vue-chat-kit 0.3.2 → 0.3.5

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