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