@instantdb/react-common 0.22.44-experimental.sync-table.19052488155.1 → 0.22.44-experimental.sync-table.19053425986.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/standalone/index.js +706 -689
- package/dist/standalone/index.umd.cjs +8 -8
- package/package.json +3 -3
package/dist/standalone/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import br, { useRef as tt, useCallback as ae, useSyncExternalStore as At, useEffect as pe, useMemo as Ct, useState as yr } from "react";
|
|
2
2
|
var jt = { exports: {} }, Ie = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
@@ -13,20 +13,20 @@ var $n;
|
|
|
13
13
|
function Ii() {
|
|
14
14
|
if ($n) return Ie;
|
|
15
15
|
$n = 1;
|
|
16
|
-
var t =
|
|
17
|
-
function o(u,
|
|
18
|
-
var
|
|
19
|
-
d !== void 0 && (h = "" + d),
|
|
20
|
-
for (
|
|
21
|
-
if (u && u.defaultProps) for (
|
|
16
|
+
var t = br, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, i = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
|
+
function o(u, c, d) {
|
|
18
|
+
var a, f = {}, h = null, p = null;
|
|
19
|
+
d !== void 0 && (h = "" + d), c.key !== void 0 && (h = "" + c.key), c.ref !== void 0 && (p = c.ref);
|
|
20
|
+
for (a in c) r.call(c, a) && !s.hasOwnProperty(a) && (f[a] = c[a]);
|
|
21
|
+
if (u && u.defaultProps) for (a in c = u.defaultProps, c) f[a] === void 0 && (f[a] = c[a]);
|
|
22
22
|
return { $$typeof: e, type: u, key: h, ref: p, props: f, _owner: i.current };
|
|
23
23
|
}
|
|
24
24
|
return Ie.Fragment = n, Ie.jsx = o, Ie.jsxs = o, Ie;
|
|
25
25
|
}
|
|
26
|
-
var Pe = {},
|
|
26
|
+
var Pe = {}, Dn;
|
|
27
27
|
function Pi() {
|
|
28
|
-
if (
|
|
29
|
-
|
|
28
|
+
if (Dn) return Pe;
|
|
29
|
+
Dn = 1;
|
|
30
30
|
var t = {};
|
|
31
31
|
/**
|
|
32
32
|
* @license React
|
|
@@ -38,45 +38,45 @@ function Pi() {
|
|
|
38
38
|
* LICENSE file in the root directory of this source tree.
|
|
39
39
|
*/
|
|
40
40
|
return t.NODE_ENV !== "production" && function() {
|
|
41
|
-
var e =
|
|
41
|
+
var e = br, n = Symbol.for("react.element"), r = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), c = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), a = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), y = Symbol.for("react.offscreen"), g = Symbol.iterator, w = "@@iterator";
|
|
42
42
|
function _(l) {
|
|
43
43
|
if (l === null || typeof l != "object")
|
|
44
44
|
return null;
|
|
45
|
-
var
|
|
46
|
-
return typeof
|
|
45
|
+
var b = g && l[g] || l[w];
|
|
46
|
+
return typeof b == "function" ? b : null;
|
|
47
47
|
}
|
|
48
48
|
var m = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
49
49
|
function S(l) {
|
|
50
50
|
{
|
|
51
|
-
for (var
|
|
51
|
+
for (var b = arguments.length, T = new Array(b > 1 ? b - 1 : 0), v = 1; v < b; v++)
|
|
52
52
|
T[v - 1] = arguments[v];
|
|
53
|
-
|
|
53
|
+
x("error", l, T);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function x(l, b, T) {
|
|
57
57
|
{
|
|
58
58
|
var v = m.ReactDebugCurrentFrame, j = v.getStackAddendum();
|
|
59
|
-
j !== "" && (
|
|
59
|
+
j !== "" && (b += "%s", T = T.concat([j]));
|
|
60
60
|
var k = T.map(function(C) {
|
|
61
61
|
return String(C);
|
|
62
62
|
});
|
|
63
|
-
k.unshift("Warning: " +
|
|
63
|
+
k.unshift("Warning: " + b), Function.prototype.apply.call(console[l], console, k);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
var O = !1, P = !1, N = !1, q = !1, Ce = !1, Ve;
|
|
67
67
|
Ve = Symbol.for("react.module.reference");
|
|
68
68
|
function dt(l) {
|
|
69
|
-
return !!(typeof l == "string" || typeof l == "function" || l === i || l === o || Ce || l === s || l ===
|
|
69
|
+
return !!(typeof l == "string" || typeof l == "function" || l === i || l === o || Ce || l === s || l === a || l === f || q || l === y || O || P || N || typeof l == "object" && l !== null && (l.$$typeof === p || l.$$typeof === h || l.$$typeof === u || l.$$typeof === c || l.$$typeof === d || // This needs to include all possible module reference object
|
|
70
70
|
// types supported by any Flight configuration anywhere since
|
|
71
71
|
// we don't know which Flight build this will end up being used
|
|
72
72
|
// with.
|
|
73
73
|
l.$$typeof === Ve || l.getModuleId !== void 0));
|
|
74
74
|
}
|
|
75
|
-
function ft(l,
|
|
75
|
+
function ft(l, b, T) {
|
|
76
76
|
var v = l.displayName;
|
|
77
77
|
if (v)
|
|
78
78
|
return v;
|
|
79
|
-
var j =
|
|
79
|
+
var j = b.displayName || b.name || "";
|
|
80
80
|
return j !== "" ? T + "(" + j + ")" : T;
|
|
81
81
|
}
|
|
82
82
|
function qe(l) {
|
|
@@ -98,16 +98,16 @@ function Pi() {
|
|
|
98
98
|
return "Profiler";
|
|
99
99
|
case s:
|
|
100
100
|
return "StrictMode";
|
|
101
|
-
case
|
|
101
|
+
case a:
|
|
102
102
|
return "Suspense";
|
|
103
103
|
case f:
|
|
104
104
|
return "SuspenseList";
|
|
105
105
|
}
|
|
106
106
|
if (typeof l == "object")
|
|
107
107
|
switch (l.$$typeof) {
|
|
108
|
-
case
|
|
109
|
-
var
|
|
110
|
-
return qe(
|
|
108
|
+
case c:
|
|
109
|
+
var b = l;
|
|
110
|
+
return qe(b) + ".Consumer";
|
|
111
111
|
case u:
|
|
112
112
|
var T = l;
|
|
113
113
|
return qe(T._context) + ".Provider";
|
|
@@ -127,14 +127,14 @@ function Pi() {
|
|
|
127
127
|
}
|
|
128
128
|
return null;
|
|
129
129
|
}
|
|
130
|
-
var ce = Object.assign, je = 0, fn, ln, hn, pn,
|
|
130
|
+
var ce = Object.assign, je = 0, fn, ln, hn, pn, bn, yn, _n;
|
|
131
131
|
function gn() {
|
|
132
132
|
}
|
|
133
133
|
gn.__reactDisabledLog = !0;
|
|
134
134
|
function ri() {
|
|
135
135
|
{
|
|
136
136
|
if (je === 0) {
|
|
137
|
-
fn = console.log, ln = console.info, hn = console.warn, pn = console.error,
|
|
137
|
+
fn = console.log, ln = console.info, hn = console.warn, pn = console.error, bn = console.group, yn = console.groupCollapsed, _n = console.groupEnd;
|
|
138
138
|
var l = {
|
|
139
139
|
configurable: !0,
|
|
140
140
|
enumerable: !0,
|
|
@@ -176,10 +176,10 @@ function Pi() {
|
|
|
176
176
|
value: pn
|
|
177
177
|
}),
|
|
178
178
|
group: ce({}, l, {
|
|
179
|
-
value:
|
|
179
|
+
value: bn
|
|
180
180
|
}),
|
|
181
181
|
groupCollapsed: ce({}, l, {
|
|
182
|
-
value:
|
|
182
|
+
value: yn
|
|
183
183
|
}),
|
|
184
184
|
groupEnd: ce({}, l, {
|
|
185
185
|
value: _n
|
|
@@ -190,7 +190,7 @@ function Pi() {
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
var lt = m.ReactCurrentDispatcher, ht;
|
|
193
|
-
function We(l,
|
|
193
|
+
function We(l, b, T) {
|
|
194
194
|
{
|
|
195
195
|
if (ht === void 0)
|
|
196
196
|
try {
|
|
@@ -208,7 +208,7 @@ function Pi() {
|
|
|
208
208
|
var si = typeof WeakMap == "function" ? WeakMap : Map;
|
|
209
209
|
ze = new si();
|
|
210
210
|
}
|
|
211
|
-
function Tn(l,
|
|
211
|
+
function Tn(l, b) {
|
|
212
212
|
if (!l || pt)
|
|
213
213
|
return "";
|
|
214
214
|
{
|
|
@@ -223,7 +223,7 @@ function Pi() {
|
|
|
223
223
|
var k;
|
|
224
224
|
k = lt.current, lt.current = null, ri();
|
|
225
225
|
try {
|
|
226
|
-
if (
|
|
226
|
+
if (b) {
|
|
227
227
|
var C = function() {
|
|
228
228
|
throw Error();
|
|
229
229
|
};
|
|
@@ -279,14 +279,14 @@ function Pi() {
|
|
|
279
279
|
var ge = l ? l.displayName || l.name : "", de = ge ? We(ge) : "";
|
|
280
280
|
return typeof l == "function" && ze.set(l, de), de;
|
|
281
281
|
}
|
|
282
|
-
function oi(l,
|
|
282
|
+
function oi(l, b, T) {
|
|
283
283
|
return Tn(l, !1);
|
|
284
284
|
}
|
|
285
285
|
function ui(l) {
|
|
286
|
-
var
|
|
287
|
-
return !!(
|
|
286
|
+
var b = l.prototype;
|
|
287
|
+
return !!(b && b.isReactComponent);
|
|
288
288
|
}
|
|
289
|
-
function Ke(l,
|
|
289
|
+
function Ke(l, b, T) {
|
|
290
290
|
if (l == null)
|
|
291
291
|
return "";
|
|
292
292
|
if (typeof l == "function")
|
|
@@ -294,7 +294,7 @@ function Pi() {
|
|
|
294
294
|
if (typeof l == "string")
|
|
295
295
|
return We(l);
|
|
296
296
|
switch (l) {
|
|
297
|
-
case
|
|
297
|
+
case a:
|
|
298
298
|
return We("Suspense");
|
|
299
299
|
case f:
|
|
300
300
|
return We("SuspenseList");
|
|
@@ -304,11 +304,11 @@ function Pi() {
|
|
|
304
304
|
case d:
|
|
305
305
|
return oi(l.render);
|
|
306
306
|
case h:
|
|
307
|
-
return Ke(l.type,
|
|
307
|
+
return Ke(l.type, b, T);
|
|
308
308
|
case p: {
|
|
309
309
|
var v = l, j = v._payload, k = v._init;
|
|
310
310
|
try {
|
|
311
|
-
return Ke(k(j),
|
|
311
|
+
return Ke(k(j), b, T);
|
|
312
312
|
} catch {
|
|
313
313
|
}
|
|
314
314
|
}
|
|
@@ -318,12 +318,12 @@ function Pi() {
|
|
|
318
318
|
var ke = Object.prototype.hasOwnProperty, wn = {}, mn = m.ReactDebugCurrentFrame;
|
|
319
319
|
function Be(l) {
|
|
320
320
|
if (l) {
|
|
321
|
-
var
|
|
321
|
+
var b = l._owner, T = Ke(l.type, l._source, b ? b.type : null);
|
|
322
322
|
mn.setExtraStackFrame(T);
|
|
323
323
|
} else
|
|
324
324
|
mn.setExtraStackFrame(null);
|
|
325
325
|
}
|
|
326
|
-
function ai(l,
|
|
326
|
+
function ai(l, b, T, v, j) {
|
|
327
327
|
{
|
|
328
328
|
var k = Function.call.bind(ke);
|
|
329
329
|
for (var C in l)
|
|
@@ -334,7 +334,7 @@ function Pi() {
|
|
|
334
334
|
var W = Error((v || "React class") + ": " + T + " type `" + C + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof l[C] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
335
335
|
throw W.name = "Invariant Violation", W;
|
|
336
336
|
}
|
|
337
|
-
E = l[C](
|
|
337
|
+
E = l[C](b, C, v, T, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
338
338
|
} catch (M) {
|
|
339
339
|
E = M;
|
|
340
340
|
}
|
|
@@ -343,12 +343,12 @@ function Pi() {
|
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
var ci = Array.isArray;
|
|
346
|
-
function
|
|
346
|
+
function bt(l) {
|
|
347
347
|
return ci(l);
|
|
348
348
|
}
|
|
349
349
|
function di(l) {
|
|
350
350
|
{
|
|
351
|
-
var
|
|
351
|
+
var b = typeof Symbol == "function" && Symbol.toStringTag, T = b && l[Symbol.toStringTag] || l.constructor.name || "Object";
|
|
352
352
|
return T;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
@@ -374,27 +374,27 @@ function Pi() {
|
|
|
374
374
|
}, En, An;
|
|
375
375
|
function hi(l) {
|
|
376
376
|
if (ke.call(l, "ref")) {
|
|
377
|
-
var
|
|
378
|
-
if (
|
|
377
|
+
var b = Object.getOwnPropertyDescriptor(l, "ref").get;
|
|
378
|
+
if (b && b.isReactWarning)
|
|
379
379
|
return !1;
|
|
380
380
|
}
|
|
381
381
|
return l.ref !== void 0;
|
|
382
382
|
}
|
|
383
383
|
function pi(l) {
|
|
384
384
|
if (ke.call(l, "key")) {
|
|
385
|
-
var
|
|
386
|
-
if (
|
|
385
|
+
var b = Object.getOwnPropertyDescriptor(l, "key").get;
|
|
386
|
+
if (b && b.isReactWarning)
|
|
387
387
|
return !1;
|
|
388
388
|
}
|
|
389
389
|
return l.key !== void 0;
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function bi(l, b) {
|
|
392
392
|
typeof l.ref == "string" && On.current;
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function yi(l, b) {
|
|
395
395
|
{
|
|
396
396
|
var T = function() {
|
|
397
|
-
En || (En = !0, S("%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
|
+
En || (En = !0, S("%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)", b));
|
|
398
398
|
};
|
|
399
399
|
T.isReactWarning = !0, Object.defineProperty(l, "key", {
|
|
400
400
|
get: T,
|
|
@@ -402,10 +402,10 @@ function Pi() {
|
|
|
402
402
|
});
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
function _i(l,
|
|
405
|
+
function _i(l, b) {
|
|
406
406
|
{
|
|
407
407
|
var T = function() {
|
|
408
|
-
An || (An = !0, S("%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)",
|
|
408
|
+
An || (An = !0, S("%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)", b));
|
|
409
409
|
};
|
|
410
410
|
T.isReactWarning = !0, Object.defineProperty(l, "ref", {
|
|
411
411
|
get: T,
|
|
@@ -413,13 +413,13 @@ function Pi() {
|
|
|
413
413
|
});
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
|
-
var gi = function(l,
|
|
416
|
+
var gi = function(l, b, T, v, j, k, C) {
|
|
417
417
|
var E = {
|
|
418
418
|
// This tag allows us to uniquely identify this as a React Element
|
|
419
419
|
$$typeof: n,
|
|
420
420
|
// Built-in properties that belong on the element
|
|
421
421
|
type: l,
|
|
422
|
-
key:
|
|
422
|
+
key: b,
|
|
423
423
|
ref: T,
|
|
424
424
|
props: C,
|
|
425
425
|
// Record the component responsible for creating this element.
|
|
@@ -442,12 +442,12 @@ function Pi() {
|
|
|
442
442
|
value: j
|
|
443
443
|
}), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
|
|
444
444
|
};
|
|
445
|
-
function Ti(l,
|
|
445
|
+
function Ti(l, b, T, v, j) {
|
|
446
446
|
{
|
|
447
447
|
var k, C = {}, E = null, W = null;
|
|
448
|
-
T !== void 0 && (vn(T), E = "" + T), pi(
|
|
449
|
-
for (k in
|
|
450
|
-
ke.call(
|
|
448
|
+
T !== void 0 && (vn(T), E = "" + T), pi(b) && (vn(b.key), E = "" + b.key), hi(b) && (W = b.ref, bi(b, j));
|
|
449
|
+
for (k in b)
|
|
450
|
+
ke.call(b, k) && !li.hasOwnProperty(k) && (C[k] = b[k]);
|
|
451
451
|
if (l && l.defaultProps) {
|
|
452
452
|
var M = l.defaultProps;
|
|
453
453
|
for (k in M)
|
|
@@ -455,15 +455,15 @@ function Pi() {
|
|
|
455
455
|
}
|
|
456
456
|
if (E || W) {
|
|
457
457
|
var $ = typeof l == "function" ? l.displayName || l.name || "Unknown" : l;
|
|
458
|
-
E &&
|
|
458
|
+
E && yi(C, $), W && _i(C, $);
|
|
459
459
|
}
|
|
460
460
|
return gi(l, E, W, j, v, On.current, C);
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
|
-
var
|
|
463
|
+
var yt = m.ReactCurrentOwner, Cn = m.ReactDebugCurrentFrame;
|
|
464
464
|
function _e(l) {
|
|
465
465
|
if (l) {
|
|
466
|
-
var
|
|
466
|
+
var b = l._owner, T = Ke(l.type, l._source, b ? b.type : null);
|
|
467
467
|
Cn.setExtraStackFrame(T);
|
|
468
468
|
} else
|
|
469
469
|
Cn.setExtraStackFrame(null);
|
|
@@ -475,8 +475,8 @@ function Pi() {
|
|
|
475
475
|
}
|
|
476
476
|
function jn() {
|
|
477
477
|
{
|
|
478
|
-
if (
|
|
479
|
-
var l = ne(
|
|
478
|
+
if (yt.current) {
|
|
479
|
+
var l = ne(yt.current.type);
|
|
480
480
|
if (l)
|
|
481
481
|
return `
|
|
482
482
|
|
|
@@ -491,37 +491,37 @@ Check the render method of \`` + l + "`.";
|
|
|
491
491
|
var kn = {};
|
|
492
492
|
function mi(l) {
|
|
493
493
|
{
|
|
494
|
-
var
|
|
495
|
-
if (!
|
|
494
|
+
var b = jn();
|
|
495
|
+
if (!b) {
|
|
496
496
|
var T = typeof l == "string" ? l : l.displayName || l.name;
|
|
497
|
-
T && (
|
|
497
|
+
T && (b = `
|
|
498
498
|
|
|
499
499
|
Check the top-level render call using <` + T + ">.");
|
|
500
500
|
}
|
|
501
|
-
return
|
|
501
|
+
return b;
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
-
function In(l,
|
|
504
|
+
function In(l, b) {
|
|
505
505
|
{
|
|
506
506
|
if (!l._store || l._store.validated || l.key != null)
|
|
507
507
|
return;
|
|
508
508
|
l._store.validated = !0;
|
|
509
|
-
var T = mi(
|
|
509
|
+
var T = mi(b);
|
|
510
510
|
if (kn[T])
|
|
511
511
|
return;
|
|
512
512
|
kn[T] = !0;
|
|
513
513
|
var v = "";
|
|
514
|
-
l && l._owner && l._owner !==
|
|
514
|
+
l && l._owner && l._owner !== yt.current && (v = " It was passed a child from " + ne(l._owner.type) + "."), _e(l), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', T, v), _e(null);
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
-
function Pn(l,
|
|
517
|
+
function Pn(l, b) {
|
|
518
518
|
{
|
|
519
519
|
if (typeof l != "object")
|
|
520
520
|
return;
|
|
521
|
-
if (
|
|
521
|
+
if (bt(l))
|
|
522
522
|
for (var T = 0; T < l.length; T++) {
|
|
523
523
|
var v = l[T];
|
|
524
|
-
gt(v) && In(v,
|
|
524
|
+
gt(v) && In(v, b);
|
|
525
525
|
}
|
|
526
526
|
else if (gt(l))
|
|
527
527
|
l._store && (l._store.validated = !0);
|
|
@@ -529,39 +529,39 @@ Check the top-level render call using <` + T + ">.");
|
|
|
529
529
|
var j = _(l);
|
|
530
530
|
if (typeof j == "function" && j !== l.entries)
|
|
531
531
|
for (var k = j.call(l), C; !(C = k.next()).done; )
|
|
532
|
-
gt(C.value) && In(C.value,
|
|
532
|
+
gt(C.value) && In(C.value, b);
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
function Si(l) {
|
|
537
537
|
{
|
|
538
|
-
var
|
|
539
|
-
if (
|
|
538
|
+
var b = l.type;
|
|
539
|
+
if (b == null || typeof b == "string")
|
|
540
540
|
return;
|
|
541
541
|
var T;
|
|
542
|
-
if (typeof
|
|
543
|
-
T =
|
|
544
|
-
else if (typeof
|
|
542
|
+
if (typeof b == "function")
|
|
543
|
+
T = b.propTypes;
|
|
544
|
+
else if (typeof b == "object" && (b.$$typeof === d || // Note: Memo only checks outer props here.
|
|
545
545
|
// Inner props are checked in the reconciler.
|
|
546
|
-
|
|
547
|
-
T =
|
|
546
|
+
b.$$typeof === h))
|
|
547
|
+
T = b.propTypes;
|
|
548
548
|
else
|
|
549
549
|
return;
|
|
550
550
|
if (T) {
|
|
551
|
-
var v = ne(
|
|
551
|
+
var v = ne(b);
|
|
552
552
|
ai(T, l.props, "prop", v, l);
|
|
553
|
-
} else if (
|
|
553
|
+
} else if (b.PropTypes !== void 0 && !_t) {
|
|
554
554
|
_t = !0;
|
|
555
|
-
var j = ne(
|
|
555
|
+
var j = ne(b);
|
|
556
556
|
S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
|
|
557
557
|
}
|
|
558
|
-
typeof
|
|
558
|
+
typeof b.getDefaultProps == "function" && !b.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
561
|
function vi(l) {
|
|
562
562
|
{
|
|
563
|
-
for (var
|
|
564
|
-
var v =
|
|
563
|
+
for (var b = Object.keys(l.props), T = 0; T < b.length; T++) {
|
|
564
|
+
var v = b[T];
|
|
565
565
|
if (v !== "children" && v !== "key") {
|
|
566
566
|
_e(l), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", v), _e(null);
|
|
567
567
|
break;
|
|
@@ -571,7 +571,7 @@ Check the top-level render call using <` + T + ">.");
|
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
573
|
var Mn = {};
|
|
574
|
-
function Rn(l,
|
|
574
|
+
function Rn(l, b, T, v, j, k) {
|
|
575
575
|
{
|
|
576
576
|
var C = dt(l);
|
|
577
577
|
if (!C) {
|
|
@@ -580,16 +580,16 @@ Check the top-level render call using <` + T + ">.");
|
|
|
580
580
|
var W = wi();
|
|
581
581
|
W ? E += W : E += jn();
|
|
582
582
|
var M;
|
|
583
|
-
l === null ? M = "null" :
|
|
583
|
+
l === null ? M = "null" : bt(l) ? M = "array" : l !== void 0 && l.$$typeof === n ? (M = "<" + (ne(l.type) || "Unknown") + " />", E = " Did you accidentally export a JSX literal instead of a component?") : M = typeof l, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", M, E);
|
|
584
584
|
}
|
|
585
|
-
var $ = Ti(l,
|
|
585
|
+
var $ = Ti(l, b, T, j, k);
|
|
586
586
|
if ($ == null)
|
|
587
587
|
return $;
|
|
588
588
|
if (C) {
|
|
589
|
-
var J =
|
|
589
|
+
var J = b.children;
|
|
590
590
|
if (J !== void 0)
|
|
591
591
|
if (v)
|
|
592
|
-
if (
|
|
592
|
+
if (bt(J)) {
|
|
593
593
|
for (var ge = 0; ge < J.length; ge++)
|
|
594
594
|
Pn(J[ge], l);
|
|
595
595
|
Object.freeze && Object.freeze(J);
|
|
@@ -598,8 +598,8 @@ Check the top-level render call using <` + T + ">.");
|
|
|
598
598
|
else
|
|
599
599
|
Pn(J, l);
|
|
600
600
|
}
|
|
601
|
-
if (ke.call(
|
|
602
|
-
var de = ne(l), K = Object.keys(
|
|
601
|
+
if (ke.call(b, "key")) {
|
|
602
|
+
var de = ne(l), K = Object.keys(b).filter(function(ki) {
|
|
603
603
|
return ki !== "key";
|
|
604
604
|
}), Tt = K.length > 0 ? "{key: someKey, " + K.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
605
605
|
if (!Mn[de + Tt]) {
|
|
@@ -615,11 +615,11 @@ React keys must be passed directly to JSX without using spread:
|
|
|
615
615
|
return l === i ? vi($) : Si($), $;
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
function Oi(l,
|
|
619
|
-
return Rn(l,
|
|
618
|
+
function Oi(l, b, T) {
|
|
619
|
+
return Rn(l, b, T, !0);
|
|
620
620
|
}
|
|
621
|
-
function Ei(l,
|
|
622
|
-
return Rn(l,
|
|
621
|
+
function Ei(l, b, T) {
|
|
622
|
+
return Rn(l, b, T, !1);
|
|
623
623
|
}
|
|
624
624
|
var Ai = Ei, Ci = Oi;
|
|
625
625
|
Pe.Fragment = i, Pe.jsx = Ai, Pe.jsxs = Ci;
|
|
@@ -674,10 +674,10 @@ const R = {
|
|
|
674
674
|
mutable: "mutable",
|
|
675
675
|
immutable: "immutable"
|
|
676
676
|
}, Yt = {};
|
|
677
|
-
function
|
|
677
|
+
function De(t, e) {
|
|
678
678
|
return t instanceof Map ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function xn(t, e) {
|
|
681
681
|
if (e in t) {
|
|
682
682
|
let n = Reflect.getPrototypeOf(t);
|
|
683
683
|
for (; n; ) {
|
|
@@ -698,7 +698,7 @@ function H(t) {
|
|
|
698
698
|
var e;
|
|
699
699
|
return (e = t.copy) !== null && e !== void 0 ? e : t.original;
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function be(t) {
|
|
702
702
|
return !!A(t);
|
|
703
703
|
}
|
|
704
704
|
function A(t) {
|
|
@@ -721,7 +721,7 @@ function gr(t, e = []) {
|
|
|
721
721
|
if (r !== null && (r == null ? void 0 : r.original) !== t.original)
|
|
722
722
|
return null;
|
|
723
723
|
const i = t.parent.type === 3, s = i ? Array.from(t.parent.setMap.keys()).indexOf(t.key) : t.key;
|
|
724
|
-
if (!(i && n.size > s ||
|
|
724
|
+
if (!(i && n.size > s || De(n, s)))
|
|
725
725
|
return null;
|
|
726
726
|
e.push(s);
|
|
727
727
|
}
|
|
@@ -735,14 +735,14 @@ function gr(t, e = []) {
|
|
|
735
735
|
}
|
|
736
736
|
return e;
|
|
737
737
|
}
|
|
738
|
-
function
|
|
738
|
+
function ye(t) {
|
|
739
739
|
return Array.isArray(t) ? 1 : t instanceof Map ? 2 : t instanceof Set ? 3 : 0;
|
|
740
740
|
}
|
|
741
741
|
function ue(t, e) {
|
|
742
|
-
return
|
|
742
|
+
return ye(t) === 2 ? t.get(e) : t[e];
|
|
743
743
|
}
|
|
744
744
|
function Le(t, e, n) {
|
|
745
|
-
|
|
745
|
+
ye(t) === 2 ? t.set(e, n) : t[e] = n;
|
|
746
746
|
}
|
|
747
747
|
function wt(t, e) {
|
|
748
748
|
const n = A(t);
|
|
@@ -765,12 +765,12 @@ function le(t, e) {
|
|
|
765
765
|
function $i(t, e) {
|
|
766
766
|
for (let n = 0; n < e.length - 1; n += 1) {
|
|
767
767
|
const r = e[n];
|
|
768
|
-
if (t = ue(
|
|
768
|
+
if (t = ue(ye(t) === 3 ? Array.from(t) : t, r), typeof t != "object")
|
|
769
769
|
throw new Error(`Cannot resolve patch at '${e.join("/")}'.`);
|
|
770
770
|
}
|
|
771
771
|
return t;
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function Di(t) {
|
|
774
774
|
const e = Object.create(Object.getPrototypeOf(t));
|
|
775
775
|
return Reflect.ownKeys(t).forEach((n) => {
|
|
776
776
|
let r = Reflect.getOwnPropertyDescriptor(t, n);
|
|
@@ -786,7 +786,7 @@ function xi(t) {
|
|
|
786
786
|
}), Reflect.defineProperty(e, n, r);
|
|
787
787
|
}), e;
|
|
788
788
|
}
|
|
789
|
-
const
|
|
789
|
+
const xi = Object.prototype.propertyIsEnumerable;
|
|
790
790
|
function Tr(t, e) {
|
|
791
791
|
let n;
|
|
792
792
|
if (Array.isArray(t))
|
|
@@ -805,7 +805,7 @@ function Tr(t, e) {
|
|
|
805
805
|
return new Map(t);
|
|
806
806
|
} else if (e != null && e.mark && (n = e.mark(t, Y), n !== void 0) && n !== Y.mutable) {
|
|
807
807
|
if (n === Y.immutable)
|
|
808
|
-
return
|
|
808
|
+
return Di(t);
|
|
809
809
|
if (typeof n == "function") {
|
|
810
810
|
if (e.enablePatches || e.enableAutoFreeze)
|
|
811
811
|
throw new Error("You can't use mark and patches or auto freeze together.");
|
|
@@ -817,7 +817,7 @@ function Tr(t, e) {
|
|
|
817
817
|
return Object.keys(t).forEach((i) => {
|
|
818
818
|
r[i] = t[i];
|
|
819
819
|
}), Object.getOwnPropertySymbols(t).forEach((i) => {
|
|
820
|
-
|
|
820
|
+
xi.call(t, i) && (r[i] = t[i]);
|
|
821
821
|
}), r;
|
|
822
822
|
} else
|
|
823
823
|
throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
|
|
@@ -855,7 +855,7 @@ function Re(t) {
|
|
|
855
855
|
return e;
|
|
856
856
|
}
|
|
857
857
|
function Ze(t) {
|
|
858
|
-
return
|
|
858
|
+
return be(t) ? Re(t) : t;
|
|
859
859
|
}
|
|
860
860
|
function re(t) {
|
|
861
861
|
var e;
|
|
@@ -871,24 +871,24 @@ function Te(t, e, n, r, i) {
|
|
|
871
871
|
if (r.length > 0) {
|
|
872
872
|
const u = r.indexOf(o);
|
|
873
873
|
if (o && typeof o == "object" && u !== -1)
|
|
874
|
-
throw r[0] === o ? new Error("Forbids circular reference") : new Error(`Forbids circular reference: ~/${i.slice(0, u).map((
|
|
875
|
-
if (typeof
|
|
876
|
-
return `[${
|
|
877
|
-
const
|
|
878
|
-
return typeof
|
|
874
|
+
throw r[0] === o ? new Error("Forbids circular reference") : new Error(`Forbids circular reference: ~/${i.slice(0, u).map((c, d) => {
|
|
875
|
+
if (typeof c == "symbol")
|
|
876
|
+
return `[${c.toString()}]`;
|
|
877
|
+
const a = r[d];
|
|
878
|
+
return typeof c == "object" && (a instanceof Map || a instanceof Set) ? Array.from(a.keys()).indexOf(c) : c;
|
|
879
879
|
}).join("/")}`);
|
|
880
880
|
r.push(o), i.push(e);
|
|
881
881
|
} else
|
|
882
882
|
r.push(o);
|
|
883
883
|
}
|
|
884
|
-
if (Object.isFrozen(t) ||
|
|
884
|
+
if (Object.isFrozen(t) || be(t)) {
|
|
885
885
|
r.pop(), i.pop();
|
|
886
886
|
return;
|
|
887
887
|
}
|
|
888
|
-
switch (
|
|
888
|
+
switch (ye(t)) {
|
|
889
889
|
case 2:
|
|
890
|
-
for (const [u,
|
|
891
|
-
Te(u, u, n, r, i), Te(
|
|
890
|
+
for (const [u, c] of t)
|
|
891
|
+
Te(u, u, n, r, i), Te(c, u, n, r, i);
|
|
892
892
|
t.set = t.clear = t.delete = Un;
|
|
893
893
|
break;
|
|
894
894
|
case 3:
|
|
@@ -904,14 +904,14 @@ function Te(t, e, n, r, i) {
|
|
|
904
904
|
break;
|
|
905
905
|
default:
|
|
906
906
|
Object.freeze(t), Object.keys(t).forEach((u) => {
|
|
907
|
-
const
|
|
908
|
-
Te(
|
|
907
|
+
const c = t[u];
|
|
908
|
+
Te(c, u, n, r, i);
|
|
909
909
|
});
|
|
910
910
|
}
|
|
911
911
|
r.pop(), i.pop();
|
|
912
912
|
}
|
|
913
913
|
function en(t, e) {
|
|
914
|
-
const n =
|
|
914
|
+
const n = ye(t);
|
|
915
915
|
if (n === 0)
|
|
916
916
|
Reflect.ownKeys(t).forEach((r) => {
|
|
917
917
|
e(r, t[r], t);
|
|
@@ -924,15 +924,15 @@ function en(t, e) {
|
|
|
924
924
|
t.forEach((r, i) => e(i, r, t));
|
|
925
925
|
}
|
|
926
926
|
function wr(t, e, n) {
|
|
927
|
-
if (
|
|
927
|
+
if (be(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;
|
|
930
930
|
if (e.add(t), en(t, (s, o) => {
|
|
931
931
|
var u;
|
|
932
|
-
if (
|
|
933
|
-
const
|
|
934
|
-
z(
|
|
935
|
-
const d = !((u =
|
|
932
|
+
if (be(o)) {
|
|
933
|
+
const c = A(o);
|
|
934
|
+
z(c);
|
|
935
|
+
const d = !((u = c.assignedMap) === null || u === void 0) && u.size || c.operated ? c.copy : c.original;
|
|
936
936
|
Le(r ? i : t, s, d);
|
|
937
937
|
} else
|
|
938
938
|
wr(o, e, n);
|
|
@@ -965,10 +965,10 @@ function tn(t, e, n, r) {
|
|
|
965
965
|
const i = A(n);
|
|
966
966
|
i && (i.callbacks || (i.callbacks = []), i.callbacks.push((s, o) => {
|
|
967
967
|
var u;
|
|
968
|
-
const
|
|
969
|
-
if (oe(ue(
|
|
968
|
+
const c = t.type === 3 ? t.setMap : t.copy;
|
|
969
|
+
if (oe(ue(c, e), n)) {
|
|
970
970
|
let d = i.original;
|
|
971
|
-
i.copy && (d = i.copy), It(t), Pt(t, r, s, o), t.options.enableAutoFreeze && (t.options.updatedValues = (u = t.options.updatedValues) !== null && u !== void 0 ? u : /* @__PURE__ */ new WeakMap(), t.options.updatedValues.set(d, i.original)), Le(
|
|
971
|
+
i.copy && (d = i.copy), It(t), Pt(t, r, s, o), t.options.enableAutoFreeze && (t.options.updatedValues = (u = t.options.updatedValues) !== null && u !== void 0 ? u : /* @__PURE__ */ new WeakMap(), t.options.updatedValues.set(d, i.original)), Le(c, e, d);
|
|
972
972
|
}
|
|
973
973
|
}), t.options.enableAutoFreeze && i.finalities !== t.finalities && (t.options.enableAutoFreeze = !1)), ee(n, t.options) && t.finalities.draft.push(() => {
|
|
974
974
|
const s = t.type === 3 ? t.setMap : t.copy;
|
|
@@ -976,16 +976,16 @@ function tn(t, e, n, r) {
|
|
|
976
976
|
});
|
|
977
977
|
}
|
|
978
978
|
function Li(t, e, n, r, i) {
|
|
979
|
-
let { original: s, assignedMap: o, options: u } = t,
|
|
980
|
-
|
|
979
|
+
let { original: s, assignedMap: o, options: u } = t, c = t.copy;
|
|
980
|
+
c.length < s.length && ([s, c] = [c, s], [n, r] = [r, n]);
|
|
981
981
|
for (let d = 0; d < s.length; d += 1)
|
|
982
|
-
if (o.get(d.toString()) &&
|
|
983
|
-
const
|
|
982
|
+
if (o.get(d.toString()) && c[d] !== s[d]) {
|
|
983
|
+
const a = e.concat([d]), f = le(a, i);
|
|
984
984
|
n.push({
|
|
985
985
|
op: R.Replace,
|
|
986
986
|
path: f,
|
|
987
987
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
988
|
-
value: Ze(
|
|
988
|
+
value: Ze(c[d])
|
|
989
989
|
}), r.push({
|
|
990
990
|
op: R.Replace,
|
|
991
991
|
path: f,
|
|
@@ -993,27 +993,27 @@ function Li(t, e, n, r, i) {
|
|
|
993
993
|
value: Ze(s[d])
|
|
994
994
|
});
|
|
995
995
|
}
|
|
996
|
-
for (let d = s.length; d <
|
|
997
|
-
const
|
|
996
|
+
for (let d = s.length; d < c.length; d += 1) {
|
|
997
|
+
const a = e.concat([d]), f = le(a, i);
|
|
998
998
|
n.push({
|
|
999
999
|
op: R.Add,
|
|
1000
1000
|
path: f,
|
|
1001
1001
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
1002
|
-
value: Ze(
|
|
1002
|
+
value: Ze(c[d])
|
|
1003
1003
|
});
|
|
1004
1004
|
}
|
|
1005
|
-
if (s.length <
|
|
1005
|
+
if (s.length < c.length) {
|
|
1006
1006
|
const { arrayLengthAssignment: d = !0 } = u.enablePatches;
|
|
1007
1007
|
if (d) {
|
|
1008
|
-
const
|
|
1008
|
+
const a = e.concat(["length"]), f = le(a, i);
|
|
1009
1009
|
r.push({
|
|
1010
1010
|
op: R.Replace,
|
|
1011
1011
|
path: f,
|
|
1012
1012
|
value: s.length
|
|
1013
1013
|
});
|
|
1014
1014
|
} else
|
|
1015
|
-
for (let
|
|
1016
|
-
const f = e.concat([
|
|
1015
|
+
for (let a = c.length; s.length < a; a -= 1) {
|
|
1016
|
+
const f = e.concat([a - 1]), h = le(f, i);
|
|
1017
1017
|
r.push({
|
|
1018
1018
|
op: R.Remove,
|
|
1019
1019
|
path: h
|
|
@@ -1022,19 +1022,19 @@ function Li(t, e, n, r, i) {
|
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
1024
|
function Fi({ original: t, copy: e, assignedMap: n }, r, i, s, o) {
|
|
1025
|
-
n.forEach((u,
|
|
1026
|
-
const d = ue(t,
|
|
1027
|
-
if (oe(d,
|
|
1025
|
+
n.forEach((u, c) => {
|
|
1026
|
+
const d = ue(t, c), a = Ze(ue(e, c)), f = u ? De(t, c) ? R.Replace : R.Add : R.Remove;
|
|
1027
|
+
if (oe(d, a) && f === R.Replace)
|
|
1028
1028
|
return;
|
|
1029
|
-
const h = r.concat(
|
|
1030
|
-
i.push(f === R.Remove ? { op: f, path: p } : { op: f, path: p, value:
|
|
1029
|
+
const h = r.concat(c), p = le(h, o);
|
|
1030
|
+
i.push(f === R.Remove ? { op: f, path: p } : { op: f, path: p, value: a }), s.push(f === R.Add ? { op: R.Remove, path: p } : f === R.Remove ? { op: R.Add, path: p, value: d } : { op: R.Replace, path: p, value: d });
|
|
1031
1031
|
});
|
|
1032
1032
|
}
|
|
1033
1033
|
function Ni({ original: t, copy: e }, n, r, i, s) {
|
|
1034
1034
|
let o = 0;
|
|
1035
1035
|
t.forEach((u) => {
|
|
1036
1036
|
if (!e.has(u)) {
|
|
1037
|
-
const
|
|
1037
|
+
const c = n.concat([o]), d = le(c, s);
|
|
1038
1038
|
r.push({
|
|
1039
1039
|
op: R.Remove,
|
|
1040
1040
|
path: d,
|
|
@@ -1048,7 +1048,7 @@ function Ni({ original: t, copy: e }, n, r, i, s) {
|
|
|
1048
1048
|
o += 1;
|
|
1049
1049
|
}), o = 0, e.forEach((u) => {
|
|
1050
1050
|
if (!t.has(u)) {
|
|
1051
|
-
const
|
|
1051
|
+
const c = n.concat([o]), d = le(c, s);
|
|
1052
1052
|
r.push({
|
|
1053
1053
|
op: R.Add,
|
|
1054
1054
|
path: d,
|
|
@@ -1165,17 +1165,17 @@ const nt = (t, e, n = !1) => {
|
|
|
1165
1165
|
return s;
|
|
1166
1166
|
const o = s.value;
|
|
1167
1167
|
let u = t.setMap.get(o);
|
|
1168
|
-
const
|
|
1169
|
-
if (t.options.strict && nt(o, t.options, d), !d && !
|
|
1170
|
-
const
|
|
1168
|
+
const c = A(u), d = ((i = (r = t.options).mark) === null || i === void 0 ? void 0 : i.call(r, u, Y)) === Y.mutable;
|
|
1169
|
+
if (t.options.strict && nt(o, t.options, d), !d && !c && ee(o, t.options) && !t.finalized && t.original.has(o)) {
|
|
1170
|
+
const a = Yt.createDraft({
|
|
1171
1171
|
original: o,
|
|
1172
1172
|
parentDraft: t,
|
|
1173
1173
|
key: o,
|
|
1174
1174
|
finalities: t.finalities,
|
|
1175
1175
|
options: t.options
|
|
1176
1176
|
});
|
|
1177
|
-
t.setMap.set(o,
|
|
1178
|
-
} else
|
|
1177
|
+
t.setMap.set(o, a), u = a;
|
|
1178
|
+
} else c && (u = c.proxy);
|
|
1179
1179
|
return {
|
|
1180
1180
|
done: !1,
|
|
1181
1181
|
value: n ? u : [u, u]
|
|
@@ -1298,17 +1298,17 @@ const qi = Reflect.ownKeys(rt), mr = /* @__PURE__ */ new WeakSet(), Sr = {
|
|
|
1298
1298
|
if (d)
|
|
1299
1299
|
return d.bind(t.proxy);
|
|
1300
1300
|
}
|
|
1301
|
-
if (!
|
|
1302
|
-
const d =
|
|
1301
|
+
if (!De(u, e)) {
|
|
1302
|
+
const d = xn(u, e);
|
|
1303
1303
|
return d ? "value" in d ? d.value : (
|
|
1304
1304
|
// !case: support for getter
|
|
1305
1305
|
(i = d.get) === null || i === void 0 ? void 0 : i.call(t.proxy)
|
|
1306
1306
|
) : void 0;
|
|
1307
1307
|
}
|
|
1308
|
-
const
|
|
1309
|
-
if (t.options.strict && nt(
|
|
1310
|
-
return
|
|
1311
|
-
if (
|
|
1308
|
+
const c = u[e];
|
|
1309
|
+
if (t.options.strict && nt(c, t.options), t.finalized || !ee(c, t.options))
|
|
1310
|
+
return c;
|
|
1311
|
+
if (c === wt(t.original, e)) {
|
|
1312
1312
|
if (z(t), t.copy[e] = nn({
|
|
1313
1313
|
original: t.original[e],
|
|
1314
1314
|
parentDraft: t,
|
|
@@ -1321,7 +1321,7 @@ const qi = Reflect.ownKeys(rt), mr = /* @__PURE__ */ new WeakSet(), Sr = {
|
|
|
1321
1321
|
}
|
|
1322
1322
|
return t.copy[e];
|
|
1323
1323
|
}
|
|
1324
|
-
return
|
|
1324
|
+
return c;
|
|
1325
1325
|
},
|
|
1326
1326
|
set(t, e, n) {
|
|
1327
1327
|
var r;
|
|
@@ -1330,11 +1330,11 @@ const qi = Reflect.ownKeys(rt), mr = /* @__PURE__ */ new WeakSet(), Sr = {
|
|
|
1330
1330
|
let i;
|
|
1331
1331
|
if (t.type === 1 && e !== "length" && !(Number.isInteger(i = Number(e)) && i >= 0 && (e === 0 || i === 0 || String(i) === String(e))))
|
|
1332
1332
|
throw new Error("Only supports setting array indices and the 'length' property.");
|
|
1333
|
-
const s =
|
|
1333
|
+
const s = xn(H(t), e);
|
|
1334
1334
|
if (s != null && s.set)
|
|
1335
1335
|
return s.set.call(t.proxy, n), !0;
|
|
1336
1336
|
const o = wt(H(t), e), u = A(o);
|
|
1337
|
-
return u && oe(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) : (oe(n, o) && (n !== void 0 ||
|
|
1337
|
+
return u && oe(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) : (oe(n, o) && (n !== void 0 || De(t.original, e)) || (z(t), re(t), De(t.original, e) && oe(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n, tn(t, e, n, Ue)), !0);
|
|
1338
1338
|
},
|
|
1339
1339
|
has(t, e) {
|
|
1340
1340
|
return e in H(t);
|
|
@@ -1366,7 +1366,7 @@ const qi = Reflect.ownKeys(rt), mr = /* @__PURE__ */ new WeakSet(), Sr = {
|
|
|
1366
1366
|
}
|
|
1367
1367
|
};
|
|
1368
1368
|
function nn(t) {
|
|
1369
|
-
const { original: e, parentDraft: n, key: r, finalities: i, options: s } = t, o =
|
|
1369
|
+
const { original: e, parentDraft: n, key: r, finalities: i, options: s } = t, o = ye(e), u = {
|
|
1370
1370
|
type: o,
|
|
1371
1371
|
finalized: !1,
|
|
1372
1372
|
parent: n,
|
|
@@ -1379,42 +1379,42 @@ function nn(t) {
|
|
|
1379
1379
|
setMap: o === 3 ? new Map(e.entries()) : void 0
|
|
1380
1380
|
};
|
|
1381
1381
|
(r || "key" in t) && (u.key = r);
|
|
1382
|
-
const { proxy:
|
|
1383
|
-
if (i.revoke.push(d), mr.add(
|
|
1384
|
-
const
|
|
1385
|
-
|
|
1386
|
-
var p,
|
|
1387
|
-
const g = A(
|
|
1388
|
-
let w =
|
|
1382
|
+
const { proxy: c, revoke: d } = Proxy.revocable(o === 1 ? Object.assign([], u) : u, Sr);
|
|
1383
|
+
if (i.revoke.push(d), mr.add(c), u.proxy = c, n) {
|
|
1384
|
+
const a = n;
|
|
1385
|
+
a.finalities.draft.push((f, h) => {
|
|
1386
|
+
var p, y;
|
|
1387
|
+
const g = A(c);
|
|
1388
|
+
let w = a.type === 3 ? a.setMap : a.copy;
|
|
1389
1389
|
const _ = ue(w, r), m = A(_);
|
|
1390
1390
|
if (m) {
|
|
1391
1391
|
let S = m.original;
|
|
1392
|
-
m.operated && (S = Xt(_)), It(m), Pt(m, Ue, f, h),
|
|
1392
|
+
m.operated && (S = Xt(_)), It(m), Pt(m, Ue, f, h), a.options.enableAutoFreeze && (a.options.updatedValues = (p = a.options.updatedValues) !== null && p !== void 0 ? p : /* @__PURE__ */ new WeakMap(), a.options.updatedValues.set(S, m.original)), Le(w, r, S);
|
|
1393
1393
|
}
|
|
1394
|
-
(
|
|
1394
|
+
(y = g.callbacks) === null || y === void 0 || y.forEach((S) => {
|
|
1395
1395
|
S(f, h);
|
|
1396
1396
|
});
|
|
1397
1397
|
});
|
|
1398
1398
|
} else {
|
|
1399
|
-
const
|
|
1400
|
-
|
|
1401
|
-
It(
|
|
1399
|
+
const a = A(c);
|
|
1400
|
+
a.finalities.draft.push((f, h) => {
|
|
1401
|
+
It(a), Pt(a, Ue, f, h);
|
|
1402
1402
|
});
|
|
1403
1403
|
}
|
|
1404
|
-
return
|
|
1404
|
+
return c;
|
|
1405
1405
|
}
|
|
1406
1406
|
Yt.createDraft = nn;
|
|
1407
1407
|
function Wi(t, e, n, r, i) {
|
|
1408
1408
|
var s;
|
|
1409
|
-
const o = A(t), u = (s = o == null ? void 0 : o.original) !== null && s !== void 0 ? s : t,
|
|
1409
|
+
const o = A(t), u = (s = o == null ? void 0 : o.original) !== null && s !== void 0 ? s : t, c = !!e.length;
|
|
1410
1410
|
if (o != null && o.operated)
|
|
1411
1411
|
for (; o.finalities.draft.length > 0; )
|
|
1412
1412
|
o.finalities.draft.pop()(n, r);
|
|
1413
|
-
const d =
|
|
1413
|
+
const d = c ? e[0] : o ? o.operated ? o.copy : o.original : t;
|
|
1414
1414
|
return o && kt(o), i && Te(d, d, o == null ? void 0 : o.options.updatedValues), [
|
|
1415
1415
|
d,
|
|
1416
|
-
n &&
|
|
1417
|
-
r &&
|
|
1416
|
+
n && c ? [{ op: R.Replace, path: [], value: e[0] }] : n,
|
|
1417
|
+
r && c ? [{ op: R.Replace, path: [], value: u }] : r
|
|
1418
1418
|
];
|
|
1419
1419
|
}
|
|
1420
1420
|
function zi(t, e) {
|
|
@@ -1434,22 +1434,22 @@ function zi(t, e) {
|
|
|
1434
1434
|
});
|
|
1435
1435
|
return [
|
|
1436
1436
|
u,
|
|
1437
|
-
(
|
|
1438
|
-
const [d,
|
|
1439
|
-
return e.enablePatches ? [d,
|
|
1437
|
+
(c = []) => {
|
|
1438
|
+
const [d, a, f] = Wi(u, c, i, s, e.enableAutoFreeze);
|
|
1439
|
+
return e.enablePatches ? [d, a, f] : d;
|
|
1440
1440
|
}
|
|
1441
1441
|
];
|
|
1442
1442
|
}
|
|
1443
1443
|
function Rt(t) {
|
|
1444
1444
|
const { rootDraft: e, value: n, useRawReturn: r = !1, isRoot: i = !0 } = t;
|
|
1445
1445
|
en(n, (s, o, u) => {
|
|
1446
|
-
const
|
|
1447
|
-
if (
|
|
1446
|
+
const c = A(o);
|
|
1447
|
+
if (c && e && c.finalities === e.finalities) {
|
|
1448
1448
|
t.isContainDraft = !0;
|
|
1449
|
-
const d =
|
|
1449
|
+
const d = c.original;
|
|
1450
1450
|
if (u instanceof Set) {
|
|
1451
|
-
const
|
|
1452
|
-
u.clear(),
|
|
1451
|
+
const a = Array.from(u);
|
|
1452
|
+
u.clear(), a.forEach((f) => u.add(s === f ? d : f));
|
|
1453
1453
|
} else
|
|
1454
1454
|
Le(u, s, d);
|
|
1455
1455
|
} else typeof o == "object" && o !== null && (t.value = o, t.isRoot = !1, Rt(t));
|
|
@@ -1460,7 +1460,7 @@ function vr(t) {
|
|
|
1460
1460
|
const n = A(t);
|
|
1461
1461
|
if (!ee(t, n == null ? void 0 : n.options))
|
|
1462
1462
|
return t;
|
|
1463
|
-
const r =
|
|
1463
|
+
const r = ye(t);
|
|
1464
1464
|
if (n && !n.operated)
|
|
1465
1465
|
return n.original;
|
|
1466
1466
|
let i;
|
|
@@ -1479,8 +1479,8 @@ function vr(t) {
|
|
|
1479
1479
|
if (en(i, (o, u) => {
|
|
1480
1480
|
if (n && oe(ue(n.original, o), u))
|
|
1481
1481
|
return;
|
|
1482
|
-
const
|
|
1483
|
-
|
|
1482
|
+
const c = vr(u);
|
|
1483
|
+
c !== u && (i === t && s(), Le(i, o, c));
|
|
1484
1484
|
}), r === 3) {
|
|
1485
1485
|
const o = (e = n == null ? void 0 : n.original) !== null && e !== void 0 ? e : i;
|
|
1486
1486
|
return Jt(o) ? new Set(i) : new (Object.getPrototypeOf(o)).constructor(i);
|
|
@@ -1488,7 +1488,7 @@ function vr(t) {
|
|
|
1488
1488
|
return i;
|
|
1489
1489
|
}
|
|
1490
1490
|
function Fn(t) {
|
|
1491
|
-
if (!
|
|
1491
|
+
if (!be(t))
|
|
1492
1492
|
throw new Error(`current() is only used for Draft, parameter: ${t}`);
|
|
1493
1493
|
return vr(t);
|
|
1494
1494
|
}
|
|
@@ -1498,23 +1498,23 @@ const Ki = (t) => function e(n, r, i) {
|
|
|
1498
1498
|
return function(O, ...P) {
|
|
1499
1499
|
return e(O, (N) => n.call(this, N, ...P), r);
|
|
1500
1500
|
};
|
|
1501
|
-
const
|
|
1502
|
-
let
|
|
1503
|
-
if (typeof r != "function" && (
|
|
1504
|
-
throw new Error(`Invalid options: ${
|
|
1505
|
-
|
|
1506
|
-
const f =
|
|
1507
|
-
for (const N of
|
|
1501
|
+
const c = n, d = r;
|
|
1502
|
+
let a = i;
|
|
1503
|
+
if (typeof r != "function" && (a = r), a !== void 0 && Object.prototype.toString.call(a) !== "[object Object]")
|
|
1504
|
+
throw new Error(`Invalid options: ${a}, 'options' should be an object.`);
|
|
1505
|
+
a = Object.assign(Object.assign({}, t), a);
|
|
1506
|
+
const f = be(c) ? Fn(c) : c, h = Array.isArray(a.mark) ? (O, P) => {
|
|
1507
|
+
for (const N of a.mark) {
|
|
1508
1508
|
if (typeof N != "function")
|
|
1509
1509
|
throw new Error(`Invalid mark: ${N}, 'mark' should be a function.`);
|
|
1510
1510
|
const q = N(O, P);
|
|
1511
1511
|
if (q)
|
|
1512
1512
|
return q;
|
|
1513
1513
|
}
|
|
1514
|
-
} :
|
|
1515
|
-
enableAutoFreeze: (u =
|
|
1514
|
+
} : a.mark, p = (s = a.enablePatches) !== null && s !== void 0 ? s : !1, y = (o = a.strict) !== null && o !== void 0 ? o : !1, w = {
|
|
1515
|
+
enableAutoFreeze: (u = a.enableAutoFreeze) !== null && u !== void 0 ? u : !1,
|
|
1516
1516
|
mark: h,
|
|
1517
|
-
strict:
|
|
1517
|
+
strict: y,
|
|
1518
1518
|
enablePatches: p
|
|
1519
1519
|
};
|
|
1520
1520
|
if (!ee(f, w) && typeof f == "object" && f !== null)
|
|
@@ -1531,9 +1531,9 @@ const Ki = (t) => function e(n, r, i) {
|
|
|
1531
1531
|
} catch (O) {
|
|
1532
1532
|
throw kt(A(_)), O;
|
|
1533
1533
|
}
|
|
1534
|
-
const
|
|
1534
|
+
const x = (O) => {
|
|
1535
1535
|
const P = A(_);
|
|
1536
|
-
if (!
|
|
1536
|
+
if (!be(O)) {
|
|
1537
1537
|
if (O !== void 0 && !oe(O, _) && (P != null && P.operated))
|
|
1538
1538
|
throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
|
|
1539
1539
|
const q = O == null ? void 0 : O[Ri];
|
|
@@ -1558,9 +1558,9 @@ const Ki = (t) => function e(n, r, i) {
|
|
|
1558
1558
|
}
|
|
1559
1559
|
return m([O]);
|
|
1560
1560
|
};
|
|
1561
|
-
return S instanceof Promise ? S.then(
|
|
1561
|
+
return S instanceof Promise ? S.then(x, (O) => {
|
|
1562
1562
|
throw kt(A(_)), O;
|
|
1563
|
-
}) :
|
|
1563
|
+
}) : x(S);
|
|
1564
1564
|
}, $t = Ki();
|
|
1565
1565
|
Object.prototype.constructor.toString();
|
|
1566
1566
|
function Or(t, e) {
|
|
@@ -1876,8 +1876,8 @@ function is(t) {
|
|
|
1876
1876
|
const [e, n] = t.split(", "), [r, i, s] = e.split("/").map(Number), o = n.match(/(\d{1,2}):(\d{2}):(\d{2}) (AM|PM)/);
|
|
1877
1877
|
if (!o)
|
|
1878
1878
|
throw new Error(`Unable to parse time from: ${t}`);
|
|
1879
|
-
let [, u,
|
|
1880
|
-
return u = Number(u),
|
|
1879
|
+
let [, u, c, d, a] = o;
|
|
1880
|
+
return u = Number(u), c = Number(c), d = Number(d), a === "PM" && u !== 12 ? u += 12 : a === "AM" && u === 12 && (u = 0), new Date(Date.UTC(s, r - 1, i, u, c, d));
|
|
1881
1881
|
}
|
|
1882
1882
|
function ss(t) {
|
|
1883
1883
|
switch (t) {
|
|
@@ -1919,7 +1919,7 @@ function as(t, e) {
|
|
|
1919
1919
|
return null;
|
|
1920
1920
|
}
|
|
1921
1921
|
}
|
|
1922
|
-
function
|
|
1922
|
+
function Dt(t) {
|
|
1923
1923
|
for (const e of us) {
|
|
1924
1924
|
const n = as(e, t);
|
|
1925
1925
|
if (n)
|
|
@@ -1930,7 +1930,7 @@ function xt(t) {
|
|
|
1930
1930
|
function cs(t) {
|
|
1931
1931
|
try {
|
|
1932
1932
|
const e = JSON.parse(t);
|
|
1933
|
-
return typeof e == "string" ?
|
|
1933
|
+
return typeof e == "string" ? Dt(e) : null;
|
|
1934
1934
|
} catch {
|
|
1935
1935
|
return null;
|
|
1936
1936
|
}
|
|
@@ -1942,7 +1942,7 @@ function ot(t) {
|
|
|
1942
1942
|
if (t instanceof Date)
|
|
1943
1943
|
return t;
|
|
1944
1944
|
if (typeof t == "string") {
|
|
1945
|
-
const e =
|
|
1945
|
+
const e = Dt(t) || cs(t) || Dt(t.trim());
|
|
1946
1946
|
if (!e)
|
|
1947
1947
|
throw new Error(`Unable to parse \`${t}\` as a date.`);
|
|
1948
1948
|
return e;
|
|
@@ -1990,22 +1990,22 @@ function B(t, e, n) {
|
|
|
1990
1990
|
function Cr(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
|
-
let [u,
|
|
1994
|
-
const f = Ee(t,
|
|
1993
|
+
let [u, c, d, a] = o;
|
|
1994
|
+
const f = Ee(t, c);
|
|
1995
1995
|
if (!f) {
|
|
1996
1996
|
console.warn("no such attr", u, t);
|
|
1997
1997
|
continue;
|
|
1998
1998
|
}
|
|
1999
|
-
f["checked-data-type"] === "date" && n && (d = ot(d), o[2] = d), sn(f) && B(s, [d,
|
|
1999
|
+
f["checked-data-type"] === "date" && n && (d = ot(d), o[2] = d), sn(f) && B(s, [d, c, u], o), B(r, [u, c, d], o), B(i, [c, u, d], o);
|
|
2000
2000
|
}
|
|
2001
2001
|
return { eav: r, aev: i, vae: s };
|
|
2002
2002
|
}
|
|
2003
2003
|
function jr(t) {
|
|
2004
2004
|
const e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
2005
2005
|
for (const s of Object.values(t)) {
|
|
2006
|
-
const o = s["forward-identity"], [u,
|
|
2007
|
-
if (B(r, [
|
|
2008
|
-
const [f, h, p] =
|
|
2006
|
+
const o = s["forward-identity"], [u, c, d] = o, a = s["reverse-identity"];
|
|
2007
|
+
if (B(r, [c, d], s), on(s) && B(e, [c, d], s), s["primary?"] && B(n, [c], s), a) {
|
|
2008
|
+
const [f, h, p] = a;
|
|
2009
2009
|
B(i, [h, p], s);
|
|
2010
2010
|
}
|
|
2011
2011
|
}
|
|
@@ -2035,24 +2035,24 @@ function Fe(t, e) {
|
|
|
2035
2035
|
var n, r;
|
|
2036
2036
|
let i;
|
|
2037
2037
|
if (Array.isArray(e[0])) {
|
|
2038
|
-
const [o, u] = e[0],
|
|
2039
|
-
if (!
|
|
2038
|
+
const [o, u] = e[0], c = t.aev.get(o);
|
|
2039
|
+
if (!c)
|
|
2040
2040
|
return null;
|
|
2041
|
-
i = (n = Q(
|
|
2041
|
+
i = (n = Q(c, 2).find((a) => a[2] === u)) === null || n === void 0 ? void 0 : n[0];
|
|
2042
2042
|
} else
|
|
2043
2043
|
i = e[0];
|
|
2044
2044
|
if (!i)
|
|
2045
2045
|
return null;
|
|
2046
2046
|
const s = e[2];
|
|
2047
2047
|
if (Array.isArray(s) && s.length === 2 && t.aev.get(s[0])) {
|
|
2048
|
-
const [o, u] = s,
|
|
2049
|
-
if (!a)
|
|
2050
|
-
return null;
|
|
2051
|
-
const c = (r = Q(a, 2).find((g) => g[2] === u)) === null || r === void 0 ? void 0 : r[0];
|
|
2048
|
+
const [o, u] = s, c = t.aev.get(o);
|
|
2052
2049
|
if (!c)
|
|
2053
2050
|
return null;
|
|
2054
|
-
const
|
|
2055
|
-
|
|
2051
|
+
const a = (r = Q(c, 2).find((g) => g[2] === u)) === null || r === void 0 ? void 0 : r[0];
|
|
2052
|
+
if (!a)
|
|
2053
|
+
return null;
|
|
2054
|
+
const [f, h, p, ...y] = e;
|
|
2055
|
+
return [i, h, a, ...y];
|
|
2056
2056
|
} else {
|
|
2057
2057
|
const [o, ...u] = e;
|
|
2058
2058
|
return [i, ...u];
|
|
@@ -2072,7 +2072,7 @@ function Mr(t, e, n) {
|
|
|
2072
2072
|
const u = ut(t.ea, [r, i, s]);
|
|
2073
2073
|
return u && (o = u[3]), o || Date.now() * 10 + fs++;
|
|
2074
2074
|
}
|
|
2075
|
-
function
|
|
2075
|
+
function xt(t, e) {
|
|
2076
2076
|
var n;
|
|
2077
2077
|
const r = Fe(t, e);
|
|
2078
2078
|
if (!r)
|
|
@@ -2082,8 +2082,8 @@ function Dt(t, e) {
|
|
|
2082
2082
|
if (!u)
|
|
2083
2083
|
return;
|
|
2084
2084
|
u["checked-data-type"] === "date" && t.useDateObjects && (o = ot(o));
|
|
2085
|
-
const
|
|
2086
|
-
ds(u) ? (B(t.eav, [i, s], /* @__PURE__ */ new Map([[o,
|
|
2085
|
+
const c = ut(t.eav, [i, s, o]), d = (n = c == null ? void 0 : c[3]) !== null && n !== void 0 ? n : Mr(t, u, r), a = [i, s, o, d];
|
|
2086
|
+
ds(u) ? (B(t.eav, [i, s], /* @__PURE__ */ new Map([[o, a]])), B(t.aev, [s, i], /* @__PURE__ */ new Map([[o, a]]))) : (B(t.eav, [i, s, o], a), B(t.aev, [s, i, o], a)), sn(u) && B(t.vae, [o, s, i], a);
|
|
2087
2087
|
}
|
|
2088
2088
|
function ls(t, e) {
|
|
2089
2089
|
var n;
|
|
@@ -2095,13 +2095,13 @@ function ls(t, e) {
|
|
|
2095
2095
|
return;
|
|
2096
2096
|
if (!on(u))
|
|
2097
2097
|
throw new Error("merge operation is not supported for links");
|
|
2098
|
-
const
|
|
2099
|
-
if (!
|
|
2098
|
+
const c = ut(t.eav, [i, s]);
|
|
2099
|
+
if (!c)
|
|
2100
2100
|
return;
|
|
2101
|
-
const d = (n =
|
|
2101
|
+
const d = (n = c.values().next()) === null || n === void 0 ? void 0 : n.value;
|
|
2102
2102
|
if (!d)
|
|
2103
2103
|
return;
|
|
2104
|
-
const
|
|
2104
|
+
const a = d[2], f = Er(a, o), h = [
|
|
2105
2105
|
i,
|
|
2106
2106
|
s,
|
|
2107
2107
|
f,
|
|
@@ -2114,26 +2114,26 @@ function Ut(t, e) {
|
|
|
2114
2114
|
const [i, s] = e, o = Fe(t, [i]);
|
|
2115
2115
|
if (!o)
|
|
2116
2116
|
return;
|
|
2117
|
-
const [u] = o,
|
|
2118
|
-
if (
|
|
2119
|
-
for (const
|
|
2120
|
-
const f = t.attrs[
|
|
2121
|
-
f && f["on-delete-reverse"] === "cascade" && Q(
|
|
2117
|
+
const [u] = o, c = t.eav.get(u);
|
|
2118
|
+
if (c) {
|
|
2119
|
+
for (const a of c.keys()) {
|
|
2120
|
+
const f = t.attrs[a];
|
|
2121
|
+
f && f["on-delete-reverse"] === "cascade" && Q(c.get(a), 1).forEach(([h, p, y]) => {
|
|
2122
2122
|
var g;
|
|
2123
|
-
return Ut(t, [
|
|
2123
|
+
return Ut(t, [y, (g = f["reverse-identity"]) === null || g === void 0 ? void 0 : g[1]]);
|
|
2124
2124
|
}), // Fall back to deleting everything if we've rehydrated tx-steps from
|
|
2125
2125
|
// the store that didn't set `etype` in deleteEntity
|
|
2126
2126
|
(!s || // If we don't know about the attr, let's just get rid of it
|
|
2127
2127
|
!f || // Make sure it matches the etype
|
|
2128
|
-
((n = f["forward-identity"]) === null || n === void 0 ? void 0 : n[1]) === s) && (X(t.aev, [
|
|
2128
|
+
((n = f["forward-identity"]) === null || n === void 0 ? void 0 : n[1]) === s) && (X(t.aev, [a, u]), X(t.eav, [u, a]));
|
|
2129
2129
|
}
|
|
2130
|
-
|
|
2130
|
+
c.size === 0 && X(t.eav, [u]);
|
|
2131
2131
|
}
|
|
2132
2132
|
const d = t.vae.get(u) && Q(t.vae.get(u), 2);
|
|
2133
|
-
d && d.forEach((
|
|
2133
|
+
d && d.forEach((a) => {
|
|
2134
2134
|
var f, h, p;
|
|
2135
|
-
const [
|
|
2136
|
-
(!s || !_ || ((f = _["reverse-identity"]) === null || f === void 0 ? void 0 : f[1]) === s) && (X(t.eav, [
|
|
2135
|
+
const [y, g, w] = a, _ = t.attrs[g];
|
|
2136
|
+
(!s || !_ || ((f = _["reverse-identity"]) === null || f === void 0 ? void 0 : f[1]) === s) && (X(t.eav, [y, g, w]), X(t.aev, [g, y, w]), X(t.vae, [w, g, y])), _ && _["on-delete"] === "cascade" && ((h = _["reverse-identity"]) === null || h === void 0 ? void 0 : h[1]) === s && Ut(t, [y, (p = _["forward-identity"]) === null || p === void 0 ? void 0 : p[1]]);
|
|
2137
2137
|
}), ((r = t.vae.get(u)) === null || r === void 0 ? void 0 : r.size) === 0 && X(t.vae, [u]);
|
|
2138
2138
|
}
|
|
2139
2139
|
function Rr(t, e) {
|
|
@@ -2154,15 +2154,15 @@ function ps(t, [e]) {
|
|
|
2154
2154
|
const n = $r(t).filter(([r, i]) => i !== e);
|
|
2155
2155
|
delete t.attrs[e], un(t), Rr(t, n);
|
|
2156
2156
|
}
|
|
2157
|
-
function
|
|
2157
|
+
function bs(t, [e]) {
|
|
2158
2158
|
const n = t.attrs[e.id];
|
|
2159
2159
|
n && (t.attrs[e.id] = Object.assign(Object.assign({}, n), e), un(t), Rr(t, $r(t)));
|
|
2160
2160
|
}
|
|
2161
|
-
function
|
|
2161
|
+
function ys(t, e) {
|
|
2162
2162
|
const [n, ...r] = e;
|
|
2163
2163
|
switch (n) {
|
|
2164
2164
|
case "add-triple":
|
|
2165
|
-
|
|
2165
|
+
xt(t, r);
|
|
2166
2166
|
break;
|
|
2167
2167
|
case "deep-merge-triple":
|
|
2168
2168
|
ls(t, r);
|
|
@@ -2180,7 +2180,7 @@ function bs(t, e) {
|
|
|
2180
2180
|
ps(t, r);
|
|
2181
2181
|
break;
|
|
2182
2182
|
case "update-attr":
|
|
2183
|
-
|
|
2183
|
+
bs(t, r);
|
|
2184
2184
|
break;
|
|
2185
2185
|
case "restore-attr":
|
|
2186
2186
|
break;
|
|
@@ -2211,17 +2211,17 @@ function Ge(t, e, n) {
|
|
|
2211
2211
|
return s;
|
|
2212
2212
|
}
|
|
2213
2213
|
if (n != null && n.hasOwnProperty("$isNull")) {
|
|
2214
|
-
const { attrId: u, isNull:
|
|
2214
|
+
const { attrId: u, isNull: c, reverse: d } = n.$isNull;
|
|
2215
2215
|
if (d)
|
|
2216
|
-
for (const
|
|
2217
|
-
const f = t.vae.get(
|
|
2218
|
-
(
|
|
2216
|
+
for (const a of e.keys()) {
|
|
2217
|
+
const f = t.vae.get(a), h = !f || ((r = f.get(u)) === null || r === void 0 ? void 0 : r.get(null)) || !f.get(u);
|
|
2218
|
+
(c ? h : !h) && s.push(e.get(a));
|
|
2219
2219
|
}
|
|
2220
2220
|
else {
|
|
2221
|
-
const
|
|
2221
|
+
const a = t.aev.get(u);
|
|
2222
2222
|
for (const f of e.keys()) {
|
|
2223
|
-
const h = !
|
|
2224
|
-
(
|
|
2223
|
+
const h = !a || ((i = a.get(f)) === null || i === void 0 ? void 0 : i.get(null)) || !a.get(f);
|
|
2224
|
+
(c ? h : !h) && s.push(e.get(f));
|
|
2225
2225
|
}
|
|
2226
2226
|
}
|
|
2227
2227
|
return s;
|
|
@@ -2230,8 +2230,8 @@ function Ge(t, e, n) {
|
|
|
2230
2230
|
return Q(e, 1).filter(n.$op);
|
|
2231
2231
|
const o = n.in || n.$in || [n];
|
|
2232
2232
|
for (const u of o) {
|
|
2233
|
-
const
|
|
2234
|
-
|
|
2233
|
+
const c = e.get(u);
|
|
2234
|
+
c && s.push(c);
|
|
2235
2235
|
}
|
|
2236
2236
|
return s;
|
|
2237
2237
|
}
|
|
@@ -2258,10 +2258,10 @@ function gs(t, [e, n, r]) {
|
|
|
2258
2258
|
const u = t.eav.get(e);
|
|
2259
2259
|
if (!u)
|
|
2260
2260
|
return [];
|
|
2261
|
-
const
|
|
2261
|
+
const c = [];
|
|
2262
2262
|
for (const d of u.values())
|
|
2263
|
-
|
|
2264
|
-
return
|
|
2263
|
+
c.push(...Ge(t, d, r));
|
|
2264
|
+
return c;
|
|
2265
2265
|
}
|
|
2266
2266
|
case "a": {
|
|
2267
2267
|
const u = t.aev.get(n);
|
|
@@ -2271,15 +2271,15 @@ function gs(t, [e, n, r]) {
|
|
|
2271
2271
|
const u = t.aev.get(n);
|
|
2272
2272
|
if (!u)
|
|
2273
2273
|
return [];
|
|
2274
|
-
const
|
|
2274
|
+
const c = [];
|
|
2275
2275
|
for (const d of u.values())
|
|
2276
|
-
|
|
2277
|
-
return
|
|
2276
|
+
c.push(...Ge(t, d, r));
|
|
2277
|
+
return c;
|
|
2278
2278
|
}
|
|
2279
2279
|
case "v": {
|
|
2280
2280
|
const u = [];
|
|
2281
|
-
for (const
|
|
2282
|
-
for (const d of
|
|
2281
|
+
for (const c of t.eav.values())
|
|
2282
|
+
for (const d of c.values())
|
|
2283
2283
|
u.push(...Ge(t, d, r));
|
|
2284
2284
|
return u;
|
|
2285
2285
|
}
|
|
@@ -2291,8 +2291,8 @@ function Ts(t, e, n) {
|
|
|
2291
2291
|
var r;
|
|
2292
2292
|
const i = {};
|
|
2293
2293
|
for (const [s, o] of e.entries()) {
|
|
2294
|
-
const u = (r = t.eav.get(n)) === null || r === void 0 ? void 0 : r.get(o.id),
|
|
2295
|
-
for (const d of
|
|
2294
|
+
const u = (r = t.eav.get(n)) === null || r === void 0 ? void 0 : r.get(o.id), c = Q(u, 1);
|
|
2295
|
+
for (const d of c)
|
|
2296
2296
|
i[s] = d[2];
|
|
2297
2297
|
}
|
|
2298
2298
|
return i;
|
|
@@ -2301,14 +2301,14 @@ function me(t, e, n) {
|
|
|
2301
2301
|
var r;
|
|
2302
2302
|
return (r = t.attrIndexes.forwardIdents.get(e)) === null || r === void 0 ? void 0 : r.get(n);
|
|
2303
2303
|
}
|
|
2304
|
-
function
|
|
2304
|
+
function Dr(t, e, n) {
|
|
2305
2305
|
var r;
|
|
2306
2306
|
return (r = t.attrIndexes.revIdents.get(e)) === null || r === void 0 ? void 0 : r.get(n);
|
|
2307
2307
|
}
|
|
2308
2308
|
function ws(t, e) {
|
|
2309
2309
|
return t.attrIndexes.blobAttrs.get(e);
|
|
2310
2310
|
}
|
|
2311
|
-
function
|
|
2311
|
+
function xr(t, e) {
|
|
2312
2312
|
var n;
|
|
2313
2313
|
const r = t.attrIndexes.primaryKeys.get(e);
|
|
2314
2314
|
return r || ((n = t.attrIndexes.forwardIdents.get(e)) === null || n === void 0 ? void 0 : n.get("id"));
|
|
@@ -2325,20 +2325,20 @@ function Ss(t, e) {
|
|
|
2325
2325
|
const n = e.filter(([r, i, s, o, u]) => {
|
|
2326
2326
|
if (r !== "add-triple" && r !== "deep-merge-triple")
|
|
2327
2327
|
return !0;
|
|
2328
|
-
const
|
|
2329
|
-
if (
|
|
2328
|
+
const c = u == null ? void 0 : u.mode;
|
|
2329
|
+
if (c !== "create" && c !== "update")
|
|
2330
2330
|
return !0;
|
|
2331
2331
|
let d = !1;
|
|
2332
|
-
const
|
|
2333
|
-
if (
|
|
2334
|
-
const f =
|
|
2332
|
+
const a = Ee(t.attrs, s);
|
|
2333
|
+
if (a) {
|
|
2334
|
+
const f = xr(t, a["forward-identity"][1]);
|
|
2335
2335
|
d = !!ms(t, [i, f.id, i]);
|
|
2336
2336
|
}
|
|
2337
|
-
return !(
|
|
2337
|
+
return !(c === "create" && d || c === "update" && !d);
|
|
2338
2338
|
});
|
|
2339
2339
|
return $t(t, (r) => {
|
|
2340
2340
|
n.forEach((i) => {
|
|
2341
|
-
|
|
2341
|
+
ys(r, i);
|
|
2342
2342
|
});
|
|
2343
2343
|
});
|
|
2344
2344
|
}
|
|
@@ -2415,14 +2415,14 @@ function $s(t, e = 0) {
|
|
|
2415
2415
|
return (U[t[e + 0]] + U[t[e + 1]] + U[t[e + 2]] + U[t[e + 3]] + "-" + U[t[e + 4]] + U[t[e + 5]] + "-" + U[t[e + 6]] + U[t[e + 7]] + "-" + U[t[e + 8]] + U[t[e + 9]] + "-" + U[t[e + 10]] + U[t[e + 11]] + U[t[e + 12]] + U[t[e + 13]] + U[t[e + 14]] + U[t[e + 15]]).toLowerCase();
|
|
2416
2416
|
}
|
|
2417
2417
|
let mt;
|
|
2418
|
-
const
|
|
2419
|
-
function
|
|
2418
|
+
const Ds = new Uint8Array(16);
|
|
2419
|
+
function xs() {
|
|
2420
2420
|
if (!mt) {
|
|
2421
2421
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
2422
2422
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
2423
2423
|
mt = crypto.getRandomValues.bind(crypto);
|
|
2424
2424
|
}
|
|
2425
|
-
return mt(
|
|
2425
|
+
return mt(Ds);
|
|
2426
2426
|
}
|
|
2427
2427
|
const Us = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), zn = { randomUUID: Us };
|
|
2428
2428
|
function Ls(t, e, n) {
|
|
@@ -2430,7 +2430,7 @@ function Ls(t, e, n) {
|
|
|
2430
2430
|
if (zn.randomUUID && !t)
|
|
2431
2431
|
return zn.randomUUID();
|
|
2432
2432
|
t = t || {};
|
|
2433
|
-
const r = t.random ?? ((i = t.rng) == null ? void 0 : i.call(t)) ??
|
|
2433
|
+
const r = t.random ?? ((i = t.rng) == null ? void 0 : i.call(t)) ?? xs();
|
|
2434
2434
|
if (r.length < 16)
|
|
2435
2435
|
throw new Error("Random bytes length must be >= 16");
|
|
2436
2436
|
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, $s(r);
|
|
@@ -2470,7 +2470,7 @@ function qs() {
|
|
|
2470
2470
|
}
|
|
2471
2471
|
const Ws = qs();
|
|
2472
2472
|
let zs = 0;
|
|
2473
|
-
function
|
|
2473
|
+
function xe(t) {
|
|
2474
2474
|
return at(`_${t}`, zs++);
|
|
2475
2475
|
}
|
|
2476
2476
|
function at(t, e) {
|
|
@@ -2482,7 +2482,7 @@ class ve extends Error {
|
|
|
2482
2482
|
}
|
|
2483
2483
|
}
|
|
2484
2484
|
function Ks(t, e) {
|
|
2485
|
-
const n =
|
|
2485
|
+
const n = xr(t, e);
|
|
2486
2486
|
if (!n)
|
|
2487
2487
|
throw new ve(`Could not find id attr for ${e}`);
|
|
2488
2488
|
return n;
|
|
@@ -2502,21 +2502,21 @@ function Qs(t, e, n) {
|
|
|
2502
2502
|
return t.map((r) => r === e ? n : r);
|
|
2503
2503
|
}
|
|
2504
2504
|
function Lr(t, e, n, r, i) {
|
|
2505
|
-
const s = me(e, n, i), o =
|
|
2505
|
+
const s = me(e, n, i), o = Dr(e, n, i), u = s || o;
|
|
2506
2506
|
if (!u)
|
|
2507
2507
|
throw new ve(`Could not find attr for ${[n, i]}`);
|
|
2508
2508
|
if (u["value-type"] !== "ref")
|
|
2509
2509
|
throw new Error(`Attr ${u.id} is not a ref`);
|
|
2510
|
-
const [
|
|
2510
|
+
const [c, d] = u["forward-identity"], [a, f] = u["reverse-identity"], h = r + 1, p = s ? [
|
|
2511
2511
|
t(d, r),
|
|
2512
2512
|
u.id,
|
|
2513
2513
|
t(f, h),
|
|
2514
|
-
|
|
2514
|
+
xe("time")
|
|
2515
2515
|
] : [
|
|
2516
2516
|
t(d, h),
|
|
2517
2517
|
u.id,
|
|
2518
2518
|
t(f, r),
|
|
2519
|
-
|
|
2519
|
+
xe("time")
|
|
2520
2520
|
];
|
|
2521
2521
|
return [s ? f : d, h, p, u, !!s];
|
|
2522
2522
|
}
|
|
@@ -2591,8 +2591,8 @@ function Gs(t, e) {
|
|
|
2591
2591
|
return e;
|
|
2592
2592
|
}
|
|
2593
2593
|
function Hs(t, e, n, r, i, s) {
|
|
2594
|
-
const o = me(e, n, i), u =
|
|
2595
|
-
if (!
|
|
2594
|
+
const o = me(e, n, i), u = Dr(e, n, i), c = o || u;
|
|
2595
|
+
if (!c)
|
|
2596
2596
|
throw new ve(`No attr for etype = ${n} label = ${i}`);
|
|
2597
2597
|
if (s != null && s.hasOwnProperty("$isNull")) {
|
|
2598
2598
|
const d = me(e, n, "id");
|
|
@@ -2601,27 +2601,27 @@ function Hs(t, e, n, r, i, s) {
|
|
|
2601
2601
|
return [
|
|
2602
2602
|
t(n, r),
|
|
2603
2603
|
d.id,
|
|
2604
|
-
{ $isNull: { attrId:
|
|
2605
|
-
|
|
2604
|
+
{ $isNull: { attrId: c.id, isNull: s.$isNull, reverse: !o } },
|
|
2605
|
+
xe("time")
|
|
2606
2606
|
];
|
|
2607
2607
|
}
|
|
2608
2608
|
return o ? [
|
|
2609
2609
|
t(n, r),
|
|
2610
|
-
|
|
2611
|
-
Gs(
|
|
2612
|
-
|
|
2613
|
-
] : [s,
|
|
2610
|
+
c.id,
|
|
2611
|
+
Gs(c, s),
|
|
2612
|
+
xe("time")
|
|
2613
|
+
] : [s, c.id, t(n, r), xe("time")];
|
|
2614
2614
|
}
|
|
2615
2615
|
function Ys(t, e, n, r, i) {
|
|
2616
|
-
const [s, o, u] = i.reduce((
|
|
2617
|
-
const [
|
|
2618
|
-
return [p,
|
|
2616
|
+
const [s, o, u] = i.reduce((c, d) => {
|
|
2617
|
+
const [a, f, h] = c, [p, y, g] = Lr(t, e, a, f, d);
|
|
2618
|
+
return [p, y, [...h, g]];
|
|
2619
2619
|
}, [n, r, []]);
|
|
2620
2620
|
return [s, o, u];
|
|
2621
2621
|
}
|
|
2622
2622
|
function Ft(t, e, n, r, i, s) {
|
|
2623
|
-
const o = i.slice(0, i.length - 1), u = i[i.length - 1], [
|
|
2624
|
-
return
|
|
2623
|
+
const o = i.slice(0, i.length - 1), u = i[i.length - 1], [c, d, a] = Ys(t, e, n, r, o), f = Hs(t, e, c, d, u, s);
|
|
2624
|
+
return a.concat([f]);
|
|
2625
2625
|
}
|
|
2626
2626
|
function Js(t, e) {
|
|
2627
2627
|
return e ? [e].concat(t) : t;
|
|
@@ -2639,9 +2639,9 @@ function eo(t, e, n) {
|
|
|
2639
2639
|
};
|
|
2640
2640
|
}
|
|
2641
2641
|
function Gn(t, e, n, r, i, s) {
|
|
2642
|
-
const o = t(r, i), u = s.map((
|
|
2643
|
-
const
|
|
2644
|
-
return Fr(
|
|
2642
|
+
const o = t(r, i), u = s.map((c, d) => {
|
|
2643
|
+
const a = eo(t, o, d);
|
|
2644
|
+
return Fr(a, n, r, i, c);
|
|
2645
2645
|
});
|
|
2646
2646
|
return { [e]: { patterns: u, joinSym: o } };
|
|
2647
2647
|
}
|
|
@@ -2664,11 +2664,11 @@ function Fr(t, e, n, r, i) {
|
|
|
2664
2664
|
return [];
|
|
2665
2665
|
const u = s.split(".");
|
|
2666
2666
|
if (o != null && o.hasOwnProperty("$ne") && (o = Object.assign(Object.assign({}, o), { $not: o.$ne }), delete o.$ne), o != null && o.hasOwnProperty("$not")) {
|
|
2667
|
-
const
|
|
2667
|
+
const c = Ft(t, e, n, r, u, o), d = Hn(t, e, n, r, u);
|
|
2668
2668
|
return [
|
|
2669
2669
|
{
|
|
2670
2670
|
or: {
|
|
2671
|
-
patterns: [
|
|
2671
|
+
patterns: [c, ...d],
|
|
2672
2672
|
joinSym: t(n, r)
|
|
2673
2673
|
}
|
|
2674
2674
|
}
|
|
@@ -2692,22 +2692,22 @@ function ro(t, e, n) {
|
|
|
2692
2692
|
return [t(e, n), t("time", n)];
|
|
2693
2693
|
}
|
|
2694
2694
|
function io(t, e, n, r, i, s) {
|
|
2695
|
-
const [o, u,
|
|
2696
|
-
return [o, u, f, d,
|
|
2695
|
+
const [o, u, c, d, a] = Lr(t, e, n, r, i), f = Qs(c, t(n, r), s);
|
|
2696
|
+
return [o, u, f, d, a];
|
|
2697
2697
|
}
|
|
2698
2698
|
function so(t, e, { etype: n, level: r, form: i }, s) {
|
|
2699
2699
|
const o = Object.keys(i).filter((u) => u !== "$");
|
|
2700
|
-
return o.length ? Object.entries(s).map(function([
|
|
2700
|
+
return o.length ? Object.entries(s).map(function([c, d]) {
|
|
2701
2701
|
return o.map(function(h) {
|
|
2702
|
-
var p,
|
|
2703
|
-
const w = !!(e.cardinalityInference && (!((g = (
|
|
2702
|
+
var p, y, g;
|
|
2703
|
+
const w = !!(e.cardinalityInference && (!((g = (y = (p = e.linkIndex) === null || p === void 0 ? void 0 : p[n]) === null || y === void 0 ? void 0 : y[h]) === null || g === void 0) && g.isSingular));
|
|
2704
2704
|
try {
|
|
2705
|
-
const [_, m, S] = io(t, e, n, r, h,
|
|
2705
|
+
const [_, m, S] = io(t, e, n, r, h, c), x = Vr(e, {
|
|
2706
2706
|
etype: _,
|
|
2707
2707
|
level: m,
|
|
2708
2708
|
form: i[h],
|
|
2709
2709
|
join: S
|
|
2710
|
-
}), O = w ?
|
|
2710
|
+
}), O = w ? x[0] : x;
|
|
2711
2711
|
return { [h]: O };
|
|
2712
2712
|
} catch (_) {
|
|
2713
2713
|
if (_ instanceof ve)
|
|
@@ -2730,11 +2730,11 @@ function Nt(t) {
|
|
|
2730
2730
|
}
|
|
2731
2731
|
function uo(t, e, n, r) {
|
|
2732
2732
|
var i;
|
|
2733
|
-
const [s, o, u,
|
|
2733
|
+
const [s, o, u, c] = t, d = n === "desc" ? 1 : -1;
|
|
2734
2734
|
if (((i = e["forward-identity"]) === null || i === void 0 ? void 0 : i[2]) === "id")
|
|
2735
|
-
return it(r, [s,
|
|
2736
|
-
const [
|
|
2737
|
-
return it([
|
|
2735
|
+
return it(r, [s, c], null) === d;
|
|
2736
|
+
const [a, f] = r, h = e["checked-data-type"], p = h === "date" ? Nt(f) : f, y = h === "date" ? Nt(u) : u;
|
|
2737
|
+
return it([a, p], [s, y], h) === d;
|
|
2738
2738
|
}
|
|
2739
2739
|
function ao(t, e) {
|
|
2740
2740
|
const n = e[1];
|
|
@@ -2756,8 +2756,8 @@ function lo(t, e, n) {
|
|
|
2756
2756
|
return ws(t, e);
|
|
2757
2757
|
const s = /* @__PURE__ */ new Map();
|
|
2758
2758
|
for (const o of n.fields) {
|
|
2759
|
-
const u = me(t, e, o),
|
|
2760
|
-
|
|
2759
|
+
const u = me(t, e, o), c = (r = u == null ? void 0 : u["forward-identity"]) === null || r === void 0 ? void 0 : r[2];
|
|
2760
|
+
c && on(u) && s.set(c, u);
|
|
2761
2761
|
}
|
|
2762
2762
|
if (!s.has("id")) {
|
|
2763
2763
|
const o = me(t, e, "id"), u = (i = o == null ? void 0 : o["forward-identity"]) === null || i === void 0 ? void 0 : i[2];
|
|
@@ -2767,29 +2767,29 @@ function lo(t, e, n) {
|
|
|
2767
2767
|
}
|
|
2768
2768
|
function ho(t, { etype: e, pageInfo: n, dq: r, form: i }) {
|
|
2769
2769
|
var s, o;
|
|
2770
|
-
const u = (s = i == null ? void 0 : i.$) === null || s === void 0 ? void 0 : s.order,
|
|
2771
|
-
let
|
|
2770
|
+
const u = (s = i == null ? void 0 : i.$) === null || s === void 0 ? void 0 : s.order, c = Nr(i), d = po(i);
|
|
2771
|
+
let a = Ps(t, r);
|
|
2772
2772
|
const f = n == null ? void 0 : n["start-cursor"], h = fo(t, e, f, u);
|
|
2773
2773
|
if (h && ((o = h == null ? void 0 : h["forward-identity"]) === null || o === void 0 ? void 0 : o[2]) !== "id") {
|
|
2774
2774
|
const g = h["checked-data-type"] === "date", w = h.id;
|
|
2775
|
-
|
|
2776
|
-
var m, S,
|
|
2777
|
-
let N = (P = (O = (
|
|
2775
|
+
a = a.map(([_]) => {
|
|
2776
|
+
var m, S, x, O, P;
|
|
2777
|
+
let N = (P = (O = (x = (S = (m = t.eav.get(_)) === null || m === void 0 ? void 0 : m.get(w)) === null || S === void 0 ? void 0 : S.values()) === null || x === void 0 ? void 0 : x.next()) === null || O === void 0 ? void 0 : O.value) === null || P === void 0 ? void 0 : P[2];
|
|
2778
2778
|
return g && (N = Nt(N)), [_, N];
|
|
2779
2779
|
});
|
|
2780
2780
|
}
|
|
2781
|
-
|
|
2781
|
+
a.sort(d === "asc" ? function(w, _) {
|
|
2782
2782
|
return it(w, _, h == null ? void 0 : h["checked-data-type"]);
|
|
2783
2783
|
} : function(w, _) {
|
|
2784
2784
|
return it(_, w, h == null ? void 0 : h["checked-data-type"]);
|
|
2785
2785
|
});
|
|
2786
2786
|
let p = {};
|
|
2787
|
-
const
|
|
2788
|
-
for (const g of
|
|
2787
|
+
const y = lo(t, e, r);
|
|
2788
|
+
for (const g of a) {
|
|
2789
2789
|
const [w] = g;
|
|
2790
|
-
if (p[w] || !
|
|
2790
|
+
if (p[w] || !c && f && h && uo(f, h, d, g))
|
|
2791
2791
|
continue;
|
|
2792
|
-
const _ = Ts(t,
|
|
2792
|
+
const _ = Ts(t, y, w);
|
|
2793
2793
|
_ && (p[w] = _);
|
|
2794
2794
|
}
|
|
2795
2795
|
return p;
|
|
@@ -2804,25 +2804,25 @@ function Nr(t) {
|
|
|
2804
2804
|
const i = (e = t.$) === null || e === void 0 ? void 0 : e.offset, s = (n = t.$) === null || n === void 0 ? void 0 : n.before, o = (r = t.$) === null || r === void 0 ? void 0 : r.after;
|
|
2805
2805
|
return !i && !s && !o;
|
|
2806
2806
|
}
|
|
2807
|
-
function
|
|
2808
|
-
var o, u,
|
|
2807
|
+
function bo(t, { etype: e, level: n, form: r, join: i, pageInfo: s }) {
|
|
2808
|
+
var o, u, c, d, a;
|
|
2809
2809
|
if (!Nr(r) && (!s || !s["start-cursor"]))
|
|
2810
2810
|
return [];
|
|
2811
|
-
const f = Js(no(t, e, n, (o = r.$) === null || o === void 0 ? void 0 : o.where), i), h = ro(at, e, n), p = (u = r.$) === null || u === void 0 ? void 0 : u.fields,
|
|
2811
|
+
const f = Js(no(t, e, n, (o = r.$) === null || o === void 0 ? void 0 : o.where), i), h = ro(at, e, n), p = (u = r.$) === null || u === void 0 ? void 0 : u.fields, y = ho(t, {
|
|
2812
2812
|
etype: e,
|
|
2813
2813
|
pageInfo: s,
|
|
2814
2814
|
form: r,
|
|
2815
2815
|
dq: { where: f, find: h, fields: p }
|
|
2816
|
-
}), g = ((
|
|
2816
|
+
}), g = ((c = r.$) === null || c === void 0 ? void 0 : c.limit) || ((d = r.$) === null || d === void 0 ? void 0 : d.first) || ((a = r.$) === null || a === void 0 ? void 0 : a.last);
|
|
2817
2817
|
if (g != null) {
|
|
2818
|
-
const w = Object.entries(
|
|
2819
|
-
return w.length <= g ?
|
|
2818
|
+
const w = Object.entries(y);
|
|
2819
|
+
return w.length <= g ? y : Object.fromEntries(w.slice(0, g));
|
|
2820
2820
|
}
|
|
2821
|
-
return
|
|
2821
|
+
return y;
|
|
2822
2822
|
}
|
|
2823
|
-
function
|
|
2823
|
+
function yo(t, e) {
|
|
2824
2824
|
try {
|
|
2825
|
-
return
|
|
2825
|
+
return bo(t, e);
|
|
2826
2826
|
} catch (n) {
|
|
2827
2827
|
if (n instanceof ve)
|
|
2828
2828
|
return {};
|
|
@@ -2830,7 +2830,7 @@ function bo(t, e) {
|
|
|
2830
2830
|
}
|
|
2831
2831
|
}
|
|
2832
2832
|
function Vr(t, e) {
|
|
2833
|
-
const n =
|
|
2833
|
+
const n = yo(t, e);
|
|
2834
2834
|
return so(at, t, e, n);
|
|
2835
2835
|
}
|
|
2836
2836
|
function _o(t) {
|
|
@@ -2845,12 +2845,12 @@ function _o(t) {
|
|
|
2845
2845
|
return e;
|
|
2846
2846
|
}
|
|
2847
2847
|
function Vt({ store: t, pageInfo: e, aggregate: n }, r) {
|
|
2848
|
-
const s = { data: Object.keys(r).reduce(function(u,
|
|
2849
|
-
return n != null && n[
|
|
2850
|
-
etype:
|
|
2851
|
-
form: r[
|
|
2848
|
+
const s = { data: Object.keys(r).reduce(function(u, c) {
|
|
2849
|
+
return n != null && n[c] || c === "$$ruleParams" || (u[c] = Vr(t, {
|
|
2850
|
+
etype: c,
|
|
2851
|
+
form: r[c],
|
|
2852
2852
|
level: 0,
|
|
2853
|
-
pageInfo: e == null ? void 0 : e[
|
|
2853
|
+
pageInfo: e == null ? void 0 : e[c]
|
|
2854
2854
|
})), u;
|
|
2855
2855
|
}, {}) };
|
|
2856
2856
|
return e && (s.pageInfo = _o(e)), n && (s.aggregate = n), s;
|
|
@@ -2926,8 +2926,8 @@ function So(t, e) {
|
|
|
2926
2926
|
if (u)
|
|
2927
2927
|
i.push(u);
|
|
2928
2928
|
else if (Array.isArray(o) && o.length == 2 && n[o[0]]) {
|
|
2929
|
-
const [
|
|
2930
|
-
i.push([n[
|
|
2929
|
+
const [c, d] = o;
|
|
2930
|
+
i.push([n[c], d]);
|
|
2931
2931
|
} else
|
|
2932
2932
|
i.push(o);
|
|
2933
2933
|
}
|
|
@@ -3003,15 +3003,15 @@ function Wr(t, e, n, r) {
|
|
|
3003
3003
|
}
|
|
3004
3004
|
function Eo({ attrs: t }, [e, n, r]) {
|
|
3005
3005
|
const i = Object.entries(r).flatMap(([s, o]) => {
|
|
3006
|
-
const u = Array.isArray(o) ? o : [o],
|
|
3007
|
-
return u.map((
|
|
3006
|
+
const u = Array.isArray(o) ? o : [o], c = F(t, e, s), d = he(t, e, s);
|
|
3007
|
+
return u.map((a) => c ? [
|
|
3008
3008
|
"add-triple",
|
|
3009
3009
|
G(t, e, n),
|
|
3010
|
-
|
|
3011
|
-
G(t,
|
|
3010
|
+
c.id,
|
|
3011
|
+
G(t, c["reverse-identity"][1], a)
|
|
3012
3012
|
] : [
|
|
3013
3013
|
"add-triple",
|
|
3014
|
-
G(t, d["forward-identity"][1],
|
|
3014
|
+
G(t, d["forward-identity"][1], a),
|
|
3015
3015
|
d.id,
|
|
3016
3016
|
G(t, e, n)
|
|
3017
3017
|
]);
|
|
@@ -3020,15 +3020,15 @@ function Eo({ attrs: t }, [e, n, r]) {
|
|
|
3020
3020
|
}
|
|
3021
3021
|
function Ao({ attrs: t }, [e, n, r]) {
|
|
3022
3022
|
const i = Object.entries(r).flatMap(([s, o]) => {
|
|
3023
|
-
const u = Array.isArray(o) ? o : [o],
|
|
3024
|
-
return u.map((
|
|
3023
|
+
const u = Array.isArray(o) ? o : [o], c = F(t, e, s), d = he(t, e, s);
|
|
3024
|
+
return u.map((a) => c ? [
|
|
3025
3025
|
"retract-triple",
|
|
3026
3026
|
G(t, e, n),
|
|
3027
|
-
|
|
3028
|
-
G(t,
|
|
3027
|
+
c.id,
|
|
3028
|
+
G(t, c["reverse-identity"][1], a)
|
|
3029
3029
|
] : [
|
|
3030
3030
|
"retract-triple",
|
|
3031
|
-
G(t, d["forward-identity"][1],
|
|
3031
|
+
G(t, d["forward-identity"][1], a),
|
|
3032
3032
|
d.id,
|
|
3033
3033
|
G(t, e, n)
|
|
3034
3034
|
]);
|
|
@@ -3041,7 +3041,7 @@ function Co(t, e, n) {
|
|
|
3041
3041
|
for (const s of t || []) {
|
|
3042
3042
|
const o = s == null ? void 0 : s.aev.get(r);
|
|
3043
3043
|
if (o) {
|
|
3044
|
-
for (const [u,
|
|
3044
|
+
for (const [u, c, d] of Q(o, 2))
|
|
3045
3045
|
if (d === i)
|
|
3046
3046
|
return !0;
|
|
3047
3047
|
}
|
|
@@ -3061,22 +3061,22 @@ function zr({ stores: t, attrs: e }, [n, r, i, s]) {
|
|
|
3061
3061
|
return (s == null ? void 0 : s.upsert) === !1 ? { mode: "update" } : (s == null ? void 0 : s.upsert) === !0 ? null : Co(t, n, r) ? { mode: "update" } : null;
|
|
3062
3062
|
}
|
|
3063
3063
|
function jo(t, e) {
|
|
3064
|
-
const { stores: n, attrs: r } = t, [i, s, o, u] = e,
|
|
3065
|
-
return [["id", d]].concat(Object.entries(
|
|
3064
|
+
const { stores: n, attrs: r } = t, [i, s, o, u] = e, c = rn(o), d = G(r, i, s);
|
|
3065
|
+
return [["id", d]].concat(Object.entries(c)).map(([f, h]) => {
|
|
3066
3066
|
const p = F(r, i, f);
|
|
3067
3067
|
return p["checked-data-type"] === "date" && t.useDateObjects && (h = ot(h)), ["add-triple", d, p.id, h, { mode: "create" }];
|
|
3068
3068
|
});
|
|
3069
3069
|
}
|
|
3070
3070
|
function ko(t, e) {
|
|
3071
|
-
const { stores: n, attrs: r } = t, [i, s, o, u] = e,
|
|
3072
|
-
return [["id", d]].concat(Object.entries(
|
|
3073
|
-
const
|
|
3074
|
-
return
|
|
3071
|
+
const { stores: n, attrs: r } = t, [i, s, o, u] = e, c = rn(o), d = G(r, i, s), a = zr(t, [i, d, o, u]);
|
|
3072
|
+
return [["id", d]].concat(Object.entries(c)).map(([h, p]) => {
|
|
3073
|
+
const y = F(r, i, h);
|
|
3074
|
+
return y["checked-data-type"] === "date" && t.useDateObjects && (p = ot(p)), [
|
|
3075
3075
|
"add-triple",
|
|
3076
3076
|
d,
|
|
3077
|
-
|
|
3077
|
+
y.id,
|
|
3078
3078
|
p,
|
|
3079
|
-
...
|
|
3079
|
+
...a ? [a] : []
|
|
3080
3080
|
];
|
|
3081
3081
|
});
|
|
3082
3082
|
}
|
|
@@ -3084,14 +3084,14 @@ function Io({ attrs: t }, [e, n]) {
|
|
|
3084
3084
|
return [["delete-entity", G(t, e, n), e]];
|
|
3085
3085
|
}
|
|
3086
3086
|
function Po(t, e) {
|
|
3087
|
-
const { stores: n, attrs: r } = t, [i, s, o, u] = e,
|
|
3087
|
+
const { stores: n, attrs: r } = t, [i, s, o, u] = e, c = rn(o), d = G(r, i, s), a = zr(t, [i, d, o, u]), f = Object.entries(c).map(([p, y]) => {
|
|
3088
3088
|
const g = F(r, i, p);
|
|
3089
3089
|
return [
|
|
3090
3090
|
"deep-merge-triple",
|
|
3091
3091
|
d,
|
|
3092
3092
|
g.id,
|
|
3093
|
-
|
|
3094
|
-
...
|
|
3093
|
+
y,
|
|
3094
|
+
...a ? [a] : []
|
|
3095
3095
|
];
|
|
3096
3096
|
});
|
|
3097
3097
|
return [[
|
|
@@ -3099,7 +3099,7 @@ function Po(t, e) {
|
|
|
3099
3099
|
d,
|
|
3100
3100
|
F(r, i, "id").id,
|
|
3101
3101
|
d,
|
|
3102
|
-
...
|
|
3102
|
+
...a ? [a] : []
|
|
3103
3103
|
]].concat(f);
|
|
3104
3104
|
}
|
|
3105
3105
|
function Mo({ attrs: t }, [e, n, r]) {
|
|
@@ -3133,7 +3133,7 @@ function $o(t, e) {
|
|
|
3133
3133
|
throw new Error(`unsupported action ${n}`);
|
|
3134
3134
|
}
|
|
3135
3135
|
}
|
|
3136
|
-
function
|
|
3136
|
+
function Do(t) {
|
|
3137
3137
|
switch (t) {
|
|
3138
3138
|
case "string":
|
|
3139
3139
|
case "date":
|
|
@@ -3144,22 +3144,22 @@ function xo(t) {
|
|
|
3144
3144
|
return;
|
|
3145
3145
|
}
|
|
3146
3146
|
}
|
|
3147
|
-
function
|
|
3147
|
+
function xo(t, e, n) {
|
|
3148
3148
|
var r, i;
|
|
3149
3149
|
const s = (i = (r = t.entities[e]) === null || r === void 0 ? void 0 : r.attrs) === null || i === void 0 ? void 0 : i[n];
|
|
3150
3150
|
if (n === "id")
|
|
3151
3151
|
return null;
|
|
3152
3152
|
if (!s)
|
|
3153
3153
|
throw new Error(`${e}.${n} does not exist in your schema`);
|
|
3154
|
-
const { unique: o, indexed: u } = s == null ? void 0 : s.config,
|
|
3154
|
+
const { unique: o, indexed: u } = s == null ? void 0 : s.config, c = Do(s == null ? void 0 : s.valueType);
|
|
3155
3155
|
return {
|
|
3156
3156
|
"index?": u,
|
|
3157
3157
|
"unique?": o,
|
|
3158
|
-
"checked-data-type":
|
|
3158
|
+
"checked-data-type": c
|
|
3159
3159
|
};
|
|
3160
3160
|
}
|
|
3161
3161
|
function He(t, e, n, r) {
|
|
3162
|
-
const i = t ?
|
|
3162
|
+
const i = t ? xo(t, e, n) : null, s = L(), u = [L(), e, n];
|
|
3163
3163
|
return Object.assign(Object.assign({ id: s, "forward-identity": u, "value-type": "blob", cardinality: "one", "unique?": !1, "index?": !1, isUnsynced: !0 }, i || {}), r || {});
|
|
3164
3164
|
}
|
|
3165
3165
|
function Uo(t, e, n) {
|
|
@@ -3198,10 +3198,10 @@ function zo(t) {
|
|
|
3198
3198
|
return e;
|
|
3199
3199
|
const o = Kt(i);
|
|
3200
3200
|
if (o && e.push({ etype: r, lookupPair: o }), n === "link")
|
|
3201
|
-
for (const [u,
|
|
3202
|
-
const d = Array.isArray(
|
|
3203
|
-
for (const
|
|
3204
|
-
const f = Kt(
|
|
3201
|
+
for (const [u, c] of Object.entries(s)) {
|
|
3202
|
+
const d = Array.isArray(c) ? c : [c];
|
|
3203
|
+
for (const a of d) {
|
|
3204
|
+
const f = Kt(a);
|
|
3205
3205
|
f && e.push({
|
|
3206
3206
|
etype: r,
|
|
3207
3207
|
lookupPair: f,
|
|
@@ -3214,47 +3214,47 @@ function zo(t) {
|
|
|
3214
3214
|
function Ko({ attrs: t, schema: e }, n) {
|
|
3215
3215
|
var r, i;
|
|
3216
3216
|
const [s, o, u] = [/* @__PURE__ */ new Set(), Object.assign({}, t), []];
|
|
3217
|
-
function
|
|
3217
|
+
function c(f) {
|
|
3218
3218
|
o[f.id] = f, u.push(["add-attr", f]), s.add(f.id);
|
|
3219
3219
|
}
|
|
3220
3220
|
function d(f) {
|
|
3221
3221
|
f != null && f.isUnsynced && !s.has(f.id) && (u.push(["add-attr", f]), s.add(f.id));
|
|
3222
3222
|
}
|
|
3223
|
-
function
|
|
3224
|
-
const p = F(o, f, h),
|
|
3225
|
-
d(p), d(
|
|
3223
|
+
function a(f, h) {
|
|
3224
|
+
const p = F(o, f, h), y = he(o, f, h);
|
|
3225
|
+
d(p), d(y), !p && !y && c(Yn(e, f, h, Wo));
|
|
3226
3226
|
}
|
|
3227
3227
|
for (const f of n)
|
|
3228
|
-
for (const { etype: h, lookupPair: p, linkLabel:
|
|
3228
|
+
for (const { etype: h, lookupPair: p, linkLabel: y } of zo(f)) {
|
|
3229
3229
|
const g = p[0];
|
|
3230
|
-
if (
|
|
3231
|
-
|
|
3232
|
-
const w = F(o, h,
|
|
3230
|
+
if (y) {
|
|
3231
|
+
a(h, y);
|
|
3232
|
+
const w = F(o, h, y), _ = he(o, h, y);
|
|
3233
3233
|
d(w), d(_);
|
|
3234
|
-
const m = ((r = w == null ? void 0 : w["reverse-identity"]) === null || r === void 0 ? void 0 : r[1]) || ((i = _ == null ? void 0 : _["forward-identity"]) === null || i === void 0 ? void 0 : i[1]) ||
|
|
3234
|
+
const m = ((r = w == null ? void 0 : w["reverse-identity"]) === null || r === void 0 ? void 0 : r[1]) || ((i = _ == null ? void 0 : _["forward-identity"]) === null || i === void 0 ? void 0 : i[1]) || y;
|
|
3235
3235
|
if (Wt(o, m, g))
|
|
3236
|
-
|
|
3236
|
+
a(m, zt(g));
|
|
3237
3237
|
else {
|
|
3238
3238
|
const S = F(o, m, g);
|
|
3239
|
-
S ||
|
|
3239
|
+
S || c(He(e, m, g, Bt)), d(S);
|
|
3240
3240
|
}
|
|
3241
3241
|
} else if (Wt(o, h, g))
|
|
3242
|
-
|
|
3242
|
+
a(h, zt(g));
|
|
3243
3243
|
else {
|
|
3244
3244
|
const w = F(o, h, g);
|
|
3245
|
-
w ||
|
|
3245
|
+
w || c(He(e, h, g, Bt)), d(w);
|
|
3246
3246
|
}
|
|
3247
3247
|
}
|
|
3248
3248
|
for (const f of n) {
|
|
3249
|
-
const [h, p,
|
|
3249
|
+
const [h, p, y, g] = f;
|
|
3250
3250
|
if (Fo.has(h)) {
|
|
3251
3251
|
const w = F(o, p, "id");
|
|
3252
|
-
d(w), w ||
|
|
3252
|
+
d(w), w || c(He(e, p, "id", { "unique?": !0 }));
|
|
3253
3253
|
for (const _ of Object.keys(g)) {
|
|
3254
3254
|
const m = F(o, p, _);
|
|
3255
|
-
if (d(m), Vo.has(h) && (m ||
|
|
3255
|
+
if (d(m), Vo.has(h) && (m || c(He(e, p, _, _ === "id" ? { "unique?": !0 } : null))), No.has(h)) {
|
|
3256
3256
|
const S = he(o, p, _);
|
|
3257
|
-
!m && !S &&
|
|
3257
|
+
!m && !S && c(Yn(e, p, _)), d(S);
|
|
3258
3258
|
}
|
|
3259
3259
|
}
|
|
3260
3260
|
}
|
|
@@ -3262,7 +3262,7 @@ function Ko({ attrs: t, schema: e }, n) {
|
|
|
3262
3262
|
return [o, u];
|
|
3263
3263
|
}
|
|
3264
3264
|
function Bo(t, e) {
|
|
3265
|
-
const r = (Array.isArray(e) ? e : [e]).flatMap((
|
|
3265
|
+
const r = (Array.isArray(e) ? e : [e]).flatMap((c) => mo(c)), [i, s] = Ko(t, r), o = Object.assign(Object.assign({}, t), { attrs: i }), u = r.flatMap((c) => $o(o, c));
|
|
3266
3266
|
return [...s, ...u];
|
|
3267
3267
|
}
|
|
3268
3268
|
var Jn = function(t, e, n, r) {
|
|
@@ -3272,22 +3272,22 @@ var Jn = function(t, e, n, r) {
|
|
|
3272
3272
|
});
|
|
3273
3273
|
}
|
|
3274
3274
|
return new (n || (n = Promise))(function(s, o) {
|
|
3275
|
-
function u(
|
|
3275
|
+
function u(a) {
|
|
3276
3276
|
try {
|
|
3277
|
-
d(r.next(
|
|
3277
|
+
d(r.next(a));
|
|
3278
3278
|
} catch (f) {
|
|
3279
3279
|
o(f);
|
|
3280
3280
|
}
|
|
3281
3281
|
}
|
|
3282
|
-
function a
|
|
3282
|
+
function c(a) {
|
|
3283
3283
|
try {
|
|
3284
|
-
d(r.throw(
|
|
3284
|
+
d(r.throw(a));
|
|
3285
3285
|
} catch (f) {
|
|
3286
3286
|
o(f);
|
|
3287
3287
|
}
|
|
3288
3288
|
}
|
|
3289
|
-
function d(
|
|
3290
|
-
|
|
3289
|
+
function d(a) {
|
|
3290
|
+
a.done ? s(a.value) : i(a.value).then(u, c);
|
|
3291
3291
|
}
|
|
3292
3292
|
d((r = r.apply(t, e || [])).next());
|
|
3293
3293
|
});
|
|
@@ -3314,9 +3314,9 @@ class Kr {
|
|
|
3314
3314
|
const n = yield this._dbPromise;
|
|
3315
3315
|
return new Promise((r, i) => {
|
|
3316
3316
|
const u = n.transaction([this._storeName], "readonly").objectStore(this._storeName).get(e);
|
|
3317
|
-
u.onerror = (
|
|
3318
|
-
i(
|
|
3319
|
-
}, u.onsuccess = (
|
|
3317
|
+
u.onerror = (c) => {
|
|
3318
|
+
i(c);
|
|
3319
|
+
}, u.onsuccess = (c) => {
|
|
3320
3320
|
u.result ? r(u.result) : r(null);
|
|
3321
3321
|
};
|
|
3322
3322
|
});
|
|
@@ -3326,10 +3326,10 @@ class Kr {
|
|
|
3326
3326
|
return Jn(this, void 0, void 0, function* () {
|
|
3327
3327
|
const r = yield this._dbPromise;
|
|
3328
3328
|
return new Promise((i, s) => {
|
|
3329
|
-
const
|
|
3330
|
-
|
|
3329
|
+
const c = r.transaction([this._storeName], "readwrite").objectStore(this._storeName).put(n, e);
|
|
3330
|
+
c.onerror = (d) => {
|
|
3331
3331
|
s(d);
|
|
3332
|
-
},
|
|
3332
|
+
}, c.onsuccess = (d) => {
|
|
3333
3333
|
i();
|
|
3334
3334
|
};
|
|
3335
3335
|
});
|
|
@@ -3343,22 +3343,22 @@ var Qo = function(t, e, n, r) {
|
|
|
3343
3343
|
});
|
|
3344
3344
|
}
|
|
3345
3345
|
return new (n || (n = Promise))(function(s, o) {
|
|
3346
|
-
function u(
|
|
3346
|
+
function u(a) {
|
|
3347
3347
|
try {
|
|
3348
|
-
d(r.next(
|
|
3348
|
+
d(r.next(a));
|
|
3349
3349
|
} catch (f) {
|
|
3350
3350
|
o(f);
|
|
3351
3351
|
}
|
|
3352
3352
|
}
|
|
3353
|
-
function a
|
|
3353
|
+
function c(a) {
|
|
3354
3354
|
try {
|
|
3355
|
-
d(r.throw(
|
|
3355
|
+
d(r.throw(a));
|
|
3356
3356
|
} catch (f) {
|
|
3357
3357
|
o(f);
|
|
3358
3358
|
}
|
|
3359
3359
|
}
|
|
3360
|
-
function d(
|
|
3361
|
-
|
|
3360
|
+
function d(a) {
|
|
3361
|
+
a.done ? s(a.value) : i(a.value).then(u, c);
|
|
3362
3362
|
}
|
|
3363
3363
|
d((r = r.apply(t, e || [])).next());
|
|
3364
3364
|
});
|
|
@@ -3397,22 +3397,22 @@ var Go = function(t, e, n, r) {
|
|
|
3397
3397
|
});
|
|
3398
3398
|
}
|
|
3399
3399
|
return new (n || (n = Promise))(function(s, o) {
|
|
3400
|
-
function u(
|
|
3400
|
+
function u(a) {
|
|
3401
3401
|
try {
|
|
3402
|
-
d(r.next(
|
|
3402
|
+
d(r.next(a));
|
|
3403
3403
|
} catch (f) {
|
|
3404
3404
|
o(f);
|
|
3405
3405
|
}
|
|
3406
3406
|
}
|
|
3407
|
-
function a
|
|
3407
|
+
function c(a) {
|
|
3408
3408
|
try {
|
|
3409
|
-
d(r.throw(
|
|
3409
|
+
d(r.throw(a));
|
|
3410
3410
|
} catch (f) {
|
|
3411
3411
|
o(f);
|
|
3412
3412
|
}
|
|
3413
3413
|
}
|
|
3414
|
-
function d(
|
|
3415
|
-
|
|
3414
|
+
function d(a) {
|
|
3415
|
+
a.done ? s(a.value) : i(a.value).then(u, c);
|
|
3416
3416
|
}
|
|
3417
3417
|
d((r = r.apply(t, e || [])).next());
|
|
3418
3418
|
});
|
|
@@ -3442,22 +3442,22 @@ var Ae = function(t, e, n, r) {
|
|
|
3442
3442
|
});
|
|
3443
3443
|
}
|
|
3444
3444
|
return new (n || (n = Promise))(function(s, o) {
|
|
3445
|
-
function u(
|
|
3445
|
+
function u(a) {
|
|
3446
3446
|
try {
|
|
3447
|
-
d(r.next(
|
|
3447
|
+
d(r.next(a));
|
|
3448
3448
|
} catch (f) {
|
|
3449
3449
|
o(f);
|
|
3450
3450
|
}
|
|
3451
3451
|
}
|
|
3452
|
-
function a
|
|
3452
|
+
function c(a) {
|
|
3453
3453
|
try {
|
|
3454
|
-
d(r.throw(
|
|
3454
|
+
d(r.throw(a));
|
|
3455
3455
|
} catch (f) {
|
|
3456
3456
|
o(f);
|
|
3457
3457
|
}
|
|
3458
3458
|
}
|
|
3459
|
-
function d(
|
|
3460
|
-
|
|
3459
|
+
function d(a) {
|
|
3460
|
+
a.done ? s(a.value) : i(a.value).then(u, c);
|
|
3461
3461
|
}
|
|
3462
3462
|
d((r = r.apply(t, e || [])).next());
|
|
3463
3463
|
});
|
|
@@ -3555,37 +3555,37 @@ var Ne = function(t, e, n, r) {
|
|
|
3555
3555
|
});
|
|
3556
3556
|
}
|
|
3557
3557
|
return new (n || (n = Promise))(function(s, o) {
|
|
3558
|
-
function u(
|
|
3558
|
+
function u(a) {
|
|
3559
3559
|
try {
|
|
3560
|
-
d(r.next(
|
|
3560
|
+
d(r.next(a));
|
|
3561
3561
|
} catch (f) {
|
|
3562
3562
|
o(f);
|
|
3563
3563
|
}
|
|
3564
3564
|
}
|
|
3565
|
-
function a
|
|
3565
|
+
function c(a) {
|
|
3566
3566
|
try {
|
|
3567
|
-
d(r.throw(
|
|
3567
|
+
d(r.throw(a));
|
|
3568
3568
|
} catch (f) {
|
|
3569
3569
|
o(f);
|
|
3570
3570
|
}
|
|
3571
3571
|
}
|
|
3572
|
-
function d(
|
|
3573
|
-
|
|
3572
|
+
function d(a) {
|
|
3573
|
+
a.done ? s(a.value) : i(a.value).then(u, c);
|
|
3574
3574
|
}
|
|
3575
3575
|
d((r = r.apply(t, e || [])).next());
|
|
3576
3576
|
});
|
|
3577
3577
|
};
|
|
3578
3578
|
function tu(t) {
|
|
3579
3579
|
return Ne(this, arguments, void 0, function* ({ apiURI: e, appId: n, path: r, file: i, refreshToken: s, contentType: o, contentDisposition: u }) {
|
|
3580
|
-
const
|
|
3580
|
+
const c = {
|
|
3581
3581
|
app_id: n,
|
|
3582
3582
|
path: r,
|
|
3583
3583
|
authorization: `Bearer ${s}`,
|
|
3584
3584
|
"content-type": o || i.type
|
|
3585
3585
|
};
|
|
3586
|
-
return u && (
|
|
3586
|
+
return u && (c["content-disposition"] = u), yield te(`${e}/storage/upload`, {
|
|
3587
3587
|
method: "PUT",
|
|
3588
|
-
headers:
|
|
3588
|
+
headers: c,
|
|
3589
3589
|
body: i
|
|
3590
3590
|
});
|
|
3591
3591
|
});
|
|
@@ -3661,10 +3661,10 @@ function ou(t, e, n) {
|
|
|
3661
3661
|
s.user = Object.assign(Object.assign({}, u), { peerId: n });
|
|
3662
3662
|
}
|
|
3663
3663
|
for (const u of Object.keys((i = t.peers) !== null && i !== void 0 ? i : {})) {
|
|
3664
|
-
const
|
|
3665
|
-
if (
|
|
3666
|
-
const
|
|
3667
|
-
s.peers[u] = Object.assign(Object.assign({},
|
|
3664
|
+
const c = (e == null ? void 0 : e.peers) === void 0, d = Array.isArray(e == null ? void 0 : e.peers) && (e == null ? void 0 : e.peers.includes(u));
|
|
3665
|
+
if (c || d) {
|
|
3666
|
+
const a = Xn(t.peers[u], e == null ? void 0 : e.keys);
|
|
3667
|
+
s.peers[u] = Object.assign(Object.assign({}, a), { peerId: u });
|
|
3668
3668
|
}
|
|
3669
3669
|
}
|
|
3670
3670
|
return s;
|
|
@@ -3697,22 +3697,22 @@ var Me = function(t, e, n, r) {
|
|
|
3697
3697
|
});
|
|
3698
3698
|
}
|
|
3699
3699
|
return new (n || (n = Promise))(function(s, o) {
|
|
3700
|
-
function u(
|
|
3700
|
+
function u(a) {
|
|
3701
3701
|
try {
|
|
3702
|
-
d(r.next(
|
|
3702
|
+
d(r.next(a));
|
|
3703
3703
|
} catch (f) {
|
|
3704
3704
|
o(f);
|
|
3705
3705
|
}
|
|
3706
3706
|
}
|
|
3707
|
-
function a
|
|
3707
|
+
function c(a) {
|
|
3708
3708
|
try {
|
|
3709
|
-
d(r.throw(
|
|
3709
|
+
d(r.throw(a));
|
|
3710
3710
|
} catch (f) {
|
|
3711
3711
|
o(f);
|
|
3712
3712
|
}
|
|
3713
3713
|
}
|
|
3714
|
-
function d(
|
|
3715
|
-
|
|
3714
|
+
function d(a) {
|
|
3715
|
+
a.done ? s(a.value) : i(a.value).then(u, c);
|
|
3716
3716
|
}
|
|
3717
3717
|
d((r = r.apply(t, e || [])).next());
|
|
3718
3718
|
});
|
|
@@ -3721,8 +3721,8 @@ function au(t, e) {
|
|
|
3721
3721
|
typeof requestIdleCallback > "u" ? t() : requestIdleCallback(t, { timeout: e });
|
|
3722
3722
|
}
|
|
3723
3723
|
class Qt {
|
|
3724
|
-
constructor(e, n, r, i, s = (d) => d, o = (d) => d, u = 100,
|
|
3725
|
-
this._subs = [], this._nextSave = null, this._persister = e, this._key = n, this._onMerge = i, this._loadedCbs = [], this._isLoading = !0, this.currentValue = r, this.serialize = s, this.parse = o, this._saveThrottleMs = u, this._pendingSaveCbs = [], this._version = 0, this._idleCallbackMaxWaitMs =
|
|
3724
|
+
constructor(e, n, r, i, s = (d) => d, o = (d) => d, u = 100, c = 1e3) {
|
|
3725
|
+
this._subs = [], this._nextSave = null, this._persister = e, this._key = n, this._onMerge = i, this._loadedCbs = [], this._isLoading = !0, this.currentValue = r, this.serialize = s, this.parse = o, this._saveThrottleMs = u, this._pendingSaveCbs = [], this._version = 0, this._idleCallbackMaxWaitMs = c, this._load();
|
|
3726
3726
|
}
|
|
3727
3727
|
_getFromStorage() {
|
|
3728
3728
|
return Me(this, void 0, void 0, function* () {
|
|
@@ -3828,7 +3828,7 @@ function nr(t) {
|
|
|
3828
3828
|
}, e;
|
|
3829
3829
|
}, {});
|
|
3830
3830
|
}
|
|
3831
|
-
const Yr = "v0.22.44-experimental.sync-table.
|
|
3831
|
+
const Yr = "v0.22.44-experimental.sync-table.19053425986.1";
|
|
3832
3832
|
function cu(t, e) {
|
|
3833
3833
|
return {
|
|
3834
3834
|
info: t ? (...n) => console.info(...n, e()) : () => {
|
|
@@ -3894,9 +3894,9 @@ const rr = [
|
|
|
3894
3894
|
return !0;
|
|
3895
3895
|
}
|
|
3896
3896
|
}, fu = (t, e, n, r, i, s, o) => {
|
|
3897
|
-
const u = s.valueType === "json",
|
|
3898
|
-
if (!Jr(f,
|
|
3899
|
-
throw new I(`Invalid value for operator '${d}' on attribute '${r}' in entity '${i}'. Expected ${
|
|
3897
|
+
const u = s.valueType === "json", c = (d, a, f) => {
|
|
3898
|
+
if (!Jr(f, a, u))
|
|
3899
|
+
throw new I(`Invalid value for operator '${d}' on attribute '${r}' in entity '${i}'. Expected ${a}, but received: ${typeof f}`, o);
|
|
3900
3900
|
};
|
|
3901
3901
|
switch (t) {
|
|
3902
3902
|
case "in":
|
|
@@ -3904,7 +3904,7 @@ const rr = [
|
|
|
3904
3904
|
if (!Array.isArray(e))
|
|
3905
3905
|
throw new I(`Operator '${t}' for attribute '${r}' in entity '${i}' must be an array, but received: ${typeof e}`, o);
|
|
3906
3906
|
for (const d of e)
|
|
3907
|
-
|
|
3907
|
+
c(t, n, d);
|
|
3908
3908
|
break;
|
|
3909
3909
|
case "$not":
|
|
3910
3910
|
case "$ne":
|
|
@@ -3912,15 +3912,15 @@ const rr = [
|
|
|
3912
3912
|
case "$lt":
|
|
3913
3913
|
case "$gte":
|
|
3914
3914
|
case "$lte":
|
|
3915
|
-
|
|
3915
|
+
c(t, n, e);
|
|
3916
3916
|
break;
|
|
3917
3917
|
case "$like":
|
|
3918
3918
|
case "$ilike":
|
|
3919
|
-
if (
|
|
3919
|
+
if (c(t, "string", e), t === "$ilike" && !s.isIndexed)
|
|
3920
3920
|
throw new I(`Operator '${t}' can only be used with indexed attributes, but '${r}' in entity '${i}' is not indexed`, o);
|
|
3921
3921
|
break;
|
|
3922
3922
|
case "$isNull":
|
|
3923
|
-
|
|
3923
|
+
c(t, "boolean", e);
|
|
3924
3924
|
break;
|
|
3925
3925
|
default:
|
|
3926
3926
|
throw new I(`Unknown operator '${t}' for attribute '${r}' in entity '${i}'`, o);
|
|
@@ -3930,9 +3930,9 @@ const rr = [
|
|
|
3930
3930
|
if (typeof t == "object" && t !== null && !Array.isArray(t)) {
|
|
3931
3931
|
if (o)
|
|
3932
3932
|
return;
|
|
3933
|
-
const
|
|
3934
|
-
for (const [d,
|
|
3935
|
-
fu(d,
|
|
3933
|
+
const c = t;
|
|
3934
|
+
for (const [d, a] of Object.entries(c))
|
|
3935
|
+
fu(d, a, s, e, r, n, `${i}.${d}`);
|
|
3936
3936
|
} else if (!Jr(t, s, o))
|
|
3937
3937
|
throw new I(`Invalid value for attribute '${e}' in entity '${r}'. Expected ${s}, but received: ${typeof t}`, i);
|
|
3938
3938
|
}, lu = (t, e, n, r, i) => {
|
|
@@ -3940,19 +3940,19 @@ const rr = [
|
|
|
3940
3940
|
if (s.length < 2)
|
|
3941
3941
|
throw new I(`Invalid dot notation path '${t}'. Must contain at least one dot.`, i);
|
|
3942
3942
|
let o = n;
|
|
3943
|
-
for (let
|
|
3944
|
-
const f = s[
|
|
3943
|
+
for (let a = 0; a < s.length - 1; a++) {
|
|
3944
|
+
const f = s[a], h = r.entities[o];
|
|
3945
3945
|
if (!h)
|
|
3946
3946
|
throw new I(`Entity '${o}' does not exist in schema while traversing dot notation path '${t}'.`, i);
|
|
3947
3947
|
const p = h.links[f];
|
|
3948
3948
|
if (!p) {
|
|
3949
|
-
const
|
|
3950
|
-
throw new I(`Link '${f}' does not exist on entity '${o}' in dot notation path '${t}'. Available links: ${
|
|
3949
|
+
const y = Object.keys(h.links);
|
|
3950
|
+
throw new I(`Link '${f}' does not exist on entity '${o}' in dot notation path '${t}'. Available links: ${y.length > 0 ? y.join(", ") : "none"}`, i);
|
|
3951
3951
|
}
|
|
3952
3952
|
o = p.entityName;
|
|
3953
3953
|
}
|
|
3954
|
-
const u = s[s.length - 1],
|
|
3955
|
-
if (!
|
|
3954
|
+
const u = s[s.length - 1], c = r.entities[o];
|
|
3955
|
+
if (!c)
|
|
3956
3956
|
throw new I(`Target entity '${o}' does not exist in schema for dot notation path '${t}'.`, i);
|
|
3957
3957
|
if (u === "id") {
|
|
3958
3958
|
if (typeof e == "string" && !Se(e))
|
|
@@ -3960,16 +3960,16 @@ const rr = [
|
|
|
3960
3960
|
we(e, t, new se("string", !1, !0), n, i);
|
|
3961
3961
|
return;
|
|
3962
3962
|
}
|
|
3963
|
-
const d =
|
|
3964
|
-
if (Object.keys(
|
|
3963
|
+
const d = c.attrs[u];
|
|
3964
|
+
if (Object.keys(c.links).includes(u)) {
|
|
3965
3965
|
if (typeof e == "string" && !Se(e))
|
|
3966
3966
|
throw new I(`Invalid value for link '${u}' in entity '${o}'. Expected a UUID, but received: ${e}`, i);
|
|
3967
3967
|
we(e, t, new se("string", !1, !0), n, i);
|
|
3968
3968
|
return;
|
|
3969
3969
|
}
|
|
3970
3970
|
if (!d) {
|
|
3971
|
-
const
|
|
3972
|
-
throw new I(`Attribute '${u}' does not exist on entity '${o}' in dot notation path '${t}'. Available attributes: ${
|
|
3971
|
+
const a = Object.keys(c.attrs);
|
|
3972
|
+
throw new I(`Attribute '${u}' does not exist on entity '${o}' in dot notation path '${t}'. Available attributes: ${a.length > 0 ? a.join(", ") + ", id" : "id"}`, i);
|
|
3973
3973
|
}
|
|
3974
3974
|
we(e, t, d, n, i);
|
|
3975
3975
|
}, Zr = (t, e, n, r) => {
|
|
@@ -3991,14 +3991,14 @@ const rr = [
|
|
|
3991
3991
|
const o = n.entities[e];
|
|
3992
3992
|
if (!o)
|
|
3993
3993
|
continue;
|
|
3994
|
-
const u = o.attrs[i],
|
|
3995
|
-
if (!u && !
|
|
3996
|
-
const d = Object.keys(o.attrs),
|
|
3997
|
-
throw new I(`Attribute or link '${i}' does not exist on entity '${e}'. Available attributes: ${d.length > 0 ? d.join(", ") : "none"}. Available links: ${
|
|
3994
|
+
const u = o.attrs[i], c = o.links[i];
|
|
3995
|
+
if (!u && !c) {
|
|
3996
|
+
const d = Object.keys(o.attrs), a = Object.keys(o.links);
|
|
3997
|
+
throw new I(`Attribute or link '${i}' does not exist on entity '${e}'. Available attributes: ${d.length > 0 ? d.join(", ") : "none"}. Available links: ${a.length > 0 ? a.join(", ") : "none"}`, `${r}.${i}`);
|
|
3998
3998
|
}
|
|
3999
3999
|
if (u)
|
|
4000
4000
|
we(s, i, u, e, `${r}.${i}`);
|
|
4001
|
-
else if (
|
|
4001
|
+
else if (c) {
|
|
4002
4002
|
if (typeof s == "string" && !Se(s))
|
|
4003
4003
|
throw new I(`Invalid value for link '${i}' in entity '${e}'. Expected a UUID, but received: ${s}`, `${r}.${i}`);
|
|
4004
4004
|
const d = new se("string", !1, !0);
|
|
@@ -4032,13 +4032,13 @@ const rr = [
|
|
|
4032
4032
|
for (const o of Object.keys(t))
|
|
4033
4033
|
if (o !== "$") {
|
|
4034
4034
|
if (n && !(o in n.entities[e].links)) {
|
|
4035
|
-
const
|
|
4036
|
-
throw new I(`Link '${o}' does not exist on entity '${e}'. Available links: ${
|
|
4035
|
+
const c = Object.keys(n.entities[e].links);
|
|
4036
|
+
throw new I(`Link '${o}' does not exist on entity '${e}'. Available links: ${c.length > 0 ? c.join(", ") : "none"}`, `${r}.${o}`);
|
|
4037
4037
|
}
|
|
4038
4038
|
const u = t[o];
|
|
4039
4039
|
if (typeof u == "object" && u !== null) {
|
|
4040
|
-
const
|
|
4041
|
-
|
|
4040
|
+
const c = (s = n == null ? void 0 : n.entities[e].links[o]) === null || s === void 0 ? void 0 : s.entityName;
|
|
4041
|
+
c && Xr(u, c, n, `${r}.${o}`, i + 1);
|
|
4042
4042
|
}
|
|
4043
4043
|
} else {
|
|
4044
4044
|
const u = t[o];
|
|
@@ -4077,7 +4077,7 @@ const ei = (t) => t.length > 0 ? t.join(", ") : "none", pu = (t, e) => new Z(`En
|
|
|
4077
4077
|
boolean: (t) => typeof t == "boolean",
|
|
4078
4078
|
date: (t) => t instanceof Date || typeof t == "string" || typeof t == "number",
|
|
4079
4079
|
json: () => !0
|
|
4080
|
-
},
|
|
4080
|
+
}, bu = (t, e) => {
|
|
4081
4081
|
var n, r;
|
|
4082
4082
|
return t == null ? !0 : (r = (n = or[e.valueType]) === null || n === void 0 ? void 0 : n.call(or, t)) !== null && r !== void 0 ? r : !1;
|
|
4083
4083
|
}, ti = (t, e) => {
|
|
@@ -4093,7 +4093,7 @@ const ei = (t) => t.length > 0 ? t.join(", ") : "none", pu = (t, e) => new Z(`En
|
|
|
4093
4093
|
if (i === "id")
|
|
4094
4094
|
continue;
|
|
4095
4095
|
const o = r.attrs[i];
|
|
4096
|
-
if (o && !
|
|
4096
|
+
if (o && !bu(s, o))
|
|
4097
4097
|
throw new Z(`Invalid value for attribute '${i}' in entity '${t}'. Expected ${o.valueType}, but received: ${typeof s}`);
|
|
4098
4098
|
}
|
|
4099
4099
|
}, ur = (t, e, n) => {
|
|
@@ -4114,7 +4114,7 @@ const ei = (t) => t.length > 0 ? t.join(", ") : "none", pu = (t, e) => new Z(`En
|
|
|
4114
4114
|
throw new Z(`Invalid UUID in link '${i}' for entity '${t}'. Expected a UUID, but received: ${s}`);
|
|
4115
4115
|
}
|
|
4116
4116
|
}
|
|
4117
|
-
},
|
|
4117
|
+
}, yu = {
|
|
4118
4118
|
create: St,
|
|
4119
4119
|
update: St,
|
|
4120
4120
|
merge: St,
|
|
@@ -4130,7 +4130,7 @@ const ei = (t) => t.length > 0 ? t.join(", ") : "none", pu = (t, e) => new Z(`En
|
|
|
4130
4130
|
throw new Z(`Invalid id for entity '${r}'. Expected a UUID, but received: ${i}`);
|
|
4131
4131
|
if (typeof r != "string")
|
|
4132
4132
|
throw new Z(`Entity name must be a string, but received: ${typeof r}`);
|
|
4133
|
-
const o =
|
|
4133
|
+
const o = yu[n];
|
|
4134
4134
|
o && s !== void 0 && o(r, s, e);
|
|
4135
4135
|
}, gu = (t, e) => {
|
|
4136
4136
|
const n = Array.isArray(t) ? t : [t];
|
|
@@ -4153,22 +4153,22 @@ var ar = function(t, e, n, r) {
|
|
|
4153
4153
|
});
|
|
4154
4154
|
}
|
|
4155
4155
|
return new (n || (n = Promise))(function(s, o) {
|
|
4156
|
-
function u(
|
|
4156
|
+
function u(a) {
|
|
4157
4157
|
try {
|
|
4158
|
-
d(r.next(
|
|
4158
|
+
d(r.next(a));
|
|
4159
4159
|
} catch (f) {
|
|
4160
4160
|
o(f);
|
|
4161
4161
|
}
|
|
4162
4162
|
}
|
|
4163
|
-
function a
|
|
4163
|
+
function c(a) {
|
|
4164
4164
|
try {
|
|
4165
|
-
d(r.throw(
|
|
4165
|
+
d(r.throw(a));
|
|
4166
4166
|
} catch (f) {
|
|
4167
4167
|
o(f);
|
|
4168
4168
|
}
|
|
4169
4169
|
}
|
|
4170
|
-
function d(
|
|
4171
|
-
|
|
4170
|
+
function d(a) {
|
|
4171
|
+
a.done ? s(a.value) : i(a.value).then(u, c);
|
|
4172
4172
|
}
|
|
4173
4173
|
d((r = r.apply(t, e || [])).next());
|
|
4174
4174
|
});
|
|
@@ -4287,22 +4287,22 @@ var dr = function(t, e, n, r) {
|
|
|
4287
4287
|
});
|
|
4288
4288
|
}
|
|
4289
4289
|
return new (n || (n = Promise))(function(s, o) {
|
|
4290
|
-
function u(
|
|
4290
|
+
function u(a) {
|
|
4291
4291
|
try {
|
|
4292
|
-
d(r.next(
|
|
4292
|
+
d(r.next(a));
|
|
4293
4293
|
} catch (f) {
|
|
4294
4294
|
o(f);
|
|
4295
4295
|
}
|
|
4296
4296
|
}
|
|
4297
|
-
function a
|
|
4297
|
+
function c(a) {
|
|
4298
4298
|
try {
|
|
4299
|
-
d(r.throw(
|
|
4299
|
+
d(r.throw(a));
|
|
4300
4300
|
} catch (f) {
|
|
4301
4301
|
o(f);
|
|
4302
4302
|
}
|
|
4303
4303
|
}
|
|
4304
|
-
function d(
|
|
4305
|
-
|
|
4304
|
+
function d(a) {
|
|
4305
|
+
a.done ? s(a.value) : i(a.value).then(u, c);
|
|
4306
4306
|
}
|
|
4307
4307
|
d((r = r.apply(t, e || [])).next());
|
|
4308
4308
|
});
|
|
@@ -4430,16 +4430,16 @@ class Ou {
|
|
|
4430
4430
|
}
|
|
4431
4431
|
this.subs.set((s) => {
|
|
4432
4432
|
var o, u;
|
|
4433
|
-
const
|
|
4434
|
-
if (!
|
|
4433
|
+
const c = s[i];
|
|
4434
|
+
if (!c)
|
|
4435
4435
|
return this.log.error("Missing sub for hash", i, e), s;
|
|
4436
|
-
const d = (u = (o =
|
|
4437
|
-
for (const
|
|
4438
|
-
for (const f of
|
|
4439
|
-
|
|
4440
|
-
return
|
|
4436
|
+
const d = (u = (o = c.result) === null || o === void 0 ? void 0 : o.store) !== null && u !== void 0 ? u : this.createStore([]);
|
|
4437
|
+
for (const a of r)
|
|
4438
|
+
for (const f of a)
|
|
4439
|
+
xt(d, f);
|
|
4440
|
+
return c.result = {
|
|
4441
4441
|
store: d,
|
|
4442
|
-
result: Vt({ store: d, pageInfo: null, aggregate: null },
|
|
4442
|
+
result: Vt({ store: d, pageInfo: null, aggregate: null }, c.query)
|
|
4443
4443
|
}, s;
|
|
4444
4444
|
}), this.notifyCbs(i);
|
|
4445
4445
|
}
|
|
@@ -4468,22 +4468,22 @@ class Ou {
|
|
|
4468
4468
|
const u = i[r];
|
|
4469
4469
|
if (!u)
|
|
4470
4470
|
return this.log.error("Missing sub for hash", r, e), i;
|
|
4471
|
-
const
|
|
4472
|
-
if (!
|
|
4471
|
+
const c = u.state;
|
|
4472
|
+
if (!c)
|
|
4473
4473
|
return this.log.error("Missing state for sub", u, e), i;
|
|
4474
4474
|
const d = (o = (s = u.result) === null || s === void 0 ? void 0 : s.store) !== null && o !== void 0 ? o : this.createStore([]);
|
|
4475
|
-
for (const
|
|
4476
|
-
if (!(
|
|
4477
|
-
for (const { action: f, triple: h } of
|
|
4475
|
+
for (const a of e.txes)
|
|
4476
|
+
if (!(c.txId > a["tx-id"])) {
|
|
4477
|
+
for (const { action: f, triple: h } of a.changes)
|
|
4478
4478
|
switch (f) {
|
|
4479
4479
|
case "added":
|
|
4480
|
-
|
|
4480
|
+
xt(d, h);
|
|
4481
4481
|
break;
|
|
4482
4482
|
case "removed":
|
|
4483
4483
|
Pr(d, h);
|
|
4484
4484
|
break;
|
|
4485
4485
|
}
|
|
4486
|
-
|
|
4486
|
+
c.txId = a["tx-id"];
|
|
4487
4487
|
}
|
|
4488
4488
|
return u.result = {
|
|
4489
4489
|
store: d,
|
|
@@ -4491,30 +4491,43 @@ class Ou {
|
|
|
4491
4491
|
}, i;
|
|
4492
4492
|
}), this.notifyCbs(r);
|
|
4493
4493
|
}
|
|
4494
|
+
clearSubscriptionData(e) {
|
|
4495
|
+
const n = this.idToHash[e];
|
|
4496
|
+
if (n) {
|
|
4497
|
+
delete this.idToHash[e];
|
|
4498
|
+
const r = this.subs.currentValue[n];
|
|
4499
|
+
if (this.subs.set((i) => (delete i[n], i)), r)
|
|
4500
|
+
return r;
|
|
4501
|
+
}
|
|
4502
|
+
}
|
|
4503
|
+
onResyncError(e) {
|
|
4504
|
+
const n = e["original-event"]["subscription-id"], r = this.clearSubscriptionData(n);
|
|
4505
|
+
r && this.initSubscription(r.query, r.hash);
|
|
4506
|
+
}
|
|
4494
4507
|
}
|
|
4495
|
-
var
|
|
4508
|
+
var D = function(t, e, n, r) {
|
|
4496
4509
|
function i(s) {
|
|
4497
4510
|
return s instanceof n ? s : new n(function(o) {
|
|
4498
4511
|
o(s);
|
|
4499
4512
|
});
|
|
4500
4513
|
}
|
|
4501
4514
|
return new (n || (n = Promise))(function(s, o) {
|
|
4502
|
-
function u(
|
|
4515
|
+
function u(a) {
|
|
4503
4516
|
try {
|
|
4504
|
-
d(r.next(
|
|
4517
|
+
d(r.next(a));
|
|
4505
4518
|
} catch (f) {
|
|
4506
4519
|
o(f);
|
|
4507
4520
|
}
|
|
4508
4521
|
}
|
|
4509
|
-
function a
|
|
4522
|
+
function c(a) {
|
|
4510
4523
|
try {
|
|
4511
|
-
d(r.throw(
|
|
4524
|
+
d(r.throw(a));
|
|
4512
4525
|
} catch (f) {
|
|
4513
4526
|
o(f);
|
|
4514
4527
|
}
|
|
4515
4528
|
}
|
|
4516
|
-
function d(
|
|
4517
|
-
|
|
4529
|
+
function d(a) {
|
|
4530
|
+
a.done ? s(a.value) : i(a.value).then(u, c);
|
|
4518
4531
|
}
|
|
4519
4532
|
d((r = r.apply(t, e || [])).next());
|
|
4520
4533
|
});
|
|
@@ -4580,50 +4593,50 @@ function Ru(t) {
|
|
|
4580
4593
|
}
|
|
4581
4594
|
function lr(t) {
|
|
4582
4595
|
return [...t].sort((e, n) => {
|
|
4583
|
-
const [r, i] = e, [s, o] = n, u = i.order || 0,
|
|
4584
|
-
return u ==
|
|
4596
|
+
const [r, i] = e, [s, o] = n, u = i.order || 0, c = o.order || 0;
|
|
4597
|
+
return u == c ? r < s ? -1 : r > s ? 1 : 0 : u - c;
|
|
4585
4598
|
});
|
|
4586
4599
|
}
|
|
4587
4600
|
class $u {
|
|
4588
4601
|
constructor(e, n = Kr, r = Br, i, s) {
|
|
4589
|
-
var o, u,
|
|
4590
|
-
if (this._isOnline = !0, this._isShutdown = !1, this.status = ie.CONNECTING, this.queryCbs = {}, this.queryOnceDfds = {}, this.authCbs = [], this.attrsCbs = [], this.mutationErrorCbs = [], this.connectionStatusCbs = [], this.mutationDeferredStore = /* @__PURE__ */ new Map(), this._reconnectTimeoutId = null, this._reconnectTimeoutMs = 0, this._transportType = "ws", this._wsOk = null, this._localIdPromises = {}, this._errorMessage = null, this._oauthCallbackResponse = null, this._linkIndex = null, this._rooms = {}, this._roomsPendingLeave = {}, this._presence = {}, this._broadcastQueue = [], this._broadcastSubs = {}, this._currentUserCached = { isLoading: !0, error: void 0, user: void 0 }, this._beforeUnloadCbs = [], this._dataForQueryCache = {}, this._inFlightMutationEventIds = /* @__PURE__ */ new Set(), this._onMergeQuerySubs = (d,
|
|
4591
|
-
const f = d || {}, h = Object.assign({},
|
|
4592
|
-
Object.entries(
|
|
4602
|
+
var o, u, c;
|
|
4603
|
+
if (this._isOnline = !0, this._isShutdown = !1, this.status = ie.CONNECTING, this.queryCbs = {}, this.queryOnceDfds = {}, this.authCbs = [], this.attrsCbs = [], this.mutationErrorCbs = [], this.connectionStatusCbs = [], this.mutationDeferredStore = /* @__PURE__ */ new Map(), this._reconnectTimeoutId = null, this._reconnectTimeoutMs = 0, this._transportType = "ws", this._wsOk = null, this._localIdPromises = {}, this._errorMessage = null, this._oauthCallbackResponse = null, this._linkIndex = null, this._rooms = {}, this._roomsPendingLeave = {}, this._presence = {}, this._broadcastQueue = [], this._broadcastSubs = {}, this._currentUserCached = { isLoading: !0, error: void 0, user: void 0 }, this._beforeUnloadCbs = [], this._dataForQueryCache = {}, this._inFlightMutationEventIds = /* @__PURE__ */ new Set(), this._onMergeQuerySubs = (d, a) => {
|
|
4604
|
+
const f = d || {}, h = Object.assign({}, a);
|
|
4605
|
+
Object.entries(a).forEach(([y, g]) => {
|
|
4593
4606
|
var w;
|
|
4594
|
-
const _ = (w = f == null ? void 0 : f[
|
|
4595
|
-
_ && !m && (h[
|
|
4596
|
-
}), Object.keys(f).filter((
|
|
4607
|
+
const _ = (w = f == null ? void 0 : f[y]) === null || w === void 0 ? void 0 : w.result, m = g.result;
|
|
4608
|
+
_ && !m && (h[y].result = _);
|
|
4609
|
+
}), Object.keys(f).filter((y) => !a[y]).sort((y, g) => {
|
|
4597
4610
|
var w, _;
|
|
4598
|
-
const m = ((w = f[
|
|
4611
|
+
const m = ((w = f[y]) === null || w === void 0 ? void 0 : w.lastAccessed) || 0;
|
|
4599
4612
|
return (((_ = f[g]) === null || _ === void 0 ? void 0 : _.lastAccessed) || 0) - m;
|
|
4600
|
-
}).slice(0, this.queryCacheLimit).forEach((
|
|
4601
|
-
h[
|
|
4602
|
-
}), this.querySubs.set((
|
|
4603
|
-
}, this._onMergePendingMutations = (d,
|
|
4604
|
-
const f = new Map([...d.entries(), ...
|
|
4605
|
-
this.pendingMutations.set((p) => f), this.loadedNotifyAll(), this._rewriteMutationsSorted(this.attrs, d).forEach(([p,
|
|
4606
|
-
!
|
|
4613
|
+
}).slice(0, this.queryCacheLimit).forEach((y) => {
|
|
4614
|
+
h[y] = f[y];
|
|
4615
|
+
}), this.querySubs.set((y) => h), this.loadedNotifyAll();
|
|
4616
|
+
}, this._onMergePendingMutations = (d, a) => {
|
|
4617
|
+
const f = new Map([...d.entries(), ...a.entries()]);
|
|
4618
|
+
this.pendingMutations.set((p) => f), this.loadedNotifyAll(), this._rewriteMutationsSorted(this.attrs, d).forEach(([p, y]) => {
|
|
4619
|
+
!a.has(p) && !y["tx-id"] && this._sendMutation(p, y);
|
|
4607
4620
|
});
|
|
4608
4621
|
}, this.getPreviousResult = (d) => {
|
|
4609
|
-
const
|
|
4610
|
-
return this.dataForQuery(
|
|
4622
|
+
const a = V(d);
|
|
4623
|
+
return this.dataForQuery(a);
|
|
4611
4624
|
}, this.notifyOne = (d) => {
|
|
4612
|
-
var
|
|
4613
|
-
const h = (
|
|
4614
|
-
|
|
4625
|
+
var a, f;
|
|
4626
|
+
const h = (a = this.queryCbs[d]) !== null && a !== void 0 ? a : [], p = (f = this._dataForQueryCache[d]) === null || f === void 0 ? void 0 : f.data, y = this.dataForQuery(d);
|
|
4627
|
+
y && (Xe(y, p) || h.forEach((g) => g.cb(y)));
|
|
4615
4628
|
}, this.notifyOneQueryOnce = (d) => {
|
|
4616
|
-
var
|
|
4617
|
-
const f = (
|
|
4629
|
+
var a;
|
|
4630
|
+
const f = (a = this.queryOnceDfds[d]) !== null && a !== void 0 ? a : [], h = this.dataForQuery(d);
|
|
4618
4631
|
f.forEach((p) => {
|
|
4619
4632
|
this._completeQueryOnce(p.q, d, p.dfd), p.dfd.resolve(h);
|
|
4620
4633
|
});
|
|
4621
|
-
}, this.notifyQueryError = (d,
|
|
4622
|
-
(this.queryCbs[d] || []).forEach((h) => h.cb({ error:
|
|
4634
|
+
}, this.notifyQueryError = (d, a) => {
|
|
4635
|
+
(this.queryCbs[d] || []).forEach((h) => h.cb({ error: a }));
|
|
4623
4636
|
}, this.pushTx = (d) => {
|
|
4624
4637
|
this.config.disableValidation || gu(d, this.config.schema);
|
|
4625
4638
|
try {
|
|
4626
|
-
const
|
|
4639
|
+
const a = Bo({
|
|
4627
4640
|
attrs: this.optimisticAttrs(),
|
|
4628
4641
|
schema: this.config.schema,
|
|
4629
4642
|
stores: Object.values(this.querySubs.currentValue).map((f) => {
|
|
@@ -4632,25 +4645,25 @@ class $u {
|
|
|
4632
4645
|
}),
|
|
4633
4646
|
useDateObjects: this.config.useDateObjects
|
|
4634
4647
|
}, d);
|
|
4635
|
-
return this.pushOps(
|
|
4636
|
-
} catch (
|
|
4637
|
-
return this.pushOps([],
|
|
4648
|
+
return this.pushOps(a);
|
|
4649
|
+
} catch (a) {
|
|
4650
|
+
return this.pushOps([], a);
|
|
4638
4651
|
}
|
|
4639
|
-
}, this.pushOps = (d,
|
|
4640
|
-
const f = L(), h = [...this.pendingMutations.currentValue.values()], p = Math.max(0, ...h.map((w) => w.order || 0)) + 1,
|
|
4652
|
+
}, this.pushOps = (d, a) => {
|
|
4653
|
+
const f = L(), h = [...this.pendingMutations.currentValue.values()], p = Math.max(0, ...h.map((w) => w.order || 0)) + 1, y = {
|
|
4641
4654
|
op: "transact",
|
|
4642
4655
|
"tx-steps": d,
|
|
4643
4656
|
created: Date.now(),
|
|
4644
|
-
error:
|
|
4657
|
+
error: a,
|
|
4645
4658
|
order: p
|
|
4646
4659
|
};
|
|
4647
|
-
this.pendingMutations.set((w) => (w.set(f,
|
|
4660
|
+
this.pendingMutations.set((w) => (w.set(f, y), w));
|
|
4648
4661
|
const g = new er();
|
|
4649
|
-
return this.mutationDeferredStore.set(f, g), this._sendMutation(f,
|
|
4662
|
+
return this.mutationDeferredStore.set(f, g), this._sendMutation(f, y), this.notifyAll(), g.promise;
|
|
4650
4663
|
}, this._transportOnOpen = (d) => {
|
|
4651
|
-
const
|
|
4652
|
-
if (this._transport !==
|
|
4653
|
-
this._log.info("[socket][open]",
|
|
4664
|
+
const a = d.target;
|
|
4665
|
+
if (this._transport !== a) {
|
|
4666
|
+
this._log.info("[socket][open]", a.id, "skip; this is no longer the current transport");
|
|
4654
4667
|
return;
|
|
4655
4668
|
}
|
|
4656
4669
|
this._log.info("[socket][open]", this._transport.id), this._setStatus(ie.OPENED), this.getCurrentUser().then((f) => {
|
|
@@ -4668,22 +4681,22 @@ class $u {
|
|
|
4668
4681
|
"__admin-token": this.config.__adminToken
|
|
4669
4682
|
});
|
|
4670
4683
|
}).catch((f) => {
|
|
4671
|
-
this._log.error("[socket][error]",
|
|
4684
|
+
this._log.error("[socket][error]", a.id, f);
|
|
4672
4685
|
});
|
|
4673
4686
|
}, this._transportOnMessage = (d) => {
|
|
4674
|
-
const
|
|
4675
|
-
if (this._transport !==
|
|
4676
|
-
this._log.info("[socket][message]",
|
|
4687
|
+
const a = d.target, f = d.message;
|
|
4688
|
+
if (this._transport !== a) {
|
|
4689
|
+
this._log.info("[socket][message]", a.id, f, "skip; this is no longer the current transport");
|
|
4677
4690
|
return;
|
|
4678
4691
|
}
|
|
4679
|
-
!this._wsOk &&
|
|
4692
|
+
!this._wsOk && a.type === "ws" && (this._wsOk = !0), this._transportType = "ws", this._handleReceive(a.id, d.message);
|
|
4680
4693
|
}, this._transportOnError = (d) => {
|
|
4681
|
-
const
|
|
4682
|
-
if (this._transport !==
|
|
4683
|
-
this._log.info("[socket][error]",
|
|
4694
|
+
const a = d.target;
|
|
4695
|
+
if (this._transport !== a) {
|
|
4696
|
+
this._log.info("[socket][error]", a.id, "skip; this is no longer the current transport");
|
|
4684
4697
|
return;
|
|
4685
4698
|
}
|
|
4686
|
-
this._log.error("[socket][error]",
|
|
4699
|
+
this._log.error("[socket][error]", a.id, d);
|
|
4687
4700
|
}, this._scheduleReconnect = () => {
|
|
4688
4701
|
!this._wsOk && this._transportType !== "sse" && (this._transportType = "sse", this._reconnectTimeoutMs = 0), setTimeout(() => {
|
|
4689
4702
|
if (this._reconnectTimeoutMs = Math.min(this._reconnectTimeoutMs + 1e3, 1e4), !this._isOnline) {
|
|
@@ -4693,28 +4706,28 @@ class $u {
|
|
|
4693
4706
|
this._startSocket();
|
|
4694
4707
|
}, this._reconnectTimeoutMs);
|
|
4695
4708
|
}, this._transportOnClose = (d) => {
|
|
4696
|
-
const
|
|
4697
|
-
if (this._transport !==
|
|
4698
|
-
this._log.info("[socket][close]",
|
|
4709
|
+
const a = d.target;
|
|
4710
|
+
if (this._transport !== a) {
|
|
4711
|
+
this._log.info("[socket][close]", a.id, "skip; this is no longer the current transport");
|
|
4699
4712
|
return;
|
|
4700
4713
|
}
|
|
4701
4714
|
this._setStatus(ie.CLOSED);
|
|
4702
4715
|
for (const f of Object.values(this._rooms))
|
|
4703
4716
|
f.isConnected = !1;
|
|
4704
4717
|
if (this._isShutdown) {
|
|
4705
|
-
this._log.info("[socket][close]",
|
|
4718
|
+
this._log.info("[socket][close]", a.id, "Reactor has been shut down and will not reconnect");
|
|
4706
4719
|
return;
|
|
4707
4720
|
}
|
|
4708
|
-
this._log.info("[socket][close]",
|
|
4709
|
-
}, this._EventSource = s, this.config = Object.assign(Object.assign({}, ku), e), this.queryCacheLimit = (o = this.config.queryCacheLimit) !== null && o !== void 0 ? o : 10, this._pendingTxCleanupTimeout = (u = this.config.pendingTxCleanupTimeout) !== null && u !== void 0 ? u : Cu, this._pendingMutationCleanupThreshold = (
|
|
4721
|
+
this._log.info("[socket][close]", a.id, "schedule reconnect, ms =", this._reconnectTimeoutMs), this._scheduleReconnect();
|
|
4722
|
+
}, this._EventSource = s, this.config = Object.assign(Object.assign({}, ku), e), this.queryCacheLimit = (o = this.config.queryCacheLimit) !== null && o !== void 0 ? o : 10, this._pendingTxCleanupTimeout = (u = this.config.pendingTxCleanupTimeout) !== null && u !== void 0 ? u : Cu, this._pendingMutationCleanupThreshold = (c = this.config.pendingMutationCleanupThreshold) !== null && c !== void 0 ? c : ju, this._log = cu(e.verbose || dn || Qr, () => this._reactorStats()), this.versions = Object.assign(Object.assign({}, i || {}), { "@instantdb/core": Yr }), this.config.schema && (this._linkIndex = nr(this.config.schema)), !!Pu()) {
|
|
4710
4723
|
if (!e.appId)
|
|
4711
4724
|
throw new Error("Instant must be initialized with an appId.");
|
|
4712
4725
|
if (!Se(e.appId))
|
|
4713
4726
|
throw new Error(`Instant must be initialized with a valid appId. \`${e.appId}\` is not a valid uuid.`);
|
|
4714
|
-
typeof BroadcastChannel == "function" && (this._broadcastChannel = new BroadcastChannel("@instantdb"), this._broadcastChannel.addEventListener("message", (d) =>
|
|
4715
|
-
var
|
|
4727
|
+
typeof BroadcastChannel == "function" && (this._broadcastChannel = new BroadcastChannel("@instantdb"), this._broadcastChannel.addEventListener("message", (d) => D(this, void 0, void 0, function* () {
|
|
4728
|
+
var a;
|
|
4716
4729
|
try {
|
|
4717
|
-
if (((
|
|
4730
|
+
if (((a = d.data) === null || a === void 0 ? void 0 : a.type) === "auth") {
|
|
4718
4731
|
const f = yield this.getCurrentUser();
|
|
4719
4732
|
this.updateUser(f.user);
|
|
4720
4733
|
}
|
|
@@ -4724,8 +4737,8 @@ class $u {
|
|
|
4724
4737
|
}))), this._initStorage(n), this._syncTable = new Ou(this._trySendAuthed.bind(this), this._persister, {
|
|
4725
4738
|
useDateObjects: this.config.useDateObjects
|
|
4726
4739
|
}, this._log, (d) => et(this.attrs, d, this.config.enableCardinalityInference, this._linkIndex, this.config.useDateObjects)), this._oauthCallbackResponse = this._oauthLoginInit(), this.getCurrentUser(), r.getIsOnline().then((d) => {
|
|
4727
|
-
this._isOnline = d, this._startSocket(), r.listen((
|
|
4728
|
-
|
|
4740
|
+
this._isOnline = d, this._startSocket(), r.listen((a) => {
|
|
4741
|
+
a !== this._isOnline && (this._log.info("[network] online =", a), this._isOnline = a, this._isOnline ? this._startSocket() : (this._log.info("Changing status from", this.status, "to", ie.CLOSED), this._setStatus(ie.CLOSED)));
|
|
4729
4742
|
});
|
|
4730
4743
|
}), typeof addEventListener < "u" && (this._beforeUnload = this._beforeUnload.bind(this), addEventListener("beforeunload", this._beforeUnload));
|
|
4731
4744
|
}
|
|
@@ -4790,12 +4803,12 @@ class $u {
|
|
|
4790
4803
|
const i = (r = (n = this._presence[e]) === null || n === void 0 ? void 0 : n.result) === null || r === void 0 ? void 0 : r.user, s = this._broadcastQueue[e];
|
|
4791
4804
|
if (this._broadcastQueue[e] = [], i && this._trySetPresence(e, i), s)
|
|
4792
4805
|
for (const o of s) {
|
|
4793
|
-
const { topic: u, roomType:
|
|
4794
|
-
this._tryBroadcast(e,
|
|
4806
|
+
const { topic: u, roomType: c, data: d } = o;
|
|
4807
|
+
this._tryBroadcast(e, c, u, d);
|
|
4795
4808
|
}
|
|
4796
4809
|
}
|
|
4797
4810
|
_handleReceive(e, n) {
|
|
4798
|
-
var r, i, s, o, u,
|
|
4811
|
+
var r, i, s, o, u, c;
|
|
4799
4812
|
const d = !!this.config.schema && ("cardinalityInference" in this.config ? !!this.config.cardinalityInference : !0);
|
|
4800
4813
|
switch (fr[n.op] || this._log.info("[receive]", e, n.op, n), n.op) {
|
|
4801
4814
|
case "init-ok": {
|
|
@@ -4811,13 +4824,13 @@ class $u {
|
|
|
4811
4824
|
break;
|
|
4812
4825
|
}
|
|
4813
4826
|
case "add-query-ok": {
|
|
4814
|
-
const { q: h, result: p } = n,
|
|
4815
|
-
this.querySubs.set((S) => (S[
|
|
4827
|
+
const { q: h, result: p } = n, y = V(h), g = (o = (s = p == null ? void 0 : p[0]) === null || s === void 0 ? void 0 : s.data) === null || o === void 0 ? void 0 : o["page-info"], w = (c = (u = p == null ? void 0 : p[0]) === null || u === void 0 ? void 0 : u.data) === null || c === void 0 ? void 0 : c.aggregate, _ = tr(p), m = et(this.attrs, _, d, this._linkIndex, this.config.useDateObjects);
|
|
4828
|
+
this.querySubs.set((S) => (S[y].result = {
|
|
4816
4829
|
store: m,
|
|
4817
4830
|
pageInfo: g,
|
|
4818
4831
|
aggregate: w,
|
|
4819
4832
|
processedTxId: n["processed-tx-id"]
|
|
4820
|
-
}, S)), this._cleanupPendingMutationsQueries(), this.notifyOne(
|
|
4833
|
+
}, S)), this._cleanupPendingMutationsQueries(), this.notifyOne(y), this.notifyOneQueryOnce(y), this._cleanupPendingMutationsTimeout();
|
|
4821
4834
|
break;
|
|
4822
4835
|
}
|
|
4823
4836
|
case "start-sync-ok": {
|
|
@@ -4837,17 +4850,17 @@ class $u {
|
|
|
4837
4850
|
break;
|
|
4838
4851
|
}
|
|
4839
4852
|
case "refresh-ok": {
|
|
4840
|
-
const { computations: h, attrs: p } = n,
|
|
4853
|
+
const { computations: h, attrs: p } = n, y = n["processed-tx-id"];
|
|
4841
4854
|
p && this._setAttrs(p), this._cleanupPendingMutationsTimeout();
|
|
4842
|
-
const g = this._rewriteMutations(this.attrs, this.pendingMutations.currentValue,
|
|
4855
|
+
const g = this._rewriteMutations(this.attrs, this.pendingMutations.currentValue, y);
|
|
4843
4856
|
g !== this.pendingMutations.currentValue && this.pendingMutations.set(() => g);
|
|
4844
4857
|
const w = lr(g.entries()), _ = h.map((m) => {
|
|
4845
|
-
var S,
|
|
4846
|
-
const N = m["instaql-query"], q = m["instaql-result"], Ce = V(N), Ve = tr(q), dt = et(this.attrs, Ve, d, this._linkIndex, this.config.useDateObjects), ft = this._applyOptimisticUpdates(dt, w,
|
|
4858
|
+
var S, x, O, P;
|
|
4859
|
+
const N = m["instaql-query"], q = m["instaql-result"], Ce = V(N), Ve = tr(q), dt = et(this.attrs, Ve, d, this._linkIndex, this.config.useDateObjects), ft = this._applyOptimisticUpdates(dt, w, y), qe = (x = (S = q == null ? void 0 : q[0]) === null || S === void 0 ? void 0 : S.data) === null || x === void 0 ? void 0 : x["page-info"], ne = (P = (O = q == null ? void 0 : q[0]) === null || O === void 0 ? void 0 : O.data) === null || P === void 0 ? void 0 : P.aggregate;
|
|
4847
4860
|
return { hash: Ce, store: ft, pageInfo: qe, aggregate: ne };
|
|
4848
4861
|
});
|
|
4849
|
-
_.forEach(({ hash: m, store: S, pageInfo:
|
|
4850
|
-
this.querySubs.set((P) => (P[m].result = { store: S, pageInfo:
|
|
4862
|
+
_.forEach(({ hash: m, store: S, pageInfo: x, aggregate: O }) => {
|
|
4863
|
+
this.querySubs.set((P) => (P[m].result = { store: S, pageInfo: x, aggregate: O, processedTxId: y }, P));
|
|
4851
4864
|
}), this._cleanupPendingMutationsQueries(), _.forEach(({ hash: m }) => {
|
|
4852
4865
|
this.notifyOne(m);
|
|
4853
4866
|
});
|
|
@@ -4894,8 +4907,8 @@ class $u {
|
|
|
4894
4907
|
break;
|
|
4895
4908
|
}
|
|
4896
4909
|
case "join-room-error":
|
|
4897
|
-
const
|
|
4898
|
-
f && (f.error = n.error), this._notifyPresenceSubs(
|
|
4910
|
+
const a = n["room-id"], f = this._rooms[a];
|
|
4911
|
+
f && (f.error = n.error), this._notifyPresenceSubs(a);
|
|
4899
4912
|
break;
|
|
4900
4913
|
case "error":
|
|
4901
4914
|
this._handleReceiveError(n);
|
|
@@ -4922,20 +4935,20 @@ class $u {
|
|
|
4922
4935
|
}
|
|
4923
4936
|
}
|
|
4924
4937
|
_handleReceiveError(e) {
|
|
4925
|
-
var n, r, i, s, o;
|
|
4938
|
+
var n, r, i, s, o, u;
|
|
4926
4939
|
console.log("error", e);
|
|
4927
|
-
const
|
|
4928
|
-
this._inFlightMutationEventIds.delete(
|
|
4929
|
-
const
|
|
4940
|
+
const c = e["client-event-id"];
|
|
4941
|
+
this._inFlightMutationEventIds.delete(c);
|
|
4942
|
+
const d = this.pendingMutations.currentValue.get(c), a = {
|
|
4930
4943
|
message: e.message || "Uh-oh, something went wrong. Ping Joe & Stopa."
|
|
4931
4944
|
};
|
|
4932
|
-
if (e.hint && (
|
|
4933
|
-
this._handleMutationError("error",
|
|
4945
|
+
if (e.hint && (a.hint = e.hint), d) {
|
|
4946
|
+
this._handleMutationError("error", c, e);
|
|
4934
4947
|
return;
|
|
4935
4948
|
}
|
|
4936
4949
|
if (!((n = e["original-event"]) === null || n === void 0) && n.hasOwnProperty("q") && ((r = e["original-event"]) === null || r === void 0 ? void 0 : r.op) === "add-query") {
|
|
4937
|
-
const
|
|
4938
|
-
this.notifyQueryError(V(
|
|
4950
|
+
const p = (i = e["original-event"]) === null || i === void 0 ? void 0 : i.q, y = V(p);
|
|
4951
|
+
this.notifyQueryError(V(p), a), this.notifyQueryOnceError(p, y, c, a);
|
|
4939
4952
|
return;
|
|
4940
4953
|
}
|
|
4941
4954
|
if (((s = e["original-event"]) === null || s === void 0 ? void 0 : s.op) === "init") {
|
|
@@ -4943,11 +4956,15 @@ class $u {
|
|
|
4943
4956
|
this.changeCurrentUser(null);
|
|
4944
4957
|
return;
|
|
4945
4958
|
}
|
|
4946
|
-
this._setStatus(ie.ERRORED,
|
|
4959
|
+
this._setStatus(ie.ERRORED, a), this.notifyAll();
|
|
4947
4960
|
return;
|
|
4948
4961
|
}
|
|
4949
|
-
|
|
4950
|
-
|
|
4962
|
+
if (((u = e["original-event"]) === null || u === void 0 ? void 0 : u.op) === "resync-table") {
|
|
4963
|
+
this._syncTable.onResyncError(e);
|
|
4964
|
+
return;
|
|
4965
|
+
}
|
|
4966
|
+
const h = Object.assign({}, e);
|
|
4967
|
+
delete h.message, delete h.hint, console.error(e.message, h), e.hint && console.error(`This error comes with some debugging information. Here it is:
|
|
4951
4968
|
`, e.hint);
|
|
4952
4969
|
}
|
|
4953
4970
|
notifyQueryOnceError(e, n, r, i) {
|
|
@@ -5019,19 +5036,19 @@ class $u {
|
|
|
5019
5036
|
_rewriteMutations(e, n, r) {
|
|
5020
5037
|
if (!e)
|
|
5021
5038
|
return n;
|
|
5022
|
-
const i = (
|
|
5023
|
-
const [f, h, p] =
|
|
5039
|
+
const i = (a) => {
|
|
5040
|
+
const [f, h, p] = a["forward-identity"];
|
|
5024
5041
|
return F(e, h, p);
|
|
5025
|
-
}, s = (
|
|
5026
|
-
const [f, h, p] =
|
|
5042
|
+
}, s = (a) => {
|
|
5043
|
+
const [f, h, p] = a["forward-identity"];
|
|
5027
5044
|
return he(e, h, p);
|
|
5028
5045
|
}, o = { attrIdMap: {}, refSwapAttrIds: /* @__PURE__ */ new Set() };
|
|
5029
5046
|
let u = !1;
|
|
5030
|
-
const
|
|
5047
|
+
const c = (a, f) => {
|
|
5031
5048
|
const h = [];
|
|
5032
|
-
for (const p of
|
|
5033
|
-
const [
|
|
5034
|
-
if (
|
|
5049
|
+
for (const p of a) {
|
|
5050
|
+
const [y] = p;
|
|
5051
|
+
if (y === "add-attr") {
|
|
5035
5052
|
const [w, _] = p, m = i(_);
|
|
5036
5053
|
if (m && _.id !== m.id) {
|
|
5037
5054
|
o.attrIdMap[_.id] = m.id, u = !0;
|
|
@@ -5045,17 +5062,17 @@ class $u {
|
|
|
5045
5062
|
}
|
|
5046
5063
|
}
|
|
5047
5064
|
}
|
|
5048
|
-
if (r && f && r >= f &&
|
|
5065
|
+
if (r && f && r >= f && y === "add-attr" || y === "update-attr" || y === "delete-attr") {
|
|
5049
5066
|
u = !0;
|
|
5050
5067
|
continue;
|
|
5051
5068
|
}
|
|
5052
5069
|
const g = u ? So(o, p) : p;
|
|
5053
5070
|
h.push(g);
|
|
5054
5071
|
}
|
|
5055
|
-
return u ? h :
|
|
5072
|
+
return u ? h : a;
|
|
5056
5073
|
}, d = /* @__PURE__ */ new Map();
|
|
5057
|
-
for (const [
|
|
5058
|
-
d.set(
|
|
5074
|
+
for (const [a, f] of n.entries())
|
|
5075
|
+
d.set(a, Object.assign(Object.assign({}, f), { "tx-steps": c(f["tx-steps"], f["tx-id"]) }));
|
|
5059
5076
|
return u ? d : n;
|
|
5060
5077
|
}
|
|
5061
5078
|
_rewriteMutationsSorted(e, n) {
|
|
@@ -5067,12 +5084,12 @@ class $u {
|
|
|
5067
5084
|
var e;
|
|
5068
5085
|
const n = [
|
|
5069
5086
|
...this.pendingMutations.currentValue.values()
|
|
5070
|
-
].flatMap((u) => u["tx-steps"]), r = new Set(n.filter(([u,
|
|
5071
|
-
for (const [u,
|
|
5087
|
+
].flatMap((u) => u["tx-steps"]), r = new Set(n.filter(([u, c]) => u === "delete-attr").map(([u, c]) => c)), i = [];
|
|
5088
|
+
for (const [u, c] of n)
|
|
5072
5089
|
if (u === "add-attr")
|
|
5073
|
-
i.push(
|
|
5074
|
-
else if (u === "update-attr" &&
|
|
5075
|
-
const d = Object.assign(Object.assign({}, this.attrs[
|
|
5090
|
+
i.push(c);
|
|
5091
|
+
else if (u === "update-attr" && c.id && (!((e = this.attrs) === null || e === void 0) && e[c.id])) {
|
|
5092
|
+
const d = Object.assign(Object.assign({}, this.attrs[c.id]), c);
|
|
5076
5093
|
i.push(d);
|
|
5077
5094
|
}
|
|
5078
5095
|
const s = [
|
|
@@ -5088,13 +5105,13 @@ class $u {
|
|
|
5088
5105
|
return { error: n };
|
|
5089
5106
|
if (!this.querySubs || !this.pendingMutations)
|
|
5090
5107
|
return;
|
|
5091
|
-
const r = this.querySubs.version(), i = this.querySubs.currentValue, s = this.pendingMutations.version(), o = this.pendingMutations.currentValue, { q: u, result:
|
|
5092
|
-
if (!
|
|
5108
|
+
const r = this.querySubs.version(), i = this.querySubs.currentValue, s = this.pendingMutations.version(), o = this.pendingMutations.currentValue, { q: u, result: c } = i[e] || {};
|
|
5109
|
+
if (!c)
|
|
5093
5110
|
return;
|
|
5094
5111
|
const d = this._dataForQueryCache[e];
|
|
5095
5112
|
if (d && r === d.querySubVersion && s === d.pendingMutationsVersion)
|
|
5096
5113
|
return d.data;
|
|
5097
|
-
const { store:
|
|
5114
|
+
const { store: a, pageInfo: f, aggregate: h, processedTxId: p } = c, y = this._rewriteMutationsSorted(a.attrs, o), g = this._applyOptimisticUpdates(a, y, p), w = Vt({ store: g, pageInfo: f, aggregate: h }, u);
|
|
5098
5115
|
return this._dataForQueryCache[e] = {
|
|
5099
5116
|
querySubVersion: r,
|
|
5100
5117
|
pendingMutationsVersion: s,
|
|
@@ -5233,7 +5250,7 @@ class $u {
|
|
|
5233
5250
|
* id once, even if multiple callers call this function concurrently.
|
|
5234
5251
|
*/
|
|
5235
5252
|
getLocalId(e) {
|
|
5236
|
-
return
|
|
5253
|
+
return D(this, void 0, void 0, function* () {
|
|
5237
5254
|
const n = `localToken_${e}`, r = yield this._persister.getItem(n);
|
|
5238
5255
|
if (r)
|
|
5239
5256
|
return r;
|
|
@@ -5271,7 +5288,7 @@ class $u {
|
|
|
5271
5288
|
* @returns Promise<null | {error: {message: string}}>
|
|
5272
5289
|
*/
|
|
5273
5290
|
_oauthLoginInit() {
|
|
5274
|
-
return
|
|
5291
|
+
return D(this, void 0, void 0, function* () {
|
|
5275
5292
|
var e, n, r, i;
|
|
5276
5293
|
if (typeof window > "u" || typeof window.location > "u" || typeof URLSearchParams > "u")
|
|
5277
5294
|
return null;
|
|
@@ -5286,20 +5303,20 @@ class $u {
|
|
|
5286
5303
|
return null;
|
|
5287
5304
|
this._replaceUrlAfterOAuth();
|
|
5288
5305
|
try {
|
|
5289
|
-
const
|
|
5306
|
+
const c = yield this._getCurrentUser(), d = (c == null ? void 0 : c.type) === "guest", { user: a } = yield Zn({
|
|
5290
5307
|
apiURI: this.config.apiURI,
|
|
5291
5308
|
appId: this.config.appId,
|
|
5292
5309
|
code: u,
|
|
5293
|
-
refreshToken: d ?
|
|
5310
|
+
refreshToken: d ? c.refresh_token : void 0
|
|
5294
5311
|
});
|
|
5295
|
-
return this.setCurrentUser(
|
|
5296
|
-
} catch (
|
|
5297
|
-
return ((e =
|
|
5312
|
+
return this.setCurrentUser(a), null;
|
|
5313
|
+
} catch (c) {
|
|
5314
|
+
return ((e = c == null ? void 0 : c.body) === null || e === void 0 ? void 0 : e.type) === "record-not-found" && ((r = (n = c == null ? void 0 : c.body) === null || n === void 0 ? void 0 : n.hint) === null || r === void 0 ? void 0 : r["record-type"]) === "app-oauth-code" && (yield this._hasCurrentUser()) ? null : { error: { message: ((i = c == null ? void 0 : c.body) === null || i === void 0 ? void 0 : i.message) || "Error logging in." } };
|
|
5298
5315
|
}
|
|
5299
5316
|
});
|
|
5300
5317
|
}
|
|
5301
5318
|
_waitForOAuthCallbackResponse() {
|
|
5302
|
-
return
|
|
5319
|
+
return D(this, void 0, void 0, function* () {
|
|
5303
5320
|
return yield this._oauthCallbackResponse;
|
|
5304
5321
|
});
|
|
5305
5322
|
}
|
|
@@ -5320,7 +5337,7 @@ class $u {
|
|
|
5320
5337
|
};
|
|
5321
5338
|
}
|
|
5322
5339
|
getAuth() {
|
|
5323
|
-
return
|
|
5340
|
+
return D(this, void 0, void 0, function* () {
|
|
5324
5341
|
const { user: e, error: n } = yield this.getCurrentUser();
|
|
5325
5342
|
if (n)
|
|
5326
5343
|
throw new Oe("Could not get current user: " + n.message);
|
|
@@ -5353,7 +5370,7 @@ class $u {
|
|
|
5353
5370
|
this.connectionStatusCbs.forEach((n) => n(e));
|
|
5354
5371
|
}
|
|
5355
5372
|
setCurrentUser(e) {
|
|
5356
|
-
return
|
|
5373
|
+
return D(this, void 0, void 0, function* () {
|
|
5357
5374
|
yield this._persister.setItem(Ot, e);
|
|
5358
5375
|
});
|
|
5359
5376
|
}
|
|
@@ -5361,13 +5378,13 @@ class $u {
|
|
|
5361
5378
|
return this._currentUserCached;
|
|
5362
5379
|
}
|
|
5363
5380
|
_getCurrentUser() {
|
|
5364
|
-
return
|
|
5381
|
+
return D(this, void 0, void 0, function* () {
|
|
5365
5382
|
const e = yield this._persister.getItem(Ot);
|
|
5366
5383
|
return typeof e == "string" ? JSON.parse(e) : e;
|
|
5367
5384
|
});
|
|
5368
5385
|
}
|
|
5369
5386
|
getCurrentUser() {
|
|
5370
|
-
return
|
|
5387
|
+
return D(this, void 0, void 0, function* () {
|
|
5371
5388
|
const e = yield this._waitForOAuthCallbackResponse();
|
|
5372
5389
|
if (e != null && e.error) {
|
|
5373
5390
|
const i = { error: e.error, user: void 0 };
|
|
@@ -5378,13 +5395,13 @@ class $u {
|
|
|
5378
5395
|
});
|
|
5379
5396
|
}
|
|
5380
5397
|
_hasCurrentUser() {
|
|
5381
|
-
return
|
|
5398
|
+
return D(this, void 0, void 0, function* () {
|
|
5382
5399
|
const e = yield this._persister.getItem(Ot);
|
|
5383
5400
|
return JSON.parse(e) != null;
|
|
5384
5401
|
});
|
|
5385
5402
|
}
|
|
5386
5403
|
changeCurrentUser(e) {
|
|
5387
|
-
return
|
|
5404
|
+
return D(this, void 0, void 0, function* () {
|
|
5388
5405
|
var n;
|
|
5389
5406
|
const { user: r } = yield this.getCurrentUser();
|
|
5390
5407
|
if (!Xe(r, e)) {
|
|
@@ -5411,7 +5428,7 @@ class $u {
|
|
|
5411
5428
|
});
|
|
5412
5429
|
}
|
|
5413
5430
|
signInWithMagicCode(e) {
|
|
5414
|
-
return
|
|
5431
|
+
return D(this, arguments, void 0, function* ({ email: n, code: r }) {
|
|
5415
5432
|
var i;
|
|
5416
5433
|
const s = yield this.getCurrentUser(), o = ((i = s == null ? void 0 : s.user) === null || i === void 0 ? void 0 : i.type) === "guest", u = yield Yo({
|
|
5417
5434
|
apiURI: this.config.apiURI,
|
|
@@ -5424,7 +5441,7 @@ class $u {
|
|
|
5424
5441
|
});
|
|
5425
5442
|
}
|
|
5426
5443
|
signInWithCustomToken(e) {
|
|
5427
|
-
return
|
|
5444
|
+
return D(this, void 0, void 0, function* () {
|
|
5428
5445
|
const n = yield Jo({
|
|
5429
5446
|
apiURI: this.config.apiURI,
|
|
5430
5447
|
appId: this.config.appId,
|
|
@@ -5434,7 +5451,7 @@ class $u {
|
|
|
5434
5451
|
});
|
|
5435
5452
|
}
|
|
5436
5453
|
signInAsGuest() {
|
|
5437
|
-
return
|
|
5454
|
+
return D(this, void 0, void 0, function* () {
|
|
5438
5455
|
const e = yield Zo({
|
|
5439
5456
|
apiURI: this.config.apiURI,
|
|
5440
5457
|
appId: this.config.appId
|
|
@@ -5461,7 +5478,7 @@ class $u {
|
|
|
5461
5478
|
});
|
|
5462
5479
|
}
|
|
5463
5480
|
signOut(e) {
|
|
5464
|
-
return
|
|
5481
|
+
return D(this, void 0, void 0, function* () {
|
|
5465
5482
|
const n = yield this.getCurrentUser();
|
|
5466
5483
|
this.potentiallyInvalidateToken(n, e), yield this.changeCurrentUser(null);
|
|
5467
5484
|
});
|
|
@@ -5484,7 +5501,7 @@ class $u {
|
|
|
5484
5501
|
* @param {string} [params.codeVerifier] - The code verifier used to generate the code challenge.
|
|
5485
5502
|
*/
|
|
5486
5503
|
exchangeCodeForToken(e) {
|
|
5487
|
-
return
|
|
5504
|
+
return D(this, arguments, void 0, function* ({ code: n, codeVerifier: r }) {
|
|
5488
5505
|
var i;
|
|
5489
5506
|
const s = yield this.getCurrentUser(), o = ((i = s == null ? void 0 : s.user) === null || i === void 0 ? void 0 : i.type) === "guest", u = yield Zn({
|
|
5490
5507
|
apiURI: this.config.apiURI,
|
|
@@ -5507,9 +5524,9 @@ class $u {
|
|
|
5507
5524
|
* @param {string | null | undefined} [params.nonce] - The nonce used when requesting the id_token from the external service
|
|
5508
5525
|
*/
|
|
5509
5526
|
signInWithIdToken(e) {
|
|
5510
|
-
return
|
|
5527
|
+
return D(this, arguments, void 0, function* ({ idToken: n, clientName: r, nonce: i }) {
|
|
5511
5528
|
var s;
|
|
5512
|
-
const o = yield this.getCurrentUser(), u = (s = o == null ? void 0 : o.user) === null || s === void 0 ? void 0 : s.refresh_token,
|
|
5529
|
+
const o = yield this.getCurrentUser(), u = (s = o == null ? void 0 : o.user) === null || s === void 0 ? void 0 : s.refresh_token, c = yield Xo({
|
|
5513
5530
|
apiURI: this.config.apiURI,
|
|
5514
5531
|
appId: this.config.appId,
|
|
5515
5532
|
idToken: n,
|
|
@@ -5517,7 +5534,7 @@ class $u {
|
|
|
5517
5534
|
nonce: i,
|
|
5518
5535
|
refreshToken: u
|
|
5519
5536
|
});
|
|
5520
|
-
return yield this.changeCurrentUser(
|
|
5537
|
+
return yield this.changeCurrentUser(c.user), c;
|
|
5521
5538
|
});
|
|
5522
5539
|
}
|
|
5523
5540
|
// --------
|
|
@@ -5588,8 +5605,8 @@ class $u {
|
|
|
5588
5605
|
r.initialPresence || r.initialData
|
|
5589
5606
|
), o = Object.assign(Object.assign({}, r), { roomId: n, cb: i, prev: null });
|
|
5590
5607
|
return this._presence[n] = this._presence[n] || {}, this._presence[n].handlers = this._presence[n].handlers || [], this._presence[n].handlers.push(o), this._notifyPresenceSub(n, o), () => {
|
|
5591
|
-
var u,
|
|
5592
|
-
this._presence[n].handlers = (d = (
|
|
5608
|
+
var u, c, d;
|
|
5609
|
+
this._presence[n].handlers = (d = (c = (u = this._presence[n]) === null || u === void 0 ? void 0 : u.handlers) === null || c === void 0 ? void 0 : c.filter((a) => a !== o)) !== null && d !== void 0 ? d : [], s();
|
|
5593
5610
|
};
|
|
5594
5611
|
}
|
|
5595
5612
|
_notifyPresenceSubs(e) {
|
|
@@ -5605,24 +5622,24 @@ class $u {
|
|
|
5605
5622
|
_patchPresencePeers(e, n) {
|
|
5606
5623
|
var r, i, s;
|
|
5607
5624
|
const o = ((i = (r = this._presence[e]) === null || r === void 0 ? void 0 : r.result) === null || i === void 0 ? void 0 : i.peers) || {};
|
|
5608
|
-
let u = Object.fromEntries(Object.entries(o).map(([d,
|
|
5625
|
+
let u = Object.fromEntries(Object.entries(o).map(([d, a]) => [d, { data: a }]));
|
|
5609
5626
|
(s = this._presence[e]) === null || s === void 0 || s.result;
|
|
5610
|
-
const
|
|
5611
|
-
for (let [
|
|
5627
|
+
const c = $t(u, (d) => {
|
|
5628
|
+
for (let [a, f, h] of n)
|
|
5612
5629
|
switch (f) {
|
|
5613
5630
|
case "+":
|
|
5614
|
-
Bi(d,
|
|
5631
|
+
Bi(d, a, h);
|
|
5615
5632
|
break;
|
|
5616
5633
|
case "r":
|
|
5617
|
-
Vn(d,
|
|
5634
|
+
Vn(d, a, h);
|
|
5618
5635
|
break;
|
|
5619
5636
|
case "-":
|
|
5620
|
-
Ar(d,
|
|
5637
|
+
Ar(d, a);
|
|
5621
5638
|
break;
|
|
5622
5639
|
}
|
|
5623
5640
|
delete d[this._sessionId];
|
|
5624
5641
|
});
|
|
5625
|
-
this._setPresencePeers(e,
|
|
5642
|
+
this._setPresencePeers(e, c);
|
|
5626
5643
|
}
|
|
5627
5644
|
_setPresencePeers(e, n) {
|
|
5628
5645
|
const r = Object.assign({}, n);
|
|
@@ -5663,22 +5680,22 @@ class $u {
|
|
|
5663
5680
|
_notifyBroadcastSubs(e, n, r) {
|
|
5664
5681
|
var i, s, o;
|
|
5665
5682
|
(o = (s = (i = this._broadcastSubs) === null || i === void 0 ? void 0 : i[e]) === null || s === void 0 ? void 0 : s[n]) === null || o === void 0 || o.forEach((u) => {
|
|
5666
|
-
var
|
|
5667
|
-
const
|
|
5668
|
-
return u(
|
|
5683
|
+
var c, d, a, f, h, p;
|
|
5684
|
+
const y = (c = r.data) === null || c === void 0 ? void 0 : c.data, g = r.data["peer-id"] === this._sessionId ? (a = (d = this._presence[e]) === null || d === void 0 ? void 0 : d.result) === null || a === void 0 ? void 0 : a.user : (p = (h = (f = this._presence[e]) === null || f === void 0 ? void 0 : f.result) === null || h === void 0 ? void 0 : h.peers) === null || p === void 0 ? void 0 : p[r.data["peer-id"]];
|
|
5685
|
+
return u(y, g);
|
|
5669
5686
|
});
|
|
5670
5687
|
}
|
|
5671
5688
|
// --------
|
|
5672
5689
|
// Storage
|
|
5673
5690
|
uploadFile(e, n, r) {
|
|
5674
|
-
return
|
|
5691
|
+
return D(this, void 0, void 0, function* () {
|
|
5675
5692
|
var i;
|
|
5676
5693
|
const s = yield this.getCurrentUser(), o = (i = s == null ? void 0 : s.user) === null || i === void 0 ? void 0 : i.refresh_token;
|
|
5677
5694
|
return tu(Object.assign(Object.assign({}, r), { apiURI: this.config.apiURI, appId: this.config.appId, path: e, file: n, refreshToken: o }));
|
|
5678
5695
|
});
|
|
5679
5696
|
}
|
|
5680
5697
|
deleteFile(e) {
|
|
5681
|
-
return
|
|
5698
|
+
return D(this, void 0, void 0, function* () {
|
|
5682
5699
|
var n;
|
|
5683
5700
|
const r = yield this.getCurrentUser(), i = (n = r == null ? void 0 : r.user) === null || n === void 0 ? void 0 : n.refresh_token;
|
|
5684
5701
|
return yield nu({
|
|
@@ -5692,7 +5709,7 @@ class $u {
|
|
|
5692
5709
|
// Deprecated Storage API (Jan 2025)
|
|
5693
5710
|
// ---------------------------------
|
|
5694
5711
|
upload(e, n) {
|
|
5695
|
-
return
|
|
5712
|
+
return D(this, void 0, void 0, function* () {
|
|
5696
5713
|
var r;
|
|
5697
5714
|
const i = yield this.getCurrentUser(), s = (r = i == null ? void 0 : i.user) === null || r === void 0 ? void 0 : r.refresh_token, o = e || n.name, u = yield ru({
|
|
5698
5715
|
apiURI: this.config.apiURI,
|
|
@@ -5704,7 +5721,7 @@ class $u {
|
|
|
5704
5721
|
});
|
|
5705
5722
|
}
|
|
5706
5723
|
getDownloadUrl(e) {
|
|
5707
|
-
return
|
|
5724
|
+
return D(this, void 0, void 0, function* () {
|
|
5708
5725
|
var n;
|
|
5709
5726
|
const r = yield this.getCurrentUser(), i = (n = r == null ? void 0 : r.user) === null || n === void 0 ? void 0 : n.refresh_token;
|
|
5710
5727
|
return yield su({
|
|
@@ -5717,31 +5734,31 @@ class $u {
|
|
|
5717
5734
|
}
|
|
5718
5735
|
}
|
|
5719
5736
|
let Ye;
|
|
5720
|
-
function
|
|
5737
|
+
function Du(t, e) {
|
|
5721
5738
|
Ye == null || Ye.dispose();
|
|
5722
|
-
const n = Vu(e), r = Lu(e, u), i = Uu(
|
|
5723
|
-
function s(
|
|
5739
|
+
const n = Vu(e), r = Lu(e, u), i = Uu(xu(t));
|
|
5740
|
+
function s(a) {
|
|
5724
5741
|
var f;
|
|
5725
|
-
|
|
5742
|
+
a.source === i.element.contentWindow && ((f = a.data) === null || f === void 0 ? void 0 : f.type) === "close" && n.isVisible() && u();
|
|
5726
5743
|
}
|
|
5727
|
-
function o(
|
|
5728
|
-
const f =
|
|
5744
|
+
function o(a) {
|
|
5745
|
+
const f = a.shiftKey && a.ctrlKey && a.key === "0", h = a.key === "Escape" || a.key === "Esc";
|
|
5729
5746
|
(f || h && n.isVisible()) && u();
|
|
5730
5747
|
}
|
|
5731
5748
|
function u() {
|
|
5732
5749
|
n.isVisible() ? n.element.style.display = "none" : (n.element.style.display = "block", n.element.contains(i.element) || n.element.appendChild(i.element));
|
|
5733
5750
|
}
|
|
5734
|
-
function
|
|
5751
|
+
function c() {
|
|
5735
5752
|
n.element.remove(), r.element.remove(), removeEventListener("keydown", o), removeEventListener("message", s);
|
|
5736
5753
|
}
|
|
5737
5754
|
function d() {
|
|
5738
5755
|
document.body.appendChild(n.element), document.body.appendChild(r.element), addEventListener("keydown", o), addEventListener("message", s), Ye = {
|
|
5739
|
-
dispose:
|
|
5756
|
+
dispose: c
|
|
5740
5757
|
};
|
|
5741
5758
|
}
|
|
5742
5759
|
return d();
|
|
5743
5760
|
}
|
|
5744
|
-
function
|
|
5761
|
+
function xu(t) {
|
|
5745
5762
|
return `${dn || Gr ? "http://localhost:3000" : "https://instantdb.com"}/_devtool?appId=${t}`;
|
|
5746
5763
|
}
|
|
5747
5764
|
function Uu(t) {
|
|
@@ -6024,7 +6041,7 @@ function Ju(t, e) {
|
|
|
6024
6041
|
if (typeof window > "u" || typeof window.location > "u" || typeof document > "u" || typeof e == "boolean" && !e)
|
|
6025
6042
|
return;
|
|
6026
6043
|
const n = Object.assign({ position: "bottom-right", allowedHosts: ["localhost"] }, typeof e == "object" ? e : {});
|
|
6027
|
-
n.allowedHosts.includes(window.location.hostname) &&
|
|
6044
|
+
n.allowedHosts.includes(window.location.hostname) && Du(t, n);
|
|
6028
6045
|
}
|
|
6029
6046
|
const Zu = {
|
|
6030
6047
|
isLoading: !0,
|
|
@@ -6046,16 +6063,16 @@ function Xu(t, e, n) {
|
|
|
6046
6063
|
const r = e ? Qu(e) : null, i = V(r), s = tt(
|
|
6047
6064
|
pr(t._reactor.getPreviousResult(r))
|
|
6048
6065
|
), o = ae(
|
|
6049
|
-
(
|
|
6066
|
+
(c) => (s.current = pr(
|
|
6050
6067
|
t._reactor.getPreviousResult(r)
|
|
6051
|
-
), r ? t.subscribeQuery(r, (
|
|
6068
|
+
), r ? t.subscribeQuery(r, (a) => {
|
|
6052
6069
|
s.current = {
|
|
6053
|
-
isLoading: !
|
|
6070
|
+
isLoading: !a,
|
|
6054
6071
|
data: void 0,
|
|
6055
6072
|
pageInfo: void 0,
|
|
6056
6073
|
error: void 0,
|
|
6057
|
-
...
|
|
6058
|
-
},
|
|
6074
|
+
...a
|
|
6075
|
+
}, c();
|
|
6059
6076
|
}) : () => {
|
|
6060
6077
|
}),
|
|
6061
6078
|
// Build a new subscribe function if the query changes
|
|
@@ -6105,7 +6122,7 @@ function ra(t, e) {
|
|
|
6105
6122
|
}
|
|
6106
6123
|
function ia(t, e = {}) {
|
|
6107
6124
|
var o, u;
|
|
6108
|
-
const [n, r] =
|
|
6125
|
+
const [n, r] = yr(() => t.core._reactor.getPresence(t.type, t.id, e) ?? {
|
|
6109
6126
|
peers: {},
|
|
6110
6127
|
isLoading: !0
|
|
6111
6128
|
});
|
|
@@ -6118,8 +6135,8 @@ function ia(t, e = {}) {
|
|
|
6118
6135
|
}
|
|
6119
6136
|
), [t.id, e.user, (o = e.peers) == null ? void 0 : o.join(), (u = e.keys) == null ? void 0 : u.join()]);
|
|
6120
6137
|
const i = ae(
|
|
6121
|
-
(
|
|
6122
|
-
t.core._reactor.publishPresence(t.type, t.id,
|
|
6138
|
+
(c) => {
|
|
6139
|
+
t.core._reactor.publishPresence(t.type, t.id, c);
|
|
6123
6140
|
},
|
|
6124
6141
|
[t.type, t.id]
|
|
6125
6142
|
);
|
|
@@ -6135,18 +6152,18 @@ function oa(t, e, n = {}) {
|
|
|
6135
6152
|
const r = ea(), i = fe.usePresence(t, {
|
|
6136
6153
|
keys: [e]
|
|
6137
6154
|
}), s = Ct(() => {
|
|
6138
|
-
const
|
|
6155
|
+
const a = t._core._reactor.getPresence(
|
|
6139
6156
|
t.type,
|
|
6140
6157
|
t.id
|
|
6141
6158
|
);
|
|
6142
|
-
return n != null && n.writeOnly ? [] : Object.values((
|
|
6159
|
+
return n != null && n.writeOnly ? [] : Object.values((a == null ? void 0 : a.peers) ?? {}).filter(
|
|
6143
6160
|
(f) => f[e] === !0
|
|
6144
6161
|
);
|
|
6145
6162
|
}, [n == null ? void 0 : n.writeOnly, i]), o = ae(
|
|
6146
|
-
(
|
|
6163
|
+
(a) => {
|
|
6147
6164
|
t.core._reactor.publishPresence(t.type, t.id, {
|
|
6148
|
-
[e]:
|
|
6149
|
-
}),
|
|
6165
|
+
[e]: a
|
|
6166
|
+
}), a && ((n == null ? void 0 : n.timeout) === null || (n == null ? void 0 : n.timeout) === 0 || r.set((n == null ? void 0 : n.timeout) ?? ta, () => {
|
|
6150
6167
|
t.core._reactor.publishPresence(t.type, t.id, {
|
|
6151
6168
|
[e]: null
|
|
6152
6169
|
});
|
|
@@ -6154,14 +6171,14 @@ function oa(t, e, n = {}) {
|
|
|
6154
6171
|
},
|
|
6155
6172
|
[t.type, t.id, e, n == null ? void 0 : n.timeout, r]
|
|
6156
6173
|
), u = ae(
|
|
6157
|
-
(
|
|
6158
|
-
const h = !((n == null ? void 0 : n.stopOnEnter) &&
|
|
6174
|
+
(a) => {
|
|
6175
|
+
const h = !((n == null ? void 0 : n.stopOnEnter) && a.key === "Enter");
|
|
6159
6176
|
o(h);
|
|
6160
6177
|
},
|
|
6161
6178
|
[n.stopOnEnter, o]
|
|
6162
|
-
),
|
|
6179
|
+
), c = ae(() => {
|
|
6163
6180
|
o(!1);
|
|
6164
|
-
}, [o]), d = Ct(() => ({ onKeyDown: u, onBlur:
|
|
6181
|
+
}, [o]), d = Ct(() => ({ onKeyDown: u, onBlur: c }), [u, c]);
|
|
6165
6182
|
return {
|
|
6166
6183
|
active: s,
|
|
6167
6184
|
setActive: o,
|
|
@@ -6190,7 +6207,7 @@ const aa = {
|
|
|
6190
6207
|
class da {
|
|
6191
6208
|
constructor(e, n) {
|
|
6192
6209
|
this.tx = cn(), this.getLocalId = (r) => this.core.getLocalId(r), this.useLocalId = (r) => {
|
|
6193
|
-
const [i, s] =
|
|
6210
|
+
const [i, s] = yr(null);
|
|
6194
6211
|
return pe(() => {
|
|
6195
6212
|
(async () => {
|
|
6196
6213
|
const u = await this.getLocalId(r);
|
|
@@ -6204,8 +6221,8 @@ class da {
|
|
|
6204
6221
|
).state, this.useAuth = () => {
|
|
6205
6222
|
const r = tt(
|
|
6206
6223
|
this.core._reactor._currentUserCached
|
|
6207
|
-
), i = ae((o) => this.core.subscribeAuth((
|
|
6208
|
-
r.current = { isLoading: !1, ...
|
|
6224
|
+
), i = ae((o) => this.core.subscribeAuth((c) => {
|
|
6225
|
+
r.current = { isLoading: !1, ...c }, o();
|
|
6209
6226
|
}), []);
|
|
6210
6227
|
return At(
|
|
6211
6228
|
i,
|
|
@@ -6222,8 +6239,8 @@ class da {
|
|
|
6222
6239
|
}, this.useConnectionStatus = () => {
|
|
6223
6240
|
const r = tt(
|
|
6224
6241
|
this.core._reactor.status
|
|
6225
|
-
), i = ae((o) => this.core.subscribeConnectionStatus((
|
|
6226
|
-
|
|
6242
|
+
), i = ae((o) => this.core.subscribeConnectionStatus((c) => {
|
|
6243
|
+
c !== r.current && (r.current = c, o());
|
|
6227
6244
|
}), []);
|
|
6228
6245
|
return At(
|
|
6229
6246
|
i,
|