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