buttplug 3.2.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- var nt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
- function It(r) {
1
+ var rt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
+ function Dt(r) {
3
3
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
4
4
  }
5
- var ot = { exports: {} };
5
+ var at = { exports: {} };
6
6
  (function(r) {
7
7
  var e = Object.prototype.hasOwnProperty, t = "~";
8
8
  function n() {
@@ -112,9 +112,9 @@ var ot = { exports: {} };
112
112
  var p;
113
113
  return v ? (p = t ? t + v : v, this._events[p] && a(this, p)) : (this._events = new n(), this._eventsCount = 0), this;
114
114
  }, f.prototype.off = f.prototype.removeListener, f.prototype.addListener = f.prototype.on, f.prefixed = t, f.EventEmitter = f, r.exports = f;
115
- })(ot);
116
- var Rt = ot.exports;
117
- const ye = /* @__PURE__ */ It(Rt);
115
+ })(at);
116
+ var Nt = at.exports;
117
+ const ve = /* @__PURE__ */ Dt(Nt);
118
118
  /*!
119
119
  * Buttplug JS Source Code File - Visit https://buttplug.io for more info about
120
120
  * the project. Licensed under the BSD 3-Clause license. See LICENSE file in the
@@ -122,8 +122,8 @@ const ye = /* @__PURE__ */ It(Rt);
122
122
  *
123
123
  * @copyright Copyright (c) Nonpolynomial Labs LLC. All rights reserved.
124
124
  */
