@viamrobotics/sdk 0.0.39 → 0.0.40-alpha.2

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 CHANGED
@@ -1,3 +1,4 @@
1
+ const version = "0.0.40-alpha.3";
1
2
  var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, robot_pb = {}, googleProtobuf = {};
2
3
  (function(exports) {
3
4
  var $jscomp = $jscomp || {};
@@ -12471,14 +12472,14 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
12471
12472
  }([function(p, o, r) {
12472
12473
  Object.defineProperty(o, "__esModule", { value: !0 });
12473
12474
  var i = r(3), l = function() {
12474
- function c(d, v) {
12475
- d === void 0 && (d = {}), v === void 0 && (v = { splitValues: !1 });
12476
- var m, y = this;
12475
+ function c(d, m) {
12476
+ d === void 0 && (d = {}), m === void 0 && (m = { splitValues: !1 });
12477
+ var v, y = this;
12477
12478
  this.headersMap = {}, d && (typeof Headers < "u" && d instanceof Headers ? i.getHeaderKeys(d).forEach(function(f) {
12478
12479
  i.getHeaderValues(d, f).forEach(function(b) {
12479
- v.splitValues ? y.append(f, i.splitHeaderValue(b)) : y.append(f, b);
12480
+ m.splitValues ? y.append(f, i.splitHeaderValue(b)) : y.append(f, b);
12480
12481
  });
12481
- }) : typeof (m = d) == "object" && typeof m.headersMap == "object" && typeof m.forEach == "function" ? d.forEach(function(f, b) {
12482
+ }) : typeof (v = d) == "object" && typeof v.headersMap == "object" && typeof v.forEach == "function" ? d.forEach(function(f, b) {
12482
12483
  y.append(f, b);
12483
12484
  }) : typeof Map < "u" && d instanceof Map ? d.forEach(function(f, b) {
12484
12485
  y.append(b, f);
@@ -12490,62 +12491,62 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
12490
12491
  }));
12491
12492
  }
12492
12493
  return c.prototype.appendFromString = function(d) {
12493
- for (var v = d.split(`\r
12494
- `), m = 0; m < v.length; m++) {
12495
- var y = v[m], f = y.indexOf(":");
12494
+ for (var m = d.split(`\r
12495
+ `), v = 0; v < m.length; v++) {
12496
+ var y = m[v], f = y.indexOf(":");
12496
12497
  if (f > 0) {
12497
12498
  var b = y.substring(0, f).trim(), h = y.substring(f + 1).trim();
12498
12499
  this.append(b, h);
12499
12500
  }
12500
12501
  }
12501
- }, c.prototype.delete = function(d, v) {
12502
- var m = i.normalizeName(d);
12503
- if (v === void 0)
12504
- delete this.headersMap[m];
12502
+ }, c.prototype.delete = function(d, m) {
12503
+ var v = i.normalizeName(d);
12504
+ if (m === void 0)
12505
+ delete this.headersMap[v];
12505
12506
  else {
12506
- var y = this.headersMap[m];
12507
+ var y = this.headersMap[v];
12507
12508
  if (y) {
12508
- var f = y.indexOf(v);
12509
- f >= 0 && y.splice(f, 1), y.length === 0 && delete this.headersMap[m];
12509
+ var f = y.indexOf(m);
12510
+ f >= 0 && y.splice(f, 1), y.length === 0 && delete this.headersMap[v];
12510
12511
  }
12511
12512
  }
12512
- }, c.prototype.append = function(d, v) {
12513
- var m = this, y = i.normalizeName(d);
12514
- Array.isArray(this.headersMap[y]) || (this.headersMap[y] = []), Array.isArray(v) ? v.forEach(function(f) {
12515
- m.headersMap[y].push(i.normalizeValue(f));
12516
- }) : this.headersMap[y].push(i.normalizeValue(v));
12517
- }, c.prototype.set = function(d, v) {
12518
- var m = i.normalizeName(d);
12519
- if (Array.isArray(v)) {
12513
+ }, c.prototype.append = function(d, m) {
12514
+ var v = this, y = i.normalizeName(d);
12515
+ Array.isArray(this.headersMap[y]) || (this.headersMap[y] = []), Array.isArray(m) ? m.forEach(function(f) {
12516
+ v.headersMap[y].push(i.normalizeValue(f));
12517
+ }) : this.headersMap[y].push(i.normalizeValue(m));
12518
+ }, c.prototype.set = function(d, m) {
12519
+ var v = i.normalizeName(d);
12520
+ if (Array.isArray(m)) {
12520
12521
  var y = [];
12521
- v.forEach(function(f) {
12522
+ m.forEach(function(f) {
12522
12523
  y.push(i.normalizeValue(f));
12523
- }), this.headersMap[m] = y;
12524
+ }), this.headersMap[v] = y;
12524
12525
  } else
12525
- this.headersMap[m] = [i.normalizeValue(v)];
12526
- }, c.prototype.has = function(d, v) {
12527
- var m = this.headersMap[i.normalizeName(d)];
12528
- if (!Array.isArray(m))
12526
+ this.headersMap[v] = [i.normalizeValue(m)];
12527
+ }, c.prototype.has = function(d, m) {
12528
+ var v = this.headersMap[i.normalizeName(d)];
12529
+ if (!Array.isArray(v))
12529
12530
  return !1;
12530
- if (v !== void 0) {
12531
- var y = i.normalizeValue(v);
12532
- return m.indexOf(y) >= 0;
12531
+ if (m !== void 0) {
12532
+ var y = i.normalizeValue(m);
12533
+ return v.indexOf(y) >= 0;
12533
12534
  }
12534
12535
  return !0;
12535
12536
  }, c.prototype.get = function(d) {
12536
- var v = this.headersMap[i.normalizeName(d)];
12537
- return v !== void 0 ? v.concat() : [];
12537
+ var m = this.headersMap[i.normalizeName(d)];
12538
+ return m !== void 0 ? m.concat() : [];
12538
12539
  }, c.prototype.forEach = function(d) {
12539
- var v = this;
12540
- Object.getOwnPropertyNames(this.headersMap).forEach(function(m) {
12541
- d(m, v.headersMap[m]);
12540
+ var m = this;
12541
+ Object.getOwnPropertyNames(this.headersMap).forEach(function(v) {
12542
+ d(v, m.headersMap[v]);
12542
12543
  }, this);
12543
12544
  }, c.prototype.toHeaders = function() {
12544
12545
  if (typeof Headers < "u") {
12545
12546
  var d = new Headers();
12546
- return this.forEach(function(v, m) {
12547
- m.forEach(function(y) {
12548
- d.append(v, y);
12547
+ return this.forEach(function(m, v) {
12548
+ v.forEach(function(y) {
12549
+ d.append(m, y);
12549
12550
  });
12550
12551
  }), d;
12551
12552
  }
@@ -12578,23 +12579,23 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
12578
12579
  var d = l;
12579
12580
  if (d instanceof Headers && d.getAll)
12580
12581
  return d.getAll(c);
12581
- var v = d.get(c);
12582
- return v && typeof v == "string" ? [v] : v;
12582
+ var m = d.get(c);
12583
+ return m && typeof m == "string" ? [m] : m;
12583
12584
  }, o.getHeaderKeys = function(l) {
12584
- var c = l, d = {}, v = [];
12585
- return c.keys ? i.iterateHeadersKeys(c, function(m) {
12586
- d[m] || (d[m] = !0, v.push(m));
12587
- }) : c.forEach ? c.forEach(function(m, y) {
12588
- d[y] || (d[y] = !0, v.push(y));
12589
- }) : i.iterateHeaders(c, function(m) {
12590
- var y = m[0];
12591
- d[y] || (d[y] = !0, v.push(y));
12592
- }), v;
12585
+ var c = l, d = {}, m = [];
12586
+ return c.keys ? i.iterateHeadersKeys(c, function(v) {
12587
+ d[v] || (d[v] = !0, m.push(v));
12588
+ }) : c.forEach ? c.forEach(function(v, y) {
12589
+ d[y] || (d[y] = !0, m.push(y));
12590
+ }) : i.iterateHeaders(c, function(v) {
12591
+ var y = v[0];
12592
+ d[y] || (d[y] = !0, m.push(y));
12593
+ }), m;
12593
12594
  }, o.splitHeaderValue = function(l) {
12594
12595
  var c = [];
12595
12596
  return l.split(", ").forEach(function(d) {
12596
- d.split(",").forEach(function(v) {
12597
- c.push(v);
12597
+ d.split(",").forEach(function(m) {
12598
+ c.push(m);
12598
12599
  });
12599
12600
  }), c;
12600
12601
  };
@@ -12618,10 +12619,10 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
12618
12619
  function d(f) {
12619
12620
  return f.getUint32(1, !1);
12620
12621
  }
12621
- function v(f, b, h) {
12622
+ function m(f, b, h) {
12622
12623
  return f.byteLength - b >= h;
12623
12624
  }
12624
- function m(f, b, h) {
12625
+ function v(f, b, h) {
12625
12626
  if (f.slice)
12626
12627
  return f.slice(b, h);
12627
12628
  var R = f.length;
@@ -12654,18 +12655,18 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
12654
12655
  else if (this.position === this.buffer.byteLength)
12655
12656
  this.buffer = b, this.position = 0;
12656
12657
  else {
12657
- var P = this.buffer.byteLength - this.position, D = new Uint8Array(P + b.byteLength), G = m(this.buffer, this.position);
12658
+ var P = this.buffer.byteLength - this.position, D = new Uint8Array(P + b.byteLength), G = v(this.buffer, this.position);
12658
12659
  D.set(G, 0);
12659
12660
  var z = new Uint8Array(b);
12660
12661
  D.set(z, P), this.buffer = D, this.position = 0;
12661
12662
  }
12662
12663
  for (; ; ) {
12663
- if (!v(this.buffer, this.position, 5))
12664
+ if (!m(this.buffer, this.position, 5))
12664
12665
  return O;
12665
- var x = m(this.buffer, this.position, this.position + 5), L = new DataView(x.buffer, x.byteOffset, x.byteLength), k = d(L);
12666
- if (!v(this.buffer, this.position, 5 + k))
12666
+ var x = v(this.buffer, this.position, this.position + 5), L = new DataView(x.buffer, x.byteOffset, x.byteLength), k = d(L);
12667
+ if (!m(this.buffer, this.position, 5 + k))
12667
12668
  return O;
12668
- var W = m(this.buffer, this.position + 5, this.position + 5 + k);
12669
+ var W = v(this.buffer, this.position + 5, this.position + 5 + k);
12669
12670
  if (this.position += 5 + k, c(L))
12670
12671
  return O.push({ chunkType: o.TRAILERS, trailers: (R = W, new r.Metadata(l(R))) }), O;
12671
12672
  O.push({ chunkType: o.MESSAGE, data: W });
@@ -12715,9 +12716,9 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
12715
12716
  Object.defineProperty(g, "__esModule", { value: !0 }), g.client = void 0;
12716
12717
  var o = p(65), r = p(617), i = p(8), l = p(346), c = p(57), d = p(882);
12717
12718
  g.client = function(y, f) {
12718
- return new v(y, f);
12719
+ return new m(y, f);
12719
12720
  };
12720
- var v = function() {
12721
+ var m = function() {
12721
12722
  function y(f, b) {
12722
12723
  this.started = !1, this.sentFirstMessage = !1, this.completed = !1, this.closed = !1, this.finishedSending = !1, this.onHeadersCallbacks = [], this.onMessageCallbacks = [], this.onEndCallbacks = [], this.parser = new r.ChunkParser(), this.methodDefinition = f, this.props = b, this.createTransport();
12723
12724
  }
@@ -12729,7 +12730,7 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
12729
12730
  this.props.debug && l.debug("grpc.onHeaders received after request was closed - ignoring");
12730
12731
  else if (b !== 0) {
12731
12732
  this.responseHeaders = f, this.props.debug && l.debug("onHeaders.responseHeaders", JSON.stringify(this.responseHeaders, null, 2));
12732
- var h = m(f);
12733
+ var h = v(f);
12733
12734
  this.props.debug && l.debug("onHeaders.gRPCStatus", h);
12734
12735
  var R = h && h >= 0 ? h : i.httpStatusToCode(b);
12735
12736
  this.props.debug && l.debug("onHeaders.code", R);
@@ -12762,7 +12763,7 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
12762
12763
  if (this.props.debug && l.debug("grpc.onEnd"), this.closed)
12763
12764
  this.props.debug && l.debug("grpc.onEnd received after request was closed - ignoring");
12764
12765
  else if (this.responseTrailers !== void 0) {
12765
- var f = m(this.responseTrailers);
12766
+ var f = v(this.responseTrailers);
12766
12767
  if (f !== null) {
12767
12768
  var b = this.responseTrailers.get("grpc-message"), h = this.decodeGRPCStatus(b[0]);
12768
12769
  this.rawOnEnd(f, h, this.responseTrailers);
@@ -12771,7 +12772,7 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
12771
12772
  } else {
12772
12773
  if (this.responseHeaders === void 0)
12773
12774
  return void this.rawOnError(i.Code.Unknown, "Response closed without headers");
12774
- var R = m(this.responseHeaders), O = this.responseHeaders.get("grpc-message");
12775
+ var R = v(this.responseHeaders), O = this.responseHeaders.get("grpc-message");
12775
12776
  if (this.props.debug && l.debug("grpc.headers only response ", R, O), R === null)
12776
12777
  return void this.rawOnEnd(i.Code.Unknown, "Response closed without grpc-status (Headers only)", this.responseHeaders);
12777
12778
  var P = this.decodeGRPCStatus(O[0]);
@@ -12871,7 +12872,7 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
12871
12872
  this.closed = !0, this.props.debug && l.debug("request.abort aborting request"), this.transport.cancel();
12872
12873
  }, y;
12873
12874
  }();
12874
- function m(y) {
12875
+ function v(y) {
12875
12876
  var f = y.get("grpc-status") || [];
12876
12877
  if (f.length > 0)
12877
12878
  try {
@@ -12890,8 +12891,8 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
12890
12891
  };
12891
12892
  }, 607: function(u, g, p) {
12892
12893
  Object.defineProperty(g, "__esModule", { value: !0 }), g.grpc = void 0;
12893
- var o, r = p(418), i = p(57), l = p(229), c = p(540), d = p(210), v = p(859), m = p(8), y = p(938), f = p(35), b = p(934);
12894
- (o = g.grpc || (g.grpc = {})).setDefaultTransport = i.setDefaultTransportFactory, o.CrossBrowserHttpTransport = v.CrossBrowserHttpTransport, o.FetchReadableStreamTransport = l.FetchReadableStreamTransport, o.XhrTransport = d.XhrTransport, o.WebsocketTransport = c.WebsocketTransport, o.Code = m.Code, o.Metadata = r.BrowserHeaders, o.client = function(h, R) {
12894
+ var o, r = p(418), i = p(57), l = p(229), c = p(540), d = p(210), m = p(859), v = p(8), y = p(938), f = p(35), b = p(934);
12895
+ (o = g.grpc || (g.grpc = {})).setDefaultTransport = i.setDefaultTransportFactory, o.CrossBrowserHttpTransport = m.CrossBrowserHttpTransport, o.FetchReadableStreamTransport = l.FetchReadableStreamTransport, o.XhrTransport = d.XhrTransport, o.WebsocketTransport = c.WebsocketTransport, o.Code = v.Code, o.Metadata = r.BrowserHeaders, o.client = function(h, R) {
12895
12896
  return b.client(h, R);
12896
12897
  }, o.invoke = y.invoke, o.unary = f.unary;
12897
12898
  }, 938: function(u, g, p) {
@@ -12924,8 +12925,8 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
12924
12925
  }, 229: function(u, g, p) {
12925
12926
  var o = this && this.__assign || function() {
12926
12927
  return (o = Object.assign || function(c) {
12927
- for (var d, v = 1, m = arguments.length; v < m; v++)
12928
- for (var y in d = arguments[v])
12928
+ for (var d, m = 1, v = arguments.length; m < v; m++)
12929
+ for (var y in d = arguments[m])
12929
12930
  Object.prototype.hasOwnProperty.call(d, y) && (c[y] = d[y]);
12930
12931
  return c;
12931
12932
  }).apply(this, arguments);
@@ -12934,36 +12935,36 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
12934
12935
  var r = p(65), i = p(346);
12935
12936
  g.FetchReadableStreamTransport = function(c) {
12936
12937
  return function(d) {
12937
- return function(v, m) {
12938
- return v.debug && i.debug("fetchRequest", v), new l(v, m);
12938
+ return function(m, v) {
12939
+ return m.debug && i.debug("fetchRequest", m), new l(m, v);
12939
12940
  }(d, c);
12940
12941
  };
12941
12942
  };
12942
12943
  var l = function() {
12943
- function c(d, v) {
12944
- this.cancelled = !1, this.controller = self.AbortController && new AbortController(), this.options = d, this.init = v;
12944
+ function c(d, m) {
12945
+ this.cancelled = !1, this.controller = self.AbortController && new AbortController(), this.options = d, this.init = m;
12945
12946
  }
12946
- return c.prototype.pump = function(d, v) {
12947
- var m = this;
12947
+ return c.prototype.pump = function(d, m) {
12948
+ var v = this;
12948
12949
  if (this.reader = d, this.cancelled)
12949
12950
  return this.options.debug && i.debug("Fetch.pump.cancel at first pump"), void this.reader.cancel().catch(function(y) {
12950
- m.options.debug && i.debug("Fetch.pump.reader.cancel exception", y);
12951
+ v.options.debug && i.debug("Fetch.pump.reader.cancel exception", y);
12951
12952
  });
12952
12953
  this.reader.read().then(function(y) {
12953
12954
  if (y.done)
12954
- return m.options.onEnd(), v;
12955
- m.options.onChunk(y.value), m.pump(m.reader, v);
12955
+ return v.options.onEnd(), m;
12956
+ v.options.onChunk(y.value), v.pump(v.reader, m);
12956
12957
  }).catch(function(y) {
12957
- m.cancelled ? m.options.debug && i.debug("Fetch.catch - request cancelled") : (m.cancelled = !0, m.options.debug && i.debug("Fetch.catch", y.message), m.options.onEnd(y));
12958
+ v.cancelled ? v.options.debug && i.debug("Fetch.catch - request cancelled") : (v.cancelled = !0, v.options.debug && i.debug("Fetch.catch", y.message), v.options.onEnd(y));
12958
12959
  });
12959
12960
  }, c.prototype.send = function(d) {
12960
- var v = this;
12961
- fetch(this.options.url, o(o({}, this.init), { headers: this.metadata.toHeaders(), method: "POST", body: d, signal: this.controller && this.controller.signal })).then(function(m) {
12962
- if (v.options.debug && i.debug("Fetch.response", m), v.options.onHeaders(new r.Metadata(m.headers), m.status), !m.body)
12963
- return m;
12964
- v.pump(m.body.getReader(), m);
12965
- }).catch(function(m) {
12966
- v.cancelled ? v.options.debug && i.debug("Fetch.catch - request cancelled") : (v.cancelled = !0, v.options.debug && i.debug("Fetch.catch", m.message), v.options.onEnd(m));
12961
+ var m = this;
12962
+ fetch(this.options.url, o(o({}, this.init), { headers: this.metadata.toHeaders(), method: "POST", body: d, signal: this.controller && this.controller.signal })).then(function(v) {
12963
+ if (m.options.debug && i.debug("Fetch.response", v), m.options.onHeaders(new r.Metadata(v.headers), v.status), !v.body)
12964
+ return v;
12965
+ m.pump(v.body.getReader(), v);
12966
+ }).catch(function(v) {
12967
+ m.cancelled ? m.options.debug && i.debug("Fetch.catch - request cancelled") : (m.cancelled = !0, m.options.debug && i.debug("Fetch.catch", v.message), m.options.onEnd(v));
12967
12968
  });
12968
12969
  }, c.prototype.sendMessage = function(d) {
12969
12970
  this.send(d);
@@ -12972,8 +12973,8 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
12972
12973
  this.metadata = d;
12973
12974
  }, c.prototype.cancel = function() {
12974
12975
  var d = this;
12975
- this.cancelled ? this.options.debug && i.debug("Fetch.cancel already cancelled") : (this.cancelled = !0, this.controller ? (this.options.debug && i.debug("Fetch.cancel.controller.abort"), this.controller.abort()) : this.options.debug && i.debug("Fetch.cancel.missing abort controller"), this.reader ? (this.options.debug && i.debug("Fetch.cancel.reader.cancel"), this.reader.cancel().catch(function(v) {
12976
- d.options.debug && i.debug("Fetch.cancel.reader.cancel exception", v);
12976
+ this.cancelled ? this.options.debug && i.debug("Fetch.cancel already cancelled") : (this.cancelled = !0, this.controller ? (this.options.debug && i.debug("Fetch.cancel.controller.abort"), this.controller.abort()) : this.options.debug && i.debug("Fetch.cancel.missing abort controller"), this.reader ? (this.options.debug && i.debug("Fetch.cancel.reader.cancel"), this.reader.cancel().catch(function(m) {
12977
+ d.options.debug && i.debug("Fetch.cancel.reader.cancel exception", m);
12977
12978
  })) : this.options.debug && i.debug("Fetch.cancel before reader"));
12978
12979
  }, c;
12979
12980
  }();
@@ -13009,7 +13010,7 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
13009
13010
  g.XhrTransport = function(f) {
13010
13011
  return function(b) {
13011
13012
  if (c.detectMozXHRSupport())
13012
- return new v(b, f);
13013
+ return new m(b, f);
13013
13014
  if (c.detectXHROverrideMimeTypeSupport())
13014
13015
  return new d(b, f);
13015
13016
  throw new Error("This environment's XHR implementation cannot support binary transfer.");
@@ -13048,7 +13049,7 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
13048
13049
  }, f;
13049
13050
  }();
13050
13051
  g.XHR = d;
13051
- var v = function(f) {
13052
+ var m = function(f) {
13052
13053
  function b() {
13053
13054
  return f !== null && f.apply(this, arguments) || this;
13054
13055
  }
@@ -13059,7 +13060,7 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
13059
13060
  this.options.debug && l.debug("MozXHR.onProgressEvent: ", new Uint8Array(h)), this.options.onChunk(new Uint8Array(h));
13060
13061
  }, b;
13061
13062
  }(d);
13062
- function m(f, b) {
13063
+ function v(f, b) {
13063
13064
  var h = f.charCodeAt(b);
13064
13065
  if (h >= 55296 && h <= 56319) {
13065
13066
  var R = f.charCodeAt(b + 1);
@@ -13069,12 +13070,12 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
13069
13070
  }
13070
13071
  function y(f) {
13071
13072
  for (var b = new Uint8Array(f.length), h = 0, R = 0; R < f.length; R++) {
13072
- var O = String.prototype.codePointAt ? f.codePointAt(R) : m(f, R);
13073
+ var O = String.prototype.codePointAt ? f.codePointAt(R) : v(f, R);
13073
13074
  b[h++] = 255 & O;
13074
13075
  }
13075
13076
  return b;
13076
13077
  }
13077
- g.MozChunkedArrayBufferXHR = v, g.stringToArrayBuffer = y;
13078
+ g.MozChunkedArrayBufferXHR = m, g.stringToArrayBuffer = y;
13078
13079
  }, 849: function(u, g) {
13079
13080
  var p;
13080
13081
  function o() {
@@ -13115,7 +13116,7 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
13115
13116
  return function(c) {
13116
13117
  return function(d) {
13117
13118
  d.debug && r.debug("websocketRequest", d);
13118
- var v, m = function(b) {
13119
+ var m, v = function(b) {
13119
13120
  if (b.substr(0, 8) === "https://")
13120
13121
  return "wss://" + b.substr(8);
13121
13122
  if (b.substr(0, 7) === "http://")
@@ -13124,34 +13125,34 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
13124
13125
  }(d.url), y = [];
13125
13126
  function f(b) {
13126
13127
  if (b === o.FINISH_SEND)
13127
- v.send(l);
13128
+ m.send(l);
13128
13129
  else {
13129
13130
  var h = b, R = new Int8Array(h.byteLength + 1);
13130
- R.set(new Uint8Array([0])), R.set(h, 1), v.send(R);
13131
+ R.set(new Uint8Array([0])), R.set(h, 1), m.send(R);
13131
13132
  }
13132
13133
  }
13133
13134
  return { sendMessage: function(b) {
13134
- v && v.readyState !== v.CONNECTING ? f(b) : y.push(b);
13135
+ m && m.readyState !== m.CONNECTING ? f(b) : y.push(b);
13135
13136
  }, finishSend: function() {
13136
- v && v.readyState !== v.CONNECTING ? f(o.FINISH_SEND) : y.push(o.FINISH_SEND);
13137
+ m && m.readyState !== m.CONNECTING ? f(o.FINISH_SEND) : y.push(o.FINISH_SEND);
13137
13138
  }, start: function(b) {
13138
- (v = new WebSocket(m, ["grpc-websockets"])).binaryType = "arraybuffer", v.onopen = function() {
13139
+ (m = new WebSocket(v, ["grpc-websockets"])).binaryType = "arraybuffer", m.onopen = function() {
13139
13140
  var h;
13140
- d.debug && r.debug("websocketRequest.onopen"), v.send((h = "", b.forEach(function(R, O) {
13141
+ d.debug && r.debug("websocketRequest.onopen"), m.send((h = "", b.forEach(function(R, O) {
13141
13142
  h += R + ": " + O.join(", ") + `\r
13142
13143
  `;
13143
13144
  }), i.encodeASCII(h))), y.forEach(function(R) {
13144
13145
  f(R);
13145
13146
  });
13146
- }, v.onclose = function(h) {
13147
+ }, m.onclose = function(h) {
13147
13148
  d.debug && r.debug("websocketRequest.onclose", h), d.onEnd();
13148
- }, v.onerror = function(h) {
13149
+ }, m.onerror = function(h) {
13149
13150
  d.debug && r.debug("websocketRequest.onerror", h);
13150
- }, v.onmessage = function(h) {
13151
+ }, m.onmessage = function(h) {
13151
13152
  d.onChunk(new Uint8Array(h.data));
13152
13153
  };
13153
13154
  }, cancel: function() {
13154
- d.debug && r.debug("websocket.abort"), v.close();
13155
+ d.debug && r.debug("websocket.abort"), m.close();
13155
13156
  } };
13156
13157
  }(c);
13157
13158
  };
@@ -13164,15 +13165,15 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
13164
13165
  throw new Error(".unary cannot be used with server-streaming methods. Use .invoke or .client instead.");
13165
13166
  if (i.requestStream)
13166
13167
  throw new Error(".unary cannot be used with client-streaming methods. Use .client instead.");
13167
- var c = null, d = null, v = r.client(i, { host: l.host, transport: l.transport, debug: l.debug });
13168
- return v.onHeaders(function(m) {
13169
- c = m;
13170
- }), v.onMessage(function(m) {
13171
- d = m;
13172
- }), v.onEnd(function(m, y, f) {
13173
- l.onEnd({ status: m, statusMessage: y, headers: c || new o.Metadata(), message: d, trailers: f });
13174
- }), v.start(l.metadata), v.send(l.request), v.finishSend(), { close: function() {
13175
- v.close();
13168
+ var c = null, d = null, m = r.client(i, { host: l.host, transport: l.transport, debug: l.debug });
13169
+ return m.onHeaders(function(v) {
13170
+ c = v;
13171
+ }), m.onMessage(function(v) {
13172
+ d = v;
13173
+ }), m.onEnd(function(v, y, f) {
13174
+ l.onEnd({ status: v, statusMessage: y, headers: c || new o.Metadata(), message: d, trailers: f });
13175
+ }), m.start(l.metadata), m.send(l.request), m.finishSend(), { close: function() {
13176
+ m.close();
13176
13177
  } };
13177
13178
  };
13178
13179
  }, 882: function(u, g) {
@@ -13202,6 +13203,41 @@ const promisify = function(t, e) {
13202
13203
  y: t.getY(),
13203
13204
  z: t.getZ()
13204
13205
  };
13206
+ }, encodePose = (t) => {
13207
+ const e = new common_pb.Pose();
13208
+ return e.setX(t.x), e.setY(t.y), e.setZ(t.z), e.setOX(t.oX), e.setOY(t.oY), e.setOZ(t.oZ), e.setTheta(t.theta), e;
13209
+ }, encodePoseInFrame = (t) => {
13210
+ if (!t.pose)
13211
+ throw new Error("no pose");
13212
+ const e = new common_pb.PoseInFrame();
13213
+ return e.setPose(encodePose(t.pose)), e.setReferenceFrame(t.referenceFrame), e;
13214
+ }, encodeResourceName = (t) => {
13215
+ const e = new common_pb.ResourceName();
13216
+ return e.setNamespace(t.namespace), e.setType(t.type), e.setSubtype(t.subtype), e.setName(t.name), e;
13217
+ }, encodeGeometry = (t) => {
13218
+ const e = new common_pb.Geometry();
13219
+ if (t.center !== void 0 && e.setCenter(encodePose(t.center)), t.sphere !== void 0) {
13220
+ const s = new common_pb.Sphere();
13221
+ s.setRadiusMm(t.sphere.radiusMm), e.setSphere(s);
13222
+ }
13223
+ if (t.box !== void 0) {
13224
+ const s = new common_pb.RectangularPrism();
13225
+ t.box.dimsMm !== void 0 && s.setDimsMm(encodeVector3D(t.box.dimsMm)), e.setBox(s);
13226
+ }
13227
+ if (t.capsule !== void 0) {
13228
+ const s = new common_pb.Capsule();
13229
+ s.setLengthMm(t.capsule.lengthMm), s.setRadiusMm(t.capsule.radiusMm), e.setCapsule(s);
13230
+ }
13231
+ return e;
13232
+ }, encodeGeometriesInFrame = (t) => {
13233
+ const e = new common_pb.GeometriesInFrame();
13234
+ return e.setReferenceFrame(t.referenceFrame), e.setGeometriesList(t.geometriesList.map(encodeGeometry)), e;
13235
+ }, encodeTransform = (t) => {
13236
+ const e = new common_pb.Transform();
13237
+ return e.setReferenceFrame(t.referenceFrame), t.physicalObject !== void 0 && e.setPhysicalObject(encodeGeometry(t.physicalObject)), t.poseInObserverFrame !== void 0 && e.setPoseInObserverFrame(encodePoseInFrame(t.poseInObserverFrame)), e;
13238
+ }, encodeWorldState = (t) => {
13239
+ const e = new common_pb.WorldState();
13240
+ return e.setObstaclesList(t.obstaclesList.map(encodeGeometriesInFrame)), e.setTransformsList(t.transformsList.map(encodeTransform)), e;
13205
13241
  };
13206
13242
  var __webpack_modules__ = { 37: function(t) {
13207
13243
  t.exports = function(e) {
@@ -13249,58 +13285,58 @@ var __webpack_modules__ = { 37: function(t) {
13249
13285
  }, function(e, s, n) {
13250
13286
  Object.defineProperty(s, "__esModule", { value: !0 });
13251
13287
  var u = n(0), g = n(8), p = n(9), o = n(1), r = n(4), i = n(14);
13252
- s.client = function(d, v) {
13253
- return new l(d, v);
13288
+ s.client = function(d, m) {
13289
+ return new l(d, m);
13254
13290
  };
13255
13291
  var l = function() {
13256
- function d(v, m) {
13257
- this.started = !1, this.sentFirstMessage = !1, this.completed = !1, this.closed = !1, this.finishedSending = !1, this.onHeadersCallbacks = [], this.onMessageCallbacks = [], this.onEndCallbacks = [], this.parser = new g.ChunkParser(), this.methodDefinition = v, this.props = m, this.createTransport();
13292
+ function d(m, v) {
13293
+ this.started = !1, this.sentFirstMessage = !1, this.completed = !1, this.closed = !1, this.finishedSending = !1, this.onHeadersCallbacks = [], this.onMessageCallbacks = [], this.onEndCallbacks = [], this.parser = new g.ChunkParser(), this.methodDefinition = m, this.props = v, this.createTransport();
13258
13294
  }
13259
13295
  return d.prototype.createTransport = function() {
13260
- var v = this.props.host + "/" + this.methodDefinition.service.serviceName + "/" + this.methodDefinition.methodName, m = { methodDefinition: this.methodDefinition, debug: this.props.debug || !1, url: v, onHeaders: this.onTransportHeaders.bind(this), onChunk: this.onTransportChunk.bind(this), onEnd: this.onTransportEnd.bind(this) };
13261
- this.props.transport ? this.transport = this.props.transport(m) : this.transport = r.makeDefaultTransport(m);
13262
- }, d.prototype.onTransportHeaders = function(v, m) {
13263
- if (this.props.debug && o.debug("onHeaders", v, m), this.closed)
13296
+ var m = this.props.host + "/" + this.methodDefinition.service.serviceName + "/" + this.methodDefinition.methodName, v = { methodDefinition: this.methodDefinition, debug: this.props.debug || !1, url: m, onHeaders: this.onTransportHeaders.bind(this), onChunk: this.onTransportChunk.bind(this), onEnd: this.onTransportEnd.bind(this) };
13297
+ this.props.transport ? this.transport = this.props.transport(v) : this.transport = r.makeDefaultTransport(v);
13298
+ }, d.prototype.onTransportHeaders = function(m, v) {
13299
+ if (this.props.debug && o.debug("onHeaders", m, v), this.closed)
13264
13300
  this.props.debug && o.debug("grpc.onHeaders received after request was closed - ignoring");
13265
- else if (m !== 0) {
13266
- this.responseHeaders = v, this.props.debug && o.debug("onHeaders.responseHeaders", JSON.stringify(this.responseHeaders, null, 2));
13267
- var y = c(v);
13301
+ else if (v !== 0) {
13302
+ this.responseHeaders = m, this.props.debug && o.debug("onHeaders.responseHeaders", JSON.stringify(this.responseHeaders, null, 2));
13303
+ var y = c(m);
13268
13304
  this.props.debug && o.debug("onHeaders.gRPCStatus", y);
13269
- var f = y && y >= 0 ? y : p.httpStatusToCode(m);
13305
+ var f = y && y >= 0 ? y : p.httpStatusToCode(v);
13270
13306
  this.props.debug && o.debug("onHeaders.code", f);
13271
- var b = v.get("grpc-message") || [];
13272
- if (this.props.debug && o.debug("onHeaders.gRPCMessage", b), this.rawOnHeaders(v), f !== p.Code.OK) {
13307
+ var b = m.get("grpc-message") || [];
13308
+ if (this.props.debug && o.debug("onHeaders.gRPCMessage", b), this.rawOnHeaders(m), f !== p.Code.OK) {
13273
13309
  var h = this.decodeGRPCStatus(b[0]);
13274
- this.rawOnError(f, h, v);
13310
+ this.rawOnError(f, h, m);
13275
13311
  }
13276
13312
  }
13277
- }, d.prototype.onTransportChunk = function(v) {
13278
- var m = this;
13313
+ }, d.prototype.onTransportChunk = function(m) {
13314
+ var v = this;
13279
13315
  if (this.closed)
13280
13316
  this.props.debug && o.debug("grpc.onChunk received after request was closed - ignoring");
13281
13317
  else {
13282
13318
  var y = [];
13283
13319
  try {
13284
- y = this.parser.parse(v);
13320
+ y = this.parser.parse(m);
13285
13321
  } catch (f) {
13286
13322
  return this.props.debug && o.debug("onChunk.parsing error", f, f.message), void this.rawOnError(p.Code.Internal, "parsing error: " + f.message);
13287
13323
  }
13288
13324
  y.forEach(function(f) {
13289
13325
  if (f.chunkType === g.ChunkType.MESSAGE) {
13290
- var b = m.methodDefinition.responseType.deserializeBinary(f.data);
13291
- m.rawOnMessage(b);
13326
+ var b = v.methodDefinition.responseType.deserializeBinary(f.data);
13327
+ v.rawOnMessage(b);
13292
13328
  } else
13293
- f.chunkType === g.ChunkType.TRAILERS && (m.responseHeaders ? (m.responseTrailers = new u.Metadata(f.trailers), m.props.debug && o.debug("onChunk.trailers", m.responseTrailers)) : (m.responseHeaders = new u.Metadata(f.trailers), m.rawOnHeaders(m.responseHeaders)));
13329
+ f.chunkType === g.ChunkType.TRAILERS && (v.responseHeaders ? (v.responseTrailers = new u.Metadata(f.trailers), v.props.debug && o.debug("onChunk.trailers", v.responseTrailers)) : (v.responseHeaders = new u.Metadata(f.trailers), v.rawOnHeaders(v.responseHeaders)));
13294
13330
  });
13295
13331
  }
13296
13332
  }, d.prototype.onTransportEnd = function() {
13297
13333
  if (this.props.debug && o.debug("grpc.onEnd"), this.closed)
13298
13334
  this.props.debug && o.debug("grpc.onEnd received after request was closed - ignoring");
13299
13335
  else if (this.responseTrailers !== void 0) {
13300
- var v = c(this.responseTrailers);
13301
- if (v !== null) {
13302
- var m = this.responseTrailers.get("grpc-message"), y = this.decodeGRPCStatus(m[0]);
13303
- this.rawOnEnd(v, y, this.responseTrailers);
13336
+ var m = c(this.responseTrailers);
13337
+ if (m !== null) {
13338
+ var v = this.responseTrailers.get("grpc-message"), y = this.decodeGRPCStatus(v[0]);
13339
+ this.rawOnEnd(m, y, this.responseTrailers);
13304
13340
  } else
13305
13341
  this.rawOnError(p.Code.Internal, "Response closed without grpc-status (Trailers provided)");
13306
13342
  } else {
@@ -13312,73 +13348,73 @@ var __webpack_modules__ = { 37: function(t) {
13312
13348
  var h = this.decodeGRPCStatus(b[0]);
13313
13349
  this.rawOnEnd(f, h, this.responseHeaders);
13314
13350
  }
13315
- }, d.prototype.decodeGRPCStatus = function(v) {
13316
- if (!v)
13351
+ }, d.prototype.decodeGRPCStatus = function(m) {
13352
+ if (!m)
13317
13353
  return "";
13318
13354
  try {
13319
- return decodeURIComponent(v);
13355
+ return decodeURIComponent(m);
13320
13356
  } catch {
13321
- return v;
13357
+ return m;
13322
13358
  }
13323
- }, d.prototype.rawOnEnd = function(v, m, y) {
13359
+ }, d.prototype.rawOnEnd = function(m, v, y) {
13324
13360
  var f = this;
13325
- this.props.debug && o.debug("rawOnEnd", v, m, y), this.completed || (this.completed = !0, this.onEndCallbacks.forEach(function(b) {
13361
+ this.props.debug && o.debug("rawOnEnd", m, v, y), this.completed || (this.completed = !0, this.onEndCallbacks.forEach(function(b) {
13326
13362
  if (!f.closed)
13327
13363
  try {
13328
- b(v, m, y);
13364
+ b(m, v, y);
13329
13365
  } catch (h) {
13330
13366
  setTimeout(function() {
13331
13367
  throw h;
13332
13368
  });
13333
13369
  }
13334
13370
  }));
13335
- }, d.prototype.rawOnHeaders = function(v) {
13336
- this.props.debug && o.debug("rawOnHeaders", v), this.completed || this.onHeadersCallbacks.forEach(function(m) {
13371
+ }, d.prototype.rawOnHeaders = function(m) {
13372
+ this.props.debug && o.debug("rawOnHeaders", m), this.completed || this.onHeadersCallbacks.forEach(function(v) {
13337
13373
  try {
13338
- m(v);
13374
+ v(m);
13339
13375
  } catch (y) {
13340
13376
  setTimeout(function() {
13341
13377
  throw y;
13342
13378
  });
13343
13379
  }
13344
13380
  });
13345
- }, d.prototype.rawOnError = function(v, m, y) {
13381
+ }, d.prototype.rawOnError = function(m, v, y) {
13346
13382
  var f = this;
13347
- y === void 0 && (y = new u.Metadata()), this.props.debug && o.debug("rawOnError", v, m), this.completed || (this.completed = !0, this.onEndCallbacks.forEach(function(b) {
13383
+ y === void 0 && (y = new u.Metadata()), this.props.debug && o.debug("rawOnError", m, v), this.completed || (this.completed = !0, this.onEndCallbacks.forEach(function(b) {
13348
13384
  if (!f.closed)
13349
13385
  try {
13350
- b(v, m, y);
13386
+ b(m, v, y);
13351
13387
  } catch (h) {
13352
13388
  setTimeout(function() {
13353
13389
  throw h;
13354
13390
  });
13355
13391
  }
13356
13392
  }));
13357
- }, d.prototype.rawOnMessage = function(v) {
13358
- var m = this;
13359
- this.props.debug && o.debug("rawOnMessage", v.toObject()), this.completed || this.closed || this.onMessageCallbacks.forEach(function(y) {
13360
- if (!m.closed)
13393
+ }, d.prototype.rawOnMessage = function(m) {
13394
+ var v = this;
13395
+ this.props.debug && o.debug("rawOnMessage", m.toObject()), this.completed || this.closed || this.onMessageCallbacks.forEach(function(y) {
13396
+ if (!v.closed)
13361
13397
  try {
13362
- y(v);
13398
+ y(m);
13363
13399
  } catch (f) {
13364
13400
  setTimeout(function() {
13365
13401
  throw f;
13366
13402
  });
13367
13403
  }
13368
13404
  });
13369
- }, d.prototype.onHeaders = function(v) {
13370
- this.onHeadersCallbacks.push(v);
13371
- }, d.prototype.onMessage = function(v) {
13372
- this.onMessageCallbacks.push(v);
13373
- }, d.prototype.onEnd = function(v) {
13374
- this.onEndCallbacks.push(v);
13375
- }, d.prototype.start = function(v) {
13405
+ }, d.prototype.onHeaders = function(m) {
13406
+ this.onHeadersCallbacks.push(m);
13407
+ }, d.prototype.onMessage = function(m) {
13408
+ this.onMessageCallbacks.push(m);
13409
+ }, d.prototype.onEnd = function(m) {
13410
+ this.onEndCallbacks.push(m);
13411
+ }, d.prototype.start = function(m) {
13376
13412
  if (this.started)
13377
13413
  throw new Error("Client already started - cannot .start()");
13378
13414
  this.started = !0;
13379
- var m = new u.Metadata(v || {});
13380
- m.set("content-type", "application/grpc-web+proto"), m.set("x-grpc-web", "1"), this.transport.start(m);
13381
- }, d.prototype.send = function(v) {
13415
+ var v = new u.Metadata(m || {});
13416
+ v.set("content-type", "application/grpc-web+proto"), v.set("x-grpc-web", "1"), this.transport.start(v);
13417
+ }, d.prototype.send = function(m) {
13382
13418
  if (!this.started)
13383
13419
  throw new Error("Client not started - .start() must be called before .send()");
13384
13420
  if (this.closed)
@@ -13388,8 +13424,8 @@ var __webpack_modules__ = { 37: function(t) {
13388
13424
  if (!this.methodDefinition.requestStream && this.sentFirstMessage)
13389
13425
  throw new Error("Message already sent for non-client-streaming method - cannot .send()");
13390
13426
  this.sentFirstMessage = !0;
13391
- var m = i.frameRequest(v);
13392
- this.transport.sendMessage(m);
13427
+ var v = i.frameRequest(m);
13428
+ this.transport.sendMessage(v);
13393
13429
  }, d.prototype.finishSend = function() {
13394
13430
  if (!this.started)
13395
13431
  throw new Error("Client not started - .finishSend() must be called before .close()");
@@ -13407,11 +13443,11 @@ var __webpack_modules__ = { 37: function(t) {
13407
13443
  }, d;
13408
13444
  }();
13409
13445
  function c(d) {
13410
- var v = d.get("grpc-status") || [];
13411
- if (v.length > 0)
13446
+ var m = d.get("grpc-status") || [];
13447
+ if (m.length > 0)
13412
13448
  try {
13413
- var m = v[0];
13414
- return parseInt(m, 10);
13449
+ var v = m[0];
13450
+ return parseInt(v, 10);
13415
13451
  } catch {
13416
13452
  return null;
13417
13453
  }
@@ -13447,63 +13483,63 @@ var __webpack_modules__ = { 37: function(t) {
13447
13483
  var r = o(3), i = function() {
13448
13484
  function l(c, d) {
13449
13485
  c === void 0 && (c = {}), d === void 0 && (d = { splitValues: !1 });
13450
- var v, m = this;
13486
+ var m, v = this;
13451
13487
  this.headersMap = {}, c && (typeof Headers < "u" && c instanceof Headers ? r.getHeaderKeys(c).forEach(function(y) {
13452
13488
  r.getHeaderValues(c, y).forEach(function(f) {
13453
- d.splitValues ? m.append(y, r.splitHeaderValue(f)) : m.append(y, f);
13489
+ d.splitValues ? v.append(y, r.splitHeaderValue(f)) : v.append(y, f);
13454
13490
  });
13455
- }) : typeof (v = c) == "object" && typeof v.headersMap == "object" && typeof v.forEach == "function" ? c.forEach(function(y, f) {
13456
- m.append(y, f);
13491
+ }) : typeof (m = c) == "object" && typeof m.headersMap == "object" && typeof m.forEach == "function" ? c.forEach(function(y, f) {
13492
+ v.append(y, f);
13457
13493
  }) : typeof Map < "u" && c instanceof Map ? c.forEach(function(y, f) {
13458
- m.append(f, y);
13494
+ v.append(f, y);
13459
13495
  }) : typeof c == "string" ? this.appendFromString(c) : typeof c == "object" && Object.getOwnPropertyNames(c).forEach(function(y) {
13460
13496
  var f = c[y];
13461
13497
  Array.isArray(f) ? f.forEach(function(b) {
13462
- m.append(y, b);
13463
- }) : m.append(y, f);
13498
+ v.append(y, b);
13499
+ }) : v.append(y, f);
13464
13500
  }));
13465
13501
  }
13466
13502
  return l.prototype.appendFromString = function(c) {
13467
13503
  for (var d = c.split(`\r
13468
- `), v = 0; v < d.length; v++) {
13469
- var m = d[v], y = m.indexOf(":");
13504
+ `), m = 0; m < d.length; m++) {
13505
+ var v = d[m], y = v.indexOf(":");
13470
13506
  if (y > 0) {
13471
- var f = m.substring(0, y).trim(), b = m.substring(y + 1).trim();
13507
+ var f = v.substring(0, y).trim(), b = v.substring(y + 1).trim();
13472
13508
  this.append(f, b);
13473
13509
  }
13474
13510
  }
13475
13511
  }, l.prototype.delete = function(c, d) {
13476
- var v = r.normalizeName(c);
13512
+ var m = r.normalizeName(c);
13477
13513
  if (d === void 0)
13478
- delete this.headersMap[v];
13514
+ delete this.headersMap[m];
13479
13515
  else {
13480
- var m = this.headersMap[v];
13481
- if (m) {
13482
- var y = m.indexOf(d);
13483
- y >= 0 && m.splice(y, 1), m.length === 0 && delete this.headersMap[v];
13516
+ var v = this.headersMap[m];
13517
+ if (v) {
13518
+ var y = v.indexOf(d);
13519
+ y >= 0 && v.splice(y, 1), v.length === 0 && delete this.headersMap[m];
13484
13520
  }
13485
13521
  }
13486
13522
  }, l.prototype.append = function(c, d) {
13487
- var v = this, m = r.normalizeName(c);
13488
- Array.isArray(this.headersMap[m]) || (this.headersMap[m] = []), Array.isArray(d) ? d.forEach(function(y) {
13489
- v.headersMap[m].push(r.normalizeValue(y));
13490
- }) : this.headersMap[m].push(r.normalizeValue(d));
13523
+ var m = this, v = r.normalizeName(c);
13524
+ Array.isArray(this.headersMap[v]) || (this.headersMap[v] = []), Array.isArray(d) ? d.forEach(function(y) {
13525
+ m.headersMap[v].push(r.normalizeValue(y));
13526
+ }) : this.headersMap[v].push(r.normalizeValue(d));
13491
13527
  }, l.prototype.set = function(c, d) {
13492
- var v = r.normalizeName(c);
13528
+ var m = r.normalizeName(c);
13493
13529
  if (Array.isArray(d)) {
13494
- var m = [];
13530
+ var v = [];
13495
13531
  d.forEach(function(y) {
13496
- m.push(r.normalizeValue(y));
13497
- }), this.headersMap[v] = m;
13532
+ v.push(r.normalizeValue(y));
13533
+ }), this.headersMap[m] = v;
13498
13534
  } else
13499
- this.headersMap[v] = [r.normalizeValue(d)];
13535
+ this.headersMap[m] = [r.normalizeValue(d)];
13500
13536
  }, l.prototype.has = function(c, d) {
13501
- var v = this.headersMap[r.normalizeName(c)];
13502
- if (!Array.isArray(v))
13537
+ var m = this.headersMap[r.normalizeName(c)];
13538
+ if (!Array.isArray(m))
13503
13539
  return !1;
13504
13540
  if (d !== void 0) {
13505
- var m = r.normalizeValue(d);
13506
- return v.indexOf(m) >= 0;
13541
+ var v = r.normalizeValue(d);
13542
+ return m.indexOf(v) >= 0;
13507
13543
  }
13508
13544
  return !0;
13509
13545
  }, l.prototype.get = function(c) {
@@ -13511,15 +13547,15 @@ var __webpack_modules__ = { 37: function(t) {
13511
13547
  return d !== void 0 ? d.concat() : [];
13512
13548
  }, l.prototype.forEach = function(c) {
13513
13549
  var d = this;
13514
- Object.getOwnPropertyNames(this.headersMap).forEach(function(v) {
13515
- c(v, d.headersMap[v]);
13550
+ Object.getOwnPropertyNames(this.headersMap).forEach(function(m) {
13551
+ c(m, d.headersMap[m]);
13516
13552
  }, this);
13517
13553
  }, l.prototype.toHeaders = function() {
13518
13554
  if (typeof Headers < "u") {
13519
13555
  var c = new Headers();
13520
- return this.forEach(function(d, v) {
13521
- v.forEach(function(m) {
13522
- c.append(d, m);
13556
+ return this.forEach(function(d, m) {
13557
+ m.forEach(function(v) {
13558
+ c.append(d, v);
13523
13559
  });
13524
13560
  }), c;
13525
13561
  }
@@ -13556,13 +13592,13 @@ var __webpack_modules__ = { 37: function(t) {
13556
13592
  return d && typeof d == "string" ? [d] : d;
13557
13593
  }, p.getHeaderKeys = function(i) {
13558
13594
  var l = i, c = {}, d = [];
13559
- return l.keys ? r.iterateHeadersKeys(l, function(v) {
13560
- c[v] || (c[v] = !0, d.push(v));
13561
- }) : l.forEach ? l.forEach(function(v, m) {
13562
- c[m] || (c[m] = !0, d.push(m));
13563
- }) : r.iterateHeaders(l, function(v) {
13564
- var m = v[0];
13595
+ return l.keys ? r.iterateHeadersKeys(l, function(m) {
13565
13596
  c[m] || (c[m] = !0, d.push(m));
13597
+ }) : l.forEach ? l.forEach(function(m, v) {
13598
+ c[v] || (c[v] = !0, d.push(v));
13599
+ }) : r.iterateHeaders(l, function(m) {
13600
+ var v = m[0];
13601
+ c[v] || (c[v] = !0, d.push(v));
13566
13602
  }), d;
13567
13603
  }, p.splitHeaderValue = function(i) {
13568
13604
  var l = [];
@@ -13649,149 +13685,149 @@ var __webpack_modules__ = { 37: function(t) {
13649
13685
  return typeof Response < "u" && Response.prototype.hasOwnProperty("body") && typeof Headers == "function";
13650
13686
  };
13651
13687
  }, function(e, s, n) {
13652
- var u, g = this && this.__extends || (u = function(v, m) {
13688
+ var u, g = this && this.__extends || (u = function(m, v) {
13653
13689
  return (u = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(y, f) {
13654
13690
  y.__proto__ = f;
13655
13691
  } || function(y, f) {
13656
13692
  for (var b in f)
13657
13693
  f.hasOwnProperty(b) && (y[b] = f[b]);
13658
- })(v, m);
13659
- }, function(v, m) {
13694
+ })(m, v);
13695
+ }, function(m, v) {
13660
13696
  function y() {
13661
- this.constructor = v;
13697
+ this.constructor = m;
13662
13698
  }
13663
- u(v, m), v.prototype = m === null ? Object.create(m) : (y.prototype = m.prototype, new y());
13699
+ u(m, v), m.prototype = v === null ? Object.create(v) : (y.prototype = v.prototype, new y());
13664
13700
  });
13665
13701
  Object.defineProperty(s, "__esModule", { value: !0 });
13666
13702
  var p = n(0), o = n(1), r = n(11);
13667
- s.XhrTransport = function(v) {
13668
- return function(m) {
13703
+ s.XhrTransport = function(m) {
13704
+ return function(v) {
13669
13705
  if (r.detectMozXHRSupport())
13670
- return new l(m, v);
13706
+ return new l(v, m);
13671
13707
  if (r.detectXHROverrideMimeTypeSupport())
13672
- return new i(m, v);
13708
+ return new i(v, m);
13673
13709
  throw new Error("This environment's XHR implementation cannot support binary transfer.");
13674
13710
  };
13675
13711
  };
13676
13712
  var i = function() {
13677
- function v(m, y) {
13678
- this.options = m, this.init = y;
13713
+ function m(v, y) {
13714
+ this.options = v, this.init = y;
13679
13715
  }
13680
- return v.prototype.onProgressEvent = function() {
13716
+ return m.prototype.onProgressEvent = function() {
13681
13717
  this.options.debug && o.debug("XHR.onProgressEvent.length: ", this.xhr.response.length);
13682
- var m = this.xhr.response.substr(this.index);
13718
+ var v = this.xhr.response.substr(this.index);
13683
13719
  this.index = this.xhr.response.length;
13684
- var y = d(m);
13720
+ var y = d(v);
13685
13721
  this.options.onChunk(y);
13686
- }, v.prototype.onLoadEvent = function() {
13722
+ }, m.prototype.onLoadEvent = function() {
13687
13723
  this.options.debug && o.debug("XHR.onLoadEvent"), this.options.onEnd();
13688
- }, v.prototype.onStateChange = function() {
13724
+ }, m.prototype.onStateChange = function() {
13689
13725
  this.options.debug && o.debug("XHR.onStateChange", this.xhr.readyState), this.xhr.readyState === XMLHttpRequest.HEADERS_RECEIVED && this.options.onHeaders(new p.Metadata(this.xhr.getAllResponseHeaders()), this.xhr.status);
13690
- }, v.prototype.sendMessage = function(m) {
13691
- this.xhr.send(m);
13692
- }, v.prototype.finishSend = function() {
13693
- }, v.prototype.start = function(m) {
13726
+ }, m.prototype.sendMessage = function(v) {
13727
+ this.xhr.send(v);
13728
+ }, m.prototype.finishSend = function() {
13729
+ }, m.prototype.start = function(v) {
13694
13730
  var y = this;
13695
- this.metadata = m;
13731
+ this.metadata = v;
13696
13732
  var f = new XMLHttpRequest();
13697
13733
  this.xhr = f, f.open("POST", this.options.url), this.configureXhr(), this.metadata.forEach(function(b, h) {
13698
13734
  f.setRequestHeader(b, h.join(", "));
13699
13735
  }), f.withCredentials = !!this.init.withCredentials, f.addEventListener("readystatechange", this.onStateChange.bind(this)), f.addEventListener("progress", this.onProgressEvent.bind(this)), f.addEventListener("loadend", this.onLoadEvent.bind(this)), f.addEventListener("error", function(b) {
13700
13736
  y.options.debug && o.debug("XHR.error", b), y.options.onEnd(b.error);
13701
13737
  });
13702
- }, v.prototype.configureXhr = function() {
13738
+ }, m.prototype.configureXhr = function() {
13703
13739
  this.xhr.responseType = "text", this.xhr.overrideMimeType("text/plain; charset=x-user-defined");
13704
- }, v.prototype.cancel = function() {
13740
+ }, m.prototype.cancel = function() {
13705
13741
  this.options.debug && o.debug("XHR.abort"), this.xhr.abort();
13706
- }, v;
13742
+ }, m;
13707
13743
  }();
13708
13744
  s.XHR = i;
13709
- var l = function(v) {
13710
- function m() {
13711
- return v !== null && v.apply(this, arguments) || this;
13745
+ var l = function(m) {
13746
+ function v() {
13747
+ return m !== null && m.apply(this, arguments) || this;
13712
13748
  }
13713
- return g(m, v), m.prototype.configureXhr = function() {
13749
+ return g(v, m), v.prototype.configureXhr = function() {
13714
13750
  this.options.debug && o.debug("MozXHR.configureXhr: setting responseType to 'moz-chunked-arraybuffer'"), this.xhr.responseType = "moz-chunked-arraybuffer";
13715
- }, m.prototype.onProgressEvent = function() {
13751
+ }, v.prototype.onProgressEvent = function() {
13716
13752
  var y = this.xhr.response;
13717
13753
  this.options.debug && o.debug("MozXHR.onProgressEvent: ", new Uint8Array(y)), this.options.onChunk(new Uint8Array(y));
13718
- }, m;
13754
+ }, v;
13719
13755
  }(i);
13720
- function c(v, m) {
13721
- var y = v.charCodeAt(m);
13756
+ function c(m, v) {
13757
+ var y = m.charCodeAt(v);
13722
13758
  if (y >= 55296 && y <= 56319) {
13723
- var f = v.charCodeAt(m + 1);
13759
+ var f = m.charCodeAt(v + 1);
13724
13760
  f >= 56320 && f <= 57343 && (y = 65536 + (y - 55296 << 10) + (f - 56320));
13725
13761
  }
13726
13762
  return y;
13727
13763
  }
13728
- function d(v) {
13729
- for (var m = new Uint8Array(v.length), y = 0, f = 0; f < v.length; f++) {
13730
- var b = String.prototype.codePointAt ? v.codePointAt(f) : c(v, f);
13731
- m[y++] = 255 & b;
13764
+ function d(m) {
13765
+ for (var v = new Uint8Array(m.length), y = 0, f = 0; f < m.length; f++) {
13766
+ var b = String.prototype.codePointAt ? m.codePointAt(f) : c(m, f);
13767
+ v[y++] = 255 & b;
13732
13768
  }
13733
- return m;
13769
+ return v;
13734
13770
  }
13735
13771
  s.MozChunkedArrayBufferXHR = l, s.stringToArrayBuffer = d;
13736
13772
  }, function(e, s, n) {
13737
13773
  Object.defineProperty(s, "__esModule", { value: !0 });
13738
13774
  var u, g = n(0);
13739
- function p(v) {
13740
- return function(m) {
13741
- return m === 9 || m === 10 || m === 13;
13742
- }(v) || v >= 32 && v <= 126;
13775
+ function p(m) {
13776
+ return function(v) {
13777
+ return v === 9 || v === 10 || v === 13;
13778
+ }(m) || m >= 32 && m <= 126;
13743
13779
  }
13744
- function o(v) {
13745
- for (var m = 0; m !== v.length; ++m)
13746
- if (!p(v[m]))
13780
+ function o(m) {
13781
+ for (var v = 0; v !== m.length; ++v)
13782
+ if (!p(m[v]))
13747
13783
  throw new Error("Metadata is not valid (printable) ASCII");
13748
- return String.fromCharCode.apply(String, Array.prototype.slice.call(v));
13784
+ return String.fromCharCode.apply(String, Array.prototype.slice.call(m));
13749
13785
  }
13750
- function r(v) {
13751
- return (128 & v.getUint8(0)) == 128;
13786
+ function r(m) {
13787
+ return (128 & m.getUint8(0)) == 128;
13752
13788
  }
13753
- function i(v) {
13754
- return v.getUint32(1, !1);
13789
+ function i(m) {
13790
+ return m.getUint32(1, !1);
13755
13791
  }
13756
- function l(v, m, y) {
13757
- return v.byteLength - m >= y;
13792
+ function l(m, v, y) {
13793
+ return m.byteLength - v >= y;
13758
13794
  }
13759
- function c(v, m, y) {
13760
- if (v.slice)
13761
- return v.slice(m, y);
13762
- var f = v.length;
13795
+ function c(m, v, y) {
13796
+ if (m.slice)
13797
+ return m.slice(v, y);
13798
+ var f = m.length;
13763
13799
  y !== void 0 && (f = y);
13764
- for (var b = new Uint8Array(f - m), h = 0, R = m; R < f; R++)
13765
- b[h++] = v[R];
13800
+ for (var b = new Uint8Array(f - v), h = 0, R = v; R < f; R++)
13801
+ b[h++] = m[R];
13766
13802
  return b;
13767
13803
  }
13768
- s.decodeASCII = o, s.encodeASCII = function(v) {
13769
- for (var m = new Uint8Array(v.length), y = 0; y !== v.length; ++y) {
13770
- var f = v.charCodeAt(y);
13804
+ s.decodeASCII = o, s.encodeASCII = function(m) {
13805
+ for (var v = new Uint8Array(m.length), y = 0; y !== m.length; ++y) {
13806
+ var f = m.charCodeAt(y);
13771
13807
  if (!p(f))
13772
13808
  throw new Error("Metadata contains invalid ASCII");
13773
- m[y] = f;
13809
+ v[y] = f;
13774
13810
  }
13775
- return m;
13776
- }, function(v) {
13777
- v[v.MESSAGE = 1] = "MESSAGE", v[v.TRAILERS = 2] = "TRAILERS";
13811
+ return v;
13812
+ }, function(m) {
13813
+ m[m.MESSAGE = 1] = "MESSAGE", m[m.TRAILERS = 2] = "TRAILERS";
13778
13814
  }(u = s.ChunkType || (s.ChunkType = {}));
13779
13815
  var d = function() {
13780
- function v() {
13816
+ function m() {
13781
13817
  this.buffer = null, this.position = 0;
13782
13818
  }
13783
- return v.prototype.parse = function(m, y) {
13784
- if (m.length === 0 && y)
13819
+ return m.prototype.parse = function(v, y) {
13820
+ if (v.length === 0 && y)
13785
13821
  return [];
13786
13822
  var f, b = [];
13787
13823
  if (this.buffer == null)
13788
- this.buffer = m, this.position = 0;
13824
+ this.buffer = v, this.position = 0;
13789
13825
  else if (this.position === this.buffer.byteLength)
13790
- this.buffer = m, this.position = 0;
13826
+ this.buffer = v, this.position = 0;
13791
13827
  else {
13792
- var h = this.buffer.byteLength - this.position, R = new Uint8Array(h + m.byteLength), O = c(this.buffer, this.position);
13828
+ var h = this.buffer.byteLength - this.position, R = new Uint8Array(h + v.byteLength), O = c(this.buffer, this.position);
13793
13829
  R.set(O, 0);
13794
- var P = new Uint8Array(m);
13830
+ var P = new Uint8Array(v);
13795
13831
  R.set(P, h), this.buffer = R, this.position = 0;
13796
13832
  }
13797
13833
  for (; ; ) {
@@ -13805,7 +13841,7 @@ var __webpack_modules__ = { 37: function(t) {
13805
13841
  return b.push({ chunkType: u.TRAILERS, trailers: (f = x, new g.Metadata(o(f))) }), b;
13806
13842
  b.push({ chunkType: u.MESSAGE, data: x });
13807
13843
  }
13808
- }, v;
13844
+ }, m;
13809
13845
  }();
13810
13846
  s.ChunkParser = d;
13811
13847
  }, function(e, s, n) {
@@ -13847,11 +13883,11 @@ var __webpack_modules__ = { 37: function(t) {
13847
13883
  };
13848
13884
  }, function(e, s, n) {
13849
13885
  Object.defineProperty(s, "__esModule", { value: !0 });
13850
- var u = n(3), g = n(4), p = n(6), o = n(12), r = n(7), i = n(5), l = n(9), c = n(13), d = n(15), v = n(2);
13851
- (function(m) {
13852
- m.setDefaultTransport = g.setDefaultTransportFactory, m.CrossBrowserHttpTransport = i.CrossBrowserHttpTransport, m.FetchReadableStreamTransport = p.FetchReadableStreamTransport, m.XhrTransport = r.XhrTransport, m.WebsocketTransport = o.WebsocketTransport, m.Code = l.Code, m.Metadata = u.BrowserHeaders, m.client = function(y, f) {
13853
- return v.client(y, f);
13854
- }, m.invoke = c.invoke, m.unary = d.unary;
13886
+ var u = n(3), g = n(4), p = n(6), o = n(12), r = n(7), i = n(5), l = n(9), c = n(13), d = n(15), m = n(2);
13887
+ (function(v) {
13888
+ v.setDefaultTransport = g.setDefaultTransportFactory, v.CrossBrowserHttpTransport = i.CrossBrowserHttpTransport, v.FetchReadableStreamTransport = p.FetchReadableStreamTransport, v.XhrTransport = r.XhrTransport, v.WebsocketTransport = o.WebsocketTransport, v.Code = l.Code, v.Metadata = u.BrowserHeaders, v.client = function(y, f) {
13889
+ return m.client(y, f);
13890
+ }, v.invoke = c.invoke, v.unary = d.unary;
13855
13891
  })(s.grpc || (s.grpc = {}));
13856
13892
  }, function(e, s, n) {
13857
13893
  var u;
@@ -13892,33 +13928,33 @@ var __webpack_modules__ = { 37: function(t) {
13892
13928
  return function(r) {
13893
13929
  return function(i) {
13894
13930
  i.debug && g.debug("websocketRequest", i);
13895
- var l, c = function(m) {
13896
- if (m.substr(0, 8) === "https://")
13897
- return "wss://" + m.substr(8);
13898
- if (m.substr(0, 7) === "http://")
13899
- return "ws://" + m.substr(7);
13931
+ var l, c = function(v) {
13932
+ if (v.substr(0, 8) === "https://")
13933
+ return "wss://" + v.substr(8);
13934
+ if (v.substr(0, 7) === "http://")
13935
+ return "ws://" + v.substr(7);
13900
13936
  throw new Error("Websocket transport constructed with non-https:// or http:// host.");
13901
13937
  }(i.url), d = [];
13902
- function v(m) {
13903
- if (m === u.FINISH_SEND)
13938
+ function m(v) {
13939
+ if (v === u.FINISH_SEND)
13904
13940
  l.send(o);
13905
13941
  else {
13906
- var y = m, f = new Int8Array(y.byteLength + 1);
13942
+ var y = v, f = new Int8Array(y.byteLength + 1);
13907
13943
  f.set(new Uint8Array([0])), f.set(y, 1), l.send(f);
13908
13944
  }
13909
13945
  }
13910
- return { sendMessage: function(m) {
13911
- l && l.readyState !== l.CONNECTING ? v(m) : d.push(m);
13946
+ return { sendMessage: function(v) {
13947
+ l && l.readyState !== l.CONNECTING ? m(v) : d.push(v);
13912
13948
  }, finishSend: function() {
13913
- l && l.readyState !== l.CONNECTING ? v(u.FINISH_SEND) : d.push(u.FINISH_SEND);
13914
- }, start: function(m) {
13949
+ l && l.readyState !== l.CONNECTING ? m(u.FINISH_SEND) : d.push(u.FINISH_SEND);
13950
+ }, start: function(v) {
13915
13951
  (l = new WebSocket(c, ["grpc-websockets"])).binaryType = "arraybuffer", l.onopen = function() {
13916
13952
  var y;
13917
- i.debug && g.debug("websocketRequest.onopen"), l.send((y = "", m.forEach(function(f, b) {
13953
+ i.debug && g.debug("websocketRequest.onopen"), l.send((y = "", v.forEach(function(f, b) {
13918
13954
  y += f + ": " + b.join(", ") + `\r
13919
13955
  `;
13920
13956
  }), p.encodeASCII(y))), d.forEach(function(f) {
13921
- v(f);
13957
+ m(f);
13922
13958
  });
13923
13959
  }, l.onclose = function(y) {
13924
13960
  i.debug && g.debug("websocketRequest.onclose", y), i.onEnd();
@@ -13962,8 +13998,8 @@ var __webpack_modules__ = { 37: function(t) {
13962
13998
  r = c;
13963
13999
  }), l.onMessage(function(c) {
13964
14000
  i = c;
13965
- }), l.onEnd(function(c, d, v) {
13966
- o.onEnd({ status: c, statusMessage: d, headers: r || new u.Metadata(), message: i, trailers: v });
14001
+ }), l.onEnd(function(c, d, m) {
14002
+ o.onEnd({ status: c, statusMessage: d, headers: r || new u.Metadata(), message: i, trailers: m });
13967
14003
  }), l.start(o.metadata), l.send(o.request), l.finishSend(), { close: function() {
13968
14004
  l.close();
13969
14005
  } };
@@ -20178,67 +20214,67 @@ var __webpack_modules__ = { 37: function(t) {
20178
20214
  }, 138: (t, e, s) => {
20179
20215
  Object.defineProperty(e, "__esModule", { value: !0 }), e.ClientChannel = void 0;
20180
20216
  var n = s(655), u = s(662), g = s(417), p = s(758), o = s(210), r = function(l) {
20181
- function c(d, v) {
20182
- var m = l.call(this, d, v) || this;
20183
- return Object.defineProperty(m, "streamIDCounter", { enumerable: !0, configurable: !0, writable: !0, value: 0 }), Object.defineProperty(m, "streams", { enumerable: !0, configurable: !0, writable: !0, value: {} }), v.onmessage = function(y) {
20184
- return m.onChannelMessage(y);
20217
+ function c(d, m) {
20218
+ var v = l.call(this, d, m) || this;
20219
+ return Object.defineProperty(v, "streamIDCounter", { enumerable: !0, configurable: !0, writable: !0, value: 0 }), Object.defineProperty(v, "streams", { enumerable: !0, configurable: !0, writable: !0, value: {} }), m.onmessage = function(y) {
20220
+ return v.onChannelMessage(y);
20185
20221
  }, d.addEventListener("iceconnectionstatechange", function() {
20186
20222
  var y = d.iceConnectionState;
20187
- y !== "failed" && y !== "disconnected" && y !== "closed" || m.onConnectionTerminated();
20188
- }), v.addEventListener("close", function() {
20189
- return m.onConnectionTerminated();
20190
- }), m;
20223
+ y !== "failed" && y !== "disconnected" && y !== "closed" || v.onConnectionTerminated();
20224
+ }), m.addEventListener("close", function() {
20225
+ return v.onConnectionTerminated();
20226
+ }), v;
20191
20227
  }
20192
20228
  return n.__extends(c, l), Object.defineProperty(c.prototype, "transportFactory", { enumerable: !1, configurable: !0, writable: !0, value: function() {
20193
20229
  var d = this;
20194
- return function(v) {
20195
- return d.newStream(d.nextStreamID(), v);
20230
+ return function(m) {
20231
+ return d.newStream(d.nextStreamID(), m);
20196
20232
  };
20197
20233
  } }), Object.defineProperty(c.prototype, "onConnectionTerminated", { enumerable: !1, configurable: !0, writable: !0, value: function() {
20198
20234
  this.closeWithReason(new p.ConnectionClosedError("data channel closed"));
20199
20235
  var d = new p.ConnectionClosedError("connection terminated");
20200
- for (var v in this.streams)
20201
- this.streams[v].cs.closeWithRecvError(d);
20236
+ for (var m in this.streams)
20237
+ this.streams[m].cs.closeWithRecvError(d);
20202
20238
  } }), Object.defineProperty(c.prototype, "onChannelMessage", { enumerable: !1, configurable: !0, writable: !0, value: function(d) {
20203
- var v;
20239
+ var m;
20204
20240
  try {
20205
- v = o.Response.deserializeBinary(d.data);
20241
+ m = o.Response.deserializeBinary(d.data);
20206
20242
  } catch (b) {
20207
20243
  return void console.error("error deserializing message", b);
20208
20244
  }
20209
- var m = v.getStream();
20210
- if (m !== void 0) {
20211
- var y = m.getId(), f = this.streams[y];
20212
- f !== void 0 ? f.cs.onResponse(v) : console.error("no stream for id; discarding", "id", y);
20245
+ var v = m.getStream();
20246
+ if (v !== void 0) {
20247
+ var y = v.getId(), f = this.streams[y];
20248
+ f !== void 0 ? f.cs.onResponse(m) : console.error("no stream for id; discarding", "id", y);
20213
20249
  } else
20214
20250
  console.error("no stream id; discarding");
20215
20251
  } }), Object.defineProperty(c.prototype, "nextStreamID", { enumerable: !1, configurable: !0, writable: !0, value: function() {
20216
20252
  var d = new o.Stream();
20217
20253
  return d.setId(this.streamIDCounter++), d;
20218
- } }), Object.defineProperty(c.prototype, "newStream", { enumerable: !1, configurable: !0, writable: !0, value: function(d, v) {
20219
- var m = this;
20254
+ } }), Object.defineProperty(c.prototype, "newStream", { enumerable: !1, configurable: !0, writable: !0, value: function(d, m) {
20255
+ var v = this;
20220
20256
  if (this.isClosed())
20221
- return new i(new p.ConnectionClosedError("connection closed"), v);
20257
+ return new i(new p.ConnectionClosedError("connection closed"), m);
20222
20258
  var y = this.streams[d.getId()];
20223
20259
  if (y === void 0) {
20224
20260
  if (Object.keys(this.streams).length > 256)
20225
- return new i(new Error("stream limit hit"), v);
20261
+ return new i(new Error("stream limit hit"), m);
20226
20262
  y = { cs: new g.ClientStream(this, d, function(f) {
20227
- return m.removeStreamByID(f);
20228
- }, v) }, this.streams[d.getId()] = y;
20263
+ return v.removeStreamByID(f);
20264
+ }, m) }, this.streams[d.getId()] = y;
20229
20265
  }
20230
20266
  return y.cs;
20231
20267
  } }), Object.defineProperty(c.prototype, "removeStreamByID", { enumerable: !1, configurable: !0, writable: !0, value: function(d) {
20232
20268
  delete this.streams[d];
20233
- } }), Object.defineProperty(c.prototype, "writeHeaders", { enumerable: !1, configurable: !0, writable: !0, value: function(d, v) {
20234
- var m = new o.Request();
20235
- m.setStream(d), m.setHeaders(v), this.write(m);
20236
- } }), Object.defineProperty(c.prototype, "writeMessage", { enumerable: !1, configurable: !0, writable: !0, value: function(d, v) {
20237
- var m = new o.Request();
20238
- m.setStream(d), m.setMessage(v), this.write(m);
20239
- } }), Object.defineProperty(c.prototype, "writeReset", { enumerable: !1, configurable: !0, writable: !0, value: function(d) {
20269
+ } }), Object.defineProperty(c.prototype, "writeHeaders", { enumerable: !1, configurable: !0, writable: !0, value: function(d, m) {
20240
20270
  var v = new o.Request();
20241
- v.setStream(d), v.setRstStream(!0), this.write(v);
20271
+ v.setStream(d), v.setHeaders(m), this.write(v);
20272
+ } }), Object.defineProperty(c.prototype, "writeMessage", { enumerable: !1, configurable: !0, writable: !0, value: function(d, m) {
20273
+ var v = new o.Request();
20274
+ v.setStream(d), v.setMessage(m), this.write(v);
20275
+ } }), Object.defineProperty(c.prototype, "writeReset", { enumerable: !1, configurable: !0, writable: !0, value: function(d) {
20276
+ var m = new o.Request();
20277
+ m.setStream(d), m.setRstStream(!0), this.write(m);
20242
20278
  } }), c;
20243
20279
  }(u.BaseChannel);
20244
20280
  e.ClientChannel = r;
@@ -20259,74 +20295,74 @@ var __webpack_modules__ = { 37: function(t) {
20259
20295
  }, 417: (t, e, s) => {
20260
20296
  Object.defineProperty(e, "__esModule", { value: !0 }), e.encodeASCII = e.ClientStream = void 0;
20261
20297
  var n = s(655), u = s(37), g = s(370), p = s(758), o = s(210), r = function(d) {
20262
- function v(m, y, f, b) {
20298
+ function m(v, y, f, b) {
20263
20299
  var h = d.call(this, y, f, b) || this;
20264
- return Object.defineProperty(h, "channel", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), Object.defineProperty(h, "headersReceived", { enumerable: !0, configurable: !0, writable: !0, value: !1 }), Object.defineProperty(h, "trailersReceived", { enumerable: !0, configurable: !0, writable: !0, value: !1 }), h.channel = m, h;
20300
+ return Object.defineProperty(h, "channel", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), Object.defineProperty(h, "headersReceived", { enumerable: !0, configurable: !0, writable: !0, value: !1 }), Object.defineProperty(h, "trailersReceived", { enumerable: !0, configurable: !0, writable: !0, value: !1 }), h.channel = v, h;
20265
20301
  }
20266
- return n.__extends(v, d), Object.defineProperty(v.prototype, "start", { enumerable: !1, configurable: !0, writable: !0, value: function(m) {
20302
+ return n.__extends(m, d), Object.defineProperty(m.prototype, "start", { enumerable: !1, configurable: !0, writable: !0, value: function(v) {
20267
20303
  var y = "/".concat(this.opts.methodDefinition.service.serviceName, "/").concat(this.opts.methodDefinition.methodName), f = new o.RequestHeaders();
20268
- f.setMethod(y), f.setMetadata(l(m));
20304
+ f.setMethod(y), f.setMetadata(l(v));
20269
20305
  try {
20270
20306
  this.channel.writeHeaders(this.stream, f);
20271
20307
  } catch (b) {
20272
20308
  console.error("error writing headers", b), this.closeWithRecvError(b);
20273
20309
  }
20274
- } }), Object.defineProperty(v.prototype, "sendMessage", { enumerable: !1, configurable: !0, writable: !0, value: function(m) {
20275
- m ? this.writeMessage(!1, m.slice(5)) : this.writeMessage(!1, void 0);
20276
- } }), Object.defineProperty(v.prototype, "resetStream", { enumerable: !1, configurable: !0, writable: !0, value: function() {
20310
+ } }), Object.defineProperty(m.prototype, "sendMessage", { enumerable: !1, configurable: !0, writable: !0, value: function(v) {
20311
+ v ? this.writeMessage(!1, v.slice(5)) : this.writeMessage(!1, void 0);
20312
+ } }), Object.defineProperty(m.prototype, "resetStream", { enumerable: !1, configurable: !0, writable: !0, value: function() {
20277
20313
  try {
20278
20314
  this.channel.writeReset(this.stream);
20279
- } catch (m) {
20280
- console.error("error writing reset", m), this.closeWithRecvError(m);
20315
+ } catch (v) {
20316
+ console.error("error writing reset", v), this.closeWithRecvError(v);
20281
20317
  }
20282
- } }), Object.defineProperty(v.prototype, "finishSend", { enumerable: !1, configurable: !0, writable: !0, value: function() {
20318
+ } }), Object.defineProperty(m.prototype, "finishSend", { enumerable: !1, configurable: !0, writable: !0, value: function() {
20283
20319
  this.opts.methodDefinition.requestStream && this.writeMessage(!0, void 0);
20284
- } }), Object.defineProperty(v.prototype, "cancel", { enumerable: !1, configurable: !0, writable: !0, value: function() {
20320
+ } }), Object.defineProperty(m.prototype, "cancel", { enumerable: !1, configurable: !0, writable: !0, value: function() {
20285
20321
  this.closed || this.resetStream();
20286
- } }), Object.defineProperty(v.prototype, "writeMessage", { enumerable: !1, configurable: !0, writable: !0, value: function(m, y) {
20322
+ } }), Object.defineProperty(m.prototype, "writeMessage", { enumerable: !1, configurable: !0, writable: !0, value: function(v, y) {
20287
20323
  try {
20288
20324
  if (!y || y.length == 0)
20289
- return (f = new o.PacketMessage()).setEom(!0), (b = new o.RequestMessage()).setHasMessage(!!y), b.setPacketMessage(f), b.setEos(m), void this.channel.writeMessage(this.stream, b);
20325
+ return (f = new o.PacketMessage()).setEom(!0), (b = new o.RequestMessage()).setHasMessage(!!y), b.setPacketMessage(f), b.setEos(v), void this.channel.writeMessage(this.stream, b);
20290
20326
  for (; y.length !== 0; ) {
20291
20327
  var f, b, h = Math.min(y.length, 16373);
20292
- (f = new o.PacketMessage()).setData(y.slice(0, h)), (y = y.slice(h)).length === 0 && f.setEom(!0), (b = new o.RequestMessage()).setHasMessage(!!y), b.setPacketMessage(f), b.setEos(m), this.channel.writeMessage(this.stream, b);
20328
+ (f = new o.PacketMessage()).setData(y.slice(0, h)), (y = y.slice(h)).length === 0 && f.setEom(!0), (b = new o.RequestMessage()).setHasMessage(!!y), b.setPacketMessage(f), b.setEos(v), this.channel.writeMessage(this.stream, b);
20293
20329
  }
20294
20330
  } catch (R) {
20295
20331
  console.error("error writing message", R), this.closeWithRecvError(R);
20296
20332
  }
20297
- } }), Object.defineProperty(v.prototype, "onResponse", { enumerable: !1, configurable: !0, writable: !0, value: function(m) {
20298
- switch (m.getTypeCase()) {
20333
+ } }), Object.defineProperty(m.prototype, "onResponse", { enumerable: !1, configurable: !0, writable: !0, value: function(v) {
20334
+ switch (v.getTypeCase()) {
20299
20335
  case o.Response.TypeCase.HEADERS:
20300
20336
  if (this.headersReceived)
20301
20337
  return void this.closeWithRecvError(new Error("headers already received"));
20302
20338
  if (this.trailersReceived)
20303
20339
  return void this.closeWithRecvError(new Error("headers received after trailers"));
20304
- this.processHeaders(m.getHeaders());
20340
+ this.processHeaders(v.getHeaders());
20305
20341
  break;
20306
20342
  case o.Response.TypeCase.MESSAGE:
20307
20343
  if (!this.headersReceived)
20308
20344
  return void this.closeWithRecvError(new Error("headers not yet received"));
20309
20345
  if (this.trailersReceived)
20310
20346
  return void this.closeWithRecvError(new Error("headers received after trailers"));
20311
- this.processMessage(m.getMessage());
20347
+ this.processMessage(v.getMessage());
20312
20348
  break;
20313
20349
  case o.Response.TypeCase.TRAILERS:
20314
- this.processTrailers(m.getTrailers());
20350
+ this.processTrailers(v.getTrailers());
20315
20351
  break;
20316
20352
  default:
20317
- console.error("unknown response type", m.getTypeCase());
20353
+ console.error("unknown response type", v.getTypeCase());
20318
20354
  }
20319
- } }), Object.defineProperty(v.prototype, "processHeaders", { enumerable: !1, configurable: !0, writable: !0, value: function(m) {
20320
- this.headersReceived = !0, this.opts.onHeaders(c(m.getMetadata()), 200);
20321
- } }), Object.defineProperty(v.prototype, "processMessage", { enumerable: !1, configurable: !0, writable: !0, value: function(m) {
20322
- var y = d.prototype.processPacketMessage.call(this, m.getPacketMessage());
20355
+ } }), Object.defineProperty(m.prototype, "processHeaders", { enumerable: !1, configurable: !0, writable: !0, value: function(v) {
20356
+ this.headersReceived = !0, this.opts.onHeaders(c(v.getMetadata()), 200);
20357
+ } }), Object.defineProperty(m.prototype, "processMessage", { enumerable: !1, configurable: !0, writable: !0, value: function(v) {
20358
+ var y = d.prototype.processPacketMessage.call(this, v.getPacketMessage());
20323
20359
  if (y) {
20324
20360
  var f = new ArrayBuffer(y.length + 5);
20325
20361
  new DataView(f, 1, 4).setUint32(0, y.length, !1), new Uint8Array(f, 5).set(y), this.opts.onChunk(new Uint8Array(f));
20326
20362
  }
20327
- } }), Object.defineProperty(v.prototype, "processTrailers", { enumerable: !1, configurable: !0, writable: !0, value: function(m) {
20363
+ } }), Object.defineProperty(m.prototype, "processTrailers", { enumerable: !1, configurable: !0, writable: !0, value: function(v) {
20328
20364
  this.trailersReceived = !0;
20329
- var y, f, b = c(m.getMetadata()), h = m.getStatus();
20365
+ var y, f, b = c(v.getMetadata()), h = v.getStatus();
20330
20366
  h ? (y = h.getCode(), f = h.getMessage(), b.set("grpc-status", "".concat(h.getCode())), f !== void 0 && b.set("grpc-message", h.getMessage())) : (y = 0, b.set("grpc-status", "0"), f = "");
20331
20367
  var R = function(P) {
20332
20368
  var D = "";
@@ -20336,12 +20372,12 @@ var __webpack_modules__ = { 37: function(t) {
20336
20372
  }), i(D);
20337
20373
  }(b), O = new ArrayBuffer(R.length + 5);
20338
20374
  new DataView(O, 0, 1).setUint8(0, 128), new DataView(O, 1, 4).setUint32(0, R.length, !1), new Uint8Array(O, 5).set(R), this.opts.onChunk(new Uint8Array(O)), y !== 0 ? this.closeWithRecvError(new p.GRPCError(y, f)) : this.closeWithRecvError();
20339
- } }), v;
20375
+ } }), m;
20340
20376
  }(g.BaseStream);
20341
20377
  function i(d) {
20342
- for (var v, m, y = new Uint8Array(d.length), f = 0; f !== d.length; ++f) {
20378
+ for (var m, v, y = new Uint8Array(d.length), f = 0; f !== d.length; ++f) {
20343
20379
  var b = d.charCodeAt(f);
20344
- if (!((v = m = b) === 9 || v === 10 || v === 13 || m >= 32 && m <= 126))
20380
+ if (!((m = v = b) === 9 || m === 10 || m === 13 || v >= 32 && v <= 126))
20345
20381
  throw new Error("Metadata contains invalid ASCII");
20346
20382
  y[f] = b;
20347
20383
  }
@@ -20350,23 +20386,23 @@ var __webpack_modules__ = { 37: function(t) {
20350
20386
  e.ClientStream = r, e.encodeASCII = i;
20351
20387
  var l = function(d) {
20352
20388
  if (d) {
20353
- var v = new o.Metadata(), m = v.getMdMap();
20389
+ var m = new o.Metadata(), v = m.getMdMap();
20354
20390
  if (d.forEach(function(y, f) {
20355
20391
  var b = new o.Strings();
20356
- b.setValuesList(f), m.set(y, b);
20357
- }), v.getMdMap().getLength() !== 0)
20358
- return v;
20392
+ b.setValuesList(f), v.set(y, b);
20393
+ }), m.getMdMap().getLength() !== 0)
20394
+ return m;
20359
20395
  }
20360
20396
  }, c = function(d) {
20361
- var v = new u.grpc.Metadata();
20362
- return d && d.getMdMap().forEach(function(m, y) {
20363
- return v.append(y, m.getValuesList());
20364
- }), v;
20397
+ var m = new u.grpc.Metadata();
20398
+ return d && d.getMdMap().forEach(function(v, y) {
20399
+ return m.append(y, v.getValuesList());
20400
+ }), m;
20365
20401
  };
20366
20402
  }, 512: (t, e, s) => {
20367
20403
  Object.defineProperty(e, "__esModule", { value: !0 }), e.dialWebRTC = e.dialDirect = void 0;
20368
- var n = s(655), u = s(37), g = s(138), p = s(758), o = s(743), r = s(34), i = s(165), l = s(400), c = s(982), d = s(958), v = s(93);
20369
- function m(h, R) {
20404
+ var n = s(655), u = s(37), g = s(138), p = s(758), o = s(743), r = s(34), i = s(165), l = s(400), c = s(982), d = s(958), m = s(93);
20405
+ function v(h, R) {
20370
20406
  return n.__awaiter(this, void 0, void 0, function() {
20371
20407
  var O, P;
20372
20408
  return n.__generator(this, function(D) {
@@ -20425,7 +20461,7 @@ var __webpack_modules__ = { 37: function(t) {
20425
20461
  });
20426
20462
  });
20427
20463
  }
20428
- e.dialDirect = m;
20464
+ e.dialDirect = v;
20429
20465
  var f = function() {
20430
20466
  function h(R, O, P) {
20431
20467
  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 = R, this.extraMetadata = P, this.transport = O(R);
@@ -20474,11 +20510,11 @@ var __webpack_modules__ = { 37: function(t) {
20474
20510
  return n.__generator(this, function(J) {
20475
20511
  switch (J.label) {
20476
20512
  case 0:
20477
- return b(O), W = O?.webrtcOptions, [4, (0, v.newPeerConnectionForClient)(W !== void 0 && W.disableTrickleICE, W?.rtcConfig)];
20513
+ return b(O), W = O?.webrtcOptions, [4, (0, m.newPeerConnectionForClient)(W !== void 0 && W.disableTrickleICE, W?.rtcConfig)];
20478
20514
  case 1:
20479
20515
  X = J.sent(), S = X.pc, M = X.dc, _ = !1, J.label = 2;
20480
20516
  case 2:
20481
- return J.trys.push([2, , 9, 10]), E = O, O && (E = n.__assign({}, O), O.accessToken || (E.authEntity = (P = O?.webrtcOptions) === null || P === void 0 ? void 0 : P.signalingAuthEntity, E.authEntity || (E.externalAuthAddress ? E.authEntity = (D = O.externalAuthAddress) === null || D === void 0 ? void 0 : D.replace(/^(.*:\/\/)/, "") : E.authEntity = h.replace(/^(.*:\/\/)/, "")), E.credentials = (G = O?.webrtcOptions) === null || G === void 0 ? void 0 : G.signalingCredentials, E.accessToken = (z = O?.webrtcOptions) === null || z === void 0 ? void 0 : z.signalingAccessToken), E.externalAuthAddress = (x = O?.webrtcOptions) === null || x === void 0 ? void 0 : x.signalingExternalAuthAddress, E.externalAuthToEntity = (L = O?.webrtcOptions) === null || L === void 0 ? void 0 : L.signalingExternalAuthToEntity), [4, m(h, E)];
20517
+ return J.trys.push([2, , 9, 10]), E = O, O && (E = n.__assign({}, O), O.accessToken || (E.authEntity = (P = O?.webrtcOptions) === null || P === void 0 ? void 0 : P.signalingAuthEntity, E.authEntity || (E.externalAuthAddress ? E.authEntity = (D = O.externalAuthAddress) === null || D === void 0 ? void 0 : D.replace(/^(.*:\/\/)/, "") : E.authEntity = h.replace(/^(.*:\/\/)/, "")), E.credentials = (G = O?.webrtcOptions) === null || G === void 0 ? void 0 : G.signalingCredentials, E.accessToken = (z = O?.webrtcOptions) === null || z === void 0 ? void 0 : z.signalingAccessToken), E.externalAuthAddress = (x = O?.webrtcOptions) === null || x === void 0 ? void 0 : x.signalingExternalAuthAddress, E.externalAuthToEntity = (L = O?.webrtcOptions) === null || L === void 0 ? void 0 : L.signalingExternalAuthToEntity), [4, v(h, E)];
20482
20518
  case 3:
20483
20519
  return F = J.sent(), T = u.grpc.client(d.SignalingService.Call, { host: h, transport: F }), w = "", C = !1, j = function(q) {
20484
20520
  if (!C) {
@@ -20601,7 +20637,7 @@ var __webpack_modules__ = { 37: function(t) {
20601
20637
  var n = s(655);
20602
20638
  e.newPeerConnectionForClient = function(u, g) {
20603
20639
  return n.__awaiter(this, void 0, void 0, function() {
20604
- var p, o, r, i, l, c, d, v, m = this;
20640
+ var p, o, r, i, l, c, d, m, v = this;
20605
20641
  return n.__generator(this, function(y) {
20606
20642
  switch (y.label) {
20607
20643
  case 0:
@@ -20610,7 +20646,7 @@ var __webpack_modules__ = { 37: function(t) {
20610
20646
  }), (i = p.createDataChannel("data", { id: 0, negotiated: !0, ordered: !0 })).binaryType = "arraybuffer", (l = p.createDataChannel("negotiation", { id: 1, negotiated: !0, ordered: !0 })).binaryType = "arraybuffer", c = !1, l.onopen = function() {
20611
20647
  c = !0;
20612
20648
  }, l.onmessage = function(f) {
20613
- return n.__awaiter(m, void 0, void 0, function() {
20649
+ return n.__awaiter(v, void 0, void 0, function() {
20614
20650
  var b, h;
20615
20651
  return n.__generator(this, function(R) {
20616
20652
  switch (R.label) {
@@ -20630,7 +20666,7 @@ var __webpack_modules__ = { 37: function(t) {
20630
20666
  });
20631
20667
  });
20632
20668
  }, p.onnegotiationneeded = function() {
20633
- return n.__awaiter(m, void 0, void 0, function() {
20669
+ return n.__awaiter(v, void 0, void 0, function() {
20634
20670
  var f;
20635
20671
  return n.__generator(this, function(b) {
20636
20672
  switch (b.label) {
@@ -20657,10 +20693,10 @@ var __webpack_modules__ = { 37: function(t) {
20657
20693
  case 3:
20658
20694
  return y.sent(), [3, 5];
20659
20695
  case 4:
20660
- return v = y.sent(), [2, Promise.reject(v)];
20696
+ return m = y.sent(), [2, Promise.reject(m)];
20661
20697
  case 5:
20662
20698
  return p.onicecandidate = function(f) {
20663
- return n.__awaiter(m, void 0, void 0, function() {
20699
+ return n.__awaiter(v, void 0, void 0, function() {
20664
20700
  return n.__generator(this, function(b) {
20665
20701
  return f.candidate !== null || o({ pc: p, dc: i }), [2];
20666
20702
  });
@@ -20671,7 +20707,7 @@ var __webpack_modules__ = { 37: function(t) {
20671
20707
  });
20672
20708
  };
20673
20709
  }, 655: (t, e, s) => {
20674
- s.r(e), s.d(e, { __assign: () => g, __asyncDelegator: () => P, __asyncGenerator: () => O, __asyncValues: () => D, __await: () => R, __awaiter: () => l, __classPrivateFieldGet: () => k, __classPrivateFieldIn: () => X, __classPrivateFieldSet: () => W, __createBinding: () => d, __decorate: () => o, __exportStar: () => v, __extends: () => u, __generator: () => c, __importDefault: () => L, __importStar: () => x, __makeTemplateObject: () => G, __metadata: () => i, __param: () => r, __read: () => y, __rest: () => p, __spread: () => f, __spreadArray: () => h, __spreadArrays: () => b, __values: () => m });
20710
+ s.r(e), s.d(e, { __assign: () => g, __asyncDelegator: () => P, __asyncGenerator: () => O, __asyncValues: () => D, __await: () => R, __awaiter: () => l, __classPrivateFieldGet: () => k, __classPrivateFieldIn: () => X, __classPrivateFieldSet: () => W, __createBinding: () => d, __decorate: () => o, __exportStar: () => m, __extends: () => u, __generator: () => c, __importDefault: () => L, __importStar: () => x, __makeTemplateObject: () => G, __metadata: () => i, __param: () => r, __read: () => y, __rest: () => p, __spread: () => f, __spreadArray: () => h, __spreadArrays: () => b, __values: () => v });
20675
20711
  var n = function(S, M) {
20676
20712
  return n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(_, E) {
20677
20713
  _.__proto__ = E;
@@ -20823,11 +20859,11 @@ var __webpack_modules__ = { 37: function(t) {
20823
20859
  } : function(S, M, _, E) {
20824
20860
  E === void 0 && (E = _), S[E] = M[_];
20825
20861
  };
20826
- function v(S, M) {
20862
+ function m(S, M) {
20827
20863
  for (var _ in S)
20828
20864
  _ === "default" || Object.prototype.hasOwnProperty.call(M, _) || d(M, S, _);
20829
20865
  }
20830
- function m(S) {
20866
+ function v(S) {
20831
20867
  var M = typeof Symbol == "function" && Symbol.iterator, _ = M && S[M], E = 0;
20832
20868
  if (_)
20833
20869
  return _.call(S);
@@ -20929,7 +20965,7 @@ var __webpack_modules__ = { 37: function(t) {
20929
20965
  if (!Symbol.asyncIterator)
20930
20966
  throw new TypeError("Symbol.asyncIterator is not defined.");
20931
20967
  var M, _ = S[Symbol.asyncIterator];
20932
- return _ ? _.call(S) : (S = m(S), M = {}, E("next"), E("throw"), E("return"), M[Symbol.asyncIterator] = function() {
20968
+ return _ ? _.call(S) : (S = v(S), M = {}, E("next"), E("throw"), E("return"), M[Symbol.asyncIterator] = function() {
20933
20969
  return this;
20934
20970
  }, M);
20935
20971
  function E(F) {
@@ -21440,13 +21476,13 @@ var __webpack_modules__ = { 37: function(t) {
21440
21476
  }
21441
21477
  g.Authenticate = { methodName: "Authenticate", service: g, requestStream: !1, responseStream: !1, requestType: n.AuthenticateRequest, responseType: n.AuthenticateResponse }, e.AuthService = g, p.prototype.authenticate = function(i, l, c) {
21442
21478
  arguments.length === 2 && (c = arguments[1]);
21443
- var d = u.unary(g.Authenticate, { request: i, host: this.serviceHost, metadata: l, transport: this.options.transport, debug: this.options.debug, onEnd: function(v) {
21479
+ var d = u.unary(g.Authenticate, { request: i, host: this.serviceHost, metadata: l, transport: this.options.transport, debug: this.options.debug, onEnd: function(m) {
21444
21480
  if (c)
21445
- if (v.status !== u.Code.OK) {
21446
- var m = new Error(v.statusMessage);
21447
- m.code = v.status, m.metadata = v.trailers, c(m, null);
21481
+ if (m.status !== u.Code.OK) {
21482
+ var v = new Error(m.statusMessage);
21483
+ v.code = m.status, v.metadata = m.trailers, c(v, null);
21448
21484
  } else
21449
- c(null, v.message);
21485
+ c(null, m.message);
21450
21486
  } });
21451
21487
  return { cancel: function() {
21452
21488
  c = null, d.close();
@@ -21462,13 +21498,13 @@ var __webpack_modules__ = { 37: function(t) {
21462
21498
  }
21463
21499
  o.AuthenticateTo = { methodName: "AuthenticateTo", service: o, requestStream: !1, responseStream: !1, requestType: n.AuthenticateToRequest, responseType: n.AuthenticateToResponse }, e.ExternalAuthService = o, r.prototype.authenticateTo = function(i, l, c) {
21464
21500
  arguments.length === 2 && (c = arguments[1]);
21465
- var d = u.unary(o.AuthenticateTo, { request: i, host: this.serviceHost, metadata: l, transport: this.options.transport, debug: this.options.debug, onEnd: function(v) {
21501
+ var d = u.unary(o.AuthenticateTo, { request: i, host: this.serviceHost, metadata: l, transport: this.options.transport, debug: this.options.debug, onEnd: function(m) {
21466
21502
  if (c)
21467
- if (v.status !== u.Code.OK) {
21468
- var m = new Error(v.statusMessage);
21469
- m.code = v.status, m.metadata = v.trailers, c(m, null);
21503
+ if (m.status !== u.Code.OK) {
21504
+ var v = new Error(m.statusMessage);
21505
+ v.code = m.status, v.metadata = m.trailers, c(v, null);
21470
21506
  } else
21471
- c(null, v.message);
21507
+ c(null, m.message);
21472
21508
  } });
21473
21509
  return { cancel: function() {
21474
21510
  c = null, d.close();
@@ -22829,11 +22865,11 @@ var __webpack_modules__ = { 37: function(t) {
22829
22865
  i.data.forEach(function(d) {
22830
22866
  d(c);
22831
22867
  });
22832
- }, onEnd: function(c, d, v) {
22833
- i.status.forEach(function(m) {
22834
- m({ code: c, details: d, metadata: v });
22835
- }), i.end.forEach(function(m) {
22836
- m({ code: c, details: d, metadata: v });
22868
+ }, onEnd: function(c, d, m) {
22869
+ i.status.forEach(function(v) {
22870
+ v({ code: c, details: d, metadata: m });
22871
+ }), i.end.forEach(function(v) {
22872
+ v({ code: c, details: d, metadata: m });
22837
22873
  }), i = null;
22838
22874
  } });
22839
22875
  return { on: function(c, d) {
@@ -22857,10 +22893,10 @@ var __webpack_modules__ = { 37: function(t) {
22857
22893
  }, p.prototype.answer = function(o) {
22858
22894
  var r = { data: [], end: [], status: [] }, i = u.client(g.Answer, { host: this.serviceHost, metadata: o, transport: this.options.transport });
22859
22895
  return i.onEnd(function(l, c, d) {
22860
- r.status.forEach(function(v) {
22861
- v({ code: l, details: c, metadata: d });
22862
- }), r.end.forEach(function(v) {
22863
- v({ code: l, details: c, metadata: d });
22896
+ r.status.forEach(function(m) {
22897
+ m({ code: l, details: c, metadata: d });
22898
+ }), r.end.forEach(function(m) {
22899
+ m({ code: l, details: c, metadata: d });
22864
22900
  }), r = null;
22865
22901
  }), i.onMessage(function(l) {
22866
22902
  r.data.forEach(function(c) {
@@ -39168,7 +39204,192 @@ const isLocalConnection = (t) => t.includes(".local"), dialDirect = async (t) =>
39168
39204
  if (!e)
39169
39205
  throw new Error("failed to connect to robot");
39170
39206
  return e;
39171
- }, version = "0.0.39";
39207
+ };
39208
+ class ArmClient {
39209
+ client;
39210
+ name;
39211
+ options;
39212
+ constructor(e, s, n = {}) {
39213
+ this.client = e.createServiceClient(ArmServiceClient_1), this.name = s, this.options = n;
39214
+ }
39215
+ get ArmService() {
39216
+ return this.client;
39217
+ }
39218
+ async getEndPosition(e = {}) {
39219
+ const s = this.ArmService, n = new arm_pb.GetEndPositionRequest();
39220
+ n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
39221
+ const g = (await promisify(s.getEndPosition.bind(s), n)).getPose();
39222
+ if (!g)
39223
+ throw new Error("no pose");
39224
+ return g.toObject();
39225
+ }
39226
+ async moveToPosition(e, s = {}) {
39227
+ const n = this.ArmService, u = new arm_pb.MoveToPositionRequest();
39228
+ u.setName(this.name), u.setTo(encodePose(e)), u.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(u), await promisify(
39229
+ n.moveToPosition.bind(n),
39230
+ u
39231
+ );
39232
+ }
39233
+ async moveToJointPositions(e, s = {}) {
39234
+ const n = this.ArmService, u = new arm_pb.JointPositions();
39235
+ u.setValuesList(e);
39236
+ const g = new arm_pb.MoveToJointPositionsRequest();
39237
+ g.setName(this.name), g.setPositions(u), g.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(g), await promisify(n.moveToJointPositions.bind(n), g);
39238
+ }
39239
+ async getJointPositions(e = {}) {
39240
+ const s = this.ArmService, n = new arm_pb.GetJointPositionsRequest();
39241
+ n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
39242
+ const g = (await promisify(s.getJointPositions.bind(s), n)).getPositions();
39243
+ if (!g)
39244
+ throw new Error("no pose");
39245
+ return g;
39246
+ }
39247
+ async stop(e = {}) {
39248
+ const s = this.ArmService, n = new arm_pb.StopRequest();
39249
+ n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n), await promisify(
39250
+ s.stop.bind(s),
39251
+ n
39252
+ );
39253
+ }
39254
+ async isMoving() {
39255
+ const e = this.ArmService, s = new arm_pb.IsMovingRequest();
39256
+ return this.options.requestLogger?.(s), (await promisify(
39257
+ e.isMoving.bind(e),
39258
+ s
39259
+ )).getIsMoving();
39260
+ }
39261
+ }
39262
+ class BaseClient {
39263
+ client;
39264
+ name;
39265
+ options;
39266
+ constructor(e, s, n = {}) {
39267
+ this.client = e.createServiceClient(BaseServiceClient_1), this.name = s, this.options = n;
39268
+ }
39269
+ get baseService() {
39270
+ return this.client;
39271
+ }
39272
+ async moveStraight(e, s, n = {}) {
39273
+ const u = this.baseService, g = new base_pb.MoveStraightRequest();
39274
+ g.setName(this.name), g.setMmPerSec(s), g.setDistanceMm(e), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
39275
+ u.moveStraight.bind(u),
39276
+ g
39277
+ );
39278
+ }
39279
+ async spin(e, s, n = {}) {
39280
+ const u = this.baseService, g = new base_pb.SpinRequest();
39281
+ g.setName(this.name), g.setAngleDeg(e), g.setDegsPerSec(s), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
39282
+ u.spin.bind(u),
39283
+ g
39284
+ );
39285
+ }
39286
+ async setPower(e, s, n = {}) {
39287
+ const u = this.baseService, g = new base_pb.SetPowerRequest();
39288
+ g.setName(this.name), g.setLinear(encodeVector3D(e)), g.setAngular(encodeVector3D(s)), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
39289
+ u.setPower.bind(u),
39290
+ g
39291
+ );
39292
+ }
39293
+ async setVelocity(e, s, n = {}) {
39294
+ const u = this.baseService, g = new base_pb.SetVelocityRequest();
39295
+ g.setName(this.name), g.setLinear(encodeVector3D(e)), g.setAngular(encodeVector3D(s)), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
39296
+ u.setVelocity.bind(u),
39297
+ g
39298
+ );
39299
+ }
39300
+ async stop(e = {}) {
39301
+ const s = this.baseService, n = new base_pb.StopRequest();
39302
+ n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n), await promisify(
39303
+ s.stop.bind(s),
39304
+ n
39305
+ );
39306
+ }
39307
+ }
39308
+ class BoardClient {
39309
+ client;
39310
+ name;
39311
+ options;
39312
+ constructor(e, s, n = {}) {
39313
+ this.client = e.createServiceClient(BoardServiceClient_1), this.name = s, this.options = n;
39314
+ }
39315
+ get boardService() {
39316
+ return this.client;
39317
+ }
39318
+ async getRawStatusResponse(e = {}) {
39319
+ const s = this.boardService, n = new board_pb.StatusRequest();
39320
+ return n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n), await promisify(
39321
+ s.status.bind(s),
39322
+ n
39323
+ );
39324
+ }
39325
+ /**
39326
+ * Get the status of the board as a raw protobuf response.
39327
+ *
39328
+ * @deprecated Use {@link BoardClient#getStatus} instead.
39329
+ */
39330
+ status(e = {}) {
39331
+ return this.getRawStatusResponse(e);
39332
+ }
39333
+ async getStatus(e = {}) {
39334
+ const n = (await this.getRawStatusResponse(e)).getStatus();
39335
+ if (!n)
39336
+ throw new Error("no status");
39337
+ const u = {};
39338
+ for (const [p, o] of n.getAnalogsMap().entries())
39339
+ u[p] = o.getValue();
39340
+ const g = {};
39341
+ for (const [p, o] of n.getDigitalInterruptsMap().entries())
39342
+ g[p] = o.getValue();
39343
+ return { analogs: u, digitalInterrupts: g };
39344
+ }
39345
+ async setGPIO(e, s, n = {}) {
39346
+ const u = this.boardService, g = new board_pb.SetGPIORequest();
39347
+ g.setName(this.name), g.setPin(e), g.setHigh(s), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
39348
+ u.setGPIO.bind(u),
39349
+ g
39350
+ );
39351
+ }
39352
+ async getGPIO(e, s = {}) {
39353
+ const n = this.boardService, u = new board_pb.GetGPIORequest();
39354
+ return u.setName(this.name), u.setPin(e), u.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(u), (await promisify(
39355
+ n.getGPIO.bind(n),
39356
+ u
39357
+ )).getHigh();
39358
+ }
39359
+ async getPWM(e, s = {}) {
39360
+ const n = this.boardService, u = new board_pb.PWMRequest();
39361
+ return u.setName(this.name), u.setPin(e), u.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(u), (await promisify(
39362
+ n.pWM.bind(n),
39363
+ u
39364
+ )).getDutyCyclePct();
39365
+ }
39366
+ async setPWM(e, s, n = {}) {
39367
+ const u = this.boardService, g = new board_pb.SetPWMRequest();
39368
+ g.setName(this.name), g.setPin(e), g.setDutyCyclePct(s), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
39369
+ u.setPWM.bind(u),
39370
+ g
39371
+ );
39372
+ }
39373
+ async getPWMFrequency(e, s = {}) {
39374
+ const n = this.boardService, u = new board_pb.PWMFrequencyRequest();
39375
+ return u.setName(this.name), u.setPin(e), u.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(u), (await promisify(n.pWMFrequency.bind(n), u)).getFrequencyHz();
39376
+ }
39377
+ async setPWMFrequency(e, s, n = {}) {
39378
+ const u = this.boardService, g = new board_pb.SetPWMFrequencyRequest();
39379
+ g.setName(this.name), g.setPin(e), g.setFrequencyHz(s), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
39380
+ u.setPWMFrequency.bind(u),
39381
+ g
39382
+ );
39383
+ }
39384
+ async readAnalogReader(e, s = {}) {
39385
+ const n = this.boardService, u = new board_pb.ReadAnalogReaderRequest();
39386
+ return u.setBoardName(this.name), u.setAnalogReaderName(e), u.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(u), (await promisify(n.readAnalogReader.bind(n), u)).getValue();
39387
+ }
39388
+ async getDigitalInterruptValue(e, s = {}) {
39389
+ const n = this.boardService, u = new board_pb.GetDigitalInterruptValueRequest();
39390
+ return u.setBoardName(this.name), u.setDigitalInterruptName(e), u.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(u), (await promisify(n.getDigitalInterruptValue.bind(n), u)).getValue();
39391
+ }
39392
+ }
39172
39393
  var camera_pb = {}, httpbody_pb = {}, any_pb = {};
39173
39394
  (function(t) {
39174
39395
  var e = googleProtobuf, s = e, n = typeof globalThis < "u" && globalThis || typeof window < "u" && window || typeof n < "u" && n || typeof self < "u" && self || function() {
@@ -40270,6 +40491,263 @@ var camera_pb = {}, httpbody_pb = {}, any_pb = {};
40270
40491
  return this.setParametersList([]);
40271
40492
  }, s.object.extend(t, proto.viam.component.camera.v1);
40272
40493
  })(camera_pb);
40494
+ var component_camera_v1_camera_pb = camera_pb, common_v1_common_pb$1 = common_pb, google_api_httpbody_pb = httpbody_pb, grpc$2 = grpcWebClient_umdExports.grpc, CameraService = function() {
40495
+ function t() {
40496
+ }
40497
+ return t.serviceName = "viam.component.camera.v1.CameraService", t;
40498
+ }();
40499
+ CameraService.GetImage = {
40500
+ methodName: "GetImage",
40501
+ service: CameraService,
40502
+ requestStream: !1,
40503
+ responseStream: !1,
40504
+ requestType: component_camera_v1_camera_pb.GetImageRequest,
40505
+ responseType: component_camera_v1_camera_pb.GetImageResponse
40506
+ };
40507
+ CameraService.RenderFrame = {
40508
+ methodName: "RenderFrame",
40509
+ service: CameraService,
40510
+ requestStream: !1,
40511
+ responseStream: !1,
40512
+ requestType: component_camera_v1_camera_pb.RenderFrameRequest,
40513
+ responseType: google_api_httpbody_pb.HttpBody
40514
+ };
40515
+ CameraService.GetPointCloud = {
40516
+ methodName: "GetPointCloud",
40517
+ service: CameraService,
40518
+ requestStream: !1,
40519
+ responseStream: !1,
40520
+ requestType: component_camera_v1_camera_pb.GetPointCloudRequest,
40521
+ responseType: component_camera_v1_camera_pb.GetPointCloudResponse
40522
+ };
40523
+ CameraService.GetProperties = {
40524
+ methodName: "GetProperties",
40525
+ service: CameraService,
40526
+ requestStream: !1,
40527
+ responseStream: !1,
40528
+ requestType: component_camera_v1_camera_pb.GetPropertiesRequest,
40529
+ responseType: component_camera_v1_camera_pb.GetPropertiesResponse
40530
+ };
40531
+ CameraService.DoCommand = {
40532
+ methodName: "DoCommand",
40533
+ service: CameraService,
40534
+ requestStream: !1,
40535
+ responseStream: !1,
40536
+ requestType: common_v1_common_pb$1.DoCommandRequest,
40537
+ responseType: common_v1_common_pb$1.DoCommandResponse
40538
+ };
40539
+ function CameraServiceClient(t, e) {
40540
+ this.serviceHost = t, this.options = e || {};
40541
+ }
40542
+ CameraServiceClient.prototype.getImage = function t(e, s, n) {
40543
+ arguments.length === 2 && (n = arguments[1]);
40544
+ var u = grpc$2.unary(CameraService.GetImage, {
40545
+ request: e,
40546
+ host: this.serviceHost,
40547
+ metadata: s,
40548
+ transport: this.options.transport,
40549
+ debug: this.options.debug,
40550
+ onEnd: function(g) {
40551
+ if (n)
40552
+ if (g.status !== grpc$2.Code.OK) {
40553
+ var p = new Error(g.statusMessage);
40554
+ p.code = g.status, p.metadata = g.trailers, n(p, null);
40555
+ } else
40556
+ n(null, g.message);
40557
+ }
40558
+ });
40559
+ return {
40560
+ cancel: function() {
40561
+ n = null, u.close();
40562
+ }
40563
+ };
40564
+ };
40565
+ CameraServiceClient.prototype.renderFrame = function t(e, s, n) {
40566
+ arguments.length === 2 && (n = arguments[1]);
40567
+ var u = grpc$2.unary(CameraService.RenderFrame, {
40568
+ request: e,
40569
+ host: this.serviceHost,
40570
+ metadata: s,
40571
+ transport: this.options.transport,
40572
+ debug: this.options.debug,
40573
+ onEnd: function(g) {
40574
+ if (n)
40575
+ if (g.status !== grpc$2.Code.OK) {
40576
+ var p = new Error(g.statusMessage);
40577
+ p.code = g.status, p.metadata = g.trailers, n(p, null);
40578
+ } else
40579
+ n(null, g.message);
40580
+ }
40581
+ });
40582
+ return {
40583
+ cancel: function() {
40584
+ n = null, u.close();
40585
+ }
40586
+ };
40587
+ };
40588
+ CameraServiceClient.prototype.getPointCloud = function t(e, s, n) {
40589
+ arguments.length === 2 && (n = arguments[1]);
40590
+ var u = grpc$2.unary(CameraService.GetPointCloud, {
40591
+ request: e,
40592
+ host: this.serviceHost,
40593
+ metadata: s,
40594
+ transport: this.options.transport,
40595
+ debug: this.options.debug,
40596
+ onEnd: function(g) {
40597
+ if (n)
40598
+ if (g.status !== grpc$2.Code.OK) {
40599
+ var p = new Error(g.statusMessage);
40600
+ p.code = g.status, p.metadata = g.trailers, n(p, null);
40601
+ } else
40602
+ n(null, g.message);
40603
+ }
40604
+ });
40605
+ return {
40606
+ cancel: function() {
40607
+ n = null, u.close();
40608
+ }
40609
+ };
40610
+ };
40611
+ CameraServiceClient.prototype.getProperties = function t(e, s, n) {
40612
+ arguments.length === 2 && (n = arguments[1]);
40613
+ var u = grpc$2.unary(CameraService.GetProperties, {
40614
+ request: e,
40615
+ host: this.serviceHost,
40616
+ metadata: s,
40617
+ transport: this.options.transport,
40618
+ debug: this.options.debug,
40619
+ onEnd: function(g) {
40620
+ if (n)
40621
+ if (g.status !== grpc$2.Code.OK) {
40622
+ var p = new Error(g.statusMessage);
40623
+ p.code = g.status, p.metadata = g.trailers, n(p, null);
40624
+ } else
40625
+ n(null, g.message);
40626
+ }
40627
+ });
40628
+ return {
40629
+ cancel: function() {
40630
+ n = null, u.close();
40631
+ }
40632
+ };
40633
+ };
40634
+ CameraServiceClient.prototype.doCommand = function t(e, s, n) {
40635
+ arguments.length === 2 && (n = arguments[1]);
40636
+ var u = grpc$2.unary(CameraService.DoCommand, {
40637
+ request: e,
40638
+ host: this.serviceHost,
40639
+ metadata: s,
40640
+ transport: this.options.transport,
40641
+ debug: this.options.debug,
40642
+ onEnd: function(g) {
40643
+ if (n)
40644
+ if (g.status !== grpc$2.Code.OK) {
40645
+ var p = new Error(g.statusMessage);
40646
+ p.code = g.status, p.metadata = g.trailers, n(p, null);
40647
+ } else
40648
+ n(null, g.message);
40649
+ }
40650
+ });
40651
+ return {
40652
+ cancel: function() {
40653
+ n = null, u.close();
40654
+ }
40655
+ };
40656
+ };
40657
+ var CameraServiceClient_1 = CameraServiceClient;
40658
+ const PointCloudPCD = "pointcloud/pcd";
40659
+ class CameraClient {
40660
+ client;
40661
+ name;
40662
+ options;
40663
+ constructor(e, s, n = {}) {
40664
+ this.client = e.createServiceClient(CameraServiceClient_1), this.name = s, this.options = n;
40665
+ }
40666
+ get cameraService() {
40667
+ return this.client;
40668
+ }
40669
+ async getImage(e) {
40670
+ const s = this.cameraService, n = new camera_pb.GetImageRequest();
40671
+ return n.setName(this.name), n.setMimeType(e), this.options.requestLogger?.(n), (await promisify(
40672
+ s.getImage.bind(s),
40673
+ n
40674
+ )).getImage_asU8();
40675
+ }
40676
+ async renderFrame(e) {
40677
+ const s = this.cameraService, n = new camera_pb.GetPointCloudRequest();
40678
+ n.setName(this.name), n.setMimeType(e), this.options.requestLogger?.(n);
40679
+ const u = await promisify(
40680
+ s.renderFrame.bind(s),
40681
+ n
40682
+ );
40683
+ return new Blob([u.getData_asU8()], { type: e });
40684
+ }
40685
+ async getPointCloud() {
40686
+ const e = this.cameraService, s = new camera_pb.GetPointCloudRequest();
40687
+ return s.setName(this.name), s.setMimeType(PointCloudPCD), this.options.requestLogger?.(s), (await promisify(e.getPointCloud.bind(e), s)).getPointCloud_asU8();
40688
+ }
40689
+ async getProperties() {
40690
+ const e = this.cameraService, s = new camera_pb.GetPropertiesRequest();
40691
+ return s.setName(this.name), this.options.requestLogger?.(s), (await promisify(e.getProperties.bind(e), s)).toObject();
40692
+ }
40693
+ }
40694
+ class MotorClient {
40695
+ client;
40696
+ name;
40697
+ options;
40698
+ constructor(e, s, n = {}) {
40699
+ this.client = e.createServiceClient(MotorServiceClient_1), this.name = s, this.options = n;
40700
+ }
40701
+ get motorService() {
40702
+ return this.client;
40703
+ }
40704
+ async setPower(e, s = {}) {
40705
+ const n = this.motorService, u = new motor_pb.SetPowerRequest();
40706
+ u.setName(this.name), u.setPowerPct(e), u.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(u), await promisify(
40707
+ n.setPower.bind(n),
40708
+ u
40709
+ );
40710
+ }
40711
+ async goFor(e, s, n = {}) {
40712
+ const u = this.motorService, g = new motor_pb.GoForRequest();
40713
+ g.setName(this.name), g.setRpm(e), g.setRevolutions(s), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
40714
+ u.goFor.bind(u),
40715
+ g
40716
+ );
40717
+ }
40718
+ async goTo(e, s, n = {}) {
40719
+ const u = this.motorService, g = new motor_pb.GoToRequest();
40720
+ g.setName(this.name), g.setRpm(e), g.setPositionRevolutions(s), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
40721
+ u.goTo.bind(u),
40722
+ g
40723
+ );
40724
+ }
40725
+ async resetZeroPosition(e, s = {}) {
40726
+ const n = this.motorService, u = new motor_pb.ResetZeroPositionRequest();
40727
+ u.setName(this.name), u.setOffset(e), u.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(u), await promisify(n.resetZeroPosition.bind(n), u);
40728
+ }
40729
+ async stop(e = {}) {
40730
+ const s = this.motorService, n = new motor_pb.StopRequest();
40731
+ n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n), await promisify(
40732
+ s.stop.bind(s),
40733
+ n
40734
+ );
40735
+ }
40736
+ async getProperties(e = {}) {
40737
+ const s = this.motorService, n = new motor_pb.GetPropertiesRequest();
40738
+ return n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n), { positionReporting: (await promisify(s.getProperties.bind(s), n)).getPositionReporting() };
40739
+ }
40740
+ async getPosition(e = {}) {
40741
+ const s = this.motorService, n = new motor_pb.GetPositionRequest();
40742
+ return n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n), (await promisify(s.getPosition.bind(s), n)).getPosition();
40743
+ }
40744
+ async isPowered(e = {}) {
40745
+ const s = this.motorService, n = new motor_pb.IsPoweredRequest();
40746
+ n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
40747
+ const u = await promisify(s.isPowered.bind(s), n);
40748
+ return [u.getIsOn(), u.getPowerPct()];
40749
+ }
40750
+ }
40273
40751
  var sensor_pb = {};
40274
40752
  (function(t) {
40275
40753
  var e = googleProtobuf, s = e, n = function() {
@@ -40392,6 +40870,200 @@ var sensor_pb = {};
40392
40870
  return this.getReadingsMap().clear(), this;
40393
40871
  }, s.object.extend(t, proto.viam.component.sensor.v1);
40394
40872
  })(sensor_pb);
40873
+ var component_sensor_v1_sensor_pb = sensor_pb, common_v1_common_pb = common_pb, grpc$1 = grpcWebClient_umdExports.grpc, SensorService = function() {
40874
+ function t() {
40875
+ }
40876
+ return t.serviceName = "viam.component.sensor.v1.SensorService", t;
40877
+ }();
40878
+ SensorService.GetReadings = {
40879
+ methodName: "GetReadings",
40880
+ service: SensorService,
40881
+ requestStream: !1,
40882
+ responseStream: !1,
40883
+ requestType: component_sensor_v1_sensor_pb.GetReadingsRequest,
40884
+ responseType: component_sensor_v1_sensor_pb.GetReadingsResponse
40885
+ };
40886
+ SensorService.DoCommand = {
40887
+ methodName: "DoCommand",
40888
+ service: SensorService,
40889
+ requestStream: !1,
40890
+ responseStream: !1,
40891
+ requestType: common_v1_common_pb.DoCommandRequest,
40892
+ responseType: common_v1_common_pb.DoCommandResponse
40893
+ };
40894
+ function SensorServiceClient(t, e) {
40895
+ this.serviceHost = t, this.options = e || {};
40896
+ }
40897
+ SensorServiceClient.prototype.getReadings = function t(e, s, n) {
40898
+ arguments.length === 2 && (n = arguments[1]);
40899
+ var u = grpc$1.unary(SensorService.GetReadings, {
40900
+ request: e,
40901
+ host: this.serviceHost,
40902
+ metadata: s,
40903
+ transport: this.options.transport,
40904
+ debug: this.options.debug,
40905
+ onEnd: function(g) {
40906
+ if (n)
40907
+ if (g.status !== grpc$1.Code.OK) {
40908
+ var p = new Error(g.statusMessage);
40909
+ p.code = g.status, p.metadata = g.trailers, n(p, null);
40910
+ } else
40911
+ n(null, g.message);
40912
+ }
40913
+ });
40914
+ return {
40915
+ cancel: function() {
40916
+ n = null, u.close();
40917
+ }
40918
+ };
40919
+ };
40920
+ SensorServiceClient.prototype.doCommand = function t(e, s, n) {
40921
+ arguments.length === 2 && (n = arguments[1]);
40922
+ var u = grpc$1.unary(SensorService.DoCommand, {
40923
+ request: e,
40924
+ host: this.serviceHost,
40925
+ metadata: s,
40926
+ transport: this.options.transport,
40927
+ debug: this.options.debug,
40928
+ onEnd: function(g) {
40929
+ if (n)
40930
+ if (g.status !== grpc$1.Code.OK) {
40931
+ var p = new Error(g.statusMessage);
40932
+ p.code = g.status, p.metadata = g.trailers, n(p, null);
40933
+ } else
40934
+ n(null, g.message);
40935
+ }
40936
+ });
40937
+ return {
40938
+ cancel: function() {
40939
+ n = null, u.close();
40940
+ }
40941
+ };
40942
+ };
40943
+ var SensorServiceClient_1 = SensorServiceClient;
40944
+ class SensorClient {
40945
+ client;
40946
+ name;
40947
+ options;
40948
+ constructor(e, s, n = {}) {
40949
+ this.client = e.createServiceClient(SensorServiceClient_1), this.name = s, this.options = n;
40950
+ }
40951
+ get sensorService() {
40952
+ return this.client;
40953
+ }
40954
+ async getReadings(e = {}) {
40955
+ const s = this.sensorService, n = new sensor_pb.GetReadingsRequest();
40956
+ n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
40957
+ const u = await promisify(s.getReadings.bind(s), n), g = {};
40958
+ for (const [p, o] of u.getReadingsMap().entries())
40959
+ g[p] = o.toJavaScript();
40960
+ return g;
40961
+ }
40962
+ }
40963
+ class MovementSensorClient {
40964
+ client;
40965
+ sensorclient;
40966
+ name;
40967
+ options;
40968
+ constructor(e, s, n = {}) {
40969
+ this.client = e.createServiceClient(MovementSensorServiceClient_1), this.sensorclient = new SensorClient(e, s, n), this.name = s, this.options = n;
40970
+ }
40971
+ get movementsensorService() {
40972
+ return this.client;
40973
+ }
40974
+ async getLinearVelocity(e = {}) {
40975
+ const s = this.movementsensorService, n = new movementsensor_pb.GetLinearVelocityRequest();
40976
+ n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
40977
+ const g = (await promisify(
40978
+ s.getLinearVelocity.bind(s),
40979
+ n
40980
+ )).getLinearVelocity();
40981
+ if (!g)
40982
+ throw new Error("no linear velocity");
40983
+ return decodeVector3D(g);
40984
+ }
40985
+ async getAngularVelocity(e = {}) {
40986
+ const s = this.movementsensorService, n = new movementsensor_pb.GetAngularVelocityRequest();
40987
+ n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
40988
+ const g = (await promisify(
40989
+ s.getAngularVelocity.bind(s),
40990
+ n
40991
+ )).getAngularVelocity();
40992
+ if (!g)
40993
+ throw new Error("no angular velocity");
40994
+ return decodeVector3D(g);
40995
+ }
40996
+ async getCompassHeading(e = {}) {
40997
+ const s = this.movementsensorService, n = new movementsensor_pb.GetCompassHeadingRequest();
40998
+ return n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n), (await promisify(
40999
+ s.getCompassHeading.bind(s),
41000
+ n
41001
+ )).getValue();
41002
+ }
41003
+ async getOrientation(e = {}) {
41004
+ const s = this.movementsensorService, n = new movementsensor_pb.GetOrientationRequest();
41005
+ n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
41006
+ const g = (await promisify(
41007
+ s.getOrientation.bind(s),
41008
+ n
41009
+ )).getOrientation();
41010
+ if (!g)
41011
+ throw new Error("no orientation");
41012
+ return {
41013
+ ox: g.getOX(),
41014
+ oy: g.getOY(),
41015
+ oz: g.getOZ(),
41016
+ theta: g.getTheta()
41017
+ };
41018
+ }
41019
+ async getPosition(e = {}) {
41020
+ const s = this.movementsensorService, n = new movementsensor_pb.GetPositionRequest();
41021
+ n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
41022
+ const u = await promisify(s.getPosition.bind(s), n), g = u.getCoordinate();
41023
+ if (!g)
41024
+ throw new Error("no coordinate");
41025
+ return {
41026
+ latitude: g.getLatitude(),
41027
+ longitude: g.getLongitude(),
41028
+ altitudeMM: u.getAltitudeMm()
41029
+ };
41030
+ }
41031
+ async getProperties(e = {}) {
41032
+ const s = this.movementsensorService, n = new movementsensor_pb.GetPropertiesRequest();
41033
+ n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
41034
+ const u = await promisify(s.getProperties.bind(s), n);
41035
+ return {
41036
+ linearVelocitySupported: u.getLinearVelocitySupported(),
41037
+ angularVelocitySupported: u.getAngularVelocitySupported(),
41038
+ orientationSupported: u.getOrientationSupported(),
41039
+ positionSupported: u.getPositionSupported(),
41040
+ compassHeadingSupported: u.getCompassHeadingSupported(),
41041
+ linearAccelerationSupported: u.getLinearAccelerationSupported()
41042
+ };
41043
+ }
41044
+ async getAccuracy(e = {}) {
41045
+ const s = this.movementsensorService, n = new movementsensor_pb.GetAccuracyRequest();
41046
+ n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
41047
+ const g = (await promisify(s.getAccuracy.bind(s), n)).getAccuracyMmMap(), p = {};
41048
+ for (const [o, r] of g.entries())
41049
+ p[o] = r;
41050
+ return p;
41051
+ }
41052
+ async getLinearAcceleration(e = {}) {
41053
+ const s = this.movementsensorService, n = new movementsensor_pb.GetLinearAccelerationRequest();
41054
+ n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
41055
+ const g = (await promisify(
41056
+ s.getLinearAcceleration.bind(s),
41057
+ n
41058
+ )).getLinearAcceleration();
41059
+ if (!g)
41060
+ throw new Error("no linear acceleration");
41061
+ return decodeVector3D(g);
41062
+ }
41063
+ getReadings(e = {}) {
41064
+ return this.sensorclient.getReadings(e);
41065
+ }
41066
+ }
40395
41067
  var stream_pb = {};
40396
41068
  (function(t) {
40397
41069
  var e = googleProtobuf, s = e, n = function() {
@@ -40610,652 +41282,6 @@ var stream_pb = {};
40610
41282
  }, proto.proto.stream.v1.RemoveStreamResponse.serializeBinaryToWriter = function(u, g) {
40611
41283
  }, s.object.extend(t, proto.proto.stream.v1);
40612
41284
  })(stream_pb);
40613
- class ArmClient {
40614
- client;
40615
- name;
40616
- options;
40617
- constructor(e, s, n = {}) {
40618
- this.client = e.createServiceClient(ArmServiceClient_1), this.name = s, this.options = n;
40619
- }
40620
- get ArmService() {
40621
- return this.client;
40622
- }
40623
- async getEndPosition(e = {}) {
40624
- const s = this.ArmService, n = new arm_pb.GetEndPositionRequest();
40625
- n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
40626
- const g = (await promisify(s.getEndPosition.bind(s), n)).getPose();
40627
- if (!g)
40628
- throw new Error("no pose");
40629
- return {
40630
- x: g.getX(),
40631
- y: g.getY(),
40632
- z: g.getZ(),
40633
- ox: g.getOX(),
40634
- oy: g.getOY(),
40635
- oz: g.getOZ(),
40636
- theta: g.getTheta()
40637
- };
40638
- }
40639
- async moveToPosition(e, s = {}) {
40640
- const n = this.ArmService, u = new common_pb.Pose();
40641
- u.setX(e.x), u.setY(e.y), u.setZ(e.z), u.setOX(e.ox), u.setOY(e.oy), u.setOZ(e.oz), u.setTheta(e.theta);
40642
- const g = new arm_pb.MoveToPositionRequest();
40643
- g.setName(this.name), g.setTo(u), g.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(g), await promisify(
40644
- n.moveToPosition.bind(n),
40645
- g
40646
- );
40647
- }
40648
- async moveToJointPositions(e, s = {}) {
40649
- const n = this.ArmService, u = new arm_pb.JointPositions();
40650
- u.setValuesList(e);
40651
- const g = new arm_pb.MoveToJointPositionsRequest();
40652
- g.setName(this.name), g.setPositions(u), g.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(g), await promisify(n.moveToJointPositions.bind(n), g);
40653
- }
40654
- async getJointPositions(e = {}) {
40655
- const s = this.ArmService, n = new arm_pb.GetJointPositionsRequest();
40656
- n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
40657
- const g = (await promisify(s.getJointPositions.bind(s), n)).getPositions();
40658
- if (!g)
40659
- throw new Error("no pose");
40660
- return g;
40661
- }
40662
- async stop(e = {}) {
40663
- const s = this.ArmService, n = new arm_pb.StopRequest();
40664
- n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n), await promisify(
40665
- s.stop.bind(s),
40666
- n
40667
- );
40668
- }
40669
- async isMoving() {
40670
- const e = this.ArmService, s = new arm_pb.IsMovingRequest();
40671
- return this.options.requestLogger?.(s), (await promisify(
40672
- e.isMoving.bind(e),
40673
- s
40674
- )).getIsMoving();
40675
- }
40676
- }
40677
- class BaseClient {
40678
- client;
40679
- name;
40680
- options;
40681
- constructor(e, s, n = {}) {
40682
- this.client = e.createServiceClient(BaseServiceClient_1), this.name = s, this.options = n;
40683
- }
40684
- get baseService() {
40685
- return this.client;
40686
- }
40687
- async moveStraight(e, s, n = {}) {
40688
- const u = this.baseService, g = new base_pb.MoveStraightRequest();
40689
- g.setName(this.name), g.setMmPerSec(s), g.setDistanceMm(e), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
40690
- u.moveStraight.bind(u),
40691
- g
40692
- );
40693
- }
40694
- async spin(e, s, n = {}) {
40695
- const u = this.baseService, g = new base_pb.SpinRequest();
40696
- g.setName(this.name), g.setAngleDeg(e), g.setDegsPerSec(s), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
40697
- u.spin.bind(u),
40698
- g
40699
- );
40700
- }
40701
- async setPower(e, s, n = {}) {
40702
- const u = this.baseService, g = new base_pb.SetPowerRequest();
40703
- g.setName(this.name), g.setLinear(encodeVector3D(e)), g.setAngular(encodeVector3D(s)), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
40704
- u.setPower.bind(u),
40705
- g
40706
- );
40707
- }
40708
- async setVelocity(e, s, n = {}) {
40709
- const u = this.baseService, g = new base_pb.SetVelocityRequest();
40710
- g.setName(this.name), g.setLinear(encodeVector3D(e)), g.setAngular(encodeVector3D(s)), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
40711
- u.setVelocity.bind(u),
40712
- g
40713
- );
40714
- }
40715
- async stop(e = {}) {
40716
- const s = this.baseService, n = new base_pb.StopRequest();
40717
- n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n), await promisify(
40718
- s.stop.bind(s),
40719
- n
40720
- );
40721
- }
40722
- }
40723
- class BoardClient {
40724
- client;
40725
- name;
40726
- options;
40727
- constructor(e, s, n = {}) {
40728
- this.client = e.createServiceClient(BoardServiceClient_1), this.name = s, this.options = n;
40729
- }
40730
- get boardService() {
40731
- return this.client;
40732
- }
40733
- async getRawStatusResponse(e = {}) {
40734
- const s = this.boardService, n = new board_pb.StatusRequest();
40735
- return n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n), await promisify(
40736
- s.status.bind(s),
40737
- n
40738
- );
40739
- }
40740
- /**
40741
- * Get the status of the board as a raw protobuf response.
40742
- *
40743
- * @deprecated Use {@link BoardClient#getStatus} instead.
40744
- */
40745
- status(e = {}) {
40746
- return this.getRawStatusResponse(e);
40747
- }
40748
- async getStatus(e = {}) {
40749
- const n = (await this.getRawStatusResponse(e)).getStatus();
40750
- if (!n)
40751
- throw new Error("no status");
40752
- const u = {};
40753
- for (const [p, o] of n.getAnalogsMap().entries())
40754
- u[p] = o.getValue();
40755
- const g = {};
40756
- for (const [p, o] of n.getDigitalInterruptsMap().entries())
40757
- g[p] = o.getValue();
40758
- return { analogs: u, digitalInterrupts: g };
40759
- }
40760
- async setGPIO(e, s, n = {}) {
40761
- const u = this.boardService, g = new board_pb.SetGPIORequest();
40762
- g.setName(this.name), g.setPin(e), g.setHigh(s), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
40763
- u.setGPIO.bind(u),
40764
- g
40765
- );
40766
- }
40767
- async getGPIO(e, s = {}) {
40768
- const n = this.boardService, u = new board_pb.GetGPIORequest();
40769
- return u.setName(this.name), u.setPin(e), u.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(u), (await promisify(
40770
- n.getGPIO.bind(n),
40771
- u
40772
- )).getHigh();
40773
- }
40774
- async getPWM(e, s = {}) {
40775
- const n = this.boardService, u = new board_pb.PWMRequest();
40776
- return u.setName(this.name), u.setPin(e), u.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(u), (await promisify(
40777
- n.pWM.bind(n),
40778
- u
40779
- )).getDutyCyclePct();
40780
- }
40781
- async setPWM(e, s, n = {}) {
40782
- const u = this.boardService, g = new board_pb.SetPWMRequest();
40783
- g.setName(this.name), g.setPin(e), g.setDutyCyclePct(s), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
40784
- u.setPWM.bind(u),
40785
- g
40786
- );
40787
- }
40788
- async getPWMFrequency(e, s = {}) {
40789
- const n = this.boardService, u = new board_pb.PWMFrequencyRequest();
40790
- return u.setName(this.name), u.setPin(e), u.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(u), (await promisify(n.pWMFrequency.bind(n), u)).getFrequencyHz();
40791
- }
40792
- async setPWMFrequency(e, s, n = {}) {
40793
- const u = this.boardService, g = new board_pb.SetPWMFrequencyRequest();
40794
- g.setName(this.name), g.setPin(e), g.setFrequencyHz(s), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
40795
- u.setPWMFrequency.bind(u),
40796
- g
40797
- );
40798
- }
40799
- async readAnalogReader(e, s = {}) {
40800
- const n = this.boardService, u = new board_pb.ReadAnalogReaderRequest();
40801
- return u.setBoardName(this.name), u.setAnalogReaderName(e), u.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(u), (await promisify(n.readAnalogReader.bind(n), u)).getValue();
40802
- }
40803
- async getDigitalInterruptValue(e, s = {}) {
40804
- const n = this.boardService, u = new board_pb.GetDigitalInterruptValueRequest();
40805
- return u.setBoardName(this.name), u.setDigitalInterruptName(e), u.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(u), (await promisify(n.getDigitalInterruptValue.bind(n), u)).getValue();
40806
- }
40807
- }
40808
- var component_camera_v1_camera_pb = camera_pb, common_v1_common_pb$1 = common_pb, google_api_httpbody_pb = httpbody_pb, grpc$2 = grpcWebClient_umdExports.grpc, CameraService = function() {
40809
- function t() {
40810
- }
40811
- return t.serviceName = "viam.component.camera.v1.CameraService", t;
40812
- }();
40813
- CameraService.GetImage = {
40814
- methodName: "GetImage",
40815
- service: CameraService,
40816
- requestStream: !1,
40817
- responseStream: !1,
40818
- requestType: component_camera_v1_camera_pb.GetImageRequest,
40819
- responseType: component_camera_v1_camera_pb.GetImageResponse
40820
- };
40821
- CameraService.RenderFrame = {
40822
- methodName: "RenderFrame",
40823
- service: CameraService,
40824
- requestStream: !1,
40825
- responseStream: !1,
40826
- requestType: component_camera_v1_camera_pb.RenderFrameRequest,
40827
- responseType: google_api_httpbody_pb.HttpBody
40828
- };
40829
- CameraService.GetPointCloud = {
40830
- methodName: "GetPointCloud",
40831
- service: CameraService,
40832
- requestStream: !1,
40833
- responseStream: !1,
40834
- requestType: component_camera_v1_camera_pb.GetPointCloudRequest,
40835
- responseType: component_camera_v1_camera_pb.GetPointCloudResponse
40836
- };
40837
- CameraService.GetProperties = {
40838
- methodName: "GetProperties",
40839
- service: CameraService,
40840
- requestStream: !1,
40841
- responseStream: !1,
40842
- requestType: component_camera_v1_camera_pb.GetPropertiesRequest,
40843
- responseType: component_camera_v1_camera_pb.GetPropertiesResponse
40844
- };
40845
- CameraService.DoCommand = {
40846
- methodName: "DoCommand",
40847
- service: CameraService,
40848
- requestStream: !1,
40849
- responseStream: !1,
40850
- requestType: common_v1_common_pb$1.DoCommandRequest,
40851
- responseType: common_v1_common_pb$1.DoCommandResponse
40852
- };
40853
- function CameraServiceClient(t, e) {
40854
- this.serviceHost = t, this.options = e || {};
40855
- }
40856
- CameraServiceClient.prototype.getImage = function t(e, s, n) {
40857
- arguments.length === 2 && (n = arguments[1]);
40858
- var u = grpc$2.unary(CameraService.GetImage, {
40859
- request: e,
40860
- host: this.serviceHost,
40861
- metadata: s,
40862
- transport: this.options.transport,
40863
- debug: this.options.debug,
40864
- onEnd: function(g) {
40865
- if (n)
40866
- if (g.status !== grpc$2.Code.OK) {
40867
- var p = new Error(g.statusMessage);
40868
- p.code = g.status, p.metadata = g.trailers, n(p, null);
40869
- } else
40870
- n(null, g.message);
40871
- }
40872
- });
40873
- return {
40874
- cancel: function() {
40875
- n = null, u.close();
40876
- }
40877
- };
40878
- };
40879
- CameraServiceClient.prototype.renderFrame = function t(e, s, n) {
40880
- arguments.length === 2 && (n = arguments[1]);
40881
- var u = grpc$2.unary(CameraService.RenderFrame, {
40882
- request: e,
40883
- host: this.serviceHost,
40884
- metadata: s,
40885
- transport: this.options.transport,
40886
- debug: this.options.debug,
40887
- onEnd: function(g) {
40888
- if (n)
40889
- if (g.status !== grpc$2.Code.OK) {
40890
- var p = new Error(g.statusMessage);
40891
- p.code = g.status, p.metadata = g.trailers, n(p, null);
40892
- } else
40893
- n(null, g.message);
40894
- }
40895
- });
40896
- return {
40897
- cancel: function() {
40898
- n = null, u.close();
40899
- }
40900
- };
40901
- };
40902
- CameraServiceClient.prototype.getPointCloud = function t(e, s, n) {
40903
- arguments.length === 2 && (n = arguments[1]);
40904
- var u = grpc$2.unary(CameraService.GetPointCloud, {
40905
- request: e,
40906
- host: this.serviceHost,
40907
- metadata: s,
40908
- transport: this.options.transport,
40909
- debug: this.options.debug,
40910
- onEnd: function(g) {
40911
- if (n)
40912
- if (g.status !== grpc$2.Code.OK) {
40913
- var p = new Error(g.statusMessage);
40914
- p.code = g.status, p.metadata = g.trailers, n(p, null);
40915
- } else
40916
- n(null, g.message);
40917
- }
40918
- });
40919
- return {
40920
- cancel: function() {
40921
- n = null, u.close();
40922
- }
40923
- };
40924
- };
40925
- CameraServiceClient.prototype.getProperties = function t(e, s, n) {
40926
- arguments.length === 2 && (n = arguments[1]);
40927
- var u = grpc$2.unary(CameraService.GetProperties, {
40928
- request: e,
40929
- host: this.serviceHost,
40930
- metadata: s,
40931
- transport: this.options.transport,
40932
- debug: this.options.debug,
40933
- onEnd: function(g) {
40934
- if (n)
40935
- if (g.status !== grpc$2.Code.OK) {
40936
- var p = new Error(g.statusMessage);
40937
- p.code = g.status, p.metadata = g.trailers, n(p, null);
40938
- } else
40939
- n(null, g.message);
40940
- }
40941
- });
40942
- return {
40943
- cancel: function() {
40944
- n = null, u.close();
40945
- }
40946
- };
40947
- };
40948
- CameraServiceClient.prototype.doCommand = function t(e, s, n) {
40949
- arguments.length === 2 && (n = arguments[1]);
40950
- var u = grpc$2.unary(CameraService.DoCommand, {
40951
- request: e,
40952
- host: this.serviceHost,
40953
- metadata: s,
40954
- transport: this.options.transport,
40955
- debug: this.options.debug,
40956
- onEnd: function(g) {
40957
- if (n)
40958
- if (g.status !== grpc$2.Code.OK) {
40959
- var p = new Error(g.statusMessage);
40960
- p.code = g.status, p.metadata = g.trailers, n(p, null);
40961
- } else
40962
- n(null, g.message);
40963
- }
40964
- });
40965
- return {
40966
- cancel: function() {
40967
- n = null, u.close();
40968
- }
40969
- };
40970
- };
40971
- var CameraServiceClient_1 = CameraServiceClient;
40972
- const PointCloudPCD = "pointcloud/pcd";
40973
- class CameraClient {
40974
- client;
40975
- name;
40976
- options;
40977
- constructor(e, s, n = {}) {
40978
- this.client = e.createServiceClient(CameraServiceClient_1), this.name = s, this.options = n;
40979
- }
40980
- get cameraService() {
40981
- return this.client;
40982
- }
40983
- async getImage(e) {
40984
- const s = this.cameraService, n = new camera_pb.GetImageRequest();
40985
- return n.setName(this.name), n.setMimeType(e), this.options.requestLogger?.(n), (await promisify(
40986
- s.getImage.bind(s),
40987
- n
40988
- )).getImage_asU8();
40989
- }
40990
- async renderFrame(e) {
40991
- const s = this.cameraService, n = new camera_pb.GetPointCloudRequest();
40992
- n.setName(this.name), n.setMimeType(e), this.options.requestLogger?.(n);
40993
- const u = await promisify(
40994
- s.renderFrame.bind(s),
40995
- n
40996
- );
40997
- return new Blob([u.getData_asU8()], { type: e });
40998
- }
40999
- async getPointCloud() {
41000
- const e = this.cameraService, s = new camera_pb.GetPointCloudRequest();
41001
- return s.setName(this.name), s.setMimeType(PointCloudPCD), this.options.requestLogger?.(s), (await promisify(e.getPointCloud.bind(e), s)).getPointCloud_asU8();
41002
- }
41003
- async getProperties() {
41004
- const e = this.cameraService, s = new camera_pb.GetPropertiesRequest();
41005
- return s.setName(this.name), this.options.requestLogger?.(s), (await promisify(e.getProperties.bind(e), s)).toObject();
41006
- }
41007
- }
41008
- class MotorClient {
41009
- client;
41010
- name;
41011
- options;
41012
- constructor(e, s, n = {}) {
41013
- this.client = e.createServiceClient(MotorServiceClient_1), this.name = s, this.options = n;
41014
- }
41015
- get motorService() {
41016
- return this.client;
41017
- }
41018
- async setPower(e, s = {}) {
41019
- const n = this.motorService, u = new motor_pb.SetPowerRequest();
41020
- u.setName(this.name), u.setPowerPct(e), u.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(u), await promisify(
41021
- n.setPower.bind(n),
41022
- u
41023
- );
41024
- }
41025
- async goFor(e, s, n = {}) {
41026
- const u = this.motorService, g = new motor_pb.GoForRequest();
41027
- g.setName(this.name), g.setRpm(e), g.setRevolutions(s), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
41028
- u.goFor.bind(u),
41029
- g
41030
- );
41031
- }
41032
- async goTo(e, s, n = {}) {
41033
- const u = this.motorService, g = new motor_pb.GoToRequest();
41034
- g.setName(this.name), g.setRpm(e), g.setPositionRevolutions(s), g.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(g), await promisify(
41035
- u.goTo.bind(u),
41036
- g
41037
- );
41038
- }
41039
- async resetZeroPosition(e, s = {}) {
41040
- const n = this.motorService, u = new motor_pb.ResetZeroPositionRequest();
41041
- u.setName(this.name), u.setOffset(e), u.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(u), await promisify(n.resetZeroPosition.bind(n), u);
41042
- }
41043
- async stop(e = {}) {
41044
- const s = this.motorService, n = new motor_pb.StopRequest();
41045
- n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n), await promisify(
41046
- s.stop.bind(s),
41047
- n
41048
- );
41049
- }
41050
- async getProperties(e = {}) {
41051
- const s = this.motorService, n = new motor_pb.GetPropertiesRequest();
41052
- return n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n), { positionReporting: (await promisify(s.getProperties.bind(s), n)).getPositionReporting() };
41053
- }
41054
- async getPosition(e = {}) {
41055
- const s = this.motorService, n = new motor_pb.GetPositionRequest();
41056
- return n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n), (await promisify(s.getPosition.bind(s), n)).getPosition();
41057
- }
41058
- async isPowered(e = {}) {
41059
- const s = this.motorService, n = new motor_pb.IsPoweredRequest();
41060
- n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
41061
- const u = await promisify(s.isPowered.bind(s), n);
41062
- return [u.getIsOn(), u.getPowerPct()];
41063
- }
41064
- }
41065
- var component_sensor_v1_sensor_pb = sensor_pb, common_v1_common_pb = common_pb, grpc$1 = grpcWebClient_umdExports.grpc, SensorService = function() {
41066
- function t() {
41067
- }
41068
- return t.serviceName = "viam.component.sensor.v1.SensorService", t;
41069
- }();
41070
- SensorService.GetReadings = {
41071
- methodName: "GetReadings",
41072
- service: SensorService,
41073
- requestStream: !1,
41074
- responseStream: !1,
41075
- requestType: component_sensor_v1_sensor_pb.GetReadingsRequest,
41076
- responseType: component_sensor_v1_sensor_pb.GetReadingsResponse
41077
- };
41078
- SensorService.DoCommand = {
41079
- methodName: "DoCommand",
41080
- service: SensorService,
41081
- requestStream: !1,
41082
- responseStream: !1,
41083
- requestType: common_v1_common_pb.DoCommandRequest,
41084
- responseType: common_v1_common_pb.DoCommandResponse
41085
- };
41086
- function SensorServiceClient(t, e) {
41087
- this.serviceHost = t, this.options = e || {};
41088
- }
41089
- SensorServiceClient.prototype.getReadings = function t(e, s, n) {
41090
- arguments.length === 2 && (n = arguments[1]);
41091
- var u = grpc$1.unary(SensorService.GetReadings, {
41092
- request: e,
41093
- host: this.serviceHost,
41094
- metadata: s,
41095
- transport: this.options.transport,
41096
- debug: this.options.debug,
41097
- onEnd: function(g) {
41098
- if (n)
41099
- if (g.status !== grpc$1.Code.OK) {
41100
- var p = new Error(g.statusMessage);
41101
- p.code = g.status, p.metadata = g.trailers, n(p, null);
41102
- } else
41103
- n(null, g.message);
41104
- }
41105
- });
41106
- return {
41107
- cancel: function() {
41108
- n = null, u.close();
41109
- }
41110
- };
41111
- };
41112
- SensorServiceClient.prototype.doCommand = function t(e, s, n) {
41113
- arguments.length === 2 && (n = arguments[1]);
41114
- var u = grpc$1.unary(SensorService.DoCommand, {
41115
- request: e,
41116
- host: this.serviceHost,
41117
- metadata: s,
41118
- transport: this.options.transport,
41119
- debug: this.options.debug,
41120
- onEnd: function(g) {
41121
- if (n)
41122
- if (g.status !== grpc$1.Code.OK) {
41123
- var p = new Error(g.statusMessage);
41124
- p.code = g.status, p.metadata = g.trailers, n(p, null);
41125
- } else
41126
- n(null, g.message);
41127
- }
41128
- });
41129
- return {
41130
- cancel: function() {
41131
- n = null, u.close();
41132
- }
41133
- };
41134
- };
41135
- var SensorServiceClient_1 = SensorServiceClient;
41136
- class SensorClient {
41137
- client;
41138
- name;
41139
- options;
41140
- constructor(e, s, n = {}) {
41141
- this.client = e.createServiceClient(SensorServiceClient_1), this.name = s, this.options = n;
41142
- }
41143
- get sensorService() {
41144
- return this.client;
41145
- }
41146
- async getReadings(e = {}) {
41147
- const s = this.sensorService, n = new sensor_pb.GetReadingsRequest();
41148
- n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
41149
- const u = await promisify(s.getReadings.bind(s), n), g = {};
41150
- for (const [p, o] of u.getReadingsMap().entries())
41151
- g[p] = o.toJavaScript();
41152
- return g;
41153
- }
41154
- }
41155
- class MovementSensorClient {
41156
- client;
41157
- sensorclient;
41158
- name;
41159
- options;
41160
- constructor(e, s, n = {}) {
41161
- this.client = e.createServiceClient(MovementSensorServiceClient_1), this.sensorclient = new SensorClient(e, s, n), this.name = s, this.options = n;
41162
- }
41163
- get movementsensorService() {
41164
- return this.client;
41165
- }
41166
- async getLinearVelocity(e = {}) {
41167
- const s = this.movementsensorService, n = new movementsensor_pb.GetLinearVelocityRequest();
41168
- n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
41169
- const g = (await promisify(
41170
- s.getLinearVelocity.bind(s),
41171
- n
41172
- )).getLinearVelocity();
41173
- if (!g)
41174
- throw new Error("no linear velocity");
41175
- return decodeVector3D(g);
41176
- }
41177
- async getAngularVelocity(e = {}) {
41178
- const s = this.movementsensorService, n = new movementsensor_pb.GetAngularVelocityRequest();
41179
- n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
41180
- const g = (await promisify(
41181
- s.getAngularVelocity.bind(s),
41182
- n
41183
- )).getAngularVelocity();
41184
- if (!g)
41185
- throw new Error("no angular velocity");
41186
- return decodeVector3D(g);
41187
- }
41188
- async getCompassHeading(e = {}) {
41189
- const s = this.movementsensorService, n = new movementsensor_pb.GetCompassHeadingRequest();
41190
- return n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n), (await promisify(
41191
- s.getCompassHeading.bind(s),
41192
- n
41193
- )).getValue();
41194
- }
41195
- async getOrientation(e = {}) {
41196
- const s = this.movementsensorService, n = new movementsensor_pb.GetOrientationRequest();
41197
- n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
41198
- const g = (await promisify(
41199
- s.getOrientation.bind(s),
41200
- n
41201
- )).getOrientation();
41202
- if (!g)
41203
- throw new Error("no orientation");
41204
- return {
41205
- ox: g.getOX(),
41206
- oy: g.getOY(),
41207
- oz: g.getOZ(),
41208
- theta: g.getTheta()
41209
- };
41210
- }
41211
- async getPosition(e = {}) {
41212
- const s = this.movementsensorService, n = new movementsensor_pb.GetPositionRequest();
41213
- n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
41214
- const u = await promisify(s.getPosition.bind(s), n), g = u.getCoordinate();
41215
- if (!g)
41216
- throw new Error("no coordinate");
41217
- return {
41218
- latitude: g.getLatitude(),
41219
- longitude: g.getLongitude(),
41220
- altitudeMM: u.getAltitudeMm()
41221
- };
41222
- }
41223
- async getProperties(e = {}) {
41224
- const s = this.movementsensorService, n = new movementsensor_pb.GetPropertiesRequest();
41225
- n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
41226
- const u = await promisify(s.getProperties.bind(s), n);
41227
- return {
41228
- linearVelocitySupported: u.getLinearVelocitySupported(),
41229
- angularVelocitySupported: u.getAngularVelocitySupported(),
41230
- orientationSupported: u.getOrientationSupported(),
41231
- positionSupported: u.getPositionSupported(),
41232
- compassHeadingSupported: u.getCompassHeadingSupported(),
41233
- linearAccelerationSupported: u.getLinearAccelerationSupported()
41234
- };
41235
- }
41236
- async getAccuracy(e = {}) {
41237
- const s = this.movementsensorService, n = new movementsensor_pb.GetAccuracyRequest();
41238
- n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
41239
- const g = (await promisify(s.getAccuracy.bind(s), n)).getAccuracyMmMap(), p = {};
41240
- for (const [o, r] of g.entries())
41241
- p[o] = r;
41242
- return p;
41243
- }
41244
- async getLinearAcceleration(e = {}) {
41245
- const s = this.movementsensorService, n = new movementsensor_pb.GetLinearAccelerationRequest();
41246
- n.setName(this.name), n.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(n);
41247
- const g = (await promisify(
41248
- s.getLinearAcceleration.bind(s),
41249
- n
41250
- )).getLinearAcceleration();
41251
- if (!g)
41252
- throw new Error("no linear acceleration");
41253
- return decodeVector3D(g);
41254
- }
41255
- getReadings(e = {}) {
41256
- return this.sensorclient.getReadings(e);
41257
- }
41258
- }
41259
41285
  var proto_stream_v1_stream_pb = stream_pb, grpc = grpcWebClient_umdExports.grpc, StreamService = function() {
41260
41286
  function t() {
41261
41287
  }
@@ -41401,12 +41427,77 @@ class StreamClient extends EventDispatcher {
41401
41427
  }
41402
41428
  }
41403
41429
  }
41430
+ const encodeLinearConstraint = (t) => {
41431
+ const e = new motion_pb.LinearConstraint();
41432
+ return e.setLineToleranceMm(t.lineToleranceMm), e.setOrientationToleranceDegs(t.orientationToleranceDegs), e;
41433
+ }, encodeOrientationConstraint = (t) => {
41434
+ const e = new motion_pb.OrientationConstraint();
41435
+ return e.setOrientationToleranceDegs(t.orientationToleranceDegs), e;
41436
+ }, encodeAllowedFrameCollisions = (t) => {
41437
+ const e = new motion_pb.CollisionSpecification.AllowedFrameCollisions();
41438
+ return e.setFrame1(t.frame1), e.setFrame2(t.frame2), e;
41439
+ }, encodeCollisionSpecification = (t) => {
41440
+ const e = new motion_pb.CollisionSpecification();
41441
+ return e.setAllowsList(t.allowsList.map(encodeAllowedFrameCollisions)), e;
41442
+ }, encodeConstraints = (t) => {
41443
+ const e = new motion_pb.Constraints();
41444
+ return e.setLinearConstraintList(
41445
+ t.linearConstraintList.map(encodeLinearConstraint)
41446
+ ), e.setOrientationConstraintList(
41447
+ t.orientationConstraintList.map(encodeOrientationConstraint)
41448
+ ), e.setCollisionSpecificationList(
41449
+ t.collisionSpecificationList.map(encodeCollisionSpecification)
41450
+ ), e;
41451
+ };
41452
+ class MotionClient {
41453
+ client;
41454
+ name;
41455
+ options;
41456
+ constructor(e, s, n = {}) {
41457
+ this.client = e.createServiceClient(MotionServiceClient_1), this.name = s, this.options = n;
41458
+ }
41459
+ get service() {
41460
+ return this.client;
41461
+ }
41462
+ async move(e, s, n, u, g = {}) {
41463
+ const p = this.service, o = new motion_pb.MoveRequest();
41464
+ return o.setName(this.name), o.setDestination(encodePoseInFrame(e)), o.setComponentName(encodeResourceName(s)), n !== void 0 && o.setWorldState(encodeWorldState(n)), u !== void 0 && o.setConstraints(encodeConstraints(u)), o.setExtra(struct_pb.Struct.fromJavaScript(g)), this.options.requestLogger?.(o), (await promisify(
41465
+ p.move.bind(p),
41466
+ o
41467
+ )).getSuccess();
41468
+ }
41469
+ async moveOnMap(e, s, n, u = {}) {
41470
+ const g = this.service, p = new motion_pb.MoveOnMapRequest();
41471
+ return p.setName(this.name), p.setDestination(encodePose(e)), p.setComponentName(encodeResourceName(s)), p.setSlamServiceName(encodeResourceName(n)), p.setExtra(struct_pb.Struct.fromJavaScript(u)), this.options.requestLogger?.(p), (await promisify(
41472
+ g.moveOnMap.bind(g),
41473
+ p
41474
+ )).getSuccess();
41475
+ }
41476
+ async moveSingleComponent(e, s, n, u = {}) {
41477
+ const g = this.service, p = new motion_pb.MoveSingleComponentRequest();
41478
+ return p.setName(this.name), p.setDestination(encodePoseInFrame(e)), p.setComponentName(encodeResourceName(s)), n !== void 0 && p.setWorldState(encodeWorldState(n)), p.setExtra(struct_pb.Struct.fromJavaScript(u)), this.options.requestLogger?.(p), (await promisify(g.moveSingleComponent.bind(g), p)).getSuccess();
41479
+ }
41480
+ async getPose(e, s, n, u = {}) {
41481
+ const g = this.service, p = new motion_pb.GetPoseRequest();
41482
+ p.setName(this.name), p.setComponentName(encodeResourceName(e)), p.setDestinationFrame(s), p.setSupplementalTransformsList(
41483
+ n.map(encodeTransform)
41484
+ ), p.setExtra(struct_pb.Struct.fromJavaScript(u)), this.options.requestLogger?.(p);
41485
+ const r = (await promisify(
41486
+ g.getPose.bind(g),
41487
+ p
41488
+ )).getPose();
41489
+ if (!r)
41490
+ throw new Error("no pose");
41491
+ return r.toObject();
41492
+ }
41493
+ }
41404
41494
  export {
41405
41495
  ArmClient,
41406
41496
  BaseClient,
41407
41497
  BoardClient,
41408
41498
  CameraClient,
41409
41499
  RobotClient as Client,
41500
+ MotionClient,
41410
41501
  MotorClient,
41411
41502
  MovementSensorClient,
41412
41503
  RobotClient,