@graffiti-garden/wrapper-vue 1.0.3 → 1.0.8
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 +1275 -627
- package/dist/browser/plugin.mjs.map +1 -1
- package/dist/node/components/GetMedia.vue.d.ts +2 -2
- package/dist/node/components/GetMedia.vue.d.ts.map +1 -1
- package/dist/node/components/ObjectInfo.vue.d.ts.map +1 -1
- package/dist/node/composables/discover.d.ts.map +1 -1
- package/dist/node/composables/get-media.d.ts +2 -2
- package/dist/node/composables/get-media.d.ts.map +1 -1
- package/dist/node/composables/resolve-string.d.ts.map +1 -1
- package/dist/node/plugin.d.ts +3 -3
- 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 +952 -317
- package/dist/node/plugin.mjs.map +1 -1
- package/package.json +9 -9
- package/src/components/Discover.vue +1 -1
- package/src/components/GetMedia.vue +5 -5
- package/src/components/ObjectInfo.vue +53 -69
- package/src/composables/discover.ts +4 -2
- package/src/composables/get-media.ts +3 -3
- package/src/composables/resolve-string.ts +2 -3
package/dist/browser/plugin.mjs
CHANGED
|
@@ -1,163 +1,823 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
1
|
+
import { ref as S, onScopeDispose as _e, watch as H, toValue as j, defineComponent as R, toRef as k, renderSlot as X, unref as v, createElementVNode as m, toDisplayString as E, createElementBlock as b, openBlock as g, createCommentVNode as Ee, createTextVNode as Se, createVNode as F, Fragment as ve, renderList as ye } from "vue";
|
|
2
|
+
class T extends Error {
|
|
3
3
|
constructor(n) {
|
|
4
|
-
super(n), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this,
|
|
4
|
+
super(n), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this, T.prototype);
|
|
5
5
|
}
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
|
+
class ze extends Error {
|
|
7
8
|
constructor(n) {
|
|
8
|
-
super(n), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this,
|
|
9
|
+
super(n), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this, ze.prototype);
|
|
9
10
|
}
|
|
10
|
-
}
|
|
11
|
-
|
|
11
|
+
}
|
|
12
|
+
class Pe extends Error {
|
|
13
|
+
constructor(n) {
|
|
14
|
+
super(n), this.name = "GraffitiErrorCursorExpired", Object.setPrototypeOf(this, Pe.prototype);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function he(e) {
|
|
12
18
|
return typeof e == "string" ? e : e.url;
|
|
13
19
|
}
|
|
14
|
-
function
|
|
20
|
+
function Je(e, n) {
|
|
21
|
+
return (
|
|
22
|
+
// If there is no allowed list, the actor is allowed.
|
|
23
|
+
!Array.isArray(e.allowed) || // Otherwise...
|
|
24
|
+
typeof n?.actor == "string" && // The actor must be the creator of the object
|
|
25
|
+
(e.actor === n.actor || // Or be on the allowed list
|
|
26
|
+
e.allowed.includes(n.actor))
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function Ke(e, n, t) {
|
|
30
|
+
if (t === e.actor) return e;
|
|
31
|
+
const r = e.allowed && t ? [t] : void 0, i = e.channels.filter((o) => n.includes(o));
|
|
32
|
+
return {
|
|
33
|
+
...e,
|
|
34
|
+
allowed: r,
|
|
35
|
+
channels: i
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
let pe;
|
|
39
|
+
async function Qe(e) {
|
|
40
|
+
if (!pe) {
|
|
41
|
+
const { default: n } = await import("./ajv-D_HICdxS.mjs").then((t) => t.a);
|
|
42
|
+
pe = new n({ strict: !1 });
|
|
43
|
+
}
|
|
15
44
|
try {
|
|
16
|
-
return
|
|
17
|
-
} catch (
|
|
18
|
-
throw new
|
|
45
|
+
return pe.compile(e);
|
|
46
|
+
} catch (n) {
|
|
47
|
+
throw new ze(
|
|
48
|
+
n instanceof Error ? n.message : String(n)
|
|
49
|
+
);
|
|
19
50
|
}
|
|
20
51
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
52
|
+
function w(e, n, t) {
|
|
53
|
+
function r(u, c) {
|
|
54
|
+
if (u._zod || Object.defineProperty(u, "_zod", {
|
|
55
|
+
value: {
|
|
56
|
+
def: c,
|
|
57
|
+
constr: s,
|
|
58
|
+
traits: /* @__PURE__ */ new Set()
|
|
59
|
+
},
|
|
60
|
+
enumerable: !1
|
|
61
|
+
}), u._zod.traits.has(e))
|
|
62
|
+
return;
|
|
63
|
+
u._zod.traits.add(e), n(u, c);
|
|
64
|
+
const a = s.prototype, f = Object.keys(a);
|
|
65
|
+
for (let d = 0; d < f.length; d++) {
|
|
66
|
+
const l = f[d];
|
|
67
|
+
l in u || (u[l] = a[l].bind(u));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const i = t?.Parent ?? Object;
|
|
71
|
+
class o extends i {
|
|
72
|
+
}
|
|
73
|
+
Object.defineProperty(o, "name", { value: e });
|
|
74
|
+
function s(u) {
|
|
75
|
+
var c;
|
|
76
|
+
const a = t?.Parent ? new o() : this;
|
|
77
|
+
r(a, u), (c = a._zod).deferred ?? (c.deferred = []);
|
|
78
|
+
for (const f of a._zod.deferred)
|
|
79
|
+
f();
|
|
80
|
+
return a;
|
|
81
|
+
}
|
|
82
|
+
return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
|
|
83
|
+
value: (u) => t?.Parent && u instanceof t.Parent ? !0 : u?._zod?.traits?.has(e)
|
|
84
|
+
}), Object.defineProperty(s, "name", { value: e }), s;
|
|
85
|
+
}
|
|
86
|
+
class L extends Error {
|
|
87
|
+
constructor() {
|
|
88
|
+
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const Ye = {};
|
|
92
|
+
function se(e) {
|
|
93
|
+
return Ye;
|
|
94
|
+
}
|
|
95
|
+
function et(e, n) {
|
|
96
|
+
return typeof n == "bigint" ? n.toString() : n;
|
|
97
|
+
}
|
|
98
|
+
function tt(e) {
|
|
99
|
+
return {
|
|
100
|
+
get value() {
|
|
101
|
+
{
|
|
102
|
+
const n = e();
|
|
103
|
+
return Object.defineProperty(this, "value", { value: n }), n;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function nt(e) {
|
|
109
|
+
const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
|
|
110
|
+
return e.slice(n, t);
|
|
111
|
+
}
|
|
112
|
+
const xe = /* @__PURE__ */ Symbol("evaluating");
|
|
113
|
+
function W(e, n, t) {
|
|
114
|
+
let r;
|
|
115
|
+
Object.defineProperty(e, n, {
|
|
116
|
+
get() {
|
|
117
|
+
if (r !== xe)
|
|
118
|
+
return r === void 0 && (r = xe, r = t()), r;
|
|
119
|
+
},
|
|
120
|
+
set(i) {
|
|
121
|
+
Object.defineProperty(e, n, {
|
|
122
|
+
value: i
|
|
123
|
+
// configurable: true,
|
|
124
|
+
});
|
|
125
|
+
},
|
|
126
|
+
configurable: !0
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
const Ze = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
130
|
+
};
|
|
131
|
+
function rt(e) {
|
|
132
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
133
|
+
}
|
|
134
|
+
function ot(e, n, t) {
|
|
135
|
+
const r = new e._zod.constr(n ?? e._zod.def);
|
|
136
|
+
return (!n || t?.parent) && (r._zod.parent = e), r;
|
|
137
|
+
}
|
|
138
|
+
function J(e) {
|
|
139
|
+
return {};
|
|
140
|
+
}
|
|
141
|
+
function it(e) {
|
|
142
|
+
return Object.keys(e).filter((n) => e[n]._zod.optin === "optional" && e[n]._zod.optout === "optional");
|
|
143
|
+
}
|
|
144
|
+
const st = {
|
|
145
|
+
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
146
|
+
int32: [-2147483648, 2147483647],
|
|
147
|
+
uint32: [0, 4294967295],
|
|
148
|
+
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
149
|
+
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
150
|
+
};
|
|
151
|
+
function Y(e, n = 0) {
|
|
152
|
+
if (e.aborted === !0)
|
|
153
|
+
return !0;
|
|
154
|
+
for (let t = n; t < e.issues.length; t++)
|
|
155
|
+
if (e.issues[t]?.continue !== !0)
|
|
156
|
+
return !0;
|
|
157
|
+
return !1;
|
|
158
|
+
}
|
|
159
|
+
function Ie(e, n) {
|
|
160
|
+
return n.map((t) => {
|
|
161
|
+
var r;
|
|
162
|
+
return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
function ee(e) {
|
|
166
|
+
return typeof e == "string" ? e : e?.message;
|
|
167
|
+
}
|
|
168
|
+
function ue(e, n, t) {
|
|
169
|
+
const r = { ...e, path: e.path ?? [] };
|
|
170
|
+
if (!e.message) {
|
|
171
|
+
const i = ee(e.inst?._zod.def?.error?.(e)) ?? ee(n?.error?.(e)) ?? ee(t.customError?.(e)) ?? ee(t.localeError?.(e)) ?? "Invalid input";
|
|
172
|
+
r.message = i;
|
|
173
|
+
}
|
|
174
|
+
return delete r.inst, delete r.continue, n?.reportInput || delete r.input, r;
|
|
175
|
+
}
|
|
176
|
+
const Re = (e, n) => {
|
|
177
|
+
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
178
|
+
value: e._zod,
|
|
179
|
+
enumerable: !1
|
|
180
|
+
}), Object.defineProperty(e, "issues", {
|
|
181
|
+
value: n,
|
|
182
|
+
enumerable: !1
|
|
183
|
+
}), e.message = JSON.stringify(n, et, 2), Object.defineProperty(e, "toString", {
|
|
184
|
+
value: () => e.message,
|
|
185
|
+
enumerable: !1
|
|
186
|
+
});
|
|
187
|
+
}, ut = w("$ZodError", Re), ae = w("$ZodError", Re, { Parent: Error }), at = (e) => (n, t, r, i) => {
|
|
188
|
+
const o = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, o);
|
|
189
|
+
if (s instanceof Promise)
|
|
190
|
+
throw new L();
|
|
191
|
+
if (s.issues.length) {
|
|
192
|
+
const u = new (i?.Err ?? e)(s.issues.map((c) => ue(c, o, se())));
|
|
193
|
+
throw Ze(u, i?.callee), u;
|
|
194
|
+
}
|
|
195
|
+
return s.value;
|
|
196
|
+
}, ct = /* @__PURE__ */ at(ae), lt = (e) => async (n, t, r, i) => {
|
|
197
|
+
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
198
|
+
let s = n._zod.run({ value: t, issues: [] }, o);
|
|
199
|
+
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
200
|
+
const u = new (i?.Err ?? e)(s.issues.map((c) => ue(c, o, se())));
|
|
201
|
+
throw Ze(u, i?.callee), u;
|
|
202
|
+
}
|
|
203
|
+
return s.value;
|
|
204
|
+
}, ft = /* @__PURE__ */ lt(ae), dt = (e) => (n, t, r) => {
|
|
205
|
+
const i = r ? { ...r, async: !1 } : { async: !1 }, o = n._zod.run({ value: t, issues: [] }, i);
|
|
206
|
+
if (o instanceof Promise)
|
|
207
|
+
throw new L();
|
|
208
|
+
return o.issues.length ? {
|
|
209
|
+
success: !1,
|
|
210
|
+
error: new (e ?? ut)(o.issues.map((s) => ue(s, i, se())))
|
|
211
|
+
} : { success: !0, data: o.value };
|
|
212
|
+
}, Ce = /* @__PURE__ */ dt(ae), ht = (e) => async (n, t, r) => {
|
|
213
|
+
const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
214
|
+
let o = n._zod.run({ value: t, issues: [] }, i);
|
|
215
|
+
return o instanceof Promise && (o = await o), o.issues.length ? {
|
|
216
|
+
success: !1,
|
|
217
|
+
error: new e(o.issues.map((s) => ue(s, i, se())))
|
|
218
|
+
} : { success: !0, data: o.value };
|
|
219
|
+
}, De = /* @__PURE__ */ ht(ae), pt = (e) => {
|
|
220
|
+
const n = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
221
|
+
return new RegExp(`^${n}$`);
|
|
222
|
+
}, mt = /^-?\d+$/, vt = /^-?\d+(?:\.\d+)?$/, Ue = /* @__PURE__ */ w("$ZodCheck", (e, n) => {
|
|
223
|
+
var t;
|
|
224
|
+
e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
|
|
225
|
+
}), yt = {
|
|
226
|
+
number: "number",
|
|
227
|
+
bigint: "bigint",
|
|
228
|
+
object: "date"
|
|
229
|
+
}, bt = /* @__PURE__ */ w("$ZodCheckGreaterThan", (e, n) => {
|
|
230
|
+
Ue.init(e, n);
|
|
231
|
+
const t = yt[typeof n.value];
|
|
232
|
+
e._zod.onattach.push((r) => {
|
|
233
|
+
const i = r._zod.bag, o = (n.inclusive ? i.minimum : i.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
234
|
+
n.value > o && (n.inclusive ? i.minimum = n.value : i.exclusiveMinimum = n.value);
|
|
235
|
+
}), e._zod.check = (r) => {
|
|
236
|
+
(n.inclusive ? r.value >= n.value : r.value > n.value) || r.issues.push({
|
|
237
|
+
origin: t,
|
|
238
|
+
code: "too_small",
|
|
239
|
+
minimum: typeof n.value == "object" ? n.value.getTime() : n.value,
|
|
240
|
+
input: r.value,
|
|
241
|
+
inclusive: n.inclusive,
|
|
242
|
+
inst: e,
|
|
243
|
+
continue: !n.abort
|
|
244
|
+
});
|
|
245
|
+
};
|
|
246
|
+
}), gt = /* @__PURE__ */ w("$ZodCheckNumberFormat", (e, n) => {
|
|
247
|
+
Ue.init(e, n), n.format = n.format || "float64";
|
|
248
|
+
const t = n.format?.includes("int"), r = t ? "int" : "number", [i, o] = st[n.format];
|
|
249
|
+
e._zod.onattach.push((s) => {
|
|
250
|
+
const u = s._zod.bag;
|
|
251
|
+
u.format = n.format, u.minimum = i, u.maximum = o, t && (u.pattern = mt);
|
|
252
|
+
}), e._zod.check = (s) => {
|
|
253
|
+
const u = s.value;
|
|
254
|
+
if (t) {
|
|
255
|
+
if (!Number.isInteger(u)) {
|
|
256
|
+
s.issues.push({
|
|
257
|
+
expected: r,
|
|
258
|
+
format: n.format,
|
|
259
|
+
code: "invalid_type",
|
|
260
|
+
continue: !1,
|
|
261
|
+
input: u,
|
|
262
|
+
inst: e
|
|
263
|
+
});
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (!Number.isSafeInteger(u)) {
|
|
267
|
+
u > 0 ? s.issues.push({
|
|
268
|
+
input: u,
|
|
269
|
+
code: "too_big",
|
|
270
|
+
maximum: Number.MAX_SAFE_INTEGER,
|
|
271
|
+
note: "Integers must be within the safe integer range.",
|
|
272
|
+
inst: e,
|
|
273
|
+
origin: r,
|
|
274
|
+
inclusive: !0,
|
|
275
|
+
continue: !n.abort
|
|
276
|
+
}) : s.issues.push({
|
|
277
|
+
input: u,
|
|
278
|
+
code: "too_small",
|
|
279
|
+
minimum: Number.MIN_SAFE_INTEGER,
|
|
280
|
+
note: "Integers must be within the safe integer range.",
|
|
281
|
+
inst: e,
|
|
282
|
+
origin: r,
|
|
283
|
+
inclusive: !0,
|
|
284
|
+
continue: !n.abort
|
|
285
|
+
});
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
u < i && s.issues.push({
|
|
290
|
+
origin: "number",
|
|
291
|
+
input: u,
|
|
292
|
+
code: "too_small",
|
|
293
|
+
minimum: i,
|
|
294
|
+
inclusive: !0,
|
|
295
|
+
inst: e,
|
|
296
|
+
continue: !n.abort
|
|
297
|
+
}), u > o && s.issues.push({
|
|
298
|
+
origin: "number",
|
|
299
|
+
input: u,
|
|
300
|
+
code: "too_big",
|
|
301
|
+
maximum: o,
|
|
302
|
+
inclusive: !0,
|
|
303
|
+
inst: e,
|
|
304
|
+
continue: !n.abort
|
|
305
|
+
});
|
|
306
|
+
};
|
|
307
|
+
}), wt = {
|
|
308
|
+
major: 4,
|
|
309
|
+
minor: 3,
|
|
310
|
+
patch: 5
|
|
311
|
+
}, M = /* @__PURE__ */ w("$ZodType", (e, n) => {
|
|
312
|
+
var t;
|
|
313
|
+
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = wt;
|
|
314
|
+
const r = [...e._zod.def.checks ?? []];
|
|
315
|
+
e._zod.traits.has("$ZodCheck") && r.unshift(e);
|
|
316
|
+
for (const i of r)
|
|
317
|
+
for (const o of i._zod.onattach)
|
|
318
|
+
o(e);
|
|
319
|
+
if (r.length === 0)
|
|
320
|
+
(t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred?.push(() => {
|
|
321
|
+
e._zod.run = e._zod.parse;
|
|
322
|
+
});
|
|
323
|
+
else {
|
|
324
|
+
const i = (s, u, c) => {
|
|
325
|
+
let a = Y(s), f;
|
|
326
|
+
for (const d of u) {
|
|
327
|
+
if (d._zod.def.when) {
|
|
328
|
+
if (!d._zod.def.when(s))
|
|
329
|
+
continue;
|
|
330
|
+
} else if (a)
|
|
331
|
+
continue;
|
|
332
|
+
const l = s.issues.length, p = d._zod.check(s);
|
|
333
|
+
if (p instanceof Promise && c?.async === !1)
|
|
334
|
+
throw new L();
|
|
335
|
+
if (f || p instanceof Promise)
|
|
336
|
+
f = (f ?? Promise.resolve()).then(async () => {
|
|
337
|
+
await p, s.issues.length !== l && (a || (a = Y(s, l)));
|
|
338
|
+
});
|
|
339
|
+
else {
|
|
340
|
+
if (s.issues.length === l)
|
|
341
|
+
continue;
|
|
342
|
+
a || (a = Y(s, l));
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
return f ? f.then(() => s) : s;
|
|
346
|
+
}, o = (s, u, c) => {
|
|
347
|
+
if (Y(s))
|
|
348
|
+
return s.aborted = !0, s;
|
|
349
|
+
const a = i(u, r, c);
|
|
350
|
+
if (a instanceof Promise) {
|
|
351
|
+
if (c.async === !1)
|
|
352
|
+
throw new L();
|
|
353
|
+
return a.then((f) => e._zod.parse(f, c));
|
|
354
|
+
}
|
|
355
|
+
return e._zod.parse(a, c);
|
|
356
|
+
};
|
|
357
|
+
e._zod.run = (s, u) => {
|
|
358
|
+
if (u.skipChecks)
|
|
359
|
+
return e._zod.parse(s, u);
|
|
360
|
+
if (u.direction === "backward") {
|
|
361
|
+
const a = e._zod.parse({ value: s.value, issues: [] }, { ...u, skipChecks: !0 });
|
|
362
|
+
return a instanceof Promise ? a.then((f) => o(f, s, u)) : o(a, s, u);
|
|
363
|
+
}
|
|
364
|
+
const c = e._zod.parse(s, u);
|
|
365
|
+
if (c instanceof Promise) {
|
|
366
|
+
if (u.async === !1)
|
|
367
|
+
throw new L();
|
|
368
|
+
return c.then((a) => i(a, r, u));
|
|
369
|
+
}
|
|
370
|
+
return i(c, r, u);
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
W(e, "~standard", () => ({
|
|
374
|
+
validate: (i) => {
|
|
375
|
+
try {
|
|
376
|
+
const o = Ce(e, i);
|
|
377
|
+
return o.success ? { value: o.data } : { issues: o.error?.issues };
|
|
378
|
+
} catch {
|
|
379
|
+
return De(e, i).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
vendor: "zod",
|
|
383
|
+
version: 1
|
|
384
|
+
}));
|
|
385
|
+
}), _t = /* @__PURE__ */ w("$ZodString", (e, n) => {
|
|
386
|
+
M.init(e, n), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? pt(e._zod.bag), e._zod.parse = (t, r) => {
|
|
387
|
+
if (n.coerce)
|
|
388
|
+
try {
|
|
389
|
+
t.value = String(t.value);
|
|
390
|
+
} catch {
|
|
391
|
+
}
|
|
392
|
+
return typeof t.value == "string" || t.issues.push({
|
|
393
|
+
expected: "string",
|
|
394
|
+
code: "invalid_type",
|
|
395
|
+
input: t.value,
|
|
396
|
+
inst: e
|
|
397
|
+
}), t;
|
|
398
|
+
};
|
|
399
|
+
}), Fe = /* @__PURE__ */ w("$ZodNumber", (e, n) => {
|
|
400
|
+
M.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? vt, e._zod.parse = (t, r) => {
|
|
401
|
+
if (n.coerce)
|
|
402
|
+
try {
|
|
403
|
+
t.value = Number(t.value);
|
|
404
|
+
} catch {
|
|
405
|
+
}
|
|
406
|
+
const i = t.value;
|
|
407
|
+
if (typeof i == "number" && !Number.isNaN(i) && Number.isFinite(i))
|
|
408
|
+
return t;
|
|
409
|
+
const o = typeof i == "number" ? Number.isNaN(i) ? "NaN" : Number.isFinite(i) ? void 0 : "Infinity" : void 0;
|
|
410
|
+
return t.issues.push({
|
|
411
|
+
expected: "number",
|
|
412
|
+
code: "invalid_type",
|
|
413
|
+
input: i,
|
|
414
|
+
inst: e,
|
|
415
|
+
...o ? { received: o } : {}
|
|
416
|
+
}), t;
|
|
417
|
+
};
|
|
418
|
+
}), zt = /* @__PURE__ */ w("$ZodNumberFormat", (e, n) => {
|
|
419
|
+
gt.init(e, n), Fe.init(e, n);
|
|
420
|
+
}), Pt = /* @__PURE__ */ w("$ZodUnknown", (e, n) => {
|
|
421
|
+
M.init(e, n), e._zod.parse = (t) => t;
|
|
422
|
+
});
|
|
423
|
+
function $e(e, n, t) {
|
|
424
|
+
e.issues.length && n.issues.push(...Ie(t, e.issues)), n.value[t] = e.value;
|
|
23
425
|
}
|
|
24
|
-
|
|
25
|
-
|
|
426
|
+
const jt = /* @__PURE__ */ w("$ZodArray", (e, n) => {
|
|
427
|
+
M.init(e, n), e._zod.parse = (t, r) => {
|
|
428
|
+
const i = t.value;
|
|
429
|
+
if (!Array.isArray(i))
|
|
430
|
+
return t.issues.push({
|
|
431
|
+
expected: "array",
|
|
432
|
+
code: "invalid_type",
|
|
433
|
+
input: i,
|
|
434
|
+
inst: e
|
|
435
|
+
}), t;
|
|
436
|
+
t.value = Array(i.length);
|
|
437
|
+
const o = [];
|
|
438
|
+
for (let s = 0; s < i.length; s++) {
|
|
439
|
+
const u = i[s], c = n.element._zod.run({
|
|
440
|
+
value: u,
|
|
441
|
+
issues: []
|
|
442
|
+
}, r);
|
|
443
|
+
c instanceof Promise ? o.push(c.then((a) => $e(a, t, s))) : $e(c, t, s);
|
|
444
|
+
}
|
|
445
|
+
return o.length ? Promise.all(o).then(() => t) : t;
|
|
446
|
+
};
|
|
447
|
+
});
|
|
448
|
+
function ne(e, n, t, r, i) {
|
|
449
|
+
if (e.issues.length) {
|
|
450
|
+
if (i && !(t in r))
|
|
451
|
+
return;
|
|
452
|
+
n.issues.push(...Ie(t, e.issues));
|
|
453
|
+
}
|
|
454
|
+
e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
|
|
455
|
+
}
|
|
456
|
+
function kt(e) {
|
|
457
|
+
const n = Object.keys(e.shape);
|
|
458
|
+
for (const r of n)
|
|
459
|
+
if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
|
|
460
|
+
throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
|
|
461
|
+
const t = it(e.shape);
|
|
462
|
+
return {
|
|
463
|
+
...e,
|
|
464
|
+
keys: n,
|
|
465
|
+
keySet: new Set(n),
|
|
466
|
+
numKeys: n.length,
|
|
467
|
+
optionalKeys: new Set(t)
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
function Ot(e, n, t, r, i, o) {
|
|
471
|
+
const s = [], u = i.keySet, c = i.catchall._zod, a = c.def.type, f = c.optout === "optional";
|
|
472
|
+
for (const d in n) {
|
|
473
|
+
if (u.has(d))
|
|
474
|
+
continue;
|
|
475
|
+
if (a === "never") {
|
|
476
|
+
s.push(d);
|
|
477
|
+
continue;
|
|
478
|
+
}
|
|
479
|
+
const l = c.run({ value: n[d], issues: [] }, r);
|
|
480
|
+
l instanceof Promise ? e.push(l.then((p) => ne(p, t, d, n, f))) : ne(l, t, d, n, f);
|
|
481
|
+
}
|
|
482
|
+
return s.length && t.issues.push({
|
|
483
|
+
code: "unrecognized_keys",
|
|
484
|
+
keys: s,
|
|
485
|
+
input: n,
|
|
486
|
+
inst: o
|
|
487
|
+
}), e.length ? Promise.all(e).then(() => t) : t;
|
|
488
|
+
}
|
|
489
|
+
const Et = /* @__PURE__ */ w("$ZodObject", (e, n) => {
|
|
490
|
+
if (M.init(e, n), !Object.getOwnPropertyDescriptor(n, "shape")?.get) {
|
|
491
|
+
const u = n.shape;
|
|
492
|
+
Object.defineProperty(n, "shape", {
|
|
493
|
+
get: () => {
|
|
494
|
+
const c = { ...u };
|
|
495
|
+
return Object.defineProperty(n, "shape", {
|
|
496
|
+
value: c
|
|
497
|
+
}), c;
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
const r = tt(() => kt(n));
|
|
502
|
+
W(e._zod, "propValues", () => {
|
|
503
|
+
const u = n.shape, c = {};
|
|
504
|
+
for (const a in u) {
|
|
505
|
+
const f = u[a]._zod;
|
|
506
|
+
if (f.values) {
|
|
507
|
+
c[a] ?? (c[a] = /* @__PURE__ */ new Set());
|
|
508
|
+
for (const d of f.values)
|
|
509
|
+
c[a].add(d);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
return c;
|
|
513
|
+
});
|
|
514
|
+
const i = rt, o = n.catchall;
|
|
515
|
+
let s;
|
|
516
|
+
e._zod.parse = (u, c) => {
|
|
517
|
+
s ?? (s = r.value);
|
|
518
|
+
const a = u.value;
|
|
519
|
+
if (!i(a))
|
|
520
|
+
return u.issues.push({
|
|
521
|
+
expected: "object",
|
|
522
|
+
code: "invalid_type",
|
|
523
|
+
input: a,
|
|
524
|
+
inst: e
|
|
525
|
+
}), u;
|
|
526
|
+
u.value = {};
|
|
527
|
+
const f = [], d = s.shape;
|
|
528
|
+
for (const l of s.keys) {
|
|
529
|
+
const p = d[l], h = p._zod.optout === "optional", y = p._zod.run({ value: a[l], issues: [] }, c);
|
|
530
|
+
y instanceof Promise ? f.push(y.then((_) => ne(_, u, l, a, h))) : ne(y, u, l, a, h);
|
|
531
|
+
}
|
|
532
|
+
return o ? Ot(f, a, u, c, r.value, e) : f.length ? Promise.all(f).then(() => u) : u;
|
|
533
|
+
};
|
|
534
|
+
});
|
|
535
|
+
function Ae(e, n) {
|
|
536
|
+
return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
|
|
537
|
+
}
|
|
538
|
+
const St = /* @__PURE__ */ w("$ZodOptional", (e, n) => {
|
|
539
|
+
M.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", W(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), W(e._zod, "pattern", () => {
|
|
540
|
+
const t = n.innerType._zod.pattern;
|
|
541
|
+
return t ? new RegExp(`^(${nt(t.source)})?$`) : void 0;
|
|
542
|
+
}), e._zod.parse = (t, r) => {
|
|
543
|
+
if (n.innerType._zod.optin === "optional") {
|
|
544
|
+
const i = n.innerType._zod.run(t, r);
|
|
545
|
+
return i instanceof Promise ? i.then((o) => Ae(o, t.value)) : Ae(i, t.value);
|
|
546
|
+
}
|
|
547
|
+
return t.value === void 0 ? t : n.innerType._zod.run(t, r);
|
|
548
|
+
};
|
|
549
|
+
});
|
|
550
|
+
var Te;
|
|
551
|
+
class xt {
|
|
552
|
+
constructor() {
|
|
553
|
+
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
554
|
+
}
|
|
555
|
+
add(n, ...t) {
|
|
556
|
+
const r = t[0];
|
|
557
|
+
return this._map.set(n, r), r && typeof r == "object" && "id" in r && this._idmap.set(r.id, n), this;
|
|
558
|
+
}
|
|
559
|
+
clear() {
|
|
560
|
+
return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
|
|
561
|
+
}
|
|
562
|
+
remove(n) {
|
|
563
|
+
const t = this._map.get(n);
|
|
564
|
+
return t && typeof t == "object" && "id" in t && this._idmap.delete(t.id), this._map.delete(n), this;
|
|
565
|
+
}
|
|
566
|
+
get(n) {
|
|
567
|
+
const t = n._zod.parent;
|
|
568
|
+
if (t) {
|
|
569
|
+
const r = { ...this.get(t) ?? {} };
|
|
570
|
+
delete r.id;
|
|
571
|
+
const i = { ...r, ...this._map.get(n) };
|
|
572
|
+
return Object.keys(i).length ? i : void 0;
|
|
573
|
+
}
|
|
574
|
+
return this._map.get(n);
|
|
575
|
+
}
|
|
576
|
+
has(n) {
|
|
577
|
+
return this._map.has(n);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
function $t() {
|
|
581
|
+
return new xt();
|
|
582
|
+
}
|
|
583
|
+
(Te = globalThis).__zod_globalRegistry ?? (Te.__zod_globalRegistry = $t());
|
|
584
|
+
// @__NO_SIDE_EFFECTS__
|
|
585
|
+
function At(e, n) {
|
|
586
|
+
return new e({
|
|
587
|
+
type: "string",
|
|
588
|
+
...J()
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
// @__NO_SIDE_EFFECTS__
|
|
592
|
+
function Tt(e, n) {
|
|
593
|
+
return new e({
|
|
594
|
+
type: "number",
|
|
595
|
+
check: "number_format",
|
|
596
|
+
abort: !1,
|
|
597
|
+
format: "safeint",
|
|
598
|
+
...J()
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
// @__NO_SIDE_EFFECTS__
|
|
602
|
+
function Gt(e) {
|
|
603
|
+
return new e({
|
|
604
|
+
type: "unknown"
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
// @__NO_SIDE_EFFECTS__
|
|
608
|
+
function Mt(e, n) {
|
|
609
|
+
return new bt({
|
|
610
|
+
check: "greater_than",
|
|
611
|
+
...J(),
|
|
612
|
+
value: e,
|
|
613
|
+
inclusive: !0
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
// @__NO_SIDE_EFFECTS__
|
|
617
|
+
function Nt(e) {
|
|
618
|
+
return /* @__PURE__ */ Mt(0);
|
|
619
|
+
}
|
|
620
|
+
const C = /* @__PURE__ */ w("ZodMiniType", (e, n) => {
|
|
621
|
+
if (!e._zod)
|
|
622
|
+
throw new Error("Uninitialized schema in ZodMiniType.");
|
|
623
|
+
M.init(e, n), e.def = n, e.type = n.type, e.parse = (t, r) => ct(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => Ce(e, t, r), e.parseAsync = async (t, r) => ft(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => De(e, t, r), e.check = (...t) => e.clone({
|
|
624
|
+
...n,
|
|
625
|
+
checks: [
|
|
626
|
+
...n.checks ?? [],
|
|
627
|
+
...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
628
|
+
]
|
|
629
|
+
}, { parent: !0 }), e.with = e.check, e.clone = (t, r) => ot(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.apply = (t) => t(e);
|
|
630
|
+
}), Zt = /* @__PURE__ */ w("ZodMiniString", (e, n) => {
|
|
631
|
+
_t.init(e, n), C.init(e, n);
|
|
632
|
+
});
|
|
633
|
+
// @__NO_SIDE_EFFECTS__
|
|
634
|
+
function It(e) {
|
|
635
|
+
return /* @__PURE__ */ At(Zt);
|
|
26
636
|
}
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
637
|
+
const Rt = /* @__PURE__ */ w("ZodMiniNumber", (e, n) => {
|
|
638
|
+
Fe.init(e, n), C.init(e, n);
|
|
639
|
+
}), Ct = /* @__PURE__ */ w("ZodMiniNumberFormat", (e, n) => {
|
|
640
|
+
zt.init(e, n), Rt.init(e, n);
|
|
641
|
+
});
|
|
642
|
+
// @__NO_SIDE_EFFECTS__
|
|
643
|
+
function Dt(e) {
|
|
644
|
+
return /* @__PURE__ */ Tt(Ct);
|
|
645
|
+
}
|
|
646
|
+
const Ut = /* @__PURE__ */ w("ZodMiniUnknown", (e, n) => {
|
|
647
|
+
Pt.init(e, n), C.init(e, n);
|
|
648
|
+
});
|
|
649
|
+
// @__NO_SIDE_EFFECTS__
|
|
650
|
+
function Ft() {
|
|
651
|
+
return /* @__PURE__ */ Gt(Ut);
|
|
652
|
+
}
|
|
653
|
+
const Lt = /* @__PURE__ */ w("ZodMiniArray", (e, n) => {
|
|
654
|
+
jt.init(e, n), C.init(e, n);
|
|
655
|
+
});
|
|
656
|
+
// @__NO_SIDE_EFFECTS__
|
|
657
|
+
function Vt(e, n) {
|
|
658
|
+
return new Lt({
|
|
659
|
+
type: "array",
|
|
660
|
+
element: e,
|
|
661
|
+
...J()
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
const qt = /* @__PURE__ */ w("ZodMiniObject", (e, n) => {
|
|
665
|
+
Et.init(e, n), C.init(e, n), W(e, "shape", () => n.shape);
|
|
666
|
+
});
|
|
667
|
+
// @__NO_SIDE_EFFECTS__
|
|
668
|
+
function Ht(e, n) {
|
|
669
|
+
return new qt({
|
|
670
|
+
type: "object",
|
|
671
|
+
shape: e,
|
|
672
|
+
catchall: /* @__PURE__ */ Ft(),
|
|
673
|
+
...J()
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
const Wt = /* @__PURE__ */ w("ZodMiniOptional", (e, n) => {
|
|
677
|
+
St.init(e, n), C.init(e, n);
|
|
678
|
+
});
|
|
679
|
+
// @__NO_SIDE_EFFECTS__
|
|
680
|
+
function Ge(e) {
|
|
681
|
+
return new Wt({
|
|
682
|
+
type: "optional",
|
|
683
|
+
innerType: e
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
(/* @__PURE__ */ Dt()).check(/* @__PURE__ */ Nt());
|
|
687
|
+
const Z = {};
|
|
688
|
+
function Bt(e) {
|
|
689
|
+
if (!Z.graffitiSession)
|
|
690
|
+
Z.graffitiSession = e;
|
|
31
691
|
else
|
|
32
692
|
throw new Error(
|
|
33
693
|
"Graffiti session already set - plugin installed multiple times?"
|
|
34
694
|
);
|
|
35
695
|
}
|
|
36
|
-
function
|
|
37
|
-
if (!
|
|
38
|
-
|
|
696
|
+
function Xt(e) {
|
|
697
|
+
if (!Z.graffitiSynchronize)
|
|
698
|
+
Z.graffitiSynchronize = e;
|
|
39
699
|
else
|
|
40
700
|
throw new Error(
|
|
41
701
|
"Graffiti synchronize already set - plugin installed multiple times?"
|
|
42
702
|
);
|
|
43
703
|
}
|
|
44
|
-
function
|
|
45
|
-
const e =
|
|
704
|
+
function ce() {
|
|
705
|
+
const e = Z.graffitiSynchronize;
|
|
46
706
|
if (!e)
|
|
47
707
|
throw new Error(
|
|
48
708
|
"No Graffiti instance provided, did you forget to install the plugin?"
|
|
49
709
|
);
|
|
50
710
|
return e;
|
|
51
711
|
}
|
|
52
|
-
function
|
|
53
|
-
return
|
|
712
|
+
function je() {
|
|
713
|
+
return ce();
|
|
54
714
|
}
|
|
55
|
-
function
|
|
56
|
-
const e =
|
|
715
|
+
function $n() {
|
|
716
|
+
const e = Z.graffitiSession;
|
|
57
717
|
if (!e)
|
|
58
718
|
throw new Error(
|
|
59
719
|
"No Graffiti session provided, did you forget to install the plugin?"
|
|
60
720
|
);
|
|
61
721
|
return e;
|
|
62
722
|
}
|
|
63
|
-
function
|
|
64
|
-
const i =
|
|
65
|
-
let
|
|
723
|
+
function Jt(e, n, t, r = !1) {
|
|
724
|
+
const i = ce(), o = /* @__PURE__ */ new Map(), s = S([]);
|
|
725
|
+
let u = async () => {
|
|
66
726
|
};
|
|
67
|
-
const c = async () =>
|
|
68
|
-
let f,
|
|
69
|
-
|
|
70
|
-
f?.return(null),
|
|
71
|
-
continue: () =>
|
|
727
|
+
const c = async () => u(), a = S(!0);
|
|
728
|
+
let f, d;
|
|
729
|
+
_e(() => {
|
|
730
|
+
f?.return(null), d?.return({
|
|
731
|
+
continue: () => d,
|
|
72
732
|
cursor: ""
|
|
73
733
|
});
|
|
74
734
|
});
|
|
75
|
-
const l =
|
|
76
|
-
function
|
|
735
|
+
const l = S(0);
|
|
736
|
+
function p(h = 0) {
|
|
77
737
|
setTimeout(() => {
|
|
78
738
|
l.value++;
|
|
79
|
-
},
|
|
739
|
+
}, h);
|
|
80
740
|
}
|
|
81
741
|
return H(
|
|
82
742
|
() => ({
|
|
83
|
-
args: [
|
|
743
|
+
args: [j(e), j(n), j(t)],
|
|
84
744
|
refresh: l.value
|
|
85
745
|
}),
|
|
86
|
-
({ args:
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
f =
|
|
90
|
-
let
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
continue: () =>
|
|
746
|
+
({ args: h }, y, _) => {
|
|
747
|
+
o.clear(), s.value = [], a.value = !0;
|
|
748
|
+
const x = i.synchronizeDiscover(...h);
|
|
749
|
+
f = x;
|
|
750
|
+
let O, z = !0;
|
|
751
|
+
_(() => {
|
|
752
|
+
z = !1, x.return(null), O?.return({
|
|
753
|
+
continue: () => d,
|
|
94
754
|
cursor: ""
|
|
95
755
|
});
|
|
96
756
|
});
|
|
97
|
-
let
|
|
757
|
+
let U;
|
|
98
758
|
(async () => {
|
|
99
|
-
for await (const
|
|
100
|
-
if (!
|
|
101
|
-
|
|
759
|
+
for await (const P of x) {
|
|
760
|
+
if (!z) break;
|
|
761
|
+
P.tombstone ? o.delete(P.object.url) : o.set(P.object.url, P.object), U || (U = new Promise((Q) => {
|
|
102
762
|
setTimeout(() => {
|
|
103
|
-
|
|
763
|
+
z && (s.value = Array.from(o.values())), U = void 0, Q();
|
|
104
764
|
}, 50);
|
|
105
765
|
}));
|
|
106
766
|
}
|
|
107
767
|
})();
|
|
108
|
-
let
|
|
109
|
-
|
|
110
|
-
if (!(
|
|
111
|
-
|
|
768
|
+
let de = !1, Oe = () => i.discover(...h);
|
|
769
|
+
u = async () => {
|
|
770
|
+
if (!(de || !z)) {
|
|
771
|
+
de = !0;
|
|
112
772
|
try {
|
|
113
|
-
|
|
773
|
+
O = Oe(h[2]);
|
|
114
774
|
} catch {
|
|
115
|
-
return
|
|
775
|
+
return p(5e3);
|
|
116
776
|
}
|
|
117
|
-
if (
|
|
118
|
-
for (
|
|
119
|
-
let
|
|
777
|
+
if (z) {
|
|
778
|
+
for (d = O; ; ) {
|
|
779
|
+
let P;
|
|
120
780
|
try {
|
|
121
|
-
|
|
122
|
-
} catch (
|
|
123
|
-
return
|
|
781
|
+
P = await O.next();
|
|
782
|
+
} catch (Q) {
|
|
783
|
+
return Q instanceof Pe ? p() : (console.error("Fatal error in discover"), console.error(Q), p(5e3));
|
|
124
784
|
}
|
|
125
|
-
if (!
|
|
126
|
-
if (
|
|
127
|
-
|
|
785
|
+
if (!z) return;
|
|
786
|
+
if (P.done) {
|
|
787
|
+
Oe = P.value.continue;
|
|
128
788
|
break;
|
|
129
|
-
} else
|
|
789
|
+
} else P.value.error && console.error(P.value.error);
|
|
130
790
|
}
|
|
131
|
-
await new Promise((
|
|
791
|
+
await new Promise((P) => setTimeout(P, 0)), U && await U, z && (de = !1, a.value = !1, j(r) && c());
|
|
132
792
|
}
|
|
133
793
|
}
|
|
134
794
|
}, c();
|
|
135
795
|
},
|
|
136
796
|
{ immediate: !0 }
|
|
137
797
|
), H(
|
|
138
|
-
() =>
|
|
139
|
-
(
|
|
798
|
+
() => j(r),
|
|
799
|
+
(h) => h && c()
|
|
140
800
|
), {
|
|
141
801
|
objects: s,
|
|
142
802
|
poll: c,
|
|
143
|
-
isFirstPoll:
|
|
803
|
+
isFirstPoll: a
|
|
144
804
|
};
|
|
145
805
|
}
|
|
146
|
-
function
|
|
147
|
-
const t =
|
|
806
|
+
function Le(e, n) {
|
|
807
|
+
const t = S(void 0);
|
|
148
808
|
return H(
|
|
149
|
-
() =>
|
|
150
|
-
async (
|
|
809
|
+
() => j(e),
|
|
810
|
+
async (r, i, o) => {
|
|
151
811
|
let s = !0;
|
|
152
|
-
|
|
812
|
+
o(() => {
|
|
153
813
|
s = !1;
|
|
154
814
|
}), t.value = void 0;
|
|
155
815
|
try {
|
|
156
|
-
const
|
|
157
|
-
s && (t.value =
|
|
158
|
-
} catch (
|
|
816
|
+
const u = await n(r);
|
|
817
|
+
s && (t.value = u);
|
|
818
|
+
} catch (u) {
|
|
159
819
|
if (!s) return;
|
|
160
|
-
|
|
820
|
+
t.value = null, u instanceof T || console.error(u);
|
|
161
821
|
}
|
|
162
822
|
},
|
|
163
823
|
{ immediate: !0 }
|
|
@@ -165,127 +825,122 @@ function me(e, n) {
|
|
|
165
825
|
output: t
|
|
166
826
|
};
|
|
167
827
|
}
|
|
168
|
-
function
|
|
828
|
+
function Ve(e) {
|
|
169
829
|
return e === void 0 ? "Loading..." : e === null ? "Not found" : e;
|
|
170
830
|
}
|
|
171
|
-
function
|
|
172
|
-
const n =
|
|
831
|
+
function Kt(e) {
|
|
832
|
+
const n = je(), { output: t } = Le(
|
|
173
833
|
e,
|
|
174
834
|
n.actorToHandle.bind(n)
|
|
175
835
|
);
|
|
176
836
|
return { handle: t };
|
|
177
837
|
}
|
|
178
|
-
const
|
|
838
|
+
const V = /* @__PURE__ */ R({
|
|
179
839
|
__name: "ActorToHandle",
|
|
180
840
|
props: {
|
|
181
841
|
actor: {}
|
|
182
842
|
},
|
|
183
843
|
setup(e) {
|
|
184
|
-
const t =
|
|
185
|
-
return (i,
|
|
186
|
-
|
|
844
|
+
const t = k(e, "actor"), { handle: r } = Kt(t);
|
|
845
|
+
return (i, o) => X(i.$slots, "default", { handle: v(r) }, () => [
|
|
846
|
+
m("span", null, E(v(Ve)(v(r))), 1)
|
|
187
847
|
]);
|
|
188
848
|
}
|
|
189
|
-
}),
|
|
849
|
+
}), Qt = ["data-url"], Yt = { key: 0 }, en = { key: 1 }, tn = { key: 0 }, nn = { key: 1 }, rn = ["disabled"], on = { key: 1 }, sn = { key: 2 }, le = /* @__PURE__ */ R({
|
|
190
850
|
__name: "ObjectInfo",
|
|
191
851
|
props: {
|
|
192
852
|
object: {}
|
|
193
853
|
},
|
|
194
854
|
setup(e) {
|
|
195
|
-
const n =
|
|
196
|
-
async function
|
|
855
|
+
const n = je(), t = S(!1);
|
|
856
|
+
async function r(i, o) {
|
|
197
857
|
t.value = !0, await new Promise((s) => setTimeout(s, 0)), confirm(
|
|
198
858
|
"Are you sure you want to delete this object? It cannot be undone."
|
|
199
|
-
) && await n.delete(i,
|
|
859
|
+
) && await n.delete(i, o), t.value = !1;
|
|
200
860
|
}
|
|
201
|
-
return (i,
|
|
861
|
+
return (i, o) => e.object ? (g(), b("article", {
|
|
202
862
|
key: 0,
|
|
203
863
|
"data-url": e.object.url
|
|
204
864
|
}, [
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
865
|
+
m("p", null, [
|
|
866
|
+
o[1] || (o[1] = Se("@", -1)),
|
|
867
|
+
F(V, {
|
|
868
|
+
actor: e.object.actor
|
|
869
|
+
}, null, 8, ["actor"]),
|
|
870
|
+
o[2] || (o[2] = Se(" posted:", -1))
|
|
871
|
+
]),
|
|
872
|
+
m("pre", null, E(e.object.value), 1),
|
|
873
|
+
m("details", null, [
|
|
874
|
+
o[14] || (o[14] = m("summary", null, "Show object properties", -1)),
|
|
875
|
+
m("dl", null, [
|
|
876
|
+
o[8] || (o[8] = m("dt", null, "Object URL", -1)),
|
|
877
|
+
m("dd", null, [
|
|
878
|
+
m("code", null, E(e.object.url), 1)
|
|
211
879
|
]),
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
880
|
+
o[9] || (o[9] = m("dt", null, "Actor", -1)),
|
|
881
|
+
m("dd", null, [
|
|
882
|
+
m("code", null, E(e.object.actor), 1)
|
|
215
883
|
]),
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
V
|
|
884
|
+
o[10] || (o[10] = m("dt", null, "Handle", -1)),
|
|
885
|
+
m("dd", null, [
|
|
886
|
+
F(V, {
|
|
219
887
|
actor: e.object.actor
|
|
220
888
|
}, null, 8, ["actor"])
|
|
221
|
-
])
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
])
|
|
889
|
+
]),
|
|
890
|
+
o[11] || (o[11] = m("dt", null, "Content", -1)),
|
|
891
|
+
m("dd", null, [
|
|
892
|
+
m("pre", null, E(e.object.value), 1)
|
|
893
|
+
]),
|
|
894
|
+
o[12] || (o[12] = m("dt", null, "Allowed actors", -1)),
|
|
895
|
+
m("dd", null, [
|
|
896
|
+
Array.isArray(e.object.allowed) ? e.object.allowed.length === 0 ? (g(), b("p", en, [...o[4] || (o[4] = [
|
|
897
|
+
m("em", null, "No one is allowed (except you)", -1)
|
|
898
|
+
])])) : Ee("", !0) : (g(), b("p", Yt, [...o[3] || (o[3] = [
|
|
899
|
+
m("em", null, "Public", -1)
|
|
900
|
+
])])),
|
|
901
|
+
m("ul", null, [
|
|
902
|
+
(g(!0), b(ve, null, ye(e.object.allowed, (s) => (g(), b("li", { key: s }, [
|
|
903
|
+
m("dl", null, [
|
|
904
|
+
o[5] || (o[5] = m("dt", null, "Actor", -1)),
|
|
905
|
+
m("dd", null, [
|
|
906
|
+
m("code", null, E(s), 1)
|
|
907
|
+
]),
|
|
908
|
+
o[6] || (o[6] = m("dt", null, "Handle", -1)),
|
|
909
|
+
m("dd", null, [
|
|
910
|
+
F(V, { actor: s }, null, 8, ["actor"])
|
|
911
|
+
])
|
|
912
|
+
])
|
|
913
|
+
]))), 128))
|
|
246
914
|
])
|
|
247
|
-
])
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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)
|
|
915
|
+
]),
|
|
916
|
+
o[13] || (o[13] = m("dt", null, "Channels", -1)),
|
|
917
|
+
m("dd", null, [
|
|
918
|
+
e.object.channels?.length ? (g(), b("ul", tn, [
|
|
919
|
+
(g(!0), b(ve, null, ye(e.object.channels, (s) => (g(), b("li", { key: s }, [
|
|
920
|
+
m("code", null, E(s), 1)
|
|
921
|
+
]))), 128))
|
|
922
|
+
])) : (g(), b("p", nn, [...o[7] || (o[7] = [
|
|
923
|
+
m("em", null, "No channels", -1)
|
|
924
|
+
])]))
|
|
269
925
|
])
|
|
270
926
|
])
|
|
271
|
-
])
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
927
|
+
]),
|
|
928
|
+
i.$graffitiSession.value?.actor === e.object.actor ? (g(), b("button", {
|
|
929
|
+
key: 0,
|
|
930
|
+
disabled: t.value,
|
|
931
|
+
onClick: o[0] || (o[0] = (s) => r(e.object, i.$graffitiSession.value))
|
|
932
|
+
}, E(t.value ? "Deleting..." : "Delete"), 9, rn)) : Ee("", !0)
|
|
933
|
+
], 8, Qt)) : e.object === null ? (g(), b("article", on, [...o[15] || (o[15] = [
|
|
934
|
+
m("p", null, [
|
|
935
|
+
m("em", null, "Graffiti object not found")
|
|
278
936
|
], -1)
|
|
279
|
-
])])) : (
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
], -1),
|
|
283
|
-
p("p", null, [
|
|
284
|
-
p("em", null, "Loading...")
|
|
937
|
+
])])) : (g(), b("article", sn, [...o[16] || (o[16] = [
|
|
938
|
+
m("p", null, [
|
|
939
|
+
m("em", null, "Graffiti object loading...")
|
|
285
940
|
], -1)
|
|
286
941
|
])]));
|
|
287
942
|
}
|
|
288
|
-
}),
|
|
943
|
+
}), un = { key: 0 }, an = { key: 1 }, qe = /* @__PURE__ */ R({
|
|
289
944
|
__name: "Discover",
|
|
290
945
|
props: {
|
|
291
946
|
channels: {},
|
|
@@ -294,62 +949,62 @@ const W = /* @__PURE__ */ _({
|
|
|
294
949
|
autopoll: { type: Boolean }
|
|
295
950
|
},
|
|
296
951
|
setup(e) {
|
|
297
|
-
const n = e, { objects: t, poll:
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
952
|
+
const n = e, { objects: t, poll: r, isFirstPoll: i } = Jt(
|
|
953
|
+
k(n, "channels"),
|
|
954
|
+
k(n, "schema"),
|
|
955
|
+
k(n, "session"),
|
|
956
|
+
k(n, "autopoll")
|
|
302
957
|
);
|
|
303
|
-
return (
|
|
958
|
+
return (o, s) => X(o.$slots, "default", {
|
|
304
959
|
objects: v(t),
|
|
305
|
-
poll: v(
|
|
960
|
+
poll: v(r),
|
|
306
961
|
isFirstPoll: v(i)
|
|
307
962
|
}, () => [
|
|
308
|
-
v(i) ? (
|
|
309
|
-
|
|
310
|
-
])])) : (
|
|
311
|
-
(
|
|
312
|
-
key:
|
|
963
|
+
v(i) ? (g(), b("p", an, [...s[0] || (s[0] = [
|
|
964
|
+
m("em", null, " Graffiti discover loading... ", -1)
|
|
965
|
+
])])) : (g(), b("ul", un, [
|
|
966
|
+
(g(!0), b(ve, null, ye(v(t), (u) => (g(), b("li", {
|
|
967
|
+
key: u.url
|
|
313
968
|
}, [
|
|
314
|
-
|
|
969
|
+
F(le, { object: u }, null, 8, ["object"])
|
|
315
970
|
]))), 128))
|
|
316
971
|
]))
|
|
317
972
|
]);
|
|
318
973
|
}
|
|
319
974
|
});
|
|
320
|
-
function
|
|
321
|
-
const
|
|
322
|
-
let
|
|
975
|
+
function cn(e, n, t) {
|
|
976
|
+
const r = ce(), i = S(void 0);
|
|
977
|
+
let o = async () => {
|
|
323
978
|
};
|
|
324
|
-
const s = async () =>
|
|
325
|
-
let
|
|
326
|
-
return
|
|
327
|
-
|
|
979
|
+
const s = async () => o();
|
|
980
|
+
let u;
|
|
981
|
+
return _e(() => {
|
|
982
|
+
u?.return(null);
|
|
328
983
|
}), H(
|
|
329
|
-
() => [
|
|
330
|
-
(c,
|
|
984
|
+
() => [j(e), j(n), j(t)],
|
|
985
|
+
(c, a, f) => {
|
|
331
986
|
i.value = void 0;
|
|
332
|
-
const
|
|
333
|
-
|
|
987
|
+
const d = r.synchronizeGet(...c);
|
|
988
|
+
u = d;
|
|
334
989
|
let l = !0;
|
|
335
990
|
f(() => {
|
|
336
|
-
l = !1,
|
|
991
|
+
l = !1, d.return(null);
|
|
337
992
|
}), (async () => {
|
|
338
|
-
for await (const
|
|
993
|
+
for await (const h of d) {
|
|
339
994
|
if (!l) return;
|
|
340
|
-
|
|
995
|
+
h.tombstone ? i.value = null : i.value = h.object;
|
|
341
996
|
}
|
|
342
997
|
})();
|
|
343
|
-
let
|
|
344
|
-
|
|
345
|
-
if (!(
|
|
346
|
-
|
|
998
|
+
let p = !1;
|
|
999
|
+
o = async () => {
|
|
1000
|
+
if (!(p || !l)) {
|
|
1001
|
+
p = !0;
|
|
347
1002
|
try {
|
|
348
|
-
await
|
|
349
|
-
} catch (
|
|
350
|
-
|
|
1003
|
+
await r.get(...c);
|
|
1004
|
+
} catch (h) {
|
|
1005
|
+
h instanceof T || console.error(h);
|
|
351
1006
|
}
|
|
352
|
-
await new Promise((
|
|
1007
|
+
await new Promise((h) => setTimeout(h, 0)), p = !1;
|
|
353
1008
|
}
|
|
354
1009
|
}, s();
|
|
355
1010
|
},
|
|
@@ -359,7 +1014,7 @@ function Ue(e, n, t) {
|
|
|
359
1014
|
poll: s
|
|
360
1015
|
};
|
|
361
1016
|
}
|
|
362
|
-
const
|
|
1017
|
+
const He = /* @__PURE__ */ R({
|
|
363
1018
|
__name: "Get",
|
|
364
1019
|
props: {
|
|
365
1020
|
url: {},
|
|
@@ -367,299 +1022,299 @@ const ge = /* @__PURE__ */ _({
|
|
|
367
1022
|
session: {}
|
|
368
1023
|
},
|
|
369
1024
|
setup(e) {
|
|
370
|
-
const n = e, { object: t, poll:
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
1025
|
+
const n = e, { object: t, poll: r } = cn(
|
|
1026
|
+
k(n, "url"),
|
|
1027
|
+
k(n, "schema"),
|
|
1028
|
+
k(n, "session")
|
|
374
1029
|
);
|
|
375
|
-
return (i,
|
|
1030
|
+
return (i, o) => X(i.$slots, "default", {
|
|
376
1031
|
object: v(t),
|
|
377
|
-
poll: v(
|
|
1032
|
+
poll: v(r)
|
|
378
1033
|
}, () => [
|
|
379
|
-
|
|
1034
|
+
F(le, { object: v(t) }, null, 8, ["object"])
|
|
380
1035
|
]);
|
|
381
1036
|
}
|
|
382
1037
|
});
|
|
383
|
-
function
|
|
384
|
-
const
|
|
1038
|
+
function ln(e, n, t) {
|
|
1039
|
+
const r = ce(), i = S(
|
|
385
1040
|
void 0
|
|
386
|
-
),
|
|
387
|
-
let s = null,
|
|
1041
|
+
), o = S(0);
|
|
1042
|
+
let s = null, u = () => {
|
|
388
1043
|
};
|
|
389
1044
|
function c() {
|
|
390
|
-
return s || (
|
|
391
|
-
|
|
392
|
-
s = null,
|
|
1045
|
+
return s || (o.value++, s = new Promise((a) => {
|
|
1046
|
+
u = () => {
|
|
1047
|
+
s = null, a();
|
|
393
1048
|
};
|
|
394
1049
|
}), s);
|
|
395
1050
|
}
|
|
396
1051
|
return H(
|
|
397
1052
|
() => ({
|
|
398
|
-
args: [
|
|
399
|
-
pollCounter:
|
|
1053
|
+
args: [j(e), j(n), j(t)],
|
|
1054
|
+
pollCounter: o.value
|
|
400
1055
|
}),
|
|
401
|
-
async ({ args:
|
|
1056
|
+
async ({ args: a }, f, d) => {
|
|
402
1057
|
i.value?.dataUrl && URL.revokeObjectURL(i.value.dataUrl), i.value = void 0;
|
|
403
1058
|
let l = !0;
|
|
404
|
-
|
|
1059
|
+
d(() => {
|
|
405
1060
|
l = !1;
|
|
406
1061
|
});
|
|
407
1062
|
try {
|
|
408
|
-
const { data:
|
|
1063
|
+
const { data: p, actor: h, allowed: y } = await r.getMedia(...a);
|
|
409
1064
|
if (!l) return;
|
|
410
|
-
const
|
|
1065
|
+
const _ = URL.createObjectURL(p);
|
|
411
1066
|
i.value = {
|
|
412
|
-
data:
|
|
413
|
-
dataUrl:
|
|
414
|
-
actor:
|
|
415
|
-
allowed:
|
|
1067
|
+
data: p,
|
|
1068
|
+
dataUrl: _,
|
|
1069
|
+
actor: h,
|
|
1070
|
+
allowed: y
|
|
416
1071
|
};
|
|
417
|
-
} catch (
|
|
1072
|
+
} catch (p) {
|
|
418
1073
|
if (!l) return;
|
|
419
|
-
|
|
1074
|
+
p instanceof T ? i.value = null : console.error(p);
|
|
420
1075
|
} finally {
|
|
421
|
-
|
|
1076
|
+
u();
|
|
422
1077
|
}
|
|
423
1078
|
},
|
|
424
1079
|
{ immediate: !0 }
|
|
425
|
-
),
|
|
426
|
-
|
|
1080
|
+
), _e(() => {
|
|
1081
|
+
u(), i.value?.dataUrl && URL.revokeObjectURL(i.value.dataUrl);
|
|
427
1082
|
}), {
|
|
428
1083
|
media: i,
|
|
429
1084
|
poll: c
|
|
430
1085
|
};
|
|
431
1086
|
}
|
|
432
|
-
const
|
|
1087
|
+
const fn = ["src", "alt"], dn = ["src", "alt"], hn = ["src", "alt"], pn = ["src", "alt"], mn = ["data", "alt"], vn = { key: 6 }, yn = { key: 7 }, We = /* @__PURE__ */ R({
|
|
433
1088
|
__name: "GetMedia",
|
|
434
1089
|
props: {
|
|
435
1090
|
url: {},
|
|
436
|
-
|
|
1091
|
+
accept: {},
|
|
437
1092
|
session: {}
|
|
438
1093
|
},
|
|
439
1094
|
setup(e) {
|
|
440
|
-
const n = e, { media: t, poll:
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
1095
|
+
const n = e, { media: t, poll: r } = ln(
|
|
1096
|
+
k(n, "url"),
|
|
1097
|
+
k(n, "accept"),
|
|
1098
|
+
k(n, "session")
|
|
444
1099
|
);
|
|
445
1100
|
function i() {
|
|
446
1101
|
t.value && (window.location.href = t.value.dataUrl);
|
|
447
1102
|
}
|
|
448
|
-
return (
|
|
1103
|
+
return (o, s) => X(o.$slots, "default", {
|
|
449
1104
|
media: v(t),
|
|
450
|
-
poll: v(
|
|
1105
|
+
poll: v(r)
|
|
451
1106
|
}, () => [
|
|
452
|
-
v(t)?.data.type.startsWith("image/") ? (
|
|
1107
|
+
v(t)?.data.type.startsWith("image/") ? (g(), b("img", {
|
|
453
1108
|
key: 0,
|
|
454
1109
|
src: v(t).dataUrl,
|
|
455
1110
|
alt: `An image by ${v(t).actor}`
|
|
456
|
-
}, null, 8,
|
|
1111
|
+
}, null, 8, fn)) : v(t)?.data.type.startsWith("video/") ? (g(), b("video", {
|
|
457
1112
|
key: 1,
|
|
458
1113
|
controls: "",
|
|
459
1114
|
src: v(t).dataUrl,
|
|
460
1115
|
alt: `A video by ${v(t).actor}`
|
|
461
|
-
}, null, 8,
|
|
1116
|
+
}, null, 8, dn)) : v(t)?.data.type.startsWith("audio/") ? (g(), b("audio", {
|
|
462
1117
|
key: 2,
|
|
463
1118
|
controls: "",
|
|
464
1119
|
src: v(t).dataUrl,
|
|
465
1120
|
alt: `Audio by ${v(t).actor}`
|
|
466
|
-
}, null, 8,
|
|
1121
|
+
}, null, 8, hn)) : v(t)?.data.type === "text/html" ? (g(), b("iframe", {
|
|
467
1122
|
key: 3,
|
|
468
1123
|
src: v(t).dataUrl,
|
|
469
1124
|
alt: `HTML by ${v(t).actor}`,
|
|
470
1125
|
sandbox: ""
|
|
471
|
-
}, null, 8,
|
|
1126
|
+
}, null, 8, pn)) : v(t)?.data.type.startsWith("application/pdf") ? (g(), b("object", {
|
|
472
1127
|
key: 4,
|
|
473
1128
|
data: v(t).dataUrl,
|
|
474
1129
|
type: "application/pdf",
|
|
475
1130
|
alt: `PDF by ${v(t).actor}`
|
|
476
|
-
}, null, 8,
|
|
1131
|
+
}, null, 8, mn)) : v(t) ? (g(), b("button", {
|
|
477
1132
|
key: 5,
|
|
478
1133
|
onClick: i
|
|
479
|
-
}, "Download")) : v(t) === null ? (
|
|
480
|
-
|
|
481
|
-
])])) : (
|
|
482
|
-
|
|
1134
|
+
}, "Download media")) : v(t) === null ? (g(), b("p", vn, [...s[0] || (s[0] = [
|
|
1135
|
+
m("em", null, "Media not found", -1)
|
|
1136
|
+
])])) : (g(), b("p", yn, [...s[1] || (s[1] = [
|
|
1137
|
+
m("em", null, " Media loading... ", -1)
|
|
483
1138
|
])]))
|
|
484
1139
|
]);
|
|
485
1140
|
}
|
|
486
1141
|
});
|
|
487
|
-
function
|
|
488
|
-
const n =
|
|
1142
|
+
function bn(e) {
|
|
1143
|
+
const n = je(), { output: t } = Le(
|
|
489
1144
|
e,
|
|
490
1145
|
n.handleToActor.bind(n)
|
|
491
1146
|
);
|
|
492
1147
|
return { actor: t };
|
|
493
1148
|
}
|
|
494
|
-
const
|
|
1149
|
+
const Be = /* @__PURE__ */ R({
|
|
495
1150
|
__name: "HandleToActor",
|
|
496
1151
|
props: {
|
|
497
1152
|
handle: {}
|
|
498
1153
|
},
|
|
499
1154
|
setup(e) {
|
|
500
|
-
const t =
|
|
501
|
-
return (i,
|
|
502
|
-
|
|
1155
|
+
const t = k(e, "handle"), { actor: r } = bn(t);
|
|
1156
|
+
return (i, o) => X(i.$slots, "default", { actor: v(r) }, () => [
|
|
1157
|
+
m("span", null, E(v(Ve)(v(r))), 1)
|
|
503
1158
|
]);
|
|
504
1159
|
}
|
|
505
1160
|
});
|
|
506
|
-
var
|
|
507
|
-
return
|
|
508
|
-
t.__proto__ =
|
|
509
|
-
} || function(t,
|
|
510
|
-
for (var i in
|
|
511
|
-
},
|
|
1161
|
+
var be = function(e, n) {
|
|
1162
|
+
return be = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) {
|
|
1163
|
+
t.__proto__ = r;
|
|
1164
|
+
} || function(t, r) {
|
|
1165
|
+
for (var i in r) r.hasOwnProperty(i) && (t[i] = r[i]);
|
|
1166
|
+
}, be(e, n);
|
|
512
1167
|
};
|
|
513
|
-
function
|
|
514
|
-
|
|
1168
|
+
function gn(e, n) {
|
|
1169
|
+
be(e, n);
|
|
515
1170
|
function t() {
|
|
516
1171
|
this.constructor = e;
|
|
517
1172
|
}
|
|
518
1173
|
e.prototype = n === null ? Object.create(n) : (t.prototype = n.prototype, new t());
|
|
519
1174
|
}
|
|
520
|
-
function
|
|
521
|
-
function i(
|
|
522
|
-
return
|
|
523
|
-
s(
|
|
1175
|
+
function I(e, n, t, r) {
|
|
1176
|
+
function i(o) {
|
|
1177
|
+
return o instanceof t ? o : new t(function(s) {
|
|
1178
|
+
s(o);
|
|
524
1179
|
});
|
|
525
1180
|
}
|
|
526
|
-
return new (t || (t = Promise))(function(
|
|
527
|
-
function
|
|
1181
|
+
return new (t || (t = Promise))(function(o, s) {
|
|
1182
|
+
function u(f) {
|
|
528
1183
|
try {
|
|
529
|
-
|
|
530
|
-
} catch (
|
|
531
|
-
s(
|
|
1184
|
+
a(r.next(f));
|
|
1185
|
+
} catch (d) {
|
|
1186
|
+
s(d);
|
|
532
1187
|
}
|
|
533
1188
|
}
|
|
534
1189
|
function c(f) {
|
|
535
1190
|
try {
|
|
536
|
-
|
|
537
|
-
} catch (
|
|
538
|
-
s(
|
|
1191
|
+
a(r.throw(f));
|
|
1192
|
+
} catch (d) {
|
|
1193
|
+
s(d);
|
|
539
1194
|
}
|
|
540
1195
|
}
|
|
541
|
-
function
|
|
542
|
-
f.done ?
|
|
1196
|
+
function a(f) {
|
|
1197
|
+
f.done ? o(f.value) : i(f.value).then(u, c);
|
|
543
1198
|
}
|
|
544
|
-
|
|
1199
|
+
a((r = r.apply(e, [])).next());
|
|
545
1200
|
});
|
|
546
1201
|
}
|
|
547
|
-
function
|
|
1202
|
+
function $(e, n) {
|
|
548
1203
|
var t = { label: 0, sent: function() {
|
|
549
|
-
if (
|
|
550
|
-
return
|
|
551
|
-
}, trys: [], ops: [] },
|
|
552
|
-
return s = { next:
|
|
1204
|
+
if (o[0] & 1) throw o[1];
|
|
1205
|
+
return o[1];
|
|
1206
|
+
}, trys: [], ops: [] }, r, i, o, s;
|
|
1207
|
+
return s = { next: u(0), throw: u(1), return: u(2) }, typeof Symbol == "function" && (s[Symbol.iterator] = function() {
|
|
553
1208
|
return this;
|
|
554
1209
|
}), s;
|
|
555
|
-
function a
|
|
1210
|
+
function u(a) {
|
|
556
1211
|
return function(f) {
|
|
557
|
-
return c([
|
|
1212
|
+
return c([a, f]);
|
|
558
1213
|
};
|
|
559
1214
|
}
|
|
560
|
-
function c(
|
|
561
|
-
if (
|
|
1215
|
+
function c(a) {
|
|
1216
|
+
if (r) throw new TypeError("Generator is already executing.");
|
|
562
1217
|
for (; t; ) try {
|
|
563
|
-
if (
|
|
564
|
-
switch (i = 0,
|
|
1218
|
+
if (r = 1, i && (o = a[0] & 2 ? i.return : a[0] ? i.throw || ((o = i.return) && o.call(i), 0) : i.next) && !(o = o.call(i, a[1])).done) return o;
|
|
1219
|
+
switch (i = 0, o && (a = [a[0] & 2, o.value]), a[0]) {
|
|
565
1220
|
case 0:
|
|
566
1221
|
case 1:
|
|
567
|
-
|
|
1222
|
+
o = a;
|
|
568
1223
|
break;
|
|
569
1224
|
case 4:
|
|
570
|
-
return t.label++, { value:
|
|
1225
|
+
return t.label++, { value: a[1], done: !1 };
|
|
571
1226
|
case 5:
|
|
572
|
-
t.label++, i =
|
|
1227
|
+
t.label++, i = a[1], a = [0];
|
|
573
1228
|
continue;
|
|
574
1229
|
case 7:
|
|
575
|
-
|
|
1230
|
+
a = t.ops.pop(), t.trys.pop();
|
|
576
1231
|
continue;
|
|
577
1232
|
default:
|
|
578
|
-
if (
|
|
1233
|
+
if (o = t.trys, !(o = o.length > 0 && o[o.length - 1]) && (a[0] === 6 || a[0] === 2)) {
|
|
579
1234
|
t = 0;
|
|
580
1235
|
continue;
|
|
581
1236
|
}
|
|
582
|
-
if (
|
|
583
|
-
t.label =
|
|
1237
|
+
if (a[0] === 3 && (!o || a[1] > o[0] && a[1] < o[3])) {
|
|
1238
|
+
t.label = a[1];
|
|
584
1239
|
break;
|
|
585
1240
|
}
|
|
586
|
-
if (
|
|
587
|
-
t.label =
|
|
1241
|
+
if (a[0] === 6 && t.label < o[1]) {
|
|
1242
|
+
t.label = o[1], o = a;
|
|
588
1243
|
break;
|
|
589
1244
|
}
|
|
590
|
-
if (
|
|
591
|
-
t.label =
|
|
1245
|
+
if (o && t.label < o[2]) {
|
|
1246
|
+
t.label = o[2], t.ops.push(a);
|
|
592
1247
|
break;
|
|
593
1248
|
}
|
|
594
|
-
|
|
1249
|
+
o[2] && t.ops.pop(), t.trys.pop();
|
|
595
1250
|
continue;
|
|
596
1251
|
}
|
|
597
|
-
|
|
1252
|
+
a = n.call(e, t);
|
|
598
1253
|
} catch (f) {
|
|
599
|
-
|
|
1254
|
+
a = [6, f], i = 0;
|
|
600
1255
|
} finally {
|
|
601
|
-
|
|
1256
|
+
r = o = 0;
|
|
602
1257
|
}
|
|
603
|
-
if (
|
|
604
|
-
return { value:
|
|
1258
|
+
if (a[0] & 5) throw a[1];
|
|
1259
|
+
return { value: a[0] ? a[1] : void 0, done: !0 };
|
|
605
1260
|
}
|
|
606
1261
|
}
|
|
607
|
-
function
|
|
608
|
-
var n = typeof Symbol == "function" && Symbol.iterator, t = n && e[n],
|
|
1262
|
+
function D(e) {
|
|
1263
|
+
var n = typeof Symbol == "function" && Symbol.iterator, t = n && e[n], r = 0;
|
|
609
1264
|
if (t) return t.call(e);
|
|
610
1265
|
if (e && typeof e.length == "number") return {
|
|
611
1266
|
next: function() {
|
|
612
|
-
return e &&
|
|
1267
|
+
return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e };
|
|
613
1268
|
}
|
|
614
1269
|
};
|
|
615
1270
|
throw new TypeError(n ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
616
1271
|
}
|
|
617
|
-
function
|
|
618
|
-
return this instanceof
|
|
1272
|
+
function B(e) {
|
|
1273
|
+
return this instanceof B ? (this.v = e, this) : new B(e);
|
|
619
1274
|
}
|
|
620
|
-
function
|
|
1275
|
+
function wn(e, n, t) {
|
|
621
1276
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
622
|
-
var
|
|
1277
|
+
var r = t.apply(e, n || []), i, o = [];
|
|
623
1278
|
return i = {}, s("next"), s("throw"), s("return"), i[Symbol.asyncIterator] = function() {
|
|
624
1279
|
return this;
|
|
625
1280
|
}, i;
|
|
626
1281
|
function s(l) {
|
|
627
|
-
|
|
628
|
-
return new Promise(function(
|
|
629
|
-
|
|
1282
|
+
r[l] && (i[l] = function(p) {
|
|
1283
|
+
return new Promise(function(h, y) {
|
|
1284
|
+
o.push([l, p, h, y]) > 1 || u(l, p);
|
|
630
1285
|
});
|
|
631
1286
|
});
|
|
632
1287
|
}
|
|
633
|
-
function
|
|
1288
|
+
function u(l, p) {
|
|
634
1289
|
try {
|
|
635
|
-
c(
|
|
636
|
-
} catch (
|
|
637
|
-
|
|
1290
|
+
c(r[l](p));
|
|
1291
|
+
} catch (h) {
|
|
1292
|
+
d(o[0][3], h);
|
|
638
1293
|
}
|
|
639
1294
|
}
|
|
640
1295
|
function c(l) {
|
|
641
|
-
l.value instanceof
|
|
1296
|
+
l.value instanceof B ? Promise.resolve(l.value.v).then(a, f) : d(o[0][2], l);
|
|
642
1297
|
}
|
|
643
|
-
function
|
|
644
|
-
|
|
1298
|
+
function a(l) {
|
|
1299
|
+
u("next", l);
|
|
645
1300
|
}
|
|
646
1301
|
function f(l) {
|
|
647
|
-
|
|
1302
|
+
u("throw", l);
|
|
648
1303
|
}
|
|
649
|
-
function
|
|
650
|
-
l(
|
|
1304
|
+
function d(l, p) {
|
|
1305
|
+
l(p), o.shift(), o.length && u(o[0][0], o[0][1]);
|
|
651
1306
|
}
|
|
652
1307
|
}
|
|
653
|
-
var
|
|
1308
|
+
var Xe = (
|
|
654
1309
|
/** @class */
|
|
655
1310
|
(function(e) {
|
|
656
|
-
|
|
1311
|
+
gn(n, e);
|
|
657
1312
|
function n(t) {
|
|
658
|
-
var
|
|
659
|
-
return Object.defineProperty(
|
|
1313
|
+
var r = e.call(this, t) || this;
|
|
1314
|
+
return Object.defineProperty(r, "name", {
|
|
660
1315
|
value: "RepeaterOverflowError",
|
|
661
1316
|
enumerable: !1
|
|
662
|
-
}), typeof Object.setPrototypeOf == "function" ? Object.setPrototypeOf(
|
|
1317
|
+
}), typeof Object.setPrototypeOf == "function" ? Object.setPrototypeOf(r, r.constructor.prototype) : r.__proto__ = r.constructor.prototype, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(r, r.constructor), r;
|
|
663
1318
|
}
|
|
664
1319
|
return n;
|
|
665
1320
|
})(Error)
|
|
@@ -746,16 +1401,16 @@ var Pe = (
|
|
|
746
1401
|
return this._q.shift();
|
|
747
1402
|
}, e;
|
|
748
1403
|
})();
|
|
749
|
-
function
|
|
750
|
-
e != null && typeof e.then == "function" && e.then(
|
|
1404
|
+
function ge(e) {
|
|
1405
|
+
e != null && typeof e.then == "function" && e.then(ie, ie);
|
|
751
1406
|
}
|
|
752
|
-
var
|
|
1407
|
+
var me = 0, Me = 1, G = 2, re = 3, we = 4, oe = 1024, ie = function() {
|
|
753
1408
|
};
|
|
754
|
-
function
|
|
755
|
-
var n = e.err, t = Promise.resolve(e.execution).then(function(
|
|
1409
|
+
function N(e) {
|
|
1410
|
+
var n = e.err, t = Promise.resolve(e.execution).then(function(r) {
|
|
756
1411
|
if (n != null)
|
|
757
1412
|
throw n;
|
|
758
|
-
return
|
|
1413
|
+
return r;
|
|
759
1414
|
});
|
|
760
1415
|
return e.err = void 0, e.execution = t.then(function() {
|
|
761
1416
|
}, function() {
|
|
@@ -763,54 +1418,54 @@ function z(e) {
|
|
|
763
1418
|
return t;
|
|
764
1419
|
});
|
|
765
1420
|
}
|
|
766
|
-
function
|
|
767
|
-
var t = e.state >=
|
|
768
|
-
return Promise.resolve(n).then(function(
|
|
769
|
-
return !t && e.state >=
|
|
1421
|
+
function A(e, n) {
|
|
1422
|
+
var t = e.state >= re;
|
|
1423
|
+
return Promise.resolve(n).then(function(r) {
|
|
1424
|
+
return !t && e.state >= we ? N(e).then(function(i) {
|
|
770
1425
|
return {
|
|
771
1426
|
value: i,
|
|
772
1427
|
done: !0
|
|
773
1428
|
};
|
|
774
|
-
}) : { value:
|
|
1429
|
+
}) : { value: r, done: t };
|
|
775
1430
|
});
|
|
776
1431
|
}
|
|
777
|
-
function
|
|
778
|
-
var t,
|
|
779
|
-
if (!(e.state >=
|
|
780
|
-
if (e.state =
|
|
781
|
-
|
|
1432
|
+
function ke(e, n) {
|
|
1433
|
+
var t, r;
|
|
1434
|
+
if (!(e.state >= G))
|
|
1435
|
+
if (e.state = G, e.onnext(), e.onstop(), e.err == null && (e.err = n), e.pushes.length === 0 && (typeof e.buffer > "u" || e.buffer.empty))
|
|
1436
|
+
q(e);
|
|
782
1437
|
else
|
|
783
1438
|
try {
|
|
784
|
-
for (var i =
|
|
785
|
-
var s =
|
|
1439
|
+
for (var i = D(e.pushes), o = i.next(); !o.done; o = i.next()) {
|
|
1440
|
+
var s = o.value;
|
|
786
1441
|
s.resolve();
|
|
787
1442
|
}
|
|
788
|
-
} catch (
|
|
789
|
-
t = { error:
|
|
1443
|
+
} catch (u) {
|
|
1444
|
+
t = { error: u };
|
|
790
1445
|
} finally {
|
|
791
1446
|
try {
|
|
792
|
-
|
|
1447
|
+
o && !o.done && (r = i.return) && r.call(i);
|
|
793
1448
|
} finally {
|
|
794
1449
|
if (t) throw t.error;
|
|
795
1450
|
}
|
|
796
1451
|
}
|
|
797
1452
|
}
|
|
798
|
-
function
|
|
1453
|
+
function q(e) {
|
|
799
1454
|
var n, t;
|
|
800
|
-
if (!(e.state >=
|
|
801
|
-
e.state <
|
|
1455
|
+
if (!(e.state >= re)) {
|
|
1456
|
+
e.state < G && ke(e), e.state = re, e.buffer = void 0;
|
|
802
1457
|
try {
|
|
803
|
-
for (var
|
|
804
|
-
var
|
|
805
|
-
return
|
|
1458
|
+
for (var r = D(e.nexts), i = r.next(); !i.done; i = r.next()) {
|
|
1459
|
+
var o = i.value, s = e.pending === void 0 ? N(e) : e.pending.then(function() {
|
|
1460
|
+
return N(e);
|
|
806
1461
|
});
|
|
807
|
-
|
|
1462
|
+
o.resolve(A(e, s));
|
|
808
1463
|
}
|
|
809
|
-
} catch (
|
|
810
|
-
n = { error:
|
|
1464
|
+
} catch (u) {
|
|
1465
|
+
n = { error: u };
|
|
811
1466
|
} finally {
|
|
812
1467
|
try {
|
|
813
|
-
i && !i.done && (t =
|
|
1468
|
+
i && !i.done && (t = r.return) && t.call(r);
|
|
814
1469
|
} finally {
|
|
815
1470
|
if (n) throw n.error;
|
|
816
1471
|
}
|
|
@@ -818,131 +1473,131 @@ function L(e) {
|
|
|
818
1473
|
e.pushes = [], e.nexts = [];
|
|
819
1474
|
}
|
|
820
1475
|
}
|
|
821
|
-
function
|
|
822
|
-
e.state >=
|
|
1476
|
+
function Ne(e) {
|
|
1477
|
+
e.state >= we || (e.state < re && q(e), e.state = we);
|
|
823
1478
|
}
|
|
824
|
-
function
|
|
825
|
-
if (
|
|
826
|
-
throw new
|
|
827
|
-
if (e.state >=
|
|
1479
|
+
function _n(e, n) {
|
|
1480
|
+
if (ge(n), e.pushes.length >= oe)
|
|
1481
|
+
throw new Xe("No more than " + oe + " pending calls to push are allowed on a single repeater.");
|
|
1482
|
+
if (e.state >= G)
|
|
828
1483
|
return Promise.resolve(void 0);
|
|
829
1484
|
var t = e.pending === void 0 ? Promise.resolve(n) : e.pending.then(function() {
|
|
830
1485
|
return n;
|
|
831
1486
|
});
|
|
832
1487
|
t = t.catch(function(c) {
|
|
833
|
-
e.state <
|
|
1488
|
+
e.state < G && (e.err = c), Ne(e);
|
|
834
1489
|
});
|
|
835
|
-
var
|
|
1490
|
+
var r;
|
|
836
1491
|
if (e.nexts.length) {
|
|
837
1492
|
var i = e.nexts.shift();
|
|
838
|
-
i.resolve(
|
|
1493
|
+
i.resolve(A(e, t)), e.nexts.length ? r = Promise.resolve(e.nexts[0].value) : typeof e.buffer < "u" && !e.buffer.full ? r = Promise.resolve(void 0) : r = new Promise(function(c) {
|
|
839
1494
|
return e.onnext = c;
|
|
840
1495
|
});
|
|
841
|
-
} else typeof e.buffer < "u" && !e.buffer.full ? (e.buffer.add(t),
|
|
1496
|
+
} else typeof e.buffer < "u" && !e.buffer.full ? (e.buffer.add(t), r = Promise.resolve(void 0)) : r = new Promise(function(c) {
|
|
842
1497
|
return e.pushes.push({ resolve: c, value: t });
|
|
843
1498
|
});
|
|
844
|
-
var
|
|
845
|
-
if (
|
|
1499
|
+
var o = !0, s = {}, u = r.catch(function(c) {
|
|
1500
|
+
if (o)
|
|
846
1501
|
throw c;
|
|
847
1502
|
});
|
|
848
|
-
return s.then = function(c,
|
|
849
|
-
return
|
|
1503
|
+
return s.then = function(c, a) {
|
|
1504
|
+
return o = !1, Promise.prototype.then.call(r, c, a);
|
|
850
1505
|
}, s.catch = function(c) {
|
|
851
|
-
return
|
|
852
|
-
}, s.finally =
|
|
853
|
-
return
|
|
1506
|
+
return o = !1, Promise.prototype.catch.call(r, c);
|
|
1507
|
+
}, s.finally = r.finally.bind(r), e.pending = t.then(function() {
|
|
1508
|
+
return u;
|
|
854
1509
|
}).catch(function(c) {
|
|
855
|
-
e.err = c,
|
|
1510
|
+
e.err = c, Ne(e);
|
|
856
1511
|
}), s;
|
|
857
1512
|
}
|
|
858
|
-
function
|
|
859
|
-
var n =
|
|
860
|
-
return e.onstop =
|
|
1513
|
+
function zn(e) {
|
|
1514
|
+
var n = ke.bind(null, e), t = new Promise(function(r) {
|
|
1515
|
+
return e.onstop = r;
|
|
861
1516
|
});
|
|
862
1517
|
return n.then = t.then.bind(t), n.catch = t.catch.bind(t), n.finally = t.finally.bind(t), n;
|
|
863
1518
|
}
|
|
864
|
-
function
|
|
865
|
-
if (!(e.state >=
|
|
866
|
-
e.state =
|
|
867
|
-
var n =
|
|
868
|
-
e.execution = new Promise(function(
|
|
869
|
-
return
|
|
1519
|
+
function Pn(e) {
|
|
1520
|
+
if (!(e.state >= Me)) {
|
|
1521
|
+
e.state = Me;
|
|
1522
|
+
var n = _n.bind(null, e), t = zn(e);
|
|
1523
|
+
e.execution = new Promise(function(r) {
|
|
1524
|
+
return r(e.executor(n, t));
|
|
870
1525
|
}), e.execution.catch(function() {
|
|
871
|
-
return
|
|
1526
|
+
return ke(e);
|
|
872
1527
|
});
|
|
873
1528
|
}
|
|
874
1529
|
}
|
|
875
|
-
var
|
|
1530
|
+
var te = /* @__PURE__ */ new WeakMap(), K = (
|
|
876
1531
|
/** @class */
|
|
877
1532
|
(function() {
|
|
878
1533
|
function e(n, t) {
|
|
879
|
-
|
|
1534
|
+
te.set(this, {
|
|
880
1535
|
executor: n,
|
|
881
1536
|
buffer: t,
|
|
882
1537
|
err: void 0,
|
|
883
|
-
state:
|
|
1538
|
+
state: me,
|
|
884
1539
|
pushes: [],
|
|
885
1540
|
nexts: [],
|
|
886
1541
|
pending: void 0,
|
|
887
1542
|
execution: void 0,
|
|
888
|
-
onnext:
|
|
889
|
-
onstop:
|
|
1543
|
+
onnext: ie,
|
|
1544
|
+
onstop: ie
|
|
890
1545
|
});
|
|
891
1546
|
}
|
|
892
1547
|
return e.prototype.next = function(n) {
|
|
893
|
-
|
|
894
|
-
var t =
|
|
1548
|
+
ge(n);
|
|
1549
|
+
var t = te.get(this);
|
|
895
1550
|
if (t === void 0)
|
|
896
1551
|
throw new Error("WeakMap error");
|
|
897
|
-
if (t.nexts.length >=
|
|
898
|
-
throw new
|
|
899
|
-
if (t.state <=
|
|
900
|
-
var
|
|
1552
|
+
if (t.nexts.length >= oe)
|
|
1553
|
+
throw new Xe("No more than " + oe + " pending calls to next are allowed on a single repeater.");
|
|
1554
|
+
if (t.state <= me && Pn(t), t.onnext(n), typeof t.buffer < "u" && !t.buffer.empty) {
|
|
1555
|
+
var r = A(t, t.buffer.remove());
|
|
901
1556
|
if (t.pushes.length) {
|
|
902
1557
|
var i = t.pushes.shift();
|
|
903
1558
|
t.buffer.add(i.value), t.onnext = i.resolve;
|
|
904
1559
|
}
|
|
905
|
-
return
|
|
1560
|
+
return r;
|
|
906
1561
|
} else if (t.pushes.length) {
|
|
907
|
-
var
|
|
908
|
-
return t.onnext =
|
|
909
|
-
} else if (t.state >=
|
|
910
|
-
return
|
|
1562
|
+
var o = t.pushes.shift();
|
|
1563
|
+
return t.onnext = o.resolve, A(t, o.value);
|
|
1564
|
+
} else if (t.state >= G)
|
|
1565
|
+
return q(t), A(t, N(t));
|
|
911
1566
|
return new Promise(function(s) {
|
|
912
1567
|
return t.nexts.push({ resolve: s, value: n });
|
|
913
1568
|
});
|
|
914
1569
|
}, e.prototype.return = function(n) {
|
|
915
|
-
|
|
916
|
-
var t =
|
|
1570
|
+
ge(n);
|
|
1571
|
+
var t = te.get(this);
|
|
917
1572
|
if (t === void 0)
|
|
918
1573
|
throw new Error("WeakMap error");
|
|
919
|
-
return
|
|
1574
|
+
return q(t), t.execution = Promise.resolve(t.execution).then(function() {
|
|
920
1575
|
return n;
|
|
921
|
-
}),
|
|
1576
|
+
}), A(t, N(t));
|
|
922
1577
|
}, e.prototype.throw = function(n) {
|
|
923
|
-
var t =
|
|
1578
|
+
var t = te.get(this);
|
|
924
1579
|
if (t === void 0)
|
|
925
1580
|
throw new Error("WeakMap error");
|
|
926
|
-
return t.state <=
|
|
1581
|
+
return t.state <= me || t.state >= G || typeof t.buffer < "u" && !t.buffer.empty ? (q(t), t.err == null && (t.err = n), A(t, N(t))) : this.next(Promise.reject(n));
|
|
927
1582
|
}, e.prototype[Symbol.asyncIterator] = function() {
|
|
928
1583
|
return this;
|
|
929
|
-
}, e.race =
|
|
1584
|
+
}, e.race = jn, e.merge = kn, e.zip = On, e.latest = En, e;
|
|
930
1585
|
})()
|
|
931
1586
|
);
|
|
932
|
-
function
|
|
933
|
-
var t,
|
|
934
|
-
|
|
935
|
-
return
|
|
936
|
-
return
|
|
1587
|
+
function fe(e, n) {
|
|
1588
|
+
var t, r, i = [], o = function(a) {
|
|
1589
|
+
a != null && typeof a[Symbol.asyncIterator] == "function" ? i.push(a[Symbol.asyncIterator]()) : a != null && typeof a[Symbol.iterator] == "function" ? i.push(a[Symbol.iterator]()) : i.push((function() {
|
|
1590
|
+
return wn(this, arguments, function() {
|
|
1591
|
+
return $(this, function(l) {
|
|
937
1592
|
switch (l.label) {
|
|
938
1593
|
case 0:
|
|
939
|
-
return n.yieldValues ? [4,
|
|
1594
|
+
return n.yieldValues ? [4, B(a)] : [3, 3];
|
|
940
1595
|
case 1:
|
|
941
1596
|
return [4, l.sent()];
|
|
942
1597
|
case 2:
|
|
943
1598
|
l.sent(), l.label = 3;
|
|
944
1599
|
case 3:
|
|
945
|
-
return n.returnValues ? [4,
|
|
1600
|
+
return n.returnValues ? [4, B(a)] : [3, 5];
|
|
946
1601
|
case 4:
|
|
947
1602
|
return [2, l.sent()];
|
|
948
1603
|
case 5:
|
|
@@ -956,28 +1611,28 @@ function Y(e, n) {
|
|
|
956
1611
|
})());
|
|
957
1612
|
};
|
|
958
1613
|
try {
|
|
959
|
-
for (var s =
|
|
960
|
-
var c =
|
|
961
|
-
|
|
1614
|
+
for (var s = D(e), u = s.next(); !u.done; u = s.next()) {
|
|
1615
|
+
var c = u.value;
|
|
1616
|
+
o(c);
|
|
962
1617
|
}
|
|
963
|
-
} catch (
|
|
964
|
-
t = { error:
|
|
1618
|
+
} catch (a) {
|
|
1619
|
+
t = { error: a };
|
|
965
1620
|
} finally {
|
|
966
1621
|
try {
|
|
967
|
-
|
|
1622
|
+
u && !u.done && (r = s.return) && r.call(s);
|
|
968
1623
|
} finally {
|
|
969
1624
|
if (t) throw t.error;
|
|
970
1625
|
}
|
|
971
1626
|
}
|
|
972
1627
|
return i;
|
|
973
1628
|
}
|
|
974
|
-
function
|
|
975
|
-
var n = this, t =
|
|
976
|
-
return new
|
|
977
|
-
return
|
|
978
|
-
var
|
|
979
|
-
return
|
|
980
|
-
switch (
|
|
1629
|
+
function jn(e) {
|
|
1630
|
+
var n = this, t = fe(e, { returnValues: !0 });
|
|
1631
|
+
return new K(function(r, i) {
|
|
1632
|
+
return I(n, void 0, void 0, function() {
|
|
1633
|
+
var o, s, u, c, a, f;
|
|
1634
|
+
return $(this, function(d) {
|
|
1635
|
+
switch (d.label) {
|
|
981
1636
|
case 0:
|
|
982
1637
|
if (!t.length)
|
|
983
1638
|
return i(), [
|
|
@@ -985,38 +1640,38 @@ function ot(e) {
|
|
|
985
1640
|
/*return*/
|
|
986
1641
|
];
|
|
987
1642
|
s = !1, i.then(function() {
|
|
988
|
-
|
|
989
|
-
}),
|
|
1643
|
+
o(), s = !0;
|
|
1644
|
+
}), d.label = 1;
|
|
990
1645
|
case 1:
|
|
991
|
-
|
|
992
|
-
var l,
|
|
993
|
-
return
|
|
994
|
-
switch (
|
|
1646
|
+
d.trys.push([1, , 5, 7]), c = void 0, a = 0, f = function() {
|
|
1647
|
+
var l, p, h, y, _, x;
|
|
1648
|
+
return $(this, function(O) {
|
|
1649
|
+
switch (O.label) {
|
|
995
1650
|
case 0:
|
|
996
|
-
l =
|
|
1651
|
+
l = a;
|
|
997
1652
|
try {
|
|
998
|
-
for (
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
}, function(
|
|
1002
|
-
return i(
|
|
1653
|
+
for (p = (_ = void 0, D(t)), h = p.next(); !h.done; h = p.next())
|
|
1654
|
+
y = h.value, Promise.resolve(y.next()).then(function(z) {
|
|
1655
|
+
z.done ? (i(), u === void 0 && (u = z)) : a === l && (a++, o(z));
|
|
1656
|
+
}, function(z) {
|
|
1657
|
+
return i(z);
|
|
1003
1658
|
});
|
|
1004
|
-
} catch (
|
|
1005
|
-
|
|
1659
|
+
} catch (z) {
|
|
1660
|
+
_ = { error: z };
|
|
1006
1661
|
} finally {
|
|
1007
1662
|
try {
|
|
1008
|
-
|
|
1663
|
+
h && !h.done && (x = p.return) && x.call(p);
|
|
1009
1664
|
} finally {
|
|
1010
|
-
if (
|
|
1665
|
+
if (_) throw _.error;
|
|
1011
1666
|
}
|
|
1012
1667
|
}
|
|
1013
|
-
return [4, new Promise(function(
|
|
1014
|
-
return
|
|
1668
|
+
return [4, new Promise(function(z) {
|
|
1669
|
+
return o = z;
|
|
1015
1670
|
})];
|
|
1016
1671
|
case 1:
|
|
1017
|
-
return c =
|
|
1672
|
+
return c = O.sent(), c === void 0 ? [3, 3] : [4, r(c.value)];
|
|
1018
1673
|
case 2:
|
|
1019
|
-
|
|
1674
|
+
O.sent(), O.label = 3;
|
|
1020
1675
|
case 3:
|
|
1021
1676
|
return [
|
|
1022
1677
|
2
|
|
@@ -1024,19 +1679,19 @@ function ot(e) {
|
|
|
1024
1679
|
];
|
|
1025
1680
|
}
|
|
1026
1681
|
});
|
|
1027
|
-
},
|
|
1682
|
+
}, d.label = 2;
|
|
1028
1683
|
case 2:
|
|
1029
1684
|
return s ? [3, 4] : [5, f()];
|
|
1030
1685
|
case 3:
|
|
1031
|
-
return
|
|
1686
|
+
return d.sent(), [3, 2];
|
|
1032
1687
|
case 4:
|
|
1033
|
-
return [2,
|
|
1688
|
+
return [2, u && u.value];
|
|
1034
1689
|
case 5:
|
|
1035
1690
|
return i(), [4, Promise.race(t.map(function(l) {
|
|
1036
1691
|
return l.return && l.return();
|
|
1037
1692
|
}))];
|
|
1038
1693
|
case 6:
|
|
1039
|
-
return
|
|
1694
|
+
return d.sent(), [
|
|
1040
1695
|
7
|
|
1041
1696
|
/*endfinally*/
|
|
1042
1697
|
];
|
|
@@ -1050,68 +1705,68 @@ function ot(e) {
|
|
|
1050
1705
|
});
|
|
1051
1706
|
});
|
|
1052
1707
|
}
|
|
1053
|
-
function
|
|
1054
|
-
var n = this, t =
|
|
1055
|
-
return new
|
|
1056
|
-
return
|
|
1057
|
-
var
|
|
1058
|
-
return
|
|
1059
|
-
switch (
|
|
1708
|
+
function kn(e) {
|
|
1709
|
+
var n = this, t = fe(e, { yieldValues: !0 });
|
|
1710
|
+
return new K(function(r, i) {
|
|
1711
|
+
return I(n, void 0, void 0, function() {
|
|
1712
|
+
var o, s, u, c = this;
|
|
1713
|
+
return $(this, function(a) {
|
|
1714
|
+
switch (a.label) {
|
|
1060
1715
|
case 0:
|
|
1061
1716
|
if (!t.length)
|
|
1062
1717
|
return i(), [
|
|
1063
1718
|
2
|
|
1064
1719
|
/*return*/
|
|
1065
1720
|
];
|
|
1066
|
-
|
|
1067
|
-
var f,
|
|
1721
|
+
o = [], s = !1, i.then(function() {
|
|
1722
|
+
var f, d;
|
|
1068
1723
|
s = !0;
|
|
1069
1724
|
try {
|
|
1070
|
-
for (var l =
|
|
1071
|
-
var
|
|
1072
|
-
|
|
1725
|
+
for (var l = D(o), p = l.next(); !p.done; p = l.next()) {
|
|
1726
|
+
var h = p.value;
|
|
1727
|
+
h();
|
|
1073
1728
|
}
|
|
1074
|
-
} catch (
|
|
1075
|
-
f = { error:
|
|
1729
|
+
} catch (y) {
|
|
1730
|
+
f = { error: y };
|
|
1076
1731
|
} finally {
|
|
1077
1732
|
try {
|
|
1078
|
-
|
|
1733
|
+
p && !p.done && (d = l.return) && d.call(l);
|
|
1079
1734
|
} finally {
|
|
1080
1735
|
if (f) throw f.error;
|
|
1081
1736
|
}
|
|
1082
1737
|
}
|
|
1083
|
-
}),
|
|
1738
|
+
}), a.label = 1;
|
|
1084
1739
|
case 1:
|
|
1085
|
-
return
|
|
1086
|
-
return
|
|
1087
|
-
var l,
|
|
1088
|
-
return
|
|
1089
|
-
switch (
|
|
1740
|
+
return a.trys.push([1, , 3, 4]), [4, Promise.all(t.map(function(f, d) {
|
|
1741
|
+
return I(c, void 0, void 0, function() {
|
|
1742
|
+
var l, p;
|
|
1743
|
+
return $(this, function(h) {
|
|
1744
|
+
switch (h.label) {
|
|
1090
1745
|
case 0:
|
|
1091
|
-
|
|
1746
|
+
h.trys.push([0, , 6, 9]), h.label = 1;
|
|
1092
1747
|
case 1:
|
|
1093
|
-
return s ? [3, 5] : (Promise.resolve(f.next()).then(function(
|
|
1094
|
-
return
|
|
1095
|
-
}, function(
|
|
1096
|
-
return i(
|
|
1097
|
-
}), [4, new Promise(function(
|
|
1098
|
-
|
|
1748
|
+
return s ? [3, 5] : (Promise.resolve(f.next()).then(function(y) {
|
|
1749
|
+
return o[d](y);
|
|
1750
|
+
}, function(y) {
|
|
1751
|
+
return i(y);
|
|
1752
|
+
}), [4, new Promise(function(y) {
|
|
1753
|
+
o[d] = y;
|
|
1099
1754
|
})]);
|
|
1100
1755
|
case 2:
|
|
1101
|
-
return l =
|
|
1756
|
+
return l = h.sent(), l === void 0 ? [3, 4] : l.done ? (u = l, [
|
|
1102
1757
|
2
|
|
1103
1758
|
/*return*/
|
|
1104
|
-
]) : [4,
|
|
1759
|
+
]) : [4, r(l.value)];
|
|
1105
1760
|
case 3:
|
|
1106
|
-
|
|
1761
|
+
h.sent(), h.label = 4;
|
|
1107
1762
|
case 4:
|
|
1108
1763
|
return [3, 1];
|
|
1109
1764
|
case 5:
|
|
1110
1765
|
return [3, 9];
|
|
1111
1766
|
case 6:
|
|
1112
|
-
return
|
|
1767
|
+
return p = f.return, p ? [4, f.return()] : [3, 8];
|
|
1113
1768
|
case 7:
|
|
1114
|
-
|
|
1769
|
+
p = h.sent(), h.label = 8;
|
|
1115
1770
|
case 8:
|
|
1116
1771
|
return [
|
|
1117
1772
|
7
|
|
@@ -1127,7 +1782,7 @@ function it(e) {
|
|
|
1127
1782
|
});
|
|
1128
1783
|
}))];
|
|
1129
1784
|
case 2:
|
|
1130
|
-
return
|
|
1785
|
+
return a.sent(), [2, u && u.value];
|
|
1131
1786
|
case 3:
|
|
1132
1787
|
return i(), [
|
|
1133
1788
|
7
|
|
@@ -1143,42 +1798,42 @@ function it(e) {
|
|
|
1143
1798
|
});
|
|
1144
1799
|
});
|
|
1145
1800
|
}
|
|
1146
|
-
function
|
|
1147
|
-
var n = this, t =
|
|
1148
|
-
return new
|
|
1149
|
-
return
|
|
1150
|
-
var
|
|
1151
|
-
return
|
|
1152
|
-
switch (
|
|
1801
|
+
function On(e) {
|
|
1802
|
+
var n = this, t = fe(e, { returnValues: !0 });
|
|
1803
|
+
return new K(function(r, i) {
|
|
1804
|
+
return I(n, void 0, void 0, function() {
|
|
1805
|
+
var o, s, u, c;
|
|
1806
|
+
return $(this, function(a) {
|
|
1807
|
+
switch (a.label) {
|
|
1153
1808
|
case 0:
|
|
1154
1809
|
if (!t.length)
|
|
1155
1810
|
return i(), [2, []];
|
|
1156
1811
|
s = !1, i.then(function() {
|
|
1157
|
-
|
|
1158
|
-
}),
|
|
1812
|
+
o(), s = !0;
|
|
1813
|
+
}), a.label = 1;
|
|
1159
1814
|
case 1:
|
|
1160
|
-
|
|
1815
|
+
a.trys.push([1, , 6, 8]), a.label = 2;
|
|
1161
1816
|
case 2:
|
|
1162
1817
|
return s ? [3, 5] : (Promise.all(t.map(function(f) {
|
|
1163
1818
|
return f.next();
|
|
1164
1819
|
})).then(function(f) {
|
|
1165
|
-
return
|
|
1820
|
+
return o(f);
|
|
1166
1821
|
}, function(f) {
|
|
1167
1822
|
return i(f);
|
|
1168
1823
|
}), [4, new Promise(function(f) {
|
|
1169
|
-
return
|
|
1824
|
+
return o = f;
|
|
1170
1825
|
})]);
|
|
1171
1826
|
case 3:
|
|
1172
|
-
return
|
|
1827
|
+
return u = a.sent(), u === void 0 ? [
|
|
1173
1828
|
2
|
|
1174
1829
|
/*return*/
|
|
1175
|
-
] : (c =
|
|
1830
|
+
] : (c = u.map(function(f) {
|
|
1176
1831
|
return f.value;
|
|
1177
|
-
}),
|
|
1832
|
+
}), u.some(function(f) {
|
|
1178
1833
|
return f.done;
|
|
1179
|
-
}) ? [2, c] : [4,
|
|
1834
|
+
}) ? [2, c] : [4, r(c)]);
|
|
1180
1835
|
case 4:
|
|
1181
|
-
return
|
|
1836
|
+
return a.sent(), [3, 2];
|
|
1182
1837
|
case 5:
|
|
1183
1838
|
return [3, 8];
|
|
1184
1839
|
case 6:
|
|
@@ -1186,7 +1841,7 @@ function st(e) {
|
|
|
1186
1841
|
return f.return && f.return();
|
|
1187
1842
|
}))];
|
|
1188
1843
|
case 7:
|
|
1189
|
-
return
|
|
1844
|
+
return a.sent(), [
|
|
1190
1845
|
7
|
|
1191
1846
|
/*endfinally*/
|
|
1192
1847
|
];
|
|
@@ -1200,79 +1855,79 @@ function st(e) {
|
|
|
1200
1855
|
});
|
|
1201
1856
|
});
|
|
1202
1857
|
}
|
|
1203
|
-
function
|
|
1204
|
-
var n = this, t =
|
|
1858
|
+
function En(e) {
|
|
1859
|
+
var n = this, t = fe(e, {
|
|
1205
1860
|
yieldValues: !0,
|
|
1206
1861
|
returnValues: !0
|
|
1207
1862
|
});
|
|
1208
|
-
return new
|
|
1209
|
-
return
|
|
1210
|
-
var
|
|
1211
|
-
return
|
|
1212
|
-
switch (
|
|
1863
|
+
return new K(function(r, i) {
|
|
1864
|
+
return I(n, void 0, void 0, function() {
|
|
1865
|
+
var o, s, u, c, a, f = this;
|
|
1866
|
+
return $(this, function(d) {
|
|
1867
|
+
switch (d.label) {
|
|
1213
1868
|
case 0:
|
|
1214
1869
|
if (!t.length)
|
|
1215
1870
|
return i(), [2, []];
|
|
1216
|
-
s = [],
|
|
1217
|
-
var l,
|
|
1218
|
-
|
|
1871
|
+
s = [], u = !1, i.then(function() {
|
|
1872
|
+
var l, p;
|
|
1873
|
+
o();
|
|
1219
1874
|
try {
|
|
1220
|
-
for (var
|
|
1221
|
-
var
|
|
1222
|
-
|
|
1875
|
+
for (var h = D(s), y = h.next(); !y.done; y = h.next()) {
|
|
1876
|
+
var _ = y.value;
|
|
1877
|
+
_();
|
|
1223
1878
|
}
|
|
1224
|
-
} catch (
|
|
1225
|
-
l = { error:
|
|
1879
|
+
} catch (x) {
|
|
1880
|
+
l = { error: x };
|
|
1226
1881
|
} finally {
|
|
1227
1882
|
try {
|
|
1228
|
-
|
|
1883
|
+
y && !y.done && (p = h.return) && p.call(h);
|
|
1229
1884
|
} finally {
|
|
1230
1885
|
if (l) throw l.error;
|
|
1231
1886
|
}
|
|
1232
1887
|
}
|
|
1233
|
-
|
|
1234
|
-
}),
|
|
1888
|
+
u = !0;
|
|
1889
|
+
}), d.label = 1;
|
|
1235
1890
|
case 1:
|
|
1236
|
-
return
|
|
1891
|
+
return d.trys.push([1, , 5, 7]), Promise.all(t.map(function(l) {
|
|
1237
1892
|
return l.next();
|
|
1238
1893
|
})).then(function(l) {
|
|
1239
|
-
return
|
|
1894
|
+
return o(l);
|
|
1240
1895
|
}, function(l) {
|
|
1241
1896
|
return i(l);
|
|
1242
1897
|
}), [4, new Promise(function(l) {
|
|
1243
|
-
return
|
|
1898
|
+
return o = l;
|
|
1244
1899
|
})];
|
|
1245
1900
|
case 2:
|
|
1246
|
-
return c =
|
|
1901
|
+
return c = d.sent(), c === void 0 ? [
|
|
1247
1902
|
2
|
|
1248
1903
|
/*return*/
|
|
1249
|
-
] : (
|
|
1904
|
+
] : (a = c.map(function(l) {
|
|
1250
1905
|
return l.value;
|
|
1251
1906
|
}), c.every(function(l) {
|
|
1252
1907
|
return l.done;
|
|
1253
|
-
}) ? [2,
|
|
1908
|
+
}) ? [2, a] : [4, r(a.slice())]);
|
|
1254
1909
|
case 3:
|
|
1255
|
-
return
|
|
1256
|
-
return
|
|
1257
|
-
var
|
|
1258
|
-
return
|
|
1259
|
-
switch (
|
|
1910
|
+
return d.sent(), [4, Promise.all(t.map(function(l, p) {
|
|
1911
|
+
return I(f, void 0, void 0, function() {
|
|
1912
|
+
var h;
|
|
1913
|
+
return $(this, function(y) {
|
|
1914
|
+
switch (y.label) {
|
|
1260
1915
|
case 0:
|
|
1261
|
-
if (c[
|
|
1262
|
-
return [2, c[
|
|
1263
|
-
|
|
1916
|
+
if (c[p].done)
|
|
1917
|
+
return [2, c[p].value];
|
|
1918
|
+
y.label = 1;
|
|
1264
1919
|
case 1:
|
|
1265
|
-
return
|
|
1266
|
-
return s[
|
|
1267
|
-
}, function(
|
|
1268
|
-
return i(
|
|
1269
|
-
}), [4, new Promise(function(
|
|
1270
|
-
return s[
|
|
1920
|
+
return u ? [3, 4] : (Promise.resolve(l.next()).then(function(_) {
|
|
1921
|
+
return s[p](_);
|
|
1922
|
+
}, function(_) {
|
|
1923
|
+
return i(_);
|
|
1924
|
+
}), [4, new Promise(function(_) {
|
|
1925
|
+
return s[p] = _;
|
|
1271
1926
|
})]);
|
|
1272
1927
|
case 2:
|
|
1273
|
-
return
|
|
1928
|
+
return h = y.sent(), h === void 0 ? [2, c[p].value] : h.done ? [2, h.value] : (a[p] = h.value, [4, r(a.slice())]);
|
|
1274
1929
|
case 3:
|
|
1275
|
-
return
|
|
1930
|
+
return y.sent(), [3, 1];
|
|
1276
1931
|
case 4:
|
|
1277
1932
|
return [
|
|
1278
1933
|
2
|
|
@@ -1283,13 +1938,13 @@ function ut(e) {
|
|
|
1283
1938
|
});
|
|
1284
1939
|
}))];
|
|
1285
1940
|
case 4:
|
|
1286
|
-
return [2,
|
|
1941
|
+
return [2, d.sent()];
|
|
1287
1942
|
case 5:
|
|
1288
1943
|
return i(), [4, Promise.all(t.map(function(l) {
|
|
1289
1944
|
return l.return && l.return();
|
|
1290
1945
|
}))];
|
|
1291
1946
|
case 6:
|
|
1292
|
-
return
|
|
1947
|
+
return d.sent(), [
|
|
1293
1948
|
7
|
|
1294
1949
|
/*endfinally*/
|
|
1295
1950
|
];
|
|
@@ -1303,8 +1958,7 @@ function ut(e) {
|
|
|
1303
1958
|
});
|
|
1304
1959
|
});
|
|
1305
1960
|
}
|
|
1306
|
-
class
|
|
1307
|
-
ajv_;
|
|
1961
|
+
class Sn {
|
|
1308
1962
|
graffiti;
|
|
1309
1963
|
callbacks = /* @__PURE__ */ new Set();
|
|
1310
1964
|
options;
|
|
@@ -1316,12 +1970,6 @@ class lt {
|
|
|
1316
1970
|
deleteMedia;
|
|
1317
1971
|
actorToHandle;
|
|
1318
1972
|
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_;
|
|
1324
|
-
}
|
|
1325
1973
|
/**
|
|
1326
1974
|
* Wraps a Graffiti API instance to provide the synchronize methods.
|
|
1327
1975
|
* The GraffitiSyncrhonize class rather than the Graffiti class
|
|
@@ -1330,24 +1978,24 @@ class lt {
|
|
|
1330
1978
|
constructor(n, t) {
|
|
1331
1979
|
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);
|
|
1332
1980
|
}
|
|
1333
|
-
synchronize(n, t,
|
|
1334
|
-
const s = new
|
|
1335
|
-
async (
|
|
1336
|
-
const
|
|
1337
|
-
if (
|
|
1338
|
-
|
|
1339
|
-
else if (
|
|
1340
|
-
|
|
1341
|
-
JSON.stringify(
|
|
1981
|
+
synchronize(n, t, r, i, o = /* @__PURE__ */ new Set()) {
|
|
1982
|
+
const s = new K(
|
|
1983
|
+
async (u, c) => {
|
|
1984
|
+
const a = await Qe(r), f = (d) => {
|
|
1985
|
+
if (d?.tombstone)
|
|
1986
|
+
o.has(d.object.url) && u(d);
|
|
1987
|
+
else if (d && n(d.object) && (this.options.omniscient || Je(d.object, i))) {
|
|
1988
|
+
let l = JSON.parse(
|
|
1989
|
+
JSON.stringify(d.object)
|
|
1342
1990
|
);
|
|
1343
|
-
this.options.omniscient ||
|
|
1991
|
+
this.options.omniscient || (l = Ke(l, t, i?.actor)), a(l) && (u({ object: l }), o.add(l.url));
|
|
1344
1992
|
}
|
|
1345
1993
|
};
|
|
1346
1994
|
this.callbacks.add(f), await c, this.callbacks.delete(f);
|
|
1347
1995
|
}
|
|
1348
1996
|
);
|
|
1349
1997
|
return (async function* () {
|
|
1350
|
-
for await (const
|
|
1998
|
+
for await (const u of s) yield u;
|
|
1351
1999
|
})();
|
|
1352
2000
|
}
|
|
1353
2001
|
/**
|
|
@@ -1363,11 +2011,11 @@ class lt {
|
|
|
1363
2011
|
*
|
|
1364
2012
|
* @group 0 - Synchronize Methods
|
|
1365
2013
|
*/
|
|
1366
|
-
synchronizeDiscover(n, t,
|
|
1367
|
-
function i(
|
|
1368
|
-
return
|
|
2014
|
+
synchronizeDiscover(n, t, r) {
|
|
2015
|
+
function i(o) {
|
|
2016
|
+
return o.channels.some((s) => n.includes(s));
|
|
1369
2017
|
}
|
|
1370
|
-
return this.synchronize(i, n, t,
|
|
2018
|
+
return this.synchronize(i, n, t, r);
|
|
1371
2019
|
}
|
|
1372
2020
|
/**
|
|
1373
2021
|
* This method has the same signature as {@link get} but
|
|
@@ -1381,16 +2029,16 @@ class lt {
|
|
|
1381
2029
|
*
|
|
1382
2030
|
* @group 0 - Synchronize Methods
|
|
1383
2031
|
*/
|
|
1384
|
-
synchronizeGet(n, t,
|
|
1385
|
-
const i =
|
|
1386
|
-
function
|
|
2032
|
+
synchronizeGet(n, t, r) {
|
|
2033
|
+
const i = he(n);
|
|
2034
|
+
function o(s) {
|
|
1387
2035
|
return s.url === i;
|
|
1388
2036
|
}
|
|
1389
2037
|
return this.synchronize(
|
|
1390
|
-
|
|
2038
|
+
o,
|
|
1391
2039
|
[],
|
|
1392
2040
|
t,
|
|
1393
|
-
|
|
2041
|
+
r,
|
|
1394
2042
|
/* @__PURE__ */ new Set([i])
|
|
1395
2043
|
);
|
|
1396
2044
|
}
|
|
@@ -1410,18 +2058,18 @@ class lt {
|
|
|
1410
2058
|
return this.synchronize(() => !0, [], n, t);
|
|
1411
2059
|
}
|
|
1412
2060
|
async synchronizeDispatch(n, t = !1) {
|
|
1413
|
-
for (const
|
|
1414
|
-
|
|
1415
|
-
t && await new Promise((
|
|
2061
|
+
for (const r of this.callbacks)
|
|
2062
|
+
r(n);
|
|
2063
|
+
t && await new Promise((r) => setTimeout(r, 0));
|
|
1416
2064
|
}
|
|
1417
2065
|
get = async (...n) => {
|
|
1418
2066
|
try {
|
|
1419
2067
|
const t = await this.graffiti.get(...n);
|
|
1420
2068
|
return this.synchronizeDispatch({ object: t }), t;
|
|
1421
2069
|
} catch (t) {
|
|
1422
|
-
throw t instanceof
|
|
2070
|
+
throw t instanceof T && this.synchronizeDispatch({
|
|
1423
2071
|
tombstone: !0,
|
|
1424
|
-
object: { url:
|
|
2072
|
+
object: { url: he(n[0]) }
|
|
1425
2073
|
}), t;
|
|
1426
2074
|
}
|
|
1427
2075
|
};
|
|
@@ -1432,28 +2080,28 @@ class lt {
|
|
|
1432
2080
|
delete = async (...n) => {
|
|
1433
2081
|
const t = {
|
|
1434
2082
|
tombstone: !0,
|
|
1435
|
-
object: { url:
|
|
2083
|
+
object: { url: he(n[0]) }
|
|
1436
2084
|
};
|
|
1437
2085
|
try {
|
|
1438
|
-
const
|
|
1439
|
-
return await this.synchronizeDispatch(t, !0),
|
|
1440
|
-
} catch (
|
|
1441
|
-
throw
|
|
2086
|
+
const r = await this.graffiti.delete(...n);
|
|
2087
|
+
return await this.synchronizeDispatch(t, !0), r;
|
|
2088
|
+
} catch (r) {
|
|
2089
|
+
throw r instanceof T && await this.synchronizeDispatch(t, !0), r;
|
|
1442
2090
|
}
|
|
1443
2091
|
};
|
|
1444
2092
|
objectStreamContinue(n) {
|
|
1445
2093
|
const t = this;
|
|
1446
2094
|
return (async function* () {
|
|
1447
2095
|
for (; ; ) {
|
|
1448
|
-
const
|
|
1449
|
-
if (
|
|
1450
|
-
const { continue: i, cursor:
|
|
2096
|
+
const r = await n.next();
|
|
2097
|
+
if (r.done) {
|
|
2098
|
+
const { continue: i, cursor: o } = r.value;
|
|
1451
2099
|
return {
|
|
1452
2100
|
continue: (s) => t.objectStreamContinue(i(s)),
|
|
1453
|
-
cursor:
|
|
2101
|
+
cursor: o
|
|
1454
2102
|
};
|
|
1455
2103
|
}
|
|
1456
|
-
|
|
2104
|
+
r.value.error || t.synchronizeDispatch(r.value), yield r.value;
|
|
1457
2105
|
}
|
|
1458
2106
|
})();
|
|
1459
2107
|
}
|
|
@@ -1461,9 +2109,9 @@ class lt {
|
|
|
1461
2109
|
const t = this.objectStreamContinue(n);
|
|
1462
2110
|
return (async function* () {
|
|
1463
2111
|
for (; ; ) {
|
|
1464
|
-
const
|
|
1465
|
-
if (
|
|
1466
|
-
(
|
|
2112
|
+
const r = await t.next();
|
|
2113
|
+
if (r.done) return r.value;
|
|
2114
|
+
(r.value.error || !r.value.tombstone) && (yield r.value);
|
|
1467
2115
|
}
|
|
1468
2116
|
})();
|
|
1469
2117
|
}
|
|
@@ -1476,47 +2124,47 @@ class lt {
|
|
|
1476
2124
|
return this.objectStreamContinue(t);
|
|
1477
2125
|
};
|
|
1478
2126
|
}
|
|
1479
|
-
const
|
|
2127
|
+
const An = {
|
|
1480
2128
|
install(e, n) {
|
|
1481
|
-
const t = n.graffiti,
|
|
1482
|
-
|
|
1483
|
-
const s =
|
|
2129
|
+
const t = n.graffiti, r = new Sn(t), i = S(void 0);
|
|
2130
|
+
r.sessionEvents.addEventListener("initialized", async (o) => {
|
|
2131
|
+
const s = o.detail;
|
|
1484
2132
|
if (s && s.error && console.error(s.error), s && s.href) {
|
|
1485
|
-
const
|
|
1486
|
-
if (
|
|
1487
|
-
const c =
|
|
1488
|
-
|
|
2133
|
+
const u = e.config.globalProperties.$router;
|
|
2134
|
+
if (u) {
|
|
2135
|
+
const c = u.options.history.base, a = new URL(s.href);
|
|
2136
|
+
a.pathname.startsWith(c) && (a.pathname = a.pathname.slice(c.length)), await u.replace(a.pathname + a.search + a.hash);
|
|
1489
2137
|
}
|
|
1490
2138
|
}
|
|
1491
2139
|
i.value || (i.value = null);
|
|
1492
|
-
}),
|
|
1493
|
-
const s =
|
|
2140
|
+
}), r.sessionEvents.addEventListener("login", (o) => {
|
|
2141
|
+
const s = o.detail;
|
|
1494
2142
|
if (s.error) {
|
|
1495
2143
|
console.error("Error logging in:"), console.error(s.error);
|
|
1496
2144
|
return;
|
|
1497
2145
|
} else
|
|
1498
2146
|
i.value = s.session;
|
|
1499
|
-
}),
|
|
1500
|
-
const s =
|
|
2147
|
+
}), r.sessionEvents.addEventListener("logout", (o) => {
|
|
2148
|
+
const s = o.detail;
|
|
1501
2149
|
s.error ? (console.error("Error logging out:"), console.error(s.error)) : i.value = null;
|
|
1502
|
-
}),
|
|
2150
|
+
}), Xt(r), Bt(i), e.component("GraffitiDiscover", qe), e.component("GraffitiGet", He), e.component("GraffitiGetMedia", We), e.component("GraffitiActorToHandle", V), e.component("GraffitiHandleToActor", Be), e.component("GraffitiObjectInfo", le), e.config.globalProperties.$graffiti = r, e.config.globalProperties.$graffitiSession = i;
|
|
1503
2151
|
}
|
|
1504
|
-
},
|
|
2152
|
+
}, Tn = qe, Gn = He, Mn = We, Nn = V, Zn = Be, In = le;
|
|
1505
2153
|
export {
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
2154
|
+
Nn as GraffitiActorToHandle,
|
|
2155
|
+
Tn as GraffitiDiscover,
|
|
2156
|
+
Gn as GraffitiGet,
|
|
2157
|
+
Mn as GraffitiGetMedia,
|
|
2158
|
+
Zn as GraffitiHandleToActor,
|
|
2159
|
+
In as GraffitiObjectInfo,
|
|
2160
|
+
An as GraffitiPlugin,
|
|
2161
|
+
je as useGraffiti,
|
|
2162
|
+
Kt as useGraffitiActorToHandle,
|
|
2163
|
+
Jt as useGraffitiDiscover,
|
|
2164
|
+
cn as useGraffitiGet,
|
|
2165
|
+
ln as useGraffitiGetMedia,
|
|
2166
|
+
bn as useGraffitiHandleToActor,
|
|
2167
|
+
$n as useGraffitiSession,
|
|
2168
|
+
ce as useGraffitiSynchronize
|
|
1521
2169
|
};
|
|
1522
2170
|
//# sourceMappingURL=plugin.mjs.map
|