@mobilon-dev/chotto 0.3.116 → 0.3.118

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.
Files changed (26) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/1_icons/VerifiedBadge.vue.js +31 -0
  3. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationRecentSelection.js +12 -15
  4. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +2 -2
  5. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +197 -187
  6. package/dist/components/2_elements/ChatInfo/ChatInfo.vue.js +43 -40
  7. package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +1 -1
  8. package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +243 -232
  9. package/dist/index.js +325 -323
  10. package/dist/themes/dark.css +1 -1
  11. package/dist/themes/default.css +1 -1
  12. package/dist/themes/glass.css +1 -1
  13. package/dist/themes/green.css +1 -1
  14. package/dist/themes/mobilon1.css +1 -1
  15. package/dist/types/src/components/1_icons/VerifiedBadge.vue.d.ts +2 -0
  16. package/dist/types/src/components/2_chatlist_elements/ChatItem/ChatItem.vue.d.ts +11 -1
  17. package/dist/types/src/components/2_chatlist_elements/ChatItem/stories/ChatItem.stories.d.ts +1 -0
  18. package/dist/types/src/components/2_chatlist_elements/ChatItem/styles/types.d.ts +35 -3
  19. package/dist/types/src/components/2_chatlist_elements/ChatItem/types.d.ts +2 -0
  20. package/dist/types/src/components/2_elements/ChatInfo/ChatInfo.vue.d.ts +2 -0
  21. package/dist/types/src/components/2_elements/ChatInfo/stories/ChatInfo.stories.d.ts +2 -0
  22. package/dist/types/src/components/2_elements/ChatInfo/styles/types.d.ts +20 -0
  23. package/dist/types/src/components/3_compounds/ChatInput/styles/types.d.ts +32 -0
  24. package/dist/types/src/components/index.d.ts +1 -0
  25. package/dist/types/src/test-utils/withSetup.d.ts +2 -0
  26. package/package.json +1 -1
@@ -1,77 +1,78 @@
1
- import { defineComponent as Dt, inject as Ht, useId as Nt, ref as M, computed as u, watch as Ut, onMounted as Ft, nextTick as U, onUnmounted as Pt, createElementBlock as c, openBlock as o, createElementVNode as m, createCommentVNode as r, withModifiers as Rt, normalizeClass as F, normalizeStyle as et, createVNode as P, withCtx as R, toDisplayString as f, createBlock as d, resolveDynamicComponent as nt, unref as h, Teleport as Wt, Fragment as jt, renderList as Xt } from "vue";
2
- import { getStatus as Yt, statuses as $t } from "../../../functions/getStatusMessage.js";
1
+ import { defineComponent as Ht, inject as Nt, useId as Ut, ref as E, computed as l, watch as Ft, onMounted as Pt, nextTick as F, onUnmounted as Rt, createElementBlock as a, openBlock as o, createElementVNode as m, createCommentVNode as c, withModifiers as Wt, normalizeClass as P, normalizeStyle as nt, createVNode as R, createBlock as d, renderSlot as $t, withCtx as W, toDisplayString as f, resolveDynamicComponent as it, unref as h, Teleport as jt, Fragment as Xt, renderList as Yt } from "vue";
2
+ import { getStatus as zt, statuses as Ot } from "../../../functions/getStatusMessage.js";
3
3
  import "../../../functions/parseMarkdown.js";
4
- import { t as b } from "../../../locale/useLocale.js";
5
- import { resolveMessageDraftStore as zt } from "../../../hooks/useMessageDraft.js";
6
- import { useTheme as Ot } from "../../../hooks/useTheme.js";
7
- import { useEmojiNative as qt } from "../../../hooks/useEmojiNative.js";
4
+ import { t as A } from "../../../locale/useLocale.js";
5
+ import { resolveMessageDraftStore as qt } from "../../../hooks/useMessageDraft.js";
6
+ import { useTheme as Gt } from "../../../hooks/useTheme.js";
7
+ import { useEmojiNative as Jt } from "../../../hooks/useEmojiNative.js";
8
8
  /* empty css */
9
9
  /* empty css */
10
10
  /* empty css */
11
11
  import "../../../node_modules/linkifyjs/dist/linkify.js";
12
12
  import "../../../node_modules/linkify-string/dist/linkify-string.js";
