@asgard-js/core 0.2.36 → 0.2.37
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/constants/enum.d.ts +8 -1
- package/dist/constants/enum.d.ts.map +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +750 -721
- package/dist/index.mjs.map +1 -1
- package/dist/lib/channel.d.ts +2 -1
- package/dist/lib/channel.d.ts.map +1 -1
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/conversation.d.ts +6 -2
- package/dist/lib/conversation.d.ts.map +1 -1
- package/dist/types/client.d.ts +5 -1
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/sse-response.d.ts +17 -0
- package/dist/types/sse-response.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2,30 +2,30 @@ class de extends Error {
|
|
|
2
2
|
status;
|
|
3
3
|
statusText;
|
|
4
4
|
body;
|
|
5
|
-
constructor(e, t,
|
|
6
|
-
super(`HTTP ${e}: ${t}`), this.name = "HttpError", this.status = e, this.statusText = t, this.body =
|
|
5
|
+
constructor(e, t, r) {
|
|
6
|
+
super(`HTTP ${e}: ${t}`), this.name = "HttpError", this.status = e, this.statusText = t, this.body = r;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
9
|
+
function on(n) {
|
|
10
|
+
return n instanceof de;
|
|
11
11
|
}
|
|
12
|
-
var
|
|
13
|
-
return
|
|
14
|
-
t.__proto__ =
|
|
15
|
-
} || function(t,
|
|
16
|
-
for (var o in
|
|
17
|
-
},
|
|
12
|
+
var $ = /* @__PURE__ */ ((n) => (n.RESET_CHANNEL = "RESET_CHANNEL", n.NONE = "NONE", n.RESPONSE_TOOL_CALL_CONSENT = "RESPONSE_TOOL_CALL_CONSENT", n))($ || {}), d = /* @__PURE__ */ ((n) => (n.INIT = "asgard.run.init", n.PROCESS = "asgard.process", n.PROCESS_START = "asgard.process.start", n.PROCESS_COMPLETE = "asgard.process.complete", n.MESSAGE = "asgard.message", n.MESSAGE_START = "asgard.message.start", n.MESSAGE_DELTA = "asgard.message.delta", n.MESSAGE_COMPLETE = "asgard.message.complete", n.TOOL_CALL = "asgard.tool_call", n.TOOL_CALL_START = "asgard.tool_call.start", n.TOOL_CALL_COMPLETE = "asgard.tool_call.complete", n.TOOL_CALL_CONSENT = "asgard.tool_call.consent", n.DONE = "asgard.run.done", n.ERROR = "asgard.run.error", n))(d || {}), De = /* @__PURE__ */ ((n) => (n.ALLOW_ONCE = "ALLOW_ONCE", n.ALLOW_ALWAYS = "ALLOW_ALWAYS", n.DENY_ONCE = "DENY_ONCE", n))(De || {}), He = /* @__PURE__ */ ((n) => (n.TEXT = "TEXT", n.HINT = "HINT", n.BUTTON = "BUTTON", n.IMAGE = "IMAGE", n.VIDEO = "VIDEO", n.AUDIO = "AUDIO", n.LOCATION = "LOCATION", n.CAROUSEL = "CAROUSEL", n.CHART = "CHART", n.TABLE = "TABLE", n))(He || {}), B = function(n, e) {
|
|
13
|
+
return B = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) {
|
|
14
|
+
t.__proto__ = r;
|
|
15
|
+
} || function(t, r) {
|
|
16
|
+
for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && (t[o] = r[o]);
|
|
17
|
+
}, B(n, e);
|
|
18
18
|
};
|
|
19
|
-
function
|
|
19
|
+
function I(n, e) {
|
|
20
20
|
if (typeof e != "function" && e !== null)
|
|
21
21
|
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
22
|
-
|
|
22
|
+
B(n, e);
|
|
23
23
|
function t() {
|
|
24
|
-
this.constructor =
|
|
24
|
+
this.constructor = n;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
n.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Ge(n, e, t, r) {
|
|
29
29
|
function o(i) {
|
|
30
30
|
return i instanceof t ? i : new t(function(s) {
|
|
31
31
|
s(i);
|
|
@@ -34,29 +34,29 @@ function He(r, e, t, n) {
|
|
|
34
34
|
return new (t || (t = Promise))(function(i, s) {
|
|
35
35
|
function a(f) {
|
|
36
36
|
try {
|
|
37
|
-
u(
|
|
38
|
-
} catch (
|
|
39
|
-
s(
|
|
37
|
+
u(r.next(f));
|
|
38
|
+
} catch (p) {
|
|
39
|
+
s(p);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
function c(f) {
|
|
43
43
|
try {
|
|
44
|
-
u(
|
|
45
|
-
} catch (
|
|
46
|
-
s(
|
|
44
|
+
u(r.throw(f));
|
|
45
|
+
} catch (p) {
|
|
46
|
+
s(p);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
function u(f) {
|
|
50
50
|
f.done ? i(f.value) : o(f.value).then(a, c);
|
|
51
51
|
}
|
|
52
|
-
u((
|
|
52
|
+
u((r = r.apply(n, e || [])).next());
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
function he(
|
|
55
|
+
function he(n, e) {
|
|
56
56
|
var t = { label: 0, sent: function() {
|
|
57
57
|
if (i[0] & 1) throw i[1];
|
|
58
58
|
return i[1];
|
|
59
|
-
}, trys: [], ops: [] },
|
|
59
|
+
}, trys: [], ops: [] }, r, o, i, s = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
60
60
|
return s.next = a(0), s.throw = a(1), s.return = a(2), typeof Symbol == "function" && (s[Symbol.iterator] = function() {
|
|
61
61
|
return this;
|
|
62
62
|
}), s;
|
|
@@ -66,9 +66,9 @@ function he(r, e) {
|
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
function c(u) {
|
|
69
|
-
if (
|
|
69
|
+
if (r) throw new TypeError("Generator is already executing.");
|
|
70
70
|
for (; s && (s = 0, u[0] && (t = 0)), t; ) try {
|
|
71
|
-
if (
|
|
71
|
+
if (r = 1, o && (i = u[0] & 2 ? o.return : u[0] ? o.throw || ((i = o.return) && i.call(o), 0) : o.next) && !(i = i.call(o, u[1])).done) return i;
|
|
72
72
|
switch (o = 0, i && (u = [u[0] & 2, i.value]), u[0]) {
|
|
73
73
|
case 0:
|
|
74
74
|
case 1:
|
|
@@ -102,99 +102,99 @@ function he(r, e) {
|
|
|
102
102
|
i[2] && t.ops.pop(), t.trys.pop();
|
|
103
103
|
continue;
|
|
104
104
|
}
|
|
105
|
-
u = e.call(
|
|
105
|
+
u = e.call(n, t);
|
|
106
106
|
} catch (f) {
|
|
107
107
|
u = [6, f], o = 0;
|
|
108
108
|
} finally {
|
|
109
|
-
|
|
109
|
+
r = i = 0;
|
|
110
110
|
}
|
|
111
111
|
if (u[0] & 5) throw u[1];
|
|
112
112
|
return { value: u[0] ? u[1] : void 0, done: !0 };
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
var e = typeof Symbol == "function" && Symbol.iterator, t = e &&
|
|
117
|
-
if (t) return t.call(
|
|
118
|
-
if (
|
|
115
|
+
function P(n) {
|
|
116
|
+
var e = typeof Symbol == "function" && Symbol.iterator, t = e && n[e], r = 0;
|
|
117
|
+
if (t) return t.call(n);
|
|
118
|
+
if (n && typeof n.length == "number") return {
|
|
119
119
|
next: function() {
|
|
120
|
-
return
|
|
120
|
+
return n && r >= n.length && (n = void 0), { value: n && n[r++], done: !n };
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
123
|
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
var t = typeof Symbol == "function" &&
|
|
127
|
-
if (!t) return
|
|
128
|
-
var
|
|
125
|
+
function M(n, e) {
|
|
126
|
+
var t = typeof Symbol == "function" && n[Symbol.iterator];
|
|
127
|
+
if (!t) return n;
|
|
128
|
+
var r = t.call(n), o, i = [], s;
|
|
129
129
|
try {
|
|
130
|
-
for (; (e === void 0 || e-- > 0) && !(o =
|
|
130
|
+
for (; (e === void 0 || e-- > 0) && !(o = r.next()).done; ) i.push(o.value);
|
|
131
131
|
} catch (a) {
|
|
132
132
|
s = { error: a };
|
|
133
133
|
} finally {
|
|
134
134
|
try {
|
|
135
|
-
o && !o.done && (t =
|
|
135
|
+
o && !o.done && (t = r.return) && t.call(r);
|
|
136
136
|
} finally {
|
|
137
137
|
if (s) throw s.error;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
return i;
|
|
141
141
|
}
|
|
142
|
-
function R(
|
|
143
|
-
if (t || arguments.length === 2) for (var
|
|
144
|
-
(i || !(
|
|
145
|
-
return
|
|
142
|
+
function R(n, e, t) {
|
|
143
|
+
if (t || arguments.length === 2) for (var r = 0, o = e.length, i; r < o; r++)
|
|
144
|
+
(i || !(r in e)) && (i || (i = Array.prototype.slice.call(e, 0, r)), i[r] = e[r]);
|
|
145
|
+
return n.concat(i || Array.prototype.slice.call(e));
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
return this instanceof
|
|
147
|
+
function x(n) {
|
|
148
|
+
return this instanceof x ? (this.v = n, this) : new x(n);
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function Fe(n, e, t) {
|
|
151
151
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
152
|
-
var
|
|
152
|
+
var r = t.apply(n, e || []), o, i = [];
|
|
153
153
|
return o = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), a("next"), a("throw"), a("return", s), o[Symbol.asyncIterator] = function() {
|
|
154
154
|
return this;
|
|
155
155
|
}, o;
|
|
156
156
|
function s(l) {
|
|
157
157
|
return function(y) {
|
|
158
|
-
return Promise.resolve(y).then(l,
|
|
158
|
+
return Promise.resolve(y).then(l, p);
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
161
|
function a(l, y) {
|
|
162
|
-
|
|
163
|
-
return new Promise(function(
|
|
164
|
-
i.push([l,
|
|
162
|
+
r[l] && (o[l] = function(v) {
|
|
163
|
+
return new Promise(function(w, E) {
|
|
164
|
+
i.push([l, v, w, E]) > 1 || c(l, v);
|
|
165
165
|
});
|
|
166
166
|
}, y && (o[l] = y(o[l])));
|
|
167
167
|
}
|
|
168
168
|
function c(l, y) {
|
|
169
169
|
try {
|
|
170
|
-
u(
|
|
171
|
-
} catch (
|
|
172
|
-
|
|
170
|
+
u(r[l](y));
|
|
171
|
+
} catch (v) {
|
|
172
|
+
h(i[0][3], v);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
function u(l) {
|
|
176
|
-
l.value instanceof
|
|
176
|
+
l.value instanceof x ? Promise.resolve(l.value.v).then(f, p) : h(i[0][2], l);
|
|
177
177
|
}
|
|
178
178
|
function f(l) {
|
|
179
179
|
c("next", l);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function p(l) {
|
|
182
182
|
c("throw", l);
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function h(l, y) {
|
|
185
185
|
l(y), i.shift(), i.length && c(i[0][0], i[0][1]);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function Ve(n) {
|
|
189
189
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
190
|
-
var e =
|
|
191
|
-
return e ? e.call(
|
|
190
|
+
var e = n[Symbol.asyncIterator], t;
|
|
191
|
+
return e ? e.call(n) : (n = typeof P == "function" ? P(n) : n[Symbol.iterator](), t = {}, r("next"), r("throw"), r("return"), t[Symbol.asyncIterator] = function() {
|
|
192
192
|
return this;
|
|
193
193
|
}, t);
|
|
194
|
-
function
|
|
195
|
-
t[i] =
|
|
194
|
+
function r(i) {
|
|
195
|
+
t[i] = n[i] && function(s) {
|
|
196
196
|
return new Promise(function(a, c) {
|
|
197
|
-
s =
|
|
197
|
+
s = n[i](s), o(a, c, s.done, s.value);
|
|
198
198
|
});
|
|
199
199
|
};
|
|
200
200
|
}
|
|
@@ -204,48 +204,48 @@ function Fe(r) {
|
|
|
204
204
|
}, s);
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
function m(
|
|
208
|
-
return typeof
|
|
207
|
+
function m(n) {
|
|
208
|
+
return typeof n == "function";
|
|
209
209
|
}
|
|
210
|
-
function
|
|
211
|
-
var e = function(
|
|
212
|
-
Error.call(
|
|
213
|
-
}, t =
|
|
210
|
+
function pe(n) {
|
|
211
|
+
var e = function(r) {
|
|
212
|
+
Error.call(r), r.stack = new Error().stack;
|
|
213
|
+
}, t = n(e);
|
|
214
214
|
return t.prototype = Object.create(Error.prototype), t.prototype.constructor = t, t;
|
|
215
215
|
}
|
|
216
|
-
var
|
|
216
|
+
var K = pe(function(n) {
|
|
217
217
|
return function(t) {
|
|
218
|
-
|
|
219
|
-
` + t.map(function(
|
|
220
|
-
return o + 1 + ") " +
|
|
218
|
+
n(this), this.message = t ? t.length + ` errors occurred during unsubscription:
|
|
219
|
+
` + t.map(function(r, o) {
|
|
220
|
+
return o + 1 + ") " + r.toString();
|
|
221
221
|
}).join(`
|
|
222
222
|
`) : "", this.name = "UnsubscriptionError", this.errors = t;
|
|
223
223
|
};
|
|
224
224
|
});
|
|
225
|
-
function D(
|
|
226
|
-
if (
|
|
227
|
-
var t =
|
|
228
|
-
0 <= t &&
|
|
225
|
+
function D(n, e) {
|
|
226
|
+
if (n) {
|
|
227
|
+
var t = n.indexOf(e);
|
|
228
|
+
0 <= t && n.splice(t, 1);
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
var
|
|
232
|
-
function
|
|
231
|
+
var N = (function() {
|
|
232
|
+
function n(e) {
|
|
233
233
|
this.initialTeardown = e, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
234
234
|
}
|
|
235
|
-
return
|
|
236
|
-
var e, t,
|
|
235
|
+
return n.prototype.unsubscribe = function() {
|
|
236
|
+
var e, t, r, o, i;
|
|
237
237
|
if (!this.closed) {
|
|
238
238
|
this.closed = !0;
|
|
239
239
|
var s = this._parentage;
|
|
240
240
|
if (s)
|
|
241
241
|
if (this._parentage = null, Array.isArray(s))
|
|
242
242
|
try {
|
|
243
|
-
for (var a =
|
|
243
|
+
for (var a = P(s), c = a.next(); !c.done; c = a.next()) {
|
|
244
244
|
var u = c.value;
|
|
245
245
|
u.remove(this);
|
|
246
246
|
}
|
|
247
|
-
} catch (
|
|
248
|
-
e = { error:
|
|
247
|
+
} catch (v) {
|
|
248
|
+
e = { error: v };
|
|
249
249
|
} finally {
|
|
250
250
|
try {
|
|
251
251
|
c && !c.done && (t = a.return) && t.call(a);
|
|
@@ -259,101 +259,101 @@ var U = (function() {
|
|
|
259
259
|
if (m(f))
|
|
260
260
|
try {
|
|
261
261
|
f();
|
|
262
|
-
} catch (
|
|
263
|
-
i =
|
|
262
|
+
} catch (v) {
|
|
263
|
+
i = v instanceof K ? v.errors : [v];
|
|
264
264
|
}
|
|
265
|
-
var
|
|
266
|
-
if (
|
|
265
|
+
var p = this._finalizers;
|
|
266
|
+
if (p) {
|
|
267
267
|
this._finalizers = null;
|
|
268
268
|
try {
|
|
269
|
-
for (var
|
|
269
|
+
for (var h = P(p), l = h.next(); !l.done; l = h.next()) {
|
|
270
270
|
var y = l.value;
|
|
271
271
|
try {
|
|
272
|
-
|
|
273
|
-
} catch (
|
|
274
|
-
i = i ?? [],
|
|
272
|
+
ne(y);
|
|
273
|
+
} catch (v) {
|
|
274
|
+
i = i ?? [], v instanceof K ? i = R(R([], M(i)), M(v.errors)) : i.push(v);
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
} catch (
|
|
278
|
-
|
|
277
|
+
} catch (v) {
|
|
278
|
+
r = { error: v };
|
|
279
279
|
} finally {
|
|
280
280
|
try {
|
|
281
|
-
l && !l.done && (o =
|
|
281
|
+
l && !l.done && (o = h.return) && o.call(h);
|
|
282
282
|
} finally {
|
|
283
|
-
if (
|
|
283
|
+
if (r) throw r.error;
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
if (i)
|
|
288
|
-
throw new
|
|
288
|
+
throw new K(i);
|
|
289
289
|
}
|
|
290
|
-
},
|
|
290
|
+
}, n.prototype.add = function(e) {
|
|
291
291
|
var t;
|
|
292
292
|
if (e && e !== this)
|
|
293
293
|
if (this.closed)
|
|
294
|
-
|
|
294
|
+
ne(e);
|
|
295
295
|
else {
|
|
296
|
-
if (e instanceof
|
|
296
|
+
if (e instanceof n) {
|
|
297
297
|
if (e.closed || e._hasParent(this))
|
|
298
298
|
return;
|
|
299
299
|
e._addParent(this);
|
|
300
300
|
}
|
|
301
301
|
(this._finalizers = (t = this._finalizers) !== null && t !== void 0 ? t : []).push(e);
|
|
302
302
|
}
|
|
303
|
-
},
|
|
303
|
+
}, n.prototype._hasParent = function(e) {
|
|
304
304
|
var t = this._parentage;
|
|
305
305
|
return t === e || Array.isArray(t) && t.includes(e);
|
|
306
|
-
},
|
|
306
|
+
}, n.prototype._addParent = function(e) {
|
|
307
307
|
var t = this._parentage;
|
|
308
308
|
this._parentage = Array.isArray(t) ? (t.push(e), t) : t ? [t, e] : e;
|
|
309
|
-
},
|
|
309
|
+
}, n.prototype._removeParent = function(e) {
|
|
310
310
|
var t = this._parentage;
|
|
311
311
|
t === e ? this._parentage = null : Array.isArray(t) && D(t, e);
|
|
312
|
-
},
|
|
312
|
+
}, n.prototype.remove = function(e) {
|
|
313
313
|
var t = this._finalizers;
|
|
314
|
-
t && D(t, e), e instanceof
|
|
315
|
-
},
|
|
316
|
-
var e = new
|
|
314
|
+
t && D(t, e), e instanceof n && e._removeParent(this);
|
|
315
|
+
}, n.EMPTY = (function() {
|
|
316
|
+
var e = new n();
|
|
317
317
|
return e.closed = !0, e;
|
|
318
|
-
})(),
|
|
319
|
-
})(),
|
|
320
|
-
function ye(
|
|
321
|
-
return
|
|
318
|
+
})(), n;
|
|
319
|
+
})(), ve = N.EMPTY;
|
|
320
|
+
function ye(n) {
|
|
321
|
+
return n instanceof N || n && "closed" in n && m(n.remove) && m(n.add) && m(n.unsubscribe);
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
m(
|
|
323
|
+
function ne(n) {
|
|
324
|
+
m(n) ? n() : n.unsubscribe();
|
|
325
325
|
}
|
|
326
|
-
var
|
|
326
|
+
var qe = {
|
|
327
327
|
Promise: void 0
|
|
328
|
-
},
|
|
329
|
-
setTimeout: function(
|
|
330
|
-
for (var t = [],
|
|
331
|
-
t[
|
|
332
|
-
return setTimeout.apply(void 0, R([
|
|
328
|
+
}, Ke = {
|
|
329
|
+
setTimeout: function(n, e) {
|
|
330
|
+
for (var t = [], r = 2; r < arguments.length; r++)
|
|
331
|
+
t[r - 2] = arguments[r];
|
|
332
|
+
return setTimeout.apply(void 0, R([n, e], M(t)));
|
|
333
333
|
},
|
|
334
|
-
clearTimeout: function(
|
|
335
|
-
return clearTimeout(
|
|
334
|
+
clearTimeout: function(n) {
|
|
335
|
+
return clearTimeout(n);
|
|
336
336
|
},
|
|
337
337
|
delegate: void 0
|
|
338
338
|
};
|
|
339
|
-
function me(
|
|
340
|
-
|
|
341
|
-
throw
|
|
339
|
+
function me(n) {
|
|
340
|
+
Ke.setTimeout(function() {
|
|
341
|
+
throw n;
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
344
|
function W() {
|
|
345
345
|
}
|
|
346
|
-
function j(
|
|
347
|
-
|
|
346
|
+
function j(n) {
|
|
347
|
+
n();
|
|
348
348
|
}
|
|
349
|
-
var Q = (function(
|
|
350
|
-
|
|
349
|
+
var Q = (function(n) {
|
|
350
|
+
I(e, n);
|
|
351
351
|
function e(t) {
|
|
352
|
-
var
|
|
353
|
-
return
|
|
352
|
+
var r = n.call(this) || this;
|
|
353
|
+
return r.isStopped = !1, t ? (r.destination = t, ye(t) && t.add(r)) : r.destination = We, r;
|
|
354
354
|
}
|
|
355
|
-
return e.create = function(t,
|
|
356
|
-
return new X(t,
|
|
355
|
+
return e.create = function(t, r, o) {
|
|
356
|
+
return new X(t, r, o);
|
|
357
357
|
}, e.prototype.next = function(t) {
|
|
358
358
|
this.isStopped || this._next(t);
|
|
359
359
|
}, e.prototype.error = function(t) {
|
|
@@ -361,7 +361,7 @@ var Q = (function(r) {
|
|
|
361
361
|
}, e.prototype.complete = function() {
|
|
362
362
|
this.isStopped || (this.isStopped = !0, this._complete());
|
|
363
363
|
}, e.prototype.unsubscribe = function() {
|
|
364
|
-
this.closed || (this.isStopped = !0,
|
|
364
|
+
this.closed || (this.isStopped = !0, n.prototype.unsubscribe.call(this), this.destination = null);
|
|
365
365
|
}, e.prototype._next = function(t) {
|
|
366
366
|
this.destination.next(t);
|
|
367
367
|
}, e.prototype._error = function(t) {
|
|
@@ -377,56 +377,56 @@ var Q = (function(r) {
|
|
|
377
377
|
this.unsubscribe();
|
|
378
378
|
}
|
|
379
379
|
}, e;
|
|
380
|
-
})(
|
|
381
|
-
function
|
|
380
|
+
})(N), Ye = (function() {
|
|
381
|
+
function n(e) {
|
|
382
382
|
this.partialObserver = e;
|
|
383
383
|
}
|
|
384
|
-
return
|
|
384
|
+
return n.prototype.next = function(e) {
|
|
385
385
|
var t = this.partialObserver;
|
|
386
386
|
if (t.next)
|
|
387
387
|
try {
|
|
388
388
|
t.next(e);
|
|
389
|
-
} catch (
|
|
390
|
-
|
|
389
|
+
} catch (r) {
|
|
390
|
+
k(r);
|
|
391
391
|
}
|
|
392
|
-
},
|
|
392
|
+
}, n.prototype.error = function(e) {
|
|
393
393
|
var t = this.partialObserver;
|
|
394
394
|
if (t.error)
|
|
395
395
|
try {
|
|
396
396
|
t.error(e);
|
|
397
|
-
} catch (
|
|
398
|
-
|
|
397
|
+
} catch (r) {
|
|
398
|
+
k(r);
|
|
399
399
|
}
|
|
400
400
|
else
|
|
401
|
-
|
|
402
|
-
},
|
|
401
|
+
k(e);
|
|
402
|
+
}, n.prototype.complete = function() {
|
|
403
403
|
var e = this.partialObserver;
|
|
404
404
|
if (e.complete)
|
|
405
405
|
try {
|
|
406
406
|
e.complete();
|
|
407
407
|
} catch (t) {
|
|
408
|
-
|
|
408
|
+
k(t);
|
|
409
409
|
}
|
|
410
|
-
},
|
|
411
|
-
})(), X = (function(
|
|
412
|
-
|
|
413
|
-
function e(t,
|
|
414
|
-
var i =
|
|
410
|
+
}, n;
|
|
411
|
+
})(), X = (function(n) {
|
|
412
|
+
I(e, n);
|
|
413
|
+
function e(t, r, o) {
|
|
414
|
+
var i = n.call(this) || this, s;
|
|
415
415
|
return m(t) || !t ? s = {
|
|
416
416
|
next: t ?? void 0,
|
|
417
|
-
error:
|
|
417
|
+
error: r ?? void 0,
|
|
418
418
|
complete: o ?? void 0
|
|
419
|
-
} : s = t, i.destination = new
|
|
419
|
+
} : s = t, i.destination = new Ye(s), i;
|
|
420
420
|
}
|
|
421
421
|
return e;
|
|
422
422
|
})(Q);
|
|
423
|
-
function
|
|
424
|
-
me(
|
|
423
|
+
function k(n) {
|
|
424
|
+
me(n);
|
|
425
425
|
}
|
|
426
|
-
function Be(
|
|
427
|
-
throw
|
|
426
|
+
function Be(n) {
|
|
427
|
+
throw n;
|
|
428
428
|
}
|
|
429
|
-
var
|
|
429
|
+
var We = {
|
|
430
430
|
closed: !0,
|
|
431
431
|
next: W,
|
|
432
432
|
error: Be,
|
|
@@ -434,38 +434,38 @@ var Ye = {
|
|
|
434
434
|
}, Z = (function() {
|
|
435
435
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
436
436
|
})();
|
|
437
|
-
function
|
|
438
|
-
return
|
|
437
|
+
function G(n) {
|
|
438
|
+
return n;
|
|
439
439
|
}
|
|
440
|
-
function
|
|
441
|
-
return
|
|
442
|
-
return
|
|
443
|
-
return o(
|
|
440
|
+
function Xe(n) {
|
|
441
|
+
return n.length === 0 ? G : n.length === 1 ? n[0] : function(t) {
|
|
442
|
+
return n.reduce(function(r, o) {
|
|
443
|
+
return o(r);
|
|
444
444
|
}, t);
|
|
445
445
|
};
|
|
446
446
|
}
|
|
447
447
|
var g = (function() {
|
|
448
|
-
function
|
|
448
|
+
function n(e) {
|
|
449
449
|
e && (this._subscribe = e);
|
|
450
450
|
}
|
|
451
|
-
return
|
|
452
|
-
var t = new
|
|
451
|
+
return n.prototype.lift = function(e) {
|
|
452
|
+
var t = new n();
|
|
453
453
|
return t.source = this, t.operator = e, t;
|
|
454
|
-
},
|
|
455
|
-
var o = this, i =
|
|
454
|
+
}, n.prototype.subscribe = function(e, t, r) {
|
|
455
|
+
var o = this, i = ze(e) ? e : new X(e, t, r);
|
|
456
456
|
return j(function() {
|
|
457
457
|
var s = o, a = s.operator, c = s.source;
|
|
458
458
|
i.add(a ? a.call(i, c) : c ? o._subscribe(i) : o._trySubscribe(i));
|
|
459
459
|
}), i;
|
|
460
|
-
},
|
|
460
|
+
}, n.prototype._trySubscribe = function(e) {
|
|
461
461
|
try {
|
|
462
462
|
return this._subscribe(e);
|
|
463
463
|
} catch (t) {
|
|
464
464
|
e.error(t);
|
|
465
465
|
}
|
|
466
|
-
},
|
|
467
|
-
var
|
|
468
|
-
return t =
|
|
466
|
+
}, n.prototype.forEach = function(e, t) {
|
|
467
|
+
var r = this;
|
|
468
|
+
return t = re(t), new t(function(o, i) {
|
|
469
469
|
var s = new X({
|
|
470
470
|
next: function(a) {
|
|
471
471
|
try {
|
|
@@ -477,73 +477,73 @@ var g = (function() {
|
|
|
477
477
|
error: i,
|
|
478
478
|
complete: o
|
|
479
479
|
});
|
|
480
|
-
|
|
480
|
+
r.subscribe(s);
|
|
481
481
|
});
|
|
482
|
-
},
|
|
482
|
+
}, n.prototype._subscribe = function(e) {
|
|
483
483
|
var t;
|
|
484
484
|
return (t = this.source) === null || t === void 0 ? void 0 : t.subscribe(e);
|
|
485
|
-
},
|
|
485
|
+
}, n.prototype[Z] = function() {
|
|
486
486
|
return this;
|
|
487
|
-
},
|
|
487
|
+
}, n.prototype.pipe = function() {
|
|
488
488
|
for (var e = [], t = 0; t < arguments.length; t++)
|
|
489
489
|
e[t] = arguments[t];
|
|
490
|
-
return
|
|
491
|
-
},
|
|
490
|
+
return Xe(e)(this);
|
|
491
|
+
}, n.prototype.toPromise = function(e) {
|
|
492
492
|
var t = this;
|
|
493
|
-
return e =
|
|
493
|
+
return e = re(e), new e(function(r, o) {
|
|
494
494
|
var i;
|
|
495
495
|
t.subscribe(function(s) {
|
|
496
496
|
return i = s;
|
|
497
497
|
}, function(s) {
|
|
498
498
|
return o(s);
|
|
499
499
|
}, function() {
|
|
500
|
-
return
|
|
500
|
+
return r(i);
|
|
501
501
|
});
|
|
502
502
|
});
|
|
503
|
-
},
|
|
504
|
-
return new
|
|
505
|
-
},
|
|
503
|
+
}, n.create = function(e) {
|
|
504
|
+
return new n(e);
|
|
505
|
+
}, n;
|
|
506
506
|
})();
|
|
507
|
-
function
|
|
507
|
+
function re(n) {
|
|
508
508
|
var e;
|
|
509
|
-
return (e =
|
|
509
|
+
return (e = n ?? qe.Promise) !== null && e !== void 0 ? e : Promise;
|
|
510
510
|
}
|
|
511
|
-
function
|
|
512
|
-
return
|
|
511
|
+
function Je(n) {
|
|
512
|
+
return n && m(n.next) && m(n.error) && m(n.complete);
|
|
513
513
|
}
|
|
514
|
-
function
|
|
515
|
-
return
|
|
514
|
+
function ze(n) {
|
|
515
|
+
return n && n instanceof Q || Je(n) && ye(n);
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
return m(
|
|
517
|
+
function Qe(n) {
|
|
518
|
+
return m(n?.lift);
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function L(n) {
|
|
521
521
|
return function(e) {
|
|
522
|
-
if (
|
|
522
|
+
if (Qe(e))
|
|
523
523
|
return e.lift(function(t) {
|
|
524
524
|
try {
|
|
525
|
-
return
|
|
526
|
-
} catch (
|
|
527
|
-
this.error(
|
|
525
|
+
return n(t, this);
|
|
526
|
+
} catch (r) {
|
|
527
|
+
this.error(r);
|
|
528
528
|
}
|
|
529
529
|
});
|
|
530
530
|
throw new TypeError("Unable to lift unknown Observable type");
|
|
531
531
|
};
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
return new
|
|
533
|
+
function O(n, e, t, r, o) {
|
|
534
|
+
return new Ze(n, e, t, r, o);
|
|
535
535
|
}
|
|
536
|
-
var
|
|
537
|
-
|
|
538
|
-
function e(t,
|
|
539
|
-
var c =
|
|
540
|
-
return c.onFinalize = s, c.shouldUnsubscribe = a, c._next =
|
|
536
|
+
var Ze = (function(n) {
|
|
537
|
+
I(e, n);
|
|
538
|
+
function e(t, r, o, i, s, a) {
|
|
539
|
+
var c = n.call(this, t) || this;
|
|
540
|
+
return c.onFinalize = s, c.shouldUnsubscribe = a, c._next = r ? function(u) {
|
|
541
541
|
try {
|
|
542
|
-
|
|
542
|
+
r(u);
|
|
543
543
|
} catch (f) {
|
|
544
544
|
t.error(f);
|
|
545
545
|
}
|
|
546
|
-
} :
|
|
546
|
+
} : n.prototype._next, c._error = i ? function(u) {
|
|
547
547
|
try {
|
|
548
548
|
i(u);
|
|
549
549
|
} catch (f) {
|
|
@@ -551,7 +551,7 @@ var Qe = (function(r) {
|
|
|
551
551
|
} finally {
|
|
552
552
|
this.unsubscribe();
|
|
553
553
|
}
|
|
554
|
-
} :
|
|
554
|
+
} : n.prototype._error, c._complete = o ? function() {
|
|
555
555
|
try {
|
|
556
556
|
o();
|
|
557
557
|
} catch (u) {
|
|
@@ -559,39 +559,39 @@ var Qe = (function(r) {
|
|
|
559
559
|
} finally {
|
|
560
560
|
this.unsubscribe();
|
|
561
561
|
}
|
|
562
|
-
} :
|
|
562
|
+
} : n.prototype._complete, c;
|
|
563
563
|
}
|
|
564
564
|
return e.prototype.unsubscribe = function() {
|
|
565
565
|
var t;
|
|
566
566
|
if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
|
|
567
|
-
var
|
|
568
|
-
|
|
567
|
+
var r = this.closed;
|
|
568
|
+
n.prototype.unsubscribe.call(this), !r && ((t = this.onFinalize) === null || t === void 0 || t.call(this));
|
|
569
569
|
}
|
|
570
570
|
}, e;
|
|
571
|
-
})(Q),
|
|
571
|
+
})(Q), et = pe(function(n) {
|
|
572
572
|
return function() {
|
|
573
|
-
|
|
573
|
+
n(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
574
574
|
};
|
|
575
|
-
}), ee = (function(
|
|
576
|
-
|
|
575
|
+
}), ee = (function(n) {
|
|
576
|
+
I(e, n);
|
|
577
577
|
function e() {
|
|
578
|
-
var t =
|
|
578
|
+
var t = n.call(this) || this;
|
|
579
579
|
return t.closed = !1, t.currentObservers = null, t.observers = [], t.isStopped = !1, t.hasError = !1, t.thrownError = null, t;
|
|
580
580
|
}
|
|
581
581
|
return e.prototype.lift = function(t) {
|
|
582
|
-
var
|
|
583
|
-
return
|
|
582
|
+
var r = new oe(this, this);
|
|
583
|
+
return r.operator = t, r;
|
|
584
584
|
}, e.prototype._throwIfClosed = function() {
|
|
585
585
|
if (this.closed)
|
|
586
|
-
throw new
|
|
586
|
+
throw new et();
|
|
587
587
|
}, e.prototype.next = function(t) {
|
|
588
|
-
var
|
|
588
|
+
var r = this;
|
|
589
589
|
j(function() {
|
|
590
590
|
var o, i;
|
|
591
|
-
if (
|
|
592
|
-
|
|
591
|
+
if (r._throwIfClosed(), !r.isStopped) {
|
|
592
|
+
r.currentObservers || (r.currentObservers = Array.from(r.observers));
|
|
593
593
|
try {
|
|
594
|
-
for (var s =
|
|
594
|
+
for (var s = P(r.currentObservers), a = s.next(); !a.done; a = s.next()) {
|
|
595
595
|
var c = a.value;
|
|
596
596
|
c.next(t);
|
|
597
597
|
}
|
|
@@ -607,11 +607,11 @@ var Qe = (function(r) {
|
|
|
607
607
|
}
|
|
608
608
|
});
|
|
609
609
|
}, e.prototype.error = function(t) {
|
|
610
|
-
var
|
|
610
|
+
var r = this;
|
|
611
611
|
j(function() {
|
|
612
|
-
if (
|
|
613
|
-
|
|
614
|
-
for (var o =
|
|
612
|
+
if (r._throwIfClosed(), !r.isStopped) {
|
|
613
|
+
r.hasError = r.isStopped = !0, r.thrownError = t;
|
|
614
|
+
for (var o = r.observers; o.length; )
|
|
615
615
|
o.shift().error(t);
|
|
616
616
|
}
|
|
617
617
|
});
|
|
@@ -620,8 +620,8 @@ var Qe = (function(r) {
|
|
|
620
620
|
j(function() {
|
|
621
621
|
if (t._throwIfClosed(), !t.isStopped) {
|
|
622
622
|
t.isStopped = !0;
|
|
623
|
-
for (var
|
|
624
|
-
|
|
623
|
+
for (var r = t.observers; r.length; )
|
|
624
|
+
r.shift().complete();
|
|
625
625
|
}
|
|
626
626
|
});
|
|
627
627
|
}, e.prototype.unsubscribe = function() {
|
|
@@ -634,47 +634,47 @@ var Qe = (function(r) {
|
|
|
634
634
|
enumerable: !1,
|
|
635
635
|
configurable: !0
|
|
636
636
|
}), e.prototype._trySubscribe = function(t) {
|
|
637
|
-
return this._throwIfClosed(),
|
|
637
|
+
return this._throwIfClosed(), n.prototype._trySubscribe.call(this, t);
|
|
638
638
|
}, e.prototype._subscribe = function(t) {
|
|
639
639
|
return this._throwIfClosed(), this._checkFinalizedStatuses(t), this._innerSubscribe(t);
|
|
640
640
|
}, e.prototype._innerSubscribe = function(t) {
|
|
641
|
-
var
|
|
642
|
-
return i || s ?
|
|
643
|
-
|
|
641
|
+
var r = this, o = this, i = o.hasError, s = o.isStopped, a = o.observers;
|
|
642
|
+
return i || s ? ve : (this.currentObservers = null, a.push(t), new N(function() {
|
|
643
|
+
r.currentObservers = null, D(a, t);
|
|
644
644
|
}));
|
|
645
645
|
}, e.prototype._checkFinalizedStatuses = function(t) {
|
|
646
|
-
var
|
|
646
|
+
var r = this, o = r.hasError, i = r.thrownError, s = r.isStopped;
|
|
647
647
|
o ? t.error(i) : s && t.complete();
|
|
648
648
|
}, e.prototype.asObservable = function() {
|
|
649
649
|
var t = new g();
|
|
650
650
|
return t.source = this, t;
|
|
651
|
-
}, e.create = function(t,
|
|
652
|
-
return new oe(t,
|
|
651
|
+
}, e.create = function(t, r) {
|
|
652
|
+
return new oe(t, r);
|
|
653
653
|
}, e;
|
|
654
|
-
})(g), oe = (function(
|
|
655
|
-
|
|
656
|
-
function e(t,
|
|
657
|
-
var o =
|
|
658
|
-
return o.destination = t, o.source =
|
|
654
|
+
})(g), oe = (function(n) {
|
|
655
|
+
I(e, n);
|
|
656
|
+
function e(t, r) {
|
|
657
|
+
var o = n.call(this) || this;
|
|
658
|
+
return o.destination = t, o.source = r, o;
|
|
659
659
|
}
|
|
660
660
|
return e.prototype.next = function(t) {
|
|
661
|
-
var
|
|
662
|
-
(o = (
|
|
661
|
+
var r, o;
|
|
662
|
+
(o = (r = this.destination) === null || r === void 0 ? void 0 : r.next) === null || o === void 0 || o.call(r, t);
|
|
663
663
|
}, e.prototype.error = function(t) {
|
|
664
|
-
var
|
|
665
|
-
(o = (
|
|
664
|
+
var r, o;
|
|
665
|
+
(o = (r = this.destination) === null || r === void 0 ? void 0 : r.error) === null || o === void 0 || o.call(r, t);
|
|
666
666
|
}, e.prototype.complete = function() {
|
|
667
|
-
var t,
|
|
668
|
-
(
|
|
667
|
+
var t, r;
|
|
668
|
+
(r = (t = this.destination) === null || t === void 0 ? void 0 : t.complete) === null || r === void 0 || r.call(t);
|
|
669
669
|
}, e.prototype._subscribe = function(t) {
|
|
670
|
-
var
|
|
671
|
-
return (o = (
|
|
670
|
+
var r, o;
|
|
671
|
+
return (o = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(t)) !== null && o !== void 0 ? o : ve;
|
|
672
672
|
}, e;
|
|
673
|
-
})(ee), ie = (function(
|
|
674
|
-
|
|
673
|
+
})(ee), ie = (function(n) {
|
|
674
|
+
I(e, n);
|
|
675
675
|
function e(t) {
|
|
676
|
-
var
|
|
677
|
-
return
|
|
676
|
+
var r = n.call(this) || this;
|
|
677
|
+
return r._value = t, r;
|
|
678
678
|
}
|
|
679
679
|
return Object.defineProperty(e.prototype, "value", {
|
|
680
680
|
get: function() {
|
|
@@ -683,66 +683,66 @@ var Qe = (function(r) {
|
|
|
683
683
|
enumerable: !1,
|
|
684
684
|
configurable: !0
|
|
685
685
|
}), e.prototype._subscribe = function(t) {
|
|
686
|
-
var
|
|
687
|
-
return !
|
|
686
|
+
var r = n.prototype._subscribe.call(this, t);
|
|
687
|
+
return !r.closed && t.next(this._value), r;
|
|
688
688
|
}, e.prototype.getValue = function() {
|
|
689
|
-
var t = this,
|
|
690
|
-
if (
|
|
689
|
+
var t = this, r = t.hasError, o = t.thrownError, i = t._value;
|
|
690
|
+
if (r)
|
|
691
691
|
throw o;
|
|
692
692
|
return this._throwIfClosed(), i;
|
|
693
693
|
}, e.prototype.next = function(t) {
|
|
694
|
-
|
|
694
|
+
n.prototype.next.call(this, this._value = t);
|
|
695
695
|
}, e;
|
|
696
|
-
})(ee),
|
|
696
|
+
})(ee), tt = {
|
|
697
697
|
now: function() {
|
|
698
698
|
return Date.now();
|
|
699
699
|
}
|
|
700
|
-
},
|
|
701
|
-
|
|
702
|
-
function e(t,
|
|
703
|
-
return
|
|
700
|
+
}, nt = (function(n) {
|
|
701
|
+
I(e, n);
|
|
702
|
+
function e(t, r) {
|
|
703
|
+
return n.call(this) || this;
|
|
704
704
|
}
|
|
705
|
-
return e.prototype.schedule = function(t,
|
|
705
|
+
return e.prototype.schedule = function(t, r) {
|
|
706
706
|
return this;
|
|
707
707
|
}, e;
|
|
708
|
-
})(
|
|
709
|
-
setInterval: function(
|
|
710
|
-
for (var t = [],
|
|
711
|
-
t[
|
|
712
|
-
return setInterval.apply(void 0, R([
|
|
708
|
+
})(N), se = {
|
|
709
|
+
setInterval: function(n, e) {
|
|
710
|
+
for (var t = [], r = 2; r < arguments.length; r++)
|
|
711
|
+
t[r - 2] = arguments[r];
|
|
712
|
+
return setInterval.apply(void 0, R([n, e], M(t)));
|
|
713
713
|
},
|
|
714
|
-
clearInterval: function(
|
|
715
|
-
return clearInterval(
|
|
714
|
+
clearInterval: function(n) {
|
|
715
|
+
return clearInterval(n);
|
|
716
716
|
},
|
|
717
717
|
delegate: void 0
|
|
718
|
-
}, rt = (function(
|
|
719
|
-
|
|
720
|
-
function e(t,
|
|
721
|
-
var o =
|
|
722
|
-
return o.scheduler = t, o.work =
|
|
718
|
+
}, rt = (function(n) {
|
|
719
|
+
I(e, n);
|
|
720
|
+
function e(t, r) {
|
|
721
|
+
var o = n.call(this, t, r) || this;
|
|
722
|
+
return o.scheduler = t, o.work = r, o.pending = !1, o;
|
|
723
723
|
}
|
|
724
|
-
return e.prototype.schedule = function(t,
|
|
724
|
+
return e.prototype.schedule = function(t, r) {
|
|
725
725
|
var o;
|
|
726
|
-
if (
|
|
726
|
+
if (r === void 0 && (r = 0), this.closed)
|
|
727
727
|
return this;
|
|
728
728
|
this.state = t;
|
|
729
729
|
var i = this.id, s = this.scheduler;
|
|
730
|
-
return i != null && (this.id = this.recycleAsyncId(s, i,
|
|
731
|
-
}, e.prototype.requestAsyncId = function(t,
|
|
730
|
+
return i != null && (this.id = this.recycleAsyncId(s, i, r)), this.pending = !0, this.delay = r, this.id = (o = this.id) !== null && o !== void 0 ? o : this.requestAsyncId(s, this.id, r), this;
|
|
731
|
+
}, e.prototype.requestAsyncId = function(t, r, o) {
|
|
732
732
|
return o === void 0 && (o = 0), se.setInterval(t.flush.bind(t, this), o);
|
|
733
|
-
}, e.prototype.recycleAsyncId = function(t,
|
|
733
|
+
}, e.prototype.recycleAsyncId = function(t, r, o) {
|
|
734
734
|
if (o === void 0 && (o = 0), o != null && this.delay === o && this.pending === !1)
|
|
735
|
-
return
|
|
736
|
-
|
|
737
|
-
}, e.prototype.execute = function(t,
|
|
735
|
+
return r;
|
|
736
|
+
r != null && se.clearInterval(r);
|
|
737
|
+
}, e.prototype.execute = function(t, r) {
|
|
738
738
|
if (this.closed)
|
|
739
739
|
return new Error("executing a cancelled action");
|
|
740
740
|
this.pending = !1;
|
|
741
|
-
var o = this._execute(t,
|
|
741
|
+
var o = this._execute(t, r);
|
|
742
742
|
if (o)
|
|
743
743
|
return o;
|
|
744
744
|
this.pending === !1 && this.id != null && (this.id = this.recycleAsyncId(this.scheduler, this.id, null));
|
|
745
|
-
}, e.prototype._execute = function(t,
|
|
745
|
+
}, e.prototype._execute = function(t, r) {
|
|
746
746
|
var o = !1, i;
|
|
747
747
|
try {
|
|
748
748
|
this.work(t);
|
|
@@ -753,28 +753,28 @@ var Qe = (function(r) {
|
|
|
753
753
|
return this.unsubscribe(), i;
|
|
754
754
|
}, e.prototype.unsubscribe = function() {
|
|
755
755
|
if (!this.closed) {
|
|
756
|
-
var t = this,
|
|
757
|
-
this.work = this.state = this.scheduler = null, this.pending = !1, D(i, this),
|
|
756
|
+
var t = this, r = t.id, o = t.scheduler, i = o.actions;
|
|
757
|
+
this.work = this.state = this.scheduler = null, this.pending = !1, D(i, this), r != null && (this.id = this.recycleAsyncId(o, r, null)), this.delay = null, n.prototype.unsubscribe.call(this);
|
|
758
758
|
}
|
|
759
759
|
}, e;
|
|
760
|
-
})(
|
|
761
|
-
function
|
|
762
|
-
t === void 0 && (t =
|
|
763
|
-
}
|
|
764
|
-
return
|
|
765
|
-
return t === void 0 && (t = 0), new this.schedulerActionCtor(this, e).schedule(
|
|
766
|
-
},
|
|
767
|
-
})(),
|
|
768
|
-
|
|
769
|
-
function e(t,
|
|
770
|
-
|
|
771
|
-
var o =
|
|
760
|
+
})(nt), ae = (function() {
|
|
761
|
+
function n(e, t) {
|
|
762
|
+
t === void 0 && (t = n.now), this.schedulerActionCtor = e, this.now = t;
|
|
763
|
+
}
|
|
764
|
+
return n.prototype.schedule = function(e, t, r) {
|
|
765
|
+
return t === void 0 && (t = 0), new this.schedulerActionCtor(this, e).schedule(r, t);
|
|
766
|
+
}, n.now = tt.now, n;
|
|
767
|
+
})(), ot = (function(n) {
|
|
768
|
+
I(e, n);
|
|
769
|
+
function e(t, r) {
|
|
770
|
+
r === void 0 && (r = ae.now);
|
|
771
|
+
var o = n.call(this, t, r) || this;
|
|
772
772
|
return o.actions = [], o._active = !1, o;
|
|
773
773
|
}
|
|
774
774
|
return e.prototype.flush = function(t) {
|
|
775
|
-
var
|
|
775
|
+
var r = this.actions;
|
|
776
776
|
if (this._active) {
|
|
777
|
-
|
|
777
|
+
r.push(t);
|
|
778
778
|
return;
|
|
779
779
|
}
|
|
780
780
|
var o;
|
|
@@ -782,67 +782,67 @@ var Qe = (function(r) {
|
|
|
782
782
|
do
|
|
783
783
|
if (o = t.execute(t.state, t.delay))
|
|
784
784
|
break;
|
|
785
|
-
while (t =
|
|
785
|
+
while (t = r.shift());
|
|
786
786
|
if (this._active = !1, o) {
|
|
787
|
-
for (; t =
|
|
787
|
+
for (; t = r.shift(); )
|
|
788
788
|
t.unsubscribe();
|
|
789
789
|
throw o;
|
|
790
790
|
}
|
|
791
791
|
}, e;
|
|
792
|
-
})(ae), be = new
|
|
793
|
-
return
|
|
792
|
+
})(ae), be = new ot(rt), it = be, st = new g(function(n) {
|
|
793
|
+
return n.complete();
|
|
794
794
|
});
|
|
795
|
-
function ge(
|
|
796
|
-
return
|
|
795
|
+
function ge(n) {
|
|
796
|
+
return n && m(n.schedule);
|
|
797
797
|
}
|
|
798
|
-
function Se(
|
|
799
|
-
return
|
|
798
|
+
function Se(n) {
|
|
799
|
+
return n[n.length - 1];
|
|
800
800
|
}
|
|
801
|
-
function
|
|
802
|
-
return m(Se(
|
|
801
|
+
function at(n) {
|
|
802
|
+
return m(Se(n)) ? n.pop() : void 0;
|
|
803
803
|
}
|
|
804
|
-
function we(
|
|
805
|
-
return ge(Se(
|
|
804
|
+
function we(n) {
|
|
805
|
+
return ge(Se(n)) ? n.pop() : void 0;
|
|
806
806
|
}
|
|
807
|
-
var Ee = (function(
|
|
808
|
-
return
|
|
807
|
+
var Ee = (function(n) {
|
|
808
|
+
return n && typeof n.length == "number" && typeof n != "function";
|
|
809
809
|
});
|
|
810
|
-
function
|
|
811
|
-
return m(
|
|
810
|
+
function Oe(n) {
|
|
811
|
+
return m(n?.then);
|
|
812
812
|
}
|
|
813
|
-
function
|
|
814
|
-
return m(
|
|
813
|
+
function Ie(n) {
|
|
814
|
+
return m(n[Z]);
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
return Symbol.asyncIterator && m(
|
|
816
|
+
function Ce(n) {
|
|
817
|
+
return Symbol.asyncIterator && m(n?.[Symbol.asyncIterator]);
|
|
818
818
|
}
|
|
819
|
-
function
|
|
820
|
-
return new TypeError("You provided " + (
|
|
819
|
+
function Ae(n) {
|
|
820
|
+
return new TypeError("You provided " + (n !== null && typeof n == "object" ? "an invalid object" : "'" + n + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function ct() {
|
|
823
823
|
return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
|
|
824
824
|
}
|
|
825
|
-
var
|
|
826
|
-
function Te(
|
|
827
|
-
return m(
|
|
825
|
+
var _e = ct();
|
|
826
|
+
function Te(n) {
|
|
827
|
+
return m(n?.[_e]);
|
|
828
828
|
}
|
|
829
|
-
function
|
|
830
|
-
return
|
|
831
|
-
var t,
|
|
829
|
+
function Le(n) {
|
|
830
|
+
return Fe(this, arguments, function() {
|
|
831
|
+
var t, r, o, i;
|
|
832
832
|
return he(this, function(s) {
|
|
833
833
|
switch (s.label) {
|
|
834
834
|
case 0:
|
|
835
|
-
t =
|
|
835
|
+
t = n.getReader(), s.label = 1;
|
|
836
836
|
case 1:
|
|
837
837
|
s.trys.push([1, , 9, 10]), s.label = 2;
|
|
838
838
|
case 2:
|
|
839
|
-
return [4,
|
|
839
|
+
return [4, x(t.read())];
|
|
840
840
|
case 3:
|
|
841
|
-
return
|
|
841
|
+
return r = s.sent(), o = r.value, i = r.done, i ? [4, x(void 0)] : [3, 5];
|
|
842
842
|
case 4:
|
|
843
843
|
return [2, s.sent()];
|
|
844
844
|
case 5:
|
|
845
|
-
return [4,
|
|
845
|
+
return [4, x(o)];
|
|
846
846
|
case 6:
|
|
847
847
|
return [4, s.sent()];
|
|
848
848
|
case 7:
|
|
@@ -857,57 +857,57 @@ function _e(r) {
|
|
|
857
857
|
});
|
|
858
858
|
});
|
|
859
859
|
}
|
|
860
|
-
function
|
|
861
|
-
return m(
|
|
862
|
-
}
|
|
863
|
-
function
|
|
864
|
-
if (
|
|
865
|
-
return
|
|
866
|
-
if (
|
|
867
|
-
if (
|
|
868
|
-
return
|
|
869
|
-
if (Ee(
|
|
870
|
-
return
|
|
871
|
-
if (
|
|
872
|
-
return
|
|
873
|
-
if (
|
|
874
|
-
return
|
|
875
|
-
if (Te(
|
|
876
|
-
return
|
|
877
|
-
if (
|
|
878
|
-
return
|
|
879
|
-
}
|
|
880
|
-
throw
|
|
881
|
-
}
|
|
882
|
-
function
|
|
860
|
+
function xe(n) {
|
|
861
|
+
return m(n?.getReader);
|
|
862
|
+
}
|
|
863
|
+
function _(n) {
|
|
864
|
+
if (n instanceof g)
|
|
865
|
+
return n;
|
|
866
|
+
if (n != null) {
|
|
867
|
+
if (Ie(n))
|
|
868
|
+
return ut(n);
|
|
869
|
+
if (Ee(n))
|
|
870
|
+
return lt(n);
|
|
871
|
+
if (Oe(n))
|
|
872
|
+
return ft(n);
|
|
873
|
+
if (Ce(n))
|
|
874
|
+
return Pe(n);
|
|
875
|
+
if (Te(n))
|
|
876
|
+
return dt(n);
|
|
877
|
+
if (xe(n))
|
|
878
|
+
return ht(n);
|
|
879
|
+
}
|
|
880
|
+
throw Ae(n);
|
|
881
|
+
}
|
|
882
|
+
function ut(n) {
|
|
883
883
|
return new g(function(e) {
|
|
884
|
-
var t =
|
|
884
|
+
var t = n[Z]();
|
|
885
885
|
if (m(t.subscribe))
|
|
886
886
|
return t.subscribe(e);
|
|
887
887
|
throw new TypeError("Provided object does not correctly implement Symbol.observable");
|
|
888
888
|
});
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function lt(n) {
|
|
891
891
|
return new g(function(e) {
|
|
892
|
-
for (var t = 0; t <
|
|
893
|
-
e.next(
|
|
892
|
+
for (var t = 0; t < n.length && !e.closed; t++)
|
|
893
|
+
e.next(n[t]);
|
|
894
894
|
e.complete();
|
|
895
895
|
});
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function ft(n) {
|
|
898
898
|
return new g(function(e) {
|
|
899
|
-
|
|
899
|
+
n.then(function(t) {
|
|
900
900
|
e.closed || (e.next(t), e.complete());
|
|
901
901
|
}, function(t) {
|
|
902
902
|
return e.error(t);
|
|
903
903
|
}).then(null, me);
|
|
904
904
|
});
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function dt(n) {
|
|
907
907
|
return new g(function(e) {
|
|
908
|
-
var t,
|
|
908
|
+
var t, r;
|
|
909
909
|
try {
|
|
910
|
-
for (var o =
|
|
910
|
+
for (var o = P(n), i = o.next(); !i.done; i = o.next()) {
|
|
911
911
|
var s = i.value;
|
|
912
912
|
if (e.next(s), e.closed)
|
|
913
913
|
return;
|
|
@@ -916,7 +916,7 @@ function ft(r) {
|
|
|
916
916
|
t = { error: a };
|
|
917
917
|
} finally {
|
|
918
918
|
try {
|
|
919
|
-
i && !i.done && (
|
|
919
|
+
i && !i.done && (r = o.return) && r.call(o);
|
|
920
920
|
} finally {
|
|
921
921
|
if (t) throw t.error;
|
|
922
922
|
}
|
|
@@ -924,29 +924,29 @@ function ft(r) {
|
|
|
924
924
|
e.complete();
|
|
925
925
|
});
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function Pe(n) {
|
|
928
928
|
return new g(function(e) {
|
|
929
|
-
|
|
929
|
+
pt(n, e).catch(function(t) {
|
|
930
930
|
return e.error(t);
|
|
931
931
|
});
|
|
932
932
|
});
|
|
933
933
|
}
|
|
934
|
-
function
|
|
935
|
-
return
|
|
934
|
+
function ht(n) {
|
|
935
|
+
return Pe(Le(n));
|
|
936
936
|
}
|
|
937
|
-
function
|
|
938
|
-
var t,
|
|
939
|
-
return
|
|
937
|
+
function pt(n, e) {
|
|
938
|
+
var t, r, o, i;
|
|
939
|
+
return Ge(this, void 0, void 0, function() {
|
|
940
940
|
var s, a;
|
|
941
941
|
return he(this, function(c) {
|
|
942
942
|
switch (c.label) {
|
|
943
943
|
case 0:
|
|
944
|
-
c.trys.push([0, 5, 6, 11]), t =
|
|
944
|
+
c.trys.push([0, 5, 6, 11]), t = Ve(n), c.label = 1;
|
|
945
945
|
case 1:
|
|
946
946
|
return [4, t.next()];
|
|
947
947
|
case 2:
|
|
948
|
-
if (
|
|
949
|
-
if (s =
|
|
948
|
+
if (r = c.sent(), !!r.done) return [3, 4];
|
|
949
|
+
if (s = r.value, e.next(s), e.closed)
|
|
950
950
|
return [2];
|
|
951
951
|
c.label = 3;
|
|
952
952
|
case 3:
|
|
@@ -956,7 +956,7 @@ function ht(r, e) {
|
|
|
956
956
|
case 5:
|
|
957
957
|
return a = c.sent(), o = { error: a }, [3, 11];
|
|
958
958
|
case 6:
|
|
959
|
-
return c.trys.push([6, , 9, 10]),
|
|
959
|
+
return c.trys.push([6, , 9, 10]), r && !r.done && (i = t.return) ? [4, i.call(t)] : [3, 8];
|
|
960
960
|
case 7:
|
|
961
961
|
c.sent(), c.label = 8;
|
|
962
962
|
case 8:
|
|
@@ -972,60 +972,60 @@ function ht(r, e) {
|
|
|
972
972
|
});
|
|
973
973
|
});
|
|
974
974
|
}
|
|
975
|
-
function
|
|
976
|
-
|
|
975
|
+
function A(n, e, t, r, o) {
|
|
976
|
+
r === void 0 && (r = 0), o === void 0 && (o = !1);
|
|
977
977
|
var i = e.schedule(function() {
|
|
978
|
-
t(), o ?
|
|
979
|
-
},
|
|
980
|
-
if (
|
|
978
|
+
t(), o ? n.add(this.schedule(null, r)) : this.unsubscribe();
|
|
979
|
+
}, r);
|
|
980
|
+
if (n.add(i), !o)
|
|
981
981
|
return i;
|
|
982
982
|
}
|
|
983
|
-
function
|
|
984
|
-
return e === void 0 && (e = 0),
|
|
985
|
-
t.subscribe(
|
|
986
|
-
return
|
|
987
|
-
return
|
|
983
|
+
function Me(n, e) {
|
|
984
|
+
return e === void 0 && (e = 0), L(function(t, r) {
|
|
985
|
+
t.subscribe(O(r, function(o) {
|
|
986
|
+
return A(r, n, function() {
|
|
987
|
+
return r.next(o);
|
|
988
988
|
}, e);
|
|
989
989
|
}, function() {
|
|
990
|
-
return
|
|
991
|
-
return
|
|
990
|
+
return A(r, n, function() {
|
|
991
|
+
return r.complete();
|
|
992
992
|
}, e);
|
|
993
993
|
}, function(o) {
|
|
994
|
-
return
|
|
995
|
-
return
|
|
994
|
+
return A(r, n, function() {
|
|
995
|
+
return r.error(o);
|
|
996
996
|
}, e);
|
|
997
997
|
}));
|
|
998
998
|
});
|
|
999
999
|
}
|
|
1000
|
-
function Re(
|
|
1001
|
-
return e === void 0 && (e = 0),
|
|
1002
|
-
|
|
1003
|
-
return t.subscribe(
|
|
1000
|
+
function Re(n, e) {
|
|
1001
|
+
return e === void 0 && (e = 0), L(function(t, r) {
|
|
1002
|
+
r.add(n.schedule(function() {
|
|
1003
|
+
return t.subscribe(r);
|
|
1004
1004
|
}, e));
|
|
1005
1005
|
});
|
|
1006
1006
|
}
|
|
1007
|
-
function vt(
|
|
1008
|
-
return
|
|
1007
|
+
function vt(n, e) {
|
|
1008
|
+
return _(n).pipe(Re(e), Me(e));
|
|
1009
1009
|
}
|
|
1010
|
-
function
|
|
1011
|
-
return
|
|
1010
|
+
function yt(n, e) {
|
|
1011
|
+
return _(n).pipe(Re(e), Me(e));
|
|
1012
1012
|
}
|
|
1013
|
-
function
|
|
1013
|
+
function mt(n, e) {
|
|
1014
1014
|
return new g(function(t) {
|
|
1015
|
-
var
|
|
1015
|
+
var r = 0;
|
|
1016
1016
|
return e.schedule(function() {
|
|
1017
|
-
|
|
1017
|
+
r === n.length ? t.complete() : (t.next(n[r++]), t.closed || this.schedule());
|
|
1018
1018
|
});
|
|
1019
1019
|
});
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1021
|
+
function bt(n, e) {
|
|
1022
1022
|
return new g(function(t) {
|
|
1023
|
-
var
|
|
1024
|
-
return
|
|
1025
|
-
|
|
1023
|
+
var r;
|
|
1024
|
+
return A(t, e, function() {
|
|
1025
|
+
r = n[_e](), A(t, e, function() {
|
|
1026
1026
|
var o, i, s;
|
|
1027
1027
|
try {
|
|
1028
|
-
o =
|
|
1028
|
+
o = r.next(), i = o.value, s = o.done;
|
|
1029
1029
|
} catch (a) {
|
|
1030
1030
|
t.error(a);
|
|
1031
1031
|
return;
|
|
@@ -1033,262 +1033,262 @@ function mt(r, e) {
|
|
|
1033
1033
|
s ? t.complete() : t.next(i);
|
|
1034
1034
|
}, 0, !0);
|
|
1035
1035
|
}), function() {
|
|
1036
|
-
return m(
|
|
1036
|
+
return m(r?.return) && r.return();
|
|
1037
1037
|
};
|
|
1038
1038
|
});
|
|
1039
1039
|
}
|
|
1040
|
-
function
|
|
1041
|
-
if (!
|
|
1040
|
+
function Ne(n, e) {
|
|
1041
|
+
if (!n)
|
|
1042
1042
|
throw new Error("Iterable cannot be null");
|
|
1043
1043
|
return new g(function(t) {
|
|
1044
|
-
|
|
1045
|
-
var
|
|
1046
|
-
|
|
1047
|
-
|
|
1044
|
+
A(t, e, function() {
|
|
1045
|
+
var r = n[Symbol.asyncIterator]();
|
|
1046
|
+
A(t, e, function() {
|
|
1047
|
+
r.next().then(function(o) {
|
|
1048
1048
|
o.done ? t.complete() : t.next(o.value);
|
|
1049
1049
|
});
|
|
1050
1050
|
}, 0, !0);
|
|
1051
1051
|
});
|
|
1052
1052
|
});
|
|
1053
1053
|
}
|
|
1054
|
-
function
|
|
1055
|
-
return
|
|
1056
|
-
}
|
|
1057
|
-
function
|
|
1058
|
-
if (
|
|
1059
|
-
if (
|
|
1060
|
-
return vt(
|
|
1061
|
-
if (Ee(
|
|
1062
|
-
return
|
|
1063
|
-
if (
|
|
1064
|
-
return
|
|
1065
|
-
if (
|
|
1066
|
-
return
|
|
1067
|
-
if (Te(
|
|
1068
|
-
return
|
|
1069
|
-
if (
|
|
1070
|
-
return
|
|
1071
|
-
}
|
|
1072
|
-
throw
|
|
1073
|
-
}
|
|
1074
|
-
function te(
|
|
1075
|
-
return e ?
|
|
1076
|
-
}
|
|
1077
|
-
function
|
|
1078
|
-
for (var
|
|
1079
|
-
|
|
1080
|
-
var t = we(
|
|
1081
|
-
return te(
|
|
1082
|
-
}
|
|
1083
|
-
function
|
|
1084
|
-
return
|
|
1085
|
-
}
|
|
1086
|
-
function
|
|
1087
|
-
return
|
|
1054
|
+
function gt(n, e) {
|
|
1055
|
+
return Ne(Le(n), e);
|
|
1056
|
+
}
|
|
1057
|
+
function St(n, e) {
|
|
1058
|
+
if (n != null) {
|
|
1059
|
+
if (Ie(n))
|
|
1060
|
+
return vt(n, e);
|
|
1061
|
+
if (Ee(n))
|
|
1062
|
+
return mt(n, e);
|
|
1063
|
+
if (Oe(n))
|
|
1064
|
+
return yt(n, e);
|
|
1065
|
+
if (Ce(n))
|
|
1066
|
+
return Ne(n, e);
|
|
1067
|
+
if (Te(n))
|
|
1068
|
+
return bt(n, e);
|
|
1069
|
+
if (xe(n))
|
|
1070
|
+
return gt(n, e);
|
|
1071
|
+
}
|
|
1072
|
+
throw Ae(n);
|
|
1073
|
+
}
|
|
1074
|
+
function te(n, e) {
|
|
1075
|
+
return e ? St(n, e) : _(n);
|
|
1076
|
+
}
|
|
1077
|
+
function wt() {
|
|
1078
|
+
for (var n = [], e = 0; e < arguments.length; e++)
|
|
1079
|
+
n[e] = arguments[e];
|
|
1080
|
+
var t = we(n);
|
|
1081
|
+
return te(n, t);
|
|
1082
|
+
}
|
|
1083
|
+
function Et(n) {
|
|
1084
|
+
return n instanceof Date && !isNaN(n);
|
|
1085
|
+
}
|
|
1086
|
+
function F(n, e) {
|
|
1087
|
+
return L(function(t, r) {
|
|
1088
1088
|
var o = 0;
|
|
1089
|
-
t.subscribe(
|
|
1090
|
-
|
|
1089
|
+
t.subscribe(O(r, function(i) {
|
|
1090
|
+
r.next(n.call(e, i, o++));
|
|
1091
1091
|
}));
|
|
1092
1092
|
});
|
|
1093
1093
|
}
|
|
1094
|
-
var
|
|
1095
|
-
function It(
|
|
1096
|
-
return
|
|
1094
|
+
var Ot = Array.isArray;
|
|
1095
|
+
function It(n, e) {
|
|
1096
|
+
return Ot(e) ? n.apply(void 0, R([], M(e))) : n(e);
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1099
|
-
return
|
|
1100
|
-
return It(
|
|
1098
|
+
function Ct(n) {
|
|
1099
|
+
return F(function(e) {
|
|
1100
|
+
return It(n, e);
|
|
1101
1101
|
});
|
|
1102
1102
|
}
|
|
1103
|
-
var At = Array.isArray,
|
|
1104
|
-
function
|
|
1105
|
-
if (
|
|
1106
|
-
var e =
|
|
1103
|
+
var At = Array.isArray, _t = Object.getPrototypeOf, Tt = Object.prototype, Lt = Object.keys;
|
|
1104
|
+
function xt(n) {
|
|
1105
|
+
if (n.length === 1) {
|
|
1106
|
+
var e = n[0];
|
|
1107
1107
|
if (At(e))
|
|
1108
1108
|
return { args: e, keys: null };
|
|
1109
1109
|
if (Pt(e)) {
|
|
1110
|
-
var t =
|
|
1110
|
+
var t = Lt(e);
|
|
1111
1111
|
return {
|
|
1112
|
-
args: t.map(function(
|
|
1113
|
-
return e[
|
|
1112
|
+
args: t.map(function(r) {
|
|
1113
|
+
return e[r];
|
|
1114
1114
|
}),
|
|
1115
1115
|
keys: t
|
|
1116
1116
|
};
|
|
1117
1117
|
}
|
|
1118
1118
|
}
|
|
1119
|
-
return { args:
|
|
1119
|
+
return { args: n, keys: null };
|
|
1120
1120
|
}
|
|
1121
|
-
function Pt(
|
|
1122
|
-
return
|
|
1121
|
+
function Pt(n) {
|
|
1122
|
+
return n && typeof n == "object" && _t(n) === Tt;
|
|
1123
1123
|
}
|
|
1124
|
-
function Mt(
|
|
1125
|
-
return
|
|
1126
|
-
return t[
|
|
1124
|
+
function Mt(n, e) {
|
|
1125
|
+
return n.reduce(function(t, r, o) {
|
|
1126
|
+
return t[r] = e[o], t;
|
|
1127
1127
|
}, {});
|
|
1128
1128
|
}
|
|
1129
|
-
function
|
|
1130
|
-
for (var
|
|
1131
|
-
|
|
1132
|
-
var t = we(
|
|
1129
|
+
function Rt() {
|
|
1130
|
+
for (var n = [], e = 0; e < arguments.length; e++)
|
|
1131
|
+
n[e] = arguments[e];
|
|
1132
|
+
var t = we(n), r = at(n), o = xt(n), i = o.args, s = o.keys;
|
|
1133
1133
|
if (i.length === 0)
|
|
1134
1134
|
return te([], t);
|
|
1135
|
-
var a = new g(
|
|
1135
|
+
var a = new g(Nt(i, t, s ? function(c) {
|
|
1136
1136
|
return Mt(s, c);
|
|
1137
|
-
} :
|
|
1138
|
-
return
|
|
1137
|
+
} : G));
|
|
1138
|
+
return r ? a.pipe(Ct(r)) : a;
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1141
|
-
return t === void 0 && (t =
|
|
1140
|
+
function Nt(n, e, t) {
|
|
1141
|
+
return t === void 0 && (t = G), function(r) {
|
|
1142
1142
|
ce(e, function() {
|
|
1143
|
-
for (var o =
|
|
1143
|
+
for (var o = n.length, i = new Array(o), s = o, a = o, c = function(f) {
|
|
1144
1144
|
ce(e, function() {
|
|
1145
|
-
var
|
|
1146
|
-
|
|
1147
|
-
i[f] = l,
|
|
1145
|
+
var p = te(n[f], e), h = !1;
|
|
1146
|
+
p.subscribe(O(r, function(l) {
|
|
1147
|
+
i[f] = l, h || (h = !0, a--), a || r.next(t(i.slice()));
|
|
1148
1148
|
}, function() {
|
|
1149
|
-
--s ||
|
|
1149
|
+
--s || r.complete();
|
|
1150
1150
|
}));
|
|
1151
|
-
},
|
|
1151
|
+
}, r);
|
|
1152
1152
|
}, u = 0; u < o; u++)
|
|
1153
1153
|
c(u);
|
|
1154
|
-
},
|
|
1154
|
+
}, r);
|
|
1155
1155
|
};
|
|
1156
1156
|
}
|
|
1157
|
-
function ce(
|
|
1158
|
-
|
|
1157
|
+
function ce(n, e, t) {
|
|
1158
|
+
n ? A(t, n, e) : e();
|
|
1159
1159
|
}
|
|
1160
|
-
function Ut(
|
|
1161
|
-
var c = [], u = 0, f = 0,
|
|
1162
|
-
|
|
1163
|
-
}, l = function(
|
|
1164
|
-
return u <
|
|
1165
|
-
}, y = function(
|
|
1160
|
+
function Ut(n, e, t, r, o, i, s, a) {
|
|
1161
|
+
var c = [], u = 0, f = 0, p = !1, h = function() {
|
|
1162
|
+
p && !c.length && !u && e.complete();
|
|
1163
|
+
}, l = function(v) {
|
|
1164
|
+
return u < r ? y(v) : c.push(v);
|
|
1165
|
+
}, y = function(v) {
|
|
1166
1166
|
u++;
|
|
1167
|
-
var
|
|
1168
|
-
|
|
1169
|
-
e.next(
|
|
1167
|
+
var w = !1;
|
|
1168
|
+
_(t(v, f++)).subscribe(O(e, function(E) {
|
|
1169
|
+
e.next(E);
|
|
1170
1170
|
}, function() {
|
|
1171
|
-
|
|
1171
|
+
w = !0;
|
|
1172
1172
|
}, void 0, function() {
|
|
1173
|
-
if (
|
|
1173
|
+
if (w)
|
|
1174
1174
|
try {
|
|
1175
1175
|
u--;
|
|
1176
|
-
for (var
|
|
1176
|
+
for (var E = function() {
|
|
1177
1177
|
var T = c.shift();
|
|
1178
1178
|
s || y(T);
|
|
1179
|
-
}; c.length && u <
|
|
1180
|
-
|
|
1181
|
-
|
|
1179
|
+
}; c.length && u < r; )
|
|
1180
|
+
E();
|
|
1181
|
+
h();
|
|
1182
1182
|
} catch (T) {
|
|
1183
1183
|
e.error(T);
|
|
1184
1184
|
}
|
|
1185
1185
|
}));
|
|
1186
1186
|
};
|
|
1187
|
-
return
|
|
1188
|
-
|
|
1187
|
+
return n.subscribe(O(e, l, function() {
|
|
1188
|
+
p = !0, h();
|
|
1189
1189
|
})), function() {
|
|
1190
1190
|
};
|
|
1191
1191
|
}
|
|
1192
|
-
function
|
|
1193
|
-
return t === void 0 && (t = 1 / 0), m(e) ?
|
|
1194
|
-
return
|
|
1195
|
-
return e(
|
|
1196
|
-
})(
|
|
1197
|
-
}, t) : (typeof e == "number" && (t = e),
|
|
1198
|
-
return Ut(
|
|
1192
|
+
function H(n, e, t) {
|
|
1193
|
+
return t === void 0 && (t = 1 / 0), m(e) ? H(function(r, o) {
|
|
1194
|
+
return F(function(i, s) {
|
|
1195
|
+
return e(r, i, o, s);
|
|
1196
|
+
})(_(n(r, o)));
|
|
1197
|
+
}, t) : (typeof e == "number" && (t = e), L(function(r, o) {
|
|
1198
|
+
return Ut(r, o, n, t);
|
|
1199
1199
|
}));
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1202
|
-
|
|
1203
|
-
var
|
|
1204
|
-
return e != null && (ge(e) ? t = e :
|
|
1205
|
-
var i =
|
|
1201
|
+
function Ue(n, e, t) {
|
|
1202
|
+
n === void 0 && (n = 0), t === void 0 && (t = it);
|
|
1203
|
+
var r = -1;
|
|
1204
|
+
return e != null && (ge(e) ? t = e : r = e), new g(function(o) {
|
|
1205
|
+
var i = Et(n) ? +n - t.now() : n;
|
|
1206
1206
|
i < 0 && (i = 0);
|
|
1207
1207
|
var s = 0;
|
|
1208
1208
|
return t.schedule(function() {
|
|
1209
|
-
o.closed || (o.next(s++), 0 <=
|
|
1209
|
+
o.closed || (o.next(s++), 0 <= r ? this.schedule(void 0, r) : o.complete());
|
|
1210
1210
|
}, i);
|
|
1211
1211
|
});
|
|
1212
1212
|
}
|
|
1213
|
-
function kt(
|
|
1214
|
-
return m(e) ?
|
|
1213
|
+
function kt(n, e) {
|
|
1214
|
+
return m(e) ? H(n, e, 1) : H(n, 1);
|
|
1215
1215
|
}
|
|
1216
|
-
function $t(
|
|
1217
|
-
return
|
|
1218
|
-
return
|
|
1219
|
-
} :
|
|
1220
|
-
var
|
|
1221
|
-
e.subscribe(
|
|
1222
|
-
++
|
|
1216
|
+
function $t(n) {
|
|
1217
|
+
return n <= 0 ? function() {
|
|
1218
|
+
return st;
|
|
1219
|
+
} : L(function(e, t) {
|
|
1220
|
+
var r = 0;
|
|
1221
|
+
e.subscribe(O(t, function(o) {
|
|
1222
|
+
++r <= n && (t.next(o), n <= r && t.complete());
|
|
1223
1223
|
}));
|
|
1224
1224
|
});
|
|
1225
1225
|
}
|
|
1226
|
-
function jt(
|
|
1227
|
-
return
|
|
1228
|
-
return
|
|
1226
|
+
function jt(n) {
|
|
1227
|
+
return F(function() {
|
|
1228
|
+
return n;
|
|
1229
1229
|
});
|
|
1230
1230
|
}
|
|
1231
|
-
function Dt(
|
|
1232
|
-
return
|
|
1233
|
-
return
|
|
1231
|
+
function Dt(n, e) {
|
|
1232
|
+
return H(function(t, r) {
|
|
1233
|
+
return _(n(t, r)).pipe($t(1), jt(t));
|
|
1234
1234
|
});
|
|
1235
1235
|
}
|
|
1236
|
-
function
|
|
1236
|
+
function Ht(n, e) {
|
|
1237
1237
|
e === void 0 && (e = be);
|
|
1238
|
-
var t =
|
|
1238
|
+
var t = Ue(n, e);
|
|
1239
1239
|
return Dt(function() {
|
|
1240
1240
|
return t;
|
|
1241
1241
|
});
|
|
1242
1242
|
}
|
|
1243
|
-
function
|
|
1243
|
+
function Gt(n) {
|
|
1244
1244
|
var e;
|
|
1245
1245
|
e = {
|
|
1246
|
-
count:
|
|
1246
|
+
count: n
|
|
1247
1247
|
};
|
|
1248
|
-
var t = e.count,
|
|
1249
|
-
return
|
|
1250
|
-
var u = 0, f,
|
|
1251
|
-
var
|
|
1252
|
-
f = a.subscribe(
|
|
1248
|
+
var t = e.count, r = t === void 0 ? 1 / 0 : t, o = e.delay, i = e.resetOnSuccess, s = i === void 0 ? !1 : i;
|
|
1249
|
+
return r <= 0 ? G : L(function(a, c) {
|
|
1250
|
+
var u = 0, f, p = function() {
|
|
1251
|
+
var h = !1;
|
|
1252
|
+
f = a.subscribe(O(c, function(l) {
|
|
1253
1253
|
s && (u = 0), c.next(l);
|
|
1254
1254
|
}, void 0, function(l) {
|
|
1255
|
-
if (u++ <
|
|
1255
|
+
if (u++ < r) {
|
|
1256
1256
|
var y = function() {
|
|
1257
|
-
f ? (f.unsubscribe(), f = null,
|
|
1257
|
+
f ? (f.unsubscribe(), f = null, p()) : h = !0;
|
|
1258
1258
|
};
|
|
1259
1259
|
if (o != null) {
|
|
1260
|
-
var
|
|
1261
|
-
|
|
1260
|
+
var v = typeof o == "number" ? Ue(o) : _(o(l, u)), w = O(c, function() {
|
|
1261
|
+
w.unsubscribe(), y();
|
|
1262
1262
|
}, function() {
|
|
1263
1263
|
c.complete();
|
|
1264
1264
|
});
|
|
1265
|
-
|
|
1265
|
+
v.subscribe(w);
|
|
1266
1266
|
} else
|
|
1267
1267
|
y();
|
|
1268
1268
|
} else
|
|
1269
1269
|
c.error(l);
|
|
1270
|
-
})),
|
|
1270
|
+
})), h && (f.unsubscribe(), f = null, p());
|
|
1271
1271
|
};
|
|
1272
|
-
|
|
1272
|
+
p();
|
|
1273
1273
|
});
|
|
1274
1274
|
}
|
|
1275
|
-
function
|
|
1276
|
-
return
|
|
1277
|
-
|
|
1275
|
+
function Ft(n) {
|
|
1276
|
+
return L(function(e, t) {
|
|
1277
|
+
_(n).subscribe(O(t, function() {
|
|
1278
1278
|
return t.complete();
|
|
1279
1279
|
}, W)), !t.closed && e.subscribe(t);
|
|
1280
1280
|
});
|
|
1281
1281
|
}
|
|
1282
|
-
async function
|
|
1283
|
-
const t =
|
|
1284
|
-
let
|
|
1285
|
-
for (; !(
|
|
1286
|
-
e(
|
|
1282
|
+
async function Vt(n, e) {
|
|
1283
|
+
const t = n.getReader();
|
|
1284
|
+
let r;
|
|
1285
|
+
for (; !(r = await t.read()).done; )
|
|
1286
|
+
e(r.value);
|
|
1287
1287
|
}
|
|
1288
|
-
function
|
|
1289
|
-
let e, t,
|
|
1288
|
+
function qt(n) {
|
|
1289
|
+
let e, t, r, o = !1;
|
|
1290
1290
|
return function(s) {
|
|
1291
|
-
e === void 0 ? (e = s, t = 0,
|
|
1291
|
+
e === void 0 ? (e = s, t = 0, r = -1) : e = Yt(e, s);
|
|
1292
1292
|
const a = e.length;
|
|
1293
1293
|
let c = 0;
|
|
1294
1294
|
for (; t < a; ) {
|
|
@@ -1297,7 +1297,7 @@ function Vt(r) {
|
|
|
1297
1297
|
for (; t < a && u === -1; ++t)
|
|
1298
1298
|
switch (e[t]) {
|
|
1299
1299
|
case 58:
|
|
1300
|
-
|
|
1300
|
+
r === -1 && (r = t - c);
|
|
1301
1301
|
break;
|
|
1302
1302
|
case 13:
|
|
1303
1303
|
o = !0;
|
|
@@ -1307,41 +1307,41 @@ function Vt(r) {
|
|
|
1307
1307
|
}
|
|
1308
1308
|
if (u === -1)
|
|
1309
1309
|
break;
|
|
1310
|
-
|
|
1310
|
+
n(e.subarray(c, u), r), c = t, r = -1;
|
|
1311
1311
|
}
|
|
1312
1312
|
c === a ? e = void 0 : c !== 0 && (e = e.subarray(c), t -= c);
|
|
1313
1313
|
};
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1316
|
-
let
|
|
1315
|
+
function Kt(n, e, t) {
|
|
1316
|
+
let r = ue();
|
|
1317
1317
|
const o = new TextDecoder();
|
|
1318
1318
|
return function(s, a) {
|
|
1319
1319
|
if (s.length === 0)
|
|
1320
|
-
t?.(
|
|
1320
|
+
t?.(r), r = ue();
|
|
1321
1321
|
else if (a > 0) {
|
|
1322
1322
|
const c = o.decode(s.subarray(0, a)), u = a + (s[a + 1] === 32 ? 2 : 1), f = o.decode(s.subarray(u));
|
|
1323
1323
|
switch (c) {
|
|
1324
1324
|
case "data":
|
|
1325
|
-
|
|
1325
|
+
r.data = r.data ? r.data + `
|
|
1326
1326
|
` + f : f;
|
|
1327
1327
|
break;
|
|
1328
1328
|
case "event":
|
|
1329
|
-
|
|
1329
|
+
r.event = f;
|
|
1330
1330
|
break;
|
|
1331
1331
|
case "id":
|
|
1332
|
-
r
|
|
1332
|
+
n(r.id = f);
|
|
1333
1333
|
break;
|
|
1334
1334
|
case "retry":
|
|
1335
|
-
const
|
|
1336
|
-
isNaN(
|
|
1335
|
+
const p = parseInt(f, 10);
|
|
1336
|
+
isNaN(p) || e(r.retry = p);
|
|
1337
1337
|
break;
|
|
1338
1338
|
}
|
|
1339
1339
|
}
|
|
1340
1340
|
};
|
|
1341
1341
|
}
|
|
1342
|
-
function
|
|
1343
|
-
const t = new Uint8Array(
|
|
1344
|
-
return t.set(
|
|
1342
|
+
function Yt(n, e) {
|
|
1343
|
+
const t = new Uint8Array(n.length + e.length);
|
|
1344
|
+
return t.set(n), t.set(e, n.length), t;
|
|
1345
1345
|
}
|
|
1346
1346
|
function ue() {
|
|
1347
1347
|
return {
|
|
@@ -1351,63 +1351,63 @@ function ue() {
|
|
|
1351
1351
|
retry: void 0
|
|
1352
1352
|
};
|
|
1353
1353
|
}
|
|
1354
|
-
var Bt = function(
|
|
1354
|
+
var Bt = function(n, e) {
|
|
1355
1355
|
var t = {};
|
|
1356
|
-
for (var
|
|
1357
|
-
if (
|
|
1358
|
-
for (var o = 0,
|
|
1359
|
-
e.indexOf(
|
|
1356
|
+
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
|
|
1357
|
+
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1358
|
+
for (var o = 0, r = Object.getOwnPropertySymbols(n); o < r.length; o++)
|
|
1359
|
+
e.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(n, r[o]) && (t[r[o]] = n[r[o]]);
|
|
1360
1360
|
return t;
|
|
1361
1361
|
};
|
|
1362
|
-
const J = "text/event-stream",
|
|
1363
|
-
function
|
|
1364
|
-
var { signal: t, headers:
|
|
1365
|
-
return new Promise((
|
|
1366
|
-
const l = Object.assign({},
|
|
1362
|
+
const J = "text/event-stream", Wt = 1e3, le = "last-event-id";
|
|
1363
|
+
function Xt(n, e) {
|
|
1364
|
+
var { signal: t, headers: r, onopen: o, onmessage: i, onclose: s, onerror: a, openWhenHidden: c, fetch: u } = e, f = Bt(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
1365
|
+
return new Promise((p, h) => {
|
|
1366
|
+
const l = Object.assign({}, r);
|
|
1367
1367
|
l.accept || (l.accept = J);
|
|
1368
1368
|
let y;
|
|
1369
|
-
function
|
|
1370
|
-
y.abort(), document.hidden ||
|
|
1369
|
+
function v() {
|
|
1370
|
+
y.abort(), document.hidden || V();
|
|
1371
1371
|
}
|
|
1372
|
-
c || document.addEventListener("visibilitychange",
|
|
1373
|
-
let
|
|
1372
|
+
c || document.addEventListener("visibilitychange", v);
|
|
1373
|
+
let w = Wt, E = 0;
|
|
1374
1374
|
function T() {
|
|
1375
|
-
document.removeEventListener("visibilitychange",
|
|
1375
|
+
document.removeEventListener("visibilitychange", v), window.clearTimeout(E), y.abort();
|
|
1376
1376
|
}
|
|
1377
1377
|
t?.addEventListener("abort", () => {
|
|
1378
|
-
T(),
|
|
1378
|
+
T(), p();
|
|
1379
1379
|
});
|
|
1380
|
-
const
|
|
1381
|
-
async function
|
|
1382
|
-
var
|
|
1380
|
+
const $e = u ?? window.fetch, je = o ?? Jt;
|
|
1381
|
+
async function V() {
|
|
1382
|
+
var q;
|
|
1383
1383
|
y = new AbortController();
|
|
1384
1384
|
try {
|
|
1385
|
-
const
|
|
1386
|
-
await
|
|
1387
|
-
|
|
1388
|
-
}, (
|
|
1389
|
-
|
|
1390
|
-
}, i))), s?.(), T(),
|
|
1391
|
-
} catch (
|
|
1385
|
+
const U = await $e(n, Object.assign(Object.assign({}, f), { headers: l, signal: y.signal }));
|
|
1386
|
+
await je(U), await Vt(U.body, qt(Kt((C) => {
|
|
1387
|
+
C ? l[le] = C : delete l[le];
|
|
1388
|
+
}, (C) => {
|
|
1389
|
+
w = C;
|
|
1390
|
+
}, i))), s?.(), T(), p();
|
|
1391
|
+
} catch (U) {
|
|
1392
1392
|
if (!y.signal.aborted)
|
|
1393
1393
|
try {
|
|
1394
|
-
const
|
|
1395
|
-
window.clearTimeout(
|
|
1396
|
-
} catch (
|
|
1397
|
-
T(),
|
|
1394
|
+
const C = (q = a?.(U)) !== null && q !== void 0 ? q : w;
|
|
1395
|
+
window.clearTimeout(E), E = window.setTimeout(V, C);
|
|
1396
|
+
} catch (C) {
|
|
1397
|
+
T(), h(C);
|
|
1398
1398
|
}
|
|
1399
1399
|
}
|
|
1400
1400
|
}
|
|
1401
|
-
|
|
1401
|
+
V();
|
|
1402
1402
|
});
|
|
1403
1403
|
}
|
|
1404
|
-
function
|
|
1405
|
-
const e =
|
|
1404
|
+
function Jt(n) {
|
|
1405
|
+
const e = n.headers.get("content-type");
|
|
1406
1406
|
if (!e?.startsWith(J))
|
|
1407
1407
|
throw new Error(`Expected content-type to be ${J}, Actual: ${e}`);
|
|
1408
1408
|
}
|
|
1409
|
-
function
|
|
1410
|
-
const { endpoint: e, apiKey: t, payload:
|
|
1409
|
+
function zt(n) {
|
|
1410
|
+
const { endpoint: e, apiKey: t, payload: r, debugMode: o, customHeaders: i } = n;
|
|
1411
1411
|
return new g((s) => {
|
|
1412
1412
|
const a = new AbortController();
|
|
1413
1413
|
let c;
|
|
@@ -1418,50 +1418,50 @@ function Jt(r) {
|
|
|
1418
1418
|
t && (u["X-API-KEY"] = t);
|
|
1419
1419
|
const f = new URLSearchParams();
|
|
1420
1420
|
o && f.set("is_debug", "true");
|
|
1421
|
-
const
|
|
1422
|
-
return f.toString() && (
|
|
1421
|
+
const p = new URL(e);
|
|
1422
|
+
return f.toString() && (p.search = f.toString()), Xt(p.toString(), {
|
|
1423
1423
|
method: "POST",
|
|
1424
1424
|
headers: u,
|
|
1425
|
-
body:
|
|
1425
|
+
body: r ? JSON.stringify(r) : void 0,
|
|
1426
1426
|
signal: a.signal,
|
|
1427
1427
|
/**
|
|
1428
1428
|
* Allow SSE to work when the page is hidden.
|
|
1429
1429
|
* https://github.com/Azure/fetch-event-source/issues/17#issuecomment-1525904929
|
|
1430
1430
|
*/
|
|
1431
1431
|
openWhenHidden: !0,
|
|
1432
|
-
onopen: async (
|
|
1433
|
-
if (
|
|
1434
|
-
c =
|
|
1432
|
+
onopen: async (h) => {
|
|
1433
|
+
if (h.ok)
|
|
1434
|
+
c = h.headers.get("X-Trace-Id") ?? void 0;
|
|
1435
1435
|
else {
|
|
1436
1436
|
let l;
|
|
1437
1437
|
try {
|
|
1438
|
-
l = await
|
|
1438
|
+
l = await h.json();
|
|
1439
1439
|
} catch {
|
|
1440
1440
|
try {
|
|
1441
|
-
l = await
|
|
1441
|
+
l = await h.text();
|
|
1442
1442
|
} catch {
|
|
1443
1443
|
l = null;
|
|
1444
1444
|
}
|
|
1445
1445
|
}
|
|
1446
|
-
s.error(new de(
|
|
1446
|
+
s.error(new de(h.status, h.statusText, l)), a.abort();
|
|
1447
1447
|
}
|
|
1448
1448
|
},
|
|
1449
|
-
onmessage: (
|
|
1450
|
-
const l = JSON.parse(
|
|
1449
|
+
onmessage: (h) => {
|
|
1450
|
+
const l = JSON.parse(h.data);
|
|
1451
1451
|
c ? l.traceId = c : l.requestId && (l.traceId = l.requestId, c || (c = l.requestId)), s.next(l);
|
|
1452
1452
|
},
|
|
1453
1453
|
onclose: () => {
|
|
1454
1454
|
s.complete();
|
|
1455
1455
|
},
|
|
1456
|
-
onerror: (
|
|
1457
|
-
throw s.error(
|
|
1456
|
+
onerror: (h) => {
|
|
1457
|
+
throw s.error(h), a.abort(), h;
|
|
1458
1458
|
}
|
|
1459
1459
|
}), () => {
|
|
1460
1460
|
a.abort();
|
|
1461
1461
|
};
|
|
1462
1462
|
});
|
|
1463
1463
|
}
|
|
1464
|
-
class
|
|
1464
|
+
class Qt {
|
|
1465
1465
|
listeners = {};
|
|
1466
1466
|
on(e, t) {
|
|
1467
1467
|
this.listeners = Object.assign({}, this.listeners, {
|
|
@@ -1470,23 +1470,23 @@ class zt {
|
|
|
1470
1470
|
}
|
|
1471
1471
|
off(e, t) {
|
|
1472
1472
|
this.listeners[e] && (this.listeners = Object.assign({}, this.listeners, {
|
|
1473
|
-
[e]: (this.listeners[e] ?? []).filter((
|
|
1473
|
+
[e]: (this.listeners[e] ?? []).filter((r) => r !== t)
|
|
1474
1474
|
}));
|
|
1475
1475
|
}
|
|
1476
1476
|
remove(e) {
|
|
1477
1477
|
delete this.listeners[e];
|
|
1478
1478
|
}
|
|
1479
1479
|
emit(e, ...t) {
|
|
1480
|
-
this.listeners[e] && this.listeners[e].forEach((
|
|
1480
|
+
this.listeners[e] && this.listeners[e].forEach((r) => r(...t));
|
|
1481
1481
|
}
|
|
1482
1482
|
}
|
|
1483
|
-
class
|
|
1483
|
+
class sn {
|
|
1484
1484
|
apiKey;
|
|
1485
1485
|
endpoint;
|
|
1486
1486
|
botProviderEndpoint;
|
|
1487
1487
|
debugMode;
|
|
1488
1488
|
destroy$ = new ee();
|
|
1489
|
-
sseEmitter = new
|
|
1489
|
+
sseEmitter = new Qt();
|
|
1490
1490
|
transformSsePayload;
|
|
1491
1491
|
customHeaders;
|
|
1492
1492
|
constructor(e) {
|
|
@@ -1504,47 +1504,53 @@ class or {
|
|
|
1504
1504
|
}
|
|
1505
1505
|
handleEvent(e) {
|
|
1506
1506
|
switch (e.eventType) {
|
|
1507
|
-
case
|
|
1508
|
-
this.sseEmitter.emit(
|
|
1507
|
+
case d.INIT:
|
|
1508
|
+
this.sseEmitter.emit(d.INIT, e);
|
|
1509
1509
|
break;
|
|
1510
|
-
case
|
|
1511
|
-
case
|
|
1512
|
-
this.sseEmitter.emit(
|
|
1510
|
+
case d.PROCESS_START:
|
|
1511
|
+
case d.PROCESS_COMPLETE:
|
|
1512
|
+
this.sseEmitter.emit(d.PROCESS, e);
|
|
1513
1513
|
break;
|
|
1514
|
-
case
|
|
1515
|
-
case
|
|
1516
|
-
case
|
|
1517
|
-
this.sseEmitter.emit(
|
|
1514
|
+
case d.MESSAGE_START:
|
|
1515
|
+
case d.MESSAGE_DELTA:
|
|
1516
|
+
case d.MESSAGE_COMPLETE:
|
|
1517
|
+
this.sseEmitter.emit(d.MESSAGE, e);
|
|
1518
1518
|
break;
|
|
1519
|
-
case
|
|
1520
|
-
case
|
|
1521
|
-
this.sseEmitter.emit(
|
|
1519
|
+
case d.TOOL_CALL_START:
|
|
1520
|
+
case d.TOOL_CALL_COMPLETE:
|
|
1521
|
+
this.sseEmitter.emit(d.TOOL_CALL, e);
|
|
1522
|
+
break;
|
|
1523
|
+
case d.TOOL_CALL_CONSENT:
|
|
1524
|
+
this.sseEmitter.emit(
|
|
1525
|
+
d.TOOL_CALL_CONSENT,
|
|
1526
|
+
e
|
|
1527
|
+
);
|
|
1522
1528
|
break;
|
|
1523
|
-
case
|
|
1524
|
-
this.sseEmitter.emit(
|
|
1529
|
+
case d.DONE:
|
|
1530
|
+
this.sseEmitter.emit(d.DONE, e);
|
|
1525
1531
|
break;
|
|
1526
|
-
case
|
|
1527
|
-
this.sseEmitter.emit(
|
|
1532
|
+
case d.ERROR:
|
|
1533
|
+
this.sseEmitter.emit(d.ERROR, e);
|
|
1528
1534
|
break;
|
|
1529
1535
|
}
|
|
1530
1536
|
}
|
|
1531
1537
|
fetchSse(e, t) {
|
|
1532
|
-
t?.onSseStart?.(),
|
|
1538
|
+
t?.onSseStart?.(), zt({
|
|
1533
1539
|
apiKey: this.apiKey,
|
|
1534
1540
|
endpoint: this.endpoint,
|
|
1535
1541
|
debugMode: this.debugMode,
|
|
1536
1542
|
payload: this.transformSsePayload?.(e) ?? e,
|
|
1537
1543
|
customHeaders: this.customHeaders
|
|
1538
1544
|
}).pipe(
|
|
1539
|
-
kt((
|
|
1540
|
-
|
|
1541
|
-
|
|
1545
|
+
kt((r) => wt(r).pipe(Ht(t?.delayTime ?? 50))),
|
|
1546
|
+
Ft(this.destroy$),
|
|
1547
|
+
Gt(3)
|
|
1542
1548
|
).subscribe({
|
|
1543
|
-
next: (
|
|
1544
|
-
t?.onSseMessage?.(
|
|
1549
|
+
next: (r) => {
|
|
1550
|
+
t?.onSseMessage?.(r), this.handleEvent(r);
|
|
1545
1551
|
},
|
|
1546
|
-
error: (
|
|
1547
|
-
t?.onSseError?.(
|
|
1552
|
+
error: (r) => {
|
|
1553
|
+
t?.onSseError?.(r);
|
|
1548
1554
|
},
|
|
1549
1555
|
complete: () => {
|
|
1550
1556
|
t?.onSseCompleted?.();
|
|
@@ -1559,8 +1565,8 @@ class or {
|
|
|
1559
1565
|
* 根據 API 文件:/ns/{namespace}/bot-provider/{bot_provider_name}/blob
|
|
1560
1566
|
*/
|
|
1561
1567
|
async uploadFile(e, t) {
|
|
1562
|
-
const
|
|
1563
|
-
if (!
|
|
1568
|
+
const r = this.deriveBlobEndpoint();
|
|
1569
|
+
if (!r)
|
|
1564
1570
|
throw new Error("Unable to derive blob endpoint. Please provide botProviderEndpoint in config.");
|
|
1565
1571
|
const o = new FormData();
|
|
1566
1572
|
o.append("file", e), o.append("customChannelId", t);
|
|
@@ -1569,7 +1575,7 @@ class or {
|
|
|
1569
1575
|
};
|
|
1570
1576
|
this.apiKey && (i["X-API-KEY"] = this.apiKey);
|
|
1571
1577
|
try {
|
|
1572
|
-
const s = await fetch(
|
|
1578
|
+
const s = await fetch(r, {
|
|
1573
1579
|
method: "POST",
|
|
1574
1580
|
headers: i,
|
|
1575
1581
|
body: o
|
|
@@ -1593,64 +1599,70 @@ class or {
|
|
|
1593
1599
|
}
|
|
1594
1600
|
}
|
|
1595
1601
|
const b = [];
|
|
1596
|
-
for (let
|
|
1597
|
-
b.push((
|
|
1598
|
-
function
|
|
1599
|
-
return (b[
|
|
1600
|
-
}
|
|
1601
|
-
let
|
|
1602
|
-
const
|
|
1603
|
-
function
|
|
1604
|
-
if (!
|
|
1602
|
+
for (let n = 0; n < 256; ++n)
|
|
1603
|
+
b.push((n + 256).toString(16).slice(1));
|
|
1604
|
+
function Zt(n, e = 0) {
|
|
1605
|
+
return (b[n[e + 0]] + b[n[e + 1]] + b[n[e + 2]] + b[n[e + 3]] + "-" + b[n[e + 4]] + b[n[e + 5]] + "-" + b[n[e + 6]] + b[n[e + 7]] + "-" + b[n[e + 8]] + b[n[e + 9]] + "-" + b[n[e + 10]] + b[n[e + 11]] + b[n[e + 12]] + b[n[e + 13]] + b[n[e + 14]] + b[n[e + 15]]).toLowerCase();
|
|
1606
|
+
}
|
|
1607
|
+
let Y;
|
|
1608
|
+
const en = new Uint8Array(16);
|
|
1609
|
+
function tn() {
|
|
1610
|
+
if (!Y) {
|
|
1605
1611
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
1606
1612
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1607
|
-
|
|
1613
|
+
Y = crypto.getRandomValues.bind(crypto);
|
|
1608
1614
|
}
|
|
1609
|
-
return
|
|
1615
|
+
return Y(en);
|
|
1610
1616
|
}
|
|
1611
|
-
const
|
|
1612
|
-
function
|
|
1613
|
-
|
|
1614
|
-
const
|
|
1615
|
-
if (
|
|
1617
|
+
const nn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), fe = { randomUUID: nn };
|
|
1618
|
+
function rn(n, e, t) {
|
|
1619
|
+
n = n || {};
|
|
1620
|
+
const r = n.random ?? n.rng?.() ?? tn();
|
|
1621
|
+
if (r.length < 16)
|
|
1616
1622
|
throw new Error("Random bytes length must be >= 16");
|
|
1617
|
-
return
|
|
1623
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Zt(r);
|
|
1618
1624
|
}
|
|
1619
|
-
function
|
|
1620
|
-
return fe.randomUUID && !
|
|
1625
|
+
function ke(n, e, t) {
|
|
1626
|
+
return fe.randomUUID && !n ? fe.randomUUID() : rn(n);
|
|
1621
1627
|
}
|
|
1622
|
-
class
|
|
1628
|
+
class S {
|
|
1623
1629
|
messages = null;
|
|
1624
|
-
|
|
1625
|
-
|
|
1630
|
+
pendingConsent = null;
|
|
1631
|
+
constructor({ messages: e, pendingConsent: t = null }) {
|
|
1632
|
+
this.messages = e, this.pendingConsent = t ?? null;
|
|
1626
1633
|
}
|
|
1627
1634
|
pushMessage(e) {
|
|
1628
1635
|
const t = new Map(this.messages);
|
|
1629
|
-
return t.set(e.messageId, e), new
|
|
1636
|
+
return t.set(e.messageId, e), new S({ messages: t, pendingConsent: this.pendingConsent });
|
|
1637
|
+
}
|
|
1638
|
+
clearPendingConsent() {
|
|
1639
|
+
return this.pendingConsent ? new S({ messages: this.messages, pendingConsent: null }) : this;
|
|
1630
1640
|
}
|
|
1631
1641
|
onMessage(e) {
|
|
1632
1642
|
switch (e.eventType) {
|
|
1633
|
-
case
|
|
1643
|
+
case d.MESSAGE_START:
|
|
1634
1644
|
return this.onMessageStart(e);
|
|
1635
|
-
case
|
|
1645
|
+
case d.MESSAGE_DELTA:
|
|
1636
1646
|
return this.onMessageDelta(e);
|
|
1637
|
-
case
|
|
1647
|
+
case d.MESSAGE_COMPLETE:
|
|
1638
1648
|
return this.onMessageComplete(e);
|
|
1639
|
-
case
|
|
1649
|
+
case d.TOOL_CALL_START:
|
|
1640
1650
|
return this.onToolCallStart(e);
|
|
1641
|
-
case
|
|
1651
|
+
case d.TOOL_CALL_COMPLETE:
|
|
1642
1652
|
return this.onToolCallComplete(e);
|
|
1643
|
-
case
|
|
1653
|
+
case d.TOOL_CALL_CONSENT:
|
|
1654
|
+
return this.onToolCallConsent(e);
|
|
1655
|
+
case d.ERROR:
|
|
1644
1656
|
return this.onMessageError(e);
|
|
1645
1657
|
default:
|
|
1646
1658
|
return this;
|
|
1647
1659
|
}
|
|
1648
1660
|
}
|
|
1649
1661
|
onMessageStart(e) {
|
|
1650
|
-
const t = e.fact.messageStart.message,
|
|
1651
|
-
return
|
|
1662
|
+
const t = e.fact.messageStart.message, r = new Map(this.messages);
|
|
1663
|
+
return r.set(t.messageId, {
|
|
1652
1664
|
type: "bot",
|
|
1653
|
-
eventType:
|
|
1665
|
+
eventType: d.MESSAGE_START,
|
|
1654
1666
|
isTyping: !0,
|
|
1655
1667
|
typingText: "",
|
|
1656
1668
|
messageId: t.messageId,
|
|
@@ -1658,15 +1670,15 @@ class E {
|
|
|
1658
1670
|
time: /* @__PURE__ */ new Date(),
|
|
1659
1671
|
traceId: e.traceId,
|
|
1660
1672
|
raw: ""
|
|
1661
|
-
}), new
|
|
1673
|
+
}), new S({ messages: r, pendingConsent: this.pendingConsent });
|
|
1662
1674
|
}
|
|
1663
1675
|
onMessageDelta(e) {
|
|
1664
|
-
const t = e.fact.messageDelta.message,
|
|
1676
|
+
const t = e.fact.messageDelta.message, r = new Map(this.messages), o = r.get(t.messageId);
|
|
1665
1677
|
if (o?.type !== "bot") return this;
|
|
1666
1678
|
const i = `${o?.typingText ?? ""}${t.text}`;
|
|
1667
|
-
return
|
|
1679
|
+
return r.set(t.messageId, {
|
|
1668
1680
|
type: "bot",
|
|
1669
|
-
eventType:
|
|
1681
|
+
eventType: d.MESSAGE_DELTA,
|
|
1670
1682
|
isTyping: !0,
|
|
1671
1683
|
typingText: i,
|
|
1672
1684
|
messageId: t.messageId,
|
|
@@ -1674,13 +1686,13 @@ class E {
|
|
|
1674
1686
|
time: /* @__PURE__ */ new Date(),
|
|
1675
1687
|
traceId: e.traceId ?? o.traceId,
|
|
1676
1688
|
raw: o.raw
|
|
1677
|
-
}), new
|
|
1689
|
+
}), new S({ messages: r, pendingConsent: this.pendingConsent });
|
|
1678
1690
|
}
|
|
1679
1691
|
onMessageComplete(e) {
|
|
1680
|
-
const t = e.fact.messageComplete.message,
|
|
1681
|
-
return
|
|
1692
|
+
const t = e.fact.messageComplete.message, r = new Map(this.messages), o = r.get(t.messageId);
|
|
1693
|
+
return r.set(t.messageId, {
|
|
1682
1694
|
type: "bot",
|
|
1683
|
-
eventType:
|
|
1695
|
+
eventType: d.MESSAGE_COMPLETE,
|
|
1684
1696
|
isTyping: !1,
|
|
1685
1697
|
typingText: null,
|
|
1686
1698
|
messageId: t.messageId,
|
|
@@ -1688,23 +1700,23 @@ class E {
|
|
|
1688
1700
|
time: /* @__PURE__ */ new Date(),
|
|
1689
1701
|
traceId: e.traceId ?? (o?.type === "bot" ? o.traceId : void 0),
|
|
1690
1702
|
raw: JSON.stringify(e)
|
|
1691
|
-
}), new
|
|
1703
|
+
}), new S({ messages: r, pendingConsent: this.pendingConsent });
|
|
1692
1704
|
}
|
|
1693
1705
|
onMessageError(e) {
|
|
1694
|
-
const t =
|
|
1706
|
+
const t = ke(), r = e.fact.runError.error, o = new Map(this.messages);
|
|
1695
1707
|
return o.set(t, {
|
|
1696
1708
|
type: "error",
|
|
1697
|
-
eventType:
|
|
1709
|
+
eventType: d.ERROR,
|
|
1698
1710
|
messageId: t,
|
|
1699
|
-
error:
|
|
1711
|
+
error: r,
|
|
1700
1712
|
time: /* @__PURE__ */ new Date(),
|
|
1701
1713
|
traceId: e.traceId
|
|
1702
|
-
}), new
|
|
1714
|
+
}), new S({ messages: o, pendingConsent: this.pendingConsent });
|
|
1703
1715
|
}
|
|
1704
1716
|
onToolCallStart(e) {
|
|
1705
|
-
const t = e.fact.toolCallStart,
|
|
1717
|
+
const t = e.fact.toolCallStart, r = new Map(this.messages), o = `${t.processId}-${t.callSeq}`, i = {
|
|
1706
1718
|
type: "tool-call",
|
|
1707
|
-
eventType:
|
|
1719
|
+
eventType: d.TOOL_CALL_START,
|
|
1708
1720
|
messageId: o,
|
|
1709
1721
|
processId: t.processId,
|
|
1710
1722
|
callSeq: t.callSeq,
|
|
@@ -1715,21 +1727,25 @@ class E {
|
|
|
1715
1727
|
time: /* @__PURE__ */ new Date(),
|
|
1716
1728
|
traceId: e.traceId
|
|
1717
1729
|
};
|
|
1718
|
-
return
|
|
1730
|
+
return r.set(o, i), new S({ messages: r, pendingConsent: this.pendingConsent });
|
|
1719
1731
|
}
|
|
1720
1732
|
onToolCallComplete(e) {
|
|
1721
|
-
const t = e.fact.toolCallComplete,
|
|
1733
|
+
const t = e.fact.toolCallComplete, r = new Map(this.messages), o = `${t.processId}-${t.callSeq}`, i = r.get(o);
|
|
1722
1734
|
if (i?.type === "tool-call") {
|
|
1723
1735
|
const s = {
|
|
1724
1736
|
...i,
|
|
1725
|
-
eventType:
|
|
1737
|
+
eventType: d.TOOL_CALL_COMPLETE,
|
|
1726
1738
|
result: t.toolCallResult,
|
|
1727
1739
|
isComplete: !0,
|
|
1728
1740
|
traceId: e.traceId ?? i.traceId
|
|
1729
1741
|
};
|
|
1730
|
-
|
|
1742
|
+
r.set(o, s);
|
|
1731
1743
|
}
|
|
1732
|
-
return new
|
|
1744
|
+
return new S({ messages: r, pendingConsent: this.pendingConsent });
|
|
1745
|
+
}
|
|
1746
|
+
onToolCallConsent(e) {
|
|
1747
|
+
const t = e.fact.toolCallConsent;
|
|
1748
|
+
return new S({ messages: this.messages, pendingConsent: t });
|
|
1733
1749
|
}
|
|
1734
1750
|
}
|
|
1735
1751
|
class z {
|
|
@@ -1752,17 +1768,17 @@ class z {
|
|
|
1752
1768
|
const t = new z(e);
|
|
1753
1769
|
return t.subscribe(), t;
|
|
1754
1770
|
}
|
|
1755
|
-
static async reset(e, t,
|
|
1771
|
+
static async reset(e, t, r) {
|
|
1756
1772
|
const o = new z(e);
|
|
1757
1773
|
try {
|
|
1758
|
-
return o.subscribe(), await o.resetChannel(t,
|
|
1774
|
+
return o.subscribe(), await o.resetChannel(t, r), o;
|
|
1759
1775
|
} catch (i) {
|
|
1760
1776
|
throw o.close(), i;
|
|
1761
1777
|
}
|
|
1762
1778
|
}
|
|
1763
1779
|
subscribe() {
|
|
1764
|
-
this.statesSubscription =
|
|
1765
|
-
|
|
1780
|
+
this.statesSubscription = Rt([this.isConnecting$, this.conversation$]).pipe(
|
|
1781
|
+
F(([e, t]) => ({
|
|
1766
1782
|
isConnecting: e,
|
|
1767
1783
|
conversation: t
|
|
1768
1784
|
}))
|
|
@@ -1783,7 +1799,7 @@ class z {
|
|
|
1783
1799
|
return e;
|
|
1784
1800
|
}
|
|
1785
1801
|
fetchSse(e, t) {
|
|
1786
|
-
return new Promise((
|
|
1802
|
+
return new Promise((r, o) => {
|
|
1787
1803
|
this.isConnecting$.next(!0), this.client.fetchSse(e, {
|
|
1788
1804
|
onSseStart: t?.onSseStart,
|
|
1789
1805
|
onSseMessage: (i) => {
|
|
@@ -1792,7 +1808,7 @@ class z {
|
|
|
1792
1808
|
a && a.type === "user" && (s.set(this.currentUserMessageId, {
|
|
1793
1809
|
...a,
|
|
1794
1810
|
traceId: i.traceId
|
|
1795
|
-
}), this.conversation$.next(new
|
|
1811
|
+
}), this.conversation$.next(new S({ messages: s }))), this.currentUserMessageId = void 0;
|
|
1796
1812
|
}
|
|
1797
1813
|
this.conversation$.next(this.conversation$.value.onMessage(i));
|
|
1798
1814
|
},
|
|
@@ -1800,7 +1816,7 @@ class z {
|
|
|
1800
1816
|
t?.onSseError?.(i), this.isConnecting$.next(!1), this.currentUserMessageId = void 0, o(i);
|
|
1801
1817
|
},
|
|
1802
1818
|
onSseCompleted: () => {
|
|
1803
|
-
t?.onSseCompleted?.(), this.isConnecting$.next(!1), this.currentUserMessageId = void 0,
|
|
1819
|
+
t?.onSseCompleted?.(), this.isConnecting$.next(!1), this.currentUserMessageId = void 0, r();
|
|
1804
1820
|
}
|
|
1805
1821
|
});
|
|
1806
1822
|
});
|
|
@@ -1808,7 +1824,7 @@ class z {
|
|
|
1808
1824
|
resetChannel(e, t) {
|
|
1809
1825
|
return this.fetchSse(
|
|
1810
1826
|
{
|
|
1811
|
-
action:
|
|
1827
|
+
action: $.RESET_CHANNEL,
|
|
1812
1828
|
customChannelId: this.customChannelId,
|
|
1813
1829
|
customMessageId: this.customMessageId,
|
|
1814
1830
|
text: e?.text || "",
|
|
@@ -1818,12 +1834,12 @@ class z {
|
|
|
1818
1834
|
);
|
|
1819
1835
|
}
|
|
1820
1836
|
sendMessage(e, t) {
|
|
1821
|
-
const
|
|
1837
|
+
const r = e.text.trim(), o = e.customMessageId ?? ke();
|
|
1822
1838
|
return this.currentUserMessageId = o, this.conversation$.next(
|
|
1823
1839
|
this.conversation$.value.pushMessage({
|
|
1824
1840
|
type: "user",
|
|
1825
1841
|
messageId: o,
|
|
1826
|
-
text:
|
|
1842
|
+
text: r,
|
|
1827
1843
|
blobIds: e.blobIds,
|
|
1828
1844
|
filePreviewUrls: e.filePreviewUrls,
|
|
1829
1845
|
documentNames: e.documentNames,
|
|
@@ -1831,28 +1847,41 @@ class z {
|
|
|
1831
1847
|
})
|
|
1832
1848
|
), this.fetchSse(
|
|
1833
1849
|
{
|
|
1834
|
-
action:
|
|
1850
|
+
action: $.NONE,
|
|
1835
1851
|
customChannelId: this.customChannelId,
|
|
1836
1852
|
customMessageId: o,
|
|
1837
1853
|
payload: this.resolvePayload(e?.payload),
|
|
1838
|
-
text:
|
|
1854
|
+
text: r,
|
|
1839
1855
|
blobIds: e?.blobIds
|
|
1840
1856
|
},
|
|
1841
1857
|
t
|
|
1842
1858
|
);
|
|
1843
1859
|
}
|
|
1860
|
+
replyToolCallConsents(e, t) {
|
|
1861
|
+
return this.conversation$.next(this.conversation$.value.clearPendingConsent()), this.fetchSse(
|
|
1862
|
+
{
|
|
1863
|
+
action: $.RESPONSE_TOOL_CALL_CONSENT,
|
|
1864
|
+
customChannelId: this.customChannelId,
|
|
1865
|
+
customMessageId: this.customMessageId,
|
|
1866
|
+
text: "",
|
|
1867
|
+
toolCallConsents: e
|
|
1868
|
+
},
|
|
1869
|
+
t
|
|
1870
|
+
);
|
|
1871
|
+
}
|
|
1844
1872
|
close() {
|
|
1845
1873
|
this.isConnecting$.complete(), this.conversation$.complete(), this.statesSubscription?.unsubscribe();
|
|
1846
1874
|
}
|
|
1847
1875
|
}
|
|
1848
1876
|
export {
|
|
1849
|
-
|
|
1877
|
+
sn as AsgardServiceClient,
|
|
1850
1878
|
z as Channel,
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1879
|
+
S as Conversation,
|
|
1880
|
+
d as EventType,
|
|
1881
|
+
$ as FetchSseAction,
|
|
1854
1882
|
de as HttpError,
|
|
1855
|
-
|
|
1856
|
-
|
|
1883
|
+
He as MessageTemplateType,
|
|
1884
|
+
De as ToolCallConsentResult,
|
|
1885
|
+
on as isHttpError
|
|
1857
1886
|
};
|
|
1858
1887
|
//# sourceMappingURL=index.mjs.map
|