@memori.ai/memori-react 9.0.0-alpha.10 → 9.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +270 -0
- package/dist/components/Chat/Chat.css +19 -0
- package/dist/components/ChatBubble/ChatBubble.js +11 -23
- package/dist/components/ChatBubble/ChatBubble.js.map +1 -1
- package/dist/components/ChatInputs/ChatInputs.css +77 -3
- package/dist/components/ChatTextArea/ChatTextArea.css +5 -25
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +7 -2
- package/dist/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +31 -15
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +181 -150
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +7 -7
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.css +11 -2
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +1 -0
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js +1 -1
- package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js.map +1 -1
- package/dist/components/MemoriWidget/MemoriWidget.js +120 -116
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/dist/components/MicrophoneButton/MicrophoneButton.css +22 -0
- package/dist/components/PoweredBy/PoweredBy.css +1 -8
- package/dist/components/StartPanel/StartPanel.js +1 -1
- package/dist/components/StartPanel/StartPanel.js.map +1 -1
- package/dist/components/layouts/Chat.js +6 -1
- package/dist/components/layouts/Chat.js.map +1 -1
- package/dist/components/layouts/WebsiteAssistant/website-assistant.css +5 -5
- package/dist/components/layouts/chat.css +98 -3
- package/dist/components/layouts/fullpage.css +7 -7
- package/dist/components/layouts/hidden-chat.css +2 -2
- package/dist/components/layouts/zoomed-full-body.css +6 -6
- package/dist/helpers/media.js +18 -3
- package/dist/helpers/media.js.map +1 -1
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/esm/components/Chat/Chat.css +19 -0
- package/esm/components/ChatBubble/ChatBubble.js +12 -24
- package/esm/components/ChatBubble/ChatBubble.js.map +1 -1
- package/esm/components/ChatInputs/ChatInputs.css +77 -3
- package/esm/components/ChatTextArea/ChatTextArea.css +5 -25
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +7 -2
- package/esm/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +31 -15
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +181 -150
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js +8 -8
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.js.map +1 -1
- package/esm/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.css +11 -2
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +1 -0
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js +2 -2
- package/esm/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js.map +1 -1
- package/esm/components/MemoriWidget/MemoriWidget.js +121 -117
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
- package/esm/components/MicrophoneButton/MicrophoneButton.css +22 -0
- package/esm/components/PoweredBy/PoweredBy.css +1 -8
- package/esm/components/StartPanel/StartPanel.js +1 -1
- package/esm/components/StartPanel/StartPanel.js.map +1 -1
- package/esm/components/layouts/Chat.js +6 -1
- package/esm/components/layouts/Chat.js.map +1 -1
- package/esm/components/layouts/WebsiteAssistant/website-assistant.css +5 -5
- package/esm/components/layouts/chat.css +98 -3
- package/esm/components/layouts/fullpage.css +7 -7
- package/esm/components/layouts/hidden-chat.css +2 -2
- package/esm/components/layouts/zoomed-full-body.css +6 -6
- package/esm/helpers/media.js +18 -3
- package/esm/helpers/media.js.map +1 -1
- package/esm/index.js +17 -17
- package/esm/index.js.map +1 -1
- package/esm/styles.css +1 -1
- package/esm/version.d.ts +1 -1
- package/esm/version.js +1 -1
- package/package.json +2 -2
- package/src/__snapshots__/index.test.tsx.snap +0 -50
- package/src/components/Chat/Chat.css +19 -0
- package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +10 -10
- package/src/components/ChatBubble/ChatBubble.test.tsx +25 -1
- package/src/components/ChatBubble/ChatBubble.tsx +20 -27
- package/src/components/ChatInputs/ChatInputs.css +77 -3
- package/src/components/ChatTextArea/ChatTextArea.css +5 -25
- package/src/components/MemoriArtifactSystem/ArtifactDrawer.stories.tsx +1 -1
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +7 -2
- package/src/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +31 -15
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +181 -150
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +63 -74
- package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.css +11 -2
- package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +1 -0
- package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.tsx +2 -2
- package/src/components/MemoriWidget/MemoriWidget.tsx +8 -1
- package/src/components/MicrophoneButton/MicrophoneButton.css +22 -0
- package/src/components/PoweredBy/PoweredBy.css +1 -8
- package/src/components/StartPanel/StartPanel.tsx +1 -1
- package/src/components/layouts/Chat.tsx +14 -1
- package/src/components/layouts/HiddenChat.tsx +1 -1
- package/src/components/layouts/WebsiteAssistant/__snapshots__/WebsiteAssistant.test.tsx.snap +10 -0
- package/src/components/layouts/WebsiteAssistant/website-assistant.css +5 -5
- package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +17 -2
- package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +30 -2
- package/src/components/layouts/__snapshots__/HiddenChat.test.tsx.snap +10 -0
- package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +15 -1
- package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +15 -1
- package/src/components/layouts/chat.css +98 -3
- package/src/components/layouts/fullpage.css +7 -7
- package/src/components/layouts/hidden-chat.css +2 -2
- package/src/components/layouts/layouts.stories.tsx +8 -8
- package/src/components/layouts/zoomed-full-body.css +6 -6
- package/src/helpers/media.test.ts +36 -0
- package/src/helpers/media.ts +39 -12
- package/src/index.tsx +1 -5
- package/src/styles.css +18 -5
- package/src/version.ts +1 -1
package/dist/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.css
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
.memori-tab-switch {
|
|
2
2
|
display: flex;
|
|
3
|
+
width: auto;
|
|
3
4
|
max-width: fit-content;
|
|
5
|
+
flex: 0 0 auto;
|
|
4
6
|
align-items: center;
|
|
5
|
-
justify-content:
|
|
7
|
+
justify-content: flex-start;
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
.memori-tab-switch__list {
|
|
9
11
|
display: flex;
|
|
12
|
+
width: auto;
|
|
13
|
+
flex: 0 0 auto;
|
|
10
14
|
gap: var(--memori-spacing-xs);
|
|
11
15
|
}
|
|
12
16
|
|
|
17
|
+
.memori-tabs[data-memori-variant='segmented'] .memori-tabs__list--horizontal {
|
|
18
|
+
background-color: transparent;
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
.memori-tab-switch__tab {
|
|
14
|
-
min-width:
|
|
22
|
+
min-width: 40px;
|
|
23
|
+
flex: 0 0 auto;
|
|
15
24
|
}
|
|
16
25
|
|
|
17
26
|
.memori-tab-switch__icon {
|
|
@@ -127,6 +127,7 @@
|
|
|
127
127
|
min-height: 0;
|
|
128
128
|
flex: 1;
|
|
129
129
|
padding: 1rem;
|
|
130
|
+
background: color-mix(in srgb, var(--memori-text-color) 4%, var(--memori-secondary-background));
|
|
130
131
|
color: var(--memori-text-color);
|
|
131
132
|
font-family: var(--memori-font-family);
|
|
132
133
|
line-height: 1.6;
|
|
@@ -26,7 +26,7 @@ const ArtifactPreview = ({ artifact, activeTab }) => {
|
|
|
26
26
|
}
|
|
27
27
|
default:
|
|
28
28
|
return ((0, jsx_runtime_1.jsx)("div", { className: "memori-artifact-preview-text", dangerouslySetInnerHTML: {
|
|
29
|
-
__html: artifact.content,
|
|
29
|
+
__html: (0, message_1.sanitizeMsg)(artifact.content),
|
|
30
30
|
} }));
|
|
31
31
|
}
|
|
32
32
|
}, [artifact]);
|
package/dist/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArtifactPreview.js","sourceRoot":"","sources":["../../../../../src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.tsx"],"names":[],"mappings":";;;;AAMA,iCAAqD;AACrD,iDAA+C;AAC/C,oEAA4B;AAI5B,+EAA+C;AAE/C,
|
|
1
|
+
{"version":3,"file":"ArtifactPreview.js","sourceRoot":"","sources":["../../../../../src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.tsx"],"names":[],"mappings":";;;;AAMA,iCAAqD;AACrD,iDAA+C;AAC/C,oEAA4B;AAI5B,+EAA+C;AAE/C,yDAAqE;AAErE,MAAM,eAAe,GAGhB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;IAC/B,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAK/B,MAAM,aAAa,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACrC,QAAQ,QAAQ,CAAC,QAAQ,EAAE,CAAC;YAC1B,KAAK,MAAM;gBACT,OAAO,CACL,mCACE,SAAS,EAAC,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ACF,CACP,IACG,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC"}
|
|
@@ -1616,7 +1616,11 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
1616
1616
|
}`);
|
|
1617
1617
|
}
|
|
1618
1618
|
if (integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.blurBackground) {
|
|
1619
|
-
integrationStylesheetParts.push(
|
|
1619
|
+
integrationStylesheetParts.push(`.memori-widget .memori-chat--history--has-global-background::before,
|
|
1620
|
+
.memori-widget .memori-chat-layout--main--has-background::before {
|
|
1621
|
+
filter: blur(5px);
|
|
1622
|
+
transform: scale(1.06);
|
|
1623
|
+
}`);
|
|
1620
1624
|
}
|
|
1621
1625
|
const integrationStylesheet = `@layer integration {
|
|
1622
1626
|
${integrationStylesheetParts.join('\n ')}
|
|
@@ -2362,132 +2366,132 @@ const MemoriWidget = ({ memori, memoriConfigs, ownerUserID, ownerUserName, tenan
|
|
|
2362
2366
|
}), "data-theme": widgetTheme, "data-memori-name": memori === null || memori === void 0 ? void 0 : memori.name, "data-memori-id": memori === null || memori === void 0 ? void 0 : memori.engineMemoriID, "data-memori-secondary-id": memori === null || memori === void 0 ? void 0 : memori.memoriID, "data-memori-session-id": sessionId, "data-memori-integration": integration === null || integration === void 0 ? void 0 : integration.integrationID, "data-memori-engine-state": JSON.stringify({
|
|
2363
2367
|
...currentDialogState,
|
|
2364
2368
|
sessionID: sessionId,
|
|
2365
|
-
}), style: { height }, children: (0, jsx_runtime_1.
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
LANG: userLang,
|
|
2388
|
-
PATHNAME: (_a = window.location.pathname) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
|
|
2389
|
-
ROUTE: ((_d = (_c = (_b = window.location.pathname) === null || _b === void 0 ? void 0 : _b.split('/')) === null || _c === void 0 ? void 0 : _c.pop()) === null || _d === void 0 ? void 0 : _d.toUpperCase()) || '',
|
|
2390
|
-
...(initialContextVars || {}),
|
|
2391
|
-
}, initialQuestion, birthDate)
|
|
2392
|
-
.then(state => {
|
|
2393
|
-
if (!(state === null || state === void 0 ? void 0 : state.sessionID)) {
|
|
2394
|
-
throw new Error('AUTH_FAILED');
|
|
2395
|
-
}
|
|
2396
|
-
setAuthModalState(null);
|
|
2397
|
-
if (state === null || state === void 0 ? void 0 : state.dialogState) {
|
|
2398
|
-
setHasUserActivatedSpeak(true);
|
|
2399
|
-
}
|
|
2400
|
-
else {
|
|
2401
|
-
onClickStart(state);
|
|
2402
|
-
}
|
|
2403
|
-
})
|
|
2404
|
-
.catch(error => {
|
|
2405
|
-
if (!(error instanceof Error) ||
|
|
2406
|
-
error.message !== 'AUTH_FAILED') {
|
|
2407
|
-
setGotErrorInOpening(true);
|
|
2408
|
-
}
|
|
2409
|
-
throw error;
|
|
2410
|
-
});
|
|
2411
|
-
}, minimumNumberOfRecoveryTokens: (_17 = memori === null || memori === void 0 ? void 0 : memori.minimumNumberOfRecoveryTokens) !== null && _17 !== void 0 ? _17 : 1 })), isClient && ((0, jsx_runtime_1.jsx)(AgeVerificationModal_1.default, { visible: showAgeVerification, minAge: minAge, onClose: birthDate => {
|
|
2412
|
-
var _a, _b, _c, _d;
|
|
2413
|
-
if (birthDate) {
|
|
2414
|
-
setBirthDate(birthDate);
|
|
2415
|
-
(0, configuration_1.setLocalConfig)('birthDate', birthDate);
|
|
2416
|
-
reopenSession(!sessionId, memoriPassword || memoriPwd || (memori === null || memori === void 0 ? void 0 : memori.secretToken), memoriTokens, personification === null || personification === void 0 ? void 0 : personification.tag, personification === null || personification === void 0 ? void 0 : personification.pin, {
|
|
2369
|
+
}), style: { height }, children: (0, jsx_runtime_1.jsxs)(ui_1.MemoriUIProvider, { container: widgetRootEl, theme: widgetTheme, children: [(0, jsx_runtime_1.jsx)(ui_1.AlertViewport, { placement: "top-end", style: { zIndex: 10002 } }), (0, jsx_runtime_1.jsx)(widgetSurfaceContext_1.WidgetSurfaceProvider, { value: widgetSurfaceEl, children: (0, jsx_runtime_1.jsxs)("div", { ref: setWidgetSurfaceEl, className: "memori-widget__surface", children: [(0, jsx_runtime_1.jsx)(Layout, { Header: Header_1.default, headerProps: headerProps, Avatar: Avatar_1.default, avatarProps: avatarProps, Chat: Chat_1.default, chatProps: chatProps, StartPanel: StartPanel_1.default, startPanelProps: startPanelProps, integrationStyle: integrationStyle, integrationBackground: integrationBackground, poweredBy: poweredBy, autoStart: autoStart, sessionId: sessionId, hasUserActivatedSpeak: hasUserActivatedSpeak, loading: loading, avatar3dHidden: avatar3dHidden !== null && avatar3dHidden !== void 0 ? avatar3dHidden : integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.avatar_3d_hidden, totemContentMaxWidth: integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.totemContentMaxWidth }), (0, jsx_runtime_1.jsx)(ArtifactAPI_1.ArtifactAPIBridge, { pushMessage: (message) => {
|
|
2370
|
+
setHistory(history => {
|
|
2371
|
+
if (!history.length)
|
|
2372
|
+
return history;
|
|
2373
|
+
const lastMessage = history[history.length - 1];
|
|
2374
|
+
if (!lastMessage || lastMessage.fromUser)
|
|
2375
|
+
return history;
|
|
2376
|
+
const updatedLastMessage = {
|
|
2377
|
+
...lastMessage,
|
|
2378
|
+
text: lastMessage.text + message.text,
|
|
2379
|
+
};
|
|
2380
|
+
return [...history.slice(0, -1), updatedLastMessage];
|
|
2381
|
+
});
|
|
2382
|
+
} }), (0, jsx_runtime_1.jsx)("audio", { id: "memori-audio", style: { display: 'none' }, src: "https://aisuru.com/intro.mp3" }), isClient && ((0, jsx_runtime_1.jsx)(Auth_1.default, { withModal: true, pwdOrTokens: authModalState, openModal: !!authModalState, setPwdOrTokens: setAuthModalState, showTokens: memori.privacyType === 'SECRET', onFinish: (values) => {
|
|
2383
|
+
var _a, _b, _c, _d;
|
|
2384
|
+
if (values['password'])
|
|
2385
|
+
setMemoriPwd(values['password']);
|
|
2386
|
+
if (values['password'])
|
|
2387
|
+
memoriPassword = values['password'];
|
|
2388
|
+
if (values['tokens'])
|
|
2389
|
+
setMemoriTokens(values['tokens']);
|
|
2390
|
+
return reopenSession(!sessionId, values['password'], values['tokens'], personification === null || personification === void 0 ? void 0 : personification.tag, personification === null || personification === void 0 ? void 0 : personification.pin, {
|
|
2417
2391
|
LANG: userLang,
|
|
2418
2392
|
PATHNAME: (_a = window.location.pathname) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
|
|
2419
2393
|
ROUTE: ((_d = (_c = (_b = window.location.pathname) === null || _b === void 0 ? void 0 : _b.split('/')) === null || _c === void 0 ? void 0 : _c.pop()) === null || _d === void 0 ? void 0 : _d.toUpperCase()) || '',
|
|
2420
2394
|
...(initialContextVars || {}),
|
|
2421
2395
|
}, initialQuestion, birthDate)
|
|
2422
2396
|
.then(state => {
|
|
2423
|
-
|
|
2397
|
+
if (!(state === null || state === void 0 ? void 0 : state.sessionID)) {
|
|
2398
|
+
throw new Error('AUTH_FAILED');
|
|
2399
|
+
}
|
|
2424
2400
|
setAuthModalState(null);
|
|
2425
|
-
|
|
2401
|
+
if (state === null || state === void 0 ? void 0 : state.dialogState) {
|
|
2402
|
+
setHasUserActivatedSpeak(true);
|
|
2403
|
+
}
|
|
2404
|
+
else {
|
|
2405
|
+
onClickStart(state);
|
|
2406
|
+
}
|
|
2426
2407
|
})
|
|
2427
|
-
.catch(
|
|
2428
|
-
|
|
2429
|
-
|
|
2408
|
+
.catch(error => {
|
|
2409
|
+
if (!(error instanceof Error) ||
|
|
2410
|
+
error.message !== 'AUTH_FAILED') {
|
|
2411
|
+
setGotErrorInOpening(true);
|
|
2412
|
+
}
|
|
2413
|
+
throw error;
|
|
2430
2414
|
});
|
|
2431
|
-
}
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
var _a, _b;
|
|
2451
|
-
setShowLoginDrawer(false);
|
|
2452
|
-
setUser(user);
|
|
2453
|
-
setLoginToken(token);
|
|
2454
|
-
userTokenRef.current = token;
|
|
2455
|
-
(0, configuration_1.setLocalConfig)('loginToken', token);
|
|
2456
|
-
if ((state === null || state === void 0 ? void 0 : state.sessionID) &&
|
|
2457
|
-
state.sessionID !== sessionId &&
|
|
2458
|
-
(state === null || state === void 0 ? void 0 : state.dialogState)) {
|
|
2459
|
-
const username = (user === null || user === void 0 ? void 0 : user.userName) || t('login.user');
|
|
2460
|
-
pushMessage({
|
|
2461
|
-
text: '',
|
|
2462
|
-
emitter: state.dialogState.emitter,
|
|
2463
|
-
media: (_b = (_a = state.dialogState.emittedMedia) !== null && _a !== void 0 ? _a : state.dialogState.media) !== null && _b !== void 0 ? _b : [],
|
|
2464
|
-
fromUser: false,
|
|
2465
|
-
initial: t('login.successfullyLoggedIn', {
|
|
2466
|
-
username,
|
|
2467
|
-
}),
|
|
2468
|
-
contextVars: state.dialogState.contextVars,
|
|
2469
|
-
date: state.dialogState.currentDate,
|
|
2470
|
-
placeName: state.dialogState.currentPlaceName,
|
|
2471
|
-
placeLatitude: state.dialogState.currentLatitude,
|
|
2472
|
-
placeLongitude: state.dialogState.currentLongitude,
|
|
2473
|
-
placeUncertaintyKm: state.dialogState.currentUncertaintyKm,
|
|
2474
|
-
tag: state.dialogState.currentTag,
|
|
2475
|
-
memoryTags: state.dialogState.memoryTags,
|
|
2415
|
+
}, minimumNumberOfRecoveryTokens: (_17 = memori === null || memori === void 0 ? void 0 : memori.minimumNumberOfRecoveryTokens) !== null && _17 !== void 0 ? _17 : 1 })), isClient && ((0, jsx_runtime_1.jsx)(AgeVerificationModal_1.default, { visible: showAgeVerification, minAge: minAge, onClose: birthDate => {
|
|
2416
|
+
var _a, _b, _c, _d;
|
|
2417
|
+
if (birthDate) {
|
|
2418
|
+
setBirthDate(birthDate);
|
|
2419
|
+
(0, configuration_1.setLocalConfig)('birthDate', birthDate);
|
|
2420
|
+
reopenSession(!sessionId, memoriPassword || memoriPwd || (memori === null || memori === void 0 ? void 0 : memori.secretToken), memoriTokens, personification === null || personification === void 0 ? void 0 : personification.tag, personification === null || personification === void 0 ? void 0 : personification.pin, {
|
|
2421
|
+
LANG: userLang,
|
|
2422
|
+
PATHNAME: (_a = window.location.pathname) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
|
|
2423
|
+
ROUTE: ((_d = (_c = (_b = window.location.pathname) === null || _b === void 0 ? void 0 : _b.split('/')) === null || _c === void 0 ? void 0 : _c.pop()) === null || _d === void 0 ? void 0 : _d.toUpperCase()) || '',
|
|
2424
|
+
...(initialContextVars || {}),
|
|
2425
|
+
}, initialQuestion, birthDate)
|
|
2426
|
+
.then(state => {
|
|
2427
|
+
setShowAgeVerification(false);
|
|
2428
|
+
setAuthModalState(null);
|
|
2429
|
+
onClickStart(state || undefined);
|
|
2430
|
+
})
|
|
2431
|
+
.catch(() => {
|
|
2432
|
+
setShowAgeVerification(false);
|
|
2433
|
+
setGotErrorInOpening(true);
|
|
2476
2434
|
});
|
|
2477
|
-
setCurrentDialogState(state.dialogState);
|
|
2478
2435
|
}
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2436
|
+
else {
|
|
2437
|
+
setShowAgeVerification(false);
|
|
2438
|
+
setClickedStart(false);
|
|
2439
|
+
}
|
|
2440
|
+
} })), showSettingsDrawer && ((0, jsx_runtime_1.jsx)(SettingsDrawer_1.default, { layout: selectedLayout, open: !!showSettingsDrawer, onClose: () => setShowSettingsDrawer(false), microphoneMode: continuousSpeech ? 'CONTINUOUS' : 'HOLD_TO_TALK', continuousSpeechTimeout: continuousSpeechTimeout, setMicrophoneMode: mode => setContinuousSpeech(mode === 'CONTINUOUS'), setContinuousSpeechTimeout: setContinuousSpeechTimeout, controlsPosition: controlsPosition, setControlsPosition: setControlsPosition, hideEmissions: hideEmissions, setHideEmissions: setHideEmissions, avatarType: avatarType, setAvatarType: setAvatarType, enablePositionControls: enablePositionControls, setEnablePositionControls: setEnablePositionControls, isAvatar3d: !!(integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.avatarURL), additionalSettings: additionalSettings, speakerMuted: speakerMuted })), showChatHistoryDrawer && ((0, jsx_runtime_1.jsx)(ChatHistory_1.default, { open: !!showChatHistoryDrawer, onClose: () => setShowChatHistoryDrawer(false), resumeSession: chatLog => {
|
|
2441
|
+
setChatLogID(chatLog.chatLogID);
|
|
2442
|
+
onClickStart(undefined, false, chatLog);
|
|
2443
|
+
setShowChatHistoryDrawer(false);
|
|
2444
|
+
}, 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'
|
|
2445
|
+
? 'memori-drawer--above-website-assistant'
|
|
2446
|
+
: undefined, onLogin: (user, token) => {
|
|
2447
|
+
var _a, _b, _c, _d;
|
|
2448
|
+
reopenSession(false, memoriPassword || memoriPwd || (memori === null || memori === void 0 ? void 0 : memori.secretToken), [], personification === null || personification === void 0 ? void 0 : personification.tag, personification === null || personification === void 0 ? void 0 : personification.pin, {
|
|
2449
|
+
LANG: userLang,
|
|
2450
|
+
PATHNAME: (_a = window.location.pathname) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
|
|
2451
|
+
ROUTE: ((_d = (_c = (_b = window.location.pathname) === null || _b === void 0 ? void 0 : _b.split('/')) === null || _c === void 0 ? void 0 : _c.pop()) === null || _d === void 0 ? void 0 : _d.toUpperCase()) || '',
|
|
2452
|
+
...(initialContextVars || {}),
|
|
2453
|
+
}, undefined, birthDate, { loginToken: token }, undefined, sessionId).then(state => {
|
|
2454
|
+
var _a, _b;
|
|
2455
|
+
setShowLoginDrawer(false);
|
|
2456
|
+
setUser(user);
|
|
2457
|
+
setLoginToken(token);
|
|
2458
|
+
userTokenRef.current = token;
|
|
2459
|
+
(0, configuration_1.setLocalConfig)('loginToken', token);
|
|
2460
|
+
if ((state === null || state === void 0 ? void 0 : state.sessionID) &&
|
|
2461
|
+
state.sessionID !== sessionId &&
|
|
2462
|
+
(state === null || state === void 0 ? void 0 : state.dialogState)) {
|
|
2463
|
+
const username = (user === null || user === void 0 ? void 0 : user.userName) || t('login.user');
|
|
2464
|
+
pushMessage({
|
|
2465
|
+
text: '',
|
|
2466
|
+
emitter: state.dialogState.emitter,
|
|
2467
|
+
media: (_b = (_a = state.dialogState.emittedMedia) !== null && _a !== void 0 ? _a : state.dialogState.media) !== null && _b !== void 0 ? _b : [],
|
|
2468
|
+
fromUser: false,
|
|
2469
|
+
initial: t('login.successfullyLoggedIn', {
|
|
2470
|
+
username,
|
|
2471
|
+
}),
|
|
2472
|
+
contextVars: state.dialogState.contextVars,
|
|
2473
|
+
date: state.dialogState.currentDate,
|
|
2474
|
+
placeName: state.dialogState.currentPlaceName,
|
|
2475
|
+
placeLatitude: state.dialogState.currentLatitude,
|
|
2476
|
+
placeLongitude: state.dialogState.currentLongitude,
|
|
2477
|
+
placeUncertaintyKm: state.dialogState.currentUncertaintyKm,
|
|
2478
|
+
tag: state.dialogState.currentTag,
|
|
2479
|
+
memoryTags: state.dialogState.memoryTags,
|
|
2480
|
+
});
|
|
2481
|
+
setCurrentDialogState(state.dialogState);
|
|
2482
|
+
}
|
|
2483
|
+
});
|
|
2484
|
+
}, setUser: setUser, onLogout: () => {
|
|
2485
|
+
if (!loginToken)
|
|
2486
|
+
return;
|
|
2487
|
+
client.backend.pwlUserLogout(loginToken).then(() => {
|
|
2488
|
+
setShowLoginDrawer(false);
|
|
2489
|
+
setUser(undefined);
|
|
2490
|
+
setLoginToken(undefined);
|
|
2491
|
+
userTokenRef.current = undefined;
|
|
2492
|
+
(0, configuration_1.removeLocalConfig)('loginToken');
|
|
2493
|
+
});
|
|
2494
|
+
} }))] }) })] }) }));
|
|
2491
2495
|
};
|
|
2492
2496
|
exports.default = MemoriWidget;
|
|
2493
2497
|
//# sourceMappingURL=MemoriWidget.js.map
|