125
- var at = /* @__PURE__ */ ((r) => (r[r.Off = 0] = "Off", r[r.Error = 1] = "Error", r[r.Warn = 2] = "Warn", r[r.Info = 3] = "Info", r[r.Debug = 4] = "Debug", r[r.Trace = 5] = "Trace", r))(at || {});
126
- class Dt {
125
+ var ct = /* @__PURE__ */ ((r) => (r[r.Off = 0] = "Off", r[r.Error = 1] = "Error", r[r.Warn = 2] = "Warn", r[r.Info = 3] = "Info", r[r.Debug = 4] = "Debug", r[r.Trace = 5] = "Trace", r))(ct || {});
126
+ class Tt {
127
127
  /**
128
128
  * @param logMessage Log message.
129
129
  * @param logLevel: Log severity level.
@@ -154,10 +154,10 @@ class Dt {
154
154
  * Returns a formatted string with timestamp, level, and message.
155
155
  */
156
156
  get FormattedMessage() {
157
- return `${at[this.logLevel]} : ${this.timestamp} : ${this.logMessage}`;
157
+ return `${ct[this.logLevel]} : ${this.timestamp} : ${this.logMessage}`;
158
158
  }
159
159
  }
160
- const ct = class pe extends ye {
160
+ const ut = class le extends ve {
161
161
  /**
162
162
  * Constructor. Can only be called internally since we regulate ButtplugLogger
163
163
  * ownership.
@@ -170,7 +170,7 @@ const ct = class pe extends ye {
170
170
  * doesn't currently exist.
171
171
  */
172
172
  static get Logger() {
173
- return pe.sLogger === void 0 && (pe.sLogger = new pe()), this.sLogger;
173
+ return le.sLogger === void 0 && (le.sLogger = new le()), this.sLogger;
174
174
  }
175
175
  /**
176
176
  * Set the maximum log level to output to console.
@@ -253,17 +253,17 @@ const ct = class pe extends ye {
253
253
  AddLogMessage(e, t) {
254
254
  if (t > this.maximumEventLogLevel && t > this.maximumConsoleLogLevel)
255
255
  return;
256
- const n = new Dt(e, t);
256
+ const n = new Tt(e, t);
257
257
  t <= this.maximumConsoleLogLevel && console.log(n.FormattedMessage), t <= this.maximumEventLogLevel && this.emit("log", n);
258
258
  }
259
259
  };
260
- ct.sLogger = void 0;
261
- let Tt = ct;
260
+ ut.sLogger = void 0;
261
+ let Pt = ut;
262
262
  var b;
263
263
  (function(r) {
264
264
  r[r.PLAIN_TO_CLASS = 0] = "PLAIN_TO_CLASS", r[r.CLASS_TO_PLAIN = 1] = "CLASS_TO_PLAIN", r[r.CLASS_TO_CLASS = 2] = "CLASS_TO_CLASS";
265
265
  })(b || (b = {}));
266
- var Nt = (
266
+ var kt = (
267
267
  /** @class */
268
268
  function() {
269
269
  function r() {
@@ -361,8 +361,8 @@ var Nt = (
361
361
  return this._ancestorsMap.get(e);
362
362
  }, r;
363
363
  }()
364
- ), F = new Nt();
365
- function Pt() {
364
+ ), F = new kt();
365
+ function jt() {
366
366
  if (typeof globalThis < "u")
367
367
  return globalThis;
368
368
  if (typeof global < "u")
@@ -372,20 +372,20 @@ function Pt() {
372
372
  if (typeof self < "u")
373
373
  return self;
374
374
  }
375
- function kt(r) {
375
+ function Bt(r) {
376
376
  return r !== null && typeof r == "object" && typeof r.then == "function";
377
377
  }
378
- var rt = globalThis && globalThis.__spreadArray || function(r, e, t) {
378
+ var st = globalThis && globalThis.__spreadArray || function(r, e, t) {
379
379
  if (t || arguments.length === 2)
380
380
  for (var n = 0, i = e.length, u; n < i; n++)
381
381
  (u || !(n in e)) && (u || (u = Array.prototype.slice.call(e, 0, n)), u[n] = e[n]);
382
382
  return r.concat(u || Array.prototype.slice.call(e));
383
383
  };
384
- function jt(r) {
384
+ function $t(r) {
385
385
  var e = new r();
386
386
  return !(e instanceof Set) && !("push" in e) ? [] : e;
387
387
  }
388
- var ie = (
388
+ var oe = (
389
389
  /** @class */
390
390
  function() {
391
391
  function r(e, t) {
@@ -394,7 +394,7 @@ var ie = (
394
394
  return r.prototype.transform = function(e, t, n, i, u, a) {
395
395
  var f = this;
396
396
  if (a === void 0 && (a = 0), Array.isArray(t) || t instanceof Set) {
397
- var l = i && this.transformationType === b.PLAIN_TO_CLASS ? jt(i) : [];
397
+ var l = i && this.transformationType === b.PLAIN_TO_CLASS ? $t(i) : [];
398
398
  return t.forEach(function(g, I) {
399
399
  var O = e ? e[I] : void 0;
400
400
  if (!f.options.enableCircularCheck || !f.isCircular(g)) {
@@ -426,9 +426,9 @@ var ie = (
426
426
  return t == null ? t : !!t;
427
427
  if ((n === Date || t instanceof Date) && !u)
428
428
  return t instanceof Date ? new Date(t.valueOf()) : t == null ? t : new Date(t);
429
- if (Pt().Buffer && (n === Buffer || t instanceof Buffer) && !u)
429
+ if (jt().Buffer && (n === Buffer || t instanceof Buffer) && !u)
430
430
  return t == null ? t : Buffer.from(t);
431
- if (kt(t) && !u)
431
+ if (Bt(t) && !u)
432
432
  return new Promise(function(g, I) {
433
433
  t.then(function(O) {
434
434
  return g(f.transform(void 0, O, n, void 0, void 0, a + 1));
@@ -459,15 +459,15 @@ var ie = (
459
459
  if (n && u)
460
460
  k = n;
461
461
  else if (n) {
462
- var T = F.findTypeMetadata(n, S);
463
- if (T) {
464
- var Se = { newObject: p, object: t, property: S }, de = T.typeFunction ? T.typeFunction(Se) : T.reflectedType;
465
- T.options && T.options.discriminator && T.options.discriminator.property && T.options.discriminator.subTypes ? t[I] instanceof Array ? k = T : (h.transformationType === b.PLAIN_TO_CLASS && (k = T.options.discriminator.subTypes.find(function(q) {
466
- if (C && C instanceof Object && T.options.discriminator.property in C)
467
- return q.name === C[T.options.discriminator.property];
468
- }), k === void 0 ? k = de : k = k.value, T.options.keepDiscriminatorProperty || C && C instanceof Object && T.options.discriminator.property in C && delete C[T.options.discriminator.property]), h.transformationType === b.CLASS_TO_CLASS && (k = C.constructor), h.transformationType === b.CLASS_TO_PLAIN && C && (C[T.options.discriminator.property] = T.options.discriminator.subTypes.find(function(q) {
462
+ var N = F.findTypeMetadata(n, S);
463
+ if (N) {
464
+ var Me = { newObject: p, object: t, property: S }, he = N.typeFunction ? N.typeFunction(Me) : N.reflectedType;
465
+ N.options && N.options.discriminator && N.options.discriminator.property && N.options.discriminator.subTypes ? t[I] instanceof Array ? k = N : (h.transformationType === b.PLAIN_TO_CLASS && (k = N.options.discriminator.subTypes.find(function(q) {
466
+ if (C && C instanceof Object && N.options.discriminator.property in C)
467
+ return q.name === C[N.options.discriminator.property];
468
+ }), k === void 0 ? k = he : k = k.value, N.options.keepDiscriminatorProperty || C && C instanceof Object && N.options.discriminator.property in C && delete C[N.options.discriminator.property]), h.transformationType === b.CLASS_TO_CLASS && (k = C.constructor), h.transformationType === b.CLASS_TO_PLAIN && C && (C[N.options.discriminator.property] = N.options.discriminator.subTypes.find(function(q) {
469
469
  return q.value === C.constructor;
470
- }).name)) : k = de, Y = Y || T.reflectedType === Map;
470
+ }).name)) : k = he, Y = Y || N.reflectedType === Map;
471
471
  } else if (h.options.targetMaps)
472
472
  h.options.targetMaps.filter(function(q) {
473
473
  return q.target === n && !!q.properties[S];
@@ -475,20 +475,20 @@ var ie = (
475
475
  return k = q.properties[S];
476
476
  });
477
477
  else if (h.options.enableImplicitConversion && h.transformationType === b.PLAIN_TO_CLASS) {
478
- var he = Reflect.getMetadata("design:type", n.prototype, S);
479
- he && (k = he);
478
+ var pe = Reflect.getMetadata("design:type", n.prototype, S);
479
+ pe && (k = pe);
480
480
  }
481
481
  }
482
- var K = Array.isArray(t[I]) ? h.getReflectedType(n, S) : void 0, ue = e ? e[I] : void 0;
482
+ var K = Array.isArray(t[I]) ? h.getReflectedType(n, S) : void 0, fe = e ? e[I] : void 0;
483
483
  if (p.constructor.prototype) {
484
- var ne = Object.getOwnPropertyDescriptor(p.constructor.prototype, O);
484
+ var re = Object.getOwnPropertyDescriptor(p.constructor.prototype, O);
485
485
  if ((h.transformationType === b.PLAIN_TO_CLASS || h.transformationType === b.CLASS_TO_CLASS) && // eslint-disable-next-line @typescript-eslint/unbound-method
486
- (ne && !ne.set || p[O] instanceof Function))
486
+ (re && !re.set || p[O] instanceof Function))
487
487
  return "continue";
488
488
  }
489
489
  if (!h.options.enableCircularCheck || !h.isCircular(C)) {
490
490
  var te = h.transformationType === b.PLAIN_TO_CLASS ? O : g, L = void 0;
491
- h.transformationType === b.CLASS_TO_PLAIN ? (L = t[te], L = h.applyCustomTransformations(L, n, te, t, h.transformationType), L = t[te] === L ? C : L, L = h.transform(ue, L, k, K, Y, a + 1)) : C === void 0 && h.options.exposeDefaultValues ? L = p[O] : (L = h.transform(ue, C, k, K, Y, a + 1), L = h.applyCustomTransformations(L, n, te, t, h.transformationType)), (L !== void 0 || h.options.exposeUnsetFields) && (p instanceof Map ? p.set(O, L) : p[O] = L);
491
+ h.transformationType === b.CLASS_TO_PLAIN ? (L = t[te], L = h.applyCustomTransformations(L, n, te, t, h.transformationType), L = t[te] === L ? C : L, L = h.transform(fe, L, k, K, Y, a + 1)) : C === void 0 && h.options.exposeDefaultValues ? L = p[O] : (L = h.transform(fe, C, k, K, Y, a + 1), L = h.applyCustomTransformations(L, n, te, t, h.transformationType)), (L !== void 0 || h.options.exposeUnsetFields) && (p instanceof Map ? p.set(O, L) : p[O] = L);
492
492
  } else if (h.transformationType === b.CLASS_TO_CLASS) {
493
493
  var L = C;
494
494
  L = h.applyCustomTransformations(L, n, g, t, h.transformationType), (L !== void 0 || h.options.exposeUnsetFields) && (p instanceof Map ? p.set(O, L) : p[O] = L);
@@ -527,7 +527,7 @@ var ie = (
527
527
  return a;
528
528
  if (this.options.ignoreDecorators && this.options.excludeExtraneousValues && e) {
529
529
  var f = F.getExposedProperties(e, this.transformationType), l = F.getExcludedProperties(e, this.transformationType);
530
- a = rt(rt([], f, !0), l, !0);
530
+ a = st(st([], f, !0), l, !0);
531
531
  }
532
532
  if (!this.options.ignoreDecorators && e) {
533
533
  var f = F.getExposedProperties(e, this.transformationType);
@@ -565,7 +565,7 @@ var ie = (
565
565
  }) : !0;
566
566
  }, r;
567
567
  }()
568
- ), oe = {
568
+ ), ae = {
569
569
  enableCircularCheck: !1,
570
570
  enableImplicitConversion: !1,
571
571
  excludeExtraneousValues: !1,
@@ -586,28 +586,28 @@ var ie = (
586
586
  }
587
587
  return r;
588
588
  }, G.apply(this, arguments);
589
- }, Bt = (
589
+ }, Ft = (
590
590
  /** @class */
591
591
  function() {
592
592
  function r() {
593
593
  }
594
594
  return r.prototype.instanceToPlain = function(e, t) {
595
- var n = new ie(b.CLASS_TO_PLAIN, G(G({}, oe), t));
595
+ var n = new oe(b.CLASS_TO_PLAIN, G(G({}, ae), t));
596
596
  return n.transform(void 0, e, void 0, void 0, void 0, void 0);
597
597
  }, r.prototype.classToPlainFromExist = function(e, t, n) {
598
- var i = new ie(b.CLASS_TO_PLAIN, G(G({}, oe), n));
598
+ var i = new oe(b.CLASS_TO_PLAIN, G(G({}, ae), n));
599
599
  return i.transform(t, e, void 0, void 0, void 0, void 0);
600
600
  }, r.prototype.plainToInstance = function(e, t, n) {
601
- var i = new ie(b.PLAIN_TO_CLASS, G(G({}, oe), n));
601
+ var i = new oe(b.PLAIN_TO_CLASS, G(G({}, ae), n));
602
602
  return i.transform(void 0, t, e, void 0, void 0, void 0);
603
603
  }, r.prototype.plainToClassFromExist = function(e, t, n) {
604
- var i = new ie(b.PLAIN_TO_CLASS, G(G({}, oe), n));
604
+ var i = new oe(b.PLAIN_TO_CLASS, G(G({}, ae), n));
605
605
  return i.transform(e, t, void 0, void 0, void 0, void 0);
606
606
  }, r.prototype.instanceToInstance = function(e, t) {
607
- var n = new ie(b.CLASS_TO_CLASS, G(G({}, oe), t));
607
+ var n = new oe(b.CLASS_TO_CLASS, G(G({}, ae), t));
608
608
  return n.transform(void 0, e, void 0, void 0, void 0, void 0);
609
609
  }, r.prototype.classToClassFromExist = function(e, t, n) {
610
- var i = new ie(b.CLASS_TO_CLASS, G(G({}, oe), n));
610
+ var i = new oe(b.CLASS_TO_CLASS, G(G({}, ae), n));
611
611
  return i.transform(t, e, void 0, void 0, void 0, void 0);
612
612
  }, r.prototype.serialize = function(e, t) {
613
613
  return JSON.stringify(this.instanceToPlain(e, t));
@@ -620,7 +620,7 @@ var ie = (
620
620
  }, r;
621
621
  }()
622
622
  );
623
- function Oe(r, e) {
623
+ function Le(r, e) {
624
624
  return e === void 0 && (e = {}), function(t, n) {
625
625
  var i = Reflect.getMetadata("design:type", t, n);
626
626
  F.addTypeMetadata({
@@ -632,12 +632,12 @@ function Oe(r, e) {
632
632
  });
633
633
  };
634
634
  }
635
- var ut = new Bt();
636
- function $t(r, e) {
637
- return ut.instanceToPlain(r, e);
635
+ var ft = new Ft();
636
+ function Ut(r, e) {
637
+ return ft.instanceToPlain(r, e);
638
638
  }
639
- function Ft(r, e, t) {
640
- return ut.plainToInstance(r, e, t);
639
+ function Wt(r, e, t) {
640
+ return ft.plainToInstance(r, e, t);
641
641
  }
642
642
  /*! *****************************************************************************
643
643
  Copyright (C) Microsoft. All rights reserved.
@@ -653,10 +653,10 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
653
653
  See the Apache Version 2.0 License for specific language governing permissions
654
654
  and limitations under the License.
655
655
  ***************************************************************************** */
656
- var st;
656
+ var it;
657
657
  (function(r) {
658
658
  (function(e) {
659
- var t = typeof nt == "object" ? nt : typeof self == "object" ? self : typeof this == "object" ? this : Function("return this;")(), n = i(r);
659
+ var t = typeof rt == "object" ? rt : typeof self == "object" ? self : typeof this == "object" ? this : Function("return this;")(), n = i(r);
660
660
  typeof t.Reflect > "u" ? t.Reflect = r : n = i(t.Reflect, n), e(n);
661
661
  function i(u, a) {
662
662
  return function(f, l) {
@@ -667,11 +667,11 @@ var st;
667
667
  var t = Object.prototype.hasOwnProperty, n = typeof Symbol == "function", i = n && typeof Symbol.toPrimitive < "u" ? Symbol.toPrimitive : "@@toPrimitive", u = n && typeof Symbol.iterator < "u" ? Symbol.iterator : "@@iterator", a = typeof Object.create == "function", f = { __proto__: [] } instanceof Array, l = !a && !f, v = {
668
668
  // create an object in dictionary mode (a.k.a. "slow" mode in v8)
669
669
  create: a ? function() {
670
- return be(/* @__PURE__ */ Object.create(null));
670
+ return Ce(/* @__PURE__ */ Object.create(null));
671
671
  } : f ? function() {
672
- return be({ __proto__: null });
672
+ return Ce({ __proto__: null });
673
673
  } : function() {
674
- return be({});
674
+ return Ce({});
675
675
  },
676
676
  has: l ? function(s, o) {
677
677
  return t.call(s, o);
@@ -683,22 +683,22 @@ var st;
683
683
  } : function(s, o) {
684
684
  return s[o];
685
685
  }
686
- }, p = Object.getPrototypeOf(Function), m = typeof process == "object" && process.env && process.env.REFLECT_METADATA_USE_MAP_POLYFILL === "true", h = !m && typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map : Et(), R = !m && typeof Set == "function" && typeof Set.prototype.entries == "function" ? Set : Ot(), E = !m && typeof WeakMap == "function" ? WeakMap : Lt(), $ = new E();
686
+ }, p = Object.getPrototypeOf(Function), m = typeof process == "object" && process.env && process.env.REFLECT_METADATA_USE_MAP_POLYFILL === "true", h = !m && typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map : Lt(), R = !m && typeof Set == "function" && typeof Set.prototype.entries == "function" ? Set : It(), E = !m && typeof WeakMap == "function" ? WeakMap : Rt(), $ = new E();
687
687
  function g(s, o, c, d) {
688
- if (N(c)) {
689
- if (!Ke(s))
688
+ if (T(c)) {
689
+ if (!Ve(s))
690
690
  throw new TypeError();
691
- if (!Ve(o))
691
+ if (!et(o))
692
692
  throw new TypeError();
693
- return de(s, o);
693
+ return he(s, o);
694
694
  } else {
695
- if (!Ke(s))
695
+ if (!Ve(s))
696
696
  throw new TypeError();
697
697
  if (!j(o))
698
698
  throw new TypeError();
699
- if (!j(d) && !N(d) && !re(d))
699
+ if (!j(d) && !T(d) && !se(d))
700
700
  throw new TypeError();
701
- return re(d) && (d = void 0), c = Z(c), he(s, o, c, d);
701
+ return se(d) && (d = void 0), c = Z(c), pe(s, o, c, d);
702
702
  }
703
703
  }
704
704
  e("decorate", g);
@@ -706,7 +706,7 @@ var st;
706
706
  function c(d, y) {
707
707
  if (!j(d))
708
708
  throw new TypeError();
709
- if (!N(y) && !Mt(y))
709
+ if (!T(y) && !Ct(y))
710
710
  throw new TypeError();
711
711
  q(s, o, d, y);
712
712
  }
@@ -716,78 +716,78 @@ var st;
716
716
  function O(s, o, c, d) {
717
717
  if (!j(c))
718
718
  throw new TypeError();
719
- return N(d) || (d = Z(d)), q(s, o, c, d);
719
+ return T(d) || (d = Z(d)), q(s, o, c, d);
720
720
  }
721
721
  e("defineMetadata", O);
722
722
  function S(s, o, c) {
723
723
  if (!j(o))
724
724
  throw new TypeError();
725
- return N(c) || (c = Z(c)), ue(s, o, c);
725
+ return T(c) || (c = Z(c)), fe(s, o, c);
726
726
  }
727
727
  e("hasMetadata", S);
728
728
  function W(s, o, c) {
729
729
  if (!j(o))
730
730
  throw new TypeError();
731
- return N(c) || (c = Z(c)), ne(s, o, c);
731
+ return T(c) || (c = Z(c)), re(s, o, c);
732
732
  }
733
733
  e("hasOwnMetadata", W);
734
734
  function C(s, o, c) {
735
735
  if (!j(o))
736
736
  throw new TypeError();
737
- return N(c) || (c = Z(c)), te(s, o, c);
737
+ return T(c) || (c = Z(c)), te(s, o, c);
738
738
  }
739
739
  e("getMetadata", C);
740
740
  function k(s, o, c) {
741
741
  if (!j(o))
742
742
  throw new TypeError();
743
- return N(c) || (c = Z(c)), L(s, o, c);
743
+ return T(c) || (c = Z(c)), L(s, o, c);
744
744
  }
745
745
  e("getOwnMetadata", k);
746
746
  function Y(s, o) {
747
747
  if (!j(s))
748
748
  throw new TypeError();
749
- return N(o) || (o = Z(o)), Xe(s, o);
749
+ return T(o) || (o = Z(o)), Ze(s, o);
750
750
  }
751
751
  e("getMetadataKeys", Y);
752
- function T(s, o) {
752
+ function N(s, o) {
753
753
  if (!j(s))
754
754
  throw new TypeError();
755
- return N(o) || (o = Z(o)), Ze(s, o);
755
+ return T(o) || (o = Z(o)), Qe(s, o);
756
756
  }
757
- e("getOwnMetadataKeys", T);
758
- function Se(s, o, c) {
757
+ e("getOwnMetadataKeys", N);
758
+ function Me(s, o, c) {
759
759
  if (!j(o))
760
760
  throw new TypeError();
761
- N(c) || (c = Z(c));
761
+ T(c) || (c = Z(c));
762
762
  var d = K(
763
763
  o,
764
764
  c,
765
765
  /*Create*/
766
766
  !1
767
767
  );
768
- if (N(d) || !d.delete(s))
768
+ if (T(d) || !d.delete(s))
769
769
  return !1;
770
770
  if (d.size > 0)
771
771
  return !0;
772
772
  var y = $.get(o);
773
773
  return y.delete(c), y.size > 0 || $.delete(o), !0;
774
774
  }
775
- e("deleteMetadata", Se);
776
- function de(s, o) {
775
+ e("deleteMetadata", Me);
776
+ function he(s, o) {
777
777
  for (var c = s.length - 1; c >= 0; --c) {
778
778
  var d = s[c], y = d(o);
779
- if (!N(y) && !re(y)) {
780
- if (!Ve(y))
779
+ if (!T(y) && !se(y)) {
780
+ if (!et(y))
781
781
  throw new TypeError();
782
782
  o = y;
783
783
  }
784
784
  }
785
785
  return o;
786
786
  }
787
- function he(s, o, c, d) {
787
+ function pe(s, o, c, d) {
788
788
  for (var y = s.length - 1; y >= 0; --y) {
789
789
  var B = s[y], _ = B(o, c, d);
790
- if (!N(_) && !re(_)) {
790
+ if (!T(_) && !se(_)) {
791
791
  if (!j(_))
792
792
  throw new TypeError();
793
793
  d = _;
@@ -797,41 +797,41 @@ var st;
797
797
  }
798
798
  function K(s, o, c) {
799
799
  var d = $.get(s);
800
- if (N(d)) {
800
+ if (T(d)) {
801
801
  if (!c)
802
802
  return;
803
803
  d = new h(), $.set(s, d);
804
804
  }
805
805
  var y = d.get(o);
806
- if (N(y)) {
806
+ if (T(y)) {
807
807
  if (!c)
808
808
  return;
809
809
  y = new h(), d.set(o, y);
810
810
  }
811
811
  return y;
812
812
  }
813
- function ue(s, o, c) {
814
- var d = ne(s, o, c);
813
+ function fe(s, o, c) {
814
+ var d = re(s, o, c);
815
815
  if (d)
816
816
  return !0;
817
- var y = Me(o);
818
- return re(y) ? !1 : ue(s, y, c);
817
+ var y = be(o);
818
+ return se(y) ? !1 : fe(s, y, c);
819
819
  }
820
- function ne(s, o, c) {
820
+ function re(s, o, c) {
821
821
  var d = K(
822
822
  o,
823
823
  c,
824
824
  /*Create*/
825
825
  !1
826
826
  );
827
- return N(d) ? !1 : _t(d.has(s));
827
+ return T(d) ? !1 : Mt(d.has(s));
828
828
  }
829
829
  function te(s, o, c) {
830
- var d = ne(s, o, c);
830
+ var d = re(s, o, c);
831
831
  if (d)
832
832
  return L(s, o, c);
833
- var y = Me(o);
834
- if (!re(y))
833
+ var y = be(o);
834
+ if (!se(y))
835
835
  return te(s, y, c);
836
836
  }
837
837
  function L(s, o, c) {
@@ -841,7 +841,7 @@ var st;
841
841
  /*Create*/
842
842
  !1
843
843
  );
844
- if (!N(d))
844
+ if (!T(d))
845
845
  return d.get(s);
846
846
  }
847
847
  function q(s, o, c, d) {
@@ -853,11 +853,11 @@ var st;
853
853
  );
854
854
  y.set(s, o);
855
855
  }
856
- function Xe(s, o) {
857
- var c = Ze(s, o), d = Me(s);
856
+ function Ze(s, o) {
857
+ var c = Qe(s, o), d = be(s);
858
858
  if (d === null)
859
859
  return c;
860
- var y = Xe(d, o);
860
+ var y = Ze(d, o);
861
861
  if (y.length <= 0)
862
862
  return c;
863
863
  if (c.length <= 0)
@@ -866,31 +866,31 @@ var st;
866
866
  var x = w[M], A = B.has(x);
867
867
  A || (B.add(x), _.push(x));
868
868
  }
869
- for (var V = 0, tt = y; V < tt.length; V++) {
870
- var x = tt[V], A = B.has(x);
869
+ for (var V = 0, nt = y; V < nt.length; V++) {
870
+ var x = nt[V], A = B.has(x);
871
871
  A || (B.add(x), _.push(x));
872
872
  }
873
873
  return _;
874
874
  }
875
- function Ze(s, o) {
875
+ function Qe(s, o) {
876
876
  var c = [], d = K(
877
877
  s,
878
878
  o,
879
879
  /*Create*/
880
880
  !1
881
881
  );
882
- if (N(d))
882
+ if (T(d))
883
883
  return c;
884
- for (var y = d.keys(), B = bt(y), _ = 0; ; ) {
885
- var M = xt(B);
884
+ for (var y = d.keys(), B = xt(y), _ = 0; ; ) {
885
+ var M = Et(B);
886
886
  if (!M)
887
887
  return c.length = _, c;
888
- var w = Ct(M);
888
+ var w = At(M);
889
889
  try {
890
890
  c[_] = w;
891
891
  } catch (x) {
892
892
  try {
893
- At(B);
893
+ Ot(B);
894
894
  } finally {
895
895
  throw x;
896
896
  }
@@ -898,7 +898,7 @@ var st;
898
898
  _++;
899
899
  }
900
900
  }
901
- function Qe(s) {
901
+ function Ke(s) {
902
902
  if (s === null)
903
903
  return 1;
904
904
  switch (typeof s) {
@@ -918,20 +918,20 @@ var st;
918
918
  return 6;
919
919
  }
920
920
  }
921
- function N(s) {
921
+ function T(s) {
922
922
  return s === void 0;
923
923
  }
924
- function re(s) {
924
+ function se(s) {
925
925
  return s === null;
926
926
  }
927
- function yt(s) {
927
+ function wt(s) {
928
928
  return typeof s == "symbol";
929
929
  }
930
930
  function j(s) {
931
931
  return typeof s == "object" ? s !== null : typeof s == "function";
932
932
  }
933
- function vt(s, o) {
934
- switch (Qe(s)) {
933
+ function _t(s, o) {
934
+ switch (Ke(s)) {
935
935
  case 0:
936
936
  return s;
937
937
  case 1:
@@ -945,38 +945,38 @@ var st;
945
945
  case 5:
946
946
  return s;
947
947
  }
948
- var c = o === 3 ? "string" : o === 5 ? "number" : "default", d = et(s, i);
948
+ var c = o === 3 ? "string" : o === 5 ? "number" : "default", d = tt(s, i);
949
949
  if (d !== void 0) {
950
950
  var y = d.call(s, c);
951
951
  if (j(y))
952
952
  throw new TypeError();
953
953
  return y;
954
954
  }
955
- return wt(s, c === "default" ? "number" : c);
955
+ return St(s, c === "default" ? "number" : c);
956
956
  }
957
- function wt(s, o) {
957
+ function St(s, o) {
958
958
  if (o === "string") {
959
959
  var c = s.toString;
960
- if (se(c)) {
960
+ if (ie(c)) {
961
961
  var d = c.call(s);
962
962
  if (!j(d))
963
963
  return d;
964
964
  }
965
965
  var y = s.valueOf;
966
- if (se(y)) {
966
+ if (ie(y)) {
967
967
  var d = y.call(s);
968
968
  if (!j(d))
969
969
  return d;
970
970
  }
971
971
  } else {
972
972
  var y = s.valueOf;
973
- if (se(y)) {
973
+ if (ie(y)) {
974
974
  var d = y.call(s);
975
975
  if (!j(d))
976
976
  return d;
977
977
  }
978
978
  var B = s.toString;
979
- if (se(B)) {
979
+ if (ie(B)) {
980
980
  var d = B.call(s);
981
981
  if (!j(d))
982
982
  return d;
@@ -984,31 +984,31 @@ var st;
984
984
  }
985
985
  throw new TypeError();
986
986
  }
987
- function _t(s) {
987
+ function Mt(s) {
988
988
  return !!s;
989
989
  }
990
- function St(s) {
990
+ function bt(s) {
991
991
  return "" + s;
992
992
  }
993
993
  function Z(s) {
994
- var o = vt(
994
+ var o = _t(
995
995
  s,
996
996
  3
997
997
  /* String */
998
998
  );
999
- return yt(o) ? o : St(o);
999
+ return wt(o) ? o : bt(o);
1000
1000
  }
1001
- function Ke(s) {
1001
+ function Ve(s) {
1002
1002
  return Array.isArray ? Array.isArray(s) : s instanceof Object ? s instanceof Array : Object.prototype.toString.call(s) === "[object Array]";
1003
1003
  }
1004
- function se(s) {
1004
+ function ie(s) {
1005
1005
  return typeof s == "function";
1006
1006
  }
1007
- function Ve(s) {
1007
+ function et(s) {
1008
1008
  return typeof s == "function";
1009
1009
  }
1010
- function Mt(s) {
1011
- switch (Qe(s)) {
1010
+ function Ct(s) {
1011
+ switch (Ke(s)) {
1012
1012
  case 3:
1013
1013
  return !0;
1014
1014
  case 4:
@@ -1017,35 +1017,35 @@ var st;
1017
1017
  return !1;
1018
1018
  }
1019
1019
  }
1020
- function et(s, o) {
1020
+ function tt(s, o) {
1021
1021
  var c = s[o];
1022
1022
  if (c != null) {
1023
- if (!se(c))
1023
+ if (!ie(c))
1024
1024
  throw new TypeError();
1025
1025
  return c;
1026
1026
  }
1027
1027
  }
1028
- function bt(s) {
1029
- var o = et(s, u);
1030
- if (!se(o))
1028
+ function xt(s) {
1029
+ var o = tt(s, u);
1030
+ if (!ie(o))
1031
1031
  throw new TypeError();
1032
1032
  var c = o.call(s);
1033
1033
  if (!j(c))
1034
1034
  throw new TypeError();
1035
1035
  return c;
1036
1036
  }
1037
- function Ct(s) {
1037
+ function At(s) {
1038
1038
  return s.value;
1039
1039
  }
1040
- function xt(s) {
1040
+ function Et(s) {
1041
1041
  var o = s.next();
1042
1042
  return o.done ? !1 : o;
1043
1043
  }
1044
- function At(s) {
1044
+ function Ot(s) {
1045
1045
  var o = s.return;
1046
1046
  o && o.call(s);
1047
1047
  }
1048
- function Me(s) {
1048
+ function be(s) {
1049
1049
  var o = Object.getPrototypeOf(s);
1050
1050
  if (typeof s != "function" || s === p || o !== p)
1051
1051
  return o;
@@ -1055,7 +1055,7 @@ var st;
1055
1055
  var y = d.constructor;
1056
1056
  return typeof y != "function" || y === s ? o : y;
1057
1057
  }
1058
- function Et() {
1058
+ function Lt() {
1059
1059
  var s = {}, o = [], c = (
1060
1060
  /** @class */
1061
1061
  function() {
@@ -1151,7 +1151,7 @@ var st;
1151
1151
  return [_, M];
1152
1152
  }
1153
1153
  }
1154
- function Ot() {
1154
+ function It() {
1155
1155
  return (
1156
1156
  /** @class */
1157
1157
  function() {
@@ -1186,7 +1186,7 @@ var st;
1186
1186
  }()
1187
1187
  );
1188
1188
  }
1189
- function Lt() {
1189
+ function Rt() {
1190
1190
  var s = 16, o = v.create(), c = d();
1191
1191
  return (
1192
1192
  /** @class */
@@ -1260,18 +1260,18 @@ var st;
1260
1260
  return x;
1261
1261
  }
1262
1262
  }
1263
- function be(s) {
1263
+ function Ce(s) {
1264
1264
  return s.__ = void 0, delete s.__, s;
1265
1265
  }
1266
1266
  });
1267
- })(st || (st = {}));
1268
- var Ut = Object.defineProperty, Wt = Object.getOwnPropertyDescriptor, Le = (r, e, t, n) => {
1269
- for (var i = n > 1 ? void 0 : n ? Wt(e, t) : e, u = r.length - 1, a; u >= 0; u--)
1267
+ })(it || (it = {}));
1268
+ var Gt = Object.defineProperty, zt = Object.getOwnPropertyDescriptor, Ie = (r, e, t, n) => {
1269
+ for (var i = n > 1 ? void 0 : n ? zt(e, t) : e, u = r.length - 1, a; u >= 0; u--)
1270
1270
  (a = r[u]) && (i = (n ? a(e, t, i) : a(i)) || i);
1271
- return n && i && Ut(e, t, i), i;
1271
+ return n && i && Gt(e, t, i), i;
1272
1272
  };
1273
- const X = 0, D = 1, Gt = 4294967295, le = 3;
1274
- class Ie {
1273
+ const X = 0, D = 1, Jt = 4294967295, ge = 3;
1274
+ class Re {
1275
1275
  constructor(e) {
1276
1276
  Object.assign(this, e);
1277
1277
  }
@@ -1280,18 +1280,18 @@ class Ie {
1280
1280
  (e = this.ScalarCmd) == null || e.forEach((a, f) => a.Index = f), (t = this.RotateCmd) == null || t.forEach((a, f) => a.Index = f), (n = this.LinearCmd) == null || n.forEach((a, f) => a.Index = f), (i = this.SensorReadCmd) == null || i.forEach((a, f) => a.Index = f), (u = this.SensorSubscribeCmd) == null || u.forEach((a, f) => a.Index = f);
1281
1281
  }
1282
1282
  }
1283
- var ae = /* @__PURE__ */ ((r) => (r.Unknown = "Unknown", r.Vibrate = "Vibrate", r.Rotate = "Rotate", r.Oscillate = "Oscillate", r.Constrict = "Constrict", r.Inflate = "Inflate", r.Position = "Position", r))(ae || {}), ee = /* @__PURE__ */ ((r) => (r.Unknown = "Unknown", r.Battery = "Battery", r.RSSI = "RSSI", r.Button = "Button", r.Pressure = "Pressure", r))(ee || {});
1284
- class zt {
1283
+ var ce = /* @__PURE__ */ ((r) => (r.Unknown = "Unknown", r.Vibrate = "Vibrate", r.Rotate = "Rotate", r.Oscillate = "Oscillate", r.Constrict = "Constrict", r.Inflate = "Inflate", r.Position = "Position", r))(ce || {}), ee = /* @__PURE__ */ ((r) => (r.Unknown = "Unknown", r.Battery = "Battery", r.RSSI = "RSSI", r.Button = "Button", r.Pressure = "Pressure", r))(ee || {});
1284
+ class qt {
1285
1285
  constructor(e) {
1286
1286
  this.Index = 0, Object.assign(this, e);
1287
1287
  }
1288
1288
  }
1289
- class Jt {
1289
+ class Ht {
1290
1290
  constructor(e) {
1291
1291
  this.Endpoints = e;
1292
1292
  }
1293
1293
  }
1294
- class qt {
1294
+ class Yt {
1295
1295
  constructor(e) {
1296
1296
  this.Index = 0, Object.assign(this, e);
1297
1297
  }
@@ -1309,7 +1309,7 @@ class H {
1309
1309
  }
1310
1310
  toProtocolFormat() {
1311
1311
  const e = {};
1312
- return e[this.constructor.Name] = $t(this), e;
1312
+ return e[this.constructor.Name] = Ut(this), e;
1313
1313
  }
1314
1314
  update() {
1315
1315
  }
@@ -1319,23 +1319,23 @@ class J extends H {
1319
1319
  super(t), this.DeviceIndex = e, this.Id = t;
1320
1320
  }
1321
1321
  }
1322
- class ce extends H {
1322
+ class ue extends H {
1323
1323
  constructor(e = X) {
1324
1324
  super(e), this.Id = e;
1325
1325
  }
1326
1326
  }
1327
- class ve extends ce {
1327
+ class we extends ue {
1328
1328
  constructor(e = D) {
1329
1329
  super(e), this.Id = e;
1330
1330
  }
1331
1331
  }
1332
- ve.Name = "Ok";
1333
- class ft extends H {
1332
+ we.Name = "Ok";
1333
+ class dt extends H {
1334
1334
  constructor(e = D) {
1335
1335
  super(e), this.Id = e;
1336
1336
  }
1337
1337
  }
1338
- ft.Name = "Ping";
1338
+ dt.Name = "Ping";
1339
1339
  var z = /* @__PURE__ */ ((r) => (r[r.ERROR_UNKNOWN = 0] = "ERROR_UNKNOWN", r[r.ERROR_INIT = 1] = "ERROR_INIT", r[r.ERROR_PING = 2] = "ERROR_PING", r[r.ERROR_MSG = 3] = "ERROR_MSG", r[r.ERROR_DEVICE = 4] = "ERROR_DEVICE", r))(z || {});
1340
1340
  let Q = class extends H {
1341
1341
  constructor(e, t = 0, n = D) {
@@ -1346,15 +1346,15 @@ let Q = class extends H {
1346
1346
  }
1347
1347
  };
1348
1348
  Q.Name = "Error";
1349
- class Re {
1349
+ class De {
1350
1350
  constructor(e) {
1351
1351
  Object.assign(this, e);
1352
1352
  }
1353
1353
  }
1354
- Le([
1355
- Oe(() => Ie)
1356
- ], Re.prototype, "DeviceMessages", 2);
1357
- class De extends H {
1354
+ Ie([
1355
+ Le(() => Re)
1356
+ ], De.prototype, "DeviceMessages", 2);
1357
+ class Ne extends H {
1358
1358
  constructor(e, t = D) {
1359
1359
  super(t), this.Devices = e, this.Id = t;
1360
1360
  }
@@ -1363,11 +1363,11 @@ class De extends H {
1363
1363
  e.DeviceMessages.update();
1364
1364
  }
1365
1365
  }
1366
- De.Name = "DeviceList";
1367
- Le([
1368
- Oe(() => Re)
1369
- ], De.prototype, "Devices", 2);
1370
- class we extends ce {
1366
+ Ne.Name = "DeviceList";
1367
+ Ie([
1368
+ Le(() => De)
1369
+ ], Ne.prototype, "Devices", 2);
1370
+ class _e extends ue {
1371
1371
  constructor(e) {
1372
1372
  super(), Object.assign(this, e);
1373
1373
  }
@@ -1375,86 +1375,86 @@ class we extends ce {
1375
1375
  this.DeviceMessages.update();
1376
1376
  }
1377
1377
  }
1378
- we.Name = "DeviceAdded";
1379
- Le([
1380
- Oe(() => Ie)
1381
- ], we.prototype, "DeviceMessages", 2);
1382
- class Te extends ce {
1378
+ _e.Name = "DeviceAdded";
1379
+ Ie([
1380
+ Le(() => Re)
1381
+ ], _e.prototype, "DeviceMessages", 2);
1382
+ class Te extends ue {
1383
1383
  constructor(e) {
1384
1384
  super(), this.DeviceIndex = e;
1385
1385
  }
1386
1386
  }
1387
1387
  Te.Name = "DeviceRemoved";
1388
- class Ne extends H {
1388
+ class Pe extends H {
1389
1389
  constructor(e = D) {
1390
1390
  super(e), this.Id = e;
1391
1391
  }
1392
1392
  }
1393
- Ne.Name = "RequestDeviceList";
1394
- class Pe extends H {
1393
+ Pe.Name = "RequestDeviceList";
1394
+ class ke extends H {
1395
1395
  constructor(e = D) {
1396
1396
  super(e), this.Id = e;
1397
1397
  }
1398
1398
  }
1399
- Pe.Name = "StartScanning";
1400
- class ke extends H {
1399
+ ke.Name = "StartScanning";
1400
+ class je extends H {
1401
1401
  constructor(e = D) {
1402
1402
  super(e), this.Id = e;
1403
1403
  }
1404
1404
  }
1405
- ke.Name = "StopScanning";
1406
- class je extends ce {
1405
+ je.Name = "StopScanning";
1406
+ class Be extends ue {
1407
1407
  constructor() {
1408
1408
  super();
1409
1409
  }
1410
1410
  }
1411
- je.Name = "ScanningFinished";
1412
- class Be extends H {
1411
+ Be.Name = "ScanningFinished";
1412
+ class $e extends H {
1413
1413
  constructor(e, t = 0, n = D) {
1414
1414
  super(n), this.ClientName = e, this.MessageVersion = t, this.Id = n;
1415
1415
  }
1416
1416
  }
1417
- Be.Name = "RequestServerInfo";
1418
- class $e extends ce {
1417
+ $e.Name = "RequestServerInfo";
1418
+ class Fe extends ue {
1419
1419
  constructor(e, t, n, i = D) {
1420
1420
  super(), this.MessageVersion = e, this.MaxPingTime = t, this.ServerName = n, this.Id = i;
1421
1421
  }
1422
1422
  }
1423
- $e.Name = "ServerInfo";
1424
- class Fe extends J {
1423
+ Fe.Name = "ServerInfo";
1424
+ class Ue extends J {
1425
1425
  constructor(e = -1, t = D) {
1426
1426
  super(e, t), this.DeviceIndex = e, this.Id = t;
1427
1427
  }
1428
1428
  }
1429
- Fe.Name = "StopDeviceCmd";
1430
- class Ue extends H {
1429
+ Ue.Name = "StopDeviceCmd";
1430
+ class We extends H {
1431
1431
  constructor(e = D) {
1432
1432
  super(e), this.Id = e;
1433
1433
  }
1434
1434
  }
1435
- Ue.Name = "StopAllDevices";
1436
- class _e {
1435
+ We.Name = "StopAllDevices";
1436
+ class Se {
1437
1437
  constructor(e) {
1438
1438
  this.Index = e;
1439
1439
  }
1440
1440
  }
1441
- class Ce extends _e {
1441
+ class xe extends Se {
1442
1442
  constructor(e, t, n) {
1443
1443
  super(e), this.Scalar = t, this.ActuatorType = n;
1444
1444
  }
1445
1445
  }
1446
- class ge extends J {
1446
+ class me extends J {
1447
1447
  constructor(e, t = -1, n = D) {
1448
1448
  super(t, n), this.Scalars = e, this.DeviceIndex = t, this.Id = n;
1449
1449
  }
1450
1450
  }
1451
- ge.Name = "ScalarCmd";
1452
- class dt extends _e {
1451
+ me.Name = "ScalarCmd";
1452
+ class ht extends Se {
1453
1453
  constructor(e, t, n) {
1454
1454
  super(e), this.Speed = t, this.Clockwise = n;
1455
1455
  }
1456
1456
  }
1457
- const ht = class pt extends J {
1457
+ const pt = class lt extends J {
1458
1458
  constructor(e, t = -1, n = D) {
1459
1459
  super(t, n), this.Rotations = e, this.DeviceIndex = t, this.Id = n;
1460
1460
  }
@@ -1462,18 +1462,18 @@ const ht = class pt extends J {
1462
1462
  const n = new Array();
1463
1463
  let i = 0;
1464
1464
  for (const [u, a] of t)
1465
- n.push(new dt(i, u, a)), ++i;
1466
- return new pt(n, e);
1465
+ n.push(new ht(i, u, a)), ++i;
1466
+ return new lt(n, e);
1467
1467
  }
1468
1468
  };
1469
- ht.Name = "RotateCmd";
1470
- let xe = ht;
1471
- class lt extends _e {
1469
+ pt.Name = "RotateCmd";
1470
+ let Ae = pt;
1471
+ class gt extends Se {
1472
1472
  constructor(e, t, n) {
1473
1473
  super(e), this.Position = t, this.Duration = n;
1474
1474
  }
1475
1475
  }
1476
- const gt = class mt extends J {
1476
+ const mt = class yt extends J {
1477
1477
  constructor(e, t = -1, n = D) {
1478
1478
  super(t, n), this.Vectors = e, this.DeviceIndex = t, this.Id = n;
1479
1479
  }
@@ -1481,99 +1481,99 @@ const gt = class mt extends J {
1481
1481
  const n = new Array();
1482
1482
  let i = 0;
1483
1483
  for (const u of t)
1484
- n.push(new lt(i, u[0], u[1])), ++i;
1485
- return new mt(n, e);
1484
+ n.push(new gt(i, u[0], u[1])), ++i;
1485
+ return new yt(n, e);
1486
1486
  }
1487
1487
  };
1488
- gt.Name = "LinearCmd";
1489
- let Ae = gt;
1490
- class We extends J {
1488
+ mt.Name = "LinearCmd";
1489
+ let Ee = mt;
1490
+ class Ge extends J {
1491
1491
  constructor(e, t, n, i = D) {
1492
1492
  super(e, i), this.DeviceIndex = e, this.SensorIndex = t, this.SensorType = n, this.Id = i;
1493
1493
  }
1494
1494
  }
1495
- We.Name = "SensorReadCmd";
1496
- class Ge extends J {
1495
+ Ge.Name = "SensorReadCmd";
1496
+ class ze extends J {
1497
1497
  constructor(e, t, n, i, u = D) {
1498
1498
  super(e, u), this.DeviceIndex = e, this.SensorIndex = t, this.SensorType = n, this.Data = i, this.Id = u;
1499
1499
  }
1500
1500
  }
1501
- Ge.Name = "SensorReading";
1502
- class ze extends J {
1501
+ ze.Name = "SensorReading";
1502
+ class Je extends J {
1503
1503
  constructor(e, t, n, i, u = D) {
1504
1504
  super(e, u), this.DeviceIndex = e, this.Endpoint = t, this.ExpectedLength = n, this.Timeout = i, this.Id = u;
1505
1505
  }
1506
1506
  }
1507
- ze.Name = "RawReadCmd";
1508
- class Je extends J {
1507
+ Je.Name = "RawReadCmd";
1508
+ class qe extends J {
1509
1509
  constructor(e, t, n, i, u = D) {
1510
1510
  super(e, u), this.DeviceIndex = e, this.Endpoint = t, this.Data = n, this.WriteWithResponse = i, this.Id = u;
1511
1511
  }
1512
1512
  }
1513
- Je.Name = "RawWriteCmd";
1514
- class qe extends J {
1513
+ qe.Name = "RawWriteCmd";
1514
+ class He extends J {
1515
1515
  constructor(e, t, n = D) {
1516
1516
  super(e, n), this.DeviceIndex = e, this.Endpoint = t, this.Id = n;
1517
1517
  }
1518
1518
  }
1519
- qe.Name = "RawSubscribeCmd";
1520
- class He extends J {
1519
+ He.Name = "RawSubscribeCmd";
1520
+ class Ye extends J {
1521
1521
  constructor(e, t, n = D) {
1522
1522
  super(e, n), this.DeviceIndex = e, this.Endpoint = t, this.Id = n;
1523
1523
  }
1524
1524
  }
1525
- He.Name = "RawUnsubscribeCmd";
1526
- class Ye extends J {
1525
+ Ye.Name = "RawUnsubscribeCmd";
1526
+ class Xe extends J {
1527
1527
  constructor(e, t, n, i = D) {
1528
1528
  super(e, i), this.DeviceIndex = e, this.Endpoint = t, this.Data = n, this.Id = i;
1529
1529
  }
1530
1530
  }
1531
- Ye.Name = "RawReading";
1532
- const Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1531
+ Xe.Name = "RawReading";
1532
+ const Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1533
1533
  __proto__: null,
1534
- ActuatorType: ae,
1534
+ ActuatorType: ce,
1535
1535
  ButtplugDeviceMessage: J,
1536
1536
  ButtplugMessage: H,
1537
- ButtplugSystemMessage: ce,
1537
+ ButtplugSystemMessage: ue,
1538
1538
  DEFAULT_MESSAGE_ID: D,
1539
- DeviceAdded: we,
1540
- DeviceInfo: Re,
1541
- DeviceList: De,
1539
+ DeviceAdded: _e,
1540
+ DeviceInfo: De,
1541
+ DeviceList: Ne,
1542
1542
  DeviceRemoved: Te,
1543
1543
  Error: Q,
1544
1544
  ErrorClass: z,
1545
- GenericDeviceMessageAttributes: zt,
1546
- GenericMessageSubcommand: _e,
1547
- LinearCmd: Ae,
1548
- MAX_ID: Gt,
1549
- MESSAGE_SPEC_VERSION: le,
1550
- MessageAttributes: Ie,
1551
- Ok: ve,
1552
- Ping: ft,
1553
- RawDeviceMessageAttributes: Jt,
1554
- RawReadCmd: ze,
1555
- RawReading: Ye,
1556
- RawSubscribeCmd: qe,
1557
- RawUnsubscribeCmd: He,
1558
- RawWriteCmd: Je,
1559
- RequestDeviceList: Ne,
1560
- RequestServerInfo: Be,
1561
- RotateCmd: xe,
1562
- RotateSubcommand: dt,
1545
+ GenericDeviceMessageAttributes: qt,
1546
+ GenericMessageSubcommand: Se,
1547
+ LinearCmd: Ee,
1548
+ MAX_ID: Jt,
1549
+ MESSAGE_SPEC_VERSION: ge,
1550
+ MessageAttributes: Re,
1551
+ Ok: we,
1552
+ Ping: dt,
1553
+ RawDeviceMessageAttributes: Ht,
1554
+ RawReadCmd: Je,
1555
+ RawReading: Xe,
1556
+ RawSubscribeCmd: He,
1557
+ RawUnsubscribeCmd: Ye,
1558
+ RawWriteCmd: qe,
1559
+ RequestDeviceList: Pe,
1560
+ RequestServerInfo: $e,
1561
+ RotateCmd: Ae,
1562
+ RotateSubcommand: ht,
1563
1563
  SYSTEM_MESSAGE_ID: X,
1564
- ScalarCmd: ge,
1565
- ScalarSubcommand: Ce,
1566
- ScanningFinished: je,
1567
- SensorDeviceMessageAttributes: qt,
1568
- SensorReadCmd: We,
1569
- SensorReading: Ge,
1564
+ ScalarCmd: me,
1565
+ ScalarSubcommand: xe,
1566
+ ScanningFinished: Be,
1567
+ SensorDeviceMessageAttributes: Yt,
1568
+ SensorReadCmd: Ge,
1569
+ SensorReading: ze,
1570
1570
  SensorType: ee,
1571
- ServerInfo: $e,
1572
- StartScanning: Pe,
1573
- StopAllDevices: Ue,
1574
- StopDeviceCmd: Fe,
1575
- StopScanning: ke,
1576
- VectorSubcommand: lt
1571
+ ServerInfo: Fe,
1572
+ StartScanning: ke,
1573
+ StopAllDevices: We,
1574
+ StopDeviceCmd: Ue,
1575
+ StopScanning: je,
1576
+ VectorSubcommand: gt
1577
1577
  }, Symbol.toStringTag, { value: "Module" }));
1578
1578
  /*!
1579
1579
  * Buttplug JS Source Code File - Visit https://buttplug.io for more info about
@@ -1606,19 +1606,19 @@ class U extends Error {
1606
1606
  case z.ERROR_DEVICE:
1607
1607
  return new P(e.ErrorMessage, e.Id);
1608
1608
  case z.ERROR_INIT:
1609
- return new Ee(e.ErrorMessage, e.Id);
1609
+ return new Oe(e.ErrorMessage, e.Id);
1610
1610
  case z.ERROR_UNKNOWN:
1611
- return new Xt(e.ErrorMessage, e.Id);
1611
+ return new Qt(e.ErrorMessage, e.Id);
1612
1612
  case z.ERROR_PING:
1613
- return new Yt(e.ErrorMessage, e.Id);
1613
+ return new Zt(e.ErrorMessage, e.Id);
1614
1614
  case z.ERROR_MSG:
1615
- return new fe(e.ErrorMessage, e.Id);
1615
+ return new de(e.ErrorMessage, e.Id);
1616
1616
  default:
1617
1617
  throw new Error(`Message type ${e.ErrorCode} not handled`);
1618
1618
  }
1619
1619
  }
1620
1620
  }
1621
- class Ee extends U {
1621
+ class Oe extends U {
1622
1622
  constructor(e, t = X) {
1623
1623
  super(e, z.ERROR_INIT, t);
1624
1624
  }
@@ -1628,22 +1628,45 @@ class P extends U {
1628
1628
  super(e, z.ERROR_DEVICE, t);
1629
1629
  }
1630
1630
  }
1631
- class fe extends U {
1631
+ class de extends U {
1632
1632
  constructor(e, t = X) {
1633
1633
  super(e, z.ERROR_MSG, t);
1634
1634
  }
1635
1635
  }
1636
- class Yt extends U {
1636
+ class Zt extends U {
1637
1637
  constructor(e, t = X) {
1638
1638
  super(e, z.ERROR_PING, t);
1639
1639
  }
1640
1640
  }
1641
- class Xt extends U {
1641
+ class Qt extends U {
1642
1642
  constructor(e, t = X) {
1643
1643
  super(e, z.ERROR_UNKNOWN, t);
1644
1644
  }
1645
1645
  }
1646
- class me extends ye {
1646
+ function vt(r) {
1647
+ for (const e of Object.values(Xt))
1648
+ if (typeof e == "function" && "Name" in e && e.Name === r)
1649
+ return e;
1650
+ return null;
1651
+ }
1652
+ function ne(r) {
1653
+ return vt(Object.getPrototypeOf(r).constructor.Name);
1654
+ }
1655
+ function ot(r) {
1656
+ const e = JSON.parse(r), t = [];
1657
+ for (const n of Array.from(e)) {
1658
+ const i = Object.getOwnPropertyNames(n)[0], u = vt(i);
1659
+ if (u) {
1660
+ const a = Wt(
1661
+ u,
1662
+ n[i]
1663
+ );
1664
+ a.update(), t.push(a);
1665
+ }
1666
+ }
1667
+ return t;
1668
+ }
1669
+ class ye extends ve {
1647
1670
  /**
1648
1671
  * @param _index Index of the device, as created by the device manager.
1649
1672
  * @param _name Name of the device.
@@ -1683,26 +1706,26 @@ class me extends ye {
1683
1706
  return this._deviceInfo.DeviceMessages;
1684
1707
  }
1685
1708
  static fromMsg(e, t) {
1686
- return new me(e, t);
1709
+ return new ye(e, t);
1687
1710
  }
1688
1711
  async send(e) {
1689
1712
  return await this._sendClosure(this, e);
1690
1713
  }
1691
1714
  async sendExpectOk(e) {
1692
1715
  const t = await this.send(e);
1693
- switch (t.constructor) {
1694
- case ve:
1716
+ switch (ne(t)) {
1717
+ case we:
1695
1718
  return;
1696
1719
  case Q:
1697
1720
  throw U.FromError(t);
1698
1721
  default:
1699
- throw new fe(
1722
+ throw new de(
1700
1723
  `Message type ${t.constructor} not handled by SendMsgExpectOk`
1701
1724
  );
1702
1725
  }
1703
1726
  }
1704
1727
  async scalar(e) {
1705
- Array.isArray(e) ? await this.sendExpectOk(new ge(e, this.index)) : await this.sendExpectOk(new ge([e], this.index));
1728
+ Array.isArray(e) ? await this.sendExpectOk(new me(e, this.index)) : await this.sendExpectOk(new me([e], this.index));
1706
1729
  }
1707
1730
  async scalarCommandBuilder(e, t) {
1708
1731
  var u;
@@ -1716,7 +1739,7 @@ class me extends ye {
1716
1739
  const i = [];
1717
1740
  if (typeof e == "number")
1718
1741
  n.forEach(
1719
- (a) => i.push(new Ce(a.Index, e, t))
1742
+ (a) => i.push(new xe(a.Index, e, t))
1720
1743
  );
1721
1744
  else if (Array.isArray(e)) {
1722
1745
  if (e.length > n.length)
@@ -1724,7 +1747,7 @@ class me extends ye {
1724
1747
  `${e.length} commands send to a device with ${n.length} vibrators`
1725
1748
  );
1726
1749
  n.forEach((a, f) => {
1727
- i.push(new Ce(a.Index, e[f], t));
1750
+ i.push(new xe(a.Index, e[f], t));
1728
1751
  });
1729
1752
  } else
1730
1753
  throw new P(
@@ -1735,20 +1758,20 @@ class me extends ye {
1735
1758
  get vibrateAttributes() {
1736
1759
  var e;
1737
1760
  return ((e = this.messageAttributes.ScalarCmd) == null ? void 0 : e.filter(
1738
- (t) => t.ActuatorType === ae.Vibrate
1761
+ (t) => t.ActuatorType === ce.Vibrate
1739
1762
  )) ?? [];
1740
1763
  }
1741
1764
  async vibrate(e) {
1742
- await this.scalarCommandBuilder(e, ae.Vibrate);
1765
+ await this.scalarCommandBuilder(e, ce.Vibrate);
1743
1766
  }
1744
1767
  get oscillateAttributes() {
1745
1768
  var e;
1746
1769
  return ((e = this.messageAttributes.ScalarCmd) == null ? void 0 : e.filter(
1747
- (t) => t.ActuatorType === ae.Oscillate
1770
+ (t) => t.ActuatorType === ce.Oscillate
1748
1771
  )) ?? [];
1749
1772
  }
1750
1773
  async oscillate(e) {
1751
- await this.scalarCommandBuilder(e, ae.Oscillate);
1774
+ await this.scalarCommandBuilder(e, ce.Oscillate);
1752
1775
  }
1753
1776
  get rotateAttributes() {
1754
1777
  return this.messageAttributes.RotateCmd ?? [];
@@ -1761,12 +1784,12 @@ class me extends ye {
1761
1784
  );
1762
1785
  let i;
1763
1786
  if (typeof e == "number")
1764
- i = xe.Create(
1787
+ i = Ae.Create(
1765
1788
  this.index,
1766
1789
  new Array(n.length).fill([e, t])
1767
1790
  );
1768
1791
  else if (Array.isArray(e))
1769
- i = xe.Create(this.index, e);
1792
+ i = Ae.Create(this.index, e);
1770
1793
  else
1771
1794
  throw new P(
1772
1795
  "SendRotateCmd can only take a number and boolean, or an array of number/boolean tuples"
@@ -1784,12 +1807,12 @@ class me extends ye {
1784
1807
  );
1785
1808
  let i;
1786
1809
  if (typeof e == "number")
1787
- i = Ae.Create(
1810
+ i = Ee.Create(
1788
1811
  this.index,
1789
1812
  new Array(n.length).fill([e, t])
1790
1813
  );
1791
1814
  else if (Array.isArray(e))
1792
- i = Ae.Create(this.index, e);
1815
+ i = Ee.Create(this.index, e);
1793
1816
  else
1794
1817
  throw new P(
1795
1818
  "SendLinearCmd can only take a number and number, or an array of number/number tuples"
@@ -1798,15 +1821,15 @@ class me extends ye {
1798
1821
  }
1799
1822
  async sensorRead(e, t) {
1800
1823
  const n = await this.send(
1801
- new We(this.index, e, t)
1824
+ new Ge(this.index, e, t)
1802
1825
  );
1803
- switch (n.constructor) {
1804
- case Ge:
1826
+ switch (ne(n)) {
1827
+ case ze:
1805
1828
  return n.Data;
1806
1829
  case Q:
1807
1830
  throw U.FromError(n);
1808
1831
  default:
1809
- throw new fe(
1832
+ throw new de(
1810
1833
  `Message type ${n.constructor} not handled by sensorRead`
1811
1834
  );
1812
1835
  }
@@ -1863,15 +1886,15 @@ class me extends ye {
1863
1886
  `Device ${this.name} has no raw readable endpoint ${e}`
1864
1887
  );
1865
1888
  const i = await this.send(
1866
- new ze(this.index, e, t, n)
1889
+ new Je(this.index, e, t, n)
1867
1890
  );
1868
- switch (i.constructor) {
1869
- case Ye:
1891
+ switch (ne(i)) {
1892
+ case Xe:
1870
1893
  return new Uint8Array(i.Data);
1871
1894
  case Q:
1872
1895
  throw U.FromError(i);
1873
1896
  default:
1874
- throw new fe(
1897
+ throw new de(
1875
1898
  `Message type ${i.constructor} not handled by rawRead`
1876
1899
  );
1877
1900
  }
@@ -1886,7 +1909,7 @@ class me extends ye {
1886
1909
  `Device ${this.name} has no raw writable endpoint ${e}`
1887
1910
  );
1888
1911
  await this.sendExpectOk(
1889
- new Je(this.index, e, t, n)
1912
+ new qe(this.index, e, t, n)
1890
1913
  );
1891
1914
  }
1892
1915
  async rawSubscribe(e) {
@@ -1898,7 +1921,7 @@ class me extends ye {
1898
1921
  throw new P(
1899
1922
  `Device ${this.name} has no raw subscribable endpoint ${e}`
1900
1923
  );
1901
- await this.sendExpectOk(new qe(this.index, e));
1924
+ await this.sendExpectOk(new He(this.index, e));
1902
1925
  }
1903
1926
  async rawUnsubscribe(e) {
1904
1927
  if (!this.messageAttributes.RawSubscribeCmd)
@@ -1910,11 +1933,11 @@ class me extends ye {
1910
1933
  `Device ${this.name} has no raw unsubscribable endpoint ${e}`
1911
1934
  );
1912
1935
  await this.sendExpectOk(
1913
- new He(this.index, e)
1936
+ new Ye(this.index, e)
1914
1937
  );
1915
1938
  }
1916
1939
  async stop() {
1917
- await this.sendExpectOk(new Fe(this.index));
1940
+ await this.sendExpectOk(new Ue(this.index));
1918
1941
  }
1919
1942
  emitDisconnected() {
1920
1943
  this.emit("deviceremoved");
@@ -1927,7 +1950,7 @@ class me extends ye {
1927
1950
  *
1928
1951
  * @copyright Copyright (c) Nonpolynomial Labs LLC. All rights reserved.
1929
1952
  */
1930
- class Zt {
1953
+ class Kt {
1931
1954
  constructor(e) {
1932
1955
  this._useCounter = e, this._counter = 1, this._waitingMsgs = /* @__PURE__ */ new Map();
1933
1956
  }
@@ -1967,33 +1990,33 @@ class Zt {
1967
1990
  *
1968
1991
  * @copyright Copyright (c) Nonpolynomial Labs LLC. All rights reserved.
1969
1992
  */
1970
- class Qt extends U {
1993
+ class Vt extends U {
1971
1994
  constructor(e) {
1972
1995
  super(e, z.ERROR_UNKNOWN);
1973
1996
  }
1974
1997
  }
1975
- class rn extends ye {
1998
+ class sn extends ve {
1976
1999
  constructor(e = "Generic Buttplug Client") {
1977
- super(), this._pingTimer = null, this._connector = null, this._devices = /* @__PURE__ */ new Map(), this._logger = Tt.Logger, this._isScanning = !1, this._sorter = new Zt(!0), this.connect = async (t) => {
2000
+ super(), this._pingTimer = null, this._connector = null, this._devices = /* @__PURE__ */ new Map(), this._logger = Pt.Logger, this._isScanning = !1, this._sorter = new Kt(!0), this.connect = async (t) => {
1978
2001
  this._logger.Info(
1979
2002
  `ButtplugClient: Connecting using ${t.constructor.name}`
1980
2003
  ), await t.connect(), this._connector = t, this._connector.addListener("message", this.parseMessages), this._connector.addListener("disconnect", this.disconnectHandler), await this.initializeConnection();
1981
2004
  }, this.disconnect = async () => {
1982
2005
  this._logger.Debug("ButtplugClient: Disconnect called"), this.checkConnector(), await this.shutdownConnection(), await this._connector.disconnect();
1983
2006
  }, this.startScanning = async () => {
1984
- this._logger.Debug("ButtplugClient: StartScanning called"), this._isScanning = !0, await this.sendMsgExpectOk(new Pe());
2007
+ this._logger.Debug("ButtplugClient: StartScanning called"), this._isScanning = !0, await this.sendMsgExpectOk(new ke());
1985
2008
  }, this.stopScanning = async () => {
1986
- this._logger.Debug("ButtplugClient: StopScanning called"), this._isScanning = !1, await this.sendMsgExpectOk(new ke());
2009
+ this._logger.Debug("ButtplugClient: StopScanning called"), this._isScanning = !1, await this.sendMsgExpectOk(new je());
1987
2010
  }, this.stopAllDevices = async () => {
1988
- this._logger.Debug("ButtplugClient: StopAllDevices"), await this.sendMsgExpectOk(new Ue());
2011
+ this._logger.Debug("ButtplugClient: StopAllDevices"), await this.sendMsgExpectOk(new We());
1989
2012
  }, this.disconnectHandler = () => {
1990
2013
  this._logger.Info("ButtplugClient: Disconnect event receieved."), this.emit("disconnect");
1991
2014
  }, this.parseMessages = (t) => {
1992
2015
  const n = this._sorter.ParseIncomingMessages(t);
1993
2016
  for (const i of n)
1994
- switch (i.constructor) {
1995
- case we: {
1996
- const u = i, a = me.fromMsg(
2017
+ switch (ne(i)) {
2018
+ case _e: {
2019
+ const u = i, a = ye.fromMsg(
1997
2020
  u,
1998
2021
  this.sendDeviceMessageClosure
1999
2022
  );
@@ -2008,28 +2031,28 @@ class rn extends ye {
2008
2031
  }
2009
2032
  break;
2010
2033
  }
2011
- case je:
2034
+ case Be:
2012
2035
  this._isScanning = !1, this.emit("scanningfinished", i);
2013
2036
  break;
2014
2037
  }
2015
2038
  }, this.initializeConnection = async () => {
2016
2039
  this.checkConnector();
2017
2040
  const t = await this.sendMessage(
2018
- new Be(
2041
+ new $e(
2019
2042
  this._clientName,
2020
- le
2043
+ ge
2021
2044
  )
2022
2045
  );
2023
- switch (t.constructor) {
2024
- case $e: {
2046
+ switch (ne(t)) {
2047
+ case Fe: {
2025
2048
  const n = t;
2026
2049
  if (this._logger.Info(
2027
2050
  `ButtplugClient: Connected to Server ${n.ServerName}`
2028
- ), n.MaxPingTime, n.MessageVersion < le)
2051
+ ), n.MaxPingTime, n.MessageVersion < ge)
2029
2052
  throw await this._connector.disconnect(), U.LogAndError(
2030
- Ee,
2053
+ Oe,
2031
2054
  this._logger,
2032
- `Server protocol version ${n.MessageVersion} is older than client protocol version ${le}. Please update server.`
2055
+ `Server protocol version ${n.MessageVersion} is older than client protocol version ${ge}. Please update server.`
2033
2056
  );
2034
2057
  return await this.requestDeviceList(), !0;
2035
2058
  }
@@ -2037,7 +2060,7 @@ class rn extends ye {
2037
2060
  await this._connector.disconnect();
2038
2061
  const n = t;
2039
2062
  throw U.LogAndError(
2040
- Ee,
2063
+ Oe,
2041
2064
  this._logger,
2042
2065
  `Cannot connect to server. ${n.ErrorMessage}`
2043
2066
  );
@@ -2046,12 +2069,12 @@ class rn extends ye {
2046
2069
  return !1;
2047
2070
  }, this.requestDeviceList = async () => {
2048
2071
  this.checkConnector(), this._logger.Debug("ButtplugClient: ReceiveDeviceList called"), (await this.sendMessage(
2049
- new Ne()
2072
+ new Pe()
2050
2073
  )).Devices.forEach((n) => {
2051
2074
  if (this._devices.has(n.DeviceIndex))
2052
2075
  this._logger.Debug(`ButtplugClient: Device already added: ${n}`);
2053
2076
  else {
2054
- const i = me.fromMsg(
2077
+ const i = ye.fromMsg(
2055
2078
  n,
2056
2079
  this.sendDeviceMessageClosure
2057
2080
  );
@@ -2062,16 +2085,16 @@ class rn extends ye {
2062
2085
  await this.stopAllDevices(), this._pingTimer !== null && (clearInterval(this._pingTimer), this._pingTimer = null);
2063
2086
  }, this.sendMsgExpectOk = async (t) => {
2064
2087
  const n = await this.sendMessage(t);
2065
- switch (n.constructor) {
2066
- case ve:
2088
+ switch (ne(n)) {
2089
+ case we:
2067
2090
  return;
2068
2091
  case Q:
2069
2092
  throw U.FromError(n);
2070
2093
  default:
2071
2094
  throw U.LogAndError(
2072
- fe,
2095
+ de,
2073
2096
  this._logger,
2074
- `Message type ${n.constructor} not handled by SendMsgExpectOk`
2097
+ `Message type ${ne(n).constructor} not handled by SendMsgExpectOk`
2075
2098
  );
2076
2099
  }
2077
2100
  }, this.sendDeviceMessageClosure = async (t, n) => await this.sendDeviceMessage(t, n), this._clientName = e, this._logger.Debug(`ButtplugClient: Client ${e} created.`);
@@ -2105,32 +2128,12 @@ class rn extends ye {
2105
2128
  }
2106
2129
  checkConnector() {
2107
2130
  if (!this.connected)
2108
- throw new Qt(
2131
+ throw new Vt(
2109
2132
  "ButtplugClient not connected"
2110
2133
  );
2111
2134
  }
2112
2135
  }
2113
- function Kt(r) {
2114
- for (const e of Object.values(Ht))
2115
- if (typeof e == "function" && "Name" in e && e.Name === r)
2116
- return e;
2117
- return null;
2118
- }
2119
- function it(r) {
2120
- const e = JSON.parse(r), t = [];
2121
- for (const n of Array.from(e)) {
2122
- const i = Object.getOwnPropertyNames(n)[0], u = Kt(i);
2123
- if (u) {
2124
- const a = Ft(
2125
- u,
2126
- n[i]
2127
- );
2128
- a.update(), t.push(a);
2129
- }
2130
- }
2131
- return t;
2132
- }
2133
- class Vt extends ye {
2136
+ class en extends ve {
2134
2137
  constructor(e) {
2135
2138
  super(), this._url = e, this._websocketConstructor = null, this.connect = async () => {
2136
2139
  const t = new (this._websocketConstructor ?? WebSocket)(this._url);
@@ -2162,17 +2165,17 @@ class Vt extends ye {
2162
2165
  }
2163
2166
  parseIncomingMessage(e) {
2164
2167
  if (typeof e.data == "string") {
2165
- const t = it(e.data);
2168
+ const t = ot(e.data);
2166
2169
  this.emit("message", t);
2167
2170
  } else
2168
2171
  e.data instanceof Blob;
2169
2172
  }
2170
2173
  onReaderLoad(e) {
2171
- const t = it(e.target.result);
2174
+ const t = ot(e.target.result);
2172
2175
  this.emit("message", t);
2173
2176
  }
2174
2177
  }
2175
- class en extends Vt {
2178
+ class tn extends en {
2176
2179
  constructor() {
2177
2180
  super(...arguments), this.send = (e) => {
2178
2181
  if (!this.Connected)
@@ -2181,74 +2184,75 @@ class en extends Vt {
2181
2184
  };
2182
2185
  }
2183
2186
  }
2184
- var tn = function() {
2187
+ var nn = function() {
2185
2188
  throw new Error(
2186
2189
  "ws does not work in the browser. Browser clients must use the native WebSocket object"
2187
2190
  );
2188
2191
  };
2189
- class sn extends en {
2192
+ class on extends tn {
2190
2193
  constructor() {
2191
- super(...arguments), this._websocketConstructor = tn.WebSocket;
2194
+ super(...arguments), this._websocketConstructor = nn.WebSocket;
2192
2195
  }
2193
2196
  }
2194
2197
  export {
2195
- ae as ActuatorType,
2196
- en as ButtplugBrowserWebsocketClientConnector,
2197
- rn as ButtplugClient,
2198
- Qt as ButtplugClientConnectorException,
2199
- me as ButtplugClientDevice,
2198
+ ce as ActuatorType,
2199
+ tn as ButtplugBrowserWebsocketClientConnector,
2200
+ sn as ButtplugClient,
2201
+ Vt as ButtplugClientConnectorException,
2202
+ ye as ButtplugClientDevice,
2200
2203
  P as ButtplugDeviceError,
2201
2204
  J as ButtplugDeviceMessage,
2202
2205
  U as ButtplugError,
2203
- Ee as ButtplugInitError,
2204
- at as ButtplugLogLevel,
2205
- Tt as ButtplugLogger,
2206
+ Oe as ButtplugInitError,
2207
+ ct as ButtplugLogLevel,
2208
+ Pt as ButtplugLogger,
2206
2209
  H as ButtplugMessage,
2207
- fe as ButtplugMessageError,
2208
- Zt as ButtplugMessageSorter,
2209
- sn as ButtplugNodeWebsocketClientConnector,
2210
- Yt as ButtplugPingError,
2211
- ce as ButtplugSystemMessage,
2212
- Xt as ButtplugUnknownError,
2210
+ de as ButtplugMessageError,
2211
+ Kt as ButtplugMessageSorter,
2212
+ on as ButtplugNodeWebsocketClientConnector,
2213
+ Zt as ButtplugPingError,
2214
+ ue as ButtplugSystemMessage,
2215
+ Qt as ButtplugUnknownError,
2213
2216
  D as DEFAULT_MESSAGE_ID,
2214
- we as DeviceAdded,
2215
- Re as DeviceInfo,
2216
- De as DeviceList,
2217
+ _e as DeviceAdded,
2218
+ De as DeviceInfo,
2219
+ Ne as DeviceList,
2217
2220
  Te as DeviceRemoved,
2218
2221
  Q as Error,
2219
2222
  z as ErrorClass,
2220
- zt as GenericDeviceMessageAttributes,
2221
- _e as GenericMessageSubcommand,
2222
- Ae as LinearCmd,
2223
- Dt as LogMessage,
2224
- Gt as MAX_ID,
2225
- le as MESSAGE_SPEC_VERSION,
2226
- Ie as MessageAttributes,
2227
- ve as Ok,
2228
- ft as Ping,
2229
- Jt as RawDeviceMessageAttributes,
2230
- ze as RawReadCmd,
2231
- Ye as RawReading,
2232
- qe as RawSubscribeCmd,
2233
- He as RawUnsubscribeCmd,
2234
- Je as RawWriteCmd,
2235
- Ne as RequestDeviceList,
2236
- Be as RequestServerInfo,
2237
- xe as RotateCmd,
2238
- dt as RotateSubcommand,
2223
+ qt as GenericDeviceMessageAttributes,
2224
+ Se as GenericMessageSubcommand,
2225
+ Ee as LinearCmd,
2226
+ Tt as LogMessage,
2227
+ Jt as MAX_ID,
2228
+ ge as MESSAGE_SPEC_VERSION,
2229
+ Re as MessageAttributes,
2230
+ we as Ok,
2231
+ dt as Ping,
2232
+ Ht as RawDeviceMessageAttributes,
2233
+ Je as RawReadCmd,
2234
+ Xe as RawReading,
2235
+ He as RawSubscribeCmd,
2236
+ Ye as RawUnsubscribeCmd,
2237
+ qe as RawWriteCmd,
2238
+ Pe as RequestDeviceList,
2239
+ $e as RequestServerInfo,
2240
+ Ae as RotateCmd,
2241
+ ht as RotateSubcommand,
2239
2242
  X as SYSTEM_MESSAGE_ID,
2240
- ge as ScalarCmd,
2241
- Ce as ScalarSubcommand,
2242
- je as ScanningFinished,
2243
- qt as SensorDeviceMessageAttributes,
2244
- We as SensorReadCmd,
2245
- Ge as SensorReading,
2243
+ me as ScalarCmd,
2244
+ xe as ScalarSubcommand,
2245
+ Be as ScanningFinished,
2246
+ Yt as SensorDeviceMessageAttributes,
2247
+ Ge as SensorReadCmd,
2248
+ ze as SensorReading,
2246
2249
  ee as SensorType,
2247
- $e as ServerInfo,
2248
- Pe as StartScanning,
2249
- Ue as StopAllDevices,
2250
- Fe as StopDeviceCmd,
2251
- ke as StopScanning,
2252
- lt as VectorSubcommand,
2253
- it as fromJSON
2250
+ Fe as ServerInfo,
2251
+ ke as StartScanning,
2252
+ We as StopAllDevices,
2253
+ Ue as StopDeviceCmd,
2254
+ je as StopScanning,
2255
+ gt as VectorSubcommand,
2256
+ ot as fromJSON,
2257
+ ne as getMessageClassFromMessage
2254
2258
  };