@paramms/chat-widget 1.0.42 → 1.0.44
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/README.md +1 -0
- package/dist/chatlist.d.ts +4 -0
- package/dist/chatlist.js +48 -44
- package/dist/chatlist.js.map +1 -1
- package/dist/codec.js +130 -125
- package/dist/codec.js.map +1 -1
- package/dist/embed.js +7 -3
- package/dist/embed.js.map +1 -1
- package/dist/index.js +108 -108
- package/dist/index.js.map +1 -1
- package/dist/react.js +94 -91
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/dist/codec.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var F = Object.defineProperty;
|
|
2
2
|
var P = (n, e, t) => e in n ? F(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
-
var
|
|
3
|
+
var o = (n, e, t) => P(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
function R(n, e) {
|
|
5
5
|
var c;
|
|
6
|
-
const t = n.trim().replace(/\/+$/, ""), s = (c = t.match(/^(https|http|wss|ws):\/\//)) == null ? void 0 : c[1], i = s ? s === "https" || s === "wss" : !0, r = (s ? t.slice(s.length + 3) : t).replace(/\/ws$/, ""),
|
|
7
|
-
return { wsUrl: `${i ? "wss" : "ws"}://${r}/ws`, httpBase:
|
|
6
|
+
const t = n.trim().replace(/\/+$/, ""), s = (c = t.match(/^(https|http|wss|ws):\/\//)) == null ? void 0 : c[1], i = s ? s === "https" || s === "wss" : !0, r = (s ? t.slice(s.length + 3) : t).replace(/\/ws$/, ""), h = e ? e.trim().replace(/\/+$/, "") : `${i ? "https" : "http"}://${r}`;
|
|
7
|
+
return { wsUrl: `${i ? "wss" : "ws"}://${r}/ws`, httpBase: h };
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function b(n) {
|
|
10
10
|
return R(n).httpBase;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function H(n, e, t, s) {
|
|
13
13
|
const i = `beforeSeq=${t}&limit=${s}`;
|
|
14
14
|
return [
|
|
15
15
|
`${n}/conversations/${e}/messages?${i}`,
|
|
@@ -17,40 +17,45 @@ function b(n, e, t, s) {
|
|
|
17
17
|
];
|
|
18
18
|
}
|
|
19
19
|
async function z(n, e, t, s, i = 20) {
|
|
20
|
-
|
|
20
|
+
let r, h = !1;
|
|
21
|
+
for (const a of H(n, e, s, i))
|
|
21
22
|
try {
|
|
22
|
-
const
|
|
23
|
-
if (!
|
|
24
|
-
const
|
|
25
|
-
return { messages:
|
|
26
|
-
} catch {
|
|
23
|
+
const c = await fetch(a, { headers: { authorization: `Bearer ${t}` } });
|
|
24
|
+
if (h = !0, !c.ok) continue;
|
|
25
|
+
const d = await c.json();
|
|
26
|
+
return { messages: d.messages ?? [], hasMore: d.hasMore ?? !1 };
|
|
27
|
+
} catch (c) {
|
|
28
|
+
r = c;
|
|
27
29
|
}
|
|
28
|
-
return
|
|
30
|
+
return h ? console.error(`[chat-widget] history request to ${n} was rejected for conversation ${e}.`) : console.error(
|
|
31
|
+
`[chat-widget] could not load history from ${n} — the request never reached the server. This is almost always CORS: add this site's origin to the chatroom's allowed origins (dashboard → chatroom → allowed origins) or to the server's CORS_ORIGINS.`,
|
|
32
|
+
r
|
|
33
|
+
), null;
|
|
29
34
|
}
|
|
30
35
|
async function Te(n, e, t, s, i, r) {
|
|
31
|
-
const
|
|
36
|
+
const h = r ? r.replace(/\/+$/, "") : b(n), a = await z(h, t, e, Number.MAX_SAFE_INTEGER);
|
|
32
37
|
if (!a || (a.messages.length ? (s.apply({ type: "sync", conversationId: t, messages: a.messages }), s.apply({ type: "history", conversationId: t, messages: [], hasMore: a.hasMore }), i.render(s)) : s.apply({ type: "history", conversationId: t, messages: [], hasMore: !1 }), !a.hasMore)) return;
|
|
33
38
|
let c = !1;
|
|
34
|
-
const
|
|
39
|
+
const d = async () => {
|
|
35
40
|
if (c || !s.hasMoreHistory) return;
|
|
36
41
|
c = !0;
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
42
|
+
const M = s.messages()[0];
|
|
43
|
+
if (!M) {
|
|
39
44
|
c = !1;
|
|
40
45
|
return;
|
|
41
46
|
}
|
|
42
|
-
const S = await z(
|
|
47
|
+
const S = await z(h, t, e, M.seq);
|
|
43
48
|
S && (s.apply({ type: "history", conversationId: t, messages: S.messages, hasMore: S.hasMore }), i.render(s)), c = !1;
|
|
44
|
-
},
|
|
45
|
-
if (!
|
|
46
|
-
let
|
|
49
|
+
}, u = i.getScrollEl();
|
|
50
|
+
if (!u) return;
|
|
51
|
+
let l = !1;
|
|
47
52
|
setTimeout(() => {
|
|
48
|
-
|
|
53
|
+
l = !0;
|
|
49
54
|
}, 300);
|
|
50
|
-
const
|
|
51
|
-
|
|
55
|
+
const k = () => {
|
|
56
|
+
l && u.scrollTop < 80 && s.hasMoreHistory && !c && d();
|
|
52
57
|
};
|
|
53
|
-
|
|
58
|
+
u.addEventListener("scroll", k, { passive: !0 }), i.setScrollCleanup(() => u.removeEventListener("scroll", k));
|
|
54
59
|
}
|
|
55
60
|
const y = "oc_uid";
|
|
56
61
|
function K(n) {
|
|
@@ -71,7 +76,7 @@ function N(n, e) {
|
|
|
71
76
|
function W() {
|
|
72
77
|
return `g_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;
|
|
73
78
|
}
|
|
74
|
-
function
|
|
79
|
+
function ve() {
|
|
75
80
|
let n = null;
|
|
76
81
|
try {
|
|
77
82
|
n = localStorage.getItem(y);
|
|
@@ -111,36 +116,36 @@ function X(n, e, t) {
|
|
|
111
116
|
const s = n.length;
|
|
112
117
|
let i = t, r = 0;
|
|
113
118
|
for (; r < s; ) {
|
|
114
|
-
let
|
|
115
|
-
if (
|
|
116
|
-
if (!(
|
|
117
|
-
e[i++] =
|
|
119
|
+
let h = n.charCodeAt(r++);
|
|
120
|
+
if (h & 4294967168)
|
|
121
|
+
if (!(h & 4294965248))
|
|
122
|
+
e[i++] = h >> 6 & 31 | 192;
|
|
118
123
|
else {
|
|
119
|
-
if (
|
|
124
|
+
if (h >= 55296 && h <= 56319 && r < s) {
|
|
120
125
|
const a = n.charCodeAt(r);
|
|
121
|
-
(a & 64512) === 56320 && (++r,
|
|
126
|
+
(a & 64512) === 56320 && (++r, h = ((h & 1023) << 10) + (a & 1023) + 65536);
|
|
122
127
|
}
|
|
123
|
-
|
|
128
|
+
h & 4294901760 ? (e[i++] = h >> 18 & 7 | 240, e[i++] = h >> 12 & 63 | 128, e[i++] = h >> 6 & 63 | 128) : (e[i++] = h >> 12 & 15 | 224, e[i++] = h >> 6 & 63 | 128);
|
|
124
129
|
}
|
|
125
130
|
else {
|
|
126
|
-
e[i++] =
|
|
131
|
+
e[i++] = h;
|
|
127
132
|
continue;
|
|
128
133
|
}
|
|
129
|
-
e[i++] =
|
|
134
|
+
e[i++] = h & 63 | 128;
|
|
130
135
|
}
|
|
131
136
|
}
|
|
132
|
-
const Y = new TextEncoder(),
|
|
133
|
-
function
|
|
137
|
+
const Y = new TextEncoder(), O = 50;
|
|
138
|
+
function q(n, e, t) {
|
|
134
139
|
Y.encodeInto(n, e.subarray(t));
|
|
135
140
|
}
|
|
136
|
-
function
|
|
137
|
-
n.length >
|
|
141
|
+
function G(n, e, t) {
|
|
142
|
+
n.length > O ? q(n, e, t) : X(n, e, t);
|
|
138
143
|
}
|
|
139
144
|
const J = 4096;
|
|
140
145
|
function D(n, e, t) {
|
|
141
146
|
let s = e;
|
|
142
147
|
const i = s + t, r = [];
|
|
143
|
-
let
|
|
148
|
+
let h = "";
|
|
144
149
|
for (; s < i; ) {
|
|
145
150
|
const a = n[s++];
|
|
146
151
|
if (!(a & 128))
|
|
@@ -149,17 +154,17 @@ function D(n, e, t) {
|
|
|
149
154
|
const c = n[s++] & 63;
|
|
150
155
|
r.push((a & 31) << 6 | c);
|
|
151
156
|
} else if ((a & 240) === 224) {
|
|
152
|
-
const c = n[s++] & 63,
|
|
153
|
-
r.push((a & 31) << 12 | c << 6 |
|
|
157
|
+
const c = n[s++] & 63, d = n[s++] & 63;
|
|
158
|
+
r.push((a & 31) << 12 | c << 6 | d);
|
|
154
159
|
} else if ((a & 248) === 240) {
|
|
155
|
-
const c = n[s++] & 63,
|
|
156
|
-
let
|
|
157
|
-
|
|
160
|
+
const c = n[s++] & 63, d = n[s++] & 63, u = n[s++] & 63;
|
|
161
|
+
let l = (a & 7) << 18 | c << 12 | d << 6 | u;
|
|
162
|
+
l > 65535 && (l -= 65536, r.push(l >>> 10 & 1023 | 55296), l = 56320 | l & 1023), r.push(l);
|
|
158
163
|
} else
|
|
159
164
|
r.push(a);
|
|
160
|
-
r.length >= J && (
|
|
165
|
+
r.length >= J && (h += String.fromCharCode(...r), r.length = 0);
|
|
161
166
|
}
|
|
162
|
-
return r.length > 0 && (
|
|
167
|
+
return r.length > 0 && (h += String.fromCharCode(...r)), h;
|
|
163
168
|
}
|
|
164
169
|
const Z = new TextDecoder(), Q = 200;
|
|
165
170
|
function j(n, e, t) {
|
|
@@ -171,8 +176,8 @@ function ee(n, e, t) {
|
|
|
171
176
|
}
|
|
172
177
|
class U {
|
|
173
178
|
constructor(e, t) {
|
|
174
|
-
|
|
175
|
-
|
|
179
|
+
o(this, "type");
|
|
180
|
+
o(this, "data");
|
|
176
181
|
this.type = e, this.data = t;
|
|
177
182
|
}
|
|
178
183
|
}
|
|
@@ -205,7 +210,7 @@ function se(n, e) {
|
|
|
205
210
|
return t * 4294967296 + s;
|
|
206
211
|
}
|
|
207
212
|
const ie = -1, ne = 4294967296 - 1, re = 17179869184 - 1;
|
|
208
|
-
function
|
|
213
|
+
function oe({ sec: n, nsec: e }) {
|
|
209
214
|
if (n >= 0 && e >= 0 && n <= re)
|
|
210
215
|
if (e === 0 && n <= ne) {
|
|
211
216
|
const t = new Uint8Array(4);
|
|
@@ -219,7 +224,7 @@ function he({ sec: n, nsec: e }) {
|
|
|
219
224
|
return s.setUint32(0, e), $(s, 4, n), t;
|
|
220
225
|
}
|
|
221
226
|
}
|
|
222
|
-
function
|
|
227
|
+
function he(n) {
|
|
223
228
|
const e = n.getTime(), t = Math.floor(e / 1e3), s = (e - t * 1e3) * 1e6, i = Math.floor(s / 1e9);
|
|
224
229
|
return {
|
|
225
230
|
sec: t + i,
|
|
@@ -228,8 +233,8 @@ function oe(n) {
|
|
|
228
233
|
}
|
|
229
234
|
function ae(n) {
|
|
230
235
|
if (n instanceof Date) {
|
|
231
|
-
const e =
|
|
232
|
-
return
|
|
236
|
+
const e = he(n);
|
|
237
|
+
return oe(e);
|
|
233
238
|
} else
|
|
234
239
|
return null;
|
|
235
240
|
}
|
|
@@ -254,7 +259,7 @@ function fe(n) {
|
|
|
254
259
|
const e = ce(n);
|
|
255
260
|
return new Date(e.sec * 1e3 + e.nsec / 1e6);
|
|
256
261
|
}
|
|
257
|
-
const
|
|
262
|
+
const le = {
|
|
258
263
|
type: ie,
|
|
259
264
|
encode: ae,
|
|
260
265
|
decode: fe
|
|
@@ -263,14 +268,14 @@ const de = {
|
|
|
263
268
|
// ensures ExtensionCodecType<X> matches ExtensionCodec<X>
|
|
264
269
|
// this will make type errors a lot more clear
|
|
265
270
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
266
|
-
|
|
271
|
+
o(this, "__brand");
|
|
267
272
|
// built-in extensions
|
|
268
|
-
|
|
269
|
-
|
|
273
|
+
o(this, "builtInEncoders", []);
|
|
274
|
+
o(this, "builtInDecoders", []);
|
|
270
275
|
// custom extensions
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
this.register(
|
|
276
|
+
o(this, "encoders", []);
|
|
277
|
+
o(this, "decoders", []);
|
|
278
|
+
this.register(le);
|
|
274
279
|
}
|
|
275
280
|
register({ type: e, encode: t, decode: s }) {
|
|
276
281
|
if (e >= 0)
|
|
@@ -286,8 +291,8 @@ const de = {
|
|
|
286
291
|
if (i != null) {
|
|
287
292
|
const r = i(e, t);
|
|
288
293
|
if (r != null) {
|
|
289
|
-
const
|
|
290
|
-
return new U(
|
|
294
|
+
const h = -1 - s;
|
|
295
|
+
return new U(h, r);
|
|
291
296
|
}
|
|
292
297
|
}
|
|
293
298
|
}
|
|
@@ -296,8 +301,8 @@ const de = {
|
|
|
296
301
|
if (i != null) {
|
|
297
302
|
const r = i(e, t);
|
|
298
303
|
if (r != null) {
|
|
299
|
-
const
|
|
300
|
-
return new U(
|
|
304
|
+
const h = s;
|
|
305
|
+
return new U(h, r);
|
|
301
306
|
}
|
|
302
307
|
}
|
|
303
308
|
}
|
|
@@ -308,30 +313,30 @@ const de = {
|
|
|
308
313
|
return i ? i(e, t, s) : new U(t, e);
|
|
309
314
|
}
|
|
310
315
|
};
|
|
311
|
-
|
|
316
|
+
o(p, "defaultCodec", new p());
|
|
312
317
|
let m = p;
|
|
313
|
-
function
|
|
318
|
+
function de(n) {
|
|
314
319
|
return n instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && n instanceof SharedArrayBuffer;
|
|
315
320
|
}
|
|
316
321
|
function B(n) {
|
|
317
|
-
return n instanceof Uint8Array ? n : ArrayBuffer.isView(n) ? new Uint8Array(n.buffer, n.byteOffset, n.byteLength) :
|
|
322
|
+
return n instanceof Uint8Array ? n : ArrayBuffer.isView(n) ? new Uint8Array(n.buffer, n.byteOffset, n.byteLength) : de(n) ? new Uint8Array(n) : Uint8Array.from(n);
|
|
318
323
|
}
|
|
319
324
|
const ue = 100, xe = 2048;
|
|
320
325
|
class I {
|
|
321
326
|
constructor(e) {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
327
|
+
o(this, "extensionCodec");
|
|
328
|
+
o(this, "context");
|
|
329
|
+
o(this, "useBigInt64");
|
|
330
|
+
o(this, "maxDepth");
|
|
331
|
+
o(this, "initialBufferSize");
|
|
332
|
+
o(this, "sortKeys");
|
|
333
|
+
o(this, "forceFloat32");
|
|
334
|
+
o(this, "ignoreUndefined");
|
|
335
|
+
o(this, "forceIntegerToFloat");
|
|
336
|
+
o(this, "pos");
|
|
337
|
+
o(this, "view");
|
|
338
|
+
o(this, "bytes");
|
|
339
|
+
o(this, "entered", !1);
|
|
335
340
|
this.extensionCodec = (e == null ? void 0 : e.extensionCodec) ?? m.defaultCodec, this.context = e == null ? void 0 : e.context, this.useBigInt64 = (e == null ? void 0 : e.useBigInt64) ?? !1, this.maxDepth = (e == null ? void 0 : e.maxDepth) ?? ue, this.initialBufferSize = (e == null ? void 0 : e.initialBufferSize) ?? xe, this.sortKeys = (e == null ? void 0 : e.sortKeys) ?? !1, this.forceFloat32 = (e == null ? void 0 : e.forceFloat32) ?? !1, this.ignoreUndefined = (e == null ? void 0 : e.ignoreUndefined) ?? !1, this.forceIntegerToFloat = (e == null ? void 0 : e.forceIntegerToFloat) ?? !1, this.pos = 0, this.view = new DataView(new ArrayBuffer(this.initialBufferSize)), this.bytes = new Uint8Array(this.view.buffer);
|
|
336
341
|
}
|
|
337
342
|
clone() {
|
|
@@ -418,7 +423,7 @@ class I {
|
|
|
418
423
|
}
|
|
419
424
|
encodeString(e) {
|
|
420
425
|
const s = V(e);
|
|
421
|
-
this.ensureBufferSizeToWrite(5 + s), this.writeStringHeader(s),
|
|
426
|
+
this.ensureBufferSizeToWrite(5 + s), this.writeStringHeader(s), G(e, this.bytes, this.pos), this.pos += s;
|
|
422
427
|
}
|
|
423
428
|
encodeObject(e, t) {
|
|
424
429
|
const s = this.extensionCodec.tryToEncode(e, this.context);
|
|
@@ -478,8 +483,8 @@ class I {
|
|
|
478
483
|
else
|
|
479
484
|
throw new Error(`Too large map object: ${i}`);
|
|
480
485
|
for (const r of s) {
|
|
481
|
-
const
|
|
482
|
-
this.ignoreUndefined &&
|
|
486
|
+
const h = e[r];
|
|
487
|
+
this.ignoreUndefined && h === void 0 || (this.encodeString(r), this.doEncode(h, t + 1));
|
|
483
488
|
}
|
|
484
489
|
}
|
|
485
490
|
encodeExtension(e) {
|
|
@@ -561,11 +566,11 @@ function E(n) {
|
|
|
561
566
|
const ge = 16, ye = 16;
|
|
562
567
|
class Ue {
|
|
563
568
|
constructor(e = ge, t = ye) {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
+
o(this, "hit", 0);
|
|
570
|
+
o(this, "miss", 0);
|
|
571
|
+
o(this, "caches");
|
|
572
|
+
o(this, "maxKeyLength");
|
|
573
|
+
o(this, "maxLengthPerKey");
|
|
569
574
|
this.maxKeyLength = e, this.maxLengthPerKey = t, this.caches = [];
|
|
570
575
|
for (let s = 0; s < this.maxKeyLength; s++)
|
|
571
576
|
this.caches.push([]);
|
|
@@ -576,9 +581,9 @@ class Ue {
|
|
|
576
581
|
find(e, t, s) {
|
|
577
582
|
const i = this.caches[s - 1];
|
|
578
583
|
e: for (const r of i) {
|
|
579
|
-
const
|
|
584
|
+
const h = r.bytes;
|
|
580
585
|
for (let a = 0; a < s; a++)
|
|
581
|
-
if (
|
|
586
|
+
if (h[a] !== e[t + a])
|
|
582
587
|
continue e;
|
|
583
588
|
return r.str;
|
|
584
589
|
}
|
|
@@ -593,8 +598,8 @@ class Ue {
|
|
|
593
598
|
if (i != null)
|
|
594
599
|
return this.hit++, i;
|
|
595
600
|
this.miss++;
|
|
596
|
-
const r = D(e, t, s),
|
|
597
|
-
return this.store(
|
|
601
|
+
const r = D(e, t, s), h = Uint8Array.prototype.slice.call(e, t, t + s);
|
|
602
|
+
return this.store(h, r), r;
|
|
598
603
|
}
|
|
599
604
|
}
|
|
600
605
|
const A = "array", g = "map_key", _ = "map_value", me = (n) => {
|
|
@@ -604,8 +609,8 @@ const A = "array", g = "map_key", _ = "map_value", me = (n) => {
|
|
|
604
609
|
};
|
|
605
610
|
class pe {
|
|
606
611
|
constructor() {
|
|
607
|
-
|
|
608
|
-
|
|
612
|
+
o(this, "stack", []);
|
|
613
|
+
o(this, "stackHeadPosition", -1);
|
|
609
614
|
}
|
|
610
615
|
get length() {
|
|
611
616
|
return this.stackHeadPosition + 1;
|
|
@@ -661,30 +666,30 @@ try {
|
|
|
661
666
|
throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access");
|
|
662
667
|
}
|
|
663
668
|
const L = new RangeError("Insufficient data"), Ee = new Ue();
|
|
664
|
-
class
|
|
669
|
+
class v {
|
|
665
670
|
constructor(e) {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
671
|
+
o(this, "extensionCodec");
|
|
672
|
+
o(this, "context");
|
|
673
|
+
o(this, "useBigInt64");
|
|
674
|
+
o(this, "rawStrings");
|
|
675
|
+
o(this, "maxStrLength");
|
|
676
|
+
o(this, "maxBinLength");
|
|
677
|
+
o(this, "maxArrayLength");
|
|
678
|
+
o(this, "maxMapLength");
|
|
679
|
+
o(this, "maxExtLength");
|
|
680
|
+
o(this, "keyDecoder");
|
|
681
|
+
o(this, "mapKeyConverter");
|
|
682
|
+
o(this, "totalPos", 0);
|
|
683
|
+
o(this, "pos", 0);
|
|
684
|
+
o(this, "view", T);
|
|
685
|
+
o(this, "bytes", Se);
|
|
686
|
+
o(this, "headByte", w);
|
|
687
|
+
o(this, "stack", new pe());
|
|
688
|
+
o(this, "entered", !1);
|
|
684
689
|
this.extensionCodec = (e == null ? void 0 : e.extensionCodec) ?? m.defaultCodec, this.context = e == null ? void 0 : e.context, this.useBigInt64 = (e == null ? void 0 : e.useBigInt64) ?? !1, this.rawStrings = (e == null ? void 0 : e.rawStrings) ?? !1, this.maxStrLength = (e == null ? void 0 : e.maxStrLength) ?? x, this.maxBinLength = (e == null ? void 0 : e.maxBinLength) ?? x, this.maxArrayLength = (e == null ? void 0 : e.maxArrayLength) ?? x, this.maxMapLength = (e == null ? void 0 : e.maxMapLength) ?? x, this.maxExtLength = (e == null ? void 0 : e.maxExtLength) ?? x, this.keyDecoder = (e == null ? void 0 : e.keyDecoder) !== void 0 ? e.keyDecoder : Ee, this.mapKeyConverter = (e == null ? void 0 : e.mapKeyConverter) ?? me;
|
|
685
690
|
}
|
|
686
691
|
clone() {
|
|
687
|
-
return new
|
|
692
|
+
return new v({
|
|
688
693
|
extensionCodec: this.extensionCodec,
|
|
689
694
|
context: this.context,
|
|
690
695
|
useBigInt64: this.useBigInt64,
|
|
@@ -771,8 +776,8 @@ class k {
|
|
|
771
776
|
throw this.createExtraByteError(this.totalPos);
|
|
772
777
|
return s;
|
|
773
778
|
}
|
|
774
|
-
const { headByte: i, pos: r, totalPos:
|
|
775
|
-
throw new RangeError(`Insufficient data in parsing ${E(i)} at ${
|
|
779
|
+
const { headByte: i, pos: r, totalPos: h } = this;
|
|
780
|
+
throw new RangeError(`Insufficient data in parsing ${E(i)} at ${h} (${r} in the current buffer)`);
|
|
776
781
|
} finally {
|
|
777
782
|
this.entered = !1;
|
|
778
783
|
}
|
|
@@ -798,9 +803,9 @@ class k {
|
|
|
798
803
|
try {
|
|
799
804
|
for (; yield this.doDecodeSync(), --i !== 0; )
|
|
800
805
|
;
|
|
801
|
-
} catch (
|
|
802
|
-
if (!(
|
|
803
|
-
throw
|
|
806
|
+
} catch (h) {
|
|
807
|
+
if (!(h instanceof RangeError))
|
|
808
|
+
throw h;
|
|
804
809
|
}
|
|
805
810
|
this.totalPos += this.pos;
|
|
806
811
|
}
|
|
@@ -1081,7 +1086,7 @@ class k {
|
|
|
1081
1086
|
}
|
|
1082
1087
|
}
|
|
1083
1088
|
function Be(n, e) {
|
|
1084
|
-
return new
|
|
1089
|
+
return new v(e).decode(n);
|
|
1085
1090
|
}
|
|
1086
1091
|
const Ae = /* @__PURE__ */ new Set([
|
|
1087
1092
|
"auth",
|
|
@@ -1108,10 +1113,10 @@ const Ae = /* @__PURE__ */ new Set([
|
|
|
1108
1113
|
"subscribe_inbox",
|
|
1109
1114
|
"unsubscribe_inbox"
|
|
1110
1115
|
]);
|
|
1111
|
-
function
|
|
1116
|
+
function ke(n) {
|
|
1112
1117
|
return Ae.has(n.type);
|
|
1113
1118
|
}
|
|
1114
|
-
function
|
|
1119
|
+
function Me(n) {
|
|
1115
1120
|
return we(n);
|
|
1116
1121
|
}
|
|
1117
1122
|
function ze(n) {
|
|
@@ -1126,10 +1131,10 @@ function ze(n) {
|
|
|
1126
1131
|
export {
|
|
1127
1132
|
Te as a,
|
|
1128
1133
|
ze as d,
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1134
|
+
Me as e,
|
|
1135
|
+
b as h,
|
|
1136
|
+
ke as i,
|
|
1137
|
+
ve as p,
|
|
1133
1138
|
R as r
|
|
1134
1139
|
};
|
|
1135
1140
|
//# sourceMappingURL=codec.js.map
|