ajaxter-chat 3.0.16 → 3.1.0
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/components/BlockList/index.d.ts +1 -0
- package/dist/components/BlockList/index.d.ts.map +1 -0
- package/dist/components/BlockList/index.js +55 -28
- package/dist/components/BlockList/index.js.map +1 -0
- package/dist/components/CallScreen/index.d.ts +3 -0
- package/dist/components/CallScreen/index.d.ts.map +1 -0
- package/dist/components/CallScreen/index.js +107 -29
- package/dist/components/CallScreen/index.js.map +1 -0
- package/dist/components/ChatScreen/index.d.ts +1 -0
- package/dist/components/ChatScreen/index.d.ts.map +1 -0
- package/dist/components/ChatScreen/index.js +493 -294
- package/dist/components/ChatScreen/index.js.map +1 -0
- package/dist/components/ChatWidget.d.ts +1 -0
- package/dist/components/ChatWidget.d.ts.map +1 -0
- package/dist/components/ChatWidget.js +359 -250
- package/dist/components/ChatWidget.js.map +1 -0
- package/dist/components/EmojiPicker/index.d.ts +1 -0
- package/dist/components/EmojiPicker/index.d.ts.map +1 -0
- package/dist/components/EmojiPicker/index.js +19 -7
- package/dist/components/EmojiPicker/index.js.map +1 -0
- package/dist/components/ErrorBoundary/index.d.ts +20 -0
- package/dist/components/ErrorBoundary/index.d.ts.map +1 -0
- package/dist/components/ErrorBoundary/index.js +76 -0
- package/dist/components/ErrorBoundary/index.js.map +1 -0
- package/dist/components/HomeScreen/index.d.ts +1 -0
- package/dist/components/HomeScreen/index.d.ts.map +1 -0
- package/dist/components/HomeScreen/index.js +236 -158
- package/dist/components/HomeScreen/index.js.map +1 -0
- package/dist/components/MaintenanceView/index.d.ts +1 -0
- package/dist/components/MaintenanceView/index.d.ts.map +1 -0
- package/dist/components/MaintenanceView/index.js +28 -12
- package/dist/components/MaintenanceView/index.js.map +1 -0
- package/dist/components/MiniCallBar/index.d.ts +15 -0
- package/dist/components/MiniCallBar/index.d.ts.map +1 -0
- package/dist/components/MiniCallBar/index.js +116 -0
- package/dist/components/MiniCallBar/index.js.map +1 -0
- package/dist/components/PermissionsGateScreen/index.d.ts +1 -0
- package/dist/components/PermissionsGateScreen/index.d.ts.map +1 -0
- package/dist/components/PermissionsGateScreen/index.js +82 -28
- package/dist/components/PermissionsGateScreen/index.js.map +1 -0
- package/dist/components/RecentChatsScreen/index.d.ts +1 -0
- package/dist/components/RecentChatsScreen/index.d.ts.map +1 -0
- package/dist/components/RecentChatsScreen/index.js +79 -19
- package/dist/components/RecentChatsScreen/index.js.map +1 -0
- package/dist/components/SlideNavMenu.d.ts +1 -0
- package/dist/components/SlideNavMenu.d.ts.map +1 -0
- package/dist/components/SlideNavMenu.js +82 -63
- package/dist/components/SlideNavMenu.js.map +1 -0
- package/dist/components/Tabs/BottomTabs.d.ts +1 -0
- package/dist/components/Tabs/BottomTabs.d.ts.map +1 -0
- package/dist/components/Tabs/BottomTabs.js +34 -19
- package/dist/components/Tabs/BottomTabs.js.map +1 -0
- package/dist/components/TicketDetailScreen/index.d.ts +1 -0
- package/dist/components/TicketDetailScreen/index.d.ts.map +1 -0
- package/dist/components/TicketDetailScreen/index.js +66 -27
- package/dist/components/TicketDetailScreen/index.js.map +1 -0
- package/dist/components/TicketFormScreen/index.d.ts +1 -0
- package/dist/components/TicketFormScreen/index.d.ts.map +1 -0
- package/dist/components/TicketFormScreen/index.js +99 -49
- package/dist/components/TicketFormScreen/index.js.map +1 -0
- package/dist/components/TicketScreen/index.d.ts +1 -0
- package/dist/components/TicketScreen/index.d.ts.map +1 -0
- package/dist/components/TicketScreen/index.js +95 -26
- package/dist/components/TicketScreen/index.js.map +1 -0
- package/dist/components/UserListScreen/index.d.ts +1 -0
- package/dist/components/UserListScreen/index.d.ts.map +1 -0
- package/dist/components/UserListScreen/index.js +127 -53
- package/dist/components/UserListScreen/index.js.map +1 -0
- package/dist/components/ViewerBlockedScreen/index.d.ts +1 -0
- package/dist/components/ViewerBlockedScreen/index.d.ts.map +1 -0
- package/dist/components/ViewerBlockedScreen/index.js +113 -61
- package/dist/components/ViewerBlockedScreen/index.js.map +1 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +7 -2
- package/dist/config/index.js.map +1 -0
- package/dist/hooks/useChat.d.ts +9 -1
- package/dist/hooks/useChat.d.ts.map +1 -0
- package/dist/hooks/useChat.js +60 -18
- package/dist/hooks/useChat.js.map +1 -0
- package/dist/hooks/useRemoteConfig.d.ts +1 -0
- package/dist/hooks/useRemoteConfig.d.ts.map +1 -0
- package/dist/hooks/useRemoteConfig.js +12 -8
- package/dist/hooks/useRemoteConfig.js.map +1 -0
- package/dist/hooks/useSocket.d.ts +40 -0
- package/dist/hooks/useSocket.d.ts.map +1 -0
- package/dist/hooks/useSocket.js +190 -0
- package/dist/hooks/useSocket.js.map +1 -0
- package/dist/hooks/useWebRTC.d.ts +10 -2
- package/dist/hooks/useWebRTC.d.ts.map +1 -0
- package/dist/hooks/useWebRTC.js +101 -69
- package/dist/hooks/useWebRTC.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +67 -21
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -1
- package/dist/types/index.js.map +1 -0
- package/dist/utils/chat.d.ts +1 -0
- package/dist/utils/chat.d.ts.map +1 -0
- package/dist/utils/chat.js +17 -7
- package/dist/utils/chat.js.map +1 -0
- package/dist/utils/fileName.d.ts +1 -0
- package/dist/utils/fileName.d.ts.map +1 -0
- package/dist/utils/fileName.js +5 -1
- package/dist/utils/fileName.js.map +1 -0
- package/dist/utils/messageSound.d.ts +1 -0
- package/dist/utils/messageSound.d.ts.map +1 -0
- package/dist/utils/messageSound.js +9 -3
- package/dist/utils/messageSound.js.map +1 -0
- package/dist/utils/presenceStatus.d.ts +1 -0
- package/dist/utils/presenceStatus.d.ts.map +1 -0
- package/dist/utils/presenceStatus.js +11 -4
- package/dist/utils/presenceStatus.js.map +1 -0
- package/dist/utils/privacyConsent.d.ts +1 -0
- package/dist/utils/privacyConsent.d.ts.map +1 -0
- package/dist/utils/privacyConsent.js +9 -3
- package/dist/utils/privacyConsent.js.map +1 -0
- package/dist/utils/reenableRequest.d.ts +1 -0
- package/dist/utils/reenableRequest.d.ts.map +1 -0
- package/dist/utils/reenableRequest.js +5 -1
- package/dist/utils/reenableRequest.js.map +1 -0
- package/dist/utils/theme.d.ts +1 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/dist/utils/theme.js +10 -4
- package/dist/utils/theme.js.map +1 -0
- package/dist/utils/widgetPermissions.d.ts +1 -0
- package/dist/utils/widgetPermissions.d.ts.map +1 -0
- package/dist/utils/widgetPermissions.js +13 -5
- package/dist/utils/widgetPermissions.js.map +1 -0
- package/dist/utils/widgetSession.d.ts +1 -0
- package/dist/utils/widgetSession.d.ts.map +1 -0
- package/dist/utils/widgetSession.js +9 -3
- package/dist/utils/widgetSession.js.map +1 -0
- package/package.json +3 -3
- package/src/components/CallScreen/index.tsx +23 -1
- package/src/components/ChatScreen/index.tsx +2 -1
- package/src/components/ChatWidget.tsx +314 -263
- package/src/components/ErrorBoundary/index.tsx +62 -0
- package/src/components/HomeScreen/index.tsx +0 -3
- package/src/components/MiniCallBar/index.tsx +150 -0
- package/src/hooks/useChat.ts +59 -12
- package/src/hooks/useSocket.ts +228 -0
- package/src/hooks/useWebRTC.ts +99 -64
- package/src/index.ts +7 -2
|
@@ -1,6 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.UserListScreen = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const chat_1 = require("../../utils/chat");
|
|
4
39
|
function matchesUser(u, q) {
|
|
5
40
|
if (!q.trim())
|
|
6
41
|
return true;
|
|
@@ -10,14 +45,14 @@ function matchesUser(u, q) {
|
|
|
10
45
|
u.designation.toLowerCase().includes(s) ||
|
|
11
46
|
u.project.toLowerCase().includes(s));
|
|
12
47
|
}
|
|
13
|
-
|
|
14
|
-
const [query, setQuery] = useState('');
|
|
15
|
-
const searchRef = useRef(null);
|
|
16
|
-
useEffect(() => {
|
|
48
|
+
const UserListScreen = ({ context, users, primaryColor, viewerType = 'user', onBack, onSelectUser, onBlockList, useHomeHeader = false, animateEntrance = false, }) => {
|
|
49
|
+
const [query, setQuery] = (0, react_1.useState)('');
|
|
50
|
+
const searchRef = (0, react_1.useRef)(null);
|
|
51
|
+
(0, react_1.useEffect)(() => {
|
|
17
52
|
var _a;
|
|
18
53
|
(_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
19
54
|
}, []);
|
|
20
|
-
const filtered = useMemo(() => users.filter(u => matchesUser(u, query)), [users, query]);
|
|
55
|
+
const filtered = (0, react_1.useMemo)(() => users.filter(u => matchesUser(u, query)), [users, query]);
|
|
21
56
|
const isStaff = viewerType === 'developer';
|
|
22
57
|
const title = context === 'support'
|
|
23
58
|
? (isStaff ? 'Provide Support' : 'Need Support')
|
|
@@ -26,56 +61,95 @@ export const UserListScreen = ({ context, users, primaryColor, viewerType = 'use
|
|
|
26
61
|
? (isStaff ? 'All chat users — choose who to help' : 'Choose a support agent')
|
|
27
62
|
: (isStaff ? 'Chat with another developer or coordinate handoff' : 'Choose a colleague');
|
|
28
63
|
const rootAnim = animateEntrance ? 'cw-slideIn 0.22s ease' : undefined;
|
|
29
|
-
return (
|
|
30
|
-
|
|
31
|
-
|
|
64
|
+
return (react_1.default.createElement("div", { style: { display: 'flex', flexDirection: 'column', height: '100%', animation: rootAnim } },
|
|
65
|
+
react_1.default.createElement("div", { style: { background: `linear-gradient(135deg,${primaryColor},${primaryColor}cc)`, padding: '14px 18px', display: 'flex', alignItems: 'center', gap: 12, flexShrink: 0, position: 'relative' } },
|
|
66
|
+
useHomeHeader ? react_1.default.createElement(HomeBtn, { onClick: onBack }) : react_1.default.createElement(BackBtn, { onClick: onBack }),
|
|
67
|
+
react_1.default.createElement("div", { style: { flex: 1, minWidth: 0 } },
|
|
68
|
+
react_1.default.createElement("div", { style: { fontWeight: 700, fontSize: 16, color: '#fff' } }, title),
|
|
69
|
+
react_1.default.createElement("div", { style: { fontSize: 12, color: 'rgba(255,255,255,0.8)' } }, subtitle)),
|
|
70
|
+
context === 'conversation' && onBlockList && (react_1.default.createElement("button", { type: "button", onClick: onBlockList, style: {
|
|
71
|
+
flexShrink: 0,
|
|
72
|
+
background: 'rgba(255,255,255,0.2)',
|
|
73
|
+
border: 'none',
|
|
74
|
+
borderRadius: 10,
|
|
75
|
+
padding: '8px 12px',
|
|
76
|
+
color: '#fff',
|
|
77
|
+
fontSize: 12,
|
|
78
|
+
fontWeight: 700,
|
|
79
|
+
cursor: 'pointer',
|
|
80
|
+
display: 'flex',
|
|
81
|
+
alignItems: 'center',
|
|
82
|
+
gap: 6,
|
|
83
|
+
}, title: "Blocked users" },
|
|
84
|
+
react_1.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none" },
|
|
85
|
+
react_1.default.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "1.8" }),
|
|
86
|
+
react_1.default.createElement("line", { x1: "4.93", y1: "4.93", x2: "19.07", y2: "19.07", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" })),
|
|
87
|
+
"Blocked"))),
|
|
88
|
+
react_1.default.createElement("div", { style: { padding: '10px 14px', background: '#fff', borderBottom: '1px solid #eef0f5', flexShrink: 0 } },
|
|
89
|
+
react_1.default.createElement("label", { style: { display: 'block', margin: 0 } },
|
|
90
|
+
react_1.default.createElement("span", { style: { position: 'absolute', width: 1, height: 1, padding: 0, overflow: 'hidden', clip: 'rect(0,0,0,0)' } }, "Search"),
|
|
91
|
+
react_1.default.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: 8, padding: '0 12px', borderRadius: 10, border: '1.5px solid #e5e7eb', background: '#f8fafc' } },
|
|
92
|
+
react_1.default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", style: { flexShrink: 0, opacity: 0.55 } },
|
|
93
|
+
react_1.default.createElement("circle", { cx: "11", cy: "11", r: "7", stroke: "#64748b", strokeWidth: "2" }),
|
|
94
|
+
react_1.default.createElement("path", { d: "M20 20l-4-4", stroke: "#64748b", strokeWidth: "2", strokeLinecap: "round" })),
|
|
95
|
+
react_1.default.createElement("input", { ref: searchRef, type: "search", value: query, onChange: e => setQuery(e.target.value), placeholder: "Search by name\u2026", autoComplete: "off", style: {
|
|
96
|
+
flex: 1,
|
|
97
|
+
minWidth: 0,
|
|
32
98
|
border: 'none',
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
?
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
border: `1px solid ${u.type === 'developer' ? primaryColor + '30' : '#16a34a30'}`,
|
|
69
|
-
}, children: u.type === 'developer' ? 'Dev' : 'User' })] }, u.uid))) })] }));
|
|
99
|
+
outline: 'none',
|
|
100
|
+
background: 'transparent',
|
|
101
|
+
fontSize: 14,
|
|
102
|
+
padding: '10px 0',
|
|
103
|
+
fontFamily: 'inherit',
|
|
104
|
+
color: '#1a2332',
|
|
105
|
+
} })))),
|
|
106
|
+
react_1.default.createElement("div", { style: { flex: 1, overflowY: 'auto' } }, filtered.length === 0 ? (react_1.default.createElement(Empty, { hasQuery: !!query.trim() })) : filtered.map((u, i) => (react_1.default.createElement("button", { key: u.uid, onClick: () => onSelectUser(u), style: Object.assign(Object.assign({ width: '100%', padding: '13px 18px', display: 'flex', alignItems: 'center', gap: 13, background: 'transparent', border: 'none', borderBottom: '1px solid #f0f2f5', cursor: 'pointer', textAlign: 'left' }, (animateEntrance
|
|
107
|
+
? { animation: `cw-fadeUp 0.28s ease both`, animationDelay: `${i * 0.05}s` }
|
|
108
|
+
: {})), { transition: 'background 0.14s' }), onMouseEnter: e => e.currentTarget.style.background = '#f8faff', onMouseLeave: e => e.currentTarget.style.background = 'transparent' },
|
|
109
|
+
react_1.default.createElement("div", { style: { position: 'relative', flexShrink: 0 } },
|
|
110
|
+
react_1.default.createElement("div", { style: {
|
|
111
|
+
width: 44, height: 44, borderRadius: '50%',
|
|
112
|
+
backgroundColor: (0, chat_1.avatarColor)(u.name),
|
|
113
|
+
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
114
|
+
color: '#fff', fontWeight: 700, fontSize: 14,
|
|
115
|
+
} }, (0, chat_1.initials)(u.name)),
|
|
116
|
+
react_1.default.createElement("span", { style: {
|
|
117
|
+
position: 'absolute', bottom: 1, right: 1,
|
|
118
|
+
width: 11, height: 11, borderRadius: '50%', border: '2px solid #fff',
|
|
119
|
+
backgroundColor: u.status === 'online' ? '#22c55e' : u.status === 'away' ? '#f59e0b' : '#d1d5db',
|
|
120
|
+
} })),
|
|
121
|
+
react_1.default.createElement("div", { style: { flex: 1, minWidth: 0 } },
|
|
122
|
+
react_1.default.createElement("div", { style: { fontWeight: 700, fontSize: 14, color: '#1a2332', marginBottom: 2 } }, u.name),
|
|
123
|
+
react_1.default.createElement("div", { style: { fontSize: 12, color: '#7b8fa1', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } },
|
|
124
|
+
u.designation,
|
|
125
|
+
" \u00B7 ",
|
|
126
|
+
u.project)),
|
|
127
|
+
react_1.default.createElement("span", { style: {
|
|
128
|
+
fontSize: 10, fontWeight: 700, padding: '3px 9px', borderRadius: 20,
|
|
129
|
+
textTransform: 'uppercase', letterSpacing: '0.05em', flexShrink: 0,
|
|
130
|
+
background: u.type === 'developer' ? `${primaryColor}15` : '#f0fdf4',
|
|
131
|
+
color: u.type === 'developer' ? primaryColor : '#16a34a',
|
|
132
|
+
border: `1px solid ${u.type === 'developer' ? primaryColor + '30' : '#16a34a30'}`,
|
|
133
|
+
} }, u.type === 'developer' ? 'Dev' : 'User')))))));
|
|
70
134
|
};
|
|
71
|
-
|
|
135
|
+
exports.UserListScreen = UserListScreen;
|
|
136
|
+
const BackBtn = ({ onClick }) => (react_1.default.createElement("button", { type: "button", onClick: onClick, style: {
|
|
72
137
|
background: 'rgba(255,255,255,0.22)', border: 'none', borderRadius: '50%',
|
|
73
138
|
width: 32, height: 32, display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
74
139
|
cursor: 'pointer', flexShrink: 0,
|
|
75
|
-
}
|
|
76
|
-
|
|
140
|
+
} },
|
|
141
|
+
react_1.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none" },
|
|
142
|
+
react_1.default.createElement("path", { d: "M19 12H5M5 12L12 19M5 12L12 5", stroke: "#fff", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round" }))));
|
|
143
|
+
const HomeBtn = ({ onClick }) => (react_1.default.createElement("button", { type: "button", onClick: onClick, title: "Home", "aria-label": "Home", style: {
|
|
77
144
|
background: 'rgba(255,255,255,0.22)', border: 'none', borderRadius: '50%',
|
|
78
145
|
width: 32, height: 32, display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
79
146
|
cursor: 'pointer', flexShrink: 0,
|
|
80
|
-
}
|
|
81
|
-
|
|
147
|
+
} },
|
|
148
|
+
react_1.default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none" },
|
|
149
|
+
react_1.default.createElement("path", { d: "M3 9.5L12 3l9 6.5V20a1 1 0 01-1 1H4a1 1 0 01-1-1V9.5z", stroke: "#fff", strokeWidth: "2.2", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
150
|
+
react_1.default.createElement("path", { d: "M9 21V12h6v9", stroke: "#fff", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round" }))));
|
|
151
|
+
const Empty = ({ hasQuery }) => (react_1.default.createElement("div", { style: { padding: '50px 24px', textAlign: 'center' } },
|
|
152
|
+
react_1.default.createElement("div", { style: { fontSize: 36, marginBottom: 10 } }, hasQuery ? '🔍' : '👥'),
|
|
153
|
+
react_1.default.createElement("div", { style: { fontWeight: 700, color: '#1a2332', marginBottom: 6 } }, hasQuery ? 'No matches' : 'No users available'),
|
|
154
|
+
react_1.default.createElement("div", { style: { fontSize: 13, color: '#7b8fa1' } }, hasQuery ? 'Try a different search' : 'Check back later')));
|
|
155
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/UserListScreen/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAoE;AAEpE,2CAAyD;AAkBzD,SAAS,WAAW,CAAC,CAAW,EAAE,CAAS;IACzC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;QAAE,OAAO,IAAI,CAAC;IAC3B,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACjC,OAAO,CACL,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;QAChC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;QACjC,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CACpC,CAAC;AACJ,CAAC;AAEM,MAAM,cAAc,GAAkC,CAAC,EAC5D,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,GAAG,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EACpF,aAAa,GAAG,KAAK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IACf,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA+KlE,CAAC"}
|
|
@@ -1,13 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.ViewerBlockedScreen = void 0;
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const reenableRequest_1 = require("../../utils/reenableRequest");
|
|
5
40
|
const DEFAULT_MESSAGE = 'You have been marked as Blocked user due to spam';
|
|
6
|
-
|
|
41
|
+
const ViewerBlockedScreen = ({ config, apiKey, onClose }) => {
|
|
7
42
|
var _a, _b;
|
|
8
|
-
const [text, setText] = useState('');
|
|
9
|
-
const [status, setStatus] = useState('idle');
|
|
10
|
-
const [error, setError] = useState(null);
|
|
43
|
+
const [text, setText] = (0, react_1.useState)('');
|
|
44
|
+
const [status, setStatus] = (0, react_1.useState)('idle');
|
|
45
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
11
46
|
const primary = config.primaryColor;
|
|
12
47
|
const body = (((_a = config.blockedViewerMessage) === null || _a === void 0 ? void 0 : _a.trim()) || DEFAULT_MESSAGE);
|
|
13
48
|
const url = (_b = config.reenableRequestUrl) === null || _b === void 0 ? void 0 : _b.trim();
|
|
@@ -26,7 +61,7 @@ export const ViewerBlockedScreen = ({ config, apiKey, onClose }) => {
|
|
|
26
61
|
setError(null);
|
|
27
62
|
setStatus('sending');
|
|
28
63
|
try {
|
|
29
|
-
await submitReenableRequest(url, {
|
|
64
|
+
await (0, reenableRequest_1.submitReenableRequest)(url, {
|
|
30
65
|
widgetId: config.id,
|
|
31
66
|
apiKey,
|
|
32
67
|
viewerUid: ((_a = config.viewerUid) === null || _a === void 0 ? void 0 : _a.trim()) || undefined,
|
|
@@ -40,7 +75,7 @@ export const ViewerBlockedScreen = ({ config, apiKey, onClose }) => {
|
|
|
40
75
|
setError(e instanceof Error ? e.message : 'Request failed');
|
|
41
76
|
}
|
|
42
77
|
};
|
|
43
|
-
return (
|
|
78
|
+
return (react_1.default.createElement("div", { className: "cw-scroll", style: {
|
|
44
79
|
flex: 1,
|
|
45
80
|
display: 'flex',
|
|
46
81
|
flexDirection: 'column',
|
|
@@ -50,58 +85,75 @@ export const ViewerBlockedScreen = ({ config, apiKey, onClose }) => {
|
|
|
50
85
|
textAlign: 'center',
|
|
51
86
|
overflowY: 'auto',
|
|
52
87
|
minHeight: 0,
|
|
53
|
-
}
|
|
54
|
-
|
|
88
|
+
} },
|
|
89
|
+
react_1.default.createElement("div", { style: { maxWidth: 380, width: '100%' } },
|
|
90
|
+
react_1.default.createElement("div", { style: { fontSize: 44, marginBottom: 16 } }, "\uD83D\uDEAB"),
|
|
91
|
+
react_1.default.createElement("p", { style: {
|
|
92
|
+
margin: '0 0 28px',
|
|
93
|
+
fontSize: 15,
|
|
94
|
+
fontWeight: 600,
|
|
95
|
+
color: '#1e293b',
|
|
96
|
+
lineHeight: 1.55,
|
|
97
|
+
} }, body),
|
|
98
|
+
status === 'sent' ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
99
|
+
react_1.default.createElement("p", { style: { margin: '0 0 16px', fontSize: 14, color: '#16a34a', fontWeight: 600 } }, "Your request was sent. We will review it shortly."),
|
|
100
|
+
react_1.default.createElement("button", { type: "button", onClick: onClose, style: {
|
|
101
|
+
width: '100%',
|
|
102
|
+
padding: '12px 16px',
|
|
103
|
+
borderRadius: 12,
|
|
104
|
+
border: '2px solid #ef4444',
|
|
105
|
+
background: '#fff',
|
|
106
|
+
color: '#ef4444',
|
|
107
|
+
fontWeight: 700,
|
|
55
108
|
fontSize: 15,
|
|
56
|
-
|
|
109
|
+
cursor: 'pointer',
|
|
110
|
+
fontFamily: 'inherit',
|
|
111
|
+
} }, "Close"))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
112
|
+
react_1.default.createElement("label", { htmlFor: "cw-reenable-msg", style: { display: 'block', textAlign: 'left', fontSize: 13, fontWeight: 600, color: '#475569', marginBottom: 8 } }, "Request access restoration"),
|
|
113
|
+
react_1.default.createElement("textarea", { id: "cw-reenable-msg", value: text, onChange: e => { setText(e.target.value); setError(null); setStatus('idle'); }, placeholder: "Explain briefly why your access should be restored\u2026", rows: 4, maxLength: 500, minLength: 50, disabled: status === 'sending', style: {
|
|
114
|
+
width: '100%',
|
|
115
|
+
boxSizing: 'border-box',
|
|
116
|
+
padding: '12px 14px',
|
|
117
|
+
borderRadius: 12,
|
|
118
|
+
border: '1.5px solid #e2e8f0',
|
|
119
|
+
fontSize: 14,
|
|
120
|
+
fontFamily: 'inherit',
|
|
57
121
|
color: '#1e293b',
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
cursor: text.trim() && status !== 'sending' ? 'pointer' : 'default',
|
|
94
|
-
}, children: status === 'sending' ? 'Sending…' : 'Submit request' }), _jsx("button", { type: "button", onClick: onClose, style: {
|
|
95
|
-
width: '100%',
|
|
96
|
-
marginTop: 12,
|
|
97
|
-
padding: '12px 16px',
|
|
98
|
-
borderRadius: 12,
|
|
99
|
-
border: '2px solid #ef4444',
|
|
100
|
-
background: '#fff',
|
|
101
|
-
color: '#ef4444',
|
|
102
|
-
fontWeight: 700,
|
|
103
|
-
fontSize: 15,
|
|
104
|
-
cursor: 'pointer',
|
|
105
|
-
fontFamily: 'inherit',
|
|
106
|
-
}, children: "Close" }), error && (_jsx("p", { style: { margin: '12px 0 0', fontSize: 13, color: '#dc2626', lineHeight: 1.45 }, children: error })), !url && (_jsxs("p", { style: { margin: '14px 0 0', fontSize: 12, color: '#94a3b8', lineHeight: 1.5 }, children: ["Your administrator must set ", _jsx("code", { style: { fontSize: 11 }, children: "reenableRequestUrl" }), " in widget config for online requests."] }))] }))] }) }));
|
|
122
|
+
resize: 'none',
|
|
123
|
+
minHeight: 100,
|
|
124
|
+
maxHeight: 250,
|
|
125
|
+
marginBottom: 14,
|
|
126
|
+
outline: 'none',
|
|
127
|
+
} }),
|
|
128
|
+
react_1.default.createElement("button", { type: "button", onClick: handleSubmit, disabled: status === 'sending' || !text.trim(), style: {
|
|
129
|
+
width: '100%',
|
|
130
|
+
padding: '12px 16px',
|
|
131
|
+
borderRadius: 12,
|
|
132
|
+
border: 'none',
|
|
133
|
+
background: text.trim() && status !== 'sending' ? primary : '#e2e8f0',
|
|
134
|
+
color: text.trim() && status !== 'sending' ? '#fff' : '#94a3b8',
|
|
135
|
+
fontWeight: 700,
|
|
136
|
+
fontSize: 15,
|
|
137
|
+
cursor: text.trim() && status !== 'sending' ? 'pointer' : 'default',
|
|
138
|
+
} }, status === 'sending' ? 'Sending…' : 'Submit request'),
|
|
139
|
+
react_1.default.createElement("button", { type: "button", onClick: onClose, style: {
|
|
140
|
+
width: '100%',
|
|
141
|
+
marginTop: 12,
|
|
142
|
+
padding: '12px 16px',
|
|
143
|
+
borderRadius: 12,
|
|
144
|
+
border: '2px solid #ef4444',
|
|
145
|
+
background: '#fff',
|
|
146
|
+
color: '#ef4444',
|
|
147
|
+
fontWeight: 700,
|
|
148
|
+
fontSize: 15,
|
|
149
|
+
cursor: 'pointer',
|
|
150
|
+
fontFamily: 'inherit',
|
|
151
|
+
} }, "Close"),
|
|
152
|
+
error && (react_1.default.createElement("p", { style: { margin: '12px 0 0', fontSize: 13, color: '#dc2626', lineHeight: 1.45 } }, error)),
|
|
153
|
+
!url && (react_1.default.createElement("p", { style: { margin: '14px 0 0', fontSize: 12, color: '#94a3b8', lineHeight: 1.5 } },
|
|
154
|
+
"Your administrator must set ",
|
|
155
|
+
react_1.default.createElement("code", { style: { fontSize: 11 } }, "reenableRequestUrl"),
|
|
156
|
+
" in widget config for online requests.")))))));
|
|
107
157
|
};
|
|
158
|
+
exports.ViewerBlockedScreen = ViewerBlockedScreen;
|
|
159
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ViewerBlockedScreen/index.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,+CAAwC;AAExC,iEAAoE;AAEpE,MAAM,eAAe,GACnB,kDAAkD,CAAC;AAQ9C,MAAM,mBAAmB,GAAuC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;;IACrG,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,CAAC,CAAC;IACrC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAwC,MAAM,CAAC,CAAC;IACpF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAgB,IAAI,CAAC,CAAC;IAExD,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC;IACpC,MAAM,IAAI,GAAG,CAAC,CAAA,MAAA,MAAM,CAAC,oBAAoB,0CAAE,IAAI,EAAE,KAAI,eAAe,CAAC,CAAC;IACtE,MAAM,GAAG,GAAG,MAAA,MAAM,CAAC,kBAAkB,0CAAE,IAAI,EAAE,CAAC;IAE9C,MAAM,YAAY,GAAG,KAAK,IAAI,EAAE;;QAC9B,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,QAAQ,CAAC,iEAAiE,CAAC,CAAC;YAC5E,SAAS,CAAC,OAAO,CAAC,CAAC;YACnB,OAAO;QACT,CAAC;QACD,MAAM,GAAG,GAAG,IAAI,CAA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b,OAAO,EAAE,WAAW;wBACpB,YAAY,EAAE,EAAE;wBAChB,MAAM,EAAE,mBAAmB;wBAC3B,UAAU,EAAE,MAAM;wBAClB,KAAK,EAAE,SAAS;wBAChB,UAAU,EAAE,GAAG;wBACf,QAAQ,EAAE,EAAE;wBACZ,MAAM,EAAE,SAAS;wBACjB,UAAU,EAAE,SAAS;qBACtB,YAGM;gBACR,KAAK,IAAI,CACR,qCAAG,KAAK,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAC/E,KAAK,CACJ,CACL;gBACA,CAAC,GAAG,IAAI,CACP,qCAAG,KAAK,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE;;oBACnD,wCAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,yBAA2B;6DAClF,CACL,CACA,CACJ,CACG,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AA/KW,QAAA,mBAAmB,uBA+K9B"}
|
package/dist/config/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AA2B1D;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,cAAc,CAAC,CAczB;AAED,wBAAgB,eAAe,IAAI,cAAc,CAKhD"}
|
package/dist/config/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchRemoteChatData = fetchRemoteChatData;
|
|
4
|
+
exports.loadLocalConfig = loadLocalConfig;
|
|
1
5
|
/**
|
|
2
6
|
* Default JSON endpoint. Override with `REACT_APP_CHAT_CONFIG_URL` / `NEXT_PUBLIC_CHAT_CONFIG_URL`.
|
|
3
7
|
* If the remote host does not send CORS headers, set this to a same-origin path (e.g. `/api/chat-config`)
|
|
@@ -21,7 +25,7 @@ function getChatDataBaseUrl() {
|
|
|
21
25
|
* Loads remote widget config once via GET. Uses query params `key` and `widget` so the
|
|
22
26
|
* server can validate the request without custom headers (avoids CORS preflight failures).
|
|
23
27
|
*/
|
|
24
|
-
|
|
28
|
+
async function fetchRemoteChatData(apiKey, widgetId) {
|
|
25
29
|
const base = getChatDataBaseUrl();
|
|
26
30
|
const url = new URL(base, typeof window !== 'undefined' ? window.location.origin : 'https://localhost');
|
|
27
31
|
url.searchParams.set('key', apiKey);
|
|
@@ -36,10 +40,11 @@ export async function fetchRemoteChatData(apiKey, widgetId) {
|
|
|
36
40
|
throw new Error(`Failed to load chat config: ${res.status}`);
|
|
37
41
|
return res.json();
|
|
38
42
|
}
|
|
39
|
-
|
|
43
|
+
function loadLocalConfig() {
|
|
40
44
|
var _a, _b;
|
|
41
45
|
return {
|
|
42
46
|
apiKey: (_a = getEnv('CHAT_API_KEY')) !== null && _a !== void 0 ? _a : DEMO_API_KEY,
|
|
43
47
|
widgetId: (_b = getEnv('CHAT_WIDGET_ID')) !== null && _b !== void 0 ? _b : DEMO_WIDGET_ID,
|
|
44
48
|
};
|
|
45
49
|
}
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";;AA+BA,kDAiBC;AAED,0CAKC;AArDD;;;;GAIG;AACH,MAAM,sBAAsB,GAAG,iDAAiD,CAAC;AACjF,MAAM,YAAY,GAAK,UAAU,CAAC;AAClC,MAAM,cAAc,GAAG,MAAM,CAAC;AAE9B,SAAS,MAAM,CAA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I,EAA6B,CAAC;AAC/C,CAAC;AAED,SAAgB,eAAe;;IAC7B,OAAO;QACL,MAAM,EAAI,MAAA,MAAM,CAAC,cAAc,CAAC,mCAAO,YAAY;QACnD,QAAQ,EAAE,MAAA,MAAM,CAAC,gBAAgB,CAAC,mCAAK,cAAc;KACtD,CAAC;AACJ,CAAC"}
|
package/dist/hooks/useChat.d.ts
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { ChatMessage, ChatUser } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export interface UseChatOptions {
|
|
3
|
+
onEmitMessage?: (msg: ChatMessage) => void;
|
|
4
|
+
onEmitPause?: (roomId: string, targetUid: string, paused: boolean) => void;
|
|
5
|
+
onEmitReport?: (roomId: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function useChat(initialMessages?: ChatMessage[], opts?: UseChatOptions): {
|
|
3
8
|
messages: ChatMessage[];
|
|
4
9
|
activeUser: ChatUser | null;
|
|
5
10
|
isPaused: boolean;
|
|
6
11
|
isReported: boolean;
|
|
7
12
|
selectUser: (user: ChatUser, history?: ChatMessage[]) => void;
|
|
8
13
|
sendMessage: (text: string, type?: ChatMessage["type"], extra?: Partial<ChatMessage>) => void;
|
|
14
|
+
receiveMessage: (msg: ChatMessage) => void;
|
|
15
|
+
updateMessageStatus: (messageId: string, status: ChatMessage["status"]) => void;
|
|
9
16
|
togglePause: () => void;
|
|
10
17
|
reportChat: () => void;
|
|
11
18
|
clearChat: () => void;
|
|
12
19
|
setMessages: import("react").Dispatch<import("react").SetStateAction<ChatMessage[]>>;
|
|
13
20
|
};
|
|
21
|
+
//# sourceMappingURL=useChat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChat.d.ts","sourceRoot":"","sources":["../../src/hooks/useChat.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,CAAC;IAC3C,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3E,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,wBAAgB,OAAO,CAAC,eAAe,GAAE,WAAW,EAAO,EAAE,IAAI,GAAE,cAAmB;;;;;uBAU9C,QAAQ,YAAW,WAAW,EAAE;wBAU9D,MAAM,SACN,WAAW,CAAC,MAAM,CAAC,UAClB,OAAO,CAAC,WAAW,CAAC;0BAkBY,WAAW;qCAOA,MAAM,UAAU,WAAW,CAAC,QAAQ,CAAC;;;;;EAsC1F"}
|