@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.
@@ -1,144 +1,784 @@
1
- import { ref as w, onScopeDispose as _, watch as P, toValue as b, defineComponent as A, toRef as h, renderSlot as L, unref as s, createElementVNode as r, toDisplayString as G, createElementBlock as u, openBlock as c, createVNode as T, createCommentVNode as V, Fragment as C, renderList as F } from "vue";
2
- import { GraffitiSynchronize as ee } from "@graffiti-garden/wrapper-synchronize";
3
- var D = class q extends Error {
4
- constructor(i) {
5
- super(i), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this, q.prototype);
1
+ import { ref as k, onScopeDispose as te, watch as R, toValue as w, defineComponent as A, toRef as z, renderSlot as U, unref as f, createElementVNode as c, toDisplayString as j, createElementBlock as h, openBlock as v, createCommentVNode as ie, createTextVNode as se, createVNode as Z, Fragment as Q, renderList as ee } from "vue";
2
+ import { GraffitiSynchronize as $e } from "@graffiti-garden/wrapper-synchronize";
3
+ class C extends Error {
4
+ constructor(t) {
5
+ super(t), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this, C.prototype);
6
6
  }
7
+ }
8
+ class ne extends Error {
9
+ constructor(t) {
10
+ super(t), this.name = "GraffitiErrorCursorExpired", Object.setPrototypeOf(this, ne.prototype);
11
+ }
12
+ }
13
+ function y(e, t, n) {
14
+ function r(u, l) {
15
+ if (u._zod || Object.defineProperty(u, "_zod", {
16
+ value: {
17
+ def: l,
18
+ constr: o,
19
+ traits: /* @__PURE__ */ new Set()
20
+ },
21
+ enumerable: !1
22
+ }), u._zod.traits.has(e))
23
+ return;
24
+ u._zod.traits.add(e), t(u, l);
25
+ const a = o.prototype, d = Object.keys(a);
26
+ for (let m = 0; m < d.length; m++) {
27
+ const p = d[m];
28
+ p in u || (u[p] = a[p].bind(u));
29
+ }
30
+ }
31
+ const s = n?.Parent ?? Object;
32
+ class i extends s {
33
+ }
34
+ Object.defineProperty(i, "name", { value: e });
35
+ function o(u) {
36
+ var l;
37
+ const a = n?.Parent ? new i() : this;
38
+ r(a, u), (l = a._zod).deferred ?? (l.deferred = []);
39
+ for (const d of a._zod.deferred)
40
+ d();
41
+ return a;
42
+ }
43
+ return Object.defineProperty(o, "init", { value: r }), Object.defineProperty(o, Symbol.hasInstance, {
44
+ value: (u) => n?.Parent && u instanceof n.Parent ? !0 : u?._zod?.traits?.has(e)
45
+ }), Object.defineProperty(o, "name", { value: e }), o;
46
+ }
47
+ class T extends Error {
48
+ constructor() {
49
+ super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
50
+ }
51
+ }
52
+ const Pe = {};
53
+ function W(e) {
54
+ return Pe;
55
+ }
56
+ function Ee(e, t) {
57
+ return typeof t == "bigint" ? t.toString() : t;
58
+ }
59
+ function Oe(e) {
60
+ return {
61
+ get value() {
62
+ {
63
+ const t = e();
64
+ return Object.defineProperty(this, "value", { value: t }), t;
65
+ }
66
+ }
67
+ };
68
+ }
69
+ function Ae(e) {
70
+ const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
71
+ return e.slice(t, n);
72
+ }
73
+ const ue = /* @__PURE__ */ Symbol("evaluating");
74
+ function I(e, t, n) {
75
+ let r;
76
+ Object.defineProperty(e, t, {
77
+ get() {
78
+ if (r !== ue)
79
+ return r === void 0 && (r = ue, r = n()), r;
80
+ },
81
+ set(s) {
82
+ Object.defineProperty(e, t, {
83
+ value: s
84
+ // configurable: true,
85
+ });
86
+ },
87
+ configurable: !0
88
+ });
89
+ }
90
+ const de = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
7
91
  };
