vue-chat-kit 0.3.6 → 0.3.8

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.
@@ -1,8 +1,8 @@
1
- import { ref as _, computed as we, nextTick as Oe, watch as Et, resolveComponent as be, openBlock as a, createBlock as G, withCtx as k, createElementVNode as e, createElementBlock as p, normalizeStyle as Xe, Fragment as me, renderList as fe, withModifiers as Be, normalizeClass as J, createVNode as m, createTextVNode as ue, onMounted as _t, onUnmounted as bt, unref as c, resolveDynamicComponent as kt, toDisplayString as y, createCommentVNode as S, isRef as Ie, withDirectives as wt, withKeys as Ct, vModelText as xt } from "vue";
2
- import { ChatDotRound as Ye, UserFilled as Qe, Bell as Ut, Setting as $t, Search as qe, Plus as St, MoreFilled as zt, Document as At, Download as Vt, Folder as Ze, Picture as Ft, ChatLineRound as It, Camera as Rt } from "@element-plus/icons-vue";
1
+ import { ref as g, computed as ke, watch as _t, nextTick as Ke, resolveComponent as ye, openBlock as a, createBlock as Z, withCtx as k, createElementVNode as e, createElementBlock as p, normalizeStyle as He, Fragment as de, renderList as ue, withModifiers as Fe, normalizeClass as K, createVNode as m, createTextVNode as me, toDisplayString as y, createCommentVNode as S, onMounted as bt, onUnmounted as kt, unref as u, resolveDynamicComponent as wt, isRef as Re, withDirectives as Ct, withKeys as xt, vModelText as Ut } from "vue";
2
+ import { ChatDotRound as Xe, UserFilled as Je, Bell as $t, Setting as St, Search as Ye, Plus as zt, MoreFilled as At, Document as Ft, Download as Vt, Folder as Qe, Picture as Rt, ChatLineRound as Mt, Camera as It } from "@element-plus/icons-vue";
3
3
  import ft from "dayjs";
