@origonai/web-sdk 0.1.0 → 0.1.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/README.md +55 -10
- package/dist/index.d.ts +90 -10
- package/dist/origon-web-sdk.js +1310 -1046
- package/dist/origon-web-sdk.js.map +1 -1
- package/docs/contract.md +59 -0
- package/docs/new-chat-protocol.md +21 -3
- package/package.json +1 -1
package/dist/origon-web-sdk.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class Qn {
|
|
2
2
|
constructor() {
|
|
3
3
|
this.callbacks = {};
|
|
4
4
|
}
|
|
@@ -11,7 +11,7 @@ class Zn {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
class
|
|
14
|
+
class h extends Error {
|
|
15
15
|
constructor(t) {
|
|
16
16
|
super(t.message), this.name = "ClientError", this.kind = t.kind, t.status !== void 0 && (this.status = t.status), t.code !== void 0 && (this.code = t.code);
|
|
17
17
|
}
|
|
@@ -20,112 +20,112 @@ class f extends Error {
|
|
|
20
20
|
return this.status !== void 0 && (t.status = this.status), this.code !== void 0 && (t.code = this.code), t;
|
|
21
21
|
}
|
|
22
22
|
static notInitialized() {
|
|
23
|
-
return new
|
|
23
|
+
return new h({ kind: "notInitialized", message: "SDK is not initialized" });
|
|
24
24
|
}
|
|
25
25
|
static noSession(t) {
|
|
26
|
-
return new
|
|
26
|
+
return new h({ kind: "noSession", message: `No active session: ${t}` });
|
|
27
27
|
}
|
|
28
28
|
static missingField(t) {
|
|
29
|
-
return new
|
|
29
|
+
return new h({ kind: "missingField", message: `Missing required field: ${t}` });
|
|
30
30
|
}
|
|
31
31
|
static serverUnavailable(t) {
|
|
32
|
-
return new
|
|
32
|
+
return new h({
|
|
33
33
|
kind: "serverUnavailable",
|
|
34
34
|
status: t,
|
|
35
35
|
message: `Server unavailable (status ${t})`
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
static http(t, n, s) {
|
|
39
|
-
return new
|
|
39
|
+
return new h({ kind: "http", status: t, code: n, message: s || `HTTP ${t}` });
|
|
40
40
|
}
|
|
41
41
|
static attachment(t, n) {
|
|
42
|
-
return new
|
|
42
|
+
return new h({ kind: "attachment", code: t, message: n });
|
|
43
43
|
}
|
|
44
44
|
static cancelled() {
|
|
45
|
-
return new
|
|
45
|
+
return new h({ kind: "cancelled", message: "Operation cancelled" });
|
|
46
46
|
}
|
|
47
47
|
static other(t) {
|
|
48
|
-
return new
|
|
48
|
+
return new h({ kind: "other", message: t });
|
|
49
49
|
}
|
|
50
50
|
static session(t) {
|
|
51
|
-
return new
|
|
51
|
+
return new h({ kind: "session", message: t });
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function nn(e) {
|
|
55
55
|
return typeof e == "object" && e !== null && "error" in e && typeof e.error == "object" && e.error !== null && "message" in e.error;
|
|
56
56
|
}
|
|
57
|
-
const
|
|
57
|
+
const k = 8, sn = 1048576, L = {
|
|
58
58
|
REQUEST: 1,
|
|
59
59
|
DATA: 2,
|
|
60
60
|
ERROR: 3,
|
|
61
61
|
CANCEL: 4
|
|
62
|
-
},
|
|
62
|
+
}, rn = 0;
|
|
63
63
|
class b extends Error {
|
|
64
64
|
constructor(t) {
|
|
65
65
|
super(t), this.name = "OrpcCodecError";
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
class
|
|
68
|
+
class an extends b {
|
|
69
69
|
constructor(t) {
|
|
70
|
-
super(`frame payload too large: ${t} > ${
|
|
70
|
+
super(`frame payload too large: ${t} > ${sn}`), this.name = "OrpcFrameTooLargeError", this.declaredLength = t;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
const
|
|
73
|
+
const we = new TextEncoder(), on = new TextDecoder("utf-8", { fatal: !0 });
|
|
74
74
|
function Jn(e, t, n, s) {
|
|
75
|
-
const r =
|
|
76
|
-
([d,
|
|
75
|
+
const r = we.encode(e), i = Object.entries(n).map(
|
|
76
|
+
([d, f]) => [we.encode(d), we.encode(f)]
|
|
77
77
|
);
|
|
78
78
|
let a = 2 + r.length + 8 + 1 + 2 + s.length;
|
|
79
|
-
for (const [d,
|
|
80
|
-
const o = Ve(
|
|
81
|
-
let u =
|
|
82
|
-
l.setUint16(u, r.length), u += 2, o.set(r, u), u += r.length, l.setBigUint64(u, BigInt(t)), u += 8, o[u++] =
|
|
83
|
-
for (const [d,
|
|
84
|
-
l.setUint16(u, d.length), u += 2, o.set(d, u), u += d.length, l.setUint16(u,
|
|
79
|
+
for (const [d, f] of i) a += 2 + d.length + 2 + f.length;
|
|
80
|
+
const o = Ve(L.REQUEST, a), l = new DataView(o.buffer);
|
|
81
|
+
let u = k;
|
|
82
|
+
l.setUint16(u, r.length), u += 2, o.set(r, u), u += r.length, l.setBigUint64(u, BigInt(t)), u += 8, o[u++] = rn, l.setUint16(u, i.length), u += 2;
|
|
83
|
+
for (const [d, f] of i)
|
|
84
|
+
l.setUint16(u, d.length), u += 2, o.set(d, u), u += d.length, l.setUint16(u, f.length), u += 2, o.set(f, u), u += f.length;
|
|
85
85
|
return o.set(s, u), o;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
const t = Ve(
|
|
89
|
-
return t.set(e,
|
|
87
|
+
function es(e) {
|
|
88
|
+
const t = Ve(L.DATA, e.length);
|
|
89
|
+
return t.set(e, k), t;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
return Ve(
|
|
91
|
+
function cn() {
|
|
92
|
+
return Ve(L.CANCEL, 0);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
if (e.length <
|
|
96
|
-
throw new b(`frame shorter than header: ${e.length} < ${
|
|
94
|
+
function ts(e) {
|
|
95
|
+
if (e.length < k)
|
|
96
|
+
throw new b(`frame shorter than header: ${e.length} < ${k}`);
|
|
97
97
|
const t = e[0];
|
|
98
|
-
if (!Object.values(
|
|
98
|
+
if (!Object.values(L).includes(t))
|
|
99
99
|
throw new b(`unexpected frame type 0x${t.toString(16)}`);
|
|
100
|
-
const n = new DataView(e.buffer, e.byteOffset,
|
|
100
|
+
const n = new DataView(e.buffer, e.byteOffset, k), s = n.getUint16(2);
|
|
101
101
|
if (s !== 0) throw new b(`non-zero reserved field: ${s}`);
|
|
102
102
|
const r = n.getUint32(4);
|
|
103
|
-
if (r >
|
|
104
|
-
if (t ===
|
|
103
|
+
if (r > sn) throw new an(r);
|
|
104
|
+
if (t === L.CANCEL && r !== 0)
|
|
105
105
|
throw new b(`CANCEL payload must be empty: ${r}`);
|
|
106
106
|
return { frameType: t, payloadLen: r };
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function ns(e, t) {
|
|
109
109
|
switch (e) {
|
|
110
|
-
case
|
|
111
|
-
const { path: n, body: s } =
|
|
110
|
+
case L.REQUEST: {
|
|
111
|
+
const { path: n, body: s } = ss(t);
|
|
112
112
|
return { type: "response", path: n, body: s };
|
|
113
113
|
}
|
|
114
|
-
case
|
|
114
|
+
case L.DATA:
|
|
115
115
|
return { type: "data", body: t };
|
|
116
|
-
case
|
|
116
|
+
case L.ERROR: {
|
|
117
117
|
if (t.length < 4)
|
|
118
118
|
throw new b(`ERROR frame too short for code: ${t.length}`);
|
|
119
119
|
const n = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
120
120
|
let s;
|
|
121
121
|
try {
|
|
122
|
-
s =
|
|
122
|
+
s = on.decode(t.subarray(4));
|
|
123
123
|
} catch {
|
|
124
124
|
throw new b("ERROR reason is not valid UTF-8");
|
|
125
125
|
}
|
|
126
126
|
return { type: "error", code: n.getUint32(0), reason: s };
|
|
127
127
|
}
|
|
128
|
-
case
|
|
128
|
+
case L.CANCEL:
|
|
129
129
|
return { type: "cancel" };
|
|
130
130
|
default:
|
|
131
131
|
throw new b(`unexpected frame type 0x${e.toString(16)}`);
|
|
@@ -134,10 +134,10 @@ function es(e, t) {
|
|
|
134
134
|
function Ve(e, t) {
|
|
135
135
|
if (!Number.isSafeInteger(t) || t < 0 || t > 4294967295)
|
|
136
136
|
throw new b(`payload length is outside u32: ${t}`);
|
|
137
|
-
const n = new Uint8Array(
|
|
137
|
+
const n = new Uint8Array(k + t), s = new DataView(n.buffer);
|
|
138
138
|
return n[0] = e, n[1] = 0, s.setUint16(2, 0), s.setUint32(4, t), n;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function ss(e) {
|
|
141
141
|
const t = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
142
142
|
let n = 0;
|
|
143
143
|
if (e.length < 2) throw new b("REQUEST payload too short for path_len");
|
|
@@ -148,11 +148,11 @@ function ts(e) {
|
|
|
148
148
|
const r = e.subarray(n, n + s);
|
|
149
149
|
for (const l of r)
|
|
150
150
|
if (!(l >= 65 && l <= 90 || l >= 97 && l <= 122 || l >= 48 && l <= 57 || l === 46 || l === 95 || l === 47)) throw new b("REQUEST path contains an invalid byte");
|
|
151
|
-
const i =
|
|
151
|
+
const i = on.decode(r);
|
|
152
152
|
if (n += s, n + 11 > e.length) throw new b("REQUEST payload missing fixed tail");
|
|
153
153
|
n += 8;
|
|
154
154
|
const a = e[n++];
|
|
155
|
-
if (a !==
|
|
155
|
+
if (a !== rn)
|
|
156
156
|
throw new b(`unsupported response encoding: ${a}`);
|
|
157
157
|
const o = t.getUint16(n);
|
|
158
158
|
n += 2;
|
|
@@ -171,61 +171,61 @@ function ts(e) {
|
|
|
171
171
|
}
|
|
172
172
|
return { path: i, body: e.subarray(n) };
|
|
173
173
|
}
|
|
174
|
-
const
|
|
175
|
-
function
|
|
176
|
-
const t =
|
|
174
|
+
const ce = /* @__PURE__ */ new Map();
|
|
175
|
+
function it(e) {
|
|
176
|
+
const t = ce.get(e);
|
|
177
177
|
if (t && !t.dead) return t;
|
|
178
178
|
const n = new WebTransport(e), s = { transport: n, dead: !1 };
|
|
179
179
|
return n.closed.then(
|
|
180
|
-
() =>
|
|
181
|
-
() =>
|
|
182
|
-
),
|
|
180
|
+
() => ue(e, s),
|
|
181
|
+
() => ue(e, s)
|
|
182
|
+
), ce.set(e, s), s;
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
t.dead = !0,
|
|
184
|
+
function ue(e, t) {
|
|
185
|
+
t.dead = !0, ce.get(e) === t && ce.delete(e);
|
|
186
186
|
}
|
|
187
|
-
async function
|
|
187
|
+
async function at(e) {
|
|
188
188
|
return await e.transport.ready, e.transport.createBidirectionalStream();
|
|
189
189
|
}
|
|
190
|
-
async function
|
|
191
|
-
let n =
|
|
190
|
+
async function rs(e, t) {
|
|
191
|
+
let n = it(e), s, r = !1;
|
|
192
192
|
try {
|
|
193
|
-
s = await
|
|
193
|
+
s = await at(n);
|
|
194
194
|
} catch {
|
|
195
|
-
|
|
195
|
+
ue(e, n), r = !0, n = it(e), s = await at(n);
|
|
196
196
|
}
|
|
197
197
|
const i = s.writable.getWriter(), a = s.readable.getReader();
|
|
198
198
|
try {
|
|
199
199
|
await i.write(t);
|
|
200
200
|
} catch (o) {
|
|
201
|
-
throw
|
|
201
|
+
throw ot(e, n, o), o;
|
|
202
202
|
}
|
|
203
203
|
return {
|
|
204
204
|
reader: a,
|
|
205
205
|
writer: i,
|
|
206
206
|
reconnected: r,
|
|
207
|
-
sessionFailed: (o) =>
|
|
207
|
+
sessionFailed: (o) => ot(e, n, o)
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
|
-
function
|
|
211
|
-
typeof n != "object" && typeof n != "function" || n === null || n.source === "session" &&
|
|
210
|
+
function ot(e, t, n) {
|
|
211
|
+
typeof n != "object" && typeof n != "function" || n === null || n.source === "session" && ue(e, t);
|
|
212
212
|
}
|
|
213
|
-
class
|
|
213
|
+
class ct {
|
|
214
214
|
constructor(t) {
|
|
215
215
|
this.reader = t, this.chunks = [], this.available = 0, this.ended = !1;
|
|
216
216
|
}
|
|
217
217
|
async readFrame() {
|
|
218
|
-
if (await this.ensure(
|
|
219
|
-
if (this.available <
|
|
218
|
+
if (await this.ensure(k), this.available === 0 && this.ended) return null;
|
|
219
|
+
if (this.available < k)
|
|
220
220
|
throw new b(
|
|
221
|
-
`response FIN truncated frame header: have ${this.available}, need ${
|
|
221
|
+
`response FIN truncated frame header: have ${this.available}, need ${k}`
|
|
222
222
|
);
|
|
223
|
-
const t =
|
|
223
|
+
const t = ts(this.peek(k)), n = k + t.payloadLen;
|
|
224
224
|
if (await this.ensure(n), this.available < n)
|
|
225
225
|
throw new b(
|
|
226
|
-
`response FIN truncated frame payload: have ${this.available -
|
|
226
|
+
`response FIN truncated frame payload: have ${this.available - k}, need ${t.payloadLen}`
|
|
227
227
|
);
|
|
228
|
-
return this.take(
|
|
228
|
+
return this.take(k), ns(t.frameType, this.take(t.payloadLen));
|
|
229
229
|
}
|
|
230
230
|
async cancel(t) {
|
|
231
231
|
await this.reader.cancel(t);
|
|
@@ -268,7 +268,7 @@ class ot {
|
|
|
268
268
|
return s;
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
const
|
|
271
|
+
const Q = {
|
|
272
272
|
/** bad signature / malformed token → refresh + retry once, then logout */
|
|
273
273
|
INVALID: 4096,
|
|
274
274
|
/** token past `exp` → refresh + retry once, then logout */
|
|
@@ -277,151 +277,151 @@ const Z = {
|
|
|
277
277
|
STALE: 4098,
|
|
278
278
|
/** session logged out / user deleted / banned → logout */
|
|
279
279
|
REVOKED: 4099
|
|
280
|
-
},
|
|
280
|
+
}, B = {
|
|
281
281
|
INVALID_ARGUMENT: 2,
|
|
282
282
|
CANCELLED: 4,
|
|
283
283
|
/** Streaming DATA exceeds the ingress cap. */
|
|
284
284
|
MESSAGE_TOO_LARGE: 12
|
|
285
|
-
},
|
|
286
|
-
class
|
|
285
|
+
}, is = "DATA frame too large";
|
|
286
|
+
class T extends Error {
|
|
287
287
|
constructor(t, n) {
|
|
288
288
|
super(`orpc error 0x${t.toString(16)}${n ? `: ${n}` : ""}`), this.name = "OrpcError", this.code = t, this.reason = n;
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function as(e) {
|
|
292
292
|
if (typeof e != "object" && typeof e != "function" || e === null) return !1;
|
|
293
293
|
const t = e;
|
|
294
294
|
return t.source === "stream" && Number.isInteger(t.streamErrorCode) && t.streamErrorCode >= 0 && t.streamErrorCode <= 255;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
297
|
-
if (!
|
|
296
|
+
function os(e) {
|
|
297
|
+
if (!as(e))
|
|
298
298
|
return e instanceof Error || typeof e == "object" && e !== null && "message" in e ? e : new Error(String(e));
|
|
299
|
-
const t = e.streamErrorCode ===
|
|
300
|
-
return new
|
|
299
|
+
const t = e.streamErrorCode === B.MESSAGE_TOO_LARGE ? is : `WebTransport stream aborted with code 0x${e.streamErrorCode.toString(16)}`;
|
|
300
|
+
return new T(e.streamErrorCode, t);
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function un(e, t = "orpc stream cancelled") {
|
|
303
303
|
if (typeof WebTransportError < "u")
|
|
304
304
|
return new WebTransportError(t, { source: "stream", streamErrorCode: e });
|
|
305
305
|
const n = new Error(t);
|
|
306
306
|
return n.name = "WebTransportError", n.source = "stream", n.streamErrorCode = e, n;
|
|
307
307
|
}
|
|
308
|
-
const
|
|
308
|
+
const cs = {
|
|
309
309
|
event() {
|
|
310
310
|
}
|
|
311
|
-
},
|
|
312
|
-
function
|
|
313
|
-
return
|
|
311
|
+
}, us = [];
|
|
312
|
+
function ls() {
|
|
313
|
+
return us.slice();
|
|
314
314
|
}
|
|
315
|
-
typeof window < "u" && (window.__orpcDebug =
|
|
316
|
-
function
|
|
317
|
-
const s = n.logger ??
|
|
315
|
+
typeof window < "u" && (window.__orpcDebug = ls);
|
|
316
|
+
function ds(e, t, n = {}) {
|
|
317
|
+
const s = n.logger ?? cs, r = n.transport ?? rs, i = { ...n.metadata };
|
|
318
318
|
delete i.authorization;
|
|
319
|
-
async function a(d,
|
|
320
|
-
const
|
|
321
|
-
s.event({ kind: "request", path: d, reqBytes:
|
|
322
|
-
const
|
|
323
|
-
return
|
|
324
|
-
}
|
|
325
|
-
async function o(d,
|
|
326
|
-
const
|
|
319
|
+
async function a(d, f) {
|
|
320
|
+
const p = t.getToken(), m = p ? { ...i, authorization: `Bearer ${p}` } : { ...i }, g = Jn(d, 0, m, f);
|
|
321
|
+
s.event({ kind: "request", path: d, reqBytes: g.length });
|
|
322
|
+
const E = await r(e, g);
|
|
323
|
+
return E.reconnected && s.event({ kind: "transport", path: d, event: "reconnect" }), E;
|
|
324
|
+
}
|
|
325
|
+
async function o(d, f, p) {
|
|
326
|
+
const m = Ie(), g = await a(d, f), E = new ct(g.reader), x = g.writer.close().then(
|
|
327
327
|
() => null,
|
|
328
|
-
(
|
|
328
|
+
(v) => V(g, v)
|
|
329
329
|
);
|
|
330
|
-
let
|
|
330
|
+
let N;
|
|
331
331
|
try {
|
|
332
|
-
|
|
333
|
-
} catch (
|
|
334
|
-
throw await O(
|
|
332
|
+
N = await E.readFrame();
|
|
333
|
+
} catch (v) {
|
|
334
|
+
throw await O(g, E, v), V(g, v);
|
|
335
335
|
}
|
|
336
|
-
if (
|
|
337
|
-
if (
|
|
336
|
+
if (N === null) throw new b("response FIN before unary reply");
|
|
337
|
+
if (N.type === "data" || N.type === "cancel")
|
|
338
338
|
throw await O(
|
|
339
|
+
g,
|
|
339
340
|
E,
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
let nt;
|
|
341
|
+
new b(`unexpected ${N.type} frame`)
|
|
342
|
+
), new b(`unexpected ${N.type} frame before unary reply`);
|
|
343
|
+
let st;
|
|
344
344
|
try {
|
|
345
|
-
|
|
346
|
-
} catch (
|
|
347
|
-
throw await O(
|
|
345
|
+
st = await E.readFrame();
|
|
346
|
+
} catch (v) {
|
|
347
|
+
throw await O(g, E, v), V(g, v);
|
|
348
348
|
}
|
|
349
|
-
if (
|
|
350
|
-
const
|
|
351
|
-
throw await O(
|
|
349
|
+
if (st !== null) {
|
|
350
|
+
const v = new b("trailing frame after unary terminal");
|
|
351
|
+
throw await O(g, E, v), v;
|
|
352
352
|
}
|
|
353
|
-
if (
|
|
353
|
+
if (N.type === "error")
|
|
354
354
|
return s.event({
|
|
355
355
|
kind: "error",
|
|
356
356
|
path: d,
|
|
357
|
-
code:
|
|
358
|
-
reason:
|
|
359
|
-
ms:
|
|
360
|
-
}), u(
|
|
361
|
-
if (
|
|
362
|
-
throw new b(`response path mismatch: expected ${d}, got ${
|
|
363
|
-
const
|
|
364
|
-
if (
|
|
365
|
-
return s.event({ kind: "response", path: d, respBytes:
|
|
366
|
-
}
|
|
367
|
-
async function l(d,
|
|
368
|
-
const
|
|
369
|
-
let
|
|
357
|
+
code: N.code,
|
|
358
|
+
reason: N.reason,
|
|
359
|
+
ms: Ie() - m
|
|
360
|
+
}), u(N.code, N.reason, d, f, p);
|
|
361
|
+
if (N.path !== d)
|
|
362
|
+
throw new b(`response path mismatch: expected ${d}, got ${N.path}`);
|
|
363
|
+
const rt = await x;
|
|
364
|
+
if (rt) throw rt;
|
|
365
|
+
return s.event({ kind: "response", path: d, respBytes: N.body.length, ms: Ie() - m }), N.body;
|
|
366
|
+
}
|
|
367
|
+
async function l(d, f) {
|
|
368
|
+
const p = await a(d, f), m = new ct(p.reader);
|
|
369
|
+
let g;
|
|
370
370
|
try {
|
|
371
|
-
|
|
372
|
-
} catch (
|
|
373
|
-
throw await O(
|
|
371
|
+
g = await m.readFrame();
|
|
372
|
+
} catch (E) {
|
|
373
|
+
throw await O(p, m, E), V(p, E);
|
|
374
374
|
}
|
|
375
|
-
if (
|
|
376
|
-
const
|
|
377
|
-
throw await O(
|
|
375
|
+
if (g === null) {
|
|
376
|
+
const E = new b("response FIN before streaming REQUEST echo");
|
|
377
|
+
throw await O(p, m, E), E;
|
|
378
378
|
}
|
|
379
|
-
if (
|
|
380
|
-
throw await
|
|
381
|
-
if (
|
|
382
|
-
const
|
|
383
|
-
`unexpected ${
|
|
379
|
+
if (g.type === "error")
|
|
380
|
+
throw await ln(p), new T(g.code, g.reason);
|
|
381
|
+
if (g.type !== "response") {
|
|
382
|
+
const E = new b(
|
|
383
|
+
`unexpected ${g.type} frame before streaming REQUEST echo`
|
|
384
384
|
);
|
|
385
|
-
throw await O(
|
|
385
|
+
throw await O(p, m, E), E;
|
|
386
386
|
}
|
|
387
|
-
if (
|
|
388
|
-
const
|
|
389
|
-
`response path mismatch: expected ${d}, got ${
|
|
387
|
+
if (g.path !== d) {
|
|
388
|
+
const E = new b(
|
|
389
|
+
`response path mismatch: expected ${d}, got ${g.path}`
|
|
390
390
|
);
|
|
391
|
-
throw await O(
|
|
391
|
+
throw await O(p, m, E), E;
|
|
392
392
|
}
|
|
393
|
-
return new
|
|
393
|
+
return new hs(g.body, p, m);
|
|
394
394
|
}
|
|
395
|
-
async function u(d,
|
|
395
|
+
async function u(d, f, p, m, g) {
|
|
396
396
|
switch (d) {
|
|
397
|
-
case
|
|
398
|
-
case
|
|
399
|
-
if (
|
|
400
|
-
throw t.logout(), new
|
|
401
|
-
return await t.refresh(), o(
|
|
402
|
-
case
|
|
403
|
-
throw await t.refresh(), typeof window < "u" && window.location.reload(), new
|
|
404
|
-
case
|
|
405
|
-
throw t.logout(), new
|
|
397
|
+
case Q.INVALID:
|
|
398
|
+
case Q.EXPIRED:
|
|
399
|
+
if (g)
|
|
400
|
+
throw t.logout(), new T(d, f);
|
|
401
|
+
return await t.refresh(), o(p, m, !0);
|
|
402
|
+
case Q.STALE:
|
|
403
|
+
throw await t.refresh(), typeof window < "u" && window.location.reload(), new T(d, f);
|
|
404
|
+
case Q.REVOKED:
|
|
405
|
+
throw t.logout(), new T(d, f);
|
|
406
406
|
default:
|
|
407
|
-
throw new
|
|
407
|
+
throw new T(d, f);
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
return {
|
|
411
|
-
call: (d,
|
|
411
|
+
call: (d, f) => o(d, f, !1),
|
|
412
412
|
stream: l
|
|
413
413
|
};
|
|
414
414
|
}
|
|
415
|
-
class
|
|
415
|
+
class hs {
|
|
416
416
|
constructor(t, n, s) {
|
|
417
417
|
this.channel = n, this.frames = s, this.terminal = "open", this.terminalError = null, this.upload = "open", this.uploadError = null, this.finishPromise = null, this.cancelPromise = null, this.nextTail = Promise.resolve(), this.initial = t;
|
|
418
418
|
}
|
|
419
419
|
async send(t) {
|
|
420
420
|
this.assertWritable();
|
|
421
421
|
try {
|
|
422
|
-
await this.channel.writer.write(
|
|
422
|
+
await this.channel.writer.write(es(t));
|
|
423
423
|
} catch (n) {
|
|
424
|
-
throw this.upload = "stopped", this.uploadError =
|
|
424
|
+
throw this.upload = "stopped", this.uploadError = V(this.channel, n), this.uploadError;
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
427
|
async finish() {
|
|
@@ -429,23 +429,23 @@ class ls {
|
|
|
429
429
|
if (this.finishPromise) return this.finishPromise;
|
|
430
430
|
if (!(this.terminal === "cancelled" || this.terminal === "error")) {
|
|
431
431
|
if (this.upload === "stopped")
|
|
432
|
-
throw this.uploadError ?? new
|
|
432
|
+
throw this.uploadError ?? new T(B.CANCELLED, "upload stopped");
|
|
433
433
|
return this.upload = "closing", this.finishPromise = this.channel.writer.close().then(
|
|
434
434
|
() => {
|
|
435
435
|
this.upload = "closed";
|
|
436
436
|
},
|
|
437
437
|
(t) => {
|
|
438
|
-
throw this.upload = "stopped", this.uploadError =
|
|
438
|
+
throw this.upload = "stopped", this.uploadError = V(this.channel, t), this.uploadError;
|
|
439
439
|
}
|
|
440
440
|
), this.finishPromise;
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
async cancel(t =
|
|
445
|
-
if (
|
|
444
|
+
async cancel(t = B.CANCELLED) {
|
|
445
|
+
if (fs(t), this.cancelPromise) return this.cancelPromise;
|
|
446
446
|
if (this.terminal !== "open") return;
|
|
447
|
-
this.terminal = "cancelled", this.terminalError = new
|
|
448
|
-
const n =
|
|
447
|
+
this.terminal = "cancelled", this.terminalError = new T(t, "stream cancelled");
|
|
448
|
+
const n = un(t);
|
|
449
449
|
return this.cancelPromise = Promise.allSettled([
|
|
450
450
|
this.cancelUpload(),
|
|
451
451
|
this.frames.cancel(n).catch((s) => this.channel.sessionFailed?.(s))
|
|
@@ -475,7 +475,7 @@ class ls {
|
|
|
475
475
|
t = await this.frames.readFrame();
|
|
476
476
|
} catch (s) {
|
|
477
477
|
if (this.terminalError) throw this.terminalError;
|
|
478
|
-
const r =
|
|
478
|
+
const r = V(this.channel, s);
|
|
479
479
|
throw this.terminal = "error", this.terminalError = r, s instanceof b && await O(this.channel, this.frames, s), r;
|
|
480
480
|
}
|
|
481
481
|
if (this.terminalError) throw this.terminalError;
|
|
@@ -483,13 +483,13 @@ class ls {
|
|
|
483
483
|
return this.terminal = "clean", { done: !0, value: void 0 };
|
|
484
484
|
if (t.type === "data") return { done: !1, value: t.body };
|
|
485
485
|
if (t.type === "error")
|
|
486
|
-
throw this.terminal = "error", this.terminalError = new
|
|
486
|
+
throw this.terminal = "error", this.terminalError = new T(t.code, t.reason), ln(this.channel), this.terminalError;
|
|
487
487
|
const n = new b(`unexpected ${t.type} frame after streaming REQUEST echo`);
|
|
488
488
|
throw this.terminal = "error", this.terminalError = n, await O(this.channel, this.frames, n), n;
|
|
489
489
|
}
|
|
490
490
|
assertWritable() {
|
|
491
491
|
if (this.terminalError) throw this.terminalError;
|
|
492
|
-
if (this.terminal !== "open") throw new
|
|
492
|
+
if (this.terminal !== "open") throw new T(B.CANCELLED, "stream is terminal");
|
|
493
493
|
if (this.upload !== "open")
|
|
494
494
|
throw this.uploadError ?? new b("stream upload is already finished");
|
|
495
495
|
}
|
|
@@ -501,7 +501,7 @@ class ls {
|
|
|
501
501
|
if (this.upload === "open") {
|
|
502
502
|
this.upload = "closing";
|
|
503
503
|
try {
|
|
504
|
-
await this.channel.writer.write(
|
|
504
|
+
await this.channel.writer.write(cn()), await this.channel.writer.close(), this.upload = "closed";
|
|
505
505
|
} catch (t) {
|
|
506
506
|
this.upload = "stopped", this.channel.sessionFailed?.(t);
|
|
507
507
|
}
|
|
@@ -510,11 +510,11 @@ class ls {
|
|
|
510
510
|
}
|
|
511
511
|
async function O(e, t, n) {
|
|
512
512
|
if (!(n instanceof b)) return;
|
|
513
|
-
const s = n instanceof
|
|
513
|
+
const s = n instanceof an ? B.MESSAGE_TOO_LARGE : B.INVALID_ARGUMENT, r = un(s, n.message);
|
|
514
514
|
await Promise.allSettled([
|
|
515
515
|
(async () => {
|
|
516
516
|
try {
|
|
517
|
-
await e.writer.write(
|
|
517
|
+
await e.writer.write(cn()), await e.writer.close();
|
|
518
518
|
} catch (i) {
|
|
519
519
|
e.sessionFailed?.(i);
|
|
520
520
|
}
|
|
@@ -522,27 +522,27 @@ async function O(e, t, n) {
|
|
|
522
522
|
t.cancel(r).catch((i) => e.sessionFailed?.(i))
|
|
523
523
|
]);
|
|
524
524
|
}
|
|
525
|
-
async function
|
|
525
|
+
async function ln(e) {
|
|
526
526
|
try {
|
|
527
527
|
await e.writer.close();
|
|
528
528
|
} catch (t) {
|
|
529
529
|
e.sessionFailed?.(t);
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
return e.sessionFailed?.(t),
|
|
532
|
+
function V(e, t) {
|
|
533
|
+
return e.sessionFailed?.(t), os(t);
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function fs(e) {
|
|
536
536
|
if (!Number.isInteger(e) || e < 0 || e > 255)
|
|
537
537
|
throw new RangeError(`WebTransport stream error code must be an integer in 0..255: ${e}`);
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function Ie() {
|
|
540
540
|
return typeof performance < "u" ? performance.now() : Date.now();
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function W(e) {
|
|
543
543
|
return new Promise((t) => setTimeout(t, e));
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function dn() {
|
|
546
546
|
const e = Date.now(), t = new Uint8Array(16);
|
|
547
547
|
crypto.getRandomValues(t), t[0] = e >> 40 & 255, t[1] = e >> 32 & 255, t[2] = e >> 24 & 255, t[3] = e >> 16 & 255, t[4] = e >> 8 & 255, t[5] = e & 255, t[6] = t[6] & 15 | 112, t[8] = t[8] & 63 | 128;
|
|
548
548
|
const n = [...t].map((s) => s.toString(16).padStart(2, "0")).join("");
|
|
@@ -551,14 +551,14 @@ function ln() {
|
|
|
551
551
|
20
|
|
552
552
|
)}-${n.slice(20)}`;
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function Fe(e, t) {
|
|
555
555
|
return e !== null && typeof e == "object" && "$typeName" in e && typeof e.$typeName == "string" ? t === void 0 ? !0 : t.typeName === e.$typeName : !1;
|
|
556
556
|
}
|
|
557
557
|
var c;
|
|
558
558
|
(function(e) {
|
|
559
559
|
e[e.DOUBLE = 1] = "DOUBLE", e[e.FLOAT = 2] = "FLOAT", e[e.INT64 = 3] = "INT64", e[e.UINT64 = 4] = "UINT64", e[e.INT32 = 5] = "INT32", e[e.FIXED64 = 6] = "FIXED64", e[e.FIXED32 = 7] = "FIXED32", e[e.BOOL = 8] = "BOOL", e[e.STRING = 9] = "STRING", e[e.BYTES = 12] = "BYTES", e[e.UINT32 = 13] = "UINT32", e[e.SFIXED32 = 15] = "SFIXED32", e[e.SFIXED64 = 16] = "SFIXED64", e[e.SINT32 = 17] = "SINT32", e[e.SINT64 = 18] = "SINT64";
|
|
560
560
|
})(c || (c = {}));
|
|
561
|
-
function
|
|
561
|
+
function ms() {
|
|
562
562
|
let e = 0, t = 0;
|
|
563
563
|
for (let s = 0; s < 28; s += 7) {
|
|
564
564
|
let r = this.buf[this.pos++];
|
|
@@ -575,7 +575,7 @@ function hs() {
|
|
|
575
575
|
}
|
|
576
576
|
throw new Error("invalid varint");
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function Ne(e, t, n) {
|
|
579
579
|
for (let i = 0; i < 28; i = i + 7) {
|
|
580
580
|
const a = e >>> i, o = !(!(a >>> 7) && t == 0), l = (o ? a | 128 : a) & 255;
|
|
581
581
|
if (n.push(l), !o)
|
|
@@ -591,43 +591,43 @@ function we(e, t, n) {
|
|
|
591
591
|
n.push(t >>> 31 & 1);
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
|
-
const
|
|
595
|
-
function
|
|
594
|
+
const ae = 4294967296;
|
|
595
|
+
function ut(e) {
|
|
596
596
|
const t = e[0] === "-";
|
|
597
597
|
t && (e = e.slice(1));
|
|
598
598
|
const n = 1e6;
|
|
599
599
|
let s = 0, r = 0;
|
|
600
600
|
function i(a, o) {
|
|
601
601
|
const l = Number(e.slice(a, o));
|
|
602
|
-
r *= n, s = s * n + l, s >=
|
|
602
|
+
r *= n, s = s * n + l, s >= ae && (r = r + (s / ae | 0), s = s % ae);
|
|
603
603
|
}
|
|
604
|
-
return i(-24, -18), i(-18, -12), i(-12, -6), i(-6), t ?
|
|
604
|
+
return i(-24, -18), i(-18, -12), i(-12, -6), i(-6), t ? fn(s, r) : Ge(s, r);
|
|
605
605
|
}
|
|
606
|
-
function
|
|
607
|
-
let n =
|
|
606
|
+
function ps(e, t) {
|
|
607
|
+
let n = Ge(e, t);
|
|
608
608
|
const s = n.hi & 2147483648;
|
|
609
|
-
s && (n =
|
|
610
|
-
const r =
|
|
609
|
+
s && (n = fn(n.lo, n.hi));
|
|
610
|
+
const r = hn(n.lo, n.hi);
|
|
611
611
|
return s ? "-" + r : r;
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
if ({ lo: e, hi: t } =
|
|
615
|
-
return String(
|
|
613
|
+
function hn(e, t) {
|
|
614
|
+
if ({ lo: e, hi: t } = bs(e, t), t <= 2097151)
|
|
615
|
+
return String(ae * t + e);
|
|
616
616
|
const n = e & 16777215, s = (e >>> 24 | t << 8) & 16777215, r = t >> 16 & 65535;
|
|
617
617
|
let i = n + s * 6777216 + r * 6710656, a = s + r * 8147497, o = r * 2;
|
|
618
618
|
const l = 1e7;
|
|
619
|
-
return i >= l && (a += Math.floor(i / l), i %= l), a >= l && (o += Math.floor(a / l), a %= l), o.toString() +
|
|
619
|
+
return i >= l && (a += Math.floor(i / l), i %= l), a >= l && (o += Math.floor(a / l), a %= l), o.toString() + lt(a) + lt(i);
|
|
620
620
|
}
|
|
621
|
-
function
|
|
621
|
+
function bs(e, t) {
|
|
622
622
|
return { lo: e >>> 0, hi: t >>> 0 };
|
|
623
623
|
}
|
|
624
|
-
function
|
|
624
|
+
function Ge(e, t) {
|
|
625
625
|
return { lo: e | 0, hi: t | 0 };
|
|
626
626
|
}
|
|
627
|
-
function
|
|
628
|
-
return t = ~t, e ? e = ~e + 1 : t += 1,
|
|
627
|
+
function fn(e, t) {
|
|
628
|
+
return t = ~t, e ? e = ~e + 1 : t += 1, Ge(e, t);
|
|
629
629
|
}
|
|
630
|
-
const
|
|
630
|
+
const lt = (e) => {
|
|
631
631
|
const t = String(e);
|
|
632
632
|
return "0000000".slice(t.length) + t;
|
|
633
633
|
};
|
|
@@ -642,7 +642,7 @@ function Ce(e, t) {
|
|
|
642
642
|
t.push(1);
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
|
-
function
|
|
645
|
+
function gs() {
|
|
646
646
|
let e = this.buf[this.pos++], t = e & 127;
|
|
647
647
|
if ((e & 128) == 0)
|
|
648
648
|
return this.assertBounds(), t;
|
|
@@ -659,8 +659,8 @@ function ps() {
|
|
|
659
659
|
throw new Error("invalid varint");
|
|
660
660
|
return this.assertBounds(), t >>> 0;
|
|
661
661
|
}
|
|
662
|
-
const w = /* @__PURE__ */
|
|
663
|
-
function
|
|
662
|
+
const w = /* @__PURE__ */ Es();
|
|
663
|
+
function Es() {
|
|
664
664
|
const e = new DataView(new ArrayBuffer(8));
|
|
665
665
|
if (typeof BigInt == "function" && typeof e.getBigInt64 == "function" && typeof e.getBigUint64 == "function" && typeof e.setBigInt64 == "function" && typeof e.setBigUint64 == "function" && (!!globalThis.Deno || !!globalThis.Bun || typeof process != "object" || typeof process.env != "object" || process.env.BUF_BIGINT_DISABLE !== "1")) {
|
|
666
666
|
const n = BigInt("-9223372036854775808"), s = BigInt("9223372036854775807"), r = BigInt("0"), i = BigInt("18446744073709551615");
|
|
@@ -703,34 +703,34 @@ function bs() {
|
|
|
703
703
|
zero: "0",
|
|
704
704
|
supported: !1,
|
|
705
705
|
parse(n) {
|
|
706
|
-
return typeof n != "string" && (n = n.toString()),
|
|
706
|
+
return typeof n != "string" && (n = n.toString()), dt(n), n;
|
|
707
707
|
},
|
|
708
708
|
uParse(n) {
|
|
709
|
-
return typeof n != "string" && (n = n.toString()),
|
|
709
|
+
return typeof n != "string" && (n = n.toString()), ht(n), n;
|
|
710
710
|
},
|
|
711
711
|
enc(n) {
|
|
712
|
-
return typeof n != "string" && (n = n.toString()),
|
|
712
|
+
return typeof n != "string" && (n = n.toString()), dt(n), ut(n);
|
|
713
713
|
},
|
|
714
714
|
uEnc(n) {
|
|
715
|
-
return typeof n != "string" && (n = n.toString()),
|
|
715
|
+
return typeof n != "string" && (n = n.toString()), ht(n), ut(n);
|
|
716
716
|
},
|
|
717
717
|
dec(n, s) {
|
|
718
|
-
return
|
|
718
|
+
return ps(n, s);
|
|
719
719
|
},
|
|
720
720
|
uDec(n, s) {
|
|
721
|
-
return
|
|
721
|
+
return hn(n, s);
|
|
722
722
|
}
|
|
723
723
|
};
|
|
724
724
|
}
|
|
725
|
-
function
|
|
725
|
+
function dt(e) {
|
|
726
726
|
if (!/^-?[0-9]+$/.test(e))
|
|
727
727
|
throw new Error("invalid int64: " + e);
|
|
728
728
|
}
|
|
729
|
-
function
|
|
729
|
+
function ht(e) {
|
|
730
730
|
if (!/^[0-9]+$/.test(e))
|
|
731
731
|
throw new Error("invalid uint64: " + e);
|
|
732
732
|
}
|
|
733
|
-
function
|
|
733
|
+
function q(e, t) {
|
|
734
734
|
switch (e) {
|
|
735
735
|
case c.STRING:
|
|
736
736
|
return "";
|
|
@@ -751,7 +751,7 @@ function X(e, t) {
|
|
|
751
751
|
return 0;
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
|
-
function
|
|
754
|
+
function ys(e, t) {
|
|
755
755
|
switch (e) {
|
|
756
756
|
case c.BOOL:
|
|
757
757
|
return t === !1;
|
|
@@ -766,16 +766,16 @@ function gs(e, t) {
|
|
|
766
766
|
return t == 0;
|
|
767
767
|
}
|
|
768
768
|
}
|
|
769
|
-
const
|
|
770
|
-
function
|
|
769
|
+
const mn = 2, M = Symbol.for("reflect unsafe local");
|
|
770
|
+
function pn(e, t) {
|
|
771
771
|
const n = e[t.localName].case;
|
|
772
772
|
return n === void 0 ? n : t.fields.find((s) => s.localName === n);
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function ws(e, t) {
|
|
775
775
|
const n = t.localName;
|
|
776
776
|
if (t.oneof)
|
|
777
777
|
return e[t.oneof.localName].case === n;
|
|
778
|
-
if (t.presence !=
|
|
778
|
+
if (t.presence != mn)
|
|
779
779
|
return e[n] !== void 0 && Object.prototype.hasOwnProperty.call(e, n);
|
|
780
780
|
switch (t.fieldKind) {
|
|
781
781
|
case "list":
|
|
@@ -783,34 +783,34 @@ function Es(e, t) {
|
|
|
783
783
|
case "map":
|
|
784
784
|
return Object.keys(e[n]).length > 0;
|
|
785
785
|
case "scalar":
|
|
786
|
-
return !
|
|
786
|
+
return !ys(t.scalar, e[n]);
|
|
787
787
|
case "enum":
|
|
788
788
|
return e[n] !== t.enum.values[0].number;
|
|
789
789
|
}
|
|
790
790
|
throw new Error("message field with implicit presence");
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function H(e, t) {
|
|
793
793
|
return Object.prototype.hasOwnProperty.call(e, t) && e[t] !== void 0;
|
|
794
794
|
}
|
|
795
|
-
function
|
|
795
|
+
function bn(e, t) {
|
|
796
796
|
if (t.oneof) {
|
|
797
797
|
const n = e[t.oneof.localName];
|
|
798
798
|
return n.case === t.localName ? n.value : void 0;
|
|
799
799
|
}
|
|
800
800
|
return e[t.localName];
|
|
801
801
|
}
|
|
802
|
-
function
|
|
802
|
+
function gn(e, t, n) {
|
|
803
803
|
t.oneof ? e[t.oneof.localName] = {
|
|
804
804
|
case: t.localName,
|
|
805
805
|
value: n
|
|
806
806
|
} : e[t.localName] = n;
|
|
807
807
|
}
|
|
808
|
-
function
|
|
808
|
+
function Is(e, t) {
|
|
809
809
|
const n = t.localName;
|
|
810
810
|
if (t.oneof) {
|
|
811
811
|
const s = t.oneof.localName;
|
|
812
812
|
e[s].case === n && (e[s] = { case: void 0 });
|
|
813
|
-
} else if (t.presence !=
|
|
813
|
+
} else if (t.presence != mn)
|
|
814
814
|
delete e[n];
|
|
815
815
|
else
|
|
816
816
|
switch (t.fieldKind) {
|
|
@@ -824,16 +824,16 @@ function ys(e, t) {
|
|
|
824
824
|
e[n] = t.enum.values[0].number;
|
|
825
825
|
break;
|
|
826
826
|
case "scalar":
|
|
827
|
-
e[n] =
|
|
827
|
+
e[n] = q(t.scalar, t.longAsString);
|
|
828
828
|
break;
|
|
829
829
|
}
|
|
830
830
|
}
|
|
831
|
-
function
|
|
831
|
+
function P(e) {
|
|
832
832
|
return e !== null && typeof e == "object" && !Array.isArray(e);
|
|
833
833
|
}
|
|
834
|
-
function
|
|
834
|
+
function Be(e, t) {
|
|
835
835
|
var n, s, r, i;
|
|
836
|
-
if (
|
|
836
|
+
if (P(e) && M in e && "add" in e && "field" in e && typeof e.field == "function") {
|
|
837
837
|
if (t !== void 0) {
|
|
838
838
|
const a = t, o = e.field();
|
|
839
839
|
return a.listKind == o.listKind && a.scalar === o.scalar && ((n = a.message) === null || n === void 0 ? void 0 : n.typeName) === ((s = o.message) === null || s === void 0 ? void 0 : s.typeName) && ((r = a.enum) === null || r === void 0 ? void 0 : r.typeName) === ((i = o.enum) === null || i === void 0 ? void 0 : i.typeName);
|
|
@@ -842,9 +842,9 @@ function Fe(e, t) {
|
|
|
842
842
|
}
|
|
843
843
|
return !1;
|
|
844
844
|
}
|
|
845
|
-
function
|
|
845
|
+
function Ye(e, t) {
|
|
846
846
|
var n, s, r, i;
|
|
847
|
-
if (
|
|
847
|
+
if (P(e) && M in e && "has" in e && "field" in e && typeof e.field == "function") {
|
|
848
848
|
if (t !== void 0) {
|
|
849
849
|
const a = t, o = e.field();
|
|
850
850
|
return a.mapKey === o.mapKey && a.mapKind == o.mapKind && a.scalar === o.scalar && ((n = a.message) === null || n === void 0 ? void 0 : n.typeName) === ((s = o.message) === null || s === void 0 ? void 0 : s.typeName) && ((r = a.enum) === null || r === void 0 ? void 0 : r.typeName) === ((i = o.enum) === null || i === void 0 ? void 0 : i.typeName);
|
|
@@ -853,17 +853,17 @@ function Ge(e, t) {
|
|
|
853
853
|
}
|
|
854
854
|
return !1;
|
|
855
855
|
}
|
|
856
|
-
function
|
|
857
|
-
return
|
|
856
|
+
function $e(e, t) {
|
|
857
|
+
return P(e) && M in e && "desc" in e && P(e.desc) && e.desc.kind === "message" && (t === void 0 || e.desc.typeName == t.typeName);
|
|
858
858
|
}
|
|
859
|
-
function
|
|
860
|
-
return
|
|
859
|
+
function Ns(e) {
|
|
860
|
+
return yn(e.$typeName);
|
|
861
861
|
}
|
|
862
|
-
function
|
|
862
|
+
function En(e) {
|
|
863
863
|
const t = e.fields[0];
|
|
864
|
-
return
|
|
864
|
+
return yn(e.typeName) && t !== void 0 && t.fieldKind == "scalar" && t.name == "value" && t.number == 1;
|
|
865
865
|
}
|
|
866
|
-
function
|
|
866
|
+
function yn(e) {
|
|
867
867
|
return e.startsWith("google.protobuf.") && [
|
|
868
868
|
"DoubleValue",
|
|
869
869
|
"FloatValue",
|
|
@@ -876,122 +876,122 @@ function En(e) {
|
|
|
876
876
|
"BytesValue"
|
|
877
877
|
].includes(e.substring(16));
|
|
878
878
|
}
|
|
879
|
-
const
|
|
880
|
-
function
|
|
881
|
-
if (
|
|
879
|
+
const Ts = 999, Ss = 998, oe = 2;
|
|
880
|
+
function C(e, t) {
|
|
881
|
+
if (Fe(t, e))
|
|
882
882
|
return t;
|
|
883
|
-
const n =
|
|
884
|
-
return t !== void 0 &&
|
|
883
|
+
const n = vs(e);
|
|
884
|
+
return t !== void 0 && ks(e, n, t), n;
|
|
885
885
|
}
|
|
886
|
-
function
|
|
886
|
+
function ks(e, t, n) {
|
|
887
887
|
for (const s of e.members) {
|
|
888
888
|
let r = n[s.localName];
|
|
889
889
|
if (r == null)
|
|
890
890
|
continue;
|
|
891
891
|
let i;
|
|
892
892
|
if (s.kind == "oneof") {
|
|
893
|
-
const a =
|
|
893
|
+
const a = pn(n, s);
|
|
894
894
|
if (!a)
|
|
895
895
|
continue;
|
|
896
|
-
i = a, r =
|
|
896
|
+
i = a, r = bn(n, a);
|
|
897
897
|
} else
|
|
898
898
|
i = s;
|
|
899
899
|
switch (i.fieldKind) {
|
|
900
900
|
case "message":
|
|
901
|
-
r =
|
|
901
|
+
r = Xe(i, r);
|
|
902
902
|
break;
|
|
903
903
|
case "scalar":
|
|
904
|
-
r =
|
|
904
|
+
r = wn(i, r);
|
|
905
905
|
break;
|
|
906
906
|
case "list":
|
|
907
|
-
r =
|
|
907
|
+
r = Rs(i, r);
|
|
908
908
|
break;
|
|
909
909
|
case "map":
|
|
910
|
-
r =
|
|
910
|
+
r = As(i, r);
|
|
911
911
|
break;
|
|
912
912
|
}
|
|
913
|
-
|
|
913
|
+
gn(t, i, r);
|
|
914
914
|
}
|
|
915
915
|
return t;
|
|
916
916
|
}
|
|
917
|
-
function
|
|
917
|
+
function wn(e, t) {
|
|
918
918
|
return e.scalar == c.BYTES ? Ke(t) : t;
|
|
919
919
|
}
|
|
920
|
-
function
|
|
921
|
-
if (
|
|
920
|
+
function As(e, t) {
|
|
921
|
+
if (P(t)) {
|
|
922
922
|
if (e.scalar == c.BYTES)
|
|
923
|
-
return
|
|
923
|
+
return ft(t, Ke);
|
|
924
924
|
if (e.mapKind == "message")
|
|
925
|
-
return
|
|
925
|
+
return ft(t, (n) => Xe(e, n));
|
|
926
926
|
}
|
|
927
927
|
return t;
|
|
928
928
|
}
|
|
929
|
-
function
|
|
929
|
+
function Rs(e, t) {
|
|
930
930
|
if (Array.isArray(t)) {
|
|
931
931
|
if (e.scalar == c.BYTES)
|
|
932
932
|
return t.map(Ke);
|
|
933
933
|
if (e.listKind == "message")
|
|
934
|
-
return t.map((n) =>
|
|
934
|
+
return t.map((n) => Xe(e, n));
|
|
935
935
|
}
|
|
936
936
|
return t;
|
|
937
937
|
}
|
|
938
|
-
function
|
|
939
|
-
if (e.fieldKind == "message" && !e.oneof &&
|
|
940
|
-
return
|
|
941
|
-
if (
|
|
938
|
+
function Xe(e, t) {
|
|
939
|
+
if (e.fieldKind == "message" && !e.oneof && En(e.message))
|
|
940
|
+
return wn(e.message.fields[0], t);
|
|
941
|
+
if (P(t)) {
|
|
942
942
|
if (e.message.typeName == "google.protobuf.Struct" && e.parent.typeName !== "google.protobuf.Value")
|
|
943
943
|
return t;
|
|
944
|
-
if (!
|
|
945
|
-
return
|
|
944
|
+
if (!Fe(t, e.message))
|
|
945
|
+
return C(e.message, t);
|
|
946
946
|
}
|
|
947
947
|
return t;
|
|
948
948
|
}
|
|
949
949
|
function Ke(e) {
|
|
950
950
|
return Array.isArray(e) ? new Uint8Array(e) : e;
|
|
951
951
|
}
|
|
952
|
-
function
|
|
952
|
+
function ft(e, t) {
|
|
953
953
|
const n = {};
|
|
954
954
|
for (const s of Object.entries(e))
|
|
955
955
|
n[s[0]] = t(s[1]);
|
|
956
956
|
return n;
|
|
957
957
|
}
|
|
958
|
-
const
|
|
959
|
-
function
|
|
958
|
+
const _s = Symbol(), mt = /* @__PURE__ */ new WeakMap();
|
|
959
|
+
function vs(e) {
|
|
960
960
|
let t;
|
|
961
961
|
if (Os(e)) {
|
|
962
|
-
const n =
|
|
962
|
+
const n = mt.get(e);
|
|
963
963
|
let s, r;
|
|
964
964
|
if (n)
|
|
965
965
|
({ prototype: s, members: r } = n);
|
|
966
966
|
else {
|
|
967
967
|
s = {}, r = /* @__PURE__ */ new Set();
|
|
968
968
|
for (const i of e.members)
|
|
969
|
-
i.kind != "oneof" && (i.fieldKind != "scalar" && i.fieldKind != "enum" || i.presence !=
|
|
970
|
-
|
|
969
|
+
i.kind != "oneof" && (i.fieldKind != "scalar" && i.fieldKind != "enum" || i.presence != oe && (r.add(i), s[i.localName] = Te(i)));
|
|
970
|
+
mt.set(e, { prototype: s, members: r });
|
|
971
971
|
}
|
|
972
972
|
t = Object.create(s), t.$typeName = e.typeName;
|
|
973
973
|
for (const i of e.members)
|
|
974
|
-
r.has(i) || i.kind == "field" && (i.fieldKind == "message" || (i.fieldKind == "scalar" || i.fieldKind == "enum") && i.presence !=
|
|
974
|
+
r.has(i) || i.kind == "field" && (i.fieldKind == "message" || (i.fieldKind == "scalar" || i.fieldKind == "enum") && i.presence != oe) || (t[i.localName] = Te(i));
|
|
975
975
|
} else {
|
|
976
976
|
t = {
|
|
977
977
|
$typeName: e.typeName
|
|
978
978
|
};
|
|
979
979
|
for (const n of e.members)
|
|
980
|
-
(n.kind == "oneof" || n.presence ==
|
|
980
|
+
(n.kind == "oneof" || n.presence == oe) && (t[n.localName] = Te(n));
|
|
981
981
|
}
|
|
982
982
|
return t;
|
|
983
983
|
}
|
|
984
984
|
function Os(e) {
|
|
985
985
|
switch (e.file.edition) {
|
|
986
|
-
case
|
|
986
|
+
case Ts:
|
|
987
987
|
return !1;
|
|
988
|
-
case
|
|
988
|
+
case Ss:
|
|
989
989
|
return !0;
|
|
990
990
|
default:
|
|
991
|
-
return e.fields.some((t) => t.presence !=
|
|
991
|
+
return e.fields.some((t) => t.presence != oe && t.fieldKind != "message" && !t.oneof);
|
|
992
992
|
}
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function Te(e) {
|
|
995
995
|
if (e.kind == "oneof")
|
|
996
996
|
return { case: void 0 };
|
|
997
997
|
if (e.fieldKind == "list")
|
|
@@ -999,21 +999,21 @@ function Ne(e) {
|
|
|
999
999
|
if (e.fieldKind == "map")
|
|
1000
1000
|
return {};
|
|
1001
1001
|
if (e.fieldKind == "message")
|
|
1002
|
-
return
|
|
1002
|
+
return _s;
|
|
1003
1003
|
const t = e.getDefaultValue();
|
|
1004
|
-
return t !== void 0 ? e.fieldKind == "scalar" && e.longAsString ? t.toString() : t : e.fieldKind == "scalar" ?
|
|
1004
|
+
return t !== void 0 ? e.fieldKind == "scalar" && e.longAsString ? t.toString() : t : e.fieldKind == "scalar" ? q(e.scalar, e.longAsString) : e.enum.values[0].number;
|
|
1005
1005
|
}
|
|
1006
|
-
class
|
|
1006
|
+
class Y extends Error {
|
|
1007
1007
|
constructor(t, n, s = "FieldValueInvalidError") {
|
|
1008
1008
|
super(n), this.name = s, this.field = () => t;
|
|
1009
1009
|
}
|
|
1010
1010
|
}
|
|
1011
|
-
const
|
|
1012
|
-
function
|
|
1013
|
-
if (globalThis[
|
|
1011
|
+
const Se = Symbol.for("@bufbuild/protobuf/text-encoding");
|
|
1012
|
+
function We() {
|
|
1013
|
+
if (globalThis[Se] == null) {
|
|
1014
1014
|
const e = new globalThis.TextEncoder(), t = new globalThis.TextDecoder();
|
|
1015
1015
|
let n;
|
|
1016
|
-
globalThis[
|
|
1016
|
+
globalThis[Se] = {
|
|
1017
1017
|
encodeUtf8(s) {
|
|
1018
1018
|
return e.encode(s);
|
|
1019
1019
|
},
|
|
@@ -1029,15 +1029,15 @@ function Xe() {
|
|
|
1029
1029
|
}
|
|
1030
1030
|
};
|
|
1031
1031
|
}
|
|
1032
|
-
return globalThis[
|
|
1032
|
+
return globalThis[Se];
|
|
1033
1033
|
}
|
|
1034
|
-
var
|
|
1034
|
+
var I;
|
|
1035
1035
|
(function(e) {
|
|
1036
1036
|
e[e.Varint = 0] = "Varint", e[e.Bit64 = 1] = "Bit64", e[e.LengthDelimited = 2] = "LengthDelimited", e[e.StartGroup = 3] = "StartGroup", e[e.EndGroup = 4] = "EndGroup", e[e.Bit32 = 5] = "Bit32";
|
|
1037
|
-
})(
|
|
1038
|
-
const
|
|
1039
|
-
class
|
|
1040
|
-
constructor(t =
|
|
1037
|
+
})(I || (I = {}));
|
|
1038
|
+
const In = 34028234663852886e22, Nn = -34028234663852886e22, Tn = 4294967295, Sn = 2147483647, kn = -2147483648;
|
|
1039
|
+
class Cs {
|
|
1040
|
+
constructor(t = We().encodeUtf8) {
|
|
1041
1041
|
this.encodeUtf8 = t, this.stack = [], this.chunks = [], this.buf = [];
|
|
1042
1042
|
}
|
|
1043
1043
|
/**
|
|
@@ -1092,7 +1092,7 @@ class Rs {
|
|
|
1092
1092
|
* Write a `uint32` value, an unsigned 32 bit varint.
|
|
1093
1093
|
*/
|
|
1094
1094
|
uint32(t) {
|
|
1095
|
-
for (
|
|
1095
|
+
for (pt(t); t > 127; )
|
|
1096
1096
|
this.buf.push(t & 127 | 128), t = t >>> 7;
|
|
1097
1097
|
return this.buf.push(t), this;
|
|
1098
1098
|
}
|
|
@@ -1100,7 +1100,7 @@ class Rs {
|
|
|
1100
1100
|
* Write a `int32` value, a signed 32 bit varint.
|
|
1101
1101
|
*/
|
|
1102
1102
|
int32(t) {
|
|
1103
|
-
return
|
|
1103
|
+
return ke(t), Ce(t, this.buf), this;
|
|
1104
1104
|
}
|
|
1105
1105
|
/**
|
|
1106
1106
|
* Write a `bool` value, a varint.
|
|
@@ -1125,7 +1125,7 @@ class Rs {
|
|
|
1125
1125
|
* Write a `float` value, 32-bit floating point number.
|
|
1126
1126
|
*/
|
|
1127
1127
|
float(t) {
|
|
1128
|
-
|
|
1128
|
+
Us(t);
|
|
1129
1129
|
let n = new Uint8Array(4);
|
|
1130
1130
|
return new DataView(n.buffer).setFloat32(0, t, !0), this.raw(n);
|
|
1131
1131
|
}
|
|
@@ -1140,7 +1140,7 @@ class Rs {
|
|
|
1140
1140
|
* Write a `fixed32` value, an unsigned, fixed-length 32-bit integer.
|
|
1141
1141
|
*/
|
|
1142
1142
|
fixed32(t) {
|
|
1143
|
-
|
|
1143
|
+
pt(t);
|
|
1144
1144
|
let n = new Uint8Array(4);
|
|
1145
1145
|
return new DataView(n.buffer).setUint32(0, t, !0), this.raw(n);
|
|
1146
1146
|
}
|
|
@@ -1148,7 +1148,7 @@ class Rs {
|
|
|
1148
1148
|
* Write a `sfixed32` value, a signed, fixed-length 32-bit integer.
|
|
1149
1149
|
*/
|
|
1150
1150
|
sfixed32(t) {
|
|
1151
|
-
|
|
1151
|
+
ke(t);
|
|
1152
1152
|
let n = new Uint8Array(4);
|
|
1153
1153
|
return new DataView(n.buffer).setInt32(0, t, !0), this.raw(n);
|
|
1154
1154
|
}
|
|
@@ -1156,7 +1156,7 @@ class Rs {
|
|
|
1156
1156
|
* Write a `sint32` value, a signed, zigzag-encoded 32-bit varint.
|
|
1157
1157
|
*/
|
|
1158
1158
|
sint32(t) {
|
|
1159
|
-
return
|
|
1159
|
+
return ke(t), t = (t << 1 ^ t >> 31) >>> 0, Ce(t, this.buf), this;
|
|
1160
1160
|
}
|
|
1161
1161
|
/**
|
|
1162
1162
|
* Write a `sfixed64` value, a signed, fixed-length 64-bit integer.
|
|
@@ -1177,26 +1177,26 @@ class Rs {
|
|
|
1177
1177
|
*/
|
|
1178
1178
|
int64(t) {
|
|
1179
1179
|
let n = w.enc(t);
|
|
1180
|
-
return
|
|
1180
|
+
return Ne(n.lo, n.hi, this.buf), this;
|
|
1181
1181
|
}
|
|
1182
1182
|
/**
|
|
1183
1183
|
* Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint.
|
|
1184
1184
|
*/
|
|
1185
1185
|
sint64(t) {
|
|
1186
1186
|
const n = w.enc(t), s = n.hi >> 31, r = n.lo << 1 ^ s, i = (n.hi << 1 | n.lo >>> 31) ^ s;
|
|
1187
|
-
return
|
|
1187
|
+
return Ne(r, i, this.buf), this;
|
|
1188
1188
|
}
|
|
1189
1189
|
/**
|
|
1190
1190
|
* Write a `uint64` value, an unsigned 64-bit varint.
|
|
1191
1191
|
*/
|
|
1192
1192
|
uint64(t) {
|
|
1193
1193
|
const n = w.uEnc(t);
|
|
1194
|
-
return
|
|
1194
|
+
return Ne(n.lo, n.hi, this.buf), this;
|
|
1195
1195
|
}
|
|
1196
1196
|
}
|
|
1197
|
-
class
|
|
1198
|
-
constructor(t, n =
|
|
1199
|
-
this.decodeUtf8 = n, this.varint64 =
|
|
1197
|
+
class Ds {
|
|
1198
|
+
constructor(t, n = We().decodeUtf8) {
|
|
1199
|
+
this.decodeUtf8 = n, this.varint64 = ms, this.uint32 = gs, this.buf = t, this.len = t.length, this.pos = 0, this.view = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
1200
1200
|
}
|
|
1201
1201
|
/**
|
|
1202
1202
|
* Reads a tag - field number and wire type. Tags are uint32 varints; values
|
|
@@ -1222,26 +1222,26 @@ class Cs {
|
|
|
1222
1222
|
skip(t, n, s = 100) {
|
|
1223
1223
|
let r = this.pos;
|
|
1224
1224
|
switch (t) {
|
|
1225
|
-
case
|
|
1225
|
+
case I.Varint:
|
|
1226
1226
|
for (; this.buf[this.pos++] & 128; )
|
|
1227
1227
|
;
|
|
1228
1228
|
break;
|
|
1229
1229
|
// @ts-ignore TS7029: Fallthrough case in switch -- ignore instead of expect-error for compiler settings without noFallthroughCasesInSwitch: true
|
|
1230
|
-
case
|
|
1230
|
+
case I.Bit64:
|
|
1231
1231
|
this.pos += 4;
|
|
1232
|
-
case
|
|
1232
|
+
case I.Bit32:
|
|
1233
1233
|
this.pos += 4;
|
|
1234
1234
|
break;
|
|
1235
|
-
case
|
|
1235
|
+
case I.LengthDelimited:
|
|
1236
1236
|
let i = this.uint32();
|
|
1237
1237
|
this.pos += i;
|
|
1238
1238
|
break;
|
|
1239
|
-
case
|
|
1239
|
+
case I.StartGroup:
|
|
1240
1240
|
if (s <= 0)
|
|
1241
1241
|
throw new Error("maximum recursion depth reached");
|
|
1242
1242
|
for (; ; ) {
|
|
1243
1243
|
const [a, o] = this.tag();
|
|
1244
|
-
if (o ===
|
|
1244
|
+
if (o === I.EndGroup) {
|
|
1245
1245
|
if (n !== void 0 && a !== n)
|
|
1246
1246
|
throw new Error("invalid end group tag");
|
|
1247
1247
|
break;
|
|
@@ -1351,82 +1351,82 @@ class Cs {
|
|
|
1351
1351
|
return this.decodeUtf8(this.bytes(), t);
|
|
1352
1352
|
}
|
|
1353
1353
|
}
|
|
1354
|
-
function
|
|
1354
|
+
function ke(e) {
|
|
1355
1355
|
if (typeof e == "string")
|
|
1356
1356
|
e = Number(e);
|
|
1357
1357
|
else if (typeof e != "number")
|
|
1358
1358
|
throw new Error("invalid int32: " + typeof e);
|
|
1359
|
-
if (!Number.isInteger(e) || e >
|
|
1359
|
+
if (!Number.isInteger(e) || e > Sn || e < kn)
|
|
1360
1360
|
throw new Error("invalid int32: " + e);
|
|
1361
1361
|
}
|
|
1362
|
-
function
|
|
1362
|
+
function pt(e) {
|
|
1363
1363
|
if (typeof e == "string")
|
|
1364
1364
|
e = Number(e);
|
|
1365
1365
|
else if (typeof e != "number")
|
|
1366
1366
|
throw new Error("invalid uint32: " + typeof e);
|
|
1367
|
-
if (!Number.isInteger(e) || e >
|
|
1367
|
+
if (!Number.isInteger(e) || e > Tn || e < 0)
|
|
1368
1368
|
throw new Error("invalid uint32: " + e);
|
|
1369
1369
|
}
|
|
1370
|
-
function
|
|
1370
|
+
function Us(e) {
|
|
1371
1371
|
if (typeof e == "string") {
|
|
1372
1372
|
const t = e;
|
|
1373
1373
|
if (e = Number(e), Number.isNaN(e) && t !== "NaN")
|
|
1374
1374
|
throw new Error("invalid float32: " + t);
|
|
1375
1375
|
} else if (typeof e != "number")
|
|
1376
1376
|
throw new Error("invalid float32: " + typeof e);
|
|
1377
|
-
if (Number.isFinite(e) && (e >
|
|
1377
|
+
if (Number.isFinite(e) && (e > In || e < Nn))
|
|
1378
1378
|
throw new Error("invalid float32: " + e);
|
|
1379
1379
|
}
|
|
1380
|
-
function
|
|
1381
|
-
const n = e.fieldKind == "list" ?
|
|
1380
|
+
function Ls(e, t) {
|
|
1381
|
+
const n = e.fieldKind == "list" ? Be(t, e) : e.fieldKind == "map" ? Ye(t, e) : je(e, t);
|
|
1382
1382
|
if (n === !0)
|
|
1383
1383
|
return;
|
|
1384
1384
|
let s;
|
|
1385
1385
|
switch (e.fieldKind) {
|
|
1386
1386
|
case "list":
|
|
1387
|
-
s = `expected ${
|
|
1387
|
+
s = `expected ${Rn(e)}, got ${de(t)}`;
|
|
1388
1388
|
break;
|
|
1389
1389
|
case "map":
|
|
1390
|
-
s = `expected ${_n(e)}, got ${
|
|
1390
|
+
s = `expected ${_n(e)}, got ${de(t)}`;
|
|
1391
1391
|
break;
|
|
1392
1392
|
default:
|
|
1393
|
-
s =
|
|
1393
|
+
s = le(e, t, n);
|
|
1394
1394
|
}
|
|
1395
|
-
return new
|
|
1395
|
+
return new Y(e, s);
|
|
1396
1396
|
}
|
|
1397
|
-
function
|
|
1398
|
-
const s =
|
|
1397
|
+
function bt(e, t, n) {
|
|
1398
|
+
const s = je(e, n);
|
|
1399
1399
|
if (s !== !0)
|
|
1400
|
-
return new
|
|
1400
|
+
return new Y(e, `list item #${t + 1}: ${le(e, n, s)}`);
|
|
1401
1401
|
}
|
|
1402
|
-
function
|
|
1403
|
-
const s =
|
|
1402
|
+
function Ms(e, t, n) {
|
|
1403
|
+
const s = De(t, e.mapKey);
|
|
1404
1404
|
if (s !== !0)
|
|
1405
|
-
return new
|
|
1406
|
-
const r =
|
|
1405
|
+
return new Y(e, `invalid map key: ${le({ scalar: e.mapKey }, t, s)}`);
|
|
1406
|
+
const r = je(e, n);
|
|
1407
1407
|
if (r !== !0)
|
|
1408
|
-
return new
|
|
1408
|
+
return new Y(e, `map entry ${de(t)}: ${le(e, n, r)}`);
|
|
1409
1409
|
}
|
|
1410
|
-
function
|
|
1411
|
-
return e.scalar !== void 0 ?
|
|
1410
|
+
function je(e, t) {
|
|
1411
|
+
return e.scalar !== void 0 ? De(t, e.scalar) : e.enum !== void 0 ? e.enum.open ? De(t, c.INT32) : e.enum.values.some((n) => n.number === t) : $e(t, e.message);
|
|
1412
1412
|
}
|
|
1413
|
-
function
|
|
1413
|
+
function De(e, t) {
|
|
1414
1414
|
switch (t) {
|
|
1415
1415
|
case c.DOUBLE:
|
|
1416
1416
|
return typeof e == "number";
|
|
1417
1417
|
case c.FLOAT:
|
|
1418
|
-
return typeof e != "number" ? !1 : Number.isNaN(e) || !Number.isFinite(e) ? !0 : e >
|
|
1418
|
+
return typeof e != "number" ? !1 : Number.isNaN(e) || !Number.isFinite(e) ? !0 : e > In || e < Nn ? `${e.toFixed()} out of range` : !0;
|
|
1419
1419
|
case c.INT32:
|
|
1420
1420
|
case c.SFIXED32:
|
|
1421
1421
|
case c.SINT32:
|
|
1422
|
-
return typeof e != "number" || !Number.isInteger(e) ? !1 : e >
|
|
1422
|
+
return typeof e != "number" || !Number.isInteger(e) ? !1 : e > Sn || e < kn ? `${e.toFixed()} out of range` : !0;
|
|
1423
1423
|
case c.FIXED32:
|
|
1424
1424
|
case c.UINT32:
|
|
1425
|
-
return typeof e != "number" || !Number.isInteger(e) ? !1 : e >
|
|
1425
|
+
return typeof e != "number" || !Number.isInteger(e) ? !1 : e > Tn || e < 0 ? `${e.toFixed()} out of range` : !0;
|
|
1426
1426
|
case c.BOOL:
|
|
1427
1427
|
return typeof e == "boolean";
|
|
1428
1428
|
case c.STRING:
|
|
1429
|
-
return typeof e != "string" ? !1 :
|
|
1429
|
+
return typeof e != "string" ? !1 : We().checkUtf8(e) || "invalid UTF8";
|
|
1430
1430
|
case c.BYTES:
|
|
1431
1431
|
return e instanceof Uint8Array;
|
|
1432
1432
|
case c.INT64:
|
|
@@ -1450,13 +1450,13 @@ function ve(e, t) {
|
|
|
1450
1450
|
return !1;
|
|
1451
1451
|
}
|
|
1452
1452
|
}
|
|
1453
|
-
function
|
|
1454
|
-
return n = typeof n == "string" ? `: ${n}` : `, got ${
|
|
1453
|
+
function le(e, t, n) {
|
|
1454
|
+
return n = typeof n == "string" ? `: ${n}` : `, got ${de(t)}`, e.scalar !== void 0 ? `expected ${xs(e.scalar)}` + n : e.enum !== void 0 ? `expected ${e.enum.toString()}` + n : `expected ${An(e.message)}` + n;
|
|
1455
1455
|
}
|
|
1456
|
-
function
|
|
1456
|
+
function de(e) {
|
|
1457
1457
|
switch (typeof e) {
|
|
1458
1458
|
case "object":
|
|
1459
|
-
return e === null ? "null" : e instanceof Uint8Array ? `Uint8Array(${e.length})` : Array.isArray(e) ? `Array(${e.length})` :
|
|
1459
|
+
return e === null ? "null" : e instanceof Uint8Array ? `Uint8Array(${e.length})` : Array.isArray(e) ? `Array(${e.length})` : Be(e) ? Rn(e.field()) : Ye(e) ? _n(e.field()) : $e(e) ? An(e.desc) : Fe(e) ? `message ${e.$typeName}` : "object";
|
|
1460
1460
|
case "string":
|
|
1461
1461
|
return e.length > 30 ? "string" : `"${e.split('"').join('\\"')}"`;
|
|
1462
1462
|
case "boolean":
|
|
@@ -1469,10 +1469,10 @@ function ue(e) {
|
|
|
1469
1469
|
return typeof e;
|
|
1470
1470
|
}
|
|
1471
1471
|
}
|
|
1472
|
-
function
|
|
1472
|
+
function An(e) {
|
|
1473
1473
|
return `ReflectMessage (${e.typeName})`;
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1475
|
+
function Rn(e) {
|
|
1476
1476
|
switch (e.listKind) {
|
|
1477
1477
|
case "message":
|
|
1478
1478
|
return `ReflectList (${e.message.toString()})`;
|
|
@@ -1492,7 +1492,7 @@ function _n(e) {
|
|
|
1492
1492
|
return `ReflectMap (${c[e.mapKey]}, ${c[e.scalar]})`;
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
|
-
function
|
|
1495
|
+
function xs(e) {
|
|
1496
1496
|
switch (e) {
|
|
1497
1497
|
case c.STRING:
|
|
1498
1498
|
return "string";
|
|
@@ -1520,68 +1520,68 @@ function Us(e) {
|
|
|
1520
1520
|
return "number (int32)";
|
|
1521
1521
|
}
|
|
1522
1522
|
}
|
|
1523
|
-
const
|
|
1524
|
-
function
|
|
1525
|
-
return new
|
|
1523
|
+
const Ps = 0;
|
|
1524
|
+
function ge(e, t, n = !0) {
|
|
1525
|
+
return new vn(e, t, n);
|
|
1526
1526
|
}
|
|
1527
|
-
const
|
|
1528
|
-
class
|
|
1527
|
+
const gt = /* @__PURE__ */ new WeakMap();
|
|
1528
|
+
class vn {
|
|
1529
1529
|
get sortedFields() {
|
|
1530
|
-
const t =
|
|
1530
|
+
const t = gt.get(this.desc);
|
|
1531
1531
|
if (t)
|
|
1532
1532
|
return t;
|
|
1533
1533
|
const n = this.desc.fields.concat().sort((s, r) => s.number - r.number);
|
|
1534
|
-
return
|
|
1534
|
+
return gt.set(this.desc, n), n;
|
|
1535
1535
|
}
|
|
1536
1536
|
constructor(t, n, s = !0) {
|
|
1537
|
-
this.lists = /* @__PURE__ */ new Map(), this.maps = /* @__PURE__ */ new Map(), this.check = s, this.desc = t, this.message = this[
|
|
1537
|
+
this.lists = /* @__PURE__ */ new Map(), this.maps = /* @__PURE__ */ new Map(), this.check = s, this.desc = t, this.message = this[M] = n ?? C(t), this.fields = t.fields, this.oneofs = t.oneofs, this.members = t.members;
|
|
1538
1538
|
}
|
|
1539
1539
|
findNumber(t) {
|
|
1540
1540
|
return this._fieldsByNumber || (this._fieldsByNumber = new Map(this.desc.fields.map((n) => [n.number, n]))), this._fieldsByNumber.get(t);
|
|
1541
1541
|
}
|
|
1542
1542
|
oneofCase(t) {
|
|
1543
|
-
return
|
|
1543
|
+
return K(this.message, t), pn(this.message, t);
|
|
1544
1544
|
}
|
|
1545
1545
|
isSet(t) {
|
|
1546
|
-
return
|
|
1546
|
+
return K(this.message, t), ws(this.message, t);
|
|
1547
1547
|
}
|
|
1548
1548
|
clear(t) {
|
|
1549
|
-
|
|
1549
|
+
K(this.message, t), Is(this.message, t);
|
|
1550
1550
|
}
|
|
1551
1551
|
get(t) {
|
|
1552
|
-
|
|
1553
|
-
const n =
|
|
1552
|
+
K(this.message, t);
|
|
1553
|
+
const n = bn(this.message, t);
|
|
1554
1554
|
switch (t.fieldKind) {
|
|
1555
1555
|
case "list":
|
|
1556
1556
|
let s = this.lists.get(t);
|
|
1557
|
-
return (!s || s[
|
|
1557
|
+
return (!s || s[M] !== n) && this.lists.set(
|
|
1558
1558
|
t,
|
|
1559
1559
|
// biome-ignore lint/suspicious/noAssignInExpressions: no
|
|
1560
|
-
s = new
|
|
1560
|
+
s = new Vs(t, n, this.check)
|
|
1561
1561
|
), s;
|
|
1562
1562
|
case "map":
|
|
1563
1563
|
let r = this.maps.get(t);
|
|
1564
|
-
return (!r || r[
|
|
1564
|
+
return (!r || r[M] !== n) && this.maps.set(
|
|
1565
1565
|
t,
|
|
1566
1566
|
// biome-ignore lint/suspicious/noAssignInExpressions: no
|
|
1567
|
-
r = new
|
|
1567
|
+
r = new Fs(t, n, this.check)
|
|
1568
1568
|
), r;
|
|
1569
1569
|
case "message":
|
|
1570
|
-
return
|
|
1570
|
+
return He(t, n, this.check);
|
|
1571
1571
|
case "scalar":
|
|
1572
|
-
return n === void 0 ?
|
|
1572
|
+
return n === void 0 ? q(t.scalar, !1) : Ze(t, n);
|
|
1573
1573
|
case "enum":
|
|
1574
1574
|
return n ?? t.enum.values[0].number;
|
|
1575
1575
|
}
|
|
1576
1576
|
}
|
|
1577
1577
|
set(t, n) {
|
|
1578
|
-
if (
|
|
1579
|
-
const r =
|
|
1578
|
+
if (K(this.message, t), this.check) {
|
|
1579
|
+
const r = Ls(t, n);
|
|
1580
1580
|
if (r)
|
|
1581
1581
|
throw r;
|
|
1582
1582
|
}
|
|
1583
1583
|
let s;
|
|
1584
|
-
t.fieldKind == "message" ? s =
|
|
1584
|
+
t.fieldKind == "message" ? s = qe(t, n) : Ye(n) || Be(n) ? s = n[M] : s = ze(t, n), gn(this.message, t, s);
|
|
1585
1585
|
}
|
|
1586
1586
|
getUnknown() {
|
|
1587
1587
|
return this.message.$unknown;
|
|
@@ -1590,11 +1590,11 @@ class On {
|
|
|
1590
1590
|
this.message.$unknown = t;
|
|
1591
1591
|
}
|
|
1592
1592
|
}
|
|
1593
|
-
function
|
|
1593
|
+
function K(e, t) {
|
|
1594
1594
|
if (t.parent.typeName !== e.$typeName)
|
|
1595
|
-
throw new
|
|
1595
|
+
throw new Y(t, `cannot use ${t.toString()} with message ${e.$typeName}`, "ForeignFieldError");
|
|
1596
1596
|
}
|
|
1597
|
-
class
|
|
1597
|
+
class Vs {
|
|
1598
1598
|
field() {
|
|
1599
1599
|
return this._field;
|
|
1600
1600
|
}
|
|
@@ -1602,29 +1602,29 @@ class Ms {
|
|
|
1602
1602
|
return this._arr.length;
|
|
1603
1603
|
}
|
|
1604
1604
|
constructor(t, n, s) {
|
|
1605
|
-
this._field = t, this._arr = this[
|
|
1605
|
+
this._field = t, this._arr = this[M] = n, this.check = s;
|
|
1606
1606
|
}
|
|
1607
1607
|
get(t) {
|
|
1608
1608
|
const n = this._arr[t];
|
|
1609
|
-
return n === void 0 ? void 0 :
|
|
1609
|
+
return n === void 0 ? void 0 : Ae(this._field, n, this.check);
|
|
1610
1610
|
}
|
|
1611
1611
|
set(t, n) {
|
|
1612
1612
|
if (t < 0 || t >= this._arr.length)
|
|
1613
|
-
throw new
|
|
1613
|
+
throw new Y(this._field, `list item #${t + 1}: out of range`);
|
|
1614
1614
|
if (this.check) {
|
|
1615
|
-
const s =
|
|
1615
|
+
const s = bt(this._field, t, n);
|
|
1616
1616
|
if (s)
|
|
1617
1617
|
throw s;
|
|
1618
1618
|
}
|
|
1619
|
-
this._arr[t] =
|
|
1619
|
+
this._arr[t] = Et(this._field, n);
|
|
1620
1620
|
}
|
|
1621
1621
|
add(t) {
|
|
1622
1622
|
if (this.check) {
|
|
1623
|
-
const n =
|
|
1623
|
+
const n = bt(this._field, this._arr.length, t);
|
|
1624
1624
|
if (n)
|
|
1625
1625
|
throw n;
|
|
1626
1626
|
}
|
|
1627
|
-
this._arr.push(
|
|
1627
|
+
this._arr.push(Et(this._field, t));
|
|
1628
1628
|
}
|
|
1629
1629
|
clear() {
|
|
1630
1630
|
this._arr.splice(0, this._arr.length);
|
|
@@ -1637,27 +1637,27 @@ class Ms {
|
|
|
1637
1637
|
}
|
|
1638
1638
|
*values() {
|
|
1639
1639
|
for (const t of this._arr)
|
|
1640
|
-
yield
|
|
1640
|
+
yield Ae(this._field, t, this.check);
|
|
1641
1641
|
}
|
|
1642
1642
|
*entries() {
|
|
1643
1643
|
for (let t = 0; t < this._arr.length; t++)
|
|
1644
|
-
yield [t,
|
|
1644
|
+
yield [t, Ae(this._field, this._arr[t], this.check)];
|
|
1645
1645
|
}
|
|
1646
1646
|
}
|
|
1647
|
-
class
|
|
1647
|
+
class Fs {
|
|
1648
1648
|
constructor(t, n, s = !0) {
|
|
1649
|
-
this.obj = this[
|
|
1649
|
+
this.obj = this[M] = n ?? {}, this.check = s, this._field = t;
|
|
1650
1650
|
}
|
|
1651
1651
|
field() {
|
|
1652
1652
|
return this._field;
|
|
1653
1653
|
}
|
|
1654
1654
|
set(t, n) {
|
|
1655
1655
|
if (this.check) {
|
|
1656
|
-
const s =
|
|
1656
|
+
const s = Ms(this._field, t, n);
|
|
1657
1657
|
if (s)
|
|
1658
1658
|
throw s;
|
|
1659
1659
|
}
|
|
1660
|
-
return this.obj[J(t)] =
|
|
1660
|
+
return this.obj[J(t)] = Gs(this._field, n), this;
|
|
1661
1661
|
}
|
|
1662
1662
|
delete(t) {
|
|
1663
1663
|
const n = J(t), s = Object.prototype.hasOwnProperty.call(this.obj, n);
|
|
@@ -1669,20 +1669,20 @@ class Vs {
|
|
|
1669
1669
|
}
|
|
1670
1670
|
get(t) {
|
|
1671
1671
|
let n = this.obj[J(t)];
|
|
1672
|
-
return n !== void 0 && (n =
|
|
1672
|
+
return n !== void 0 && (n = Re(this._field, n, this.check)), n;
|
|
1673
1673
|
}
|
|
1674
1674
|
has(t) {
|
|
1675
1675
|
return Object.prototype.hasOwnProperty.call(this.obj, J(t));
|
|
1676
1676
|
}
|
|
1677
1677
|
*keys() {
|
|
1678
1678
|
for (const t of Object.keys(this.obj))
|
|
1679
|
-
yield
|
|
1679
|
+
yield yt(t, this._field.mapKey);
|
|
1680
1680
|
}
|
|
1681
1681
|
*entries() {
|
|
1682
1682
|
for (const t of Object.entries(this.obj))
|
|
1683
1683
|
yield [
|
|
1684
|
-
|
|
1685
|
-
|
|
1684
|
+
yt(t[0], this._field.mapKey),
|
|
1685
|
+
Re(this._field, t[1], this.check)
|
|
1686
1686
|
];
|
|
1687
1687
|
}
|
|
1688
1688
|
[Symbol.iterator]() {
|
|
@@ -1693,38 +1693,38 @@ class Vs {
|
|
|
1693
1693
|
}
|
|
1694
1694
|
*values() {
|
|
1695
1695
|
for (const t of Object.values(this.obj))
|
|
1696
|
-
yield
|
|
1696
|
+
yield Re(this._field, t, this.check);
|
|
1697
1697
|
}
|
|
1698
1698
|
forEach(t, n) {
|
|
1699
1699
|
for (const s of this.entries())
|
|
1700
1700
|
t.call(n, s[1], s[0], this);
|
|
1701
1701
|
}
|
|
1702
1702
|
}
|
|
1703
|
-
function
|
|
1704
|
-
return
|
|
1703
|
+
function qe(e, t) {
|
|
1704
|
+
return $e(t) ? Ns(t.message) && !e.oneof && e.fieldKind == "message" ? t.message.value : t.desc.typeName == "google.protobuf.Struct" && e.parent.typeName != "google.protobuf.Value" ? Cn(t.message) : t.message : t;
|
|
1705
1705
|
}
|
|
1706
|
-
function
|
|
1707
|
-
return t !== void 0 && (
|
|
1706
|
+
function He(e, t, n) {
|
|
1707
|
+
return t !== void 0 && (En(e.message) && !e.oneof && e.fieldKind == "message" ? t = {
|
|
1708
1708
|
$typeName: e.message.typeName,
|
|
1709
|
-
value:
|
|
1710
|
-
} : e.message.typeName == "google.protobuf.Struct" && e.parent.typeName != "google.protobuf.Value" &&
|
|
1709
|
+
value: Ze(e.message.fields[0], t)
|
|
1710
|
+
} : e.message.typeName == "google.protobuf.Struct" && e.parent.typeName != "google.protobuf.Value" && P(t) && (t = On(t))), new vn(e.message, t, n);
|
|
1711
1711
|
}
|
|
1712
|
-
function
|
|
1713
|
-
return e.listKind == "message" ?
|
|
1712
|
+
function Et(e, t) {
|
|
1713
|
+
return e.listKind == "message" ? qe(e, t) : ze(e, t);
|
|
1714
1714
|
}
|
|
1715
|
-
function
|
|
1716
|
-
return e.listKind == "message" ?
|
|
1715
|
+
function Ae(e, t, n) {
|
|
1716
|
+
return e.listKind == "message" ? He(e, t, n) : Ze(e, t);
|
|
1717
1717
|
}
|
|
1718
|
-
function
|
|
1719
|
-
return e.mapKind == "message" ?
|
|
1718
|
+
function Gs(e, t) {
|
|
1719
|
+
return e.mapKind == "message" ? qe(e, t) : ze(e, t);
|
|
1720
1720
|
}
|
|
1721
|
-
function
|
|
1722
|
-
return e.mapKind == "message" ?
|
|
1721
|
+
function Re(e, t, n) {
|
|
1722
|
+
return e.mapKind == "message" ? He(e, t, n) : t;
|
|
1723
1723
|
}
|
|
1724
1724
|
function J(e) {
|
|
1725
1725
|
return typeof e == "string" || typeof e == "number" ? e : String(e);
|
|
1726
1726
|
}
|
|
1727
|
-
function
|
|
1727
|
+
function yt(e, t) {
|
|
1728
1728
|
switch (t) {
|
|
1729
1729
|
case c.STRING:
|
|
1730
1730
|
return e;
|
|
@@ -1762,7 +1762,7 @@ function Et(e, t) {
|
|
|
1762
1762
|
}
|
|
1763
1763
|
return e;
|
|
1764
1764
|
}
|
|
1765
|
-
function
|
|
1765
|
+
function Ze(e, t) {
|
|
1766
1766
|
switch (e.scalar) {
|
|
1767
1767
|
case c.INT64:
|
|
1768
1768
|
case c.SFIXED64:
|
|
@@ -1776,7 +1776,7 @@ function He(e, t) {
|
|
|
1776
1776
|
}
|
|
1777
1777
|
return t;
|
|
1778
1778
|
}
|
|
1779
|
-
function
|
|
1779
|
+
function ze(e, t) {
|
|
1780
1780
|
switch (e.scalar) {
|
|
1781
1781
|
case c.INT64:
|
|
1782
1782
|
case c.SFIXED64:
|
|
@@ -1790,28 +1790,28 @@ function Ze(e, t) {
|
|
|
1790
1790
|
}
|
|
1791
1791
|
return t;
|
|
1792
1792
|
}
|
|
1793
|
-
function
|
|
1793
|
+
function On(e) {
|
|
1794
1794
|
const t = {
|
|
1795
1795
|
$typeName: "google.protobuf.Struct",
|
|
1796
1796
|
fields: {}
|
|
1797
1797
|
};
|
|
1798
|
-
if (
|
|
1798
|
+
if (P(e))
|
|
1799
1799
|
for (const [n, s] of Object.entries(e))
|
|
1800
|
-
t.fields[n] =
|
|
1800
|
+
t.fields[n] = Un(s);
|
|
1801
1801
|
return t;
|
|
1802
1802
|
}
|
|
1803
1803
|
function Cn(e) {
|
|
1804
1804
|
const t = {};
|
|
1805
1805
|
for (const [n, s] of Object.entries(e.fields))
|
|
1806
|
-
t[n] =
|
|
1806
|
+
t[n] = Dn(s);
|
|
1807
1807
|
return t;
|
|
1808
1808
|
}
|
|
1809
|
-
function
|
|
1809
|
+
function Dn(e) {
|
|
1810
1810
|
switch (e.kind.case) {
|
|
1811
1811
|
case "structValue":
|
|
1812
1812
|
return Cn(e.kind.value);
|
|
1813
1813
|
case "listValue":
|
|
1814
|
-
return e.kind.value.values.map(
|
|
1814
|
+
return e.kind.value.values.map(Dn);
|
|
1815
1815
|
case "nullValue":
|
|
1816
1816
|
case void 0:
|
|
1817
1817
|
return null;
|
|
@@ -1819,7 +1819,7 @@ function vn(e) {
|
|
|
1819
1819
|
return e.kind.value;
|
|
1820
1820
|
}
|
|
1821
1821
|
}
|
|
1822
|
-
function
|
|
1822
|
+
function Un(e) {
|
|
1823
1823
|
const t = {
|
|
1824
1824
|
$typeName: "google.protobuf.Value",
|
|
1825
1825
|
kind: { case: void 0 }
|
|
@@ -1836,7 +1836,7 @@ function Dn(e) {
|
|
|
1836
1836
|
break;
|
|
1837
1837
|
case "object":
|
|
1838
1838
|
if (e === null)
|
|
1839
|
-
t.kind = { case: "nullValue", value:
|
|
1839
|
+
t.kind = { case: "nullValue", value: Ps };
|
|
1840
1840
|
else if (Array.isArray(e)) {
|
|
1841
1841
|
const n = {
|
|
1842
1842
|
$typeName: "google.protobuf.ListValue",
|
|
@@ -1844,7 +1844,7 @@ function Dn(e) {
|
|
|
1844
1844
|
};
|
|
1845
1845
|
if (Array.isArray(e))
|
|
1846
1846
|
for (const s of e)
|
|
1847
|
-
n.values.push(
|
|
1847
|
+
n.values.push(Un(s));
|
|
1848
1848
|
t.kind = {
|
|
1849
1849
|
case: "listValue",
|
|
1850
1850
|
value: n
|
|
@@ -1852,14 +1852,14 @@ function Dn(e) {
|
|
|
1852
1852
|
} else
|
|
1853
1853
|
t.kind = {
|
|
1854
1854
|
case: "structValue",
|
|
1855
|
-
value:
|
|
1855
|
+
value: On(e)
|
|
1856
1856
|
};
|
|
1857
1857
|
break;
|
|
1858
1858
|
}
|
|
1859
1859
|
return t;
|
|
1860
1860
|
}
|
|
1861
|
-
function
|
|
1862
|
-
const t =
|
|
1861
|
+
function Bs(e) {
|
|
1862
|
+
const t = $s();
|
|
1863
1863
|
let n = e.length * 3 / 4;
|
|
1864
1864
|
e[e.length - 2] == "=" ? n -= 2 : e[e.length - 1] == "=" && (n -= 1);
|
|
1865
1865
|
let s = new Uint8Array(n), r = 0, i = 0, a, o = 0;
|
|
@@ -1899,21 +1899,21 @@ function Ps(e) {
|
|
|
1899
1899
|
throw Error("invalid base64 string");
|
|
1900
1900
|
return s.subarray(0, r);
|
|
1901
1901
|
}
|
|
1902
|
-
let
|
|
1903
|
-
function
|
|
1904
|
-
return
|
|
1902
|
+
let ee, G;
|
|
1903
|
+
function Ys(e) {
|
|
1904
|
+
return ee || (ee = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), ee.slice(0, -2).concat("-", "_")), ee;
|
|
1905
1905
|
}
|
|
1906
|
-
function
|
|
1907
|
-
if (!
|
|
1908
|
-
|
|
1909
|
-
const e =
|
|
1906
|
+
function $s() {
|
|
1907
|
+
if (!G) {
|
|
1908
|
+
G = [];
|
|
1909
|
+
const e = Ys();
|
|
1910
1910
|
for (let t = 0; t < e.length; t++)
|
|
1911
|
-
|
|
1912
|
-
|
|
1911
|
+
G[e[t].charCodeAt(0)] = t;
|
|
1912
|
+
G[45] = e.indexOf("+"), G[95] = e.indexOf("/");
|
|
1913
1913
|
}
|
|
1914
|
-
return
|
|
1914
|
+
return G;
|
|
1915
1915
|
}
|
|
1916
|
-
function
|
|
1916
|
+
function he(e) {
|
|
1917
1917
|
let t = !1;
|
|
1918
1918
|
const n = [];
|
|
1919
1919
|
for (let s = 0; s < e.length; s++) {
|
|
@@ -1941,33 +1941,33 @@ function le(e) {
|
|
|
1941
1941
|
}
|
|
1942
1942
|
return n.join("");
|
|
1943
1943
|
}
|
|
1944
|
-
const
|
|
1944
|
+
const Xs = /* @__PURE__ */ new Set([
|
|
1945
1945
|
// names reserved by JavaScript
|
|
1946
1946
|
"constructor",
|
|
1947
1947
|
"toString",
|
|
1948
1948
|
"toJSON",
|
|
1949
1949
|
"valueOf"
|
|
1950
1950
|
]);
|
|
1951
|
-
function
|
|
1952
|
-
return
|
|
1951
|
+
function Z(e) {
|
|
1952
|
+
return Xs.has(e) ? e + "$" : e;
|
|
1953
1953
|
}
|
|
1954
|
-
function
|
|
1954
|
+
function Qe(e) {
|
|
1955
1955
|
for (const t of e.field)
|
|
1956
|
-
|
|
1957
|
-
e.nestedType.forEach(
|
|
1956
|
+
H(t, "jsonName") || (t.jsonName = he(t.name));
|
|
1957
|
+
e.nestedType.forEach(Qe);
|
|
1958
1958
|
}
|
|
1959
|
-
function
|
|
1959
|
+
function Ks(e, t) {
|
|
1960
1960
|
const n = e.values.find((s) => s.name === t);
|
|
1961
1961
|
if (!n)
|
|
1962
1962
|
throw new Error(`cannot parse ${e} default value: ${t}`);
|
|
1963
1963
|
return n.number;
|
|
1964
1964
|
}
|
|
1965
|
-
function
|
|
1965
|
+
function Ws(e, t) {
|
|
1966
1966
|
switch (e) {
|
|
1967
1967
|
case c.STRING:
|
|
1968
1968
|
return t;
|
|
1969
1969
|
case c.BYTES: {
|
|
1970
|
-
const n =
|
|
1970
|
+
const n = js(t);
|
|
1971
1971
|
if (n === !1)
|
|
1972
1972
|
throw new Error(`cannot parse ${c[e]} default value: ${t}`);
|
|
1973
1973
|
return n;
|
|
@@ -2001,7 +2001,7 @@ function Ks(e, t) {
|
|
|
2001
2001
|
return parseInt(t, 10);
|
|
2002
2002
|
}
|
|
2003
2003
|
}
|
|
2004
|
-
function
|
|
2004
|
+
function js(e) {
|
|
2005
2005
|
const t = [], n = {
|
|
2006
2006
|
tail: e,
|
|
2007
2007
|
c: "",
|
|
@@ -2095,27 +2095,27 @@ function Xs(e) {
|
|
|
2095
2095
|
}
|
|
2096
2096
|
return new Uint8Array(t);
|
|
2097
2097
|
}
|
|
2098
|
-
function*
|
|
2098
|
+
function* Ue(e) {
|
|
2099
2099
|
switch (e.kind) {
|
|
2100
2100
|
case "file":
|
|
2101
2101
|
for (const t of e.messages)
|
|
2102
|
-
yield t, yield*
|
|
2102
|
+
yield t, yield* Ue(t);
|
|
2103
2103
|
yield* e.enums, yield* e.services, yield* e.extensions;
|
|
2104
2104
|
break;
|
|
2105
2105
|
case "message":
|
|
2106
2106
|
for (const t of e.nestedMessages)
|
|
2107
|
-
yield t, yield*
|
|
2107
|
+
yield t, yield* Ue(t);
|
|
2108
2108
|
yield* e.nestedEnums, yield* e.nestedExtensions;
|
|
2109
2109
|
break;
|
|
2110
2110
|
}
|
|
2111
2111
|
}
|
|
2112
2112
|
function Ln(...e) {
|
|
2113
|
-
const t =
|
|
2113
|
+
const t = qs();
|
|
2114
2114
|
if (!e.length)
|
|
2115
2115
|
return t;
|
|
2116
2116
|
if ("$typeName" in e[0] && e[0].$typeName == "google.protobuf.FileDescriptorSet") {
|
|
2117
2117
|
for (const n of e[0].file)
|
|
2118
|
-
|
|
2118
|
+
Tt(n, t);
|
|
2119
2119
|
return t;
|
|
2120
2120
|
}
|
|
2121
2121
|
if ("$typeName" in e[0]) {
|
|
@@ -2133,14 +2133,14 @@ function Ln(...e) {
|
|
|
2133
2133
|
};
|
|
2134
2134
|
const n = e[0], s = e[1], r = /* @__PURE__ */ new Set();
|
|
2135
2135
|
for (const a of [n, ...i(n)].reverse())
|
|
2136
|
-
|
|
2136
|
+
Tt(a, t);
|
|
2137
2137
|
} else
|
|
2138
2138
|
for (const n of e)
|
|
2139
2139
|
for (const s of n.files)
|
|
2140
2140
|
t.addFile(s);
|
|
2141
2141
|
return t;
|
|
2142
2142
|
}
|
|
2143
|
-
function
|
|
2143
|
+
function qs() {
|
|
2144
2144
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
2145
2145
|
return {
|
|
2146
2146
|
kind: "registry",
|
|
@@ -2154,7 +2154,7 @@ function Ws() {
|
|
|
2154
2154
|
},
|
|
2155
2155
|
addFile(s, r, i) {
|
|
2156
2156
|
if (n.set(s.proto.name, s), !r)
|
|
2157
|
-
for (const a of
|
|
2157
|
+
for (const a of Ue(s))
|
|
2158
2158
|
this.add(a);
|
|
2159
2159
|
if (i)
|
|
2160
2160
|
for (const a of s.dependencies)
|
|
@@ -2199,7 +2199,7 @@ function Ws() {
|
|
|
2199
2199
|
}
|
|
2200
2200
|
};
|
|
2201
2201
|
}
|
|
2202
|
-
const
|
|
2202
|
+
const Hs = 998, Zs = 999, zs = 9999, Qs = 9, z = 10, j = 11, Js = 12, wt = 14, Je = 3, er = 2, It = 1, tr = 0, _e = 1, Nt = 2, nr = 3, sr = 1, rr = 2, ir = 1, ar = 2, or = 1001, Mn = {
|
|
2203
2203
|
// EDITION_PROTO2
|
|
2204
2204
|
998: {
|
|
2205
2205
|
fieldPresence: 1,
|
|
@@ -2277,15 +2277,15 @@ const js = 998, qs = 999, Hs = 9999, Zs = 9, q = 10, K = 11, Js = 12, yt = 14, z
|
|
|
2277
2277
|
// EXPORT_TOP_LEVEL,
|
|
2278
2278
|
}
|
|
2279
2279
|
};
|
|
2280
|
-
function
|
|
2280
|
+
function Tt(e, t) {
|
|
2281
2281
|
var n, s;
|
|
2282
2282
|
const r = {
|
|
2283
2283
|
kind: "file",
|
|
2284
2284
|
proto: e,
|
|
2285
2285
|
deprecated: (s = (n = e.options) === null || n === void 0 ? void 0 : n.deprecated) !== null && s !== void 0 ? s : !1,
|
|
2286
|
-
edition:
|
|
2286
|
+
edition: dr(e),
|
|
2287
2287
|
name: e.name.replace(/\.proto$/, ""),
|
|
2288
|
-
dependencies:
|
|
2288
|
+
dependencies: hr(e, t),
|
|
2289
2289
|
enums: [],
|
|
2290
2290
|
messages: [],
|
|
2291
2291
|
extensions: [],
|
|
@@ -2305,14 +2305,14 @@ function It(e, t) {
|
|
|
2305
2305
|
for (const o of e.enumType)
|
|
2306
2306
|
xn(o, r, void 0, t);
|
|
2307
2307
|
for (const o of e.messageType)
|
|
2308
|
-
|
|
2308
|
+
Pn(o, r, void 0, t, a);
|
|
2309
2309
|
for (const o of e.service)
|
|
2310
|
-
|
|
2310
|
+
cr(o, r, t);
|
|
2311
2311
|
Le(r, t);
|
|
2312
2312
|
for (const o of i.values())
|
|
2313
|
-
|
|
2313
|
+
Me(o, t, a);
|
|
2314
2314
|
for (const o of r.messages)
|
|
2315
|
-
|
|
2315
|
+
Me(o, t, a), Le(o, t);
|
|
2316
2316
|
t.addFile(r, !0);
|
|
2317
2317
|
}
|
|
2318
2318
|
function Le(e, t) {
|
|
@@ -2333,20 +2333,20 @@ function Le(e, t) {
|
|
|
2333
2333
|
break;
|
|
2334
2334
|
}
|
|
2335
2335
|
}
|
|
2336
|
-
function
|
|
2337
|
-
const s = e.proto.oneofDecl.map((i) =>
|
|
2336
|
+
function Me(e, t, n) {
|
|
2337
|
+
const s = e.proto.oneofDecl.map((i) => lr(i, e)), r = /* @__PURE__ */ new Set();
|
|
2338
2338
|
for (const i of e.proto.field) {
|
|
2339
|
-
const a =
|
|
2339
|
+
const a = pr(i, s), o = xe(i, e, t, a, n);
|
|
2340
2340
|
e.fields.push(o), e.field[o.localName] = o, a === void 0 ? e.members.push(o) : (a.fields.push(o), r.has(a) || (r.add(a), e.members.push(a)));
|
|
2341
2341
|
}
|
|
2342
2342
|
for (const i of s.filter((a) => r.has(a)))
|
|
2343
2343
|
e.oneofs.push(i);
|
|
2344
2344
|
for (const i of e.nestedMessages)
|
|
2345
|
-
|
|
2345
|
+
Me(i, t, n);
|
|
2346
2346
|
}
|
|
2347
2347
|
function xn(e, t, n, s) {
|
|
2348
2348
|
var r, i, a, o, l;
|
|
2349
|
-
const u =
|
|
2349
|
+
const u = fr(e.name, e.value), d = {
|
|
2350
2350
|
kind: "enum",
|
|
2351
2351
|
proto: e,
|
|
2352
2352
|
deprecated: (i = (r = e.options) === null || r === void 0 ? void 0 : r.deprecated) !== null && i !== void 0 ? i : !1,
|
|
@@ -2354,7 +2354,7 @@ function xn(e, t, n, s) {
|
|
|
2354
2354
|
parent: n,
|
|
2355
2355
|
open: !0,
|
|
2356
2356
|
name: e.name,
|
|
2357
|
-
typeName:
|
|
2357
|
+
typeName: Ee(e, n, t),
|
|
2358
2358
|
value: {},
|
|
2359
2359
|
values: [],
|
|
2360
2360
|
sharedPrefix: u,
|
|
@@ -2362,28 +2362,28 @@ function xn(e, t, n, s) {
|
|
|
2362
2362
|
return `enum ${this.typeName}`;
|
|
2363
2363
|
}
|
|
2364
2364
|
};
|
|
2365
|
-
d.open =
|
|
2366
|
-
for (const
|
|
2367
|
-
const
|
|
2365
|
+
d.open = yr(d), s.add(d);
|
|
2366
|
+
for (const f of e.value) {
|
|
2367
|
+
const p = f.name;
|
|
2368
2368
|
d.values.push(
|
|
2369
2369
|
// biome-ignore lint/suspicious/noAssignInExpressions: no
|
|
2370
|
-
d.value[
|
|
2370
|
+
d.value[f.number] = {
|
|
2371
2371
|
kind: "enum_value",
|
|
2372
|
-
proto:
|
|
2373
|
-
deprecated: (o = (a =
|
|
2372
|
+
proto: f,
|
|
2373
|
+
deprecated: (o = (a = f.options) === null || a === void 0 ? void 0 : a.deprecated) !== null && o !== void 0 ? o : !1,
|
|
2374
2374
|
parent: d,
|
|
2375
|
-
name:
|
|
2376
|
-
localName:
|
|
2377
|
-
number:
|
|
2375
|
+
name: p,
|
|
2376
|
+
localName: Z(u == null ? p : p.substring(u.length)),
|
|
2377
|
+
number: f.number,
|
|
2378
2378
|
toString() {
|
|
2379
|
-
return `enum value ${d.typeName}.${
|
|
2379
|
+
return `enum value ${d.typeName}.${p}`;
|
|
2380
2380
|
}
|
|
2381
2381
|
}
|
|
2382
2382
|
);
|
|
2383
2383
|
}
|
|
2384
2384
|
((l = n?.nestedEnums) !== null && l !== void 0 ? l : t.enums).push(d);
|
|
2385
2385
|
}
|
|
2386
|
-
function
|
|
2386
|
+
function Pn(e, t, n, s, r) {
|
|
2387
2387
|
var i, a, o, l;
|
|
2388
2388
|
const u = {
|
|
2389
2389
|
kind: "message",
|
|
@@ -2392,7 +2392,7 @@ function Mn(e, t, n, s, r) {
|
|
|
2392
2392
|
file: t,
|
|
2393
2393
|
parent: n,
|
|
2394
2394
|
name: e.name,
|
|
2395
|
-
typeName:
|
|
2395
|
+
typeName: Ee(e, n, t),
|
|
2396
2396
|
fields: [],
|
|
2397
2397
|
field: {},
|
|
2398
2398
|
oneofs: [],
|
|
@@ -2408,9 +2408,9 @@ function Mn(e, t, n, s, r) {
|
|
|
2408
2408
|
for (const d of e.enumType)
|
|
2409
2409
|
xn(d, t, u, s);
|
|
2410
2410
|
for (const d of e.nestedType)
|
|
2411
|
-
|
|
2411
|
+
Pn(d, t, u, s, r);
|
|
2412
2412
|
}
|
|
2413
|
-
function
|
|
2413
|
+
function cr(e, t, n) {
|
|
2414
2414
|
var s, r;
|
|
2415
2415
|
const i = {
|
|
2416
2416
|
kind: "service",
|
|
@@ -2418,7 +2418,7 @@ function ar(e, t, n) {
|
|
|
2418
2418
|
deprecated: (r = (s = e.options) === null || s === void 0 ? void 0 : s.deprecated) !== null && r !== void 0 ? r : !1,
|
|
2419
2419
|
file: t,
|
|
2420
2420
|
name: e.name,
|
|
2421
|
-
typeName:
|
|
2421
|
+
typeName: Ee(e, void 0, t),
|
|
2422
2422
|
methods: [],
|
|
2423
2423
|
method: {},
|
|
2424
2424
|
toString() {
|
|
@@ -2427,15 +2427,15 @@ function ar(e, t, n) {
|
|
|
2427
2427
|
};
|
|
2428
2428
|
t.services.push(i), n.add(i);
|
|
2429
2429
|
for (const a of e.method) {
|
|
2430
|
-
const o =
|
|
2430
|
+
const o = ur(a, i, n);
|
|
2431
2431
|
i.methods.push(o), i.method[o.localName] = o;
|
|
2432
2432
|
}
|
|
2433
2433
|
}
|
|
2434
|
-
function
|
|
2434
|
+
function ur(e, t, n) {
|
|
2435
2435
|
var s, r, i, a;
|
|
2436
2436
|
let o;
|
|
2437
2437
|
e.clientStreaming && e.serverStreaming ? o = "bidi_streaming" : e.clientStreaming ? o = "client_streaming" : e.serverStreaming ? o = "server_streaming" : o = "unary";
|
|
2438
|
-
const l = n.getMessage(
|
|
2438
|
+
const l = n.getMessage(D(e.inputType)), u = n.getMessage(D(e.outputType));
|
|
2439
2439
|
A(l, `invalid MethodDescriptorProto: input_type ${e.inputType} not found`), A(u, `invalid MethodDescriptorProto: output_type ${e.inputType} not found`);
|
|
2440
2440
|
const d = e.name;
|
|
2441
2441
|
return {
|
|
@@ -2444,17 +2444,17 @@ function or(e, t, n) {
|
|
|
2444
2444
|
deprecated: (r = (s = e.options) === null || s === void 0 ? void 0 : s.deprecated) !== null && r !== void 0 ? r : !1,
|
|
2445
2445
|
parent: t,
|
|
2446
2446
|
name: d,
|
|
2447
|
-
localName:
|
|
2447
|
+
localName: Z(d.length ? Z(d[0].toLowerCase() + d.substring(1)) : d),
|
|
2448
2448
|
methodKind: o,
|
|
2449
2449
|
input: l,
|
|
2450
2450
|
output: u,
|
|
2451
|
-
idempotency: (a = (i = e.options) === null || i === void 0 ? void 0 : i.idempotencyLevel) !== null && a !== void 0 ? a :
|
|
2451
|
+
idempotency: (a = (i = e.options) === null || i === void 0 ? void 0 : i.idempotencyLevel) !== null && a !== void 0 ? a : tr,
|
|
2452
2452
|
toString() {
|
|
2453
2453
|
return `rpc ${t.typeName}.${d}`;
|
|
2454
2454
|
}
|
|
2455
2455
|
};
|
|
2456
2456
|
}
|
|
2457
|
-
function
|
|
2457
|
+
function lr(e, t) {
|
|
2458
2458
|
return {
|
|
2459
2459
|
kind: "oneof",
|
|
2460
2460
|
proto: e,
|
|
@@ -2462,7 +2462,7 @@ function cr(e, t) {
|
|
|
2462
2462
|
parent: t,
|
|
2463
2463
|
fields: [],
|
|
2464
2464
|
name: e.name,
|
|
2465
|
-
localName:
|
|
2465
|
+
localName: Z(he(e.name)),
|
|
2466
2466
|
toString() {
|
|
2467
2467
|
return `oneof ${t.typeName}.${this.name}`;
|
|
2468
2468
|
}
|
|
@@ -2479,8 +2479,8 @@ function xe(e, t, n, s, r) {
|
|
|
2479
2479
|
scalar: void 0,
|
|
2480
2480
|
message: void 0,
|
|
2481
2481
|
enum: void 0,
|
|
2482
|
-
presence:
|
|
2483
|
-
utf8Validation:
|
|
2482
|
+
presence: br(e, s, l, t),
|
|
2483
|
+
utf8Validation: wr(e, t),
|
|
2484
2484
|
listKind: void 0,
|
|
2485
2485
|
mapKind: void 0,
|
|
2486
2486
|
mapKey: void 0,
|
|
@@ -2490,72 +2490,72 @@ function xe(e, t, n, s, r) {
|
|
|
2490
2490
|
getDefaultValue: void 0
|
|
2491
2491
|
};
|
|
2492
2492
|
if (l) {
|
|
2493
|
-
const
|
|
2494
|
-
u.kind = "extension", u.file =
|
|
2495
|
-
const
|
|
2496
|
-
A(
|
|
2493
|
+
const m = t.kind == "file" ? t : t.file, g = t.kind == "file" ? void 0 : t, E = Ee(e, g, m);
|
|
2494
|
+
u.kind = "extension", u.file = m, u.parent = g, u.oneof = void 0, u.typeName = E, u.jsonName = `[${E}]`, u.toString = () => `extension ${E}`;
|
|
2495
|
+
const x = n.getMessage(D(e.extendee));
|
|
2496
|
+
A(x, `invalid FieldDescriptorProto: extendee ${e.extendee} not found`), u.extendee = x;
|
|
2497
2497
|
} else {
|
|
2498
|
-
const
|
|
2499
|
-
A(
|
|
2498
|
+
const m = t;
|
|
2499
|
+
A(m.kind == "message"), u.parent = m, u.oneof = s, u.localName = s ? he(e.name) : Z(he(e.name)), u.jsonName = e.jsonName, u.toString = () => `field ${m.typeName}.${e.name}`;
|
|
2500
2500
|
}
|
|
2501
|
-
const d = e.label,
|
|
2502
|
-
if (d ===
|
|
2503
|
-
const
|
|
2504
|
-
if (
|
|
2501
|
+
const d = e.label, f = e.type, p = (o = e.options) === null || o === void 0 ? void 0 : o.jstype;
|
|
2502
|
+
if (d === Je) {
|
|
2503
|
+
const m = f == j ? r?.get(D(e.typeName)) : void 0;
|
|
2504
|
+
if (m) {
|
|
2505
2505
|
u.fieldKind = "map";
|
|
2506
|
-
const { key:
|
|
2507
|
-
return u.mapKey =
|
|
2506
|
+
const { key: g, value: E } = Er(m);
|
|
2507
|
+
return u.mapKey = g.scalar, u.mapKind = E.fieldKind, u.message = E.message, u.delimitedEncoding = !1, u.enum = E.enum, u.scalar = E.scalar, u;
|
|
2508
2508
|
}
|
|
2509
|
-
switch (u.fieldKind = "list",
|
|
2510
|
-
case
|
|
2511
|
-
case
|
|
2512
|
-
u.listKind = "message", u.message = n.getMessage(
|
|
2509
|
+
switch (u.fieldKind = "list", f) {
|
|
2510
|
+
case j:
|
|
2511
|
+
case z:
|
|
2512
|
+
u.listKind = "message", u.message = n.getMessage(D(e.typeName)), A(u.message), u.delimitedEncoding = St(e, t);
|
|
2513
2513
|
break;
|
|
2514
|
-
case
|
|
2515
|
-
u.listKind = "enum", u.enum = n.getEnum(
|
|
2514
|
+
case wt:
|
|
2515
|
+
u.listKind = "enum", u.enum = n.getEnum(D(e.typeName)), A(u.enum);
|
|
2516
2516
|
break;
|
|
2517
2517
|
default:
|
|
2518
|
-
u.listKind = "scalar", u.scalar =
|
|
2518
|
+
u.listKind = "scalar", u.scalar = f, u.longAsString = p == It;
|
|
2519
2519
|
break;
|
|
2520
2520
|
}
|
|
2521
|
-
return u.packed =
|
|
2521
|
+
return u.packed = gr(e, t), u;
|
|
2522
2522
|
}
|
|
2523
|
-
switch (
|
|
2524
|
-
case
|
|
2525
|
-
case
|
|
2526
|
-
u.fieldKind = "message", u.message = n.getMessage(
|
|
2523
|
+
switch (f) {
|
|
2524
|
+
case j:
|
|
2525
|
+
case z:
|
|
2526
|
+
u.fieldKind = "message", u.message = n.getMessage(D(e.typeName)), A(u.message, `invalid FieldDescriptorProto: type_name ${e.typeName} not found`), u.delimitedEncoding = St(e, t), u.getDefaultValue = () => {
|
|
2527
2527
|
};
|
|
2528
2528
|
break;
|
|
2529
|
-
case
|
|
2530
|
-
const
|
|
2531
|
-
A(
|
|
2529
|
+
case wt: {
|
|
2530
|
+
const m = n.getEnum(D(e.typeName));
|
|
2531
|
+
A(m !== void 0, `invalid FieldDescriptorProto: type_name ${e.typeName} not found`), u.fieldKind = "enum", u.enum = n.getEnum(D(e.typeName)), u.getDefaultValue = () => H(e, "defaultValue") ? Ks(m, e.defaultValue) : void 0;
|
|
2532
2532
|
break;
|
|
2533
2533
|
}
|
|
2534
2534
|
default: {
|
|
2535
|
-
u.fieldKind = "scalar", u.scalar =
|
|
2535
|
+
u.fieldKind = "scalar", u.scalar = f, u.longAsString = p == It, u.getDefaultValue = () => H(e, "defaultValue") ? Ws(f, e.defaultValue) : void 0;
|
|
2536
2536
|
break;
|
|
2537
2537
|
}
|
|
2538
2538
|
}
|
|
2539
2539
|
return u;
|
|
2540
2540
|
}
|
|
2541
|
-
function
|
|
2541
|
+
function dr(e) {
|
|
2542
2542
|
switch (e.syntax) {
|
|
2543
2543
|
case "":
|
|
2544
2544
|
case "proto2":
|
|
2545
|
-
return
|
|
2545
|
+
return Hs;
|
|
2546
2546
|
case "proto3":
|
|
2547
|
-
return
|
|
2547
|
+
return Zs;
|
|
2548
2548
|
case "editions":
|
|
2549
|
-
if (e.edition ===
|
|
2550
|
-
return
|
|
2551
|
-
if (e.edition in
|
|
2549
|
+
if (e.edition === zs)
|
|
2550
|
+
return or;
|
|
2551
|
+
if (e.edition in Mn)
|
|
2552
2552
|
return e.edition;
|
|
2553
2553
|
throw new Error(`${e.name}: unsupported edition`);
|
|
2554
2554
|
default:
|
|
2555
2555
|
throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`);
|
|
2556
2556
|
}
|
|
2557
2557
|
}
|
|
2558
|
-
function
|
|
2558
|
+
function hr(e, t) {
|
|
2559
2559
|
return e.dependency.map((n) => {
|
|
2560
2560
|
const s = t.getFile(n);
|
|
2561
2561
|
if (!s)
|
|
@@ -2563,8 +2563,8 @@ function lr(e, t) {
|
|
|
2563
2563
|
return s;
|
|
2564
2564
|
});
|
|
2565
2565
|
}
|
|
2566
|
-
function
|
|
2567
|
-
const n =
|
|
2566
|
+
function fr(e, t) {
|
|
2567
|
+
const n = mr(e) + "_";
|
|
2568
2568
|
for (const s of t) {
|
|
2569
2569
|
if (!s.name.toLowerCase().startsWith(n))
|
|
2570
2570
|
return;
|
|
@@ -2574,72 +2574,72 @@ function dr(e, t) {
|
|
|
2574
2574
|
}
|
|
2575
2575
|
return n;
|
|
2576
2576
|
}
|
|
2577
|
-
function
|
|
2577
|
+
function mr(e) {
|
|
2578
2578
|
return (e.substring(0, 1) + e.substring(1).replace(/[A-Z]/g, (t) => "_" + t)).toLowerCase();
|
|
2579
2579
|
}
|
|
2580
|
-
function
|
|
2580
|
+
function Ee(e, t, n) {
|
|
2581
2581
|
let s;
|
|
2582
2582
|
return t ? s = `${t.typeName}.${e.name}` : n.proto.package.length > 0 ? s = `${n.proto.package}.${e.name}` : s = `${e.name}`, s;
|
|
2583
2583
|
}
|
|
2584
|
-
function
|
|
2584
|
+
function D(e) {
|
|
2585
2585
|
return e.startsWith(".") ? e.substring(1) : e;
|
|
2586
2586
|
}
|
|
2587
|
-
function
|
|
2588
|
-
if (!
|
|
2587
|
+
function pr(e, t) {
|
|
2588
|
+
if (!H(e, "oneofIndex") || e.proto3Optional)
|
|
2589
2589
|
return;
|
|
2590
2590
|
const n = t[e.oneofIndex];
|
|
2591
2591
|
return A(n, `invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`), n;
|
|
2592
2592
|
}
|
|
2593
|
-
function
|
|
2594
|
-
if (e.label ==
|
|
2595
|
-
return
|
|
2596
|
-
if (e.label ==
|
|
2593
|
+
function br(e, t, n, s) {
|
|
2594
|
+
if (e.label == er)
|
|
2595
|
+
return nr;
|
|
2596
|
+
if (e.label == Je)
|
|
2597
2597
|
return Nt;
|
|
2598
2598
|
if (t || e.proto3Optional || n)
|
|
2599
|
-
return
|
|
2600
|
-
const r =
|
|
2601
|
-
return r == Nt && (e.type ==
|
|
2599
|
+
return _e;
|
|
2600
|
+
const r = F("fieldPresence", { proto: e, parent: s });
|
|
2601
|
+
return r == Nt && (e.type == j || e.type == z) ? _e : r;
|
|
2602
2602
|
}
|
|
2603
|
-
function
|
|
2604
|
-
if (e.label !=
|
|
2603
|
+
function gr(e, t) {
|
|
2604
|
+
if (e.label != Je)
|
|
2605
2605
|
return !1;
|
|
2606
2606
|
switch (e.type) {
|
|
2607
|
-
case
|
|
2607
|
+
case Qs:
|
|
2608
2608
|
case Js:
|
|
2609
|
-
case
|
|
2610
|
-
case
|
|
2609
|
+
case z:
|
|
2610
|
+
case j:
|
|
2611
2611
|
return !1;
|
|
2612
2612
|
}
|
|
2613
2613
|
const n = e.options;
|
|
2614
|
-
return n &&
|
|
2614
|
+
return n && H(n, "packed") ? n.packed : sr == F("repeatedFieldEncoding", {
|
|
2615
2615
|
proto: e,
|
|
2616
2616
|
parent: t
|
|
2617
2617
|
});
|
|
2618
2618
|
}
|
|
2619
|
-
function
|
|
2619
|
+
function Er(e) {
|
|
2620
2620
|
const t = e.fields.find((s) => s.number === 1), n = e.fields.find((s) => s.number === 2);
|
|
2621
2621
|
return A(t && t.fieldKind == "scalar" && t.scalar != c.BYTES && t.scalar != c.FLOAT && t.scalar != c.DOUBLE && n && n.fieldKind != "list" && n.fieldKind != "map"), { key: t, value: n };
|
|
2622
2622
|
}
|
|
2623
|
-
function
|
|
2623
|
+
function yr(e) {
|
|
2624
2624
|
var t;
|
|
2625
|
-
return
|
|
2625
|
+
return ir == F("enumType", {
|
|
2626
2626
|
proto: e.proto,
|
|
2627
2627
|
parent: (t = e.parent) !== null && t !== void 0 ? t : e.file
|
|
2628
2628
|
});
|
|
2629
2629
|
}
|
|
2630
|
-
function
|
|
2631
|
-
return e.type ==
|
|
2630
|
+
function St(e, t) {
|
|
2631
|
+
return e.type == z ? !0 : rr == F("messageEncoding", {
|
|
2632
2632
|
proto: e,
|
|
2633
2633
|
parent: t
|
|
2634
2634
|
});
|
|
2635
2635
|
}
|
|
2636
|
-
function
|
|
2637
|
-
return
|
|
2636
|
+
function wr(e, t) {
|
|
2637
|
+
return ar == F("utf8Validation", {
|
|
2638
2638
|
proto: e,
|
|
2639
2639
|
parent: t
|
|
2640
2640
|
});
|
|
2641
2641
|
}
|
|
2642
|
-
function
|
|
2642
|
+
function F(e, t) {
|
|
2643
2643
|
var n, s;
|
|
2644
2644
|
const r = (n = t.proto.options) === null || n === void 0 ? void 0 : n.features;
|
|
2645
2645
|
if (r) {
|
|
@@ -2649,28 +2649,28 @@ function V(e, t) {
|
|
|
2649
2649
|
}
|
|
2650
2650
|
if ("kind" in t) {
|
|
2651
2651
|
if (t.kind == "message")
|
|
2652
|
-
return
|
|
2653
|
-
const i =
|
|
2652
|
+
return F(e, (s = t.parent) !== null && s !== void 0 ? s : t.file);
|
|
2653
|
+
const i = Mn[t.edition];
|
|
2654
2654
|
if (!i)
|
|
2655
2655
|
throw new Error(`feature default for edition ${t.edition} not found`);
|
|
2656
2656
|
return i[e];
|
|
2657
2657
|
}
|
|
2658
|
-
return
|
|
2658
|
+
return F(e, t.parent);
|
|
2659
2659
|
}
|
|
2660
2660
|
function A(e, t) {
|
|
2661
2661
|
if (!e)
|
|
2662
2662
|
throw new Error(t);
|
|
2663
2663
|
}
|
|
2664
|
-
function
|
|
2665
|
-
const t =
|
|
2666
|
-
return t.messageType.forEach(
|
|
2664
|
+
function Ir(e) {
|
|
2665
|
+
const t = Nr(e);
|
|
2666
|
+
return t.messageType.forEach(Qe), Ln(t, () => {
|
|
2667
2667
|
}).getFile(t.name);
|
|
2668
2668
|
}
|
|
2669
|
-
function
|
|
2669
|
+
function Nr(e) {
|
|
2670
2670
|
return Object.assign(/* @__PURE__ */ Object.create({
|
|
2671
2671
|
syntax: "",
|
|
2672
2672
|
edition: 0
|
|
2673
|
-
}), Object.assign(Object.assign({ $typeName: "google.protobuf.FileDescriptorProto", dependency: [], publicDependency: [], weakDependency: [], optionDependency: [], service: [], extension: [] }, e), { messageType: e.messageType.map(Vn), enumType: e.enumType.map(
|
|
2673
|
+
}), Object.assign(Object.assign({ $typeName: "google.protobuf.FileDescriptorProto", dependency: [], publicDependency: [], weakDependency: [], optionDependency: [], service: [], extension: [] }, e), { messageType: e.messageType.map(Vn), enumType: e.enumType.map(Fn) }));
|
|
2674
2674
|
}
|
|
2675
2675
|
function Vn(e) {
|
|
2676
2676
|
var t, n, s, r, i, a, o, l;
|
|
@@ -2679,17 +2679,17 @@ function Vn(e) {
|
|
|
2679
2679
|
}), {
|
|
2680
2680
|
$typeName: "google.protobuf.DescriptorProto",
|
|
2681
2681
|
name: e.name,
|
|
2682
|
-
field: (n = (t = e.field) === null || t === void 0 ? void 0 : t.map(
|
|
2682
|
+
field: (n = (t = e.field) === null || t === void 0 ? void 0 : t.map(Tr)) !== null && n !== void 0 ? n : [],
|
|
2683
2683
|
extension: [],
|
|
2684
2684
|
nestedType: (r = (s = e.nestedType) === null || s === void 0 ? void 0 : s.map(Vn)) !== null && r !== void 0 ? r : [],
|
|
2685
|
-
enumType: (a = (i = e.enumType) === null || i === void 0 ? void 0 : i.map(
|
|
2685
|
+
enumType: (a = (i = e.enumType) === null || i === void 0 ? void 0 : i.map(Fn)) !== null && a !== void 0 ? a : [],
|
|
2686
2686
|
extensionRange: (l = (o = e.extensionRange) === null || o === void 0 ? void 0 : o.map((d) => Object.assign({ $typeName: "google.protobuf.DescriptorProto.ExtensionRange" }, d))) !== null && l !== void 0 ? l : [],
|
|
2687
2687
|
oneofDecl: [],
|
|
2688
2688
|
reservedRange: [],
|
|
2689
2689
|
reservedName: []
|
|
2690
2690
|
});
|
|
2691
2691
|
}
|
|
2692
|
-
function
|
|
2692
|
+
function Tr(e) {
|
|
2693
2693
|
return Object.assign(/* @__PURE__ */ Object.create({
|
|
2694
2694
|
label: 1,
|
|
2695
2695
|
typeName: "",
|
|
@@ -2698,9 +2698,9 @@ function Nr(e) {
|
|
|
2698
2698
|
oneofIndex: 0,
|
|
2699
2699
|
jsonName: "",
|
|
2700
2700
|
proto3Optional: !1
|
|
2701
|
-
}), Object.assign(Object.assign({ $typeName: "google.protobuf.FieldDescriptorProto" }, e), { options: e.options ?
|
|
2701
|
+
}), Object.assign(Object.assign({ $typeName: "google.protobuf.FieldDescriptorProto" }, e), { options: e.options ? Sr(e.options) : void 0 }));
|
|
2702
2702
|
}
|
|
2703
|
-
function
|
|
2703
|
+
function Sr(e) {
|
|
2704
2704
|
var t, n, s;
|
|
2705
2705
|
return Object.assign(/* @__PURE__ */ Object.create({
|
|
2706
2706
|
ctype: 0,
|
|
@@ -2714,7 +2714,7 @@ function Ir(e) {
|
|
|
2714
2714
|
retention: 0
|
|
2715
2715
|
}), Object.assign(Object.assign({ $typeName: "google.protobuf.FieldOptions" }, e), { targets: (t = e.targets) !== null && t !== void 0 ? t : [], editionDefaults: (s = (n = e.editionDefaults) === null || n === void 0 ? void 0 : n.map((i) => Object.assign({ $typeName: "google.protobuf.FieldOptions.EditionDefault" }, i))) !== null && s !== void 0 ? s : [], uninterpretedOption: [] }));
|
|
2716
2716
|
}
|
|
2717
|
-
function
|
|
2717
|
+
function Fn(e) {
|
|
2718
2718
|
return Object.assign(/* @__PURE__ */ Object.create({
|
|
2719
2719
|
visibility: 0
|
|
2720
2720
|
}), {
|
|
@@ -2725,125 +2725,125 @@ function Bn(e) {
|
|
|
2725
2725
|
value: e.value.map((n) => Object.assign({ $typeName: "google.protobuf.EnumValueDescriptorProto" }, n))
|
|
2726
2726
|
});
|
|
2727
2727
|
}
|
|
2728
|
-
function
|
|
2728
|
+
function R(e, t, ...n) {
|
|
2729
2729
|
return n.reduce((s, r) => s.nestedMessages[r], e.messages[t]);
|
|
2730
2730
|
}
|
|
2731
|
-
const Tr = /* @__PURE__ */ yr({ name: "google/protobuf/descriptor.proto", package: "google.protobuf", messageType: [{ name: "FileDescriptorSet", field: [{ name: "file", number: 1, type: 11, label: 3, typeName: ".google.protobuf.FileDescriptorProto" }], extensionRange: [{ start: 536e6, end: 536000001 }] }, { name: "FileDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "package", number: 2, type: 9, label: 1 }, { name: "dependency", number: 3, type: 9, label: 3 }, { name: "public_dependency", number: 10, type: 5, label: 3 }, { name: "weak_dependency", number: 11, type: 5, label: 3 }, { name: "option_dependency", number: 15, type: 9, label: 3 }, { name: "message_type", number: 4, type: 11, label: 3, typeName: ".google.protobuf.DescriptorProto" }, { name: "enum_type", number: 5, type: 11, label: 3, typeName: ".google.protobuf.EnumDescriptorProto" }, { name: "service", number: 6, type: 11, label: 3, typeName: ".google.protobuf.ServiceDescriptorProto" }, { name: "extension", number: 7, type: 11, label: 3, typeName: ".google.protobuf.FieldDescriptorProto" }, { name: "options", number: 8, type: 11, label: 1, typeName: ".google.protobuf.FileOptions" }, { name: "source_code_info", number: 9, type: 11, label: 1, typeName: ".google.protobuf.SourceCodeInfo" }, { name: "syntax", number: 12, type: 9, label: 1 }, { name: "edition", number: 14, type: 14, label: 1, typeName: ".google.protobuf.Edition" }] }, { name: "DescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "field", number: 2, type: 11, label: 3, typeName: ".google.protobuf.FieldDescriptorProto" }, { name: "extension", number: 6, type: 11, label: 3, typeName: ".google.protobuf.FieldDescriptorProto" }, { name: "nested_type", number: 3, type: 11, label: 3, typeName: ".google.protobuf.DescriptorProto" }, { name: "enum_type", number: 4, type: 11, label: 3, typeName: ".google.protobuf.EnumDescriptorProto" }, { name: "extension_range", number: 5, type: 11, label: 3, typeName: ".google.protobuf.DescriptorProto.ExtensionRange" }, { name: "oneof_decl", number: 8, type: 11, label: 3, typeName: ".google.protobuf.OneofDescriptorProto" }, { name: "options", number: 7, type: 11, label: 1, typeName: ".google.protobuf.MessageOptions" }, { name: "reserved_range", number: 9, type: 11, label: 3, typeName: ".google.protobuf.DescriptorProto.ReservedRange" }, { name: "reserved_name", number: 10, type: 9, label: 3 }, { name: "visibility", number: 11, type: 14, label: 1, typeName: ".google.protobuf.SymbolVisibility" }], nestedType: [{ name: "ExtensionRange", field: [{ name: "start", number: 1, type: 5, label: 1 }, { name: "end", number: 2, type: 5, label: 1 }, { name: "options", number: 3, type: 11, label: 1, typeName: ".google.protobuf.ExtensionRangeOptions" }] }, { name: "ReservedRange", field: [{ name: "start", number: 1, type: 5, label: 1 }, { name: "end", number: 2, type: 5, label: 1 }] }] }, { name: "ExtensionRangeOptions", field: [{ name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }, { name: "declaration", number: 2, type: 11, label: 3, typeName: ".google.protobuf.ExtensionRangeOptions.Declaration", options: { retention: 2 } }, { name: "features", number: 50, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "verification", number: 3, type: 14, label: 1, typeName: ".google.protobuf.ExtensionRangeOptions.VerificationState", defaultValue: "UNVERIFIED", options: { retention: 2 } }], nestedType: [{ name: "Declaration", field: [{ name: "number", number: 1, type: 5, label: 1 }, { name: "full_name", number: 2, type: 9, label: 1 }, { name: "type", number: 3, type: 9, label: 1 }, { name: "reserved", number: 5, type: 8, label: 1 }, { name: "repeated", number: 6, type: 8, label: 1 }] }], enumType: [{ name: "VerificationState", value: [{ name: "DECLARATION", number: 0 }, { name: "UNVERIFIED", number: 1 }] }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "FieldDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "number", number: 3, type: 5, label: 1 }, { name: "label", number: 4, type: 14, label: 1, typeName: ".google.protobuf.FieldDescriptorProto.Label" }, { name: "type", number: 5, type: 14, label: 1, typeName: ".google.protobuf.FieldDescriptorProto.Type" }, { name: "type_name", number: 6, type: 9, label: 1 }, { name: "extendee", number: 2, type: 9, label: 1 }, { name: "default_value", number: 7, type: 9, label: 1 }, { name: "oneof_index", number: 9, type: 5, label: 1 }, { name: "json_name", number: 10, type: 9, label: 1 }, { name: "options", number: 8, type: 11, label: 1, typeName: ".google.protobuf.FieldOptions" }, { name: "proto3_optional", number: 17, type: 8, label: 1 }], enumType: [{ name: "Type", value: [{ name: "TYPE_DOUBLE", number: 1 }, { name: "TYPE_FLOAT", number: 2 }, { name: "TYPE_INT64", number: 3 }, { name: "TYPE_UINT64", number: 4 }, { name: "TYPE_INT32", number: 5 }, { name: "TYPE_FIXED64", number: 6 }, { name: "TYPE_FIXED32", number: 7 }, { name: "TYPE_BOOL", number: 8 }, { name: "TYPE_STRING", number: 9 }, { name: "TYPE_GROUP", number: 10 }, { name: "TYPE_MESSAGE", number: 11 }, { name: "TYPE_BYTES", number: 12 }, { name: "TYPE_UINT32", number: 13 }, { name: "TYPE_ENUM", number: 14 }, { name: "TYPE_SFIXED32", number: 15 }, { name: "TYPE_SFIXED64", number: 16 }, { name: "TYPE_SINT32", number: 17 }, { name: "TYPE_SINT64", number: 18 }] }, { name: "Label", value: [{ name: "LABEL_OPTIONAL", number: 1 }, { name: "LABEL_REPEATED", number: 3 }, { name: "LABEL_REQUIRED", number: 2 }] }] }, { name: "OneofDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "options", number: 2, type: 11, label: 1, typeName: ".google.protobuf.OneofOptions" }] }, { name: "EnumDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "value", number: 2, type: 11, label: 3, typeName: ".google.protobuf.EnumValueDescriptorProto" }, { name: "options", number: 3, type: 11, label: 1, typeName: ".google.protobuf.EnumOptions" }, { name: "reserved_range", number: 4, type: 11, label: 3, typeName: ".google.protobuf.EnumDescriptorProto.EnumReservedRange" }, { name: "reserved_name", number: 5, type: 9, label: 3 }, { name: "visibility", number: 6, type: 14, label: 1, typeName: ".google.protobuf.SymbolVisibility" }], nestedType: [{ name: "EnumReservedRange", field: [{ name: "start", number: 1, type: 5, label: 1 }, { name: "end", number: 2, type: 5, label: 1 }] }] }, { name: "EnumValueDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "number", number: 2, type: 5, label: 1 }, { name: "options", number: 3, type: 11, label: 1, typeName: ".google.protobuf.EnumValueOptions" }] }, { name: "ServiceDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "method", number: 2, type: 11, label: 3, typeName: ".google.protobuf.MethodDescriptorProto" }, { name: "options", number: 3, type: 11, label: 1, typeName: ".google.protobuf.ServiceOptions" }] }, { name: "MethodDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "input_type", number: 2, type: 9, label: 1 }, { name: "output_type", number: 3, type: 9, label: 1 }, { name: "options", number: 4, type: 11, label: 1, typeName: ".google.protobuf.MethodOptions" }, { name: "client_streaming", number: 5, type: 8, label: 1, defaultValue: "false" }, { name: "server_streaming", number: 6, type: 8, label: 1, defaultValue: "false" }] }, { name: "FileOptions", field: [{ name: "java_package", number: 1, type: 9, label: 1 }, { name: "java_outer_classname", number: 8, type: 9, label: 1 }, { name: "java_multiple_files", number: 10, type: 8, label: 1, defaultValue: "false", options: {} }, { name: "java_generate_equals_and_hash", number: 20, type: 8, label: 1, options: { deprecated: !0 } }, { name: "java_string_check_utf8", number: 27, type: 8, label: 1, defaultValue: "false" }, { name: "optimize_for", number: 9, type: 14, label: 1, typeName: ".google.protobuf.FileOptions.OptimizeMode", defaultValue: "SPEED" }, { name: "go_package", number: 11, type: 9, label: 1 }, { name: "cc_generic_services", number: 16, type: 8, label: 1, defaultValue: "false" }, { name: "java_generic_services", number: 17, type: 8, label: 1, defaultValue: "false" }, { name: "py_generic_services", number: 18, type: 8, label: 1, defaultValue: "false" }, { name: "deprecated", number: 23, type: 8, label: 1, defaultValue: "false" }, { name: "cc_enable_arenas", number: 31, type: 8, label: 1, defaultValue: "true" }, { name: "objc_class_prefix", number: 36, type: 9, label: 1 }, { name: "csharp_namespace", number: 37, type: 9, label: 1 }, { name: "swift_prefix", number: 39, type: 9, label: 1 }, { name: "php_class_prefix", number: 40, type: 9, label: 1 }, { name: "php_namespace", number: 41, type: 9, label: 1 }, { name: "php_metadata_namespace", number: 44, type: 9, label: 1 }, { name: "ruby_package", number: 45, type: 9, label: 1 }, { name: "features", number: 50, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], enumType: [{ name: "OptimizeMode", value: [{ name: "SPEED", number: 1 }, { name: "CODE_SIZE", number: 2 }, { name: "LITE_RUNTIME", number: 3 }] }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "MessageOptions", field: [{ name: "message_set_wire_format", number: 1, type: 8, label: 1, defaultValue: "false" }, { name: "no_standard_descriptor_accessor", number: 2, type: 8, label: 1, defaultValue: "false" }, { name: "deprecated", number: 3, type: 8, label: 1, defaultValue: "false" }, { name: "map_entry", number: 7, type: 8, label: 1 }, { name: "deprecated_legacy_json_field_conflicts", number: 11, type: 8, label: 1, options: { deprecated: !0 } }, { name: "features", number: 12, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "FieldOptions", field: [{ name: "ctype", number: 1, type: 14, label: 1, typeName: ".google.protobuf.FieldOptions.CType", defaultValue: "STRING" }, { name: "packed", number: 2, type: 8, label: 1 }, { name: "jstype", number: 6, type: 14, label: 1, typeName: ".google.protobuf.FieldOptions.JSType", defaultValue: "JS_NORMAL" }, { name: "lazy", number: 5, type: 8, label: 1, defaultValue: "false" }, { name: "unverified_lazy", number: 15, type: 8, label: 1, defaultValue: "false" }, { name: "deprecated", number: 3, type: 8, label: 1, defaultValue: "false" }, { name: "weak", number: 10, type: 8, label: 1, defaultValue: "false", options: { deprecated: !0 } }, { name: "debug_redact", number: 16, type: 8, label: 1, defaultValue: "false" }, { name: "retention", number: 17, type: 14, label: 1, typeName: ".google.protobuf.FieldOptions.OptionRetention" }, { name: "targets", number: 19, type: 14, label: 3, typeName: ".google.protobuf.FieldOptions.OptionTargetType" }, { name: "edition_defaults", number: 20, type: 11, label: 3, typeName: ".google.protobuf.FieldOptions.EditionDefault" }, { name: "features", number: 21, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "feature_support", number: 22, type: 11, label: 1, typeName: ".google.protobuf.FieldOptions.FeatureSupport" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], nestedType: [{ name: "EditionDefault", field: [{ name: "edition", number: 3, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "value", number: 2, type: 9, label: 1 }] }, { name: "FeatureSupport", field: [{ name: "edition_introduced", number: 1, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "edition_deprecated", number: 2, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "deprecation_warning", number: 3, type: 9, label: 1 }, { name: "edition_removed", number: 4, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "removal_error", number: 5, type: 9, label: 1 }] }], enumType: [{ name: "CType", value: [{ name: "STRING", number: 0 }, { name: "CORD", number: 1 }, { name: "STRING_PIECE", number: 2 }] }, { name: "JSType", value: [{ name: "JS_NORMAL", number: 0 }, { name: "JS_STRING", number: 1 }, { name: "JS_NUMBER", number: 2 }] }, { name: "OptionRetention", value: [{ name: "RETENTION_UNKNOWN", number: 0 }, { name: "RETENTION_RUNTIME", number: 1 }, { name: "RETENTION_SOURCE", number: 2 }] }, { name: "OptionTargetType", value: [{ name: "TARGET_TYPE_UNKNOWN", number: 0 }, { name: "TARGET_TYPE_FILE", number: 1 }, { name: "TARGET_TYPE_EXTENSION_RANGE", number: 2 }, { name: "TARGET_TYPE_MESSAGE", number: 3 }, { name: "TARGET_TYPE_FIELD", number: 4 }, { name: "TARGET_TYPE_ONEOF", number: 5 }, { name: "TARGET_TYPE_ENUM", number: 6 }, { name: "TARGET_TYPE_ENUM_ENTRY", number: 7 }, { name: "TARGET_TYPE_SERVICE", number: 8 }, { name: "TARGET_TYPE_METHOD", number: 9 }] }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "OneofOptions", field: [{ name: "features", number: 1, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "EnumOptions", field: [{ name: "allow_alias", number: 2, type: 8, label: 1 }, { name: "deprecated", number: 3, type: 8, label: 1, defaultValue: "false" }, { name: "deprecated_legacy_json_field_conflicts", number: 6, type: 8, label: 1, options: { deprecated: !0 } }, { name: "features", number: 7, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "EnumValueOptions", field: [{ name: "deprecated", number: 1, type: 8, label: 1, defaultValue: "false" }, { name: "features", number: 2, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "debug_redact", number: 3, type: 8, label: 1, defaultValue: "false" }, { name: "feature_support", number: 4, type: 11, label: 1, typeName: ".google.protobuf.FieldOptions.FeatureSupport" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "ServiceOptions", field: [{ name: "features", number: 34, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "deprecated", number: 33, type: 8, label: 1, defaultValue: "false" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "MethodOptions", field: [{ name: "deprecated", number: 33, type: 8, label: 1, defaultValue: "false" }, { name: "idempotency_level", number: 34, type: 14, label: 1, typeName: ".google.protobuf.MethodOptions.IdempotencyLevel", defaultValue: "IDEMPOTENCY_UNKNOWN" }, { name: "features", number: 35, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], enumType: [{ name: "IdempotencyLevel", value: [{ name: "IDEMPOTENCY_UNKNOWN", number: 0 }, { name: "NO_SIDE_EFFECTS", number: 1 }, { name: "IDEMPOTENT", number: 2 }] }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "UninterpretedOption", field: [{ name: "name", number: 2, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption.NamePart" }, { name: "identifier_value", number: 3, type: 9, label: 1 }, { name: "positive_int_value", number: 4, type: 4, label: 1 }, { name: "negative_int_value", number: 5, type: 3, label: 1 }, { name: "double_value", number: 6, type: 1, label: 1 }, { name: "string_value", number: 7, type: 12, label: 1 }, { name: "aggregate_value", number: 8, type: 9, label: 1 }], nestedType: [{ name: "NamePart", field: [{ name: "name_part", number: 1, type: 9, label: 2 }, { name: "is_extension", number: 2, type: 8, label: 2 }] }] }, { name: "FeatureSet", field: [{ name: "field_presence", number: 1, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.FieldPresence", options: { retention: 1, targets: [4, 1], editionDefaults: [{ value: "EXPLICIT", edition: 900 }, { value: "IMPLICIT", edition: 999 }, { value: "EXPLICIT", edition: 1e3 }] } }, { name: "enum_type", number: 2, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.EnumType", options: { retention: 1, targets: [6, 1], editionDefaults: [{ value: "CLOSED", edition: 900 }, { value: "OPEN", edition: 999 }] } }, { name: "repeated_field_encoding", number: 3, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.RepeatedFieldEncoding", options: { retention: 1, targets: [4, 1], editionDefaults: [{ value: "EXPANDED", edition: 900 }, { value: "PACKED", edition: 999 }] } }, { name: "utf8_validation", number: 4, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.Utf8Validation", options: { retention: 1, targets: [4, 1], editionDefaults: [{ value: "NONE", edition: 900 }, { value: "VERIFY", edition: 999 }] } }, { name: "message_encoding", number: 5, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.MessageEncoding", options: { retention: 1, targets: [4, 1], editionDefaults: [{ value: "LENGTH_PREFIXED", edition: 900 }] } }, { name: "json_format", number: 6, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.JsonFormat", options: { retention: 1, targets: [3, 6, 1], editionDefaults: [{ value: "LEGACY_BEST_EFFORT", edition: 900 }, { value: "ALLOW", edition: 999 }] } }, { name: "enforce_naming_style", number: 7, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.EnforceNamingStyle", options: { retention: 2, targets: [1, 2, 3, 4, 5, 6, 7, 8, 9], editionDefaults: [{ value: "STYLE_LEGACY", edition: 900 }, { value: "STYLE2024", edition: 1001 }] } }, { name: "default_symbol_visibility", number: 8, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility", options: { retention: 2, targets: [1], editionDefaults: [{ value: "EXPORT_ALL", edition: 900 }, { value: "EXPORT_TOP_LEVEL", edition: 1001 }] } }], nestedType: [{ name: "VisibilityFeature", enumType: [{ name: "DefaultSymbolVisibility", value: [{ name: "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", number: 0 }, { name: "EXPORT_ALL", number: 1 }, { name: "EXPORT_TOP_LEVEL", number: 2 }, { name: "LOCAL_ALL", number: 3 }, { name: "STRICT", number: 4 }] }] }], enumType: [{ name: "FieldPresence", value: [{ name: "FIELD_PRESENCE_UNKNOWN", number: 0 }, { name: "EXPLICIT", number: 1 }, { name: "IMPLICIT", number: 2 }, { name: "LEGACY_REQUIRED", number: 3 }] }, { name: "EnumType", value: [{ name: "ENUM_TYPE_UNKNOWN", number: 0 }, { name: "OPEN", number: 1 }, { name: "CLOSED", number: 2 }] }, { name: "RepeatedFieldEncoding", value: [{ name: "REPEATED_FIELD_ENCODING_UNKNOWN", number: 0 }, { name: "PACKED", number: 1 }, { name: "EXPANDED", number: 2 }] }, { name: "Utf8Validation", value: [{ name: "UTF8_VALIDATION_UNKNOWN", number: 0 }, { name: "VERIFY", number: 2 }, { name: "NONE", number: 3 }] }, { name: "MessageEncoding", value: [{ name: "MESSAGE_ENCODING_UNKNOWN", number: 0 }, { name: "LENGTH_PREFIXED", number: 1 }, { name: "DELIMITED", number: 2 }] }, { name: "JsonFormat", value: [{ name: "JSON_FORMAT_UNKNOWN", number: 0 }, { name: "ALLOW", number: 1 }, { name: "LEGACY_BEST_EFFORT", number: 2 }] }, { name: "EnforceNamingStyle", value: [{ name: "ENFORCE_NAMING_STYLE_UNKNOWN", number: 0 }, { name: "STYLE2024", number: 1 }, { name: "STYLE_LEGACY", number: 2 }] }], extensionRange: [{ start: 1e3, end: 9995 }, { start: 9995, end: 1e4 }, { start: 1e4, end: 10001 }] }, { name: "FeatureSetDefaults", field: [{ name: "defaults", number: 1, type: 11, label: 3, typeName: ".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault" }, { name: "minimum_edition", number: 4, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "maximum_edition", number: 5, type: 14, label: 1, typeName: ".google.protobuf.Edition" }], nestedType: [{ name: "FeatureSetEditionDefault", field: [{ name: "edition", number: 3, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "overridable_features", number: 4, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "fixed_features", number: 5, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }] }] }, { name: "SourceCodeInfo", field: [{ name: "location", number: 1, type: 11, label: 3, typeName: ".google.protobuf.SourceCodeInfo.Location" }], nestedType: [{ name: "Location", field: [{ name: "path", number: 1, type: 5, label: 3, options: { packed: !0 } }, { name: "span", number: 2, type: 5, label: 3, options: { packed: !0 } }, { name: "leading_comments", number: 3, type: 9, label: 1 }, { name: "trailing_comments", number: 4, type: 9, label: 1 }, { name: "leading_detached_comments", number: 6, type: 9, label: 3 }] }], extensionRange: [{ start: 536e6, end: 536000001 }] }, { name: "GeneratedCodeInfo", field: [{ name: "annotation", number: 1, type: 11, label: 3, typeName: ".google.protobuf.GeneratedCodeInfo.Annotation" }], nestedType: [{ name: "Annotation", field: [{ name: "path", number: 1, type: 5, label: 3, options: { packed: !0 } }, { name: "source_file", number: 2, type: 9, label: 1 }, { name: "begin", number: 3, type: 5, label: 1 }, { name: "end", number: 4, type: 5, label: 1 }, { name: "semantic", number: 5, type: 14, label: 1, typeName: ".google.protobuf.GeneratedCodeInfo.Annotation.Semantic" }], enumType: [{ name: "Semantic", value: [{ name: "NONE", number: 0 }, { name: "SET", number: 1 }, { name: "ALIAS", number: 2 }] }] }] }], enumType: [{ name: "Edition", value: [{ name: "EDITION_UNKNOWN", number: 0 }, { name: "EDITION_LEGACY", number: 900 }, { name: "EDITION_PROTO2", number: 998 }, { name: "EDITION_PROTO3", number: 999 }, { name: "EDITION_2023", number: 1e3 }, { name: "EDITION_2024", number: 1001 }, { name: "EDITION_UNSTABLE", number: 9999 }, { name: "EDITION_1_TEST_ONLY", number: 1 }, { name: "EDITION_2_TEST_ONLY", number: 2 }, { name: "EDITION_99997_TEST_ONLY", number: 99997 }, { name: "EDITION_99998_TEST_ONLY", number: 99998 }, { name: "EDITION_99999_TEST_ONLY", number: 99999 }, { name: "EDITION_MAX", number: 2147483647 }] }, { name: "SymbolVisibility", value: [{ name: "VISIBILITY_UNSET", number: 0 }, { name: "VISIBILITY_LOCAL", number: 1 }, { name: "VISIBILITY_EXPORT", number: 2 }] }] }), Sr = /* @__PURE__ */ D(Tr, 1);
|
|
2732
|
-
var St;
|
|
2733
|
-
(function(e) {
|
|
2734
|
-
e[e.DECLARATION = 0] = "DECLARATION", e[e.UNVERIFIED = 1] = "UNVERIFIED";
|
|
2735
|
-
})(St || (St = {}));
|
|
2731
|
+
const kr = /* @__PURE__ */ Ir({ name: "google/protobuf/descriptor.proto", package: "google.protobuf", messageType: [{ name: "FileDescriptorSet", field: [{ name: "file", number: 1, type: 11, label: 3, typeName: ".google.protobuf.FileDescriptorProto" }], extensionRange: [{ start: 536e6, end: 536000001 }] }, { name: "FileDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "package", number: 2, type: 9, label: 1 }, { name: "dependency", number: 3, type: 9, label: 3 }, { name: "public_dependency", number: 10, type: 5, label: 3 }, { name: "weak_dependency", number: 11, type: 5, label: 3 }, { name: "option_dependency", number: 15, type: 9, label: 3 }, { name: "message_type", number: 4, type: 11, label: 3, typeName: ".google.protobuf.DescriptorProto" }, { name: "enum_type", number: 5, type: 11, label: 3, typeName: ".google.protobuf.EnumDescriptorProto" }, { name: "service", number: 6, type: 11, label: 3, typeName: ".google.protobuf.ServiceDescriptorProto" }, { name: "extension", number: 7, type: 11, label: 3, typeName: ".google.protobuf.FieldDescriptorProto" }, { name: "options", number: 8, type: 11, label: 1, typeName: ".google.protobuf.FileOptions" }, { name: "source_code_info", number: 9, type: 11, label: 1, typeName: ".google.protobuf.SourceCodeInfo" }, { name: "syntax", number: 12, type: 9, label: 1 }, { name: "edition", number: 14, type: 14, label: 1, typeName: ".google.protobuf.Edition" }] }, { name: "DescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "field", number: 2, type: 11, label: 3, typeName: ".google.protobuf.FieldDescriptorProto" }, { name: "extension", number: 6, type: 11, label: 3, typeName: ".google.protobuf.FieldDescriptorProto" }, { name: "nested_type", number: 3, type: 11, label: 3, typeName: ".google.protobuf.DescriptorProto" }, { name: "enum_type", number: 4, type: 11, label: 3, typeName: ".google.protobuf.EnumDescriptorProto" }, { name: "extension_range", number: 5, type: 11, label: 3, typeName: ".google.protobuf.DescriptorProto.ExtensionRange" }, { name: "oneof_decl", number: 8, type: 11, label: 3, typeName: ".google.protobuf.OneofDescriptorProto" }, { name: "options", number: 7, type: 11, label: 1, typeName: ".google.protobuf.MessageOptions" }, { name: "reserved_range", number: 9, type: 11, label: 3, typeName: ".google.protobuf.DescriptorProto.ReservedRange" }, { name: "reserved_name", number: 10, type: 9, label: 3 }, { name: "visibility", number: 11, type: 14, label: 1, typeName: ".google.protobuf.SymbolVisibility" }], nestedType: [{ name: "ExtensionRange", field: [{ name: "start", number: 1, type: 5, label: 1 }, { name: "end", number: 2, type: 5, label: 1 }, { name: "options", number: 3, type: 11, label: 1, typeName: ".google.protobuf.ExtensionRangeOptions" }] }, { name: "ReservedRange", field: [{ name: "start", number: 1, type: 5, label: 1 }, { name: "end", number: 2, type: 5, label: 1 }] }] }, { name: "ExtensionRangeOptions", field: [{ name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }, { name: "declaration", number: 2, type: 11, label: 3, typeName: ".google.protobuf.ExtensionRangeOptions.Declaration", options: { retention: 2 } }, { name: "features", number: 50, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "verification", number: 3, type: 14, label: 1, typeName: ".google.protobuf.ExtensionRangeOptions.VerificationState", defaultValue: "UNVERIFIED", options: { retention: 2 } }], nestedType: [{ name: "Declaration", field: [{ name: "number", number: 1, type: 5, label: 1 }, { name: "full_name", number: 2, type: 9, label: 1 }, { name: "type", number: 3, type: 9, label: 1 }, { name: "reserved", number: 5, type: 8, label: 1 }, { name: "repeated", number: 6, type: 8, label: 1 }] }], enumType: [{ name: "VerificationState", value: [{ name: "DECLARATION", number: 0 }, { name: "UNVERIFIED", number: 1 }] }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "FieldDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "number", number: 3, type: 5, label: 1 }, { name: "label", number: 4, type: 14, label: 1, typeName: ".google.protobuf.FieldDescriptorProto.Label" }, { name: "type", number: 5, type: 14, label: 1, typeName: ".google.protobuf.FieldDescriptorProto.Type" }, { name: "type_name", number: 6, type: 9, label: 1 }, { name: "extendee", number: 2, type: 9, label: 1 }, { name: "default_value", number: 7, type: 9, label: 1 }, { name: "oneof_index", number: 9, type: 5, label: 1 }, { name: "json_name", number: 10, type: 9, label: 1 }, { name: "options", number: 8, type: 11, label: 1, typeName: ".google.protobuf.FieldOptions" }, { name: "proto3_optional", number: 17, type: 8, label: 1 }], enumType: [{ name: "Type", value: [{ name: "TYPE_DOUBLE", number: 1 }, { name: "TYPE_FLOAT", number: 2 }, { name: "TYPE_INT64", number: 3 }, { name: "TYPE_UINT64", number: 4 }, { name: "TYPE_INT32", number: 5 }, { name: "TYPE_FIXED64", number: 6 }, { name: "TYPE_FIXED32", number: 7 }, { name: "TYPE_BOOL", number: 8 }, { name: "TYPE_STRING", number: 9 }, { name: "TYPE_GROUP", number: 10 }, { name: "TYPE_MESSAGE", number: 11 }, { name: "TYPE_BYTES", number: 12 }, { name: "TYPE_UINT32", number: 13 }, { name: "TYPE_ENUM", number: 14 }, { name: "TYPE_SFIXED32", number: 15 }, { name: "TYPE_SFIXED64", number: 16 }, { name: "TYPE_SINT32", number: 17 }, { name: "TYPE_SINT64", number: 18 }] }, { name: "Label", value: [{ name: "LABEL_OPTIONAL", number: 1 }, { name: "LABEL_REPEATED", number: 3 }, { name: "LABEL_REQUIRED", number: 2 }] }] }, { name: "OneofDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "options", number: 2, type: 11, label: 1, typeName: ".google.protobuf.OneofOptions" }] }, { name: "EnumDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "value", number: 2, type: 11, label: 3, typeName: ".google.protobuf.EnumValueDescriptorProto" }, { name: "options", number: 3, type: 11, label: 1, typeName: ".google.protobuf.EnumOptions" }, { name: "reserved_range", number: 4, type: 11, label: 3, typeName: ".google.protobuf.EnumDescriptorProto.EnumReservedRange" }, { name: "reserved_name", number: 5, type: 9, label: 3 }, { name: "visibility", number: 6, type: 14, label: 1, typeName: ".google.protobuf.SymbolVisibility" }], nestedType: [{ name: "EnumReservedRange", field: [{ name: "start", number: 1, type: 5, label: 1 }, { name: "end", number: 2, type: 5, label: 1 }] }] }, { name: "EnumValueDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "number", number: 2, type: 5, label: 1 }, { name: "options", number: 3, type: 11, label: 1, typeName: ".google.protobuf.EnumValueOptions" }] }, { name: "ServiceDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "method", number: 2, type: 11, label: 3, typeName: ".google.protobuf.MethodDescriptorProto" }, { name: "options", number: 3, type: 11, label: 1, typeName: ".google.protobuf.ServiceOptions" }] }, { name: "MethodDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "input_type", number: 2, type: 9, label: 1 }, { name: "output_type", number: 3, type: 9, label: 1 }, { name: "options", number: 4, type: 11, label: 1, typeName: ".google.protobuf.MethodOptions" }, { name: "client_streaming", number: 5, type: 8, label: 1, defaultValue: "false" }, { name: "server_streaming", number: 6, type: 8, label: 1, defaultValue: "false" }] }, { name: "FileOptions", field: [{ name: "java_package", number: 1, type: 9, label: 1 }, { name: "java_outer_classname", number: 8, type: 9, label: 1 }, { name: "java_multiple_files", number: 10, type: 8, label: 1, defaultValue: "false", options: {} }, { name: "java_generate_equals_and_hash", number: 20, type: 8, label: 1, options: { deprecated: !0 } }, { name: "java_string_check_utf8", number: 27, type: 8, label: 1, defaultValue: "false" }, { name: "optimize_for", number: 9, type: 14, label: 1, typeName: ".google.protobuf.FileOptions.OptimizeMode", defaultValue: "SPEED" }, { name: "go_package", number: 11, type: 9, label: 1 }, { name: "cc_generic_services", number: 16, type: 8, label: 1, defaultValue: "false" }, { name: "java_generic_services", number: 17, type: 8, label: 1, defaultValue: "false" }, { name: "py_generic_services", number: 18, type: 8, label: 1, defaultValue: "false" }, { name: "deprecated", number: 23, type: 8, label: 1, defaultValue: "false" }, { name: "cc_enable_arenas", number: 31, type: 8, label: 1, defaultValue: "true" }, { name: "objc_class_prefix", number: 36, type: 9, label: 1 }, { name: "csharp_namespace", number: 37, type: 9, label: 1 }, { name: "swift_prefix", number: 39, type: 9, label: 1 }, { name: "php_class_prefix", number: 40, type: 9, label: 1 }, { name: "php_namespace", number: 41, type: 9, label: 1 }, { name: "php_metadata_namespace", number: 44, type: 9, label: 1 }, { name: "ruby_package", number: 45, type: 9, label: 1 }, { name: "features", number: 50, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], enumType: [{ name: "OptimizeMode", value: [{ name: "SPEED", number: 1 }, { name: "CODE_SIZE", number: 2 }, { name: "LITE_RUNTIME", number: 3 }] }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "MessageOptions", field: [{ name: "message_set_wire_format", number: 1, type: 8, label: 1, defaultValue: "false" }, { name: "no_standard_descriptor_accessor", number: 2, type: 8, label: 1, defaultValue: "false" }, { name: "deprecated", number: 3, type: 8, label: 1, defaultValue: "false" }, { name: "map_entry", number: 7, type: 8, label: 1 }, { name: "deprecated_legacy_json_field_conflicts", number: 11, type: 8, label: 1, options: { deprecated: !0 } }, { name: "features", number: 12, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "FieldOptions", field: [{ name: "ctype", number: 1, type: 14, label: 1, typeName: ".google.protobuf.FieldOptions.CType", defaultValue: "STRING" }, { name: "packed", number: 2, type: 8, label: 1 }, { name: "jstype", number: 6, type: 14, label: 1, typeName: ".google.protobuf.FieldOptions.JSType", defaultValue: "JS_NORMAL" }, { name: "lazy", number: 5, type: 8, label: 1, defaultValue: "false" }, { name: "unverified_lazy", number: 15, type: 8, label: 1, defaultValue: "false" }, { name: "deprecated", number: 3, type: 8, label: 1, defaultValue: "false" }, { name: "weak", number: 10, type: 8, label: 1, defaultValue: "false", options: { deprecated: !0 } }, { name: "debug_redact", number: 16, type: 8, label: 1, defaultValue: "false" }, { name: "retention", number: 17, type: 14, label: 1, typeName: ".google.protobuf.FieldOptions.OptionRetention" }, { name: "targets", number: 19, type: 14, label: 3, typeName: ".google.protobuf.FieldOptions.OptionTargetType" }, { name: "edition_defaults", number: 20, type: 11, label: 3, typeName: ".google.protobuf.FieldOptions.EditionDefault" }, { name: "features", number: 21, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "feature_support", number: 22, type: 11, label: 1, typeName: ".google.protobuf.FieldOptions.FeatureSupport" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], nestedType: [{ name: "EditionDefault", field: [{ name: "edition", number: 3, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "value", number: 2, type: 9, label: 1 }] }, { name: "FeatureSupport", field: [{ name: "edition_introduced", number: 1, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "edition_deprecated", number: 2, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "deprecation_warning", number: 3, type: 9, label: 1 }, { name: "edition_removed", number: 4, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "removal_error", number: 5, type: 9, label: 1 }] }], enumType: [{ name: "CType", value: [{ name: "STRING", number: 0 }, { name: "CORD", number: 1 }, { name: "STRING_PIECE", number: 2 }] }, { name: "JSType", value: [{ name: "JS_NORMAL", number: 0 }, { name: "JS_STRING", number: 1 }, { name: "JS_NUMBER", number: 2 }] }, { name: "OptionRetention", value: [{ name: "RETENTION_UNKNOWN", number: 0 }, { name: "RETENTION_RUNTIME", number: 1 }, { name: "RETENTION_SOURCE", number: 2 }] }, { name: "OptionTargetType", value: [{ name: "TARGET_TYPE_UNKNOWN", number: 0 }, { name: "TARGET_TYPE_FILE", number: 1 }, { name: "TARGET_TYPE_EXTENSION_RANGE", number: 2 }, { name: "TARGET_TYPE_MESSAGE", number: 3 }, { name: "TARGET_TYPE_FIELD", number: 4 }, { name: "TARGET_TYPE_ONEOF", number: 5 }, { name: "TARGET_TYPE_ENUM", number: 6 }, { name: "TARGET_TYPE_ENUM_ENTRY", number: 7 }, { name: "TARGET_TYPE_SERVICE", number: 8 }, { name: "TARGET_TYPE_METHOD", number: 9 }] }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "OneofOptions", field: [{ name: "features", number: 1, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "EnumOptions", field: [{ name: "allow_alias", number: 2, type: 8, label: 1 }, { name: "deprecated", number: 3, type: 8, label: 1, defaultValue: "false" }, { name: "deprecated_legacy_json_field_conflicts", number: 6, type: 8, label: 1, options: { deprecated: !0 } }, { name: "features", number: 7, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "EnumValueOptions", field: [{ name: "deprecated", number: 1, type: 8, label: 1, defaultValue: "false" }, { name: "features", number: 2, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "debug_redact", number: 3, type: 8, label: 1, defaultValue: "false" }, { name: "feature_support", number: 4, type: 11, label: 1, typeName: ".google.protobuf.FieldOptions.FeatureSupport" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "ServiceOptions", field: [{ name: "features", number: 34, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "deprecated", number: 33, type: 8, label: 1, defaultValue: "false" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "MethodOptions", field: [{ name: "deprecated", number: 33, type: 8, label: 1, defaultValue: "false" }, { name: "idempotency_level", number: 34, type: 14, label: 1, typeName: ".google.protobuf.MethodOptions.IdempotencyLevel", defaultValue: "IDEMPOTENCY_UNKNOWN" }, { name: "features", number: 35, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], enumType: [{ name: "IdempotencyLevel", value: [{ name: "IDEMPOTENCY_UNKNOWN", number: 0 }, { name: "NO_SIDE_EFFECTS", number: 1 }, { name: "IDEMPOTENT", number: 2 }] }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "UninterpretedOption", field: [{ name: "name", number: 2, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption.NamePart" }, { name: "identifier_value", number: 3, type: 9, label: 1 }, { name: "positive_int_value", number: 4, type: 4, label: 1 }, { name: "negative_int_value", number: 5, type: 3, label: 1 }, { name: "double_value", number: 6, type: 1, label: 1 }, { name: "string_value", number: 7, type: 12, label: 1 }, { name: "aggregate_value", number: 8, type: 9, label: 1 }], nestedType: [{ name: "NamePart", field: [{ name: "name_part", number: 1, type: 9, label: 2 }, { name: "is_extension", number: 2, type: 8, label: 2 }] }] }, { name: "FeatureSet", field: [{ name: "field_presence", number: 1, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.FieldPresence", options: { retention: 1, targets: [4, 1], editionDefaults: [{ value: "EXPLICIT", edition: 900 }, { value: "IMPLICIT", edition: 999 }, { value: "EXPLICIT", edition: 1e3 }] } }, { name: "enum_type", number: 2, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.EnumType", options: { retention: 1, targets: [6, 1], editionDefaults: [{ value: "CLOSED", edition: 900 }, { value: "OPEN", edition: 999 }] } }, { name: "repeated_field_encoding", number: 3, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.RepeatedFieldEncoding", options: { retention: 1, targets: [4, 1], editionDefaults: [{ value: "EXPANDED", edition: 900 }, { value: "PACKED", edition: 999 }] } }, { name: "utf8_validation", number: 4, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.Utf8Validation", options: { retention: 1, targets: [4, 1], editionDefaults: [{ value: "NONE", edition: 900 }, { value: "VERIFY", edition: 999 }] } }, { name: "message_encoding", number: 5, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.MessageEncoding", options: { retention: 1, targets: [4, 1], editionDefaults: [{ value: "LENGTH_PREFIXED", edition: 900 }] } }, { name: "json_format", number: 6, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.JsonFormat", options: { retention: 1, targets: [3, 6, 1], editionDefaults: [{ value: "LEGACY_BEST_EFFORT", edition: 900 }, { value: "ALLOW", edition: 999 }] } }, { name: "enforce_naming_style", number: 7, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.EnforceNamingStyle", options: { retention: 2, targets: [1, 2, 3, 4, 5, 6, 7, 8, 9], editionDefaults: [{ value: "STYLE_LEGACY", edition: 900 }, { value: "STYLE2024", edition: 1001 }] } }, { name: "default_symbol_visibility", number: 8, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility", options: { retention: 2, targets: [1], editionDefaults: [{ value: "EXPORT_ALL", edition: 900 }, { value: "EXPORT_TOP_LEVEL", edition: 1001 }] } }], nestedType: [{ name: "VisibilityFeature", enumType: [{ name: "DefaultSymbolVisibility", value: [{ name: "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", number: 0 }, { name: "EXPORT_ALL", number: 1 }, { name: "EXPORT_TOP_LEVEL", number: 2 }, { name: "LOCAL_ALL", number: 3 }, { name: "STRICT", number: 4 }] }] }], enumType: [{ name: "FieldPresence", value: [{ name: "FIELD_PRESENCE_UNKNOWN", number: 0 }, { name: "EXPLICIT", number: 1 }, { name: "IMPLICIT", number: 2 }, { name: "LEGACY_REQUIRED", number: 3 }] }, { name: "EnumType", value: [{ name: "ENUM_TYPE_UNKNOWN", number: 0 }, { name: "OPEN", number: 1 }, { name: "CLOSED", number: 2 }] }, { name: "RepeatedFieldEncoding", value: [{ name: "REPEATED_FIELD_ENCODING_UNKNOWN", number: 0 }, { name: "PACKED", number: 1 }, { name: "EXPANDED", number: 2 }] }, { name: "Utf8Validation", value: [{ name: "UTF8_VALIDATION_UNKNOWN", number: 0 }, { name: "VERIFY", number: 2 }, { name: "NONE", number: 3 }] }, { name: "MessageEncoding", value: [{ name: "MESSAGE_ENCODING_UNKNOWN", number: 0 }, { name: "LENGTH_PREFIXED", number: 1 }, { name: "DELIMITED", number: 2 }] }, { name: "JsonFormat", value: [{ name: "JSON_FORMAT_UNKNOWN", number: 0 }, { name: "ALLOW", number: 1 }, { name: "LEGACY_BEST_EFFORT", number: 2 }] }, { name: "EnforceNamingStyle", value: [{ name: "ENFORCE_NAMING_STYLE_UNKNOWN", number: 0 }, { name: "STYLE2024", number: 1 }, { name: "STYLE_LEGACY", number: 2 }] }], extensionRange: [{ start: 1e3, end: 9995 }, { start: 9995, end: 1e4 }, { start: 1e4, end: 10001 }] }, { name: "FeatureSetDefaults", field: [{ name: "defaults", number: 1, type: 11, label: 3, typeName: ".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault" }, { name: "minimum_edition", number: 4, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "maximum_edition", number: 5, type: 14, label: 1, typeName: ".google.protobuf.Edition" }], nestedType: [{ name: "FeatureSetEditionDefault", field: [{ name: "edition", number: 3, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "overridable_features", number: 4, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "fixed_features", number: 5, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }] }] }, { name: "SourceCodeInfo", field: [{ name: "location", number: 1, type: 11, label: 3, typeName: ".google.protobuf.SourceCodeInfo.Location" }], nestedType: [{ name: "Location", field: [{ name: "path", number: 1, type: 5, label: 3, options: { packed: !0 } }, { name: "span", number: 2, type: 5, label: 3, options: { packed: !0 } }, { name: "leading_comments", number: 3, type: 9, label: 1 }, { name: "trailing_comments", number: 4, type: 9, label: 1 }, { name: "leading_detached_comments", number: 6, type: 9, label: 3 }] }], extensionRange: [{ start: 536e6, end: 536000001 }] }, { name: "GeneratedCodeInfo", field: [{ name: "annotation", number: 1, type: 11, label: 3, typeName: ".google.protobuf.GeneratedCodeInfo.Annotation" }], nestedType: [{ name: "Annotation", field: [{ name: "path", number: 1, type: 5, label: 3, options: { packed: !0 } }, { name: "source_file", number: 2, type: 9, label: 1 }, { name: "begin", number: 3, type: 5, label: 1 }, { name: "end", number: 4, type: 5, label: 1 }, { name: "semantic", number: 5, type: 14, label: 1, typeName: ".google.protobuf.GeneratedCodeInfo.Annotation.Semantic" }], enumType: [{ name: "Semantic", value: [{ name: "NONE", number: 0 }, { name: "SET", number: 1 }, { name: "ALIAS", number: 2 }] }] }] }], enumType: [{ name: "Edition", value: [{ name: "EDITION_UNKNOWN", number: 0 }, { name: "EDITION_LEGACY", number: 900 }, { name: "EDITION_PROTO2", number: 998 }, { name: "EDITION_PROTO3", number: 999 }, { name: "EDITION_2023", number: 1e3 }, { name: "EDITION_2024", number: 1001 }, { name: "EDITION_UNSTABLE", number: 9999 }, { name: "EDITION_1_TEST_ONLY", number: 1 }, { name: "EDITION_2_TEST_ONLY", number: 2 }, { name: "EDITION_99997_TEST_ONLY", number: 99997 }, { name: "EDITION_99998_TEST_ONLY", number: 99998 }, { name: "EDITION_99999_TEST_ONLY", number: 99999 }, { name: "EDITION_MAX", number: 2147483647 }] }, { name: "SymbolVisibility", value: [{ name: "VISIBILITY_UNSET", number: 0 }, { name: "VISIBILITY_LOCAL", number: 1 }, { name: "VISIBILITY_EXPORT", number: 2 }] }] }), Ar = /* @__PURE__ */ R(kr, 1);
|
|
2736
2732
|
var kt;
|
|
2737
2733
|
(function(e) {
|
|
2738
|
-
e[e.
|
|
2734
|
+
e[e.DECLARATION = 0] = "DECLARATION", e[e.UNVERIFIED = 1] = "UNVERIFIED";
|
|
2739
2735
|
})(kt || (kt = {}));
|
|
2740
2736
|
var At;
|
|
2741
2737
|
(function(e) {
|
|
2742
|
-
e[e.
|
|
2738
|
+
e[e.DOUBLE = 1] = "DOUBLE", e[e.FLOAT = 2] = "FLOAT", e[e.INT64 = 3] = "INT64", e[e.UINT64 = 4] = "UINT64", e[e.INT32 = 5] = "INT32", e[e.FIXED64 = 6] = "FIXED64", e[e.FIXED32 = 7] = "FIXED32", e[e.BOOL = 8] = "BOOL", e[e.STRING = 9] = "STRING", e[e.GROUP = 10] = "GROUP", e[e.MESSAGE = 11] = "MESSAGE", e[e.BYTES = 12] = "BYTES", e[e.UINT32 = 13] = "UINT32", e[e.ENUM = 14] = "ENUM", e[e.SFIXED32 = 15] = "SFIXED32", e[e.SFIXED64 = 16] = "SFIXED64", e[e.SINT32 = 17] = "SINT32", e[e.SINT64 = 18] = "SINT64";
|
|
2743
2739
|
})(At || (At = {}));
|
|
2740
|
+
var Rt;
|
|
2741
|
+
(function(e) {
|
|
2742
|
+
e[e.OPTIONAL = 1] = "OPTIONAL", e[e.REPEATED = 3] = "REPEATED", e[e.REQUIRED = 2] = "REQUIRED";
|
|
2743
|
+
})(Rt || (Rt = {}));
|
|
2744
2744
|
var _t;
|
|
2745
2745
|
(function(e) {
|
|
2746
2746
|
e[e.SPEED = 1] = "SPEED", e[e.CODE_SIZE = 2] = "CODE_SIZE", e[e.LITE_RUNTIME = 3] = "LITE_RUNTIME";
|
|
2747
2747
|
})(_t || (_t = {}));
|
|
2748
|
-
var
|
|
2748
|
+
var vt;
|
|
2749
2749
|
(function(e) {
|
|
2750
2750
|
e[e.STRING = 0] = "STRING", e[e.CORD = 1] = "CORD", e[e.STRING_PIECE = 2] = "STRING_PIECE";
|
|
2751
|
-
})(
|
|
2752
|
-
var
|
|
2751
|
+
})(vt || (vt = {}));
|
|
2752
|
+
var Ot;
|
|
2753
2753
|
(function(e) {
|
|
2754
2754
|
e[e.JS_NORMAL = 0] = "JS_NORMAL", e[e.JS_STRING = 1] = "JS_STRING", e[e.JS_NUMBER = 2] = "JS_NUMBER";
|
|
2755
|
-
})(
|
|
2755
|
+
})(Ot || (Ot = {}));
|
|
2756
2756
|
var Ct;
|
|
2757
2757
|
(function(e) {
|
|
2758
2758
|
e[e.RETENTION_UNKNOWN = 0] = "RETENTION_UNKNOWN", e[e.RETENTION_RUNTIME = 1] = "RETENTION_RUNTIME", e[e.RETENTION_SOURCE = 2] = "RETENTION_SOURCE";
|
|
2759
2759
|
})(Ct || (Ct = {}));
|
|
2760
|
-
var
|
|
2760
|
+
var Dt;
|
|
2761
2761
|
(function(e) {
|
|
2762
2762
|
e[e.TARGET_TYPE_UNKNOWN = 0] = "TARGET_TYPE_UNKNOWN", e[e.TARGET_TYPE_FILE = 1] = "TARGET_TYPE_FILE", e[e.TARGET_TYPE_EXTENSION_RANGE = 2] = "TARGET_TYPE_EXTENSION_RANGE", e[e.TARGET_TYPE_MESSAGE = 3] = "TARGET_TYPE_MESSAGE", e[e.TARGET_TYPE_FIELD = 4] = "TARGET_TYPE_FIELD", e[e.TARGET_TYPE_ONEOF = 5] = "TARGET_TYPE_ONEOF", e[e.TARGET_TYPE_ENUM = 6] = "TARGET_TYPE_ENUM", e[e.TARGET_TYPE_ENUM_ENTRY = 7] = "TARGET_TYPE_ENUM_ENTRY", e[e.TARGET_TYPE_SERVICE = 8] = "TARGET_TYPE_SERVICE", e[e.TARGET_TYPE_METHOD = 9] = "TARGET_TYPE_METHOD";
|
|
2763
|
-
})(
|
|
2764
|
-
var
|
|
2763
|
+
})(Dt || (Dt = {}));
|
|
2764
|
+
var Ut;
|
|
2765
2765
|
(function(e) {
|
|
2766
2766
|
e[e.IDEMPOTENCY_UNKNOWN = 0] = "IDEMPOTENCY_UNKNOWN", e[e.NO_SIDE_EFFECTS = 1] = "NO_SIDE_EFFECTS", e[e.IDEMPOTENT = 2] = "IDEMPOTENT";
|
|
2767
|
-
})(
|
|
2767
|
+
})(Ut || (Ut = {}));
|
|
2768
2768
|
var Lt;
|
|
2769
2769
|
(function(e) {
|
|
2770
2770
|
e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", e[e.EXPORT_ALL = 1] = "EXPORT_ALL", e[e.EXPORT_TOP_LEVEL = 2] = "EXPORT_TOP_LEVEL", e[e.LOCAL_ALL = 3] = "LOCAL_ALL", e[e.STRICT = 4] = "STRICT";
|
|
2771
2771
|
})(Lt || (Lt = {}));
|
|
2772
|
-
var
|
|
2772
|
+
var Mt;
|
|
2773
2773
|
(function(e) {
|
|
2774
2774
|
e[e.FIELD_PRESENCE_UNKNOWN = 0] = "FIELD_PRESENCE_UNKNOWN", e[e.EXPLICIT = 1] = "EXPLICIT", e[e.IMPLICIT = 2] = "IMPLICIT", e[e.LEGACY_REQUIRED = 3] = "LEGACY_REQUIRED";
|
|
2775
|
-
})(
|
|
2775
|
+
})(Mt || (Mt = {}));
|
|
2776
2776
|
var xt;
|
|
2777
2777
|
(function(e) {
|
|
2778
2778
|
e[e.ENUM_TYPE_UNKNOWN = 0] = "ENUM_TYPE_UNKNOWN", e[e.OPEN = 1] = "OPEN", e[e.CLOSED = 2] = "CLOSED";
|
|
2779
2779
|
})(xt || (xt = {}));
|
|
2780
|
-
var
|
|
2780
|
+
var Pt;
|
|
2781
2781
|
(function(e) {
|
|
2782
2782
|
e[e.REPEATED_FIELD_ENCODING_UNKNOWN = 0] = "REPEATED_FIELD_ENCODING_UNKNOWN", e[e.PACKED = 1] = "PACKED", e[e.EXPANDED = 2] = "EXPANDED";
|
|
2783
|
-
})(
|
|
2783
|
+
})(Pt || (Pt = {}));
|
|
2784
2784
|
var Vt;
|
|
2785
2785
|
(function(e) {
|
|
2786
2786
|
e[e.UTF8_VALIDATION_UNKNOWN = 0] = "UTF8_VALIDATION_UNKNOWN", e[e.VERIFY = 2] = "VERIFY", e[e.NONE = 3] = "NONE";
|
|
2787
2787
|
})(Vt || (Vt = {}));
|
|
2788
|
-
var Bt;
|
|
2789
|
-
(function(e) {
|
|
2790
|
-
e[e.MESSAGE_ENCODING_UNKNOWN = 0] = "MESSAGE_ENCODING_UNKNOWN", e[e.LENGTH_PREFIXED = 1] = "LENGTH_PREFIXED", e[e.DELIMITED = 2] = "DELIMITED";
|
|
2791
|
-
})(Bt || (Bt = {}));
|
|
2792
|
-
var Pt;
|
|
2793
|
-
(function(e) {
|
|
2794
|
-
e[e.JSON_FORMAT_UNKNOWN = 0] = "JSON_FORMAT_UNKNOWN", e[e.ALLOW = 1] = "ALLOW", e[e.LEGACY_BEST_EFFORT = 2] = "LEGACY_BEST_EFFORT";
|
|
2795
|
-
})(Pt || (Pt = {}));
|
|
2796
2788
|
var Ft;
|
|
2797
2789
|
(function(e) {
|
|
2798
|
-
e[e.
|
|
2790
|
+
e[e.MESSAGE_ENCODING_UNKNOWN = 0] = "MESSAGE_ENCODING_UNKNOWN", e[e.LENGTH_PREFIXED = 1] = "LENGTH_PREFIXED", e[e.DELIMITED = 2] = "DELIMITED";
|
|
2799
2791
|
})(Ft || (Ft = {}));
|
|
2800
2792
|
var Gt;
|
|
2801
2793
|
(function(e) {
|
|
2802
|
-
e[e.
|
|
2794
|
+
e[e.JSON_FORMAT_UNKNOWN = 0] = "JSON_FORMAT_UNKNOWN", e[e.ALLOW = 1] = "ALLOW", e[e.LEGACY_BEST_EFFORT = 2] = "LEGACY_BEST_EFFORT";
|
|
2803
2795
|
})(Gt || (Gt = {}));
|
|
2796
|
+
var Bt;
|
|
2797
|
+
(function(e) {
|
|
2798
|
+
e[e.ENFORCE_NAMING_STYLE_UNKNOWN = 0] = "ENFORCE_NAMING_STYLE_UNKNOWN", e[e.STYLE2024 = 1] = "STYLE2024", e[e.STYLE_LEGACY = 2] = "STYLE_LEGACY";
|
|
2799
|
+
})(Bt || (Bt = {}));
|
|
2804
2800
|
var Yt;
|
|
2805
2801
|
(function(e) {
|
|
2806
|
-
e[e.
|
|
2802
|
+
e[e.NONE = 0] = "NONE", e[e.SET = 1] = "SET", e[e.ALIAS = 2] = "ALIAS";
|
|
2807
2803
|
})(Yt || (Yt = {}));
|
|
2808
2804
|
var $t;
|
|
2809
2805
|
(function(e) {
|
|
2810
|
-
e[e.
|
|
2806
|
+
e[e.EDITION_UNKNOWN = 0] = "EDITION_UNKNOWN", e[e.EDITION_LEGACY = 900] = "EDITION_LEGACY", e[e.EDITION_PROTO2 = 998] = "EDITION_PROTO2", e[e.EDITION_PROTO3 = 999] = "EDITION_PROTO3", e[e.EDITION_2023 = 1e3] = "EDITION_2023", e[e.EDITION_2024 = 1001] = "EDITION_2024", e[e.EDITION_UNSTABLE = 9999] = "EDITION_UNSTABLE", e[e.EDITION_1_TEST_ONLY = 1] = "EDITION_1_TEST_ONLY", e[e.EDITION_2_TEST_ONLY = 2] = "EDITION_2_TEST_ONLY", e[e.EDITION_99997_TEST_ONLY = 99997] = "EDITION_99997_TEST_ONLY", e[e.EDITION_99998_TEST_ONLY = 99998] = "EDITION_99998_TEST_ONLY", e[e.EDITION_99999_TEST_ONLY = 99999] = "EDITION_99999_TEST_ONLY", e[e.EDITION_MAX = 2147483647] = "EDITION_MAX";
|
|
2811
2807
|
})($t || ($t = {}));
|
|
2812
|
-
|
|
2808
|
+
var Xt;
|
|
2809
|
+
(function(e) {
|
|
2810
|
+
e[e.VISIBILITY_UNSET = 0] = "VISIBILITY_UNSET", e[e.VISIBILITY_LOCAL = 1] = "VISIBILITY_LOCAL", e[e.VISIBILITY_EXPORT = 2] = "VISIBILITY_EXPORT";
|
|
2811
|
+
})(Xt || (Xt = {}));
|
|
2812
|
+
function Rr(e) {
|
|
2813
2813
|
return Object.assign(Object.assign({ readUnknownFields: !0, recursionLimit: 100 }, e), { depth: 0 });
|
|
2814
2814
|
}
|
|
2815
|
-
function
|
|
2816
|
-
const s =
|
|
2817
|
-
return
|
|
2815
|
+
function fe(e, t, n) {
|
|
2816
|
+
const s = ge(e, void 0, !1);
|
|
2817
|
+
return Gn(s, new Ds(t), Rr(n), !1, t.byteLength), s.message;
|
|
2818
2818
|
}
|
|
2819
|
-
function
|
|
2819
|
+
function Gn(e, t, n, s, r) {
|
|
2820
2820
|
var i;
|
|
2821
2821
|
if (++n.depth > n.recursionLimit)
|
|
2822
2822
|
throw new Error(`cannot decode ${e.desc} from binary: maximum recursion depth of ${n.recursionLimit} reached`);
|
|
2823
2823
|
const a = s ? t.len : t.pos + r;
|
|
2824
2824
|
let o, l;
|
|
2825
2825
|
const u = (i = e.getUnknown()) !== null && i !== void 0 ? i : [];
|
|
2826
|
-
for (; t.pos < a && ([o, l] = t.tag(), !(s && l ==
|
|
2826
|
+
for (; t.pos < a && ([o, l] = t.tag(), !(s && l == I.EndGroup)); ) {
|
|
2827
2827
|
const d = e.findNumber(o);
|
|
2828
2828
|
if (!d) {
|
|
2829
|
-
const
|
|
2830
|
-
n.readUnknownFields && u.push({ no: o, wireType: l, data:
|
|
2829
|
+
const f = n.recursionLimit - n.depth, p = t.skip(l, o, f);
|
|
2830
|
+
n.readUnknownFields && u.push({ no: o, wireType: l, data: p });
|
|
2831
2831
|
continue;
|
|
2832
2832
|
}
|
|
2833
|
-
|
|
2833
|
+
_r(e, t, d, l, n);
|
|
2834
2834
|
}
|
|
2835
|
-
if (s && (l !=
|
|
2835
|
+
if (s && (l != I.EndGroup || o !== r))
|
|
2836
2836
|
throw new Error("invalid end group tag");
|
|
2837
2837
|
u.length > 0 && e.setUnknown(u), n.depth--;
|
|
2838
2838
|
}
|
|
2839
|
-
function
|
|
2839
|
+
function _r(e, t, n, s, r) {
|
|
2840
2840
|
var i;
|
|
2841
2841
|
switch (n.fieldKind) {
|
|
2842
2842
|
case "scalar":
|
|
2843
|
-
e.set(n,
|
|
2843
|
+
e.set(n, $(t, n.scalar, n.utf8Validation));
|
|
2844
2844
|
break;
|
|
2845
2845
|
case "enum":
|
|
2846
|
-
const a =
|
|
2846
|
+
const a = $(t, c.INT32);
|
|
2847
2847
|
if (n.enum.open)
|
|
2848
2848
|
e.set(n, a);
|
|
2849
2849
|
else if (n.enum.values.some((l) => l.number === a))
|
|
@@ -2860,17 +2860,17 @@ function Ar(e, t, n, s, r) {
|
|
|
2860
2860
|
}
|
|
2861
2861
|
break;
|
|
2862
2862
|
case "message":
|
|
2863
|
-
e.set(n,
|
|
2863
|
+
e.set(n, et(t, r, n, e.get(n)));
|
|
2864
2864
|
break;
|
|
2865
2865
|
case "list":
|
|
2866
2866
|
Or(t, s, e.get(n), r);
|
|
2867
2867
|
break;
|
|
2868
2868
|
case "map":
|
|
2869
|
-
|
|
2869
|
+
vr(t, e.get(n), r);
|
|
2870
2870
|
break;
|
|
2871
2871
|
}
|
|
2872
2872
|
}
|
|
2873
|
-
function
|
|
2873
|
+
function vr(e, t, n) {
|
|
2874
2874
|
const s = t.field();
|
|
2875
2875
|
let r, i;
|
|
2876
2876
|
const a = e.uint32(), o = e.pos + a;
|
|
@@ -2878,33 +2878,33 @@ function _r(e, t, n) {
|
|
|
2878
2878
|
const [l] = e.tag();
|
|
2879
2879
|
switch (l) {
|
|
2880
2880
|
case 1:
|
|
2881
|
-
r =
|
|
2881
|
+
r = $(e, s.mapKey, s.utf8Validation);
|
|
2882
2882
|
break;
|
|
2883
2883
|
case 2:
|
|
2884
2884
|
switch (s.mapKind) {
|
|
2885
2885
|
case "scalar":
|
|
2886
|
-
i =
|
|
2886
|
+
i = $(e, s.scalar, s.utf8Validation);
|
|
2887
2887
|
break;
|
|
2888
2888
|
case "enum":
|
|
2889
2889
|
i = e.int32();
|
|
2890
2890
|
break;
|
|
2891
2891
|
case "message":
|
|
2892
|
-
i =
|
|
2892
|
+
i = et(e, n, s);
|
|
2893
2893
|
break;
|
|
2894
2894
|
}
|
|
2895
2895
|
break;
|
|
2896
2896
|
}
|
|
2897
2897
|
}
|
|
2898
|
-
if (r === void 0 && (r =
|
|
2898
|
+
if (r === void 0 && (r = q(s.mapKey, !1)), i === void 0)
|
|
2899
2899
|
switch (s.mapKind) {
|
|
2900
2900
|
case "scalar":
|
|
2901
|
-
i =
|
|
2901
|
+
i = q(s.scalar, !1);
|
|
2902
2902
|
break;
|
|
2903
2903
|
case "enum":
|
|
2904
2904
|
i = s.enum.values[0].number;
|
|
2905
2905
|
break;
|
|
2906
2906
|
case "message":
|
|
2907
|
-
i =
|
|
2907
|
+
i = ge(s.message, void 0, !1);
|
|
2908
2908
|
break;
|
|
2909
2909
|
}
|
|
2910
2910
|
t.set(r, i);
|
|
@@ -2913,23 +2913,23 @@ function Or(e, t, n, s) {
|
|
|
2913
2913
|
var r;
|
|
2914
2914
|
const i = n.field();
|
|
2915
2915
|
if (i.listKind === "message") {
|
|
2916
|
-
n.add(
|
|
2916
|
+
n.add(et(e, s, i));
|
|
2917
2917
|
return;
|
|
2918
2918
|
}
|
|
2919
2919
|
const a = (r = i.scalar) !== null && r !== void 0 ? r : c.INT32;
|
|
2920
|
-
if (!(t ==
|
|
2921
|
-
n.add(
|
|
2920
|
+
if (!(t == I.LengthDelimited && a != c.STRING && a != c.BYTES)) {
|
|
2921
|
+
n.add($(e, a, i.utf8Validation));
|
|
2922
2922
|
return;
|
|
2923
2923
|
}
|
|
2924
2924
|
const l = e.uint32() + e.pos;
|
|
2925
2925
|
for (; e.pos < l; )
|
|
2926
|
-
n.add(
|
|
2926
|
+
n.add($(e, a, i.utf8Validation));
|
|
2927
2927
|
}
|
|
2928
|
-
function
|
|
2929
|
-
const r = n.delimitedEncoding, i = s ??
|
|
2930
|
-
return
|
|
2928
|
+
function et(e, t, n, s) {
|
|
2929
|
+
const r = n.delimitedEncoding, i = s ?? ge(n.message, void 0, !1);
|
|
2930
|
+
return Gn(i, e, t, r, r ? n.number : e.uint32()), i;
|
|
2931
2931
|
}
|
|
2932
|
-
function
|
|
2932
|
+
function $(e, t, n = !1) {
|
|
2933
2933
|
switch (t) {
|
|
2934
2934
|
case c.STRING:
|
|
2935
2935
|
return e.string(n);
|
|
@@ -2963,95 +2963,95 @@ function G(e, t, n = !1) {
|
|
|
2963
2963
|
return e.sint32();
|
|
2964
2964
|
}
|
|
2965
2965
|
}
|
|
2966
|
-
function
|
|
2966
|
+
function Cr(e, t) {
|
|
2967
2967
|
var n;
|
|
2968
|
-
const s =
|
|
2969
|
-
return s.messageType.forEach(
|
|
2968
|
+
const s = fe(Ar, Bs(e));
|
|
2969
|
+
return s.messageType.forEach(Qe), s.dependency = (n = void 0) !== null && n !== void 0 ? n : [], Ln(s, (i) => {
|
|
2970
2970
|
}).getFile(s.name);
|
|
2971
2971
|
}
|
|
2972
|
-
const
|
|
2972
|
+
const Dr = 3, Kt = {
|
|
2973
2973
|
writeUnknownFields: !0
|
|
2974
2974
|
};
|
|
2975
|
-
function
|
|
2975
|
+
function Ur(e) {
|
|
2976
2976
|
return e ? Object.assign(Object.assign({}, Kt), e) : Kt;
|
|
2977
2977
|
}
|
|
2978
|
-
function
|
|
2979
|
-
return
|
|
2978
|
+
function te(e, t, n) {
|
|
2979
|
+
return me(new Cs(), Ur(n), ge(e, t)).finish();
|
|
2980
2980
|
}
|
|
2981
|
-
function
|
|
2981
|
+
function me(e, t, n) {
|
|
2982
2982
|
var s;
|
|
2983
2983
|
for (const r of n.sortedFields) {
|
|
2984
2984
|
if (!n.isSet(r)) {
|
|
2985
|
-
if (r.presence ==
|
|
2985
|
+
if (r.presence == Dr)
|
|
2986
2986
|
throw new Error(`cannot encode ${r} to binary: required field not set`);
|
|
2987
2987
|
continue;
|
|
2988
2988
|
}
|
|
2989
|
-
|
|
2989
|
+
Lr(e, t, n, r);
|
|
2990
2990
|
}
|
|
2991
2991
|
if (t.writeUnknownFields)
|
|
2992
2992
|
for (const { no: r, wireType: i, data: a } of (s = n.getUnknown()) !== null && s !== void 0 ? s : [])
|
|
2993
2993
|
e.tag(r, i).raw(a);
|
|
2994
2994
|
return e;
|
|
2995
2995
|
}
|
|
2996
|
-
function
|
|
2996
|
+
function Lr(e, t, n, s) {
|
|
2997
2997
|
var r;
|
|
2998
2998
|
switch (s.fieldKind) {
|
|
2999
2999
|
case "scalar":
|
|
3000
3000
|
case "enum":
|
|
3001
|
-
|
|
3001
|
+
pe(e, n.desc.typeName, s.name, (r = s.scalar) !== null && r !== void 0 ? r : c.INT32, s.number, n.get(s));
|
|
3002
3002
|
break;
|
|
3003
3003
|
case "list":
|
|
3004
|
-
|
|
3004
|
+
Mr(e, t, s, n.get(s));
|
|
3005
3005
|
break;
|
|
3006
3006
|
case "message":
|
|
3007
|
-
|
|
3007
|
+
Bn(e, t, s, n.get(s));
|
|
3008
3008
|
break;
|
|
3009
3009
|
case "map":
|
|
3010
3010
|
for (const [i, a] of n.get(s))
|
|
3011
|
-
|
|
3011
|
+
xr(e, t, s, i, a);
|
|
3012
3012
|
break;
|
|
3013
3013
|
}
|
|
3014
3014
|
}
|
|
3015
|
-
function
|
|
3016
|
-
|
|
3015
|
+
function pe(e, t, n, s, r, i) {
|
|
3016
|
+
Yn(e.tag(r, Pr(s)), t, n, s, i);
|
|
3017
3017
|
}
|
|
3018
|
-
function
|
|
3019
|
-
n.delimitedEncoding ?
|
|
3018
|
+
function Bn(e, t, n, s) {
|
|
3019
|
+
n.delimitedEncoding ? me(e.tag(n.number, I.StartGroup), t, s).tag(n.number, I.EndGroup) : me(e.tag(n.number, I.LengthDelimited).fork(), t, s).join();
|
|
3020
3020
|
}
|
|
3021
|
-
function
|
|
3021
|
+
function Mr(e, t, n, s) {
|
|
3022
3022
|
var r;
|
|
3023
3023
|
if (n.listKind == "message") {
|
|
3024
3024
|
for (const a of s)
|
|
3025
|
-
|
|
3025
|
+
Bn(e, t, n, a);
|
|
3026
3026
|
return;
|
|
3027
3027
|
}
|
|
3028
3028
|
const i = (r = n.scalar) !== null && r !== void 0 ? r : c.INT32;
|
|
3029
3029
|
if (n.packed) {
|
|
3030
3030
|
if (!s.size)
|
|
3031
3031
|
return;
|
|
3032
|
-
e.tag(n.number,
|
|
3032
|
+
e.tag(n.number, I.LengthDelimited).fork();
|
|
3033
3033
|
for (const a of s)
|
|
3034
|
-
|
|
3034
|
+
Yn(e, n.parent.typeName, n.name, i, a);
|
|
3035
3035
|
e.join();
|
|
3036
3036
|
return;
|
|
3037
3037
|
}
|
|
3038
3038
|
for (const a of s)
|
|
3039
|
-
|
|
3039
|
+
pe(e, n.parent.typeName, n.name, i, n.number, a);
|
|
3040
3040
|
}
|
|
3041
|
-
function
|
|
3041
|
+
function xr(e, t, n, s, r) {
|
|
3042
3042
|
var i;
|
|
3043
|
-
switch (e.tag(n.number,
|
|
3043
|
+
switch (e.tag(n.number, I.LengthDelimited).fork(), pe(e, n.parent.typeName, n.name, n.mapKey, 1, s), n.mapKind) {
|
|
3044
3044
|
case "scalar":
|
|
3045
3045
|
case "enum":
|
|
3046
|
-
|
|
3046
|
+
pe(e, n.parent.typeName, n.name, (i = n.scalar) !== null && i !== void 0 ? i : c.INT32, 2, r);
|
|
3047
3047
|
break;
|
|
3048
3048
|
case "message":
|
|
3049
|
-
|
|
3049
|
+
me(e.tag(2, I.LengthDelimited).fork(), t, r).join();
|
|
3050
3050
|
break;
|
|
3051
3051
|
}
|
|
3052
3052
|
e.join();
|
|
3053
3053
|
}
|
|
3054
|
-
function
|
|
3054
|
+
function Yn(e, t, n, s, r) {
|
|
3055
3055
|
try {
|
|
3056
3056
|
switch (s) {
|
|
3057
3057
|
case c.STRING:
|
|
@@ -3104,80 +3104,102 @@ function Gn(e, t, n, s, r) {
|
|
|
3104
3104
|
throw i instanceof Error ? new Error(`cannot encode field ${t}.${n} to binary: ${i.message}`) : i;
|
|
3105
3105
|
}
|
|
3106
3106
|
}
|
|
3107
|
-
function
|
|
3107
|
+
function Pr(e) {
|
|
3108
3108
|
switch (e) {
|
|
3109
3109
|
case c.BYTES:
|
|
3110
3110
|
case c.STRING:
|
|
3111
|
-
return
|
|
3111
|
+
return I.LengthDelimited;
|
|
3112
3112
|
case c.DOUBLE:
|
|
3113
3113
|
case c.FIXED64:
|
|
3114
3114
|
case c.SFIXED64:
|
|
3115
|
-
return
|
|
3115
|
+
return I.Bit64;
|
|
3116
3116
|
case c.FIXED32:
|
|
3117
3117
|
case c.SFIXED32:
|
|
3118
3118
|
case c.FLOAT:
|
|
3119
|
-
return
|
|
3119
|
+
return I.Bit32;
|
|
3120
3120
|
default:
|
|
3121
|
-
return
|
|
3121
|
+
return I.Varint;
|
|
3122
3122
|
}
|
|
3123
3123
|
}
|
|
3124
|
-
function
|
|
3124
|
+
function Vr(e, t, ...n) {
|
|
3125
3125
|
if (n.length > 0)
|
|
3126
3126
|
throw new Error();
|
|
3127
3127
|
return e.services[t];
|
|
3128
3128
|
}
|
|
3129
|
-
const
|
|
3129
|
+
const _ = /* @__PURE__ */ Cr("CgpjaGF0LnByb3RvEgdjaGF0LnYxIkkKCkF0dGFjaG1lbnQSCgoCaWQYASABKAkSDAoEbmFtZRgCIAEoCRIUCgxjb250ZW50X3R5cGUYAyABKAkSCwoDdXJsGAQgASgJIkEKBkJ1dHRvbhINCgVsYWJlbBgBIAEoCRINCgV2YWx1ZRgCIAEoCRIZCgtidXR0b25fdHlwZRgDIAEoCVIEdHlwZSJ/CgRDYXJkEg0KBXRpdGxlGAEgASgJEhMKC2Rlc2NyaXB0aW9uGAIgASgJEicKBWltYWdlGAMgASgLMhMuY2hhdC52MS5BdHRhY2htZW50SACIAQESIAoHYnV0dG9ucxgEIAMoCzIPLmNoYXQudjEuQnV0dG9uQggKBl9pbWFnZSIjCg9NZXNzYWdlTWV0YWRhdGESEAoIYXVkaWVuY2UYASABKAkiIgoOVHlwaW5nTWV0YWRhdGESEAoIYXVkaWVuY2UYASABKAki7QIKB01lc3NhZ2USCgoCaWQYASABKAkSDAoEcm9sZRgCIAEoCRIRCgR0ZXh0GAMgASgJSACIAQESEQoEaHRtbBgEIAEoCUgBiAEBEigKC2F0dGFjaG1lbnRzGAUgAygLMhMuY2hhdC52MS5BdHRhY2htZW50EiAKB2J1dHRvbnMYBiADKAsyDy5jaGF0LnYxLkJ1dHRvbhIeCgdnYWxsZXJ5GAcgAygLMg0uY2hhdC52MS5DYXJkEhEKCXRpbWVzdGFtcBgIIAEoCRIYCgd1c2VyX2lkGAkgASgJUgd1c2VyX2lkEhwKCXVzZXJfbmFtZRgKIAEoCVIJdXNlcl9uYW1lEg0KBXN0YXRlGAsgASgJEhMKBmFjdGlvbhgMIAEoCUgCiAEBEioKCG1ldGFkYXRhGA0gASgLMhguY2hhdC52MS5NZXNzYWdlTWV0YWRhdGFCBwoFX3RleHRCBwoFX2h0bWxCCQoHX2FjdGlvbiKRAQoLVHlwaW5nRXZlbnQSFgoOcGFydGljaXBhbnRfaWQYASABKAkSDQoFc3RhdGUYAiABKAkSDAoEcm9sZRgDIAEoCRIPCgd1c2VyX2lkGAQgASgJEhEKCXVzZXJfbmFtZRgFIAEoCRIpCghtZXRhZGF0YRgGIAEoCzIXLmNoYXQudjEuVHlwaW5nTWV0YWRhdGEiXQoRUGFydGljaXBhbnRKb2luZWQSFgoOcGFydGljaXBhbnRfaWQYASABKAkSDAoEcm9sZRgCIAEoCRIPCgd1c2VyX2lkGAMgASgJEhEKCXVzZXJfbmFtZRgEIAEoCSJJCg9QYXJ0aWNpcGFudExlZnQSFgoOcGFydGljaXBhbnRfaWQYASABKAkSEwoGcmVhc29uGAIgASgJSACIAQFCCQoHX3JlYXNvbiJjCgNBY3cSDwoHZW5hYmxlZBgBIAEoCBIQCghkdXJhdGlvbhgCIAEoAxIPCgdlbmZvcmNlGAMgASgIEhIKCnN0YXJ0ZWRfYXQYBCABKAkSFAoMZGlzcG9zaXRpb25zGAUgAygJIkYKDFNlc3Npb25FbmRlZBIOCgZyZWFzb24YASABKAkSHgoDYWN3GAIgASgLMgwuY2hhdC52MS5BY3dIAIgBAUIGCgRfYWN3IhwKCUhlYXJ0YmVhdBIPCgd1bml4X21zGAEgASgDIqkCCglDaGF0RXZlbnQSIwoHbWVzc2FnZRgBIAEoCzIQLmNoYXQudjEuTWVzc2FnZUgAEiYKBnR5cGluZxgCIAEoCzIULmNoYXQudjEuVHlwaW5nRXZlbnRIABI4ChJwYXJ0aWNpcGFudF9qb2luZWQYAyABKAsyGi5jaGF0LnYxLlBhcnRpY2lwYW50Sm9pbmVkSAASNAoQcGFydGljaXBhbnRfbGVmdBgEIAEoCzIYLmNoYXQudjEuUGFydGljaXBhbnRMZWZ0SAASLgoNc2Vzc2lvbl9lbmRlZBgFIAEoCzIVLmNoYXQudjEuU2Vzc2lvbkVuZGVkSAASJwoJaGVhcnRiZWF0GAYgASgLMhIuY2hhdC52MS5IZWFydGJlYXRIAEIGCgRraW5kIg8KDUF0dGFjaFJlcXVlc3QiNgoOQXR0YWNoUmVzcG9uc2USFgoOcGFydGljaXBhbnRfaWQYASABKAkSDAoEcm9sZRgCIAEoCSKFAgoOTWVzc2FnZVJlcXVlc3QSGQoRY2xpZW50X21lc3NhZ2VfaWQYASABKAkSEQoEdGV4dBgCIAEoCUgAiAEBEigKC2F0dGFjaG1lbnRzGAMgAygLMhMuY2hhdC52MS5BdHRhY2htZW50EhIKBXZhbHVlGAQgASgJSAGIAQESGgoNZ2FsbGVyeV9sYWJlbBgFIAEoCUgCiAEBEhEKBGh0bWwYBiABKAlIA4gBARIqCghtZXRhZGF0YRgHIAEoCzIYLmNoYXQudjEuTWVzc2FnZU1ldGFkYXRhQgcKBV90ZXh0QggKBl92YWx1ZUIQCg5fZ2FsbGVyeV9sYWJlbEIHCgVfaHRtbCI0Cg9NZXNzYWdlUmVzcG9uc2USIQoHbWVzc2FnZRgBIAEoCzIQLmNoYXQudjEuTWVzc2FnZSJJCg1UeXBpbmdSZXF1ZXN0Eg0KBXN0YXRlGAEgASgJEikKCG1ldGFkYXRhGAIgASgLMhcuY2hhdC52MS5UeXBpbmdNZXRhZGF0YSIQCg5UeXBpbmdSZXNwb25zZSIOCgxMZWF2ZVJlcXVlc3QiDwoNTGVhdmVSZXNwb25zZTLyAQoHU2Vzc2lvbhI2CgZBdHRhY2gSFi5jaGF0LnYxLkF0dGFjaFJlcXVlc3QaEi5jaGF0LnYxLkNoYXRFdmVudDABEjwKB01lc3NhZ2USFy5jaGF0LnYxLk1lc3NhZ2VSZXF1ZXN0GhguY2hhdC52MS5NZXNzYWdlUmVzcG9uc2USOQoGVHlwaW5nEhYuY2hhdC52MS5UeXBpbmdSZXF1ZXN0GhcuY2hhdC52MS5UeXBpbmdSZXNwb25zZRI2CgVMZWF2ZRIVLmNoYXQudjEuTGVhdmVSZXF1ZXN0GhYuY2hhdC52MS5MZWF2ZVJlc3BvbnNlYgZwcm90bzM"), Fr = /* @__PURE__ */ R(_, 0), Gr = /* @__PURE__ */ R(_, 3), Br = /* @__PURE__ */ R(_, 4), Yr = /* @__PURE__ */ R(_, 12), Wt = /* @__PURE__ */ R(_, 13), $r = /* @__PURE__ */ R(_, 14), jt = /* @__PURE__ */ R(_, 15), Xr = /* @__PURE__ */ R(_, 16), qt = /* @__PURE__ */ R(_, 17), Ht = /* @__PURE__ */ R(_, 19), ne = /* @__PURE__ */ Vr(_, 0), Kr = "x-origon-client-id", Wr = "stream_overflow", U = {
|
|
3130
|
+
/** session_not_found — terminal */
|
|
3131
|
+
NOT_FOUND: 1,
|
|
3132
|
+
/** bad request (e.g. missing client id at gw) — terminal */
|
|
3133
|
+
INVALID_ARGUMENT: 2,
|
|
3130
3134
|
/** server_shutting_down (cx draining) — reattach ladder (D4) */
|
|
3131
3135
|
UNAVAILABLE: 5,
|
|
3136
|
+
/** monitor capacity exhausted — terminal */
|
|
3137
|
+
CAPACITY: 7,
|
|
3132
3138
|
/** token invalid/expired — SH-5 re-mint, retry once (D5) */
|
|
3133
3139
|
UNAUTHENTICATED: 9,
|
|
3140
|
+
/** forbidden — terminal */
|
|
3141
|
+
PERMISSION_DENIED: 10,
|
|
3134
3142
|
/** already_connected (slot held) — retryable */
|
|
3135
3143
|
CONFLICT: 11
|
|
3136
3144
|
};
|
|
3137
|
-
function
|
|
3145
|
+
function se(e) {
|
|
3138
3146
|
switch (e) {
|
|
3139
|
-
case
|
|
3147
|
+
case U.CONFLICT:
|
|
3140
3148
|
return "retry";
|
|
3141
|
-
case
|
|
3149
|
+
case U.UNAUTHENTICATED:
|
|
3142
3150
|
return "remint";
|
|
3143
|
-
case
|
|
3151
|
+
case U.UNAVAILABLE:
|
|
3144
3152
|
return "ladder";
|
|
3145
3153
|
default:
|
|
3146
3154
|
return "terminal";
|
|
3147
3155
|
}
|
|
3148
3156
|
}
|
|
3149
|
-
function
|
|
3157
|
+
function Zt(e) {
|
|
3150
3158
|
let t;
|
|
3151
3159
|
try {
|
|
3152
3160
|
t = new URL(e);
|
|
3153
3161
|
} catch (s) {
|
|
3154
|
-
throw
|
|
3162
|
+
throw h.session(
|
|
3155
3163
|
`chat session url: ${s instanceof Error ? s.message : String(s)}`
|
|
3156
3164
|
);
|
|
3157
3165
|
}
|
|
3158
3166
|
const n = t.pathname.split("/").slice(1);
|
|
3159
3167
|
if (n.length === 4 && n[0] === "chat" && n[1] === "api" && n[3] === "live" && n[2].trim() !== "")
|
|
3160
3168
|
return n[2];
|
|
3161
|
-
throw
|
|
3169
|
+
throw h.session(
|
|
3162
3170
|
`chat session url carries no client id (want /chat/api/<id>/live, got "${t.pathname}")`
|
|
3163
3171
|
);
|
|
3164
3172
|
}
|
|
3165
|
-
function
|
|
3166
|
-
const t =
|
|
3173
|
+
function jr(e) {
|
|
3174
|
+
const t = fe(Yr, e);
|
|
3167
3175
|
switch (t.kind.case) {
|
|
3168
3176
|
case "message":
|
|
3169
|
-
return { kind: "message", message:
|
|
3170
|
-
case "typing":
|
|
3171
|
-
|
|
3177
|
+
return { kind: "message", message: $n(t.kind.value) };
|
|
3178
|
+
case "typing": {
|
|
3179
|
+
const n = t.kind.value;
|
|
3180
|
+
if (n.state !== "on" && n.state !== "off")
|
|
3181
|
+
throw h.session(`chat typing event carried invalid state "${n.state}"`);
|
|
3182
|
+
return {
|
|
3183
|
+
kind: "typing",
|
|
3184
|
+
update: {
|
|
3185
|
+
participantId: n.participantId,
|
|
3186
|
+
role: n.role,
|
|
3187
|
+
userId: n.userId,
|
|
3188
|
+
userName: n.userName,
|
|
3189
|
+
state: n.state,
|
|
3190
|
+
metadata: zr(n.metadata?.audience)
|
|
3191
|
+
}
|
|
3192
|
+
};
|
|
3193
|
+
}
|
|
3172
3194
|
case "sessionEnded": {
|
|
3173
3195
|
const n = t.kind.value.reason;
|
|
3174
|
-
return { kind: "ended", reason: n, replay: n ===
|
|
3196
|
+
return { kind: "ended", reason: n, replay: n === Wr };
|
|
3175
3197
|
}
|
|
3176
3198
|
default:
|
|
3177
3199
|
return { kind: "ignore" };
|
|
3178
3200
|
}
|
|
3179
3201
|
}
|
|
3180
|
-
function
|
|
3202
|
+
function $n(e) {
|
|
3181
3203
|
return {
|
|
3182
3204
|
role: e.role === "ai" || e.role === "user" || e.role === "system" ? e.role : "external",
|
|
3183
3205
|
id: e.id,
|
|
@@ -3185,41 +3207,42 @@ function Yn(e) {
|
|
|
3185
3207
|
id: n.id,
|
|
3186
3208
|
name: n.name,
|
|
3187
3209
|
contentType: n.contentType,
|
|
3188
|
-
url: n.url
|
|
3210
|
+
...n.url !== "" ? { url: n.url } : {}
|
|
3189
3211
|
})),
|
|
3190
3212
|
status: "delivered",
|
|
3191
3213
|
state: e.state === "streaming" ? "streaming" : "completed",
|
|
3214
|
+
metadata: Zr(e.metadata?.audience),
|
|
3192
3215
|
...e.text !== void 0 ? { text: e.text } : {},
|
|
3193
3216
|
...e.html !== void 0 ? { html: e.html } : {},
|
|
3194
3217
|
...e.timestamp !== "" ? { timestamp: e.timestamp } : {},
|
|
3195
3218
|
...e.userId !== "" ? { userId: e.userId } : {},
|
|
3196
3219
|
...e.userName !== "" ? { userName: e.userName } : {},
|
|
3197
3220
|
...e.action !== void 0 ? { action: e.action } : {},
|
|
3198
|
-
...e.buttons.length > 0 ? { buttons: e.buttons.map(
|
|
3199
|
-
...e.gallery.length > 0 ? { gallery: e.gallery.map(
|
|
3221
|
+
...e.buttons.length > 0 ? { buttons: e.buttons.map(Xn) } : {},
|
|
3222
|
+
...e.gallery.length > 0 ? { gallery: e.gallery.map(qr) } : {}
|
|
3200
3223
|
};
|
|
3201
3224
|
}
|
|
3202
|
-
function
|
|
3225
|
+
function Xn(e) {
|
|
3203
3226
|
return { label: e.label, value: e.value, type: e.buttonType };
|
|
3204
3227
|
}
|
|
3205
|
-
function
|
|
3228
|
+
function qr(e) {
|
|
3206
3229
|
return {
|
|
3207
3230
|
title: e.title,
|
|
3208
3231
|
description: e.description,
|
|
3209
|
-
buttons: e.buttons.map(
|
|
3232
|
+
buttons: e.buttons.map(Xn),
|
|
3210
3233
|
...e.image !== void 0 ? {
|
|
3211
3234
|
image: {
|
|
3212
3235
|
id: e.image.id,
|
|
3213
3236
|
name: e.image.name,
|
|
3214
3237
|
contentType: e.image.contentType,
|
|
3215
|
-
url: e.image.url
|
|
3238
|
+
...e.image.url !== "" ? { url: e.image.url } : {}
|
|
3216
3239
|
}
|
|
3217
3240
|
} : {}
|
|
3218
3241
|
};
|
|
3219
3242
|
}
|
|
3220
|
-
class
|
|
3243
|
+
class Hr {
|
|
3221
3244
|
constructor(t, n) {
|
|
3222
|
-
this.url = t.url, this.token = t.token, this.clientId =
|
|
3245
|
+
this.url = t.url, this.token = t.token, this.clientId = Zt(t.url), this.opts = n, this.client = this.createClient();
|
|
3223
3246
|
}
|
|
3224
3247
|
get credentials() {
|
|
3225
3248
|
return { url: this.url, token: this.token };
|
|
@@ -3232,7 +3255,7 @@ class Wr {
|
|
|
3232
3255
|
*/
|
|
3233
3256
|
setCredentials(t) {
|
|
3234
3257
|
const n = t.url !== this.url;
|
|
3235
|
-
this.url = t.url, this.token = t.token, n && (this.clientId =
|
|
3258
|
+
this.url = t.url, this.token = t.token, n && (this.clientId = Zt(t.url), this.client = this.createClient());
|
|
3236
3259
|
}
|
|
3237
3260
|
createClient() {
|
|
3238
3261
|
const t = {
|
|
@@ -3241,18 +3264,18 @@ class Wr {
|
|
|
3241
3264
|
logout: () => {
|
|
3242
3265
|
}
|
|
3243
3266
|
};
|
|
3244
|
-
return
|
|
3245
|
-
metadata: { [
|
|
3267
|
+
return ds(this.url, t, {
|
|
3268
|
+
metadata: { [Kr]: this.clientId },
|
|
3246
3269
|
...this.opts.transport !== void 0 ? { transport: this.opts.transport } : {},
|
|
3247
3270
|
...this.opts.logger !== void 0 ? { logger: this.opts.logger } : {}
|
|
3248
3271
|
});
|
|
3249
3272
|
}
|
|
3250
3273
|
/** Attach — join the room. The `initial` frame is the `AttachResponse`. */
|
|
3251
3274
|
async attach() {
|
|
3252
|
-
const t =
|
|
3275
|
+
const t = te(Wt, C(Wt)), n = await this.client.stream(re(ne.method.attach), t);
|
|
3253
3276
|
let s;
|
|
3254
3277
|
try {
|
|
3255
|
-
s =
|
|
3278
|
+
s = fe($r, n.initial);
|
|
3256
3279
|
} catch (r) {
|
|
3257
3280
|
throw n.cancel(), r;
|
|
3258
3281
|
}
|
|
@@ -3263,10 +3286,10 @@ class Wr {
|
|
|
3263
3286
|
* timestamp, rewritten attachment URLs) — the former POST echo.
|
|
3264
3287
|
*/
|
|
3265
3288
|
async message(t) {
|
|
3266
|
-
const n =
|
|
3289
|
+
const n = C(jt, {
|
|
3267
3290
|
clientMessageId: t.clientMessageId,
|
|
3268
3291
|
attachments: (t.attachments ?? []).map(
|
|
3269
|
-
(i) =>
|
|
3292
|
+
(i) => C(Fr, {
|
|
3270
3293
|
id: i.id,
|
|
3271
3294
|
name: i.name,
|
|
3272
3295
|
contentType: i.contentType,
|
|
@@ -3277,41 +3300,55 @@ class Wr {
|
|
|
3277
3300
|
...t.text !== void 0 ? { text: t.text } : {},
|
|
3278
3301
|
...t.html !== void 0 ? { html: t.html } : {},
|
|
3279
3302
|
...t.value !== void 0 ? { value: t.value } : {},
|
|
3280
|
-
...t.galleryLabel !== void 0 ? { galleryLabel: t.galleryLabel } : {}
|
|
3303
|
+
...t.galleryLabel !== void 0 ? { galleryLabel: t.galleryLabel } : {},
|
|
3304
|
+
metadata: C(Gr, t.metadata)
|
|
3281
3305
|
}), s = await this.client.call(
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
), r =
|
|
3306
|
+
re(ne.method.message),
|
|
3307
|
+
te(jt, n)
|
|
3308
|
+
), r = fe(Xr, s);
|
|
3285
3309
|
if (r.message === void 0)
|
|
3286
|
-
throw
|
|
3287
|
-
return
|
|
3310
|
+
throw h.session("chat message response carried no message");
|
|
3311
|
+
return $n(r.message);
|
|
3288
3312
|
}
|
|
3289
3313
|
/** Typing — on/off indicator. Unary; the response is empty. */
|
|
3290
|
-
async typing(t) {
|
|
3291
|
-
const
|
|
3314
|
+
async typing(t, n) {
|
|
3315
|
+
const s = C(qt, {
|
|
3316
|
+
state: t,
|
|
3317
|
+
metadata: C(Br, n)
|
|
3318
|
+
});
|
|
3292
3319
|
await this.client.call(
|
|
3293
|
-
|
|
3294
|
-
|
|
3320
|
+
re(ne.method.typing),
|
|
3321
|
+
te(qt, s)
|
|
3295
3322
|
);
|
|
3296
3323
|
}
|
|
3297
3324
|
/** Leave — explicit participant leave (immediate finalize, idempotent). */
|
|
3298
3325
|
async leave() {
|
|
3299
3326
|
await this.client.call(
|
|
3300
|
-
|
|
3301
|
-
|
|
3327
|
+
re(ne.method.leave),
|
|
3328
|
+
te(Ht, C(Ht))
|
|
3302
3329
|
);
|
|
3303
3330
|
}
|
|
3304
3331
|
}
|
|
3305
|
-
function
|
|
3332
|
+
function Kn(e, t) {
|
|
3333
|
+
if (e === "internal" || e === "all") return e;
|
|
3334
|
+
throw h.session(`${t} carried invalid or missing metadata.audience`);
|
|
3335
|
+
}
|
|
3336
|
+
function Zr(e) {
|
|
3337
|
+
return { audience: Kn(e, "chat message") };
|
|
3338
|
+
}
|
|
3339
|
+
function zr(e) {
|
|
3340
|
+
return { audience: Kn(e, "chat typing event") };
|
|
3341
|
+
}
|
|
3342
|
+
function re(e) {
|
|
3306
3343
|
return `${e.parent.typeName}/${e.name}`;
|
|
3307
3344
|
}
|
|
3308
|
-
const
|
|
3309
|
-
class
|
|
3345
|
+
const Qr = 3e3, Jr = 6e3, ei = 3, ti = 500, ni = 2e3;
|
|
3346
|
+
class si {
|
|
3310
3347
|
constructor(t, n) {
|
|
3311
|
-
this.stream = null, this.terminalFired = !1, this.reattaching = !1, this.knownMessageIds = /* @__PURE__ */ new Set(), this.outboundOffTimer = null, this.
|
|
3348
|
+
this.stream = null, this.terminalFired = !1, this.reattaching = !1, this.provisionedRecoveryPromise = null, this.recoveryGeneration = 0, this.knownMessageIds = /* @__PURE__ */ new Set(), this.outboundOffTimer = null, this.outboundTypingMetadata = null, this.inboundTyping = /* @__PURE__ */ new Map(), this.sessionId = t.sessionId, this.lane = new Hr(
|
|
3312
3349
|
{ url: t.url.replace(/\/$/, ""), token: t.token },
|
|
3313
3350
|
{ remint: () => this.remint() }
|
|
3314
|
-
), this.sessionHttp = n.sessionHttp, this.dispatcher = n.dispatcher, this.onTerminal = n.onTerminal;
|
|
3351
|
+
), this.sessionHttp = n.sessionHttp, this.provisionedRecovery = n.provisionedRecovery, this.dispatcher = n.dispatcher, this.onTerminal = n.onTerminal;
|
|
3315
3352
|
}
|
|
3316
3353
|
/**
|
|
3317
3354
|
* Attach to the room. Resolves once the initial `AttachResponse` frame is
|
|
@@ -3324,18 +3361,27 @@ class zr {
|
|
|
3324
3361
|
try {
|
|
3325
3362
|
({ stream: t } = await this.lane.attach());
|
|
3326
3363
|
} catch (n) {
|
|
3364
|
+
if (this.provisionedRecovery) {
|
|
3365
|
+
const s = this.provisionedTerminalFromRefusal(n);
|
|
3366
|
+
if (s)
|
|
3367
|
+
throw this.fireTerminal(s), n;
|
|
3368
|
+
if (await this.beginProvisionedRecovery(
|
|
3369
|
+
n instanceof T && se(n.code) === "remint" ? "unauthenticated" : "transportError"
|
|
3370
|
+
)) return;
|
|
3371
|
+
throw n;
|
|
3372
|
+
}
|
|
3327
3373
|
throw this.fireTerminal(
|
|
3328
|
-
n instanceof
|
|
3374
|
+
n instanceof T ? { kind: "serverClosed", code: n.code, reason: n.reason } : { kind: "networkLoss" }
|
|
3329
3375
|
), n;
|
|
3330
3376
|
}
|
|
3331
3377
|
if (this.terminalFired)
|
|
3332
|
-
throw t.cancel(),
|
|
3378
|
+
throw t.cancel(), h.session("chat session closed during attach");
|
|
3333
3379
|
this.stream = t, this.pump(t);
|
|
3334
3380
|
}
|
|
3335
3381
|
// ── Outbound API ─────────────────────────────────────────────────────
|
|
3336
3382
|
async sendMessage(t) {
|
|
3337
3383
|
this.cancelOutboundDebounce({ flushOff: !0 });
|
|
3338
|
-
const n =
|
|
3384
|
+
const n = dn(), s = t.metadata ?? { audience: "all" }, r = {
|
|
3339
3385
|
role: t.role ?? "external",
|
|
3340
3386
|
id: "",
|
|
3341
3387
|
localId: n,
|
|
@@ -3344,12 +3390,14 @@ class zr {
|
|
|
3344
3390
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3345
3391
|
attachments: t.attachments ?? [],
|
|
3346
3392
|
status: "sending",
|
|
3347
|
-
state: "completed"
|
|
3393
|
+
state: "completed",
|
|
3394
|
+
metadata: s
|
|
3348
3395
|
};
|
|
3349
|
-
this.knownMessageIds.add(n), this.dispatcher.fire("onMessageAdded", this.sessionId, "chat",
|
|
3396
|
+
this.knownMessageIds.add(n), this.dispatcher.fire("onMessageAdded", this.sessionId, "chat", r);
|
|
3350
3397
|
try {
|
|
3351
|
-
const
|
|
3398
|
+
const i = {
|
|
3352
3399
|
clientMessageId: n,
|
|
3400
|
+
metadata: s,
|
|
3353
3401
|
...t.text !== void 0 ? { text: t.text } : {},
|
|
3354
3402
|
...t.html !== void 0 ? { html: t.html } : {},
|
|
3355
3403
|
...t.attachments && t.attachments.length > 0 ? { attachments: t.attachments } : {},
|
|
@@ -3357,45 +3405,47 @@ class zr {
|
|
|
3357
3405
|
value: t.buttonReply.value,
|
|
3358
3406
|
...t.buttonReply.label !== void 0 ? { galleryLabel: t.buttonReply.label } : {}
|
|
3359
3407
|
} : {}
|
|
3360
|
-
},
|
|
3361
|
-
...
|
|
3362
|
-
...
|
|
3408
|
+
}, a = await this.lane.message(i), o = {
|
|
3409
|
+
...r,
|
|
3410
|
+
...a,
|
|
3363
3411
|
localId: n,
|
|
3364
3412
|
// The canonical echo carries the rewritten attachment URLs; keep the
|
|
3365
3413
|
// provisional rows (with their local previews) only when it has none.
|
|
3366
|
-
attachments:
|
|
3414
|
+
attachments: a.attachments.length > 0 ? a.attachments : r.attachments
|
|
3367
3415
|
};
|
|
3368
|
-
return
|
|
3369
|
-
id:
|
|
3370
|
-
message:
|
|
3371
|
-
}),
|
|
3372
|
-
} catch (
|
|
3373
|
-
const
|
|
3374
|
-
...
|
|
3416
|
+
return o.id && this.knownMessageIds.add(o.id), this.terminalFired || this.dispatcher.fire("onMessageUpdated", this.sessionId, "chat", {
|
|
3417
|
+
id: o.id || n,
|
|
3418
|
+
message: o
|
|
3419
|
+
}), o;
|
|
3420
|
+
} catch (i) {
|
|
3421
|
+
const a = {
|
|
3422
|
+
...r,
|
|
3375
3423
|
status: "failed",
|
|
3376
|
-
errorText:
|
|
3424
|
+
errorText: i instanceof Error ? i.message : String(i)
|
|
3377
3425
|
};
|
|
3378
3426
|
throw this.terminalFired || this.dispatcher.fire("onMessageUpdated", this.sessionId, "chat", {
|
|
3379
3427
|
id: n,
|
|
3380
|
-
message:
|
|
3381
|
-
}),
|
|
3428
|
+
message: a
|
|
3429
|
+
}), i;
|
|
3382
3430
|
}
|
|
3383
3431
|
}
|
|
3384
|
-
notifyTyping() {
|
|
3385
|
-
this.outboundOffTimer ? clearTimeout(this.outboundOffTimer) : this.sendTyping("on"), this.outboundOffTimer = setTimeout(() => {
|
|
3386
|
-
this.outboundOffTimer = null
|
|
3387
|
-
|
|
3432
|
+
notifyTyping(t = { audience: "all" }) {
|
|
3433
|
+
this.outboundOffTimer ? (clearTimeout(this.outboundOffTimer), this.outboundTypingMetadata?.audience !== t.audience && (this.outboundTypingMetadata && this.sendTyping("off", this.outboundTypingMetadata), this.sendTyping("on", t))) : this.sendTyping("on", t), this.outboundTypingMetadata = t, this.outboundOffTimer = setTimeout(() => {
|
|
3434
|
+
this.outboundOffTimer = null;
|
|
3435
|
+
const n = this.outboundTypingMetadata;
|
|
3436
|
+
this.outboundTypingMetadata = null, n && this.sendTyping("off", n);
|
|
3437
|
+
}, Qr);
|
|
3388
3438
|
}
|
|
3389
3439
|
stopTyping() {
|
|
3390
3440
|
this.cancelOutboundDebounce({ flushOff: !0 });
|
|
3391
3441
|
}
|
|
3392
3442
|
async disconnect() {
|
|
3393
3443
|
this.cancelOutboundDebounce({ flushOff: !1 });
|
|
3394
|
-
const
|
|
3395
|
-
this.fireTerminal({ kind: "localClose" }),
|
|
3396
|
-
this.lane.leave().catch((
|
|
3444
|
+
const n = !this.terminalFired && (this.provisionedRecovery === void 0 || this.stream !== null && this.provisionedRecoveryPromise === null);
|
|
3445
|
+
this.fireTerminal({ kind: "localClose" }), n && await Promise.race([
|
|
3446
|
+
this.lane.leave().catch((s) => {
|
|
3397
3447
|
}),
|
|
3398
|
-
|
|
3448
|
+
W(ni)
|
|
3399
3449
|
]);
|
|
3400
3450
|
}
|
|
3401
3451
|
/**
|
|
@@ -3423,7 +3473,7 @@ class zr {
|
|
|
3423
3473
|
if (this.terminalFired || this.stream !== t) continue;
|
|
3424
3474
|
let r;
|
|
3425
3475
|
try {
|
|
3426
|
-
r =
|
|
3476
|
+
r = jr(s);
|
|
3427
3477
|
} catch {
|
|
3428
3478
|
this.fireTerminal({ kind: "protocolViolation" });
|
|
3429
3479
|
return;
|
|
@@ -3433,20 +3483,24 @@ class zr {
|
|
|
3433
3483
|
this.deliverMessage(r.message);
|
|
3434
3484
|
break;
|
|
3435
3485
|
case "typing":
|
|
3436
|
-
this.handleTyping(r.
|
|
3486
|
+
this.handleTyping(r.update);
|
|
3437
3487
|
break;
|
|
3438
3488
|
case "ended":
|
|
3439
|
-
n = !0, r.replay ? this.reattach() : this.fireTerminal({ kind: "sessionEnded" });
|
|
3489
|
+
n = !0, r.replay ? this.provisionedRecovery ? this.beginProvisionedRecovery("streamOverflow", t) : this.reattach() : this.fireTerminal({ kind: "sessionEnded" });
|
|
3440
3490
|
break;
|
|
3441
3491
|
case "ignore":
|
|
3442
3492
|
break;
|
|
3443
3493
|
}
|
|
3444
3494
|
}
|
|
3445
3495
|
} catch {
|
|
3496
|
+
if (this.provisionedRecovery && !n && !this.terminalFired && this.stream === t) {
|
|
3497
|
+
this.beginProvisionedRecovery("transportError", t);
|
|
3498
|
+
return;
|
|
3499
|
+
}
|
|
3446
3500
|
!n && !this.terminalFired && this.stream === t && this.fireTerminal({ kind: "networkLoss" });
|
|
3447
3501
|
return;
|
|
3448
3502
|
}
|
|
3449
|
-
!n && !this.terminalFired && this.stream === t && this.fireTerminal({ kind: "networkLoss" });
|
|
3503
|
+
!n && !this.terminalFired && this.stream === t && (this.provisionedRecovery ? this.beginProvisionedRecovery("cleanFin", t) : this.fireTerminal({ kind: "networkLoss" }));
|
|
3450
3504
|
})();
|
|
3451
3505
|
}
|
|
3452
3506
|
/**
|
|
@@ -3457,7 +3511,7 @@ class zr {
|
|
|
3457
3511
|
*/
|
|
3458
3512
|
deliverMessage(t) {
|
|
3459
3513
|
if (this.terminalFired) return;
|
|
3460
|
-
this.
|
|
3514
|
+
this.clearInboundWatchdogsForUser(t.userId);
|
|
3461
3515
|
const n = t.id || t.localId;
|
|
3462
3516
|
n && this.knownMessageIds.has(n) ? this.dispatcher.fire("onMessageUpdated", this.sessionId, "chat", {
|
|
3463
3517
|
id: t.id || n,
|
|
@@ -3465,7 +3519,100 @@ class zr {
|
|
|
3465
3519
|
}) : (n && this.knownMessageIds.add(n), this.dispatcher.fire("onMessageAdded", this.sessionId, "chat", t));
|
|
3466
3520
|
}
|
|
3467
3521
|
handleTyping(t) {
|
|
3468
|
-
t ? this.armInboundWatchdog() : this.clearInboundWatchdog(), this.dispatcher.fire("onTyping", this.sessionId, "chat", t);
|
|
3522
|
+
t.state === "on" ? this.armInboundWatchdog(t) : this.clearInboundWatchdog(t.participantId), this.dispatcher.fire("onTyping", this.sessionId, "chat", t);
|
|
3523
|
+
}
|
|
3524
|
+
// ── Provisioned recovery ─────────────────────────────────────────────
|
|
3525
|
+
/**
|
|
3526
|
+
* Serialize every provisioned refresh/Attach cycle. The returned promise is
|
|
3527
|
+
* shared by concurrent error/FIN signals. It is cleared before the recovered
|
|
3528
|
+
* stream pump starts, so a transport that fails immediately starts a new,
|
|
3529
|
+
* strictly later generation instead of being mistaken for the old cycle.
|
|
3530
|
+
*/
|
|
3531
|
+
beginProvisionedRecovery(t, n) {
|
|
3532
|
+
if (!this.provisionedRecovery || this.terminalFired) return Promise.resolve(!1);
|
|
3533
|
+
if (n && this.stream === n && (this.stream = null), this.provisionedRecoveryPromise) return this.provisionedRecoveryPromise;
|
|
3534
|
+
this.clearAllInboundWatchdogs({ notify: !0 });
|
|
3535
|
+
const s = this.runProvisionedRecovery(t);
|
|
3536
|
+
let r;
|
|
3537
|
+
return r = s.then((i) => (this.provisionedRecoveryPromise === r && (this.provisionedRecoveryPromise = null), !i || this.terminalFired ? (i && i.cancel(), !1) : (this.stream = i, this.pump(i), !0))), this.provisionedRecoveryPromise = r, r;
|
|
3538
|
+
}
|
|
3539
|
+
/** Fresh control-plane authorization before every bounded Attach attempt. */
|
|
3540
|
+
async runProvisionedRecovery(t) {
|
|
3541
|
+
const n = this.provisionedRecovery;
|
|
3542
|
+
if (!n) return null;
|
|
3543
|
+
let s = t;
|
|
3544
|
+
for (let r = 0; r < n.delaysMs.length; r++) {
|
|
3545
|
+
if (await W(n.delaysMs[r]), this.terminalFired) return null;
|
|
3546
|
+
const i = ++this.recoveryGeneration;
|
|
3547
|
+
let a;
|
|
3548
|
+
try {
|
|
3549
|
+
a = await n.reauthorize({
|
|
3550
|
+
sessionId: this.sessionId,
|
|
3551
|
+
attempt: r + 1,
|
|
3552
|
+
generation: i,
|
|
3553
|
+
cause: s
|
|
3554
|
+
});
|
|
3555
|
+
} catch {
|
|
3556
|
+
continue;
|
|
3557
|
+
}
|
|
3558
|
+
if (this.terminalFired || i !== this.recoveryGeneration) return null;
|
|
3559
|
+
if ("terminal" in a)
|
|
3560
|
+
return this.fireProvisionedTerminal(a.terminal), null;
|
|
3561
|
+
if (a.sessionId !== this.sessionId || a.url.trim() === "" || a.token.trim() === "")
|
|
3562
|
+
return this.fireTerminal({ kind: "protocolViolation" }), null;
|
|
3563
|
+
try {
|
|
3564
|
+
this.lane.setCredentials({
|
|
3565
|
+
url: a.url.replace(/\/$/, ""),
|
|
3566
|
+
token: a.token
|
|
3567
|
+
});
|
|
3568
|
+
const { stream: o } = await this.lane.attach();
|
|
3569
|
+
return this.terminalFired || i !== this.recoveryGeneration ? (o.cancel(), null) : o;
|
|
3570
|
+
} catch (o) {
|
|
3571
|
+
const l = this.provisionedTerminalFromRefusal(o);
|
|
3572
|
+
if (l)
|
|
3573
|
+
return this.fireTerminal(l), null;
|
|
3574
|
+
o instanceof T && se(o.code) === "remint" && (s = "unauthenticated");
|
|
3575
|
+
}
|
|
3576
|
+
}
|
|
3577
|
+
return this.fireTerminal({ kind: "replayLost" }), null;
|
|
3578
|
+
}
|
|
3579
|
+
provisionedTerminalFromRefusal(t) {
|
|
3580
|
+
if (!(t instanceof T)) return null;
|
|
3581
|
+
switch (t.code) {
|
|
3582
|
+
case U.NOT_FOUND:
|
|
3583
|
+
return { kind: "sessionEnded" };
|
|
3584
|
+
case U.CAPACITY:
|
|
3585
|
+
return { kind: "resourceExhausted" };
|
|
3586
|
+
case U.PERMISSION_DENIED:
|
|
3587
|
+
case U.INVALID_ARGUMENT:
|
|
3588
|
+
return { kind: "serverClosed", code: t.code, reason: t.reason };
|
|
3589
|
+
default:
|
|
3590
|
+
return se(t.code) === "terminal" ? { kind: "serverClosed", code: t.code, reason: t.reason } : null;
|
|
3591
|
+
}
|
|
3592
|
+
}
|
|
3593
|
+
fireProvisionedTerminal(t) {
|
|
3594
|
+
switch (t) {
|
|
3595
|
+
case "ended":
|
|
3596
|
+
this.fireTerminal({ kind: "sessionEnded" });
|
|
3597
|
+
break;
|
|
3598
|
+
case "capacity":
|
|
3599
|
+
this.fireTerminal({ kind: "resourceExhausted" });
|
|
3600
|
+
break;
|
|
3601
|
+
case "revoked":
|
|
3602
|
+
this.fireTerminal({
|
|
3603
|
+
kind: "serverClosed",
|
|
3604
|
+
code: U.PERMISSION_DENIED,
|
|
3605
|
+
reason: "provisioned_authorization_revoked"
|
|
3606
|
+
});
|
|
3607
|
+
break;
|
|
3608
|
+
case "removed":
|
|
3609
|
+
this.fireTerminal({
|
|
3610
|
+
kind: "serverClosed",
|
|
3611
|
+
code: U.PERMISSION_DENIED,
|
|
3612
|
+
reason: "provisioned_participant_removed"
|
|
3613
|
+
});
|
|
3614
|
+
break;
|
|
3615
|
+
}
|
|
3469
3616
|
}
|
|
3470
3617
|
// ── Overflow reattach (D4) + SH-5 re-mint (D5) ───────────────────────
|
|
3471
3618
|
/**
|
|
@@ -3479,8 +3626,8 @@ class zr {
|
|
|
3479
3626
|
this.reattaching = !0;
|
|
3480
3627
|
try {
|
|
3481
3628
|
let t = !1;
|
|
3482
|
-
for (let n = 0; n <
|
|
3483
|
-
if (await
|
|
3629
|
+
for (let n = 0; n < ei; n++) {
|
|
3630
|
+
if (await W(ti * 2 ** n), this.terminalFired) return;
|
|
3484
3631
|
try {
|
|
3485
3632
|
const { stream: s } = await this.lane.attach();
|
|
3486
3633
|
if (this.terminalFired) {
|
|
@@ -3490,8 +3637,8 @@ class zr {
|
|
|
3490
3637
|
this.stream = s, this.pump(s), await this.replayHistory();
|
|
3491
3638
|
return;
|
|
3492
3639
|
} catch (s) {
|
|
3493
|
-
if (s instanceof
|
|
3494
|
-
const r =
|
|
3640
|
+
if (s instanceof T) {
|
|
3641
|
+
const r = se(s.code);
|
|
3495
3642
|
if (r === "remint" && !t) {
|
|
3496
3643
|
t = !0;
|
|
3497
3644
|
try {
|
|
@@ -3499,7 +3646,7 @@ class zr {
|
|
|
3499
3646
|
continue;
|
|
3500
3647
|
} catch (i) {
|
|
3501
3648
|
this.fireTerminal(
|
|
3502
|
-
i instanceof
|
|
3649
|
+
i instanceof h && i.kind === "session" ? { kind: "sessionEnded" } : { kind: "networkLoss" }
|
|
3503
3650
|
);
|
|
3504
3651
|
return;
|
|
3505
3652
|
}
|
|
@@ -3549,42 +3696,70 @@ class zr {
|
|
|
3549
3696
|
* strand the visible transcript.
|
|
3550
3697
|
*/
|
|
3551
3698
|
async remint() {
|
|
3699
|
+
if (this.provisionedRecovery)
|
|
3700
|
+
throw h.session(
|
|
3701
|
+
"provisioned chat credentials are refreshed only by the caller reauthorization policy"
|
|
3702
|
+
);
|
|
3552
3703
|
const t = await this.sessionHttp.startSession({
|
|
3553
3704
|
channel: "chat",
|
|
3554
3705
|
sessionId: this.sessionId
|
|
3555
3706
|
});
|
|
3556
3707
|
if (t.sessionId !== this.sessionId)
|
|
3557
|
-
throw
|
|
3708
|
+
throw h.session(
|
|
3558
3709
|
`chat re-mint returned a different session (${t.sessionId}) — the room is gone`
|
|
3559
3710
|
);
|
|
3560
3711
|
return { url: t.url.replace(/\/$/, ""), token: t.token };
|
|
3561
3712
|
}
|
|
3562
3713
|
// ── Timers ───────────────────────────────────────────────────────────
|
|
3563
|
-
armInboundWatchdog() {
|
|
3564
|
-
this.clearInboundWatchdog(
|
|
3565
|
-
|
|
3566
|
-
|
|
3714
|
+
armInboundWatchdog(t) {
|
|
3715
|
+
this.clearInboundWatchdog(t.participantId);
|
|
3716
|
+
const n = setTimeout(() => {
|
|
3717
|
+
this.inboundTyping.delete(t.participantId), this.dispatcher.fire("onTyping", this.sessionId, "chat", {
|
|
3718
|
+
...t,
|
|
3719
|
+
state: "off"
|
|
3720
|
+
});
|
|
3721
|
+
}, Jr);
|
|
3722
|
+
this.inboundTyping.set(t.participantId, { timer: n, update: t });
|
|
3723
|
+
}
|
|
3724
|
+
clearInboundWatchdog(t) {
|
|
3725
|
+
const n = this.inboundTyping.get(t);
|
|
3726
|
+
n && (clearTimeout(n.timer), this.inboundTyping.delete(t));
|
|
3567
3727
|
}
|
|
3568
|
-
|
|
3569
|
-
|
|
3728
|
+
clearInboundWatchdogsForUser(t) {
|
|
3729
|
+
if (t)
|
|
3730
|
+
for (const [n, s] of this.inboundTyping)
|
|
3731
|
+
s.update.userId === t && this.clearInboundWatchdog(n);
|
|
3732
|
+
}
|
|
3733
|
+
clearAllInboundWatchdogs({ notify: t }) {
|
|
3734
|
+
const n = [...this.inboundTyping.values()];
|
|
3735
|
+
this.inboundTyping.clear();
|
|
3736
|
+
for (const s of n)
|
|
3737
|
+
clearTimeout(s.timer), t && this.dispatcher.fire("onTyping", this.sessionId, "chat", {
|
|
3738
|
+
...s.update,
|
|
3739
|
+
state: "off"
|
|
3740
|
+
});
|
|
3570
3741
|
}
|
|
3571
3742
|
cancelOutboundDebounce({ flushOff: t }) {
|
|
3572
|
-
|
|
3743
|
+
if (this.outboundOffTimer) {
|
|
3744
|
+
clearTimeout(this.outboundOffTimer), this.outboundOffTimer = null;
|
|
3745
|
+
const n = this.outboundTypingMetadata;
|
|
3746
|
+
this.outboundTypingMetadata = null, t && n && this.sendTyping("off", n);
|
|
3747
|
+
}
|
|
3573
3748
|
}
|
|
3574
|
-
async sendTyping(t) {
|
|
3749
|
+
async sendTyping(t, n) {
|
|
3575
3750
|
try {
|
|
3576
|
-
await this.lane.typing(t);
|
|
3751
|
+
await this.lane.typing(t, n);
|
|
3577
3752
|
} catch {
|
|
3578
3753
|
}
|
|
3579
3754
|
}
|
|
3580
3755
|
fireTerminal(t) {
|
|
3581
3756
|
if (this.terminalFired) return;
|
|
3582
|
-
this.terminalFired = !0
|
|
3757
|
+
this.terminalFired = !0, this.recoveryGeneration++;
|
|
3583
3758
|
const n = this.stream;
|
|
3584
|
-
this.stream = null, n && n.cancel(), this.
|
|
3759
|
+
this.stream = null, n && n.cancel(), this.clearAllInboundWatchdogs({ notify: this.provisionedRecovery !== void 0 }), this.outboundOffTimer && (clearTimeout(this.outboundOffTimer), this.outboundOffTimer = null), this.outboundTypingMetadata = null, this.onTerminal(t, this.sessionId);
|
|
3585
3760
|
}
|
|
3586
3761
|
}
|
|
3587
|
-
class
|
|
3762
|
+
class ri {
|
|
3588
3763
|
constructor(t) {
|
|
3589
3764
|
this.endpoint = t.endpoint.replace(/\/$/, ""), this.defaultHeaders = {}, t.token && (this.defaultHeaders.Authorization = `Bearer ${t.token}`);
|
|
3590
3765
|
}
|
|
@@ -3612,9 +3787,9 @@ class Qr {
|
|
|
3612
3787
|
try {
|
|
3613
3788
|
i = await fetch(t, r);
|
|
3614
3789
|
} catch (a) {
|
|
3615
|
-
throw
|
|
3790
|
+
throw h.other(`fetch failed: ${a.message}`);
|
|
3616
3791
|
}
|
|
3617
|
-
return
|
|
3792
|
+
return zt(i);
|
|
3618
3793
|
}
|
|
3619
3794
|
async getJsonAbsolute(t, n) {
|
|
3620
3795
|
const s = {
|
|
@@ -3626,9 +3801,9 @@ class Qr {
|
|
|
3626
3801
|
try {
|
|
3627
3802
|
r = await fetch(t, s);
|
|
3628
3803
|
} catch (i) {
|
|
3629
|
-
throw
|
|
3804
|
+
throw h.other(`fetch failed: ${i.message}`);
|
|
3630
3805
|
}
|
|
3631
|
-
return
|
|
3806
|
+
return zt(r);
|
|
3632
3807
|
}
|
|
3633
3808
|
async deleteAbsolute(t, n) {
|
|
3634
3809
|
const s = {
|
|
@@ -3640,50 +3815,53 @@ class Qr {
|
|
|
3640
3815
|
try {
|
|
3641
3816
|
r = await fetch(t, s);
|
|
3642
3817
|
} catch (i) {
|
|
3643
|
-
throw
|
|
3818
|
+
throw h.other(`fetch failed: ${i.message}`);
|
|
3644
3819
|
}
|
|
3645
3820
|
if (!r.ok) {
|
|
3646
|
-
const i = await r.text().catch(() => "");
|
|
3647
|
-
throw
|
|
3821
|
+
const i = await r.text().catch(() => ""), a = n?.bearer;
|
|
3822
|
+
throw tt(
|
|
3823
|
+
r.status,
|
|
3824
|
+
a ? i.split(a).join("[REDACTED]") : i
|
|
3825
|
+
);
|
|
3648
3826
|
}
|
|
3649
3827
|
}
|
|
3650
3828
|
buildAbsoluteUrl(t) {
|
|
3651
3829
|
return this.url(t);
|
|
3652
3830
|
}
|
|
3653
3831
|
}
|
|
3654
|
-
async function
|
|
3832
|
+
async function zt(e) {
|
|
3655
3833
|
const t = await e.text();
|
|
3656
3834
|
if (!e.ok)
|
|
3657
|
-
throw
|
|
3835
|
+
throw tt(e.status, t);
|
|
3658
3836
|
let n;
|
|
3659
3837
|
if (t.length !== 0) {
|
|
3660
3838
|
try {
|
|
3661
3839
|
n = JSON.parse(t);
|
|
3662
3840
|
} catch (s) {
|
|
3663
|
-
throw
|
|
3841
|
+
throw h.other(`decode response: ${s.message}`);
|
|
3664
3842
|
}
|
|
3665
|
-
if (
|
|
3666
|
-
throw
|
|
3843
|
+
if (nn(n))
|
|
3844
|
+
throw h.http(e.status, n.error.code, n.error.message);
|
|
3667
3845
|
return n;
|
|
3668
3846
|
}
|
|
3669
3847
|
}
|
|
3670
|
-
function
|
|
3848
|
+
function tt(e, t) {
|
|
3671
3849
|
if (e >= 500)
|
|
3672
|
-
return
|
|
3850
|
+
return h.serverUnavailable(e);
|
|
3673
3851
|
if (t.length === 0)
|
|
3674
|
-
return
|
|
3852
|
+
return h.http(e, "", `HTTP ${e}`);
|
|
3675
3853
|
try {
|
|
3676
3854
|
const n = JSON.parse(t);
|
|
3677
|
-
if (
|
|
3678
|
-
return
|
|
3855
|
+
if (nn(n))
|
|
3856
|
+
return h.http(e, n.error.code, n.error.message);
|
|
3679
3857
|
} catch {
|
|
3680
3858
|
}
|
|
3681
|
-
return
|
|
3859
|
+
return h.http(e, "", t.slice(0, 200));
|
|
3682
3860
|
}
|
|
3683
|
-
function
|
|
3861
|
+
function ve(e, t) {
|
|
3684
3862
|
return t ? `${e}?userId=${encodeURIComponent(t)}` : e;
|
|
3685
3863
|
}
|
|
3686
|
-
class
|
|
3864
|
+
class ii {
|
|
3687
3865
|
constructor(t, n) {
|
|
3688
3866
|
this.http = t, this.userId = n;
|
|
3689
3867
|
}
|
|
@@ -3695,54 +3873,54 @@ class ei {
|
|
|
3695
3873
|
startSession(t) {
|
|
3696
3874
|
const n = { channel: t.channel };
|
|
3697
3875
|
return t.sessionId && (n.sessionId = t.sessionId), t.data && (n.data = t.data), this.http.postJson(
|
|
3698
|
-
|
|
3876
|
+
ve("/session/start", this.userId),
|
|
3699
3877
|
n
|
|
3700
3878
|
);
|
|
3701
3879
|
}
|
|
3702
3880
|
/** `GET /sessions` — list prior sessions (matches `client-sdk/session`). */
|
|
3703
3881
|
async listSessions() {
|
|
3704
|
-
const t = await this.http.getJson(
|
|
3705
|
-
return
|
|
3882
|
+
const t = await this.http.getJson(ve("/sessions", this.userId));
|
|
3883
|
+
return ai(t);
|
|
3706
3884
|
}
|
|
3707
3885
|
/** `GET /session/{id}` — fetch transcript + control (matches `client-sdk/session`). */
|
|
3708
3886
|
getSession(t) {
|
|
3709
3887
|
return this.http.getJson(
|
|
3710
|
-
|
|
3888
|
+
ve(`/session/${encodeURIComponent(t)}`, this.userId)
|
|
3711
3889
|
);
|
|
3712
3890
|
}
|
|
3713
3891
|
}
|
|
3714
|
-
function
|
|
3892
|
+
function ai(e) {
|
|
3715
3893
|
if (!Array.isArray(e))
|
|
3716
|
-
throw
|
|
3894
|
+
throw h.other("decode sessions: expected an array");
|
|
3717
3895
|
return e.forEach((t, n) => {
|
|
3718
3896
|
if (typeof t != "object" || t === null || Array.isArray(t))
|
|
3719
|
-
throw
|
|
3897
|
+
throw h.other(`decode sessions[${n}]: expected an object`);
|
|
3720
3898
|
if (typeof t.active != "boolean")
|
|
3721
|
-
throw
|
|
3899
|
+
throw h.other(`decode sessions[${n}].active: expected boolean`);
|
|
3722
3900
|
}), e;
|
|
3723
3901
|
}
|
|
3724
|
-
function
|
|
3725
|
-
return new Promise((
|
|
3726
|
-
const
|
|
3727
|
-
|
|
3728
|
-
const
|
|
3729
|
-
|
|
3730
|
-
let
|
|
3731
|
-
if (n.onProgress && (
|
|
3732
|
-
const
|
|
3733
|
-
if (m !== void 0 ? m !==
|
|
3734
|
-
m !== void 0 && (
|
|
3735
|
-
const
|
|
3736
|
-
|
|
3902
|
+
function oi(e, t, n, s) {
|
|
3903
|
+
return new Promise((r, i) => {
|
|
3904
|
+
const a = new XMLHttpRequest();
|
|
3905
|
+
a.open("POST", e, !0), s && a.setRequestHeader("Authorization", `Bearer ${s}`);
|
|
3906
|
+
const o = new FormData();
|
|
3907
|
+
o.append("file", t, t.name);
|
|
3908
|
+
let l = -1, u = 0;
|
|
3909
|
+
if (n.onProgress && (a.upload.onprogress = (d) => {
|
|
3910
|
+
const f = d.lengthComputable ? d.total : void 0, p = d.loaded, m = f !== void 0 ? Math.min(100, Math.floor(p / f * 100)) : void 0, g = Date.now();
|
|
3911
|
+
if (m !== void 0 ? m !== l : g - u >= 100) {
|
|
3912
|
+
m !== void 0 && (l = m), u = g;
|
|
3913
|
+
const x = { bytesUploaded: p };
|
|
3914
|
+
f !== void 0 && (x.totalBytes = f), m !== void 0 && (x.percent = m), n.onProgress?.(x);
|
|
3737
3915
|
}
|
|
3738
|
-
}),
|
|
3739
|
-
const
|
|
3740
|
-
if (
|
|
3741
|
-
|
|
3916
|
+
}), a.onload = () => {
|
|
3917
|
+
const d = a.status, f = a.responseText ?? "";
|
|
3918
|
+
if (d < 200 || d >= 300) {
|
|
3919
|
+
i(tt(d, li(f, s)));
|
|
3742
3920
|
return;
|
|
3743
3921
|
}
|
|
3744
3922
|
try {
|
|
3745
|
-
const
|
|
3923
|
+
const p = ci(JSON.parse(f));
|
|
3746
3924
|
if (n.onProgress && t.size > 0) {
|
|
3747
3925
|
const m = {
|
|
3748
3926
|
bytesUploaded: t.size,
|
|
@@ -3751,33 +3929,48 @@ function ni(e, t, n) {
|
|
|
3751
3929
|
};
|
|
3752
3930
|
n.onProgress(m);
|
|
3753
3931
|
}
|
|
3754
|
-
|
|
3755
|
-
} catch (
|
|
3756
|
-
|
|
3932
|
+
r(p);
|
|
3933
|
+
} catch (p) {
|
|
3934
|
+
i(h.other(`decode response: ${p.message}`));
|
|
3757
3935
|
}
|
|
3758
|
-
},
|
|
3759
|
-
|
|
3760
|
-
},
|
|
3761
|
-
|
|
3936
|
+
}, a.onerror = () => {
|
|
3937
|
+
i(h.other("upload failed: network error"));
|
|
3938
|
+
}, a.onabort = () => {
|
|
3939
|
+
i(h.cancelled());
|
|
3762
3940
|
}, n.signal) {
|
|
3763
3941
|
if (n.signal.aborted) {
|
|
3764
|
-
|
|
3942
|
+
a.abort();
|
|
3765
3943
|
return;
|
|
3766
3944
|
}
|
|
3767
|
-
n.signal.addEventListener("abort", () =>
|
|
3945
|
+
n.signal.addEventListener("abort", () => a.abort(), { once: !0 });
|
|
3768
3946
|
}
|
|
3769
|
-
|
|
3947
|
+
a.send(o);
|
|
3770
3948
|
});
|
|
3771
3949
|
}
|
|
3772
|
-
function
|
|
3950
|
+
function ci(e) {
|
|
3951
|
+
if (!ui(e)) throw h.other("decode response: attachment must be an object");
|
|
3952
|
+
const { id: t, name: n, contentType: s, url: r } = e;
|
|
3953
|
+
if (typeof t != "string" || typeof n != "string" || typeof s != "string")
|
|
3954
|
+
throw h.other("decode response: attachment id, name, and contentType must be strings");
|
|
3955
|
+
if (r !== void 0 && typeof r != "string")
|
|
3956
|
+
throw h.other("decode response: attachment url must be a string when present");
|
|
3957
|
+
return { id: t, name: n, contentType: s, ...r !== void 0 ? { url: r } : {} };
|
|
3958
|
+
}
|
|
3959
|
+
function ui(e) {
|
|
3960
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
3961
|
+
}
|
|
3962
|
+
function li(e, t) {
|
|
3963
|
+
return t ? e.split(t).join("[REDACTED]") : e;
|
|
3964
|
+
}
|
|
3965
|
+
function di(e, t) {
|
|
3773
3966
|
if (e.size === 0)
|
|
3774
|
-
return { ok: !1, error:
|
|
3967
|
+
return { ok: !1, error: h.attachment("EMPTY_FILE", `Empty file: ${e.name}`) };
|
|
3775
3968
|
if (!t) return { ok: !0 };
|
|
3776
|
-
const n =
|
|
3969
|
+
const n = hi(e.type);
|
|
3777
3970
|
if (!n)
|
|
3778
3971
|
return {
|
|
3779
3972
|
ok: !1,
|
|
3780
|
-
error:
|
|
3973
|
+
error: h.attachment(
|
|
3781
3974
|
"POLICY_UNSUPPORTED_TYPE",
|
|
3782
3975
|
`Unsupported content type: ${e.type || "unknown"}`
|
|
3783
3976
|
)
|
|
@@ -3785,43 +3978,43 @@ function si(e, t) {
|
|
|
3785
3978
|
const s = t[n];
|
|
3786
3979
|
return !s || !s.enabled ? {
|
|
3787
3980
|
ok: !1,
|
|
3788
|
-
error:
|
|
3981
|
+
error: h.attachment(
|
|
3789
3982
|
"POLICY_TYPE_DISABLED",
|
|
3790
3983
|
`Attachment type disabled: ${n}`
|
|
3791
3984
|
)
|
|
3792
3985
|
} : s.maxSize && e.size > s.maxSize * 1024 * 1024 ? {
|
|
3793
3986
|
ok: !1,
|
|
3794
|
-
error:
|
|
3987
|
+
error: h.attachment(
|
|
3795
3988
|
"POLICY_TOO_LARGE",
|
|
3796
3989
|
`File ${e.name} exceeds ${s.maxSize}MB limit for ${n}`
|
|
3797
3990
|
)
|
|
3798
3991
|
} : { ok: !0 };
|
|
3799
3992
|
}
|
|
3800
|
-
function
|
|
3993
|
+
function hi(e) {
|
|
3801
3994
|
return e ? e.startsWith("image/") ? "images" : e.startsWith("video/") ? "videos" : e.startsWith("audio/") ? "audio" : e.startsWith("application/") || e.startsWith("text/") || e === "application/pdf" ? "documents" : null : null;
|
|
3802
3995
|
}
|
|
3803
|
-
const
|
|
3804
|
-
function
|
|
3805
|
-
const e = localStorage.getItem(
|
|
3996
|
+
const Qt = "origonWebSdkUserId";
|
|
3997
|
+
function fi() {
|
|
3998
|
+
const e = localStorage.getItem(Qt);
|
|
3806
3999
|
if (e) return e;
|
|
3807
|
-
const t =
|
|
3808
|
-
return localStorage.setItem(
|
|
4000
|
+
const t = dn();
|
|
4001
|
+
return localStorage.setItem(Qt, t), t;
|
|
3809
4002
|
}
|
|
3810
|
-
const
|
|
4003
|
+
const mi = (1n << 62n) - 1n;
|
|
3811
4004
|
class y extends Error {
|
|
3812
4005
|
constructor(t) {
|
|
3813
4006
|
super(t), this.name = "CodecError";
|
|
3814
4007
|
}
|
|
3815
4008
|
}
|
|
3816
|
-
function
|
|
4009
|
+
function pi(e) {
|
|
3817
4010
|
if (e < 0n) throw new y(`negative varint: ${e}`);
|
|
3818
4011
|
if (e <= 63n) return 1;
|
|
3819
4012
|
if (e <= 16383n) return 2;
|
|
3820
4013
|
if (e <= 1073741823n) return 4;
|
|
3821
|
-
if (e <=
|
|
4014
|
+
if (e <= mi) return 8;
|
|
3822
4015
|
throw new y(`varint overflow: ${e}`);
|
|
3823
4016
|
}
|
|
3824
|
-
class
|
|
4017
|
+
class X {
|
|
3825
4018
|
constructor() {
|
|
3826
4019
|
this.chunks = [], this.len = 0;
|
|
3827
4020
|
}
|
|
@@ -3843,7 +4036,7 @@ class Y {
|
|
|
3843
4036
|
this.chunks.push(t), this.len += t.length;
|
|
3844
4037
|
}
|
|
3845
4038
|
putVarint(t) {
|
|
3846
|
-
const n = typeof t == "number" ? BigInt(t) : t, s =
|
|
4039
|
+
const n = typeof t == "number" ? BigInt(t) : t, s = pi(n);
|
|
3847
4040
|
switch (s) {
|
|
3848
4041
|
case 1:
|
|
3849
4042
|
this.putU8(Number(n));
|
|
@@ -3882,7 +4075,7 @@ class Y {
|
|
|
3882
4075
|
return t;
|
|
3883
4076
|
}
|
|
3884
4077
|
}
|
|
3885
|
-
class
|
|
4078
|
+
class ye {
|
|
3886
4079
|
constructor(t) {
|
|
3887
4080
|
this.buf = t, this.offset = 0;
|
|
3888
4081
|
}
|
|
@@ -3963,9 +4156,9 @@ class ge {
|
|
|
3963
4156
|
return new TextDecoder("utf-8", { fatal: !0 }).decode(this.getLengthPrefixedBytes());
|
|
3964
4157
|
}
|
|
3965
4158
|
}
|
|
3966
|
-
function
|
|
4159
|
+
function bi(e) {
|
|
3967
4160
|
try {
|
|
3968
|
-
const t = new
|
|
4161
|
+
const t = new ye(e);
|
|
3969
4162
|
t.getVarint();
|
|
3970
4163
|
const n = t.getVarint();
|
|
3971
4164
|
return t.position() + Number(n);
|
|
@@ -3973,56 +4166,56 @@ function ci(e) {
|
|
|
3973
4166
|
return null;
|
|
3974
4167
|
}
|
|
3975
4168
|
}
|
|
3976
|
-
const
|
|
3977
|
-
function
|
|
3978
|
-
const t = new
|
|
4169
|
+
const gi = 1, Wn = 2, Ei = 4, yi = 8, wi = 32;
|
|
4170
|
+
function Ii(e) {
|
|
4171
|
+
const t = new X(), n = e.endOfGroup ? Wn : 0;
|
|
3979
4172
|
return t.putVarint(n), t.putVarint(e.trackAlias), t.putVarint(e.groupId), t.putVarint(e.objectId), t.putU8(e.publisherPriority & 255), t.putBytes(e.payload), t.toUint8Array();
|
|
3980
4173
|
}
|
|
3981
|
-
function
|
|
3982
|
-
const t = new
|
|
4174
|
+
function Ni(e) {
|
|
4175
|
+
const t = new ye(e), n = Number(t.getVarint());
|
|
3983
4176
|
if (!(n >= 0 && n <= 15 || n >= 32 && n <= 47))
|
|
3984
4177
|
throw new y(`invalid ObjectDatagram type byte 0x${n.toString(16)}`);
|
|
3985
|
-
const s = (n &
|
|
4178
|
+
const s = (n & gi) !== 0, r = (n & Wn) !== 0, i = (n & Ei) !== 0, a = (n & yi) !== 0, o = (n & wi) !== 0;
|
|
3986
4179
|
if (o && r)
|
|
3987
4180
|
throw new y("status datagram cannot also be end-of-group");
|
|
3988
|
-
const l = t.getVarint(), u = t.getVarint(), d = i ? 1n : t.getVarint(),
|
|
4181
|
+
const l = t.getVarint(), u = t.getVarint(), d = i ? 1n : t.getVarint(), f = a ? 0 : t.getU8();
|
|
3989
4182
|
if (s) {
|
|
3990
|
-
const
|
|
3991
|
-
if (
|
|
3992
|
-
t.getBytes(
|
|
4183
|
+
const m = Number(t.getVarint());
|
|
4184
|
+
if (m === 0) throw new y("extension block declared but empty");
|
|
4185
|
+
t.getBytes(m);
|
|
3993
4186
|
}
|
|
3994
4187
|
if (o)
|
|
3995
4188
|
return t.getVarint(), {
|
|
3996
4189
|
trackAlias: l,
|
|
3997
4190
|
groupId: u,
|
|
3998
4191
|
objectId: d,
|
|
3999
|
-
publisherPriority:
|
|
4192
|
+
publisherPriority: f,
|
|
4000
4193
|
endOfGroup: r,
|
|
4001
4194
|
payload: new Uint8Array(0)
|
|
4002
4195
|
};
|
|
4003
|
-
const
|
|
4196
|
+
const p = t.drainRemaining();
|
|
4004
4197
|
return {
|
|
4005
4198
|
trackAlias: l,
|
|
4006
4199
|
groupId: u,
|
|
4007
4200
|
objectId: d,
|
|
4008
|
-
publisherPriority:
|
|
4201
|
+
publisherPriority: f,
|
|
4009
4202
|
endOfGroup: r,
|
|
4010
|
-
payload:
|
|
4203
|
+
payload: p.slice()
|
|
4011
4204
|
};
|
|
4012
4205
|
}
|
|
4013
|
-
const
|
|
4206
|
+
const ie = {
|
|
4014
4207
|
AudioObject: 0,
|
|
4015
4208
|
AudioFeedback: 1
|
|
4016
4209
|
};
|
|
4017
|
-
function
|
|
4210
|
+
function Jt(e, t) {
|
|
4018
4211
|
const n = new Uint8Array(t.length + 1);
|
|
4019
4212
|
return n[0] = e, n.set(t, 1), n;
|
|
4020
4213
|
}
|
|
4021
|
-
function
|
|
4214
|
+
function Ti(e) {
|
|
4022
4215
|
if (e.length === 0) throw new y("empty datagram envelope");
|
|
4023
4216
|
return { cls: e[0], body: e.subarray(1) };
|
|
4024
4217
|
}
|
|
4025
|
-
const
|
|
4218
|
+
const Pe = 64 * 1024, S = {
|
|
4026
4219
|
CONNECT: 0x40n,
|
|
4027
4220
|
CONNECT_OK: 0x41n,
|
|
4028
4221
|
NEGOTIATE_MEDIA: 0x42n,
|
|
@@ -4043,31 +4236,31 @@ const Me = 64 * 1024, T = {
|
|
|
4043
4236
|
// 0x54 = DtmfReceived — not implemented; uni-stream payload anyway
|
|
4044
4237
|
MOQ_ERROR: 0x55n
|
|
4045
4238
|
};
|
|
4046
|
-
function
|
|
4047
|
-
const t = new
|
|
4048
|
-
if (s.length >
|
|
4049
|
-
throw new y(`control frame payload ${s.length} > ${
|
|
4239
|
+
function Si(e) {
|
|
4240
|
+
const t = new X(), { msgType: n, payload: s } = Ai(e);
|
|
4241
|
+
if (s.length > Pe)
|
|
4242
|
+
throw new y(`control frame payload ${s.length} > ${Pe}`);
|
|
4050
4243
|
return t.putVarint(n), t.putVarint(s.length), t.putBytes(s), t.toUint8Array();
|
|
4051
4244
|
}
|
|
4052
|
-
function
|
|
4053
|
-
const t =
|
|
4245
|
+
function ki(e) {
|
|
4246
|
+
const t = bi(e);
|
|
4054
4247
|
if (t === null || t > e.length) return null;
|
|
4055
|
-
const n = new
|
|
4056
|
-
if (r >
|
|
4248
|
+
const n = new ye(e), s = n.getVarint(), r = Number(n.getVarint());
|
|
4249
|
+
if (r > Pe)
|
|
4057
4250
|
throw new y(`oversized payload ${r}`);
|
|
4058
4251
|
const i = n.getBytes(r);
|
|
4059
|
-
return { msg:
|
|
4252
|
+
return { msg: Ri(s, i), consumed: t };
|
|
4060
4253
|
}
|
|
4061
|
-
function
|
|
4254
|
+
function Ai(e) {
|
|
4062
4255
|
switch (e.type) {
|
|
4063
4256
|
case "connect":
|
|
4064
|
-
return { msgType:
|
|
4257
|
+
return { msgType: S.CONNECT, payload: Yi(e.data) };
|
|
4065
4258
|
case "negotiateMedia":
|
|
4066
|
-
return { msgType:
|
|
4259
|
+
return { msgType: S.NEGOTIATE_MEDIA, payload: $i(e.data) };
|
|
4067
4260
|
case "mute":
|
|
4068
|
-
return { msgType:
|
|
4261
|
+
return { msgType: S.MUTE, payload: Xi(e.data) };
|
|
4069
4262
|
case "resume":
|
|
4070
|
-
return { msgType:
|
|
4263
|
+
return { msgType: S.RESUME, payload: Ki(e.data) };
|
|
4071
4264
|
// The remaining variants are server-emitted; we never encode them
|
|
4072
4265
|
// outbound. Including the cases keeps the union exhaustive.
|
|
4073
4266
|
case "connectOk":
|
|
@@ -4083,39 +4276,39 @@ function Ei(e) {
|
|
|
4083
4276
|
throw new y(`refusing to encode server-emitted variant '${e.type}'`);
|
|
4084
4277
|
}
|
|
4085
4278
|
}
|
|
4086
|
-
function
|
|
4087
|
-
const n = new
|
|
4279
|
+
function Ri(e, t) {
|
|
4280
|
+
const n = new ye(t);
|
|
4088
4281
|
let s;
|
|
4089
4282
|
switch (e) {
|
|
4090
|
-
case
|
|
4091
|
-
s = { type: "connectOk", data:
|
|
4283
|
+
case S.CONNECT_OK:
|
|
4284
|
+
s = { type: "connectOk", data: Wi(n) };
|
|
4092
4285
|
break;
|
|
4093
|
-
case
|
|
4094
|
-
s = { type: "negotiateMediaOk", data:
|
|
4286
|
+
case S.NEGOTIATE_MEDIA_OK:
|
|
4287
|
+
s = { type: "negotiateMediaOk", data: ji(n) };
|
|
4095
4288
|
break;
|
|
4096
|
-
case
|
|
4097
|
-
s = { type: "muteOk", data:
|
|
4289
|
+
case S.MUTE_OK:
|
|
4290
|
+
s = { type: "muteOk", data: qi(n) };
|
|
4098
4291
|
break;
|
|
4099
|
-
case
|
|
4100
|
-
s = { type: "resumeOk", data:
|
|
4292
|
+
case S.RESUME_OK:
|
|
4293
|
+
s = { type: "resumeOk", data: Hi(n) };
|
|
4101
4294
|
break;
|
|
4102
|
-
case
|
|
4103
|
-
s = { type: "peerAttached", data:
|
|
4295
|
+
case S.PEER_ATTACHED:
|
|
4296
|
+
s = { type: "peerAttached", data: Zi(n) };
|
|
4104
4297
|
break;
|
|
4105
|
-
case
|
|
4106
|
-
s = { type: "peerDetached", data:
|
|
4298
|
+
case S.PEER_DETACHED:
|
|
4299
|
+
s = { type: "peerDetached", data: zi(n) };
|
|
4107
4300
|
break;
|
|
4108
|
-
case
|
|
4109
|
-
s = { type: "endpointMuted", data:
|
|
4301
|
+
case S.ENDPOINT_MUTED:
|
|
4302
|
+
s = { type: "endpointMuted", data: Qi(n) };
|
|
4110
4303
|
break;
|
|
4111
|
-
case
|
|
4112
|
-
s = { type: "endpointHangup", data:
|
|
4304
|
+
case S.ENDPOINT_HANGUP:
|
|
4305
|
+
s = { type: "endpointHangup", data: Ji(n) };
|
|
4113
4306
|
break;
|
|
4114
|
-
case
|
|
4115
|
-
s = { type: "peerStateChanged", data:
|
|
4307
|
+
case S.PEER_STATE_CHANGED:
|
|
4308
|
+
s = { type: "peerStateChanged", data: ea(n) };
|
|
4116
4309
|
break;
|
|
4117
|
-
case
|
|
4118
|
-
s = { type: "moqError", data:
|
|
4310
|
+
case S.MOQ_ERROR:
|
|
4311
|
+
s = { type: "moqError", data: ta(n) };
|
|
4119
4312
|
break;
|
|
4120
4313
|
default:
|
|
4121
4314
|
throw new y(`unknown control message type 0x${e.toString(16)}`);
|
|
@@ -4126,17 +4319,17 @@ function yi(e, t) {
|
|
|
4126
4319
|
);
|
|
4127
4320
|
return s;
|
|
4128
4321
|
}
|
|
4129
|
-
function
|
|
4322
|
+
function _i(e) {
|
|
4130
4323
|
switch (e) {
|
|
4131
4324
|
case "audio":
|
|
4132
4325
|
return 1n;
|
|
4133
4326
|
}
|
|
4134
4327
|
}
|
|
4135
|
-
function
|
|
4328
|
+
function vi(e) {
|
|
4136
4329
|
if (e === 1n) return "audio";
|
|
4137
4330
|
throw new y(`unknown EncodingClass id ${e}`);
|
|
4138
4331
|
}
|
|
4139
|
-
function
|
|
4332
|
+
function Oi(e) {
|
|
4140
4333
|
switch (e) {
|
|
4141
4334
|
case "primary":
|
|
4142
4335
|
return 1n;
|
|
@@ -4144,12 +4337,12 @@ function Ii(e) {
|
|
|
4144
4337
|
return 2n;
|
|
4145
4338
|
}
|
|
4146
4339
|
}
|
|
4147
|
-
function
|
|
4340
|
+
function Ci(e) {
|
|
4148
4341
|
if (e === 1n) return "primary";
|
|
4149
4342
|
if (e === 2n) return "captions";
|
|
4150
4343
|
throw new y(`unknown TrackPurpose id ${e}`);
|
|
4151
4344
|
}
|
|
4152
|
-
function
|
|
4345
|
+
function Di(e) {
|
|
4153
4346
|
switch (e) {
|
|
4154
4347
|
case "opus":
|
|
4155
4348
|
return 1n;
|
|
@@ -4159,13 +4352,13 @@ function Si(e) {
|
|
|
4159
4352
|
return 3n;
|
|
4160
4353
|
}
|
|
4161
4354
|
}
|
|
4162
|
-
function
|
|
4355
|
+
function nt(e) {
|
|
4163
4356
|
if (e === 1n) return "opus";
|
|
4164
4357
|
if (e === 2n) return "pcmu";
|
|
4165
4358
|
if (e === 3n) return "pcma";
|
|
4166
4359
|
throw new y(`unknown AudioCodec id ${e}`);
|
|
4167
4360
|
}
|
|
4168
|
-
function
|
|
4361
|
+
function Ui(e) {
|
|
4169
4362
|
switch (e) {
|
|
4170
4363
|
case "none":
|
|
4171
4364
|
return 0n;
|
|
@@ -4177,165 +4370,165 @@ function ki(e) {
|
|
|
4177
4370
|
return 3n;
|
|
4178
4371
|
}
|
|
4179
4372
|
}
|
|
4180
|
-
function
|
|
4373
|
+
function jn(e) {
|
|
4181
4374
|
if (e === 0n) return "none";
|
|
4182
4375
|
if (e === 1n) return "uplink";
|
|
4183
4376
|
if (e === 2n) return "downlink";
|
|
4184
4377
|
if (e === 3n) return "both";
|
|
4185
4378
|
throw new y(`unknown MuteScope id ${e}`);
|
|
4186
4379
|
}
|
|
4187
|
-
function
|
|
4380
|
+
function Li(e) {
|
|
4188
4381
|
if (e === 1n) return "normal";
|
|
4189
4382
|
if (e === 2n) return "userCancel";
|
|
4190
4383
|
if (e === 3n) return "error";
|
|
4191
4384
|
throw new y(`unknown HangupReason id ${e}`);
|
|
4192
4385
|
}
|
|
4193
|
-
function
|
|
4386
|
+
function qn(e) {
|
|
4194
4387
|
if (e === 1n) return "client";
|
|
4195
4388
|
if (e === 2n) return "controller";
|
|
4196
4389
|
if (e === 3n) return "engine";
|
|
4197
4390
|
if (e === 4n) return "networkLost";
|
|
4198
4391
|
throw new y(`unknown Origin id ${e}`);
|
|
4199
4392
|
}
|
|
4200
|
-
function
|
|
4393
|
+
function Mi(e) {
|
|
4201
4394
|
if (e === 1n) return "active";
|
|
4202
4395
|
if (e === 2n) return "held";
|
|
4203
4396
|
if (e === 3n) return "muted";
|
|
4204
4397
|
if (e === 4n) return "hangup";
|
|
4205
4398
|
throw new y(`unknown PeerState id ${e}`);
|
|
4206
4399
|
}
|
|
4207
|
-
function
|
|
4400
|
+
function xi(e) {
|
|
4208
4401
|
if (e === 1n) return "codecMismatch";
|
|
4209
4402
|
if (e === 2n) return "unsupportedClass";
|
|
4210
4403
|
if (e === 3n) return "capacityExceeded";
|
|
4211
4404
|
throw new y(`unknown TrackRejectionReason id ${e}`);
|
|
4212
4405
|
}
|
|
4213
|
-
function
|
|
4214
|
-
t.putVarint(
|
|
4215
|
-
for (const n of e.codecs) t.putVarint(
|
|
4406
|
+
function Pi(e, t) {
|
|
4407
|
+
t.putVarint(_i(e.class)), t.putVarint(Oi(e.purpose)), t.putVarint(e.codecs.length);
|
|
4408
|
+
for (const n of e.codecs) t.putVarint(Di(n));
|
|
4216
4409
|
}
|
|
4217
|
-
function
|
|
4410
|
+
function Hn(e, t) {
|
|
4218
4411
|
t.putVarint(e.length);
|
|
4219
|
-
for (const n of e)
|
|
4412
|
+
for (const n of e) Pi(n, t);
|
|
4220
4413
|
}
|
|
4221
|
-
function
|
|
4414
|
+
function Vi(e) {
|
|
4222
4415
|
return {
|
|
4223
4416
|
offerIndex: Number(e.getVarint()),
|
|
4224
4417
|
alias: e.getVarint(),
|
|
4225
|
-
codec:
|
|
4418
|
+
codec: nt(e.getVarint()),
|
|
4226
4419
|
frameSizeMs: Number(e.getVarint())
|
|
4227
4420
|
};
|
|
4228
4421
|
}
|
|
4229
|
-
function
|
|
4422
|
+
function Zn(e) {
|
|
4230
4423
|
const t = Number(e.getVarint()), n = [];
|
|
4231
|
-
for (let s = 0; s < t; s++) n.push(
|
|
4424
|
+
for (let s = 0; s < t; s++) n.push(Vi(e));
|
|
4232
4425
|
return n;
|
|
4233
4426
|
}
|
|
4234
|
-
function
|
|
4427
|
+
function Fi(e) {
|
|
4235
4428
|
return {
|
|
4236
4429
|
offerIndex: Number(e.getVarint()),
|
|
4237
|
-
reason:
|
|
4430
|
+
reason: xi(e.getVarint())
|
|
4238
4431
|
};
|
|
4239
4432
|
}
|
|
4240
|
-
function
|
|
4433
|
+
function zn(e) {
|
|
4241
4434
|
const t = Number(e.getVarint()), n = [];
|
|
4242
|
-
for (let s = 0; s < t; s++) n.push(
|
|
4435
|
+
for (let s = 0; s < t; s++) n.push(Fi(e));
|
|
4243
4436
|
return n;
|
|
4244
4437
|
}
|
|
4245
|
-
function
|
|
4438
|
+
function Gi(e) {
|
|
4246
4439
|
return {
|
|
4247
4440
|
peerEndpointId: e.getString(),
|
|
4248
4441
|
alias: e.getVarint(),
|
|
4249
|
-
codec:
|
|
4442
|
+
codec: nt(e.getVarint())
|
|
4250
4443
|
};
|
|
4251
4444
|
}
|
|
4252
|
-
function
|
|
4253
|
-
const t = e.getVarint(), n =
|
|
4254
|
-
for (let a = 0; a < r; a++) i.push(
|
|
4445
|
+
function Bi(e) {
|
|
4446
|
+
const t = e.getVarint(), n = jn(e.getVarint()), s = e.getVarint() !== 0n, r = Number(e.getVarint()), i = [];
|
|
4447
|
+
for (let a = 0; a < r; a++) i.push(Gi(e));
|
|
4255
4448
|
return { sessionSeq: t, mute: n, held: s, peers: i };
|
|
4256
4449
|
}
|
|
4257
|
-
function
|
|
4258
|
-
const t = new
|
|
4259
|
-
return t.putVarint(e.requestId), t.putLengthPrefixedBytes(e.callToken), t.putString(e.sdkName), t.putString(e.sdkVersion),
|
|
4450
|
+
function Yi(e) {
|
|
4451
|
+
const t = new X();
|
|
4452
|
+
return t.putVarint(e.requestId), t.putLengthPrefixedBytes(e.callToken), t.putString(e.sdkName), t.putString(e.sdkVersion), Hn(e.offers, t), t.putVarint(e.frameSizeMs), t.toUint8Array();
|
|
4260
4453
|
}
|
|
4261
|
-
function
|
|
4262
|
-
const t = new
|
|
4263
|
-
return t.putVarint(e.requestId),
|
|
4454
|
+
function $i(e) {
|
|
4455
|
+
const t = new X();
|
|
4456
|
+
return t.putVarint(e.requestId), Hn(e.offers, t), t.putVarint(e.frameSizeMs), t.toUint8Array();
|
|
4264
4457
|
}
|
|
4265
|
-
function
|
|
4266
|
-
const t = new
|
|
4267
|
-
return t.putVarint(e.requestId), t.putVarint(
|
|
4458
|
+
function Xi(e) {
|
|
4459
|
+
const t = new X();
|
|
4460
|
+
return t.putVarint(e.requestId), t.putVarint(Ui(e.scope)), t.toUint8Array();
|
|
4268
4461
|
}
|
|
4269
|
-
function
|
|
4270
|
-
const t = new
|
|
4462
|
+
function Ki(e) {
|
|
4463
|
+
const t = new X();
|
|
4271
4464
|
return t.putVarint(e.requestId), t.putLengthPrefixedBytes(e.callToken), t.putVarint(e.lastEventSeq), t.toUint8Array();
|
|
4272
4465
|
}
|
|
4273
|
-
function
|
|
4466
|
+
function Wi(e) {
|
|
4274
4467
|
return {
|
|
4275
4468
|
requestId: e.getVarint(),
|
|
4276
4469
|
serverEpochUnix: e.getVarint(),
|
|
4277
4470
|
canonicalPcmRate: Number(e.getVarint()),
|
|
4278
|
-
bindings:
|
|
4279
|
-
rejected:
|
|
4471
|
+
bindings: Zn(e),
|
|
4472
|
+
rejected: zn(e)
|
|
4280
4473
|
};
|
|
4281
4474
|
}
|
|
4282
|
-
function
|
|
4475
|
+
function ji(e) {
|
|
4283
4476
|
return {
|
|
4284
4477
|
requestId: e.getVarint(),
|
|
4285
|
-
bindings:
|
|
4286
|
-
rejected:
|
|
4478
|
+
bindings: Zn(e),
|
|
4479
|
+
rejected: zn(e)
|
|
4287
4480
|
};
|
|
4288
4481
|
}
|
|
4289
|
-
function
|
|
4482
|
+
function qi(e) {
|
|
4290
4483
|
return { requestId: e.getVarint() };
|
|
4291
4484
|
}
|
|
4292
|
-
function
|
|
4485
|
+
function Hi(e) {
|
|
4293
4486
|
return {
|
|
4294
4487
|
requestId: e.getVarint(),
|
|
4295
|
-
state:
|
|
4488
|
+
state: Bi(e)
|
|
4296
4489
|
};
|
|
4297
4490
|
}
|
|
4298
|
-
function
|
|
4491
|
+
function Zi(e) {
|
|
4299
4492
|
return {
|
|
4300
4493
|
requestId: e.getVarint(),
|
|
4301
4494
|
peerEndpointId: e.getString(),
|
|
4302
4495
|
alias: e.getVarint(),
|
|
4303
|
-
class:
|
|
4304
|
-
purpose:
|
|
4305
|
-
codec:
|
|
4496
|
+
class: vi(e.getVarint()),
|
|
4497
|
+
purpose: Ci(e.getVarint()),
|
|
4498
|
+
codec: nt(e.getVarint()),
|
|
4306
4499
|
frameSizeMs: Number(e.getVarint())
|
|
4307
4500
|
};
|
|
4308
4501
|
}
|
|
4309
|
-
function
|
|
4502
|
+
function zi(e) {
|
|
4310
4503
|
return {
|
|
4311
4504
|
requestId: e.getVarint(),
|
|
4312
4505
|
peerEndpointId: e.getString()
|
|
4313
4506
|
};
|
|
4314
4507
|
}
|
|
4315
|
-
function
|
|
4508
|
+
function Qi(e) {
|
|
4316
4509
|
return {
|
|
4317
4510
|
requestId: e.getVarint(),
|
|
4318
4511
|
endpointId: e.getString(),
|
|
4319
|
-
scope:
|
|
4320
|
-
origin:
|
|
4512
|
+
scope: jn(e.getVarint()),
|
|
4513
|
+
origin: qn(e.getVarint())
|
|
4321
4514
|
};
|
|
4322
4515
|
}
|
|
4323
|
-
function
|
|
4516
|
+
function Ji(e) {
|
|
4324
4517
|
return {
|
|
4325
4518
|
requestId: e.getVarint(),
|
|
4326
4519
|
endpointId: e.getString(),
|
|
4327
|
-
reason:
|
|
4328
|
-
origin:
|
|
4520
|
+
reason: Li(e.getVarint()),
|
|
4521
|
+
origin: qn(e.getVarint())
|
|
4329
4522
|
};
|
|
4330
4523
|
}
|
|
4331
|
-
function
|
|
4524
|
+
function ea(e) {
|
|
4332
4525
|
return {
|
|
4333
4526
|
requestId: e.getVarint(),
|
|
4334
4527
|
peerEndpointId: e.getString(),
|
|
4335
|
-
state:
|
|
4528
|
+
state: Mi(e.getVarint())
|
|
4336
4529
|
};
|
|
4337
4530
|
}
|
|
4338
|
-
function
|
|
4531
|
+
function ta(e) {
|
|
4339
4532
|
const t = e.getVarint();
|
|
4340
4533
|
let n;
|
|
4341
4534
|
if (t === 0n)
|
|
@@ -4345,9 +4538,9 @@ function ji(e) {
|
|
|
4345
4538
|
else
|
|
4346
4539
|
throw new y(`MoqError.request_id present tag ${t} not in {0,1}`);
|
|
4347
4540
|
const s = e.getVarint(), r = e.getString();
|
|
4348
|
-
return { requestId: n, code:
|
|
4541
|
+
return { requestId: n, code: na(s), rawCode: s, detail: r };
|
|
4349
4542
|
}
|
|
4350
|
-
function
|
|
4543
|
+
function na(e) {
|
|
4351
4544
|
switch (e) {
|
|
4352
4545
|
case 0x1001n:
|
|
4353
4546
|
return "endpointNotProvisioned";
|
|
@@ -4375,7 +4568,7 @@ function qi(e) {
|
|
|
4375
4568
|
return null;
|
|
4376
4569
|
}
|
|
4377
4570
|
}
|
|
4378
|
-
const
|
|
4571
|
+
const sa = /* @__PURE__ */ new Set([
|
|
4379
4572
|
"sessionEnded",
|
|
4380
4573
|
"tokenInvalid",
|
|
4381
4574
|
"tokenExpired",
|
|
@@ -4384,7 +4577,7 @@ const Hi = /* @__PURE__ */ new Set([
|
|
|
4384
4577
|
"endpointAlreadyConnected",
|
|
4385
4578
|
"replayLost"
|
|
4386
4579
|
]);
|
|
4387
|
-
class
|
|
4580
|
+
class be {
|
|
4388
4581
|
constructor(t, n, s, r, i) {
|
|
4389
4582
|
this.wt = t, this.controlWriter = n, this.controlReader = s, this.datagramWriter = r, this.datagramReader = i;
|
|
4390
4583
|
}
|
|
@@ -4403,7 +4596,7 @@ class me {
|
|
|
4403
4596
|
} catch {
|
|
4404
4597
|
}
|
|
4405
4598
|
const s = await n.createBidirectionalStream(), r = s.writable.getWriter(), i = s.readable.getReader(), a = n.datagrams.writable.getWriter(), o = n.datagrams.readable.getReader();
|
|
4406
|
-
return new
|
|
4599
|
+
return new be(
|
|
4407
4600
|
n,
|
|
4408
4601
|
r,
|
|
4409
4602
|
i,
|
|
@@ -4413,7 +4606,7 @@ class me {
|
|
|
4413
4606
|
}
|
|
4414
4607
|
/** Encode + write one control frame. Honours WT backpressure. */
|
|
4415
4608
|
async sendControl(t) {
|
|
4416
|
-
const n =
|
|
4609
|
+
const n = Si(t);
|
|
4417
4610
|
await this.controlWriter.ready, await this.controlWriter.write(n);
|
|
4418
4611
|
}
|
|
4419
4612
|
/**
|
|
@@ -4425,7 +4618,7 @@ class me {
|
|
|
4425
4618
|
let t = new Uint8Array(0);
|
|
4426
4619
|
for (; ; ) {
|
|
4427
4620
|
for (; ; ) {
|
|
4428
|
-
const i =
|
|
4621
|
+
const i = ki(t);
|
|
4429
4622
|
if (!i) break;
|
|
4430
4623
|
yield i.msg, t = t.subarray(i.consumed);
|
|
4431
4624
|
}
|
|
@@ -4500,8 +4693,8 @@ class me {
|
|
|
4500
4693
|
}
|
|
4501
4694
|
}
|
|
4502
4695
|
}
|
|
4503
|
-
const
|
|
4504
|
-
class
|
|
4696
|
+
const ra = 2e3;
|
|
4697
|
+
class ia {
|
|
4505
4698
|
constructor(t) {
|
|
4506
4699
|
this.ctx = null, this.node = null, this.micStream = null, this.micSource = null, this.silenceSource = null, this.micDiagAnalyser = null, this.micDiagTimer = null, this.outboundCallback = null, this.downlinkFeedbackCallback = null, this.captureGeneration = 0, this.outboundCaptureGeneration = null, this.outputGateEpoch = 0, this.captureCommandId = 0, this.captureAcks = /* @__PURE__ */ new Map(), this.options = {
|
|
4507
4700
|
wasmUrl: t.wasmUrl,
|
|
@@ -4711,7 +4904,7 @@ class Ji {
|
|
|
4711
4904
|
const n = ++this.captureCommandId, s = new Promise((r, i) => {
|
|
4712
4905
|
const a = setTimeout(() => {
|
|
4713
4906
|
this.captureAcks.get(n)?.expected === t && (this.captureAcks.delete(n), i(new Error(`${t} acknowledgement timed out`)));
|
|
4714
|
-
},
|
|
4907
|
+
}, ra);
|
|
4715
4908
|
this.captureAcks.set(n, { expected: t, resolve: r, reject: i, timeout: a });
|
|
4716
4909
|
});
|
|
4717
4910
|
return { commandId: n, ack: s };
|
|
@@ -4738,16 +4931,16 @@ class Ji {
|
|
|
4738
4931
|
}
|
|
4739
4932
|
}
|
|
4740
4933
|
}
|
|
4741
|
-
const
|
|
4742
|
-
function
|
|
4934
|
+
const en = [100, 250, 500, 1e3], aa = 1e4, oa = 50;
|
|
4935
|
+
function tn(e, t) {
|
|
4743
4936
|
return new URL(t, e.endsWith("/") ? e : `${e}/`).href;
|
|
4744
4937
|
}
|
|
4745
|
-
const
|
|
4746
|
-
class
|
|
4938
|
+
const ca = new URL("./audio/wasm-gen/origon_web_audio_bg.wasm?no-inline", import.meta.url).href, ua = new URL("./audio/audio-processor.js?no-inline", import.meta.url).href;
|
|
4939
|
+
class la {
|
|
4747
4940
|
constructor(t, n) {
|
|
4748
4941
|
this.transport = null, this.requestIdCtr = 1n, this.uplinkAlias = null, this.peerAliasByEndpoint = /* @__PURE__ */ new Map(), this.pendingRequests = /* @__PURE__ */ new Map(), this.closedTransports = /* @__PURE__ */ new WeakSet(), this.lastEventSeq = 0n, this.terminalReason = null, this.statsSubscriberCount = 0, this.latestStats = null, this.statsSubscribers = /* @__PURE__ */ new Set(), this.currentMuteScope = "none", this.startGeneration = 0, this.captureTransition = Promise.resolve(), this.captureGeneration = 0, this.localCaptureEnabled = !1, this.desiredCoach = !1, this.diagTx = 0, this.diagRx = 0, this.diagLastStatsLog = 0, this.sessionId = t.sessionId, this.url = `${t.url.replace(/\/$/, "")}/web`, this.callToken = t.token, this.dispatcher = n.dispatcher, this.onTerminal = n.onTerminal;
|
|
4749
|
-
const s = n.assetBaseUrl ?
|
|
4750
|
-
this.host = new
|
|
4942
|
+
const s = n.assetBaseUrl ? tn(n.assetBaseUrl, "audio/wasm-gen/origon_web_audio_bg.wasm") : ca, r = n.assetBaseUrl ? tn(n.assetBaseUrl, "audio/audio-processor.js") : ua;
|
|
4943
|
+
this.host = new ia({
|
|
4751
4944
|
wasmUrl: s,
|
|
4752
4945
|
processorUrl: r,
|
|
4753
4946
|
onStats: (i) => this.handleHostStats(i),
|
|
@@ -4762,7 +4955,7 @@ class na {
|
|
|
4762
4955
|
const n = this.startGeneration;
|
|
4763
4956
|
this.assertStartActive(n), await this.host.start(), this.assertStartActive(n), this.host.onOutboundDatagram((s) => {
|
|
4764
4957
|
this.diagTx += 1, this.diagTx === 1 || this.diagTx % 100;
|
|
4765
|
-
const r =
|
|
4958
|
+
const r = Jt(ie.AudioObject, s);
|
|
4766
4959
|
this.transport?.sendDatagram(r).catch(() => {
|
|
4767
4960
|
});
|
|
4768
4961
|
}), this.host.onDownlinkFeedback((s) => {
|
|
@@ -4772,7 +4965,7 @@ class na {
|
|
|
4772
4965
|
if (r += 2, r + i > s.length) break;
|
|
4773
4966
|
const a = s.subarray(r, r + i);
|
|
4774
4967
|
r += i;
|
|
4775
|
-
const o =
|
|
4968
|
+
const o = Jt(ie.AudioFeedback, a);
|
|
4776
4969
|
this.transport?.sendDatagram(o).catch(() => {
|
|
4777
4970
|
});
|
|
4778
4971
|
}
|
|
@@ -4856,7 +5049,7 @@ class na {
|
|
|
4856
5049
|
}
|
|
4857
5050
|
// ── Connect handshake + read pumps ───────────────────────────────────
|
|
4858
5051
|
async dial(t, n) {
|
|
4859
|
-
const s = await
|
|
5052
|
+
const s = await be.open(this.url);
|
|
4860
5053
|
if (!this.isStartActive(n))
|
|
4861
5054
|
throw s.close({ closeCode: 0, reason: "session start cancelled" }), new Error("voice session start cancelled");
|
|
4862
5055
|
this.transport = s, this.transport.startUniStreamDrain(), this.startReadLoops();
|
|
@@ -4903,19 +5096,19 @@ class na {
|
|
|
4903
5096
|
for await (const n of t.readDatagrams()) {
|
|
4904
5097
|
let s;
|
|
4905
5098
|
try {
|
|
4906
|
-
const r =
|
|
4907
|
-
if (r.cls ===
|
|
5099
|
+
const r = Ti(n);
|
|
5100
|
+
if (r.cls === ie.AudioFeedback) {
|
|
4908
5101
|
this.host.pushUplinkFeedback(r.body);
|
|
4909
5102
|
continue;
|
|
4910
5103
|
}
|
|
4911
|
-
if (r.cls !==
|
|
5104
|
+
if (r.cls !== ie.AudioObject)
|
|
4912
5105
|
continue;
|
|
4913
5106
|
s = r.body;
|
|
4914
5107
|
} catch {
|
|
4915
5108
|
continue;
|
|
4916
5109
|
}
|
|
4917
5110
|
try {
|
|
4918
|
-
const r =
|
|
5111
|
+
const r = Ni(s);
|
|
4919
5112
|
this.diagRx += 1, this.diagRx === 1 || this.diagRx % 100;
|
|
4920
5113
|
} catch {
|
|
4921
5114
|
}
|
|
@@ -4936,7 +5129,7 @@ class na {
|
|
|
4936
5129
|
}
|
|
4937
5130
|
if ("requestId" in t.data) {
|
|
4938
5131
|
const s = t.data.requestId;
|
|
4939
|
-
s !== null && s !== 0n && (this.lastEventSeq =
|
|
5132
|
+
s !== null && s !== 0n && (this.lastEventSeq = da(this.lastEventSeq, s));
|
|
4940
5133
|
}
|
|
4941
5134
|
switch (t.type) {
|
|
4942
5135
|
case "peerAttached": {
|
|
@@ -4969,10 +5162,10 @@ class na {
|
|
|
4969
5162
|
}
|
|
4970
5163
|
case "moqError": {
|
|
4971
5164
|
const s = t.data.code;
|
|
4972
|
-
if (s === null ||
|
|
5165
|
+
if (s === null || sa.has(s)) {
|
|
4973
5166
|
const i = s ?? "unknown";
|
|
4974
5167
|
this.enterTerminalState(
|
|
4975
|
-
s === null ? { kind: "protocolViolation" } :
|
|
5168
|
+
s === null ? { kind: "protocolViolation" } : ha(s),
|
|
4976
5169
|
new Error(`terminal MoqError ${i}`),
|
|
4977
5170
|
`terminal MoqError ${i}`
|
|
4978
5171
|
);
|
|
@@ -5005,20 +5198,20 @@ class na {
|
|
|
5005
5198
|
if (this.rejectPendingRequestsForTransport(
|
|
5006
5199
|
t,
|
|
5007
5200
|
new Error("voice transport closed before control acknowledgement")
|
|
5008
|
-
), this.closedTransports.add(t), this.host.cancelCaptureTransition(!1), this.localCaptureEnabled || (this.captureGeneration += 1, this.host.cancelCaptureTransition(!0)), await
|
|
5201
|
+
), this.closedTransports.add(t), this.host.cancelCaptureTransition(!1), this.localCaptureEnabled || (this.captureGeneration += 1, this.host.cancelCaptureTransition(!0)), await W(oa), this.terminalReason) {
|
|
5009
5202
|
this.host.dispose().catch(() => {
|
|
5010
5203
|
}), this.onTerminal(this.terminalReason, this.sessionId);
|
|
5011
5204
|
return;
|
|
5012
5205
|
}
|
|
5013
5206
|
this.transport === t && (this.transport = null);
|
|
5014
|
-
for (let r = 1; r <=
|
|
5015
|
-
const i =
|
|
5207
|
+
for (let r = 1; r <= en.length && this.isStartActive(n); r++) {
|
|
5208
|
+
const i = en[r - 1];
|
|
5016
5209
|
this.dispatcher.fire("onReconnecting", this.sessionId, "voice", {
|
|
5017
5210
|
attempt: r,
|
|
5018
5211
|
reason: { kind: "networkLoss" }
|
|
5019
5212
|
});
|
|
5020
5213
|
try {
|
|
5021
|
-
await
|
|
5214
|
+
await W(i), this.assertStartActive(n), await this.attemptResume(n), this.assertStartActive(n), this.dispatcher.fire("onReconnected", this.sessionId, "voice"), this.watchTransportClosed();
|
|
5022
5215
|
return;
|
|
5023
5216
|
} catch {
|
|
5024
5217
|
if (this.terminalReason)
|
|
@@ -5030,7 +5223,7 @@ class na {
|
|
|
5030
5223
|
}), this.onTerminal(s, this.sessionId);
|
|
5031
5224
|
}
|
|
5032
5225
|
async attemptResume(t) {
|
|
5033
|
-
const n = await
|
|
5226
|
+
const n = await be.open(this.url);
|
|
5034
5227
|
if (!this.isStartActive(t))
|
|
5035
5228
|
throw n.close({ closeCode: 0, reason: "session reconnect cancelled" }), new Error("voice session start cancelled");
|
|
5036
5229
|
this.transport = n, this.transport.startUniStreamDrain(), this.startReadLoops();
|
|
@@ -5116,7 +5309,7 @@ class na {
|
|
|
5116
5309
|
}
|
|
5117
5310
|
const a = setTimeout(() => {
|
|
5118
5311
|
this.pendingRequests.delete(t) && r(new Error(`request ${t} timed out`));
|
|
5119
|
-
},
|
|
5312
|
+
}, aa);
|
|
5120
5313
|
this.pendingRequests.set(t, {
|
|
5121
5314
|
transport: i,
|
|
5122
5315
|
resolve: (o) => {
|
|
@@ -5141,7 +5334,7 @@ class na {
|
|
|
5141
5334
|
/** Outbound datagram payload — for tests / external pumps. */
|
|
5142
5335
|
encodeAudioObject(t) {
|
|
5143
5336
|
if (this.uplinkAlias === null) throw new Error("uplink alias not negotiated");
|
|
5144
|
-
return
|
|
5337
|
+
return Ii({
|
|
5145
5338
|
trackAlias: this.uplinkAlias,
|
|
5146
5339
|
groupId: t.groupId,
|
|
5147
5340
|
objectId: t.objectId,
|
|
@@ -5154,10 +5347,10 @@ class na {
|
|
|
5154
5347
|
return this.currentMuteScope;
|
|
5155
5348
|
}
|
|
5156
5349
|
}
|
|
5157
|
-
function
|
|
5350
|
+
function da(e, t) {
|
|
5158
5351
|
return e > t ? e : t;
|
|
5159
5352
|
}
|
|
5160
|
-
function
|
|
5353
|
+
function ha(e) {
|
|
5161
5354
|
switch (e) {
|
|
5162
5355
|
case "sessionEnded":
|
|
5163
5356
|
return { kind: "sessionEnded" };
|
|
@@ -5183,17 +5376,20 @@ function ra(e) {
|
|
|
5183
5376
|
return { kind: "replayLost" };
|
|
5184
5377
|
}
|
|
5185
5378
|
}
|
|
5186
|
-
class
|
|
5379
|
+
class fa {
|
|
5187
5380
|
constructor() {
|
|
5188
|
-
this.config = null, this.http = null, this.sessionHttp = null, this.dispatcher = new
|
|
5381
|
+
this.config = null, this.http = null, this.sessionHttp = null, this.dispatcher = new Qn(), this.sessions = /* @__PURE__ */ new Map(), this.pendingUploads = /* @__PURE__ */ new Map();
|
|
5189
5382
|
}
|
|
5190
5383
|
// ── Lifecycle ────────────────────────────────────────────────────────
|
|
5191
5384
|
initialize(t) {
|
|
5192
|
-
if (!t.endpoint) throw
|
|
5193
|
-
|
|
5385
|
+
if (!t.endpoint) throw h.missingField("endpoint");
|
|
5386
|
+
const n = t.attachmentBaseUrl === void 0 ? void 0 : ba(t.endpoint, t.attachmentBaseUrl);
|
|
5387
|
+
if (n !== void 0 && !t.token)
|
|
5388
|
+
throw h.missingField("token");
|
|
5389
|
+
this.attributes = t.attributes ? { ...t.attributes } : void 0, this.assetBaseUrl = t.assetBaseUrl, this.attachmentBaseUrl = n, this.attachmentBearer = n === void 0 ? void 0 : t.token, this.userId = t.userId ?? fi(), this.http = new ri({
|
|
5194
5390
|
endpoint: t.endpoint,
|
|
5195
5391
|
...t.token ? { token: t.token } : {}
|
|
5196
|
-
}), this.sessionHttp = new
|
|
5392
|
+
}), this.sessionHttp = new ii(this.http, this.userId);
|
|
5197
5393
|
}
|
|
5198
5394
|
async authenticate() {
|
|
5199
5395
|
const n = await this.requireSessionHttp().postConfig();
|
|
@@ -5228,8 +5424,8 @@ class ia {
|
|
|
5228
5424
|
async startSession(t) {
|
|
5229
5425
|
const n = this.requireSessionHttp();
|
|
5230
5426
|
if (t.sessionId && this.sessions.has(t.sessionId))
|
|
5231
|
-
throw
|
|
5232
|
-
const s =
|
|
5427
|
+
throw h.other(`session already active: ${t.sessionId}`);
|
|
5428
|
+
const s = ma(this.attributes, t.data), r = { channel: t.channel };
|
|
5233
5429
|
t.sessionId && (r.sessionId = t.sessionId), s && (r.data = s);
|
|
5234
5430
|
const i = await n.startSession(r);
|
|
5235
5431
|
return t.channel, await this.attachSession(i, t.channel), { sessionId: i.sessionId };
|
|
@@ -5244,13 +5440,22 @@ class ia {
|
|
|
5244
5440
|
*/
|
|
5245
5441
|
async joinSession(t) {
|
|
5246
5442
|
if (this.requireSessionHttp(), this.sessions.has(t.sessionId))
|
|
5247
|
-
throw
|
|
5248
|
-
|
|
5443
|
+
throw h.other(`session already active: ${t.sessionId}`);
|
|
5444
|
+
if (t.channel === "voice" && t.chat !== void 0)
|
|
5445
|
+
throw h.other('chat join options require channel "chat"');
|
|
5446
|
+
if (t.channel === "chat" && t.voice !== void 0)
|
|
5447
|
+
throw h.other('voice join options require channel "voice"');
|
|
5448
|
+
const n = t.channel === "chat" ? pa(t.chat?.recovery) : void 0, s = {
|
|
5249
5449
|
sessionId: t.sessionId,
|
|
5250
5450
|
url: t.url,
|
|
5251
5451
|
token: t.token
|
|
5252
5452
|
};
|
|
5253
|
-
return await this.attachSession(
|
|
5453
|
+
return await this.attachSession(
|
|
5454
|
+
s,
|
|
5455
|
+
t.channel,
|
|
5456
|
+
t.voice?.receiveOnly ?? !1,
|
|
5457
|
+
n
|
|
5458
|
+
), { sessionId: t.sessionId };
|
|
5254
5459
|
}
|
|
5255
5460
|
/**
|
|
5256
5461
|
* Shared core: construct the per-channel session from a
|
|
@@ -5262,50 +5467,51 @@ class ia {
|
|
|
5262
5467
|
* after `start()`; voice fires it from inside `VoiceSession.dial()` once
|
|
5263
5468
|
* the MoQ `ConnectOk` lands — so this method must NOT fire it for voice.
|
|
5264
5469
|
*/
|
|
5265
|
-
async attachSession(t, n, s = !1) {
|
|
5470
|
+
async attachSession(t, n, s = !1, r) {
|
|
5266
5471
|
if (n === "voice") {
|
|
5267
|
-
const
|
|
5472
|
+
const a = new la(t, {
|
|
5268
5473
|
dispatcher: this.dispatcher,
|
|
5269
5474
|
// `sessionId` is the session's *current* id (post-`rename()`), not the
|
|
5270
5475
|
// one captured at construction — so a migrated session tears down its
|
|
5271
5476
|
// real map entry instead of orphaning it.
|
|
5272
|
-
onTerminal: (
|
|
5273
|
-
this.sessions.delete(
|
|
5477
|
+
onTerminal: (o, l) => {
|
|
5478
|
+
this.sessions.delete(l), this.dispatcher.fire("onDisconnected", l, "voice", { reason: o });
|
|
5274
5479
|
},
|
|
5275
5480
|
assetBaseUrl: this.assetBaseUrl
|
|
5276
5481
|
});
|
|
5277
|
-
this.sessions.set(t.sessionId, { kind: "voice", session:
|
|
5482
|
+
this.sessions.set(t.sessionId, { kind: "voice", session: a }), this.dispatcher.fire("onSessionUpdated", t.sessionId, "voice");
|
|
5278
5483
|
try {
|
|
5279
|
-
await
|
|
5280
|
-
} catch (
|
|
5281
|
-
for (const [
|
|
5282
|
-
if (
|
|
5283
|
-
this.sessions.delete(
|
|
5484
|
+
await a.start({ receiveOnly: s });
|
|
5485
|
+
} catch (o) {
|
|
5486
|
+
for (const [l, u] of this.sessions)
|
|
5487
|
+
if (u.session === a) {
|
|
5488
|
+
this.sessions.delete(l);
|
|
5284
5489
|
break;
|
|
5285
5490
|
}
|
|
5286
5491
|
try {
|
|
5287
|
-
await
|
|
5288
|
-
} catch (
|
|
5289
|
-
const
|
|
5290
|
-
throw Object.assign(
|
|
5492
|
+
await a.disconnect();
|
|
5493
|
+
} catch (l) {
|
|
5494
|
+
const u = o instanceof Error ? o : Object.assign(new Error("voice session start failed"), { startError: o });
|
|
5495
|
+
throw Object.assign(u, { cleanupError: l });
|
|
5291
5496
|
}
|
|
5292
|
-
throw
|
|
5497
|
+
throw o;
|
|
5293
5498
|
}
|
|
5294
5499
|
return;
|
|
5295
5500
|
}
|
|
5296
|
-
const
|
|
5501
|
+
const i = new si(t, {
|
|
5297
5502
|
sessionHttp: this.requireSessionHttp(),
|
|
5503
|
+
provisionedRecovery: r,
|
|
5298
5504
|
dispatcher: this.dispatcher,
|
|
5299
5505
|
// See the voice branch: teardown uses the session's current id.
|
|
5300
|
-
onTerminal: (
|
|
5301
|
-
this.sessions.delete(
|
|
5506
|
+
onTerminal: (a, o) => {
|
|
5507
|
+
this.sessions.delete(o), this.dispatcher.fire("onDisconnected", o, "chat", { reason: a });
|
|
5302
5508
|
}
|
|
5303
5509
|
});
|
|
5304
|
-
this.sessions.set(t.sessionId, { kind: "chat", session:
|
|
5510
|
+
this.sessions.set(t.sessionId, { kind: "chat", session: i }), this.dispatcher.fire("onSessionUpdated", t.sessionId, "chat"), await i.start(), this.dispatcher.fire("onConnected", t.sessionId, "chat");
|
|
5305
5511
|
}
|
|
5306
5512
|
async endSession(t) {
|
|
5307
5513
|
const n = this.sessions.get(t);
|
|
5308
|
-
if (!n) throw
|
|
5514
|
+
if (!n) throw h.noSession(t);
|
|
5309
5515
|
await n.session.disconnect();
|
|
5310
5516
|
}
|
|
5311
5517
|
async endAllSessions() {
|
|
@@ -5336,8 +5542,8 @@ class ia {
|
|
|
5336
5542
|
sendMessage(t, n) {
|
|
5337
5543
|
return this.requireChatSession(t).sendMessage(n);
|
|
5338
5544
|
}
|
|
5339
|
-
notifyTyping(t) {
|
|
5340
|
-
this.requireChatSession(t).notifyTyping();
|
|
5545
|
+
notifyTyping(t, n) {
|
|
5546
|
+
this.requireChatSession(t).notifyTyping(n);
|
|
5341
5547
|
}
|
|
5342
5548
|
stopTyping(t) {
|
|
5343
5549
|
this.requireChatSession(t).stopTyping();
|
|
@@ -5371,32 +5577,33 @@ class ia {
|
|
|
5371
5577
|
}
|
|
5372
5578
|
// ── Attachments ──────────────────────────────────────────────────────
|
|
5373
5579
|
/**
|
|
5374
|
-
* Upload an attachment.
|
|
5375
|
-
*
|
|
5376
|
-
*
|
|
5580
|
+
* Upload an attachment. It remains session-less: widget callers use the
|
|
5581
|
+
* tokenless endpoint lane, while an explicit same-origin attachmentBaseUrl
|
|
5582
|
+
* selects the authenticated agent lane and uses the top-level token.
|
|
5377
5583
|
* Needs `authenticate()` only for the local policy precheck (absent config
|
|
5378
5584
|
* defers the whole decision to the server).
|
|
5379
5585
|
*/
|
|
5380
5586
|
async uploadAttachment(t, n) {
|
|
5381
|
-
const s = this.requireHttp(), r = this.config?.attachmentPolicy, i =
|
|
5587
|
+
const s = this.requireHttp(), r = this.config?.attachmentPolicy, i = di(t, r);
|
|
5382
5588
|
if (!i.ok) throw i.error;
|
|
5383
5589
|
const a = new AbortController();
|
|
5384
5590
|
this.pendingUploads.set(n.uploadId, a);
|
|
5385
5591
|
try {
|
|
5386
|
-
const o =
|
|
5387
|
-
return await
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5592
|
+
const o = Ea(a.signal, n.signal), l = this.attachmentBaseUrl ?? s.buildAbsoluteUrl("/attachment");
|
|
5593
|
+
return await oi(
|
|
5594
|
+
`${l}/upload`,
|
|
5595
|
+
t,
|
|
5596
|
+
{ ...n, signal: o },
|
|
5597
|
+
this.attachmentBearer
|
|
5598
|
+
);
|
|
5391
5599
|
} finally {
|
|
5392
5600
|
this.pendingUploads.delete(n.uploadId);
|
|
5393
5601
|
}
|
|
5394
5602
|
}
|
|
5395
5603
|
/**
|
|
5396
5604
|
* Dual purpose: cancel an in-flight upload (when `idOrUploadId` matches a
|
|
5397
|
-
* pending `uploadId`) OR DELETE a stored attachment by id.
|
|
5398
|
-
*
|
|
5399
|
-
* before sending anything.
|
|
5605
|
+
* pending `uploadId`) OR DELETE a stored attachment by id. The route/auth
|
|
5606
|
+
* lane matches upload: explicit base is authenticated; widget is tokenless.
|
|
5400
5607
|
*/
|
|
5401
5608
|
async deleteAttachment(t) {
|
|
5402
5609
|
const n = this.pendingUploads.get(t);
|
|
@@ -5404,62 +5611,119 @@ class ia {
|
|
|
5404
5611
|
n.abort(), this.pendingUploads.delete(t);
|
|
5405
5612
|
return;
|
|
5406
5613
|
}
|
|
5407
|
-
const s = this.requireHttp();
|
|
5614
|
+
const s = this.requireHttp(), r = this.attachmentBaseUrl ?? s.buildAbsoluteUrl("/attachment");
|
|
5408
5615
|
await s.deleteAbsolute(
|
|
5409
|
-
|
|
5410
|
-
//
|
|
5411
|
-
//
|
|
5412
|
-
{ bearer: "" }
|
|
5616
|
+
`${r}/${encodeURIComponent(t)}`,
|
|
5617
|
+
// Explicit base opts into the existing top-level bearer. The widget
|
|
5618
|
+
// lane always suppresses it, even when initialize received a token.
|
|
5619
|
+
{ bearer: this.attachmentBaseUrl === void 0 ? "" : this.attachmentBearer ?? "" }
|
|
5413
5620
|
);
|
|
5414
5621
|
}
|
|
5415
5622
|
// ── Internal ─────────────────────────────────────────────────────────
|
|
5416
5623
|
requireChatSession(t) {
|
|
5417
5624
|
const n = this.sessions.get(t);
|
|
5418
|
-
if (!n) throw
|
|
5625
|
+
if (!n) throw h.noSession(t);
|
|
5419
5626
|
if (n.kind !== "chat")
|
|
5420
|
-
throw
|
|
5627
|
+
throw h.other(`session ${t} is a voice session, not chat`);
|
|
5421
5628
|
return n.session;
|
|
5422
5629
|
}
|
|
5423
5630
|
requireVoiceSession(t) {
|
|
5424
5631
|
const n = this.sessions.get(t);
|
|
5425
|
-
if (!n) throw
|
|
5632
|
+
if (!n) throw h.noSession(t);
|
|
5426
5633
|
if (n.kind !== "voice")
|
|
5427
|
-
throw
|
|
5634
|
+
throw h.other(`session ${t} is a chat session, not voice`);
|
|
5428
5635
|
return n.session;
|
|
5429
5636
|
}
|
|
5430
5637
|
requireSessionHttp() {
|
|
5431
|
-
if (!this.sessionHttp) throw
|
|
5638
|
+
if (!this.sessionHttp) throw h.notInitialized();
|
|
5432
5639
|
return this.sessionHttp;
|
|
5433
5640
|
}
|
|
5434
5641
|
requireHttp() {
|
|
5435
|
-
if (!this.http) throw
|
|
5642
|
+
if (!this.http) throw h.notInitialized();
|
|
5436
5643
|
return this.http;
|
|
5437
5644
|
}
|
|
5438
5645
|
}
|
|
5439
|
-
let
|
|
5440
|
-
function
|
|
5441
|
-
return
|
|
5646
|
+
let Oe = null;
|
|
5647
|
+
function ya() {
|
|
5648
|
+
return Oe || (Oe = new fa()), Oe;
|
|
5442
5649
|
}
|
|
5443
|
-
function
|
|
5650
|
+
function ma(e, t) {
|
|
5444
5651
|
if (!(!e && !t))
|
|
5445
5652
|
return e ? t ? { ...t, attributes: { ...e, ...t.attributes } } : { attributes: e } : t;
|
|
5446
5653
|
}
|
|
5447
|
-
function
|
|
5654
|
+
function pa(e) {
|
|
5655
|
+
if (e !== void 0) {
|
|
5656
|
+
if (e.replay !== "server")
|
|
5657
|
+
throw h.other('provisioned chat recovery requires replay "server"');
|
|
5658
|
+
if (e.delaysMs.length < 1 || e.delaysMs.length > 8 || e.delaysMs.some((t) => !Number.isFinite(t) || t < 0))
|
|
5659
|
+
throw h.other(
|
|
5660
|
+
"provisioned chat recovery delaysMs must contain 1–8 finite, non-negative values"
|
|
5661
|
+
);
|
|
5662
|
+
return { ...e, delaysMs: [...e.delaysMs] };
|
|
5663
|
+
}
|
|
5664
|
+
}
|
|
5665
|
+
function ba(e, t) {
|
|
5666
|
+
let n, s;
|
|
5667
|
+
try {
|
|
5668
|
+
n = new URL(e), s = new URL(t, n);
|
|
5669
|
+
} catch {
|
|
5670
|
+
throw h.other("invalid attachmentBaseUrl");
|
|
5671
|
+
}
|
|
5672
|
+
if (t.trim() === "" || t.trim() !== t || !t.startsWith("/") && !/^https?:\/\//.test(t) || ga(t) || s.protocol !== "https:" && s.protocol !== "http:" || s.origin !== n.origin || s.username !== "" || s.password !== "" || s.search !== "" || s.hash !== "" || s.pathname === "/")
|
|
5673
|
+
throw h.other("attachmentBaseUrl must be an HTTP(S) path on the endpoint origin");
|
|
5674
|
+
return s.toString().replace(/\/$/, "");
|
|
5675
|
+
}
|
|
5676
|
+
function ga(e) {
|
|
5677
|
+
let t = e;
|
|
5678
|
+
for (let r = e.length + 1; r > 0; r -= 1) {
|
|
5679
|
+
if (t.includes("\\")) return !0;
|
|
5680
|
+
let i;
|
|
5681
|
+
try {
|
|
5682
|
+
i = decodeURIComponent(t);
|
|
5683
|
+
} catch {
|
|
5684
|
+
return !0;
|
|
5685
|
+
}
|
|
5686
|
+
if (i === t) break;
|
|
5687
|
+
t = i;
|
|
5688
|
+
}
|
|
5689
|
+
let n;
|
|
5690
|
+
if (e.startsWith("/"))
|
|
5691
|
+
n = e.split(/[?#]/, 1)[0];
|
|
5692
|
+
else {
|
|
5693
|
+
const r = e.indexOf("://") + 3, i = e.indexOf("/", r);
|
|
5694
|
+
n = i === -1 ? "/" : e.slice(i).split(/[?#]/, 1)[0];
|
|
5695
|
+
}
|
|
5696
|
+
let s = n;
|
|
5697
|
+
for (let r = e.length + 1; r > 0; r -= 1) {
|
|
5698
|
+
if (s.includes("\\") || s.split("/").some((a) => a === "." || a === ".."))
|
|
5699
|
+
return !0;
|
|
5700
|
+
let i;
|
|
5701
|
+
try {
|
|
5702
|
+
i = decodeURIComponent(s);
|
|
5703
|
+
} catch {
|
|
5704
|
+
return !0;
|
|
5705
|
+
}
|
|
5706
|
+
if (i === s) return !1;
|
|
5707
|
+
s = i;
|
|
5708
|
+
}
|
|
5709
|
+
return !0;
|
|
5710
|
+
}
|
|
5711
|
+
function Ea(e, t) {
|
|
5448
5712
|
if (!t) return e;
|
|
5449
5713
|
const n = new AbortController(), s = () => n.abort();
|
|
5450
5714
|
return e.aborted || t.aborted ? (n.abort(), n.signal) : (e.addEventListener("abort", s, { once: !0 }), t.addEventListener("abort", s, { once: !0 }), n.signal);
|
|
5451
5715
|
}
|
|
5452
|
-
const
|
|
5716
|
+
const wa = {
|
|
5453
5717
|
AI: "ai",
|
|
5454
5718
|
EXTERNAL: "external",
|
|
5455
5719
|
USER: "user",
|
|
5456
5720
|
SYSTEM: "system"
|
|
5457
5721
|
};
|
|
5458
5722
|
export {
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5723
|
+
h as ClientError,
|
|
5724
|
+
wa as MESSAGE_ROLES,
|
|
5725
|
+
T as OrpcError,
|
|
5726
|
+
fa as SessionManager,
|
|
5727
|
+
ya as getSessionManager
|
|
5464
5728
|
};
|
|
5465
5729
|
//# sourceMappingURL=origon-web-sdk.js.map
|