@bytexbyte/nxtlinq-ai-agent-ui-react-development 0.1.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.
- package/dist/NxtlinqAgentChat.d.ts +26 -0
- package/dist/NxtlinqAgentChat.d.ts.map +1 -0
- package/dist/NxtlinqAgentChat.js +28 -0
- package/dist/components/AgentAssistantShell.d.ts +5 -0
- package/dist/components/AgentAssistantShell.d.ts.map +1 -0
- package/dist/components/AgentAssistantShell.js +52 -0
- package/dist/components/AgentComposer.d.ts +3 -0
- package/dist/components/AgentComposer.d.ts.map +1 -0
- package/dist/components/AgentComposer.js +60 -0
- package/dist/components/AgentMessageList.d.ts +3 -0
- package/dist/components/AgentMessageList.d.ts.map +1 -0
- package/dist/components/AgentMessageList.js +37 -0
- package/dist/components/AgentRemoteAudio.d.ts +4 -0
- package/dist/components/AgentRemoteAudio.d.ts.map +1 -0
- package/dist/components/AgentRemoteAudio.js +34 -0
- package/dist/components/AgentVoiceBar.d.ts +3 -0
- package/dist/components/AgentVoiceBar.d.ts.map +1 -0
- package/dist/components/AgentVoiceBar.js +91 -0
- package/dist/components/PresetMessageChips.d.ts +3 -0
- package/dist/components/PresetMessageChips.d.ts.map +1 -0
- package/dist/components/PresetMessageChips.js +23 -0
- package/dist/context/AgentAssistantContext.d.ts +32 -0
- package/dist/context/AgentAssistantContext.d.ts.map +1 -0
- package/dist/context/AgentAssistantContext.js +159 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/legacy/assets/images/adiSideItalicDataUri.d.ts +2 -0
- package/dist/legacy/assets/images/adiSideItalicDataUri.d.ts.map +1 -0
- package/dist/legacy/assets/images/adiSideItalicDataUri.js +1 -0
- package/dist/legacy/chatbot/ChatBot.d.ts +5 -0
- package/dist/legacy/chatbot/ChatBot.d.ts.map +1 -0
- package/dist/legacy/chatbot/ChatBot.js +35 -0
- package/dist/legacy/chatbot/context/ChatBotContext.d.ts +5 -0
- package/dist/legacy/chatbot/context/ChatBotContext.d.ts.map +1 -0
- package/dist/legacy/chatbot/context/ChatBotContext.js +2908 -0
- package/dist/legacy/chatbot/types/ChatBotTypes.d.ts +166 -0
- package/dist/legacy/chatbot/types/ChatBotTypes.d.ts.map +1 -0
- package/dist/legacy/chatbot/types/ChatBotTypes.js +1 -0
- package/dist/legacy/chatbot/ui/BerifyMeModal.d.ts +17 -0
- package/dist/legacy/chatbot/ui/BerifyMeModal.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/BerifyMeModal.js +110 -0
- package/dist/legacy/chatbot/ui/ChatBotUI.d.ts +3 -0
- package/dist/legacy/chatbot/ui/ChatBotUI.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/ChatBotUI.js +625 -0
- package/dist/legacy/chatbot/ui/MessageInput.d.ts +3 -0
- package/dist/legacy/chatbot/ui/MessageInput.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/MessageInput.js +321 -0
- package/dist/legacy/chatbot/ui/MessageList.d.ts +4 -0
- package/dist/legacy/chatbot/ui/MessageList.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/MessageList.js +455 -0
- package/dist/legacy/chatbot/ui/ModelSelector.d.ts +4 -0
- package/dist/legacy/chatbot/ui/ModelSelector.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/ModelSelector.js +122 -0
- package/dist/legacy/chatbot/ui/NotificationModal.d.ts +15 -0
- package/dist/legacy/chatbot/ui/NotificationModal.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/NotificationModal.js +53 -0
- package/dist/legacy/chatbot/ui/PermissionForm.d.ts +8 -0
- package/dist/legacy/chatbot/ui/PermissionForm.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/PermissionForm.js +465 -0
- package/dist/legacy/chatbot/ui/PresetMessages.d.ts +4 -0
- package/dist/legacy/chatbot/ui/PresetMessages.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/PresetMessages.js +33 -0
- package/dist/legacy/chatbot/ui/VoiceModePanel.d.ts +3 -0
- package/dist/legacy/chatbot/ui/VoiceModePanel.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/VoiceModePanel.js +95 -0
- package/dist/legacy/chatbot/ui/styles/isolatedStyles.d.ts +73 -0
- package/dist/legacy/chatbot/ui/styles/isolatedStyles.d.ts.map +1 -0
- package/dist/legacy/chatbot/ui/styles/isolatedStyles.js +985 -0
- package/dist/legacy/index.d.ts +14 -0
- package/dist/legacy/index.d.ts.map +1 -0
- package/dist/legacy/index.js +12 -0
- package/dist/theme/defaultTheme.d.ts +3 -0
- package/dist/theme/defaultTheme.d.ts.map +1 -0
- package/dist/theme/defaultTheme.js +20 -0
- package/dist/types.d.ts +62 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/voice/useVoiceConnectOrchestration.d.ts +21 -0
- package/dist/voice/useVoiceConnectOrchestration.d.ts.map +1 -0
- package/dist/voice/useVoiceConnectOrchestration.js +86 -0
- package/dist/voice/useVoiceMicState.d.ts +15 -0
- package/dist/voice/useVoiceMicState.d.ts.map +1 -0
- package/dist/voice/useVoiceMicState.js +94 -0
- package/dist/voice/useVoiceSilenceCommit.d.ts +10 -0
- package/dist/voice/useVoiceSilenceCommit.d.ts.map +1 -0
- package/dist/voice/useVoiceSilenceCommit.js +67 -0
- package/dist/voice/useVoiceTranscriptMessages.d.ts +16 -0
- package/dist/voice/useVoiceTranscriptMessages.d.ts.map +1 -0
- package/dist/voice/useVoiceTranscriptMessages.js +129 -0
- package/dist/voice/useWsRealtimeAudio.d.ts +18 -0
- package/dist/voice/useWsRealtimeAudio.d.ts.map +1 -0
- package/dist/voice/useWsRealtimeAudio.js +102 -0
- package/dist/voice/voiceMicConstants.d.ts +4 -0
- package/dist/voice/voiceMicConstants.d.ts.map +1 -0
- package/dist/voice/voiceMicConstants.js +10 -0
- package/dist/voice/ws/BrowserWsPcmPlayer.d.ts +23 -0
- package/dist/voice/ws/BrowserWsPcmPlayer.d.ts.map +1 -0
- package/dist/voice/ws/BrowserWsPcmPlayer.js +137 -0
- package/dist/voice/ws/BrowserWsPcmRecorder.d.ts +17 -0
- package/dist/voice/ws/BrowserWsPcmRecorder.d.ts.map +1 -0
- package/dist/voice/ws/BrowserWsPcmRecorder.js +71 -0
- package/dist/voice/ws/float32ToPcm16.d.ts +2 -0
- package/dist/voice/ws/float32ToPcm16.d.ts.map +1 -0
- package/dist/voice/ws/float32ToPcm16.js +8 -0
- package/dist/voice/ws/voiceSilenceConstants.d.ts +5 -0
- package/dist/voice/ws/voiceSilenceConstants.d.ts.map +1 -0
- package/dist/voice/ws/voiceSilenceConstants.js +4 -0
- package/dist/voice/ws/wsRealtimeConstants.d.ts +2 -0
- package/dist/voice/ws/wsRealtimeConstants.d.ts.map +1 -0
- package/dist/voice/ws/wsRealtimeConstants.js +1 -0
- package/package.json +60 -0
- package/src/NxtlinqAgentChat.tsx +79 -0
- package/src/components/AgentAssistantShell.tsx +104 -0
- package/src/components/AgentComposer.tsx +134 -0
- package/src/components/AgentMessageList.tsx +78 -0
- package/src/components/AgentRemoteAudio.tsx +34 -0
- package/src/components/AgentVoiceBar.tsx +173 -0
- package/src/components/PresetMessageChips.tsx +41 -0
- package/src/context/AgentAssistantContext.tsx +276 -0
- package/src/index.ts +78 -0
- package/src/legacy/assets/images/adiSideItalicDataUri.ts +1 -0
- package/src/legacy/chatbot/ChatBot.tsx +61 -0
- package/src/legacy/chatbot/context/ChatBotContext.tsx +3227 -0
- package/src/legacy/chatbot/types/ChatBotTypes.ts +195 -0
- package/src/legacy/chatbot/ui/BerifyMeModal.tsx +145 -0
- package/src/legacy/chatbot/ui/ChatBotUI.tsx +949 -0
- package/src/legacy/chatbot/ui/MessageInput.tsx +517 -0
- package/src/legacy/chatbot/ui/MessageList.tsx +764 -0
- package/src/legacy/chatbot/ui/ModelSelector.tsx +190 -0
- package/src/legacy/chatbot/ui/NotificationModal.tsx +110 -0
- package/src/legacy/chatbot/ui/PermissionForm.tsx +632 -0
- package/src/legacy/chatbot/ui/PresetMessages.tsx +50 -0
- package/src/legacy/chatbot/ui/VoiceModePanel.tsx +168 -0
- package/src/legacy/chatbot/ui/styles/isolatedStyles.ts +1058 -0
- package/src/legacy/index.ts +26 -0
- package/src/theme/defaultTheme.ts +22 -0
- package/src/types.ts +65 -0
- package/src/voice/useVoiceConnectOrchestration.ts +117 -0
- package/src/voice/useVoiceMicState.ts +117 -0
- package/src/voice/useVoiceTranscriptMessages.ts +173 -0
- package/src/voice/voiceMicConstants.ts +13 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
import { createNotification, getNotificationIcon } from '@bytexbyte/nxtlinq-ai-agent-web-development';
|
|
4
|
+
import { actionButton, modalOverlay } from './styles/isolatedStyles';
|
|
5
|
+
export const NotificationModal = ({ type, title, message, onClose, onConfirm, showConfirm = false, confirmText = 'Confirm', cancelText = 'Cancel' }) => {
|
|
6
|
+
const icon = getNotificationIcon(type);
|
|
7
|
+
const notification = createNotification(type, message);
|
|
8
|
+
return (_jsx("div", { css: modalOverlay, children: _jsxs("div", { css: css `
|
|
9
|
+
background-color: white !important;
|
|
10
|
+
padding: 24px !important;
|
|
11
|
+
border-radius: 12px !important;
|
|
12
|
+
width: 400px !important;
|
|
13
|
+
max-width: 90% !important;
|
|
14
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
|
|
15
|
+
text-align: center !important;
|
|
16
|
+
`, children: [_jsx("div", { css: css `
|
|
17
|
+
font-size: 48px !important;
|
|
18
|
+
margin-bottom: 16px !important;
|
|
19
|
+
`, children: icon }), _jsx("h3", { css: css `
|
|
20
|
+
margin: 0 0 12px 0 !important;
|
|
21
|
+
font-size: 20px !important;
|
|
22
|
+
font-weight: 600 !important;
|
|
23
|
+
color: #1a1a1a !important;
|
|
24
|
+
`, children: title }), _jsx("p", { css: css `
|
|
25
|
+
margin: 0 0 24px 0 !important;
|
|
26
|
+
font-size: 16px !important;
|
|
27
|
+
color: #666 !important;
|
|
28
|
+
line-height: 1.5 !important;
|
|
29
|
+
`, children: message }), _jsxs("div", { css: css `
|
|
30
|
+
display: flex !important;
|
|
31
|
+
justify-content: center !important;
|
|
32
|
+
gap: 12px !important;
|
|
33
|
+
`, children: [showConfirm && onConfirm && (_jsx("button", { onClick: onConfirm, css: css `
|
|
34
|
+
${actionButton}
|
|
35
|
+
background-color: ${type === 'error' ? '#dc3545' : '#007bff'} !important;
|
|
36
|
+
border-radius: 8px !important;
|
|
37
|
+
|
|
38
|
+
&:hover {
|
|
39
|
+
background-color: ${type === 'error' ? '#c82333' : '#0056b3'} !important;
|
|
40
|
+
}
|
|
41
|
+
`, children: confirmText })), _jsx("button", { onClick: onClose, css: css `
|
|
42
|
+
${actionButton}
|
|
43
|
+
background-color: ${showConfirm ? '#f8f9fa' : '#007bff'} !important;
|
|
44
|
+
color: ${showConfirm ? '#666' : 'white'} !important;
|
|
45
|
+
border: ${showConfirm ? '1px solid #dee2e6' : 'none'} !important;
|
|
46
|
+
border-radius: 8px !important;
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
background-color: ${showConfirm ? '#e9ecef' : '#0056b3'} !important;
|
|
50
|
+
border-color: ${showConfirm ? '#ced4da' : 'none'} !important;
|
|
51
|
+
}
|
|
52
|
+
`, children: cancelText })] })] }) }));
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionForm.d.ts","sourceRoot":"","sources":["../../../../src/legacy/chatbot/ui/PermissionForm.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,UAAU,mBAAmB;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA4mBxD,CAAC"}
|
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { css } from '@emotion/react';
|
|
5
|
+
import { useChatBot } from '../context/ChatBotContext';
|
|
6
|
+
import { walletTextUtils } from '@bytexbyte/nxtlinq-ai-agent-web-development';
|
|
7
|
+
import { actionButton } from './styles/isolatedStyles';
|
|
8
|
+
export const PermissionForm = ({ onClose }) => {
|
|
9
|
+
const { hitAddress, permissions, setPermissions, setIsDisabled, onSave, onConnectWallet, onSignIn, isNeedSignInWithWallet, walletInfo, onVerifyWallet, serviceId, nxtlinqApi, permissionGroup, isAITLoading, isWalletLoading = false, refreshAIT, props } = useChatBot();
|
|
10
|
+
const [availablePermissions, setAvailablePermissions] = React.useState([]);
|
|
11
|
+
const [isSaving, setIsSaving] = React.useState(false);
|
|
12
|
+
const [tempPermissions, setTempPermissions] = React.useState(permissions);
|
|
13
|
+
const [hasUserInteracted, setHasUserInteracted] = React.useState(false);
|
|
14
|
+
// Check if ALL permission is selected
|
|
15
|
+
const isAllSelected = tempPermissions.includes('ALL');
|
|
16
|
+
// Update temp permissions when permissions change, but only if user hasn't interacted
|
|
17
|
+
React.useEffect(() => {
|
|
18
|
+
if (!hasUserInteracted) {
|
|
19
|
+
setTempPermissions(permissions);
|
|
20
|
+
}
|
|
21
|
+
}, [permissions, hasUserInteracted]);
|
|
22
|
+
// When ALL is selected, automatically select all other permissions
|
|
23
|
+
// This handles cases where ALL is set from initial permissions or when availablePermissions loads
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
if (isAllSelected && availablePermissions.length > 0) {
|
|
26
|
+
const allPermissionLabels = availablePermissions.map(p => p.label);
|
|
27
|
+
const currentPermissionSet = new Set(tempPermissions);
|
|
28
|
+
// Check if all permissions are already selected
|
|
29
|
+
const hasAllPermissions = allPermissionLabels.every(label => currentPermissionSet.has(label));
|
|
30
|
+
if (!hasAllPermissions) {
|
|
31
|
+
// Add all permissions (this will include ALL and all others)
|
|
32
|
+
setTempPermissions([...allPermissionLabels].sort());
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
|
+
}, [isAllSelected, availablePermissions.length]);
|
|
37
|
+
const fetchAvailablePermissions = async () => {
|
|
38
|
+
if (!serviceId)
|
|
39
|
+
return;
|
|
40
|
+
try {
|
|
41
|
+
const result = await nxtlinqApi.permissions.getServicePermissions({
|
|
42
|
+
serviceId,
|
|
43
|
+
...(permissionGroup && { groupName: permissionGroup })
|
|
44
|
+
});
|
|
45
|
+
if ('error' in result) {
|
|
46
|
+
console.error('Failed to fetch permissions:', result.error);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
setAvailablePermissions(result.permissions);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
console.error('Error fetching permissions:', error);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
fetchAvailablePermissions();
|
|
57
|
+
}, [serviceId, nxtlinqApi, permissionGroup]);
|
|
58
|
+
// Refresh wallet info when component mounts or when hitAddress changes
|
|
59
|
+
React.useEffect(() => {
|
|
60
|
+
if (hitAddress) {
|
|
61
|
+
// Trigger a refresh of AIT and wallet info when the form opens
|
|
62
|
+
const refreshWalletInfo = async () => {
|
|
63
|
+
try {
|
|
64
|
+
// This will trigger refreshAIT which includes wallet info fetch
|
|
65
|
+
await refreshAIT();
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
console.error('Failed to refresh wallet info:', error);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
refreshWalletInfo();
|
|
72
|
+
}
|
|
73
|
+
}, [hitAddress]);
|
|
74
|
+
// Check if wallet IDV verification is required based on configuration
|
|
75
|
+
const requireWalletIDVVerification = props.requireWalletIDVVerification ?? true; // Default to true
|
|
76
|
+
const isWalletVerified = Boolean(walletInfo?.id);
|
|
77
|
+
const isWalletVerifiedWithBerifyme = walletInfo?.method === 'berifyme';
|
|
78
|
+
// Show verification prompt if:
|
|
79
|
+
// 1. IDV verification is required AND wallet is not verified, OR
|
|
80
|
+
// 2. IDV verification is required AND wallet is verified but not with Berifyme
|
|
81
|
+
const shouldShowVerificationPrompt = requireWalletIDVVerification && (!isWalletVerified || !isWalletVerifiedWithBerifyme);
|
|
82
|
+
const handleSave = async () => {
|
|
83
|
+
setIsSaving(true);
|
|
84
|
+
try {
|
|
85
|
+
// Update the actual permissions with temp permissions
|
|
86
|
+
setPermissions(tempPermissions);
|
|
87
|
+
await onSave(tempPermissions);
|
|
88
|
+
setHasUserInteracted(false);
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
setIsSaving(false);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const handleCancel = () => {
|
|
95
|
+
// Reset temp permissions to original permissions
|
|
96
|
+
setTempPermissions(permissions);
|
|
97
|
+
setHasUserInteracted(false);
|
|
98
|
+
onClose();
|
|
99
|
+
};
|
|
100
|
+
// Check if permissions have changed
|
|
101
|
+
const hasPermissionChanges = () => {
|
|
102
|
+
if (tempPermissions.length !== permissions.length)
|
|
103
|
+
return true;
|
|
104
|
+
return tempPermissions.some(p => !permissions.includes(p)) ||
|
|
105
|
+
permissions.some(p => !tempPermissions.includes(p));
|
|
106
|
+
};
|
|
107
|
+
// Show loading state while checking wallet status
|
|
108
|
+
if (isWalletLoading) {
|
|
109
|
+
return (_jsxs("div", { css: css `
|
|
110
|
+
background-color: white !important;
|
|
111
|
+
padding: 24px !important;
|
|
112
|
+
border-radius: 12px !important;
|
|
113
|
+
width: 480px !important;
|
|
114
|
+
max-width: 90% !important;
|
|
115
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
|
|
116
|
+
`, children: [_jsxs("div", { css: css `
|
|
117
|
+
display: flex !important;
|
|
118
|
+
justify-content: space-between !important;
|
|
119
|
+
align-items: center !important;
|
|
120
|
+
margin-bottom: 24px !important;
|
|
121
|
+
`, children: [_jsx("h3", { css: css `
|
|
122
|
+
margin: 0 !important;
|
|
123
|
+
font-size: 20px !important;
|
|
124
|
+
font-weight: 600 !important;
|
|
125
|
+
color: #1a1a1a !important;
|
|
126
|
+
`, children: "AIT Settings" }), _jsx("button", { onClick: onClose, css: css `
|
|
127
|
+
background: none !important;
|
|
128
|
+
border: none !important;
|
|
129
|
+
font-size: 24px !important;
|
|
130
|
+
cursor: pointer !important;
|
|
131
|
+
color: #666 !important;
|
|
132
|
+
padding: 4px !important;
|
|
133
|
+
display: flex !important;
|
|
134
|
+
align-items: center !important;
|
|
135
|
+
justify-content: center !important;
|
|
136
|
+
|
|
137
|
+
&:hover {
|
|
138
|
+
background-color: #f0f0f0 !important;
|
|
139
|
+
color: #333 !important;
|
|
140
|
+
}
|
|
141
|
+
`, children: "\u00D7" })] }), _jsxs("div", { css: css `
|
|
142
|
+
text-align: center !important;
|
|
143
|
+
padding: 32px 0 !important;
|
|
144
|
+
`, children: [_jsx("div", { css: css `
|
|
145
|
+
width: 64px !important;
|
|
146
|
+
height: 64px !important;
|
|
147
|
+
margin: 0 auto 16px !important;
|
|
148
|
+
background-color: #f5f5f5 !important;
|
|
149
|
+
border-radius: 50% !important;
|
|
150
|
+
display: flex !important;
|
|
151
|
+
align-items: center !important;
|
|
152
|
+
justify-content: center !important;
|
|
153
|
+
`, children: _jsx("div", { css: css `
|
|
154
|
+
width: 32px !important;
|
|
155
|
+
height: 32px !important;
|
|
156
|
+
border: 3px solid #e3e3e3 !important;
|
|
157
|
+
border-top: 3px solid #007bff !important;
|
|
158
|
+
border-radius: 50% !important;
|
|
159
|
+
animation: spin 1s linear infinite !important;
|
|
160
|
+
` }) }), _jsx("p", { css: css `
|
|
161
|
+
margin-bottom: 24px !important;
|
|
162
|
+
font-size: 16px !important;
|
|
163
|
+
color: #666 !important;
|
|
164
|
+
`, children: walletTextUtils.getWalletText('Checking wallet status...', serviceId) })] }), _jsx("style", { children: `
|
|
165
|
+
@keyframes spin {
|
|
166
|
+
0% { transform: rotate(0deg); }
|
|
167
|
+
100% { transform: rotate(360deg); }
|
|
168
|
+
}
|
|
169
|
+
` })] }));
|
|
170
|
+
}
|
|
171
|
+
return (_jsxs("div", { css: css `
|
|
172
|
+
background-color: white !important;
|
|
173
|
+
padding: 24px !important;
|
|
174
|
+
border-radius: 12px !important;
|
|
175
|
+
width: 480px !important;
|
|
176
|
+
max-width: 90% !important;
|
|
177
|
+
max-height: 90vh !important;
|
|
178
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
|
|
179
|
+
display: flex !important;
|
|
180
|
+
flex-direction: column !important;
|
|
181
|
+
overflow: hidden !important;
|
|
182
|
+
|
|
183
|
+
/* Mobile responsive adjustments */
|
|
184
|
+
@media (max-width: 768px) {
|
|
185
|
+
width: 75vw !important;
|
|
186
|
+
max-width: 75vw !important;
|
|
187
|
+
padding: 20px !important;
|
|
188
|
+
border-radius: 8px !important;
|
|
189
|
+
max-height: 65vh !important;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
@media (max-width: 480px) {
|
|
193
|
+
width: 70vw !important;
|
|
194
|
+
max-width: 70vw !important;
|
|
195
|
+
padding: 16px !important;
|
|
196
|
+
border-radius: 6px !important;
|
|
197
|
+
max-height: 60vh !important;
|
|
198
|
+
}
|
|
199
|
+
`, children: [_jsxs("div", { css: css `
|
|
200
|
+
display: flex !important;
|
|
201
|
+
justify-content: space-between !important;
|
|
202
|
+
align-items: center !important;
|
|
203
|
+
margin-bottom: 24px !important;
|
|
204
|
+
`, children: [_jsx("h3", { css: css `
|
|
205
|
+
margin: 0 !important;
|
|
206
|
+
font-size: 20px !important;
|
|
207
|
+
font-weight: 600 !important;
|
|
208
|
+
color: #1a1a1a !important;
|
|
209
|
+
`, children: "AIT Settings" }), _jsx("button", { onClick: onClose, css: css `
|
|
210
|
+
background: none !important;
|
|
211
|
+
border: none !important;
|
|
212
|
+
font-size: 24px !important;
|
|
213
|
+
cursor: pointer !important;
|
|
214
|
+
color: #666 !important;
|
|
215
|
+
padding: 8px !important;
|
|
216
|
+
display: flex !important;
|
|
217
|
+
align-items: center !important;
|
|
218
|
+
justify-content: center !important;
|
|
219
|
+
border-radius: 4px !important;
|
|
220
|
+
transition: background-color 0.2s !important;
|
|
221
|
+
min-width: 32px !important;
|
|
222
|
+
min-height: 32px !important;
|
|
223
|
+
|
|
224
|
+
&:hover {
|
|
225
|
+
background-color: #f0f0f0 !important;
|
|
226
|
+
color: #333 !important;
|
|
227
|
+
}
|
|
228
|
+
`, title: "Close", children: "\u00D7" })] }), !hitAddress ? (_jsxs("div", { css: css `
|
|
229
|
+
text-align: center !important;
|
|
230
|
+
padding: 32px 0 !important;
|
|
231
|
+
`, children: [_jsx("div", { css: css `
|
|
232
|
+
width: 64px !important;
|
|
233
|
+
height: 64px !important;
|
|
234
|
+
margin: 0 auto 16px !important;
|
|
235
|
+
background-color: #f5f5f5 !important;
|
|
236
|
+
border-radius: 50% !important;
|
|
237
|
+
display: flex !important;
|
|
238
|
+
align-items: center !important;
|
|
239
|
+
justify-content: center !important;
|
|
240
|
+
`, children: _jsx("span", { css: css `font-size: 32px !important;`, children: "\uD83D\uDC5B" }) }), _jsx("p", { css: css `
|
|
241
|
+
margin-bottom: 24px !important;
|
|
242
|
+
font-size: 16px !important;
|
|
243
|
+
color: #666 !important;
|
|
244
|
+
`, children: walletTextUtils.getWalletText('Please connect your wallet first', serviceId) }), _jsx("button", { onClick: onConnectWallet, disabled: Boolean(hitAddress), css: css `
|
|
245
|
+
${actionButton}
|
|
246
|
+
padding: 12px 24px !important;
|
|
247
|
+
background-color: ${Boolean(hitAddress) ? '#28a745' : '#007bff'} !important;
|
|
248
|
+
border-radius: 8px !important;
|
|
249
|
+
font-size: 16px !important;
|
|
250
|
+
opacity: ${Boolean(hitAddress) ? 0.8 : 1} !important;
|
|
251
|
+
|
|
252
|
+
&:disabled {
|
|
253
|
+
cursor: not-allowed !important;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
&:hover:not(:disabled) {
|
|
257
|
+
background-color: #0056b3 !important;
|
|
258
|
+
}
|
|
259
|
+
`, children: Boolean(hitAddress) ? 'Connected' : walletTextUtils.getWalletText('Connect Wallet', serviceId) })] })) : isNeedSignInWithWallet ? (_jsxs("div", { css: css `
|
|
260
|
+
text-align: center !important;
|
|
261
|
+
padding: 32px 0 !important;
|
|
262
|
+
`, children: [_jsxs("div", { css: css `margin-bottom: 24px !important;`, children: [_jsx("h4", { css: css `
|
|
263
|
+
margin-bottom: 12px !important;
|
|
264
|
+
font-size: 16px !important;
|
|
265
|
+
color: #666 !important;
|
|
266
|
+
`, children: walletTextUtils.getWalletText('Connected Wallet', serviceId) }), _jsx("p", { css: css `
|
|
267
|
+
word-break: break-all !important;
|
|
268
|
+
background-color: #f8f9fa !important;
|
|
269
|
+
padding: 12px !important;
|
|
270
|
+
border-radius: 8px !important;
|
|
271
|
+
font-size: 14px !important;
|
|
272
|
+
color: #333 !important;
|
|
273
|
+
border: 1px solid #e9ecef !important;
|
|
274
|
+
`, children: hitAddress })] }), _jsx("p", { css: css `
|
|
275
|
+
margin-bottom: 24px !important;
|
|
276
|
+
font-size: 16px !important;
|
|
277
|
+
color: #666 !important;
|
|
278
|
+
`, children: "Please sign in to continue" }), _jsx("button", { onClick: onSignIn, disabled: !isNeedSignInWithWallet, css: css `
|
|
279
|
+
${actionButton}
|
|
280
|
+
padding: 12px 24px !important;
|
|
281
|
+
background-color: ${!isNeedSignInWithWallet ? '#28a745' : '#007bff'} !important;
|
|
282
|
+
border-radius: 8px !important;
|
|
283
|
+
font-size: 16px !important;
|
|
284
|
+
opacity: ${!isNeedSignInWithWallet ? 0.8 : 1} !important;
|
|
285
|
+
|
|
286
|
+
&:disabled {
|
|
287
|
+
cursor: not-allowed !important;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
&:hover:not(:disabled) {
|
|
291
|
+
background-color: #0056b3 !important;
|
|
292
|
+
}
|
|
293
|
+
`, children: !isNeedSignInWithWallet ? 'Signed In' : 'Sign In' })] })) : shouldShowVerificationPrompt ? (_jsxs("div", { css: css `
|
|
294
|
+
text-align: center !important;
|
|
295
|
+
padding: 32px 0 !important;
|
|
296
|
+
`, children: [_jsxs("div", { css: css `margin-bottom: 24px !important;`, children: [_jsx("h4", { css: css `
|
|
297
|
+
margin-bottom: 12px !important;
|
|
298
|
+
font-size: 16px !important;
|
|
299
|
+
color: #666 !important;
|
|
300
|
+
`, children: walletTextUtils.getWalletText('Connected Wallet', serviceId) }), _jsx("p", { css: css `
|
|
301
|
+
word-break: break-all !important;
|
|
302
|
+
background-color: #f8f9fa !important;
|
|
303
|
+
padding: 12px !important;
|
|
304
|
+
border-radius: 8px !important;
|
|
305
|
+
font-size: 14px !important;
|
|
306
|
+
color: #333 !important;
|
|
307
|
+
border: 1px solid #e9ecef !important;
|
|
308
|
+
`, children: hitAddress })] }), _jsx("p", { css: css `
|
|
309
|
+
margin-bottom: 24px !important;
|
|
310
|
+
font-size: 16px !important;
|
|
311
|
+
color: #666 !important;
|
|
312
|
+
`, children: isWalletVerified && !isWalletVerifiedWithBerifyme
|
|
313
|
+
? walletTextUtils.getWalletText('Your wallet is verified with custom method, but Berify.me verification is required to continue.', serviceId)
|
|
314
|
+
: walletTextUtils.getWalletText('Please verify your wallet with Berify.me to continue', serviceId) }), _jsx("button", { onClick: () => onVerifyWallet('berifyme'), css: css `
|
|
315
|
+
${actionButton}
|
|
316
|
+
padding: 12px 24px !important;
|
|
317
|
+
background-color: #007bff !important;
|
|
318
|
+
border-radius: 8px !important;
|
|
319
|
+
font-size: 16px !important;
|
|
320
|
+
|
|
321
|
+
&:hover {
|
|
322
|
+
background-color: #0056b3 !important;
|
|
323
|
+
}
|
|
324
|
+
`, children: walletTextUtils.getWalletText('Verify your wallet', serviceId) })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { css: css `margin-bottom: 24px !important;`, children: [_jsx("h4", { css: css `
|
|
325
|
+
margin-bottom: 12px !important;
|
|
326
|
+
font-size: 16px !important;
|
|
327
|
+
color: #666 !important;
|
|
328
|
+
`, children: walletTextUtils.getWalletText('Connected Wallet', serviceId) }), _jsx("p", { css: css `
|
|
329
|
+
word-break: break-all !important;
|
|
330
|
+
background-color: #f8f9fa !important;
|
|
331
|
+
padding: 12px !important;
|
|
332
|
+
border-radius: 8px !important;
|
|
333
|
+
font-size: 14px !important;
|
|
334
|
+
color: #333 !important;
|
|
335
|
+
border: 1px solid #e9ecef !important;
|
|
336
|
+
`, children: hitAddress })] }), _jsxs("div", { css: css `
|
|
337
|
+
margin-bottom: 24px !important;
|
|
338
|
+
flex: 1 !important;
|
|
339
|
+
display: flex !important;
|
|
340
|
+
flex-direction: column !important;
|
|
341
|
+
min-height: 0 !important;
|
|
342
|
+
`, children: [_jsx("h4", { css: css `
|
|
343
|
+
margin-bottom: 12px !important;
|
|
344
|
+
font-size: 16px !important;
|
|
345
|
+
color: #666 !important;
|
|
346
|
+
flex-shrink: 0 !important;
|
|
347
|
+
`, children: "Permissions" }), isAITLoading ? (_jsx("div", { css: css `
|
|
348
|
+
background-color: #f8f9fa !important;
|
|
349
|
+
padding: 16px !important;
|
|
350
|
+
border-radius: 8px !important;
|
|
351
|
+
border: 1px solid #e9ecef !important;
|
|
352
|
+
text-align: center !important;
|
|
353
|
+
color: #666 !important;
|
|
354
|
+
`, children: "Loading permissions..." })) : (_jsx("div", { css: css `
|
|
355
|
+
background-color: #f8f9fa !important;
|
|
356
|
+
padding: 16px !important;
|
|
357
|
+
border-radius: 8px !important;
|
|
358
|
+
border: 1px solid #e9ecef !important;
|
|
359
|
+
flex: 1 !important;
|
|
360
|
+
overflow-y: auto !important;
|
|
361
|
+
overflow-x: hidden !important;
|
|
362
|
+
min-height: 0 !important;
|
|
363
|
+
`, children: availablePermissions.map((permission) => {
|
|
364
|
+
const isAllPermission = permission.label === 'ALL';
|
|
365
|
+
const isOtherPermissionDisabled = isAllSelected && !isAllPermission;
|
|
366
|
+
const isChecked = isAllSelected && !isAllPermission
|
|
367
|
+
? true
|
|
368
|
+
: tempPermissions.includes(permission.label);
|
|
369
|
+
return (_jsx("div", { css: css `margin-bottom: 12px !important;`, children: _jsxs("label", { css: css `
|
|
370
|
+
display: flex !important;
|
|
371
|
+
align-items: center !important;
|
|
372
|
+
gap: 12px !important;
|
|
373
|
+
cursor: ${isAITLoading || isOtherPermissionDisabled ? 'not-allowed' : 'pointer'} !important;
|
|
374
|
+
padding: 8px !important;
|
|
375
|
+
border-radius: 6px !important;
|
|
376
|
+
transition: background-color 0.2s !important;
|
|
377
|
+
opacity: ${isAITLoading || isOtherPermissionDisabled ? 0.6 : 1} !important;
|
|
378
|
+
|
|
379
|
+
&:hover {
|
|
380
|
+
background-color: ${!isAITLoading && !isOtherPermissionDisabled ? '#e9ecef' : 'transparent'} !important;
|
|
381
|
+
}
|
|
382
|
+
`, children: [_jsx("input", { type: "checkbox", checked: isChecked, onChange: () => {
|
|
383
|
+
if (!isAITLoading) {
|
|
384
|
+
if (isAllPermission) {
|
|
385
|
+
// Handle ALL permission toggle
|
|
386
|
+
if (isAllSelected) {
|
|
387
|
+
// Unchecking ALL - keep all other permissions selected
|
|
388
|
+
// Get all permission labels except ALL
|
|
389
|
+
const allOtherPermissions = availablePermissions
|
|
390
|
+
.map(p => p.label)
|
|
391
|
+
.filter(label => label !== 'ALL');
|
|
392
|
+
setTempPermissions(allOtherPermissions.sort());
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
// Checking ALL - add all permissions
|
|
396
|
+
const allPermissionLabels = availablePermissions.map(p => p.label);
|
|
397
|
+
setTempPermissions(allPermissionLabels.sort());
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
else {
|
|
401
|
+
// Handle other permissions (only if ALL is not selected)
|
|
402
|
+
if (!isAllSelected) {
|
|
403
|
+
const newPermissions = tempPermissions.includes(permission.label)
|
|
404
|
+
? tempPermissions.filter(p => p !== permission.label)
|
|
405
|
+
: [...tempPermissions, permission.label].sort();
|
|
406
|
+
setTempPermissions(newPermissions);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
setHasUserInteracted(true);
|
|
410
|
+
setIsDisabled(false);
|
|
411
|
+
}
|
|
412
|
+
}, disabled: isAITLoading || isOtherPermissionDisabled, css: css `
|
|
413
|
+
margin: 0 !important;
|
|
414
|
+
width: 18px !important;
|
|
415
|
+
height: 18px !important;
|
|
416
|
+
cursor: ${isAITLoading || isOtherPermissionDisabled ? 'not-allowed' : 'pointer'} !important;
|
|
417
|
+
` }), _jsx("span", { css: css `
|
|
418
|
+
font-size: 14px !important;
|
|
419
|
+
color: ${isOtherPermissionDisabled ? '#999' : '#333'} !important;
|
|
420
|
+
`, children: permission.label })] }) }, permission.id));
|
|
421
|
+
}) }))] }), _jsxs("div", { css: css `
|
|
422
|
+
display: flex !important;
|
|
423
|
+
justify-content: flex-end !important;
|
|
424
|
+
gap: 12px !important;
|
|
425
|
+
border-top: 1px solid #e9ecef !important;
|
|
426
|
+
padding-top: 24px !important;
|
|
427
|
+
flex-shrink: 0 !important;
|
|
428
|
+
margin-top: auto !important;
|
|
429
|
+
`, children: [_jsx("button", { onClick: handleCancel, css: css `
|
|
430
|
+
padding: 10px 20px !important;
|
|
431
|
+
background-color: #f8f9fa !important;
|
|
432
|
+
color: #666 !important;
|
|
433
|
+
border: 1px solid #dee2e6 !important;
|
|
434
|
+
border-radius: 8px !important;
|
|
435
|
+
cursor: pointer !important;
|
|
436
|
+
font-size: 14px !important;
|
|
437
|
+
font-weight: 500 !important;
|
|
438
|
+
transition: all 0.2s !important;
|
|
439
|
+
margin-top: 0 !important;
|
|
440
|
+
|
|
441
|
+
&:hover {
|
|
442
|
+
background-color: #e9ecef !important;
|
|
443
|
+
border-color: #ced4da !important;
|
|
444
|
+
}
|
|
445
|
+
`, children: "Cancel" }), _jsx("button", { onClick: handleSave, disabled: !hasPermissionChanges() || isSaving || isAITLoading, css: css `
|
|
446
|
+
padding: 10px 20px !important;
|
|
447
|
+
background-color: ${!hasPermissionChanges() || isSaving || isAITLoading ? '#e9ecef' : '#007bff'} !important;
|
|
448
|
+
color: ${!hasPermissionChanges() || isSaving || isAITLoading ? '#6c757d' : 'white'} !important;
|
|
449
|
+
border: none !important;
|
|
450
|
+
border-radius: 8px !important;
|
|
451
|
+
cursor: ${!hasPermissionChanges() || isSaving || isAITLoading ? 'not-allowed' : 'pointer'} !important;
|
|
452
|
+
font-size: 14px !important;
|
|
453
|
+
font-weight: 500 !important;
|
|
454
|
+
transition: all 0.2s !important;
|
|
455
|
+
margin-top: 0 !important;
|
|
456
|
+
|
|
457
|
+
&:disabled {
|
|
458
|
+
cursor: not-allowed !important;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
&:hover:not(:disabled) {
|
|
462
|
+
background-color: #0056b3 !important;
|
|
463
|
+
}
|
|
464
|
+
`, children: isSaving ? 'Saving...' : 'Save' })] })] }))] }));
|
|
465
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PresetMessages.d.ts","sourceRoot":"","sources":["../../../../src/legacy/chatbot/ui/PresetMessages.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EA0ClC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
import { useChatBot } from '../context/ChatBotContext';
|
|
4
|
+
import { actionButton } from './styles/isolatedStyles';
|
|
5
|
+
export const PresetMessages = () => {
|
|
6
|
+
const { suggestions, handlePresetMessage } = useChatBot();
|
|
7
|
+
if (!suggestions || suggestions.length === 0) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
return (_jsx("div", { css: css `
|
|
11
|
+
padding: 10px 15px !important;
|
|
12
|
+
border-top: 1px solid #eee !important;
|
|
13
|
+
overflow-x: auto !important;
|
|
14
|
+
white-space: nowrap !important;
|
|
15
|
+
display: flex !important;
|
|
16
|
+
gap: 10px !important;
|
|
17
|
+
align-items: center !important;
|
|
18
|
+
`, children: suggestions.map((preset, index) => (_jsx("button", { onClick: () => handlePresetMessage(preset), css: css `
|
|
19
|
+
${actionButton}
|
|
20
|
+
padding: 5px 10px !important;
|
|
21
|
+
font-size: 12px !important;
|
|
22
|
+
white-space: nowrap !important;
|
|
23
|
+
flex-shrink: 0 !important;
|
|
24
|
+
|
|
25
|
+
&:hover {
|
|
26
|
+
background-color: #0056b3 !important;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:active {
|
|
30
|
+
background-color: #004085 !important;
|
|
31
|
+
}
|
|
32
|
+
`, children: preset.text }, index))) }));
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceModePanel.d.ts","sourceRoot":"","sources":["../../../../src/legacy/chatbot/ui/VoiceModePanel.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqC/B,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EA4HlC,CAAC"}
|