@variamosple/variamos-components 0.2.0 → 0.2.1
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/Components/Header/index.js +33 -26
- package/dist/Components/Notifications/NotificationBell.js +5 -5
- package/dist/Components/Notifications/NotificationDrawer.js +104 -68
- package/dist/Context/NotificationContext.d.ts +1 -0
- package/dist/Context/NotificationContext.js +273 -260
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useSession as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
Object.keys(
|
|
14
|
-
|
|
1
|
+
import { jsx as Re } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as Oe, useState as O, useEffect as Se, useContext as Ce } from "react";
|
|
3
|
+
import { useSession as Be } from "./SessionContext.js";
|
|
4
|
+
const E = /* @__PURE__ */ Object.create(null);
|
|
5
|
+
E.open = "0";
|
|
6
|
+
E.close = "1";
|
|
7
|
+
E.ping = "2";
|
|
8
|
+
E.pong = "3";
|
|
9
|
+
E.message = "4";
|
|
10
|
+
E.upgrade = "5";
|
|
11
|
+
E.noop = "6";
|
|
12
|
+
const N = /* @__PURE__ */ Object.create(null);
|
|
13
|
+
Object.keys(E).forEach((n) => {
|
|
14
|
+
N[E[n]] = n;
|
|
15
15
|
});
|
|
16
|
-
const M = { type: "error", data: "parser error" }, re = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", oe = typeof ArrayBuffer == "function", ae = (n) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(n) : n && n.buffer instanceof ArrayBuffer,
|
|
16
|
+
const M = { type: "error", data: "parser error" }, re = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", oe = typeof ArrayBuffer == "function", ae = (n) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(n) : n && n.buffer instanceof ArrayBuffer, z = ({ type: n, data: e }, t, s) => re && e instanceof Blob ? t ? s(e) : ee(e, s) : oe && (e instanceof ArrayBuffer || ae(e)) ? t ? s(e) : ee(new Blob([e]), s) : s(E[n] + (e || "")), ee = (n, e) => {
|
|
17
17
|
const t = new FileReader();
|
|
18
18
|
return t.onload = function() {
|
|
19
19
|
const s = t.result.split(",")[1];
|
|
@@ -23,27 +23,27 @@ const M = { type: "error", data: "parser error" }, re = typeof Blob == "function
|
|
|
23
23
|
function te(n) {
|
|
24
24
|
return n instanceof Uint8Array ? n : n instanceof ArrayBuffer ? new Uint8Array(n) : new Uint8Array(n.buffer, n.byteOffset, n.byteLength);
|
|
25
25
|
}
|
|
26
|
-
let
|
|
27
|
-
function
|
|
26
|
+
let V;
|
|
27
|
+
function xe(n, e) {
|
|
28
28
|
if (re && n.data instanceof Blob)
|
|
29
29
|
return n.data.arrayBuffer().then(te).then(e);
|
|
30
30
|
if (oe && (n.data instanceof ArrayBuffer || ae(n.data)))
|
|
31
31
|
return e(te(n.data));
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
z(n, !1, (t) => {
|
|
33
|
+
V || (V = new TextEncoder()), e(V.encode(t));
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
const se = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
|
|
36
|
+
const se = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", C = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
|
|
37
37
|
for (let n = 0; n < se.length; n++)
|
|
38
|
-
|
|
39
|
-
const
|
|
38
|
+
C[se.charCodeAt(n)] = n;
|
|
39
|
+
const Ne = (n) => {
|
|
40
40
|
let e = n.length * 0.75, t = n.length, s, i = 0, r, o, a, h;
|
|
41
41
|
n[n.length - 1] === "=" && (e--, n[n.length - 2] === "=" && e--);
|
|
42
|
-
const m = new ArrayBuffer(e),
|
|
42
|
+
const m = new ArrayBuffer(e), d = new Uint8Array(m);
|
|
43
43
|
for (s = 0; s < t; s += 4)
|
|
44
|
-
r =
|
|
44
|
+
r = C[n.charCodeAt(s)], o = C[n.charCodeAt(s + 1)], a = C[n.charCodeAt(s + 2)], h = C[n.charCodeAt(s + 3)], d[i++] = r << 2 | o >> 4, d[i++] = (o & 15) << 4 | a >> 2, d[i++] = (a & 3) << 6 | h & 63;
|
|
45
45
|
return m;
|
|
46
|
-
},
|
|
46
|
+
}, Le = typeof ArrayBuffer == "function", J = (n, e) => {
|
|
47
47
|
if (typeof n != "string")
|
|
48
48
|
return {
|
|
49
49
|
type: "message",
|
|
@@ -52,16 +52,16 @@ const xe = (n) => {
|
|
|
52
52
|
const t = n.charAt(0);
|
|
53
53
|
return t === "b" ? {
|
|
54
54
|
type: "message",
|
|
55
|
-
data:
|
|
56
|
-
} :
|
|
57
|
-
type:
|
|
55
|
+
data: Pe(n.substring(1), e)
|
|
56
|
+
} : N[t] ? n.length > 1 ? {
|
|
57
|
+
type: N[t],
|
|
58
58
|
data: n.substring(1)
|
|
59
59
|
} : {
|
|
60
|
-
type:
|
|
60
|
+
type: N[t]
|
|
61
61
|
} : M;
|
|
62
|
-
},
|
|
63
|
-
if (
|
|
64
|
-
const t =
|
|
62
|
+
}, Pe = (n, e) => {
|
|
63
|
+
if (Le) {
|
|
64
|
+
const t = Ne(n);
|
|
65
65
|
return ce(t, e);
|
|
66
66
|
} else
|
|
67
67
|
return { base64: !0, data: n };
|
|
@@ -73,27 +73,27 @@ const xe = (n) => {
|
|
|
73
73
|
default:
|
|
74
74
|
return n instanceof ArrayBuffer ? n : n.buffer;
|
|
75
75
|
}
|
|
76
|
-
}, he = "",
|
|
76
|
+
}, he = "", qe = (n, e) => {
|
|
77
77
|
const t = n.length, s = new Array(t);
|
|
78
78
|
let i = 0;
|
|
79
79
|
n.forEach((r, o) => {
|
|
80
|
-
|
|
80
|
+
z(r, !1, (a) => {
|
|
81
81
|
s[o] = a, ++i === t && e(s.join(he));
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
|
-
},
|
|
84
|
+
}, Ie = (n, e) => {
|
|
85
85
|
const t = n.split(he), s = [];
|
|
86
86
|
for (let i = 0; i < t.length; i++) {
|
|
87
|
-
const r =
|
|
87
|
+
const r = J(t[i], e);
|
|
88
88
|
if (s.push(r), r.type === "error")
|
|
89
89
|
break;
|
|
90
90
|
}
|
|
91
91
|
return s;
|
|
92
92
|
};
|
|
93
|
-
function
|
|
93
|
+
function De() {
|
|
94
94
|
return new TransformStream({
|
|
95
95
|
transform(n, e) {
|
|
96
|
-
|
|
96
|
+
xe(n, (t) => {
|
|
97
97
|
const s = t.length;
|
|
98
98
|
let i;
|
|
99
99
|
if (s < 126)
|
|
@@ -112,11 +112,11 @@ function Ie() {
|
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
let
|
|
116
|
-
function
|
|
115
|
+
let U;
|
|
116
|
+
function B(n) {
|
|
117
117
|
return n.reduce((e, t) => e + t.length, 0);
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function x(n, e) {
|
|
120
120
|
if (n[0].length === e)
|
|
121
121
|
return n.shift();
|
|
122
122
|
const t = new Uint8Array(e);
|
|
@@ -125,37 +125,37 @@ function B(n, e) {
|
|
|
125
125
|
t[i] = n[0][s++], s === n[0].length && (n.shift(), s = 0);
|
|
126
126
|
return n.length && s < n[0].length && (n[0] = n[0].slice(s)), t;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
|
|
128
|
+
function Fe(n, e) {
|
|
129
|
+
U || (U = new TextDecoder());
|
|
130
130
|
const t = [];
|
|
131
131
|
let s = 0, i = -1, r = !1;
|
|
132
132
|
return new TransformStream({
|
|
133
133
|
transform(o, a) {
|
|
134
134
|
for (t.push(o); ; ) {
|
|
135
135
|
if (s === 0) {
|
|
136
|
-
if (
|
|
136
|
+
if (B(t) < 1)
|
|
137
137
|
break;
|
|
138
|
-
const h =
|
|
138
|
+
const h = x(t, 1);
|
|
139
139
|
r = (h[0] & 128) === 128, i = h[0] & 127, i < 126 ? s = 3 : i === 126 ? s = 1 : s = 2;
|
|
140
140
|
} else if (s === 1) {
|
|
141
|
-
if (
|
|
141
|
+
if (B(t) < 2)
|
|
142
142
|
break;
|
|
143
|
-
const h =
|
|
143
|
+
const h = x(t, 2);
|
|
144
144
|
i = new DataView(h.buffer, h.byteOffset, h.length).getUint16(0), s = 3;
|
|
145
145
|
} else if (s === 2) {
|
|
146
|
-
if (
|
|
146
|
+
if (B(t) < 8)
|
|
147
147
|
break;
|
|
148
|
-
const h =
|
|
149
|
-
if (
|
|
148
|
+
const h = x(t, 8), m = new DataView(h.buffer, h.byteOffset, h.length), d = m.getUint32(0);
|
|
149
|
+
if (d > Math.pow(2, 21) - 1) {
|
|
150
150
|
a.enqueue(M);
|
|
151
151
|
break;
|
|
152
152
|
}
|
|
153
|
-
i =
|
|
153
|
+
i = d * Math.pow(2, 32) + m.getUint32(4), s = 3;
|
|
154
154
|
} else {
|
|
155
|
-
if (
|
|
155
|
+
if (B(t) < i)
|
|
156
156
|
break;
|
|
157
|
-
const h =
|
|
158
|
-
a.enqueue(
|
|
157
|
+
const h = x(t, i);
|
|
158
|
+
a.enqueue(J(r ? h : U.decode(h), e)), s = 0;
|
|
159
159
|
}
|
|
160
160
|
if (i === 0 || i > n) {
|
|
161
161
|
a.enqueue(M);
|
|
@@ -167,9 +167,9 @@ function De(n, e) {
|
|
|
167
167
|
}
|
|
168
168
|
const fe = 4;
|
|
169
169
|
function u(n) {
|
|
170
|
-
if (n) return
|
|
170
|
+
if (n) return Ve(n);
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function Ve(n) {
|
|
173
173
|
for (var e in u.prototype)
|
|
174
174
|
n[e] = u.prototype[e];
|
|
175
175
|
return n;
|
|
@@ -215,19 +215,19 @@ u.prototype.listeners = function(n) {
|
|
|
215
215
|
u.prototype.hasListeners = function(n) {
|
|
216
216
|
return !!this.listeners(n).length;
|
|
217
217
|
};
|
|
218
|
-
const
|
|
218
|
+
const D = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, t) => t(e, 0), y = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), Ue = "arraybuffer";
|
|
219
219
|
function ue(n, ...e) {
|
|
220
220
|
return e.reduce((t, s) => (n.hasOwnProperty(s) && (t[s] = n[s]), t), {});
|
|
221
221
|
}
|
|
222
|
-
const
|
|
223
|
-
function
|
|
224
|
-
e.useNativeTimers ? (n.setTimeoutFn =
|
|
225
|
-
}
|
|
226
|
-
const $e = 1.33;
|
|
227
|
-
function He(n) {
|
|
228
|
-
return typeof n == "string" ? Ke(n) : Math.ceil((n.byteLength || n.size) * $e);
|
|
222
|
+
const $e = y.setTimeout, Me = y.clearTimeout;
|
|
223
|
+
function F(n, e) {
|
|
224
|
+
e.useNativeTimers ? (n.setTimeoutFn = $e.bind(y), n.clearTimeoutFn = Me.bind(y)) : (n.setTimeoutFn = y.setTimeout.bind(y), n.clearTimeoutFn = y.clearTimeout.bind(y));
|
|
229
225
|
}
|
|
226
|
+
const He = 1.33;
|
|
230
227
|
function Ke(n) {
|
|
228
|
+
return typeof n == "string" ? We(n) : Math.ceil((n.byteLength || n.size) * He);
|
|
229
|
+
}
|
|
230
|
+
function We(n) {
|
|
231
231
|
let e = 0, t = 0;
|
|
232
232
|
for (let s = 0, i = n.length; s < i; s++)
|
|
233
233
|
e = n.charCodeAt(s), e < 128 ? t += 1 : e < 2048 ? t += 2 : e < 55296 || e >= 57344 ? t += 3 : (s++, t += 4);
|
|
@@ -236,13 +236,13 @@ function Ke(n) {
|
|
|
236
236
|
function le() {
|
|
237
237
|
return Date.now().toString(36).substring(3) + Math.random().toString(36).substring(2, 5);
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function Ye(n) {
|
|
240
240
|
let e = "";
|
|
241
241
|
for (let t in n)
|
|
242
242
|
n.hasOwnProperty(t) && (e.length && (e += "&"), e += encodeURIComponent(t) + "=" + encodeURIComponent(n[t]));
|
|
243
243
|
return e;
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function ze(n) {
|
|
246
246
|
let e = {}, t = n.split("&");
|
|
247
247
|
for (let s = 0, i = t.length; s < i; s++) {
|
|
248
248
|
let r = t[s].split("=");
|
|
@@ -250,12 +250,12 @@ function Ye(n) {
|
|
|
250
250
|
}
|
|
251
251
|
return e;
|
|
252
252
|
}
|
|
253
|
-
class
|
|
253
|
+
class Je extends Error {
|
|
254
254
|
constructor(e, t, s) {
|
|
255
255
|
super(e), this.description = t, this.context = s, this.type = "TransportError";
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
-
class
|
|
258
|
+
class X extends u {
|
|
259
259
|
/**
|
|
260
260
|
* Transport abstract constructor.
|
|
261
261
|
*
|
|
@@ -263,7 +263,7 @@ class J extends u {
|
|
|
263
263
|
* @protected
|
|
264
264
|
*/
|
|
265
265
|
constructor(e) {
|
|
266
|
-
super(), this.writable = !1,
|
|
266
|
+
super(), this.writable = !1, F(this, e), this.opts = e, this.query = e.query, this.socket = e.socket, this.supportsBinary = !e.forceBase64;
|
|
267
267
|
}
|
|
268
268
|
/**
|
|
269
269
|
* Emits an error.
|
|
@@ -275,7 +275,7 @@ class J extends u {
|
|
|
275
275
|
* @protected
|
|
276
276
|
*/
|
|
277
277
|
onError(e, t, s) {
|
|
278
|
-
return super.emitReserved("error", new
|
|
278
|
+
return super.emitReserved("error", new Je(e, t, s)), this;
|
|
279
279
|
}
|
|
280
280
|
/**
|
|
281
281
|
* Opens the transport.
|
|
@@ -312,7 +312,7 @@ class J extends u {
|
|
|
312
312
|
* @protected
|
|
313
313
|
*/
|
|
314
314
|
onData(e) {
|
|
315
|
-
const t =
|
|
315
|
+
const t = J(e, this.socket.binaryType);
|
|
316
316
|
this.onPacket(t);
|
|
317
317
|
}
|
|
318
318
|
/**
|
|
@@ -349,11 +349,11 @@ class J extends u {
|
|
|
349
349
|
return this.opts.port && (this.opts.secure && Number(this.opts.port) !== 443 || !this.opts.secure && Number(this.opts.port) !== 80) ? ":" + this.opts.port : "";
|
|
350
350
|
}
|
|
351
351
|
_query(e) {
|
|
352
|
-
const t =
|
|
352
|
+
const t = Ye(e);
|
|
353
353
|
return t.length ? "?" + t : "";
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
|
-
class
|
|
356
|
+
class Xe extends X {
|
|
357
357
|
constructor() {
|
|
358
358
|
super(...arguments), this._polling = !1;
|
|
359
359
|
}
|
|
@@ -409,7 +409,7 @@ class Je extends J {
|
|
|
409
409
|
return this.onClose({ description: "transport closed by the server" }), !1;
|
|
410
410
|
this.onPacket(s);
|
|
411
411
|
};
|
|
412
|
-
|
|
412
|
+
Ie(e, this.socket.binaryType).forEach(t), this.readyState !== "closed" && (this._polling = !1, this.emitReserved("pollComplete"), this.readyState === "open" && this._poll());
|
|
413
413
|
}
|
|
414
414
|
/**
|
|
415
415
|
* For polling, send a close packet.
|
|
@@ -429,7 +429,7 @@ class Je extends J {
|
|
|
429
429
|
* @protected
|
|
430
430
|
*/
|
|
431
431
|
write(e) {
|
|
432
|
-
this.writable = !1,
|
|
432
|
+
this.writable = !1, qe(e, (t) => {
|
|
433
433
|
this.doWrite(t, () => {
|
|
434
434
|
this.writable = !0, this.emitReserved("drain");
|
|
435
435
|
});
|
|
@@ -450,10 +450,10 @@ try {
|
|
|
450
450
|
pe = typeof XMLHttpRequest < "u" && "withCredentials" in new XMLHttpRequest();
|
|
451
451
|
} catch {
|
|
452
452
|
}
|
|
453
|
-
const
|
|
454
|
-
function
|
|
453
|
+
const Qe = pe;
|
|
454
|
+
function je() {
|
|
455
455
|
}
|
|
456
|
-
class
|
|
456
|
+
class Ge extends Xe {
|
|
457
457
|
/**
|
|
458
458
|
* XHR Polling constructor.
|
|
459
459
|
*
|
|
@@ -495,7 +495,7 @@ class je extends Je {
|
|
|
495
495
|
}), this.pollXhr = e;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
class
|
|
498
|
+
class b extends u {
|
|
499
499
|
/**
|
|
500
500
|
* Request constructor
|
|
501
501
|
*
|
|
@@ -503,7 +503,7 @@ class w extends u {
|
|
|
503
503
|
* @package
|
|
504
504
|
*/
|
|
505
505
|
constructor(e, t, s) {
|
|
506
|
-
super(), this.createRequest = e,
|
|
506
|
+
super(), this.createRequest = e, F(this, s), this._opts = s, this._method = s.method || "GET", this._uri = t, this._data = s.data !== void 0 ? s.data : null, this._create();
|
|
507
507
|
}
|
|
508
508
|
/**
|
|
509
509
|
* Creates the XHR object and sends the request.
|
|
@@ -549,7 +549,7 @@ class w extends u {
|
|
|
549
549
|
}, 0);
|
|
550
550
|
return;
|
|
551
551
|
}
|
|
552
|
-
typeof document < "u" && (this._index =
|
|
552
|
+
typeof document < "u" && (this._index = b.requestsCount++, b.requests[this._index] = this);
|
|
553
553
|
}
|
|
554
554
|
/**
|
|
555
555
|
* Called upon error.
|
|
@@ -566,12 +566,12 @@ class w extends u {
|
|
|
566
566
|
*/
|
|
567
567
|
_cleanup(e) {
|
|
568
568
|
if (!(typeof this._xhr > "u" || this._xhr === null)) {
|
|
569
|
-
if (this._xhr.onreadystatechange =
|
|
569
|
+
if (this._xhr.onreadystatechange = je, e)
|
|
570
570
|
try {
|
|
571
571
|
this._xhr.abort();
|
|
572
572
|
} catch {
|
|
573
573
|
}
|
|
574
|
-
typeof document < "u" && delete
|
|
574
|
+
typeof document < "u" && delete b.requests[this._index], this._xhr = null;
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
577
|
/**
|
|
@@ -592,8 +592,8 @@ class w extends u {
|
|
|
592
592
|
this._cleanup();
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
-
|
|
596
|
-
|
|
595
|
+
b.requestsCount = 0;
|
|
596
|
+
b.requests = {};
|
|
597
597
|
if (typeof document < "u") {
|
|
598
598
|
if (typeof attachEvent == "function")
|
|
599
599
|
attachEvent("onunload", ne);
|
|
@@ -603,29 +603,29 @@ if (typeof document < "u") {
|
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
605
|
function ne() {
|
|
606
|
-
for (let n in
|
|
607
|
-
|
|
606
|
+
for (let n in b.requests)
|
|
607
|
+
b.requests.hasOwnProperty(n) && b.requests[n].abort();
|
|
608
608
|
}
|
|
609
|
-
const
|
|
609
|
+
const Ze = (function() {
|
|
610
610
|
const n = de({
|
|
611
611
|
xdomain: !1
|
|
612
612
|
});
|
|
613
613
|
return n && n.responseType !== null;
|
|
614
614
|
})();
|
|
615
|
-
class
|
|
615
|
+
class et extends Ge {
|
|
616
616
|
constructor(e) {
|
|
617
617
|
super(e);
|
|
618
618
|
const t = e && e.forceBase64;
|
|
619
|
-
this.supportsBinary =
|
|
619
|
+
this.supportsBinary = Ze && !t;
|
|
620
620
|
}
|
|
621
621
|
request(e = {}) {
|
|
622
|
-
return Object.assign(e, { xd: this.xd }, this.opts), new
|
|
622
|
+
return Object.assign(e, { xd: this.xd }, this.opts), new b(de, this.uri(), e);
|
|
623
623
|
}
|
|
624
624
|
}
|
|
625
625
|
function de(n) {
|
|
626
626
|
const e = n.xdomain;
|
|
627
627
|
try {
|
|
628
|
-
if (typeof XMLHttpRequest < "u" && (!e ||
|
|
628
|
+
if (typeof XMLHttpRequest < "u" && (!e || Qe))
|
|
629
629
|
return new XMLHttpRequest();
|
|
630
630
|
} catch {
|
|
631
631
|
}
|
|
@@ -636,7 +636,7 @@ function de(n) {
|
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
638
|
const ye = typeof navigator < "u" && typeof navigator.product == "string" && navigator.product.toLowerCase() === "reactnative";
|
|
639
|
-
class
|
|
639
|
+
class tt extends X {
|
|
640
640
|
get name() {
|
|
641
641
|
return "websocket";
|
|
642
642
|
}
|
|
@@ -667,12 +667,12 @@ class et extends J {
|
|
|
667
667
|
this.writable = !1;
|
|
668
668
|
for (let t = 0; t < e.length; t++) {
|
|
669
669
|
const s = e[t], i = t === e.length - 1;
|
|
670
|
-
|
|
670
|
+
z(s, this.supportsBinary, (r) => {
|
|
671
671
|
try {
|
|
672
672
|
this.doWrite(s, r);
|
|
673
673
|
} catch {
|
|
674
674
|
}
|
|
675
|
-
i &&
|
|
675
|
+
i && D(() => {
|
|
676
676
|
this.writable = !0, this.emitReserved("drain");
|
|
677
677
|
}, this.setTimeoutFn);
|
|
678
678
|
});
|
|
@@ -692,16 +692,16 @@ class et extends J {
|
|
|
692
692
|
return this.opts.timestampRequests && (t[this.opts.timestampParam] = le()), this.supportsBinary || (t.b64 = 1), this.createUri(e, t);
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
|
-
const
|
|
696
|
-
class
|
|
695
|
+
const $ = y.WebSocket || y.MozWebSocket;
|
|
696
|
+
class st extends tt {
|
|
697
697
|
createSocket(e, t, s) {
|
|
698
|
-
return ye ? new
|
|
698
|
+
return ye ? new $(e, t, s) : t ? new $(e, t) : new $(e);
|
|
699
699
|
}
|
|
700
700
|
doWrite(e, t) {
|
|
701
701
|
this.ws.send(t);
|
|
702
702
|
}
|
|
703
703
|
}
|
|
704
|
-
class
|
|
704
|
+
class nt extends X {
|
|
705
705
|
get name() {
|
|
706
706
|
return "webtransport";
|
|
707
707
|
}
|
|
@@ -717,7 +717,7 @@ class st extends J {
|
|
|
717
717
|
this.onError("webtransport error", e);
|
|
718
718
|
}), this._transport.ready.then(() => {
|
|
719
719
|
this._transport.createBidirectionalStream().then((e) => {
|
|
720
|
-
const t =
|
|
720
|
+
const t = Fe(Number.MAX_SAFE_INTEGER, this.socket.binaryType), s = e.readable.pipeThrough(t).getReader(), i = De();
|
|
721
721
|
i.readable.pipeTo(e.writable), this._writer = i.writable.getWriter();
|
|
722
722
|
const r = () => {
|
|
723
723
|
s.read().then(({ done: a, value: h }) => {
|
|
@@ -736,7 +736,7 @@ class st extends J {
|
|
|
736
736
|
for (let t = 0; t < e.length; t++) {
|
|
737
737
|
const s = e[t], i = t === e.length - 1;
|
|
738
738
|
this._writer.write(s).then(() => {
|
|
739
|
-
i &&
|
|
739
|
+
i && D(() => {
|
|
740
740
|
this.writable = !0, this.emitReserved("drain");
|
|
741
741
|
}, this.setTimeoutFn);
|
|
742
742
|
});
|
|
@@ -747,11 +747,11 @@ class st extends J {
|
|
|
747
747
|
(e = this._transport) === null || e === void 0 || e.close();
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
|
-
const
|
|
751
|
-
websocket:
|
|
752
|
-
webtransport:
|
|
753
|
-
polling:
|
|
754
|
-
},
|
|
750
|
+
const it = {
|
|
751
|
+
websocket: st,
|
|
752
|
+
webtransport: nt,
|
|
753
|
+
polling: et
|
|
754
|
+
}, rt = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, ot = [
|
|
755
755
|
"source",
|
|
756
756
|
"protocol",
|
|
757
757
|
"authority",
|
|
@@ -767,31 +767,31 @@ const nt = {
|
|
|
767
767
|
"query",
|
|
768
768
|
"anchor"
|
|
769
769
|
];
|
|
770
|
-
function
|
|
770
|
+
function H(n) {
|
|
771
771
|
if (n.length > 8e3)
|
|
772
772
|
throw "URI too long";
|
|
773
773
|
const e = n, t = n.indexOf("["), s = n.indexOf("]");
|
|
774
774
|
t != -1 && s != -1 && (n = n.substring(0, t) + n.substring(t, s).replace(/:/g, ";") + n.substring(s, n.length));
|
|
775
|
-
let i =
|
|
775
|
+
let i = rt.exec(n || ""), r = {}, o = 14;
|
|
776
776
|
for (; o--; )
|
|
777
|
-
r[
|
|
778
|
-
return t != -1 && s != -1 && (r.source = e, r.host = r.host.substring(1, r.host.length - 1).replace(/;/g, ":"), r.authority = r.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), r.ipv6uri = !0), r.pathNames =
|
|
777
|
+
r[ot[o]] = i[o] || "";
|
|
778
|
+
return t != -1 && s != -1 && (r.source = e, r.host = r.host.substring(1, r.host.length - 1).replace(/;/g, ":"), r.authority = r.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), r.ipv6uri = !0), r.pathNames = at(r, r.path), r.queryKey = ct(r, r.query), r;
|
|
779
779
|
}
|
|
780
|
-
function
|
|
780
|
+
function at(n, e) {
|
|
781
781
|
const t = /\/{2,9}/g, s = e.replace(t, "/").split("/");
|
|
782
782
|
return (e.slice(0, 1) == "/" || e.length === 0) && s.splice(0, 1), e.slice(-1) == "/" && s.splice(s.length - 1, 1), s;
|
|
783
783
|
}
|
|
784
|
-
function
|
|
784
|
+
function ct(n, e) {
|
|
785
785
|
const t = {};
|
|
786
786
|
return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function(s, i, r) {
|
|
787
787
|
i && (t[i] = r);
|
|
788
788
|
}), t;
|
|
789
789
|
}
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
|
|
790
|
+
const K = typeof addEventListener == "function" && typeof removeEventListener == "function", L = [];
|
|
791
|
+
K && addEventListener("offline", () => {
|
|
792
|
+
L.forEach((n) => n());
|
|
793
793
|
}, !1);
|
|
794
|
-
class
|
|
794
|
+
class A extends u {
|
|
795
795
|
/**
|
|
796
796
|
* Socket constructor.
|
|
797
797
|
*
|
|
@@ -799,11 +799,11 @@ class k extends u {
|
|
|
799
799
|
* @param {Object} opts - options
|
|
800
800
|
*/
|
|
801
801
|
constructor(e, t) {
|
|
802
|
-
if (super(), this.binaryType =
|
|
803
|
-
const s =
|
|
802
|
+
if (super(), this.binaryType = Ue, this.writeBuffer = [], this._prevBufferLen = 0, this._pingInterval = -1, this._pingTimeout = -1, this._maxPayload = -1, this._pingTimeoutTime = 1 / 0, e && typeof e == "object" && (t = e, e = null), e) {
|
|
803
|
+
const s = H(e);
|
|
804
804
|
t.hostname = s.host, t.secure = s.protocol === "https" || s.protocol === "wss", t.port = s.port, s.query && (t.query = s.query);
|
|
805
|
-
} else t.host && (t.hostname =
|
|
806
|
-
|
|
805
|
+
} else t.host && (t.hostname = H(t.host).host);
|
|
806
|
+
F(this, t), this.secure = t.secure != null ? t.secure : typeof location < "u" && location.protocol === "https:", t.hostname && !t.port && (t.port = this.secure ? "443" : "80"), this.hostname = t.hostname || (typeof location < "u" ? location.hostname : "localhost"), this.port = t.port || (typeof location < "u" && location.port ? location.port : this.secure ? "443" : "80"), this.transports = [], this._transportsByName = {}, t.transports.forEach((s) => {
|
|
807
807
|
const i = s.prototype.name;
|
|
808
808
|
this.transports.push(i), this._transportsByName[i] = s;
|
|
809
809
|
}), this.opts = Object.assign({
|
|
@@ -820,13 +820,13 @@ class k extends u {
|
|
|
820
820
|
},
|
|
821
821
|
transportOptions: {},
|
|
822
822
|
closeOnBeforeunload: !1
|
|
823
|
-
}, t), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query =
|
|
823
|
+
}, t), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query = ze(this.opts.query)), K && (this.opts.closeOnBeforeunload && (this._beforeunloadEventListener = () => {
|
|
824
824
|
this.transport && (this.transport.removeAllListeners(), this.transport.close());
|
|
825
825
|
}, addEventListener("beforeunload", this._beforeunloadEventListener, !1)), this.hostname !== "localhost" && (this._offlineEventListener = () => {
|
|
826
826
|
this._onClose("transport close", {
|
|
827
827
|
description: "network connection lost"
|
|
828
828
|
});
|
|
829
|
-
},
|
|
829
|
+
}, L.push(this._offlineEventListener))), this.opts.withCredentials && (this._cookieJar = void 0), this._open();
|
|
830
830
|
}
|
|
831
831
|
/**
|
|
832
832
|
* Creates transport of the given type.
|
|
@@ -859,7 +859,7 @@ class k extends u {
|
|
|
859
859
|
}, 0);
|
|
860
860
|
return;
|
|
861
861
|
}
|
|
862
|
-
const e = this.opts.rememberUpgrade &&
|
|
862
|
+
const e = this.opts.rememberUpgrade && A.priorWebsocketSuccess && this.transports.indexOf("websocket") !== -1 ? "websocket" : this.transports[0];
|
|
863
863
|
this.readyState = "opening";
|
|
864
864
|
const t = this.createTransport(e);
|
|
865
865
|
t.open(), this.setTransport(t);
|
|
@@ -878,7 +878,7 @@ class k extends u {
|
|
|
878
878
|
* @private
|
|
879
879
|
*/
|
|
880
880
|
onOpen() {
|
|
881
|
-
this.readyState = "open",
|
|
881
|
+
this.readyState = "open", A.priorWebsocketSuccess = this.transport.name === "websocket", this.emitReserved("open"), this.flush();
|
|
882
882
|
}
|
|
883
883
|
/**
|
|
884
884
|
* Handles a packet.
|
|
@@ -955,7 +955,7 @@ class k extends u {
|
|
|
955
955
|
let t = 1;
|
|
956
956
|
for (let s = 0; s < this.writeBuffer.length; s++) {
|
|
957
957
|
const i = this.writeBuffer[s].data;
|
|
958
|
-
if (i && (t +=
|
|
958
|
+
if (i && (t += Ke(i)), s > 0 && t > this._maxPayload)
|
|
959
959
|
return this.writeBuffer.slice(0, s);
|
|
960
960
|
t += 2;
|
|
961
961
|
}
|
|
@@ -975,7 +975,7 @@ class k extends u {
|
|
|
975
975
|
if (!this._pingTimeoutTime)
|
|
976
976
|
return !0;
|
|
977
977
|
const e = Date.now() > this._pingTimeoutTime;
|
|
978
|
-
return e && (this._pingTimeoutTime = 0,
|
|
978
|
+
return e && (this._pingTimeoutTime = 0, D(() => {
|
|
979
979
|
this._onClose("ping timeout");
|
|
980
980
|
}, this.setTimeoutFn)), e;
|
|
981
981
|
}
|
|
@@ -1042,7 +1042,7 @@ class k extends u {
|
|
|
1042
1042
|
* @private
|
|
1043
1043
|
*/
|
|
1044
1044
|
_onError(e) {
|
|
1045
|
-
if (
|
|
1045
|
+
if (A.priorWebsocketSuccess = !1, this.opts.tryAllTransports && this.transports.length > 1 && this.readyState === "opening")
|
|
1046
1046
|
return this.transports.shift(), this._open();
|
|
1047
1047
|
this.emitReserved("error", e), this._onClose("transport error", e);
|
|
1048
1048
|
}
|
|
@@ -1053,16 +1053,16 @@ class k extends u {
|
|
|
1053
1053
|
*/
|
|
1054
1054
|
_onClose(e, t) {
|
|
1055
1055
|
if (this.readyState === "opening" || this.readyState === "open" || this.readyState === "closing") {
|
|
1056
|
-
if (this.clearTimeoutFn(this._pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(),
|
|
1057
|
-
const s =
|
|
1058
|
-
s !== -1 &&
|
|
1056
|
+
if (this.clearTimeoutFn(this._pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), K && (this._beforeunloadEventListener && removeEventListener("beforeunload", this._beforeunloadEventListener, !1), this._offlineEventListener)) {
|
|
1057
|
+
const s = L.indexOf(this._offlineEventListener);
|
|
1058
|
+
s !== -1 && L.splice(s, 1);
|
|
1059
1059
|
}
|
|
1060
1060
|
this.readyState = "closed", this.id = null, this.emitReserved("close", e, t), this.writeBuffer = [], this._prevBufferLen = 0;
|
|
1061
1061
|
}
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
|
-
|
|
1065
|
-
class
|
|
1064
|
+
A.protocol = fe;
|
|
1065
|
+
class ht extends A {
|
|
1066
1066
|
constructor() {
|
|
1067
1067
|
super(...arguments), this._upgrades = [];
|
|
1068
1068
|
}
|
|
@@ -1079,15 +1079,15 @@ class ct extends k {
|
|
|
1079
1079
|
*/
|
|
1080
1080
|
_probe(e) {
|
|
1081
1081
|
let t = this.createTransport(e), s = !1;
|
|
1082
|
-
|
|
1082
|
+
A.priorWebsocketSuccess = !1;
|
|
1083
1083
|
const i = () => {
|
|
1084
1084
|
s || (t.send([{ type: "ping", data: "probe" }]), t.once("packet", (g) => {
|
|
1085
1085
|
if (!s)
|
|
1086
1086
|
if (g.type === "pong" && g.data === "probe") {
|
|
1087
1087
|
if (this.upgrading = !0, this.emitReserved("upgrading", t), !t)
|
|
1088
1088
|
return;
|
|
1089
|
-
|
|
1090
|
-
s || this.readyState !== "closed" && (
|
|
1089
|
+
A.priorWebsocketSuccess = t.name === "websocket", this.transport.pause(() => {
|
|
1090
|
+
s || this.readyState !== "closed" && (d(), this.setTransport(t), t.send([{ type: "upgrade" }]), this.emitReserved("upgrade", t), t = null, this.upgrading = !1, this.flush());
|
|
1091
1091
|
});
|
|
1092
1092
|
} else {
|
|
1093
1093
|
const v = new Error("probe error");
|
|
@@ -1096,7 +1096,7 @@ class ct extends k {
|
|
|
1096
1096
|
}));
|
|
1097
1097
|
};
|
|
1098
1098
|
function r() {
|
|
1099
|
-
s || (s = !0,
|
|
1099
|
+
s || (s = !0, d(), t.close(), t = null);
|
|
1100
1100
|
}
|
|
1101
1101
|
const o = (g) => {
|
|
1102
1102
|
const v = new Error("probe error: " + g);
|
|
@@ -1111,7 +1111,7 @@ class ct extends k {
|
|
|
1111
1111
|
function m(g) {
|
|
1112
1112
|
t && g.name !== t.name && r();
|
|
1113
1113
|
}
|
|
1114
|
-
const
|
|
1114
|
+
const d = () => {
|
|
1115
1115
|
t.removeListener("open", i), t.removeListener("error", o), t.removeListener("close", a), this.off("close", h), this.off("upgrading", m);
|
|
1116
1116
|
};
|
|
1117
1117
|
t.once("open", i), t.once("error", o), t.once("close", a), this.once("close", h), this.once("upgrading", m), this._upgrades.indexOf("webtransport") !== -1 && e !== "webtransport" ? this.setTimeoutFn(() => {
|
|
@@ -1134,69 +1134,69 @@ class ct extends k {
|
|
|
1134
1134
|
return t;
|
|
1135
1135
|
}
|
|
1136
1136
|
}
|
|
1137
|
-
let
|
|
1137
|
+
let ft = class extends ht {
|
|
1138
1138
|
constructor(e, t = {}) {
|
|
1139
1139
|
const s = typeof e == "object", i = s ? { ...e } : { ...t };
|
|
1140
|
-
(!i.transports || i.transports && typeof i.transports[0] == "string") && (i.transports = (i.transports || ["polling", "websocket", "webtransport"]).map((r) =>
|
|
1140
|
+
(!i.transports || i.transports && typeof i.transports[0] == "string") && (i.transports = (i.transports || ["polling", "websocket", "webtransport"]).map((r) => it[r]).filter((r) => !!r)), super(s ? i : e, i);
|
|
1141
1141
|
}
|
|
1142
1142
|
};
|
|
1143
|
-
function
|
|
1143
|
+
function ut(n, e = "", t) {
|
|
1144
1144
|
let s = n;
|
|
1145
|
-
t = t || typeof location < "u" && location, n == null && (n = t.protocol + "//" + t.host), typeof n == "string" && (n.charAt(0) === "/" && (n.charAt(1) === "/" ? n = t.protocol + n : n = t.host + n), /^(https?|wss?):\/\//.test(n) || (typeof t < "u" ? n = t.protocol + "//" + n : n = "https://" + n), s =
|
|
1145
|
+
t = t || typeof location < "u" && location, n == null && (n = t.protocol + "//" + t.host), typeof n == "string" && (n.charAt(0) === "/" && (n.charAt(1) === "/" ? n = t.protocol + n : n = t.host + n), /^(https?|wss?):\/\//.test(n) || (typeof t < "u" ? n = t.protocol + "//" + n : n = "https://" + n), s = H(n)), s.port || (/^(http|ws)$/.test(s.protocol) ? s.port = "80" : /^(http|ws)s$/.test(s.protocol) && (s.port = "443")), s.path = s.path || "/";
|
|
1146
1146
|
const r = s.host.indexOf(":") !== -1 ? "[" + s.host + "]" : s.host;
|
|
1147
1147
|
return s.id = s.protocol + "://" + r + ":" + s.port + e, s.href = s.protocol + "://" + r + (t && t.port === s.port ? "" : ":" + s.port), s;
|
|
1148
1148
|
}
|
|
1149
|
-
const
|
|
1150
|
-
function
|
|
1151
|
-
return
|
|
1149
|
+
const lt = typeof ArrayBuffer == "function", pt = (n) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(n) : n.buffer instanceof ArrayBuffer, me = Object.prototype.toString, dt = typeof Blob == "function" || typeof Blob < "u" && me.call(Blob) === "[object BlobConstructor]", yt = typeof File == "function" || typeof File < "u" && me.call(File) === "[object FileConstructor]";
|
|
1150
|
+
function Q(n) {
|
|
1151
|
+
return lt && (n instanceof ArrayBuffer || pt(n)) || dt && n instanceof Blob || yt && n instanceof File;
|
|
1152
1152
|
}
|
|
1153
|
-
function
|
|
1153
|
+
function P(n, e) {
|
|
1154
1154
|
if (!n || typeof n != "object")
|
|
1155
1155
|
return !1;
|
|
1156
1156
|
if (Array.isArray(n)) {
|
|
1157
1157
|
for (let t = 0, s = n.length; t < s; t++)
|
|
1158
|
-
if (
|
|
1158
|
+
if (P(n[t]))
|
|
1159
1159
|
return !0;
|
|
1160
1160
|
return !1;
|
|
1161
1161
|
}
|
|
1162
|
-
if (
|
|
1162
|
+
if (Q(n))
|
|
1163
1163
|
return !0;
|
|
1164
1164
|
if (n.toJSON && typeof n.toJSON == "function" && arguments.length === 1)
|
|
1165
|
-
return
|
|
1165
|
+
return P(n.toJSON(), !0);
|
|
1166
1166
|
for (const t in n)
|
|
1167
|
-
if (Object.prototype.hasOwnProperty.call(n, t) &&
|
|
1167
|
+
if (Object.prototype.hasOwnProperty.call(n, t) && P(n[t]))
|
|
1168
1168
|
return !0;
|
|
1169
1169
|
return !1;
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function mt(n) {
|
|
1172
1172
|
const e = [], t = n.data, s = n;
|
|
1173
|
-
return s.data =
|
|
1173
|
+
return s.data = q(t, e), s.attachments = e.length, { packet: s, buffers: e };
|
|
1174
1174
|
}
|
|
1175
|
-
function
|
|
1175
|
+
function q(n, e, t) {
|
|
1176
1176
|
if (!n)
|
|
1177
1177
|
return n;
|
|
1178
|
-
if (
|
|
1178
|
+
if (Q(n)) {
|
|
1179
1179
|
const s = { _placeholder: !0, num: e.length };
|
|
1180
1180
|
return e.push(n), s;
|
|
1181
1181
|
} else if (Array.isArray(n)) {
|
|
1182
1182
|
const s = new Array(n.length);
|
|
1183
1183
|
for (let i = 0; i < n.length; i++)
|
|
1184
|
-
s[i] =
|
|
1184
|
+
s[i] = q(n[i], e);
|
|
1185
1185
|
return s;
|
|
1186
1186
|
} else if (typeof n == "object" && !(n instanceof Date)) {
|
|
1187
1187
|
if (n.toJSON && typeof n.toJSON == "function" && !t)
|
|
1188
|
-
return
|
|
1188
|
+
return q(n.toJSON(), e, !0);
|
|
1189
1189
|
const s = {};
|
|
1190
1190
|
for (const i in n)
|
|
1191
|
-
Object.prototype.hasOwnProperty.call(n, i) && (s[i] =
|
|
1191
|
+
Object.prototype.hasOwnProperty.call(n, i) && (s[i] = q(n[i], e));
|
|
1192
1192
|
return s;
|
|
1193
1193
|
}
|
|
1194
1194
|
return n;
|
|
1195
1195
|
}
|
|
1196
|
-
function
|
|
1197
|
-
return n.data =
|
|
1196
|
+
function gt(n, e) {
|
|
1197
|
+
return n.data = W(n.data, e), delete n.attachments, n;
|
|
1198
1198
|
}
|
|
1199
|
-
function
|
|
1199
|
+
function W(n, e) {
|
|
1200
1200
|
if (!n)
|
|
1201
1201
|
return n;
|
|
1202
1202
|
if (n && n._placeholder === !0) {
|
|
@@ -1205,13 +1205,13 @@ function K(n, e) {
|
|
|
1205
1205
|
throw new Error("illegal attachments");
|
|
1206
1206
|
} else if (Array.isArray(n))
|
|
1207
1207
|
for (let t = 0; t < n.length; t++)
|
|
1208
|
-
n[t] =
|
|
1208
|
+
n[t] = W(n[t], e);
|
|
1209
1209
|
else if (typeof n == "object")
|
|
1210
1210
|
for (const t in n)
|
|
1211
|
-
Object.prototype.hasOwnProperty.call(n, t) && (n[t] =
|
|
1211
|
+
Object.prototype.hasOwnProperty.call(n, t) && (n[t] = W(n[t], e));
|
|
1212
1212
|
return n;
|
|
1213
1213
|
}
|
|
1214
|
-
const
|
|
1214
|
+
const _t = [
|
|
1215
1215
|
"connect",
|
|
1216
1216
|
// used on the client side
|
|
1217
1217
|
"connect_error",
|
|
@@ -1229,7 +1229,7 @@ var c;
|
|
|
1229
1229
|
(function(n) {
|
|
1230
1230
|
n[n.CONNECT = 0] = "CONNECT", n[n.DISCONNECT = 1] = "DISCONNECT", n[n.EVENT = 2] = "EVENT", n[n.ACK = 3] = "ACK", n[n.CONNECT_ERROR = 4] = "CONNECT_ERROR", n[n.BINARY_EVENT = 5] = "BINARY_EVENT", n[n.BINARY_ACK = 6] = "BINARY_ACK";
|
|
1231
1231
|
})(c || (c = {}));
|
|
1232
|
-
class
|
|
1232
|
+
class wt {
|
|
1233
1233
|
/**
|
|
1234
1234
|
* Encoder constructor
|
|
1235
1235
|
*
|
|
@@ -1245,7 +1245,7 @@ class _t {
|
|
|
1245
1245
|
* @param {Object} obj - packet object
|
|
1246
1246
|
*/
|
|
1247
1247
|
encode(e) {
|
|
1248
|
-
return (e.type === c.EVENT || e.type === c.ACK) &&
|
|
1248
|
+
return (e.type === c.EVENT || e.type === c.ACK) && P(e) ? this.encodeAsBinary({
|
|
1249
1249
|
type: e.type === c.EVENT ? c.BINARY_EVENT : c.BINARY_ACK,
|
|
1250
1250
|
nsp: e.nsp,
|
|
1251
1251
|
data: e.data,
|
|
@@ -1265,11 +1265,11 @@ class _t {
|
|
|
1265
1265
|
* a list of buffers.
|
|
1266
1266
|
*/
|
|
1267
1267
|
encodeAsBinary(e) {
|
|
1268
|
-
const t =
|
|
1268
|
+
const t = mt(e), s = this.encodeAsString(t.packet), i = t.buffers;
|
|
1269
1269
|
return i.unshift(s), i;
|
|
1270
1270
|
}
|
|
1271
1271
|
}
|
|
1272
|
-
class
|
|
1272
|
+
class j extends u {
|
|
1273
1273
|
/**
|
|
1274
1274
|
* Decoder constructor
|
|
1275
1275
|
*/
|
|
@@ -1291,8 +1291,8 @@ class Q extends u {
|
|
|
1291
1291
|
throw new Error("got plaintext data when reconstructing a packet");
|
|
1292
1292
|
t = this.decodeString(e);
|
|
1293
1293
|
const s = t.type === c.BINARY_EVENT;
|
|
1294
|
-
s || t.type === c.BINARY_ACK ? (t.type = s ? c.EVENT : c.ACK, this.reconstructor = new
|
|
1295
|
-
} else if (
|
|
1294
|
+
s || t.type === c.BINARY_ACK ? (t.type = s ? c.EVENT : c.ACK, this.reconstructor = new bt(t)) : super.emitReserved("decoded", t);
|
|
1295
|
+
} else if (Q(e) || e.base64)
|
|
1296
1296
|
if (this.reconstructor)
|
|
1297
1297
|
t = this.reconstructor.takeBinaryData(e), t && (this.reconstructor = null, super.emitReserved("decoded", t));
|
|
1298
1298
|
else
|
|
@@ -1321,7 +1321,7 @@ class Q extends u {
|
|
|
1321
1321
|
if (o != Number(o) || e.charAt(t) !== "-")
|
|
1322
1322
|
throw new Error("Illegal attachments");
|
|
1323
1323
|
const a = Number(o);
|
|
1324
|
-
if (!
|
|
1324
|
+
if (!Et(a) || a < 1)
|
|
1325
1325
|
throw new Error("Illegal attachments");
|
|
1326
1326
|
if (a > this.opts.maxAttachments)
|
|
1327
1327
|
throw new Error("too many attachments");
|
|
@@ -1350,7 +1350,7 @@ class Q extends u {
|
|
|
1350
1350
|
}
|
|
1351
1351
|
if (e.charAt(++t)) {
|
|
1352
1352
|
const r = this.tryParse(e.substr(t));
|
|
1353
|
-
if (
|
|
1353
|
+
if (j.isPayloadValid(s.type, r))
|
|
1354
1354
|
s.data = r;
|
|
1355
1355
|
else
|
|
1356
1356
|
throw new Error("invalid payload");
|
|
@@ -1374,7 +1374,7 @@ class Q extends u {
|
|
|
1374
1374
|
return typeof t == "string" || ie(t);
|
|
1375
1375
|
case c.EVENT:
|
|
1376
1376
|
case c.BINARY_EVENT:
|
|
1377
|
-
return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" &&
|
|
1377
|
+
return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" && _t.indexOf(t[0]) === -1);
|
|
1378
1378
|
case c.ACK:
|
|
1379
1379
|
case c.BINARY_ACK:
|
|
1380
1380
|
return Array.isArray(t);
|
|
@@ -1387,7 +1387,7 @@ class Q extends u {
|
|
|
1387
1387
|
this.reconstructor && (this.reconstructor.finishedReconstruction(), this.reconstructor = null);
|
|
1388
1388
|
}
|
|
1389
1389
|
}
|
|
1390
|
-
class
|
|
1390
|
+
class bt {
|
|
1391
1391
|
constructor(e) {
|
|
1392
1392
|
this.packet = e, this.buffers = [], this.reconPack = e;
|
|
1393
1393
|
}
|
|
@@ -1401,7 +1401,7 @@ class wt {
|
|
|
1401
1401
|
*/
|
|
1402
1402
|
takeBinaryData(e) {
|
|
1403
1403
|
if (this.buffers.push(e), this.buffers.length === this.reconPack.attachments) {
|
|
1404
|
-
const t =
|
|
1404
|
+
const t = gt(this.reconPack, this.buffers);
|
|
1405
1405
|
return this.finishedReconstruction(), t;
|
|
1406
1406
|
}
|
|
1407
1407
|
return null;
|
|
@@ -1413,7 +1413,7 @@ class wt {
|
|
|
1413
1413
|
this.reconPack = null, this.buffers = [];
|
|
1414
1414
|
}
|
|
1415
1415
|
}
|
|
1416
|
-
const
|
|
1416
|
+
const Et = Number.isInteger || function(n) {
|
|
1417
1417
|
return typeof n == "number" && isFinite(n) && Math.floor(n) === n;
|
|
1418
1418
|
};
|
|
1419
1419
|
function ie(n) {
|
|
@@ -1421,18 +1421,18 @@ function ie(n) {
|
|
|
1421
1421
|
}
|
|
1422
1422
|
const vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1423
1423
|
__proto__: null,
|
|
1424
|
-
Decoder:
|
|
1425
|
-
Encoder:
|
|
1424
|
+
Decoder: j,
|
|
1425
|
+
Encoder: wt,
|
|
1426
1426
|
get PacketType() {
|
|
1427
1427
|
return c;
|
|
1428
1428
|
}
|
|
1429
1429
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1430
|
-
function
|
|
1430
|
+
function w(n, e, t) {
|
|
1431
1431
|
return n.on(e, t), function() {
|
|
1432
1432
|
n.off(e, t);
|
|
1433
1433
|
};
|
|
1434
1434
|
}
|
|
1435
|
-
const
|
|
1435
|
+
const kt = Object.freeze({
|
|
1436
1436
|
connect: 1,
|
|
1437
1437
|
connect_error: 1,
|
|
1438
1438
|
disconnect: 1,
|
|
@@ -1475,10 +1475,10 @@ class ge extends u {
|
|
|
1475
1475
|
return;
|
|
1476
1476
|
const e = this.io;
|
|
1477
1477
|
this.subs = [
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1478
|
+
w(e, "open", this.onopen.bind(this)),
|
|
1479
|
+
w(e, "packet", this.onpacket.bind(this)),
|
|
1480
|
+
w(e, "error", this.onerror.bind(this)),
|
|
1481
|
+
w(e, "close", this.onclose.bind(this))
|
|
1482
1482
|
];
|
|
1483
1483
|
}
|
|
1484
1484
|
/**
|
|
@@ -1557,7 +1557,7 @@ class ge extends u {
|
|
|
1557
1557
|
*/
|
|
1558
1558
|
emit(e, ...t) {
|
|
1559
1559
|
var s, i, r;
|
|
1560
|
-
if (
|
|
1560
|
+
if (kt.hasOwnProperty(e))
|
|
1561
1561
|
throw new Error('"' + e.toString() + '" is a reserved event name');
|
|
1562
1562
|
if (t.unshift(e), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile)
|
|
1563
1563
|
return this._addToQueue(t), this;
|
|
@@ -1566,8 +1566,8 @@ class ge extends u {
|
|
|
1566
1566
|
data: t
|
|
1567
1567
|
};
|
|
1568
1568
|
if (o.options = {}, o.options.compress = this.flags.compress !== !1, typeof t[t.length - 1] == "function") {
|
|
1569
|
-
const
|
|
1570
|
-
this._registerAckCallback(
|
|
1569
|
+
const d = this.ids++, g = t.pop();
|
|
1570
|
+
this._registerAckCallback(d, g), o.id = d;
|
|
1571
1571
|
}
|
|
1572
1572
|
const a = (i = (s = this.io.engine) === null || s === void 0 ? void 0 : s.transport) === null || i === void 0 ? void 0 : i.writable, h = this.connected && !(!((r = this.io.engine) === null || r === void 0) && r._hasPingExpired());
|
|
1573
1573
|
return this.flags.volatile && !a || (h ? (this.notifyOutgoingListeners(o), this.packet(o)) : this.sendBuffer.push(o)), this.flags = {}, this;
|
|
@@ -2033,10 +2033,10 @@ class ge extends u {
|
|
|
2033
2033
|
}
|
|
2034
2034
|
}
|
|
2035
2035
|
}
|
|
2036
|
-
function
|
|
2036
|
+
function R(n) {
|
|
2037
2037
|
n = n || {}, this.ms = n.min || 100, this.max = n.max || 1e4, this.factor = n.factor || 2, this.jitter = n.jitter > 0 && n.jitter <= 1 ? n.jitter : 0, this.attempts = 0;
|
|
2038
2038
|
}
|
|
2039
|
-
|
|
2039
|
+
R.prototype.duration = function() {
|
|
2040
2040
|
var n = this.ms * Math.pow(this.factor, this.attempts++);
|
|
2041
2041
|
if (this.jitter) {
|
|
2042
2042
|
var e = Math.random(), t = Math.floor(e * this.jitter * n);
|
|
@@ -2044,22 +2044,22 @@ T.prototype.duration = function() {
|
|
|
2044
2044
|
}
|
|
2045
2045
|
return Math.min(n, this.max) | 0;
|
|
2046
2046
|
};
|
|
2047
|
-
|
|
2047
|
+
R.prototype.reset = function() {
|
|
2048
2048
|
this.attempts = 0;
|
|
2049
2049
|
};
|
|
2050
|
-
|
|
2050
|
+
R.prototype.setMin = function(n) {
|
|
2051
2051
|
this.ms = n;
|
|
2052
2052
|
};
|
|
2053
|
-
|
|
2053
|
+
R.prototype.setMax = function(n) {
|
|
2054
2054
|
this.max = n;
|
|
2055
2055
|
};
|
|
2056
|
-
|
|
2056
|
+
R.prototype.setJitter = function(n) {
|
|
2057
2057
|
this.jitter = n;
|
|
2058
2058
|
};
|
|
2059
|
-
class
|
|
2059
|
+
class Y extends u {
|
|
2060
2060
|
constructor(e, t) {
|
|
2061
2061
|
var s;
|
|
2062
|
-
super(), this.nsps = {}, this.subs = [], e && typeof e == "object" && (t = e, e = void 0), t = t || {}, t.path = t.path || "/socket.io", this.opts = t,
|
|
2062
|
+
super(), this.nsps = {}, this.subs = [], e && typeof e == "object" && (t = e, e = void 0), t = t || {}, t.path = t.path || "/socket.io", this.opts = t, F(this, t), this.reconnection(t.reconnection !== !1), this.reconnectionAttempts(t.reconnectionAttempts || 1 / 0), this.reconnectionDelay(t.reconnectionDelay || 1e3), this.reconnectionDelayMax(t.reconnectionDelayMax || 5e3), this.randomizationFactor((s = t.randomizationFactor) !== null && s !== void 0 ? s : 0.5), this.backoff = new R({
|
|
2063
2063
|
min: this.reconnectionDelay(),
|
|
2064
2064
|
max: this.reconnectionDelayMax(),
|
|
2065
2065
|
jitter: this.randomizationFactor()
|
|
@@ -2107,14 +2107,14 @@ class W extends u {
|
|
|
2107
2107
|
open(e) {
|
|
2108
2108
|
if (~this._readyState.indexOf("open"))
|
|
2109
2109
|
return this;
|
|
2110
|
-
this.engine = new
|
|
2110
|
+
this.engine = new ft(this.uri, this.opts);
|
|
2111
2111
|
const t = this.engine, s = this;
|
|
2112
2112
|
this._readyState = "opening", this.skipReconnect = !1;
|
|
2113
|
-
const i =
|
|
2113
|
+
const i = w(t, "open", function() {
|
|
2114
2114
|
s.onopen(), e && e();
|
|
2115
2115
|
}), r = (a) => {
|
|
2116
2116
|
this.cleanup(), this._readyState = "closed", this.emitReserved("error", a), e ? e(a) : this.maybeReconnectOnOpen();
|
|
2117
|
-
}, o =
|
|
2117
|
+
}, o = w(t, "error", r);
|
|
2118
2118
|
if (this._timeout !== !1) {
|
|
2119
2119
|
const a = this._timeout, h = this.setTimeoutFn(() => {
|
|
2120
2120
|
i(), r(new Error("timeout")), t.close();
|
|
@@ -2143,12 +2143,12 @@ class W extends u {
|
|
|
2143
2143
|
this.cleanup(), this._readyState = "open", this.emitReserved("open");
|
|
2144
2144
|
const e = this.engine;
|
|
2145
2145
|
this.subs.push(
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2146
|
+
w(e, "ping", this.onping.bind(this)),
|
|
2147
|
+
w(e, "data", this.ondata.bind(this)),
|
|
2148
|
+
w(e, "error", this.onerror.bind(this)),
|
|
2149
|
+
w(e, "close", this.onclose.bind(this)),
|
|
2150
2150
|
// @ts-ignore
|
|
2151
|
-
|
|
2151
|
+
w(this.decoder, "decoded", this.ondecoded.bind(this))
|
|
2152
2152
|
);
|
|
2153
2153
|
}
|
|
2154
2154
|
/**
|
|
@@ -2177,7 +2177,7 @@ class W extends u {
|
|
|
2177
2177
|
* @private
|
|
2178
2178
|
*/
|
|
2179
2179
|
ondecoded(e) {
|
|
2180
|
-
|
|
2180
|
+
D(() => {
|
|
2181
2181
|
this.emitReserved("packet", e);
|
|
2182
2182
|
}, this.setTimeoutFn);
|
|
2183
2183
|
}
|
|
@@ -2294,127 +2294,139 @@ class W extends u {
|
|
|
2294
2294
|
this._reconnecting = !1, this.backoff.reset(), this.emitReserved("reconnect", e);
|
|
2295
2295
|
}
|
|
2296
2296
|
}
|
|
2297
|
-
const
|
|
2298
|
-
function
|
|
2297
|
+
const S = {};
|
|
2298
|
+
function I(n, e) {
|
|
2299
2299
|
typeof n == "object" && (e = n, n = void 0), e = e || {};
|
|
2300
|
-
const t =
|
|
2300
|
+
const t = ut(n, e.path || "/socket.io"), s = t.source, i = t.id, r = t.path, o = S[i] && r in S[i].nsps, a = e.forceNew || e["force new connection"] || e.multiplex === !1 || o;
|
|
2301
2301
|
let h;
|
|
2302
|
-
return a ? h = new
|
|
2302
|
+
return a ? h = new Y(s, e) : (S[i] || (S[i] = new Y(s, e)), h = S[i]), t.query && !e.query && (e.query = t.queryKey), h.socket(t.path, e);
|
|
2303
2303
|
}
|
|
2304
|
-
Object.assign(
|
|
2305
|
-
Manager:
|
|
2304
|
+
Object.assign(I, {
|
|
2305
|
+
Manager: Y,
|
|
2306
2306
|
Socket: ge,
|
|
2307
|
-
io:
|
|
2308
|
-
connect:
|
|
2307
|
+
io: I,
|
|
2308
|
+
connect: I
|
|
2309
2309
|
});
|
|
2310
|
-
const _e =
|
|
2310
|
+
const _e = Oe(void 0), St = ({
|
|
2311
2311
|
apiUrl: n,
|
|
2312
2312
|
children: e
|
|
2313
2313
|
}) => {
|
|
2314
|
-
const { user: t } =
|
|
2314
|
+
const { user: t } = Be(), [s, i] = O([]), [r, o] = O(0), [a, h] = O(null), [m, d] = O(!1), [g, v] = O(null), T = () => {
|
|
2315
2315
|
const f = localStorage.getItem("authToken");
|
|
2316
2316
|
return {
|
|
2317
2317
|
"Content-Type": "application/json",
|
|
2318
2318
|
...f ? { Authorization: `Bearer ${f}` } : {}
|
|
2319
2319
|
};
|
|
2320
|
-
},
|
|
2320
|
+
}, G = async (f = "inbox", l = 1, p = 10) => {
|
|
2321
2321
|
if (t) {
|
|
2322
|
-
|
|
2322
|
+
d(!0);
|
|
2323
2323
|
try {
|
|
2324
|
-
const
|
|
2325
|
-
`${n}/notifications?recipientId=${t.id}&page=${
|
|
2326
|
-
{ headers:
|
|
2324
|
+
const _ = await fetch(
|
|
2325
|
+
`${n}/notifications?recipientId=${t.id}&page=${l}&limit=${p}&folder=${f}`,
|
|
2326
|
+
{ headers: T() }
|
|
2327
2327
|
);
|
|
2328
|
-
if (
|
|
2329
|
-
const
|
|
2330
|
-
if (i(
|
|
2331
|
-
const
|
|
2332
|
-
o(
|
|
2328
|
+
if (_.ok) {
|
|
2329
|
+
const k = await _.json();
|
|
2330
|
+
if (i(k), f === "inbox") {
|
|
2331
|
+
const Ae = k.filter((Te) => !Te.isRead).length;
|
|
2332
|
+
o(Ae);
|
|
2333
2333
|
}
|
|
2334
2334
|
}
|
|
2335
|
-
} catch (
|
|
2336
|
-
console.error("Failed to fetch notifications:",
|
|
2335
|
+
} catch (_) {
|
|
2336
|
+
console.error("Failed to fetch notifications:", _);
|
|
2337
2337
|
} finally {
|
|
2338
|
-
|
|
2338
|
+
d(!1);
|
|
2339
2339
|
}
|
|
2340
2340
|
}
|
|
2341
2341
|
}, we = async (f) => {
|
|
2342
2342
|
try {
|
|
2343
2343
|
(await fetch(`${n}/notifications/${f}/read`, {
|
|
2344
2344
|
method: "PATCH",
|
|
2345
|
-
headers:
|
|
2345
|
+
headers: T()
|
|
2346
2346
|
})).ok && (i(
|
|
2347
|
-
(
|
|
2348
|
-
), o((
|
|
2349
|
-
} catch (
|
|
2350
|
-
console.error("Failed to mark notification as read:",
|
|
2347
|
+
(p) => p.map((_) => _.id === f ? { ..._, isRead: !0 } : _)
|
|
2348
|
+
), o((p) => Math.max(0, p - 1)));
|
|
2349
|
+
} catch (l) {
|
|
2350
|
+
console.error("Failed to mark notification as read:", l);
|
|
2351
2351
|
}
|
|
2352
2352
|
}, be = async () => {
|
|
2353
2353
|
if (t)
|
|
2354
2354
|
try {
|
|
2355
2355
|
(await fetch(`${n}/notifications/read-all?recipientId=${t.id}`, {
|
|
2356
2356
|
method: "PATCH",
|
|
2357
|
-
headers:
|
|
2358
|
-
})).ok && (i((
|
|
2357
|
+
headers: T()
|
|
2358
|
+
})).ok && (i((l) => l.map((p) => ({ ...p, isRead: !0 }))), o(0));
|
|
2359
2359
|
} catch (f) {
|
|
2360
2360
|
console.error("Failed to mark all notifications as read:", f);
|
|
2361
2361
|
}
|
|
2362
|
-
},
|
|
2362
|
+
}, Ee = async () => {
|
|
2363
2363
|
if (t)
|
|
2364
2364
|
try {
|
|
2365
2365
|
(await fetch(`${n}/notifications/trash?recipientId=${t.id}`, {
|
|
2366
2366
|
method: "DELETE",
|
|
2367
|
-
headers:
|
|
2367
|
+
headers: T()
|
|
2368
2368
|
})).ok && i([]);
|
|
2369
2369
|
} catch (f) {
|
|
2370
2370
|
console.error("Failed to empty trash:", f);
|
|
2371
2371
|
}
|
|
2372
|
-
},
|
|
2372
|
+
}, ve = async (f) => {
|
|
2373
|
+
try {
|
|
2374
|
+
(await fetch(`${n}/notifications/${f}`, {
|
|
2375
|
+
method: "DELETE",
|
|
2376
|
+
headers: T()
|
|
2377
|
+
})).ok && i((p) => {
|
|
2378
|
+
const _ = p.find((k) => k.id === f);
|
|
2379
|
+
return _ && !_.isRead && o((k) => Math.max(0, k - 1)), p.filter((k) => k.id !== f);
|
|
2380
|
+
});
|
|
2381
|
+
} catch (l) {
|
|
2382
|
+
console.error("Failed to delete notification:", l);
|
|
2383
|
+
}
|
|
2384
|
+
}, Z = async () => {
|
|
2373
2385
|
if (t)
|
|
2374
2386
|
try {
|
|
2375
2387
|
const f = await fetch(`${n}/notifications/preferences?recipientId=${t.id}`, {
|
|
2376
|
-
headers:
|
|
2388
|
+
headers: T()
|
|
2377
2389
|
});
|
|
2378
2390
|
if (f.ok) {
|
|
2379
|
-
const
|
|
2380
|
-
h(
|
|
2391
|
+
const l = await f.json();
|
|
2392
|
+
h(l);
|
|
2381
2393
|
}
|
|
2382
2394
|
} catch (f) {
|
|
2383
2395
|
console.error("Failed to fetch preferences:", f);
|
|
2384
2396
|
}
|
|
2385
|
-
},
|
|
2397
|
+
}, ke = async (f) => {
|
|
2386
2398
|
if (t)
|
|
2387
2399
|
try {
|
|
2388
|
-
const
|
|
2400
|
+
const l = await fetch(`${n}/notifications/preferences?recipientId=${t.id}`, {
|
|
2389
2401
|
method: "PATCH",
|
|
2390
|
-
headers:
|
|
2402
|
+
headers: T(),
|
|
2391
2403
|
body: JSON.stringify(f)
|
|
2392
2404
|
});
|
|
2393
|
-
if (
|
|
2394
|
-
const
|
|
2395
|
-
h(
|
|
2405
|
+
if (l.ok) {
|
|
2406
|
+
const p = await l.json();
|
|
2407
|
+
h(p);
|
|
2396
2408
|
}
|
|
2397
|
-
} catch (
|
|
2398
|
-
console.error("Failed to update preferences:",
|
|
2409
|
+
} catch (l) {
|
|
2410
|
+
console.error("Failed to update preferences:", l);
|
|
2399
2411
|
}
|
|
2400
2412
|
};
|
|
2401
|
-
return
|
|
2413
|
+
return Se(() => {
|
|
2402
2414
|
if (!t) {
|
|
2403
2415
|
g && (g.disconnect(), v(null)), i([]), o(0), h(null);
|
|
2404
2416
|
return;
|
|
2405
2417
|
}
|
|
2406
|
-
const f =
|
|
2418
|
+
const f = I(n, {
|
|
2407
2419
|
query: { userId: t.id },
|
|
2408
2420
|
transports: ["websocket"]
|
|
2409
2421
|
});
|
|
2410
2422
|
return f.on("connect", () => {
|
|
2411
2423
|
console.log("WebSocket connected to notifications microservice");
|
|
2412
|
-
}), f.on("notification", (
|
|
2413
|
-
i((
|
|
2414
|
-
}), v(f),
|
|
2424
|
+
}), f.on("notification", (l) => {
|
|
2425
|
+
i((p) => [l, ...p]), o((p) => p + 1);
|
|
2426
|
+
}), v(f), G("inbox"), Z(), () => {
|
|
2415
2427
|
f.disconnect();
|
|
2416
2428
|
};
|
|
2417
|
-
}, [t, n]), /* @__PURE__ */
|
|
2429
|
+
}, [t, n]), /* @__PURE__ */ Re(
|
|
2418
2430
|
_e.Provider,
|
|
2419
2431
|
{
|
|
2420
2432
|
value: {
|
|
@@ -2422,23 +2434,24 @@ const _e = Re(void 0), Ot = ({
|
|
|
2422
2434
|
unreadCount: r,
|
|
2423
2435
|
preferences: a,
|
|
2424
2436
|
isLoading: m,
|
|
2425
|
-
fetchNotifications:
|
|
2437
|
+
fetchNotifications: G,
|
|
2426
2438
|
markAsRead: we,
|
|
2427
2439
|
markAllAsRead: be,
|
|
2428
|
-
emptyTrash:
|
|
2429
|
-
|
|
2430
|
-
|
|
2440
|
+
emptyTrash: Ee,
|
|
2441
|
+
deleteNotification: ve,
|
|
2442
|
+
fetchPreferences: Z,
|
|
2443
|
+
updatePreferences: ke
|
|
2431
2444
|
},
|
|
2432
2445
|
children: e
|
|
2433
2446
|
}
|
|
2434
2447
|
);
|
|
2435
|
-
},
|
|
2436
|
-
const n =
|
|
2448
|
+
}, Ct = () => {
|
|
2449
|
+
const n = Ce(_e);
|
|
2437
2450
|
if (n === void 0)
|
|
2438
2451
|
throw new Error("useNotifications must be used within a NotificationProvider");
|
|
2439
2452
|
return n;
|
|
2440
2453
|
};
|
|
2441
2454
|
export {
|
|
2442
|
-
|
|
2443
|
-
|
|
2455
|
+
St as NotificationProvider,
|
|
2456
|
+
Ct as useNotifications
|
|
2444
2457
|
};
|