@instantdb/react 1.0.40 → 1.0.41-branch-python-sdk-v1.26586025551.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 +587 -587
- package/dist/standalone/index.umd.cjs +11 -11
- package/package.json +4 -4
package/dist/standalone/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var p = (n, e, t) =>
|
|
4
|
-
import
|
|
1
|
+
var xi = Object.defineProperty;
|
|
2
|
+
var $i = (n, e, t) => e in n ? xi(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var p = (n, e, t) => $i(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import ps, { useRef as $e, useCallback as Me, useSyncExternalStore as Vt, useEffect as We, useMemo as Sn, useState as ys, createElement as Di } from "react";
|
|
5
5
|
function ce(n) {
|
|
6
6
|
const e = Ut(n);
|
|
7
7
|
let t = 3735928559 ^ e.length, r = 1103547991 ^ e.length;
|
|
@@ -77,7 +77,7 @@ const te = {
|
|
|
77
77
|
Remove: "remove",
|
|
78
78
|
Replace: "replace",
|
|
79
79
|
Add: "add"
|
|
80
|
-
},
|
|
80
|
+
}, bs = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), Ui = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), Lt = Symbol.iterator, we = {
|
|
81
81
|
mutable: "mutable",
|
|
82
82
|
immutable: "immutable"
|
|
83
83
|
}, Gn = {};
|
|
@@ -109,7 +109,7 @@ function qe(n) {
|
|
|
109
109
|
return !!D(n);
|
|
110
110
|
}
|
|
111
111
|
function D(n) {
|
|
112
|
-
return typeof n != "object" ? null : n == null ? void 0 : n[
|
|
112
|
+
return typeof n != "object" ? null : n == null ? void 0 : n[bs];
|
|
113
113
|
}
|
|
114
114
|
function Yn(n) {
|
|
115
115
|
var e;
|
|
@@ -122,7 +122,7 @@ function ke(n, e) {
|
|
|
122
122
|
let t;
|
|
123
123
|
return Object.getPrototypeOf(n) === Object.prototype || Array.isArray(n) || n instanceof Map || n instanceof Set || !!(e != null && e.mark) && ((t = e.mark(n, we)) === we.immutable || typeof t == "function");
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function gs(n, e = []) {
|
|
126
126
|
if (Object.hasOwnProperty.call(n, "key")) {
|
|
127
127
|
const t = n.parent.copy, r = D(je(t, n.key));
|
|
128
128
|
if (r !== null && (r == null ? void 0 : r.original) !== n.original)
|
|
@@ -133,10 +133,10 @@ function bs(n, e = []) {
|
|
|
133
133
|
e.push(i);
|
|
134
134
|
}
|
|
135
135
|
if (n.parent)
|
|
136
|
-
return
|
|
136
|
+
return gs(n.parent, e);
|
|
137
137
|
e.reverse();
|
|
138
138
|
try {
|
|
139
|
-
|
|
139
|
+
Li(n.copy, e);
|
|
140
140
|
} catch {
|
|
141
141
|
return null;
|
|
142
142
|
}
|
|
@@ -169,7 +169,7 @@ function Ne(n, e) {
|
|
|
169
169
|
return r.indexOf("/") === -1 && r.indexOf("~") === -1 ? r : r.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
170
170
|
}).join("/");
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function Li(n, e) {
|
|
173
173
|
for (let t = 0; t < e.length - 1; t += 1) {
|
|
174
174
|
const r = e[t];
|
|
175
175
|
if (n = je(ze(n) === 3 ? Array.from(n) : n, r), typeof n != "object")
|
|
@@ -177,7 +177,7 @@ function Ui(n, e) {
|
|
|
177
177
|
}
|
|
178
178
|
return n;
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function Fi(n) {
|
|
181
181
|
const e = Object.create(Object.getPrototypeOf(n));
|
|
182
182
|
return Reflect.ownKeys(n).forEach((t) => {
|
|
183
183
|
let r = Reflect.getOwnPropertyDescriptor(n, t);
|
|
@@ -193,8 +193,8 @@ function Li(n) {
|
|
|
193
193
|
}), Reflect.defineProperty(e, t, r);
|
|
194
194
|
}), e;
|
|
195
195
|
}
|
|
196
|
-
const
|
|
197
|
-
function
|
|
196
|
+
const Ni = Object.prototype.propertyIsEnumerable;
|
|
197
|
+
function _s(n, e) {
|
|
198
198
|
let t;
|
|
199
199
|
if (Array.isArray(n))
|
|
200
200
|
return Array.prototype.concat.call(n);
|
|
@@ -212,7 +212,7 @@ function gs(n, e) {
|
|
|
212
212
|
return new Map(n);
|
|
213
213
|
} else if (e != null && e.mark && (t = e.mark(n, we), t !== void 0) && t !== we.mutable) {
|
|
214
214
|
if (t === we.immutable)
|
|
215
|
-
return
|
|
215
|
+
return Fi(n);
|
|
216
216
|
if (typeof t == "function") {
|
|
217
217
|
if (e.enablePatches || e.enableAutoFreeze)
|
|
218
218
|
throw new Error("You can't use mark and patches or auto freeze together.");
|
|
@@ -224,13 +224,13 @@ function gs(n, e) {
|
|
|
224
224
|
return Object.keys(n).forEach((s) => {
|
|
225
225
|
r[s] = n[s];
|
|
226
226
|
}), Object.getOwnPropertySymbols(n).forEach((s) => {
|
|
227
|
-
|
|
227
|
+
Ni.call(n, s) && (r[s] = n[s]);
|
|
228
228
|
}), r;
|
|
229
229
|
} else
|
|
230
230
|
throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
|
|
231
231
|
}
|
|
232
232
|
function de(n) {
|
|
233
|
-
n.copy || (n.copy =
|
|
233
|
+
n.copy || (n.copy = _s(n.original, n.options));
|
|
234
234
|
}
|
|
235
235
|
function ht(n) {
|
|
236
236
|
if (!ke(n))
|
|
@@ -330,7 +330,7 @@ function Zn(n, e) {
|
|
|
330
330
|
} else
|
|
331
331
|
n.forEach((r, s) => e(s, r, n));
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function ms(n, e, t) {
|
|
334
334
|
if (qe(n) || !ke(n, t) || e.has(n) || Object.isFrozen(n))
|
|
335
335
|
return;
|
|
336
336
|
const r = n instanceof Set, s = r ? /* @__PURE__ */ new Map() : void 0;
|
|
@@ -342,7 +342,7 @@ function _s(n, e, t) {
|
|
|
342
342
|
const u = !((a = c.assignedMap) === null || a === void 0) && a.size || c.operated ? c.copy : c.original;
|
|
343
343
|
Ot(r ? s : n, i, u);
|
|
344
344
|
} else
|
|
345
|
-
|
|
345
|
+
ms(o, e, t);
|
|
346
346
|
}), s) {
|
|
347
347
|
const i = n, o = Array.from(i);
|
|
348
348
|
i.clear(), o.forEach((a) => {
|
|
@@ -350,9 +350,9 @@ function _s(n, e, t) {
|
|
|
350
350
|
});
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function Ki(n, e) {
|
|
354
354
|
const t = n.type === 3 ? n.setMap : n.copy;
|
|
355
|
-
n.finalities.revoke.length > 1 && n.assignedMap.get(e) && t &&
|
|
355
|
+
n.finalities.revoke.length > 1 && n.assignedMap.get(e) && t && ms(je(t, e), n.finalities.handledSet, n.options);
|
|
356
356
|
}
|
|
357
357
|
function vn(n) {
|
|
358
358
|
n.type === 3 && n.copy && (n.copy.clear(), n.setMap.forEach((e) => {
|
|
@@ -362,7 +362,7 @@ function vn(n) {
|
|
|
362
362
|
function En(n, e, t, r) {
|
|
363
363
|
if (n.operated && n.assignedMap && n.assignedMap.size > 0 && !n.finalized) {
|
|
364
364
|
if (t && r) {
|
|
365
|
-
const i =
|
|
365
|
+
const i = gs(n);
|
|
366
366
|
i && e(n, i, t, r);
|
|
367
367
|
}
|
|
368
368
|
n.finalized = !0;
|
|
@@ -379,10 +379,10 @@ function Xn(n, e, t, r) {
|
|
|
379
379
|
}
|
|
380
380
|
}), n.options.enableAutoFreeze && s.finalities !== n.finalities && (n.options.enableAutoFreeze = !1)), ke(t, n.options) && n.finalities.draft.push(() => {
|
|
381
381
|
const i = n.type === 3 ? n.setMap : n.copy;
|
|
382
|
-
Re(je(i, e), t) &&
|
|
382
|
+
Re(je(i, e), t) && Ki(n, e);
|
|
383
383
|
});
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function Wi(n, e, t, r, s) {
|
|
386
386
|
let { original: i, assignedMap: o, options: a } = n, c = n.copy;
|
|
387
387
|
c.length < i.length && ([i, c] = [c, i], [t, r] = [r, t]);
|
|
388
388
|
for (let u = 0; u < i.length; u += 1)
|
|
@@ -428,7 +428,7 @@ function Ki(n, e, t, r, s) {
|
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function qi({ original: n, copy: e, assignedMap: t }, r, s, i, o) {
|
|
432
432
|
t.forEach((a, c) => {
|
|
433
433
|
const u = je(n, c), l = Ft(je(e, c)), f = a ? wt(n, c) ? te.Replace : te.Add : te.Remove;
|
|
434
434
|
if (Re(u, l) && f === te.Replace)
|
|
@@ -437,7 +437,7 @@ function Wi({ original: n, copy: e, assignedMap: t }, r, s, i, o) {
|
|
|
437
437
|
s.push(f === te.Remove ? { op: f, path: y } : { op: f, path: y, value: l }), i.push(f === te.Add ? { op: te.Remove, path: y } : f === te.Remove ? { op: te.Add, path: y, value: u } : { op: te.Replace, path: y, value: u });
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function zi({ original: n, copy: e }, t, r, s, i) {
|
|
441
441
|
let o = 0;
|
|
442
442
|
n.forEach((a) => {
|
|
443
443
|
if (!e.has(a)) {
|
|
@@ -474,11 +474,11 @@ function Et(n, e, t, r) {
|
|
|
474
474
|
switch (n.type) {
|
|
475
475
|
case 0:
|
|
476
476
|
case 2:
|
|
477
|
-
return
|
|
477
|
+
return qi(n, e, t, r, s);
|
|
478
478
|
case 1:
|
|
479
|
-
return
|
|
479
|
+
return Wi(n, e, t, r, s);
|
|
480
480
|
case 3:
|
|
481
|
-
return
|
|
481
|
+
return zi(n, e, t, r, s);
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
const Qt = (n, e, t = !1) => {
|
|
@@ -565,7 +565,7 @@ const Qt = (n, e, t = !1) => {
|
|
|
565
565
|
[Lt]() {
|
|
566
566
|
return this.entries();
|
|
567
567
|
}
|
|
568
|
-
},
|
|
568
|
+
}, Vi = Reflect.ownKeys(On), kr = (n, e, { isValuesIterator: t }) => () => {
|
|
569
569
|
var r, s;
|
|
570
570
|
const i = e.next();
|
|
571
571
|
if (i.done)
|
|
@@ -676,13 +676,13 @@ Set.prototype.difference && Object.assign(Bt, {
|
|
|
676
676
|
return Set.prototype.isDisjointFrom.call(new Set(this.values()), n);
|
|
677
677
|
}
|
|
678
678
|
});
|
|
679
|
-
const
|
|
679
|
+
const Qi = Reflect.ownKeys(Bt), ws = /* @__PURE__ */ new WeakSet(), Ss = {
|
|
680
680
|
get(n, e, t) {
|
|
681
681
|
var r, s;
|
|
682
682
|
const i = (r = n.copy) === null || r === void 0 ? void 0 : r[e];
|
|
683
|
-
if (i &&
|
|
683
|
+
if (i && ws.has(i))
|
|
684
684
|
return i;
|
|
685
|
-
if (e ===
|
|
685
|
+
if (e === bs)
|
|
686
686
|
return n;
|
|
687
687
|
let o;
|
|
688
688
|
if (n.options.mark) {
|
|
@@ -691,14 +691,14 @@ const Vi = Reflect.ownKeys(Bt), ms = /* @__PURE__ */ new WeakSet(), ws = {
|
|
|
691
691
|
return n.options.strict && Qt(u, n.options, !0), u;
|
|
692
692
|
}
|
|
693
693
|
const a = me(n);
|
|
694
|
-
if (a instanceof Map &&
|
|
694
|
+
if (a instanceof Map && Vi.includes(e)) {
|
|
695
695
|
if (e === "size")
|
|
696
696
|
return Object.getOwnPropertyDescriptor(On, "size").get.call(n.proxy);
|
|
697
697
|
const u = On[e];
|
|
698
698
|
if (u)
|
|
699
699
|
return u.bind(n.proxy);
|
|
700
700
|
}
|
|
701
|
-
if (a instanceof Set &&
|
|
701
|
+
if (a instanceof Set && Qi.includes(e)) {
|
|
702
702
|
if (e === "size")
|
|
703
703
|
return Object.getOwnPropertyDescriptor(Bt, "size").get.call(n.proxy);
|
|
704
704
|
const u = Bt[e];
|
|
@@ -769,7 +769,7 @@ const Vi = Reflect.ownKeys(Bt), ms = /* @__PURE__ */ new WeakSet(), ws = {
|
|
|
769
769
|
},
|
|
770
770
|
deleteProperty(n, e) {
|
|
771
771
|
var t;
|
|
772
|
-
return n.type === 1 ?
|
|
772
|
+
return n.type === 1 ? Ss.set.call(this, n, e, void 0, n.proxy) : (fn(n.original, e) !== void 0 || e in n.original ? (de(n), Ie(n), n.assignedMap.set(e, !1)) : (n.assignedMap = (t = n.assignedMap) !== null && t !== void 0 ? t : /* @__PURE__ */ new Map(), n.assignedMap.delete(e)), n.copy && delete n.copy[e], !0);
|
|
773
773
|
}
|
|
774
774
|
};
|
|
775
775
|
function er(n) {
|
|
@@ -786,8 +786,8 @@ function er(n) {
|
|
|
786
786
|
setMap: o === 3 ? new Map(e.entries()) : void 0
|
|
787
787
|
};
|
|
788
788
|
(r || "key" in n) && (a.key = r);
|
|
789
|
-
const { proxy: c, revoke: u } = Proxy.revocable(o === 1 ? Object.assign([], a) : a,
|
|
790
|
-
if (s.revoke.push(u),
|
|
789
|
+
const { proxy: c, revoke: u } = Proxy.revocable(o === 1 ? Object.assign([], a) : a, Ss);
|
|
790
|
+
if (s.revoke.push(u), ws.add(c), a.proxy = c, t) {
|
|
791
791
|
const l = t;
|
|
792
792
|
l.finalities.draft.push((f, d) => {
|
|
793
793
|
var y, b;
|
|
@@ -811,7 +811,7 @@ function er(n) {
|
|
|
811
811
|
return c;
|
|
812
812
|
}
|
|
813
813
|
Gn.createDraft = er;
|
|
814
|
-
function
|
|
814
|
+
function Bi(n, e, t, r, s) {
|
|
815
815
|
var i;
|
|
816
816
|
const o = D(n), a = (i = o == null ? void 0 : o.original) !== null && i !== void 0 ? i : n, c = !!e.length;
|
|
817
817
|
if (o != null && o.operated)
|
|
@@ -824,7 +824,7 @@ function Qi(n, e, t, r, s) {
|
|
|
824
824
|
r && c ? [{ op: te.Replace, path: [], value: a }] : r
|
|
825
825
|
];
|
|
826
826
|
}
|
|
827
|
-
function
|
|
827
|
+
function Gi(n, e) {
|
|
828
828
|
var t;
|
|
829
829
|
const r = {
|
|
830
830
|
draft: [],
|
|
@@ -842,7 +842,7 @@ function Bi(n, e) {
|
|
|
842
842
|
return [
|
|
843
843
|
a,
|
|
844
844
|
(c = []) => {
|
|
845
|
-
const [u, l, f] =
|
|
845
|
+
const [u, l, f] = Bi(a, c, s, i, e.enableAutoFreeze);
|
|
846
846
|
return e.enablePatches ? [u, l, f] : u;
|
|
847
847
|
}
|
|
848
848
|
];
|
|
@@ -862,7 +862,7 @@ function kn(n) {
|
|
|
862
862
|
} else typeof o == "object" && o !== null && (n.value = o, n.isRoot = !1, kn(n));
|
|
863
863
|
}), s && (n.isContainDraft || console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."), r && console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."));
|
|
864
864
|
}
|
|
865
|
-
function
|
|
865
|
+
function Ts(n) {
|
|
866
866
|
var e;
|
|
867
867
|
const t = D(n);
|
|
868
868
|
if (!ke(n, t == null ? void 0 : t.options))
|
|
@@ -872,7 +872,7 @@ function Ss(n) {
|
|
|
872
872
|
return t.original;
|
|
873
873
|
let s;
|
|
874
874
|
function i() {
|
|
875
|
-
s = r === 2 ? Jn(n) ? new Map(n) : new (Object.getPrototypeOf(n)).constructor(n) : r === 3 ? Array.from(t.setMap.values()) :
|
|
875
|
+
s = r === 2 ? Jn(n) ? new Map(n) : new (Object.getPrototypeOf(n)).constructor(n) : r === 3 ? Array.from(t.setMap.values()) : _s(n, t == null ? void 0 : t.options);
|
|
876
876
|
}
|
|
877
877
|
if (t) {
|
|
878
878
|
t.finalized = !0;
|
|
@@ -886,7 +886,7 @@ function Ss(n) {
|
|
|
886
886
|
if (Zn(s, (o, a) => {
|
|
887
887
|
if (t && Re(je(t.original, o), a))
|
|
888
888
|
return;
|
|
889
|
-
const c =
|
|
889
|
+
const c = Ts(a);
|
|
890
890
|
c !== a && (s === n && i(), Ot(s, o, c));
|
|
891
891
|
}), r === 3) {
|
|
892
892
|
const o = (e = t == null ? void 0 : t.original) !== null && e !== void 0 ? e : s;
|
|
@@ -897,9 +897,9 @@ function Ss(n) {
|
|
|
897
897
|
function Ar(n) {
|
|
898
898
|
if (!qe(n))
|
|
899
899
|
throw new Error(`current() is only used for Draft, parameter: ${n}`);
|
|
900
|
-
return
|
|
900
|
+
return Ts(n);
|
|
901
901
|
}
|
|
902
|
-
const
|
|
902
|
+
const Hi = (n) => function e(t, r, s) {
|
|
903
903
|
var i, o, a;
|
|
904
904
|
if (typeof t == "function" && typeof r != "function")
|
|
905
905
|
return function(v, ...U) {
|
|
@@ -926,7 +926,7 @@ const Gi = (n) => function e(t, r, s) {
|
|
|
926
926
|
};
|
|
927
927
|
if (!ke(f, m) && typeof f == "object" && f !== null)
|
|
928
928
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
929
|
-
const [T, _] =
|
|
929
|
+
const [T, _] = Gi(f, m);
|
|
930
930
|
if (typeof r != "function") {
|
|
931
931
|
if (!ke(f, m))
|
|
932
932
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
@@ -943,7 +943,7 @@ const Gi = (n) => function e(t, r, s) {
|
|
|
943
943
|
if (!qe(v)) {
|
|
944
944
|
if (v !== void 0 && !Re(v, T) && (U != null && U.operated))
|
|
945
945
|
throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
|
|
946
|
-
const P = v == null ? void 0 : v[
|
|
946
|
+
const P = v == null ? void 0 : v[Ui];
|
|
947
947
|
if (P) {
|
|
948
948
|
const H = P[0];
|
|
949
949
|
return m.strict && typeof v == "object" && v !== null && kn({
|
|
@@ -968,9 +968,9 @@ const Gi = (n) => function e(t, r, s) {
|
|
|
968
968
|
return w instanceof Promise ? w.then(C, (v) => {
|
|
969
969
|
throw Tn(D(T)), v;
|
|
970
970
|
}) : C(w);
|
|
971
|
-
}, Gt =
|
|
971
|
+
}, Gt = Hi();
|
|
972
972
|
Object.prototype.constructor.toString();
|
|
973
|
-
function
|
|
973
|
+
function vs(n, e) {
|
|
974
974
|
const t = Object.keys(n), r = Object.keys(e);
|
|
975
975
|
return t.length === r.length && Object.keys(n).every((s) => e.hasOwnProperty(s));
|
|
976
976
|
}
|
|
@@ -978,7 +978,7 @@ function Cr(n, e) {
|
|
|
978
978
|
return Object.keys(n).length === Object.keys(e).length && Object.keys(n).every((t) => e.hasOwnProperty(t) && n[t] === e[t]);
|
|
979
979
|
}
|
|
980
980
|
function Nt(n, e) {
|
|
981
|
-
return typeof n != "object" || typeof e != "object" || n === null || e === null ? n === e :
|
|
981
|
+
return typeof n != "object" || typeof e != "object" || n === null || e === null ? n === e : vs(n, e) ? Object.keys(n).every((t) => Nt(n[t], e[t])) : !1;
|
|
982
982
|
}
|
|
983
983
|
function tr(n) {
|
|
984
984
|
if (!pt(n))
|
|
@@ -988,7 +988,7 @@ function tr(n) {
|
|
|
988
988
|
r !== void 0 && (e[t] = r);
|
|
989
989
|
return e;
|
|
990
990
|
}
|
|
991
|
-
function
|
|
991
|
+
function Es(n, e) {
|
|
992
992
|
if (!pt(n) || !pt(e))
|
|
993
993
|
return e;
|
|
994
994
|
const t = { ...n };
|
|
@@ -1000,14 +1000,14 @@ function vs(n, e) {
|
|
|
1000
1000
|
continue;
|
|
1001
1001
|
}
|
|
1002
1002
|
const s = pt(n[r]) && pt(e[r]);
|
|
1003
|
-
t[r] = s ?
|
|
1003
|
+
t[r] = s ? Es(n[r], e[r]) : e[r];
|
|
1004
1004
|
}
|
|
1005
1005
|
return t;
|
|
1006
1006
|
}
|
|
1007
1007
|
function pt(n) {
|
|
1008
1008
|
return typeof n == "object" && n !== null && !Array.isArray(n);
|
|
1009
1009
|
}
|
|
1010
|
-
function
|
|
1010
|
+
function Ji(n, e, t) {
|
|
1011
1011
|
if (!n || e.length === 0)
|
|
1012
1012
|
return;
|
|
1013
1013
|
let r = n || {};
|
|
@@ -1028,7 +1028,7 @@ function Ir(n, e, t) {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
r[e[e.length - 1]] = t;
|
|
1030
1030
|
}
|
|
1031
|
-
function
|
|
1031
|
+
function Os(n, e) {
|
|
1032
1032
|
if (!n || e.length === 0)
|
|
1033
1033
|
return;
|
|
1034
1034
|
const [t, ...r] = e;
|
|
@@ -1037,13 +1037,13 @@ function Es(n, e) {
|
|
|
1037
1037
|
Array.isArray(n) ? n.splice(t, 1) : delete n[t];
|
|
1038
1038
|
return;
|
|
1039
1039
|
}
|
|
1040
|
-
|
|
1040
|
+
Os(n[t], r), Yi(n[t]) && delete n[t];
|
|
1041
1041
|
}
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1043
|
+
function Yi(n) {
|
|
1044
1044
|
return n && Object.keys(n).length === 0;
|
|
1045
1045
|
}
|
|
1046
|
-
const Pr = /ZULU|YEKT|YEKST|YAPT|YAKT|YAKST|XJT|WGT|WGST|WFT|WETDST|WET|WDT|WAT|WAST|WAKT|WADT|VUT|VOLT|VLAT|VLAST|VET|UZT|UZST|UYT|UYST|UTC|UT|ULAT|ULAST|UCT|TVT|TRUT|TOT|TMT|TKT|TJT|TFT|TAHT|SGT|SCT|SAST|SADT|RET|PYT|PYST|PWT|PST|PONT|PMST|PMDT|PKT|PKST|PHT|PGT|PETT|PETST|PET|PDT|OMST|OMSST|NZT|NZST|NZDT|NUT|NST|NPT|NOVT|NOVST|NFT|NDT|MYT|MVT|MUT|MUST|MST|MSK|MSD|MPT|MMT|MHT|MEZ|METDST|MET|MESZ|MEST|MDT|MAWT|MART|MAGT|MAGST|LKT|LINT|LIGT|LHST|LHDT|KST|KRAT|KRAST|KOST|KGT|KGST|KDT|JST|JAYT|IST|IRT|IRKT|IRKST|IOT|IDT|ICT|HST|HKT|GYT|GMT|GILT|GFT|GET|GEST|GAMT|GALT|FNT|FNST|FKT|FKST|FJT|FJST|FET|EST|EGT|EGST|EETDST|EET|EEST|EDT|EAT|EAST|EASST|DDUT|DAVT|CXT|CST|COT|CLT|CLST|CKT|CHUT|CHAST|CHADT|CETDST|CET|CEST|CDT|CCT|CAST|CADT|BTT|BST|BRT|BRST|BRA|BOT|BORT|BNT|BDT|BDST|AZT|AZST|AZOT|AZOST|AWST|AWSST|AST|ART|ARST|ANAT|ANAST|AMT|AMST|ALMT|ALMST|AKST|AKDT|AFT|AEST|AESST|AEDT|ADT|ACWST|ACT|ACST|ACSST|ACDT$/,
|
|
1046
|
+
const Pr = /ZULU|YEKT|YEKST|YAPT|YAKT|YAKST|XJT|WGT|WGST|WFT|WETDST|WET|WDT|WAT|WAST|WAKT|WADT|VUT|VOLT|VLAT|VLAST|VET|UZT|UZST|UYT|UYST|UTC|UT|ULAT|ULAST|UCT|TVT|TRUT|TOT|TMT|TKT|TJT|TFT|TAHT|SGT|SCT|SAST|SADT|RET|PYT|PYST|PWT|PST|PONT|PMST|PMDT|PKT|PKST|PHT|PGT|PETT|PETST|PET|PDT|OMST|OMSST|NZT|NZST|NZDT|NUT|NST|NPT|NOVT|NOVST|NFT|NDT|MYT|MVT|MUT|MUST|MST|MSK|MSD|MPT|MMT|MHT|MEZ|METDST|MET|MESZ|MEST|MDT|MAWT|MART|MAGT|MAGST|LKT|LINT|LIGT|LHST|LHDT|KST|KRAT|KRAST|KOST|KGT|KGST|KDT|JST|JAYT|IST|IRT|IRKT|IRKST|IOT|IDT|ICT|HST|HKT|GYT|GMT|GILT|GFT|GET|GEST|GAMT|GALT|FNT|FNST|FKT|FKST|FJT|FJST|FET|EST|EGT|EGST|EETDST|EET|EEST|EDT|EAT|EAST|EASST|DDUT|DAVT|CXT|CST|COT|CLT|CLST|CKT|CHUT|CHAST|CHADT|CETDST|CET|CEST|CDT|CCT|CAST|CADT|BTT|BST|BRT|BRST|BRA|BOT|BORT|BNT|BDT|BDST|AZT|AZST|AZOT|AZOST|AWST|AWSST|AST|ART|ARST|ANAT|ANAST|AMT|AMST|ALMT|ALMST|AKST|AKDT|AFT|AEST|AESST|AEDT|ADT|ACWST|ACT|ACST|ACSST|ACDT$/, Zi = {
|
|
1047
1047
|
ZULU: 0,
|
|
1048
1048
|
YEKT: 18e3,
|
|
1049
1049
|
YEKST: 21600,
|
|
@@ -1239,39 +1239,39 @@ const Pr = /ZULU|YEKT|YEKST|YAPT|YAKT|YAKST|XJT|WGT|WGST|WFT|WETDST|WET|WDT|WAT|
|
|
|
1239
1239
|
ACSST: 37800,
|
|
1240
1240
|
ACDT: 37800
|
|
1241
1241
|
};
|
|
1242
|
-
function
|
|
1242
|
+
function Xi(n) {
|
|
1243
1243
|
return new Date(n);
|
|
1244
1244
|
}
|
|
1245
|
-
function
|
|
1245
|
+
function eo(n) {
|
|
1246
1246
|
return /* @__PURE__ */ new Date(n + "Z");
|
|
1247
1247
|
}
|
|
1248
|
-
const
|
|
1249
|
-
function
|
|
1250
|
-
const e = n.match(
|
|
1248
|
+
const to = /^(\d+)[\./-](\d+)[\./-](\d+)$/;
|
|
1249
|
+
function no(n) {
|
|
1250
|
+
const e = n.match(to);
|
|
1251
1251
|
if (!e)
|
|
1252
1252
|
return null;
|
|
1253
1253
|
const [t, r, s, i] = e;
|
|
1254
1254
|
return r <= 0 || s <= 0 || i <= 0 ? null : r > 999 ? new Date(Date.UTC(r, s - 1, i, 0, 0, 0, 0)) : new Date(Date.UTC(i, r - 1, s, 0, 0, 0, 0));
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1256
|
+
function ro(n) {
|
|
1257
1257
|
const [e, t] = n.split(" ");
|
|
1258
1258
|
return /* @__PURE__ */ new Date(e + "T" + t + "Z");
|
|
1259
1259
|
}
|
|
1260
|
-
function
|
|
1260
|
+
function so(n) {
|
|
1261
1261
|
const [e, t] = n.split(" ");
|
|
1262
1262
|
return /* @__PURE__ */ new Date(e + "T" + t + "Z");
|
|
1263
1263
|
}
|
|
1264
|
-
function
|
|
1264
|
+
function io(n) {
|
|
1265
1265
|
return new Date(n);
|
|
1266
1266
|
}
|
|
1267
|
-
function
|
|
1267
|
+
function oo(n) {
|
|
1268
1268
|
const e = /^(\w{3}) (\w{3}) (\d{2}) (\d{4})$/;
|
|
1269
1269
|
if (!n.match(e))
|
|
1270
1270
|
throw new Error(`Unable to parse \`${n}\` as a date.`);
|
|
1271
1271
|
const r = /* @__PURE__ */ new Date(n + " UTC");
|
|
1272
1272
|
return new Date(Date.UTC(r.getUTCFullYear(), r.getUTCMonth(), r.getUTCDate(), 0, 0, 0, 0));
|
|
1273
1273
|
}
|
|
1274
|
-
function
|
|
1274
|
+
function ao(n) {
|
|
1275
1275
|
const e = /^(.+T.+)([+-])(\d{2})$/, t = n.match(e);
|
|
1276
1276
|
if (t) {
|
|
1277
1277
|
const [, r, s, i] = t, o = `${r}${s}${i}:00`;
|
|
@@ -1279,7 +1279,7 @@ function oo(n) {
|
|
|
1279
1279
|
}
|
|
1280
1280
|
return null;
|
|
1281
1281
|
}
|
|
1282
|
-
function
|
|
1282
|
+
function co(n) {
|
|
1283
1283
|
const e = /^(\d+)-(\d{1,2})-(\d{1,2})([ T])(\d{1,2})(?::(\d{1,2}))?(?::(\d{1,2}))?(.*)$/, t = n.match(e);
|
|
1284
1284
|
if (t) {
|
|
1285
1285
|
const [, r, s, i, o, a, c, u, l] = t, f = s.padStart(2, "0"), d = i.padStart(2, "0");
|
|
@@ -1290,14 +1290,14 @@ function ao(n) {
|
|
|
1290
1290
|
}
|
|
1291
1291
|
return null;
|
|
1292
1292
|
}
|
|
1293
|
-
function
|
|
1293
|
+
function uo(n) {
|
|
1294
1294
|
const [e, t] = n.split(", "), [r, s, i] = e.split("/").map(Number), o = t.match(/(\d{1,2}):(\d{2}):(\d{2}) (AM|PM)/);
|
|
1295
1295
|
if (!o)
|
|
1296
1296
|
throw new Error(`Unable to parse time from: ${n}`);
|
|
1297
1297
|
let [, a, c, u, l] = o;
|
|
1298
1298
|
return a = Number(a), c = Number(c), u = Number(u), l === "PM" && a !== 12 ? a += 12 : l === "AM" && a === 12 && (a = 0), new Date(Date.UTC(i, r - 1, s, a, c, u));
|
|
1299
1299
|
}
|
|
1300
|
-
function
|
|
1300
|
+
function lo(n) {
|
|
1301
1301
|
switch (n) {
|
|
1302
1302
|
case "epoch":
|
|
1303
1303
|
return /* @__PURE__ */ new Date(0);
|
|
@@ -1309,28 +1309,28 @@ function uo(n) {
|
|
|
1309
1309
|
return null;
|
|
1310
1310
|
}
|
|
1311
1311
|
}
|
|
1312
|
-
function
|
|
1312
|
+
function fo(n) {
|
|
1313
1313
|
const e = n.match(Pr);
|
|
1314
1314
|
if (!e)
|
|
1315
1315
|
return null;
|
|
1316
|
-
const [t] = e, r =
|
|
1316
|
+
const [t] = e, r = Zi[t], s = new Date(n.replace(Pr, "Z"));
|
|
1317
1317
|
return new Date(s.getTime() - r * 1e3);
|
|
1318
1318
|
}
|
|
1319
|
-
const
|
|
1320
|
-
to,
|
|
1321
|
-
ro,
|
|
1322
|
-
io,
|
|
1323
|
-
co,
|
|
1324
|
-
Xi,
|
|
1325
|
-
oo,
|
|
1319
|
+
const ho = [
|
|
1326
1320
|
no,
|
|
1327
|
-
|
|
1321
|
+
so,
|
|
1322
|
+
oo,
|
|
1328
1323
|
uo,
|
|
1329
|
-
|
|
1324
|
+
eo,
|
|
1330
1325
|
ao,
|
|
1331
|
-
|
|
1326
|
+
ro,
|
|
1327
|
+
Xi,
|
|
1328
|
+
lo,
|
|
1329
|
+
fo,
|
|
1330
|
+
co,
|
|
1331
|
+
io
|
|
1332
1332
|
];
|
|
1333
|
-
function
|
|
1333
|
+
function po(n, e) {
|
|
1334
1334
|
try {
|
|
1335
1335
|
const t = n(e);
|
|
1336
1336
|
return t instanceof Date && !isNaN(t.getTime()) ? t : null;
|
|
@@ -1339,14 +1339,14 @@ function ho(n, e) {
|
|
|
1339
1339
|
}
|
|
1340
1340
|
}
|
|
1341
1341
|
function An(n) {
|
|
1342
|
-
for (const e of
|
|
1343
|
-
const t =
|
|
1342
|
+
for (const e of ho) {
|
|
1343
|
+
const t = po(e, n);
|
|
1344
1344
|
if (t)
|
|
1345
1345
|
return t;
|
|
1346
1346
|
}
|
|
1347
1347
|
return null;
|
|
1348
1348
|
}
|
|
1349
|
-
function
|
|
1349
|
+
function yo(n) {
|
|
1350
1350
|
try {
|
|
1351
1351
|
const e = JSON.parse(n);
|
|
1352
1352
|
return typeof e == "string" ? An(e) : null;
|
|
@@ -1361,7 +1361,7 @@ function Zt(n) {
|
|
|
1361
1361
|
if (n instanceof Date)
|
|
1362
1362
|
return n;
|
|
1363
1363
|
if (typeof n == "string") {
|
|
1364
|
-
const e = An(n) ||
|
|
1364
|
+
const e = An(n) || yo(n) || An(n.trim());
|
|
1365
1365
|
if (!e)
|
|
1366
1366
|
throw new Error(`Unable to parse \`${n}\` as a date.`);
|
|
1367
1367
|
return e;
|
|
@@ -1445,7 +1445,7 @@ class Ke {
|
|
|
1445
1445
|
return { attrs: this.attrs, linkIndex: this.linkIndex };
|
|
1446
1446
|
}
|
|
1447
1447
|
}
|
|
1448
|
-
function
|
|
1448
|
+
function bo(n) {
|
|
1449
1449
|
return n.cardinality === "one";
|
|
1450
1450
|
}
|
|
1451
1451
|
function nr(n) {
|
|
@@ -1477,7 +1477,7 @@ function be(n, e, t) {
|
|
|
1477
1477
|
}
|
|
1478
1478
|
s > -1 && r.set(e[s], t);
|
|
1479
1479
|
}
|
|
1480
|
-
function
|
|
1480
|
+
function ks(n, e, t) {
|
|
1481
1481
|
const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
1482
1482
|
for (const o of e) {
|
|
1483
1483
|
let [a, c, u] = o;
|
|
@@ -1490,7 +1490,7 @@ function Os(n, e, t) {
|
|
|
1490
1490
|
}
|
|
1491
1491
|
return { eav: r, aev: s, vae: i };
|
|
1492
1492
|
}
|
|
1493
|
-
function
|
|
1493
|
+
function As(n) {
|
|
1494
1494
|
return {
|
|
1495
1495
|
triples: ge(n.eav, 3),
|
|
1496
1496
|
cardinalityInference: n.cardinalityInference,
|
|
@@ -1498,20 +1498,20 @@ function ks(n) {
|
|
|
1498
1498
|
version: 1
|
|
1499
1499
|
};
|
|
1500
1500
|
}
|
|
1501
|
-
function
|
|
1501
|
+
function Cs(n, e) {
|
|
1502
1502
|
return yt(n, e.triples, e.cardinalityInference, e.useDateObjects);
|
|
1503
1503
|
}
|
|
1504
|
-
function
|
|
1504
|
+
function Is(n, e) {
|
|
1505
1505
|
if (n)
|
|
1506
1506
|
return new Ke(n.attrs, n.linkIndex);
|
|
1507
1507
|
if (e && "__type" in e)
|
|
1508
1508
|
return new Ke(e.attrs, e.linkIndex);
|
|
1509
1509
|
}
|
|
1510
|
-
function
|
|
1510
|
+
function go(n, e) {
|
|
1511
1511
|
return at(n.eav, [e]) !== void 0;
|
|
1512
1512
|
}
|
|
1513
1513
|
function yt(n, e, t, r) {
|
|
1514
|
-
const s =
|
|
1514
|
+
const s = ks(n, e, r);
|
|
1515
1515
|
return s.cardinalityInference = t, s.useDateObjects = r, s;
|
|
1516
1516
|
}
|
|
1517
1517
|
function kt(n, e) {
|
|
@@ -1541,21 +1541,21 @@ function kt(n, e) {
|
|
|
1541
1541
|
return [t, ...a];
|
|
1542
1542
|
}
|
|
1543
1543
|
}
|
|
1544
|
-
function
|
|
1544
|
+
function Ps(n, e, t) {
|
|
1545
1545
|
const r = kt(n, t);
|
|
1546
1546
|
if (!r)
|
|
1547
1547
|
return;
|
|
1548
1548
|
const [s, i, o] = r, a = e.getAttr(i);
|
|
1549
1549
|
a && (Oe(n.eav, [s, i, o]), Oe(n.aev, [i, s, o]), nr(a) && Oe(n.vae, [o, i, s]));
|
|
1550
1550
|
}
|
|
1551
|
-
let
|
|
1552
|
-
function
|
|
1551
|
+
let _o = 0;
|
|
1552
|
+
function Ms(n, e, t) {
|
|
1553
1553
|
const [r, s, i] = t;
|
|
1554
1554
|
let o;
|
|
1555
1555
|
const a = at(n.eav, [r, s, i]);
|
|
1556
|
-
return a && (o = a[3]), o || Date.now() * 10 +
|
|
1556
|
+
return a && (o = a[3]), o || Date.now() * 10 + _o++;
|
|
1557
1557
|
}
|
|
1558
|
-
function
|
|
1558
|
+
function Rs(n, e, t) {
|
|
1559
1559
|
const r = kt(n, t);
|
|
1560
1560
|
if (!r)
|
|
1561
1561
|
return;
|
|
@@ -1564,10 +1564,10 @@ function Ms(n, e, t) {
|
|
|
1564
1564
|
if (!a)
|
|
1565
1565
|
return;
|
|
1566
1566
|
a["checked-data-type"] === "date" && n.useDateObjects && (o = Zt(o));
|
|
1567
|
-
const c = at(n.eav, [s, i, o]), u = (c == null ? void 0 : c[3]) ??
|
|
1568
|
-
|
|
1567
|
+
const c = at(n.eav, [s, i, o]), u = (c == null ? void 0 : c[3]) ?? Ms(n, a, r), l = [s, i, o, u];
|
|
1568
|
+
bo(a) ? (be(n.eav, [s, i], /* @__PURE__ */ new Map([[o, l]])), be(n.aev, [i, s], /* @__PURE__ */ new Map([[o, l]]))) : (be(n.eav, [s, i, o], l), be(n.aev, [i, s, o], l)), nr(a) && be(n.vae, [o, i, s], l);
|
|
1569
1569
|
}
|
|
1570
|
-
function
|
|
1570
|
+
function mo(n, e, t) {
|
|
1571
1571
|
var y;
|
|
1572
1572
|
const r = kt(n, t);
|
|
1573
1573
|
if (!r)
|
|
@@ -1583,11 +1583,11 @@ function _o(n, e, t) {
|
|
|
1583
1583
|
const u = (y = c.values().next()) == null ? void 0 : y.value;
|
|
1584
1584
|
if (!u)
|
|
1585
1585
|
return;
|
|
1586
|
-
const l = u[2], f =
|
|
1586
|
+
const l = u[2], f = Es(l, o), d = [
|
|
1587
1587
|
s,
|
|
1588
1588
|
i,
|
|
1589
1589
|
f,
|
|
1590
|
-
|
|
1590
|
+
Ms(n, a, u)
|
|
1591
1591
|
];
|
|
1592
1592
|
be(n.eav, [s, i], /* @__PURE__ */ new Map([[f, d]])), be(n.aev, [i, s], /* @__PURE__ */ new Map([[f, d]]));
|
|
1593
1593
|
}
|
|
@@ -1618,50 +1618,50 @@ function Cn(n, e, t) {
|
|
|
1618
1618
|
(!s || !g || ((m = g["reverse-identity"]) == null ? void 0 : m[1]) === s) && (Oe(n.eav, [d, y, b]), Oe(n.aev, [y, d, b]), Oe(n.vae, [b, y, d])), g && g["on-delete"] === "cascade" && ((T = g["reverse-identity"]) == null ? void 0 : T[1]) === s && Cn(n, e, [d, (_ = g["forward-identity"]) == null ? void 0 : _[1]]);
|
|
1619
1619
|
}), ((l = n.vae.get(o)) == null ? void 0 : l.size) === 0 && Oe(n.vae, [o]);
|
|
1620
1620
|
}
|
|
1621
|
-
function
|
|
1622
|
-
const r =
|
|
1621
|
+
function js(n, e, t) {
|
|
1622
|
+
const r = ks(e, t, n.useDateObjects);
|
|
1623
1623
|
Object.keys(r).forEach((s) => {
|
|
1624
1624
|
n[s] = r[s];
|
|
1625
1625
|
});
|
|
1626
1626
|
}
|
|
1627
|
-
function
|
|
1627
|
+
function wo(n, [e]) {
|
|
1628
1628
|
n.addAttr(e);
|
|
1629
1629
|
}
|
|
1630
|
-
function
|
|
1630
|
+
function xs(n) {
|
|
1631
1631
|
return ge(n.eav, 3);
|
|
1632
1632
|
}
|
|
1633
|
-
function
|
|
1633
|
+
function So(n, e, [t]) {
|
|
1634
1634
|
if (!e.getAttr(t))
|
|
1635
1635
|
return;
|
|
1636
|
-
const r =
|
|
1637
|
-
e.deleteAttr(t),
|
|
1636
|
+
const r = xs(n).filter(([s, i]) => i !== t);
|
|
1637
|
+
e.deleteAttr(t), js(n, e, r);
|
|
1638
1638
|
}
|
|
1639
|
-
function
|
|
1640
|
-
e.getAttr(t.id) && (e.updateAttr(t),
|
|
1639
|
+
function To(n, e, [t]) {
|
|
1640
|
+
e.getAttr(t.id) && (e.updateAttr(t), js(n, e, xs(n)));
|
|
1641
1641
|
}
|
|
1642
|
-
function
|
|
1642
|
+
function vo(n, e, t) {
|
|
1643
1643
|
const [r, ...s] = t;
|
|
1644
1644
|
switch (r) {
|
|
1645
1645
|
case "add-triple":
|
|
1646
|
-
|
|
1646
|
+
Rs(n, e, s);
|
|
1647
1647
|
break;
|
|
1648
1648
|
case "deep-merge-triple":
|
|
1649
|
-
|
|
1649
|
+
mo(n, e, s);
|
|
1650
1650
|
break;
|
|
1651
1651
|
case "retract-triple":
|
|
1652
|
-
|
|
1652
|
+
Ps(n, e, s);
|
|
1653
1653
|
break;
|
|
1654
1654
|
case "delete-entity":
|
|
1655
1655
|
Cn(n, e, s);
|
|
1656
1656
|
break;
|
|
1657
1657
|
case "add-attr":
|
|
1658
|
-
|
|
1658
|
+
wo(e, s);
|
|
1659
1659
|
break;
|
|
1660
1660
|
case "delete-attr":
|
|
1661
|
-
|
|
1661
|
+
So(n, e, s);
|
|
1662
1662
|
break;
|
|
1663
1663
|
case "update-attr":
|
|
1664
|
-
|
|
1664
|
+
To(n, e, s);
|
|
1665
1665
|
break;
|
|
1666
1666
|
case "restore-attr":
|
|
1667
1667
|
break;
|
|
@@ -1716,13 +1716,13 @@ function Mt(n, e, t) {
|
|
|
1716
1716
|
}
|
|
1717
1717
|
return r;
|
|
1718
1718
|
}
|
|
1719
|
-
function
|
|
1719
|
+
function Eo(n, e, t) {
|
|
1720
1720
|
let r = "";
|
|
1721
1721
|
return n !== void 0 && (r += "e"), e !== void 0 && (r += "a"), t !== void 0 && (r += "v"), r;
|
|
1722
1722
|
}
|
|
1723
|
-
function
|
|
1723
|
+
function Oo(n, [e, t, r]) {
|
|
1724
1724
|
var i, o;
|
|
1725
|
-
switch (
|
|
1725
|
+
switch (Eo(e, t, r)) {
|
|
1726
1726
|
case "e": {
|
|
1727
1727
|
const a = n.eav.get(e);
|
|
1728
1728
|
return ge(a, 2);
|
|
@@ -1768,7 +1768,7 @@ function Eo(n, [e, t, r]) {
|
|
|
1768
1768
|
return ge(n.eav, 3);
|
|
1769
1769
|
}
|
|
1770
1770
|
}
|
|
1771
|
-
function
|
|
1771
|
+
function ko(n, e, t) {
|
|
1772
1772
|
var s;
|
|
1773
1773
|
const r = {};
|
|
1774
1774
|
if (!e)
|
|
@@ -1788,15 +1788,15 @@ function Ve(n, e, t) {
|
|
|
1788
1788
|
var r;
|
|
1789
1789
|
return (r = n.revIdents.get(e)) == null ? void 0 : r.get(t);
|
|
1790
1790
|
}
|
|
1791
|
-
function
|
|
1791
|
+
function Ao(n, e) {
|
|
1792
1792
|
return n.blobAttrs.get(e);
|
|
1793
1793
|
}
|
|
1794
|
-
function
|
|
1794
|
+
function $s(n, e) {
|
|
1795
1795
|
var r;
|
|
1796
1796
|
const t = n.primaryKeys.get(e);
|
|
1797
1797
|
return t || ((r = n.forwardIdents.get(e)) == null ? void 0 : r.get("id"));
|
|
1798
1798
|
}
|
|
1799
|
-
function
|
|
1799
|
+
function Co(n, e, t) {
|
|
1800
1800
|
const r = kt(n, t);
|
|
1801
1801
|
if (!r)
|
|
1802
1802
|
return;
|
|
@@ -1804,7 +1804,7 @@ function Ao(n, e, t) {
|
|
|
1804
1804
|
if (e.getAttr(i))
|
|
1805
1805
|
return at(n.eav, [s, i]);
|
|
1806
1806
|
}
|
|
1807
|
-
function
|
|
1807
|
+
function Io(n, e, t) {
|
|
1808
1808
|
const r = t.filter(([s, i, o, a, c]) => {
|
|
1809
1809
|
if (s !== "add-triple" && s !== "deep-merge-triple")
|
|
1810
1810
|
return !0;
|
|
@@ -1814,8 +1814,8 @@ function Co(n, e, t) {
|
|
|
1814
1814
|
let l = !1;
|
|
1815
1815
|
const f = e.getAttr(o);
|
|
1816
1816
|
if (f) {
|
|
1817
|
-
const d =
|
|
1818
|
-
l = !!
|
|
1817
|
+
const d = $s(e, f["forward-identity"][1]);
|
|
1818
|
+
l = !!Co(n, e, [
|
|
1819
1819
|
i,
|
|
1820
1820
|
d == null ? void 0 : d.id,
|
|
1821
1821
|
i
|
|
@@ -1825,7 +1825,7 @@ function Co(n, e, t) {
|
|
|
1825
1825
|
});
|
|
1826
1826
|
return Gt({ store: n, attrsStore: e }, (s) => {
|
|
1827
1827
|
r.forEach((i) => {
|
|
1828
|
-
|
|
1828
|
+
vo(s.store, s.attrsStore, i);
|
|
1829
1829
|
});
|
|
1830
1830
|
}, {
|
|
1831
1831
|
mark: (s) => {
|
|
@@ -1834,28 +1834,28 @@ function Co(n, e, t) {
|
|
|
1834
1834
|
}
|
|
1835
1835
|
});
|
|
1836
1836
|
}
|
|
1837
|
-
function
|
|
1837
|
+
function Po(n) {
|
|
1838
1838
|
return typeof n == "string" && n.startsWith("?");
|
|
1839
1839
|
}
|
|
1840
|
-
function
|
|
1840
|
+
function Mo(n, e, t) {
|
|
1841
1841
|
if (t.hasOwnProperty(n)) {
|
|
1842
1842
|
const r = t[n];
|
|
1843
|
-
return
|
|
1843
|
+
return Ds(r, e, t);
|
|
1844
1844
|
}
|
|
1845
1845
|
return { ...t, [n]: e };
|
|
1846
1846
|
}
|
|
1847
1847
|
function Mr(n, e, t) {
|
|
1848
1848
|
return n === e ? t : null;
|
|
1849
1849
|
}
|
|
1850
|
-
function
|
|
1850
|
+
function Ro(n) {
|
|
1851
1851
|
switch (typeof n) {
|
|
1852
1852
|
case "string":
|
|
1853
|
-
return n.startsWith("?") ?
|
|
1853
|
+
return n.startsWith("?") ? Mo : Mr;
|
|
1854
1854
|
default:
|
|
1855
1855
|
return Mr;
|
|
1856
1856
|
}
|
|
1857
1857
|
}
|
|
1858
|
-
const
|
|
1858
|
+
const jo = [
|
|
1859
1859
|
"in",
|
|
1860
1860
|
"$in",
|
|
1861
1861
|
"$not",
|
|
@@ -1863,69 +1863,69 @@ const Ro = [
|
|
|
1863
1863
|
"$comparator"
|
|
1864
1864
|
// covers all of $gt, $lt, etc.
|
|
1865
1865
|
];
|
|
1866
|
-
function
|
|
1867
|
-
for (const e of
|
|
1866
|
+
function xo(n) {
|
|
1867
|
+
for (const e of jo)
|
|
1868
1868
|
if (n.hasOwnProperty(e))
|
|
1869
1869
|
return !0;
|
|
1870
1870
|
return !1;
|
|
1871
1871
|
}
|
|
1872
|
-
function
|
|
1873
|
-
return t ? typeof n == "object" ?
|
|
1872
|
+
function Ds(n, e, t) {
|
|
1873
|
+
return t ? typeof n == "object" ? xo(n) ? t : null : Ro(n)(n, e, t) : null;
|
|
1874
1874
|
}
|
|
1875
|
-
function
|
|
1875
|
+
function $o(n, e, t) {
|
|
1876
1876
|
return n.reduce((r, s, i) => {
|
|
1877
1877
|
const o = e[i];
|
|
1878
|
-
return
|
|
1878
|
+
return Ds(s, o, r);
|
|
1879
1879
|
}, t);
|
|
1880
1880
|
}
|
|
1881
|
-
function $o(n, e, t) {
|
|
1882
|
-
return Lo(n, e, t).map((r) => xo(e, r, t)).filter((r) => r);
|
|
1883
|
-
}
|
|
1884
1881
|
function Do(n, e, t) {
|
|
1885
|
-
return
|
|
1882
|
+
return Fo(n, e, t).map((r) => $o(e, r, t)).filter((r) => r);
|
|
1883
|
+
}
|
|
1884
|
+
function Uo(n, e, t) {
|
|
1885
|
+
return e.or ? e.or.patterns.flatMap((r) => In(n, r, t)) : e.and ? e.and.patterns.reduce((r, s) => In(n, s, r), t) : t.flatMap((r) => Do(n, e, r));
|
|
1886
1886
|
}
|
|
1887
1887
|
function In(n, e, t = [{}]) {
|
|
1888
|
-
return e.reduce((r, s) =>
|
|
1888
|
+
return e.reduce((r, s) => Uo(n, s, r), t);
|
|
1889
1889
|
}
|
|
1890
1890
|
function sr(n, e) {
|
|
1891
|
-
return Array.isArray(e) ? e.map((t) => sr(n, t)) :
|
|
1891
|
+
return Array.isArray(e) ? e.map((t) => sr(n, t)) : Po(e) ? n[e] : e;
|
|
1892
1892
|
}
|
|
1893
|
-
function
|
|
1893
|
+
function Lo(n, { find: e, where: t }) {
|
|
1894
1894
|
return In(n, t).map((s) => sr(s, e));
|
|
1895
1895
|
}
|
|
1896
|
-
function
|
|
1897
|
-
return
|
|
1896
|
+
function Fo(n, e, t) {
|
|
1897
|
+
return Oo(n, sr(t, e));
|
|
1898
1898
|
}
|
|
1899
|
-
const
|
|
1899
|
+
const No = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
|
|
1900
1900
|
function it(n) {
|
|
1901
|
-
return typeof n == "string" &&
|
|
1901
|
+
return typeof n == "string" && No.test(n);
|
|
1902
1902
|
}
|
|
1903
1903
|
const oe = [];
|
|
1904
1904
|
for (let n = 0; n < 256; ++n)
|
|
1905
1905
|
oe.push((n + 256).toString(16).slice(1));
|
|
1906
|
-
function
|
|
1906
|
+
function Ko(n, e = 0) {
|
|
1907
1907
|
return (oe[n[e + 0]] + oe[n[e + 1]] + oe[n[e + 2]] + oe[n[e + 3]] + "-" + oe[n[e + 4]] + oe[n[e + 5]] + "-" + oe[n[e + 6]] + oe[n[e + 7]] + "-" + oe[n[e + 8]] + oe[n[e + 9]] + "-" + oe[n[e + 10]] + oe[n[e + 11]] + oe[n[e + 12]] + oe[n[e + 13]] + oe[n[e + 14]] + oe[n[e + 15]]).toLowerCase();
|
|
1908
1908
|
}
|
|
1909
1909
|
let dn;
|
|
1910
|
-
const
|
|
1911
|
-
function
|
|
1910
|
+
const Wo = new Uint8Array(16);
|
|
1911
|
+
function qo() {
|
|
1912
1912
|
if (!dn) {
|
|
1913
1913
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
1914
1914
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1915
1915
|
dn = crypto.getRandomValues.bind(crypto);
|
|
1916
1916
|
}
|
|
1917
|
-
return dn(
|
|
1917
|
+
return dn(Wo);
|
|
1918
1918
|
}
|
|
1919
|
-
const
|
|
1920
|
-
function
|
|
1919
|
+
const zo = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Rr = { randomUUID: zo };
|
|
1920
|
+
function Vo(n, e, t) {
|
|
1921
1921
|
var s;
|
|
1922
1922
|
if (Rr.randomUUID && !n)
|
|
1923
1923
|
return Rr.randomUUID();
|
|
1924
1924
|
n = n || {};
|
|
1925
|
-
const r = n.random ?? ((s = n.rng) == null ? void 0 : s.call(n)) ??
|
|
1925
|
+
const r = n.random ?? ((s = n.rng) == null ? void 0 : s.call(n)) ?? qo();
|
|
1926
1926
|
if (r.length < 16)
|
|
1927
1927
|
throw new Error("Random bytes length must be >= 16");
|
|
1928
|
-
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128,
|
|
1928
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Ko(r);
|
|
1929
1929
|
}
|
|
1930
1930
|
function jr(n) {
|
|
1931
1931
|
const e = n.replace(/-/g, ""), t = [];
|
|
@@ -1933,7 +1933,7 @@ function jr(n) {
|
|
|
1933
1933
|
t.push(parseInt(e.substring(r, r + 2), 16));
|
|
1934
1934
|
return t;
|
|
1935
1935
|
}
|
|
1936
|
-
function
|
|
1936
|
+
function Qo(n, e) {
|
|
1937
1937
|
for (let t = 0; t < n.length; t++) {
|
|
1938
1938
|
if (n[t] < e[t])
|
|
1939
1939
|
return -1;
|
|
@@ -1942,17 +1942,17 @@ function Vo(n, e) {
|
|
|
1942
1942
|
}
|
|
1943
1943
|
return 0;
|
|
1944
1944
|
}
|
|
1945
|
-
function
|
|
1946
|
-
return
|
|
1945
|
+
function Bo(n, e) {
|
|
1946
|
+
return Qo(jr(n), jr(e));
|
|
1947
1947
|
}
|
|
1948
1948
|
function Z() {
|
|
1949
|
-
return
|
|
1949
|
+
return Vo();
|
|
1950
1950
|
}
|
|
1951
|
-
function
|
|
1951
|
+
function Go(n, e) {
|
|
1952
1952
|
return n.localeCompare(e);
|
|
1953
1953
|
}
|
|
1954
|
-
function
|
|
1955
|
-
let n =
|
|
1954
|
+
function Ho() {
|
|
1955
|
+
let n = Go;
|
|
1956
1956
|
if (typeof Intl == "object" && Intl.hasOwnProperty("Collator"))
|
|
1957
1957
|
try {
|
|
1958
1958
|
n = Intl.Collator("en-US").compare;
|
|
@@ -1960,14 +1960,14 @@ function Go() {
|
|
|
1960
1960
|
}
|
|
1961
1961
|
return n;
|
|
1962
1962
|
}
|
|
1963
|
-
const
|
|
1964
|
-
let
|
|
1963
|
+
const Jo = Ho();
|
|
1964
|
+
let Us = !0;
|
|
1965
1965
|
const al = (n) => {
|
|
1966
|
-
|
|
1966
|
+
Us = n;
|
|
1967
1967
|
};
|
|
1968
|
-
let
|
|
1968
|
+
let Yo = 0;
|
|
1969
1969
|
function St(n) {
|
|
1970
|
-
return Xt(`_${n}`,
|
|
1970
|
+
return Xt(`_${n}`, Yo++);
|
|
1971
1971
|
}
|
|
1972
1972
|
function Xt(n, e) {
|
|
1973
1973
|
return `?${n}-${e}`;
|
|
@@ -1977,27 +1977,27 @@ class ot extends Error {
|
|
|
1977
1977
|
super(e), this.name = "AttrNotFoundError";
|
|
1978
1978
|
}
|
|
1979
1979
|
}
|
|
1980
|
-
function
|
|
1981
|
-
const t =
|
|
1980
|
+
function Zo(n, e) {
|
|
1981
|
+
const t = $s(n, e);
|
|
1982
1982
|
if (!t)
|
|
1983
1983
|
throw new ot(`Could not find id attr for ${e}`);
|
|
1984
1984
|
return t;
|
|
1985
1985
|
}
|
|
1986
1986
|
function xr(n, e, t, r) {
|
|
1987
|
-
return [
|
|
1987
|
+
return [Xo(n, e, t, r)];
|
|
1988
1988
|
}
|
|
1989
|
-
function
|
|
1989
|
+
function Xo(n, e, t, r) {
|
|
1990
1990
|
return [
|
|
1991
1991
|
n(t, r),
|
|
1992
|
-
|
|
1992
|
+
Zo(e, t).id,
|
|
1993
1993
|
n(t, r),
|
|
1994
1994
|
n("time", r)
|
|
1995
1995
|
];
|
|
1996
1996
|
}
|
|
1997
|
-
function
|
|
1997
|
+
function ea(n, e, t) {
|
|
1998
1998
|
return n.map((r) => r === e ? t : r);
|
|
1999
1999
|
}
|
|
2000
|
-
function
|
|
2000
|
+
function Ls(n, e, t, r, s) {
|
|
2001
2001
|
const i = se(e, t, s), o = Ve(e, t, s), a = i || o;
|
|
2002
2002
|
if (!a)
|
|
2003
2003
|
throw new ot(`Could not find attr for ${[t, s]}`);
|
|
@@ -2026,7 +2026,7 @@ function $r(n, e) {
|
|
|
2026
2026
|
return typeof o != "string" ? !1 : s.test(o);
|
|
2027
2027
|
};
|
|
2028
2028
|
}
|
|
2029
|
-
function
|
|
2029
|
+
function ta(n, e) {
|
|
2030
2030
|
if (typeof e != "object" || e.hasOwnProperty("$in") || e.hasOwnProperty("in"))
|
|
2031
2031
|
return e;
|
|
2032
2032
|
const t = n["checked-data-type"] === "date";
|
|
@@ -2086,7 +2086,7 @@ function ea(n, e) {
|
|
|
2086
2086
|
}
|
|
2087
2087
|
return e;
|
|
2088
2088
|
}
|
|
2089
|
-
function
|
|
2089
|
+
function na(n, e, t, r, s, i) {
|
|
2090
2090
|
const o = se(e, t, s), a = Ve(e, t, s), c = o || a;
|
|
2091
2091
|
if (!c)
|
|
2092
2092
|
throw new ot(`No attr for etype = ${t} label = ${s}`);
|
|
@@ -2104,31 +2104,31 @@ function ta(n, e, t, r, s, i) {
|
|
|
2104
2104
|
return o ? [
|
|
2105
2105
|
n(t, r),
|
|
2106
2106
|
c.id,
|
|
2107
|
-
|
|
2107
|
+
ta(c, i),
|
|
2108
2108
|
St("time")
|
|
2109
2109
|
] : [i, c.id, n(t, r), St("time")];
|
|
2110
2110
|
}
|
|
2111
|
-
function
|
|
2111
|
+
function ra(n, e, t, r, s) {
|
|
2112
2112
|
const [i, o, a] = s.reduce((c, u) => {
|
|
2113
|
-
const [l, f, d] = c, [y, b, g] =
|
|
2113
|
+
const [l, f, d] = c, [y, b, g] = Ls(n, e, l, f, u);
|
|
2114
2114
|
return [y, b, [...d, g]];
|
|
2115
2115
|
}, [t, r, []]);
|
|
2116
2116
|
return [i, o, a];
|
|
2117
2117
|
}
|
|
2118
2118
|
function Pn(n, e, t, r, s, i) {
|
|
2119
|
-
const o = s.slice(0, s.length - 1), a = s[s.length - 1], [c, u, l] =
|
|
2119
|
+
const o = s.slice(0, s.length - 1), a = s[s.length - 1], [c, u, l] = ra(n, e, t, r, o), f = na(n, e, c, u, a, i);
|
|
2120
2120
|
return l.concat([f]);
|
|
2121
2121
|
}
|
|
2122
|
-
function
|
|
2122
|
+
function sa(n, e) {
|
|
2123
2123
|
return e ? [e].concat(n) : n;
|
|
2124
2124
|
}
|
|
2125
|
-
function
|
|
2125
|
+
function ia([n, e]) {
|
|
2126
2126
|
return n === "or" && Array.isArray(e);
|
|
2127
2127
|
}
|
|
2128
|
-
function
|
|
2128
|
+
function oa([n, e]) {
|
|
2129
2129
|
return n === "and" && Array.isArray(e);
|
|
2130
2130
|
}
|
|
2131
|
-
function
|
|
2131
|
+
function aa(n, e, t) {
|
|
2132
2132
|
return (r, s) => {
|
|
2133
2133
|
const i = n(r, s);
|
|
2134
2134
|
return e == i ? i : `${i}-${t}`;
|
|
@@ -2136,27 +2136,27 @@ function oa(n, e, t) {
|
|
|
2136
2136
|
}
|
|
2137
2137
|
function Dr(n, e, t, r, s, i) {
|
|
2138
2138
|
const o = n(r, s), a = i.map((c, u) => {
|
|
2139
|
-
const l =
|
|
2140
|
-
return
|
|
2139
|
+
const l = aa(n, o, u);
|
|
2140
|
+
return Fs(l, t, r, s, c);
|
|
2141
2141
|
});
|
|
2142
2142
|
return { [e]: { patterns: a, joinSym: o } };
|
|
2143
2143
|
}
|
|
2144
|
-
function
|
|
2144
|
+
function ca(n) {
|
|
2145
2145
|
const e = [];
|
|
2146
2146
|
for (let t = 1; t <= n.length; t++)
|
|
2147
2147
|
e.push(n.slice(0, t));
|
|
2148
2148
|
return e;
|
|
2149
2149
|
}
|
|
2150
2150
|
function Ur(n, e, t, r, s) {
|
|
2151
|
-
return
|
|
2151
|
+
return ca(s).map((i) => Pn(n, e, t, r, i, {
|
|
2152
2152
|
$isNull: !0
|
|
2153
2153
|
}));
|
|
2154
2154
|
}
|
|
2155
|
-
function
|
|
2155
|
+
function Fs(n, e, t, r, s) {
|
|
2156
2156
|
return Object.entries(s).flatMap(([i, o]) => {
|
|
2157
|
-
if (sa([i, o]))
|
|
2158
|
-
return Dr(n, "or", e, t, r, o);
|
|
2159
2157
|
if (ia([i, o]))
|
|
2158
|
+
return Dr(n, "or", e, t, r, o);
|
|
2159
|
+
if (oa([i, o]))
|
|
2160
2160
|
return Dr(n, "and", e, t, r, o);
|
|
2161
2161
|
if (i === "$entityIdStartsWith")
|
|
2162
2162
|
return [];
|
|
@@ -2182,25 +2182,25 @@ function Ls(n, e, t, r, s) {
|
|
|
2182
2182
|
] : Pn(n, e, t, r, a, o);
|
|
2183
2183
|
});
|
|
2184
2184
|
}
|
|
2185
|
-
function
|
|
2185
|
+
function ua(n, e, t, r) {
|
|
2186
2186
|
const s = Xt;
|
|
2187
|
-
return r ?
|
|
2187
|
+
return r ? Fs(s, n, e, t, r).concat(xr(s, n, e, t)) : xr(s, n, e, t);
|
|
2188
2188
|
}
|
|
2189
|
-
function
|
|
2189
|
+
function la(n, e, t) {
|
|
2190
2190
|
return [n(e, t), n("time", t)];
|
|
2191
2191
|
}
|
|
2192
|
-
function
|
|
2193
|
-
const [o, a, c, u, l] =
|
|
2192
|
+
function fa(n, e, t, r, s, i) {
|
|
2193
|
+
const [o, a, c, u, l] = Ls(n, e, t, r, s), f = ea(c, n(t, r), i);
|
|
2194
2194
|
return [o, a, f, u, l];
|
|
2195
2195
|
}
|
|
2196
|
-
function
|
|
2196
|
+
function da(n, e, t, { etype: r, level: s, form: i }, o) {
|
|
2197
2197
|
const a = Object.keys(i).filter((c) => c !== "$");
|
|
2198
2198
|
return a.length ? Object.entries(o).map(function([u, l]) {
|
|
2199
2199
|
return a.map(function(y) {
|
|
2200
2200
|
var g, m, T;
|
|
2201
2201
|
const b = !!(e.cardinalityInference && ((T = (m = (g = t.linkIndex) == null ? void 0 : g[r]) == null ? void 0 : m[y]) != null && T.isSingular));
|
|
2202
2202
|
try {
|
|
2203
|
-
const [_, w, C] =
|
|
2203
|
+
const [_, w, C] = fa(n, t, r, s, y, u), v = Ws(e, t, {
|
|
2204
2204
|
etype: _,
|
|
2205
2205
|
level: w,
|
|
2206
2206
|
form: i[y],
|
|
@@ -2217,11 +2217,11 @@ function fa(n, e, t, { etype: r, level: s, form: i }, o) {
|
|
|
2217
2217
|
}, l);
|
|
2218
2218
|
}) : Object.values(o);
|
|
2219
2219
|
}
|
|
2220
|
-
function
|
|
2221
|
-
return t === "string" ?
|
|
2220
|
+
function ha(n, e, t) {
|
|
2221
|
+
return t === "string" ? Jo(n, e) : n > e ? 1 : -1;
|
|
2222
2222
|
}
|
|
2223
2223
|
function bt(n, e, t, r, s) {
|
|
2224
|
-
return e === r || e == null && r == null ?
|
|
2224
|
+
return e === r || e == null && r == null ? Bo(n, t) : r == null ? 1 : e == null ? -1 : ha(e, r, s);
|
|
2225
2225
|
}
|
|
2226
2226
|
function Ht([n, e], [t, r], s) {
|
|
2227
2227
|
return bt(n, e, t, r, s);
|
|
@@ -2229,7 +2229,7 @@ function Ht([n, e], [t, r], s) {
|
|
|
2229
2229
|
function Mn(n) {
|
|
2230
2230
|
return n == null ? n : new Date(n).getTime();
|
|
2231
2231
|
}
|
|
2232
|
-
function
|
|
2232
|
+
function Ns(n, e, t) {
|
|
2233
2233
|
var d;
|
|
2234
2234
|
const [r, s, i, o] = n;
|
|
2235
2235
|
if (((d = e["forward-identity"]) == null ? void 0 : d[2]) === "id")
|
|
@@ -2237,32 +2237,32 @@ function Fs(n, e, t) {
|
|
|
2237
2237
|
const [a, c] = t, u = e["checked-data-type"], l = u === "date" ? Mn(c) : c, f = u === "date" ? Mn(i) : i;
|
|
2238
2238
|
return Ht([a, l], [r, f], u);
|
|
2239
2239
|
}
|
|
2240
|
-
function
|
|
2241
|
-
const s =
|
|
2240
|
+
function pa(n, e, t, r) {
|
|
2241
|
+
const s = Ns(n, e, r);
|
|
2242
2242
|
return t === "desc" ? s > 0 : s < 0;
|
|
2243
2243
|
}
|
|
2244
|
-
function
|
|
2245
|
-
const s =
|
|
2244
|
+
function ya(n, e, t, r) {
|
|
2245
|
+
const s = Ns(n, e, r);
|
|
2246
2246
|
return t === "desc" ? s < 0 : s > 0;
|
|
2247
2247
|
}
|
|
2248
|
-
function
|
|
2248
|
+
function ba(n, e) {
|
|
2249
2249
|
const t = e[1];
|
|
2250
2250
|
return n.getAttr(t);
|
|
2251
2251
|
}
|
|
2252
|
-
function
|
|
2252
|
+
function ga(n, e, t) {
|
|
2253
2253
|
const r = Object.keys(t)[0];
|
|
2254
2254
|
return se(n, e, r);
|
|
2255
2255
|
}
|
|
2256
|
-
function
|
|
2256
|
+
function _a(n, e, t, r) {
|
|
2257
2257
|
if (t)
|
|
2258
|
-
return
|
|
2258
|
+
return ba(n, t);
|
|
2259
2259
|
if (r)
|
|
2260
|
-
return
|
|
2260
|
+
return ga(n, e, r);
|
|
2261
2261
|
}
|
|
2262
|
-
function
|
|
2262
|
+
function ma(n, e, t) {
|
|
2263
2263
|
var s, i;
|
|
2264
2264
|
if (!Array.isArray(t.fields))
|
|
2265
|
-
return
|
|
2265
|
+
return Ao(n, e);
|
|
2266
2266
|
const r = /* @__PURE__ */ new Map();
|
|
2267
2267
|
for (const o of t.fields) {
|
|
2268
2268
|
const a = se(n, e, o), c = (s = a == null ? void 0 : a["forward-identity"]) == null ? void 0 : s[2];
|
|
@@ -2274,11 +2274,11 @@ function _a(n, e, t) {
|
|
|
2274
2274
|
}
|
|
2275
2275
|
return r;
|
|
2276
2276
|
}
|
|
2277
|
-
function
|
|
2277
|
+
function wa(n, e, { etype: t, pageInfo: r, dq: s, form: i }) {
|
|
2278
2278
|
var g, m;
|
|
2279
|
-
const o = (g = i == null ? void 0 : i.$) == null ? void 0 : g.order, a =
|
|
2280
|
-
let u =
|
|
2281
|
-
const l = r == null ? void 0 : r["start-cursor"], f = r == null ? void 0 : r["end-cursor"], d =
|
|
2279
|
+
const o = (g = i == null ? void 0 : i.$) == null ? void 0 : g.order, a = Ks(i), c = Sa(i);
|
|
2280
|
+
let u = Lo(n, s);
|
|
2281
|
+
const l = r == null ? void 0 : r["start-cursor"], f = r == null ? void 0 : r["end-cursor"], d = _a(e, t, l, o);
|
|
2282
2282
|
if (d && ((m = d == null ? void 0 : d["forward-identity"]) == null ? void 0 : m[2]) !== "id") {
|
|
2283
2283
|
const T = d["checked-data-type"] === "date", _ = d.id;
|
|
2284
2284
|
u = u.map(([w]) => {
|
|
@@ -2293,57 +2293,57 @@ function ma(n, e, { etype: t, pageInfo: r, dq: s, form: i }) {
|
|
|
2293
2293
|
return Ht(w, _, d == null ? void 0 : d["checked-data-type"]);
|
|
2294
2294
|
});
|
|
2295
2295
|
let y = {};
|
|
2296
|
-
const b =
|
|
2296
|
+
const b = ma(e, t, s);
|
|
2297
2297
|
for (const T of u) {
|
|
2298
2298
|
const [_] = T;
|
|
2299
|
-
if (y[_] || !a && l && d &&
|
|
2299
|
+
if (y[_] || !a && l && d && pa(l, d, c, T) || !a && f && d && ya(f, d, c, T))
|
|
2300
2300
|
continue;
|
|
2301
|
-
const w =
|
|
2301
|
+
const w = ko(n, b, _);
|
|
2302
2302
|
w && (y[_] = w);
|
|
2303
2303
|
}
|
|
2304
2304
|
return y;
|
|
2305
2305
|
}
|
|
2306
|
-
function
|
|
2306
|
+
function Sa(n) {
|
|
2307
2307
|
var t;
|
|
2308
2308
|
const e = (t = n.$) == null ? void 0 : t.order;
|
|
2309
2309
|
return e && e[Object.keys(e)[0]] || "asc";
|
|
2310
2310
|
}
|
|
2311
|
-
function
|
|
2311
|
+
function Ks(n) {
|
|
2312
2312
|
var s, i, o;
|
|
2313
2313
|
const e = (s = n.$) == null ? void 0 : s.offset, t = (i = n.$) == null ? void 0 : i.before, r = (o = n.$) == null ? void 0 : o.after;
|
|
2314
2314
|
return !e && !t && !r;
|
|
2315
2315
|
}
|
|
2316
|
-
function
|
|
2316
|
+
function Ta(n, e, { etype: t, level: r, form: s, join: i, pageInfo: o }) {
|
|
2317
2317
|
var d, y, b, g, m;
|
|
2318
|
-
if (!
|
|
2318
|
+
if (!Ks(s) && (!o || !o["start-cursor"]))
|
|
2319
2319
|
return [];
|
|
2320
|
-
const a =
|
|
2320
|
+
const a = sa(ua(e, t, r, (d = s.$) == null ? void 0 : d.where), i), c = la(Xt, t, r), u = (y = s.$) == null ? void 0 : y.fields, l = wa(n, e, {
|
|
2321
2321
|
etype: t,
|
|
2322
2322
|
pageInfo: o,
|
|
2323
2323
|
form: s,
|
|
2324
2324
|
dq: { where: a, find: c, fields: u }
|
|
2325
2325
|
}), f = ((b = s.$) == null ? void 0 : b.limit) || ((g = s.$) == null ? void 0 : g.first) || ((m = s.$) == null ? void 0 : m.last);
|
|
2326
2326
|
if (f != null) {
|
|
2327
|
-
r > 0 &&
|
|
2327
|
+
r > 0 && Us && console.warn("WARNING: Limits in child queries are only run client-side. Data returned from the server will not have a limit.");
|
|
2328
2328
|
const T = Object.entries(l);
|
|
2329
2329
|
return T.length <= f ? l : Object.fromEntries(T.slice(0, f));
|
|
2330
2330
|
}
|
|
2331
2331
|
return l;
|
|
2332
2332
|
}
|
|
2333
|
-
function
|
|
2333
|
+
function va(n, e, t) {
|
|
2334
2334
|
try {
|
|
2335
|
-
return
|
|
2335
|
+
return Ta(n, e, t);
|
|
2336
2336
|
} catch (r) {
|
|
2337
2337
|
if (r instanceof ot)
|
|
2338
2338
|
return {};
|
|
2339
2339
|
throw r;
|
|
2340
2340
|
}
|
|
2341
2341
|
}
|
|
2342
|
-
function
|
|
2343
|
-
const r =
|
|
2344
|
-
return
|
|
2342
|
+
function Ws(n, e, t) {
|
|
2343
|
+
const r = va(n, e, t);
|
|
2344
|
+
return da(Xt, n, e, t, r);
|
|
2345
2345
|
}
|
|
2346
|
-
function
|
|
2346
|
+
function Ea(n) {
|
|
2347
2347
|
const e = {};
|
|
2348
2348
|
for (const [t, r] of Object.entries(n))
|
|
2349
2349
|
e[t] = {
|
|
@@ -2354,18 +2354,18 @@ function va(n) {
|
|
|
2354
2354
|
};
|
|
2355
2355
|
return e;
|
|
2356
2356
|
}
|
|
2357
|
-
function
|
|
2357
|
+
function qs({ store: n, attrsStore: e, pageInfo: t, aggregate: r }, s) {
|
|
2358
2358
|
const o = { data: Object.keys(s).reduce(function(c, u) {
|
|
2359
|
-
return r != null && r[u] || u === "$$ruleParams" || (c[u] =
|
|
2359
|
+
return r != null && r[u] || u === "$$ruleParams" || (c[u] = Ws(n, e, {
|
|
2360
2360
|
etype: u,
|
|
2361
2361
|
form: s[u],
|
|
2362
2362
|
level: 0,
|
|
2363
2363
|
pageInfo: t == null ? void 0 : t[u]
|
|
2364
2364
|
})), c;
|
|
2365
2365
|
}, {}) };
|
|
2366
|
-
return t && (o.pageInfo =
|
|
2366
|
+
return t && (o.pageInfo = Ea(t)), r && (o.aggregate = r), o;
|
|
2367
2367
|
}
|
|
2368
|
-
function
|
|
2368
|
+
function Oa() {
|
|
2369
2369
|
const e = {
|
|
2370
2370
|
__etype: 1,
|
|
2371
2371
|
__ops: 1,
|
|
@@ -2379,7 +2379,7 @@ function Ea() {
|
|
|
2379
2379
|
};
|
|
2380
2380
|
return new Set(Object.keys(e));
|
|
2381
2381
|
}
|
|
2382
|
-
const
|
|
2382
|
+
const ka = Oa();
|
|
2383
2383
|
function Kt(n, e, t) {
|
|
2384
2384
|
const r = {
|
|
2385
2385
|
__etype: n,
|
|
@@ -2391,7 +2391,7 @@ function Kt(n, e, t) {
|
|
|
2391
2391
|
return t;
|
|
2392
2392
|
if (i === "__etype")
|
|
2393
2393
|
return n;
|
|
2394
|
-
if (
|
|
2394
|
+
if (ka.has(i))
|
|
2395
2395
|
return (o, a) => Kt(n, e, [
|
|
2396
2396
|
...t,
|
|
2397
2397
|
a ? [i, n, e, o, a] : [i, n, e, o]
|
|
@@ -2399,7 +2399,7 @@ function Kt(n, e, t) {
|
|
|
2399
2399
|
}
|
|
2400
2400
|
});
|
|
2401
2401
|
}
|
|
2402
|
-
function
|
|
2402
|
+
function Aa(n, e) {
|
|
2403
2403
|
return `lookup__${n}__${JSON.stringify(e)}`;
|
|
2404
2404
|
}
|
|
2405
2405
|
function Jt(n) {
|
|
@@ -2409,13 +2409,13 @@ function Rn(n) {
|
|
|
2409
2409
|
const [e, t, ...r] = n.split("__");
|
|
2410
2410
|
return [t, JSON.parse(r.join("__"))];
|
|
2411
2411
|
}
|
|
2412
|
-
function
|
|
2412
|
+
function Ca(n) {
|
|
2413
2413
|
return new Proxy({
|
|
2414
2414
|
__etype: n
|
|
2415
2415
|
}, {
|
|
2416
2416
|
get(e, t) {
|
|
2417
2417
|
if (t === "lookup")
|
|
2418
|
-
return (s, i) => Kt(n, Rn(
|
|
2418
|
+
return (s, i) => Kt(n, Rn(Aa(s, i)), []);
|
|
2419
2419
|
if (t === "__etype")
|
|
2420
2420
|
return n;
|
|
2421
2421
|
const r = t;
|
|
@@ -2426,15 +2426,15 @@ function Aa(n) {
|
|
|
2426
2426
|
function ir() {
|
|
2427
2427
|
return new Proxy({}, {
|
|
2428
2428
|
get(n, e) {
|
|
2429
|
-
return
|
|
2429
|
+
return Ca(e);
|
|
2430
2430
|
}
|
|
2431
2431
|
});
|
|
2432
2432
|
}
|
|
2433
2433
|
const cl = ir();
|
|
2434
|
-
function
|
|
2434
|
+
function Ia(n) {
|
|
2435
2435
|
return n.__ops;
|
|
2436
2436
|
}
|
|
2437
|
-
function
|
|
2437
|
+
function Pa(n, e) {
|
|
2438
2438
|
const { attrIdMap: t, refSwapAttrIds: r } = n, s = [];
|
|
2439
2439
|
for (const o of e) {
|
|
2440
2440
|
const a = t[o];
|
|
@@ -2453,7 +2453,7 @@ function Ia(n, e) {
|
|
|
2453
2453
|
}
|
|
2454
2454
|
return s;
|
|
2455
2455
|
}
|
|
2456
|
-
function
|
|
2456
|
+
function Ma(n) {
|
|
2457
2457
|
if (Array.isArray(n))
|
|
2458
2458
|
return n;
|
|
2459
2459
|
const e = Object.entries(n);
|
|
@@ -2461,7 +2461,7 @@ function Pa(n) {
|
|
|
2461
2461
|
throw new Error("lookup must be an object with a single unique attr and value.");
|
|
2462
2462
|
return e[0];
|
|
2463
2463
|
}
|
|
2464
|
-
function
|
|
2464
|
+
function Ra(n, e, t) {
|
|
2465
2465
|
return t.indexOf(".") !== -1 && // attr names can have `.` in them, so use the attr we find with a `.`
|
|
2466
2466
|
// before assuming it's a ref lookup.
|
|
2467
2467
|
!se(n, e, t);
|
|
@@ -2472,8 +2472,8 @@ function jn(n) {
|
|
|
2472
2472
|
throw new Error(`${n} is not a valid lookup attribute.`);
|
|
2473
2473
|
return e;
|
|
2474
2474
|
}
|
|
2475
|
-
function
|
|
2476
|
-
if (!
|
|
2475
|
+
function ja(n, e, t) {
|
|
2476
|
+
if (!Ra(n, e, t))
|
|
2477
2477
|
return se(n, e, t);
|
|
2478
2478
|
const r = jn(t), s = se(n, e, r) || Ve(n, e, r);
|
|
2479
2479
|
if (s && s["value-type"] !== "ref")
|
|
@@ -2481,18 +2481,18 @@ function Ra(n, e, t) {
|
|
|
2481
2481
|
return s;
|
|
2482
2482
|
}
|
|
2483
2483
|
function xn(n) {
|
|
2484
|
-
return typeof n == "string" && !Jt(n) ? null : typeof n == "string" && Jt(n) ? Rn(n) :
|
|
2484
|
+
return typeof n == "string" && !Jt(n) ? null : typeof n == "string" && Jt(n) ? Rn(n) : Ma(n);
|
|
2485
2485
|
}
|
|
2486
2486
|
function _e(n, e, t) {
|
|
2487
2487
|
const r = xn(t);
|
|
2488
2488
|
if (r === null)
|
|
2489
2489
|
return t;
|
|
2490
|
-
const [s, i] = r, o =
|
|
2490
|
+
const [s, i] = r, o = ja(n, e, s);
|
|
2491
2491
|
if (!o || !o["unique?"])
|
|
2492
2492
|
throw new Error(`${s} is not a unique attribute.`);
|
|
2493
2493
|
return [o.id, i];
|
|
2494
2494
|
}
|
|
2495
|
-
function
|
|
2495
|
+
function zs(n, e, t, r) {
|
|
2496
2496
|
var o;
|
|
2497
2497
|
const s = _e(n, e, t);
|
|
2498
2498
|
return Array.isArray(s) ? [[
|
|
@@ -2502,7 +2502,7 @@ function qs(n, e, t, r) {
|
|
|
2502
2502
|
s
|
|
2503
2503
|
]].concat(r) : r;
|
|
2504
2504
|
}
|
|
2505
|
-
function
|
|
2505
|
+
function xa({ attrsStore: n }, [e, t, r]) {
|
|
2506
2506
|
const s = Object.entries(r).flatMap(([i, o]) => {
|
|
2507
2507
|
const a = Array.isArray(o) ? o : [o], c = se(n, e, i), u = Ve(n, e, i);
|
|
2508
2508
|
return a.map((l) => c ? [
|
|
@@ -2521,9 +2521,9 @@ function ja({ attrsStore: n }, [e, t, r]) {
|
|
|
2521
2521
|
_e(n, e, t)
|
|
2522
2522
|
]);
|
|
2523
2523
|
});
|
|
2524
|
-
return
|
|
2524
|
+
return zs(n, e, t, s);
|
|
2525
2525
|
}
|
|
2526
|
-
function
|
|
2526
|
+
function $a({ attrsStore: n }, [e, t, r]) {
|
|
2527
2527
|
const s = Object.entries(r).flatMap(([i, o]) => {
|
|
2528
2528
|
const a = Array.isArray(o) ? o : [o], c = se(n, e, i), u = Ve(n, e, i);
|
|
2529
2529
|
return a.map((l) => c ? [
|
|
@@ -2542,9 +2542,9 @@ function xa({ attrsStore: n }, [e, t, r]) {
|
|
|
2542
2542
|
_e(n, e, t)
|
|
2543
2543
|
]);
|
|
2544
2544
|
});
|
|
2545
|
-
return
|
|
2545
|
+
return zs(n, e, t, s);
|
|
2546
2546
|
}
|
|
2547
|
-
function
|
|
2547
|
+
function Da(n, e, t, r) {
|
|
2548
2548
|
var s;
|
|
2549
2549
|
if (Array.isArray(r)) {
|
|
2550
2550
|
const [i, o] = r;
|
|
@@ -2567,18 +2567,18 @@ function $a(n, e, t, r) {
|
|
|
2567
2567
|
}
|
|
2568
2568
|
return !1;
|
|
2569
2569
|
}
|
|
2570
|
-
function
|
|
2571
|
-
return (i == null ? void 0 : i.upsert) === !1 ? { mode: "update" } : (i == null ? void 0 : i.upsert) === !0 ? null :
|
|
2570
|
+
function Vs({ stores: n, attrsStore: e }, [t, r, s, i]) {
|
|
2571
|
+
return (i == null ? void 0 : i.upsert) === !1 ? { mode: "update" } : (i == null ? void 0 : i.upsert) === !0 ? null : Da(n, e, t, r) ? { mode: "update" } : null;
|
|
2572
2572
|
}
|
|
2573
|
-
function
|
|
2573
|
+
function Ua(n, e) {
|
|
2574
2574
|
const { attrsStore: t } = n, [r, s, i, o] = e, a = tr(i), c = _e(t, r, s);
|
|
2575
2575
|
return [["id", c]].concat(Object.entries(a)).map(([l, f]) => {
|
|
2576
2576
|
const d = se(t, r, l);
|
|
2577
2577
|
return d["checked-data-type"] === "date" && n.useDateObjects && (f = Zt(f)), ["add-triple", c, d.id, f, { mode: "create" }];
|
|
2578
2578
|
});
|
|
2579
2579
|
}
|
|
2580
|
-
function
|
|
2581
|
-
const { attrsStore: t } = n, [r, s, i, o] = e, a = tr(i), c = _e(t, r, s), u =
|
|
2580
|
+
function La(n, e) {
|
|
2581
|
+
const { attrsStore: t } = n, [r, s, i, o] = e, a = tr(i), c = _e(t, r, s), u = Vs(n, [r, c, i, o]);
|
|
2582
2582
|
return [["id", c]].concat(Object.entries(a)).map(([f, d]) => {
|
|
2583
2583
|
const y = se(t, r, f);
|
|
2584
2584
|
return y["checked-data-type"] === "date" && n.useDateObjects && (d = Zt(d)), [
|
|
@@ -2590,11 +2590,11 @@ function Ua(n, e) {
|
|
|
2590
2590
|
];
|
|
2591
2591
|
});
|
|
2592
2592
|
}
|
|
2593
|
-
function
|
|
2593
|
+
function Fa({ attrsStore: n }, [e, t]) {
|
|
2594
2594
|
return [["delete-entity", _e(n, e, t), e]];
|
|
2595
2595
|
}
|
|
2596
|
-
function
|
|
2597
|
-
const { attrsStore: t } = n, [r, s, i, o] = e, a = tr(i), c = _e(t, r, s), u =
|
|
2596
|
+
function Na(n, e) {
|
|
2597
|
+
const { attrsStore: t } = n, [r, s, i, o] = e, a = tr(i), c = _e(t, r, s), u = Vs(n, [r, c, i, o]), l = Object.entries(a).map(([d, y]) => {
|
|
2598
2598
|
const b = se(t, r, d);
|
|
2599
2599
|
return [
|
|
2600
2600
|
"deep-merge-triple",
|
|
@@ -2612,38 +2612,38 @@ function Fa(n, e) {
|
|
|
2612
2612
|
...u ? [u] : []
|
|
2613
2613
|
]].concat(l);
|
|
2614
2614
|
}
|
|
2615
|
-
function
|
|
2615
|
+
function Ka({ attrsStore: n }, [e, t, r]) {
|
|
2616
2616
|
return [["rule-params", _e(n, e, t), e, r]];
|
|
2617
2617
|
}
|
|
2618
|
-
function
|
|
2618
|
+
function Wa(n) {
|
|
2619
2619
|
const [e, t, r, s, i] = n;
|
|
2620
2620
|
if (!s)
|
|
2621
2621
|
return n;
|
|
2622
2622
|
const o = { ...s };
|
|
2623
2623
|
return delete o.id, [e, t, r, o, ...i ? [i] : []];
|
|
2624
2624
|
}
|
|
2625
|
-
function
|
|
2626
|
-
const [t, ...r] =
|
|
2625
|
+
function qa(n, e) {
|
|
2626
|
+
const [t, ...r] = Wa(e);
|
|
2627
2627
|
switch (t) {
|
|
2628
2628
|
case "merge":
|
|
2629
|
-
return
|
|
2629
|
+
return Na(n, r);
|
|
2630
2630
|
case "create":
|
|
2631
|
-
return Da(n, r);
|
|
2632
|
-
case "update":
|
|
2633
2631
|
return Ua(n, r);
|
|
2632
|
+
case "update":
|
|
2633
|
+
return La(n, r);
|
|
2634
2634
|
case "link":
|
|
2635
|
-
return ja(n, r);
|
|
2636
|
-
case "unlink":
|
|
2637
2635
|
return xa(n, r);
|
|
2636
|
+
case "unlink":
|
|
2637
|
+
return $a(n, r);
|
|
2638
2638
|
case "delete":
|
|
2639
|
-
return
|
|
2639
|
+
return Fa(n, r);
|
|
2640
2640
|
case "ruleParams":
|
|
2641
|
-
return
|
|
2641
|
+
return Ka(n, r);
|
|
2642
2642
|
default:
|
|
2643
2643
|
throw new Error(`unsupported action ${t}`);
|
|
2644
2644
|
}
|
|
2645
2645
|
}
|
|
2646
|
-
function
|
|
2646
|
+
function za(n) {
|
|
2647
2647
|
switch (n) {
|
|
2648
2648
|
case "string":
|
|
2649
2649
|
case "date":
|
|
@@ -2654,14 +2654,14 @@ function qa(n) {
|
|
|
2654
2654
|
return;
|
|
2655
2655
|
}
|
|
2656
2656
|
}
|
|
2657
|
-
function
|
|
2657
|
+
function Va(n, e, t) {
|
|
2658
2658
|
var a, c;
|
|
2659
2659
|
const r = (c = (a = n.entities[e]) == null ? void 0 : a.attrs) == null ? void 0 : c[t];
|
|
2660
2660
|
if (t === "id")
|
|
2661
2661
|
return null;
|
|
2662
2662
|
if (!r)
|
|
2663
2663
|
throw new Error(`${e}.${t} does not exist in your schema`);
|
|
2664
|
-
const { unique: s, indexed: i } = r == null ? void 0 : r.config, o =
|
|
2664
|
+
const { unique: s, indexed: i } = r == null ? void 0 : r.config, o = za(r == null ? void 0 : r.valueType);
|
|
2665
2665
|
return {
|
|
2666
2666
|
"index?": i,
|
|
2667
2667
|
"unique?": s,
|
|
@@ -2669,7 +2669,7 @@ function za(n, e, t) {
|
|
|
2669
2669
|
};
|
|
2670
2670
|
}
|
|
2671
2671
|
function Rt(n, e, t, r) {
|
|
2672
|
-
const s = n ?
|
|
2672
|
+
const s = n ? Va(n, e, t) : null, i = Z(), a = [Z(), e, t];
|
|
2673
2673
|
return {
|
|
2674
2674
|
id: i,
|
|
2675
2675
|
"forward-identity": a,
|
|
@@ -2682,11 +2682,11 @@ function Rt(n, e, t, r) {
|
|
|
2682
2682
|
...r || {}
|
|
2683
2683
|
};
|
|
2684
2684
|
}
|
|
2685
|
-
function
|
|
2685
|
+
function Qa(n, e, t) {
|
|
2686
2686
|
return Object.values(n.links).find((i) => i.forward.on === e && i.forward.label === t || i.reverse.on === e && i.reverse.label === t);
|
|
2687
2687
|
}
|
|
2688
|
-
function
|
|
2689
|
-
const r =
|
|
2688
|
+
function Ba(n, e, t) {
|
|
2689
|
+
const r = Qa(n, e, t);
|
|
2690
2690
|
if (!r)
|
|
2691
2691
|
throw new Error(`Couldn't find the link ${e}.${t} in your schema`);
|
|
2692
2692
|
const { forward: s, reverse: i } = r;
|
|
@@ -2700,7 +2700,7 @@ function Qa(n, e, t) {
|
|
|
2700
2700
|
};
|
|
2701
2701
|
}
|
|
2702
2702
|
function Lr(n, e, t, r) {
|
|
2703
|
-
const s = n ?
|
|
2703
|
+
const s = n ? Ba(n, e, t) : null, i = Z(), o = [Z(), e, t], a = [Z(), t, e];
|
|
2704
2704
|
return {
|
|
2705
2705
|
id: i,
|
|
2706
2706
|
// @ts-ignore: ts thinks it's any[]
|
|
@@ -2717,7 +2717,7 @@ function Lr(n, e, t, r) {
|
|
|
2717
2717
|
...r || {}
|
|
2718
2718
|
};
|
|
2719
2719
|
}
|
|
2720
|
-
const
|
|
2720
|
+
const Ga = /* @__PURE__ */ new Set(["create", "update", "merge", "link", "unlink"]), Ha = /* @__PURE__ */ new Set(["link", "unlink"]), Ja = /* @__PURE__ */ new Set(["create", "update", "merge"]), Ya = /* @__PURE__ */ new Set([
|
|
2721
2721
|
"link",
|
|
2722
2722
|
"unlink",
|
|
2723
2723
|
"create",
|
|
@@ -2725,13 +2725,13 @@ const Ba = /* @__PURE__ */ new Set(["create", "update", "merge", "link", "unlink
|
|
|
2725
2725
|
"merge",
|
|
2726
2726
|
"delete",
|
|
2727
2727
|
"ruleParams"
|
|
2728
|
-
]), $n = { "unique?": !0, "index?": !0 },
|
|
2728
|
+
]), $n = { "unique?": !0, "index?": !0 }, Za = {
|
|
2729
2729
|
...$n,
|
|
2730
2730
|
cardinality: "one"
|
|
2731
2731
|
};
|
|
2732
|
-
function
|
|
2732
|
+
function Xa(n) {
|
|
2733
2733
|
const e = [], [t, r, s, i] = n;
|
|
2734
|
-
if (!
|
|
2734
|
+
if (!Ya.has(t))
|
|
2735
2735
|
return e;
|
|
2736
2736
|
const o = xn(s);
|
|
2737
2737
|
if (o && e.push({ etype: r, lookupPair: o }), t === "link")
|
|
@@ -2748,7 +2748,7 @@ function Za(n) {
|
|
|
2748
2748
|
}
|
|
2749
2749
|
return e;
|
|
2750
2750
|
}
|
|
2751
|
-
function
|
|
2751
|
+
function ec({ attrsStore: n, schema: e }, t) {
|
|
2752
2752
|
var d, y;
|
|
2753
2753
|
const r = /* @__PURE__ */ new Set(), s = [], i = [];
|
|
2754
2754
|
function o(b, g) {
|
|
@@ -2773,10 +2773,10 @@ function Xa({ attrsStore: n, schema: e }, t) {
|
|
|
2773
2773
|
}
|
|
2774
2774
|
function f(b, g) {
|
|
2775
2775
|
const m = o(b, g), T = a(b, g);
|
|
2776
|
-
u(m), u(T), !m && !T && c(Lr(e, b, g,
|
|
2776
|
+
u(m), u(T), !m && !T && c(Lr(e, b, g, Za));
|
|
2777
2777
|
}
|
|
2778
2778
|
for (const b of t)
|
|
2779
|
-
for (const { etype: g, lookupPair: m, linkLabel: T } of
|
|
2779
|
+
for (const { etype: g, lookupPair: m, linkLabel: T } of Xa(b)) {
|
|
2780
2780
|
const _ = m[0];
|
|
2781
2781
|
if (T) {
|
|
2782
2782
|
f(g, T);
|
|
@@ -2798,12 +2798,12 @@ function Xa({ attrsStore: n, schema: e }, t) {
|
|
|
2798
2798
|
}
|
|
2799
2799
|
for (const b of t) {
|
|
2800
2800
|
const [g, m, T, _] = b;
|
|
2801
|
-
if (
|
|
2801
|
+
if (Ga.has(g)) {
|
|
2802
2802
|
const w = o(m, "id");
|
|
2803
2803
|
u(w), w || c(Rt(e, m, "id", { "unique?": !0 }));
|
|
2804
2804
|
for (const C of Object.keys(_)) {
|
|
2805
2805
|
const v = o(m, C);
|
|
2806
|
-
if (u(v),
|
|
2806
|
+
if (u(v), Ja.has(g) && (v || c(Rt(e, m, C, C === "id" ? { "unique?": !0 } : null))), Ha.has(g)) {
|
|
2807
2807
|
const U = a(m, C);
|
|
2808
2808
|
!v && !U && c(Lr(e, m, C)), u(U);
|
|
2809
2809
|
}
|
|
@@ -2818,15 +2818,15 @@ function Xa({ attrsStore: n, schema: e }, t) {
|
|
|
2818
2818
|
}
|
|
2819
2819
|
return [n, i];
|
|
2820
2820
|
}
|
|
2821
|
-
function
|
|
2822
|
-
const r = (Array.isArray(e) ? e : [e]).flatMap((c) =>
|
|
2821
|
+
function tc(n, e) {
|
|
2822
|
+
const r = (Array.isArray(e) ? e : [e]).flatMap((c) => Ia(c)), [s, i] = ec(n, r), o = { ...n, attrsStore: s }, a = r.flatMap((c) => qa(o, c));
|
|
2823
2823
|
return [...i, ...a];
|
|
2824
2824
|
}
|
|
2825
2825
|
function Fr(n, e) {
|
|
2826
2826
|
typeof requestIdleCallback > "u" ? n() : requestIdleCallback(n, { timeout: e });
|
|
2827
2827
|
}
|
|
2828
2828
|
const tt = "__meta";
|
|
2829
|
-
class
|
|
2829
|
+
class nc {
|
|
2830
2830
|
constructor(e, t) {
|
|
2831
2831
|
}
|
|
2832
2832
|
}
|
|
@@ -3078,13 +3078,13 @@ class Dn {
|
|
|
3078
3078
|
e && await this._enqueuePersist();
|
|
3079
3079
|
}
|
|
3080
3080
|
}
|
|
3081
|
-
const
|
|
3082
|
-
function
|
|
3081
|
+
const rc = 6, sc = ["kv", "querySubs", "syncSubs"];
|
|
3082
|
+
function ic(n) {
|
|
3083
3083
|
return function(t) {
|
|
3084
3084
|
console.error("Error in IndexedDB event", { source: n, event: t });
|
|
3085
3085
|
};
|
|
3086
3086
|
}
|
|
3087
|
-
async function
|
|
3087
|
+
async function oc(n) {
|
|
3088
3088
|
return new Promise((e) => {
|
|
3089
3089
|
const t = indexedDB.open(n);
|
|
3090
3090
|
t.onerror = (r) => {
|
|
@@ -3098,7 +3098,7 @@ async function ic(n) {
|
|
|
3098
3098
|
};
|
|
3099
3099
|
});
|
|
3100
3100
|
}
|
|
3101
|
-
async function
|
|
3101
|
+
async function ac(n, e, t) {
|
|
3102
3102
|
const r = (
|
|
3103
3103
|
// Backwards compatibility for older versions where we JSON.stringified before storing
|
|
3104
3104
|
typeof e == "string" ? JSON.parse(e) : e
|
|
@@ -3138,8 +3138,8 @@ async function Nr(n, e, t) {
|
|
|
3138
3138
|
r.onsuccess = () => s(), r.onerror = (o) => i(o);
|
|
3139
3139
|
});
|
|
3140
3140
|
}
|
|
3141
|
-
async function
|
|
3142
|
-
const t = await
|
|
3141
|
+
async function cc(n, e) {
|
|
3142
|
+
const t = await oc(`instant_${n}_5`);
|
|
3143
3143
|
if (!t)
|
|
3144
3144
|
return;
|
|
3145
3145
|
const r = await new Promise((l, f) => {
|
|
@@ -3162,7 +3162,7 @@ async function ac(n, e) {
|
|
|
3162
3162
|
for (const [l, f] of r)
|
|
3163
3163
|
switch (l) {
|
|
3164
3164
|
case "querySubs": {
|
|
3165
|
-
const d =
|
|
3165
|
+
const d = ac(l, f, o);
|
|
3166
3166
|
a.push(d);
|
|
3167
3167
|
break;
|
|
3168
3168
|
}
|
|
@@ -3184,7 +3184,7 @@ async function ac(n, e) {
|
|
|
3184
3184
|
});
|
|
3185
3185
|
}
|
|
3186
3186
|
const Kr = /* @__PURE__ */ new Map();
|
|
3187
|
-
class
|
|
3187
|
+
class Qs extends nc {
|
|
3188
3188
|
constructor(t, r) {
|
|
3189
3189
|
super(t, r);
|
|
3190
3190
|
p(this, "dbName");
|
|
@@ -3192,7 +3192,7 @@ class Vs extends tc {
|
|
|
3192
3192
|
p(this, "_appId");
|
|
3193
3193
|
p(this, "_prefix");
|
|
3194
3194
|
p(this, "_dbPromise");
|
|
3195
|
-
this.dbName = `instant_${t}_${
|
|
3195
|
+
this.dbName = `instant_${t}_${rc}`, this._storeName = r, this._appId = t, this._dbPromise = this._init();
|
|
3196
3196
|
}
|
|
3197
3197
|
_init() {
|
|
3198
3198
|
return new Promise((t, r) => {
|
|
@@ -3207,8 +3207,8 @@ class Vs extends tc {
|
|
|
3207
3207
|
}, c.onversionchange = () => {
|
|
3208
3208
|
c.close();
|
|
3209
3209
|
}, s) {
|
|
3210
|
-
const u =
|
|
3211
|
-
|
|
3210
|
+
const u = cc(this._appId, c).catch((l) => {
|
|
3211
|
+
ic("Error upgrading store from version 5 to 6.")(l);
|
|
3212
3212
|
});
|
|
3213
3213
|
Kr.set(this.dbName, u), u.then(() => t(c)).catch(() => t(c));
|
|
3214
3214
|
} else {
|
|
@@ -3222,7 +3222,7 @@ class Vs extends tc {
|
|
|
3222
3222
|
}
|
|
3223
3223
|
_upgradeStore(t) {
|
|
3224
3224
|
const s = t.target.result;
|
|
3225
|
-
for (const i of
|
|
3225
|
+
for (const i of sc)
|
|
3226
3226
|
s.objectStoreNames.contains(i) || s.createObjectStore(i);
|
|
3227
3227
|
}
|
|
3228
3228
|
// Browsers can close IndexedDB connections unexpectedly (backgrounded tabs,
|
|
@@ -3283,7 +3283,7 @@ class Vs extends tc {
|
|
|
3283
3283
|
}));
|
|
3284
3284
|
}
|
|
3285
3285
|
}
|
|
3286
|
-
class
|
|
3286
|
+
class Bs {
|
|
3287
3287
|
static async getIsOnline() {
|
|
3288
3288
|
return navigator.onLine;
|
|
3289
3289
|
}
|
|
@@ -3329,14 +3329,14 @@ async function Ae(n, e) {
|
|
|
3329
3329
|
const t = await fetch(n, e), r = await t.json();
|
|
3330
3330
|
return t.status === 200 ? Promise.resolve(r) : Promise.reject(new en({ status: t.status, body: r }));
|
|
3331
3331
|
}
|
|
3332
|
-
function
|
|
3332
|
+
function uc({ apiURI: n, appId: e, email: t }) {
|
|
3333
3333
|
return Ae(`${n}/runtime/auth/send_magic_code`, {
|
|
3334
3334
|
method: "POST",
|
|
3335
3335
|
headers: { "content-type": "application/json" },
|
|
3336
3336
|
body: JSON.stringify({ "app-id": e, email: t })
|
|
3337
3337
|
});
|
|
3338
3338
|
}
|
|
3339
|
-
async function
|
|
3339
|
+
async function lc({ apiURI: n, appId: e, email: t, code: r, refreshToken: s, extraFields: i }) {
|
|
3340
3340
|
return await Ae(`${n}/runtime/auth/verify_magic_code`, {
|
|
3341
3341
|
method: "POST",
|
|
3342
3342
|
headers: { "content-type": "application/json" },
|
|
@@ -3349,7 +3349,7 @@ async function uc({ apiURI: n, appId: e, email: t, code: r, refreshToken: s, ext
|
|
|
3349
3349
|
})
|
|
3350
3350
|
});
|
|
3351
3351
|
}
|
|
3352
|
-
async function
|
|
3352
|
+
async function fc({ apiURI: n, appId: e, refreshToken: t }) {
|
|
3353
3353
|
return await Ae(`${n}/runtime/auth/verify_refresh_token`, {
|
|
3354
3354
|
method: "POST",
|
|
3355
3355
|
headers: { "content-type": "application/json" },
|
|
@@ -3359,7 +3359,7 @@ async function lc({ apiURI: n, appId: e, refreshToken: t }) {
|
|
|
3359
3359
|
})
|
|
3360
3360
|
});
|
|
3361
3361
|
}
|
|
3362
|
-
async function
|
|
3362
|
+
async function dc({ apiURI: n, appId: e }) {
|
|
3363
3363
|
return await Ae(`${n}/runtime/auth/sign_in_guest`, {
|
|
3364
3364
|
method: "POST",
|
|
3365
3365
|
headers: { "content-type": "application/json" },
|
|
@@ -3381,7 +3381,7 @@ async function Wr({ apiURI: n, appId: e, code: t, codeVerifier: r, refreshToken:
|
|
|
3381
3381
|
})
|
|
3382
3382
|
});
|
|
3383
3383
|
}
|
|
3384
|
-
async function
|
|
3384
|
+
async function hc({ apiURI: n, appId: e, nonce: t, idToken: r, clientName: s, refreshToken: i, extraFields: o }) {
|
|
3385
3385
|
return await Ae(`${n}/runtime/oauth/id_token`, {
|
|
3386
3386
|
method: "POST",
|
|
3387
3387
|
headers: { "content-type": "application/json" },
|
|
@@ -3395,7 +3395,7 @@ async function dc({ apiURI: n, appId: e, nonce: t, idToken: r, clientName: s, re
|
|
|
3395
3395
|
})
|
|
3396
3396
|
});
|
|
3397
3397
|
}
|
|
3398
|
-
async function
|
|
3398
|
+
async function pc({ apiURI: n, appId: e, refreshToken: t }) {
|
|
3399
3399
|
return await Ae(`${n}/runtime/signout`, {
|
|
3400
3400
|
method: "POST",
|
|
3401
3401
|
headers: {
|
|
@@ -3407,7 +3407,7 @@ async function hc({ apiURI: n, appId: e, refreshToken: t }) {
|
|
|
3407
3407
|
})
|
|
3408
3408
|
});
|
|
3409
3409
|
}
|
|
3410
|
-
async function
|
|
3410
|
+
async function yc({ apiURI: n, appId: e, path: t, file: r, refreshToken: s, contentType: i, contentDisposition: o }) {
|
|
3411
3411
|
const a = {
|
|
3412
3412
|
app_id: e,
|
|
3413
3413
|
path: t,
|
|
@@ -3420,7 +3420,7 @@ async function pc({ apiURI: n, appId: e, path: t, file: r, refreshToken: s, cont
|
|
|
3420
3420
|
body: r
|
|
3421
3421
|
});
|
|
3422
3422
|
}
|
|
3423
|
-
async function
|
|
3423
|
+
async function bc({ apiURI: n, appId: e, path: t, refreshToken: r }) {
|
|
3424
3424
|
const { data: s } = await Ae(`${n}/storage/files?app_id=${e}&filename=${encodeURIComponent(t)}`, {
|
|
3425
3425
|
method: "DELETE",
|
|
3426
3426
|
headers: {
|
|
@@ -3430,7 +3430,7 @@ async function yc({ apiURI: n, appId: e, path: t, refreshToken: r }) {
|
|
|
3430
3430
|
});
|
|
3431
3431
|
return s;
|
|
3432
3432
|
}
|
|
3433
|
-
async function
|
|
3433
|
+
async function gc({ apiURI: n, appId: e, fileName: t, refreshToken: r, metadata: s = {} }) {
|
|
3434
3434
|
const { data: i } = await Ae(`${n}/storage/signed-upload-url`, {
|
|
3435
3435
|
method: "POST",
|
|
3436
3436
|
headers: {
|
|
@@ -3444,7 +3444,7 @@ async function bc({ apiURI: n, appId: e, fileName: t, refreshToken: r, metadata:
|
|
|
3444
3444
|
});
|
|
3445
3445
|
return i;
|
|
3446
3446
|
}
|
|
3447
|
-
async function
|
|
3447
|
+
async function _c(n, e) {
|
|
3448
3448
|
return (await fetch(n, {
|
|
3449
3449
|
method: "PUT",
|
|
3450
3450
|
body: e,
|
|
@@ -3453,7 +3453,7 @@ async function gc(n, e) {
|
|
|
3453
3453
|
}
|
|
3454
3454
|
})).ok;
|
|
3455
3455
|
}
|
|
3456
|
-
async function
|
|
3456
|
+
async function mc({ apiURI: n, appId: e, path: t, refreshToken: r }) {
|
|
3457
3457
|
const { data: s } = await Ae(`${n}/storage/signed-download-url?app_id=${e}&filename=${encodeURIComponent(t)}`, {
|
|
3458
3458
|
method: "GET",
|
|
3459
3459
|
headers: {
|
|
@@ -3463,8 +3463,8 @@ async function _c({ apiURI: n, appId: e, path: t, refreshToken: r }) {
|
|
|
3463
3463
|
});
|
|
3464
3464
|
return s;
|
|
3465
3465
|
}
|
|
3466
|
-
let or = !1,
|
|
3467
|
-
typeof window < "u" && typeof window.localStorage < "u" && (or = !!window.localStorage.getItem("devBackend"),
|
|
3466
|
+
let or = !1, Gs = !1, Hs = !1;
|
|
3467
|
+
typeof window < "u" && typeof window.localStorage < "u" && (or = !!window.localStorage.getItem("devBackend"), Gs = !!window.localStorage.getItem("__instantLogging"), Hs = !!window.localStorage.getItem("__devtoolLocalDash"));
|
|
3468
3468
|
function qr(n, e) {
|
|
3469
3469
|
if (!e)
|
|
3470
3470
|
return n;
|
|
@@ -3473,7 +3473,7 @@ function qr(n, e) {
|
|
|
3473
3473
|
t[r] = n[r];
|
|
3474
3474
|
}), t;
|
|
3475
3475
|
}
|
|
3476
|
-
function
|
|
3476
|
+
function wc(n, e, t) {
|
|
3477
3477
|
const r = {
|
|
3478
3478
|
peers: {}
|
|
3479
3479
|
};
|
|
@@ -3490,8 +3490,8 @@ function mc(n, e, t) {
|
|
|
3490
3490
|
}
|
|
3491
3491
|
return r;
|
|
3492
3492
|
}
|
|
3493
|
-
function
|
|
3494
|
-
if (n.isLoading !== e.isLoading || n.error !== e.error || (n.user || e.user) && (!n.user || !e.user || !Cr(n.user, e.user)) || !
|
|
3493
|
+
function Sc(n, e) {
|
|
3494
|
+
if (n.isLoading !== e.isLoading || n.error !== e.error || (n.user || e.user) && (!n.user || !e.user || !Cr(n.user, e.user)) || !vs(n.peers, e.peers))
|
|
3495
3495
|
return !0;
|
|
3496
3496
|
for (const r of Object.keys(n.peers))
|
|
3497
3497
|
if (!Cr(n.peers[r], e.peers[r]))
|
|
@@ -3514,18 +3514,18 @@ class zr {
|
|
|
3514
3514
|
this._reject(e);
|
|
3515
3515
|
}
|
|
3516
3516
|
}
|
|
3517
|
-
function
|
|
3517
|
+
function Js(n, e = []) {
|
|
3518
3518
|
n.forEach((t) => {
|
|
3519
3519
|
const { data: r } = t, { "datalog-result": s } = r, { "join-rows": i } = s;
|
|
3520
3520
|
for (const o of i)
|
|
3521
3521
|
for (const a of o)
|
|
3522
3522
|
e.push(a);
|
|
3523
|
-
|
|
3523
|
+
Js(t["child-nodes"], e);
|
|
3524
3524
|
});
|
|
3525
3525
|
}
|
|
3526
3526
|
function Vr(n) {
|
|
3527
3527
|
const e = [];
|
|
3528
|
-
return
|
|
3528
|
+
return Js(n, e), e;
|
|
3529
3529
|
}
|
|
3530
3530
|
function Qr(n) {
|
|
3531
3531
|
return Object.values(n.links).reduce((e, t) => {
|
|
@@ -3541,8 +3541,8 @@ function Qr(n) {
|
|
|
3541
3541
|
}, e;
|
|
3542
3542
|
}, {});
|
|
3543
3543
|
}
|
|
3544
|
-
const ar = "v1.0.
|
|
3545
|
-
function
|
|
3544
|
+
const ar = "v1.0.41-branch-python-sdk-v1.26586025551.1";
|
|
3545
|
+
function Tc(n, e) {
|
|
3546
3546
|
return {
|
|
3547
3547
|
info: n ? (...t) => console.info(...t, e()) : () => {
|
|
3548
3548
|
},
|
|
@@ -3644,7 +3644,7 @@ const Br = [
|
|
|
3644
3644
|
"beforeInclusive",
|
|
3645
3645
|
"fields",
|
|
3646
3646
|
"aggregate"
|
|
3647
|
-
],
|
|
3647
|
+
], vc = (n) => n.valueType || "unknown", Ys = (n, e, t = !1) => {
|
|
3648
3648
|
if (t || n == null)
|
|
3649
3649
|
return !0;
|
|
3650
3650
|
switch (e) {
|
|
@@ -3659,9 +3659,9 @@ const Br = [
|
|
|
3659
3659
|
default:
|
|
3660
3660
|
return !0;
|
|
3661
3661
|
}
|
|
3662
|
-
},
|
|
3662
|
+
}, Ec = (n, e, t, r, s, i, o) => {
|
|
3663
3663
|
const a = i.valueType === "json", c = (u, l, f) => {
|
|
3664
|
-
if (!
|
|
3664
|
+
if (!Ys(f, l, a))
|
|
3665
3665
|
throw new B(`Invalid value for operator '${u}' on attribute '${r}' in entity '${s}'. Expected ${l}, but received: ${typeof f}`, o);
|
|
3666
3666
|
};
|
|
3667
3667
|
switch (n) {
|
|
@@ -3692,16 +3692,16 @@ const Br = [
|
|
|
3692
3692
|
throw new B(`Unknown operator '${n}' for attribute '${r}' in entity '${s}'`, o);
|
|
3693
3693
|
}
|
|
3694
3694
|
}, rt = (n, e, t, r, s) => {
|
|
3695
|
-
const i =
|
|
3695
|
+
const i = vc(t), o = t.valueType === "json";
|
|
3696
3696
|
if (typeof n == "object" && n !== null && !Array.isArray(n)) {
|
|
3697
3697
|
if (o)
|
|
3698
3698
|
return;
|
|
3699
3699
|
const c = n;
|
|
3700
3700
|
for (const [u, l] of Object.entries(c))
|
|
3701
|
-
|
|
3702
|
-
} else if (!
|
|
3701
|
+
Ec(u, l, i, e, r, t, `${s}.${u}`);
|
|
3702
|
+
} else if (!Ys(n, i, o))
|
|
3703
3703
|
throw new B(`Invalid value for attribute '${e}' in entity '${r}'. Expected ${i}, but received: ${typeof n}`, s);
|
|
3704
|
-
},
|
|
3704
|
+
}, Oc = (n, e, t, r, s) => {
|
|
3705
3705
|
const i = n.split(".");
|
|
3706
3706
|
if (i.length < 2)
|
|
3707
3707
|
throw new B(`Invalid dot notation path '${n}'. Must contain at least one dot.`, s);
|
|
@@ -3738,12 +3738,12 @@ const Br = [
|
|
|
3738
3738
|
throw new B(`Attribute '${a}' does not exist on entity '${o}' in dot notation path '${n}'. Available attributes: ${l.length > 0 ? l.join(", ") + ", id" : "id"}`, s);
|
|
3739
3739
|
}
|
|
3740
3740
|
rt(e, n, u, t, s);
|
|
3741
|
-
},
|
|
3741
|
+
}, Zs = (n, e, t, r) => {
|
|
3742
3742
|
for (const [s, i] of Object.entries(n)) {
|
|
3743
3743
|
if (s === "or" || s === "and") {
|
|
3744
3744
|
if (Array.isArray(i))
|
|
3745
3745
|
for (const u of i)
|
|
3746
|
-
typeof u == "object" && u !== null &&
|
|
3746
|
+
typeof u == "object" && u !== null && Zs(u, e, t, `${r}.${s}[${u}]`);
|
|
3747
3747
|
continue;
|
|
3748
3748
|
}
|
|
3749
3749
|
if (s === "id") {
|
|
@@ -3751,7 +3751,7 @@ const Br = [
|
|
|
3751
3751
|
continue;
|
|
3752
3752
|
}
|
|
3753
3753
|
if (s.includes(".")) {
|
|
3754
|
-
|
|
3754
|
+
Oc(s, i, e, t, `${r}.${s}`);
|
|
3755
3755
|
continue;
|
|
3756
3756
|
}
|
|
3757
3757
|
const o = t.entities[e];
|
|
@@ -3771,7 +3771,7 @@ const Br = [
|
|
|
3771
3771
|
rt(i, s, u, e, `${r}.${s}`);
|
|
3772
3772
|
}
|
|
3773
3773
|
}
|
|
3774
|
-
},
|
|
3774
|
+
}, kc = (n, e, t, r, s = 0) => {
|
|
3775
3775
|
for (const o of Object.keys(n))
|
|
3776
3776
|
if (!Br.includes(o))
|
|
3777
3777
|
throw new B(`Invalid query parameter '${o}' in $ object. Valid parameters are: ${Br.join(", ")}. Found: ${o}`, r);
|
|
@@ -3791,9 +3791,9 @@ const Br = [
|
|
|
3791
3791
|
if (n.where && t) {
|
|
3792
3792
|
if (typeof n.where != "object" || n.where === null)
|
|
3793
3793
|
throw new B(`'where' clause must be an object in entity '${e}', but received: ${typeof n.where}`, r ? `${r}.where` : void 0);
|
|
3794
|
-
|
|
3794
|
+
Zs(n.where, e, t, r ? `${r}.where` : "where");
|
|
3795
3795
|
}
|
|
3796
|
-
},
|
|
3796
|
+
}, Xs = (n, e, t, r, s = 0) => {
|
|
3797
3797
|
var i;
|
|
3798
3798
|
if (!n || typeof n != "object")
|
|
3799
3799
|
throw new B(`Query part for entity '${e}' must be an object, but received: ${typeof n}`, r);
|
|
@@ -3806,13 +3806,13 @@ const Br = [
|
|
|
3806
3806
|
const a = n[o];
|
|
3807
3807
|
if (typeof a == "object" && a !== null) {
|
|
3808
3808
|
const c = (i = t == null ? void 0 : t.entities[e].links[o]) == null ? void 0 : i.entityName;
|
|
3809
|
-
c &&
|
|
3809
|
+
c && Xs(a, c, t, `${r}.${o}`, s + 1);
|
|
3810
3810
|
}
|
|
3811
3811
|
} else {
|
|
3812
3812
|
const a = n[o];
|
|
3813
3813
|
if (typeof a != "object" || a === null)
|
|
3814
3814
|
throw new B(`Query parameter '$' must be an object in entity '${e}', but received: ${typeof a}`, `${r}.$`);
|
|
3815
|
-
|
|
3815
|
+
kc(a, e, t, `${r}.$`, s);
|
|
3816
3816
|
}
|
|
3817
3817
|
}, Gr = (n, e) => {
|
|
3818
3818
|
if (typeof n != "object" || n === null)
|
|
@@ -3830,7 +3830,7 @@ const Br = [
|
|
|
3830
3830
|
const s = Object.keys(e.entities);
|
|
3831
3831
|
throw new B(`Entity '${r}' does not exist in schema. Available entities: ${s.length > 0 ? s.join(", ") : "none"}`, r);
|
|
3832
3832
|
}
|
|
3833
|
-
|
|
3833
|
+
Xs(t[r], r, e, r, 0);
|
|
3834
3834
|
}
|
|
3835
3835
|
}
|
|
3836
3836
|
}, Hr = (n) => typeof n != "string" ? !1 : Jt(n) ? !0 : it(n);
|
|
@@ -3839,39 +3839,39 @@ class Te extends Error {
|
|
|
3839
3839
|
super(e), this.name = "TransactionValidationError";
|
|
3840
3840
|
}
|
|
3841
3841
|
}
|
|
3842
|
-
const
|
|
3842
|
+
const ei = (n) => n.length > 0 ? n.join(", ") : "none", Ac = (n, e) => new Te(`Entity '${n}' does not exist in schema. Available entities: ${ei(e)}`), hn = {
|
|
3843
3843
|
string: (n) => typeof n == "string",
|
|
3844
3844
|
number: (n) => typeof n == "number" && !isNaN(n),
|
|
3845
3845
|
boolean: (n) => typeof n == "boolean",
|
|
3846
3846
|
date: (n) => n instanceof Date || typeof n == "string" || typeof n == "number",
|
|
3847
3847
|
json: () => !0
|
|
3848
|
-
},
|
|
3848
|
+
}, Cc = (n, e) => {
|
|
3849
3849
|
var t;
|
|
3850
3850
|
return n == null ? !0 : ((t = hn[e.valueType]) == null ? void 0 : t.call(hn, n)) ?? !1;
|
|
3851
|
-
},
|
|
3851
|
+
}, ti = (n, e) => {
|
|
3852
3852
|
const t = e.entities[n];
|
|
3853
3853
|
if (!t)
|
|
3854
|
-
throw
|
|
3854
|
+
throw Ac(n, Object.keys(e.entities));
|
|
3855
3855
|
return t;
|
|
3856
3856
|
}, pn = (n, e, t) => {
|
|
3857
|
-
const r =
|
|
3857
|
+
const r = ti(n, t);
|
|
3858
3858
|
if (typeof e != "object" || e === null)
|
|
3859
3859
|
throw new Te(`Arguments for data operation on entity '${n}' must be an object, but received: ${typeof e}`);
|
|
3860
3860
|
for (const [s, i] of Object.entries(e)) {
|
|
3861
3861
|
if (s === "id")
|
|
3862
3862
|
continue;
|
|
3863
3863
|
const o = r.attrs[s];
|
|
3864
|
-
if (o && !
|
|
3864
|
+
if (o && !Cc(i, o))
|
|
3865
3865
|
throw new Te(`Invalid value for attribute '${s}' in entity '${n}'. Expected ${o.valueType}, but received: ${typeof i}`);
|
|
3866
3866
|
}
|
|
3867
3867
|
}, Jr = (n, e, t) => {
|
|
3868
|
-
const r =
|
|
3868
|
+
const r = ti(n, t);
|
|
3869
3869
|
if (typeof e != "object" || e === null)
|
|
3870
3870
|
throw new Te(`Arguments for link operation on entity '${n}' must be an object, but received: ${typeof e}`);
|
|
3871
3871
|
for (const [s, i] of Object.entries(e)) {
|
|
3872
3872
|
if (!r.links[s]) {
|
|
3873
3873
|
const a = Object.keys(r.links);
|
|
3874
|
-
throw new Te(`Link '${s}' does not exist on entity '${n}'. Available links: ${
|
|
3874
|
+
throw new Te(`Link '${s}' does not exist on entity '${n}'. Available links: ${ei(a)}`);
|
|
3875
3875
|
}
|
|
3876
3876
|
if (i != null) {
|
|
3877
3877
|
if (Array.isArray(i)) {
|
|
@@ -3882,7 +3882,7 @@ const Xs = (n) => n.length > 0 ? n.join(", ") : "none", kc = (n, e) => new Te(`E
|
|
|
3882
3882
|
throw new Te(`Invalid UUID in link '${s}' for entity '${n}'. Expected a UUID, but received: ${i}`);
|
|
3883
3883
|
}
|
|
3884
3884
|
}
|
|
3885
|
-
},
|
|
3885
|
+
}, Ic = {
|
|
3886
3886
|
create: pn,
|
|
3887
3887
|
update: pn,
|
|
3888
3888
|
merge: pn,
|
|
@@ -3890,7 +3890,7 @@ const Xs = (n) => n.length > 0 ? n.join(", ") : "none", kc = (n, e) => new Te(`E
|
|
|
3890
3890
|
unlink: Jr,
|
|
3891
3891
|
delete: () => {
|
|
3892
3892
|
}
|
|
3893
|
-
},
|
|
3893
|
+
}, Pc = (n, e) => {
|
|
3894
3894
|
if (!e)
|
|
3895
3895
|
return;
|
|
3896
3896
|
const [t, r, s, i] = n;
|
|
@@ -3898,9 +3898,9 @@ const Xs = (n) => n.length > 0 ? n.join(", ") : "none", kc = (n, e) => new Te(`E
|
|
|
3898
3898
|
throw new Te(`Invalid id for entity '${r}'. Expected a UUID, but received: ${s}`);
|
|
3899
3899
|
if (typeof r != "string")
|
|
3900
3900
|
throw new Te(`Entity name must be a string, but received: ${typeof r}`);
|
|
3901
|
-
const o =
|
|
3901
|
+
const o = Ic[t];
|
|
3902
3902
|
o && i !== void 0 && o(r, i, e);
|
|
3903
|
-
},
|
|
3903
|
+
}, Mc = (n, e) => {
|
|
3904
3904
|
const t = Array.isArray(n) ? n : [n];
|
|
3905
3905
|
for (const r of t) {
|
|
3906
3906
|
if (!r || typeof r != "object")
|
|
@@ -3910,11 +3910,11 @@ const Xs = (n) => n.length > 0 ? n.join(", ") : "none", kc = (n, e) => new Te(`E
|
|
|
3910
3910
|
for (const s of r.__ops) {
|
|
3911
3911
|
if (!Array.isArray(s))
|
|
3912
3912
|
throw new Te(`Transaction operation must be an array, but received: ${typeof s}`);
|
|
3913
|
-
|
|
3913
|
+
Pc(s, e);
|
|
3914
3914
|
}
|
|
3915
3915
|
}
|
|
3916
3916
|
};
|
|
3917
|
-
let
|
|
3917
|
+
let ni = 0;
|
|
3918
3918
|
class Yr {
|
|
3919
3919
|
constructor(e) {
|
|
3920
3920
|
p(this, "type", "ws");
|
|
@@ -3924,7 +3924,7 @@ class Yr {
|
|
|
3924
3924
|
p(this, "onmessage");
|
|
3925
3925
|
p(this, "onclose");
|
|
3926
3926
|
p(this, "onerror");
|
|
3927
|
-
this.id = `${this.type}_${
|
|
3927
|
+
this.id = `${this.type}_${ni++}`, this.conn = new WebSocket(e), this.conn.onopen = (t) => {
|
|
3928
3928
|
this.onopen && this.onopen({ target: this });
|
|
3929
3929
|
}, this.conn.onmessage = (t) => {
|
|
3930
3930
|
this.onmessage && this.onmessage({
|
|
@@ -3950,7 +3950,7 @@ class Yr {
|
|
|
3950
3950
|
return this.conn.send(JSON.stringify(e));
|
|
3951
3951
|
}
|
|
3952
3952
|
}
|
|
3953
|
-
class
|
|
3953
|
+
class Rc {
|
|
3954
3954
|
constructor(e, t, r) {
|
|
3955
3955
|
p(this, "type", "sse");
|
|
3956
3956
|
p(this, "initParams", null);
|
|
@@ -3967,7 +3967,7 @@ class Mc {
|
|
|
3967
3967
|
p(this, "onmessage");
|
|
3968
3968
|
p(this, "onclose");
|
|
3969
3969
|
p(this, "onerror");
|
|
3970
|
-
this.id = `${this.type}_${
|
|
3970
|
+
this.id = `${this.type}_${ni++}`, this.url = t, this.messageUrl = r || this.url, this.ES = e, this.conn = new e(t), this.sseInitTimeout = setTimeout(() => {
|
|
3971
3971
|
this.initParams || this.handleError();
|
|
3972
3972
|
}, 1e4), this.conn.onmessage = (s) => {
|
|
3973
3973
|
const i = JSON.parse(s.data);
|
|
@@ -4047,24 +4047,24 @@ class Mc {
|
|
|
4047
4047
|
this.handleClose();
|
|
4048
4048
|
}
|
|
4049
4049
|
}
|
|
4050
|
-
function
|
|
4050
|
+
function jc(n, e) {
|
|
4051
4051
|
const t = n.values;
|
|
4052
4052
|
if (t) {
|
|
4053
|
-
const r =
|
|
4053
|
+
const r = Is(t.attrsStore, null);
|
|
4054
4054
|
if (r) {
|
|
4055
4055
|
for (const s of t.entities || [])
|
|
4056
|
-
s.store.useDateObjects = e, s.store =
|
|
4056
|
+
s.store.useDateObjects = e, s.store = Cs(r, s.store);
|
|
4057
4057
|
t.attrsStore = r;
|
|
4058
4058
|
}
|
|
4059
4059
|
}
|
|
4060
4060
|
return n;
|
|
4061
4061
|
}
|
|
4062
|
-
function
|
|
4062
|
+
function xc(n, e) {
|
|
4063
4063
|
var t;
|
|
4064
4064
|
if (e.values) {
|
|
4065
4065
|
const r = [];
|
|
4066
4066
|
for (const s of (t = e.values) == null ? void 0 : t.entities) {
|
|
4067
|
-
const i =
|
|
4067
|
+
const i = As(s.store);
|
|
4068
4068
|
r.push({ ...s, store: i });
|
|
4069
4069
|
}
|
|
4070
4070
|
return {
|
|
@@ -4074,13 +4074,13 @@ function jc(n, e) {
|
|
|
4074
4074
|
} else
|
|
4075
4075
|
return e;
|
|
4076
4076
|
}
|
|
4077
|
-
function
|
|
4077
|
+
function $c(n, e, t) {
|
|
4078
4078
|
var i, o;
|
|
4079
4079
|
const r = (i = e == null ? void 0 : e.state) == null ? void 0 : i.txId, s = (o = t == null ? void 0 : t.state) == null ? void 0 : o.txId;
|
|
4080
4080
|
return r && (!s || r > s) ? e : s && (!r || s > r) ? t : e || t;
|
|
4081
4081
|
}
|
|
4082
4082
|
function yn(n, e, t) {
|
|
4083
|
-
return
|
|
4083
|
+
return qs({ store: e, attrsStore: t, pageInfo: null, aggregate: null }, n.query).data[n.table][0];
|
|
4084
4084
|
}
|
|
4085
4085
|
function Zr(n, e, t, r) {
|
|
4086
4086
|
var o;
|
|
@@ -4094,14 +4094,14 @@ function Xr(n, e, t) {
|
|
|
4094
4094
|
for (const { action: r, triple: s } of t)
|
|
4095
4095
|
switch (r) {
|
|
4096
4096
|
case "added":
|
|
4097
|
-
|
|
4097
|
+
Rs(n, e, s);
|
|
4098
4098
|
break;
|
|
4099
4099
|
case "removed":
|
|
4100
|
-
|
|
4100
|
+
Ps(n, e, s);
|
|
4101
4101
|
break;
|
|
4102
4102
|
}
|
|
4103
4103
|
}
|
|
4104
|
-
function
|
|
4104
|
+
function Dc(n, e, t) {
|
|
4105
4105
|
var s, i;
|
|
4106
4106
|
const r = {};
|
|
4107
4107
|
for (const { action: o, triple: a } of t) {
|
|
@@ -4129,14 +4129,14 @@ function $c(n, e, t) {
|
|
|
4129
4129
|
function jt(n, e) {
|
|
4130
4130
|
return { [n.table]: e.map((t) => t.entity) };
|
|
4131
4131
|
}
|
|
4132
|
-
function
|
|
4132
|
+
function Uc(n, e) {
|
|
4133
4133
|
var r;
|
|
4134
4134
|
if (n.orderFieldType)
|
|
4135
4135
|
return n.orderFieldType;
|
|
4136
4136
|
const t = n.orderField === "serverCreatedAt" ? "number" : (r = se(e(), n.table, n.orderField)) == null ? void 0 : r["checked-data-type"];
|
|
4137
4137
|
return n.orderFieldType = t, t;
|
|
4138
4138
|
}
|
|
4139
|
-
function
|
|
4139
|
+
function Lc(n, e, t) {
|
|
4140
4140
|
const r = e;
|
|
4141
4141
|
if (n.orderField === "serverCreatedAt") {
|
|
4142
4142
|
t.sort(n.orderDirection === "asc" ? function(o, a) {
|
|
@@ -4157,7 +4157,7 @@ var Ue;
|
|
|
4157
4157
|
(function(n) {
|
|
4158
4158
|
n.InitialSyncBatch = "InitialSyncBatch", n.InitialSyncComplete = "InitialSyncComplete", n.LoadFromStorage = "LoadFromStorage", n.SyncTransaction = "SyncTransaction", n.Error = "Error";
|
|
4159
4159
|
})(Ue || (Ue = {}));
|
|
4160
|
-
class
|
|
4160
|
+
class Fc {
|
|
4161
4161
|
constructor(e, t, r, s, i, o) {
|
|
4162
4162
|
p(this, "trySend");
|
|
4163
4163
|
p(this, "subs");
|
|
@@ -4170,9 +4170,9 @@ class Lc {
|
|
|
4170
4170
|
p(this, "getAttrs");
|
|
4171
4171
|
this.trySend = e, this.config = r, this.log = s, this.createStore = i, this.getAttrs = o, this.subs = new Dn({
|
|
4172
4172
|
persister: t,
|
|
4173
|
-
merge:
|
|
4174
|
-
serialize:
|
|
4175
|
-
parse: (a, c) =>
|
|
4173
|
+
merge: $c,
|
|
4174
|
+
serialize: xc,
|
|
4175
|
+
parse: (a, c) => jc(c, this.config.useDateObjects),
|
|
4176
4176
|
objectSize: (a) => {
|
|
4177
4177
|
var c;
|
|
4178
4178
|
return ((c = a.values) == null ? void 0 : c.entities.length) || 0;
|
|
@@ -4367,9 +4367,9 @@ class Lc {
|
|
|
4367
4367
|
e: for (const [m, T] of Object.entries(u))
|
|
4368
4368
|
for (let _ = 0; _ < f.length; _++) {
|
|
4369
4369
|
const w = f[_];
|
|
4370
|
-
if (
|
|
4370
|
+
if (go(w.store, m)) {
|
|
4371
4371
|
Xr(w.store, l.attrsStore, T);
|
|
4372
|
-
const C = yn(s, w.store, l.attrsStore), v =
|
|
4372
|
+
const C = yn(s, w.store, l.attrsStore), v = Dc(w.store, l.attrsStore, T)[m];
|
|
4373
4373
|
C ? (d.push({
|
|
4374
4374
|
oldEntity: w.entity,
|
|
4375
4375
|
newEntity: C,
|
|
@@ -4400,8 +4400,8 @@ class Lc {
|
|
|
4400
4400
|
const b = [];
|
|
4401
4401
|
for (const m of c.sort().reverse())
|
|
4402
4402
|
b.push(f[m].entity), f.splice(m, 1);
|
|
4403
|
-
const g =
|
|
4404
|
-
|
|
4403
|
+
const g = Uc(s, this.getAttrs);
|
|
4404
|
+
Lc(s, g, f), this.notifyCbs(r, {
|
|
4405
4405
|
type: Ue.SyncTransaction,
|
|
4406
4406
|
data: jt(s, (o = s.values) == null ? void 0 : o.entities),
|
|
4407
4407
|
added: y,
|
|
@@ -4442,7 +4442,7 @@ class Lc {
|
|
|
4442
4442
|
r && this.initSubscription(r.query, r.hash);
|
|
4443
4443
|
}
|
|
4444
4444
|
}
|
|
4445
|
-
function
|
|
4445
|
+
function Nc({ WStream: n, opts: e, startStream: t, appendStream: r, registerStream: s }) {
|
|
4446
4446
|
const i = e.clientId;
|
|
4447
4447
|
let o = null, a = null, c = null;
|
|
4448
4448
|
const u = Z();
|
|
@@ -4641,7 +4641,7 @@ function Fc({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
|
|
|
4641
4641
|
}
|
|
4642
4642
|
};
|
|
4643
4643
|
}
|
|
4644
|
-
class
|
|
4644
|
+
class Kc {
|
|
4645
4645
|
constructor() {
|
|
4646
4646
|
p(this, "items", []);
|
|
4647
4647
|
p(this, "resolvers", []);
|
|
@@ -4675,7 +4675,7 @@ class Nc {
|
|
|
4675
4675
|
}
|
|
4676
4676
|
}
|
|
4677
4677
|
}
|
|
4678
|
-
function
|
|
4678
|
+
function Wc({ RStream: n, opts: e, startStream: t, cancelStream: r }) {
|
|
4679
4679
|
let s = e.byteOffset || 0, i = !1;
|
|
4680
4680
|
const o = new TextDecoder("utf-8"), a = new TextEncoder();
|
|
4681
4681
|
let c, u = !1;
|
|
@@ -4833,7 +4833,7 @@ function Kc({ RStream: n, opts: e, startStream: t, cancelStream: r }) {
|
|
|
4833
4833
|
}
|
|
4834
4834
|
};
|
|
4835
4835
|
}
|
|
4836
|
-
class
|
|
4836
|
+
class qc {
|
|
4837
4837
|
constructor({ WStream: e, RStream: t, trySend: r, log: s }) {
|
|
4838
4838
|
p(this, "trySend");
|
|
4839
4839
|
p(this, "WStream");
|
|
@@ -4846,7 +4846,7 @@ class Wc {
|
|
|
4846
4846
|
this.WStream = e, this.RStream = t, this.trySend = r, this.log = s;
|
|
4847
4847
|
}
|
|
4848
4848
|
createWriteStream(e) {
|
|
4849
|
-
const { stream: t, addCompleteCb: r } =
|
|
4849
|
+
const { stream: t, addCompleteCb: r } = Nc({
|
|
4850
4850
|
WStream: this.WStream,
|
|
4851
4851
|
startStream: this.startWriteStream.bind(this),
|
|
4852
4852
|
appendStream: this.appendStream.bind(this),
|
|
@@ -4858,7 +4858,7 @@ class Wc {
|
|
|
4858
4858
|
}), t;
|
|
4859
4859
|
}
|
|
4860
4860
|
createReadStream(e) {
|
|
4861
|
-
const { stream: t, addCloseCb: r } =
|
|
4861
|
+
const { stream: t, addCloseCb: r } = Wc({
|
|
4862
4862
|
RStream: this.RStream,
|
|
4863
4863
|
opts: e,
|
|
4864
4864
|
startStream: this.startReadStream.bind(this),
|
|
@@ -4920,7 +4920,7 @@ class Wc {
|
|
|
4920
4920
|
if (!r && !t)
|
|
4921
4921
|
throw new Error("Must provide one of streamId or clientId to subscribe to the stream.");
|
|
4922
4922
|
r && (o["stream-id"] = r), t && (o["client-id"] = t), s && (o.offset = s), i && (o["rule-params"] = i);
|
|
4923
|
-
const a = new
|
|
4923
|
+
const a = new Kc();
|
|
4924
4924
|
return this.readStreamIterators[e] = a, this.trySend(e, o), a;
|
|
4925
4925
|
}
|
|
4926
4926
|
cancelReadStream({ eventId: e }) {
|
|
@@ -5001,23 +5001,23 @@ const Ce = {
|
|
|
5001
5001
|
AUTHENTICATED: "authenticated",
|
|
5002
5002
|
CLOSED: "closed",
|
|
5003
5003
|
ERRORED: "errored"
|
|
5004
|
-
},
|
|
5004
|
+
}, zc = 3e4, Vc = 3e4, Qc = 200, Bc = 1e3 * 60, Gc = {
|
|
5005
5005
|
apiURI: "https://api.instantdb.com",
|
|
5006
5006
|
websocketURI: "wss://api.instantdb.com/runtime/session"
|
|
5007
5007
|
}, bn = "_instant_oauth_redirect", gn = "_instant_extra_fields_id", xt = "oauthExtraFields", Ge = "currentUser";
|
|
5008
|
-
function
|
|
5008
|
+
function Hc({ transportType: n, appId: e, apiURI: t, wsURI: r, EventSourceImpl: s }) {
|
|
5009
5009
|
if (!s)
|
|
5010
5010
|
return new Yr(`${r}?app_id=${e}`);
|
|
5011
5011
|
switch (n) {
|
|
5012
5012
|
case "ws":
|
|
5013
5013
|
return new Yr(`${r}?app_id=${e}`);
|
|
5014
5014
|
case "sse":
|
|
5015
|
-
return new
|
|
5015
|
+
return new Rc(s, `${t}/runtime/sse?app_id=${e}`);
|
|
5016
5016
|
default:
|
|
5017
5017
|
throw new Error("Unknown transport type " + n);
|
|
5018
5018
|
}
|
|
5019
5019
|
}
|
|
5020
|
-
function
|
|
5020
|
+
function Jc() {
|
|
5021
5021
|
return typeof window < "u" || typeof chrome < "u";
|
|
5022
5022
|
}
|
|
5023
5023
|
const es = {
|
|
@@ -5026,14 +5026,14 @@ const es = {
|
|
|
5026
5026
|
"refresh-presence": !0,
|
|
5027
5027
|
"patch-presence": !0
|
|
5028
5028
|
};
|
|
5029
|
-
function
|
|
5029
|
+
function Yc(n, e) {
|
|
5030
5030
|
var r;
|
|
5031
5031
|
const t = typeof n == "string" ? JSON.parse(n) : n;
|
|
5032
5032
|
if ((r = t == null ? void 0 : t.result) != null && r.store) {
|
|
5033
|
-
const s =
|
|
5033
|
+
const s = Is(t.result.attrsStore, t.result.store);
|
|
5034
5034
|
if (s) {
|
|
5035
5035
|
const i = t.result.store;
|
|
5036
|
-
t.result.store =
|
|
5036
|
+
t.result.store = Cs(s, {
|
|
5037
5037
|
...i,
|
|
5038
5038
|
useDateObjects: e
|
|
5039
5039
|
}), t.result.attrsStore = s;
|
|
@@ -5041,7 +5041,7 @@ function Jc(n, e) {
|
|
|
5041
5041
|
}
|
|
5042
5042
|
return t;
|
|
5043
5043
|
}
|
|
5044
|
-
function
|
|
5044
|
+
function Zc(n, e) {
|
|
5045
5045
|
const { result: t, ...r } = e, s = (
|
|
5046
5046
|
/** @type {import('./reactorTypes.ts').QuerySubInStorage} */
|
|
5047
5047
|
r
|
|
@@ -5049,14 +5049,14 @@ function Yc(n, e) {
|
|
|
5049
5049
|
if (t) {
|
|
5050
5050
|
const i = {
|
|
5051
5051
|
...t,
|
|
5052
|
-
store:
|
|
5052
|
+
store: As(t.store),
|
|
5053
5053
|
attrsStore: t.attrsStore.toJSON()
|
|
5054
5054
|
};
|
|
5055
5055
|
s.result = i;
|
|
5056
5056
|
}
|
|
5057
5057
|
return s;
|
|
5058
5058
|
}
|
|
5059
|
-
function
|
|
5059
|
+
function Xc(n, e) {
|
|
5060
5060
|
switch (n) {
|
|
5061
5061
|
case "pendingMutations":
|
|
5062
5062
|
return new Map(typeof e == "string" ? JSON.parse(e) : e);
|
|
@@ -5064,7 +5064,7 @@ function Zc(n, e) {
|
|
|
5064
5064
|
return e;
|
|
5065
5065
|
}
|
|
5066
5066
|
}
|
|
5067
|
-
function
|
|
5067
|
+
function eu(n, e) {
|
|
5068
5068
|
switch (n) {
|
|
5069
5069
|
case "pendingMutations":
|
|
5070
5070
|
return [...e.entries()];
|
|
@@ -5072,7 +5072,7 @@ function Xc(n, e) {
|
|
|
5072
5072
|
return e;
|
|
5073
5073
|
}
|
|
5074
5074
|
}
|
|
5075
|
-
function
|
|
5075
|
+
function tu(n, e, t) {
|
|
5076
5076
|
const r = e == null ? void 0 : e.result, s = t == null ? void 0 : t.result;
|
|
5077
5077
|
return r && !s && t && (t.result = r), t || e;
|
|
5078
5078
|
}
|
|
@@ -5082,8 +5082,8 @@ function _n(n) {
|
|
|
5082
5082
|
return a == c ? r < i ? -1 : r > i ? 1 : 0 : a - c;
|
|
5083
5083
|
});
|
|
5084
5084
|
}
|
|
5085
|
-
class
|
|
5086
|
-
constructor(e, t =
|
|
5085
|
+
class nu {
|
|
5086
|
+
constructor(e, t = Qs, r = Bs, s, i) {
|
|
5087
5087
|
/** @type {s.AttrsStore | undefined} */
|
|
5088
5088
|
p(this, "attrs");
|
|
5089
5089
|
p(this, "_isOnline", !0);
|
|
@@ -5181,9 +5181,9 @@ class tu {
|
|
|
5181
5181
|
});
|
|
5182
5182
|
/** Applies transactions locally and sends transact message to server */
|
|
5183
5183
|
p(this, "pushTx", (e) => {
|
|
5184
|
-
this.config.disableValidation ||
|
|
5184
|
+
this.config.disableValidation || Mc(e, this.config.schema);
|
|
5185
5185
|
try {
|
|
5186
|
-
const t =
|
|
5186
|
+
const t = tc({
|
|
5187
5187
|
attrsStore: this.optimisticAttrs(),
|
|
5188
5188
|
schema: this.config.schema,
|
|
5189
5189
|
stores: Object.values(this.querySubs.currentValue).map((r) => {
|
|
@@ -5284,7 +5284,7 @@ class tu {
|
|
|
5284
5284
|
}
|
|
5285
5285
|
this._log.info("[socket][close]", t.id, "schedule reconnect, ms =", this._reconnectTimeoutMs), this._scheduleReconnect();
|
|
5286
5286
|
});
|
|
5287
|
-
if (this._EventSource = i, this.config = { ...
|
|
5287
|
+
if (this._EventSource = i, this.config = { ...Gc, ...e }, this.queryCacheLimit = this.config.queryCacheLimit ?? 10, this._pendingTxCleanupTimeout = this.config.pendingTxCleanupTimeout ?? Vc, this._pendingMutationCleanupThreshold = this.config.pendingMutationCleanupThreshold ?? Qc, this._log = Tc(e.verbose || or || Gs, () => this._reactorStats()), this.versions = { ...s || {}, "@instantdb/core": ar }, this.config.schema && (this._linkIndex = Qr(this.config.schema)), !!Jc()) {
|
|
5288
5288
|
if (!e.appId)
|
|
5289
5289
|
throw new Error("Instant must be initialized with an appId.");
|
|
5290
5290
|
if (!it(e.appId))
|
|
@@ -5303,9 +5303,9 @@ class tu {
|
|
|
5303
5303
|
} catch (c) {
|
|
5304
5304
|
this._log.error("[error] handle broadcast channel", c);
|
|
5305
5305
|
}
|
|
5306
|
-
})), this._initStorage(t), this._syncTable = new
|
|
5306
|
+
})), this._initStorage(t), this._syncTable = new Fc(this._trySendAuthed.bind(this), new t(this.config.appId, "syncSubs"), {
|
|
5307
5307
|
useDateObjects: this.config.useDateObjects
|
|
5308
|
-
}, this._log, (o) => yt(this.ensureAttrs(), o, this.config.enableCardinalityInference, this.config.useDateObjects), () => this.ensureAttrs()), this._instantStream = new
|
|
5308
|
+
}, this._log, (o) => yt(this.ensureAttrs(), o, this.config.enableCardinalityInference, this.config.useDateObjects), () => this.ensureAttrs()), this._instantStream = new qc({
|
|
5309
5309
|
WStream: this.config.WritableStream || WritableStream,
|
|
5310
5310
|
RStream: this.config.ReadableStream || ReadableStream,
|
|
5311
5311
|
trySend: this._trySendAuthed.bind(this),
|
|
@@ -5315,7 +5315,7 @@ class tu {
|
|
|
5315
5315
|
}), setInterval(async () => {
|
|
5316
5316
|
const o = await this.getCurrentUser();
|
|
5317
5317
|
this.syncUserToEndpoint(o.user);
|
|
5318
|
-
},
|
|
5318
|
+
}, Bc), r.getIsOnline().then((o) => {
|
|
5319
5319
|
this._isOnline = o, this._startSocket(), r.listen((a) => {
|
|
5320
5320
|
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", Ce.CLOSED), this._setStatus(Ce.CLOSED)));
|
|
5321
5321
|
});
|
|
@@ -5354,9 +5354,9 @@ class tu {
|
|
|
5354
5354
|
_initStorage(e) {
|
|
5355
5355
|
this.querySubs = new Dn({
|
|
5356
5356
|
persister: new e(this.config.appId, "querySubs"),
|
|
5357
|
-
merge:
|
|
5358
|
-
serialize:
|
|
5359
|
-
parse: (t, r) =>
|
|
5357
|
+
merge: tu,
|
|
5358
|
+
serialize: Zc,
|
|
5359
|
+
parse: (t, r) => Yc(r, this.config.useDateObjects),
|
|
5360
5360
|
// objectSize
|
|
5361
5361
|
objectSize: (t) => {
|
|
5362
5362
|
var r, s, i;
|
|
@@ -5375,8 +5375,8 @@ class tu {
|
|
|
5375
5375
|
}), this.querySubs.onKeyLoaded = (t) => this._onQuerySubLoaded(t), this.kv = new Dn({
|
|
5376
5376
|
persister: new e(this.config.appId, "kv"),
|
|
5377
5377
|
merge: this._onMergeKv,
|
|
5378
|
-
serialize:
|
|
5379
|
-
parse:
|
|
5378
|
+
serialize: eu,
|
|
5379
|
+
parse: Xc,
|
|
5380
5380
|
objectSize: () => 0,
|
|
5381
5381
|
logger: this._log,
|
|
5382
5382
|
saveThrottleMs: 100,
|
|
@@ -5771,7 +5771,7 @@ class tu {
|
|
|
5771
5771
|
if (!this.querySubs)
|
|
5772
5772
|
return r.reject(new Error("We can't run `queryOnce` on the backend. Use adminAPI.query instead: https://www.instantdb.com/docs/backend#query")), r.promise;
|
|
5773
5773
|
const s = ce(e), i = this._startQuerySub(e, s);
|
|
5774
|
-
return this.queryOnceDfds[s] = this.queryOnceDfds[s] ?? [], this.queryOnceDfds[s].push({ q: e, dfd: r, eventId: i }), setTimeout(() => r.reject(new Error("Query timed out")),
|
|
5774
|
+
return this.queryOnceDfds[s] = this.queryOnceDfds[s] ?? [], this.queryOnceDfds[s].push({ q: e, dfd: r, eventId: i }), setTimeout(() => r.reject(new Error("Query timed out")), zc), r.promise;
|
|
5775
5775
|
}
|
|
5776
5776
|
_completeQueryOnce(e, t, r) {
|
|
5777
5777
|
this.queryOnceDfds[t] && (this.queryOnceDfds[t] = this.queryOnceDfds[t].filter((s) => s.dfd !== r), this._cleanupQuery(e, t));
|
|
@@ -5838,7 +5838,7 @@ class tu {
|
|
|
5838
5838
|
a = !0;
|
|
5839
5839
|
continue;
|
|
5840
5840
|
}
|
|
5841
|
-
const g = a ?
|
|
5841
|
+
const g = a ? Pa(o, y) : y;
|
|
5842
5842
|
d.push(g);
|
|
5843
5843
|
}
|
|
5844
5844
|
return a ? d : l;
|
|
@@ -5896,12 +5896,12 @@ class tu {
|
|
|
5896
5896
|
const _ = this._applyOptimisticUpdates(f, d, m, g);
|
|
5897
5897
|
f = _.store, d = _.attrsStore;
|
|
5898
5898
|
}
|
|
5899
|
-
return { data:
|
|
5899
|
+
return { data: qs({ store: f, attrsStore: d, pageInfo: y, aggregate: b }, c), querySubVersion: s, pendingMutationsVersion: o };
|
|
5900
5900
|
}
|
|
5901
5901
|
_applyOptimisticUpdates(e, t, r, s) {
|
|
5902
5902
|
for (const [i, o] of r)
|
|
5903
5903
|
if (!o["tx-id"] || s && o["tx-id"] > s) {
|
|
5904
|
-
const a =
|
|
5904
|
+
const a = Io(e, t, o["tx-steps"]);
|
|
5905
5905
|
e = a.store, t = a.attrsStore;
|
|
5906
5906
|
}
|
|
5907
5907
|
return { store: e, attrsStore: t };
|
|
@@ -6019,7 +6019,7 @@ class tu {
|
|
|
6019
6019
|
return;
|
|
6020
6020
|
}
|
|
6021
6021
|
const e = this._transport;
|
|
6022
|
-
this._transport =
|
|
6022
|
+
this._transport = Hc({
|
|
6023
6023
|
transportType: this._transportType,
|
|
6024
6024
|
appId: this.config.appId,
|
|
6025
6025
|
apiURI: this.config.apiURI,
|
|
@@ -6253,7 +6253,7 @@ class tu {
|
|
|
6253
6253
|
}), this._reconnectTimeoutMs = 0, this._transport.close(), this._oauthCallbackResponse = null, this.notifyAuthSubs(t);
|
|
6254
6254
|
}
|
|
6255
6255
|
sendMagicCode({ email: e }) {
|
|
6256
|
-
return
|
|
6256
|
+
return uc({
|
|
6257
6257
|
apiURI: this.config.apiURI,
|
|
6258
6258
|
appId: this.config.appId,
|
|
6259
6259
|
email: e
|
|
@@ -6261,7 +6261,7 @@ class tu {
|
|
|
6261
6261
|
}
|
|
6262
6262
|
async signInWithMagicCode(e) {
|
|
6263
6263
|
var i, o;
|
|
6264
|
-
const t = await this.getCurrentUser(), r = ((i = t == null ? void 0 : t.user) == null ? void 0 : i.type) === "guest", s = await
|
|
6264
|
+
const t = await this.getCurrentUser(), r = ((i = t == null ? void 0 : t.user) == null ? void 0 : i.type) === "guest", s = await lc({
|
|
6265
6265
|
apiURI: this.config.apiURI,
|
|
6266
6266
|
appId: this.config.appId,
|
|
6267
6267
|
email: e.email,
|
|
@@ -6272,7 +6272,7 @@ class tu {
|
|
|
6272
6272
|
return await this.changeCurrentUser(s.user), s;
|
|
6273
6273
|
}
|
|
6274
6274
|
async signInWithCustomToken(e) {
|
|
6275
|
-
const t = await
|
|
6275
|
+
const t = await fc({
|
|
6276
6276
|
apiURI: this.config.apiURI,
|
|
6277
6277
|
appId: this.config.appId,
|
|
6278
6278
|
refreshToken: e
|
|
@@ -6280,7 +6280,7 @@ class tu {
|
|
|
6280
6280
|
return await this.changeCurrentUser(t.user), t;
|
|
6281
6281
|
}
|
|
6282
6282
|
async signInAsGuest() {
|
|
6283
|
-
const e = await
|
|
6283
|
+
const e = await dc({
|
|
6284
6284
|
apiURI: this.config.apiURI,
|
|
6285
6285
|
appId: this.config.appId
|
|
6286
6286
|
});
|
|
@@ -6295,7 +6295,7 @@ class tu {
|
|
|
6295
6295
|
this._log.info("[auth-invalidate] skipped invalidateToken");
|
|
6296
6296
|
return;
|
|
6297
6297
|
}
|
|
6298
|
-
|
|
6298
|
+
pc({
|
|
6299
6299
|
apiURI: this.config.apiURI,
|
|
6300
6300
|
appId: this.config.appId,
|
|
6301
6301
|
refreshToken: r
|
|
@@ -6360,7 +6360,7 @@ class tu {
|
|
|
6360
6360
|
*/
|
|
6361
6361
|
async signInWithIdToken(e) {
|
|
6362
6362
|
var i;
|
|
6363
|
-
const t = await this.getCurrentUser(), r = (i = t == null ? void 0 : t.user) == null ? void 0 : i.refresh_token, s = await
|
|
6363
|
+
const t = await this.getCurrentUser(), r = (i = t == null ? void 0 : t.user) == null ? void 0 : i.refresh_token, s = await hc({
|
|
6364
6364
|
apiURI: this.config.apiURI,
|
|
6365
6365
|
appId: this.config.appId,
|
|
6366
6366
|
idToken: e.idToken,
|
|
@@ -6404,7 +6404,7 @@ class tu {
|
|
|
6404
6404
|
getPresence(e, t, r = {}) {
|
|
6405
6405
|
const s = this._rooms[t], i = this._presence[t];
|
|
6406
6406
|
return !s || !i || !i.result ? null : {
|
|
6407
|
-
...
|
|
6407
|
+
...wc(i.result, r, this._sessionId),
|
|
6408
6408
|
isLoading: !s.isConnected,
|
|
6409
6409
|
error: s.error
|
|
6410
6410
|
};
|
|
@@ -6466,7 +6466,7 @@ class tu {
|
|
|
6466
6466
|
}
|
|
6467
6467
|
_notifyPresenceSub(e, t) {
|
|
6468
6468
|
const r = this.getPresence("", e, t);
|
|
6469
|
-
r && (t.prev && !
|
|
6469
|
+
r && (t.prev && !Sc(r, t.prev) || (t.prev = r, t.cb(r)));
|
|
6470
6470
|
}
|
|
6471
6471
|
_patchPresencePeers(e, t) {
|
|
6472
6472
|
var o, a, c;
|
|
@@ -6477,13 +6477,13 @@ class tu {
|
|
|
6477
6477
|
for (let [l, f, d] of t)
|
|
6478
6478
|
switch (f) {
|
|
6479
6479
|
case "+":
|
|
6480
|
-
|
|
6480
|
+
Ji(u, l, d);
|
|
6481
6481
|
break;
|
|
6482
6482
|
case "r":
|
|
6483
6483
|
Ir(u, l, d);
|
|
6484
6484
|
break;
|
|
6485
6485
|
case "-":
|
|
6486
|
-
|
|
6486
|
+
Os(u, l);
|
|
6487
6487
|
break;
|
|
6488
6488
|
}
|
|
6489
6489
|
delete u[this._sessionId];
|
|
@@ -6538,7 +6538,7 @@ class tu {
|
|
|
6538
6538
|
async uploadFile(e, t, r) {
|
|
6539
6539
|
var o;
|
|
6540
6540
|
const s = await this.getCurrentUser(), i = (o = s == null ? void 0 : s.user) == null ? void 0 : o.refresh_token;
|
|
6541
|
-
return
|
|
6541
|
+
return yc({
|
|
6542
6542
|
...r,
|
|
6543
6543
|
apiURI: this.config.apiURI,
|
|
6544
6544
|
appId: this.config.appId,
|
|
@@ -6550,7 +6550,7 @@ class tu {
|
|
|
6550
6550
|
async deleteFile(e) {
|
|
6551
6551
|
var i;
|
|
6552
6552
|
const t = await this.getCurrentUser(), r = (i = t == null ? void 0 : t.user) == null ? void 0 : i.refresh_token;
|
|
6553
|
-
return await
|
|
6553
|
+
return await bc({
|
|
6554
6554
|
apiURI: this.config.apiURI,
|
|
6555
6555
|
appId: this.config.appId,
|
|
6556
6556
|
path: e,
|
|
@@ -6561,18 +6561,18 @@ class tu {
|
|
|
6561
6561
|
// ---------------------------------
|
|
6562
6562
|
async upload(e, t) {
|
|
6563
6563
|
var c;
|
|
6564
|
-
const r = await this.getCurrentUser(), s = (c = r == null ? void 0 : r.user) == null ? void 0 : c.refresh_token, i = e || t.name, o = await
|
|
6564
|
+
const r = await this.getCurrentUser(), s = (c = r == null ? void 0 : r.user) == null ? void 0 : c.refresh_token, i = e || t.name, o = await gc({
|
|
6565
6565
|
apiURI: this.config.apiURI,
|
|
6566
6566
|
appId: this.config.appId,
|
|
6567
6567
|
fileName: i,
|
|
6568
6568
|
refreshToken: s
|
|
6569
6569
|
});
|
|
6570
|
-
return await
|
|
6570
|
+
return await _c(o, t);
|
|
6571
6571
|
}
|
|
6572
6572
|
async getDownloadUrl(e) {
|
|
6573
6573
|
var i;
|
|
6574
6574
|
const t = await this.getCurrentUser(), r = (i = t == null ? void 0 : t.user) == null ? void 0 : i.refresh_token;
|
|
6575
|
-
return await
|
|
6575
|
+
return await mc({
|
|
6576
6576
|
apiURI: this.config.apiURI,
|
|
6577
6577
|
appId: this.config.appId,
|
|
6578
6578
|
path: e,
|
|
@@ -6580,9 +6580,9 @@ class tu {
|
|
|
6580
6580
|
});
|
|
6581
6581
|
}
|
|
6582
6582
|
}
|
|
6583
|
-
function
|
|
6583
|
+
function ru(n, e) {
|
|
6584
6584
|
return new nn(
|
|
6585
|
-
|
|
6585
|
+
ri(n, e),
|
|
6586
6586
|
// (XXX): LinksDef<any> stems from TypeScript’s inability to reconcile the
|
|
6587
6587
|
// type EntitiesWithLinks<EntitiesWithoutLinks, Links> with
|
|
6588
6588
|
// EntitiesWithoutLinks. TypeScript is strict about ensuring that types are
|
|
@@ -6592,28 +6592,28 @@ function nu(n, e) {
|
|
|
6592
6592
|
void 0
|
|
6593
6593
|
);
|
|
6594
6594
|
}
|
|
6595
|
-
function
|
|
6595
|
+
function su(n) {
|
|
6596
6596
|
return new tn(n, {});
|
|
6597
6597
|
}
|
|
6598
|
-
function
|
|
6598
|
+
function iu() {
|
|
6599
6599
|
return new he("string", !0, !1);
|
|
6600
6600
|
}
|
|
6601
|
-
function
|
|
6601
|
+
function ou() {
|
|
6602
6602
|
return new he("number", !0, !1);
|
|
6603
6603
|
}
|
|
6604
|
-
function
|
|
6604
|
+
function au() {
|
|
6605
6605
|
return new he("boolean", !0, !1);
|
|
6606
6606
|
}
|
|
6607
|
-
function
|
|
6607
|
+
function cu() {
|
|
6608
6608
|
return new he("date", !0, !1);
|
|
6609
6609
|
}
|
|
6610
|
-
function
|
|
6610
|
+
function uu() {
|
|
6611
6611
|
return new he("json", !0, !1);
|
|
6612
6612
|
}
|
|
6613
|
-
function
|
|
6613
|
+
function lu() {
|
|
6614
6614
|
return new he("json", !0, !1);
|
|
6615
6615
|
}
|
|
6616
|
-
function
|
|
6616
|
+
function ri(n, e) {
|
|
6617
6617
|
var s, i, o, a;
|
|
6618
6618
|
const t = { fwd: {}, rev: {} };
|
|
6619
6619
|
for (const c of Object.values(e))
|
|
@@ -6632,10 +6632,10 @@ function ni(n, e) {
|
|
|
6632
6632
|
})
|
|
6633
6633
|
]));
|
|
6634
6634
|
}
|
|
6635
|
-
function
|
|
6635
|
+
function fu({ entities: n, links: e, rooms: t }) {
|
|
6636
6636
|
const r = e ?? {}, s = t ?? {};
|
|
6637
6637
|
return new nn(
|
|
6638
|
-
|
|
6638
|
+
ri(n, r),
|
|
6639
6639
|
// (XXX): LinksDef<any> stems from TypeScript's inability to reconcile the
|
|
6640
6640
|
// type EntitiesWithLinks<EntitiesWithoutLinks, Links> with
|
|
6641
6641
|
// EntitiesWithoutLinks. TypeScript is strict about ensuring that types are
|
|
@@ -6647,21 +6647,21 @@ function lu({ entities: n, links: e, rooms: t }) {
|
|
|
6647
6647
|
}
|
|
6648
6648
|
const ul = {
|
|
6649
6649
|
// constructs
|
|
6650
|
-
graph:
|
|
6651
|
-
schema:
|
|
6652
|
-
entity:
|
|
6650
|
+
graph: ru,
|
|
6651
|
+
schema: fu,
|
|
6652
|
+
entity: su,
|
|
6653
6653
|
// value types
|
|
6654
|
-
string:
|
|
6655
|
-
number:
|
|
6656
|
-
boolean:
|
|
6657
|
-
date:
|
|
6658
|
-
json:
|
|
6659
|
-
any:
|
|
6654
|
+
string: iu,
|
|
6655
|
+
number: ou,
|
|
6656
|
+
boolean: au,
|
|
6657
|
+
date: cu,
|
|
6658
|
+
json: uu,
|
|
6659
|
+
any: lu
|
|
6660
6660
|
};
|
|
6661
6661
|
let $t;
|
|
6662
|
-
function
|
|
6662
|
+
function du(n, e) {
|
|
6663
6663
|
$t == null || $t.dispose();
|
|
6664
|
-
const t =
|
|
6664
|
+
const t = _u(e), r = yu(e, a), s = pu(hu(n));
|
|
6665
6665
|
function i(l) {
|
|
6666
6666
|
var f;
|
|
6667
6667
|
l.source === s.element.contentWindow && ((f = l.data) == null ? void 0 : f.type) === "close" && t.isVisible() && a();
|
|
@@ -6683,10 +6683,10 @@ function fu(n, e) {
|
|
|
6683
6683
|
}
|
|
6684
6684
|
return u();
|
|
6685
6685
|
}
|
|
6686
|
-
function du(n) {
|
|
6687
|
-
return `${or || Gs ? "http://localhost:3000" : "https://instantdb.com"}/_devtool?appId=${n}`;
|
|
6688
|
-
}
|
|
6689
6686
|
function hu(n) {
|
|
6687
|
+
return `${or || Hs ? "http://localhost:3000" : "https://instantdb.com"}/_devtool?appId=${n}`;
|
|
6688
|
+
}
|
|
6689
|
+
function pu(n) {
|
|
6690
6690
|
const e = document.createElement("iframe");
|
|
6691
6691
|
return e.src = n, e.className = "instant-devtool-iframe", Object.assign(e.style, {
|
|
6692
6692
|
width: "100%",
|
|
@@ -6695,7 +6695,7 @@ function hu(n) {
|
|
|
6695
6695
|
border: "none"
|
|
6696
6696
|
}), { element: e };
|
|
6697
6697
|
}
|
|
6698
|
-
function
|
|
6698
|
+
function yu(n, e) {
|
|
6699
6699
|
const t = `
|
|
6700
6700
|
<svg width="32" height="32" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6701
6701
|
<rect width="512" height="512" fill="black"/>
|
|
@@ -6705,7 +6705,7 @@ function pu(n, e) {
|
|
|
6705
6705
|
return r.innerHTML = t, r.className = "instant-devtool-toggler", Object.assign(r.style, {
|
|
6706
6706
|
// pos
|
|
6707
6707
|
position: "fixed",
|
|
6708
|
-
...
|
|
6708
|
+
...bu(n.position),
|
|
6709
6709
|
height: "32px",
|
|
6710
6710
|
width: "32px",
|
|
6711
6711
|
// layout
|
|
@@ -6720,7 +6720,7 @@ function pu(n, e) {
|
|
|
6720
6720
|
cursor: "pointer"
|
|
6721
6721
|
}), r.addEventListener("click", e), { element: r };
|
|
6722
6722
|
}
|
|
6723
|
-
function
|
|
6723
|
+
function bu(n) {
|
|
6724
6724
|
switch (n) {
|
|
6725
6725
|
case "bottom-left":
|
|
6726
6726
|
return { bottom: "24px", left: "24px" };
|
|
@@ -6732,7 +6732,7 @@ function yu(n) {
|
|
|
6732
6732
|
return { top: "24px", left: "24px" };
|
|
6733
6733
|
}
|
|
6734
6734
|
}
|
|
6735
|
-
function
|
|
6735
|
+
function gu(n) {
|
|
6736
6736
|
switch (n) {
|
|
6737
6737
|
case "bottom-left":
|
|
6738
6738
|
return { bottom: "24px", right: "24px", left: "60px", top: "72px" };
|
|
@@ -6744,11 +6744,11 @@ function bu(n) {
|
|
|
6744
6744
|
return { top: "24px", right: "24px", left: "60px", bottom: "72px" };
|
|
6745
6745
|
}
|
|
6746
6746
|
}
|
|
6747
|
-
function
|
|
6747
|
+
function _u(n) {
|
|
6748
6748
|
const e = document.createElement("div");
|
|
6749
6749
|
Object.assign(e.style, {
|
|
6750
6750
|
position: "fixed",
|
|
6751
|
-
...
|
|
6751
|
+
...gu(n.position),
|
|
6752
6752
|
display: "block",
|
|
6753
6753
|
borderRadius: "4px",
|
|
6754
6754
|
border: "1px #ccc solid",
|
|
@@ -6761,7 +6761,7 @@ function gu(n) {
|
|
|
6761
6761
|
}
|
|
6762
6762
|
return { element: e, isVisible: t };
|
|
6763
6763
|
}
|
|
6764
|
-
function
|
|
6764
|
+
function mu(n, e) {
|
|
6765
6765
|
return e && e.refresh_token ? new Response(JSON.stringify({ ok: !0 }), {
|
|
6766
6766
|
headers: {
|
|
6767
6767
|
"Content-Type": "application/json",
|
|
@@ -6796,7 +6796,7 @@ const ll = (n) => ({
|
|
|
6796
6796
|
return Dt(403, "App ID mismatch");
|
|
6797
6797
|
switch (t.type) {
|
|
6798
6798
|
case "sync-user":
|
|
6799
|
-
return
|
|
6799
|
+
return mu(n, t.user ?? null);
|
|
6800
6800
|
default:
|
|
6801
6801
|
return Dt(400, `Unknown type: ${t.type}`);
|
|
6802
6802
|
}
|
|
@@ -6806,10 +6806,10 @@ function lt(n, e) {
|
|
|
6806
6806
|
if (!n)
|
|
6807
6807
|
throw new Error("[assertion error] " + e);
|
|
6808
6808
|
}
|
|
6809
|
-
const
|
|
6809
|
+
const wu = (n) => JSON.stringify(n), gt = (n, e = !1) => JSON.stringify([n, e]), ts = (n) => {
|
|
6810
6810
|
const [e, t] = JSON.parse(n);
|
|
6811
6811
|
return { cursor: e, afterInclusive: t };
|
|
6812
|
-
}, He = (n, e, t = !1) => `${n}:${gt(e, t)}`,
|
|
6812
|
+
}, He = (n, e, t = !1) => `${n}:${gt(e, t)}`, Su = (n) => !!n.endCursor, Tu = (n) => {
|
|
6813
6813
|
var t;
|
|
6814
6814
|
const e = Array.from(n.values());
|
|
6815
6815
|
return e.length === 0 ? !1 : ((t = e[e.length - 1]) == null ? void 0 : t.hasMore) || !1;
|
|
@@ -6824,9 +6824,9 @@ const mu = (n) => JSON.stringify(n), gt = (n, e = !1) => JSON.stringify([n, e]),
|
|
|
6824
6824
|
} : {
|
|
6825
6825
|
serverCreatedAt: "asc"
|
|
6826
6826
|
};
|
|
6827
|
-
},
|
|
6827
|
+
}, si = (n) => n && Object.keys(n).length > 0 ? n : {
|
|
6828
6828
|
serverCreatedAt: "asc"
|
|
6829
|
-
},
|
|
6829
|
+
}, vu = (n, e) => {
|
|
6830
6830
|
const t = [
|
|
6831
6831
|
...Array.from(e.values()).slice().reverse(),
|
|
6832
6832
|
...Array.from(n.values())
|
|
@@ -6835,21 +6835,21 @@ const mu = (n) => JSON.stringify(n), gt = (n, e = !1) => JSON.stringify([n, e]),
|
|
|
6835
6835
|
...Array.from(n.values()).flatMap((s) => s.data)
|
|
6836
6836
|
];
|
|
6837
6837
|
return { chunks: t, data: r };
|
|
6838
|
-
}, mn = ["bootstrap", "bootstrap", "bootstrap", 1],
|
|
6838
|
+
}, mn = ["bootstrap", "bootstrap", "bootstrap", 1], Eu = (n, e, t, r) => {
|
|
6839
6839
|
var G, V, ne, q;
|
|
6840
|
-
const { entityName: s, entityQuery: i } =
|
|
6840
|
+
const { entityName: s, entityQuery: i } = ii(e), o = ((G = i.$) == null ? void 0 : G.limit) || 10, a = s, c = si((V = i.$) == null ? void 0 : V.order), u = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
|
|
6841
6841
|
let d = !1, y = !0, b = null, g = null;
|
|
6842
6842
|
const m = (k) => {
|
|
6843
6843
|
t({ error: k, data: void 0, canLoadNextPage: !1 });
|
|
6844
6844
|
}, T = () => {
|
|
6845
6845
|
if (!y)
|
|
6846
6846
|
return;
|
|
6847
|
-
const { chunks: k, data: j } =
|
|
6847
|
+
const { chunks: k, data: j } = vu(u, l);
|
|
6848
6848
|
t({
|
|
6849
6849
|
data: { [a]: j },
|
|
6850
6850
|
// @ts-expect-error hidden debug variable
|
|
6851
6851
|
chunks: k,
|
|
6852
|
-
canLoadNextPage:
|
|
6852
|
+
canLoadNextPage: Tu(u)
|
|
6853
6853
|
});
|
|
6854
6854
|
}, _ = (k, j) => {
|
|
6855
6855
|
u.set(gt(k, j.afterInclusive), j), T();
|
|
@@ -6973,9 +6973,9 @@ const mu = (n) => JSON.stringify(n), gt = (n, e = !1) => JSON.stringify([n, e]),
|
|
|
6973
6973
|
if (!k)
|
|
6974
6974
|
return;
|
|
6975
6975
|
const [j, R] = k;
|
|
6976
|
-
if (!(R != null && R.hasMore) || !
|
|
6976
|
+
if (!(R != null && R.hasMore) || !Su(R))
|
|
6977
6977
|
return;
|
|
6978
|
-
const F = `${j}:${
|
|
6978
|
+
const F = `${j}:${wu(R.endCursor)}`;
|
|
6979
6979
|
F != b && (b = F, C(j, R), v(R.endCursor));
|
|
6980
6980
|
}, H = () => {
|
|
6981
6981
|
const k = Array.from(u.entries()).at(-1);
|
|
@@ -7031,7 +7031,7 @@ const mu = (n) => JSON.stringify(n), gt = (n, e = !1) => JSON.stringify([n, e]),
|
|
|
7031
7031
|
},
|
|
7032
7032
|
loadNextPage: H
|
|
7033
7033
|
};
|
|
7034
|
-
},
|
|
7034
|
+
}, rs = (n, e, t) => {
|
|
7035
7035
|
var u, l, f, d;
|
|
7036
7036
|
if (!e)
|
|
7037
7037
|
return {
|
|
@@ -7039,8 +7039,8 @@ const mu = (n) => JSON.stringify(n), gt = (n, e = !1) => JSON.stringify([n, e]),
|
|
|
7039
7039
|
data: void 0,
|
|
7040
7040
|
error: void 0
|
|
7041
7041
|
};
|
|
7042
|
-
const { entityName: r, entityQuery: s } =
|
|
7043
|
-
let a = e ?
|
|
7042
|
+
const { entityName: r, entityQuery: s } = ii(e), i = ((u = s.$) == null ? void 0 : u.limit) || 10, o = si((l = s.$) == null ? void 0 : l.order);
|
|
7043
|
+
let a = e ? oi({
|
|
7044
7044
|
[r]: {
|
|
7045
7045
|
...s,
|
|
7046
7046
|
$: {
|
|
@@ -7061,7 +7061,7 @@ const mu = (n) => JSON.stringify(n), gt = (n, e = !1) => JSON.stringify([n, e]),
|
|
|
7061
7061
|
data: (c == null ? void 0 : c.data) || void 0,
|
|
7062
7062
|
error: void 0
|
|
7063
7063
|
};
|
|
7064
|
-
},
|
|
7064
|
+
}, ii = (n) => {
|
|
7065
7065
|
if (Object.keys(n).length !== 1)
|
|
7066
7066
|
throw new B("subscribeInfiniteQuery expects exactly one entity");
|
|
7067
7067
|
const [t, r] = Object.entries(n)[0];
|
|
@@ -7082,7 +7082,7 @@ function Un(n) {
|
|
|
7082
7082
|
const e = n.__adminToken, t = n.__extraDedupeKey;
|
|
7083
7083
|
return n.appId + "_" + (n.websocketURI || "default_ws_uri") + "_" + (n.apiURI || "default_api_uri") + "_" + (e || "client_only") + "_" + n.useDateObjects + "_" + (t || "");
|
|
7084
7084
|
}
|
|
7085
|
-
const Ln = Au(),
|
|
7085
|
+
const Ln = Au(), ss = ku();
|
|
7086
7086
|
class Cu {
|
|
7087
7087
|
constructor(e) {
|
|
7088
7088
|
p(this, "db");
|
|
@@ -7284,7 +7284,7 @@ class Pu {
|
|
|
7284
7284
|
this.db = e;
|
|
7285
7285
|
}
|
|
7286
7286
|
}
|
|
7287
|
-
function
|
|
7287
|
+
function oi(n) {
|
|
7288
7288
|
return JSON.parse(JSON.stringify(n));
|
|
7289
7289
|
}
|
|
7290
7290
|
class Mu {
|
|
@@ -7372,7 +7372,7 @@ class Mu {
|
|
|
7372
7372
|
* });
|
|
7373
7373
|
*/
|
|
7374
7374
|
subscribeInfiniteQuery(e, t, r) {
|
|
7375
|
-
return
|
|
7375
|
+
return Eu(this, e, t, r);
|
|
7376
7376
|
}
|
|
7377
7377
|
/**
|
|
7378
7378
|
* Listen for the logged in state. This is useful
|
|
@@ -7490,17 +7490,17 @@ class Mu {
|
|
|
7490
7490
|
return this._reactor.subscribeTable(e, t);
|
|
7491
7491
|
}
|
|
7492
7492
|
}
|
|
7493
|
-
function
|
|
7493
|
+
function is(n) {
|
|
7494
7494
|
if (!n)
|
|
7495
7495
|
return "0";
|
|
7496
|
-
const e =
|
|
7496
|
+
const e = ss.get(n);
|
|
7497
7497
|
if (e)
|
|
7498
7498
|
return e;
|
|
7499
7499
|
const t = ce(n);
|
|
7500
|
-
return
|
|
7500
|
+
return ss.set(n, t), t;
|
|
7501
7501
|
}
|
|
7502
7502
|
function Ru(n, e) {
|
|
7503
|
-
return
|
|
7503
|
+
return is(n._reactor.config.schema) !== is(e);
|
|
7504
7504
|
}
|
|
7505
7505
|
function ju(n, e, t, r, s) {
|
|
7506
7506
|
var u;
|
|
@@ -7511,11 +7511,11 @@ function ju(n, e, t, r, s) {
|
|
|
7511
7511
|
}, o = Ln[Un(i)];
|
|
7512
7512
|
if (o)
|
|
7513
7513
|
return Ru(o, i.schema) && o._reactor.updateSchema(i.schema), o;
|
|
7514
|
-
const a = new
|
|
7514
|
+
const a = new nu({
|
|
7515
7515
|
...Ou,
|
|
7516
7516
|
...i,
|
|
7517
7517
|
cardinalityInference: !!i.schema
|
|
7518
|
-
}, e ||
|
|
7518
|
+
}, e || Qs, t || Bs, { ...r || {}, "@instantdb/core": ar }, s), c = new Mu(a);
|
|
7519
7519
|
return Ln[Un(i)] = c, xu(i.appId, i.devtool), c;
|
|
7520
7520
|
}
|
|
7521
7521
|
function xu(n, e) {
|
|
@@ -7526,7 +7526,7 @@ function xu(n, e) {
|
|
|
7526
7526
|
allowedHosts: ["localhost"],
|
|
7527
7527
|
...typeof e == "object" ? e : {}
|
|
7528
7528
|
};
|
|
7529
|
-
t.allowedHosts.includes(window.location.hostname) &&
|
|
7529
|
+
t.allowedHosts.includes(window.location.hostname) && du(n, t);
|
|
7530
7530
|
}
|
|
7531
7531
|
var Fn = { exports: {} }, ft = {};
|
|
7532
7532
|
/**
|
|
@@ -7538,11 +7538,11 @@ var Fn = { exports: {} }, ft = {};
|
|
|
7538
7538
|
* This source code is licensed under the MIT license found in the
|
|
7539
7539
|
* LICENSE file in the root directory of this source tree.
|
|
7540
7540
|
*/
|
|
7541
|
-
var
|
|
7541
|
+
var os;
|
|
7542
7542
|
function $u() {
|
|
7543
|
-
if (
|
|
7544
|
-
|
|
7545
|
-
var n =
|
|
7543
|
+
if (os) return ft;
|
|
7544
|
+
os = 1;
|
|
7545
|
+
var n = ps, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, s = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
7546
7546
|
function o(a, c, u) {
|
|
7547
7547
|
var l, f = {}, d = null, y = null;
|
|
7548
7548
|
u !== void 0 && (d = "" + u), c.key !== void 0 && (d = "" + c.key), c.ref !== void 0 && (y = c.ref);
|
|
@@ -7552,10 +7552,10 @@ function $u() {
|
|
|
7552
7552
|
}
|
|
7553
7553
|
return ft.Fragment = t, ft.jsx = o, ft.jsxs = o, ft;
|
|
7554
7554
|
}
|
|
7555
|
-
var dt = {},
|
|
7555
|
+
var dt = {}, as;
|
|
7556
7556
|
function Du() {
|
|
7557
|
-
if (
|
|
7558
|
-
|
|
7557
|
+
if (as) return dt;
|
|
7558
|
+
as = 1;
|
|
7559
7559
|
var n = {};
|
|
7560
7560
|
/**
|
|
7561
7561
|
* @license React
|
|
@@ -7567,7 +7567,7 @@ function Du() {
|
|
|
7567
7567
|
* LICENSE file in the root directory of this source tree.
|
|
7568
7568
|
*/
|
|
7569
7569
|
return n.NODE_ENV !== "production" && function() {
|
|
7570
|
-
var e =
|
|
7570
|
+
var e = ps, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), c = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), b = Symbol.for("react.offscreen"), g = Symbol.iterator, m = "@@iterator";
|
|
7571
7571
|
function T(h) {
|
|
7572
7572
|
if (h === null || typeof h != "object")
|
|
7573
7573
|
return null;
|
|
@@ -7734,8 +7734,8 @@ function Du() {
|
|
|
7734
7734
|
}
|
|
7735
7735
|
var sn = !1, Ct;
|
|
7736
7736
|
{
|
|
7737
|
-
var
|
|
7738
|
-
Ct = new
|
|
7737
|
+
var ui = typeof WeakMap == "function" ? WeakMap : Map;
|
|
7738
|
+
Ct = new ui();
|
|
7739
7739
|
}
|
|
7740
7740
|
function ur(h, S) {
|
|
7741
7741
|
if (!h || sn)
|
|
@@ -7808,10 +7808,10 @@ function Du() {
|
|
|
7808
7808
|
var Be = h ? h.displayName || h.name : "", De = Be ? At(Be) : "";
|
|
7809
7809
|
return typeof h == "function" && Ct.set(h, De), De;
|
|
7810
7810
|
}
|
|
7811
|
-
function
|
|
7811
|
+
function li(h, S, E) {
|
|
7812
7812
|
return ur(h, !1);
|
|
7813
7813
|
}
|
|
7814
|
-
function
|
|
7814
|
+
function fi(h) {
|
|
7815
7815
|
var S = h.prototype;
|
|
7816
7816
|
return !!(S && S.isReactComponent);
|
|
7817
7817
|
}
|
|
@@ -7819,7 +7819,7 @@ function Du() {
|
|
|
7819
7819
|
if (h == null)
|
|
7820
7820
|
return "";
|
|
7821
7821
|
if (typeof h == "function")
|
|
7822
|
-
return ur(h,
|
|
7822
|
+
return ur(h, fi(h));
|
|
7823
7823
|
if (typeof h == "string")
|
|
7824
7824
|
return At(h);
|
|
7825
7825
|
switch (h) {
|
|
@@ -7831,7 +7831,7 @@ function Du() {
|
|
|
7831
7831
|
if (typeof h == "object")
|
|
7832
7832
|
switch (h.$$typeof) {
|
|
7833
7833
|
case u:
|
|
7834
|
-
return
|
|
7834
|
+
return li(h.render);
|
|
7835
7835
|
case d:
|
|
7836
7836
|
return It(h.type, S, E);
|
|
7837
7837
|
case y: {
|
|
@@ -7852,7 +7852,7 @@ function Du() {
|
|
|
7852
7852
|
} else
|
|
7853
7853
|
fr.setExtraStackFrame(null);
|
|
7854
7854
|
}
|
|
7855
|
-
function
|
|
7855
|
+
function di(h, S, E, M, z) {
|
|
7856
7856
|
{
|
|
7857
7857
|
var Q = Function.call.bind(ut);
|
|
7858
7858
|
for (var L in h)
|
|
@@ -7871,17 +7871,17 @@ function Du() {
|
|
|
7871
7871
|
}
|
|
7872
7872
|
}
|
|
7873
7873
|
}
|
|
7874
|
-
var
|
|
7874
|
+
var hi = Array.isArray;
|
|
7875
7875
|
function on(h) {
|
|
7876
|
-
return
|
|
7876
|
+
return hi(h);
|
|
7877
7877
|
}
|
|
7878
|
-
function
|
|
7878
|
+
function pi(h) {
|
|
7879
7879
|
{
|
|
7880
7880
|
var S = typeof Symbol == "function" && Symbol.toStringTag, E = S && h[Symbol.toStringTag] || h.constructor.name || "Object";
|
|
7881
7881
|
return E;
|
|
7882
7882
|
}
|
|
7883
7883
|
}
|
|
7884
|
-
function
|
|
7884
|
+
function yi(h) {
|
|
7885
7885
|
try {
|
|
7886
7886
|
return dr(h), !1;
|
|
7887
7887
|
} catch {
|
|
@@ -7892,16 +7892,16 @@ function Du() {
|
|
|
7892
7892
|
return "" + h;
|
|
7893
7893
|
}
|
|
7894
7894
|
function hr(h) {
|
|
7895
|
-
if (
|
|
7896
|
-
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
7895
|
+
if (yi(h))
|
|
7896
|
+
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", pi(h)), dr(h);
|
|
7897
7897
|
}
|
|
7898
|
-
var pr = _.ReactCurrentOwner,
|
|
7898
|
+
var pr = _.ReactCurrentOwner, bi = {
|
|
7899
7899
|
key: !0,
|
|
7900
7900
|
ref: !0,
|
|
7901
7901
|
__self: !0,
|
|
7902
7902
|
__source: !0
|
|
7903
7903
|
}, yr, br;
|
|
7904
|
-
function
|
|
7904
|
+
function gi(h) {
|
|
7905
7905
|
if (ut.call(h, "ref")) {
|
|
7906
7906
|
var S = Object.getOwnPropertyDescriptor(h, "ref").get;
|
|
7907
7907
|
if (S && S.isReactWarning)
|
|
@@ -7909,7 +7909,7 @@ function Du() {
|
|
|
7909
7909
|
}
|
|
7910
7910
|
return h.ref !== void 0;
|
|
7911
7911
|
}
|
|
7912
|
-
function
|
|
7912
|
+
function _i(h) {
|
|
7913
7913
|
if (ut.call(h, "key")) {
|
|
7914
7914
|
var S = Object.getOwnPropertyDescriptor(h, "key").get;
|
|
7915
7915
|
if (S && S.isReactWarning)
|
|
@@ -7917,10 +7917,10 @@ function Du() {
|
|
|
7917
7917
|
}
|
|
7918
7918
|
return h.key !== void 0;
|
|
7919
7919
|
}
|
|
7920
|
-
function
|
|
7920
|
+
function mi(h, S) {
|
|
7921
7921
|
typeof h.ref == "string" && pr.current;
|
|
7922
7922
|
}
|
|
7923
|
-
function
|
|
7923
|
+
function wi(h, S) {
|
|
7924
7924
|
{
|
|
7925
7925
|
var E = function() {
|
|
7926
7926
|
yr || (yr = !0, w("%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)", S));
|
|
@@ -7931,7 +7931,7 @@ function Du() {
|
|
|
7931
7931
|
});
|
|
7932
7932
|
}
|
|
7933
7933
|
}
|
|
7934
|
-
function
|
|
7934
|
+
function Si(h, S) {
|
|
7935
7935
|
{
|
|
7936
7936
|
var E = function() {
|
|
7937
7937
|
br || (br = !0, w("%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)", S));
|
|
@@ -7942,7 +7942,7 @@ function Du() {
|
|
|
7942
7942
|
});
|
|
7943
7943
|
}
|
|
7944
7944
|
}
|
|
7945
|
-
var
|
|
7945
|
+
var Ti = function(h, S, E, M, z, Q, L) {
|
|
7946
7946
|
var $ = {
|
|
7947
7947
|
// This tag allows us to uniquely identify this as a React Element
|
|
7948
7948
|
$$typeof: t,
|
|
@@ -7971,12 +7971,12 @@ function Du() {
|
|
|
7971
7971
|
value: z
|
|
7972
7972
|
}), Object.freeze && (Object.freeze($.props), Object.freeze($)), $;
|
|
7973
7973
|
};
|
|
7974
|
-
function
|
|
7974
|
+
function vi(h, S, E, M, z) {
|
|
7975
7975
|
{
|
|
7976
7976
|
var Q, L = {}, $ = null, fe = null;
|
|
7977
|
-
E !== void 0 && (hr(E), $ = "" + E),
|
|
7977
|
+
E !== void 0 && (hr(E), $ = "" + E), _i(S) && (hr(S.key), $ = "" + S.key), gi(S) && (fe = S.ref, mi(S, z));
|
|
7978
7978
|
for (Q in S)
|
|
7979
|
-
ut.call(S, Q) && !
|
|
7979
|
+
ut.call(S, Q) && !bi.hasOwnProperty(Q) && (L[Q] = S[Q]);
|
|
7980
7980
|
if (h && h.defaultProps) {
|
|
7981
7981
|
var ee = h.defaultProps;
|
|
7982
7982
|
for (Q in ee)
|
|
@@ -7984,9 +7984,9 @@ function Du() {
|
|
|
7984
7984
|
}
|
|
7985
7985
|
if ($ || fe) {
|
|
7986
7986
|
var re = typeof h == "function" ? h.displayName || h.name || "Unknown" : h;
|
|
7987
|
-
$ &&
|
|
7987
|
+
$ && wi(L, re), fe && Si(L, re);
|
|
7988
7988
|
}
|
|
7989
|
-
return
|
|
7989
|
+
return Ti(h, $, fe, z, M, pr.current, L);
|
|
7990
7990
|
}
|
|
7991
7991
|
}
|
|
7992
7992
|
var an = _.ReactCurrentOwner, gr = _.ReactDebugCurrentFrame;
|
|
@@ -8014,11 +8014,11 @@ Check the render method of \`` + h + "`.";
|
|
|
8014
8014
|
return "";
|
|
8015
8015
|
}
|
|
8016
8016
|
}
|
|
8017
|
-
function
|
|
8017
|
+
function Ei(h) {
|
|
8018
8018
|
return "";
|
|
8019
8019
|
}
|
|
8020
8020
|
var mr = {};
|
|
8021
|
-
function
|
|
8021
|
+
function Oi(h) {
|
|
8022
8022
|
{
|
|
8023
8023
|
var S = _r();
|
|
8024
8024
|
if (!S) {
|
|
@@ -8035,7 +8035,7 @@ Check the top-level render call using <` + E + ">.");
|
|
|
8035
8035
|
if (!h._store || h._store.validated || h.key != null)
|
|
8036
8036
|
return;
|
|
8037
8037
|
h._store.validated = !0;
|
|
8038
|
-
var E =
|
|
8038
|
+
var E = Oi(S);
|
|
8039
8039
|
if (mr[E])
|
|
8040
8040
|
return;
|
|
8041
8041
|
mr[E] = !0;
|
|
@@ -8062,7 +8062,7 @@ Check the top-level render call using <` + E + ">.");
|
|
|
8062
8062
|
}
|
|
8063
8063
|
}
|
|
8064
8064
|
}
|
|
8065
|
-
function
|
|
8065
|
+
function ki(h) {
|
|
8066
8066
|
{
|
|
8067
8067
|
var S = h.type;
|
|
8068
8068
|
if (S == null || typeof S == "string")
|
|
@@ -8078,7 +8078,7 @@ Check the top-level render call using <` + E + ">.");
|
|
|
8078
8078
|
return;
|
|
8079
8079
|
if (E) {
|
|
8080
8080
|
var M = q(S);
|
|
8081
|
-
|
|
8081
|
+
di(E, h.props, "prop", M, h);
|
|
8082
8082
|
} else if (S.PropTypes !== void 0 && !cn) {
|
|
8083
8083
|
cn = !0;
|
|
8084
8084
|
var z = q(S);
|
|
@@ -8087,7 +8087,7 @@ Check the top-level render call using <` + E + ">.");
|
|
|
8087
8087
|
typeof S.getDefaultProps == "function" && !S.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
8088
8088
|
}
|
|
8089
8089
|
}
|
|
8090
|
-
function
|
|
8090
|
+
function Ai(h) {
|
|
8091
8091
|
{
|
|
8092
8092
|
for (var S = Object.keys(h.props), E = 0; E < S.length; E++) {
|
|
8093
8093
|
var M = S[E];
|
|
@@ -8106,12 +8106,12 @@ Check the top-level render call using <` + E + ">.");
|
|
|
8106
8106
|
if (!L) {
|
|
8107
8107
|
var $ = "";
|
|
8108
8108
|
(h === void 0 || typeof h == "object" && h !== null && Object.keys(h).length === 0) && ($ += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
8109
|
-
var fe =
|
|
8109
|
+
var fe = Ei();
|
|
8110
8110
|
fe ? $ += fe : $ += _r();
|
|
8111
8111
|
var ee;
|
|
8112
8112
|
h === null ? ee = "null" : on(h) ? ee = "array" : h !== void 0 && h.$$typeof === t ? (ee = "<" + (q(h.type) || "Unknown") + " />", $ = " Did you accidentally export a JSX literal instead of a component?") : ee = typeof h, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ee, $);
|
|
8113
8113
|
}
|
|
8114
|
-
var re =
|
|
8114
|
+
var re = vi(h, S, E, z, Q);
|
|
8115
8115
|
if (re == null)
|
|
8116
8116
|
return re;
|
|
8117
8117
|
if (L) {
|
|
@@ -8128,30 +8128,30 @@ Check the top-level render call using <` + E + ">.");
|
|
|
8128
8128
|
Sr(Se, h);
|
|
8129
8129
|
}
|
|
8130
8130
|
if (ut.call(S, "key")) {
|
|
8131
|
-
var De = q(h), pe = Object.keys(S).filter(function(
|
|
8132
|
-
return
|
|
8131
|
+
var De = q(h), pe = Object.keys(S).filter(function(ji) {
|
|
8132
|
+
return ji !== "key";
|
|
8133
8133
|
}), ln = pe.length > 0 ? "{key: someKey, " + pe.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
8134
8134
|
if (!Tr[De + ln]) {
|
|
8135
|
-
var
|
|
8135
|
+
var Ri = pe.length > 0 ? "{" + pe.join(": ..., ") + ": ...}" : "{}";
|
|
8136
8136
|
w(`A props object containing a "key" prop is being spread into JSX:
|
|
8137
8137
|
let props = %s;
|
|
8138
8138
|
<%s {...props} />
|
|
8139
8139
|
React keys must be passed directly to JSX without using spread:
|
|
8140
8140
|
let props = %s;
|
|
8141
|
-
<%s key={someKey} {...props} />`, ln, De,
|
|
8141
|
+
<%s key={someKey} {...props} />`, ln, De, Ri, De), Tr[De + ln] = !0;
|
|
8142
8142
|
}
|
|
8143
8143
|
}
|
|
8144
|
-
return h === s ?
|
|
8144
|
+
return h === s ? Ai(re) : ki(re), re;
|
|
8145
8145
|
}
|
|
8146
8146
|
}
|
|
8147
|
-
function
|
|
8147
|
+
function Ci(h, S, E) {
|
|
8148
8148
|
return vr(h, S, E, !0);
|
|
8149
8149
|
}
|
|
8150
|
-
function
|
|
8150
|
+
function Ii(h, S, E) {
|
|
8151
8151
|
return vr(h, S, E, !1);
|
|
8152
8152
|
}
|
|
8153
|
-
var
|
|
8154
|
-
dt.Fragment = s, dt.jsx =
|
|
8153
|
+
var Pi = Ii, Mi = Ci;
|
|
8154
|
+
dt.Fragment = s, dt.jsx = Pi, dt.jsxs = Mi;
|
|
8155
8155
|
}(), dt;
|
|
8156
8156
|
}
|
|
8157
8157
|
var Uu = {};
|
|
@@ -8163,7 +8163,7 @@ const Lu = {
|
|
|
8163
8163
|
pageInfo: void 0,
|
|
8164
8164
|
error: void 0
|
|
8165
8165
|
};
|
|
8166
|
-
function
|
|
8166
|
+
function cs(n) {
|
|
8167
8167
|
return {
|
|
8168
8168
|
isLoading: !n,
|
|
8169
8169
|
data: void 0,
|
|
@@ -8174,8 +8174,8 @@ function as(n) {
|
|
|
8174
8174
|
}
|
|
8175
8175
|
function Fu(n, e, t, r) {
|
|
8176
8176
|
e && t && "ruleParams" in t && (e = { $$ruleParams: t.ruleParams, ...e });
|
|
8177
|
-
const s = e ?
|
|
8178
|
-
(l) => (o.current =
|
|
8177
|
+
const s = e ? oi(e) : null, i = ce(s), o = $e(cs(n._reactor.getPreviousResult(s))), a = $e(Lu), c = Me(
|
|
8178
|
+
(l) => (o.current = cs(n._reactor.getPreviousResult(s)), l(), s ? n.subscribeQuery(s, (d) => {
|
|
8179
8179
|
o.current = {
|
|
8180
8180
|
isLoading: !d,
|
|
8181
8181
|
// @ts-expect-error: ts thinks this will always be overwritten
|
|
@@ -8200,26 +8200,26 @@ const Nu = {
|
|
|
8200
8200
|
canLoadNextPage: !1
|
|
8201
8201
|
};
|
|
8202
8202
|
function Ku({ core: n, query: e, opts: t }) {
|
|
8203
|
-
const r = $e(null), s = ce(e), i = ce(t), o =
|
|
8203
|
+
const r = $e(null), s = ce(e), i = ce(t), o = rs(n, e, t), a = $e({
|
|
8204
8204
|
...o,
|
|
8205
8205
|
isLoading: !o.data && !o.error
|
|
8206
8206
|
}), c = Me((f) => {
|
|
8207
|
-
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8207
|
+
r.current = null;
|
|
8208
|
+
const d = rs(n, e, t);
|
|
8209
|
+
if (a.current = {
|
|
8210
|
+
...d,
|
|
8211
|
+
isLoading: !d.data && !d.error
|
|
8212
8212
|
}, f(), !e)
|
|
8213
8213
|
return () => {
|
|
8214
8214
|
};
|
|
8215
|
-
const
|
|
8215
|
+
const y = n.subscribeInfiniteQuery(e, (b) => {
|
|
8216
8216
|
a.current = {
|
|
8217
|
-
...
|
|
8217
|
+
...b,
|
|
8218
8218
|
isLoading: !1
|
|
8219
8219
|
}, f();
|
|
8220
8220
|
}, t);
|
|
8221
|
-
return r.current =
|
|
8222
|
-
|
|
8221
|
+
return r.current = y, () => {
|
|
8222
|
+
y.unsubscribe(), r.current === y && (r.current = null);
|
|
8223
8223
|
};
|
|
8224
8224
|
}, [s, i]);
|
|
8225
8225
|
return {
|
|
@@ -8262,7 +8262,7 @@ function Vu(n, e) {
|
|
|
8262
8262
|
}
|
|
8263
8263
|
function Qu(n, e = {}) {
|
|
8264
8264
|
var o, a;
|
|
8265
|
-
const [t, r] =
|
|
8265
|
+
const [t, r] = ys(() => n.core._reactor.getPresence(n.type, n.id, e) ?? {
|
|
8266
8266
|
peers: {},
|
|
8267
8267
|
isLoading: !0
|
|
8268
8268
|
});
|
|
@@ -8436,7 +8436,7 @@ class Wt {
|
|
|
8436
8436
|
* console.log('Device ID:', deviceId)
|
|
8437
8437
|
*/
|
|
8438
8438
|
p(this, "useLocalId", (e) => {
|
|
8439
|
-
const [t, r] =
|
|
8439
|
+
const [t, r] = ys(null);
|
|
8440
8440
|
return We(() => {
|
|
8441
8441
|
(async () => {
|
|
8442
8442
|
const i = await this.getLocalId(e);
|
|
@@ -8704,7 +8704,7 @@ class Wt {
|
|
|
8704
8704
|
}
|
|
8705
8705
|
}
|
|
8706
8706
|
p(Wt, "Store"), p(Wt, "NetworkListener"), p(Wt, "EventSourceImpl");
|
|
8707
|
-
class
|
|
8707
|
+
class us extends Error {
|
|
8708
8708
|
constructor(e, t) {
|
|
8709
8709
|
super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
|
|
8710
8710
|
}
|
|
@@ -8755,7 +8755,7 @@ function Yu(n) {
|
|
|
8755
8755
|
break;
|
|
8756
8756
|
case "retry":
|
|
8757
8757
|
/^\d+$/.test(m) ? r(parseInt(m, 10)) : t(
|
|
8758
|
-
new
|
|
8758
|
+
new us(`Invalid \`retry\` value: "${m}"`, {
|
|
8759
8759
|
type: "invalid-retry",
|
|
8760
8760
|
value: m,
|
|
8761
8761
|
line: T
|
|
@@ -8764,7 +8764,7 @@ function Yu(n) {
|
|
|
8764
8764
|
break;
|
|
8765
8765
|
default:
|
|
8766
8766
|
t(
|
|
8767
|
-
new
|
|
8767
|
+
new us(
|
|
8768
8768
|
`Unknown field "${g.length > 20 ? `${g.slice(0, 20)}…` : g}"`,
|
|
8769
8769
|
{ type: "unknown-field", field: g, value: m, line: T }
|
|
8770
8770
|
)
|
|
@@ -8805,7 +8805,7 @@ function Zu(n) {
|
|
|
8805
8805
|
}
|
|
8806
8806
|
return [e, t];
|
|
8807
8807
|
}
|
|
8808
|
-
class
|
|
8808
|
+
class ls extends Event {
|
|
8809
8809
|
/**
|
|
8810
8810
|
* Constructs a new `ErrorEvent` instance. This is typically not called directly,
|
|
8811
8811
|
* but rather emitted by the `EventSource` object when an error occurs.
|
|
@@ -8830,7 +8830,7 @@ class us extends Event {
|
|
|
8830
8830
|
* @returns A string representation of the error
|
|
8831
8831
|
*/
|
|
8832
8832
|
[Symbol.for("nodejs.util.inspect.custom")](e, t, r) {
|
|
8833
|
-
return r(
|
|
8833
|
+
return r(fs(this), t);
|
|
8834
8834
|
}
|
|
8835
8835
|
/**
|
|
8836
8836
|
* Deno "hides" the `message` and `code` properties of the `ErrorEvent` instance,
|
|
@@ -8844,7 +8844,7 @@ class us extends Event {
|
|
|
8844
8844
|
* @returns A string representation of the error
|
|
8845
8845
|
*/
|
|
8846
8846
|
[Symbol.for("Deno.customInspect")](e, t) {
|
|
8847
|
-
return e(
|
|
8847
|
+
return e(fs(this), t);
|
|
8848
8848
|
}
|
|
8849
8849
|
}
|
|
8850
8850
|
function Xu(n) {
|
|
@@ -8854,7 +8854,7 @@ function Xu(n) {
|
|
|
8854
8854
|
function Nn(n) {
|
|
8855
8855
|
return n instanceof Error ? "errors" in n && Array.isArray(n.errors) ? n.errors.map(Nn).join(", ") : "cause" in n && n.cause instanceof Error ? `${n}: ${Nn(n.cause)}` : n.message : `${n}`;
|
|
8856
8856
|
}
|
|
8857
|
-
function
|
|
8857
|
+
function fs(n) {
|
|
8858
8858
|
return {
|
|
8859
8859
|
type: n.type,
|
|
8860
8860
|
message: n.message,
|
|
@@ -8864,9 +8864,9 @@ function ls(n) {
|
|
|
8864
8864
|
timeStamp: n.timeStamp
|
|
8865
8865
|
};
|
|
8866
8866
|
}
|
|
8867
|
-
var
|
|
8867
|
+
var ai = (n) => {
|
|
8868
8868
|
throw TypeError(n);
|
|
8869
|
-
}, cr = (n, e, t) => e.has(n) ||
|
|
8869
|
+
}, cr = (n, e, t) => e.has(n) || ai("Cannot " + t), x = (n, e, t) => (cr(n, e, "read from private field"), t ? t.call(n) : e.get(n)), ie = (n, e, t) => e.has(n) ? ai("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), Y = (n, e, t, r) => (cr(n, e, "write to private field"), e.set(n, t), t), Pe = (n, e, t) => (cr(n, e, "access private method"), t), ye, Fe, Ye, qt, Yt, Tt, nt, vt, xe, Ze, st, Xe, _t, Ee, Kn, Wn, qn, ds, zn, Vn, mt, Qn, Bn;
|
|
8870
8870
|
class zt extends EventTarget {
|
|
8871
8871
|
constructor(e, t) {
|
|
8872
8872
|
var r, s;
|
|
@@ -9007,14 +9007,14 @@ ye = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap(), Ye = /*
|
|
|
9007
9007
|
* @internal
|
|
9008
9008
|
*/
|
|
9009
9009
|
Kn = function() {
|
|
9010
|
-
Y(this, ye, this.CONNECTING), Y(this, xe, new AbortController()), x(this, Yt)(x(this, Fe), Pe(this, Ee,
|
|
9010
|
+
Y(this, ye, this.CONNECTING), Y(this, xe, new AbortController()), x(this, Yt)(x(this, Fe), Pe(this, Ee, ds).call(this)).then(x(this, Wn)).catch(x(this, qn));
|
|
9011
9011
|
}, Wn = /* @__PURE__ */ new WeakMap(), qn = /* @__PURE__ */ new WeakMap(), /**
|
|
9012
9012
|
* Get request options for the `fetch()` request
|
|
9013
9013
|
*
|
|
9014
9014
|
* @returns The request options
|
|
9015
9015
|
* @internal
|
|
9016
9016
|
*/
|
|
9017
|
-
|
|
9017
|
+
ds = function() {
|
|
9018
9018
|
var n;
|
|
9019
9019
|
const e = {
|
|
9020
9020
|
// [spec] Let `corsAttributeState` be `Anonymous`…
|
|
@@ -9036,7 +9036,7 @@ fs = function() {
|
|
|
9036
9036
|
mt = function(n, e) {
|
|
9037
9037
|
var t;
|
|
9038
9038
|
x(this, ye) !== this.CLOSED && Y(this, ye, this.CLOSED);
|
|
9039
|
-
const r = new
|
|
9039
|
+
const r = new ls("error", { code: e, message: n });
|
|
9040
9040
|
(t = x(this, st)) == null || t.call(this, r), this.dispatchEvent(r);
|
|
9041
9041
|
}, /**
|
|
9042
9042
|
* Schedules a reconnection attempt against the EventSource endpoint.
|
|
@@ -9050,7 +9050,7 @@ Qn = function(n, e) {
|
|
|
9050
9050
|
if (x(this, ye) === this.CLOSED)
|
|
9051
9051
|
return;
|
|
9052
9052
|
Y(this, ye, this.CONNECTING);
|
|
9053
|
-
const r = new
|
|
9053
|
+
const r = new ls("error", { code: e, message: n });
|
|
9054
9054
|
(t = x(this, st)) == null || t.call(this, r), this.dispatchEvent(r), Y(this, nt, setTimeout(x(this, Bn), x(this, Tt)));
|
|
9055
9055
|
}, Bn = /* @__PURE__ */ new WeakMap(), /**
|
|
9056
9056
|
* ReadyState representing an EventSource currently trying to connect
|
|
@@ -9072,15 +9072,15 @@ function el() {
|
|
|
9072
9072
|
const n = "document" in globalThis ? globalThis.document : void 0;
|
|
9073
9073
|
return n && typeof n == "object" && "baseURI" in n && typeof n.baseURI == "string" ? n.baseURI : void 0;
|
|
9074
9074
|
}
|
|
9075
|
-
class
|
|
9075
|
+
class ci extends Wt {
|
|
9076
9076
|
}
|
|
9077
|
-
p(
|
|
9077
|
+
p(ci, "EventSourceImpl", zt);
|
|
9078
9078
|
function tl(n) {
|
|
9079
9079
|
const e = {
|
|
9080
9080
|
...n,
|
|
9081
9081
|
useDateObjects: n.useDateObjects ?? !1
|
|
9082
9082
|
};
|
|
9083
|
-
return new
|
|
9083
|
+
return new ci(e, {
|
|
9084
9084
|
"@instantdb/react": ar
|
|
9085
9085
|
});
|
|
9086
9086
|
}
|
|
@@ -9137,7 +9137,7 @@ function dl({
|
|
|
9137
9137
|
[l]: void 0
|
|
9138
9138
|
});
|
|
9139
9139
|
}
|
|
9140
|
-
return
|
|
9140
|
+
return Di(
|
|
9141
9141
|
n,
|
|
9142
9142
|
{
|
|
9143
9143
|
onMouseMove: b,
|
|
@@ -9156,7 +9156,7 @@ function dl({
|
|
|
9156
9156
|
"div",
|
|
9157
9157
|
{
|
|
9158
9158
|
style: {
|
|
9159
|
-
...
|
|
9159
|
+
...hs,
|
|
9160
9160
|
...rl,
|
|
9161
9161
|
zIndex: u !== void 0 ? u : sl
|
|
9162
9162
|
},
|
|
@@ -9166,7 +9166,7 @@ function dl({
|
|
|
9166
9166
|
"div",
|
|
9167
9167
|
{
|
|
9168
9168
|
style: {
|
|
9169
|
-
...
|
|
9169
|
+
...hs,
|
|
9170
9170
|
transform: `translate(${C.xPercent}%, ${C.yPercent}%)`,
|
|
9171
9171
|
transformOrigin: "0 0",
|
|
9172
9172
|
transition: "transform 100ms"
|
|
@@ -9232,7 +9232,7 @@ function nl({ color: n }) {
|
|
|
9232
9232
|
}
|
|
9233
9233
|
);
|
|
9234
9234
|
}
|
|
9235
|
-
const
|
|
9235
|
+
const hs = {
|
|
9236
9236
|
position: "absolute",
|
|
9237
9237
|
top: 0,
|
|
9238
9238
|
left: 0,
|
|
@@ -9247,15 +9247,15 @@ export {
|
|
|
9247
9247
|
dl as Cursors,
|
|
9248
9248
|
en as InstantAPIError,
|
|
9249
9249
|
Wt as InstantReactAbstractDatabase,
|
|
9250
|
-
|
|
9251
|
-
|
|
9250
|
+
ci as InstantReactWebDatabase,
|
|
9251
|
+
nc as StoreInterface,
|
|
9252
9252
|
Ue as SyncTableCallbackEventType,
|
|
9253
9253
|
ll as createInstantRouteHandler,
|
|
9254
9254
|
ul as i,
|
|
9255
9255
|
Z as id,
|
|
9256
9256
|
tl as init,
|
|
9257
9257
|
fl as init_experimental,
|
|
9258
|
-
|
|
9258
|
+
Aa as lookup,
|
|
9259
9259
|
al as setInstantWarningsEnabled,
|
|
9260
9260
|
cl as tx
|
|
9261
9261
|
};
|