@stoker-platform/web-client 0.5.40 → 0.5.42
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/bundle.js +736 -735
- package/package.json +3 -3
package/dist/bundle.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getApp as it, registerVersion as xm, initializeApp as zn, setLogLevel as Qr, onLog as Nm } from "firebase/app";
|
|
2
2
|
import { isSupported as Fm, initializeAnalytics as Dm, setConsent as Mm } from "firebase/analytics";
|
|
3
|
-
import { getAuth as dr, validatePassword as
|
|
3
|
+
import { getAuth as dr, validatePassword as vd, initializeAuth as Oc, indexedDBLocalPersistence as Pm, browserLocalPersistence as qm, browserSessionPersistence as Ec, inMemoryPersistence as Sc, beforeAuthStateChanged as Lm, connectAuthEmulator as $m, onAuthStateChanged as Bn, getIdTokenResult as jm, signOut as _d, signInWithEmailAndPassword as Um, getMultiFactorResolver as Vm, TotpMultiFactorGenerator as Xa, signInWithCustomToken as Wm, multiFactor as Tc } from "firebase/auth";
|
|
4
4
|
import { getDatabase as wd, onValue as zm, ref as Bm, connectDatabaseEmulator as Zm } from "firebase/database";
|
|
5
5
|
import { getFirestore as We, where as ye, query as me, collection as qr, and as Xr, or as Rc, onSnapshot as hr, doc as ke, Timestamp as Bt, setDoc as Gm, getDoc as bd, orderBy as rt, limit as Xt, startAfter as eo, endBefore as to, limitToLast as Fr, getDocsFromCache as Od, getDocsFromServer as Hm, getDocs as Km, getCountFromServer as Ed, getDocFromCache as Ym, getDocFromServer as Jm, writeBatch as Ao, serverTimestamp as Lr, deleteField as Cn, arrayRemove as ko, arrayUnion as Io, collectionGroup as Qm, connectFirestoreEmulator as Cc, persistentLocalCache as Ac, persistentSingleTabManager as kc, persistentMultipleTabManager as Ic, memoryEagerGarbageCollector as Xm, memoryLruGarbageCollector as ep, memoryLocalCache as tp, initializeFirestore as Zn, getPersistentCacheIndexManager as rp, enablePersistentCacheIndexAutoCreation as np, terminate as sp, clearIndexedDbPersistence as xc, waitForPendingWrites as ip, onSnapshotsInSync as Sd, startAt as ap, endAt as op, addDoc as Td } from "firebase/firestore";
|
|
6
6
|
import { connectStorageEmulator as cp, getStorage as lp } from "firebase/storage";
|
|
@@ -8,10 +8,10 @@ import { getFunctions as Ue, httpsCallable as Je, connectFunctionsEmulator as up
|
|
|
8
8
|
import { ReCaptchaEnterpriseProvider as fp, initializeAppCheck as Gn, onTokenChanged as Hn } from "firebase/app-check";
|
|
9
9
|
import { getPerformance as dp } from "firebase/performance";
|
|
10
10
|
import { getRemoteConfig as hp, fetchAndActivate as mp } from "firebase/remote-config";
|
|
11
|
-
const pp = "0.5.
|
|
11
|
+
const pp = "0.5.41", yp = (r) => !!r.auth, ct = (r, e) => {
|
|
12
12
|
if (e?.operations)
|
|
13
13
|
return e.operations.includes(r);
|
|
14
|
-
}, An = (r, e) => e ? e.Role ? r.access?.includes(e.Role) : !1 : !0, gp = (r, e) => e ? !e.Role || r.restrictCreate === !0 ? !1 : typeof r.restrictCreate == "object" ? r.restrictCreate?.includes(e.Role) : !0 : !0,
|
|
14
|
+
}, An = (r, e) => e ? e.Role ? r.access?.includes(e.Role) : !1 : !0, gp = (r, e) => e ? !e.Role || r.restrictCreate === !0 ? !1 : typeof r.restrictCreate == "object" ? r.restrictCreate?.includes(e.Role) : !0 : !0, vp = (r, e) => e ? !e.Role || r.restrictUpdate === !0 ? !1 : typeof r.restrictUpdate == "object" ? r.restrictUpdate?.includes(e.Role) : !0 : !0, te = (r, e) => r.filter((t) => t.name === e)[0], ve = (r) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(r.type), Rd = (r, e) => {
|
|
15
15
|
const t = {
|
|
16
16
|
Record_Owner: "recordOwner",
|
|
17
17
|
Record_User: "recordUser",
|
|
@@ -36,7 +36,7 @@ const pp = "0.5.40", yp = (r) => !!r.auth, vt = (r, e) => {
|
|
|
36
36
|
if (!a.roles.some((h) => h.role === t.Role))
|
|
37
37
|
return;
|
|
38
38
|
const o = a.collectionField, c = te(r.fields, o);
|
|
39
|
-
if (!
|
|
39
|
+
if (!ve(c))
|
|
40
40
|
throw new Error("PERMISSION_DENIED");
|
|
41
41
|
const l = t.collections?.[c.collection], f = e.collections[c.collection].access.entityRestrictions;
|
|
42
42
|
if (!f)
|
|
@@ -53,12 +53,12 @@ const pp = "0.5.40", yp = (r) => !!r.auth, vt = (r, e) => {
|
|
|
53
53
|
for (const a of n) {
|
|
54
54
|
const { fields: o } = a;
|
|
55
55
|
for (const c of o)
|
|
56
|
-
if (!(c.access && !An(c, t)) && t.Role &&
|
|
56
|
+
if (!(c.access && !An(c, t)) && t.Role && ve(c) && c.collection === s.collection && c.dependencyFields)
|
|
57
57
|
for (const l of c.dependencyFields)
|
|
58
58
|
!i.find((f) => f.field === l.field) && l.roles.includes(t.Role) && i.push(l);
|
|
59
59
|
}
|
|
60
60
|
return i;
|
|
61
|
-
},
|
|
61
|
+
}, _p = (r, e, t, n, s, i, a) => {
|
|
62
62
|
const { fields: o } = e, c = s.collections?.[e.labels.collection];
|
|
63
63
|
let l = !0;
|
|
64
64
|
if (!c) {
|
|
@@ -76,63 +76,63 @@ const pp = "0.5.40", yp = (r) => !!r.auth, vt = (r, e) => {
|
|
|
76
76
|
}), u?.filter((y) => y.type === "Record_Property").forEach((y) => {
|
|
77
77
|
if ("operations" in y && y.operations && !y.operations.includes(r))
|
|
78
78
|
return;
|
|
79
|
-
const T = te(o, y.propertyField), S = y.roles.find((
|
|
80
|
-
T.type === "Array" ? S.values?.some((
|
|
79
|
+
const T = te(o, y.propertyField), S = y.roles.find((_) => _.role === s.Role);
|
|
80
|
+
T.type === "Array" ? S.values?.some((_) => i[T.name].includes(_)) || (l = !1) : S.values?.includes(i[T.name]) || (l = !1);
|
|
81
81
|
});
|
|
82
82
|
let h = !0, p = !1;
|
|
83
83
|
f?.filter((y) => y.type === "Individual").forEach(() => {
|
|
84
84
|
p = !0, c?.individualEntities?.includes(i.id) || (h = !1);
|
|
85
85
|
});
|
|
86
|
-
let
|
|
86
|
+
let O = !0, g = !1;
|
|
87
87
|
if (f?.filter((y) => y.type === "Parent").forEach((y) => {
|
|
88
88
|
g = !0;
|
|
89
89
|
const T = te(o, y.collectionField);
|
|
90
|
-
c?.parentEntities?.some((S) => i[`${T.name}_Array`].includes(S)) || (
|
|
90
|
+
c?.parentEntities?.some((S) => i[`${T.name}_Array`].includes(S)) || (O = !1);
|
|
91
91
|
}), f?.filter((y) => y.type === "Parent_Property").forEach((y) => {
|
|
92
92
|
g = !0;
|
|
93
93
|
const T = te(o, y.collectionField), S = te(o, y.propertyField);
|
|
94
|
-
Object.entries(c?.parentPropertyEntities || {}).some((
|
|
95
|
-
const [I,
|
|
96
|
-
return I === i[S.name] && i[`${T.name}_Array`].some((C) =>
|
|
97
|
-
}) || (
|
|
94
|
+
Object.entries(c?.parentPropertyEntities || {}).some((_) => {
|
|
95
|
+
const [I, v] = _;
|
|
96
|
+
return I === i[S.name] && i[`${T.name}_Array`].some((C) => v.includes(C));
|
|
97
|
+
}) || (O = !1);
|
|
98
98
|
}), p && g) {
|
|
99
|
-
if (!(h ||
|
|
99
|
+
if (!(h || O)) {
|
|
100
100
|
l = !1;
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
|
-
} else if (!h || !
|
|
103
|
+
} else if (!h || !O) {
|
|
104
104
|
l = !1;
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
107
|
let w = !0, b = !1;
|
|
108
108
|
d?.filter((y) => y.parentFilter.type === "Individual").forEach((y) => {
|
|
109
109
|
b = !0;
|
|
110
|
-
const { parentFilter: T } = y, S = te(o, T.collectionField),
|
|
111
|
-
if (!
|
|
110
|
+
const { parentFilter: T } = y, S = te(o, T.collectionField), _ = s.collections?.[S.collection];
|
|
111
|
+
if (!_) {
|
|
112
112
|
l = !1;
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
|
|
115
|
+
_.individualEntities?.some((I) => i[`${S.name}_Array`].includes(I)) || (w = !1);
|
|
116
116
|
});
|
|
117
117
|
let A = !0, F = !1;
|
|
118
118
|
if (d?.filter((y) => y.parentFilter.type === "Parent").forEach((y) => {
|
|
119
119
|
F = !0;
|
|
120
|
-
const { parentFilter: T } = y, S = te(o, T.collectionField),
|
|
120
|
+
const { parentFilter: T } = y, S = te(o, T.collectionField), _ = te(o, T.parentCollectionField), I = s.collections?.[S.collection];
|
|
121
121
|
if (!I) {
|
|
122
122
|
l = !1;
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
-
I.parentEntities?.some((
|
|
125
|
+
I.parentEntities?.some((v) => i[`${_.name}_Array`].includes(v)) || (A = !1);
|
|
126
126
|
}), d?.filter((y) => y.parentFilter.type === "Parent_Property").forEach((y) => {
|
|
127
127
|
F = !0;
|
|
128
|
-
const { parentFilter: T } = y, S = te(o, T.collectionField),
|
|
129
|
-
if (!
|
|
128
|
+
const { parentFilter: T } = y, S = te(o, T.collectionField), _ = te(o, T.parentPropertyField), I = te(o, T.parentCollectionField), v = s.collections?.[S.collection];
|
|
129
|
+
if (!v) {
|
|
130
130
|
l = !1;
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
|
-
Object.entries(
|
|
133
|
+
Object.entries(v.parentPropertyEntities || {}).some((C) => {
|
|
134
134
|
const [k, m] = C;
|
|
135
|
-
return k === i[
|
|
135
|
+
return k === i[_.name] && i[`${I.name}_Array`].some((R) => m.includes(R));
|
|
136
136
|
}) || (A = !1);
|
|
137
137
|
}), b && F) {
|
|
138
138
|
if (!(w || A)) {
|
|
@@ -149,26 +149,26 @@ const pp = "0.5.40", yp = (r) => !!r.auth, vt = (r, e) => {
|
|
|
149
149
|
let c = !0;
|
|
150
150
|
if (!o || !s.Role)
|
|
151
151
|
return c = !1, c;
|
|
152
|
-
|
|
152
|
+
ct(r, o) || (c = !1);
|
|
153
153
|
const u = xo(e, s)?.filter((f) => f.type === "Individual").length > 0;
|
|
154
|
-
return r === "Create" && u && (c = !1),
|
|
154
|
+
return r === "Create" && u && (c = !1), _p(r, e, t, n, s, i) || (c = !1), c;
|
|
155
155
|
}, jt = (r, e, t) => {
|
|
156
156
|
const n = [];
|
|
157
157
|
for (const s of r.fields)
|
|
158
|
-
if (
|
|
158
|
+
if (ve(s)) {
|
|
159
159
|
if (s.access && (!t || !An(s, t)) || !e.collections[s.collection])
|
|
160
160
|
continue;
|
|
161
161
|
const a = t?.collections?.[s.collection];
|
|
162
162
|
if (!a)
|
|
163
163
|
continue;
|
|
164
|
-
(!t ||
|
|
164
|
+
(!t || ct("Read", a) || kn(r, e, t)) && n.push(s.collection);
|
|
165
165
|
}
|
|
166
166
|
return Array.from(new Set(n));
|
|
167
167
|
}, Ad = (r, e, t) => {
|
|
168
168
|
const { labels: n } = r, s = [];
|
|
169
169
|
for (const i of Object.values(e.collections)) {
|
|
170
170
|
const a = t?.collections?.[i.labels.collection];
|
|
171
|
-
a && i.parentCollection === n.collection && (!t ||
|
|
171
|
+
a && i.parentCollection === n.collection && (!t || ct("Read", a)) && s.push(i);
|
|
172
172
|
}
|
|
173
173
|
return s;
|
|
174
174
|
};
|
|
@@ -313,7 +313,7 @@ function kd() {
|
|
|
313
313
|
return os = r, os;
|
|
314
314
|
}
|
|
315
315
|
var cs, Bc;
|
|
316
|
-
function
|
|
316
|
+
function ut() {
|
|
317
317
|
if (Bc) return cs;
|
|
318
318
|
Bc = 1;
|
|
319
319
|
var r = kd(), e = typeof self == "object" && self && self.Object === Object && self, t = r || e || Function("return this")();
|
|
@@ -323,7 +323,7 @@ var ls, Zc;
|
|
|
323
323
|
function Wr() {
|
|
324
324
|
if (Zc) return ls;
|
|
325
325
|
Zc = 1;
|
|
326
|
-
var r =
|
|
326
|
+
var r = ut(), e = r.Symbol;
|
|
327
327
|
return ls = e, ls;
|
|
328
328
|
}
|
|
329
329
|
var us, Gc;
|
|
@@ -390,7 +390,7 @@ var ps, Qc;
|
|
|
390
390
|
function xp() {
|
|
391
391
|
if (Qc) return ps;
|
|
392
392
|
Qc = 1;
|
|
393
|
-
var r =
|
|
393
|
+
var r = ut(), e = r["__core-js_shared__"];
|
|
394
394
|
return ps = e, ps;
|
|
395
395
|
}
|
|
396
396
|
var ys, Xc;
|
|
@@ -426,9 +426,9 @@ function Id() {
|
|
|
426
426
|
}
|
|
427
427
|
return gs = t, gs;
|
|
428
428
|
}
|
|
429
|
-
var
|
|
429
|
+
var vs, tl;
|
|
430
430
|
function Fp() {
|
|
431
|
-
if (tl) return
|
|
431
|
+
if (tl) return vs;
|
|
432
432
|
tl = 1;
|
|
433
433
|
var r = No(), e = Np(), t = wt(), n = Id(), s = /[\\^$.*+?()[\]{}|]/g, i = /^\[object .+?Constructor\]$/, a = Function.prototype, o = Object.prototype, c = a.toString, l = o.hasOwnProperty, u = RegExp(
|
|
434
434
|
"^" + c.call(l).replace(s, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
@@ -439,16 +439,16 @@ function Fp() {
|
|
|
439
439
|
var h = r(d) ? u : i;
|
|
440
440
|
return h.test(n(d));
|
|
441
441
|
}
|
|
442
|
-
return
|
|
442
|
+
return vs = f, vs;
|
|
443
443
|
}
|
|
444
|
-
var
|
|
444
|
+
var _s, rl;
|
|
445
445
|
function Dp() {
|
|
446
|
-
if (rl) return
|
|
446
|
+
if (rl) return _s;
|
|
447
447
|
rl = 1;
|
|
448
448
|
function r(e, t) {
|
|
449
449
|
return e?.[t];
|
|
450
450
|
}
|
|
451
|
-
return
|
|
451
|
+
return _s = r, _s;
|
|
452
452
|
}
|
|
453
453
|
var ws, nl;
|
|
454
454
|
function Zt() {
|
|
@@ -465,7 +465,7 @@ var bs, sl;
|
|
|
465
465
|
function Fo() {
|
|
466
466
|
if (sl) return bs;
|
|
467
467
|
sl = 1;
|
|
468
|
-
var r = Zt(), e =
|
|
468
|
+
var r = Zt(), e = ut(), t = r(e, "Map");
|
|
469
469
|
return bs = t, bs;
|
|
470
470
|
}
|
|
471
471
|
var Os, il;
|
|
@@ -612,10 +612,10 @@ function Bp() {
|
|
|
612
612
|
}
|
|
613
613
|
return Ds = e, Ds;
|
|
614
614
|
}
|
|
615
|
-
var Ms,
|
|
615
|
+
var Ms, vl;
|
|
616
616
|
function Zp() {
|
|
617
|
-
if (
|
|
618
|
-
|
|
617
|
+
if (vl) return Ms;
|
|
618
|
+
vl = 1;
|
|
619
619
|
var r = Dn();
|
|
620
620
|
function e(t, n) {
|
|
621
621
|
var s = r(this, t), i = s.size;
|
|
@@ -623,10 +623,10 @@ function Zp() {
|
|
|
623
623
|
}
|
|
624
624
|
return Ms = e, Ms;
|
|
625
625
|
}
|
|
626
|
-
var Ps,
|
|
626
|
+
var Ps, _l;
|
|
627
627
|
function Do() {
|
|
628
|
-
if (
|
|
629
|
-
|
|
628
|
+
if (_l) return Ps;
|
|
629
|
+
_l = 1;
|
|
630
630
|
var r = Up(), e = Wp(), t = zp(), n = Bp(), s = Zp();
|
|
631
631
|
function i(a) {
|
|
632
632
|
var o = -1, c = a == null ? 0 : a.length;
|
|
@@ -726,9 +726,9 @@ function xd() {
|
|
|
726
726
|
var d = c & n, h = a.length, p = o.length;
|
|
727
727
|
if (h != p && !(d && p > h))
|
|
728
728
|
return !1;
|
|
729
|
-
var
|
|
730
|
-
if (
|
|
731
|
-
return
|
|
729
|
+
var O = f.get(a), g = f.get(o);
|
|
730
|
+
if (O && g)
|
|
731
|
+
return O == o && g == a;
|
|
732
732
|
var w = -1, b = !0, A = c & s ? new r() : void 0;
|
|
733
733
|
for (f.set(a, o), f.set(o, a); ++w < h; ) {
|
|
734
734
|
var F = a[w], y = o[w];
|
|
@@ -741,9 +741,9 @@ function xd() {
|
|
|
741
741
|
break;
|
|
742
742
|
}
|
|
743
743
|
if (A) {
|
|
744
|
-
if (!e(o, function(S,
|
|
745
|
-
if (!t(A,
|
|
746
|
-
return A.push(
|
|
744
|
+
if (!e(o, function(S, _) {
|
|
745
|
+
if (!t(A, _) && (F === S || u(F, S, c, l, f)))
|
|
746
|
+
return A.push(_);
|
|
747
747
|
})) {
|
|
748
748
|
b = !1;
|
|
749
749
|
break;
|
|
@@ -761,7 +761,7 @@ var Bs, Al;
|
|
|
761
761
|
function Nd() {
|
|
762
762
|
if (Al) return Bs;
|
|
763
763
|
Al = 1;
|
|
764
|
-
var r =
|
|
764
|
+
var r = ut(), e = r.Uint8Array;
|
|
765
765
|
return Bs = e, Bs;
|
|
766
766
|
}
|
|
767
767
|
var Zs, kl;
|
|
@@ -792,9 +792,9 @@ var Hs, xl;
|
|
|
792
792
|
function ty() {
|
|
793
793
|
if (xl) return Hs;
|
|
794
794
|
xl = 1;
|
|
795
|
-
var r = Wr(), e = Nd(), t = Vr(), n = xd(), s = Xp(), i = ey(), a = 1, o = 2, c = "[object Boolean]", l = "[object Date]", u = "[object Error]", f = "[object Map]", d = "[object Number]", h = "[object RegExp]", p = "[object Set]",
|
|
796
|
-
function y(T, S,
|
|
797
|
-
switch (
|
|
795
|
+
var r = Wr(), e = Nd(), t = Vr(), n = xd(), s = Xp(), i = ey(), a = 1, o = 2, c = "[object Boolean]", l = "[object Date]", u = "[object Error]", f = "[object Map]", d = "[object Number]", h = "[object RegExp]", p = "[object Set]", O = "[object String]", g = "[object Symbol]", w = "[object ArrayBuffer]", b = "[object DataView]", A = r ? r.prototype : void 0, F = A ? A.valueOf : void 0;
|
|
796
|
+
function y(T, S, _, I, v, C, k) {
|
|
797
|
+
switch (_) {
|
|
798
798
|
case b:
|
|
799
799
|
if (T.byteLength != S.byteLength || T.byteOffset != S.byteOffset)
|
|
800
800
|
return !1;
|
|
@@ -808,7 +808,7 @@ function ty() {
|
|
|
808
808
|
case u:
|
|
809
809
|
return T.name == S.name && T.message == S.message;
|
|
810
810
|
case h:
|
|
811
|
-
case
|
|
811
|
+
case O:
|
|
812
812
|
return T == S + "";
|
|
813
813
|
case f:
|
|
814
814
|
var m = s;
|
|
@@ -816,11 +816,11 @@ function ty() {
|
|
|
816
816
|
var R = I & a;
|
|
817
817
|
if (m || (m = i), T.size != S.size && !R)
|
|
818
818
|
return !1;
|
|
819
|
-
var
|
|
820
|
-
if (
|
|
821
|
-
return
|
|
819
|
+
var E = k.get(T);
|
|
820
|
+
if (E)
|
|
821
|
+
return E == S;
|
|
822
822
|
I |= o, k.set(T, S);
|
|
823
|
-
var D = n(m(T), m(S), I,
|
|
823
|
+
var D = n(m(T), m(S), I, v, C, k);
|
|
824
824
|
return k.delete(T), D;
|
|
825
825
|
case g:
|
|
826
826
|
if (F)
|
|
@@ -946,7 +946,7 @@ Sr.exports;
|
|
|
946
946
|
var Wl;
|
|
947
947
|
function Mn() {
|
|
948
948
|
return Wl || (Wl = 1, (function(r, e) {
|
|
949
|
-
var t =
|
|
949
|
+
var t = ut(), n = iy(), s = e && !e.nodeType && e, i = s && !0 && r && !r.nodeType && r, a = i && i.exports === s, o = a ? t.Buffer : void 0, c = o ? o.isBuffer : void 0, l = c || n;
|
|
950
950
|
r.exports = l;
|
|
951
951
|
})(Sr, Sr.exports)), Sr.exports;
|
|
952
952
|
}
|
|
@@ -975,8 +975,8 @@ var ci, Zl;
|
|
|
975
975
|
function ay() {
|
|
976
976
|
if (Zl) return ci;
|
|
977
977
|
Zl = 1;
|
|
978
|
-
var r = mr(), e = qd(), t = bt(), n = "[object Arguments]", s = "[object Array]", i = "[object Boolean]", a = "[object Date]", o = "[object Error]", c = "[object Function]", l = "[object Map]", u = "[object Number]", f = "[object Object]", d = "[object RegExp]", h = "[object Set]", p = "[object String]",
|
|
979
|
-
C[b] = C[A] = C[F] = C[y] = C[T] = C[S] = C[
|
|
978
|
+
var r = mr(), e = qd(), t = bt(), n = "[object Arguments]", s = "[object Array]", i = "[object Boolean]", a = "[object Date]", o = "[object Error]", c = "[object Function]", l = "[object Map]", u = "[object Number]", f = "[object Object]", d = "[object RegExp]", h = "[object Set]", p = "[object String]", O = "[object WeakMap]", g = "[object ArrayBuffer]", w = "[object DataView]", b = "[object Float32Array]", A = "[object Float64Array]", F = "[object Int8Array]", y = "[object Int16Array]", T = "[object Int32Array]", S = "[object Uint8Array]", _ = "[object Uint8ClampedArray]", I = "[object Uint16Array]", v = "[object Uint32Array]", C = {};
|
|
979
|
+
C[b] = C[A] = C[F] = C[y] = C[T] = C[S] = C[_] = C[I] = C[v] = !0, C[n] = C[s] = C[g] = C[i] = C[w] = C[a] = C[o] = C[c] = C[l] = C[u] = C[f] = C[d] = C[h] = C[p] = C[O] = !1;
|
|
980
980
|
function k(m) {
|
|
981
981
|
return t(m) && e(m.length) && !!C[r(m)];
|
|
982
982
|
}
|
|
@@ -1021,9 +1021,9 @@ function Ld() {
|
|
|
1021
1021
|
Yl = 1;
|
|
1022
1022
|
var r = ny(), e = Pd(), t = Dt(), n = Mn(), s = qo(), i = jo(), a = Object.prototype, o = a.hasOwnProperty;
|
|
1023
1023
|
function c(l, u) {
|
|
1024
|
-
var f = t(l), d = !f && e(l), h = !f && !d && n(l), p = !f && !d && !h && i(l),
|
|
1024
|
+
var f = t(l), d = !f && e(l), h = !f && !d && n(l), p = !f && !d && !h && i(l), O = f || d || h || p, g = O ? r(l.length, String) : [], w = g.length;
|
|
1025
1025
|
for (var b in l)
|
|
1026
|
-
(u || o.call(l, b)) && !(
|
|
1026
|
+
(u || o.call(l, b)) && !(O && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1027
1027
|
(b == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1028
1028
|
h && (b == "offset" || b == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1029
1029
|
p && (b == "buffer" || b == "byteLength" || b == "byteOffset") || // Skip index properties.
|
|
@@ -1096,24 +1096,24 @@ function Vo() {
|
|
|
1096
1096
|
}
|
|
1097
1097
|
return gi = n, gi;
|
|
1098
1098
|
}
|
|
1099
|
-
var
|
|
1099
|
+
var vi, nu;
|
|
1100
1100
|
function jd() {
|
|
1101
|
-
if (nu) return
|
|
1101
|
+
if (nu) return vi;
|
|
1102
1102
|
nu = 1;
|
|
1103
1103
|
var r = Dd(), e = Po(), t = Vo();
|
|
1104
1104
|
function n(s) {
|
|
1105
1105
|
return r(s, t, e);
|
|
1106
1106
|
}
|
|
1107
|
-
return
|
|
1107
|
+
return vi = n, vi;
|
|
1108
1108
|
}
|
|
1109
|
-
var
|
|
1109
|
+
var _i, su;
|
|
1110
1110
|
function ly() {
|
|
1111
|
-
if (su) return
|
|
1111
|
+
if (su) return _i;
|
|
1112
1112
|
su = 1;
|
|
1113
1113
|
var r = jd(), e = 1, t = Object.prototype, n = t.hasOwnProperty;
|
|
1114
1114
|
function s(i, a, o, c, l, u) {
|
|
1115
|
-
var f = o & e, d = r(i), h = d.length, p = r(a),
|
|
1116
|
-
if (h !=
|
|
1115
|
+
var f = o & e, d = r(i), h = d.length, p = r(a), O = p.length;
|
|
1116
|
+
if (h != O && !f)
|
|
1117
1117
|
return !1;
|
|
1118
1118
|
for (var g = h; g--; ) {
|
|
1119
1119
|
var w = d[g];
|
|
@@ -1129,54 +1129,54 @@ function ly() {
|
|
|
1129
1129
|
w = d[g];
|
|
1130
1130
|
var T = i[w], S = a[w];
|
|
1131
1131
|
if (c)
|
|
1132
|
-
var
|
|
1133
|
-
if (!(
|
|
1132
|
+
var _ = f ? c(S, T, w, a, i, u) : c(T, S, w, i, a, u);
|
|
1133
|
+
if (!(_ === void 0 ? T === S || l(T, S, o, c, u) : _)) {
|
|
1134
1134
|
F = !1;
|
|
1135
1135
|
break;
|
|
1136
1136
|
}
|
|
1137
1137
|
y || (y = w == "constructor");
|
|
1138
1138
|
}
|
|
1139
1139
|
if (F && !y) {
|
|
1140
|
-
var I = i.constructor,
|
|
1141
|
-
I !=
|
|
1140
|
+
var I = i.constructor, v = a.constructor;
|
|
1141
|
+
I != v && "constructor" in i && "constructor" in a && !(typeof I == "function" && I instanceof I && typeof v == "function" && v instanceof v) && (F = !1);
|
|
1142
1142
|
}
|
|
1143
1143
|
return u.delete(i), u.delete(a), F;
|
|
1144
1144
|
}
|
|
1145
|
-
return
|
|
1145
|
+
return _i = s, _i;
|
|
1146
1146
|
}
|
|
1147
1147
|
var wi, iu;
|
|
1148
1148
|
function uy() {
|
|
1149
1149
|
if (iu) return wi;
|
|
1150
1150
|
iu = 1;
|
|
1151
|
-
var r = Zt(), e =
|
|
1151
|
+
var r = Zt(), e = ut(), t = r(e, "DataView");
|
|
1152
1152
|
return wi = t, wi;
|
|
1153
1153
|
}
|
|
1154
1154
|
var bi, au;
|
|
1155
1155
|
function fy() {
|
|
1156
1156
|
if (au) return bi;
|
|
1157
1157
|
au = 1;
|
|
1158
|
-
var r = Zt(), e =
|
|
1158
|
+
var r = Zt(), e = ut(), t = r(e, "Promise");
|
|
1159
1159
|
return bi = t, bi;
|
|
1160
1160
|
}
|
|
1161
1161
|
var Oi, ou;
|
|
1162
1162
|
function dy() {
|
|
1163
1163
|
if (ou) return Oi;
|
|
1164
1164
|
ou = 1;
|
|
1165
|
-
var r = Zt(), e =
|
|
1165
|
+
var r = Zt(), e = ut(), t = r(e, "Set");
|
|
1166
1166
|
return Oi = t, Oi;
|
|
1167
1167
|
}
|
|
1168
1168
|
var Ei, cu;
|
|
1169
1169
|
function hy() {
|
|
1170
1170
|
if (cu) return Ei;
|
|
1171
1171
|
cu = 1;
|
|
1172
|
-
var r = Zt(), e =
|
|
1172
|
+
var r = Zt(), e = ut(), t = r(e, "WeakMap");
|
|
1173
1173
|
return Ei = t, Ei;
|
|
1174
1174
|
}
|
|
1175
1175
|
var Si, lu;
|
|
1176
1176
|
function qn() {
|
|
1177
1177
|
if (lu) return Si;
|
|
1178
1178
|
lu = 1;
|
|
1179
|
-
var r = uy(), e = Fo(), t = fy(), n = dy(), s = hy(), i = mr(), a = Id(), o = "[object Map]", c = "[object Object]", l = "[object Promise]", u = "[object Set]", f = "[object WeakMap]", d = "[object DataView]", h = a(r), p = a(e),
|
|
1179
|
+
var r = uy(), e = Fo(), t = fy(), n = dy(), s = hy(), i = mr(), a = Id(), o = "[object Map]", c = "[object Object]", l = "[object Promise]", u = "[object Set]", f = "[object WeakMap]", d = "[object DataView]", h = a(r), p = a(e), O = a(t), g = a(n), w = a(s), b = i;
|
|
1180
1180
|
return (r && b(new r(new ArrayBuffer(1))) != d || e && b(new e()) != o || t && b(t.resolve()) != l || n && b(new n()) != u || s && b(new s()) != f) && (b = function(A) {
|
|
1181
1181
|
var F = i(A), y = F == c ? A.constructor : void 0, T = y ? a(y) : "";
|
|
1182
1182
|
if (T)
|
|
@@ -1185,7 +1185,7 @@ function qn() {
|
|
|
1185
1185
|
return d;
|
|
1186
1186
|
case p:
|
|
1187
1187
|
return o;
|
|
1188
|
-
case
|
|
1188
|
+
case O:
|
|
1189
1189
|
return l;
|
|
1190
1190
|
case g:
|
|
1191
1191
|
return u;
|
|
@@ -1200,25 +1200,25 @@ function my() {
|
|
|
1200
1200
|
if (uu) return Ti;
|
|
1201
1201
|
uu = 1;
|
|
1202
1202
|
var r = Mo(), e = xd(), t = ty(), n = ly(), s = qn(), i = Dt(), a = Mn(), o = jo(), c = 1, l = "[object Arguments]", u = "[object Array]", f = "[object Object]", d = Object.prototype, h = d.hasOwnProperty;
|
|
1203
|
-
function p(
|
|
1204
|
-
var y = i(
|
|
1205
|
-
S = S == l ? f : S,
|
|
1206
|
-
var I = S == f,
|
|
1207
|
-
if (C && a(
|
|
1203
|
+
function p(O, g, w, b, A, F) {
|
|
1204
|
+
var y = i(O), T = i(g), S = y ? u : s(O), _ = T ? u : s(g);
|
|
1205
|
+
S = S == l ? f : S, _ = _ == l ? f : _;
|
|
1206
|
+
var I = S == f, v = _ == f, C = S == _;
|
|
1207
|
+
if (C && a(O)) {
|
|
1208
1208
|
if (!a(g))
|
|
1209
1209
|
return !1;
|
|
1210
1210
|
y = !0, I = !1;
|
|
1211
1211
|
}
|
|
1212
1212
|
if (C && !I)
|
|
1213
|
-
return F || (F = new r()), y || o(
|
|
1213
|
+
return F || (F = new r()), y || o(O) ? e(O, g, w, b, A, F) : t(O, g, S, w, b, A, F);
|
|
1214
1214
|
if (!(w & c)) {
|
|
1215
|
-
var k = I && h.call(
|
|
1215
|
+
var k = I && h.call(O, "__wrapped__"), m = v && h.call(g, "__wrapped__");
|
|
1216
1216
|
if (k || m) {
|
|
1217
|
-
var R = k ?
|
|
1218
|
-
return F || (F = new r()), A(R,
|
|
1217
|
+
var R = k ? O.value() : O, E = m ? g.value() : g;
|
|
1218
|
+
return F || (F = new r()), A(R, E, w, b, F);
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
|
-
return C ? (F || (F = new r()), n(
|
|
1221
|
+
return C ? (F || (F = new r()), n(O, g, w, b, A, F)) : !1;
|
|
1222
1222
|
}
|
|
1223
1223
|
return Ti = p, Ti;
|
|
1224
1224
|
}
|
|
@@ -1243,7 +1243,7 @@ function yy() {
|
|
|
1243
1243
|
return Ci = e, Ci;
|
|
1244
1244
|
}
|
|
1245
1245
|
var gy = yy();
|
|
1246
|
-
const
|
|
1246
|
+
const vy = /* @__PURE__ */ In(gy), _y = (r, e, t, n, s, i, a, o, c) => {
|
|
1247
1247
|
const { access: l } = e, { permissionWriteRestrictions: u } = l;
|
|
1248
1248
|
let f = !0, d = "";
|
|
1249
1249
|
const h = u?.filter((p) => n === p.userRole);
|
|
@@ -1253,13 +1253,13 @@ const _y = /* @__PURE__ */ In(gy), vy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1253
1253
|
}, wy = (r, e, t, n, s, i, a, o, c, l, u) => {
|
|
1254
1254
|
const { labels: f } = n;
|
|
1255
1255
|
let d = !0;
|
|
1256
|
-
return (!e.Role || i && (!a?.Role || !
|
|
1256
|
+
return (!e.Role || i && (!a?.Role || !_y(r, n, s, a.Role, e.Role) || i === e.User_ID)) && (d = !1), d;
|
|
1257
1257
|
}, by = (r, e, t, n, s, i, a) => {
|
|
1258
1258
|
const { labels: o, fields: c } = t, l = i?.collections?.[o.collection];
|
|
1259
1259
|
let u = !0;
|
|
1260
1260
|
if (s && !l)
|
|
1261
1261
|
throw new Error("PERMISSION_DENIED");
|
|
1262
|
-
s && !
|
|
1262
|
+
s && !ct("Create", l) && (u = !1), s && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1263
1263
|
!dn("Create", t, n, s, i, r) && (u = !1), t.auth;
|
|
1264
1264
|
for (const f of c) {
|
|
1265
1265
|
const d = r[f.name];
|
|
@@ -1273,24 +1273,25 @@ const _y = /* @__PURE__ */ In(gy), vy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1273
1273
|
}, Oy = (r, e, t, n, s, i, a, o, c, l) => {
|
|
1274
1274
|
const { labels: u, fields: f } = n, d = a?.collections?.[u.collection], h = { ...e, ...r };
|
|
1275
1275
|
tr(h);
|
|
1276
|
-
let p = !0,
|
|
1276
|
+
let p = !0, O = "";
|
|
1277
1277
|
if (i && !d)
|
|
1278
1278
|
throw new Error("PERMISSION_DENIED");
|
|
1279
|
-
i && !
|
|
1279
|
+
i && !ct("Update", d) && (p = !1, O = "Authenticated user does not have Update access to this collection"), i && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1280
1280
|
(!dn("Update", n, s, i, a, e) || // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1281
|
-
!dn("Update", n, s, i, a, h)) && (p = !1,
|
|
1281
|
+
!dn("Update", n, s, i, a, h)) && (p = !1, O = "Authenticated user does not have Update access to this document"), i && n.softDelete && r[n.softDelete.archivedField] === !0 && !e[n.softDelete.archivedField] && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1282
|
+
!ct("Delete", d) && (p = !1, O = "Authenticated user does not have Delete access to this document");
|
|
1282
1283
|
for (const g of f) {
|
|
1283
1284
|
const w = r[g.name];
|
|
1284
|
-
g.access && !An(g, a) && w !== void 0 && (
|
|
1285
|
+
g.access && !An(g, a) && w !== void 0 && (O = `Authenticated user does not have access to field ${g.name}`, p = !1), w !== void 0 && !vp(g, a) && (O = `Authenticated user does not have Update access to field ${g.name}`, p = !1);
|
|
1285
1286
|
}
|
|
1286
1287
|
if (!p)
|
|
1287
|
-
throw
|
|
1288
|
+
throw O && console.error(`PERMISSION_DENIED: ${O}`), new Error("PERMISSION_DENIED");
|
|
1288
1289
|
}, Ey = (r, e, t, n, s, i) => {
|
|
1289
1290
|
const { labels: a } = t, o = i.collections?.[a.collection];
|
|
1290
1291
|
let c = !0;
|
|
1291
1292
|
if (!o)
|
|
1292
1293
|
throw new Error("PERMISSION_DENIED");
|
|
1293
|
-
if (
|
|
1294
|
+
if (ct("Delete", o) || (c = !1), dn("Delete", t, n, s, i, r) || (c = !1), t.auth && r.User_ID && (yp(o) || (c = !1), wy("delete", r, e, t, n, s, i) || (c = !1)), !c)
|
|
1294
1295
|
throw new Error("PERMISSION_DENIED");
|
|
1295
1296
|
}, Ud = (r, e, t) => {
|
|
1296
1297
|
const { access: n } = e, { entityRestrictions: s } = n;
|
|
@@ -1304,7 +1305,7 @@ const _y = /* @__PURE__ */ In(gy), vy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1304
1305
|
if (!i.roles.some((l) => l.role === r))
|
|
1305
1306
|
continue;
|
|
1306
1307
|
const a = te(e.fields, i.collectionField);
|
|
1307
|
-
if (!
|
|
1308
|
+
if (!ve(a))
|
|
1308
1309
|
throw new Error("PERMISSION_DENIED");
|
|
1309
1310
|
const c = t.collections[a.collection].access.entityRestrictions?.restrictions?.find((l) => l.type === i.type && l.roles.some((u) => u.role === r));
|
|
1310
1311
|
if (!c)
|
|
@@ -1391,10 +1392,10 @@ function Cy() {
|
|
|
1391
1392
|
}
|
|
1392
1393
|
var Rr = { exports: {} };
|
|
1393
1394
|
Rr.exports;
|
|
1394
|
-
var
|
|
1395
|
+
var vu;
|
|
1395
1396
|
function zd() {
|
|
1396
|
-
return
|
|
1397
|
-
var t =
|
|
1397
|
+
return vu || (vu = 1, (function(r, e) {
|
|
1398
|
+
var t = ut(), n = e && !e.nodeType && e, s = n && !0 && r && !r.nodeType && r, i = s && s.exports === n, a = i ? t.Buffer : void 0, o = a ? a.allocUnsafe : void 0;
|
|
1398
1399
|
function c(l, u) {
|
|
1399
1400
|
if (u)
|
|
1400
1401
|
return l.slice();
|
|
@@ -1404,10 +1405,10 @@ function zd() {
|
|
|
1404
1405
|
r.exports = c;
|
|
1405
1406
|
})(Rr, Rr.exports)), Rr.exports;
|
|
1406
1407
|
}
|
|
1407
|
-
var Fi,
|
|
1408
|
+
var Fi, _u;
|
|
1408
1409
|
function zo() {
|
|
1409
|
-
if (
|
|
1410
|
-
|
|
1410
|
+
if (_u) return Fi;
|
|
1411
|
+
_u = 1;
|
|
1411
1412
|
var r = Nd();
|
|
1412
1413
|
function e(t) {
|
|
1413
1414
|
var n = new t.constructor(t.byteLength);
|
|
@@ -1590,20 +1591,20 @@ function Dy() {
|
|
|
1590
1591
|
if (Du) return Hi;
|
|
1591
1592
|
Du = 1;
|
|
1592
1593
|
var r = Wd(), e = zd(), t = Bd(), n = Zd(), s = Gd(), i = Pd(), a = Dt(), o = ky(), c = Mn(), l = No(), u = wt(), f = Iy(), d = jo(), h = Hd(), p = Fy();
|
|
1593
|
-
function
|
|
1594
|
-
var S = h(g, b),
|
|
1594
|
+
function O(g, w, b, A, F, y, T) {
|
|
1595
|
+
var S = h(g, b), _ = h(w, b), I = T.get(_);
|
|
1595
1596
|
if (I) {
|
|
1596
1597
|
r(g, b, I);
|
|
1597
1598
|
return;
|
|
1598
1599
|
}
|
|
1599
|
-
var
|
|
1600
|
+
var v = y ? y(S, _, b + "", g, w, T) : void 0, C = v === void 0;
|
|
1600
1601
|
if (C) {
|
|
1601
|
-
var k = a(
|
|
1602
|
-
|
|
1602
|
+
var k = a(_), m = !k && c(_), R = !k && !m && d(_);
|
|
1603
|
+
v = _, k || m || R ? a(S) ? v = S : o(S) ? v = n(S) : m ? (C = !1, v = e(_, !0)) : R ? (C = !1, v = t(_, !0)) : v = [] : f(_) || i(_) ? (v = S, i(S) ? v = p(S) : (!u(S) || l(S)) && (v = s(_))) : C = !1;
|
|
1603
1604
|
}
|
|
1604
|
-
C && (T.set(
|
|
1605
|
+
C && (T.set(_, v), F(v, _, A, y, T), T.delete(_)), r(g, b, v);
|
|
1605
1606
|
}
|
|
1606
|
-
return Hi =
|
|
1607
|
+
return Hi = O, Hi;
|
|
1607
1608
|
}
|
|
1608
1609
|
var Ki, Mu;
|
|
1609
1610
|
function My() {
|
|
@@ -1615,8 +1616,8 @@ function My() {
|
|
|
1615
1616
|
if (d || (d = new r()), s(h))
|
|
1616
1617
|
n(c, l, p, u, o, f, d);
|
|
1617
1618
|
else {
|
|
1618
|
-
var
|
|
1619
|
-
|
|
1619
|
+
var O = f ? f(a(c, p), h, p + "", c, l, d) : void 0;
|
|
1620
|
+
O === void 0 && (O = h), e(c, p, O);
|
|
1620
1621
|
}
|
|
1621
1622
|
}, i);
|
|
1622
1623
|
}
|
|
@@ -1907,28 +1908,28 @@ function ng() {
|
|
|
1907
1908
|
return a;
|
|
1908
1909
|
o = e(o, a);
|
|
1909
1910
|
for (var u = -1, f = o.length, d = f - 1, h = a; h != null && ++u < f; ) {
|
|
1910
|
-
var p = s(o[u]),
|
|
1911
|
+
var p = s(o[u]), O = c;
|
|
1911
1912
|
if (p === "__proto__" || p === "constructor" || p === "prototype")
|
|
1912
1913
|
return a;
|
|
1913
1914
|
if (u != d) {
|
|
1914
1915
|
var g = h[p];
|
|
1915
|
-
|
|
1916
|
+
O = l ? l(g, p, h) : void 0, O === void 0 && (O = n(g) ? g : t(o[u + 1]) ? [] : {});
|
|
1916
1917
|
}
|
|
1917
|
-
r(h, p,
|
|
1918
|
+
r(h, p, O), h = h[p];
|
|
1918
1919
|
}
|
|
1919
1920
|
return a;
|
|
1920
1921
|
}
|
|
1921
1922
|
return ga = i, ga;
|
|
1922
1923
|
}
|
|
1923
|
-
var
|
|
1924
|
+
var va, sf;
|
|
1924
1925
|
function sg() {
|
|
1925
|
-
if (sf) return
|
|
1926
|
+
if (sf) return va;
|
|
1926
1927
|
sf = 1;
|
|
1927
1928
|
var r = ng();
|
|
1928
1929
|
function e(t, n, s) {
|
|
1929
1930
|
return t == null ? t : r(t, n, s);
|
|
1930
1931
|
}
|
|
1931
|
-
return
|
|
1932
|
+
return va = e, va;
|
|
1932
1933
|
}
|
|
1933
1934
|
var ig = sg();
|
|
1934
1935
|
const ag = /* @__PURE__ */ In(ig), Dr = {
|
|
@@ -1936,7 +1937,7 @@ const ag = /* @__PURE__ */ In(ig), Dr = {
|
|
|
1936
1937
|
collections: {}
|
|
1937
1938
|
}, og = () => {
|
|
1938
1939
|
Dr.global = {}, Dr.collections = {};
|
|
1939
|
-
},
|
|
1940
|
+
}, _e = async (r, e) => {
|
|
1940
1941
|
let t = r;
|
|
1941
1942
|
return r && (typeof r == "function" || typeof r.then == "function") && (e ? t = await r(...e) : t = await r()), t;
|
|
1942
1943
|
}, ne = async (r, e, t, n) => {
|
|
@@ -1963,7 +1964,7 @@ const ag = /* @__PURE__ */ In(ig), Dr = {
|
|
|
1963
1964
|
o = o[u];
|
|
1964
1965
|
}
|
|
1965
1966
|
let l;
|
|
1966
|
-
if (c && (l = await
|
|
1967
|
+
if (c && (l = await _e(o, t)), l) {
|
|
1967
1968
|
let u = Dr;
|
|
1968
1969
|
const f = {};
|
|
1969
1970
|
for (let d = 0; d < e.length; d++) {
|
|
@@ -1983,7 +1984,7 @@ const ag = /* @__PURE__ */ In(ig), Dr = {
|
|
|
1983
1984
|
for (const a of n) {
|
|
1984
1985
|
const { fields: o } = a;
|
|
1985
1986
|
for (const c of o)
|
|
1986
|
-
if (
|
|
1987
|
+
if (ve(c) && c.collection === s.collection && c.dependencyFields)
|
|
1987
1988
|
for (const l of c.dependencyFields)
|
|
1988
1989
|
l.field == r.name && (i = !0);
|
|
1989
1990
|
}
|
|
@@ -1993,7 +1994,7 @@ const ag = /* @__PURE__ */ In(ig), Dr = {
|
|
|
1993
1994
|
return t.forEach((i) => {
|
|
1994
1995
|
const { labels: a, fields: o } = i;
|
|
1995
1996
|
o.forEach((c) => {
|
|
1996
|
-
|
|
1997
|
+
ve(c) && c.collection === n.collection && c.dependencyFields && c.dependencyFields.forEach((l) => {
|
|
1997
1998
|
s[l.field] ||= {}, s[l.field][a.collection] ||= [], s[l.field][a.collection] = s[l.field][a.collection].concat(l.roles), s[l.field][a.collection] = [
|
|
1998
1999
|
...new Set(s[l.field][a.collection])
|
|
1999
2000
|
];
|
|
@@ -2127,7 +2128,7 @@ const ag = /* @__PURE__ */ In(ig), Dr = {
|
|
|
2127
2128
|
if (Object.values(o).forEach((c) => {
|
|
2128
2129
|
Object.keys(c).forEach((l) => {
|
|
2129
2130
|
t.collections[l].fields.forEach((f) => {
|
|
2130
|
-
|
|
2131
|
+
ve(f) && f.collection === e.labels.collection && f.dependencyFields?.some((d) => d.field === r.name) && f.constraints && f.constraints.forEach((d) => {
|
|
2131
2132
|
a.push(d[0]);
|
|
2132
2133
|
});
|
|
2133
2134
|
});
|
|
@@ -2144,19 +2145,19 @@ const ag = /* @__PURE__ */ In(ig), Dr = {
|
|
|
2144
2145
|
return [...t, ...n.filter((a) => a.name !== "id")].forEach((a) => {
|
|
2145
2146
|
r?.fields.some((o) => o.name === a.name) || s.push(a);
|
|
2146
2147
|
}), s;
|
|
2147
|
-
},
|
|
2148
|
+
}, _a = async (r, e, t) => {
|
|
2148
2149
|
if (e) {
|
|
2149
|
-
const n = await
|
|
2150
|
+
const n = await _e(e, t);
|
|
2150
2151
|
if (n === !1)
|
|
2151
2152
|
throw new Error(`CANCELLED: Operation cancelled by ${r}`);
|
|
2152
2153
|
return n;
|
|
2153
2154
|
}
|
|
2154
2155
|
};
|
|
2155
2156
|
async function ae(r, e, t, n) {
|
|
2156
|
-
const s = await
|
|
2157
|
+
const s = await _a(r, t.custom?.[r], n);
|
|
2157
2158
|
for (const i of t.fields)
|
|
2158
|
-
await
|
|
2159
|
-
if (r !== "setEmbedding" && (await
|
|
2159
|
+
await _a(r, i.custom?.[r], n);
|
|
2160
|
+
if (r !== "setEmbedding" && (await _a(r, e?.[r], n), r === "postWriteError"))
|
|
2160
2161
|
return s;
|
|
2161
2162
|
}
|
|
2162
2163
|
const Ko = (r, e, t, n, s, i, a, o, c, l) => (r == "create" && (t.Collection_Path = e, l || (t.Created_At = o), t.Saved_At = c, t.Created_By = a || "System"), t.Last_Write_App = s, l || (t.Last_Write_At = o), t.Last_Save_At = c, t.Last_Write_By = a || "System", t.Last_Write_Connection_Status = i, t.Last_Write_Version = n.version, t), Qd = (r, e) => {
|
|
@@ -2164,10 +2165,10 @@ const Ko = (r, e, t, n, s, i, a, o, c, l) => (r == "create" && (t.Collection_Pat
|
|
|
2164
2165
|
if (n)
|
|
2165
2166
|
for (const a of n) {
|
|
2166
2167
|
const o = te(e, a.field);
|
|
2167
|
-
e.find((c) => c.name === a.field) &&
|
|
2168
|
+
e.find((c) => c.name === a.field) && ve(o) && ["OneToOne", "OneToMany"].includes(o.type) && i.add(o);
|
|
2168
2169
|
}
|
|
2169
2170
|
return e.forEach((a) => {
|
|
2170
|
-
|
|
2171
|
+
ve(a) && ["OneToOne", "OneToMany"].includes(a.type) && a.sorting && (typeof a.sorting == "boolean" || !a.sorting.roles?.every((o) => s?.includes(o))) && i.add(a);
|
|
2171
2172
|
}), i;
|
|
2172
2173
|
}, Zr = (r, e) => {
|
|
2173
2174
|
const { access: t, recordTitleField: n } = r, { serverReadOnly: s } = t, i = /* @__PURE__ */ new Set();
|
|
@@ -2177,7 +2178,7 @@ const Ko = (r, e, t, n, s, i, a, o, c, l) => (r == "create" && (t.Collection_Pat
|
|
|
2177
2178
|
}, Xd = (r, e, t) => {
|
|
2178
2179
|
const { fields: n } = r;
|
|
2179
2180
|
n.forEach((i) => {
|
|
2180
|
-
if (
|
|
2181
|
+
if (ve(i))
|
|
2181
2182
|
if (e[i.name]) {
|
|
2182
2183
|
if (ir(e[i.name]))
|
|
2183
2184
|
e[`${i.name}_Array`] = e[i.name];
|
|
@@ -2210,10 +2211,10 @@ const Ko = (r, e, t, n, s, i, a, o, c, l) => (r == "create" && (t.Collection_Pat
|
|
|
2210
2211
|
const { fields: s } = e;
|
|
2211
2212
|
for (const i of t.fields) {
|
|
2212
2213
|
const a = te(s, i.name);
|
|
2213
|
-
i.custom?.initialValue !== void 0 && !(n && a.access && !a.access.includes(n)) && (r[i.name] = await
|
|
2214
|
+
i.custom?.initialValue !== void 0 && !(n && a.access && !a.access.includes(n)) && (r[i.name] = await _e(i.custom.initialValue, [r]), Zr(e, [a]).size === 1 && (r[`${i.name}_Lowercase`] = r[i.name].toLowerCase()));
|
|
2214
2215
|
}
|
|
2215
2216
|
for (const i of s)
|
|
2216
|
-
n && i.access && !i.access.includes(n) || ("autoIncrement" in i && i.autoIncrement && !r[i.name] && (r[i.name] = "Pending"), !
|
|
2217
|
+
n && i.access && !i.access.includes(n) || ("autoIncrement" in i && i.autoIncrement && !r[i.name] && (r[i.name] = "Pending"), !ve(i) && i.nullable && r[i.name] === void 0 && (r[i.name] = null));
|
|
2217
2218
|
};
|
|
2218
2219
|
var fe;
|
|
2219
2220
|
(function(r) {
|
|
@@ -2320,7 +2321,7 @@ const V = fe.arrayToEnum([
|
|
|
2320
2321
|
"not_multiple_of",
|
|
2321
2322
|
"not_finite"
|
|
2322
2323
|
]);
|
|
2323
|
-
class
|
|
2324
|
+
class vt extends Error {
|
|
2324
2325
|
get errors() {
|
|
2325
2326
|
return this.issues;
|
|
2326
2327
|
}
|
|
@@ -2357,7 +2358,7 @@ class gt extends Error {
|
|
|
2357
2358
|
return s(this), n;
|
|
2358
2359
|
}
|
|
2359
2360
|
static assert(e) {
|
|
2360
|
-
if (!(e instanceof
|
|
2361
|
+
if (!(e instanceof vt))
|
|
2361
2362
|
throw new Error(`Not a ZodError: ${e}`);
|
|
2362
2363
|
}
|
|
2363
2364
|
toString() {
|
|
@@ -2383,7 +2384,7 @@ class gt extends Error {
|
|
|
2383
2384
|
return this.flatten();
|
|
2384
2385
|
}
|
|
2385
2386
|
}
|
|
2386
|
-
|
|
2387
|
+
vt.create = (r) => new vt(r);
|
|
2387
2388
|
const ro = (r, e) => {
|
|
2388
2389
|
let t;
|
|
2389
2390
|
switch (r.code) {
|
|
@@ -2531,7 +2532,7 @@ var W;
|
|
|
2531
2532
|
(function(r) {
|
|
2532
2533
|
r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
2533
2534
|
})(W || (W = {}));
|
|
2534
|
-
class
|
|
2535
|
+
class lt {
|
|
2535
2536
|
constructor(e, t, n, s) {
|
|
2536
2537
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = s;
|
|
2537
2538
|
}
|
|
@@ -2549,7 +2550,7 @@ const lf = (r, e) => {
|
|
|
2549
2550
|
get error() {
|
|
2550
2551
|
if (this._error)
|
|
2551
2552
|
return this._error;
|
|
2552
|
-
const t = new
|
|
2553
|
+
const t = new vt(r.common.issues);
|
|
2553
2554
|
return this._error = t, this._error;
|
|
2554
2555
|
}
|
|
2555
2556
|
};
|
|
@@ -2722,7 +2723,7 @@ class ce {
|
|
|
2722
2723
|
return ot.create(this);
|
|
2723
2724
|
}
|
|
2724
2725
|
promise() {
|
|
2725
|
-
return
|
|
2726
|
+
return vn.create(this, this._def);
|
|
2726
2727
|
}
|
|
2727
2728
|
or(e) {
|
|
2728
2729
|
return pn.create([this, e], this._def);
|
|
@@ -2783,7 +2784,7 @@ class ce {
|
|
|
2783
2784
|
return this.safeParse(null).success;
|
|
2784
2785
|
}
|
|
2785
2786
|
}
|
|
2786
|
-
const gg = /^c[^\s-]{8,}$/i,
|
|
2787
|
+
const gg = /^c[^\s-]{8,}$/i, vg = /^[0-9a-z]+$/, _g = /^[0-9A-HJKMNP-TV-Z]{26}$/i, wg = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, bg = /^[a-z0-9_-]{21}$/i, Og = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Eg = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Sg = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Tg = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
2787
2788
|
let wa;
|
|
2788
2789
|
const Rg = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Cg = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Ag = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, kg = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ig = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, xg = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, th = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Ng = new RegExp(`^${th}$`);
|
|
2789
2790
|
function rh(r) {
|
|
@@ -2819,7 +2820,7 @@ function Pg(r, e) {
|
|
|
2819
2820
|
function qg(r, e) {
|
|
2820
2821
|
return !!((e === "v4" || !e) && Cg.test(r) || (e === "v6" || !e) && kg.test(r));
|
|
2821
2822
|
}
|
|
2822
|
-
class
|
|
2823
|
+
class gt extends ce {
|
|
2823
2824
|
_parse(e) {
|
|
2824
2825
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== V.string) {
|
|
2825
2826
|
const i = this._getOrReturnCtx(e);
|
|
@@ -2898,13 +2899,13 @@ class yt extends ce {
|
|
|
2898
2899
|
message: i.message
|
|
2899
2900
|
}), n.dirty());
|
|
2900
2901
|
else if (i.kind === "cuid2")
|
|
2901
|
-
|
|
2902
|
+
vg.test(e.data) || (s = this._getOrReturnCtx(e, s), $(s, {
|
|
2902
2903
|
validation: "cuid2",
|
|
2903
2904
|
code: x.invalid_string,
|
|
2904
2905
|
message: i.message
|
|
2905
2906
|
}), n.dirty());
|
|
2906
2907
|
else if (i.kind === "ulid")
|
|
2907
|
-
|
|
2908
|
+
_g.test(e.data) || (s = this._getOrReturnCtx(e, s), $(s, {
|
|
2908
2909
|
validation: "ulid",
|
|
2909
2910
|
code: x.invalid_string,
|
|
2910
2911
|
message: i.message
|
|
@@ -2982,7 +2983,7 @@ class yt extends ce {
|
|
|
2982
2983
|
});
|
|
2983
2984
|
}
|
|
2984
2985
|
_addCheck(e) {
|
|
2985
|
-
return new
|
|
2986
|
+
return new gt({
|
|
2986
2987
|
...this._def,
|
|
2987
2988
|
checks: [...this._def.checks, e]
|
|
2988
2989
|
});
|
|
@@ -3118,19 +3119,19 @@ class yt extends ce {
|
|
|
3118
3119
|
return this.min(1, W.errToObj(e));
|
|
3119
3120
|
}
|
|
3120
3121
|
trim() {
|
|
3121
|
-
return new
|
|
3122
|
+
return new gt({
|
|
3122
3123
|
...this._def,
|
|
3123
3124
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
3124
3125
|
});
|
|
3125
3126
|
}
|
|
3126
3127
|
toLowerCase() {
|
|
3127
|
-
return new
|
|
3128
|
+
return new gt({
|
|
3128
3129
|
...this._def,
|
|
3129
3130
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
3130
3131
|
});
|
|
3131
3132
|
}
|
|
3132
3133
|
toUpperCase() {
|
|
3133
|
-
return new
|
|
3134
|
+
return new gt({
|
|
3134
3135
|
...this._def,
|
|
3135
3136
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
3136
3137
|
});
|
|
@@ -3196,7 +3197,7 @@ class yt extends ce {
|
|
|
3196
3197
|
return e;
|
|
3197
3198
|
}
|
|
3198
3199
|
}
|
|
3199
|
-
|
|
3200
|
+
gt.create = (r) => new gt({
|
|
3200
3201
|
checks: [],
|
|
3201
3202
|
typeName: Q.ZodString,
|
|
3202
3203
|
coerce: r?.coerce ?? !1,
|
|
@@ -3749,8 +3750,8 @@ class ot extends ce {
|
|
|
3749
3750
|
exact: !1,
|
|
3750
3751
|
message: s.maxLength.message
|
|
3751
3752
|
}), n.dirty()), t.common.async)
|
|
3752
|
-
return Promise.all([...t.data].map((a, o) => s.type._parseAsync(new
|
|
3753
|
-
const i = [...t.data].map((a, o) => s.type._parseSync(new
|
|
3753
|
+
return Promise.all([...t.data].map((a, o) => s.type._parseAsync(new lt(t, a, t.path, o)))).then((a) => qe.mergeArray(n, a));
|
|
3754
|
+
const i = [...t.data].map((a, o) => s.type._parseSync(new lt(t, a, t.path, o)));
|
|
3754
3755
|
return qe.mergeArray(n, i);
|
|
3755
3756
|
}
|
|
3756
3757
|
get element() {
|
|
@@ -3830,7 +3831,7 @@ class Ce extends ce {
|
|
|
3830
3831
|
const u = i[l], f = s.data[l];
|
|
3831
3832
|
c.push({
|
|
3832
3833
|
key: { status: "valid", value: l },
|
|
3833
|
-
value: u._parse(new
|
|
3834
|
+
value: u._parse(new lt(s, f, s.path, l)),
|
|
3834
3835
|
alwaysSet: l in s.data
|
|
3835
3836
|
});
|
|
3836
3837
|
}
|
|
@@ -3855,7 +3856,7 @@ class Ce extends ce {
|
|
|
3855
3856
|
c.push({
|
|
3856
3857
|
key: { status: "valid", value: u },
|
|
3857
3858
|
value: l._parse(
|
|
3858
|
-
new
|
|
3859
|
+
new lt(s, f, s.path, u)
|
|
3859
3860
|
//, ctx.child(key), value, getParsedType(value)
|
|
3860
3861
|
),
|
|
3861
3862
|
alwaysSet: u in s.data
|
|
@@ -4099,7 +4100,7 @@ class pn extends ce {
|
|
|
4099
4100
|
for (const o of i)
|
|
4100
4101
|
if (o.result.status === "dirty")
|
|
4101
4102
|
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
4102
|
-
const a = i.map((o) => new
|
|
4103
|
+
const a = i.map((o) => new vt(o.ctx.common.issues));
|
|
4103
4104
|
return $(t, {
|
|
4104
4105
|
code: x.invalid_union,
|
|
4105
4106
|
unionErrors: a
|
|
@@ -4146,7 +4147,7 @@ class pn extends ce {
|
|
|
4146
4147
|
}
|
|
4147
4148
|
if (i)
|
|
4148
4149
|
return t.common.issues.push(...i.ctx.common.issues), i.result;
|
|
4149
|
-
const o = a.map((c) => new
|
|
4150
|
+
const o = a.map((c) => new vt(c));
|
|
4150
4151
|
return $(t, {
|
|
4151
4152
|
code: x.invalid_union,
|
|
4152
4153
|
unionErrors: o
|
|
@@ -4252,7 +4253,7 @@ class Wt extends ce {
|
|
|
4252
4253
|
}), t.dirty());
|
|
4253
4254
|
const i = [...n.data].map((a, o) => {
|
|
4254
4255
|
const c = this._def.items[o] || this._def.rest;
|
|
4255
|
-
return c ? c._parse(new
|
|
4256
|
+
return c ? c._parse(new lt(n, a, n.path, o)) : null;
|
|
4256
4257
|
}).filter((a) => !!a);
|
|
4257
4258
|
return n.common.async ? Promise.all(i).then((a) => qe.mergeArray(t, a)) : qe.mergeArray(t, i);
|
|
4258
4259
|
}
|
|
@@ -4294,8 +4295,8 @@ class gn extends ce {
|
|
|
4294
4295
|
const s = [], i = this._def.keyType, a = this._def.valueType;
|
|
4295
4296
|
for (const o in n.data)
|
|
4296
4297
|
s.push({
|
|
4297
|
-
key: i._parse(new
|
|
4298
|
-
value: a._parse(new
|
|
4298
|
+
key: i._parse(new lt(n, o, n.path, o)),
|
|
4299
|
+
value: a._parse(new lt(n, n.data[o], n.path, o)),
|
|
4299
4300
|
alwaysSet: o in n.data
|
|
4300
4301
|
});
|
|
4301
4302
|
return n.common.async ? qe.mergeObjectAsync(t, s) : qe.mergeObjectSync(t, s);
|
|
@@ -4310,7 +4311,7 @@ class gn extends ce {
|
|
|
4310
4311
|
typeName: Q.ZodRecord,
|
|
4311
4312
|
...se(n)
|
|
4312
4313
|
}) : new gn({
|
|
4313
|
-
keyType:
|
|
4314
|
+
keyType: gt.create(),
|
|
4314
4315
|
valueType: e,
|
|
4315
4316
|
typeName: Q.ZodRecord,
|
|
4316
4317
|
...se(t)
|
|
@@ -4333,8 +4334,8 @@ class pf extends ce {
|
|
|
4333
4334
|
received: n.parsedType
|
|
4334
4335
|
}), ee;
|
|
4335
4336
|
const s = this._def.keyType, i = this._def.valueType, a = [...n.data.entries()].map(([o, c], l) => ({
|
|
4336
|
-
key: s._parse(new
|
|
4337
|
-
value: i._parse(new
|
|
4337
|
+
key: s._parse(new lt(n, o, n.path, [l, "key"])),
|
|
4338
|
+
value: i._parse(new lt(n, c, n.path, [l, "value"]))
|
|
4338
4339
|
}));
|
|
4339
4340
|
if (n.common.async) {
|
|
4340
4341
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -4400,7 +4401,7 @@ class jr extends ce {
|
|
|
4400
4401
|
}
|
|
4401
4402
|
return { status: t.value, value: l };
|
|
4402
4403
|
}
|
|
4403
|
-
const o = [...n.data.values()].map((c, l) => i._parse(new
|
|
4404
|
+
const o = [...n.data.values()].map((c, l) => i._parse(new lt(n, c, n.path, l)));
|
|
4404
4405
|
return n.common.async ? Promise.all(o).then((c) => a(c)) : a(o);
|
|
4405
4406
|
}
|
|
4406
4407
|
min(e, t) {
|
|
@@ -4556,7 +4557,7 @@ gf.create = (r, e) => new gf({
|
|
|
4556
4557
|
typeName: Q.ZodNativeEnum,
|
|
4557
4558
|
...se(e)
|
|
4558
4559
|
});
|
|
4559
|
-
class
|
|
4560
|
+
class vn extends ce {
|
|
4560
4561
|
unwrap() {
|
|
4561
4562
|
return this._def.type;
|
|
4562
4563
|
}
|
|
@@ -4575,7 +4576,7 @@ class _n extends ce {
|
|
|
4575
4576
|
})));
|
|
4576
4577
|
}
|
|
4577
4578
|
}
|
|
4578
|
-
|
|
4579
|
+
vn.create = (r, e) => new vn({
|
|
4579
4580
|
type: r,
|
|
4580
4581
|
typeName: Q.ZodPromise,
|
|
4581
4582
|
...se(e)
|
|
@@ -4737,7 +4738,7 @@ class co extends ce {
|
|
|
4737
4738
|
status: "valid",
|
|
4738
4739
|
value: i.status === "valid" ? i.value : this._def.catchValue({
|
|
4739
4740
|
get error() {
|
|
4740
|
-
return new
|
|
4741
|
+
return new vt(n.common.issues);
|
|
4741
4742
|
},
|
|
4742
4743
|
input: n.data
|
|
4743
4744
|
})
|
|
@@ -4745,7 +4746,7 @@ class co extends ce {
|
|
|
4745
4746
|
status: "valid",
|
|
4746
4747
|
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
4747
4748
|
get error() {
|
|
4748
|
-
return new
|
|
4749
|
+
return new vt(n.common.issues);
|
|
4749
4750
|
},
|
|
4750
4751
|
input: n.data
|
|
4751
4752
|
})
|
|
@@ -4761,7 +4762,7 @@ co.create = (r, e) => new co({
|
|
|
4761
4762
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
4762
4763
|
...se(e)
|
|
4763
4764
|
});
|
|
4764
|
-
class
|
|
4765
|
+
class vf extends ce {
|
|
4765
4766
|
_parse(e) {
|
|
4766
4767
|
if (this._getType(e) !== V.nan) {
|
|
4767
4768
|
const n = this._getOrReturnCtx(e);
|
|
@@ -4774,7 +4775,7 @@ class _f extends ce {
|
|
|
4774
4775
|
return { status: "valid", value: e.data };
|
|
4775
4776
|
}
|
|
4776
4777
|
}
|
|
4777
|
-
|
|
4778
|
+
vf.create = (r) => new vf({
|
|
4778
4779
|
typeName: Q.ZodNaN,
|
|
4779
4780
|
...se(r)
|
|
4780
4781
|
});
|
|
@@ -4849,18 +4850,18 @@ var Q;
|
|
|
4849
4850
|
(function(r) {
|
|
4850
4851
|
r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
|
|
4851
4852
|
})(Q || (Q = {}));
|
|
4852
|
-
const at =
|
|
4853
|
+
const at = gt.create, uo = or.create, jg = no.create, Ut = so.create;
|
|
4853
4854
|
Ft.create;
|
|
4854
|
-
const Ln = ot.create, sh = Ce.create,
|
|
4855
|
+
const Ln = ot.create, sh = Ce.create, _n = pn.create;
|
|
4855
4856
|
yn.create;
|
|
4856
4857
|
Wt.create;
|
|
4857
4858
|
const Jo = gn.create, fo = ao.create, ho = cr.create;
|
|
4858
|
-
|
|
4859
|
+
vn.create;
|
|
4859
4860
|
It.create;
|
|
4860
4861
|
ur.create;
|
|
4861
4862
|
const on = () => Ut().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds !== void 0 || r._seconds !== void 0 && r._nanoseconds !== void 0), {
|
|
4862
4863
|
message: "Value is not a valid timestamp"
|
|
4863
|
-
}),
|
|
4864
|
+
}), _f = () => Ut().refine((r) => r && (r._methodName === "serverTimestamp" || r.constructor.name === "ServerTimestampTransform"), {
|
|
4864
4865
|
message: "Value is not a valid server timestamp"
|
|
4865
4866
|
}), ih = (r, e, t) => {
|
|
4866
4867
|
const n = {};
|
|
@@ -4884,7 +4885,7 @@ const on = () => Ut().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4884
4885
|
let t = Jo(ih(r, e));
|
|
4885
4886
|
return r.required || (t = t.optional()), t;
|
|
4886
4887
|
}, Vg = (r) => {
|
|
4887
|
-
let e = Ln(
|
|
4888
|
+
let e = Ln(_n([at().length(20), at().length(28)]));
|
|
4888
4889
|
return ["OneToOne", "OneToMany"].includes(r.type) ? e = e.max(1) : (r.min && (e = e.min(r.min)), r.max && (e = e.max(r.max)), r.length && (e = e.length(r.length))), r.required ? e = e.nonempty() : e = e.optional(), e;
|
|
4889
4890
|
}, wn = (r, e, t) => {
|
|
4890
4891
|
const { softDelete: n } = r, s = n?.timestampField;
|
|
@@ -4902,7 +4903,7 @@ const on = () => Ut().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4902
4903
|
i = jg();
|
|
4903
4904
|
break;
|
|
4904
4905
|
case "Number":
|
|
4905
|
-
e.autoIncrement ? i =
|
|
4906
|
+
e.autoIncrement ? i = _n([fo("Pending"), uo().int()]) : (i = uo(), e.min && (i = i.min(e.min)), e.max && (i = i.max(e.max)), e.decimal ? i = i.refine((a) => e.decimal ? (a.toString().split(".")[1]?.length || 0) <= e.decimal : !1, {
|
|
4906
4907
|
message: `Value must have ${e.decimal} or fewer decimal places`
|
|
4907
4908
|
}) : i = i.int(), e.values && (i = i.refine((a) => e.values?.includes(a), {
|
|
4908
4909
|
message: "Value is not an allowed value"
|
|
@@ -4934,24 +4935,24 @@ const on = () => Ut().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4934
4935
|
i = Ut();
|
|
4935
4936
|
break;
|
|
4936
4937
|
}
|
|
4937
|
-
return !
|
|
4938
|
+
return !ve(e) && e.nullable && (i = i.nullable()), e.required || (i = i.optional()), i;
|
|
4938
4939
|
}, Wg = (r, e, t) => {
|
|
4939
4940
|
const n = {
|
|
4940
4941
|
Collection_Path: Ln(at()),
|
|
4941
4942
|
Last_Write_App: at(),
|
|
4942
4943
|
Last_Write_At: on(),
|
|
4943
|
-
Last_Save_At:
|
|
4944
|
-
Last_Write_By:
|
|
4944
|
+
Last_Save_At: _f(),
|
|
4945
|
+
Last_Write_By: _n([at().length(28), fo("System")]),
|
|
4945
4946
|
Last_Write_Connection_Status: ho(["Online", "Offline"]),
|
|
4946
4947
|
Last_Write_Version: uo().int(),
|
|
4947
4948
|
id: at().regex(new RegExp("^[a-zA-Z0-9]+$")).length(20),
|
|
4948
4949
|
Created_At: on(),
|
|
4949
|
-
Created_By:
|
|
4950
|
+
Created_By: _n([at().length(28), fo("System")])
|
|
4950
4951
|
};
|
|
4951
|
-
r === "create" && (n.Saved_At =
|
|
4952
|
+
r === "create" && (n.Saved_At = _f()), r === "update" && (n.Saved_At = on(), n.Collection_Path = n.Collection_Path.optional(), n.id = n.id.optional(), n.Created_At = n.Created_At.optional(), n.Saved_At = n.Saved_At.optional(), n.Created_By = n.Created_By.optional());
|
|
4952
4953
|
const s = Qd(e, e.fields), i = Array.from(s).map((c) => c.name);
|
|
4953
4954
|
e.fields.forEach((c) => {
|
|
4954
|
-
|
|
4955
|
+
ve(c) ? (n[c.name] = Ug(c, t), n[`${c.name}_Array`] = Vg(c), i.includes(c.name) && (n[`${c.name}_Single`] = ih(c, t, !0), c.required || (n[`${c.name}_Single`] = n[`${c.name}_Single`].optional())), c.length && (n[c.name] = n[c.name].refine((l) => c.length && l && Object.keys(l).length === c.length, {
|
|
4955
4956
|
message: `Value must contain ${c.length} item(s)`
|
|
4956
4957
|
})), c.min && (n[c.name] = n[c.name].refine((l) => c.min && l && Object.keys(l).length >= c.min, {
|
|
4957
4958
|
message: `Value must contain at least ${c.min} item(s)`
|
|
@@ -5055,13 +5056,13 @@ const q = "numeric", st = "short", je = "long", bn = {
|
|
|
5055
5056
|
second: q,
|
|
5056
5057
|
hourCycle: "h23",
|
|
5057
5058
|
timeZoneName: je
|
|
5058
|
-
},
|
|
5059
|
+
}, vh = {
|
|
5059
5060
|
year: q,
|
|
5060
5061
|
month: q,
|
|
5061
5062
|
day: q,
|
|
5062
5063
|
hour: q,
|
|
5063
5064
|
minute: q
|
|
5064
|
-
},
|
|
5065
|
+
}, _h = {
|
|
5065
5066
|
year: q,
|
|
5066
5067
|
month: q,
|
|
5067
5068
|
day: q,
|
|
@@ -5436,28 +5437,28 @@ function yo(r, e = {}) {
|
|
|
5436
5437
|
return n === void 0 && (n = new Intl.DateTimeFormat(r, e), po.set(t, n)), n;
|
|
5437
5438
|
}
|
|
5438
5439
|
const go = /* @__PURE__ */ new Map();
|
|
5439
|
-
function
|
|
5440
|
+
function ev(r, e = {}) {
|
|
5440
5441
|
const t = JSON.stringify([r, e]);
|
|
5441
5442
|
let n = go.get(t);
|
|
5442
5443
|
return n === void 0 && (n = new Intl.NumberFormat(r, e), go.set(t, n)), n;
|
|
5443
5444
|
}
|
|
5444
|
-
const
|
|
5445
|
-
function
|
|
5445
|
+
const vo = /* @__PURE__ */ new Map();
|
|
5446
|
+
function tv(r, e = {}) {
|
|
5446
5447
|
const { base: t, ...n } = e, s = JSON.stringify([r, n]);
|
|
5447
|
-
let i =
|
|
5448
|
-
return i === void 0 && (i = new Intl.RelativeTimeFormat(r, e),
|
|
5448
|
+
let i = vo.get(s);
|
|
5449
|
+
return i === void 0 && (i = new Intl.RelativeTimeFormat(r, e), vo.set(s, i)), i;
|
|
5449
5450
|
}
|
|
5450
5451
|
let Ar = null;
|
|
5451
|
-
function
|
|
5452
|
+
function rv() {
|
|
5452
5453
|
return Ar || (Ar = new Intl.DateTimeFormat().resolvedOptions().locale, Ar);
|
|
5453
5454
|
}
|
|
5454
|
-
const
|
|
5455
|
+
const _o = /* @__PURE__ */ new Map();
|
|
5455
5456
|
function Rh(r) {
|
|
5456
|
-
let e =
|
|
5457
|
-
return e === void 0 && (e = new Intl.DateTimeFormat(r).resolvedOptions(),
|
|
5457
|
+
let e = _o.get(r);
|
|
5458
|
+
return e === void 0 && (e = new Intl.DateTimeFormat(r).resolvedOptions(), _o.set(r, e)), e;
|
|
5458
5459
|
}
|
|
5459
5460
|
const wo = /* @__PURE__ */ new Map();
|
|
5460
|
-
function
|
|
5461
|
+
function nv(r) {
|
|
5461
5462
|
let e = wo.get(r);
|
|
5462
5463
|
if (!e) {
|
|
5463
5464
|
const t = new Intl.Locale(r);
|
|
@@ -5465,7 +5466,7 @@ function n_(r) {
|
|
|
5465
5466
|
}
|
|
5466
5467
|
return e;
|
|
5467
5468
|
}
|
|
5468
|
-
function
|
|
5469
|
+
function sv(r) {
|
|
5469
5470
|
const e = r.indexOf("-x-");
|
|
5470
5471
|
e !== -1 && (r = r.substring(0, e));
|
|
5471
5472
|
const t = r.indexOf("-u-");
|
|
@@ -5483,10 +5484,10 @@ function s_(r) {
|
|
|
5483
5484
|
return [s, i, a];
|
|
5484
5485
|
}
|
|
5485
5486
|
}
|
|
5486
|
-
function
|
|
5487
|
+
function iv(r, e, t) {
|
|
5487
5488
|
return (t || e) && (r.includes("-u-") || (r += "-u"), t && (r += `-ca-${t}`), e && (r += `-nu-${e}`)), r;
|
|
5488
5489
|
}
|
|
5489
|
-
function
|
|
5490
|
+
function av(r) {
|
|
5490
5491
|
const e = [];
|
|
5491
5492
|
for (let t = 1; t <= 12; t++) {
|
|
5492
5493
|
const n = B.utc(2009, t, 1);
|
|
@@ -5494,7 +5495,7 @@ function a_(r) {
|
|
|
5494
5495
|
}
|
|
5495
5496
|
return e;
|
|
5496
5497
|
}
|
|
5497
|
-
function
|
|
5498
|
+
function ov(r) {
|
|
5498
5499
|
const e = [];
|
|
5499
5500
|
for (let t = 1; t <= 7; t++) {
|
|
5500
5501
|
const n = B.utc(2016, 11, 13 + t);
|
|
@@ -5506,16 +5507,16 @@ function tn(r, e, t, n) {
|
|
|
5506
5507
|
const s = r.listingMode();
|
|
5507
5508
|
return s === "error" ? null : s === "en" ? t(e) : n(e);
|
|
5508
5509
|
}
|
|
5509
|
-
function
|
|
5510
|
+
function cv(r) {
|
|
5510
5511
|
return r.numberingSystem && r.numberingSystem !== "latn" ? !1 : r.numberingSystem === "latn" || !r.locale || r.locale.startsWith("en") || Rh(r.locale).numberingSystem === "latn";
|
|
5511
5512
|
}
|
|
5512
|
-
class
|
|
5513
|
+
class lv {
|
|
5513
5514
|
constructor(e, t, n) {
|
|
5514
5515
|
this.padTo = n.padTo || 0, this.floor = n.floor || !1;
|
|
5515
5516
|
const { padTo: s, floor: i, ...a } = n;
|
|
5516
5517
|
if (!t || Object.keys(a).length > 0) {
|
|
5517
5518
|
const o = { useGrouping: !1, ...n };
|
|
5518
|
-
n.padTo > 0 && (o.minimumIntegerDigits = n.padTo), this.inf =
|
|
5519
|
+
n.padTo > 0 && (o.minimumIntegerDigits = n.padTo), this.inf = ev(e, o);
|
|
5519
5520
|
}
|
|
5520
5521
|
}
|
|
5521
5522
|
format(e) {
|
|
@@ -5528,7 +5529,7 @@ class l_ {
|
|
|
5528
5529
|
}
|
|
5529
5530
|
}
|
|
5530
5531
|
}
|
|
5531
|
-
class
|
|
5532
|
+
class uv {
|
|
5532
5533
|
constructor(e, t, n) {
|
|
5533
5534
|
this.opts = n, this.originalZone = void 0;
|
|
5534
5535
|
let s;
|
|
@@ -5564,12 +5565,12 @@ class u_ {
|
|
|
5564
5565
|
return this.dtf.resolvedOptions();
|
|
5565
5566
|
}
|
|
5566
5567
|
}
|
|
5567
|
-
class
|
|
5568
|
+
class fv {
|
|
5568
5569
|
constructor(e, t, n) {
|
|
5569
|
-
this.opts = { style: "long", ...n }, !t && Dh() && (this.rtf =
|
|
5570
|
+
this.opts = { style: "long", ...n }, !t && Dh() && (this.rtf = tv(e, n));
|
|
5570
5571
|
}
|
|
5571
5572
|
format(e, t) {
|
|
5572
|
-
return this.rtf ? this.rtf.format(e, t) :
|
|
5573
|
+
return this.rtf ? this.rtf.format(e, t) : Fv(t, e, this.opts.numeric, this.opts.style !== "long");
|
|
5573
5574
|
}
|
|
5574
5575
|
formatToParts(e, t) {
|
|
5575
5576
|
return this.rtf ? this.rtf.formatToParts(e, t) : [];
|
|
@@ -5591,21 +5592,21 @@ class he {
|
|
|
5591
5592
|
);
|
|
5592
5593
|
}
|
|
5593
5594
|
static create(e, t, n, s, i = !1) {
|
|
5594
|
-
const a = e || Ee.defaultLocale, o = a || (i ? "en-US" :
|
|
5595
|
+
const a = e || Ee.defaultLocale, o = a || (i ? "en-US" : rv()), c = t || Ee.defaultNumberingSystem, l = n || Ee.defaultOutputCalendar, u = Oo(s) || Ee.defaultWeekSettings;
|
|
5595
5596
|
return new he(o, c, l, u, a);
|
|
5596
5597
|
}
|
|
5597
5598
|
static resetCache() {
|
|
5598
|
-
Ar = null, po.clear(), go.clear(),
|
|
5599
|
+
Ar = null, po.clear(), go.clear(), vo.clear(), _o.clear(), wo.clear();
|
|
5599
5600
|
}
|
|
5600
5601
|
static fromObject({ locale: e, numberingSystem: t, outputCalendar: n, weekSettings: s } = {}) {
|
|
5601
5602
|
return he.create(e, t, n, s);
|
|
5602
5603
|
}
|
|
5603
5604
|
constructor(e, t, n, s, i) {
|
|
5604
|
-
const [a, o, c] =
|
|
5605
|
-
this.locale = a, this.numberingSystem = t || o || null, this.outputCalendar = n || c || null, this.weekSettings = s, this.intl =
|
|
5605
|
+
const [a, o, c] = sv(e);
|
|
5606
|
+
this.locale = a, this.numberingSystem = t || o || null, this.outputCalendar = n || c || null, this.weekSettings = s, this.intl = iv(this.locale, this.numberingSystem, this.outputCalendar), this.weekdaysCache = { format: {}, standalone: {} }, this.monthsCache = { format: {}, standalone: {} }, this.meridiemCache = null, this.eraCache = {}, this.specifiedLocale = i, this.fastNumbersCached = null;
|
|
5606
5607
|
}
|
|
5607
5608
|
get fastNumbers() {
|
|
5608
|
-
return this.fastNumbersCached == null && (this.fastNumbersCached =
|
|
5609
|
+
return this.fastNumbersCached == null && (this.fastNumbersCached = cv(this)), this.fastNumbersCached;
|
|
5609
5610
|
}
|
|
5610
5611
|
listingMode() {
|
|
5611
5612
|
const e = this.isEnglish(), t = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory");
|
|
@@ -5633,7 +5634,7 @@ class he {
|
|
|
5633
5634
|
const s = t ? { month: e, day: "numeric" } : { month: e }, i = t ? "format" : "standalone";
|
|
5634
5635
|
if (!this.monthsCache[i][e]) {
|
|
5635
5636
|
const a = n ? (o) => this.dtFormatter(o, s).format() : (o) => this.extract(o, s, "month");
|
|
5636
|
-
this.monthsCache[i][e] =
|
|
5637
|
+
this.monthsCache[i][e] = av(a);
|
|
5637
5638
|
}
|
|
5638
5639
|
return this.monthsCache[i][e];
|
|
5639
5640
|
});
|
|
@@ -5641,7 +5642,7 @@ class he {
|
|
|
5641
5642
|
weekdays(e, t = !1) {
|
|
5642
5643
|
return tn(this, e, Vh, () => {
|
|
5643
5644
|
const n = t ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, s = t ? "format" : "standalone";
|
|
5644
|
-
return this.weekdaysCache[s][e] || (this.weekdaysCache[s][e] =
|
|
5645
|
+
return this.weekdaysCache[s][e] || (this.weekdaysCache[s][e] = ov(
|
|
5645
5646
|
(i) => this.extract(i, n, "weekday")
|
|
5646
5647
|
)), this.weekdaysCache[s][e];
|
|
5647
5648
|
});
|
|
@@ -5675,13 +5676,13 @@ class he {
|
|
|
5675
5676
|
return a ? a.value : null;
|
|
5676
5677
|
}
|
|
5677
5678
|
numberFormatter(e = {}) {
|
|
5678
|
-
return new
|
|
5679
|
+
return new lv(this.intl, e.forceSimple || this.fastNumbers, e);
|
|
5679
5680
|
}
|
|
5680
5681
|
dtFormatter(e, t = {}) {
|
|
5681
|
-
return new
|
|
5682
|
+
return new uv(e, this.intl, t);
|
|
5682
5683
|
}
|
|
5683
5684
|
relFormatter(e = {}) {
|
|
5684
|
-
return new
|
|
5685
|
+
return new fv(this.intl, this.isEnglish(), e);
|
|
5685
5686
|
}
|
|
5686
5687
|
listFormatter(e = {}) {
|
|
5687
5688
|
return Xg(this.intl, e);
|
|
@@ -5690,7 +5691,7 @@ class he {
|
|
|
5690
5691
|
return this.locale === "en" || this.locale.toLowerCase() === "en-us" || Rh(this.intl).locale.startsWith("en-us");
|
|
5691
5692
|
}
|
|
5692
5693
|
getWeekSettings() {
|
|
5693
|
-
return this.weekSettings ? this.weekSettings : Mh() ?
|
|
5694
|
+
return this.weekSettings ? this.weekSettings : Mh() ? nv(this.locale) : Ch;
|
|
5694
5695
|
}
|
|
5695
5696
|
getStartOfWeek() {
|
|
5696
5697
|
return this.getWeekSettings().firstDay;
|
|
@@ -5828,7 +5829,7 @@ class Pe extends Gr {
|
|
|
5828
5829
|
return !0;
|
|
5829
5830
|
}
|
|
5830
5831
|
}
|
|
5831
|
-
class
|
|
5832
|
+
class dv extends Gr {
|
|
5832
5833
|
constructor(e) {
|
|
5833
5834
|
super(), this.zoneName = e;
|
|
5834
5835
|
}
|
|
@@ -5870,10 +5871,10 @@ function kt(r, e) {
|
|
|
5870
5871
|
return e;
|
|
5871
5872
|
if (r instanceof Gr)
|
|
5872
5873
|
return r;
|
|
5873
|
-
if (
|
|
5874
|
+
if (vv(r)) {
|
|
5874
5875
|
const t = r.toLowerCase();
|
|
5875
5876
|
return t === "default" ? e : t === "local" || t === "system" ? $n.instance : t === "utc" || t === "gmt" ? Pe.utcInstance : Pe.parseSpecifier(t) || _t.create(r);
|
|
5876
|
-
} else return xt(r) ? Pe.instance(r) : typeof r == "object" && "offset" in r && typeof r.offset == "function" ? r : new
|
|
5877
|
+
} else return xt(r) ? Pe.instance(r) : typeof r == "object" && "offset" in r && typeof r.offset == "function" ? r : new dv(r);
|
|
5877
5878
|
}
|
|
5878
5879
|
const Qo = {
|
|
5879
5880
|
arab: "[٠-٩]",
|
|
@@ -5917,15 +5918,15 @@ const Qo = {
|
|
|
5917
5918
|
telu: [3174, 3183],
|
|
5918
5919
|
thai: [3664, 3673],
|
|
5919
5920
|
tibt: [3872, 3881]
|
|
5920
|
-
},
|
|
5921
|
-
function
|
|
5921
|
+
}, hv = Qo.hanidec.replace(/[\[|\]]/g, "").split("");
|
|
5922
|
+
function mv(r) {
|
|
5922
5923
|
let e = parseInt(r, 10);
|
|
5923
5924
|
if (isNaN(e)) {
|
|
5924
5925
|
e = "";
|
|
5925
5926
|
for (let t = 0; t < r.length; t++) {
|
|
5926
5927
|
const n = r.charCodeAt(t);
|
|
5927
5928
|
if (r[t].search(Qo.hanidec) !== -1)
|
|
5928
|
-
e +=
|
|
5929
|
+
e += hv.indexOf(r[t]);
|
|
5929
5930
|
else
|
|
5930
5931
|
for (const s in bf) {
|
|
5931
5932
|
const [i, a] = bf[s];
|
|
@@ -5937,7 +5938,7 @@ function m_(r) {
|
|
|
5937
5938
|
return e;
|
|
5938
5939
|
}
|
|
5939
5940
|
const bo = /* @__PURE__ */ new Map();
|
|
5940
|
-
function
|
|
5941
|
+
function pv() {
|
|
5941
5942
|
bo.clear();
|
|
5942
5943
|
}
|
|
5943
5944
|
function et({ numberingSystem: r }, e = "") {
|
|
@@ -6084,7 +6085,7 @@ class Ee {
|
|
|
6084
6085
|
* @return {void}
|
|
6085
6086
|
*/
|
|
6086
6087
|
static resetCaches() {
|
|
6087
|
-
he.resetCache(), _t.resetCache(), B.resetCache(),
|
|
6088
|
+
he.resetCache(), _t.resetCache(), B.resetCache(), pv();
|
|
6088
6089
|
}
|
|
6089
6090
|
}
|
|
6090
6091
|
class nt {
|
|
@@ -6151,7 +6152,7 @@ function Nf(r, e) {
|
|
|
6151
6152
|
} else
|
|
6152
6153
|
return { minDaysInFirstWeek: 4, startOfWeek: 1 };
|
|
6153
6154
|
}
|
|
6154
|
-
function
|
|
6155
|
+
function yv(r, e = 4, t = 1) {
|
|
6155
6156
|
const n = jn(r.weekYear), s = Ke(
|
|
6156
6157
|
r.weekNumber,
|
|
6157
6158
|
1,
|
|
@@ -6159,7 +6160,7 @@ function y_(r, e = 4, t = 1) {
|
|
|
6159
6160
|
), i = Ke(r.weekday, 1, 7);
|
|
6160
6161
|
return n ? s ? i ? !1 : He("weekday", r.weekday) : He("week", r.weekNumber) : He("weekYear", r.weekYear);
|
|
6161
6162
|
}
|
|
6162
|
-
function
|
|
6163
|
+
function gv(r) {
|
|
6163
6164
|
const e = jn(r.year), t = Ke(r.ordinal, 1, rr(r.year));
|
|
6164
6165
|
return e ? t ? !1 : He("ordinal", r.ordinal) : He("year", r.year);
|
|
6165
6166
|
}
|
|
@@ -6180,10 +6181,10 @@ function xt(r) {
|
|
|
6180
6181
|
function jn(r) {
|
|
6181
6182
|
return typeof r == "number" && r % 1 === 0;
|
|
6182
6183
|
}
|
|
6183
|
-
function
|
|
6184
|
+
function vv(r) {
|
|
6184
6185
|
return typeof r == "string";
|
|
6185
6186
|
}
|
|
6186
|
-
function
|
|
6187
|
+
function _v(r) {
|
|
6187
6188
|
return Object.prototype.toString.call(r) === "[object Date]";
|
|
6188
6189
|
}
|
|
6189
6190
|
function Dh() {
|
|
@@ -6200,7 +6201,7 @@ function Mh() {
|
|
|
6200
6201
|
return !1;
|
|
6201
6202
|
}
|
|
6202
6203
|
}
|
|
6203
|
-
function
|
|
6204
|
+
function wv(r) {
|
|
6204
6205
|
return Array.isArray(r) ? r : [r];
|
|
6205
6206
|
}
|
|
6206
6207
|
function Ff(r, e, t) {
|
|
@@ -6210,7 +6211,7 @@ function Ff(r, e, t) {
|
|
|
6210
6211
|
return n && t(n[0], i[0]) === n[0] ? n : i;
|
|
6211
6212
|
}, null)[1];
|
|
6212
6213
|
}
|
|
6213
|
-
function
|
|
6214
|
+
function bv(r, e) {
|
|
6214
6215
|
return e.reduce((t, n) => (t[n] = r[n], t), {});
|
|
6215
6216
|
}
|
|
6216
6217
|
function fr(r, e) {
|
|
@@ -6232,7 +6233,7 @@ function Oo(r) {
|
|
|
6232
6233
|
function Ke(r, e, t) {
|
|
6233
6234
|
return jn(r) && r >= e && r <= t;
|
|
6234
6235
|
}
|
|
6235
|
-
function
|
|
6236
|
+
function Ov(r, e) {
|
|
6236
6237
|
return r - e * Math.floor(r / e);
|
|
6237
6238
|
}
|
|
6238
6239
|
function Ae(r, e = 2) {
|
|
@@ -6278,7 +6279,7 @@ function rr(r) {
|
|
|
6278
6279
|
return Hr(r) ? 366 : 365;
|
|
6279
6280
|
}
|
|
6280
6281
|
function En(r, e) {
|
|
6281
|
-
const t =
|
|
6282
|
+
const t = Ov(e - 1, 12) + 1, n = r + (e - t) / 12;
|
|
6282
6283
|
return t === 2 ? Hr(n) ? 29 : 28 : [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][t - 1];
|
|
6283
6284
|
}
|
|
6284
6285
|
function Un(r) {
|
|
@@ -6352,9 +6353,9 @@ function Mr(r, e) {
|
|
|
6352
6353
|
}
|
|
6353
6354
|
}
|
|
6354
6355
|
function Wn(r) {
|
|
6355
|
-
return
|
|
6356
|
+
return bv(r, ["hour", "minute", "second", "millisecond"]);
|
|
6356
6357
|
}
|
|
6357
|
-
const
|
|
6358
|
+
const Ev = [
|
|
6358
6359
|
"January",
|
|
6359
6360
|
"February",
|
|
6360
6361
|
"March",
|
|
@@ -6380,15 +6381,15 @@ const E_ = [
|
|
|
6380
6381
|
"Oct",
|
|
6381
6382
|
"Nov",
|
|
6382
6383
|
"Dec"
|
|
6383
|
-
],
|
|
6384
|
+
], Sv = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
|
|
6384
6385
|
function $h(r) {
|
|
6385
6386
|
switch (r) {
|
|
6386
6387
|
case "narrow":
|
|
6387
|
-
return [...
|
|
6388
|
+
return [...Sv];
|
|
6388
6389
|
case "short":
|
|
6389
6390
|
return [...Lh];
|
|
6390
6391
|
case "long":
|
|
6391
|
-
return [...
|
|
6392
|
+
return [...Ev];
|
|
6392
6393
|
case "numeric":
|
|
6393
6394
|
return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
|
|
6394
6395
|
case "2-digit":
|
|
@@ -6405,11 +6406,11 @@ const jh = [
|
|
|
6405
6406
|
"Friday",
|
|
6406
6407
|
"Saturday",
|
|
6407
6408
|
"Sunday"
|
|
6408
|
-
], Uh = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
|
|
6409
|
+
], Uh = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], Tv = ["M", "T", "W", "T", "F", "S", "S"];
|
|
6409
6410
|
function Vh(r) {
|
|
6410
6411
|
switch (r) {
|
|
6411
6412
|
case "narrow":
|
|
6412
|
-
return [...
|
|
6413
|
+
return [...Tv];
|
|
6413
6414
|
case "short":
|
|
6414
6415
|
return [...Uh];
|
|
6415
6416
|
case "long":
|
|
@@ -6420,32 +6421,32 @@ function Vh(r) {
|
|
|
6420
6421
|
return null;
|
|
6421
6422
|
}
|
|
6422
6423
|
}
|
|
6423
|
-
const Wh = ["AM", "PM"],
|
|
6424
|
+
const Wh = ["AM", "PM"], Rv = ["Before Christ", "Anno Domini"], Cv = ["BC", "AD"], Av = ["B", "A"];
|
|
6424
6425
|
function zh(r) {
|
|
6425
6426
|
switch (r) {
|
|
6426
6427
|
case "narrow":
|
|
6427
|
-
return [...
|
|
6428
|
+
return [...Av];
|
|
6428
6429
|
case "short":
|
|
6429
|
-
return [...
|
|
6430
|
+
return [...Cv];
|
|
6430
6431
|
case "long":
|
|
6431
|
-
return [...
|
|
6432
|
+
return [...Rv];
|
|
6432
6433
|
default:
|
|
6433
6434
|
return null;
|
|
6434
6435
|
}
|
|
6435
6436
|
}
|
|
6436
|
-
function
|
|
6437
|
+
function kv(r) {
|
|
6437
6438
|
return Wh[r.hour < 12 ? 0 : 1];
|
|
6438
6439
|
}
|
|
6439
|
-
function
|
|
6440
|
+
function Iv(r, e) {
|
|
6440
6441
|
return Vh(e)[r.weekday - 1];
|
|
6441
6442
|
}
|
|
6442
|
-
function
|
|
6443
|
+
function xv(r, e) {
|
|
6443
6444
|
return $h(e)[r.month - 1];
|
|
6444
6445
|
}
|
|
6445
|
-
function
|
|
6446
|
+
function Nv(r, e) {
|
|
6446
6447
|
return zh(e)[r.year < 0 ? 0 : 1];
|
|
6447
6448
|
}
|
|
6448
|
-
function
|
|
6449
|
+
function Fv(r, e, t = "always", n = !1) {
|
|
6449
6450
|
const s = {
|
|
6450
6451
|
years: ["year", "yr."],
|
|
6451
6452
|
quarters: ["quarter", "qtr."],
|
|
@@ -6476,7 +6477,7 @@ function Mf(r, e) {
|
|
|
6476
6477
|
n.literal ? t += n.val : t += e(n.val);
|
|
6477
6478
|
return t;
|
|
6478
6479
|
}
|
|
6479
|
-
const
|
|
6480
|
+
const Dv = {
|
|
6480
6481
|
D: bn,
|
|
6481
6482
|
DD: oh,
|
|
6482
6483
|
DDD: ch,
|
|
@@ -6489,11 +6490,11 @@ const D_ = {
|
|
|
6489
6490
|
TT: ph,
|
|
6490
6491
|
TTT: yh,
|
|
6491
6492
|
TTTT: gh,
|
|
6492
|
-
f:
|
|
6493
|
+
f: vh,
|
|
6493
6494
|
ff: wh,
|
|
6494
6495
|
fff: Oh,
|
|
6495
6496
|
ffff: Sh,
|
|
6496
|
-
F:
|
|
6497
|
+
F: _h,
|
|
6497
6498
|
FF: bh,
|
|
6498
6499
|
FFF: Eh,
|
|
6499
6500
|
FFFF: Th
|
|
@@ -6515,7 +6516,7 @@ class Fe {
|
|
|
6515
6516
|
return n.length > 0 && i.push({ literal: s || /^\s+$/.test(n), val: n }), i;
|
|
6516
6517
|
}
|
|
6517
6518
|
static macroTokenToFormatOpts(e) {
|
|
6518
|
-
return
|
|
6519
|
+
return Dv[e];
|
|
6519
6520
|
}
|
|
6520
6521
|
constructor(e, t) {
|
|
6521
6522
|
this.opts = t, this.loc = e, this.systemLoc = null;
|
|
@@ -6545,13 +6546,13 @@ class Fe {
|
|
|
6545
6546
|
return t > 0 && (s.padTo = t), n && (s.signDisplay = n), this.loc.numberFormatter(s).format(e);
|
|
6546
6547
|
}
|
|
6547
6548
|
formatDateTimeFromString(e, t) {
|
|
6548
|
-
const n = this.loc.listingMode() === "en", s = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", i = (h, p) => this.loc.extract(e, h, p), a = (h) => e.isOffsetFixed && e.offset === 0 && h.allowZ ? "Z" : e.isValid ? e.zone.formatOffset(e.ts, h.format) : "", o = () => n ?
|
|
6549
|
+
const n = this.loc.listingMode() === "en", s = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", i = (h, p) => this.loc.extract(e, h, p), a = (h) => e.isOffsetFixed && e.offset === 0 && h.allowZ ? "Z" : e.isValid ? e.zone.formatOffset(e.ts, h.format) : "", o = () => n ? kv(e) : i({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), c = (h, p) => n ? xv(e, h) : i(p ? { month: h } : { month: h, day: "numeric" }, "month"), l = (h, p) => n ? Iv(e, h) : i(
|
|
6549
6550
|
p ? { weekday: h } : { weekday: h, month: "long", day: "numeric" },
|
|
6550
6551
|
"weekday"
|
|
6551
6552
|
), u = (h) => {
|
|
6552
6553
|
const p = Fe.macroTokenToFormatOpts(h);
|
|
6553
6554
|
return p ? this.formatWithSystemDefault(e, p) : h;
|
|
6554
|
-
}, f = (h) => n ?
|
|
6555
|
+
}, f = (h) => n ? Nv(e, h) : i({ era: h }, "era"), d = (h) => {
|
|
6555
6556
|
switch (h) {
|
|
6556
6557
|
// ms
|
|
6557
6558
|
case "S":
|
|
@@ -6722,8 +6723,8 @@ class Fe {
|
|
|
6722
6723
|
const h = s(d);
|
|
6723
6724
|
if (h) {
|
|
6724
6725
|
const p = f.isNegativeDuration && h !== f.largestUnit ? n : 1;
|
|
6725
|
-
let
|
|
6726
|
-
return this.opts.signMode === "negativeLargestOnly" && h !== f.largestUnit ?
|
|
6726
|
+
let O;
|
|
6727
|
+
return this.opts.signMode === "negativeLargestOnly" && h !== f.largestUnit ? O = "never" : this.opts.signMode === "all" ? O = "always" : O = "auto", this.num(u.get(h) * p, d.length, O);
|
|
6727
6728
|
} else
|
|
6728
6729
|
return d;
|
|
6729
6730
|
}, a = Fe.parseFormat(t), o = a.reduce(
|
|
@@ -6771,21 +6772,21 @@ function Zh(...r) {
|
|
|
6771
6772
|
return [n, null, t + s];
|
|
6772
6773
|
};
|
|
6773
6774
|
}
|
|
6774
|
-
const Gh = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,
|
|
6775
|
+
const Gh = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, Mv = `(?:${Gh.source}?(?:\\[(${Bh.source})\\])?)?`, nc = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, Hh = RegExp(`${nc.source}${Mv}`), sc = RegExp(`(?:[Tt]${Hh.source})?`), Pv = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, qv = /(\d{4})-?W(\d\d)(?:-?(\d))?/, Lv = /(\d{4})-?(\d{3})/, $v = Zh("weekYear", "weekNumber", "weekDay"), jv = Zh("year", "ordinal"), Uv = /(\d{4})-(\d\d)-(\d\d)/, Kh = RegExp(
|
|
6775
6776
|
`${nc.source} ?(?:${Gh.source}|(${Bh.source}))?`
|
|
6776
|
-
),
|
|
6777
|
+
), Vv = RegExp(`(?: ${Kh.source})?`);
|
|
6777
6778
|
function nr(r, e, t) {
|
|
6778
6779
|
const n = r[e];
|
|
6779
6780
|
return J(n) ? t : Ct(n);
|
|
6780
6781
|
}
|
|
6781
|
-
function
|
|
6782
|
+
function Wv(r, e) {
|
|
6782
6783
|
return [{
|
|
6783
6784
|
year: nr(r, e),
|
|
6784
6785
|
month: nr(r, e + 1, 1),
|
|
6785
6786
|
day: nr(r, e + 2, 1)
|
|
6786
6787
|
}, null, e + 3];
|
|
6787
6788
|
}
|
|
6788
|
-
function
|
|
6789
|
+
function vr(r, e) {
|
|
6789
6790
|
return [{
|
|
6790
6791
|
hours: nr(r, e, 0),
|
|
6791
6792
|
minutes: nr(r, e + 1, 0),
|
|
@@ -6801,8 +6802,8 @@ function Yr(r, e) {
|
|
|
6801
6802
|
const t = r[e] ? _t.create(r[e]) : null;
|
|
6802
6803
|
return [{}, t, e + 1];
|
|
6803
6804
|
}
|
|
6804
|
-
const
|
|
6805
|
-
function
|
|
6805
|
+
const zv = RegExp(`^T?${nc.source}$`), Bv = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;
|
|
6806
|
+
function Zv(r) {
|
|
6806
6807
|
const [e, t, n, s, i, a, o, c, l] = r, u = e[0] === "-", f = c && c[0] === "-", d = (h, p = !1) => h !== void 0 && (p || h && u) ? -h : h;
|
|
6807
6808
|
return [
|
|
6808
6809
|
{
|
|
@@ -6817,7 +6818,7 @@ function Z_(r) {
|
|
|
6817
6818
|
}
|
|
6818
6819
|
];
|
|
6819
6820
|
}
|
|
6820
|
-
const
|
|
6821
|
+
const Gv = {
|
|
6821
6822
|
GMT: 0,
|
|
6822
6823
|
EDT: -240,
|
|
6823
6824
|
EST: -300,
|
|
@@ -6838,8 +6839,8 @@ function ic(r, e, t, n, s, i, a) {
|
|
|
6838
6839
|
};
|
|
6839
6840
|
return a && (o.second = Ct(a)), r && (o.weekday = r.length > 3 ? jh.indexOf(r) + 1 : Uh.indexOf(r) + 1), o;
|
|
6840
6841
|
}
|
|
6841
|
-
const
|
|
6842
|
-
function
|
|
6842
|
+
const Hv = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;
|
|
6843
|
+
function Kv(r) {
|
|
6843
6844
|
const [
|
|
6844
6845
|
,
|
|
6845
6846
|
e,
|
|
@@ -6855,77 +6856,77 @@ function K_(r) {
|
|
|
6855
6856
|
f
|
|
6856
6857
|
] = r, d = ic(e, s, n, t, i, a, o);
|
|
6857
6858
|
let h;
|
|
6858
|
-
return c ? h =
|
|
6859
|
+
return c ? h = Gv[c] : l ? h = 0 : h = Vn(u, f), [d, new Pe(h)];
|
|
6859
6860
|
}
|
|
6860
|
-
function
|
|
6861
|
+
function Yv(r) {
|
|
6861
6862
|
return r.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
|
|
6862
6863
|
}
|
|
6863
|
-
const
|
|
6864
|
+
const Jv = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, Qv = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, Xv = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;
|
|
6864
6865
|
function Pf(r) {
|
|
6865
6866
|
const [, e, t, n, s, i, a, o] = r;
|
|
6866
6867
|
return [ic(e, s, n, t, i, a, o), Pe.utcInstance];
|
|
6867
6868
|
}
|
|
6868
|
-
function
|
|
6869
|
+
function e_(r) {
|
|
6869
6870
|
const [, e, t, n, s, i, a, o] = r;
|
|
6870
6871
|
return [ic(e, o, t, n, s, i, a), Pe.utcInstance];
|
|
6871
6872
|
}
|
|
6872
|
-
const
|
|
6873
|
-
|
|
6874
|
-
|
|
6873
|
+
const t_ = pr(Pv, sc), r_ = pr(qv, sc), n_ = pr(Lv, sc), s_ = pr(Hh), Yh = yr(
|
|
6874
|
+
Wv,
|
|
6875
|
+
vr,
|
|
6875
6876
|
Kr,
|
|
6876
6877
|
Yr
|
|
6877
|
-
),
|
|
6878
|
-
$
|
|
6879
|
-
|
|
6878
|
+
), i_ = yr(
|
|
6879
|
+
$v,
|
|
6880
|
+
vr,
|
|
6880
6881
|
Kr,
|
|
6881
6882
|
Yr
|
|
6882
|
-
),
|
|
6883
|
-
|
|
6884
|
-
|
|
6883
|
+
), a_ = yr(
|
|
6884
|
+
jv,
|
|
6885
|
+
vr,
|
|
6885
6886
|
Kr,
|
|
6886
6887
|
Yr
|
|
6887
|
-
),
|
|
6888
|
-
|
|
6888
|
+
), o_ = yr(
|
|
6889
|
+
vr,
|
|
6889
6890
|
Kr,
|
|
6890
6891
|
Yr
|
|
6891
6892
|
);
|
|
6892
|
-
function
|
|
6893
|
+
function c_(r) {
|
|
6893
6894
|
return gr(
|
|
6894
6895
|
r,
|
|
6895
|
-
[
|
|
6896
|
-
[
|
|
6897
|
-
[
|
|
6898
|
-
[
|
|
6896
|
+
[t_, Yh],
|
|
6897
|
+
[r_, i_],
|
|
6898
|
+
[n_, a_],
|
|
6899
|
+
[s_, o_]
|
|
6899
6900
|
);
|
|
6900
6901
|
}
|
|
6901
|
-
function
|
|
6902
|
-
return gr(
|
|
6902
|
+
function l_(r) {
|
|
6903
|
+
return gr(Yv(r), [Hv, Kv]);
|
|
6903
6904
|
}
|
|
6904
|
-
function
|
|
6905
|
+
function u_(r) {
|
|
6905
6906
|
return gr(
|
|
6906
6907
|
r,
|
|
6907
|
-
[
|
|
6908
|
-
[
|
|
6909
|
-
[
|
|
6908
|
+
[Jv, Pf],
|
|
6909
|
+
[Qv, Pf],
|
|
6910
|
+
[Xv, e_]
|
|
6910
6911
|
);
|
|
6911
6912
|
}
|
|
6912
|
-
function
|
|
6913
|
-
return gr(r, [
|
|
6913
|
+
function f_(r) {
|
|
6914
|
+
return gr(r, [Bv, Zv]);
|
|
6914
6915
|
}
|
|
6915
|
-
const
|
|
6916
|
-
function
|
|
6917
|
-
return gr(r, [
|
|
6916
|
+
const d_ = yr(vr);
|
|
6917
|
+
function h_(r) {
|
|
6918
|
+
return gr(r, [zv, d_]);
|
|
6918
6919
|
}
|
|
6919
|
-
const
|
|
6920
|
-
|
|
6920
|
+
const m_ = pr(Uv, Vv), p_ = pr(Kh), y_ = yr(
|
|
6921
|
+
vr,
|
|
6921
6922
|
Kr,
|
|
6922
6923
|
Yr
|
|
6923
6924
|
);
|
|
6924
|
-
function
|
|
6925
|
+
function g_(r) {
|
|
6925
6926
|
return gr(
|
|
6926
6927
|
r,
|
|
6927
|
-
[
|
|
6928
|
-
[
|
|
6928
|
+
[m_, Yh],
|
|
6929
|
+
[p_, y_]
|
|
6929
6930
|
);
|
|
6930
6931
|
}
|
|
6931
6932
|
const qf = "Invalid Duration", Jh = {
|
|
@@ -6945,7 +6946,7 @@ const qf = "Invalid Duration", Jh = {
|
|
|
6945
6946
|
hours: { minutes: 60, seconds: 3600, milliseconds: 3600 * 1e3 },
|
|
6946
6947
|
minutes: { seconds: 60, milliseconds: 60 * 1e3 },
|
|
6947
6948
|
seconds: { milliseconds: 1e3 }
|
|
6948
|
-
},
|
|
6949
|
+
}, v_ = {
|
|
6949
6950
|
years: {
|
|
6950
6951
|
quarters: 4,
|
|
6951
6952
|
months: 12,
|
|
@@ -6974,7 +6975,7 @@ const qf = "Invalid Duration", Jh = {
|
|
|
6974
6975
|
milliseconds: 720 * 60 * 60 * 1e3
|
|
6975
6976
|
},
|
|
6976
6977
|
...Jh
|
|
6977
|
-
}, Ze = 146097 / 400, Kt = 146097 / 4800,
|
|
6978
|
+
}, Ze = 146097 / 400, Kt = 146097 / 4800, __ = {
|
|
6978
6979
|
years: {
|
|
6979
6980
|
quarters: 4,
|
|
6980
6981
|
months: 12,
|
|
@@ -7013,8 +7014,8 @@ const qf = "Invalid Duration", Jh = {
|
|
|
7013
7014
|
"minutes",
|
|
7014
7015
|
"seconds",
|
|
7015
7016
|
"milliseconds"
|
|
7016
|
-
],
|
|
7017
|
-
function
|
|
7017
|
+
], w_ = Vt.slice(0).reverse();
|
|
7018
|
+
function ht(r, e, t = !1) {
|
|
7018
7019
|
const n = {
|
|
7019
7020
|
values: t ? e.values : { ...r.values, ...e.values || {} },
|
|
7020
7021
|
loc: r.loc.clone(e.loc),
|
|
@@ -7025,7 +7026,7 @@ function dt(r, e, t = !1) {
|
|
|
7025
7026
|
}
|
|
7026
7027
|
function Qh(r, e) {
|
|
7027
7028
|
let t = e.milliseconds ?? 0;
|
|
7028
|
-
for (const n of
|
|
7029
|
+
for (const n of w_.slice(1))
|
|
7029
7030
|
e[n] && (t += e[n] * r[n].milliseconds);
|
|
7030
7031
|
return t;
|
|
7031
7032
|
}
|
|
@@ -7061,7 +7062,7 @@ class ue {
|
|
|
7061
7062
|
*/
|
|
7062
7063
|
constructor(e) {
|
|
7063
7064
|
const t = e.conversionAccuracy === "longterm" || !1;
|
|
7064
|
-
let n = t ?
|
|
7065
|
+
let n = t ? __ : v_;
|
|
7065
7066
|
e.matrix && (n = e.matrix), this.values = e.values, this.loc = e.loc || he.create(), this.conversionAccuracy = t ? "longterm" : "casual", this.invalid = e.invalid || null, this.matrix = n, this.isLuxonDuration = !0;
|
|
7066
7067
|
}
|
|
7067
7068
|
/**
|
|
@@ -7144,7 +7145,7 @@ class ue {
|
|
|
7144
7145
|
* @return {Duration}
|
|
7145
7146
|
*/
|
|
7146
7147
|
static fromISO(e, t) {
|
|
7147
|
-
const [n] =
|
|
7148
|
+
const [n] = f_(e);
|
|
7148
7149
|
return n ? ue.fromObject(n, t) : ue.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
|
|
7149
7150
|
}
|
|
7150
7151
|
/**
|
|
@@ -7164,7 +7165,7 @@ class ue {
|
|
|
7164
7165
|
* @return {Duration}
|
|
7165
7166
|
*/
|
|
7166
7167
|
static fromISOTime(e, t) {
|
|
7167
|
-
const [n] =
|
|
7168
|
+
const [n] = h_(e);
|
|
7168
7169
|
return n ? ue.fromObject(n, t) : ue.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
|
|
7169
7170
|
}
|
|
7170
7171
|
/**
|
|
@@ -7384,7 +7385,7 @@ class ue {
|
|
|
7384
7385
|
const t = ue.fromDurationLike(e), n = {};
|
|
7385
7386
|
for (const s of Vt)
|
|
7386
7387
|
(fr(t.values, s) || fr(this.values, s)) && (n[s] = t.get(s) + this.get(s));
|
|
7387
|
-
return
|
|
7388
|
+
return ht(this, { values: n }, !0);
|
|
7388
7389
|
}
|
|
7389
7390
|
/**
|
|
7390
7391
|
* Make this Duration shorter by the specified amount. Return a newly-constructed Duration.
|
|
@@ -7408,7 +7409,7 @@ class ue {
|
|
|
7408
7409
|
const t = {};
|
|
7409
7410
|
for (const n of Object.keys(this.values))
|
|
7410
7411
|
t[n] = qh(e(this.values[n], n));
|
|
7411
|
-
return
|
|
7412
|
+
return ht(this, { values: t }, !0);
|
|
7412
7413
|
}
|
|
7413
7414
|
/**
|
|
7414
7415
|
* Get the value of unit.
|
|
@@ -7431,7 +7432,7 @@ class ue {
|
|
|
7431
7432
|
set(e) {
|
|
7432
7433
|
if (!this.isValid) return this;
|
|
7433
7434
|
const t = { ...this.values, ...Sn(e, ue.normalizeUnit) };
|
|
7434
|
-
return
|
|
7435
|
+
return ht(this, { values: t });
|
|
7435
7436
|
}
|
|
7436
7437
|
/**
|
|
7437
7438
|
* "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration.
|
|
@@ -7440,7 +7441,7 @@ class ue {
|
|
|
7440
7441
|
*/
|
|
7441
7442
|
reconfigure({ locale: e, numberingSystem: t, conversionAccuracy: n, matrix: s } = {}) {
|
|
7442
7443
|
const a = { loc: this.loc.clone({ locale: e, numberingSystem: t }), matrix: s, conversionAccuracy: n };
|
|
7443
|
-
return
|
|
7444
|
+
return ht(this, a);
|
|
7444
7445
|
}
|
|
7445
7446
|
/**
|
|
7446
7447
|
* Return the length of the duration in the specified unit.
|
|
@@ -7471,7 +7472,7 @@ class ue {
|
|
|
7471
7472
|
normalize() {
|
|
7472
7473
|
if (!this.isValid) return this;
|
|
7473
7474
|
const e = this.toObject();
|
|
7474
|
-
return Lf(this.matrix, e),
|
|
7475
|
+
return Lf(this.matrix, e), ht(this, { values: e }, !0);
|
|
7475
7476
|
}
|
|
7476
7477
|
/**
|
|
7477
7478
|
* Rescale units to its largest representation
|
|
@@ -7481,7 +7482,7 @@ class ue {
|
|
|
7481
7482
|
rescale() {
|
|
7482
7483
|
if (!this.isValid) return this;
|
|
7483
7484
|
const e = $f(this.normalize().shiftToAll().toObject());
|
|
7484
|
-
return
|
|
7485
|
+
return ht(this, { values: e }, !0);
|
|
7485
7486
|
}
|
|
7486
7487
|
/**
|
|
7487
7488
|
* Convert this Duration into its representation in a different set of units.
|
|
@@ -7507,7 +7508,7 @@ class ue {
|
|
|
7507
7508
|
} else xt(s[a]) && (n[a] = s[a]);
|
|
7508
7509
|
for (const a in n)
|
|
7509
7510
|
n[a] !== 0 && (t[i] += a === i ? n[a] : n[a] / this.matrix[i][a]);
|
|
7510
|
-
return Lf(this.matrix, t),
|
|
7511
|
+
return Lf(this.matrix, t), ht(this, { values: t }, !0);
|
|
7511
7512
|
}
|
|
7512
7513
|
/**
|
|
7513
7514
|
* Shift this Duration to all available units.
|
|
@@ -7536,7 +7537,7 @@ class ue {
|
|
|
7536
7537
|
const e = {};
|
|
7537
7538
|
for (const t of Object.keys(this.values))
|
|
7538
7539
|
e[t] = this.values[t] === 0 ? 0 : -this.values[t];
|
|
7539
|
-
return
|
|
7540
|
+
return ht(this, { values: e }, !0);
|
|
7540
7541
|
}
|
|
7541
7542
|
/**
|
|
7542
7543
|
* Removes all units with values equal to 0 from this Duration.
|
|
@@ -7546,7 +7547,7 @@ class ue {
|
|
|
7546
7547
|
removeZeros() {
|
|
7547
7548
|
if (!this.isValid) return this;
|
|
7548
7549
|
const e = $f(this.values);
|
|
7549
|
-
return
|
|
7550
|
+
return ht(this, { values: e }, !0);
|
|
7550
7551
|
}
|
|
7551
7552
|
/**
|
|
7552
7553
|
* Get the years.
|
|
@@ -7652,7 +7653,7 @@ class ue {
|
|
|
7652
7653
|
}
|
|
7653
7654
|
}
|
|
7654
7655
|
const Yt = "Invalid Interval";
|
|
7655
|
-
function
|
|
7656
|
+
function b_(r, e) {
|
|
7656
7657
|
return !r || !r.isValid ? Oe.invalid("missing or invalid start") : !e || !e.isValid ? Oe.invalid("missing or invalid end") : e < r ? Oe.invalid(
|
|
7657
7658
|
"end before start",
|
|
7658
7659
|
`The end of an interval must be after its start, but you had start=${r.toISO()} and end=${e.toISO()}`
|
|
@@ -7686,7 +7687,7 @@ class Oe {
|
|
|
7686
7687
|
* @return {Interval}
|
|
7687
7688
|
*/
|
|
7688
7689
|
static fromDateTimes(e, t) {
|
|
7689
|
-
const n = Or(e), s = Or(t), i =
|
|
7690
|
+
const n = Or(e), s = Or(t), i = b_(n, s);
|
|
7690
7691
|
return i ?? new Oe({
|
|
7691
7692
|
start: n,
|
|
7692
7693
|
end: s
|
|
@@ -8293,7 +8294,7 @@ function jf(r, e) {
|
|
|
8293
8294
|
const t = (s) => s.toUTC(0, { keepLocalTime: !0 }).startOf("day").valueOf(), n = t(e) - t(r);
|
|
8294
8295
|
return Math.floor(ue.fromMillis(n).as("days"));
|
|
8295
8296
|
}
|
|
8296
|
-
function
|
|
8297
|
+
function O_(r, e, t) {
|
|
8297
8298
|
const n = [
|
|
8298
8299
|
["years", (c, l) => l.year - c.year],
|
|
8299
8300
|
["quarters", (c, l) => l.quarter - c.quarter + (l.year - c.year) * 4],
|
|
@@ -8312,8 +8313,8 @@ function Ov(r, e, t) {
|
|
|
8312
8313
|
t.indexOf(c) >= 0 && (a = c, s[c] = l(r, e), o = i.plus(s), o > e ? (s[c]--, r = i.plus(s), r > e && (o = r, s[c]--, r = i.plus(s))) : r = o);
|
|
8313
8314
|
return [r, s, o, a];
|
|
8314
8315
|
}
|
|
8315
|
-
function
|
|
8316
|
-
let [s, i, a, o] =
|
|
8316
|
+
function E_(r, e, t, n) {
|
|
8317
|
+
let [s, i, a, o] = O_(r, e, t);
|
|
8317
8318
|
const c = e - s, l = t.filter(
|
|
8318
8319
|
(f) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(f) >= 0
|
|
8319
8320
|
);
|
|
@@ -8321,12 +8322,12 @@ function Ev(r, e, t, n) {
|
|
|
8321
8322
|
const u = ue.fromObject(i, n);
|
|
8322
8323
|
return l.length > 0 ? ue.fromMillis(c, n).shiftTo(...l).plus(u) : u;
|
|
8323
8324
|
}
|
|
8324
|
-
const
|
|
8325
|
+
const S_ = "missing Intl.DateTimeFormat.formatToParts support";
|
|
8325
8326
|
function de(r, e = (t) => t) {
|
|
8326
|
-
return { regex: r, deser: ([t]) => e(
|
|
8327
|
+
return { regex: r, deser: ([t]) => e(mv(t)) };
|
|
8327
8328
|
}
|
|
8328
|
-
const
|
|
8329
|
-
function
|
|
8329
|
+
const T_ = " ", Xh = `[ ${T_}]`, em = new RegExp(Xh, "g");
|
|
8330
|
+
function R_(r) {
|
|
8330
8331
|
return r.replace(/\./g, "\\.?").replace(em, Xh);
|
|
8331
8332
|
}
|
|
8332
8333
|
function Uf(r) {
|
|
@@ -8334,7 +8335,7 @@ function Uf(r) {
|
|
|
8334
8335
|
}
|
|
8335
8336
|
function tt(r, e) {
|
|
8336
8337
|
return r === null ? null : {
|
|
8337
|
-
regex: RegExp(r.map(
|
|
8338
|
+
regex: RegExp(r.map(R_).join("|")),
|
|
8338
8339
|
deser: ([t]) => r.findIndex((n) => Uf(t) === Uf(n)) + e
|
|
8339
8340
|
};
|
|
8340
8341
|
}
|
|
@@ -8344,11 +8345,11 @@ function Vf(r, e) {
|
|
|
8344
8345
|
function nn(r) {
|
|
8345
8346
|
return { regex: r, deser: ([e]) => e };
|
|
8346
8347
|
}
|
|
8347
|
-
function
|
|
8348
|
+
function C_(r) {
|
|
8348
8349
|
return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
8349
8350
|
}
|
|
8350
|
-
function
|
|
8351
|
-
const t = et(e), n = et(e, "{2}"), s = et(e, "{3}"), i = et(e, "{4}"), a = et(e, "{6}"), o = et(e, "{1,2}"), c = et(e, "{1,3}"), l = et(e, "{1,6}"), u = et(e, "{1,9}"), f = et(e, "{2,4}"), d = et(e, "{4,6}"), h = (g) => ({ regex: RegExp(
|
|
8351
|
+
function A_(r, e) {
|
|
8352
|
+
const t = et(e), n = et(e, "{2}"), s = et(e, "{3}"), i = et(e, "{4}"), a = et(e, "{6}"), o = et(e, "{1,2}"), c = et(e, "{1,3}"), l = et(e, "{1,6}"), u = et(e, "{1,9}"), f = et(e, "{2,4}"), d = et(e, "{4,6}"), h = (g) => ({ regex: RegExp(C_(g.val)), deser: ([w]) => w, literal: !0 }), O = ((g) => {
|
|
8352
8353
|
if (r.literal)
|
|
8353
8354
|
return h(g);
|
|
8354
8355
|
switch (g.val) {
|
|
@@ -8469,11 +8470,11 @@ function Av(r, e) {
|
|
|
8469
8470
|
return h(g);
|
|
8470
8471
|
}
|
|
8471
8472
|
})(r) || {
|
|
8472
|
-
invalidReason:
|
|
8473
|
+
invalidReason: S_
|
|
8473
8474
|
};
|
|
8474
|
-
return
|
|
8475
|
+
return O.token = r, O;
|
|
8475
8476
|
}
|
|
8476
|
-
const
|
|
8477
|
+
const k_ = {
|
|
8477
8478
|
year: {
|
|
8478
8479
|
"2-digit": "yy",
|
|
8479
8480
|
numeric: "yyyyy"
|
|
@@ -8515,7 +8516,7 @@ const kv = {
|
|
|
8515
8516
|
short: "ZZZ"
|
|
8516
8517
|
}
|
|
8517
8518
|
};
|
|
8518
|
-
function
|
|
8519
|
+
function I_(r, e, t) {
|
|
8519
8520
|
const { type: n, value: s } = r;
|
|
8520
8521
|
if (n === "literal") {
|
|
8521
8522
|
const c = /^\s+$/.test(s);
|
|
@@ -8527,17 +8528,17 @@ function Iv(r, e, t) {
|
|
|
8527
8528
|
const i = e[n];
|
|
8528
8529
|
let a = n;
|
|
8529
8530
|
n === "hour" && (e.hour12 != null ? a = e.hour12 ? "hour12" : "hour24" : e.hourCycle != null ? e.hourCycle === "h11" || e.hourCycle === "h12" ? a = "hour12" : a = "hour24" : a = t.hour12 ? "hour12" : "hour24");
|
|
8530
|
-
let o =
|
|
8531
|
+
let o = k_[a];
|
|
8531
8532
|
if (typeof o == "object" && (o = o[i]), o)
|
|
8532
8533
|
return {
|
|
8533
8534
|
literal: !1,
|
|
8534
8535
|
val: o
|
|
8535
8536
|
};
|
|
8536
8537
|
}
|
|
8537
|
-
function
|
|
8538
|
+
function x_(r) {
|
|
8538
8539
|
return [`^${r.map((t) => t.regex).reduce((t, n) => `${t}(${n.source})`, "")}$`, r];
|
|
8539
8540
|
}
|
|
8540
|
-
function
|
|
8541
|
+
function N_(r, e, t) {
|
|
8541
8542
|
const n = r.match(e);
|
|
8542
8543
|
if (n) {
|
|
8543
8544
|
const s = {};
|
|
@@ -8551,7 +8552,7 @@ function Nv(r, e, t) {
|
|
|
8551
8552
|
} else
|
|
8552
8553
|
return [n, {}];
|
|
8553
8554
|
}
|
|
8554
|
-
function
|
|
8555
|
+
function F_(r) {
|
|
8555
8556
|
const e = (i) => {
|
|
8556
8557
|
switch (i) {
|
|
8557
8558
|
case "S":
|
|
@@ -8592,28 +8593,28 @@ function Fv(r) {
|
|
|
8592
8593
|
}, {}), t, n];
|
|
8593
8594
|
}
|
|
8594
8595
|
let Ta = null;
|
|
8595
|
-
function
|
|
8596
|
+
function D_() {
|
|
8596
8597
|
return Ta || (Ta = B.fromMillis(1555555555555)), Ta;
|
|
8597
8598
|
}
|
|
8598
|
-
function
|
|
8599
|
+
function M_(r, e) {
|
|
8599
8600
|
if (r.literal)
|
|
8600
8601
|
return r;
|
|
8601
8602
|
const t = Fe.macroTokenToFormatOpts(r.val), n = sm(t, e);
|
|
8602
8603
|
return n == null || n.includes(void 0) ? r : n;
|
|
8603
8604
|
}
|
|
8604
8605
|
function tm(r, e) {
|
|
8605
|
-
return Array.prototype.concat(...r.map((t) =>
|
|
8606
|
+
return Array.prototype.concat(...r.map((t) => M_(t, e)));
|
|
8606
8607
|
}
|
|
8607
8608
|
class rm {
|
|
8608
8609
|
constructor(e, t) {
|
|
8609
|
-
if (this.locale = e, this.format = t, this.tokens = tm(Fe.parseFormat(t), e), this.units = this.tokens.map((n) =>
|
|
8610
|
-
const [n, s] =
|
|
8610
|
+
if (this.locale = e, this.format = t, this.tokens = tm(Fe.parseFormat(t), e), this.units = this.tokens.map((n) => A_(n, e)), this.disqualifyingUnit = this.units.find((n) => n.invalidReason), !this.disqualifyingUnit) {
|
|
8611
|
+
const [n, s] = x_(this.units);
|
|
8611
8612
|
this.regex = RegExp(n, "i"), this.handlers = s;
|
|
8612
8613
|
}
|
|
8613
8614
|
}
|
|
8614
8615
|
explainFromTokens(e) {
|
|
8615
8616
|
if (this.isValid) {
|
|
8616
|
-
const [t, n] =
|
|
8617
|
+
const [t, n] = N_(e, this.regex, this.handlers), [s, i, a] = n ? F_(n) : [null, null, void 0];
|
|
8617
8618
|
if (fr(n, "a") && fr(n, "H"))
|
|
8618
8619
|
throw new er(
|
|
8619
8620
|
"Can't include meridiem when specifying 24-hour format"
|
|
@@ -8641,15 +8642,15 @@ class rm {
|
|
|
8641
8642
|
function nm(r, e, t) {
|
|
8642
8643
|
return new rm(r, t).explainFromTokens(e);
|
|
8643
8644
|
}
|
|
8644
|
-
function
|
|
8645
|
+
function P_(r, e, t) {
|
|
8645
8646
|
const { result: n, zone: s, specificOffset: i, invalidReason: a } = nm(r, e, t);
|
|
8646
8647
|
return [n, s, i, a];
|
|
8647
8648
|
}
|
|
8648
8649
|
function sm(r, e) {
|
|
8649
8650
|
if (!r)
|
|
8650
8651
|
return null;
|
|
8651
|
-
const n = Fe.create(e, r).dtFormatter(
|
|
8652
|
-
return s.map((a) =>
|
|
8652
|
+
const n = Fe.create(e, r).dtFormatter(D_()), s = n.formatToParts(), i = n.resolvedOptions();
|
|
8653
|
+
return s.map((a) => I_(a, r, i));
|
|
8653
8654
|
}
|
|
8654
8655
|
const Ra = "Invalid DateTime", Wf = 864e13;
|
|
8655
8656
|
function kr(r) {
|
|
@@ -8779,20 +8780,20 @@ const am = {
|
|
|
8779
8780
|
minute: 0,
|
|
8780
8781
|
second: 0,
|
|
8781
8782
|
millisecond: 0
|
|
8782
|
-
},
|
|
8783
|
+
}, q_ = {
|
|
8783
8784
|
weekNumber: 1,
|
|
8784
8785
|
weekday: 1,
|
|
8785
8786
|
hour: 0,
|
|
8786
8787
|
minute: 0,
|
|
8787
8788
|
second: 0,
|
|
8788
8789
|
millisecond: 0
|
|
8789
|
-
},
|
|
8790
|
+
}, L_ = {
|
|
8790
8791
|
ordinal: 1,
|
|
8791
8792
|
hour: 0,
|
|
8792
8793
|
minute: 0,
|
|
8793
8794
|
second: 0,
|
|
8794
8795
|
millisecond: 0
|
|
8795
|
-
}, ln = ["year", "month", "day", "hour", "minute", "second", "millisecond"], $
|
|
8796
|
+
}, ln = ["year", "month", "day", "hour", "minute", "second", "millisecond"], $_ = [
|
|
8796
8797
|
"weekYear",
|
|
8797
8798
|
"weekNumber",
|
|
8798
8799
|
"weekday",
|
|
@@ -8800,7 +8801,7 @@ const am = {
|
|
|
8800
8801
|
"minute",
|
|
8801
8802
|
"second",
|
|
8802
8803
|
"millisecond"
|
|
8803
|
-
],
|
|
8804
|
+
], j_ = ["year", "ordinal", "hour", "minute", "second", "millisecond"];
|
|
8804
8805
|
function un(r) {
|
|
8805
8806
|
const e = {
|
|
8806
8807
|
year: "year",
|
|
@@ -8846,7 +8847,7 @@ function Zf(r) {
|
|
|
8846
8847
|
return un(r);
|
|
8847
8848
|
}
|
|
8848
8849
|
}
|
|
8849
|
-
function
|
|
8850
|
+
function U_(r) {
|
|
8850
8851
|
if (Ir === void 0 && (Ir = Ee.now()), r.type !== "iana")
|
|
8851
8852
|
return r.offset(Ir);
|
|
8852
8853
|
const e = r.name;
|
|
@@ -8867,7 +8868,7 @@ function Gf(r, e) {
|
|
|
8867
8868
|
const a = Nh(r) || Fh(r);
|
|
8868
8869
|
if (a)
|
|
8869
8870
|
return B.invalid(a);
|
|
8870
|
-
const o =
|
|
8871
|
+
const o = U_(t);
|
|
8871
8872
|
[s, i] = cn(r, o, t);
|
|
8872
8873
|
}
|
|
8873
8874
|
return new B({ ts: s, zone: t, loc: n, o: i });
|
|
@@ -8980,7 +8981,7 @@ class B {
|
|
|
8980
8981
|
* @return {DateTime}
|
|
8981
8982
|
*/
|
|
8982
8983
|
static fromJSDate(e, t = {}) {
|
|
8983
|
-
const n =
|
|
8984
|
+
const n = _v(e) ? e.valueOf() : NaN;
|
|
8984
8985
|
if (Number.isNaN(n))
|
|
8985
8986
|
return B.invalid("invalid input");
|
|
8986
8987
|
const s = kt(t.zone, Ee.defaultZone);
|
|
@@ -9077,21 +9078,21 @@ class B {
|
|
|
9077
9078
|
);
|
|
9078
9079
|
if (d && u)
|
|
9079
9080
|
throw new er("Can't mix ordinal dates with month/day");
|
|
9080
|
-
const
|
|
9081
|
+
const O = p || i.weekday && !h;
|
|
9081
9082
|
let g, w, b = sn(c, l);
|
|
9082
|
-
|
|
9083
|
+
O ? (g = $_, w = q_, b = On(b, a, o)) : u ? (g = j_, w = L_, b = Sa(b)) : (g = ln, w = am);
|
|
9083
9084
|
let A = !1;
|
|
9084
|
-
for (const
|
|
9085
|
-
const C = i[
|
|
9086
|
-
J(C) ? A ? i[
|
|
9085
|
+
for (const v of g) {
|
|
9086
|
+
const C = i[v];
|
|
9087
|
+
J(C) ? A ? i[v] = w[v] : i[v] = b[v] : A = !0;
|
|
9087
9088
|
}
|
|
9088
|
-
const F =
|
|
9089
|
+
const F = O ? yv(i, a, o) : u ? gv(i) : Nh(i), y = F || Fh(i);
|
|
9089
9090
|
if (y)
|
|
9090
9091
|
return B.invalid(y);
|
|
9091
|
-
const T =
|
|
9092
|
+
const T = O ? If(i, a, o) : u ? xf(i) : i, [S, _] = cn(T, l, n), I = new B({
|
|
9092
9093
|
ts: S,
|
|
9093
9094
|
zone: n,
|
|
9094
|
-
o:
|
|
9095
|
+
o: _,
|
|
9095
9096
|
loc: s
|
|
9096
9097
|
});
|
|
9097
9098
|
return i.weekday && h && e.weekday !== I.weekday ? B.invalid(
|
|
@@ -9117,7 +9118,7 @@ class B {
|
|
|
9117
9118
|
* @return {DateTime}
|
|
9118
9119
|
*/
|
|
9119
9120
|
static fromISO(e, t = {}) {
|
|
9120
|
-
const [n, s] =
|
|
9121
|
+
const [n, s] = c_(e);
|
|
9121
9122
|
return Jt(n, s, t, "ISO 8601", e);
|
|
9122
9123
|
}
|
|
9123
9124
|
/**
|
|
@@ -9136,7 +9137,7 @@ class B {
|
|
|
9136
9137
|
* @return {DateTime}
|
|
9137
9138
|
*/
|
|
9138
9139
|
static fromRFC2822(e, t = {}) {
|
|
9139
|
-
const [n, s] =
|
|
9140
|
+
const [n, s] = l_(e);
|
|
9140
9141
|
return Jt(n, s, t, "RFC 2822", e);
|
|
9141
9142
|
}
|
|
9142
9143
|
/**
|
|
@@ -9156,7 +9157,7 @@ class B {
|
|
|
9156
9157
|
* @return {DateTime}
|
|
9157
9158
|
*/
|
|
9158
9159
|
static fromHTTP(e, t = {}) {
|
|
9159
|
-
const [n, s] =
|
|
9160
|
+
const [n, s] = u_(e);
|
|
9160
9161
|
return Jt(n, s, t, "HTTP", t);
|
|
9161
9162
|
}
|
|
9162
9163
|
/**
|
|
@@ -9180,7 +9181,7 @@ class B {
|
|
|
9180
9181
|
locale: s,
|
|
9181
9182
|
numberingSystem: i,
|
|
9182
9183
|
defaultToEN: !0
|
|
9183
|
-
}), [o, c, l, u] =
|
|
9184
|
+
}), [o, c, l, u] = P_(a, e, t);
|
|
9184
9185
|
return u ? B.invalid(u) : Jt(o, c, n, `format ${t}`, e, l);
|
|
9185
9186
|
}
|
|
9186
9187
|
/**
|
|
@@ -9211,7 +9212,7 @@ class B {
|
|
|
9211
9212
|
* @return {DateTime}
|
|
9212
9213
|
*/
|
|
9213
9214
|
static fromSQL(e, t = {}) {
|
|
9214
|
-
const [n, s] =
|
|
9215
|
+
const [n, s] = g_(e);
|
|
9215
9216
|
return Jt(n, s, t, "SQL", e);
|
|
9216
9217
|
}
|
|
9217
9218
|
/**
|
|
@@ -10114,7 +10115,7 @@ class B {
|
|
|
10114
10115
|
diff(e, t = "milliseconds", n = {}) {
|
|
10115
10116
|
if (!this.isValid || !e.isValid)
|
|
10116
10117
|
return ue.invalid("created by diffing an invalid DateTime");
|
|
10117
|
-
const s = { locale: this.locale, numberingSystem: this.numberingSystem, ...n }, i =
|
|
10118
|
+
const s = { locale: this.locale, numberingSystem: this.numberingSystem, ...n }, i = wv(t).map(ue.normalizeUnit), a = e.valueOf() > this.valueOf(), o = a ? this : e, c = a ? e : this, l = E_(o, c, i, s);
|
|
10118
10119
|
return a ? l.negate() : l;
|
|
10119
10120
|
}
|
|
10120
10121
|
/**
|
|
@@ -10406,14 +10407,14 @@ class B {
|
|
|
10406
10407
|
* @type {Object}
|
|
10407
10408
|
*/
|
|
10408
10409
|
static get DATETIME_SHORT() {
|
|
10409
|
-
return
|
|
10410
|
+
return vh;
|
|
10410
10411
|
}
|
|
10411
10412
|
/**
|
|
10412
10413
|
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
10413
10414
|
* @type {Object}
|
|
10414
10415
|
*/
|
|
10415
10416
|
static get DATETIME_SHORT_WITH_SECONDS() {
|
|
10416
|
-
return
|
|
10417
|
+
return _h;
|
|
10417
10418
|
}
|
|
10418
10419
|
/**
|
|
10419
10420
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
@@ -10478,7 +10479,7 @@ function Or(r) {
|
|
|
10478
10479
|
}
|
|
10479
10480
|
const Yf = async (r, e) => {
|
|
10480
10481
|
if (r) {
|
|
10481
|
-
const t = await
|
|
10482
|
+
const t = await _e(r, e);
|
|
10482
10483
|
if (!t.valid)
|
|
10483
10484
|
throw new Error(t.message);
|
|
10484
10485
|
}
|
|
@@ -10487,42 +10488,42 @@ const Yf = async (r, e) => {
|
|
|
10487
10488
|
for (const o of n.fields)
|
|
10488
10489
|
await Yf(o.custom?.preValidate, s);
|
|
10489
10490
|
return Wg(r, t, i).parse(e), e;
|
|
10490
|
-
}, ac = (r, e, t, n, s, i, a, o, c, l, u, f, d, h, p,
|
|
10491
|
+
}, ac = (r, e, t, n, s, i, a, o, c, l, u, f, d, h, p, O, g, w, b, A, F) => {
|
|
10491
10492
|
const { fields: y } = a;
|
|
10492
|
-
y.filter((
|
|
10493
|
-
r !== "delete" && (typeof s[
|
|
10493
|
+
y.filter((_) => "unique" in _ && _.unique).forEach((_) => {
|
|
10494
|
+
r !== "delete" && (typeof s[_.name] == "string" || typeof s[_.name] == "number") && e.set(h(_, s[_.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||")), {
|
|
10494
10495
|
id: n,
|
|
10495
10496
|
Collection_Path: t
|
|
10496
10497
|
});
|
|
10497
|
-
}), y.forEach((
|
|
10498
|
-
if (cg(
|
|
10499
|
-
const I = fg(
|
|
10500
|
-
s[
|
|
10501
|
-
s[C.name] !== void 0 && (
|
|
10502
|
-
}), Object.keys(
|
|
10498
|
+
}), y.forEach((_) => {
|
|
10499
|
+
if (cg(_, a, i)) {
|
|
10500
|
+
const I = fg(_, a, i), v = {};
|
|
10501
|
+
s[_.name] !== void 0 && (v[_.name] = s[_.name], ve(_) && (v[`${_.name}_Array`] = s[`${_.name}_Array`])), I.forEach((C) => {
|
|
10502
|
+
s[C.name] !== void 0 && (ve(C) ? v[`${C.name}_Array`] = s[`${C.name}_Array`] : v[C.name] = s[C.name]);
|
|
10503
|
+
}), Object.keys(v).length > 0 && (r === "create" && (v.Collection_Path = t, v.Collection_Path_String = t.join("/"), e.set(d(_), v)), r === "update" && e.update(d(_), v), r === "delete" && e.delete(d(_)));
|
|
10503
10504
|
}
|
|
10504
10505
|
});
|
|
10505
10506
|
const T = c[a.labels.collection];
|
|
10506
|
-
for (const
|
|
10507
|
-
const I = dg(
|
|
10507
|
+
for (const _ of T) {
|
|
10508
|
+
const I = dg(_, a), v = { ...s };
|
|
10508
10509
|
I.forEach((C) => {
|
|
10509
|
-
delete
|
|
10510
|
-
}), Object.keys(
|
|
10510
|
+
delete v[C.name], delete v[`${C.name}_Array`], delete v[`${C.name}_Single`], delete v[`${C.name}_Lowercase`];
|
|
10511
|
+
}), Object.keys(v).length > 0 && (r === "create" && (v.Collection_Path ||= t, v.Collection_Path_String = t.join("/"), e.set(p(_.key), v)), r === "update" && e.update(p(_.key), v), r === "delete" && e.delete(p(_.key)));
|
|
10511
10512
|
}
|
|
10512
10513
|
if (r === "delete")
|
|
10513
10514
|
return;
|
|
10514
|
-
const S = y.filter((
|
|
10515
|
+
const S = y.filter((_) => ve(_) && _.twoWay);
|
|
10515
10516
|
if (!o?.noTwoWay) {
|
|
10516
|
-
for (const
|
|
10517
|
+
for (const _ of S)
|
|
10517
10518
|
throw new Error("VALIDATION_ERROR: batchSize is required");
|
|
10518
|
-
for (const
|
|
10519
|
+
for (const _ of S)
|
|
10519
10520
|
throw new Error("VALIDATION_ERROR: batchSize is required");
|
|
10520
|
-
for (const
|
|
10521
|
+
for (const _ of S)
|
|
10521
10522
|
throw new Error("VALIDATION_ERROR: batchSize is required");
|
|
10522
10523
|
}
|
|
10523
10524
|
};
|
|
10524
10525
|
var Ia, Jf;
|
|
10525
|
-
function
|
|
10526
|
+
function V_() {
|
|
10526
10527
|
if (Jf) return Ia;
|
|
10527
10528
|
Jf = 1;
|
|
10528
10529
|
function r(e, t) {
|
|
@@ -10533,7 +10534,7 @@ function Vv() {
|
|
|
10533
10534
|
return Ia = r, Ia;
|
|
10534
10535
|
}
|
|
10535
10536
|
var xa, Qf;
|
|
10536
|
-
function
|
|
10537
|
+
function W_() {
|
|
10537
10538
|
if (Qf) return xa;
|
|
10538
10539
|
Qf = 1;
|
|
10539
10540
|
var r = zr(), e = Vo();
|
|
@@ -10543,7 +10544,7 @@ function Wv() {
|
|
|
10543
10544
|
return xa = t, xa;
|
|
10544
10545
|
}
|
|
10545
10546
|
var Na, Xf;
|
|
10546
|
-
function
|
|
10547
|
+
function z_() {
|
|
10547
10548
|
if (Xf) return Na;
|
|
10548
10549
|
Xf = 1;
|
|
10549
10550
|
var r = zr(), e = Br();
|
|
@@ -10553,7 +10554,7 @@ function zv() {
|
|
|
10553
10554
|
return Na = t, Na;
|
|
10554
10555
|
}
|
|
10555
10556
|
var Fa, ed;
|
|
10556
|
-
function
|
|
10557
|
+
function B_() {
|
|
10557
10558
|
if (ed) return Fa;
|
|
10558
10559
|
ed = 1;
|
|
10559
10560
|
var r = zr(), e = Po();
|
|
@@ -10574,7 +10575,7 @@ function cm() {
|
|
|
10574
10575
|
return Da = i, Da;
|
|
10575
10576
|
}
|
|
10576
10577
|
var Ma, rd;
|
|
10577
|
-
function
|
|
10578
|
+
function Z_() {
|
|
10578
10579
|
if (rd) return Ma;
|
|
10579
10580
|
rd = 1;
|
|
10580
10581
|
var r = zr(), e = cm();
|
|
@@ -10584,7 +10585,7 @@ function Zv() {
|
|
|
10584
10585
|
return Ma = t, Ma;
|
|
10585
10586
|
}
|
|
10586
10587
|
var Pa, nd;
|
|
10587
|
-
function
|
|
10588
|
+
function G_() {
|
|
10588
10589
|
if (nd) return Pa;
|
|
10589
10590
|
nd = 1;
|
|
10590
10591
|
var r = Dd(), e = cm(), t = Br();
|
|
@@ -10594,7 +10595,7 @@ function Gv() {
|
|
|
10594
10595
|
return Pa = n, Pa;
|
|
10595
10596
|
}
|
|
10596
10597
|
var qa, sd;
|
|
10597
|
-
function
|
|
10598
|
+
function H_() {
|
|
10598
10599
|
if (sd) return qa;
|
|
10599
10600
|
sd = 1;
|
|
10600
10601
|
var r = Object.prototype, e = r.hasOwnProperty;
|
|
@@ -10605,7 +10606,7 @@ function Hv() {
|
|
|
10605
10606
|
return qa = t, qa;
|
|
10606
10607
|
}
|
|
10607
10608
|
var La, id;
|
|
10608
|
-
function
|
|
10609
|
+
function K_() {
|
|
10609
10610
|
if (id) return La;
|
|
10610
10611
|
id = 1;
|
|
10611
10612
|
var r = zo();
|
|
@@ -10616,7 +10617,7 @@ function Kv() {
|
|
|
10616
10617
|
return La = e, La;
|
|
10617
10618
|
}
|
|
10618
10619
|
var $a, ad;
|
|
10619
|
-
function
|
|
10620
|
+
function Y_() {
|
|
10620
10621
|
if (ad) return $a;
|
|
10621
10622
|
ad = 1;
|
|
10622
10623
|
var r = /\w*$/;
|
|
@@ -10627,7 +10628,7 @@ function Yv() {
|
|
|
10627
10628
|
return $a = e, $a;
|
|
10628
10629
|
}
|
|
10629
10630
|
var ja, od;
|
|
10630
|
-
function
|
|
10631
|
+
function J_() {
|
|
10631
10632
|
if (od) return ja;
|
|
10632
10633
|
od = 1;
|
|
10633
10634
|
var r = Wr(), e = r ? r.prototype : void 0, t = e ? e.valueOf : void 0;
|
|
@@ -10637,13 +10638,13 @@ function Jv() {
|
|
|
10637
10638
|
return ja = n, ja;
|
|
10638
10639
|
}
|
|
10639
10640
|
var Ua, cd;
|
|
10640
|
-
function
|
|
10641
|
+
function Q_() {
|
|
10641
10642
|
if (cd) return Ua;
|
|
10642
10643
|
cd = 1;
|
|
10643
|
-
var r = zo(), e =
|
|
10644
|
-
function
|
|
10644
|
+
var r = zo(), e = K_(), t = Y_(), n = J_(), s = Bd(), i = "[object Boolean]", a = "[object Date]", o = "[object Map]", c = "[object Number]", l = "[object RegExp]", u = "[object Set]", f = "[object String]", d = "[object Symbol]", h = "[object ArrayBuffer]", p = "[object DataView]", O = "[object Float32Array]", g = "[object Float64Array]", w = "[object Int8Array]", b = "[object Int16Array]", A = "[object Int32Array]", F = "[object Uint8Array]", y = "[object Uint8ClampedArray]", T = "[object Uint16Array]", S = "[object Uint32Array]";
|
|
10645
|
+
function _(I, v, C) {
|
|
10645
10646
|
var k = I.constructor;
|
|
10646
|
-
switch (
|
|
10647
|
+
switch (v) {
|
|
10647
10648
|
case h:
|
|
10648
10649
|
return r(I);
|
|
10649
10650
|
case i:
|
|
@@ -10651,7 +10652,7 @@ function Qv() {
|
|
|
10651
10652
|
return new k(+I);
|
|
10652
10653
|
case p:
|
|
10653
10654
|
return e(I, C);
|
|
10654
|
-
case
|
|
10655
|
+
case O:
|
|
10655
10656
|
case g:
|
|
10656
10657
|
case w:
|
|
10657
10658
|
case b:
|
|
@@ -10674,10 +10675,10 @@ function Qv() {
|
|
|
10674
10675
|
return n(I);
|
|
10675
10676
|
}
|
|
10676
10677
|
}
|
|
10677
|
-
return Ua =
|
|
10678
|
+
return Ua = _, Ua;
|
|
10678
10679
|
}
|
|
10679
10680
|
var Va, ld;
|
|
10680
|
-
function
|
|
10681
|
+
function X_() {
|
|
10681
10682
|
if (ld) return Va;
|
|
10682
10683
|
ld = 1;
|
|
10683
10684
|
var r = qn(), e = bt(), t = "[object Map]";
|
|
@@ -10690,7 +10691,7 @@ var Wa, ud;
|
|
|
10690
10691
|
function ew() {
|
|
10691
10692
|
if (ud) return Wa;
|
|
10692
10693
|
ud = 1;
|
|
10693
|
-
var r =
|
|
10694
|
+
var r = X_(), e = Lo(), t = $o(), n = t && t.isMap, s = n ? e(n) : r;
|
|
10694
10695
|
return Wa = s, Wa;
|
|
10695
10696
|
}
|
|
10696
10697
|
var za, fd;
|
|
@@ -10714,28 +10715,28 @@ var Za, hd;
|
|
|
10714
10715
|
function nw() {
|
|
10715
10716
|
if (hd) return Za;
|
|
10716
10717
|
hd = 1;
|
|
10717
|
-
var r = Mo(), e =
|
|
10718
|
-
Z[I] = Z[
|
|
10719
|
-
function Te(H, ge, re, Xe,
|
|
10720
|
-
var xe, wr = ge & T, Re = ge & S, br = ge &
|
|
10721
|
-
if (re && (xe =
|
|
10718
|
+
var r = Mo(), e = V_(), t = Zo(), n = W_(), s = z_(), i = zd(), a = Zd(), o = B_(), c = Z_(), l = jd(), u = G_(), f = qn(), d = H_(), h = Q_(), p = Gd(), O = Dt(), g = Mn(), w = ew(), b = wt(), A = rw(), F = Vo(), y = Br(), T = 1, S = 2, _ = 4, I = "[object Arguments]", v = "[object Array]", C = "[object Boolean]", k = "[object Date]", m = "[object Error]", R = "[object Function]", E = "[object GeneratorFunction]", D = "[object Map]", M = "[object Number]", N = "[object Object]", L = "[object RegExp]", z = "[object Set]", X = "[object String]", le = "[object Symbol]", P = "[object WeakMap]", oe = "[object ArrayBuffer]", ie = "[object DataView]", Me = "[object Float32Array]", Se = "[object Float64Array]", Le = "[object Int8Array]", Ot = "[object Int16Array]", G = "[object Int32Array]", K = "[object Uint8Array]", j = "[object Uint8ClampedArray]", Y = "[object Uint16Array]", U = "[object Uint32Array]", Z = {};
|
|
10719
|
+
Z[I] = Z[v] = Z[oe] = Z[ie] = Z[C] = Z[k] = Z[Me] = Z[Se] = Z[Le] = Z[Ot] = Z[G] = Z[D] = Z[M] = Z[N] = Z[L] = Z[z] = Z[X] = Z[le] = Z[K] = Z[j] = Z[Y] = Z[U] = !0, Z[m] = Z[R] = Z[P] = !1;
|
|
10720
|
+
function Te(H, ge, re, Xe, dt, Be) {
|
|
10721
|
+
var xe, wr = ge & T, Re = ge & S, br = ge & _;
|
|
10722
|
+
if (re && (xe = dt ? re(H, Xe, dt, Be) : re(H)), xe !== void 0)
|
|
10722
10723
|
return xe;
|
|
10723
10724
|
if (!b(H))
|
|
10724
10725
|
return H;
|
|
10725
|
-
var
|
|
10726
|
-
if (
|
|
10726
|
+
var vc = O(H);
|
|
10727
|
+
if (vc) {
|
|
10727
10728
|
if (xe = d(H), !wr)
|
|
10728
10729
|
return a(H, xe);
|
|
10729
10730
|
} else {
|
|
10730
|
-
var Ht = f(H),
|
|
10731
|
+
var Ht = f(H), _c = Ht == R || Ht == E;
|
|
10731
10732
|
if (g(H))
|
|
10732
10733
|
return i(H, wr);
|
|
10733
|
-
if (Ht == N || Ht == I ||
|
|
10734
|
-
if (xe = Re ||
|
|
10734
|
+
if (Ht == N || Ht == I || _c && !dt) {
|
|
10735
|
+
if (xe = Re || _c ? {} : p(H), !wr)
|
|
10735
10736
|
return Re ? c(H, s(xe, H)) : o(H, n(xe, H));
|
|
10736
10737
|
} else {
|
|
10737
10738
|
if (!Z[Ht])
|
|
10738
|
-
return
|
|
10739
|
+
return dt ? H : {};
|
|
10739
10740
|
xe = h(H, Ht, wr);
|
|
10740
10741
|
}
|
|
10741
10742
|
}
|
|
@@ -10748,7 +10749,7 @@ function nw() {
|
|
|
10748
10749
|
}) : w(H) && H.forEach(function(Et, Pt) {
|
|
10749
10750
|
xe.set(Pt, Te(Et, ge, re, Pt, H, Be));
|
|
10750
10751
|
});
|
|
10751
|
-
var Im = br ? Re ? u : l : Re ? y : F, bc =
|
|
10752
|
+
var Im = br ? Re ? u : l : Re ? y : F, bc = vc ? void 0 : Im(H);
|
|
10752
10753
|
return e(bc || H, function(Et, Pt) {
|
|
10753
10754
|
bc && (Pt = Et, Et = H[Pt]), t(xe, Pt, Te(Et, ge, re, Pt, H, Be));
|
|
10754
10755
|
}), xe;
|
|
@@ -10855,18 +10856,18 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
|
|
|
10855
10856
|
const t = We(), n = Mt(), s = Ve(), i = De(), a = r.at(-1);
|
|
10856
10857
|
if (!a)
|
|
10857
10858
|
throw new Error("EMPTY_PATH");
|
|
10858
|
-
const o = s.collections[a], { labels: c, fields: l, preloadCache: u } = o, f =
|
|
10859
|
+
const o = s.collections[a], { labels: c, fields: l, preloadCache: u } = o, f = ft(a), d = i.collections?.[c.collection];
|
|
10859
10860
|
if (!i.Role)
|
|
10860
10861
|
throw new Error("PERMISSION_DENIED");
|
|
10861
|
-
const h = d &&
|
|
10862
|
+
const h = d && ct("Read", d), p = kn(o, s, i), O = Rd(o, i), g = xo(o, i), w = Cd(o, s, i), b = (m = []) => {
|
|
10862
10863
|
const R = [];
|
|
10863
10864
|
if (h)
|
|
10864
10865
|
R.push(me(qr(t, "tenants", n, "system_fields", c.collection, `${c.collection}-${e.key}`), ye("Collection_Path_String", "==", r.join("/")), ...m));
|
|
10865
10866
|
else if (p)
|
|
10866
|
-
for (const
|
|
10867
|
-
R.push(me(qr(t, "tenants", n, "system_fields", c.collection, `${c.collection}-${
|
|
10867
|
+
for (const E of p)
|
|
10868
|
+
R.push(me(qr(t, "tenants", n, "system_fields", c.collection, `${c.collection}-${E.field}`), ye("Collection_Path_String", "==", r.join("/")), ...m));
|
|
10868
10869
|
return R;
|
|
10869
|
-
}, A =
|
|
10870
|
+
}, A = O.filter((m) => "operations" in m && m.operations ? m.operations.includes("Read") : !0);
|
|
10870
10871
|
if (A.length === 0 && g.length === 0 && w.length === 0)
|
|
10871
10872
|
return b();
|
|
10872
10873
|
let F = 0;
|
|
@@ -10876,7 +10877,7 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
|
|
|
10876
10877
|
if (A) {
|
|
10877
10878
|
for (const m of A)
|
|
10878
10879
|
if (m.type === "Record_Property") {
|
|
10879
|
-
const R = m.roles.find((
|
|
10880
|
+
const R = m.roles.find((E) => E.role === i.Role);
|
|
10880
10881
|
if (!R)
|
|
10881
10882
|
throw new Error("PERMISSION_DENIED");
|
|
10882
10883
|
y(R.values?.length);
|
|
@@ -10885,42 +10886,42 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
|
|
|
10885
10886
|
u?.roles.includes(i.Role) && u.range && y(u.range.fields.length);
|
|
10886
10887
|
const T = f.admin?.statusField;
|
|
10887
10888
|
T && !u?.roles.includes(i.Role) && y(Math.max(T.active?.length || 0, T.archived?.length || 0));
|
|
10888
|
-
const S = F === 0 ? 30 : Math.max(1, Math.floor(30 / F)),
|
|
10889
|
-
A.filter((m) => m.type === "Record_Owner").forEach(() =>
|
|
10889
|
+
const S = F === 0 ? 30 : Math.max(1, Math.floor(30 / F)), _ = [];
|
|
10890
|
+
A.filter((m) => m.type === "Record_Owner").forEach(() => _.push(ye("Created_By", "==", i.User_ID))), A.filter((m) => m.type === "Record_User").forEach((m) => {
|
|
10890
10891
|
if ("collectionField" in m) {
|
|
10891
10892
|
const R = te(l, m.collectionField);
|
|
10892
|
-
|
|
10893
|
+
_.push(ye(`${R.name}_Array`, "array-contains", i.Doc_ID));
|
|
10893
10894
|
}
|
|
10894
10895
|
}), A.filter((m) => m.type === "Record_Property").forEach((m) => {
|
|
10895
10896
|
if ("propertyField" in m) {
|
|
10896
10897
|
const R = m.roles.find((D) => D.role === i.Role);
|
|
10897
10898
|
if (!R)
|
|
10898
10899
|
throw new Error("PERMISSION_DENIED");
|
|
10899
|
-
const
|
|
10900
|
-
|
|
10900
|
+
const E = te(l, m.propertyField);
|
|
10901
|
+
E.type === "Array" ? _.push(ye(E.name, "array-contains-any", R.values)) : _.push(ye(E.name, "in", R.values));
|
|
10901
10902
|
}
|
|
10902
10903
|
});
|
|
10903
10904
|
const I = [];
|
|
10904
10905
|
g.filter((m) => m.type === "Individual").forEach((m) => {
|
|
10905
|
-
const R = d?.individualEntities,
|
|
10906
|
+
const R = d?.individualEntities, E = [];
|
|
10906
10907
|
if (R) {
|
|
10907
10908
|
const D = m.singleQuery ? m.singleQuery : S;
|
|
10908
10909
|
for (let M = 0; M < R.length; M += D) {
|
|
10909
10910
|
const N = R.slice(M, M + D);
|
|
10910
|
-
|
|
10911
|
+
E.push(N);
|
|
10911
10912
|
}
|
|
10912
10913
|
if (!m.singleQuery)
|
|
10913
|
-
|
|
10914
|
-
I.push(...b(
|
|
10914
|
+
E.forEach((M) => {
|
|
10915
|
+
I.push(...b(_.concat(ye("id", "in", M))));
|
|
10915
10916
|
});
|
|
10916
10917
|
else {
|
|
10917
10918
|
if (R.length > D)
|
|
10918
10919
|
throw new Error(`INPUT_ERROR: Individual entity restriction with singleQuery set to true must not have more than ${m.singleQuery} entities`);
|
|
10919
|
-
|
|
10920
|
+
_.push(ye("id", "in", R));
|
|
10920
10921
|
}
|
|
10921
10922
|
}
|
|
10922
10923
|
}), w.filter((m) => m.parentFilter.type === "Individual").forEach((m) => {
|
|
10923
|
-
const { parentFilter: R, parentRestriction:
|
|
10924
|
+
const { parentFilter: R, parentRestriction: E } = m;
|
|
10924
10925
|
if ("collectionField" in R) {
|
|
10925
10926
|
const D = te(l, R.collectionField);
|
|
10926
10927
|
if ("collection" in D) {
|
|
@@ -10929,50 +10930,50 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
|
|
|
10929
10930
|
throw new Error("PERMISSION_DENIED");
|
|
10930
10931
|
const N = M?.individualEntities, L = [];
|
|
10931
10932
|
if (N) {
|
|
10932
|
-
const z =
|
|
10933
|
+
const z = E.singleQuery ? E.singleQuery : S;
|
|
10933
10934
|
for (let X = 0; X < N.length; X += z) {
|
|
10934
10935
|
const le = N.slice(X, X + z);
|
|
10935
10936
|
L.push(le);
|
|
10936
10937
|
}
|
|
10937
|
-
if (!
|
|
10938
|
+
if (!E.singleQuery)
|
|
10938
10939
|
L.forEach((X) => {
|
|
10939
|
-
I.push(...b(
|
|
10940
|
+
I.push(...b(_.concat(ye(`${D.name}_Array`, "array-contains-any", X))));
|
|
10940
10941
|
});
|
|
10941
10942
|
else {
|
|
10942
10943
|
if (N.length > z)
|
|
10943
|
-
throw new Error(`INPUT_ERROR: Individual entity parentFilter with singleQuery set to true must not have more than ${
|
|
10944
|
-
|
|
10944
|
+
throw new Error(`INPUT_ERROR: Individual entity parentFilter with singleQuery set to true must not have more than ${E.singleQuery} entities`);
|
|
10945
|
+
_.push(ye(`${D.name}_Array`, "array-contains-any", N));
|
|
10945
10946
|
}
|
|
10946
10947
|
}
|
|
10947
10948
|
}
|
|
10948
10949
|
}
|
|
10949
10950
|
});
|
|
10950
|
-
const
|
|
10951
|
+
const v = [];
|
|
10951
10952
|
g.filter((m) => m.type === "Parent").forEach((m) => {
|
|
10952
10953
|
if ("collectionField" in m) {
|
|
10953
10954
|
const R = te(l, m.collectionField);
|
|
10954
10955
|
if ("collection" in R) {
|
|
10955
|
-
const
|
|
10956
|
-
if (
|
|
10956
|
+
const E = d?.parentEntities, D = [];
|
|
10957
|
+
if (E) {
|
|
10957
10958
|
const M = m.singleQuery ? m.singleQuery : S;
|
|
10958
|
-
for (let N = 0; N <
|
|
10959
|
-
const L =
|
|
10959
|
+
for (let N = 0; N < E.length; N += M) {
|
|
10960
|
+
const L = E.slice(N, N + M);
|
|
10960
10961
|
D.push(L);
|
|
10961
10962
|
}
|
|
10962
10963
|
if (!m.singleQuery)
|
|
10963
10964
|
D.forEach((N) => {
|
|
10964
|
-
|
|
10965
|
+
v.push(...b(_.concat(ye(`${R.name}_Array`, "array-contains-any", N))));
|
|
10965
10966
|
});
|
|
10966
10967
|
else {
|
|
10967
|
-
if (
|
|
10968
|
+
if (E && E.length > M)
|
|
10968
10969
|
throw new Error(`INPUT_ERROR: Parent entity restriction with singleQuery set to true must not have more than ${m.singleQuery} entities`);
|
|
10969
|
-
|
|
10970
|
+
_.push(ye(`${R.name}_Array`, "array-contains-any", E));
|
|
10970
10971
|
}
|
|
10971
10972
|
}
|
|
10972
10973
|
}
|
|
10973
10974
|
}
|
|
10974
10975
|
}), w.filter((m) => m.parentFilter.type === "Parent").forEach((m) => {
|
|
10975
|
-
const { parentFilter: R, parentRestriction:
|
|
10976
|
+
const { parentFilter: R, parentRestriction: E } = m;
|
|
10976
10977
|
if ("collectionField" in R && "parentCollectionField" in R) {
|
|
10977
10978
|
const D = te(l, R.collectionField), M = te(l, R.parentCollectionField);
|
|
10978
10979
|
if ("collection" in D && "collection" in M) {
|
|
@@ -10981,28 +10982,28 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
|
|
|
10981
10982
|
throw new Error("PERMISSION_DENIED");
|
|
10982
10983
|
const L = N.parentEntities, z = [];
|
|
10983
10984
|
if (L) {
|
|
10984
|
-
const X =
|
|
10985
|
+
const X = E.singleQuery ? E.singleQuery : S;
|
|
10985
10986
|
for (let le = 0; le < L.length; le += X) {
|
|
10986
10987
|
const P = L.slice(le, le + X);
|
|
10987
10988
|
z.push(P);
|
|
10988
10989
|
}
|
|
10989
|
-
if (!
|
|
10990
|
+
if (!E.singleQuery)
|
|
10990
10991
|
z.forEach((le) => {
|
|
10991
|
-
|
|
10992
|
+
v.push(...b(_.concat(ye(`${M.name}_Array`, "array-contains-any", le))));
|
|
10992
10993
|
});
|
|
10993
10994
|
else {
|
|
10994
10995
|
if (L && L.length > X)
|
|
10995
|
-
throw new Error(`INPUT_ERROR: Parent entity parentFilter with singleQuery set to true must not have more than ${
|
|
10996
|
-
|
|
10996
|
+
throw new Error(`INPUT_ERROR: Parent entity parentFilter with singleQuery set to true must not have more than ${E.singleQuery} entities`);
|
|
10997
|
+
_.push(ye(`${M.name}_Array`, "array-contains-any", L));
|
|
10997
10998
|
}
|
|
10998
10999
|
}
|
|
10999
11000
|
}
|
|
11000
11001
|
}
|
|
11001
11002
|
});
|
|
11002
11003
|
const C = [];
|
|
11003
|
-
|
|
11004
|
+
v.length === 0 && (g.filter((m) => m.type === "Parent_Property").forEach((m) => {
|
|
11004
11005
|
if ("collectionField" in m && "propertyField" in m) {
|
|
11005
|
-
const R = te(l, m.collectionField),
|
|
11006
|
+
const R = te(l, m.collectionField), E = te(l, m.propertyField);
|
|
11006
11007
|
if ("collection" in R) {
|
|
11007
11008
|
const D = d?.parentPropertyEntities || {};
|
|
11008
11009
|
Object.entries(D).forEach(([M, N]) => {
|
|
@@ -11013,9 +11014,9 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
|
|
|
11013
11014
|
L.push(X);
|
|
11014
11015
|
}
|
|
11015
11016
|
L.forEach((z) => {
|
|
11016
|
-
C.push(...b(
|
|
11017
|
+
C.push(...b(_.concat([
|
|
11017
11018
|
ye(`${R.name}_Array`, "array-contains-any", z),
|
|
11018
|
-
ye(
|
|
11019
|
+
ye(E.name, "==", M)
|
|
11019
11020
|
])));
|
|
11020
11021
|
});
|
|
11021
11022
|
}
|
|
@@ -11025,9 +11026,9 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
|
|
|
11025
11026
|
}), w.filter((m) => m.parentFilter.type === "Parent_Property").forEach((m) => {
|
|
11026
11027
|
const { parentFilter: R } = m;
|
|
11027
11028
|
if ("collectionField" in R && "parentCollectionField" in R && "parentPropertyField" in R) {
|
|
11028
|
-
const
|
|
11029
|
-
if ("collection" in
|
|
11030
|
-
const N = i.collections?.[
|
|
11029
|
+
const E = te(l, R.collectionField), D = te(l, R.parentCollectionField), M = te(l, R.parentPropertyField);
|
|
11030
|
+
if ("collection" in E && "collection" in D) {
|
|
11031
|
+
const N = i.collections?.[E.collection];
|
|
11031
11032
|
if (!N)
|
|
11032
11033
|
throw new Error("PERMISSION_DENIED");
|
|
11033
11034
|
const L = N.parentPropertyEntities || {};
|
|
@@ -11039,7 +11040,7 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
|
|
|
11039
11040
|
le.push(oe);
|
|
11040
11041
|
}
|
|
11041
11042
|
le.forEach((P) => {
|
|
11042
|
-
C.push(...b(
|
|
11043
|
+
C.push(...b(_.concat([
|
|
11043
11044
|
ye(`${D.name}_Array`, "array-contains-any", P),
|
|
11044
11045
|
ye(M.name, "==", z)
|
|
11045
11046
|
])));
|
|
@@ -11049,8 +11050,8 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
|
|
|
11049
11050
|
}
|
|
11050
11051
|
}
|
|
11051
11052
|
}));
|
|
11052
|
-
const k = [...I, ...
|
|
11053
|
-
return !g.length && !w.length ? b(
|
|
11053
|
+
const k = [...I, ...v, ...C];
|
|
11054
|
+
return !g.length && !w.length ? b(_) : k;
|
|
11054
11055
|
}, fm = {}, xr = {}, Zw = async (r) => {
|
|
11055
11056
|
for (const s of Object.keys(xr))
|
|
11056
11057
|
delete xr[s];
|
|
@@ -11067,7 +11068,7 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
|
|
|
11067
11068
|
n.includes(s) || t.includes(s) || await sr(s, r?.[s].constraints, r?.[s].range, r?.[s].orQueries, r);
|
|
11068
11069
|
return xr;
|
|
11069
11070
|
}, To = () => fm, lw = () => xr, uw = async (r, e, t, n, s) => {
|
|
11070
|
-
const { labels: i, preloadCache: a } = r, c = Jr()[i.collection], l = Ie(), u =
|
|
11071
|
+
const { labels: i, preloadCache: a } = r, c = Jr()[i.collection], l = Ie(), u = ft(i.collection), f = De();
|
|
11071
11072
|
if (!f?.Role)
|
|
11072
11073
|
throw new Error("PERMISSION_DENIED");
|
|
11073
11074
|
if (!a?.roles.includes(f.Role))
|
|
@@ -11091,7 +11092,7 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
|
|
|
11091
11092
|
g = me(g, Rc(...A, ...F || []));
|
|
11092
11093
|
}
|
|
11093
11094
|
return n && (g = me(g, Xr(Rc(...n.map((w) => ye(...w)))))), e && (g = me(g, Xr(...e.map((w) => ye(...w))))), g;
|
|
11094
|
-
}),
|
|
11095
|
+
}), O = /* @__PURE__ */ new Map();
|
|
11095
11096
|
return new Promise((g, w) => {
|
|
11096
11097
|
if (p.length === 0) {
|
|
11097
11098
|
g({});
|
|
@@ -11100,7 +11101,7 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
|
|
|
11100
11101
|
p.forEach((b) => {
|
|
11101
11102
|
let A = !1;
|
|
11102
11103
|
const F = hr(b, { includeMetadataChanges: !0 }, (y) => {
|
|
11103
|
-
(!y.metadata.fromCache || A) && (A || (A = !0,
|
|
11104
|
+
(!y.metadata.fromCache || A) && (A || (A = !0, O.set(b, !0), O.size === p.length && g({})));
|
|
11104
11105
|
}, (y) => {
|
|
11105
11106
|
console.error(`${h} - ${y.message}`), w(y);
|
|
11106
11107
|
});
|
|
@@ -11116,7 +11117,7 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
|
|
|
11116
11117
|
if (i && (d = i), f[d] === "Loading" || !u?.roles.includes(o.Role))
|
|
11117
11118
|
return;
|
|
11118
11119
|
const h = o.collections?.[r];
|
|
11119
|
-
if (!(h &&
|
|
11120
|
+
if (!(h && ct("Read", h) || kn(c, a, o).length > 0)) {
|
|
11120
11121
|
f[d] = "Error";
|
|
11121
11122
|
return;
|
|
11122
11123
|
}
|
|
@@ -11124,7 +11125,7 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
|
|
|
11124
11125
|
const p = new Event(`stoker:loading:${r}`);
|
|
11125
11126
|
document.dispatchEvent(p);
|
|
11126
11127
|
try {
|
|
11127
|
-
if (await uw(c, e, t, n, i), u?.relationCollections && !i && await
|
|
11128
|
+
if (await uw(c, e, t, n, i), u?.relationCollections && !i && await _e(u.relationCollections)) {
|
|
11128
11129
|
const w = jt(c, a, o);
|
|
11129
11130
|
for (const b of w)
|
|
11130
11131
|
if (!s?.[b]) {
|
|
@@ -11137,10 +11138,10 @@ const we = /* @__PURE__ */ In(iw), Nt = (r) => {
|
|
|
11137
11138
|
}
|
|
11138
11139
|
}
|
|
11139
11140
|
f[d] = "Loaded";
|
|
11140
|
-
const
|
|
11141
|
-
document.dispatchEvent(
|
|
11142
|
-
} catch (
|
|
11143
|
-
throw f[d] = "Error",
|
|
11141
|
+
const O = new Event(`stoker:loaded:${r}`);
|
|
11142
|
+
document.dispatchEvent(O);
|
|
11143
|
+
} catch (O) {
|
|
11144
|
+
throw f[d] = "Error", O;
|
|
11144
11145
|
}
|
|
11145
11146
|
};
|
|
11146
11147
|
let $t = null;
|
|
@@ -11161,13 +11162,13 @@ const fw = async (r, e) => {
|
|
|
11161
11162
|
if (document.dispatchEvent(p), i.auth.signOutOnPermissionsChange)
|
|
11162
11163
|
Em();
|
|
11163
11164
|
else {
|
|
11164
|
-
const
|
|
11165
|
-
if (
|
|
11166
|
-
for (const [g, w] of Object.entries(
|
|
11165
|
+
const O = $t.collections;
|
|
11166
|
+
if (O)
|
|
11167
|
+
for (const [g, w] of Object.entries(O))
|
|
11167
11168
|
// eslint-disable-next-line security/detect-object-injection
|
|
11168
11169
|
a.collections[g] && c && // eslint-disable-next-line security/detect-object-injection
|
|
11169
11170
|
(!c.collections?.[g] || // eslint-disable-next-line security/detect-object-injection
|
|
11170
|
-
!
|
|
11171
|
+
!vy(w, c.collections[g])) && sr(g);
|
|
11171
11172
|
}
|
|
11172
11173
|
}
|
|
11173
11174
|
c = $t;
|
|
@@ -11203,8 +11204,8 @@ const fw = async (r, e) => {
|
|
|
11203
11204
|
const b = /* @__PURE__ */ new Date(), A = new Date((/* @__PURE__ */ new Date()).setDate(b.getDate() + h));
|
|
11204
11205
|
p.TTL = Bt.fromDate(A);
|
|
11205
11206
|
}
|
|
11206
|
-
const
|
|
11207
|
-
r !== "delete" && (p.data.data =
|
|
11207
|
+
const O = we(t);
|
|
11208
|
+
r !== "delete" && (p.data.data = O, e === "written" && cc(p.data.data)), r !== "delete" && e !== "written" && tr(O), r === "update" && (p.data.originalRecord = we(c)), r !== "delete" && ["started", "written"].includes(e) && (delete p.data.data.Saved_At, delete p.data.data.Last_Save_At), e === "failed" && (p.data.error = JSON.stringify(o));
|
|
11208
11209
|
const g = t.Last_Write_At, w = ke(d, "tenants", l, n.join("/"), s, "system_write_log", `${a}-${g.valueOf()}`);
|
|
11209
11210
|
Gm(w, p).catch((b) => {
|
|
11210
11211
|
console.error(`Error saving "${e}" ${r} log entry for record ${s} in ${u.collection} collection.`, { cause: b });
|
|
@@ -11235,7 +11236,7 @@ const fw = async (r, e) => {
|
|
|
11235
11236
|
const c = i.collections[o], { labels: l } = c, u = a.collections?.[l.collection];
|
|
11236
11237
|
if (!a.Role)
|
|
11237
11238
|
throw new Error("PERMISSION_DENIED");
|
|
11238
|
-
const f = u &&
|
|
11239
|
+
const f = u && ct("Read", u), d = kn(c, i, a), h = [];
|
|
11239
11240
|
if (f)
|
|
11240
11241
|
h.push(ke(n, "tenants", s, "system_fields", l.collection, `${l.collection}-${t.key}`, e));
|
|
11241
11242
|
else if (d)
|
|
@@ -11304,7 +11305,7 @@ const fw = async (r, e) => {
|
|
|
11304
11305
|
if (!De())
|
|
11305
11306
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11306
11307
|
const o = e.at(-2);
|
|
11307
|
-
t.fields ||= n.collections[o].fields.filter((u) =>
|
|
11308
|
+
t.fields ||= n.collections[o].fields.filter((u) => ve(u));
|
|
11308
11309
|
const c = t.depth - 1, l = [];
|
|
11309
11310
|
for (const u of t.fields)
|
|
11310
11311
|
if ("collection" in u) {
|
|
@@ -11313,7 +11314,7 @@ const fw = async (r, e) => {
|
|
|
11313
11314
|
continue;
|
|
11314
11315
|
const d = Object.keys(f);
|
|
11315
11316
|
for (const h of d) {
|
|
11316
|
-
const p = f[h],
|
|
11317
|
+
const p = f[h], O = _r(p.Collection_Path, h, { only: s, noEmbeddingFields: i }).then((g) => {
|
|
11317
11318
|
if (f[h] = g, c > 0)
|
|
11318
11319
|
return uc(
|
|
11319
11320
|
// eslint-disable-next-line security/detect-object-injection
|
|
@@ -11330,7 +11331,7 @@ const fw = async (r, e) => {
|
|
|
11330
11331
|
else
|
|
11331
11332
|
throw g;
|
|
11332
11333
|
});
|
|
11333
|
-
l.push(
|
|
11334
|
+
l.push(O);
|
|
11334
11335
|
}
|
|
11335
11336
|
}
|
|
11336
11337
|
await Promise.all(l);
|
|
@@ -11350,7 +11351,7 @@ const fw = async (r, e) => {
|
|
|
11350
11351
|
const s = Ve(!0), a = Jr()[n], o = s.collections[n], { labels: c, access: l, preloadCache: u } = o, { serverReadOnly: f } = l, d = Ie(), h = Object.keys(s.collections).includes(n), p = d.disabledCollections?.includes(n);
|
|
11351
11352
|
if (!h || p)
|
|
11352
11353
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11353
|
-
const
|
|
11354
|
+
const O = await ft(c.collection), g = await ne(d, [
|
|
11354
11355
|
"global",
|
|
11355
11356
|
"firebase",
|
|
11356
11357
|
"serverTimestampOptions"
|
|
@@ -11373,23 +11374,23 @@ const fw = async (r, e) => {
|
|
|
11373
11374
|
const m = t.pagination.startAfter || t.pagination.endBefore, R = Ud(w.Role, o, s);
|
|
11374
11375
|
if (m && R !== !0)
|
|
11375
11376
|
throw new Error("INPUT_ERROR: Pagination is not allowed when using " + R);
|
|
11376
|
-
t.pagination.orderByField && t.pagination.orderByDirection ? t.pagination.startAfter || t.pagination.endBefore ? t.pagination.startAfter ? A = A.map((
|
|
11377
|
+
t.pagination.orderByField && t.pagination.orderByDirection ? t.pagination.startAfter || t.pagination.endBefore ? t.pagination.startAfter ? A = A.map((E, D) => me(E, rt(t.pagination.orderByField, t.pagination.orderByDirection), eo(F.last.get(D)), Xt(t.pagination.number))) : A = A.map((E, D) => me(E, rt(t.pagination.orderByField, t.pagination.orderByDirection), to(F.first.get(D)), Fr(t.pagination.number))) : A = A.map((E) => me(E, rt(t.pagination.orderByField, t.pagination.orderByDirection), Xt(t.pagination.number))) : !t.pagination.startAfter && !t.pagination.endBefore ? A = A.map((E) => me(E, Xt(t.pagination.number))) : t.pagination.startAfter ? A = A.map((E, D) => me(E, eo(F.last.get(D)), Xt(t.pagination.number))) : A = A.map((E, D) => me(E, to(F.first.get(D)), Fr(t.pagination.number)));
|
|
11377
11378
|
}
|
|
11378
11379
|
const y = { collection: c.collection };
|
|
11379
|
-
await ae("preOperation", d,
|
|
11380
|
-
const
|
|
11380
|
+
await ae("preOperation", d, O, ["read", void 0, void 0, y]), await ae("preRead", d, O, [y, A, !0, !1]);
|
|
11381
|
+
const _ = /* @__PURE__ */ new Map(), I = A.map(async (m) => {
|
|
11381
11382
|
let R;
|
|
11382
11383
|
return t?.only === "cache" ? R = await Od(m) : t?.only === "server" ? R = await Hm(m) : R = await Km(m), R;
|
|
11383
|
-
}),
|
|
11384
|
-
for (const m of
|
|
11384
|
+
}), v = await Promise.all(I);
|
|
11385
|
+
for (const m of v) {
|
|
11385
11386
|
for (const R of m.docs) {
|
|
11386
|
-
|
|
11387
|
-
const
|
|
11387
|
+
_.has(R.id) || _.set(R.id, {});
|
|
11388
|
+
const E = R.data({ serverTimestamps: g || "none" }), D = _.get(R.id);
|
|
11388
11389
|
D.id ||= R.id;
|
|
11389
|
-
const M = { ...D, ...
|
|
11390
|
-
delete M.Collection_Path_String,
|
|
11390
|
+
const M = { ...D, ...E };
|
|
11391
|
+
delete M.Collection_Path_String, _.set(R.id, M);
|
|
11391
11392
|
}
|
|
11392
|
-
F.first.set(
|
|
11393
|
+
F.first.set(v.indexOf(m), m.docs[0]), F.last.set(v.indexOf(m), m.docs.at(-1) || m.docs[0]);
|
|
11393
11394
|
}
|
|
11394
11395
|
let C;
|
|
11395
11396
|
if (t?.pagination && !u?.roles.includes(w?.Role) && !f?.includes(w?.Role)) {
|
|
@@ -11398,18 +11399,18 @@ const fw = async (r, e) => {
|
|
|
11398
11399
|
const R = await Ed(m).catch(() => {
|
|
11399
11400
|
});
|
|
11400
11401
|
if (R) {
|
|
11401
|
-
const
|
|
11402
|
-
C = D > 0 ? Math.floor(
|
|
11402
|
+
const E = R.data().count, D = t.pagination.number;
|
|
11403
|
+
C = D > 0 ? Math.floor(E / D) : 0;
|
|
11403
11404
|
}
|
|
11404
11405
|
}
|
|
11405
11406
|
let k;
|
|
11406
|
-
t?.noComputedFields || (k = await
|
|
11407
|
-
for (const m of
|
|
11408
|
-
const R = [],
|
|
11407
|
+
t?.noComputedFields || (k = await _e(O.admin?.retriever));
|
|
11408
|
+
for (const m of _.values()) {
|
|
11409
|
+
const R = [], E = [...m.Collection_Path, m.id];
|
|
11409
11410
|
t?.subcollections && R.push(mm(
|
|
11410
11411
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11411
|
-
|
|
11412
|
-
|
|
11412
|
+
_.get(m.id),
|
|
11413
|
+
E,
|
|
11413
11414
|
we(t.subcollections),
|
|
11414
11415
|
s,
|
|
11415
11416
|
we(t?.relations),
|
|
@@ -11425,8 +11426,8 @@ const fw = async (r, e) => {
|
|
|
11425
11426
|
return L;
|
|
11426
11427
|
})), R.push(uc(
|
|
11427
11428
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11428
|
-
|
|
11429
|
-
|
|
11429
|
+
_.get(m.id),
|
|
11430
|
+
E,
|
|
11430
11431
|
we(t.relations),
|
|
11431
11432
|
s,
|
|
11432
11433
|
t?.only,
|
|
@@ -11434,14 +11435,14 @@ const fw = async (r, e) => {
|
|
|
11434
11435
|
))), await Promise.all(R);
|
|
11435
11436
|
const D = [];
|
|
11436
11437
|
for (const L of o.fields)
|
|
11437
|
-
L.type === "Computed" && !t?.noComputedFields && D.push(
|
|
11438
|
+
L.type === "Computed" && !t?.noComputedFields && D.push(_e(L.formula, [m, k]).then((z) => {
|
|
11438
11439
|
m[L.name] = z;
|
|
11439
11440
|
})), t?.noEmbeddingFields && L.type === "Embedding" && delete m[L.name];
|
|
11440
11441
|
await Promise.all(D);
|
|
11441
11442
|
const M = ["read", m, m.id, y];
|
|
11442
|
-
await ae("postOperation", d,
|
|
11443
|
+
await ae("postOperation", d, O, M), await ae("postRead", d, O, [y, b, m, !1]);
|
|
11443
11444
|
}
|
|
11444
|
-
return { cursor: F, pages: C, docs: Array.from(
|
|
11445
|
+
return { cursor: F, pages: C, docs: Array.from(_.values()) };
|
|
11445
11446
|
}, mw = async (r, e, t) => {
|
|
11446
11447
|
const n = it(), s = ze(), i = Ue(n, s.STOKER_FB_FUNCTIONS_REGION), l = (await Je(i, "stoker-readapi")({
|
|
11447
11448
|
path: r,
|
|
@@ -11478,7 +11479,7 @@ const fw = async (r, e) => {
|
|
|
11478
11479
|
if (!De())
|
|
11479
11480
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11480
11481
|
const c = e.at(-2);
|
|
11481
|
-
t.fields ||= n.collections[c].fields.filter((f) =>
|
|
11482
|
+
t.fields ||= n.collections[c].fields.filter((f) => ve(f));
|
|
11482
11483
|
const l = t.depth - 1, u = [];
|
|
11483
11484
|
for (const f of t.fields)
|
|
11484
11485
|
if ("collection" in f) {
|
|
@@ -11486,7 +11487,7 @@ const fw = async (r, e) => {
|
|
|
11486
11487
|
if (!d)
|
|
11487
11488
|
continue;
|
|
11488
11489
|
for (const [h, p] of Object.entries(d)) {
|
|
11489
|
-
const
|
|
11490
|
+
const O = _r(p.Collection_Path, h, {
|
|
11490
11491
|
only: s,
|
|
11491
11492
|
noComputedFields: i,
|
|
11492
11493
|
noEmbeddingFields: a
|
|
@@ -11508,11 +11509,11 @@ const fw = async (r, e) => {
|
|
|
11508
11509
|
else
|
|
11509
11510
|
throw g;
|
|
11510
11511
|
});
|
|
11511
|
-
u.push(
|
|
11512
|
+
u.push(O);
|
|
11512
11513
|
}
|
|
11513
11514
|
}
|
|
11514
11515
|
await Promise.all(u);
|
|
11515
|
-
},
|
|
11516
|
+
}, _r = async (r, e, t) => {
|
|
11516
11517
|
if (t?.subcollections?.depth && t.subcollections.depth > 10)
|
|
11517
11518
|
throw new Error("INPUT_ERROR: Subcollections depth cannot exceed 10");
|
|
11518
11519
|
if (t?.relations?.depth && t.relations.depth > 10)
|
|
@@ -11527,7 +11528,7 @@ const fw = async (r, e) => {
|
|
|
11527
11528
|
"global",
|
|
11528
11529
|
"firebase",
|
|
11529
11530
|
"serverTimestampOptions"
|
|
11530
|
-
]), f = s.collections[n], { labels: d, access: h } = f, { serverReadOnly: p } = h,
|
|
11531
|
+
]), f = s.collections[n], { labels: d, access: h } = f, { serverReadOnly: p } = h, O = ft(d.collection), g = De();
|
|
11531
11532
|
if (!g?.Role)
|
|
11532
11533
|
throw new Error("PERMISSIONS_DENIED");
|
|
11533
11534
|
if (p?.includes(g.Role))
|
|
@@ -11536,7 +11537,7 @@ const fw = async (r, e) => {
|
|
|
11536
11537
|
if (w.length === 0)
|
|
11537
11538
|
throw new Error("PERMISSION_DENIED");
|
|
11538
11539
|
const b = { collection: d.collection };
|
|
11539
|
-
await ae("preOperation", o,
|
|
11540
|
+
await ae("preOperation", o, O, ["read", void 0, e, b]), await ae("preRead", o, O, [b, w, !1, !1]);
|
|
11540
11541
|
let y = {};
|
|
11541
11542
|
const T = w.map(async (k) => {
|
|
11542
11543
|
let m;
|
|
@@ -11546,8 +11547,8 @@ const fw = async (r, e) => {
|
|
|
11546
11547
|
}), S = await Promise.all(T);
|
|
11547
11548
|
for (const k of S)
|
|
11548
11549
|
y.id ||= k.id, y = { ...y, ...k.data }, delete y.Collection_Path_String;
|
|
11549
|
-
const
|
|
11550
|
-
if (t?.subcollections &&
|
|
11550
|
+
const _ = [], I = r ? [...r, e] : [d.collection, e];
|
|
11551
|
+
if (t?.subcollections && _.push(ym(y, I, we(t.subcollections), s, we(t?.relations), t?.only)), t?.relations && (t.relations.fields && (t.relations.fields = t.relations.fields.map((k) => {
|
|
11551
11552
|
if (typeof k == "string") {
|
|
11552
11553
|
const m = f.fields.find((R) => R.name === k);
|
|
11553
11554
|
if (m)
|
|
@@ -11555,14 +11556,14 @@ const fw = async (r, e) => {
|
|
|
11555
11556
|
throw new Error(`SCHEMA_ERROR: Field ${k} not found in collection ${n}`);
|
|
11556
11557
|
}
|
|
11557
11558
|
return k;
|
|
11558
|
-
})),
|
|
11559
|
+
})), _.push(gm(y, I, we(t.relations), s, t?.only, t?.noComputedFields, t?.noEmbeddingFields))), await Promise.all(_), !t?.noComputedFields)
|
|
11559
11560
|
for (const k of f.fields)
|
|
11560
11561
|
k.type === "Computed" && (y[k.name] = await k.formula(y));
|
|
11561
11562
|
if (t?.noEmbeddingFields)
|
|
11562
11563
|
for (const k of f.fields)
|
|
11563
11564
|
k.type === "Embedding" && delete y[k.name];
|
|
11564
|
-
return await ae("postOperation", o,
|
|
11565
|
-
}, pw = (r) => r !== null && typeof r == "object",
|
|
11565
|
+
return await ae("postOperation", o, O, ["read", y, e, b]), await ae("postRead", o, O, [b, w, y, !1]), y;
|
|
11566
|
+
}, pw = (r) => r !== null && typeof r == "object", vm = (r) => {
|
|
11566
11567
|
const e = (t) => {
|
|
11567
11568
|
Object.entries(t).forEach(([n, s]) => {
|
|
11568
11569
|
s instanceof Bt ? t[n] = {
|
|
@@ -11574,7 +11575,7 @@ const fw = async (r, e) => {
|
|
|
11574
11575
|
e(r);
|
|
11575
11576
|
}, yw = async (r, e, t, n) => {
|
|
11576
11577
|
const s = it(), i = ze(), a = Ue(s, i.STOKER_FB_FUNCTIONS_REGION), o = Je(a, "stoker-writeapi", { timeout: 540 * 1e3 });
|
|
11577
|
-
return
|
|
11578
|
+
return vm(t), cc(t), (await o({
|
|
11578
11579
|
operation: "update",
|
|
11579
11580
|
path: r,
|
|
11580
11581
|
id: e,
|
|
@@ -11585,29 +11586,29 @@ const fw = async (r, e) => {
|
|
|
11585
11586
|
const a = Mt(), o = Ve(), c = Ve(!0), l = yc(), u = Ie(), f = dr(), d = We(), h = De();
|
|
11586
11587
|
if (r.length === 0)
|
|
11587
11588
|
throw new Error("EMPTY_PATH");
|
|
11588
|
-
const p = r.at(-1),
|
|
11589
|
-
if (!
|
|
11589
|
+
const p = r.at(-1), O = Object.keys(o.collections).includes(p), g = u.disabledCollections?.includes(p);
|
|
11590
|
+
if (!O || g)
|
|
11590
11591
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11591
|
-
const w = o.collections[p], { labels: b, access: A, fields: F, enableWriteLog: y } = w, { serverWriteOnly: T } = A, S =
|
|
11592
|
-
if (!
|
|
11592
|
+
const w = o.collections[p], { labels: b, access: A, fields: F, enableWriteLog: y } = w, { serverWriteOnly: T } = A, S = ft(b.collection), _ = await ne(u, ["global", "appName"]), I = s?.retry, v = f.currentUser;
|
|
11593
|
+
if (!v)
|
|
11593
11594
|
throw new Error("NOT_AUTHENTICATED");
|
|
11594
11595
|
if (!h)
|
|
11595
11596
|
throw new Error("PERMISSION_DENIED");
|
|
11596
11597
|
if (bm(e))
|
|
11597
11598
|
throw new Error("RECORD_BUSY");
|
|
11598
|
-
i = I?.originalRecord || i || await
|
|
11599
|
+
i = I?.originalRecord || i || await _r(r, e, { noComputedFields: !0, noEmbeddingFields: !0 });
|
|
11599
11600
|
for (const P of c.collections[p].fields)
|
|
11600
11601
|
P.type === "Computed" && (delete t[P.name], delete i[P.name]);
|
|
11601
|
-
const C = Ao(d), k = { collection: b.collection }, m = w.auth && n?.operation === "create", R = w.auth && n?.operation === "delete",
|
|
11602
|
+
const C = Ao(d), k = { collection: b.collection }, m = w.auth && n?.operation === "create", R = w.auth && n?.operation === "delete", E = w.auth && !m && !R && (n?.operation === "update" || t.Role || t.Enabled !== void 0 || t.Name || t.Email || t.Photo_URL), D = await ne(S, [
|
|
11602
11603
|
"collections",
|
|
11603
11604
|
b.collection,
|
|
11604
11605
|
"custom",
|
|
11605
11606
|
"disableOfflineUpdate"
|
|
11606
11607
|
]), M = () => {
|
|
11607
|
-
if (zt() === "Offline" && (D || T || w.auth && (m ||
|
|
11608
|
+
if (zt() === "Offline" && (D || T || w.auth && (m || E || R)))
|
|
11608
11609
|
throw new Error("CLIENT_OFFLINE");
|
|
11609
11610
|
};
|
|
11610
|
-
if (M(), T || m ||
|
|
11611
|
+
if (M(), T || m || E || R) {
|
|
11611
11612
|
if (m) {
|
|
11612
11613
|
if (!n.password)
|
|
11613
11614
|
throw new Error("VALIDATION_ERROR: Password is required");
|
|
@@ -11618,7 +11619,7 @@ const fw = async (r, e) => {
|
|
|
11618
11619
|
if (!await ne(u, ["global", "firebase", "enableEmulators"])) {
|
|
11619
11620
|
M();
|
|
11620
11621
|
try {
|
|
11621
|
-
const { isValid: Me } = await
|
|
11622
|
+
const { isValid: Me } = await vd(f, n.password);
|
|
11622
11623
|
if (!Me)
|
|
11623
11624
|
throw new Error("Please create a stronger password");
|
|
11624
11625
|
} catch (Me) {
|
|
@@ -11636,10 +11637,10 @@ const fw = async (r, e) => {
|
|
|
11636
11637
|
return await ae("preValidate", u, S, P), await yw(r, e, t, n ? { operation: n.operation, permissions: n.permissions, password: n.password } : void 0);
|
|
11637
11638
|
}
|
|
11638
11639
|
delete t.id;
|
|
11639
|
-
const N = Ko("update", r, t, o,
|
|
11640
|
+
const N = Ko("update", r, t, o, _, zt(), v.uid, Bt.now(), Lr(), !!I);
|
|
11640
11641
|
for (const P of F)
|
|
11641
|
-
!
|
|
11642
|
-
if (Nt(N), Nt(i), !I && y && Ye("update", "started", N, r, e, w,
|
|
11642
|
+
!ve(P) && ir(N[P.name]) && P.nullable && (N[P.name] = null);
|
|
11643
|
+
if (Nt(N), Nt(i), !I && y && Ye("update", "started", N, r, e, w, v.uid, void 0, i), !I) {
|
|
11643
11644
|
const P = [
|
|
11644
11645
|
"update",
|
|
11645
11646
|
N,
|
|
@@ -11659,17 +11660,17 @@ const fw = async (r, e) => {
|
|
|
11659
11660
|
} catch (P) {
|
|
11660
11661
|
throw new Error(`VALIDATION_ERROR: ${P.message}`);
|
|
11661
11662
|
}
|
|
11662
|
-
if (Oy(N, i, e, w, o,
|
|
11663
|
+
if (Oy(N, i, e, w, o, v.uid, h), Nt(N), ac("update", C, r, e, N, o, w, s, l, Io, ko, Cn, (P) => ke(d, "tenants", a, "system_fields", b.collection, `${b.collection}-${P.name}`, e), (P, oe) => ke(d, "tenants", a, "system_unique", b.collection, `Unique-${b.collection}-${P.name}`, oe), (P) => ke(d, "tenants", a, "system_fields", b.collection, `${b.collection}-${P}`, e)), C.update(ke(d, "tenants", a, r.join("/"), e), N), !I && y && Ye("update", "written", N, r, e, w, v.uid, void 0, i), await dc("update", r, e, N, k, w, S, C, v.uid, y || !1, h, !!I, i), I?.type === "unique") {
|
|
11663
11664
|
const P = { ...i, ...N };
|
|
11664
11665
|
return tr(P), { id: e, ...P };
|
|
11665
11666
|
}
|
|
11666
|
-
y && Ye("update", "success", N, r, e, w,
|
|
11667
|
+
y && Ye("update", "success", N, r, e, w, v.uid, void 0, i);
|
|
11667
11668
|
const L = ["update", N, e, k, !!I, we(i)], z = [...L];
|
|
11668
11669
|
await ae("postWrite", u, S, L), await ae("postOperation", u, S, z);
|
|
11669
11670
|
const X = { ...i, ...N };
|
|
11670
11671
|
return tr(X), { id: e, ...X };
|
|
11671
11672
|
}, dc = async (r, e, t, n, s, i, a, o, c, l, u, f, d) => {
|
|
11672
|
-
const h = Ve(), p = Ie(), { labels:
|
|
11673
|
+
const h = Ve(), p = Ie(), { labels: O } = i;
|
|
11673
11674
|
let g = 0;
|
|
11674
11675
|
const w = async () => {
|
|
11675
11676
|
try {
|
|
@@ -11679,36 +11680,36 @@ const fw = async (r, e) => {
|
|
|
11679
11680
|
let A;
|
|
11680
11681
|
const F = await ne(a, [
|
|
11681
11682
|
"collections",
|
|
11682
|
-
|
|
11683
|
+
O.collection,
|
|
11683
11684
|
"custom",
|
|
11684
11685
|
"autoCorrectUnique"
|
|
11685
11686
|
]);
|
|
11686
|
-
if (b.code === "unavailable" && await
|
|
11687
|
+
if (b.code === "unavailable" && await _e(p.onIndexedDBConnectionLost), r !== "delete" && b.code === "permission-denied")
|
|
11687
11688
|
try {
|
|
11688
11689
|
await lc(r, t, n, i, u);
|
|
11689
11690
|
} catch (I) {
|
|
11690
|
-
const
|
|
11691
|
+
const v = I.message.split(", "), C = [], k = [];
|
|
11691
11692
|
let m = !1;
|
|
11692
|
-
for (const R of
|
|
11693
|
-
const
|
|
11693
|
+
for (const R of v) {
|
|
11694
|
+
const E = R.split(" ")[0], D = h.collections[O.collection].fields.find((M) => M.name === E);
|
|
11694
11695
|
if (!D)
|
|
11695
|
-
throw new Error(`SCHEMA_ERROR: Field ${
|
|
11696
|
+
throw new Error(`SCHEMA_ERROR: Field ${E} not found in ${O.collection} schema`);
|
|
11696
11697
|
D.type === "Number" && C.push(R), D.type === "String" && k.push(R);
|
|
11697
11698
|
}
|
|
11698
|
-
if ((!F || C.length > 0) && (A = new Error(`VALIDATION_ERROR: ${
|
|
11699
|
+
if ((!F || C.length > 0) && (A = new Error(`VALIDATION_ERROR: ${v.join(", ")}`)), F && k.length > 0) {
|
|
11699
11700
|
for (const R of k) {
|
|
11700
|
-
const
|
|
11701
|
-
if (h.collections[
|
|
11701
|
+
const E = R.split(" ")[0];
|
|
11702
|
+
if (h.collections[O.collection].fields.find((N) => N.name === E).type === "Number")
|
|
11702
11703
|
continue;
|
|
11703
11704
|
let M = 1;
|
|
11704
|
-
n[
|
|
11705
|
+
n[E].match(/ - DUPLICATE-\d+/) ? (M = parseInt(
|
|
11705
11706
|
// eslint-disable-next-line security/detect-object-injection
|
|
11706
|
-
n[
|
|
11707
|
-
), n[
|
|
11708
|
-
n[
|
|
11707
|
+
n[E].match(/ - DUPLICATE-\d+/)[0].split("-")[2]
|
|
11708
|
+
), n[E] = // eslint-disable-next-line security/detect-object-injection
|
|
11709
|
+
n[E].replace(/ - DUPLICATE-\d+/g, "") + ` - DUPLICATE-${M + 1}`) : n[E] = n[E] + " - DUPLICATE-1", M < 10 ? m = !0 : A = new Error(v.map((N) => N.replace(/ - DUPLICATE-\d+/g, "")).join(", "));
|
|
11709
11710
|
}
|
|
11710
11711
|
if (m) {
|
|
11711
|
-
r === "create" && await
|
|
11712
|
+
r === "create" && await _m(e, n, void 0, { retry: { type: "unique", docId: t } }), r === "update" && await fc(e, t, n, void 0, {
|
|
11712
11713
|
retry: {
|
|
11713
11714
|
type: "unique",
|
|
11714
11715
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -11729,10 +11730,10 @@ const fw = async (r, e) => {
|
|
|
11729
11730
|
f,
|
|
11730
11731
|
g,
|
|
11731
11732
|
r === "update" ? d : void 0
|
|
11732
|
-
], S = b.code === "unavailable",
|
|
11733
|
-
if (
|
|
11733
|
+
], S = b.code === "unavailable", _ = await ae("postWriteError", p, a, T);
|
|
11734
|
+
if (_?.resolved)
|
|
11734
11735
|
return;
|
|
11735
|
-
if (!S &&
|
|
11736
|
+
if (!S && _?.retry) {
|
|
11736
11737
|
g++, await w();
|
|
11737
11738
|
return;
|
|
11738
11739
|
} else
|
|
@@ -11754,36 +11755,36 @@ const fw = async (r, e) => {
|
|
|
11754
11755
|
await w();
|
|
11755
11756
|
}, gw = async (r, e, t, n) => {
|
|
11756
11757
|
const s = it(), i = ze(), a = Ue(s, i.STOKER_FB_FUNCTIONS_REGION), o = Je(a, "stoker-writeapi", { timeout: 540 * 1e3 });
|
|
11757
|
-
return
|
|
11758
|
+
return vm(e), (await o({
|
|
11758
11759
|
operation: "create",
|
|
11759
11760
|
path: r,
|
|
11760
11761
|
record: e,
|
|
11761
11762
|
user: t,
|
|
11762
11763
|
id: n
|
|
11763
11764
|
})).data?.result;
|
|
11764
|
-
},
|
|
11765
|
+
}, _m = async (r, e, t, n, s, i) => {
|
|
11765
11766
|
const a = Mt(), o = Ve(), c = yc(), l = Ie(), u = dr(), f = We(), d = De();
|
|
11766
11767
|
if (r.length === 0)
|
|
11767
11768
|
throw new Error("EMPTY_PATH");
|
|
11768
|
-
const h = r.at(-1), p = Object.keys(o.collections).includes(h),
|
|
11769
|
-
if (!p ||
|
|
11769
|
+
const h = r.at(-1), p = Object.keys(o.collections).includes(h), O = l.disabledCollections?.includes(h);
|
|
11770
|
+
if (!p || O)
|
|
11770
11771
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11771
|
-
const g = o.collections[h], { labels: w, access: b, enableWriteLog: A, softDelete: F } = g, { serverWriteOnly: y } = b, T =
|
|
11772
|
+
const g = o.collections[h], { labels: w, access: b, enableWriteLog: A, softDelete: F } = g, { serverWriteOnly: y } = b, T = ft(w.collection), S = await ne(l, ["global", "appName"]), _ = n?.retry, I = u.currentUser;
|
|
11772
11773
|
if (!I)
|
|
11773
11774
|
throw new Error("NOT_AUTHENTICATED");
|
|
11774
11775
|
if (!d)
|
|
11775
11776
|
throw new Error("PERMISSION_DENIED");
|
|
11776
|
-
const
|
|
11777
|
+
const v = await ne(T, [
|
|
11777
11778
|
"collections",
|
|
11778
11779
|
w.collection,
|
|
11779
11780
|
"custom",
|
|
11780
11781
|
"disableOfflineCreate"
|
|
11781
11782
|
]), C = () => {
|
|
11782
|
-
if (zt() === "Offline" && (
|
|
11783
|
+
if (zt() === "Offline" && (v || y || g.auth && t))
|
|
11783
11784
|
throw new Error("CLIENT_OFFLINE");
|
|
11784
11785
|
};
|
|
11785
11786
|
C();
|
|
11786
|
-
const k = Ao(f), m =
|
|
11787
|
+
const k = Ao(f), m = _?.docId || s || ke(qr(f, "tenants", a, w.collection)).id, R = { collection: w.collection };
|
|
11787
11788
|
if (y || g.auth && t) {
|
|
11788
11789
|
if (C(), g.auth && t) {
|
|
11789
11790
|
if (!t.password)
|
|
@@ -11795,7 +11796,7 @@ const fw = async (r, e) => {
|
|
|
11795
11796
|
if (!await ne(l, ["global", "firebase", "enableEmulators"])) {
|
|
11796
11797
|
C();
|
|
11797
11798
|
try {
|
|
11798
|
-
const { isValid: le } = await
|
|
11799
|
+
const { isValid: le } = await vd(u, t.password);
|
|
11799
11800
|
if (!le)
|
|
11800
11801
|
throw new Error("Please create a stronger password");
|
|
11801
11802
|
} catch (le) {
|
|
@@ -11806,33 +11807,33 @@ const fw = async (r, e) => {
|
|
|
11806
11807
|
return await ae("preValidate", l, T, ["create", e, R, k]), i && i(), await gw(r, e, t ? { permissions: t.permissions, password: t.password } : void 0, m);
|
|
11807
11808
|
}
|
|
11808
11809
|
e.id = m;
|
|
11809
|
-
const
|
|
11810
|
-
if (F && (
|
|
11810
|
+
const E = Ko("create", r, e, o, S, zt(), I.uid, Bt.now(), Lr(), !!_);
|
|
11811
|
+
if (F && (E[F.archivedField] = !1), Nt(E), !_ && A && Ye("create", "started", E, r, m, g, I.uid), _ || (await ae("preOperation", l, T, ["create", E, m, R, k]), await ae("preWrite", l, T, ["create", E, m, R, k])), Xd(g, E, o), eh(g, E), _ || await hg(E, g, T, d.Role), !_)
|
|
11811
11812
|
try {
|
|
11812
|
-
await om("create",
|
|
11813
|
+
await om("create", E, g, T, ["create", E, R, k], o), v && (C(), await lc("create", m, E, g, d));
|
|
11813
11814
|
} catch (L) {
|
|
11814
11815
|
throw new Error(`VALIDATION_ERROR: ${L.message}`);
|
|
11815
11816
|
}
|
|
11816
|
-
if (i && i(), Nt(
|
|
11817
|
-
return { id: m, ...
|
|
11818
|
-
A && Ye("create", "success",
|
|
11819
|
-
const D = ["create",
|
|
11820
|
-
return await ae("postWrite", l, T, D), await ae("postOperation", l, T, M), { id: m, ...
|
|
11821
|
-
},
|
|
11817
|
+
if (i && i(), Nt(E), by(E, m, g, o, I.uid, d), ac("create", k, r, m, E, o, g, n, c, Io, ko, Cn, (L) => ke(f, "tenants", a, "system_fields", w.collection, `${w.collection}-${L.name}`, m), (L, z) => ke(f, "tenants", a, "system_unique", w.collection, `Unique-${w.collection}-${L.name}`, z), (L) => ke(f, "tenants", a, "system_fields", w.collection, `${w.collection}-${L}`, m)), k.set(ke(f, "tenants", a, r.join("/"), m), E), !_ && A && Ye("create", "written", E, r, m, g, I.uid), await dc("create", r, m, E, R, g, T, k, I.uid, A || !1, d, !!_), _?.type === "unique")
|
|
11818
|
+
return { id: m, ...E };
|
|
11819
|
+
A && Ye("create", "success", E, r, m, g, I.uid);
|
|
11820
|
+
const D = ["create", E, m, R, !!_], M = [...D];
|
|
11821
|
+
return await ae("postWrite", l, T, D), await ae("postOperation", l, T, M), { id: m, ...E };
|
|
11822
|
+
}, vw = async (r, e) => {
|
|
11822
11823
|
const t = it(), n = ze(), s = Ue(t, n.STOKER_FB_FUNCTIONS_REGION);
|
|
11823
11824
|
return (await Je(s, "stoker-writeapi", { timeout: 540 * 1e3 })({
|
|
11824
11825
|
operation: "delete",
|
|
11825
11826
|
path: r,
|
|
11826
11827
|
id: e
|
|
11827
11828
|
})).data?.result;
|
|
11828
|
-
},
|
|
11829
|
+
}, _w = async (r, e, t) => {
|
|
11829
11830
|
const n = Mt(), s = Ve(), i = yc(), a = dr(), o = We(), c = Ie(), l = De();
|
|
11830
11831
|
if (r.length === 0)
|
|
11831
11832
|
throw new Error("EMPTY_PATH");
|
|
11832
11833
|
const u = r.at(-1), f = Object.keys(s.collections).includes(u), d = c.disabledCollections?.includes(u);
|
|
11833
11834
|
if (!f || d)
|
|
11834
11835
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11835
|
-
const h = s.collections[u], { labels: p, access:
|
|
11836
|
+
const h = s.collections[u], { labels: p, access: O, enableWriteLog: g, softDelete: w } = h, { serverWriteOnly: b } = O, A = ft(p.collection), F = await ne(c, ["global", "appName"]), y = t?.retry, T = a.currentUser;
|
|
11836
11837
|
if (!T)
|
|
11837
11838
|
throw new Error("NOT_AUTHENTICATED");
|
|
11838
11839
|
if (!l)
|
|
@@ -11855,17 +11856,17 @@ const fw = async (r, e) => {
|
|
|
11855
11856
|
throw new Error("RECORD_BUSY");
|
|
11856
11857
|
let I;
|
|
11857
11858
|
try {
|
|
11858
|
-
I = await
|
|
11859
|
+
I = await _r(r, e);
|
|
11859
11860
|
} catch (M) {
|
|
11860
11861
|
throw g && y?.record && M.message.indexOf("NOT_FOUND") !== -1 && await Ye("delete", "failed", y?.record, r, e, h, T.uid, M), M;
|
|
11861
11862
|
}
|
|
11862
11863
|
if (b || h.auth && I.User_ID)
|
|
11863
|
-
return await
|
|
11864
|
+
return await vw(r, e);
|
|
11864
11865
|
delete I.id;
|
|
11865
|
-
const
|
|
11866
|
-
Nt(k), !y && g && Ye("delete", "started", k, r, e, h, T.uid), y || (await ae("preOperation", c, A, ["delete", k, e, C,
|
|
11867
|
-
const R = ["delete", k, e, C, !!y],
|
|
11868
|
-
return await ae("postWrite", c, A, R), await ae("postOperation", c, A,
|
|
11866
|
+
const v = Ao(o), C = { collection: p.collection }, k = Ko("delete", r, I, s, F, zt(), T.uid, Bt.now(), Lr(), !!y);
|
|
11867
|
+
Nt(k), !y && g && Ye("delete", "started", k, r, e, h, T.uid), y || (await ae("preOperation", c, A, ["delete", k, e, C, v]), await ae("preWrite", c, A, ["delete", k, e, C, v])), Nt(k), Ey(k, e, h, s, T.uid, l), ac("delete", v, r, e, k, s, h, t, i, Io, ko, Cn, (M) => ke(o, "tenants", n, "system_fields", p.collection, `${p.collection}-${M.name}`, e), (M, N) => ke(o, "tenants", n, "system_unique", p.collection, `Unique-${p.collection}-${M.name}`, N), (M) => ke(o, "tenants", n, "system_fields", p.collection, `${p.collection}-${M}`, e)), v.delete(ke(o, "tenants", n, r.join("/"), e)), !y && g && Ye("delete", "written", k, r, e, h, T.uid), await dc("delete", r, e, k, C, h, A, v, T.uid, g || !1, l, !!y), g && Ye("delete", "success", { ...k, ...y?.record || {} }, r, e, h, T.uid);
|
|
11868
|
+
const R = ["delete", k, e, C, !!y], E = [...R];
|
|
11869
|
+
return await ae("postWrite", c, A, R), await ae("postOperation", c, A, E), { id: e, ...k };
|
|
11869
11870
|
}, wm = (r) => {
|
|
11870
11871
|
if (typeof r == "object")
|
|
11871
11872
|
for (const e in r)
|
|
@@ -11874,7 +11875,7 @@ const fw = async (r, e) => {
|
|
|
11874
11875
|
const t = it(), n = ze(), s = Ue(t, n.STOKER_FB_FUNCTIONS_REGION);
|
|
11875
11876
|
return (await Je(s, r)(e)).data;
|
|
11876
11877
|
};
|
|
11877
|
-
let
|
|
11878
|
+
let yt = {};
|
|
11878
11879
|
const bw = async (r, e) => {
|
|
11879
11880
|
const t = dr(), n = gc(), s = t.currentUser;
|
|
11880
11881
|
if (s?.uid !== e.uid)
|
|
@@ -11884,15 +11885,15 @@ const bw = async (r, e) => {
|
|
|
11884
11885
|
const a = Om();
|
|
11885
11886
|
if (a?.version)
|
|
11886
11887
|
for (const o of i.docs) {
|
|
11887
|
-
|
|
11888
|
+
yt[o.id] ??= 0;
|
|
11888
11889
|
const c = o.data(), { data: l, operation: u, docId: f, collection: d, Collection_Path: h, Last_Write_Version: p } = c;
|
|
11889
11890
|
await new Promise((w) => setTimeout(w, 1e3));
|
|
11890
|
-
const
|
|
11891
|
+
const O = await ww("stoker-writelog", {
|
|
11891
11892
|
path: h,
|
|
11892
11893
|
id: f,
|
|
11893
11894
|
log: o.id
|
|
11894
11895
|
});
|
|
11895
|
-
if (!
|
|
11896
|
+
if (!O || O.status !== "written")
|
|
11896
11897
|
continue;
|
|
11897
11898
|
if (s?.uid !== e.uid)
|
|
11898
11899
|
return;
|
|
@@ -11914,25 +11915,25 @@ const bw = async (r, e) => {
|
|
|
11914
11915
|
}
|
|
11915
11916
|
const g = localStorage.getItem(`stoker-retry-${f}`);
|
|
11916
11917
|
if (g !== "done" && !(g && Date.now() - parseInt(g) < 1e4)) {
|
|
11917
|
-
if (localStorage.setItem(`stoker-retry-${f}`, Date.now().toString()), console.info(`Retrying pending ${u} operation: ${o.ref.path}`), u === "create" && (
|
|
11918
|
+
if (localStorage.setItem(`stoker-retry-${f}`, Date.now().toString()), console.info(`Retrying pending ${u} operation: ${o.ref.path}`), u === "create" && (yt[f]++, await _m(h, l.data, void 0, {
|
|
11918
11919
|
retry: {
|
|
11919
11920
|
type: "offline",
|
|
11920
11921
|
docId: f
|
|
11921
11922
|
}
|
|
11922
11923
|
}).catch((w) => {
|
|
11923
11924
|
console.error(w);
|
|
11924
|
-
}),
|
|
11925
|
+
}), yt[f]--, localStorage.setItem(`stoker-retry-${f}`, "done")), u === "update") {
|
|
11925
11926
|
const w = r.collections[d], { softDelete: b } = w;
|
|
11926
|
-
b && l.data?.[b.archivedField] && l.data?.[b.archivedField] !== l.originalRecord?.[b.archivedField] && (l.data[b.timestampField] = Lr()), l.data && wm(l.data),
|
|
11927
|
+
b && l.data?.[b.archivedField] && l.data?.[b.archivedField] !== l.originalRecord?.[b.archivedField] && (l.data[b.timestampField] = Lr()), l.data && wm(l.data), yt[f]++, await fc(h, f, l.data, void 0, {
|
|
11927
11928
|
retry: {
|
|
11928
11929
|
type: "offline",
|
|
11929
11930
|
originalRecord: l.originalRecord
|
|
11930
11931
|
}
|
|
11931
11932
|
}).catch((A) => {
|
|
11932
11933
|
console.error(A);
|
|
11933
|
-
}),
|
|
11934
|
+
}), yt[f]--, localStorage.setItem(`stoker-retry-${f}`, "done");
|
|
11934
11935
|
}
|
|
11935
|
-
u === "delete" && (
|
|
11936
|
+
u === "delete" && (yt[f]++, await _w(h, f, {
|
|
11936
11937
|
retry: {
|
|
11937
11938
|
type: "offline",
|
|
11938
11939
|
record: {
|
|
@@ -11945,17 +11946,17 @@ const bw = async (r, e) => {
|
|
|
11945
11946
|
}
|
|
11946
11947
|
}).catch((w) => {
|
|
11947
11948
|
console.error(w);
|
|
11948
|
-
}),
|
|
11949
|
+
}), yt[f]--, localStorage.setItem(`stoker-retry-${f}`, "done"));
|
|
11949
11950
|
}
|
|
11950
11951
|
}
|
|
11951
|
-
}, bm = (r) => !!
|
|
11952
|
-
|
|
11952
|
+
}, bm = (r) => !!yt[r], Ow = () => {
|
|
11953
|
+
yt = {};
|
|
11953
11954
|
};
|
|
11954
11955
|
let fn, Ka = 0;
|
|
11955
11956
|
const Ew = async () => {
|
|
11956
11957
|
const r = Am(), e = Ie();
|
|
11957
11958
|
return hr(ke(r, "system_deployment", "latest_deploy"), (n) => {
|
|
11958
|
-
n.exists() ? (fn = n.data(), Ka++, Ka > 1 && (fn.refresh ? window.location.reload() :
|
|
11959
|
+
n.exists() ? (fn = n.data(), Ka++, Ka > 1 && (fn.refresh ? window.location.reload() : _e(e.onVersionUpdate, [fn, Ka]))) : console.error("Version info not found");
|
|
11959
11960
|
}, (n) => {
|
|
11960
11961
|
console.error("Error getting version info", { cause: n.message });
|
|
11961
11962
|
});
|
|
@@ -11964,7 +11965,7 @@ let Ro;
|
|
|
11964
11965
|
const Sw = async () => {
|
|
11965
11966
|
const r = Ie(), e = Am();
|
|
11966
11967
|
hr(ke(e, "system_deployment", "maintenance_mode"), (t) => {
|
|
11967
|
-
t.exists() ? (Ro = t.data(),
|
|
11968
|
+
t.exists() ? (Ro = t.data(), _e(r.onMaintenanceUpdate, [Ro.active ? "on" : "off"])) : console.error("Maintenance status not found");
|
|
11968
11969
|
}, (t) => {
|
|
11969
11970
|
console.error("Error getting maintenance status", { cause: t.message });
|
|
11970
11971
|
});
|
|
@@ -11974,24 +11975,24 @@ const Rw = () => {
|
|
|
11974
11975
|
const r = wd(), e = Ie();
|
|
11975
11976
|
let t = !1;
|
|
11976
11977
|
return zm(Bm(r, ".info/connected"), (s) => {
|
|
11977
|
-
s.val() === !0 ? (Er && (clearTimeout(Er), Er = null), Nr = "Online",
|
|
11978
|
-
Nr = "Offline",
|
|
11978
|
+
s.val() === !0 ? (Er && (clearTimeout(Er), Er = null), Nr = "Online", _e(e.onConnectionStatusChange, [Nr, !t]), t || (t = !0)) : !Er && t && (Er = setTimeout(() => {
|
|
11979
|
+
Nr = "Offline", _e(e.onConnectionStatusChange, [Nr]);
|
|
11979
11980
|
}, 5e3));
|
|
11980
11981
|
});
|
|
11981
11982
|
}, zt = () => Nr, Cw = () => navigator.onLine ? "Online" : "Offline", Em = async () => {
|
|
11982
11983
|
const r = Ie(), e = dr(), t = e.currentUser;
|
|
11983
|
-
if (r.preLogout && await
|
|
11984
|
+
if (r.preLogout && await _e(r.preLogout, [t]) === !1)
|
|
11984
11985
|
throw new Error("Operation cancelled by preLogout");
|
|
11985
11986
|
try {
|
|
11986
11987
|
e.signOut();
|
|
11987
11988
|
} catch (n) {
|
|
11988
11989
|
console.error(n);
|
|
11989
11990
|
const s = { error: !0, instances: [{ instance: "[DEFAULT]", code: "SIGN_OUT", error: n }] };
|
|
11990
|
-
await
|
|
11991
|
+
await _e(r.postLogout, [s]);
|
|
11991
11992
|
}
|
|
11992
11993
|
}, Aw = (r) => {
|
|
11993
11994
|
const e = (s) => {
|
|
11994
|
-
typeof s == "string" && s.includes("Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.") && (console.warn("Slow Firestore Connection Detected"),
|
|
11995
|
+
typeof s == "string" && s.includes("Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.") && (console.warn("Slow Firestore Connection Detected"), _e(r.onFirestoreSlowConnection)), typeof s == "string" && s.includes("Using maximum backoff delay to prevent overloading the backend.") && (console.warn("Firestore Load Failure Detected"), _e(r.onFirestoreLoadFailure)), typeof s == "string" && s.includes("The user's credential is no longer valid. The user must sign in again.") && (console.warn("User Credential Expired"), Em()), typeof s == "string" && s.includes("Connection to Indexed Database server lost. Refresh the page to try again") && (console.warn("Indexed Database Connection Lost"), _e(r.onIndexedDBConnectionLost));
|
|
11995
11996
|
}, t = console.error.bind(console);
|
|
11996
11997
|
let n = !1;
|
|
11997
11998
|
console.error = (...s) => {
|
|
@@ -12011,10 +12012,10 @@ const Rw = () => {
|
|
|
12011
12012
|
e(i);
|
|
12012
12013
|
});
|
|
12013
12014
|
};
|
|
12014
|
-
let
|
|
12015
|
+
let mt, hc, Tt, Sm, pe, Tm, Pr, mc, pc, $e, Rm, Rn = [], be;
|
|
12015
12016
|
const Ya = {
|
|
12016
12017
|
firestoreWriteApp: {}
|
|
12017
|
-
},
|
|
12018
|
+
}, pt = {
|
|
12018
12019
|
main: {},
|
|
12019
12020
|
firestoreWrite: {}
|
|
12020
12021
|
}, Ge = {
|
|
@@ -12043,7 +12044,7 @@ const Ya = {
|
|
|
12043
12044
|
for (const t of Object.values(e.collections))
|
|
12044
12045
|
for (const n of t.fields)
|
|
12045
12046
|
if (n.type === "Computed") {
|
|
12046
|
-
const s = Ty(n,
|
|
12047
|
+
const s = Ty(n, ft(t.labels.collection));
|
|
12047
12048
|
s.formula && (n.formula = s.formula);
|
|
12048
12049
|
}
|
|
12049
12050
|
} else
|
|
@@ -12077,7 +12078,7 @@ const Ya = {
|
|
|
12077
12078
|
return At.firestoreWrite;
|
|
12078
12079
|
},
|
|
12079
12080
|
getFirestoreWriteAuth() {
|
|
12080
|
-
return
|
|
12081
|
+
return pt.firestoreWrite;
|
|
12081
12082
|
},
|
|
12082
12083
|
getFirestoreWrite() {
|
|
12083
12084
|
return Ge.firestoreWrite;
|
|
@@ -12092,36 +12093,36 @@ const Ya = {
|
|
|
12092
12093
|
};
|
|
12093
12094
|
let gd = !1;
|
|
12094
12095
|
const Gw = async (r, e, t, n) => {
|
|
12095
|
-
if (be = t,
|
|
12096
|
+
if (be = t, mt)
|
|
12096
12097
|
return console.error("Stoker is already initialized."), !0;
|
|
12097
12098
|
xm("stoker-client", pp, "web"), Tt = be.MODE, pe = r.default("web", Co, n), Sm = await ne(pe, ["global", "timezone"]), ne(pe, ["global", "roles"]), ne(pe, ["global", "appName"]), ne(pe, ["global", "auth", "enableMultiFactorAuth"]);
|
|
12098
12099
|
const s = JSON.parse(be.STOKER_FB_WEB_APP_CONFIG), i = await ne(pe, ["global", "firebase", "GDPRSettings"]);
|
|
12099
|
-
|
|
12100
|
+
mt = zn(s, {
|
|
12100
12101
|
automaticDataCollectionEnabled: i || !0
|
|
12101
12102
|
});
|
|
12102
|
-
const a = dp(
|
|
12103
|
+
const a = dp(mt);
|
|
12103
12104
|
Tt === "development" && (a.instrumentationEnabled = !1, a.dataCollectionEnabled = !1);
|
|
12104
12105
|
const o = ["firestoreWrite"];
|
|
12105
|
-
for (const
|
|
12106
|
-
Ya[`${
|
|
12106
|
+
for (const v of o)
|
|
12107
|
+
Ya[`${v}App`] = zn(s, v);
|
|
12107
12108
|
const { firestoreWriteApp: c } = Ya, l = zn(s, "maintenance");
|
|
12108
12109
|
Ge.maintenance = We(l);
|
|
12109
12110
|
const u = hp();
|
|
12110
12111
|
if (u.settings.minimumFetchIntervalMillis = 36e5, await mp(u), be.STOKER_FB_ENABLE_APP_CHECK === "true" && be.STOKER_FB_APP_CHECK_KEY) {
|
|
12111
12112
|
(Tt === "development" || window.location.hostname === "localhost") && (globalThis.FIREBASE_APPCHECK_DEBUG_TOKEN = !0);
|
|
12112
|
-
const
|
|
12113
|
+
const v = {
|
|
12113
12114
|
provider: new fp(be.STOKER_FB_APP_CHECK_KEY),
|
|
12114
12115
|
isTokenAutoRefreshEnabled: !0
|
|
12115
12116
|
};
|
|
12116
|
-
At.main = Gn(
|
|
12117
|
+
At.main = Gn(mt, v), At.firestoreWrite = Gn(c, v), At.maintenance = Gn(l, v);
|
|
12117
12118
|
let C = !1;
|
|
12118
12119
|
const k = (m, R) => {
|
|
12119
12120
|
if (console.log(`App Check token error detected for ${R}`), !C)
|
|
12120
12121
|
if (C = !0, pe.onAppCheckTokenFailure)
|
|
12121
|
-
|
|
12122
|
+
_e(pe.onAppCheckTokenFailure, [m]);
|
|
12122
12123
|
else {
|
|
12123
|
-
const
|
|
12124
|
-
!
|
|
12124
|
+
const E = sessionStorage.getItem("stoker-app-check-reload");
|
|
12125
|
+
!E || new Date(E).getTime() < Date.now() - 3e5 ? (sessionStorage.setItem("stoker-app-check-reload", (/* @__PURE__ */ new Date()).toISOString()), window.location.reload()) : alert("For security reasons, please close this tab and wait a while before restarting it.");
|
|
12125
12126
|
}
|
|
12126
12127
|
};
|
|
12127
12128
|
Hn(At.main, () => {
|
|
@@ -12145,7 +12146,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12145
12146
|
"global",
|
|
12146
12147
|
"firebase",
|
|
12147
12148
|
"enableEmulators"
|
|
12148
|
-
]),
|
|
12149
|
+
]), O = await ne(pe, ["global", "enableUserIDLogging"]), g = await ne(pe, [
|
|
12149
12150
|
"global",
|
|
12150
12151
|
"firebase",
|
|
12151
12152
|
"logLevel",
|
|
@@ -12155,10 +12156,10 @@ const Gw = async (r, e, t, n) => {
|
|
|
12155
12156
|
"firebase",
|
|
12156
12157
|
"logLevel",
|
|
12157
12158
|
"prod"
|
|
12158
|
-
]), b = await Fm().catch((
|
|
12159
|
-
throw new Error("Error checking analytics support.", { cause:
|
|
12159
|
+
]), b = await Fm().catch((v) => {
|
|
12160
|
+
throw new Error("Error checking analytics support.", { cause: v });
|
|
12160
12161
|
});
|
|
12161
|
-
Tt === "production" && f && b && Dm(
|
|
12162
|
+
Tt === "production" && f && b && Dm(mt, d || {}), h && Mm(h);
|
|
12162
12163
|
const A = await ne(pe, [
|
|
12163
12164
|
"global",
|
|
12164
12165
|
"auth",
|
|
@@ -12167,12 +12168,12 @@ const Gw = async (r, e, t, n) => {
|
|
|
12167
12168
|
popupRedirectResolver: void 0,
|
|
12168
12169
|
persistence: A === "LOCAL" ? [Pm, qm, Ec] : A === "SESSION" ? [Ec, Sc] : [Sc]
|
|
12169
12170
|
};
|
|
12170
|
-
|
|
12171
|
-
for (const
|
|
12172
|
-
|
|
12173
|
-
const { main: T } =
|
|
12174
|
-
Lm(T, async (
|
|
12175
|
-
if (
|
|
12171
|
+
pt.main = Oc(mt, y);
|
|
12172
|
+
for (const v of o)
|
|
12173
|
+
pt[v] = Oc(Ya[`${v}App`], y);
|
|
12174
|
+
const { main: T } = pt;
|
|
12175
|
+
Lm(T, async (v) => {
|
|
12176
|
+
if (v && await _e(pe.preLogin, [v]) === !1)
|
|
12176
12177
|
throw new Error("Operation cancelled by preLogin");
|
|
12177
12178
|
});
|
|
12178
12179
|
const S = await ne(pe, [
|
|
@@ -12182,29 +12183,29 @@ const Gw = async (r, e, t, n) => {
|
|
|
12182
12183
|
]);
|
|
12183
12184
|
if (Tt === "development" && p) {
|
|
12184
12185
|
if (!S?.includes("Auth")) {
|
|
12185
|
-
const
|
|
12186
|
-
for (const C of Object.values(
|
|
12187
|
-
$m(C, `http://localhost:${
|
|
12186
|
+
const v = be.STOKER_FB_EMULATOR_AUTH_PORT ? parseInt(be.STOKER_FB_EMULATOR_AUTH_PORT) : 9099;
|
|
12187
|
+
for (const C of Object.values(pt))
|
|
12188
|
+
$m(C, `http://localhost:${v}`);
|
|
12188
12189
|
}
|
|
12189
12190
|
if (!S?.includes("Database")) {
|
|
12190
|
-
const
|
|
12191
|
-
Zm(wd(), "localhost",
|
|
12191
|
+
const v = be.STOKER_FB_EMULATOR_DATABASE_PORT ? parseInt(be.STOKER_FB_EMULATOR_DATABASE_PORT) : 9e3;
|
|
12192
|
+
Zm(wd(), "localhost", v);
|
|
12192
12193
|
}
|
|
12193
12194
|
if (!S?.includes("Firestore")) {
|
|
12194
|
-
const
|
|
12195
|
-
Cc(Ge.maintenance, "localhost",
|
|
12195
|
+
const v = be.STOKER_FB_EMULATOR_FIRESTORE_PORT ? parseInt(be.STOKER_FB_EMULATOR_FIRESTORE_PORT) : 8080;
|
|
12196
|
+
Cc(Ge.maintenance, "localhost", v);
|
|
12196
12197
|
}
|
|
12197
12198
|
if (!S?.includes("Storage")) {
|
|
12198
|
-
const
|
|
12199
|
-
cp(lp(), "localhost",
|
|
12199
|
+
const v = be.STOKER_FB_EMULATOR_STORAGE_PORT ? parseInt(be.STOKER_FB_EMULATOR_STORAGE_PORT) : 9199;
|
|
12200
|
+
cp(lp(), "localhost", v);
|
|
12200
12201
|
}
|
|
12201
12202
|
if (!S?.includes("Functions")) {
|
|
12202
|
-
const
|
|
12203
|
-
up(Ue(
|
|
12203
|
+
const v = be.STOKER_FB_EMULATOR_FUNCTIONS_PORT ? parseInt(be.STOKER_FB_EMULATOR_FUNCTIONS_PORT) : 5001;
|
|
12204
|
+
up(Ue(mt, be.STOKER_FB_FUNCTIONS_REGION), "localhost", v);
|
|
12204
12205
|
}
|
|
12205
12206
|
}
|
|
12206
|
-
if (Ew(), Sw(), Rw(), Tt === "development" && (g ? Qr(g) : Qr("debug")), Tt === "production" && (w ? Qr(w) : Qr("error")),
|
|
12207
|
-
const
|
|
12207
|
+
if (Ew(), Sw(), Rw(), Tt === "development" && (g ? Qr(g) : Qr("debug")), Tt === "production" && (w ? Qr(w) : Qr("error")), O) {
|
|
12208
|
+
const v = Bn(T, async (C) => {
|
|
12208
12209
|
if (C) {
|
|
12209
12210
|
const k = JSON.parse(be.STOKER_FB_WEB_APP_CONFIG);
|
|
12210
12211
|
Nm(() => {
|
|
@@ -12212,18 +12213,18 @@ const Gw = async (r, e, t, n) => {
|
|
|
12212
12213
|
});
|
|
12213
12214
|
}
|
|
12214
12215
|
});
|
|
12215
|
-
Rn.push(
|
|
12216
|
+
Rn.push(v);
|
|
12216
12217
|
}
|
|
12217
|
-
await Promise.all(Object.values(
|
|
12218
|
-
throw new Error(`Error waiting for auth state in ${
|
|
12218
|
+
await Promise.all(Object.values(pt).map((v) => v.authStateReady().catch((C) => {
|
|
12219
|
+
throw new Error(`Error waiting for auth state in ${v.app.name}.`, { cause: C });
|
|
12219
12220
|
})));
|
|
12220
|
-
let
|
|
12221
|
-
for (const
|
|
12222
|
-
|
|
12221
|
+
let _ = !1;
|
|
12222
|
+
for (const v of Object.values(pt))
|
|
12223
|
+
v.currentUser || (_ = !0);
|
|
12223
12224
|
let I;
|
|
12224
|
-
return Bn(T, async (
|
|
12225
|
-
if (
|
|
12226
|
-
$e =
|
|
12225
|
+
return Bn(T, async (v) => {
|
|
12226
|
+
if (v) {
|
|
12227
|
+
$e = v;
|
|
12227
12228
|
const C = await jm($e), { claims: k } = C;
|
|
12228
12229
|
hc = k.tenant, Rm = {
|
|
12229
12230
|
...$e,
|
|
@@ -12232,14 +12233,14 @@ const Gw = async (r, e, t, n) => {
|
|
|
12232
12233
|
}
|
|
12233
12234
|
};
|
|
12234
12235
|
const m = [];
|
|
12235
|
-
for (const Se of Object.values(
|
|
12236
|
+
for (const Se of Object.values(pt))
|
|
12236
12237
|
m.push(new Promise((Le) => {
|
|
12237
12238
|
const Ot = Bn(Se, async (G) => {
|
|
12238
12239
|
G && (Ot(), Le({}));
|
|
12239
12240
|
});
|
|
12240
12241
|
}));
|
|
12241
12242
|
await Promise.all(m), gd || (Aw(pe), gd = !0), I = await ne(pe, ["global", "auth", "offlinePersistenceType"], [$e, k]);
|
|
12242
|
-
const R = await ne(pe, ["global", "auth", "tabManager"], [$e, k]),
|
|
12243
|
+
const R = await ne(pe, ["global", "auth", "tabManager"], [$e, k]), E = await ne(pe, ["global", "auth", "garbageCollectionStrategy"], [$e, k]), D = await ne(pe, ["global", "auth", "maxCacheSize"], [$e, k]) || -1, M = await ne(pe, ["global", "auth", "maxWriteCacheSize"], [$e, k]);
|
|
12243
12244
|
let N;
|
|
12244
12245
|
const L = {
|
|
12245
12246
|
localCache: Ac({
|
|
@@ -12253,11 +12254,11 @@ const Gw = async (r, e, t, n) => {
|
|
|
12253
12254
|
})
|
|
12254
12255
|
};
|
|
12255
12256
|
let X;
|
|
12256
|
-
if (
|
|
12257
|
+
if (E === "EAGER" ? X = Xm() : X = ep({ cacheSizeBytes: D }), I === "ALL" ? N = L : N = {
|
|
12257
12258
|
localCache: tp({
|
|
12258
12259
|
garbageCollector: X
|
|
12259
12260
|
})
|
|
12260
|
-
}, Ge.main = Zn(
|
|
12261
|
+
}, Ge.main = Zn(mt, N), ["ALL", "WRITE"].includes(I) ? Ge.firestoreWrite = Zn(c, z) : Ge.firestoreWrite = Zn(c, N), Tt === "development" && p && !S?.includes("Firestore")) {
|
|
12261
12262
|
const Se = be.STOKER_FB_EMULATOR_FIRESTORE_PORT ? parseInt(be.STOKER_FB_EMULATOR_FIRESTORE_PORT) : 8080;
|
|
12262
12263
|
for (const [Le, Ot] of Object.entries(Ge))
|
|
12263
12264
|
Le !== "maintenance" && Cc(Ot, "localhost", Se);
|
|
@@ -12266,33 +12267,33 @@ const Gw = async (r, e, t, n) => {
|
|
|
12266
12267
|
const Se = rp(Ge.main);
|
|
12267
12268
|
Se && np(Se);
|
|
12268
12269
|
}
|
|
12269
|
-
const P = await Je(Ue(
|
|
12270
|
+
const P = await Je(Ue(mt, be.STOKER_FB_FUNCTIONS_REGION), "stoker-schema")().catch((Se) => {
|
|
12270
12271
|
throw new Error("Error fetching schema.", { cause: Se });
|
|
12271
12272
|
});
|
|
12272
12273
|
Pr = P.data.schema;
|
|
12273
12274
|
const oe = Object.entries(P.data.allRoleGroups).map(([Se, Le]) => [Se, new Set(Le)]);
|
|
12274
12275
|
mc = Object.fromEntries(oe), pc = P.data.currentUserRoleGroups, Tm = Sy(Object.keys(Pr.collections), e, "web", Co, n);
|
|
12275
12276
|
const ie = await fw($e, C);
|
|
12276
|
-
Rn.push(...ie), I === "WRITE" && bw(Pr, $e), await
|
|
12277
|
+
Rn.push(...ie), I === "WRITE" && bw(Pr, $e), await _e(pe.postLogin, [$e]);
|
|
12277
12278
|
const Me = new Event("stoker:ready");
|
|
12278
12279
|
document.dispatchEvent(Me);
|
|
12279
12280
|
} else if ($e) {
|
|
12280
|
-
kw(), Iw().forEach((
|
|
12281
|
-
|
|
12281
|
+
kw(), Iw().forEach((E) => {
|
|
12282
|
+
E();
|
|
12282
12283
|
}), xw();
|
|
12283
12284
|
const k = new Event("stoker:signOut");
|
|
12284
12285
|
document.dispatchEvent(k);
|
|
12285
12286
|
const m = { error: !1, instances: [] };
|
|
12286
|
-
await Promise.all(Object.values(
|
|
12287
|
-
|
|
12287
|
+
await Promise.all(Object.values(pt).map(async (E) => {
|
|
12288
|
+
E.currentUser && await _d(E).catch((D) => {
|
|
12288
12289
|
m.error = !0, m.instances.push({
|
|
12289
|
-
instance:
|
|
12290
|
+
instance: E.app.name,
|
|
12290
12291
|
code: "SIGN_OUT",
|
|
12291
12292
|
error: D
|
|
12292
|
-
}), console.error(`Error signing out of ${
|
|
12293
|
+
}), console.error(`Error signing out of ${E.app.name}.`);
|
|
12293
12294
|
});
|
|
12294
|
-
})), await Promise.all(Object.entries(Ge).map(async ([
|
|
12295
|
-
|
|
12295
|
+
})), await Promise.all(Object.entries(Ge).map(async ([E, D]) => {
|
|
12296
|
+
E !== "maintenance" && Object.keys(D).length !== 0 && await sp(D).catch((M) => {
|
|
12296
12297
|
console.error(`Error terminating ${D.app.name}.`), m.error = !0, m.instances.push({
|
|
12297
12298
|
instance: D.app.name,
|
|
12298
12299
|
code: "TERMINATE_APP",
|
|
@@ -12303,14 +12304,14 @@ const Gw = async (r, e, t, n) => {
|
|
|
12303
12304
|
"global",
|
|
12304
12305
|
"auth",
|
|
12305
12306
|
"clearPersistenceOnSignOut"
|
|
12306
|
-
]) ?? !0) && (I === "ALL" && await xc(Ge.main).catch((
|
|
12307
|
-
console.error('Error clearing indexedDB persistence in "[DEFAULT]".'), m.error = !0, m.instances.push({ instance: "[DEFAULT]", code: "CLEAR_CACHE", error:
|
|
12308
|
-
}), ["ALL", "WRITE"].includes(I) && await xc(Ge.firestoreWrite).catch((
|
|
12309
|
-
console.error('Error clearing indexedDB persistence in "firestoreWrite".'), m.error = !0, m.instances.push({ instance: "firestoreWrite", code: "CLEAR_CACHE", error:
|
|
12310
|
-
})), m.error ? console.info("Sign out operation completed with errors.") : console.info("Sign out operation completed successfully."), await
|
|
12311
|
-
}
|
|
12312
|
-
}),
|
|
12313
|
-
}, { getTenant: Mt, getEnv: ze, getTimezone: Cm, getSchema: Ve, getCurrentUser: Hw, getCurrentUserRoleGroups: Jr, getAllRoleGroups: yc, getGlobalConfigModule: Ie, getCollectionConfigModule:
|
|
12307
|
+
]) ?? !0) && (I === "ALL" && await xc(Ge.main).catch((E) => {
|
|
12308
|
+
console.error('Error clearing indexedDB persistence in "[DEFAULT]".'), m.error = !0, m.instances.push({ instance: "[DEFAULT]", code: "CLEAR_CACHE", error: E });
|
|
12309
|
+
}), ["ALL", "WRITE"].includes(I) && await xc(Ge.firestoreWrite).catch((E) => {
|
|
12310
|
+
console.error('Error clearing indexedDB persistence in "firestoreWrite".'), m.error = !0, m.instances.push({ instance: "firestoreWrite", code: "CLEAR_CACHE", error: E });
|
|
12311
|
+
})), m.error ? console.info("Sign out operation completed with errors.") : console.info("Sign out operation completed successfully."), await _e(pe.postLogout, [m]);
|
|
12312
|
+
}
|
|
12313
|
+
}), _ ? !1 : T.currentUser ? (O && console.info(`${T.currentUser.uid} successfully logged in.`), !0) : !1;
|
|
12314
|
+
}, { getTenant: Mt, getEnv: ze, getTimezone: Cm, getSchema: Ve, getCurrentUser: Hw, getCurrentUserRoleGroups: Jr, getAllRoleGroups: yc, getGlobalConfigModule: Ie, getCollectionConfigModule: ft, getAppCheck: Kw, getAppCheckFirestoreWrite: Yw, getFirestoreWriteAuth: Nw, getFirestoreWrite: gc, getFirestoreMaintenance: Am } = Co, Jw = async (r, e, t) => {
|
|
12314
12315
|
const [n, s] = [dr(), Nw()], i = Ie();
|
|
12315
12316
|
if (!r || !e)
|
|
12316
12317
|
throw new Error("Email and password are required.");
|
|
@@ -12340,12 +12341,12 @@ const Gw = async (r, e, t, n) => {
|
|
|
12340
12341
|
throw new Error("The user is not authenticated.");
|
|
12341
12342
|
await Wm(s, h);
|
|
12342
12343
|
} catch {
|
|
12343
|
-
throw n && n.currentUser && await
|
|
12344
|
+
throw n && n.currentUser && await _d(n), new Error("The user is not authenticated.");
|
|
12344
12345
|
}
|
|
12345
12346
|
}
|
|
12346
12347
|
console.info(`${a} successfully logged in.`);
|
|
12347
12348
|
} catch (a) {
|
|
12348
|
-
throw await
|
|
12349
|
+
throw await _e(i.postLogin, [null, a]), a;
|
|
12349
12350
|
}
|
|
12350
12351
|
}, Qw = (r) => (document.addEventListener("stoker:ready", r), () => {
|
|
12351
12352
|
document.removeEventListener("stoker:ready", r);
|
|
@@ -12400,10 +12401,10 @@ const Gw = async (r, e, t, n) => {
|
|
|
12400
12401
|
const o = Ve(!0), l = Jr()[i], u = We(), f = o.collections[i];
|
|
12401
12402
|
if (!f)
|
|
12402
12403
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12403
|
-
const { labels: d, preloadCache: h } = f, p = Ie(),
|
|
12404
|
-
if (!
|
|
12404
|
+
const { labels: d, preloadCache: h } = f, p = Ie(), O = Object.keys(o.collections).includes(i), g = p.disabledCollections?.includes(i);
|
|
12405
|
+
if (!O || g)
|
|
12405
12406
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12406
|
-
const w =
|
|
12407
|
+
const w = ft(d.collection), b = await ne(p, [
|
|
12407
12408
|
"global",
|
|
12408
12409
|
"firebase",
|
|
12409
12410
|
"serverTimestampOptions"
|
|
@@ -12412,8 +12413,8 @@ const Gw = async (r, e, t, n) => {
|
|
|
12412
12413
|
throw new Error("PERMISSION_DENIED");
|
|
12413
12414
|
const F = h?.roles?.includes(a.Role), y = { collection: d.collection };
|
|
12414
12415
|
await ae("preOperation", p, w, ["read", void 0, e, y]), await ae("preRead", p, w, [y, A, !1, !0]);
|
|
12415
|
-
const
|
|
12416
|
-
let
|
|
12416
|
+
const _ = /* @__PURE__ */ new Map(), I = [];
|
|
12417
|
+
let v = {};
|
|
12417
12418
|
const C = /* @__PURE__ */ new Map();
|
|
12418
12419
|
typeof s?.relations == "object" && (s.relations.fields = s.relations.fields.map((M) => {
|
|
12419
12420
|
if (typeof M == "string") {
|
|
@@ -12426,34 +12427,34 @@ const Gw = async (r, e, t, n) => {
|
|
|
12426
12427
|
}));
|
|
12427
12428
|
const k = () => {
|
|
12428
12429
|
const M = Sd(u, async () => {
|
|
12429
|
-
if (M(),
|
|
12430
|
-
if (um(
|
|
12430
|
+
if (M(), v) {
|
|
12431
|
+
if (um(v, C), !s?.noComputedFields) {
|
|
12431
12432
|
const N = [];
|
|
12432
12433
|
for (const L of f.fields)
|
|
12433
|
-
L.type === "Computed" && N.push(
|
|
12434
|
-
|
|
12434
|
+
L.type === "Computed" && N.push(_e(() => L.formula(v)).then((z) => {
|
|
12435
|
+
v && (v[L.name] = z);
|
|
12435
12436
|
}));
|
|
12436
12437
|
await Promise.all(N);
|
|
12437
12438
|
}
|
|
12438
12439
|
if (s?.noEmbeddingFields)
|
|
12439
12440
|
for (const N of f.fields)
|
|
12440
|
-
N.type === "Embedding" && delete
|
|
12441
|
+
N.type === "Embedding" && delete v[N.name];
|
|
12441
12442
|
}
|
|
12442
|
-
t(we(
|
|
12443
|
+
t(we(v));
|
|
12443
12444
|
});
|
|
12444
|
-
}, m = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(),
|
|
12445
|
+
}, m = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(), E = (M) => typeof M == "object" ? M.fields.filter((L) => typeof L == "object" && ve(L) && jt(f, o, a).includes(L.collection)) : f.fields.filter((L) => ve(L) && jt(f, o, a).includes(L.collection)), D = (M) => new Promise((N) => {
|
|
12445
12446
|
if (!s?.relations) {
|
|
12446
12447
|
N({});
|
|
12447
12448
|
return;
|
|
12448
12449
|
}
|
|
12449
|
-
const L = we(s.relations), z = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map(), le =
|
|
12450
|
+
const L = we(s.relations), z = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map(), le = E(L);
|
|
12450
12451
|
for (const P of le)
|
|
12451
12452
|
for (const oe of R.values())
|
|
12452
12453
|
oe.type === P.type && oe.field === P.name && // eslint-disable-next-line security/detect-object-injection
|
|
12453
|
-
!
|
|
12454
|
+
!v[P.name][oe.id] && (oe.listener(), m.delete(`${P.name}_${oe.id}`));
|
|
12454
12455
|
for (const P of le)
|
|
12455
12456
|
if ("collection" in P) {
|
|
12456
|
-
const oe =
|
|
12457
|
+
const oe = v[P.name];
|
|
12457
12458
|
if (!oe)
|
|
12458
12459
|
continue;
|
|
12459
12460
|
for (const ie of Object.keys(oe))
|
|
@@ -12464,7 +12465,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12464
12465
|
else
|
|
12465
12466
|
for (const P of le)
|
|
12466
12467
|
if ("collection" in P) {
|
|
12467
|
-
const oe =
|
|
12468
|
+
const oe = v[P.name];
|
|
12468
12469
|
if (!oe)
|
|
12469
12470
|
continue;
|
|
12470
12471
|
for (const [ie, Me] of Object.entries(oe))
|
|
@@ -12475,7 +12476,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12475
12476
|
Se();
|
|
12476
12477
|
} else {
|
|
12477
12478
|
const Se = o.collections[P.collection], { access: Le } = Se, { serverReadOnly: Ot } = Le;
|
|
12478
|
-
Ot?.includes(a.Role) ?
|
|
12479
|
+
Ot?.includes(a.Role) ? _r([...Me.Collection_Path], ie, {
|
|
12479
12480
|
noComputedFields: s?.noComputedFields,
|
|
12480
12481
|
noEmbeddingFields: s?.noEmbeddingFields
|
|
12481
12482
|
}).then((K) => {
|
|
@@ -12489,13 +12490,13 @@ const Gw = async (r, e, t, n) => {
|
|
|
12489
12490
|
}
|
|
12490
12491
|
oe[ie] = K, z.set(`${P.name}_${ie}`, !0), Array.from(z.values()).every((j) => j) && (N({}), k(), M.fromCache === !1 && (ae("postOperation", p, w, [
|
|
12491
12492
|
"read",
|
|
12492
|
-
|
|
12493
|
+
v,
|
|
12493
12494
|
e,
|
|
12494
12495
|
y
|
|
12495
12496
|
]), ae("postRead", p, w, [
|
|
12496
12497
|
y,
|
|
12497
12498
|
A,
|
|
12498
|
-
|
|
12499
|
+
v,
|
|
12499
12500
|
!0
|
|
12500
12501
|
])));
|
|
12501
12502
|
}).catch((K) => {
|
|
@@ -12516,13 +12517,13 @@ const Gw = async (r, e, t, n) => {
|
|
|
12516
12517
|
}
|
|
12517
12518
|
oe[ie] = K, z.set(`${P.name}_${ie}`, !0), Array.from(z.values()).every((j) => j) && (N({}), k(), M.fromCache === !1 && (ae("postOperation", p, w, [
|
|
12518
12519
|
"read",
|
|
12519
|
-
|
|
12520
|
+
v,
|
|
12520
12521
|
e,
|
|
12521
12522
|
y
|
|
12522
12523
|
]), ae("postRead", p, w, [
|
|
12523
12524
|
y,
|
|
12524
12525
|
A,
|
|
12525
|
-
|
|
12526
|
+
v,
|
|
12526
12527
|
!0
|
|
12527
12528
|
])));
|
|
12528
12529
|
},
|
|
@@ -12552,22 +12553,22 @@ const Gw = async (r, e, t, n) => {
|
|
|
12552
12553
|
const N = hr(M, { source: s?.only || (F ? "cache" : "default") }, (L) => {
|
|
12553
12554
|
if (L.exists()) {
|
|
12554
12555
|
const z = L.data({ serverTimestamps: b || "none" });
|
|
12555
|
-
if (
|
|
12556
|
-
const le =
|
|
12556
|
+
if (_.has(M.path) && s?.relations) {
|
|
12557
|
+
const le = E(s?.relations);
|
|
12557
12558
|
for (const P of le)
|
|
12558
|
-
"collection" in P && z[P.name] && (z[P.name] =
|
|
12559
|
+
"collection" in P && z[P.name] && (z[P.name] = v?.[P.name]);
|
|
12559
12560
|
}
|
|
12560
|
-
|
|
12561
|
+
_.set(M.path, !0), v ||= {}, v.id ||= L.id, v = { ...v, ...z }, delete v.Collection_Path_String;
|
|
12561
12562
|
const X = C.get(M) || /* @__PURE__ */ new Set();
|
|
12562
|
-
lm(z, X), C.set(M, X),
|
|
12563
|
+
lm(z, X), C.set(M, X), _.size === A.length && D(L.metadata).then(() => {
|
|
12563
12564
|
k(), L.metadata.fromCache === !1 && (ae("postOperation", p, w, [
|
|
12564
12565
|
"read",
|
|
12565
|
-
|
|
12566
|
+
v,
|
|
12566
12567
|
e,
|
|
12567
12568
|
y
|
|
12568
|
-
]), ae("postRead", p, w, [y, A,
|
|
12569
|
+
]), ae("postRead", p, w, [y, A, v, !0]));
|
|
12569
12570
|
});
|
|
12570
|
-
} else
|
|
12571
|
+
} else v && (v = void 0, k(), L.metadata.fromCache === !1 && (ae("postOperation", p, w, ["read", void 0, e, y]), ae("postRead", p, w, [y, A, void 0, !0])));
|
|
12571
12572
|
}, (L) => {
|
|
12572
12573
|
n && n(L), I.forEach((z) => z());
|
|
12573
12574
|
});
|
|
@@ -12599,10 +12600,10 @@ const Gw = async (r, e, t, n) => {
|
|
|
12599
12600
|
const a = De();
|
|
12600
12601
|
if (!a?.Role)
|
|
12601
12602
|
throw new Error("PERMISSION_DENIED");
|
|
12602
|
-
const o = Ve(!0), l = Jr()[i], u = We(), f = o.collections[i], { labels: d, preloadCache: h, access: p } = f, { serverReadOnly:
|
|
12603
|
+
const o = Ve(!0), l = Jr()[i], u = We(), f = o.collections[i], { labels: d, preloadCache: h, access: p } = f, { serverReadOnly: O } = p, g = Ie(), w = Object.keys(o.collections).includes(i), b = g.disabledCollections?.includes(i);
|
|
12603
12604
|
if (!w || b)
|
|
12604
12605
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12605
|
-
const A =
|
|
12606
|
+
const A = ft(d.collection), F = await ne(g, [
|
|
12606
12607
|
"global",
|
|
12607
12608
|
"firebase",
|
|
12608
12609
|
"serverTimestampOptions"
|
|
@@ -12617,7 +12618,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12617
12618
|
return { pages: 0, count: 0, unsubscribe: () => {
|
|
12618
12619
|
} };
|
|
12619
12620
|
let S = T.map((G) => me(G, ...e));
|
|
12620
|
-
const
|
|
12621
|
+
const _ = s?.pagination?.startAfter || s?.pagination?.endBefore || s?.pagination?.startAt || s?.pagination?.endAt || {
|
|
12621
12622
|
first: /* @__PURE__ */ new Map(),
|
|
12622
12623
|
last: /* @__PURE__ */ new Map()
|
|
12623
12624
|
};
|
|
@@ -12630,22 +12631,22 @@ const Gw = async (r, e, t, n) => {
|
|
|
12630
12631
|
s.pagination.startAfter || s.pagination.endBefore || s.pagination.startAt || s.pagination.endAt ? s.pagination.startAfter ? (Qa(s.pagination.startAfter), S = S.map((j, Y) => {
|
|
12631
12632
|
if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
|
|
12632
12633
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using startAfter");
|
|
12633
|
-
let U = me(j, rt(s.pagination.orderByField, s.pagination.orderByDirection), eo(
|
|
12634
|
+
let U = me(j, rt(s.pagination.orderByField, s.pagination.orderByDirection), eo(_.last.get(Y)));
|
|
12634
12635
|
return s.pagination.number && (U = me(U, Xt(s.pagination.number))), U;
|
|
12635
12636
|
})) : s.pagination.endBefore ? (Ja(s.pagination.endBefore), S = S.map((j, Y) => {
|
|
12636
12637
|
if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
|
|
12637
12638
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using endBefore");
|
|
12638
|
-
let U = me(j, rt(s.pagination.orderByField, s.pagination.orderByDirection), to(
|
|
12639
|
+
let U = me(j, rt(s.pagination.orderByField, s.pagination.orderByDirection), to(_.first.get(Y)));
|
|
12639
12640
|
return s.pagination.number && (U = me(U, Fr(s.pagination.number))), U;
|
|
12640
12641
|
})) : s.pagination.startAt ? (Ja(s.pagination.startAt), S = S.map((j, Y) => {
|
|
12641
12642
|
if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
|
|
12642
12643
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using startAt");
|
|
12643
|
-
let U = me(j, rt(s.pagination.orderByField, s.pagination.orderByDirection), ap(
|
|
12644
|
+
let U = me(j, rt(s.pagination.orderByField, s.pagination.orderByDirection), ap(_.first.get(Y)));
|
|
12644
12645
|
return s.pagination.number && (U = me(U, Fr(s.pagination.number))), U;
|
|
12645
12646
|
})) : s.pagination.endAt && (Qa(s.pagination.endAt), S = S.map((j, Y) => {
|
|
12646
12647
|
if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
|
|
12647
12648
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using endAt");
|
|
12648
|
-
let U = me(j, rt(s.pagination.orderByField, s.pagination.orderByDirection), op(
|
|
12649
|
+
let U = me(j, rt(s.pagination.orderByField, s.pagination.orderByDirection), op(_.last.get(Y)));
|
|
12649
12650
|
return s.pagination.number && (U = me(U, Fr(s.pagination.number))), U;
|
|
12650
12651
|
})) : S = S.map((j) => {
|
|
12651
12652
|
let Y = me(j);
|
|
@@ -12655,12 +12656,12 @@ const Gw = async (r, e, t, n) => {
|
|
|
12655
12656
|
const I = { collection: d.collection };
|
|
12656
12657
|
await ae("preOperation", g, A, ["read", void 0, void 0, I]), await ae("preRead", g, A, [I, S, !0, !0]);
|
|
12657
12658
|
let k = !0;
|
|
12658
|
-
const m = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(),
|
|
12659
|
+
const m = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(), E = [], D = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map(), L = (G, K, j) => {
|
|
12659
12660
|
const Y = [];
|
|
12660
12661
|
D.forEach((U) => {
|
|
12661
12662
|
um(U, M.get(U.id));
|
|
12662
12663
|
for (const Z of f.fields)
|
|
12663
|
-
Z.type === "Computed" && !s?.noComputedFields && Y.push(
|
|
12664
|
+
Z.type === "Computed" && !s?.noComputedFields && Y.push(_e(Z.formula, [U, j]).then((Te) => {
|
|
12664
12665
|
U[Z.name] = Te;
|
|
12665
12666
|
})), s?.noEmbeddingFields && Z.type === "Embedding" && delete U[Z.name];
|
|
12666
12667
|
}), Promise.all(Y).then(() => {
|
|
@@ -12677,7 +12678,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12677
12678
|
}), m.size === S.length && j) {
|
|
12678
12679
|
k = !1;
|
|
12679
12680
|
const Y = Sd(u, () => {
|
|
12680
|
-
Y(), !s?.noComputedFields && A?.admin?.retriever ?
|
|
12681
|
+
Y(), !s?.noComputedFields && A?.admin?.retriever ? _e(A.admin.retriever).then((U) => {
|
|
12681
12682
|
L(G, K, U);
|
|
12682
12683
|
}) : L(G, K);
|
|
12683
12684
|
});
|
|
@@ -12697,7 +12698,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12697
12698
|
return;
|
|
12698
12699
|
const j = G.id;
|
|
12699
12700
|
R.set(j, "loading"), le[j] ||= /* @__PURE__ */ new Map();
|
|
12700
|
-
const Y = we(s?.relations), U = typeof Y == "object" ? Y.fields.filter((H) => typeof H == "object" &&
|
|
12701
|
+
const Y = we(s?.relations), U = typeof Y == "object" ? Y.fields.filter((H) => typeof H == "object" && ve(H) && jt(f, o, a).includes(H.collection)) : f.fields.filter((H) => ve(H) && jt(f, o, a).includes(H.collection)), Z = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map();
|
|
12701
12702
|
X[j] ||= /* @__PURE__ */ new Map();
|
|
12702
12703
|
for (const H of U)
|
|
12703
12704
|
for (const ge of le[j].entries()) {
|
|
@@ -12723,13 +12724,13 @@ const Gw = async (r, e, t, n) => {
|
|
|
12723
12724
|
continue;
|
|
12724
12725
|
for (const [re, Xe] of Object.entries(ge))
|
|
12725
12726
|
if (Te.has(re)) {
|
|
12726
|
-
const
|
|
12727
|
-
ge[re].id ? (Z.set(re, !0), Array.from(Z.values()).every((Be) => Be) && R.set(j, "loaded")) : setTimeout(
|
|
12727
|
+
const dt = async () => {
|
|
12728
|
+
ge[re].id ? (Z.set(re, !0), Array.from(Z.values()).every((Be) => Be) && R.set(j, "loaded")) : setTimeout(dt, 100);
|
|
12728
12729
|
};
|
|
12729
|
-
|
|
12730
|
+
dt();
|
|
12730
12731
|
} else {
|
|
12731
|
-
const
|
|
12732
|
-
xe?.includes(a.Role) ?
|
|
12732
|
+
const dt = o.collections[H.collection], { access: Be } = dt, { serverReadOnly: xe } = Be;
|
|
12733
|
+
xe?.includes(a.Role) ? _r([...Xe.Collection_Path], re).then((Re) => {
|
|
12733
12734
|
if (!Re) {
|
|
12734
12735
|
delete ge[re];
|
|
12735
12736
|
return;
|
|
@@ -12769,7 +12770,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12769
12770
|
Re(), X[j].delete(re);
|
|
12770
12771
|
return;
|
|
12771
12772
|
}
|
|
12772
|
-
|
|
12773
|
+
E.push(Re), le[j].set(re, {
|
|
12773
12774
|
doc: j,
|
|
12774
12775
|
type: H.type,
|
|
12775
12776
|
field: H.name,
|
|
@@ -12779,7 +12780,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12779
12780
|
}
|
|
12780
12781
|
}
|
|
12781
12782
|
}, oe = (G) => {
|
|
12782
|
-
const K = we(s?.relations), j = typeof K == "object" ? K.fields.filter((Y) => typeof Y == "object" &&
|
|
12783
|
+
const K = we(s?.relations), j = typeof K == "object" ? K.fields.filter((Y) => typeof Y == "object" && ve(Y) && jt(f, o, a).includes(Y.collection)) : f.fields.filter((Y) => ve(Y) && jt(f, o, a).includes(Y.collection));
|
|
12783
12784
|
for (const Y of j)
|
|
12784
12785
|
if (le[G])
|
|
12785
12786
|
for (const U of le[G].entries()) {
|
|
@@ -12798,22 +12799,22 @@ const Gw = async (r, e, t, n) => {
|
|
|
12798
12799
|
for (const G of S) {
|
|
12799
12800
|
let K = !0;
|
|
12800
12801
|
const j = hr(G, { source: Me ? "cache" : "default", includeMetadataChanges: !0 }, (Y) => {
|
|
12801
|
-
(Me || Y.metadata.fromCache === !1) && (m.set(G, !0),
|
|
12802
|
+
(Me || Y.metadata.fromCache === !1) && (m.set(G, !0), _.first.set(S.indexOf(G), Y.docs[0]), _.last.set(S.indexOf(G), Y.docs.at(-1) || Y.docs[0]), k && s?.relations || z(_, Y.metadata)), m.get(G) === !0 && (K ? (Y.docs.forEach((U) => {
|
|
12802
12803
|
const Z = D.get(U.id) || {}, Te = N.get(U.id) || 0;
|
|
12803
12804
|
N.set(U.id, Te + 1), ie(G, Z, U);
|
|
12804
12805
|
}), K = !1) : Y.docChanges().forEach((U) => {
|
|
12805
12806
|
const Z = D.get(U.doc.id) || {}, Te = N.get(U.doc.id) || 0;
|
|
12806
12807
|
U.type === "added" && N.set(U.doc.id, Te + 1), U.type === "added" || U.type === "modified" ? ie(G, Z, U.doc) : U.type === "removed" && (N.set(U.doc.id, Te - 1), N.get(U.doc.id) === 0 && (D.delete(U.doc.id), m.size === S.length && s?.relations && (R.set(U.doc.id, "deleted"), oe(U.doc.id))));
|
|
12807
|
-
}), m.size === S.length && s?.relations && (D.size === 0 && z(
|
|
12808
|
-
P(U,
|
|
12808
|
+
}), m.size === S.length && s?.relations && (D.size === 0 && z(_, Y.metadata), D.forEach((U) => {
|
|
12809
|
+
P(U, _);
|
|
12809
12810
|
})));
|
|
12810
12811
|
}, (Y) => {
|
|
12811
|
-
n && n(new Error(`Error fetching documents at location ${r.join("/")}`, { cause: Y })),
|
|
12812
|
+
n && n(new Error(`Error fetching documents at location ${r.join("/")}`, { cause: Y })), E.forEach((U) => U());
|
|
12812
12813
|
});
|
|
12813
|
-
|
|
12814
|
+
E.push(j);
|
|
12814
12815
|
}
|
|
12815
12816
|
let Se, Le;
|
|
12816
|
-
if (s?.pagination && !h?.roles.includes(a.Role) && !
|
|
12817
|
+
if (s?.pagination && !h?.roles.includes(a.Role) && !O?.includes(a.Role)) {
|
|
12817
12818
|
let G = me(T[0], ...e);
|
|
12818
12819
|
s.pagination.orderByField && s.pagination.orderByDirection && (G = me(G, rt(s.pagination.orderByField, s.pagination.orderByDirection)));
|
|
12819
12820
|
const K = await Ed(G).catch(() => {
|
|
@@ -12825,7 +12826,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12825
12826
|
}
|
|
12826
12827
|
}
|
|
12827
12828
|
return { pages: Le, count: Se, unsubscribe: (G) => {
|
|
12828
|
-
G === "first" && Ja(
|
|
12829
|
+
G === "first" && Ja(_), G === "last" && Qa(_), E.forEach((K) => K());
|
|
12829
12830
|
} };
|
|
12830
12831
|
}, ib = async (r, e) => {
|
|
12831
12832
|
const t = it(), n = ze(), s = Ue(t, n.STOKER_FB_FUNCTIONS_REGION);
|
|
@@ -12849,13 +12850,13 @@ const Gw = async (r, e, t, n) => {
|
|
|
12849
12850
|
await Fw(e, t, n, s, i, a);
|
|
12850
12851
|
return;
|
|
12851
12852
|
}
|
|
12852
|
-
const f = Ha(r), d = cw(e), h = t ? pd(t) : void 0, p = n ? pd(n) : void 0,
|
|
12853
|
+
const f = Ha(r), d = cw(e), h = t ? pd(t) : void 0, p = n ? pd(n) : void 0, O = s ? Ha(s) : void 0, g = i ? Ha(i) : void 0, w = a ? Tn(a) : void 0, b = c ? Tn(c) : void 0, A = Array.isArray(f) ? f : [f];
|
|
12853
12854
|
if (A.length === 0 || A.length === 1 && !A[0])
|
|
12854
12855
|
throw new Error("No valid email addresses provided");
|
|
12855
12856
|
const F = We(), y = { to: f, message: { subject: d } };
|
|
12856
|
-
if (h && (y.message.text = h), p && (y.message.html = p),
|
|
12857
|
-
const T = Array.isArray(
|
|
12858
|
-
T.length > 0 && T[0] && (y.cc =
|
|
12857
|
+
if (h && (y.message.text = h), p && (y.message.html = p), O) {
|
|
12858
|
+
const T = Array.isArray(O) ? O : [O];
|
|
12859
|
+
T.length > 0 && T[0] && (y.cc = O);
|
|
12859
12860
|
}
|
|
12860
12861
|
if (g) {
|
|
12861
12862
|
const T = Array.isArray(g) ? g : [g];
|
|
@@ -12888,7 +12889,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12888
12889
|
return B.fromJSDate(r).minus({ minutes: a }).toJSDate();
|
|
12889
12890
|
}, fb = (r) => "seconds" in r && "nanoseconds" in r ? Mw(new Bt(r.seconds, r.nanoseconds)).toFormat("MMMM d, yyyy '@' h:mm a") : "";
|
|
12890
12891
|
export {
|
|
12891
|
-
|
|
12892
|
+
_m as addRecord,
|
|
12892
12893
|
gw as addRecordServer,
|
|
12893
12894
|
Jw as authenticateStoker,
|
|
12894
12895
|
ww as callFunction,
|
|
@@ -12896,15 +12897,15 @@ export {
|
|
|
12896
12897
|
cb as convertDateToTimezone,
|
|
12897
12898
|
Mw as convertTimestampToTimezone,
|
|
12898
12899
|
rb as deleteFolder,
|
|
12899
|
-
|
|
12900
|
-
|
|
12900
|
+
_w as deleteRecord,
|
|
12901
|
+
vw as deleteRecordServer,
|
|
12901
12902
|
hm as deserializeTimestamps,
|
|
12902
12903
|
fb as displayDate,
|
|
12903
12904
|
yc as getAllRoleGroups,
|
|
12904
12905
|
Kw as getAppCheck,
|
|
12905
12906
|
Yw as getAppCheckFirestoreWrite,
|
|
12906
12907
|
ne as getCachedConfigValue,
|
|
12907
|
-
|
|
12908
|
+
ft as getCollectionConfigModule,
|
|
12908
12909
|
oc as getCollectionRefs,
|
|
12909
12910
|
zt as getConnectionStatus,
|
|
12910
12911
|
Hw as getCurrentUser,
|
|
@@ -12920,7 +12921,7 @@ export {
|
|
|
12920
12921
|
To as getLoadingState,
|
|
12921
12922
|
Tw as getMaintenanceInfo,
|
|
12922
12923
|
Cw as getNetworkStatus,
|
|
12923
|
-
|
|
12924
|
+
_r as getOne,
|
|
12924
12925
|
mw as getOneServer,
|
|
12925
12926
|
lw as getPreloadListeners,
|
|
12926
12927
|
Ve as getSchema,
|
|
@@ -12945,11 +12946,11 @@ export {
|
|
|
12945
12946
|
Dw as sendAdminSMS,
|
|
12946
12947
|
ab as sendMail,
|
|
12947
12948
|
ob as sendMessage,
|
|
12948
|
-
|
|
12949
|
+
vm as serializeTimestamps,
|
|
12949
12950
|
Em as signOut,
|
|
12950
12951
|
sb as subscribeMany,
|
|
12951
12952
|
km as subscribeOne,
|
|
12952
|
-
|
|
12953
|
+
_e as tryPromise,
|
|
12953
12954
|
fc as updateRecord,
|
|
12954
12955
|
yw as updateRecordServer,
|
|
12955
12956
|
nb as waitForPendingWrites
|