@codingfactory/messenger-client 0.2.8 → 0.2.9
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 +629 -622
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
import { ref as he, getCurrentInstance as
|
|
2
|
-
import { defineStore as
|
|
3
|
-
import
|
|
4
|
-
import { isAxiosError as
|
|
5
|
-
import { useRoute as
|
|
6
|
-
const
|
|
7
|
-
},
|
|
8
|
-
},
|
|
9
|
-
}, $n = () => {
|
|
10
|
-
}, Hn = () => {
|
|
1
|
+
import { ref as he, getCurrentInstance as Ut, computed as te, watch as Mt, onUnmounted as Oe, toValue as zn, onMounted as Ot } from "vue";
|
|
2
|
+
import { defineStore as hi, storeToRefs as fi } from "pinia";
|
|
3
|
+
import Nt, { isAxiosError as pi, AxiosHeaders as yn } from "axios";
|
|
4
|
+
import { isAxiosError as ec } from "axios";
|
|
5
|
+
import { useRoute as gi } from "vue-router";
|
|
6
|
+
const jn = () => () => {
|
|
7
|
+
}, $n = () => () => {
|
|
8
|
+
}, Hn = async () => {
|
|
11
9
|
}, Bn = () => {
|
|
12
10
|
}, Vn = () => {
|
|
13
11
|
}, Xn = () => {
|
|
14
|
-
throw new Error("messenger-client subscribeToConversation is not configured");
|
|
15
12
|
}, Wn = () => {
|
|
13
|
+
}, Gn = () => {
|
|
14
|
+
throw new Error("messenger-client subscribeToConversation is not configured");
|
|
15
|
+
}, Jn = () => {
|
|
16
16
|
throw new Error("messenger-client subscribeToTyping is not configured");
|
|
17
17
|
}, $ = {
|
|
18
18
|
ECHO_INITIALIZED_EVENT: "messenger-client:echo-initialized",
|
|
19
19
|
getEcho: () => null,
|
|
20
20
|
getConnectionStatus: () => "disconnected",
|
|
21
21
|
getAccessState: () => "available",
|
|
22
|
-
onConnectionStatusChange:
|
|
23
|
-
onAccessStateChange:
|
|
24
|
-
reconnect:
|
|
25
|
-
subscribeToPresenceStatus:
|
|
26
|
-
unsubscribeFromPresenceStatus:
|
|
27
|
-
subscribeToConversation:
|
|
28
|
-
unsubscribeFromConversation:
|
|
29
|
-
subscribeToTyping:
|
|
30
|
-
unsubscribeFromTyping:
|
|
31
|
-
}, Be = () => $.ECHO_INITIALIZED_EVENT, Ie = () => $.getEcho(),
|
|
22
|
+
onConnectionStatusChange: jn,
|
|
23
|
+
onAccessStateChange: $n,
|
|
24
|
+
reconnect: Hn,
|
|
25
|
+
subscribeToPresenceStatus: Bn,
|
|
26
|
+
unsubscribeFromPresenceStatus: Vn,
|
|
27
|
+
subscribeToConversation: Gn,
|
|
28
|
+
unsubscribeFromConversation: Xn,
|
|
29
|
+
subscribeToTyping: Jn,
|
|
30
|
+
unsubscribeFromTyping: Wn
|
|
31
|
+
}, Be = () => $.ECHO_INITIALIZED_EVENT, Ie = () => $.getEcho(), Kn = () => $.getConnectionStatus(), za = () => Kn(), xt = () => $.getAccessState(), ct = (e) => $.onConnectionStatusChange(e), mi = (e) => $.onAccessStateChange(e), vi = async () => {
|
|
32
32
|
await $.reconnect();
|
|
33
|
-
},
|
|
34
|
-
function
|
|
33
|
+
}, bi = (e) => $.subscribeToPresenceStatus(e), yi = () => $.unsubscribeFromPresenceStatus(), _i = (e, n) => $.subscribeToConversation(e, n), Si = (e) => $.unsubscribeFromConversation(e), Ci = (e, n) => $.subscribeToTyping(e, n), wi = (e) => $.unsubscribeFromTyping(e);
|
|
34
|
+
function Ti(e) {
|
|
35
35
|
e.initializedEvent && ($.ECHO_INITIALIZED_EVENT = e.initializedEvent), e.getEcho && ($.getEcho = e.getEcho), e.getConnectionStatus && ($.getConnectionStatus = e.getConnectionStatus), e.getAccessState && ($.getAccessState = e.getAccessState), e.onConnectionStatusChange && ($.onConnectionStatusChange = e.onConnectionStatusChange), e.onAccessStateChange && ($.onAccessStateChange = e.onAccessStateChange), e.reconnect && ($.reconnect = e.reconnect), e.subscribeToPresenceStatus && ($.subscribeToPresenceStatus = e.subscribeToPresenceStatus), e.unsubscribeFromPresenceStatus && ($.unsubscribeFromPresenceStatus = e.unsubscribeFromPresenceStatus), e.subscribeToConversation && ($.subscribeToConversation = e.subscribeToConversation), e.unsubscribeFromConversation && ($.unsubscribeFromConversation = e.unsubscribeFromConversation), e.subscribeToTyping && ($.subscribeToTyping = e.subscribeToTyping), e.unsubscribeFromTyping && ($.unsubscribeFromTyping = e.unsubscribeFromTyping);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
$.ECHO_INITIALIZED_EVENT = "messenger-client:echo-initialized", $.getEcho = () => null, $.getConnectionStatus = () => "disconnected", $.getAccessState = () => "available", $.onConnectionStatusChange =
|
|
37
|
+
function Ei() {
|
|
38
|
+
$.ECHO_INITIALIZED_EVENT = "messenger-client:echo-initialized", $.getEcho = () => null, $.getConnectionStatus = () => "disconnected", $.getAccessState = () => "available", $.onConnectionStatusChange = jn, $.onAccessStateChange = $n, $.reconnect = Hn, $.subscribeToPresenceStatus = Bn, $.unsubscribeFromPresenceStatus = Vn, $.subscribeToConversation = Gn, $.unsubscribeFromConversation = Xn, $.subscribeToTyping = Jn, $.unsubscribeFromTyping = Wn;
|
|
39
39
|
}
|
|
40
40
|
function Ae(e) {
|
|
41
41
|
return typeof e == "object" && e !== null;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function Ai(e) {
|
|
44
44
|
return Ae(e) && typeof e.conversation_id == "string" && Ae(e.message) && typeof e.message.id == "string" && typeof e.message.conversation_id == "string" && typeof e.message.author_id == "string";
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Ri(e) {
|
|
47
47
|
return Ae(e) && typeof e.conversation_id == "string" && typeof e.user_id == "string" && typeof e.message_id == "string";
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function Pi(e) {
|
|
50
50
|
return Ae(e) && typeof e.conversation_id == "string" && Ae(e.message) && typeof e.message.id == "string";
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function Mi(e) {
|
|
53
53
|
return Ae(e) && typeof e.conversation_id == "string" && typeof e.message_id == "string";
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function xi(e) {
|
|
56
56
|
return Ae(e) && typeof e.conversation_id == "string" && typeof e.message_id == "string" && Array.isArray(e.reactions);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function ki(e) {
|
|
59
59
|
return Ae(e) && typeof e.conversation_id == "string";
|
|
60
60
|
}
|
|
61
|
-
const
|
|
62
|
-
let
|
|
61
|
+
const Yn = Nt;
|
|
62
|
+
let Dt = Yn;
|
|
63
63
|
function G() {
|
|
64
|
-
return
|
|
64
|
+
return Dt;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
66
|
+
function Ii(e) {
|
|
67
|
+
Dt = e;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
|
|
69
|
+
function Li() {
|
|
70
|
+
Dt = Yn;
|
|
71
71
|
}
|
|
72
|
-
const
|
|
72
|
+
const Qn = {
|
|
73
73
|
currentUser: null
|
|
74
74
|
};
|
|
75
|
-
let
|
|
75
|
+
let Ft = () => Qn;
|
|
76
76
|
function Le() {
|
|
77
|
-
return
|
|
77
|
+
return Ft;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
79
|
+
function Ui(e) {
|
|
80
|
+
Ft = e;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
|
|
82
|
+
function Oi() {
|
|
83
|
+
Ft = () => Qn;
|
|
84
84
|
}
|
|
85
85
|
function Y(e) {
|
|
86
|
-
if (
|
|
86
|
+
if (pi(e)) {
|
|
87
87
|
const n = e.response?.data?.message || e.message || "An error occurred";
|
|
88
88
|
return n.includes("SQLSTATE") || n.includes("Connection:") || n.includes("\\Illuminate\\") ? "Something went wrong. Please try again later." : n;
|
|
89
89
|
}
|
|
90
90
|
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";
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function ja(e) {
|
|
93
93
|
return e instanceof Error;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function $a(e) {
|
|
96
96
|
return typeof e == "object" && e !== null && "response" in e && typeof e.response == "object";
|
|
97
97
|
}
|
|
98
|
-
const
|
|
98
|
+
const Zn = {
|
|
99
99
|
async uploadImage() {
|
|
100
100
|
throw new Error("messenger-client mediaApi.uploadImage is not configured");
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
-
let
|
|
104
|
-
function Ui() {
|
|
105
|
-
return Ft;
|
|
106
|
-
}
|
|
107
|
-
function Oi(e) {
|
|
108
|
-
Ft = e;
|
|
109
|
-
}
|
|
103
|
+
let qt = Zn;
|
|
110
104
|
function Ni() {
|
|
111
|
-
|
|
105
|
+
return qt;
|
|
112
106
|
}
|
|
113
107
|
function Di(e) {
|
|
108
|
+
qt = e;
|
|
109
|
+
}
|
|
110
|
+
function Fi() {
|
|
111
|
+
qt = Zn;
|
|
112
|
+
}
|
|
113
|
+
function qi(e) {
|
|
114
114
|
return e !== null && typeof e == "object" && "id" in e && "type" in e && "participants" in e;
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function es(e) {
|
|
117
117
|
return typeof e == "object" && e !== null;
|
|
118
118
|
}
|
|
119
119
|
function qe(e) {
|
|
120
|
-
return !
|
|
120
|
+
return !es(e) || !("data" in e) ? e : e.data;
|
|
121
121
|
}
|
|
122
122
|
function Ze(e, n) {
|
|
123
123
|
const i = e[n];
|
|
@@ -144,8 +144,8 @@ function wt(e, n) {
|
|
|
144
144
|
}
|
|
145
145
|
throw new Error(`Invalid messaging folder payload: missing numeric ${n}`);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
if (!
|
|
147
|
+
function kt(e) {
|
|
148
|
+
if (!es(e))
|
|
149
149
|
throw new Error("Invalid messaging folder payload: expected object");
|
|
150
150
|
return {
|
|
151
151
|
id: Ze(e, "id"),
|
|
@@ -159,28 +159,28 @@ function xt(e) {
|
|
|
159
159
|
updated_at: Ze(e, "updated_at")
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function zi(e) {
|
|
163
163
|
if (!Array.isArray(e))
|
|
164
164
|
throw new Error("Invalid messaging folder payload: expected array");
|
|
165
|
-
return e.map((n) =>
|
|
165
|
+
return e.map((n) => kt(n));
|
|
166
166
|
}
|
|
167
167
|
function Sn(e) {
|
|
168
|
-
if (!
|
|
168
|
+
if (!qi(e))
|
|
169
169
|
throw new Error("Invalid conversation payload from folder assignment endpoint");
|
|
170
170
|
return e;
|
|
171
171
|
}
|
|
172
172
|
const Ee = {
|
|
173
173
|
async fetchFolders() {
|
|
174
174
|
const e = await G().get("/v1/messaging/folders");
|
|
175
|
-
return
|
|
175
|
+
return zi(qe(e.data));
|
|
176
176
|
},
|
|
177
177
|
async createFolder(e) {
|
|
178
178
|
const n = await G().post("/v1/messaging/folders", e);
|
|
179
|
-
return
|
|
179
|
+
return kt(qe(n.data));
|
|
180
180
|
},
|
|
181
181
|
async updateFolder(e, n) {
|
|
182
182
|
const i = await G().patch(`/v1/messaging/folders/${e}`, n);
|
|
183
|
-
return
|
|
183
|
+
return kt(qe(i.data));
|
|
184
184
|
},
|
|
185
185
|
async deleteFolder(e) {
|
|
186
186
|
await G().delete(`/v1/messaging/folders/${e}`);
|
|
@@ -201,7 +201,7 @@ const Ee = {
|
|
|
201
201
|
async declineRequest(e) {
|
|
202
202
|
await G().post(`/v1/messaging/conversations/${e}/decline`);
|
|
203
203
|
}
|
|
204
|
-
}, Cn = 1e3,
|
|
204
|
+
}, Cn = 1e3, zt = 4e3, ji = 12e4, $i = 300, Hi = 1, Bi = 1600, jt = (e) => {
|
|
205
205
|
if (typeof e == "number" && Number.isFinite(e))
|
|
206
206
|
return e;
|
|
207
207
|
if (typeof e == "string") {
|
|
@@ -209,10 +209,10 @@ const Ee = {
|
|
|
209
209
|
if (Number.isFinite(n))
|
|
210
210
|
return n;
|
|
211
211
|
}
|
|
212
|
-
},
|
|
213
|
-
const i =
|
|
214
|
-
return i === void 0 ? !0 : i === 429 ||
|
|
215
|
-
},
|
|
212
|
+
}, ts = (e) => typeof e == "number" && e >= 500 && e < 600, wn = (e) => {
|
|
213
|
+
const i = jt(e.response?.status);
|
|
214
|
+
return i === void 0 ? !0 : i === 429 || ts(i);
|
|
215
|
+
}, ns = (e) => {
|
|
216
216
|
if (typeof e == "number" && Number.isFinite(e) && e > 0)
|
|
217
217
|
return Math.max(Cn, e * 1e3);
|
|
218
218
|
if (typeof e == "string") {
|
|
@@ -220,18 +220,21 @@ const Ee = {
|
|
|
220
220
|
if (Number.isFinite(n) && n > 0)
|
|
221
221
|
return Math.max(Cn, n * 1e3);
|
|
222
222
|
}
|
|
223
|
-
return
|
|
224
|
-
},
|
|
225
|
-
const n = Math.max(0, e), i = 2 ** Math.min(n, 6), o =
|
|
226
|
-
return Math.min(
|
|
227
|
-
},
|
|
223
|
+
return zt;
|
|
224
|
+
}, Vi = (e) => {
|
|
225
|
+
const n = Math.max(0, e), i = 2 ** Math.min(n, 6), o = zt * i;
|
|
226
|
+
return Math.min(ji, o);
|
|
227
|
+
}, Xi = (e) => {
|
|
228
228
|
const n = e;
|
|
229
|
-
return
|
|
229
|
+
return jt(n.response?.status) === 429 ? ns(n.response?.headers?.["retry-after"]) : $i;
|
|
230
230
|
}, Tn = async (e) => {
|
|
231
231
|
await new Promise((n) => {
|
|
232
232
|
setTimeout(n, e);
|
|
233
233
|
});
|
|
234
|
-
},
|
|
234
|
+
}, En = () => ({
|
|
235
|
+
data: [],
|
|
236
|
+
has_more: !1
|
|
237
|
+
}), An = () => xt() === "account_suspended", Wi = (e) => {
|
|
235
238
|
if (!de(e))
|
|
236
239
|
return !1;
|
|
237
240
|
const i = (de(e.data) ? e.data : e).throttled;
|
|
@@ -245,7 +248,7 @@ const Ee = {
|
|
|
245
248
|
}
|
|
246
249
|
return !1;
|
|
247
250
|
};
|
|
248
|
-
function
|
|
251
|
+
function Gi(e, n, i) {
|
|
249
252
|
const o = typeof e == "string" && e.trim().length > 0 ? e.trim().toLowerCase() : void 0;
|
|
250
253
|
if (o)
|
|
251
254
|
return o;
|
|
@@ -255,17 +258,17 @@ function Xi(e, n, i) {
|
|
|
255
258
|
const d = typeof i == "string" && i.trim().length > 0 ? i.trim().toLowerCase() : void 0;
|
|
256
259
|
return d ? d === "image" ? "image/*" : d === "video" ? "video/*" : d === "audio" ? "audio/*" : d : "application/octet-stream";
|
|
257
260
|
}
|
|
258
|
-
function
|
|
261
|
+
function Ji(e) {
|
|
259
262
|
const n = e.url || "", i = e.thumbnail_url ?? e.thumbnail, o = {
|
|
260
263
|
id: e.media_id ?? e.id ?? "",
|
|
261
|
-
name: e.name ??
|
|
264
|
+
name: e.name ?? Ki(n),
|
|
262
265
|
url: n,
|
|
263
|
-
type:
|
|
266
|
+
type: Gi(e.mime, e.mime_type, e.type),
|
|
264
267
|
size: e.size ?? 0
|
|
265
268
|
};
|
|
266
269
|
return i !== void 0 && (o.thumbnail = i), o;
|
|
267
270
|
}
|
|
268
|
-
function
|
|
271
|
+
function Ki(e) {
|
|
269
272
|
if (!e) return "attachment";
|
|
270
273
|
try {
|
|
271
274
|
const i = new URL(e).pathname.split("/");
|
|
@@ -274,8 +277,8 @@ function Gi(e) {
|
|
|
274
277
|
return "attachment";
|
|
275
278
|
}
|
|
276
279
|
}
|
|
277
|
-
function
|
|
278
|
-
return !Array.isArray(e) || e.length === 0 ? [] : e.map(
|
|
280
|
+
function Yi(e) {
|
|
281
|
+
return !Array.isArray(e) || e.length === 0 ? [] : e.map(Ji);
|
|
279
282
|
}
|
|
280
283
|
function it(e) {
|
|
281
284
|
if (typeof e != "string")
|
|
@@ -284,7 +287,7 @@ function it(e) {
|
|
|
284
287
|
if (n.length !== 0)
|
|
285
288
|
return n;
|
|
286
289
|
}
|
|
287
|
-
function
|
|
290
|
+
function Qi(e) {
|
|
288
291
|
if (!e)
|
|
289
292
|
return;
|
|
290
293
|
const n = it(e.avatar) ?? it(e.avatar_url), i = typeof e.handle == "string" && e.handle.length > 0 ? e.handle : void 0;
|
|
@@ -311,12 +314,12 @@ function st(e) {
|
|
|
311
314
|
} : null;
|
|
312
315
|
return {
|
|
313
316
|
...e,
|
|
314
|
-
...i ? { author:
|
|
317
|
+
...i ? { author: Qi(i) } : {},
|
|
315
318
|
shared_post: o,
|
|
316
|
-
attachments:
|
|
319
|
+
attachments: Yi(e.attachments)
|
|
317
320
|
};
|
|
318
321
|
}
|
|
319
|
-
function
|
|
322
|
+
function Zi(e) {
|
|
320
323
|
if (!e || !de(e))
|
|
321
324
|
return;
|
|
322
325
|
const n = typeof e.id == "string" ? e.id.trim() : "", i = typeof e.title == "string" ? e.title.trim() : "", o = typeof e.url == "string" ? e.url.trim() : "";
|
|
@@ -339,20 +342,20 @@ function Yi(e) {
|
|
|
339
342
|
} : {}
|
|
340
343
|
};
|
|
341
344
|
}
|
|
342
|
-
function
|
|
345
|
+
function eo(e) {
|
|
343
346
|
return typeof e != "string" || e.length === 0 ? null : e;
|
|
344
347
|
}
|
|
345
|
-
function
|
|
348
|
+
function Rn(e) {
|
|
346
349
|
if (!(typeof e != "string" || e.length === 0))
|
|
347
350
|
return e;
|
|
348
351
|
}
|
|
349
|
-
function
|
|
352
|
+
function It(e) {
|
|
350
353
|
return typeof e == "string" && e.length > 0 && !e.startsWith("temp-");
|
|
351
354
|
}
|
|
352
|
-
function
|
|
355
|
+
function to(e, n = []) {
|
|
353
356
|
const i = /* @__PURE__ */ new Map();
|
|
354
357
|
for (const o of n) {
|
|
355
|
-
const u =
|
|
358
|
+
const u = Rn(o.last_read_message_id);
|
|
356
359
|
u && i.set(o.user_id, u);
|
|
357
360
|
}
|
|
358
361
|
return e.map((o) => {
|
|
@@ -361,7 +364,7 @@ function Zi(e, n = []) {
|
|
|
361
364
|
name: o.user.name,
|
|
362
365
|
...d ? { avatar: d } : {},
|
|
363
366
|
...o.user.handle ? { handle: o.user.handle } : {}
|
|
364
|
-
} : void 0, g =
|
|
367
|
+
} : void 0, g = Rn(o.last_read_message_id);
|
|
365
368
|
if (g)
|
|
366
369
|
return {
|
|
367
370
|
...o,
|
|
@@ -387,7 +390,7 @@ function Zi(e, n = []) {
|
|
|
387
390
|
});
|
|
388
391
|
}
|
|
389
392
|
function ze(e, n) {
|
|
390
|
-
const i =
|
|
393
|
+
const i = eo(e.muted_until), o = e.is_muted ?? i !== null, u = e.last_message ? st(e.last_message) : n?.last_message, d = e.last_message_at ?? n?.last_message_at, l = (() => {
|
|
391
394
|
if (!n || n.unread_count !== 0 || e.unread_count <= 0)
|
|
392
395
|
return !1;
|
|
393
396
|
const g = n.last_message?.id, h = e.last_message?.id;
|
|
@@ -396,36 +399,36 @@ function ze(e, n) {
|
|
|
396
399
|
return {
|
|
397
400
|
...e,
|
|
398
401
|
unread_count: o || l ? 0 : e.unread_count,
|
|
399
|
-
participants:
|
|
402
|
+
participants: to(e.participants, n?.participants),
|
|
400
403
|
is_muted: o,
|
|
401
404
|
muted_until: i,
|
|
402
405
|
...u ? { last_message: u } : {},
|
|
403
406
|
...d ? { last_message_at: d } : {}
|
|
404
407
|
};
|
|
405
408
|
}
|
|
406
|
-
function
|
|
409
|
+
function no(e) {
|
|
407
410
|
return e.is_muted ? !0 : typeof e.muted_until == "string" && e.muted_until.length > 0;
|
|
408
411
|
}
|
|
409
412
|
function Tt(e) {
|
|
410
|
-
return
|
|
413
|
+
return no(e) ? 0 : e.unread_count || 0;
|
|
411
414
|
}
|
|
412
|
-
function
|
|
415
|
+
function Pn(e, n) {
|
|
413
416
|
const i = n[e.id];
|
|
414
417
|
if (Array.isArray(i))
|
|
415
418
|
for (let o = i.length - 1; o >= 0; o -= 1) {
|
|
416
419
|
const u = i[o]?.id;
|
|
417
|
-
if (
|
|
420
|
+
if (It(u))
|
|
418
421
|
return u;
|
|
419
422
|
}
|
|
420
|
-
return
|
|
423
|
+
return It(e.last_message?.id) ? e.last_message.id : null;
|
|
421
424
|
}
|
|
422
425
|
function de(e) {
|
|
423
426
|
return typeof e == "object" && e !== null;
|
|
424
427
|
}
|
|
425
|
-
function
|
|
428
|
+
function so(e) {
|
|
426
429
|
return de(e) ? (de(e.response) ? e.response : null)?.status === 401 : !1;
|
|
427
430
|
}
|
|
428
|
-
function
|
|
431
|
+
function Mn(e) {
|
|
429
432
|
if (!Array.isArray(e))
|
|
430
433
|
return [];
|
|
431
434
|
const n = [];
|
|
@@ -446,7 +449,7 @@ function Rn(e) {
|
|
|
446
449
|
}
|
|
447
450
|
return n;
|
|
448
451
|
}
|
|
449
|
-
function
|
|
452
|
+
function ro(e, n) {
|
|
450
453
|
const i = de(n) ? n : null, o = i?.next ?? i?.next_cursor ?? e.next_cursor;
|
|
451
454
|
if (!(typeof o != "string" || o.length === 0))
|
|
452
455
|
return o;
|
|
@@ -456,13 +459,13 @@ function et(e, n) {
|
|
|
456
459
|
let u = [];
|
|
457
460
|
return Array.isArray(o) ? u = o : de(o) && (Array.isArray(o.items) ? u = o.items : Array.isArray(o[n]) ? u = o[n] : Array.isArray(o.data) && (u = o.data)), {
|
|
458
461
|
items: u,
|
|
459
|
-
nextCursor:
|
|
462
|
+
nextCursor: ro(i, o)
|
|
460
463
|
};
|
|
461
464
|
}
|
|
462
|
-
function
|
|
465
|
+
function xn(e) {
|
|
463
466
|
return de(e) && typeof e.id == "string" && e.id.length > 0;
|
|
464
467
|
}
|
|
465
|
-
function
|
|
468
|
+
function kn(e) {
|
|
466
469
|
return de(e) ? typeof e.id == "string" && (e.type === "dm" || e.type === "group") && Array.isArray(e.participants) : !1;
|
|
467
470
|
}
|
|
468
471
|
function rt(e, n) {
|
|
@@ -477,12 +480,12 @@ function tt(e, n) {
|
|
|
477
480
|
function je(e) {
|
|
478
481
|
return [...e].sort((n, i) => n.sort_order !== i.sort_order ? n.sort_order - i.sort_order : n.name.localeCompare(i.name));
|
|
479
482
|
}
|
|
480
|
-
function
|
|
483
|
+
function io(e, n) {
|
|
481
484
|
return typeof e != "string" || e.length === 0 ? null : n.has(e) ? e : null;
|
|
482
485
|
}
|
|
483
|
-
function
|
|
486
|
+
function In(e, n) {
|
|
484
487
|
return e.map((i) => {
|
|
485
|
-
const o =
|
|
488
|
+
const o = io(i.folder_id, n);
|
|
486
489
|
return (i.folder_id ?? null) === o ? i : {
|
|
487
490
|
...i,
|
|
488
491
|
folder_id: o
|
|
@@ -497,7 +500,7 @@ function Et(e) {
|
|
|
497
500
|
i.is_request === !0 && n.set(i.id, i);
|
|
498
501
|
return Array.from(n.values()).sort(rt);
|
|
499
502
|
}
|
|
500
|
-
const
|
|
503
|
+
const $t = hi("messaging", {
|
|
501
504
|
state: () => ({
|
|
502
505
|
conversations: [],
|
|
503
506
|
requests: [],
|
|
@@ -542,7 +545,7 @@ const jt = li("messaging", {
|
|
|
542
545
|
if (!this.foldersLoaded)
|
|
543
546
|
return;
|
|
544
547
|
const e = new Set(this.folders.map((n) => n.id));
|
|
545
|
-
this.conversations =
|
|
548
|
+
this.conversations = In(this.conversations, e), this.requests = In(this.requests, e), this.activeFolderId !== null && !e.has(this.activeFolderId) && (this.activeFolderId = null);
|
|
546
549
|
},
|
|
547
550
|
async fetchFolders() {
|
|
548
551
|
try {
|
|
@@ -619,6 +622,8 @@ const jt = li("messaging", {
|
|
|
619
622
|
async fetchConversations(e, n, i, o) {
|
|
620
623
|
this.loading = !0, this.error = null;
|
|
621
624
|
try {
|
|
625
|
+
if (An())
|
|
626
|
+
return e || (this.conversations = [], this.normalizeFolderAssignmentsState()), En();
|
|
622
627
|
const u = o?.includePresence ?? !0, d = {};
|
|
623
628
|
u && (d.include_presence = 1), e && (d.cursor = e), n && (d.filter = n), typeof i == "string" && i.length > 0 && (d.folder_id = i);
|
|
624
629
|
const l = await G().get("/v1/messaging/conversations", { params: d }), { items: g, nextCursor: h } = et(
|
|
@@ -651,8 +656,8 @@ const jt = li("messaging", {
|
|
|
651
656
|
includePresence: !1
|
|
652
657
|
}), this.backgroundPollRetryAfterUntil = 0, this.backgroundPollTransientFailureCount = 0, !0;
|
|
653
658
|
} catch (e) {
|
|
654
|
-
const n = e, i =
|
|
655
|
-
return i === 429 ? (this.backgroundPollRetryAfterUntil = Date.now() +
|
|
659
|
+
const n = e, i = jt(n.response?.status);
|
|
660
|
+
return i === 429 ? (this.backgroundPollRetryAfterUntil = Date.now() + ns(n.response?.headers?.["retry-after"]), !1) : (this.backgroundPollTransientFailureCount += 1, i === void 0 || ts(i) ? (this.backgroundPollRetryAfterUntil = Date.now() + Vi(this.backgroundPollTransientFailureCount), !1) : (this.backgroundPollRetryAfterUntil = Date.now() + zt, !1));
|
|
656
661
|
}
|
|
657
662
|
},
|
|
658
663
|
async fetchConversation(e) {
|
|
@@ -673,6 +678,8 @@ const jt = li("messaging", {
|
|
|
673
678
|
async fetchRequests(e) {
|
|
674
679
|
this.loading = !0, this.error = null;
|
|
675
680
|
try {
|
|
681
|
+
if (An())
|
|
682
|
+
return e || (this.requests = [], this.normalizeFolderAssignmentsState()), En();
|
|
676
683
|
const n = {
|
|
677
684
|
include_presence: 1,
|
|
678
685
|
filter: "requests"
|
|
@@ -707,9 +714,9 @@ const jt = li("messaging", {
|
|
|
707
714
|
u = await G().get(`/v1/messaging/conversations/${e}/messages`, { params: i });
|
|
708
715
|
break;
|
|
709
716
|
} catch (b) {
|
|
710
|
-
if (!(o <
|
|
717
|
+
if (!(o < Hi && wn(b)))
|
|
711
718
|
throw b;
|
|
712
|
-
o += 1, await Tn(
|
|
719
|
+
o += 1, await Tn(Xi(b));
|
|
713
720
|
}
|
|
714
721
|
const { items: d, nextCursor: l } = et(
|
|
715
722
|
u.data,
|
|
@@ -735,7 +742,7 @@ const jt = li("messaging", {
|
|
|
735
742
|
}
|
|
736
743
|
},
|
|
737
744
|
async sendMessage(e, n, i, o, u, d, l) {
|
|
738
|
-
const g = Le()(), h = `temp-${Date.now()}-${Math.random()}`, k = typeof d == "string" && d.trim().length > 0 ? d.trim() : null, x =
|
|
745
|
+
const g = Le()(), h = `temp-${Date.now()}-${Math.random()}`, k = typeof d == "string" && d.trim().length > 0 ? d.trim() : null, x = Zi(l), b = g.currentUser, S = {
|
|
739
746
|
id: h,
|
|
740
747
|
conversation_id: e,
|
|
741
748
|
author_id: b?.id || "",
|
|
@@ -764,7 +771,7 @@ const jt = li("messaging", {
|
|
|
764
771
|
if (i && i.length > 0) {
|
|
765
772
|
const M = await Promise.all(
|
|
766
773
|
i.map(async (U) => {
|
|
767
|
-
const j = await
|
|
774
|
+
const j = await Ni().uploadImage(U);
|
|
768
775
|
return {
|
|
769
776
|
media_id: j.id,
|
|
770
777
|
mime: j.mime_type,
|
|
@@ -831,11 +838,11 @@ const jt = li("messaging", {
|
|
|
831
838
|
return null;
|
|
832
839
|
for (let d = u.length - 1; d >= 0; d -= 1) {
|
|
833
840
|
const l = u[d]?.id;
|
|
834
|
-
if (
|
|
841
|
+
if (It(l))
|
|
835
842
|
return l;
|
|
836
843
|
}
|
|
837
844
|
return null;
|
|
838
|
-
})(), o = n ?
|
|
845
|
+
})(), o = n ? Pn(n, this.messages) : i;
|
|
839
846
|
if (!o)
|
|
840
847
|
return;
|
|
841
848
|
await G().post(`/v1/messaging/conversations/${e}/read`, {
|
|
@@ -854,7 +861,7 @@ const jt = li("messaging", {
|
|
|
854
861
|
if (e.length === 0)
|
|
855
862
|
return;
|
|
856
863
|
const n = e.map((u) => {
|
|
857
|
-
const d =
|
|
864
|
+
const d = Pn(u, this.messages);
|
|
858
865
|
return d ? {
|
|
859
866
|
conversationId: u.id,
|
|
860
867
|
messageId: d
|
|
@@ -886,9 +893,9 @@ const jt = li("messaging", {
|
|
|
886
893
|
async sendTyping(e, n = "start") {
|
|
887
894
|
try {
|
|
888
895
|
const i = await G().post(`/v1/messaging/conversations/${e}/typing`, { state: n });
|
|
889
|
-
if (n !== "start" || !
|
|
896
|
+
if (n !== "start" || !Wi(i.data))
|
|
890
897
|
return;
|
|
891
|
-
await Tn(
|
|
898
|
+
await Tn(Bi), await G().post(`/v1/messaging/conversations/${e}/typing`, { state: n });
|
|
892
899
|
} catch (i) {
|
|
893
900
|
console.warn("Failed to send typing indicator:", i);
|
|
894
901
|
}
|
|
@@ -954,9 +961,9 @@ const jt = li("messaging", {
|
|
|
954
961
|
};
|
|
955
962
|
n && (i.message = n);
|
|
956
963
|
const o = await G().post("/v1/messaging/conversations/dm", i), u = o.data.data || o.data;
|
|
957
|
-
if (!
|
|
964
|
+
if (!xn(u))
|
|
958
965
|
throw new Error("Invalid conversation payload from DM create endpoint.");
|
|
959
|
-
const d =
|
|
966
|
+
const d = kn(u) ? ze(u) : await this.fetchConversation(u.id);
|
|
960
967
|
return d.is_request === !0 ? (this.requests = tt(this.requests, d), this.conversations = this.conversations.filter((l) => l.id !== d.id), d) : (this.conversations = tt(this.conversations, d), this.requests = this.requests.filter((l) => l.id !== d.id), d);
|
|
961
968
|
} catch (i) {
|
|
962
969
|
throw this.error = Y(i), i;
|
|
@@ -968,9 +975,9 @@ const jt = li("messaging", {
|
|
|
968
975
|
title: e,
|
|
969
976
|
participant_ids: n
|
|
970
977
|
}), o = i.data.data || i.data;
|
|
971
|
-
if (!
|
|
978
|
+
if (!xn(o))
|
|
972
979
|
throw new Error("Invalid conversation payload from group create endpoint.");
|
|
973
|
-
const u =
|
|
980
|
+
const u = kn(o) ? o : await this.fetchConversation(o.id);
|
|
974
981
|
return this.conversations = tt(this.conversations, u), u;
|
|
975
982
|
} catch (i) {
|
|
976
983
|
throw this.error = Y(i), i;
|
|
@@ -1078,16 +1085,16 @@ const jt = li("messaging", {
|
|
|
1078
1085
|
try {
|
|
1079
1086
|
g = await G().post(o, u);
|
|
1080
1087
|
} catch (b) {
|
|
1081
|
-
if (!
|
|
1088
|
+
if (!so(b))
|
|
1082
1089
|
throw b;
|
|
1083
1090
|
g = await G().post(o, u);
|
|
1084
1091
|
}
|
|
1085
|
-
const h = de(g.data) && "data" in g.data ? g.data.data : g.data, k =
|
|
1092
|
+
const h = de(g.data) && "data" in g.data ? g.data.data : g.data, k = Mn(
|
|
1086
1093
|
de(h) ? h.reactions : void 0
|
|
1087
1094
|
);
|
|
1088
1095
|
(k.length > 0 || l.length === 0) && this.updateMessageReactions(e, n, k);
|
|
1089
1096
|
try {
|
|
1090
|
-
const b = await G().get(o), S = de(b.data) && "data" in b.data ? b.data.data : b.data, E =
|
|
1097
|
+
const b = await G().get(o), S = de(b.data) && "data" in b.data ? b.data.data : b.data, E = Mn(
|
|
1091
1098
|
de(S) ? S.reactions : void 0
|
|
1092
1099
|
);
|
|
1093
1100
|
this.updateMessageReactions(e, n, E);
|
|
@@ -1214,10 +1221,10 @@ const jt = li("messaging", {
|
|
|
1214
1221
|
}
|
|
1215
1222
|
}
|
|
1216
1223
|
});
|
|
1217
|
-
function
|
|
1218
|
-
const n =
|
|
1224
|
+
function Ha(e) {
|
|
1225
|
+
const n = $t(), i = Le()(), o = he(!1), u = he(null), d = he(null), l = Ut(), g = l !== null, h = 20, k = 250;
|
|
1219
1226
|
let x = 0, b = null, S = null;
|
|
1220
|
-
const E = te(() => i.currentUser?.id), P = () =>
|
|
1227
|
+
const E = te(() => i.currentUser?.id), P = () => zn(e)?.trim() ?? "";
|
|
1221
1228
|
function T() {
|
|
1222
1229
|
b && (clearTimeout(b), b = null), x = 0;
|
|
1223
1230
|
}
|
|
@@ -1269,7 +1276,7 @@ function ja(e) {
|
|
|
1269
1276
|
}
|
|
1270
1277
|
function j(_) {
|
|
1271
1278
|
const V = d.value;
|
|
1272
|
-
S && (S(), S = null), V && (_ && !n.hasGlobalConversationSubscription(V) &&
|
|
1279
|
+
S && (S(), S = null), V && (_ && !n.hasGlobalConversationSubscription(V) && Si(V), n.unregisterDetailSubscription(V), d.value = null), o.value = !1;
|
|
1273
1280
|
}
|
|
1274
1281
|
function N() {
|
|
1275
1282
|
const _ = P();
|
|
@@ -1280,7 +1287,7 @@ function ja(e) {
|
|
|
1280
1287
|
}
|
|
1281
1288
|
u.value = null;
|
|
1282
1289
|
try {
|
|
1283
|
-
S =
|
|
1290
|
+
S = _i(_, {
|
|
1284
1291
|
onMessageSent: m,
|
|
1285
1292
|
onMessageRead: v,
|
|
1286
1293
|
onMessageEdited: D,
|
|
@@ -1333,37 +1340,37 @@ function ja(e) {
|
|
|
1333
1340
|
unsubscribe: q
|
|
1334
1341
|
};
|
|
1335
1342
|
}
|
|
1336
|
-
const
|
|
1337
|
-
},
|
|
1343
|
+
const ss = () => () => {
|
|
1344
|
+
}, rs = async () => {
|
|
1338
1345
|
}, fe = {
|
|
1339
1346
|
initializedEvent: "messenger-client:main-echo-initialized",
|
|
1340
1347
|
getEcho: () => null,
|
|
1341
1348
|
getConnectionStatus: () => "disconnected",
|
|
1342
|
-
onConnectionStatusChange:
|
|
1343
|
-
reconnect:
|
|
1349
|
+
onConnectionStatusChange: ss,
|
|
1350
|
+
reconnect: rs
|
|
1344
1351
|
};
|
|
1345
|
-
function
|
|
1352
|
+
function oo() {
|
|
1346
1353
|
return fe.initializedEvent;
|
|
1347
1354
|
}
|
|
1348
|
-
function
|
|
1355
|
+
function ao() {
|
|
1349
1356
|
return fe.getEcho();
|
|
1350
1357
|
}
|
|
1351
|
-
function
|
|
1358
|
+
function co() {
|
|
1352
1359
|
return fe.getConnectionStatus();
|
|
1353
1360
|
}
|
|
1354
|
-
function
|
|
1361
|
+
function uo(e) {
|
|
1355
1362
|
return fe.onConnectionStatusChange(e);
|
|
1356
1363
|
}
|
|
1357
|
-
async function
|
|
1364
|
+
async function lo() {
|
|
1358
1365
|
await fe.reconnect();
|
|
1359
1366
|
}
|
|
1360
|
-
function
|
|
1367
|
+
function ho(e) {
|
|
1361
1368
|
e.initializedEvent && (fe.initializedEvent = e.initializedEvent), e.getEcho && (fe.getEcho = e.getEcho), e.getConnectionStatus && (fe.getConnectionStatus = e.getConnectionStatus), e.onConnectionStatusChange && (fe.onConnectionStatusChange = e.onConnectionStatusChange), e.reconnect && (fe.reconnect = e.reconnect);
|
|
1362
1369
|
}
|
|
1363
|
-
function
|
|
1364
|
-
fe.initializedEvent = "messenger-client:main-echo-initialized", fe.getEcho = () => null, fe.getConnectionStatus = () => "disconnected", fe.onConnectionStatusChange =
|
|
1370
|
+
function fo() {
|
|
1371
|
+
fe.initializedEvent = "messenger-client:main-echo-initialized", fe.getEcho = () => null, fe.getConnectionStatus = () => "disconnected", fe.onConnectionStatusChange = ss, fe.reconnect = rs;
|
|
1365
1372
|
}
|
|
1366
|
-
const
|
|
1373
|
+
const po = {
|
|
1367
1374
|
debug: () => {
|
|
1368
1375
|
},
|
|
1369
1376
|
info: () => {
|
|
@@ -1372,48 +1379,48 @@ const ho = {
|
|
|
1372
1379
|
},
|
|
1373
1380
|
error: () => {
|
|
1374
1381
|
}
|
|
1375
|
-
},
|
|
1376
|
-
let
|
|
1377
|
-
function
|
|
1378
|
-
return
|
|
1382
|
+
}, is = () => po;
|
|
1383
|
+
let Ht = is;
|
|
1384
|
+
function Bt() {
|
|
1385
|
+
return Ht;
|
|
1379
1386
|
}
|
|
1380
|
-
function
|
|
1381
|
-
|
|
1387
|
+
function go(e) {
|
|
1388
|
+
Ht = e;
|
|
1382
1389
|
}
|
|
1383
|
-
function
|
|
1384
|
-
|
|
1390
|
+
function mo() {
|
|
1391
|
+
Ht = is;
|
|
1385
1392
|
}
|
|
1386
|
-
const
|
|
1393
|
+
const vo = {
|
|
1387
1394
|
connected: "",
|
|
1388
1395
|
connecting: "",
|
|
1389
1396
|
disconnected: "",
|
|
1390
1397
|
error: "",
|
|
1391
1398
|
unknown: ""
|
|
1392
|
-
},
|
|
1393
|
-
function
|
|
1399
|
+
}, Ln = Bt()("ConnectionStatus");
|
|
1400
|
+
function Un(e) {
|
|
1394
1401
|
return e?.connector?.pusher?.connection ?? null;
|
|
1395
1402
|
}
|
|
1396
|
-
function
|
|
1403
|
+
function bo(e) {
|
|
1397
1404
|
return e === "messenger" ? {
|
|
1398
1405
|
initializedEvent: Be(),
|
|
1399
|
-
getConnectionStatus:
|
|
1406
|
+
getConnectionStatus: Kn,
|
|
1400
1407
|
onConnectionStatusChange: ct,
|
|
1401
|
-
reconnect:
|
|
1402
|
-
getEchoConnection: () =>
|
|
1408
|
+
reconnect: vi,
|
|
1409
|
+
getEchoConnection: () => Un(Ie())
|
|
1403
1410
|
} : {
|
|
1404
|
-
initializedEvent:
|
|
1405
|
-
getConnectionStatus:
|
|
1406
|
-
onConnectionStatusChange:
|
|
1407
|
-
reconnect:
|
|
1408
|
-
getEchoConnection: () =>
|
|
1411
|
+
initializedEvent: oo(),
|
|
1412
|
+
getConnectionStatus: co,
|
|
1413
|
+
onConnectionStatusChange: uo,
|
|
1414
|
+
reconnect: lo,
|
|
1415
|
+
getEchoConnection: () => Un(ao())
|
|
1409
1416
|
};
|
|
1410
1417
|
}
|
|
1411
|
-
function
|
|
1418
|
+
function On(e) {
|
|
1412
1419
|
return e.getEchoConnection()?.state ?? null;
|
|
1413
1420
|
}
|
|
1414
|
-
function
|
|
1415
|
-
const o =
|
|
1416
|
-
...
|
|
1421
|
+
function Ba(e = {}) {
|
|
1422
|
+
const o = bo(e.source ?? "app"), u = {
|
|
1423
|
+
...vo,
|
|
1417
1424
|
...e.icons
|
|
1418
1425
|
}, d = he(o.getConnectionStatus()), l = he(null), g = he(0), h = he(!1), k = he(!1), x = he(!1), b = he(!1);
|
|
1419
1426
|
let S = null, E = null, P = null, T = null, f = null, m = null, v = null;
|
|
@@ -1456,7 +1463,7 @@ function $a(e = {}) {
|
|
|
1456
1463
|
return u.unknown;
|
|
1457
1464
|
}
|
|
1458
1465
|
}), ce = async () => {
|
|
1459
|
-
|
|
1466
|
+
Ln.debug("Manual reconnect triggered"), g.value += 1, await o.reconnect();
|
|
1460
1467
|
}, q = (y, O = d.value) => {
|
|
1461
1468
|
if (y !== "connecting" && E && (clearTimeout(E), E = null), y === "disconnected" || y === "error") {
|
|
1462
1469
|
const ne = !b.value && O === y, be = !k.value && (ne || O === "connected" || O === "connecting");
|
|
@@ -1482,11 +1489,11 @@ function $a(e = {}) {
|
|
|
1482
1489
|
return;
|
|
1483
1490
|
E = setTimeout(() => {
|
|
1484
1491
|
if (E = null, d.value === "connecting") {
|
|
1485
|
-
if (
|
|
1492
|
+
if (On(o) === "connected") {
|
|
1486
1493
|
_("connected");
|
|
1487
1494
|
return;
|
|
1488
1495
|
}
|
|
1489
|
-
k.value = !0,
|
|
1496
|
+
k.value = !0, Ln.warn("Still connecting after 10s, treating as disconnected"), _("disconnected"), g.value += 1, o.reconnect();
|
|
1490
1497
|
}
|
|
1491
1498
|
}, 1e4);
|
|
1492
1499
|
}
|
|
@@ -1498,7 +1505,7 @@ function $a(e = {}) {
|
|
|
1498
1505
|
}
|
|
1499
1506
|
d.value = y, y === "connecting" && (O === "disconnected" || O === "error") && g.value === 0 && (g.value = 1), y === "connected" && (l.value = /* @__PURE__ */ new Date(), g.value = 0), q(y, O);
|
|
1500
1507
|
}, V = () => {
|
|
1501
|
-
const y =
|
|
1508
|
+
const y = On(o), O = d.value;
|
|
1502
1509
|
if (y === "connected" && O !== "connected") {
|
|
1503
1510
|
_("connected");
|
|
1504
1511
|
return;
|
|
@@ -1551,7 +1558,7 @@ function $a(e = {}) {
|
|
|
1551
1558
|
const y = Date.now() - l.value.getTime(), O = Math.floor(y / 6e4), ne = Math.floor(y % 6e4 / 1e3);
|
|
1552
1559
|
return O > 0 ? `${O}m ${ne}s` : `${ne}s`;
|
|
1553
1560
|
});
|
|
1554
|
-
return
|
|
1561
|
+
return Ot(() => {
|
|
1555
1562
|
d.value = o.getConnectionStatus(), S = o.onConnectionStatusChange(_), D.value && (l.value = /* @__PURE__ */ new Date()), q(d.value, d.value), b.value = !0, A(), m = () => {
|
|
1556
1563
|
A(), V();
|
|
1557
1564
|
}, window.addEventListener(o.initializedEvent, m), V(), T = setInterval(() => {
|
|
@@ -1576,73 +1583,73 @@ function $a(e = {}) {
|
|
|
1576
1583
|
reconnect: ce
|
|
1577
1584
|
};
|
|
1578
1585
|
}
|
|
1579
|
-
const
|
|
1580
|
-
let
|
|
1581
|
-
function
|
|
1582
|
-
return
|
|
1586
|
+
const os = Nt;
|
|
1587
|
+
let Vt = os;
|
|
1588
|
+
function as() {
|
|
1589
|
+
return Vt;
|
|
1583
1590
|
}
|
|
1584
|
-
function
|
|
1585
|
-
|
|
1591
|
+
function yo(e) {
|
|
1592
|
+
Vt = e;
|
|
1586
1593
|
}
|
|
1587
|
-
function
|
|
1588
|
-
|
|
1594
|
+
function _o() {
|
|
1595
|
+
Vt = os;
|
|
1589
1596
|
}
|
|
1590
|
-
const
|
|
1591
|
-
function
|
|
1597
|
+
const So = 6e4;
|
|
1598
|
+
function Co(e) {
|
|
1592
1599
|
return e === "online" || e === "idle" || e === "dnd" || e === "offline";
|
|
1593
1600
|
}
|
|
1594
|
-
function
|
|
1601
|
+
function wo(e) {
|
|
1595
1602
|
if (typeof e != "string")
|
|
1596
1603
|
return null;
|
|
1597
1604
|
const n = e.trim().toLowerCase();
|
|
1598
|
-
return
|
|
1605
|
+
return Co(n) ? n : null;
|
|
1599
1606
|
}
|
|
1600
|
-
function
|
|
1607
|
+
function cs(e) {
|
|
1601
1608
|
if (typeof e != "string")
|
|
1602
1609
|
return null;
|
|
1603
1610
|
const n = e.trim();
|
|
1604
1611
|
return n.length > 0 ? n : null;
|
|
1605
1612
|
}
|
|
1606
|
-
function
|
|
1607
|
-
const n =
|
|
1613
|
+
function Lt(e) {
|
|
1614
|
+
const n = cs(e);
|
|
1608
1615
|
if (n === null)
|
|
1609
1616
|
return null;
|
|
1610
1617
|
const i = n.includes("T") ? n : n.replace(" ", "T"), o = /(?:Z|[+-]\d{2}:\d{2})$/i.test(i) ? i : `${i}Z`, u = new Date(o);
|
|
1611
1618
|
return Number.isNaN(u.getTime()) ? null : u;
|
|
1612
1619
|
}
|
|
1613
|
-
function
|
|
1620
|
+
function To(e, n, i = {}) {
|
|
1614
1621
|
if (e === null)
|
|
1615
1622
|
return null;
|
|
1616
1623
|
if (e === "offline")
|
|
1617
1624
|
return "offline";
|
|
1618
|
-
const o =
|
|
1625
|
+
const o = Lt(n);
|
|
1619
1626
|
if (o === null)
|
|
1620
1627
|
return e;
|
|
1621
|
-
const u = i.now ?? Date.now(), d = i.staleAfterMs ??
|
|
1628
|
+
const u = i.now ?? Date.now(), d = i.staleAfterMs ?? So;
|
|
1622
1629
|
return u - o.getTime() > d ? "offline" : e;
|
|
1623
1630
|
}
|
|
1624
|
-
function
|
|
1625
|
-
const i =
|
|
1631
|
+
function Nn(e, n = {}) {
|
|
1632
|
+
const i = cs(e?.last_seen_at), o = wo(e?.status);
|
|
1626
1633
|
return {
|
|
1627
|
-
status:
|
|
1634
|
+
status: To(o, i, n),
|
|
1628
1635
|
lastSeenAt: i
|
|
1629
1636
|
};
|
|
1630
1637
|
}
|
|
1631
|
-
const
|
|
1638
|
+
const us = () => {
|
|
1632
1639
|
};
|
|
1633
|
-
let
|
|
1634
|
-
function
|
|
1635
|
-
return
|
|
1640
|
+
let Xt = us;
|
|
1641
|
+
function Eo() {
|
|
1642
|
+
return Xt;
|
|
1636
1643
|
}
|
|
1637
|
-
function
|
|
1638
|
-
|
|
1644
|
+
function Ao(e) {
|
|
1645
|
+
Xt = e;
|
|
1639
1646
|
}
|
|
1640
|
-
function
|
|
1641
|
-
|
|
1647
|
+
function Ro() {
|
|
1648
|
+
Xt = us;
|
|
1642
1649
|
}
|
|
1643
|
-
const xe =
|
|
1644
|
-
function
|
|
1645
|
-
const e =
|
|
1650
|
+
const xe = Bt()("GlobalMessaging"), Po = 3, Mo = (e) => e.replace(/\/+$/, ""), xo = (e) => Mo(window.location.pathname) === `/messages/${e}`, ko = (e) => e.is_muted ? !0 : typeof e.muted_until == "string" && e.muted_until.length > 0;
|
|
1651
|
+
function Va() {
|
|
1652
|
+
const e = $t(), n = Le()(), i = Eo(), o = as(), u = gi(), d = Ut(), { conversations: l } = fi(e), g = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Map();
|
|
1646
1653
|
let k = !1;
|
|
1647
1654
|
function x(M) {
|
|
1648
1655
|
const U = h.get(M);
|
|
@@ -1664,14 +1671,14 @@ function Ha() {
|
|
|
1664
1671
|
const j = `conversation.${M}`;
|
|
1665
1672
|
x(M);
|
|
1666
1673
|
const N = U.private(j), Q = (R) => {
|
|
1667
|
-
if (!
|
|
1674
|
+
if (!Ai(R)) {
|
|
1668
1675
|
xe.warn("Dropping malformed ConversationMessageSent event", R);
|
|
1669
1676
|
return;
|
|
1670
1677
|
}
|
|
1671
1678
|
const y = R, O = n.currentUser?.id;
|
|
1672
1679
|
if (!O || y.message.author_id === O) return;
|
|
1673
1680
|
e.addMessage(y.message);
|
|
1674
|
-
const ne = e.hasDetailSubscription(y.conversation_id), be =
|
|
1681
|
+
const ne = e.hasDetailSubscription(y.conversation_id), be = xo(y.conversation_id);
|
|
1675
1682
|
if (ne || be) {
|
|
1676
1683
|
const oe = e.getConversationById(y.conversation_id);
|
|
1677
1684
|
oe && (oe.unread_count = 0), e.markAsRead(y.conversation_id).catch(() => {
|
|
@@ -1680,24 +1687,24 @@ function Ha() {
|
|
|
1680
1687
|
}
|
|
1681
1688
|
const me = e.getConversationById(y.conversation_id);
|
|
1682
1689
|
if (me) {
|
|
1683
|
-
const oe =
|
|
1690
|
+
const oe = ko(me);
|
|
1684
1691
|
oe || me.unread_count++, i(oe);
|
|
1685
1692
|
}
|
|
1686
1693
|
}, ce = (R) => {
|
|
1687
|
-
if (!
|
|
1694
|
+
if (!Ri(R)) {
|
|
1688
1695
|
xe.warn("Dropping malformed ConversationMessageRead event", R);
|
|
1689
1696
|
return;
|
|
1690
1697
|
}
|
|
1691
1698
|
e.applyParticipantReadState(R);
|
|
1692
1699
|
}, q = (R) => {
|
|
1693
|
-
if (!
|
|
1700
|
+
if (!xi(R)) {
|
|
1694
1701
|
xe.warn("Dropping malformed MessageReactionToggled event", R);
|
|
1695
1702
|
return;
|
|
1696
1703
|
}
|
|
1697
1704
|
const y = R;
|
|
1698
1705
|
e.updateMessageReactions(y.conversation_id, y.message_id, y.reactions);
|
|
1699
1706
|
}, _ = (R) => {
|
|
1700
|
-
if (!
|
|
1707
|
+
if (!Pi(R)) {
|
|
1701
1708
|
xe.warn("Dropping malformed ConversationMessageEdited event", R);
|
|
1702
1709
|
return;
|
|
1703
1710
|
}
|
|
@@ -1715,14 +1722,14 @@ function Ha() {
|
|
|
1715
1722
|
body: y.message.body
|
|
1716
1723
|
});
|
|
1717
1724
|
}, V = (R) => {
|
|
1718
|
-
if (!
|
|
1725
|
+
if (!Mi(R)) {
|
|
1719
1726
|
xe.warn("Dropping malformed ConversationMessageDeleted event", R);
|
|
1720
1727
|
return;
|
|
1721
1728
|
}
|
|
1722
1729
|
const y = R;
|
|
1723
1730
|
e.removeMessage(y.conversation_id, y.message_id);
|
|
1724
1731
|
}, A = (R) => {
|
|
1725
|
-
if (!
|
|
1732
|
+
if (!ki(R)) {
|
|
1726
1733
|
xe.warn("Dropping malformed ConversationRequestAccepted event", R);
|
|
1727
1734
|
return;
|
|
1728
1735
|
}
|
|
@@ -1762,7 +1769,7 @@ function Ha() {
|
|
|
1762
1769
|
function P() {
|
|
1763
1770
|
const M = Ie();
|
|
1764
1771
|
if (!M) return;
|
|
1765
|
-
const U = e.conversations.slice(0,
|
|
1772
|
+
const U = e.conversations.slice(0, Po), j = new Set(U.map((N) => N.id));
|
|
1766
1773
|
for (const N of g)
|
|
1767
1774
|
if (!j.has(N) && !e.hasDetailSubscription(N)) {
|
|
1768
1775
|
try {
|
|
@@ -1775,7 +1782,7 @@ function Ha() {
|
|
|
1775
1782
|
S(N.id);
|
|
1776
1783
|
}
|
|
1777
1784
|
function T(M) {
|
|
1778
|
-
const U =
|
|
1785
|
+
const U = Nn({
|
|
1779
1786
|
status: M.status,
|
|
1780
1787
|
last_seen_at: M.last_seen_at ?? null
|
|
1781
1788
|
});
|
|
@@ -1795,7 +1802,7 @@ function Ha() {
|
|
|
1795
1802
|
params: { ids: M }
|
|
1796
1803
|
}), j = U.data?.data?.items ?? U.data?.items ?? [];
|
|
1797
1804
|
for (const N of j) {
|
|
1798
|
-
const Q =
|
|
1805
|
+
const Q = Nn(N);
|
|
1799
1806
|
Q.status !== null && e.updatePresenceForUser(N.id, Q.status, Q.lastSeenAt);
|
|
1800
1807
|
}
|
|
1801
1808
|
} catch (U) {
|
|
@@ -1803,10 +1810,10 @@ function Ha() {
|
|
|
1803
1810
|
}
|
|
1804
1811
|
}
|
|
1805
1812
|
function m() {
|
|
1806
|
-
!Ie() || k || (
|
|
1813
|
+
!Ie() || k || (bi(T), k = !0);
|
|
1807
1814
|
}
|
|
1808
1815
|
function v() {
|
|
1809
|
-
k && (
|
|
1816
|
+
k && (yi(), k = !1);
|
|
1810
1817
|
}
|
|
1811
1818
|
const D = Mt(
|
|
1812
1819
|
l,
|
|
@@ -1826,11 +1833,11 @@ function Ha() {
|
|
|
1826
1833
|
D(), X(), B(), E(), v();
|
|
1827
1834
|
});
|
|
1828
1835
|
}
|
|
1829
|
-
function
|
|
1830
|
-
const e = he(
|
|
1836
|
+
function Xa() {
|
|
1837
|
+
const e = he(xt());
|
|
1831
1838
|
let n = null;
|
|
1832
|
-
return
|
|
1833
|
-
e.value =
|
|
1839
|
+
return Ot(() => {
|
|
1840
|
+
e.value = xt(), n = mi((i) => {
|
|
1834
1841
|
e.value = i;
|
|
1835
1842
|
});
|
|
1836
1843
|
}), Oe(() => {
|
|
@@ -1841,7 +1848,7 @@ function Ba() {
|
|
|
1841
1848
|
isSuspended: te(() => e.value === "account_suspended")
|
|
1842
1849
|
};
|
|
1843
1850
|
}
|
|
1844
|
-
const
|
|
1851
|
+
const ls = {
|
|
1845
1852
|
sessionOpenUrl: "/v1/presence/session/open",
|
|
1846
1853
|
sessionHeartbeatUrl: "/v1/presence/heartbeat",
|
|
1847
1854
|
sessionCloseUrl: "/v1/presence/session/close",
|
|
@@ -1854,24 +1861,24 @@ const cs = {
|
|
|
1854
1861
|
userAgentResolver: () => navigator.userAgent.slice(0, 256),
|
|
1855
1862
|
authTokenResolver: () => null
|
|
1856
1863
|
};
|
|
1857
|
-
let ot = { ...
|
|
1858
|
-
function
|
|
1864
|
+
let ot = { ...ls };
|
|
1865
|
+
function Io() {
|
|
1859
1866
|
return ot;
|
|
1860
1867
|
}
|
|
1861
|
-
function
|
|
1868
|
+
function Lo(e) {
|
|
1862
1869
|
ot = {
|
|
1863
1870
|
...ot,
|
|
1864
1871
|
...e
|
|
1865
1872
|
};
|
|
1866
1873
|
}
|
|
1867
|
-
function
|
|
1868
|
-
ot = { ...
|
|
1874
|
+
function Uo() {
|
|
1875
|
+
ot = { ...ls };
|
|
1869
1876
|
}
|
|
1870
|
-
const
|
|
1877
|
+
const Oo = 429, No = 423, Do = "ACCOUNT_LIMITED", Fo = "ACCOUNT_WRITE_TIMEOUT", qo = 2, zo = 5 * 6e4;
|
|
1871
1878
|
function He(e) {
|
|
1872
1879
|
return typeof e == "object" && e !== null;
|
|
1873
1880
|
}
|
|
1874
|
-
function
|
|
1881
|
+
function jo(e) {
|
|
1875
1882
|
if (!He(e))
|
|
1876
1883
|
return null;
|
|
1877
1884
|
const n = e.response;
|
|
@@ -1886,7 +1893,7 @@ function qo(e) {
|
|
|
1886
1893
|
}
|
|
1887
1894
|
return null;
|
|
1888
1895
|
}
|
|
1889
|
-
function
|
|
1896
|
+
function $o(e) {
|
|
1890
1897
|
if (!He(e))
|
|
1891
1898
|
return null;
|
|
1892
1899
|
const n = e.response;
|
|
@@ -1896,20 +1903,20 @@ function zo(e) {
|
|
|
1896
1903
|
return He(i) && typeof i.code == "string" ? i.code : null;
|
|
1897
1904
|
}
|
|
1898
1905
|
function At(e) {
|
|
1899
|
-
const n =
|
|
1900
|
-
return n ===
|
|
1906
|
+
const n = jo(e), i = $o(e);
|
|
1907
|
+
return n === Oo && i === Do || n === No && i === Fo;
|
|
1901
1908
|
}
|
|
1902
1909
|
function Ve() {
|
|
1903
1910
|
return typeof sessionStorage > "u" ? null : sessionStorage;
|
|
1904
1911
|
}
|
|
1905
|
-
function
|
|
1912
|
+
function Ho(e) {
|
|
1906
1913
|
const n = Ve(), i = n?.getItem(e);
|
|
1907
1914
|
if (i)
|
|
1908
1915
|
return i;
|
|
1909
1916
|
const o = `web-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
1910
1917
|
return n?.setItem(e, o), o;
|
|
1911
1918
|
}
|
|
1912
|
-
function
|
|
1919
|
+
function Bo(e) {
|
|
1913
1920
|
const n = Ve(), i = n?.getItem(e);
|
|
1914
1921
|
if (!i)
|
|
1915
1922
|
return null;
|
|
@@ -1917,19 +1924,19 @@ function $o(e) {
|
|
|
1917
1924
|
return Number.isFinite(o) ? o : (n?.removeItem(e), null);
|
|
1918
1925
|
}
|
|
1919
1926
|
function Rt(e, n = Date.now()) {
|
|
1920
|
-
const i = Ve(), o =
|
|
1927
|
+
const i = Ve(), o = Bo(e);
|
|
1921
1928
|
return o === null ? !1 : o <= n ? (i?.removeItem(e), !1) : !0;
|
|
1922
1929
|
}
|
|
1923
|
-
function
|
|
1924
|
-
Ve()?.setItem(e, String(n +
|
|
1930
|
+
function Vo(e, n = Date.now()) {
|
|
1931
|
+
Ve()?.setItem(e, String(n + zo));
|
|
1925
1932
|
}
|
|
1926
|
-
function
|
|
1933
|
+
function Xo(e) {
|
|
1927
1934
|
Ve()?.removeItem(e);
|
|
1928
1935
|
}
|
|
1929
|
-
function
|
|
1936
|
+
function Wo(e) {
|
|
1930
1937
|
return e.startsWith("/v1/") ? `/api${e}` : e;
|
|
1931
1938
|
}
|
|
1932
|
-
function
|
|
1939
|
+
function Go(e, n, i) {
|
|
1933
1940
|
if (typeof fetch > "u")
|
|
1934
1941
|
return null;
|
|
1935
1942
|
const o = {
|
|
@@ -1938,7 +1945,7 @@ function Xo(e, n, i) {
|
|
|
1938
1945
|
};
|
|
1939
1946
|
i && (o.Authorization = `Bearer ${i}`);
|
|
1940
1947
|
try {
|
|
1941
|
-
return fetch(
|
|
1948
|
+
return fetch(Wo(e), {
|
|
1942
1949
|
method: "POST",
|
|
1943
1950
|
headers: o,
|
|
1944
1951
|
body: JSON.stringify({ client_id: n }),
|
|
@@ -1950,8 +1957,8 @@ function Xo(e, n, i) {
|
|
|
1950
1957
|
return null;
|
|
1951
1958
|
}
|
|
1952
1959
|
}
|
|
1953
|
-
function
|
|
1954
|
-
const e = Le()(), n =
|
|
1960
|
+
function Wa() {
|
|
1961
|
+
const e = Le()(), n = Io(), i = as(), o = Ho(n.clientIdStorageKey);
|
|
1955
1962
|
let u = null, d = null, l = !1, g = Rt(n.accountLimitedUntilStorageKey), h = !1, k = null, x = 0;
|
|
1956
1963
|
const b = () => {
|
|
1957
1964
|
u && (clearInterval(u), u = null);
|
|
@@ -1962,7 +1969,7 @@ function Va() {
|
|
|
1962
1969
|
U();
|
|
1963
1970
|
}, n.heartbeatIntervalMs);
|
|
1964
1971
|
}, P = (q) => {
|
|
1965
|
-
g || console.warn(q),
|
|
1972
|
+
g || console.warn(q), Vo(n.accountLimitedUntilStorageKey), g = !0, l = !1, k = null, b(), S();
|
|
1966
1973
|
}, T = async (q) => {
|
|
1967
1974
|
if (!(!l || h || g) && k !== q)
|
|
1968
1975
|
try {
|
|
@@ -1992,12 +1999,12 @@ function Va() {
|
|
|
1992
1999
|
return await i.post(n.sessionOpenUrl, {
|
|
1993
2000
|
client_id: o,
|
|
1994
2001
|
user_agent: n.userAgentResolver()
|
|
1995
|
-
}),
|
|
2002
|
+
}), Xo(n.accountLimitedUntilStorageKey), g = !1, l = !0, k = null, "opened";
|
|
1996
2003
|
} catch (q) {
|
|
1997
2004
|
return At(q) ? (P("[Presence] Session open skipped: account is temporarily limited"), "account_limited") : "failed";
|
|
1998
2005
|
}
|
|
1999
2006
|
}, M = async () => {
|
|
2000
|
-
for (let q = 0; q <
|
|
2007
|
+
for (let q = 0; q < qo; q += 1)
|
|
2001
2008
|
if (await B() !== "failed")
|
|
2002
2009
|
return;
|
|
2003
2010
|
console.warn("[Presence] Failed to open session");
|
|
@@ -2012,7 +2019,7 @@ function Va() {
|
|
|
2012
2019
|
if (!l)
|
|
2013
2020
|
return;
|
|
2014
2021
|
l = !1, k = null, S();
|
|
2015
|
-
const q =
|
|
2022
|
+
const q = Go(
|
|
2016
2023
|
n.sessionCloseUrl,
|
|
2017
2024
|
o,
|
|
2018
2025
|
n.authTokenResolver()
|
|
@@ -2047,7 +2054,7 @@ function Va() {
|
|
|
2047
2054
|
}, ce = () => {
|
|
2048
2055
|
h || (j(), b(), S());
|
|
2049
2056
|
};
|
|
2050
|
-
|
|
2057
|
+
Ot(async () => {
|
|
2051
2058
|
if (e.isAuthenticated ?? e.currentUser !== null) {
|
|
2052
2059
|
if (await M(), h) {
|
|
2053
2060
|
j();
|
|
@@ -2059,11 +2066,11 @@ function Va() {
|
|
|
2059
2066
|
h = !0, X(), S(), b(), j(), document.removeEventListener("visibilitychange", Q), window.removeEventListener("pagehide", ce), window.removeEventListener("beforeunload", ce);
|
|
2060
2067
|
});
|
|
2061
2068
|
}
|
|
2062
|
-
const
|
|
2063
|
-
function
|
|
2064
|
-
const n =
|
|
2069
|
+
const Jo = 12e3, Ko = 250, Yo = 20;
|
|
2070
|
+
function Ga(e) {
|
|
2071
|
+
const n = $t(), i = Le()(), o = he(!1), u = he(null), d = he(null), l = he([]), g = /* @__PURE__ */ new Map(), h = Ut(), k = h !== null;
|
|
2065
2072
|
let x = 0, b = null, S = null;
|
|
2066
|
-
const E = te(() => i.currentUser?.id), P = () =>
|
|
2073
|
+
const E = te(() => i.currentUser?.id), P = () => zn(e)?.trim() ?? "", T = () => {
|
|
2067
2074
|
const A = d.value?.trim() ?? "";
|
|
2068
2075
|
if (A.length > 0)
|
|
2069
2076
|
return A;
|
|
@@ -2085,7 +2092,7 @@ function Xa(e) {
|
|
|
2085
2092
|
v(A);
|
|
2086
2093
|
const y = setTimeout(() => {
|
|
2087
2094
|
g.delete(A), n.removeTypingUser(R, A), l.value = l.value.filter((O) => O.id !== A);
|
|
2088
|
-
},
|
|
2095
|
+
}, Jo);
|
|
2089
2096
|
g.set(A, y);
|
|
2090
2097
|
}, B = () => {
|
|
2091
2098
|
b && (clearTimeout(b), b = null), x = 0;
|
|
@@ -2093,13 +2100,13 @@ function Xa(e) {
|
|
|
2093
2100
|
const A = P();
|
|
2094
2101
|
if (!(o.value || !A)) {
|
|
2095
2102
|
if (u.value = null, !Ie()) {
|
|
2096
|
-
k && !b && x <
|
|
2103
|
+
k && !b && x < Yo && (b = setTimeout(() => {
|
|
2097
2104
|
b = null, x += 1, M();
|
|
2098
|
-
},
|
|
2105
|
+
}, Ko));
|
|
2099
2106
|
return;
|
|
2100
2107
|
}
|
|
2101
2108
|
try {
|
|
2102
|
-
S && (S(), S = null), S =
|
|
2109
|
+
S && (S(), S = null), S = Ci(A, {
|
|
2103
2110
|
onTypingStart: j,
|
|
2104
2111
|
onTypingStop: N
|
|
2105
2112
|
}), o.value = !0, d.value = A, B();
|
|
@@ -2111,7 +2118,7 @@ function Xa(e) {
|
|
|
2111
2118
|
const A = d.value;
|
|
2112
2119
|
if (B(), !(!o.value || !A))
|
|
2113
2120
|
try {
|
|
2114
|
-
S && (S(), S = null),
|
|
2121
|
+
S && (S(), S = null), wi(A), D(), m(A), o.value = !1, d.value = null, u.value = null;
|
|
2115
2122
|
} catch (R) {
|
|
2116
2123
|
u.value = R instanceof Error ? R.message : "Failed to unsubscribe from typing channel";
|
|
2117
2124
|
}
|
|
@@ -2194,13 +2201,13 @@ function Xa(e) {
|
|
|
2194
2201
|
unsubscribe: U
|
|
2195
2202
|
};
|
|
2196
2203
|
}
|
|
2197
|
-
function
|
|
2198
|
-
e.apiClient &&
|
|
2204
|
+
function Ja(e) {
|
|
2205
|
+
e.apiClient && Ii(e.apiClient), e.mainApiClient && yo(e.mainApiClient), e.authStore && Ui(e.authStore), e.mediaApi && Di(e.mediaApi), e.createLogger && go(e.createLogger), e.playMessageNotification && Ao(e.playMessageNotification), e.echo && Ti(e.echo), e.mainEcho && ho(e.mainEcho), e.presence && Lo(e.presence);
|
|
2199
2206
|
}
|
|
2200
|
-
function
|
|
2201
|
-
|
|
2207
|
+
function Ka() {
|
|
2208
|
+
Li(), _o(), Oi(), Fi(), mo(), Ro(), Ei(), fo(), Uo();
|
|
2202
2209
|
}
|
|
2203
|
-
class
|
|
2210
|
+
class Wt {
|
|
2204
2211
|
constructor() {
|
|
2205
2212
|
this.notificationCreatedEvent = ".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated";
|
|
2206
2213
|
}
|
|
@@ -2229,7 +2236,7 @@ class Xt {
|
|
|
2229
2236
|
return this.stopListening(".client-" + n, i);
|
|
2230
2237
|
}
|
|
2231
2238
|
}
|
|
2232
|
-
class
|
|
2239
|
+
class ds {
|
|
2233
2240
|
/**
|
|
2234
2241
|
* Create a new class instance.
|
|
2235
2242
|
*/
|
|
@@ -2249,7 +2256,7 @@ class us {
|
|
|
2249
2256
|
this.namespace = n;
|
|
2250
2257
|
}
|
|
2251
2258
|
}
|
|
2252
|
-
function
|
|
2259
|
+
function Qo(e) {
|
|
2253
2260
|
try {
|
|
2254
2261
|
new e();
|
|
2255
2262
|
} catch (n) {
|
|
@@ -2258,12 +2265,12 @@ function Ko(e) {
|
|
|
2258
2265
|
}
|
|
2259
2266
|
return !0;
|
|
2260
2267
|
}
|
|
2261
|
-
class
|
|
2268
|
+
class Gt extends Wt {
|
|
2262
2269
|
/**
|
|
2263
2270
|
* Create a new class instance.
|
|
2264
2271
|
*/
|
|
2265
2272
|
constructor(n, i, o) {
|
|
2266
|
-
super(), this.name = i, this.pusher = n, this.options = o, this.eventFormatter = new
|
|
2273
|
+
super(), this.name = i, this.pusher = n, this.options = o, this.eventFormatter = new ds(this.options.namespace), this.subscribe();
|
|
2267
2274
|
}
|
|
2268
2275
|
/**
|
|
2269
2276
|
* Subscribe to a Pusher channel.
|
|
@@ -2335,7 +2342,7 @@ class Wt extends Xt {
|
|
|
2335
2342
|
return this.subscription.bind(n, i), this;
|
|
2336
2343
|
}
|
|
2337
2344
|
}
|
|
2338
|
-
class
|
|
2345
|
+
class hs extends Gt {
|
|
2339
2346
|
/**
|
|
2340
2347
|
* Send a whisper event to other clients in the channel.
|
|
2341
2348
|
*/
|
|
@@ -2346,7 +2353,7 @@ class ls extends Wt {
|
|
|
2346
2353
|
), this;
|
|
2347
2354
|
}
|
|
2348
2355
|
}
|
|
2349
|
-
class
|
|
2356
|
+
class Zo extends Gt {
|
|
2350
2357
|
/**
|
|
2351
2358
|
* Send a whisper event to other clients in the channel.
|
|
2352
2359
|
*/
|
|
@@ -2357,7 +2364,7 @@ class Yo extends Wt {
|
|
|
2357
2364
|
), this;
|
|
2358
2365
|
}
|
|
2359
2366
|
}
|
|
2360
|
-
class
|
|
2367
|
+
class ea extends hs {
|
|
2361
2368
|
/**
|
|
2362
2369
|
* Register a callback to be called anytime the member list changes.
|
|
2363
2370
|
*/
|
|
@@ -2392,12 +2399,12 @@ class Qo extends ls {
|
|
|
2392
2399
|
}), this;
|
|
2393
2400
|
}
|
|
2394
2401
|
}
|
|
2395
|
-
class
|
|
2402
|
+
class fs extends Wt {
|
|
2396
2403
|
/**
|
|
2397
2404
|
* Create a new class instance.
|
|
2398
2405
|
*/
|
|
2399
2406
|
constructor(n, i, o) {
|
|
2400
|
-
super(), this.events = {}, this.listeners = {}, this.name = i, this.socket = n, this.options = o, this.eventFormatter = new
|
|
2407
|
+
super(), this.events = {}, this.listeners = {}, this.name = i, this.socket = n, this.options = o, this.eventFormatter = new ds(this.options.namespace), this.subscribe();
|
|
2401
2408
|
}
|
|
2402
2409
|
/**
|
|
2403
2410
|
* Subscribe to a Socket.io channel.
|
|
@@ -2468,7 +2475,7 @@ class ds extends Xt {
|
|
|
2468
2475
|
)), (!i || this.listeners[n].length === 0) && (this.events[n] && (this.socket.removeListener(n, this.events[n]), delete this.events[n]), delete this.listeners[n]);
|
|
2469
2476
|
}
|
|
2470
2477
|
}
|
|
2471
|
-
class
|
|
2478
|
+
class ps extends fs {
|
|
2472
2479
|
/**
|
|
2473
2480
|
* Send a whisper event to other clients in the channel.
|
|
2474
2481
|
*/
|
|
@@ -2480,7 +2487,7 @@ class hs extends ds {
|
|
|
2480
2487
|
}), this;
|
|
2481
2488
|
}
|
|
2482
2489
|
}
|
|
2483
|
-
class
|
|
2490
|
+
class ta extends ps {
|
|
2484
2491
|
/**
|
|
2485
2492
|
* Register a callback to be called anytime the member list changes.
|
|
2486
2493
|
*/
|
|
@@ -2518,7 +2525,7 @@ class Zo extends hs {
|
|
|
2518
2525
|
), this;
|
|
2519
2526
|
}
|
|
2520
2527
|
}
|
|
2521
|
-
class at extends
|
|
2528
|
+
class at extends Wt {
|
|
2522
2529
|
/**
|
|
2523
2530
|
* Subscribe to a channel.
|
|
2524
2531
|
*/
|
|
@@ -2566,7 +2573,7 @@ class at extends Xt {
|
|
|
2566
2573
|
return this;
|
|
2567
2574
|
}
|
|
2568
2575
|
}
|
|
2569
|
-
class
|
|
2576
|
+
class gs extends at {
|
|
2570
2577
|
/**
|
|
2571
2578
|
* Send a whisper event to other clients in the channel.
|
|
2572
2579
|
*/
|
|
@@ -2574,7 +2581,7 @@ class fs extends at {
|
|
|
2574
2581
|
return this;
|
|
2575
2582
|
}
|
|
2576
2583
|
}
|
|
2577
|
-
class
|
|
2584
|
+
class na extends at {
|
|
2578
2585
|
/**
|
|
2579
2586
|
* Send a whisper event to other clients in the channel.
|
|
2580
2587
|
*/
|
|
@@ -2582,7 +2589,7 @@ class ea extends at {
|
|
|
2582
2589
|
return this;
|
|
2583
2590
|
}
|
|
2584
2591
|
}
|
|
2585
|
-
class
|
|
2592
|
+
class sa extends gs {
|
|
2586
2593
|
/**
|
|
2587
2594
|
* Register a callback to be called anytime the member list changes.
|
|
2588
2595
|
*/
|
|
@@ -2608,7 +2615,7 @@ class ta extends fs {
|
|
|
2608
2615
|
return this;
|
|
2609
2616
|
}
|
|
2610
2617
|
}
|
|
2611
|
-
const
|
|
2618
|
+
const ms = class vs {
|
|
2612
2619
|
/**
|
|
2613
2620
|
* Create a new class instance.
|
|
2614
2621
|
*/
|
|
@@ -2620,7 +2627,7 @@ const ps = class gs {
|
|
|
2620
2627
|
*/
|
|
2621
2628
|
setOptions(n) {
|
|
2622
2629
|
this.options = {
|
|
2623
|
-
...
|
|
2630
|
+
...vs._defaultOptions,
|
|
2624
2631
|
...n,
|
|
2625
2632
|
broadcaster: n.broadcaster
|
|
2626
2633
|
};
|
|
@@ -2635,7 +2642,7 @@ const ps = class gs {
|
|
|
2635
2642
|
return typeof window < "u" && (n = window.Laravel) != null && n.csrfToken ? window.Laravel.csrfToken : this.options.csrfToken ? this.options.csrfToken : typeof document < "u" && typeof document.querySelector == "function" ? ((i = document.querySelector('meta[name="csrf-token"]')) == null ? void 0 : i.getAttribute("content")) ?? null : null;
|
|
2636
2643
|
}
|
|
2637
2644
|
};
|
|
2638
|
-
|
|
2645
|
+
ms._defaultOptions = {
|
|
2639
2646
|
auth: {
|
|
2640
2647
|
headers: {}
|
|
2641
2648
|
},
|
|
@@ -2650,8 +2657,8 @@ ps._defaultOptions = {
|
|
|
2650
2657
|
key: null,
|
|
2651
2658
|
namespace: "App.Events"
|
|
2652
2659
|
};
|
|
2653
|
-
let
|
|
2654
|
-
class nt extends
|
|
2660
|
+
let Jt = ms;
|
|
2661
|
+
class nt extends Jt {
|
|
2655
2662
|
constructor() {
|
|
2656
2663
|
super(...arguments), this.channels = {};
|
|
2657
2664
|
}
|
|
@@ -2689,7 +2696,7 @@ class nt extends Gt {
|
|
|
2689
2696
|
* Get a channel instance by name.
|
|
2690
2697
|
*/
|
|
2691
2698
|
channel(n) {
|
|
2692
|
-
return this.channels[n] || (this.channels[n] = new
|
|
2699
|
+
return this.channels[n] || (this.channels[n] = new Gt(
|
|
2693
2700
|
this.pusher,
|
|
2694
2701
|
n,
|
|
2695
2702
|
this.options
|
|
@@ -2699,7 +2706,7 @@ class nt extends Gt {
|
|
|
2699
2706
|
* Get a private channel instance by name.
|
|
2700
2707
|
*/
|
|
2701
2708
|
privateChannel(n) {
|
|
2702
|
-
return this.channels["private-" + n] || (this.channels["private-" + n] = new
|
|
2709
|
+
return this.channels["private-" + n] || (this.channels["private-" + n] = new hs(
|
|
2703
2710
|
this.pusher,
|
|
2704
2711
|
"private-" + n,
|
|
2705
2712
|
this.options
|
|
@@ -2709,7 +2716,7 @@ class nt extends Gt {
|
|
|
2709
2716
|
* Get a private encrypted channel instance by name.
|
|
2710
2717
|
*/
|
|
2711
2718
|
encryptedPrivateChannel(n) {
|
|
2712
|
-
return this.channels["private-encrypted-" + n] || (this.channels["private-encrypted-" + n] = new
|
|
2719
|
+
return this.channels["private-encrypted-" + n] || (this.channels["private-encrypted-" + n] = new Zo(
|
|
2713
2720
|
this.pusher,
|
|
2714
2721
|
"private-encrypted-" + n,
|
|
2715
2722
|
this.options
|
|
@@ -2719,7 +2726,7 @@ class nt extends Gt {
|
|
|
2719
2726
|
* Get a presence channel instance by name.
|
|
2720
2727
|
*/
|
|
2721
2728
|
presenceChannel(n) {
|
|
2722
|
-
return this.channels["presence-" + n] || (this.channels["presence-" + n] = new
|
|
2729
|
+
return this.channels["presence-" + n] || (this.channels["presence-" + n] = new ea(
|
|
2723
2730
|
this.pusher,
|
|
2724
2731
|
"presence-" + n,
|
|
2725
2732
|
this.options
|
|
@@ -2788,7 +2795,7 @@ class nt extends Gt {
|
|
|
2788
2795
|
this.pusher.disconnect();
|
|
2789
2796
|
}
|
|
2790
2797
|
}
|
|
2791
|
-
class
|
|
2798
|
+
class ra extends Jt {
|
|
2792
2799
|
constructor() {
|
|
2793
2800
|
super(...arguments), this.channels = {};
|
|
2794
2801
|
}
|
|
@@ -2828,7 +2835,7 @@ class na extends Gt {
|
|
|
2828
2835
|
* Get a channel instance by name.
|
|
2829
2836
|
*/
|
|
2830
2837
|
channel(n) {
|
|
2831
|
-
return this.channels[n] || (this.channels[n] = new
|
|
2838
|
+
return this.channels[n] || (this.channels[n] = new fs(
|
|
2832
2839
|
this.socket,
|
|
2833
2840
|
n,
|
|
2834
2841
|
this.options
|
|
@@ -2838,7 +2845,7 @@ class na extends Gt {
|
|
|
2838
2845
|
* Get a private channel instance by name.
|
|
2839
2846
|
*/
|
|
2840
2847
|
privateChannel(n) {
|
|
2841
|
-
return this.channels["private-" + n] || (this.channels["private-" + n] = new
|
|
2848
|
+
return this.channels["private-" + n] || (this.channels["private-" + n] = new ps(
|
|
2842
2849
|
this.socket,
|
|
2843
2850
|
"private-" + n,
|
|
2844
2851
|
this.options
|
|
@@ -2848,7 +2855,7 @@ class na extends Gt {
|
|
|
2848
2855
|
* Get a presence channel instance by name.
|
|
2849
2856
|
*/
|
|
2850
2857
|
presenceChannel(n) {
|
|
2851
|
-
return this.channels["presence-" + n] || (this.channels["presence-" + n] = new
|
|
2858
|
+
return this.channels["presence-" + n] || (this.channels["presence-" + n] = new ta(
|
|
2852
2859
|
this.socket,
|
|
2853
2860
|
"presence-" + n,
|
|
2854
2861
|
this.options
|
|
@@ -2910,7 +2917,7 @@ class na extends Gt {
|
|
|
2910
2917
|
this.socket.disconnect();
|
|
2911
2918
|
}
|
|
2912
2919
|
}
|
|
2913
|
-
class
|
|
2920
|
+
class Dn extends Jt {
|
|
2914
2921
|
constructor() {
|
|
2915
2922
|
super(...arguments), this.channels = {};
|
|
2916
2923
|
}
|
|
@@ -2935,19 +2942,19 @@ class On extends Gt {
|
|
|
2935
2942
|
* Get a private channel instance by name.
|
|
2936
2943
|
*/
|
|
2937
2944
|
privateChannel(n) {
|
|
2938
|
-
return new
|
|
2945
|
+
return new gs();
|
|
2939
2946
|
}
|
|
2940
2947
|
/**
|
|
2941
2948
|
* Get a private encrypted channel instance by name.
|
|
2942
2949
|
*/
|
|
2943
2950
|
encryptedPrivateChannel(n) {
|
|
2944
|
-
return new
|
|
2951
|
+
return new na();
|
|
2945
2952
|
}
|
|
2946
2953
|
/**
|
|
2947
2954
|
* Get a presence channel instance by name.
|
|
2948
2955
|
*/
|
|
2949
2956
|
presenceChannel(n) {
|
|
2950
|
-
return new
|
|
2957
|
+
return new sa();
|
|
2951
2958
|
}
|
|
2952
2959
|
/**
|
|
2953
2960
|
* Leave the given channel, as well as its private and presence variants.
|
|
@@ -2984,7 +2991,7 @@ class On extends Gt {
|
|
|
2984
2991
|
disconnect() {
|
|
2985
2992
|
}
|
|
2986
2993
|
}
|
|
2987
|
-
class
|
|
2994
|
+
class ia {
|
|
2988
2995
|
/**
|
|
2989
2996
|
* Create a new class instance.
|
|
2990
2997
|
*/
|
|
@@ -3015,10 +3022,10 @@ class sa {
|
|
|
3015
3022
|
broadcaster: "pusher"
|
|
3016
3023
|
});
|
|
3017
3024
|
else if (this.options.broadcaster === "socket.io")
|
|
3018
|
-
this.connector = new
|
|
3025
|
+
this.connector = new ra(this.options);
|
|
3019
3026
|
else if (this.options.broadcaster === "null")
|
|
3020
|
-
this.connector = new
|
|
3021
|
-
else if (typeof this.options.broadcaster == "function" &&
|
|
3027
|
+
this.connector = new Dn(this.options);
|
|
3028
|
+
else if (typeof this.options.broadcaster == "function" && Qo(this.options.broadcaster))
|
|
3022
3029
|
this.connector = new this.options.broadcaster(this.options);
|
|
3023
3030
|
else
|
|
3024
3031
|
throw new Error(
|
|
@@ -3081,7 +3088,7 @@ class sa {
|
|
|
3081
3088
|
);
|
|
3082
3089
|
}
|
|
3083
3090
|
connectorSupportsEncryptedPrivateChannels(n) {
|
|
3084
|
-
return n instanceof nt || n instanceof
|
|
3091
|
+
return n instanceof nt || n instanceof Dn;
|
|
3085
3092
|
}
|
|
3086
3093
|
/**
|
|
3087
3094
|
* Get the Socket ID for the connection.
|
|
@@ -3142,13 +3149,13 @@ class sa {
|
|
|
3142
3149
|
);
|
|
3143
3150
|
}
|
|
3144
3151
|
}
|
|
3145
|
-
function
|
|
3152
|
+
function oa(e) {
|
|
3146
3153
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3147
3154
|
}
|
|
3148
3155
|
var Pt = { exports: {} };
|
|
3149
|
-
var
|
|
3150
|
-
function
|
|
3151
|
-
return
|
|
3156
|
+
var Fn;
|
|
3157
|
+
function aa() {
|
|
3158
|
+
return Fn || (Fn = 1, (function(e, n) {
|
|
3152
3159
|
(function(o, u) {
|
|
3153
3160
|
e.exports = u();
|
|
3154
3161
|
})(window, function() {
|
|
@@ -3629,14 +3636,14 @@ function ia() {
|
|
|
3629
3636
|
});
|
|
3630
3637
|
}
|
|
3631
3638
|
}
|
|
3632
|
-
class
|
|
3639
|
+
class Kt extends ne {
|
|
3633
3640
|
constructor(t, s) {
|
|
3634
3641
|
super(setInterval, me, t, function(a) {
|
|
3635
3642
|
return s(), a;
|
|
3636
3643
|
});
|
|
3637
3644
|
}
|
|
3638
3645
|
}
|
|
3639
|
-
var
|
|
3646
|
+
var Yt = {
|
|
3640
3647
|
now() {
|
|
3641
3648
|
return Date.now ? Date.now() : (/* @__PURE__ */ new Date()).valueOf();
|
|
3642
3649
|
},
|
|
@@ -3649,7 +3656,7 @@ function ia() {
|
|
|
3649
3656
|
return a[r].apply(a, s.concat(arguments));
|
|
3650
3657
|
};
|
|
3651
3658
|
}
|
|
3652
|
-
}, ue =
|
|
3659
|
+
}, ue = Yt;
|
|
3653
3660
|
function w(r, ...t) {
|
|
3654
3661
|
for (var s = 0; s < t.length; s++) {
|
|
3655
3662
|
var a = t[s];
|
|
@@ -3742,13 +3749,13 @@ function ia() {
|
|
|
3742
3749
|
return typeof t == "object" && (t = Ge(t)), encodeURIComponent(ce(t.toString()));
|
|
3743
3750
|
});
|
|
3744
3751
|
}
|
|
3745
|
-
function
|
|
3752
|
+
function bs(r) {
|
|
3746
3753
|
var t = pe(r, function(a) {
|
|
3747
3754
|
return a !== void 0;
|
|
3748
3755
|
}), s = Xe(_e(Ne(t)), ue.method("join", "=")).join("&");
|
|
3749
3756
|
return s;
|
|
3750
3757
|
}
|
|
3751
|
-
function
|
|
3758
|
+
function ys(r) {
|
|
3752
3759
|
var t = [], s = [];
|
|
3753
3760
|
return (function a(c, p) {
|
|
3754
3761
|
var C, L, F;
|
|
@@ -3779,10 +3786,10 @@ function ia() {
|
|
|
3779
3786
|
try {
|
|
3780
3787
|
return JSON.stringify(r);
|
|
3781
3788
|
} catch {
|
|
3782
|
-
return JSON.stringify(
|
|
3789
|
+
return JSON.stringify(ys(r));
|
|
3783
3790
|
}
|
|
3784
3791
|
}
|
|
3785
|
-
class
|
|
3792
|
+
class _s {
|
|
3786
3793
|
constructor() {
|
|
3787
3794
|
this.globalLog = (t) => {
|
|
3788
3795
|
window.console && window.console.log && window.console.log(t);
|
|
@@ -3808,7 +3815,7 @@ function ia() {
|
|
|
3808
3815
|
_t.log ? _t.log(a) : _t.logToConsole && t.bind(this)(a);
|
|
3809
3816
|
}
|
|
3810
3817
|
}
|
|
3811
|
-
var re = new
|
|
3818
|
+
var re = new _s(), Ss = function(r, t, s, a, c) {
|
|
3812
3819
|
(s.headers !== void 0 || s.headersProvider != null) && re.warn(`To send headers with the ${a.toString()} request, you must use AJAX, rather than JSONP.`);
|
|
3813
3820
|
var p = r.nextAuthCallbackID.toString();
|
|
3814
3821
|
r.nextAuthCallbackID++;
|
|
@@ -3820,8 +3827,8 @@ function ia() {
|
|
|
3820
3827
|
L.src = s.endpoint + "?callback=" + encodeURIComponent(F) + "&" + t;
|
|
3821
3828
|
var K = C.getElementsByTagName("head")[0] || C.documentElement;
|
|
3822
3829
|
K.insertBefore(L, K.firstChild);
|
|
3823
|
-
},
|
|
3824
|
-
class
|
|
3830
|
+
}, Cs = Ss;
|
|
3831
|
+
class ws {
|
|
3825
3832
|
constructor(t) {
|
|
3826
3833
|
this.src = t;
|
|
3827
3834
|
}
|
|
@@ -3841,13 +3848,13 @@ function ia() {
|
|
|
3841
3848
|
this.script && (this.script.onload = this.script.onerror = null, this.script.onreadystatechange = null), this.script && this.script.parentNode && this.script.parentNode.removeChild(this.script), this.errorScript && this.errorScript.parentNode && this.errorScript.parentNode.removeChild(this.errorScript), this.script = null, this.errorScript = null;
|
|
3842
3849
|
}
|
|
3843
3850
|
}
|
|
3844
|
-
class
|
|
3851
|
+
class Ts {
|
|
3845
3852
|
constructor(t, s) {
|
|
3846
3853
|
this.url = t, this.data = s;
|
|
3847
3854
|
}
|
|
3848
3855
|
send(t) {
|
|
3849
3856
|
if (!this.request) {
|
|
3850
|
-
var s =
|
|
3857
|
+
var s = bs(this.data), a = this.url + "/" + t.number + "?" + s;
|
|
3851
3858
|
this.request = z.createScriptRequest(a), this.request.send(t);
|
|
3852
3859
|
}
|
|
3853
3860
|
}
|
|
@@ -3855,17 +3862,17 @@ function ia() {
|
|
|
3855
3862
|
this.request && this.request.cleanup();
|
|
3856
3863
|
}
|
|
3857
3864
|
}
|
|
3858
|
-
var
|
|
3865
|
+
var Es = function(r, t) {
|
|
3859
3866
|
return function(s, a) {
|
|
3860
3867
|
var c = "http" + (t ? "s" : "") + "://", p = c + (r.host || r.options.host) + r.options.path, C = z.createJSONPRequest(p, s), L = z.ScriptReceivers.create(function(F, K) {
|
|
3861
3868
|
l.remove(L), C.cleanup(), K && K.host && (r.host = K.host), a && a(F, K);
|
|
3862
3869
|
});
|
|
3863
3870
|
C.send(L);
|
|
3864
3871
|
};
|
|
3865
|
-
},
|
|
3872
|
+
}, As = {
|
|
3866
3873
|
name: "jsonp",
|
|
3867
|
-
getAgent:
|
|
3868
|
-
},
|
|
3874
|
+
getAgent: Es
|
|
3875
|
+
}, Rs = As;
|
|
3869
3876
|
function lt(r, t, s) {
|
|
3870
3877
|
var a = r + (t.useTLS ? "s" : ""), c = t.useTLS ? t.hostTLS : t.hostNonTLS;
|
|
3871
3878
|
return a + "://" + c + s;
|
|
@@ -3874,17 +3881,17 @@ function ia() {
|
|
|
3874
3881
|
var s = "/app/" + r, a = "?protocol=" + h.PROTOCOL + "&client=js&version=" + h.VERSION + (t ? "&" + t : "");
|
|
3875
3882
|
return s + a;
|
|
3876
3883
|
}
|
|
3877
|
-
var
|
|
3884
|
+
var Ps = {
|
|
3878
3885
|
getInitial: function(r, t) {
|
|
3879
3886
|
var s = (t.httpPath || "") + dt(r, "flash=false");
|
|
3880
3887
|
return lt("ws", t, s);
|
|
3881
3888
|
}
|
|
3882
|
-
},
|
|
3889
|
+
}, Ms = {
|
|
3883
3890
|
getInitial: function(r, t) {
|
|
3884
3891
|
var s = (t.httpPath || "/pusher") + dt(r);
|
|
3885
3892
|
return lt("http", t, s);
|
|
3886
3893
|
}
|
|
3887
|
-
},
|
|
3894
|
+
}, xs = {
|
|
3888
3895
|
getInitial: function(r, t) {
|
|
3889
3896
|
return lt("http", t, t.httpPath || "/pusher");
|
|
3890
3897
|
},
|
|
@@ -3892,7 +3899,7 @@ function ia() {
|
|
|
3892
3899
|
return dt(r);
|
|
3893
3900
|
}
|
|
3894
3901
|
};
|
|
3895
|
-
class
|
|
3902
|
+
class ks {
|
|
3896
3903
|
constructor() {
|
|
3897
3904
|
this._callbacks = {};
|
|
3898
3905
|
}
|
|
@@ -3932,7 +3939,7 @@ function ia() {
|
|
|
3932
3939
|
}
|
|
3933
3940
|
class Se {
|
|
3934
3941
|
constructor(t) {
|
|
3935
|
-
this.callbacks = new
|
|
3942
|
+
this.callbacks = new ks(), this.global_callbacks = [], this.failThrough = t;
|
|
3936
3943
|
}
|
|
3937
3944
|
bind(t, s, a) {
|
|
3938
3945
|
return this.callbacks.add(t, s, a), this;
|
|
@@ -3960,7 +3967,7 @@ function ia() {
|
|
|
3960
3967
|
return this;
|
|
3961
3968
|
}
|
|
3962
3969
|
}
|
|
3963
|
-
class
|
|
3970
|
+
class Is extends Se {
|
|
3964
3971
|
constructor(t, s, a, c, p) {
|
|
3965
3972
|
super(), this.initialize = z.transportConnectionInitializer, this.hooks = t, this.name = s, this.priority = a, this.key = c, this.options = p, this.state = "new", this.timeline = p.timeline, this.activityTimeout = p.activityTimeout, this.id = this.timeline.generateUniqueID();
|
|
3966
3973
|
}
|
|
@@ -4047,11 +4054,11 @@ function ia() {
|
|
|
4047
4054
|
return this.hooks.isSupported(t);
|
|
4048
4055
|
}
|
|
4049
4056
|
createConnection(t, s, a, c) {
|
|
4050
|
-
return new
|
|
4057
|
+
return new Is(this.hooks, t, s, a, c);
|
|
4051
4058
|
}
|
|
4052
4059
|
}
|
|
4053
|
-
var
|
|
4054
|
-
urls:
|
|
4060
|
+
var Ls = new Ue({
|
|
4061
|
+
urls: Ps,
|
|
4055
4062
|
handlesActivityChecks: !1,
|
|
4056
4063
|
supportsPing: !1,
|
|
4057
4064
|
isInitialized: function() {
|
|
@@ -4063,32 +4070,32 @@ function ia() {
|
|
|
4063
4070
|
getSocket: function(r) {
|
|
4064
4071
|
return z.createWebSocket(r);
|
|
4065
4072
|
}
|
|
4066
|
-
}),
|
|
4067
|
-
urls:
|
|
4073
|
+
}), Qt = {
|
|
4074
|
+
urls: Ms,
|
|
4068
4075
|
handlesActivityChecks: !1,
|
|
4069
4076
|
supportsPing: !0,
|
|
4070
4077
|
isInitialized: function() {
|
|
4071
4078
|
return !0;
|
|
4072
4079
|
}
|
|
4073
|
-
},
|
|
4080
|
+
}, Zt = w({
|
|
4074
4081
|
getSocket: function(r) {
|
|
4075
4082
|
return z.HTTPFactory.createStreamingSocket(r);
|
|
4076
4083
|
}
|
|
4077
|
-
},
|
|
4084
|
+
}, Qt), en = w({
|
|
4078
4085
|
getSocket: function(r) {
|
|
4079
4086
|
return z.HTTPFactory.createPollingSocket(r);
|
|
4080
4087
|
}
|
|
4081
|
-
},
|
|
4088
|
+
}, Qt), tn = {
|
|
4082
4089
|
isSupported: function() {
|
|
4083
4090
|
return z.isXHRSupported();
|
|
4084
4091
|
}
|
|
4085
|
-
},
|
|
4086
|
-
ws:
|
|
4087
|
-
xhr_streaming:
|
|
4088
|
-
xhr_polling:
|
|
4089
|
-
}, Je =
|
|
4092
|
+
}, Us = new Ue(w({}, Zt, tn)), Os = new Ue(w({}, en, tn)), Ns = {
|
|
4093
|
+
ws: Ls,
|
|
4094
|
+
xhr_streaming: Us,
|
|
4095
|
+
xhr_polling: Os
|
|
4096
|
+
}, Je = Ns, Ds = new Ue({
|
|
4090
4097
|
file: "sockjs",
|
|
4091
|
-
urls:
|
|
4098
|
+
urls: xs,
|
|
4092
4099
|
handlesActivityChecks: !0,
|
|
4093
4100
|
supportsPing: !1,
|
|
4094
4101
|
isSupported: function() {
|
|
@@ -4110,15 +4117,15 @@ function ia() {
|
|
|
4110
4117
|
path: t
|
|
4111
4118
|
}));
|
|
4112
4119
|
}
|
|
4113
|
-
}),
|
|
4120
|
+
}), nn = {
|
|
4114
4121
|
isSupported: function(r) {
|
|
4115
4122
|
var t = z.isXDRSupported(r.useTLS);
|
|
4116
4123
|
return t;
|
|
4117
4124
|
}
|
|
4118
|
-
},
|
|
4119
|
-
Je.xdr_streaming =
|
|
4120
|
-
var
|
|
4121
|
-
class
|
|
4125
|
+
}, Fs = new Ue(w({}, Zt, nn)), qs = new Ue(w({}, en, nn));
|
|
4126
|
+
Je.xdr_streaming = Fs, Je.xdr_polling = qs, Je.sockjs = Ds;
|
|
4127
|
+
var zs = Je;
|
|
4128
|
+
class js extends Se {
|
|
4122
4129
|
constructor() {
|
|
4123
4130
|
super();
|
|
4124
4131
|
var t = this;
|
|
@@ -4132,8 +4139,8 @@ function ia() {
|
|
|
4132
4139
|
return window.navigator.onLine === void 0 ? !0 : window.navigator.onLine;
|
|
4133
4140
|
}
|
|
4134
4141
|
}
|
|
4135
|
-
var
|
|
4136
|
-
class
|
|
4142
|
+
var $s = new js();
|
|
4143
|
+
class Hs {
|
|
4137
4144
|
constructor(t, s, a) {
|
|
4138
4145
|
this.manager = t, this.transport = s, this.minPingDelay = a.minPingDelay, this.maxPingDelay = a.maxPingDelay, this.pingDelay = void 0;
|
|
4139
4146
|
}
|
|
@@ -4157,7 +4164,7 @@ function ia() {
|
|
|
4157
4164
|
return this.manager.isAlive() && this.transport.isSupported(t);
|
|
4158
4165
|
}
|
|
4159
4166
|
}
|
|
4160
|
-
const
|
|
4167
|
+
const sn = {
|
|
4161
4168
|
decodeMessage: function(r) {
|
|
4162
4169
|
try {
|
|
4163
4170
|
var t = JSON.parse(r.data), s = t.data;
|
|
@@ -4180,7 +4187,7 @@ function ia() {
|
|
|
4180
4187
|
return JSON.stringify(r);
|
|
4181
4188
|
},
|
|
4182
4189
|
processHandshake: function(r) {
|
|
4183
|
-
var t =
|
|
4190
|
+
var t = sn.decodeMessage(r);
|
|
4184
4191
|
if (t.event === "pusher:connection_established") {
|
|
4185
4192
|
if (!t.data.activity_timeout)
|
|
4186
4193
|
throw "No activity timeout specified in handshake";
|
|
@@ -4211,8 +4218,8 @@ function ia() {
|
|
|
4211
4218
|
} : null;
|
|
4212
4219
|
}
|
|
4213
4220
|
};
|
|
4214
|
-
var Re =
|
|
4215
|
-
class
|
|
4221
|
+
var Re = sn;
|
|
4222
|
+
class Bs extends Se {
|
|
4216
4223
|
constructor(t, s) {
|
|
4217
4224
|
super(), this.id = t, this.transport = s, this.activityTimeout = s.activityTimeout, this.bindListeners();
|
|
4218
4225
|
}
|
|
@@ -4286,7 +4293,7 @@ function ia() {
|
|
|
4286
4293
|
a && this.emit("error", a), s && this.emit(s, { action: s, error: a });
|
|
4287
4294
|
}
|
|
4288
4295
|
}
|
|
4289
|
-
class
|
|
4296
|
+
class Vs {
|
|
4290
4297
|
constructor(t, s) {
|
|
4291
4298
|
this.transport = t, this.callback = s, this.bindListeners();
|
|
4292
4299
|
}
|
|
@@ -4304,7 +4311,7 @@ function ia() {
|
|
|
4304
4311
|
return;
|
|
4305
4312
|
}
|
|
4306
4313
|
s.action === "connected" ? this.finish("connected", {
|
|
4307
|
-
connection: new
|
|
4314
|
+
connection: new Bs(s.id, this.transport),
|
|
4308
4315
|
activityTimeout: s.activityTimeout
|
|
4309
4316
|
}) : (this.finish(s.action, { error: s.error }), this.transport.close());
|
|
4310
4317
|
}, this.onClosed = (t) => {
|
|
@@ -4320,7 +4327,7 @@ function ia() {
|
|
|
4320
4327
|
this.callback(w({ transport: this.transport, action: t }, s));
|
|
4321
4328
|
}
|
|
4322
4329
|
}
|
|
4323
|
-
class
|
|
4330
|
+
class Xs {
|
|
4324
4331
|
constructor(t, s) {
|
|
4325
4332
|
this.timeline = t, this.options = s || {};
|
|
4326
4333
|
}
|
|
@@ -4398,7 +4405,7 @@ function ia() {
|
|
|
4398
4405
|
}, s);
|
|
4399
4406
|
}
|
|
4400
4407
|
}
|
|
4401
|
-
class
|
|
4408
|
+
class Ws {
|
|
4402
4409
|
constructor() {
|
|
4403
4410
|
this.reset();
|
|
4404
4411
|
}
|
|
@@ -4430,7 +4437,7 @@ function ia() {
|
|
|
4430
4437
|
this.members = {}, this.count = 0, this.myID = null, this.me = null;
|
|
4431
4438
|
}
|
|
4432
4439
|
}
|
|
4433
|
-
var
|
|
4440
|
+
var Gs = function(r, t, s, a) {
|
|
4434
4441
|
function c(p) {
|
|
4435
4442
|
return p instanceof s ? p : new s(function(C) {
|
|
4436
4443
|
C(p);
|
|
@@ -4457,12 +4464,12 @@ function ia() {
|
|
|
4457
4464
|
K((a = a.apply(r, t || [])).next());
|
|
4458
4465
|
});
|
|
4459
4466
|
};
|
|
4460
|
-
class
|
|
4467
|
+
class Js extends pt {
|
|
4461
4468
|
constructor(t, s) {
|
|
4462
|
-
super(t, s), this.members = new
|
|
4469
|
+
super(t, s), this.members = new Ws();
|
|
4463
4470
|
}
|
|
4464
4471
|
authorize(t, s) {
|
|
4465
|
-
super.authorize(t, (a, c) =>
|
|
4472
|
+
super.authorize(t, (a, c) => Gs(this, void 0, void 0, function* () {
|
|
4466
4473
|
if (!a)
|
|
4467
4474
|
if (c = c, c.channel_data != null) {
|
|
4468
4475
|
var p = JSON.parse(c.channel_data);
|
|
@@ -4512,8 +4519,8 @@ function ia() {
|
|
|
4512
4519
|
this.members.reset(), super.disconnect();
|
|
4513
4520
|
}
|
|
4514
4521
|
}
|
|
4515
|
-
var
|
|
4516
|
-
class
|
|
4522
|
+
var Ks = u(1), gt = u(0);
|
|
4523
|
+
class Ys extends pt {
|
|
4517
4524
|
constructor(t, s, a) {
|
|
4518
4525
|
super(t, s), this.key = null, this.nacl = a;
|
|
4519
4526
|
}
|
|
@@ -4579,7 +4586,7 @@ function ia() {
|
|
|
4579
4586
|
this.emit(t, this.getDataToEmit(p));
|
|
4580
4587
|
}
|
|
4581
4588
|
getDataToEmit(t) {
|
|
4582
|
-
let s = Object(
|
|
4589
|
+
let s = Object(Ks.decode)(t);
|
|
4583
4590
|
try {
|
|
4584
4591
|
return JSON.parse(s);
|
|
4585
4592
|
} catch {
|
|
@@ -4587,7 +4594,7 @@ function ia() {
|
|
|
4587
4594
|
}
|
|
4588
4595
|
}
|
|
4589
4596
|
}
|
|
4590
|
-
class
|
|
4597
|
+
class Qs extends Se {
|
|
4591
4598
|
constructor(t, s) {
|
|
4592
4599
|
super(), this.state = "initialized", this.connection = null, this.key = t, this.options = s, this.timeline = this.options.timeline, this.usingTLS = this.options.useTLS, this.errorCallbacks = this.buildErrorCallbacks(), this.connectionCallbacks = this.buildConnectionCallbacks(this.errorCallbacks), this.handshakeCallbacks = this.buildHandshakeCallbacks(this.errorCallbacks);
|
|
4593
4600
|
var a = z.getNetwork();
|
|
@@ -4743,12 +4750,12 @@ function ia() {
|
|
|
4743
4750
|
return this.state === "connecting" || this.state === "connected";
|
|
4744
4751
|
}
|
|
4745
4752
|
}
|
|
4746
|
-
class
|
|
4753
|
+
class Zs {
|
|
4747
4754
|
constructor() {
|
|
4748
4755
|
this.channels = {};
|
|
4749
4756
|
}
|
|
4750
4757
|
add(t, s) {
|
|
4751
|
-
return this.channels[t] || (this.channels[t] =
|
|
4758
|
+
return this.channels[t] || (this.channels[t] = er(t, s)), this.channels[t];
|
|
4752
4759
|
}
|
|
4753
4760
|
all() {
|
|
4754
4761
|
return ye(this.channels);
|
|
@@ -4766,7 +4773,7 @@ function ia() {
|
|
|
4766
4773
|
});
|
|
4767
4774
|
}
|
|
4768
4775
|
}
|
|
4769
|
-
function
|
|
4776
|
+
function er(r, t) {
|
|
4770
4777
|
if (r.indexOf("private-encrypted-") === 0) {
|
|
4771
4778
|
if (t.config.nacl)
|
|
4772
4779
|
return Ce.createEncryptedChannel(r, t, t.config.nacl);
|
|
@@ -4782,12 +4789,12 @@ function ia() {
|
|
|
4782
4789
|
return Ce.createChannel(r, t);
|
|
4783
4790
|
}
|
|
4784
4791
|
}
|
|
4785
|
-
var
|
|
4792
|
+
var tr = {
|
|
4786
4793
|
createChannels() {
|
|
4787
|
-
return new
|
|
4794
|
+
return new Zs();
|
|
4788
4795
|
},
|
|
4789
4796
|
createConnectionManager(r, t) {
|
|
4790
|
-
return new
|
|
4797
|
+
return new Qs(r, t);
|
|
4791
4798
|
},
|
|
4792
4799
|
createChannel(r, t) {
|
|
4793
4800
|
return new ft(r, t);
|
|
@@ -4796,22 +4803,22 @@ function ia() {
|
|
|
4796
4803
|
return new pt(r, t);
|
|
4797
4804
|
},
|
|
4798
4805
|
createPresenceChannel(r, t) {
|
|
4799
|
-
return new
|
|
4806
|
+
return new Js(r, t);
|
|
4800
4807
|
},
|
|
4801
4808
|
createEncryptedChannel(r, t, s) {
|
|
4802
|
-
return new
|
|
4809
|
+
return new Ys(r, t, s);
|
|
4803
4810
|
},
|
|
4804
4811
|
createTimelineSender(r, t) {
|
|
4805
|
-
return new
|
|
4812
|
+
return new Xs(r, t);
|
|
4806
4813
|
},
|
|
4807
4814
|
createHandshake(r, t) {
|
|
4808
|
-
return new
|
|
4815
|
+
return new Vs(r, t);
|
|
4809
4816
|
},
|
|
4810
4817
|
createAssistantToTheTransportManager(r, t, s) {
|
|
4811
|
-
return new
|
|
4818
|
+
return new Hs(r, t, s);
|
|
4812
4819
|
}
|
|
4813
|
-
}, Ce =
|
|
4814
|
-
class
|
|
4820
|
+
}, Ce = tr;
|
|
4821
|
+
class rn {
|
|
4815
4822
|
constructor(t) {
|
|
4816
4823
|
this.options = t || {}, this.livesLeft = this.options.lives || 1 / 0;
|
|
4817
4824
|
}
|
|
@@ -4872,10 +4879,10 @@ function ia() {
|
|
|
4872
4879
|
return Te(this.strategies, ue.method("isSupported"));
|
|
4873
4880
|
}
|
|
4874
4881
|
connect(t, s) {
|
|
4875
|
-
return
|
|
4882
|
+
return nr(this.strategies, t, function(a, c) {
|
|
4876
4883
|
return function(p, C) {
|
|
4877
4884
|
if (c[a].error = p, p) {
|
|
4878
|
-
|
|
4885
|
+
sr(c) && s(!0);
|
|
4879
4886
|
return;
|
|
4880
4887
|
}
|
|
4881
4888
|
ge(c, function(L) {
|
|
@@ -4885,13 +4892,13 @@ function ia() {
|
|
|
4885
4892
|
});
|
|
4886
4893
|
}
|
|
4887
4894
|
}
|
|
4888
|
-
function
|
|
4895
|
+
function nr(r, t, s) {
|
|
4889
4896
|
var a = Xe(r, function(c, p, C, L) {
|
|
4890
4897
|
return c.connect(t, s(p, L));
|
|
4891
4898
|
});
|
|
4892
4899
|
return {
|
|
4893
4900
|
abort: function() {
|
|
4894
|
-
ge(a,
|
|
4901
|
+
ge(a, rr);
|
|
4895
4902
|
},
|
|
4896
4903
|
forceMinPriority: function(c) {
|
|
4897
4904
|
ge(a, function(p) {
|
|
@@ -4900,15 +4907,15 @@ function ia() {
|
|
|
4900
4907
|
}
|
|
4901
4908
|
};
|
|
4902
4909
|
}
|
|
4903
|
-
function
|
|
4910
|
+
function sr(r) {
|
|
4904
4911
|
return J(r, function(t) {
|
|
4905
4912
|
return !!t.error;
|
|
4906
4913
|
});
|
|
4907
4914
|
}
|
|
4908
|
-
function
|
|
4915
|
+
function rr(r) {
|
|
4909
4916
|
!r.error && !r.aborted && (r.abort(), r.aborted = !0);
|
|
4910
4917
|
}
|
|
4911
|
-
class
|
|
4918
|
+
class ir {
|
|
4912
4919
|
constructor(t, s, a) {
|
|
4913
4920
|
this.strategy = t, this.transports = s, this.ttl = a.ttl || 1800 * 1e3, this.usingTLS = a.useTLS, this.timeline = a.timeline;
|
|
4914
4921
|
}
|
|
@@ -4916,7 +4923,7 @@ function ia() {
|
|
|
4916
4923
|
return this.strategy.isSupported();
|
|
4917
4924
|
}
|
|
4918
4925
|
connect(t, s) {
|
|
4919
|
-
var a = this.usingTLS, c =
|
|
4926
|
+
var a = this.usingTLS, c = or(a), p = c && c.cacheSkipCount ? c.cacheSkipCount : 0, C = [this.strategy];
|
|
4920
4927
|
if (c && c.timestamp + this.ttl >= ue.now()) {
|
|
4921
4928
|
var L = this.transports[c.transport];
|
|
4922
4929
|
L && (["ws", "wss"].includes(c.transport) || p > 3 ? (this.timeline.info({
|
|
@@ -4929,7 +4936,7 @@ function ia() {
|
|
|
4929
4936
|
}))) : p++);
|
|
4930
4937
|
}
|
|
4931
4938
|
var F = ue.now(), K = C.pop().connect(t, function Z(ie, Qe) {
|
|
4932
|
-
ie ? (
|
|
4939
|
+
ie ? (on(a), C.length > 0 ? (F = ue.now(), K = C.pop().connect(t, Z)) : s(ie)) : (ar(a, Qe.transport.name, ue.now() - F, p), s(null, Qe));
|
|
4933
4940
|
});
|
|
4934
4941
|
return {
|
|
4935
4942
|
abort: function() {
|
|
@@ -4944,7 +4951,7 @@ function ia() {
|
|
|
4944
4951
|
function vt(r) {
|
|
4945
4952
|
return "pusherTransport" + (r ? "TLS" : "NonTLS");
|
|
4946
4953
|
}
|
|
4947
|
-
function
|
|
4954
|
+
function or(r) {
|
|
4948
4955
|
var t = z.getLocalStorage();
|
|
4949
4956
|
if (t)
|
|
4950
4957
|
try {
|
|
@@ -4952,11 +4959,11 @@ function ia() {
|
|
|
4952
4959
|
if (s)
|
|
4953
4960
|
return JSON.parse(s);
|
|
4954
4961
|
} catch {
|
|
4955
|
-
|
|
4962
|
+
on(r);
|
|
4956
4963
|
}
|
|
4957
4964
|
return null;
|
|
4958
4965
|
}
|
|
4959
|
-
function
|
|
4966
|
+
function ar(r, t, s, a) {
|
|
4960
4967
|
var c = z.getLocalStorage();
|
|
4961
4968
|
if (c)
|
|
4962
4969
|
try {
|
|
@@ -4969,7 +4976,7 @@ function ia() {
|
|
|
4969
4976
|
} catch {
|
|
4970
4977
|
}
|
|
4971
4978
|
}
|
|
4972
|
-
function
|
|
4979
|
+
function on(r) {
|
|
4973
4980
|
var t = z.getLocalStorage();
|
|
4974
4981
|
if (t)
|
|
4975
4982
|
try {
|
|
@@ -5011,7 +5018,7 @@ function ia() {
|
|
|
5011
5018
|
return a.connect(t, s);
|
|
5012
5019
|
}
|
|
5013
5020
|
}
|
|
5014
|
-
class
|
|
5021
|
+
class cr {
|
|
5015
5022
|
constructor(t) {
|
|
5016
5023
|
this.strategy = t;
|
|
5017
5024
|
}
|
|
@@ -5030,11 +5037,11 @@ function ia() {
|
|
|
5030
5037
|
return r.isSupported();
|
|
5031
5038
|
};
|
|
5032
5039
|
}
|
|
5033
|
-
var
|
|
5040
|
+
var ur = function(r, t, s) {
|
|
5034
5041
|
var a = {};
|
|
5035
|
-
function c(
|
|
5036
|
-
var
|
|
5037
|
-
return a[
|
|
5042
|
+
function c(vn, ci, ui, li, di) {
|
|
5043
|
+
var bn = s(r, vn, ci, ui, li, di);
|
|
5044
|
+
return a[vn] = bn, bn;
|
|
5038
5045
|
}
|
|
5039
5046
|
var p = Object.assign({}, t, {
|
|
5040
5047
|
hostNonTLS: r.wsHost + ":" + r.wsPort,
|
|
@@ -5050,43 +5057,43 @@ function ia() {
|
|
|
5050
5057
|
loop: !0,
|
|
5051
5058
|
timeout: 15e3,
|
|
5052
5059
|
timeoutLimit: 6e4
|
|
5053
|
-
}, K = new
|
|
5060
|
+
}, K = new rn({
|
|
5054
5061
|
minPingDelay: 1e4,
|
|
5055
5062
|
maxPingDelay: r.activityTimeout
|
|
5056
|
-
}), Z = new
|
|
5063
|
+
}), Z = new rn({
|
|
5057
5064
|
lives: 2,
|
|
5058
5065
|
minPingDelay: 1e4,
|
|
5059
5066
|
maxPingDelay: r.activityTimeout
|
|
5060
|
-
}), ie = c("ws", "ws", 3, p, K), Qe = c("wss", "ws", 3, C, K),
|
|
5061
|
-
new De(Fe(
|
|
5062
|
-
], F), pn = new Pe([
|
|
5063
|
-
new De(Fe(dn), dn, si)
|
|
5067
|
+
}), ie = c("ws", "ws", 3, p, K), Qe = c("wss", "ws", 3, C, K), si = c("sockjs", "sockjs", 1, L), dn = c("xhr_streaming", "xhr_streaming", 1, L, Z), ri = c("xdr_streaming", "xdr_streaming", 1, L, Z), hn = c("xhr_polling", "xhr_polling", 1, L), ii = c("xdr_polling", "xdr_polling", 1, L), fn = new Pe([ie], F), oi = new Pe([Qe], F), ai = new Pe([si], F), pn = new Pe([
|
|
5068
|
+
new De(Fe(dn), dn, ri)
|
|
5064
5069
|
], F), gn = new Pe([
|
|
5065
|
-
new De(Fe(
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
+
new De(Fe(hn), hn, ii)
|
|
5071
|
+
], F), mn = new Pe([
|
|
5072
|
+
new De(Fe(pn), new mt([
|
|
5073
|
+
pn,
|
|
5074
|
+
new Ke(gn, { delay: 4e3 })
|
|
5075
|
+
]), gn)
|
|
5076
|
+
], F), St = new De(Fe(mn), mn, ai), Ct;
|
|
5070
5077
|
return t.useTLS ? Ct = new mt([
|
|
5071
|
-
|
|
5078
|
+
fn,
|
|
5072
5079
|
new Ke(St, { delay: 2e3 })
|
|
5073
5080
|
]) : Ct = new mt([
|
|
5074
|
-
|
|
5075
|
-
new Ke(
|
|
5081
|
+
fn,
|
|
5082
|
+
new Ke(oi, { delay: 2e3 }),
|
|
5076
5083
|
new Ke(St, { delay: 5e3 })
|
|
5077
|
-
]), new
|
|
5084
|
+
]), new ir(new cr(new De(Fe(ie), Ct, St)), a, {
|
|
5078
5085
|
ttl: 18e5,
|
|
5079
5086
|
timeline: t.timeline,
|
|
5080
5087
|
useTLS: t.useTLS
|
|
5081
5088
|
});
|
|
5082
|
-
},
|
|
5089
|
+
}, lr = ur, dr = (function() {
|
|
5083
5090
|
var r = this;
|
|
5084
5091
|
r.timeline.info(r.buildTimelineMessage({
|
|
5085
5092
|
transport: r.name + (r.options.useTLS ? "s" : "")
|
|
5086
5093
|
})), r.hooks.isInitialized() ? r.changeState("initialized") : r.hooks.file ? (r.changeState("initializing"), b.load(r.hooks.file, { useTLS: r.options.useTLS }, function(t, s) {
|
|
5087
5094
|
r.hooks.isInitialized() ? (r.changeState("initialized"), s(!0)) : (t && r.onError(t), r.onClose(), s(!1));
|
|
5088
5095
|
})) : r.onClose();
|
|
5089
|
-
}),
|
|
5096
|
+
}), hr = {
|
|
5090
5097
|
getRequest: function(r) {
|
|
5091
5098
|
var t = new window.XDomainRequest();
|
|
5092
5099
|
return t.ontimeout = function() {
|
|
@@ -5102,9 +5109,9 @@ function ia() {
|
|
|
5102
5109
|
abortRequest: function(r) {
|
|
5103
5110
|
r.ontimeout = r.onerror = r.onprogress = r.onload = null, r.abort();
|
|
5104
5111
|
}
|
|
5105
|
-
},
|
|
5106
|
-
const
|
|
5107
|
-
class
|
|
5112
|
+
}, fr = hr;
|
|
5113
|
+
const pr = 256 * 1024;
|
|
5114
|
+
class gr extends Se {
|
|
5108
5115
|
constructor(t, s, a) {
|
|
5109
5116
|
super(), this.hooks = t, this.method = s, this.url = a;
|
|
5110
5117
|
}
|
|
@@ -5132,17 +5139,17 @@ function ia() {
|
|
|
5132
5139
|
return a !== -1 ? (this.position += a + 1, s.slice(0, a)) : null;
|
|
5133
5140
|
}
|
|
5134
5141
|
isBufferTooLong(t) {
|
|
5135
|
-
return this.position === t.length && t.length >
|
|
5142
|
+
return this.position === t.length && t.length > pr;
|
|
5136
5143
|
}
|
|
5137
5144
|
}
|
|
5138
5145
|
var bt;
|
|
5139
5146
|
(function(r) {
|
|
5140
5147
|
r[r.CONNECTING = 0] = "CONNECTING", r[r.OPEN = 1] = "OPEN", r[r.CLOSED = 3] = "CLOSED";
|
|
5141
5148
|
})(bt || (bt = {}));
|
|
5142
|
-
var Me = bt,
|
|
5143
|
-
class
|
|
5149
|
+
var Me = bt, mr = 1;
|
|
5150
|
+
class vr {
|
|
5144
5151
|
constructor(t, s) {
|
|
5145
|
-
this.hooks = t, this.session =
|
|
5152
|
+
this.hooks = t, this.session = cn(1e3) + "/" + Sr(8), this.location = br(s), this.readyState = Me.CONNECTING, this.openStream();
|
|
5146
5153
|
}
|
|
5147
5154
|
send(t) {
|
|
5148
5155
|
return this.sendRaw(JSON.stringify([t]));
|
|
@@ -5156,7 +5163,7 @@ function ia() {
|
|
|
5156
5163
|
sendRaw(t) {
|
|
5157
5164
|
if (this.readyState === Me.OPEN)
|
|
5158
5165
|
try {
|
|
5159
|
-
return z.createSocketRequest("POST",
|
|
5166
|
+
return z.createSocketRequest("POST", an(yr(this.location, this.session))).start(t), !0;
|
|
5160
5167
|
} catch {
|
|
5161
5168
|
return !1;
|
|
5162
5169
|
}
|
|
@@ -5199,7 +5206,7 @@ function ia() {
|
|
|
5199
5206
|
}
|
|
5200
5207
|
}
|
|
5201
5208
|
onOpen(t) {
|
|
5202
|
-
this.readyState === Me.CONNECTING ? (t && t.hostname && (this.location.base =
|
|
5209
|
+
this.readyState === Me.CONNECTING ? (t && t.hostname && (this.location.base = _r(this.location.base, t.hostname)), this.readyState = Me.OPEN, this.onopen && this.onopen()) : this.onClose(1006, "Server lost session", !0);
|
|
5203
5210
|
}
|
|
5204
5211
|
onEvent(t) {
|
|
5205
5212
|
this.readyState === Me.OPEN && this.onmessage && this.onmessage({ data: t });
|
|
@@ -5211,7 +5218,7 @@ function ia() {
|
|
|
5211
5218
|
this.onerror && this.onerror(t);
|
|
5212
5219
|
}
|
|
5213
5220
|
openStream() {
|
|
5214
|
-
this.stream = z.createSocketRequest("POST",
|
|
5221
|
+
this.stream = z.createSocketRequest("POST", an(this.hooks.getReceiveURL(this.location, this.session))), this.stream.bind("chunk", (t) => {
|
|
5215
5222
|
this.onChunk(t);
|
|
5216
5223
|
}), this.stream.bind("finished", (t) => {
|
|
5217
5224
|
this.hooks.onFinished(this, t);
|
|
@@ -5230,33 +5237,33 @@ function ia() {
|
|
|
5230
5237
|
this.stream && (this.stream.unbind_all(), this.stream.close(), this.stream = null);
|
|
5231
5238
|
}
|
|
5232
5239
|
}
|
|
5233
|
-
function
|
|
5240
|
+
function br(r) {
|
|
5234
5241
|
var t = /([^\?]*)\/*(\??.*)/.exec(r);
|
|
5235
5242
|
return {
|
|
5236
5243
|
base: t[1],
|
|
5237
5244
|
queryString: t[2]
|
|
5238
5245
|
};
|
|
5239
5246
|
}
|
|
5240
|
-
function
|
|
5247
|
+
function yr(r, t) {
|
|
5241
5248
|
return r.base + "/" + t + "/xhr_send";
|
|
5242
5249
|
}
|
|
5243
|
-
function
|
|
5250
|
+
function an(r) {
|
|
5244
5251
|
var t = r.indexOf("?") === -1 ? "?" : "&";
|
|
5245
|
-
return r + t + "t=" + +/* @__PURE__ */ new Date() + "&n=" +
|
|
5252
|
+
return r + t + "t=" + +/* @__PURE__ */ new Date() + "&n=" + mr++;
|
|
5246
5253
|
}
|
|
5247
|
-
function
|
|
5254
|
+
function _r(r, t) {
|
|
5248
5255
|
var s = /(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(r);
|
|
5249
5256
|
return s[1] + t + s[3];
|
|
5250
5257
|
}
|
|
5251
|
-
function
|
|
5258
|
+
function cn(r) {
|
|
5252
5259
|
return z.randomInt(r);
|
|
5253
5260
|
}
|
|
5254
|
-
function
|
|
5261
|
+
function Sr(r) {
|
|
5255
5262
|
for (var t = [], s = 0; s < r; s++)
|
|
5256
|
-
t.push(
|
|
5263
|
+
t.push(cn(32).toString(32));
|
|
5257
5264
|
return t.join("");
|
|
5258
5265
|
}
|
|
5259
|
-
var
|
|
5266
|
+
var Cr = vr, wr = {
|
|
5260
5267
|
getReceiveURL: function(r, t) {
|
|
5261
5268
|
return r.base + "/" + t + "/xhr_streaming" + r.queryString;
|
|
5262
5269
|
},
|
|
@@ -5269,7 +5276,7 @@ function ia() {
|
|
|
5269
5276
|
onFinished: function(r, t) {
|
|
5270
5277
|
r.onClose(1006, "Connection interrupted (" + t + ")", !1);
|
|
5271
5278
|
}
|
|
5272
|
-
},
|
|
5279
|
+
}, Tr = wr, Er = {
|
|
5273
5280
|
getReceiveURL: function(r, t) {
|
|
5274
5281
|
return r.base + "/" + t + "/xhr" + r.queryString;
|
|
5275
5282
|
},
|
|
@@ -5281,7 +5288,7 @@ function ia() {
|
|
|
5281
5288
|
onFinished: function(r, t) {
|
|
5282
5289
|
t === 200 ? r.reconnect() : r.onClose(1006, "Connection interrupted (" + t + ")", !1);
|
|
5283
5290
|
}
|
|
5284
|
-
},
|
|
5291
|
+
}, Ar = Er, Rr = {
|
|
5285
5292
|
getRequest: function(r) {
|
|
5286
5293
|
var t = z.getXHRAPI(), s = new t();
|
|
5287
5294
|
return s.onreadystatechange = s.onprogress = function() {
|
|
@@ -5298,36 +5305,36 @@ function ia() {
|
|
|
5298
5305
|
abortRequest: function(r) {
|
|
5299
5306
|
r.onreadystatechange = null, r.abort();
|
|
5300
5307
|
}
|
|
5301
|
-
},
|
|
5308
|
+
}, Pr = Rr, Mr = {
|
|
5302
5309
|
createStreamingSocket(r) {
|
|
5303
|
-
return this.createSocket(
|
|
5310
|
+
return this.createSocket(Tr, r);
|
|
5304
5311
|
},
|
|
5305
5312
|
createPollingSocket(r) {
|
|
5306
|
-
return this.createSocket(
|
|
5313
|
+
return this.createSocket(Ar, r);
|
|
5307
5314
|
},
|
|
5308
5315
|
createSocket(r, t) {
|
|
5309
|
-
return new
|
|
5316
|
+
return new Cr(r, t);
|
|
5310
5317
|
},
|
|
5311
5318
|
createXHR(r, t) {
|
|
5312
|
-
return this.createRequest(
|
|
5319
|
+
return this.createRequest(Pr, r, t);
|
|
5313
5320
|
},
|
|
5314
5321
|
createRequest(r, t, s) {
|
|
5315
|
-
return new
|
|
5322
|
+
return new gr(r, t, s);
|
|
5316
5323
|
}
|
|
5317
|
-
},
|
|
5318
|
-
|
|
5319
|
-
return this.createRequest(
|
|
5324
|
+
}, un = Mr;
|
|
5325
|
+
un.createXDR = function(r, t) {
|
|
5326
|
+
return this.createRequest(fr, r, t);
|
|
5320
5327
|
};
|
|
5321
|
-
var
|
|
5328
|
+
var xr = un, kr = {
|
|
5322
5329
|
nextAuthCallbackID: 1,
|
|
5323
5330
|
auth_callbacks: {},
|
|
5324
5331
|
ScriptReceivers: l,
|
|
5325
5332
|
DependenciesReceivers: x,
|
|
5326
|
-
getDefaultStrategy:
|
|
5327
|
-
Transports:
|
|
5328
|
-
transportConnectionInitializer:
|
|
5329
|
-
HTTPFactory:
|
|
5330
|
-
TimelineTransport:
|
|
5333
|
+
getDefaultStrategy: lr,
|
|
5334
|
+
Transports: zs,
|
|
5335
|
+
transportConnectionInitializer: dr,
|
|
5336
|
+
HTTPFactory: xr,
|
|
5337
|
+
TimelineTransport: Rs,
|
|
5331
5338
|
getXHRAPI() {
|
|
5332
5339
|
return window.XMLHttpRequest;
|
|
5333
5340
|
},
|
|
@@ -5348,7 +5355,7 @@ function ia() {
|
|
|
5348
5355
|
return this.getDocument().location.protocol;
|
|
5349
5356
|
},
|
|
5350
5357
|
getAuthorizers() {
|
|
5351
|
-
return { ajax: Q, jsonp:
|
|
5358
|
+
return { ajax: Q, jsonp: Cs };
|
|
5352
5359
|
},
|
|
5353
5360
|
onDocumentBody(r) {
|
|
5354
5361
|
document.body ? r() : setTimeout(() => {
|
|
@@ -5356,10 +5363,10 @@ function ia() {
|
|
|
5356
5363
|
}, 0);
|
|
5357
5364
|
},
|
|
5358
5365
|
createJSONPRequest(r, t) {
|
|
5359
|
-
return new
|
|
5366
|
+
return new Ts(r, t);
|
|
5360
5367
|
},
|
|
5361
5368
|
createScriptRequest(r) {
|
|
5362
|
-
return new
|
|
5369
|
+
return new ws(r);
|
|
5363
5370
|
},
|
|
5364
5371
|
getLocalStorage() {
|
|
5365
5372
|
try {
|
|
@@ -5379,7 +5386,7 @@ function ia() {
|
|
|
5379
5386
|
return new ActiveXObject("Microsoft.XMLHTTP");
|
|
5380
5387
|
},
|
|
5381
5388
|
getNetwork() {
|
|
5382
|
-
return
|
|
5389
|
+
return $s;
|
|
5383
5390
|
},
|
|
5384
5391
|
createWebSocket(r) {
|
|
5385
5392
|
var t = this.getWebSocketAPI();
|
|
@@ -5411,12 +5418,12 @@ function ia() {
|
|
|
5411
5418
|
return (window.crypto || window.msCrypto).getRandomValues(new Uint32Array(1))[0] / Math.pow(2, 32);
|
|
5412
5419
|
}() * r);
|
|
5413
5420
|
}
|
|
5414
|
-
}, z =
|
|
5421
|
+
}, z = kr, yt;
|
|
5415
5422
|
(function(r) {
|
|
5416
5423
|
r[r.ERROR = 3] = "ERROR", r[r.INFO = 6] = "INFO", r[r.DEBUG = 7] = "DEBUG";
|
|
5417
5424
|
})(yt || (yt = {}));
|
|
5418
5425
|
var Ye = yt;
|
|
5419
|
-
class
|
|
5426
|
+
class Ir {
|
|
5420
5427
|
constructor(t, s, a) {
|
|
5421
5428
|
this.key = t, this.session = s, this.events = [], this.options = a || {}, this.sent = 0, this.uniqueID = 0;
|
|
5422
5429
|
}
|
|
@@ -5454,7 +5461,7 @@ function ia() {
|
|
|
5454
5461
|
return this.uniqueID++, this.uniqueID;
|
|
5455
5462
|
}
|
|
5456
5463
|
}
|
|
5457
|
-
class
|
|
5464
|
+
class Lr {
|
|
5458
5465
|
constructor(t, s, a, c) {
|
|
5459
5466
|
this.name = t, this.priority = s, this.transport = a, this.options = c || {};
|
|
5460
5467
|
}
|
|
@@ -5466,8 +5473,8 @@ function ia() {
|
|
|
5466
5473
|
connect(t, s) {
|
|
5467
5474
|
if (this.isSupported()) {
|
|
5468
5475
|
if (this.priority < t)
|
|
5469
|
-
return
|
|
5470
|
-
} else return
|
|
5476
|
+
return ln(new D(), s);
|
|
5477
|
+
} else return ln(new U(), s);
|
|
5471
5478
|
var a = !1, c = this.transport.createConnection(this.name, this.priority, this.options.key, this.options), p = null, C = function() {
|
|
5472
5479
|
c.unbind("initialized", C), c.connect();
|
|
5473
5480
|
}, L = function() {
|
|
@@ -5493,7 +5500,7 @@ function ia() {
|
|
|
5493
5500
|
};
|
|
5494
5501
|
}
|
|
5495
5502
|
}
|
|
5496
|
-
function
|
|
5503
|
+
function ln(r, t) {
|
|
5497
5504
|
return ue.defer(function() {
|
|
5498
5505
|
t(r);
|
|
5499
5506
|
}), {
|
|
@@ -5503,14 +5510,14 @@ function ia() {
|
|
|
5503
5510
|
}
|
|
5504
5511
|
};
|
|
5505
5512
|
}
|
|
5506
|
-
const { Transports:
|
|
5507
|
-
var
|
|
5508
|
-
var C =
|
|
5513
|
+
const { Transports: Ur } = z;
|
|
5514
|
+
var Or = function(r, t, s, a, c, p) {
|
|
5515
|
+
var C = Ur[s];
|
|
5509
5516
|
if (!C)
|
|
5510
5517
|
throw new M(s);
|
|
5511
5518
|
var L = (!r.enabledTransports || W(r.enabledTransports, t) !== -1) && (!r.disabledTransports || W(r.disabledTransports, t) === -1), F;
|
|
5512
|
-
return L ? (c = Object.assign({ ignoreNullOrigin: r.ignoreNullOrigin }, c), F = new
|
|
5513
|
-
},
|
|
5519
|
+
return L ? (c = Object.assign({ ignoreNullOrigin: r.ignoreNullOrigin }, c), F = new Lr(t, a, p ? p.getAssistant(C) : C, c)) : F = Nr, F;
|
|
5520
|
+
}, Nr = {
|
|
5514
5521
|
isSupported: function() {
|
|
5515
5522
|
return !1;
|
|
5516
5523
|
},
|
|
@@ -5527,14 +5534,14 @@ function ia() {
|
|
|
5527
5534
|
};
|
|
5528
5535
|
}
|
|
5529
5536
|
};
|
|
5530
|
-
function
|
|
5537
|
+
function Dr(r) {
|
|
5531
5538
|
if (r == null)
|
|
5532
5539
|
throw "You must pass an options object";
|
|
5533
5540
|
if (r.cluster == null)
|
|
5534
5541
|
throw "Options object must provide a cluster";
|
|
5535
5542
|
"disableStats" in r && re.warn("The disableStats option is deprecated in favor of enableStats");
|
|
5536
5543
|
}
|
|
5537
|
-
const
|
|
5544
|
+
const Fr = (r, t) => {
|
|
5538
5545
|
var s = "socket_id=" + encodeURIComponent(r.socketId);
|
|
5539
5546
|
for (var a in t.params)
|
|
5540
5547
|
s += "&" + encodeURIComponent(a) + "=" + encodeURIComponent(t.params[a]);
|
|
@@ -5545,15 +5552,15 @@ function ia() {
|
|
|
5545
5552
|
}
|
|
5546
5553
|
return s;
|
|
5547
5554
|
};
|
|
5548
|
-
var
|
|
5555
|
+
var qr = (r) => {
|
|
5549
5556
|
if (typeof z.getAuthorizers()[r.transport] > "u")
|
|
5550
5557
|
throw `'${r.transport}' is not a recognized auth transport`;
|
|
5551
5558
|
return (t, s) => {
|
|
5552
|
-
const a =
|
|
5559
|
+
const a = Fr(t, r);
|
|
5553
5560
|
z.getAuthorizers()[r.transport](z, a, r, T.UserAuthentication, s);
|
|
5554
5561
|
};
|
|
5555
5562
|
};
|
|
5556
|
-
const
|
|
5563
|
+
const zr = (r, t) => {
|
|
5557
5564
|
var s = "socket_id=" + encodeURIComponent(r.socketId);
|
|
5558
5565
|
s += "&channel_name=" + encodeURIComponent(r.channelName);
|
|
5559
5566
|
for (var a in t.params)
|
|
@@ -5565,15 +5572,15 @@ function ia() {
|
|
|
5565
5572
|
}
|
|
5566
5573
|
return s;
|
|
5567
5574
|
};
|
|
5568
|
-
var
|
|
5575
|
+
var jr = (r) => {
|
|
5569
5576
|
if (typeof z.getAuthorizers()[r.transport] > "u")
|
|
5570
5577
|
throw `'${r.transport}' is not a recognized auth transport`;
|
|
5571
5578
|
return (t, s) => {
|
|
5572
|
-
const a =
|
|
5579
|
+
const a = zr(t, r);
|
|
5573
5580
|
z.getAuthorizers()[r.transport](z, a, r, T.ChannelAuthorization, s);
|
|
5574
5581
|
};
|
|
5575
5582
|
};
|
|
5576
|
-
const
|
|
5583
|
+
const $r = (r, t, s) => {
|
|
5577
5584
|
const a = {
|
|
5578
5585
|
authTransport: t.transport,
|
|
5579
5586
|
authEndpoint: t.endpoint,
|
|
@@ -5587,7 +5594,7 @@ function ia() {
|
|
|
5587
5594
|
s(C, a).authorize(c.socketId, p);
|
|
5588
5595
|
};
|
|
5589
5596
|
};
|
|
5590
|
-
function
|
|
5597
|
+
function Hr(r, t) {
|
|
5591
5598
|
let s = {
|
|
5592
5599
|
activityTimeout: r.activityTimeout || h.activityTimeout,
|
|
5593
5600
|
cluster: r.cluster,
|
|
@@ -5600,46 +5607,46 @@ function ia() {
|
|
|
5600
5607
|
wsPath: r.wsPath || h.wsPath,
|
|
5601
5608
|
wsPort: r.wsPort || h.wsPort,
|
|
5602
5609
|
wssPort: r.wssPort || h.wssPort,
|
|
5603
|
-
enableStats:
|
|
5604
|
-
httpHost:
|
|
5605
|
-
useTLS:
|
|
5606
|
-
wsHost:
|
|
5607
|
-
userAuthenticator:
|
|
5608
|
-
channelAuthorizer:
|
|
5610
|
+
enableStats: Gr(r),
|
|
5611
|
+
httpHost: Br(r),
|
|
5612
|
+
useTLS: Wr(r),
|
|
5613
|
+
wsHost: Vr(r),
|
|
5614
|
+
userAuthenticator: Jr(r),
|
|
5615
|
+
channelAuthorizer: Yr(r, t)
|
|
5609
5616
|
};
|
|
5610
5617
|
return "disabledTransports" in r && (s.disabledTransports = r.disabledTransports), "enabledTransports" in r && (s.enabledTransports = r.enabledTransports), "ignoreNullOrigin" in r && (s.ignoreNullOrigin = r.ignoreNullOrigin), "timelineParams" in r && (s.timelineParams = r.timelineParams), "nacl" in r && (s.nacl = r.nacl), s;
|
|
5611
5618
|
}
|
|
5612
|
-
function
|
|
5619
|
+
function Br(r) {
|
|
5613
5620
|
return r.httpHost ? r.httpHost : r.cluster ? `sockjs-${r.cluster}.pusher.com` : h.httpHost;
|
|
5614
5621
|
}
|
|
5615
|
-
function
|
|
5616
|
-
return r.wsHost ? r.wsHost :
|
|
5622
|
+
function Vr(r) {
|
|
5623
|
+
return r.wsHost ? r.wsHost : Xr(r.cluster);
|
|
5617
5624
|
}
|
|
5618
|
-
function
|
|
5625
|
+
function Xr(r) {
|
|
5619
5626
|
return `ws-${r}.pusher.com`;
|
|
5620
5627
|
}
|
|
5621
|
-
function
|
|
5628
|
+
function Wr(r) {
|
|
5622
5629
|
return z.getProtocol() === "https:" ? !0 : r.forceTLS !== !1;
|
|
5623
5630
|
}
|
|
5624
|
-
function
|
|
5631
|
+
function Gr(r) {
|
|
5625
5632
|
return "enableStats" in r ? r.enableStats : "disableStats" in r ? !r.disableStats : !1;
|
|
5626
5633
|
}
|
|
5627
|
-
function
|
|
5634
|
+
function Jr(r) {
|
|
5628
5635
|
const t = Object.assign(Object.assign({}, h.userAuthentication), r.userAuthentication);
|
|
5629
|
-
return "customHandler" in t && t.customHandler != null ? t.customHandler :
|
|
5636
|
+
return "customHandler" in t && t.customHandler != null ? t.customHandler : qr(t);
|
|
5630
5637
|
}
|
|
5631
|
-
function
|
|
5638
|
+
function Kr(r, t) {
|
|
5632
5639
|
let s;
|
|
5633
5640
|
return "channelAuthorization" in r ? s = Object.assign(Object.assign({}, h.channelAuthorization), r.channelAuthorization) : (s = {
|
|
5634
5641
|
transport: r.authTransport || h.authTransport,
|
|
5635
5642
|
endpoint: r.authEndpoint || h.authEndpoint
|
|
5636
|
-
}, "auth" in r && ("params" in r.auth && (s.params = r.auth.params), "headers" in r.auth && (s.headers = r.auth.headers)), "authorizer" in r && (s.customHandler =
|
|
5643
|
+
}, "auth" in r && ("params" in r.auth && (s.params = r.auth.params), "headers" in r.auth && (s.headers = r.auth.headers)), "authorizer" in r && (s.customHandler = $r(t, s, r.authorizer))), s;
|
|
5637
5644
|
}
|
|
5638
|
-
function
|
|
5639
|
-
const s =
|
|
5640
|
-
return "customHandler" in s && s.customHandler != null ? s.customHandler :
|
|
5645
|
+
function Yr(r, t) {
|
|
5646
|
+
const s = Kr(r, t);
|
|
5647
|
+
return "customHandler" in s && s.customHandler != null ? s.customHandler : jr(s);
|
|
5641
5648
|
}
|
|
5642
|
-
class
|
|
5649
|
+
class Qr extends Se {
|
|
5643
5650
|
constructor(t) {
|
|
5644
5651
|
super(function(s, a) {
|
|
5645
5652
|
re.debug(`No callbacks on watchlist events for ${s}`);
|
|
@@ -5657,14 +5664,14 @@ function ia() {
|
|
|
5657
5664
|
});
|
|
5658
5665
|
}
|
|
5659
5666
|
}
|
|
5660
|
-
function
|
|
5667
|
+
function Zr() {
|
|
5661
5668
|
let r, t;
|
|
5662
5669
|
return { promise: new Promise((a, c) => {
|
|
5663
5670
|
r = a, t = c;
|
|
5664
5671
|
}), resolve: r, reject: t };
|
|
5665
5672
|
}
|
|
5666
|
-
var
|
|
5667
|
-
class
|
|
5673
|
+
var ei = Zr;
|
|
5674
|
+
class ti extends Se {
|
|
5668
5675
|
constructor(t) {
|
|
5669
5676
|
super(function(s, a) {
|
|
5670
5677
|
re.debug("No callbacks on user for " + s);
|
|
@@ -5679,7 +5686,7 @@ function ia() {
|
|
|
5679
5686
|
});
|
|
5680
5687
|
}, this.pusher = t, this.pusher.connection.bind("state_change", ({ previous: s, current: a }) => {
|
|
5681
5688
|
s !== "connected" && a === "connected" && this._signin(), s === "connected" && a !== "connected" && (this._cleanup(), this._newSigninPromiseIfNeeded());
|
|
5682
|
-
}), this.watchlist = new
|
|
5689
|
+
}), this.watchlist = new Qr(t), this.pusher.connection.bind("message", (s) => {
|
|
5683
5690
|
var a = s.event;
|
|
5684
5691
|
a === "pusher:signin_success" && this._onSigninSuccess(s.data), this.serverToUserChannel && this.serverToUserChannel.name === s.channel && this.serverToUserChannel.handleEvent(s);
|
|
5685
5692
|
});
|
|
@@ -5719,7 +5726,7 @@ function ia() {
|
|
|
5719
5726
|
_newSigninPromiseIfNeeded() {
|
|
5720
5727
|
if (!this.signin_requested || this.signinDonePromise && !this.signinDonePromise.done)
|
|
5721
5728
|
return;
|
|
5722
|
-
const { promise: t, resolve: s } =
|
|
5729
|
+
const { promise: t, resolve: s } = ei();
|
|
5723
5730
|
t.done = !1;
|
|
5724
5731
|
const a = () => {
|
|
5725
5732
|
t.done = !0;
|
|
@@ -5739,7 +5746,7 @@ function ia() {
|
|
|
5739
5746
|
}));
|
|
5740
5747
|
}
|
|
5741
5748
|
constructor(t, s) {
|
|
5742
|
-
|
|
5749
|
+
ni(t), Dr(s), this.key = t, this.config = Hr(s, this), this.channels = Ce.createChannels(), this.global_emitter = new Se(), this.sessionID = z.randomInt(1e9), this.timeline = new Ir(this.key, this.sessionID, {
|
|
5743
5750
|
cluster: this.config.cluster,
|
|
5744
5751
|
features: le.getClientFeatures(),
|
|
5745
5752
|
params: this.config.timelineParams || {},
|
|
@@ -5750,7 +5757,7 @@ function ia() {
|
|
|
5750
5757
|
host: this.config.statsHost,
|
|
5751
5758
|
path: "/timeline/v2/" + z.TimelineTransport.name
|
|
5752
5759
|
}));
|
|
5753
|
-
var a = (c) => z.getDefaultStrategy(this.config, c,
|
|
5760
|
+
var a = (c) => z.getDefaultStrategy(this.config, c, Or);
|
|
5754
5761
|
this.connection = Ce.createConnectionManager(this.key, {
|
|
5755
5762
|
getStrategy: a,
|
|
5756
5763
|
timeline: this.timeline,
|
|
@@ -5773,7 +5780,7 @@ function ia() {
|
|
|
5773
5780
|
this.channels.disconnect();
|
|
5774
5781
|
}), this.connection.bind("error", (c) => {
|
|
5775
5782
|
re.warn(c);
|
|
5776
|
-
}), le.instances.push(this), this.timeline.info({ instances: le.instances.length }), this.user = new
|
|
5783
|
+
}), le.instances.push(this), this.timeline.info({ instances: le.instances.length }), this.user = new ti(this), le.isReady && this.connect();
|
|
5777
5784
|
}
|
|
5778
5785
|
channel(t) {
|
|
5779
5786
|
return this.channels.find(t);
|
|
@@ -5784,7 +5791,7 @@ function ia() {
|
|
|
5784
5791
|
connect() {
|
|
5785
5792
|
if (this.connection.connect(), this.timelineSender && !this.timelineSenderTimer) {
|
|
5786
5793
|
var t = this.connection.isUsingTLS(), s = this.timelineSender;
|
|
5787
|
-
this.timelineSenderTimer = new
|
|
5794
|
+
this.timelineSenderTimer = new Kt(6e4, function() {
|
|
5788
5795
|
s.send(t);
|
|
5789
5796
|
});
|
|
5790
5797
|
}
|
|
@@ -5832,7 +5839,7 @@ function ia() {
|
|
|
5832
5839
|
}
|
|
5833
5840
|
le.instances = [], le.isReady = !1, le.logToConsole = !1, le.Runtime = z, le.ScriptReceivers = z.ScriptReceivers, le.DependenciesReceivers = z.DependenciesReceivers, le.auth_callbacks = z.auth_callbacks;
|
|
5834
5841
|
var _t = o.default = le;
|
|
5835
|
-
function
|
|
5842
|
+
function ni(r) {
|
|
5836
5843
|
if (r == null)
|
|
5837
5844
|
throw "You must pass your app key when you instantiate Pusher.";
|
|
5838
5845
|
}
|
|
@@ -5844,8 +5851,8 @@ function ia() {
|
|
|
5844
5851
|
});
|
|
5845
5852
|
})(Pt)), Pt.exports;
|
|
5846
5853
|
}
|
|
5847
|
-
var
|
|
5848
|
-
const
|
|
5854
|
+
var ca = aa();
|
|
5855
|
+
const ua = /* @__PURE__ */ oa(ca), la = "/v1/messenger/bootstrap", da = 3e4, ha = 3e4, fa = 5 * 6e4;
|
|
5849
5856
|
function ee(e) {
|
|
5850
5857
|
return typeof e == "object" && e !== null;
|
|
5851
5858
|
}
|
|
@@ -5867,7 +5874,7 @@ function $e(e, n) {
|
|
|
5867
5874
|
const o = i.trim();
|
|
5868
5875
|
return o === "" ? null : o;
|
|
5869
5876
|
}
|
|
5870
|
-
function
|
|
5877
|
+
function pa(e, n) {
|
|
5871
5878
|
const i = e[n];
|
|
5872
5879
|
if (typeof i == "number" && Number.isFinite(i))
|
|
5873
5880
|
return i;
|
|
@@ -5878,14 +5885,14 @@ function ha(e, n) {
|
|
|
5878
5885
|
}
|
|
5879
5886
|
throw new Error(`Invalid messenger bootstrap payload: missing integer ${n}`);
|
|
5880
5887
|
}
|
|
5881
|
-
function
|
|
5888
|
+
function ga(e) {
|
|
5882
5889
|
return e.toLowerCase() === "http" ? "http" : "https";
|
|
5883
5890
|
}
|
|
5884
|
-
function
|
|
5891
|
+
function ma(e) {
|
|
5885
5892
|
if (e !== null)
|
|
5886
5893
|
return e.startsWith("/") ? e : `/${e}`;
|
|
5887
5894
|
}
|
|
5888
|
-
function
|
|
5895
|
+
function va(e) {
|
|
5889
5896
|
const n = ee(e) && ee(e.data) ? e.data : e;
|
|
5890
5897
|
if (!ee(n))
|
|
5891
5898
|
throw new Error("Invalid messenger bootstrap payload: expected object");
|
|
@@ -5895,7 +5902,7 @@ function ga(e) {
|
|
|
5895
5902
|
const u = i.user, d = o.reverb;
|
|
5896
5903
|
if (!ee(u) || !ee(d))
|
|
5897
5904
|
throw new Error("Invalid messenger bootstrap payload: missing user or reverb data");
|
|
5898
|
-
const l =
|
|
5905
|
+
const l = ma($e(d, "path"));
|
|
5899
5906
|
return {
|
|
5900
5907
|
auth: {
|
|
5901
5908
|
token: ve(i, "token"),
|
|
@@ -5917,17 +5924,17 @@ function ga(e) {
|
|
|
5917
5924
|
reverb: {
|
|
5918
5925
|
appKey: ve(d, "app_key"),
|
|
5919
5926
|
host: ve(d, "host"),
|
|
5920
|
-
port:
|
|
5921
|
-
scheme:
|
|
5927
|
+
port: pa(d, "port"),
|
|
5928
|
+
scheme: ga(ve(d, "scheme")),
|
|
5922
5929
|
...l ? { path: l } : {}
|
|
5923
5930
|
}
|
|
5924
5931
|
}
|
|
5925
5932
|
};
|
|
5926
5933
|
}
|
|
5927
|
-
function
|
|
5934
|
+
function ba(e) {
|
|
5928
5935
|
return e.replace(/^https?:\/\//, "").replace(/\/.*$/, "").replace(/:\d+$/, "");
|
|
5929
5936
|
}
|
|
5930
|
-
function
|
|
5937
|
+
function ya(e) {
|
|
5931
5938
|
if (!ee(e))
|
|
5932
5939
|
return !1;
|
|
5933
5940
|
const n = ee(e.response) ? e.response : null;
|
|
@@ -5936,13 +5943,13 @@ function va(e) {
|
|
|
5936
5943
|
const i = n.data;
|
|
5937
5944
|
return i?.code === "ACCOUNT_SUSPENDED" || i?.errors?.reason === "account_suspended" ? !0 : typeof i?.message == "string" && i.message.toLowerCase().includes("suspended");
|
|
5938
5945
|
}
|
|
5939
|
-
function
|
|
5940
|
-
if (e.headers instanceof
|
|
5946
|
+
function qn(e, n) {
|
|
5947
|
+
if (e.headers instanceof yn) {
|
|
5941
5948
|
e.headers.set("Authorization", `Bearer ${n}`), e.headers.set("Accept", "application/json"), e.headers.set("X-Requested-With", "XMLHttpRequest"), typeof FormData < "u" && e.data instanceof FormData && (e.headers.delete("Content-Type"), e.headers.delete("content-type"));
|
|
5942
5949
|
return;
|
|
5943
5950
|
}
|
|
5944
5951
|
const i = ee(e.headers) ? e.headers : {};
|
|
5945
|
-
e.headers = new
|
|
5952
|
+
e.headers = new yn({
|
|
5946
5953
|
...i,
|
|
5947
5954
|
Authorization: `Bearer ${n}`,
|
|
5948
5955
|
Accept: "application/json",
|
|
@@ -5956,16 +5963,16 @@ function we(e, n, i) {
|
|
|
5956
5963
|
const u = e[i];
|
|
5957
5964
|
return typeof u == "string" && u.trim() !== "" ? u : null;
|
|
5958
5965
|
}
|
|
5959
|
-
function
|
|
5966
|
+
function _a(e) {
|
|
5960
5967
|
if (typeof e != "string")
|
|
5961
5968
|
return null;
|
|
5962
5969
|
const n = e.trim().toLowerCase();
|
|
5963
5970
|
return n === "online" || n === "idle" || n === "dnd" || n === "offline" ? n : null;
|
|
5964
5971
|
}
|
|
5965
|
-
function
|
|
5972
|
+
function Sa(e, n) {
|
|
5966
5973
|
if (!ee(e))
|
|
5967
5974
|
return null;
|
|
5968
|
-
const i = we(e, "user_id", "userId"), o =
|
|
5975
|
+
const i = we(e, "user_id", "userId"), o = _a(e.status);
|
|
5969
5976
|
if (!i || !o)
|
|
5970
5977
|
return null;
|
|
5971
5978
|
const u = {
|
|
@@ -5978,7 +5985,7 @@ function ya(e, n) {
|
|
|
5978
5985
|
const l = e.last_seen_at ?? e.lastSeenAt;
|
|
5979
5986
|
return typeof l == "string" ? u.last_seen_at = l : l === null && (u.last_seen_at = null), u;
|
|
5980
5987
|
}
|
|
5981
|
-
function
|
|
5988
|
+
function Ca(e) {
|
|
5982
5989
|
if (!ee(e))
|
|
5983
5990
|
return null;
|
|
5984
5991
|
const n = we(e, "user_id", "userId"), i = we(e, "conversation_id", "conversationId");
|
|
@@ -5999,7 +6006,7 @@ function _a(e) {
|
|
|
5999
6006
|
...typeof e.stopped_at == "string" ? { stopped_at: e.stopped_at } : {}
|
|
6000
6007
|
};
|
|
6001
6008
|
}
|
|
6002
|
-
function
|
|
6009
|
+
function wa(e) {
|
|
6003
6010
|
if (!ee(e))
|
|
6004
6011
|
return null;
|
|
6005
6012
|
const n = we(e, "user_id", "userId"), i = we(e, "conversation_id", "conversationId");
|
|
@@ -6018,7 +6025,7 @@ function Sa(e) {
|
|
|
6018
6025
|
...typeof e.ts == "string" ? { ts: e.ts } : {}
|
|
6019
6026
|
};
|
|
6020
6027
|
}
|
|
6021
|
-
function
|
|
6028
|
+
function Ta(e) {
|
|
6022
6029
|
if (!ee(e))
|
|
6023
6030
|
return null;
|
|
6024
6031
|
const n = we(e, "user_id", "userId"), i = we(e, "conversation_id", "conversationId");
|
|
@@ -6029,31 +6036,31 @@ function Ca(e) {
|
|
|
6029
6036
|
...typeof e.ts == "string" ? { ts: e.ts } : {}
|
|
6030
6037
|
};
|
|
6031
6038
|
}
|
|
6032
|
-
function
|
|
6039
|
+
function Ea(e) {
|
|
6033
6040
|
return ee(e) && ae(e, "id") && ae(e, "name");
|
|
6034
6041
|
}
|
|
6035
|
-
function
|
|
6036
|
-
return !ee(e) || !ae(e, "reaction") || typeof e.count != "number" ? !1 : Array.isArray(e.users) && e.users.every((n) =>
|
|
6042
|
+
function Aa(e) {
|
|
6043
|
+
return !ee(e) || !ae(e, "reaction") || typeof e.count != "number" ? !1 : Array.isArray(e.users) && e.users.every((n) => Ea(n));
|
|
6037
6044
|
}
|
|
6038
|
-
function
|
|
6045
|
+
function Ra(e) {
|
|
6039
6046
|
return ee(e) && ee(e.message) && ae(e.message, "id") && ae(e.message, "conversation_id") && ae(e.message, "author_id");
|
|
6040
6047
|
}
|
|
6041
|
-
function
|
|
6048
|
+
function Pa(e) {
|
|
6042
6049
|
return ee(e) && ae(e, "conversation_id") && ae(e, "user_id") && ae(e, "message_id");
|
|
6043
6050
|
}
|
|
6044
|
-
function
|
|
6051
|
+
function Ma(e) {
|
|
6045
6052
|
return ee(e) && ae(e, "conversation_id") && ee(e.message) && ae(e.message, "id");
|
|
6046
6053
|
}
|
|
6047
|
-
function
|
|
6054
|
+
function xa(e) {
|
|
6048
6055
|
return ee(e) && ae(e, "conversation_id") && ae(e, "message_id");
|
|
6049
6056
|
}
|
|
6050
|
-
function
|
|
6051
|
-
return ee(e) && ae(e, "conversation_id") && ae(e, "message_id") && Array.isArray(e.reactions) && e.reactions.every((n) =>
|
|
6057
|
+
function ka(e) {
|
|
6058
|
+
return ee(e) && ae(e, "conversation_id") && ae(e, "message_id") && Array.isArray(e.reactions) && e.reactions.every((n) => Aa(n));
|
|
6052
6059
|
}
|
|
6053
|
-
function
|
|
6060
|
+
function Ia(e) {
|
|
6054
6061
|
return ee(e) && ae(e, "conversation_id");
|
|
6055
6062
|
}
|
|
6056
|
-
function
|
|
6063
|
+
function La(e) {
|
|
6057
6064
|
return ee(e) && ae(e, "conversation_id") && ae(e, "removed_user_id");
|
|
6058
6065
|
}
|
|
6059
6066
|
function ke(e, n, i, o) {
|
|
@@ -6062,9 +6069,9 @@ function ke(e, n, i, o) {
|
|
|
6062
6069
|
};
|
|
6063
6070
|
return e.listen(n, u), u;
|
|
6064
6071
|
}
|
|
6065
|
-
function
|
|
6066
|
-
const n = e.initializedEvent ?? "messenger-client:echo-initialized", i = e.bootstrapEndpoint ??
|
|
6067
|
-
typeof window < "u" && (window.Pusher =
|
|
6072
|
+
function Ya(e) {
|
|
6073
|
+
const n = e.initializedEvent ?? "messenger-client:echo-initialized", i = e.bootstrapEndpoint ?? la, o = e.bootstrapRefreshSkewMs ?? da, u = e.presenceFreshnessTtlMs ?? fa, d = (e.createLogger ?? Bt())("MessengerEcho");
|
|
6074
|
+
typeof window < "u" && (window.Pusher = ua);
|
|
6068
6075
|
let l = null, g = null, h = null, k = null, x = "disconnected", b = "available", S = null, E = null;
|
|
6069
6076
|
const P = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Map(), m = (w) => {
|
|
6070
6077
|
x = w;
|
|
@@ -6107,10 +6114,10 @@ function Ja(e) {
|
|
|
6107
6114
|
const W = await e.bootstrapClient.get(
|
|
6108
6115
|
i,
|
|
6109
6116
|
w ? { params: { refresh: 1 } } : void 0
|
|
6110
|
-
), H =
|
|
6117
|
+
), H = va(W.data);
|
|
6111
6118
|
return l = H, v("available"), j(H), H;
|
|
6112
6119
|
} catch (W) {
|
|
6113
|
-
if (
|
|
6120
|
+
if (ya(W))
|
|
6114
6121
|
return l = null, D(), v("account_suspended"), X(), m("disconnected"), null;
|
|
6115
6122
|
throw W;
|
|
6116
6123
|
}
|
|
@@ -6150,7 +6157,7 @@ function Ja(e) {
|
|
|
6150
6157
|
const H = W.service.reverb.scheme === "https", se = {
|
|
6151
6158
|
broadcaster: "reverb",
|
|
6152
6159
|
key: W.service.reverb.appKey,
|
|
6153
|
-
wsHost:
|
|
6160
|
+
wsHost: ba(W.service.reverb.host),
|
|
6154
6161
|
wsPort: W.service.reverb.port,
|
|
6155
6162
|
wssPort: W.service.reverb.port,
|
|
6156
6163
|
forceTLS: H,
|
|
@@ -6165,11 +6172,11 @@ function Ja(e) {
|
|
|
6165
6172
|
}
|
|
6166
6173
|
}
|
|
6167
6174
|
};
|
|
6168
|
-
return W.service.reverb.path && (se.wsPath = W.service.reverb.path), h = new
|
|
6175
|
+
return W.service.reverb.path && (se.wsPath = W.service.reverb.path), h = new ia(se), ce(h), m("connecting"), typeof window < "u" && window.dispatchEvent(new CustomEvent(n)), h;
|
|
6169
6176
|
})().finally(() => {
|
|
6170
6177
|
k = null;
|
|
6171
|
-
}), await k), _ =
|
|
6172
|
-
timeout: e.requestTimeoutMs ??
|
|
6178
|
+
}), await k), _ = Nt.create({
|
|
6179
|
+
timeout: e.requestTimeoutMs ?? ha,
|
|
6173
6180
|
withCredentials: !1,
|
|
6174
6181
|
headers: {
|
|
6175
6182
|
Accept: "application/json",
|
|
@@ -6180,7 +6187,7 @@ function Ja(e) {
|
|
|
6180
6187
|
const I = await N();
|
|
6181
6188
|
if (I === null)
|
|
6182
6189
|
throw new Error("Messenger bootstrap is unavailable.");
|
|
6183
|
-
return w.baseURL = I.service.apiBaseUrl,
|
|
6190
|
+
return w.baseURL = I.service.apiBaseUrl, qn(w, I.auth.token), w;
|
|
6184
6191
|
}), _.interceptors.response.use(
|
|
6185
6192
|
(w) => w,
|
|
6186
6193
|
async (w) => {
|
|
@@ -6189,7 +6196,7 @@ function Ja(e) {
|
|
|
6189
6196
|
I._messengerRetry = !0;
|
|
6190
6197
|
const W = await N(!0);
|
|
6191
6198
|
if (W !== null)
|
|
6192
|
-
return I.baseURL = W.service.apiBaseUrl,
|
|
6199
|
+
return I.baseURL = W.service.apiBaseUrl, qn(I, W.auth.token), await _(I);
|
|
6193
6200
|
}
|
|
6194
6201
|
return Promise.reject(w);
|
|
6195
6202
|
}
|
|
@@ -6201,7 +6208,7 @@ function Ja(e) {
|
|
|
6201
6208
|
}), R = (w) => (T.add(w), w(b), () => {
|
|
6202
6209
|
T.delete(w);
|
|
6203
6210
|
}), y = () => l?.auth.tenantId ?? "global", O = (w) => {
|
|
6204
|
-
const I =
|
|
6211
|
+
const I = Lt(w.ts)?.getTime() ?? Lt(w.last_seen_at)?.getTime() ?? null;
|
|
6205
6212
|
if (I === null)
|
|
6206
6213
|
return !0;
|
|
6207
6214
|
const W = `${w.tenant_scope ?? "global"}:${w.user_id}`, H = f.get(W);
|
|
@@ -6243,7 +6250,7 @@ function Ja(e) {
|
|
|
6243
6250
|
];
|
|
6244
6251
|
for (const se of H)
|
|
6245
6252
|
W.listen(se, (ye) => {
|
|
6246
|
-
const ge =
|
|
6253
|
+
const ge = Sa(ye, y());
|
|
6247
6254
|
!ge || !O(ge) || w(ge);
|
|
6248
6255
|
});
|
|
6249
6256
|
},
|
|
@@ -6258,25 +6265,25 @@ function Ja(e) {
|
|
|
6258
6265
|
const H = W.private(`conversation.${w}`), se = [];
|
|
6259
6266
|
return I.onMessageSent && se.push({
|
|
6260
6267
|
event: ".ConversationMessageSent",
|
|
6261
|
-
handler: ke(H, ".ConversationMessageSent",
|
|
6268
|
+
handler: ke(H, ".ConversationMessageSent", Ra, I.onMessageSent)
|
|
6262
6269
|
}), I.onMessageRead && se.push({
|
|
6263
6270
|
event: ".ConversationMessageRead",
|
|
6264
|
-
handler: ke(H, ".ConversationMessageRead",
|
|
6271
|
+
handler: ke(H, ".ConversationMessageRead", Pa, I.onMessageRead)
|
|
6265
6272
|
}), I.onMessageEdited && se.push({
|
|
6266
6273
|
event: ".ConversationMessageEdited",
|
|
6267
|
-
handler: ke(H, ".ConversationMessageEdited",
|
|
6274
|
+
handler: ke(H, ".ConversationMessageEdited", Ma, I.onMessageEdited)
|
|
6268
6275
|
}), I.onMessageDeleted && se.push({
|
|
6269
6276
|
event: ".ConversationMessageDeleted",
|
|
6270
|
-
handler: ke(H, ".ConversationMessageDeleted",
|
|
6277
|
+
handler: ke(H, ".ConversationMessageDeleted", xa, I.onMessageDeleted)
|
|
6271
6278
|
}), I.onReactionToggled && se.push({
|
|
6272
6279
|
event: ".MessageReactionToggled",
|
|
6273
|
-
handler: ke(H, ".MessageReactionToggled",
|
|
6280
|
+
handler: ke(H, ".MessageReactionToggled", ka, I.onReactionToggled)
|
|
6274
6281
|
}), I.onRequestAccepted && se.push({
|
|
6275
6282
|
event: ".ConversationRequestAccepted",
|
|
6276
|
-
handler: ke(H, ".ConversationRequestAccepted",
|
|
6283
|
+
handler: ke(H, ".ConversationRequestAccepted", Ia, I.onRequestAccepted)
|
|
6277
6284
|
}), I.onParticipantRemoved && se.push({
|
|
6278
6285
|
event: ".ConversationParticipantRemoved",
|
|
6279
|
-
handler: ke(H, ".ConversationParticipantRemoved",
|
|
6286
|
+
handler: ke(H, ".ConversationParticipantRemoved", La, I.onParticipantRemoved)
|
|
6280
6287
|
}), () => {
|
|
6281
6288
|
if (typeof H.stopListening == "function")
|
|
6282
6289
|
for (const ye of se)
|
|
@@ -6303,7 +6310,7 @@ function Ja(e) {
|
|
|
6303
6310
|
], ge = [".typing.start", "typing.start", ".TypingStarted", "TypingStarted", ".TypingStart", "TypingStart"], Xe = [".typing.stop", "typing.stop", ".TypingStopped", "TypingStopped", ".TypingStop", "TypingStop"], ut = /* @__PURE__ */ new Set(["start", "typing"]), We = /* @__PURE__ */ new Set(["stop", "idle", "viewing"]);
|
|
6304
6311
|
for (const pe of ye) {
|
|
6305
6312
|
const _e = (Te) => {
|
|
6306
|
-
const J =
|
|
6313
|
+
const J = Ca(Te);
|
|
6307
6314
|
if (J) {
|
|
6308
6315
|
if (ut.has(J.state)) {
|
|
6309
6316
|
I.onTypingStart?.({
|
|
@@ -6328,7 +6335,7 @@ function Ja(e) {
|
|
|
6328
6335
|
}
|
|
6329
6336
|
for (const pe of ge) {
|
|
6330
6337
|
const _e = (Te) => {
|
|
6331
|
-
const J =
|
|
6338
|
+
const J = wa(Te);
|
|
6332
6339
|
if (!J)
|
|
6333
6340
|
return;
|
|
6334
6341
|
const Ne = {
|
|
@@ -6347,7 +6354,7 @@ function Ja(e) {
|
|
|
6347
6354
|
}
|
|
6348
6355
|
for (const pe of Xe) {
|
|
6349
6356
|
const _e = (Te) => {
|
|
6350
|
-
const J =
|
|
6357
|
+
const J = Ta(Te);
|
|
6351
6358
|
if (!J)
|
|
6352
6359
|
return;
|
|
6353
6360
|
const Ne = {
|
|
@@ -6372,72 +6379,72 @@ function Ja(e) {
|
|
|
6372
6379
|
};
|
|
6373
6380
|
}
|
|
6374
6381
|
export {
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6382
|
+
So as DEFAULT_PRESENCE_STALE_AFTER_MS,
|
|
6383
|
+
Ja as configureMessengerClient,
|
|
6384
|
+
Ya as createMessengerEcho,
|
|
6378
6385
|
G as getApi,
|
|
6379
6386
|
Le as getAuthStore,
|
|
6380
|
-
|
|
6387
|
+
za as getConnectionStatus,
|
|
6381
6388
|
Ie as getEcho,
|
|
6382
|
-
|
|
6389
|
+
Kn as getEchoConnectionStatus,
|
|
6383
6390
|
Be as getEchoInitializedEvent,
|
|
6384
6391
|
Y as getErrorMessage,
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6392
|
+
Bt as getLoggerFactory,
|
|
6393
|
+
as as getMainApi,
|
|
6394
|
+
ao as getMainEcho,
|
|
6395
|
+
co as getMainEchoConnectionStatus,
|
|
6396
|
+
oo as getMainEchoInitializedEvent,
|
|
6397
|
+
Ni as getMediaApi,
|
|
6398
|
+
xt as getMessagingAccessState,
|
|
6399
|
+
Io as getPresenceRuntimeConfig,
|
|
6400
|
+
$a as hasResponse,
|
|
6401
|
+
ec as isAxiosError,
|
|
6402
|
+
ja as isError,
|
|
6403
|
+
Mi as isValidMessageDeletedEvent,
|
|
6404
|
+
Pi as isValidMessageEditedEvent,
|
|
6405
|
+
Ri as isValidMessageReadEvent,
|
|
6406
|
+
Ai as isValidMessageSentEvent,
|
|
6407
|
+
xi as isValidReactionToggledEvent,
|
|
6408
|
+
ki as isValidRequestAcceptedEvent,
|
|
6402
6409
|
Ee as messagingApi,
|
|
6403
|
-
|
|
6404
|
-
|
|
6410
|
+
wo as normalizePresenceStatus,
|
|
6411
|
+
cs as normalizePresenceTimestamp,
|
|
6405
6412
|
ct as onConnectionStatusChange,
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6413
|
+
uo as onMainEchoConnectionStatusChange,
|
|
6414
|
+
mi as onMessagingAccessStateChange,
|
|
6415
|
+
Lt as parsePresenceTimestamp,
|
|
6416
|
+
vi as reconnectEcho,
|
|
6417
|
+
lo as reconnectMainEcho,
|
|
6418
|
+
Ei as resetEchoRuntimeConfig,
|
|
6419
|
+
mo as resetLoggerFactory,
|
|
6420
|
+
_o as resetMainApiClient,
|
|
6421
|
+
fo as resetMainEchoRuntimeConfig,
|
|
6422
|
+
Li as resetMessagingApiClient,
|
|
6423
|
+
Oi as resetMessagingAuthStoreResolver,
|
|
6424
|
+
Fi as resetMessagingMediaApi,
|
|
6425
|
+
Ka as resetMessengerClientConfig,
|
|
6426
|
+
Uo as resetPresenceRuntimeConfig,
|
|
6427
|
+
To as resolveFreshPresenceStatus,
|
|
6428
|
+
Nn as resolvePresenceSnapshot,
|
|
6429
|
+
Ti as setEchoRuntimeConfig,
|
|
6430
|
+
go as setLoggerFactory,
|
|
6431
|
+
yo as setMainApiClient,
|
|
6432
|
+
ho as setMainEchoRuntimeConfig,
|
|
6433
|
+
Ii as setMessagingApiClient,
|
|
6434
|
+
Ui as setMessagingAuthStoreResolver,
|
|
6435
|
+
Di as setMessagingMediaApi,
|
|
6436
|
+
Lo as setPresenceRuntimeConfig,
|
|
6437
|
+
_i as subscribeToConversation,
|
|
6438
|
+
bi as subscribeToPresenceStatus,
|
|
6439
|
+
Ci as subscribeToTyping,
|
|
6440
|
+
Si as unsubscribeFromConversation,
|
|
6441
|
+
yi as unsubscribeFromPresenceStatus,
|
|
6442
|
+
wi as unsubscribeFromTyping,
|
|
6443
|
+
Ba as useConnectionStatus,
|
|
6444
|
+
Ha as useConversationChannel,
|
|
6445
|
+
Va as useGlobalMessaging,
|
|
6446
|
+
Xa as useMessagingAccessState,
|
|
6447
|
+
$t as useMessagingStore,
|
|
6448
|
+
Wa as usePresence,
|
|
6449
|
+
Ga as useTypingChannel
|
|
6443
6450
|
};
|