@asgard-js/core 0.0.2 → 0.0.4
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 +829 -796
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/constants/enum.d.ts +0 -22
- package/dist/constants/enum.d.ts.map +0 -1
- package/dist/index.d.ts +0 -6
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/client.d.ts +0 -13
- package/dist/lib/client.d.ts.map +0 -1
- package/dist/lib/conversation.d.ts +0 -29
- package/dist/lib/conversation.d.ts.map +0 -1
- package/dist/lib/create-sse-observable.d.ts +0 -12
- package/dist/lib/create-sse-observable.d.ts.map +0 -1
- package/dist/types/client.d.ts +0 -43
- package/dist/types/client.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/sse-response.d.ts +0 -94
- package/dist/types/sse-response.d.ts.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
var
|
|
2
|
-
var Le = (
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var je = Object.defineProperty;
|
|
2
|
+
var Le = (t, n, e) => n in t ? je(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
3
|
+
var m = (t, n, e) => Le(t, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
var H = /* @__PURE__ */ ((t) => (t.RESET_CHANNEL = "RESET_CHANNEL", t.NONE = "NONE", t))(H || {}), I = /* @__PURE__ */ ((t) => (t.INIT = "asgard.run.init", t.MESSAGE_START = "asgard.message.start", t.MESSAGE_DELTA = "asgard.message.delta", t.MESSAGE_COMPLETE = "asgard.message.complete", t.DONE = "asgard.run.done", t))(I || {}), Ue = /* @__PURE__ */ ((t) => (t.TEXT = "TEXT", t.HINT = "HINT", t.BUTTON = "BUTTON", t.IMAGE = "IMAGE", t.VIDEO = "VIDEO", t.AUDIO = "AUDIO", t.LOCATION = "LOCATION", t.CAROUSEL = "CAROUSEL", t))(Ue || {}), V = function(t, n) {
|
|
5
5
|
return V = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
6
6
|
e.__proto__ = r;
|
|
7
7
|
} || function(e, r) {
|
|
8
8
|
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
|
|
9
|
-
}, V(
|
|
9
|
+
}, V(t, n);
|
|
10
10
|
};
|
|
11
|
-
function
|
|
12
|
-
if (typeof
|
|
13
|
-
throw new TypeError("Class extends value " + String(
|
|
14
|
-
V(
|
|
11
|
+
function S(t, n) {
|
|
12
|
+
if (typeof n != "function" && n !== null)
|
|
13
|
+
throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
|
|
14
|
+
V(t, n);
|
|
15
15
|
function e() {
|
|
16
|
-
this.constructor =
|
|
16
|
+
this.constructor = t;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
t.prototype = n === null ? Object.create(n) : (e.prototype = n.prototype, new e());
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
function i(
|
|
22
|
-
return
|
|
23
|
-
o(
|
|
20
|
+
function Ne(t, n, e, r) {
|
|
21
|
+
function i(u) {
|
|
22
|
+
return u instanceof e ? u : new e(function(o) {
|
|
23
|
+
o(u);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
return new (e || (e = Promise))(function(
|
|
27
|
-
function
|
|
26
|
+
return new (e || (e = Promise))(function(u, o) {
|
|
27
|
+
function s(l) {
|
|
28
28
|
try {
|
|
29
29
|
a(r.next(l));
|
|
30
30
|
} catch (h) {
|
|
31
31
|
o(h);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function c(l) {
|
|
35
35
|
try {
|
|
36
36
|
a(r.throw(l));
|
|
37
37
|
} catch (h) {
|
|
@@ -39,32 +39,32 @@ function je(n, t, e, r) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
function a(l) {
|
|
42
|
-
l.done ?
|
|
42
|
+
l.done ? u(l.value) : i(l.value).then(s, c);
|
|
43
43
|
}
|
|
44
|
-
a((r = r.apply(
|
|
44
|
+
a((r = r.apply(t, n || [])).next());
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function ae(t, n) {
|
|
48
48
|
var e = { label: 0, sent: function() {
|
|
49
|
-
if (
|
|
50
|
-
return
|
|
51
|
-
}, trys: [], ops: [] }, r, i,
|
|
52
|
-
return o.next =
|
|
49
|
+
if (u[0] & 1) throw u[1];
|
|
50
|
+
return u[1];
|
|
51
|
+
}, trys: [], ops: [] }, r, i, u, o = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
52
|
+
return o.next = s(0), o.throw = s(1), o.return = s(2), typeof Symbol == "function" && (o[Symbol.iterator] = function() {
|
|
53
53
|
return this;
|
|
54
54
|
}), o;
|
|
55
|
-
function
|
|
55
|
+
function s(a) {
|
|
56
56
|
return function(l) {
|
|
57
|
-
return
|
|
57
|
+
return c([a, l]);
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function c(a) {
|
|
61
61
|
if (r) throw new TypeError("Generator is already executing.");
|
|
62
62
|
for (; o && (o = 0, a[0] && (e = 0)), e; ) try {
|
|
63
|
-
if (r = 1, i && (
|
|
64
|
-
switch (i = 0,
|
|
63
|
+
if (r = 1, i && (u = a[0] & 2 ? i.return : a[0] ? i.throw || ((u = i.return) && u.call(i), 0) : i.next) && !(u = u.call(i, a[1])).done) return u;
|
|
64
|
+
switch (i = 0, u && (a = [a[0] & 2, u.value]), a[0]) {
|
|
65
65
|
case 0:
|
|
66
66
|
case 1:
|
|
67
|
-
|
|
67
|
+
u = a;
|
|
68
68
|
break;
|
|
69
69
|
case 4:
|
|
70
70
|
return e.label++, { value: a[1], done: !1 };
|
|
@@ -75,53 +75,53 @@ function oe(n, t) {
|
|
|
75
75
|
a = e.ops.pop(), e.trys.pop();
|
|
76
76
|
continue;
|
|
77
77
|
default:
|
|
78
|
-
if (
|
|
78
|
+
if (u = e.trys, !(u = u.length > 0 && u[u.length - 1]) && (a[0] === 6 || a[0] === 2)) {
|
|
79
79
|
e = 0;
|
|
80
80
|
continue;
|
|
81
81
|
}
|
|
82
|
-
if (a[0] === 3 && (!
|
|
82
|
+
if (a[0] === 3 && (!u || a[1] > u[0] && a[1] < u[3])) {
|
|
83
83
|
e.label = a[1];
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
|
-
if (a[0] === 6 && e.label <
|
|
87
|
-
e.label =
|
|
86
|
+
if (a[0] === 6 && e.label < u[1]) {
|
|
87
|
+
e.label = u[1], u = a;
|
|
88
88
|
break;
|
|
89
89
|
}
|
|
90
|
-
if (
|
|
91
|
-
e.label =
|
|
90
|
+
if (u && e.label < u[2]) {
|
|
91
|
+
e.label = u[2], e.ops.push(a);
|
|
92
92
|
break;
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
u[2] && e.ops.pop(), e.trys.pop();
|
|
95
95
|
continue;
|
|
96
96
|
}
|
|
97
|
-
a =
|
|
97
|
+
a = n.call(t, e);
|
|
98
98
|
} catch (l) {
|
|
99
99
|
a = [6, l], i = 0;
|
|
100
100
|
} finally {
|
|
101
|
-
r =
|
|
101
|
+
r = u = 0;
|
|
102
102
|
}
|
|
103
103
|
if (a[0] & 5) throw a[1];
|
|
104
104
|
return { value: a[0] ? a[1] : void 0, done: !0 };
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
var
|
|
109
|
-
if (e) return e.call(
|
|
110
|
-
if (
|
|
107
|
+
function M(t) {
|
|
108
|
+
var n = typeof Symbol == "function" && Symbol.iterator, e = n && t[n], r = 0;
|
|
109
|
+
if (e) return e.call(t);
|
|
110
|
+
if (t && typeof t.length == "number") return {
|
|
111
111
|
next: function() {
|
|
112
|
-
return
|
|
112
|
+
return t && r >= t.length && (t = void 0), { value: t && t[r++], done: !t };
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
|
-
throw new TypeError(
|
|
115
|
+
throw new TypeError(n ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
var e = typeof Symbol == "function" &&
|
|
119
|
-
if (!e) return
|
|
120
|
-
var r = e.call(
|
|
117
|
+
function U(t, n) {
|
|
118
|
+
var e = typeof Symbol == "function" && t[Symbol.iterator];
|
|
119
|
+
if (!e) return t;
|
|
120
|
+
var r = e.call(t), i, u = [], o;
|
|
121
121
|
try {
|
|
122
|
-
for (; (
|
|
123
|
-
} catch (
|
|
124
|
-
o = { error:
|
|
122
|
+
for (; (n === void 0 || n-- > 0) && !(i = r.next()).done; ) u.push(i.value);
|
|
123
|
+
} catch (s) {
|
|
124
|
+
o = { error: s };
|
|
125
125
|
} finally {
|
|
126
126
|
try {
|
|
127
127
|
i && !i.done && (e = r.return) && e.call(r);
|
|
@@ -129,20 +129,20 @@ function j(n, t) {
|
|
|
129
129
|
if (o) throw o.error;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
return
|
|
132
|
+
return u;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
if (e || arguments.length === 2) for (var r = 0, i =
|
|
136
|
-
(
|
|
137
|
-
return
|
|
134
|
+
function N(t, n, e) {
|
|
135
|
+
if (e || arguments.length === 2) for (var r = 0, i = n.length, u; r < i; r++)
|
|
136
|
+
(u || !(r in n)) && (u || (u = Array.prototype.slice.call(n, 0, r)), u[r] = n[r]);
|
|
137
|
+
return t.concat(u || Array.prototype.slice.call(n));
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
return this instanceof
|
|
139
|
+
function P(t) {
|
|
140
|
+
return this instanceof P ? (this.v = t, this) : new P(t);
|
|
141
141
|
}
|
|
142
|
-
function Re(
|
|
142
|
+
function Re(t, n, e) {
|
|
143
143
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
144
|
-
var r = e.apply(
|
|
145
|
-
return i = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype),
|
|
144
|
+
var r = e.apply(t, n || []), i, u = [];
|
|
145
|
+
return i = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), s("next"), s("throw"), s("return", o), i[Symbol.asyncIterator] = function() {
|
|
146
146
|
return this;
|
|
147
147
|
}, i;
|
|
148
148
|
function o(f) {
|
|
@@ -150,99 +150,99 @@ function Re(n, t, e) {
|
|
|
150
150
|
return Promise.resolve(y).then(f, h);
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function s(f, y) {
|
|
154
154
|
r[f] && (i[f] = function(d) {
|
|
155
|
-
return new Promise(function(
|
|
156
|
-
|
|
155
|
+
return new Promise(function(w, g) {
|
|
156
|
+
u.push([f, d, w, g]) > 1 || c(f, d);
|
|
157
157
|
});
|
|
158
158
|
}, y && (i[f] = y(i[f])));
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function c(f, y) {
|
|
161
161
|
try {
|
|
162
162
|
a(r[f](y));
|
|
163
163
|
} catch (d) {
|
|
164
|
-
|
|
164
|
+
b(u[0][3], d);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
function a(f) {
|
|
168
|
-
f.value instanceof
|
|
168
|
+
f.value instanceof P ? Promise.resolve(f.value.v).then(l, h) : b(u[0][2], f);
|
|
169
169
|
}
|
|
170
170
|
function l(f) {
|
|
171
|
-
|
|
171
|
+
c("next", f);
|
|
172
172
|
}
|
|
173
173
|
function h(f) {
|
|
174
|
-
|
|
174
|
+
c("throw", f);
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
f(y),
|
|
176
|
+
function b(f, y) {
|
|
177
|
+
f(y), u.shift(), u.length && c(u[0][0], u[0][1]);
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function $e(t) {
|
|
181
181
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
182
|
-
var
|
|
183
|
-
return
|
|
182
|
+
var n = t[Symbol.asyncIterator], e;
|
|
183
|
+
return n ? n.call(t) : (t = typeof M == "function" ? M(t) : t[Symbol.iterator](), e = {}, r("next"), r("throw"), r("return"), e[Symbol.asyncIterator] = function() {
|
|
184
184
|
return this;
|
|
185
185
|
}, e);
|
|
186
|
-
function r(
|
|
187
|
-
e[
|
|
188
|
-
return new Promise(function(
|
|
189
|
-
o =
|
|
186
|
+
function r(u) {
|
|
187
|
+
e[u] = t[u] && function(o) {
|
|
188
|
+
return new Promise(function(s, c) {
|
|
189
|
+
o = t[u](o), i(s, c, o.done, o.value);
|
|
190
190
|
});
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
function i(
|
|
194
|
-
Promise.resolve(
|
|
195
|
-
|
|
193
|
+
function i(u, o, s, c) {
|
|
194
|
+
Promise.resolve(c).then(function(a) {
|
|
195
|
+
u({ value: a, done: s });
|
|
196
196
|
}, o);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
function v(
|
|
200
|
-
return typeof
|
|
199
|
+
function v(t) {
|
|
200
|
+
return typeof t == "function";
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
var
|
|
202
|
+
function ce(t) {
|
|
203
|
+
var n = function(r) {
|
|
204
204
|
Error.call(r), r.stack = new Error().stack;
|
|
205
|
-
}, e = n
|
|
205
|
+
}, e = t(n);
|
|
206
206
|
return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
|
|
207
207
|
}
|
|
208
|
-
var
|
|
208
|
+
var K = ce(function(t) {
|
|
209
209
|
return function(e) {
|
|
210
|
-
|
|
210
|
+
t(this), this.message = e ? e.length + ` errors occurred during unsubscription:
|
|
211
211
|
` + e.map(function(r, i) {
|
|
212
212
|
return i + 1 + ") " + r.toString();
|
|
213
213
|
}).join(`
|
|
214
214
|
`) : "", this.name = "UnsubscriptionError", this.errors = e;
|
|
215
215
|
};
|
|
216
216
|
});
|
|
217
|
-
function
|
|
218
|
-
if (
|
|
219
|
-
var e =
|
|
220
|
-
0 <= e &&
|
|
217
|
+
function R(t, n) {
|
|
218
|
+
if (t) {
|
|
219
|
+
var e = t.indexOf(n);
|
|
220
|
+
0 <= e && t.splice(e, 1);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
var D = function() {
|
|
224
|
-
function n
|
|
225
|
-
this.initialTeardown =
|
|
224
|
+
function t(n) {
|
|
225
|
+
this.initialTeardown = n, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
226
226
|
}
|
|
227
|
-
return
|
|
228
|
-
var
|
|
227
|
+
return t.prototype.unsubscribe = function() {
|
|
228
|
+
var n, e, r, i, u;
|
|
229
229
|
if (!this.closed) {
|
|
230
230
|
this.closed = !0;
|
|
231
231
|
var o = this._parentage;
|
|
232
232
|
if (o)
|
|
233
233
|
if (this._parentage = null, Array.isArray(o))
|
|
234
234
|
try {
|
|
235
|
-
for (var
|
|
236
|
-
var a =
|
|
235
|
+
for (var s = M(o), c = s.next(); !c.done; c = s.next()) {
|
|
236
|
+
var a = c.value;
|
|
237
237
|
a.remove(this);
|
|
238
238
|
}
|
|
239
239
|
} catch (d) {
|
|
240
|
-
|
|
240
|
+
n = { error: d };
|
|
241
241
|
} finally {
|
|
242
242
|
try {
|
|
243
|
-
|
|
243
|
+
c && !c.done && (e = s.return) && e.call(s);
|
|
244
244
|
} finally {
|
|
245
|
-
if (
|
|
245
|
+
if (n) throw n.error;
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
else
|
|
@@ -252,68 +252,68 @@ var D = function() {
|
|
|
252
252
|
try {
|
|
253
253
|
l();
|
|
254
254
|
} catch (d) {
|
|
255
|
-
|
|
255
|
+
u = d instanceof K ? d.errors : [d];
|
|
256
256
|
}
|
|
257
257
|
var h = this._finalizers;
|
|
258
258
|
if (h) {
|
|
259
259
|
this._finalizers = null;
|
|
260
260
|
try {
|
|
261
|
-
for (var
|
|
261
|
+
for (var b = M(h), f = b.next(); !f.done; f = b.next()) {
|
|
262
262
|
var y = f.value;
|
|
263
263
|
try {
|
|
264
|
-
|
|
264
|
+
J(y);
|
|
265
265
|
} catch (d) {
|
|
266
|
-
|
|
266
|
+
u = u ?? [], d instanceof K ? u = N(N([], U(u)), U(d.errors)) : u.push(d);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
} catch (d) {
|
|
270
270
|
r = { error: d };
|
|
271
271
|
} finally {
|
|
272
272
|
try {
|
|
273
|
-
f && !f.done && (i =
|
|
273
|
+
f && !f.done && (i = b.return) && i.call(b);
|
|
274
274
|
} finally {
|
|
275
275
|
if (r) throw r.error;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
if (
|
|
280
|
-
throw new
|
|
279
|
+
if (u)
|
|
280
|
+
throw new K(u);
|
|
281
281
|
}
|
|
282
|
-
},
|
|
282
|
+
}, t.prototype.add = function(n) {
|
|
283
283
|
var e;
|
|
284
|
-
if (
|
|
284
|
+
if (n && n !== this)
|
|
285
285
|
if (this.closed)
|
|
286
|
-
|
|
286
|
+
J(n);
|
|
287
287
|
else {
|
|
288
|
-
if (
|
|
289
|
-
if (
|
|
288
|
+
if (n instanceof t) {
|
|
289
|
+
if (n.closed || n._hasParent(this))
|
|
290
290
|
return;
|
|
291
|
-
|
|
291
|
+
n._addParent(this);
|
|
292
292
|
}
|
|
293
|
-
(this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(
|
|
293
|
+
(this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(n);
|
|
294
294
|
}
|
|
295
|
-
},
|
|
295
|
+
}, t.prototype._hasParent = function(n) {
|
|
296
296
|
var e = this._parentage;
|
|
297
|
-
return e ===
|
|
298
|
-
},
|
|
297
|
+
return e === n || Array.isArray(e) && e.includes(n);
|
|
298
|
+
}, t.prototype._addParent = function(n) {
|
|
299
299
|
var e = this._parentage;
|
|
300
|
-
this._parentage = Array.isArray(e) ? (e.push(
|
|
301
|
-
},
|
|
300
|
+
this._parentage = Array.isArray(e) ? (e.push(n), e) : e ? [e, n] : n;
|
|
301
|
+
}, t.prototype._removeParent = function(n) {
|
|
302
302
|
var e = this._parentage;
|
|
303
|
-
e ===
|
|
304
|
-
},
|
|
303
|
+
e === n ? this._parentage = null : Array.isArray(e) && R(e, n);
|
|
304
|
+
}, t.prototype.remove = function(n) {
|
|
305
305
|
var e = this._finalizers;
|
|
306
|
-
e &&
|
|
307
|
-
},
|
|
308
|
-
var
|
|
309
|
-
return
|
|
310
|
-
}(),
|
|
311
|
-
}(),
|
|
312
|
-
function
|
|
313
|
-
return
|
|
314
|
-
}
|
|
315
|
-
function
|
|
316
|
-
v(
|
|
306
|
+
e && R(e, n), n instanceof t && n._removeParent(this);
|
|
307
|
+
}, t.EMPTY = function() {
|
|
308
|
+
var n = new t();
|
|
309
|
+
return n.closed = !0, n;
|
|
310
|
+
}(), t;
|
|
311
|
+
}(), fe = D.EMPTY;
|
|
312
|
+
function le(t) {
|
|
313
|
+
return t instanceof D || t && "closed" in t && v(t.remove) && v(t.add) && v(t.unsubscribe);
|
|
314
|
+
}
|
|
315
|
+
function J(t) {
|
|
316
|
+
v(t) ? t() : t.unsubscribe();
|
|
317
317
|
}
|
|
318
318
|
var Ge = {
|
|
319
319
|
onUnhandledError: null,
|
|
@@ -321,205 +321,205 @@ var Ge = {
|
|
|
321
321
|
Promise: void 0,
|
|
322
322
|
useDeprecatedSynchronousErrorHandling: !1,
|
|
323
323
|
useDeprecatedNextContext: !1
|
|
324
|
-
},
|
|
325
|
-
setTimeout: function(
|
|
324
|
+
}, de = {
|
|
325
|
+
setTimeout: function(t, n) {
|
|
326
326
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
327
327
|
e[r - 2] = arguments[r];
|
|
328
|
-
return setTimeout.apply(void 0,
|
|
328
|
+
return setTimeout.apply(void 0, N([t, n], U(e)));
|
|
329
329
|
},
|
|
330
|
-
clearTimeout: function(
|
|
331
|
-
var
|
|
332
|
-
return ((
|
|
330
|
+
clearTimeout: function(t) {
|
|
331
|
+
var n = de.delegate;
|
|
332
|
+
return ((n == null ? void 0 : n.clearTimeout) || clearTimeout)(t);
|
|
333
333
|
},
|
|
334
334
|
delegate: void 0
|
|
335
335
|
};
|
|
336
|
-
function
|
|
337
|
-
|
|
338
|
-
throw
|
|
336
|
+
function he(t) {
|
|
337
|
+
de.setTimeout(function() {
|
|
338
|
+
throw t;
|
|
339
339
|
});
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function q() {
|
|
342
342
|
}
|
|
343
|
-
function
|
|
344
|
-
|
|
343
|
+
function L(t) {
|
|
344
|
+
t();
|
|
345
345
|
}
|
|
346
|
-
var W = function(
|
|
347
|
-
|
|
348
|
-
function
|
|
349
|
-
var r =
|
|
350
|
-
return r.isStopped = !1, e ? (r.destination = e,
|
|
346
|
+
var W = function(t) {
|
|
347
|
+
S(n, t);
|
|
348
|
+
function n(e) {
|
|
349
|
+
var r = t.call(this) || this;
|
|
350
|
+
return r.isStopped = !1, e ? (r.destination = e, le(e) && e.add(r)) : r.destination = He, r;
|
|
351
351
|
}
|
|
352
|
-
return
|
|
353
|
-
return new
|
|
354
|
-
},
|
|
352
|
+
return n.create = function(e, r, i) {
|
|
353
|
+
return new B(e, r, i);
|
|
354
|
+
}, n.prototype.next = function(e) {
|
|
355
355
|
this.isStopped || this._next(e);
|
|
356
|
-
},
|
|
356
|
+
}, n.prototype.error = function(e) {
|
|
357
357
|
this.isStopped || (this.isStopped = !0, this._error(e));
|
|
358
|
-
},
|
|
358
|
+
}, n.prototype.complete = function() {
|
|
359
359
|
this.isStopped || (this.isStopped = !0, this._complete());
|
|
360
|
-
},
|
|
361
|
-
this.closed || (this.isStopped = !0,
|
|
362
|
-
},
|
|
360
|
+
}, n.prototype.unsubscribe = function() {
|
|
361
|
+
this.closed || (this.isStopped = !0, t.prototype.unsubscribe.call(this), this.destination = null);
|
|
362
|
+
}, n.prototype._next = function(e) {
|
|
363
363
|
this.destination.next(e);
|
|
364
|
-
},
|
|
364
|
+
}, n.prototype._error = function(e) {
|
|
365
365
|
try {
|
|
366
366
|
this.destination.error(e);
|
|
367
367
|
} finally {
|
|
368
368
|
this.unsubscribe();
|
|
369
369
|
}
|
|
370
|
-
},
|
|
370
|
+
}, n.prototype._complete = function() {
|
|
371
371
|
try {
|
|
372
372
|
this.destination.complete();
|
|
373
373
|
} finally {
|
|
374
374
|
this.unsubscribe();
|
|
375
375
|
}
|
|
376
|
-
},
|
|
376
|
+
}, n;
|
|
377
377
|
}(D), Fe = function() {
|
|
378
|
-
function n
|
|
379
|
-
this.partialObserver =
|
|
378
|
+
function t(n) {
|
|
379
|
+
this.partialObserver = n;
|
|
380
380
|
}
|
|
381
|
-
return
|
|
381
|
+
return t.prototype.next = function(n) {
|
|
382
382
|
var e = this.partialObserver;
|
|
383
383
|
if (e.next)
|
|
384
384
|
try {
|
|
385
|
-
e.next(
|
|
385
|
+
e.next(n);
|
|
386
386
|
} catch (r) {
|
|
387
|
-
|
|
387
|
+
j(r);
|
|
388
388
|
}
|
|
389
|
-
},
|
|
389
|
+
}, t.prototype.error = function(n) {
|
|
390
390
|
var e = this.partialObserver;
|
|
391
391
|
if (e.error)
|
|
392
392
|
try {
|
|
393
|
-
e.error(
|
|
393
|
+
e.error(n);
|
|
394
394
|
} catch (r) {
|
|
395
|
-
|
|
395
|
+
j(r);
|
|
396
396
|
}
|
|
397
397
|
else
|
|
398
|
-
|
|
399
|
-
},
|
|
400
|
-
var
|
|
401
|
-
if (
|
|
398
|
+
j(n);
|
|
399
|
+
}, t.prototype.complete = function() {
|
|
400
|
+
var n = this.partialObserver;
|
|
401
|
+
if (n.complete)
|
|
402
402
|
try {
|
|
403
|
-
|
|
403
|
+
n.complete();
|
|
404
404
|
} catch (e) {
|
|
405
|
-
|
|
405
|
+
j(e);
|
|
406
406
|
}
|
|
407
|
-
},
|
|
408
|
-
}(),
|
|
409
|
-
|
|
410
|
-
function
|
|
411
|
-
var
|
|
407
|
+
}, t;
|
|
408
|
+
}(), B = function(t) {
|
|
409
|
+
S(n, t);
|
|
410
|
+
function n(e, r, i) {
|
|
411
|
+
var u = t.call(this) || this, o;
|
|
412
412
|
return v(e) || !e ? o = {
|
|
413
413
|
next: e ?? void 0,
|
|
414
414
|
error: r ?? void 0,
|
|
415
415
|
complete: i ?? void 0
|
|
416
|
-
} : o = e,
|
|
416
|
+
} : o = e, u.destination = new Fe(o), u;
|
|
417
417
|
}
|
|
418
|
-
return
|
|
418
|
+
return n;
|
|
419
419
|
}(W);
|
|
420
|
-
function
|
|
421
|
-
|
|
420
|
+
function j(t) {
|
|
421
|
+
he(t);
|
|
422
422
|
}
|
|
423
|
-
function Ke(
|
|
424
|
-
throw
|
|
423
|
+
function Ke(t) {
|
|
424
|
+
throw t;
|
|
425
425
|
}
|
|
426
426
|
var He = {
|
|
427
427
|
closed: !0,
|
|
428
|
-
next:
|
|
428
|
+
next: q,
|
|
429
429
|
error: Ke,
|
|
430
|
-
complete:
|
|
430
|
+
complete: q
|
|
431
431
|
}, X = function() {
|
|
432
432
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
433
433
|
}();
|
|
434
|
-
function
|
|
435
|
-
return
|
|
434
|
+
function ye(t) {
|
|
435
|
+
return t;
|
|
436
436
|
}
|
|
437
|
-
function
|
|
438
|
-
return
|
|
439
|
-
return
|
|
437
|
+
function Ve(t) {
|
|
438
|
+
return t.length === 0 ? ye : t.length === 1 ? t[0] : function(e) {
|
|
439
|
+
return t.reduce(function(r, i) {
|
|
440
440
|
return i(r);
|
|
441
441
|
}, e);
|
|
442
442
|
};
|
|
443
443
|
}
|
|
444
|
-
var
|
|
445
|
-
function n
|
|
446
|
-
|
|
444
|
+
var p = function() {
|
|
445
|
+
function t(n) {
|
|
446
|
+
n && (this._subscribe = n);
|
|
447
447
|
}
|
|
448
|
-
return
|
|
449
|
-
var e = new
|
|
450
|
-
return e.source = this, e.operator =
|
|
451
|
-
},
|
|
452
|
-
var i = this,
|
|
453
|
-
return
|
|
454
|
-
var o = i,
|
|
455
|
-
|
|
456
|
-
}),
|
|
457
|
-
},
|
|
448
|
+
return t.prototype.lift = function(n) {
|
|
449
|
+
var e = new t();
|
|
450
|
+
return e.source = this, e.operator = n, e;
|
|
451
|
+
}, t.prototype.subscribe = function(n, e, r) {
|
|
452
|
+
var i = this, u = Be(n) ? n : new B(n, e, r);
|
|
453
|
+
return L(function() {
|
|
454
|
+
var o = i, s = o.operator, c = o.source;
|
|
455
|
+
u.add(s ? s.call(u, c) : c ? i._subscribe(u) : i._trySubscribe(u));
|
|
456
|
+
}), u;
|
|
457
|
+
}, t.prototype._trySubscribe = function(n) {
|
|
458
458
|
try {
|
|
459
|
-
return this._subscribe(
|
|
459
|
+
return this._subscribe(n);
|
|
460
460
|
} catch (e) {
|
|
461
|
-
|
|
461
|
+
n.error(e);
|
|
462
462
|
}
|
|
463
|
-
},
|
|
463
|
+
}, t.prototype.forEach = function(n, e) {
|
|
464
464
|
var r = this;
|
|
465
|
-
return e =
|
|
466
|
-
var o = new
|
|
467
|
-
next: function(
|
|
465
|
+
return e = Q(e), new e(function(i, u) {
|
|
466
|
+
var o = new B({
|
|
467
|
+
next: function(s) {
|
|
468
468
|
try {
|
|
469
|
-
|
|
470
|
-
} catch (
|
|
471
|
-
|
|
469
|
+
n(s);
|
|
470
|
+
} catch (c) {
|
|
471
|
+
u(c), o.unsubscribe();
|
|
472
472
|
}
|
|
473
473
|
},
|
|
474
|
-
error:
|
|
474
|
+
error: u,
|
|
475
475
|
complete: i
|
|
476
476
|
});
|
|
477
477
|
r.subscribe(o);
|
|
478
478
|
});
|
|
479
|
-
},
|
|
479
|
+
}, t.prototype._subscribe = function(n) {
|
|
480
480
|
var e;
|
|
481
|
-
return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(
|
|
482
|
-
},
|
|
481
|
+
return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(n);
|
|
482
|
+
}, t.prototype[X] = function() {
|
|
483
483
|
return this;
|
|
484
|
-
},
|
|
485
|
-
for (var
|
|
486
|
-
|
|
487
|
-
return
|
|
488
|
-
},
|
|
484
|
+
}, t.prototype.pipe = function() {
|
|
485
|
+
for (var n = [], e = 0; e < arguments.length; e++)
|
|
486
|
+
n[e] = arguments[e];
|
|
487
|
+
return Ve(n)(this);
|
|
488
|
+
}, t.prototype.toPromise = function(n) {
|
|
489
489
|
var e = this;
|
|
490
|
-
return
|
|
491
|
-
var
|
|
490
|
+
return n = Q(n), new n(function(r, i) {
|
|
491
|
+
var u;
|
|
492
492
|
e.subscribe(function(o) {
|
|
493
|
-
return
|
|
493
|
+
return u = o;
|
|
494
494
|
}, function(o) {
|
|
495
495
|
return i(o);
|
|
496
496
|
}, function() {
|
|
497
|
-
return r(
|
|
497
|
+
return r(u);
|
|
498
498
|
});
|
|
499
499
|
});
|
|
500
|
-
},
|
|
501
|
-
return new n
|
|
502
|
-
},
|
|
500
|
+
}, t.create = function(n) {
|
|
501
|
+
return new t(n);
|
|
502
|
+
}, t;
|
|
503
503
|
}();
|
|
504
|
-
function
|
|
505
|
-
var
|
|
506
|
-
return (
|
|
504
|
+
function Q(t) {
|
|
505
|
+
var n;
|
|
506
|
+
return (n = t ?? Ge.Promise) !== null && n !== void 0 ? n : Promise;
|
|
507
507
|
}
|
|
508
|
-
function
|
|
509
|
-
return
|
|
508
|
+
function qe(t) {
|
|
509
|
+
return t && v(t.next) && v(t.error) && v(t.complete);
|
|
510
510
|
}
|
|
511
|
-
function
|
|
512
|
-
return
|
|
511
|
+
function Be(t) {
|
|
512
|
+
return t && t instanceof W || qe(t) && le(t);
|
|
513
513
|
}
|
|
514
|
-
function
|
|
515
|
-
return v(
|
|
514
|
+
function Ye(t) {
|
|
515
|
+
return v(t == null ? void 0 : t.lift);
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
return function(
|
|
519
|
-
if (
|
|
520
|
-
return
|
|
517
|
+
function C(t) {
|
|
518
|
+
return function(n) {
|
|
519
|
+
if (Ye(n))
|
|
520
|
+
return n.lift(function(e) {
|
|
521
521
|
try {
|
|
522
|
-
return
|
|
522
|
+
return t(e, this);
|
|
523
523
|
} catch (r) {
|
|
524
524
|
this.error(r);
|
|
525
525
|
}
|
|
@@ -527,28 +527,28 @@ function T(n) {
|
|
|
527
527
|
throw new TypeError("Unable to lift unknown Observable type");
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
|
-
function
|
|
531
|
-
return new
|
|
530
|
+
function O(t, n, e, r, i) {
|
|
531
|
+
return new We(t, n, e, r, i);
|
|
532
532
|
}
|
|
533
|
-
var
|
|
534
|
-
|
|
535
|
-
function
|
|
536
|
-
var
|
|
537
|
-
return
|
|
533
|
+
var We = function(t) {
|
|
534
|
+
S(n, t);
|
|
535
|
+
function n(e, r, i, u, o, s) {
|
|
536
|
+
var c = t.call(this, e) || this;
|
|
537
|
+
return c.onFinalize = o, c.shouldUnsubscribe = s, c._next = r ? function(a) {
|
|
538
538
|
try {
|
|
539
539
|
r(a);
|
|
540
540
|
} catch (l) {
|
|
541
541
|
e.error(l);
|
|
542
542
|
}
|
|
543
|
-
} :
|
|
543
|
+
} : t.prototype._next, c._error = u ? function(a) {
|
|
544
544
|
try {
|
|
545
|
-
|
|
545
|
+
u(a);
|
|
546
546
|
} catch (l) {
|
|
547
547
|
e.error(l);
|
|
548
548
|
} finally {
|
|
549
549
|
this.unsubscribe();
|
|
550
550
|
}
|
|
551
|
-
} :
|
|
551
|
+
} : t.prototype._error, c._complete = i ? function() {
|
|
552
552
|
try {
|
|
553
553
|
i();
|
|
554
554
|
} catch (a) {
|
|
@@ -556,160 +556,183 @@ var Be = function(n) {
|
|
|
556
556
|
} finally {
|
|
557
557
|
this.unsubscribe();
|
|
558
558
|
}
|
|
559
|
-
} :
|
|
559
|
+
} : t.prototype._complete, c;
|
|
560
560
|
}
|
|
561
|
-
return
|
|
561
|
+
return n.prototype.unsubscribe = function() {
|
|
562
562
|
var e;
|
|
563
563
|
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
|
|
564
564
|
var r = this.closed;
|
|
565
|
-
|
|
565
|
+
t.prototype.unsubscribe.call(this), !r && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
|
|
566
566
|
}
|
|
567
|
-
},
|
|
568
|
-
}(W),
|
|
567
|
+
}, n;
|
|
568
|
+
}(W), Xe = ce(function(t) {
|
|
569
569
|
return function() {
|
|
570
|
-
|
|
570
|
+
t(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
571
571
|
};
|
|
572
|
-
}),
|
|
573
|
-
|
|
574
|
-
function
|
|
575
|
-
var e =
|
|
572
|
+
}), z = function(t) {
|
|
573
|
+
S(n, t);
|
|
574
|
+
function n() {
|
|
575
|
+
var e = t.call(this) || this;
|
|
576
576
|
return e.closed = !1, e.currentObservers = null, e.observers = [], e.isStopped = !1, e.hasError = !1, e.thrownError = null, e;
|
|
577
577
|
}
|
|
578
|
-
return
|
|
579
|
-
var r = new
|
|
578
|
+
return n.prototype.lift = function(e) {
|
|
579
|
+
var r = new Z(this, this);
|
|
580
580
|
return r.operator = e, r;
|
|
581
|
-
},
|
|
581
|
+
}, n.prototype._throwIfClosed = function() {
|
|
582
582
|
if (this.closed)
|
|
583
|
-
throw new
|
|
584
|
-
},
|
|
583
|
+
throw new Xe();
|
|
584
|
+
}, n.prototype.next = function(e) {
|
|
585
585
|
var r = this;
|
|
586
|
-
|
|
587
|
-
var i,
|
|
586
|
+
L(function() {
|
|
587
|
+
var i, u;
|
|
588
588
|
if (r._throwIfClosed(), !r.isStopped) {
|
|
589
589
|
r.currentObservers || (r.currentObservers = Array.from(r.observers));
|
|
590
590
|
try {
|
|
591
|
-
for (var o =
|
|
592
|
-
var
|
|
593
|
-
|
|
591
|
+
for (var o = M(r.currentObservers), s = o.next(); !s.done; s = o.next()) {
|
|
592
|
+
var c = s.value;
|
|
593
|
+
c.next(e);
|
|
594
594
|
}
|
|
595
595
|
} catch (a) {
|
|
596
596
|
i = { error: a };
|
|
597
597
|
} finally {
|
|
598
598
|
try {
|
|
599
|
-
|
|
599
|
+
s && !s.done && (u = o.return) && u.call(o);
|
|
600
600
|
} finally {
|
|
601
601
|
if (i) throw i.error;
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
605
|
});
|
|
606
|
-
},
|
|
606
|
+
}, n.prototype.error = function(e) {
|
|
607
607
|
var r = this;
|
|
608
|
-
|
|
608
|
+
L(function() {
|
|
609
609
|
if (r._throwIfClosed(), !r.isStopped) {
|
|
610
610
|
r.hasError = r.isStopped = !0, r.thrownError = e;
|
|
611
611
|
for (var i = r.observers; i.length; )
|
|
612
612
|
i.shift().error(e);
|
|
613
613
|
}
|
|
614
614
|
});
|
|
615
|
-
},
|
|
615
|
+
}, n.prototype.complete = function() {
|
|
616
616
|
var e = this;
|
|
617
|
-
|
|
617
|
+
L(function() {
|
|
618
618
|
if (e._throwIfClosed(), !e.isStopped) {
|
|
619
619
|
e.isStopped = !0;
|
|
620
620
|
for (var r = e.observers; r.length; )
|
|
621
621
|
r.shift().complete();
|
|
622
622
|
}
|
|
623
623
|
});
|
|
624
|
-
},
|
|
624
|
+
}, n.prototype.unsubscribe = function() {
|
|
625
625
|
this.isStopped = this.closed = !0, this.observers = this.currentObservers = null;
|
|
626
|
-
}, Object.defineProperty(
|
|
626
|
+
}, Object.defineProperty(n.prototype, "observed", {
|
|
627
627
|
get: function() {
|
|
628
628
|
var e;
|
|
629
629
|
return ((e = this.observers) === null || e === void 0 ? void 0 : e.length) > 0;
|
|
630
630
|
},
|
|
631
631
|
enumerable: !1,
|
|
632
632
|
configurable: !0
|
|
633
|
-
}),
|
|
634
|
-
return this._throwIfClosed(),
|
|
635
|
-
},
|
|
633
|
+
}), n.prototype._trySubscribe = function(e) {
|
|
634
|
+
return this._throwIfClosed(), t.prototype._trySubscribe.call(this, e);
|
|
635
|
+
}, n.prototype._subscribe = function(e) {
|
|
636
636
|
return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
|
|
637
|
-
},
|
|
638
|
-
var r = this, i = this,
|
|
639
|
-
return
|
|
640
|
-
r.currentObservers = null,
|
|
637
|
+
}, n.prototype._innerSubscribe = function(e) {
|
|
638
|
+
var r = this, i = this, u = i.hasError, o = i.isStopped, s = i.observers;
|
|
639
|
+
return u || o ? fe : (this.currentObservers = null, s.push(e), new D(function() {
|
|
640
|
+
r.currentObservers = null, R(s, e);
|
|
641
641
|
}));
|
|
642
|
-
},
|
|
643
|
-
var r = this, i = r.hasError,
|
|
644
|
-
i ? e.error(
|
|
645
|
-
},
|
|
646
|
-
var e = new
|
|
642
|
+
}, n.prototype._checkFinalizedStatuses = function(e) {
|
|
643
|
+
var r = this, i = r.hasError, u = r.thrownError, o = r.isStopped;
|
|
644
|
+
i ? e.error(u) : o && e.complete();
|
|
645
|
+
}, n.prototype.asObservable = function() {
|
|
646
|
+
var e = new p();
|
|
647
647
|
return e.source = this, e;
|
|
648
|
-
},
|
|
649
|
-
return new
|
|
650
|
-
},
|
|
651
|
-
}(
|
|
652
|
-
|
|
653
|
-
function
|
|
654
|
-
var i =
|
|
648
|
+
}, n.create = function(e, r) {
|
|
649
|
+
return new Z(e, r);
|
|
650
|
+
}, n;
|
|
651
|
+
}(p), Z = function(t) {
|
|
652
|
+
S(n, t);
|
|
653
|
+
function n(e, r) {
|
|
654
|
+
var i = t.call(this) || this;
|
|
655
655
|
return i.destination = e, i.source = r, i;
|
|
656
656
|
}
|
|
657
|
-
return
|
|
657
|
+
return n.prototype.next = function(e) {
|
|
658
658
|
var r, i;
|
|
659
659
|
(i = (r = this.destination) === null || r === void 0 ? void 0 : r.next) === null || i === void 0 || i.call(r, e);
|
|
660
|
-
},
|
|
660
|
+
}, n.prototype.error = function(e) {
|
|
661
661
|
var r, i;
|
|
662
662
|
(i = (r = this.destination) === null || r === void 0 ? void 0 : r.error) === null || i === void 0 || i.call(r, e);
|
|
663
|
-
},
|
|
663
|
+
}, n.prototype.complete = function() {
|
|
664
664
|
var e, r;
|
|
665
665
|
(r = (e = this.destination) === null || e === void 0 ? void 0 : e.complete) === null || r === void 0 || r.call(e);
|
|
666
|
-
},
|
|
666
|
+
}, n.prototype._subscribe = function(e) {
|
|
667
667
|
var r, i;
|
|
668
|
-
return (i = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e)) !== null && i !== void 0 ? i :
|
|
669
|
-
},
|
|
670
|
-
}(
|
|
668
|
+
return (i = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e)) !== null && i !== void 0 ? i : fe;
|
|
669
|
+
}, n;
|
|
670
|
+
}(z), ee = function(t) {
|
|
671
|
+
S(n, t);
|
|
672
|
+
function n(e) {
|
|
673
|
+
var r = t.call(this) || this;
|
|
674
|
+
return r._value = e, r;
|
|
675
|
+
}
|
|
676
|
+
return Object.defineProperty(n.prototype, "value", {
|
|
677
|
+
get: function() {
|
|
678
|
+
return this.getValue();
|
|
679
|
+
},
|
|
680
|
+
enumerable: !1,
|
|
681
|
+
configurable: !0
|
|
682
|
+
}), n.prototype._subscribe = function(e) {
|
|
683
|
+
var r = t.prototype._subscribe.call(this, e);
|
|
684
|
+
return !r.closed && e.next(this._value), r;
|
|
685
|
+
}, n.prototype.getValue = function() {
|
|
686
|
+
var e = this, r = e.hasError, i = e.thrownError, u = e._value;
|
|
687
|
+
if (r)
|
|
688
|
+
throw i;
|
|
689
|
+
return this._throwIfClosed(), u;
|
|
690
|
+
}, n.prototype.next = function(e) {
|
|
691
|
+
t.prototype.next.call(this, this._value = e);
|
|
692
|
+
}, n;
|
|
693
|
+
}(z), ze = {
|
|
671
694
|
now: function() {
|
|
672
695
|
return Date.now();
|
|
673
696
|
},
|
|
674
697
|
delegate: void 0
|
|
675
|
-
},
|
|
676
|
-
|
|
677
|
-
function
|
|
678
|
-
return
|
|
698
|
+
}, Je = function(t) {
|
|
699
|
+
S(n, t);
|
|
700
|
+
function n(e, r) {
|
|
701
|
+
return t.call(this) || this;
|
|
679
702
|
}
|
|
680
|
-
return
|
|
703
|
+
return n.prototype.schedule = function(e, r) {
|
|
681
704
|
return this;
|
|
682
|
-
},
|
|
683
|
-
}(D),
|
|
684
|
-
setInterval: function(
|
|
705
|
+
}, n;
|
|
706
|
+
}(D), te = {
|
|
707
|
+
setInterval: function(t, n) {
|
|
685
708
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
686
709
|
e[r - 2] = arguments[r];
|
|
687
|
-
return setInterval.apply(void 0,
|
|
710
|
+
return setInterval.apply(void 0, N([t, n], U(e)));
|
|
688
711
|
},
|
|
689
|
-
clearInterval: function(
|
|
690
|
-
return clearInterval(
|
|
712
|
+
clearInterval: function(t) {
|
|
713
|
+
return clearInterval(t);
|
|
691
714
|
},
|
|
692
715
|
delegate: void 0
|
|
693
|
-
},
|
|
694
|
-
|
|
695
|
-
function
|
|
696
|
-
var i =
|
|
716
|
+
}, Qe = function(t) {
|
|
717
|
+
S(n, t);
|
|
718
|
+
function n(e, r) {
|
|
719
|
+
var i = t.call(this, e, r) || this;
|
|
697
720
|
return i.scheduler = e, i.work = r, i.pending = !1, i;
|
|
698
721
|
}
|
|
699
|
-
return
|
|
722
|
+
return n.prototype.schedule = function(e, r) {
|
|
700
723
|
var i;
|
|
701
724
|
if (r === void 0 && (r = 0), this.closed)
|
|
702
725
|
return this;
|
|
703
726
|
this.state = e;
|
|
704
|
-
var
|
|
705
|
-
return
|
|
706
|
-
},
|
|
707
|
-
return i === void 0 && (i = 0),
|
|
708
|
-
},
|
|
727
|
+
var u = this.id, o = this.scheduler;
|
|
728
|
+
return u != null && (this.id = this.recycleAsyncId(o, u, r)), this.pending = !0, this.delay = r, this.id = (i = this.id) !== null && i !== void 0 ? i : this.requestAsyncId(o, this.id, r), this;
|
|
729
|
+
}, n.prototype.requestAsyncId = function(e, r, i) {
|
|
730
|
+
return i === void 0 && (i = 0), te.setInterval(e.flush.bind(e, this), i);
|
|
731
|
+
}, n.prototype.recycleAsyncId = function(e, r, i) {
|
|
709
732
|
if (i === void 0 && (i = 0), i != null && this.delay === i && this.pending === !1)
|
|
710
733
|
return r;
|
|
711
|
-
r != null &&
|
|
712
|
-
},
|
|
734
|
+
r != null && te.clearInterval(r);
|
|
735
|
+
}, n.prototype.execute = function(e, r) {
|
|
713
736
|
if (this.closed)
|
|
714
737
|
return new Error("executing a cancelled action");
|
|
715
738
|
this.pending = !1;
|
|
@@ -717,36 +740,36 @@ var Be = function(n) {
|
|
|
717
740
|
if (i)
|
|
718
741
|
return i;
|
|
719
742
|
this.pending === !1 && this.id != null && (this.id = this.recycleAsyncId(this.scheduler, this.id, null));
|
|
720
|
-
},
|
|
721
|
-
var i = !1,
|
|
743
|
+
}, n.prototype._execute = function(e, r) {
|
|
744
|
+
var i = !1, u;
|
|
722
745
|
try {
|
|
723
746
|
this.work(e);
|
|
724
747
|
} catch (o) {
|
|
725
|
-
i = !0,
|
|
748
|
+
i = !0, u = o || new Error("Scheduled action threw falsy error");
|
|
726
749
|
}
|
|
727
750
|
if (i)
|
|
728
|
-
return this.unsubscribe(),
|
|
729
|
-
},
|
|
751
|
+
return this.unsubscribe(), u;
|
|
752
|
+
}, n.prototype.unsubscribe = function() {
|
|
730
753
|
if (!this.closed) {
|
|
731
|
-
var e = this, r = e.id, i = e.scheduler,
|
|
732
|
-
this.work = this.state = this.scheduler = null, this.pending = !1,
|
|
754
|
+
var e = this, r = e.id, i = e.scheduler, u = i.actions;
|
|
755
|
+
this.work = this.state = this.scheduler = null, this.pending = !1, R(u, this), r != null && (this.id = this.recycleAsyncId(i, r, null)), this.delay = null, t.prototype.unsubscribe.call(this);
|
|
733
756
|
}
|
|
734
|
-
},
|
|
735
|
-
}(
|
|
736
|
-
function n
|
|
737
|
-
e === void 0 && (e =
|
|
757
|
+
}, n;
|
|
758
|
+
}(Je), ne = function() {
|
|
759
|
+
function t(n, e) {
|
|
760
|
+
e === void 0 && (e = t.now), this.schedulerActionCtor = n, this.now = e;
|
|
738
761
|
}
|
|
739
|
-
return
|
|
740
|
-
return e === void 0 && (e = 0), new this.schedulerActionCtor(this,
|
|
741
|
-
},
|
|
742
|
-
}(),
|
|
743
|
-
|
|
744
|
-
function
|
|
745
|
-
r === void 0 && (r =
|
|
746
|
-
var i =
|
|
762
|
+
return t.prototype.schedule = function(n, e, r) {
|
|
763
|
+
return e === void 0 && (e = 0), new this.schedulerActionCtor(this, n).schedule(r, e);
|
|
764
|
+
}, t.now = ze.now, t;
|
|
765
|
+
}(), Ze = function(t) {
|
|
766
|
+
S(n, t);
|
|
767
|
+
function n(e, r) {
|
|
768
|
+
r === void 0 && (r = ne.now);
|
|
769
|
+
var i = t.call(this, e, r) || this;
|
|
747
770
|
return i.actions = [], i._active = !1, i;
|
|
748
771
|
}
|
|
749
|
-
return
|
|
772
|
+
return n.prototype.flush = function(e) {
|
|
750
773
|
var r = this.actions;
|
|
751
774
|
if (this._active) {
|
|
752
775
|
r.push(e);
|
|
@@ -763,58 +786,58 @@ var Be = function(n) {
|
|
|
763
786
|
e.unsubscribe();
|
|
764
787
|
throw i;
|
|
765
788
|
}
|
|
766
|
-
},
|
|
767
|
-
}(
|
|
768
|
-
return
|
|
789
|
+
}, n;
|
|
790
|
+
}(ne), ve = new Ze(Qe), et = ve, tt = new p(function(t) {
|
|
791
|
+
return t.complete();
|
|
769
792
|
});
|
|
770
|
-
function
|
|
771
|
-
return
|
|
793
|
+
function be(t) {
|
|
794
|
+
return t && v(t.schedule);
|
|
772
795
|
}
|
|
773
|
-
function
|
|
774
|
-
return
|
|
796
|
+
function nt(t) {
|
|
797
|
+
return t[t.length - 1];
|
|
775
798
|
}
|
|
776
|
-
function
|
|
777
|
-
return
|
|
799
|
+
function rt(t) {
|
|
800
|
+
return be(nt(t)) ? t.pop() : void 0;
|
|
778
801
|
}
|
|
779
|
-
var pe = function(
|
|
780
|
-
return
|
|
802
|
+
var pe = function(t) {
|
|
803
|
+
return t && typeof t.length == "number" && typeof t != "function";
|
|
781
804
|
};
|
|
782
|
-
function
|
|
783
|
-
return v(
|
|
805
|
+
function me(t) {
|
|
806
|
+
return v(t == null ? void 0 : t.then);
|
|
784
807
|
}
|
|
785
|
-
function
|
|
786
|
-
return v(
|
|
808
|
+
function we(t) {
|
|
809
|
+
return v(t[X]);
|
|
787
810
|
}
|
|
788
|
-
function ge(
|
|
789
|
-
return Symbol.asyncIterator && v(
|
|
811
|
+
function ge(t) {
|
|
812
|
+
return Symbol.asyncIterator && v(t == null ? void 0 : t[Symbol.asyncIterator]);
|
|
790
813
|
}
|
|
791
|
-
function
|
|
792
|
-
return new TypeError("You provided " + (
|
|
814
|
+
function Se(t) {
|
|
815
|
+
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.");
|
|
793
816
|
}
|
|
794
|
-
function
|
|
817
|
+
function it() {
|
|
795
818
|
return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
|
|
796
819
|
}
|
|
797
|
-
var
|
|
798
|
-
function
|
|
799
|
-
return v(
|
|
820
|
+
var Ee = it();
|
|
821
|
+
function Ie(t) {
|
|
822
|
+
return v(t == null ? void 0 : t[Ee]);
|
|
800
823
|
}
|
|
801
|
-
function
|
|
824
|
+
function xe(t) {
|
|
802
825
|
return Re(this, arguments, function() {
|
|
803
|
-
var e, r, i,
|
|
804
|
-
return
|
|
826
|
+
var e, r, i, u;
|
|
827
|
+
return ae(this, function(o) {
|
|
805
828
|
switch (o.label) {
|
|
806
829
|
case 0:
|
|
807
|
-
e =
|
|
830
|
+
e = t.getReader(), o.label = 1;
|
|
808
831
|
case 1:
|
|
809
832
|
o.trys.push([1, , 9, 10]), o.label = 2;
|
|
810
833
|
case 2:
|
|
811
|
-
return [4,
|
|
834
|
+
return [4, P(e.read())];
|
|
812
835
|
case 3:
|
|
813
|
-
return r = o.sent(), i = r.value,
|
|
836
|
+
return r = o.sent(), i = r.value, u = r.done, u ? [4, P(void 0)] : [3, 5];
|
|
814
837
|
case 4:
|
|
815
838
|
return [2, o.sent()];
|
|
816
839
|
case 5:
|
|
817
|
-
return [4,
|
|
840
|
+
return [4, P(i)];
|
|
818
841
|
case 6:
|
|
819
842
|
return [4, o.sent()];
|
|
820
843
|
case 7:
|
|
@@ -829,108 +852,108 @@ function Ie(n) {
|
|
|
829
852
|
});
|
|
830
853
|
});
|
|
831
854
|
}
|
|
832
|
-
function Oe(
|
|
833
|
-
return v(
|
|
834
|
-
}
|
|
835
|
-
function
|
|
836
|
-
if (
|
|
837
|
-
return
|
|
838
|
-
if (
|
|
839
|
-
if (
|
|
840
|
-
return
|
|
841
|
-
if (pe(
|
|
842
|
-
return
|
|
843
|
-
if (
|
|
844
|
-
return
|
|
845
|
-
if (ge(
|
|
846
|
-
return
|
|
847
|
-
if (
|
|
848
|
-
return
|
|
849
|
-
if (Oe(
|
|
850
|
-
return
|
|
855
|
+
function Oe(t) {
|
|
856
|
+
return v(t == null ? void 0 : t.getReader);
|
|
857
|
+
}
|
|
858
|
+
function A(t) {
|
|
859
|
+
if (t instanceof p)
|
|
860
|
+
return t;
|
|
861
|
+
if (t != null) {
|
|
862
|
+
if (we(t))
|
|
863
|
+
return ut(t);
|
|
864
|
+
if (pe(t))
|
|
865
|
+
return ot(t);
|
|
866
|
+
if (me(t))
|
|
867
|
+
return st(t);
|
|
868
|
+
if (ge(t))
|
|
869
|
+
return Ae(t);
|
|
870
|
+
if (Ie(t))
|
|
871
|
+
return at(t);
|
|
872
|
+
if (Oe(t))
|
|
873
|
+
return ct(t);
|
|
851
874
|
}
|
|
852
|
-
throw
|
|
875
|
+
throw Se(t);
|
|
853
876
|
}
|
|
854
|
-
function
|
|
855
|
-
return new
|
|
856
|
-
var e =
|
|
877
|
+
function ut(t) {
|
|
878
|
+
return new p(function(n) {
|
|
879
|
+
var e = t[X]();
|
|
857
880
|
if (v(e.subscribe))
|
|
858
|
-
return e.subscribe(
|
|
881
|
+
return e.subscribe(n);
|
|
859
882
|
throw new TypeError("Provided object does not correctly implement Symbol.observable");
|
|
860
883
|
});
|
|
861
884
|
}
|
|
862
|
-
function
|
|
863
|
-
return new
|
|
864
|
-
for (var e = 0; e <
|
|
865
|
-
|
|
866
|
-
|
|
885
|
+
function ot(t) {
|
|
886
|
+
return new p(function(n) {
|
|
887
|
+
for (var e = 0; e < t.length && !n.closed; e++)
|
|
888
|
+
n.next(t[e]);
|
|
889
|
+
n.complete();
|
|
867
890
|
});
|
|
868
891
|
}
|
|
869
|
-
function
|
|
870
|
-
return new
|
|
871
|
-
|
|
872
|
-
|
|
892
|
+
function st(t) {
|
|
893
|
+
return new p(function(n) {
|
|
894
|
+
t.then(function(e) {
|
|
895
|
+
n.closed || (n.next(e), n.complete());
|
|
873
896
|
}, function(e) {
|
|
874
|
-
return
|
|
875
|
-
}).then(null,
|
|
897
|
+
return n.error(e);
|
|
898
|
+
}).then(null, he);
|
|
876
899
|
});
|
|
877
900
|
}
|
|
878
|
-
function
|
|
879
|
-
return new
|
|
901
|
+
function at(t) {
|
|
902
|
+
return new p(function(n) {
|
|
880
903
|
var e, r;
|
|
881
904
|
try {
|
|
882
|
-
for (var i =
|
|
883
|
-
var o =
|
|
884
|
-
if (
|
|
905
|
+
for (var i = M(t), u = i.next(); !u.done; u = i.next()) {
|
|
906
|
+
var o = u.value;
|
|
907
|
+
if (n.next(o), n.closed)
|
|
885
908
|
return;
|
|
886
909
|
}
|
|
887
|
-
} catch (
|
|
888
|
-
e = { error:
|
|
910
|
+
} catch (s) {
|
|
911
|
+
e = { error: s };
|
|
889
912
|
} finally {
|
|
890
913
|
try {
|
|
891
|
-
|
|
914
|
+
u && !u.done && (r = i.return) && r.call(i);
|
|
892
915
|
} finally {
|
|
893
916
|
if (e) throw e.error;
|
|
894
917
|
}
|
|
895
918
|
}
|
|
896
|
-
|
|
919
|
+
n.complete();
|
|
897
920
|
});
|
|
898
921
|
}
|
|
899
|
-
function
|
|
900
|
-
return new
|
|
901
|
-
|
|
902
|
-
return
|
|
922
|
+
function Ae(t) {
|
|
923
|
+
return new p(function(n) {
|
|
924
|
+
ft(t, n).catch(function(e) {
|
|
925
|
+
return n.error(e);
|
|
903
926
|
});
|
|
904
927
|
});
|
|
905
928
|
}
|
|
906
|
-
function
|
|
907
|
-
return xe(
|
|
929
|
+
function ct(t) {
|
|
930
|
+
return Ae(xe(t));
|
|
908
931
|
}
|
|
909
|
-
function
|
|
910
|
-
var e, r, i,
|
|
911
|
-
return
|
|
912
|
-
var o,
|
|
913
|
-
return
|
|
914
|
-
switch (
|
|
932
|
+
function ft(t, n) {
|
|
933
|
+
var e, r, i, u;
|
|
934
|
+
return Ne(this, void 0, void 0, function() {
|
|
935
|
+
var o, s;
|
|
936
|
+
return ae(this, function(c) {
|
|
937
|
+
switch (c.label) {
|
|
915
938
|
case 0:
|
|
916
|
-
|
|
939
|
+
c.trys.push([0, 5, 6, 11]), e = $e(t), c.label = 1;
|
|
917
940
|
case 1:
|
|
918
941
|
return [4, e.next()];
|
|
919
942
|
case 2:
|
|
920
|
-
if (r =
|
|
921
|
-
if (o = r.value,
|
|
943
|
+
if (r = c.sent(), !!r.done) return [3, 4];
|
|
944
|
+
if (o = r.value, n.next(o), n.closed)
|
|
922
945
|
return [2];
|
|
923
|
-
|
|
946
|
+
c.label = 3;
|
|
924
947
|
case 3:
|
|
925
948
|
return [3, 1];
|
|
926
949
|
case 4:
|
|
927
950
|
return [3, 11];
|
|
928
951
|
case 5:
|
|
929
|
-
return
|
|
952
|
+
return s = c.sent(), i = { error: s }, [3, 11];
|
|
930
953
|
case 6:
|
|
931
|
-
return
|
|
954
|
+
return c.trys.push([6, , 9, 10]), r && !r.done && (u = e.return) ? [4, u.call(e)] : [3, 8];
|
|
932
955
|
case 7:
|
|
933
|
-
|
|
956
|
+
c.sent(), c.label = 8;
|
|
934
957
|
case 8:
|
|
935
958
|
return [3, 10];
|
|
936
959
|
case 9:
|
|
@@ -939,83 +962,83 @@ function fn(n, t) {
|
|
|
939
962
|
case 10:
|
|
940
963
|
return [7];
|
|
941
964
|
case 11:
|
|
942
|
-
return
|
|
965
|
+
return n.complete(), [2];
|
|
943
966
|
}
|
|
944
967
|
});
|
|
945
968
|
});
|
|
946
969
|
}
|
|
947
|
-
function
|
|
970
|
+
function T(t, n, e, r, i) {
|
|
948
971
|
r === void 0 && (r = 0), i === void 0 && (i = !1);
|
|
949
|
-
var
|
|
950
|
-
e(), i ?
|
|
972
|
+
var u = n.schedule(function() {
|
|
973
|
+
e(), i ? t.add(this.schedule(null, r)) : this.unsubscribe();
|
|
951
974
|
}, r);
|
|
952
|
-
if (
|
|
953
|
-
return
|
|
975
|
+
if (t.add(u), !i)
|
|
976
|
+
return u;
|
|
954
977
|
}
|
|
955
|
-
function
|
|
956
|
-
return
|
|
957
|
-
e.subscribe(
|
|
958
|
-
return
|
|
978
|
+
function _e(t, n) {
|
|
979
|
+
return n === void 0 && (n = 0), C(function(e, r) {
|
|
980
|
+
e.subscribe(O(r, function(i) {
|
|
981
|
+
return T(r, t, function() {
|
|
959
982
|
return r.next(i);
|
|
960
|
-
},
|
|
983
|
+
}, n);
|
|
961
984
|
}, function() {
|
|
962
|
-
return
|
|
985
|
+
return T(r, t, function() {
|
|
963
986
|
return r.complete();
|
|
964
|
-
},
|
|
987
|
+
}, n);
|
|
965
988
|
}, function(i) {
|
|
966
|
-
return
|
|
989
|
+
return T(r, t, function() {
|
|
967
990
|
return r.error(i);
|
|
968
|
-
},
|
|
991
|
+
}, n);
|
|
969
992
|
}));
|
|
970
993
|
});
|
|
971
994
|
}
|
|
972
|
-
function
|
|
973
|
-
return
|
|
974
|
-
r.add(
|
|
995
|
+
function Te(t, n) {
|
|
996
|
+
return n === void 0 && (n = 0), C(function(e, r) {
|
|
997
|
+
r.add(t.schedule(function() {
|
|
975
998
|
return e.subscribe(r);
|
|
976
|
-
},
|
|
999
|
+
}, n));
|
|
977
1000
|
});
|
|
978
1001
|
}
|
|
979
|
-
function
|
|
980
|
-
return
|
|
1002
|
+
function lt(t, n) {
|
|
1003
|
+
return A(t).pipe(Te(n), _e(n));
|
|
981
1004
|
}
|
|
982
|
-
function
|
|
983
|
-
return
|
|
1005
|
+
function dt(t, n) {
|
|
1006
|
+
return A(t).pipe(Te(n), _e(n));
|
|
984
1007
|
}
|
|
985
|
-
function
|
|
986
|
-
return new
|
|
1008
|
+
function ht(t, n) {
|
|
1009
|
+
return new p(function(e) {
|
|
987
1010
|
var r = 0;
|
|
988
|
-
return
|
|
989
|
-
r ===
|
|
1011
|
+
return n.schedule(function() {
|
|
1012
|
+
r === t.length ? e.complete() : (e.next(t[r++]), e.closed || this.schedule());
|
|
990
1013
|
});
|
|
991
1014
|
});
|
|
992
1015
|
}
|
|
993
|
-
function
|
|
994
|
-
return new
|
|
1016
|
+
function yt(t, n) {
|
|
1017
|
+
return new p(function(e) {
|
|
995
1018
|
var r;
|
|
996
|
-
return
|
|
997
|
-
r =
|
|
998
|
-
var i,
|
|
1019
|
+
return T(e, n, function() {
|
|
1020
|
+
r = t[Ee](), T(e, n, function() {
|
|
1021
|
+
var i, u, o;
|
|
999
1022
|
try {
|
|
1000
|
-
i = r.next(),
|
|
1001
|
-
} catch (
|
|
1002
|
-
e.error(
|
|
1023
|
+
i = r.next(), u = i.value, o = i.done;
|
|
1024
|
+
} catch (s) {
|
|
1025
|
+
e.error(s);
|
|
1003
1026
|
return;
|
|
1004
1027
|
}
|
|
1005
|
-
o ? e.complete() : e.next(
|
|
1028
|
+
o ? e.complete() : e.next(u);
|
|
1006
1029
|
}, 0, !0);
|
|
1007
1030
|
}), function() {
|
|
1008
1031
|
return v(r == null ? void 0 : r.return) && r.return();
|
|
1009
1032
|
};
|
|
1010
1033
|
});
|
|
1011
1034
|
}
|
|
1012
|
-
function
|
|
1013
|
-
if (!
|
|
1035
|
+
function Ce(t, n) {
|
|
1036
|
+
if (!t)
|
|
1014
1037
|
throw new Error("Iterable cannot be null");
|
|
1015
|
-
return new
|
|
1016
|
-
|
|
1017
|
-
var r =
|
|
1018
|
-
|
|
1038
|
+
return new p(function(e) {
|
|
1039
|
+
T(e, n, function() {
|
|
1040
|
+
var r = t[Symbol.asyncIterator]();
|
|
1041
|
+
T(e, n, function() {
|
|
1019
1042
|
r.next().then(function(i) {
|
|
1020
1043
|
i.done ? e.complete() : e.next(i.value);
|
|
1021
1044
|
});
|
|
@@ -1023,187 +1046,187 @@ function Me(n, t) {
|
|
|
1023
1046
|
});
|
|
1024
1047
|
});
|
|
1025
1048
|
}
|
|
1026
|
-
function
|
|
1027
|
-
return
|
|
1028
|
-
}
|
|
1029
|
-
function
|
|
1030
|
-
if (
|
|
1031
|
-
if (
|
|
1032
|
-
return
|
|
1033
|
-
if (pe(
|
|
1034
|
-
return
|
|
1035
|
-
if (
|
|
1036
|
-
return
|
|
1037
|
-
if (ge(
|
|
1038
|
-
return
|
|
1039
|
-
if (
|
|
1040
|
-
return
|
|
1041
|
-
if (Oe(
|
|
1042
|
-
return
|
|
1049
|
+
function vt(t, n) {
|
|
1050
|
+
return Ce(xe(t), n);
|
|
1051
|
+
}
|
|
1052
|
+
function bt(t, n) {
|
|
1053
|
+
if (t != null) {
|
|
1054
|
+
if (we(t))
|
|
1055
|
+
return lt(t, n);
|
|
1056
|
+
if (pe(t))
|
|
1057
|
+
return ht(t, n);
|
|
1058
|
+
if (me(t))
|
|
1059
|
+
return dt(t, n);
|
|
1060
|
+
if (ge(t))
|
|
1061
|
+
return Ce(t, n);
|
|
1062
|
+
if (Ie(t))
|
|
1063
|
+
return yt(t, n);
|
|
1064
|
+
if (Oe(t))
|
|
1065
|
+
return vt(t, n);
|
|
1043
1066
|
}
|
|
1044
|
-
throw
|
|
1067
|
+
throw Se(t);
|
|
1045
1068
|
}
|
|
1046
|
-
function
|
|
1047
|
-
return
|
|
1069
|
+
function pt(t, n) {
|
|
1070
|
+
return n ? bt(t, n) : A(t);
|
|
1048
1071
|
}
|
|
1049
|
-
function
|
|
1050
|
-
for (var
|
|
1051
|
-
n
|
|
1052
|
-
var e =
|
|
1053
|
-
return
|
|
1072
|
+
function mt() {
|
|
1073
|
+
for (var t = [], n = 0; n < arguments.length; n++)
|
|
1074
|
+
t[n] = arguments[n];
|
|
1075
|
+
var e = rt(t);
|
|
1076
|
+
return pt(t, e);
|
|
1054
1077
|
}
|
|
1055
|
-
function
|
|
1056
|
-
return
|
|
1078
|
+
function wt(t) {
|
|
1079
|
+
return t instanceof Date && !isNaN(t);
|
|
1057
1080
|
}
|
|
1058
|
-
function
|
|
1059
|
-
return
|
|
1081
|
+
function Pe(t, n) {
|
|
1082
|
+
return C(function(e, r) {
|
|
1060
1083
|
var i = 0;
|
|
1061
|
-
e.subscribe(
|
|
1062
|
-
r.next(
|
|
1084
|
+
e.subscribe(O(r, function(u) {
|
|
1085
|
+
r.next(t.call(n, u, i++));
|
|
1063
1086
|
}));
|
|
1064
1087
|
});
|
|
1065
1088
|
}
|
|
1066
|
-
function
|
|
1067
|
-
var
|
|
1068
|
-
h && !
|
|
1089
|
+
function gt(t, n, e, r, i, u, o, s) {
|
|
1090
|
+
var c = [], a = 0, l = 0, h = !1, b = function() {
|
|
1091
|
+
h && !c.length && !a && n.complete();
|
|
1069
1092
|
}, f = function(d) {
|
|
1070
|
-
return a < r ? y(d) :
|
|
1093
|
+
return a < r ? y(d) : c.push(d);
|
|
1071
1094
|
}, y = function(d) {
|
|
1072
1095
|
a++;
|
|
1073
|
-
var
|
|
1074
|
-
|
|
1075
|
-
|
|
1096
|
+
var w = !1;
|
|
1097
|
+
A(e(d, l++)).subscribe(O(n, function(g) {
|
|
1098
|
+
n.next(g);
|
|
1076
1099
|
}, function() {
|
|
1077
|
-
|
|
1100
|
+
w = !0;
|
|
1078
1101
|
}, void 0, function() {
|
|
1079
|
-
if (
|
|
1102
|
+
if (w)
|
|
1080
1103
|
try {
|
|
1081
1104
|
a--;
|
|
1082
|
-
for (var
|
|
1083
|
-
var
|
|
1084
|
-
o || y(
|
|
1085
|
-
};
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
} catch (
|
|
1089
|
-
|
|
1105
|
+
for (var g = function() {
|
|
1106
|
+
var _ = c.shift();
|
|
1107
|
+
o || y(_);
|
|
1108
|
+
}; c.length && a < r; )
|
|
1109
|
+
g();
|
|
1110
|
+
b();
|
|
1111
|
+
} catch (_) {
|
|
1112
|
+
n.error(_);
|
|
1090
1113
|
}
|
|
1091
1114
|
}));
|
|
1092
1115
|
};
|
|
1093
|
-
return
|
|
1094
|
-
h = !0,
|
|
1116
|
+
return t.subscribe(O(n, f, function() {
|
|
1117
|
+
h = !0, b();
|
|
1095
1118
|
})), function() {
|
|
1096
1119
|
};
|
|
1097
1120
|
}
|
|
1098
|
-
function
|
|
1099
|
-
return e === void 0 && (e = 1 / 0), v(
|
|
1100
|
-
return
|
|
1101
|
-
return
|
|
1102
|
-
})(
|
|
1103
|
-
}, e) : (typeof
|
|
1104
|
-
return
|
|
1121
|
+
function $(t, n, e) {
|
|
1122
|
+
return e === void 0 && (e = 1 / 0), v(n) ? $(function(r, i) {
|
|
1123
|
+
return Pe(function(u, o) {
|
|
1124
|
+
return n(r, u, i, o);
|
|
1125
|
+
})(A(t(r, i)));
|
|
1126
|
+
}, e) : (typeof n == "number" && (e = n), C(function(r, i) {
|
|
1127
|
+
return gt(r, i, t, e);
|
|
1105
1128
|
}));
|
|
1106
1129
|
}
|
|
1107
|
-
function
|
|
1108
|
-
|
|
1130
|
+
function Me(t, n, e) {
|
|
1131
|
+
t === void 0 && (t = 0), e === void 0 && (e = et);
|
|
1109
1132
|
var r = -1;
|
|
1110
|
-
return
|
|
1111
|
-
var
|
|
1112
|
-
|
|
1133
|
+
return n != null && (be(n) ? e = n : r = n), new p(function(i) {
|
|
1134
|
+
var u = wt(t) ? +t - e.now() : t;
|
|
1135
|
+
u < 0 && (u = 0);
|
|
1113
1136
|
var o = 0;
|
|
1114
1137
|
return e.schedule(function() {
|
|
1115
1138
|
i.closed || (i.next(o++), 0 <= r ? this.schedule(void 0, r) : i.complete());
|
|
1116
|
-
},
|
|
1139
|
+
}, u);
|
|
1117
1140
|
});
|
|
1118
1141
|
}
|
|
1119
|
-
function
|
|
1120
|
-
return v(
|
|
1142
|
+
function St(t, n) {
|
|
1143
|
+
return v(n) ? $(t, n, 1) : $(t, 1);
|
|
1121
1144
|
}
|
|
1122
|
-
function
|
|
1123
|
-
return
|
|
1124
|
-
return
|
|
1125
|
-
} :
|
|
1145
|
+
function Et(t) {
|
|
1146
|
+
return t <= 0 ? function() {
|
|
1147
|
+
return tt;
|
|
1148
|
+
} : C(function(n, e) {
|
|
1126
1149
|
var r = 0;
|
|
1127
|
-
|
|
1128
|
-
++r <=
|
|
1150
|
+
n.subscribe(O(e, function(i) {
|
|
1151
|
+
++r <= t && (e.next(i), t <= r && e.complete());
|
|
1129
1152
|
}));
|
|
1130
1153
|
});
|
|
1131
1154
|
}
|
|
1132
|
-
function
|
|
1133
|
-
return
|
|
1134
|
-
return
|
|
1155
|
+
function It(t) {
|
|
1156
|
+
return Pe(function() {
|
|
1157
|
+
return t;
|
|
1135
1158
|
});
|
|
1136
1159
|
}
|
|
1137
|
-
function
|
|
1138
|
-
return
|
|
1139
|
-
return
|
|
1160
|
+
function xt(t, n) {
|
|
1161
|
+
return $(function(e, r) {
|
|
1162
|
+
return A(t(e, r)).pipe(Et(1), It(e));
|
|
1140
1163
|
});
|
|
1141
1164
|
}
|
|
1142
|
-
function
|
|
1143
|
-
|
|
1144
|
-
var e =
|
|
1145
|
-
return
|
|
1165
|
+
function Ot(t, n) {
|
|
1166
|
+
n === void 0 && (n = ve);
|
|
1167
|
+
var e = Me(t, n);
|
|
1168
|
+
return xt(function() {
|
|
1146
1169
|
return e;
|
|
1147
1170
|
});
|
|
1148
1171
|
}
|
|
1149
|
-
function
|
|
1150
|
-
var
|
|
1151
|
-
|
|
1152
|
-
count:
|
|
1172
|
+
function re(t) {
|
|
1173
|
+
var n;
|
|
1174
|
+
n = {
|
|
1175
|
+
count: t
|
|
1153
1176
|
};
|
|
1154
|
-
var e =
|
|
1155
|
-
return r <= 0 ?
|
|
1177
|
+
var e = n.count, r = e === void 0 ? 1 / 0 : e, i = n.delay, u = n.resetOnSuccess, o = u === void 0 ? !1 : u;
|
|
1178
|
+
return r <= 0 ? ye : C(function(s, c) {
|
|
1156
1179
|
var a = 0, l, h = function() {
|
|
1157
|
-
var
|
|
1158
|
-
l =
|
|
1159
|
-
o && (a = 0),
|
|
1180
|
+
var b = !1;
|
|
1181
|
+
l = s.subscribe(O(c, function(f) {
|
|
1182
|
+
o && (a = 0), c.next(f);
|
|
1160
1183
|
}, void 0, function(f) {
|
|
1161
1184
|
if (a++ < r) {
|
|
1162
1185
|
var y = function() {
|
|
1163
|
-
l ? (l.unsubscribe(), l = null, h()) :
|
|
1186
|
+
l ? (l.unsubscribe(), l = null, h()) : b = !0;
|
|
1164
1187
|
};
|
|
1165
1188
|
if (i != null) {
|
|
1166
|
-
var d = typeof i == "number" ?
|
|
1167
|
-
|
|
1189
|
+
var d = typeof i == "number" ? Me(i) : A(i(f, a)), w = O(c, function() {
|
|
1190
|
+
w.unsubscribe(), y();
|
|
1168
1191
|
}, function() {
|
|
1169
|
-
|
|
1192
|
+
c.complete();
|
|
1170
1193
|
});
|
|
1171
|
-
d.subscribe(
|
|
1194
|
+
d.subscribe(w);
|
|
1172
1195
|
} else
|
|
1173
1196
|
y();
|
|
1174
1197
|
} else
|
|
1175
|
-
|
|
1176
|
-
})),
|
|
1198
|
+
c.error(f);
|
|
1199
|
+
})), b && (l.unsubscribe(), l = null, h());
|
|
1177
1200
|
};
|
|
1178
1201
|
h();
|
|
1179
1202
|
});
|
|
1180
1203
|
}
|
|
1181
|
-
function
|
|
1182
|
-
return
|
|
1183
|
-
|
|
1204
|
+
function ie(t) {
|
|
1205
|
+
return C(function(n, e) {
|
|
1206
|
+
A(t).subscribe(O(e, function() {
|
|
1184
1207
|
return e.complete();
|
|
1185
|
-
},
|
|
1208
|
+
}, q)), !e.closed && n.subscribe(e);
|
|
1186
1209
|
});
|
|
1187
1210
|
}
|
|
1188
|
-
async function
|
|
1189
|
-
const e =
|
|
1211
|
+
async function At(t, n) {
|
|
1212
|
+
const e = t.getReader();
|
|
1190
1213
|
let r;
|
|
1191
1214
|
for (; !(r = await e.read()).done; )
|
|
1192
|
-
|
|
1215
|
+
n(r.value);
|
|
1193
1216
|
}
|
|
1194
|
-
function
|
|
1195
|
-
let
|
|
1217
|
+
function _t(t) {
|
|
1218
|
+
let n, e, r, i = !1;
|
|
1196
1219
|
return function(o) {
|
|
1197
|
-
|
|
1198
|
-
const
|
|
1199
|
-
let
|
|
1200
|
-
for (; e <
|
|
1201
|
-
i && (
|
|
1220
|
+
n === void 0 ? (n = o, e = 0, r = -1) : n = Ct(n, o);
|
|
1221
|
+
const s = n.length;
|
|
1222
|
+
let c = 0;
|
|
1223
|
+
for (; e < s; ) {
|
|
1224
|
+
i && (n[e] === 10 && (c = ++e), i = !1);
|
|
1202
1225
|
let a = -1;
|
|
1203
|
-
for (; e <
|
|
1204
|
-
switch (
|
|
1226
|
+
for (; e < s && a === -1; ++e)
|
|
1227
|
+
switch (n[e]) {
|
|
1205
1228
|
case 58:
|
|
1206
|
-
r === -1 && (r = e -
|
|
1229
|
+
r === -1 && (r = e - c);
|
|
1207
1230
|
break;
|
|
1208
1231
|
case 13:
|
|
1209
1232
|
i = !0;
|
|
@@ -1213,20 +1236,20 @@ function _n(n) {
|
|
|
1213
1236
|
}
|
|
1214
1237
|
if (a === -1)
|
|
1215
1238
|
break;
|
|
1216
|
-
n
|
|
1239
|
+
t(n.subarray(c, a), r), c = e, r = -1;
|
|
1217
1240
|
}
|
|
1218
|
-
|
|
1241
|
+
c === s ? n = void 0 : c !== 0 && (n = n.subarray(c), e -= c);
|
|
1219
1242
|
};
|
|
1220
1243
|
}
|
|
1221
|
-
function
|
|
1222
|
-
let r =
|
|
1244
|
+
function Tt(t, n, e) {
|
|
1245
|
+
let r = ue();
|
|
1223
1246
|
const i = new TextDecoder();
|
|
1224
|
-
return function(o,
|
|
1247
|
+
return function(o, s) {
|
|
1225
1248
|
if (o.length === 0)
|
|
1226
|
-
e == null || e(r), r =
|
|
1227
|
-
else if (
|
|
1228
|
-
const
|
|
1229
|
-
switch (
|
|
1249
|
+
e == null || e(r), r = ue();
|
|
1250
|
+
else if (s > 0) {
|
|
1251
|
+
const c = i.decode(o.subarray(0, s)), a = s + (o[s + 1] === 32 ? 2 : 1), l = i.decode(o.subarray(a));
|
|
1252
|
+
switch (c) {
|
|
1230
1253
|
case "data":
|
|
1231
1254
|
r.data = r.data ? r.data + `
|
|
1232
1255
|
` + l : l;
|
|
@@ -1235,21 +1258,21 @@ function Mn(n, t, e) {
|
|
|
1235
1258
|
r.event = l;
|
|
1236
1259
|
break;
|
|
1237
1260
|
case "id":
|
|
1238
|
-
|
|
1261
|
+
t(r.id = l);
|
|
1239
1262
|
break;
|
|
1240
1263
|
case "retry":
|
|
1241
1264
|
const h = parseInt(l, 10);
|
|
1242
|
-
isNaN(h) ||
|
|
1265
|
+
isNaN(h) || n(r.retry = h);
|
|
1243
1266
|
break;
|
|
1244
1267
|
}
|
|
1245
1268
|
}
|
|
1246
1269
|
};
|
|
1247
1270
|
}
|
|
1248
|
-
function
|
|
1249
|
-
const e = new Uint8Array(
|
|
1250
|
-
return e.set(
|
|
1271
|
+
function Ct(t, n) {
|
|
1272
|
+
const e = new Uint8Array(t.length + n.length);
|
|
1273
|
+
return e.set(t), e.set(n, t.length), e;
|
|
1251
1274
|
}
|
|
1252
|
-
function
|
|
1275
|
+
function ue() {
|
|
1253
1276
|
return {
|
|
1254
1277
|
data: "",
|
|
1255
1278
|
event: "",
|
|
@@ -1257,75 +1280,75 @@ function re() {
|
|
|
1257
1280
|
retry: void 0
|
|
1258
1281
|
};
|
|
1259
1282
|
}
|
|
1260
|
-
var
|
|
1283
|
+
var Pt = function(t, n) {
|
|
1261
1284
|
var e = {};
|
|
1262
|
-
for (var r in
|
|
1263
|
-
if (
|
|
1264
|
-
for (var i = 0, r = Object.getOwnPropertySymbols(
|
|
1265
|
-
|
|
1285
|
+
for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && n.indexOf(r) < 0 && (e[r] = t[r]);
|
|
1286
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1287
|
+
for (var i = 0, r = Object.getOwnPropertySymbols(t); i < r.length; i++)
|
|
1288
|
+
n.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[i]) && (e[r[i]] = t[r[i]]);
|
|
1266
1289
|
return e;
|
|
1267
1290
|
};
|
|
1268
|
-
const
|
|
1269
|
-
function
|
|
1270
|
-
var { signal: e, headers: r, onopen: i, onmessage:
|
|
1271
|
-
return new Promise((h,
|
|
1291
|
+
const Y = "text/event-stream", Mt = 1e3, oe = "last-event-id";
|
|
1292
|
+
function Dt(t, n) {
|
|
1293
|
+
var { signal: e, headers: r, onopen: i, onmessage: u, onclose: o, onerror: s, openWhenHidden: c, fetch: a } = n, l = Pt(n, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
1294
|
+
return new Promise((h, b) => {
|
|
1272
1295
|
const f = Object.assign({}, r);
|
|
1273
|
-
f.accept || (f.accept =
|
|
1296
|
+
f.accept || (f.accept = Y);
|
|
1274
1297
|
let y;
|
|
1275
1298
|
function d() {
|
|
1276
|
-
y.abort(), document.hidden ||
|
|
1299
|
+
y.abort(), document.hidden || G();
|
|
1277
1300
|
}
|
|
1278
|
-
|
|
1279
|
-
let
|
|
1280
|
-
function
|
|
1281
|
-
document.removeEventListener("visibilitychange", d), window.clearTimeout(
|
|
1301
|
+
c || document.addEventListener("visibilitychange", d);
|
|
1302
|
+
let w = Mt, g = 0;
|
|
1303
|
+
function _() {
|
|
1304
|
+
document.removeEventListener("visibilitychange", d), window.clearTimeout(g), y.abort();
|
|
1282
1305
|
}
|
|
1283
1306
|
e == null || e.addEventListener("abort", () => {
|
|
1284
|
-
|
|
1307
|
+
_(), h();
|
|
1285
1308
|
});
|
|
1286
|
-
const
|
|
1287
|
-
async function
|
|
1288
|
-
var
|
|
1309
|
+
const De = a ?? window.fetch, ke = i ?? kt;
|
|
1310
|
+
async function G() {
|
|
1311
|
+
var F;
|
|
1289
1312
|
y = new AbortController();
|
|
1290
1313
|
try {
|
|
1291
|
-
const k = await
|
|
1292
|
-
await
|
|
1293
|
-
E ? f[
|
|
1314
|
+
const k = await De(t, Object.assign(Object.assign({}, l), { headers: f, signal: y.signal }));
|
|
1315
|
+
await ke(k), await At(k.body, _t(Tt((E) => {
|
|
1316
|
+
E ? f[oe] = E : delete f[oe];
|
|
1294
1317
|
}, (E) => {
|
|
1295
|
-
|
|
1296
|
-
},
|
|
1318
|
+
w = E;
|
|
1319
|
+
}, u))), o == null || o(), _(), h();
|
|
1297
1320
|
} catch (k) {
|
|
1298
1321
|
if (!y.signal.aborted)
|
|
1299
1322
|
try {
|
|
1300
|
-
const E = (
|
|
1301
|
-
window.clearTimeout(
|
|
1323
|
+
const E = (F = s == null ? void 0 : s(k)) !== null && F !== void 0 ? F : w;
|
|
1324
|
+
window.clearTimeout(g), g = window.setTimeout(G, E);
|
|
1302
1325
|
} catch (E) {
|
|
1303
|
-
|
|
1326
|
+
_(), b(E);
|
|
1304
1327
|
}
|
|
1305
1328
|
}
|
|
1306
1329
|
}
|
|
1307
|
-
|
|
1330
|
+
G();
|
|
1308
1331
|
});
|
|
1309
1332
|
}
|
|
1310
|
-
function
|
|
1311
|
-
const
|
|
1312
|
-
if (!(
|
|
1313
|
-
throw new Error(`Expected content-type to be ${
|
|
1333
|
+
function kt(t) {
|
|
1334
|
+
const n = t.headers.get("content-type");
|
|
1335
|
+
if (!(n != null && n.startsWith(Y)))
|
|
1336
|
+
throw new Error(`Expected content-type to be ${Y}, Actual: ${n}`);
|
|
1314
1337
|
}
|
|
1315
|
-
function se(
|
|
1316
|
-
const { endpoint:
|
|
1317
|
-
return new
|
|
1318
|
-
const
|
|
1319
|
-
return
|
|
1338
|
+
function se(t) {
|
|
1339
|
+
const { endpoint: n, apiKey: e, payload: r } = t;
|
|
1340
|
+
return new p((i) => {
|
|
1341
|
+
const u = new AbortController();
|
|
1342
|
+
return Dt(n, {
|
|
1320
1343
|
method: "POST",
|
|
1321
1344
|
headers: {
|
|
1322
1345
|
"X-API-KEY": e,
|
|
1323
1346
|
"Content-Type": "application/json"
|
|
1324
1347
|
},
|
|
1325
1348
|
body: r ? JSON.stringify(r) : void 0,
|
|
1326
|
-
signal:
|
|
1349
|
+
signal: u.signal,
|
|
1327
1350
|
onopen: async (o) => {
|
|
1328
|
-
o.ok || (i.error(o),
|
|
1351
|
+
o.ok || (i.error(o), u.abort());
|
|
1329
1352
|
},
|
|
1330
1353
|
onmessage: (o) => {
|
|
1331
1354
|
i.next(JSON.parse(o.data));
|
|
@@ -1334,203 +1357,213 @@ function se(n) {
|
|
|
1334
1357
|
i.complete();
|
|
1335
1358
|
},
|
|
1336
1359
|
onerror: (o) => {
|
|
1337
|
-
throw i.error(o),
|
|
1360
|
+
throw i.error(o), u.abort(), o;
|
|
1338
1361
|
}
|
|
1339
1362
|
}), () => {
|
|
1340
|
-
|
|
1363
|
+
u.abort();
|
|
1341
1364
|
};
|
|
1342
1365
|
});
|
|
1343
1366
|
}
|
|
1344
|
-
class
|
|
1345
|
-
constructor(
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
if (!
|
|
1367
|
+
class Lt {
|
|
1368
|
+
constructor(n) {
|
|
1369
|
+
m(this, "apiKey");
|
|
1370
|
+
m(this, "endpoint");
|
|
1371
|
+
m(this, "destroy$", new z());
|
|
1372
|
+
m(this, "transformSsePayload");
|
|
1373
|
+
if (!n.apiKey)
|
|
1351
1374
|
throw new Error("apiKey must be required");
|
|
1352
|
-
if (!
|
|
1353
|
-
throw new Error("
|
|
1354
|
-
this.apiKey =
|
|
1375
|
+
if (!n.endpoint)
|
|
1376
|
+
throw new Error("endpoint must be required");
|
|
1377
|
+
this.apiKey = n.apiKey, this.endpoint = n.endpoint, this.transformSsePayload = n.transformSsePayload;
|
|
1355
1378
|
}
|
|
1356
|
-
|
|
1357
|
-
var
|
|
1358
|
-
(
|
|
1379
|
+
resetChannel(n, e) {
|
|
1380
|
+
var i, u;
|
|
1381
|
+
(i = e == null ? void 0 : e.onSseStart) == null || i.call(e);
|
|
1382
|
+
const r = {
|
|
1383
|
+
action: H.RESET_CHANNEL,
|
|
1384
|
+
customChannelId: n.customChannelId,
|
|
1385
|
+
customMessageId: n == null ? void 0 : n.customMessageId,
|
|
1386
|
+
text: ""
|
|
1387
|
+
};
|
|
1388
|
+
se({
|
|
1359
1389
|
apiKey: this.apiKey,
|
|
1360
1390
|
endpoint: this.endpoint,
|
|
1361
|
-
payload:
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
customMessageId: t == null ? void 0 : t.customMessageId,
|
|
1365
|
-
text: ""
|
|
1366
|
-
}
|
|
1367
|
-
}).pipe(te(this.destroy$), ne(3)).subscribe({
|
|
1368
|
-
next: (i) => {
|
|
1391
|
+
payload: ((u = this.transformSsePayload) == null ? void 0 : u.call(this, r)) ?? r
|
|
1392
|
+
}).pipe(ie(this.destroy$), re(3)).subscribe({
|
|
1393
|
+
next: (o) => {
|
|
1369
1394
|
var s;
|
|
1370
|
-
(s = e == null ? void 0 : e.onSseMessage) == null || s.call(e,
|
|
1395
|
+
(s = e == null ? void 0 : e.onSseMessage) == null || s.call(e, o);
|
|
1371
1396
|
},
|
|
1372
|
-
error: (
|
|
1397
|
+
error: (o) => {
|
|
1373
1398
|
var s;
|
|
1374
|
-
(s = e == null ? void 0 : e.onSseError) == null || s.call(e,
|
|
1399
|
+
(s = e == null ? void 0 : e.onSseError) == null || s.call(e, o);
|
|
1375
1400
|
},
|
|
1376
1401
|
complete: () => {
|
|
1377
|
-
var
|
|
1378
|
-
(
|
|
1402
|
+
var o;
|
|
1403
|
+
(o = e == null ? void 0 : e.onSseCompleted) == null || o.call(e);
|
|
1379
1404
|
}
|
|
1380
1405
|
});
|
|
1381
1406
|
}
|
|
1382
|
-
sendMessage(
|
|
1383
|
-
var
|
|
1384
|
-
|
|
1407
|
+
sendMessage(n, e) {
|
|
1408
|
+
var i, u;
|
|
1409
|
+
(i = e == null ? void 0 : e.onSseStart) == null || i.call(e);
|
|
1410
|
+
const r = {
|
|
1411
|
+
action: H.NONE,
|
|
1412
|
+
customChannelId: n.customChannelId,
|
|
1413
|
+
customMessageId: n == null ? void 0 : n.customMessageId,
|
|
1414
|
+
text: n.text
|
|
1415
|
+
};
|
|
1416
|
+
se({
|
|
1385
1417
|
apiKey: this.apiKey,
|
|
1386
1418
|
endpoint: this.endpoint,
|
|
1387
|
-
payload:
|
|
1388
|
-
action: $.NONE,
|
|
1389
|
-
customChannelId: t.customChannelId,
|
|
1390
|
-
customMessageId: t == null ? void 0 : t.customMessageId,
|
|
1391
|
-
text: t.text
|
|
1392
|
-
}
|
|
1419
|
+
payload: ((u = this.transformSsePayload) == null ? void 0 : u.call(this, r)) ?? r
|
|
1393
1420
|
}).pipe(
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1421
|
+
St((o) => mt(o).pipe(Ot((e == null ? void 0 : e.delayTime) ?? 50))),
|
|
1422
|
+
ie(this.destroy$),
|
|
1423
|
+
re(3)
|
|
1397
1424
|
).subscribe({
|
|
1398
|
-
next: (
|
|
1425
|
+
next: (o) => {
|
|
1399
1426
|
var s;
|
|
1400
|
-
(s = e == null ? void 0 : e.onSseMessage) == null || s.call(e,
|
|
1427
|
+
(s = e == null ? void 0 : e.onSseMessage) == null || s.call(e, o);
|
|
1401
1428
|
},
|
|
1402
|
-
error: (
|
|
1429
|
+
error: (o) => {
|
|
1403
1430
|
var s;
|
|
1404
|
-
(s = e == null ? void 0 : e.onSseError) == null || s.call(e,
|
|
1431
|
+
(s = e == null ? void 0 : e.onSseError) == null || s.call(e, o);
|
|
1405
1432
|
},
|
|
1406
1433
|
complete: () => {
|
|
1407
|
-
var
|
|
1408
|
-
(
|
|
1434
|
+
var o;
|
|
1435
|
+
(o = e == null ? void 0 : e.onSseCompleted) == null || o.call(e);
|
|
1409
1436
|
}
|
|
1410
1437
|
});
|
|
1411
1438
|
}
|
|
1412
1439
|
close() {
|
|
1413
|
-
this.
|
|
1440
|
+
this.destroy$.next(), this.destroy$.complete();
|
|
1414
1441
|
}
|
|
1415
1442
|
}
|
|
1416
|
-
class
|
|
1417
|
-
constructor(
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
this
|
|
1443
|
+
class Ut {
|
|
1444
|
+
constructor(n) {
|
|
1445
|
+
m(this, "client");
|
|
1446
|
+
m(this, "isConnecting$");
|
|
1447
|
+
m(this, "conversation$");
|
|
1448
|
+
m(this, "customChannelId");
|
|
1449
|
+
if (!n.client)
|
|
1450
|
+
throw new Error("client must be required");
|
|
1451
|
+
if (!n.customChannelId)
|
|
1452
|
+
throw new Error("customChannelId must be required");
|
|
1453
|
+
this.client = n.client, this.customChannelId = n.customChannelId, this.isConnecting$ = new ee(!1), this.conversation$ = new ee(n.conversation);
|
|
1421
1454
|
}
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1455
|
+
sendMessage(n, e) {
|
|
1456
|
+
this.isConnecting$.next(!0);
|
|
1457
|
+
const r = n.customMessageId ?? crypto.randomUUID();
|
|
1458
|
+
this.conversation$.next(
|
|
1459
|
+
this.conversation$.value.pushMessage({
|
|
1460
|
+
type: "user",
|
|
1461
|
+
messageId: r,
|
|
1462
|
+
text: n.text,
|
|
1463
|
+
time: /* @__PURE__ */ new Date()
|
|
1464
|
+
})
|
|
1465
|
+
), this.client.sendMessage(
|
|
1466
|
+
{
|
|
1467
|
+
customChannelId: this.customChannelId,
|
|
1468
|
+
customMessageId: r,
|
|
1469
|
+
text: n.text
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
onSseStart: e == null ? void 0 : e.onSseStart,
|
|
1473
|
+
onSseMessage: (i) => {
|
|
1474
|
+
var u;
|
|
1475
|
+
(u = e == null ? void 0 : e.onSseMessage) == null || u.call(e, i), this.conversation$.next(this.conversation$.value.onMessage(i));
|
|
1476
|
+
},
|
|
1477
|
+
onSseError: (i) => {
|
|
1478
|
+
var u;
|
|
1479
|
+
(u = e == null ? void 0 : e.onSseError) == null || u.call(e, i), this.isConnecting$.next(!1);
|
|
1480
|
+
},
|
|
1481
|
+
onSseCompleted: () => {
|
|
1482
|
+
var i;
|
|
1483
|
+
(i = e == null ? void 0 : e.onSseCompleted) == null || i.call(e), this.isConnecting$.next(!1);
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
);
|
|
1427
1487
|
}
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
return r.set(e.messageId, e), new w({
|
|
1431
|
-
messages: r,
|
|
1432
|
-
typingMessages: t.typingMessages
|
|
1433
|
-
});
|
|
1488
|
+
close() {
|
|
1489
|
+
this.isConnecting$.complete(), this.conversation$.complete();
|
|
1434
1490
|
}
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1491
|
+
}
|
|
1492
|
+
class x {
|
|
1493
|
+
constructor({ messages: n, showDebugMessage: e }) {
|
|
1494
|
+
m(this, "showDebugMessage", !1);
|
|
1495
|
+
m(this, "messages", null);
|
|
1496
|
+
this.messages = n, this.showDebugMessage = e ?? !1;
|
|
1497
|
+
}
|
|
1498
|
+
pushMessage(n) {
|
|
1499
|
+
const e = new Map(this.messages);
|
|
1500
|
+
return e.set(n.messageId, n), new x({ messages: e });
|
|
1501
|
+
}
|
|
1502
|
+
onMessage(n) {
|
|
1503
|
+
switch (n.eventType) {
|
|
1504
|
+
case I.MESSAGE_START:
|
|
1505
|
+
return this.onMessageStart(
|
|
1506
|
+
n
|
|
1443
1507
|
);
|
|
1444
|
-
case
|
|
1445
|
-
return
|
|
1446
|
-
|
|
1447
|
-
e,
|
|
1448
|
-
{ showDebugMessage: i }
|
|
1508
|
+
case I.MESSAGE_DELTA:
|
|
1509
|
+
return this.onMessageDelta(
|
|
1510
|
+
n
|
|
1449
1511
|
);
|
|
1450
|
-
case
|
|
1451
|
-
return
|
|
1452
|
-
|
|
1453
|
-
e,
|
|
1454
|
-
{ showDebugMessage: i }
|
|
1512
|
+
case I.MESSAGE_COMPLETE:
|
|
1513
|
+
return this.onMessageComplete(
|
|
1514
|
+
n
|
|
1455
1515
|
);
|
|
1456
|
-
case g.DONE:
|
|
1457
|
-
return t.onMessageDone(t);
|
|
1458
1516
|
default:
|
|
1459
|
-
return
|
|
1517
|
+
return this;
|
|
1460
1518
|
}
|
|
1461
1519
|
}
|
|
1462
|
-
onMessageStart(
|
|
1463
|
-
const
|
|
1464
|
-
return
|
|
1465
|
-
messages: t.messages,
|
|
1466
|
-
typingMessages: s
|
|
1467
|
-
}) : (s.set(i.messageId, {
|
|
1520
|
+
onMessageStart(n) {
|
|
1521
|
+
const e = n.fact.messageStart.message, r = new Map(this.messages);
|
|
1522
|
+
return e.isDebug && !this.showDebugMessage || r != null && r.has(e.messageId) ? new x({ messages: r }) : (r.set(e.messageId, {
|
|
1468
1523
|
type: "bot",
|
|
1469
|
-
eventType:
|
|
1524
|
+
eventType: I.MESSAGE_START,
|
|
1470
1525
|
isTyping: !0,
|
|
1471
1526
|
typingText: "",
|
|
1472
|
-
messageId:
|
|
1473
|
-
message:
|
|
1527
|
+
messageId: e.messageId,
|
|
1528
|
+
message: e,
|
|
1474
1529
|
time: /* @__PURE__ */ new Date()
|
|
1475
|
-
}), new
|
|
1476
|
-
messages: t.messages,
|
|
1477
|
-
typingMessages: s
|
|
1478
|
-
}));
|
|
1530
|
+
}), new x({ messages: r }));
|
|
1479
1531
|
}
|
|
1480
|
-
onMessageDelta(
|
|
1481
|
-
const
|
|
1482
|
-
if (
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
const u = `${(c == null ? void 0 : c.typingText) ?? ""}${i.text}`;
|
|
1488
|
-
return o.set(i.messageId, {
|
|
1532
|
+
onMessageDelta(n) {
|
|
1533
|
+
const e = n.fact.messageDelta.message, r = new Map(this.messages), i = r.get(e.messageId);
|
|
1534
|
+
if ((i == null ? void 0 : i.type) === "user") return this;
|
|
1535
|
+
if (e.isDebug && !this.showDebugMessage || (i == null ? void 0 : i.eventType) === I.MESSAGE_COMPLETE)
|
|
1536
|
+
return new x({ messages: r });
|
|
1537
|
+
const u = `${(i == null ? void 0 : i.typingText) ?? ""}${e.text}`;
|
|
1538
|
+
return r.set(e.messageId, {
|
|
1489
1539
|
type: "bot",
|
|
1490
|
-
eventType:
|
|
1540
|
+
eventType: I.MESSAGE_DELTA,
|
|
1491
1541
|
isTyping: !0,
|
|
1492
1542
|
typingText: u,
|
|
1493
|
-
messageId:
|
|
1494
|
-
message:
|
|
1543
|
+
messageId: e.messageId,
|
|
1544
|
+
message: e,
|
|
1495
1545
|
time: /* @__PURE__ */ new Date()
|
|
1496
|
-
}), new
|
|
1497
|
-
messages: t.messages,
|
|
1498
|
-
typingMessages: o
|
|
1499
|
-
});
|
|
1546
|
+
}), new x({ messages: r });
|
|
1500
1547
|
}
|
|
1501
|
-
onMessageComplete(
|
|
1502
|
-
const
|
|
1503
|
-
return
|
|
1504
|
-
messages: s,
|
|
1505
|
-
typingMessages: o
|
|
1506
|
-
}) : (s.set(i.messageId, {
|
|
1548
|
+
onMessageComplete(n) {
|
|
1549
|
+
const e = n.fact.messageComplete.message, r = new Map(this.messages);
|
|
1550
|
+
return e.isDebug && !this.showDebugMessage ? new x({ messages: r }) : (r.set(e.messageId, {
|
|
1507
1551
|
type: "bot",
|
|
1508
|
-
eventType:
|
|
1552
|
+
eventType: I.MESSAGE_COMPLETE,
|
|
1509
1553
|
isTyping: !1,
|
|
1510
1554
|
typingText: null,
|
|
1511
|
-
messageId:
|
|
1512
|
-
message:
|
|
1555
|
+
messageId: e.messageId,
|
|
1556
|
+
message: e,
|
|
1513
1557
|
time: /* @__PURE__ */ new Date()
|
|
1514
|
-
}),
|
|
1515
|
-
messages: s,
|
|
1516
|
-
typingMessages: o
|
|
1517
|
-
}));
|
|
1518
|
-
}
|
|
1519
|
-
onMessageDone(t) {
|
|
1520
|
-
const e = new Map(t.messages), r = new Map(t.typingMessages);
|
|
1521
|
-
return r.forEach((i, s) => {
|
|
1522
|
-
i.eventType === g.MESSAGE_COMPLETE && (e.set(i.messageId, i), r.delete(s));
|
|
1523
|
-
}), new w({
|
|
1524
|
-
messages: t.messages,
|
|
1525
|
-
typingMessages: r
|
|
1526
|
-
});
|
|
1558
|
+
}), new x({ messages: r }));
|
|
1527
1559
|
}
|
|
1528
1560
|
}
|
|
1529
1561
|
export {
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1562
|
+
Lt as AsgardServiceClient,
|
|
1563
|
+
Ut as Channel,
|
|
1564
|
+
x as Conversation,
|
|
1565
|
+
I as EventType,
|
|
1566
|
+
H as FetchSseAction,
|
|
1567
|
+
Ue as MessageTemplateType
|
|
1535
1568
|
};
|
|
1536
1569
|
//# sourceMappingURL=index.mjs.map
|