8
- const k = {};
9
- function te(e) {
10
- if (!k.graffitiSession)
11
- k.graffitiSession = e;
92
+ function Ne(e) {
93
+ return typeof e == "object" && e !== null && !Array.isArray(e);
94
+ }
95
+ function Se(e, t, n) {
96
+ const r = new e._zod.constr(t ?? e._zod.def);
97
+ return (!t || n?.parent) && (r._zod.parent = e), r;
98
+ }
99
+ function F(e) {
100
+ return {};
101
+ }
102
+ function Ge(e) {
103
+ return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
104
+ }
105
+ const Ze = {
106
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
107
+ int32: [-2147483648, 2147483647],
108
+ uint32: [0, 4294967295],
109
+ float32: [-34028234663852886e22, 34028234663852886e22],
110
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
111
+ };
112
+ function D(e, t = 0) {
113
+ if (e.aborted === !0)
114
+ return !0;
115
+ for (let n = t; n < e.issues.length; n++)
116
+ if (e.issues[n]?.continue !== !0)
117
+ return !0;
118
+ return !1;
119
+ }
120
+ function me(e, t) {
121
+ return t.map((n) => {
122
+ var r;
123
+ return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
124
+ });
125
+ }
126
+ function H(e) {
127
+ return typeof e == "string" ? e : e?.message;
128
+ }
129
+ function B(e, t, n) {
130
+ const r = { ...e, path: e.path ?? [] };
131
+ if (!e.message) {
132
+ const s = H(e.inst?._zod.def?.error?.(e)) ?? H(t?.error?.(e)) ?? H(n.customError?.(e)) ?? H(n.localeError?.(e)) ?? "Invalid input";
133
+ r.message = s;
134
+ }
135
+ return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
136
+ }
137
+ const pe = (e, t) => {
138
+ e.name = "$ZodError", Object.defineProperty(e, "_zod", {
139
+ value: e._zod,
140
+ enumerable: !1
141
+ }), Object.defineProperty(e, "issues", {
142
+ value: t,
143
+ enumerable: !1
144
+ }), e.message = JSON.stringify(t, Ee, 2), Object.defineProperty(e, "toString", {
145
+ value: () => e.message,
146
+ enumerable: !1
147
+ });
148
+ }, Te = y("$ZodError", pe), X = y("$ZodError", pe, { Parent: Error }), Me = (e) => (t, n, r, s) => {
149
+ const i = r ? Object.assign(r, { async: !1 }) : { async: !1 }, o = t._zod.run({ value: n, issues: [] }, i);
150
+ if (o instanceof Promise)
151
+ throw new T();
152
+ if (o.issues.length) {
153
+ const u = new (s?.Err ?? e)(o.issues.map((l) => B(l, i, W())));
154
+ throw de(u, s?.callee), u;
155
+ }
156
+ return o.value;
157
+ }, Re = /* @__PURE__ */ Me(X), Ie = (e) => async (t, n, r, s) => {
158
+ const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
159
+ let o = t._zod.run({ value: n, issues: [] }, i);
160
+ if (o instanceof Promise && (o = await o), o.issues.length) {
161
+ const u = new (s?.Err ?? e)(o.issues.map((l) => B(l, i, W())));
162
+ throw de(u, s?.callee), u;
163
+ }
164
+ return o.value;
165
+ }, Ue = /* @__PURE__ */ Ie(X), Ce = (e) => (t, n, r) => {
166
+ const s = r ? { ...r, async: !1 } : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, s);
167
+ if (i instanceof Promise)
168
+ throw new T();
169
+ return i.issues.length ? {
170
+ success: !1,
171
+ error: new (e ?? Te)(i.issues.map((o) => B(o, s, W())))
172
+ } : { success: !0, data: i.value };
173
+ }, he = /* @__PURE__ */ Ce(X), Fe = (e) => async (t, n, r) => {
174
+ const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
175
+ let i = t._zod.run({ value: n, issues: [] }, s);
176
+ return i instanceof Promise && (i = await i), i.issues.length ? {
177
+ success: !1,
178
+ error: new e(i.issues.map((o) => B(o, s, W())))
179
+ } : { success: !0, data: i.value };
180
+ }, ve = /* @__PURE__ */ Fe(X), Le = (e) => {
181
+ const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
182
+ return new RegExp(`^${t}$`);
183
+ }, xe = /^-?\d+$/, De = /^-?\d+(?:\.\d+)?$/, be = /* @__PURE__ */ y("$ZodCheck", (e, t) => {
184
+ var n;
185
+ e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
186
+ }), He = {
187
+ number: "number",
188
+ bigint: "bigint",
189
+ object: "date"
190
+ }, Ve = /* @__PURE__ */ y("$ZodCheckGreaterThan", (e, t) => {
191
+ be.init(e, t);
192
+ const n = He[typeof t.value];
193
+ e._zod.onattach.push((r) => {
194
+ const s = r._zod.bag, i = (t.inclusive ? s.minimum : s.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
195
+ t.value > i && (t.inclusive ? s.minimum = t.value : s.exclusiveMinimum = t.value);
196
+ }), e._zod.check = (r) => {
197
+ (t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({
198
+ origin: n,
199
+ code: "too_small",
200
+ minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
201
+ input: r.value,
202
+ inclusive: t.inclusive,
203
+ inst: e,
204
+ continue: !t.abort
205
+ });
206
+ };
207
+ }), We = /* @__PURE__ */ y("$ZodCheckNumberFormat", (e, t) => {
208
+ be.init(e, t), t.format = t.format || "float64";
209
+ const n = t.format?.includes("int"), r = n ? "int" : "number", [s, i] = Ze[t.format];
210
+ e._zod.onattach.push((o) => {
211
+ const u = o._zod.bag;
212
+ u.format = t.format, u.minimum = s, u.maximum = i, n && (u.pattern = xe);
213
+ }), e._zod.check = (o) => {
214
+ const u = o.value;
215
+ if (n) {
216
+ if (!Number.isInteger(u)) {
217
+ o.issues.push({
218
+ expected: r,
219
+ format: t.format,
220
+ code: "invalid_type",
221
+ continue: !1,
222
+ input: u,
223
+ inst: e
224
+ });
225
+ return;
226
+ }
227
+ if (!Number.isSafeInteger(u)) {
228
+ u > 0 ? o.issues.push({
229
+ input: u,
230
+ code: "too_big",
231
+ maximum: Number.MAX_SAFE_INTEGER,
232
+ note: "Integers must be within the safe integer range.",
233
+ inst: e,
234
+ origin: r,
235
+ inclusive: !0,
236
+ continue: !t.abort
237
+ }) : o.issues.push({
238
+ input: u,
239
+ code: "too_small",
240
+ minimum: Number.MIN_SAFE_INTEGER,
241
+ note: "Integers must be within the safe integer range.",
242
+ inst: e,
243
+ origin: r,
244
+ inclusive: !0,
245
+ continue: !t.abort
246
+ });
247
+ return;
248
+ }
249
+ }
250
+ u < s && o.issues.push({
251
+ origin: "number",
252
+ input: u,
253
+ code: "too_small",
254
+ minimum: s,
255
+ inclusive: !0,
256
+ inst: e,
257
+ continue: !t.abort
258
+ }), u > i && o.issues.push({
259
+ origin: "number",
260
+ input: u,
261
+ code: "too_big",
262
+ maximum: i,
263
+ inclusive: !0,
264
+ inst: e,
265
+ continue: !t.abort
266
+ });
267
+ };
268
+ }), Be = {
269
+ major: 4,
270
+ minor: 3,
271
+ patch: 5
272
+ }, P = /* @__PURE__ */ y("$ZodType", (e, t) => {
273
+ var n;
274
+ e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Be;
275
+ const r = [...e._zod.def.checks ?? []];
276
+ e._zod.traits.has("$ZodCheck") && r.unshift(e);
277
+ for (const s of r)
278
+ for (const i of s._zod.onattach)
279
+ i(e);
280
+ if (r.length === 0)
281
+ (n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => {
282
+ e._zod.run = e._zod.parse;
283
+ });
284
+ else {
285
+ const s = (o, u, l) => {
286
+ let a = D(o), d;
287
+ for (const m of u) {
288
+ if (m._zod.def.when) {
289
+ if (!m._zod.def.when(o))
290
+ continue;
291
+ } else if (a)
292
+ continue;
293
+ const p = o.issues.length, g = m._zod.check(o);
294
+ if (g instanceof Promise && l?.async === !1)
295
+ throw new T();
296
+ if (d || g instanceof Promise)
297
+ d = (d ?? Promise.resolve()).then(async () => {
298
+ await g, o.issues.length !== p && (a || (a = D(o, p)));
299
+ });
300
+ else {
301
+ if (o.issues.length === p)
302
+ continue;
303
+ a || (a = D(o, p));
304
+ }
305
+ }
306
+ return d ? d.then(() => o) : o;
307
+ }, i = (o, u, l) => {
308
+ if (D(o))
309
+ return o.aborted = !0, o;
310
+ const a = s(u, r, l);
311
+ if (a instanceof Promise) {
312
+ if (l.async === !1)
313
+ throw new T();
314
+ return a.then((d) => e._zod.parse(d, l));
315
+ }
316
+ return e._zod.parse(a, l);
317
+ };
318
+ e._zod.run = (o, u) => {
319
+ if (u.skipChecks)
320
+ return e._zod.parse(o, u);
321
+ if (u.direction === "backward") {
322
+ const a = e._zod.parse({ value: o.value, issues: [] }, { ...u, skipChecks: !0 });
323
+ return a instanceof Promise ? a.then((d) => i(d, o, u)) : i(a, o, u);
324
+ }
325
+ const l = e._zod.parse(o, u);
326
+ if (l instanceof Promise) {
327
+ if (u.async === !1)
328
+ throw new T();
329
+ return l.then((a) => s(a, r, u));
330
+ }
331
+ return s(l, r, u);
332
+ };
333
+ }
334
+ I(e, "~standard", () => ({
335
+ validate: (s) => {
336
+ try {
337
+ const i = he(e, s);
338
+ return i.success ? { value: i.data } : { issues: i.error?.issues };
339
+ } catch {
340
+ return ve(e, s).then((o) => o.success ? { value: o.data } : { issues: o.error?.issues });
341
+ }
342
+ },
343
+ vendor: "zod",
344
+ version: 1
345
+ }));
346
+ }), Xe = /* @__PURE__ */ y("$ZodString", (e, t) => {
347
+ P.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Le(e._zod.bag), e._zod.parse = (n, r) => {
348
+ if (t.coerce)
349
+ try {
350
+ n.value = String(n.value);
351
+ } catch {
352
+ }
353
+ return typeof n.value == "string" || n.issues.push({
354
+ expected: "string",
355
+ code: "invalid_type",
356
+ input: n.value,
357
+ inst: e
358
+ }), n;
359
+ };
360
+ }), ge = /* @__PURE__ */ y("$ZodNumber", (e, t) => {
361
+ P.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? De, e._zod.parse = (n, r) => {
362
+ if (t.coerce)
363
+ try {
364
+ n.value = Number(n.value);
365
+ } catch {
366
+ }
367
+ const s = n.value;
368
+ if (typeof s == "number" && !Number.isNaN(s) && Number.isFinite(s))
369
+ return n;
370
+ const i = typeof s == "number" ? Number.isNaN(s) ? "NaN" : Number.isFinite(s) ? void 0 : "Infinity" : void 0;
371
+ return n.issues.push({
372
+ expected: "number",
373
+ code: "invalid_type",
374
+ input: s,
375
+ inst: e,
376
+ ...i ? { received: i } : {}
377
+ }), n;
378
+ };
379
+ }), Ke = /* @__PURE__ */ y("$ZodNumberFormat", (e, t) => {
380
+ We.init(e, t), ge.init(e, t);
381
+ }), Je = /* @__PURE__ */ y("$ZodUnknown", (e, t) => {
382
+ P.init(e, t), e._zod.parse = (n) => n;
383
+ });
384
+ function ae(e, t, n) {
385
+ e.issues.length && t.issues.push(...me(n, e.issues)), t.value[n] = e.value;
386
+ }
387
+ const Ye = /* @__PURE__ */ y("$ZodArray", (e, t) => {
388
+ P.init(e, t), e._zod.parse = (n, r) => {
389
+ const s = n.value;
390
+ if (!Array.isArray(s))
391
+ return n.issues.push({
392
+ expected: "array",
393
+ code: "invalid_type",
394
+ input: s,
395
+ inst: e
396
+ }), n;
397
+ n.value = Array(s.length);
398
+ const i = [];
399
+ for (let o = 0; o < s.length; o++) {
400
+ const u = s[o], l = t.element._zod.run({
401
+ value: u,
402
+ issues: []
403
+ }, r);
404
+ l instanceof Promise ? i.push(l.then((a) => ae(a, n, o))) : ae(l, n, o);
405
+ }
406
+ return i.length ? Promise.all(i).then(() => n) : n;
407
+ };
408
+ });
409
+ function V(e, t, n, r, s) {
410
+ if (e.issues.length) {
411
+ if (s && !(n in r))
412
+ return;
413
+ t.issues.push(...me(n, e.issues));
414
+ }
415
+ e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
416
+ }
417
+ function qe(e) {
418
+ const t = Object.keys(e.shape);
419
+ for (const r of t)
420
+ if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
421
+ throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
422
+ const n = Ge(e.shape);
423
+ return {
424
+ ...e,
425
+ keys: t,
426
+ keySet: new Set(t),
427
+ numKeys: t.length,
428
+ optionalKeys: new Set(n)
429
+ };
430
+ }
431
+ function Qe(e, t, n, r, s, i) {
432
+ const o = [], u = s.keySet, l = s.catchall._zod, a = l.def.type, d = l.optout === "optional";
433
+ for (const m in t) {
434
+ if (u.has(m))
435
+ continue;
436
+ if (a === "never") {
437
+ o.push(m);
438
+ continue;
439
+ }
440
+ const p = l.run({ value: t[m], issues: [] }, r);
441
+ p instanceof Promise ? e.push(p.then((g) => V(g, n, m, t, d))) : V(p, n, m, t, d);
442
+ }
443
+ return o.length && n.issues.push({
444
+ code: "unrecognized_keys",
445
+ keys: o,
446
+ input: t,
447
+ inst: i
448
+ }), e.length ? Promise.all(e).then(() => n) : n;
449
+ }
450
+ const et = /* @__PURE__ */ y("$ZodObject", (e, t) => {
451
+ if (P.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
452
+ const u = t.shape;
453
+ Object.defineProperty(t, "shape", {
454
+ get: () => {
455
+ const l = { ...u };
456
+ return Object.defineProperty(t, "shape", {
457
+ value: l
458
+ }), l;
459
+ }
460
+ });
461
+ }
462
+ const r = Oe(() => qe(t));
463
+ I(e._zod, "propValues", () => {
464
+ const u = t.shape, l = {};
465
+ for (const a in u) {
466
+ const d = u[a]._zod;
467
+ if (d.values) {
468
+ l[a] ?? (l[a] = /* @__PURE__ */ new Set());
469
+ for (const m of d.values)
470
+ l[a].add(m);
471
+ }
472
+ }
473
+ return l;
474
+ });
475
+ const s = Ne, i = t.catchall;
476
+ let o;
477
+ e._zod.parse = (u, l) => {
478
+ o ?? (o = r.value);
479
+ const a = u.value;
480
+ if (!s(a))
481
+ return u.issues.push({
482
+ expected: "object",
483
+ code: "invalid_type",
484
+ input: a,
485
+ inst: e
486
+ }), u;
487
+ u.value = {};
488
+ const d = [], m = o.shape;
489
+ for (const p of o.keys) {
490
+ const g = m[p], b = g._zod.optout === "optional", E = g._zod.run({ value: a[p], issues: [] }, l);
491
+ E instanceof Promise ? d.push(E.then((S) => V(S, u, p, a, b))) : V(E, u, p, a, b);
492
+ }
493
+ return i ? Qe(d, a, u, l, r.value, e) : d.length ? Promise.all(d).then(() => u) : u;
494
+ };
495
+ });
496
+ function le(e, t) {
497
+ return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
498
+ }
499
+ const tt = /* @__PURE__ */ y("$ZodOptional", (e, t) => {
500
+ P.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", I(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), I(e._zod, "pattern", () => {
501
+ const n = t.innerType._zod.pattern;
502
+ return n ? new RegExp(`^(${Ae(n.source)})?$`) : void 0;
503
+ }), e._zod.parse = (n, r) => {
504
+ if (t.innerType._zod.optin === "optional") {
505
+ const s = t.innerType._zod.run(n, r);
506
+ return s instanceof Promise ? s.then((i) => le(i, n.value)) : le(s, n.value);
507
+ }
508
+ return n.value === void 0 ? n : t.innerType._zod.run(n, r);
509
+ };
510
+ });
511
+ var ce;
512
+ class nt {
513
+ constructor() {
514
+ this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
515
+ }
516
+ add(t, ...n) {
517
+ const r = n[0];
518
+ return this._map.set(t, r), r && typeof r == "object" && "id" in r && this._idmap.set(r.id, t), this;
519
+ }
520
+ clear() {
521
+ return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
522
+ }
523
+ remove(t) {
524
+ const n = this._map.get(t);
525
+ return n && typeof n == "object" && "id" in n && this._idmap.delete(n.id), this._map.delete(t), this;
526
+ }
527
+ get(t) {
528
+ const n = t._zod.parent;
529
+ if (n) {
530
+ const r = { ...this.get(n) ?? {} };
531
+ delete r.id;
532
+ const s = { ...r, ...this._map.get(t) };
533
+ return Object.keys(s).length ? s : void 0;
534
+ }
535
+ return this._map.get(t);
536
+ }
537
+ has(t) {
538
+ return this._map.has(t);
539
+ }
540
+ }
541
+ function rt() {
542
+ return new nt();
543
+ }
544
+ (ce = globalThis).__zod_globalRegistry ?? (ce.__zod_globalRegistry = rt());
545
+ // @__NO_SIDE_EFFECTS__
546
+ function ot(e, t) {
547
+ return new e({
548
+ type: "string",
549
+ ...F()
550
+ });
551
+ }
552
+ // @__NO_SIDE_EFFECTS__
553
+ function it(e, t) {
554
+ return new e({
555
+ type: "number",
556
+ check: "number_format",
557
+ abort: !1,
558
+ format: "safeint",
559
+ ...F()
560
+ });
561
+ }
562
+ // @__NO_SIDE_EFFECTS__
563
+ function st(e) {
564
+ return new e({
565
+ type: "unknown"
566
+ });
567
+ }
568
+ // @__NO_SIDE_EFFECTS__
569
+ function ut(e, t) {
570
+ return new Ve({
571
+ check: "greater_than",
572
+ ...F(),
573
+ value: e,
574
+ inclusive: !0
575
+ });
576
+ }
577
+ // @__NO_SIDE_EFFECTS__
578
+ function at(e) {
579
+ return /* @__PURE__ */ ut(0);
580
+ }
581
+ const N = /* @__PURE__ */ y("ZodMiniType", (e, t) => {
582
+ if (!e._zod)
583
+ throw new Error("Uninitialized schema in ZodMiniType.");
584
+ P.init(e, t), e.def = t, e.type = t.type, e.parse = (n, r) => Re(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => he(e, n, r), e.parseAsync = async (n, r) => Ue(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => ve(e, n, r), e.check = (...n) => e.clone({
585
+ ...t,
586
+ checks: [
587
+ ...t.checks ?? [],
588
+ ...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
589
+ ]
590
+ }, { parent: !0 }), e.with = e.check, e.clone = (n, r) => Se(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.apply = (n) => n(e);
591
+ }), lt = /* @__PURE__ */ y("ZodMiniString", (e, t) => {
592
+ Xe.init(e, t), N.init(e, t);
593
+ });
594
+ // @__NO_SIDE_EFFECTS__
595
+ function ct(e) {
596
+ return /* @__PURE__ */ ot(lt);
597
+ }
598
+ const ft = /* @__PURE__ */ y("ZodMiniNumber", (e, t) => {
599
+ ge.init(e, t), N.init(e, t);
600
+ }), dt = /* @__PURE__ */ y("ZodMiniNumberFormat", (e, t) => {
601
+ Ke.init(e, t), ft.init(e, t);
602
+ });
603
+ // @__NO_SIDE_EFFECTS__
604
+ function mt(e) {
605
+ return /* @__PURE__ */ it(dt);
606
+ }
607
+ const pt = /* @__PURE__ */ y("ZodMiniUnknown", (e, t) => {
608
+ Je.init(e, t), N.init(e, t);
609
+ });
610
+ // @__NO_SIDE_EFFECTS__
611
+ function ht() {
612
+ return /* @__PURE__ */ st(pt);
613
+ }
614
+ const vt = /* @__PURE__ */ y("ZodMiniArray", (e, t) => {
615
+ Ye.init(e, t), N.init(e, t);
616
+ });
617
+ // @__NO_SIDE_EFFECTS__
618
+ function bt(e, t) {
619
+ return new vt({
620
+ type: "array",
621
+ element: e,
622
+ ...F()
623
+ });
624
+ }
625
+ const gt = /* @__PURE__ */ y("ZodMiniObject", (e, t) => {
626
+ et.init(e, t), N.init(e, t), I(e, "shape", () => t.shape);
627
+ });
628
+ // @__NO_SIDE_EFFECTS__
629
+ function yt(e, t) {
630
+ return new gt({
631
+ type: "object",
632
+ shape: e,
633
+ catchall: /* @__PURE__ */ ht(),
634
+ ...F()
635
+ });
636
+ }
637
+ const _t = /* @__PURE__ */ y("ZodMiniOptional", (e, t) => {
638
+ tt.init(e, t), N.init(e, t);
639
+ });
640
+ // @__NO_SIDE_EFFECTS__
641
+ function fe(e) {
642
+ return new _t({
643
+ type: "optional",
644
+ innerType: e
645
+ });
646
+ }
647
+ (/* @__PURE__ */ mt()).check(/* @__PURE__ */ at());
648
+ const O = {};
649
+ function wt(e) {
650
+ if (!O.graffitiSession)
651
+ O.graffitiSession = e;
12
652
  else
13
653
  throw new Error(
14
654
  "Graffiti session already set - plugin installed multiple times?"
15
655
  );
16
656
  }
17
- function ne(e) {
18
- if (!k.graffitiSynchronize)
19
- k.graffitiSynchronize = e;
657
+ function zt(e) {
658
+ if (!O.graffitiSynchronize)
659
+ O.graffitiSynchronize = e;
20
660
  else
21
661
  throw new Error(
22
662
  "Graffiti synchronize already set - plugin installed multiple times?"
23
663
  );
24
664
  }
25
- function H() {
26
- const e = k.graffitiSynchronize;
665
+ function K() {
666
+ const e = O.graffitiSynchronize;
27
667
  if (!e)
28
668
  throw new Error(
29
669
  "No Graffiti instance provided, did you forget to install the plugin?"
30
670
  );
31
671
  return e;
32
672
  }
33
- function W() {
34
- return H();
673
+ function re() {
674
+ return K();
35
675
  }
36
- function Pe() {
37
- const e = k.graffitiSession;
676
+ function Bt() {
677
+ const e = O.graffitiSession;
38
678
  if (!e)
39
679
  throw new Error(
40
680
  "No Graffiti session provided, did you forget to install the plugin?"
41
681
  );
42
682
  return e;
43
683
  }
44
- function oe(e, i, n, a = !1) {
45
- const l = H(), t = /* @__PURE__ */ new Map(), o = w([]);
46
- let f = async () => {
684
+ function jt(e, t, n, r = !1) {
685
+ const s = K(), i = /* @__PURE__ */ new Map(), o = k([]);
686
+ let u = async () => {
47
687
  };
48
- const p = async () => f(), m = w(!0);
49
- let S, g;
50
- _(() => {
51
- S?.return(null), g?.return({
52
- continue: () => g,
688
+ const l = async () => u(), a = k(!0);
689
+ let d, m;
690
+ te(() => {
691
+ d?.return(null), m?.return({
692
+ continue: () => m,
53
693
  cursor: ""
54
694
  });
55
695
  });
56
- const j = w(0);
57
- function v(d = 0) {
696
+ const p = k(0);
697
+ function g(b = 0) {
58
698
  setTimeout(() => {
59
- j.value++;
60
- }, d);
699
+ p.value++;
700
+ }, b);
61
701
  }
62
- return P(
702
+ return R(
63
703
  () => ({
64
- args: [b(e), b(i), b(n)],
65
- refresh: j.value
704
+ args: [w(e), w(t), w(n)],
705
+ refresh: p.value
66
706
  }),
67
- ({ args: d }, x, z) => {
68
- t.clear(), o.value = [], m.value = !0;
69
- const I = l.synchronizeDiscover(...d);
70
- S = I;
71
- let E, $ = !0;
72
- z(() => {
73
- $ = !1, I.return(null), E?.return({
74
- continue: () => g,
707
+ ({ args: b }, E, S) => {
708
+ i.clear(), o.value = [], a.value = !0;
709
+ const Y = s.synchronizeDiscover(...b);
710
+ d = Y;
711
+ let L, $ = !0;
712
+ S(() => {
713
+ $ = !1, Y.return(null), L?.return({
714
+ continue: () => m,
75
715
  cursor: ""
76
716
  });
77
717
  });
78
- let U;
718
+ let G;
79
719
  (async () => {
80
- for await (const y of I) {
720
+ for await (const _ of Y) {
81
721
  if (!$) break;
82
- y.tombstone ? t.delete(y.object.url) : t.set(y.object.url, y.object), U || (U = new Promise((N) => {
722
+ _.tombstone ? i.delete(_.object.url) : i.set(_.object.url, _.object), G || (G = new Promise((x) => {
83
723
  setTimeout(() => {
84
- $ && (o.value = Array.from(t.values())), U = void 0, N();
724
+ $ && (o.value = Array.from(i.values())), G = void 0, x();
85
725
  }, 50);
86
726
  }));
87
727
  }
88
728
  })();
89
- let M = !1, B = () => l.discover(...d);
90
- f = async () => {
91
- if (!(M || !$)) {
92
- M = !0;
729
+ let q = !1, oe = () => s.discover(...b);
730
+ u = async () => {
731
+ if (!(q || !$)) {
732
+ q = !0;
93
733
  try {
94
- E = B(d[2]);
734
+ L = oe(b[2]);
95
735
  } catch {
96
- return v(5e3);
736
+ return g(5e3);
97
737
  }
98
738
  if ($) {
99
- for (g = E; ; ) {
100
- let y;
739
+ for (m = L; ; ) {
740
+ let _;
101
741
  try {
102
- y = await E.next();
103
- } catch (N) {
104
- return N instanceof D ? v() : v(5e3);
742
+ _ = await L.next();
743
+ } catch (x) {
744
+ return x instanceof ne ? g() : (console.error("Fatal error in discover"), console.error(x), g(5e3));
105
745
  }
106
746
  if (!$) return;
107
- if (y.done) {
108
- B = y.value.continue;
747
+ if (_.done) {
748
+ oe = _.value.continue;
109
749
  break;
110
- } else y.value.error && console.error(y.value.error);
750
+ } else _.value.error && console.error(_.value.error);
111
751
  }
112
- await new Promise((y) => setTimeout(y, 0)), U && await U, $ && (M = !1, m.value = !1, b(a) && p());
752
+ await new Promise((_) => setTimeout(_, 0)), G && await G, $ && (q = !1, a.value = !1, w(r) && l());
113
753
  }
114
754
  }
115
- }, p();
755
+ }, l();
116
756
  },
117
757
  { immediate: !0 }
118
- ), P(
119
- () => b(a),
120
- (d) => d && p()
758
+ ), R(
759
+ () => w(r),
760
+ (b) => b && l()
121
761
  ), {
122
762
  objects: o,
123
- poll: p,
124
- isFirstPoll: m
763
+ poll: l,
764
+ isFirstPoll: a
125
765
  };
126
766
  }
127
- function J(e, i) {
128
- const n = w(void 0);
129
- return P(
130
- () => b(e),
131
- async (a, l, t) => {
767
+ function ye(e, t) {
768
+ const n = k(void 0);
769
+ return R(
770
+ () => w(e),
771
+ async (r, s, i) => {
132
772
  let o = !0;
133
- t(() => {
773
+ i(() => {
134
774
  o = !1;
135
775
  }), n.value = void 0;
136
776
  try {
137
- const f = await i(a);
138
- o && (n.value = f);
139
- } catch (f) {
777
+ const u = await t(r);
778
+ o && (n.value = u);
779
+ } catch (u) {
140
780
  if (!o) return;
141
- f instanceof D ? n.value = null : console.error(f);
781
+ n.value = null, u instanceof C || console.error(u);
142
782
  }
143
783
  },
144
784
  { immediate: !0 }
@@ -146,127 +786,122 @@ function J(e, i) {
146
786
  output: n
147
787
  };
148
788
  }
149
- function K(e) {
789
+ function _e(e) {
150
790
  return e === void 0 ? "Loading..." : e === null ? "Not found" : e;
151
791
  }
152
- function re(e) {
153
- const i = W(), { output: n } = J(
792
+ function kt(e) {
793
+ const t = re(), { output: n } = ye(
154
794
  e,
155
- i.actorToHandle.bind(i)
795
+ t.actorToHandle.bind(t)
156
796
  );
157
797
  return { handle: n };
158
798
  }
159
- const O = /* @__PURE__ */ A({
799
+ const M = /* @__PURE__ */ A({
160
800
  __name: "ActorToHandle",
161
801
  props: {
162
802
  actor: {}
163
803
  },
164
804
  setup(e) {
165
- const n = h(e, "actor"), { handle: a } = re(n);
166
- return (l, t) => L(l.$slots, "default", { handle: s(a) }, () => [
167
- r("span", null, G(s(K)(s(a))), 1)
805
+ const n = z(e, "actor"), { handle: r } = kt(n);
806
+ return (s, i) => U(s.$slots, "default", { handle: f(r) }, () => [
807
+ c("span", null, j(f(_e)(f(r))), 1)
168
808
  ]);
169
809
  }
170
- }), le = ["data-url"], ie = { key: 0 }, se = { key: 1 }, ae = { key: 0 }, ue = { key: 1 }, ce = { key: 0 }, fe = ["disabled"], de = { key: 1 }, me = { key: 2 }, R = /* @__PURE__ */ A({
810
+ }), $t = ["data-url"], Pt = { key: 0 }, Et = { key: 1 }, Ot = { key: 0 }, At = { key: 1 }, Nt = ["disabled"], St = { key: 1 }, Gt = { key: 2 }, J = /* @__PURE__ */ A({
171
811
  __name: "ObjectInfo",
172
812
  props: {
173
813
  object: {}
174
814
  },
175
815
  setup(e) {
176
- const i = W(), n = w(!1);
177
- async function a(l, t) {
816
+ const t = re(), n = k(!1);
817
+ async function r(s, i) {
178
818
  n.value = !0, await new Promise((o) => setTimeout(o, 0)), confirm(
179
819
  "Are you sure you want to delete this object? It cannot be undone."
180
- ) && await i.delete(l, t), n.value = !1;
820
+ ) && await t.delete(s, i), n.value = !1;
181
821
  }
182
- return (l, t) => e.object ? (c(), u("article", {
822
+ return (s, i) => e.object ? (v(), h("article", {
183
823
  key: 0,
184
824
  "data-url": e.object.url
185
825
  }, [
186
- r("header", null, [
187
- t[4] || (t[4] = r("h2", null, "Graffiti Object", -1)),
188
- r("dl", null, [
189
- t[1] || (t[1] = r("dt", null, "Object URL", -1)),
190
- r("dd", null, [
191
- r("code", null, G(e.object.url), 1)
826
+ c("p", null, [
827
+ i[1] || (i[1] = se("@", -1)),
828
+ Z(M, {
829
+ actor: e.object.actor
830
+ }, null, 8, ["actor"]),
831
+ i[2] || (i[2] = se(" posted:", -1))
832
+ ]),
833
+ c("pre", null, j(e.object.value), 1),
834
+ c("details", null, [
835
+ i[14] || (i[14] = c("summary", null, "Show object properties", -1)),
836
+ c("dl", null, [
837
+ i[8] || (i[8] = c("dt", null, "Object URL", -1)),
838
+ c("dd", null, [
839
+ c("code", null, j(e.object.url), 1)
192
840
  ]),
193
- t[2] || (t[2] = r("dt", null, "Actor", -1)),
194
- r("dd", null, [
195
- r("code", null, G(e.object.actor), 1)
841
+ i[9] || (i[9] = c("dt", null, "Actor", -1)),
842
+ c("dd", null, [
843
+ c("code", null, j(e.object.actor), 1)
196
844
  ]),
197
- t[3] || (t[3] = r("dt", null, "Handle", -1)),
198
- r("dd", null, [
199
- T(O, {
845
+ i[10] || (i[10] = c("dt", null, "Handle", -1)),
846
+ c("dd", null, [
847
+ Z(M, {
200
848
  actor: e.object.actor
201
849
  }, null, 8, ["actor"])
202
- ])
203
- ])
204
- ]),
205
- r("section", null, [
206
- t[5] || (t[5] = r("h3", null, "Content", -1)),
207
- r("pre", null, G(e.object.value), 1)
208
- ]),
209
- r("section", null, [
210
- t[10] || (t[10] = r("h3", null, "Allowed Actors", -1)),
211
- Array.isArray(e.object.allowed) ? e.object.allowed.length === 0 ? (c(), u("p", se, [...t[7] || (t[7] = [
212
- r("em", null, "Noone", -1)
213
- ])])) : V("", !0) : (c(), u("p", ie, [...t[6] || (t[6] = [
214
- r("em", null, "Public", -1)
215
- ])])),
216
- r("ul", null, [
217
- (c(!0), u(C, null, F(e.object.allowed, (o) => (c(), u("li", { key: o }, [
218
- r("dl", null, [
219
- t[8] || (t[8] = r("dt", null, "Actor", -1)),
220
- r("dd", null, [
221
- r("code", null, G(o), 1)
222
- ]),
223
- t[9] || (t[9] = r("dt", null, "Handle", -1)),
224
- r("dd", null, [
225
- T(O, { actor: o }, null, 8, ["actor"])
226
- ])
850
+ ]),
851
+ i[11] || (i[11] = c("dt", null, "Content", -1)),
852
+ c("dd", null, [
853
+ c("pre", null, j(e.object.value), 1)
854
+ ]),
855
+ i[12] || (i[12] = c("dt", null, "Allowed actors", -1)),
856
+ c("dd", null, [
857
+ Array.isArray(e.object.allowed) ? e.object.allowed.length === 0 ? (v(), h("p", Et, [...i[4] || (i[4] = [
858
+ c("em", null, "No one is allowed (except you)", -1)
859
+ ])])) : ie("", !0) : (v(), h("p", Pt, [...i[3] || (i[3] = [
860
+ c("em", null, "Public", -1)
861
+ ])])),
862
+ c("ul", null, [
863
+ (v(!0), h(Q, null, ee(e.object.allowed, (o) => (v(), h("li", { key: o }, [
864
+ c("dl", null, [
865
+ i[5] || (i[5] = c("dt", null, "Actor", -1)),
866
+ c("dd", null, [
867
+ c("code", null, j(o), 1)
868
+ ]),
869
+ i[6] || (i[6] = c("dt", null, "Handle", -1)),
870
+ c("dd", null, [
871
+ Z(M, { actor: o }, null, 8, ["actor"])
872
+ ])
873
+ ])
874
+ ]))), 128))
227
875
  ])
228
- ]))), 128))
229
- ])
230
- ]),
231
- r("section", null, [
232
- t[12] || (t[12] = r("h3", null, "Channels", -1)),
233
- e.object.channels?.length ? (c(), u("ul", ae, [
234
- (c(!0), u(C, null, F(e.object.channels, (o) => (c(), u("li", { key: o }, [
235
- r("code", null, G(o), 1)
236
- ]))), 128))
237
- ])) : (c(), u("p", ue, [...t[11] || (t[11] = [
238
- r("em", null, "No channels", -1)
239
- ])]))
240
- ]),
241
- r("footer", null, [
242
- r("nav", null, [
243
- r("ul", null, [
244
- l.$graffitiSession.value?.actor === e.object.actor ? (c(), u("li", ce, [
245
- r("button", {
246
- disabled: n.value,
247
- onClick: t[0] || (t[0] = (o) => a(e.object, l.$graffitiSession.value))
248
- }, G(n.value ? "Deleting..." : "Delete"), 9, fe)
249
- ])) : V("", !0)
876
+ ]),
877
+ i[13] || (i[13] = c("dt", null, "Channels", -1)),
878
+ c("dd", null, [
879
+ e.object.channels?.length ? (v(), h("ul", Ot, [
880
+ (v(!0), h(Q, null, ee(e.object.channels, (o) => (v(), h("li", { key: o }, [
881
+ c("code", null, j(o), 1)
882
+ ]))), 128))
883
+ ])) : (v(), h("p", At, [...i[7] || (i[7] = [
884
+ c("em", null, "No channels", -1)
885
+ ])]))
250
886
  ])
251
887
  ])
252
- ])
253
- ], 8, le)) : e.object === null ? (c(), u("article", de, [...t[13] || (t[13] = [
254
- r("header", null, [
255
- r("h2", null, "Graffiti Object")
256
- ], -1),
257
- r("p", null, [
258
- r("em", null, "Object not found")
888
+ ]),
889
+ s.$graffitiSession.value?.actor === e.object.actor ? (v(), h("button", {
890
+ key: 0,
891
+ disabled: n.value,
892
+ onClick: i[0] || (i[0] = (o) => r(e.object, s.$graffitiSession.value))
893
+ }, j(n.value ? "Deleting..." : "Delete"), 9, Nt)) : ie("", !0)
894
+ ], 8, $t)) : e.object === null ? (v(), h("article", St, [...i[15] || (i[15] = [
895
+ c("p", null, [
896
+ c("em", null, "Graffiti object not found")
259
897
  ], -1)
260
- ])])) : (c(), u("article", me, [...t[14] || (t[14] = [
261
- r("header", null, [
262
- r("h2", null, "Graffiti Object")
263
- ], -1),
264
- r("p", null, [
265
- r("em", null, "Loading...")
898
+ ])])) : (v(), h("article", Gt, [...i[16] || (i[16] = [
899
+ c("p", null, [
900
+ c("em", null, "Graffiti object loading...")
266
901
  ], -1)
267
902
  ])]));
268
903
  }
269
- }), ve = { key: 0 }, ye = { key: 1 }, Q = /* @__PURE__ */ A({
904
+ }), Zt = { key: 0 }, Tt = { key: 1 }, we = /* @__PURE__ */ A({
270
905
  __name: "Discover",
271
906
  props: {
272
907
  channels: {},
@@ -275,72 +910,72 @@ const O = /* @__PURE__ */ A({
275
910
  autopoll: { type: Boolean }
276
911
  },
277
912
  setup(e) {
278
- const i = e, { objects: n, poll: a, isFirstPoll: l } = oe(
279
- h(i, "channels"),
280
- h(i, "schema"),
281
- h(i, "session"),
282
- h(i, "autopoll")
913
+ const t = e, { objects: n, poll: r, isFirstPoll: s } = jt(
914
+ z(t, "channels"),
915
+ z(t, "schema"),
916
+ z(t, "session"),
917
+ z(t, "autopoll")
283
918
  );
284
- return (t, o) => L(t.$slots, "default", {
285
- objects: s(n),
286
- poll: s(a),
287
- isFirstPoll: s(l)
919
+ return (i, o) => U(i.$slots, "default", {
920
+ objects: f(n),
921
+ poll: f(r),
922
+ isFirstPoll: f(s)
288
923
  }, () => [
289
- s(l) ? (c(), u("p", ye, [...o[0] || (o[0] = [
290
- r("em", null, " Loading... ", -1)
291
- ])])) : (c(), u("ul", ve, [
292
- (c(!0), u(C, null, F(s(n), (f) => (c(), u("li", {
293
- key: f.url
924
+ f(s) ? (v(), h("p", Tt, [...o[0] || (o[0] = [
925
+ c("em", null, " Graffiti discover loading... ", -1)
926
+ ])])) : (v(), h("ul", Zt, [
927
+ (v(!0), h(Q, null, ee(f(n), (u) => (v(), h("li", {
928
+ key: u.url
294
929
  }, [
295
- T(R, { object: f }, null, 8, ["object"])
930
+ Z(J, { object: u }, null, 8, ["object"])
296
931
  ]))), 128))
297
932
  ]))
298
933
  ]);
299
934
  }
300
935
  });
301
- function pe(e, i, n) {
302
- const a = H(), l = w(void 0);
303
- let t = async () => {
936
+ function Mt(e, t, n) {
937
+ const r = K(), s = k(void 0);
938
+ let i = async () => {
304
939
  };
305
- const o = async () => t();
306
- let f;
307
- return _(() => {
308
- f?.return(null);
309
- }), P(
310
- () => [b(e), b(i), b(n)],
311
- (p, m, S) => {
312
- l.value = void 0;
313
- const g = a.synchronizeGet(...p);
314
- f = g;
315
- let j = !0;
316
- S(() => {
317
- j = !1, g.return(null);
940
+ const o = async () => i();
941
+ let u;
942
+ return te(() => {
943
+ u?.return(null);
944
+ }), R(
945
+ () => [w(e), w(t), w(n)],
946
+ (l, a, d) => {
947
+ s.value = void 0;
948
+ const m = r.synchronizeGet(...l);
949
+ u = m;
950
+ let p = !0;
951
+ d(() => {
952
+ p = !1, m.return(null);
318
953
  }), (async () => {
319
- for await (const d of g) {
320
- if (!j) return;
321
- d.tombstone ? l.value = null : l.value = d.object;
954
+ for await (const b of m) {
955
+ if (!p) return;
956
+ b.tombstone ? s.value = null : s.value = b.object;
322
957
  }
323
958
  })();
324
- let v = !1;
325
- t = async () => {
326
- if (!(v || !j)) {
327
- v = !0;
959
+ let g = !1;
960
+ i = async () => {
961
+ if (!(g || !p)) {
962
+ g = !0;
328
963
  try {
329
- await a.get(...p);
330
- } catch (d) {
331
- d instanceof D || console.error(d);
964
+ await r.get(...l);
965
+ } catch (b) {
966
+ b instanceof C || console.error(b);
332
967
  }
333
- await new Promise((d) => setTimeout(d, 0)), v = !1;
968
+ await new Promise((b) => setTimeout(b, 0)), g = !1;
334
969
  }
335
970
  }, o();
336
971
  },
337
972
  { immediate: !0 }
338
973
  ), {
339
- object: l,
974
+ object: s,
340
975
  poll: o
341
976
  };
342
977
  }
343
- const X = /* @__PURE__ */ A({
978
+ const ze = /* @__PURE__ */ A({
344
979
  __name: "Get",
345
980
  props: {
346
981
  url: {},
@@ -348,182 +983,182 @@ const X = /* @__PURE__ */ A({
348
983
  session: {}
349
984
  },
350
985
  setup(e) {
351
- const i = e, { object: n, poll: a } = pe(
352
- h(i, "url"),
353
- h(i, "schema"),
354
- h(i, "session")
986
+ const t = e, { object: n, poll: r } = Mt(
987
+ z(t, "url"),
988
+ z(t, "schema"),
989
+ z(t, "session")
355
990
  );
356
- return (l, t) => L(l.$slots, "default", {
357
- object: s(n),
358
- poll: s(a)
991
+ return (s, i) => U(s.$slots, "default", {
992
+ object: f(n),
993
+ poll: f(r)
359
994
  }, () => [
360
- T(R, { object: s(n) }, null, 8, ["object"])
995
+ Z(J, { object: f(n) }, null, 8, ["object"])
361
996
  ]);
362
997
  }
363
998
  });
364
- function be(e, i, n) {
365
- const a = H(), l = w(
999
+ function Rt(e, t, n) {
1000
+ const r = K(), s = k(
366
1001
  void 0
367
- ), t = w(0);
368
- let o = null, f = () => {
1002
+ ), i = k(0);
1003
+ let o = null, u = () => {
369
1004
  };
370
- function p() {
371
- return o || (t.value++, o = new Promise((m) => {
372
- f = () => {
373
- o = null, m();
1005
+ function l() {
1006
+ return o || (i.value++, o = new Promise((a) => {
1007
+ u = () => {
1008
+ o = null, a();
374
1009
  };
375
1010
  }), o);
376
1011
  }
377
- return P(
1012
+ return R(
378
1013
  () => ({
379
- args: [b(e), b(i), b(n)],
380
- pollCounter: t.value
1014
+ args: [w(e), w(t), w(n)],
1015
+ pollCounter: i.value
381
1016
  }),
382
- async ({ args: m }, S, g) => {
383
- l.value?.dataUrl && URL.revokeObjectURL(l.value.dataUrl), l.value = void 0;
384
- let j = !0;
385
- g(() => {
386
- j = !1;
1017
+ async ({ args: a }, d, m) => {
1018
+ s.value?.dataUrl && URL.revokeObjectURL(s.value.dataUrl), s.value = void 0;
1019
+ let p = !0;
1020
+ m(() => {
1021
+ p = !1;
387
1022
  });
388
1023
  try {
389
- const { data: v, actor: d, allowed: x } = await a.getMedia(...m);
390
- if (!j) return;
391
- const z = URL.createObjectURL(v);
392
- l.value = {
393
- data: v,
394
- dataUrl: z,
395
- actor: d,
396
- allowed: x
1024
+ const { data: g, actor: b, allowed: E } = await r.getMedia(...a);
1025
+ if (!p) return;
1026
+ const S = URL.createObjectURL(g);
1027
+ s.value = {
1028
+ data: g,
1029
+ dataUrl: S,
1030
+ actor: b,
1031
+ allowed: E
397
1032
  };
398
- } catch (v) {
399
- if (!j) return;
400
- v instanceof D ? l.value = null : console.error(v);
1033
+ } catch (g) {
1034
+ if (!p) return;
1035
+ g instanceof C ? s.value = null : console.error(g);
401
1036
  } finally {
402
- f();
1037
+ u();
403
1038
  }
404
1039
  },
405
1040
  { immediate: !0 }
406
- ), _(() => {
407
- f(), l.value?.dataUrl && URL.revokeObjectURL(l.value.dataUrl);
1041
+ ), te(() => {
1042
+ u(), s.value?.dataUrl && URL.revokeObjectURL(s.value.dataUrl);
408
1043
  }), {
409
- media: l,
410
- poll: p
1044
+ media: s,
1045
+ poll: l
411
1046
  };
412
1047
  }
413
- const he = ["src", "alt"], ge = ["src", "alt"], je = ["src", "alt"], we = ["src", "alt"], Ge = ["data", "alt"], $e = { key: 6 }, ke = { key: 7 }, Y = /* @__PURE__ */ A({
1048
+ const It = ["src", "alt"], Ut = ["src", "alt"], Ct = ["src", "alt"], Ft = ["src", "alt"], Lt = ["data", "alt"], xt = { key: 6 }, Dt = { key: 7 }, je = /* @__PURE__ */ A({
414
1049
  __name: "GetMedia",
415
1050
  props: {
416
1051
  url: {},
417
- requirements: {},
1052
+ accept: {},
418
1053
  session: {}
419
1054
  },
420
1055
  setup(e) {
421
- const i = e, { media: n, poll: a } = be(
422
- h(i, "url"),
423
- h(i, "requirements"),
424
- h(i, "session")
1056
+ const t = e, { media: n, poll: r } = Rt(
1057
+ z(t, "url"),
1058
+ z(t, "accept"),
1059
+ z(t, "session")
425
1060
  );
426
- function l() {
1061
+ function s() {
427
1062
  n.value && (window.location.href = n.value.dataUrl);
428
1063
  }
429
- return (t, o) => L(t.$slots, "default", {
430
- media: s(n),
431
- poll: s(a)
1064
+ return (i, o) => U(i.$slots, "default", {
1065
+ media: f(n),
1066
+ poll: f(r)
432
1067
  }, () => [
433
- s(n)?.data.type.startsWith("image/") ? (c(), u("img", {
1068
+ f(n)?.data.type.startsWith("image/") ? (v(), h("img", {
434
1069
  key: 0,
435
- src: s(n).dataUrl,
436
- alt: `An image by ${s(n).actor}`
437
- }, null, 8, he)) : s(n)?.data.type.startsWith("video/") ? (c(), u("video", {
1070
+ src: f(n).dataUrl,
1071
+ alt: `An image by ${f(n).actor}`
1072
+ }, null, 8, It)) : f(n)?.data.type.startsWith("video/") ? (v(), h("video", {
438
1073
  key: 1,
439
1074
  controls: "",
440
- src: s(n).dataUrl,
441
- alt: `A video by ${s(n).actor}`
442
- }, null, 8, ge)) : s(n)?.data.type.startsWith("audio/") ? (c(), u("audio", {
1075
+ src: f(n).dataUrl,
1076
+ alt: `A video by ${f(n).actor}`
1077
+ }, null, 8, Ut)) : f(n)?.data.type.startsWith("audio/") ? (v(), h("audio", {
443
1078
  key: 2,
444
1079
  controls: "",
445
- src: s(n).dataUrl,
446
- alt: `Audio by ${s(n).actor}`
447
- }, null, 8, je)) : s(n)?.data.type === "text/html" ? (c(), u("iframe", {
1080
+ src: f(n).dataUrl,
1081
+ alt: `Audio by ${f(n).actor}`
1082
+ }, null, 8, Ct)) : f(n)?.data.type === "text/html" ? (v(), h("iframe", {
448
1083
  key: 3,
449
- src: s(n).dataUrl,
450
- alt: `HTML by ${s(n).actor}`,
1084
+ src: f(n).dataUrl,
1085
+ alt: `HTML by ${f(n).actor}`,
451
1086
  sandbox: ""
452
- }, null, 8, we)) : s(n)?.data.type.startsWith("application/pdf") ? (c(), u("object", {
1087
+ }, null, 8, Ft)) : f(n)?.data.type.startsWith("application/pdf") ? (v(), h("object", {
453
1088
  key: 4,
454
- data: s(n).dataUrl,
1089
+ data: f(n).dataUrl,
455
1090
  type: "application/pdf",
456
- alt: `PDF by ${s(n).actor}`
457
- }, null, 8, Ge)) : s(n) ? (c(), u("button", {
1091
+ alt: `PDF by ${f(n).actor}`
1092
+ }, null, 8, Lt)) : f(n) ? (v(), h("button", {
458
1093
  key: 5,
459
- onClick: l
460
- }, "Download")) : s(n) === null ? (c(), u("p", $e, [...o[0] || (o[0] = [
461
- r("em", null, "Media not found", -1)
462
- ])])) : (c(), u("p", ke, [...o[1] || (o[1] = [
463
- r("em", null, " Loading... ", -1)
1094
+ onClick: s
1095
+ }, "Download media")) : f(n) === null ? (v(), h("p", xt, [...o[0] || (o[0] = [
1096
+ c("em", null, "Media not found", -1)
1097
+ ])])) : (v(), h("p", Dt, [...o[1] || (o[1] = [
1098
+ c("em", null, " Media loading... ", -1)
464
1099
  ])]))
465
1100
  ]);
466
1101
  }
467
1102
  });
468
- function Ae(e) {
469
- const i = W(), { output: n } = J(
1103
+ function Ht(e) {
1104
+ const t = re(), { output: n } = ye(
470
1105
  e,
471
- i.handleToActor.bind(i)
1106
+ t.handleToActor.bind(t)
472
1107
  );
473
1108
  return { actor: n };
474
1109
  }
475
- const Z = /* @__PURE__ */ A({
1110
+ const ke = /* @__PURE__ */ A({
476
1111
  __name: "HandleToActor",
477
1112
  props: {
478
1113
  handle: {}
479
1114
  },
480
1115
  setup(e) {
481
- const n = h(e, "handle"), { actor: a } = Ae(n);
482
- return (l, t) => L(l.$slots, "default", { actor: s(a) }, () => [
483
- r("span", null, G(s(K)(s(a))), 1)
1116
+ const n = z(e, "handle"), { actor: r } = Ht(n);
1117
+ return (s, i) => U(s.$slots, "default", { actor: f(r) }, () => [
1118
+ c("span", null, j(f(_e)(f(r))), 1)
484
1119
  ]);
485
1120
  }
486
- }), Le = {
487
- install(e, i) {
488
- const n = i.graffiti, a = new ee(n), l = w(void 0);
489
- a.sessionEvents.addEventListener("initialized", async (t) => {
490
- const o = t.detail;
1121
+ }), Xt = {
1122
+ install(e, t) {
1123
+ const n = t.graffiti, r = new $e(n), s = k(void 0);
1124
+ r.sessionEvents.addEventListener("initialized", async (i) => {
1125
+ const o = i.detail;
491
1126
  if (o && o.error && console.error(o.error), o && o.href) {
492
- const f = e.config.globalProperties.$router;
493
- if (f) {
494
- const p = f.options.history.base, m = new URL(o.href);
495
- m.pathname.startsWith(p) && (m.pathname = m.pathname.slice(p.length)), await f.replace(m.pathname + m.search + m.hash);
1127
+ const u = e.config.globalProperties.$router;
1128
+ if (u) {
1129
+ const l = u.options.history.base, a = new URL(o.href);
1130
+ a.pathname.startsWith(l) && (a.pathname = a.pathname.slice(l.length)), await u.replace(a.pathname + a.search + a.hash);
496
1131
  }
497
1132
  }
498
- l.value || (l.value = null);
499
- }), a.sessionEvents.addEventListener("login", (t) => {
500
- const o = t.detail;
1133
+ s.value || (s.value = null);
1134
+ }), r.sessionEvents.addEventListener("login", (i) => {
1135
+ const o = i.detail;
501
1136
  if (o.error) {
502
1137
  console.error("Error logging in:"), console.error(o.error);
503
1138
  return;
504
1139
  } else
505
- l.value = o.session;
506
- }), a.sessionEvents.addEventListener("logout", (t) => {
507
- const o = t.detail;
508
- o.error ? (console.error("Error logging out:"), console.error(o.error)) : l.value = null;
509
- }), ne(a), te(l), e.component("GraffitiDiscover", Q), e.component("GraffitiGet", X), e.component("GraffitiGetMedia", Y), e.component("GraffitiActorToHandle", O), e.component("GraffitiHandleToActor", Z), e.component("GraffitiObjectInfo", R), e.config.globalProperties.$graffiti = a, e.config.globalProperties.$graffitiSession = l;
1140
+ s.value = o.session;
1141
+ }), r.sessionEvents.addEventListener("logout", (i) => {
1142
+ const o = i.detail;
1143
+ o.error ? (console.error("Error logging out:"), console.error(o.error)) : s.value = null;
1144
+ }), zt(r), wt(s), e.component("GraffitiDiscover", we), e.component("GraffitiGet", ze), e.component("GraffitiGetMedia", je), e.component("GraffitiActorToHandle", M), e.component("GraffitiHandleToActor", ke), e.component("GraffitiObjectInfo", J), e.config.globalProperties.$graffiti = r, e.config.globalProperties.$graffitiSession = s;
510
1145
  }
511
- }, Ee = Q, Te = X, Oe = Y, De = O, He = Z, Re = R;
1146
+ }, Kt = we, Jt = ze, Yt = je, qt = M, Qt = ke, en = J;
512
1147
  export {
513
- De as GraffitiActorToHandle,
514
- Ee as GraffitiDiscover,
515
- Te as GraffitiGet,
516
- Oe as GraffitiGetMedia,
517
- He as GraffitiHandleToActor,
518
- Re as GraffitiObjectInfo,
519
- Le as GraffitiPlugin,
520
- W as useGraffiti,
521
- re as useGraffitiActorToHandle,
522
- oe as useGraffitiDiscover,
523
- pe as useGraffitiGet,
524
- be as useGraffitiGetMedia,
525
- Ae as useGraffitiHandleToActor,
526
- Pe as useGraffitiSession,
527
- H as useGraffitiSynchronize
1148
+ qt as GraffitiActorToHandle,
1149
+ Kt as GraffitiDiscover,
1150
+ Jt as GraffitiGet,
1151
+ Yt as GraffitiGetMedia,
1152
+ Qt as GraffitiHandleToActor,
1153
+ en as GraffitiObjectInfo,
1154
+ Xt as GraffitiPlugin,
1155
+ re as useGraffiti,
1156
+ kt as useGraffitiActorToHandle,
1157
+ jt as useGraffitiDiscover,
1158
+ Mt as useGraffitiGet,
1159
+ Rt as useGraffitiGetMedia,
1160
+ Ht as useGraffitiHandleToActor,
1161
+ Bt as useGraffitiSession,
1162
+ K as useGraffitiSynchronize
528
1163
  };
529
1164
  //# sourceMappingURL=plugin.mjs.map