@codingfactory/messenger-client 0.1.0 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +377 -361
- package/dist/services/echo.d.ts +7 -7
- package/dist/services/mediaApi.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,84 +1,94 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { defineStore as
|
|
3
|
-
import
|
|
4
|
-
import { isAxiosError as
|
|
5
|
-
import { useRoute as
|
|
6
|
-
const
|
|
7
|
-
},
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
},
|
|
1
|
+
import { ref as Q, getCurrentInstance as Me, computed as J, onUnmounted as we, toValue as Oe, watch as de } from "vue";
|
|
2
|
+
import { defineStore as Ge, storeToRefs as ke } from "pinia";
|
|
3
|
+
import Ve, { isAxiosError as Be } from "axios";
|
|
4
|
+
import { isAxiosError as Zt } from "axios";
|
|
5
|
+
import { useRoute as He } from "vue-router";
|
|
6
|
+
const Re = () => () => {
|
|
7
|
+
}, Ae = () => {
|
|
8
|
+
}, Ee = () => {
|
|
9
|
+
}, Fe = () => {
|
|
10
|
+
}, Te = () => {
|
|
11
11
|
throw new Error("messenger-client subscribeToConversation is not configured");
|
|
12
|
-
}
|
|
13
|
-
|
|
12
|
+
}, _ = {
|
|
13
|
+
ECHO_INITIALIZED_EVENT: "messenger-client:echo-initialized",
|
|
14
|
+
getEcho: () => null,
|
|
15
|
+
onConnectionStatusChange: Re,
|
|
16
|
+
subscribeToPresenceStatus: Ae,
|
|
17
|
+
unsubscribeFromPresenceStatus: Ee,
|
|
18
|
+
subscribeToConversation: Te,
|
|
19
|
+
unsubscribeFromConversation: Fe
|
|
20
|
+
}, le = () => _.ECHO_INITIALIZED_EVENT, O = () => _.getEcho(), xe = (e) => _.onConnectionStatusChange(e), je = (e) => _.subscribeToPresenceStatus(e), Ye = () => _.unsubscribeFromPresenceStatus(), We = (e, t) => _.subscribeToConversation(e, t), Ze = (e) => _.unsubscribeFromConversation(e);
|
|
14
21
|
function Xe(e) {
|
|
15
|
-
e.initializedEvent && (
|
|
22
|
+
e.initializedEvent && (_.ECHO_INITIALIZED_EVENT = e.initializedEvent), e.getEcho && (_.getEcho = e.getEcho), e.onConnectionStatusChange && (_.onConnectionStatusChange = e.onConnectionStatusChange), e.subscribeToPresenceStatus && (_.subscribeToPresenceStatus = e.subscribeToPresenceStatus), e.unsubscribeFromPresenceStatus && (_.unsubscribeFromPresenceStatus = e.unsubscribeFromPresenceStatus), e.subscribeToConversation && (_.subscribeToConversation = e.subscribeToConversation), e.unsubscribeFromConversation && (_.unsubscribeFromConversation = e.unsubscribeFromConversation);
|
|
16
23
|
}
|
|
17
24
|
function Qe() {
|
|
18
|
-
|
|
25
|
+
_.ECHO_INITIALIZED_EVENT = "messenger-client:echo-initialized", _.getEcho = () => null, _.onConnectionStatusChange = Re, _.subscribeToPresenceStatus = Ae, _.unsubscribeFromPresenceStatus = Ee, _.subscribeToConversation = Te, _.unsubscribeFromConversation = Fe;
|
|
19
26
|
}
|
|
20
|
-
function
|
|
27
|
+
function Z(e) {
|
|
21
28
|
return typeof e == "object" && e !== null;
|
|
22
29
|
}
|
|
23
|
-
function Ze(e) {
|
|
24
|
-
return X(e) && typeof e.conversation_id == "string" && X(e.message) && typeof e.message.id == "string" && typeof e.message.conversation_id == "string" && typeof e.message.author_id == "string";
|
|
25
|
-
}
|
|
26
30
|
function Je(e) {
|
|
27
|
-
return
|
|
31
|
+
return Z(e) && typeof e.conversation_id == "string" && Z(e.message) && typeof e.message.id == "string" && typeof e.message.conversation_id == "string" && typeof e.message.author_id == "string";
|
|
28
32
|
}
|
|
29
33
|
function Ke(e) {
|
|
30
|
-
return
|
|
34
|
+
return Z(e) && typeof e.conversation_id == "string" && typeof e.user_id == "string" && typeof e.message_id == "string";
|
|
31
35
|
}
|
|
32
|
-
const Ue = Ye;
|
|
33
|
-
let l = Ue;
|
|
34
36
|
function et(e) {
|
|
37
|
+
return Z(e) && typeof e.conversation_id == "string";
|
|
38
|
+
}
|
|
39
|
+
const qe = Ve;
|
|
40
|
+
let l = qe;
|
|
41
|
+
function tt(e) {
|
|
35
42
|
l = e;
|
|
36
43
|
}
|
|
37
|
-
function
|
|
38
|
-
l =
|
|
44
|
+
function st() {
|
|
45
|
+
l = qe;
|
|
39
46
|
}
|
|
40
|
-
const
|
|
47
|
+
const Pe = {
|
|
41
48
|
currentUser: null
|
|
42
49
|
};
|
|
43
|
-
let L = () =>
|
|
44
|
-
function
|
|
50
|
+
let L = () => Pe;
|
|
51
|
+
function nt(e) {
|
|
45
52
|
L = e;
|
|
46
53
|
}
|
|
47
|
-
function
|
|
48
|
-
L = () =>
|
|
54
|
+
function rt() {
|
|
55
|
+
L = () => Pe;
|
|
49
56
|
}
|
|
50
57
|
function m(e) {
|
|
51
|
-
if (
|
|
58
|
+
if (Be(e)) {
|
|
52
59
|
const t = e.response?.data?.message || e.message || "An error occurred";
|
|
53
60
|
return t.includes("SQLSTATE") || t.includes("Connection:") || t.includes("\\Illuminate\\") ? "Something went wrong. Please try again later." : t;
|
|
54
61
|
}
|
|
55
62
|
return e instanceof Error ? e.message : typeof e == "string" ? e : typeof e == "object" && e !== null && "message" in e && typeof e.message == "string" ? e.message : "An unexpected error occurred";
|
|
56
63
|
}
|
|
57
|
-
function
|
|
64
|
+
function Gt(e) {
|
|
58
65
|
return e instanceof Error;
|
|
59
66
|
}
|
|
60
|
-
function
|
|
67
|
+
function kt(e) {
|
|
61
68
|
return typeof e == "object" && e !== null && "response" in e && typeof e.response == "object";
|
|
62
69
|
}
|
|
63
|
-
const
|
|
70
|
+
const Le = {
|
|
64
71
|
async uploadImage() {
|
|
65
72
|
throw new Error("messenger-client mediaApi.uploadImage is not configured");
|
|
66
73
|
}
|
|
67
74
|
};
|
|
68
|
-
let
|
|
69
|
-
function rt(e) {
|
|
70
|
-
de = e;
|
|
71
|
-
}
|
|
75
|
+
let ie = Le;
|
|
72
76
|
function it() {
|
|
73
|
-
|
|
77
|
+
return ie;
|
|
74
78
|
}
|
|
75
79
|
function ot(e) {
|
|
80
|
+
ie = e;
|
|
81
|
+
}
|
|
82
|
+
function at() {
|
|
83
|
+
ie = Le;
|
|
84
|
+
}
|
|
85
|
+
function ct(e) {
|
|
76
86
|
return e !== null && typeof e == "object" && "id" in e && "type" in e && "participants" in e;
|
|
77
87
|
}
|
|
78
88
|
function Ne(e) {
|
|
79
89
|
return typeof e == "object" && e !== null;
|
|
80
90
|
}
|
|
81
|
-
function
|
|
91
|
+
function I(e) {
|
|
82
92
|
return !Ne(e) || !("data" in e) ? e : e.data;
|
|
83
93
|
}
|
|
84
94
|
function B(e, t) {
|
|
@@ -87,7 +97,7 @@ function B(e, t) {
|
|
|
87
97
|
throw new Error(`Invalid messaging folder payload: missing string ${t}`);
|
|
88
98
|
return s;
|
|
89
99
|
}
|
|
90
|
-
function
|
|
100
|
+
function fe(e, t) {
|
|
91
101
|
const s = e[t];
|
|
92
102
|
if (s == null)
|
|
93
103
|
return null;
|
|
@@ -95,7 +105,7 @@ function pe(e, t) {
|
|
|
95
105
|
throw new Error(`Invalid messaging folder payload: ${t} must be a string or null`);
|
|
96
106
|
return s;
|
|
97
107
|
}
|
|
98
|
-
function
|
|
108
|
+
function K(e, t) {
|
|
99
109
|
const s = e[t];
|
|
100
110
|
if (typeof s == "number" && Number.isFinite(s))
|
|
101
111
|
return s;
|
|
@@ -106,43 +116,43 @@ function ee(e, t) {
|
|
|
106
116
|
}
|
|
107
117
|
throw new Error(`Invalid messaging folder payload: missing numeric ${t}`);
|
|
108
118
|
}
|
|
109
|
-
function
|
|
119
|
+
function ne(e) {
|
|
110
120
|
if (!Ne(e))
|
|
111
121
|
throw new Error("Invalid messaging folder payload: expected object");
|
|
112
122
|
return {
|
|
113
123
|
id: B(e, "id"),
|
|
114
124
|
name: B(e, "name"),
|
|
115
|
-
color:
|
|
116
|
-
icon:
|
|
117
|
-
sort_order:
|
|
118
|
-
conversation_count:
|
|
119
|
-
unread_count:
|
|
125
|
+
color: fe(e, "color"),
|
|
126
|
+
icon: fe(e, "icon"),
|
|
127
|
+
sort_order: K(e, "sort_order"),
|
|
128
|
+
conversation_count: K(e, "conversation_count"),
|
|
129
|
+
unread_count: K(e, "unread_count"),
|
|
120
130
|
created_at: B(e, "created_at"),
|
|
121
131
|
updated_at: B(e, "updated_at")
|
|
122
132
|
};
|
|
123
133
|
}
|
|
124
|
-
function
|
|
134
|
+
function ut(e) {
|
|
125
135
|
if (!Array.isArray(e))
|
|
126
136
|
throw new Error("Invalid messaging folder payload: expected array");
|
|
127
|
-
return e.map((t) =>
|
|
137
|
+
return e.map((t) => ne(t));
|
|
128
138
|
}
|
|
129
|
-
function
|
|
130
|
-
if (!
|
|
139
|
+
function he(e) {
|
|
140
|
+
if (!ct(e))
|
|
131
141
|
throw new Error("Invalid conversation payload from folder assignment endpoint");
|
|
132
142
|
return e;
|
|
133
143
|
}
|
|
134
|
-
const
|
|
144
|
+
const P = {
|
|
135
145
|
async fetchFolders() {
|
|
136
146
|
const e = await l.get("/v1/messaging/folders");
|
|
137
|
-
return
|
|
147
|
+
return ut(I(e.data));
|
|
138
148
|
},
|
|
139
149
|
async createFolder(e) {
|
|
140
150
|
const t = await l.post("/v1/messaging/folders", e);
|
|
141
|
-
return
|
|
151
|
+
return ne(I(t.data));
|
|
142
152
|
},
|
|
143
153
|
async updateFolder(e, t) {
|
|
144
154
|
const s = await l.patch(`/v1/messaging/folders/${e}`, t);
|
|
145
|
-
return
|
|
155
|
+
return ne(I(s.data));
|
|
146
156
|
},
|
|
147
157
|
async deleteFolder(e) {
|
|
148
158
|
await l.delete(`/v1/messaging/folders/${e}`);
|
|
@@ -154,16 +164,16 @@ const q = {
|
|
|
154
164
|
const s = await l.patch(`/v1/messaging/conversations/${e}/folder`, {
|
|
155
165
|
folder_id: t
|
|
156
166
|
});
|
|
157
|
-
return
|
|
167
|
+
return he(I(s.data));
|
|
158
168
|
},
|
|
159
169
|
async acceptRequest(e) {
|
|
160
170
|
const t = await l.post(`/v1/messaging/conversations/${e}/accept`);
|
|
161
|
-
return
|
|
171
|
+
return he(I(t.data));
|
|
162
172
|
},
|
|
163
173
|
async declineRequest(e) {
|
|
164
174
|
await l.post(`/v1/messaging/conversations/${e}/decline`);
|
|
165
175
|
}
|
|
166
|
-
},
|
|
176
|
+
}, ge = 1e3, oe = 4e3, dt = 12e4, lt = 300, ft = 1, ht = 1600, ae = (e) => {
|
|
167
177
|
if (typeof e == "number" && Number.isFinite(e))
|
|
168
178
|
return e;
|
|
169
179
|
if (typeof e == "string") {
|
|
@@ -171,32 +181,32 @@ const q = {
|
|
|
171
181
|
if (Number.isFinite(t))
|
|
172
182
|
return t;
|
|
173
183
|
}
|
|
174
|
-
},
|
|
175
|
-
const s =
|
|
176
|
-
return s === void 0 ? !0 : s === 429 ||
|
|
177
|
-
},
|
|
184
|
+
}, Ue = (e) => typeof e == "number" && e >= 500 && e < 600, me = (e) => {
|
|
185
|
+
const s = ae(e.response?.status);
|
|
186
|
+
return s === void 0 ? !0 : s === 429 || Ue(s);
|
|
187
|
+
}, ze = (e) => {
|
|
178
188
|
if (typeof e == "number" && Number.isFinite(e) && e > 0)
|
|
179
|
-
return Math.max(
|
|
189
|
+
return Math.max(ge, e * 1e3);
|
|
180
190
|
if (typeof e == "string") {
|
|
181
191
|
const t = Number.parseInt(e, 10);
|
|
182
192
|
if (Number.isFinite(t) && t > 0)
|
|
183
|
-
return Math.max(
|
|
193
|
+
return Math.max(ge, t * 1e3);
|
|
184
194
|
}
|
|
185
|
-
return
|
|
186
|
-
},
|
|
187
|
-
const t = Math.max(0, e), s = 2 ** Math.min(t, 6), n =
|
|
188
|
-
return Math.min(
|
|
189
|
-
},
|
|
195
|
+
return oe;
|
|
196
|
+
}, gt = (e) => {
|
|
197
|
+
const t = Math.max(0, e), s = 2 ** Math.min(t, 6), n = oe * s;
|
|
198
|
+
return Math.min(dt, n);
|
|
199
|
+
}, mt = (e) => {
|
|
190
200
|
const t = e;
|
|
191
|
-
return
|
|
192
|
-
},
|
|
201
|
+
return ae(t.response?.status) === 429 ? ze(t.response?.headers?.["retry-after"]) : lt;
|
|
202
|
+
}, pe = async (e) => {
|
|
193
203
|
await new Promise((t) => {
|
|
194
204
|
setTimeout(t, e);
|
|
195
205
|
});
|
|
196
|
-
},
|
|
197
|
-
if (!
|
|
206
|
+
}, pt = (e) => {
|
|
207
|
+
if (!M(e))
|
|
198
208
|
return !1;
|
|
199
|
-
const s = (
|
|
209
|
+
const s = (M(e.data) ? e.data : e).throttled;
|
|
200
210
|
if (typeof s == "boolean")
|
|
201
211
|
return s;
|
|
202
212
|
if (typeof s == "number")
|
|
@@ -207,7 +217,7 @@ const q = {
|
|
|
207
217
|
}
|
|
208
218
|
return !1;
|
|
209
219
|
};
|
|
210
|
-
function
|
|
220
|
+
function vt(e, t, s) {
|
|
211
221
|
const n = typeof e == "string" && e.trim().length > 0 ? e.trim().toLowerCase() : void 0;
|
|
212
222
|
if (n)
|
|
213
223
|
return n;
|
|
@@ -217,17 +227,17 @@ function mt(e, t, s) {
|
|
|
217
227
|
const i = typeof s == "string" && s.trim().length > 0 ? s.trim().toLowerCase() : void 0;
|
|
218
228
|
return i ? i === "image" ? "image/*" : i === "video" ? "video/*" : i === "audio" ? "audio/*" : i : "application/octet-stream";
|
|
219
229
|
}
|
|
220
|
-
function
|
|
230
|
+
function _t(e) {
|
|
221
231
|
const t = e.url || "", s = e.thumbnail_url ?? e.thumbnail, n = {
|
|
222
232
|
id: e.media_id ?? e.id ?? "",
|
|
223
|
-
name: e.name ??
|
|
233
|
+
name: e.name ?? yt(t),
|
|
224
234
|
url: t,
|
|
225
|
-
type:
|
|
235
|
+
type: vt(e.mime, e.mime_type, e.type),
|
|
226
236
|
size: e.size ?? 0
|
|
227
237
|
};
|
|
228
238
|
return s !== void 0 && (n.thumbnail = s), n;
|
|
229
239
|
}
|
|
230
|
-
function
|
|
240
|
+
function yt(e) {
|
|
231
241
|
if (!e) return "attachment";
|
|
232
242
|
try {
|
|
233
243
|
const s = new URL(e).pathname.split("/");
|
|
@@ -236,20 +246,20 @@ function vt(e) {
|
|
|
236
246
|
return "attachment";
|
|
237
247
|
}
|
|
238
248
|
}
|
|
239
|
-
function
|
|
240
|
-
return !Array.isArray(e) || e.length === 0 ? [] : e.map(
|
|
249
|
+
function bt(e) {
|
|
250
|
+
return !Array.isArray(e) || e.length === 0 ? [] : e.map(_t);
|
|
241
251
|
}
|
|
242
|
-
function
|
|
252
|
+
function X(e) {
|
|
243
253
|
if (typeof e != "string")
|
|
244
254
|
return;
|
|
245
255
|
const t = e.trim();
|
|
246
256
|
if (t.length !== 0)
|
|
247
257
|
return t;
|
|
248
258
|
}
|
|
249
|
-
function
|
|
259
|
+
function Ct(e) {
|
|
250
260
|
if (!e)
|
|
251
261
|
return;
|
|
252
|
-
const t =
|
|
262
|
+
const t = X(e.avatar) ?? X(e.avatar_url), s = typeof e.handle == "string" && e.handle.length > 0 ? e.handle : void 0;
|
|
253
263
|
return {
|
|
254
264
|
id: e.id ?? "",
|
|
255
265
|
name: e.name ?? "",
|
|
@@ -273,54 +283,60 @@ function Y(e) {
|
|
|
273
283
|
} : null;
|
|
274
284
|
return {
|
|
275
285
|
...e,
|
|
276
|
-
...s ? { author:
|
|
286
|
+
...s ? { author: Ct(s) } : {},
|
|
277
287
|
shared_post: n,
|
|
278
|
-
attachments:
|
|
288
|
+
attachments: bt(e.attachments)
|
|
279
289
|
};
|
|
280
290
|
}
|
|
281
|
-
function
|
|
291
|
+
function St(e) {
|
|
282
292
|
return typeof e != "string" || e.length === 0 ? null : e;
|
|
283
293
|
}
|
|
284
|
-
function
|
|
294
|
+
function ve(e) {
|
|
285
295
|
if (!(typeof e != "string" || e.length === 0))
|
|
286
296
|
return e;
|
|
287
297
|
}
|
|
288
|
-
function
|
|
298
|
+
function re(e) {
|
|
289
299
|
return typeof e == "string" && e.length > 0 && !e.startsWith("temp-");
|
|
290
300
|
}
|
|
291
|
-
function
|
|
301
|
+
function Mt(e, t = []) {
|
|
292
302
|
const s = /* @__PURE__ */ new Map();
|
|
293
303
|
for (const n of t) {
|
|
294
|
-
const r =
|
|
304
|
+
const r = ve(n.last_read_message_id);
|
|
295
305
|
r && s.set(n.user_id, r);
|
|
296
306
|
}
|
|
297
307
|
return e.map((n) => {
|
|
298
|
-
const r =
|
|
308
|
+
const r = Object.prototype.hasOwnProperty.call(n, "last_read_message_id"), i = X(n.user?.avatar) ?? X(n.user?.avatar_url), o = n.user ? {
|
|
299
309
|
id: n.user.id,
|
|
300
310
|
name: n.user.name,
|
|
301
|
-
...
|
|
311
|
+
...i ? { avatar: i } : {},
|
|
302
312
|
...n.user.handle ? { handle: n.user.handle } : {}
|
|
303
|
-
} : void 0,
|
|
304
|
-
if (
|
|
313
|
+
} : void 0, a = ve(n.last_read_message_id);
|
|
314
|
+
if (a)
|
|
305
315
|
return {
|
|
306
316
|
...n,
|
|
307
|
-
...
|
|
308
|
-
last_read_message_id:
|
|
317
|
+
...o ? { user: o } : {},
|
|
318
|
+
last_read_message_id: a
|
|
309
319
|
};
|
|
310
|
-
|
|
311
|
-
|
|
320
|
+
if (r)
|
|
321
|
+
return {
|
|
322
|
+
...n,
|
|
323
|
+
...o ? { user: o } : {},
|
|
324
|
+
last_read_message_id: ""
|
|
325
|
+
};
|
|
326
|
+
const u = s.get(n.user_id);
|
|
327
|
+
return u ? {
|
|
312
328
|
...n,
|
|
313
|
-
...
|
|
314
|
-
last_read_message_id:
|
|
329
|
+
...o ? { user: o } : {},
|
|
330
|
+
last_read_message_id: u
|
|
315
331
|
} : {
|
|
316
332
|
...n,
|
|
317
|
-
...
|
|
333
|
+
...o ? { user: o } : {},
|
|
318
334
|
last_read_message_id: ""
|
|
319
335
|
};
|
|
320
336
|
});
|
|
321
337
|
}
|
|
322
338
|
function D(e, t) {
|
|
323
|
-
const s =
|
|
339
|
+
const s = St(e.muted_until), n = e.is_muted ?? s !== null, r = e.last_message ? Y(e.last_message) : t?.last_message, i = e.last_message_at ?? t?.last_message_at, o = (() => {
|
|
324
340
|
if (!t || t.unread_count !== 0 || e.unread_count <= 0)
|
|
325
341
|
return !1;
|
|
326
342
|
const a = t.last_message?.id, u = e.last_message?.id;
|
|
@@ -329,43 +345,43 @@ function D(e, t) {
|
|
|
329
345
|
return {
|
|
330
346
|
...e,
|
|
331
347
|
unread_count: n || o ? 0 : e.unread_count,
|
|
332
|
-
participants:
|
|
348
|
+
participants: Mt(e.participants, t?.participants),
|
|
333
349
|
is_muted: n,
|
|
334
350
|
muted_until: s,
|
|
335
351
|
...r ? { last_message: r } : {},
|
|
336
352
|
...i ? { last_message_at: i } : {}
|
|
337
353
|
};
|
|
338
354
|
}
|
|
339
|
-
function
|
|
355
|
+
function wt(e) {
|
|
340
356
|
return e.is_muted ? !0 : typeof e.muted_until == "string" && e.muted_until.length > 0;
|
|
341
357
|
}
|
|
342
|
-
function
|
|
343
|
-
return
|
|
358
|
+
function ee(e) {
|
|
359
|
+
return wt(e) ? 0 : e.unread_count || 0;
|
|
344
360
|
}
|
|
345
|
-
function
|
|
361
|
+
function _e(e, t) {
|
|
346
362
|
const s = t[e.id];
|
|
347
363
|
if (Array.isArray(s))
|
|
348
364
|
for (let n = s.length - 1; n >= 0; n -= 1) {
|
|
349
365
|
const r = s[n]?.id;
|
|
350
|
-
if (
|
|
366
|
+
if (re(r))
|
|
351
367
|
return r;
|
|
352
368
|
}
|
|
353
|
-
return
|
|
369
|
+
return re(e.last_message?.id) ? e.last_message.id : null;
|
|
354
370
|
}
|
|
355
|
-
function
|
|
371
|
+
function M(e) {
|
|
356
372
|
return typeof e == "object" && e !== null;
|
|
357
373
|
}
|
|
358
|
-
function
|
|
359
|
-
return
|
|
374
|
+
function Rt(e) {
|
|
375
|
+
return M(e) ? (M(e.response) ? e.response : null)?.status === 401 : !1;
|
|
360
376
|
}
|
|
361
|
-
function
|
|
377
|
+
function ye(e) {
|
|
362
378
|
if (!Array.isArray(e))
|
|
363
379
|
return [];
|
|
364
380
|
const t = [];
|
|
365
381
|
for (const s of e) {
|
|
366
|
-
if (!
|
|
382
|
+
if (!M(s) || typeof s.reaction != "string" || typeof s.count != "number" || !Array.isArray(s.users))
|
|
367
383
|
continue;
|
|
368
|
-
const n = s.users.filter((r) =>
|
|
384
|
+
const n = s.users.filter((r) => M(r)).filter(
|
|
369
385
|
(r) => typeof r.id == "string" && typeof r.name == "string"
|
|
370
386
|
).map((r) => ({
|
|
371
387
|
id: r.id,
|
|
@@ -379,58 +395,58 @@ function Me(e) {
|
|
|
379
395
|
}
|
|
380
396
|
return t;
|
|
381
397
|
}
|
|
382
|
-
function
|
|
383
|
-
const s =
|
|
398
|
+
function At(e, t) {
|
|
399
|
+
const s = M(t) ? t : null, n = s?.next ?? s?.next_cursor ?? e.next_cursor;
|
|
384
400
|
if (!(typeof n != "string" || n.length === 0))
|
|
385
401
|
return n;
|
|
386
402
|
}
|
|
387
|
-
function
|
|
388
|
-
const s =
|
|
403
|
+
function H(e, t) {
|
|
404
|
+
const s = M(e) ? e : {}, n = s.data ?? e;
|
|
389
405
|
let r = [];
|
|
390
|
-
return Array.isArray(n) ? r = n :
|
|
406
|
+
return Array.isArray(n) ? r = n : M(n) && (Array.isArray(n.items) ? r = n.items : Array.isArray(n[t]) ? r = n[t] : Array.isArray(n.data) && (r = n.data)), {
|
|
391
407
|
items: r,
|
|
392
|
-
nextCursor:
|
|
408
|
+
nextCursor: At(s, n)
|
|
393
409
|
};
|
|
394
410
|
}
|
|
395
|
-
function
|
|
396
|
-
return
|
|
411
|
+
function be(e) {
|
|
412
|
+
return M(e) && typeof e.id == "string" && e.id.length > 0;
|
|
397
413
|
}
|
|
398
|
-
function
|
|
399
|
-
return
|
|
414
|
+
function Ce(e) {
|
|
415
|
+
return M(e) ? typeof e.id == "string" && (e.type === "dm" || e.type === "group") && Array.isArray(e.participants) : !1;
|
|
400
416
|
}
|
|
401
|
-
function
|
|
417
|
+
function W(e, t) {
|
|
402
418
|
if (e.is_pinned !== t.is_pinned)
|
|
403
419
|
return e.is_pinned ? -1 : 1;
|
|
404
420
|
const s = e.last_message_at ?? e.created_at, r = (t.last_message_at ?? t.created_at).localeCompare(s);
|
|
405
421
|
return r !== 0 ? r : e.id.localeCompare(t.id);
|
|
406
422
|
}
|
|
407
|
-
function
|
|
423
|
+
function j(e, t) {
|
|
408
424
|
return [t, ...e.filter((s) => s.id !== t.id)];
|
|
409
425
|
}
|
|
410
|
-
function
|
|
426
|
+
function $(e) {
|
|
411
427
|
return [...e].sort((t, s) => t.sort_order !== s.sort_order ? t.sort_order - s.sort_order : t.name.localeCompare(s.name));
|
|
412
428
|
}
|
|
413
|
-
function
|
|
429
|
+
function Et(e, t) {
|
|
414
430
|
return typeof e != "string" || e.length === 0 ? null : t.has(e) ? e : null;
|
|
415
431
|
}
|
|
416
|
-
function
|
|
432
|
+
function Se(e, t) {
|
|
417
433
|
return e.map((s) => {
|
|
418
|
-
const n =
|
|
434
|
+
const n = Et(s.folder_id, t);
|
|
419
435
|
return (s.folder_id ?? null) === n ? s : {
|
|
420
436
|
...s,
|
|
421
437
|
folder_id: n
|
|
422
438
|
};
|
|
423
439
|
});
|
|
424
440
|
}
|
|
425
|
-
function
|
|
441
|
+
function te(e) {
|
|
426
442
|
const t = /* @__PURE__ */ new Map();
|
|
427
443
|
for (const s of e.requests)
|
|
428
444
|
s.is_request === !0 && t.set(s.id, s);
|
|
429
445
|
for (const s of e.conversations)
|
|
430
446
|
s.is_request === !0 && t.set(s.id, s);
|
|
431
|
-
return Array.from(t.values()).sort(
|
|
447
|
+
return Array.from(t.values()).sort(W);
|
|
432
448
|
}
|
|
433
|
-
const
|
|
449
|
+
const Ie = Ge("messaging", {
|
|
434
450
|
state: () => ({
|
|
435
451
|
conversations: [],
|
|
436
452
|
requests: [],
|
|
@@ -457,46 +473,46 @@ const Oe = Ve("messaging", {
|
|
|
457
473
|
getConversationById: (e) => (t) => e.conversations.find((s) => s.id === t),
|
|
458
474
|
getMessagesByConversationId: (e) => (t) => e.messages[t] || [],
|
|
459
475
|
getTypingUsers: (e) => (t) => e.typingUsers[t] || [],
|
|
460
|
-
unreadConversationsCount: (e) => e.conversations.filter((t) =>
|
|
461
|
-
unreadCount: (e) => e.conversations.reduce((t, s) => t +
|
|
462
|
-
totalUnreadCount: (e) => e.conversations.reduce((t, s) => t +
|
|
463
|
-
sortedFolders: (e) =>
|
|
476
|
+
unreadConversationsCount: (e) => e.conversations.filter((t) => ee(t) > 0).length,
|
|
477
|
+
unreadCount: (e) => e.conversations.reduce((t, s) => t + ee(s), 0),
|
|
478
|
+
totalUnreadCount: (e) => e.conversations.reduce((t, s) => t + ee(s), 0),
|
|
479
|
+
sortedFolders: (e) => $(e.folders),
|
|
464
480
|
folderById: (e) => (t) => e.folders.find((s) => s.id === t),
|
|
465
481
|
conversationsInFolder: (e) => (t) => e.conversations.filter((s) => s.folder_id === t),
|
|
466
482
|
hasMoreMessages: (e) => (t) => e.conversationHasMore[t] ?? !1,
|
|
467
483
|
isLoadingMessages: (e) => (t) => e.loadingMessages[t] ?? !1,
|
|
468
484
|
// Message request getters
|
|
469
|
-
requestConversations: (e) =>
|
|
470
|
-
requestCount: (e) =>
|
|
471
|
-
unreadRequestCount: (e) =>
|
|
485
|
+
requestConversations: (e) => te(e),
|
|
486
|
+
requestCount: (e) => te(e).length,
|
|
487
|
+
unreadRequestCount: (e) => te(e).filter((t) => t.unread_count > 0).length
|
|
472
488
|
},
|
|
473
489
|
actions: {
|
|
474
490
|
normalizeFolderAssignmentsState() {
|
|
475
491
|
if (!this.foldersLoaded)
|
|
476
492
|
return;
|
|
477
493
|
const e = new Set(this.folders.map((t) => t.id));
|
|
478
|
-
this.conversations =
|
|
494
|
+
this.conversations = Se(this.conversations, e), this.requests = Se(this.requests, e), this.activeFolderId !== null && !e.has(this.activeFolderId) && (this.activeFolderId = null);
|
|
479
495
|
},
|
|
480
496
|
async fetchFolders() {
|
|
481
497
|
try {
|
|
482
|
-
const e = await
|
|
483
|
-
return this.folders =
|
|
498
|
+
const e = await P.fetchFolders();
|
|
499
|
+
return this.folders = $(e), this.foldersLoaded = !0, this.normalizeFolderAssignmentsState(), this.folders;
|
|
484
500
|
} catch (e) {
|
|
485
501
|
throw this.error = m(e), e;
|
|
486
502
|
}
|
|
487
503
|
},
|
|
488
504
|
async createFolder(e) {
|
|
489
505
|
try {
|
|
490
|
-
const t = await
|
|
491
|
-
return this.folders =
|
|
506
|
+
const t = await P.createFolder(e);
|
|
507
|
+
return this.folders = $([...this.folders, t]), t;
|
|
492
508
|
} catch (t) {
|
|
493
509
|
throw this.error = m(t), t;
|
|
494
510
|
}
|
|
495
511
|
},
|
|
496
512
|
async updateFolder(e, t) {
|
|
497
513
|
try {
|
|
498
|
-
const s = await
|
|
499
|
-
return this.folders =
|
|
514
|
+
const s = await P.updateFolder(e, t);
|
|
515
|
+
return this.folders = $(
|
|
500
516
|
this.folders.map((n) => n.id === e ? s : n)
|
|
501
517
|
), s;
|
|
502
518
|
} catch (s) {
|
|
@@ -505,14 +521,14 @@ const Oe = Ve("messaging", {
|
|
|
505
521
|
},
|
|
506
522
|
async deleteFolder(e) {
|
|
507
523
|
try {
|
|
508
|
-
await
|
|
524
|
+
await P.deleteFolder(e), this.folders = this.folders.filter((t) => t.id !== e), this.foldersLoaded = !0, this.activeFolderId === e && (this.activeFolderId = null), this.normalizeFolderAssignmentsState();
|
|
509
525
|
} catch (t) {
|
|
510
526
|
throw this.error = m(t), t;
|
|
511
527
|
}
|
|
512
528
|
},
|
|
513
529
|
async reorderFolders(e) {
|
|
514
530
|
try {
|
|
515
|
-
await
|
|
531
|
+
await P.reorderFolders(e);
|
|
516
532
|
const t = new Map(this.folders.map((r) => [r.id, r])), s = [];
|
|
517
533
|
for (const r of e) {
|
|
518
534
|
const i = t.get(r);
|
|
@@ -521,7 +537,7 @@ const Oe = Ve("messaging", {
|
|
|
521
537
|
sort_order: s.length + 1
|
|
522
538
|
}), t.delete(r));
|
|
523
539
|
}
|
|
524
|
-
const n =
|
|
540
|
+
const n = $(Array.from(t.values()));
|
|
525
541
|
for (const r of n)
|
|
526
542
|
s.push({
|
|
527
543
|
...r,
|
|
@@ -534,7 +550,7 @@ const Oe = Ve("messaging", {
|
|
|
534
550
|
},
|
|
535
551
|
async assignToFolder(e, t) {
|
|
536
552
|
try {
|
|
537
|
-
const s = await
|
|
553
|
+
const s = await P.assignFolder(e, t), n = this.conversations.findIndex((o) => o.id === e);
|
|
538
554
|
if (n < 0)
|
|
539
555
|
return;
|
|
540
556
|
const r = this.conversations[n];
|
|
@@ -554,7 +570,7 @@ const Oe = Ve("messaging", {
|
|
|
554
570
|
try {
|
|
555
571
|
const r = n?.includePresence ?? !0, i = {};
|
|
556
572
|
r && (i.include_presence = 1), e && (i.cursor = e), t && (i.filter = t), typeof s == "string" && s.length > 0 && (i.folder_id = s);
|
|
557
|
-
const o = await l.get("/v1/messaging/conversations", { params: i }), { items: a, nextCursor: u } =
|
|
573
|
+
const o = await l.get("/v1/messaging/conversations", { params: i }), { items: a, nextCursor: u } = H(
|
|
558
574
|
o.data,
|
|
559
575
|
"conversations"
|
|
560
576
|
), f = a.map((d) => {
|
|
@@ -564,13 +580,13 @@ const Oe = Ve("messaging", {
|
|
|
564
580
|
return D(d, p);
|
|
565
581
|
});
|
|
566
582
|
e ? this.conversations.push(...f) : this.conversations = f, this.normalizeFolderAssignmentsState(), this.lastFetch = Date.now();
|
|
567
|
-
const
|
|
583
|
+
const y = {
|
|
568
584
|
data: f,
|
|
569
585
|
has_more: !!u
|
|
570
586
|
};
|
|
571
|
-
return u !== void 0 && (
|
|
587
|
+
return u !== void 0 && (y.next_cursor = u), y;
|
|
572
588
|
} catch (r) {
|
|
573
|
-
throw n?.background &&
|
|
589
|
+
throw n?.background && me(r) || (this.error = m(r)), r;
|
|
574
590
|
} finally {
|
|
575
591
|
this.loading = !1;
|
|
576
592
|
}
|
|
@@ -584,8 +600,8 @@ const Oe = Ve("messaging", {
|
|
|
584
600
|
includePresence: !1
|
|
585
601
|
}), this.backgroundPollRetryAfterUntil = 0, this.backgroundPollTransientFailureCount = 0, !0;
|
|
586
602
|
} catch (e) {
|
|
587
|
-
const t = e, s =
|
|
588
|
-
return s === 429 ? (this.backgroundPollRetryAfterUntil = Date.now() +
|
|
603
|
+
const t = e, s = ae(t.response?.status);
|
|
604
|
+
return s === 429 ? (this.backgroundPollRetryAfterUntil = Date.now() + ze(t.response?.headers?.["retry-after"]), !1) : (this.backgroundPollTransientFailureCount += 1, s === void 0 || Ue(s) ? (this.backgroundPollRetryAfterUntil = Date.now() + gt(this.backgroundPollTransientFailureCount), !1) : (this.backgroundPollRetryAfterUntil = Date.now() + oe, !1));
|
|
589
605
|
}
|
|
590
606
|
},
|
|
591
607
|
async fetchConversation(e) {
|
|
@@ -611,7 +627,7 @@ const Oe = Ve("messaging", {
|
|
|
611
627
|
filter: "requests"
|
|
612
628
|
};
|
|
613
629
|
e && (t.cursor = e);
|
|
614
|
-
const s = await l.get("/v1/messaging/conversations", { params: t }), { items: n, nextCursor: r } =
|
|
630
|
+
const s = await l.get("/v1/messaging/conversations", { params: t }), { items: n, nextCursor: r } = H(
|
|
615
631
|
s.data,
|
|
616
632
|
"conversations"
|
|
617
633
|
), i = n.map((a) => {
|
|
@@ -640,11 +656,11 @@ const Oe = Ve("messaging", {
|
|
|
640
656
|
r = await l.get(`/v1/messaging/conversations/${e}/messages`, { params: s });
|
|
641
657
|
break;
|
|
642
658
|
} catch (d) {
|
|
643
|
-
if (!(n <
|
|
659
|
+
if (!(n < ft && me(d)))
|
|
644
660
|
throw d;
|
|
645
|
-
n += 1, await
|
|
661
|
+
n += 1, await pe(mt(d));
|
|
646
662
|
}
|
|
647
|
-
const { items: i, nextCursor: o } =
|
|
663
|
+
const { items: i, nextCursor: o } = H(
|
|
648
664
|
r.data,
|
|
649
665
|
"messages"
|
|
650
666
|
), a = i.map(Y), u = [...a].reverse();
|
|
@@ -656,11 +672,11 @@ const Oe = Ve("messaging", {
|
|
|
656
672
|
d && this.updateConversationLastMessage(e, d);
|
|
657
673
|
}
|
|
658
674
|
o ? (this.conversationCursors[e] = o, this.conversationHasMore[e] = !0) : (delete this.conversationCursors[e], this.conversationHasMore[e] = !1);
|
|
659
|
-
const
|
|
675
|
+
const y = {
|
|
660
676
|
data: a,
|
|
661
677
|
has_more: !!o
|
|
662
678
|
};
|
|
663
|
-
return o !== void 0 && (
|
|
679
|
+
return o !== void 0 && (y.next_cursor = o), y;
|
|
664
680
|
} catch (s) {
|
|
665
681
|
throw this.error = m(s), s;
|
|
666
682
|
} finally {
|
|
@@ -668,7 +684,7 @@ const Oe = Ve("messaging", {
|
|
|
668
684
|
}
|
|
669
685
|
},
|
|
670
686
|
async sendMessage(e, t, s, n, r, i) {
|
|
671
|
-
const o = L(), a = `temp-${Date.now()}-${Math.random()}`, u = typeof i == "string" && i.trim().length > 0 ? i.trim() : null, f = o.currentUser,
|
|
687
|
+
const o = L(), a = `temp-${Date.now()}-${Math.random()}`, u = typeof i == "string" && i.trim().length > 0 ? i.trim() : null, f = o.currentUser, y = {
|
|
672
688
|
id: a,
|
|
673
689
|
conversation_id: e,
|
|
674
690
|
author_id: f?.id || "",
|
|
@@ -679,12 +695,12 @@ const Oe = Ve("messaging", {
|
|
|
679
695
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
680
696
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
681
697
|
};
|
|
682
|
-
f && (
|
|
698
|
+
f && (y.author = {
|
|
683
699
|
id: f.id,
|
|
684
700
|
name: f.name,
|
|
685
701
|
...f.avatar ? { avatar: f.avatar } : {},
|
|
686
702
|
...f.handle ? { handle: f.handle } : {}
|
|
687
|
-
}), n != null && (
|
|
703
|
+
}), n != null && (y.reply_to_id = n), r != null && (y.reply_to = r), this.messages[e] || (this.messages[e] = []), this.messages[e].push(y), this._pendingSendIds.add(a);
|
|
688
704
|
try {
|
|
689
705
|
let d;
|
|
690
706
|
const p = {
|
|
@@ -694,12 +710,12 @@ const Oe = Ve("messaging", {
|
|
|
694
710
|
};
|
|
695
711
|
if (s && s.length > 0) {
|
|
696
712
|
const v = await Promise.all(
|
|
697
|
-
s.map(async (
|
|
698
|
-
const
|
|
713
|
+
s.map(async (E) => {
|
|
714
|
+
const b = await it().uploadImage(E);
|
|
699
715
|
return {
|
|
700
|
-
media_id:
|
|
701
|
-
mime:
|
|
702
|
-
size:
|
|
716
|
+
media_id: b.id,
|
|
717
|
+
mime: b.mime_type,
|
|
718
|
+
size: b.size
|
|
703
719
|
};
|
|
704
720
|
})
|
|
705
721
|
);
|
|
@@ -712,15 +728,15 @@ const Oe = Ve("messaging", {
|
|
|
712
728
|
...p,
|
|
713
729
|
type: "text"
|
|
714
730
|
});
|
|
715
|
-
const F = d.data.data || d.data,
|
|
716
|
-
|
|
717
|
-
const
|
|
731
|
+
const F = d.data.data || d.data, N = { ...y, ...F, attachments: F.attachments ?? y.attachments }, A = Y(N), T = this.messages[e], x = T.findIndex((v) => v.id === a);
|
|
732
|
+
x >= 0 && (T[x] = A), this._pendingSendIds.delete(a);
|
|
733
|
+
const U = A.id;
|
|
718
734
|
let h = 0;
|
|
719
|
-
for (let v =
|
|
720
|
-
const
|
|
721
|
-
|
|
735
|
+
for (let v = T.length - 1; v >= 0; v--) {
|
|
736
|
+
const E = T[v];
|
|
737
|
+
E && E.id === U && (h++, h > 1 && T.splice(v, 1));
|
|
722
738
|
}
|
|
723
|
-
return this.updateConversationLastMessage(e,
|
|
739
|
+
return this.updateConversationLastMessage(e, A), A;
|
|
724
740
|
} catch (d) {
|
|
725
741
|
throw this._pendingSendIds.delete(a), this.messages[e] = this.messages[e].filter((p) => p.id !== a), this.error = m(d), d;
|
|
726
742
|
}
|
|
@@ -762,11 +778,11 @@ const Oe = Ve("messaging", {
|
|
|
762
778
|
return null;
|
|
763
779
|
for (let i = r.length - 1; i >= 0; i -= 1) {
|
|
764
780
|
const o = r[i]?.id;
|
|
765
|
-
if (
|
|
781
|
+
if (re(o))
|
|
766
782
|
return o;
|
|
767
783
|
}
|
|
768
784
|
return null;
|
|
769
|
-
})(), n = t ?
|
|
785
|
+
})(), n = t ? _e(t, this.messages) : s;
|
|
770
786
|
if (!n)
|
|
771
787
|
return;
|
|
772
788
|
await l.post(`/v1/messaging/conversations/${e}/read`, {
|
|
@@ -785,7 +801,7 @@ const Oe = Ve("messaging", {
|
|
|
785
801
|
if (e.length === 0)
|
|
786
802
|
return;
|
|
787
803
|
const t = e.map((r) => {
|
|
788
|
-
const i =
|
|
804
|
+
const i = _e(r, this.messages);
|
|
789
805
|
return i ? {
|
|
790
806
|
conversationId: r.id,
|
|
791
807
|
messageId: i
|
|
@@ -817,9 +833,9 @@ const Oe = Ve("messaging", {
|
|
|
817
833
|
async sendTyping(e, t = "start") {
|
|
818
834
|
try {
|
|
819
835
|
const s = await l.post(`/v1/messaging/conversations/${e}/typing`, { state: t });
|
|
820
|
-
if (t !== "start" || !
|
|
836
|
+
if (t !== "start" || !pt(s.data))
|
|
821
837
|
return;
|
|
822
|
-
await
|
|
838
|
+
await pe(ht), await l.post(`/v1/messaging/conversations/${e}/typing`, { state: t });
|
|
823
839
|
} catch (s) {
|
|
824
840
|
console.warn("Failed to send typing indicator:", s);
|
|
825
841
|
}
|
|
@@ -859,7 +875,7 @@ const Oe = Ve("messaging", {
|
|
|
859
875
|
try {
|
|
860
876
|
await l.patch(`/v1/messaging/conversations/${e}/pin`, { pinned: t });
|
|
861
877
|
const s = this.conversations.find((n) => n.id === e);
|
|
862
|
-
s && (s.is_pinned = t), this.conversations.sort(
|
|
878
|
+
s && (s.is_pinned = t), this.conversations.sort(W);
|
|
863
879
|
} catch (s) {
|
|
864
880
|
throw this.error = m(s), s;
|
|
865
881
|
}
|
|
@@ -885,10 +901,10 @@ const Oe = Ve("messaging", {
|
|
|
885
901
|
};
|
|
886
902
|
t && (s.message = t);
|
|
887
903
|
const n = await l.post("/v1/messaging/conversations/dm", s), r = n.data.data || n.data;
|
|
888
|
-
if (!
|
|
904
|
+
if (!be(r))
|
|
889
905
|
throw new Error("Invalid conversation payload from DM create endpoint.");
|
|
890
|
-
const i =
|
|
891
|
-
return i.is_request === !0 ? (this.requests =
|
|
906
|
+
const i = Ce(r) ? D(r) : await this.fetchConversation(r.id);
|
|
907
|
+
return i.is_request === !0 ? (this.requests = j(this.requests, i), this.conversations = this.conversations.filter((o) => o.id !== i.id), i) : (this.conversations = j(this.conversations, i), this.requests = this.requests.filter((o) => o.id !== i.id), i);
|
|
892
908
|
} catch (s) {
|
|
893
909
|
throw this.error = m(s), s;
|
|
894
910
|
}
|
|
@@ -899,10 +915,10 @@ const Oe = Ve("messaging", {
|
|
|
899
915
|
title: e,
|
|
900
916
|
participant_ids: t
|
|
901
917
|
}), n = s.data.data || s.data;
|
|
902
|
-
if (!
|
|
918
|
+
if (!be(n))
|
|
903
919
|
throw new Error("Invalid conversation payload from group create endpoint.");
|
|
904
|
-
const r =
|
|
905
|
-
return this.conversations =
|
|
920
|
+
const r = Ce(n) ? n : await this.fetchConversation(n.id);
|
|
921
|
+
return this.conversations = j(this.conversations, r), r;
|
|
906
922
|
} catch (s) {
|
|
907
923
|
throw this.error = m(s), s;
|
|
908
924
|
}
|
|
@@ -997,17 +1013,17 @@ const Oe = Ve("messaging", {
|
|
|
997
1013
|
try {
|
|
998
1014
|
a = await l.post(n, r);
|
|
999
1015
|
} catch (d) {
|
|
1000
|
-
if (!
|
|
1016
|
+
if (!Rt(d))
|
|
1001
1017
|
throw d;
|
|
1002
1018
|
a = await l.post(n, r);
|
|
1003
1019
|
}
|
|
1004
|
-
const u =
|
|
1005
|
-
|
|
1020
|
+
const u = M(a.data) && "data" in a.data ? a.data.data : a.data, f = ye(
|
|
1021
|
+
M(u) ? u.reactions : void 0
|
|
1006
1022
|
);
|
|
1007
1023
|
(f.length > 0 || o.length === 0) && this.updateMessageReactions(e, t, f);
|
|
1008
1024
|
try {
|
|
1009
|
-
const d = await l.get(n), p =
|
|
1010
|
-
|
|
1025
|
+
const d = await l.get(n), p = M(d.data) && "data" in d.data ? d.data.data : d.data, F = ye(
|
|
1026
|
+
M(p) ? p.reactions : void 0
|
|
1011
1027
|
);
|
|
1012
1028
|
this.updateMessageReactions(e, t, F);
|
|
1013
1029
|
} catch {
|
|
@@ -1038,7 +1054,7 @@ const Oe = Ve("messaging", {
|
|
|
1038
1054
|
const o = i.find((a) => a.id === e);
|
|
1039
1055
|
return o ? (o.last_message = t, o.last_message_at = t.created_at, !0) : !1;
|
|
1040
1056
|
}, n = s(this.conversations), r = s(this.requests);
|
|
1041
|
-
n && this.conversations.sort(
|
|
1057
|
+
n && this.conversations.sort(W), r && this.requests.sort(W);
|
|
1042
1058
|
},
|
|
1043
1059
|
updatePresenceForUser(e, t) {
|
|
1044
1060
|
const s = t === "online" || t === "idle" || t === "dnd";
|
|
@@ -1047,7 +1063,7 @@ const Oe = Ve("messaging", {
|
|
|
1047
1063
|
},
|
|
1048
1064
|
async acceptRequest(e) {
|
|
1049
1065
|
try {
|
|
1050
|
-
const t = await
|
|
1066
|
+
const t = await P.acceptRequest(e);
|
|
1051
1067
|
this.requests = this.requests.filter((n) => n.id !== e);
|
|
1052
1068
|
const s = D({
|
|
1053
1069
|
...t,
|
|
@@ -1055,14 +1071,14 @@ const Oe = Ve("messaging", {
|
|
|
1055
1071
|
is_archived: t.is_archived ?? !1,
|
|
1056
1072
|
is_muted: t.is_muted ?? !1
|
|
1057
1073
|
});
|
|
1058
|
-
this.conversations =
|
|
1074
|
+
this.conversations = j(this.conversations, s);
|
|
1059
1075
|
} catch (t) {
|
|
1060
1076
|
throw this.error = m(t), t;
|
|
1061
1077
|
}
|
|
1062
1078
|
},
|
|
1063
1079
|
async declineRequest(e) {
|
|
1064
1080
|
try {
|
|
1065
|
-
await
|
|
1081
|
+
await P.declineRequest(e), this.requests = this.requests.filter((t) => t.id !== e);
|
|
1066
1082
|
} catch (t) {
|
|
1067
1083
|
throw this.error = m(t), t;
|
|
1068
1084
|
}
|
|
@@ -1074,7 +1090,7 @@ const Oe = Ve("messaging", {
|
|
|
1074
1090
|
t && (n.filter = t), typeof s == "string" && s.length > 0 && (n.folder_id = s);
|
|
1075
1091
|
const r = await l.get("/v1/messaging/conversations", {
|
|
1076
1092
|
params: n
|
|
1077
|
-
}), { items: i } =
|
|
1093
|
+
}), { items: i } = H(
|
|
1078
1094
|
r.data,
|
|
1079
1095
|
"conversations"
|
|
1080
1096
|
);
|
|
@@ -1133,117 +1149,117 @@ const Oe = Ve("messaging", {
|
|
|
1133
1149
|
}
|
|
1134
1150
|
}
|
|
1135
1151
|
});
|
|
1136
|
-
function
|
|
1137
|
-
const t =
|
|
1138
|
-
let
|
|
1139
|
-
const F =
|
|
1140
|
-
d && (clearTimeout(d), d = null),
|
|
1141
|
-
}, E = () => {
|
|
1142
|
-
!a || n.value || d || _ >= u || (d = setTimeout(() => {
|
|
1143
|
-
d = null, _ += 1, T();
|
|
1144
|
-
}, f));
|
|
1152
|
+
function Vt(e) {
|
|
1153
|
+
const t = Ie(), s = L(), n = Q(!1), r = Q(null), i = Q(null), o = Me(), a = o !== null, u = 20, f = 250;
|
|
1154
|
+
let y = 0, d = null, p = null;
|
|
1155
|
+
const F = J(() => s.currentUser?.id), N = () => Oe(e)?.trim() ?? "", A = () => {
|
|
1156
|
+
d && (clearTimeout(d), d = null), y = 0;
|
|
1145
1157
|
}, T = () => {
|
|
1146
|
-
|
|
1158
|
+
!a || n.value || d || y >= u || (d = setTimeout(() => {
|
|
1159
|
+
d = null, y += 1, x();
|
|
1160
|
+
}, f));
|
|
1161
|
+
}, x = () => {
|
|
1162
|
+
const c = N();
|
|
1147
1163
|
if (!(n.value || !c)) {
|
|
1148
|
-
if (!
|
|
1149
|
-
|
|
1164
|
+
if (!O()) {
|
|
1165
|
+
T();
|
|
1150
1166
|
return;
|
|
1151
1167
|
}
|
|
1152
1168
|
r.value = null;
|
|
1153
1169
|
try {
|
|
1154
|
-
p =
|
|
1155
|
-
onMessageSent:
|
|
1156
|
-
onMessageRead:
|
|
1157
|
-
onMessageEdited:
|
|
1158
|
-
onMessageDeleted:
|
|
1159
|
-
onReactionToggled:
|
|
1160
|
-
onRequestAccepted:
|
|
1161
|
-
onParticipantRemoved:
|
|
1162
|
-
}), n.value = !0, i.value = c, t.registerDetailSubscription(c),
|
|
1170
|
+
p = We(c, {
|
|
1171
|
+
onMessageSent: E,
|
|
1172
|
+
onMessageRead: b,
|
|
1173
|
+
onMessageEdited: z,
|
|
1174
|
+
onMessageDeleted: G,
|
|
1175
|
+
onReactionToggled: k,
|
|
1176
|
+
onRequestAccepted: V,
|
|
1177
|
+
onParticipantRemoved: C
|
|
1178
|
+
}), n.value = !0, i.value = c, t.registerDetailSubscription(c), A();
|
|
1163
1179
|
} catch (g) {
|
|
1164
1180
|
r.value = g instanceof Error ? g.message : "Failed to subscribe to conversation", console.error("ConversationChannel: Subscribe error", g);
|
|
1165
1181
|
}
|
|
1166
1182
|
}
|
|
1167
|
-
},
|
|
1168
|
-
n.value ||
|
|
1183
|
+
}, U = () => {
|
|
1184
|
+
n.value || x();
|
|
1169
1185
|
};
|
|
1170
|
-
typeof window < "u" && window.addEventListener(
|
|
1171
|
-
const h =
|
|
1186
|
+
typeof window < "u" && window.addEventListener(le(), U);
|
|
1187
|
+
const h = xe((c) => {
|
|
1172
1188
|
if (c === "connected") {
|
|
1173
|
-
n.value ||
|
|
1189
|
+
n.value || x();
|
|
1174
1190
|
return;
|
|
1175
1191
|
}
|
|
1176
|
-
(c === "disconnected" || c === "error") && (
|
|
1192
|
+
(c === "disconnected" || c === "error") && (A(), p && (p(), p = null), i.value && (t.unregisterDetailSubscription(i.value), i.value = null), n.value = !1);
|
|
1177
1193
|
}), v = () => {
|
|
1178
1194
|
const c = i.value;
|
|
1179
|
-
if (
|
|
1195
|
+
if (A(), !(!n.value || !c))
|
|
1180
1196
|
try {
|
|
1181
|
-
p && (p(), p = null), t.hasGlobalConversationSubscription(c) ||
|
|
1197
|
+
p && (p(), p = null), t.hasGlobalConversationSubscription(c) || Ze(c), n.value = !1, t.unregisterDetailSubscription(c), i.value = null, r.value = null;
|
|
1182
1198
|
} catch (g) {
|
|
1183
1199
|
r.value = g instanceof Error ? g.message : "Failed to unsubscribe from conversation", console.error("ConversationChannel: Unsubscribe error", g);
|
|
1184
1200
|
}
|
|
1185
|
-
},
|
|
1201
|
+
}, E = (c) => {
|
|
1186
1202
|
if (t.addMessage(c.message), c.message.author_id !== F.value) {
|
|
1187
1203
|
const g = t.getConversationById(c.conversation_id);
|
|
1188
1204
|
g && (g.unread_count = 0), t.markAsRead(c.conversation_id).catch(() => {
|
|
1189
1205
|
});
|
|
1190
1206
|
}
|
|
1191
|
-
},
|
|
1207
|
+
}, b = (c) => {
|
|
1192
1208
|
const g = t.getConversationById(c.conversation_id);
|
|
1193
1209
|
if (g) {
|
|
1194
|
-
let
|
|
1195
|
-
const
|
|
1196
|
-
...
|
|
1210
|
+
let w = !1;
|
|
1211
|
+
const R = g.participants.map((S) => S.user_id !== c.user_id || S.last_read_message_id === c.message_id ? S : (w = !0, {
|
|
1212
|
+
...S,
|
|
1197
1213
|
last_read_message_id: c.message_id
|
|
1198
1214
|
}));
|
|
1199
|
-
|
|
1215
|
+
w && (g.participants = R);
|
|
1200
1216
|
}
|
|
1201
|
-
},
|
|
1202
|
-
const g = t.getMessagesByConversationId(c.conversation_id),
|
|
1203
|
-
if (
|
|
1204
|
-
const
|
|
1205
|
-
if (!
|
|
1206
|
-
const
|
|
1207
|
-
c.message.body !== void 0 && (
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1217
|
+
}, z = (c) => {
|
|
1218
|
+
const g = t.getMessagesByConversationId(c.conversation_id), w = g.findIndex((R) => R.id === c.message.id);
|
|
1219
|
+
if (w >= 0) {
|
|
1220
|
+
const R = g[w];
|
|
1221
|
+
if (!R) return;
|
|
1222
|
+
const S = { ...R };
|
|
1223
|
+
c.message.body !== void 0 && (S.body = c.message.body), c.message.edited_at !== void 0 && (S.edited_at = c.message.edited_at), c.message.meta !== void 0 && (S.meta = c.message.meta), g[w] = S;
|
|
1224
|
+
const q = t.getConversationById(c.conversation_id);
|
|
1225
|
+
q && q.last_message?.id === c.message.id && (q.last_message = S);
|
|
1210
1226
|
}
|
|
1211
|
-
}, O = (c) => {
|
|
1212
|
-
t.removeMessage(c.conversation_id, c.message_id);
|
|
1213
1227
|
}, G = (c) => {
|
|
1228
|
+
t.removeMessage(c.conversation_id, c.message_id);
|
|
1229
|
+
}, k = (c) => {
|
|
1214
1230
|
t.updateMessageReactions(
|
|
1215
1231
|
c.conversation_id,
|
|
1216
1232
|
c.message_id,
|
|
1217
1233
|
c.reactions
|
|
1218
1234
|
);
|
|
1219
|
-
},
|
|
1235
|
+
}, V = (c) => {
|
|
1220
1236
|
const g = t.getConversationById(c.conversation_id);
|
|
1221
1237
|
g && (g.is_request = !1), t.requests = t.requests.filter(
|
|
1222
|
-
(
|
|
1238
|
+
(w) => w.id !== c.conversation_id
|
|
1223
1239
|
);
|
|
1224
|
-
},
|
|
1240
|
+
}, C = (c) => {
|
|
1225
1241
|
c.removed_user_id === F.value && (v(), t.deleteConversation(c.conversation_id).catch(() => {
|
|
1226
1242
|
}));
|
|
1227
1243
|
};
|
|
1228
|
-
return o !== null &&
|
|
1229
|
-
|
|
1244
|
+
return o !== null && we(() => {
|
|
1245
|
+
A(), h(), v(), typeof window < "u" && window.removeEventListener(le(), U);
|
|
1230
1246
|
}), {
|
|
1231
|
-
isSubscribed:
|
|
1232
|
-
error:
|
|
1233
|
-
subscribe:
|
|
1247
|
+
isSubscribed: J(() => n.value),
|
|
1248
|
+
error: J(() => r.value),
|
|
1249
|
+
subscribe: x,
|
|
1234
1250
|
unsubscribe: v
|
|
1235
1251
|
};
|
|
1236
1252
|
}
|
|
1237
|
-
const
|
|
1253
|
+
const De = () => {
|
|
1238
1254
|
};
|
|
1239
|
-
let
|
|
1240
|
-
function
|
|
1241
|
-
|
|
1255
|
+
let ce = De;
|
|
1256
|
+
function Ft(e) {
|
|
1257
|
+
ce = e;
|
|
1242
1258
|
}
|
|
1243
|
-
function
|
|
1244
|
-
|
|
1259
|
+
function Tt() {
|
|
1260
|
+
ce = De;
|
|
1245
1261
|
}
|
|
1246
|
-
const
|
|
1262
|
+
const xt = {
|
|
1247
1263
|
debug: () => {
|
|
1248
1264
|
},
|
|
1249
1265
|
info: () => {
|
|
@@ -1252,24 +1268,24 @@ const Et = {
|
|
|
1252
1268
|
},
|
|
1253
1269
|
error: () => {
|
|
1254
1270
|
}
|
|
1255
|
-
},
|
|
1256
|
-
let
|
|
1257
|
-
function
|
|
1258
|
-
|
|
1271
|
+
}, $e = () => xt;
|
|
1272
|
+
let ue = $e;
|
|
1273
|
+
function qt(e) {
|
|
1274
|
+
ue = e;
|
|
1259
1275
|
}
|
|
1260
|
-
function
|
|
1261
|
-
|
|
1276
|
+
function Pt() {
|
|
1277
|
+
ue = $e;
|
|
1262
1278
|
}
|
|
1263
|
-
const
|
|
1264
|
-
function
|
|
1265
|
-
const e =
|
|
1279
|
+
const se = ue("GlobalMessaging"), Lt = 3, Nt = (e) => e.replace(/\/+$/, ""), Ut = (e) => Nt(window.location.pathname) === `/messages/${e}`, zt = (e) => e.is_muted ? !0 : typeof e.muted_until == "string" && e.muted_until.length > 0;
|
|
1280
|
+
function Bt() {
|
|
1281
|
+
const e = Ie(), t = L(), s = He(), n = Me(), { conversations: r } = ke(e), i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
1266
1282
|
let a = !1;
|
|
1267
1283
|
function u(h) {
|
|
1268
1284
|
const v = o.get(h);
|
|
1269
1285
|
if (v && (o.delete(h), typeof v.channel.stopListening == "function"))
|
|
1270
|
-
for (const
|
|
1286
|
+
for (const E of v.bindings)
|
|
1271
1287
|
try {
|
|
1272
|
-
v.channel.stopListening(
|
|
1288
|
+
v.channel.stopListening(E.event, E.handler);
|
|
1273
1289
|
} catch {
|
|
1274
1290
|
}
|
|
1275
1291
|
}
|
|
@@ -1278,68 +1294,68 @@ function kt() {
|
|
|
1278
1294
|
u(h), e.unregisterGlobalConversationSubscription(h);
|
|
1279
1295
|
i.clear();
|
|
1280
1296
|
}
|
|
1281
|
-
function
|
|
1282
|
-
const v =
|
|
1297
|
+
function y(h) {
|
|
1298
|
+
const v = O();
|
|
1283
1299
|
if (!v || i.has(h)) return;
|
|
1284
|
-
const
|
|
1285
|
-
const c = e.getConversationById(
|
|
1300
|
+
const E = (C) => {
|
|
1301
|
+
const c = e.getConversationById(C.conversation_id);
|
|
1286
1302
|
if (!c)
|
|
1287
1303
|
return;
|
|
1288
1304
|
let g = !1;
|
|
1289
|
-
const
|
|
1290
|
-
...
|
|
1291
|
-
last_read_message_id:
|
|
1305
|
+
const w = c.participants.map((R) => R.user_id !== C.user_id || R.last_read_message_id === C.message_id ? R : (g = !0, {
|
|
1306
|
+
...R,
|
|
1307
|
+
last_read_message_id: C.message_id
|
|
1292
1308
|
}));
|
|
1293
|
-
g && (c.participants =
|
|
1294
|
-
},
|
|
1309
|
+
g && (c.participants = w);
|
|
1310
|
+
}, b = `conversation.${h}`;
|
|
1295
1311
|
u(h);
|
|
1296
|
-
const
|
|
1297
|
-
if (!
|
|
1298
|
-
|
|
1312
|
+
const z = v.private(b), G = (C) => {
|
|
1313
|
+
if (!Je(C)) {
|
|
1314
|
+
se.warn("Dropping malformed ConversationMessageSent event", C);
|
|
1299
1315
|
return;
|
|
1300
1316
|
}
|
|
1301
|
-
const c =
|
|
1317
|
+
const c = C, g = t.currentUser?.id;
|
|
1302
1318
|
if (!g || c.message.author_id === g) return;
|
|
1303
1319
|
e.addMessage(c.message);
|
|
1304
|
-
const
|
|
1305
|
-
if (
|
|
1306
|
-
const
|
|
1307
|
-
|
|
1320
|
+
const w = e.hasDetailSubscription(c.conversation_id), R = Ut(c.conversation_id);
|
|
1321
|
+
if (w || R) {
|
|
1322
|
+
const q = e.getConversationById(c.conversation_id);
|
|
1323
|
+
q && (q.unread_count = 0), e.markAsRead(c.conversation_id).catch(() => {
|
|
1308
1324
|
});
|
|
1309
1325
|
return;
|
|
1310
1326
|
}
|
|
1311
|
-
const
|
|
1312
|
-
if (
|
|
1313
|
-
const
|
|
1314
|
-
|
|
1327
|
+
const S = e.getConversationById(c.conversation_id);
|
|
1328
|
+
if (S) {
|
|
1329
|
+
const q = zt(S);
|
|
1330
|
+
q || S.unread_count++, ce(q);
|
|
1315
1331
|
}
|
|
1316
|
-
},
|
|
1317
|
-
if (!
|
|
1318
|
-
|
|
1332
|
+
}, k = (C) => {
|
|
1333
|
+
if (!Ke(C)) {
|
|
1334
|
+
se.warn("Dropping malformed ConversationMessageRead event", C);
|
|
1319
1335
|
return;
|
|
1320
1336
|
}
|
|
1321
|
-
|
|
1322
|
-
},
|
|
1323
|
-
if (!
|
|
1324
|
-
|
|
1337
|
+
E(C);
|
|
1338
|
+
}, V = (C) => {
|
|
1339
|
+
if (!et(C)) {
|
|
1340
|
+
se.warn("Dropping malformed ConversationRequestAccepted event", C);
|
|
1325
1341
|
return;
|
|
1326
1342
|
}
|
|
1327
|
-
const c =
|
|
1343
|
+
const c = C, g = e.getConversationById(c.conversation_id);
|
|
1328
1344
|
g && (g.is_request = !1), e.requests = e.requests.filter(
|
|
1329
|
-
(
|
|
1345
|
+
(w) => w.id !== c.conversation_id
|
|
1330
1346
|
);
|
|
1331
1347
|
};
|
|
1332
|
-
|
|
1333
|
-
channel:
|
|
1348
|
+
z.listen(".ConversationMessageSent", G), z.listen(".ConversationMessageRead", k), z.listen(".ConversationRequestAccepted", V), o.set(h, {
|
|
1349
|
+
channel: z,
|
|
1334
1350
|
bindings: [
|
|
1335
|
-
{ event: ".ConversationMessageSent", handler:
|
|
1336
|
-
{ event: ".ConversationMessageRead", handler:
|
|
1337
|
-
{ event: ".ConversationRequestAccepted", handler:
|
|
1351
|
+
{ event: ".ConversationMessageSent", handler: G },
|
|
1352
|
+
{ event: ".ConversationMessageRead", handler: k },
|
|
1353
|
+
{ event: ".ConversationRequestAccepted", handler: V }
|
|
1338
1354
|
]
|
|
1339
1355
|
}), i.add(h), e.registerGlobalConversationSubscription(h);
|
|
1340
1356
|
}
|
|
1341
1357
|
function d() {
|
|
1342
|
-
const h =
|
|
1358
|
+
const h = O();
|
|
1343
1359
|
if (!h) {
|
|
1344
1360
|
f();
|
|
1345
1361
|
return;
|
|
@@ -1355,86 +1371,86 @@ function kt() {
|
|
|
1355
1371
|
i.clear();
|
|
1356
1372
|
}
|
|
1357
1373
|
function p() {
|
|
1358
|
-
const h =
|
|
1374
|
+
const h = O();
|
|
1359
1375
|
if (!h) return;
|
|
1360
|
-
const v = e.conversations.slice(0,
|
|
1361
|
-
for (const
|
|
1362
|
-
if (!
|
|
1376
|
+
const v = e.conversations.slice(0, Lt), E = new Set(v.map((b) => b.id));
|
|
1377
|
+
for (const b of i)
|
|
1378
|
+
if (!E.has(b) && !e.hasDetailSubscription(b)) {
|
|
1363
1379
|
try {
|
|
1364
|
-
u(
|
|
1380
|
+
u(b), h.leave(`conversation.${b}`);
|
|
1365
1381
|
} catch {
|
|
1366
1382
|
}
|
|
1367
|
-
i.delete(
|
|
1383
|
+
i.delete(b), e.unregisterGlobalConversationSubscription(b);
|
|
1368
1384
|
}
|
|
1369
|
-
for (const
|
|
1370
|
-
|
|
1385
|
+
for (const b of v)
|
|
1386
|
+
y(b.id);
|
|
1371
1387
|
}
|
|
1372
1388
|
function F(h) {
|
|
1373
1389
|
e.updatePresenceForUser(h.user_id, h.status);
|
|
1374
1390
|
}
|
|
1375
|
-
function
|
|
1376
|
-
!
|
|
1391
|
+
function N() {
|
|
1392
|
+
!O() || a || (je(F), a = !0);
|
|
1377
1393
|
}
|
|
1378
|
-
function
|
|
1379
|
-
a && (
|
|
1394
|
+
function A() {
|
|
1395
|
+
a && (Ye(), a = !1);
|
|
1380
1396
|
}
|
|
1381
|
-
const
|
|
1397
|
+
const T = de(
|
|
1382
1398
|
r,
|
|
1383
1399
|
() => {
|
|
1384
1400
|
p();
|
|
1385
1401
|
},
|
|
1386
1402
|
{ deep: !1, immediate: !0 }
|
|
1387
|
-
),
|
|
1403
|
+
), x = de(
|
|
1388
1404
|
() => s.fullPath,
|
|
1389
1405
|
() => {
|
|
1390
1406
|
p();
|
|
1391
1407
|
}
|
|
1392
|
-
),
|
|
1393
|
-
h === "connected" ? (f(), p(),
|
|
1408
|
+
), U = xe((h) => {
|
|
1409
|
+
h === "connected" ? (f(), p(), A(), N()) : (h === "disconnected" || h === "error") && (f(), A());
|
|
1394
1410
|
});
|
|
1395
|
-
p(),
|
|
1396
|
-
|
|
1411
|
+
p(), N(), n !== null && we(() => {
|
|
1412
|
+
T(), x(), U(), d(), A();
|
|
1397
1413
|
});
|
|
1398
1414
|
}
|
|
1399
|
-
function
|
|
1400
|
-
e.apiClient &&
|
|
1415
|
+
function Ht(e) {
|
|
1416
|
+
e.apiClient && tt(e.apiClient), e.authStore && nt(e.authStore), e.mediaApi && ot(e.mediaApi), e.createLogger && qt(e.createLogger), e.playMessageNotification && Ft(e.playMessageNotification), e.echo && Xe(e.echo);
|
|
1401
1417
|
}
|
|
1402
|
-
function
|
|
1403
|
-
|
|
1418
|
+
function jt() {
|
|
1419
|
+
st(), rt(), at(), Pt(), Tt(), Qe();
|
|
1404
1420
|
}
|
|
1405
1421
|
export {
|
|
1406
|
-
W as ECHO_INITIALIZED_EVENT,
|
|
1407
1422
|
l as api,
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1423
|
+
Ht as configureMessengerClient,
|
|
1424
|
+
ue as createLogger,
|
|
1425
|
+
O as getEcho,
|
|
1426
|
+
le as getEchoInitializedEvent,
|
|
1411
1427
|
m as getErrorMessage,
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1428
|
+
it as getMediaApi,
|
|
1429
|
+
kt as hasResponse,
|
|
1430
|
+
Zt as isAxiosError,
|
|
1431
|
+
Gt as isError,
|
|
1432
|
+
Ke as isValidMessageReadEvent,
|
|
1433
|
+
Je as isValidMessageSentEvent,
|
|
1434
|
+
et as isValidRequestAcceptedEvent,
|
|
1435
|
+
P as messagingApi,
|
|
1436
|
+
xe as onConnectionStatusChange,
|
|
1421
1437
|
Qe as resetEchoRuntimeConfig,
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1438
|
+
Pt as resetLoggerFactory,
|
|
1439
|
+
st as resetMessagingApiClient,
|
|
1440
|
+
rt as resetMessagingAuthStoreResolver,
|
|
1441
|
+
at as resetMessagingMediaApi,
|
|
1442
|
+
jt as resetMessengerClientConfig,
|
|
1427
1443
|
Xe as setEchoRuntimeConfig,
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1444
|
+
qt as setLoggerFactory,
|
|
1445
|
+
tt as setMessagingApiClient,
|
|
1446
|
+
nt as setMessagingAuthStoreResolver,
|
|
1447
|
+
ot as setMessagingMediaApi,
|
|
1448
|
+
We as subscribeToConversation,
|
|
1449
|
+
je as subscribeToPresenceStatus,
|
|
1450
|
+
Ze as unsubscribeFromConversation,
|
|
1451
|
+
Ye as unsubscribeFromPresenceStatus,
|
|
1436
1452
|
L as useAuthStore,
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1453
|
+
Vt as useConversationChannel,
|
|
1454
|
+
Bt as useGlobalMessaging,
|
|
1455
|
+
Ie as useMessagingStore
|
|
1440
1456
|
};
|