13
- import { textToAppleEmojiHtml as W, textContainsEmoji as it } from "../../../functions/renderAppleEmojis.js";
14
- import ot from "../../1_atoms/Tooltip/Tooltip.vue.js";
15
- import Gt from "../../1_atoms/ButtonContextMenu/ButtonContextMenu.vue.js";
16
- import Jt from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
17
- import Kt from "../../1_icons/AvatarIcon.vue.js";
18
- import Qt from "../../1_icons/MessageStatus/ErrorStatusIcon.vue.js";
19
- import Zt from "../../1_icons/MessageStatus/PendingStatusIcon.vue.js";
20
- import te from "../../1_icons/MessageStatus/ReadStatusIcon.vue.js";
21
- import ee from "../../1_icons/MessageStatus/ReceivedStatusIcon.vue.js";
22
- import ne from "../../1_icons/MessageStatus/SentStatusIcon.vue.js";
23
- import at from "./icons/AudioIcon.vue.js";
13
+ import { textToAppleEmojiHtml as $, textContainsEmoji as ot } from "../../../functions/renderAppleEmojis.js";
14
+ import at from "../../1_atoms/Tooltip/Tooltip.vue.js";
15
+ import Kt from "../../1_atoms/ButtonContextMenu/ButtonContextMenu.vue.js";
16
+ import Qt from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
17
+ import Zt from "../../1_icons/AvatarIcon.vue.js";
18
+ import te from "../../1_icons/VerifiedBadge.vue.js";
19
+ import ee from "../../1_icons/MessageStatus/ErrorStatusIcon.vue.js";
20
+ import ne from "../../1_icons/MessageStatus/PendingStatusIcon.vue.js";
21
+ import ie from "../../1_icons/MessageStatus/ReadStatusIcon.vue.js";
22
+ import oe from "../../1_icons/MessageStatus/ReceivedStatusIcon.vue.js";
23
+ import ae from "../../1_icons/MessageStatus/SentStatusIcon.vue.js";
24
+ import st from "./icons/AudioIcon.vue.js";
24
25
  import j from "./icons/FileIcon.vue.js";
25
26
  import ct from "./icons/ImageIcon.vue.js";
26
- import ie from "./icons/MissedCallIcon.vue.js";
27
+ import se from "./icons/MissedCallIcon.vue.js";
27
28
  import X from "./icons/StickerIcon.vue.js";
