@graffiti-garden/wrapper-vue 0.5.0 → 0.6.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/browser/plugin.mjs +661 -639
- package/dist/browser/plugin.mjs.map +1 -1
- package/dist/node/composables.d.ts +2 -6
- package/dist/node/composables.d.ts.map +1 -1
- package/dist/node/plugin.js +1 -1
- package/dist/node/plugin.js.map +1 -1
- package/dist/node/plugin.mjs +166 -191
- package/dist/node/plugin.mjs.map +1 -1
- package/dist/node/pollers.d.ts +6 -10
- package/dist/node/pollers.d.ts.map +1 -1
- package/dist/node/reducers.d.ts +8 -11
- package/dist/node/reducers.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/composables.ts +15 -12
- package/src/pollers.ts +36 -84
- package/src/reducers.ts +46 -34
package/dist/browser/plugin.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var he = Object.defineProperty;
|
|
2
|
-
var pe = (t,
|
|
3
|
-
var
|
|
4
|
-
import { inject as X, ref as
|
|
2
|
+
var pe = (t, n, e) => n in t ? he(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
3
|
+
var v = (t, n, e) => pe(t, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { inject as X, ref as M, computed as de, watch as ye, onScopeDispose as ve, toValue as j, defineComponent as L, toRef as g, renderSlot as W, unref as b } from "vue";
|
|
5
5
|
const Y = Symbol(), Z = Symbol();
|
|
6
|
-
function
|
|
6
|
+
function N() {
|
|
7
7
|
const t = X(Y);
|
|
8
8
|
if (!t)
|
|
9
9
|
throw new Error(
|
|
@@ -11,8 +11,8 @@ function B() {
|
|
|
11
11
|
);
|
|
12
12
|
return t;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
return
|
|
14
|
+
function $e() {
|
|
15
|
+
return N();
|
|
16
16
|
}
|
|
17
17
|
function ee() {
|
|
18
18
|
const t = X(Z);
|
|
@@ -22,237 +22,169 @@ function ee() {
|
|
|
22
22
|
);
|
|
23
23
|
return t;
|
|
24
24
|
}
|
|
25
|
-
class
|
|
26
|
-
constructor(
|
|
27
|
-
|
|
25
|
+
class me {
|
|
26
|
+
constructor(n) {
|
|
27
|
+
v(this, "poll", async (n) => {
|
|
28
28
|
let e;
|
|
29
29
|
try {
|
|
30
30
|
e = await this.getter();
|
|
31
31
|
} catch {
|
|
32
|
-
|
|
32
|
+
n(null);
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
n({ object: e });
|
|
36
36
|
});
|
|
37
|
-
this.getter =
|
|
37
|
+
this.getter = n;
|
|
38
38
|
}
|
|
39
39
|
clear() {
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
class te {
|
|
43
|
-
constructor(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
...o.properties,
|
|
56
|
-
lastModified: {
|
|
57
|
-
minimum: this.bookmark.lastModified,
|
|
58
|
-
// if the schema already has a minimum
|
|
59
|
-
// it won't be overridden because
|
|
60
|
-
// the schema below takes precedence
|
|
61
|
-
...typeof h == "object" ? h : {}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
let i;
|
|
67
|
-
try {
|
|
68
|
-
i = this.streamFactory();
|
|
69
|
-
} catch (h) {
|
|
70
|
-
console.error(h);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
this.iterator = i;
|
|
74
|
-
let a = (f = this.bookmark) == null ? void 0 : f.lastModified, u = await i.next();
|
|
75
|
-
for (; !u.done; ) {
|
|
76
|
-
if (u.value.error) {
|
|
77
|
-
console.error(u.value.error), u = await i.next();
|
|
43
|
+
constructor(n) {
|
|
44
|
+
v(this, "iterator");
|
|
45
|
+
v(this, "continue");
|
|
46
|
+
v(this, "poll", async (n) => {
|
|
47
|
+
for (this.iterator || (this.continue ? this.iterator = this.continue() : this.iterator = this.streamFactory()); ; ) {
|
|
48
|
+
const e = await this.iterator.next();
|
|
49
|
+
if (e.done) {
|
|
50
|
+
e.value && (this.iterator = void 0, this.continue = e.value.continue);
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
if (e.value.error) {
|
|
54
|
+
console.error(e.value.error);
|
|
78
55
|
continue;
|
|
79
56
|
}
|
|
80
|
-
|
|
81
|
-
(!a || h.lastModified > a) && (a = h.lastModified), r(h), u = await i.next();
|
|
57
|
+
n(e.value);
|
|
82
58
|
}
|
|
83
|
-
if (this.iterator !== i) return;
|
|
84
|
-
this.iterator = void 0;
|
|
85
|
-
const { tombstoneRetention: c } = u.value;
|
|
86
|
-
a && (this.bookmark = {
|
|
87
|
-
lastModified: a,
|
|
88
|
-
fullRepollBy: e + c
|
|
89
|
-
});
|
|
90
59
|
});
|
|
91
|
-
this.
|
|
60
|
+
this.streamFactory = n;
|
|
92
61
|
}
|
|
93
62
|
clear() {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
constructor(r) {
|
|
101
|
-
super(r), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this, re.prototype);
|
|
102
|
-
}
|
|
103
|
-
}, ge = class ne extends Error {
|
|
104
|
-
constructor(r) {
|
|
105
|
-
super(r), this.name = "GraffitiErrorPatchTestFailed", Object.setPrototypeOf(this, ne.prototype);
|
|
106
|
-
}
|
|
107
|
-
}, be = class ie extends Error {
|
|
108
|
-
constructor(r) {
|
|
109
|
-
super(r), this.name = "GraffitiErrorPatchError", Object.setPrototypeOf(this, ie.prototype);
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
function Pe(t) {
|
|
113
|
-
return typeof t == "string" ? t : t.url;
|
|
114
|
-
}
|
|
115
|
-
function oe(t, r) {
|
|
116
|
-
return t.lastModified > r.lastModified || t.lastModified === r.lastModified && !t.tombstone && r.tombstone;
|
|
117
|
-
}
|
|
118
|
-
function xe(t, r, e, n) {
|
|
119
|
-
const o = e[r];
|
|
120
|
-
if (!(!o || !o.length))
|
|
121
|
-
try {
|
|
122
|
-
n[r] = t(n[r], o, !0, !1).newDocument;
|
|
123
|
-
} catch (i) {
|
|
124
|
-
throw typeof i == "object" && i && "name" in i && typeof i.name == "string" && "message" in i && typeof i.message == "string" ? i.name === "TEST_OPERATION_FAILED" ? new ge(i.message) : new be(i.name + ": " + i.message) : i;
|
|
63
|
+
if (this.iterator) {
|
|
64
|
+
const n = this.iterator;
|
|
65
|
+
this.iterator.return({
|
|
66
|
+
continue: () => n,
|
|
67
|
+
cursor: ""
|
|
68
|
+
});
|
|
125
69
|
}
|
|
126
|
-
|
|
127
|
-
function Oe(t, r) {
|
|
128
|
-
try {
|
|
129
|
-
return t.compile(r);
|
|
130
|
-
} catch (e) {
|
|
131
|
-
throw new we(
|
|
132
|
-
e instanceof Error ? e.message : void 0
|
|
133
|
-
);
|
|
70
|
+
this.iterator = void 0, this.continue = void 0;
|
|
134
71
|
}
|
|
135
72
|
}
|
|
136
|
-
function
|
|
137
|
-
|
|
138
|
-
(n) => r.includes(n)
|
|
139
|
-
));
|
|
140
|
-
}
|
|
141
|
-
function Ee(t, r) {
|
|
142
|
-
return t.allowed === void 0 || t.allowed === null || !!(r != null && r.actor) && (t.actor === r.actor || t.allowed.includes(r.actor));
|
|
73
|
+
function ne(t, n) {
|
|
74
|
+
return !n || t.object.lastModified > n.object.lastModified || t.object.lastModified === n.object.lastModified && !t.tombstone && !!n.tombstone;
|
|
143
75
|
}
|
|
144
|
-
class
|
|
76
|
+
class we {
|
|
145
77
|
constructor() {
|
|
146
|
-
|
|
78
|
+
v(this, "entry", M());
|
|
79
|
+
}
|
|
80
|
+
get result() {
|
|
81
|
+
return de(() => {
|
|
82
|
+
const n = this.entry.value;
|
|
83
|
+
return n && (n.tombstone ? null : n.object);
|
|
84
|
+
});
|
|
147
85
|
}
|
|
148
86
|
clear() {
|
|
149
|
-
this.
|
|
87
|
+
this.entry.value = void 0;
|
|
150
88
|
}
|
|
151
|
-
|
|
152
|
-
(!
|
|
153
|
-
...r,
|
|
154
|
-
tombstone: !1
|
|
155
|
-
});
|
|
89
|
+
onEntry(n) {
|
|
90
|
+
(!n || ne(n, this.entry.value)) && (this.entry.value = n);
|
|
156
91
|
}
|
|
157
92
|
}
|
|
158
|
-
class
|
|
159
|
-
constructor(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
this.graffiti =
|
|
93
|
+
class re {
|
|
94
|
+
constructor(n) {
|
|
95
|
+
v(this, "results", M([]));
|
|
96
|
+
v(this, "resultsRaw", /* @__PURE__ */ new Map());
|
|
97
|
+
v(this, "batchFlattenTimer");
|
|
98
|
+
this.graffiti = n;
|
|
164
99
|
}
|
|
165
100
|
clear() {
|
|
166
101
|
this.resultsRaw.clear(), this.results.value = [], clearTimeout(this.batchFlattenTimer), this.batchFlattenTimer = void 0;
|
|
167
102
|
}
|
|
168
103
|
flattenResults() {
|
|
169
|
-
this.results.value = Array.from(this.resultsRaw.values()).reduce((
|
|
170
|
-
const { tombstone: n } = e;
|
|
171
|
-
return n || r.push({ ...e, tombstone: n }), r;
|
|
172
|
-
}, []);
|
|
104
|
+
this.results.value = Array.from(this.resultsRaw.values()).reduce((n, e) => (e.tombstone || n.push(e.object), n), []);
|
|
173
105
|
}
|
|
174
|
-
|
|
175
|
-
if (!
|
|
176
|
-
const e = this.resultsRaw.get(
|
|
177
|
-
|
|
106
|
+
onEntry(n) {
|
|
107
|
+
if (!n) return;
|
|
108
|
+
const e = this.resultsRaw.get(n.object.url);
|
|
109
|
+
ne(n, e) && (this.resultsRaw.set(n.object.url, n), this.batchFlattenTimer || (this.batchFlattenTimer = setTimeout(() => {
|
|
178
110
|
this.flattenResults(), this.batchFlattenTimer = void 0;
|
|
179
111
|
}, 0)));
|
|
180
112
|
}
|
|
181
113
|
}
|
|
182
|
-
function J(t,
|
|
183
|
-
let
|
|
184
|
-
async function
|
|
185
|
-
|
|
186
|
-
for await (const
|
|
187
|
-
if (
|
|
188
|
-
console.error(
|
|
114
|
+
function J(t, n, e, r) {
|
|
115
|
+
let i;
|
|
116
|
+
async function o() {
|
|
117
|
+
i = e();
|
|
118
|
+
for await (const a of i) {
|
|
119
|
+
if (a.error) {
|
|
120
|
+
console.error(a.error);
|
|
189
121
|
continue;
|
|
190
122
|
}
|
|
191
|
-
t.
|
|
123
|
+
t.onEntry(a);
|
|
192
124
|
}
|
|
193
125
|
}
|
|
194
|
-
const
|
|
195
|
-
return
|
|
196
|
-
|
|
197
|
-
async (
|
|
198
|
-
if (JSON.stringify(
|
|
199
|
-
|
|
126
|
+
const u = () => n.poll(t.onEntry.bind(t)), l = M(!1);
|
|
127
|
+
return ye(
|
|
128
|
+
r,
|
|
129
|
+
async (a, s) => {
|
|
130
|
+
if (JSON.stringify(a) !== JSON.stringify(s)) {
|
|
131
|
+
i == null || i.return(null), t.clear(), n.clear(), o(), l.value = !0;
|
|
200
132
|
try {
|
|
201
|
-
await
|
|
133
|
+
await u();
|
|
202
134
|
} finally {
|
|
203
|
-
|
|
135
|
+
l.value = !1;
|
|
204
136
|
}
|
|
205
137
|
}
|
|
206
138
|
},
|
|
207
139
|
{
|
|
208
140
|
immediate: !0
|
|
209
141
|
}
|
|
210
|
-
),
|
|
142
|
+
), ve(() => i == null ? void 0 : i.return(null)), { poll: u, isPolling: l };
|
|
211
143
|
}
|
|
212
|
-
function
|
|
144
|
+
function oe(t, n) {
|
|
213
145
|
return () => {
|
|
214
|
-
const e =
|
|
146
|
+
const e = j(n);
|
|
215
147
|
return e === void 0 ? t == null ? void 0 : t.value : e;
|
|
216
148
|
};
|
|
217
149
|
}
|
|
218
|
-
function
|
|
219
|
-
return t.map((
|
|
150
|
+
function E(t) {
|
|
151
|
+
return t.map((n) => n());
|
|
220
152
|
}
|
|
221
|
-
function
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
|
|
153
|
+
function be(t, n, e) {
|
|
154
|
+
const r = N(), i = ee(), o = () => j(t), u = () => j(n), l = oe(i, e), a = [o, u, l], s = () => r.synchronizeDiscover(...E(a)), f = () => r.discover(...E(a)), p = new re(r), c = new te(f), { poll: d, isPolling: h } = J(
|
|
155
|
+
p,
|
|
156
|
+
c,
|
|
225
157
|
s,
|
|
226
|
-
|
|
158
|
+
a
|
|
227
159
|
);
|
|
228
160
|
return {
|
|
229
161
|
/**
|
|
230
162
|
* A [Ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
|
|
231
163
|
* an array of Graffiti objects. All tombstoned objects have been filtered out.
|
|
232
164
|
*/
|
|
233
|
-
results:
|
|
165
|
+
results: p.results,
|
|
234
166
|
/**
|
|
235
167
|
* A method to poll for new results.
|
|
236
168
|
*/
|
|
237
|
-
poll:
|
|
169
|
+
poll: d,
|
|
238
170
|
/**
|
|
239
171
|
* A boolean [Ref](https://vuejs.org/api/reactivity-core.html#ref)
|
|
240
172
|
* that indicates if the poll is currently running.
|
|
241
173
|
* Useful to show a loading spinner or disable a button.
|
|
242
174
|
*/
|
|
243
|
-
isPolling:
|
|
175
|
+
isPolling: h
|
|
244
176
|
};
|
|
245
177
|
}
|
|
246
|
-
function
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
], s = () =>
|
|
178
|
+
function ge(t, n, e) {
|
|
179
|
+
const r = N(), i = ee(), o = () => j(t), u = () => j(n), l = oe(i, e), a = [
|
|
180
|
+
o,
|
|
181
|
+
u,
|
|
182
|
+
l
|
|
183
|
+
], s = () => r.synchronizeGet(...E(a)), f = new we(), p = () => r.get(...E(a)), c = new me(p), { poll: d, isPolling: h } = J(
|
|
252
184
|
f,
|
|
253
|
-
|
|
185
|
+
c,
|
|
254
186
|
s,
|
|
255
|
-
|
|
187
|
+
a
|
|
256
188
|
);
|
|
257
189
|
return {
|
|
258
190
|
/**
|
|
@@ -264,28 +196,28 @@ function ke(t, r, e) {
|
|
|
264
196
|
/**
|
|
265
197
|
* A method to poll for new results.
|
|
266
198
|
*/
|
|
267
|
-
poll:
|
|
199
|
+
poll: d,
|
|
268
200
|
/**
|
|
269
201
|
* A boolean [Ref](https://vuejs.org/api/reactivity-core.html#ref)
|
|
270
202
|
* that indicates if the poll is currently running.
|
|
271
203
|
* Useful to show a loading spinner or disable a button.
|
|
272
204
|
*/
|
|
273
|
-
isPolling:
|
|
205
|
+
isPolling: h
|
|
274
206
|
};
|
|
275
207
|
}
|
|
276
|
-
function
|
|
277
|
-
const e =
|
|
278
|
-
|
|
208
|
+
function Pe(t, n) {
|
|
209
|
+
const e = N(), o = [() => j(t), () => j(n)], u = () => e.synchronizeRecoverOrphans(...E(o)), l = new re(e), a = () => e.recoverOrphans(...E(o)), s = new te(a), { poll: f, isPolling: p } = J(
|
|
210
|
+
l,
|
|
279
211
|
s,
|
|
280
|
-
|
|
281
|
-
|
|
212
|
+
u,
|
|
213
|
+
o
|
|
282
214
|
);
|
|
283
215
|
return {
|
|
284
216
|
/**
|
|
285
217
|
* A [Ref](https://vuejs.org/api/reactivity-core.html#ref) that contains
|
|
286
218
|
* an array of Graffiti objects. All tombstoned objects have been filtered out.
|
|
287
219
|
*/
|
|
288
|
-
results:
|
|
220
|
+
results: l.results,
|
|
289
221
|
/**
|
|
290
222
|
* A method to poll for new results.
|
|
291
223
|
*/
|
|
@@ -295,10 +227,10 @@ function Re(t, r) {
|
|
|
295
227
|
* that indicates if the poll is currently running.
|
|
296
228
|
* Useful to show a loading spinner or disable a button.
|
|
297
229
|
*/
|
|
298
|
-
isPolling:
|
|
230
|
+
isPolling: p
|
|
299
231
|
};
|
|
300
232
|
}
|
|
301
|
-
const
|
|
233
|
+
const ie = /* @__PURE__ */ L({
|
|
302
234
|
__name: "Discover",
|
|
303
235
|
props: {
|
|
304
236
|
channels: {},
|
|
@@ -306,18 +238,18 @@ const ue = /* @__PURE__ */ W({
|
|
|
306
238
|
session: {}
|
|
307
239
|
},
|
|
308
240
|
setup(t) {
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
241
|
+
const n = t, { results: e, poll: r, isPolling: i } = be(
|
|
242
|
+
g(n, "channels"),
|
|
243
|
+
g(n, "schema"),
|
|
244
|
+
g(n, "session")
|
|
313
245
|
);
|
|
314
|
-
return (
|
|
315
|
-
results:
|
|
316
|
-
poll:
|
|
317
|
-
isPolling:
|
|
246
|
+
return (o, u) => W(o.$slots, "default", {
|
|
247
|
+
results: b(e),
|
|
248
|
+
poll: b(r),
|
|
249
|
+
isPolling: b(i)
|
|
318
250
|
});
|
|
319
251
|
}
|
|
320
|
-
}),
|
|
252
|
+
}), se = /* @__PURE__ */ L({
|
|
321
253
|
__name: "Get",
|
|
322
254
|
props: {
|
|
323
255
|
url: {},
|
|
@@ -325,35 +257,49 @@ const ue = /* @__PURE__ */ W({
|
|
|
325
257
|
session: {}
|
|
326
258
|
},
|
|
327
259
|
setup(t) {
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
260
|
+
const n = t, { result: e, poll: r, isPolling: i } = ge(
|
|
261
|
+
g(n, "url"),
|
|
262
|
+
g(n, "schema"),
|
|
263
|
+
g(n, "session")
|
|
332
264
|
);
|
|
333
|
-
return (
|
|
334
|
-
result:
|
|
335
|
-
poll:
|
|
336
|
-
isPolling:
|
|
265
|
+
return (o, u) => W(o.$slots, "default", {
|
|
266
|
+
result: b(e),
|
|
267
|
+
poll: b(r),
|
|
268
|
+
isPolling: b(i)
|
|
337
269
|
});
|
|
338
270
|
}
|
|
339
|
-
}),
|
|
271
|
+
}), ue = /* @__PURE__ */ L({
|
|
340
272
|
__name: "RecoverOrphans",
|
|
341
273
|
props: {
|
|
342
274
|
schema: {},
|
|
343
275
|
session: {}
|
|
344
276
|
},
|
|
345
277
|
setup(t) {
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
|
|
278
|
+
const n = t, { results: e, poll: r, isPolling: i } = Pe(
|
|
279
|
+
g(n, "schema"),
|
|
280
|
+
g(n, "session")
|
|
349
281
|
);
|
|
350
|
-
return (
|
|
351
|
-
results:
|
|
352
|
-
poll:
|
|
353
|
-
isPolling:
|
|
282
|
+
return (o, u) => W(o.$slots, "default", {
|
|
283
|
+
results: b(e),
|
|
284
|
+
poll: b(r),
|
|
285
|
+
isPolling: b(i)
|
|
354
286
|
});
|
|
355
287
|
}
|
|
356
288
|
});
|
|
289
|
+
var xe = class {
|
|
290
|
+
}, je = class ae extends Error {
|
|
291
|
+
constructor(n) {
|
|
292
|
+
super(n), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this, ae.prototype);
|
|
293
|
+
}
|
|
294
|
+
}, Oe = class ce extends Error {
|
|
295
|
+
constructor(n) {
|
|
296
|
+
super(n), this.name = "GraffitiErrorPatchTestFailed", Object.setPrototypeOf(this, ce.prototype);
|
|
297
|
+
}
|
|
298
|
+
}, Se = class le extends Error {
|
|
299
|
+
constructor(n) {
|
|
300
|
+
super(n), this.name = "GraffitiErrorPatchError", Object.setPrototypeOf(this, le.prototype);
|
|
301
|
+
}
|
|
302
|
+
};
|
|
357
303
|
/*! *****************************************************************************
|
|
358
304
|
Copyright (c) Microsoft Corporation.
|
|
359
305
|
|
|
@@ -368,172 +314,172 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
368
314
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
369
315
|
PERFORMANCE OF THIS SOFTWARE.
|
|
370
316
|
***************************************************************************** */
|
|
371
|
-
var
|
|
372
|
-
return
|
|
373
|
-
e.__proto__ =
|
|
374
|
-
} || function(e,
|
|
375
|
-
for (var
|
|
376
|
-
},
|
|
317
|
+
var C = function(t, n) {
|
|
318
|
+
return C = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
319
|
+
e.__proto__ = r;
|
|
320
|
+
} || function(e, r) {
|
|
321
|
+
for (var i in r) r.hasOwnProperty(i) && (e[i] = r[i]);
|
|
322
|
+
}, C(t, n);
|
|
377
323
|
};
|
|
378
|
-
function
|
|
379
|
-
|
|
324
|
+
function Ee(t, n) {
|
|
325
|
+
C(t, n);
|
|
380
326
|
function e() {
|
|
381
327
|
this.constructor = t;
|
|
382
328
|
}
|
|
383
|
-
t.prototype =
|
|
329
|
+
t.prototype = n === null ? Object.create(n) : (e.prototype = n.prototype, new e());
|
|
384
330
|
}
|
|
385
|
-
function
|
|
386
|
-
function o
|
|
387
|
-
return
|
|
388
|
-
|
|
331
|
+
function G(t, n, e, r) {
|
|
332
|
+
function i(o) {
|
|
333
|
+
return o instanceof e ? o : new e(function(u) {
|
|
334
|
+
u(o);
|
|
389
335
|
});
|
|
390
336
|
}
|
|
391
|
-
return new (e || (e = Promise))(function(
|
|
392
|
-
function
|
|
337
|
+
return new (e || (e = Promise))(function(o, u) {
|
|
338
|
+
function l(f) {
|
|
393
339
|
try {
|
|
394
|
-
s(
|
|
395
|
-
} catch (
|
|
396
|
-
|
|
340
|
+
s(r.next(f));
|
|
341
|
+
} catch (p) {
|
|
342
|
+
u(p);
|
|
397
343
|
}
|
|
398
344
|
}
|
|
399
|
-
function
|
|
345
|
+
function a(f) {
|
|
400
346
|
try {
|
|
401
|
-
s(
|
|
402
|
-
} catch (
|
|
403
|
-
|
|
347
|
+
s(r.throw(f));
|
|
348
|
+
} catch (p) {
|
|
349
|
+
u(p);
|
|
404
350
|
}
|
|
405
351
|
}
|
|
406
352
|
function s(f) {
|
|
407
|
-
f.done ?
|
|
353
|
+
f.done ? o(f.value) : i(f.value).then(l, a);
|
|
408
354
|
}
|
|
409
|
-
s((
|
|
355
|
+
s((r = r.apply(t, [])).next());
|
|
410
356
|
});
|
|
411
357
|
}
|
|
412
|
-
function P(t,
|
|
358
|
+
function P(t, n) {
|
|
413
359
|
var e = { label: 0, sent: function() {
|
|
414
|
-
if (
|
|
415
|
-
return
|
|
416
|
-
}, trys: [], ops: [] },
|
|
417
|
-
return
|
|
360
|
+
if (o[0] & 1) throw o[1];
|
|
361
|
+
return o[1];
|
|
362
|
+
}, trys: [], ops: [] }, r, i, o, u;
|
|
363
|
+
return u = { next: l(0), throw: l(1), return: l(2) }, typeof Symbol == "function" && (u[Symbol.iterator] = function() {
|
|
418
364
|
return this;
|
|
419
|
-
}),
|
|
420
|
-
function
|
|
365
|
+
}), u;
|
|
366
|
+
function l(s) {
|
|
421
367
|
return function(f) {
|
|
422
|
-
return
|
|
368
|
+
return a([s, f]);
|
|
423
369
|
};
|
|
424
370
|
}
|
|
425
|
-
function
|
|
426
|
-
if (
|
|
371
|
+
function a(s) {
|
|
372
|
+
if (r) throw new TypeError("Generator is already executing.");
|
|
427
373
|
for (; e; ) try {
|
|
428
|
-
if (
|
|
429
|
-
switch (
|
|
374
|
+
if (r = 1, i && (o = s[0] & 2 ? i.return : s[0] ? i.throw || ((o = i.return) && o.call(i), 0) : i.next) && !(o = o.call(i, s[1])).done) return o;
|
|
375
|
+
switch (i = 0, o && (s = [s[0] & 2, o.value]), s[0]) {
|
|
430
376
|
case 0:
|
|
431
377
|
case 1:
|
|
432
|
-
|
|
378
|
+
o = s;
|
|
433
379
|
break;
|
|
434
380
|
case 4:
|
|
435
381
|
return e.label++, { value: s[1], done: !1 };
|
|
436
382
|
case 5:
|
|
437
|
-
e.label++,
|
|
383
|
+
e.label++, i = s[1], s = [0];
|
|
438
384
|
continue;
|
|
439
385
|
case 7:
|
|
440
386
|
s = e.ops.pop(), e.trys.pop();
|
|
441
387
|
continue;
|
|
442
388
|
default:
|
|
443
|
-
if (
|
|
389
|
+
if (o = e.trys, !(o = o.length > 0 && o[o.length - 1]) && (s[0] === 6 || s[0] === 2)) {
|
|
444
390
|
e = 0;
|
|
445
391
|
continue;
|
|
446
392
|
}
|
|
447
|
-
if (s[0] === 3 && (!
|
|
393
|
+
if (s[0] === 3 && (!o || s[1] > o[0] && s[1] < o[3])) {
|
|
448
394
|
e.label = s[1];
|
|
449
395
|
break;
|
|
450
396
|
}
|
|
451
|
-
if (s[0] === 6 && e.label <
|
|
452
|
-
e.label =
|
|
397
|
+
if (s[0] === 6 && e.label < o[1]) {
|
|
398
|
+
e.label = o[1], o = s;
|
|
453
399
|
break;
|
|
454
400
|
}
|
|
455
|
-
if (
|
|
456
|
-
e.label =
|
|
401
|
+
if (o && e.label < o[2]) {
|
|
402
|
+
e.label = o[2], e.ops.push(s);
|
|
457
403
|
break;
|
|
458
404
|
}
|
|
459
|
-
|
|
405
|
+
o[2] && e.ops.pop(), e.trys.pop();
|
|
460
406
|
continue;
|
|
461
407
|
}
|
|
462
|
-
s =
|
|
408
|
+
s = n.call(t, e);
|
|
463
409
|
} catch (f) {
|
|
464
|
-
s = [6, f],
|
|
410
|
+
s = [6, f], i = 0;
|
|
465
411
|
} finally {
|
|
466
|
-
|
|
412
|
+
r = o = 0;
|
|
467
413
|
}
|
|
468
414
|
if (s[0] & 5) throw s[1];
|
|
469
415
|
return { value: s[0] ? s[1] : void 0, done: !0 };
|
|
470
416
|
}
|
|
471
417
|
}
|
|
472
|
-
function
|
|
473
|
-
var
|
|
418
|
+
function _(t) {
|
|
419
|
+
var n = typeof Symbol == "function" && Symbol.iterator, e = n && t[n], r = 0;
|
|
474
420
|
if (e) return e.call(t);
|
|
475
421
|
if (t && typeof t.length == "number") return {
|
|
476
422
|
next: function() {
|
|
477
|
-
return t &&
|
|
423
|
+
return t && r >= t.length && (t = void 0), { value: t && t[r++], done: !t };
|
|
478
424
|
}
|
|
479
425
|
};
|
|
480
|
-
throw new TypeError(
|
|
426
|
+
throw new TypeError(n ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
481
427
|
}
|
|
482
|
-
function
|
|
483
|
-
return this instanceof
|
|
428
|
+
function z(t) {
|
|
429
|
+
return this instanceof z ? (this.v = t, this) : new z(t);
|
|
484
430
|
}
|
|
485
|
-
function
|
|
431
|
+
function Ge(t, n, e) {
|
|
486
432
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
487
|
-
var
|
|
488
|
-
return
|
|
433
|
+
var r = e.apply(t, n || []), i, o = [];
|
|
434
|
+
return i = {}, u("next"), u("throw"), u("return"), i[Symbol.asyncIterator] = function() {
|
|
489
435
|
return this;
|
|
490
|
-
},
|
|
491
|
-
function
|
|
492
|
-
|
|
493
|
-
return new Promise(function(
|
|
494
|
-
|
|
436
|
+
}, i;
|
|
437
|
+
function u(c) {
|
|
438
|
+
r[c] && (i[c] = function(d) {
|
|
439
|
+
return new Promise(function(h, y) {
|
|
440
|
+
o.push([c, d, h, y]) > 1 || l(c, d);
|
|
495
441
|
});
|
|
496
442
|
});
|
|
497
443
|
}
|
|
498
|
-
function
|
|
444
|
+
function l(c, d) {
|
|
499
445
|
try {
|
|
500
|
-
|
|
501
|
-
} catch (
|
|
502
|
-
|
|
446
|
+
a(r[c](d));
|
|
447
|
+
} catch (h) {
|
|
448
|
+
p(o[0][3], h);
|
|
503
449
|
}
|
|
504
450
|
}
|
|
505
|
-
function c
|
|
506
|
-
|
|
451
|
+
function a(c) {
|
|
452
|
+
c.value instanceof z ? Promise.resolve(c.value.v).then(s, f) : p(o[0][2], c);
|
|
507
453
|
}
|
|
508
|
-
function s(
|
|
509
|
-
|
|
454
|
+
function s(c) {
|
|
455
|
+
l("next", c);
|
|
510
456
|
}
|
|
511
|
-
function f(
|
|
512
|
-
|
|
457
|
+
function f(c) {
|
|
458
|
+
l("throw", c);
|
|
513
459
|
}
|
|
514
|
-
function
|
|
515
|
-
|
|
460
|
+
function p(c, d) {
|
|
461
|
+
c(d), o.shift(), o.length && l(o[0][0], o[0][1]);
|
|
516
462
|
}
|
|
517
463
|
}
|
|
518
464
|
var fe = (
|
|
519
465
|
/** @class */
|
|
520
466
|
function(t) {
|
|
521
|
-
|
|
522
|
-
function
|
|
523
|
-
var
|
|
524
|
-
return Object.defineProperty(
|
|
467
|
+
Ee(n, t);
|
|
468
|
+
function n(e) {
|
|
469
|
+
var r = t.call(this, e) || this;
|
|
470
|
+
return Object.defineProperty(r, "name", {
|
|
525
471
|
value: "RepeaterOverflowError",
|
|
526
472
|
enumerable: !1
|
|
527
|
-
}), typeof Object.setPrototypeOf == "function" ? Object.setPrototypeOf(
|
|
473
|
+
}), typeof Object.setPrototypeOf == "function" ? Object.setPrototypeOf(r, r.constructor.prototype) : r.__proto__ = r.constructor.prototype, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(r, r.constructor), r;
|
|
528
474
|
}
|
|
529
|
-
return
|
|
475
|
+
return n;
|
|
530
476
|
}(Error)
|
|
531
477
|
);
|
|
532
478
|
(function() {
|
|
533
|
-
function t(
|
|
534
|
-
if (
|
|
479
|
+
function t(n) {
|
|
480
|
+
if (n < 0)
|
|
535
481
|
throw new RangeError("Capacity may not be less than 0");
|
|
536
|
-
this._c =
|
|
482
|
+
this._c = n, this._q = [];
|
|
537
483
|
}
|
|
538
484
|
return Object.defineProperty(t.prototype, "empty", {
|
|
539
485
|
get: function() {
|
|
@@ -547,10 +493,10 @@ var fe = (
|
|
|
547
493
|
},
|
|
548
494
|
enumerable: !1,
|
|
549
495
|
configurable: !0
|
|
550
|
-
}), t.prototype.add = function(
|
|
496
|
+
}), t.prototype.add = function(n) {
|
|
551
497
|
if (this.full)
|
|
552
498
|
throw new Error("Buffer full");
|
|
553
|
-
this._q.push(
|
|
499
|
+
this._q.push(n);
|
|
554
500
|
}, t.prototype.remove = function() {
|
|
555
501
|
if (this.empty)
|
|
556
502
|
throw new Error("Buffer empty");
|
|
@@ -558,10 +504,10 @@ var fe = (
|
|
|
558
504
|
}, t;
|
|
559
505
|
})();
|
|
560
506
|
(function() {
|
|
561
|
-
function t(
|
|
562
|
-
if (
|
|
507
|
+
function t(n) {
|
|
508
|
+
if (n < 1)
|
|
563
509
|
throw new RangeError("Capacity may not be less than 1");
|
|
564
|
-
this._c =
|
|
510
|
+
this._c = n, this._q = [];
|
|
565
511
|
}
|
|
566
512
|
return Object.defineProperty(t.prototype, "empty", {
|
|
567
513
|
get: function() {
|
|
@@ -575,10 +521,10 @@ var fe = (
|
|
|
575
521
|
},
|
|
576
522
|
enumerable: !1,
|
|
577
523
|
configurable: !0
|
|
578
|
-
}), t.prototype.add = function(
|
|
524
|
+
}), t.prototype.add = function(n) {
|
|
579
525
|
for (; this._q.length >= this._c; )
|
|
580
526
|
this._q.shift();
|
|
581
|
-
this._q.push(
|
|
527
|
+
this._q.push(n);
|
|
582
528
|
}, t.prototype.remove = function() {
|
|
583
529
|
if (this.empty)
|
|
584
530
|
throw new Error("Buffer empty");
|
|
@@ -586,10 +532,10 @@ var fe = (
|
|
|
586
532
|
}, t;
|
|
587
533
|
})();
|
|
588
534
|
(function() {
|
|
589
|
-
function t(
|
|
590
|
-
if (
|
|
535
|
+
function t(n) {
|
|
536
|
+
if (n < 1)
|
|
591
537
|
throw new RangeError("Capacity may not be less than 1");
|
|
592
|
-
this._c =
|
|
538
|
+
this._c = n, this._q = [];
|
|
593
539
|
}
|
|
594
540
|
return Object.defineProperty(t.prototype, "empty", {
|
|
595
541
|
get: function() {
|
|
@@ -603,8 +549,8 @@ var fe = (
|
|
|
603
549
|
},
|
|
604
550
|
enumerable: !1,
|
|
605
551
|
configurable: !0
|
|
606
|
-
}), t.prototype.add = function(
|
|
607
|
-
this._q.length < this._c && this._q.push(
|
|
552
|
+
}), t.prototype.add = function(n) {
|
|
553
|
+
this._q.length < this._c && this._q.push(n);
|
|
608
554
|
}, t.prototype.remove = function() {
|
|
609
555
|
if (this.empty)
|
|
610
556
|
throw new Error("Buffer empty");
|
|
@@ -612,15 +558,15 @@ var fe = (
|
|
|
612
558
|
}, t;
|
|
613
559
|
})();
|
|
614
560
|
function $(t) {
|
|
615
|
-
t != null && typeof t.then == "function" && t.then(
|
|
561
|
+
t != null && typeof t.then == "function" && t.then(A, A);
|
|
616
562
|
}
|
|
617
|
-
var
|
|
563
|
+
var B = 0, H = 1, O = 2, F = 3, U = 4, I = 1024, A = function() {
|
|
618
564
|
};
|
|
619
|
-
function
|
|
620
|
-
var
|
|
621
|
-
if (
|
|
622
|
-
throw
|
|
623
|
-
return
|
|
565
|
+
function S(t) {
|
|
566
|
+
var n = t.err, e = Promise.resolve(t.execution).then(function(r) {
|
|
567
|
+
if (n != null)
|
|
568
|
+
throw n;
|
|
569
|
+
return r;
|
|
624
570
|
});
|
|
625
571
|
return t.err = void 0, t.execution = e.then(function() {
|
|
626
572
|
}, function() {
|
|
@@ -628,188 +574,188 @@ function E(t) {
|
|
|
628
574
|
return e;
|
|
629
575
|
});
|
|
630
576
|
}
|
|
631
|
-
function x(t,
|
|
632
|
-
var e = t.state >=
|
|
633
|
-
return Promise.resolve(
|
|
634
|
-
return !e && t.state >=
|
|
577
|
+
function x(t, n) {
|
|
578
|
+
var e = t.state >= F;
|
|
579
|
+
return Promise.resolve(n).then(function(r) {
|
|
580
|
+
return !e && t.state >= U ? S(t).then(function(i) {
|
|
635
581
|
return {
|
|
636
|
-
value:
|
|
582
|
+
value: i,
|
|
637
583
|
done: !0
|
|
638
584
|
};
|
|
639
|
-
}) : { value:
|
|
585
|
+
}) : { value: r, done: e };
|
|
640
586
|
});
|
|
641
587
|
}
|
|
642
|
-
function K(t,
|
|
643
|
-
var e,
|
|
644
|
-
if (!(t.state >=
|
|
645
|
-
if (t.state =
|
|
588
|
+
function K(t, n) {
|
|
589
|
+
var e, r;
|
|
590
|
+
if (!(t.state >= O))
|
|
591
|
+
if (t.state = O, t.onnext(), t.onstop(), t.err == null && (t.err = n), t.pushes.length === 0 && (typeof t.buffer > "u" || t.buffer.empty))
|
|
646
592
|
R(t);
|
|
647
593
|
else
|
|
648
594
|
try {
|
|
649
|
-
for (var
|
|
650
|
-
var
|
|
651
|
-
|
|
595
|
+
for (var i = _(t.pushes), o = i.next(); !o.done; o = i.next()) {
|
|
596
|
+
var u = o.value;
|
|
597
|
+
u.resolve();
|
|
652
598
|
}
|
|
653
|
-
} catch (
|
|
654
|
-
e = { error:
|
|
599
|
+
} catch (l) {
|
|
600
|
+
e = { error: l };
|
|
655
601
|
} finally {
|
|
656
602
|
try {
|
|
657
|
-
|
|
603
|
+
o && !o.done && (r = i.return) && r.call(i);
|
|
658
604
|
} finally {
|
|
659
605
|
if (e) throw e.error;
|
|
660
606
|
}
|
|
661
607
|
}
|
|
662
608
|
}
|
|
663
609
|
function R(t) {
|
|
664
|
-
var
|
|
665
|
-
if (!(t.state >=
|
|
666
|
-
t.state <
|
|
610
|
+
var n, e;
|
|
611
|
+
if (!(t.state >= F)) {
|
|
612
|
+
t.state < O && K(t), t.state = F, t.buffer = void 0;
|
|
667
613
|
try {
|
|
668
|
-
for (var
|
|
669
|
-
var
|
|
670
|
-
return
|
|
614
|
+
for (var r = _(t.nexts), i = r.next(); !i.done; i = r.next()) {
|
|
615
|
+
var o = i.value, u = t.pending === void 0 ? S(t) : t.pending.then(function() {
|
|
616
|
+
return S(t);
|
|
671
617
|
});
|
|
672
|
-
|
|
618
|
+
o.resolve(x(t, u));
|
|
673
619
|
}
|
|
674
|
-
} catch (
|
|
675
|
-
|
|
620
|
+
} catch (l) {
|
|
621
|
+
n = { error: l };
|
|
676
622
|
} finally {
|
|
677
623
|
try {
|
|
678
|
-
|
|
624
|
+
i && !i.done && (e = r.return) && e.call(r);
|
|
679
625
|
} finally {
|
|
680
|
-
if (
|
|
626
|
+
if (n) throw n.error;
|
|
681
627
|
}
|
|
682
628
|
}
|
|
683
629
|
t.pushes = [], t.nexts = [];
|
|
684
630
|
}
|
|
685
631
|
}
|
|
686
632
|
function Q(t) {
|
|
687
|
-
t.state >=
|
|
633
|
+
t.state >= U || (t.state < F && R(t), t.state = U);
|
|
688
634
|
}
|
|
689
|
-
function
|
|
690
|
-
if ($(
|
|
691
|
-
throw new fe("No more than " +
|
|
692
|
-
if (t.state >=
|
|
635
|
+
function _e(t, n) {
|
|
636
|
+
if ($(n), t.pushes.length >= I)
|
|
637
|
+
throw new fe("No more than " + I + " pending calls to push are allowed on a single repeater.");
|
|
638
|
+
if (t.state >= O)
|
|
693
639
|
return Promise.resolve(void 0);
|
|
694
|
-
var e = t.pending === void 0 ? Promise.resolve(
|
|
695
|
-
return
|
|
640
|
+
var e = t.pending === void 0 ? Promise.resolve(n) : t.pending.then(function() {
|
|
641
|
+
return n;
|
|
696
642
|
});
|
|
697
|
-
e = e.catch(function(
|
|
698
|
-
t.state <
|
|
643
|
+
e = e.catch(function(a) {
|
|
644
|
+
t.state < O && (t.err = a), Q(t);
|
|
699
645
|
});
|
|
700
|
-
var
|
|
646
|
+
var r;
|
|
701
647
|
if (t.nexts.length) {
|
|
702
|
-
var
|
|
703
|
-
|
|
704
|
-
return t.onnext =
|
|
648
|
+
var i = t.nexts.shift();
|
|
649
|
+
i.resolve(x(t, e)), t.nexts.length ? r = Promise.resolve(t.nexts[0].value) : typeof t.buffer < "u" && !t.buffer.full ? r = Promise.resolve(void 0) : r = new Promise(function(a) {
|
|
650
|
+
return t.onnext = a;
|
|
705
651
|
});
|
|
706
|
-
} else typeof t.buffer < "u" && !t.buffer.full ? (t.buffer.add(e),
|
|
707
|
-
return t.pushes.push({ resolve:
|
|
652
|
+
} else typeof t.buffer < "u" && !t.buffer.full ? (t.buffer.add(e), r = Promise.resolve(void 0)) : r = new Promise(function(a) {
|
|
653
|
+
return t.pushes.push({ resolve: a, value: e });
|
|
708
654
|
});
|
|
709
|
-
var
|
|
710
|
-
if (
|
|
711
|
-
throw
|
|
655
|
+
var o = !0, u = {}, l = r.catch(function(a) {
|
|
656
|
+
if (o)
|
|
657
|
+
throw a;
|
|
712
658
|
});
|
|
713
|
-
return
|
|
714
|
-
return
|
|
715
|
-
},
|
|
716
|
-
return
|
|
717
|
-
},
|
|
718
|
-
return
|
|
719
|
-
}).catch(function(
|
|
720
|
-
t.err =
|
|
721
|
-
}),
|
|
659
|
+
return u.then = function(a, s) {
|
|
660
|
+
return o = !1, Promise.prototype.then.call(r, a, s);
|
|
661
|
+
}, u.catch = function(a) {
|
|
662
|
+
return o = !1, Promise.prototype.catch.call(r, a);
|
|
663
|
+
}, u.finally = r.finally.bind(r), t.pending = e.then(function() {
|
|
664
|
+
return l;
|
|
665
|
+
}).catch(function(a) {
|
|
666
|
+
t.err = a, Q(t);
|
|
667
|
+
}), u;
|
|
722
668
|
}
|
|
723
|
-
function
|
|
724
|
-
var
|
|
725
|
-
return t.onstop =
|
|
669
|
+
function Re(t) {
|
|
670
|
+
var n = K.bind(null, t), e = new Promise(function(r) {
|
|
671
|
+
return t.onstop = r;
|
|
726
672
|
});
|
|
727
|
-
return
|
|
673
|
+
return n.then = e.then.bind(e), n.catch = e.catch.bind(e), n.finally = e.finally.bind(e), n;
|
|
728
674
|
}
|
|
729
|
-
function
|
|
675
|
+
function ze(t) {
|
|
730
676
|
if (!(t.state >= H)) {
|
|
731
677
|
t.state = H;
|
|
732
|
-
var
|
|
733
|
-
t.execution = new Promise(function(
|
|
734
|
-
return
|
|
678
|
+
var n = _e.bind(null, t), e = Re(t);
|
|
679
|
+
t.execution = new Promise(function(r) {
|
|
680
|
+
return r(t.executor(n, e));
|
|
735
681
|
}), t.execution.catch(function() {
|
|
736
682
|
return K(t);
|
|
737
683
|
});
|
|
738
684
|
}
|
|
739
685
|
}
|
|
740
|
-
var D = /* @__PURE__ */ new WeakMap(),
|
|
686
|
+
var D = /* @__PURE__ */ new WeakMap(), k = (
|
|
741
687
|
/** @class */
|
|
742
688
|
function() {
|
|
743
|
-
function t(
|
|
689
|
+
function t(n, e) {
|
|
744
690
|
D.set(this, {
|
|
745
|
-
executor:
|
|
691
|
+
executor: n,
|
|
746
692
|
buffer: e,
|
|
747
693
|
err: void 0,
|
|
748
|
-
state:
|
|
694
|
+
state: B,
|
|
749
695
|
pushes: [],
|
|
750
696
|
nexts: [],
|
|
751
697
|
pending: void 0,
|
|
752
698
|
execution: void 0,
|
|
753
|
-
onnext:
|
|
754
|
-
onstop:
|
|
699
|
+
onnext: A,
|
|
700
|
+
onstop: A
|
|
755
701
|
});
|
|
756
702
|
}
|
|
757
|
-
return t.prototype.next = function(
|
|
758
|
-
$(
|
|
703
|
+
return t.prototype.next = function(n) {
|
|
704
|
+
$(n);
|
|
759
705
|
var e = D.get(this);
|
|
760
706
|
if (e === void 0)
|
|
761
707
|
throw new Error("WeakMap error");
|
|
762
|
-
if (e.nexts.length >=
|
|
763
|
-
throw new fe("No more than " +
|
|
764
|
-
if (e.state <=
|
|
765
|
-
var
|
|
708
|
+
if (e.nexts.length >= I)
|
|
709
|
+
throw new fe("No more than " + I + " pending calls to next are allowed on a single repeater.");
|
|
710
|
+
if (e.state <= B && ze(e), e.onnext(n), typeof e.buffer < "u" && !e.buffer.empty) {
|
|
711
|
+
var r = x(e, e.buffer.remove());
|
|
766
712
|
if (e.pushes.length) {
|
|
767
|
-
var
|
|
768
|
-
e.buffer.add(
|
|
713
|
+
var i = e.pushes.shift();
|
|
714
|
+
e.buffer.add(i.value), e.onnext = i.resolve;
|
|
769
715
|
}
|
|
770
|
-
return
|
|
716
|
+
return r;
|
|
771
717
|
} else if (e.pushes.length) {
|
|
772
|
-
var
|
|
773
|
-
return e.onnext =
|
|
774
|
-
} else if (e.state >=
|
|
775
|
-
return R(e), x(e,
|
|
776
|
-
return new Promise(function(
|
|
777
|
-
return e.nexts.push({ resolve:
|
|
718
|
+
var o = e.pushes.shift();
|
|
719
|
+
return e.onnext = o.resolve, x(e, o.value);
|
|
720
|
+
} else if (e.state >= O)
|
|
721
|
+
return R(e), x(e, S(e));
|
|
722
|
+
return new Promise(function(u) {
|
|
723
|
+
return e.nexts.push({ resolve: u, value: n });
|
|
778
724
|
});
|
|
779
|
-
}, t.prototype.return = function(
|
|
780
|
-
$(
|
|
725
|
+
}, t.prototype.return = function(n) {
|
|
726
|
+
$(n);
|
|
781
727
|
var e = D.get(this);
|
|
782
728
|
if (e === void 0)
|
|
783
729
|
throw new Error("WeakMap error");
|
|
784
730
|
return R(e), e.execution = Promise.resolve(e.execution).then(function() {
|
|
785
|
-
return
|
|
786
|
-
}), x(e,
|
|
787
|
-
}, t.prototype.throw = function(
|
|
731
|
+
return n;
|
|
732
|
+
}), x(e, S(e));
|
|
733
|
+
}, t.prototype.throw = function(n) {
|
|
788
734
|
var e = D.get(this);
|
|
789
735
|
if (e === void 0)
|
|
790
736
|
throw new Error("WeakMap error");
|
|
791
|
-
return e.state <=
|
|
737
|
+
return e.state <= B || e.state >= O || typeof e.buffer < "u" && !e.buffer.empty ? (R(e), e.err == null && (e.err = n), x(e, S(e))) : this.next(Promise.reject(n));
|
|
792
738
|
}, t.prototype[Symbol.asyncIterator] = function() {
|
|
793
739
|
return this;
|
|
794
|
-
}, t.race =
|
|
740
|
+
}, t.race = ke, t.merge = Te, t.zip = qe, t.latest = De, t;
|
|
795
741
|
}()
|
|
796
742
|
);
|
|
797
|
-
function
|
|
798
|
-
var e,
|
|
799
|
-
s != null && typeof s[Symbol.asyncIterator] == "function" ?
|
|
800
|
-
return
|
|
801
|
-
return P(this, function(
|
|
802
|
-
switch (
|
|
743
|
+
function V(t, n) {
|
|
744
|
+
var e, r, i = [], o = function(s) {
|
|
745
|
+
s != null && typeof s[Symbol.asyncIterator] == "function" ? i.push(s[Symbol.asyncIterator]()) : s != null && typeof s[Symbol.iterator] == "function" ? i.push(s[Symbol.iterator]()) : i.push(function() {
|
|
746
|
+
return Ge(this, arguments, function() {
|
|
747
|
+
return P(this, function(c) {
|
|
748
|
+
switch (c.label) {
|
|
803
749
|
case 0:
|
|
804
|
-
return
|
|
750
|
+
return n.yieldValues ? [4, z(s)] : [3, 3];
|
|
805
751
|
case 1:
|
|
806
|
-
return [4,
|
|
752
|
+
return [4, c.sent()];
|
|
807
753
|
case 2:
|
|
808
|
-
|
|
754
|
+
c.sent(), c.label = 3;
|
|
809
755
|
case 3:
|
|
810
|
-
return
|
|
756
|
+
return n.returnValues ? [4, z(s)] : [3, 5];
|
|
811
757
|
case 4:
|
|
812
|
-
return [2,
|
|
758
|
+
return [2, c.sent()];
|
|
813
759
|
case 5:
|
|
814
760
|
return [
|
|
815
761
|
2
|
|
@@ -821,67 +767,67 @@ function N(t, r) {
|
|
|
821
767
|
}());
|
|
822
768
|
};
|
|
823
769
|
try {
|
|
824
|
-
for (var
|
|
825
|
-
var
|
|
826
|
-
|
|
770
|
+
for (var u = _(t), l = u.next(); !l.done; l = u.next()) {
|
|
771
|
+
var a = l.value;
|
|
772
|
+
o(a);
|
|
827
773
|
}
|
|
828
774
|
} catch (s) {
|
|
829
775
|
e = { error: s };
|
|
830
776
|
} finally {
|
|
831
777
|
try {
|
|
832
|
-
|
|
778
|
+
l && !l.done && (r = u.return) && r.call(u);
|
|
833
779
|
} finally {
|
|
834
780
|
if (e) throw e.error;
|
|
835
781
|
}
|
|
836
782
|
}
|
|
837
|
-
return
|
|
783
|
+
return i;
|
|
838
784
|
}
|
|
839
|
-
function
|
|
840
|
-
var
|
|
841
|
-
return new
|
|
842
|
-
return
|
|
843
|
-
var
|
|
844
|
-
return P(this, function(
|
|
845
|
-
switch (
|
|
785
|
+
function ke(t) {
|
|
786
|
+
var n = this, e = V(t, { returnValues: !0 });
|
|
787
|
+
return new k(function(r, i) {
|
|
788
|
+
return G(n, void 0, void 0, function() {
|
|
789
|
+
var o, u, l, a, s, f;
|
|
790
|
+
return P(this, function(p) {
|
|
791
|
+
switch (p.label) {
|
|
846
792
|
case 0:
|
|
847
793
|
if (!e.length)
|
|
848
|
-
return
|
|
794
|
+
return i(), [
|
|
849
795
|
2
|
|
850
796
|
/*return*/
|
|
851
797
|
];
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
}),
|
|
798
|
+
u = !1, i.then(function() {
|
|
799
|
+
o(), u = !0;
|
|
800
|
+
}), p.label = 1;
|
|
855
801
|
case 1:
|
|
856
|
-
|
|
857
|
-
var
|
|
858
|
-
return P(this, function(
|
|
859
|
-
switch (
|
|
802
|
+
p.trys.push([1, , 5, 7]), a = void 0, s = 0, f = function() {
|
|
803
|
+
var c, d, h, y, m, T;
|
|
804
|
+
return P(this, function(q) {
|
|
805
|
+
switch (q.label) {
|
|
860
806
|
case 0:
|
|
861
|
-
|
|
807
|
+
c = s;
|
|
862
808
|
try {
|
|
863
|
-
for (
|
|
864
|
-
|
|
865
|
-
w.done ? (
|
|
809
|
+
for (d = (m = void 0, _(e)), h = d.next(); !h.done; h = d.next())
|
|
810
|
+
y = h.value, Promise.resolve(y.next()).then(function(w) {
|
|
811
|
+
w.done ? (i(), l === void 0 && (l = w)) : s === c && (s++, o(w));
|
|
866
812
|
}, function(w) {
|
|
867
|
-
return
|
|
813
|
+
return i(w);
|
|
868
814
|
});
|
|
869
815
|
} catch (w) {
|
|
870
816
|
m = { error: w };
|
|
871
817
|
} finally {
|
|
872
818
|
try {
|
|
873
|
-
|
|
819
|
+
h && !h.done && (T = d.return) && T.call(d);
|
|
874
820
|
} finally {
|
|
875
821
|
if (m) throw m.error;
|
|
876
822
|
}
|
|
877
823
|
}
|
|
878
824
|
return [4, new Promise(function(w) {
|
|
879
|
-
return
|
|
825
|
+
return o = w;
|
|
880
826
|
})];
|
|
881
827
|
case 1:
|
|
882
|
-
return
|
|
828
|
+
return a = q.sent(), a === void 0 ? [3, 3] : [4, r(a.value)];
|
|
883
829
|
case 2:
|
|
884
|
-
|
|
830
|
+
q.sent(), q.label = 3;
|
|
885
831
|
case 3:
|
|
886
832
|
return [
|
|
887
833
|
2
|
|
@@ -889,19 +835,19 @@ function qe(t) {
|
|
|
889
835
|
];
|
|
890
836
|
}
|
|
891
837
|
});
|
|
892
|
-
},
|
|
838
|
+
}, p.label = 2;
|
|
893
839
|
case 2:
|
|
894
|
-
return
|
|
840
|
+
return u ? [3, 4] : [5, f()];
|
|
895
841
|
case 3:
|
|
896
|
-
return
|
|
842
|
+
return p.sent(), [3, 2];
|
|
897
843
|
case 4:
|
|
898
|
-
return [2,
|
|
844
|
+
return [2, l && l.value];
|
|
899
845
|
case 5:
|
|
900
|
-
return
|
|
901
|
-
return
|
|
846
|
+
return i(), [4, Promise.race(e.map(function(c) {
|
|
847
|
+
return c.return && c.return();
|
|
902
848
|
}))];
|
|
903
849
|
case 6:
|
|
904
|
-
return
|
|
850
|
+
return p.sent(), [
|
|
905
851
|
7
|
|
906
852
|
/*endfinally*/
|
|
907
853
|
];
|
|
@@ -915,68 +861,68 @@ function qe(t) {
|
|
|
915
861
|
});
|
|
916
862
|
});
|
|
917
863
|
}
|
|
918
|
-
function
|
|
919
|
-
var
|
|
920
|
-
return new
|
|
921
|
-
return
|
|
922
|
-
var
|
|
864
|
+
function Te(t) {
|
|
865
|
+
var n = this, e = V(t, { yieldValues: !0 });
|
|
866
|
+
return new k(function(r, i) {
|
|
867
|
+
return G(n, void 0, void 0, function() {
|
|
868
|
+
var o, u, l, a = this;
|
|
923
869
|
return P(this, function(s) {
|
|
924
870
|
switch (s.label) {
|
|
925
871
|
case 0:
|
|
926
872
|
if (!e.length)
|
|
927
|
-
return
|
|
873
|
+
return i(), [
|
|
928
874
|
2
|
|
929
875
|
/*return*/
|
|
930
876
|
];
|
|
931
|
-
|
|
932
|
-
var f,
|
|
933
|
-
|
|
877
|
+
o = [], u = !1, i.then(function() {
|
|
878
|
+
var f, p;
|
|
879
|
+
u = !0;
|
|
934
880
|
try {
|
|
935
|
-
for (var
|
|
936
|
-
var
|
|
937
|
-
|
|
881
|
+
for (var c = _(o), d = c.next(); !d.done; d = c.next()) {
|
|
882
|
+
var h = d.value;
|
|
883
|
+
h();
|
|
938
884
|
}
|
|
939
|
-
} catch (
|
|
940
|
-
f = { error:
|
|
885
|
+
} catch (y) {
|
|
886
|
+
f = { error: y };
|
|
941
887
|
} finally {
|
|
942
888
|
try {
|
|
943
|
-
|
|
889
|
+
d && !d.done && (p = c.return) && p.call(c);
|
|
944
890
|
} finally {
|
|
945
891
|
if (f) throw f.error;
|
|
946
892
|
}
|
|
947
893
|
}
|
|
948
894
|
}), s.label = 1;
|
|
949
895
|
case 1:
|
|
950
|
-
return s.trys.push([1, , 3, 4]), [4, Promise.all(e.map(function(f,
|
|
951
|
-
return
|
|
952
|
-
var
|
|
953
|
-
return P(this, function(
|
|
954
|
-
switch (
|
|
896
|
+
return s.trys.push([1, , 3, 4]), [4, Promise.all(e.map(function(f, p) {
|
|
897
|
+
return G(a, void 0, void 0, function() {
|
|
898
|
+
var c, d;
|
|
899
|
+
return P(this, function(h) {
|
|
900
|
+
switch (h.label) {
|
|
955
901
|
case 0:
|
|
956
|
-
|
|
902
|
+
h.trys.push([0, , 6, 9]), h.label = 1;
|
|
957
903
|
case 1:
|
|
958
|
-
return
|
|
959
|
-
return
|
|
960
|
-
}, function(
|
|
961
|
-
return
|
|
962
|
-
}), [4, new Promise(function(
|
|
963
|
-
|
|
904
|
+
return u ? [3, 5] : (Promise.resolve(f.next()).then(function(y) {
|
|
905
|
+
return o[p](y);
|
|
906
|
+
}, function(y) {
|
|
907
|
+
return i(y);
|
|
908
|
+
}), [4, new Promise(function(y) {
|
|
909
|
+
o[p] = y;
|
|
964
910
|
})]);
|
|
965
911
|
case 2:
|
|
966
|
-
return
|
|
912
|
+
return c = h.sent(), c === void 0 ? [3, 4] : c.done ? (l = c, [
|
|
967
913
|
2
|
|
968
914
|
/*return*/
|
|
969
|
-
]) : [4,
|
|
915
|
+
]) : [4, r(c.value)];
|
|
970
916
|
case 3:
|
|
971
|
-
|
|
917
|
+
h.sent(), h.label = 4;
|
|
972
918
|
case 4:
|
|
973
919
|
return [3, 1];
|
|
974
920
|
case 5:
|
|
975
921
|
return [3, 9];
|
|
976
922
|
case 6:
|
|
977
|
-
return
|
|
923
|
+
return d = f.return, d ? [4, f.return()] : [3, 8];
|
|
978
924
|
case 7:
|
|
979
|
-
|
|
925
|
+
d = h.sent(), h.label = 8;
|
|
980
926
|
case 8:
|
|
981
927
|
return [
|
|
982
928
|
7
|
|
@@ -992,9 +938,9 @@ function Fe(t) {
|
|
|
992
938
|
});
|
|
993
939
|
}))];
|
|
994
940
|
case 2:
|
|
995
|
-
return s.sent(), [2,
|
|
941
|
+
return s.sent(), [2, l && l.value];
|
|
996
942
|
case 3:
|
|
997
|
-
return
|
|
943
|
+
return i(), [
|
|
998
944
|
7
|
|
999
945
|
/*endfinally*/
|
|
1000
946
|
];
|
|
@@ -1008,46 +954,46 @@ function Fe(t) {
|
|
|
1008
954
|
});
|
|
1009
955
|
});
|
|
1010
956
|
}
|
|
1011
|
-
function
|
|
1012
|
-
var
|
|
1013
|
-
return new
|
|
1014
|
-
return
|
|
1015
|
-
var
|
|
957
|
+
function qe(t) {
|
|
958
|
+
var n = this, e = V(t, { returnValues: !0 });
|
|
959
|
+
return new k(function(r, i) {
|
|
960
|
+
return G(n, void 0, void 0, function() {
|
|
961
|
+
var o, u, l, a;
|
|
1016
962
|
return P(this, function(s) {
|
|
1017
963
|
switch (s.label) {
|
|
1018
964
|
case 0:
|
|
1019
965
|
if (!e.length)
|
|
1020
|
-
return
|
|
1021
|
-
|
|
1022
|
-
|
|
966
|
+
return i(), [2, []];
|
|
967
|
+
u = !1, i.then(function() {
|
|
968
|
+
o(), u = !0;
|
|
1023
969
|
}), s.label = 1;
|
|
1024
970
|
case 1:
|
|
1025
971
|
s.trys.push([1, , 6, 8]), s.label = 2;
|
|
1026
972
|
case 2:
|
|
1027
|
-
return
|
|
973
|
+
return u ? [3, 5] : (Promise.all(e.map(function(f) {
|
|
1028
974
|
return f.next();
|
|
1029
975
|
})).then(function(f) {
|
|
1030
|
-
return i(f);
|
|
1031
|
-
}, function(f) {
|
|
1032
976
|
return o(f);
|
|
977
|
+
}, function(f) {
|
|
978
|
+
return i(f);
|
|
1033
979
|
}), [4, new Promise(function(f) {
|
|
1034
|
-
return
|
|
980
|
+
return o = f;
|
|
1035
981
|
})]);
|
|
1036
982
|
case 3:
|
|
1037
|
-
return
|
|
983
|
+
return l = s.sent(), l === void 0 ? [
|
|
1038
984
|
2
|
|
1039
985
|
/*return*/
|
|
1040
|
-
] : (
|
|
986
|
+
] : (a = l.map(function(f) {
|
|
1041
987
|
return f.value;
|
|
1042
|
-
}),
|
|
988
|
+
}), l.some(function(f) {
|
|
1043
989
|
return f.done;
|
|
1044
|
-
}) ? [2,
|
|
990
|
+
}) ? [2, a] : [4, r(a)]);
|
|
1045
991
|
case 4:
|
|
1046
992
|
return s.sent(), [3, 2];
|
|
1047
993
|
case 5:
|
|
1048
994
|
return [3, 8];
|
|
1049
995
|
case 6:
|
|
1050
|
-
return
|
|
996
|
+
return i(), [4, Promise.all(e.map(function(f) {
|
|
1051
997
|
return f.return && f.return();
|
|
1052
998
|
}))];
|
|
1053
999
|
case 7:
|
|
@@ -1065,79 +1011,79 @@ function Ie(t) {
|
|
|
1065
1011
|
});
|
|
1066
1012
|
});
|
|
1067
1013
|
}
|
|
1068
|
-
function
|
|
1069
|
-
var
|
|
1014
|
+
function De(t) {
|
|
1015
|
+
var n = this, e = V(t, {
|
|
1070
1016
|
yieldValues: !0,
|
|
1071
1017
|
returnValues: !0
|
|
1072
1018
|
});
|
|
1073
|
-
return new
|
|
1074
|
-
return
|
|
1075
|
-
var
|
|
1076
|
-
return P(this, function(
|
|
1077
|
-
switch (
|
|
1019
|
+
return new k(function(r, i) {
|
|
1020
|
+
return G(n, void 0, void 0, function() {
|
|
1021
|
+
var o, u, l, a, s, f = this;
|
|
1022
|
+
return P(this, function(p) {
|
|
1023
|
+
switch (p.label) {
|
|
1078
1024
|
case 0:
|
|
1079
1025
|
if (!e.length)
|
|
1080
|
-
return
|
|
1081
|
-
|
|
1082
|
-
var
|
|
1083
|
-
|
|
1026
|
+
return i(), [2, []];
|
|
1027
|
+
u = [], l = !1, i.then(function() {
|
|
1028
|
+
var c, d;
|
|
1029
|
+
o();
|
|
1084
1030
|
try {
|
|
1085
|
-
for (var
|
|
1086
|
-
var m =
|
|
1031
|
+
for (var h = _(u), y = h.next(); !y.done; y = h.next()) {
|
|
1032
|
+
var m = y.value;
|
|
1087
1033
|
m();
|
|
1088
1034
|
}
|
|
1089
1035
|
} catch (T) {
|
|
1090
|
-
|
|
1036
|
+
c = { error: T };
|
|
1091
1037
|
} finally {
|
|
1092
1038
|
try {
|
|
1093
|
-
|
|
1039
|
+
y && !y.done && (d = h.return) && d.call(h);
|
|
1094
1040
|
} finally {
|
|
1095
|
-
if (
|
|
1041
|
+
if (c) throw c.error;
|
|
1096
1042
|
}
|
|
1097
1043
|
}
|
|
1098
|
-
|
|
1099
|
-
}),
|
|
1044
|
+
l = !0;
|
|
1045
|
+
}), p.label = 1;
|
|
1100
1046
|
case 1:
|
|
1101
|
-
return
|
|
1102
|
-
return
|
|
1103
|
-
})).then(function(
|
|
1104
|
-
return
|
|
1105
|
-
}, function(
|
|
1106
|
-
return
|
|
1107
|
-
}), [4, new Promise(function(
|
|
1108
|
-
return
|
|
1047
|
+
return p.trys.push([1, , 5, 7]), Promise.all(e.map(function(c) {
|
|
1048
|
+
return c.next();
|
|
1049
|
+
})).then(function(c) {
|
|
1050
|
+
return o(c);
|
|
1051
|
+
}, function(c) {
|
|
1052
|
+
return i(c);
|
|
1053
|
+
}), [4, new Promise(function(c) {
|
|
1054
|
+
return o = c;
|
|
1109
1055
|
})];
|
|
1110
1056
|
case 2:
|
|
1111
|
-
return
|
|
1057
|
+
return a = p.sent(), a === void 0 ? [
|
|
1112
1058
|
2
|
|
1113
1059
|
/*return*/
|
|
1114
|
-
] : (s =
|
|
1115
|
-
return
|
|
1116
|
-
}),
|
|
1117
|
-
return
|
|
1118
|
-
}) ? [2, s] : [4,
|
|
1060
|
+
] : (s = a.map(function(c) {
|
|
1061
|
+
return c.value;
|
|
1062
|
+
}), a.every(function(c) {
|
|
1063
|
+
return c.done;
|
|
1064
|
+
}) ? [2, s] : [4, r(s.slice())]);
|
|
1119
1065
|
case 3:
|
|
1120
|
-
return
|
|
1121
|
-
return
|
|
1122
|
-
var
|
|
1123
|
-
return P(this, function(
|
|
1124
|
-
switch (
|
|
1066
|
+
return p.sent(), [4, Promise.all(e.map(function(c, d) {
|
|
1067
|
+
return G(f, void 0, void 0, function() {
|
|
1068
|
+
var h;
|
|
1069
|
+
return P(this, function(y) {
|
|
1070
|
+
switch (y.label) {
|
|
1125
1071
|
case 0:
|
|
1126
|
-
if (
|
|
1127
|
-
return [2,
|
|
1128
|
-
|
|
1072
|
+
if (a[d].done)
|
|
1073
|
+
return [2, a[d].value];
|
|
1074
|
+
y.label = 1;
|
|
1129
1075
|
case 1:
|
|
1130
|
-
return
|
|
1131
|
-
return
|
|
1076
|
+
return l ? [3, 4] : (Promise.resolve(c.next()).then(function(m) {
|
|
1077
|
+
return u[d](m);
|
|
1132
1078
|
}, function(m) {
|
|
1133
|
-
return
|
|
1079
|
+
return i(m);
|
|
1134
1080
|
}), [4, new Promise(function(m) {
|
|
1135
|
-
return
|
|
1081
|
+
return u[d] = m;
|
|
1136
1082
|
})]);
|
|
1137
1083
|
case 2:
|
|
1138
|
-
return
|
|
1084
|
+
return h = y.sent(), h === void 0 ? [2, a[d].value] : h.done ? [2, h.value] : (s[d] = h.value, [4, r(s.slice())]);
|
|
1139
1085
|
case 3:
|
|
1140
|
-
return
|
|
1086
|
+
return y.sent(), [3, 1];
|
|
1141
1087
|
case 4:
|
|
1142
1088
|
return [
|
|
1143
1089
|
2
|
|
@@ -1148,13 +1094,13 @@ function Ae(t) {
|
|
|
1148
1094
|
});
|
|
1149
1095
|
}))];
|
|
1150
1096
|
case 4:
|
|
1151
|
-
return [2,
|
|
1097
|
+
return [2, p.sent()];
|
|
1152
1098
|
case 5:
|
|
1153
|
-
return
|
|
1154
|
-
return
|
|
1099
|
+
return i(), [4, Promise.all(e.map(function(c) {
|
|
1100
|
+
return c.return && c.return();
|
|
1155
1101
|
}))];
|
|
1156
1102
|
case 6:
|
|
1157
|
-
return
|
|
1103
|
+
return p.sent(), [
|
|
1158
1104
|
7
|
|
1159
1105
|
/*endfinally*/
|
|
1160
1106
|
];
|
|
@@ -1168,61 +1114,114 @@ function Ae(t) {
|
|
|
1168
1114
|
});
|
|
1169
1115
|
});
|
|
1170
1116
|
}
|
|
1171
|
-
|
|
1117
|
+
function Fe(t) {
|
|
1118
|
+
return typeof t == "string" ? t : t.url;
|
|
1119
|
+
}
|
|
1120
|
+
function Ie(t, n, e, r) {
|
|
1121
|
+
const i = e[n];
|
|
1122
|
+
if (!(!i || !i.length))
|
|
1123
|
+
try {
|
|
1124
|
+
r[n] = t(r[n], i, !0, !1).newDocument;
|
|
1125
|
+
} catch (o) {
|
|
1126
|
+
throw typeof o == "object" && o && "name" in o && typeof o.name == "string" && "message" in o && typeof o.message == "string" ? o.name === "TEST_OPERATION_FAILED" ? new Oe(o.message) : new Se(o.name + ": " + o.message) : o;
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
function Ae(t, n) {
|
|
1130
|
+
try {
|
|
1131
|
+
return t.compile(n);
|
|
1132
|
+
} catch (e) {
|
|
1133
|
+
throw new je(
|
|
1134
|
+
e instanceof Error ? e.message : void 0
|
|
1135
|
+
);
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
function Me(t, n, e) {
|
|
1139
|
+
t.actor !== (e == null ? void 0 : e.actor) && (t.allowed = t.allowed && e ? [e.actor] : void 0, t.channels = t.channels.filter(
|
|
1140
|
+
(r) => n.includes(r)
|
|
1141
|
+
));
|
|
1142
|
+
}
|
|
1143
|
+
function Ne(t, n) {
|
|
1144
|
+
return t.allowed === void 0 || t.allowed === null || !!(n != null && n.actor) && (t.actor === n.actor || t.allowed.includes(n.actor));
|
|
1145
|
+
}
|
|
1146
|
+
class Ve extends xe {
|
|
1172
1147
|
/**
|
|
1173
1148
|
* Wraps a Graffiti API instance to provide the synchronize methods.
|
|
1174
1149
|
* The GraffitiSyncrhonize class rather than the Graffiti class
|
|
1175
1150
|
* must be used for all functions for the synchronize methods to work.
|
|
1176
1151
|
*/
|
|
1177
|
-
constructor(e,
|
|
1152
|
+
constructor(e, r) {
|
|
1178
1153
|
super();
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
const
|
|
1190
|
-
return this.synchronizeDispatch(
|
|
1154
|
+
v(this, "ajv_");
|
|
1155
|
+
v(this, "applyPatch_");
|
|
1156
|
+
v(this, "graffiti");
|
|
1157
|
+
v(this, "callbacks", /* @__PURE__ */ new Set());
|
|
1158
|
+
v(this, "options");
|
|
1159
|
+
v(this, "channelStats");
|
|
1160
|
+
v(this, "login");
|
|
1161
|
+
v(this, "logout");
|
|
1162
|
+
v(this, "sessionEvents");
|
|
1163
|
+
v(this, "get", async (...e) => {
|
|
1164
|
+
const r = await this.graffiti.get(...e);
|
|
1165
|
+
return this.synchronizeDispatch({ object: r }), r;
|
|
1191
1166
|
});
|
|
1192
|
-
|
|
1193
|
-
const
|
|
1194
|
-
...
|
|
1195
|
-
value:
|
|
1196
|
-
channels:
|
|
1197
|
-
allowed:
|
|
1198
|
-
tombstone: !1
|
|
1167
|
+
v(this, "put", async (...e) => {
|
|
1168
|
+
const r = await this.graffiti.put(...e), i = e[0], o = {
|
|
1169
|
+
...r,
|
|
1170
|
+
value: i.value,
|
|
1171
|
+
channels: i.channels,
|
|
1172
|
+
allowed: i.allowed
|
|
1199
1173
|
};
|
|
1200
|
-
return await this.synchronizeDispatch(
|
|
1174
|
+
return await this.synchronizeDispatch(
|
|
1175
|
+
{
|
|
1176
|
+
tombstone: !0,
|
|
1177
|
+
object: r
|
|
1178
|
+
},
|
|
1179
|
+
{
|
|
1180
|
+
object: o
|
|
1181
|
+
},
|
|
1182
|
+
!0
|
|
1183
|
+
), r;
|
|
1201
1184
|
});
|
|
1202
|
-
|
|
1203
|
-
const
|
|
1204
|
-
o
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1185
|
+
v(this, "patch", async (...e) => {
|
|
1186
|
+
const r = await this.graffiti.patch(...e), i = { ...r };
|
|
1187
|
+
for (const o of ["value", "channels", "allowed"])
|
|
1188
|
+
Ie(await this.applyPatch, o, e[0], i);
|
|
1189
|
+
return await this.synchronizeDispatch(
|
|
1190
|
+
{
|
|
1191
|
+
tombstone: !0,
|
|
1192
|
+
object: r
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
object: i
|
|
1196
|
+
},
|
|
1197
|
+
!0
|
|
1198
|
+
), r;
|
|
1208
1199
|
});
|
|
1209
|
-
|
|
1210
|
-
const
|
|
1211
|
-
return await this.synchronizeDispatch(
|
|
1200
|
+
v(this, "delete", async (...e) => {
|
|
1201
|
+
const r = await this.graffiti.delete(...e);
|
|
1202
|
+
return await this.synchronizeDispatch(
|
|
1203
|
+
{
|
|
1204
|
+
tombstone: !0,
|
|
1205
|
+
object: r
|
|
1206
|
+
},
|
|
1207
|
+
void 0,
|
|
1208
|
+
!0
|
|
1209
|
+
), r;
|
|
1212
1210
|
});
|
|
1213
|
-
|
|
1214
|
-
const
|
|
1215
|
-
return this.objectStream(
|
|
1211
|
+
v(this, "discover", (...e) => {
|
|
1212
|
+
const r = this.graffiti.discover(...e);
|
|
1213
|
+
return this.objectStream(r);
|
|
1216
1214
|
});
|
|
1217
|
-
|
|
1218
|
-
const
|
|
1219
|
-
return this.objectStream(
|
|
1215
|
+
v(this, "recoverOrphans", (...e) => {
|
|
1216
|
+
const r = this.graffiti.recoverOrphans(...e);
|
|
1217
|
+
return this.objectStream(r);
|
|
1220
1218
|
});
|
|
1221
|
-
this
|
|
1219
|
+
v(this, "continueObjectStream", (...e) => this.graffiti.continueObjectStream(...e));
|
|
1220
|
+
this.options = r ?? {}, this.graffiti = e, this.channelStats = e.channelStats.bind(e), this.login = e.login.bind(e), this.logout = e.logout.bind(e), this.sessionEvents = e.sessionEvents;
|
|
1222
1221
|
}
|
|
1223
1222
|
get ajv() {
|
|
1224
1223
|
return this.ajv_ || (this.ajv_ = (async () => {
|
|
1225
|
-
const { default: e } = await import("./ajv-C30pimY5.mjs").then((
|
|
1224
|
+
const { default: e } = await import("./ajv-C30pimY5.mjs").then((r) => r.a);
|
|
1226
1225
|
return new e({ strict: !1 });
|
|
1227
1226
|
})()), this.ajv_;
|
|
1228
1227
|
}
|
|
@@ -1232,20 +1231,23 @@ class Be extends me {
|
|
|
1232
1231
|
return e;
|
|
1233
1232
|
})()), this.applyPatch_;
|
|
1234
1233
|
}
|
|
1235
|
-
synchronize(e,
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1234
|
+
synchronize(e, r, i, o) {
|
|
1235
|
+
const u = /* @__PURE__ */ new Set();
|
|
1236
|
+
return new k(
|
|
1237
|
+
async (a, s) => {
|
|
1238
|
+
const f = Ae(await this.ajv, i), p = (c, d) => {
|
|
1239
|
+
for (const h of [d, c])
|
|
1240
|
+
if (h != null && h.tombstone)
|
|
1241
|
+
u.has(h.object.url) && a(h);
|
|
1242
|
+
else if (h && e(h.object) && (this.options.omniscient || Ne(h.object, o))) {
|
|
1243
|
+
const y = { ...h.object };
|
|
1244
|
+
if (this.options.omniscient || Me(y, r, o), f(y)) {
|
|
1245
|
+
a({ object: y }), u.add(y.url);
|
|
1244
1246
|
break;
|
|
1245
1247
|
}
|
|
1246
1248
|
}
|
|
1247
1249
|
};
|
|
1248
|
-
this.callbacks.add(
|
|
1250
|
+
this.callbacks.add(p), await s, this.callbacks.delete(p);
|
|
1249
1251
|
}
|
|
1250
1252
|
);
|
|
1251
1253
|
}
|
|
@@ -1263,11 +1265,11 @@ class Be extends me {
|
|
|
1263
1265
|
* @group Synchronize Methods
|
|
1264
1266
|
*/
|
|
1265
1267
|
synchronizeDiscover(...e) {
|
|
1266
|
-
const [
|
|
1267
|
-
function
|
|
1268
|
-
return
|
|
1268
|
+
const [r, i, o] = e;
|
|
1269
|
+
function u(l) {
|
|
1270
|
+
return l.channels.some((a) => r.includes(a));
|
|
1269
1271
|
}
|
|
1270
|
-
return this.synchronize(
|
|
1272
|
+
return this.synchronize(u, r, i, o);
|
|
1271
1273
|
}
|
|
1272
1274
|
/**
|
|
1273
1275
|
* This method has the same signature as {@link get} but
|
|
@@ -1276,16 +1278,17 @@ class Be extends me {
|
|
|
1276
1278
|
* streams appropriate changes to provide a responsive and consistent user experience.
|
|
1277
1279
|
*
|
|
1278
1280
|
* Unlike {@link get}, which returns a single result, this method continuously
|
|
1279
|
-
* listens for changes which are output as an asynchronous
|
|
1281
|
+
* listens for changes which are output as an asynchronous stream, similar
|
|
1282
|
+
* to {@link discover}.
|
|
1280
1283
|
*
|
|
1281
1284
|
* @group Synchronize Methods
|
|
1282
1285
|
*/
|
|
1283
1286
|
synchronizeGet(...e) {
|
|
1284
|
-
const [
|
|
1285
|
-
function
|
|
1286
|
-
return
|
|
1287
|
+
const [r, i, o] = e, u = Fe(r);
|
|
1288
|
+
function l(a) {
|
|
1289
|
+
return a.url === u;
|
|
1287
1290
|
}
|
|
1288
|
-
return this.synchronize(
|
|
1291
|
+
return this.synchronize(l, [], i, o);
|
|
1289
1292
|
}
|
|
1290
1293
|
/**
|
|
1291
1294
|
* This method has the same signature as {@link recoverOrphans} but
|
|
@@ -1301,11 +1304,11 @@ class Be extends me {
|
|
|
1301
1304
|
* @group Synchronize Methods
|
|
1302
1305
|
*/
|
|
1303
1306
|
synchronizeRecoverOrphans(...e) {
|
|
1304
|
-
const [
|
|
1305
|
-
function
|
|
1306
|
-
return
|
|
1307
|
+
const [r, i] = e;
|
|
1308
|
+
function o(u) {
|
|
1309
|
+
return u.actor === i.actor && u.channels.length === 0;
|
|
1307
1310
|
}
|
|
1308
|
-
return this.synchronize(
|
|
1311
|
+
return this.synchronize(o, [], r, i);
|
|
1309
1312
|
}
|
|
1310
1313
|
/**
|
|
1311
1314
|
* Streams changes made to *any* object in *any* channel
|
|
@@ -1317,60 +1320,79 @@ class Be extends me {
|
|
|
1317
1320
|
* Be careful using this method. Without additional filters it can
|
|
1318
1321
|
* expose the user to content out of context.
|
|
1319
1322
|
*/
|
|
1320
|
-
synchronizeAll(e,
|
|
1321
|
-
return this.synchronize(() => !0, [], e
|
|
1323
|
+
synchronizeAll(e, r) {
|
|
1324
|
+
return this.synchronize(() => !0, [], e, r);
|
|
1325
|
+
}
|
|
1326
|
+
async synchronizeDispatch(e, r, i = !1) {
|
|
1327
|
+
for (const o of this.callbacks)
|
|
1328
|
+
o(e, r);
|
|
1329
|
+
i && await new Promise((o) => setTimeout(o, 0));
|
|
1322
1330
|
}
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1331
|
+
objectStreamContinue(e) {
|
|
1332
|
+
const r = this;
|
|
1333
|
+
return async function* () {
|
|
1334
|
+
for (; ; ) {
|
|
1335
|
+
const i = await e.next();
|
|
1336
|
+
if (i.done) {
|
|
1337
|
+
const { continue: o, cursor: u } = i.value;
|
|
1338
|
+
return {
|
|
1339
|
+
continue: () => r.objectStreamContinue(o()),
|
|
1340
|
+
cursor: u
|
|
1341
|
+
};
|
|
1342
|
+
}
|
|
1343
|
+
i.value.error || r.synchronizeDispatch(
|
|
1344
|
+
i.value
|
|
1345
|
+
), yield i.value;
|
|
1346
|
+
}
|
|
1347
|
+
}();
|
|
1327
1348
|
}
|
|
1328
1349
|
objectStream(e) {
|
|
1329
|
-
const
|
|
1350
|
+
const r = this.objectStreamContinue(e);
|
|
1330
1351
|
return async function* () {
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1352
|
+
for (; ; ) {
|
|
1353
|
+
const i = await r.next();
|
|
1354
|
+
if (i.done) return i.value;
|
|
1355
|
+
(i.value.error || !i.value.tombstone) && (yield i.value);
|
|
1356
|
+
}
|
|
1335
1357
|
}();
|
|
1336
1358
|
}
|
|
1337
1359
|
}
|
|
1338
|
-
const
|
|
1339
|
-
install(t,
|
|
1340
|
-
const e =
|
|
1341
|
-
|
|
1342
|
-
const
|
|
1343
|
-
if (
|
|
1344
|
-
const
|
|
1345
|
-
if (
|
|
1346
|
-
const
|
|
1347
|
-
s.pathname.startsWith(
|
|
1360
|
+
const Ue = {
|
|
1361
|
+
install(t, n) {
|
|
1362
|
+
const e = n.graffiti, r = new Ve(e), i = M(void 0);
|
|
1363
|
+
r.sessionEvents.addEventListener("initialized", async (o) => {
|
|
1364
|
+
const u = o.detail;
|
|
1365
|
+
if (u && u.error && console.error(u.error), u && u.href) {
|
|
1366
|
+
const l = t.config.globalProperties.$router;
|
|
1367
|
+
if (l) {
|
|
1368
|
+
const a = l.options.history.base, s = new URL(u.href);
|
|
1369
|
+
s.pathname.startsWith(a) && (s.pathname = s.pathname.slice(a.length)), await l.replace(s.pathname + s.search + s.hash);
|
|
1348
1370
|
}
|
|
1349
1371
|
}
|
|
1350
|
-
|
|
1351
|
-
}),
|
|
1352
|
-
const
|
|
1353
|
-
if (
|
|
1354
|
-
console.error("Error logging in:"), console.error(
|
|
1372
|
+
i.value || (i.value = null);
|
|
1373
|
+
}), r.sessionEvents.addEventListener("login", (o) => {
|
|
1374
|
+
const u = o.detail;
|
|
1375
|
+
if (u.error) {
|
|
1376
|
+
console.error("Error logging in:"), console.error(u.error);
|
|
1355
1377
|
return;
|
|
1356
1378
|
} else
|
|
1357
|
-
|
|
1358
|
-
}),
|
|
1359
|
-
const
|
|
1360
|
-
|
|
1361
|
-
}), t.provide(Y,
|
|
1379
|
+
i.value = u.session;
|
|
1380
|
+
}), r.sessionEvents.addEventListener("logout", (o) => {
|
|
1381
|
+
const u = o.detail;
|
|
1382
|
+
u.error ? (console.error("Error logging out:"), console.error(u.error)) : i.value = null;
|
|
1383
|
+
}), t.provide(Y, r), t.provide(Z, i), t.component("GraffitiDiscover", ie), t.component("GraffitiGet", se), t.component("GraffitiRecoverOrphans", ue), t.config.globalProperties.$graffiti = r, t.config.globalProperties.$graffitiSession = i;
|
|
1362
1384
|
}
|
|
1363
|
-
},
|
|
1385
|
+
}, Le = ie, We = se, Je = ue;
|
|
1364
1386
|
export {
|
|
1365
|
-
|
|
1387
|
+
Le as GraffitiDiscover,
|
|
1366
1388
|
We as GraffitiGet,
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1389
|
+
Ue as GraffitiPlugin,
|
|
1390
|
+
Je as GraffitiRecoverOrphans,
|
|
1391
|
+
$e as useGraffiti,
|
|
1392
|
+
be as useGraffitiDiscover,
|
|
1393
|
+
ge as useGraffitiGet,
|
|
1394
|
+
Pe as useGraffitiRecoverOrphans,
|
|
1373
1395
|
ee as useGraffitiSession,
|
|
1374
|
-
|
|
1396
|
+
N as useGraffitiSynchronize
|
|
1375
1397
|
};
|
|
1376
1398
|
//# sourceMappingURL=plugin.mjs.map
|