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