28
- import st from "./icons/VideoIcon.vue.js";
29
- import rt from "./icons/VoiceIcon.vue.js";
30
- const oe = ["data-chat-id"], ae = { class: "chat-item__avatar-container" }, ce = ["src"], se = {
29
+ import rt from "./icons/VideoIcon.vue.js";
30
+ import lt from "./icons/VoiceIcon.vue.js";
31
+ const ce = ["data-chat-id"], re = { class: "chat-item__avatar-container" }, le = ["src"], ue = {
31
32
  key: 1,
32
33
  class: "chat-item__avatar-placeholder"
33
- }, re = { class: "chat-item__info-container" }, le = ["innerHTML"], ue = {
34
+ }, me = { class: "chat-item__info-container" }, de = { class: "chat-item__title-row" }, he = ["innerHTML"], fe = {
34
35
  key: 1,
35
36
  class: "chat-item__name"
36
- }, me = {
37
+ }, ve = {
37
38
  key: 0,
38
39
  class: "chat-item__last-message"
39
- }, de = {
40
+ }, ge = {
40
41
  key: 1,
41
42
  class: "chat-item__last-message-text chat-item__last-message-text--draft"
42
- }, he = { class: "chat-item__draft-label" }, fe = ["innerHTML"], ve = {
43
+ }, ye = { class: "chat-item__draft-label" }, pe = ["innerHTML"], _e = {
43
44
  key: 2,
44
45
  class: "chat-item__draft-text"
45
- }, ge = ["innerHTML"], ye = {
46
+ }, ke = ["innerHTML"], xe = {
46
47
  key: 3,
47
48
  class: "chat-item__last-message-text"
48
- }, pe = { class: "chat-item__details-container" }, _e = {
49
+ }, we = { class: "chat-item__details-container" }, Ce = {
49
50
  key: 0,
50
51
  class: "chat-item__time"
51
- }, ke = { class: "chat-item__status-unread-container" }, xe = {
52
+ }, Ie = { class: "chat-item__status-unread-container" }, Te = {
52
53
  key: 1,
53
54
  class: "chat-item__unread"
54
- }, we = {
55
+ }, Me = {
55
56
  key: 2,
56
57
  class: "chat-item__status-chat-container"
57
- }, Ce = {
58
+ }, Ee = {
58
59
  key: 0,
59
60
  class: "chat-item__fixed pi pi-thumbtack"
60
- }, Ie = {
61
+ }, Se = {
61
62
  key: 0,
62
63
  id: "noSelectButton",
63
64
  class: "chat-item__menu-button"
64
- }, Te = {
65
+ }, Le = {
65
66
  key: 1,
66
67
  id: "noSelectButton",
67
68
  class: "chat-item__menu-button"
68
- }, Me = {
69
+ }, be = {
69
70
  key: 0,
70
71
  class: "dialog__container"
71
- }, Ee = ["onClick"], Se = ["src"], Le = {
72
+ }, Ae = ["onClick"], Be = ["src"], Ve = {
72
73
  key: 1,
73
74
  class: "dialog__icon pi pi-user"
74
- }, be = { class: "dialog__text-container" }, Ae = { class: "dialog__name" }, Be = { class: "dialog__time" }, ln = /* @__PURE__ */ Dt({
75
+ }, De = { class: "dialog__text-container" }, He = { class: "dialog__name" }, Ne = { class: "dialog__time" }, fn = /* @__PURE__ */ Ht({
75
76
  __name: "ChatItem",
76
77
  props: {
77
78
  chat: {},
@@ -79,59 +80,64 @@ const oe = ["data-chat-id"], ae = { class: "chat-item__avatar-container" }, ce =
79
80
  contextMenuTrigger: { default: "hover" }
80
81
  },
81
82
  emits: ["select", "action", "expand"],
82
- setup(a, { emit: lt }) {
83
- const E = Ht("chatAppId"), { getTheme: Y } = Ot(E), { isNative: $, emojiSrc: A } = qt(E), ut = zt(String(E ?? "")), n = a, S = lt, y = Nt(), p = M(!1), k = M(!1), B = M(!1), mt = M(null), dt = () => {
84
- B.value = !0;
85
- }, ht = (t) => {
86
- B.value || t.target instanceof HTMLElement && t.target.id != "noSelectButton" && S("select", { chat: n.chat, dialog: null }), B.value = !1;
83
+ setup(s, { emit: ut }) {
84
+ const S = Nt("chatAppId"), { getTheme: Y } = Gt(S), { isNative: z, emojiSrc: B } = Jt(S), mt = qt(String(S ?? "")), n = s, L = ut, y = Ut(), p = E(!1), k = E(!1), V = E(!1), dt = E(null), x = l(
85
+ () => {
86
+ var t;
87
+ return (((t = n.chat.actions) == null ? void 0 : t.length) ?? 0) > 0;
88
+ }
89
+ ), ht = () => {
90
+ V.value = !0;
87
91
  }, ft = (t) => {
88
- S("select", { chat: n.chat, dialog: t });
89
- }, vt = () => n.chat.isSelected ? "chat-item__selected" : "", gt = (t) => t.isSelected ? "dialog__selected" : "", z = (t) => {
90
- n.contextMenuTrigger === "rightClick" && V(), S("action", { chat: n.chat, ...t });
91
- }, V = () => {
92
+ V.value || t.target instanceof HTMLElement && t.target.id != "noSelectButton" && L("select", { chat: n.chat, dialog: null }), V.value = !1;
93
+ }, vt = (t) => {
94
+ L("select", { chat: n.chat, dialog: t });
95
+ }, gt = () => n.chat.isSelected ? "chat-item__selected" : "", yt = (t) => t.isSelected ? "dialog__selected" : "", O = (t) => {
96
+ n.contextMenuTrigger === "rightClick" && D(), L("action", { chat: n.chat, ...t });
97
+ }, D = () => {
92
98
  const t = document.getElementById("context-menu-rightclick-" + y);
93
99
  t && (t.style.top = "0", t.style.left = "0", t.style.opacity = "0", t.style.display = "none"), k.value = !1;
94
- }, yt = () => {
100
+ }, pt = () => {
95
101
  document.querySelectorAll('[id^="context-menu-rightclick-"]').forEach((e) => {
96
102
  const i = e;
97
103
  i.id !== "context-menu-rightclick-" + y && (i.style.top = "0", i.style.left = "0", i.style.opacity = "0", i.style.display = "none");
98
104
  });
99
- }, pt = () => n.chat.dialogs ? [...n.chat.dialogs].sort((t, e) => Number(t["lastActivity.timestamp"]) > Number(e["lastActivity.timestamp"]) ? -1 : Number(t["lastActivity.timestamp"]) < Number(e["lastActivity.timestamp"]) ? 1 : (Number(t["lastActivity.timestamp"]) == Number(e["lastActivity.timestamp"]), 0)) : [], _t = u(() => Yt(n.chat["lastMessage.status"])), kt = u(() => n.chat.showEmptyIndicator || n.chat.countUnread > 0), xt = u(() => n.chat.countUnread > 0 ? n.chat.countUnread > 99 ? "99+" : n.chat.countUnread : n.chat.showEmptyIndicator ? "" : void 0);
100
- let L;
101
- const _ = M(0), O = [b("component.ChatItem.typing") + ".", b("component.ChatItem.typing") + "..", b("component.ChatItem.typing") + "..."], q = (t) => {
102
- var l, s, v;
105
+ }, _t = () => n.chat.dialogs ? [...n.chat.dialogs].sort((t, e) => Number(t["lastActivity.timestamp"]) > Number(e["lastActivity.timestamp"]) ? -1 : Number(t["lastActivity.timestamp"]) < Number(e["lastActivity.timestamp"]) ? 1 : (Number(t["lastActivity.timestamp"]) == Number(e["lastActivity.timestamp"]), 0)) : [], kt = l(() => zt(n.chat["lastMessage.status"])), xt = l(() => n.chat.showEmptyIndicator || n.chat.countUnread > 0), wt = l(() => n.chat.countUnread > 0 ? n.chat.countUnread > 99 ? "99+" : n.chat.countUnread : n.chat.showEmptyIndicator ? "" : void 0);
106
+ let b;
107
+ const _ = E(0), q = [A("component.ChatItem.typing") + ".", A("component.ChatItem.typing") + "..", A("component.ChatItem.typing") + "..."], G = (t) => {
108
+ var u, r, v;
103
109
  if (typeof t == "string")
104
110
  return t;
105
111
  if ((t == null ? void 0 : t.type) === "message.sticker")
106
112
  return "Стикер";
107
113
  if ((t == null ? void 0 : t.type) === "message.audio")
108
- return (t.isVoiceMessage || ((l = t == null ? void 0 : t.data) == null ? void 0 : l.isVoiceMessage)) === !0 ? "Голосовое сообщение" : "Аудиофайл";
114
+ return (t.isVoiceMessage || ((u = t == null ? void 0 : t.data) == null ? void 0 : u.isVoiceMessage)) === !0 ? "Голосовое сообщение" : "Аудиофайл";
109
115
  if ((t == null ? void 0 : t.type) === "message.missedCall")
110
116
  return "Пропущенный звонок";
111
- const e = (s = t == null ? void 0 : t.data) == null ? void 0 : s.text;
117
+ const e = (r = t == null ? void 0 : t.data) == null ? void 0 : r.text;
112
118
  if (e)
113
119
  return e;
114
120
  const i = (v = t == null ? void 0 : t.data) == null ? void 0 : v.filename;
115
121
  return i || "";
116
- }, wt = (t) => typeof t == "string" ? null : (t == null ? void 0 : t.type) || null, D = b("component.ChatItem.draft"), H = u(() => {
122
+ }, Ct = (t) => typeof t == "string" ? null : (t == null ? void 0 : t.type) || null, H = A("component.ChatItem.draft"), N = l(() => {
117
123
  var e;
118
- const t = ut.getChatDraft(String(E ?? ""), n.chat.chatId);
124
+ const t = mt.getChatDraft(String(S ?? ""), n.chat.chatId);
119
125
  if (!(!t || t.edit) && !(!t.listPreviewText && !t.listPreviewFile) && !(!(t.text || "").trim() && !t.file && !((e = t.files) != null && e.length)))
120
126
  return t;
121
- }), x = u(() => !!H.value), g = u(() => {
127
+ }), w = l(() => !!N.value), g = l(() => {
122
128
  var e;
123
- const t = H.value;
129
+ const t = N.value;
124
130
  return t ? t.file ? (((e = t.listPreviewFile) == null ? void 0 : e.name) || t.file.name || "").trim() : (t.listPreviewText || "").trim() : "";
125
- }), G = u(() => {
126
- const t = H.value;
131
+ }), J = l(() => {
132
+ const t = N.value;
127
133
  if (!(t != null && t.file)) return null;
128
- const e = t.listPreviewFile, i = ((e == null ? void 0 : e.type) || t.file.type || "").toLowerCase(), l = ((e == null ? void 0 : e.name) || t.file.name || "").toLowerCase();
129
- return i === "sticker" || l.endsWith(".tgs") || l.endsWith(".webp") ? X : i === "image" || i.includes("image") ? ct : i === "video" || i.includes("video") ? st : i === "audio" || i.includes("audio") ? l.includes("voice") || l.includes("голос") ? rt : at : i === "file" || l ? j : j;
130
- }), Ct = u(() => W(g.value || "", null, A.value)), J = u(() => {
131
- var e, i, l;
132
- if (n.chat.typing || x.value)
134
+ const e = t.listPreviewFile, i = ((e == null ? void 0 : e.type) || t.file.type || "").toLowerCase(), u = ((e == null ? void 0 : e.name) || t.file.name || "").toLowerCase();
135
+ return i === "sticker" || u.endsWith(".tgs") || u.endsWith(".webp") ? X : i === "image" || i.includes("image") ? ct : i === "video" || i.includes("video") ? rt : i === "audio" || i.includes("audio") ? u.includes("voice") || u.includes("голос") ? lt : st : i === "file" || u ? j : j;
136
+ }), It = l(() => $(g.value || "", null, B.value)), K = l(() => {
137
+ var e, i, u;
138
+ if (n.chat.typing || w.value)
133
139
  return null;
134
- const t = wt(n.chat.lastMessage);
140
+ const t = Ct(n.chat.lastMessage);
135
141
  if (!t)
136
142
  return null;
137
143
  if (t === "message.sticker")
@@ -139,226 +145,230 @@ const oe = ["data-chat-id"], ae = { class: "chat-item__avatar-container" }, ce =
139
145
  if (t === "message.image")
140
146
  return ct;
141
147
  if (t === "message.video")
142
- return st;
148
+ return rt;
143
149
  if (t === "message.audio") {
144
- const s = n.chat.lastMessage;
145
- return (s.isVoiceMessage || ((e = s == null ? void 0 : s.data) == null ? void 0 : e.isVoiceMessage)) === !0 ? rt : at;
150
+ const r = n.chat.lastMessage;
151
+ return (r.isVoiceMessage || ((e = r == null ? void 0 : r.data) == null ? void 0 : e.isVoiceMessage)) === !0 ? lt : st;
146
152
  }
147
153
  if (t === "message.missedCall")
148
- return ie;
154
+ return se;
149
155
  if (t === "message.file") {
150
- const s = n.chat.lastMessage, v = ((l = (i = s == null ? void 0 : s.data) == null ? void 0 : i.filename) == null ? void 0 : l.toLowerCase()) || "";
156
+ const r = n.chat.lastMessage, v = ((u = (i = r == null ? void 0 : r.data) == null ? void 0 : i.filename) == null ? void 0 : u.toLowerCase()) || "";
151
157
  return v.endsWith(".tgs") || v.endsWith(".webp") ? X : j;
152
158
  }
153
159
  return null;
154
- }), It = u(() => n.chat.typing ? O[_.value] : x.value ? g.value ? `${D} ${g.value}` : D : q(n.chat.lastMessage)), N = u(() => n.chat.typing ? O[_.value] : q(n.chat.lastMessage)), K = u(
155
- () => !$.value && it(g.value || N.value || "")
156
- ), Tt = u(
157
- () => !$.value && it(n.chat.name || "")
158
- ), Mt = u(() => W(N.value || "", null, A.value)), Et = u(() => W(n.chat.name || "", null, A.value));
159
- Ut(
160
+ }), Tt = l(() => n.chat.typing ? q[_.value] : w.value ? g.value ? `${H} ${g.value}` : H : G(n.chat.lastMessage)), U = l(() => n.chat.typing ? q[_.value] : G(n.chat.lastMessage)), Q = l(
161
+ () => !z.value && ot(g.value || U.value || "")
162
+ ), Mt = l(
163
+ () => !z.value && ot(n.chat.name || "")
164
+ ), Et = l(() => $(U.value || "", null, B.value)), St = l(() => $(n.chat.name || "", null, B.value));
165
+ Ft(
160
166
  () => n.chat.typing,
161
167
  () => {
162
- n.chat.typing ? L = setInterval(() => {
168
+ n.chat.typing ? b = setInterval(() => {
163
169
  _.value < 2 ? _.value += 1 : _.value = 0;
164
- }, 1e3) : (_.value = 0, L && (clearInterval(L), L = void 0));
170
+ }, 1e3) : (_.value = 0, b && (clearInterval(b), b = void 0));
165
171
  },
166
172
  { immediate: !0 }
167
173
  );
168
- const St = () => {
169
- n.contextMenuTrigger === "hover" && (p.value = !0);
170
- }, Lt = (t) => {
171
- n.contextMenuTrigger === "hover" && (t.relatedTarget instanceof HTMLElement && t.relatedTarget.className == "context-menu__list" ? p.value = !0 : p.value = !1);
174
+ const Lt = () => {
175
+ n.contextMenuTrigger === "hover" && x.value && (p.value = !0);
172
176
  }, bt = (t) => {
173
- n.contextMenuTrigger === "rightClick" && n.chat.actions && At(t);
177
+ n.contextMenuTrigger === "hover" && (t.relatedTarget instanceof HTMLElement && t.relatedTarget.className == "context-menu__list" ? p.value = !0 : p.value = !1);
174
178
  }, At = (t) => {
175
- yt(), k.value = !0, U(() => {
179
+ n.contextMenuTrigger === "rightClick" && x.value && Bt(t);
180
+ }, Bt = (t) => {
181
+ pt(), k.value = !0, F(() => {
176
182
  const e = document.getElementById("context-menu-rightclick-" + y);
177
183
  if (e) {
178
- const i = t.clientX, l = t.clientY;
184
+ const i = t.clientX, u = t.clientY;
179
185
  e.style.display = "inherit";
180
- const s = e.getBoundingClientRect();
181
- e.style.display = "none", U(() => {
182
- const v = window.innerWidth, tt = window.innerHeight, w = window.scrollX || window.pageXOffset, C = window.scrollY || window.pageYOffset;
183
- let I = i + w, T = l + C;
184
- I + s.width > v + w && (I = i + w - s.width), T + s.height > tt + C && (T = l + C - s.height), I < w && (I = w), T < C && (T = C), e.style.top = T + "px", e.style.left = I + "px", e.style.opacity = "1", e.style.display = "inherit";
186
+ const r = e.getBoundingClientRect();
187
+ e.style.display = "none", F(() => {
188
+ const v = window.innerWidth, et = window.innerHeight, C = window.scrollX || window.pageXOffset, I = window.scrollY || window.pageYOffset;
189
+ let T = i + C, M = u + I;
190
+ T + r.width > v + C && (T = i + C - r.width), M + r.height > et + I && (M = u + I - r.height), T < C && (T = C), M < I && (M = I), e.style.top = M + "px", e.style.left = T + "px", e.style.opacity = "1", e.style.display = "inherit";
185
191
  });
186
192
  }
187
193
  });
188
- }, Bt = () => {
189
194
  }, Vt = () => {
190
- }, Q = (t) => {
195
+ }, Dt = () => {
196
+ }, Z = (t) => {
191
197
  if (n.contextMenuTrigger === "rightClick" && k.value) {
192
198
  const e = t.target, i = document.getElementById("context-menu-rightclick-" + y);
193
- (!i || !i.contains(e)) && V();
199
+ (!i || !i.contains(e)) && D();
194
200
  }
195
- }, Z = () => {
196
- n.contextMenuTrigger === "rightClick" && k.value && V();
201
+ }, tt = () => {
202
+ n.contextMenuTrigger === "rightClick" && k.value && D();
197
203
  };
198
- return Ft(() => {
199
- n.contextMenuTrigger === "rightClick" && (document.addEventListener("click", Q), window.addEventListener("scroll", Z, !0), U(() => {
204
+ return Pt(() => {
205
+ n.contextMenuTrigger === "rightClick" && (document.addEventListener("click", Z), window.addEventListener("scroll", tt, !0), F(() => {
200
206
  const t = document.getElementById("context-menu-rightclick-" + y);
201
207
  t && (t.style.display = "none", t.style.opacity = "0");
202
208
  }));
203
- }), Pt(() => {
204
- document.removeEventListener("click", Q), window.removeEventListener("scroll", Z, !0);
205
- }), (t, e) => (o(), c("div", null, [
209
+ }), Rt(() => {
210
+ document.removeEventListener("click", Z), window.removeEventListener("scroll", tt, !0);
211
+ }), (t, e) => (o(), a("div", null, [
206
212
  m("div", {
207
213
  ref_key: "containerRef",
208
- ref: mt,
209
- class: F(["chat-item__container", vt()]),
214
+ ref: dt,
215
+ class: P(["chat-item__container", gt()]),
210
216
  "data-testid": "chat-item",
211
217
  "data-chat-id": n.chat.chatId,
212
- onMouseenter: St,
213
- onMouseleave: Lt,
214
- onClick: ht,
215
- onContextmenu: Rt(bt, ["prevent"])
218
+ onMouseenter: Lt,
219
+ onMouseleave: bt,
220
+ onClick: ft,
221
+ onContextmenu: Wt(At, ["prevent"])
216
222
  }, [
217
- m("div", ae, [
223
+ m("div", re, [
218
224
  m("span", {
219
225
  class: "chat-item__status-user",
220
- style: et({ backgroundColor: n.chat.status })
226
+ style: nt({ backgroundColor: n.chat.status })
221
227
  }, null, 4),
222
- n.chat.avatar ? (o(), c("img", {
228
+ n.chat.avatar ? (o(), a("img", {
223
229
  key: 0,
224
230
  src: n.chat.avatar,
225
231
  height: "48",
226
232
  width: "48"
227
- }, null, 8, ce)) : (o(), c("div", se, [
228
- P(Kt)
233
+ }, null, 8, le)) : (o(), a("div", ue, [
234
+ R(Zt)
229
235
  ]))
230
236
  ]),
231
- m("div", re, [
232
- P(ot, {
233
- text: a.chat.name,
234
- position: "bottom"
235
- }, {
236
- default: R(() => [
237
- Tt.value ? (o(), c("div", {
238
- key: 0,
239
- class: "chat-item__name",
240
- innerHTML: Et.value
241
- }, null, 8, le)) : (o(), c("div", ue, f(a.chat.name), 1))
242
- ]),
243
- _: 1
244
- }, 8, ["text"]),
245
- P(ot, {
246
- text: It.value,
237
+ m("div", me, [
238
+ m("div", de, [
239
+ R(at, {
240
+ text: s.chat.name,
241
+ position: "bottom"
242
+ }, {
243
+ default: W(() => [
244
+ Mt.value ? (o(), a("div", {
245
+ key: 0,
246
+ class: "chat-item__name",
247
+ innerHTML: St.value
248
+ }, null, 8, he)) : (o(), a("div", fe, f(s.chat.name), 1))
249
+ ]),
250
+ _: 1
251
+ }, 8, ["text"]),
252
+ s.chat.verified ? (o(), d(te, { key: 0 })) : c("", !0),
253
+ $t(t.$slots, "name-suffix", {}, void 0, !0)
254
+ ]),
255
+ R(at, {
256
+ text: Tt.value,
247
257
  position: "bottom"
248
258
  }, {
249
- default: R(() => [
250
- a.chat.lastMessage || a.chat.typing || x.value ? (o(), c("div", me, [
251
- J.value && !x.value ? (o(), d(nt(J.value), {
259
+ default: W(() => [
260
+ s.chat.lastMessage || s.chat.typing || w.value ? (o(), a("div", ve, [
261
+ K.value && !w.value ? (o(), d(it(K.value), {
252
262
  key: 0,
253
263
  class: "chat-item__message-icon"
254
- })) : r("", !0),
255
- x.value ? (o(), c("span", de, [
256
- m("span", he, f(h(D)), 1),
257
- G.value ? (o(), d(nt(G.value), {
264
+ })) : c("", !0),
265
+ w.value ? (o(), a("span", ge, [
266
+ m("span", ye, f(h(H)), 1),
267
+ J.value ? (o(), d(it(J.value), {
258
268
  key: 0,
259
269
  class: "chat-item__message-icon"
260
- })) : r("", !0),
261
- g.value && K.value ? (o(), c("span", {
270
+ })) : c("", !0),
271
+ g.value && Q.value ? (o(), a("span", {
262
272
  key: 1,
263
273
  class: "chat-item__draft-text",
264
- innerHTML: Ct.value
265
- }, null, 8, fe)) : g.value ? (o(), c("span", ve, f(g.value), 1)) : r("", !0)
266
- ])) : K.value ? (o(), c("span", {
274
+ innerHTML: It.value
275
+ }, null, 8, pe)) : g.value ? (o(), a("span", _e, f(g.value), 1)) : c("", !0)
276
+ ])) : Q.value ? (o(), a("span", {
267
277
  key: 2,
268
278
  class: "chat-item__last-message-text",
269
- innerHTML: Mt.value
270
- }, null, 8, ge)) : (o(), c("span", ye, f(N.value), 1))
271
- ])) : r("", !0)
279
+ innerHTML: Et.value
280
+ }, null, 8, ke)) : (o(), a("span", xe, f(U.value), 1))
281
+ ])) : c("", !0)
272
282
  ]),
273
283
  _: 1
274
284
  }, 8, ["text"])
275
285
  ]),
276
- m("div", pe, [
277
- a.chat["lastActivity.time"] && (!a.chat.actions || !p.value) ? (o(), c("div", _e, f(a.chat["lastActivity.time"]), 1)) : r("", !0),
278
- p.value && a.chat.actions && a.contextMenuTrigger === "hover" ? (o(), d(Gt, {
286
+ m("div", we, [
287
+ s.chat["lastActivity.time"] && (!x.value || !p.value) ? (o(), a("div", Ce, f(s.chat["lastActivity.time"]), 1)) : c("", !0),
288
+ p.value && x.value && s.contextMenuTrigger === "hover" ? (o(), d(Kt, {
279
289
  key: 1,
280
290
  mode: "click",
281
291
  "menu-side": "bottom-right",
282
- actions: a.chat.actions,
283
- onClick: z,
284
- onButtonClick: dt,
292
+ actions: s.chat.actions,
293
+ onClick: O,
294
+ onButtonClick: ht,
285
295
  onMenuMouseLeave: e[0] || (e[0] = (i) => p.value = !1)
286
296
  }, {
287
- default: R(() => [...e[2] || (e[2] = [
297
+ default: W(() => [...e[2] || (e[2] = [
288
298
  m("span", { class: "pi pi-ellipsis-h chat-item__actions-trigger" }, null, -1)
289
299
  ])]),
290
300
  _: 1
291
- }, 8, ["actions"])) : r("", !0),
292
- (o(), d(Wt, { to: "body" }, [
293
- a.contextMenuTrigger === "rightClick" && a.chat.actions && k.value ? (o(), d(Jt, {
301
+ }, 8, ["actions"])) : c("", !0),
302
+ (o(), d(jt, { to: "body" }, [
303
+ s.contextMenuTrigger === "rightClick" && x.value && k.value ? (o(), d(Qt, {
294
304
  key: 0,
295
305
  id: "context-menu-rightclick-" + h(y),
296
- actions: a.chat.actions,
306
+ actions: s.chat.actions,
297
307
  "data-theme": h(Y)().theme ? h(Y)().theme : "light",
298
- onClick: z,
299
- onMouseenter: Bt,
300
- onMouseleave: Vt
301
- }, null, 8, ["id", "actions", "data-theme"])) : r("", !0)
308
+ onClick: O,
309
+ onMouseenter: Vt,
310
+ onMouseleave: Dt
311
+ }, null, 8, ["id", "actions", "data-theme"])) : c("", !0)
302
312
  ])),
303
- m("div", ke, [
304
- h($t).includes(a.chat["lastMessage.status"]) ? (o(), c("div", {
313
+ m("div", Ie, [
314
+ h(Ot).includes(s.chat["lastMessage.status"]) ? (o(), a("div", {
305
315
  key: 0,
306
- class: F(["chat-item__status-message", _t.value])
316
+ class: P(["chat-item__status-message", kt.value])
307
317
  }, [
308
- a.chat["lastMessage.status"] === "pending" ? (o(), d(h(Zt), { key: 0 })) : a.chat["lastMessage.status"] === "error" ? (o(), d(h(Qt), { key: 1 })) : a.chat["lastMessage.status"] === "read" ? (o(), d(h(te), { key: 2 })) : a.chat["lastMessage.status"] === "received" ? (o(), d(h(ee), { key: 3 })) : (o(), d(h(ne), { key: 4 }))
309
- ], 2)) : r("", !0),
310
- kt.value ? (o(), c("div", xe, f(xt.value), 1)) : r("", !0)
318
+ s.chat["lastMessage.status"] === "pending" ? (o(), d(h(ne), { key: 0 })) : s.chat["lastMessage.status"] === "error" ? (o(), d(h(ee), { key: 1 })) : s.chat["lastMessage.status"] === "read" ? (o(), d(h(ie), { key: 2 })) : s.chat["lastMessage.status"] === "received" ? (o(), d(h(oe), { key: 3 })) : (o(), d(h(ae), { key: 4 }))
319
+ ], 2)) : c("", !0),
320
+ xt.value ? (o(), a("div", Te, f(wt.value), 1)) : c("", !0)
311
321
  ]),
312
- a.chat.countUnread < 1 ? (o(), c("div", we, [
313
- a.chat.isFixedTop || a.chat.isFixedBottom ? (o(), c("span", Ce)) : r("", !0)
314
- ])) : r("", !0)
322
+ s.chat.countUnread < 1 ? (o(), a("div", Me, [
323
+ s.chat.isFixedTop || s.chat.isFixedBottom ? (o(), a("span", Ee)) : c("", !0)
324
+ ])) : c("", !0)
315
325
  ]),
316
- n.showDialogs && a.chat.dialogs ? (o(), c("div", {
326
+ n.showDialogs && s.chat.dialogs ? (o(), a("div", {
317
327
  key: 0,
318
328
  class: "chat-item__dialog-buttons",
319
- onClick: e[1] || (e[1] = (i) => S("expand", n.chat))
329
+ onClick: e[1] || (e[1] = (i) => L("expand", n.chat))
320
330
  }, [
321
- n.showDialogs && !a.chat.dialogsExpanded ? (o(), c("button", Ie, [...e[3] || (e[3] = [
331
+ n.showDialogs && !s.chat.dialogsExpanded ? (o(), a("button", Se, [...e[3] || (e[3] = [
322
332
  m("span", {
323
333
  id: "noSelectButton",
324
334
  class: "pi pi-angle-down"
325
335
  }, null, -1)
326
- ])])) : r("", !0),
327
- n.showDialogs && a.chat.dialogsExpanded ? (o(), c("button", Te, [...e[4] || (e[4] = [
336
+ ])])) : c("", !0),
337
+ n.showDialogs && s.chat.dialogsExpanded ? (o(), a("button", Le, [...e[4] || (e[4] = [
328
338
  m("span", {
329
339
  id: "noSelectButton",
330
340
  class: "pi pi-angle-up"
331
341
  }, null, -1)
332
- ])])) : r("", !0)
333
- ])) : r("", !0)
334
- ], 42, oe),
335
- n.showDialogs && a.chat.dialogsExpanded ? (o(), c("div", Me, [
336
- (o(!0), c(jt, null, Xt(pt(), (i) => (o(), c("div", {
342
+ ])])) : c("", !0)
343
+ ])) : c("", !0)
344
+ ], 42, ce),
345
+ n.showDialogs && s.chat.dialogsExpanded ? (o(), a("div", be, [
346
+ (o(!0), a(Xt, null, Yt(_t(), (i) => (o(), a("div", {
337
347
  key: i.dialogId,
338
- class: F(["dialog__item", gt(i)]),
339
- onClick: (l) => ft(i)
348
+ class: P(["dialog__item", yt(i)]),
349
+ onClick: (u) => vt(i)
340
350
  }, [
341
- i.icon ? (o(), c("img", {
351
+ i.icon ? (o(), a("img", {
342
352
  key: 0,
343
353
  class: "dialog__icon",
344
354
  src: i.icon,
345
355
  height: "16",
346
356
  width: "16"
347
- }, null, 8, Se)) : (o(), c("span", Le)),
348
- m("div", be, [
349
- m("div", Ae, f(i.name), 1),
350
- m("div", Be, f(i["lastActivity.time"]), 1)
357
+ }, null, 8, Be)) : (o(), a("span", Ve)),
358
+ m("div", De, [
359
+ m("div", He, f(i.name), 1),
360
+ m("div", Ne, f(i["lastActivity.time"]), 1)
351
361
  ]),
352
- i.countUnread > 0 ? (o(), c("div", {
362
+ i.countUnread > 0 ? (o(), a("div", {
353
363
  key: 2,
354
364
  class: "chat-item__unread",
355
- style: et(i.colorUnread ? { backgroundColor: i.colorUnread } : {})
356
- }, f(i.countUnread > 99 ? "99+" : i.countUnread), 5)) : r("", !0)
357
- ], 10, Ee))), 128))
358
- ])) : r("", !0)
365
+ style: nt(i.colorUnread ? { backgroundColor: i.colorUnread } : {})
366
+ }, f(i.countUnread > 99 ? "99+" : i.countUnread), 5)) : c("", !0)
367
+ ], 10, Ae))), 128))
368
+ ])) : c("", !0)
359
369
  ]));
360
370
  }
361
371
  });
362
372
  export {
363
- ln as default
373
+ fn as default
364
374
  };