@asgard-js/core 0.2.17 → 0.2.19
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.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +128 -124
- package/dist/index.mjs.map +1 -1
- package/dist/lib/channel.d.ts +1 -0
- package/dist/lib/channel.d.ts.map +1 -1
- package/dist/types/sse-response.d.ts +1 -1
- package/dist/types/sse-response.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -41,7 +41,7 @@ function Ne(r, e, t, n) {
|
|
|
41
41
|
u((n = n.apply(r, e || [])).next());
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function de(r, e) {
|
|
45
45
|
var t = { label: 0, sent: function() {
|
|
46
46
|
if (i[0] & 1) throw i[1];
|
|
47
47
|
return i[1];
|
|
@@ -196,13 +196,13 @@ function He(r) {
|
|
|
196
196
|
function m(r) {
|
|
197
197
|
return typeof r == "function";
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function he(r) {
|
|
200
200
|
var e = function(n) {
|
|
201
201
|
Error.call(n), n.stack = new Error().stack;
|
|
202
202
|
}, t = r(e);
|
|
203
203
|
return t.prototype = Object.create(Error.prototype), t.prototype.constructor = t, t;
|
|
204
204
|
}
|
|
205
|
-
var q =
|
|
205
|
+
var q = he(function(r) {
|
|
206
206
|
return function(t) {
|
|
207
207
|
r(this), this.message = t ? t.length + ` errors occurred during unsubscription:
|
|
208
208
|
` + t.map(function(n, o) {
|
|
@@ -258,7 +258,7 @@ var U = (function() {
|
|
|
258
258
|
for (var v = M(h), l = v.next(); !l.done; l = v.next()) {
|
|
259
259
|
var y = l.value;
|
|
260
260
|
try {
|
|
261
|
-
|
|
261
|
+
re(y);
|
|
262
262
|
} catch (p) {
|
|
263
263
|
i = i ?? [], p instanceof q ? i = R(R([], L(i)), L(p.errors)) : i.push(p);
|
|
264
264
|
}
|
|
@@ -280,7 +280,7 @@ var U = (function() {
|
|
|
280
280
|
var t;
|
|
281
281
|
if (e && e !== this)
|
|
282
282
|
if (this.closed)
|
|
283
|
-
|
|
283
|
+
re(e);
|
|
284
284
|
else {
|
|
285
285
|
if (e instanceof r) {
|
|
286
286
|
if (e.closed || e._hasParent(this))
|
|
@@ -305,11 +305,11 @@ var U = (function() {
|
|
|
305
305
|
var e = new r();
|
|
306
306
|
return e.closed = !0, e;
|
|
307
307
|
})(), r;
|
|
308
|
-
})(),
|
|
309
|
-
function
|
|
308
|
+
})(), ve = U.EMPTY;
|
|
309
|
+
function pe(r) {
|
|
310
310
|
return r instanceof U || r && "closed" in r && m(r.remove) && m(r.add) && m(r.unsubscribe);
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function re(r) {
|
|
313
313
|
m(r) ? r() : r.unsubscribe();
|
|
314
314
|
}
|
|
315
315
|
var Fe = {
|
|
@@ -325,7 +325,7 @@ var Fe = {
|
|
|
325
325
|
},
|
|
326
326
|
delegate: void 0
|
|
327
327
|
};
|
|
328
|
-
function
|
|
328
|
+
function ye(r) {
|
|
329
329
|
Ve.setTimeout(function() {
|
|
330
330
|
throw r;
|
|
331
331
|
});
|
|
@@ -335,11 +335,11 @@ function W() {
|
|
|
335
335
|
function j(r) {
|
|
336
336
|
r();
|
|
337
337
|
}
|
|
338
|
-
var
|
|
338
|
+
var Q = (function(r) {
|
|
339
339
|
O(e, r);
|
|
340
340
|
function e(t) {
|
|
341
341
|
var n = r.call(this) || this;
|
|
342
|
-
return n.isStopped = !1, t ? (n.destination = t,
|
|
342
|
+
return n.isStopped = !1, t ? (n.destination = t, pe(t) && t.add(n)) : n.destination = Be, n;
|
|
343
343
|
}
|
|
344
344
|
return e.create = function(t, n, o) {
|
|
345
345
|
return new X(t, n, o);
|
|
@@ -408,9 +408,9 @@ var z = (function(r) {
|
|
|
408
408
|
} : s = t, i.destination = new qe(s), i;
|
|
409
409
|
}
|
|
410
410
|
return e;
|
|
411
|
-
})(
|
|
411
|
+
})(Q);
|
|
412
412
|
function $(r) {
|
|
413
|
-
|
|
413
|
+
ye(r);
|
|
414
414
|
}
|
|
415
415
|
function Ke(r) {
|
|
416
416
|
throw r;
|
|
@@ -420,7 +420,7 @@ var Be = {
|
|
|
420
420
|
next: W,
|
|
421
421
|
error: Ke,
|
|
422
422
|
complete: W
|
|
423
|
-
},
|
|
423
|
+
}, Z = (function() {
|
|
424
424
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
425
425
|
})();
|
|
426
426
|
function G(r) {
|
|
@@ -454,7 +454,7 @@ var g = (function() {
|
|
|
454
454
|
}
|
|
455
455
|
}, r.prototype.forEach = function(e, t) {
|
|
456
456
|
var n = this;
|
|
457
|
-
return t =
|
|
457
|
+
return t = ne(t), new t(function(o, i) {
|
|
458
458
|
var s = new X({
|
|
459
459
|
next: function(a) {
|
|
460
460
|
try {
|
|
@@ -471,7 +471,7 @@ var g = (function() {
|
|
|
471
471
|
}, r.prototype._subscribe = function(e) {
|
|
472
472
|
var t;
|
|
473
473
|
return (t = this.source) === null || t === void 0 ? void 0 : t.subscribe(e);
|
|
474
|
-
}, r.prototype[
|
|
474
|
+
}, r.prototype[Z] = function() {
|
|
475
475
|
return this;
|
|
476
476
|
}, r.prototype.pipe = function() {
|
|
477
477
|
for (var e = [], t = 0; t < arguments.length; t++)
|
|
@@ -479,7 +479,7 @@ var g = (function() {
|
|
|
479
479
|
return Ye(e)(this);
|
|
480
480
|
}, r.prototype.toPromise = function(e) {
|
|
481
481
|
var t = this;
|
|
482
|
-
return e =
|
|
482
|
+
return e = ne(e), new e(function(n, o) {
|
|
483
483
|
var i;
|
|
484
484
|
t.subscribe(function(s) {
|
|
485
485
|
return i = s;
|
|
@@ -493,7 +493,7 @@ var g = (function() {
|
|
|
493
493
|
return new r(e);
|
|
494
494
|
}, r;
|
|
495
495
|
})();
|
|
496
|
-
function
|
|
496
|
+
function ne(r) {
|
|
497
497
|
var e;
|
|
498
498
|
return (e = r ?? Fe.Promise) !== null && e !== void 0 ? e : Promise;
|
|
499
499
|
}
|
|
@@ -501,12 +501,12 @@ function We(r) {
|
|
|
501
501
|
return r && m(r.next) && m(r.error) && m(r.complete);
|
|
502
502
|
}
|
|
503
503
|
function Xe(r) {
|
|
504
|
-
return r && r instanceof
|
|
504
|
+
return r && r instanceof Q || We(r) && pe(r);
|
|
505
505
|
}
|
|
506
506
|
function Je(r) {
|
|
507
507
|
return m(r?.lift);
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function _(r) {
|
|
510
510
|
return function(e) {
|
|
511
511
|
if (Je(e))
|
|
512
512
|
return e.lift(function(t) {
|
|
@@ -557,18 +557,18 @@ var ze = (function(r) {
|
|
|
557
557
|
r.prototype.unsubscribe.call(this), !n && ((t = this.onFinalize) === null || t === void 0 || t.call(this));
|
|
558
558
|
}
|
|
559
559
|
}, e;
|
|
560
|
-
})(
|
|
560
|
+
})(Q), Qe = he(function(r) {
|
|
561
561
|
return function() {
|
|
562
562
|
r(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
563
563
|
};
|
|
564
|
-
}),
|
|
564
|
+
}), ee = (function(r) {
|
|
565
565
|
O(e, r);
|
|
566
566
|
function e() {
|
|
567
567
|
var t = r.call(this) || this;
|
|
568
568
|
return t.closed = !1, t.currentObservers = null, t.observers = [], t.isStopped = !1, t.hasError = !1, t.thrownError = null, t;
|
|
569
569
|
}
|
|
570
570
|
return e.prototype.lift = function(t) {
|
|
571
|
-
var n = new
|
|
571
|
+
var n = new oe(this, this);
|
|
572
572
|
return n.operator = t, n;
|
|
573
573
|
}, e.prototype._throwIfClosed = function() {
|
|
574
574
|
if (this.closed)
|
|
@@ -628,7 +628,7 @@ var ze = (function(r) {
|
|
|
628
628
|
return this._throwIfClosed(), this._checkFinalizedStatuses(t), this._innerSubscribe(t);
|
|
629
629
|
}, e.prototype._innerSubscribe = function(t) {
|
|
630
630
|
var n = this, o = this, i = o.hasError, s = o.isStopped, a = o.observers;
|
|
631
|
-
return i || s ?
|
|
631
|
+
return i || s ? ve : (this.currentObservers = null, a.push(t), new U(function() {
|
|
632
632
|
n.currentObservers = null, D(a, t);
|
|
633
633
|
}));
|
|
634
634
|
}, e.prototype._checkFinalizedStatuses = function(t) {
|
|
@@ -638,9 +638,9 @@ var ze = (function(r) {
|
|
|
638
638
|
var t = new g();
|
|
639
639
|
return t.source = this, t;
|
|
640
640
|
}, e.create = function(t, n) {
|
|
641
|
-
return new
|
|
641
|
+
return new oe(t, n);
|
|
642
642
|
}, e;
|
|
643
|
-
})(g),
|
|
643
|
+
})(g), oe = (function(r) {
|
|
644
644
|
O(e, r);
|
|
645
645
|
function e(t, n) {
|
|
646
646
|
var o = r.call(this) || this;
|
|
@@ -657,9 +657,9 @@ var ze = (function(r) {
|
|
|
657
657
|
(n = (t = this.destination) === null || t === void 0 ? void 0 : t.complete) === null || n === void 0 || n.call(t);
|
|
658
658
|
}, e.prototype._subscribe = function(t) {
|
|
659
659
|
var n, o;
|
|
660
|
-
return (o = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(t)) !== null && o !== void 0 ? o :
|
|
660
|
+
return (o = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(t)) !== null && o !== void 0 ? o : ve;
|
|
661
661
|
}, e;
|
|
662
|
-
})(
|
|
662
|
+
})(ee), ie = (function(r) {
|
|
663
663
|
O(e, r);
|
|
664
664
|
function e(t) {
|
|
665
665
|
var n = r.call(this) || this;
|
|
@@ -682,7 +682,7 @@ var ze = (function(r) {
|
|
|
682
682
|
}, e.prototype.next = function(t) {
|
|
683
683
|
r.prototype.next.call(this, this._value = t);
|
|
684
684
|
}, e;
|
|
685
|
-
})(
|
|
685
|
+
})(ee), Ze = {
|
|
686
686
|
now: function() {
|
|
687
687
|
return Date.now();
|
|
688
688
|
}
|
|
@@ -694,7 +694,7 @@ var ze = (function(r) {
|
|
|
694
694
|
return e.prototype.schedule = function(t, n) {
|
|
695
695
|
return this;
|
|
696
696
|
}, e;
|
|
697
|
-
})(U),
|
|
697
|
+
})(U), se = {
|
|
698
698
|
setInterval: function(r, e) {
|
|
699
699
|
for (var t = [], n = 2; n < arguments.length; n++)
|
|
700
700
|
t[n - 2] = arguments[n];
|
|
@@ -718,11 +718,11 @@ var ze = (function(r) {
|
|
|
718
718
|
var i = this.id, s = this.scheduler;
|
|
719
719
|
return i != null && (this.id = this.recycleAsyncId(s, i, n)), this.pending = !0, this.delay = n, this.id = (o = this.id) !== null && o !== void 0 ? o : this.requestAsyncId(s, this.id, n), this;
|
|
720
720
|
}, e.prototype.requestAsyncId = function(t, n, o) {
|
|
721
|
-
return o === void 0 && (o = 0),
|
|
721
|
+
return o === void 0 && (o = 0), se.setInterval(t.flush.bind(t, this), o);
|
|
722
722
|
}, e.prototype.recycleAsyncId = function(t, n, o) {
|
|
723
723
|
if (o === void 0 && (o = 0), o != null && this.delay === o && this.pending === !1)
|
|
724
724
|
return n;
|
|
725
|
-
n != null &&
|
|
725
|
+
n != null && se.clearInterval(n);
|
|
726
726
|
}, e.prototype.execute = function(t, n) {
|
|
727
727
|
if (this.closed)
|
|
728
728
|
return new Error("executing a cancelled action");
|
|
@@ -746,7 +746,7 @@ var ze = (function(r) {
|
|
|
746
746
|
this.work = this.state = this.scheduler = null, this.pending = !1, D(i, this), n != null && (this.id = this.recycleAsyncId(o, n, null)), this.delay = null, r.prototype.unsubscribe.call(this);
|
|
747
747
|
}
|
|
748
748
|
}, e;
|
|
749
|
-
})(et),
|
|
749
|
+
})(et), ae = (function() {
|
|
750
750
|
function r(e, t) {
|
|
751
751
|
t === void 0 && (t = r.now), this.schedulerActionCtor = e, this.now = t;
|
|
752
752
|
}
|
|
@@ -756,7 +756,7 @@ var ze = (function(r) {
|
|
|
756
756
|
})(), rt = (function(r) {
|
|
757
757
|
O(e, r);
|
|
758
758
|
function e(t, n) {
|
|
759
|
-
n === void 0 && (n =
|
|
759
|
+
n === void 0 && (n = ae.now);
|
|
760
760
|
var o = r.call(this, t, n) || this;
|
|
761
761
|
return o.actions = [], o._active = !1, o;
|
|
762
762
|
}
|
|
@@ -778,47 +778,47 @@ var ze = (function(r) {
|
|
|
778
778
|
throw o;
|
|
779
779
|
}
|
|
780
780
|
}, e;
|
|
781
|
-
})(
|
|
781
|
+
})(ae), me = new rt(tt), nt = me, ot = new g(function(r) {
|
|
782
782
|
return r.complete();
|
|
783
783
|
});
|
|
784
|
-
function
|
|
784
|
+
function be(r) {
|
|
785
785
|
return r && m(r.schedule);
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function ge(r) {
|
|
788
788
|
return r[r.length - 1];
|
|
789
789
|
}
|
|
790
790
|
function it(r) {
|
|
791
|
-
return m(
|
|
791
|
+
return m(ge(r)) ? r.pop() : void 0;
|
|
792
792
|
}
|
|
793
|
-
function
|
|
794
|
-
return
|
|
793
|
+
function Se(r) {
|
|
794
|
+
return be(ge(r)) ? r.pop() : void 0;
|
|
795
795
|
}
|
|
796
|
-
var
|
|
796
|
+
var we = (function(r) {
|
|
797
797
|
return r && typeof r.length == "number" && typeof r != "function";
|
|
798
798
|
});
|
|
799
|
-
function we(r) {
|
|
800
|
-
return m(r?.then);
|
|
801
|
-
}
|
|
802
799
|
function Ee(r) {
|
|
803
|
-
return m(r
|
|
800
|
+
return m(r?.then);
|
|
804
801
|
}
|
|
805
802
|
function Ie(r) {
|
|
806
|
-
return
|
|
803
|
+
return m(r[Z]);
|
|
807
804
|
}
|
|
808
805
|
function Oe(r) {
|
|
806
|
+
return Symbol.asyncIterator && m(r?.[Symbol.asyncIterator]);
|
|
807
|
+
}
|
|
808
|
+
function Ae(r) {
|
|
809
809
|
return new TypeError("You provided " + (r !== null && typeof r == "object" ? "an invalid object" : "'" + r + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
|
|
810
810
|
}
|
|
811
811
|
function st() {
|
|
812
812
|
return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
|
|
813
813
|
}
|
|
814
|
-
var
|
|
815
|
-
function Ce(r) {
|
|
816
|
-
return m(r?.[Ae]);
|
|
817
|
-
}
|
|
814
|
+
var Ce = st();
|
|
818
815
|
function xe(r) {
|
|
816
|
+
return m(r?.[Ce]);
|
|
817
|
+
}
|
|
818
|
+
function Te(r) {
|
|
819
819
|
return Ge(this, arguments, function() {
|
|
820
820
|
var t, n, o, i;
|
|
821
|
-
return
|
|
821
|
+
return de(this, function(s) {
|
|
822
822
|
switch (s.label) {
|
|
823
823
|
case 0:
|
|
824
824
|
t = r.getReader(), s.label = 1;
|
|
@@ -853,24 +853,24 @@ function x(r) {
|
|
|
853
853
|
if (r instanceof g)
|
|
854
854
|
return r;
|
|
855
855
|
if (r != null) {
|
|
856
|
-
if (
|
|
856
|
+
if (Ie(r))
|
|
857
857
|
return at(r);
|
|
858
|
-
if (Se(r))
|
|
859
|
-
return ct(r);
|
|
860
858
|
if (we(r))
|
|
859
|
+
return ct(r);
|
|
860
|
+
if (Ee(r))
|
|
861
861
|
return ut(r);
|
|
862
|
-
if (
|
|
863
|
-
return
|
|
864
|
-
if (
|
|
862
|
+
if (Oe(r))
|
|
863
|
+
return Pe(r);
|
|
864
|
+
if (xe(r))
|
|
865
865
|
return lt(r);
|
|
866
866
|
if (_e(r))
|
|
867
867
|
return ft(r);
|
|
868
868
|
}
|
|
869
|
-
throw
|
|
869
|
+
throw Ae(r);
|
|
870
870
|
}
|
|
871
871
|
function at(r) {
|
|
872
872
|
return new g(function(e) {
|
|
873
|
-
var t = r[
|
|
873
|
+
var t = r[Z]();
|
|
874
874
|
if (m(t.subscribe))
|
|
875
875
|
return t.subscribe(e);
|
|
876
876
|
throw new TypeError("Provided object does not correctly implement Symbol.observable");
|
|
@@ -889,7 +889,7 @@ function ut(r) {
|
|
|
889
889
|
e.closed || (e.next(t), e.complete());
|
|
890
890
|
}, function(t) {
|
|
891
891
|
return e.error(t);
|
|
892
|
-
}).then(null,
|
|
892
|
+
}).then(null, ye);
|
|
893
893
|
});
|
|
894
894
|
}
|
|
895
895
|
function lt(r) {
|
|
@@ -913,7 +913,7 @@ function lt(r) {
|
|
|
913
913
|
e.complete();
|
|
914
914
|
});
|
|
915
915
|
}
|
|
916
|
-
function
|
|
916
|
+
function Pe(r) {
|
|
917
917
|
return new g(function(e) {
|
|
918
918
|
dt(r, e).catch(function(t) {
|
|
919
919
|
return e.error(t);
|
|
@@ -921,13 +921,13 @@ function Te(r) {
|
|
|
921
921
|
});
|
|
922
922
|
}
|
|
923
923
|
function ft(r) {
|
|
924
|
-
return Te(
|
|
924
|
+
return Pe(Te(r));
|
|
925
925
|
}
|
|
926
926
|
function dt(r, e) {
|
|
927
927
|
var t, n, o, i;
|
|
928
928
|
return Ne(this, void 0, void 0, function() {
|
|
929
929
|
var s, a;
|
|
930
|
-
return
|
|
930
|
+
return de(this, function(c) {
|
|
931
931
|
switch (c.label) {
|
|
932
932
|
case 0:
|
|
933
933
|
c.trys.push([0, 5, 6, 11]), t = He(r), c.label = 1;
|
|
@@ -969,8 +969,8 @@ function C(r, e, t, n, o) {
|
|
|
969
969
|
if (r.add(i), !o)
|
|
970
970
|
return i;
|
|
971
971
|
}
|
|
972
|
-
function
|
|
973
|
-
return e === void 0 && (e = 0),
|
|
972
|
+
function Me(r, e) {
|
|
973
|
+
return e === void 0 && (e = 0), _(function(t, n) {
|
|
974
974
|
t.subscribe(I(n, function(o) {
|
|
975
975
|
return C(n, r, function() {
|
|
976
976
|
return n.next(o);
|
|
@@ -986,18 +986,18 @@ function Pe(r, e) {
|
|
|
986
986
|
}));
|
|
987
987
|
});
|
|
988
988
|
}
|
|
989
|
-
function
|
|
990
|
-
return e === void 0 && (e = 0),
|
|
989
|
+
function Le(r, e) {
|
|
990
|
+
return e === void 0 && (e = 0), _(function(t, n) {
|
|
991
991
|
n.add(r.schedule(function() {
|
|
992
992
|
return t.subscribe(n);
|
|
993
993
|
}, e));
|
|
994
994
|
});
|
|
995
995
|
}
|
|
996
996
|
function ht(r, e) {
|
|
997
|
-
return x(r).pipe(
|
|
997
|
+
return x(r).pipe(Le(e), Me(e));
|
|
998
998
|
}
|
|
999
999
|
function vt(r, e) {
|
|
1000
|
-
return x(r).pipe(
|
|
1000
|
+
return x(r).pipe(Le(e), Me(e));
|
|
1001
1001
|
}
|
|
1002
1002
|
function pt(r, e) {
|
|
1003
1003
|
return new g(function(t) {
|
|
@@ -1011,7 +1011,7 @@ function yt(r, e) {
|
|
|
1011
1011
|
return new g(function(t) {
|
|
1012
1012
|
var n;
|
|
1013
1013
|
return C(t, e, function() {
|
|
1014
|
-
n = r[
|
|
1014
|
+
n = r[Ce](), C(t, e, function() {
|
|
1015
1015
|
var o, i, s;
|
|
1016
1016
|
try {
|
|
1017
1017
|
o = n.next(), i = o.value, s = o.done;
|
|
@@ -1026,7 +1026,7 @@ function yt(r, e) {
|
|
|
1026
1026
|
};
|
|
1027
1027
|
});
|
|
1028
1028
|
}
|
|
1029
|
-
function
|
|
1029
|
+
function Re(r, e) {
|
|
1030
1030
|
if (!r)
|
|
1031
1031
|
throw new Error("Iterable cannot be null");
|
|
1032
1032
|
return new g(function(t) {
|
|
@@ -1041,39 +1041,39 @@ function Le(r, e) {
|
|
|
1041
1041
|
});
|
|
1042
1042
|
}
|
|
1043
1043
|
function mt(r, e) {
|
|
1044
|
-
return
|
|
1044
|
+
return Re(Te(r), e);
|
|
1045
1045
|
}
|
|
1046
1046
|
function bt(r, e) {
|
|
1047
1047
|
if (r != null) {
|
|
1048
|
-
if (
|
|
1048
|
+
if (Ie(r))
|
|
1049
1049
|
return ht(r, e);
|
|
1050
|
-
if (Se(r))
|
|
1051
|
-
return pt(r, e);
|
|
1052
1050
|
if (we(r))
|
|
1051
|
+
return pt(r, e);
|
|
1052
|
+
if (Ee(r))
|
|
1053
1053
|
return vt(r, e);
|
|
1054
|
-
if (
|
|
1055
|
-
return
|
|
1056
|
-
if (
|
|
1054
|
+
if (Oe(r))
|
|
1055
|
+
return Re(r, e);
|
|
1056
|
+
if (xe(r))
|
|
1057
1057
|
return yt(r, e);
|
|
1058
1058
|
if (_e(r))
|
|
1059
1059
|
return mt(r, e);
|
|
1060
1060
|
}
|
|
1061
|
-
throw
|
|
1061
|
+
throw Ae(r);
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1063
|
+
function te(r, e) {
|
|
1064
1064
|
return e ? bt(r, e) : x(r);
|
|
1065
1065
|
}
|
|
1066
1066
|
function gt() {
|
|
1067
1067
|
for (var r = [], e = 0; e < arguments.length; e++)
|
|
1068
1068
|
r[e] = arguments[e];
|
|
1069
|
-
var t =
|
|
1070
|
-
return
|
|
1069
|
+
var t = Se(r);
|
|
1070
|
+
return te(r, t);
|
|
1071
1071
|
}
|
|
1072
1072
|
function St(r) {
|
|
1073
1073
|
return r instanceof Date && !isNaN(r);
|
|
1074
1074
|
}
|
|
1075
1075
|
function H(r, e) {
|
|
1076
|
-
return
|
|
1076
|
+
return _(function(t, n) {
|
|
1077
1077
|
var o = 0;
|
|
1078
1078
|
t.subscribe(I(n, function(i) {
|
|
1079
1079
|
n.next(r.call(e, i, o++));
|
|
@@ -1090,12 +1090,12 @@ function It(r) {
|
|
|
1090
1090
|
});
|
|
1091
1091
|
}
|
|
1092
1092
|
var Ot = Array.isArray, At = Object.getPrototypeOf, Ct = Object.prototype, xt = Object.keys;
|
|
1093
|
-
function
|
|
1093
|
+
function Tt(r) {
|
|
1094
1094
|
if (r.length === 1) {
|
|
1095
1095
|
var e = r[0];
|
|
1096
1096
|
if (Ot(e))
|
|
1097
1097
|
return { args: e, keys: null };
|
|
1098
|
-
if (
|
|
1098
|
+
if (_t(e)) {
|
|
1099
1099
|
var t = xt(e);
|
|
1100
1100
|
return {
|
|
1101
1101
|
args: t.map(function(n) {
|
|
@@ -1107,7 +1107,7 @@ function _t(r) {
|
|
|
1107
1107
|
}
|
|
1108
1108
|
return { args: r, keys: null };
|
|
1109
1109
|
}
|
|
1110
|
-
function
|
|
1110
|
+
function _t(r) {
|
|
1111
1111
|
return r && typeof r == "object" && At(r) === Ct;
|
|
1112
1112
|
}
|
|
1113
1113
|
function Pt(r, e) {
|
|
@@ -1118,9 +1118,9 @@ function Pt(r, e) {
|
|
|
1118
1118
|
function Mt() {
|
|
1119
1119
|
for (var r = [], e = 0; e < arguments.length; e++)
|
|
1120
1120
|
r[e] = arguments[e];
|
|
1121
|
-
var t =
|
|
1121
|
+
var t = Se(r), n = it(r), o = Tt(r), i = o.args, s = o.keys;
|
|
1122
1122
|
if (i.length === 0)
|
|
1123
|
-
return
|
|
1123
|
+
return te([], t);
|
|
1124
1124
|
var a = new g(Lt(i, t, s ? function(c) {
|
|
1125
1125
|
return Pt(s, c);
|
|
1126
1126
|
} : G));
|
|
@@ -1128,10 +1128,10 @@ function Mt() {
|
|
|
1128
1128
|
}
|
|
1129
1129
|
function Lt(r, e, t) {
|
|
1130
1130
|
return t === void 0 && (t = G), function(n) {
|
|
1131
|
-
|
|
1131
|
+
ce(e, function() {
|
|
1132
1132
|
for (var o = r.length, i = new Array(o), s = o, a = o, c = function(f) {
|
|
1133
|
-
|
|
1134
|
-
var h =
|
|
1133
|
+
ce(e, function() {
|
|
1134
|
+
var h = te(r[f], e), v = !1;
|
|
1135
1135
|
h.subscribe(I(n, function(l) {
|
|
1136
1136
|
i[f] = l, v || (v = !0, a--), a || n.next(t(i.slice()));
|
|
1137
1137
|
}, function() {
|
|
@@ -1143,7 +1143,7 @@ function Lt(r, e, t) {
|
|
|
1143
1143
|
}, n);
|
|
1144
1144
|
};
|
|
1145
1145
|
}
|
|
1146
|
-
function
|
|
1146
|
+
function ce(r, e, t) {
|
|
1147
1147
|
r ? C(t, r, e) : e();
|
|
1148
1148
|
}
|
|
1149
1149
|
function Rt(r, e, t, n, o, i, s, a) {
|
|
@@ -1163,13 +1163,13 @@ function Rt(r, e, t, n, o, i, s, a) {
|
|
|
1163
1163
|
try {
|
|
1164
1164
|
u--;
|
|
1165
1165
|
for (var w = function() {
|
|
1166
|
-
var
|
|
1167
|
-
s || y(
|
|
1166
|
+
var T = c.shift();
|
|
1167
|
+
s || y(T);
|
|
1168
1168
|
}; c.length && u < n; )
|
|
1169
1169
|
w();
|
|
1170
1170
|
v();
|
|
1171
|
-
} catch (
|
|
1172
|
-
e.error(
|
|
1171
|
+
} catch (T) {
|
|
1172
|
+
e.error(T);
|
|
1173
1173
|
}
|
|
1174
1174
|
}));
|
|
1175
1175
|
};
|
|
@@ -1183,14 +1183,14 @@ function N(r, e, t) {
|
|
|
1183
1183
|
return H(function(i, s) {
|
|
1184
1184
|
return e(n, i, o, s);
|
|
1185
1185
|
})(x(r(n, o)));
|
|
1186
|
-
}, t) : (typeof e == "number" && (t = e),
|
|
1186
|
+
}, t) : (typeof e == "number" && (t = e), _(function(n, o) {
|
|
1187
1187
|
return Rt(n, o, r, t);
|
|
1188
1188
|
}));
|
|
1189
1189
|
}
|
|
1190
|
-
function
|
|
1190
|
+
function Ue(r, e, t) {
|
|
1191
1191
|
r === void 0 && (r = 0), t === void 0 && (t = nt);
|
|
1192
1192
|
var n = -1;
|
|
1193
|
-
return e != null && (
|
|
1193
|
+
return e != null && (be(e) ? t = e : n = e), new g(function(o) {
|
|
1194
1194
|
var i = St(r) ? +r - t.now() : r;
|
|
1195
1195
|
i < 0 && (i = 0);
|
|
1196
1196
|
var s = 0;
|
|
@@ -1205,7 +1205,7 @@ function Ut(r, e) {
|
|
|
1205
1205
|
function kt(r) {
|
|
1206
1206
|
return r <= 0 ? function() {
|
|
1207
1207
|
return ot;
|
|
1208
|
-
} :
|
|
1208
|
+
} : _(function(e, t) {
|
|
1209
1209
|
var n = 0;
|
|
1210
1210
|
e.subscribe(I(t, function(o) {
|
|
1211
1211
|
++n <= r && (t.next(o), r <= n && t.complete());
|
|
@@ -1223,8 +1223,8 @@ function jt(r, e) {
|
|
|
1223
1223
|
});
|
|
1224
1224
|
}
|
|
1225
1225
|
function Dt(r, e) {
|
|
1226
|
-
e === void 0 && (e =
|
|
1227
|
-
var t =
|
|
1226
|
+
e === void 0 && (e = me);
|
|
1227
|
+
var t = Ue(r, e);
|
|
1228
1228
|
return jt(function() {
|
|
1229
1229
|
return t;
|
|
1230
1230
|
});
|
|
@@ -1235,7 +1235,7 @@ function Nt(r) {
|
|
|
1235
1235
|
count: r
|
|
1236
1236
|
};
|
|
1237
1237
|
var t = e.count, n = t === void 0 ? 1 / 0 : t, o = e.delay, i = e.resetOnSuccess, s = i === void 0 ? !1 : i;
|
|
1238
|
-
return n <= 0 ? G :
|
|
1238
|
+
return n <= 0 ? G : _(function(a, c) {
|
|
1239
1239
|
var u = 0, f, h = function() {
|
|
1240
1240
|
var v = !1;
|
|
1241
1241
|
f = a.subscribe(I(c, function(l) {
|
|
@@ -1246,7 +1246,7 @@ function Nt(r) {
|
|
|
1246
1246
|
f ? (f.unsubscribe(), f = null, h()) : v = !0;
|
|
1247
1247
|
};
|
|
1248
1248
|
if (o != null) {
|
|
1249
|
-
var p = typeof o == "number" ?
|
|
1249
|
+
var p = typeof o == "number" ? Ue(o) : x(o(l, u)), S = I(c, function() {
|
|
1250
1250
|
S.unsubscribe(), y();
|
|
1251
1251
|
}, function() {
|
|
1252
1252
|
c.complete();
|
|
@@ -1262,7 +1262,7 @@ function Nt(r) {
|
|
|
1262
1262
|
});
|
|
1263
1263
|
}
|
|
1264
1264
|
function Gt(r) {
|
|
1265
|
-
return
|
|
1265
|
+
return _(function(e, t) {
|
|
1266
1266
|
x(r).subscribe(I(t, function() {
|
|
1267
1267
|
return t.complete();
|
|
1268
1268
|
}, W)), !t.closed && e.subscribe(t);
|
|
@@ -1302,11 +1302,11 @@ function Ft(r) {
|
|
|
1302
1302
|
};
|
|
1303
1303
|
}
|
|
1304
1304
|
function Vt(r, e, t) {
|
|
1305
|
-
let n =
|
|
1305
|
+
let n = ue();
|
|
1306
1306
|
const o = new TextDecoder();
|
|
1307
1307
|
return function(s, a) {
|
|
1308
1308
|
if (s.length === 0)
|
|
1309
|
-
t?.(n), n =
|
|
1309
|
+
t?.(n), n = ue();
|
|
1310
1310
|
else if (a > 0) {
|
|
1311
1311
|
const c = o.decode(s.subarray(0, a)), u = a + (s[a + 1] === 32 ? 2 : 1), f = o.decode(s.subarray(u));
|
|
1312
1312
|
switch (c) {
|
|
@@ -1332,7 +1332,7 @@ function qt(r, e) {
|
|
|
1332
1332
|
const t = new Uint8Array(r.length + e.length);
|
|
1333
1333
|
return t.set(r), t.set(e, r.length), t;
|
|
1334
1334
|
}
|
|
1335
|
-
function
|
|
1335
|
+
function ue() {
|
|
1336
1336
|
return {
|
|
1337
1337
|
data: "",
|
|
1338
1338
|
event: "",
|
|
@@ -1348,7 +1348,7 @@ var Kt = function(r, e) {
|
|
|
1348
1348
|
e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(r, n[o]) && (t[n[o]] = r[n[o]]);
|
|
1349
1349
|
return t;
|
|
1350
1350
|
};
|
|
1351
|
-
const J = "text/event-stream", Bt = 1e3,
|
|
1351
|
+
const J = "text/event-stream", Bt = 1e3, le = "last-event-id";
|
|
1352
1352
|
function Yt(r, e) {
|
|
1353
1353
|
var { signal: t, headers: n, onopen: o, onmessage: i, onclose: s, onerror: a, openWhenHidden: c, fetch: u } = e, f = Kt(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
1354
1354
|
return new Promise((h, v) => {
|
|
@@ -1360,11 +1360,11 @@ function Yt(r, e) {
|
|
|
1360
1360
|
}
|
|
1361
1361
|
c || document.addEventListener("visibilitychange", p);
|
|
1362
1362
|
let S = Bt, w = 0;
|
|
1363
|
-
function
|
|
1363
|
+
function T() {
|
|
1364
1364
|
document.removeEventListener("visibilitychange", p), window.clearTimeout(w), y.abort();
|
|
1365
1365
|
}
|
|
1366
1366
|
t?.addEventListener("abort", () => {
|
|
1367
|
-
|
|
1367
|
+
T(), h();
|
|
1368
1368
|
});
|
|
1369
1369
|
const $e = u ?? window.fetch, je = o ?? Wt;
|
|
1370
1370
|
async function F() {
|
|
@@ -1373,17 +1373,17 @@ function Yt(r, e) {
|
|
|
1373
1373
|
try {
|
|
1374
1374
|
const k = await $e(r, Object.assign(Object.assign({}, f), { headers: l, signal: y.signal }));
|
|
1375
1375
|
await je(k), await Ht(k.body, Ft(Vt((A) => {
|
|
1376
|
-
A ? l[
|
|
1376
|
+
A ? l[le] = A : delete l[le];
|
|
1377
1377
|
}, (A) => {
|
|
1378
1378
|
S = A;
|
|
1379
|
-
}, i))), s?.(),
|
|
1379
|
+
}, i))), s?.(), T(), h();
|
|
1380
1380
|
} catch (k) {
|
|
1381
1381
|
if (!y.signal.aborted)
|
|
1382
1382
|
try {
|
|
1383
1383
|
const A = (V = a?.(k)) !== null && V !== void 0 ? V : S;
|
|
1384
1384
|
window.clearTimeout(w), w = window.setTimeout(F, A);
|
|
1385
1385
|
} catch (A) {
|
|
1386
|
-
|
|
1386
|
+
T(), v(A);
|
|
1387
1387
|
}
|
|
1388
1388
|
}
|
|
1389
1389
|
}
|
|
@@ -1460,7 +1460,7 @@ class rr {
|
|
|
1460
1460
|
endpoint;
|
|
1461
1461
|
botProviderEndpoint;
|
|
1462
1462
|
debugMode;
|
|
1463
|
-
destroy$ = new
|
|
1463
|
+
destroy$ = new ee();
|
|
1464
1464
|
sseEmitter = new Jt();
|
|
1465
1465
|
transformSsePayload;
|
|
1466
1466
|
customHeaders;
|
|
@@ -1592,7 +1592,7 @@ function Zt() {
|
|
|
1592
1592
|
}
|
|
1593
1593
|
return K(Qt);
|
|
1594
1594
|
}
|
|
1595
|
-
const er = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
1595
|
+
const er = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), fe = { randomUUID: er };
|
|
1596
1596
|
function tr(r, e, t) {
|
|
1597
1597
|
r = r || {};
|
|
1598
1598
|
const n = r.random ?? r.rng?.() ?? Zt();
|
|
@@ -1600,8 +1600,8 @@ function tr(r, e, t) {
|
|
|
1600
1600
|
throw new Error("Random bytes length must be >= 16");
|
|
1601
1601
|
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, zt(n);
|
|
1602
1602
|
}
|
|
1603
|
-
function
|
|
1604
|
-
return
|
|
1603
|
+
function ke(r, e, t) {
|
|
1604
|
+
return fe.randomUUID && !r ? fe.randomUUID() : tr(r);
|
|
1605
1605
|
}
|
|
1606
1606
|
class E {
|
|
1607
1607
|
messages = null;
|
|
@@ -1675,7 +1675,7 @@ class E {
|
|
|
1675
1675
|
}), new E({ messages: n });
|
|
1676
1676
|
}
|
|
1677
1677
|
onMessageError(e) {
|
|
1678
|
-
const t =
|
|
1678
|
+
const t = ke(), n = e.fact.runError.error, o = new Map(this.messages);
|
|
1679
1679
|
return o.set(t, {
|
|
1680
1680
|
type: "error",
|
|
1681
1681
|
eventType: d.ERROR,
|
|
@@ -1716,7 +1716,7 @@ class E {
|
|
|
1716
1716
|
return new E({ messages: n });
|
|
1717
1717
|
}
|
|
1718
1718
|
}
|
|
1719
|
-
class
|
|
1719
|
+
class z {
|
|
1720
1720
|
client;
|
|
1721
1721
|
customChannelId;
|
|
1722
1722
|
customMessageId;
|
|
@@ -1730,10 +1730,14 @@ class ke {
|
|
|
1730
1730
|
throw new Error("client must be required");
|
|
1731
1731
|
if (!e.customChannelId)
|
|
1732
1732
|
throw new Error("customChannelId must be required");
|
|
1733
|
-
this.client = e.client, this.customChannelId = e.customChannelId, this.customMessageId = e.customMessageId, this.isConnecting$ = new
|
|
1733
|
+
this.client = e.client, this.customChannelId = e.customChannelId, this.customMessageId = e.customMessageId, this.isConnecting$ = new ie(!1), this.conversation$ = new ie(e.conversation), this.statesObserver = e.statesObserver;
|
|
1734
|
+
}
|
|
1735
|
+
static create(e) {
|
|
1736
|
+
const t = new z(e);
|
|
1737
|
+
return t.subscribe(), t;
|
|
1734
1738
|
}
|
|
1735
1739
|
static async reset(e, t, n) {
|
|
1736
|
-
const o = new
|
|
1740
|
+
const o = new z(e);
|
|
1737
1741
|
try {
|
|
1738
1742
|
return o.subscribe(), await o.resetChannel(t, n), o;
|
|
1739
1743
|
} catch (i) {
|
|
@@ -1798,7 +1802,7 @@ class ke {
|
|
|
1798
1802
|
);
|
|
1799
1803
|
}
|
|
1800
1804
|
sendMessage(e, t) {
|
|
1801
|
-
const n = e.text.trim(), o = e.customMessageId ??
|
|
1805
|
+
const n = e.text.trim(), o = e.customMessageId ?? ke();
|
|
1802
1806
|
return this.currentUserMessageId = o, this.conversation$.next(
|
|
1803
1807
|
this.conversation$.value.pushMessage({
|
|
1804
1808
|
type: "user",
|
|
@@ -1827,7 +1831,7 @@ class ke {
|
|
|
1827
1831
|
}
|
|
1828
1832
|
export {
|
|
1829
1833
|
rr as AsgardServiceClient,
|
|
1830
|
-
|
|
1834
|
+
z as Channel,
|
|
1831
1835
|
E as Conversation,
|
|
1832
1836
|
d as EventType,
|
|
1833
1837
|
B as FetchSseAction,
|