4
- import { ElMessage as Q } from "element-plus";
5
- class Dt {
4
+ import { ElMessage as ee } from "element-plus";
5
+ class Wt {
6
6
  constructor(t, n = {}) {
7
7
  this.userId = t, this.wsUrl = n.wsUrl || "", this.socket = null, this.reconnectAttempts = 0, this.maxReconnectAttempts = n.maxReconnectAttempts || 5, this.reconnectDelay = n.reconnectDelay || 3e3, this.handlers = {
8
8
  message: [],
@@ -40,17 +40,17 @@ class Dt {
40
40
  /**
41
41
  * 发送消息
42
42
  */
43
- send(t, n, v = "text", $ = "", ee = "", H = 0) {
43
+ send(t, n, v = "text", $ = "", O = "", H = 0) {
44
44
  if (this.isConnected()) {
45
- const Z = JSON.stringify({
45
+ const G = JSON.stringify({
46
46
  to: t,
47
47
  msg: n,
48
48
  type: v,
49
49
  fileUrl: $,
50
- fileName: ee,
50
+ fileName: O,
51
51
  fileSize: H
52
52
  });
53
- return this.socket.send(Z), !0;
53
+ return this.socket.send(G), !0;
54
54
  }
55
55
  return console.warn("[VueChatKit] WebSocket 连接未建立,无法发送消息"), !1;
56
56
  }
@@ -99,12 +99,12 @@ class Dt {
99
99
  return this.socket && this.socket.readyState === WebSocket.OPEN;
100
100
  }
101
101
  }
102
- class Je extends Error {
102
+ class Ge extends Error {
103
103
  constructor(t, n, v, $) {
104
104
  super(t), this.name = "RequestError", this.status = n || 0, this.code = v || 0, this.data = $;
105
105
  }
106
106
  }
107
- class Wt {
107
+ class jt {
108
108
  constructor(t = {}) {
109
109
  this.baseUrl = t.baseUrl || "", this.timeout = t.timeout || 1e4, this.headers = t.headers || {}, this.requestInterceptors = [], this.responseInterceptors = [], t.requestInterceptors && Array.isArray(t.requestInterceptors) && t.requestInterceptors.forEach((n) => {
110
110
  this.requestInterceptors.push(n);
@@ -133,7 +133,7 @@ class Wt {
133
133
  timeoutPromise(t) {
134
134
  return new Promise((n, v) => {
135
135
  setTimeout(() => {
136
- v(new Je("请求超时", 408, 408));
136
+ v(new Ge("请求超时", 408, 408));
137
137
  }, t);
138
138
  });
139
139
  }
@@ -141,37 +141,37 @@ class Wt {
141
141
  * 核心请求方法
142
142
  */
143
143
  async request(t, n = {}) {
144
- const { method: v = "GET", headers: $ = {}, body: ee, params: H } = n;
145
- let Z = t.startsWith("http") ? t : `${this.baseUrl}${t}`, X = {
144
+ const { method: v = "GET", headers: $ = {}, body: O, params: H } = n;
145
+ let G = t.startsWith("http") ? t : `${this.baseUrl}${t}`, V = {
146
146
  method: v,
147
147
  headers: { ...this.headers, ...$ },
148
- body: ee,
148
+ body: O,
149
149
  params: H
150
150
  };
151
- this.requestInterceptors.forEach((V) => {
152
- X = V(X);
151
+ this.requestInterceptors.forEach((R) => {
152
+ V = R(V);
153
153
  });
154
- const ve = {
155
- method: X.method,
156
- headers: X.headers,
154
+ const ie = {
155
+ method: V.method,
156
+ headers: V.headers,
157
157
  credentials: "include"
158
158
  };
159
- if (X.body && v !== "GET" && (X.body instanceof FormData ? ve.body = X.body : typeof X.body == "object" ? ve.body = JSON.stringify(X.body) : ve.body = X.body), X.params) {
160
- const V = new URLSearchParams();
161
- for (const A in X.params)
162
- X.params[A] !== void 0 && X.params[A] !== null && X.params[A] !== "" && V.append(A, X.params[A]);
163
- const U = V.toString();
164
- U && (Z += (Z.includes("?") ? "&" : "?") + U);
159
+ if (V.body && v !== "GET" && (V.body instanceof FormData ? ie.body = V.body : typeof V.body == "object" ? ie.body = JSON.stringify(V.body) : ie.body = V.body), V.params) {
160
+ const R = new URLSearchParams();
161
+ for (const A in V.params)
162
+ V.params[A] !== void 0 && V.params[A] !== null && V.params[A] !== "" && R.append(A, V.params[A]);
163
+ const U = R.toString();
164
+ U && (G += (G.includes("?") ? "&" : "?") + U);
165
165
  }
166
166
  try {
167
167
  let U = await Promise.race([
168
- fetch(Z, ve),
168
+ fetch(G, ie),
169
169
  this.timeoutPromise(this.timeout)
170
170
  ]);
171
- if (this.responseInterceptors.forEach((ce) => {
172
- U = ce(U);
171
+ if (this.responseInterceptors.forEach((ve) => {
172
+ U = ve(U);
173
173
  }), !U.ok)
174
- throw new Je(
174
+ throw new Ge(
175
175
  `HTTP ${U.status}: ${U.statusText}`,
176
176
  U.status,
177
177
  U.status
@@ -179,9 +179,9 @@ class Wt {
179
179
  const A = U.headers.get("content-type");
180
180
  let f;
181
181
  return A && A.includes("application/json") ? f = await U.json() : f = await U.text(), f;
182
- } catch (V) {
183
- throw V instanceof Je ? V : new Je(
184
- V instanceof Error ? V.message : "网络错误",
182
+ } catch (R) {
183
+ throw R instanceof Ge ? R : new Ge(
184
+ R instanceof Error ? R.message : "网络错误",
185
185
  0,
186
186
  0
187
187
  );
@@ -201,9 +201,9 @@ class Wt {
201
201
  return this.request(t, { ...n, method: "DELETE" });
202
202
  }
203
203
  }
204
- class ht {
204
+ class gt {
205
205
  constructor(t, n = null) {
206
- this.config = t, this.endpoints = t.api.endpoints, this.customAdapter = t.api.adapter, n ? this.http = n : this.http = new Wt({
206
+ this.config = t, this.endpoints = t.api.endpoints, this.customAdapter = t.api.adapter, n ? this.http = n : this.http = new jt({
207
207
  baseUrl: t.api.baseUrl,
208
208
  headers: t.headers,
209
209
  requestInterceptors: t.requestInterceptors,
@@ -235,6 +235,15 @@ class ht {
235
235
  async _getAvailableUsers(t) {
236
236
  return this.http.get(this.endpoints.getAvailableUsers, { currentUser: t });
237
237
  }
238
+ /**
239
+ * 搜索用户
240
+ */
241
+ async searchUser(t) {
242
+ return this._call("searchUser", t);
243
+ }
244
+ async _searchUser(t) {
245
+ return this.http.get(this.endpoints.searchUser, { keyword: t });
246
+ }
238
247
  /**
239
248
  * 添加好友
240
249
  */
@@ -301,16 +310,6 @@ class ht {
301
310
  const n = new FormData();
302
311
  return n.append("file", t), this.http.post(this.endpoints.uploadFile, n);
303
312
  }
304
- // ========== 用户相关 ==========
305
- /**
306
- * 获取用户信息
307
- */
308
- async getUserInfo(t) {
309
- return this._call("getUserInfo", t);
310
- }
311
- async _getUserInfo(t) {
312
- return this.http.get(this.endpoints.getUserInfo, { username: t });
313
- }
314
313
  /**
315
314
  * 更新用户信息
316
315
  */
@@ -340,133 +339,128 @@ class ht {
340
339
  return v.append("file", t), v.append("username", n), this.http.post(this.endpoints.uploadAvatar, v);
341
340
  }
342
341
  }
343
- const Mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
342
+ const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
344
343
  __proto__: null,
345
- ChatApi: ht,
346
- default: ht
344
+ ChatApi: gt,
345
+ default: gt
347
346
  }, Symbol.toStringTag, { value: "Module" }));
348
- function Lt(x, t) {
349
- const n = new ht(x);
347
+ function Tt(w, t) {
348
+ const n = new gt(w);
350
349
  let v = null;
351
- const $ = x.user.username, ee = _(x.user.avatar || `https://api.dicebear.com/7.x/avataaars/svg?seed=${$}`), H = _({
350
+ const $ = w.user.username, O = g(w.user.avatar || `https://api.dicebear.com/7.x/avataaars/svg?seed=${$}`), H = g({
352
351
  username: $,
353
- nickname: x.user.nickname || "",
354
- email: x.user.email || "",
355
- phone: x.user.phone || "",
356
- bio: x.user.bio || ""
357
- }), Z = _(!1), X = _([]), ve = _([]), V = _([]), U = _(""), A = _(""), f = _(""), ce = _(null), Ae = _(!1), he = _(""), C = _([]), ge = _(!1), Ce = _([]), Ve = _(!1), xe = we(() => {
358
- let i = ve.value;
352
+ nickname: w.user.nickname || "",
353
+ email: w.user.email || "",
354
+ phone: w.user.phone || "",
355
+ bio: w.user.bio || ""
356
+ }), G = g(!1), V = g([]), ie = g([]), R = g([]), U = g(""), A = g(""), f = g(""), ve = g(null), Se = g(!1), ge = g(""), x = g([]), he = g(!1), we = g([]), ze = g(!1), Ce = ke(() => {
357
+ let c = ie.value;
359
358
  if (A.value) {
360
- const d = A.value.toLowerCase();
361
- i = i.filter(
362
- (g) => {
363
- var F;
364
- return (F = g.username) == null ? void 0 : F.toLowerCase().includes(d);
359
+ const r = A.value.toLowerCase();
360
+ c = c.filter(
361
+ (_) => {
362
+ var I;
363
+ return (I = _.username) == null ? void 0 : I.toLowerCase().includes(r);
365
364
  }
366
365
  );
367
366
  }
368
- return i.map((d) => ({
369
- id: d.username,
370
- name: d.username,
371
- avatar: d.avatar || ee.value,
372
- online: d.online,
373
- lastMsg: d.lastMsg || "暂无消息",
374
- lastTime: d.lastTime,
375
- unread: d.unReadNum || 0
367
+ return c.map((r) => ({
368
+ id: r.username,
369
+ name: r.username,
370
+ avatar: r.avatar || O.value,
371
+ online: r.online,
372
+ lastMsg: r.lastMsg || "暂无消息",
373
+ lastTime: r.lastTime,
374
+ unread: r.unReadNum || 0
376
375
  }));
377
- }), Se = we(() => {
378
- let i = X.value;
376
+ }), Ue = ke(() => {
377
+ let c = V.value;
379
378
  if (A.value) {
380
- const d = A.value.toLowerCase();
381
- i = i.filter(
382
- (g) => {
383
- var F;
384
- return (F = g.username) == null ? void 0 : F.toLowerCase().includes(d);
379
+ const r = A.value.toLowerCase();
380
+ c = c.filter(
381
+ (_) => {
382
+ var I;
383
+ return (I = _.username) == null ? void 0 : I.toLowerCase().includes(r);
385
384
  }
386
385
  );
387
386
  }
388
- return i.map((d) => ({
389
- id: d.username,
390
- name: d.username,
391
- avatar: d.avatar || ee.value,
392
- online: d.online,
393
- isChatting: d.isChatting
387
+ return c.map((r) => ({
388
+ id: r.username,
389
+ name: r.username,
390
+ avatar: r.avatar || O.value,
391
+ online: r.online,
392
+ isChatting: r.isChatting
394
393
  }));
395
- }), Fe = we(() => he.value ? C.value.filter(
396
- (i) => {
397
- var d;
398
- return (d = i.username) == null ? void 0 : d.toLowerCase().includes(he.value.toLowerCase());
399
- }
400
- ) : C.value), Re = we(() => xe.value.find((i) => i.id === U.value) || null), De = we(() => V.value.map((i) => {
401
- const d = i.type === "file" || i.fileUrl || i.fileName, g = i.fileName || i.msgContent;
394
+ }), Ve = ke(() => x.value), Me = ke(() => Ce.value.find((c) => c.id === U.value) || null), De = ke(() => R.value.map((c) => {
395
+ const r = c.type === "file" || c.fileUrl || c.fileName, _ = c.fileName || c.msgContent;
402
396
  return {
403
- text: i.msgContent,
404
- isSelf: i.sendUsername === $,
405
- time: i.createTime,
406
- sendUsername: i.sendUsername,
407
- type: d ? "file" : "text",
408
- fileType: w(g) ? "image" : z(g),
409
- fileUrl: i.fileUrl || "",
410
- fileName: g,
411
- fileSize: i.fileSize || 0
397
+ text: c.msgContent,
398
+ isSelf: c.sendUsername === $,
399
+ time: c.createTime,
400
+ sendUsername: c.sendUsername,
401
+ type: r ? "file" : "text",
402
+ fileType: C(_) ? "image" : z(_),
403
+ fileUrl: c.fileUrl || "",
404
+ fileName: _,
405
+ fileSize: c.fileSize || 0
412
406
  };
413
- })), We = (i) => ft(i).format("HH:mm"), Me = (i) => {
414
- if (!i) return "";
415
- const d = ft(), g = ft(i);
416
- return d.isSame(g, "day") ? g.format("HH:mm") : d.diff(g, "day") === 1 ? "昨天" : d.diff(g, "day") < 7 ? ["周日", "周一", "周二", "周三", "周四", "周五", "周六"][g.day()] : g.format("MM/DD");
417
- }, w = (i) => {
418
- if (!i) return !1;
419
- const d = ["jpg", "jpeg", "png", "gif", "bmp", "webp", "svg"], g = i.split(".").pop().toLowerCase();
420
- return d.includes(g);
421
- }, z = (i) => {
422
- if (!i) return "default";
423
- const d = i.split(".").pop().toLowerCase();
424
- return ["xls", "xlsx"].includes(d) ? "excel" : ["pdf"].includes(d) ? "pdf" : ["doc", "docx"].includes(d) ? "docx" : "default";
425
- }, Y = () => {
426
- Oe(() => {
427
- ce.value && (ce.value.scrollTop = ce.value.scrollHeight);
407
+ })), We = (c) => ft(c).format("HH:mm"), Ie = (c) => {
408
+ if (!c) return "";
409
+ const r = ft(), _ = ft(c);
410
+ return r.isSame(_, "day") ? _.format("HH:mm") : r.diff(_, "day") === 1 ? "昨天" : r.diff(_, "day") < 7 ? ["周日", "周一", "周二", "周三", "周四", "周五", "周六"][_.day()] : _.format("MM/DD");
411
+ }, C = (c) => {
412
+ if (!c) return !1;
413
+ const r = ["jpg", "jpeg", "png", "gif", "bmp", "webp", "svg"], _ = c.split(".").pop().toLowerCase();
414
+ return r.includes(_);
415
+ }, z = (c) => {
416
+ if (!c) return "default";
417
+ const r = c.split(".").pop().toLowerCase();
418
+ return ["xls", "xlsx"].includes(r) ? "excel" : ["pdf"].includes(r) ? "pdf" : ["doc", "docx"].includes(r) ? "docx" : "default";
419
+ }, q = () => {
420
+ Ke(() => {
421
+ ve.value && (ve.value.scrollTop = ve.value.scrollHeight);
428
422
  });
429
- }, I = async () => {
423
+ }, L = async () => {
430
424
  try {
431
- const d = (await n.getFriends($)).data || [];
432
- X.value = d, ve.value = d.filter((g) => g.isChatting === 1);
433
- for (const g of ve.value)
425
+ const r = (await n.getFriends($)).data || [];
426
+ V.value = r, ie.value = r.filter((_) => _.isChatting === 1);
427
+ for (const _ of ie.value)
434
428
  try {
435
- const _e = (await n.getHistory($, g.username)).data || [];
436
- g.unReadNum = _e.filter(
437
- (j) => j.isRead === 0 && j.sendUsername === g.username
429
+ const ae = (await n.getHistory($, _.username)).data || [];
430
+ _.unReadNum = ae.filter(
431
+ (B) => B.isRead === 0 && B.sendUsername === _.username
438
432
  ).length;
439
433
  } catch {
440
- g.unReadNum = 0;
434
+ _.unReadNum = 0;
441
435
  }
442
- } catch (i) {
443
- console.error("[VueChatKit] 获取好友列表失败", i);
436
+ } catch (c) {
437
+ console.error("[VueChatKit] 获取好友列表失败", c);
444
438
  }
445
- }, R = async (i) => {
439
+ }, E = async (c) => {
446
440
  try {
447
- const d = await n.getHistory($, i);
448
- V.value = d.data || [], Y();
449
- } catch (d) {
450
- console.error("[VueChatKit] 获取聊天历史失败", d);
441
+ const r = await n.getHistory($, c);
442
+ R.value = r.data || [], q();
443
+ } catch (r) {
444
+ console.error("[VueChatKit] 获取聊天历史失败", r);
451
445
  }
452
- }, M = async (i) => {
446
+ }, D = async (c) => {
453
447
  try {
454
- await n.setRead($, i), I();
455
- } catch (d) {
456
- console.error("[VueChatKit] 标记已读失败", d);
448
+ await n.setRead($, c), L();
449
+ } catch (r) {
450
+ console.error("[VueChatKit] 标记已读失败", r);
457
451
  }
458
- }, E = async (i) => {
459
- U.value = i.id, await R(i.id), await M(i.id), Y();
460
- }, N = async (i, d = 1) => {
452
+ }, X = async (c) => {
453
+ U.value = c.id, await E(c.id), await D(c.id), q();
454
+ }, J = async (c, r = 1) => {
461
455
  try {
462
- return await n.setChatStatus($, i, d), await I(), !0;
463
- } catch (g) {
464
- return console.error("[VueChatKit] 设置聊天状态失败", g), !1;
456
+ return await n.setChatStatus($, c, r), await L(), !0;
457
+ } catch (_) {
458
+ return console.error("[VueChatKit] 设置聊天状态失败", _), !1;
465
459
  }
466
- }, P = () => {
460
+ }, Q = () => {
467
461
  if (!f.value.trim() || !U.value || !v) return;
468
462
  if (v.send(U.value, f.value.trim(), "text")) {
469
- const d = {
463
+ const r = {
470
464
  msgContent: f.value.trim(),
471
465
  sendUsername: $,
472
466
  receiveUsername: U.value,
@@ -474,263 +468,252 @@ function Lt(x, t) {
474
468
  isRead: 0,
475
469
  type: "text"
476
470
  };
477
- V.value.push(d), f.value = "", Y(), setTimeout(() => {
478
- R(U.value), I();
471
+ R.value.push(r), f.value = "", q(), setTimeout(() => {
472
+ E(U.value), L();
479
473
  }, 300);
480
474
  }
481
- }, L = async (i) => {
475
+ }, W = async (c) => {
482
476
  if (!U.value || !v) return !1;
483
477
  try {
484
- const d = await n.uploadFile(i);
485
- if (d.code === 200 && d.data) {
486
- const { fileUrl: g, fileName: F } = d.data;
478
+ const r = await n.uploadFile(c);
479
+ if (r.code === 200 && r.data) {
480
+ const { fileUrl: _, fileName: I } = r.data;
487
481
  if (v.send(
488
482
  U.value,
489
- F,
483
+ I,
490
484
  "file",
491
- g,
492
- F,
493
- i.size
485
+ _,
486
+ I,
487
+ c.size
494
488
  )) {
495
- const j = {
496
- msgContent: F,
489
+ const B = {
490
+ msgContent: I,
497
491
  sendUsername: $,
498
492
  receiveUsername: U.value,
499
493
  createTime: /* @__PURE__ */ new Date(),
500
494
  isRead: 0,
501
495
  type: "file",
502
- fileUrl: g,
503
- fileName: F,
504
- fileSize: i.size
496
+ fileUrl: _,
497
+ fileName: I,
498
+ fileSize: c.size
505
499
  };
506
- return V.value.push(j), Y(), !0;
500
+ return R.value.push(B), q(), !0;
507
501
  }
508
502
  }
509
503
  return !1;
510
- } catch (d) {
511
- return console.error("[VueChatKit] 发送文件失败", d), !1;
504
+ } catch (r) {
505
+ return console.error("[VueChatKit] 发送文件失败", r), !1;
512
506
  }
513
- }, q = async (i, d) => {
507
+ }, N = async (c, r) => {
514
508
  if (!(!U.value || !v)) {
515
- if (d && d.trim() && v.send(U.value, d.trim(), "text")) {
516
- const F = {
517
- msgContent: d.trim(),
509
+ if (r && r.trim() && v.send(U.value, r.trim(), "text")) {
510
+ const I = {
511
+ msgContent: r.trim(),
518
512
  sendUsername: $,
519
513
  receiveUsername: U.value,
520
514
  createTime: /* @__PURE__ */ new Date(),
521
515
  isRead: 0,
522
516
  type: "text"
523
517
  };
524
- V.value.push(F);
518
+ R.value.push(I);
525
519
  }
526
- for (const g of i) {
527
- const F = g.file || g;
528
- await L(F);
520
+ for (const _ of c) {
521
+ const I = _.file || _;
522
+ await W(I);
529
523
  }
530
524
  setTimeout(() => {
531
- R(U.value), I();
525
+ E(U.value), L();
532
526
  }, 300);
533
527
  }
534
- }, te = (i) => {
528
+ }, te = (c) => {
535
529
  try {
536
530
  try {
537
- const g = JSON.parse(i);
538
- if (g.to || g.msg)
531
+ const _ = JSON.parse(c);
532
+ if (_.to || _.msg)
539
533
  return {
540
- to: g.to,
541
- content: g.msg,
542
- type: g.type || "text",
543
- fileUrl: g.fileUrl || "",
544
- fileName: g.fileName || "",
545
- fileSize: g.fileSize || 0
534
+ to: _.to,
535
+ content: _.msg,
536
+ type: _.type || "text",
537
+ fileUrl: _.fileUrl || "",
538
+ fileName: _.fileName || "",
539
+ fileSize: _.fileSize || 0
546
540
  };
547
541
  } catch {
548
542
  }
549
- const d = i.match(/^\[(.+?)\]:(.+)$/);
550
- if (d)
543
+ const r = c.match(/^\[(.+?)\]:(.+)$/);
544
+ if (r)
551
545
  return {
552
- username: d[1],
553
- content: d[2],
546
+ username: r[1],
547
+ content: r[2],
554
548
  type: "text"
555
549
  };
556
- } catch (d) {
557
- console.error("[VueChatKit] 解析消息失败", d);
550
+ } catch (r) {
551
+ console.error("[VueChatKit] 解析消息失败", r);
558
552
  }
559
553
  return null;
560
- }, se = (i) => {
561
- if (i.includes("【状态变更】")) {
562
- const g = /【状态变更】(.+?) 已(上线|下线)/, F = i.match(g);
563
- if (F) {
564
- const _e = F[1], j = F[2] === "上线", O = X.value.find((Ue) => Ue.username === _e);
565
- O && (O.online = j);
554
+ }, ne = (c) => {
555
+ if (c.includes("【状态变更】")) {
556
+ const _ = /【状态变更】(.+?) 已(上线|下线)/, I = c.match(_);
557
+ if (I) {
558
+ const ae = I[1], B = I[2] === "上线", pe = V.value.find((Ae) => Ae.username === ae);
559
+ pe && (pe.online = B);
566
560
  }
567
561
  return;
568
562
  }
569
- const d = te(i);
570
- if (d) {
571
- const g = {
572
- content: d.content,
573
- username: d.username || U.value,
574
- type: d.type || "text",
575
- fileUrl: d.fileUrl || "",
576
- fileName: d.fileName || "",
577
- fileSize: d.fileSize || 0,
563
+ const r = te(c);
564
+ if (r) {
565
+ const _ = {
566
+ content: r.content,
567
+ username: r.username || U.value,
568
+ type: r.type || "text",
569
+ fileUrl: r.fileUrl || "",
570
+ fileName: r.fileName || "",
571
+ fileSize: r.fileSize || 0,
578
572
  timestamp: /* @__PURE__ */ new Date()
579
573
  };
580
574
  if (U.value) {
581
575
  try {
582
- let F = {
583
- msgContent: d.content,
584
- sendUsername: g.username,
576
+ let I = {
577
+ msgContent: r.content,
578
+ sendUsername: _.username,
585
579
  receiveUsername: $,
586
580
  createTime: /* @__PURE__ */ new Date(),
587
581
  isRead: 0,
588
- type: d.type || "text",
589
- fileUrl: d.fileUrl || "",
590
- fileName: d.fileName || "",
591
- fileSize: d.fileSize || 0
582
+ type: r.type || "text",
583
+ fileUrl: r.fileUrl || "",
584
+ fileName: r.fileName || "",
585
+ fileSize: r.fileSize || 0
592
586
  };
593
- V.value.push(F), Y();
594
- } catch (F) {
595
- console.error("[VueChatKit] 添加临时消息失败", F);
587
+ R.value.push(I), q();
588
+ } catch (I) {
589
+ console.error("[VueChatKit] 添加临时消息失败", I);
596
590
  }
597
- R(U.value);
591
+ E(U.value);
598
592
  }
599
- I(), t && typeof t == "function" && t(g);
593
+ L(), t && typeof t == "function" && t(_);
600
594
  }
601
- }, de = () => {
602
- const i = `${x.api.websocketUrl}?userId=${$}`;
603
- v = new Dt($, {
604
- wsUrl: i,
605
- maxReconnectAttempts: x.websocket.maxReconnectAttempts,
606
- reconnectDelay: x.websocket.reconnectDelay
607
- }), v.on("message", se), v.connect();
608
- }, pe = () => {
595
+ }, le = () => {
596
+ const c = `${w.api.websocketUrl}?userId=${$}`;
597
+ v = new Wt($, {
598
+ wsUrl: c,
599
+ maxReconnectAttempts: w.websocket.maxReconnectAttempts,
600
+ reconnectDelay: w.websocket.reconnectDelay
601
+ }), v.on("message", ne), v.connect();
602
+ }, se = () => {
609
603
  v && (v.close(), v = null);
610
- }, B = async () => {
611
- Ae.value = !0, he.value = "", await ae();
612
- }, ae = async () => {
613
- ge.value = !0;
604
+ }, F = async () => {
605
+ Se.value = !0, ge.value = "", x.value = [];
606
+ }, T = async (c = "") => {
607
+ he.value = !0;
614
608
  try {
615
- const i = await n.getAvailableUsers($);
616
- C.value = (i == null ? void 0 : i.data) || [];
617
- } catch (i) {
618
- console.error("[VueChatKit] 获取可用用户失败", i);
609
+ let r;
610
+ c ? r = await n.searchUser(c) : r = await n.getAvailableUsers($), x.value = (r == null ? void 0 : r.data) || [];
611
+ } catch (r) {
612
+ console.error("[VueChatKit] 获取可用用户失败", r);
619
613
  } finally {
620
- ge.value = !1;
614
+ he.value = !1;
621
615
  }
622
- }, ne = async (i) => {
616
+ }, M = async (c) => {
623
617
  try {
624
- await n.addFriend($, i.username), await I(), Ae.value = !1;
625
- } catch (d) {
626
- console.error("[VueChatKit] 添加好友失败", d);
618
+ await n.addFriend($, c.username), await L(), Se.value = !1;
619
+ } catch (r) {
620
+ console.error("[VueChatKit] 添加好友失败", r);
627
621
  }
628
- }, D = async () => {
629
- Ve.value = !0;
622
+ }, Y = async () => {
623
+ ze.value = !0;
630
624
  try {
631
- const i = await n.getApplyList($);
632
- Ce.value = i.data || [];
633
- } catch (i) {
634
- console.error("[VueChatKit] 获取好友申请列表失败", i);
625
+ const c = await n.getApplyList($);
626
+ we.value = c.data || [];
627
+ } catch (c) {
628
+ console.error("[VueChatKit] 获取好友申请列表失败", c);
635
629
  } finally {
636
- Ve.value = !1;
637
- }
638
- }, W = async (i) => {
639
- try {
640
- await n.agreeFriend(i, $), await D(), await I();
641
- } catch (d) {
642
- console.error("[VueChatKit] 同意好友申请失败", d);
630
+ ze.value = !1;
643
631
  }
644
- }, ie = async () => {
632
+ }, oe = async (c) => {
645
633
  try {
646
- const i = await n.getUserAvatar($);
647
- i.code === 200 && i.data && (ee.value = i.data);
648
- } catch (i) {
649
- console.warn("[VueChatKit] 加载头像失败", i);
634
+ await n.agreeFriend(c, $), await Y(), await L();
635
+ } catch (r) {
636
+ console.error("[VueChatKit] 同意好友申请失败", r);
650
637
  }
651
- }, le = (i) => {
652
- ee.value = i;
653
- }, K = async () => {
654
- Z.value = !0;
638
+ }, P = async () => {
655
639
  try {
656
- const i = await n.getUserInfo($);
657
- i.code === 200 && i.data && (H.value = {
658
- ...H.value,
659
- ...i.data
660
- });
661
- } catch (i) {
662
- console.error("[VueChatKit] 获取用户信息失败", i);
663
- } finally {
664
- Z.value = !1;
640
+ const c = await n.getUserAvatar($);
641
+ c.code === 200 && c.data && (O.value = c.data);
642
+ } catch (c) {
643
+ console.warn("[VueChatKit] 加载头像失败", c);
665
644
  }
666
- }, oe = async (i) => {
645
+ }, re = (c) => {
646
+ O.value = c;
647
+ }, $e = async (c) => {
667
648
  try {
668
- return (await n.updateUserInfo($, i)).code === 200 ? (H.value = {
649
+ return (await n.updateUserInfo($, c)).code === 200 ? (H.value = {
669
650
  ...H.value,
670
- ...i
651
+ ...c
671
652
  }, !0) : !1;
672
- } catch (d) {
673
- return console.error("[VueChatKit] 更新用户信息失败", d), !1;
653
+ } catch (r) {
654
+ return console.error("[VueChatKit] 更新用户信息失败", r), !1;
674
655
  }
675
- }, ze = () => {
676
- U.value = "", V.value = [], f.value = "", A.value = "";
656
+ }, _e = () => {
657
+ U.value = "", R.value = [], f.value = "", A.value = "";
677
658
  };
678
- return ie(), {
659
+ return P(), _t(ge, async (c) => {
660
+ await T(c);
661
+ }), {
679
662
  // 状态
680
663
  myUsername: $,
681
- myAvatar: ee,
664
+ myAvatar: O,
682
665
  userInfo: H,
683
- loadingUserInfo: Z,
684
- friendList: X,
685
- chatList: ve,
686
- filteredFriendList: Se,
687
- chatMsgList: V,
666
+ loadingUserInfo: G,
667
+ friendList: V,
668
+ chatList: ie,
669
+ filteredFriendList: Ue,
670
+ chatMsgList: R,
688
671
  currentSelectName: U,
689
672
  searchText: A,
690
673
  inputText: f,
691
- messagesContainer: ce,
692
- filteredUsers: xe,
693
- filteredAvailableUsers: Fe,
694
- currentUser: Re,
674
+ messagesContainer: ve,
675
+ filteredUsers: Ce,
676
+ filteredAvailableUsers: Ve,
677
+ currentUser: Me,
695
678
  currentMessages: De,
696
- addFriendDialogVisible: Ae,
697
- addFriendSearchText: he,
698
- availableUsers: C,
699
- loadingAvailableUsers: ge,
700
- friendApplyList: Ce,
701
- loadingFriendApply: Ve,
679
+ addFriendDialogVisible: Se,
680
+ addFriendSearchText: ge,
681
+ availableUsers: x,
682
+ loadingAvailableUsers: he,
683
+ friendApplyList: we,
684
+ loadingFriendApply: ze,
702
685
  // 方法
703
686
  formatTime: We,
704
- formatLastTime: Me,
705
- scrollToBottom: Y,
706
- getFriendList: I,
707
- getChatHistory: R,
708
- setFriendToChatStatus: N,
709
- selectUser: E,
710
- sendMessage: P,
711
- sendFile: L,
712
- sendFilesAndText: q,
713
- initWebSocket: de,
714
- closeWebSocket: pe,
715
- reset: ze,
716
- openAddFriendDialog: B,
717
- addFriend: ne,
718
- loadFriendApplyList: D,
719
- agreeFriend: W,
720
- updateMyAvatar: le,
721
- getUserInfo: K,
722
- updateUserInfo: oe
687
+ formatLastTime: Ie,
688
+ scrollToBottom: q,
689
+ getFriendList: L,
690
+ getChatHistory: E,
691
+ setFriendToChatStatus: J,
692
+ selectUser: X,
693
+ sendMessage: Q,
694
+ sendFile: W,
695
+ sendFilesAndText: N,
696
+ initWebSocket: le,
697
+ closeWebSocket: se,
698
+ reset: _e,
699
+ openAddFriendDialog: F,
700
+ loadAvailableUsers: T,
701
+ addFriend: M,
702
+ loadFriendApplyList: Y,
703
+ agreeFriend: oe,
704
+ updateMyAvatar: re,
705
+ updateUserInfo: $e
723
706
  };
724
707
  }
725
- const gt = (x, t) => {
726
- const n = x.__vccOpts || x;
708
+ const Ze = (w, t) => {
709
+ const n = w.__vccOpts || w;
727
710
  for (const [v, $] of t)
728
711
  n[v] = $;
729
712
  return n;
730
713
  }, Ht = { class: "avatar-crop-container" }, Xt = {
731
714
  key: 0,
732
715
  class: "crop-wrapper"
733
- }, Yt = ["src"], qt = ["onMousedown", "onTouchstart"], Bt = { class: "preview-wrapper" }, Kt = ["width", "height"], Nt = { class: "dialog-footer" }, Pt = {
716
+ }, Yt = ["src"], qt = ["onMousedown", "onTouchstart"], Bt = { class: "preview-wrapper" }, Nt = ["width", "height"], Pt = { class: "dialog-footer" }, Kt = {
734
717
  __name: "AvatarCrop",
735
718
  props: {
736
719
  modelValue: Boolean,
@@ -746,198 +729,198 @@ const gt = (x, t) => {
746
729
  minSize: { type: Number, default: 50 }
747
730
  },
748
731
  emits: ["update:modelValue", "confirm", "cancel", "closed"],
749
- setup(x, { expose: t, emit: n }) {
750
- const v = x, $ = n, ee = we({
732
+ setup(w, { expose: t, emit: n }) {
733
+ const v = w, $ = n, O = ke({
751
734
  get: () => v.modelValue,
752
- set: (w) => $("update:modelValue", w)
753
- }), H = we({
735
+ set: (C) => $("update:modelValue", C)
736
+ }), H = ke({
754
737
  get: () => v.src,
755
- set: (w) => {
738
+ set: (C) => {
756
739
  }
757
- }), Z = ["nw", "n", "ne", "e", "se", "s", "sw", "w"], X = _(!1), ve = _(null), V = _(null), U = _(null), A = _({
740
+ }), G = ["nw", "n", "ne", "e", "se", "s", "sw", "w"], V = g(!1), ie = g(null), R = g(null), U = g(null), A = g({
758
741
  naturalWidth: 0,
759
742
  naturalHeight: 0,
760
743
  displayWidth: 0,
761
744
  displayHeight: 0,
762
745
  offsetX: 0,
763
746
  offsetY: 0
764
- }), f = _({
747
+ }), f = g({
765
748
  x: 0,
766
749
  y: 0,
767
750
  size: 150,
768
751
  minSize: v.minSize
769
- }), ce = we(() => ({
752
+ }), ve = ke(() => ({
770
753
  width: `${A.value.displayWidth}px`,
771
754
  height: `${A.value.displayHeight}px`,
772
755
  maxWidth: "none",
773
756
  maxHeight: "none",
774
757
  display: "block"
775
- })), Ae = we(() => ({
758
+ })), Se = ke(() => ({
776
759
  left: `${f.value.x}px`,
777
760
  top: `${f.value.y}px`,
778
761
  width: `${f.value.size}px`,
779
762
  height: `${f.value.size / v.aspectRatio}px`
780
763
  }));
781
- let he = null, C = null;
782
- const ge = () => {
783
- Oe(() => {
784
- const w = V.value, z = ve.value;
785
- if (!w || !z) return;
786
- const Y = z.clientWidth, I = z.clientHeight, R = w.naturalWidth / w.naturalHeight, M = Y / I;
787
- let E, N, P, L;
788
- R > M ? (E = Y, N = Y / R, P = 0, L = (I - N) / 2) : (N = I, E = I * R, P = (Y - E) / 2, L = 0), A.value = {
789
- naturalWidth: w.naturalWidth,
790
- naturalHeight: w.naturalHeight,
791
- displayWidth: E,
792
- displayHeight: N,
793
- offsetX: P,
794
- offsetY: L
764
+ let ge = null, x = null;
765
+ const he = () => {
766
+ Ke(() => {
767
+ const C = R.value, z = ie.value;
768
+ if (!C || !z) return;
769
+ const q = z.clientWidth, L = z.clientHeight, E = C.naturalWidth / C.naturalHeight, D = q / L;
770
+ let X, J, Q, W;
771
+ E > D ? (X = q, J = q / E, Q = 0, W = (L - J) / 2) : (J = L, X = L * E, Q = (q - X) / 2, W = 0), A.value = {
772
+ naturalWidth: C.naturalWidth,
773
+ naturalHeight: C.naturalHeight,
774
+ displayWidth: X,
775
+ displayHeight: J,
776
+ offsetX: Q,
777
+ offsetY: W
795
778
  };
796
- const q = Math.min(E, N) * 0.6;
797
- f.value.size = q, f.value.x = P + (E - q) / 2, f.value.y = L + (N - q / v.aspectRatio) / 2, Ce();
779
+ const N = Math.min(X, J) * 0.6;
780
+ f.value.size = N, f.value.x = Q + (X - N) / 2, f.value.y = W + (J - N / v.aspectRatio) / 2, we();
798
781
  });
799
- }, Ce = () => {
800
- const w = U.value, z = V.value;
801
- if (!w || !z) return;
802
- const Y = w.getContext("2d"), { naturalWidth: I, naturalHeight: R, displayWidth: M, displayHeight: E, offsetX: N, offsetY: P } = A.value, L = I / M, q = R / E, te = (f.value.x - N) * L, se = (f.value.y - P) * q, de = f.value.size * L, pe = f.value.size / v.aspectRatio * q;
803
- Y.clearRect(0, 0, w.width, w.height), Y.drawImage(z, te, se, de, pe, 0, 0, w.width, w.height);
804
- }, Ve = (w) => {
805
- w.preventDefault();
806
- const z = w.clientX || w.touches[0].clientX, Y = w.clientY || w.touches[0].clientY;
807
- he = {
782
+ }, we = () => {
783
+ const C = U.value, z = R.value;
784
+ if (!C || !z) return;
785
+ const q = C.getContext("2d"), { naturalWidth: L, naturalHeight: E, displayWidth: D, displayHeight: X, offsetX: J, offsetY: Q } = A.value, W = L / D, N = E / X, te = (f.value.x - J) * W, ne = (f.value.y - Q) * N, le = f.value.size * W, se = f.value.size / v.aspectRatio * N;
786
+ q.clearRect(0, 0, C.width, C.height), q.drawImage(z, te, ne, le, se, 0, 0, C.width, C.height);
787
+ }, ze = (C) => {
788
+ C.preventDefault();
789
+ const z = C.clientX || C.touches[0].clientX, q = C.clientY || C.touches[0].clientY;
790
+ ge = {
808
791
  startX: z,
809
- startY: Y,
792
+ startY: q,
810
793
  boxX: f.value.x,
811
794
  boxY: f.value.y
812
795
  };
813
- const I = (M) => {
814
- const E = M.clientX || M.touches[0].clientX, N = M.clientY || M.touches[0].clientY, P = E - he.startX, L = N - he.startY, { offsetX: q, offsetY: te, displayWidth: se, displayHeight: de } = A.value, pe = f.value.size / v.aspectRatio, B = Math.max(q, Math.min(q + se - f.value.size, he.boxX + P)), ae = Math.max(te, Math.min(te + de - pe, he.boxY + L));
815
- f.value.x = B, f.value.y = ae, Ce();
816
- }, R = () => {
817
- he = null, document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", R), document.removeEventListener("touchmove", I), document.removeEventListener("touchend", R);
796
+ const L = (D) => {
797
+ const X = D.clientX || D.touches[0].clientX, J = D.clientY || D.touches[0].clientY, Q = X - ge.startX, W = J - ge.startY, { offsetX: N, offsetY: te, displayWidth: ne, displayHeight: le } = A.value, se = f.value.size / v.aspectRatio, F = Math.max(N, Math.min(N + ne - f.value.size, ge.boxX + Q)), T = Math.max(te, Math.min(te + le - se, ge.boxY + W));
798
+ f.value.x = F, f.value.y = T, we();
799
+ }, E = () => {
800
+ ge = null, document.removeEventListener("mousemove", L), document.removeEventListener("mouseup", E), document.removeEventListener("touchmove", L), document.removeEventListener("touchend", E);
818
801
  };
819
- document.addEventListener("mousemove", I), document.addEventListener("mouseup", R), document.addEventListener("touchmove", I, { passive: !1 }), document.addEventListener("touchend", R);
820
- }, xe = (w, z) => {
802
+ document.addEventListener("mousemove", L), document.addEventListener("mouseup", E), document.addEventListener("touchmove", L, { passive: !1 }), document.addEventListener("touchend", E);
803
+ }, Ce = (C, z) => {
821
804
  z.preventDefault();
822
- const Y = z.clientX || z.touches[0].clientX, I = z.clientY || z.touches[0].clientY;
823
- C = {
824
- handle: w,
825
- startX: Y,
826
- startY: I,
805
+ const q = z.clientX || z.touches[0].clientX, L = z.clientY || z.touches[0].clientY;
806
+ x = {
807
+ handle: C,
808
+ startX: q,
809
+ startY: L,
827
810
  boxX: f.value.x,
828
811
  boxY: f.value.y,
829
812
  boxSize: f.value.size
830
813
  };
831
- const R = (E) => {
832
- const N = E.clientX || E.touches[0].clientX, P = E.clientY || E.touches[0].clientY, L = N - C.startX, q = P - C.startY, { offsetX: te, offsetY: se, displayWidth: de, displayHeight: pe } = A.value;
833
- let B = C.boxSize, ae = C.boxX, ne = C.boxY;
834
- const D = C.boxSize / v.aspectRatio;
835
- switch (w) {
814
+ const E = (X) => {
815
+ const J = X.clientX || X.touches[0].clientX, Q = X.clientY || X.touches[0].clientY, W = J - x.startX, N = Q - x.startY, { offsetX: te, offsetY: ne, displayWidth: le, displayHeight: se } = A.value;
816
+ let F = x.boxSize, T = x.boxX, M = x.boxY;
817
+ const Y = x.boxSize / v.aspectRatio;
818
+ switch (C) {
836
819
  case "se":
837
- B = Math.max(f.value.minSize, Math.min(de - (C.boxX - te), pe - (C.boxY - se), C.boxSize + Math.max(L, q)));
820
+ F = Math.max(f.value.minSize, Math.min(le - (x.boxX - te), se - (x.boxY - ne), x.boxSize + Math.max(W, N)));
838
821
  break;
839
822
  case "nw":
840
- B = Math.max(f.value.minSize, Math.min(C.boxX - te + C.boxSize, C.boxY - se + D, C.boxSize - Math.max(L, q))), ae = C.boxX + (C.boxSize - B), ne = C.boxY + (D - B / v.aspectRatio);
823
+ F = Math.max(f.value.minSize, Math.min(x.boxX - te + x.boxSize, x.boxY - ne + Y, x.boxSize - Math.max(W, N))), T = x.boxX + (x.boxSize - F), M = x.boxY + (Y - F / v.aspectRatio);
841
824
  break;
842
825
  case "ne":
843
- B = Math.max(f.value.minSize, Math.min(te + de - C.boxX, C.boxY - se + D, C.boxSize + Math.max(L, -q))), ne = C.boxY + (D - B / v.aspectRatio);
826
+ F = Math.max(f.value.minSize, Math.min(te + le - x.boxX, x.boxY - ne + Y, x.boxSize + Math.max(W, -N))), M = x.boxY + (Y - F / v.aspectRatio);
844
827
  break;
845
828
  case "sw":
846
- B = Math.max(f.value.minSize, Math.min(C.boxX - te + C.boxSize, se + pe - C.boxY, C.boxSize + Math.max(-L, q))), ae = C.boxX + (C.boxSize - B);
829
+ F = Math.max(f.value.minSize, Math.min(x.boxX - te + x.boxSize, ne + se - x.boxY, x.boxSize + Math.max(-W, N))), T = x.boxX + (x.boxSize - F);
847
830
  break;
848
831
  case "n":
849
- B = Math.max(f.value.minSize, Math.min(C.boxY - se + D, C.boxSize - q)), ne = C.boxY + (D - B / v.aspectRatio);
832
+ F = Math.max(f.value.minSize, Math.min(x.boxY - ne + Y, x.boxSize - N)), M = x.boxY + (Y - F / v.aspectRatio);
850
833
  break;
851
834
  case "s":
852
- B = Math.max(f.value.minSize, Math.min(se + pe - C.boxY, C.boxSize + q));
835
+ F = Math.max(f.value.minSize, Math.min(ne + se - x.boxY, x.boxSize + N));
853
836
  break;
854
837
  case "w":
855
- B = Math.max(f.value.minSize, Math.min(C.boxX - te + C.boxSize, C.boxSize - L)), ae = C.boxX + (C.boxSize - B);
838
+ F = Math.max(f.value.minSize, Math.min(x.boxX - te + x.boxSize, x.boxSize - W)), T = x.boxX + (x.boxSize - F);
856
839
  break;
857
840
  case "e":
858
- B = Math.max(f.value.minSize, Math.min(te + de - C.boxX, C.boxSize + L));
841
+ F = Math.max(f.value.minSize, Math.min(te + le - x.boxX, x.boxSize + W));
859
842
  break;
860
843
  }
861
- f.value.size = B, f.value.x = ae, f.value.y = ne, Ce();
862
- }, M = () => {
863
- C = null, document.removeEventListener("mousemove", R), document.removeEventListener("mouseup", M), document.removeEventListener("touchmove", R), document.removeEventListener("touchend", M);
844
+ f.value.size = F, f.value.x = T, f.value.y = M, we();
845
+ }, D = () => {
846
+ x = null, document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", D), document.removeEventListener("touchmove", E), document.removeEventListener("touchend", D);
864
847
  };
865
- document.addEventListener("mousemove", R), document.addEventListener("mouseup", M), document.addEventListener("touchmove", R, { passive: !1 }), document.addEventListener("touchend", M);
866
- }, Se = () => {
867
- const w = document.createElement("canvas"), z = V.value;
848
+ document.addEventListener("mousemove", E), document.addEventListener("mouseup", D), document.addEventListener("touchmove", E, { passive: !1 }), document.addEventListener("touchend", D);
849
+ }, Ue = () => {
850
+ const C = document.createElement("canvas"), z = R.value;
868
851
  if (!z) return null;
869
- const { naturalWidth: Y, naturalHeight: I, displayWidth: R, displayHeight: M, offsetX: E, offsetY: N } = A.value, P = Y / R, L = I / M, q = (f.value.x - E) * P, te = (f.value.y - N) * L, se = f.value.size * P, de = f.value.size / v.aspectRatio * L;
870
- return w.width = v.outputSize, w.height = v.outputSize / v.aspectRatio, w.getContext("2d").drawImage(z, q, te, se, de, 0, 0, w.width, w.height), new Promise((B) => {
871
- w.toBlob(
872
- (ae) => {
873
- B(new File([ae], "avatar.jpg", { type: v.outputType }));
852
+ const { naturalWidth: q, naturalHeight: L, displayWidth: E, displayHeight: D, offsetX: X, offsetY: J } = A.value, Q = q / E, W = L / D, N = (f.value.x - X) * Q, te = (f.value.y - J) * W, ne = f.value.size * Q, le = f.value.size / v.aspectRatio * W;
853
+ return C.width = v.outputSize, C.height = v.outputSize / v.aspectRatio, C.getContext("2d").drawImage(z, N, te, ne, le, 0, 0, C.width, C.height), new Promise((F) => {
854
+ C.toBlob(
855
+ (T) => {
856
+ F(new File([T], "avatar.jpg", { type: v.outputType }));
874
857
  },
875
858
  v.outputType,
876
859
  v.outputQuality
877
860
  );
878
861
  });
879
- }, Fe = () => {
880
- const w = document.createElement("canvas"), z = V.value;
862
+ }, Ve = () => {
863
+ const C = document.createElement("canvas"), z = R.value;
881
864
  if (!z) return null;
882
- const { naturalWidth: Y, naturalHeight: I, displayWidth: R, displayHeight: M, offsetX: E, offsetY: N } = A.value, P = Y / R, L = I / M, q = (f.value.x - E) * P, te = (f.value.y - N) * L, se = f.value.size * P, de = f.value.size / v.aspectRatio * L;
883
- return w.width = v.outputSize, w.height = v.outputSize / v.aspectRatio, w.getContext("2d").drawImage(z, q, te, se, de, 0, 0, w.width, w.height), w.toDataURL(v.outputType, v.outputQuality);
884
- }, Re = async () => {
865
+ const { naturalWidth: q, naturalHeight: L, displayWidth: E, displayHeight: D, offsetX: X, offsetY: J } = A.value, Q = q / E, W = L / D, N = (f.value.x - X) * Q, te = (f.value.y - J) * W, ne = f.value.size * Q, le = f.value.size / v.aspectRatio * W;
866
+ return C.width = v.outputSize, C.height = v.outputSize / v.aspectRatio, C.getContext("2d").drawImage(z, N, te, ne, le, 0, 0, C.width, C.height), C.toDataURL(v.outputType, v.outputQuality);
867
+ }, Me = async () => {
885
868
  if (H.value) {
886
- X.value = !0;
869
+ V.value = !0;
887
870
  try {
888
- const w = await Se(), z = Fe();
889
- w && $("confirm", { file: w, dataUrl: z });
890
- } catch (w) {
891
- console.error(w), Q.error("生成图片失败");
871
+ const C = await Ue(), z = Ve();
872
+ C && $("confirm", { file: C, dataUrl: z });
873
+ } catch (C) {
874
+ console.error(C), ee.error("生成图片失败");
892
875
  } finally {
893
- X.value = !1;
876
+ V.value = !1;
894
877
  }
895
878
  }
896
879
  }, De = () => {
897
- $("cancel"), ee.value = !1;
880
+ $("cancel"), O.value = !1;
898
881
  }, We = () => {
899
- Me(), $("closed");
900
- }, Me = () => {
882
+ Ie(), $("closed");
883
+ }, Ie = () => {
901
884
  f.value = { x: 0, y: 0, size: 150, minSize: v.minSize };
902
885
  };
903
- return Et(
886
+ return _t(
904
887
  () => v.src,
905
- (w) => {
906
- w && Oe(() => {
907
- V.value && V.value.complete && ge();
888
+ (C) => {
889
+ C && Ke(() => {
890
+ R.value && R.value.complete && he();
908
891
  });
909
892
  }
910
893
  ), t({
911
- getCroppedImage: Se,
912
- getCroppedImageDataUrl: Fe,
913
- reset: Me
914
- }), (w, z) => {
915
- const Y = be("el-empty"), I = be("el-button"), R = be("el-dialog");
916
- return a(), G(R, {
917
- modelValue: ee.value,
918
- "onUpdate:modelValue": z[0] || (z[0] = (M) => ee.value = M),
894
+ getCroppedImage: Ue,
895
+ getCroppedImageDataUrl: Ve,
896
+ reset: Ie
897
+ }), (C, z) => {
898
+ const q = ye("el-empty"), L = ye("el-button"), E = ye("el-dialog");
899
+ return a(), Z(E, {
900
+ modelValue: O.value,
901
+ "onUpdate:modelValue": z[0] || (z[0] = (D) => O.value = D),
919
902
  title: "调整头像",
920
- width: x.dialogWidth,
903
+ width: w.dialogWidth,
921
904
  "close-on-click-modal": !1,
922
- "append-to-body": x.appendToBody,
905
+ "append-to-body": w.appendToBody,
923
906
  onClosed: We
924
907
  }, {
925
908
  footer: k(() => [
926
- e("div", Nt, [
927
- m(I, { onClick: De }, {
909
+ e("div", Pt, [
910
+ m(L, { onClick: De }, {
928
911
  default: k(() => [...z[2] || (z[2] = [
929
- ue("取消", -1)
912
+ me("取消", -1)
930
913
  ])]),
931
914
  _: 1
932
915
  }),
933
- m(I, {
916
+ m(L, {
934
917
  type: "primary",
935
- loading: X.value,
918
+ loading: V.value,
936
919
  disabled: !H.value,
937
- onClick: Re
920
+ onClick: Me
938
921
  }, {
939
922
  default: k(() => [...z[3] || (z[3] = [
940
- ue(" 确认 ", -1)
923
+ me(" 确认 ", -1)
941
924
  ])]),
942
925
  _: 1
943
926
  }, 8, ["loading", "disabled"])
@@ -948,28 +931,28 @@ const gt = (x, t) => {
948
931
  H.value ? (a(), p("div", Xt, [
949
932
  e("div", {
950
933
  ref_key: "cropAreaRef",
951
- ref: ve,
934
+ ref: ie,
952
935
  class: "crop-area",
953
- style: Xe({ height: x.cropAreaHeight })
936
+ style: He({ height: w.cropAreaHeight })
954
937
  }, [
955
938
  e("img", {
956
939
  src: H.value,
957
940
  ref_key: "imageRef",
958
- ref: V,
959
- onLoad: ge,
960
- style: Xe(ce.value)
941
+ ref: R,
942
+ onLoad: he,
943
+ style: He(ve.value)
961
944
  }, null, 44, Yt),
962
945
  e("div", {
963
946
  class: "crop-box",
964
- style: Xe(Ae.value),
965
- onMousedown: Ve,
966
- onTouchstart: Ve
947
+ style: He(Se.value),
948
+ onMousedown: ze,
949
+ onTouchstart: ze
967
950
  }, [
968
- (a(), p(me, null, fe(Z, (M) => e("div", {
969
- key: M,
970
- class: J(["crop-handle", M]),
971
- onMousedown: Be((E) => xe(M, E), ["stop"]),
972
- onTouchstart: Be((E) => xe(M, E), ["stop"])
951
+ (a(), p(de, null, ue(G, (D) => e("div", {
952
+ key: D,
953
+ class: K(["crop-handle", D]),
954
+ onMousedown: Fe((X) => Ce(D, X), ["stop"]),
955
+ onTouchstart: Fe((X) => Ce(D, X), ["stop"])
973
956
  }, null, 42, qt)), 64))
974
957
  ], 36)
975
958
  ], 4),
@@ -977,18 +960,18 @@ const gt = (x, t) => {
977
960
  z[1] || (z[1] = e("div", { class: "preview-label" }, "预览", -1)),
978
961
  e("div", {
979
962
  class: "preview-box",
980
- style: Xe({ width: x.previewSize + "px", height: x.previewSize + "px" })
963
+ style: He({ width: w.previewSize + "px", height: w.previewSize + "px" })
981
964
  }, [
982
965
  e("canvas", {
983
966
  ref_key: "previewCanvasRef",
984
967
  ref: U,
985
- width: x.previewSize,
986
- height: x.previewSize,
968
+ width: w.previewSize,
969
+ height: w.previewSize,
987
970
  class: "preview-canvas"
988
- }, null, 8, Kt)
971
+ }, null, 8, Nt)
989
972
  ], 4)
990
973
  ])
991
- ])) : (a(), G(Y, {
974
+ ])) : (a(), Z(q, {
992
975
  key: 1,
993
976
  description: "请上传图片"
994
977
  }))
@@ -998,422 +981,830 @@ const gt = (x, t) => {
998
981
  }, 8, ["modelValue", "width", "append-to-body"]);
999
982
  };
1000
983
  }
1001
- }, yt = /* @__PURE__ */ gt(Pt, [["__scopeId", "data-v-594eeaf3"]]), jt = { class: "chat-panel" }, Ot = { class: "chat-sidebar" }, Gt = ["src"], Jt = ["onClick"], Qt = {
984
+ }, yt = /* @__PURE__ */ Ze(Kt, [["__scopeId", "data-v-594eeaf3"]]), Ot = { class: "emoji-header" }, Gt = ["onClick"], Jt = { class: "emoji-body" }, Qt = ["onClick"], Zt = {
985
+ __name: "EmojiPicker",
986
+ props: {
987
+ visible: {
988
+ type: Boolean,
989
+ default: !1
990
+ }
991
+ },
992
+ emits: ["select", "close"],
993
+ setup(w, { emit: t }) {
994
+ const n = t, v = g(0), $ = [
995
+ {
996
+ id: "emoticons",
997
+ icon: "😀",
998
+ name: "表情",
999
+ emojis: [
1000
+ "😀",
1001
+ "😃",
1002
+ "😄",
1003
+ "😁",
1004
+ "😆",
1005
+ "😅",
1006
+ "🤣",
1007
+ "😂",
1008
+ "🙂",
1009
+ "🙃",
1010
+ "😉",
1011
+ "😊",
1012
+ "😇",
1013
+ "🥰",
1014
+ "😍",
1015
+ "🤩",
1016
+ "😘",
1017
+ "😗",
1018
+ "😚",
1019
+ "😋",
1020
+ "😛",
1021
+ "😜",
1022
+ "🤪",
1023
+ "😝",
1024
+ "🤑",
1025
+ "🤗",
1026
+ "🤭",
1027
+ "🤫",
1028
+ "🤔",
1029
+ "🤐",
1030
+ "🤨",
1031
+ "😐",
1032
+ "😑",
1033
+ "😶",
1034
+ "😏",
1035
+ "😒",
1036
+ "🙄",
1037
+ "😬",
1038
+ "🤥",
1039
+ "😌",
1040
+ "😔",
1041
+ "😪",
1042
+ "🤤",
1043
+ "😴",
1044
+ "😷",
1045
+ "🤒",
1046
+ "🤕",
1047
+ "🤢",
1048
+ "🤮",
1049
+ "🤧",
1050
+ "🥵",
1051
+ "🥶",
1052
+ "🥴",
1053
+ "😵",
1054
+ "🤯",
1055
+ "🤠",
1056
+ "🥳",
1057
+ "😎",
1058
+ "🤓",
1059
+ "🧐",
1060
+ "😕",
1061
+ "😟",
1062
+ "🙁",
1063
+ "☹️",
1064
+ "😮",
1065
+ "😯",
1066
+ "😲",
1067
+ "😳",
1068
+ "🥺",
1069
+ "😦",
1070
+ "😧",
1071
+ "😨",
1072
+ "😰",
1073
+ "😥",
1074
+ "😢",
1075
+ "😭",
1076
+ "😱",
1077
+ "😖",
1078
+ "😣",
1079
+ "😞"
1080
+ ]
1081
+ },
1082
+ {
1083
+ id: "gestures",
1084
+ icon: "👋",
1085
+ name: "手势",
1086
+ emojis: [
1087
+ "👋",
1088
+ "🤚",
1089
+ "🖐️",
1090
+ "✋",
1091
+ "🖖",
1092
+ "👌",
1093
+ "🤌",
1094
+ "🤏",
1095
+ "✌️",
1096
+ "🤞",
1097
+ "🤟",
1098
+ "🤘",
1099
+ "🤙",
1100
+ "👈",
1101
+ "👉",
1102
+ "👆",
1103
+ "🖕",
1104
+ "👇",
1105
+ "☝️",
1106
+ "👍",
1107
+ "👎",
1108
+ "✊",
1109
+ "👊",
1110
+ "🤛",
1111
+ "🤜",
1112
+ "👏",
1113
+ "🙌",
1114
+ "👐",
1115
+ "🤲",
1116
+ "🤝",
1117
+ "🙏",
1118
+ "🤚🏻",
1119
+ "🖐🏻",
1120
+ "✋🏻",
1121
+ "🖖🏻",
1122
+ "👌🏻",
1123
+ "🤌🏻",
1124
+ "🤏🏻",
1125
+ "✌🏻",
1126
+ "🤞🏻",
1127
+ "🤟🏻",
1128
+ "🤘🏻",
1129
+ "🤙🏻",
1130
+ "👈🏻",
1131
+ "👉🏻",
1132
+ "👆🏻",
1133
+ "🖕🏻",
1134
+ "👇🏻",
1135
+ "☝🏻",
1136
+ "👍🏻"
1137
+ ]
1138
+ },
1139
+ {
1140
+ id: "animals",
1141
+ icon: "🐶",
1142
+ name: "动物",
1143
+ emojis: [
1144
+ "🐶",
1145
+ "🐱",
1146
+ "🐭",
1147
+ "🐹",
1148
+ "🐰",
1149
+ "🦊",
1150
+ "🐻",
1151
+ "🐼",
1152
+ "🐨",
1153
+ "🐯",
1154
+ "🦁",
1155
+ "🐮",
1156
+ "🐷",
1157
+ "🐸",
1158
+ "🐵",
1159
+ "🙈",
1160
+ "🙉",
1161
+ "🙊",
1162
+ "🐒",
1163
+ "🐔",
1164
+ "🐧",
1165
+ "🐦",
1166
+ "🐤",
1167
+ "🐣",
1168
+ "🐥",
1169
+ "🦆",
1170
+ "🦅",
1171
+ "🦉",
1172
+ "🦇",
1173
+ "🐺",
1174
+ "🐗",
1175
+ "🐴",
1176
+ "🦄",
1177
+ "🐝",
1178
+ "🐛",
1179
+ "🦋",
1180
+ "🐌",
1181
+ "🐞",
1182
+ "🐜",
1183
+ "🦟",
1184
+ "🦗",
1185
+ "🕷️",
1186
+ "🦂",
1187
+ "🐢",
1188
+ "🐍",
1189
+ "🦎",
1190
+ "🦖",
1191
+ "🦕",
1192
+ "🐙",
1193
+ "🦑"
1194
+ ]
1195
+ },
1196
+ {
1197
+ id: "food",
1198
+ icon: "🍎",
1199
+ name: "食物",
1200
+ emojis: [
1201
+ "🍎",
1202
+ "🍊",
1203
+ "🍋",
1204
+ "🍌",
1205
+ "🍉",
1206
+ "🍇",
1207
+ "🍓",
1208
+ "🍈",
1209
+ "🍒",
1210
+ "🍑",
1211
+ "🥭",
1212
+ "🍍",
1213
+ "🥥",
1214
+ "🥝",
1215
+ "🍅",
1216
+ "🍆",
1217
+ "🥑",
1218
+ "🥦",
1219
+ "🥬",
1220
+ "🥒",
1221
+ "🌶️",
1222
+ "🌽",
1223
+ "🥕",
1224
+ "🧄",
1225
+ "🧅",
1226
+ "🥔",
1227
+ "🍠",
1228
+ "🥐",
1229
+ "🥯",
1230
+ "🍞",
1231
+ "🥖",
1232
+ "🥨",
1233
+ "🧀",
1234
+ "🥚",
1235
+ "🍳",
1236
+ "🧈",
1237
+ "🥞",
1238
+ "🧇",
1239
+ "🥓",
1240
+ "🥩",
1241
+ "🍗",
1242
+ "🍖",
1243
+ "🌭",
1244
+ "🍔",
1245
+ "🍟",
1246
+ "🍕",
1247
+ "🥪",
1248
+ "🥙",
1249
+ "🧆",
1250
+ "🌮"
1251
+ ]
1252
+ },
1253
+ {
1254
+ id: "objects",
1255
+ icon: "⌚",
1256
+ name: "物品",
1257
+ emojis: [
1258
+ "⌚",
1259
+ "📱",
1260
+ "📲",
1261
+ "💻",
1262
+ "⌨️",
1263
+ "🖥️",
1264
+ "🖨️",
1265
+ "🖱️",
1266
+ "🖲️",
1267
+ "🕹️",
1268
+ "🗜️",
1269
+ "💽",
1270
+ "💾",
1271
+ "💿",
1272
+ "📀",
1273
+ "🧮",
1274
+ "🎥",
1275
+ "🎞️",
1276
+ "📽️",
1277
+ "🎬",
1278
+ "📺",
1279
+ "📷",
1280
+ "📸",
1281
+ "📹",
1282
+ "📼",
1283
+ "🔍",
1284
+ "🔎",
1285
+ "🕯️",
1286
+ "💡",
1287
+ "🔦",
1288
+ "🏮",
1289
+ "📔",
1290
+ "📕",
1291
+ "📖",
1292
+ "📗",
1293
+ "📘",
1294
+ "📙",
1295
+ "📚",
1296
+ "📓",
1297
+ "📒",
1298
+ "📃",
1299
+ "📜",
1300
+ "📄",
1301
+ "📰",
1302
+ "🗞️",
1303
+ "📑",
1304
+ "🔖",
1305
+ "🏷️",
1306
+ "💰",
1307
+ "🪙"
1308
+ ]
1309
+ },
1310
+ {
1311
+ id: "nature",
1312
+ icon: "☀️",
1313
+ name: "自然",
1314
+ emojis: [
1315
+ "☀️",
1316
+ "🌤️",
1317
+ "⛅",
1318
+ "🌥️",
1319
+ "☁️",
1320
+ "🌦️",
1321
+ "🌧️",
1322
+ "⛈️",
1323
+ "🌩️",
1324
+ "🌨️",
1325
+ "❄️",
1326
+ "☃️",
1327
+ "⛄",
1328
+ "🌬️",
1329
+ "💨",
1330
+ "🌪️",
1331
+ "🌫️",
1332
+ "🌊",
1333
+ "💧",
1334
+ "💦",
1335
+ "☔",
1336
+ "☂️",
1337
+ "🌱",
1338
+ "🌲",
1339
+ "🌳",
1340
+ "🌴",
1341
+ "🌵",
1342
+ "🌷",
1343
+ "🌹",
1344
+ "🥀",
1345
+ "🌺",
1346
+ "🌸",
1347
+ "🌼",
1348
+ "🌻",
1349
+ "🌞",
1350
+ "⭐",
1351
+ "🌟",
1352
+ "✨",
1353
+ "💫",
1354
+ "🌙",
1355
+ "🌚",
1356
+ "🌛",
1357
+ "🌜",
1358
+ "🌝",
1359
+ "🪐",
1360
+ "🌍",
1361
+ "🌎",
1362
+ "🌏",
1363
+ "⛱️",
1364
+ "🏖️"
1365
+ ]
1366
+ }
1367
+ ], O = (H) => {
1368
+ n("select", H);
1369
+ };
1370
+ return (H, G) => w.visible ? (a(), p("div", {
1371
+ key: 0,
1372
+ class: "emoji-picker",
1373
+ onClick: G[0] || (G[0] = Fe(() => {
1374
+ }, ["stop"]))
1375
+ }, [
1376
+ e("div", Ot, [
1377
+ (a(), p(de, null, ue($, (V, ie) => e("div", {
1378
+ key: V.id,
1379
+ class: K(["emoji-category-tab", { active: v.value === ie }]),
1380
+ onClick: (R) => v.value = ie
1381
+ }, y(V.icon), 11, Gt)), 64))
1382
+ ]),
1383
+ e("div", Jt, [
1384
+ (a(!0), p(de, null, ue($[v.value].emojis, (V) => (a(), p("div", {
1385
+ key: V,
1386
+ class: "emoji-item",
1387
+ onClick: (ie) => O(V)
1388
+ }, y(V), 9, Qt))), 128))
1389
+ ])
1390
+ ])) : S("", !0);
1391
+ }
1392
+ }, Et = /* @__PURE__ */ Ze(Zt, [["__scopeId", "data-v-6ca53096"]]), es = { class: "chat-panel" }, ts = { class: "chat-sidebar" }, ss = ["src"], as = ["onClick"], ns = {
1002
1393
  key: 0,
1003
1394
  class: "sidebar-nav-badge"
1004
- }, Zt = { class: "chat-content-panel" }, es = { class: "chat-search-bar" }, ts = { class: "chat-content-scroll" }, ss = { key: 0 }, as = ["onClick", "onContextmenu"], ns = { class: "chat-list-avatar-wrapper" }, is = ["src", "alt"], ls = {
1395
+ }, is = { class: "chat-content-panel" }, ls = { class: "chat-search-bar" }, os = { class: "chat-content-scroll" }, rs = { key: 0 }, cs = ["onClick", "onContextmenu"], ds = { class: "chat-list-avatar-wrapper" }, us = ["src", "alt"], vs = {
1005
1396
  key: 0,
1006
1397
  class: "chat-list-online-indicator"
1007
- }, os = { class: "chat-list-info" }, rs = { class: "chat-list-header" }, cs = { class: "chat-list-name" }, ds = { class: "chat-list-time" }, us = { class: "chat-list-preview" }, vs = { class: "chat-list-last-msg" }, ps = {
1398
+ }, ps = { class: "chat-list-info" }, ms = { class: "chat-list-header" }, hs = { class: "chat-list-name" }, fs = { class: "chat-list-time" }, gs = { class: "chat-list-preview" }, ys = { class: "chat-list-last-msg" }, _s = {
1008
1399
  key: 0,
1009
1400
  class: "chat-list-unread"
1010
- }, ms = { key: 1 }, fs = { class: "add-friend-section" }, hs = { class: "add-friend-icon" }, gs = ["onClick"], ys = { class: "chat-list-avatar-wrapper" }, _s = ["src", "alt"], bs = { class: "chat-list-info" }, ks = { class: "chat-list-name" }, ws = { key: 2 }, Cs = { class: "friend-request-info" }, xs = ["src", "alt"], Us = { class: "friend-request-details" }, $s = { class: "friend-request-username" }, Ss = { class: "chat-main-area" }, zs = {
1401
+ }, bs = { key: 1 }, ks = { class: "add-friend-section" }, ws = { class: "add-friend-icon" }, Cs = ["onClick"], xs = { class: "chat-list-avatar-wrapper" }, Us = ["src", "alt"], $s = { class: "chat-list-info" }, Ss = { class: "chat-list-name" }, zs = { key: 2 }, As = { class: "friend-request-info" }, Fs = ["src", "alt"], Vs = { class: "friend-request-details" }, Rs = { class: "friend-request-username" }, Ms = { class: "chat-main-area" }, Is = {
1011
1402
  key: 0,
1012
1403
  class: "friend-profile-area"
1013
- }, As = ["src", "alt"], Vs = { class: "profile-name" }, Fs = { class: "profile-status" }, Is = {
1404
+ }, Ls = ["src", "alt"], Ts = { class: "profile-name" }, Es = { class: "profile-status" }, Ds = {
1014
1405
  key: 1,
1015
1406
  class: "chat-window-area"
1016
- }, Rs = { class: "chat-window-header" }, Ms = { class: "chat-window-title" }, Ls = { class: "chat-window-name" }, Ts = { class: "chat-window-actions" }, Es = { class: "message-avatar" }, Ds = ["src"], Ws = {
1407
+ }, Ws = { class: "chat-window-header" }, js = { class: "chat-window-title" }, Hs = { class: "chat-window-name" }, Xs = { class: "chat-window-actions" }, Ys = { class: "message-avatar" }, qs = ["src"], Bs = {
1017
1408
  key: 0,
1018
1409
  class: "message-sender-name"
1019
- }, Hs = { class: "message-bubble-wrapper" }, Xs = ["onClick"], Ys = ["src", "alt"], qs = {
1410
+ }, Ns = { class: "message-bubble-wrapper" }, Ps = ["onClick"], Ks = ["src", "alt"], Os = {
1020
1411
  key: 0,
1021
1412
  class: "message-image-size"
1022
- }, Bs = ["onClick"], Ks = { class: "message-file-content" }, Ns = { class: "message-file-icon" }, Ps = { class: "message-file-info" }, js = { class: "message-file-name" }, Os = { class: "message-file-meta" }, Gs = { key: 0 }, Js = { class: "chat-input-area" }, Qs = {
1413
+ }, Gs = ["onClick"], Js = { class: "message-file-content" }, Qs = { class: "message-file-icon" }, Zs = { class: "message-file-info" }, ea = { class: "message-file-name" }, ta = { class: "message-file-meta" }, sa = { key: 0 }, aa = {
1023
1414
  key: 0,
1024
1415
  class: "pending-files-area"
1025
- }, Zs = {
1416
+ }, na = {
1026
1417
  key: 0,
1027
1418
  class: "pending-image-wrapper"
1028
- }, ea = ["src", "alt"], ta = ["onClick"], sa = {
1419
+ }, ia = ["src", "alt"], la = ["onClick"], oa = {
1029
1420
  key: 1,
1030
1421
  class: "pending-file-wrapper"
1031
- }, aa = { class: "pending-file-name" }, na = ["onClick"], ia = {
1422
+ }, ra = { class: "pending-file-name" }, ca = ["onClick"], da = {
1032
1423
  key: 1,
1033
1424
  class: "input-toolbar"
1034
- }, la = { class: "input-textarea-wrapper" }, oa = ["onKeydown"], ra = { class: "input-send-wrapper" }, ca = {
1425
+ }, ua = { class: "emoji-button-wrapper" }, va = { class: "input-textarea-wrapper" }, pa = ["onKeydown"], ma = { class: "input-send-wrapper" }, ha = {
1035
1426
  key: 2,
1036
1427
  class: "chat-empty-state"
1037
- }, da = { class: "empty-state-text" }, ua = {
1428
+ }, fa = { class: "empty-state-text" }, ga = {
1038
1429
  key: 0,
1039
1430
  class: "chat-detail-panel"
1040
- }, va = { class: "chat-detail-content" }, pa = { class: "chat-detail-profile" }, ma = ["src", "alt"], fa = { class: "chat-detail-name" }, ha = { class: "add-friend-search-wrapper" }, ga = { class: "add-friend-users-list" }, ya = { class: "add-friend-user-info" }, _a = ["src", "alt"], ba = { class: "add-friend-user-name" }, ka = { class: "chat-settings-container" }, wa = { class: "chat-settings-avatar-section" }, Ca = { class: "chat-settings-avatar-wrapper" }, xa = ["src"], Ua = { class: "chat-settings-user-display" }, $a = { class: "chat-settings-nickname" }, Sa = { class: "chat-settings-username" }, za = { class: "chat-settings-form-section" }, Aa = { class: "chat-settings-form-header" }, Va = { class: "chat-settings-form-title" }, Fa = { class: "chat-settings-form" }, Ia = { class: "chat-settings-form-item" }, Ra = {
1431
+ }, ya = { class: "chat-detail-content" }, _a = { class: "chat-detail-profile" }, ba = ["src", "alt"], ka = { class: "chat-detail-name" }, wa = { class: "add-friend-search-wrapper" }, Ca = { class: "add-friend-users-list" }, xa = { class: "add-friend-user-info" }, Ua = ["src", "alt"], $a = { class: "add-friend-user-name" }, Sa = { class: "chat-settings-container" }, za = { class: "chat-settings-avatar-section" }, Aa = { class: "chat-settings-avatar-wrapper" }, Fa = ["src"], Va = { class: "chat-settings-user-display" }, Ra = { class: "chat-settings-nickname" }, Ma = { class: "chat-settings-username" }, Ia = { class: "chat-settings-form-section" }, La = { class: "chat-settings-form-header" }, Ta = { class: "chat-settings-form-title" }, Ea = { class: "chat-settings-form" }, Da = { class: "chat-settings-form-item" }, Wa = {
1041
1432
  key: 1,
1042
1433
  class: "chat-settings-form-value"
1043
- }, Ma = { class: "chat-settings-form-item" }, La = {
1434
+ }, ja = { class: "chat-settings-form-item" }, Ha = {
1044
1435
  key: 1,
1045
1436
  class: "chat-settings-form-value"
1046
- }, Ta = { class: "chat-settings-form-item" }, Ea = {
1437
+ }, Xa = { class: "chat-settings-form-item" }, Ya = {
1047
1438
  key: 1,
1048
1439
  class: "chat-settings-form-value"
1049
- }, Da = { class: "chat-settings-form-item" }, Wa = {
1440
+ }, qa = { class: "chat-settings-form-item" }, Ba = {
1050
1441
  key: 1,
1051
1442
  class: "chat-settings-form-value bio-value"
1052
- }, Ha = {
1443
+ }, Na = {
1053
1444
  key: 0,
1054
1445
  class: "chat-settings-form-actions"
1055
- }, Xa = {
1446
+ }, Pa = {
1056
1447
  __name: "ChatPanel",
1057
1448
  props: {
1058
1449
  config: { type: Object, required: !0 }
1059
1450
  },
1060
1451
  emits: ["message", "send", "error", "init"],
1061
- setup(x, { emit: t }) {
1062
- const n = x, v = t, {
1452
+ setup(w, { emit: t }) {
1453
+ const n = w, v = t, {
1063
1454
  myUsername: $,
1064
- myAvatar: ee,
1455
+ myAvatar: O,
1065
1456
  userInfo: H,
1066
- loadingUserInfo: Z,
1067
- friendList: X,
1068
- filteredFriendList: ve,
1069
- searchText: V,
1457
+ loadingUserInfo: G,
1458
+ friendList: V,
1459
+ filteredFriendList: ie,
1460
+ searchText: R,
1070
1461
  inputText: U,
1071
1462
  messagesContainer: A,
1072
1463
  filteredUsers: f,
1073
- filteredAvailableUsers: ce,
1074
- currentUser: Ae,
1075
- currentMessages: he,
1076
- addFriendDialogVisible: C,
1077
- addFriendSearchText: ge,
1078
- availableUsers: Ce,
1079
- loadingAvailableUsers: Ve,
1080
- friendApplyList: xe,
1081
- loadingFriendApply: Se,
1082
- formatTime: Fe,
1083
- formatLastTime: Re,
1464
+ filteredAvailableUsers: ve,
1465
+ currentUser: Se,
1466
+ currentMessages: ge,
1467
+ addFriendDialogVisible: x,
1468
+ addFriendSearchText: he,
1469
+ availableUsers: we,
1470
+ loadingAvailableUsers: ze,
1471
+ friendApplyList: Ce,
1472
+ loadingFriendApply: Ue,
1473
+ formatTime: Ve,
1474
+ formatLastTime: Me,
1084
1475
  scrollToBottom: De,
1085
1476
  getFriendList: We,
1086
- getChatHistory: Me,
1087
- setFriendToChatStatus: w,
1477
+ getChatHistory: Ie,
1478
+ setFriendToChatStatus: C,
1088
1479
  selectUser: z,
1089
- sendMessage: Y,
1090
- sendFile: I,
1091
- sendFilesAndText: R,
1092
- initWebSocket: M,
1093
- closeWebSocket: E,
1094
- reset: N,
1095
- openAddFriendDialog: P,
1096
- addFriend: L,
1097
- loadFriendApplyList: q,
1480
+ sendMessage: q,
1481
+ sendFile: L,
1482
+ sendFilesAndText: E,
1483
+ initWebSocket: D,
1484
+ closeWebSocket: X,
1485
+ reset: J,
1486
+ openAddFriendDialog: Q,
1487
+ addFriend: W,
1488
+ loadFriendApplyList: N,
1098
1489
  agreeFriend: te,
1099
- updateMyAvatar: se,
1100
- getUserInfo: de,
1101
- updateUserInfo: pe
1102
- } = Lt(n.config, (h) => {
1490
+ updateMyAvatar: ne
1491
+ } = Tt(n.config, (h) => {
1103
1492
  v("message", h);
1104
- }), B = we(() => {
1105
- var r;
1106
- const h = [{ id: "chat", icon: Ye, badge: 0 }];
1107
- return n.config.modules.friends && h.push({ id: "friends", icon: Qe, badge: 0 }), n.config.modules.apply && h.push({ id: "apply", icon: Ut, badge: ((r = xe.value) == null ? void 0 : r.length) || 0 }), h;
1108
- }), ae = _("chat"), ne = _(null), D = _(null), W = _(null), ie = _(!1), le = _(!1), K = _({ nickname: "", email: "", phone: "", bio: "" }), oe = _(!1), ze = _(!1), i = _(!1), d = _(!1), g = _(null), F = _(""), _e = _(null), j = _([]), O = _({ visible: !1, x: 0, y: 0, chat: null }), Ue = (h, r) => {
1109
- h.preventDefault(), h.stopPropagation(), O.value = { visible: !0, x: h.clientX, y: h.clientY, chat: r };
1493
+ }), le = ke(() => {
1494
+ var o;
1495
+ const h = [{ id: "chat", icon: Xe, badge: 0 }];
1496
+ return n.config.modules.friends && h.push({ id: "friends", icon: Je, badge: 0 }), n.config.modules.apply && h.push({ id: "apply", icon: $t, badge: ((o = Ce.value) == null ? void 0 : o.length) || 0 }), h;
1497
+ }), se = g("chat"), F = g(null), T = g(null), M = g(null), Y = g(!1), oe = g(!1), P = g({ nickname: "", email: "", phone: "", bio: "" }), re = g(!1), $e = g(!1), _e = g(!1), c = g(!1), r = g(null), _ = g(""), I = g(null), ae = g([]), B = g({ visible: !1, x: 0, y: 0, chat: null }), pe = g(!1), Ae = (h, o) => {
1498
+ h.preventDefault(), h.stopPropagation(), B.value = { visible: !0, x: h.clientX, y: h.clientY, chat: o };
1110
1499
  }, Le = () => {
1111
- O.value.visible = !1;
1500
+ B.value.visible = !1;
1112
1501
  }, et = async () => {
1113
- if (!O.value.chat) return;
1114
- await w(O.value.chat.id, 0) && ne.value === O.value.chat.id && (ne.value = null, D.value = null), Le();
1502
+ if (!B.value.chat) return;
1503
+ await C(B.value.chat.id, 0) && F.value === B.value.chat.id && (F.value = null, T.value = null), Le();
1115
1504
  }, Te = (h) => {
1116
- ne.value = h.id, D.value = h, W.value = null, ie.value = !1, z({
1505
+ F.value = h.id, T.value = h, M.value = null, Y.value = !1, z({
1117
1506
  id: h.id,
1118
1507
  name: h.name,
1119
1508
  avatar: h.avatar,
1120
1509
  online: h.online
1121
1510
  });
1122
1511
  }, tt = (h) => {
1123
- W.value = h, ne.value = null, D.value = null;
1512
+ M.value = h, F.value = null, T.value = null;
1124
1513
  }, st = async () => {
1125
- if (!W.value) return;
1126
- if (await w(W.value.id)) {
1127
- ae.value = "chat", await Oe();
1128
- const r = f.value.find((u) => u.id === W.value.id);
1129
- r && Te(r), W.value = null;
1514
+ if (!M.value) return;
1515
+ if (await C(M.value.id)) {
1516
+ se.value = "chat", await Ke();
1517
+ const o = f.value.find((d) => d.id === M.value.id);
1518
+ o && Te(o), M.value = null;
1130
1519
  }
1131
1520
  }, at = () => {
1132
- ze.value = !0;
1521
+ $e.value = !0;
1133
1522
  }, nt = () => {
1134
1523
  var h;
1135
- (h = g.value) == null || h.click();
1524
+ (h = r.value) == null || h.click();
1136
1525
  }, it = () => {
1137
1526
  var h;
1138
- (h = _e.value) == null || h.click();
1527
+ (h = I.value) == null || h.click();
1139
1528
  }, lt = (h) => {
1140
- const r = Array.from(h.target.files || []);
1141
- if (r.length !== 0) {
1142
- for (const u of r) {
1143
- if (u.size > 50 * 1024 * 1024) {
1144
- Q.warning(`文件 ${u.name} 超过50MB,已跳过`);
1529
+ const o = Array.from(h.target.files || []);
1530
+ if (o.length !== 0) {
1531
+ for (const d of o) {
1532
+ if (d.size > 50 * 1024 * 1024) {
1533
+ ee.warning(`文件 ${d.name} 超过50MB,已跳过`);
1145
1534
  continue;
1146
1535
  }
1147
- const s = URL.createObjectURL(u);
1148
- j.value.push({
1536
+ const s = URL.createObjectURL(d);
1537
+ ae.value.push({
1149
1538
  id: Date.now() + Math.random(),
1150
- file: u,
1151
- name: u.name,
1152
- size: u.size,
1153
- type: u.type,
1539
+ file: d,
1540
+ name: d.name,
1541
+ size: d.size,
1542
+ type: d.type,
1154
1543
  previewUrl: s,
1155
- isImage: u.type.startsWith("image/")
1544
+ isImage: d.type.startsWith("image/")
1156
1545
  });
1157
1546
  }
1158
- _e.value && (_e.value.value = "");
1547
+ I.value && (I.value.value = "");
1159
1548
  }
1160
- }, Ke = (h) => {
1161
- const r = j.value[h];
1162
- r.previewUrl && URL.revokeObjectURL(r.previewUrl), j.value.splice(h, 1);
1163
- }, Ne = (h) => {
1549
+ }, qe = (h) => {
1550
+ const o = ae.value[h];
1551
+ o.previewUrl && URL.revokeObjectURL(o.previewUrl), ae.value.splice(h, 1);
1552
+ }, Be = (h) => {
1164
1553
  if (h === 0) return "0 B";
1165
- const r = 1024, u = ["B", "KB", "MB", "GB"], s = Math.floor(Math.log(h) / Math.log(r));
1166
- return parseFloat((h / Math.pow(r, s)).toFixed(2)) + " " + u[s];
1167
- }, Pe = async () => {
1168
- if (!U.value.trim() && j.value.length === 0) return;
1169
- const h = [...j.value], r = U.value;
1170
- U.value = "", j.value.forEach((u) => {
1171
- u.previewUrl && URL.revokeObjectURL(u.previewUrl);
1172
- }), j.value = [], await R(h, r), v("send", { text: r, files: h });
1554
+ const o = 1024, d = ["B", "KB", "MB", "GB"], s = Math.floor(Math.log(h) / Math.log(o));
1555
+ return parseFloat((h / Math.pow(o, s)).toFixed(2)) + " " + d[s];
1556
+ }, Ne = async () => {
1557
+ if (!U.value.trim() && ae.value.length === 0) return;
1558
+ const h = [...ae.value], o = U.value;
1559
+ U.value = "", ae.value.forEach((d) => {
1560
+ d.previewUrl && URL.revokeObjectURL(d.previewUrl);
1561
+ }), ae.value = [], await E(h, o), v("send", { text: o, files: h });
1173
1562
  }, ot = (h) => {
1174
- var u;
1175
- const r = (u = h.clipboardData) == null ? void 0 : u.items;
1176
- if (r) {
1177
- for (const s of r)
1563
+ var d;
1564
+ const o = (d = h.clipboardData) == null ? void 0 : d.items;
1565
+ if (o) {
1566
+ for (const s of o)
1178
1567
  if (s.kind === "file") {
1179
1568
  const b = s.getAsFile();
1180
1569
  if (b) {
1181
1570
  if (b.size > 50 * 1024 * 1024) {
1182
- Q.warning(`文件 ${b.name} 超过50MB,已跳过`);
1571
+ ee.warning(`文件 ${b.name} 超过50MB,已跳过`);
1183
1572
  continue;
1184
1573
  }
1185
- const T = URL.createObjectURL(b);
1186
- j.value.push({
1574
+ const j = URL.createObjectURL(b);
1575
+ ae.value.push({
1187
1576
  id: Date.now() + Math.random(),
1188
1577
  file: b,
1189
1578
  name: b.name,
1190
1579
  size: b.size,
1191
1580
  type: b.type,
1192
- previewUrl: T,
1581
+ previewUrl: j,
1193
1582
  isImage: b.type.startsWith("image/")
1194
1583
  });
1195
1584
  }
1196
1585
  }
1197
1586
  }
1198
- }, je = (h) => {
1587
+ }, Pe = (h) => {
1199
1588
  if (!h) {
1200
- Q.warning("文件地址无效");
1589
+ ee.warning("文件地址无效");
1201
1590
  return;
1202
1591
  }
1203
1592
  window.open(h, "_blank");
1204
1593
  }, rt = (h) => {
1205
1594
  console.warn("图片加载失败", h);
1206
1595
  }, ct = (h) => {
1207
- const r = h.target.files[0];
1208
- if (!r) return;
1209
- if (!r.type.startsWith("image/")) {
1210
- Q.error("只能上传图片文件");
1596
+ U.value += h, pe.value = !1;
1597
+ }, dt = (h) => {
1598
+ const o = h.target.files[0];
1599
+ if (!o) return;
1600
+ if (!o.type.startsWith("image/")) {
1601
+ ee.error("只能上传图片文件");
1211
1602
  return;
1212
1603
  }
1213
- if (r.size > 5 * 1024 * 1024) {
1214
- Q.error("图片大小不能超过 5MB");
1604
+ if (o.size > 5 * 1024 * 1024) {
1605
+ ee.error("图片大小不能超过 5MB");
1215
1606
  return;
1216
1607
  }
1217
- const u = new FileReader();
1218
- u.onload = (s) => {
1219
- F.value = s.target.result, i.value = !0;
1220
- }, u.readAsDataURL(r);
1221
- }, dt = async ({ file: h }) => {
1608
+ const d = new FileReader();
1609
+ d.onload = (s) => {
1610
+ _.value = s.target.result, _e.value = !0;
1611
+ }, d.readAsDataURL(o);
1612
+ }, ut = async ({ file: h }) => {
1222
1613
  if (h) {
1223
- d.value = !0;
1614
+ c.value = !0;
1224
1615
  try {
1225
- const { ChatApi: r } = await Promise.resolve().then(() => Mt), s = await new r(n.config).uploadAvatar(h, $);
1226
- s.code === 200 ? (Q.success("头像上传成功"), se(s.data), Ge()) : Q.error(s.msg || "头像上传失败");
1227
- } catch (r) {
1228
- console.error(r), Q.error("头像上传失败");
1616
+ const { ChatApi: o } = await Promise.resolve().then(() => Lt), s = await new o(n.config).uploadAvatar(h, $);
1617
+ s.code === 200 ? (ee.success("头像上传成功"), ne(s.data), Oe()) : ee.error(s.msg || "头像上传失败");
1618
+ } catch (o) {
1619
+ console.error(o), ee.error("头像上传失败");
1229
1620
  } finally {
1230
- d.value = !1;
1621
+ c.value = !1;
1231
1622
  }
1232
1623
  }
1233
- }, Ge = () => {
1234
- F.value = "", i.value = !1, g.value && (g.value.value = "");
1235
- }, ut = () => {
1236
- K.value = {
1624
+ }, Oe = () => {
1625
+ _.value = "", _e.value = !1, r.value && (r.value.value = "");
1626
+ }, vt = () => {
1627
+ P.value = {
1237
1628
  nickname: H.value.nickname || "",
1238
1629
  email: H.value.email || "",
1239
1630
  phone: H.value.phone || "",
1240
1631
  bio: H.value.bio || ""
1241
- }, le.value = !0;
1242
- }, vt = () => {
1243
- le.value = !1, K.value = { nickname: "", email: "", phone: "", bio: "" };
1244
- }, pt = async () => {
1245
- oe.value = !0;
1632
+ }, oe.value = !0;
1633
+ }, pt = () => {
1634
+ oe.value = !1, P.value = { nickname: "", email: "", phone: "", bio: "" };
1635
+ }, mt = async () => {
1636
+ re.value = !0;
1246
1637
  try {
1247
- await pe(K.value) ? (Q.success("保存成功"), le.value = !1) : Q.error("保存失败");
1638
+ await updateUserInfo(P.value) ? (ee.success("保存成功"), oe.value = !1) : ee.error("保存失败");
1248
1639
  } catch (h) {
1249
- console.error(h), Q.error("保存失败");
1640
+ console.error(h), ee.error("保存失败");
1250
1641
  } finally {
1251
- oe.value = !1;
1642
+ re.value = !1;
1252
1643
  }
1253
1644
  };
1254
- return _t(async () => {
1255
- await Promise.all([We(), q()]), M(), f.value.length > 0 && Te(f.value[0]), v("init"), document.addEventListener("click", Le);
1256
- }), bt(() => {
1257
- N(), E(), document.removeEventListener("click", Le);
1258
- }), (h, r) => {
1259
- var ke, He, Ee;
1260
- const u = be("el-icon"), s = be("el-input"), b = be("el-empty"), T = be("el-button"), re = be("el-dialog");
1261
- return a(), p("div", jt, [
1262
- e("div", Ot, [
1645
+ return bt(async () => {
1646
+ await Promise.all([We(), N()]), D(), f.value.length > 0 && Te(f.value[0]), v("init"), document.addEventListener("click", Le);
1647
+ }), kt(() => {
1648
+ J(), X(), document.removeEventListener("click", Le);
1649
+ }), (h, o) => {
1650
+ var be, je, Ee;
1651
+ const d = ye("el-icon"), s = ye("el-input"), b = ye("el-empty"), j = ye("el-button"), ce = ye("el-dialog");
1652
+ return a(), p("div", es, [
1653
+ e("div", ts, [
1263
1654
  e("div", {
1264
1655
  class: "sidebar-avatar",
1265
1656
  onClick: at
1266
1657
  }, [
1267
1658
  e("img", {
1268
- src: c(ee),
1659
+ src: u(O),
1269
1660
  alt: "头像",
1270
1661
  class: "sidebar-avatar-img"
1271
- }, null, 8, Gt)
1662
+ }, null, 8, ss)
1272
1663
  ]),
1273
- (a(!0), p(me, null, fe(B.value, (o) => (a(), p("div", {
1274
- key: o.id,
1275
- class: J([
1664
+ (a(!0), p(de, null, ue(le.value, (l) => (a(), p("div", {
1665
+ key: l.id,
1666
+ class: K([
1276
1667
  "sidebar-nav-item",
1277
- ae.value === o.id ? "sidebar-nav-item-active" : "sidebar-nav-item-inactive"
1668
+ se.value === l.id ? "sidebar-nav-item-active" : "sidebar-nav-item-inactive"
1278
1669
  ]),
1279
- onClick: (ye) => ae.value = o.id
1670
+ onClick: (fe) => se.value = l.id
1280
1671
  }, [
1281
- m(u, { size: 24 }, {
1672
+ m(d, { size: 24 }, {
1282
1673
  default: k(() => [
1283
- (a(), G(kt(o.icon)))
1674
+ (a(), Z(wt(l.icon)))
1284
1675
  ]),
1285
1676
  _: 2
1286
1677
  }, 1024),
1287
- o.badge ? (a(), p("span", Qt, y(o.badge > 99 ? "99+" : o.badge), 1)) : S("", !0)
1288
- ], 10, Jt))), 128)),
1289
- r[13] || (r[13] = e("div", { class: "sidebar-spacer" }, null, -1)),
1290
- x.config.modules.settings ? (a(), p("div", {
1678
+ l.badge ? (a(), p("span", ns, y(l.badge > 99 ? "99+" : l.badge), 1)) : S("", !0)
1679
+ ], 10, as))), 128)),
1680
+ o[15] || (o[15] = e("div", { class: "sidebar-spacer" }, null, -1)),
1681
+ w.config.modules.settings ? (a(), p("div", {
1291
1682
  key: 0,
1292
1683
  class: "sidebar-nav-item sidebar-nav-item-inactive",
1293
- onClick: r[0] || (r[0] = (o) => ze.value = !0),
1684
+ onClick: o[0] || (o[0] = (l) => $e.value = !0),
1294
1685
  title: "设置"
1295
1686
  }, [
1296
- m(u, { size: 24 }, {
1687
+ m(d, { size: 24 }, {
1297
1688
  default: k(() => [
1298
- m(c($t))
1689
+ m(u(St))
1299
1690
  ]),
1300
1691
  _: 1
1301
1692
  })
1302
1693
  ])) : S("", !0)
1303
1694
  ]),
1304
- e("div", Zt, [
1305
- e("div", es, [
1695
+ e("div", is, [
1696
+ e("div", ls, [
1306
1697
  m(s, {
1307
- modelValue: c(V),
1308
- "onUpdate:modelValue": r[1] || (r[1] = (o) => Ie(V) ? V.value = o : null),
1698
+ modelValue: u(R),
1699
+ "onUpdate:modelValue": o[1] || (o[1] = (l) => Re(R) ? R.value = l : null),
1309
1700
  placeholder: "搜索",
1310
- "prefix-icon": c(qe),
1701
+ "prefix-icon": u(Ye),
1311
1702
  class: "chat-search-input"
1312
1703
  }, null, 8, ["modelValue", "prefix-icon"])
1313
1704
  ]),
1314
- e("div", ts, [
1315
- ae.value === "chat" ? (a(), p("div", ss, [
1316
- (a(!0), p(me, null, fe(c(f), (o) => (a(), p("div", {
1317
- key: o.id,
1318
- class: J([
1705
+ e("div", os, [
1706
+ se.value === "chat" ? (a(), p("div", rs, [
1707
+ (a(!0), p(de, null, ue(u(f), (l) => (a(), p("div", {
1708
+ key: l.id,
1709
+ class: K([
1319
1710
  "chat-list-item",
1320
- ne.value === o.id ? "chat-list-item-active" : ""
1711
+ F.value === l.id ? "chat-list-item-active" : ""
1321
1712
  ]),
1322
- onClick: (ye) => Te(o),
1323
- onContextmenu: Be((ye) => Ue(ye, o), ["prevent", "stop"])
1713
+ onClick: (fe) => Te(l),
1714
+ onContextmenu: Fe((fe) => Ae(fe, l), ["prevent", "stop"])
1324
1715
  }, [
1325
- e("div", ns, [
1716
+ e("div", ds, [
1326
1717
  e("img", {
1327
- src: o.avatar,
1328
- alt: o.name,
1718
+ src: l.avatar,
1719
+ alt: l.name,
1329
1720
  class: "chat-list-avatar"
1330
- }, null, 8, is),
1331
- o.online ? (a(), p("span", ls)) : S("", !0)
1721
+ }, null, 8, us),
1722
+ l.online ? (a(), p("span", vs)) : S("", !0)
1332
1723
  ]),
1333
- e("div", os, [
1334
- e("div", rs, [
1335
- e("span", cs, y(o.name), 1),
1336
- e("span", ds, y(c(Re)(o.lastTime)), 1)
1724
+ e("div", ps, [
1725
+ e("div", ms, [
1726
+ e("span", hs, y(l.name), 1),
1727
+ e("span", fs, y(u(Me)(l.lastTime)), 1)
1337
1728
  ]),
1338
- e("div", us, [
1339
- e("span", vs, y(o.lastMsg), 1),
1340
- o.unread > 0 ? (a(), p("span", ps, y(o.unread > 99 ? "99+" : o.unread), 1)) : S("", !0)
1729
+ e("div", gs, [
1730
+ e("span", ys, y(l.lastMsg), 1),
1731
+ l.unread > 0 ? (a(), p("span", _s, y(l.unread > 99 ? "99+" : l.unread), 1)) : S("", !0)
1341
1732
  ])
1342
1733
  ])
1343
- ], 42, as))), 128))
1734
+ ], 42, cs))), 128))
1344
1735
  ])) : S("", !0),
1345
- ae.value === "friends" && x.config.modules.friends ? (a(), p("div", ms, [
1346
- e("div", fs, [
1736
+ se.value === "friends" && w.config.modules.friends ? (a(), p("div", bs, [
1737
+ e("div", ks, [
1347
1738
  e("div", {
1348
1739
  class: "add-friend-btn",
1349
- onClick: r[2] || (r[2] = (...o) => c(P) && c(P)(...o))
1740
+ onClick: o[2] || (o[2] = (...l) => u(Q) && u(Q)(...l))
1350
1741
  }, [
1351
- e("div", hs, [
1352
- m(u, {
1742
+ e("div", ws, [
1743
+ m(d, {
1353
1744
  class: "text-white",
1354
1745
  size: 20
1355
1746
  }, {
1356
1747
  default: k(() => [
1357
- m(c(St))
1748
+ m(u(zt))
1358
1749
  ]),
1359
1750
  _: 1
1360
1751
  })
1361
1752
  ]),
1362
- r[14] || (r[14] = e("span", { class: "add-friend-text" }, "添加好友", -1))
1753
+ o[16] || (o[16] = e("span", { class: "add-friend-text" }, "添加好友", -1))
1363
1754
  ])
1364
1755
  ]),
1365
- (a(!0), p(me, null, fe(c(ve), (o) => (a(), p("div", {
1366
- key: o.id,
1756
+ (a(!0), p(de, null, ue(u(ie), (l) => (a(), p("div", {
1757
+ key: l.id,
1367
1758
  class: "chat-list-item",
1368
- onClick: (ye) => tt(o)
1759
+ onClick: (fe) => tt(l)
1369
1760
  }, [
1370
- e("div", ys, [
1761
+ e("div", xs, [
1371
1762
  e("img", {
1372
- src: o.avatar,
1373
- alt: o.name,
1763
+ src: l.avatar,
1764
+ alt: l.name,
1374
1765
  class: "chat-list-avatar"
1375
- }, null, 8, _s),
1766
+ }, null, 8, Us),
1376
1767
  e("span", {
1377
- class: J([
1768
+ class: K([
1378
1769
  "chat-list-online-indicator",
1379
- o.online ? "chat-list-online" : "chat-list-offline"
1770
+ l.online ? "chat-list-online" : "chat-list-offline"
1380
1771
  ])
1381
1772
  }, null, 2)
1382
1773
  ]),
1383
- e("div", bs, [
1384
- e("span", ks, y(o.name), 1)
1774
+ e("div", $s, [
1775
+ e("span", Ss, y(l.name), 1)
1385
1776
  ])
1386
- ], 8, gs))), 128))
1777
+ ], 8, Cs))), 128))
1387
1778
  ])) : S("", !0),
1388
- ae.value === "apply" && x.config.modules.apply ? (a(), p("div", ws, [
1389
- c(Se) ? (a(), G(b, {
1779
+ se.value === "apply" && w.config.modules.apply ? (a(), p("div", zs, [
1780
+ u(Ue) ? (a(), Z(b, {
1390
1781
  key: 0,
1391
1782
  description: "加载中..."
1392
- })) : c(xe).length === 0 ? (a(), G(b, {
1783
+ })) : u(Ce).length === 0 ? (a(), Z(b, {
1393
1784
  key: 1,
1394
1785
  description: "暂无好友申请"
1395
- })) : (a(!0), p(me, { key: 2 }, fe(c(xe), (o) => (a(), p("div", {
1396
- key: o.applyUser || o.id,
1786
+ })) : (a(!0), p(de, { key: 2 }, ue(u(Ce), (l) => (a(), p("div", {
1787
+ key: l.applyUser || l.id,
1397
1788
  class: "friend-request-item"
1398
1789
  }, [
1399
- e("div", Cs, [
1790
+ e("div", As, [
1400
1791
  e("img", {
1401
- src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${o.applyUser}`,
1402
- alt: o.applyUser,
1792
+ src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${l.applyUser}`,
1793
+ alt: l.applyUser,
1403
1794
  class: "friend-request-avatar"
1404
- }, null, 8, xs),
1405
- e("div", Us, [
1406
- e("div", $s, y(o.applyUser), 1),
1407
- r[15] || (r[15] = e("div", { class: "friend-request-desc" }, "请求添加你为好友", -1))
1795
+ }, null, 8, Fs),
1796
+ e("div", Vs, [
1797
+ e("div", Rs, y(l.applyUser), 1),
1798
+ o[17] || (o[17] = e("div", { class: "friend-request-desc" }, "请求添加你为好友", -1))
1408
1799
  ])
1409
1800
  ]),
1410
- m(T, {
1801
+ m(j, {
1411
1802
  type: "primary",
1412
1803
  size: "small",
1413
- onClick: (ye) => c(te)(o.applyUser)
1804
+ onClick: (fe) => u(te)(l.applyUser)
1414
1805
  }, {
1415
- default: k(() => [...r[16] || (r[16] = [
1416
- ue("同意", -1)
1806
+ default: k(() => [...o[18] || (o[18] = [
1807
+ me("同意", -1)
1417
1808
  ])]),
1418
1809
  _: 1
1419
1810
  }, 8, ["onClick"])
@@ -1421,65 +1812,65 @@ const gt = (x, t) => {
1421
1812
  ])) : S("", !0)
1422
1813
  ])
1423
1814
  ]),
1424
- e("div", Ss, [
1425
- W.value && !D.value ? (a(), p("div", zs, [
1815
+ e("div", Ms, [
1816
+ M.value && !T.value ? (a(), p("div", Is, [
1426
1817
  e("img", {
1427
- src: W.value.avatar,
1428
- alt: W.value.name,
1818
+ src: M.value.avatar,
1819
+ alt: M.value.name,
1429
1820
  class: "profile-avatar"
1430
- }, null, 8, As),
1431
- e("div", Vs, y(W.value.name), 1),
1432
- e("div", Fs, [
1821
+ }, null, 8, Ls),
1822
+ e("div", Ts, y(M.value.name), 1),
1823
+ e("div", Es, [
1433
1824
  e("span", {
1434
- class: J([
1825
+ class: K([
1435
1826
  "profile-status-dot",
1436
- W.value.online ? "profile-status-online" : "profile-status-offline"
1827
+ M.value.online ? "profile-status-online" : "profile-status-offline"
1437
1828
  ])
1438
1829
  }, null, 2),
1439
- e("span", null, y(W.value.online ? "在线" : "离线"), 1)
1830
+ e("span", null, y(M.value.online ? "在线" : "离线"), 1)
1440
1831
  ]),
1441
- m(T, {
1832
+ m(j, {
1442
1833
  type: "primary",
1443
1834
  size: "large",
1444
1835
  onClick: st,
1445
1836
  class: "profile-start-chat-btn"
1446
1837
  }, {
1447
1838
  default: k(() => [
1448
- m(u, null, {
1839
+ m(d, null, {
1449
1840
  default: k(() => [
1450
- m(c(Ye))
1841
+ m(u(Xe))
1451
1842
  ]),
1452
1843
  _: 1
1453
1844
  }),
1454
- r[17] || (r[17] = e("span", null, "发消息", -1))
1845
+ o[19] || (o[19] = e("span", null, "发消息", -1))
1455
1846
  ]),
1456
1847
  _: 1
1457
1848
  })
1458
1849
  ])) : S("", !0),
1459
- D.value ? (a(), p("div", Is, [
1460
- e("div", Rs, [
1461
- e("div", Ms, [
1462
- e("span", Ls, y(D.value.name), 1),
1850
+ T.value ? (a(), p("div", Ds, [
1851
+ e("div", Ws, [
1852
+ e("div", js, [
1853
+ e("span", Hs, y(T.value.name), 1),
1463
1854
  e("span", {
1464
- class: J([
1855
+ class: K([
1465
1856
  "chat-window-status",
1466
- D.value.online ? "chat-window-status-online" : "chat-window-status-offline"
1857
+ T.value.online ? "chat-window-status-online" : "chat-window-status-offline"
1467
1858
  ])
1468
- }, y(D.value.online ? "在线" : "离线"), 3)
1859
+ }, y(T.value.online ? "在线" : "离线"), 3)
1469
1860
  ]),
1470
- e("div", Ts, [
1471
- m(u, { class: "chat-action-icon" }, {
1861
+ e("div", Xs, [
1862
+ m(d, { class: "chat-action-icon" }, {
1472
1863
  default: k(() => [
1473
- m(c(qe))
1864
+ m(u(Ye))
1474
1865
  ]),
1475
1866
  _: 1
1476
1867
  }),
1477
- m(u, {
1868
+ m(d, {
1478
1869
  class: "chat-action-icon",
1479
- onClick: r[3] || (r[3] = (o) => ie.value = !ie.value)
1870
+ onClick: o[3] || (o[3] = (l) => Y.value = !Y.value)
1480
1871
  }, {
1481
1872
  default: k(() => [
1482
- m(c(zt))
1873
+ m(u(At))
1483
1874
  ]),
1484
1875
  _: 1
1485
1876
  })
@@ -1490,253 +1881,265 @@ const gt = (x, t) => {
1490
1881
  ref: A,
1491
1882
  class: "chat-messages-container"
1492
1883
  }, [
1493
- (a(!0), p(me, null, fe(c(he), (o, ye) => (a(), p("div", {
1494
- key: ye,
1495
- class: J([
1884
+ (a(!0), p(de, null, ue(u(ge), (l, fe) => (a(), p("div", {
1885
+ key: fe,
1886
+ class: K([
1496
1887
  "message-wrapper",
1497
- o.isSelf ? "message-self" : "message-other"
1888
+ l.isSelf ? "message-self" : "message-other"
1498
1889
  ])
1499
1890
  }, [
1500
- e("div", Es, [
1891
+ e("div", Ys, [
1501
1892
  e("img", {
1502
- src: o.isSelf ? c(ee) : D.value.avatar,
1893
+ src: l.isSelf ? u(O) : T.value.avatar,
1503
1894
  class: "message-avatar-img"
1504
- }, null, 8, Ds)
1895
+ }, null, 8, qs)
1505
1896
  ]),
1506
1897
  e("div", {
1507
- class: J([
1898
+ class: K([
1508
1899
  "message-content",
1509
- o.isSelf ? "message-content-self" : "message-content-other"
1900
+ l.isSelf ? "message-content-self" : "message-content-other"
1510
1901
  ])
1511
1902
  }, [
1512
- o.isSelf ? S("", !0) : (a(), p("div", Ws, y(D.value.name), 1)),
1513
- e("div", Hs, [
1514
- o.type === "text" ? (a(), p("div", {
1903
+ l.isSelf ? S("", !0) : (a(), p("div", Bs, y(T.value.name), 1)),
1904
+ e("div", Ns, [
1905
+ l.type === "text" ? (a(), p("div", {
1515
1906
  key: 0,
1516
- class: J([
1907
+ class: K([
1517
1908
  "message-bubble",
1518
- o.isSelf ? "message-bubble-self" : "message-bubble-other"
1909
+ l.isSelf ? "message-bubble-self" : "message-bubble-other"
1519
1910
  ])
1520
- }, y(o.text), 3)) : o.type === "file" && o.fileType === "image" ? (a(), p("div", {
1911
+ }, y(l.text), 3)) : l.type === "file" && l.fileType === "image" ? (a(), p("div", {
1521
1912
  key: 1,
1522
- class: J([
1913
+ class: K([
1523
1914
  "message-bubble",
1524
1915
  "message-image-bubble",
1525
- o.isSelf ? "message-bubble-self" : "message-bubble-other"
1916
+ l.isSelf ? "message-bubble-self" : "message-bubble-other"
1526
1917
  ]),
1527
- onClick: (l) => je(o.fileUrl)
1918
+ onClick: (i) => Pe(l.fileUrl)
1528
1919
  }, [
1529
1920
  e("img", {
1530
- src: o.fileUrl,
1531
- alt: o.fileName,
1921
+ src: l.fileUrl,
1922
+ alt: l.fileName,
1532
1923
  class: "message-image",
1533
1924
  onError: rt
1534
- }, null, 40, Ys),
1535
- o.fileSize ? (a(), p("div", qs, y(Ne(o.fileSize)), 1)) : S("", !0)
1536
- ], 10, Xs)) : o.type === "file" ? (a(), p("div", {
1925
+ }, null, 40, Ks),
1926
+ l.fileSize ? (a(), p("div", Os, y(Be(l.fileSize)), 1)) : S("", !0)
1927
+ ], 10, Ps)) : l.type === "file" ? (a(), p("div", {
1537
1928
  key: 2,
1538
- class: J([
1929
+ class: K([
1539
1930
  "message-bubble",
1540
1931
  "message-file-bubble",
1541
- o.isSelf ? "message-bubble-self" : "message-bubble-other"
1932
+ l.isSelf ? "message-bubble-self" : "message-bubble-other"
1542
1933
  ]),
1543
- onClick: (l) => je(o.fileUrl)
1934
+ onClick: (i) => Pe(l.fileUrl)
1544
1935
  }, [
1545
- e("div", Ks, [
1546
- e("div", Ns, [
1547
- m(u, { size: 28 }, {
1936
+ e("div", Js, [
1937
+ e("div", Qs, [
1938
+ m(d, { size: 28 }, {
1548
1939
  default: k(() => [
1549
- m(c(At))
1940
+ m(u(Ft))
1550
1941
  ]),
1551
1942
  _: 1
1552
1943
  })
1553
1944
  ]),
1554
- e("div", Ps, [
1555
- e("div", js, y(o.fileName || o.text), 1),
1556
- e("div", Os, [
1557
- m(u, { size: 12 }, {
1945
+ e("div", Zs, [
1946
+ e("div", ea, y(l.fileName || l.text), 1),
1947
+ e("div", ta, [
1948
+ m(d, { size: 12 }, {
1558
1949
  default: k(() => [
1559
- m(c(Vt))
1950
+ m(u(Vt))
1560
1951
  ]),
1561
1952
  _: 1
1562
1953
  }),
1563
- r[18] || (r[18] = e("span", null, "点击下载", -1)),
1564
- o.fileSize ? (a(), p("span", Gs, "· " + y(Ne(o.fileSize)), 1)) : S("", !0)
1954
+ o[20] || (o[20] = e("span", null, "点击下载", -1)),
1955
+ l.fileSize ? (a(), p("span", sa, "· " + y(Be(l.fileSize)), 1)) : S("", !0)
1565
1956
  ])
1566
1957
  ])
1567
1958
  ])
1568
- ], 10, Bs)) : S("", !0),
1959
+ ], 10, Gs)) : S("", !0),
1569
1960
  e("div", {
1570
- class: J([
1961
+ class: K([
1571
1962
  "message-time",
1572
- o.isSelf ? "message-time-right" : "message-time-left"
1963
+ l.isSelf ? "message-time-right" : "message-time-left"
1573
1964
  ])
1574
- }, y(c(Fe)(o.time)), 3)
1965
+ }, y(u(Ve)(l.time)), 3)
1575
1966
  ])
1576
1967
  ], 2)
1577
1968
  ], 2))), 128))
1578
1969
  ], 512),
1579
- e("div", Js, [
1580
- j.value.length > 0 ? (a(), p("div", Qs, [
1581
- (a(!0), p(me, null, fe(j.value, (o, ye) => (a(), p("div", {
1582
- key: o.id,
1970
+ e("div", {
1971
+ class: "chat-input-area",
1972
+ onClick: o[6] || (o[6] = (l) => pe.value = !1)
1973
+ }, [
1974
+ ae.value.length > 0 ? (a(), p("div", aa, [
1975
+ (a(!0), p(de, null, ue(ae.value, (l, fe) => (a(), p("div", {
1976
+ key: l.id,
1583
1977
  class: "pending-file-item"
1584
1978
  }, [
1585
- o.isImage ? (a(), p("div", Zs, [
1979
+ l.isImage ? (a(), p("div", na, [
1586
1980
  e("img", {
1587
- src: o.previewUrl,
1588
- alt: o.name,
1981
+ src: l.previewUrl,
1982
+ alt: l.name,
1589
1983
  class: "pending-image"
1590
- }, null, 8, ea),
1984
+ }, null, 8, ia),
1591
1985
  e("button", {
1592
- onClick: (l) => Ke(ye),
1986
+ onClick: (i) => qe(fe),
1593
1987
  class: "pending-file-remove-btn"
1594
- }, " × ", 8, ta)
1595
- ])) : (a(), p("div", sa, [
1596
- m(u, { class: "pending-file-icon" }, {
1988
+ }, " × ", 8, la)
1989
+ ])) : (a(), p("div", oa, [
1990
+ m(d, { class: "pending-file-icon" }, {
1597
1991
  default: k(() => [
1598
- m(c(Ze))
1992
+ m(u(Qe))
1599
1993
  ]),
1600
1994
  _: 1
1601
1995
  }),
1602
- e("span", aa, y(o.name), 1),
1996
+ e("span", ra, y(l.name), 1),
1603
1997
  e("button", {
1604
- onClick: (l) => Ke(ye),
1998
+ onClick: (i) => qe(fe),
1605
1999
  class: "pending-file-remove-btn"
1606
- }, " × ", 8, na)
2000
+ }, " × ", 8, ca)
1607
2001
  ]))
1608
2002
  ]))), 128))
1609
2003
  ])) : S("", !0),
1610
- x.config.modules.fileUpload ? (a(), p("div", ia, [
1611
- m(u, { class: "input-toolbar-icon" }, {
1612
- default: k(() => [
1613
- m(c(Ye))
1614
- ]),
1615
- _: 1
1616
- }),
1617
- m(u, {
2004
+ w.config.modules.fileUpload ? (a(), p("div", da, [
2005
+ e("div", ua, [
2006
+ m(d, {
2007
+ class: "input-toolbar-icon",
2008
+ onClick: o[4] || (o[4] = Fe((l) => pe.value = !pe.value, ["stop"]))
2009
+ }, {
2010
+ default: k(() => [
2011
+ m(u(Xe))
2012
+ ]),
2013
+ _: 1
2014
+ }),
2015
+ m(Et, {
2016
+ visible: pe.value,
2017
+ onSelect: ct
2018
+ }, null, 8, ["visible"])
2019
+ ]),
2020
+ m(d, {
1618
2021
  class: "input-toolbar-icon",
1619
2022
  onClick: it
1620
2023
  }, {
1621
2024
  default: k(() => [
1622
- m(c(Ze))
2025
+ m(u(Qe))
1623
2026
  ]),
1624
2027
  _: 1
1625
2028
  }),
1626
- m(u, { class: "input-toolbar-icon" }, {
2029
+ m(d, { class: "input-toolbar-icon" }, {
1627
2030
  default: k(() => [
1628
- m(c(Ft))
2031
+ m(u(Rt))
1629
2032
  ]),
1630
2033
  _: 1
1631
2034
  })
1632
2035
  ])) : S("", !0),
1633
- e("div", la, [
1634
- wt(e("textarea", {
1635
- "onUpdate:modelValue": r[4] || (r[4] = (o) => Ie(U) ? U.value = o : null),
1636
- onKeydown: Ct(Be(Pe, ["prevent"]), ["enter"]),
2036
+ e("div", va, [
2037
+ Ct(e("textarea", {
2038
+ "onUpdate:modelValue": o[5] || (o[5] = (l) => Re(U) ? U.value = l : null),
2039
+ onKeydown: xt(Fe(Ne, ["prevent"]), ["enter"]),
1637
2040
  onPaste: ot,
1638
2041
  placeholder: "输入消息或粘贴文件...",
1639
2042
  class: "message-input-textarea",
1640
2043
  rows: "3"
1641
- }, null, 40, oa), [
1642
- [xt, c(U)]
2044
+ }, null, 40, pa), [
2045
+ [Ut, u(U)]
1643
2046
  ])
1644
2047
  ]),
1645
- e("div", ra, [
1646
- m(T, {
2048
+ e("div", ma, [
2049
+ m(j, {
1647
2050
  type: "primary",
1648
- disabled: !c(U).trim() && j.value.length === 0,
1649
- onClick: Pe,
2051
+ disabled: !u(U).trim() && ae.value.length === 0,
2052
+ onClick: Ne,
1650
2053
  class: "send-message-btn"
1651
2054
  }, {
1652
- default: k(() => [...r[19] || (r[19] = [
1653
- ue(" 发送 ", -1)
2055
+ default: k(() => [...o[21] || (o[21] = [
2056
+ me(" 发送 ", -1)
1654
2057
  ])]),
1655
2058
  _: 1
1656
2059
  }, 8, ["disabled"])
1657
2060
  ]),
1658
2061
  e("input", {
1659
2062
  ref_key: "fileInputRef",
1660
- ref: _e,
2063
+ ref: I,
1661
2064
  type: "file",
1662
2065
  multiple: "",
1663
2066
  class: "hidden-file-input",
1664
2067
  onChange: lt
1665
2068
  }, null, 544)
1666
2069
  ])
1667
- ])) : W.value ? S("", !0) : (a(), p("div", ca, [
1668
- m(u, {
2070
+ ])) : M.value ? S("", !0) : (a(), p("div", ha, [
2071
+ m(d, {
1669
2072
  size: 64,
1670
2073
  class: "empty-state-icon"
1671
2074
  }, {
1672
2075
  default: k(() => [
1673
- m(c(It))
2076
+ m(u(Mt))
1674
2077
  ]),
1675
2078
  _: 1
1676
2079
  }),
1677
- e("div", da, y(ae.value === "apply" ? "在左侧选择好友申请" : "在左侧选择好友开始聊天"), 1)
2080
+ e("div", fa, y(se.value === "apply" ? "在左侧选择好友申请" : "在左侧选择好友开始聊天"), 1)
1678
2081
  ]))
1679
2082
  ]),
1680
- ie.value ? (a(), p("div", ua, [
1681
- r[21] || (r[21] = e("div", { class: "chat-detail-header" }, "聊天详情", -1)),
1682
- e("div", va, [
1683
- e("div", pa, [
2083
+ Y.value ? (a(), p("div", ga, [
2084
+ o[23] || (o[23] = e("div", { class: "chat-detail-header" }, "聊天详情", -1)),
2085
+ e("div", ya, [
2086
+ e("div", _a, [
1684
2087
  e("img", {
1685
- src: (ke = D.value) == null ? void 0 : ke.avatar,
1686
- alt: (He = D.value) == null ? void 0 : He.name,
2088
+ src: (be = T.value) == null ? void 0 : be.avatar,
2089
+ alt: (je = T.value) == null ? void 0 : je.name,
1687
2090
  class: "chat-detail-avatar"
1688
- }, null, 8, ma),
1689
- e("div", fa, y((Ee = D.value) == null ? void 0 : Ee.name), 1),
1690
- r[20] || (r[20] = e("div", { class: "chat-detail-actions" }, [
2091
+ }, null, 8, ba),
2092
+ e("div", ka, y((Ee = T.value) == null ? void 0 : Ee.name), 1),
2093
+ o[22] || (o[22] = e("div", { class: "chat-detail-actions" }, [
1691
2094
  e("div", { class: "chat-detail-action-item" }, "查找聊天记录"),
1692
2095
  e("div", { class: "chat-detail-action-item" }, "清空聊天记录")
1693
2096
  ], -1))
1694
2097
  ])
1695
2098
  ])
1696
2099
  ])) : S("", !0),
1697
- m(re, {
1698
- modelValue: c(C),
1699
- "onUpdate:modelValue": r[6] || (r[6] = (o) => Ie(C) ? C.value = o : null),
2100
+ m(ce, {
2101
+ modelValue: u(x),
2102
+ "onUpdate:modelValue": o[8] || (o[8] = (l) => Re(x) ? x.value = l : null),
1700
2103
  title: "添加好友",
1701
2104
  width: "500px",
1702
2105
  "append-to-body": ""
1703
2106
  }, {
1704
2107
  default: k(() => [
1705
- e("div", ha, [
2108
+ e("div", wa, [
1706
2109
  m(s, {
1707
- modelValue: c(ge),
1708
- "onUpdate:modelValue": r[5] || (r[5] = (o) => Ie(ge) ? ge.value = o : null),
2110
+ modelValue: u(he),
2111
+ "onUpdate:modelValue": o[7] || (o[7] = (l) => Re(he) ? he.value = l : null),
1709
2112
  placeholder: "搜索用户",
1710
- "prefix-icon": c(qe),
2113
+ "prefix-icon": u(Ye),
1711
2114
  class: "add-friend-search-input"
1712
2115
  }, null, 8, ["modelValue", "prefix-icon"])
1713
2116
  ]),
1714
- e("div", ga, [
1715
- c(Ve) ? (a(), G(b, {
2117
+ e("div", Ca, [
2118
+ u(ze) ? (a(), Z(b, {
1716
2119
  key: 0,
1717
2120
  description: "加载中..."
1718
- })) : c(ce).length === 0 ? (a(), G(b, {
2121
+ })) : u(ve).length === 0 ? (a(), Z(b, {
1719
2122
  key: 1,
1720
2123
  description: "暂无用户"
1721
- })) : (a(!0), p(me, { key: 2 }, fe(c(ce), (o) => (a(), p("div", {
1722
- key: o.username,
2124
+ })) : (a(!0), p(de, { key: 2 }, ue(u(ve), (l) => (a(), p("div", {
2125
+ key: l.username,
1723
2126
  class: "add-friend-user-item"
1724
2127
  }, [
1725
- e("div", ya, [
2128
+ e("div", xa, [
1726
2129
  e("img", {
1727
- src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${o.username}`,
1728
- alt: o.username,
2130
+ src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${l.username}`,
2131
+ alt: l.username,
1729
2132
  class: "add-friend-user-avatar"
1730
- }, null, 8, _a),
1731
- e("div", ba, y(o.username), 1)
2133
+ }, null, 8, Ua),
2134
+ e("div", $a, y(l.username), 1)
1732
2135
  ]),
1733
- m(T, {
2136
+ m(j, {
1734
2137
  type: "primary",
1735
2138
  size: "small",
1736
- onClick: (ye) => c(L)(o)
2139
+ onClick: (fe) => u(W)(l)
1737
2140
  }, {
1738
- default: k(() => [...r[22] || (r[22] = [
1739
- ue("添加", -1)
2141
+ default: k(() => [...o[24] || (o[24] = [
2142
+ me("添加", -1)
1740
2143
  ])]),
1741
2144
  _: 1
1742
2145
  }, 8, ["onClick"])
@@ -1745,9 +2148,9 @@ const gt = (x, t) => {
1745
2148
  ]),
1746
2149
  _: 1
1747
2150
  }, 8, ["modelValue"]),
1748
- m(re, {
1749
- modelValue: ze.value,
1750
- "onUpdate:modelValue": r[11] || (r[11] = (o) => ze.value = o),
2151
+ m(ce, {
2152
+ modelValue: $e.value,
2153
+ "onUpdate:modelValue": o[13] || (o[13] = (l) => $e.value = l),
1751
2154
  title: "个人设置",
1752
2155
  width: "560px",
1753
2156
  "close-on-click-modal": !1,
@@ -1755,128 +2158,128 @@ const gt = (x, t) => {
1755
2158
  class: "chat-settings-dialog"
1756
2159
  }, {
1757
2160
  default: k(() => [
1758
- e("div", ka, [
1759
- e("div", wa, [
1760
- e("div", Ca, [
2161
+ e("div", Sa, [
2162
+ e("div", za, [
2163
+ e("div", Aa, [
1761
2164
  e("img", {
1762
- src: c(ee),
2165
+ src: u(O),
1763
2166
  alt: "头像",
1764
2167
  class: "chat-settings-avatar"
1765
- }, null, 8, xa),
1766
- x.config.modules.avatarCrop ? (a(), p("div", {
2168
+ }, null, 8, Fa),
2169
+ w.config.modules.avatarCrop ? (a(), p("div", {
1767
2170
  key: 0,
1768
2171
  class: "chat-settings-avatar-edit",
1769
2172
  onClick: nt
1770
2173
  }, [
1771
- m(u, {
2174
+ m(d, {
1772
2175
  size: 18,
1773
2176
  class: "chat-settings-avatar-icon"
1774
2177
  }, {
1775
2178
  default: k(() => [
1776
- m(c(Rt))
2179
+ m(u(It))
1777
2180
  ]),
1778
2181
  _: 1
1779
2182
  })
1780
2183
  ])) : S("", !0),
1781
2184
  e("input", {
1782
2185
  ref_key: "avatarInputRef",
1783
- ref: g,
2186
+ ref: r,
1784
2187
  type: "file",
1785
2188
  accept: "image/*",
1786
2189
  class: "hidden-avatar-input",
1787
- onChange: ct
2190
+ onChange: dt
1788
2191
  }, null, 544)
1789
2192
  ]),
1790
- e("div", Ua, [
1791
- e("div", $a, y(c(H).nickname || c($)), 1),
1792
- e("div", Sa, "@" + y(c($)), 1)
2193
+ e("div", Va, [
2194
+ e("div", Ra, y(u(H).nickname || u($)), 1),
2195
+ e("div", Ma, "@" + y(u($)), 1)
1793
2196
  ])
1794
2197
  ]),
1795
- e("div", za, [
1796
- e("div", Aa, [
1797
- e("div", Va, [
1798
- m(u, null, {
2198
+ e("div", Ia, [
2199
+ e("div", La, [
2200
+ e("div", Ta, [
2201
+ m(d, null, {
1799
2202
  default: k(() => [
1800
- m(c(Qe))
2203
+ m(u(Je))
1801
2204
  ]),
1802
2205
  _: 1
1803
2206
  }),
1804
- r[23] || (r[23] = ue(" 个人信息 ", -1))
2207
+ o[25] || (o[25] = me(" 个人信息 ", -1))
1805
2208
  ]),
1806
- le.value ? S("", !0) : (a(), G(T, {
2209
+ oe.value ? S("", !0) : (a(), Z(j, {
1807
2210
  key: 0,
1808
2211
  type: "primary",
1809
2212
  size: "small",
1810
- onClick: ut,
2213
+ onClick: vt,
1811
2214
  class: "chat-settings-edit-btn"
1812
2215
  }, {
1813
- default: k(() => [...r[24] || (r[24] = [
1814
- ue(" 编辑 ", -1)
2216
+ default: k(() => [...o[26] || (o[26] = [
2217
+ me(" 编辑 ", -1)
1815
2218
  ])]),
1816
2219
  _: 1
1817
2220
  }))
1818
2221
  ]),
1819
- e("div", Fa, [
1820
- e("div", Ia, [
1821
- r[25] || (r[25] = e("label", { class: "chat-settings-form-label" }, "昵称", -1)),
1822
- le.value ? (a(), G(s, {
2222
+ e("div", Ea, [
2223
+ e("div", Da, [
2224
+ o[27] || (o[27] = e("label", { class: "chat-settings-form-label" }, "昵称", -1)),
2225
+ oe.value ? (a(), Z(s, {
1823
2226
  key: 0,
1824
- modelValue: K.value.nickname,
1825
- "onUpdate:modelValue": r[7] || (r[7] = (o) => K.value.nickname = o),
2227
+ modelValue: P.value.nickname,
2228
+ "onUpdate:modelValue": o[9] || (o[9] = (l) => P.value.nickname = l),
1826
2229
  placeholder: "请输入昵称",
1827
2230
  size: "large"
1828
- }, null, 8, ["modelValue"])) : (a(), p("div", Ra, y(c(H).nickname || "未设置"), 1))
2231
+ }, null, 8, ["modelValue"])) : (a(), p("div", Wa, y(u(H).nickname || "未设置"), 1))
1829
2232
  ]),
1830
- e("div", Ma, [
1831
- r[26] || (r[26] = e("label", { class: "chat-settings-form-label" }, "邮箱", -1)),
1832
- le.value ? (a(), G(s, {
2233
+ e("div", ja, [
2234
+ o[28] || (o[28] = e("label", { class: "chat-settings-form-label" }, "邮箱", -1)),
2235
+ oe.value ? (a(), Z(s, {
1833
2236
  key: 0,
1834
- modelValue: K.value.email,
1835
- "onUpdate:modelValue": r[8] || (r[8] = (o) => K.value.email = o),
2237
+ modelValue: P.value.email,
2238
+ "onUpdate:modelValue": o[10] || (o[10] = (l) => P.value.email = l),
1836
2239
  placeholder: "请输入邮箱",
1837
2240
  size: "large"
1838
- }, null, 8, ["modelValue"])) : (a(), p("div", La, y(c(H).email || "未设置"), 1))
2241
+ }, null, 8, ["modelValue"])) : (a(), p("div", Ha, y(u(H).email || "未设置"), 1))
1839
2242
  ]),
1840
- e("div", Ta, [
1841
- r[27] || (r[27] = e("label", { class: "chat-settings-form-label" }, "手机号", -1)),
1842
- le.value ? (a(), G(s, {
2243
+ e("div", Xa, [
2244
+ o[29] || (o[29] = e("label", { class: "chat-settings-form-label" }, "手机号", -1)),
2245
+ oe.value ? (a(), Z(s, {
1843
2246
  key: 0,
1844
- modelValue: K.value.phone,
1845
- "onUpdate:modelValue": r[9] || (r[9] = (o) => K.value.phone = o),
2247
+ modelValue: P.value.phone,
2248
+ "onUpdate:modelValue": o[11] || (o[11] = (l) => P.value.phone = l),
1846
2249
  placeholder: "请输入手机号",
1847
2250
  size: "large"
1848
- }, null, 8, ["modelValue"])) : (a(), p("div", Ea, y(c(H).phone || "未设置"), 1))
2251
+ }, null, 8, ["modelValue"])) : (a(), p("div", Ya, y(u(H).phone || "未设置"), 1))
1849
2252
  ]),
1850
- e("div", Da, [
1851
- r[28] || (r[28] = e("label", { class: "chat-settings-form-label" }, "个人简介", -1)),
1852
- le.value ? (a(), G(s, {
2253
+ e("div", qa, [
2254
+ o[30] || (o[30] = e("label", { class: "chat-settings-form-label" }, "个人简介", -1)),
2255
+ oe.value ? (a(), Z(s, {
1853
2256
  key: 0,
1854
- modelValue: K.value.bio,
1855
- "onUpdate:modelValue": r[10] || (r[10] = (o) => K.value.bio = o),
2257
+ modelValue: P.value.bio,
2258
+ "onUpdate:modelValue": o[12] || (o[12] = (l) => P.value.bio = l),
1856
2259
  type: "textarea",
1857
2260
  rows: 4,
1858
2261
  placeholder: "介绍一下自己吧...",
1859
2262
  size: "large"
1860
- }, null, 8, ["modelValue"])) : (a(), p("div", Wa, y(c(H).bio || "这个人很懒,什么都没写~"), 1))
2263
+ }, null, 8, ["modelValue"])) : (a(), p("div", Ba, y(u(H).bio || "这个人很懒,什么都没写~"), 1))
1861
2264
  ]),
1862
- le.value ? (a(), p("div", Ha, [
1863
- m(T, {
2265
+ oe.value ? (a(), p("div", Na, [
2266
+ m(j, {
1864
2267
  size: "default",
1865
- onClick: vt
2268
+ onClick: pt
1866
2269
  }, {
1867
- default: k(() => [...r[29] || (r[29] = [
1868
- ue("取消", -1)
2270
+ default: k(() => [...o[31] || (o[31] = [
2271
+ me("取消", -1)
1869
2272
  ])]),
1870
2273
  _: 1
1871
2274
  }),
1872
- m(T, {
2275
+ m(j, {
1873
2276
  type: "primary",
1874
2277
  size: "default",
1875
- loading: oe.value,
1876
- onClick: pt
2278
+ loading: re.value,
2279
+ onClick: mt
1877
2280
  }, {
1878
- default: k(() => [...r[30] || (r[30] = [
1879
- ue("保存更改", -1)
2281
+ default: k(() => [...o[32] || (o[32] = [
2282
+ me("保存更改", -1)
1880
2283
  ])]),
1881
2284
  _: 1
1882
2285
  }, 8, ["loading"])
@@ -1888,15 +2291,15 @@ const gt = (x, t) => {
1888
2291
  _: 1
1889
2292
  }, 8, ["modelValue"]),
1890
2293
  m(yt, {
1891
- modelValue: i.value,
1892
- "onUpdate:modelValue": r[12] || (r[12] = (o) => i.value = o),
1893
- src: F.value,
1894
- onConfirm: dt
2294
+ modelValue: _e.value,
2295
+ "onUpdate:modelValue": o[14] || (o[14] = (l) => _e.value = l),
2296
+ src: _.value,
2297
+ onConfirm: ut
1895
2298
  }, null, 8, ["modelValue", "src"]),
1896
- O.value.visible ? (a(), p("div", {
2299
+ B.value.visible ? (a(), p("div", {
1897
2300
  key: 1,
1898
2301
  class: "chat-context-menu",
1899
- style: Xe({ left: O.value.x + "px", top: O.value.y + "px" })
2302
+ style: He({ left: B.value.x + "px", top: B.value.y + "px" })
1900
2303
  }, [
1901
2304
  e("div", {
1902
2305
  class: "chat-context-menu-item",
@@ -1906,61 +2309,61 @@ const gt = (x, t) => {
1906
2309
  ]);
1907
2310
  };
1908
2311
  }
1909
- }, Ya = /* @__PURE__ */ gt(Xa, [["__scopeId", "data-v-c08932e1"]]), qa = { class: "chat-container" }, Ba = { class: "sidebar-nav" }, Ka = ["src"], Na = ["onClick"], Pa = {
2312
+ }, Ka = /* @__PURE__ */ Ze(Pa, [["__scopeId", "data-v-4f950e86"]]), Oa = { class: "chat-container" }, Ga = { class: "sidebar-nav" }, Ja = ["src"], Qa = ["onClick"], Za = {
1910
2313
  key: 0,
1911
2314
  class: "nav-badge"
1912
- }, ja = { class: "content-panel" }, Oa = { class: "search-bar" }, Ga = { class: "content-scroll" }, Ja = { key: 0 }, Qa = ["onClick", "onContextmenu"], Za = { class: "friend-avatar-wrapper" }, en = ["src", "alt"], tn = {
2315
+ }, en = { class: "content-panel" }, tn = { class: "search-bar" }, sn = { class: "content-scroll" }, an = { key: 0 }, nn = ["onClick", "onContextmenu"], ln = { class: "friend-avatar-wrapper" }, on = ["src", "alt"], rn = {
1913
2316
  key: 0,
1914
2317
  class: "online-indicator"
1915
- }, sn = { class: "friend-info" }, an = { class: "friend-header" }, nn = { class: "friend-name" }, ln = { class: "last-time" }, on = { class: "friend-preview" }, rn = { class: "last-msg" }, cn = {
2318
+ }, cn = { class: "friend-info" }, dn = { class: "friend-header" }, un = { class: "friend-name" }, vn = { class: "last-time" }, pn = { class: "friend-preview" }, mn = { class: "last-msg" }, hn = {
1916
2319
  key: 0,
1917
2320
  class: "unread-badge"
1918
- }, dn = { key: 1 }, un = { class: "add-friend-section" }, vn = { class: "add-friend-icon" }, pn = ["onClick"], mn = { class: "friend-avatar-wrapper" }, fn = ["src", "alt"], hn = { class: "friend-info" }, gn = { class: "friend-name" }, yn = { key: 2 }, _n = { class: "request-info" }, bn = ["src", "alt"], kn = { class: "request-details" }, wn = { class: "request-username" }, Cn = { class: "chat-area" }, xn = {
2321
+ }, fn = { key: 1 }, gn = { class: "add-friend-section" }, yn = { class: "add-friend-icon" }, _n = ["onClick"], bn = { class: "friend-avatar-wrapper" }, kn = ["src", "alt"], wn = { class: "friend-info" }, Cn = { class: "friend-name" }, xn = { key: 2 }, Un = { class: "request-info" }, $n = ["src", "alt"], Sn = { class: "request-details" }, zn = { class: "request-username" }, An = { class: "chat-area" }, Fn = {
1919
2322
  key: 0,
1920
2323
  class: "friend-profile"
1921
- }, Un = ["src", "alt"], $n = { class: "profile-name" }, Sn = { class: "profile-status" }, zn = {
2324
+ }, Vn = ["src", "alt"], Rn = { class: "profile-name" }, Mn = { class: "profile-status" }, In = {
1922
2325
  key: 1,
1923
2326
  class: "chat-window"
1924
- }, An = { class: "chat-header" }, Vn = { class: "chat-title" }, Fn = { class: "chat-name" }, In = { class: "chat-actions" }, Rn = { class: "message-avatar" }, Mn = ["src"], Ln = {
2327
+ }, Ln = { class: "chat-header" }, Tn = { class: "chat-title" }, En = { class: "chat-name" }, Dn = { class: "chat-actions" }, Wn = { class: "message-avatar" }, jn = ["src"], Hn = {
1925
2328
  key: 0,
1926
2329
  class: "sender-name"
1927
- }, Tn = { class: "message-bubble-wrapper" }, En = ["onClick"], Dn = ["src", "alt"], Wn = {
2330
+ }, Xn = { class: "message-bubble-wrapper" }, Yn = ["onClick"], qn = ["src", "alt"], Bn = {
1928
2331
  key: 0,
1929
2332
  class: "image-size"
1930
- }, Hn = ["onClick"], Xn = { class: "file-content" }, Yn = { class: "file-icon" }, qn = { class: "file-info" }, Bn = { class: "file-name" }, Kn = { class: "file-meta" }, Nn = { key: 0 }, Pn = { class: "input-area" }, jn = {
2333
+ }, Nn = ["onClick"], Pn = { class: "file-content" }, Kn = { class: "file-icon" }, On = { class: "file-info" }, Gn = { class: "file-name" }, Jn = { class: "file-meta" }, Qn = { key: 0 }, Zn = {
1931
2334
  key: 0,
1932
2335
  class: "pending-files"
1933
- }, On = {
2336
+ }, ei = {
1934
2337
  key: 0,
1935
2338
  class: "pending-image-wrapper"
1936
- }, Gn = ["src", "alt"], Jn = ["onClick"], Qn = {
2339
+ }, ti = ["src", "alt"], si = ["onClick"], ai = {
1937
2340
  key: 1,
1938
2341
  class: "pending-file-wrapper"
1939
- }, Zn = { class: "pending-file-name" }, ei = ["onClick"], ti = {
2342
+ }, ni = { class: "pending-file-name" }, ii = ["onClick"], li = {
1940
2343
  key: 1,
1941
2344
  class: "input-actions"
1942
- }, si = { class: "input-wrapper" }, ai = ["onKeydown"], ni = { class: "send-btn-wrapper" }, ii = {
2345
+ }, oi = { class: "emoji-button-wrapper" }, ri = { class: "input-wrapper" }, ci = ["onKeydown"], di = { class: "send-btn-wrapper" }, ui = {
1943
2346
  key: 2,
1944
2347
  class: "empty-state"
1945
- }, li = { class: "empty-text" }, oi = {
2348
+ }, vi = { class: "empty-text" }, pi = {
1946
2349
  key: 0,
1947
2350
  class: "detail-panel"
1948
- }, ri = { class: "detail-content" }, ci = { class: "detail-profile" }, di = ["src", "alt"], ui = { class: "detail-name" }, vi = { class: "search-users-wrapper" }, pi = { class: "search-users-input" }, mi = { class: "users-list-scroll" }, fi = { class: "available-user-info" }, hi = ["src", "alt"], gi = { class: "available-user-name" }, yi = { class: "settings-container" }, _i = { class: "settings-avatar-section" }, bi = { class: "settings-avatar-wrapper" }, ki = ["src"], wi = { class: "settings-user-display" }, Ci = { class: "settings-nickname" }, xi = { class: "settings-username" }, Ui = { class: "settings-form-section" }, $i = { class: "settings-form-header" }, Si = { class: "settings-form-title" }, zi = { class: "settings-form" }, Ai = { class: "settings-form-item" }, Vi = {
2351
+ }, mi = { class: "detail-content" }, hi = { class: "detail-profile" }, fi = ["src", "alt"], gi = { class: "detail-name" }, yi = { class: "search-users-wrapper" }, _i = { class: "search-users-input" }, bi = { class: "users-list-scroll" }, ki = { class: "available-user-info" }, wi = ["src", "alt"], Ci = { class: "available-user-name" }, xi = { class: "settings-container" }, Ui = { class: "settings-avatar-section" }, $i = { class: "settings-avatar-wrapper" }, Si = ["src"], zi = { class: "settings-user-display" }, Ai = { class: "settings-nickname" }, Fi = { class: "settings-username" }, Vi = { class: "settings-form-section" }, Ri = { class: "settings-form-header" }, Mi = { class: "settings-form-title" }, Ii = { class: "settings-form" }, Li = { class: "settings-form-item" }, Ti = {
1949
2352
  key: 1,
1950
2353
  class: "settings-form-value"
1951
- }, Fi = { class: "settings-form-item" }, Ii = {
2354
+ }, Ei = { class: "settings-form-item" }, Di = {
1952
2355
  key: 1,
1953
2356
  class: "settings-form-value"
1954
- }, Ri = { class: "settings-form-item" }, Mi = {
2357
+ }, Wi = { class: "settings-form-item" }, ji = {
1955
2358
  key: 1,
1956
2359
  class: "settings-form-value"
1957
- }, Li = { class: "settings-form-item" }, Ti = {
2360
+ }, Hi = { class: "settings-form-item" }, Xi = {
1958
2361
  key: 1,
1959
2362
  class: "settings-form-value bio-value"
1960
- }, Ei = {
2363
+ }, Yi = {
1961
2364
  key: 0,
1962
2365
  class: "settings-form-actions"
1963
- }, Di = {
2366
+ }, qi = {
1964
2367
  __name: "ChatWindow",
1965
2368
  props: {
1966
2369
  modelValue: { type: Boolean, default: !1 },
@@ -1968,376 +2371,376 @@ const gt = (x, t) => {
1968
2371
  width: { type: [String, Number], default: "1100px" }
1969
2372
  },
1970
2373
  emits: ["update:modelValue", "open", "close", "message", "send", "error"],
1971
- setup(x, { emit: t }) {
1972
- const n = x, v = t, $ = we({
2374
+ setup(w, { emit: t }) {
2375
+ const n = w, v = t, $ = ke({
1973
2376
  get: () => n.modelValue,
1974
- set: (u) => v("update:modelValue", u)
2377
+ set: (d) => v("update:modelValue", d)
1975
2378
  }), {
1976
- myUsername: ee,
2379
+ myUsername: O,
1977
2380
  myAvatar: H,
1978
- userInfo: Z,
1979
- loadingUserInfo: X,
1980
- friendList: ve,
1981
- filteredFriendList: V,
2381
+ userInfo: G,
2382
+ loadingUserInfo: V,
2383
+ friendList: ie,
2384
+ filteredFriendList: R,
1982
2385
  searchText: U,
1983
2386
  inputText: A,
1984
2387
  messagesContainer: f,
1985
- filteredUsers: ce,
1986
- filteredAvailableUsers: Ae,
1987
- currentUser: he,
1988
- currentMessages: C,
1989
- addFriendDialogVisible: ge,
1990
- addFriendSearchText: Ce,
1991
- availableUsers: Ve,
1992
- loadingAvailableUsers: xe,
1993
- friendApplyList: Se,
1994
- loadingFriendApply: Fe,
1995
- formatTime: Re,
2388
+ filteredUsers: ve,
2389
+ filteredAvailableUsers: Se,
2390
+ currentUser: ge,
2391
+ currentMessages: x,
2392
+ addFriendDialogVisible: he,
2393
+ addFriendSearchText: we,
2394
+ availableUsers: ze,
2395
+ loadingAvailableUsers: Ce,
2396
+ friendApplyList: Ue,
2397
+ loadingFriendApply: Ve,
2398
+ formatTime: Me,
1996
2399
  formatLastTime: De,
1997
2400
  scrollToBottom: We,
1998
- getFriendList: Me,
1999
- getChatHistory: w,
2401
+ getFriendList: Ie,
2402
+ getChatHistory: C,
2000
2403
  setFriendToChatStatus: z,
2001
- selectUser: Y,
2002
- sendMessage: I,
2003
- sendFile: R,
2004
- sendFilesAndText: M,
2005
- initWebSocket: E,
2006
- closeWebSocket: N,
2007
- reset: P,
2008
- openAddFriendDialog: L,
2009
- addFriend: q,
2404
+ selectUser: q,
2405
+ sendMessage: L,
2406
+ sendFile: E,
2407
+ sendFilesAndText: D,
2408
+ initWebSocket: X,
2409
+ closeWebSocket: J,
2410
+ reset: Q,
2411
+ openAddFriendDialog: W,
2412
+ addFriend: N,
2010
2413
  loadFriendApplyList: te,
2011
- agreeFriend: se,
2012
- updateMyAvatar: de,
2013
- getUserInfo: pe,
2014
- updateUserInfo: B
2015
- } = Lt(n.config), ae = we(() => {
2414
+ agreeFriend: ne,
2415
+ updateMyAvatar: le
2416
+ } = Tt(n.config), se = ke(() => {
2016
2417
  var s;
2017
- const u = [{ id: "chat", icon: Ye, badge: 0 }];
2018
- return n.config.modules.friends && u.push({ id: "friends", icon: Qe, badge: 0 }), n.config.modules.apply && u.push({ id: "apply", icon: Ut, badge: ((s = Se.value) == null ? void 0 : s.length) || 0 }), u;
2019
- }), ne = _("chat"), D = _(null), W = _(null), ie = _(null), le = _(!1), K = _(!1), oe = _({ nickname: "", email: "", phone: "", bio: "" }), ze = _(!1), i = _(!1), d = _(!1), g = _(!1), F = _(null), _e = _(""), j = _(null), O = _([]), Ue = _({ visible: !1, x: 0, y: 0, chat: null }), Le = () => {
2020
- Ue.value.visible = !1;
2418
+ const d = [{ id: "chat", icon: Xe, badge: 0 }];
2419
+ return n.config.modules.friends && d.push({ id: "friends", icon: Je, badge: 0 }), n.config.modules.apply && d.push({ id: "apply", icon: $t, badge: ((s = Ue.value) == null ? void 0 : s.length) || 0 }), d;
2420
+ }), F = g("chat"), T = g(null), M = g(null), Y = g(null), oe = g(!1), P = g(!1), re = g({ nickname: "", email: "", phone: "", bio: "" }), $e = g(!1), _e = g(!1), c = g(!1), r = g(!1), _ = g(null), I = g(""), ae = g(null), B = g([]), pe = g({ visible: !1, x: 0, y: 0, chat: null }), Ae = g(!1), Le = () => {
2421
+ pe.value.visible = !1;
2021
2422
  }, et = async () => {
2022
- if (!Ue.value.chat) return;
2023
- await z(Ue.value.chat.id, 0) && D.value === Ue.value.chat.id && (D.value = null, W.value = null), Le();
2024
- }, Te = (u) => {
2025
- D.value = u.id, W.value = u, ie.value = null, le.value = !1, Y({
2026
- id: u.id,
2027
- name: u.name,
2028
- avatar: u.avatar,
2029
- online: u.online
2423
+ if (!pe.value.chat) return;
2424
+ await z(pe.value.chat.id, 0) && T.value === pe.value.chat.id && (T.value = null, M.value = null), Le();
2425
+ }, Te = (d) => {
2426
+ T.value = d.id, M.value = d, Y.value = null, oe.value = !1, q({
2427
+ id: d.id,
2428
+ name: d.name,
2429
+ avatar: d.avatar,
2430
+ online: d.online
2030
2431
  });
2031
- }, tt = (u) => {
2032
- ie.value = u, D.value = null, W.value = null;
2432
+ }, tt = (d) => {
2433
+ Y.value = d, T.value = null, M.value = null;
2033
2434
  }, st = async () => {
2034
- if (!ie.value) return;
2035
- if (await z(ie.value.id)) {
2036
- ne.value = "chat", await Oe();
2037
- const s = ce.value.find((b) => b.id === ie.value.id);
2038
- s && Te(s), ie.value = null;
2435
+ if (!Y.value) return;
2436
+ if (await z(Y.value.id)) {
2437
+ F.value = "chat", await Ke();
2438
+ const s = ve.value.find((b) => b.id === Y.value.id);
2439
+ s && Te(s), Y.value = null;
2039
2440
  }
2040
2441
  }, at = () => {
2041
- i.value = !0;
2442
+ _e.value = !0;
2042
2443
  }, nt = () => {
2043
- var u;
2044
- (u = F.value) == null || u.click();
2444
+ var d;
2445
+ (d = _.value) == null || d.click();
2045
2446
  }, it = () => {
2046
- var u;
2047
- (u = j.value) == null || u.click();
2048
- }, lt = (u) => {
2049
- const s = Array.from(u.target.files || []);
2447
+ var d;
2448
+ (d = ae.value) == null || d.click();
2449
+ }, lt = (d) => {
2450
+ const s = Array.from(d.target.files || []);
2050
2451
  if (s.length !== 0) {
2051
2452
  for (const b of s) {
2052
2453
  if (b.size > 50 * 1024 * 1024) {
2053
- Q.warning(`文件 ${b.name} 超过50MB,已跳过`);
2454
+ ee.warning(`文件 ${b.name} 超过50MB,已跳过`);
2054
2455
  continue;
2055
2456
  }
2056
- const T = URL.createObjectURL(b);
2057
- O.value.push({
2457
+ const j = URL.createObjectURL(b);
2458
+ B.value.push({
2058
2459
  id: Date.now() + Math.random(),
2059
2460
  file: b,
2060
2461
  name: b.name,
2061
2462
  size: b.size,
2062
2463
  type: b.type,
2063
- previewUrl: T,
2464
+ previewUrl: j,
2064
2465
  isImage: b.type.startsWith("image/")
2065
2466
  });
2066
2467
  }
2067
- j.value && (j.value.value = "");
2468
+ ae.value && (ae.value.value = "");
2068
2469
  }
2069
- }, Ke = (u) => {
2070
- const s = O.value[u];
2071
- s.previewUrl && URL.revokeObjectURL(s.previewUrl), O.value.splice(u, 1);
2072
- }, Ne = (u) => {
2073
- if (u === 0) return "0 B";
2074
- const s = 1024, b = ["B", "KB", "MB", "GB"], T = Math.floor(Math.log(u) / Math.log(s));
2075
- return parseFloat((u / Math.pow(s, T)).toFixed(2)) + " " + b[T];
2076
- }, Pe = async () => {
2077
- if (!A.value.trim() && O.value.length === 0) return;
2078
- const u = [...O.value], s = A.value;
2079
- A.value = "", O.value.forEach((b) => {
2470
+ }, qe = (d) => {
2471
+ const s = B.value[d];
2472
+ s.previewUrl && URL.revokeObjectURL(s.previewUrl), B.value.splice(d, 1);
2473
+ }, Be = (d) => {
2474
+ if (d === 0) return "0 B";
2475
+ const s = 1024, b = ["B", "KB", "MB", "GB"], j = Math.floor(Math.log(d) / Math.log(s));
2476
+ return parseFloat((d / Math.pow(s, j)).toFixed(2)) + " " + b[j];
2477
+ }, Ne = async () => {
2478
+ if (!A.value.trim() && B.value.length === 0) return;
2479
+ const d = [...B.value], s = A.value;
2480
+ A.value = "", B.value.forEach((b) => {
2080
2481
  b.previewUrl && URL.revokeObjectURL(b.previewUrl);
2081
- }), O.value = [], await M(u, s), v("send", { text: s, files: u });
2082
- }, ot = (u) => {
2482
+ }), B.value = [], await D(d, s), v("send", { text: s, files: d });
2483
+ }, ot = (d) => {
2083
2484
  var b;
2084
- const s = (b = u.clipboardData) == null ? void 0 : b.items;
2485
+ const s = (b = d.clipboardData) == null ? void 0 : b.items;
2085
2486
  if (s) {
2086
- for (const T of s)
2087
- if (T.kind === "file") {
2088
- const re = T.getAsFile();
2089
- if (re) {
2090
- if (re.size > 50 * 1024 * 1024) {
2091
- Q.warning(`文件 ${re.name} 超过50MB,已跳过`);
2487
+ for (const j of s)
2488
+ if (j.kind === "file") {
2489
+ const ce = j.getAsFile();
2490
+ if (ce) {
2491
+ if (ce.size > 50 * 1024 * 1024) {
2492
+ ee.warning(`文件 ${ce.name} 超过50MB,已跳过`);
2092
2493
  continue;
2093
2494
  }
2094
- const ke = URL.createObjectURL(re);
2095
- O.value.push({
2495
+ const be = URL.createObjectURL(ce);
2496
+ B.value.push({
2096
2497
  id: Date.now() + Math.random(),
2097
- file: re,
2098
- name: re.name,
2099
- size: re.size,
2100
- type: re.type,
2101
- previewUrl: ke,
2102
- isImage: re.type.startsWith("image/")
2498
+ file: ce,
2499
+ name: ce.name,
2500
+ size: ce.size,
2501
+ type: ce.type,
2502
+ previewUrl: be,
2503
+ isImage: ce.type.startsWith("image/")
2103
2504
  });
2104
2505
  }
2105
2506
  }
2106
2507
  }
2107
- }, je = (u) => {
2108
- if (!u) {
2109
- Q.warning("文件地址无效");
2508
+ }, Pe = (d) => {
2509
+ if (!d) {
2510
+ ee.warning("文件地址无效");
2110
2511
  return;
2111
2512
  }
2112
- window.open(u, "_blank");
2113
- }, rt = (u) => {
2114
- console.warn("图片加载失败", u);
2115
- }, ct = (u) => {
2116
- const s = u.target.files[0];
2513
+ window.open(d, "_blank");
2514
+ }, rt = (d) => {
2515
+ console.warn("图片加载失败", d);
2516
+ }, ct = (d) => {
2517
+ A.value += d, Ae.value = !1;
2518
+ }, dt = (d) => {
2519
+ const s = d.target.files[0];
2117
2520
  if (!s) return;
2118
2521
  if (!s.type.startsWith("image/")) {
2119
- Q.error("只能上传图片文件");
2522
+ ee.error("只能上传图片文件");
2120
2523
  return;
2121
2524
  }
2122
2525
  if (s.size > 5 * 1024 * 1024) {
2123
- Q.error("图片大小不能超过 5MB");
2526
+ ee.error("图片大小不能超过 5MB");
2124
2527
  return;
2125
2528
  }
2126
2529
  const b = new FileReader();
2127
- b.onload = (T) => {
2128
- _e.value = T.target.result, d.value = !0;
2530
+ b.onload = (j) => {
2531
+ I.value = j.target.result, c.value = !0;
2129
2532
  }, b.readAsDataURL(s);
2130
- }, dt = async ({ file: u }) => {
2131
- if (u) {
2132
- g.value = !0;
2533
+ }, ut = async ({ file: d }) => {
2534
+ if (d) {
2535
+ r.value = !0;
2133
2536
  try {
2134
- const { ChatApi: s } = await Promise.resolve().then(() => Mt), T = await new s(n.config).uploadAvatar(u, ee);
2135
- T.code === 200 ? (Q.success("头像上传成功"), de(T.data), Ge()) : Q.error(T.msg || "头像上传失败");
2537
+ const { ChatApi: s } = await Promise.resolve().then(() => Lt), j = await new s(n.config).uploadAvatar(d, O);
2538
+ j.code === 200 ? (ee.success("头像上传成功"), le(j.data), Oe()) : ee.error(j.msg || "头像上传失败");
2136
2539
  } catch (s) {
2137
- console.error(s), Q.error("头像上传失败");
2540
+ console.error(s), ee.error("头像上传失败");
2138
2541
  } finally {
2139
- g.value = !1;
2542
+ r.value = !1;
2140
2543
  }
2141
2544
  }
2142
- }, Ge = () => {
2143
- _e.value = "", d.value = !1, F.value && (F.value.value = "");
2144
- }, ut = () => {
2145
- oe.value = {
2146
- nickname: Z.value.nickname || "",
2147
- email: Z.value.email || "",
2148
- phone: Z.value.phone || "",
2149
- bio: Z.value.bio || ""
2150
- }, K.value = !0;
2545
+ }, Oe = () => {
2546
+ I.value = "", c.value = !1, _.value && (_.value.value = "");
2151
2547
  }, vt = () => {
2152
- K.value = !1, oe.value = { nickname: "", email: "", phone: "", bio: "" };
2153
- }, pt = async () => {
2154
- ze.value = !0;
2548
+ re.value = {
2549
+ nickname: G.value.nickname || "",
2550
+ email: G.value.email || "",
2551
+ phone: G.value.phone || "",
2552
+ bio: G.value.bio || ""
2553
+ }, P.value = !0;
2554
+ }, pt = () => {
2555
+ P.value = !1, re.value = { nickname: "", email: "", phone: "", bio: "" };
2556
+ }, mt = async () => {
2557
+ $e.value = !0;
2155
2558
  try {
2156
- await B(oe.value) ? (Q.success("保存成功"), K.value = !1) : Q.error("保存失败");
2157
- } catch (u) {
2158
- console.error(u), Q.error("保存失败");
2559
+ await updateUserInfo(re.value) ? (ee.success("保存成功"), P.value = !1) : ee.error("保存失败");
2560
+ } catch (d) {
2561
+ console.error(d), ee.error("保存失败");
2159
2562
  } finally {
2160
- ze.value = !1;
2563
+ $e.value = !1;
2161
2564
  }
2162
2565
  }, h = () => {
2163
- P(), N(), le.value = !1, i.value = !1, Ge(), K.value = !1, v("close");
2164
- }, r = async () => {
2165
- await Promise.all([Me(), te(), pe()]), E(), ce.value.length > 0 && Te(ce.value[0]), v("open");
2566
+ Q(), J(), oe.value = !1, _e.value = !1, Oe(), P.value = !1, v("close");
2567
+ }, o = async () => {
2568
+ await Promise.all([Ie(), te()]), X(), ve.value.length > 0 && Te(ve.value[0]), v("open");
2166
2569
  };
2167
- return _t(() => {
2570
+ return bt(() => {
2168
2571
  document.addEventListener("click", Le);
2169
- }), bt(() => {
2170
- document.removeEventListener("click", Le), N();
2171
- }), (u, s) => {
2172
- const b = be("el-icon"), T = be("el-input"), re = be("el-empty"), ke = be("el-button"), He = be("el-dialog");
2173
- return a(), G(He, {
2572
+ }), kt(() => {
2573
+ document.removeEventListener("click", Le), J();
2574
+ }), (d, s) => {
2575
+ const b = ye("el-icon"), j = ye("el-input"), ce = ye("el-empty"), be = ye("el-button"), je = ye("el-dialog");
2576
+ return a(), Z(je, {
2174
2577
  modelValue: $.value,
2175
- "onUpdate:modelValue": s[13] || (s[13] = (Ee) => $.value = Ee),
2176
- width: x.width,
2578
+ "onUpdate:modelValue": s[15] || (s[15] = (Ee) => $.value = Ee),
2579
+ width: w.width,
2177
2580
  "close-on-click-modal": !1,
2178
2581
  class: "chat-dialog",
2179
2582
  "append-to-body": "",
2180
2583
  onClosed: h,
2181
- onOpen: r
2584
+ onOpen: o
2182
2585
  }, {
2183
2586
  default: k(() => {
2184
- var Ee, o, ye;
2587
+ var Ee, l, fe;
2185
2588
  return [
2186
- e("div", qa, [
2187
- e("div", Ba, [
2589
+ e("div", Oa, [
2590
+ e("div", Ga, [
2188
2591
  e("div", {
2189
2592
  class: "sidebar-avatar",
2190
2593
  onClick: at
2191
2594
  }, [
2192
2595
  e("img", {
2193
- src: c(H),
2596
+ src: u(H),
2194
2597
  alt: "头像",
2195
2598
  class: "avatar-img"
2196
- }, null, 8, Ka)
2599
+ }, null, 8, Ja)
2197
2600
  ]),
2198
- (a(!0), p(me, null, fe(ae.value, (l) => (a(), p("div", {
2199
- key: l.id,
2200
- class: J([
2601
+ (a(!0), p(de, null, ue(se.value, (i) => (a(), p("div", {
2602
+ key: i.id,
2603
+ class: K([
2201
2604
  "nav-item",
2202
- ne.value === l.id ? "nav-item-active" : "nav-item-inactive"
2605
+ F.value === i.id ? "nav-item-active" : "nav-item-inactive"
2203
2606
  ]),
2204
- onClick: ($e) => ne.value = l.id
2607
+ onClick: (xe) => F.value = i.id
2205
2608
  }, [
2206
2609
  m(b, { size: 24 }, {
2207
2610
  default: k(() => [
2208
- (a(), G(kt(l.icon)))
2611
+ (a(), Z(wt(i.icon)))
2209
2612
  ]),
2210
2613
  _: 2
2211
2614
  }, 1024),
2212
- l.badge ? (a(), p("span", Pa, y(l.badge > 99 ? "99+" : l.badge), 1)) : S("", !0)
2213
- ], 10, Na))), 128)),
2214
- s[14] || (s[14] = e("div", { class: "nav-spacer" }, null, -1)),
2215
- x.config.modules.settings ? (a(), p("div", {
2615
+ i.badge ? (a(), p("span", Za, y(i.badge > 99 ? "99+" : i.badge), 1)) : S("", !0)
2616
+ ], 10, Qa))), 128)),
2617
+ s[16] || (s[16] = e("div", { class: "nav-spacer" }, null, -1)),
2618
+ w.config.modules.settings ? (a(), p("div", {
2216
2619
  key: 0,
2217
2620
  class: "nav-item nav-item-inactive",
2218
- onClick: s[0] || (s[0] = (l) => i.value = !0),
2621
+ onClick: s[0] || (s[0] = (i) => _e.value = !0),
2219
2622
  title: "设置"
2220
2623
  }, [
2221
2624
  m(b, { size: 24 }, {
2222
2625
  default: k(() => [
2223
- m(c($t))
2626
+ m(u(St))
2224
2627
  ]),
2225
2628
  _: 1
2226
2629
  })
2227
2630
  ])) : S("", !0)
2228
2631
  ]),
2229
- e("div", ja, [
2230
- e("div", Oa, [
2231
- m(T, {
2232
- modelValue: c(U),
2233
- "onUpdate:modelValue": s[1] || (s[1] = (l) => Ie(U) ? U.value = l : null),
2632
+ e("div", en, [
2633
+ e("div", tn, [
2634
+ m(j, {
2635
+ modelValue: u(U),
2636
+ "onUpdate:modelValue": s[1] || (s[1] = (i) => Re(U) ? U.value = i : null),
2234
2637
  placeholder: "搜索",
2235
- "prefix-icon": c(qe)
2638
+ "prefix-icon": u(Ye)
2236
2639
  }, null, 8, ["modelValue", "prefix-icon"])
2237
2640
  ]),
2238
- e("div", Ga, [
2239
- ne.value === "chat" ? (a(), p("div", Ja, [
2240
- (a(!0), p(me, null, fe(c(ce), (l) => (a(), p("div", {
2241
- key: l.id,
2242
- class: J([
2641
+ e("div", sn, [
2642
+ F.value === "chat" ? (a(), p("div", an, [
2643
+ (a(!0), p(de, null, ue(u(ve), (i) => (a(), p("div", {
2644
+ key: i.id,
2645
+ class: K([
2243
2646
  "chat-item",
2244
- D.value === l.id ? "chat-item-active" : ""
2647
+ T.value === i.id ? "chat-item-active" : ""
2245
2648
  ]),
2246
- onClick: ($e) => Te(l),
2247
- onContextmenu: Be(($e) => u.showContextMenu($e, l), ["prevent", "stop"])
2649
+ onClick: (xe) => Te(i),
2650
+ onContextmenu: Fe((xe) => d.showContextMenu(xe, i), ["prevent", "stop"])
2248
2651
  }, [
2249
- e("div", Za, [
2652
+ e("div", ln, [
2250
2653
  e("img", {
2251
- src: l.avatar,
2252
- alt: l.name,
2654
+ src: i.avatar,
2655
+ alt: i.name,
2253
2656
  class: "friend-avatar"
2254
- }, null, 8, en),
2255
- l.online ? (a(), p("span", tn)) : S("", !0)
2657
+ }, null, 8, on),
2658
+ i.online ? (a(), p("span", rn)) : S("", !0)
2256
2659
  ]),
2257
- e("div", sn, [
2258
- e("div", an, [
2259
- e("span", nn, y(l.name), 1),
2260
- e("span", ln, y(c(De)(l.lastTime)), 1)
2660
+ e("div", cn, [
2661
+ e("div", dn, [
2662
+ e("span", un, y(i.name), 1),
2663
+ e("span", vn, y(u(De)(i.lastTime)), 1)
2261
2664
  ]),
2262
- e("div", on, [
2263
- e("span", rn, y(l.lastMsg), 1),
2264
- l.unread > 0 ? (a(), p("span", cn, y(l.unread > 99 ? "99+" : l.unread), 1)) : S("", !0)
2665
+ e("div", pn, [
2666
+ e("span", mn, y(i.lastMsg), 1),
2667
+ i.unread > 0 ? (a(), p("span", hn, y(i.unread > 99 ? "99+" : i.unread), 1)) : S("", !0)
2265
2668
  ])
2266
2669
  ])
2267
- ], 42, Qa))), 128))
2670
+ ], 42, nn))), 128))
2268
2671
  ])) : S("", !0),
2269
- ne.value === "friends" && x.config.modules.friends ? (a(), p("div", dn, [
2270
- e("div", un, [
2672
+ F.value === "friends" && w.config.modules.friends ? (a(), p("div", fn, [
2673
+ e("div", gn, [
2271
2674
  e("div", {
2272
2675
  class: "add-friend-btn",
2273
- onClick: s[2] || (s[2] = (...l) => c(L) && c(L)(...l))
2676
+ onClick: s[2] || (s[2] = (...i) => u(W) && u(W)(...i))
2274
2677
  }, [
2275
- e("div", vn, [
2678
+ e("div", yn, [
2276
2679
  m(b, {
2277
2680
  class: "text-white",
2278
2681
  size: 20
2279
2682
  }, {
2280
2683
  default: k(() => [
2281
- m(c(St))
2684
+ m(u(zt))
2282
2685
  ]),
2283
2686
  _: 1
2284
2687
  })
2285
2688
  ]),
2286
- s[15] || (s[15] = e("span", { class: "add-friend-text" }, "添加好友", -1))
2689
+ s[17] || (s[17] = e("span", { class: "add-friend-text" }, "添加好友", -1))
2287
2690
  ])
2288
2691
  ]),
2289
- (a(!0), p(me, null, fe(c(V), (l) => (a(), p("div", {
2290
- key: l.id,
2692
+ (a(!0), p(de, null, ue(u(R), (i) => (a(), p("div", {
2693
+ key: i.id,
2291
2694
  class: "chat-item",
2292
- onClick: ($e) => tt(l)
2695
+ onClick: (xe) => tt(i)
2293
2696
  }, [
2294
- e("div", mn, [
2697
+ e("div", bn, [
2295
2698
  e("img", {
2296
- src: l.avatar,
2297
- alt: l.name,
2699
+ src: i.avatar,
2700
+ alt: i.name,
2298
2701
  class: "friend-avatar"
2299
- }, null, 8, fn),
2702
+ }, null, 8, kn),
2300
2703
  e("span", {
2301
- class: J([
2704
+ class: K([
2302
2705
  "online-indicator",
2303
- l.online ? "online" : "offline"
2706
+ i.online ? "online" : "offline"
2304
2707
  ])
2305
2708
  }, null, 2)
2306
2709
  ]),
2307
- e("div", hn, [
2308
- e("span", gn, y(l.name), 1)
2710
+ e("div", wn, [
2711
+ e("span", Cn, y(i.name), 1)
2309
2712
  ])
2310
- ], 8, pn))), 128))
2713
+ ], 8, _n))), 128))
2311
2714
  ])) : S("", !0),
2312
- ne.value === "apply" && x.config.modules.apply ? (a(), p("div", yn, [
2313
- c(Fe) ? (a(), G(re, {
2715
+ F.value === "apply" && w.config.modules.apply ? (a(), p("div", xn, [
2716
+ u(Ve) ? (a(), Z(ce, {
2314
2717
  key: 0,
2315
2718
  description: "加载中..."
2316
- })) : c(Se).length === 0 ? (a(), G(re, {
2719
+ })) : u(Ue).length === 0 ? (a(), Z(ce, {
2317
2720
  key: 1,
2318
2721
  description: "暂无好友申请"
2319
- })) : (a(!0), p(me, { key: 2 }, fe(c(Se), (l) => (a(), p("div", {
2320
- key: l.applyUser || l.id,
2722
+ })) : (a(!0), p(de, { key: 2 }, ue(u(Ue), (i) => (a(), p("div", {
2723
+ key: i.applyUser || i.id,
2321
2724
  class: "friend-request-item"
2322
2725
  }, [
2323
- e("div", _n, [
2726
+ e("div", Un, [
2324
2727
  e("img", {
2325
- src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${l.applyUser}`,
2326
- alt: l.applyUser,
2728
+ src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${i.applyUser}`,
2729
+ alt: i.applyUser,
2327
2730
  class: "request-avatar"
2328
- }, null, 8, bn),
2329
- e("div", kn, [
2330
- e("div", wn, y(l.applyUser), 1),
2331
- s[16] || (s[16] = e("div", { class: "request-desc" }, "请求添加你为好友", -1))
2731
+ }, null, 8, $n),
2732
+ e("div", Sn, [
2733
+ e("div", zn, y(i.applyUser), 1),
2734
+ s[18] || (s[18] = e("div", { class: "request-desc" }, "请求添加你为好友", -1))
2332
2735
  ])
2333
2736
  ]),
2334
- m(ke, {
2737
+ m(be, {
2335
2738
  type: "primary",
2336
2739
  size: "small",
2337
- onClick: ($e) => c(se)(l.applyUser)
2740
+ onClick: (xe) => u(ne)(i.applyUser)
2338
2741
  }, {
2339
- default: k(() => [...s[17] || (s[17] = [
2340
- ue("同意", -1)
2742
+ default: k(() => [...s[19] || (s[19] = [
2743
+ me("同意", -1)
2341
2744
  ])]),
2342
2745
  _: 1
2343
2746
  }, 8, ["onClick"])
@@ -2345,24 +2748,24 @@ const gt = (x, t) => {
2345
2748
  ])) : S("", !0)
2346
2749
  ])
2347
2750
  ]),
2348
- e("div", Cn, [
2349
- ie.value && !W.value ? (a(), p("div", xn, [
2751
+ e("div", An, [
2752
+ Y.value && !M.value ? (a(), p("div", Fn, [
2350
2753
  e("img", {
2351
- src: ie.value.avatar,
2352
- alt: ie.value.name,
2754
+ src: Y.value.avatar,
2755
+ alt: Y.value.name,
2353
2756
  class: "profile-avatar"
2354
- }, null, 8, Un),
2355
- e("div", $n, y(ie.value.name), 1),
2356
- e("div", Sn, [
2757
+ }, null, 8, Vn),
2758
+ e("div", Rn, y(Y.value.name), 1),
2759
+ e("div", Mn, [
2357
2760
  e("span", {
2358
- class: J([
2761
+ class: K([
2359
2762
  "status-dot",
2360
- ie.value.online ? "status-online" : "status-offline"
2763
+ Y.value.online ? "status-online" : "status-offline"
2361
2764
  ])
2362
2765
  }, null, 2),
2363
- e("span", null, y(ie.value.online ? "在线" : "离线"), 1)
2766
+ e("span", null, y(Y.value.online ? "在线" : "离线"), 1)
2364
2767
  ]),
2365
- m(ke, {
2768
+ m(be, {
2366
2769
  type: "primary",
2367
2770
  size: "large",
2368
2771
  onClick: st,
@@ -2371,39 +2774,39 @@ const gt = (x, t) => {
2371
2774
  default: k(() => [
2372
2775
  m(b, null, {
2373
2776
  default: k(() => [
2374
- m(c(Ye))
2777
+ m(u(Xe))
2375
2778
  ]),
2376
2779
  _: 1
2377
2780
  }),
2378
- s[18] || (s[18] = e("span", null, "发消息", -1))
2781
+ s[20] || (s[20] = e("span", null, "发消息", -1))
2379
2782
  ]),
2380
2783
  _: 1
2381
2784
  })
2382
2785
  ])) : S("", !0),
2383
- W.value ? (a(), p("div", zn, [
2384
- e("div", An, [
2385
- e("div", Vn, [
2386
- e("span", Fn, y(W.value.name), 1),
2786
+ M.value ? (a(), p("div", In, [
2787
+ e("div", Ln, [
2788
+ e("div", Tn, [
2789
+ e("span", En, y(M.value.name), 1),
2387
2790
  e("span", {
2388
- class: J([
2791
+ class: K([
2389
2792
  "status-badge",
2390
- W.value.online ? "status-badge-online" : "status-badge-offline"
2793
+ M.value.online ? "status-badge-online" : "status-badge-offline"
2391
2794
  ])
2392
- }, y(W.value.online ? "在线" : "离线"), 3)
2795
+ }, y(M.value.online ? "在线" : "离线"), 3)
2393
2796
  ]),
2394
- e("div", In, [
2797
+ e("div", Dn, [
2395
2798
  m(b, { class: "action-icon" }, {
2396
2799
  default: k(() => [
2397
- m(c(qe))
2800
+ m(u(Ye))
2398
2801
  ]),
2399
2802
  _: 1
2400
2803
  }),
2401
2804
  m(b, {
2402
2805
  class: "action-icon",
2403
- onClick: s[3] || (s[3] = (l) => le.value = !le.value)
2806
+ onClick: s[3] || (s[3] = (i) => oe.value = !oe.value)
2404
2807
  }, {
2405
2808
  default: k(() => [
2406
- m(c(zt))
2809
+ m(u(At))
2407
2810
  ]),
2408
2811
  _: 1
2409
2812
  })
@@ -2414,204 +2817,216 @@ const gt = (x, t) => {
2414
2817
  ref: f,
2415
2818
  class: "messages-container"
2416
2819
  }, [
2417
- (a(!0), p(me, null, fe(c(C), (l, $e) => (a(), p("div", {
2418
- key: $e,
2419
- class: J([
2820
+ (a(!0), p(de, null, ue(u(x), (i, xe) => (a(), p("div", {
2821
+ key: xe,
2822
+ class: K([
2420
2823
  "message-wrapper",
2421
- l.isSelf ? "message-self" : "message-other"
2824
+ i.isSelf ? "message-self" : "message-other"
2422
2825
  ])
2423
2826
  }, [
2424
- e("div", Rn, [
2827
+ e("div", Wn, [
2425
2828
  e("img", {
2426
- src: l.isSelf ? c(H) : W.value.avatar,
2829
+ src: i.isSelf ? u(H) : M.value.avatar,
2427
2830
  class: "avatar-sm"
2428
- }, null, 8, Mn)
2831
+ }, null, 8, jn)
2429
2832
  ]),
2430
2833
  e("div", {
2431
- class: J([
2834
+ class: K([
2432
2835
  "message-content-wrapper",
2433
- l.isSelf ? "content-self" : "content-other"
2836
+ i.isSelf ? "content-self" : "content-other"
2434
2837
  ])
2435
2838
  }, [
2436
- l.isSelf ? S("", !0) : (a(), p("div", Ln, y(W.value.name), 1)),
2437
- e("div", Tn, [
2438
- l.type === "text" ? (a(), p("div", {
2839
+ i.isSelf ? S("", !0) : (a(), p("div", Hn, y(M.value.name), 1)),
2840
+ e("div", Xn, [
2841
+ i.type === "text" ? (a(), p("div", {
2439
2842
  key: 0,
2440
- class: J([
2843
+ class: K([
2441
2844
  "message-bubble",
2442
- l.isSelf ? "bubble-self" : "bubble-other"
2845
+ i.isSelf ? "bubble-self" : "bubble-other"
2443
2846
  ])
2444
- }, y(l.text), 3)) : l.type === "file" && l.fileType === "image" ? (a(), p("div", {
2847
+ }, y(i.text), 3)) : i.type === "file" && i.fileType === "image" ? (a(), p("div", {
2445
2848
  key: 1,
2446
- class: J([
2849
+ class: K([
2447
2850
  "message-bubble",
2448
2851
  "image-bubble",
2449
- l.isSelf ? "bubble-self" : "bubble-other"
2852
+ i.isSelf ? "bubble-self" : "bubble-other"
2450
2853
  ]),
2451
- onClick: (mt) => je(l.fileUrl)
2854
+ onClick: (ht) => Pe(i.fileUrl)
2452
2855
  }, [
2453
2856
  e("img", {
2454
- src: l.fileUrl,
2455
- alt: l.fileName,
2857
+ src: i.fileUrl,
2858
+ alt: i.fileName,
2456
2859
  class: "message-image",
2457
2860
  onError: rt
2458
- }, null, 40, Dn),
2459
- l.fileSize ? (a(), p("div", Wn, y(Ne(l.fileSize)), 1)) : S("", !0)
2460
- ], 10, En)) : l.type === "file" ? (a(), p("div", {
2861
+ }, null, 40, qn),
2862
+ i.fileSize ? (a(), p("div", Bn, y(Be(i.fileSize)), 1)) : S("", !0)
2863
+ ], 10, Yn)) : i.type === "file" ? (a(), p("div", {
2461
2864
  key: 2,
2462
- class: J([
2865
+ class: K([
2463
2866
  "message-bubble",
2464
2867
  "file-bubble",
2465
- l.isSelf ? "bubble-self" : "bubble-other"
2868
+ i.isSelf ? "bubble-self" : "bubble-other"
2466
2869
  ]),
2467
- onClick: (mt) => je(l.fileUrl)
2870
+ onClick: (ht) => Pe(i.fileUrl)
2468
2871
  }, [
2469
- e("div", Xn, [
2470
- e("div", Yn, [
2872
+ e("div", Pn, [
2873
+ e("div", Kn, [
2471
2874
  m(b, { size: 28 }, {
2472
2875
  default: k(() => [
2473
- m(c(At))
2876
+ m(u(Ft))
2474
2877
  ]),
2475
2878
  _: 1
2476
2879
  })
2477
2880
  ]),
2478
- e("div", qn, [
2479
- e("div", Bn, y(l.fileName || l.text), 1),
2480
- e("div", Kn, [
2881
+ e("div", On, [
2882
+ e("div", Gn, y(i.fileName || i.text), 1),
2883
+ e("div", Jn, [
2481
2884
  m(b, { size: 12 }, {
2482
2885
  default: k(() => [
2483
- m(c(Vt))
2886
+ m(u(Vt))
2484
2887
  ]),
2485
2888
  _: 1
2486
2889
  }),
2487
- s[19] || (s[19] = e("span", null, "点击下载", -1)),
2488
- l.fileSize ? (a(), p("span", Nn, "· " + y(Ne(l.fileSize)), 1)) : S("", !0)
2890
+ s[21] || (s[21] = e("span", null, "点击下载", -1)),
2891
+ i.fileSize ? (a(), p("span", Qn, "· " + y(Be(i.fileSize)), 1)) : S("", !0)
2489
2892
  ])
2490
2893
  ])
2491
2894
  ])
2492
- ], 10, Hn)) : S("", !0),
2895
+ ], 10, Nn)) : S("", !0),
2493
2896
  e("div", {
2494
- class: J([
2897
+ class: K([
2495
2898
  "message-time",
2496
- l.isSelf ? "time-right" : "time-left"
2899
+ i.isSelf ? "time-right" : "time-left"
2497
2900
  ])
2498
- }, y(c(Re)(l.time)), 3)
2901
+ }, y(u(Me)(i.time)), 3)
2499
2902
  ])
2500
2903
  ], 2)
2501
2904
  ], 2))), 128))
2502
2905
  ], 512),
2503
- e("div", Pn, [
2504
- O.value.length > 0 ? (a(), p("div", jn, [
2505
- (a(!0), p(me, null, fe(O.value, (l, $e) => (a(), p("div", {
2506
- key: l.id,
2906
+ e("div", {
2907
+ class: "input-area",
2908
+ onClick: s[6] || (s[6] = (i) => Ae.value = !1)
2909
+ }, [
2910
+ B.value.length > 0 ? (a(), p("div", Zn, [
2911
+ (a(!0), p(de, null, ue(B.value, (i, xe) => (a(), p("div", {
2912
+ key: i.id,
2507
2913
  class: "pending-file"
2508
2914
  }, [
2509
- l.isImage ? (a(), p("div", On, [
2915
+ i.isImage ? (a(), p("div", ei, [
2510
2916
  e("img", {
2511
- src: l.previewUrl,
2512
- alt: l.name,
2917
+ src: i.previewUrl,
2918
+ alt: i.name,
2513
2919
  class: "pending-image"
2514
- }, null, 8, Gn),
2920
+ }, null, 8, ti),
2515
2921
  e("button", {
2516
- onClick: (mt) => Ke($e),
2922
+ onClick: (ht) => qe(xe),
2517
2923
  class: "remove-file-btn"
2518
- }, " × ", 8, Jn)
2519
- ])) : (a(), p("div", Qn, [
2924
+ }, " × ", 8, si)
2925
+ ])) : (a(), p("div", ai, [
2520
2926
  m(b, { class: "pending-file-icon" }, {
2521
2927
  default: k(() => [
2522
- m(c(Ze))
2928
+ m(u(Qe))
2523
2929
  ]),
2524
2930
  _: 1
2525
2931
  }),
2526
- e("span", Zn, y(l.name), 1),
2932
+ e("span", ni, y(i.name), 1),
2527
2933
  e("button", {
2528
- onClick: (mt) => Ke($e),
2934
+ onClick: (ht) => qe(xe),
2529
2935
  class: "remove-file-btn"
2530
- }, " × ", 8, ei)
2936
+ }, " × ", 8, ii)
2531
2937
  ]))
2532
2938
  ]))), 128))
2533
2939
  ])) : S("", !0),
2534
- x.config.modules.fileUpload ? (a(), p("div", ti, [
2535
- m(b, { class: "action-icon" }, {
2536
- default: k(() => [
2537
- m(c(Ye))
2538
- ]),
2539
- _: 1
2540
- }),
2940
+ w.config.modules.fileUpload ? (a(), p("div", li, [
2941
+ e("div", oi, [
2942
+ m(b, {
2943
+ class: "action-icon",
2944
+ onClick: s[4] || (s[4] = Fe((i) => Ae.value = !Ae.value, ["stop"]))
2945
+ }, {
2946
+ default: k(() => [
2947
+ m(u(Xe))
2948
+ ]),
2949
+ _: 1
2950
+ }),
2951
+ m(Et, {
2952
+ visible: Ae.value,
2953
+ onSelect: ct
2954
+ }, null, 8, ["visible"])
2955
+ ]),
2541
2956
  m(b, {
2542
2957
  class: "action-icon",
2543
2958
  onClick: it
2544
2959
  }, {
2545
2960
  default: k(() => [
2546
- m(c(Ze))
2961
+ m(u(Qe))
2547
2962
  ]),
2548
2963
  _: 1
2549
2964
  }),
2550
2965
  m(b, { class: "action-icon" }, {
2551
2966
  default: k(() => [
2552
- m(c(Ft))
2967
+ m(u(Rt))
2553
2968
  ]),
2554
2969
  _: 1
2555
2970
  })
2556
2971
  ])) : S("", !0),
2557
- e("div", si, [
2558
- wt(e("textarea", {
2559
- "onUpdate:modelValue": s[4] || (s[4] = (l) => Ie(A) ? A.value = l : null),
2560
- onKeydown: Ct(Be(Pe, ["prevent"]), ["enter"]),
2972
+ e("div", ri, [
2973
+ Ct(e("textarea", {
2974
+ "onUpdate:modelValue": s[5] || (s[5] = (i) => Re(A) ? A.value = i : null),
2975
+ onKeydown: xt(Fe(Ne, ["prevent"]), ["enter"]),
2561
2976
  onPaste: ot,
2562
2977
  placeholder: "输入消息或粘贴文件...",
2563
2978
  class: "message-input",
2564
2979
  rows: "3"
2565
- }, null, 40, ai), [
2566
- [xt, c(A)]
2980
+ }, null, 40, ci), [
2981
+ [Ut, u(A)]
2567
2982
  ])
2568
2983
  ]),
2569
- e("div", ni, [
2570
- m(ke, {
2984
+ e("div", di, [
2985
+ m(be, {
2571
2986
  type: "primary",
2572
- disabled: !c(A).trim() && O.value.length === 0,
2573
- onClick: Pe,
2987
+ disabled: !u(A).trim() && B.value.length === 0,
2988
+ onClick: Ne,
2574
2989
  class: "send-btn"
2575
2990
  }, {
2576
- default: k(() => [...s[20] || (s[20] = [
2577
- ue(" 发送 ", -1)
2991
+ default: k(() => [...s[22] || (s[22] = [
2992
+ me(" 发送 ", -1)
2578
2993
  ])]),
2579
2994
  _: 1
2580
2995
  }, 8, ["disabled"])
2581
2996
  ]),
2582
2997
  e("input", {
2583
2998
  ref_key: "fileInputRef",
2584
- ref: j,
2999
+ ref: ae,
2585
3000
  type: "file",
2586
3001
  multiple: "",
2587
3002
  class: "hidden-file-input",
2588
3003
  onChange: lt
2589
3004
  }, null, 544)
2590
3005
  ])
2591
- ])) : ie.value ? S("", !0) : (a(), p("div", ii, [
3006
+ ])) : Y.value ? S("", !0) : (a(), p("div", ui, [
2592
3007
  m(b, {
2593
3008
  size: 64,
2594
3009
  class: "empty-icon"
2595
3010
  }, {
2596
3011
  default: k(() => [
2597
- m(c(It))
3012
+ m(u(Mt))
2598
3013
  ]),
2599
3014
  _: 1
2600
3015
  }),
2601
- e("div", li, y(ne.value === "apply" ? "在左侧选择好友申请" : "在左侧选择好友开始聊天"), 1)
3016
+ e("div", vi, y(F.value === "apply" ? "在左侧选择好友申请" : "在左侧选择好友开始聊天"), 1)
2602
3017
  ]))
2603
3018
  ]),
2604
- le.value ? (a(), p("div", oi, [
2605
- s[22] || (s[22] = e("div", { class: "detail-header" }, "聊天详情", -1)),
2606
- e("div", ri, [
2607
- e("div", ci, [
3019
+ oe.value ? (a(), p("div", pi, [
3020
+ s[24] || (s[24] = e("div", { class: "detail-header" }, "聊天详情", -1)),
3021
+ e("div", mi, [
3022
+ e("div", hi, [
2608
3023
  e("img", {
2609
- src: (Ee = W.value) == null ? void 0 : Ee.avatar,
2610
- alt: (o = W.value) == null ? void 0 : o.name,
3024
+ src: (Ee = M.value) == null ? void 0 : Ee.avatar,
3025
+ alt: (l = M.value) == null ? void 0 : l.name,
2611
3026
  class: "detail-avatar"
2612
- }, null, 8, di),
2613
- e("div", ui, y((ye = W.value) == null ? void 0 : ye.name), 1),
2614
- s[21] || (s[21] = e("div", { class: "detail-actions" }, [
3027
+ }, null, 8, fi),
3028
+ e("div", gi, y((fe = M.value) == null ? void 0 : fe.name), 1),
3029
+ s[23] || (s[23] = e("div", { class: "detail-actions" }, [
2615
3030
  e("div", { class: "detail-action-item" }, "查找聊天记录"),
2616
3031
  e("div", { class: "detail-action-item" }, "清空聊天记录")
2617
3032
  ], -1))
@@ -2619,50 +3034,50 @@ const gt = (x, t) => {
2619
3034
  ])
2620
3035
  ])) : S("", !0)
2621
3036
  ]),
2622
- m(He, {
2623
- modelValue: c(ge),
2624
- "onUpdate:modelValue": s[6] || (s[6] = (l) => Ie(ge) ? ge.value = l : null),
3037
+ m(je, {
3038
+ modelValue: u(he),
3039
+ "onUpdate:modelValue": s[8] || (s[8] = (i) => Re(he) ? he.value = i : null),
2625
3040
  title: "添加好友",
2626
3041
  width: "500px",
2627
3042
  "append-to-body": ""
2628
3043
  }, {
2629
3044
  default: k(() => [
2630
- e("div", vi, [
2631
- e("div", pi, [
2632
- m(T, {
2633
- modelValue: c(Ce),
2634
- "onUpdate:modelValue": s[5] || (s[5] = (l) => Ie(Ce) ? Ce.value = l : null),
3045
+ e("div", yi, [
3046
+ e("div", _i, [
3047
+ m(j, {
3048
+ modelValue: u(we),
3049
+ "onUpdate:modelValue": s[7] || (s[7] = (i) => Re(we) ? we.value = i : null),
2635
3050
  placeholder: "搜索用户",
2636
- "prefix-icon": c(qe)
3051
+ "prefix-icon": u(Ye)
2637
3052
  }, null, 8, ["modelValue", "prefix-icon"])
2638
3053
  ])
2639
3054
  ]),
2640
- e("div", mi, [
2641
- c(xe) ? (a(), G(re, {
3055
+ e("div", bi, [
3056
+ u(Ce) ? (a(), Z(ce, {
2642
3057
  key: 0,
2643
3058
  description: "加载中..."
2644
- })) : c(Ae).length === 0 ? (a(), G(re, {
3059
+ })) : u(Se).length === 0 ? (a(), Z(ce, {
2645
3060
  key: 1,
2646
3061
  description: "暂无用户"
2647
- })) : (a(!0), p(me, { key: 2 }, fe(c(Ae), (l) => (a(), p("div", {
2648
- key: l.username,
3062
+ })) : (a(!0), p(de, { key: 2 }, ue(u(Se), (i) => (a(), p("div", {
3063
+ key: i.username,
2649
3064
  class: "available-user-item"
2650
3065
  }, [
2651
- e("div", fi, [
3066
+ e("div", ki, [
2652
3067
  e("img", {
2653
- src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${l.username}`,
2654
- alt: l.username,
3068
+ src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${i.username}`,
3069
+ alt: i.username,
2655
3070
  class: "available-user-avatar"
2656
- }, null, 8, hi),
2657
- e("div", gi, y(l.username), 1)
3071
+ }, null, 8, wi),
3072
+ e("div", Ci, y(i.username), 1)
2658
3073
  ]),
2659
- m(ke, {
3074
+ m(be, {
2660
3075
  type: "primary",
2661
3076
  size: "small",
2662
- onClick: ($e) => c(q)(l)
3077
+ onClick: (xe) => u(N)(i)
2663
3078
  }, {
2664
- default: k(() => [...s[23] || (s[23] = [
2665
- ue("添加", -1)
3079
+ default: k(() => [...s[25] || (s[25] = [
3080
+ me("添加", -1)
2666
3081
  ])]),
2667
3082
  _: 1
2668
3083
  }, 8, ["onClick"])
@@ -2671,9 +3086,9 @@ const gt = (x, t) => {
2671
3086
  ]),
2672
3087
  _: 1
2673
3088
  }, 8, ["modelValue"]),
2674
- m(He, {
2675
- modelValue: i.value,
2676
- "onUpdate:modelValue": s[11] || (s[11] = (l) => i.value = l),
3089
+ m(je, {
3090
+ modelValue: _e.value,
3091
+ "onUpdate:modelValue": s[13] || (s[13] = (i) => _e.value = i),
2677
3092
  title: "个人设置",
2678
3093
  width: "560px",
2679
3094
  "close-on-click-modal": !1,
@@ -2681,15 +3096,15 @@ const gt = (x, t) => {
2681
3096
  class: "settings-dialog"
2682
3097
  }, {
2683
3098
  default: k(() => [
2684
- e("div", yi, [
2685
- e("div", _i, [
2686
- e("div", bi, [
3099
+ e("div", xi, [
3100
+ e("div", Ui, [
3101
+ e("div", $i, [
2687
3102
  e("img", {
2688
- src: c(H),
3103
+ src: u(H),
2689
3104
  alt: "头像",
2690
3105
  class: "settings-avatar"
2691
- }, null, 8, ki),
2692
- x.config.modules.avatarCrop ? (a(), p("div", {
3106
+ }, null, 8, Si),
3107
+ w.config.modules.avatarCrop ? (a(), p("div", {
2693
3108
  key: 0,
2694
3109
  class: "settings-avatar-edit",
2695
3110
  onClick: nt
@@ -2699,110 +3114,110 @@ const gt = (x, t) => {
2699
3114
  class: "settings-avatar-icon"
2700
3115
  }, {
2701
3116
  default: k(() => [
2702
- m(c(Rt))
3117
+ m(u(It))
2703
3118
  ]),
2704
3119
  _: 1
2705
3120
  })
2706
3121
  ])) : S("", !0),
2707
3122
  e("input", {
2708
3123
  ref_key: "avatarInputRef",
2709
- ref: F,
3124
+ ref: _,
2710
3125
  type: "file",
2711
3126
  accept: "image/*",
2712
3127
  class: "hidden-avatar-input",
2713
- onChange: ct
3128
+ onChange: dt
2714
3129
  }, null, 544)
2715
3130
  ]),
2716
- e("div", wi, [
2717
- e("div", Ci, y(c(Z).nickname || c(ee)), 1),
2718
- e("div", xi, "@" + y(c(ee)), 1)
3131
+ e("div", zi, [
3132
+ e("div", Ai, y(u(G).nickname || u(O)), 1),
3133
+ e("div", Fi, "@" + y(u(O)), 1)
2719
3134
  ])
2720
3135
  ]),
2721
- e("div", Ui, [
2722
- e("div", $i, [
2723
- e("div", Si, [
3136
+ e("div", Vi, [
3137
+ e("div", Ri, [
3138
+ e("div", Mi, [
2724
3139
  m(b, null, {
2725
3140
  default: k(() => [
2726
- m(c(Qe))
3141
+ m(u(Je))
2727
3142
  ]),
2728
3143
  _: 1
2729
3144
  }),
2730
- s[24] || (s[24] = ue(" 个人信息 ", -1))
3145
+ s[26] || (s[26] = me(" 个人信息 ", -1))
2731
3146
  ]),
2732
- K.value ? S("", !0) : (a(), G(ke, {
3147
+ P.value ? S("", !0) : (a(), Z(be, {
2733
3148
  key: 0,
2734
3149
  type: "primary",
2735
3150
  size: "small",
2736
- onClick: ut,
3151
+ onClick: vt,
2737
3152
  class: "settings-edit-btn"
2738
3153
  }, {
2739
- default: k(() => [...s[25] || (s[25] = [
2740
- ue(" 编辑 ", -1)
3154
+ default: k(() => [...s[27] || (s[27] = [
3155
+ me(" 编辑 ", -1)
2741
3156
  ])]),
2742
3157
  _: 1
2743
3158
  }))
2744
3159
  ]),
2745
- e("div", zi, [
2746
- e("div", Ai, [
2747
- s[26] || (s[26] = e("label", { class: "settings-form-label" }, "昵称", -1)),
2748
- K.value ? (a(), G(T, {
3160
+ e("div", Ii, [
3161
+ e("div", Li, [
3162
+ s[28] || (s[28] = e("label", { class: "settings-form-label" }, "昵称", -1)),
3163
+ P.value ? (a(), Z(j, {
2749
3164
  key: 0,
2750
- modelValue: oe.value.nickname,
2751
- "onUpdate:modelValue": s[7] || (s[7] = (l) => oe.value.nickname = l),
3165
+ modelValue: re.value.nickname,
3166
+ "onUpdate:modelValue": s[9] || (s[9] = (i) => re.value.nickname = i),
2752
3167
  placeholder: "请输入昵称",
2753
3168
  size: "large"
2754
- }, null, 8, ["modelValue"])) : (a(), p("div", Vi, y(c(Z).nickname || "未设置"), 1))
3169
+ }, null, 8, ["modelValue"])) : (a(), p("div", Ti, y(u(G).nickname || "未设置"), 1))
2755
3170
  ]),
2756
- e("div", Fi, [
2757
- s[27] || (s[27] = e("label", { class: "settings-form-label" }, "邮箱", -1)),
2758
- K.value ? (a(), G(T, {
3171
+ e("div", Ei, [
3172
+ s[29] || (s[29] = e("label", { class: "settings-form-label" }, "邮箱", -1)),
3173
+ P.value ? (a(), Z(j, {
2759
3174
  key: 0,
2760
- modelValue: oe.value.email,
2761
- "onUpdate:modelValue": s[8] || (s[8] = (l) => oe.value.email = l),
3175
+ modelValue: re.value.email,
3176
+ "onUpdate:modelValue": s[10] || (s[10] = (i) => re.value.email = i),
2762
3177
  placeholder: "请输入邮箱",
2763
3178
  size: "large"
2764
- }, null, 8, ["modelValue"])) : (a(), p("div", Ii, y(c(Z).email || "未设置"), 1))
3179
+ }, null, 8, ["modelValue"])) : (a(), p("div", Di, y(u(G).email || "未设置"), 1))
2765
3180
  ]),
2766
- e("div", Ri, [
2767
- s[28] || (s[28] = e("label", { class: "settings-form-label" }, "手机号", -1)),
2768
- K.value ? (a(), G(T, {
3181
+ e("div", Wi, [
3182
+ s[30] || (s[30] = e("label", { class: "settings-form-label" }, "手机号", -1)),
3183
+ P.value ? (a(), Z(j, {
2769
3184
  key: 0,
2770
- modelValue: oe.value.phone,
2771
- "onUpdate:modelValue": s[9] || (s[9] = (l) => oe.value.phone = l),
3185
+ modelValue: re.value.phone,
3186
+ "onUpdate:modelValue": s[11] || (s[11] = (i) => re.value.phone = i),
2772
3187
  placeholder: "请输入手机号",
2773
3188
  size: "large"
2774
- }, null, 8, ["modelValue"])) : (a(), p("div", Mi, y(c(Z).phone || "未设置"), 1))
3189
+ }, null, 8, ["modelValue"])) : (a(), p("div", ji, y(u(G).phone || "未设置"), 1))
2775
3190
  ]),
2776
- e("div", Li, [
2777
- s[29] || (s[29] = e("label", { class: "settings-form-label" }, "个人简介", -1)),
2778
- K.value ? (a(), G(T, {
3191
+ e("div", Hi, [
3192
+ s[31] || (s[31] = e("label", { class: "settings-form-label" }, "个人简介", -1)),
3193
+ P.value ? (a(), Z(j, {
2779
3194
  key: 0,
2780
- modelValue: oe.value.bio,
2781
- "onUpdate:modelValue": s[10] || (s[10] = (l) => oe.value.bio = l),
3195
+ modelValue: re.value.bio,
3196
+ "onUpdate:modelValue": s[12] || (s[12] = (i) => re.value.bio = i),
2782
3197
  type: "textarea",
2783
3198
  rows: 4,
2784
3199
  placeholder: "介绍一下自己吧...",
2785
3200
  size: "large"
2786
- }, null, 8, ["modelValue"])) : (a(), p("div", Ti, y(c(Z).bio || "这个人很懒,什么都没写~"), 1))
3201
+ }, null, 8, ["modelValue"])) : (a(), p("div", Xi, y(u(G).bio || "这个人很懒,什么都没写~"), 1))
2787
3202
  ]),
2788
- K.value ? (a(), p("div", Ei, [
2789
- m(ke, {
3203
+ P.value ? (a(), p("div", Yi, [
3204
+ m(be, {
2790
3205
  size: "default",
2791
- onClick: vt
3206
+ onClick: pt
2792
3207
  }, {
2793
- default: k(() => [...s[30] || (s[30] = [
2794
- ue("取消", -1)
3208
+ default: k(() => [...s[32] || (s[32] = [
3209
+ me("取消", -1)
2795
3210
  ])]),
2796
3211
  _: 1
2797
3212
  }),
2798
- m(ke, {
3213
+ m(be, {
2799
3214
  type: "primary",
2800
3215
  size: "default",
2801
- loading: ze.value,
2802
- onClick: pt
3216
+ loading: $e.value,
3217
+ onClick: mt
2803
3218
  }, {
2804
- default: k(() => [...s[31] || (s[31] = [
2805
- ue("保存更改", -1)
3219
+ default: k(() => [...s[33] || (s[33] = [
3220
+ me("保存更改", -1)
2806
3221
  ])]),
2807
3222
  _: 1
2808
3223
  }, 8, ["loading"])
@@ -2814,15 +3229,15 @@ const gt = (x, t) => {
2814
3229
  _: 1
2815
3230
  }, 8, ["modelValue"]),
2816
3231
  m(yt, {
2817
- modelValue: d.value,
2818
- "onUpdate:modelValue": s[12] || (s[12] = (l) => d.value = l),
2819
- src: _e.value,
2820
- onConfirm: dt
3232
+ modelValue: c.value,
3233
+ "onUpdate:modelValue": s[14] || (s[14] = (i) => c.value = i),
3234
+ src: I.value,
3235
+ onConfirm: ut
2821
3236
  }, null, 8, ["modelValue", "src"]),
2822
- Ue.value.visible ? (a(), p("div", {
3237
+ pe.value.visible ? (a(), p("div", {
2823
3238
  key: 0,
2824
3239
  class: "context-menu",
2825
- style: Xe({ left: Ue.value.x + "px", top: Ue.value.y + "px" })
3240
+ style: He({ left: pe.value.x + "px", top: pe.value.y + "px" })
2826
3241
  }, [
2827
3242
  e("div", {
2828
3243
  class: "context-menu-item",
@@ -2835,7 +3250,7 @@ const gt = (x, t) => {
2835
3250
  }, 8, ["modelValue", "width"]);
2836
3251
  };
2837
3252
  }
2838
- }, Wi = /* @__PURE__ */ gt(Di, [["__scopeId", "data-v-a76a4ef3"]]), Hi = {
3253
+ }, Bi = /* @__PURE__ */ Ze(qi, [["__scopeId", "data-v-b69ff046"]]), Ni = {
2839
3254
  // API 配置
2840
3255
  api: {
2841
3256
  baseUrl: "",
@@ -2850,8 +3265,7 @@ const gt = (x, t) => {
2850
3265
  agreeFriend: "/chart/friend/agree",
2851
3266
  setChatStatus: "/chart/friend/chat/status",
2852
3267
  getAvailableUsers: "/chart/user/canAddFriend",
2853
- getUserInfo: "/user/info",
2854
- updateUserInfo: "/user/info",
3268
+ searchUser: "/chart/user/search",
2855
3269
  getUserAvatar: "/user/getAvatar",
2856
3270
  uploadAvatar: "/user/uploadAvatar"
2857
3271
  },
@@ -2898,30 +3312,30 @@ const gt = (x, t) => {
2898
3312
  allowedTypes: ["*"]
2899
3313
  }
2900
3314
  };
2901
- function Ki(x = {}) {
2902
- const t = Tt(Hi, x);
3315
+ function Ji(w = {}) {
3316
+ const t = Dt(Ni, w);
2903
3317
  return t.api.baseUrl || console.warn("[VueChatKit] 请配置 api.baseUrl"), t.api.websocketUrl || console.warn("[VueChatKit] 请配置 api.websocketUrl"), t.user.username || console.warn("[VueChatKit] 请配置 user.username"), t;
2904
3318
  }
2905
- function Tt(x, t) {
2906
- const n = { ...x };
3319
+ function Dt(w, t) {
3320
+ const n = { ...w };
2907
3321
  for (const v in t)
2908
- t[v] && typeof t[v] == "object" && !Array.isArray(t[v]) ? n[v] = Tt(x[v] || {}, t[v]) : n[v] = t[v];
3322
+ t[v] && typeof t[v] == "object" && !Array.isArray(t[v]) ? n[v] = Dt(w[v] || {}, t[v]) : n[v] = t[v];
2909
3323
  return n;
2910
3324
  }
2911
- const Ni = {
2912
- install(x) {
2913
- x.component("ChatPanel", Ya), x.component("ChatWindow", Wi), x.component("AvatarCrop", yt);
3325
+ const Qi = {
3326
+ install(w) {
3327
+ w.component("ChatPanel", Ka), w.component("ChatWindow", Bi), w.component("AvatarCrop", yt);
2914
3328
  }
2915
3329
  };
2916
3330
  export {
2917
3331
  yt as AvatarCrop,
2918
- ht as ChatApi,
2919
- Ya as ChatPanel,
2920
- Dt as ChatWebSocket,
2921
- Wi as ChatWindow,
2922
- Wt as HttpClient,
2923
- Ni as VueChatKit,
2924
- Ki as createChatConfig,
2925
- Ni as default,
2926
- Lt as useChat
3332
+ gt as ChatApi,
3333
+ Ka as ChatPanel,
3334
+ Wt as ChatWebSocket,
3335
+ Bi as ChatWindow,
3336
+ jt as HttpClient,
3337
+ Qi as VueChatKit,
3338
+ Ji as createChatConfig,
3339
+ Qi as default,
3340
+ Tt as useChat
2927
3341
  };