@instantdb/react-common 0.22.75 → 0.22.76

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.
@@ -50,15 +50,15 @@ function Ki() {
50
50
  {
51
51
  for (var _ = arguments.length, w = new Array(_ > 1 ? _ - 1 : 0), O = 1; O < _; O++)
52
52
  w[O - 1] = arguments[O];
53
- j("error", h, w);
53
+ k("error", h, w);
54
54
  }
55
55
  }
56
- function j(h, _, w) {
56
+ function k(h, _, w) {
57
57
  {
58
58
  var O = T.ReactDebugCurrentFrame, C = O.getStackAddendum();
59
59
  C !== "" && (_ += "%s", w = w.concat([C]));
60
- var P = w.map(function(k) {
61
- return String(k);
60
+ var P = w.map(function(j) {
61
+ return String(j);
62
62
  });
63
63
  P.unshift("Warning: " + _), Function.prototype.apply.call(console[h], console, P);
64
64
  }
@@ -117,9 +117,9 @@ function Ki() {
117
117
  var O = h.displayName || null;
118
118
  return O !== null ? O : ne(h.type) || "Memo";
119
119
  case p: {
120
- var C = h, P = C._payload, k = C._init;
120
+ var C = h, P = C._payload, j = C._init;
121
121
  try {
122
- return ne(k(P));
122
+ return ne(j(P));
123
123
  } catch {
124
124
  return null;
125
125
  }
@@ -224,27 +224,27 @@ function Ki() {
224
224
  P = Tt.current, Tt.current = null, hi();
225
225
  try {
226
226
  if (_) {
227
- var k = function() {
227
+ var j = function() {
228
228
  throw Error();
229
229
  };
230
- if (Object.defineProperty(k.prototype, "props", {
230
+ if (Object.defineProperty(j.prototype, "props", {
231
231
  set: function() {
232
232
  throw Error();
233
233
  }
234
234
  }), typeof Reflect == "object" && Reflect.construct) {
235
235
  try {
236
- Reflect.construct(k, []);
236
+ Reflect.construct(j, []);
237
237
  } catch (W) {
238
238
  O = W;
239
239
  }
240
- Reflect.construct(h, [], k);
240
+ Reflect.construct(h, [], j);
241
241
  } else {
242
242
  try {
243
- k.call();
243
+ j.call();
244
244
  } catch (W) {
245
245
  O = W;
246
246
  }
247
- h.call(k.prototype);
247
+ h.call(j.prototype);
248
248
  }
249
249
  } else {
250
250
  try {
@@ -326,19 +326,19 @@ function Ki() {
326
326
  function gi(h, _, w, O, C) {
327
327
  {
328
328
  var P = Function.call.bind(Re);
329
- for (var k in h)
330
- if (P(h, k)) {
329
+ for (var j in h)
330
+ if (P(h, j)) {
331
331
  var E = void 0;
332
332
  try {
333
- if (typeof h[k] != "function") {
334
- var z = Error((O || "React class") + ": " + w + " type `" + k + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof h[k] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
333
+ if (typeof h[j] != "function") {
334
+ var z = Error((O || "React class") + ": " + w + " type `" + j + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof h[j] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
335
335
  throw z.name = "Invariant Violation", z;
336
336
  }
337
- E = h[k](_, k, O, w, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
+ E = h[j](_, j, O, w, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
338
338
  } catch ($) {
339
339
  E = $;
340
340
  }
341
- E && !(E instanceof Error) && (Xe(C), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", O || "React class", w, k, typeof E), Xe(null)), E instanceof Error && !(E.message in Sn) && (Sn[E.message] = !0, Xe(C), v("Failed %s type: %s", w, E.message), Xe(null));
341
+ E && !(E instanceof Error) && (Xe(C), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", O || "React class", w, j, typeof E), Xe(null)), E instanceof Error && !(E.message in Sn) && (Sn[E.message] = !0, Xe(C), v("Failed %s type: %s", w, E.message), Xe(null));
342
342
  }
343
343
  }
344
344
  }
@@ -366,12 +366,12 @@ function Ki() {
366
366
  if (wi(h))
367
367
  return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", mi(h)), En(h);
368
368
  }
369
- var kn = T.ReactCurrentOwner, vi = {
369
+ var jn = T.ReactCurrentOwner, vi = {
370
370
  key: !0,
371
371
  ref: !0,
372
372
  __self: !0,
373
373
  __source: !0
374
- }, jn, Cn;
374
+ }, kn, Cn;
375
375
  function Si(h) {
376
376
  if (Re.call(h, "ref")) {
377
377
  var _ = Object.getOwnPropertyDescriptor(h, "ref").get;
@@ -389,12 +389,12 @@ function Ki() {
389
389
  return h.key !== void 0;
390
390
  }
391
391
  function Ei(h, _) {
392
- typeof h.ref == "string" && kn.current;
392
+ typeof h.ref == "string" && jn.current;
393
393
  }
394
394
  function Ai(h, _) {
395
395
  {
396
396
  var w = function() {
397
- jn || (jn = !0, v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", _));
397
+ kn || (kn = !0, v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", _));
398
398
  };
399
399
  w.isReactWarning = !0, Object.defineProperty(h, "key", {
400
400
  get: w,
@@ -402,7 +402,7 @@ function Ki() {
402
402
  });
403
403
  }
404
404
  }
405
- function ki(h, _) {
405
+ function ji(h, _) {
406
406
  {
407
407
  var w = function() {
408
408
  Cn || (Cn = !0, v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", _));
@@ -413,7 +413,7 @@ function Ki() {
413
413
  });
414
414
  }
415
415
  }
416
- var ji = function(h, _, w, O, C, P, k) {
416
+ var ki = function(h, _, w, O, C, P, j) {
417
417
  var E = {
418
418
  // This tag allows us to uniquely identify this as a React Element
419
419
  $$typeof: n,
@@ -421,7 +421,7 @@ function Ki() {
421
421
  type: h,
422
422
  key: _,
423
423
  ref: w,
424
- props: k,
424
+ props: j,
425
425
  // Record the component responsible for creating this element.
426
426
  _owner: P
427
427
  };
@@ -444,20 +444,20 @@ function Ki() {
444
444
  };
445
445
  function Ci(h, _, w, O, C) {
446
446
  {
447
- var P, k = {}, E = null, z = null;
447
+ var P, j = {}, E = null, z = null;
448
448
  w !== void 0 && (An(w), E = "" + w), Oi(_) && (An(_.key), E = "" + _.key), Si(_) && (z = _.ref, Ei(_, C));
449
449
  for (P in _)
450
- Re.call(_, P) && !vi.hasOwnProperty(P) && (k[P] = _[P]);
450
+ Re.call(_, P) && !vi.hasOwnProperty(P) && (j[P] = _[P]);
451
451
  if (h && h.defaultProps) {
452
452
  var $ = h.defaultProps;
453
453
  for (P in $)
454
- k[P] === void 0 && (k[P] = $[P]);
454
+ j[P] === void 0 && (j[P] = $[P]);
455
455
  }
456
456
  if (E || z) {
457
457
  var D = typeof h == "function" ? h.displayName || h.name || "Unknown" : h;
458
- E && Ai(k, D), z && ki(k, D);
458
+ E && Ai(j, D), z && ji(j, D);
459
459
  }
460
- return ji(h, E, z, C, O, kn.current, k);
460
+ return ki(h, E, z, C, O, jn.current, j);
461
461
  }
462
462
  }
463
463
  var St = T.ReactCurrentOwner, Pn = T.ReactDebugCurrentFrame;
@@ -528,8 +528,8 @@ Check the top-level render call using <` + w + ">.");
528
528
  else if (h) {
529
529
  var C = m(h);
530
530
  if (typeof C == "function" && C !== h.entries)
531
- for (var P = C.call(h), k; !(k = P.next()).done; )
532
- Et(k.value) && Rn(k.value, _);
531
+ for (var P = C.call(h), j; !(j = P.next()).done; )
532
+ Et(j.value) && Rn(j.value, _);
533
533
  }
534
534
  }
535
535
  }
@@ -573,8 +573,8 @@ Check the top-level render call using <` + w + ">.");
573
573
  var xn = {};
574
574
  function Dn(h, _, w, O, C, P) {
575
575
  {
576
- var k = _t(h);
577
- if (!k) {
576
+ var j = _t(h);
577
+ if (!j) {
578
578
  var E = "";
579
579
  (h === void 0 || typeof h == "object" && h !== null && Object.keys(h).length === 0) && (E += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
580
580
  var z = Pi();
@@ -585,7 +585,7 @@ Check the top-level render call using <` + w + ">.");
585
585
  var D = Ci(h, _, w, C, P);
586
586
  if (D == null)
587
587
  return D;
588
- if (k) {
588
+ if (j) {
589
589
  var J = _.children;
590
590
  if (J !== void 0)
591
591
  if (O)
@@ -744,7 +744,7 @@ function ce(t, e) {
744
744
  function We(t, e, n) {
745
745
  me(t) === 2 ? t.set(e, n) : t[e] = n;
746
746
  }
747
- function kt(t, e) {
747
+ function jt(t, e) {
748
748
  const n = A(t);
749
749
  return (n ? H(n) : t)[e];
750
750
  }
@@ -787,7 +787,7 @@ function Wi(t) {
787
787
  }), e;
788
788
  }
789
789
  const Bi = Object.prototype.propertyIsEnumerable;
790
- function kr(t, e) {
790
+ function jr(t, e) {
791
791
  let n;
792
792
  if (Array.isArray(t))
793
793
  return Array.prototype.concat.call(t);
@@ -823,7 +823,7 @@ function kr(t, e) {
823
823
  throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
824
824
  }
825
825
  function V(t) {
826
- t.copy || (t.copy = kr(t.original, t.options));
826
+ t.copy || (t.copy = jr(t.original, t.options));
827
827
  }
828
828
  function Ue(t) {
829
829
  if (!ee(t))
@@ -923,7 +923,7 @@ function rn(t, e) {
923
923
  } else
924
924
  t.forEach((r, i) => e(i, r, t));
925
925
  }
926
- function jr(t, e, n) {
926
+ function kr(t, e, n) {
927
927
  if (Te(t) || !ee(t, n) || e.has(t) || Object.isFrozen(t))
928
928
  return;
929
929
  const r = t instanceof Set, i = r ? /* @__PURE__ */ new Map() : void 0;
@@ -935,7 +935,7 @@ function jr(t, e, n) {
935
935
  const d = !((u = a.assignedMap) === null || u === void 0) && u.size || a.operated ? a.copy : a.original;
936
936
  We(r ? i : t, s, d);
937
937
  } else
938
- jr(o, e, n);
938
+ kr(o, e, n);
939
939
  }), i) {
940
940
  const s = t, o = Array.from(s);
941
941
  s.clear(), o.forEach((u) => {
@@ -945,7 +945,7 @@ function jr(t, e, n) {
945
945
  }
946
946
  function Gi(t, e) {
947
947
  const n = t.type === 3 ? t.setMap : t.copy;
948
- t.finalities.revoke.length > 1 && t.assignedMap.get(e) && n && jr(ce(n, e), t.finalities.handledSet, t.options);
948
+ t.finalities.revoke.length > 1 && t.assignedMap.get(e) && n && kr(ce(n, e), t.finalities.handledSet, t.options);
949
949
  }
950
950
  function Dt(t) {
951
951
  t.type === 3 && t.copy && (t.copy.clear(), t.setMap.forEach((e) => {
@@ -1308,7 +1308,7 @@ const Zi = Reflect.ownKeys(dt), Cr = /* @__PURE__ */ new WeakSet(), Pr = {
1308
1308
  const a = u[e];
1309
1309
  if (t.options.strict && ct(a, t.options), t.finalized || !ee(a, t.options))
1310
1310
  return a;
1311
- if (a === kt(t.original, e)) {
1311
+ if (a === jt(t.original, e)) {
1312
1312
  if (V(t), t.copy[e] = on({
1313
1313
  original: t.original[e],
1314
1314
  parentDraft: t,
@@ -1333,7 +1333,7 @@ const Zi = Reflect.ownKeys(dt), Cr = /* @__PURE__ */ new WeakSet(), Pr = {
1333
1333
  const s = Fn(H(t), e);
1334
1334
  if (s != null && s.set)
1335
1335
  return s.set.call(t.proxy, n), !0;
1336
- const o = kt(H(t), e), u = A(o);
1336
+ const o = jt(H(t), e), u = A(o);
1337
1337
  return u && ae(u.original, n) ? (t.copy[e] = n, t.assignedMap = (r = t.assignedMap) !== null && r !== void 0 ? r : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (ae(n, o) && (n !== void 0 || Ne(t.original, e)) || (V(t), ie(t), Ne(t.original, e) && ae(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n, sn(t, e, n, Ve)), !0);
1338
1338
  },
1339
1339
  has(t, e) {
@@ -1362,7 +1362,7 @@ const Zi = Reflect.ownKeys(dt), Cr = /* @__PURE__ */ new WeakSet(), Pr = {
1362
1362
  },
1363
1363
  deleteProperty(t, e) {
1364
1364
  var n;
1365
- return t.type === 1 ? Pr.set.call(this, t, e, void 0, t.proxy) : (kt(t.original, e) !== void 0 || e in t.original ? (V(t), ie(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (n = t.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
1365
+ return t.type === 1 ? Pr.set.call(this, t, e, void 0, t.proxy) : (jt(t.original, e) !== void 0 || e in t.original ? (V(t), ie(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (n = t.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
1366
1366
  }
1367
1367
  };
1368
1368
  function on(t) {
@@ -1465,7 +1465,7 @@ function Ir(t) {
1465
1465
  return n.original;
1466
1466
  let i;
1467
1467
  function s() {
1468
- i = r === 2 ? tn(t) ? new Map(t) : new (Object.getPrototypeOf(t)).constructor(t) : r === 3 ? Array.from(n.setMap.values()) : kr(t, n == null ? void 0 : n.options);
1468
+ i = r === 2 ? tn(t) ? new Map(t) : new (Object.getPrototypeOf(t)).constructor(t) : r === 3 ? Array.from(n.setMap.values()) : jr(t, n == null ? void 0 : n.options);
1469
1469
  }
1470
1470
  if (n) {
1471
1471
  n.finalized = !0;
@@ -1531,7 +1531,7 @@ const ts = (t) => function e(n, r, i) {
1531
1531
  } catch (S) {
1532
1532
  throw xt(A(m)), S;
1533
1533
  }
1534
- const j = (S) => {
1534
+ const k = (S) => {
1535
1535
  const I = A(m);
1536
1536
  if (!Te(S)) {
1537
1537
  if (S !== void 0 && !ae(S, m) && (I != null && I.operated))
@@ -1558,9 +1558,9 @@ const ts = (t) => function e(n, r, i) {
1558
1558
  }
1559
1559
  return T([S]);
1560
1560
  };
1561
- return v instanceof Promise ? v.then(j, (S) => {
1561
+ return v instanceof Promise ? v.then(k, (S) => {
1562
1562
  throw xt(A(m)), S;
1563
- }) : j(v);
1563
+ }) : k(v);
1564
1564
  }, ft = ts();
1565
1565
  Object.prototype.constructor.toString();
1566
1566
  function Mr(t, e) {
@@ -1960,7 +1960,7 @@ function an(t) {
1960
1960
  function cn(t) {
1961
1961
  return t["value-type"] === "blob";
1962
1962
  }
1963
- function je(t, e) {
1963
+ function ke(t, e) {
1964
1964
  return t[e];
1965
1965
  }
1966
1966
  function Ce(t, e) {
@@ -1991,7 +1991,7 @@ function xr(t, e, n) {
1991
1991
  const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
1992
1992
  for (const o of e) {
1993
1993
  let [u, a, d, c] = o;
1994
- const f = je(t, a);
1994
+ const f = ke(t, a);
1995
1995
  if (!f) {
1996
1996
  console.warn("no such attr", u, t);
1997
1997
  continue;
@@ -2065,7 +2065,7 @@ function Fr(t, e) {
2065
2065
  const n = Be(t, e);
2066
2066
  if (!n)
2067
2067
  return;
2068
- const [r, i, s] = n, o = je(t.attrs, i);
2068
+ const [r, i, s] = n, o = ke(t.attrs, i);
2069
2069
  o && (X(t.eav, [r, i, s]), X(t.aev, [i, r, s]), an(o) && X(t.vae, [s, i, r]));
2070
2070
  }
2071
2071
  let vs = 0;
@@ -2081,7 +2081,7 @@ function Kr(t, e) {
2081
2081
  if (!r)
2082
2082
  return;
2083
2083
  let [i, s, o] = r;
2084
- const u = je(t.attrs, s);
2084
+ const u = ke(t.attrs, s);
2085
2085
  if (!u)
2086
2086
  return;
2087
2087
  u["checked-data-type"] === "date" && t.useDateObjects && (o = pt(o));
@@ -2093,7 +2093,7 @@ function Ss(t, e) {
2093
2093
  const r = Be(t, e);
2094
2094
  if (!r)
2095
2095
  return;
2096
- const [i, s, o] = r, u = je(t.attrs, s);
2096
+ const [i, s, o] = r, u = ke(t.attrs, s);
2097
2097
  if (!u)
2098
2098
  return;
2099
2099
  if (!cn(u))
@@ -2161,7 +2161,7 @@ function As(t, [e]) {
2161
2161
  const n = t.attrs[e.id];
2162
2162
  n && (t.attrs[e.id] = Object.assign(Object.assign({}, n), e), dn(t), qr(t, zr(t)));
2163
2163
  }
2164
- function ks(t, e) {
2164
+ function js(t, e) {
2165
2165
  const [n, ...r] = e;
2166
2166
  switch (n) {
2167
2167
  case "add-triple":
@@ -2238,13 +2238,13 @@ function tt(t, e, n) {
2238
2238
  }
2239
2239
  return s;
2240
2240
  }
2241
- function js(t, e, n) {
2241
+ function ks(t, e, n) {
2242
2242
  let r = "";
2243
2243
  return t !== void 0 && (r += "e"), e !== void 0 && (r += "a"), n !== void 0 && (r += "v"), r;
2244
2244
  }
2245
2245
  function Cs(t, [e, n, r]) {
2246
2246
  var i, s;
2247
- switch (js(e, n, r)) {
2247
+ switch (ks(e, n, r)) {
2248
2248
  case "e": {
2249
2249
  const u = t.eav.get(e);
2250
2250
  return G(u, 2);
@@ -2321,7 +2321,7 @@ function Ms(t, e) {
2321
2321
  if (!n)
2322
2322
  return;
2323
2323
  const [r, i, s] = n;
2324
- if (je(t.attrs, i))
2324
+ if (ke(t.attrs, i))
2325
2325
  return Ce(t.eav, [r, i]);
2326
2326
  }
2327
2327
  function Rs(t, e) {
@@ -2332,7 +2332,7 @@ function Rs(t, e) {
2332
2332
  if (a !== "create" && a !== "update")
2333
2333
  return !0;
2334
2334
  let d = !1;
2335
- const c = je(t.attrs, s);
2335
+ const c = ke(t.attrs, s);
2336
2336
  if (c) {
2337
2337
  const f = Wr(t, c["forward-identity"][1]);
2338
2338
  d = !!Ms(t, [i, f.id, i]);
@@ -2341,7 +2341,7 @@ function Rs(t, e) {
2341
2341
  });
2342
2342
  return ft(t, (r) => {
2343
2343
  n.forEach((i) => {
2344
- ks(r, i);
2344
+ js(r, i);
2345
2345
  });
2346
2346
  });
2347
2347
  }
@@ -2417,15 +2417,15 @@ for (let t = 0; t < 256; ++t)
2417
2417
  function Ws(t, e = 0) {
2418
2418
  return (F[t[e + 0]] + F[t[e + 1]] + F[t[e + 2]] + F[t[e + 3]] + "-" + F[t[e + 4]] + F[t[e + 5]] + "-" + F[t[e + 6]] + F[t[e + 7]] + "-" + F[t[e + 8]] + F[t[e + 9]] + "-" + F[t[e + 10]] + F[t[e + 11]] + F[t[e + 12]] + F[t[e + 13]] + F[t[e + 14]] + F[t[e + 15]]).toLowerCase();
2419
2419
  }
2420
- let jt;
2420
+ let kt;
2421
2421
  const Bs = new Uint8Array(16);
2422
2422
  function Gs() {
2423
- if (!jt) {
2423
+ if (!kt) {
2424
2424
  if (typeof crypto > "u" || !crypto.getRandomValues)
2425
2425
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
2426
- jt = crypto.getRandomValues.bind(crypto);
2426
+ kt = crypto.getRandomValues.bind(crypto);
2427
2427
  }
2428
- return jt(Bs);
2428
+ return kt(Bs);
2429
2429
  }
2430
2430
  const Qs = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Gn = { randomUUID: Qs };
2431
2431
  function Hs(t, e, n) {
@@ -2705,12 +2705,12 @@ function _o(t, e, { etype: n, level: r, form: i }, s) {
2705
2705
  var p, y, b;
2706
2706
  const g = !!(e.cardinalityInference && (!((b = (y = (p = e.linkIndex) === null || p === void 0 ? void 0 : p[n]) === null || y === void 0 ? void 0 : y[l]) === null || b === void 0) && b.isSingular));
2707
2707
  try {
2708
- const [m, T, v] = bo(t, e, n, r, l, a), j = Yr(e, {
2708
+ const [m, T, v] = bo(t, e, n, r, l, a), k = Yr(e, {
2709
2709
  etype: m,
2710
2710
  level: T,
2711
2711
  form: i[l],
2712
2712
  join: v
2713
- }), S = g ? j[0] : j;
2713
+ }), S = g ? k[0] : k;
2714
2714
  return { [l]: S };
2715
2715
  } catch (m) {
2716
2716
  if (m instanceof Ae)
@@ -2779,8 +2779,8 @@ function Oo(t, { etype: e, pageInfo: n, dq: r, form: i }) {
2779
2779
  if (l && ((o = l == null ? void 0 : l["forward-identity"]) === null || o === void 0 ? void 0 : o[2]) !== "id") {
2780
2780
  const b = l["checked-data-type"] === "date", g = l.id;
2781
2781
  c = c.map(([m]) => {
2782
- var T, v, j, S, I;
2783
- let R = (I = (S = (j = (v = (T = t.eav.get(m)) === null || T === void 0 ? void 0 : T.get(g)) === null || v === void 0 ? void 0 : v.values()) === null || j === void 0 ? void 0 : j.next()) === null || S === void 0 ? void 0 : S.value) === null || I === void 0 ? void 0 : I[2];
2782
+ var T, v, k, S, I;
2783
+ let R = (I = (S = (k = (v = (T = t.eav.get(m)) === null || T === void 0 ? void 0 : T.get(g)) === null || v === void 0 ? void 0 : v.values()) === null || k === void 0 ? void 0 : k.next()) === null || S === void 0 ? void 0 : S.value) === null || I === void 0 ? void 0 : I[2];
2784
2784
  return b && (R = Vt(R)), [m, R];
2785
2785
  });
2786
2786
  }
@@ -2827,7 +2827,7 @@ function Ao(t, { etype: e, level: n, form: r, join: i, pageInfo: s }) {
2827
2827
  }
2828
2828
  return y;
2829
2829
  }
2830
- function ko(t, e) {
2830
+ function jo(t, e) {
2831
2831
  try {
2832
2832
  return Ao(t, e);
2833
2833
  } catch (n) {
@@ -2837,10 +2837,10 @@ function ko(t, e) {
2837
2837
  }
2838
2838
  }
2839
2839
  function Yr(t, e) {
2840
- const n = ko(t, e);
2840
+ const n = jo(t, e);
2841
2841
  return _o(yt, t, e, n);
2842
2842
  }
2843
- function jo(t) {
2843
+ function ko(t) {
2844
2844
  const e = {};
2845
2845
  for (const [n, r] of Object.entries(t))
2846
2846
  e[n] = {
@@ -2860,7 +2860,7 @@ function Jr({ store: t, pageInfo: e, aggregate: n }, r) {
2860
2860
  pageInfo: e == null ? void 0 : e[a]
2861
2861
  })), u;
2862
2862
  }, {}) };
2863
- return e && (s.pageInfo = jo(e)), n && (s.aggregate = n), s;
2863
+ return e && (s.pageInfo = ko(e)), n && (s.aggregate = n), s;
2864
2864
  }
2865
2865
  function Co() {
2866
2866
  const e = {
@@ -3839,11 +3839,11 @@ class ni {
3839
3839
  };
3840
3840
  }
3841
3841
  }
3842
- class ke extends Error {
3842
+ class je extends Error {
3843
3843
  constructor(e, n) {
3844
3844
  super(e), this.hint = n;
3845
3845
  const r = new.target.prototype;
3846
- Object.setPrototypeOf && Object.setPrototypeOf(this, r), Error.captureStackTrace && Error.captureStackTrace(this, ke), this.name = "InstantError";
3846
+ Object.setPrototypeOf && Object.setPrototypeOf(this, r), Error.captureStackTrace && Error.captureStackTrace(this, je), this.name = "InstantError";
3847
3847
  }
3848
3848
  get [Symbol.toStringTag]() {
3849
3849
  return "InstantError";
@@ -3876,7 +3876,7 @@ var lu = function(t, e, n, r) {
3876
3876
  d((r = r.apply(t, e || [])).next());
3877
3877
  });
3878
3878
  };
3879
- class bt extends ke {
3879
+ class bt extends je {
3880
3880
  constructor(e) {
3881
3881
  var n;
3882
3882
  const r = ((n = e.body) === null || n === void 0 ? void 0 : n.message) || `API Error (${e.status})`;
@@ -4176,7 +4176,7 @@ function ur(t) {
4176
4176
  }, e;
4177
4177
  }, {});
4178
4178
  }
4179
- const oi = "v0.22.75";
4179
+ const oi = "v0.22.76";
4180
4180
  function Au(t, e) {
4181
4181
  return {
4182
4182
  info: t ? (...n) => console.info(...n, e()) : () => {
@@ -4226,7 +4226,7 @@ const ar = [
4226
4226
  "before",
4227
4227
  "fields",
4228
4228
  "aggregate"
4229
- ], ku = (t) => t.valueType || "unknown", ui = (t, e, n = !1) => {
4229
+ ], ju = (t) => t.valueType || "unknown", ui = (t, e, n = !1) => {
4230
4230
  if (n || t == null)
4231
4231
  return !0;
4232
4232
  switch (e) {
@@ -4241,7 +4241,7 @@ const ar = [
4241
4241
  default:
4242
4242
  return !0;
4243
4243
  }
4244
- }, ju = (t, e, n, r, i, s, o) => {
4244
+ }, ku = (t, e, n, r, i, s, o) => {
4245
4245
  const u = s.valueType === "json", a = (d, c, f) => {
4246
4246
  if (!ui(f, c, u))
4247
4247
  throw new M(`Invalid value for operator '${d}' on attribute '${r}' in entity '${i}'. Expected ${c}, but received: ${typeof f}`, o);
@@ -4274,13 +4274,13 @@ const ar = [
4274
4274
  throw new M(`Unknown operator '${t}' for attribute '${r}' in entity '${i}'`, o);
4275
4275
  }
4276
4276
  }, Oe = (t, e, n, r, i) => {
4277
- const s = ku(n), o = n.valueType === "json";
4277
+ const s = ju(n), o = n.valueType === "json";
4278
4278
  if (typeof t == "object" && t !== null && !Array.isArray(t)) {
4279
4279
  if (o)
4280
4280
  return;
4281
4281
  const a = t;
4282
4282
  for (const [d, c] of Object.entries(a))
4283
- ju(d, c, s, e, r, n, `${i}.${d}`);
4283
+ ku(d, c, s, e, r, n, `${i}.${d}`);
4284
4284
  } else if (!ui(t, s, o))
4285
4285
  throw new M(`Invalid value for attribute '${e}' in entity '${r}'. Expected ${s}, but received: ${typeof t}`, i);
4286
4286
  }, Cu = (t, e, n, r, i) => {
@@ -4558,22 +4558,29 @@ class Du {
4558
4558
  this.initParams || this.handleError();
4559
4559
  }, 1e4), this.conn.onmessage = (r) => {
4560
4560
  const i = JSON.parse(r.data);
4561
- if (i.op === "sse-init") {
4562
- this.initParams = {
4563
- machineId: i["machine-id"],
4564
- sessionId: i["session-id"],
4565
- sseToken: i["sse-token"]
4566
- }, this.onopen && this.onopen({ target: this }), clearTimeout(this.sseInitTimeout);
4567
- return;
4568
- }
4569
- this.onmessage && this.onmessage({
4570
- target: this,
4571
- message: i
4572
- });
4561
+ if (Array.isArray(i))
4562
+ for (const s of i)
4563
+ this.handleMessage(s);
4564
+ else
4565
+ this.handleMessage(i);
4573
4566
  }, this.conn.onerror = (r) => {
4574
4567
  this.handleError();
4575
4568
  };
4576
4569
  }
4570
+ handleMessage(e) {
4571
+ if (e.op === "sse-init") {
4572
+ this.initParams = {
4573
+ machineId: e["machine-id"],
4574
+ sessionId: e["session-id"],
4575
+ sseToken: e["sse-token"]
4576
+ }, this.onopen && this.onopen({ target: this }), clearTimeout(this.sseInitTimeout);
4577
+ return;
4578
+ }
4579
+ this.onmessage && this.onmessage({
4580
+ target: this,
4581
+ message: e
4582
+ });
4583
+ }
4577
4584
  // Runs the onerror and closes the connection
4578
4585
  handleError() {
4579
4586
  try {
@@ -4966,8 +4973,8 @@ class zu {
4966
4973
  u.values = l;
4967
4974
  const y = [];
4968
4975
  e: for (const [T, v] of Object.entries(f))
4969
- for (let j = 0; j < p.length; j++) {
4970
- const S = p[j];
4976
+ for (let k = 0; k < p.length; k++) {
4977
+ const S = p[k];
4971
4978
  if (ws(S.store, T)) {
4972
4979
  _r(S.store, v);
4973
4980
  const I = Pt(u, S.store), R = Nu(S.store, v)[T];
@@ -4975,27 +4982,27 @@ class zu {
4975
4982
  oldEntity: S.entity,
4976
4983
  newEntity: I,
4977
4984
  changedFields: R || {}
4978
- }), S.entity = I) : c.push(j), delete f[T];
4985
+ }), S.entity = I) : c.push(k), delete f[T];
4979
4986
  continue e;
4980
4987
  }
4981
4988
  }
4982
4989
  const b = [];
4983
4990
  for (const [T, v] of Object.entries(f)) {
4984
- const j = this.createStore([]);
4985
- l.attrs = j.attrs, _r(j, v);
4986
- const S = Pt(u, j);
4991
+ const k = this.createStore([]);
4992
+ l.attrs = k.attrs, _r(k, v);
4993
+ const S = Pt(u, k);
4987
4994
  if (!S) {
4988
4995
  this.log.error("No entity found after applying change", {
4989
4996
  sub: u,
4990
4997
  changes: v,
4991
- store: j
4998
+ store: k
4992
4999
  });
4993
5000
  continue;
4994
5001
  }
4995
5002
  p.push({
4996
- store: j,
5003
+ store: k,
4997
5004
  entity: S,
4998
- serverCreatedAt: br(u, j, S.id)
5005
+ serverCreatedAt: br(u, k, S.id)
4999
5006
  }), b.push(S);
5000
5007
  }
5001
5008
  const g = [];
@@ -5157,8 +5164,8 @@ class na {
5157
5164
  case "pendingMutations": {
5158
5165
  const y = (l = c == null ? void 0 : c.entries()) !== null && l !== void 0 ? l : [], b = (p = f == null ? void 0 : f.entries()) !== null && p !== void 0 ? p : [], g = new Map([...y, ...b]);
5159
5166
  return (c ? this._rewriteMutationsSorted(this.attrs, c) : []).forEach(([T, v]) => {
5160
- var j;
5161
- !(!((j = f == null ? void 0 : f.pendingMutations) === null || j === void 0) && j.has(T)) && !v["tx-id"] && this._sendMutation(T, v);
5167
+ var k;
5168
+ !(!((k = f == null ? void 0 : f.pendingMutations) === null || k === void 0) && k.has(T)) && !v["tx-id"] && this._sendMutation(T, v);
5162
5169
  }), g;
5163
5170
  }
5164
5171
  default:
@@ -5238,7 +5245,11 @@ class na {
5238
5245
  this._log.info("[socket][message]", c.id, f, "skip; this is no longer the current transport");
5239
5246
  return;
5240
5247
  }
5241
- !this._wsOk && c.type === "ws" && (this._wsOk = !0), this._transportType = "ws", this._handleReceive(c.id, d.message);
5248
+ if (!this._wsOk && c.type === "ws" && (this._wsOk = !0), this._transportType = "ws", Array.isArray(d.message))
5249
+ for (const l of d.message)
5250
+ this._handleReceive(c.id, l);
5251
+ else
5252
+ this._handleReceive(c.id, d.message);
5242
5253
  }, this._transportOnError = (d) => {
5243
5254
  const c = d.target;
5244
5255
  if (this._transport !== c) {
@@ -5368,7 +5379,7 @@ class na {
5368
5379
  status: o ?? 0
5369
5380
  }));
5370
5381
  } else
5371
- i.reject(new ke((r == null ? void 0 : r.message) || "Unknown error", r == null ? void 0 : r.hint));
5382
+ i.reject(new je((r == null ? void 0 : r.message) || "Unknown error", r == null ? void 0 : r.hint));
5372
5383
  }
5373
5384
  _setStatus(e, n) {
5374
5385
  this.status = e, this._errorMessage = n, this.notifyConnectionStatusSubs(e);
@@ -5441,17 +5452,17 @@ class na {
5441
5452
  T.pendingMutations = b;
5442
5453
  });
5443
5454
  const g = Tr(b.entries()), m = l.map((T) => {
5444
- var v, j, S, I;
5445
- const R = T["instaql-query"], q = T["instaql-result"], Ie = N(R), Qe = or(q), _t = at(this.attrs, Qe, d, this._linkIndex, this.config.useDateObjects), gt = this._applyOptimisticUpdates(_t, g, y), He = (j = (v = q == null ? void 0 : q[0]) === null || v === void 0 ? void 0 : v.data) === null || j === void 0 ? void 0 : j["page-info"], ne = (I = (S = q == null ? void 0 : q[0]) === null || S === void 0 ? void 0 : S.data) === null || I === void 0 ? void 0 : I.aggregate;
5455
+ var v, k, S, I;
5456
+ const R = T["instaql-query"], q = T["instaql-result"], Ie = N(R), Qe = or(q), _t = at(this.attrs, Qe, d, this._linkIndex, this.config.useDateObjects), gt = this._applyOptimisticUpdates(_t, g, y), He = (k = (v = q == null ? void 0 : q[0]) === null || v === void 0 ? void 0 : v.data) === null || k === void 0 ? void 0 : k["page-info"], ne = (I = (S = q == null ? void 0 : q[0]) === null || S === void 0 ? void 0 : S.data) === null || I === void 0 ? void 0 : I.aggregate;
5446
5457
  return { q: R, hash: Ie, store: gt, pageInfo: He, aggregate: ne };
5447
5458
  });
5448
- m.forEach(({ hash: T, q: v, store: j, pageInfo: S, aggregate: I }) => {
5459
+ m.forEach(({ hash: T, q: v, store: k, pageInfo: S, aggregate: I }) => {
5449
5460
  this.querySubs.updateInPlace((R) => {
5450
5461
  if (!R[T]) {
5451
5462
  this._log.error("Missing value in querySubs", { hash: T, q: v });
5452
5463
  return;
5453
5464
  }
5454
- R[T].result = { store: j, pageInfo: S, aggregate: I, processedTxId: y };
5465
+ R[T].result = { store: k, pageInfo: S, aggregate: I, processedTxId: y };
5455
5466
  });
5456
5467
  }), this._cleanupPendingMutationsQueries(), m.forEach(({ hash: T }) => {
5457
5468
  this.notifyOne(T);
@@ -5948,7 +5959,7 @@ class na {
5948
5959
  return U(this, void 0, void 0, function* () {
5949
5960
  const { user: e, error: n } = yield this.getCurrentUser();
5950
5961
  if (n)
5951
- throw new ke("Could not get current user: " + n.message);
5962
+ throw new je("Could not get current user: " + n.message);
5952
5963
  return e;
5953
5964
  });
5954
5965
  }
@@ -6666,11 +6677,12 @@ function _a(t, e) {
6666
6677
  return wr(t._reactor.config.schema) !== wr(e);
6667
6678
  }
6668
6679
  function ga(t, e, n, r, i) {
6669
- const s = Zt[Jt(t)];
6670
- if (s)
6671
- return _a(s, t.schema) && s._reactor.updateSchema(t.schema), s;
6672
- const o = new na(Object.assign(Object.assign(Object.assign({}, da), t), { cardinalityInference: !!t.schema }), e || ti, n || ni, Object.assign(Object.assign({}, r || {}), { "@instantdb/core": oi }), i), u = new ba(o);
6673
- return Zt[Jt(t)] = u, Ta(t.appId, t.devtool), u;
6680
+ var s;
6681
+ const o = Object.assign(Object.assign({}, t), { useDateObjects: (s = t.useDateObjects) !== null && s !== void 0 ? s : !1 }), u = Zt[Jt(o)];
6682
+ if (u)
6683
+ return _a(u, o.schema) && u._reactor.updateSchema(o.schema), u;
6684
+ const a = new na(Object.assign(Object.assign(Object.assign({}, da), o), { cardinalityInference: !!o.schema }), e || ti, n || ni, Object.assign(Object.assign({}, r || {}), { "@instantdb/core": oi }), i), d = new ba(a);
6685
+ return Zt[Jt(o)] = d, Ta(o.appId, o.devtool), d;
6674
6686
  }
6675
6687
  function Ta(t, e) {
6676
6688
  if (typeof window > "u" || typeof window.location > "u" || typeof document > "u" || typeof e == "boolean" && !e)
@@ -6703,8 +6715,11 @@ function wa(t, e, n) {
6703
6715
  ), r ? t.subscribeQuery(r, (c) => {
6704
6716
  s.current = {
6705
6717
  isLoading: !c,
6718
+ // @ts-expect-error: ts thinks this will always be overwritten
6706
6719
  data: void 0,
6720
+ // @ts-expect-error: ts thinks this will always be overwritten
6707
6721
  pageInfo: void 0,
6722
+ // @ts-expect-error: ts thinks this will always be overwritten
6708
6723
  error: void 0,
6709
6724
  ...c
6710
6725
  }, a();
@@ -6725,10 +6740,10 @@ function va() {
6725
6740
  n();
6726
6741
  }, []);
6727
6742
  function e(r, i) {
6728
- clearTimeout(t.current), t.current = setTimeout(i, r);
6743
+ n(), t.current = setTimeout(i, r);
6729
6744
  }
6730
6745
  function n() {
6731
- clearTimeout(t.current);
6746
+ t.current && clearTimeout(t.current);
6732
6747
  }
6733
6748
  return { set: e, clear: n };
6734
6749
  }
@@ -6781,10 +6796,10 @@ function Aa(t, e = {}) {
6781
6796
  publishPresence: i
6782
6797
  }), [n, i]);
6783
6798
  }
6784
- function ka(t, e, n) {
6799
+ function ja(t, e, n) {
6785
6800
  ge(() => t.core._reactor.joinRoom(t.id, e), [t.id]), ge(() => t.core._reactor.publishPresence(t.type, t.id, e), [t.type, t.id, n ?? JSON.stringify(e)]);
6786
6801
  }
6787
- function ja(t, e, n = {}) {
6802
+ function ka(t, e, n = {}) {
6788
6803
  const r = va(), i = ye.usePresence(t, {
6789
6804
  keys: [e]
6790
6805
  }), s = Rt(() => {
@@ -6825,8 +6840,8 @@ const ye = {
6825
6840
  useTopicEffect: Oa,
6826
6841
  usePublishTopic: Ea,
6827
6842
  usePresence: Aa,
6828
- useSyncPresence: ka,
6829
- useTypingIndicator: ja
6843
+ useSyncPresence: ja,
6844
+ useTypingIndicator: ka
6830
6845
  };
6831
6846
  class Ca {
6832
6847
  constructor(e, n, r) {
@@ -6850,11 +6865,7 @@ class Ma {
6850
6865
  s(u);
6851
6866
  })();
6852
6867
  }, [r]), i;
6853
- }, this.rooms = ye, this.transact = (r) => this.core.transact(r), this.useQuery = (r, i) => wa(
6854
- this.core,
6855
- r,
6856
- i
6857
- ).state, this.useAuth = () => {
6868
+ }, this.rooms = ye, this.transact = (r) => this.core.transact(r), this.useQuery = (r, i) => wa(this.core, r, i).state, this.useAuth = () => {
6858
6869
  const r = ze(
6859
6870
  this.core._reactor._currentUserCached
6860
6871
  ), i = de((o) => this.core.subscribeAuth((a) => {
@@ -6868,7 +6879,7 @@ class Ma {
6868
6879
  }, this.useUser = () => {
6869
6880
  const { user: r } = this.useAuth();
6870
6881
  if (!r)
6871
- throw new ke(
6882
+ throw new je(
6872
6883
  "useUser must be used within an auth-protected route"
6873
6884
  );
6874
6885
  return r;