@placeos/ts-client 4.2.0 → 4.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.
package/dist/index.es.js CHANGED
@@ -23,7 +23,7 @@ var ze = function() {
23
23
  return e;
24
24
  }, ze.apply(this, arguments);
25
25
  };
26
- function zr(t, e) {
26
+ function Lr(t, e) {
27
27
  var n = {};
28
28
  for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
29
29
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
@@ -31,7 +31,7 @@ function zr(t, e) {
31
31
  e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[i]) && (n[r[i]] = t[r[i]]);
32
32
  return n;
33
33
  }
34
- function Lr(t, e, n, r) {
34
+ function Wr(t, e, n, r) {
35
35
  function i(o) {
36
36
  return o instanceof n ? o : new n(function(s) {
37
37
  s(o);
@@ -58,7 +58,7 @@ function Lr(t, e, n, r) {
58
58
  l((r = r.apply(t, e || [])).next());
59
59
  });
60
60
  }
61
- function zn(t, e) {
61
+ function Ln(t, e) {
62
62
  var n = { label: 0, sent: function() {
63
63
  if (o[0] & 1) throw o[1];
64
64
  return o[1];
@@ -153,7 +153,7 @@ function pt(t, e, n) {
153
153
  function Ae(t) {
154
154
  return this instanceof Ae ? (this.v = t, this) : new Ae(t);
155
155
  }
156
- function Wr(t, e, n) {
156
+ function Hr(t, e, n) {
157
157
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
158
158
  var r = n.apply(t, e || []), i, o = [];
159
159
  return i = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), u("next"), u("throw"), u("return", s), i[Symbol.asyncIterator] = function() {
@@ -191,7 +191,7 @@ function Wr(t, e, n) {
191
191
  a(h), o.shift(), o.length && c(o[0][0], o[0][1]);
192
192
  }
193
193
  }
194
- function Hr(t) {
194
+ function Br(t) {
195
195
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
196
196
  var e = t[Symbol.asyncIterator], n;
197
197
  return e ? e.call(t) : (t = typeof Oe == "function" ? Oe(t) : t[Symbol.iterator](), n = {}, r("next"), r("throw"), r("return"), n[Symbol.asyncIterator] = function() {
@@ -213,13 +213,13 @@ function Hr(t) {
213
213
  function P(t) {
214
214
  return typeof t == "function";
215
215
  }
216
- function Ln(t) {
216
+ function Wn(t) {
217
217
  var e = function(r) {
218
218
  Error.call(r), r.stack = new Error().stack;
219
219
  }, n = t(e);
220
220
  return n.prototype = Object.create(Error.prototype), n.prototype.constructor = n, n;
221
221
  }
222
- var Yt = Ln(function(t) {
222
+ var Yt = Wn(function(t) {
223
223
  return function(n) {
224
224
  t(this), this.message = n ? n.length + ` errors occurred during unsubscription:
225
225
  ` + n.map(function(r, i) {
@@ -322,16 +322,16 @@ var ge = function() {
322
322
  var e = new t();
323
323
  return e.closed = !0, e;
324
324
  }(), t;
325
- }(), Wn = ge.EMPTY;
326
- function Hn(t) {
325
+ }(), Hn = ge.EMPTY;
326
+ function Bn(t) {
327
327
  return t instanceof ge || t && "closed" in t && P(t.remove) && P(t.add) && P(t.unsubscribe);
328
328
  }
329
329
  function Sn(t) {
330
330
  P(t) ? t() : t.unsubscribe();
331
331
  }
332
- var Br = {
332
+ var Vr = {
333
333
  Promise: void 0
334
- }, Vr = {
334
+ }, Qr = {
335
335
  setTimeout: function(t, e) {
336
336
  for (var n = [], r = 2; r < arguments.length; r++)
337
337
  n[r - 2] = arguments[r];
@@ -342,8 +342,8 @@ var Br = {
342
342
  },
343
343
  delegate: void 0
344
344
  };
345
- function Bn(t) {
346
- Vr.setTimeout(function() {
345
+ function Vn(t) {
346
+ Qr.setTimeout(function() {
347
347
  throw t;
348
348
  });
349
349
  }
@@ -356,7 +356,7 @@ var At = function(t) {
356
356
  Z(e, t);
357
357
  function e(n) {
358
358
  var r = t.call(this) || this;
359
- return r.isStopped = !1, n ? (r.destination = n, Hn(n) && n.add(r)) : r.destination = Jr, r;
359
+ return r.isStopped = !1, n ? (r.destination = n, Bn(n) && n.add(r)) : r.destination = Kr, r;
360
360
  }
361
361
  return e.create = function(n, r, i) {
362
362
  return new en(n, r, i);
@@ -383,7 +383,7 @@ var At = function(t) {
383
383
  this.unsubscribe();
384
384
  }
385
385
  }, e;
386
- }(ge), Qr = function() {
386
+ }(ge), Yr = function() {
387
387
  function t(e) {
388
388
  this.partialObserver = e;
389
389
  }
@@ -422,29 +422,29 @@ var At = function(t) {
422
422
  next: n ?? void 0,
423
423
  error: r ?? void 0,
424
424
  complete: i ?? void 0
425
- } : s = n, o.destination = new Qr(s), o;
425
+ } : s = n, o.destination = new Yr(s), o;
426
426
  }
427
427
  return e;
428
428
  }(At);
429
429
  function ct(t) {
430
- Bn(t);
430
+ Vn(t);
431
431
  }
432
- function Yr(t) {
432
+ function Jr(t) {
433
433
  throw t;
434
434
  }
435
- var Jr = {
435
+ var Kr = {
436
436
  closed: !0,
437
437
  next: kn,
438
- error: Yr,
438
+ error: Jr,
439
439
  complete: kn
440
440
  }, on = function() {
441
441
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
442
442
  }();
443
- function Vn(t) {
443
+ function Qn(t) {
444
444
  return t;
445
445
  }
446
- function Kr(t) {
447
- return t.length === 0 ? Vn : t.length === 1 ? t[0] : function(n) {
446
+ function Zr(t) {
447
+ return t.length === 0 ? Qn : t.length === 1 ? t[0] : function(n) {
448
448
  return t.reduce(function(r, i) {
449
449
  return i(r);
450
450
  }, n);
@@ -458,7 +458,7 @@ var q = function() {
458
458
  var n = new t();
459
459
  return n.source = this, n.operator = e, n;
460
460
  }, t.prototype.subscribe = function(e, n, r) {
461
- var i = this, o = Gr(e) ? e : new en(e, n, r);
461
+ var i = this, o = Xr(e) ? e : new en(e, n, r);
462
462
  return lt(function() {
463
463
  var s = i, u = s.operator, c = s.source;
464
464
  o.add(u ? u.call(o, c) : c ? i._subscribe(o) : i._trySubscribe(o));
@@ -493,7 +493,7 @@ var q = function() {
493
493
  }, t.prototype.pipe = function() {
494
494
  for (var e = [], n = 0; n < arguments.length; n++)
495
495
  e[n] = arguments[n];
496
- return Kr(e)(this);
496
+ return Zr(e)(this);
497
497
  }, t.prototype.toPromise = function(e) {
498
498
  var n = this;
499
499
  return e = xn(e), new e(function(r, i) {
@@ -512,20 +512,20 @@ var q = function() {
512
512
  }();
513
513
  function xn(t) {
514
514
  var e;
515
- return (e = t ?? Br.Promise) !== null && e !== void 0 ? e : Promise;
516
- }
517
- function Zr(t) {
518
- return t && P(t.next) && P(t.error) && P(t.complete);
515
+ return (e = t ?? Vr.Promise) !== null && e !== void 0 ? e : Promise;
519
516
  }
520
517
  function Gr(t) {
521
- return t && t instanceof At || Zr(t) && Hn(t);
518
+ return t && P(t.next) && P(t.error) && P(t.complete);
522
519
  }
523
520
  function Xr(t) {
521
+ return t && t instanceof At || Gr(t) && Bn(t);
522
+ }
523
+ function ei(t) {
524
524
  return P(t?.lift);
525
525
  }
526
526
  function re(t) {
527
527
  return function(e) {
528
- if (Xr(e))
528
+ if (ei(e))
529
529
  return e.lift(function(n) {
530
530
  try {
531
531
  return t(n, this);
@@ -537,9 +537,9 @@ function re(t) {
537
537
  };
538
538
  }
539
539
  function J(t, e, n, r, i) {
540
- return new ei(t, e, n, r, i);
540
+ return new ti(t, e, n, r, i);
541
541
  }
542
- var ei = function(t) {
542
+ var ti = function(t) {
543
543
  Z(e, t);
544
544
  function e(n, r, i, o, s, u) {
545
545
  var c = t.call(this, n) || this;
@@ -574,7 +574,7 @@ var ei = function(t) {
574
574
  t.prototype.unsubscribe.call(this), !r && ((n = this.onFinalize) === null || n === void 0 || n.call(this));
575
575
  }
576
576
  }, e;
577
- }(At), ti = Ln(function(t) {
577
+ }(At), ni = Wn(function(t) {
578
578
  return function() {
579
579
  t(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
580
580
  };
@@ -589,7 +589,7 @@ var ei = function(t) {
589
589
  return r.operator = n, r;
590
590
  }, e.prototype._throwIfClosed = function() {
591
591
  if (this.closed)
592
- throw new ti();
592
+ throw new ni();
593
593
  }, e.prototype.next = function(n) {
594
594
  var r = this;
595
595
  lt(function() {
@@ -645,7 +645,7 @@ var ei = function(t) {
645
645
  return this._throwIfClosed(), this._checkFinalizedStatuses(n), this._innerSubscribe(n);
646
646
  }, e.prototype._innerSubscribe = function(n) {
647
647
  var r = this, i = this, o = i.hasError, s = i.isStopped, u = i.observers;
648
- return o || s ? Wn : (this.currentObservers = null, u.push(n), new ge(function() {
648
+ return o || s ? Hn : (this.currentObservers = null, u.push(n), new ge(function() {
649
649
  r.currentObservers = null, _t(u, n);
650
650
  }));
651
651
  }, e.prototype._checkFinalizedStatuses = function(n) {
@@ -674,7 +674,7 @@ var ei = function(t) {
674
674
  (r = (n = this.destination) === null || n === void 0 ? void 0 : n.complete) === null || r === void 0 || r.call(n);
675
675
  }, e.prototype._subscribe = function(n) {
676
676
  var r, i;
677
- return (i = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(n)) !== null && i !== void 0 ? i : Wn;
677
+ return (i = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(n)) !== null && i !== void 0 ? i : Hn;
678
678
  }, e;
679
679
  }(ae), le = function(t) {
680
680
  Z(e, t);
@@ -727,7 +727,7 @@ var ei = function(t) {
727
727
  l && o.splice(0, l + 1);
728
728
  }
729
729
  }, e;
730
- }(ae), ni = function(t) {
730
+ }(ae), ri = function(t) {
731
731
  Z(e, t);
732
732
  function e(n, r) {
733
733
  return t.call(this) || this;
@@ -745,7 +745,7 @@ var ei = function(t) {
745
745
  return clearInterval(t);
746
746
  },
747
747
  delegate: void 0
748
- }, ri = function(t) {
748
+ }, ii = function(t) {
749
749
  Z(e, t);
750
750
  function e(n, r) {
751
751
  var i = t.call(this, n, r) || this;
@@ -787,14 +787,14 @@ var ei = function(t) {
787
787
  this.work = this.state = this.scheduler = null, this.pending = !1, _t(o, this), r != null && (this.id = this.recycleAsyncId(i, r, null)), this.delay = null, t.prototype.unsubscribe.call(this);
788
788
  }
789
789
  }, e;
790
- }(ni), An = function() {
790
+ }(ri), An = function() {
791
791
  function t(e, n) {
792
792
  n === void 0 && (n = t.now), this.schedulerActionCtor = e, this.now = n;
793
793
  }
794
794
  return t.prototype.schedule = function(e, n, r) {
795
795
  return n === void 0 && (n = 0), new this.schedulerActionCtor(this, e).schedule(r, n);
796
796
  }, t.now = sn.now, t;
797
- }(), ii = function(t) {
797
+ }(), oi = function(t) {
798
798
  Z(e, t);
799
799
  function e(n, r) {
800
800
  r === void 0 && (r = An.now);
@@ -819,44 +819,44 @@ var ei = function(t) {
819
819
  throw i;
820
820
  }
821
821
  }, e;
822
- }(An), Qn = new ii(ri), oi = Qn, si = new q(function(t) {
822
+ }(An), Yn = new oi(ii), si = Yn, ui = new q(function(t) {
823
823
  return t.complete();
824
824
  });
825
- function Yn(t) {
825
+ function Jn(t) {
826
826
  return t && P(t.schedule);
827
827
  }
828
- function ui(t) {
828
+ function ci(t) {
829
829
  return t[t.length - 1];
830
830
  }
831
- function ci(t) {
832
- return Yn(ui(t)) ? t.pop() : void 0;
831
+ function ai(t) {
832
+ return Jn(ci(t)) ? t.pop() : void 0;
833
833
  }
834
- var Jn = function(t) {
834
+ var Kn = function(t) {
835
835
  return t && typeof t.length == "number" && typeof t != "function";
836
836
  };
837
- function Kn(t) {
837
+ function Zn(t) {
838
838
  return P(t?.then);
839
839
  }
840
- function Zn(t) {
840
+ function Gn(t) {
841
841
  return P(t[on]);
842
842
  }
843
- function Gn(t) {
843
+ function Xn(t) {
844
844
  return Symbol.asyncIterator && P(t?.[Symbol.asyncIterator]);
845
845
  }
846
- function Xn(t) {
846
+ function er(t) {
847
847
  return new TypeError("You provided " + (t !== null && typeof t == "object" ? "an invalid object" : "'" + t + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
848
848
  }
849
- function ai() {
849
+ function li() {
850
850
  return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
851
851
  }
852
- var er = ai();
853
- function tr(t) {
854
- return P(t?.[er]);
855
- }
852
+ var tr = li();
856
853
  function nr(t) {
857
- return Wr(this, arguments, function() {
854
+ return P(t?.[tr]);
855
+ }
856
+ function rr(t) {
857
+ return Hr(this, arguments, function() {
858
858
  var n, r, i, o;
859
- return zn(this, function(s) {
859
+ return Ln(this, function(s) {
860
860
  switch (s.label) {
861
861
  case 0:
862
862
  n = t.getReader(), s.label = 1;
@@ -884,29 +884,29 @@ function nr(t) {
884
884
  });
885
885
  });
886
886
  }
887
- function rr(t) {
887
+ function ir(t) {
888
888
  return P(t?.getReader);
889
889
  }
890
890
  function ie(t) {
891
891
  if (t instanceof q)
892
892
  return t;
893
893
  if (t != null) {
894
- if (Zn(t))
895
- return li(t);
896
- if (Jn(t))
894
+ if (Gn(t))
897
895
  return fi(t);
898
896
  if (Kn(t))
899
897
  return hi(t);
900
- if (Gn(t))
901
- return ir(t);
902
- if (tr(t))
898
+ if (Zn(t))
903
899
  return di(t);
904
- if (rr(t))
900
+ if (Xn(t))
901
+ return or(t);
902
+ if (nr(t))
905
903
  return pi(t);
904
+ if (ir(t))
905
+ return _i(t);
906
906
  }
907
- throw Xn(t);
907
+ throw er(t);
908
908
  }
909
- function li(t) {
909
+ function fi(t) {
910
910
  return new q(function(e) {
911
911
  var n = t[on]();
912
912
  if (P(n.subscribe))
@@ -914,23 +914,23 @@ function li(t) {
914
914
  throw new TypeError("Provided object does not correctly implement Symbol.observable");
915
915
  });
916
916
  }
917
- function fi(t) {
917
+ function hi(t) {
918
918
  return new q(function(e) {
919
919
  for (var n = 0; n < t.length && !e.closed; n++)
920
920
  e.next(t[n]);
921
921
  e.complete();
922
922
  });
923
923
  }
924
- function hi(t) {
924
+ function di(t) {
925
925
  return new q(function(e) {
926
926
  t.then(function(n) {
927
927
  e.closed || (e.next(n), e.complete());
928
928
  }, function(n) {
929
929
  return e.error(n);
930
- }).then(null, Bn);
930
+ }).then(null, Vn);
931
931
  });
932
932
  }
933
- function di(t) {
933
+ function pi(t) {
934
934
  return new q(function(e) {
935
935
  var n, r;
936
936
  try {
@@ -951,24 +951,24 @@ function di(t) {
951
951
  e.complete();
952
952
  });
953
953
  }
954
- function ir(t) {
954
+ function or(t) {
955
955
  return new q(function(e) {
956
- _i(t, e).catch(function(n) {
956
+ mi(t, e).catch(function(n) {
957
957
  return e.error(n);
958
958
  });
959
959
  });
960
960
  }
961
- function pi(t) {
962
- return ir(nr(t));
961
+ function _i(t) {
962
+ return or(rr(t));
963
963
  }
964
- function _i(t, e) {
964
+ function mi(t, e) {
965
965
  var n, r, i, o;
966
- return Lr(this, void 0, void 0, function() {
966
+ return Wr(this, void 0, void 0, function() {
967
967
  var s, u;
968
- return zn(this, function(c) {
968
+ return Ln(this, function(c) {
969
969
  switch (c.label) {
970
970
  case 0:
971
- c.trys.push([0, 5, 6, 11]), n = Hr(t), c.label = 1;
971
+ c.trys.push([0, 5, 6, 11]), n = Br(t), c.label = 1;
972
972
  case 1:
973
973
  return [4, n.next()];
974
974
  case 2:
@@ -1007,7 +1007,7 @@ function _e(t, e, n, r, i) {
1007
1007
  if (t.add(o), !i)
1008
1008
  return o;
1009
1009
  }
1010
- function or(t, e) {
1010
+ function sr(t, e) {
1011
1011
  return e === void 0 && (e = 0), re(function(n, r) {
1012
1012
  n.subscribe(J(r, function(i) {
1013
1013
  return _e(r, t, function() {
@@ -1024,20 +1024,20 @@ function or(t, e) {
1024
1024
  }));
1025
1025
  });
1026
1026
  }
1027
- function sr(t, e) {
1027
+ function ur(t, e) {
1028
1028
  return e === void 0 && (e = 0), re(function(n, r) {
1029
1029
  r.add(t.schedule(function() {
1030
1030
  return n.subscribe(r);
1031
1031
  }, e));
1032
1032
  });
1033
1033
  }
1034
- function mi(t, e) {
1035
- return ie(t).pipe(sr(e), or(e));
1036
- }
1037
1034
  function yi(t, e) {
1038
- return ie(t).pipe(sr(e), or(e));
1035
+ return ie(t).pipe(ur(e), sr(e));
1039
1036
  }
1040
1037
  function gi(t, e) {
1038
+ return ie(t).pipe(ur(e), sr(e));
1039
+ }
1040
+ function vi(t, e) {
1041
1041
  return new q(function(n) {
1042
1042
  var r = 0;
1043
1043
  return e.schedule(function() {
@@ -1045,11 +1045,11 @@ function gi(t, e) {
1045
1045
  });
1046
1046
  });
1047
1047
  }
1048
- function vi(t, e) {
1048
+ function bi(t, e) {
1049
1049
  return new q(function(n) {
1050
1050
  var r;
1051
1051
  return _e(n, e, function() {
1052
- r = t[er](), _e(n, e, function() {
1052
+ r = t[tr](), _e(n, e, function() {
1053
1053
  var i, o, s;
1054
1054
  try {
1055
1055
  i = r.next(), o = i.value, s = i.done;
@@ -1064,7 +1064,7 @@ function vi(t, e) {
1064
1064
  };
1065
1065
  });
1066
1066
  }
1067
- function ur(t, e) {
1067
+ function cr(t, e) {
1068
1068
  if (!t)
1069
1069
  throw new Error("Iterable cannot be null");
1070
1070
  return new q(function(n) {
@@ -1078,34 +1078,34 @@ function ur(t, e) {
1078
1078
  });
1079
1079
  });
1080
1080
  }
1081
- function bi(t, e) {
1082
- return ur(nr(t), e);
1083
- }
1084
1081
  function Si(t, e) {
1082
+ return cr(rr(t), e);
1083
+ }
1084
+ function ki(t, e) {
1085
1085
  if (t != null) {
1086
- if (Zn(t))
1087
- return mi(t, e);
1088
- if (Jn(t))
1089
- return gi(t, e);
1090
- if (Kn(t))
1091
- return yi(t, e);
1092
1086
  if (Gn(t))
1093
- return ur(t, e);
1094
- if (tr(t))
1087
+ return yi(t, e);
1088
+ if (Kn(t))
1095
1089
  return vi(t, e);
1096
- if (rr(t))
1090
+ if (Zn(t))
1091
+ return gi(t, e);
1092
+ if (Xn(t))
1093
+ return cr(t, e);
1094
+ if (nr(t))
1097
1095
  return bi(t, e);
1096
+ if (ir(t))
1097
+ return Si(t, e);
1098
1098
  }
1099
- throw Xn(t);
1099
+ throw er(t);
1100
1100
  }
1101
- function cr(t, e) {
1102
- return e ? Si(t, e) : ie(t);
1101
+ function ar(t, e) {
1102
+ return e ? ki(t, e) : ie(t);
1103
1103
  }
1104
1104
  function wn() {
1105
1105
  for (var t = [], e = 0; e < arguments.length; e++)
1106
1106
  t[e] = arguments[e];
1107
- var n = ci(t);
1108
- return cr(t, n);
1107
+ var n = ai(t);
1108
+ return ar(t, n);
1109
1109
  }
1110
1110
  function On(t, e) {
1111
1111
  var n = P(t) ? t : function() {
@@ -1115,7 +1115,7 @@ function On(t, e) {
1115
1115
  };
1116
1116
  return new q(r);
1117
1117
  }
1118
- function ki(t) {
1118
+ function xi(t) {
1119
1119
  return t instanceof Date && !isNaN(t);
1120
1120
  }
1121
1121
  function I(t, e) {
@@ -1126,7 +1126,7 @@ function I(t, e) {
1126
1126
  }));
1127
1127
  });
1128
1128
  }
1129
- function xi(t, e, n, r, i, o, s, u) {
1129
+ function $i(t, e, n, r, i, o, s, u) {
1130
1130
  var c = [], l = 0, _ = 0, b = !1, p = function() {
1131
1131
  b && !c.length && !l && e.complete();
1132
1132
  }, a = function(f) {
@@ -1164,14 +1164,14 @@ function un(t, e, n) {
1164
1164
  return e(r, o, i, s);
1165
1165
  })(ie(t(r, i)));
1166
1166
  }, n) : (typeof e == "number" && (n = e), re(function(r, i) {
1167
- return xi(r, i, t, n);
1167
+ return $i(r, i, t, n);
1168
1168
  }));
1169
1169
  }
1170
- function $i(t, e, n) {
1171
- t === void 0 && (t = 0), n === void 0 && (n = oi);
1170
+ function Ai(t, e, n) {
1171
+ t === void 0 && (t = 0), n === void 0 && (n = si);
1172
1172
  var r = -1;
1173
- return e != null && (Yn(e) ? n = e : r = e), new q(function(i) {
1174
- var o = ki(t) ? +t - n.now() : t;
1173
+ return e != null && (Jn(e) ? n = e : r = e), new q(function(i) {
1174
+ var o = xi(t) ? +t - n.now() : t;
1175
1175
  o < 0 && (o = 0);
1176
1176
  var s = 0;
1177
1177
  return n.schedule(function() {
@@ -1179,7 +1179,7 @@ function $i(t, e, n) {
1179
1179
  }, o);
1180
1180
  });
1181
1181
  }
1182
- function Ai(t, e) {
1182
+ function wi(t, e) {
1183
1183
  return re(function(n, r) {
1184
1184
  var i = 0;
1185
1185
  n.subscribe(J(r, function(o) {
@@ -1187,9 +1187,9 @@ function Ai(t, e) {
1187
1187
  }));
1188
1188
  });
1189
1189
  }
1190
- function ar(t) {
1190
+ function lr(t) {
1191
1191
  return t <= 0 ? function() {
1192
- return si;
1192
+ return ui;
1193
1193
  } : re(function(e, n) {
1194
1194
  var r = 0;
1195
1195
  e.subscribe(J(n, function(i) {
@@ -1197,25 +1197,25 @@ function ar(t) {
1197
1197
  }));
1198
1198
  });
1199
1199
  }
1200
- function wi(t) {
1200
+ function Oi(t) {
1201
1201
  return I(function() {
1202
1202
  return t;
1203
1203
  });
1204
1204
  }
1205
- function Oi(t, e) {
1205
+ function Ei(t, e) {
1206
1206
  return un(function(n, r) {
1207
- return ie(t(n, r)).pipe(ar(1), wi(n));
1207
+ return ie(t(n, r)).pipe(lr(1), Oi(n));
1208
1208
  });
1209
1209
  }
1210
- function Ei(t, e) {
1211
- e === void 0 && (e = Qn);
1212
- var n = $i(t, e);
1213
- return Oi(function() {
1210
+ function Ii(t, e) {
1211
+ e === void 0 && (e = Yn);
1212
+ var n = Ai(t, e);
1213
+ return Ei(function() {
1214
1214
  return n;
1215
1215
  });
1216
1216
  }
1217
- function Ii(t, e) {
1218
- return e === void 0 && (e = Vn), t = t ?? Pi, re(function(n, r) {
1217
+ function Pi(t, e) {
1218
+ return e === void 0 && (e = Qn), t = t ?? Ti, re(function(n, r) {
1219
1219
  var i, o = !0;
1220
1220
  n.subscribe(J(r, function(s) {
1221
1221
  var u = e(s);
@@ -1223,10 +1223,10 @@ function Ii(t, e) {
1223
1223
  }));
1224
1224
  });
1225
1225
  }
1226
- function Pi(t, e) {
1226
+ function Ti(t, e) {
1227
1227
  return t === e;
1228
1228
  }
1229
- function Ti(t) {
1229
+ function Mi(t) {
1230
1230
  return re(function(e, n) {
1231
1231
  var r, i = !1, o, s = function() {
1232
1232
  r = e.subscribe(J(n, void 0, void 0, function(u) {
@@ -1258,7 +1258,7 @@ function En(t, e) {
1258
1258
  }
1259
1259
  function cn(t, e) {
1260
1260
  e === void 0 && (e = {});
1261
- var n = e.selector, r = zr(e, ["selector"]);
1261
+ var n = e.selector, r = Lr(e, ["selector"]);
1262
1262
  return new q(function(i) {
1263
1263
  var o = new AbortController(), s = o.signal, u = !0, c = r.signal;
1264
1264
  if (c)
@@ -1482,13 +1482,13 @@ function at(t) {
1482
1482
  throw new Error("Unable to parse base64 string.");
1483
1483
  return e;
1484
1484
  }
1485
- function lr(t) {
1485
+ function fr(t) {
1486
1486
  let e = "", n, r = t.length;
1487
1487
  for (n = 2; n < r; n += 3)
1488
1488
  e += te[t[n - 2] >> 2], e += te[(t[n - 2] & 3) << 4 | t[n - 1] >> 4], e += te[(t[n - 1] & 15) << 2 | t[n] >> 6], e += te[t[n] & 63];
1489
1489
  return n === r + 1 && (e += te[t[n - 2] >> 2], e += te[(t[n - 2] & 3) << 4], e += "=="), n === r && (e += te[t[n - 2] >> 2], e += te[(t[n - 2] & 3) << 4 | t[n - 1] >> 4], e += te[(t[n - 1] & 15) << 2], e += "="), e;
1490
1490
  }
1491
- function Mi(t) {
1491
+ function Ri(t) {
1492
1492
  if (t.length % 4 !== 0)
1493
1493
  throw new Error("Unable to parse base64 string.");
1494
1494
  const e = t.indexOf("=");
@@ -1499,11 +1499,11 @@ function Mi(t) {
1499
1499
  o = at(t.charCodeAt(s)) << 18 | at(t.charCodeAt(s + 1)) << 12 | at(t.charCodeAt(s + 2)) << 6 | at(t.charCodeAt(s + 3)), i[u] = o >> 16, i[u + 1] = o >> 8 & 255, i[u + 2] = o & 255;
1500
1500
  return i.subarray(0, i.length - n);
1501
1501
  }
1502
- function Ri(t, e = new TextEncoder()) {
1503
- return lr(e.encode(t));
1502
+ function Ui(t, e = new TextEncoder()) {
1503
+ return fr(e.encode(t));
1504
1504
  }
1505
- var ft = { exports: {} }, Ui = ft.exports, Pn;
1506
- function Di() {
1505
+ var ft = { exports: {} }, Di = ft.exports, Pn;
1506
+ function qi() {
1507
1507
  return Pn || (Pn = 1, function(t) {
1508
1508
  (function(e, n) {
1509
1509
  var r = {};
@@ -1512,7 +1512,7 @@ function Di() {
1512
1512
  for (var o in r)
1513
1513
  i[o] = r[o];
1514
1514
  t.exports = i;
1515
- })(Ui, function(e) {
1515
+ })(Di, function(e) {
1516
1516
  e.__esModule = !0, e.digestLength = 32, e.blockSize = 64;
1517
1517
  var n = new Uint32Array([
1518
1518
  1116352408,
@@ -1728,8 +1728,8 @@ function Di() {
1728
1728
  });
1729
1729
  }(ft)), ft.exports;
1730
1730
  }
1731
- var qi = Di();
1732
- const Ci = new Int32Array(4);
1731
+ var Ci = qi();
1732
+ const Ni = new Int32Array(4);
1733
1733
  class H {
1734
1734
  static hashStr(e, n = !1) {
1735
1735
  return this.onePassHasher.start().appendStr(e).end(n);
@@ -1887,7 +1887,7 @@ class H {
1887
1887
  i[14] = s;
1888
1888
  else {
1889
1889
  const u = s.toString(16).match(/(.*?)(.{0,8})$/);
1890
- if (u === null) return e ? Ci : "";
1890
+ if (u === null) return e ? Ni : "";
1891
1891
  const c = parseInt(u[2], 16), l = parseInt(u[1], 16) || 0;
1892
1892
  i[14] = c, i[15] = l;
1893
1893
  }
@@ -1896,14 +1896,14 @@ class H {
1896
1896
  }
1897
1897
  if (H.hashStr("hello") !== "5d41402abc4b2a76b9719d911017c592")
1898
1898
  throw new Error("Md5 self test failed.");
1899
- const Ni = 36e5, Tn = Symbol.for("constructDateFrom");
1899
+ const ji = 36e5, Tn = Symbol.for("constructDateFrom");
1900
1900
  function mt(t, e) {
1901
1901
  return typeof t == "function" ? t(e) : t && typeof t == "object" && Tn in t ? t[Tn](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
1902
1902
  }
1903
1903
  function Le(t, e) {
1904
1904
  return mt(t, t);
1905
1905
  }
1906
- function ji(t, e, n) {
1906
+ function Fi(t, e, n) {
1907
1907
  const r = Le(t);
1908
1908
  if (isNaN(e)) return mt(t, NaN);
1909
1909
  const i = r.getDate(), o = mt(t, r.getTime());
@@ -1915,22 +1915,22 @@ function ji(t, e, n) {
1915
1915
  i
1916
1916
  ), r);
1917
1917
  }
1918
- function fr(t, e, n) {
1918
+ function hr(t, e, n) {
1919
1919
  return mt(t, +Le(t) + e);
1920
1920
  }
1921
- function Fi(t, e, n) {
1922
- return fr(t, e * Ni);
1923
- }
1924
1921
  function zi(t, e, n) {
1925
- return fr(t, e * 1e3);
1922
+ return hr(t, e * ji);
1926
1923
  }
1927
1924
  function Li(t, e, n) {
1928
- return ji(t, e * 12);
1925
+ return hr(t, e * 1e3);
1926
+ }
1927
+ function Wi(t, e, n) {
1928
+ return Fi(t, e * 12);
1929
1929
  }
1930
1930
  function Mn(t) {
1931
1931
  return Math.trunc(+Le(t) / 1e3);
1932
1932
  }
1933
- function Wi(t, e) {
1933
+ function Hi(t, e) {
1934
1934
  return +Le(t) < +Le(e);
1935
1935
  }
1936
1936
  function d(t, e, n, r = "debug", i) {
@@ -1946,7 +1946,7 @@ function d(t, e, n, r = "debug", i) {
1946
1946
  function Rn() {
1947
1947
  return !(document.documentMode || /Edge/.test(navigator.userAgent));
1948
1948
  }
1949
- function hr() {
1949
+ function dr() {
1950
1950
  const t = window.location?.hash ? window.location?.hash.slice(1) : window.location?.href.split("#")[1] || "";
1951
1951
  let e = window.location?.search ? window.location?.search.slice(1) : window.location?.href.split("?")[1] || "", n = {};
1952
1952
  if (t)
@@ -1969,7 +1969,7 @@ function je(t) {
1969
1969
  return e;
1970
1970
  }
1971
1971
  const Un = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
1972
- function Hi(t = 40) {
1972
+ function Bi(t = 40) {
1973
1973
  let e = "";
1974
1974
  for (let n = 0; n < t; n++)
1975
1975
  e += Un.charAt(
@@ -1992,7 +1992,7 @@ function yt(t, e = !1) {
1992
1992
  const r = Math.floor(Math.log(t) / Math.log(n)), i = (e ? "kMGTPE" : "KMGTPE").charAt(r - 1) + (e ? "iB" : "B");
1993
1993
  return (t / Math.pow(n, r)).toFixed(2) + " " + i;
1994
1994
  }
1995
- function Bi(t) {
1995
+ function Vi(t) {
1996
1996
  if (t.length === 0)
1997
1997
  throw new Error("Input must not be of zero length");
1998
1998
  const e = t.split(","), n = {};
@@ -2005,12 +2005,12 @@ function Bi(t) {
2005
2005
  }
2006
2006
  return n;
2007
2007
  }
2008
- function Vi(t, e) {
2008
+ function Qi(t, e) {
2009
2009
  for (const n in t)
2010
2010
  t.hasOwnProperty(n) && e.indexOf(t[n]) >= 0 && delete t[n];
2011
2011
  return t;
2012
2012
  }
2013
- function Qi() {
2013
+ function Yi() {
2014
2014
  return [
2015
2015
  "iPad Simulator",
2016
2016
  "iPhone Simulator",
@@ -2021,13 +2021,13 @@ function Qi() {
2021
2021
  ].includes(navigator.platform) || // iPad on iOS 13 detection
2022
2022
  navigator.userAgent.includes("Mac") && "ontouchend" in document;
2023
2023
  }
2024
- function Yi() {
2024
+ function Ji() {
2025
2025
  return window.location !== window.parent.location;
2026
2026
  }
2027
- function Ji(t = Date.now(), e = 60 * 1e3) {
2027
+ function Ki(t = Date.now(), e = 60 * 1e3) {
2028
2028
  return Math.floor(t / e);
2029
2029
  }
2030
- class Ki {
2030
+ class Zi {
2031
2031
  abort() {
2032
2032
  d("Stub", "Aborted");
2033
2033
  }
@@ -2042,13 +2042,13 @@ function z(t) {
2042
2042
  return e;
2043
2043
  }
2044
2044
  const me = {}, Fe = {}, ue = {};
2045
- function Zi() {
2045
+ function Gi() {
2046
2046
  for (const t in me)
2047
2047
  me.hasOwnProperty(t) && ve(t);
2048
2048
  for (const t in Fe)
2049
- Fe.hasOwnProperty(t) && Gi(t);
2049
+ Fe.hasOwnProperty(t) && Xi(t);
2050
2050
  for (const t in ue)
2051
- ue.hasOwnProperty(t) && Xi(t);
2051
+ ue.hasOwnProperty(t) && eo(t);
2052
2052
  }
2053
2053
  function ne(t, e, n = 300) {
2054
2054
  if (t && e && e instanceof Function)
@@ -2063,13 +2063,13 @@ function ne(t, e, n = 300) {
2063
2063
  function ve(t) {
2064
2064
  me[t] && (clearTimeout(me[t]), delete me[t]);
2065
2065
  }
2066
- function Gi(t) {
2066
+ function Xi(t) {
2067
2067
  Fe[t] && (clearInterval(Fe[t]), delete Fe[t]);
2068
2068
  }
2069
- function Xi(t) {
2069
+ function eo(t) {
2070
2070
  ue && ue[t] && (ue[t] instanceof ge ? ue[t].unsubscribe() : ue[t](), delete ue[t]);
2071
2071
  }
2072
- const eo = {
2072
+ const to = {
2073
2073
  id: "mock-authority",
2074
2074
  name: "localhost:4200",
2075
2075
  description: "",
@@ -2086,30 +2086,30 @@ const v = {};
2086
2086
  let w = "", ye = "";
2087
2087
  const Ee = new le(""), wt = new le("");
2088
2088
  let an = "/api/engine/v2";
2089
- const ce = new le(!1), to = ce.asObservable();
2089
+ const ce = new le(!1), no = ce.asObservable();
2090
2090
  let gt = 0;
2091
2091
  function be() {
2092
- return `${`${g.secure || window.location?.protocol.indexOf("https") >= 0 ? "https:" : "http:"}//${g.host || window.location?.host}`}${dr()}`;
2092
+ return `${`${g.secure || window.location?.protocol.indexOf("https") >= 0 ? "https:" : "http:"}//${g.host || window.location?.host}`}${pr()}`;
2093
2093
  }
2094
- function dr() {
2094
+ function pr() {
2095
2095
  return g.version === "ACA Engine" ? "/control/api" : an;
2096
2096
  }
2097
- function no() {
2097
+ function ro() {
2098
2098
  return !!g.token_header;
2099
2099
  }
2100
- function ro() {
2100
+ function io() {
2101
2101
  return w;
2102
2102
  }
2103
2103
  function ys() {
2104
2104
  return g.redirect_uri;
2105
2105
  }
2106
2106
  function gs(t, e = !0) {
2107
- A.setItem(`${w}_x-api-key`, `${t}`), A.setItem("trusted", `${e}`), io("x-api-key", Li(/* @__PURE__ */ new Date(), 5).valueOf());
2107
+ A.setItem(`${w}_x-api-key`, `${t}`), A.setItem("trusted", `${e}`), oo("x-api-key", Wi(/* @__PURE__ */ new Date(), 5).valueOf());
2108
2108
  }
2109
2109
  function Ot() {
2110
2110
  return bt("x-api-key", !1) || "";
2111
2111
  }
2112
- function io(t, e = Fi(/* @__PURE__ */ new Date(), 2).valueOf()) {
2112
+ function oo(t, e = zi(/* @__PURE__ */ new Date(), 2).valueOf()) {
2113
2113
  g.ignore_api_key && t === "x-api-key" || (A.setItem(`${w}_expires_at`, `${e}`), A.setItem(`${w}_access_token`, t));
2114
2114
  }
2115
2115
  function Y(t = !0) {
@@ -2117,9 +2117,9 @@ function Y(t = !0) {
2117
2117
  if (!A) return "";
2118
2118
  if (Ot() && !g.ignore_api_key) return "x-api-key";
2119
2119
  const e = A.getItem(`${w}_expires_at`) || "", n = Ee.getValue();
2120
- return Wi(+e, /* @__PURE__ */ new Date()) && (d("Auth", "Token expired. Requesting new token..."), hn(), v.load_authority || (gt += 1, ne(
2120
+ return Hi(+e, /* @__PURE__ */ new Date()) && (d("Auth", "Token expired. Requesting new token..."), hn(), v.load_authority || (gt += 1, ne(
2121
2121
  "re-authorise",
2122
- () => mr().catch(
2122
+ () => yr().catch(
2123
2123
  (r) => d("Auth", `Failed to get token: ${r}`)
2124
2124
  ),
2125
2125
  200 * Math.min(20, gt)
@@ -2131,11 +2131,11 @@ function nn() {
2131
2131
  function rn() {
2132
2132
  return g.host || window.location?.host;
2133
2133
  }
2134
- function oo() {
2134
+ function so() {
2135
2135
  return !!Y();
2136
2136
  }
2137
- function so() {
2138
- return Ee.pipe(I((t) => !!oo()));
2137
+ function uo() {
2138
+ return Ee.pipe(I((t) => !!so()));
2139
2139
  }
2140
2140
  function vt() {
2141
2141
  return F;
@@ -2146,42 +2146,42 @@ function vs() {
2146
2146
  function ln() {
2147
2147
  return !!g.mock;
2148
2148
  }
2149
- function uo() {
2149
+ function co() {
2150
2150
  return !!g.secure;
2151
2151
  }
2152
2152
  function bs() {
2153
- return to;
2153
+ return no;
2154
2154
  }
2155
2155
  function fn() {
2156
2156
  return bt("trust") === "true" || bt("trusted") === "true";
2157
2157
  }
2158
- function pr() {
2158
+ function _r() {
2159
2159
  return !!Ot() && !g.ignore_api_key || bt("fixed_device") === "true";
2160
2160
  }
2161
2161
  function bt(t, e = !0) {
2162
- let r = hr()[t];
2162
+ let r = dr()[t];
2163
2163
  if (A) {
2164
- const i = `${ro()}_${t}`;
2164
+ const i = `${io()}_${t}`;
2165
2165
  r = r || A.getItem(i) || A.getItem(t) || "", e && A.setItem(i, `${r}`);
2166
2166
  }
2167
2167
  return r;
2168
2168
  }
2169
2169
  function Ss(t) {
2170
- return g = t || g, g.token_header = g.token_header ?? Yi(), window.AbortController || (window.AbortController = Ki), A = g.storage === "session" ? sessionStorage : localStorage, w = H.hashStr(g.redirect_uri, !1), dn();
2170
+ return g = t || g, g.token_header = g.token_header ?? Ji(), window.AbortController || (window.AbortController = Zi), A = g.storage === "session" ? sessionStorage : localStorage, w = H.hashStr(g.redirect_uri, !1), dn();
2171
2171
  }
2172
2172
  function ks() {
2173
2173
  g = {}, F = void 0, Ee.next(""), wt.next(""), ce.next(!1), w = "", ye = "", an = "/api/engine/v2";
2174
2174
  for (const t in v)
2175
2175
  t in v && delete v[t];
2176
- Zi();
2176
+ Gi();
2177
2177
  }
2178
- function _r() {
2178
+ function mr() {
2179
2179
  return d("Auth", "Refreshing authorty."), F = void 0, dn();
2180
2180
  }
2181
2181
  function hn() {
2182
2182
  d("Auth", "Invalidating tokens."), A.removeItem(`${w}_access_token`), A.removeItem(`${w}_expires_at`), Ee.getValue() && Ee.next("");
2183
2183
  }
2184
- function mr(t, e = F) {
2184
+ function yr(t, e = F) {
2185
2185
  return v.authorise || (v.authorise = new Promise((n, r) => {
2186
2186
  if (!e)
2187
2187
  return delete v.authorise, r("Authority is not loaded");
@@ -2198,18 +2198,18 @@ function mr(t, e = F) {
2198
2198
  d("Auth", "Failed to generate token."), r("Failed to generate token"), setTimeout(() => delete v.authorise, 200);
2199
2199
  }
2200
2200
  ];
2201
- g && g.auth_type === "password" ? (d("Auth", "Logging in with credentials."), yo(g).then(
2201
+ g && g.auth_type === "password" ? (d("Auth", "Logging in with credentials."), go(g).then(
2202
2202
  ...o
2203
2203
  ), gt = 0) : ye || nn() ? (d(
2204
2204
  "Auth",
2205
2205
  `Generating token with ${ye ? "code" : "refresh token"}`
2206
- ), gr().then(...o), gt = 0) : e.session ? (d(
2206
+ ), vr().then(...o), gt = 0) : e.session ? (d(
2207
2207
  "Auth",
2208
2208
  "Users has session. Authorising application..."
2209
- ), co(t).then(...o)) : (d("Auth", "No user session"), yr(e), r("No user session"), setTimeout(() => delete v.authorise, 200));
2209
+ ), ao(t).then(...o)) : (d("Auth", "No user session"), gr(e), r("No user session"), setTimeout(() => delete v.authorise, 200));
2210
2210
  }
2211
2211
  };
2212
- lo().then(i, i);
2212
+ fo().then(i, i);
2213
2213
  })), v.authorise;
2214
2214
  }
2215
2215
  function xs() {
@@ -2232,10 +2232,10 @@ function xs() {
2232
2232
  function dn(t = 0) {
2233
2233
  return v.load_authority || (v.load_authority = new Promise((e) => {
2234
2234
  if (ce.next(!1), g.mock) {
2235
- F = eo, d("Auth", "System in mock mode"), ce.next(!0), e();
2235
+ F = to, d("Auth", "System in mock mode"), ce.next(!0), e();
2236
2236
  return;
2237
2237
  }
2238
- d("Auth", `Fixed: ${pr()} | Trusted: ${fn()}`), d("Auth", "Loading authority...");
2238
+ d("Auth", `Fixed: ${_r()} | Trusted: ${fn()}`), d("Auth", "Loading authority...");
2239
2239
  const n = g.secure || window.location?.protocol.indexOf("https") >= 0, r = (i) => {
2240
2240
  d("Auth", `Failed to load authority(${i})`), ce.next(!1), ne(
2241
2241
  "load_authority",
@@ -2262,17 +2262,17 @@ function dn(t = 0) {
2262
2262
  const o = () => {
2263
2263
  ce.next(!0), d("Auth", "Application set online."), e();
2264
2264
  };
2265
- delete v.load_authority, mr("").then(o, o);
2265
+ delete v.load_authority, yr("").then(o, o);
2266
2266
  }, r);
2267
2267
  })), v.load_authority;
2268
2268
  }
2269
- async function co(t) {
2270
- const e = ho(t);
2269
+ async function ao(t) {
2270
+ const e = po(t);
2271
2271
  if (g.use_iframe)
2272
- return ao(e);
2272
+ return lo(e);
2273
2273
  window.location?.assign(e);
2274
2274
  }
2275
- function ao(t) {
2275
+ function lo(t) {
2276
2276
  return v.iframe_auth || (v.iframe_auth = new Promise((e, n) => {
2277
2277
  d("Auth", "Authorizing in an iFrame...");
2278
2278
  const r = document.createElement("iframe");
@@ -2285,7 +2285,7 @@ function ao(t) {
2285
2285
  access_token: s.token,
2286
2286
  ...s
2287
2287
  });
2288
- ye = s.code || "", gr().then(
2288
+ ye = s.code || "", vr().then(
2289
2289
  (u) => e(u),
2290
2290
  (u) => n(u)
2291
2291
  );
@@ -2303,7 +2303,7 @@ function ao(t) {
2303
2303
  })), v.iframe_auth;
2304
2304
  }
2305
2305
  let Dn = !1;
2306
- function yr(t) {
2306
+ function gr(t) {
2307
2307
  if (g.handle_login !== !1 && !Dn) {
2308
2308
  d("Auth", "Redirecting to login page...");
2309
2309
  const e = t.login_url?.replace(
@@ -2315,15 +2315,15 @@ function yr(t) {
2315
2315
  d("Auth", "Login being handled locally.");
2316
2316
  delete v.authorise;
2317
2317
  }
2318
- function lo() {
2318
+ function fo() {
2319
2319
  return v.check_token || (v.check_token = new Promise(async (t, e) => {
2320
- Y() ? (d("Auth", "Valid token found."), t(Y())) : (d("Auth", "No token. Checking URL for auth credentials..."), await fo() ? t(!0) : e()), delete v.check_token;
2320
+ Y() ? (d("Auth", "Valid token found."), t(Y())) : (d("Auth", "No token. Checking URL for auth credentials..."), await ho() ? t(!0) : e()), delete v.check_token;
2321
2321
  })), v.check_token;
2322
2322
  }
2323
- function fo() {
2323
+ function ho() {
2324
2324
  return v.check_params || (v.check_params = new Promise((t) => {
2325
2325
  d("Auth", "Checking for auth parameters...");
2326
- let e = hr();
2326
+ let e = dr();
2327
2327
  if ((!e || Object.keys(e).length <= 0) && sessionStorage && (e = JSON.parse(
2328
2328
  sessionStorage.getItem("ENGINE.auth.params") || "{}"
2329
2329
  )), e && (e.code || e.access_token || e.refresh_token)) {
@@ -2344,25 +2344,25 @@ function fo() {
2344
2344
  );
2345
2345
  })), v.check_params;
2346
2346
  }
2347
- function ho(t) {
2348
- const e = go();
2347
+ function po(t) {
2348
+ const e = vo();
2349
2349
  t = t ? `${e};${t}` : e;
2350
2350
  const n = g ? (g.auth_uri || "").indexOf("?") >= 0 : !1, r = (g ? g.auth_uri : null) || "/auth/oauth/authorize", i = fn() || g.auth_type === "auth_code" ? "code" : "token";
2351
2351
  let o = `${r}${n ? "&" : "?"}response_type=${encodeURIComponent(i)}&client_id=${encodeURIComponent(w)}&state=${encodeURIComponent(t)}&redirect_uri=${encodeURIComponent(g.redirect_uri)}&scope=${encodeURIComponent(g.scope)}`;
2352
2352
  if (g.auth_type === "auth_code") {
2353
- const { challenge: s, verify: u } = po();
2353
+ const { challenge: s, verify: u } = _o();
2354
2354
  sessionStorage.setItem(`${w}_challenge`, s), o += "&code_challenge_method=S256", o += `&code_challenge=${u}`;
2355
2355
  }
2356
2356
  return o;
2357
2357
  }
2358
2358
  const qn = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split("");
2359
- function po(t = 43) {
2359
+ function _o(t = 43) {
2360
2360
  const e = new Array(t).fill(0).map(
2361
2361
  () => qn[Math.floor(Math.random() * qn.length)]
2362
- ).join(""), n = Mi(Ri(e)), r = lr(qi.hash(n)).split("=")[0].replace(/\//g, "_").replace(/\+/g, "-");
2362
+ ).join(""), n = Ri(Ui(e)), r = fr(Ci.hash(n)).split("=")[0].replace(/\//g, "_").replace(/\+/g, "-");
2363
2363
  return { challenge: e, verify: r };
2364
2364
  }
2365
- function _o() {
2365
+ function mo() {
2366
2366
  let e = (g.token_uri || "/auth/token") + `?client_id=${encodeURIComponent(w)}`, n = "";
2367
2367
  if (e += `&redirect_uri=${encodeURIComponent(g.redirect_uri)}`, nn()) {
2368
2368
  e += `&refresh_token=${encodeURIComponent(nn())}`, e += "&grant_type=refresh_token";
@@ -2375,7 +2375,7 @@ function _o() {
2375
2375
  }
2376
2376
  return [e, n];
2377
2377
  }
2378
- function mo(t) {
2378
+ function yo(t) {
2379
2379
  const e = t.token_uri || "/auth/token", n = z({
2380
2380
  grant_type: "password",
2381
2381
  client_id: w,
@@ -2388,13 +2388,13 @@ function mo(t) {
2388
2388
  });
2389
2389
  return `${e}?${n}`;
2390
2390
  }
2391
- function gr() {
2392
- return vr(..._o());
2391
+ function vr() {
2392
+ return br(...mo());
2393
2393
  }
2394
- function yo(t) {
2395
- return vr(mo(t));
2394
+ function go(t) {
2395
+ return br(yo(t));
2396
2396
  }
2397
- function vr(t, e = "") {
2397
+ function br(t, e = "") {
2398
2398
  return v.generate_tokens || (v.generate_tokens = new Promise((n, r) => {
2399
2399
  d("Auth", "Generating new token...");
2400
2400
  const i = (o) => {
@@ -2414,7 +2414,7 @@ function vr(t, e = "") {
2414
2414
  })), v.generate_tokens;
2415
2415
  }
2416
2416
  function pn(t) {
2417
- const e = zi(
2417
+ const e = Li(
2418
2418
  /* @__PURE__ */ new Date(),
2419
2419
  Math.max(60, parseInt(t.expires_in, 10) - 300)
2420
2420
  );
@@ -2426,13 +2426,13 @@ function pn(t) {
2426
2426
  t.refresh_token
2427
2427
  ), de("refresh_token"))), t.expires_in && (A.setItem(`${w}_expires_at`, `${e.valueOf()}`), de("expires_in")), ce.next(!0), Ee.next(t.access_token || ""), wt.next(t.refresh_token || "");
2428
2428
  }
2429
- function go() {
2430
- const t = Hi();
2429
+ function vo() {
2430
+ const t = Bi();
2431
2431
  return A.setItem(`${w}_nonce`, t), t;
2432
2432
  }
2433
2433
  const Et = {};
2434
2434
  function $s(t, e = Et) {
2435
- vo(t.method, t.path, e);
2435
+ bo(t.method, t.path, e);
2436
2436
  const n = `${t.method}|${t.path}`, r = t.path.replace(/(http|https):\/\/[a-zA-Z0-9.]*:?([0-9]*)?/g, "").replace(/^\//, "").split("/"), i = {
2437
2437
  ...t,
2438
2438
  path_parts: r,
@@ -2442,19 +2442,19 @@ function $s(t, e = Et) {
2442
2442
  };
2443
2443
  e[n] = i, d("HTTP(M)", `+ ${t.method} ${t.path}`);
2444
2444
  }
2445
- function vo(t, e, n = Et) {
2445
+ function bo(t, e, n = Et) {
2446
2446
  const r = `${t}|${e}`;
2447
2447
  n[r] && (delete n[r], d("HTTP(M)", `- ${t} ${e}`));
2448
2448
  }
2449
- function bo(t, e, n, r = Et) {
2450
- const i = So(t, e, r);
2449
+ function So(t, e, n, r = Et) {
2450
+ const i = ko(t, e, r);
2451
2451
  if (i) {
2452
- const o = ko(e, i, n);
2453
- return xo(i, o);
2452
+ const o = xo(e, i, n);
2453
+ return $o(i, o);
2454
2454
  }
2455
2455
  return null;
2456
2456
  }
2457
- function So(t, e, n = Et) {
2457
+ function ko(t, e, n = Et) {
2458
2458
  const i = e.replace(/(http|https)?:\/\/[a-zA-Z0-9.]*:?([0-9]*)?/g, "").replace(/^\//, "").split("?")[0].split("/"), o = Object.keys(
2459
2459
  n
2460
2460
  ).reduce((s, u) => (u.indexOf(`${t}|`) === 0 && s.push(n[u]), s), []);
@@ -2471,7 +2471,7 @@ function So(t, e, n = Et) {
2471
2471
  }
2472
2472
  return null;
2473
2473
  }
2474
- function ko(t, e, n) {
2474
+ function xo(t, e, n) {
2475
2475
  const r = t.replace(/(http|https):\/\/[a-zA-Z0-9.]*:?([0-9]*)?/g, "").split("?"), i = r[0].replace(/^\//g, ""), o = r[1] || "", s = je(o), u = i.split("/"), c = {};
2476
2476
  for (const _ of e.path_structure)
2477
2477
  _ && (c[_] = u[e.path_structure.indexOf(_)]);
@@ -2486,12 +2486,12 @@ function ko(t, e, n) {
2486
2486
  };
2487
2487
  return d("HTTP(M)", `MATCHED ${l.method}:`, l), l;
2488
2488
  }
2489
- function xo(t, e) {
2489
+ function $o(t, e) {
2490
2490
  const n = t.callback ? t.callback(e) : t.metadata, r = t.delay_variance || 100, i = t.delay || 300, o = Math.floor(Math.random() * r - r / 2) + i;
2491
- return d("HTTP(M)", `RESP ${e.method}:`, [e.url, n]), cr([n]).pipe(Ei(Math.max(200, o)));
2491
+ return d("HTTP(M)", `RESP ${e.method}:`, [e.url, n]), ar([n]).pipe(Ii(Math.max(200, o)));
2492
2492
  }
2493
- const br = {};
2494
- function $o(t, e = br) {
2493
+ const Sr = {};
2494
+ function Ao(t, e = Sr) {
2495
2495
  return e[t] || {};
2496
2496
  }
2497
2497
  function ee(t, e, n = Be) {
@@ -2509,7 +2509,7 @@ function It(t, e, n, r = Be) {
2509
2509
  function He(t, e, n = Be) {
2510
2510
  return e || (e = { response_type: "void" }), n("DELETE", t, { response_type: "void", ...e });
2511
2511
  }
2512
- async function Ao(t, e, n = br) {
2512
+ async function wo(t, e, n = Sr) {
2513
2513
  if (t.headers) {
2514
2514
  const r = {};
2515
2515
  t.headers.forEach ? t.headers.forEach((i, o) => r[o.toLowerCase()] = i) : Object.keys(t.headers).forEach(
@@ -2523,21 +2523,21 @@ async function Ao(t, e, n = br) {
2523
2523
  return await t.text();
2524
2524
  }
2525
2525
  }
2526
- const Sr = () => {
2527
- hn(), _r().then(
2526
+ const kr = () => {
2527
+ hn(), mr().then(
2528
2528
  () => null,
2529
- () => setTimeout(() => Sr(), 1e3)
2529
+ () => setTimeout(() => kr(), 1e3)
2530
2530
  );
2531
2531
  };
2532
- function Be(t, e, n, r = ln, i = bo, o = Ao) {
2532
+ function Be(t, e, n, r = ln, i = So, o = wo) {
2533
2533
  if (r()) {
2534
2534
  const s = i(t, e, n?.body);
2535
2535
  if (s)
2536
2536
  return s;
2537
2537
  }
2538
- return n.headers = n.headers || {}, n.headers["Content-Type"] = "application/json", so().pipe(
2539
- Ai((s) => s),
2540
- ar(1),
2538
+ return n.headers = n.headers || {}, n.headers["Content-Type"] = "application/json", uo().pipe(
2539
+ wi((s) => s),
2540
+ lr(1),
2541
2541
  En((s) => (Y() === "x-api-key" ? n.headers["X-API-Key"] = Ot() : n.headers.Authorization = `Bearer ${Y()}`, cn(e, {
2542
2542
  ...n,
2543
2543
  body: JSON.stringify(n.body),
@@ -2545,9 +2545,9 @@ function Be(t, e, n, r = ln, i = bo, o = Ao) {
2545
2545
  credentials: "same-origin"
2546
2546
  }))),
2547
2547
  En((s) => s.ok ? o(s, n.response_type) : On(s)),
2548
- Ti(
2548
+ Mi(
2549
2549
  (s) => s.pipe(
2550
- un((u, c) => u.status === 511 ? (yr(vt()), wn(u)) : c + 1 > 4 || u.status !== 401 ? On(u || {}) : (d("HTTP", "Auth error", u), Sr(), wn(u)))
2550
+ un((u, c) => u.status === 511 ? (gr(vt()), wn(u)) : c + 1 > 4 || u.status !== 401 ? On(u || {}) : (d("HTTP", "Auth error", u), kr(), wn(u)))
2551
2551
  )
2552
2552
  )
2553
2553
  );
@@ -2571,10 +2571,10 @@ class B {
2571
2571
  */
2572
2572
  toJSON() {
2573
2573
  const e = { ...this };
2574
- return e.version = this.version, delete e.created_at, Vi(e, [void 0, null, ""]);
2574
+ return e.version = this.version, delete e.created_at, Qi(e, [void 0, null, ""]);
2575
2575
  }
2576
2576
  }
2577
- class wo extends B {
2577
+ class Oo extends B {
2578
2578
  /** Unique identifier of the application */
2579
2579
  uid;
2580
2580
  /** Secret associated with the application */
@@ -2594,18 +2594,18 @@ class wo extends B {
2594
2594
  }
2595
2595
  }
2596
2596
  function As(t) {
2597
- return kr[t] || 0;
2597
+ return xr[t] || 0;
2598
2598
  }
2599
2599
  function ws(t) {
2600
- return xr[t] || 0;
2600
+ return $r[t] || 0;
2601
2601
  }
2602
- let kr = {}, xr = {}, Cn = "";
2602
+ let xr = {}, $r = {}, Cn = "";
2603
2603
  const Pt = (t) => t;
2604
2604
  function E(t) {
2605
2605
  const { query_params: e, fn: n, path: r, endpoint: i } = t, o = z(e), s = `${i || be()}${r ? "/" + r : ""}${o ? "?" + o : ""}`;
2606
2606
  return ee(s).pipe(
2607
2607
  I((u) => {
2608
- const c = Oo(s, o, r);
2608
+ const c = Eo(s, o, r);
2609
2609
  return {
2610
2610
  total: c.total || 0,
2611
2611
  next: c.next ? () => E({
@@ -2653,8 +2653,8 @@ function T(t) {
2653
2653
  const { id: e, query_params: n, path: r } = t, i = z(n), o = `${be()}/${r}/${e}${i ? "?" + i : ""}`;
2654
2654
  return He(o);
2655
2655
  }
2656
- function Oo(t, e, n) {
2657
- const r = $o(
2656
+ function Eo(t, e, n) {
2657
+ const r = Ao(
2658
2658
  t[0] === "/" ? `${location.origin}${t}` : t
2659
2659
  ), i = {
2660
2660
  total: 0,
@@ -2662,13 +2662,13 @@ function Oo(t, e, n) {
2662
2662
  };
2663
2663
  if (r && r["x-total-count"]) {
2664
2664
  const o = +(r["x-total-count"] || 0);
2665
- (e.length < 2 || e.length < 12 && e.indexOf("offset=") >= 0) && (kr[n] = o), xr[n] = o, i.total = o;
2665
+ (e.length < 2 || e.length < 12 && e.indexOf("offset=") >= 0) && (xr[n] = o), $r[n] = o, i.total = o;
2666
2666
  }
2667
- return r && r.link && (Cn = Bi(r.link || "").next, i.next = je(Cn.split("?")[1])), i;
2667
+ return r && r.link && (Cn = Vi(r.link || "").next, i.next = je(Cn.split("?")[1])), i;
2668
2668
  }
2669
2669
  const Ve = "oauth_apps";
2670
2670
  function Tt(t) {
2671
- return new wo(t);
2671
+ return new Oo(t);
2672
2672
  }
2673
2673
  function Os(t = {}) {
2674
2674
  return E({ query_params: t, fn: Tt, path: Ve });
@@ -2692,8 +2692,8 @@ function Ps(t) {
2692
2692
  function Ts(t, e = {}) {
2693
2693
  return T({ id: t, query_params: e, path: Ve });
2694
2694
  }
2695
- var Eo = /* @__PURE__ */ ((t) => (t[t.Certificate = 0] = "Certificate", t[t.NoAuth = 1] = "NoAuth", t[t.UserPassword = 2] = "UserPassword", t))(Eo || {});
2696
- class Io extends B {
2695
+ var Io = /* @__PURE__ */ ((t) => (t[t.Certificate = 0] = "Certificate", t[t.NoAuth = 1] = "NoAuth", t[t.UserPassword = 2] = "UserPassword", t))(Io || {});
2696
+ class Po extends B {
2697
2697
  /** Unique identifier for the Broker */
2698
2698
  id;
2699
2699
  /** Name of the Broker */
@@ -2724,7 +2724,7 @@ class Io extends B {
2724
2724
  }
2725
2725
  const Qe = "brokers";
2726
2726
  function Mt(t) {
2727
- return new Io(t);
2727
+ return new Po(t);
2728
2728
  }
2729
2729
  function Ms(t = {}) {
2730
2730
  return E({ query_params: t, fn: Mt, path: Qe });
@@ -2748,7 +2748,7 @@ function Ds(t) {
2748
2748
  function qs(t, e = {}) {
2749
2749
  return T({ id: t, query_params: e, path: Qe });
2750
2750
  }
2751
- class Po {
2751
+ class To {
2752
2752
  /** Unique identifier of the application */
2753
2753
  id;
2754
2754
  /** List of running drivers */
@@ -2796,7 +2796,7 @@ class Po {
2796
2796
  })) || [];
2797
2797
  }
2798
2798
  }
2799
- class To {
2799
+ class Mo {
2800
2800
  /** ID of the cluster associated with the process */
2801
2801
  cluster_id;
2802
2802
  /** Unique identifier of the application */
@@ -2828,18 +2828,18 @@ class To {
2828
2828
  }
2829
2829
  }
2830
2830
  const _n = "cluster";
2831
- function Mo(t) {
2832
- return new Po(t);
2831
+ function Ro(t) {
2832
+ return new To(t);
2833
2833
  }
2834
2834
  function Cs(t = {}) {
2835
- return E({ query_params: t, fn: Mo, path: _n });
2835
+ return E({ query_params: t, fn: Ro, path: _n });
2836
2836
  }
2837
2837
  function Ns(t, e = {}) {
2838
2838
  return $({
2839
2839
  id: t,
2840
2840
  query_params: e,
2841
2841
  fn: (n) => n.map(
2842
- (r) => new To(t, r)
2842
+ (r) => new Mo(t, r)
2843
2843
  ),
2844
2844
  path: _n
2845
2845
  });
@@ -2847,7 +2847,7 @@ function Ns(t, e = {}) {
2847
2847
  function js(t, e) {
2848
2848
  return T({ id: t, query_params: { driver: e }, path: _n });
2849
2849
  }
2850
- class Ro extends B {
2850
+ class Uo extends B {
2851
2851
  /** Domain name */
2852
2852
  domain;
2853
2853
  /** Login URL for the domain */
@@ -2868,7 +2868,7 @@ class Ro extends B {
2868
2868
  }
2869
2869
  const Ye = "domains";
2870
2870
  function Rt(t) {
2871
- return new Ro(t);
2871
+ return new Uo(t);
2872
2872
  }
2873
2873
  function Fs(t = {}) {
2874
2874
  return E({ query_params: t, fn: Rt, path: Ye });
@@ -2915,7 +2915,7 @@ class Se extends B {
2915
2915
  }
2916
2916
  }
2917
2917
  var St = /* @__PURE__ */ ((t) => (t[t.SSH = 0] = "SSH", t[t.Device = 1] = "Device", t[t.Service = 2] = "Service", t[t.Websocket = 3] = "Websocket", t[t.Logic = 99] = "Logic", t))(St || {});
2918
- class $r extends B {
2918
+ class Ar extends B {
2919
2919
  /** Place class name of the driver */
2920
2920
  class_name;
2921
2921
  /** Description of the driver functionality */
@@ -2952,7 +2952,7 @@ class $r extends B {
2952
2952
  }
2953
2953
  const fe = "drivers";
2954
2954
  function Ut(t) {
2955
- return new $r(t);
2955
+ return new Ar(t);
2956
2956
  }
2957
2957
  function Bs(t = {}) {
2958
2958
  return E({ query_params: t, fn: Ut, path: fe });
@@ -2985,7 +2985,7 @@ function Zs(t) {
2985
2985
  function Gs(t) {
2986
2986
  return m({ id: t, task_name: "compiled", method: "get", path: fe });
2987
2987
  }
2988
- class Uo extends B {
2988
+ class Do extends B {
2989
2989
  description;
2990
2990
  secret;
2991
2991
  x_api_key;
@@ -3001,7 +3001,7 @@ class Uo extends B {
3001
3001
  }
3002
3002
  const Te = "edges";
3003
3003
  function Dt(t) {
3004
- return new Uo(t);
3004
+ return new Do(t);
3005
3005
  }
3006
3006
  function Xs(t = {}) {
3007
3007
  return E({ query_params: t, fn: Dt, path: Te });
@@ -3034,7 +3034,7 @@ function iu(t, e = {}) {
3034
3034
  path: Te
3035
3035
  });
3036
3036
  }
3037
- class Do extends B {
3037
+ class qo extends B {
3038
3038
  /** Type of auth source */
3039
3039
  type = "ldap";
3040
3040
  /** ID of the authority associted with the auth method */
@@ -3064,7 +3064,7 @@ class Do extends B {
3064
3064
  }
3065
3065
  const Je = "ldap_auths";
3066
3066
  function qt(t) {
3067
- return new Do(t);
3067
+ return new qo(t);
3068
3068
  }
3069
3069
  function ou(t = {}) {
3070
3070
  return E({ query_params: t, fn: qt, path: Je });
@@ -3088,7 +3088,7 @@ function cu(t) {
3088
3088
  function au(t, e = {}) {
3089
3089
  return T({ id: t, query_params: e, path: Je });
3090
3090
  }
3091
- class Ar {
3091
+ class wr {
3092
3092
  /** ID of the parent resource associated with the metadata */
3093
3093
  id;
3094
3094
  /** Name/ID of the zone metadata */
@@ -3231,7 +3231,7 @@ class mn extends B {
3231
3231
  ));
3232
3232
  }
3233
3233
  }
3234
- class qo {
3234
+ class Co {
3235
3235
  /** Zone associated with the metadata */
3236
3236
  zone;
3237
3237
  /** Metadata for zone */
@@ -3242,12 +3242,12 @@ class qo {
3242
3242
  this.zone = new mn(e.zone), this.keys = e.keys || [], this.metadata = {};
3243
3243
  const n = e.metadata || {};
3244
3244
  for (const r of this.keys)
3245
- this.metadata[r] = new Ar(n[r]);
3245
+ this.metadata[r] = new wr(n[r]);
3246
3246
  }
3247
3247
  }
3248
3248
  const ke = "metadata";
3249
3249
  function Ke(t) {
3250
- return new Ar(t);
3250
+ return new wr(t);
3251
3251
  }
3252
3252
  function lu(t, e = {}) {
3253
3253
  return $({
@@ -3257,7 +3257,7 @@ function lu(t, e = {}) {
3257
3257
  path: ke
3258
3258
  });
3259
3259
  }
3260
- function Co(t) {
3260
+ function No(t) {
3261
3261
  const e = [...t], n = [];
3262
3262
  for (; e.length; ) {
3263
3263
  const r = e.pop();
@@ -3271,7 +3271,7 @@ function fu(t, e = {}) {
3271
3271
  task_name: "history",
3272
3272
  form_data: e,
3273
3273
  method: "get",
3274
- callback: (n) => Co(
3274
+ callback: (n) => No(
3275
3275
  Object.keys(n).map(
3276
3276
  (r) => n[r].map((i) => Ke(i))
3277
3277
  )
@@ -3310,7 +3310,7 @@ function mu(t, e) {
3310
3310
  form_data: e,
3311
3311
  method: "get",
3312
3312
  callback: (n) => n.map(
3313
- (r) => new qo({
3313
+ (r) => new Co({
3314
3314
  ...r,
3315
3315
  keys: Object.keys(r.metadata)
3316
3316
  })
@@ -3318,7 +3318,7 @@ function mu(t, e) {
3318
3318
  path: ke
3319
3319
  });
3320
3320
  }
3321
- class wr extends B {
3321
+ class Or extends B {
3322
3322
  /** Tuple of user settings of differring encryption levels for the system */
3323
3323
  settings = [null, null, null, null];
3324
3324
  /** Display name of the system */
@@ -3371,11 +3371,11 @@ class wr extends B {
3371
3371
  encryption_level: +n
3372
3372
  }));
3373
3373
  e.module_data && e.module_data instanceof Array && (this.module_list = e.module_data.map(
3374
- (n) => new Or(n)
3374
+ (n) => new Er(n)
3375
3375
  ));
3376
3376
  }
3377
3377
  }
3378
- class Or extends B {
3378
+ class Er extends B {
3379
3379
  /** Whether the associated hardware is connected */
3380
3380
  connected;
3381
3381
  /** Whether the module driver is running */
@@ -3423,9 +3423,9 @@ class Or extends B {
3423
3423
  return this.control_system_id;
3424
3424
  }
3425
3425
  constructor(e = {}) {
3426
- super(e), this.driver_id = e.driver_id || e.dependency_id || "", this.control_system_id = e.control_system_id || "", this.edge_id = e.edge_id || "", this.ip = e.ip || "", this.tls = e.tls || !1, this.udp = e.udp || !1, this.port = e.port || 1, this.makebreak = e.makebreak || !1, this.uri = e.uri || "", this.custom_name = e.custom_name || "", this.role = e.role ?? St.Logic, this.notes = e.notes || "", this.ignore_connected = e.ignore_connected || !1, this.connected = e.connected, this.running = e.running || !1, this.updated_at = e.updated_at || 0, this.system = new wr(
3426
+ super(e), this.driver_id = e.driver_id || e.dependency_id || "", this.control_system_id = e.control_system_id || "", this.edge_id = e.edge_id || "", this.ip = e.ip || "", this.tls = e.tls || !1, this.udp = e.udp || !1, this.port = e.port || 1, this.makebreak = e.makebreak || !1, this.uri = e.uri || "", this.custom_name = e.custom_name || "", this.role = e.role ?? St.Logic, this.notes = e.notes || "", this.ignore_connected = e.ignore_connected || !1, this.connected = e.connected, this.running = e.running || !1, this.updated_at = e.updated_at || 0, this.system = new Or(
3427
3427
  e.control_system || e.system
3428
- ), this.has_runtime_error = e.has_runtime_error || !1, this.error_timestamp = e.error_timestamp || 0, this.driver = new $r(e.dependency || e.driver), this.settings = e.settings || [null, null, null, null], typeof this.settings != "object" && (this.settings = [null, null, null, null]);
3428
+ ), this.has_runtime_error = e.has_runtime_error || !1, this.error_timestamp = e.error_timestamp || 0, this.driver = new Ar(e.dependency || e.driver), this.settings = e.settings || [null, null, null, null], typeof this.settings != "object" && (this.settings = [null, null, null, null]);
3429
3429
  for (const n in Pe)
3430
3430
  !isNaN(Number(n)) && !this.settings[n] && (this.settings[n] = new Se({
3431
3431
  parent_id: this.id,
@@ -3442,7 +3442,7 @@ class Or extends B {
3442
3442
  }
3443
3443
  const K = "modules";
3444
3444
  function Ct(t) {
3445
- return new Or(t);
3445
+ return new Er(t);
3446
3446
  }
3447
3447
  function yu(t = {}) {
3448
3448
  return E({ query_params: t, fn: Ct, path: K });
@@ -3498,7 +3498,7 @@ function Eu(t) {
3498
3498
  path: K
3499
3499
  });
3500
3500
  }
3501
- class No extends B {
3501
+ class jo extends B {
3502
3502
  /** Type of auth source */
3503
3503
  type = "oauth";
3504
3504
  /** ID of the authority associted with the auth method */
@@ -3533,7 +3533,7 @@ class No extends B {
3533
3533
  }
3534
3534
  const Ze = "oauth_auths";
3535
3535
  function Nt(t) {
3536
- return new No(t);
3536
+ return new jo(t);
3537
3537
  }
3538
3538
  function Iu(t = {}) {
3539
3539
  return E({ query_params: t, fn: Nt, path: Ze });
@@ -3557,8 +3557,8 @@ function Mu(t) {
3557
3557
  function Ru(t, e = {}) {
3558
3558
  return T({ id: t, query_params: e, path: Ze });
3559
3559
  }
3560
- var Er = /* @__PURE__ */ ((t) => (t.Driver = "driver", t.Interface = "interface", t))(Er || {});
3561
- class jo extends B {
3560
+ var Ir = /* @__PURE__ */ ((t) => (t.Driver = "driver", t.Interface = "interface", t))(Ir || {});
3561
+ class Fo extends B {
3562
3562
  /** Name of the folder on the server to pull the repository */
3563
3563
  folder_name;
3564
3564
  /** Description of the contents of the repository */
@@ -3580,12 +3580,12 @@ class jo extends B {
3580
3580
  return this.repo_type;
3581
3581
  }
3582
3582
  constructor(e = {}) {
3583
- super(e), this.folder_name = e.folder_name || "", this.description = e.description || "", this.uri = e.uri || "", this.branch = e.branch || "", this.commit_hash = e.commit_hash || "", this.repo_type = e.repo_type || Er.Driver, this.username = e.username || "", this.password = e.password || "";
3583
+ super(e), this.folder_name = e.folder_name || "", this.description = e.description || "", this.uri = e.uri || "", this.branch = e.branch || "", this.commit_hash = e.commit_hash || "", this.repo_type = e.repo_type || Ir.Driver, this.username = e.username || "", this.password = e.password || "";
3584
3584
  }
3585
3585
  }
3586
3586
  const V = "repositories";
3587
3587
  function jt(t) {
3588
- return new jo(t);
3588
+ return new Fo(t);
3589
3589
  }
3590
3590
  function Uu(t = {}) {
3591
3591
  return E({ query_params: t, fn: jt, path: V });
@@ -3689,7 +3689,7 @@ function Yu(t, e) {
3689
3689
  path: V
3690
3690
  });
3691
3691
  }
3692
- class Fo extends B {
3692
+ class zo extends B {
3693
3693
  /** Type of auth source */
3694
3694
  type = "saml";
3695
3695
  /** ID of the authority associted with the auth method */
@@ -3729,7 +3729,7 @@ class Fo extends B {
3729
3729
  }
3730
3730
  const Ge = "saml_auths";
3731
3731
  function Ft(t) {
3732
- return new Fo(t);
3732
+ return new zo(t);
3733
3733
  }
3734
3734
  function Ju(t = {}) {
3735
3735
  return E({ query_params: t, fn: Ft, path: Ge });
@@ -3791,7 +3791,7 @@ function oc(t, e = {}) {
3791
3791
  }
3792
3792
  const M = "systems";
3793
3793
  function xe(t) {
3794
- return new wr(t);
3794
+ return new Or(t);
3795
3795
  }
3796
3796
  function sc(t = {}) {
3797
3797
  return E({ query_params: t, fn: xe, path: M });
@@ -3962,8 +3962,8 @@ function Pc(t) {
3962
3962
  path: Ue
3963
3963
  });
3964
3964
  }
3965
- var zo = /* @__PURE__ */ ((t) => (t.EQ = "equal", t.NEQ = "not_equal", t.GT = "greater_than", t.GTE = "greater_than_or_equal", t.LT = "less_than", t.LTE = "less_than_or_equal", t.AND = "and", t.OR = "or", t.XOR = "exclusive_or", t))(zo || {}), Lo = /* @__PURE__ */ ((t) => (t.AT = "at", t.CRON = "cron", t))(Lo || {}), Wo = /* @__PURE__ */ ((t) => (t[t.ExecuteBefore = 0] = "ExecuteBefore", t[t.ExecuteAfter = 1] = "ExecuteAfter", t[t.PayloadOnly = 2] = "PayloadOnly", t[t.IgnorePayload = 3] = "IgnorePayload", t))(Wo || {});
3966
- class Ho extends B {
3965
+ var Lo = /* @__PURE__ */ ((t) => (t.EQ = "equal", t.NEQ = "not_equal", t.GT = "greater_than", t.GTE = "greater_than_or_equal", t.LT = "less_than", t.LTE = "less_than_or_equal", t.AND = "and", t.OR = "or", t.XOR = "exclusive_or", t))(Lo || {}), Wo = /* @__PURE__ */ ((t) => (t.AT = "at", t.CRON = "cron", t))(Wo || {}), Ho = /* @__PURE__ */ ((t) => (t[t.ExecuteBefore = 0] = "ExecuteBefore", t[t.ExecuteAfter = 1] = "ExecuteAfter", t[t.PayloadOnly = 2] = "PayloadOnly", t[t.IgnorePayload = 3] = "IgnorePayload", t))(Ho || {});
3966
+ class Bo extends B {
3967
3967
  /** Hash of the email address of the user */
3968
3968
  email_digest;
3969
3969
  /** ID of the authority associated with the user */
@@ -4018,7 +4018,7 @@ class Ho extends B {
4018
4018
  }
4019
4019
  const De = "users";
4020
4020
  function et(t) {
4021
- return new Ho(t);
4021
+ return new Bo(t);
4022
4022
  }
4023
4023
  function Tc(t = {}) {
4024
4024
  return E({ query_params: t, fn: et, path: De });
@@ -4096,8 +4096,8 @@ function Hc(t, e, n, r = 1, i = []) {
4096
4096
  path: he
4097
4097
  });
4098
4098
  }
4099
- var Ir = /* @__PURE__ */ ((t) => (t[t.Default = 0] = "Default", t[t.Cut = 1] = "Cut", t[t.CrossFade = 2] = "CrossFade", t[t.SlideTop = 3] = "SlideTop", t[t.SlideLeft = 4] = "SlideLeft", t[t.SlideRight = 5] = "SlideRight", t[t.SlideBottom = 6] = "SlideBottom", t))(Ir || {});
4100
- class Bo {
4099
+ var Pr = /* @__PURE__ */ ((t) => (t[t.Default = 0] = "Default", t[t.Cut = 1] = "Cut", t[t.CrossFade = 2] = "CrossFade", t[t.SlideTop = 3] = "SlideTop", t[t.SlideLeft = 4] = "SlideLeft", t[t.SlideRight = 5] = "SlideRight", t[t.SlideBottom = 6] = "SlideBottom", t))(Pr || {});
4100
+ class Vo {
4101
4101
  id;
4102
4102
  created_at;
4103
4103
  updated_at;
@@ -4143,7 +4143,7 @@ class yn {
4143
4143
  this.id = e.id || "", this.playlist_id = e.playlist_id || "", this.created_at = e.created_at || 0, this.updated_at = e.updated_at || 0, this.items = e.items || [], this.approved = !!e.approved, this.approved_by_id = e.approved_by_id || "", this.approved_by_email = e.approved_by_email || "", this.approved_by_name = e.approved_by_name || "", this.user_id = e.user_id || "", this.user_name = e.user_name || "", this.user_email = e.user_email || "";
4144
4144
  }
4145
4145
  }
4146
- class Vo {
4146
+ class Qo {
4147
4147
  id;
4148
4148
  created_at;
4149
4149
  updated_at;
@@ -4163,12 +4163,12 @@ class Vo {
4163
4163
  valid_from;
4164
4164
  valid_until;
4165
4165
  constructor(e) {
4166
- this.id = e.id || "", this.created_at = e.created_at || 0, this.updated_at = e.updated_at || 0, this.name = e.name || "", this.description = e.description || "", this.authority_id = e.authority_id || "", this.orientation = e.orientation || "", this.play_count = e.play_count || 0, this.play_through_count = e.play_through_count || 0, this.default_animation = e.default_animation || Ir.Cut, this.random = e.random || !1, this.enabled = e.enabled ?? !0, this.default_duration = e.default_duration ?? 15 * 1e3, this.valid_from = e.valid_from, this.valid_until = e.valid_until, this.play_hours = e.play_hours || "", this.play_at = e.play_at || "", this.play_cron = e.play_cron || "";
4166
+ this.id = e.id || "", this.created_at = e.created_at || 0, this.updated_at = e.updated_at || 0, this.name = e.name || "", this.description = e.description || "", this.authority_id = e.authority_id || "", this.orientation = e.orientation || "", this.play_count = e.play_count || 0, this.play_through_count = e.play_through_count || 0, this.default_animation = e.default_animation || Pr.Cut, this.random = e.random || !1, this.enabled = e.enabled ?? !0, this.default_duration = e.default_duration ?? 15 * 1e3, this.valid_from = e.valid_from, this.valid_until = e.valid_until, this.play_hours = e.play_hours || "", this.play_at = e.play_at || "", this.play_cron = e.play_cron || "";
4167
4167
  }
4168
4168
  }
4169
- const Pr = "signage";
4169
+ const Tr = "signage";
4170
4170
  function Bc(t, e = {}, n) {
4171
- return $({ id: t, query_params: e, fn: (r) => r, path: `${Pr}`, options: n });
4171
+ return $({ id: t, query_params: e, fn: (r) => r, path: `${Tr}`, options: n });
4172
4172
  }
4173
4173
  function Vc(t) {
4174
4174
  return m({
@@ -4177,12 +4177,12 @@ function Vc(t) {
4177
4177
  form_data: {},
4178
4178
  method: "post",
4179
4179
  callback: (e) => e,
4180
- path: Pr
4180
+ path: Tr
4181
4181
  });
4182
4182
  }
4183
4183
  const tt = "signage/media";
4184
4184
  function Wt(t) {
4185
- return new Bo(t);
4185
+ return new Vo(t);
4186
4186
  }
4187
4187
  function Qc(t = {}) {
4188
4188
  return E({ query_params: t, fn: Wt, path: tt });
@@ -4213,7 +4213,7 @@ function Zc(t, e = {}) {
4213
4213
  }
4214
4214
  const oe = "signage/playlists";
4215
4215
  function Ht(t) {
4216
- return new Vo(t);
4216
+ return new Qo(t);
4217
4217
  }
4218
4218
  function Gc(t = {}) {
4219
4219
  return E({ query_params: t, fn: Ht, path: oe });
@@ -4287,7 +4287,7 @@ function sa(t, e) {
4287
4287
  callback: (n) => new yn(n)
4288
4288
  });
4289
4289
  }
4290
- class Tr {
4290
+ class Mr {
4291
4291
  id;
4292
4292
  question_id;
4293
4293
  survey_id;
@@ -4297,16 +4297,16 @@ class Tr {
4297
4297
  this.id = e.id || 0, this.question_id = e.question_id || 0, this.survey_id = e.survey_id || 0, this.type = e.type || "", this.answer_json = e.answer_json || {};
4298
4298
  }
4299
4299
  }
4300
- const Mr = "/api/staff/v1/surveys/answers";
4300
+ const Rr = "/api/staff/v1/surveys/answers";
4301
4301
  function ua(t = {}) {
4302
4302
  const e = z(t);
4303
- return ee(`${Mr}${e ? "?" + e : ""}`).pipe(
4304
- I((n) => n.map((r) => new Tr(r)))
4303
+ return ee(`${Rr}${e ? "?" + e : ""}`).pipe(
4304
+ I((n) => n.map((r) => new Mr(r)))
4305
4305
  );
4306
4306
  }
4307
4307
  function ca(t) {
4308
- return Ie(`${Mr}`, t).pipe(
4309
- I((e) => e.map((n) => new Tr(n)))
4308
+ return Ie(`${Rr}`, t).pipe(
4309
+ I((e) => e.map((n) => new Mr(n)))
4310
4310
  );
4311
4311
  }
4312
4312
  class Bt {
@@ -4425,7 +4425,7 @@ function xa(t, e = {}) {
4425
4425
  const n = z(e);
4426
4426
  return He(`${it}/${t}${n ? "?" + n : ""}`);
4427
4427
  }
4428
- var Qo = {
4428
+ var Yo = {
4429
4429
  url: "",
4430
4430
  deserializer: function(t) {
4431
4431
  return JSON.parse(t.data);
@@ -4433,14 +4433,14 @@ var Qo = {
4433
4433
  serializer: function(t) {
4434
4434
  return JSON.stringify(t);
4435
4435
  }
4436
- }, Yo = "WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }", Jo = function(t) {
4436
+ }, Jo = "WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }", Ko = function(t) {
4437
4437
  Z(e, t);
4438
4438
  function e(n, r) {
4439
4439
  var i = t.call(this) || this;
4440
4440
  if (i._socket = null, n instanceof q)
4441
4441
  i.destination = r, i.source = n;
4442
4442
  else {
4443
- var o = i._config = ze({}, Qo);
4443
+ var o = i._config = ze({}, Yo);
4444
4444
  if (i._output = new ae(), typeof n == "string")
4445
4445
  o.url = n;
4446
4446
  else
@@ -4521,7 +4521,7 @@ var Qo = {
4521
4521
  }
4522
4522
  }, function(f) {
4523
4523
  var S = n._config.closingObserver;
4524
- S && S.next(void 0), f && f.code ? l.close(f.code, f.reason) : c.error(new TypeError(Yo)), n._resetState();
4524
+ S && S.next(void 0), f && f.code ? l.close(f.code, f.reason) : c.error(new TypeError(Jo)), n._resetState();
4525
4525
  }, function() {
4526
4526
  var f = n._config.closingObserver;
4527
4527
  f && f.next(void 0), l.close(), n._resetState();
@@ -4551,11 +4551,11 @@ var Qo = {
4551
4551
  n && (n.readyState === 1 || n.readyState === 0) && n.close(), this._resetState(), t.prototype.unsubscribe.call(this);
4552
4552
  }, e;
4553
4553
  }(tn);
4554
- function Ko(t) {
4555
- return new Jo(t);
4554
+ function Zo(t) {
4555
+ return new Ko(t);
4556
4556
  }
4557
- var X = /* @__PURE__ */ ((t) => (t[t.PARSE_ERROR = 0] = "PARSE_ERROR", t[t.BAD_REQUEST = 1] = "BAD_REQUEST", t[t.ACCESS_DENIED = 2] = "ACCESS_DENIED", t[t.REQUEST_FAILED = 3] = "REQUEST_FAILED", t[t.UNKNOWN_CMD = 4] = "UNKNOWN_CMD", t[t.SYS_NOT_FOUND = 5] = "SYS_NOT_FOUND", t[t.MOD_NOT_FOUND = 6] = "MOD_NOT_FOUND", t[t.UNEXPECTED_FAILURE = 7] = "UNEXPECTED_FAILURE", t))(X || {}), Rr = /* @__PURE__ */ ((t) => (t.Info = "info", t.Debug = "debug", t.Warning = "warn", t.Error = "error", t.Fatal = "fatal", t.Trace = "trace", t))(Rr || {});
4558
- class Zo {
4557
+ var X = /* @__PURE__ */ ((t) => (t[t.PARSE_ERROR = 0] = "PARSE_ERROR", t[t.BAD_REQUEST = 1] = "BAD_REQUEST", t[t.ACCESS_DENIED = 2] = "ACCESS_DENIED", t[t.REQUEST_FAILED = 3] = "REQUEST_FAILED", t[t.UNKNOWN_CMD = 4] = "UNKNOWN_CMD", t[t.SYS_NOT_FOUND = 5] = "SYS_NOT_FOUND", t[t.MOD_NOT_FOUND = 6] = "MOD_NOT_FOUND", t[t.UNEXPECTED_FAILURE = 7] = "UNEXPECTED_FAILURE", t))(X || {}), Ur = /* @__PURE__ */ ((t) => (t.Info = "info", t.Debug = "debug", t.Warning = "warn", t.Error = "error", t.Fatal = "fatal", t.Trace = "trace", t))(Ur || {});
4558
+ class Go {
4559
4559
  constructor(e, n) {
4560
4560
  this._system = e;
4561
4561
  const r = Object.getOwnPropertyNames(
@@ -4602,7 +4602,7 @@ class Zo {
4602
4602
  });
4603
4603
  }
4604
4604
  }
4605
- class Go {
4605
+ class Xo {
4606
4606
  constructor(e) {
4607
4607
  for (const n in e)
4608
4608
  e.hasOwnProperty(n) && e[n] && e[n] instanceof Array && e[n].forEach((r) => {
@@ -4615,45 +4615,45 @@ class Go {
4615
4615
  * @param properties Properties of the new module
4616
4616
  */
4617
4617
  addModule(e, n) {
4618
- this[e] || (this[e] = []), this[e].push(new Zo(this, n));
4618
+ this[e] || (this[e] = []), this[e].push(new Go(this, n));
4619
4619
  }
4620
4620
  }
4621
4621
  const kt = {};
4622
4622
  function $a(t, e) {
4623
- return kt[t] = new Go(e), kt[t];
4623
+ return kt[t] = new Xo(e), kt[t];
4624
4624
  }
4625
- function Xo(t) {
4625
+ function es(t) {
4626
4626
  return kt[t];
4627
4627
  }
4628
4628
  function Aa(t) {
4629
4629
  delete kt[t];
4630
4630
  }
4631
- const Ur = 15;
4632
- let ot = 0, Q, Dr = 0;
4633
- const L = {}, gn = {}, $e = {}, es = {}, pe = new le(!1);
4631
+ const Dr = 15;
4632
+ let ot = 0, Q, qr = 0;
4633
+ const L = {}, gn = {}, $e = {}, ts = {}, pe = new le(!1);
4634
4634
  $e._place_os_status = pe.asObservable();
4635
- const qr = new le([0, 0]);
4636
- $e._place_os_sync = qr.asObservable();
4637
- let Cr = Date.now(), we, xt = 0, se = null, ht, vn = 0;
4638
- const st = 10 * 1e3, Nr = new ae();
4639
- $e._place_os_debug_events = Nr.asObservable();
4635
+ const Cr = new le([0, 0]);
4636
+ $e._place_os_sync = Cr.asObservable();
4637
+ let Nr = Date.now(), we, xt = 0, se = null, ht, vn = 0;
4638
+ const st = 10 * 1e3, jr = new ae();
4639
+ $e._place_os_debug_events = jr.asObservable();
4640
4640
  function Kt() {
4641
- return be().indexOf("/control/") >= 0 ? "/control/websocket" : `${dr()}/systems/control`;
4641
+ return be().indexOf("/control/") >= 0 ? "/control/websocket" : `${pr()}/systems/control`;
4642
4642
  }
4643
- function jr() {
4643
+ function Fr() {
4644
4644
  return pe.getValue();
4645
4645
  }
4646
- function ts() {
4646
+ function ns() {
4647
4647
  return $e._place_os_status;
4648
4648
  }
4649
4649
  function wa() {
4650
4650
  return $e._place_os_status;
4651
4651
  }
4652
- function ns(t, e = gn, n = $e) {
4652
+ function rs(t, e = gn, n = $e) {
4653
4653
  const r = `${t.sys}|${t.mod}_${t.index}|${t.name}`;
4654
4654
  return e[r] || (e[r] = new le(void 0), n[r] = e[r].asObservable()), n[r];
4655
4655
  }
4656
- function rs(t, e = gn) {
4656
+ function is(t, e = gn) {
4657
4657
  const n = `${t.sys}|${t.mod}_${t.index}|${t.name}`;
4658
4658
  if (e[n])
4659
4659
  return e[n].getValue();
@@ -4666,7 +4666,7 @@ function Nn(t, e = 0, n = qe) {
4666
4666
  };
4667
4667
  return n(r, e);
4668
4668
  }
4669
- function is(t, e = 0, n = qe) {
4669
+ function os(t, e = 0, n = qe) {
4670
4670
  const r = {
4671
4671
  id: ++ot,
4672
4672
  cmd: "unbind",
@@ -4674,7 +4674,7 @@ function is(t, e = 0, n = qe) {
4674
4674
  };
4675
4675
  return n(r, e);
4676
4676
  }
4677
- function os(t, e = st, n = qe) {
4677
+ function ss(t, e = st, n = qe) {
4678
4678
  const r = {
4679
4679
  id: ++ot,
4680
4680
  cmd: "exec",
@@ -4699,7 +4699,7 @@ function Ea(t, e = st, n = qe) {
4699
4699
  return n(r, e);
4700
4700
  }
4701
4701
  function qe(t, e = st, n = 0) {
4702
- const r = `${t.cmd}|${t.sys}|${t.mod}${t.index}|${t.name}|${t.args}|${Ji()}`;
4702
+ const r = `${t.cmd}|${t.sys}|${t.mod}${t.index}|${t.name}|${t.args}|${Ki()}`;
4703
4703
  if (L[r])
4704
4704
  d("WS", "Request already in progress. Waiting...", t);
4705
4705
  else {
@@ -4711,8 +4711,8 @@ function qe(t, e = st, n = 0) {
4711
4711
  (c) => s(c)
4712
4712
  );
4713
4713
  };
4714
- if (Q && jr()) {
4715
- ln() && hs(t, Q, es), i.resolve = o, i.reject = s;
4714
+ if (Q && Fr()) {
4715
+ ln() && ds(t, Q, ts), i.resolve = o, i.reject = s;
4716
4716
  const c = `${t.sys}, ${t.mod}_${t.index}, ${t.name}`;
4717
4717
  d(
4718
4718
  "WS",
@@ -4730,12 +4730,12 @@ function qe(t, e = st, n = 0) {
4730
4730
  }
4731
4731
  return L[r].promise;
4732
4732
  }
4733
- function Fr(t) {
4733
+ function zr(t) {
4734
4734
  if (t !== "pong" && t instanceof Object) {
4735
4735
  if (t.type === "notify" && t.meta)
4736
- cs(t.meta, t.value);
4736
+ as(t.meta, t.value);
4737
4737
  else if (t.type === "success")
4738
- ss(t);
4738
+ us(t);
4739
4739
  else if (t.type === "debug") {
4740
4740
  d(
4741
4741
  "WS",
@@ -4743,23 +4743,23 @@ function Fr(t) {
4743
4743
  t.msg
4744
4744
  );
4745
4745
  const e = t.meta || { mod: "", index: "" };
4746
- Nr.next({
4746
+ jr.next({
4747
4747
  mod_id: t.mod || "<empty>",
4748
4748
  module: `${e.mod}_${e.index}`,
4749
4749
  class_name: t.klass || "<empty>",
4750
4750
  message: t.msg || "<empty>",
4751
- level: t.level || Rr.Debug,
4751
+ level: t.level || Ur.Debug,
4752
4752
  time: Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3)
4753
4753
  });
4754
- } else t.type === "error" ? us(t) : t.cmd || d("WS", "Invalid websocket message", t, "error");
4754
+ } else t.type === "error" ? cs(t) : t.cmd || d("WS", "Invalid websocket message", t, "error");
4755
4755
  ve(`${t.id}`);
4756
4756
  } else t === "pong" && (vn = Date.now(), d("WS", "Pong!"));
4757
4757
  }
4758
- function ss(t) {
4758
+ function us(t) {
4759
4759
  const e = Object.keys(L).map((n) => L[n]).find((n) => n?.id === t.id);
4760
4760
  d("WS", `[SUCCESS](${t.id})`), e && e.resolve && (e.resolve(t.value), delete L[e.key]);
4761
4761
  }
4762
- function us(t) {
4762
+ function cs(t) {
4763
4763
  let e = "UNEXPECTED FAILURE";
4764
4764
  switch (t.code) {
4765
4765
  case X.ACCESS_DENIED:
@@ -4793,7 +4793,7 @@ function us(t) {
4793
4793
  const n = Object.keys(L).map((r) => L[r]).filter((r) => r).find((r) => r.id === t.id);
4794
4794
  n && n.reject && (n.reject(t), ve(`${n.key}`), delete L[n.key]);
4795
4795
  }
4796
- function cs(t, e, n = gn, r = $e) {
4796
+ function as(t, e, n = gn, r = $e) {
4797
4797
  const i = `${t.sys}|${t.mod}_${t.index}|${t.name}`;
4798
4798
  n[i] || (n[i] = new le(null), r[i] = n[i].asObservable());
4799
4799
  const o = `${t.sys}, ${t.mod}_${t.index}, ${t.name}`;
@@ -4807,20 +4807,20 @@ function bn(t = 0) {
4807
4807
  return se == null && (se = new Promise((e) => {
4808
4808
  if (t > 40)
4809
4809
  return location.reload();
4810
- xt++, Cr = Date.now(), Q = ln() ? fs() : as(), Q ? (d("WS(Debug)", "Authority:", [vt()]), d("WS", "Connecting to websocket..."), Q.subscribe(
4810
+ xt++, Nr = Date.now(), Q = ln() ? hs() : ls(), Q ? (d("WS(Debug)", "Authority:", [vt()]), d("WS", "Connecting to websocket..."), Q.subscribe(
4811
4811
  (n) => {
4812
- pe.getValue() || (d("WS", "Connection established."), e()), pe.next(!0), xt = 0, Zt(), Fr(n);
4812
+ pe.getValue() || (d("WS", "Connection established."), e()), pe.next(!0), xt = 0, Zt(), zr(n);
4813
4813
  },
4814
4814
  (n) => {
4815
- Q = void 0, se = null, Fn(), Zt(), ls(n);
4815
+ Q = void 0, se = null, Fn(), Zt(), fs(n);
4816
4816
  },
4817
4817
  () => {
4818
4818
  Q = void 0, se = null, Fn(), d("WS", "Connection closed by browser."), pe.next(!1), $t();
4819
4819
  }
4820
4820
  ), we && clearInterval(we), vn = Date.now(), jn(), we = setInterval(
4821
4821
  () => jn(),
4822
- Ur * 1e3
4823
- ), Zt(), Dr += 1, ht = setTimeout(() => {
4822
+ Dr * 1e3
4823
+ ), Zt(), qr += 1, ht = setTimeout(() => {
4824
4824
  d("WS", "Unhealthy connection. Reconnecting..."), pe.next(!1), se = null, $t();
4825
4825
  }, 30 * 1e3)) : (Q ? d(
4826
4826
  "WS",
@@ -4840,16 +4840,16 @@ function bn(t = 0) {
4840
4840
  ));
4841
4841
  })), se;
4842
4842
  }
4843
- function as() {
4843
+ function ls() {
4844
4844
  if (!vt() || !Y()) return null;
4845
- const t = uo() || location.protocol.indexOf("https") >= 0;
4846
- let e = `ws${t ? "s" : ""}://${rn()}${Kt()}${pr() ? "?fixed_device=true" : ""}`;
4845
+ const t = co() || location.protocol.indexOf("https") >= 0;
4846
+ let e = `ws${t ? "s" : ""}://${rn()}${Kt()}${_r() ? "?fixed_device=true" : ""}`;
4847
4847
  const n = Y();
4848
4848
  let r = n === "x-api-key" ? `api-key=${Ot()}` : `bearer_token=${n}`;
4849
- return !no() && !Qi() ? (d("WS", "Authenticating through cookie..."), r += `;max-age=120;path=${Kt()};`, r += `${t ? "secure;" : ""}samesite=strict`, document.cookie = r, d("WS", "Cookies:", [document.cookie, r])) : (d("WS", "Authenticating through URL query parameter..."), e += `${e.indexOf("?") >= 0 ? "&" : "?"}${r}`), d(
4849
+ return !ro() && !Yi() ? (d("WS", "Authenticating through cookie..."), r += `;max-age=120;path=${Kt()};`, r += `${t ? "secure;" : ""}samesite=strict`, document.cookie = r, d("WS", "Cookies:", [document.cookie, r])) : (d("WS", "Authenticating through URL query parameter..."), e += `${e.indexOf("?") >= 0 ? "&" : "?"}${r}`), d(
4850
4850
  "WS",
4851
4851
  `Creating websocket connection to ws${t ? "s" : ""}://${rn()}${Kt()}`
4852
- ), Ko({
4852
+ ), Zo({
4853
4853
  url: e,
4854
4854
  serializer: (i) => typeof i == "object" ? JSON.stringify(i) : i,
4855
4855
  deserializer: (i) => {
@@ -4864,7 +4864,7 @@ function as() {
4864
4864
  });
4865
4865
  }
4866
4866
  function $t() {
4867
- qr.next([Dr, Date.now() - Cr]), Q && jr() && (Q.complete(), we && (clearInterval(we), we = void 0)), d(
4867
+ Cr.next([qr, Date.now() - Nr]), Q && Fr() && (Q.complete(), we && (clearInterval(we), we = void 0)), d(
4868
4868
  "WS",
4869
4869
  `Reconnecting in ${Math.min(
4870
4870
  5e3,
@@ -4877,24 +4877,24 @@ function $t() {
4877
4877
  );
4878
4878
  }
4879
4879
  function jn() {
4880
- if (Date.now() - vn > 4 * Ur * 1e3)
4880
+ if (Date.now() - vn > 4 * Dr * 1e3)
4881
4881
  return $t();
4882
4882
  Q?.next("ping");
4883
4883
  }
4884
- function ls(t) {
4885
- pe.next(!1), d("WS", "Websocket error:", t, void 0, "error"), t.status === 401 && hn(), _r(), $t();
4884
+ function fs(t) {
4885
+ pe.next(!1), d("WS", "Websocket error:", t, void 0, "error"), t.status === 401 && hn(), mr(), $t();
4886
4886
  }
4887
4887
  function Zt() {
4888
4888
  ht && (clearTimeout(ht), ht = void 0);
4889
4889
  }
4890
- function fs() {
4890
+ function hs() {
4891
4891
  const t = new ae();
4892
4892
  return t.subscribe(
4893
- (e) => Fr(e)
4893
+ (e) => zr(e)
4894
4894
  ), t;
4895
4895
  }
4896
- function hs(t, e, n) {
4897
- const r = `${t.sys}|${t.mod}_${t.index}|${t.name}`, i = Xo(t.sys), o = i && i[t.mod] ? i[t.mod][t.index - 1 || 0] : null;
4896
+ function ds(t, e, n) {
4897
+ const r = `${t.sys}|${t.mod}_${t.index}|${t.name}`, i = es(t.sys), o = i && i[t.mod] ? i[t.mod][t.index - 1 || 0] : null;
4898
4898
  if (o) {
4899
4899
  switch (t.cmd) {
4900
4900
  case "bind":
@@ -4943,9 +4943,9 @@ function Fn() {
4943
4943
  for (const t in L)
4944
4944
  L[t] && delete L[t];
4945
4945
  }
4946
- class ds {
4946
+ class zn {
4947
4947
  constructor(e, n) {
4948
- this._module = e, this.name = n, ts().pipe(Ii()).subscribe((r) => {
4948
+ this._module = e, this.name = n, ns().pipe(Pi()).subscribe((r) => {
4949
4949
  r && (this._stale_bindings || this._pending === 1) ? (d("VAR", "Re-binding to status variable", this.binding()), this.rebind()) : r || (ve(
4950
4950
  `rebind:${JSON.stringify(this.binding())}`
4951
4951
  ), d(
@@ -4969,16 +4969,17 @@ class ds {
4969
4969
  }
4970
4970
  /** Current value of the binding */
4971
4971
  get value() {
4972
- return rs(this.binding());
4972
+ return is(this.binding());
4973
4973
  }
4974
4974
  /**
4975
4975
  * Get an observable that emits the current value of the binding
4976
4976
  */
4977
4977
  listen() {
4978
- return ns(this.binding());
4978
+ return rs(this.binding());
4979
4979
  }
4980
4980
  /**
4981
- * Subscribe to changes of the variable's binding value
4981
+ * Subscribe to changes of the variable's binding value.
4982
+ * Note: Initial value emitted may be `undefined`
4982
4983
  * @param next Callback for changes to the bindings value
4983
4984
  */
4984
4985
  subscribe(e) {
@@ -4996,7 +4997,7 @@ class ds {
4996
4997
  * Unbind from status variable
4997
4998
  */
4998
4999
  unbind() {
4999
- this._binding_count === 1 && this._pending === 0 ? (this._pending = 2, is(this.binding()).then(() => {
5000
+ this._binding_count === 1 && this._pending === 0 ? (this._pending = 2, os(this.binding()).then(() => {
5000
5001
  this._pending === 2 && (this._pending = 0), this._binding_count--;
5001
5002
  })) : this._binding_count = Math.max(this._binding_count - 1, 0);
5002
5003
  }
@@ -5050,9 +5051,17 @@ class ps {
5050
5051
  /**
5051
5052
  * Get binding with the given name
5052
5053
  * @param name Name of the binding
5054
+ * @deprecated Use `variable` instead
5053
5055
  */
5054
5056
  binding(e) {
5055
- return this._bindings[e] || (this._bindings[e] = new ds(this, e)), this._bindings[e];
5057
+ return this._bindings[e] || (this._bindings[e] = new zn(this, e)), this._bindings[e];
5058
+ }
5059
+ /**
5060
+ * Get binding with the given name
5061
+ * @param name Name of the binding
5062
+ */
5063
+ variable(e) {
5064
+ return this._bindings[e] || (this._bindings[e] = new zn(this, e)), this._bindings[e];
5056
5065
  }
5057
5066
  /**
5058
5067
  * Execute method on the engine module
@@ -5060,7 +5069,7 @@ class ps {
5060
5069
  * @param args Array of arguments to pass to the method
5061
5070
  */
5062
5071
  execute(e, n, r = st) {
5063
- return os(
5072
+ return ss(
5064
5073
  {
5065
5074
  sys: this._system.id,
5066
5075
  mod: this.name,
@@ -5109,48 +5118,48 @@ function Ia(t, e, n = 1) {
5109
5118
  return ms(t).module(e, n);
5110
5119
  }
5111
5120
  export {
5112
- Eo as AuthType,
5121
+ Io as AuthType,
5113
5122
  Pe as EncryptionLevel,
5114
- Ir as MediaAnimation,
5115
- Zo as MockPlaceWebsocketModule,
5116
- Go as MockPlaceWebsocketSystem,
5117
- wo as PlaceApplication,
5118
- Po as PlaceCluster,
5119
- Ro as PlaceDomain,
5120
- $r as PlaceDriver,
5123
+ Pr as MediaAnimation,
5124
+ Go as MockPlaceWebsocketModule,
5125
+ Xo as MockPlaceWebsocketSystem,
5126
+ Oo as PlaceApplication,
5127
+ To as PlaceCluster,
5128
+ Uo as PlaceDomain,
5129
+ Ar as PlaceDriver,
5121
5130
  St as PlaceDriverRole,
5122
- Uo as PlaceEdge,
5131
+ Do as PlaceEdge,
5123
5132
  X as PlaceErrorCodes,
5124
- Do as PlaceLDAPSource,
5125
- Rr as PlaceLogLevel,
5126
- Io as PlaceMQTTBroker,
5127
- Ar as PlaceMetadata,
5128
- Or as PlaceModule,
5133
+ qo as PlaceLDAPSource,
5134
+ Ur as PlaceLogLevel,
5135
+ Po as PlaceMQTTBroker,
5136
+ wr as PlaceMetadata,
5137
+ Er as PlaceModule,
5129
5138
  ps as PlaceModuleBinding,
5130
- No as PlaceOAuthSource,
5131
- To as PlaceProcess,
5132
- jo as PlaceRepository,
5133
- Er as PlaceRepositoryType,
5139
+ jo as PlaceOAuthSource,
5140
+ Mo as PlaceProcess,
5141
+ Fo as PlaceRepository,
5142
+ Ir as PlaceRepositoryType,
5134
5143
  B as PlaceResource,
5135
- Fo as PlaceSAMLSource,
5144
+ zo as PlaceSAMLSource,
5136
5145
  Se as PlaceSettings,
5137
- wr as PlaceSystem,
5146
+ Or as PlaceSystem,
5138
5147
  _s as PlaceSystemBinding,
5139
5148
  Me as PlaceTrigger,
5140
- Ho as PlaceUser,
5141
- ds as PlaceVariableBinding,
5149
+ Bo as PlaceUser,
5150
+ zn as PlaceVariableBinding,
5142
5151
  mn as PlaceZone,
5143
- qo as PlaceZoneMetadata,
5144
- Bo as SignageMedia,
5145
- Vo as SignagePlaylist,
5152
+ Co as PlaceZoneMetadata,
5153
+ Vo as SignageMedia,
5154
+ Qo as SignagePlaylist,
5146
5155
  yn as SignagePlaylistMedia,
5147
5156
  Qt as Survey,
5148
- Tr as SurveyAnswer,
5157
+ Mr as SurveyAnswer,
5149
5158
  Bt as SurveyInvitation,
5150
5159
  Vt as SurveyQuestion,
5151
- zo as TriggerConditionOperator,
5152
- Lo as TriggerTimeConditionType,
5153
- Wo as TriggerWebhookType,
5160
+ Lo as TriggerConditionOperator,
5161
+ Wo as TriggerTimeConditionType,
5162
+ Ho as TriggerWebhookType,
5154
5163
  ca as addAnswer,
5155
5164
  Ps as addApplication,
5156
5165
  Ds as addBroker,
@@ -5178,46 +5187,46 @@ export {
5178
5187
  be as apiEndpoint,
5179
5188
  Ot as apiKey,
5180
5189
  oa as approveSignagePlaylist,
5181
- mr as authorise,
5190
+ yr as authorise,
5182
5191
  vt as authority,
5183
5192
  Nn as bind,
5184
- Vi as cleanObject,
5193
+ Qi as cleanObject,
5185
5194
  ks as cleanupAuth,
5186
- ro as clientId,
5195
+ io as clientId,
5187
5196
  wa as connectionState,
5188
5197
  Rn as consoleHasColours,
5189
5198
  je as convertPairStringToMap,
5190
5199
  C as create,
5191
5200
  Rc as currentUser,
5192
5201
  Oa as debug,
5193
- Nr as debug_events,
5202
+ jr as debug_events,
5194
5203
  He as del,
5195
- vo as deregisterMockEndpoint,
5204
+ bo as deregisterMockEndpoint,
5196
5205
  Aa as deregisterSystem,
5197
- os as execute,
5206
+ ss as execute,
5198
5207
  mc as executeOnSystem,
5199
5208
  Hc as executeOnZone,
5200
5209
  vc as functionList,
5201
- Hi as generateNonce,
5210
+ Bi as generateNonce,
5202
5211
  ee as get,
5203
- hr as getFragments,
5212
+ dr as getFragments,
5204
5213
  Ia as getModule,
5205
5214
  ms as getSystem,
5206
- oo as hasToken,
5215
+ so as hasToken,
5207
5216
  rn as host,
5208
- dr as httpRoute,
5217
+ pr as httpRoute,
5209
5218
  yt as humanReadableByteCount,
5210
5219
  Ea as ignore,
5211
5220
  hn as invalidateToken,
5212
5221
  Gs as isDriverCompiled,
5213
- pr as isFixedDevice,
5214
- Qi as isMobileSafari,
5222
+ _r as isFixedDevice,
5223
+ Yi as isMobileSafari,
5215
5224
  ln as isMock,
5216
- Yi as isNestedFrame,
5225
+ Ji as isNestedFrame,
5217
5226
  vs as isOnline,
5218
- uo as isSecure,
5227
+ co as isSecure,
5219
5228
  fn as isTrusted,
5220
- jr as is_connected,
5229
+ Fr as is_connected,
5221
5230
  ws as lastRequestTotal,
5222
5231
  mu as listChildMetadata,
5223
5232
  ju as listInterfaceRepositories,
@@ -5238,19 +5247,19 @@ export {
5238
5247
  Pc as listTriggerInstances,
5239
5248
  Nc as listZoneTags,
5240
5249
  Wc as listZoneTriggers,
5241
- ns as listen,
5242
- so as listenForToken,
5250
+ rs as listen,
5251
+ uo as listenForToken,
5243
5252
  wu as loadModule,
5244
5253
  d as log,
5245
5254
  xs as logout,
5246
5255
  Au as lookupModuleState,
5247
5256
  gc as lookupSystemModuleState,
5248
- Xo as mockSystem,
5257
+ es as mockSystem,
5249
5258
  Eu as moduleRuntimeError,
5250
5259
  Ou as moduleSettings,
5251
5260
  $u as moduleState,
5252
5261
  bs as onlineState,
5253
- Bi as parseLinkHeader,
5262
+ Vi as parseLinkHeader,
5254
5263
  It as patch,
5255
5264
  Ie as post,
5256
5265
  Yu as pullRepositoryChanges,
@@ -5282,7 +5291,7 @@ export {
5282
5291
  Cc as queryZones,
5283
5292
  Ks as recompileDriver,
5284
5293
  ys as redirectUri,
5285
- _r as refreshAuthority,
5294
+ mr as refreshAuthority,
5286
5295
  nn as refreshToken,
5287
5296
  $s as registerMockEndpoint,
5288
5297
  $a as registerSystem,
@@ -5313,10 +5322,10 @@ export {
5313
5322
  qc as removeUser,
5314
5323
  Lc as removeZone,
5315
5324
  As as requestTotal,
5316
- $o as responseHeaders,
5325
+ Ao as responseHeaders,
5317
5326
  iu as retrieveEdgeToken,
5318
5327
  gs as setAPI_Key,
5319
- io as setToken,
5328
+ oo as setToken,
5320
5329
  oc as settingsHistory,
5321
5330
  Ss as setup,
5322
5331
  $ as show,
@@ -5343,17 +5352,17 @@ export {
5343
5352
  wc as showTrigger,
5344
5353
  Mc as showUser,
5345
5354
  jc as showZone,
5346
- Ji as simplifiedTime,
5355
+ Ki as simplifiedTime,
5347
5356
  ku as startModule,
5348
5357
  pc as startSystem,
5349
- ts as status,
5358
+ ns as status,
5350
5359
  xu as stopModule,
5351
5360
  _c as stopSystem,
5352
5361
  yc as systemModuleState,
5353
5362
  $c as systemSettings,
5354
5363
  js as terminateProcess,
5355
5364
  Y as token,
5356
- is as unbind,
5365
+ os as unbind,
5357
5366
  N as update,
5358
5367
  Is as updateApplication,
5359
5368
  Us as updateBroker,
@@ -5377,7 +5386,7 @@ export {
5377
5386
  Oc as updateTrigger,
5378
5387
  Uc as updateUser,
5379
5388
  Fc as updateZone,
5380
- rs as value,
5389
+ is as value,
5381
5390
  Kt as websocketRoute
5382
5391
  };
5383
5392
  //# sourceMappingURL=index.es.js.map