@viamrobotics/sdk 0.5.0 → 0.6.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.es.js +379 -364
- package/dist/main.umd.js +8 -7
- package/dist/robot/client.d.ts +6 -1
- package/dist/robot/dial.d.ts +1 -0
- package/package.json +4 -3
package/dist/main.es.js
CHANGED
|
@@ -13835,7 +13835,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
|
|
|
13835
13835
|
for (; ; ) {
|
|
13836
13836
|
if (!u(this.buffer, this.position, 5))
|
|
13837
13837
|
return b;
|
|
13838
|
-
var
|
|
13838
|
+
var D = c(this.buffer, this.position, this.position + 5), z = new DataView(D.buffer, D.byteOffset, D.byteLength), j = r(z);
|
|
13839
13839
|
if (!u(this.buffer, this.position, 5 + j))
|
|
13840
13840
|
return b;
|
|
13841
13841
|
var L = c(this.buffer, this.position + 5, this.position + 5 + j);
|
|
@@ -20367,11 +20367,11 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
|
|
|
20367
20367
|
var f, y, b = c(v.getMetadata()), h = v.getStatus();
|
|
20368
20368
|
h ? (f = h.getCode(), y = h.getMessage(), b.set("grpc-status", "".concat(h.getCode())), y !== void 0 && b.set("grpc-message", h.getMessage())) : (f = 0, b.set("grpc-status", "0"), y = "");
|
|
20369
20369
|
var R = function(T) {
|
|
20370
|
-
var
|
|
20370
|
+
var D = "";
|
|
20371
20371
|
return T.forEach(function(z, j) {
|
|
20372
|
-
|
|
20372
|
+
D += "".concat(z, ": ").concat(j.join(", "), `\r
|
|
20373
20373
|
`);
|
|
20374
|
-
}), r(
|
|
20374
|
+
}), r(D);
|
|
20375
20375
|
}(b), w = new ArrayBuffer(R.length + 5);
|
|
20376
20376
|
new DataView(w, 0, 1).setUint8(0, 128), new DataView(w, 1, 4).setUint32(0, R.length, !1), new Uint8Array(w, 5).set(R), this.opts.onChunk(new Uint8Array(w)), f !== 0 ? this.closeWithRecvError(new p.GRPCError(f, y)) : this.closeWithRecvError();
|
|
20377
20377
|
} }), m;
|
|
@@ -20406,51 +20406,51 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
|
|
|
20406
20406
|
var s = n(655), l = n(37), g = n(138), p = n(758), t = n(743), o = n(34), r = n(165), u = n(400), c = n(982), d = n(958), m = n(93);
|
|
20407
20407
|
function v(R, w) {
|
|
20408
20408
|
return s.__awaiter(this, void 0, void 0, function() {
|
|
20409
|
-
var T,
|
|
20409
|
+
var T, D;
|
|
20410
20410
|
return s.__generator(this, function(z) {
|
|
20411
20411
|
return h(w), T = function(j) {
|
|
20412
20412
|
return l.grpc.CrossBrowserHttpTransport({ withCredentials: !1 })(j);
|
|
20413
|
-
}, !w?.accessToken || w?.externalAuthAddress && w?.externalAuthToEntity ? w && (w?.credentials || w?.accessToken) ? [2, f(R, T, w)] : [2, T] : ((
|
|
20414
|
-
return new y(j, T,
|
|
20413
|
+
}, !w?.accessToken || w?.externalAuthAddress && w?.externalAuthToEntity ? w && (w?.credentials || w?.accessToken) ? [2, f(R, T, w)] : [2, T] : ((D = new l.grpc.Metadata()).set("authorization", "Bearer ".concat(w.accessToken)), [2, function(j) {
|
|
20414
|
+
return new y(j, T, D);
|
|
20415
20415
|
}]);
|
|
20416
20416
|
});
|
|
20417
20417
|
});
|
|
20418
20418
|
}
|
|
20419
20419
|
function f(R, w, T) {
|
|
20420
20420
|
return s.__awaiter(this, void 0, void 0, function() {
|
|
20421
|
-
var
|
|
20421
|
+
var D, z, j, L = this;
|
|
20422
20422
|
return s.__generator(this, function(x) {
|
|
20423
20423
|
switch (x.label) {
|
|
20424
20424
|
case 0:
|
|
20425
|
-
return
|
|
20425
|
+
return D = "", z = function() {
|
|
20426
20426
|
return s.__awaiter(L, void 0, void 0, function() {
|
|
20427
|
-
var I, U, k, M,
|
|
20427
|
+
var I, U, k, S, M, E, B, F, C, O;
|
|
20428
20428
|
return s.__generator(this, function(P) {
|
|
20429
20429
|
switch (P.label) {
|
|
20430
20430
|
case 0:
|
|
20431
|
-
return
|
|
20432
|
-
U =
|
|
20433
|
-
}), l.grpc.invoke(u.AuthService.Authenticate, { request:
|
|
20434
|
-
I =
|
|
20435
|
-
}, onEnd: function(
|
|
20436
|
-
|
|
20437
|
-
} }), [4,
|
|
20431
|
+
return D != "" ? [3, 5] : (I = "", T.accessToken && T.accessToken !== "" ? [3, 2] : ((B = new r.AuthenticateRequest()).setEntity(T.authEntity ? T.authEntity : R.replace(/^(.*:\/\/)/, "")), (S = new r.Credentials()).setType((C = T.credentials) === null || C === void 0 ? void 0 : C.type), S.setPayload((O = T.credentials) === null || O === void 0 ? void 0 : O.payload), B.setCredentials(S), E = new Promise(function(A, W) {
|
|
20432
|
+
U = A, k = W;
|
|
20433
|
+
}), l.grpc.invoke(u.AuthService.Authenticate, { request: B, host: T.externalAuthAddress ? T.externalAuthAddress : R, transport: w, onMessage: function(A) {
|
|
20434
|
+
I = A.getAccessToken();
|
|
20435
|
+
}, onEnd: function(A, W, _) {
|
|
20436
|
+
A == l.grpc.Code.OK ? U(F) : k(W);
|
|
20437
|
+
} }), [4, E]));
|
|
20438
20438
|
case 1:
|
|
20439
20439
|
return P.sent(), [3, 3];
|
|
20440
20440
|
case 2:
|
|
20441
20441
|
I = T.accessToken, P.label = 3;
|
|
20442
20442
|
case 3:
|
|
20443
|
-
return
|
|
20444
|
-
U =
|
|
20445
|
-
}), I = "", (
|
|
20446
|
-
I =
|
|
20447
|
-
}, onEnd: function(
|
|
20448
|
-
|
|
20449
|
-
} }), [4,
|
|
20443
|
+
return D = I, T.externalAuthAddress && T.externalAuthToEntity ? ((M = new l.grpc.Metadata()).set("authorization", "Bearer ".concat(D)), E = new Promise(function(A, W) {
|
|
20444
|
+
U = A, k = W;
|
|
20445
|
+
}), I = "", (B = new r.AuthenticateToRequest()).setEntity(T.externalAuthToEntity), l.grpc.invoke(u.ExternalAuthService.AuthenticateTo, { request: B, host: T.externalAuthAddress, transport: w, metadata: M, onMessage: function(A) {
|
|
20446
|
+
I = A.getAccessToken();
|
|
20447
|
+
}, onEnd: function(A, W, _) {
|
|
20448
|
+
A == l.grpc.Code.OK ? U(M) : k(W);
|
|
20449
|
+
} }), [4, E]) : [3, 5];
|
|
20450
20450
|
case 4:
|
|
20451
|
-
P.sent(),
|
|
20451
|
+
P.sent(), D = I, P.label = 5;
|
|
20452
20452
|
case 5:
|
|
20453
|
-
return (
|
|
20453
|
+
return (F = new l.grpc.Metadata()).set("authorization", "Bearer ".concat(D)), [2, F];
|
|
20454
20454
|
}
|
|
20455
20455
|
});
|
|
20456
20456
|
});
|
|
@@ -20465,12 +20465,12 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
|
|
|
20465
20465
|
}
|
|
20466
20466
|
e.dialDirect = v;
|
|
20467
20467
|
var y = function() {
|
|
20468
|
-
function R(w, T,
|
|
20469
|
-
Object.defineProperty(this, "opts", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), Object.defineProperty(this, "transport", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), Object.defineProperty(this, "extraMetadata", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), this.opts = w, this.extraMetadata =
|
|
20468
|
+
function R(w, T, D) {
|
|
20469
|
+
Object.defineProperty(this, "opts", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), Object.defineProperty(this, "transport", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), Object.defineProperty(this, "extraMetadata", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), this.opts = w, this.extraMetadata = D, this.transport = T(w);
|
|
20470
20470
|
}
|
|
20471
20471
|
return Object.defineProperty(R.prototype, "start", { enumerable: !1, configurable: !0, writable: !0, value: function(w) {
|
|
20472
|
-
this.extraMetadata.forEach(function(T,
|
|
20473
|
-
w.set(T,
|
|
20472
|
+
this.extraMetadata.forEach(function(T, D) {
|
|
20473
|
+
w.set(T, D);
|
|
20474
20474
|
}), this.transport.start(w);
|
|
20475
20475
|
} }), Object.defineProperty(R.prototype, "sendMessage", { enumerable: !1, configurable: !0, writable: !0, value: function(w) {
|
|
20476
20476
|
this.transport.sendMessage(w);
|
|
@@ -20482,22 +20482,22 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
|
|
|
20482
20482
|
}();
|
|
20483
20483
|
function b(R, w, T) {
|
|
20484
20484
|
return s.__awaiter(this, void 0, void 0, function() {
|
|
20485
|
-
var
|
|
20485
|
+
var D, z, j, L, x, I;
|
|
20486
20486
|
return s.__generator(this, function(U) {
|
|
20487
20487
|
switch (U.label) {
|
|
20488
20488
|
case 0:
|
|
20489
|
-
return
|
|
20489
|
+
return D = s.__assign({}, T), [4, v(R, D)];
|
|
20490
20490
|
case 1:
|
|
20491
|
-
return z = U.sent(), I = new Promise(function(k,
|
|
20492
|
-
j = k, L =
|
|
20491
|
+
return z = U.sent(), I = new Promise(function(k, S) {
|
|
20492
|
+
j = k, L = S;
|
|
20493
20493
|
}), l.grpc.unary(d.SignalingService.OptionalWebRTCConfig, { request: new c.OptionalWebRTCConfigRequest(), metadata: { "rpc-host": w }, host: R, transport: z, onEnd: function(k) {
|
|
20494
|
-
var
|
|
20495
|
-
if (
|
|
20496
|
-
if (!(x =
|
|
20494
|
+
var S = k.status, M = k.statusMessage, E = k.message;
|
|
20495
|
+
if (S === l.grpc.Code.OK && E) {
|
|
20496
|
+
if (!(x = E.getConfig()))
|
|
20497
20497
|
return void j(new c.WebRTCConfig());
|
|
20498
20498
|
j(x);
|
|
20499
20499
|
} else
|
|
20500
|
-
L(
|
|
20500
|
+
L(M);
|
|
20501
20501
|
} }), [4, I];
|
|
20502
20502
|
case 2:
|
|
20503
20503
|
if (U.sent(), !x)
|
|
@@ -20533,114 +20533,114 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
|
|
|
20533
20533
|
}
|
|
20534
20534
|
}
|
|
20535
20535
|
e.dialWebRTC = function(R, w, T) {
|
|
20536
|
-
var
|
|
20536
|
+
var D, z, j, L, x, I, U, k;
|
|
20537
20537
|
return s.__awaiter(this, void 0, void 0, function() {
|
|
20538
|
-
var
|
|
20538
|
+
var S, M, E, B, F, C, O, P, A, W, _, G, H, Y, oe, le, re, ge, ae, ie, pe, ne, ce, se, de, ve, ue, me = this;
|
|
20539
20539
|
return s.__generator(this, function(J) {
|
|
20540
20540
|
switch (J.label) {
|
|
20541
20541
|
case 0:
|
|
20542
20542
|
return R = R.replace(/(\/)$/, ""), h(T), [4, b(R, w, T)];
|
|
20543
20543
|
case 1:
|
|
20544
|
-
return
|
|
20544
|
+
return S = J.sent(), M = S.toObject().additionalIceServersList.map(function(q) {
|
|
20545
20545
|
return { urls: q.urlsList, credential: q.credential, username: q.username };
|
|
20546
|
-
}), T || (T = {}), T.webrtcOptions ? (
|
|
20546
|
+
}), T || (T = {}), T.webrtcOptions ? (E = T.webrtcOptions).rtcConfig ? E.rtcConfig.iceServers = s.__spreadArray(s.__spreadArray([], E.rtcConfig.iceServers || [], !0), M, !0) : E.rtcConfig = { iceServers: M } : E = { disableTrickleICE: S.getDisableTrickle(), rtcConfig: { iceServers: M } }, [4, (0, m.newPeerConnectionForClient)(E !== void 0 && E.disableTrickleICE, E?.rtcConfig, E?.additionalSdpFields)];
|
|
20547
20547
|
case 2:
|
|
20548
|
-
B = J.sent(), F = B.pc,
|
|
20548
|
+
B = J.sent(), F = B.pc, C = B.dc, O = !1, J.label = 3;
|
|
20549
20549
|
case 3:
|
|
20550
|
-
return J.trys.push([3, , 10, 11]),
|
|
20550
|
+
return J.trys.push([3, , 10, 11]), P = T, T && (P = s.__assign({}, T), T.accessToken || (P.authEntity = (D = T?.webrtcOptions) === null || D === void 0 ? void 0 : D.signalingAuthEntity, P.authEntity || (P.externalAuthAddress ? P.authEntity = (z = T.externalAuthAddress) === null || z === void 0 ? void 0 : z.replace(/^(.*:\/\/)/, "") : P.authEntity = R.replace(/^(.*:\/\/)/, "")), P.credentials = (j = T?.webrtcOptions) === null || j === void 0 ? void 0 : j.signalingCredentials, P.accessToken = (L = T?.webrtcOptions) === null || L === void 0 ? void 0 : L.signalingAccessToken), P.externalAuthAddress = (x = T?.webrtcOptions) === null || x === void 0 ? void 0 : x.signalingExternalAuthAddress, P.externalAuthToEntity = (I = T?.webrtcOptions) === null || I === void 0 ? void 0 : I.signalingExternalAuthToEntity), [4, v(R, P)];
|
|
20551
20551
|
case 4:
|
|
20552
|
-
return
|
|
20553
|
-
if (!
|
|
20554
|
-
|
|
20552
|
+
return A = J.sent(), W = l.grpc.client(d.SignalingService.Call, { host: R, transport: A }), _ = "", G = !1, H = function(q) {
|
|
20553
|
+
if (!G) {
|
|
20554
|
+
G = !0;
|
|
20555
20555
|
var N = new c.CallUpdateRequest();
|
|
20556
|
-
N.setUuid(
|
|
20556
|
+
N.setUuid(_);
|
|
20557
20557
|
var $ = new o.Status();
|
|
20558
|
-
$.setCode(t.Code.UNKNOWN), $.setMessage(q), N.setError($), l.grpc.unary(d.SignalingService.CallUpdate, { request: N, metadata: { "rpc-host": w }, host: R, transport:
|
|
20559
|
-
var
|
|
20560
|
-
|
|
20558
|
+
$.setCode(t.Code.UNKNOWN), $.setMessage(q), N.setError($), l.grpc.unary(d.SignalingService.CallUpdate, { request: N, metadata: { "rpc-host": w }, host: R, transport: A, onEnd: function(K) {
|
|
20559
|
+
var V = K.status, X = K.statusMessage, Q = K.message;
|
|
20560
|
+
V === l.grpc.Code.OK && Q || console.error(X);
|
|
20561
20561
|
} });
|
|
20562
20562
|
}
|
|
20563
|
-
},
|
|
20564
|
-
if (!
|
|
20565
|
-
|
|
20563
|
+
}, Y = function() {
|
|
20564
|
+
if (!G) {
|
|
20565
|
+
G = !0;
|
|
20566
20566
|
var q = new c.CallUpdateRequest();
|
|
20567
|
-
q.setUuid(
|
|
20568
|
-
var $ = N.status, K = N.statusMessage,
|
|
20569
|
-
$ === l.grpc.Code.OK &&
|
|
20567
|
+
q.setUuid(_), q.setDone(!0), l.grpc.unary(d.SignalingService.CallUpdate, { request: q, metadata: { "rpc-host": w }, host: R, transport: A, onEnd: function(N) {
|
|
20568
|
+
var $ = N.status, K = N.statusMessage, V = N.message;
|
|
20569
|
+
$ === l.grpc.Code.OK && V || console.error(K);
|
|
20570
20570
|
} });
|
|
20571
20571
|
}
|
|
20572
|
-
},
|
|
20573
|
-
|
|
20574
|
-
}), re = !1,
|
|
20572
|
+
}, le = new Promise(function(q) {
|
|
20573
|
+
oe = q;
|
|
20574
|
+
}), re = !1, E?.disableTrickleICE ? [3, 7] : [4, F.createOffer()];
|
|
20575
20575
|
case 5:
|
|
20576
|
-
return
|
|
20577
|
-
return s.__awaiter(
|
|
20576
|
+
return ge = J.sent(), ae = !1, F.onicecandidate = function(q) {
|
|
20577
|
+
return s.__awaiter(me, void 0, void 0, function() {
|
|
20578
20578
|
var N, $;
|
|
20579
20579
|
return s.__generator(this, function(K) {
|
|
20580
20580
|
switch (K.label) {
|
|
20581
20581
|
case 0:
|
|
20582
|
-
return [4,
|
|
20582
|
+
return [4, le];
|
|
20583
20583
|
case 1:
|
|
20584
|
-
return K.sent(), re ? [2] : q.candidate === null ? (ae = !0,
|
|
20585
|
-
var ee = Q.status,
|
|
20586
|
-
ee === l.grpc.Code.OK && te || re || ae || console.error("error sending candidate",
|
|
20584
|
+
return K.sent(), re ? [2] : q.candidate === null ? (ae = !0, Y(), [2]) : (V = q.candidate, (X = new c.ICECandidate()).setCandidate(V.candidate), V.sdpMid && X.setSdpMid(V.sdpMid), V.sdpMLineIndex && X.setSdpmLineIndex(V.sdpMLineIndex), V.usernameFragment && X.setUsernameFragment(V.usernameFragment), N = X, ($ = new c.CallUpdateRequest()).setUuid(_), $.setCandidate(N), l.grpc.unary(d.SignalingService.CallUpdate, { request: $, metadata: { "rpc-host": w }, host: R, transport: A, onEnd: function(Q) {
|
|
20585
|
+
var ee = Q.status, Z = Q.statusMessage, te = Q.message;
|
|
20586
|
+
ee === l.grpc.Code.OK && te || re || ae || console.error("error sending candidate", Z);
|
|
20587
20587
|
} }), [2]);
|
|
20588
20588
|
}
|
|
20589
|
-
var
|
|
20589
|
+
var V, X;
|
|
20590
20590
|
});
|
|
20591
20591
|
});
|
|
20592
|
-
}, [4, F.setLocalDescription(
|
|
20592
|
+
}, [4, F.setLocalDescription(ge)];
|
|
20593
20593
|
case 6:
|
|
20594
20594
|
J.sent(), J.label = 7;
|
|
20595
20595
|
case 7:
|
|
20596
20596
|
return ie = !1, W.onMessage(function(q) {
|
|
20597
|
-
return s.__awaiter(
|
|
20598
|
-
var N, $, K,
|
|
20597
|
+
return s.__awaiter(me, void 0, void 0, function() {
|
|
20598
|
+
var N, $, K, V, X, Q;
|
|
20599
20599
|
return s.__generator(this, function(ee) {
|
|
20600
20600
|
switch (ee.label) {
|
|
20601
20601
|
case 0:
|
|
20602
|
-
return (N = q).hasInit() ? ie ? (
|
|
20602
|
+
return (N = q).hasInit() ? ie ? (H("got init stage more than once"), [2]) : ($ = N.getInit(), ie = !0, _ = N.getUuid(), K = new RTCSessionDescription(JSON.parse(atob($.getSdp()))), [4, F.setRemoteDescription(K)]) : [3, 2];
|
|
20603
20603
|
case 1:
|
|
20604
|
-
return ee.sent(),
|
|
20604
|
+
return ee.sent(), oe(!0), E?.disableTrickleICE ? (re = !0, Y(), [2]) : [3, 8];
|
|
20605
20605
|
case 2:
|
|
20606
20606
|
if (!N.hasUpdate())
|
|
20607
20607
|
return [3, 7];
|
|
20608
20608
|
if (!ie)
|
|
20609
|
-
return
|
|
20610
|
-
if (N.getUuid() !==
|
|
20611
|
-
return
|
|
20612
|
-
|
|
20609
|
+
return H("got update stage before init stage"), [2];
|
|
20610
|
+
if (N.getUuid() !== _)
|
|
20611
|
+
return H("uuid mismatch; have=".concat(N.getUuid(), " want=").concat(_)), [2];
|
|
20612
|
+
V = N.getUpdate(), Z = V.getCandidate(), te = { candidate: Z.getCandidate() }, Z.hasSdpMid() && (te.sdpMid = Z.getSdpMid()), Z.hasSdpmLineIndex() && (te.sdpMLineIndex = Z.getSdpmLineIndex()), Z.hasUsernameFragment() && (te.usernameFragment = Z.getUsernameFragment()), X = te, ee.label = 3;
|
|
20613
20613
|
case 3:
|
|
20614
|
-
return ee.trys.push([3, 5, , 6]), [4, F.addIceCandidate(
|
|
20614
|
+
return ee.trys.push([3, 5, , 6]), [4, F.addIceCandidate(X)];
|
|
20615
20615
|
case 4:
|
|
20616
20616
|
return ee.sent(), [3, 6];
|
|
20617
20617
|
case 5:
|
|
20618
|
-
return Q = ee.sent(),
|
|
20618
|
+
return Q = ee.sent(), H(JSON.stringify(Q)), [2];
|
|
20619
20619
|
case 6:
|
|
20620
20620
|
return [3, 8];
|
|
20621
20621
|
case 7:
|
|
20622
|
-
return
|
|
20622
|
+
return H("unknown CallResponse stage"), [2];
|
|
20623
20623
|
case 8:
|
|
20624
20624
|
return [2];
|
|
20625
20625
|
}
|
|
20626
|
-
var
|
|
20626
|
+
var Z, te;
|
|
20627
20627
|
});
|
|
20628
20628
|
});
|
|
20629
|
-
}),
|
|
20629
|
+
}), ce = new Promise(function(q, N) {
|
|
20630
20630
|
pe = q, ne = N;
|
|
20631
20631
|
}), W.onEnd(function(q, N, $) {
|
|
20632
20632
|
q !== l.grpc.Code.OK ? N !== "Response closed without headers" ? (console.error(N), ne(N)) : ne(new p.ConnectionClosedError("failed to dial")) : pe();
|
|
20633
|
-
}), W.start({ "rpc-host": w }), se = new c.CallRequest(),
|
|
20633
|
+
}), W.start({ "rpc-host": w }), se = new c.CallRequest(), de = (0, m.addSdpFields)(F.localDescription, (U = T.webrtcOptions) === null || U === void 0 ? void 0 : U.additionalSdpFields), ve = btoa(JSON.stringify(de)), se.setSdp(ve), E && E.disableTrickleICE && se.setDisableTrickle(E.disableTrickleICE), W.send(se), (ue = new g.ClientChannel(F, C)).ready.then(function() {
|
|
20634
20634
|
return pe();
|
|
20635
20635
|
}).catch(function(q) {
|
|
20636
20636
|
return ne(q);
|
|
20637
|
-
}), [4,
|
|
20637
|
+
}), [4, ce];
|
|
20638
20638
|
case 8:
|
|
20639
20639
|
return J.sent(), [4, ue.ready];
|
|
20640
20640
|
case 9:
|
|
20641
|
-
return J.sent(), re = !0,
|
|
20641
|
+
return J.sent(), re = !0, Y(), T?.externalAuthAddress || (k = T?.credentials) === null || k === void 0 || k.type, O = !0, [2, { transportFactory: ue.transportFactory(), peerConnection: F }];
|
|
20642
20642
|
case 10:
|
|
20643
|
-
return
|
|
20643
|
+
return O || F.close(), [7];
|
|
20644
20644
|
case 11:
|
|
20645
20645
|
return [2];
|
|
20646
20646
|
}
|
|
@@ -20668,393 +20668,400 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
|
|
|
20668
20668
|
}(Error);
|
|
20669
20669
|
e.GRPCError = g;
|
|
20670
20670
|
}, 93: (i, e, n) => {
|
|
20671
|
-
Object.defineProperty(e, "__esModule", { value: !0 }), e.newPeerConnectionForClient = void 0;
|
|
20671
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.newPeerConnectionForClient = e.addSdpFields = void 0;
|
|
20672
20672
|
var s = n(655);
|
|
20673
|
-
|
|
20673
|
+
function l(g, p) {
|
|
20674
|
+
var t = { sdp: g?.sdp, type: g?.type };
|
|
20675
|
+
return p && Object.keys(p).forEach(function(o) {
|
|
20676
|
+
t.sdp = [t.sdp, "a=".concat(o, ":").concat(p[o], `\r
|
|
20677
|
+
`)].join("");
|
|
20678
|
+
}), t;
|
|
20679
|
+
}
|
|
20680
|
+
e.addSdpFields = l, e.newPeerConnectionForClient = function(g, p, t) {
|
|
20674
20681
|
return s.__awaiter(this, void 0, void 0, function() {
|
|
20675
|
-
var
|
|
20676
|
-
return s.__generator(this, function(
|
|
20677
|
-
switch (
|
|
20682
|
+
var o, r, u, c, d, m, v, f, y = this;
|
|
20683
|
+
return s.__generator(this, function(b) {
|
|
20684
|
+
switch (b.label) {
|
|
20678
20685
|
case 0:
|
|
20679
|
-
return
|
|
20680
|
-
|
|
20681
|
-
}), (
|
|
20682
|
-
|
|
20683
|
-
},
|
|
20684
|
-
return s.__awaiter(
|
|
20685
|
-
var
|
|
20686
|
-
return s.__generator(this, function(
|
|
20687
|
-
switch (
|
|
20686
|
+
return p || (p = { iceServers: [{ urls: "stun:global.stun.twilio.com:3478" }] }), o = new RTCPeerConnection(p), u = new Promise(function(h) {
|
|
20687
|
+
r = h;
|
|
20688
|
+
}), (c = o.createDataChannel("data", { id: 0, negotiated: !0, ordered: !0 })).binaryType = "arraybuffer", (d = o.createDataChannel("negotiation", { id: 1, negotiated: !0, ordered: !0 })).binaryType = "arraybuffer", m = !1, d.onopen = function() {
|
|
20689
|
+
m = !0;
|
|
20690
|
+
}, d.onmessage = function(h) {
|
|
20691
|
+
return s.__awaiter(y, void 0, void 0, function() {
|
|
20692
|
+
var R, w, T;
|
|
20693
|
+
return s.__generator(this, function(D) {
|
|
20694
|
+
switch (D.label) {
|
|
20688
20695
|
case 0:
|
|
20689
|
-
return
|
|
20696
|
+
return D.trys.push([0, 4, , 5]), (R = new RTCSessionDescription(JSON.parse(atob(h.data)))).type === "offer" && (R || o.signalingState), [4, o.setRemoteDescription(R)];
|
|
20690
20697
|
case 1:
|
|
20691
|
-
return
|
|
20698
|
+
return D.sent(), R.type !== "offer" ? [3, 3] : [4, o.setLocalDescription()];
|
|
20692
20699
|
case 2:
|
|
20693
|
-
|
|
20700
|
+
D.sent(), w = l(o.localDescription, t), d.send(btoa(JSON.stringify(w))), D.label = 3;
|
|
20694
20701
|
case 3:
|
|
20695
20702
|
return [3, 5];
|
|
20696
20703
|
case 4:
|
|
20697
|
-
return
|
|
20704
|
+
return T = D.sent(), console.error(T), [3, 5];
|
|
20698
20705
|
case 5:
|
|
20699
20706
|
return [2];
|
|
20700
20707
|
}
|
|
20701
20708
|
});
|
|
20702
20709
|
});
|
|
20703
|
-
},
|
|
20704
|
-
return s.__awaiter(
|
|
20705
|
-
var
|
|
20706
|
-
return s.__generator(this, function(
|
|
20707
|
-
switch (
|
|
20710
|
+
}, o.onnegotiationneeded = function() {
|
|
20711
|
+
return s.__awaiter(y, void 0, void 0, function() {
|
|
20712
|
+
var h, R;
|
|
20713
|
+
return s.__generator(this, function(w) {
|
|
20714
|
+
switch (w.label) {
|
|
20708
20715
|
case 0:
|
|
20709
|
-
if (!
|
|
20716
|
+
if (!m)
|
|
20710
20717
|
return [2];
|
|
20711
|
-
|
|
20718
|
+
w.label = 1;
|
|
20712
20719
|
case 1:
|
|
20713
|
-
return
|
|
20720
|
+
return w.trys.push([1, 3, , 4]), [4, o.setLocalDescription()];
|
|
20714
20721
|
case 2:
|
|
20715
|
-
return
|
|
20722
|
+
return w.sent(), h = l(o.localDescription, t), d.send(btoa(JSON.stringify(h))), [3, 4];
|
|
20716
20723
|
case 3:
|
|
20717
|
-
return
|
|
20724
|
+
return R = w.sent(), console.error(R), [3, 4];
|
|
20718
20725
|
case 4:
|
|
20719
20726
|
return [2];
|
|
20720
20727
|
}
|
|
20721
20728
|
});
|
|
20722
20729
|
});
|
|
20723
|
-
},
|
|
20730
|
+
}, g ? [4, o.createOffer()] : [2, Promise.resolve({ pc: o, dc: c })];
|
|
20724
20731
|
case 1:
|
|
20725
|
-
|
|
20732
|
+
v = b.sent(), b.label = 2;
|
|
20726
20733
|
case 2:
|
|
20727
|
-
return
|
|
20734
|
+
return b.trys.push([2, 4, , 5]), [4, o.setLocalDescription(v)];
|
|
20728
20735
|
case 3:
|
|
20729
|
-
return
|
|
20736
|
+
return b.sent(), [3, 5];
|
|
20730
20737
|
case 4:
|
|
20731
|
-
return
|
|
20738
|
+
return f = b.sent(), [2, Promise.reject(f)];
|
|
20732
20739
|
case 5:
|
|
20733
|
-
return
|
|
20734
|
-
return s.__awaiter(
|
|
20735
|
-
return s.__generator(this, function(
|
|
20736
|
-
return
|
|
20740
|
+
return o.onicecandidate = function(h) {
|
|
20741
|
+
return s.__awaiter(y, void 0, void 0, function() {
|
|
20742
|
+
return s.__generator(this, function(R) {
|
|
20743
|
+
return h.candidate !== null || r({ pc: o, dc: c }), [2];
|
|
20737
20744
|
});
|
|
20738
20745
|
});
|
|
20739
|
-
}, [2,
|
|
20746
|
+
}, [2, u];
|
|
20740
20747
|
}
|
|
20741
20748
|
});
|
|
20742
20749
|
});
|
|
20743
20750
|
};
|
|
20744
20751
|
}, 655: (i, e, n) => {
|
|
20745
|
-
n.r(e), n.d(e, { __assign: () => g, __asyncDelegator: () => T, __asyncGenerator: () => w, __asyncValues: () =>
|
|
20746
|
-
var s = function(
|
|
20747
|
-
return s = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(
|
|
20748
|
-
|
|
20749
|
-
} || function(
|
|
20750
|
-
for (var
|
|
20751
|
-
Object.prototype.hasOwnProperty.call(
|
|
20752
|
-
}, s(
|
|
20752
|
+
n.r(e), n.d(e, { __assign: () => g, __asyncDelegator: () => T, __asyncGenerator: () => w, __asyncValues: () => D, __await: () => R, __awaiter: () => u, __classPrivateFieldGet: () => I, __classPrivateFieldIn: () => k, __classPrivateFieldSet: () => U, __createBinding: () => d, __decorate: () => t, __exportStar: () => m, __extends: () => l, __generator: () => c, __importDefault: () => x, __importStar: () => L, __makeTemplateObject: () => z, __metadata: () => r, __param: () => o, __read: () => f, __rest: () => p, __spread: () => y, __spreadArray: () => h, __spreadArrays: () => b, __values: () => v });
|
|
20753
|
+
var s = function(S, M) {
|
|
20754
|
+
return s = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(E, B) {
|
|
20755
|
+
E.__proto__ = B;
|
|
20756
|
+
} || function(E, B) {
|
|
20757
|
+
for (var F in B)
|
|
20758
|
+
Object.prototype.hasOwnProperty.call(B, F) && (E[F] = B[F]);
|
|
20759
|
+
}, s(S, M);
|
|
20753
20760
|
};
|
|
20754
|
-
function l(
|
|
20755
|
-
if (typeof
|
|
20756
|
-
throw new TypeError("Class extends value " + String(
|
|
20757
|
-
function
|
|
20758
|
-
this.constructor =
|
|
20761
|
+
function l(S, M) {
|
|
20762
|
+
if (typeof M != "function" && M !== null)
|
|
20763
|
+
throw new TypeError("Class extends value " + String(M) + " is not a constructor or null");
|
|
20764
|
+
function E() {
|
|
20765
|
+
this.constructor = S;
|
|
20759
20766
|
}
|
|
20760
|
-
s(
|
|
20767
|
+
s(S, M), S.prototype = M === null ? Object.create(M) : (E.prototype = M.prototype, new E());
|
|
20761
20768
|
}
|
|
20762
20769
|
var g = function() {
|
|
20763
|
-
return g = Object.assign || function(
|
|
20764
|
-
for (var
|
|
20765
|
-
for (var
|
|
20766
|
-
Object.prototype.hasOwnProperty.call(
|
|
20767
|
-
return
|
|
20770
|
+
return g = Object.assign || function(S) {
|
|
20771
|
+
for (var M, E = 1, B = arguments.length; E < B; E++)
|
|
20772
|
+
for (var F in M = arguments[E])
|
|
20773
|
+
Object.prototype.hasOwnProperty.call(M, F) && (S[F] = M[F]);
|
|
20774
|
+
return S;
|
|
20768
20775
|
}, g.apply(this, arguments);
|
|
20769
20776
|
};
|
|
20770
|
-
function p(
|
|
20771
|
-
var
|
|
20772
|
-
for (var
|
|
20773
|
-
Object.prototype.hasOwnProperty.call(
|
|
20774
|
-
if (
|
|
20775
|
-
var
|
|
20776
|
-
for (
|
|
20777
|
-
|
|
20778
|
-
}
|
|
20779
|
-
return
|
|
20780
|
-
}
|
|
20781
|
-
function t(M,
|
|
20782
|
-
var
|
|
20777
|
+
function p(S, M) {
|
|
20778
|
+
var E = {};
|
|
20779
|
+
for (var B in S)
|
|
20780
|
+
Object.prototype.hasOwnProperty.call(S, B) && M.indexOf(B) < 0 && (E[B] = S[B]);
|
|
20781
|
+
if (S != null && typeof Object.getOwnPropertySymbols == "function") {
|
|
20782
|
+
var F = 0;
|
|
20783
|
+
for (B = Object.getOwnPropertySymbols(S); F < B.length; F++)
|
|
20784
|
+
M.indexOf(B[F]) < 0 && Object.prototype.propertyIsEnumerable.call(S, B[F]) && (E[B[F]] = S[B[F]]);
|
|
20785
|
+
}
|
|
20786
|
+
return E;
|
|
20787
|
+
}
|
|
20788
|
+
function t(S, M, E, B) {
|
|
20789
|
+
var F, C = arguments.length, O = C < 3 ? M : B === null ? B = Object.getOwnPropertyDescriptor(M, E) : B;
|
|
20783
20790
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
20784
|
-
O = Reflect.decorate(M,
|
|
20791
|
+
O = Reflect.decorate(S, M, E, B);
|
|
20785
20792
|
else
|
|
20786
|
-
for (var P =
|
|
20787
|
-
(
|
|
20788
|
-
return
|
|
20793
|
+
for (var P = S.length - 1; P >= 0; P--)
|
|
20794
|
+
(F = S[P]) && (O = (C < 3 ? F(O) : C > 3 ? F(M, E, O) : F(M, E)) || O);
|
|
20795
|
+
return C > 3 && O && Object.defineProperty(M, E, O), O;
|
|
20789
20796
|
}
|
|
20790
|
-
function o(
|
|
20791
|
-
return function(
|
|
20792
|
-
|
|
20797
|
+
function o(S, M) {
|
|
20798
|
+
return function(E, B) {
|
|
20799
|
+
M(E, B, S);
|
|
20793
20800
|
};
|
|
20794
20801
|
}
|
|
20795
|
-
function r(
|
|
20802
|
+
function r(S, M) {
|
|
20796
20803
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
20797
|
-
return Reflect.metadata(
|
|
20804
|
+
return Reflect.metadata(S, M);
|
|
20798
20805
|
}
|
|
20799
|
-
function u(M,
|
|
20800
|
-
return new (
|
|
20801
|
-
function O(
|
|
20806
|
+
function u(S, M, E, B) {
|
|
20807
|
+
return new (E || (E = Promise))(function(F, C) {
|
|
20808
|
+
function O(W) {
|
|
20802
20809
|
try {
|
|
20803
|
-
|
|
20810
|
+
A(B.next(W));
|
|
20804
20811
|
} catch (_) {
|
|
20805
|
-
|
|
20812
|
+
C(_);
|
|
20806
20813
|
}
|
|
20807
20814
|
}
|
|
20808
|
-
function P(
|
|
20815
|
+
function P(W) {
|
|
20809
20816
|
try {
|
|
20810
|
-
|
|
20817
|
+
A(B.throw(W));
|
|
20811
20818
|
} catch (_) {
|
|
20812
|
-
|
|
20819
|
+
C(_);
|
|
20813
20820
|
}
|
|
20814
20821
|
}
|
|
20815
|
-
function W
|
|
20822
|
+
function A(W) {
|
|
20816
20823
|
var _;
|
|
20817
|
-
|
|
20824
|
+
W.done ? F(W.value) : (_ = W.value, _ instanceof E ? _ : new E(function(G) {
|
|
20818
20825
|
G(_);
|
|
20819
20826
|
})).then(O, P);
|
|
20820
20827
|
}
|
|
20821
|
-
|
|
20828
|
+
A((B = B.apply(S, M || [])).next());
|
|
20822
20829
|
});
|
|
20823
20830
|
}
|
|
20824
|
-
function c(
|
|
20825
|
-
var B, F,
|
|
20826
|
-
if (1 &
|
|
20827
|
-
throw
|
|
20828
|
-
return
|
|
20831
|
+
function c(S, M) {
|
|
20832
|
+
var E, B, F, C, O = { label: 0, sent: function() {
|
|
20833
|
+
if (1 & F[0])
|
|
20834
|
+
throw F[1];
|
|
20835
|
+
return F[1];
|
|
20829
20836
|
}, trys: [], ops: [] };
|
|
20830
|
-
return
|
|
20837
|
+
return C = { next: P(0), throw: P(1), return: P(2) }, typeof Symbol == "function" && (C[Symbol.iterator] = function() {
|
|
20831
20838
|
return this;
|
|
20832
|
-
}),
|
|
20833
|
-
function P(
|
|
20834
|
-
return function(
|
|
20839
|
+
}), C;
|
|
20840
|
+
function P(A) {
|
|
20841
|
+
return function(W) {
|
|
20835
20842
|
return function(_) {
|
|
20836
|
-
if (
|
|
20843
|
+
if (E)
|
|
20837
20844
|
throw new TypeError("Generator is already executing.");
|
|
20838
|
-
for (;
|
|
20845
|
+
for (; C && (C = 0, _[0] && (O = 0)), O; )
|
|
20839
20846
|
try {
|
|
20840
|
-
if (
|
|
20841
|
-
return
|
|
20842
|
-
switch (
|
|
20847
|
+
if (E = 1, B && (F = 2 & _[0] ? B.return : _[0] ? B.throw || ((F = B.return) && F.call(B), 0) : B.next) && !(F = F.call(B, _[1])).done)
|
|
20848
|
+
return F;
|
|
20849
|
+
switch (B = 0, F && (_ = [2 & _[0], F.value]), _[0]) {
|
|
20843
20850
|
case 0:
|
|
20844
20851
|
case 1:
|
|
20845
|
-
|
|
20852
|
+
F = _;
|
|
20846
20853
|
break;
|
|
20847
20854
|
case 4:
|
|
20848
20855
|
return O.label++, { value: _[1], done: !1 };
|
|
20849
20856
|
case 5:
|
|
20850
|
-
O.label++,
|
|
20857
|
+
O.label++, B = _[1], _ = [0];
|
|
20851
20858
|
continue;
|
|
20852
20859
|
case 7:
|
|
20853
20860
|
_ = O.ops.pop(), O.trys.pop();
|
|
20854
20861
|
continue;
|
|
20855
20862
|
default:
|
|
20856
|
-
if (!((
|
|
20863
|
+
if (!((F = (F = O.trys).length > 0 && F[F.length - 1]) || _[0] !== 6 && _[0] !== 2)) {
|
|
20857
20864
|
O = 0;
|
|
20858
20865
|
continue;
|
|
20859
20866
|
}
|
|
20860
|
-
if (_[0] === 3 && (!
|
|
20867
|
+
if (_[0] === 3 && (!F || _[1] > F[0] && _[1] < F[3])) {
|
|
20861
20868
|
O.label = _[1];
|
|
20862
20869
|
break;
|
|
20863
20870
|
}
|
|
20864
|
-
if (_[0] === 6 && O.label <
|
|
20865
|
-
O.label =
|
|
20871
|
+
if (_[0] === 6 && O.label < F[1]) {
|
|
20872
|
+
O.label = F[1], F = _;
|
|
20866
20873
|
break;
|
|
20867
20874
|
}
|
|
20868
|
-
if (
|
|
20869
|
-
O.label =
|
|
20875
|
+
if (F && O.label < F[2]) {
|
|
20876
|
+
O.label = F[2], O.ops.push(_);
|
|
20870
20877
|
break;
|
|
20871
20878
|
}
|
|
20872
|
-
|
|
20879
|
+
F[2] && O.ops.pop(), O.trys.pop();
|
|
20873
20880
|
continue;
|
|
20874
20881
|
}
|
|
20875
|
-
_ =
|
|
20882
|
+
_ = M.call(S, O);
|
|
20876
20883
|
} catch (G) {
|
|
20877
|
-
_ = [6, G],
|
|
20884
|
+
_ = [6, G], B = 0;
|
|
20878
20885
|
} finally {
|
|
20879
|
-
|
|
20886
|
+
E = F = 0;
|
|
20880
20887
|
}
|
|
20881
20888
|
if (5 & _[0])
|
|
20882
20889
|
throw _[1];
|
|
20883
20890
|
return { value: _[0] ? _[1] : void 0, done: !0 };
|
|
20884
|
-
}([
|
|
20891
|
+
}([A, W]);
|
|
20885
20892
|
};
|
|
20886
20893
|
}
|
|
20887
20894
|
}
|
|
20888
|
-
var d = Object.create ? function(M,
|
|
20889
|
-
|
|
20890
|
-
var
|
|
20891
|
-
|
|
20892
|
-
return
|
|
20893
|
-
} }), Object.defineProperty(
|
|
20894
|
-
} : function(M,
|
|
20895
|
-
|
|
20895
|
+
var d = Object.create ? function(S, M, E, B) {
|
|
20896
|
+
B === void 0 && (B = E);
|
|
20897
|
+
var F = Object.getOwnPropertyDescriptor(M, E);
|
|
20898
|
+
F && !("get" in F ? !M.__esModule : F.writable || F.configurable) || (F = { enumerable: !0, get: function() {
|
|
20899
|
+
return M[E];
|
|
20900
|
+
} }), Object.defineProperty(S, B, F);
|
|
20901
|
+
} : function(S, M, E, B) {
|
|
20902
|
+
B === void 0 && (B = E), S[B] = M[E];
|
|
20896
20903
|
};
|
|
20897
|
-
function m(
|
|
20898
|
-
for (var
|
|
20899
|
-
|
|
20900
|
-
}
|
|
20901
|
-
function v(
|
|
20902
|
-
var
|
|
20903
|
-
if (
|
|
20904
|
-
return
|
|
20905
|
-
if (
|
|
20904
|
+
function m(S, M) {
|
|
20905
|
+
for (var E in S)
|
|
20906
|
+
E === "default" || Object.prototype.hasOwnProperty.call(M, E) || d(M, S, E);
|
|
20907
|
+
}
|
|
20908
|
+
function v(S) {
|
|
20909
|
+
var M = typeof Symbol == "function" && Symbol.iterator, E = M && S[M], B = 0;
|
|
20910
|
+
if (E)
|
|
20911
|
+
return E.call(S);
|
|
20912
|
+
if (S && typeof S.length == "number")
|
|
20906
20913
|
return { next: function() {
|
|
20907
|
-
return
|
|
20914
|
+
return S && B >= S.length && (S = void 0), { value: S && S[B++], done: !S };
|
|
20908
20915
|
} };
|
|
20909
|
-
throw new TypeError(
|
|
20916
|
+
throw new TypeError(M ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
20910
20917
|
}
|
|
20911
|
-
function f(
|
|
20912
|
-
var
|
|
20913
|
-
if (!
|
|
20914
|
-
return
|
|
20915
|
-
var
|
|
20918
|
+
function f(S, M) {
|
|
20919
|
+
var E = typeof Symbol == "function" && S[Symbol.iterator];
|
|
20920
|
+
if (!E)
|
|
20921
|
+
return S;
|
|
20922
|
+
var B, F, C = E.call(S), O = [];
|
|
20916
20923
|
try {
|
|
20917
|
-
for (; (
|
|
20918
|
-
O.push(
|
|
20924
|
+
for (; (M === void 0 || M-- > 0) && !(B = C.next()).done; )
|
|
20925
|
+
O.push(B.value);
|
|
20919
20926
|
} catch (P) {
|
|
20920
|
-
|
|
20927
|
+
F = { error: P };
|
|
20921
20928
|
} finally {
|
|
20922
20929
|
try {
|
|
20923
|
-
|
|
20930
|
+
B && !B.done && (E = C.return) && E.call(C);
|
|
20924
20931
|
} finally {
|
|
20925
|
-
if (
|
|
20926
|
-
throw
|
|
20932
|
+
if (F)
|
|
20933
|
+
throw F.error;
|
|
20927
20934
|
}
|
|
20928
20935
|
}
|
|
20929
20936
|
return O;
|
|
20930
20937
|
}
|
|
20931
20938
|
function y() {
|
|
20932
|
-
for (var
|
|
20933
|
-
|
|
20934
|
-
return
|
|
20939
|
+
for (var S = [], M = 0; M < arguments.length; M++)
|
|
20940
|
+
S = S.concat(f(arguments[M]));
|
|
20941
|
+
return S;
|
|
20935
20942
|
}
|
|
20936
20943
|
function b() {
|
|
20937
|
-
for (var
|
|
20938
|
-
|
|
20939
|
-
var
|
|
20940
|
-
for (
|
|
20941
|
-
for (var
|
|
20942
|
-
F
|
|
20943
|
-
return
|
|
20944
|
-
}
|
|
20945
|
-
function h(
|
|
20946
|
-
if (
|
|
20947
|
-
for (var
|
|
20948
|
-
!
|
|
20949
|
-
return
|
|
20950
|
-
}
|
|
20951
|
-
function R(
|
|
20952
|
-
return this instanceof R ? (this.v =
|
|
20953
|
-
}
|
|
20954
|
-
function w(
|
|
20944
|
+
for (var S = 0, M = 0, E = arguments.length; M < E; M++)
|
|
20945
|
+
S += arguments[M].length;
|
|
20946
|
+
var B = Array(S), F = 0;
|
|
20947
|
+
for (M = 0; M < E; M++)
|
|
20948
|
+
for (var C = arguments[M], O = 0, P = C.length; O < P; O++, F++)
|
|
20949
|
+
B[F] = C[O];
|
|
20950
|
+
return B;
|
|
20951
|
+
}
|
|
20952
|
+
function h(S, M, E) {
|
|
20953
|
+
if (E || arguments.length === 2)
|
|
20954
|
+
for (var B, F = 0, C = M.length; F < C; F++)
|
|
20955
|
+
!B && F in M || (B || (B = Array.prototype.slice.call(M, 0, F)), B[F] = M[F]);
|
|
20956
|
+
return S.concat(B || Array.prototype.slice.call(M));
|
|
20957
|
+
}
|
|
20958
|
+
function R(S) {
|
|
20959
|
+
return this instanceof R ? (this.v = S, this) : new R(S);
|
|
20960
|
+
}
|
|
20961
|
+
function w(S, M, E) {
|
|
20955
20962
|
if (!Symbol.asyncIterator)
|
|
20956
20963
|
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
20957
|
-
var
|
|
20958
|
-
return
|
|
20964
|
+
var B, F = E.apply(S, M || []), C = [];
|
|
20965
|
+
return B = {}, O("next"), O("throw"), O("return"), B[Symbol.asyncIterator] = function() {
|
|
20959
20966
|
return this;
|
|
20960
|
-
},
|
|
20967
|
+
}, B;
|
|
20961
20968
|
function O(G) {
|
|
20962
|
-
|
|
20963
|
-
return new Promise(function(
|
|
20964
|
-
|
|
20969
|
+
F[G] && (B[G] = function(H) {
|
|
20970
|
+
return new Promise(function(Y, oe) {
|
|
20971
|
+
C.push([G, H, Y, oe]) > 1 || P(G, H);
|
|
20965
20972
|
});
|
|
20966
20973
|
});
|
|
20967
20974
|
}
|
|
20968
|
-
function P(G,
|
|
20975
|
+
function P(G, H) {
|
|
20969
20976
|
try {
|
|
20970
|
-
(
|
|
20977
|
+
(Y = F[G](H)).value instanceof R ? Promise.resolve(Y.value.v).then(A, W) : _(C[0][2], Y);
|
|
20971
20978
|
} catch (oe) {
|
|
20972
|
-
_(
|
|
20979
|
+
_(C[0][3], oe);
|
|
20973
20980
|
}
|
|
20974
|
-
var
|
|
20981
|
+
var Y;
|
|
20975
20982
|
}
|
|
20976
|
-
function
|
|
20983
|
+
function A(G) {
|
|
20977
20984
|
P("next", G);
|
|
20978
20985
|
}
|
|
20979
|
-
function
|
|
20986
|
+
function W(G) {
|
|
20980
20987
|
P("throw", G);
|
|
20981
20988
|
}
|
|
20982
|
-
function _(G,
|
|
20983
|
-
G(
|
|
20989
|
+
function _(G, H) {
|
|
20990
|
+
G(H), C.shift(), C.length && P(C[0][0], C[0][1]);
|
|
20984
20991
|
}
|
|
20985
20992
|
}
|
|
20986
|
-
function T(
|
|
20987
|
-
var
|
|
20988
|
-
return
|
|
20989
|
-
throw
|
|
20990
|
-
}),
|
|
20993
|
+
function T(S) {
|
|
20994
|
+
var M, E;
|
|
20995
|
+
return M = {}, B("next"), B("throw", function(F) {
|
|
20996
|
+
throw F;
|
|
20997
|
+
}), B("return"), M[Symbol.iterator] = function() {
|
|
20991
20998
|
return this;
|
|
20992
|
-
},
|
|
20993
|
-
function F
|
|
20994
|
-
|
|
20995
|
-
return (
|
|
20996
|
-
} :
|
|
20999
|
+
}, M;
|
|
21000
|
+
function B(F, C) {
|
|
21001
|
+
M[F] = S[F] ? function(O) {
|
|
21002
|
+
return (E = !E) ? { value: R(S[F](O)), done: F === "return" } : C ? C(O) : O;
|
|
21003
|
+
} : C;
|
|
20997
21004
|
}
|
|
20998
21005
|
}
|
|
20999
|
-
function
|
|
21006
|
+
function D(S) {
|
|
21000
21007
|
if (!Symbol.asyncIterator)
|
|
21001
21008
|
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
21002
|
-
var
|
|
21003
|
-
return
|
|
21009
|
+
var M, E = S[Symbol.asyncIterator];
|
|
21010
|
+
return E ? E.call(S) : (S = v(S), M = {}, B("next"), B("throw"), B("return"), M[Symbol.asyncIterator] = function() {
|
|
21004
21011
|
return this;
|
|
21005
|
-
},
|
|
21006
|
-
function F
|
|
21007
|
-
|
|
21012
|
+
}, M);
|
|
21013
|
+
function B(F) {
|
|
21014
|
+
M[F] = S[F] && function(C) {
|
|
21008
21015
|
return new Promise(function(O, P) {
|
|
21009
|
-
(function(
|
|
21010
|
-
Promise.resolve(G).then(function(
|
|
21011
|
-
|
|
21012
|
-
},
|
|
21013
|
-
})(O, P, (
|
|
21016
|
+
(function(A, W, _, G) {
|
|
21017
|
+
Promise.resolve(G).then(function(H) {
|
|
21018
|
+
A({ value: H, done: _ });
|
|
21019
|
+
}, W);
|
|
21020
|
+
})(O, P, (C = S[F](C)).done, C.value);
|
|
21014
21021
|
});
|
|
21015
21022
|
};
|
|
21016
21023
|
}
|
|
21017
21024
|
}
|
|
21018
|
-
function z(
|
|
21019
|
-
return Object.defineProperty ? Object.defineProperty(
|
|
21025
|
+
function z(S, M) {
|
|
21026
|
+
return Object.defineProperty ? Object.defineProperty(S, "raw", { value: M }) : S.raw = M, S;
|
|
21020
21027
|
}
|
|
21021
|
-
var j = Object.create ? function(
|
|
21022
|
-
Object.defineProperty(
|
|
21023
|
-
} : function(
|
|
21024
|
-
|
|
21028
|
+
var j = Object.create ? function(S, M) {
|
|
21029
|
+
Object.defineProperty(S, "default", { enumerable: !0, value: M });
|
|
21030
|
+
} : function(S, M) {
|
|
21031
|
+
S.default = M;
|
|
21025
21032
|
};
|
|
21026
|
-
function L(
|
|
21027
|
-
if (
|
|
21028
|
-
return
|
|
21029
|
-
var
|
|
21030
|
-
if (
|
|
21031
|
-
for (var
|
|
21032
|
-
|
|
21033
|
-
return j(
|
|
21034
|
-
}
|
|
21035
|
-
function x(
|
|
21036
|
-
return
|
|
21037
|
-
}
|
|
21038
|
-
function I(M,
|
|
21039
|
-
if (
|
|
21033
|
+
function L(S) {
|
|
21034
|
+
if (S && S.__esModule)
|
|
21035
|
+
return S;
|
|
21036
|
+
var M = {};
|
|
21037
|
+
if (S != null)
|
|
21038
|
+
for (var E in S)
|
|
21039
|
+
E !== "default" && Object.prototype.hasOwnProperty.call(S, E) && d(M, S, E);
|
|
21040
|
+
return j(M, S), M;
|
|
21041
|
+
}
|
|
21042
|
+
function x(S) {
|
|
21043
|
+
return S && S.__esModule ? S : { default: S };
|
|
21044
|
+
}
|
|
21045
|
+
function I(S, M, E, B) {
|
|
21046
|
+
if (E === "a" && !B)
|
|
21040
21047
|
throw new TypeError("Private accessor was defined without a getter");
|
|
21041
|
-
if (typeof
|
|
21048
|
+
if (typeof M == "function" ? S !== M || !B : !M.has(S))
|
|
21042
21049
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
21043
|
-
return
|
|
21050
|
+
return E === "m" ? B : E === "a" ? B.call(S) : B ? B.value : M.get(S);
|
|
21044
21051
|
}
|
|
21045
|
-
function U(M,
|
|
21046
|
-
if (
|
|
21052
|
+
function U(S, M, E, B, F) {
|
|
21053
|
+
if (B === "m")
|
|
21047
21054
|
throw new TypeError("Private method is not writable");
|
|
21048
|
-
if (
|
|
21055
|
+
if (B === "a" && !F)
|
|
21049
21056
|
throw new TypeError("Private accessor was defined without a setter");
|
|
21050
|
-
if (typeof
|
|
21057
|
+
if (typeof M == "function" ? S !== M || !F : !M.has(S))
|
|
21051
21058
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
21052
|
-
return
|
|
21059
|
+
return B === "a" ? F.call(S, E) : F ? F.value = E : M.set(S, E), E;
|
|
21053
21060
|
}
|
|
21054
|
-
function k(
|
|
21055
|
-
if (
|
|
21061
|
+
function k(S, M) {
|
|
21062
|
+
if (M === null || typeof M != "object" && typeof M != "function")
|
|
21056
21063
|
throw new TypeError("Cannot use 'in' operator on non-object");
|
|
21057
|
-
return typeof
|
|
21064
|
+
return typeof S == "function" ? M === S : S.has(M);
|
|
21058
21065
|
}
|
|
21059
21066
|
}, 80: (i, e, n) => {
|
|
21060
21067
|
var s = n(19), l = s, g = function() {
|
|
@@ -23224,8 +23231,8 @@ var grpcWebClient_umdExports$1 = {}, grpcWebClient_umd$1 = {
|
|
|
23224
23231
|
return y.slice(b, h);
|
|
23225
23232
|
var R = y.length;
|
|
23226
23233
|
h !== void 0 && (R = h);
|
|
23227
|
-
for (var w = new Uint8Array(R - b), T = 0,
|
|
23228
|
-
w[T++] = y[
|
|
23234
|
+
for (var w = new Uint8Array(R - b), T = 0, D = b; D < R; D++)
|
|
23235
|
+
w[T++] = y[D];
|
|
23229
23236
|
return w;
|
|
23230
23237
|
}
|
|
23231
23238
|
g.decodeASCII = u, g.encodeASCII = function(y) {
|
|
@@ -23252,10 +23259,10 @@ var grpcWebClient_umdExports$1 = {}, grpcWebClient_umd$1 = {
|
|
|
23252
23259
|
else if (this.position === this.buffer.byteLength)
|
|
23253
23260
|
this.buffer = b, this.position = 0;
|
|
23254
23261
|
else {
|
|
23255
|
-
var T = this.buffer.byteLength - this.position,
|
|
23256
|
-
|
|
23262
|
+
var T = this.buffer.byteLength - this.position, D = new Uint8Array(T + b.byteLength), z = v(this.buffer, this.position);
|
|
23263
|
+
D.set(z, 0);
|
|
23257
23264
|
var j = new Uint8Array(b);
|
|
23258
|
-
|
|
23265
|
+
D.set(j, T), this.buffer = D, this.position = 0;
|
|
23259
23266
|
}
|
|
23260
23267
|
for (; ; ) {
|
|
23261
23268
|
if (!m(this.buffer, this.position, 5))
|
|
@@ -41554,17 +41561,21 @@ class RobotClient extends EventDispatcher {
|
|
|
41554
41561
|
isConnected() {
|
|
41555
41562
|
return this.peerConn?.iceConnectionState === "connected";
|
|
41556
41563
|
}
|
|
41557
|
-
async connect(
|
|
41564
|
+
async connect({
|
|
41565
|
+
authEntity: e = this.savedAuthEntity,
|
|
41566
|
+
creds: n = this.savedCreds,
|
|
41567
|
+
priority: s
|
|
41568
|
+
} = {}) {
|
|
41558
41569
|
if (this.connecting) {
|
|
41559
41570
|
for (; this.connecting; )
|
|
41560
41571
|
await this.connecting;
|
|
41561
41572
|
return;
|
|
41562
41573
|
}
|
|
41563
|
-
this.connecting = new Promise((
|
|
41564
|
-
this.connectResolve =
|
|
41574
|
+
this.connecting = new Promise((l) => {
|
|
41575
|
+
this.connectResolve = l;
|
|
41565
41576
|
}), this.peerConn && (this.peerConn.close(), this.peerConn = void 0), this.sessionManager.reset();
|
|
41566
41577
|
try {
|
|
41567
|
-
const
|
|
41578
|
+
const l = {
|
|
41568
41579
|
authEntity: e,
|
|
41569
41580
|
credentials: n,
|
|
41570
41581
|
webrtcOptions: {
|
|
@@ -41572,78 +41583,78 @@ class RobotClient extends EventDispatcher {
|
|
|
41572
41583
|
rtcConfig: this.webrtcOptions?.rtcConfig
|
|
41573
41584
|
}
|
|
41574
41585
|
};
|
|
41575
|
-
if (this.savedAuthEntity = e, this.savedCreds = n, this.webrtcOptions?.enabled) {
|
|
41576
|
-
|
|
41577
|
-
const
|
|
41586
|
+
if (s !== void 0 && l.webrtcOptions && (l.webrtcOptions.additionalSdpFields = { "x-priority": s }), this.savedAuthEntity = e, this.savedCreds = n, this.webrtcOptions?.enabled) {
|
|
41587
|
+
l.webrtcOptions && (l.webrtcOptions.signalingAuthEntity = l.authEntity, l.webrtcOptions.signalingCredentials = l.credentials);
|
|
41588
|
+
const t = await __webpack_exports__dialWebRTC(
|
|
41578
41589
|
this.webrtcOptions.signalingAddress || this.serviceHost,
|
|
41579
41590
|
this.webrtcOptions.host,
|
|
41580
|
-
|
|
41591
|
+
l
|
|
41581
41592
|
);
|
|
41582
|
-
this.peerConn =
|
|
41593
|
+
this.peerConn = t.peerConnection, this.peerConn.addEventListener("iceconnectionstatechange", () => {
|
|
41583
41594
|
this.peerConn?.iceConnectionState === "connected" ? events.emit(RECONNECTED, {}) : this.peerConn?.iceConnectionState === "closed" && events.emit(DISCONNECTED, {});
|
|
41584
|
-
}), this.transportFactory =
|
|
41585
|
-
const [
|
|
41586
|
-
if (!
|
|
41587
|
-
throw events.emit("track",
|
|
41588
|
-
const
|
|
41589
|
-
Object.defineProperty(
|
|
41590
|
-
value:
|
|
41591
|
-
}), events.emit("track",
|
|
41595
|
+
}), this.transportFactory = t.transportFactory, t.peerConnection.ontrack = (o) => {
|
|
41596
|
+
const [r] = o.streams;
|
|
41597
|
+
if (!r)
|
|
41598
|
+
throw events.emit("track", o), new Error("expected event stream to exist");
|
|
41599
|
+
const u = r.id.replaceAll("+", ":");
|
|
41600
|
+
Object.defineProperty(r, "id", {
|
|
41601
|
+
value: u
|
|
41602
|
+
}), events.emit("track", o);
|
|
41592
41603
|
};
|
|
41593
41604
|
} else
|
|
41594
|
-
this.transportFactory = await __webpack_exports__dialDirect(this.serviceHost,
|
|
41595
|
-
const
|
|
41605
|
+
this.transportFactory = await __webpack_exports__dialDirect(this.serviceHost, l), await this.gRPCConnectionManager.start();
|
|
41606
|
+
const p = { transport: this.sessionOptions?.disabled ? this.transportFactory : this.sessionManager.transportFactory };
|
|
41596
41607
|
this.robotServiceClient = new RobotServiceClient_1(
|
|
41597
41608
|
this.serviceHost,
|
|
41598
|
-
|
|
41609
|
+
p
|
|
41599
41610
|
), this.armServiceClient = new ArmServiceClient_1(
|
|
41600
41611
|
this.serviceHost,
|
|
41601
|
-
|
|
41612
|
+
p
|
|
41602
41613
|
), this.baseServiceClient = new BaseServiceClient_1(
|
|
41603
41614
|
this.serviceHost,
|
|
41604
|
-
|
|
41615
|
+
p
|
|
41605
41616
|
), this.boardServiceClient = new BoardServiceClient_1(
|
|
41606
41617
|
this.serviceHost,
|
|
41607
|
-
|
|
41618
|
+
p
|
|
41608
41619
|
), this.encoderServiceClient = new EncoderServiceClient_1(
|
|
41609
41620
|
this.serviceHost,
|
|
41610
|
-
|
|
41621
|
+
p
|
|
41611
41622
|
), this.gantryServiceClient = new GantryServiceClient_1(
|
|
41612
41623
|
this.serviceHost,
|
|
41613
|
-
|
|
41624
|
+
p
|
|
41614
41625
|
), this.genericServiceClient = new GenericServiceClient_1(
|
|
41615
41626
|
this.serviceHost,
|
|
41616
|
-
|
|
41627
|
+
p
|
|
41617
41628
|
), this.gripperServiceClient = new GripperServiceClient_1(
|
|
41618
41629
|
this.serviceHost,
|
|
41619
|
-
|
|
41630
|
+
p
|
|
41620
41631
|
), this.movementSensorServiceClient = new MovementSensorServiceClient_1(
|
|
41621
41632
|
this.serviceHost,
|
|
41622
|
-
|
|
41633
|
+
p
|
|
41623
41634
|
), this.inputControllerServiceClient = new InputControllerServiceClient_1(
|
|
41624
41635
|
this.serviceHost,
|
|
41625
|
-
|
|
41636
|
+
p
|
|
41626
41637
|
), this.motorServiceClient = new MotorServiceClient_1(
|
|
41627
41638
|
this.serviceHost,
|
|
41628
|
-
|
|
41639
|
+
p
|
|
41629
41640
|
), this.navigationServiceClient = new NavigationServiceClient_1(
|
|
41630
41641
|
this.serviceHost,
|
|
41631
|
-
|
|
41642
|
+
p
|
|
41632
41643
|
), this.motionServiceClient = new MotionServiceClient_1(
|
|
41633
41644
|
this.serviceHost,
|
|
41634
|
-
|
|
41645
|
+
p
|
|
41635
41646
|
), this.visionServiceClient = new VisionServiceClient_1(
|
|
41636
41647
|
this.serviceHost,
|
|
41637
|
-
|
|
41648
|
+
p
|
|
41638
41649
|
), this.sensorsServiceClient = new SensorsServiceClient_1(
|
|
41639
41650
|
this.serviceHost,
|
|
41640
|
-
|
|
41651
|
+
p
|
|
41641
41652
|
), this.servoServiceClient = new ServoServiceClient_1(
|
|
41642
41653
|
this.serviceHost,
|
|
41643
|
-
|
|
41654
|
+
p
|
|
41644
41655
|
), this.slamServiceClient = new SLAMServiceClient_1(
|
|
41645
41656
|
this.serviceHost,
|
|
41646
|
-
|
|
41657
|
+
p
|
|
41647
41658
|
);
|
|
41648
41659
|
} finally {
|
|
41649
41660
|
this.connectResolve?.(), this.connectResolve = void 0, this.connecting = void 0;
|
|
@@ -42325,8 +42336,8 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
|
|
|
42325
42336
|
else if (this.position === this.buffer.byteLength)
|
|
42326
42337
|
this.buffer = y, this.position = 0;
|
|
42327
42338
|
else {
|
|
42328
|
-
var w = this.buffer.byteLength - this.position, T = new Uint8Array(w + y.byteLength),
|
|
42329
|
-
T.set(
|
|
42339
|
+
var w = this.buffer.byteLength - this.position, T = new Uint8Array(w + y.byteLength), D = m(this.buffer, this.position);
|
|
42340
|
+
T.set(D, 0);
|
|
42330
42341
|
var z = new Uint8Array(y);
|
|
42331
42342
|
T.set(z, w), this.buffer = T, this.position = 0;
|
|
42332
42343
|
}
|
|
@@ -46305,7 +46316,7 @@ const isPosInt = (i) => !!(i > 0 && Number.isInteger(i)), isLocalConnection = (i
|
|
|
46305
46316
|
i.disableSessions && (n = { disabled: !0 });
|
|
46306
46317
|
const s = new RobotClient(i.host, void 0, n, e);
|
|
46307
46318
|
let l;
|
|
46308
|
-
return i.credential && (l = i.credential), await s.connect(i.authEntity, l), console.debug("connected via gRPC"), s;
|
|
46319
|
+
return i.credential && (l = i.credential), await s.connect({ authEntity: i.authEntity, creds: l }), console.debug("connected via gRPC"), s;
|
|
46309
46320
|
}, dialWebRTC = async (i) => {
|
|
46310
46321
|
console.debug("dialing via WebRTC...");
|
|
46311
46322
|
const e = i.host, { signalingAddress: n } = i, l = { iceServers: i.iceServers ?? [] }, g = {
|
|
@@ -46321,7 +46332,11 @@ const isPosInt = (i) => !!(i > 0 && Number.isInteger(i)), isLocalConnection = (i
|
|
|
46321
46332
|
i.disableSessions && (p = { disabled: !0 });
|
|
46322
46333
|
const t = new RobotClient(e, g, p);
|
|
46323
46334
|
let o;
|
|
46324
|
-
return i.credential && (o = i.credential), await t.connect(
|
|
46335
|
+
return i.credential && (o = i.credential), await t.connect({
|
|
46336
|
+
authEntity: i.authEntity || e,
|
|
46337
|
+
creds: o,
|
|
46338
|
+
priority: i.priority
|
|
46339
|
+
}), console.debug("connected via WebRTC"), t;
|
|
46325
46340
|
}, isDialWebRTCConf = (i) => {
|
|
46326
46341
|
const e = i;
|
|
46327
46342
|
return typeof e.signalingAddress != "string" ? !1 : !e.iceServers || Array.isArray(e.iceServers);
|
|
@@ -54423,7 +54438,7 @@ const concatArrayU8 = (i) => {
|
|
|
54423
54438
|
for (const l of i)
|
|
54424
54439
|
n.set(l, s), s += l.length;
|
|
54425
54440
|
return n;
|
|
54426
|
-
}, version = "0.
|
|
54441
|
+
}, version = "0.6.0-rc.0";
|
|
54427
54442
|
export {
|
|
54428
54443
|
ArmClient,
|
|
54429
54444
|
BaseClient,
|