vue-chat-kit 0.1.2 → 0.1.3
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/vue-chat-kit.css +1 -1
- package/dist/vue-chat-kit.es.js +1199 -1215
- package/dist/vue-chat-kit.umd.js +1 -1
- package/package.json +1 -1
- package/src/components/ChatWindow.vue +1158 -390
- package/src/index.js +3 -0
- package/src/style.css +3 -0
package/dist/vue-chat-kit.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { ChatDotRound as
|
|
3
|
-
import
|
|
4
|
-
import { ElMessage as
|
|
5
|
-
class
|
|
6
|
-
constructor(e,
|
|
7
|
-
this.userId = e, this.wsUrl =
|
|
1
|
+
import { ref as f, computed as re, nextTick as Ne, watch as yt, resolveComponent as ce, openBlock as r, createBlock as q, withCtx as b, createElementVNode as t, createElementBlock as v, createCommentVNode as I, createVNode as p, createTextVNode as ne, onMounted as _t, onUnmounted as bt, unref as u, Fragment as fe, renderList as me, normalizeClass as X, resolveDynamicComponent as Ct, toDisplayString as k, isRef as we, withModifiers as Je, withDirectives as kt, withKeys as wt, vModelText as Ut, normalizeStyle as xt } from "vue";
|
|
2
|
+
import { ChatDotRound as Ee, UserFilled as Qe, Bell as At, Setting as St, Search as Ke, Plus as Vt, MoreFilled as Ft, Document as Rt, Download as It, Folder as Ze, Picture as Lt, ChatLineRound as Tt, Camera as zt } from "@element-plus/icons-vue";
|
|
3
|
+
import We from "dayjs";
|
|
4
|
+
import { ElMessage as Y } from "element-plus";
|
|
5
|
+
class Dt {
|
|
6
|
+
constructor(e, s = {}) {
|
|
7
|
+
this.userId = e, this.wsUrl = s.wsUrl || "", this.socket = null, this.reconnectAttempts = 0, this.maxReconnectAttempts = s.maxReconnectAttempts || 5, this.reconnectDelay = s.reconnectDelay || 3e3, this.handlers = {
|
|
8
8
|
message: [],
|
|
9
9
|
open: [],
|
|
10
10
|
close: [],
|
|
@@ -22,10 +22,10 @@ class Lt {
|
|
|
22
22
|
console.log("[VueChatKit] WebSocket 连接成功"), this.isConnecting = !1, this.reconnectAttempts = 0, this.emit("open");
|
|
23
23
|
}, this.socket.onmessage = (e) => {
|
|
24
24
|
try {
|
|
25
|
-
const
|
|
26
|
-
this.emit("message",
|
|
27
|
-
} catch (
|
|
28
|
-
console.error("[VueChatKit] WebSocket 消息解析失败",
|
|
25
|
+
const s = e.data;
|
|
26
|
+
this.emit("message", s);
|
|
27
|
+
} catch (s) {
|
|
28
|
+
console.error("[VueChatKit] WebSocket 消息解析失败", s);
|
|
29
29
|
}
|
|
30
30
|
}, this.socket.onclose = (e) => {
|
|
31
31
|
console.log("[VueChatKit] WebSocket 连接关闭", e.code), this.isConnecting = !1, this.emit("close", e), !this.manualClose && e.code !== 1e3 && this.reconnect();
|
|
@@ -40,40 +40,40 @@ class Lt {
|
|
|
40
40
|
/**
|
|
41
41
|
* 发送消息
|
|
42
42
|
*/
|
|
43
|
-
send(e,
|
|
43
|
+
send(e, s, o = "text", F = "", T = "", z = 0) {
|
|
44
44
|
if (this.isConnected()) {
|
|
45
|
-
const
|
|
45
|
+
const w = JSON.stringify({
|
|
46
46
|
to: e,
|
|
47
|
-
msg:
|
|
47
|
+
msg: s,
|
|
48
48
|
type: o,
|
|
49
|
-
fileUrl:
|
|
50
|
-
fileName:
|
|
49
|
+
fileUrl: F,
|
|
50
|
+
fileName: T,
|
|
51
51
|
fileSize: z
|
|
52
52
|
});
|
|
53
|
-
return this.socket.send(
|
|
53
|
+
return this.socket.send(w), !0;
|
|
54
54
|
}
|
|
55
55
|
return console.warn("[VueChatKit] WebSocket 连接未建立,无法发送消息"), !1;
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* 注册事件监听
|
|
59
59
|
*/
|
|
60
|
-
on(e,
|
|
61
|
-
this.handlers[e] && this.handlers[e].push(
|
|
60
|
+
on(e, s) {
|
|
61
|
+
this.handlers[e] && this.handlers[e].push(s);
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* 移除事件监听
|
|
65
65
|
*/
|
|
66
|
-
off(e,
|
|
66
|
+
off(e, s) {
|
|
67
67
|
if (this.handlers[e]) {
|
|
68
|
-
const o = this.handlers[e].indexOf(
|
|
68
|
+
const o = this.handlers[e].indexOf(s);
|
|
69
69
|
o > -1 && this.handlers[e].splice(o, 1);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* 触发事件
|
|
74
74
|
*/
|
|
75
|
-
emit(e, ...
|
|
76
|
-
this.handlers[e] && this.handlers[e].forEach((o) => o(...
|
|
75
|
+
emit(e, ...s) {
|
|
76
|
+
this.handlers[e] && this.handlers[e].forEach((o) => o(...s));
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* 重连
|
|
@@ -99,17 +99,17 @@ class Lt {
|
|
|
99
99
|
return this.socket && this.socket.readyState === WebSocket.OPEN;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
class
|
|
103
|
-
constructor(e,
|
|
104
|
-
super(e), this.name = "RequestError", this.status =
|
|
102
|
+
class Ue extends Error {
|
|
103
|
+
constructor(e, s, o, F) {
|
|
104
|
+
super(e), this.name = "RequestError", this.status = s || 0, this.code = o || 0, this.data = F;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
class
|
|
107
|
+
class Mt {
|
|
108
108
|
constructor(e = {}) {
|
|
109
|
-
this.baseUrl = e.baseUrl || "", this.timeout = e.timeout || 1e4, this.headers = e.headers || {}, this.requestInterceptors = [], this.responseInterceptors = [], this.addRequestInterceptor((
|
|
109
|
+
this.baseUrl = e.baseUrl || "", this.timeout = e.timeout || 1e4, this.headers = e.headers || {}, this.requestInterceptors = [], this.responseInterceptors = [], this.addRequestInterceptor((s) => (s.body instanceof FormData || (s.headers = {
|
|
110
110
|
"Content-Type": "application/json",
|
|
111
|
-
...
|
|
112
|
-
}),
|
|
111
|
+
...s.headers
|
|
112
|
+
}), s));
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
115
115
|
* 添加请求拦截器
|
|
@@ -127,79 +127,79 @@ class Tt {
|
|
|
127
127
|
* 超时控制
|
|
128
128
|
*/
|
|
129
129
|
timeoutPromise(e) {
|
|
130
|
-
return new Promise((
|
|
130
|
+
return new Promise((s, o) => {
|
|
131
131
|
setTimeout(() => {
|
|
132
|
-
o(new
|
|
132
|
+
o(new Ue("请求超时", 408, 408));
|
|
133
133
|
}, e);
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
137
|
* 核心请求方法
|
|
138
138
|
*/
|
|
139
|
-
async request(e,
|
|
140
|
-
const { method: o = "GET", headers:
|
|
141
|
-
let
|
|
139
|
+
async request(e, s = {}) {
|
|
140
|
+
const { method: o = "GET", headers: F = {}, body: T, params: z } = s;
|
|
141
|
+
let w = e.startsWith("http") ? e : `${this.baseUrl}${e}`, U = {
|
|
142
142
|
method: o,
|
|
143
|
-
headers: { ...this.headers, ...
|
|
144
|
-
body:
|
|
143
|
+
headers: { ...this.headers, ...F },
|
|
144
|
+
body: T,
|
|
145
145
|
params: z
|
|
146
146
|
};
|
|
147
|
-
this.requestInterceptors.forEach((
|
|
148
|
-
|
|
147
|
+
this.requestInterceptors.forEach((m) => {
|
|
148
|
+
U = m(U);
|
|
149
149
|
});
|
|
150
150
|
const V = {
|
|
151
|
-
method:
|
|
152
|
-
headers:
|
|
151
|
+
method: U.method,
|
|
152
|
+
headers: U.headers,
|
|
153
153
|
credentials: "include"
|
|
154
154
|
};
|
|
155
|
-
if (
|
|
156
|
-
const
|
|
157
|
-
for (const
|
|
158
|
-
|
|
159
|
-
const
|
|
160
|
-
|
|
155
|
+
if (U.body && o !== "GET" && (U.body instanceof FormData ? V.body = U.body : typeof U.body == "object" ? V.body = JSON.stringify(U.body) : V.body = U.body), U.params) {
|
|
156
|
+
const m = new URLSearchParams();
|
|
157
|
+
for (const C in U.params)
|
|
158
|
+
U.params[C] !== void 0 && U.params[C] !== null && U.params[C] !== "" && m.append(C, U.params[C]);
|
|
159
|
+
const _ = m.toString();
|
|
160
|
+
_ && (w += (w.includes("?") ? "&" : "?") + _);
|
|
161
161
|
}
|
|
162
162
|
try {
|
|
163
|
-
let
|
|
164
|
-
fetch(
|
|
163
|
+
let _ = await Promise.race([
|
|
164
|
+
fetch(w, V),
|
|
165
165
|
this.timeoutPromise(this.timeout)
|
|
166
166
|
]);
|
|
167
|
-
if (this.responseInterceptors.forEach((
|
|
168
|
-
|
|
169
|
-
}), !
|
|
170
|
-
throw new
|
|
171
|
-
`HTTP ${
|
|
172
|
-
|
|
173
|
-
|
|
167
|
+
if (this.responseInterceptors.forEach((N) => {
|
|
168
|
+
_ = N(_);
|
|
169
|
+
}), !_.ok)
|
|
170
|
+
throw new Ue(
|
|
171
|
+
`HTTP ${_.status}: ${_.statusText}`,
|
|
172
|
+
_.status,
|
|
173
|
+
_.status
|
|
174
174
|
);
|
|
175
|
-
const
|
|
176
|
-
let
|
|
177
|
-
return
|
|
178
|
-
} catch (
|
|
179
|
-
throw
|
|
180
|
-
|
|
175
|
+
const C = _.headers.get("content-type");
|
|
176
|
+
let R;
|
|
177
|
+
return C && C.includes("application/json") ? R = await _.json() : R = await _.text(), R;
|
|
178
|
+
} catch (m) {
|
|
179
|
+
throw m instanceof Ue ? m : new Ue(
|
|
180
|
+
m instanceof Error ? m.message : "网络错误",
|
|
181
181
|
0,
|
|
182
182
|
0
|
|
183
183
|
);
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
// 便捷方法
|
|
187
|
-
get(e,
|
|
188
|
-
return this.request(e, { ...o, method: "GET", params:
|
|
187
|
+
get(e, s, o) {
|
|
188
|
+
return this.request(e, { ...o, method: "GET", params: s });
|
|
189
189
|
}
|
|
190
|
-
post(e,
|
|
191
|
-
return this.request(e, { ...o, method: "POST", body:
|
|
190
|
+
post(e, s, o) {
|
|
191
|
+
return this.request(e, { ...o, method: "POST", body: s });
|
|
192
192
|
}
|
|
193
|
-
put(e,
|
|
194
|
-
return this.request(e, { ...o, method: "PUT", body:
|
|
193
|
+
put(e, s, o) {
|
|
194
|
+
return this.request(e, { ...o, method: "PUT", body: s });
|
|
195
195
|
}
|
|
196
|
-
delete(e,
|
|
197
|
-
return this.request(e, { ...
|
|
196
|
+
delete(e, s) {
|
|
197
|
+
return this.request(e, { ...s, method: "DELETE" });
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
class
|
|
201
|
-
constructor(e,
|
|
202
|
-
this.config = e, this.endpoints = e.api.endpoints, this.customAdapter = e.api.adapter,
|
|
200
|
+
class Be {
|
|
201
|
+
constructor(e, s = null) {
|
|
202
|
+
this.config = e, this.endpoints = e.api.endpoints, this.customAdapter = e.api.adapter, s ? this.http = s : this.http = new Mt({
|
|
203
203
|
baseUrl: e.api.baseUrl,
|
|
204
204
|
headers: e.headers
|
|
205
205
|
});
|
|
@@ -207,8 +207,8 @@ class zt {
|
|
|
207
207
|
/**
|
|
208
208
|
* 使用自定义适配器或默认实现
|
|
209
209
|
*/
|
|
210
|
-
async _call(e, ...
|
|
211
|
-
return this.customAdapter && typeof this.customAdapter[e] == "function" ? this.customAdapter[e](...
|
|
210
|
+
async _call(e, ...s) {
|
|
211
|
+
return this.customAdapter && typeof this.customAdapter[e] == "function" ? this.customAdapter[e](...s) : this[`_${e}`](...s);
|
|
212
212
|
}
|
|
213
213
|
// ========== 好友相关 ==========
|
|
214
214
|
/**
|
|
@@ -232,11 +232,11 @@ class zt {
|
|
|
232
232
|
/**
|
|
233
233
|
* 添加好友
|
|
234
234
|
*/
|
|
235
|
-
async addFriend(e,
|
|
236
|
-
return this._call("addFriend", e,
|
|
235
|
+
async addFriend(e, s) {
|
|
236
|
+
return this._call("addFriend", e, s);
|
|
237
237
|
}
|
|
238
|
-
async _addFriend(e,
|
|
239
|
-
return this.http.post(this.endpoints.addFriend, { currentUser: e, friendUser:
|
|
238
|
+
async _addFriend(e, s) {
|
|
239
|
+
return this.http.post(this.endpoints.addFriend, { currentUser: e, friendUser: s });
|
|
240
240
|
}
|
|
241
241
|
/**
|
|
242
242
|
* 获取好友申请列表
|
|
@@ -250,39 +250,39 @@ class zt {
|
|
|
250
250
|
/**
|
|
251
251
|
* 同意好友申请
|
|
252
252
|
*/
|
|
253
|
-
async agreeFriend(e,
|
|
254
|
-
return this._call("agreeFriend", e,
|
|
253
|
+
async agreeFriend(e, s) {
|
|
254
|
+
return this._call("agreeFriend", e, s);
|
|
255
255
|
}
|
|
256
|
-
async _agreeFriend(e,
|
|
257
|
-
return this.http.post(this.endpoints.agreeFriend, { applyUser: e, friendUser:
|
|
256
|
+
async _agreeFriend(e, s) {
|
|
257
|
+
return this.http.post(this.endpoints.agreeFriend, { applyUser: e, friendUser: s });
|
|
258
258
|
}
|
|
259
259
|
/**
|
|
260
260
|
* 设置好友聊天状态
|
|
261
261
|
*/
|
|
262
|
-
async setChatStatus(e,
|
|
263
|
-
return this._call("setChatStatus", e,
|
|
262
|
+
async setChatStatus(e, s, o = 1) {
|
|
263
|
+
return this._call("setChatStatus", e, s, o);
|
|
264
264
|
}
|
|
265
|
-
async _setChatStatus(e,
|
|
266
|
-
return this.http.post(this.endpoints.setChatStatus, null, { params: { currentUser: e, friendUser:
|
|
265
|
+
async _setChatStatus(e, s, o) {
|
|
266
|
+
return this.http.post(this.endpoints.setChatStatus, null, { params: { currentUser: e, friendUser: s, status: o } });
|
|
267
267
|
}
|
|
268
268
|
// ========== 消息相关 ==========
|
|
269
269
|
/**
|
|
270
270
|
* 获取聊天历史
|
|
271
271
|
*/
|
|
272
|
-
async getHistory(e,
|
|
273
|
-
return this._call("getHistory", e,
|
|
272
|
+
async getHistory(e, s) {
|
|
273
|
+
return this._call("getHistory", e, s);
|
|
274
274
|
}
|
|
275
|
-
async _getHistory(e,
|
|
276
|
-
return this.http.get(this.endpoints.getHistory, { fromUser: e, toUser:
|
|
275
|
+
async _getHistory(e, s) {
|
|
276
|
+
return this.http.get(this.endpoints.getHistory, { fromUser: e, toUser: s });
|
|
277
277
|
}
|
|
278
278
|
/**
|
|
279
279
|
* 标记消息已读
|
|
280
280
|
*/
|
|
281
|
-
async setRead(e,
|
|
282
|
-
return this._call("setRead", e,
|
|
281
|
+
async setRead(e, s) {
|
|
282
|
+
return this._call("setRead", e, s);
|
|
283
283
|
}
|
|
284
|
-
async _setRead(e,
|
|
285
|
-
return this.http.post(this.endpoints.setRead, { currentUser: e, friendUser:
|
|
284
|
+
async _setRead(e, s) {
|
|
285
|
+
return this.http.post(this.endpoints.setRead, { currentUser: e, friendUser: s });
|
|
286
286
|
}
|
|
287
287
|
// ========== 文件相关 ==========
|
|
288
288
|
/**
|
|
@@ -292,8 +292,8 @@ class zt {
|
|
|
292
292
|
return this._call("uploadFile", e);
|
|
293
293
|
}
|
|
294
294
|
async _uploadFile(e) {
|
|
295
|
-
const
|
|
296
|
-
return
|
|
295
|
+
const s = new FormData();
|
|
296
|
+
return s.append("file", e), this.http.post(this.endpoints.uploadFile, s);
|
|
297
297
|
}
|
|
298
298
|
// ========== 用户相关 ==========
|
|
299
299
|
/**
|
|
@@ -308,11 +308,11 @@ class zt {
|
|
|
308
308
|
/**
|
|
309
309
|
* 更新用户信息
|
|
310
310
|
*/
|
|
311
|
-
async updateUserInfo(e,
|
|
312
|
-
return this._call("updateUserInfo", e,
|
|
311
|
+
async updateUserInfo(e, s) {
|
|
312
|
+
return this._call("updateUserInfo", e, s);
|
|
313
313
|
}
|
|
314
|
-
async _updateUserInfo(e,
|
|
315
|
-
return this.http.put(this.endpoints.updateUserInfo, { username: e, ...
|
|
314
|
+
async _updateUserInfo(e, s) {
|
|
315
|
+
return this.http.put(this.endpoints.updateUserInfo, { username: e, ...s });
|
|
316
316
|
}
|
|
317
317
|
/**
|
|
318
318
|
* 获取用户头像
|
|
@@ -326,195 +326,209 @@ class zt {
|
|
|
326
326
|
/**
|
|
327
327
|
* 上传头像
|
|
328
328
|
*/
|
|
329
|
-
async uploadAvatar(e,
|
|
330
|
-
return this._call("uploadAvatar", e,
|
|
329
|
+
async uploadAvatar(e, s) {
|
|
330
|
+
return this._call("uploadAvatar", e, s);
|
|
331
331
|
}
|
|
332
|
-
async _uploadAvatar(e,
|
|
332
|
+
async _uploadAvatar(e, s) {
|
|
333
333
|
const o = new FormData();
|
|
334
|
-
return o.append("file", e), o.append("username",
|
|
334
|
+
return o.append("file", e), o.append("username", s), this.http.post(this.endpoints.uploadAvatar, o);
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
337
|
+
const $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
338
|
+
__proto__: null,
|
|
339
|
+
ChatApi: Be,
|
|
340
|
+
default: Be
|
|
341
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
342
|
+
function Et(y) {
|
|
343
|
+
const e = new Be(y);
|
|
344
|
+
let s = null;
|
|
345
|
+
const o = y.user.username, F = f(y.user.avatar || `https://api.dicebear.com/7.x/avataaars/svg?seed=${o}`), T = f({
|
|
341
346
|
username: o,
|
|
342
347
|
nickname: y.user.nickname || "",
|
|
343
348
|
email: y.user.email || "",
|
|
344
349
|
phone: y.user.phone || "",
|
|
345
350
|
bio: y.user.bio || ""
|
|
346
|
-
}), z =
|
|
347
|
-
let
|
|
348
|
-
if (
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
(c) =>
|
|
351
|
+
}), z = f(!1), w = f([]), U = f([]), V = f([]), m = f(""), _ = f(""), C = f(""), R = f(null), N = f(!1), G = f(""), J = f([]), Q = f(!1), le = f([]), te = f(!1), g = re(() => {
|
|
352
|
+
let a = U.value;
|
|
353
|
+
if (_.value) {
|
|
354
|
+
const i = _.value.toLowerCase();
|
|
355
|
+
a = a.filter(
|
|
356
|
+
(c) => {
|
|
357
|
+
var S;
|
|
358
|
+
return (S = c.username) == null ? void 0 : S.toLowerCase().includes(i);
|
|
359
|
+
}
|
|
352
360
|
);
|
|
353
361
|
}
|
|
354
|
-
return
|
|
355
|
-
id:
|
|
356
|
-
name:
|
|
357
|
-
avatar:
|
|
358
|
-
online:
|
|
359
|
-
lastMsg:
|
|
360
|
-
lastTime:
|
|
361
|
-
unread:
|
|
362
|
+
return a.map((i) => ({
|
|
363
|
+
id: i.username,
|
|
364
|
+
name: i.username,
|
|
365
|
+
avatar: i.avatar || F.value,
|
|
366
|
+
online: i.online,
|
|
367
|
+
lastMsg: i.lastMsg || "暂无消息",
|
|
368
|
+
lastTime: i.lastTime,
|
|
369
|
+
unread: i.unReadNum || 0
|
|
362
370
|
}));
|
|
363
|
-
}),
|
|
364
|
-
let
|
|
365
|
-
if (
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
(c) =>
|
|
371
|
+
}), x = re(() => {
|
|
372
|
+
let a = w.value;
|
|
373
|
+
if (_.value) {
|
|
374
|
+
const i = _.value.toLowerCase();
|
|
375
|
+
a = a.filter(
|
|
376
|
+
(c) => {
|
|
377
|
+
var S;
|
|
378
|
+
return (S = c.username) == null ? void 0 : S.toLowerCase().includes(i);
|
|
379
|
+
}
|
|
369
380
|
);
|
|
370
381
|
}
|
|
371
|
-
return
|
|
372
|
-
id:
|
|
373
|
-
name:
|
|
374
|
-
avatar:
|
|
375
|
-
online:
|
|
376
|
-
isChatting:
|
|
382
|
+
return a.map((i) => ({
|
|
383
|
+
id: i.username,
|
|
384
|
+
name: i.username,
|
|
385
|
+
avatar: i.avatar || F.value,
|
|
386
|
+
online: i.online,
|
|
387
|
+
isChatting: i.isChatting
|
|
377
388
|
}));
|
|
378
|
-
}), A =
|
|
379
|
-
(
|
|
380
|
-
|
|
381
|
-
|
|
389
|
+
}), A = re(() => G.value ? J.value.filter(
|
|
390
|
+
(a) => {
|
|
391
|
+
var i;
|
|
392
|
+
return (i = a.username) == null ? void 0 : i.toLowerCase().includes(G.value.toLowerCase());
|
|
393
|
+
}
|
|
394
|
+
) : J.value), E = re(() => g.value.find((a) => a.id === m.value) || null), ie = re(() => V.value.map((a) => {
|
|
395
|
+
const i = a.type === "file" || a.fileUrl || a.fileName, c = a.fileName || a.msgContent;
|
|
382
396
|
return {
|
|
383
|
-
text:
|
|
384
|
-
isSelf:
|
|
385
|
-
time:
|
|
386
|
-
sendUsername:
|
|
387
|
-
type:
|
|
388
|
-
fileType:
|
|
389
|
-
fileUrl:
|
|
397
|
+
text: a.msgContent,
|
|
398
|
+
isSelf: a.sendUsername === o,
|
|
399
|
+
time: a.createTime,
|
|
400
|
+
sendUsername: a.sendUsername,
|
|
401
|
+
type: i ? "file" : "text",
|
|
402
|
+
fileType: ge(c) ? "image" : ye(c),
|
|
403
|
+
fileUrl: a.fileUrl || "",
|
|
390
404
|
fileName: c,
|
|
391
|
-
fileSize:
|
|
405
|
+
fileSize: a.fileSize || 0
|
|
392
406
|
};
|
|
393
|
-
})), P = (
|
|
394
|
-
if (!
|
|
395
|
-
const
|
|
396
|
-
return
|
|
397
|
-
},
|
|
398
|
-
if (!
|
|
399
|
-
const
|
|
400
|
-
return
|
|
401
|
-
}, ye = (
|
|
402
|
-
if (!
|
|
403
|
-
const
|
|
404
|
-
return ["xls", "xlsx"].includes(
|
|
405
|
-
},
|
|
406
|
-
|
|
407
|
-
|
|
407
|
+
})), P = (a) => We(a).format("HH:mm"), he = (a) => {
|
|
408
|
+
if (!a) return "";
|
|
409
|
+
const i = We(), c = We(a);
|
|
410
|
+
return i.isSame(c, "day") ? c.format("HH:mm") : i.diff(c, "day") === 1 ? "昨天" : i.diff(c, "day") < 7 ? ["周日", "周一", "周二", "周三", "周四", "周五", "周六"][c.day()] : c.format("MM/DD");
|
|
411
|
+
}, ge = (a) => {
|
|
412
|
+
if (!a) return !1;
|
|
413
|
+
const i = ["jpg", "jpeg", "png", "gif", "bmp", "webp", "svg"], c = a.split(".").pop().toLowerCase();
|
|
414
|
+
return i.includes(c);
|
|
415
|
+
}, ye = (a) => {
|
|
416
|
+
if (!a) return "default";
|
|
417
|
+
const i = a.split(".").pop().toLowerCase();
|
|
418
|
+
return ["xls", "xlsx"].includes(i) ? "excel" : ["pdf"].includes(i) ? "pdf" : ["doc", "docx"].includes(i) ? "docx" : "default";
|
|
419
|
+
}, O = () => {
|
|
420
|
+
Ne(() => {
|
|
421
|
+
R.value && (R.value.scrollTop = R.value.scrollHeight);
|
|
408
422
|
});
|
|
409
|
-
},
|
|
423
|
+
}, K = async () => {
|
|
410
424
|
try {
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
for (const c of
|
|
425
|
+
const i = (await e.getFriends(o)).data || [];
|
|
426
|
+
w.value = i, U.value = i.filter((c) => c.isChatting === 1);
|
|
427
|
+
for (const c of U.value)
|
|
414
428
|
try {
|
|
415
|
-
const
|
|
416
|
-
c.unReadNum =
|
|
417
|
-
(
|
|
429
|
+
const se = (await e.getHistory(o, c.username)).data || [];
|
|
430
|
+
c.unReadNum = se.filter(
|
|
431
|
+
(ee) => ee.isRead === 0 && ee.sendUsername === c.username
|
|
418
432
|
).length;
|
|
419
433
|
} catch {
|
|
420
434
|
c.unReadNum = 0;
|
|
421
435
|
}
|
|
422
|
-
} catch (
|
|
423
|
-
console.error("[VueChatKit] 获取好友列表失败",
|
|
436
|
+
} catch (a) {
|
|
437
|
+
console.error("[VueChatKit] 获取好友列表失败", a);
|
|
424
438
|
}
|
|
425
|
-
},
|
|
439
|
+
}, oe = async (a) => {
|
|
426
440
|
try {
|
|
427
|
-
const
|
|
428
|
-
V.value =
|
|
429
|
-
} catch (
|
|
430
|
-
console.error("[VueChatKit] 获取聊天历史失败",
|
|
441
|
+
const i = await e.getHistory(o, a);
|
|
442
|
+
V.value = i.data || [], O();
|
|
443
|
+
} catch (i) {
|
|
444
|
+
console.error("[VueChatKit] 获取聊天历史失败", i);
|
|
431
445
|
}
|
|
432
|
-
},
|
|
446
|
+
}, He = async (a) => {
|
|
433
447
|
try {
|
|
434
|
-
await e.setRead(o,
|
|
435
|
-
} catch (
|
|
436
|
-
console.error("[VueChatKit] 标记已读失败",
|
|
448
|
+
await e.setRead(o, a), K();
|
|
449
|
+
} catch (i) {
|
|
450
|
+
console.error("[VueChatKit] 标记已读失败", i);
|
|
437
451
|
}
|
|
438
|
-
},
|
|
439
|
-
|
|
440
|
-
},
|
|
452
|
+
}, xe = async (a) => {
|
|
453
|
+
m.value = a.id, await oe(a.id), await He(a.id), O();
|
|
454
|
+
}, Ae = async (a, i = 1) => {
|
|
441
455
|
try {
|
|
442
|
-
return await e.setChatStatus(o,
|
|
456
|
+
return await e.setChatStatus(o, a, i), await K(), !0;
|
|
443
457
|
} catch (c) {
|
|
444
458
|
return console.error("[VueChatKit] 设置聊天状态失败", c), !1;
|
|
445
459
|
}
|
|
446
|
-
},
|
|
447
|
-
if (!
|
|
448
|
-
if (
|
|
449
|
-
const
|
|
450
|
-
msgContent:
|
|
460
|
+
}, _e = () => {
|
|
461
|
+
if (!C.value.trim() || !m.value || !s) return;
|
|
462
|
+
if (s.send(m.value, C.value.trim(), "text")) {
|
|
463
|
+
const i = {
|
|
464
|
+
msgContent: C.value.trim(),
|
|
451
465
|
sendUsername: o,
|
|
452
|
-
receiveUsername:
|
|
466
|
+
receiveUsername: m.value,
|
|
453
467
|
createTime: /* @__PURE__ */ new Date(),
|
|
454
468
|
isRead: 0,
|
|
455
469
|
type: "text"
|
|
456
470
|
};
|
|
457
|
-
V.value.push(
|
|
458
|
-
|
|
471
|
+
V.value.push(i), C.value = "", O(), setTimeout(() => {
|
|
472
|
+
oe(m.value), K();
|
|
459
473
|
}, 300);
|
|
460
474
|
}
|
|
461
|
-
}, be = async (
|
|
462
|
-
if (!
|
|
475
|
+
}, be = async (a) => {
|
|
476
|
+
if (!m.value || !s) return !1;
|
|
463
477
|
try {
|
|
464
|
-
const
|
|
465
|
-
if (
|
|
466
|
-
const { fileUrl: c, fileName:
|
|
467
|
-
if (
|
|
468
|
-
|
|
469
|
-
|
|
478
|
+
const i = await e.uploadFile(a);
|
|
479
|
+
if (i.code === 200 && i.data) {
|
|
480
|
+
const { fileUrl: c, fileName: S } = i.data;
|
|
481
|
+
if (s.send(
|
|
482
|
+
m.value,
|
|
483
|
+
S,
|
|
470
484
|
"file",
|
|
471
485
|
c,
|
|
472
|
-
|
|
473
|
-
|
|
486
|
+
S,
|
|
487
|
+
a.size
|
|
474
488
|
)) {
|
|
475
|
-
const
|
|
476
|
-
msgContent:
|
|
489
|
+
const ee = {
|
|
490
|
+
msgContent: S,
|
|
477
491
|
sendUsername: o,
|
|
478
|
-
receiveUsername:
|
|
492
|
+
receiveUsername: m.value,
|
|
479
493
|
createTime: /* @__PURE__ */ new Date(),
|
|
480
494
|
isRead: 0,
|
|
481
495
|
type: "file",
|
|
482
496
|
fileUrl: c,
|
|
483
|
-
fileName:
|
|
484
|
-
fileSize:
|
|
497
|
+
fileName: S,
|
|
498
|
+
fileSize: a.size
|
|
485
499
|
};
|
|
486
|
-
return V.value.push(
|
|
500
|
+
return V.value.push(ee), O(), !0;
|
|
487
501
|
}
|
|
488
502
|
}
|
|
489
503
|
return !1;
|
|
490
|
-
} catch (
|
|
491
|
-
return console.error("[VueChatKit] 发送文件失败",
|
|
504
|
+
} catch (i) {
|
|
505
|
+
return console.error("[VueChatKit] 发送文件失败", i), !1;
|
|
492
506
|
}
|
|
493
|
-
},
|
|
494
|
-
if (!(!
|
|
495
|
-
if (
|
|
496
|
-
const
|
|
497
|
-
msgContent:
|
|
507
|
+
}, Ce = async (a, i) => {
|
|
508
|
+
if (!(!m.value || !s)) {
|
|
509
|
+
if (i && i.trim() && s.send(m.value, i.trim(), "text")) {
|
|
510
|
+
const S = {
|
|
511
|
+
msgContent: i.trim(),
|
|
498
512
|
sendUsername: o,
|
|
499
|
-
receiveUsername:
|
|
513
|
+
receiveUsername: m.value,
|
|
500
514
|
createTime: /* @__PURE__ */ new Date(),
|
|
501
515
|
isRead: 0,
|
|
502
516
|
type: "text"
|
|
503
517
|
};
|
|
504
|
-
V.value.push(
|
|
518
|
+
V.value.push(S);
|
|
505
519
|
}
|
|
506
|
-
for (const c of
|
|
507
|
-
const
|
|
508
|
-
await be(
|
|
520
|
+
for (const c of a) {
|
|
521
|
+
const S = c.file || c;
|
|
522
|
+
await be(S);
|
|
509
523
|
}
|
|
510
524
|
setTimeout(() => {
|
|
511
|
-
|
|
525
|
+
oe(m.value), K();
|
|
512
526
|
}, 300);
|
|
513
527
|
}
|
|
514
|
-
},
|
|
528
|
+
}, Se = (a) => {
|
|
515
529
|
try {
|
|
516
530
|
try {
|
|
517
|
-
const c = JSON.parse(
|
|
531
|
+
const c = JSON.parse(a);
|
|
518
532
|
if (c.to || c.msg)
|
|
519
533
|
return {
|
|
520
534
|
to: c.to,
|
|
@@ -526,182 +540,182 @@ function jt(y) {
|
|
|
526
540
|
};
|
|
527
541
|
} catch {
|
|
528
542
|
}
|
|
529
|
-
const
|
|
530
|
-
if (
|
|
543
|
+
const i = a.match(/^\[(.+?)\]:(.+)$/);
|
|
544
|
+
if (i)
|
|
531
545
|
return {
|
|
532
|
-
username:
|
|
533
|
-
content:
|
|
546
|
+
username: i[1],
|
|
547
|
+
content: i[2],
|
|
534
548
|
type: "text"
|
|
535
549
|
};
|
|
536
|
-
} catch (
|
|
537
|
-
console.error("[VueChatKit] 解析消息失败",
|
|
550
|
+
} catch (i) {
|
|
551
|
+
console.error("[VueChatKit] 解析消息失败", i);
|
|
538
552
|
}
|
|
539
553
|
return null;
|
|
540
|
-
},
|
|
541
|
-
if (
|
|
542
|
-
const c = /【状态变更】(.+?) 已(上线|下线)/,
|
|
543
|
-
if (
|
|
544
|
-
const
|
|
545
|
-
|
|
554
|
+
}, Ve = (a) => {
|
|
555
|
+
if (a.includes("【状态变更】")) {
|
|
556
|
+
const c = /【状态变更】(.+?) 已(上线|下线)/, S = a.match(c);
|
|
557
|
+
if (S) {
|
|
558
|
+
const se = S[1], ee = S[2] === "上线", ve = w.value.find((B) => B.username === se);
|
|
559
|
+
ve && (ve.online = ee);
|
|
546
560
|
}
|
|
547
561
|
return;
|
|
548
562
|
}
|
|
549
|
-
const
|
|
550
|
-
if (
|
|
551
|
-
if (
|
|
563
|
+
const i = Se(a);
|
|
564
|
+
if (i) {
|
|
565
|
+
if (m.value) {
|
|
552
566
|
try {
|
|
553
567
|
let c = {
|
|
554
|
-
msgContent:
|
|
555
|
-
sendUsername:
|
|
568
|
+
msgContent: i.content,
|
|
569
|
+
sendUsername: i.username || m.value,
|
|
556
570
|
receiveUsername: o,
|
|
557
571
|
createTime: /* @__PURE__ */ new Date(),
|
|
558
572
|
isRead: 0,
|
|
559
|
-
type:
|
|
560
|
-
fileUrl:
|
|
561
|
-
fileName:
|
|
562
|
-
fileSize:
|
|
573
|
+
type: i.type || "text",
|
|
574
|
+
fileUrl: i.fileUrl || "",
|
|
575
|
+
fileName: i.fileName || "",
|
|
576
|
+
fileSize: i.fileSize || 0
|
|
563
577
|
};
|
|
564
|
-
V.value.push(c),
|
|
578
|
+
V.value.push(c), O();
|
|
565
579
|
} catch (c) {
|
|
566
580
|
console.error("[VueChatKit] 添加临时消息失败", c);
|
|
567
581
|
}
|
|
568
|
-
|
|
582
|
+
oe(m.value);
|
|
569
583
|
}
|
|
570
|
-
|
|
584
|
+
K();
|
|
571
585
|
}
|
|
572
|
-
},
|
|
573
|
-
const
|
|
574
|
-
|
|
575
|
-
wsUrl:
|
|
586
|
+
}, Fe = () => {
|
|
587
|
+
const a = `${y.api.websocketUrl}?userId=${o}`;
|
|
588
|
+
s = new Dt(o, {
|
|
589
|
+
wsUrl: a,
|
|
576
590
|
maxReconnectAttempts: y.websocket.maxReconnectAttempts,
|
|
577
591
|
reconnectDelay: y.websocket.reconnectDelay
|
|
578
|
-
}),
|
|
579
|
-
},
|
|
580
|
-
|
|
581
|
-
}, Re = async () => {
|
|
582
|
-
B.value = !0, Y.value = "", await Ie();
|
|
592
|
+
}), s.on("message", Ve), s.connect();
|
|
593
|
+
}, Re = () => {
|
|
594
|
+
s && (s.close(), s = null);
|
|
583
595
|
}, Ie = async () => {
|
|
584
|
-
|
|
596
|
+
N.value = !0, G.value = "", await Le();
|
|
597
|
+
}, Le = async () => {
|
|
598
|
+
Q.value = !0;
|
|
585
599
|
try {
|
|
586
|
-
const
|
|
587
|
-
|
|
588
|
-
} catch (
|
|
589
|
-
console.error("[VueChatKit] 获取可用用户失败",
|
|
600
|
+
const a = await e.getAvailableUsers(o);
|
|
601
|
+
J.value = (a == null ? void 0 : a.data) || [];
|
|
602
|
+
} catch (a) {
|
|
603
|
+
console.error("[VueChatKit] 获取可用用户失败", a);
|
|
590
604
|
} finally {
|
|
591
|
-
|
|
605
|
+
Q.value = !1;
|
|
592
606
|
}
|
|
593
|
-
},
|
|
607
|
+
}, Te = async (a) => {
|
|
594
608
|
try {
|
|
595
|
-
await e.addFriend(o,
|
|
596
|
-
} catch (
|
|
597
|
-
console.error("[VueChatKit] 添加好友失败",
|
|
609
|
+
await e.addFriend(o, a.username), await K(), N.value = !1;
|
|
610
|
+
} catch (i) {
|
|
611
|
+
console.error("[VueChatKit] 添加好友失败", i);
|
|
598
612
|
}
|
|
599
|
-
},
|
|
600
|
-
|
|
613
|
+
}, Z = async () => {
|
|
614
|
+
te.value = !0;
|
|
601
615
|
try {
|
|
602
|
-
const
|
|
603
|
-
|
|
604
|
-
} catch (
|
|
605
|
-
console.error("[VueChatKit] 获取好友申请列表失败",
|
|
616
|
+
const a = await e.getApplyList(o);
|
|
617
|
+
le.value = a.data || [];
|
|
618
|
+
} catch (a) {
|
|
619
|
+
console.error("[VueChatKit] 获取好友申请列表失败", a);
|
|
606
620
|
} finally {
|
|
607
|
-
|
|
621
|
+
te.value = !1;
|
|
608
622
|
}
|
|
609
|
-
},
|
|
623
|
+
}, de = async (a) => {
|
|
610
624
|
try {
|
|
611
|
-
await e.agreeFriend(
|
|
612
|
-
} catch (
|
|
613
|
-
console.error("[VueChatKit] 同意好友申请失败",
|
|
625
|
+
await e.agreeFriend(a, o), await Z(), await K();
|
|
626
|
+
} catch (i) {
|
|
627
|
+
console.error("[VueChatKit] 同意好友申请失败", i);
|
|
614
628
|
}
|
|
615
629
|
}, D = async () => {
|
|
616
630
|
try {
|
|
617
|
-
const
|
|
618
|
-
|
|
619
|
-
} catch (
|
|
620
|
-
console.warn("[VueChatKit] 加载头像失败",
|
|
631
|
+
const a = await e.getUserAvatar(o);
|
|
632
|
+
a.code === 200 && a.data && (F.value = a.data);
|
|
633
|
+
} catch (a) {
|
|
634
|
+
console.warn("[VueChatKit] 加载头像失败", a);
|
|
621
635
|
}
|
|
622
|
-
}, M = (
|
|
623
|
-
|
|
624
|
-
},
|
|
636
|
+
}, M = (a) => {
|
|
637
|
+
F.value = a;
|
|
638
|
+
}, ue = async () => {
|
|
625
639
|
z.value = !0;
|
|
626
640
|
try {
|
|
627
|
-
const
|
|
628
|
-
|
|
629
|
-
...
|
|
630
|
-
...
|
|
641
|
+
const a = await e.getUserInfo(o);
|
|
642
|
+
a.code === 200 && a.data && (T.value = {
|
|
643
|
+
...T.value,
|
|
644
|
+
...a.data
|
|
631
645
|
});
|
|
632
|
-
} catch (
|
|
633
|
-
console.error("[VueChatKit] 获取用户信息失败",
|
|
646
|
+
} catch (a) {
|
|
647
|
+
console.error("[VueChatKit] 获取用户信息失败", a);
|
|
634
648
|
} finally {
|
|
635
649
|
z.value = !1;
|
|
636
650
|
}
|
|
637
|
-
},
|
|
651
|
+
}, H = async (a) => {
|
|
638
652
|
try {
|
|
639
|
-
return (await e.updateUserInfo(o,
|
|
640
|
-
...
|
|
641
|
-
...
|
|
653
|
+
return (await e.updateUserInfo(o, a)).code === 200 ? (T.value = {
|
|
654
|
+
...T.value,
|
|
655
|
+
...a
|
|
642
656
|
}, !0) : !1;
|
|
643
|
-
} catch (
|
|
644
|
-
return console.error("[VueChatKit] 更新用户信息失败",
|
|
657
|
+
} catch (i) {
|
|
658
|
+
return console.error("[VueChatKit] 更新用户信息失败", i), !1;
|
|
645
659
|
}
|
|
646
|
-
},
|
|
647
|
-
|
|
660
|
+
}, W = () => {
|
|
661
|
+
m.value = "", V.value = [], C.value = "", _.value = "";
|
|
648
662
|
};
|
|
649
663
|
return D(), {
|
|
650
664
|
// 状态
|
|
651
665
|
myUsername: o,
|
|
652
|
-
myAvatar:
|
|
653
|
-
userInfo:
|
|
666
|
+
myAvatar: F,
|
|
667
|
+
userInfo: T,
|
|
654
668
|
loadingUserInfo: z,
|
|
655
|
-
friendList:
|
|
656
|
-
chatList:
|
|
657
|
-
filteredFriendList:
|
|
669
|
+
friendList: w,
|
|
670
|
+
chatList: U,
|
|
671
|
+
filteredFriendList: x,
|
|
658
672
|
chatMsgList: V,
|
|
659
|
-
currentSelectName:
|
|
660
|
-
searchText:
|
|
661
|
-
inputText:
|
|
662
|
-
messagesContainer:
|
|
673
|
+
currentSelectName: m,
|
|
674
|
+
searchText: _,
|
|
675
|
+
inputText: C,
|
|
676
|
+
messagesContainer: R,
|
|
663
677
|
filteredUsers: g,
|
|
664
678
|
filteredAvailableUsers: A,
|
|
665
679
|
currentUser: E,
|
|
666
|
-
currentMessages:
|
|
667
|
-
addFriendDialogVisible:
|
|
668
|
-
addFriendSearchText:
|
|
669
|
-
availableUsers:
|
|
670
|
-
loadingAvailableUsers:
|
|
671
|
-
friendApplyList:
|
|
672
|
-
loadingFriendApply:
|
|
680
|
+
currentMessages: ie,
|
|
681
|
+
addFriendDialogVisible: N,
|
|
682
|
+
addFriendSearchText: G,
|
|
683
|
+
availableUsers: J,
|
|
684
|
+
loadingAvailableUsers: Q,
|
|
685
|
+
friendApplyList: le,
|
|
686
|
+
loadingFriendApply: te,
|
|
673
687
|
// 方法
|
|
674
688
|
formatTime: P,
|
|
675
|
-
formatLastTime:
|
|
676
|
-
scrollToBottom:
|
|
677
|
-
getFriendList:
|
|
678
|
-
getChatHistory:
|
|
679
|
-
setFriendToChatStatus:
|
|
680
|
-
selectUser:
|
|
681
|
-
sendMessage:
|
|
689
|
+
formatLastTime: he,
|
|
690
|
+
scrollToBottom: O,
|
|
691
|
+
getFriendList: K,
|
|
692
|
+
getChatHistory: oe,
|
|
693
|
+
setFriendToChatStatus: Ae,
|
|
694
|
+
selectUser: xe,
|
|
695
|
+
sendMessage: _e,
|
|
682
696
|
sendFile: be,
|
|
683
|
-
sendFilesAndText:
|
|
684
|
-
initWebSocket:
|
|
685
|
-
closeWebSocket:
|
|
686
|
-
reset:
|
|
687
|
-
openAddFriendDialog:
|
|
688
|
-
addFriend:
|
|
689
|
-
loadFriendApplyList:
|
|
690
|
-
agreeFriend:
|
|
697
|
+
sendFilesAndText: Ce,
|
|
698
|
+
initWebSocket: Fe,
|
|
699
|
+
closeWebSocket: Re,
|
|
700
|
+
reset: W,
|
|
701
|
+
openAddFriendDialog: Ie,
|
|
702
|
+
addFriend: Te,
|
|
703
|
+
loadFriendApplyList: Z,
|
|
704
|
+
agreeFriend: de,
|
|
691
705
|
updateMyAvatar: M,
|
|
692
|
-
getUserInfo:
|
|
693
|
-
updateUserInfo:
|
|
706
|
+
getUserInfo: ue,
|
|
707
|
+
updateUserInfo: H
|
|
694
708
|
};
|
|
695
709
|
}
|
|
696
|
-
const
|
|
697
|
-
const
|
|
698
|
-
for (const [o,
|
|
699
|
-
|
|
700
|
-
return
|
|
701
|
-
},
|
|
710
|
+
const et = (y, e) => {
|
|
711
|
+
const s = y.__vccOpts || y;
|
|
712
|
+
for (const [o, F] of e)
|
|
713
|
+
s[o] = F;
|
|
714
|
+
return s;
|
|
715
|
+
}, Kt = { class: "avatar-crop-container" }, Wt = ["src"], Bt = { class: "crop-overlay" }, Nt = { class: "crop-box" }, Ht = {
|
|
702
716
|
key: 0,
|
|
703
717
|
class: "crop-mask"
|
|
704
|
-
},
|
|
718
|
+
}, qt = { class: "zoom-controls" }, Pt = {
|
|
705
719
|
__name: "AvatarCrop",
|
|
706
720
|
props: {
|
|
707
721
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -709,119 +723,119 @@ const Ge = (y, e) => {
|
|
|
709
723
|
},
|
|
710
724
|
emits: ["update:modelValue", "confirm"],
|
|
711
725
|
setup(y, { emit: e }) {
|
|
712
|
-
const
|
|
713
|
-
get: () =>
|
|
726
|
+
const s = y, o = e, F = re({
|
|
727
|
+
get: () => s.modelValue,
|
|
714
728
|
set: (g) => o("update:modelValue", g)
|
|
715
|
-
}),
|
|
716
|
-
|
|
717
|
-
g && (
|
|
729
|
+
}), T = f(""), z = f(null), w = f(null), U = f(null), V = f(1), m = f({ x: 0, y: 0 }), _ = f(!1), C = f({ x: 0, y: 0 }), R = f({ width: 0, height: 0 });
|
|
730
|
+
yt(() => s.src, (g) => {
|
|
731
|
+
g && (T.value = g, V.value = 1, m.value = { x: 0, y: 0 });
|
|
718
732
|
});
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
if (z.value &&
|
|
722
|
-
const g = z.value,
|
|
723
|
-
g.naturalWidth > g.naturalHeight ? (
|
|
724
|
-
x: (A -
|
|
725
|
-
y: (A -
|
|
733
|
+
const N = () => {
|
|
734
|
+
Ne(() => {
|
|
735
|
+
if (z.value && w.value) {
|
|
736
|
+
const g = z.value, x = w.value, A = Math.min(x.clientWidth, x.clientHeight);
|
|
737
|
+
g.naturalWidth > g.naturalHeight ? (R.value.height = A, R.value.width = g.naturalWidth / g.naturalHeight * A) : (R.value.width = A, R.value.height = g.naturalHeight / g.naturalWidth * A), m.value = {
|
|
738
|
+
x: (A - R.value.width) / 2,
|
|
739
|
+
y: (A - R.value.height) / 2
|
|
726
740
|
};
|
|
727
741
|
}
|
|
728
742
|
});
|
|
729
|
-
}, Y = (g) => {
|
|
730
|
-
x.value = !0;
|
|
731
|
-
const U = g.touches ? g.touches[0].clientX : g.clientX, A = g.touches ? g.touches[0].clientY : g.clientY;
|
|
732
|
-
_.value = { x: U - v.value.x, y: A - v.value.y }, document.addEventListener("mousemove", G), document.addEventListener("mouseup", J), document.addEventListener("touchmove", G), document.addEventListener("touchend", J);
|
|
733
743
|
}, G = (g) => {
|
|
734
|
-
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
744
|
+
_.value = !0;
|
|
745
|
+
const x = g.touches ? g.touches[0].clientX : g.clientX, A = g.touches ? g.touches[0].clientY : g.clientY;
|
|
746
|
+
C.value = { x: x - m.value.x, y: A - m.value.y }, document.addEventListener("mousemove", J), document.addEventListener("mouseup", Q), document.addEventListener("touchmove", J), document.addEventListener("touchend", Q);
|
|
747
|
+
}, J = (g) => {
|
|
748
|
+
if (!_.value) return;
|
|
749
|
+
const x = g.touches ? g.touches[0].clientX : g.clientX, A = g.touches ? g.touches[0].clientY : g.clientY;
|
|
750
|
+
m.value = {
|
|
751
|
+
x: x - C.value.x,
|
|
752
|
+
y: A - C.value.y
|
|
739
753
|
};
|
|
740
|
-
},
|
|
741
|
-
|
|
742
|
-
},
|
|
743
|
-
const g = document.createElement("canvas"),
|
|
754
|
+
}, Q = () => {
|
|
755
|
+
_.value = !1, document.removeEventListener("mousemove", J), document.removeEventListener("mouseup", Q), document.removeEventListener("touchmove", J), document.removeEventListener("touchend", Q);
|
|
756
|
+
}, le = () => {
|
|
757
|
+
const g = document.createElement("canvas"), x = g.getContext("2d"), A = 200;
|
|
744
758
|
g.width = A, g.height = A;
|
|
745
|
-
const E = z.value,
|
|
746
|
-
if (E &&
|
|
747
|
-
const
|
|
748
|
-
|
|
759
|
+
const E = z.value, ie = U.value, P = w.value;
|
|
760
|
+
if (E && ie && P) {
|
|
761
|
+
const he = ie.getBoundingClientRect(), ge = P.getBoundingClientRect(), ye = (he.left - ge.left - m.value.x) / V.value, O = (he.top - ge.top - m.value.y) / V.value, K = he.width / V.value;
|
|
762
|
+
x.drawImage(
|
|
749
763
|
E,
|
|
750
|
-
ye * (E.naturalWidth /
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
764
|
+
ye * (E.naturalWidth / R.value.width),
|
|
765
|
+
O * (E.naturalHeight / R.value.height),
|
|
766
|
+
K * (E.naturalWidth / R.value.width),
|
|
767
|
+
K * (E.naturalHeight / R.value.height),
|
|
754
768
|
0,
|
|
755
769
|
0,
|
|
756
770
|
A,
|
|
757
771
|
A
|
|
758
|
-
), g.toBlob((
|
|
759
|
-
o("confirm", { file:
|
|
772
|
+
), g.toBlob((oe) => {
|
|
773
|
+
o("confirm", { file: oe, url: g.toDataURL("image/png") }), F.value = !1;
|
|
760
774
|
}, "image/png");
|
|
761
775
|
}
|
|
762
|
-
},
|
|
763
|
-
|
|
776
|
+
}, te = () => {
|
|
777
|
+
T.value = "", V.value = 1, m.value = { x: 0, y: 0 };
|
|
764
778
|
};
|
|
765
|
-
return (g,
|
|
766
|
-
const A =
|
|
767
|
-
return
|
|
768
|
-
modelValue:
|
|
769
|
-
"onUpdate:modelValue":
|
|
779
|
+
return (g, x) => {
|
|
780
|
+
const A = ce("el-slider"), E = ce("el-button"), ie = ce("el-dialog");
|
|
781
|
+
return r(), q(ie, {
|
|
782
|
+
modelValue: F.value,
|
|
783
|
+
"onUpdate:modelValue": x[2] || (x[2] = (P) => F.value = P),
|
|
770
784
|
title: "裁剪头像",
|
|
771
785
|
width: "500px",
|
|
772
786
|
"close-on-click-modal": !1,
|
|
773
|
-
onClosed:
|
|
787
|
+
onClosed: te
|
|
774
788
|
}, {
|
|
775
789
|
footer: b(() => [
|
|
776
|
-
|
|
777
|
-
onClick:
|
|
790
|
+
p(E, {
|
|
791
|
+
onClick: x[1] || (x[1] = (P) => F.value = !1)
|
|
778
792
|
}, {
|
|
779
|
-
default: b(() => [...
|
|
780
|
-
|
|
793
|
+
default: b(() => [...x[3] || (x[3] = [
|
|
794
|
+
ne("取消", -1)
|
|
781
795
|
])]),
|
|
782
796
|
_: 1
|
|
783
797
|
}),
|
|
784
|
-
|
|
798
|
+
p(E, {
|
|
785
799
|
type: "primary",
|
|
786
|
-
onClick:
|
|
800
|
+
onClick: le
|
|
787
801
|
}, {
|
|
788
|
-
default: b(() => [...
|
|
789
|
-
|
|
802
|
+
default: b(() => [...x[4] || (x[4] = [
|
|
803
|
+
ne("确定", -1)
|
|
790
804
|
])]),
|
|
791
805
|
_: 1
|
|
792
806
|
})
|
|
793
807
|
]),
|
|
794
808
|
default: b(() => [
|
|
795
|
-
t("div",
|
|
809
|
+
t("div", Kt, [
|
|
796
810
|
t("div", {
|
|
797
811
|
class: "crop-area",
|
|
798
812
|
ref_key: "cropAreaRef",
|
|
799
|
-
ref:
|
|
813
|
+
ref: w
|
|
800
814
|
}, [
|
|
801
815
|
t("img", {
|
|
802
|
-
src:
|
|
816
|
+
src: T.value,
|
|
803
817
|
ref_key: "imageRef",
|
|
804
818
|
ref: z,
|
|
805
819
|
class: "crop-image",
|
|
806
|
-
onLoad:
|
|
807
|
-
onMousedown:
|
|
808
|
-
onTouchstart:
|
|
809
|
-
}, null, 40,
|
|
810
|
-
t("div",
|
|
811
|
-
t("div",
|
|
820
|
+
onLoad: N,
|
|
821
|
+
onMousedown: G,
|
|
822
|
+
onTouchstart: G
|
|
823
|
+
}, null, 40, Wt),
|
|
824
|
+
t("div", Bt, [
|
|
825
|
+
t("div", Nt, [
|
|
812
826
|
t("div", {
|
|
813
827
|
class: "crop-border",
|
|
814
828
|
ref_key: "cropBoxRef",
|
|
815
|
-
ref:
|
|
829
|
+
ref: U
|
|
816
830
|
}, null, 512)
|
|
817
831
|
])
|
|
818
832
|
]),
|
|
819
|
-
|
|
833
|
+
_.value ? (r(), v("div", Ht)) : I("", !0)
|
|
820
834
|
], 512),
|
|
821
|
-
t("div",
|
|
822
|
-
|
|
835
|
+
t("div", qt, [
|
|
836
|
+
p(A, {
|
|
823
837
|
modelValue: V.value,
|
|
824
|
-
"onUpdate:modelValue":
|
|
838
|
+
"onUpdate:modelValue": x[0] || (x[0] = (P) => V.value = P),
|
|
825
839
|
min: 0.5,
|
|
826
840
|
max: 3,
|
|
827
841
|
step: 0.1,
|
|
@@ -834,61 +848,61 @@ const Ge = (y, e) => {
|
|
|
834
848
|
}, 8, ["modelValue"]);
|
|
835
849
|
};
|
|
836
850
|
}
|
|
837
|
-
},
|
|
851
|
+
}, Ot = /* @__PURE__ */ et(Pt, [["__scopeId", "data-v-4e4a992b"]]), jt = { class: "chat-container" }, Xt = { class: "sidebar-nav" }, Yt = ["src"], Gt = ["onClick"], Jt = {
|
|
838
852
|
key: 0,
|
|
839
|
-
class: "
|
|
840
|
-
},
|
|
853
|
+
class: "nav-badge"
|
|
854
|
+
}, Qt = { class: "content-panel" }, Zt = { class: "search-bar" }, es = { class: "content-scroll" }, ts = { key: 0 }, ss = ["onClick", "onContextmenu"], as = { class: "friend-avatar-wrapper" }, ns = ["src", "alt"], ls = {
|
|
841
855
|
key: 0,
|
|
842
|
-
class: "
|
|
843
|
-
},
|
|
856
|
+
class: "online-indicator"
|
|
857
|
+
}, is = { class: "friend-info" }, os = { class: "friend-header" }, rs = { class: "friend-name" }, cs = { class: "last-time" }, ds = { class: "friend-preview" }, us = { class: "last-msg" }, vs = {
|
|
844
858
|
key: 0,
|
|
845
|
-
class: "
|
|
846
|
-
},
|
|
859
|
+
class: "unread-badge"
|
|
860
|
+
}, ps = { key: 1 }, fs = { class: "add-friend-section" }, ms = { class: "add-friend-icon" }, hs = ["onClick"], gs = { class: "friend-avatar-wrapper" }, ys = ["src", "alt"], _s = { class: "friend-info" }, bs = { class: "friend-name" }, Cs = { key: 2 }, ks = { class: "request-info" }, ws = ["src", "alt"], Us = { class: "request-details" }, xs = { class: "request-username" }, As = { class: "chat-area" }, Ss = {
|
|
847
861
|
key: 0,
|
|
848
|
-
class: "
|
|
849
|
-
},
|
|
862
|
+
class: "friend-profile"
|
|
863
|
+
}, Vs = ["src", "alt"], Fs = { class: "profile-name" }, Rs = { class: "profile-status" }, Is = {
|
|
850
864
|
key: 1,
|
|
851
|
-
class: "
|
|
852
|
-
},
|
|
865
|
+
class: "chat-window"
|
|
866
|
+
}, Ls = { class: "chat-header" }, Ts = { class: "chat-title" }, zs = { class: "chat-name" }, Ds = { class: "chat-actions" }, Ms = { class: "message-avatar" }, $s = ["src"], Es = {
|
|
853
867
|
key: 0,
|
|
854
|
-
class: "
|
|
855
|
-
},
|
|
868
|
+
class: "sender-name"
|
|
869
|
+
}, Ks = { class: "message-bubble-wrapper" }, Ws = ["onClick"], Bs = ["src", "alt"], Ns = {
|
|
856
870
|
key: 0,
|
|
857
|
-
class: "
|
|
858
|
-
},
|
|
871
|
+
class: "image-size"
|
|
872
|
+
}, Hs = ["onClick"], qs = { class: "file-content" }, Ps = { class: "file-icon" }, Os = { class: "file-info" }, js = { class: "file-name" }, Xs = { class: "file-meta" }, Ys = { key: 0 }, Gs = { class: "input-area" }, Js = {
|
|
859
873
|
key: 0,
|
|
860
|
-
class: "
|
|
861
|
-
},
|
|
874
|
+
class: "pending-files"
|
|
875
|
+
}, Qs = {
|
|
862
876
|
key: 0,
|
|
863
|
-
class: "
|
|
864
|
-
},
|
|
877
|
+
class: "pending-image-wrapper"
|
|
878
|
+
}, Zs = ["src", "alt"], ea = ["onClick"], ta = {
|
|
865
879
|
key: 1,
|
|
866
|
-
class: "
|
|
867
|
-
},
|
|
880
|
+
class: "pending-file-wrapper"
|
|
881
|
+
}, sa = { class: "pending-file-name" }, aa = ["onClick"], na = {
|
|
868
882
|
key: 1,
|
|
869
|
-
class: "
|
|
870
|
-
},
|
|
883
|
+
class: "input-actions"
|
|
884
|
+
}, la = { class: "input-wrapper" }, ia = ["onKeydown"], oa = { class: "send-btn-wrapper" }, ra = {
|
|
871
885
|
key: 2,
|
|
872
|
-
class: "
|
|
873
|
-
},
|
|
886
|
+
class: "empty-state"
|
|
887
|
+
}, ca = { class: "empty-text" }, da = {
|
|
874
888
|
key: 0,
|
|
875
|
-
class: "
|
|
876
|
-
},
|
|
889
|
+
class: "detail-panel"
|
|
890
|
+
}, ua = { class: "detail-content" }, va = { class: "detail-profile" }, pa = ["src", "alt"], fa = { class: "detail-name" }, ma = { class: "search-users-wrapper" }, ha = { class: "search-users-input" }, ga = { class: "users-list-scroll" }, ya = { class: "available-user-info" }, _a = ["src", "alt"], ba = { class: "available-user-name" }, Ca = { class: "settings-container" }, ka = { class: "settings-avatar-section" }, wa = { class: "settings-avatar-wrapper" }, Ua = ["src"], xa = { class: "settings-user-display" }, Aa = { class: "settings-nickname" }, Sa = { class: "settings-username" }, Va = { class: "settings-form-section" }, Fa = { class: "settings-form-header" }, Ra = { class: "settings-form-title" }, Ia = { class: "settings-form" }, La = { class: "settings-form-item" }, Ta = {
|
|
877
891
|
key: 1,
|
|
878
|
-
class: "
|
|
879
|
-
},
|
|
892
|
+
class: "settings-form-value"
|
|
893
|
+
}, za = { class: "settings-form-item" }, Da = {
|
|
880
894
|
key: 1,
|
|
881
|
-
class: "
|
|
882
|
-
},
|
|
895
|
+
class: "settings-form-value"
|
|
896
|
+
}, Ma = { class: "settings-form-item" }, $a = {
|
|
883
897
|
key: 1,
|
|
884
|
-
class: "
|
|
885
|
-
},
|
|
898
|
+
class: "settings-form-value"
|
|
899
|
+
}, Ea = { class: "settings-form-item" }, Ka = {
|
|
886
900
|
key: 1,
|
|
887
|
-
class: "
|
|
888
|
-
},
|
|
901
|
+
class: "settings-form-value bio-value"
|
|
902
|
+
}, Wa = {
|
|
889
903
|
key: 0,
|
|
890
|
-
class: "
|
|
891
|
-
},
|
|
904
|
+
class: "settings-form-actions"
|
|
905
|
+
}, Ba = {
|
|
892
906
|
__name: "ChatWindow",
|
|
893
907
|
props: {
|
|
894
908
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -897,406 +911,409 @@ const Ge = (y, e) => {
|
|
|
897
911
|
},
|
|
898
912
|
emits: ["update:modelValue", "open", "close", "message", "send", "error"],
|
|
899
913
|
setup(y, { emit: e }) {
|
|
900
|
-
const
|
|
901
|
-
get: () =>
|
|
914
|
+
const s = y, o = e, F = re({
|
|
915
|
+
get: () => s.modelValue,
|
|
902
916
|
set: (d) => o("update:modelValue", d)
|
|
903
917
|
}), {
|
|
904
|
-
myUsername:
|
|
918
|
+
myUsername: T,
|
|
905
919
|
myAvatar: z,
|
|
906
|
-
userInfo:
|
|
907
|
-
loadingUserInfo:
|
|
920
|
+
userInfo: w,
|
|
921
|
+
loadingUserInfo: U,
|
|
908
922
|
friendList: V,
|
|
909
|
-
filteredFriendList:
|
|
910
|
-
searchText:
|
|
911
|
-
inputText:
|
|
912
|
-
messagesContainer:
|
|
913
|
-
filteredUsers:
|
|
914
|
-
filteredAvailableUsers:
|
|
915
|
-
currentUser:
|
|
916
|
-
currentMessages:
|
|
917
|
-
addFriendDialogVisible:
|
|
918
|
-
addFriendSearchText:
|
|
923
|
+
filteredFriendList: m,
|
|
924
|
+
searchText: _,
|
|
925
|
+
inputText: C,
|
|
926
|
+
messagesContainer: R,
|
|
927
|
+
filteredUsers: N,
|
|
928
|
+
filteredAvailableUsers: G,
|
|
929
|
+
currentUser: J,
|
|
930
|
+
currentMessages: Q,
|
|
931
|
+
addFriendDialogVisible: le,
|
|
932
|
+
addFriendSearchText: te,
|
|
919
933
|
availableUsers: g,
|
|
920
|
-
loadingAvailableUsers:
|
|
934
|
+
loadingAvailableUsers: x,
|
|
921
935
|
friendApplyList: A,
|
|
922
936
|
loadingFriendApply: E,
|
|
923
|
-
formatTime:
|
|
937
|
+
formatTime: ie,
|
|
924
938
|
formatLastTime: P,
|
|
925
|
-
scrollToBottom:
|
|
926
|
-
getFriendList:
|
|
939
|
+
scrollToBottom: he,
|
|
940
|
+
getFriendList: ge,
|
|
927
941
|
getChatHistory: ye,
|
|
928
|
-
setFriendToChatStatus:
|
|
929
|
-
selectUser:
|
|
930
|
-
sendMessage:
|
|
931
|
-
sendFile:
|
|
932
|
-
sendFilesAndText:
|
|
933
|
-
initWebSocket:
|
|
934
|
-
closeWebSocket:
|
|
942
|
+
setFriendToChatStatus: O,
|
|
943
|
+
selectUser: K,
|
|
944
|
+
sendMessage: oe,
|
|
945
|
+
sendFile: He,
|
|
946
|
+
sendFilesAndText: xe,
|
|
947
|
+
initWebSocket: Ae,
|
|
948
|
+
closeWebSocket: _e,
|
|
935
949
|
reset: be,
|
|
936
|
-
openAddFriendDialog:
|
|
937
|
-
addFriend:
|
|
938
|
-
loadFriendApplyList:
|
|
939
|
-
agreeFriend:
|
|
940
|
-
updateMyAvatar:
|
|
941
|
-
getUserInfo:
|
|
942
|
-
updateUserInfo:
|
|
943
|
-
} =
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
ce.value = d.id, D.value = d, M.value = null, de.value = !1, $({
|
|
950
|
+
openAddFriendDialog: Ce,
|
|
951
|
+
addFriend: Se,
|
|
952
|
+
loadFriendApplyList: Ve,
|
|
953
|
+
agreeFriend: Fe,
|
|
954
|
+
updateMyAvatar: Re,
|
|
955
|
+
getUserInfo: Ie,
|
|
956
|
+
updateUserInfo: Le
|
|
957
|
+
} = Et(s.config), Te = re(() => {
|
|
958
|
+
var l;
|
|
959
|
+
const d = [{ id: "chat", icon: Ee, badge: 0 }];
|
|
960
|
+
return s.config.modules.friends && d.push({ id: "friends", icon: Qe, badge: 0 }), s.config.modules.apply && d.push({ id: "apply", icon: At, badge: ((l = A.value) == null ? void 0 : l.length) || 0 }), d;
|
|
961
|
+
}), Z = f("chat"), de = f(null), D = f(null), M = f(null), ue = f(!1), H = f(!1), W = f({ nickname: "", email: "", phone: "", bio: "" }), a = f(!1), i = f(!1), c = f(!1), S = f(!1), se = f(null), ee = f(""), ve = f(null), B = f([]), pe = f({ visible: !1, x: 0, y: 0, chat: null }), ze = () => {
|
|
962
|
+
pe.value.visible = !1;
|
|
963
|
+
}, st = async () => {
|
|
964
|
+
if (!pe.value.chat) return;
|
|
965
|
+
await O(pe.value.chat.id, 0) && de.value === pe.value.chat.id && (de.value = null, D.value = null), ze();
|
|
966
|
+
}, De = (d) => {
|
|
967
|
+
de.value = d.id, D.value = d, M.value = null, ue.value = !1, K({
|
|
955
968
|
id: d.id,
|
|
956
969
|
name: d.name,
|
|
957
970
|
avatar: d.avatar,
|
|
958
971
|
online: d.online
|
|
959
972
|
});
|
|
960
|
-
},
|
|
961
|
-
M.value = d,
|
|
962
|
-
},
|
|
973
|
+
}, at = (d) => {
|
|
974
|
+
M.value = d, de.value = null, D.value = null;
|
|
975
|
+
}, nt = async () => {
|
|
963
976
|
if (!M.value) return;
|
|
964
|
-
if (await
|
|
965
|
-
|
|
966
|
-
const l =
|
|
967
|
-
l &&
|
|
977
|
+
if (await O(M.value.id)) {
|
|
978
|
+
Z.value = "chat", await Ne();
|
|
979
|
+
const l = N.value.find((h) => h.id === M.value.id);
|
|
980
|
+
l && De(l), M.value = null;
|
|
968
981
|
}
|
|
969
|
-
},
|
|
970
|
-
|
|
971
|
-
},
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
982
|
+
}, lt = () => {
|
|
983
|
+
i.value = !0;
|
|
984
|
+
}, it = () => {
|
|
985
|
+
var d;
|
|
986
|
+
(d = se.value) == null || d.click();
|
|
987
|
+
}, ot = () => {
|
|
988
|
+
var d;
|
|
989
|
+
(d = ve.value) == null || d.click();
|
|
990
|
+
}, rt = (d) => {
|
|
976
991
|
const l = Array.from(d.target.files || []);
|
|
977
992
|
if (l.length !== 0) {
|
|
978
|
-
for (const
|
|
979
|
-
if (
|
|
980
|
-
|
|
993
|
+
for (const h of l) {
|
|
994
|
+
if (h.size > 50 * 1024 * 1024) {
|
|
995
|
+
Y.warning(`文件 ${h.name} 超过50MB,已跳过`);
|
|
981
996
|
continue;
|
|
982
997
|
}
|
|
983
|
-
const
|
|
984
|
-
|
|
998
|
+
const L = URL.createObjectURL(h);
|
|
999
|
+
B.value.push({
|
|
985
1000
|
id: Date.now() + Math.random(),
|
|
986
|
-
file:
|
|
987
|
-
name:
|
|
988
|
-
size:
|
|
989
|
-
type:
|
|
990
|
-
previewUrl:
|
|
991
|
-
isImage:
|
|
1001
|
+
file: h,
|
|
1002
|
+
name: h.name,
|
|
1003
|
+
size: h.size,
|
|
1004
|
+
type: h.type,
|
|
1005
|
+
previewUrl: L,
|
|
1006
|
+
isImage: h.type.startsWith("image/")
|
|
992
1007
|
});
|
|
993
1008
|
}
|
|
994
|
-
|
|
1009
|
+
ve.value && (ve.value.value = "");
|
|
995
1010
|
}
|
|
996
|
-
},
|
|
997
|
-
const l =
|
|
998
|
-
l.previewUrl && URL.revokeObjectURL(l.previewUrl),
|
|
999
|
-
},
|
|
1011
|
+
}, qe = (d) => {
|
|
1012
|
+
const l = B.value[d];
|
|
1013
|
+
l.previewUrl && URL.revokeObjectURL(l.previewUrl), B.value.splice(d, 1);
|
|
1014
|
+
}, Pe = (d) => {
|
|
1000
1015
|
if (d === 0) return "0 B";
|
|
1001
|
-
const l = 1024,
|
|
1002
|
-
return parseFloat((d / Math.pow(l,
|
|
1003
|
-
},
|
|
1004
|
-
if (!
|
|
1005
|
-
const d = [...
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
}),
|
|
1009
|
-
},
|
|
1010
|
-
|
|
1016
|
+
const l = 1024, h = ["B", "KB", "MB", "GB"], L = Math.floor(Math.log(d) / Math.log(l));
|
|
1017
|
+
return parseFloat((d / Math.pow(l, L)).toFixed(2)) + " " + h[L];
|
|
1018
|
+
}, Oe = async () => {
|
|
1019
|
+
if (!C.value.trim() && B.value.length === 0) return;
|
|
1020
|
+
const d = [...B.value], l = C.value;
|
|
1021
|
+
C.value = "", B.value.forEach((h) => {
|
|
1022
|
+
h.previewUrl && URL.revokeObjectURL(h.previewUrl);
|
|
1023
|
+
}), B.value = [], await xe(d, l), o("send", { text: l, files: d });
|
|
1024
|
+
}, ct = (d) => {
|
|
1025
|
+
var h;
|
|
1026
|
+
const l = (h = d.clipboardData) == null ? void 0 : h.items;
|
|
1011
1027
|
if (l) {
|
|
1012
|
-
for (const
|
|
1013
|
-
if (
|
|
1014
|
-
const
|
|
1015
|
-
if (
|
|
1016
|
-
if (
|
|
1017
|
-
|
|
1028
|
+
for (const L of l)
|
|
1029
|
+
if (L.kind === "file") {
|
|
1030
|
+
const $ = L.getAsFile();
|
|
1031
|
+
if ($) {
|
|
1032
|
+
if ($.size > 50 * 1024 * 1024) {
|
|
1033
|
+
Y.warning(`文件 ${$.name} 超过50MB,已跳过`);
|
|
1018
1034
|
continue;
|
|
1019
1035
|
}
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1036
|
+
const ae = URL.createObjectURL($);
|
|
1037
|
+
B.value.push({
|
|
1022
1038
|
id: Date.now() + Math.random(),
|
|
1023
|
-
file:
|
|
1024
|
-
name:
|
|
1025
|
-
size:
|
|
1026
|
-
type:
|
|
1027
|
-
previewUrl:
|
|
1028
|
-
isImage:
|
|
1039
|
+
file: $,
|
|
1040
|
+
name: $.name,
|
|
1041
|
+
size: $.size,
|
|
1042
|
+
type: $.type,
|
|
1043
|
+
previewUrl: ae,
|
|
1044
|
+
isImage: $.type.startsWith("image/")
|
|
1029
1045
|
});
|
|
1030
1046
|
}
|
|
1031
1047
|
}
|
|
1032
1048
|
}
|
|
1033
|
-
},
|
|
1049
|
+
}, je = (d) => {
|
|
1034
1050
|
if (!d) {
|
|
1035
|
-
|
|
1051
|
+
Y.warning("文件地址无效");
|
|
1036
1052
|
return;
|
|
1037
1053
|
}
|
|
1038
1054
|
window.open(d, "_blank");
|
|
1039
|
-
},
|
|
1055
|
+
}, dt = (d) => {
|
|
1040
1056
|
console.warn("图片加载失败", d);
|
|
1041
|
-
},
|
|
1057
|
+
}, ut = (d) => {
|
|
1042
1058
|
const l = d.target.files[0];
|
|
1043
1059
|
if (!l) return;
|
|
1044
1060
|
if (!l.type.startsWith("image/")) {
|
|
1045
|
-
|
|
1061
|
+
Y.error("只能上传图片文件");
|
|
1046
1062
|
return;
|
|
1047
1063
|
}
|
|
1048
1064
|
if (l.size > 5 * 1024 * 1024) {
|
|
1049
|
-
|
|
1065
|
+
Y.error("图片大小不能超过 5MB");
|
|
1050
1066
|
return;
|
|
1051
1067
|
}
|
|
1052
|
-
const
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
},
|
|
1056
|
-
},
|
|
1068
|
+
const h = new FileReader();
|
|
1069
|
+
h.onload = (L) => {
|
|
1070
|
+
ee.value = L.target.result, c.value = !0;
|
|
1071
|
+
}, h.readAsDataURL(l);
|
|
1072
|
+
}, vt = async ({ file: d }) => {
|
|
1057
1073
|
if (d) {
|
|
1058
|
-
|
|
1074
|
+
S.value = !0;
|
|
1059
1075
|
try {
|
|
1060
|
-
const
|
|
1061
|
-
|
|
1076
|
+
const { ChatApi: l } = await Promise.resolve().then(() => $t), L = await new l(s.config).uploadAvatar(d, T);
|
|
1077
|
+
L.code === 200 ? (Y.success("头像上传成功"), Re(L.data), Xe()) : Y.error(L.msg || "头像上传失败");
|
|
1062
1078
|
} catch (l) {
|
|
1063
|
-
console.error(l),
|
|
1079
|
+
console.error(l), Y.error("头像上传失败");
|
|
1064
1080
|
} finally {
|
|
1065
|
-
|
|
1081
|
+
S.value = !1;
|
|
1066
1082
|
}
|
|
1067
1083
|
}
|
|
1068
|
-
},
|
|
1069
|
-
|
|
1070
|
-
},
|
|
1071
|
-
|
|
1072
|
-
nickname:
|
|
1073
|
-
email:
|
|
1074
|
-
phone:
|
|
1075
|
-
bio:
|
|
1076
|
-
},
|
|
1077
|
-
},
|
|
1078
|
-
|
|
1079
|
-
},
|
|
1080
|
-
|
|
1084
|
+
}, Xe = () => {
|
|
1085
|
+
ee.value = "", c.value = !1, se.value && (se.value.value = "");
|
|
1086
|
+
}, pt = () => {
|
|
1087
|
+
W.value = {
|
|
1088
|
+
nickname: w.value.nickname || "",
|
|
1089
|
+
email: w.value.email || "",
|
|
1090
|
+
phone: w.value.phone || "",
|
|
1091
|
+
bio: w.value.bio || ""
|
|
1092
|
+
}, H.value = !0;
|
|
1093
|
+
}, ft = () => {
|
|
1094
|
+
H.value = !1, W.value = { nickname: "", email: "", phone: "", bio: "" };
|
|
1095
|
+
}, mt = async () => {
|
|
1096
|
+
a.value = !0;
|
|
1081
1097
|
try {
|
|
1082
|
-
await
|
|
1098
|
+
await Le(W.value) ? (Y.success("保存成功"), H.value = !1) : Y.error("保存失败");
|
|
1083
1099
|
} catch (d) {
|
|
1084
|
-
console.error(d),
|
|
1100
|
+
console.error(d), Y.error("保存失败");
|
|
1085
1101
|
} finally {
|
|
1086
|
-
|
|
1102
|
+
a.value = !1;
|
|
1087
1103
|
}
|
|
1088
1104
|
}, ht = () => {
|
|
1089
|
-
be(),
|
|
1090
|
-
},
|
|
1091
|
-
await Promise.all([
|
|
1105
|
+
be(), _e(), ue.value = !1, i.value = !1, Xe(), H.value = !1, o("close");
|
|
1106
|
+
}, gt = async () => {
|
|
1107
|
+
await Promise.all([ge(), Ve(), Ie()]), Ae(), N.value.length > 0 && De(N.value[0]), o("open");
|
|
1092
1108
|
};
|
|
1093
|
-
return
|
|
1094
|
-
document.addEventListener("click",
|
|
1095
|
-
}),
|
|
1096
|
-
document.removeEventListener("click",
|
|
1109
|
+
return _t(() => {
|
|
1110
|
+
document.addEventListener("click", ze);
|
|
1111
|
+
}), bt(() => {
|
|
1112
|
+
document.removeEventListener("click", ze), _e();
|
|
1097
1113
|
}), (d, l) => {
|
|
1098
|
-
const
|
|
1099
|
-
return
|
|
1100
|
-
modelValue:
|
|
1101
|
-
"onUpdate:modelValue": l[13] || (l[13] = (
|
|
1114
|
+
const h = ce("el-icon"), L = ce("el-input"), $ = ce("el-empty"), ae = ce("el-button"), Me = ce("el-dialog");
|
|
1115
|
+
return r(), q(Me, {
|
|
1116
|
+
modelValue: F.value,
|
|
1117
|
+
"onUpdate:modelValue": l[13] || (l[13] = (ke) => F.value = ke),
|
|
1102
1118
|
width: y.width,
|
|
1103
1119
|
"close-on-click-modal": !1,
|
|
1104
1120
|
class: "chat-dialog",
|
|
1105
1121
|
"append-to-body": "",
|
|
1106
1122
|
onClosed: ht,
|
|
1107
|
-
onOpen:
|
|
1123
|
+
onOpen: gt
|
|
1108
1124
|
}, {
|
|
1109
|
-
default: b(() =>
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
key: s.id,
|
|
1124
|
-
class: j([
|
|
1125
|
-
"w-10 h-10 flex items-center justify-center cursor-pointer rounded-lg transition-all relative",
|
|
1126
|
-
Q.value === s.id ? "bg-green-50 text-green-600" : "text-gray-500 hover:bg-gray-100"
|
|
1125
|
+
default: b(() => {
|
|
1126
|
+
var ke, Ye, Ge;
|
|
1127
|
+
return [
|
|
1128
|
+
t("div", jt, [
|
|
1129
|
+
t("div", Xt, [
|
|
1130
|
+
t("div", {
|
|
1131
|
+
class: "sidebar-avatar",
|
|
1132
|
+
onClick: lt
|
|
1133
|
+
}, [
|
|
1134
|
+
t("img", {
|
|
1135
|
+
src: u(z),
|
|
1136
|
+
alt: "头像",
|
|
1137
|
+
class: "avatar-img"
|
|
1138
|
+
}, null, 8, Yt)
|
|
1127
1139
|
]),
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
]),
|
|
1134
|
-
_: 2
|
|
1135
|
-
}, 1024),
|
|
1136
|
-
s.badge ? (i(), f("span", Xt, w(s.badge > 99 ? "99+" : s.badge), 1)) : F("", !0)
|
|
1137
|
-
], 10, Ot))), 128)),
|
|
1138
|
-
l[14] || (l[14] = t("div", { class: "flex-1" }, null, -1)),
|
|
1139
|
-
y.config.modules.settings ? (i(), f("div", {
|
|
1140
|
-
key: 0,
|
|
1141
|
-
class: "w-10 h-10 flex items-center justify-center cursor-pointer rounded-lg hover:bg-gray-100 transition-all mb-4 text-gray-500",
|
|
1142
|
-
onClick: l[0] || (l[0] = (s) => r.value = !0),
|
|
1143
|
-
title: "设置"
|
|
1144
|
-
}, [
|
|
1145
|
-
h(p, { size: 24 }, {
|
|
1146
|
-
default: b(() => [
|
|
1147
|
-
h(u(Ct))
|
|
1140
|
+
(r(!0), v(fe, null, me(Te.value, (n) => (r(), v("div", {
|
|
1141
|
+
key: n.id,
|
|
1142
|
+
class: X([
|
|
1143
|
+
"nav-item",
|
|
1144
|
+
Z.value === n.id ? "nav-item-active" : "nav-item-inactive"
|
|
1148
1145
|
]),
|
|
1149
|
-
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
t("div", Gt, [
|
|
1155
|
-
h(S, {
|
|
1156
|
-
modelValue: u(x),
|
|
1157
|
-
"onUpdate:modelValue": l[1] || (l[1] = (s) => we(x) ? x.value = s : null),
|
|
1158
|
-
placeholder: "搜索",
|
|
1159
|
-
"prefix-icon": u(Ee)
|
|
1160
|
-
}, null, 8, ["modelValue", "prefix-icon"])
|
|
1161
|
-
]),
|
|
1162
|
-
t("div", Jt, [
|
|
1163
|
-
Q.value === "chat" ? (i(), f("div", Qt, [
|
|
1164
|
-
(i(!0), f(he, null, pe(u(B), (s) => (i(), f("div", {
|
|
1165
|
-
key: s.id,
|
|
1166
|
-
class: j([
|
|
1167
|
-
"flex items-center p-3 cursor-pointer hover:bg-[#e5e5e5] transition-colors",
|
|
1168
|
-
ce.value === s.id ? "bg-[#d6d6d6]" : ""
|
|
1146
|
+
onClick: (j) => Z.value = n.id
|
|
1147
|
+
}, [
|
|
1148
|
+
p(h, { size: 24 }, {
|
|
1149
|
+
default: b(() => [
|
|
1150
|
+
(r(), q(Ct(n.icon)))
|
|
1169
1151
|
]),
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1152
|
+
_: 2
|
|
1153
|
+
}, 1024),
|
|
1154
|
+
n.badge ? (r(), v("span", Jt, k(n.badge > 99 ? "99+" : n.badge), 1)) : I("", !0)
|
|
1155
|
+
], 10, Gt))), 128)),
|
|
1156
|
+
l[14] || (l[14] = t("div", { class: "nav-spacer" }, null, -1)),
|
|
1157
|
+
y.config.modules.settings ? (r(), v("div", {
|
|
1158
|
+
key: 0,
|
|
1159
|
+
class: "nav-item nav-item-inactive",
|
|
1160
|
+
onClick: l[0] || (l[0] = (n) => i.value = !0),
|
|
1161
|
+
title: "设置"
|
|
1162
|
+
}, [
|
|
1163
|
+
p(h, { size: 24 }, {
|
|
1164
|
+
default: b(() => [
|
|
1165
|
+
p(u(St))
|
|
1180
1166
|
]),
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1167
|
+
_: 1
|
|
1168
|
+
})
|
|
1169
|
+
])) : I("", !0)
|
|
1170
|
+
]),
|
|
1171
|
+
t("div", Qt, [
|
|
1172
|
+
t("div", Zt, [
|
|
1173
|
+
p(L, {
|
|
1174
|
+
modelValue: u(_),
|
|
1175
|
+
"onUpdate:modelValue": l[1] || (l[1] = (n) => we(_) ? _.value = n : null),
|
|
1176
|
+
placeholder: "搜索",
|
|
1177
|
+
"prefix-icon": u(Ke)
|
|
1178
|
+
}, null, 8, ["modelValue", "prefix-icon"])
|
|
1179
|
+
]),
|
|
1180
|
+
t("div", es, [
|
|
1181
|
+
Z.value === "chat" ? (r(), v("div", ts, [
|
|
1182
|
+
(r(!0), v(fe, null, me(u(N), (n) => (r(), v("div", {
|
|
1183
|
+
key: n.id,
|
|
1184
|
+
class: X([
|
|
1185
|
+
"chat-item",
|
|
1186
|
+
de.value === n.id ? "chat-item-active" : ""
|
|
1185
1187
|
]),
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
s.unread > 0 ? (i(), f("span", cs, w(s.unread > 99 ? "99+" : s.unread), 1)) : F("", !0)
|
|
1189
|
-
])
|
|
1190
|
-
])
|
|
1191
|
-
], 42, Zt))), 128))
|
|
1192
|
-
])) : F("", !0),
|
|
1193
|
-
Q.value === "friends" && y.config.modules.friends ? (i(), f("div", ds, [
|
|
1194
|
-
t("div", us, [
|
|
1195
|
-
t("div", {
|
|
1196
|
-
class: "flex items-center gap-2 p-2 rounded-lg cursor-pointer hover:bg-[#e5e5e5]",
|
|
1197
|
-
onClick: l[2] || (l[2] = (...s) => u(_e) && u(_e)(...s))
|
|
1188
|
+
onClick: (j) => De(n),
|
|
1189
|
+
onContextmenu: Je((j) => d.showContextMenu(j, n), ["prevent", "stop"])
|
|
1198
1190
|
}, [
|
|
1199
|
-
t("div",
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
]),
|
|
1207
|
-
_: 1
|
|
1208
|
-
})
|
|
1191
|
+
t("div", as, [
|
|
1192
|
+
t("img", {
|
|
1193
|
+
src: n.avatar,
|
|
1194
|
+
alt: n.name,
|
|
1195
|
+
class: "friend-avatar"
|
|
1196
|
+
}, null, 8, ns),
|
|
1197
|
+
n.online ? (r(), v("span", ls)) : I("", !0)
|
|
1209
1198
|
]),
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
t("div", ps, [
|
|
1219
|
-
t("img", {
|
|
1220
|
-
src: s.avatar,
|
|
1221
|
-
alt: s.name,
|
|
1222
|
-
class: "w-11 h-11 rounded-full object-cover"
|
|
1223
|
-
}, null, 8, ms),
|
|
1224
|
-
t("span", {
|
|
1225
|
-
class: j([
|
|
1226
|
-
"absolute bottom-0 right-0 w-3 h-3 rounded-full border-2 border-white",
|
|
1227
|
-
s.online ? "bg-green-500" : "bg-gray-400"
|
|
1199
|
+
t("div", is, [
|
|
1200
|
+
t("div", os, [
|
|
1201
|
+
t("span", rs, k(n.name), 1),
|
|
1202
|
+
t("span", cs, k(u(P)(n.lastTime)), 1)
|
|
1203
|
+
]),
|
|
1204
|
+
t("div", ds, [
|
|
1205
|
+
t("span", us, k(n.lastMsg), 1),
|
|
1206
|
+
n.unread > 0 ? (r(), v("span", vs, k(n.unread > 99 ? "99+" : n.unread), 1)) : I("", !0)
|
|
1228
1207
|
])
|
|
1229
|
-
|
|
1208
|
+
])
|
|
1209
|
+
], 42, ss))), 128))
|
|
1210
|
+
])) : I("", !0),
|
|
1211
|
+
Z.value === "friends" && y.config.modules.friends ? (r(), v("div", ps, [
|
|
1212
|
+
t("div", fs, [
|
|
1213
|
+
t("div", {
|
|
1214
|
+
class: "add-friend-btn",
|
|
1215
|
+
onClick: l[2] || (l[2] = (...n) => u(Ce) && u(Ce)(...n))
|
|
1216
|
+
}, [
|
|
1217
|
+
t("div", ms, [
|
|
1218
|
+
p(h, {
|
|
1219
|
+
class: "text-white",
|
|
1220
|
+
size: 20
|
|
1221
|
+
}, {
|
|
1222
|
+
default: b(() => [
|
|
1223
|
+
p(u(Vt))
|
|
1224
|
+
]),
|
|
1225
|
+
_: 1
|
|
1226
|
+
})
|
|
1227
|
+
]),
|
|
1228
|
+
l[15] || (l[15] = t("span", { class: "add-friend-text" }, "添加好友", -1))
|
|
1229
|
+
])
|
|
1230
1230
|
]),
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${s.applyUser}`,
|
|
1250
|
-
alt: s.applyUser,
|
|
1251
|
-
class: "w-11 h-11 rounded-full object-cover"
|
|
1252
|
-
}, null, 8, bs),
|
|
1231
|
+
(r(!0), v(fe, null, me(u(m), (n) => (r(), v("div", {
|
|
1232
|
+
key: n.id,
|
|
1233
|
+
class: "chat-item",
|
|
1234
|
+
onClick: (j) => at(n)
|
|
1235
|
+
}, [
|
|
1236
|
+
t("div", gs, [
|
|
1237
|
+
t("img", {
|
|
1238
|
+
src: n.avatar,
|
|
1239
|
+
alt: n.name,
|
|
1240
|
+
class: "friend-avatar"
|
|
1241
|
+
}, null, 8, ys),
|
|
1242
|
+
t("span", {
|
|
1243
|
+
class: X([
|
|
1244
|
+
"online-indicator",
|
|
1245
|
+
n.online ? "online" : "offline"
|
|
1246
|
+
])
|
|
1247
|
+
}, null, 2)
|
|
1248
|
+
]),
|
|
1253
1249
|
t("div", _s, [
|
|
1254
|
-
t("
|
|
1255
|
-
l[16] || (l[16] = t("div", { class: "text-xs text-gray-500 mt-1" }, "请求添加你为好友", -1))
|
|
1250
|
+
t("span", bs, k(n.name), 1)
|
|
1256
1251
|
])
|
|
1257
|
-
]),
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1252
|
+
], 8, hs))), 128))
|
|
1253
|
+
])) : I("", !0),
|
|
1254
|
+
Z.value === "apply" && y.config.modules.apply ? (r(), v("div", Cs, [
|
|
1255
|
+
u(E) ? (r(), q($, {
|
|
1256
|
+
key: 0,
|
|
1257
|
+
description: "加载中..."
|
|
1258
|
+
})) : u(A).length === 0 ? (r(), q($, {
|
|
1259
|
+
key: 1,
|
|
1260
|
+
description: "暂无好友申请"
|
|
1261
|
+
})) : (r(!0), v(fe, { key: 2 }, me(u(A), (n) => (r(), v("div", {
|
|
1262
|
+
key: n.applyUser || n.id,
|
|
1263
|
+
class: "friend-request-item"
|
|
1264
|
+
}, [
|
|
1265
|
+
t("div", ks, [
|
|
1266
|
+
t("img", {
|
|
1267
|
+
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${n.applyUser}`,
|
|
1268
|
+
alt: n.applyUser,
|
|
1269
|
+
class: "request-avatar"
|
|
1270
|
+
}, null, 8, ws),
|
|
1271
|
+
t("div", Us, [
|
|
1272
|
+
t("div", xs, k(n.applyUser), 1),
|
|
1273
|
+
l[16] || (l[16] = t("div", { class: "request-desc" }, "请求添加你为好友", -1))
|
|
1274
|
+
])
|
|
1275
|
+
]),
|
|
1276
|
+
p(ae, {
|
|
1277
|
+
type: "primary",
|
|
1278
|
+
size: "small",
|
|
1279
|
+
onClick: (j) => u(Fe)(n.applyUser)
|
|
1280
|
+
}, {
|
|
1281
|
+
default: b(() => [...l[17] || (l[17] = [
|
|
1282
|
+
ne("同意", -1)
|
|
1283
|
+
])]),
|
|
1284
|
+
_: 1
|
|
1285
|
+
}, 8, ["onClick"])
|
|
1286
|
+
]))), 128))
|
|
1287
|
+
])) : I("", !0)
|
|
1288
|
+
])
|
|
1289
|
+
]),
|
|
1290
|
+
t("div", As, [
|
|
1291
|
+
M.value && !D.value ? (r(), v("div", Ss, [
|
|
1275
1292
|
t("img", {
|
|
1276
1293
|
src: M.value.avatar,
|
|
1277
1294
|
alt: M.value.name,
|
|
1278
|
-
class: "
|
|
1279
|
-
}, null, 8,
|
|
1280
|
-
t("div",
|
|
1281
|
-
t("div",
|
|
1295
|
+
class: "profile-avatar"
|
|
1296
|
+
}, null, 8, Vs),
|
|
1297
|
+
t("div", Fs, k(M.value.name), 1),
|
|
1298
|
+
t("div", Rs, [
|
|
1282
1299
|
t("span", {
|
|
1283
|
-
class:
|
|
1284
|
-
"
|
|
1285
|
-
M.value.online ? "
|
|
1300
|
+
class: X([
|
|
1301
|
+
"status-dot",
|
|
1302
|
+
M.value.online ? "status-online" : "status-offline"
|
|
1286
1303
|
])
|
|
1287
1304
|
}, null, 2),
|
|
1288
|
-
t("span",
|
|
1305
|
+
t("span", null, k(M.value.online ? "在线" : "离线"), 1)
|
|
1289
1306
|
]),
|
|
1290
|
-
|
|
1307
|
+
p(ae, {
|
|
1291
1308
|
type: "primary",
|
|
1292
1309
|
size: "large",
|
|
1293
|
-
onClick:
|
|
1294
|
-
class: "
|
|
1310
|
+
onClick: nt,
|
|
1311
|
+
class: "start-chat-btn"
|
|
1295
1312
|
}, {
|
|
1296
1313
|
default: b(() => [
|
|
1297
|
-
h
|
|
1314
|
+
p(h, null, {
|
|
1298
1315
|
default: b(() => [
|
|
1299
|
-
|
|
1316
|
+
p(u(Ee))
|
|
1300
1317
|
]),
|
|
1301
1318
|
_: 1
|
|
1302
1319
|
}),
|
|
@@ -1304,496 +1321,463 @@ const Ge = (y, e) => {
|
|
|
1304
1321
|
]),
|
|
1305
1322
|
_: 1
|
|
1306
1323
|
})
|
|
1307
|
-
])
|
|
1308
|
-
|
|
1309
|
-
D.value ? (i(), f("div", Rs, [
|
|
1310
|
-
t("div", Is, [
|
|
1324
|
+
])) : I("", !0),
|
|
1325
|
+
D.value ? (r(), v("div", Is, [
|
|
1311
1326
|
t("div", Ls, [
|
|
1312
|
-
t("
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
]),
|
|
1338
|
-
t("div", {
|
|
1339
|
-
ref_key: "messagesContainer",
|
|
1340
|
-
ref: I,
|
|
1341
|
-
class: "flex-1 overflow-y-auto p-4 bg-[#f5f5f5] min-h-0 message-list"
|
|
1342
|
-
}, [
|
|
1343
|
-
(i(!0), f(he, null, pe(u(J), (s, O) => (i(), f("div", {
|
|
1344
|
-
key: O,
|
|
1345
|
-
class: j([
|
|
1346
|
-
"flex mb-6 items-start",
|
|
1347
|
-
s.isSelf ? "flex-row-reverse" : "flex-row"
|
|
1327
|
+
t("div", Ts, [
|
|
1328
|
+
t("span", zs, k(D.value.name), 1),
|
|
1329
|
+
t("span", {
|
|
1330
|
+
class: X([
|
|
1331
|
+
"status-badge",
|
|
1332
|
+
D.value.online ? "status-badge-online" : "status-badge-offline"
|
|
1333
|
+
])
|
|
1334
|
+
}, k(D.value.online ? "在线" : "离线"), 3)
|
|
1335
|
+
]),
|
|
1336
|
+
t("div", Ds, [
|
|
1337
|
+
p(h, { class: "action-icon" }, {
|
|
1338
|
+
default: b(() => [
|
|
1339
|
+
p(u(Ke))
|
|
1340
|
+
]),
|
|
1341
|
+
_: 1
|
|
1342
|
+
}),
|
|
1343
|
+
p(h, {
|
|
1344
|
+
class: "action-icon",
|
|
1345
|
+
onClick: l[3] || (l[3] = (n) => ue.value = !ue.value)
|
|
1346
|
+
}, {
|
|
1347
|
+
default: b(() => [
|
|
1348
|
+
p(u(Ft))
|
|
1349
|
+
]),
|
|
1350
|
+
_: 1
|
|
1351
|
+
})
|
|
1348
1352
|
])
|
|
1353
|
+
]),
|
|
1354
|
+
t("div", {
|
|
1355
|
+
ref_key: "messagesContainer",
|
|
1356
|
+
ref: R,
|
|
1357
|
+
class: "messages-container"
|
|
1349
1358
|
}, [
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
]),
|
|
1356
|
-
t("div", {
|
|
1357
|
-
class: j([
|
|
1358
|
-
"flex flex-col max-w-[75%]",
|
|
1359
|
-
s.isSelf ? "mr-3 items-end" : "ml-3 items-start"
|
|
1359
|
+
(r(!0), v(fe, null, me(u(Q), (n, j) => (r(), v("div", {
|
|
1360
|
+
key: j,
|
|
1361
|
+
class: X([
|
|
1362
|
+
"message-wrapper",
|
|
1363
|
+
n.isSelf ? "message-self" : "message-other"
|
|
1360
1364
|
])
|
|
1361
1365
|
}, [
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
}, [
|
|
1378
|
-
t("img", {
|
|
1379
|
-
src: s.fileUrl,
|
|
1380
|
-
alt: s.fileName,
|
|
1381
|
-
class: "w-full h-auto block",
|
|
1382
|
-
onError: ot
|
|
1383
|
-
}, null, 40, Ks),
|
|
1384
|
-
s.fileName || s.fileSize ? (i(), f("div", {
|
|
1366
|
+
t("div", Ms, [
|
|
1367
|
+
t("img", {
|
|
1368
|
+
src: n.isSelf ? u(z) : D.value.avatar,
|
|
1369
|
+
class: "avatar-sm"
|
|
1370
|
+
}, null, 8, $s)
|
|
1371
|
+
]),
|
|
1372
|
+
t("div", {
|
|
1373
|
+
class: X([
|
|
1374
|
+
"message-content-wrapper",
|
|
1375
|
+
n.isSelf ? "content-self" : "content-other"
|
|
1376
|
+
])
|
|
1377
|
+
}, [
|
|
1378
|
+
n.isSelf ? I("", !0) : (r(), v("div", Es, k(D.value.name), 1)),
|
|
1379
|
+
t("div", Ks, [
|
|
1380
|
+
n.type === "text" ? (r(), v("div", {
|
|
1385
1381
|
key: 0,
|
|
1386
|
-
class:
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
}, [
|
|
1390
|
-
s.fileSize ? (i(), f("div", Ws, w(Ne(s.fileSize)), 1)) : F("", !0)
|
|
1391
|
-
], 2)) : F("", !0)
|
|
1392
|
-
], 10, $s)) : s.type === "file" ? (i(), f("div", {
|
|
1393
|
-
key: 2,
|
|
1394
|
-
class: j([
|
|
1395
|
-
"rounded-lg shadow-sm cursor-pointer overflow-hidden min-w-[200px]",
|
|
1396
|
-
s.isSelf ? "self-end message-bubble-self" : "message-bubble-other"
|
|
1397
|
-
]),
|
|
1398
|
-
onClick: (De) => Pe(s.fileUrl)
|
|
1399
|
-
}, [
|
|
1400
|
-
t("div", {
|
|
1401
|
-
class: j([
|
|
1402
|
-
"flex items-center gap-3 px-4 py-3",
|
|
1403
|
-
s.isSelf ? "bg-[#95ec69]" : "bg-white"
|
|
1382
|
+
class: X([
|
|
1383
|
+
"message-bubble",
|
|
1384
|
+
n.isSelf ? "bubble-self" : "bubble-other"
|
|
1404
1385
|
])
|
|
1386
|
+
}, k(n.text), 3)) : n.type === "file" && n.fileType === "image" ? (r(), v("div", {
|
|
1387
|
+
key: 1,
|
|
1388
|
+
class: X([
|
|
1389
|
+
"message-bubble",
|
|
1390
|
+
"image-bubble",
|
|
1391
|
+
n.isSelf ? "bubble-self" : "bubble-other"
|
|
1392
|
+
]),
|
|
1393
|
+
onClick: ($e) => je(n.fileUrl)
|
|
1405
1394
|
}, [
|
|
1406
|
-
t("
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1395
|
+
t("img", {
|
|
1396
|
+
src: n.fileUrl,
|
|
1397
|
+
alt: n.fileName,
|
|
1398
|
+
class: "message-image",
|
|
1399
|
+
onError: dt
|
|
1400
|
+
}, null, 40, Bs),
|
|
1401
|
+
n.fileSize ? (r(), v("div", Ns, k(Pe(n.fileSize)), 1)) : I("", !0)
|
|
1402
|
+
], 10, Ws)) : n.type === "file" ? (r(), v("div", {
|
|
1403
|
+
key: 2,
|
|
1404
|
+
class: X([
|
|
1405
|
+
"message-bubble",
|
|
1406
|
+
"file-bubble",
|
|
1407
|
+
n.isSelf ? "bubble-self" : "bubble-other"
|
|
1416
1408
|
]),
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
])
|
|
1423
|
-
}, w(s.fileName || s.text), 3),
|
|
1424
|
-
t("div", {
|
|
1425
|
-
class: j([
|
|
1426
|
-
"text-xs mt-1 flex items-center gap-2",
|
|
1427
|
-
s.isSelf ? "text-gray-600" : "text-gray-500"
|
|
1428
|
-
])
|
|
1429
|
-
}, [
|
|
1430
|
-
h(p, { size: 12 }, {
|
|
1409
|
+
onClick: ($e) => je(n.fileUrl)
|
|
1410
|
+
}, [
|
|
1411
|
+
t("div", qs, [
|
|
1412
|
+
t("div", Ps, [
|
|
1413
|
+
p(h, { size: 28 }, {
|
|
1431
1414
|
default: b(() => [
|
|
1432
|
-
|
|
1415
|
+
p(u(Rt))
|
|
1433
1416
|
]),
|
|
1434
1417
|
_: 1
|
|
1435
|
-
})
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1418
|
+
})
|
|
1419
|
+
]),
|
|
1420
|
+
t("div", Os, [
|
|
1421
|
+
t("div", js, k(n.fileName || n.text), 1),
|
|
1422
|
+
t("div", Xs, [
|
|
1423
|
+
p(h, { size: 12 }, {
|
|
1424
|
+
default: b(() => [
|
|
1425
|
+
p(u(It))
|
|
1426
|
+
]),
|
|
1427
|
+
_: 1
|
|
1428
|
+
}),
|
|
1429
|
+
l[19] || (l[19] = t("span", null, "点击下载", -1)),
|
|
1430
|
+
n.fileSize ? (r(), v("span", Ys, "· " + k(Pe(n.fileSize)), 1)) : I("", !0)
|
|
1431
|
+
])
|
|
1432
|
+
])
|
|
1439
1433
|
])
|
|
1440
|
-
],
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
])
|
|
1449
|
-
], 2)
|
|
1450
|
-
],
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
]))
|
|
1481
|
-
]))
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
onClick: nt
|
|
1493
|
-
}, {
|
|
1494
|
-
default: b(() => [
|
|
1495
|
-
h(u(Ye))
|
|
1496
|
-
]),
|
|
1497
|
-
_: 1
|
|
1498
|
-
}),
|
|
1499
|
-
h(p, { class: "text-gray-500 cursor-pointer hover:text-gray-700" }, {
|
|
1500
|
-
default: b(() => [
|
|
1501
|
-
h(u(Ft))
|
|
1502
|
-
]),
|
|
1503
|
-
_: 1
|
|
1504
|
-
})
|
|
1505
|
-
])) : F("", !0),
|
|
1506
|
-
t("div", ta, [
|
|
1507
|
-
xt(t("textarea", {
|
|
1508
|
-
"onUpdate:modelValue": l[4] || (l[4] = (s) => we(_) ? _.value = s : null),
|
|
1509
|
-
onKeydown: bt(Oe(He, ["prevent"]), ["enter"]),
|
|
1510
|
-
onPaste: rt,
|
|
1511
|
-
placeholder: "输入消息或粘贴文件...",
|
|
1512
|
-
class: "w-full resize-none border-0 outline-none text-sm h-[80px]",
|
|
1513
|
-
rows: "3"
|
|
1514
|
-
}, null, 40, sa), [
|
|
1515
|
-
[_t, u(_)]
|
|
1516
|
-
])
|
|
1517
|
-
]),
|
|
1518
|
-
t("div", aa, [
|
|
1519
|
-
h(fe, {
|
|
1520
|
-
type: "primary",
|
|
1521
|
-
disabled: !u(_).trim() && W.value.length === 0,
|
|
1522
|
-
onClick: He,
|
|
1523
|
-
class: "bg-[#07c160] hover:bg-[#06ad56] border-0 text-sm px-6"
|
|
1524
|
-
}, {
|
|
1525
|
-
default: b(() => [...l[20] || (l[20] = [
|
|
1526
|
-
se(" 发送 ", -1)
|
|
1527
|
-
])]),
|
|
1528
|
-
_: 1
|
|
1529
|
-
}, 8, ["disabled"])
|
|
1530
|
-
]),
|
|
1531
|
-
t("input", {
|
|
1532
|
-
ref_key: "fileInputRef",
|
|
1533
|
-
ref: ue,
|
|
1534
|
-
type: "file",
|
|
1535
|
-
multiple: "",
|
|
1536
|
-
class: "hidden",
|
|
1537
|
-
onChange: lt
|
|
1538
|
-
}, null, 544)
|
|
1539
|
-
])
|
|
1540
|
-
])) : M.value ? F("", !0) : (i(), f("div", na, [
|
|
1541
|
-
h(p, {
|
|
1542
|
-
size: 64,
|
|
1543
|
-
class: "text-gray-300 mb-2"
|
|
1544
|
-
}, {
|
|
1545
|
-
default: b(() => [
|
|
1546
|
-
h(u(Rt))
|
|
1547
|
-
]),
|
|
1548
|
-
_: 1
|
|
1549
|
-
}),
|
|
1550
|
-
t("div", la, w(Q.value === "apply" ? "在左侧选择好友申请" : "在左侧选择好友开始聊天"), 1)
|
|
1551
|
-
]))
|
|
1552
|
-
]),
|
|
1553
|
-
de.value ? (i(), f("div", ra, [
|
|
1554
|
-
l[22] || (l[22] = t("div", { class: "h-14 flex items-center justify-center border-b border-gray-200" }, [
|
|
1555
|
-
t("span", { class: "font-medium text-gray-700" }, "聊天详情")
|
|
1556
|
-
], -1)),
|
|
1557
|
-
t("div", oa, [
|
|
1558
|
-
t("div", ia, [
|
|
1559
|
-
t("img", {
|
|
1560
|
-
src: D.value?.avatar,
|
|
1561
|
-
alt: D.value?.name,
|
|
1562
|
-
class: "w-20 h-20 rounded-full object-cover"
|
|
1563
|
-
}, null, 8, ca),
|
|
1564
|
-
t("div", da, w(D.value?.name), 1),
|
|
1565
|
-
l[21] || (l[21] = t("div", { class: "mt-6 w-full" }, [
|
|
1566
|
-
t("div", { class: "bg-white rounded-lg" }, [
|
|
1567
|
-
t("div", { class: "p-3 border-b border-gray-100 cursor-pointer hover:bg-gray-50" }, [
|
|
1568
|
-
t("span", { class: "text-sm text-gray-700" }, "查找聊天记录")
|
|
1569
|
-
]),
|
|
1570
|
-
t("div", { class: "p-3 border-b border-gray-100 cursor-pointer hover:bg-gray-50" }, [
|
|
1571
|
-
t("span", { class: "text-sm text-gray-700" }, "清空聊天记录")
|
|
1572
|
-
])
|
|
1573
|
-
])
|
|
1574
|
-
], -1))
|
|
1575
|
-
])
|
|
1576
|
-
])
|
|
1577
|
-
])) : F("", !0)
|
|
1578
|
-
]),
|
|
1579
|
-
h(je, {
|
|
1580
|
-
modelValue: u(ae),
|
|
1581
|
-
"onUpdate:modelValue": l[6] || (l[6] = (s) => we(ae) ? ae.value = s : null),
|
|
1582
|
-
title: "添加好友",
|
|
1583
|
-
width: "500px",
|
|
1584
|
-
"append-to-body": ""
|
|
1585
|
-
}, {
|
|
1586
|
-
default: b(() => [
|
|
1587
|
-
t("div", ua, [
|
|
1588
|
-
t("div", fa, [
|
|
1589
|
-
h(S, {
|
|
1590
|
-
modelValue: u(ee),
|
|
1591
|
-
"onUpdate:modelValue": l[5] || (l[5] = (s) => we(ee) ? ee.value = s : null),
|
|
1592
|
-
placeholder: "搜索用户",
|
|
1593
|
-
"prefix-icon": u(Ee)
|
|
1594
|
-
}, null, 8, ["modelValue", "prefix-icon"])
|
|
1595
|
-
])
|
|
1596
|
-
]),
|
|
1597
|
-
t("div", ha, [
|
|
1598
|
-
u(U) ? (i(), H(ge, {
|
|
1599
|
-
key: 0,
|
|
1600
|
-
description: "加载中..."
|
|
1601
|
-
})) : u(Y).length === 0 ? (i(), H(ge, {
|
|
1602
|
-
key: 1,
|
|
1603
|
-
description: "暂无用户"
|
|
1604
|
-
})) : (i(!0), f(he, { key: 2 }, pe(u(Y), (s) => (i(), f("div", {
|
|
1605
|
-
key: s.username,
|
|
1606
|
-
class: "flex items-center justify-between p-3 hover:bg-gray-50 rounded-lg mb-2 transition-colors"
|
|
1607
|
-
}, [
|
|
1608
|
-
t("div", pa, [
|
|
1609
|
-
t("img", {
|
|
1610
|
-
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${s.username}`,
|
|
1611
|
-
alt: s.username,
|
|
1612
|
-
class: "w-10 h-10 rounded-full object-cover"
|
|
1613
|
-
}, null, 8, ma),
|
|
1614
|
-
t("div", va, [
|
|
1615
|
-
t("div", ga, w(s.username), 1)
|
|
1616
|
-
])
|
|
1617
|
-
]),
|
|
1618
|
-
h(fe, {
|
|
1619
|
-
type: "primary",
|
|
1620
|
-
size: "small",
|
|
1621
|
-
onClick: (O) => u(Ae)(s)
|
|
1622
|
-
}, {
|
|
1623
|
-
default: b(() => [...l[23] || (l[23] = [
|
|
1624
|
-
se("添加", -1)
|
|
1625
|
-
])]),
|
|
1626
|
-
_: 1
|
|
1627
|
-
}, 8, ["onClick"])
|
|
1628
|
-
]))), 128))
|
|
1629
|
-
])
|
|
1630
|
-
]),
|
|
1631
|
-
_: 1
|
|
1632
|
-
}, 8, ["modelValue"]),
|
|
1633
|
-
h(je, {
|
|
1634
|
-
modelValue: r.value,
|
|
1635
|
-
"onUpdate:modelValue": l[11] || (l[11] = (s) => r.value = s),
|
|
1636
|
-
title: "个人设置",
|
|
1637
|
-
width: "560px",
|
|
1638
|
-
"close-on-click-modal": !1,
|
|
1639
|
-
"append-to-body": "",
|
|
1640
|
-
class: "settings-dialog"
|
|
1641
|
-
}, {
|
|
1642
|
-
default: b(() => [
|
|
1643
|
-
t("div", ya, [
|
|
1644
|
-
t("div", xa, [
|
|
1645
|
-
t("div", ba, [
|
|
1646
|
-
t("img", {
|
|
1647
|
-
src: u(z),
|
|
1648
|
-
alt: "头像",
|
|
1649
|
-
class: "w-28 h-28 rounded-full object-cover border-4 border-white shadow-lg"
|
|
1650
|
-
}, null, 8, _a),
|
|
1651
|
-
y.config.modules.avatarCrop ? (i(), f("div", {
|
|
1652
|
-
key: 0,
|
|
1653
|
-
class: "absolute -bottom-1 -right-1 w-10 h-10 bg-green-500 rounded-full flex items-center justify-center cursor-pointer hover:bg-green-600 transition-all shadow-md",
|
|
1654
|
-
onClick: at
|
|
1655
|
-
}, [
|
|
1656
|
-
h(p, {
|
|
1657
|
-
size: 18,
|
|
1658
|
-
class: "text-white"
|
|
1434
|
+
], 10, Hs)) : I("", !0),
|
|
1435
|
+
t("div", {
|
|
1436
|
+
class: X([
|
|
1437
|
+
"message-time",
|
|
1438
|
+
n.isSelf ? "time-right" : "time-left"
|
|
1439
|
+
])
|
|
1440
|
+
}, k(u(ie)(n.time)), 3)
|
|
1441
|
+
])
|
|
1442
|
+
], 2)
|
|
1443
|
+
], 2))), 128))
|
|
1444
|
+
], 512),
|
|
1445
|
+
t("div", Gs, [
|
|
1446
|
+
B.value.length > 0 ? (r(), v("div", Js, [
|
|
1447
|
+
(r(!0), v(fe, null, me(B.value, (n, j) => (r(), v("div", {
|
|
1448
|
+
key: n.id,
|
|
1449
|
+
class: "pending-file"
|
|
1450
|
+
}, [
|
|
1451
|
+
n.isImage ? (r(), v("div", Qs, [
|
|
1452
|
+
t("img", {
|
|
1453
|
+
src: n.previewUrl,
|
|
1454
|
+
alt: n.name,
|
|
1455
|
+
class: "pending-image"
|
|
1456
|
+
}, null, 8, Zs),
|
|
1457
|
+
t("button", {
|
|
1458
|
+
onClick: ($e) => qe(j),
|
|
1459
|
+
class: "remove-file-btn"
|
|
1460
|
+
}, " × ", 8, ea)
|
|
1461
|
+
])) : (r(), v("div", ta, [
|
|
1462
|
+
p(h, { class: "pending-file-icon" }, {
|
|
1463
|
+
default: b(() => [
|
|
1464
|
+
p(u(Ze))
|
|
1465
|
+
]),
|
|
1466
|
+
_: 1
|
|
1467
|
+
}),
|
|
1468
|
+
t("span", sa, k(n.name), 1),
|
|
1469
|
+
t("button", {
|
|
1470
|
+
onClick: ($e) => qe(j),
|
|
1471
|
+
class: "remove-file-btn"
|
|
1472
|
+
}, " × ", 8, aa)
|
|
1473
|
+
]))
|
|
1474
|
+
]))), 128))
|
|
1475
|
+
])) : I("", !0),
|
|
1476
|
+
y.config.modules.fileUpload ? (r(), v("div", na, [
|
|
1477
|
+
p(h, { class: "action-icon" }, {
|
|
1478
|
+
default: b(() => [
|
|
1479
|
+
p(u(Ee))
|
|
1480
|
+
]),
|
|
1481
|
+
_: 1
|
|
1482
|
+
}),
|
|
1483
|
+
p(h, {
|
|
1484
|
+
class: "action-icon",
|
|
1485
|
+
onClick: ot
|
|
1659
1486
|
}, {
|
|
1660
1487
|
default: b(() => [
|
|
1661
|
-
|
|
1488
|
+
p(u(Ze))
|
|
1489
|
+
]),
|
|
1490
|
+
_: 1
|
|
1491
|
+
}),
|
|
1492
|
+
p(h, { class: "action-icon" }, {
|
|
1493
|
+
default: b(() => [
|
|
1494
|
+
p(u(Lt))
|
|
1662
1495
|
]),
|
|
1663
1496
|
_: 1
|
|
1664
1497
|
})
|
|
1665
|
-
])) :
|
|
1498
|
+
])) : I("", !0),
|
|
1499
|
+
t("div", la, [
|
|
1500
|
+
kt(t("textarea", {
|
|
1501
|
+
"onUpdate:modelValue": l[4] || (l[4] = (n) => we(C) ? C.value = n : null),
|
|
1502
|
+
onKeydown: wt(Je(Oe, ["prevent"]), ["enter"]),
|
|
1503
|
+
onPaste: ct,
|
|
1504
|
+
placeholder: "输入消息或粘贴文件...",
|
|
1505
|
+
class: "message-input",
|
|
1506
|
+
rows: "3"
|
|
1507
|
+
}, null, 40, ia), [
|
|
1508
|
+
[Ut, u(C)]
|
|
1509
|
+
])
|
|
1510
|
+
]),
|
|
1511
|
+
t("div", oa, [
|
|
1512
|
+
p(ae, {
|
|
1513
|
+
type: "primary",
|
|
1514
|
+
disabled: !u(C).trim() && B.value.length === 0,
|
|
1515
|
+
onClick: Oe,
|
|
1516
|
+
class: "send-btn"
|
|
1517
|
+
}, {
|
|
1518
|
+
default: b(() => [...l[20] || (l[20] = [
|
|
1519
|
+
ne(" 发送 ", -1)
|
|
1520
|
+
])]),
|
|
1521
|
+
_: 1
|
|
1522
|
+
}, 8, ["disabled"])
|
|
1523
|
+
]),
|
|
1666
1524
|
t("input", {
|
|
1667
|
-
ref_key: "
|
|
1668
|
-
ref:
|
|
1525
|
+
ref_key: "fileInputRef",
|
|
1526
|
+
ref: ve,
|
|
1669
1527
|
type: "file",
|
|
1670
|
-
|
|
1671
|
-
class: "hidden",
|
|
1672
|
-
onChange:
|
|
1528
|
+
multiple: "",
|
|
1529
|
+
class: "hidden-file-input",
|
|
1530
|
+
onChange: rt
|
|
1673
1531
|
}, null, 544)
|
|
1674
|
-
])
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1532
|
+
])
|
|
1533
|
+
])) : M.value ? I("", !0) : (r(), v("div", ra, [
|
|
1534
|
+
p(h, {
|
|
1535
|
+
size: 64,
|
|
1536
|
+
class: "empty-icon"
|
|
1537
|
+
}, {
|
|
1538
|
+
default: b(() => [
|
|
1539
|
+
p(u(Tt))
|
|
1540
|
+
]),
|
|
1541
|
+
_: 1
|
|
1542
|
+
}),
|
|
1543
|
+
t("div", ca, k(Z.value === "apply" ? "在左侧选择好友申请" : "在左侧选择好友开始聊天"), 1)
|
|
1544
|
+
]))
|
|
1545
|
+
]),
|
|
1546
|
+
ue.value ? (r(), v("div", da, [
|
|
1547
|
+
l[22] || (l[22] = t("div", { class: "detail-header" }, "聊天详情", -1)),
|
|
1548
|
+
t("div", ua, [
|
|
1549
|
+
t("div", va, [
|
|
1550
|
+
t("img", {
|
|
1551
|
+
src: (ke = D.value) == null ? void 0 : ke.avatar,
|
|
1552
|
+
alt: (Ye = D.value) == null ? void 0 : Ye.name,
|
|
1553
|
+
class: "detail-avatar"
|
|
1554
|
+
}, null, 8, pa),
|
|
1555
|
+
t("div", fa, k((Ge = D.value) == null ? void 0 : Ge.name), 1),
|
|
1556
|
+
l[21] || (l[21] = t("div", { class: "detail-actions" }, [
|
|
1557
|
+
t("div", { class: "detail-action-item" }, "查找聊天记录"),
|
|
1558
|
+
t("div", { class: "detail-action-item" }, "清空聊天记录")
|
|
1559
|
+
], -1))
|
|
1560
|
+
])
|
|
1561
|
+
])
|
|
1562
|
+
])) : I("", !0)
|
|
1563
|
+
]),
|
|
1564
|
+
p(Me, {
|
|
1565
|
+
modelValue: u(le),
|
|
1566
|
+
"onUpdate:modelValue": l[6] || (l[6] = (n) => we(le) ? le.value = n : null),
|
|
1567
|
+
title: "添加好友",
|
|
1568
|
+
width: "500px",
|
|
1569
|
+
"append-to-body": ""
|
|
1570
|
+
}, {
|
|
1571
|
+
default: b(() => [
|
|
1572
|
+
t("div", ma, [
|
|
1573
|
+
t("div", ha, [
|
|
1574
|
+
p(L, {
|
|
1575
|
+
modelValue: u(te),
|
|
1576
|
+
"onUpdate:modelValue": l[5] || (l[5] = (n) => we(te) ? te.value = n : null),
|
|
1577
|
+
placeholder: "搜索用户",
|
|
1578
|
+
"prefix-icon": u(Ke)
|
|
1579
|
+
}, null, 8, ["modelValue", "prefix-icon"])
|
|
1678
1580
|
])
|
|
1679
1581
|
]),
|
|
1680
|
-
t("div",
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1582
|
+
t("div", ga, [
|
|
1583
|
+
u(x) ? (r(), q($, {
|
|
1584
|
+
key: 0,
|
|
1585
|
+
description: "加载中..."
|
|
1586
|
+
})) : u(G).length === 0 ? (r(), q($, {
|
|
1587
|
+
key: 1,
|
|
1588
|
+
description: "暂无用户"
|
|
1589
|
+
})) : (r(!0), v(fe, { key: 2 }, me(u(G), (n) => (r(), v("div", {
|
|
1590
|
+
key: n.username,
|
|
1591
|
+
class: "available-user-item"
|
|
1592
|
+
}, [
|
|
1593
|
+
t("div", ya, [
|
|
1594
|
+
t("img", {
|
|
1595
|
+
src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${n.username}`,
|
|
1596
|
+
alt: n.username,
|
|
1597
|
+
class: "available-user-avatar"
|
|
1598
|
+
}, null, 8, _a),
|
|
1599
|
+
t("div", ba, k(n.username), 1)
|
|
1690
1600
|
]),
|
|
1691
|
-
|
|
1692
|
-
key: 0,
|
|
1601
|
+
p(ae, {
|
|
1693
1602
|
type: "primary",
|
|
1694
1603
|
size: "small",
|
|
1695
|
-
onClick:
|
|
1696
|
-
class: "rounded-full"
|
|
1604
|
+
onClick: (j) => u(Se)(n)
|
|
1697
1605
|
}, {
|
|
1698
|
-
default: b(() => [...l[
|
|
1699
|
-
|
|
1606
|
+
default: b(() => [...l[23] || (l[23] = [
|
|
1607
|
+
ne("添加", -1)
|
|
1700
1608
|
])]),
|
|
1701
1609
|
_: 1
|
|
1702
|
-
})
|
|
1703
|
-
]),
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
N.value ? (i(), H(S, {
|
|
1610
|
+
}, 8, ["onClick"])
|
|
1611
|
+
]))), 128))
|
|
1612
|
+
])
|
|
1613
|
+
]),
|
|
1614
|
+
_: 1
|
|
1615
|
+
}, 8, ["modelValue"]),
|
|
1616
|
+
p(Me, {
|
|
1617
|
+
modelValue: i.value,
|
|
1618
|
+
"onUpdate:modelValue": l[11] || (l[11] = (n) => i.value = n),
|
|
1619
|
+
title: "个人设置",
|
|
1620
|
+
width: "560px",
|
|
1621
|
+
"close-on-click-modal": !1,
|
|
1622
|
+
"append-to-body": "",
|
|
1623
|
+
class: "settings-dialog"
|
|
1624
|
+
}, {
|
|
1625
|
+
default: b(() => [
|
|
1626
|
+
t("div", Ca, [
|
|
1627
|
+
t("div", ka, [
|
|
1628
|
+
t("div", wa, [
|
|
1629
|
+
t("img", {
|
|
1630
|
+
src: u(z),
|
|
1631
|
+
alt: "头像",
|
|
1632
|
+
class: "settings-avatar"
|
|
1633
|
+
}, null, 8, Ua),
|
|
1634
|
+
y.config.modules.avatarCrop ? (r(), v("div", {
|
|
1728
1635
|
key: 0,
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1636
|
+
class: "settings-avatar-edit",
|
|
1637
|
+
onClick: it
|
|
1638
|
+
}, [
|
|
1639
|
+
p(h, {
|
|
1640
|
+
size: 18,
|
|
1641
|
+
class: "settings-avatar-icon"
|
|
1642
|
+
}, {
|
|
1643
|
+
default: b(() => [
|
|
1644
|
+
p(u(zt))
|
|
1645
|
+
]),
|
|
1646
|
+
_: 1
|
|
1647
|
+
})
|
|
1648
|
+
])) : I("", !0),
|
|
1649
|
+
t("input", {
|
|
1650
|
+
ref_key: "avatarInputRef",
|
|
1651
|
+
ref: se,
|
|
1652
|
+
type: "file",
|
|
1653
|
+
accept: "image/*",
|
|
1654
|
+
class: "hidden-avatar-input",
|
|
1655
|
+
onChange: ut
|
|
1656
|
+
}, null, 544)
|
|
1734
1657
|
]),
|
|
1735
|
-
t("div",
|
|
1736
|
-
|
|
1737
|
-
|
|
1658
|
+
t("div", xa, [
|
|
1659
|
+
t("div", Aa, k(u(w).nickname || u(T)), 1),
|
|
1660
|
+
t("div", Sa, "@" + k(u(T)), 1)
|
|
1661
|
+
])
|
|
1662
|
+
]),
|
|
1663
|
+
t("div", Va, [
|
|
1664
|
+
t("div", Fa, [
|
|
1665
|
+
t("div", Ra, [
|
|
1666
|
+
p(h, null, {
|
|
1667
|
+
default: b(() => [
|
|
1668
|
+
p(u(Qe))
|
|
1669
|
+
]),
|
|
1670
|
+
_: 1
|
|
1671
|
+
}),
|
|
1672
|
+
l[24] || (l[24] = ne(" 个人信息 ", -1))
|
|
1673
|
+
]),
|
|
1674
|
+
H.value ? I("", !0) : (r(), q(ae, {
|
|
1738
1675
|
key: 0,
|
|
1739
|
-
modelValue: K.value.bio,
|
|
1740
|
-
"onUpdate:modelValue": l[10] || (l[10] = (s) => K.value.bio = s),
|
|
1741
|
-
type: "textarea",
|
|
1742
|
-
rows: 4,
|
|
1743
|
-
placeholder: "介绍一下自己吧...",
|
|
1744
|
-
size: "large"
|
|
1745
|
-
}, null, 8, ["modelValue"])) : (i(), f("div", La, w(u(k).bio || "这个人很懒,什么都没写~"), 1))
|
|
1746
|
-
]),
|
|
1747
|
-
N.value ? (i(), f("div", Ta, [
|
|
1748
|
-
h(fe, {
|
|
1749
|
-
size: "default",
|
|
1750
|
-
onClick: ut
|
|
1751
|
-
}, {
|
|
1752
|
-
default: b(() => [...l[30] || (l[30] = [
|
|
1753
|
-
se("取消", -1)
|
|
1754
|
-
])]),
|
|
1755
|
-
_: 1
|
|
1756
|
-
}),
|
|
1757
|
-
h(fe, {
|
|
1758
1676
|
type: "primary",
|
|
1759
|
-
size: "
|
|
1760
|
-
|
|
1761
|
-
|
|
1677
|
+
size: "small",
|
|
1678
|
+
onClick: pt,
|
|
1679
|
+
class: "settings-edit-btn"
|
|
1762
1680
|
}, {
|
|
1763
|
-
default: b(() => [...l[
|
|
1764
|
-
|
|
1681
|
+
default: b(() => [...l[25] || (l[25] = [
|
|
1682
|
+
ne(" 编辑 ", -1)
|
|
1765
1683
|
])]),
|
|
1766
1684
|
_: 1
|
|
1767
|
-
}
|
|
1768
|
-
])
|
|
1685
|
+
}))
|
|
1686
|
+
]),
|
|
1687
|
+
t("div", Ia, [
|
|
1688
|
+
t("div", La, [
|
|
1689
|
+
l[26] || (l[26] = t("label", { class: "settings-form-label" }, "昵称", -1)),
|
|
1690
|
+
H.value ? (r(), q(L, {
|
|
1691
|
+
key: 0,
|
|
1692
|
+
modelValue: W.value.nickname,
|
|
1693
|
+
"onUpdate:modelValue": l[7] || (l[7] = (n) => W.value.nickname = n),
|
|
1694
|
+
placeholder: "请输入昵称",
|
|
1695
|
+
size: "large"
|
|
1696
|
+
}, null, 8, ["modelValue"])) : (r(), v("div", Ta, k(u(w).nickname || "未设置"), 1))
|
|
1697
|
+
]),
|
|
1698
|
+
t("div", za, [
|
|
1699
|
+
l[27] || (l[27] = t("label", { class: "settings-form-label" }, "邮箱", -1)),
|
|
1700
|
+
H.value ? (r(), q(L, {
|
|
1701
|
+
key: 0,
|
|
1702
|
+
modelValue: W.value.email,
|
|
1703
|
+
"onUpdate:modelValue": l[8] || (l[8] = (n) => W.value.email = n),
|
|
1704
|
+
placeholder: "请输入邮箱",
|
|
1705
|
+
size: "large"
|
|
1706
|
+
}, null, 8, ["modelValue"])) : (r(), v("div", Da, k(u(w).email || "未设置"), 1))
|
|
1707
|
+
]),
|
|
1708
|
+
t("div", Ma, [
|
|
1709
|
+
l[28] || (l[28] = t("label", { class: "settings-form-label" }, "手机号", -1)),
|
|
1710
|
+
H.value ? (r(), q(L, {
|
|
1711
|
+
key: 0,
|
|
1712
|
+
modelValue: W.value.phone,
|
|
1713
|
+
"onUpdate:modelValue": l[9] || (l[9] = (n) => W.value.phone = n),
|
|
1714
|
+
placeholder: "请输入手机号",
|
|
1715
|
+
size: "large"
|
|
1716
|
+
}, null, 8, ["modelValue"])) : (r(), v("div", $a, k(u(w).phone || "未设置"), 1))
|
|
1717
|
+
]),
|
|
1718
|
+
t("div", Ea, [
|
|
1719
|
+
l[29] || (l[29] = t("label", { class: "settings-form-label" }, "个人简介", -1)),
|
|
1720
|
+
H.value ? (r(), q(L, {
|
|
1721
|
+
key: 0,
|
|
1722
|
+
modelValue: W.value.bio,
|
|
1723
|
+
"onUpdate:modelValue": l[10] || (l[10] = (n) => W.value.bio = n),
|
|
1724
|
+
type: "textarea",
|
|
1725
|
+
rows: 4,
|
|
1726
|
+
placeholder: "介绍一下自己吧...",
|
|
1727
|
+
size: "large"
|
|
1728
|
+
}, null, 8, ["modelValue"])) : (r(), v("div", Ka, k(u(w).bio || "这个人很懒,什么都没写~"), 1))
|
|
1729
|
+
]),
|
|
1730
|
+
H.value ? (r(), v("div", Wa, [
|
|
1731
|
+
p(ae, {
|
|
1732
|
+
size: "default",
|
|
1733
|
+
onClick: ft
|
|
1734
|
+
}, {
|
|
1735
|
+
default: b(() => [...l[30] || (l[30] = [
|
|
1736
|
+
ne("取消", -1)
|
|
1737
|
+
])]),
|
|
1738
|
+
_: 1
|
|
1739
|
+
}),
|
|
1740
|
+
p(ae, {
|
|
1741
|
+
type: "primary",
|
|
1742
|
+
size: "default",
|
|
1743
|
+
loading: a.value,
|
|
1744
|
+
onClick: mt
|
|
1745
|
+
}, {
|
|
1746
|
+
default: b(() => [...l[31] || (l[31] = [
|
|
1747
|
+
ne("保存更改", -1)
|
|
1748
|
+
])]),
|
|
1749
|
+
_: 1
|
|
1750
|
+
}, 8, ["loading"])
|
|
1751
|
+
])) : I("", !0)
|
|
1752
|
+
])
|
|
1769
1753
|
])
|
|
1770
1754
|
])
|
|
1771
|
-
])
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
]
|
|
1791
|
-
|
|
1755
|
+
]),
|
|
1756
|
+
_: 1
|
|
1757
|
+
}, 8, ["modelValue"]),
|
|
1758
|
+
p(Ot, {
|
|
1759
|
+
modelValue: c.value,
|
|
1760
|
+
"onUpdate:modelValue": l[12] || (l[12] = (n) => c.value = n),
|
|
1761
|
+
src: ee.value,
|
|
1762
|
+
onConfirm: vt
|
|
1763
|
+
}, null, 8, ["modelValue", "src"]),
|
|
1764
|
+
pe.value.visible ? (r(), v("div", {
|
|
1765
|
+
key: 0,
|
|
1766
|
+
class: "context-menu",
|
|
1767
|
+
style: xt({ left: pe.value.x + "px", top: pe.value.y + "px" })
|
|
1768
|
+
}, [
|
|
1769
|
+
t("div", {
|
|
1770
|
+
class: "context-menu-item",
|
|
1771
|
+
onClick: st
|
|
1772
|
+
}, "删除聊天")
|
|
1773
|
+
], 4)) : I("", !0)
|
|
1774
|
+
];
|
|
1775
|
+
}),
|
|
1792
1776
|
_: 1
|
|
1793
1777
|
}, 8, ["modelValue", "width"]);
|
|
1794
1778
|
};
|
|
1795
1779
|
}
|
|
1796
|
-
},
|
|
1780
|
+
}, ja = /* @__PURE__ */ et(Ba, [["__scopeId", "data-v-a76a4ef3"]]), Na = {
|
|
1797
1781
|
// API 配置
|
|
1798
1782
|
api: {
|
|
1799
1783
|
baseUrl: "",
|
|
@@ -1852,29 +1836,29 @@ const Ge = (y, e) => {
|
|
|
1852
1836
|
allowedTypes: ["*"]
|
|
1853
1837
|
}
|
|
1854
1838
|
};
|
|
1855
|
-
function
|
|
1856
|
-
const e =
|
|
1839
|
+
function Xa(y = {}) {
|
|
1840
|
+
const e = tt(Na, y);
|
|
1857
1841
|
return e.api.baseUrl || console.warn("[VueChatKit] 请配置 api.baseUrl"), e.api.websocketUrl || console.warn("[VueChatKit] 请配置 api.websocketUrl"), e.user.username || console.warn("[VueChatKit] 请配置 user.username"), e;
|
|
1858
1842
|
}
|
|
1859
|
-
function
|
|
1860
|
-
const
|
|
1843
|
+
function tt(y, e) {
|
|
1844
|
+
const s = { ...y };
|
|
1861
1845
|
for (const o in e)
|
|
1862
|
-
e[o] && typeof e[o] == "object" && !Array.isArray(e[o]) ?
|
|
1863
|
-
return
|
|
1846
|
+
e[o] && typeof e[o] == "object" && !Array.isArray(e[o]) ? s[o] = tt(y[o] || {}, e[o]) : s[o] = e[o];
|
|
1847
|
+
return s;
|
|
1864
1848
|
}
|
|
1865
|
-
const
|
|
1849
|
+
const Ya = {
|
|
1866
1850
|
install(y) {
|
|
1867
1851
|
y.component("ChatWindow", ChatWindow), y.component("AvatarCrop", AvatarCrop);
|
|
1868
1852
|
}
|
|
1869
1853
|
};
|
|
1870
1854
|
export {
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1855
|
+
Ot as AvatarCrop,
|
|
1856
|
+
Be as ChatApi,
|
|
1857
|
+
Dt as ChatWebSocket,
|
|
1858
|
+
ja as ChatWindow,
|
|
1859
|
+
Mt as HttpClient,
|
|
1860
|
+
Ya as VueChatKit,
|
|
1861
|
+
Xa as createChatConfig,
|
|
1862
|
+
Ya as default,
|
|
1863
|
+
Et as useChat
|
|
1880
1864
|
};
|