@graffiti-garden/wrapper-vue 0.7.0 → 0.7.2

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,46 +1,46 @@
1
- var pe = Object.defineProperty;
2
- var de = (t, n, e) => n in t ? pe(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
- var v = (t, n, e) => de(t, typeof n != "symbol" ? n + "" : n, e);
4
- import { inject as X, ref as N, computed as ye, watch as ve, onScopeDispose as me, toValue as P, defineComponent as L, toRef as b, renderSlot as W, unref as g } from "vue";
5
- const Y = Symbol(), Z = Symbol();
6
- function B() {
7
- const t = X(Y);
1
+ var fe = Object.defineProperty;
2
+ var he = (t, n, e) => n in t ? fe(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
+ var v = (t, n, e) => he(t, typeof n != "symbol" ? n + "" : n, e);
4
+ import { ref as B, computed as pe, watch as de, onScopeDispose as ye, toValue as P, defineComponent as W, toRef as b, renderSlot as J, unref as g } from "vue";
5
+ const q = {};
6
+ function M() {
7
+ const t = q.graffitiSynchronize;
8
8
  if (!t)
9
9
  throw new Error(
10
10
  "No Graffiti instance provided, did you forget to install the plugin?"
11
11
  );
12
12
  return t;
13
13
  }
14
- function Le() {
15
- return B();
14
+ function $e() {
15
+ return M();
16
16
  }
17
- function ee() {
18
- const t = X(Z);
17
+ function Y() {
18
+ const t = q.graffitiSession;
19
19
  if (!t)
20
20
  throw new Error(
21
21
  "No Graffiti session provided, did you forget to install the plugin?"
22
22
  );
23
23
  return t;
24
24
  }
25
- var be = class {
26
- }, we = class te extends Error {
25
+ var ve = class {
26
+ }, me = class Z extends Error {
27
27
  constructor(n) {
28
- super(n), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this, te.prototype);
28
+ super(n), this.name = "GraffitiErrorNotFound", Object.setPrototypeOf(this, Z.prototype);
29
29
  }
30
- }, ge = class ne extends Error {
30
+ }, be = class ee extends Error {
31
31
  constructor(n) {
32
- super(n), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this, ne.prototype);
32
+ super(n), this.name = "GraffitiErrorInvalidSchema", Object.setPrototypeOf(this, ee.prototype);
33
33
  }
34
- }, Pe = class re extends Error {
34
+ }, we = class te extends Error {
35
35
  constructor(n) {
36
- super(n), this.name = "GraffitiErrorPatchTestFailed", Object.setPrototypeOf(this, re.prototype);
36
+ super(n), this.name = "GraffitiErrorPatchTestFailed", Object.setPrototypeOf(this, te.prototype);
37
37
  }
38
- }, je = class ie extends Error {
38
+ }, ge = class ne extends Error {
39
39
  constructor(n) {
40
- super(n), this.name = "GraffitiErrorPatchError", Object.setPrototypeOf(this, ie.prototype);
40
+ super(n), this.name = "GraffitiErrorPatchError", Object.setPrototypeOf(this, ne.prototype);
41
41
  }
42
42
  };
43
- class xe {
43
+ class Pe {
44
44
  constructor(n) {
45
45
  v(this, "poll", async (n) => {
46
46
  let e;
@@ -58,7 +58,7 @@ class xe {
58
58
  clear() {
59
59
  }
60
60
  }
61
- class oe {
61
+ class re {
62
62
  constructor(n) {
63
63
  v(this, "iterator");
64
64
  v(this, "continue");
@@ -68,7 +68,7 @@ class oe {
68
68
  try {
69
69
  this.iterator = this.continue();
70
70
  } catch (e) {
71
- if (e instanceof we)
71
+ if (e instanceof me)
72
72
  n("clear"), this.iterator = this.streamFactory();
73
73
  else
74
74
  throw e;
@@ -79,7 +79,7 @@ class oe {
79
79
  const e = this.iterator, r = await e.next();
80
80
  if (e === this.iterator) {
81
81
  if (r.done) {
82
- r.value && (this.iterator = void 0, this.continue = r.value.continue);
82
+ this.iterator = void 0, r.value && (this.continue = r.value.continue);
83
83
  break;
84
84
  }
85
85
  if (r.value.error) {
@@ -103,15 +103,15 @@ class oe {
103
103
  this.iterator = void 0, this.continue = void 0;
104
104
  }
105
105
  }
106
- function se(t, n) {
106
+ function ie(t, n) {
107
107
  return !n || t.object.lastModified > n.object.lastModified || t.object.lastModified === n.object.lastModified && !t.tombstone && !!n.tombstone;
108
108
  }
109
- class Oe {
109
+ class je {
110
110
  constructor() {
111
- v(this, "entry", N());
111
+ v(this, "entry", B());
112
112
  }
113
113
  get result() {
114
- return ye(() => {
114
+ return pe(() => {
115
115
  const n = this.entry.value;
116
116
  return n && (n.tombstone ? null : n.object);
117
117
  });
@@ -124,12 +124,12 @@ class Oe {
124
124
  this.clear();
125
125
  return;
126
126
  }
127
- (!n || se(n, this.entry.value)) && (this.entry.value = n);
127
+ (!n || ie(n, this.entry.value)) && (this.entry.value = n);
128
128
  }
129
129
  }
130
- class ae {
130
+ class oe {
131
131
  constructor(n) {
132
- v(this, "results", N([]));
132
+ v(this, "results", B([]));
133
133
  v(this, "resultsRaw", /* @__PURE__ */ new Map());
134
134
  v(this, "batchFlattenTimer");
135
135
  this.graffiti = n;
@@ -147,12 +147,12 @@ class ae {
147
147
  return;
148
148
  }
149
149
  const e = this.resultsRaw.get(n.object.url);
150
- se(n, e) && (this.resultsRaw.set(n.object.url, n), this.batchFlattenTimer || (this.batchFlattenTimer = setTimeout(() => {
150
+ ie(n, e) && (this.resultsRaw.set(n.object.url, n), this.batchFlattenTimer || (this.batchFlattenTimer = setTimeout(() => {
151
151
  this.flattenResults(), this.batchFlattenTimer = void 0;
152
152
  }, 0)));
153
153
  }
154
154
  }
155
- function J(t, n, e, r, o) {
155
+ function H(t, n, e, r, o) {
156
156
  let i;
157
157
  async function a() {
158
158
  i = e();
@@ -171,12 +171,14 @@ function J(t, n, e, r, o) {
171
171
  l = !0;
172
172
  try {
173
173
  await h();
174
+ } catch {
175
+ await new Promise((d) => setTimeout(d, 2e3));
174
176
  } finally {
175
177
  if (h !== c) return;
176
178
  l = !1, P(o) && s();
177
179
  }
178
- }, f = N(!1);
179
- return ve(
180
+ }, f = B(!1);
181
+ return de(
180
182
  r,
181
183
  async (h, u) => {
182
184
  if (JSON.stringify(h) === JSON.stringify(u))
@@ -194,11 +196,11 @@ function J(t, n, e, r, o) {
194
196
  {
195
197
  immediate: !0
196
198
  }
197
- ), me(() => {
199
+ ), ye(() => {
198
200
  i == null || i.return(null), t.clear(), n.clear(), c = void 0;
199
201
  }), { poll: s, isInitialPolling: f };
200
202
  }
201
- function ue(t, n) {
203
+ function se(t, n) {
202
204
  return () => {
203
205
  const e = P(n);
204
206
  return e === void 0 ? t == null ? void 0 : t.value : e;
@@ -207,8 +209,8 @@ function ue(t, n) {
207
209
  function E(t) {
208
210
  return t.map((n) => n());
209
211
  }
210
- function Se(t, n, e, r = !1) {
211
- const o = B(), i = ee(), a = () => P(t), l = () => P(n), c = ue(i, e), s = [a, l, c], f = () => o.synchronizeDiscover(...E(s)), h = () => o.discover(...E(s)), u = new ae(o), d = new oe(h), { poll: p, isInitialPolling: y } = J(
212
+ function xe(t, n, e, r = !1) {
213
+ const o = M(), i = Y(), a = () => P(t), l = () => P(n), c = se(i, e), s = [a, l, c], f = () => o.synchronizeDiscover(...E(s)), h = () => o.discover(...E(s)), u = new oe(o), d = new re(h), { poll: p, isInitialPolling: y } = H(
212
214
  u,
213
215
  d,
214
216
  f,
@@ -237,12 +239,12 @@ function Se(t, n, e, r = !1) {
237
239
  isInitialPolling: y
238
240
  };
239
241
  }
240
- function Ee(t, n, e, r = !1) {
241
- const o = B(), i = ee(), a = () => P(t), l = () => P(n), c = ue(i, e), s = [
242
+ function Oe(t, n, e, r = !1) {
243
+ const o = M(), i = Y(), a = () => P(t), l = () => P(n), c = se(i, e), s = [
242
244
  a,
243
245
  l,
244
246
  c
245
- ], f = () => o.synchronizeGet(...E(s)), h = new Oe(), u = () => o.get(...E(s)), d = new xe(u), { poll: p, isInitialPolling: y } = J(
247
+ ], f = () => o.synchronizeGet(...E(s)), h = new je(), u = () => o.get(...E(s)), d = new Pe(u), { poll: p, isInitialPolling: y } = H(
246
248
  h,
247
249
  d,
248
250
  f,
@@ -272,8 +274,8 @@ function Ee(t, n, e, r = !1) {
272
274
  isInitialPolling: y
273
275
  };
274
276
  }
275
- function Ge(t, n, e = !1) {
276
- const r = B(), a = [() => P(t), () => P(n)], l = () => r.synchronizeRecoverOrphans(...E(a)), c = new ae(r), s = () => r.recoverOrphans(...E(a)), f = new oe(s), { poll: h, isInitialPolling: u } = J(
277
+ function Se(t, n, e = !1) {
278
+ const r = M(), a = [() => P(t), () => P(n)], l = () => r.synchronizeRecoverOrphans(...E(a)), c = new oe(r), s = () => r.recoverOrphans(...E(a)), f = new re(s), { poll: h, isInitialPolling: u } = H(
277
279
  c,
278
280
  f,
279
281
  l,
@@ -302,7 +304,7 @@ function Ge(t, n, e = !1) {
302
304
  isInitialPolling: u
303
305
  };
304
306
  }
305
- const ce = /* @__PURE__ */ L({
307
+ const ae = /* @__PURE__ */ W({
306
308
  __name: "Discover",
307
309
  props: {
308
310
  channels: {},
@@ -311,19 +313,19 @@ const ce = /* @__PURE__ */ L({
311
313
  autopoll: { type: Boolean }
312
314
  },
313
315
  setup(t) {
314
- const n = t, { objects: e, poll: r, isInitialPolling: o } = Se(
316
+ const n = t, { objects: e, poll: r, isInitialPolling: o } = xe(
315
317
  b(n, "channels"),
316
318
  b(n, "schema"),
317
319
  b(n, "session"),
318
320
  b(n, "autopoll")
319
321
  );
320
- return (i, a) => W(i.$slots, "default", {
322
+ return (i, a) => J(i.$slots, "default", {
321
323
  objects: g(e),
322
324
  poll: g(r),
323
325
  isInitialPolling: g(o)
324
326
  });
325
327
  }
326
- }), le = /* @__PURE__ */ L({
328
+ }), ue = /* @__PURE__ */ W({
327
329
  __name: "Get",
328
330
  props: {
329
331
  url: {},
@@ -332,19 +334,19 @@ const ce = /* @__PURE__ */ L({
332
334
  autopoll: { type: Boolean }
333
335
  },
334
336
  setup(t) {
335
- const n = t, { object: e, poll: r, isInitialPolling: o } = Ee(
337
+ const n = t, { object: e, poll: r, isInitialPolling: o } = Oe(
336
338
  b(n, "url"),
337
339
  b(n, "schema"),
338
340
  b(n, "session"),
339
341
  b(n, "autopoll")
340
342
  );
341
- return (i, a) => W(i.$slots, "default", {
343
+ return (i, a) => J(i.$slots, "default", {
342
344
  object: g(e),
343
345
  poll: g(r),
344
346
  isInitialPolling: g(o)
345
347
  });
346
348
  }
347
- }), fe = /* @__PURE__ */ L({
349
+ }), ce = /* @__PURE__ */ W({
348
350
  __name: "RecoverOrphans",
349
351
  props: {
350
352
  schema: {},
@@ -352,12 +354,12 @@ const ce = /* @__PURE__ */ L({
352
354
  autopoll: { type: Boolean }
353
355
  },
354
356
  setup(t) {
355
- const n = t, { objects: e, poll: r, isInitialPolling: o } = Ge(
357
+ const n = t, { objects: e, poll: r, isInitialPolling: o } = Se(
356
358
  b(n, "schema"),
357
359
  b(n, "session"),
358
360
  b(n, "autopoll")
359
361
  );
360
- return (i, a) => W(i.$slots, "default", {
362
+ return (i, a) => J(i.$slots, "default", {
361
363
  objects: g(e),
362
364
  poll: g(r),
363
365
  isInitialPolling: g(o)
@@ -378,15 +380,15 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
378
380
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
379
381
  PERFORMANCE OF THIS SOFTWARE.
380
382
  ***************************************************************************** */
381
- var C = function(t, n) {
382
- return C = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
383
+ var $ = function(t, n) {
384
+ return $ = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
383
385
  e.__proto__ = r;
384
386
  } || function(e, r) {
385
387
  for (var o in r) r.hasOwnProperty(o) && (e[o] = r[o]);
386
- }, C(t, n);
388
+ }, $(t, n);
387
389
  };
388
- function _e(t, n) {
389
- C(t, n);
390
+ function Ee(t, n) {
391
+ $(t, n);
390
392
  function e() {
391
393
  this.constructor = t;
392
394
  }
@@ -489,10 +491,10 @@ function _(t) {
489
491
  };
490
492
  throw new TypeError(n ? "Object is not iterable." : "Symbol.iterator is not defined.");
491
493
  }
492
- function z(t) {
493
- return this instanceof z ? (this.v = t, this) : new z(t);
494
+ function R(t) {
495
+ return this instanceof R ? (this.v = t, this) : new R(t);
494
496
  }
495
- function Re(t, n, e) {
497
+ function Ge(t, n, e) {
496
498
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
497
499
  var r = e.apply(t, n || []), o, i = [];
498
500
  return o = {}, a("next"), a("throw"), a("return"), o[Symbol.asyncIterator] = function() {
@@ -513,7 +515,7 @@ function Re(t, n, e) {
513
515
  }
514
516
  }
515
517
  function c(u) {
516
- u.value instanceof z ? Promise.resolve(u.value.v).then(s, f) : h(i[0][2], u);
518
+ u.value instanceof R ? Promise.resolve(u.value.v).then(s, f) : h(i[0][2], u);
517
519
  }
518
520
  function s(u) {
519
521
  l("next", u);
@@ -525,10 +527,10 @@ function Re(t, n, e) {
525
527
  u(d), i.shift(), i.length && l(i[0][0], i[0][1]);
526
528
  }
527
529
  }
528
- var he = (
530
+ var le = (
529
531
  /** @class */
530
532
  function(t) {
531
- _e(n, t);
533
+ Ee(n, t);
532
534
  function n(e) {
533
535
  var r = t.call(this, e) || this;
534
536
  return Object.defineProperty(r, "name", {
@@ -621,10 +623,10 @@ var he = (
621
623
  return this._q.shift();
622
624
  }, t;
623
625
  })();
624
- function $(t) {
625
- t != null && typeof t.then == "function" && t.then(A, A);
626
+ function U(t) {
627
+ t != null && typeof t.then == "function" && t.then(N, N);
626
628
  }
627
- var V = 0, H = 1, O = 2, q = 3, U = 4, D = 1024, A = function() {
629
+ var C = 0, X = 1, O = 2, D = 3, L = 4, A = 1024, N = function() {
628
630
  };
629
631
  function S(t) {
630
632
  var n = t.err, e = Promise.resolve(t.execution).then(function(r) {
@@ -639,9 +641,9 @@ function S(t) {
639
641
  });
640
642
  }
641
643
  function x(t, n) {
642
- var e = t.state >= q;
644
+ var e = t.state >= D;
643
645
  return Promise.resolve(n).then(function(r) {
644
- return !e && t.state >= U ? S(t).then(function(o) {
646
+ return !e && t.state >= L ? S(t).then(function(o) {
645
647
  return {
646
648
  value: o,
647
649
  done: !0
@@ -649,11 +651,11 @@ function x(t, n) {
649
651
  }) : { value: r, done: e };
650
652
  });
651
653
  }
652
- function K(t, n) {
654
+ function Q(t, n) {
653
655
  var e, r;
654
656
  if (!(t.state >= O))
655
657
  if (t.state = O, t.onnext(), t.onstop(), t.err == null && (t.err = n), t.pushes.length === 0 && (typeof t.buffer > "u" || t.buffer.empty))
656
- R(t);
658
+ z(t);
657
659
  else
658
660
  try {
659
661
  for (var o = _(t.pushes), i = o.next(); !i.done; i = o.next()) {
@@ -670,10 +672,10 @@ function K(t, n) {
670
672
  }
671
673
  }
672
674
  }
673
- function R(t) {
675
+ function z(t) {
674
676
  var n, e;
675
- if (!(t.state >= q)) {
676
- t.state < O && K(t), t.state = q, t.buffer = void 0;
677
+ if (!(t.state >= D)) {
678
+ t.state < O && Q(t), t.state = D, t.buffer = void 0;
677
679
  try {
678
680
  for (var r = _(t.nexts), o = r.next(); !o.done; o = r.next()) {
679
681
  var i = o.value, a = t.pending === void 0 ? S(t) : t.pending.then(function() {
@@ -693,19 +695,19 @@ function R(t) {
693
695
  t.pushes = [], t.nexts = [];
694
696
  }
695
697
  }
696
- function Q(t) {
697
- t.state >= U || (t.state < q && R(t), t.state = U);
698
+ function K(t) {
699
+ t.state >= L || (t.state < D && z(t), t.state = L);
698
700
  }
699
- function ze(t, n) {
700
- if ($(n), t.pushes.length >= D)
701
- throw new he("No more than " + D + " pending calls to push are allowed on a single repeater.");
701
+ function _e(t, n) {
702
+ if (U(n), t.pushes.length >= A)
703
+ throw new le("No more than " + A + " pending calls to push are allowed on a single repeater.");
702
704
  if (t.state >= O)
703
705
  return Promise.resolve(void 0);
704
706
  var e = t.pending === void 0 ? Promise.resolve(n) : t.pending.then(function() {
705
707
  return n;
706
708
  });
707
709
  e = e.catch(function(c) {
708
- t.state < O && (t.err = c), Q(t);
710
+ t.state < O && (t.err = c), K(t);
709
711
  });
710
712
  var r;
711
713
  if (t.nexts.length) {
@@ -727,27 +729,27 @@ function ze(t, n) {
727
729
  }, a.finally = r.finally.bind(r), t.pending = e.then(function() {
728
730
  return l;
729
731
  }).catch(function(c) {
730
- t.err = c, Q(t);
732
+ t.err = c, K(t);
731
733
  }), a;
732
734
  }
733
- function Ie(t) {
734
- var n = K.bind(null, t), e = new Promise(function(r) {
735
+ function ze(t) {
736
+ var n = Q.bind(null, t), e = new Promise(function(r) {
735
737
  return t.onstop = r;
736
738
  });
737
739
  return n.then = e.then.bind(e), n.catch = e.catch.bind(e), n.finally = e.finally.bind(e), n;
738
740
  }
739
- function ke(t) {
740
- if (!(t.state >= H)) {
741
- t.state = H;
742
- var n = ze.bind(null, t), e = Ie(t);
741
+ function Re(t) {
742
+ if (!(t.state >= X)) {
743
+ t.state = X;
744
+ var n = _e.bind(null, t), e = ze(t);
743
745
  t.execution = new Promise(function(r) {
744
746
  return r(t.executor(n, e));
745
747
  }), t.execution.catch(function() {
746
- return K(t);
748
+ return Q(t);
747
749
  });
748
750
  }
749
751
  }
750
- var F = /* @__PURE__ */ new WeakMap(), I = (
752
+ var F = /* @__PURE__ */ new WeakMap(), k = (
751
753
  /** @class */
752
754
  function() {
753
755
  function t(n, e) {
@@ -755,23 +757,23 @@ var F = /* @__PURE__ */ new WeakMap(), I = (
755
757
  executor: n,
756
758
  buffer: e,
757
759
  err: void 0,
758
- state: V,
760
+ state: C,
759
761
  pushes: [],
760
762
  nexts: [],
761
763
  pending: void 0,
762
764
  execution: void 0,
763
- onnext: A,
764
- onstop: A
765
+ onnext: N,
766
+ onstop: N
765
767
  });
766
768
  }
767
769
  return t.prototype.next = function(n) {
768
- $(n);
770
+ U(n);
769
771
  var e = F.get(this);
770
772
  if (e === void 0)
771
773
  throw new Error("WeakMap error");
772
- if (e.nexts.length >= D)
773
- throw new he("No more than " + D + " pending calls to next are allowed on a single repeater.");
774
- if (e.state <= V && ke(e), e.onnext(n), typeof e.buffer < "u" && !e.buffer.empty) {
774
+ if (e.nexts.length >= A)
775
+ throw new le("No more than " + A + " pending calls to next are allowed on a single repeater.");
776
+ if (e.state <= C && Re(e), e.onnext(n), typeof e.buffer < "u" && !e.buffer.empty) {
775
777
  var r = x(e, e.buffer.remove());
776
778
  if (e.pushes.length) {
777
779
  var o = e.pushes.shift();
@@ -782,42 +784,42 @@ var F = /* @__PURE__ */ new WeakMap(), I = (
782
784
  var i = e.pushes.shift();
783
785
  return e.onnext = i.resolve, x(e, i.value);
784
786
  } else if (e.state >= O)
785
- return R(e), x(e, S(e));
787
+ return z(e), x(e, S(e));
786
788
  return new Promise(function(a) {
787
789
  return e.nexts.push({ resolve: a, value: n });
788
790
  });
789
791
  }, t.prototype.return = function(n) {
790
- $(n);
792
+ U(n);
791
793
  var e = F.get(this);
792
794
  if (e === void 0)
793
795
  throw new Error("WeakMap error");
794
- return R(e), e.execution = Promise.resolve(e.execution).then(function() {
796
+ return z(e), e.execution = Promise.resolve(e.execution).then(function() {
795
797
  return n;
796
798
  }), x(e, S(e));
797
799
  }, t.prototype.throw = function(n) {
798
800
  var e = F.get(this);
799
801
  if (e === void 0)
800
802
  throw new Error("WeakMap error");
801
- return e.state <= V || e.state >= O || typeof e.buffer < "u" && !e.buffer.empty ? (R(e), e.err == null && (e.err = n), x(e, S(e))) : this.next(Promise.reject(n));
803
+ return e.state <= C || e.state >= O || typeof e.buffer < "u" && !e.buffer.empty ? (z(e), e.err == null && (e.err = n), x(e, S(e))) : this.next(Promise.reject(n));
802
804
  }, t.prototype[Symbol.asyncIterator] = function() {
803
805
  return this;
804
- }, t.race = Te, t.merge = Fe, t.zip = qe, t.latest = De, t;
806
+ }, t.race = ke, t.merge = Ie, t.zip = Te, t.latest = Fe, t;
805
807
  }()
806
808
  );
807
- function M(t, n) {
809
+ function V(t, n) {
808
810
  var e, r, o = [], i = function(s) {
809
811
  s != null && typeof s[Symbol.asyncIterator] == "function" ? o.push(s[Symbol.asyncIterator]()) : s != null && typeof s[Symbol.iterator] == "function" ? o.push(s[Symbol.iterator]()) : o.push(function() {
810
- return Re(this, arguments, function() {
812
+ return Ge(this, arguments, function() {
811
813
  return j(this, function(u) {
812
814
  switch (u.label) {
813
815
  case 0:
814
- return n.yieldValues ? [4, z(s)] : [3, 3];
816
+ return n.yieldValues ? [4, R(s)] : [3, 3];
815
817
  case 1:
816
818
  return [4, u.sent()];
817
819
  case 2:
818
820
  u.sent(), u.label = 3;
819
821
  case 3:
820
- return n.returnValues ? [4, z(s)] : [3, 5];
822
+ return n.returnValues ? [4, R(s)] : [3, 5];
821
823
  case 4:
822
824
  return [2, u.sent()];
823
825
  case 5:
@@ -846,9 +848,9 @@ function M(t, n) {
846
848
  }
847
849
  return o;
848
850
  }
849
- function Te(t) {
850
- var n = this, e = M(t, { returnValues: !0 });
851
- return new I(function(r, o) {
851
+ function ke(t) {
852
+ var n = this, e = V(t, { returnValues: !0 });
853
+ return new k(function(r, o) {
852
854
  return G(n, void 0, void 0, function() {
853
855
  var i, a, l, c, s, f;
854
856
  return j(this, function(h) {
@@ -864,7 +866,7 @@ function Te(t) {
864
866
  }), h.label = 1;
865
867
  case 1:
866
868
  h.trys.push([1, , 5, 7]), c = void 0, s = 0, f = function() {
867
- var u, d, p, y, m, k;
869
+ var u, d, p, y, m, I;
868
870
  return j(this, function(T) {
869
871
  switch (T.label) {
870
872
  case 0:
@@ -880,7 +882,7 @@ function Te(t) {
880
882
  m = { error: w };
881
883
  } finally {
882
884
  try {
883
- p && !p.done && (k = d.return) && k.call(d);
885
+ p && !p.done && (I = d.return) && I.call(d);
884
886
  } finally {
885
887
  if (m) throw m.error;
886
888
  }
@@ -925,9 +927,9 @@ function Te(t) {
925
927
  });
926
928
  });
927
929
  }
928
- function Fe(t) {
929
- var n = this, e = M(t, { yieldValues: !0 });
930
- return new I(function(r, o) {
930
+ function Ie(t) {
931
+ var n = this, e = V(t, { yieldValues: !0 });
932
+ return new k(function(r, o) {
931
933
  return G(n, void 0, void 0, function() {
932
934
  var i, a, l, c = this;
933
935
  return j(this, function(s) {
@@ -1018,9 +1020,9 @@ function Fe(t) {
1018
1020
  });
1019
1021
  });
1020
1022
  }
1021
- function qe(t) {
1022
- var n = this, e = M(t, { returnValues: !0 });
1023
- return new I(function(r, o) {
1023
+ function Te(t) {
1024
+ var n = this, e = V(t, { returnValues: !0 });
1025
+ return new k(function(r, o) {
1024
1026
  return G(n, void 0, void 0, function() {
1025
1027
  var i, a, l, c;
1026
1028
  return j(this, function(s) {
@@ -1075,12 +1077,12 @@ function qe(t) {
1075
1077
  });
1076
1078
  });
1077
1079
  }
1078
- function De(t) {
1079
- var n = this, e = M(t, {
1080
+ function Fe(t) {
1081
+ var n = this, e = V(t, {
1080
1082
  yieldValues: !0,
1081
1083
  returnValues: !0
1082
1084
  });
1083
- return new I(function(r, o) {
1085
+ return new k(function(r, o) {
1084
1086
  return G(n, void 0, void 0, function() {
1085
1087
  var i, a, l, c, s, f = this;
1086
1088
  return j(this, function(h) {
@@ -1096,8 +1098,8 @@ function De(t) {
1096
1098
  var m = y.value;
1097
1099
  m();
1098
1100
  }
1099
- } catch (k) {
1100
- u = { error: k };
1101
+ } catch (I) {
1102
+ u = { error: I };
1101
1103
  } finally {
1102
1104
  try {
1103
1105
  y && !y.done && (d = p.return) && d.call(p);
@@ -1178,36 +1180,36 @@ function De(t) {
1178
1180
  });
1179
1181
  });
1180
1182
  }
1181
- function Ae(t) {
1183
+ function qe(t) {
1182
1184
  return typeof t == "string" ? t : t.url;
1183
1185
  }
1184
- function Ne(t, n, e, r) {
1186
+ function De(t, n, e, r) {
1185
1187
  const o = e[n];
1186
1188
  if (!(!o || !o.length))
1187
1189
  try {
1188
1190
  r[n] = t(r[n], o, !0, !1).newDocument;
1189
1191
  } catch (i) {
1190
- throw typeof i == "object" && i && "name" in i && typeof i.name == "string" && "message" in i && typeof i.message == "string" ? i.name === "TEST_OPERATION_FAILED" ? new Pe(i.message) : new je(i.name + ": " + i.message) : i;
1192
+ throw typeof i == "object" && i && "name" in i && typeof i.name == "string" && "message" in i && typeof i.message == "string" ? i.name === "TEST_OPERATION_FAILED" ? new we(i.message) : new ge(i.name + ": " + i.message) : i;
1191
1193
  }
1192
1194
  }
1193
- function Be(t, n) {
1195
+ function Ae(t, n) {
1194
1196
  try {
1195
1197
  return t.compile(n);
1196
1198
  } catch (e) {
1197
- throw new ge(
1199
+ throw new be(
1198
1200
  e instanceof Error ? e.message : void 0
1199
1201
  );
1200
1202
  }
1201
1203
  }
1202
- function Me(t, n, e) {
1204
+ function Ne(t, n, e) {
1203
1205
  t.actor !== (e == null ? void 0 : e.actor) && (t.allowed = t.allowed && e ? [e.actor] : void 0, t.channels = t.channels.filter(
1204
1206
  (r) => n.includes(r)
1205
1207
  ));
1206
1208
  }
1207
- function Ve(t, n) {
1209
+ function Be(t, n) {
1208
1210
  return t.allowed === void 0 || t.allowed === null || !!(n != null && n.actor) && (t.actor === n.actor || t.allowed.includes(n.actor));
1209
1211
  }
1210
- class Ce extends be {
1212
+ class Me extends ve {
1211
1213
  /**
1212
1214
  * Wraps a Graffiti API instance to provide the synchronize methods.
1213
1215
  * The GraffitiSyncrhonize class rather than the Graffiti class
@@ -1249,7 +1251,7 @@ class Ce extends be {
1249
1251
  v(this, "patch", async (...e) => {
1250
1252
  const r = await this.graffiti.patch(...e), o = { ...r };
1251
1253
  for (const i of ["value", "channels", "allowed"])
1252
- Ne(await this.applyPatch, i, e[0], o);
1254
+ De(await this.applyPatch, i, e[0], o);
1253
1255
  return await this.synchronizeDispatch(
1254
1256
  {
1255
1257
  tombstone: !0,
@@ -1297,17 +1299,17 @@ class Ce extends be {
1297
1299
  }
1298
1300
  synchronize(e, r, o, i) {
1299
1301
  const a = /* @__PURE__ */ new Set();
1300
- return new I(
1302
+ return new k(
1301
1303
  async (c, s) => {
1302
- const f = Be(await this.ajv, o), h = (u, d) => {
1304
+ const f = Ae(await this.ajv, o), h = (u, d) => {
1303
1305
  for (const p of [d, u])
1304
1306
  if (p != null && p.tombstone)
1305
1307
  a.has(p.object.url) && c(p);
1306
- else if (p && e(p.object) && (this.options.omniscient || Ve(p.object, i))) {
1308
+ else if (p && e(p.object) && (this.options.omniscient || Be(p.object, i))) {
1307
1309
  const y = JSON.parse(
1308
1310
  JSON.stringify(p.object)
1309
1311
  );
1310
- if (this.options.omniscient || Me(y, r, i), f(y)) {
1312
+ if (this.options.omniscient || Ne(y, r, i), f(y)) {
1311
1313
  c({ object: y }), a.add(y.url);
1312
1314
  break;
1313
1315
  }
@@ -1350,7 +1352,7 @@ class Ce extends be {
1350
1352
  * @group Synchronize Methods
1351
1353
  */
1352
1354
  synchronizeGet(...e) {
1353
- const [r, o, i] = e, a = Ae(r);
1355
+ const [r, o, i] = e, a = qe(r);
1354
1356
  function l(c) {
1355
1357
  return c.url === a;
1356
1358
  }
@@ -1423,9 +1425,9 @@ class Ce extends be {
1423
1425
  }();
1424
1426
  }
1425
1427
  }
1426
- const We = {
1428
+ const Ue = {
1427
1429
  install(t, n) {
1428
- const e = n.graffiti, r = new Ce(e), o = N(void 0);
1430
+ const e = n.graffiti, r = new Me(e), o = B(void 0);
1429
1431
  r.sessionEvents.addEventListener("initialized", async (i) => {
1430
1432
  const a = i.detail;
1431
1433
  if (a && a.error && console.error(a.error), a && a.href) {
@@ -1446,19 +1448,19 @@ const We = {
1446
1448
  }), r.sessionEvents.addEventListener("logout", (i) => {
1447
1449
  const a = i.detail;
1448
1450
  a.error ? (console.error("Error logging out:"), console.error(a.error)) : o.value = null;
1449
- }), t.provide(Y, r), t.provide(Z, o), t.component("GraffitiDiscover", ce), t.component("GraffitiGet", le), t.component("GraffitiRecoverOrphans", fe), t.config.globalProperties.$graffiti = r, t.config.globalProperties.$graffitiSession = o;
1451
+ }), q.graffitiSynchronize = r, q.graffitiSession = o, t.component("GraffitiDiscover", ae), t.component("GraffitiGet", ue), t.component("GraffitiRecoverOrphans", ce), t.config.globalProperties.$graffiti = r, t.config.globalProperties.$graffitiSession = o;
1450
1452
  }
1451
- }, Je = ce, Ke = le, He = fe;
1453
+ }, Le = ae, We = ue, Je = ce;
1452
1454
  export {
1453
- Je as GraffitiDiscover,
1454
- Ke as GraffitiGet,
1455
- We as GraffitiPlugin,
1456
- He as GraffitiRecoverOrphans,
1457
- Le as useGraffiti,
1458
- Se as useGraffitiDiscover,
1459
- Ee as useGraffitiGet,
1460
- Ge as useGraffitiRecoverOrphans,
1461
- ee as useGraffitiSession,
1462
- B as useGraffitiSynchronize
1455
+ Le as GraffitiDiscover,
1456
+ We as GraffitiGet,
1457
+ Ue as GraffitiPlugin,
1458
+ Je as GraffitiRecoverOrphans,
1459
+ $e as useGraffiti,
1460
+ xe as useGraffitiDiscover,
1461
+ Oe as useGraffitiGet,
1462
+ Se as useGraffitiRecoverOrphans,
1463
+ Y as useGraffitiSession,
1464
+ M as useGraffitiSynchronize
1463
1465
  };
1464
1466
  //# sourceMappingURL=plugin.mjs.map