@graffiti-garden/wrapper-vue 0.6.1 → 0.6.3
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 +212 -209
- package/dist/browser/plugin.mjs.map +1 -1
- package/dist/node/plugin.js +1 -1
- package/dist/node/plugin.js.map +1 -1
- package/dist/node/plugin.mjs +58 -55
- package/dist/node/plugin.mjs.map +1 -1
- package/dist/node/pollers.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/pollers.ts +30 -12
package/dist/browser/plugin.mjs
CHANGED
|
@@ -22,39 +22,56 @@ function ee() {
|
|
|
22
22
|
);
|
|
23
23
|
return t;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
var me = class {
|
|
26
|
+
}, we = class te extends Error {
|
|
27
|
+
constructor(n) {
|
|
28
|
+
super(n), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this, te.prototype);
|
|
29
|
+
}
|
|
30
|
+
}, be = class ne extends Error {
|
|
31
|
+
constructor(n) {
|
|
32
|
+
super(n), this.name = "GraffitiErrorPatchTestFailed", Object.setPrototypeOf(this, ne.prototype);
|
|
33
|
+
}
|
|
34
|
+
}, ge = class re extends Error {
|
|
35
|
+
constructor(n) {
|
|
36
|
+
super(n), this.name = "GraffitiErrorPatchError", Object.setPrototypeOf(this, re.prototype);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
class Pe {
|
|
26
40
|
constructor(n) {
|
|
27
41
|
v(this, "poll", async (n) => {
|
|
28
42
|
let e;
|
|
43
|
+
const r = this.getter;
|
|
29
44
|
try {
|
|
30
|
-
e = await
|
|
45
|
+
e = await r();
|
|
31
46
|
} catch {
|
|
32
|
-
n(null);
|
|
47
|
+
this.getter === r && n(null);
|
|
33
48
|
return;
|
|
34
49
|
}
|
|
35
|
-
n({ object: e });
|
|
50
|
+
this.getter === r && n({ object: e });
|
|
36
51
|
});
|
|
37
52
|
this.getter = n;
|
|
38
53
|
}
|
|
39
54
|
clear() {
|
|
40
55
|
}
|
|
41
56
|
}
|
|
42
|
-
class
|
|
57
|
+
class ie {
|
|
43
58
|
constructor(n) {
|
|
44
59
|
v(this, "iterator");
|
|
45
60
|
v(this, "continue");
|
|
46
61
|
v(this, "poll", async (n) => {
|
|
47
|
-
for (this.iterator || (this.continue ? this.iterator = this.continue() : this.iterator = this.streamFactory()); ; ) {
|
|
48
|
-
const e =
|
|
49
|
-
if (e.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
62
|
+
for (this.iterator || (this.continue ? this.iterator = this.continue() : this.iterator = this.streamFactory()); this.iterator; ) {
|
|
63
|
+
const e = this.iterator, r = await e.next();
|
|
64
|
+
if (e === this.iterator) {
|
|
65
|
+
if (r.done) {
|
|
66
|
+
r.value && (this.iterator = void 0, this.continue = r.value.continue);
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
if (r.value.error) {
|
|
70
|
+
console.error(r.value.error);
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
n(r.value);
|
|
56
74
|
}
|
|
57
|
-
n(e.value);
|
|
58
75
|
}
|
|
59
76
|
});
|
|
60
77
|
this.streamFactory = n;
|
|
@@ -70,10 +87,10 @@ class te {
|
|
|
70
87
|
this.iterator = void 0, this.continue = void 0;
|
|
71
88
|
}
|
|
72
89
|
}
|
|
73
|
-
function
|
|
90
|
+
function oe(t, n) {
|
|
74
91
|
return !n || t.object.lastModified > n.object.lastModified || t.object.lastModified === n.object.lastModified && !t.tombstone && !!n.tombstone;
|
|
75
92
|
}
|
|
76
|
-
class
|
|
93
|
+
class xe {
|
|
77
94
|
constructor() {
|
|
78
95
|
v(this, "entry", M());
|
|
79
96
|
}
|
|
@@ -87,10 +104,10 @@ class we {
|
|
|
87
104
|
this.entry.value = void 0;
|
|
88
105
|
}
|
|
89
106
|
onEntry(n) {
|
|
90
|
-
(!n ||
|
|
107
|
+
(!n || oe(n, this.entry.value)) && (this.entry.value = n);
|
|
91
108
|
}
|
|
92
109
|
}
|
|
93
|
-
class
|
|
110
|
+
class se {
|
|
94
111
|
constructor(n) {
|
|
95
112
|
v(this, "results", M([]));
|
|
96
113
|
v(this, "resultsRaw", /* @__PURE__ */ new Map());
|
|
@@ -106,16 +123,16 @@ class re {
|
|
|
106
123
|
onEntry(n) {
|
|
107
124
|
if (!n) return;
|
|
108
125
|
const e = this.resultsRaw.get(n.object.url);
|
|
109
|
-
|
|
126
|
+
oe(n, e) && (this.resultsRaw.set(n.object.url, n), this.batchFlattenTimer || (this.batchFlattenTimer = setTimeout(() => {
|
|
110
127
|
this.flattenResults(), this.batchFlattenTimer = void 0;
|
|
111
128
|
}, 0)));
|
|
112
129
|
}
|
|
113
130
|
}
|
|
114
131
|
function J(t, n, e, r) {
|
|
115
|
-
let
|
|
116
|
-
async function
|
|
117
|
-
|
|
118
|
-
for await (const a of
|
|
132
|
+
let o;
|
|
133
|
+
async function i() {
|
|
134
|
+
o = e();
|
|
135
|
+
for await (const a of o) {
|
|
119
136
|
if (a.error) {
|
|
120
137
|
console.error(a.error);
|
|
121
138
|
continue;
|
|
@@ -128,7 +145,7 @@ function J(t, n, e, r) {
|
|
|
128
145
|
r,
|
|
129
146
|
async (a, s) => {
|
|
130
147
|
if (JSON.stringify(a) !== JSON.stringify(s)) {
|
|
131
|
-
|
|
148
|
+
o == null || o.return(null), t.clear(), n.clear(), i(), l.value = !0;
|
|
132
149
|
try {
|
|
133
150
|
await u();
|
|
134
151
|
} finally {
|
|
@@ -139,9 +156,9 @@ function J(t, n, e, r) {
|
|
|
139
156
|
{
|
|
140
157
|
immediate: !0
|
|
141
158
|
}
|
|
142
|
-
), ve(() =>
|
|
159
|
+
), ve(() => o == null ? void 0 : o.return(null)), { poll: u, isPolling: l };
|
|
143
160
|
}
|
|
144
|
-
function
|
|
161
|
+
function ue(t, n) {
|
|
145
162
|
return () => {
|
|
146
163
|
const e = j(n);
|
|
147
164
|
return e === void 0 ? t == null ? void 0 : t.value : e;
|
|
@@ -150,8 +167,8 @@ function oe(t, n) {
|
|
|
150
167
|
function E(t) {
|
|
151
168
|
return t.map((n) => n());
|
|
152
169
|
}
|
|
153
|
-
function
|
|
154
|
-
const r = N(),
|
|
170
|
+
function je(t, n, e) {
|
|
171
|
+
const r = N(), o = ee(), i = () => j(t), u = () => j(n), l = ue(o, e), a = [i, u, l], s = () => r.synchronizeDiscover(...E(a)), f = () => r.discover(...E(a)), p = new se(r), c = new ie(f), { poll: d, isPolling: h } = J(
|
|
155
172
|
p,
|
|
156
173
|
c,
|
|
157
174
|
s,
|
|
@@ -175,12 +192,12 @@ function be(t, n, e) {
|
|
|
175
192
|
isPolling: h
|
|
176
193
|
};
|
|
177
194
|
}
|
|
178
|
-
function
|
|
179
|
-
const r = N(),
|
|
180
|
-
|
|
195
|
+
function Oe(t, n, e) {
|
|
196
|
+
const r = N(), o = ee(), i = () => j(t), u = () => j(n), l = ue(o, e), a = [
|
|
197
|
+
i,
|
|
181
198
|
u,
|
|
182
199
|
l
|
|
183
|
-
], s = () => r.synchronizeGet(...E(a)), f = new
|
|
200
|
+
], s = () => r.synchronizeGet(...E(a)), f = new xe(), p = () => r.get(...E(a)), c = new Pe(p), { poll: d, isPolling: h } = J(
|
|
184
201
|
f,
|
|
185
202
|
c,
|
|
186
203
|
s,
|
|
@@ -205,12 +222,12 @@ function ge(t, n, e) {
|
|
|
205
222
|
isPolling: h
|
|
206
223
|
};
|
|
207
224
|
}
|
|
208
|
-
function
|
|
209
|
-
const e = N(),
|
|
225
|
+
function Se(t, n) {
|
|
226
|
+
const e = N(), i = [() => j(t), () => j(n)], u = () => e.synchronizeRecoverOrphans(...E(i)), l = new se(e), a = () => e.recoverOrphans(...E(i)), s = new ie(a), { poll: f, isPolling: p } = J(
|
|
210
227
|
l,
|
|
211
228
|
s,
|
|
212
229
|
u,
|
|
213
|
-
|
|
230
|
+
i
|
|
214
231
|
);
|
|
215
232
|
return {
|
|
216
233
|
/**
|
|
@@ -230,7 +247,7 @@ function Pe(t, n) {
|
|
|
230
247
|
isPolling: p
|
|
231
248
|
};
|
|
232
249
|
}
|
|
233
|
-
const
|
|
250
|
+
const ae = /* @__PURE__ */ L({
|
|
234
251
|
__name: "Discover",
|
|
235
252
|
props: {
|
|
236
253
|
channels: {},
|
|
@@ -238,18 +255,18 @@ const ie = /* @__PURE__ */ L({
|
|
|
238
255
|
session: {}
|
|
239
256
|
},
|
|
240
257
|
setup(t) {
|
|
241
|
-
const n = t, { results: e, poll: r, isPolling:
|
|
258
|
+
const n = t, { results: e, poll: r, isPolling: o } = je(
|
|
242
259
|
g(n, "channels"),
|
|
243
260
|
g(n, "schema"),
|
|
244
261
|
g(n, "session")
|
|
245
262
|
);
|
|
246
|
-
return (
|
|
263
|
+
return (i, u) => W(i.$slots, "default", {
|
|
247
264
|
results: b(e),
|
|
248
265
|
poll: b(r),
|
|
249
|
-
isPolling: b(
|
|
266
|
+
isPolling: b(o)
|
|
250
267
|
});
|
|
251
268
|
}
|
|
252
|
-
}),
|
|
269
|
+
}), ce = /* @__PURE__ */ L({
|
|
253
270
|
__name: "Get",
|
|
254
271
|
props: {
|
|
255
272
|
url: {},
|
|
@@ -257,49 +274,35 @@ const ie = /* @__PURE__ */ L({
|
|
|
257
274
|
session: {}
|
|
258
275
|
},
|
|
259
276
|
setup(t) {
|
|
260
|
-
const n = t, { result: e, poll: r, isPolling:
|
|
277
|
+
const n = t, { result: e, poll: r, isPolling: o } = Oe(
|
|
261
278
|
g(n, "url"),
|
|
262
279
|
g(n, "schema"),
|
|
263
280
|
g(n, "session")
|
|
264
281
|
);
|
|
265
|
-
return (
|
|
282
|
+
return (i, u) => W(i.$slots, "default", {
|
|
266
283
|
result: b(e),
|
|
267
284
|
poll: b(r),
|
|
268
|
-
isPolling: b(
|
|
285
|
+
isPolling: b(o)
|
|
269
286
|
});
|
|
270
287
|
}
|
|
271
|
-
}),
|
|
288
|
+
}), le = /* @__PURE__ */ L({
|
|
272
289
|
__name: "RecoverOrphans",
|
|
273
290
|
props: {
|
|
274
291
|
schema: {},
|
|
275
292
|
session: {}
|
|
276
293
|
},
|
|
277
294
|
setup(t) {
|
|
278
|
-
const n = t, { results: e, poll: r, isPolling:
|
|
295
|
+
const n = t, { results: e, poll: r, isPolling: o } = Se(
|
|
279
296
|
g(n, "schema"),
|
|
280
297
|
g(n, "session")
|
|
281
298
|
);
|
|
282
|
-
return (
|
|
299
|
+
return (i, u) => W(i.$slots, "default", {
|
|
283
300
|
results: b(e),
|
|
284
301
|
poll: b(r),
|
|
285
|
-
isPolling: b(
|
|
302
|
+
isPolling: b(o)
|
|
286
303
|
});
|
|
287
304
|
}
|
|
288
305
|
});
|
|
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
|
-
};
|
|
303
306
|
/*! *****************************************************************************
|
|
304
307
|
Copyright (c) Microsoft Corporation.
|
|
305
308
|
|
|
@@ -318,7 +321,7 @@ var C = function(t, n) {
|
|
|
318
321
|
return C = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
319
322
|
e.__proto__ = r;
|
|
320
323
|
} || function(e, r) {
|
|
321
|
-
for (var
|
|
324
|
+
for (var o in r) r.hasOwnProperty(o) && (e[o] = r[o]);
|
|
322
325
|
}, C(t, n);
|
|
323
326
|
};
|
|
324
327
|
function Ee(t, n) {
|
|
@@ -329,12 +332,12 @@ function Ee(t, n) {
|
|
|
329
332
|
t.prototype = n === null ? Object.create(n) : (e.prototype = n.prototype, new e());
|
|
330
333
|
}
|
|
331
334
|
function G(t, n, e, r) {
|
|
332
|
-
function i
|
|
333
|
-
return
|
|
334
|
-
u(
|
|
335
|
+
function o(i) {
|
|
336
|
+
return i instanceof e ? i : new e(function(u) {
|
|
337
|
+
u(i);
|
|
335
338
|
});
|
|
336
339
|
}
|
|
337
|
-
return new (e || (e = Promise))(function(
|
|
340
|
+
return new (e || (e = Promise))(function(i, u) {
|
|
338
341
|
function l(f) {
|
|
339
342
|
try {
|
|
340
343
|
s(r.next(f));
|
|
@@ -350,16 +353,16 @@ function G(t, n, e, r) {
|
|
|
350
353
|
}
|
|
351
354
|
}
|
|
352
355
|
function s(f) {
|
|
353
|
-
f.done ?
|
|
356
|
+
f.done ? i(f.value) : o(f.value).then(l, a);
|
|
354
357
|
}
|
|
355
358
|
s((r = r.apply(t, [])).next());
|
|
356
359
|
});
|
|
357
360
|
}
|
|
358
361
|
function P(t, n) {
|
|
359
362
|
var e = { label: 0, sent: function() {
|
|
360
|
-
if (
|
|
361
|
-
return
|
|
362
|
-
}, trys: [], ops: [] }, r,
|
|
363
|
+
if (i[0] & 1) throw i[1];
|
|
364
|
+
return i[1];
|
|
365
|
+
}, trys: [], ops: [] }, r, o, i, u;
|
|
363
366
|
return u = { next: l(0), throw: l(1), return: l(2) }, typeof Symbol == "function" && (u[Symbol.iterator] = function() {
|
|
364
367
|
return this;
|
|
365
368
|
}), u;
|
|
@@ -371,45 +374,45 @@ function P(t, n) {
|
|
|
371
374
|
function a(s) {
|
|
372
375
|
if (r) throw new TypeError("Generator is already executing.");
|
|
373
376
|
for (; e; ) try {
|
|
374
|
-
if (r = 1,
|
|
375
|
-
switch (
|
|
377
|
+
if (r = 1, o && (i = s[0] & 2 ? o.return : s[0] ? o.throw || ((i = o.return) && i.call(o), 0) : o.next) && !(i = i.call(o, s[1])).done) return i;
|
|
378
|
+
switch (o = 0, i && (s = [s[0] & 2, i.value]), s[0]) {
|
|
376
379
|
case 0:
|
|
377
380
|
case 1:
|
|
378
|
-
|
|
381
|
+
i = s;
|
|
379
382
|
break;
|
|
380
383
|
case 4:
|
|
381
384
|
return e.label++, { value: s[1], done: !1 };
|
|
382
385
|
case 5:
|
|
383
|
-
e.label++,
|
|
386
|
+
e.label++, o = s[1], s = [0];
|
|
384
387
|
continue;
|
|
385
388
|
case 7:
|
|
386
389
|
s = e.ops.pop(), e.trys.pop();
|
|
387
390
|
continue;
|
|
388
391
|
default:
|
|
389
|
-
if (
|
|
392
|
+
if (i = e.trys, !(i = i.length > 0 && i[i.length - 1]) && (s[0] === 6 || s[0] === 2)) {
|
|
390
393
|
e = 0;
|
|
391
394
|
continue;
|
|
392
395
|
}
|
|
393
|
-
if (s[0] === 3 && (!
|
|
396
|
+
if (s[0] === 3 && (!i || s[1] > i[0] && s[1] < i[3])) {
|
|
394
397
|
e.label = s[1];
|
|
395
398
|
break;
|
|
396
399
|
}
|
|
397
|
-
if (s[0] === 6 && e.label <
|
|
398
|
-
e.label =
|
|
400
|
+
if (s[0] === 6 && e.label < i[1]) {
|
|
401
|
+
e.label = i[1], i = s;
|
|
399
402
|
break;
|
|
400
403
|
}
|
|
401
|
-
if (
|
|
402
|
-
e.label =
|
|
404
|
+
if (i && e.label < i[2]) {
|
|
405
|
+
e.label = i[2], e.ops.push(s);
|
|
403
406
|
break;
|
|
404
407
|
}
|
|
405
|
-
|
|
408
|
+
i[2] && e.ops.pop(), e.trys.pop();
|
|
406
409
|
continue;
|
|
407
410
|
}
|
|
408
411
|
s = n.call(t, e);
|
|
409
412
|
} catch (f) {
|
|
410
|
-
s = [6, f],
|
|
413
|
+
s = [6, f], o = 0;
|
|
411
414
|
} finally {
|
|
412
|
-
r =
|
|
415
|
+
r = i = 0;
|
|
413
416
|
}
|
|
414
417
|
if (s[0] & 5) throw s[1];
|
|
415
418
|
return { value: s[0] ? s[1] : void 0, done: !0 };
|
|
@@ -430,14 +433,14 @@ function z(t) {
|
|
|
430
433
|
}
|
|
431
434
|
function Ge(t, n, e) {
|
|
432
435
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
433
|
-
var r = e.apply(t, n || []),
|
|
434
|
-
return
|
|
436
|
+
var r = e.apply(t, n || []), o, i = [];
|
|
437
|
+
return o = {}, u("next"), u("throw"), u("return"), o[Symbol.asyncIterator] = function() {
|
|
435
438
|
return this;
|
|
436
|
-
},
|
|
439
|
+
}, o;
|
|
437
440
|
function u(c) {
|
|
438
|
-
r[c] && (
|
|
441
|
+
r[c] && (o[c] = function(d) {
|
|
439
442
|
return new Promise(function(h, y) {
|
|
440
|
-
|
|
443
|
+
i.push([c, d, h, y]) > 1 || l(c, d);
|
|
441
444
|
});
|
|
442
445
|
});
|
|
443
446
|
}
|
|
@@ -445,11 +448,11 @@ function Ge(t, n, e) {
|
|
|
445
448
|
try {
|
|
446
449
|
a(r[c](d));
|
|
447
450
|
} catch (h) {
|
|
448
|
-
p(
|
|
451
|
+
p(i[0][3], h);
|
|
449
452
|
}
|
|
450
453
|
}
|
|
451
454
|
function a(c) {
|
|
452
|
-
c.value instanceof z ? Promise.resolve(c.value.v).then(s, f) : p(
|
|
455
|
+
c.value instanceof z ? Promise.resolve(c.value.v).then(s, f) : p(i[0][2], c);
|
|
453
456
|
}
|
|
454
457
|
function s(c) {
|
|
455
458
|
l("next", c);
|
|
@@ -458,7 +461,7 @@ function Ge(t, n, e) {
|
|
|
458
461
|
l("throw", c);
|
|
459
462
|
}
|
|
460
463
|
function p(c, d) {
|
|
461
|
-
c(d),
|
|
464
|
+
c(d), i.shift(), i.length && l(i[0][0], i[0][1]);
|
|
462
465
|
}
|
|
463
466
|
}
|
|
464
467
|
var fe = (
|
|
@@ -577,9 +580,9 @@ function S(t) {
|
|
|
577
580
|
function x(t, n) {
|
|
578
581
|
var e = t.state >= F;
|
|
579
582
|
return Promise.resolve(n).then(function(r) {
|
|
580
|
-
return !e && t.state >= U ? S(t).then(function(
|
|
583
|
+
return !e && t.state >= U ? S(t).then(function(o) {
|
|
581
584
|
return {
|
|
582
|
-
value:
|
|
585
|
+
value: o,
|
|
583
586
|
done: !0
|
|
584
587
|
};
|
|
585
588
|
}) : { value: r, done: e };
|
|
@@ -592,15 +595,15 @@ function K(t, n) {
|
|
|
592
595
|
R(t);
|
|
593
596
|
else
|
|
594
597
|
try {
|
|
595
|
-
for (var
|
|
596
|
-
var u =
|
|
598
|
+
for (var o = _(t.pushes), i = o.next(); !i.done; i = o.next()) {
|
|
599
|
+
var u = i.value;
|
|
597
600
|
u.resolve();
|
|
598
601
|
}
|
|
599
602
|
} catch (l) {
|
|
600
603
|
e = { error: l };
|
|
601
604
|
} finally {
|
|
602
605
|
try {
|
|
603
|
-
|
|
606
|
+
i && !i.done && (r = o.return) && r.call(o);
|
|
604
607
|
} finally {
|
|
605
608
|
if (e) throw e.error;
|
|
606
609
|
}
|
|
@@ -611,17 +614,17 @@ function R(t) {
|
|
|
611
614
|
if (!(t.state >= F)) {
|
|
612
615
|
t.state < O && K(t), t.state = F, t.buffer = void 0;
|
|
613
616
|
try {
|
|
614
|
-
for (var r = _(t.nexts),
|
|
615
|
-
var
|
|
617
|
+
for (var r = _(t.nexts), o = r.next(); !o.done; o = r.next()) {
|
|
618
|
+
var i = o.value, u = t.pending === void 0 ? S(t) : t.pending.then(function() {
|
|
616
619
|
return S(t);
|
|
617
620
|
});
|
|
618
|
-
|
|
621
|
+
i.resolve(x(t, u));
|
|
619
622
|
}
|
|
620
623
|
} catch (l) {
|
|
621
624
|
n = { error: l };
|
|
622
625
|
} finally {
|
|
623
626
|
try {
|
|
624
|
-
|
|
627
|
+
o && !o.done && (e = r.return) && e.call(r);
|
|
625
628
|
} finally {
|
|
626
629
|
if (n) throw n.error;
|
|
627
630
|
}
|
|
@@ -645,21 +648,21 @@ function _e(t, n) {
|
|
|
645
648
|
});
|
|
646
649
|
var r;
|
|
647
650
|
if (t.nexts.length) {
|
|
648
|
-
var
|
|
649
|
-
|
|
651
|
+
var o = t.nexts.shift();
|
|
652
|
+
o.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
653
|
return t.onnext = a;
|
|
651
654
|
});
|
|
652
655
|
} else typeof t.buffer < "u" && !t.buffer.full ? (t.buffer.add(e), r = Promise.resolve(void 0)) : r = new Promise(function(a) {
|
|
653
656
|
return t.pushes.push({ resolve: a, value: e });
|
|
654
657
|
});
|
|
655
|
-
var
|
|
656
|
-
if (
|
|
658
|
+
var i = !0, u = {}, l = r.catch(function(a) {
|
|
659
|
+
if (i)
|
|
657
660
|
throw a;
|
|
658
661
|
});
|
|
659
662
|
return u.then = function(a, s) {
|
|
660
|
-
return
|
|
663
|
+
return i = !1, Promise.prototype.then.call(r, a, s);
|
|
661
664
|
}, u.catch = function(a) {
|
|
662
|
-
return
|
|
665
|
+
return i = !1, Promise.prototype.catch.call(r, a);
|
|
663
666
|
}, u.finally = r.finally.bind(r), t.pending = e.then(function() {
|
|
664
667
|
return l;
|
|
665
668
|
}).catch(function(a) {
|
|
@@ -710,13 +713,13 @@ var D = /* @__PURE__ */ new WeakMap(), k = (
|
|
|
710
713
|
if (e.state <= B && ze(e), e.onnext(n), typeof e.buffer < "u" && !e.buffer.empty) {
|
|
711
714
|
var r = x(e, e.buffer.remove());
|
|
712
715
|
if (e.pushes.length) {
|
|
713
|
-
var
|
|
714
|
-
e.buffer.add(
|
|
716
|
+
var o = e.pushes.shift();
|
|
717
|
+
e.buffer.add(o.value), e.onnext = o.resolve;
|
|
715
718
|
}
|
|
716
719
|
return r;
|
|
717
720
|
} else if (e.pushes.length) {
|
|
718
|
-
var
|
|
719
|
-
return e.onnext =
|
|
721
|
+
var i = e.pushes.shift();
|
|
722
|
+
return e.onnext = i.resolve, x(e, i.value);
|
|
720
723
|
} else if (e.state >= O)
|
|
721
724
|
return R(e), x(e, S(e));
|
|
722
725
|
return new Promise(function(u) {
|
|
@@ -741,8 +744,8 @@ var D = /* @__PURE__ */ new WeakMap(), k = (
|
|
|
741
744
|
}()
|
|
742
745
|
);
|
|
743
746
|
function V(t, n) {
|
|
744
|
-
var e, r,
|
|
745
|
-
s != null && typeof s[Symbol.asyncIterator] == "function" ?
|
|
747
|
+
var e, r, o = [], i = function(s) {
|
|
748
|
+
s != null && typeof s[Symbol.asyncIterator] == "function" ? o.push(s[Symbol.asyncIterator]()) : s != null && typeof s[Symbol.iterator] == "function" ? o.push(s[Symbol.iterator]()) : o.push(function() {
|
|
746
749
|
return Ge(this, arguments, function() {
|
|
747
750
|
return P(this, function(c) {
|
|
748
751
|
switch (c.label) {
|
|
@@ -769,7 +772,7 @@ function V(t, n) {
|
|
|
769
772
|
try {
|
|
770
773
|
for (var u = _(t), l = u.next(); !l.done; l = u.next()) {
|
|
771
774
|
var a = l.value;
|
|
772
|
-
|
|
775
|
+
i(a);
|
|
773
776
|
}
|
|
774
777
|
} catch (s) {
|
|
775
778
|
e = { error: s };
|
|
@@ -780,23 +783,23 @@ function V(t, n) {
|
|
|
780
783
|
if (e) throw e.error;
|
|
781
784
|
}
|
|
782
785
|
}
|
|
783
|
-
return
|
|
786
|
+
return o;
|
|
784
787
|
}
|
|
785
788
|
function ke(t) {
|
|
786
789
|
var n = this, e = V(t, { returnValues: !0 });
|
|
787
|
-
return new k(function(r,
|
|
790
|
+
return new k(function(r, o) {
|
|
788
791
|
return G(n, void 0, void 0, function() {
|
|
789
|
-
var
|
|
792
|
+
var i, u, l, a, s, f;
|
|
790
793
|
return P(this, function(p) {
|
|
791
794
|
switch (p.label) {
|
|
792
795
|
case 0:
|
|
793
796
|
if (!e.length)
|
|
794
|
-
return
|
|
797
|
+
return o(), [
|
|
795
798
|
2
|
|
796
799
|
/*return*/
|
|
797
800
|
];
|
|
798
|
-
u = !1,
|
|
799
|
-
|
|
801
|
+
u = !1, o.then(function() {
|
|
802
|
+
i(), u = !0;
|
|
800
803
|
}), p.label = 1;
|
|
801
804
|
case 1:
|
|
802
805
|
p.trys.push([1, , 5, 7]), a = void 0, s = 0, f = function() {
|
|
@@ -808,9 +811,9 @@ function ke(t) {
|
|
|
808
811
|
try {
|
|
809
812
|
for (d = (m = void 0, _(e)), h = d.next(); !h.done; h = d.next())
|
|
810
813
|
y = h.value, Promise.resolve(y.next()).then(function(w) {
|
|
811
|
-
w.done ? (
|
|
814
|
+
w.done ? (o(), l === void 0 && (l = w)) : s === c && (s++, i(w));
|
|
812
815
|
}, function(w) {
|
|
813
|
-
return
|
|
816
|
+
return o(w);
|
|
814
817
|
});
|
|
815
818
|
} catch (w) {
|
|
816
819
|
m = { error: w };
|
|
@@ -822,7 +825,7 @@ function ke(t) {
|
|
|
822
825
|
}
|
|
823
826
|
}
|
|
824
827
|
return [4, new Promise(function(w) {
|
|
825
|
-
return
|
|
828
|
+
return i = w;
|
|
826
829
|
})];
|
|
827
830
|
case 1:
|
|
828
831
|
return a = q.sent(), a === void 0 ? [3, 3] : [4, r(a.value)];
|
|
@@ -843,7 +846,7 @@ function ke(t) {
|
|
|
843
846
|
case 4:
|
|
844
847
|
return [2, l && l.value];
|
|
845
848
|
case 5:
|
|
846
|
-
return
|
|
849
|
+
return o(), [4, Promise.race(e.map(function(c) {
|
|
847
850
|
return c.return && c.return();
|
|
848
851
|
}))];
|
|
849
852
|
case 6:
|
|
@@ -863,22 +866,22 @@ function ke(t) {
|
|
|
863
866
|
}
|
|
864
867
|
function Te(t) {
|
|
865
868
|
var n = this, e = V(t, { yieldValues: !0 });
|
|
866
|
-
return new k(function(r,
|
|
869
|
+
return new k(function(r, o) {
|
|
867
870
|
return G(n, void 0, void 0, function() {
|
|
868
|
-
var
|
|
871
|
+
var i, u, l, a = this;
|
|
869
872
|
return P(this, function(s) {
|
|
870
873
|
switch (s.label) {
|
|
871
874
|
case 0:
|
|
872
875
|
if (!e.length)
|
|
873
|
-
return
|
|
876
|
+
return o(), [
|
|
874
877
|
2
|
|
875
878
|
/*return*/
|
|
876
879
|
];
|
|
877
|
-
|
|
880
|
+
i = [], u = !1, o.then(function() {
|
|
878
881
|
var f, p;
|
|
879
882
|
u = !0;
|
|
880
883
|
try {
|
|
881
|
-
for (var c = _(
|
|
884
|
+
for (var c = _(i), d = c.next(); !d.done; d = c.next()) {
|
|
882
885
|
var h = d.value;
|
|
883
886
|
h();
|
|
884
887
|
}
|
|
@@ -902,11 +905,11 @@ function Te(t) {
|
|
|
902
905
|
h.trys.push([0, , 6, 9]), h.label = 1;
|
|
903
906
|
case 1:
|
|
904
907
|
return u ? [3, 5] : (Promise.resolve(f.next()).then(function(y) {
|
|
905
|
-
return
|
|
908
|
+
return i[p](y);
|
|
906
909
|
}, function(y) {
|
|
907
|
-
return
|
|
910
|
+
return o(y);
|
|
908
911
|
}), [4, new Promise(function(y) {
|
|
909
|
-
|
|
912
|
+
i[p] = y;
|
|
910
913
|
})]);
|
|
911
914
|
case 2:
|
|
912
915
|
return c = h.sent(), c === void 0 ? [3, 4] : c.done ? (l = c, [
|
|
@@ -940,7 +943,7 @@ function Te(t) {
|
|
|
940
943
|
case 2:
|
|
941
944
|
return s.sent(), [2, l && l.value];
|
|
942
945
|
case 3:
|
|
943
|
-
return
|
|
946
|
+
return o(), [
|
|
944
947
|
7
|
|
945
948
|
/*endfinally*/
|
|
946
949
|
];
|
|
@@ -956,16 +959,16 @@ function Te(t) {
|
|
|
956
959
|
}
|
|
957
960
|
function qe(t) {
|
|
958
961
|
var n = this, e = V(t, { returnValues: !0 });
|
|
959
|
-
return new k(function(r,
|
|
962
|
+
return new k(function(r, o) {
|
|
960
963
|
return G(n, void 0, void 0, function() {
|
|
961
|
-
var
|
|
964
|
+
var i, u, l, a;
|
|
962
965
|
return P(this, function(s) {
|
|
963
966
|
switch (s.label) {
|
|
964
967
|
case 0:
|
|
965
968
|
if (!e.length)
|
|
966
|
-
return
|
|
967
|
-
u = !1,
|
|
968
|
-
|
|
969
|
+
return o(), [2, []];
|
|
970
|
+
u = !1, o.then(function() {
|
|
971
|
+
i(), u = !0;
|
|
969
972
|
}), s.label = 1;
|
|
970
973
|
case 1:
|
|
971
974
|
s.trys.push([1, , 6, 8]), s.label = 2;
|
|
@@ -973,11 +976,11 @@ function qe(t) {
|
|
|
973
976
|
return u ? [3, 5] : (Promise.all(e.map(function(f) {
|
|
974
977
|
return f.next();
|
|
975
978
|
})).then(function(f) {
|
|
976
|
-
return o(f);
|
|
977
|
-
}, function(f) {
|
|
978
979
|
return i(f);
|
|
980
|
+
}, function(f) {
|
|
981
|
+
return o(f);
|
|
979
982
|
}), [4, new Promise(function(f) {
|
|
980
|
-
return
|
|
983
|
+
return i = f;
|
|
981
984
|
})]);
|
|
982
985
|
case 3:
|
|
983
986
|
return l = s.sent(), l === void 0 ? [
|
|
@@ -993,7 +996,7 @@ function qe(t) {
|
|
|
993
996
|
case 5:
|
|
994
997
|
return [3, 8];
|
|
995
998
|
case 6:
|
|
996
|
-
return
|
|
999
|
+
return o(), [4, Promise.all(e.map(function(f) {
|
|
997
1000
|
return f.return && f.return();
|
|
998
1001
|
}))];
|
|
999
1002
|
case 7:
|
|
@@ -1016,17 +1019,17 @@ function De(t) {
|
|
|
1016
1019
|
yieldValues: !0,
|
|
1017
1020
|
returnValues: !0
|
|
1018
1021
|
});
|
|
1019
|
-
return new k(function(r,
|
|
1022
|
+
return new k(function(r, o) {
|
|
1020
1023
|
return G(n, void 0, void 0, function() {
|
|
1021
|
-
var
|
|
1024
|
+
var i, u, l, a, s, f = this;
|
|
1022
1025
|
return P(this, function(p) {
|
|
1023
1026
|
switch (p.label) {
|
|
1024
1027
|
case 0:
|
|
1025
1028
|
if (!e.length)
|
|
1026
|
-
return
|
|
1027
|
-
u = [], l = !1,
|
|
1029
|
+
return o(), [2, []];
|
|
1030
|
+
u = [], l = !1, o.then(function() {
|
|
1028
1031
|
var c, d;
|
|
1029
|
-
|
|
1032
|
+
i();
|
|
1030
1033
|
try {
|
|
1031
1034
|
for (var h = _(u), y = h.next(); !y.done; y = h.next()) {
|
|
1032
1035
|
var m = y.value;
|
|
@@ -1047,11 +1050,11 @@ function De(t) {
|
|
|
1047
1050
|
return p.trys.push([1, , 5, 7]), Promise.all(e.map(function(c) {
|
|
1048
1051
|
return c.next();
|
|
1049
1052
|
})).then(function(c) {
|
|
1050
|
-
return o(c);
|
|
1051
|
-
}, function(c) {
|
|
1052
1053
|
return i(c);
|
|
1054
|
+
}, function(c) {
|
|
1055
|
+
return o(c);
|
|
1053
1056
|
}), [4, new Promise(function(c) {
|
|
1054
|
-
return
|
|
1057
|
+
return i = c;
|
|
1055
1058
|
})];
|
|
1056
1059
|
case 2:
|
|
1057
1060
|
return a = p.sent(), a === void 0 ? [
|
|
@@ -1076,7 +1079,7 @@ function De(t) {
|
|
|
1076
1079
|
return l ? [3, 4] : (Promise.resolve(c.next()).then(function(m) {
|
|
1077
1080
|
return u[d](m);
|
|
1078
1081
|
}, function(m) {
|
|
1079
|
-
return
|
|
1082
|
+
return o(m);
|
|
1080
1083
|
}), [4, new Promise(function(m) {
|
|
1081
1084
|
return u[d] = m;
|
|
1082
1085
|
})]);
|
|
@@ -1096,7 +1099,7 @@ function De(t) {
|
|
|
1096
1099
|
case 4:
|
|
1097
1100
|
return [2, p.sent()];
|
|
1098
1101
|
case 5:
|
|
1099
|
-
return
|
|
1102
|
+
return o(), [4, Promise.all(e.map(function(c) {
|
|
1100
1103
|
return c.return && c.return();
|
|
1101
1104
|
}))];
|
|
1102
1105
|
case 6:
|
|
@@ -1118,19 +1121,19 @@ function Fe(t) {
|
|
|
1118
1121
|
return typeof t == "string" ? t : t.url;
|
|
1119
1122
|
}
|
|
1120
1123
|
function Ie(t, n, e, r) {
|
|
1121
|
-
const
|
|
1122
|
-
if (!(!
|
|
1124
|
+
const o = e[n];
|
|
1125
|
+
if (!(!o || !o.length))
|
|
1123
1126
|
try {
|
|
1124
|
-
r[n] = t(r[n],
|
|
1125
|
-
} catch (
|
|
1126
|
-
throw typeof
|
|
1127
|
+
r[n] = t(r[n], o, !0, !1).newDocument;
|
|
1128
|
+
} catch (i) {
|
|
1129
|
+
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 be(i.message) : new ge(i.name + ": " + i.message) : i;
|
|
1127
1130
|
}
|
|
1128
1131
|
}
|
|
1129
1132
|
function Ae(t, n) {
|
|
1130
1133
|
try {
|
|
1131
1134
|
return t.compile(n);
|
|
1132
1135
|
} catch (e) {
|
|
1133
|
-
throw new
|
|
1136
|
+
throw new we(
|
|
1134
1137
|
e instanceof Error ? e.message : void 0
|
|
1135
1138
|
);
|
|
1136
1139
|
}
|
|
@@ -1143,7 +1146,7 @@ function Me(t, n, e) {
|
|
|
1143
1146
|
function Ne(t, n) {
|
|
1144
1147
|
return t.allowed === void 0 || t.allowed === null || !!(n != null && n.actor) && (t.actor === n.actor || t.allowed.includes(n.actor));
|
|
1145
1148
|
}
|
|
1146
|
-
class Ve extends
|
|
1149
|
+
class Ve extends me {
|
|
1147
1150
|
/**
|
|
1148
1151
|
* Wraps a Graffiti API instance to provide the synchronize methods.
|
|
1149
1152
|
* The GraffitiSyncrhonize class rather than the Graffiti class
|
|
@@ -1165,11 +1168,11 @@ class Ve extends xe {
|
|
|
1165
1168
|
return this.synchronizeDispatch({ object: r }), r;
|
|
1166
1169
|
});
|
|
1167
1170
|
v(this, "put", async (...e) => {
|
|
1168
|
-
const r = await this.graffiti.put(...e),
|
|
1171
|
+
const r = await this.graffiti.put(...e), o = e[0], i = {
|
|
1169
1172
|
...r,
|
|
1170
|
-
value:
|
|
1171
|
-
channels:
|
|
1172
|
-
allowed:
|
|
1173
|
+
value: o.value,
|
|
1174
|
+
channels: o.channels,
|
|
1175
|
+
allowed: o.allowed
|
|
1173
1176
|
};
|
|
1174
1177
|
return await this.synchronizeDispatch(
|
|
1175
1178
|
{
|
|
@@ -1177,22 +1180,22 @@ class Ve extends xe {
|
|
|
1177
1180
|
object: r
|
|
1178
1181
|
},
|
|
1179
1182
|
{
|
|
1180
|
-
object:
|
|
1183
|
+
object: i
|
|
1181
1184
|
},
|
|
1182
1185
|
!0
|
|
1183
1186
|
), r;
|
|
1184
1187
|
});
|
|
1185
1188
|
v(this, "patch", async (...e) => {
|
|
1186
|
-
const r = await this.graffiti.patch(...e),
|
|
1187
|
-
for (const
|
|
1188
|
-
Ie(await this.applyPatch,
|
|
1189
|
+
const r = await this.graffiti.patch(...e), o = { ...r };
|
|
1190
|
+
for (const i of ["value", "channels", "allowed"])
|
|
1191
|
+
Ie(await this.applyPatch, i, e[0], o);
|
|
1189
1192
|
return await this.synchronizeDispatch(
|
|
1190
1193
|
{
|
|
1191
1194
|
tombstone: !0,
|
|
1192
1195
|
object: r
|
|
1193
1196
|
},
|
|
1194
1197
|
{
|
|
1195
|
-
object:
|
|
1198
|
+
object: o
|
|
1196
1199
|
},
|
|
1197
1200
|
!0
|
|
1198
1201
|
), r;
|
|
@@ -1231,17 +1234,17 @@ class Ve extends xe {
|
|
|
1231
1234
|
return e;
|
|
1232
1235
|
})()), this.applyPatch_;
|
|
1233
1236
|
}
|
|
1234
|
-
synchronize(e, r,
|
|
1237
|
+
synchronize(e, r, o, i) {
|
|
1235
1238
|
const u = /* @__PURE__ */ new Set();
|
|
1236
1239
|
return new k(
|
|
1237
1240
|
async (a, s) => {
|
|
1238
|
-
const f = Ae(await this.ajv,
|
|
1241
|
+
const f = Ae(await this.ajv, o), p = (c, d) => {
|
|
1239
1242
|
for (const h of [d, c])
|
|
1240
1243
|
if (h != null && h.tombstone)
|
|
1241
1244
|
u.has(h.object.url) && a(h);
|
|
1242
|
-
else if (h && e(h.object) && (this.options.omniscient || Ne(h.object,
|
|
1245
|
+
else if (h && e(h.object) && (this.options.omniscient || Ne(h.object, i))) {
|
|
1243
1246
|
const y = { ...h.object };
|
|
1244
|
-
if (this.options.omniscient || Me(y, r,
|
|
1247
|
+
if (this.options.omniscient || Me(y, r, i), f(y)) {
|
|
1245
1248
|
a({ object: y }), u.add(y.url);
|
|
1246
1249
|
break;
|
|
1247
1250
|
}
|
|
@@ -1265,11 +1268,11 @@ class Ve extends xe {
|
|
|
1265
1268
|
* @group Synchronize Methods
|
|
1266
1269
|
*/
|
|
1267
1270
|
synchronizeDiscover(...e) {
|
|
1268
|
-
const [r,
|
|
1271
|
+
const [r, o, i] = e;
|
|
1269
1272
|
function u(l) {
|
|
1270
1273
|
return l.channels.some((a) => r.includes(a));
|
|
1271
1274
|
}
|
|
1272
|
-
return this.synchronize(u, r,
|
|
1275
|
+
return this.synchronize(u, r, o, i);
|
|
1273
1276
|
}
|
|
1274
1277
|
/**
|
|
1275
1278
|
* This method has the same signature as {@link get} but
|
|
@@ -1284,11 +1287,11 @@ class Ve extends xe {
|
|
|
1284
1287
|
* @group Synchronize Methods
|
|
1285
1288
|
*/
|
|
1286
1289
|
synchronizeGet(...e) {
|
|
1287
|
-
const [r,
|
|
1290
|
+
const [r, o, i] = e, u = Fe(r);
|
|
1288
1291
|
function l(a) {
|
|
1289
1292
|
return a.url === u;
|
|
1290
1293
|
}
|
|
1291
|
-
return this.synchronize(l, [],
|
|
1294
|
+
return this.synchronize(l, [], o, i);
|
|
1292
1295
|
}
|
|
1293
1296
|
/**
|
|
1294
1297
|
* This method has the same signature as {@link recoverOrphans} but
|
|
@@ -1304,11 +1307,11 @@ class Ve extends xe {
|
|
|
1304
1307
|
* @group Synchronize Methods
|
|
1305
1308
|
*/
|
|
1306
1309
|
synchronizeRecoverOrphans(...e) {
|
|
1307
|
-
const [r,
|
|
1308
|
-
function
|
|
1309
|
-
return u.actor ===
|
|
1310
|
+
const [r, o] = e;
|
|
1311
|
+
function i(u) {
|
|
1312
|
+
return u.actor === o.actor && u.channels.length === 0;
|
|
1310
1313
|
}
|
|
1311
|
-
return this.synchronize(
|
|
1314
|
+
return this.synchronize(i, [], r, o);
|
|
1312
1315
|
}
|
|
1313
1316
|
/**
|
|
1314
1317
|
* Streams changes made to *any* object in *any* channel
|
|
@@ -1323,26 +1326,26 @@ class Ve extends xe {
|
|
|
1323
1326
|
synchronizeAll(e, r) {
|
|
1324
1327
|
return this.synchronize(() => !0, [], e, r);
|
|
1325
1328
|
}
|
|
1326
|
-
async synchronizeDispatch(e, r,
|
|
1327
|
-
for (const
|
|
1328
|
-
|
|
1329
|
-
|
|
1329
|
+
async synchronizeDispatch(e, r, o = !1) {
|
|
1330
|
+
for (const i of this.callbacks)
|
|
1331
|
+
i(e, r);
|
|
1332
|
+
o && await new Promise((i) => setTimeout(i, 0));
|
|
1330
1333
|
}
|
|
1331
1334
|
objectStreamContinue(e) {
|
|
1332
1335
|
const r = this;
|
|
1333
1336
|
return async function* () {
|
|
1334
1337
|
for (; ; ) {
|
|
1335
|
-
const
|
|
1336
|
-
if (
|
|
1337
|
-
const { continue:
|
|
1338
|
+
const o = await e.next();
|
|
1339
|
+
if (o.done) {
|
|
1340
|
+
const { continue: i, cursor: u } = o.value;
|
|
1338
1341
|
return {
|
|
1339
|
-
continue: () => r.objectStreamContinue(
|
|
1342
|
+
continue: () => r.objectStreamContinue(i()),
|
|
1340
1343
|
cursor: u
|
|
1341
1344
|
};
|
|
1342
1345
|
}
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
), yield
|
|
1346
|
+
o.value.error || r.synchronizeDispatch(
|
|
1347
|
+
o.value
|
|
1348
|
+
), yield o.value;
|
|
1346
1349
|
}
|
|
1347
1350
|
}();
|
|
1348
1351
|
}
|
|
@@ -1350,18 +1353,18 @@ class Ve extends xe {
|
|
|
1350
1353
|
const r = this.objectStreamContinue(e);
|
|
1351
1354
|
return async function* () {
|
|
1352
1355
|
for (; ; ) {
|
|
1353
|
-
const
|
|
1354
|
-
if (
|
|
1355
|
-
(
|
|
1356
|
+
const o = await r.next();
|
|
1357
|
+
if (o.done) return o.value;
|
|
1358
|
+
(o.value.error || !o.value.tombstone) && (yield o.value);
|
|
1356
1359
|
}
|
|
1357
1360
|
}();
|
|
1358
1361
|
}
|
|
1359
1362
|
}
|
|
1360
1363
|
const Ue = {
|
|
1361
1364
|
install(t, n) {
|
|
1362
|
-
const e = n.graffiti, r = new Ve(e),
|
|
1363
|
-
r.sessionEvents.addEventListener("initialized", async (
|
|
1364
|
-
const u =
|
|
1365
|
+
const e = n.graffiti, r = new Ve(e), o = M(void 0);
|
|
1366
|
+
r.sessionEvents.addEventListener("initialized", async (i) => {
|
|
1367
|
+
const u = i.detail;
|
|
1365
1368
|
if (u && u.error && console.error(u.error), u && u.href) {
|
|
1366
1369
|
const l = t.config.globalProperties.$router;
|
|
1367
1370
|
if (l) {
|
|
@@ -1369,29 +1372,29 @@ const Ue = {
|
|
|
1369
1372
|
s.pathname.startsWith(a) && (s.pathname = s.pathname.slice(a.length)), await l.replace(s.pathname + s.search + s.hash);
|
|
1370
1373
|
}
|
|
1371
1374
|
}
|
|
1372
|
-
|
|
1373
|
-
}), r.sessionEvents.addEventListener("login", (
|
|
1374
|
-
const u =
|
|
1375
|
+
o.value || (o.value = null);
|
|
1376
|
+
}), r.sessionEvents.addEventListener("login", (i) => {
|
|
1377
|
+
const u = i.detail;
|
|
1375
1378
|
if (u.error) {
|
|
1376
1379
|
console.error("Error logging in:"), console.error(u.error);
|
|
1377
1380
|
return;
|
|
1378
1381
|
} else
|
|
1379
|
-
|
|
1380
|
-
}), r.sessionEvents.addEventListener("logout", (
|
|
1381
|
-
const u =
|
|
1382
|
-
u.error ? (console.error("Error logging out:"), console.error(u.error)) :
|
|
1383
|
-
}), t.provide(Y, r), t.provide(Z,
|
|
1382
|
+
o.value = u.session;
|
|
1383
|
+
}), r.sessionEvents.addEventListener("logout", (i) => {
|
|
1384
|
+
const u = i.detail;
|
|
1385
|
+
u.error ? (console.error("Error logging out:"), console.error(u.error)) : o.value = null;
|
|
1386
|
+
}), t.provide(Y, r), t.provide(Z, o), t.component("GraffitiDiscover", ae), t.component("GraffitiGet", ce), t.component("GraffitiRecoverOrphans", le), t.config.globalProperties.$graffiti = r, t.config.globalProperties.$graffitiSession = o;
|
|
1384
1387
|
}
|
|
1385
|
-
}, Le =
|
|
1388
|
+
}, Le = ae, We = ce, Je = le;
|
|
1386
1389
|
export {
|
|
1387
1390
|
Le as GraffitiDiscover,
|
|
1388
1391
|
We as GraffitiGet,
|
|
1389
1392
|
Ue as GraffitiPlugin,
|
|
1390
1393
|
Je as GraffitiRecoverOrphans,
|
|
1391
1394
|
$e as useGraffiti,
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
+
je as useGraffitiDiscover,
|
|
1396
|
+
Oe as useGraffitiGet,
|
|
1397
|
+
Se as useGraffitiRecoverOrphans,
|
|
1395
1398
|
ee as useGraffitiSession,
|
|
1396
1399
|
N as useGraffitiSynchronize
|
|
1397
1400
|
};
|