@stoker-platform/web-client 0.2.6 → 0.2.8
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 +897 -881
- package/package.json +2 -2
package/dist/bundle.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { getApp as nt, registerVersion as
|
|
2
|
-
import { isSupported as
|
|
3
|
-
import { getAuth as fr, validatePassword as pd, initializeAuth as vc, indexedDBLocalPersistence as
|
|
4
|
-
import { getDatabase as gd, onValue as
|
|
5
|
-
import { getFirestore as je, where as ge, query as pe, collection as Mr, and as Jr, or as Ec, onSnapshot as dr, doc as Ae, Timestamp as zt, setDoc as
|
|
6
|
-
import { connectStorageEmulator as
|
|
7
|
-
import { getFunctions as $e, httpsCallable as Ke, connectFunctionsEmulator as
|
|
8
|
-
import { ReCaptchaEnterpriseProvider as
|
|
9
|
-
import { getPerformance as
|
|
10
|
-
import { getRemoteConfig as
|
|
11
|
-
const
|
|
1
|
+
import { getApp as nt, registerVersion as km, initializeApp as Vn, setLogLevel as Yr, onLog as Im } from "firebase/app";
|
|
2
|
+
import { isSupported as xm, initializeAnalytics as Nm, setConsent as Fm } from "firebase/analytics";
|
|
3
|
+
import { getAuth as fr, validatePassword as pd, initializeAuth as vc, indexedDBLocalPersistence as Dm, browserLocalPersistence as Mm, browserSessionPersistence as wc, inMemoryPersistence as bc, beforeAuthStateChanged as Pm, connectAuthEmulator as qm, onAuthStateChanged as Wn, getIdTokenResult as Lm, signOut as yd, signInWithEmailAndPassword as $m, getMultiFactorResolver as jm, TotpMultiFactorGenerator as Ja, signInWithCustomToken as Um, multiFactor as Oc } from "firebase/auth";
|
|
4
|
+
import { getDatabase as gd, onValue as Vm, ref as Wm, connectDatabaseEmulator as zm } from "firebase/database";
|
|
5
|
+
import { getFirestore as je, where as ge, query as pe, collection as Mr, and as Jr, or as Ec, onSnapshot as dr, doc as Ae, Timestamp as zt, setDoc as Bm, getDoc as _d, orderBy as et, limit as Xt, startAfter as Qa, endBefore as Xa, limitToLast as Ir, getDocsFromCache as vd, getDocsFromServer as Zm, getDocs as Gm, getCountFromServer as wd, getDocFromCache as Hm, getDocFromServer as Km, writeBatch as Ro, serverTimestamp as Pr, deleteField as Tn, arrayRemove as Ao, arrayUnion as Co, collectionGroup as Ym, connectFirestoreEmulator as Sc, persistentLocalCache as Tc, persistentSingleTabManager as Rc, persistentMultipleTabManager as Ac, memoryEagerGarbageCollector as Jm, memoryLruGarbageCollector as Qm, memoryLocalCache as Xm, initializeFirestore as zn, getPersistentCacheIndexManager as ep, enablePersistentCacheIndexAutoCreation as tp, terminate as rp, clearIndexedDbPersistence as Cc, waitForPendingWrites as np, onSnapshotsInSync as bd, startAt as sp, endAt as ip, addDoc as Od } from "firebase/firestore";
|
|
6
|
+
import { connectStorageEmulator as ap, getStorage as op } from "firebase/storage";
|
|
7
|
+
import { getFunctions as $e, httpsCallable as Ke, connectFunctionsEmulator as cp } from "firebase/functions";
|
|
8
|
+
import { ReCaptchaEnterpriseProvider as lp, initializeAppCheck as Bn, onTokenChanged as Zn } from "firebase/app-check";
|
|
9
|
+
import { getPerformance as up } from "firebase/performance";
|
|
10
|
+
import { getRemoteConfig as fp, fetchAndActivate as dp } from "firebase/remote-config";
|
|
11
|
+
const hp = "0.2.8", mp = (r) => !!r.auth, _t = (r, e) => {
|
|
12
12
|
if (e?.operations)
|
|
13
13
|
return e.operations.includes(r);
|
|
14
|
-
}, Rn = (r, e) => e ? e.Role ? r.access?.includes(e.Role) : !1 : !0,
|
|
14
|
+
}, Rn = (r, e) => e ? e.Role ? r.access?.includes(e.Role) : !1 : !0, pp = (r, e) => r.restrictCreate === !0 ? !1 : e && typeof r.restrictCreate == "object" ? e.Role ? r.restrictCreate?.includes(e.Role) : !1 : !0, yp = (r, e) => r.restrictUpdate === !0 ? !1 : e && typeof r.restrictUpdate == "object" ? e.Role ? r.restrictUpdate?.includes(e.Role) : !1 : !0, re = (r, e) => r.filter((t) => t.name === e)[0], _e = (r) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(r.type), Ed = (r, e) => {
|
|
15
15
|
const t = {
|
|
16
16
|
Record_Owner: "recordOwner",
|
|
17
17
|
Record_User: "recordUser",
|
|
@@ -30,12 +30,12 @@ const dp = "0.2.6", hp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
30
30
|
c.role === e.Role && (!i.assignable?.includes(e.Role) || a?.restrictEntities) && t.push(o);
|
|
31
31
|
});
|
|
32
32
|
}), t;
|
|
33
|
-
},
|
|
33
|
+
}, Sd = (r, e, t) => {
|
|
34
34
|
const n = [], { access: s } = r, { entityRestrictions: i } = s;
|
|
35
35
|
return i?.parentFilters?.forEach((a) => {
|
|
36
36
|
if (!a.roles.some((h) => h.role === t.Role))
|
|
37
37
|
return;
|
|
38
|
-
const o = a.collectionField, c =
|
|
38
|
+
const o = a.collectionField, c = re(r.fields, o);
|
|
39
39
|
if (!_e(c))
|
|
40
40
|
throw new Error("PERMISSION_DENIED");
|
|
41
41
|
const l = t.collections?.[c.collection], f = e.collections[c.collection].access.entityRestrictions;
|
|
@@ -58,25 +58,25 @@ const dp = "0.2.6", hp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
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
|
+
}, gp = (r, e, t, n, s, i) => {
|
|
62
62
|
const { fields: a } = e, o = s.collections?.[e.labels.collection];
|
|
63
63
|
let c = !0;
|
|
64
64
|
if (!o) {
|
|
65
65
|
c = !1;
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
const l =
|
|
68
|
+
const l = Ed(e, s), u = ko(e, s), f = Sd(e, t, s);
|
|
69
69
|
l?.filter((w) => w.type === "Record_Owner").forEach((w) => {
|
|
70
70
|
"operations" in w && w.operations && !w.operations.includes(r) || i.Created_By !== n && (c = !1);
|
|
71
71
|
}), l?.filter((w) => w.type === "Record_User").forEach((w) => {
|
|
72
72
|
if ("operations" in w && w.operations && !w.operations.includes(r))
|
|
73
73
|
return;
|
|
74
|
-
const E =
|
|
74
|
+
const E = re(a, w.collectionField);
|
|
75
75
|
i[`${E.name}_Array`]?.includes(s.Doc_ID) || (c = !1);
|
|
76
76
|
}), l?.filter((w) => w.type === "Record_Property").forEach((w) => {
|
|
77
77
|
if ("operations" in w && w.operations && !w.operations.includes(r))
|
|
78
78
|
return;
|
|
79
|
-
const E =
|
|
79
|
+
const E = re(a, w.propertyField), I = w.roles.find((T) => T.role === s.Role);
|
|
80
80
|
E.type === "Array" ? I.values?.some((T) => i[E.name].includes(T)) || (c = !1) : I.values?.includes(i[E.name]) || (c = !1);
|
|
81
81
|
});
|
|
82
82
|
let d = !0, h = !1;
|
|
@@ -86,14 +86,14 @@ const dp = "0.2.6", hp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
86
86
|
let p = !0, v = !1;
|
|
87
87
|
if (u?.filter((w) => w.type === "Parent").forEach((w) => {
|
|
88
88
|
v = !0;
|
|
89
|
-
const E =
|
|
89
|
+
const E = re(a, w.collectionField);
|
|
90
90
|
o.parentEntities?.some((I) => i[`${E.name}_Array`].includes(I)) || (p = !1);
|
|
91
91
|
}), u?.filter((w) => w.type === "Parent_Property").forEach((w) => {
|
|
92
92
|
v = !0;
|
|
93
|
-
const E =
|
|
93
|
+
const E = re(a, w.collectionField), I = re(a, w.propertyField);
|
|
94
94
|
Object.entries(o.parentPropertyEntities || {}).some((T) => {
|
|
95
|
-
const [
|
|
96
|
-
return
|
|
95
|
+
const [g, N] = T;
|
|
96
|
+
return g === i[I.name] && i[`${E.name}_Array`].some((_) => N.includes(_));
|
|
97
97
|
}) || (p = !1);
|
|
98
98
|
}), h && v) {
|
|
99
99
|
if (!(d || p)) {
|
|
@@ -104,42 +104,42 @@ const dp = "0.2.6", hp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
104
104
|
c = !1;
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
|
-
let
|
|
107
|
+
let y = !0, O = !1;
|
|
108
108
|
f?.filter((w) => w.parentFilter.type === "Individual").forEach((w) => {
|
|
109
109
|
O = !0;
|
|
110
|
-
const { parentFilter: E } = w, I =
|
|
110
|
+
const { parentFilter: E } = w, I = re(a, E.collectionField), T = s.collections?.[I.collection];
|
|
111
111
|
if (!T) {
|
|
112
112
|
c = !1;
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
T.individualEntities?.some((
|
|
115
|
+
T.individualEntities?.some((g) => i[`${I.name}_Array`].includes(g)) || (y = !1);
|
|
116
116
|
});
|
|
117
117
|
let R = !0, C = !1;
|
|
118
118
|
if (f?.filter((w) => w.parentFilter.type === "Parent").forEach((w) => {
|
|
119
119
|
C = !0;
|
|
120
|
-
const { parentFilter: E } = w, I =
|
|
121
|
-
if (!
|
|
120
|
+
const { parentFilter: E } = w, I = re(a, E.collectionField), T = re(a, E.parentCollectionField), g = s.collections?.[I.collection];
|
|
121
|
+
if (!g) {
|
|
122
122
|
c = !1;
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
-
|
|
125
|
+
g.parentEntities?.some((N) => i[`${T.name}_Array`].includes(N)) || (R = !1);
|
|
126
126
|
}), f?.filter((w) => w.parentFilter.type === "Parent_Property").forEach((w) => {
|
|
127
127
|
C = !0;
|
|
128
|
-
const { parentFilter: E } = w, I =
|
|
128
|
+
const { parentFilter: E } = w, I = re(a, E.collectionField), T = re(a, E.parentPropertyField), g = re(a, E.parentCollectionField), N = s.collections?.[I.collection];
|
|
129
129
|
if (!N) {
|
|
130
130
|
c = !1;
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
|
-
Object.entries(N.parentPropertyEntities || {}).some((
|
|
134
|
-
const [A, b] =
|
|
135
|
-
return A === i[T.name] && i[`${
|
|
133
|
+
Object.entries(N.parentPropertyEntities || {}).some((_) => {
|
|
134
|
+
const [A, b] = _;
|
|
135
|
+
return A === i[T.name] && i[`${g.name}_Array`].some((m) => b.includes(m));
|
|
136
136
|
}) || (R = !1);
|
|
137
137
|
}), O && C) {
|
|
138
|
-
if (!(
|
|
138
|
+
if (!(y || R)) {
|
|
139
139
|
c = !1;
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
|
-
} else if (!
|
|
142
|
+
} else if (!y || !R) {
|
|
143
143
|
c = !1;
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
@@ -151,7 +151,7 @@ const dp = "0.2.6", hp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
151
151
|
return c = !1, c;
|
|
152
152
|
_t(r, o) || (c = !1);
|
|
153
153
|
const u = ko(e, s)?.filter((f) => f.type === "Individual").length > 0;
|
|
154
|
-
return r === "Create" && u && (c = !1),
|
|
154
|
+
return r === "Create" && u && (c = !1), gp(r, e, t, n, s, i) || (c = !1), c;
|
|
155
155
|
}, $t = (r, e, t) => {
|
|
156
156
|
const n = [];
|
|
157
157
|
for (const s of r.fields)
|
|
@@ -164,7 +164,7 @@ const dp = "0.2.6", hp = (r) => !!r.auth, _t = (r, e) => {
|
|
|
164
164
|
(!t || _t("Read", a) || An(r, e, t)) && n.push(s.collection);
|
|
165
165
|
}
|
|
166
166
|
return Array.from(new Set(n));
|
|
167
|
-
},
|
|
167
|
+
}, Td = (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];
|
|
@@ -177,7 +177,7 @@ function Cn(r) {
|
|
|
177
177
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
178
178
|
}
|
|
179
179
|
var Gn, kc;
|
|
180
|
-
function
|
|
180
|
+
function _p() {
|
|
181
181
|
if (kc) return Gn;
|
|
182
182
|
kc = 1;
|
|
183
183
|
function r() {
|
|
@@ -208,7 +208,7 @@ function kn() {
|
|
|
208
208
|
return Kn = e, Kn;
|
|
209
209
|
}
|
|
210
210
|
var Yn, Nc;
|
|
211
|
-
function
|
|
211
|
+
function vp() {
|
|
212
212
|
if (Nc) return Yn;
|
|
213
213
|
Nc = 1;
|
|
214
214
|
var r = kn(), e = Array.prototype, t = e.splice;
|
|
@@ -222,7 +222,7 @@ function _p() {
|
|
|
222
222
|
return Yn = n, Yn;
|
|
223
223
|
}
|
|
224
224
|
var Jn, Fc;
|
|
225
|
-
function
|
|
225
|
+
function wp() {
|
|
226
226
|
if (Fc) return Jn;
|
|
227
227
|
Fc = 1;
|
|
228
228
|
var r = kn();
|
|
@@ -233,7 +233,7 @@ function vp() {
|
|
|
233
233
|
return Jn = e, Jn;
|
|
234
234
|
}
|
|
235
235
|
var Qn, Dc;
|
|
236
|
-
function
|
|
236
|
+
function bp() {
|
|
237
237
|
if (Dc) return Qn;
|
|
238
238
|
Dc = 1;
|
|
239
239
|
var r = kn();
|
|
@@ -243,7 +243,7 @@ function wp() {
|
|
|
243
243
|
return Qn = e, Qn;
|
|
244
244
|
}
|
|
245
245
|
var Xn, Mc;
|
|
246
|
-
function
|
|
246
|
+
function Op() {
|
|
247
247
|
if (Mc) return Xn;
|
|
248
248
|
Mc = 1;
|
|
249
249
|
var r = kn();
|
|
@@ -257,7 +257,7 @@ var es, Pc;
|
|
|
257
257
|
function In() {
|
|
258
258
|
if (Pc) return es;
|
|
259
259
|
Pc = 1;
|
|
260
|
-
var r =
|
|
260
|
+
var r = _p(), e = vp(), t = wp(), n = bp(), s = Op();
|
|
261
261
|
function i(a) {
|
|
262
262
|
var o = -1, c = a == null ? 0 : a.length;
|
|
263
263
|
for (this.clear(); ++o < c; ) {
|
|
@@ -268,7 +268,7 @@ function In() {
|
|
|
268
268
|
return i.prototype.clear = r, i.prototype.delete = e, i.prototype.get = t, i.prototype.has = n, i.prototype.set = s, es = i, es;
|
|
269
269
|
}
|
|
270
270
|
var ts, qc;
|
|
271
|
-
function
|
|
271
|
+
function Ep() {
|
|
272
272
|
if (qc) return ts;
|
|
273
273
|
qc = 1;
|
|
274
274
|
var r = In();
|
|
@@ -278,7 +278,7 @@ function Op() {
|
|
|
278
278
|
return ts = e, ts;
|
|
279
279
|
}
|
|
280
280
|
var rs, Lc;
|
|
281
|
-
function
|
|
281
|
+
function Sp() {
|
|
282
282
|
if (Lc) return rs;
|
|
283
283
|
Lc = 1;
|
|
284
284
|
function r(e) {
|
|
@@ -288,7 +288,7 @@ function Ep() {
|
|
|
288
288
|
return rs = r, rs;
|
|
289
289
|
}
|
|
290
290
|
var ns, $c;
|
|
291
|
-
function
|
|
291
|
+
function Tp() {
|
|
292
292
|
if ($c) return ns;
|
|
293
293
|
$c = 1;
|
|
294
294
|
function r(e) {
|
|
@@ -297,7 +297,7 @@ function Sp() {
|
|
|
297
297
|
return ns = r, ns;
|
|
298
298
|
}
|
|
299
299
|
var ss, jc;
|
|
300
|
-
function
|
|
300
|
+
function Rp() {
|
|
301
301
|
if (jc) return ss;
|
|
302
302
|
jc = 1;
|
|
303
303
|
function r(e) {
|
|
@@ -306,7 +306,7 @@ function Tp() {
|
|
|
306
306
|
return ss = r, ss;
|
|
307
307
|
}
|
|
308
308
|
var is, Uc;
|
|
309
|
-
function
|
|
309
|
+
function Rd() {
|
|
310
310
|
if (Uc) return is;
|
|
311
311
|
Uc = 1;
|
|
312
312
|
var r = typeof Qr == "object" && Qr && Qr.Object === Object && Qr;
|
|
@@ -316,7 +316,7 @@ var as, Vc;
|
|
|
316
316
|
function ct() {
|
|
317
317
|
if (Vc) return as;
|
|
318
318
|
Vc = 1;
|
|
319
|
-
var r =
|
|
319
|
+
var r = Rd(), e = typeof self == "object" && self && self.Object === Object && self, t = r || e || Function("return this")();
|
|
320
320
|
return as = t, as;
|
|
321
321
|
}
|
|
322
322
|
var os, Wc;
|
|
@@ -327,7 +327,7 @@ function Ur() {
|
|
|
327
327
|
return os = e, os;
|
|
328
328
|
}
|
|
329
329
|
var cs, zc;
|
|
330
|
-
function
|
|
330
|
+
function Ap() {
|
|
331
331
|
if (zc) return cs;
|
|
332
332
|
zc = 1;
|
|
333
333
|
var r = Ur(), e = Object.prototype, t = e.hasOwnProperty, n = e.toString, s = r ? r.toStringTag : void 0;
|
|
@@ -344,7 +344,7 @@ function Rp() {
|
|
|
344
344
|
return cs = i, cs;
|
|
345
345
|
}
|
|
346
346
|
var ls, Bc;
|
|
347
|
-
function
|
|
347
|
+
function Cp() {
|
|
348
348
|
if (Bc) return ls;
|
|
349
349
|
Bc = 1;
|
|
350
350
|
var r = Object.prototype, e = r.toString;
|
|
@@ -357,7 +357,7 @@ var us, Zc;
|
|
|
357
357
|
function hr() {
|
|
358
358
|
if (Zc) return us;
|
|
359
359
|
Zc = 1;
|
|
360
|
-
var r = Ur(), e =
|
|
360
|
+
var r = Ur(), e = Ap(), t = Cp(), n = "[object Null]", s = "[object Undefined]", i = r ? r.toStringTag : void 0;
|
|
361
361
|
function a(o) {
|
|
362
362
|
return o == null ? o === void 0 ? s : n : i && i in Object(o) ? e(o) : t(o);
|
|
363
363
|
}
|
|
@@ -387,17 +387,17 @@ function Io() {
|
|
|
387
387
|
return ds = a, ds;
|
|
388
388
|
}
|
|
389
389
|
var hs, Kc;
|
|
390
|
-
function
|
|
390
|
+
function kp() {
|
|
391
391
|
if (Kc) return hs;
|
|
392
392
|
Kc = 1;
|
|
393
393
|
var r = ct(), e = r["__core-js_shared__"];
|
|
394
394
|
return hs = e, hs;
|
|
395
395
|
}
|
|
396
396
|
var ms, Yc;
|
|
397
|
-
function
|
|
397
|
+
function Ip() {
|
|
398
398
|
if (Yc) return ms;
|
|
399
399
|
Yc = 1;
|
|
400
|
-
var r =
|
|
400
|
+
var r = kp(), e = (function() {
|
|
401
401
|
var n = /[^.]+$/.exec(r && r.keys && r.keys.IE_PROTO || "");
|
|
402
402
|
return n ? "Symbol(src)_1." + n : "";
|
|
403
403
|
})();
|
|
@@ -407,7 +407,7 @@ function kp() {
|
|
|
407
407
|
return ms = t, ms;
|
|
408
408
|
}
|
|
409
409
|
var ps, Jc;
|
|
410
|
-
function
|
|
410
|
+
function Ad() {
|
|
411
411
|
if (Jc) return ps;
|
|
412
412
|
Jc = 1;
|
|
413
413
|
var r = Function.prototype, e = r.toString;
|
|
@@ -427,10 +427,10 @@ function kd() {
|
|
|
427
427
|
return ps = t, ps;
|
|
428
428
|
}
|
|
429
429
|
var ys, Qc;
|
|
430
|
-
function
|
|
430
|
+
function xp() {
|
|
431
431
|
if (Qc) return ys;
|
|
432
432
|
Qc = 1;
|
|
433
|
-
var r = Io(), e =
|
|
433
|
+
var r = Io(), e = Ip(), t = vt(), n = Ad(), 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.*?") + "$"
|
|
435
435
|
);
|
|
436
436
|
function f(d) {
|
|
@@ -442,7 +442,7 @@ function Ip() {
|
|
|
442
442
|
return ys = f, ys;
|
|
443
443
|
}
|
|
444
444
|
var gs, Xc;
|
|
445
|
-
function
|
|
445
|
+
function Np() {
|
|
446
446
|
if (Xc) return gs;
|
|
447
447
|
Xc = 1;
|
|
448
448
|
function r(e, t) {
|
|
@@ -454,7 +454,7 @@ var _s, el;
|
|
|
454
454
|
function Bt() {
|
|
455
455
|
if (el) return _s;
|
|
456
456
|
el = 1;
|
|
457
|
-
var r =
|
|
457
|
+
var r = xp(), e = Np();
|
|
458
458
|
function t(n, s) {
|
|
459
459
|
var i = e(n, s);
|
|
460
460
|
return r(i) ? i : void 0;
|
|
@@ -476,7 +476,7 @@ function xn() {
|
|
|
476
476
|
return ws = e, ws;
|
|
477
477
|
}
|
|
478
478
|
var bs, nl;
|
|
479
|
-
function
|
|
479
|
+
function Fp() {
|
|
480
480
|
if (nl) return bs;
|
|
481
481
|
nl = 1;
|
|
482
482
|
var r = xn();
|
|
@@ -486,7 +486,7 @@ function Np() {
|
|
|
486
486
|
return bs = e, bs;
|
|
487
487
|
}
|
|
488
488
|
var Os, sl;
|
|
489
|
-
function
|
|
489
|
+
function Dp() {
|
|
490
490
|
if (sl) return Os;
|
|
491
491
|
sl = 1;
|
|
492
492
|
function r(e) {
|
|
@@ -496,7 +496,7 @@ function Fp() {
|
|
|
496
496
|
return Os = r, Os;
|
|
497
497
|
}
|
|
498
498
|
var Es, il;
|
|
499
|
-
function
|
|
499
|
+
function Mp() {
|
|
500
500
|
if (il) return Es;
|
|
501
501
|
il = 1;
|
|
502
502
|
var r = xn(), e = "__lodash_hash_undefined__", t = Object.prototype, n = t.hasOwnProperty;
|
|
@@ -511,7 +511,7 @@ function Dp() {
|
|
|
511
511
|
return Es = s, Es;
|
|
512
512
|
}
|
|
513
513
|
var Ss, al;
|
|
514
|
-
function
|
|
514
|
+
function Pp() {
|
|
515
515
|
if (al) return Ss;
|
|
516
516
|
al = 1;
|
|
517
517
|
var r = xn(), e = Object.prototype, t = e.hasOwnProperty;
|
|
@@ -522,7 +522,7 @@ function Mp() {
|
|
|
522
522
|
return Ss = n, Ss;
|
|
523
523
|
}
|
|
524
524
|
var Ts, ol;
|
|
525
|
-
function
|
|
525
|
+
function qp() {
|
|
526
526
|
if (ol) return Ts;
|
|
527
527
|
ol = 1;
|
|
528
528
|
var r = xn(), e = "__lodash_hash_undefined__";
|
|
@@ -533,10 +533,10 @@ function Pp() {
|
|
|
533
533
|
return Ts = t, Ts;
|
|
534
534
|
}
|
|
535
535
|
var Rs, cl;
|
|
536
|
-
function
|
|
536
|
+
function Lp() {
|
|
537
537
|
if (cl) return Rs;
|
|
538
538
|
cl = 1;
|
|
539
|
-
var r =
|
|
539
|
+
var r = Fp(), e = Dp(), t = Mp(), n = Pp(), s = qp();
|
|
540
540
|
function i(a) {
|
|
541
541
|
var o = -1, c = a == null ? 0 : a.length;
|
|
542
542
|
for (this.clear(); ++o < c; ) {
|
|
@@ -547,10 +547,10 @@ function qp() {
|
|
|
547
547
|
return i.prototype.clear = r, i.prototype.delete = e, i.prototype.get = t, i.prototype.has = n, i.prototype.set = s, Rs = i, Rs;
|
|
548
548
|
}
|
|
549
549
|
var As, ll;
|
|
550
|
-
function
|
|
550
|
+
function $p() {
|
|
551
551
|
if (ll) return As;
|
|
552
552
|
ll = 1;
|
|
553
|
-
var r =
|
|
553
|
+
var r = Lp(), e = In(), t = xo();
|
|
554
554
|
function n() {
|
|
555
555
|
this.size = 0, this.__data__ = {
|
|
556
556
|
hash: new r(),
|
|
@@ -561,7 +561,7 @@ function Lp() {
|
|
|
561
561
|
return As = n, As;
|
|
562
562
|
}
|
|
563
563
|
var Cs, ul;
|
|
564
|
-
function
|
|
564
|
+
function jp() {
|
|
565
565
|
if (ul) return Cs;
|
|
566
566
|
ul = 1;
|
|
567
567
|
function r(e) {
|
|
@@ -574,7 +574,7 @@ var ks, fl;
|
|
|
574
574
|
function Nn() {
|
|
575
575
|
if (fl) return ks;
|
|
576
576
|
fl = 1;
|
|
577
|
-
var r =
|
|
577
|
+
var r = jp();
|
|
578
578
|
function e(t, n) {
|
|
579
579
|
var s = t.__data__;
|
|
580
580
|
return r(n) ? s[typeof n == "string" ? "string" : "hash"] : s.map;
|
|
@@ -582,7 +582,7 @@ function Nn() {
|
|
|
582
582
|
return ks = e, ks;
|
|
583
583
|
}
|
|
584
584
|
var Is, dl;
|
|
585
|
-
function
|
|
585
|
+
function Up() {
|
|
586
586
|
if (dl) return Is;
|
|
587
587
|
dl = 1;
|
|
588
588
|
var r = Nn();
|
|
@@ -593,7 +593,7 @@ function jp() {
|
|
|
593
593
|
return Is = e, Is;
|
|
594
594
|
}
|
|
595
595
|
var xs, hl;
|
|
596
|
-
function
|
|
596
|
+
function Vp() {
|
|
597
597
|
if (hl) return xs;
|
|
598
598
|
hl = 1;
|
|
599
599
|
var r = Nn();
|
|
@@ -603,7 +603,7 @@ function Up() {
|
|
|
603
603
|
return xs = e, xs;
|
|
604
604
|
}
|
|
605
605
|
var Ns, ml;
|
|
606
|
-
function
|
|
606
|
+
function Wp() {
|
|
607
607
|
if (ml) return Ns;
|
|
608
608
|
ml = 1;
|
|
609
609
|
var r = Nn();
|
|
@@ -613,7 +613,7 @@ function Vp() {
|
|
|
613
613
|
return Ns = e, Ns;
|
|
614
614
|
}
|
|
615
615
|
var Fs, pl;
|
|
616
|
-
function
|
|
616
|
+
function zp() {
|
|
617
617
|
if (pl) return Fs;
|
|
618
618
|
pl = 1;
|
|
619
619
|
var r = Nn();
|
|
@@ -627,7 +627,7 @@ var Ds, yl;
|
|
|
627
627
|
function No() {
|
|
628
628
|
if (yl) return Ds;
|
|
629
629
|
yl = 1;
|
|
630
|
-
var r =
|
|
630
|
+
var r = $p(), e = Up(), t = Vp(), n = Wp(), s = zp();
|
|
631
631
|
function i(a) {
|
|
632
632
|
var o = -1, c = a == null ? 0 : a.length;
|
|
633
633
|
for (this.clear(); ++o < c; ) {
|
|
@@ -638,7 +638,7 @@ function No() {
|
|
|
638
638
|
return i.prototype.clear = r, i.prototype.delete = e, i.prototype.get = t, i.prototype.has = n, i.prototype.set = s, Ds = i, Ds;
|
|
639
639
|
}
|
|
640
640
|
var Ms, gl;
|
|
641
|
-
function
|
|
641
|
+
function Bp() {
|
|
642
642
|
if (gl) return Ms;
|
|
643
643
|
gl = 1;
|
|
644
644
|
var r = In(), e = xo(), t = No(), n = 200;
|
|
@@ -658,7 +658,7 @@ var Ps, _l;
|
|
|
658
658
|
function Fo() {
|
|
659
659
|
if (_l) return Ps;
|
|
660
660
|
_l = 1;
|
|
661
|
-
var r = In(), e =
|
|
661
|
+
var r = In(), e = Ep(), t = Sp(), n = Tp(), s = Rp(), i = Bp();
|
|
662
662
|
function a(o) {
|
|
663
663
|
var c = this.__data__ = new r(o);
|
|
664
664
|
this.size = c.size;
|
|
@@ -666,7 +666,7 @@ function Fo() {
|
|
|
666
666
|
return a.prototype.clear = e, a.prototype.delete = t, a.prototype.get = n, a.prototype.has = s, a.prototype.set = i, Ps = a, Ps;
|
|
667
667
|
}
|
|
668
668
|
var qs, vl;
|
|
669
|
-
function
|
|
669
|
+
function Zp() {
|
|
670
670
|
if (vl) return qs;
|
|
671
671
|
vl = 1;
|
|
672
672
|
var r = "__lodash_hash_undefined__";
|
|
@@ -676,7 +676,7 @@ function Bp() {
|
|
|
676
676
|
return qs = e, qs;
|
|
677
677
|
}
|
|
678
678
|
var Ls, wl;
|
|
679
|
-
function
|
|
679
|
+
function Gp() {
|
|
680
680
|
if (wl) return Ls;
|
|
681
681
|
wl = 1;
|
|
682
682
|
function r(e) {
|
|
@@ -685,10 +685,10 @@ function Zp() {
|
|
|
685
685
|
return Ls = r, Ls;
|
|
686
686
|
}
|
|
687
687
|
var $s, bl;
|
|
688
|
-
function
|
|
688
|
+
function Hp() {
|
|
689
689
|
if (bl) return $s;
|
|
690
690
|
bl = 1;
|
|
691
|
-
var r = No(), e =
|
|
691
|
+
var r = No(), e = Zp(), t = Gp();
|
|
692
692
|
function n(s) {
|
|
693
693
|
var i = -1, a = s == null ? 0 : s.length;
|
|
694
694
|
for (this.__data__ = new r(); ++i < a; )
|
|
@@ -697,7 +697,7 @@ function Gp() {
|
|
|
697
697
|
return n.prototype.add = n.prototype.push = e, n.prototype.has = t, $s = n, $s;
|
|
698
698
|
}
|
|
699
699
|
var js, Ol;
|
|
700
|
-
function
|
|
700
|
+
function Kp() {
|
|
701
701
|
if (Ol) return js;
|
|
702
702
|
Ol = 1;
|
|
703
703
|
function r(e, t) {
|
|
@@ -709,7 +709,7 @@ function Hp() {
|
|
|
709
709
|
return js = r, js;
|
|
710
710
|
}
|
|
711
711
|
var Us, El;
|
|
712
|
-
function
|
|
712
|
+
function Yp() {
|
|
713
713
|
if (El) return Us;
|
|
714
714
|
El = 1;
|
|
715
715
|
function r(e, t) {
|
|
@@ -718,17 +718,17 @@ function Kp() {
|
|
|
718
718
|
return Us = r, Us;
|
|
719
719
|
}
|
|
720
720
|
var Vs, Sl;
|
|
721
|
-
function
|
|
721
|
+
function Cd() {
|
|
722
722
|
if (Sl) return Vs;
|
|
723
723
|
Sl = 1;
|
|
724
|
-
var r =
|
|
724
|
+
var r = Hp(), e = Kp(), t = Yp(), n = 1, s = 2;
|
|
725
725
|
function i(a, o, c, l, u, f) {
|
|
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 v = f.get(a),
|
|
730
|
-
if (v &&
|
|
731
|
-
return v == o &&
|
|
729
|
+
var v = f.get(a), y = f.get(o);
|
|
730
|
+
if (v && y)
|
|
731
|
+
return v == o && y == a;
|
|
732
732
|
var O = -1, R = !0, C = c & s ? new r() : void 0;
|
|
733
733
|
for (f.set(a, o), f.set(o, a); ++O < h; ) {
|
|
734
734
|
var w = a[O], E = o[O];
|
|
@@ -741,9 +741,9 @@ function Id() {
|
|
|
741
741
|
break;
|
|
742
742
|
}
|
|
743
743
|
if (C) {
|
|
744
|
-
if (!e(o, function(T,
|
|
745
|
-
if (!t(C,
|
|
746
|
-
return C.push(
|
|
744
|
+
if (!e(o, function(T, g) {
|
|
745
|
+
if (!t(C, g) && (w === T || u(w, T, c, l, f)))
|
|
746
|
+
return C.push(g);
|
|
747
747
|
})) {
|
|
748
748
|
R = !1;
|
|
749
749
|
break;
|
|
@@ -758,14 +758,14 @@ function Id() {
|
|
|
758
758
|
return Vs = i, Vs;
|
|
759
759
|
}
|
|
760
760
|
var Ws, Tl;
|
|
761
|
-
function
|
|
761
|
+
function kd() {
|
|
762
762
|
if (Tl) return Ws;
|
|
763
763
|
Tl = 1;
|
|
764
764
|
var r = ct(), e = r.Uint8Array;
|
|
765
765
|
return Ws = e, Ws;
|
|
766
766
|
}
|
|
767
767
|
var zs, Rl;
|
|
768
|
-
function
|
|
768
|
+
function Jp() {
|
|
769
769
|
if (Rl) return zs;
|
|
770
770
|
Rl = 1;
|
|
771
771
|
function r(e) {
|
|
@@ -777,7 +777,7 @@ function Yp() {
|
|
|
777
777
|
return zs = r, zs;
|
|
778
778
|
}
|
|
779
779
|
var Bs, Al;
|
|
780
|
-
function
|
|
780
|
+
function Qp() {
|
|
781
781
|
if (Al) return Bs;
|
|
782
782
|
Al = 1;
|
|
783
783
|
function r(e) {
|
|
@@ -789,12 +789,12 @@ function Jp() {
|
|
|
789
789
|
return Bs = r, Bs;
|
|
790
790
|
}
|
|
791
791
|
var Zs, Cl;
|
|
792
|
-
function
|
|
792
|
+
function Xp() {
|
|
793
793
|
if (Cl) return Zs;
|
|
794
794
|
Cl = 1;
|
|
795
|
-
var r = Ur(), e =
|
|
796
|
-
function E(I, T,
|
|
797
|
-
switch (
|
|
795
|
+
var r = Ur(), e = kd(), t = jr(), n = Cd(), s = Jp(), i = Qp(), 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]", v = "[object String]", y = "[object Symbol]", O = "[object ArrayBuffer]", R = "[object DataView]", C = r ? r.prototype : void 0, w = C ? C.valueOf : void 0;
|
|
796
|
+
function E(I, T, g, N, _, A, b) {
|
|
797
|
+
switch (g) {
|
|
798
798
|
case R:
|
|
799
799
|
if (I.byteLength != T.byteLength || I.byteOffset != T.byteOffset)
|
|
800
800
|
return !1;
|
|
@@ -820,9 +820,9 @@ function Qp() {
|
|
|
820
820
|
if (k)
|
|
821
821
|
return k == T;
|
|
822
822
|
N |= o, b.set(I, T);
|
|
823
|
-
var D = n(m(I), m(T), N,
|
|
823
|
+
var D = n(m(I), m(T), N, _, A, b);
|
|
824
824
|
return b.delete(I), D;
|
|
825
|
-
case
|
|
825
|
+
case y:
|
|
826
826
|
if (w)
|
|
827
827
|
return w.call(I) == w.call(T);
|
|
828
828
|
}
|
|
@@ -831,7 +831,7 @@ function Qp() {
|
|
|
831
831
|
return Zs = E, Zs;
|
|
832
832
|
}
|
|
833
833
|
var Gs, kl;
|
|
834
|
-
function
|
|
834
|
+
function Id() {
|
|
835
835
|
if (kl) return Gs;
|
|
836
836
|
kl = 1;
|
|
837
837
|
function r(e, t) {
|
|
@@ -849,10 +849,10 @@ function Dt() {
|
|
|
849
849
|
return Hs = r, Hs;
|
|
850
850
|
}
|
|
851
851
|
var Ks, xl;
|
|
852
|
-
function
|
|
852
|
+
function xd() {
|
|
853
853
|
if (xl) return Ks;
|
|
854
854
|
xl = 1;
|
|
855
|
-
var r =
|
|
855
|
+
var r = Id(), e = Dt();
|
|
856
856
|
function t(n, s, i) {
|
|
857
857
|
var a = s(n);
|
|
858
858
|
return e(n) ? a : r(a, i(n));
|
|
@@ -860,7 +860,7 @@ function Fd() {
|
|
|
860
860
|
return Ks = t, Ks;
|
|
861
861
|
}
|
|
862
862
|
var Ys, Nl;
|
|
863
|
-
function
|
|
863
|
+
function ey() {
|
|
864
864
|
if (Nl) return Ys;
|
|
865
865
|
Nl = 1;
|
|
866
866
|
function r(e, t) {
|
|
@@ -873,7 +873,7 @@ function Xp() {
|
|
|
873
873
|
return Ys = r, Ys;
|
|
874
874
|
}
|
|
875
875
|
var Js, Fl;
|
|
876
|
-
function
|
|
876
|
+
function Nd() {
|
|
877
877
|
if (Fl) return Js;
|
|
878
878
|
Fl = 1;
|
|
879
879
|
function r() {
|
|
@@ -885,7 +885,7 @@ var Qs, Dl;
|
|
|
885
885
|
function Do() {
|
|
886
886
|
if (Dl) return Qs;
|
|
887
887
|
Dl = 1;
|
|
888
|
-
var r =
|
|
888
|
+
var r = ey(), e = Nd(), t = Object.prototype, n = t.propertyIsEnumerable, s = Object.getOwnPropertySymbols, i = s ? function(a) {
|
|
889
889
|
return a == null ? [] : (a = Object(a), r(s(a), function(o) {
|
|
890
890
|
return n.call(a, o);
|
|
891
891
|
}));
|
|
@@ -893,7 +893,7 @@ function Do() {
|
|
|
893
893
|
return Qs = i, Qs;
|
|
894
894
|
}
|
|
895
895
|
var Xs, Ml;
|
|
896
|
-
function
|
|
896
|
+
function ty() {
|
|
897
897
|
if (Ml) return Xs;
|
|
898
898
|
Ml = 1;
|
|
899
899
|
function r(e, t) {
|
|
@@ -913,7 +913,7 @@ function wt() {
|
|
|
913
913
|
return ei = r, ei;
|
|
914
914
|
}
|
|
915
915
|
var ti, ql;
|
|
916
|
-
function
|
|
916
|
+
function ry() {
|
|
917
917
|
if (ql) return ti;
|
|
918
918
|
ql = 1;
|
|
919
919
|
var r = hr(), e = wt(), t = "[object Arguments]";
|
|
@@ -923,10 +923,10 @@ function ty() {
|
|
|
923
923
|
return ti = n, ti;
|
|
924
924
|
}
|
|
925
925
|
var ri, Ll;
|
|
926
|
-
function
|
|
926
|
+
function Fd() {
|
|
927
927
|
if (Ll) return ri;
|
|
928
928
|
Ll = 1;
|
|
929
|
-
var r =
|
|
929
|
+
var r = ry(), e = wt(), t = Object.prototype, n = t.hasOwnProperty, s = t.propertyIsEnumerable, i = r(/* @__PURE__ */ (function() {
|
|
930
930
|
return arguments;
|
|
931
931
|
})()) ? r : function(a) {
|
|
932
932
|
return e(a) && n.call(a, "callee") && !s.call(a, "callee");
|
|
@@ -934,7 +934,7 @@ function Md() {
|
|
|
934
934
|
return ri = i, ri;
|
|
935
935
|
}
|
|
936
936
|
var br = { exports: {} }, ni, $l;
|
|
937
|
-
function
|
|
937
|
+
function ny() {
|
|
938
938
|
if ($l) return ni;
|
|
939
939
|
$l = 1;
|
|
940
940
|
function r() {
|
|
@@ -946,7 +946,7 @@ br.exports;
|
|
|
946
946
|
var jl;
|
|
947
947
|
function Fn() {
|
|
948
948
|
return jl || (jl = 1, (function(r, e) {
|
|
949
|
-
var t = ct(), n =
|
|
949
|
+
var t = ct(), n = ny(), 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
|
})(br, br.exports)), br.exports;
|
|
952
952
|
}
|
|
@@ -962,7 +962,7 @@ function Mo() {
|
|
|
962
962
|
return si = t, si;
|
|
963
963
|
}
|
|
964
964
|
var ii, Vl;
|
|
965
|
-
function
|
|
965
|
+
function Dd() {
|
|
966
966
|
if (Vl) return ii;
|
|
967
967
|
Vl = 1;
|
|
968
968
|
var r = 9007199254740991;
|
|
@@ -972,11 +972,11 @@ function Pd() {
|
|
|
972
972
|
return ii = e, ii;
|
|
973
973
|
}
|
|
974
974
|
var ai, Wl;
|
|
975
|
-
function
|
|
975
|
+
function sy() {
|
|
976
976
|
if (Wl) return ai;
|
|
977
977
|
Wl = 1;
|
|
978
|
-
var r = hr(), e =
|
|
979
|
-
A[R] = A[C] = A[w] = A[E] = A[I] = A[T] = A[
|
|
978
|
+
var r = hr(), e = Dd(), t = wt(), 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]", v = "[object WeakMap]", y = "[object ArrayBuffer]", O = "[object DataView]", R = "[object Float32Array]", C = "[object Float64Array]", w = "[object Int8Array]", E = "[object Int16Array]", I = "[object Int32Array]", T = "[object Uint8Array]", g = "[object Uint8ClampedArray]", N = "[object Uint16Array]", _ = "[object Uint32Array]", A = {};
|
|
979
|
+
A[R] = A[C] = A[w] = A[E] = A[I] = A[T] = A[g] = A[N] = A[_] = !0, A[n] = A[s] = A[y] = A[i] = A[O] = A[a] = A[o] = A[c] = A[l] = A[u] = A[f] = A[d] = A[h] = A[p] = A[v] = !1;
|
|
980
980
|
function b(m) {
|
|
981
981
|
return t(m) && e(m.length) && !!A[r(m)];
|
|
982
982
|
}
|
|
@@ -998,7 +998,7 @@ Or.exports;
|
|
|
998
998
|
var Bl;
|
|
999
999
|
function qo() {
|
|
1000
1000
|
return Bl || (Bl = 1, (function(r, e) {
|
|
1001
|
-
var t =
|
|
1001
|
+
var t = Rd(), n = e && !e.nodeType && e, s = n && !0 && r && !r.nodeType && r, i = s && s.exports === n, a = i && t.process, o = (function() {
|
|
1002
1002
|
try {
|
|
1003
1003
|
var c = s && s.require && s.require("util").types;
|
|
1004
1004
|
return c || a && a.binding && a.binding("util");
|
|
@@ -1012,23 +1012,23 @@ var ci, Zl;
|
|
|
1012
1012
|
function Lo() {
|
|
1013
1013
|
if (Zl) return ci;
|
|
1014
1014
|
Zl = 1;
|
|
1015
|
-
var r =
|
|
1015
|
+
var r = sy(), e = Po(), t = qo(), n = t && t.isTypedArray, s = n ? e(n) : r;
|
|
1016
1016
|
return ci = s, ci;
|
|
1017
1017
|
}
|
|
1018
1018
|
var li, Gl;
|
|
1019
|
-
function
|
|
1019
|
+
function Md() {
|
|
1020
1020
|
if (Gl) return li;
|
|
1021
1021
|
Gl = 1;
|
|
1022
|
-
var r =
|
|
1022
|
+
var r = ty(), e = Fd(), t = Dt(), n = Fn(), s = Mo(), i = Lo(), 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), v = f || d || h || p,
|
|
1024
|
+
var f = t(l), d = !f && e(l), h = !f && !d && n(l), p = !f && !d && !h && i(l), v = f || d || h || p, y = v ? r(l.length, String) : [], O = y.length;
|
|
1025
1025
|
for (var R in l)
|
|
1026
1026
|
(u || o.call(l, R)) && !(v && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1027
1027
|
(R == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1028
1028
|
h && (R == "offset" || R == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1029
1029
|
p && (R == "buffer" || R == "byteLength" || R == "byteOffset") || // Skip index properties.
|
|
1030
|
-
s(R, O))) &&
|
|
1031
|
-
return
|
|
1030
|
+
s(R, O))) && y.push(R);
|
|
1031
|
+
return y;
|
|
1032
1032
|
}
|
|
1033
1033
|
return li = c, li;
|
|
1034
1034
|
}
|
|
@@ -1044,7 +1044,7 @@ function $o() {
|
|
|
1044
1044
|
return ui = e, ui;
|
|
1045
1045
|
}
|
|
1046
1046
|
var fi, Kl;
|
|
1047
|
-
function
|
|
1047
|
+
function Pd() {
|
|
1048
1048
|
if (Kl) return fi;
|
|
1049
1049
|
Kl = 1;
|
|
1050
1050
|
function r(e, t) {
|
|
@@ -1055,17 +1055,17 @@ function Ld() {
|
|
|
1055
1055
|
return fi = r, fi;
|
|
1056
1056
|
}
|
|
1057
1057
|
var di, Yl;
|
|
1058
|
-
function
|
|
1058
|
+
function iy() {
|
|
1059
1059
|
if (Yl) return di;
|
|
1060
1060
|
Yl = 1;
|
|
1061
|
-
var r =
|
|
1061
|
+
var r = Pd(), e = r(Object.keys, Object);
|
|
1062
1062
|
return di = e, di;
|
|
1063
1063
|
}
|
|
1064
1064
|
var hi, Jl;
|
|
1065
|
-
function
|
|
1065
|
+
function ay() {
|
|
1066
1066
|
if (Jl) return hi;
|
|
1067
1067
|
Jl = 1;
|
|
1068
|
-
var r = $o(), e =
|
|
1068
|
+
var r = $o(), e = iy(), t = Object.prototype, n = t.hasOwnProperty;
|
|
1069
1069
|
function s(i) {
|
|
1070
1070
|
if (!r(i))
|
|
1071
1071
|
return e(i);
|
|
@@ -1080,7 +1080,7 @@ var mi, Ql;
|
|
|
1080
1080
|
function Dn() {
|
|
1081
1081
|
if (Ql) return mi;
|
|
1082
1082
|
Ql = 1;
|
|
1083
|
-
var r = Io(), e =
|
|
1083
|
+
var r = Io(), e = Dd();
|
|
1084
1084
|
function t(n) {
|
|
1085
1085
|
return n != null && e(n.length) && !r(n);
|
|
1086
1086
|
}
|
|
@@ -1090,33 +1090,33 @@ var pi, Xl;
|
|
|
1090
1090
|
function jo() {
|
|
1091
1091
|
if (Xl) return pi;
|
|
1092
1092
|
Xl = 1;
|
|
1093
|
-
var r =
|
|
1093
|
+
var r = Md(), e = ay(), t = Dn();
|
|
1094
1094
|
function n(s) {
|
|
1095
1095
|
return t(s) ? r(s) : e(s);
|
|
1096
1096
|
}
|
|
1097
1097
|
return pi = n, pi;
|
|
1098
1098
|
}
|
|
1099
1099
|
var yi, eu;
|
|
1100
|
-
function
|
|
1100
|
+
function qd() {
|
|
1101
1101
|
if (eu) return yi;
|
|
1102
1102
|
eu = 1;
|
|
1103
|
-
var r =
|
|
1103
|
+
var r = xd(), e = Do(), t = jo();
|
|
1104
1104
|
function n(s) {
|
|
1105
1105
|
return r(s, t, e);
|
|
1106
1106
|
}
|
|
1107
1107
|
return yi = n, yi;
|
|
1108
1108
|
}
|
|
1109
1109
|
var gi, tu;
|
|
1110
|
-
function
|
|
1110
|
+
function oy() {
|
|
1111
1111
|
if (tu) return gi;
|
|
1112
1112
|
tu = 1;
|
|
1113
|
-
var r =
|
|
1113
|
+
var r = qd(), e = 1, t = Object.prototype, n = t.hasOwnProperty;
|
|
1114
1114
|
function s(i, a, o, c, l, u) {
|
|
1115
1115
|
var f = o & e, d = r(i), h = d.length, p = r(a), v = p.length;
|
|
1116
1116
|
if (h != v && !f)
|
|
1117
1117
|
return !1;
|
|
1118
|
-
for (var
|
|
1119
|
-
var O = d[
|
|
1118
|
+
for (var y = h; y--; ) {
|
|
1119
|
+
var O = d[y];
|
|
1120
1120
|
if (!(f ? O in a : n.call(a, O)))
|
|
1121
1121
|
return !1;
|
|
1122
1122
|
}
|
|
@@ -1125,48 +1125,48 @@ function ay() {
|
|
|
1125
1125
|
return R == a && C == i;
|
|
1126
1126
|
var w = !0;
|
|
1127
1127
|
u.set(i, a), u.set(a, i);
|
|
1128
|
-
for (var E = f; ++
|
|
1129
|
-
O = d[
|
|
1128
|
+
for (var E = f; ++y < h; ) {
|
|
1129
|
+
O = d[y];
|
|
1130
1130
|
var I = i[O], T = a[O];
|
|
1131
1131
|
if (c)
|
|
1132
|
-
var
|
|
1133
|
-
if (!(
|
|
1132
|
+
var g = f ? c(T, I, O, a, i, u) : c(I, T, O, i, a, u);
|
|
1133
|
+
if (!(g === void 0 ? I === T || l(I, T, o, c, u) : g)) {
|
|
1134
1134
|
w = !1;
|
|
1135
1135
|
break;
|
|
1136
1136
|
}
|
|
1137
1137
|
E || (E = O == "constructor");
|
|
1138
1138
|
}
|
|
1139
1139
|
if (w && !E) {
|
|
1140
|
-
var N = i.constructor,
|
|
1141
|
-
N !=
|
|
1140
|
+
var N = i.constructor, _ = a.constructor;
|
|
1141
|
+
N != _ && "constructor" in i && "constructor" in a && !(typeof N == "function" && N instanceof N && typeof _ == "function" && _ instanceof _) && (w = !1);
|
|
1142
1142
|
}
|
|
1143
1143
|
return u.delete(i), u.delete(a), w;
|
|
1144
1144
|
}
|
|
1145
1145
|
return gi = s, gi;
|
|
1146
1146
|
}
|
|
1147
1147
|
var _i, ru;
|
|
1148
|
-
function
|
|
1148
|
+
function cy() {
|
|
1149
1149
|
if (ru) return _i;
|
|
1150
1150
|
ru = 1;
|
|
1151
1151
|
var r = Bt(), e = ct(), t = r(e, "DataView");
|
|
1152
1152
|
return _i = t, _i;
|
|
1153
1153
|
}
|
|
1154
1154
|
var vi, nu;
|
|
1155
|
-
function
|
|
1155
|
+
function ly() {
|
|
1156
1156
|
if (nu) return vi;
|
|
1157
1157
|
nu = 1;
|
|
1158
1158
|
var r = Bt(), e = ct(), t = r(e, "Promise");
|
|
1159
1159
|
return vi = t, vi;
|
|
1160
1160
|
}
|
|
1161
1161
|
var wi, su;
|
|
1162
|
-
function
|
|
1162
|
+
function uy() {
|
|
1163
1163
|
if (su) return wi;
|
|
1164
1164
|
su = 1;
|
|
1165
1165
|
var r = Bt(), e = ct(), t = r(e, "Set");
|
|
1166
1166
|
return wi = t, wi;
|
|
1167
1167
|
}
|
|
1168
1168
|
var bi, iu;
|
|
1169
|
-
function
|
|
1169
|
+
function fy() {
|
|
1170
1170
|
if (iu) return bi;
|
|
1171
1171
|
iu = 1;
|
|
1172
1172
|
var r = Bt(), e = ct(), t = r(e, "WeakMap");
|
|
@@ -1176,7 +1176,7 @@ var Oi, au;
|
|
|
1176
1176
|
function Mn() {
|
|
1177
1177
|
if (au) return Oi;
|
|
1178
1178
|
au = 1;
|
|
1179
|
-
var r =
|
|
1179
|
+
var r = cy(), e = xo(), t = ly(), n = uy(), s = fy(), i = hr(), a = Ad(), o = "[object Map]", c = "[object Object]", l = "[object Promise]", u = "[object Set]", f = "[object WeakMap]", d = "[object DataView]", h = a(r), p = a(e), v = a(t), y = a(n), O = a(s), R = i;
|
|
1180
1180
|
return (r && R(new r(new ArrayBuffer(1))) != d || e && R(new e()) != o || t && R(t.resolve()) != l || n && R(new n()) != u || s && R(new s()) != f) && (R = function(C) {
|
|
1181
1181
|
var w = i(C), E = w == c ? C.constructor : void 0, I = E ? a(E) : "";
|
|
1182
1182
|
if (I)
|
|
@@ -1187,7 +1187,7 @@ function Mn() {
|
|
|
1187
1187
|
return o;
|
|
1188
1188
|
case v:
|
|
1189
1189
|
return l;
|
|
1190
|
-
case
|
|
1190
|
+
case y:
|
|
1191
1191
|
return u;
|
|
1192
1192
|
case O:
|
|
1193
1193
|
return f;
|
|
@@ -1196,65 +1196,65 @@ function Mn() {
|
|
|
1196
1196
|
}), Oi = R, Oi;
|
|
1197
1197
|
}
|
|
1198
1198
|
var Ei, ou;
|
|
1199
|
-
function
|
|
1199
|
+
function dy() {
|
|
1200
1200
|
if (ou) return Ei;
|
|
1201
1201
|
ou = 1;
|
|
1202
|
-
var r = Fo(), e =
|
|
1203
|
-
function p(v,
|
|
1204
|
-
var E = i(v), I = i(
|
|
1205
|
-
T = T == l ? f : T,
|
|
1206
|
-
var N = T == f,
|
|
1202
|
+
var r = Fo(), e = Cd(), t = Xp(), n = oy(), s = Mn(), i = Dt(), a = Fn(), o = Lo(), c = 1, l = "[object Arguments]", u = "[object Array]", f = "[object Object]", d = Object.prototype, h = d.hasOwnProperty;
|
|
1203
|
+
function p(v, y, O, R, C, w) {
|
|
1204
|
+
var E = i(v), I = i(y), T = E ? u : s(v), g = I ? u : s(y);
|
|
1205
|
+
T = T == l ? f : T, g = g == l ? f : g;
|
|
1206
|
+
var N = T == f, _ = g == f, A = T == g;
|
|
1207
1207
|
if (A && a(v)) {
|
|
1208
|
-
if (!a(
|
|
1208
|
+
if (!a(y))
|
|
1209
1209
|
return !1;
|
|
1210
1210
|
E = !0, N = !1;
|
|
1211
1211
|
}
|
|
1212
1212
|
if (A && !N)
|
|
1213
|
-
return w || (w = new r()), E || o(v) ? e(v,
|
|
1213
|
+
return w || (w = new r()), E || o(v) ? e(v, y, O, R, C, w) : t(v, y, T, O, R, C, w);
|
|
1214
1214
|
if (!(O & c)) {
|
|
1215
|
-
var b = N && h.call(v, "__wrapped__"), m =
|
|
1215
|
+
var b = N && h.call(v, "__wrapped__"), m = _ && h.call(y, "__wrapped__");
|
|
1216
1216
|
if (b || m) {
|
|
1217
|
-
var S = b ? v.value() : v, k = m ?
|
|
1217
|
+
var S = b ? v.value() : v, k = m ? y.value() : y;
|
|
1218
1218
|
return w || (w = new r()), C(S, k, O, R, w);
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
|
-
return A ? (w || (w = new r()), n(v,
|
|
1221
|
+
return A ? (w || (w = new r()), n(v, y, O, R, C, w)) : !1;
|
|
1222
1222
|
}
|
|
1223
1223
|
return Ei = p, Ei;
|
|
1224
1224
|
}
|
|
1225
1225
|
var Si, cu;
|
|
1226
|
-
function
|
|
1226
|
+
function hy() {
|
|
1227
1227
|
if (cu) return Si;
|
|
1228
1228
|
cu = 1;
|
|
1229
|
-
var r =
|
|
1229
|
+
var r = dy(), e = wt();
|
|
1230
1230
|
function t(n, s, i, a, o) {
|
|
1231
1231
|
return n === s ? !0 : n == null || s == null || !e(n) && !e(s) ? n !== n && s !== s : r(n, s, i, a, t, o);
|
|
1232
1232
|
}
|
|
1233
1233
|
return Si = t, Si;
|
|
1234
1234
|
}
|
|
1235
1235
|
var Ti, lu;
|
|
1236
|
-
function
|
|
1236
|
+
function my() {
|
|
1237
1237
|
if (lu) return Ti;
|
|
1238
1238
|
lu = 1;
|
|
1239
|
-
var r =
|
|
1239
|
+
var r = hy();
|
|
1240
1240
|
function e(t, n) {
|
|
1241
1241
|
return r(t, n);
|
|
1242
1242
|
}
|
|
1243
1243
|
return Ti = e, Ti;
|
|
1244
1244
|
}
|
|
1245
|
-
var
|
|
1246
|
-
const
|
|
1245
|
+
var py = my();
|
|
1246
|
+
const yy = /* @__PURE__ */ Cn(py), gy = (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);
|
|
1250
1250
|
return h?.length && !h.some((p) => p.recordRole === s) ? (d = `User ${n} does not have write access to record with role ${s}`, f = !1, f) : (u?.forEach((p) => {
|
|
1251
1251
|
n === p.userRole && p.recordRole;
|
|
1252
1252
|
}), d && console.error(`PERMISSION_DENIED: ${d}`), f);
|
|
1253
|
-
},
|
|
1253
|
+
}, _y = (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 || !
|
|
1257
|
-
},
|
|
1256
|
+
return (!e.Role || i && (!a?.Role || !gy(r, n, s, a.Role, e.Role) || i === e.User_ID)) && (d = !1), d;
|
|
1257
|
+
}, vy = (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)
|
|
@@ -1263,14 +1263,14 @@ const py = /* @__PURE__ */ Cn(my), yy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1263
1263
|
!un("Create", t, n, s, i, r) && (u = !1), t.auth;
|
|
1264
1264
|
for (const f of c) {
|
|
1265
1265
|
const d = r[f.name];
|
|
1266
|
-
f.access && !Rn(f, i) && d !== void 0 && (u = !1), d !== void 0 && !
|
|
1266
|
+
f.access && !Rn(f, i) && d !== void 0 && (u = !1), d !== void 0 && !pp(f, i) && (u = !1);
|
|
1267
1267
|
}
|
|
1268
1268
|
if (!u)
|
|
1269
1269
|
throw new Error("PERMISSION_DENIED");
|
|
1270
1270
|
}, sr = (r) => r && (r._methodName === "deleteField" || r.constructor.name === "DeleteTransform"), tr = (r) => {
|
|
1271
1271
|
for (const e in r)
|
|
1272
1272
|
Object.prototype.hasOwnProperty.call(r, e) && (sr(r[e]) ? delete r[e] : typeof r[e] == "object" && r[e] !== null && tr(r[e]));
|
|
1273
|
-
},
|
|
1273
|
+
}, wy = (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
1276
|
let p = !0, v = "";
|
|
@@ -1279,20 +1279,20 @@ const py = /* @__PURE__ */ Cn(my), yy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1279
1279
|
i && !_t("Update", d) && (p = !1, v = "Authenticated user does not have Update access to this collection"), i && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1280
1280
|
(!un("Update", n, s, i, a, e) || // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1281
1281
|
!un("Update", n, s, i, a, h)) && (p = !1, v = "Authenticated user does not have Update access to this document");
|
|
1282
|
-
for (const
|
|
1283
|
-
const O = r[
|
|
1284
|
-
|
|
1282
|
+
for (const y of f) {
|
|
1283
|
+
const O = r[y.name];
|
|
1284
|
+
y.access && !Rn(y, a) && O !== void 0 && (v = `Authenticated user does not have access to field ${y.name}`, p = !1), O !== void 0 && !yp(y, a) && (v = `Authenticated user does not have Update access to field ${y.name}`, p = !1);
|
|
1285
1285
|
}
|
|
1286
1286
|
if (!p)
|
|
1287
1287
|
throw v && console.error(`PERMISSION_DENIED: ${v}`), new Error("PERMISSION_DENIED");
|
|
1288
|
-
},
|
|
1288
|
+
}, by = (r, e, t, n, s, i) => {
|
|
1289
1289
|
const { labels: a } = t, o = i.collections?.[a.collection];
|
|
1290
1290
|
let c = !0;
|
|
1291
1291
|
if (!o)
|
|
1292
1292
|
throw new Error("PERMISSION_DENIED");
|
|
1293
|
-
if (_t("Delete", o) || (c = !1), un("Delete", t, n, s, i, r) || (c = !1), t.auth && r.User_ID && (
|
|
1293
|
+
if (_t("Delete", o) || (c = !1), un("Delete", t, n, s, i, r) || (c = !1), t.auth && r.User_ID && (mp(o) || (c = !1), _y("delete", r, e, t, n, s, i) || (c = !1)), !c)
|
|
1294
1294
|
throw new Error("PERMISSION_DENIED");
|
|
1295
|
-
},
|
|
1295
|
+
}, Ld = (r, e, t) => {
|
|
1296
1296
|
const { access: n } = e, { entityRestrictions: s } = n;
|
|
1297
1297
|
if (s?.restrictions) {
|
|
1298
1298
|
for (const i of s.restrictions)
|
|
@@ -1303,7 +1303,7 @@ const py = /* @__PURE__ */ Cn(my), yy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1303
1303
|
for (const i of s.parentFilters) {
|
|
1304
1304
|
if (!i.roles.some((l) => l.role === r))
|
|
1305
1305
|
continue;
|
|
1306
|
-
const a =
|
|
1306
|
+
const a = re(e.fields, i.collectionField);
|
|
1307
1307
|
if (!_e(a))
|
|
1308
1308
|
throw new Error("PERMISSION_DENIED");
|
|
1309
1309
|
const c = t.collections[a.collection].access.entityRestrictions?.restrictions?.find((l) => l.type === i.type && l.roles.some((u) => u.role === r));
|
|
@@ -1315,7 +1315,7 @@ const py = /* @__PURE__ */ Cn(my), yy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1315
1315
|
return `${i.type} parent filter`;
|
|
1316
1316
|
}
|
|
1317
1317
|
return !0;
|
|
1318
|
-
},
|
|
1318
|
+
}, Oy = (r, e, t, n, s) => {
|
|
1319
1319
|
const i = {};
|
|
1320
1320
|
for (const a of r) {
|
|
1321
1321
|
const c = e[a].default(t, n, s);
|
|
@@ -1327,9 +1327,9 @@ const py = /* @__PURE__ */ Cn(my), yy = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1327
1327
|
i[a] = c;
|
|
1328
1328
|
}
|
|
1329
1329
|
return i;
|
|
1330
|
-
},
|
|
1330
|
+
}, Ey = (r, e) => e.fields.filter((t) => t.name === r.name)[0];
|
|
1331
1331
|
var Ri, uu;
|
|
1332
|
-
function
|
|
1332
|
+
function $d() {
|
|
1333
1333
|
if (uu) return Ri;
|
|
1334
1334
|
uu = 1;
|
|
1335
1335
|
var r = Bt(), e = (function() {
|
|
@@ -1345,7 +1345,7 @@ var Ai, fu;
|
|
|
1345
1345
|
function Uo() {
|
|
1346
1346
|
if (fu) return Ai;
|
|
1347
1347
|
fu = 1;
|
|
1348
|
-
var r =
|
|
1348
|
+
var r = $d();
|
|
1349
1349
|
function e(t, n, s) {
|
|
1350
1350
|
n == "__proto__" && r ? r(t, n, {
|
|
1351
1351
|
configurable: !0,
|
|
@@ -1357,7 +1357,7 @@ function Uo() {
|
|
|
1357
1357
|
return Ai = e, Ai;
|
|
1358
1358
|
}
|
|
1359
1359
|
var Ci, du;
|
|
1360
|
-
function
|
|
1360
|
+
function jd() {
|
|
1361
1361
|
if (du) return Ci;
|
|
1362
1362
|
du = 1;
|
|
1363
1363
|
var r = Uo(), e = jr();
|
|
@@ -1367,7 +1367,7 @@ function Vd() {
|
|
|
1367
1367
|
return Ci = t, Ci;
|
|
1368
1368
|
}
|
|
1369
1369
|
var ki, hu;
|
|
1370
|
-
function
|
|
1370
|
+
function Sy() {
|
|
1371
1371
|
if (hu) return ki;
|
|
1372
1372
|
hu = 1;
|
|
1373
1373
|
function r(e) {
|
|
@@ -1383,16 +1383,16 @@ function Ey() {
|
|
|
1383
1383
|
return ki = r, ki;
|
|
1384
1384
|
}
|
|
1385
1385
|
var Ii, mu;
|
|
1386
|
-
function
|
|
1386
|
+
function Ty() {
|
|
1387
1387
|
if (mu) return Ii;
|
|
1388
1388
|
mu = 1;
|
|
1389
|
-
var r =
|
|
1389
|
+
var r = Sy(), e = r();
|
|
1390
1390
|
return Ii = e, Ii;
|
|
1391
1391
|
}
|
|
1392
1392
|
var Er = { exports: {} };
|
|
1393
1393
|
Er.exports;
|
|
1394
1394
|
var pu;
|
|
1395
|
-
function
|
|
1395
|
+
function Ud() {
|
|
1396
1396
|
return pu || (pu = 1, (function(r, e) {
|
|
1397
1397
|
var t = ct(), 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
1398
|
function c(l, u) {
|
|
@@ -1408,7 +1408,7 @@ var xi, yu;
|
|
|
1408
1408
|
function Vo() {
|
|
1409
1409
|
if (yu) return xi;
|
|
1410
1410
|
yu = 1;
|
|
1411
|
-
var r =
|
|
1411
|
+
var r = kd();
|
|
1412
1412
|
function e(t) {
|
|
1413
1413
|
var n = new t.constructor(t.byteLength);
|
|
1414
1414
|
return new r(n).set(new r(t)), n;
|
|
@@ -1416,7 +1416,7 @@ function Vo() {
|
|
|
1416
1416
|
return xi = e, xi;
|
|
1417
1417
|
}
|
|
1418
1418
|
var Ni, gu;
|
|
1419
|
-
function
|
|
1419
|
+
function Vd() {
|
|
1420
1420
|
if (gu) return Ni;
|
|
1421
1421
|
gu = 1;
|
|
1422
1422
|
var r = Vo();
|
|
@@ -1427,7 +1427,7 @@ function zd() {
|
|
|
1427
1427
|
return Ni = e, Ni;
|
|
1428
1428
|
}
|
|
1429
1429
|
var Fi, _u;
|
|
1430
|
-
function
|
|
1430
|
+
function Wd() {
|
|
1431
1431
|
if (_u) return Fi;
|
|
1432
1432
|
_u = 1;
|
|
1433
1433
|
function r(e, t) {
|
|
@@ -1439,7 +1439,7 @@ function Bd() {
|
|
|
1439
1439
|
return Fi = r, Fi;
|
|
1440
1440
|
}
|
|
1441
1441
|
var Di, vu;
|
|
1442
|
-
function
|
|
1442
|
+
function Ry() {
|
|
1443
1443
|
if (vu) return Di;
|
|
1444
1444
|
vu = 1;
|
|
1445
1445
|
var r = vt(), e = Object.create, t = /* @__PURE__ */ (function() {
|
|
@@ -1461,21 +1461,21 @@ var Mi, wu;
|
|
|
1461
1461
|
function Wo() {
|
|
1462
1462
|
if (wu) return Mi;
|
|
1463
1463
|
wu = 1;
|
|
1464
|
-
var r =
|
|
1464
|
+
var r = Pd(), e = r(Object.getPrototypeOf, Object);
|
|
1465
1465
|
return Mi = e, Mi;
|
|
1466
1466
|
}
|
|
1467
1467
|
var Pi, bu;
|
|
1468
|
-
function
|
|
1468
|
+
function zd() {
|
|
1469
1469
|
if (bu) return Pi;
|
|
1470
1470
|
bu = 1;
|
|
1471
|
-
var r =
|
|
1471
|
+
var r = Ry(), e = Wo(), t = $o();
|
|
1472
1472
|
function n(s) {
|
|
1473
1473
|
return typeof s.constructor == "function" && !t(s) ? r(e(s)) : {};
|
|
1474
1474
|
}
|
|
1475
1475
|
return Pi = n, Pi;
|
|
1476
1476
|
}
|
|
1477
1477
|
var qi, Ou;
|
|
1478
|
-
function
|
|
1478
|
+
function Ay() {
|
|
1479
1479
|
if (Ou) return qi;
|
|
1480
1480
|
Ou = 1;
|
|
1481
1481
|
var r = Dn(), e = wt();
|
|
@@ -1485,7 +1485,7 @@ function Ry() {
|
|
|
1485
1485
|
return qi = t, qi;
|
|
1486
1486
|
}
|
|
1487
1487
|
var Li, Eu;
|
|
1488
|
-
function
|
|
1488
|
+
function Cy() {
|
|
1489
1489
|
if (Eu) return Li;
|
|
1490
1490
|
Eu = 1;
|
|
1491
1491
|
var r = hr(), e = Wo(), t = wt(), n = "[object Object]", s = Function.prototype, i = Object.prototype, a = s.toString, o = i.hasOwnProperty, c = a.call(Object);
|
|
@@ -1501,7 +1501,7 @@ function Ay() {
|
|
|
1501
1501
|
return Li = l, Li;
|
|
1502
1502
|
}
|
|
1503
1503
|
var $i, Su;
|
|
1504
|
-
function
|
|
1504
|
+
function Bd() {
|
|
1505
1505
|
if (Su) return $i;
|
|
1506
1506
|
Su = 1;
|
|
1507
1507
|
function r(e, t) {
|
|
@@ -1538,7 +1538,7 @@ function Vr() {
|
|
|
1538
1538
|
return Ui = t, Ui;
|
|
1539
1539
|
}
|
|
1540
1540
|
var Vi, Au;
|
|
1541
|
-
function
|
|
1541
|
+
function ky() {
|
|
1542
1542
|
if (Au) return Vi;
|
|
1543
1543
|
Au = 1;
|
|
1544
1544
|
function r(e) {
|
|
@@ -1551,10 +1551,10 @@ function Cy() {
|
|
|
1551
1551
|
return Vi = r, Vi;
|
|
1552
1552
|
}
|
|
1553
1553
|
var Wi, Cu;
|
|
1554
|
-
function
|
|
1554
|
+
function Iy() {
|
|
1555
1555
|
if (Cu) return Wi;
|
|
1556
1556
|
Cu = 1;
|
|
1557
|
-
var r = vt(), e = $o(), t =
|
|
1557
|
+
var r = vt(), e = $o(), t = ky(), n = Object.prototype, s = n.hasOwnProperty;
|
|
1558
1558
|
function i(a) {
|
|
1559
1559
|
if (!r(a))
|
|
1560
1560
|
return t(a);
|
|
@@ -1569,14 +1569,14 @@ var zi, ku;
|
|
|
1569
1569
|
function Wr() {
|
|
1570
1570
|
if (ku) return zi;
|
|
1571
1571
|
ku = 1;
|
|
1572
|
-
var r =
|
|
1572
|
+
var r = Md(), e = Iy(), t = Dn();
|
|
1573
1573
|
function n(s) {
|
|
1574
1574
|
return t(s) ? r(s, !0) : e(s);
|
|
1575
1575
|
}
|
|
1576
1576
|
return zi = n, zi;
|
|
1577
1577
|
}
|
|
1578
1578
|
var Bi, Iu;
|
|
1579
|
-
function
|
|
1579
|
+
function xy() {
|
|
1580
1580
|
if (Iu) return Bi;
|
|
1581
1581
|
Iu = 1;
|
|
1582
1582
|
var r = Vr(), e = Wr();
|
|
@@ -1586,30 +1586,30 @@ function Iy() {
|
|
|
1586
1586
|
return Bi = t, Bi;
|
|
1587
1587
|
}
|
|
1588
1588
|
var Zi, xu;
|
|
1589
|
-
function
|
|
1589
|
+
function Ny() {
|
|
1590
1590
|
if (xu) return Zi;
|
|
1591
1591
|
xu = 1;
|
|
1592
|
-
var r =
|
|
1593
|
-
function v(
|
|
1594
|
-
var T = h(
|
|
1592
|
+
var r = jd(), e = Ud(), t = Vd(), n = Wd(), s = zd(), i = Fd(), a = Dt(), o = Ay(), c = Fn(), l = Io(), u = vt(), f = Cy(), d = Lo(), h = Bd(), p = xy();
|
|
1593
|
+
function v(y, O, R, C, w, E, I) {
|
|
1594
|
+
var T = h(y, R), g = h(O, R), N = I.get(g);
|
|
1595
1595
|
if (N) {
|
|
1596
|
-
r(
|
|
1596
|
+
r(y, R, N);
|
|
1597
1597
|
return;
|
|
1598
1598
|
}
|
|
1599
|
-
var
|
|
1599
|
+
var _ = E ? E(T, g, R + "", y, O, I) : void 0, A = _ === void 0;
|
|
1600
1600
|
if (A) {
|
|
1601
|
-
var b = a(
|
|
1602
|
-
|
|
1601
|
+
var b = a(g), m = !b && c(g), S = !b && !m && d(g);
|
|
1602
|
+
_ = g, b || m || S ? a(T) ? _ = T : o(T) ? _ = n(T) : m ? (A = !1, _ = e(g, !0)) : S ? (A = !1, _ = t(g, !0)) : _ = [] : f(g) || i(g) ? (_ = T, i(T) ? _ = p(T) : (!u(T) || l(T)) && (_ = s(g))) : A = !1;
|
|
1603
1603
|
}
|
|
1604
|
-
A && (I.set(
|
|
1604
|
+
A && (I.set(g, _), w(_, g, C, E, I), I.delete(g)), r(y, R, _);
|
|
1605
1605
|
}
|
|
1606
1606
|
return Zi = v, Zi;
|
|
1607
1607
|
}
|
|
1608
1608
|
var Gi, Nu;
|
|
1609
|
-
function
|
|
1609
|
+
function Fy() {
|
|
1610
1610
|
if (Nu) return Gi;
|
|
1611
1611
|
Nu = 1;
|
|
1612
|
-
var r = Fo(), e =
|
|
1612
|
+
var r = Fo(), e = jd(), t = Ty(), n = Ny(), s = vt(), i = Wr(), a = Bd();
|
|
1613
1613
|
function o(c, l, u, f, d) {
|
|
1614
1614
|
c !== l && t(l, function(h, p) {
|
|
1615
1615
|
if (d || (d = new r()), s(h))
|
|
@@ -1623,7 +1623,7 @@ function Ny() {
|
|
|
1623
1623
|
return Gi = o, Gi;
|
|
1624
1624
|
}
|
|
1625
1625
|
var Hi, Fu;
|
|
1626
|
-
function
|
|
1626
|
+
function Zd() {
|
|
1627
1627
|
if (Fu) return Hi;
|
|
1628
1628
|
Fu = 1;
|
|
1629
1629
|
function r(e) {
|
|
@@ -1632,7 +1632,7 @@ function Hd() {
|
|
|
1632
1632
|
return Hi = r, Hi;
|
|
1633
1633
|
}
|
|
1634
1634
|
var Ki, Du;
|
|
1635
|
-
function
|
|
1635
|
+
function Dy() {
|
|
1636
1636
|
if (Du) return Ki;
|
|
1637
1637
|
Du = 1;
|
|
1638
1638
|
function r(e, t, n) {
|
|
@@ -1651,10 +1651,10 @@ function Fy() {
|
|
|
1651
1651
|
return Ki = r, Ki;
|
|
1652
1652
|
}
|
|
1653
1653
|
var Yi, Mu;
|
|
1654
|
-
function
|
|
1654
|
+
function My() {
|
|
1655
1655
|
if (Mu) return Yi;
|
|
1656
1656
|
Mu = 1;
|
|
1657
|
-
var r =
|
|
1657
|
+
var r = Dy(), e = Math.max;
|
|
1658
1658
|
function t(n, s, i) {
|
|
1659
1659
|
return s = e(s === void 0 ? n.length - 1 : s, 0), function() {
|
|
1660
1660
|
for (var a = arguments, o = -1, c = e(a.length - s, 0), l = Array(c); ++o < c; )
|
|
@@ -1668,7 +1668,7 @@ function Dy() {
|
|
|
1668
1668
|
return Yi = t, Yi;
|
|
1669
1669
|
}
|
|
1670
1670
|
var Ji, Pu;
|
|
1671
|
-
function
|
|
1671
|
+
function Py() {
|
|
1672
1672
|
if (Pu) return Ji;
|
|
1673
1673
|
Pu = 1;
|
|
1674
1674
|
function r(e) {
|
|
@@ -1679,10 +1679,10 @@ function My() {
|
|
|
1679
1679
|
return Ji = r, Ji;
|
|
1680
1680
|
}
|
|
1681
1681
|
var Qi, qu;
|
|
1682
|
-
function
|
|
1682
|
+
function qy() {
|
|
1683
1683
|
if (qu) return Qi;
|
|
1684
1684
|
qu = 1;
|
|
1685
|
-
var r =
|
|
1685
|
+
var r = Py(), e = $d(), t = Zd(), n = e ? function(s, i) {
|
|
1686
1686
|
return e(s, "toString", {
|
|
1687
1687
|
configurable: !0,
|
|
1688
1688
|
enumerable: !1,
|
|
@@ -1693,7 +1693,7 @@ function Py() {
|
|
|
1693
1693
|
return Qi = n, Qi;
|
|
1694
1694
|
}
|
|
1695
1695
|
var Xi, Lu;
|
|
1696
|
-
function
|
|
1696
|
+
function Ly() {
|
|
1697
1697
|
if (Lu) return Xi;
|
|
1698
1698
|
Lu = 1;
|
|
1699
1699
|
var r = 800, e = 16, t = Date.now;
|
|
@@ -1712,24 +1712,24 @@ function qy() {
|
|
|
1712
1712
|
return Xi = n, Xi;
|
|
1713
1713
|
}
|
|
1714
1714
|
var ea, $u;
|
|
1715
|
-
function
|
|
1715
|
+
function $y() {
|
|
1716
1716
|
if ($u) return ea;
|
|
1717
1717
|
$u = 1;
|
|
1718
|
-
var r =
|
|
1718
|
+
var r = qy(), e = Ly(), t = e(r);
|
|
1719
1719
|
return ea = t, ea;
|
|
1720
1720
|
}
|
|
1721
1721
|
var ta, ju;
|
|
1722
|
-
function
|
|
1722
|
+
function jy() {
|
|
1723
1723
|
if (ju) return ta;
|
|
1724
1724
|
ju = 1;
|
|
1725
|
-
var r =
|
|
1725
|
+
var r = Zd(), e = My(), t = $y();
|
|
1726
1726
|
function n(s, i) {
|
|
1727
1727
|
return t(e(s, i, r), s + "");
|
|
1728
1728
|
}
|
|
1729
1729
|
return ta = n, ta;
|
|
1730
1730
|
}
|
|
1731
1731
|
var ra, Uu;
|
|
1732
|
-
function
|
|
1732
|
+
function Uy() {
|
|
1733
1733
|
if (Uu) return ra;
|
|
1734
1734
|
Uu = 1;
|
|
1735
1735
|
var r = jr(), e = Dn(), t = Mo(), n = vt();
|
|
@@ -1742,10 +1742,10 @@ function jy() {
|
|
|
1742
1742
|
return ra = s, ra;
|
|
1743
1743
|
}
|
|
1744
1744
|
var na, Vu;
|
|
1745
|
-
function
|
|
1745
|
+
function Vy() {
|
|
1746
1746
|
if (Vu) return na;
|
|
1747
1747
|
Vu = 1;
|
|
1748
|
-
var r =
|
|
1748
|
+
var r = jy(), e = Uy();
|
|
1749
1749
|
function t(n) {
|
|
1750
1750
|
return r(function(s, i) {
|
|
1751
1751
|
var a = -1, o = i.length, c = o > 1 ? i[o - 1] : void 0, l = o > 2 ? i[2] : void 0;
|
|
@@ -1759,16 +1759,16 @@ function Uy() {
|
|
|
1759
1759
|
return na = t, na;
|
|
1760
1760
|
}
|
|
1761
1761
|
var sa, Wu;
|
|
1762
|
-
function
|
|
1762
|
+
function Wy() {
|
|
1763
1763
|
if (Wu) return sa;
|
|
1764
1764
|
Wu = 1;
|
|
1765
|
-
var r =
|
|
1765
|
+
var r = Fy(), e = Vy(), t = e(function(n, s, i) {
|
|
1766
1766
|
r(n, s, i);
|
|
1767
1767
|
});
|
|
1768
1768
|
return sa = t, sa;
|
|
1769
1769
|
}
|
|
1770
|
-
var
|
|
1771
|
-
const
|
|
1770
|
+
var zy = Wy();
|
|
1771
|
+
const By = /* @__PURE__ */ Cn(zy);
|
|
1772
1772
|
var ia, zu;
|
|
1773
1773
|
function Bo() {
|
|
1774
1774
|
if (zu) return ia;
|
|
@@ -1780,7 +1780,7 @@ function Bo() {
|
|
|
1780
1780
|
return ia = n, ia;
|
|
1781
1781
|
}
|
|
1782
1782
|
var aa, Bu;
|
|
1783
|
-
function
|
|
1783
|
+
function Zy() {
|
|
1784
1784
|
if (Bu) return aa;
|
|
1785
1785
|
Bu = 1;
|
|
1786
1786
|
var r = Dt(), e = Bo(), t = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, n = /^\w*$/;
|
|
@@ -1793,7 +1793,7 @@ function By() {
|
|
|
1793
1793
|
return aa = s, aa;
|
|
1794
1794
|
}
|
|
1795
1795
|
var oa, Zu;
|
|
1796
|
-
function
|
|
1796
|
+
function Gy() {
|
|
1797
1797
|
if (Zu) return oa;
|
|
1798
1798
|
Zu = 1;
|
|
1799
1799
|
var r = No(), e = "Expected a function";
|
|
@@ -1812,10 +1812,10 @@ function Zy() {
|
|
|
1812
1812
|
return t.Cache = r, oa = t, oa;
|
|
1813
1813
|
}
|
|
1814
1814
|
var ca, Gu;
|
|
1815
|
-
function
|
|
1815
|
+
function Hy() {
|
|
1816
1816
|
if (Gu) return ca;
|
|
1817
1817
|
Gu = 1;
|
|
1818
|
-
var r =
|
|
1818
|
+
var r = Gy(), e = 500;
|
|
1819
1819
|
function t(n) {
|
|
1820
1820
|
var s = r(n, function(a) {
|
|
1821
1821
|
return i.size === e && i.clear(), a;
|
|
@@ -1825,10 +1825,10 @@ function Gy() {
|
|
|
1825
1825
|
return ca = t, ca;
|
|
1826
1826
|
}
|
|
1827
1827
|
var la, Hu;
|
|
1828
|
-
function
|
|
1828
|
+
function Ky() {
|
|
1829
1829
|
if (Hu) return la;
|
|
1830
1830
|
Hu = 1;
|
|
1831
|
-
var r =
|
|
1831
|
+
var r = Hy(), e = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, t = /\\(\\)?/g, n = r(function(s) {
|
|
1832
1832
|
var i = [];
|
|
1833
1833
|
return s.charCodeAt(0) === 46 && i.push(""), s.replace(e, function(a, o, c, l) {
|
|
1834
1834
|
i.push(c ? l.replace(t, "$1") : o || a);
|
|
@@ -1837,7 +1837,7 @@ function Hy() {
|
|
|
1837
1837
|
return la = n, la;
|
|
1838
1838
|
}
|
|
1839
1839
|
var ua, Ku;
|
|
1840
|
-
function
|
|
1840
|
+
function Yy() {
|
|
1841
1841
|
if (Ku) return ua;
|
|
1842
1842
|
Ku = 1;
|
|
1843
1843
|
function r(e, t) {
|
|
@@ -1848,10 +1848,10 @@ function Ky() {
|
|
|
1848
1848
|
return ua = r, ua;
|
|
1849
1849
|
}
|
|
1850
1850
|
var fa, Yu;
|
|
1851
|
-
function
|
|
1851
|
+
function Jy() {
|
|
1852
1852
|
if (Yu) return fa;
|
|
1853
1853
|
Yu = 1;
|
|
1854
|
-
var r = Ur(), e =
|
|
1854
|
+
var r = Ur(), e = Yy(), t = Dt(), n = Bo(), s = r ? r.prototype : void 0, i = s ? s.toString : void 0;
|
|
1855
1855
|
function a(o) {
|
|
1856
1856
|
if (typeof o == "string")
|
|
1857
1857
|
return o;
|
|
@@ -1865,27 +1865,27 @@ function Yy() {
|
|
|
1865
1865
|
return fa = a, fa;
|
|
1866
1866
|
}
|
|
1867
1867
|
var da, Ju;
|
|
1868
|
-
function
|
|
1868
|
+
function Qy() {
|
|
1869
1869
|
if (Ju) return da;
|
|
1870
1870
|
Ju = 1;
|
|
1871
|
-
var r =
|
|
1871
|
+
var r = Jy();
|
|
1872
1872
|
function e(t) {
|
|
1873
1873
|
return t == null ? "" : r(t);
|
|
1874
1874
|
}
|
|
1875
1875
|
return da = e, da;
|
|
1876
1876
|
}
|
|
1877
1877
|
var ha, Qu;
|
|
1878
|
-
function
|
|
1878
|
+
function Xy() {
|
|
1879
1879
|
if (Qu) return ha;
|
|
1880
1880
|
Qu = 1;
|
|
1881
|
-
var r = Dt(), e =
|
|
1881
|
+
var r = Dt(), e = Zy(), t = Ky(), n = Qy();
|
|
1882
1882
|
function s(i, a) {
|
|
1883
1883
|
return r(i) ? i : e(i, a) ? [i] : t(n(i));
|
|
1884
1884
|
}
|
|
1885
1885
|
return ha = s, ha;
|
|
1886
1886
|
}
|
|
1887
1887
|
var ma, Xu;
|
|
1888
|
-
function
|
|
1888
|
+
function eg() {
|
|
1889
1889
|
if (Xu) return ma;
|
|
1890
1890
|
Xu = 1;
|
|
1891
1891
|
var r = Bo();
|
|
@@ -1898,10 +1898,10 @@ function Xy() {
|
|
|
1898
1898
|
return ma = e, ma;
|
|
1899
1899
|
}
|
|
1900
1900
|
var pa, ef;
|
|
1901
|
-
function
|
|
1901
|
+
function tg() {
|
|
1902
1902
|
if (ef) return pa;
|
|
1903
1903
|
ef = 1;
|
|
1904
|
-
var r = zo(), e =
|
|
1904
|
+
var r = zo(), e = Xy(), t = Mo(), n = vt(), s = eg();
|
|
1905
1905
|
function i(a, o, c, l) {
|
|
1906
1906
|
if (!n(a))
|
|
1907
1907
|
return a;
|
|
@@ -1911,8 +1911,8 @@ function eg() {
|
|
|
1911
1911
|
if (p === "__proto__" || p === "constructor" || p === "prototype")
|
|
1912
1912
|
return a;
|
|
1913
1913
|
if (u != d) {
|
|
1914
|
-
var
|
|
1915
|
-
v = l ? l(
|
|
1914
|
+
var y = h[p];
|
|
1915
|
+
v = l ? l(y, p, h) : void 0, v === void 0 && (v = n(y) ? y : t(o[u + 1]) ? [] : {});
|
|
1916
1916
|
}
|
|
1917
1917
|
r(h, p, v), h = h[p];
|
|
1918
1918
|
}
|
|
@@ -1921,20 +1921,20 @@ function eg() {
|
|
|
1921
1921
|
return pa = i, pa;
|
|
1922
1922
|
}
|
|
1923
1923
|
var ya, tf;
|
|
1924
|
-
function
|
|
1924
|
+
function rg() {
|
|
1925
1925
|
if (tf) return ya;
|
|
1926
1926
|
tf = 1;
|
|
1927
|
-
var r =
|
|
1927
|
+
var r = tg();
|
|
1928
1928
|
function e(t, n, s) {
|
|
1929
1929
|
return t == null ? t : r(t, n, s);
|
|
1930
1930
|
}
|
|
1931
1931
|
return ya = e, ya;
|
|
1932
1932
|
}
|
|
1933
|
-
var
|
|
1934
|
-
const
|
|
1933
|
+
var ng = rg();
|
|
1934
|
+
const sg = /* @__PURE__ */ Cn(ng), xr = {
|
|
1935
1935
|
global: {},
|
|
1936
1936
|
collections: {}
|
|
1937
|
-
},
|
|
1937
|
+
}, ig = () => {
|
|
1938
1938
|
xr.global = {}, xr.collections = {};
|
|
1939
1939
|
}, Ee = async (r, e) => {
|
|
1940
1940
|
let t = r;
|
|
@@ -1971,13 +1971,13 @@ const ng = /* @__PURE__ */ Cn(rg), xr = {
|
|
|
1971
1971
|
if (h !== void 0) {
|
|
1972
1972
|
if (h === "__proto__" || h === "constructor" || h === "prototype")
|
|
1973
1973
|
throw new Error("Invalid config path: prototype pollution keys are not allowed");
|
|
1974
|
-
d === e.length - 1 ?
|
|
1974
|
+
d === e.length - 1 ? sg(f, e.join("."), l) : (u[h] ||= {}, u = u[h]);
|
|
1975
1975
|
}
|
|
1976
1976
|
}
|
|
1977
|
-
|
|
1977
|
+
By(xr, f);
|
|
1978
1978
|
}
|
|
1979
1979
|
return l;
|
|
1980
|
-
},
|
|
1980
|
+
}, ag = (r, e, t) => {
|
|
1981
1981
|
const n = Object.values(t.collections), { labels: s } = e;
|
|
1982
1982
|
let i = !1;
|
|
1983
1983
|
for (const a of n) {
|
|
@@ -1988,7 +1988,7 @@ const ng = /* @__PURE__ */ Cn(rg), xr = {
|
|
|
1988
1988
|
l.field == r.name && (i = !0);
|
|
1989
1989
|
}
|
|
1990
1990
|
return i;
|
|
1991
|
-
},
|
|
1991
|
+
}, Gd = (r, e) => {
|
|
1992
1992
|
const t = Object.values(e.collections), { labels: n } = r, s = {};
|
|
1993
1993
|
return t.forEach((i) => {
|
|
1994
1994
|
const { labels: a, fields: o } = i;
|
|
@@ -2000,7 +2000,7 @@ const ng = /* @__PURE__ */ Cn(rg), xr = {
|
|
|
2000
2000
|
});
|
|
2001
2001
|
});
|
|
2002
2002
|
}), s;
|
|
2003
|
-
},
|
|
2003
|
+
}, Hd = [
|
|
2004
2004
|
"id",
|
|
2005
2005
|
"Collection_Path",
|
|
2006
2006
|
"Last_Write_At",
|
|
@@ -2012,7 +2012,7 @@ const ng = /* @__PURE__ */ Cn(rg), xr = {
|
|
|
2012
2012
|
"Created_At",
|
|
2013
2013
|
"Saved_At",
|
|
2014
2014
|
"Created_By"
|
|
2015
|
-
], Zo = () =>
|
|
2015
|
+
], Zo = () => Hd.map((r) => {
|
|
2016
2016
|
let e = "", t;
|
|
2017
2017
|
switch (r) {
|
|
2018
2018
|
case "id":
|
|
@@ -2061,48 +2061,48 @@ const ng = /* @__PURE__ */ Cn(rg), xr = {
|
|
|
2061
2061
|
if (c.roles.some((l) => l.role === e))
|
|
2062
2062
|
switch (c.type) {
|
|
2063
2063
|
case "Record_Owner":
|
|
2064
|
-
t.push(
|
|
2064
|
+
t.push(re(o, "Created_By"));
|
|
2065
2065
|
break;
|
|
2066
2066
|
case "Record_User":
|
|
2067
|
-
t.push(
|
|
2067
|
+
t.push(re(s, c.collectionField));
|
|
2068
2068
|
break;
|
|
2069
2069
|
case "Record_Property":
|
|
2070
|
-
t.push(
|
|
2070
|
+
t.push(re(s, c.propertyField));
|
|
2071
2071
|
break;
|
|
2072
2072
|
}
|
|
2073
2073
|
}), a && (a.restrictions?.forEach((c) => {
|
|
2074
2074
|
if (c.roles.some((l) => l.role === e))
|
|
2075
2075
|
switch (c.type) {
|
|
2076
2076
|
case "Individual":
|
|
2077
|
-
t.push(
|
|
2077
|
+
t.push(re(o, "id"));
|
|
2078
2078
|
break;
|
|
2079
2079
|
case "Parent":
|
|
2080
|
-
t.push(
|
|
2080
|
+
t.push(re(s, c.collectionField));
|
|
2081
2081
|
break;
|
|
2082
2082
|
case "Parent_Property":
|
|
2083
|
-
t.push(
|
|
2083
|
+
t.push(re(s, c.collectionField)), t.push(re(s, c.propertyField));
|
|
2084
2084
|
break;
|
|
2085
2085
|
}
|
|
2086
2086
|
}), a.parentFilters && a.parentFilters.forEach((c) => {
|
|
2087
2087
|
if (c.roles.some((l) => l.role === e))
|
|
2088
2088
|
switch (c.type) {
|
|
2089
2089
|
case "Individual":
|
|
2090
|
-
t.push(
|
|
2090
|
+
t.push(re(s, c.collectionField));
|
|
2091
2091
|
break;
|
|
2092
2092
|
case "Parent":
|
|
2093
|
-
t.push(
|
|
2093
|
+
t.push(re(s, c.parentCollectionField));
|
|
2094
2094
|
break;
|
|
2095
2095
|
case "Parent_Property":
|
|
2096
|
-
t.push(
|
|
2096
|
+
t.push(re(s, c.parentCollectionField)), t.push(re(s, c.parentPropertyField));
|
|
2097
2097
|
break;
|
|
2098
2098
|
}
|
|
2099
2099
|
})), [...new Set(t)];
|
|
2100
2100
|
}, cg = (r, e, t) => {
|
|
2101
2101
|
const n = [], { fields: s, preloadCache: i } = e, a = Zo();
|
|
2102
2102
|
i?.range && i.range.fields.forEach((l) => {
|
|
2103
|
-
|
|
2103
|
+
Hd.includes(l) ? n.push(re(a, l)) : n.push(re(s, l));
|
|
2104
2104
|
});
|
|
2105
|
-
const o = /* @__PURE__ */ new Set(), c =
|
|
2105
|
+
const o = /* @__PURE__ */ new Set(), c = Gd(e, t);
|
|
2106
2106
|
return Object.entries(c).map(([l, u]) => {
|
|
2107
2107
|
r.name === l && Object.values(u).forEach((f) => {
|
|
2108
2108
|
f.forEach((d) => {
|
|
@@ -2114,7 +2114,7 @@ const ng = /* @__PURE__ */ Cn(rg), xr = {
|
|
|
2114
2114
|
}), [...new Set(n)];
|
|
2115
2115
|
}, lg = (r, e, t) => {
|
|
2116
2116
|
const n = [], { fields: s, softDelete: i } = e;
|
|
2117
|
-
|
|
2117
|
+
n.push({
|
|
2118
2118
|
name: "Collection_Path",
|
|
2119
2119
|
type: "Array",
|
|
2120
2120
|
required: !0
|
|
@@ -2122,9 +2122,21 @@ const ng = /* @__PURE__ */ Cn(rg), xr = {
|
|
|
2122
2122
|
name: "id",
|
|
2123
2123
|
type: "String",
|
|
2124
2124
|
required: !0
|
|
2125
|
+
});
|
|
2126
|
+
const a = [], o = Gd(e, t);
|
|
2127
|
+
if (Object.values(o).forEach((c) => {
|
|
2128
|
+
Object.keys(c).forEach((l) => {
|
|
2129
|
+
t.collections[l].fields.forEach((f) => {
|
|
2130
|
+
_e(f) && f.collection === e.labels.collection && f.dependencyFields?.some((d) => d.field === r.name) && f.constraints && f.constraints.forEach((d) => {
|
|
2131
|
+
a.push(d[0]);
|
|
2132
|
+
});
|
|
2133
|
+
});
|
|
2134
|
+
});
|
|
2135
|
+
}), a.forEach((c) => {
|
|
2136
|
+
n.push(re(s, c));
|
|
2125
2137
|
}), i) {
|
|
2126
|
-
const
|
|
2127
|
-
|
|
2138
|
+
const c = re(s, i.archivedField);
|
|
2139
|
+
c && n.push(c);
|
|
2128
2140
|
}
|
|
2129
2141
|
return n.push(...cg(r, e, t)), [...new Set(n)];
|
|
2130
2142
|
}, ug = (r, e) => {
|
|
@@ -2147,11 +2159,11 @@ async function oe(r, e, t, n) {
|
|
|
2147
2159
|
if (r !== "setEmbedding" && (await ga(r, e?.[r], n), r === "postWriteError"))
|
|
2148
2160
|
return s;
|
|
2149
2161
|
}
|
|
2150
|
-
const Go = (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),
|
|
2162
|
+
const Go = (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), Kd = (r, e) => {
|
|
2151
2163
|
const { access: t, queries: n } = r, { serverReadOnly: s } = t, i = /* @__PURE__ */ new Set();
|
|
2152
2164
|
if (n)
|
|
2153
2165
|
for (const a of n) {
|
|
2154
|
-
const o =
|
|
2166
|
+
const o = re(e, a.field);
|
|
2155
2167
|
e.find((c) => c.name === a.field) && _e(o) && ["OneToOne", "OneToMany"].includes(o.type) && i.add(o);
|
|
2156
2168
|
}
|
|
2157
2169
|
return e.forEach((a) => {
|
|
@@ -2162,7 +2174,7 @@ const Go = (r, e, t, n, s, i, a, o, c, l) => (r == "create" && (t.Collection_Pat
|
|
|
2162
2174
|
return e.forEach((a) => {
|
|
2163
2175
|
(n === a.name || a.sorting && (typeof a.sorting == "boolean" || !a.sorting.roles?.every((o) => s?.includes(o)))) && a.type === "String" && i.add(a);
|
|
2164
2176
|
}), i;
|
|
2165
|
-
},
|
|
2177
|
+
}, Yd = (r, e, t) => {
|
|
2166
2178
|
const { fields: n } = r;
|
|
2167
2179
|
n.forEach((i) => {
|
|
2168
2180
|
if (_e(i))
|
|
@@ -2171,14 +2183,14 @@ const Go = (r, e, t, n, s, i, a, o, c, l) => (r == "create" && (t.Collection_Pat
|
|
|
2171
2183
|
e[`${i.name}_Array`] = e[i.name];
|
|
2172
2184
|
else if (e[`${i.name}_Array`] = Object.keys(e[i.name]), i.includeFields)
|
|
2173
2185
|
for (const a of i.includeFields) {
|
|
2174
|
-
const o = t.collections[i.collection], c =
|
|
2186
|
+
const o = t.collections[i.collection], c = re(o.fields, a);
|
|
2175
2187
|
zr(o, [c]).size === 1 && Object.keys(e[i.name]).forEach((u) => {
|
|
2176
2188
|
e[i.name][u][a] ? e[i.name][u][`${a}_Lowercase`] = e[i.name][u][a].toLowerCase() : delete e[i.name][u][`${a}_Lowercase`];
|
|
2177
2189
|
});
|
|
2178
2190
|
}
|
|
2179
2191
|
} else
|
|
2180
2192
|
delete e[`${i.name}_Array`], delete e[`${i.name}_Single`];
|
|
2181
|
-
}),
|
|
2193
|
+
}), Kd(r, n).forEach((i) => {
|
|
2182
2194
|
if (e[i.name])
|
|
2183
2195
|
if (sr(e[i.name]))
|
|
2184
2196
|
e[`${i.name}_Single`] = e[i.name];
|
|
@@ -2190,14 +2202,14 @@ const Go = (r, e, t, n, s, i, a, o, c, l) => (r == "create" && (t.Collection_Pat
|
|
|
2190
2202
|
}
|
|
2191
2203
|
}
|
|
2192
2204
|
});
|
|
2193
|
-
},
|
|
2205
|
+
}, Jd = (r, e) => {
|
|
2194
2206
|
zr(r, r.fields).forEach((n) => {
|
|
2195
2207
|
e[n.name] ? e[`${n.name}_Lowercase`] = e[n.name].toLowerCase() : delete e[`${n.name}_Lowercase`];
|
|
2196
2208
|
});
|
|
2197
2209
|
}, fg = async (r, e, t, n) => {
|
|
2198
2210
|
const { fields: s } = e;
|
|
2199
2211
|
for (const i of t.fields) {
|
|
2200
|
-
const a =
|
|
2212
|
+
const a = re(s, i.name);
|
|
2201
2213
|
i.custom?.initialValue && !(n && a.access && !a.access.includes(n)) && (r[i.name] = await Ee(i.custom.initialValue, [r]), zr(e, [a]).size === 1 && (r[`${i.name}_Lowercase`] = r[i.name].toLowerCase()));
|
|
2202
2214
|
}
|
|
2203
2215
|
for (const i of s)
|
|
@@ -2773,18 +2785,18 @@ class ce {
|
|
|
2773
2785
|
}
|
|
2774
2786
|
const pg = /^c[^\s-]{8,}$/i, yg = /^[0-9a-z]+$/, gg = /^[0-9A-HJKMNP-TV-Z]{26}$/i, _g = /^[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, vg = /^[a-z0-9_-]{21}$/i, wg = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, bg = /^[-+]?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)?)??$/, Og = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Eg = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
2775
2787
|
let _a;
|
|
2776
|
-
const Sg = /^(?:(?: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])$/, Tg = /^(?:(?: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])$/, Rg = /^(([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]))$/, 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]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Cg = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, kg = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
|
|
2777
|
-
function
|
|
2788
|
+
const Sg = /^(?:(?: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])$/, Tg = /^(?:(?: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])$/, Rg = /^(([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]))$/, 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]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Cg = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, kg = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Qd = "((\\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])))", Ig = new RegExp(`^${Qd}$`);
|
|
2789
|
+
function Xd(r) {
|
|
2778
2790
|
let e = "[0-5]\\d";
|
|
2779
2791
|
r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
2780
2792
|
const t = r.precision ? "+" : "?";
|
|
2781
2793
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
|
|
2782
2794
|
}
|
|
2783
2795
|
function xg(r) {
|
|
2784
|
-
return new RegExp(`^${
|
|
2796
|
+
return new RegExp(`^${Xd(r)}$`);
|
|
2785
2797
|
}
|
|
2786
2798
|
function Ng(r) {
|
|
2787
|
-
let e = `${
|
|
2799
|
+
let e = `${Qd}T${Xd(r)}`;
|
|
2788
2800
|
const t = [];
|
|
2789
2801
|
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
2790
2802
|
}
|
|
@@ -4053,7 +4065,7 @@ class Te extends ce {
|
|
|
4053
4065
|
});
|
|
4054
4066
|
}
|
|
4055
4067
|
keyof() {
|
|
4056
|
-
return
|
|
4068
|
+
return eh(ue.objectKeys(this.shape));
|
|
4057
4069
|
}
|
|
4058
4070
|
}
|
|
4059
4071
|
Te.create = (r, e) => new Te({
|
|
@@ -4452,7 +4464,7 @@ so.create = (r, e) => new so({
|
|
|
4452
4464
|
typeName: Q.ZodLiteral,
|
|
4453
4465
|
...ie(e)
|
|
4454
4466
|
});
|
|
4455
|
-
function
|
|
4467
|
+
function eh(r, e) {
|
|
4456
4468
|
return new or({
|
|
4457
4469
|
values: r,
|
|
4458
4470
|
typeName: Q.ZodEnum,
|
|
@@ -4513,7 +4525,7 @@ class or extends ce {
|
|
|
4513
4525
|
});
|
|
4514
4526
|
}
|
|
4515
4527
|
}
|
|
4516
|
-
or.create =
|
|
4528
|
+
or.create = eh;
|
|
4517
4529
|
class mf extends ce {
|
|
4518
4530
|
_parse(e) {
|
|
4519
4531
|
const t = ue.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -4839,7 +4851,7 @@ var Q;
|
|
|
4839
4851
|
})(Q || (Q = {}));
|
|
4840
4852
|
const mt = pt.create, co = ar.create, Lg = to.create, jt = ro.create;
|
|
4841
4853
|
Ft.create;
|
|
4842
|
-
const Pn = at.create,
|
|
4854
|
+
const Pn = at.create, th = Te.create, gn = hn.create;
|
|
4843
4855
|
mn.create;
|
|
4844
4856
|
Vt.create;
|
|
4845
4857
|
const Ko = pn.create, lo = so.create, uo = or.create;
|
|
@@ -4850,7 +4862,7 @@ const sn = () => jt().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4850
4862
|
message: "Value is not a valid timestamp"
|
|
4851
4863
|
}), yf = () => jt().refine((r) => r && (r._methodName === "serverTimestamp" || r.constructor.name === "ServerTimestampTransform"), {
|
|
4852
4864
|
message: "Value is not a valid server timestamp"
|
|
4853
|
-
}),
|
|
4865
|
+
}), rh = (r, e) => {
|
|
4854
4866
|
const t = {};
|
|
4855
4867
|
if (r.includeFields) {
|
|
4856
4868
|
const n = e.collections[r.collection];
|
|
@@ -4863,12 +4875,12 @@ const sn = () => jt().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4863
4875
|
t[s] = _n(n, i), zr(n, [i]).size === 1 && (t[`${s}_Lowercase`] = _n(n, i, !0));
|
|
4864
4876
|
});
|
|
4865
4877
|
}
|
|
4866
|
-
return
|
|
4878
|
+
return th({
|
|
4867
4879
|
Collection_Path: Pn(mt()),
|
|
4868
4880
|
...t
|
|
4869
4881
|
});
|
|
4870
4882
|
}, $g = (r, e) => {
|
|
4871
|
-
let t = Ko(
|
|
4883
|
+
let t = Ko(rh(r, e));
|
|
4872
4884
|
return r.required || (t = t.optional()), t;
|
|
4873
4885
|
}, jg = (r) => {
|
|
4874
4886
|
let e = Pn(gn([mt().length(20), mt().length(28)]));
|
|
@@ -4936,9 +4948,9 @@ const sn = () => jt().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4936
4948
|
Created_By: gn([mt().length(28), lo("System")])
|
|
4937
4949
|
};
|
|
4938
4950
|
r === "create" && (n.Saved_At = yf()), r === "update" && (n.Saved_At = sn(), 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());
|
|
4939
|
-
const s =
|
|
4951
|
+
const s = Kd(e, e.fields), i = Array.from(s).map((c) => c.name);
|
|
4940
4952
|
e.fields.forEach((c) => {
|
|
4941
|
-
_e(c) ? (n[c.name] = $g(c, t), n[`${c.name}_Array`] = jg(c), i.includes(c.name) && (n[`${c.name}_Single`] =
|
|
4953
|
+
_e(c) ? (n[c.name] = $g(c, t), n[`${c.name}_Array`] = jg(c), i.includes(c.name) && (n[`${c.name}_Single`] = rh(c, t), 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, {
|
|
4942
4954
|
message: `Value must contain ${c.length} item(s)`
|
|
4943
4955
|
})), c.min && (n[c.name] = n[c.name].refine((l) => c.min && l && Object.keys(l).length >= c.min, {
|
|
4944
4956
|
message: `Value must contain at least ${c.min} item(s)`
|
|
@@ -4948,7 +4960,7 @@ const sn = () => jt().refine((r) => r && (r.seconds !== void 0 && r.nanoseconds
|
|
|
4948
4960
|
}), zr(e, e.fields).forEach((c) => {
|
|
4949
4961
|
n[c.name] && (n[`${c.name}_Lowercase`] = _n(e, c, !0));
|
|
4950
4962
|
});
|
|
4951
|
-
const o =
|
|
4963
|
+
const o = th(n);
|
|
4952
4964
|
return e.allowSchemalessFields ? o.passthrough() : o.strict();
|
|
4953
4965
|
};
|
|
4954
4966
|
class Zt extends Error {
|
|
@@ -4970,7 +4982,7 @@ class zg extends Zt {
|
|
|
4970
4982
|
}
|
|
4971
4983
|
class er extends Zt {
|
|
4972
4984
|
}
|
|
4973
|
-
class
|
|
4985
|
+
class nh extends Zt {
|
|
4974
4986
|
constructor(e) {
|
|
4975
4987
|
super(`Invalid unit ${e}`);
|
|
4976
4988
|
}
|
|
@@ -4986,7 +4998,7 @@ const q = "numeric", rt = "short", Le = "long", vn = {
|
|
|
4986
4998
|
year: q,
|
|
4987
4999
|
month: q,
|
|
4988
5000
|
day: q
|
|
4989
|
-
},
|
|
5001
|
+
}, sh = {
|
|
4990
5002
|
year: q,
|
|
4991
5003
|
month: rt,
|
|
4992
5004
|
day: q
|
|
@@ -4995,73 +5007,73 @@ const q = "numeric", rt = "short", Le = "long", vn = {
|
|
|
4995
5007
|
month: rt,
|
|
4996
5008
|
day: q,
|
|
4997
5009
|
weekday: rt
|
|
4998
|
-
},
|
|
5010
|
+
}, ih = {
|
|
4999
5011
|
year: q,
|
|
5000
5012
|
month: Le,
|
|
5001
5013
|
day: q
|
|
5002
|
-
},
|
|
5014
|
+
}, ah = {
|
|
5003
5015
|
year: q,
|
|
5004
5016
|
month: Le,
|
|
5005
5017
|
day: q,
|
|
5006
5018
|
weekday: Le
|
|
5007
|
-
},
|
|
5019
|
+
}, oh = {
|
|
5008
5020
|
hour: q,
|
|
5009
5021
|
minute: q
|
|
5010
|
-
},
|
|
5022
|
+
}, ch = {
|
|
5011
5023
|
hour: q,
|
|
5012
5024
|
minute: q,
|
|
5013
5025
|
second: q
|
|
5014
|
-
},
|
|
5026
|
+
}, lh = {
|
|
5015
5027
|
hour: q,
|
|
5016
5028
|
minute: q,
|
|
5017
5029
|
second: q,
|
|
5018
5030
|
timeZoneName: rt
|
|
5019
|
-
},
|
|
5031
|
+
}, uh = {
|
|
5020
5032
|
hour: q,
|
|
5021
5033
|
minute: q,
|
|
5022
5034
|
second: q,
|
|
5023
5035
|
timeZoneName: Le
|
|
5024
|
-
},
|
|
5036
|
+
}, fh = {
|
|
5025
5037
|
hour: q,
|
|
5026
5038
|
minute: q,
|
|
5027
5039
|
hourCycle: "h23"
|
|
5028
|
-
},
|
|
5040
|
+
}, dh = {
|
|
5029
5041
|
hour: q,
|
|
5030
5042
|
minute: q,
|
|
5031
5043
|
second: q,
|
|
5032
5044
|
hourCycle: "h23"
|
|
5033
|
-
},
|
|
5045
|
+
}, hh = {
|
|
5034
5046
|
hour: q,
|
|
5035
5047
|
minute: q,
|
|
5036
5048
|
second: q,
|
|
5037
5049
|
hourCycle: "h23",
|
|
5038
5050
|
timeZoneName: rt
|
|
5039
|
-
},
|
|
5051
|
+
}, mh = {
|
|
5040
5052
|
hour: q,
|
|
5041
5053
|
minute: q,
|
|
5042
5054
|
second: q,
|
|
5043
5055
|
hourCycle: "h23",
|
|
5044
5056
|
timeZoneName: Le
|
|
5045
|
-
},
|
|
5057
|
+
}, ph = {
|
|
5046
5058
|
year: q,
|
|
5047
5059
|
month: q,
|
|
5048
5060
|
day: q,
|
|
5049
5061
|
hour: q,
|
|
5050
5062
|
minute: q
|
|
5051
|
-
},
|
|
5063
|
+
}, yh = {
|
|
5052
5064
|
year: q,
|
|
5053
5065
|
month: q,
|
|
5054
5066
|
day: q,
|
|
5055
5067
|
hour: q,
|
|
5056
5068
|
minute: q,
|
|
5057
5069
|
second: q
|
|
5058
|
-
},
|
|
5070
|
+
}, gh = {
|
|
5059
5071
|
year: q,
|
|
5060
5072
|
month: rt,
|
|
5061
5073
|
day: q,
|
|
5062
5074
|
hour: q,
|
|
5063
5075
|
minute: q
|
|
5064
|
-
},
|
|
5076
|
+
}, _h = {
|
|
5065
5077
|
year: q,
|
|
5066
5078
|
month: rt,
|
|
5067
5079
|
day: q,
|
|
@@ -5075,14 +5087,14 @@ const q = "numeric", rt = "short", Le = "long", vn = {
|
|
|
5075
5087
|
weekday: rt,
|
|
5076
5088
|
hour: q,
|
|
5077
5089
|
minute: q
|
|
5078
|
-
},
|
|
5090
|
+
}, vh = {
|
|
5079
5091
|
year: q,
|
|
5080
5092
|
month: Le,
|
|
5081
5093
|
day: q,
|
|
5082
5094
|
hour: q,
|
|
5083
5095
|
minute: q,
|
|
5084
5096
|
timeZoneName: rt
|
|
5085
|
-
},
|
|
5097
|
+
}, wh = {
|
|
5086
5098
|
year: q,
|
|
5087
5099
|
month: Le,
|
|
5088
5100
|
day: q,
|
|
@@ -5090,7 +5102,7 @@ const q = "numeric", rt = "short", Le = "long", vn = {
|
|
|
5090
5102
|
minute: q,
|
|
5091
5103
|
second: q,
|
|
5092
5104
|
timeZoneName: rt
|
|
5093
|
-
},
|
|
5105
|
+
}, bh = {
|
|
5094
5106
|
year: q,
|
|
5095
5107
|
month: Le,
|
|
5096
5108
|
day: q,
|
|
@@ -5098,7 +5110,7 @@ const q = "numeric", rt = "short", Le = "long", vn = {
|
|
|
5098
5110
|
hour: q,
|
|
5099
5111
|
minute: q,
|
|
5100
5112
|
timeZoneName: Le
|
|
5101
|
-
},
|
|
5113
|
+
}, Oh = {
|
|
5102
5114
|
year: q,
|
|
5103
5115
|
month: Le,
|
|
5104
5116
|
day: q,
|
|
@@ -5215,7 +5227,7 @@ class qn extends Br {
|
|
|
5215
5227
|
}
|
|
5216
5228
|
/** @override **/
|
|
5217
5229
|
offsetName(e, { format: t, locale: n }) {
|
|
5218
|
-
return
|
|
5230
|
+
return Fh(e, t, n);
|
|
5219
5231
|
}
|
|
5220
5232
|
/** @override **/
|
|
5221
5233
|
formatOffset(e, t) {
|
|
@@ -5353,7 +5365,7 @@ class gt extends Br {
|
|
|
5353
5365
|
* @return {string}
|
|
5354
5366
|
*/
|
|
5355
5367
|
offsetName(e, { format: t, locale: n }) {
|
|
5356
|
-
return
|
|
5368
|
+
return Fh(e, t, n, this.name);
|
|
5357
5369
|
}
|
|
5358
5370
|
/**
|
|
5359
5371
|
* Returns the offset's value as a string
|
|
@@ -5439,7 +5451,7 @@ function e_() {
|
|
|
5439
5451
|
return Tr || (Tr = new Intl.DateTimeFormat().resolvedOptions().locale, Tr);
|
|
5440
5452
|
}
|
|
5441
5453
|
const go = /* @__PURE__ */ new Map();
|
|
5442
|
-
function
|
|
5454
|
+
function Eh(r) {
|
|
5443
5455
|
let e = go.get(r);
|
|
5444
5456
|
return e === void 0 && (e = new Intl.DateTimeFormat(r).resolvedOptions(), go.set(r, e)), e;
|
|
5445
5457
|
}
|
|
@@ -5448,7 +5460,7 @@ function t_(r) {
|
|
|
5448
5460
|
let e = _o.get(r);
|
|
5449
5461
|
if (!e) {
|
|
5450
5462
|
const t = new Intl.Locale(r);
|
|
5451
|
-
e = "getWeekInfo" in t ? t.getWeekInfo() : t.weekInfo, "minimalDays" in e || (e = { ...
|
|
5463
|
+
e = "getWeekInfo" in t ? t.getWeekInfo() : t.weekInfo, "minimalDays" in e || (e = { ...Sh, ...e }), _o.set(r, e);
|
|
5452
5464
|
}
|
|
5453
5465
|
return e;
|
|
5454
5466
|
}
|
|
@@ -5494,7 +5506,7 @@ function Xr(r, e, t, n) {
|
|
|
5494
5506
|
return s === "error" ? null : s === "en" ? t(e) : n(e);
|
|
5495
5507
|
}
|
|
5496
5508
|
function a_(r) {
|
|
5497
|
-
return r.numberingSystem && r.numberingSystem !== "latn" ? !1 : r.numberingSystem === "latn" || !r.locale || r.locale.startsWith("en") ||
|
|
5509
|
+
return r.numberingSystem && r.numberingSystem !== "latn" ? !1 : r.numberingSystem === "latn" || !r.locale || r.locale.startsWith("en") || Eh(r.locale).numberingSystem === "latn";
|
|
5498
5510
|
}
|
|
5499
5511
|
class o_ {
|
|
5500
5512
|
constructor(e, t, n) {
|
|
@@ -5553,7 +5565,7 @@ class c_ {
|
|
|
5553
5565
|
}
|
|
5554
5566
|
class l_ {
|
|
5555
5567
|
constructor(e, t, n) {
|
|
5556
|
-
this.opts = { style: "long", ...n }, !t &&
|
|
5568
|
+
this.opts = { style: "long", ...n }, !t && xh() && (this.rtf = Xg(e, n));
|
|
5557
5569
|
}
|
|
5558
5570
|
format(e, t) {
|
|
5559
5571
|
return this.rtf ? this.rtf.format(e, t) : x_(t, e, this.opts.numeric, this.opts.style !== "long");
|
|
@@ -5562,7 +5574,7 @@ class l_ {
|
|
|
5562
5574
|
return this.rtf ? this.rtf.formatToParts(e, t) : [];
|
|
5563
5575
|
}
|
|
5564
5576
|
}
|
|
5565
|
-
const
|
|
5577
|
+
const Sh = {
|
|
5566
5578
|
firstDay: 1,
|
|
5567
5579
|
minimalDays: 4,
|
|
5568
5580
|
weekend: [6, 7]
|
|
@@ -5614,7 +5626,7 @@ class he {
|
|
|
5614
5626
|
return this.clone({ ...e, defaultToEN: !1 });
|
|
5615
5627
|
}
|
|
5616
5628
|
months(e, t = !1) {
|
|
5617
|
-
return Xr(this, e,
|
|
5629
|
+
return Xr(this, e, Ph, () => {
|
|
5618
5630
|
const n = this.intl === "ja" || this.intl.startsWith("ja-");
|
|
5619
5631
|
t &= !n;
|
|
5620
5632
|
const s = t ? { month: e, day: "numeric" } : { month: e }, i = t ? "format" : "standalone";
|
|
@@ -5626,7 +5638,7 @@ class he {
|
|
|
5626
5638
|
});
|
|
5627
5639
|
}
|
|
5628
5640
|
weekdays(e, t = !1) {
|
|
5629
|
-
return Xr(this, e,
|
|
5641
|
+
return Xr(this, e, $h, () => {
|
|
5630
5642
|
const n = t ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, s = t ? "format" : "standalone";
|
|
5631
5643
|
return this.weekdaysCache[s][e] || (this.weekdaysCache[s][e] = i_(
|
|
5632
5644
|
(i) => this.extract(i, n, "weekday")
|
|
@@ -5637,7 +5649,7 @@ class he {
|
|
|
5637
5649
|
return Xr(
|
|
5638
5650
|
this,
|
|
5639
5651
|
void 0,
|
|
5640
|
-
() =>
|
|
5652
|
+
() => jh,
|
|
5641
5653
|
() => {
|
|
5642
5654
|
if (!this.meridiemCache) {
|
|
5643
5655
|
const e = { hour: "numeric", hourCycle: "h12" };
|
|
@@ -5650,7 +5662,7 @@ class he {
|
|
|
5650
5662
|
);
|
|
5651
5663
|
}
|
|
5652
5664
|
eras(e) {
|
|
5653
|
-
return Xr(this, e,
|
|
5665
|
+
return Xr(this, e, Uh, () => {
|
|
5654
5666
|
const t = { era: e };
|
|
5655
5667
|
return this.eraCache[e] || (this.eraCache[e] = [z.utc(-40, 1, 1), z.utc(2017, 1, 1)].map(
|
|
5656
5668
|
(n) => this.extract(n, t, "era")
|
|
@@ -5674,10 +5686,10 @@ class he {
|
|
|
5674
5686
|
return Jg(this.intl, e);
|
|
5675
5687
|
}
|
|
5676
5688
|
isEnglish() {
|
|
5677
|
-
return this.locale === "en" || this.locale.toLowerCase() === "en-us" ||
|
|
5689
|
+
return this.locale === "en" || this.locale.toLowerCase() === "en-us" || Eh(this.intl).locale.startsWith("en-us");
|
|
5678
5690
|
}
|
|
5679
5691
|
getWeekSettings() {
|
|
5680
|
-
return this.weekSettings ? this.weekSettings :
|
|
5692
|
+
return this.weekSettings ? this.weekSettings : Nh() ? t_(this.locale) : Sh;
|
|
5681
5693
|
}
|
|
5682
5694
|
getStartOfWeek() {
|
|
5683
5695
|
return this.getWeekSettings().firstDay;
|
|
@@ -6082,7 +6094,7 @@ class tt {
|
|
|
6082
6094
|
return this.explanation ? `${this.reason}: ${this.explanation}` : this.reason;
|
|
6083
6095
|
}
|
|
6084
6096
|
}
|
|
6085
|
-
const
|
|
6097
|
+
const Th = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Rh = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
|
|
6086
6098
|
function Be(r, e) {
|
|
6087
6099
|
return new tt(
|
|
6088
6100
|
"unit out of range",
|
|
@@ -6095,18 +6107,18 @@ function Jo(r, e, t) {
|
|
|
6095
6107
|
const s = n.getUTCDay();
|
|
6096
6108
|
return s === 0 ? 7 : s;
|
|
6097
6109
|
}
|
|
6098
|
-
function
|
|
6099
|
-
return t + (Zr(r) ?
|
|
6110
|
+
function Ah(r, e, t) {
|
|
6111
|
+
return t + (Zr(r) ? Rh : Th)[e - 1];
|
|
6100
6112
|
}
|
|
6101
|
-
function
|
|
6102
|
-
const t = Zr(r) ?
|
|
6113
|
+
function Ch(r, e) {
|
|
6114
|
+
const t = Zr(r) ? Rh : Th, n = t.findIndex((i) => i < e), s = e - t[n];
|
|
6103
6115
|
return { month: n + 1, day: s };
|
|
6104
6116
|
}
|
|
6105
6117
|
function Qo(r, e) {
|
|
6106
6118
|
return (r - e + 7) % 7 + 1;
|
|
6107
6119
|
}
|
|
6108
6120
|
function wn(r, e = 4, t = 1) {
|
|
6109
|
-
const { year: n, month: s, day: i } = r, a =
|
|
6121
|
+
const { year: n, month: s, day: i } = r, a = Ah(n, s, i), o = Qo(Jo(n, s, i), t);
|
|
6110
6122
|
let c = Math.floor((a - o + 14 - e) / 7), l;
|
|
6111
6123
|
return c < 1 ? (l = n - 1, c = $r(l, e, t)) : c > $r(n, e, t) ? (l = n + 1, c = 1) : l = n, { weekYear: l, weekNumber: c, weekday: o, ...Un(r) };
|
|
6112
6124
|
}
|
|
@@ -6114,15 +6126,15 @@ function Af(r, e = 4, t = 1) {
|
|
|
6114
6126
|
const { weekYear: n, weekNumber: s, weekday: i } = r, a = Qo(Jo(n, 1, e), t), o = rr(n);
|
|
6115
6127
|
let c = s * 7 + i - a - 7 + e, l;
|
|
6116
6128
|
c < 1 ? (l = n - 1, c += rr(l)) : c > o ? (l = n + 1, c -= rr(n)) : l = n;
|
|
6117
|
-
const { month: u, day: f } =
|
|
6129
|
+
const { month: u, day: f } = Ch(l, c);
|
|
6118
6130
|
return { year: l, month: u, day: f, ...Un(r) };
|
|
6119
6131
|
}
|
|
6120
6132
|
function Oa(r) {
|
|
6121
|
-
const { year: e, month: t, day: n } = r, s =
|
|
6133
|
+
const { year: e, month: t, day: n } = r, s = Ah(e, t, n);
|
|
6122
6134
|
return { year: e, ordinal: s, ...Un(r) };
|
|
6123
6135
|
}
|
|
6124
6136
|
function Cf(r) {
|
|
6125
|
-
const { year: e, ordinal: t } = r, { month: n, day: s } =
|
|
6137
|
+
const { year: e, ordinal: t } = r, { month: n, day: s } = Ch(e, t);
|
|
6126
6138
|
return { year: e, month: n, day: s, ...Un(r) };
|
|
6127
6139
|
}
|
|
6128
6140
|
function kf(r, e) {
|
|
@@ -6150,11 +6162,11 @@ function p_(r) {
|
|
|
6150
6162
|
const e = Ln(r.year), t = Ze(r.ordinal, 1, rr(r.year));
|
|
6151
6163
|
return e ? t ? !1 : Be("ordinal", r.ordinal) : Be("year", r.year);
|
|
6152
6164
|
}
|
|
6153
|
-
function
|
|
6165
|
+
function kh(r) {
|
|
6154
6166
|
const e = Ln(r.year), t = Ze(r.month, 1, 12), n = Ze(r.day, 1, bn(r.year, r.month));
|
|
6155
6167
|
return e ? t ? n ? !1 : Be("day", r.day) : Be("month", r.month) : Be("year", r.year);
|
|
6156
6168
|
}
|
|
6157
|
-
function
|
|
6169
|
+
function Ih(r) {
|
|
6158
6170
|
const { hour: e, minute: t, second: n, millisecond: s } = r, i = Ze(e, 0, 23) || e === 24 && t === 0 && n === 0 && s === 0, a = Ze(t, 0, 59), o = Ze(n, 0, 59), c = Ze(s, 0, 999);
|
|
6159
6171
|
return i ? a ? o ? c ? !1 : Be("millisecond", s) : Be("second", n) : Be("minute", t) : Be("hour", e);
|
|
6160
6172
|
}
|
|
@@ -6173,14 +6185,14 @@ function y_(r) {
|
|
|
6173
6185
|
function g_(r) {
|
|
6174
6186
|
return Object.prototype.toString.call(r) === "[object Date]";
|
|
6175
6187
|
}
|
|
6176
|
-
function
|
|
6188
|
+
function xh() {
|
|
6177
6189
|
try {
|
|
6178
6190
|
return typeof Intl < "u" && !!Intl.RelativeTimeFormat;
|
|
6179
6191
|
} catch {
|
|
6180
6192
|
return !1;
|
|
6181
6193
|
}
|
|
6182
6194
|
}
|
|
6183
|
-
function
|
|
6195
|
+
function Nh() {
|
|
6184
6196
|
try {
|
|
6185
6197
|
return typeof Intl < "u" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype);
|
|
6186
6198
|
} catch {
|
|
@@ -6290,7 +6302,7 @@ function $r(r, e = 4, t = 1) {
|
|
|
6290
6302
|
function bo(r) {
|
|
6291
6303
|
return r > 99 ? r : r > be.twoDigitCutoffYear ? 1900 + r : 2e3 + r;
|
|
6292
6304
|
}
|
|
6293
|
-
function
|
|
6305
|
+
function Fh(r, e, t, n = null) {
|
|
6294
6306
|
const s = new Date(r), i = {
|
|
6295
6307
|
hourCycle: "h23",
|
|
6296
6308
|
year: "numeric",
|
|
@@ -6309,7 +6321,7 @@ function jn(r, e) {
|
|
|
6309
6321
|
const n = parseInt(e, 10) || 0, s = t < 0 || Object.is(t, -0) ? -n : n;
|
|
6310
6322
|
return t * 60 + s;
|
|
6311
6323
|
}
|
|
6312
|
-
function
|
|
6324
|
+
function Dh(r) {
|
|
6313
6325
|
const e = Number(r);
|
|
6314
6326
|
if (typeof r == "boolean" || r === "" || !Number.isFinite(e))
|
|
6315
6327
|
throw new xe(`Invalid unit value ${r}`);
|
|
@@ -6321,7 +6333,7 @@ function On(r, e) {
|
|
|
6321
6333
|
if (ur(r, n)) {
|
|
6322
6334
|
const s = r[n];
|
|
6323
6335
|
if (s == null) continue;
|
|
6324
|
-
t[e(n)] =
|
|
6336
|
+
t[e(n)] = Dh(s);
|
|
6325
6337
|
}
|
|
6326
6338
|
return t;
|
|
6327
6339
|
}
|
|
@@ -6354,7 +6366,7 @@ const b_ = [
|
|
|
6354
6366
|
"October",
|
|
6355
6367
|
"November",
|
|
6356
6368
|
"December"
|
|
6357
|
-
],
|
|
6369
|
+
], Mh = [
|
|
6358
6370
|
"Jan",
|
|
6359
6371
|
"Feb",
|
|
6360
6372
|
"Mar",
|
|
@@ -6368,12 +6380,12 @@ const b_ = [
|
|
|
6368
6380
|
"Nov",
|
|
6369
6381
|
"Dec"
|
|
6370
6382
|
], O_ = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
|
|
6371
|
-
function
|
|
6383
|
+
function Ph(r) {
|
|
6372
6384
|
switch (r) {
|
|
6373
6385
|
case "narrow":
|
|
6374
6386
|
return [...O_];
|
|
6375
6387
|
case "short":
|
|
6376
|
-
return [...
|
|
6388
|
+
return [...Mh];
|
|
6377
6389
|
case "long":
|
|
6378
6390
|
return [...b_];
|
|
6379
6391
|
case "numeric":
|
|
@@ -6384,7 +6396,7 @@ function qh(r) {
|
|
|
6384
6396
|
return null;
|
|
6385
6397
|
}
|
|
6386
6398
|
}
|
|
6387
|
-
const
|
|
6399
|
+
const qh = [
|
|
6388
6400
|
"Monday",
|
|
6389
6401
|
"Tuesday",
|
|
6390
6402
|
"Wednesday",
|
|
@@ -6392,23 +6404,23 @@ const Lh = [
|
|
|
6392
6404
|
"Friday",
|
|
6393
6405
|
"Saturday",
|
|
6394
6406
|
"Sunday"
|
|
6395
|
-
],
|
|
6396
|
-
function
|
|
6407
|
+
], Lh = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], E_ = ["M", "T", "W", "T", "F", "S", "S"];
|
|
6408
|
+
function $h(r) {
|
|
6397
6409
|
switch (r) {
|
|
6398
6410
|
case "narrow":
|
|
6399
6411
|
return [...E_];
|
|
6400
6412
|
case "short":
|
|
6401
|
-
return [...$h];
|
|
6402
|
-
case "long":
|
|
6403
6413
|
return [...Lh];
|
|
6414
|
+
case "long":
|
|
6415
|
+
return [...qh];
|
|
6404
6416
|
case "numeric":
|
|
6405
6417
|
return ["1", "2", "3", "4", "5", "6", "7"];
|
|
6406
6418
|
default:
|
|
6407
6419
|
return null;
|
|
6408
6420
|
}
|
|
6409
6421
|
}
|
|
6410
|
-
const
|
|
6411
|
-
function
|
|
6422
|
+
const jh = ["AM", "PM"], S_ = ["Before Christ", "Anno Domini"], T_ = ["BC", "AD"], R_ = ["B", "A"];
|
|
6423
|
+
function Uh(r) {
|
|
6412
6424
|
switch (r) {
|
|
6413
6425
|
case "narrow":
|
|
6414
6426
|
return [...R_];
|
|
@@ -6421,16 +6433,16 @@ function Vh(r) {
|
|
|
6421
6433
|
}
|
|
6422
6434
|
}
|
|
6423
6435
|
function A_(r) {
|
|
6424
|
-
return
|
|
6436
|
+
return jh[r.hour < 12 ? 0 : 1];
|
|
6425
6437
|
}
|
|
6426
6438
|
function C_(r, e) {
|
|
6427
|
-
return
|
|
6439
|
+
return $h(e)[r.weekday - 1];
|
|
6428
6440
|
}
|
|
6429
6441
|
function k_(r, e) {
|
|
6430
|
-
return
|
|
6442
|
+
return Ph(e)[r.month - 1];
|
|
6431
6443
|
}
|
|
6432
6444
|
function I_(r, e) {
|
|
6433
|
-
return
|
|
6445
|
+
return Uh(e)[r.year < 0 ? 0 : 1];
|
|
6434
6446
|
}
|
|
6435
6447
|
function x_(r, e, t = "always", n = !1) {
|
|
6436
6448
|
const s = {
|
|
@@ -6465,25 +6477,25 @@ function Nf(r, e) {
|
|
|
6465
6477
|
}
|
|
6466
6478
|
const N_ = {
|
|
6467
6479
|
D: vn,
|
|
6468
|
-
DD:
|
|
6469
|
-
DDD:
|
|
6470
|
-
DDDD:
|
|
6471
|
-
t:
|
|
6472
|
-
tt:
|
|
6473
|
-
ttt:
|
|
6474
|
-
tttt:
|
|
6475
|
-
T:
|
|
6476
|
-
TT:
|
|
6477
|
-
TTT:
|
|
6478
|
-
TTTT:
|
|
6479
|
-
f:
|
|
6480
|
-
ff:
|
|
6481
|
-
fff:
|
|
6482
|
-
ffff:
|
|
6483
|
-
F:
|
|
6484
|
-
FF:
|
|
6485
|
-
FFF:
|
|
6486
|
-
FFFF:
|
|
6480
|
+
DD: sh,
|
|
6481
|
+
DDD: ih,
|
|
6482
|
+
DDDD: ah,
|
|
6483
|
+
t: oh,
|
|
6484
|
+
tt: ch,
|
|
6485
|
+
ttt: lh,
|
|
6486
|
+
tttt: uh,
|
|
6487
|
+
T: fh,
|
|
6488
|
+
TT: dh,
|
|
6489
|
+
TTT: hh,
|
|
6490
|
+
TTTT: mh,
|
|
6491
|
+
f: ph,
|
|
6492
|
+
ff: gh,
|
|
6493
|
+
fff: vh,
|
|
6494
|
+
ffff: bh,
|
|
6495
|
+
F: yh,
|
|
6496
|
+
FF: _h,
|
|
6497
|
+
FFF: wh,
|
|
6498
|
+
FFFF: Oh
|
|
6487
6499
|
};
|
|
6488
6500
|
class Ne {
|
|
6489
6501
|
static create(e, t = {}) {
|
|
@@ -6725,7 +6737,7 @@ class Ne {
|
|
|
6725
6737
|
return Nf(a, i(c, l));
|
|
6726
6738
|
}
|
|
6727
6739
|
}
|
|
6728
|
-
const
|
|
6740
|
+
const Vh = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
|
|
6729
6741
|
function mr(...r) {
|
|
6730
6742
|
const e = r.reduce((t, n) => t + n.source, "");
|
|
6731
6743
|
return RegExp(`^${e}$`);
|
|
@@ -6749,7 +6761,7 @@ function yr(r, ...e) {
|
|
|
6749
6761
|
}
|
|
6750
6762
|
return [null, null];
|
|
6751
6763
|
}
|
|
6752
|
-
function
|
|
6764
|
+
function Wh(...r) {
|
|
6753
6765
|
return (e, t) => {
|
|
6754
6766
|
const n = {};
|
|
6755
6767
|
let s;
|
|
@@ -6758,9 +6770,9 @@ function zh(...r) {
|
|
|
6758
6770
|
return [n, null, t + s];
|
|
6759
6771
|
};
|
|
6760
6772
|
}
|
|
6761
|
-
const
|
|
6762
|
-
`${tc.source} ?(?:${
|
|
6763
|
-
), j_ = RegExp(`(?: ${
|
|
6773
|
+
const zh = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, F_ = `(?:${zh.source}?(?:\\[(${Vh.source})\\])?)?`, tc = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, Bh = RegExp(`${tc.source}${F_}`), rc = RegExp(`(?:[Tt]${Bh.source})?`), D_ = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, M_ = /(\d{4})-?W(\d\d)(?:-?(\d))?/, P_ = /(\d{4})-?(\d{3})/, q_ = Wh("weekYear", "weekNumber", "weekDay"), L_ = Wh("year", "ordinal"), $_ = /(\d{4})-(\d\d)-(\d\d)/, Zh = RegExp(
|
|
6774
|
+
`${tc.source} ?(?:${zh.source}|(${Vh.source}))?`
|
|
6775
|
+
), j_ = RegExp(`(?: ${Zh.source})?`);
|
|
6764
6776
|
function nr(r, e, t) {
|
|
6765
6777
|
const n = r[e];
|
|
6766
6778
|
return J(n) ? t : At(n);
|
|
@@ -6818,12 +6830,12 @@ const B_ = {
|
|
|
6818
6830
|
function nc(r, e, t, n, s, i, a) {
|
|
6819
6831
|
const o = {
|
|
6820
6832
|
year: e.length === 2 ? bo(At(e)) : At(e),
|
|
6821
|
-
month:
|
|
6833
|
+
month: Mh.indexOf(t) + 1,
|
|
6822
6834
|
day: At(n),
|
|
6823
6835
|
hour: At(s),
|
|
6824
6836
|
minute: At(i)
|
|
6825
6837
|
};
|
|
6826
|
-
return a && (o.second = At(a)), r && (o.weekday = r.length > 3 ?
|
|
6838
|
+
return a && (o.second = At(a)), r && (o.weekday = r.length > 3 ? qh.indexOf(r) + 1 : Lh.indexOf(r) + 1), o;
|
|
6827
6839
|
}
|
|
6828
6840
|
const Z_ = /^(?:(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)))$/;
|
|
6829
6841
|
function G_(r) {
|
|
@@ -6856,7 +6868,7 @@ function Q_(r) {
|
|
|
6856
6868
|
const [, e, t, n, s, i, a, o] = r;
|
|
6857
6869
|
return [nc(e, o, t, n, s, i, a), Me.utcInstance];
|
|
6858
6870
|
}
|
|
6859
|
-
const X_ = mr(D_, rc), ev = mr(M_, rc), tv = mr(P_, rc), rv = mr(
|
|
6871
|
+
const X_ = mr(D_, rc), ev = mr(M_, rc), tv = mr(P_, rc), rv = mr(Bh), Gh = pr(
|
|
6860
6872
|
U_,
|
|
6861
6873
|
gr,
|
|
6862
6874
|
Gr,
|
|
@@ -6879,7 +6891,7 @@ const X_ = mr(D_, rc), ev = mr(M_, rc), tv = mr(P_, rc), rv = mr(Zh), Hh = pr(
|
|
|
6879
6891
|
function av(r) {
|
|
6880
6892
|
return yr(
|
|
6881
6893
|
r,
|
|
6882
|
-
[X_,
|
|
6894
|
+
[X_, Gh],
|
|
6883
6895
|
[ev, nv],
|
|
6884
6896
|
[tv, sv],
|
|
6885
6897
|
[rv, iv]
|
|
@@ -6903,7 +6915,7 @@ const uv = pr(gr);
|
|
|
6903
6915
|
function fv(r) {
|
|
6904
6916
|
return yr(r, [V_, uv]);
|
|
6905
6917
|
}
|
|
6906
|
-
const dv = mr($_, j_), hv = mr(
|
|
6918
|
+
const dv = mr($_, j_), hv = mr(Zh), mv = pr(
|
|
6907
6919
|
gr,
|
|
6908
6920
|
Gr,
|
|
6909
6921
|
Hr
|
|
@@ -6911,11 +6923,11 @@ const dv = mr($_, j_), hv = mr(Gh), mv = pr(
|
|
|
6911
6923
|
function pv(r) {
|
|
6912
6924
|
return yr(
|
|
6913
6925
|
r,
|
|
6914
|
-
[dv,
|
|
6926
|
+
[dv, Gh],
|
|
6915
6927
|
[hv, mv]
|
|
6916
6928
|
);
|
|
6917
6929
|
}
|
|
6918
|
-
const Df = "Invalid Duration",
|
|
6930
|
+
const Df = "Invalid Duration", Hh = {
|
|
6919
6931
|
weeks: {
|
|
6920
6932
|
days: 7,
|
|
6921
6933
|
hours: 168,
|
|
@@ -6960,7 +6972,7 @@ const Df = "Invalid Duration", Kh = {
|
|
|
6960
6972
|
seconds: 720 * 60 * 60,
|
|
6961
6973
|
milliseconds: 720 * 60 * 60 * 1e3
|
|
6962
6974
|
},
|
|
6963
|
-
...
|
|
6975
|
+
...Hh
|
|
6964
6976
|
}, We = 146097 / 400, Kt = 146097 / 4800, gv = {
|
|
6965
6977
|
years: {
|
|
6966
6978
|
quarters: 4,
|
|
@@ -6989,7 +7001,7 @@ const Df = "Invalid Duration", Kh = {
|
|
|
6989
7001
|
seconds: Kt * 24 * 60 * 60,
|
|
6990
7002
|
milliseconds: Kt * 24 * 60 * 60 * 1e3
|
|
6991
7003
|
},
|
|
6992
|
-
...
|
|
7004
|
+
...Hh
|
|
6993
7005
|
}, Ut = [
|
|
6994
7006
|
"years",
|
|
6995
7007
|
"quarters",
|
|
@@ -7010,14 +7022,14 @@ function ut(r, e, t = !1) {
|
|
|
7010
7022
|
};
|
|
7011
7023
|
return new le(n);
|
|
7012
7024
|
}
|
|
7013
|
-
function
|
|
7025
|
+
function Kh(r, e) {
|
|
7014
7026
|
let t = e.milliseconds ?? 0;
|
|
7015
7027
|
for (const n of _v.slice(1))
|
|
7016
7028
|
e[n] && (t += e[n] * r[n].milliseconds);
|
|
7017
7029
|
return t;
|
|
7018
7030
|
}
|
|
7019
7031
|
function Mf(r, e) {
|
|
7020
|
-
const t =
|
|
7032
|
+
const t = Kh(r, e) < 0 ? -1 : 1;
|
|
7021
7033
|
Ut.reduceRight((n, s) => {
|
|
7022
7034
|
if (J(e[s]))
|
|
7023
7035
|
return n;
|
|
@@ -7192,7 +7204,7 @@ class le {
|
|
|
7192
7204
|
millisecond: "milliseconds",
|
|
7193
7205
|
milliseconds: "milliseconds"
|
|
7194
7206
|
}[e && e.toLowerCase()];
|
|
7195
|
-
if (!t) throw new
|
|
7207
|
+
if (!t) throw new nh(e);
|
|
7196
7208
|
return t;
|
|
7197
7209
|
}
|
|
7198
7210
|
/**
|
|
@@ -7352,7 +7364,7 @@ class le {
|
|
|
7352
7364
|
* @return {number}
|
|
7353
7365
|
*/
|
|
7354
7366
|
toMillis() {
|
|
7355
|
-
return this.isValid ?
|
|
7367
|
+
return this.isValid ? Kh(this.matrix, this.values) : NaN;
|
|
7356
7368
|
}
|
|
7357
7369
|
/**
|
|
7358
7370
|
* Returns an milliseconds value of this Duration. Alias of {@link toMillis}
|
|
@@ -7394,7 +7406,7 @@ class le {
|
|
|
7394
7406
|
if (!this.isValid) return this;
|
|
7395
7407
|
const t = {};
|
|
7396
7408
|
for (const n of Object.keys(this.values))
|
|
7397
|
-
t[n] =
|
|
7409
|
+
t[n] = Dh(e(this.values[n], n));
|
|
7398
7410
|
return ut(this, { values: t }, !0);
|
|
7399
7411
|
}
|
|
7400
7412
|
/**
|
|
@@ -8273,7 +8285,7 @@ class en {
|
|
|
8273
8285
|
* @return {Object}
|
|
8274
8286
|
*/
|
|
8275
8287
|
static features() {
|
|
8276
|
-
return { relative:
|
|
8288
|
+
return { relative: xh(), localeWeek: Nh() };
|
|
8277
8289
|
}
|
|
8278
8290
|
}
|
|
8279
8291
|
function qf(r, e) {
|
|
@@ -8312,12 +8324,12 @@ const Ov = "missing Intl.DateTimeFormat.formatToParts support";
|
|
|
8312
8324
|
function fe(r, e = (t) => t) {
|
|
8313
8325
|
return { regex: r, deser: ([t]) => e(d_(t)) };
|
|
8314
8326
|
}
|
|
8315
|
-
const Ev = " ",
|
|
8327
|
+
const Ev = " ", Yh = `[ ${Ev}]`, Jh = new RegExp(Yh, "g");
|
|
8316
8328
|
function Sv(r) {
|
|
8317
|
-
return r.replace(/\./g, "\\.?").replace(
|
|
8329
|
+
return r.replace(/\./g, "\\.?").replace(Jh, Yh);
|
|
8318
8330
|
}
|
|
8319
8331
|
function Lf(r) {
|
|
8320
|
-
return r.replace(/\./g, "").replace(
|
|
8332
|
+
return r.replace(/\./g, "").replace(Jh, " ").toLowerCase();
|
|
8321
8333
|
}
|
|
8322
8334
|
function Xe(r, e) {
|
|
8323
8335
|
return r === null ? null : {
|
|
@@ -8335,10 +8347,10 @@ function Tv(r) {
|
|
|
8335
8347
|
return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
8336
8348
|
}
|
|
8337
8349
|
function Rv(r, e) {
|
|
8338
|
-
const t = Qe(e), n = Qe(e, "{2}"), s = Qe(e, "{3}"), i = Qe(e, "{4}"), a = Qe(e, "{6}"), o = Qe(e, "{1,2}"), c = Qe(e, "{1,3}"), l = Qe(e, "{1,6}"), u = Qe(e, "{1,9}"), f = Qe(e, "{2,4}"), d = Qe(e, "{4,6}"), h = (
|
|
8350
|
+
const t = Qe(e), n = Qe(e, "{2}"), s = Qe(e, "{3}"), i = Qe(e, "{4}"), a = Qe(e, "{6}"), o = Qe(e, "{1,2}"), c = Qe(e, "{1,3}"), l = Qe(e, "{1,6}"), u = Qe(e, "{1,9}"), f = Qe(e, "{2,4}"), d = Qe(e, "{4,6}"), h = (y) => ({ regex: RegExp(Tv(y.val)), deser: ([O]) => O, literal: !0 }), v = ((y) => {
|
|
8339
8351
|
if (r.literal)
|
|
8340
|
-
return h(
|
|
8341
|
-
switch (
|
|
8352
|
+
return h(y);
|
|
8353
|
+
switch (y.val) {
|
|
8342
8354
|
// era
|
|
8343
8355
|
case "G":
|
|
8344
8356
|
return Xe(e.eras("short"), 0);
|
|
@@ -8453,7 +8465,7 @@ function Rv(r, e) {
|
|
|
8453
8465
|
case " ":
|
|
8454
8466
|
return tn(/[^\S\n\r]/);
|
|
8455
8467
|
default:
|
|
8456
|
-
return h(
|
|
8468
|
+
return h(y);
|
|
8457
8469
|
}
|
|
8458
8470
|
})(r) || {
|
|
8459
8471
|
invalidReason: Ov
|
|
@@ -8585,15 +8597,15 @@ function Nv() {
|
|
|
8585
8597
|
function Fv(r, e) {
|
|
8586
8598
|
if (r.literal)
|
|
8587
8599
|
return r;
|
|
8588
|
-
const t = Ne.macroTokenToFormatOpts(r.val), n =
|
|
8600
|
+
const t = Ne.macroTokenToFormatOpts(r.val), n = tm(t, e);
|
|
8589
8601
|
return n == null || n.includes(void 0) ? r : n;
|
|
8590
8602
|
}
|
|
8591
|
-
function
|
|
8603
|
+
function Qh(r, e) {
|
|
8592
8604
|
return Array.prototype.concat(...r.map((t) => Fv(t, e)));
|
|
8593
8605
|
}
|
|
8594
|
-
class
|
|
8606
|
+
class Xh {
|
|
8595
8607
|
constructor(e, t) {
|
|
8596
|
-
if (this.locale = e, this.format = t, this.tokens =
|
|
8608
|
+
if (this.locale = e, this.format = t, this.tokens = Qh(Ne.parseFormat(t), e), this.units = this.tokens.map((n) => Rv(n, e)), this.disqualifyingUnit = this.units.find((n) => n.invalidReason), !this.disqualifyingUnit) {
|
|
8597
8609
|
const [n, s] = kv(this.units);
|
|
8598
8610
|
this.regex = RegExp(n, "i"), this.handlers = s;
|
|
8599
8611
|
}
|
|
@@ -8625,14 +8637,14 @@ class em {
|
|
|
8625
8637
|
return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;
|
|
8626
8638
|
}
|
|
8627
8639
|
}
|
|
8628
|
-
function
|
|
8629
|
-
return new
|
|
8640
|
+
function em(r, e, t) {
|
|
8641
|
+
return new Xh(r, t).explainFromTokens(e);
|
|
8630
8642
|
}
|
|
8631
8643
|
function Dv(r, e, t) {
|
|
8632
|
-
const { result: n, zone: s, specificOffset: i, invalidReason: a } =
|
|
8644
|
+
const { result: n, zone: s, specificOffset: i, invalidReason: a } = em(r, e, t);
|
|
8633
8645
|
return [n, s, i, a];
|
|
8634
8646
|
}
|
|
8635
|
-
function
|
|
8647
|
+
function tm(r, e) {
|
|
8636
8648
|
if (!r)
|
|
8637
8649
|
return null;
|
|
8638
8650
|
const n = Ne.create(e, r).dtFormatter(Nv()), s = n.formatToParts(), i = n.resolvedOptions();
|
|
@@ -8663,7 +8675,7 @@ function qt(r, e) {
|
|
|
8663
8675
|
};
|
|
8664
8676
|
return new z({ ...t, ...e, old: t });
|
|
8665
8677
|
}
|
|
8666
|
-
function
|
|
8678
|
+
function rm(r, e, t) {
|
|
8667
8679
|
let n = r - e * 60 * 1e3;
|
|
8668
8680
|
const s = t.offset(n);
|
|
8669
8681
|
if (e === s)
|
|
@@ -8686,7 +8698,7 @@ function rn(r, e) {
|
|
|
8686
8698
|
};
|
|
8687
8699
|
}
|
|
8688
8700
|
function an(r, e, t) {
|
|
8689
|
-
return
|
|
8701
|
+
return rm($n(r), e, t);
|
|
8690
8702
|
}
|
|
8691
8703
|
function Uf(r, e) {
|
|
8692
8704
|
const t = r.o, n = r.c.year + Math.trunc(e.years), s = r.c.month + Math.trunc(e.months) + Math.trunc(e.quarters) * 3, i = {
|
|
@@ -8705,7 +8717,7 @@ function Uf(r, e) {
|
|
|
8705
8717
|
seconds: e.seconds,
|
|
8706
8718
|
milliseconds: e.milliseconds
|
|
8707
8719
|
}).as("milliseconds"), o = $n(i);
|
|
8708
|
-
let [c, l] =
|
|
8720
|
+
let [c, l] = rm(o, t, r.zone);
|
|
8709
8721
|
return a !== 0 && (c += a, l = r.zone.offset(c)), { ts: c, o: l };
|
|
8710
8722
|
}
|
|
8711
8723
|
function Jt(r, e, t, n, s, i) {
|
|
@@ -8759,7 +8771,7 @@ function Vf(r, e, t, n, s, i, a) {
|
|
|
8759
8771
|
}
|
|
8760
8772
|
return s && (r.isOffsetFixed && r.offset === 0 && !i ? c += "Z" : r.o < 0 ? (c += "-", c += Re(Math.trunc(-r.o / 60)), c += ":", c += Re(Math.trunc(-r.o % 60))) : (c += "+", c += Re(Math.trunc(r.o / 60)), c += ":", c += Re(Math.trunc(r.o % 60)))), i && (c += "[" + r.zone.ianaName + "]"), c;
|
|
8761
8773
|
}
|
|
8762
|
-
const
|
|
8774
|
+
const nm = {
|
|
8763
8775
|
month: 1,
|
|
8764
8776
|
day: 1,
|
|
8765
8777
|
hour: 0,
|
|
@@ -8815,7 +8827,7 @@ function cn(r) {
|
|
|
8815
8827
|
weekyears: "weekYear",
|
|
8816
8828
|
ordinal: "ordinal"
|
|
8817
8829
|
}[r.toLowerCase()];
|
|
8818
|
-
if (!e) throw new
|
|
8830
|
+
if (!e) throw new nh(r);
|
|
8819
8831
|
return e;
|
|
8820
8832
|
}
|
|
8821
8833
|
function Wf(r) {
|
|
@@ -8850,8 +8862,8 @@ function zf(r, e) {
|
|
|
8850
8862
|
s = be.now();
|
|
8851
8863
|
else {
|
|
8852
8864
|
for (const c of on)
|
|
8853
|
-
J(r[c]) && (r[c] =
|
|
8854
|
-
const a =
|
|
8865
|
+
J(r[c]) && (r[c] = nm[c]);
|
|
8866
|
+
const a = kh(r) || Ih(r);
|
|
8855
8867
|
if (a)
|
|
8856
8868
|
return z.invalid(a);
|
|
8857
8869
|
const o = $v(t);
|
|
@@ -9065,20 +9077,20 @@ class z {
|
|
|
9065
9077
|
if (d && u)
|
|
9066
9078
|
throw new er("Can't mix ordinal dates with month/day");
|
|
9067
9079
|
const v = p || i.weekday && !h;
|
|
9068
|
-
let
|
|
9069
|
-
v ? (
|
|
9080
|
+
let y, O, R = rn(c, l);
|
|
9081
|
+
v ? (y = qv, O = Mv, R = wn(R, a, o)) : u ? (y = Lv, O = Pv, R = Oa(R)) : (y = on, O = nm);
|
|
9070
9082
|
let C = !1;
|
|
9071
|
-
for (const
|
|
9072
|
-
const A = i[
|
|
9073
|
-
J(A) ? C ? i[
|
|
9083
|
+
for (const _ of y) {
|
|
9084
|
+
const A = i[_];
|
|
9085
|
+
J(A) ? C ? i[_] = O[_] : i[_] = R[_] : C = !0;
|
|
9074
9086
|
}
|
|
9075
|
-
const w = v ? m_(i, a, o) : u ? p_(i) :
|
|
9087
|
+
const w = v ? m_(i, a, o) : u ? p_(i) : kh(i), E = w || Ih(i);
|
|
9076
9088
|
if (E)
|
|
9077
9089
|
return z.invalid(E);
|
|
9078
|
-
const I = v ? Af(i, a, o) : u ? Cf(i) : i, [T,
|
|
9090
|
+
const I = v ? Af(i, a, o) : u ? Cf(i) : i, [T, g] = an(I, l, n), N = new z({
|
|
9079
9091
|
ts: T,
|
|
9080
9092
|
zone: n,
|
|
9081
|
-
o:
|
|
9093
|
+
o: g,
|
|
9082
9094
|
loc: s
|
|
9083
9095
|
});
|
|
9084
9096
|
return i.weekday && h && e.weekday !== N.weekday ? z.invalid(
|
|
@@ -9230,7 +9242,7 @@ class z {
|
|
|
9230
9242
|
* @returns {string}
|
|
9231
9243
|
*/
|
|
9232
9244
|
static parseFormatForOpts(e, t = {}) {
|
|
9233
|
-
const n =
|
|
9245
|
+
const n = tm(e, he.fromObject(t));
|
|
9234
9246
|
return n ? n.map((s) => s ? s.val : null).join("") : null;
|
|
9235
9247
|
}
|
|
9236
9248
|
/**
|
|
@@ -9241,7 +9253,7 @@ class z {
|
|
|
9241
9253
|
* @returns {string}
|
|
9242
9254
|
*/
|
|
9243
9255
|
static expandFormat(e, t = {}) {
|
|
9244
|
-
return
|
|
9256
|
+
return Qh(Ne.parseFormat(e), he.fromObject(t)).map((s) => s.val).join("");
|
|
9245
9257
|
}
|
|
9246
9258
|
static resetCache() {
|
|
9247
9259
|
Ar = void 0, Oo.clear();
|
|
@@ -10234,7 +10246,7 @@ class z {
|
|
|
10234
10246
|
numberingSystem: i,
|
|
10235
10247
|
defaultToEN: !0
|
|
10236
10248
|
});
|
|
10237
|
-
return
|
|
10249
|
+
return em(a, e, t);
|
|
10238
10250
|
}
|
|
10239
10251
|
/**
|
|
10240
10252
|
* @deprecated use fromFormatExplain instead
|
|
@@ -10260,7 +10272,7 @@ class z {
|
|
|
10260
10272
|
numberingSystem: s,
|
|
10261
10273
|
defaultToEN: !0
|
|
10262
10274
|
});
|
|
10263
|
-
return new
|
|
10275
|
+
return new Xh(i, e);
|
|
10264
10276
|
}
|
|
10265
10277
|
/**
|
|
10266
10278
|
* Create a DateTime from an input string and format parser.
|
|
@@ -10309,7 +10321,7 @@ class z {
|
|
|
10309
10321
|
* @type {Object}
|
|
10310
10322
|
*/
|
|
10311
10323
|
static get DATE_MED() {
|
|
10312
|
-
return
|
|
10324
|
+
return sh;
|
|
10313
10325
|
}
|
|
10314
10326
|
/**
|
|
10315
10327
|
* {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'
|
|
@@ -10323,98 +10335,98 @@ class z {
|
|
|
10323
10335
|
* @type {Object}
|
|
10324
10336
|
*/
|
|
10325
10337
|
static get DATE_FULL() {
|
|
10326
|
-
return
|
|
10338
|
+
return ih;
|
|
10327
10339
|
}
|
|
10328
10340
|
/**
|
|
10329
10341
|
* {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'
|
|
10330
10342
|
* @type {Object}
|
|
10331
10343
|
*/
|
|
10332
10344
|
static get DATE_HUGE() {
|
|
10333
|
-
return
|
|
10345
|
+
return ah;
|
|
10334
10346
|
}
|
|
10335
10347
|
/**
|
|
10336
10348
|
* {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.
|
|
10337
10349
|
* @type {Object}
|
|
10338
10350
|
*/
|
|
10339
10351
|
static get TIME_SIMPLE() {
|
|
10340
|
-
return
|
|
10352
|
+
return oh;
|
|
10341
10353
|
}
|
|
10342
10354
|
/**
|
|
10343
10355
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.
|
|
10344
10356
|
* @type {Object}
|
|
10345
10357
|
*/
|
|
10346
10358
|
static get TIME_WITH_SECONDS() {
|
|
10347
|
-
return
|
|
10359
|
+
return ch;
|
|
10348
10360
|
}
|
|
10349
10361
|
/**
|
|
10350
10362
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.
|
|
10351
10363
|
* @type {Object}
|
|
10352
10364
|
*/
|
|
10353
10365
|
static get TIME_WITH_SHORT_OFFSET() {
|
|
10354
|
-
return
|
|
10366
|
+
return lh;
|
|
10355
10367
|
}
|
|
10356
10368
|
/**
|
|
10357
10369
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
10358
10370
|
* @type {Object}
|
|
10359
10371
|
*/
|
|
10360
10372
|
static get TIME_WITH_LONG_OFFSET() {
|
|
10361
|
-
return
|
|
10373
|
+
return uh;
|
|
10362
10374
|
}
|
|
10363
10375
|
/**
|
|
10364
10376
|
* {@link DateTime#toLocaleString} format like '09:30', always 24-hour.
|
|
10365
10377
|
* @type {Object}
|
|
10366
10378
|
*/
|
|
10367
10379
|
static get TIME_24_SIMPLE() {
|
|
10368
|
-
return
|
|
10380
|
+
return fh;
|
|
10369
10381
|
}
|
|
10370
10382
|
/**
|
|
10371
10383
|
* {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.
|
|
10372
10384
|
* @type {Object}
|
|
10373
10385
|
*/
|
|
10374
10386
|
static get TIME_24_WITH_SECONDS() {
|
|
10375
|
-
return
|
|
10387
|
+
return dh;
|
|
10376
10388
|
}
|
|
10377
10389
|
/**
|
|
10378
10390
|
* {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.
|
|
10379
10391
|
* @type {Object}
|
|
10380
10392
|
*/
|
|
10381
10393
|
static get TIME_24_WITH_SHORT_OFFSET() {
|
|
10382
|
-
return
|
|
10394
|
+
return hh;
|
|
10383
10395
|
}
|
|
10384
10396
|
/**
|
|
10385
10397
|
* {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.
|
|
10386
10398
|
* @type {Object}
|
|
10387
10399
|
*/
|
|
10388
10400
|
static get TIME_24_WITH_LONG_OFFSET() {
|
|
10389
|
-
return
|
|
10401
|
+
return mh;
|
|
10390
10402
|
}
|
|
10391
10403
|
/**
|
|
10392
10404
|
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
10393
10405
|
* @type {Object}
|
|
10394
10406
|
*/
|
|
10395
10407
|
static get DATETIME_SHORT() {
|
|
10396
|
-
return
|
|
10408
|
+
return ph;
|
|
10397
10409
|
}
|
|
10398
10410
|
/**
|
|
10399
10411
|
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
10400
10412
|
* @type {Object}
|
|
10401
10413
|
*/
|
|
10402
10414
|
static get DATETIME_SHORT_WITH_SECONDS() {
|
|
10403
|
-
return
|
|
10415
|
+
return yh;
|
|
10404
10416
|
}
|
|
10405
10417
|
/**
|
|
10406
10418
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
10407
10419
|
* @type {Object}
|
|
10408
10420
|
*/
|
|
10409
10421
|
static get DATETIME_MED() {
|
|
10410
|
-
return
|
|
10422
|
+
return gh;
|
|
10411
10423
|
}
|
|
10412
10424
|
/**
|
|
10413
10425
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
10414
10426
|
* @type {Object}
|
|
10415
10427
|
*/
|
|
10416
10428
|
static get DATETIME_MED_WITH_SECONDS() {
|
|
10417
|
-
return
|
|
10429
|
+
return _h;
|
|
10418
10430
|
}
|
|
10419
10431
|
/**
|
|
10420
10432
|
* {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
@@ -10428,28 +10440,28 @@ class z {
|
|
|
10428
10440
|
* @type {Object}
|
|
10429
10441
|
*/
|
|
10430
10442
|
static get DATETIME_FULL() {
|
|
10431
|
-
return
|
|
10443
|
+
return vh;
|
|
10432
10444
|
}
|
|
10433
10445
|
/**
|
|
10434
10446
|
* {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.
|
|
10435
10447
|
* @type {Object}
|
|
10436
10448
|
*/
|
|
10437
10449
|
static get DATETIME_FULL_WITH_SECONDS() {
|
|
10438
|
-
return
|
|
10450
|
+
return wh;
|
|
10439
10451
|
}
|
|
10440
10452
|
/**
|
|
10441
10453
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
10442
10454
|
* @type {Object}
|
|
10443
10455
|
*/
|
|
10444
10456
|
static get DATETIME_HUGE() {
|
|
10445
|
-
return
|
|
10457
|
+
return bh;
|
|
10446
10458
|
}
|
|
10447
10459
|
/**
|
|
10448
10460
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
10449
10461
|
* @type {Object}
|
|
10450
10462
|
*/
|
|
10451
10463
|
static get DATETIME_HUGE_WITH_SECONDS() {
|
|
10452
|
-
return
|
|
10464
|
+
return Oh;
|
|
10453
10465
|
}
|
|
10454
10466
|
}
|
|
10455
10467
|
function vr(r) {
|
|
@@ -10469,42 +10481,42 @@ const Gf = async (r, e) => {
|
|
|
10469
10481
|
if (!t.valid)
|
|
10470
10482
|
throw new Error(`VALIDATION_ERROR: ${t.message}`);
|
|
10471
10483
|
}
|
|
10472
|
-
},
|
|
10484
|
+
}, sm = async (r, e, t, n, s, i) => {
|
|
10473
10485
|
await Gf(n.custom?.preValidate, s);
|
|
10474
10486
|
for (const o of n.fields)
|
|
10475
10487
|
await Gf(o.custom?.preValidate, s);
|
|
10476
10488
|
return Ug(r, t, i).parse(e), e;
|
|
10477
|
-
}, sc = (r, e, t, n, s, i, a, o, c, l, u, f, d, h, p, v,
|
|
10489
|
+
}, sc = (r, e, t, n, s, i, a, o, c, l, u, f, d, h, p, v, y, O, R, C, w) => {
|
|
10478
10490
|
const { fields: E } = a;
|
|
10479
|
-
E.filter((
|
|
10480
|
-
r !== "delete" && (typeof s[
|
|
10491
|
+
E.filter((g) => "unique" in g && g.unique).forEach((g) => {
|
|
10492
|
+
r !== "delete" && (typeof s[g.name] == "string" || typeof s[g.name] == "number") && e.set(h(g, s[g.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||")), {
|
|
10481
10493
|
id: n,
|
|
10482
10494
|
Collection_Path: t
|
|
10483
10495
|
});
|
|
10484
|
-
}), E.forEach((
|
|
10485
|
-
if (
|
|
10486
|
-
const N = lg(
|
|
10487
|
-
s[
|
|
10488
|
-
s[A.name] !== void 0 && (_e(A) ?
|
|
10489
|
-
}), Object.keys(
|
|
10496
|
+
}), E.forEach((g) => {
|
|
10497
|
+
if (ag(g, a, i)) {
|
|
10498
|
+
const N = lg(g, a, i), _ = {};
|
|
10499
|
+
s[g.name] !== void 0 && (_[g.name] = s[g.name], _e(g) && (_[`${g.name}_Array`] = s[`${g.name}_Array`])), N.forEach((A) => {
|
|
10500
|
+
s[A.name] !== void 0 && (_e(A) ? _[`${A.name}_Array`] = s[`${A.name}_Array`] : _[A.name] = s[A.name]);
|
|
10501
|
+
}), Object.keys(_).length > 0 && (r === "create" && (_.Collection_Path = t, _.Collection_Path_String = t.join("/"), e.set(d(g), _)), r === "update" && e.update(d(g), _), r === "delete" && e.delete(d(g)));
|
|
10490
10502
|
}
|
|
10491
10503
|
});
|
|
10492
10504
|
const I = c[a.labels.collection];
|
|
10493
|
-
for (const
|
|
10494
|
-
const N = ug(
|
|
10505
|
+
for (const g of I) {
|
|
10506
|
+
const N = ug(g, a), _ = { ...s };
|
|
10495
10507
|
N.forEach((A) => {
|
|
10496
|
-
delete
|
|
10497
|
-
}), Object.keys(
|
|
10508
|
+
delete _[A.name], delete _[`${A.name}_Array`], delete _[`${A.name}_Single`], delete _[`${A.name}_Lowercase`];
|
|
10509
|
+
}), Object.keys(_).length > 0 && (r === "create" && (_.Collection_Path ||= t, _.Collection_Path_String = t.join("/"), e.set(p(g.key), _)), r === "update" && e.update(p(g.key), _), r === "delete" && e.delete(p(g.key)));
|
|
10498
10510
|
}
|
|
10499
10511
|
if (r === "delete")
|
|
10500
10512
|
return;
|
|
10501
|
-
const T = E.filter((
|
|
10513
|
+
const T = E.filter((g) => _e(g) && g.twoWay);
|
|
10502
10514
|
if (!o?.noTwoWay) {
|
|
10503
|
-
for (const
|
|
10515
|
+
for (const g of T)
|
|
10504
10516
|
throw new Error("VALIDATION_ERROR: batchSize is required");
|
|
10505
|
-
for (const
|
|
10517
|
+
for (const g of T)
|
|
10506
10518
|
throw new Error("VALIDATION_ERROR: batchSize is required");
|
|
10507
|
-
for (const
|
|
10519
|
+
for (const g of T)
|
|
10508
10520
|
throw new Error("VALIDATION_ERROR: batchSize is required");
|
|
10509
10521
|
}
|
|
10510
10522
|
};
|
|
@@ -10550,10 +10562,10 @@ function Wv() {
|
|
|
10550
10562
|
return xa = t, xa;
|
|
10551
10563
|
}
|
|
10552
10564
|
var Na, Qf;
|
|
10553
|
-
function
|
|
10565
|
+
function im() {
|
|
10554
10566
|
if (Qf) return Na;
|
|
10555
10567
|
Qf = 1;
|
|
10556
|
-
var r =
|
|
10568
|
+
var r = Id(), e = Wo(), t = Do(), n = Nd(), s = Object.getOwnPropertySymbols, i = s ? function(a) {
|
|
10557
10569
|
for (var o = []; a; )
|
|
10558
10570
|
r(o, t(a)), a = e(a);
|
|
10559
10571
|
return o;
|
|
@@ -10564,7 +10576,7 @@ var Fa, Xf;
|
|
|
10564
10576
|
function zv() {
|
|
10565
10577
|
if (Xf) return Fa;
|
|
10566
10578
|
Xf = 1;
|
|
10567
|
-
var r = Vr(), e =
|
|
10579
|
+
var r = Vr(), e = im();
|
|
10568
10580
|
function t(n, s) {
|
|
10569
10581
|
return r(n, e(n), s);
|
|
10570
10582
|
}
|
|
@@ -10574,7 +10586,7 @@ var Da, ed;
|
|
|
10574
10586
|
function Bv() {
|
|
10575
10587
|
if (ed) return Da;
|
|
10576
10588
|
ed = 1;
|
|
10577
|
-
var r =
|
|
10589
|
+
var r = xd(), e = im(), t = Wr();
|
|
10578
10590
|
function n(s) {
|
|
10579
10591
|
return r(s, t, e);
|
|
10580
10592
|
}
|
|
@@ -10627,10 +10639,10 @@ var $a, id;
|
|
|
10627
10639
|
function Yv() {
|
|
10628
10640
|
if (id) return $a;
|
|
10629
10641
|
id = 1;
|
|
10630
|
-
var r = Vo(), e = Gv(), t = Hv(), n = Kv(), s =
|
|
10631
|
-
function
|
|
10642
|
+
var r = Vo(), e = Gv(), t = Hv(), n = Kv(), s = Vd(), 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]", v = "[object Float32Array]", y = "[object Float64Array]", O = "[object Int8Array]", R = "[object Int16Array]", C = "[object Int32Array]", w = "[object Uint8Array]", E = "[object Uint8ClampedArray]", I = "[object Uint16Array]", T = "[object Uint32Array]";
|
|
10643
|
+
function g(N, _, A) {
|
|
10632
10644
|
var b = N.constructor;
|
|
10633
|
-
switch (
|
|
10645
|
+
switch (_) {
|
|
10634
10646
|
case h:
|
|
10635
10647
|
return r(N);
|
|
10636
10648
|
case i:
|
|
@@ -10639,7 +10651,7 @@ function Yv() {
|
|
|
10639
10651
|
case p:
|
|
10640
10652
|
return e(N, A);
|
|
10641
10653
|
case v:
|
|
10642
|
-
case
|
|
10654
|
+
case y:
|
|
10643
10655
|
case O:
|
|
10644
10656
|
case R:
|
|
10645
10657
|
case C:
|
|
@@ -10661,7 +10673,7 @@ function Yv() {
|
|
|
10661
10673
|
return n(N);
|
|
10662
10674
|
}
|
|
10663
10675
|
}
|
|
10664
|
-
return $a =
|
|
10676
|
+
return $a = g, $a;
|
|
10665
10677
|
}
|
|
10666
10678
|
var ja, ad;
|
|
10667
10679
|
function Jv() {
|
|
@@ -10701,10 +10713,10 @@ var za, ud;
|
|
|
10701
10713
|
function tw() {
|
|
10702
10714
|
if (ud) return za;
|
|
10703
10715
|
ud = 1;
|
|
10704
|
-
var r = Fo(), e = jv(), t = zo(), n = Uv(), s = Vv(), i =
|
|
10705
|
-
X[N] = X[
|
|
10706
|
-
function me(K,
|
|
10707
|
-
var De, Se =
|
|
10716
|
+
var r = Fo(), e = jv(), t = zo(), n = Uv(), s = Vv(), i = Ud(), a = Wd(), o = Wv(), c = zv(), l = qd(), u = Bv(), f = Mn(), d = Zv(), h = Yv(), p = zd(), v = Dt(), y = Fn(), O = Qv(), R = vt(), C = ew(), w = jo(), E = Wr(), I = 1, T = 2, g = 4, N = "[object Arguments]", _ = "[object Array]", A = "[object Boolean]", b = "[object Date]", m = "[object Error]", S = "[object Function]", k = "[object GeneratorFunction]", D = "[object Map]", x = "[object Number]", M = "[object Object]", $ = "[object RegExp]", G = "[object Set]", ae = "[object String]", P = "[object Symbol]", B = "[object WeakMap]", te = "[object ArrayBuffer]", Je = "[object DataView]", Ve = "[object Float32Array]", Ce = "[object Float64Array]", st = "[object Int8Array]", Z = "[object Int16Array]", H = "[object Int32Array]", j = "[object Uint8Array]", Y = "[object Uint8ClampedArray]", W = "[object Uint16Array]", de = "[object Uint32Array]", X = {};
|
|
10717
|
+
X[N] = X[_] = X[te] = X[Je] = X[A] = X[b] = X[Ve] = X[Ce] = X[st] = X[Z] = X[H] = X[D] = X[x] = X[M] = X[$] = X[G] = X[ae] = X[P] = X[j] = X[Y] = X[W] = X[de] = !0, X[m] = X[S] = X[B] = !1;
|
|
10718
|
+
function me(K, ne, Ie, Gt, bt, it) {
|
|
10719
|
+
var De, Se = ne & I, Ot = ne & T, Am = ne & g;
|
|
10708
10720
|
if (Ie && (De = bt ? Ie(K, Gt, bt, it) : Ie(K)), De !== void 0)
|
|
10709
10721
|
return De;
|
|
10710
10722
|
if (!R(K))
|
|
@@ -10715,7 +10727,7 @@ function tw() {
|
|
|
10715
10727
|
return a(K, De);
|
|
10716
10728
|
} else {
|
|
10717
10729
|
var Ht = f(K), yc = Ht == S || Ht == k;
|
|
10718
|
-
if (
|
|
10730
|
+
if (y(K))
|
|
10719
10731
|
return i(K, Se);
|
|
10720
10732
|
if (Ht == M || Ht == N || yc && !bt) {
|
|
10721
10733
|
if (De = Ot || yc ? {} : p(K), !Se)
|
|
@@ -10731,13 +10743,13 @@ function tw() {
|
|
|
10731
10743
|
if (gc)
|
|
10732
10744
|
return gc;
|
|
10733
10745
|
it.set(K, De), C(K) ? K.forEach(function(Et) {
|
|
10734
|
-
De.add(me(Et,
|
|
10746
|
+
De.add(me(Et, ne, Ie, Et, K, it));
|
|
10735
10747
|
}) : O(K) && K.forEach(function(Et, Mt) {
|
|
10736
|
-
De.set(Mt, me(Et,
|
|
10748
|
+
De.set(Mt, me(Et, ne, Ie, Mt, K, it));
|
|
10737
10749
|
});
|
|
10738
|
-
var
|
|
10750
|
+
var Cm = Am ? Ot ? u : l : Ot ? E : w, _c = pc ? void 0 : Cm(K);
|
|
10739
10751
|
return e(_c || K, function(Et, Mt) {
|
|
10740
|
-
_c && (Mt = Et, Et = K[Mt]), t(De, Mt, me(Et,
|
|
10752
|
+
_c && (Mt = Et, Et = K[Mt]), t(De, Mt, me(Et, ne, Ie, Mt, K, it));
|
|
10741
10753
|
}), De;
|
|
10742
10754
|
}
|
|
10743
10755
|
return za = me, za;
|
|
@@ -10800,14 +10812,14 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10800
10812
|
return !1;
|
|
10801
10813
|
}
|
|
10802
10814
|
return !(new Blob([r]).size > 1500);
|
|
10803
|
-
},
|
|
10815
|
+
}, am = (r, e) => {
|
|
10804
10816
|
const t = Object.keys(r);
|
|
10805
10817
|
e.forEach((n) => {
|
|
10806
10818
|
n in t || e.delete(n);
|
|
10807
10819
|
}), t.forEach((n) => {
|
|
10808
10820
|
e.add(n);
|
|
10809
10821
|
}), e.has("id") || e.add("id");
|
|
10810
|
-
},
|
|
10822
|
+
}, om = (r, e) => {
|
|
10811
10823
|
Object.keys(r).forEach((t) => {
|
|
10812
10824
|
let n = !1;
|
|
10813
10825
|
e.forEach((s) => {
|
|
@@ -10845,7 +10857,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10845
10857
|
const o = s.collections[a], { labels: c, fields: l, preloadCache: u } = o, f = lt(a), d = i.collections?.[c.collection];
|
|
10846
10858
|
if (!i.Role)
|
|
10847
10859
|
throw new Error("PERMISSION_DENIED");
|
|
10848
|
-
const h = d && _t("Read", d), p = An(o, s, i), v =
|
|
10860
|
+
const h = d && _t("Read", d), p = An(o, s, i), v = Ed(o, i), y = ko(o, i), O = Sd(o, s, i), R = (m = []) => {
|
|
10849
10861
|
const S = [];
|
|
10850
10862
|
if (h)
|
|
10851
10863
|
S.push(pe(Mr(n, "system_fields", c.collection, `${c.collection}-${e.key}`), ge("Collection_Path_String", "==", r.join("/")), ...m));
|
|
@@ -10854,7 +10866,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10854
10866
|
S.push(pe(Mr(n, "system_fields", c.collection, `${c.collection}-${k.field}`), ge("Collection_Path_String", "==", r.join("/")), ...m));
|
|
10855
10867
|
return S;
|
|
10856
10868
|
}, C = v.filter((m) => "operations" in m && m.operations ? m.operations.includes("Read") : !0);
|
|
10857
|
-
if (t || C.length === 0 &&
|
|
10869
|
+
if (t || C.length === 0 && y.length === 0 && O.length === 0)
|
|
10858
10870
|
return R();
|
|
10859
10871
|
let w = 0;
|
|
10860
10872
|
const E = (m) => {
|
|
@@ -10872,23 +10884,23 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10872
10884
|
u?.roles.includes(i.Role) && u.range && E(u.range.fields.length);
|
|
10873
10885
|
const I = f.admin?.statusField;
|
|
10874
10886
|
I && !u?.roles.includes(i.Role) && E(Math.max(I.active?.length || 0, I.archived?.length || 0));
|
|
10875
|
-
const T = w === 0 ? 30 : Math.max(1, Math.floor(30 / w)),
|
|
10876
|
-
C.filter((m) => m.type === "Record_Owner").forEach(() =>
|
|
10887
|
+
const T = w === 0 ? 30 : Math.max(1, Math.floor(30 / w)), g = [];
|
|
10888
|
+
C.filter((m) => m.type === "Record_Owner").forEach(() => g.push(ge("Created_By", "==", i.User_ID))), C.filter((m) => m.type === "Record_User").forEach((m) => {
|
|
10877
10889
|
if ("collectionField" in m) {
|
|
10878
|
-
const S =
|
|
10879
|
-
|
|
10890
|
+
const S = re(l, m.collectionField);
|
|
10891
|
+
g.push(ge(`${S.name}_Array`, "array-contains", i.Doc_ID));
|
|
10880
10892
|
}
|
|
10881
10893
|
}), C.filter((m) => m.type === "Record_Property").forEach((m) => {
|
|
10882
10894
|
if ("propertyField" in m) {
|
|
10883
10895
|
const S = m.roles.find((D) => D.role === i.Role);
|
|
10884
10896
|
if (!S)
|
|
10885
10897
|
throw new Error("PERMISSION_DENIED");
|
|
10886
|
-
const k =
|
|
10887
|
-
k.type === "Array" ?
|
|
10898
|
+
const k = re(l, m.propertyField);
|
|
10899
|
+
k.type === "Array" ? g.push(ge(k.name, "array-contains-any", S.values)) : g.push(ge(k.name, "in", S.values));
|
|
10888
10900
|
}
|
|
10889
10901
|
});
|
|
10890
10902
|
const N = [];
|
|
10891
|
-
|
|
10903
|
+
y.filter((m) => m.type === "Individual").forEach((m) => {
|
|
10892
10904
|
const S = d?.individualEntities, k = [];
|
|
10893
10905
|
if (S) {
|
|
10894
10906
|
const D = m.singleQuery ? m.singleQuery : T;
|
|
@@ -10898,18 +10910,18 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10898
10910
|
}
|
|
10899
10911
|
if (!m.singleQuery)
|
|
10900
10912
|
k.forEach((x) => {
|
|
10901
|
-
N.push(...R(
|
|
10913
|
+
N.push(...R(g.concat(ge("id", "in", x))));
|
|
10902
10914
|
});
|
|
10903
10915
|
else {
|
|
10904
10916
|
if (S.length > D)
|
|
10905
10917
|
throw new Error(`INPUT_ERROR: Individual entity restriction with singleQuery set to true must not have more than ${m.singleQuery} entities`);
|
|
10906
|
-
|
|
10918
|
+
g.push(ge("id", "in", S));
|
|
10907
10919
|
}
|
|
10908
10920
|
}
|
|
10909
10921
|
}), O.filter((m) => m.parentFilter.type === "Individual").forEach((m) => {
|
|
10910
10922
|
const { parentFilter: S, parentRestriction: k } = m;
|
|
10911
10923
|
if ("collectionField" in S) {
|
|
10912
|
-
const D =
|
|
10924
|
+
const D = re(l, S.collectionField);
|
|
10913
10925
|
if ("collection" in D) {
|
|
10914
10926
|
const x = i.collections?.[D.collection];
|
|
10915
10927
|
if (!x)
|
|
@@ -10923,21 +10935,21 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10923
10935
|
}
|
|
10924
10936
|
if (!k.singleQuery)
|
|
10925
10937
|
$.forEach((ae) => {
|
|
10926
|
-
N.push(...R(
|
|
10938
|
+
N.push(...R(g.concat(ge(`${D.name}_Array`, "array-contains-any", ae))));
|
|
10927
10939
|
});
|
|
10928
10940
|
else {
|
|
10929
10941
|
if (M.length > G)
|
|
10930
10942
|
throw new Error(`INPUT_ERROR: Individual entity parentFilter with singleQuery set to true must not have more than ${k.singleQuery} entities`);
|
|
10931
|
-
|
|
10943
|
+
g.push(ge(`${D.name}_Array`, "array-contains-any", M));
|
|
10932
10944
|
}
|
|
10933
10945
|
}
|
|
10934
10946
|
}
|
|
10935
10947
|
}
|
|
10936
10948
|
});
|
|
10937
|
-
const
|
|
10938
|
-
|
|
10949
|
+
const _ = [];
|
|
10950
|
+
y.filter((m) => m.type === "Parent").forEach((m) => {
|
|
10939
10951
|
if ("collectionField" in m) {
|
|
10940
|
-
const S =
|
|
10952
|
+
const S = re(l, m.collectionField);
|
|
10941
10953
|
if ("collection" in S) {
|
|
10942
10954
|
const k = d?.parentEntities, D = [];
|
|
10943
10955
|
if (k) {
|
|
@@ -10948,12 +10960,12 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10948
10960
|
}
|
|
10949
10961
|
if (!m.singleQuery)
|
|
10950
10962
|
D.forEach((M) => {
|
|
10951
|
-
|
|
10963
|
+
_.push(...R(g.concat(ge(`${S.name}_Array`, "array-contains-any", M))));
|
|
10952
10964
|
});
|
|
10953
10965
|
else {
|
|
10954
10966
|
if (k && k.length > x)
|
|
10955
10967
|
throw new Error(`INPUT_ERROR: Parent entity restriction with singleQuery set to true must not have more than ${m.singleQuery} entities`);
|
|
10956
|
-
|
|
10968
|
+
g.push(ge(`${S.name}_Array`, "array-contains-any", k));
|
|
10957
10969
|
}
|
|
10958
10970
|
}
|
|
10959
10971
|
}
|
|
@@ -10961,7 +10973,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10961
10973
|
}), O.filter((m) => m.parentFilter.type === "Parent").forEach((m) => {
|
|
10962
10974
|
const { parentFilter: S, parentRestriction: k } = m;
|
|
10963
10975
|
if ("collectionField" in S && "parentCollectionField" in S) {
|
|
10964
|
-
const D =
|
|
10976
|
+
const D = re(l, S.collectionField), x = re(l, S.parentCollectionField);
|
|
10965
10977
|
if ("collection" in D && "collection" in x) {
|
|
10966
10978
|
const M = i.collections?.[D.collection];
|
|
10967
10979
|
if (!M)
|
|
@@ -10975,21 +10987,21 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
10975
10987
|
}
|
|
10976
10988
|
if (!k.singleQuery)
|
|
10977
10989
|
G.forEach((P) => {
|
|
10978
|
-
|
|
10990
|
+
_.push(...R(g.concat(ge(`${x.name}_Array`, "array-contains-any", P))));
|
|
10979
10991
|
});
|
|
10980
10992
|
else {
|
|
10981
10993
|
if ($ && $.length > ae)
|
|
10982
10994
|
throw new Error(`INPUT_ERROR: Parent entity parentFilter with singleQuery set to true must not have more than ${k.singleQuery} entities`);
|
|
10983
|
-
|
|
10995
|
+
g.push(ge(`${x.name}_Array`, "array-contains-any", $));
|
|
10984
10996
|
}
|
|
10985
10997
|
}
|
|
10986
10998
|
}
|
|
10987
10999
|
}
|
|
10988
11000
|
});
|
|
10989
11001
|
const A = [];
|
|
10990
|
-
|
|
11002
|
+
_.length === 0 && (y.filter((m) => m.type === "Parent_Property").forEach((m) => {
|
|
10991
11003
|
if ("collectionField" in m && "propertyField" in m) {
|
|
10992
|
-
const S =
|
|
11004
|
+
const S = re(l, m.collectionField), k = re(l, m.propertyField);
|
|
10993
11005
|
if ("collection" in S) {
|
|
10994
11006
|
const D = d?.parentPropertyEntities || {};
|
|
10995
11007
|
Object.entries(D).forEach(([x, M]) => {
|
|
@@ -11000,7 +11012,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
11000
11012
|
$.push(ae);
|
|
11001
11013
|
}
|
|
11002
11014
|
$.forEach((G) => {
|
|
11003
|
-
A.push(...R(
|
|
11015
|
+
A.push(...R(g.concat([
|
|
11004
11016
|
ge(`${S.name}_Array`, "array-contains-any", G),
|
|
11005
11017
|
ge(k.name, "==", x)
|
|
11006
11018
|
])));
|
|
@@ -11012,7 +11024,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
11012
11024
|
}), O.filter((m) => m.parentFilter.type === "Parent_Property").forEach((m) => {
|
|
11013
11025
|
const { parentFilter: S } = m;
|
|
11014
11026
|
if ("collectionField" in S && "parentCollectionField" in S && "parentPropertyField" in S) {
|
|
11015
|
-
const k =
|
|
11027
|
+
const k = re(l, S.collectionField), D = re(l, S.parentCollectionField), x = re(l, S.parentPropertyField);
|
|
11016
11028
|
if ("collection" in k && "collection" in D) {
|
|
11017
11029
|
const M = i.collections?.[k.collection];
|
|
11018
11030
|
if (!M)
|
|
@@ -11026,7 +11038,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
11026
11038
|
P.push(te);
|
|
11027
11039
|
}
|
|
11028
11040
|
P.forEach((B) => {
|
|
11029
|
-
A.push(...R(
|
|
11041
|
+
A.push(...R(g.concat([
|
|
11030
11042
|
ge(`${D.name}_Array`, "array-contains-any", B),
|
|
11031
11043
|
ge(x.name, "==", G)
|
|
11032
11044
|
])));
|
|
@@ -11036,13 +11048,13 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
11036
11048
|
}
|
|
11037
11049
|
}
|
|
11038
11050
|
}));
|
|
11039
|
-
const b = [...N, ...
|
|
11040
|
-
return !
|
|
11041
|
-
},
|
|
11051
|
+
const b = [...N, ..._, ...A];
|
|
11052
|
+
return !y.length && !O.length ? R(g) : b;
|
|
11053
|
+
}, cm = {}, Cr = {}, zw = async (r) => {
|
|
11042
11054
|
for (const s of Object.keys(Cr))
|
|
11043
11055
|
delete Cr[s];
|
|
11044
11056
|
for (const s of Object.keys(r || {}))
|
|
11045
|
-
Cr[s] = [], delete
|
|
11057
|
+
Cr[s] = [], delete cm[s];
|
|
11046
11058
|
const e = await ke(), t = await se(e, ["global", "preload", "sync"]), n = await se(e, ["global", "preload", "async"]);
|
|
11047
11059
|
if (n)
|
|
11048
11060
|
for (const s of n)
|
|
@@ -11053,7 +11065,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
11053
11065
|
for (const s of Object.keys(r || {}))
|
|
11054
11066
|
n.includes(s) || t.includes(s) || await Fr(s, r?.[s].constraints, r?.[s].range, r?.[s].orQueries);
|
|
11055
11067
|
return Cr;
|
|
11056
|
-
}, Eo = () =>
|
|
11068
|
+
}, Eo = () => cm, ow = () => Cr, cw = async (r, e, t, n) => {
|
|
11057
11069
|
const { labels: s, preloadCache: i } = r, o = Kr()[s.collection], c = ke(), l = lt(s.collection), u = Fe();
|
|
11058
11070
|
if (!u?.Role)
|
|
11059
11071
|
throw new Error("PERMISSION_DENIED");
|
|
@@ -11073,7 +11085,7 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
11073
11085
|
]), t ||= i.range;
|
|
11074
11086
|
const d = ic([s.collection], o).map((p) => {
|
|
11075
11087
|
if (t) {
|
|
11076
|
-
const { start: v, end:
|
|
11088
|
+
const { start: v, end: y } = sw(t), O = t.fields.filter((C) => !t.ranges?.some((w) => w.includes(C))).map((C) => Jr(ge(C, ">=", v), ge(C, "<=", y))), R = t.ranges?.map((C) => Jr(ge(C[0], "<=", y), ge(C[1], ">=", v)));
|
|
11077
11089
|
p = pe(p, Ec(...O, ...R || []));
|
|
11078
11090
|
}
|
|
11079
11091
|
return n && (p = pe(p, Jr(Ec(...n.map((v) => ge(...v)))))), e && (p = pe(p, Jr(...e.map((v) => ge(...v))))), p;
|
|
@@ -11083,10 +11095,10 @@ const Oe = /* @__PURE__ */ Cn(nw), Nt = (r) => {
|
|
|
11083
11095
|
p({});
|
|
11084
11096
|
return;
|
|
11085
11097
|
}
|
|
11086
|
-
d.forEach((
|
|
11098
|
+
d.forEach((y) => {
|
|
11087
11099
|
let O = !1;
|
|
11088
|
-
const R = dr(
|
|
11089
|
-
(!C.metadata.fromCache || O) && (O || (O = !0, h.set(
|
|
11100
|
+
const R = dr(y, { includeMetadataChanges: !0 }, (C) => {
|
|
11101
|
+
(!C.metadata.fromCache || O) && (O || (O = !0, h.set(y, !0), h.size === d.length && p({})));
|
|
11090
11102
|
}, (C) => {
|
|
11091
11103
|
console.error(C), v(C);
|
|
11092
11104
|
});
|
|
@@ -11141,14 +11153,14 @@ const lw = async (r, e) => {
|
|
|
11141
11153
|
else {
|
|
11142
11154
|
const d = new Event("stoker:permissionsChange");
|
|
11143
11155
|
if (document.dispatchEvent(d), s.auth.signOutOnPermissionsChange)
|
|
11144
|
-
|
|
11156
|
+
wm();
|
|
11145
11157
|
else {
|
|
11146
11158
|
const h = Lt.collections;
|
|
11147
11159
|
if (h)
|
|
11148
11160
|
for (const [p, v] of Object.entries(h))
|
|
11149
11161
|
a && // eslint-disable-next-line security/detect-object-injection
|
|
11150
11162
|
(!a.collections?.[p] || // eslint-disable-next-line security/detect-object-injection
|
|
11151
|
-
!
|
|
11163
|
+
!yy(v, a.collections[p])) && Fr(p);
|
|
11152
11164
|
}
|
|
11153
11165
|
}
|
|
11154
11166
|
a = Lt;
|
|
@@ -11186,8 +11198,8 @@ const lw = async (r, e) => {
|
|
|
11186
11198
|
}
|
|
11187
11199
|
const p = Oe(t);
|
|
11188
11200
|
r !== "delete" && (h.data.data = p, e === "written" && ac(h.data.data)), r !== "delete" && e !== "written" && tr(p), r === "update" && (h.data.originalRecord = Oe(c)), r !== "delete" && ["started", "written"].includes(e) && (delete h.data.data.Saved_At, delete h.data.data.Last_Save_At), e === "failed" && (h.data.error = JSON.stringify(o));
|
|
11189
|
-
const v = t.Last_Write_At,
|
|
11190
|
-
|
|
11201
|
+
const v = t.Last_Write_At, y = Ae(f, n.join("/"), s, "system_write_log", `${a}-${v.valueOf()}`);
|
|
11202
|
+
Bm(y, h).catch((O) => {
|
|
11191
11203
|
console.error(`Error saving "${e}" ${r} log entry for record ${s} in ${l.collection} collection.`, { cause: O });
|
|
11192
11204
|
});
|
|
11193
11205
|
}, oc = async (r, e, t, n, s) => {
|
|
@@ -11209,7 +11221,7 @@ const lw = async (r, e) => {
|
|
|
11209
11221
|
}
|
|
11210
11222
|
})), c.length > 0)
|
|
11211
11223
|
throw new Error(c.join(", "));
|
|
11212
|
-
},
|
|
11224
|
+
}, lm = (r, e, t) => {
|
|
11213
11225
|
const n = je(), s = He(), i = Fe(), a = r.at(-1);
|
|
11214
11226
|
if (!a)
|
|
11215
11227
|
throw new Error("EMPTY_PATH");
|
|
@@ -11223,7 +11235,7 @@ const lw = async (r, e) => {
|
|
|
11223
11235
|
for (const h of f)
|
|
11224
11236
|
d.push(Ae(n, "system_fields", c.collection, `${c.collection}-${h.field}`, e));
|
|
11225
11237
|
return d;
|
|
11226
|
-
}, hd = (r) => r !== null && typeof r == "object" && !Array.isArray(r),
|
|
11238
|
+
}, hd = (r) => r !== null && typeof r == "object" && !Array.isArray(r), um = (r) => {
|
|
11227
11239
|
const e = (t) => {
|
|
11228
11240
|
Object.entries(t).forEach(([n, s]) => {
|
|
11229
11241
|
hd(s) && Object.keys(s).length === 2 && typeof s._seconds == "number" && typeof s._nanoseconds == "number" ? t[n] = new zt(s._seconds, s._nanoseconds) : hd(s) && e(s);
|
|
@@ -11253,19 +11265,19 @@ const lw = async (r, e) => {
|
|
|
11253
11265
|
}
|
|
11254
11266
|
const l = c.data;
|
|
11255
11267
|
for (const u of l.result.docs)
|
|
11256
|
-
|
|
11268
|
+
um(u);
|
|
11257
11269
|
return l?.result;
|
|
11258
|
-
},
|
|
11270
|
+
}, fm = async (r, e, t, n, s, i, a) => {
|
|
11259
11271
|
const o = Fe();
|
|
11260
11272
|
if (!o)
|
|
11261
11273
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11262
|
-
const c = e.at(-2), l =
|
|
11274
|
+
const c = e.at(-2), l = Td(n.collections[c], n, o).map((d) => d.labels.collection);
|
|
11263
11275
|
t.collections ? t.collections.forEach((d) => {
|
|
11264
11276
|
if (!l.includes(d))
|
|
11265
11277
|
throw new Error(`SCHEMA_ERROR: Collection ${d} not found in subcollections of ${c}`);
|
|
11266
11278
|
}) : t.collections = l;
|
|
11267
11279
|
const u = t.depth - 1, f = t.collections.map(async (d) => {
|
|
11268
|
-
const h = await
|
|
11280
|
+
const h = await dm([...e, d], t.constraints || [], {
|
|
11269
11281
|
only: i,
|
|
11270
11282
|
pagination: t.limit,
|
|
11271
11283
|
noEmbeddingFields: a
|
|
@@ -11277,7 +11289,7 @@ const lw = async (r, e) => {
|
|
|
11277
11289
|
r[d].map((p) => cc(p, [...e, d, p.id], s, n, i, a))
|
|
11278
11290
|
), u > 0 && await Promise.all(
|
|
11279
11291
|
// eslint-disable-next-line security/detect-object-injection
|
|
11280
|
-
r[d].map((p) =>
|
|
11292
|
+
r[d].map((p) => fm(p, [...e, d, p.id], { depth: u }, n, s, i, a))
|
|
11281
11293
|
);
|
|
11282
11294
|
});
|
|
11283
11295
|
await Promise.all(f);
|
|
@@ -11294,8 +11306,8 @@ const lw = async (r, e) => {
|
|
|
11294
11306
|
continue;
|
|
11295
11307
|
const d = Object.keys(f);
|
|
11296
11308
|
for (const h of d) {
|
|
11297
|
-
const p = f[h], v = _r(p.Collection_Path, h, { only: s, noEmbeddingFields: i }).then((
|
|
11298
|
-
if (f[h] =
|
|
11309
|
+
const p = f[h], v = _r(p.Collection_Path, h, { only: s, noEmbeddingFields: i }).then((y) => {
|
|
11310
|
+
if (f[h] = y, c > 0)
|
|
11299
11311
|
return cc(
|
|
11300
11312
|
// eslint-disable-next-line security/detect-object-injection
|
|
11301
11313
|
f[h],
|
|
@@ -11305,17 +11317,17 @@ const lw = async (r, e) => {
|
|
|
11305
11317
|
s,
|
|
11306
11318
|
i
|
|
11307
11319
|
);
|
|
11308
|
-
}).catch((
|
|
11309
|
-
if (
|
|
11320
|
+
}).catch((y) => {
|
|
11321
|
+
if (y.message.includes("NOT_FOUND") || y.code === "permission-denied")
|
|
11310
11322
|
delete f[h];
|
|
11311
11323
|
else
|
|
11312
|
-
throw
|
|
11324
|
+
throw y;
|
|
11313
11325
|
});
|
|
11314
11326
|
l.push(v);
|
|
11315
11327
|
}
|
|
11316
11328
|
}
|
|
11317
11329
|
await Promise.all(l);
|
|
11318
|
-
},
|
|
11330
|
+
}, dm = async (r, e, t) => {
|
|
11319
11331
|
if (t?.subcollections?.depth && t.subcollections.depth > 10)
|
|
11320
11332
|
throw new Error("INPUT_ERROR: Subcollections depth cannot exceed 10");
|
|
11321
11333
|
if (t?.relations?.depth && t.relations.depth > 10)
|
|
@@ -11331,7 +11343,7 @@ const lw = async (r, e) => {
|
|
|
11331
11343
|
const s = He(!0), a = Kr()[n], o = s.collections[n], { labels: c, access: l, preloadCache: u } = o, { serverReadOnly: f } = l, d = ke(), h = Object.keys(s.collections).includes(n), p = d.disabledCollections?.includes(n);
|
|
11332
11344
|
if (!h || p)
|
|
11333
11345
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11334
|
-
const v = await lt(c.collection),
|
|
11346
|
+
const v = await lt(c.collection), y = await se(d, [
|
|
11335
11347
|
"global",
|
|
11336
11348
|
"firebase",
|
|
11337
11349
|
"serverTimestampOptions"
|
|
@@ -11351,26 +11363,26 @@ const lw = async (r, e) => {
|
|
|
11351
11363
|
if (t?.pagination) {
|
|
11352
11364
|
if (t.pagination.startAfter && t.pagination.endBefore)
|
|
11353
11365
|
throw new Error("INPUT_ERROR: startAfter and endBefore cannot be provided together");
|
|
11354
|
-
const b = t.pagination.startAfter || t.pagination.endBefore, m =
|
|
11366
|
+
const b = t.pagination.startAfter || t.pagination.endBefore, m = Ld(O.Role, o, s);
|
|
11355
11367
|
if (b && m !== !0)
|
|
11356
11368
|
throw new Error("INPUT_ERROR: Pagination is not allowed when using " + m);
|
|
11357
11369
|
t.pagination.orderByField && t.pagination.orderByDirection ? t.pagination.startAfter || t.pagination.endBefore ? t.pagination.startAfter ? C = C.map((S, k) => pe(S, et(t.pagination.orderByField, t.pagination.orderByDirection), Qa(w.last.get(k)), Xt(t.pagination.number))) : C = C.map((S, k) => pe(S, et(t.pagination.orderByField, t.pagination.orderByDirection), Xa(w.first.get(k)), Ir(t.pagination.number))) : C = C.map((S) => pe(S, et(t.pagination.orderByField, t.pagination.orderByDirection), Xt(t.pagination.number))) : !t.pagination.startAfter && !t.pagination.endBefore ? C = C.map((S) => pe(S, Xt(t.pagination.number))) : t.pagination.startAfter ? C = C.map((S, k) => pe(S, Qa(w.last.get(k)), Xt(t.pagination.number))) : C = C.map((S, k) => pe(S, Xa(w.first.get(k)), Ir(t.pagination.number)));
|
|
11358
11370
|
}
|
|
11359
11371
|
const E = { collection: c.collection };
|
|
11360
11372
|
await oe("preOperation", d, v, ["read", void 0, void 0, E]), await oe("preRead", d, v, [E, C, !0, !1]);
|
|
11361
|
-
const
|
|
11373
|
+
const g = /* @__PURE__ */ new Map(), N = C.map(async (b) => {
|
|
11362
11374
|
let m;
|
|
11363
|
-
return t?.only === "cache" ? m = await vd(b) : t?.only === "server" ? m = await
|
|
11364
|
-
}),
|
|
11365
|
-
for (const b of
|
|
11375
|
+
return t?.only === "cache" ? m = await vd(b) : t?.only === "server" ? m = await Zm(b) : m = await Gm(b), m;
|
|
11376
|
+
}), _ = await Promise.all(N);
|
|
11377
|
+
for (const b of _) {
|
|
11366
11378
|
for (const m of b.docs) {
|
|
11367
|
-
|
|
11368
|
-
const S = m.data({ serverTimestamps:
|
|
11379
|
+
g.has(m.id) || g.set(m.id, {});
|
|
11380
|
+
const S = m.data({ serverTimestamps: y || "none" }), k = g.get(m.id);
|
|
11369
11381
|
k.id ||= m.id;
|
|
11370
11382
|
const D = { ...k, ...S };
|
|
11371
|
-
delete D.Collection_Path_String,
|
|
11383
|
+
delete D.Collection_Path_String, g.set(m.id, D);
|
|
11372
11384
|
}
|
|
11373
|
-
w.first.set(
|
|
11385
|
+
w.first.set(_.indexOf(b), b.docs[0]), w.last.set(_.indexOf(b), b.docs.at(-1) || b.docs[0]);
|
|
11374
11386
|
}
|
|
11375
11387
|
let A;
|
|
11376
11388
|
if (t?.pagination && !u?.roles.includes(O?.Role) && !f?.includes(O?.Role)) {
|
|
@@ -11383,11 +11395,11 @@ const lw = async (r, e) => {
|
|
|
11383
11395
|
A = k > 0 ? Math.floor(S / k) : 0;
|
|
11384
11396
|
}
|
|
11385
11397
|
}
|
|
11386
|
-
for (const b of
|
|
11398
|
+
for (const b of g.values()) {
|
|
11387
11399
|
const m = [], S = [...b.Collection_Path, b.id];
|
|
11388
|
-
t?.subcollections && m.push(
|
|
11400
|
+
t?.subcollections && m.push(fm(
|
|
11389
11401
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11390
|
-
|
|
11402
|
+
g.get(b.id),
|
|
11391
11403
|
S,
|
|
11392
11404
|
Oe(t.subcollections),
|
|
11393
11405
|
s,
|
|
@@ -11404,38 +11416,38 @@ const lw = async (r, e) => {
|
|
|
11404
11416
|
return x;
|
|
11405
11417
|
})), m.push(cc(
|
|
11406
11418
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11407
|
-
|
|
11419
|
+
g.get(b.id),
|
|
11408
11420
|
S,
|
|
11409
11421
|
Oe(t.relations),
|
|
11410
11422
|
s,
|
|
11411
11423
|
t?.only,
|
|
11412
11424
|
t?.noEmbeddingFields
|
|
11413
11425
|
))), await Promise.all(m);
|
|
11414
|
-
for (const x of
|
|
11426
|
+
for (const x of g.values())
|
|
11415
11427
|
for (const M of o.fields)
|
|
11416
11428
|
M.type === "Computed" && !t?.noComputedFields && (x[M.name] = await M.formula(x)), t?.noEmbeddingFields && M.type === "Embedding" && delete x[M.name];
|
|
11417
11429
|
const k = ["read", b, b.id, E];
|
|
11418
11430
|
await oe("postOperation", d, v, k), await oe("postRead", d, v, [E, R, b, !1]);
|
|
11419
11431
|
}
|
|
11420
|
-
return { cursor: w, pages: A, docs: Array.from(
|
|
11432
|
+
return { cursor: w, pages: A, docs: Array.from(g.values()) };
|
|
11421
11433
|
}, dw = async (r, e, t) => {
|
|
11422
11434
|
const n = nt(), s = Ue(), i = $e(n, s.STOKER_FB_FUNCTIONS_REGION), l = (await Ke(i, "stoker-readapi")({
|
|
11423
11435
|
path: r,
|
|
11424
11436
|
id: e,
|
|
11425
11437
|
options: t
|
|
11426
11438
|
})).data.result;
|
|
11427
|
-
return
|
|
11428
|
-
},
|
|
11439
|
+
return um(l), l;
|
|
11440
|
+
}, hm = async (r, e, t, n, s, i) => {
|
|
11429
11441
|
const a = Fe();
|
|
11430
11442
|
if (!a)
|
|
11431
11443
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11432
|
-
const o = e.at(-2), c =
|
|
11444
|
+
const o = e.at(-2), c = Td(n.collections[o], n, a).map((f) => f.labels.collection);
|
|
11433
11445
|
t.collections ? t.collections.forEach((f) => {
|
|
11434
11446
|
if (!c.includes(f))
|
|
11435
11447
|
throw new Error(`SCHEMA_ERROR: Collection ${f} not found in subcollections of ${o}`);
|
|
11436
11448
|
}) : t.collections = c;
|
|
11437
11449
|
const l = t.depth - 1, u = t.collections.map(async (f) => {
|
|
11438
|
-
const d = await
|
|
11450
|
+
const d = await dm([...e, f], t.constraints || [], {
|
|
11439
11451
|
only: i,
|
|
11440
11452
|
relations: s,
|
|
11441
11453
|
pagination: t.limit
|
|
@@ -11445,12 +11457,12 @@ const lw = async (r, e) => {
|
|
|
11445
11457
|
r[f] = d.docs, l > 0 && await Promise.all(
|
|
11446
11458
|
// eslint-disable-next-line security/detect-object-injection
|
|
11447
11459
|
r[f].map(async (h) => {
|
|
11448
|
-
await
|
|
11460
|
+
await hm(h, [...e, f, h.id], { depth: l }, n, s, i);
|
|
11449
11461
|
})
|
|
11450
11462
|
);
|
|
11451
11463
|
});
|
|
11452
11464
|
await Promise.all(u);
|
|
11453
|
-
},
|
|
11465
|
+
}, mm = async (r, e, t, n, s, i, a) => {
|
|
11454
11466
|
if (!Fe())
|
|
11455
11467
|
throw new Error("PERMISSIONS_NOT_FOUND");
|
|
11456
11468
|
const c = e.at(-2);
|
|
@@ -11466,9 +11478,9 @@ const lw = async (r, e) => {
|
|
|
11466
11478
|
only: s,
|
|
11467
11479
|
noComputedFields: i,
|
|
11468
11480
|
noEmbeddingFields: a
|
|
11469
|
-
}).then((
|
|
11470
|
-
if (d[h] =
|
|
11471
|
-
return
|
|
11481
|
+
}).then((y) => {
|
|
11482
|
+
if (d[h] = y, l > 0)
|
|
11483
|
+
return mm(
|
|
11472
11484
|
// eslint-disable-next-line security/detect-object-injection
|
|
11473
11485
|
d[h],
|
|
11474
11486
|
[...p.Collection_Path, h],
|
|
@@ -11478,11 +11490,11 @@ const lw = async (r, e) => {
|
|
|
11478
11490
|
i,
|
|
11479
11491
|
a
|
|
11480
11492
|
);
|
|
11481
|
-
}).catch((
|
|
11482
|
-
if (
|
|
11493
|
+
}).catch((y) => {
|
|
11494
|
+
if (y.message.includes("NOT_FOUND") || y.code === "permission-denied")
|
|
11483
11495
|
delete d[h];
|
|
11484
11496
|
else
|
|
11485
|
-
throw
|
|
11497
|
+
throw y;
|
|
11486
11498
|
});
|
|
11487
11499
|
u.push(v);
|
|
11488
11500
|
}
|
|
@@ -11503,12 +11515,12 @@ const lw = async (r, e) => {
|
|
|
11503
11515
|
"global",
|
|
11504
11516
|
"firebase",
|
|
11505
11517
|
"serverTimestampOptions"
|
|
11506
|
-
]), f = s.collections[n], { labels: d, access: h } = f, { serverReadOnly: p } = h, v = lt(d.collection),
|
|
11507
|
-
if (!
|
|
11518
|
+
]), f = s.collections[n], { labels: d, access: h } = f, { serverReadOnly: p } = h, v = lt(d.collection), y = Fe();
|
|
11519
|
+
if (!y?.Role)
|
|
11508
11520
|
throw new Error("PERMISSIONS_DENIED");
|
|
11509
|
-
if (p?.includes(
|
|
11521
|
+
if (p?.includes(y.Role))
|
|
11510
11522
|
return await dw(r, e, t);
|
|
11511
|
-
const O =
|
|
11523
|
+
const O = lm(r, e, a);
|
|
11512
11524
|
if (O.length === 0)
|
|
11513
11525
|
throw new Error("PERMISSION_DENIED");
|
|
11514
11526
|
const R = { collection: d.collection };
|
|
@@ -11516,14 +11528,14 @@ const lw = async (r, e) => {
|
|
|
11516
11528
|
let E = {};
|
|
11517
11529
|
const I = O.map(async (b) => {
|
|
11518
11530
|
let m;
|
|
11519
|
-
if (t?.only === "cache" ? m = await
|
|
11531
|
+
if (t?.only === "cache" ? m = await Hm(b) : t?.only === "server" ? m = await Km(b) : m = await _d(b), !m.exists())
|
|
11520
11532
|
throw new Error(`NOT_FOUND: Document with ID ${e} does not exist at location ${r?.join("/") || d.collection}`);
|
|
11521
11533
|
return { id: m.id, data: m.data({ serverTimestamps: u || "none" }) };
|
|
11522
11534
|
}), T = await Promise.all(I);
|
|
11523
11535
|
for (const b of T)
|
|
11524
11536
|
E.id ||= b.id, E = { ...E, ...b.data }, delete E.Collection_Path_String;
|
|
11525
|
-
const
|
|
11526
|
-
if (t?.subcollections &&
|
|
11537
|
+
const g = [], N = r ? [...r, e] : [d.collection, e];
|
|
11538
|
+
if (t?.subcollections && g.push(hm(E, N, Oe(t.subcollections), s, Oe(t?.relations), t?.only)), t?.relations && (t.relations.fields && (t.relations.fields = t.relations.fields.map((b) => {
|
|
11527
11539
|
if (typeof b == "string") {
|
|
11528
11540
|
const m = f.fields.find((S) => S.name === b);
|
|
11529
11541
|
if (m)
|
|
@@ -11531,14 +11543,14 @@ const lw = async (r, e) => {
|
|
|
11531
11543
|
throw new Error(`SCHEMA_ERROR: Field ${b} not found in collection ${n}`);
|
|
11532
11544
|
}
|
|
11533
11545
|
return b;
|
|
11534
|
-
})),
|
|
11546
|
+
})), g.push(mm(E, N, Oe(t.relations), s, t?.only, t?.noComputedFields, t?.noEmbeddingFields))), await Promise.all(g), !t?.noComputedFields)
|
|
11535
11547
|
for (const b of f.fields)
|
|
11536
11548
|
b.type === "Computed" && (E[b.name] = await b.formula(E));
|
|
11537
11549
|
if (t?.noEmbeddingFields)
|
|
11538
11550
|
for (const b of f.fields)
|
|
11539
11551
|
b.type === "Embedding" && delete E[b.name];
|
|
11540
11552
|
return await oe("postOperation", o, v, ["read", E, e, R]), await oe("postRead", o, v, [R, O, E, !1]), E;
|
|
11541
|
-
}, hw = (r) => r !== null && typeof r == "object",
|
|
11553
|
+
}, hw = (r) => r !== null && typeof r == "object", pm = (r) => {
|
|
11542
11554
|
const e = (t) => {
|
|
11543
11555
|
Object.entries(t).forEach(([n, s]) => {
|
|
11544
11556
|
s instanceof zt ? t[n] = {
|
|
@@ -11550,7 +11562,7 @@ const lw = async (r, e) => {
|
|
|
11550
11562
|
e(r);
|
|
11551
11563
|
}, mw = async (r, e, t, n) => {
|
|
11552
11564
|
const s = nt(), i = Ue(), a = $e(s, i.STOKER_FB_FUNCTIONS_REGION), o = Ke(a, "stoker-writeapi", { timeout: 540 * 1e3 });
|
|
11553
|
-
return
|
|
11565
|
+
return pm(t), ac(t), (await o({
|
|
11554
11566
|
operation: "update",
|
|
11555
11567
|
path: r,
|
|
11556
11568
|
id: e,
|
|
@@ -11564,23 +11576,23 @@ const lw = async (r, e) => {
|
|
|
11564
11576
|
const h = r.at(-1), p = Object.keys(a.collections).includes(h), v = l.disabledCollections?.includes(h);
|
|
11565
11577
|
if (!p || v)
|
|
11566
11578
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11567
|
-
const
|
|
11579
|
+
const y = a.collections[h], { labels: O, access: R, fields: C, enableWriteLog: w } = y, { serverWriteOnly: E } = R, I = lt(O.collection), T = await se(l, ["global", "appName"]), g = s?.retry, N = u.currentUser;
|
|
11568
11580
|
if (!N)
|
|
11569
11581
|
throw new Error("NOT_AUTHENTICATED");
|
|
11570
11582
|
if (!d)
|
|
11571
11583
|
throw new Error("PERMISSION_DENIED");
|
|
11572
|
-
if (
|
|
11584
|
+
if (_m(e))
|
|
11573
11585
|
throw new Error("RECORD_BUSY");
|
|
11574
|
-
i =
|
|
11586
|
+
i = g?.originalRecord || i || await _r([O.collection], e, { noComputedFields: !0, noEmbeddingFields: !0 });
|
|
11575
11587
|
for (const P of o.collections[h].fields)
|
|
11576
11588
|
P.type === "Computed" && (delete t[P.name], delete i[P.name]);
|
|
11577
|
-
const
|
|
11589
|
+
const _ = Ro(f), A = { collection: O.collection }, b = y.auth && n?.operation === "create", m = y.auth && n?.operation === "delete", S = y.auth && !b && !m && (n?.operation === "update" || t.Role || t.Enabled !== void 0 || t.Name || t.Email || t.Photo_URL), k = await se(I, [
|
|
11578
11590
|
"collections",
|
|
11579
11591
|
O.collection,
|
|
11580
11592
|
"custom",
|
|
11581
11593
|
"disableOfflineUpdate"
|
|
11582
11594
|
]), D = () => {
|
|
11583
|
-
if (Wt() === "Offline" && (k || E ||
|
|
11595
|
+
if (Wt() === "Offline" && (k || E || y.auth && (b || S || m)))
|
|
11584
11596
|
throw new Error("CLIENT_OFFLINE");
|
|
11585
11597
|
};
|
|
11586
11598
|
if (D(), E || b || S || m) {
|
|
@@ -11605,41 +11617,41 @@ const lw = async (r, e) => {
|
|
|
11605
11617
|
return await mw(r, e, t, n ? { operation: n.operation, permissions: n.permissions, password: n.password } : void 0);
|
|
11606
11618
|
}
|
|
11607
11619
|
delete t.id;
|
|
11608
|
-
const x = Go("update", r, t, a, T, Wt(), N.uid, zt.now(), Pr(), !!
|
|
11620
|
+
const x = Go("update", r, t, a, T, Wt(), N.uid, zt.now(), Pr(), !!g);
|
|
11609
11621
|
for (const P of C)
|
|
11610
11622
|
!_e(P) && sr(x[P.name]) && P.nullable && (x[P.name] = null);
|
|
11611
|
-
if (Nt(x), Nt(i), !
|
|
11623
|
+
if (Nt(x), Nt(i), !g && w && Ge("update", "started", x, r, e, y, N.uid, void 0, i), !g) {
|
|
11612
11624
|
const P = [
|
|
11613
11625
|
"update",
|
|
11614
11626
|
x,
|
|
11615
11627
|
e,
|
|
11616
11628
|
A,
|
|
11617
|
-
|
|
11629
|
+
_,
|
|
11618
11630
|
Oe(i)
|
|
11619
11631
|
];
|
|
11620
11632
|
await oe("preOperation", l, I, P);
|
|
11621
|
-
const B = ["update", x, e, A,
|
|
11633
|
+
const B = ["update", x, e, A, _, Oe(i)];
|
|
11622
11634
|
await oe("preWrite", l, I, B);
|
|
11623
11635
|
}
|
|
11624
|
-
if (
|
|
11636
|
+
if (Yd(y, x, a), Jd(y, x), !g)
|
|
11625
11637
|
try {
|
|
11626
11638
|
const P = { ...i, ...x };
|
|
11627
|
-
tr(P), await
|
|
11639
|
+
tr(P), await sm("update", P, y, I, ["update", P, A, _, Oe(i)], a), k && (D(), await oc("update", e, x, y, d));
|
|
11628
11640
|
} catch (P) {
|
|
11629
11641
|
throw new Error(`VALIDATION_ERROR: ${P.message}`);
|
|
11630
11642
|
}
|
|
11631
|
-
if (
|
|
11643
|
+
if (wy(x, i, e, y, a, N.uid, d), Nt(x), sc("update", _, r, e, x, a, y, s, c, Co, Ao, Tn, (P) => Ae(f, "system_fields", O.collection, `${O.collection}-${P.name}`, e), (P, B) => Ae(f, "system_unique", O.collection, `Unique-${O.collection}-${P.name}`, B), (P) => Ae(f, "system_fields", O.collection, `${O.collection}-${P}`, e)), _.update(Ae(f, r.join("/"), e), x), !g && w && Ge("update", "written", x, r, e, y, N.uid, void 0, i), await uc("update", r, e, x, A, y, I, _, N.uid, w || !1, d, !!g, i), g?.type === "unique") {
|
|
11632
11644
|
const P = { ...i, ...x };
|
|
11633
11645
|
return tr(P), { id: e, ...P };
|
|
11634
11646
|
}
|
|
11635
|
-
w && Ge("update", "success", x, r, e,
|
|
11636
|
-
const M = ["update", x, e, A, !!
|
|
11647
|
+
w && Ge("update", "success", x, r, e, y, N.uid, void 0, i);
|
|
11648
|
+
const M = ["update", x, e, A, !!g, Oe(i)], $ = [...M];
|
|
11637
11649
|
await oe("postWrite", l, I, M), await oe("postOperation", l, I, $);
|
|
11638
11650
|
const G = { ...i, ...x };
|
|
11639
11651
|
return tr(G), { id: e, ...G };
|
|
11640
11652
|
}, uc = async (r, e, t, n, s, i, a, o, c, l, u, f, d) => {
|
|
11641
11653
|
const h = He(), p = ke(), { labels: v } = i;
|
|
11642
|
-
let
|
|
11654
|
+
let y = 0;
|
|
11643
11655
|
const O = async () => {
|
|
11644
11656
|
try {
|
|
11645
11657
|
await Oe(o).commit();
|
|
@@ -11656,15 +11668,15 @@ const lw = async (r, e) => {
|
|
|
11656
11668
|
try {
|
|
11657
11669
|
await oc(r, t, n, i, u);
|
|
11658
11670
|
} catch (N) {
|
|
11659
|
-
const
|
|
11671
|
+
const _ = N.message.split(", "), A = [], b = [];
|
|
11660
11672
|
let m = !1;
|
|
11661
|
-
for (const S of
|
|
11673
|
+
for (const S of _) {
|
|
11662
11674
|
const k = S.split(" ")[0], D = h.collections[v.collection].fields.find((x) => x.name === k);
|
|
11663
11675
|
if (!D)
|
|
11664
11676
|
throw new Error(`SCHEMA_ERROR: Field ${k} not found in ${v.collection} schema`);
|
|
11665
11677
|
D.type === "Number" && A.push(S), D.type === "String" && b.push(S);
|
|
11666
11678
|
}
|
|
11667
|
-
if ((!w || A.length > 0) && (C = new Error(`VALIDATION_ERROR: ${
|
|
11679
|
+
if ((!w || A.length > 0) && (C = new Error(`VALIDATION_ERROR: ${_.join(", ")}`)), w && b.length > 0) {
|
|
11668
11680
|
for (const S of b) {
|
|
11669
11681
|
const k = S.split(" ")[0];
|
|
11670
11682
|
if (h.collections[v.collection].fields.find((M) => M.name === k).type === "Number")
|
|
@@ -11674,10 +11686,10 @@ const lw = async (r, e) => {
|
|
|
11674
11686
|
// eslint-disable-next-line security/detect-object-injection
|
|
11675
11687
|
n[k].match(/ - DUPLICATE-\d+/)[0].split("-")[2]
|
|
11676
11688
|
), n[k] = // eslint-disable-next-line security/detect-object-injection
|
|
11677
|
-
n[k].replace(/ - DUPLICATE-\d+/g, "") + ` - DUPLICATE-${x + 1}`) : n[k] = n[k] + " - DUPLICATE-1", x < 10 ? m = !0 : C = new Error(
|
|
11689
|
+
n[k].replace(/ - DUPLICATE-\d+/g, "") + ` - DUPLICATE-${x + 1}`) : n[k] = n[k] + " - DUPLICATE-1", x < 10 ? m = !0 : C = new Error(_.map((M) => M.replace(/ - DUPLICATE-\d+/g, "")).join(", "));
|
|
11678
11690
|
}
|
|
11679
11691
|
if (m) {
|
|
11680
|
-
r === "create" && await
|
|
11692
|
+
r === "create" && await ym(e, n, void 0, { retry: { type: "unique", docId: t } }), r === "update" && await lc(e, t, n, void 0, {
|
|
11681
11693
|
retry: {
|
|
11682
11694
|
type: "unique",
|
|
11683
11695
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -11695,13 +11707,13 @@ const lw = async (r, e) => {
|
|
|
11695
11707
|
s,
|
|
11696
11708
|
E,
|
|
11697
11709
|
f,
|
|
11698
|
-
|
|
11710
|
+
y,
|
|
11699
11711
|
r === "update" ? d : void 0
|
|
11700
|
-
], T = R.code === "unavailable",
|
|
11701
|
-
if (
|
|
11712
|
+
], T = R.code === "unavailable", g = await oe("postWriteError", p, a, I);
|
|
11713
|
+
if (g?.resolved)
|
|
11702
11714
|
return;
|
|
11703
|
-
if (!T &&
|
|
11704
|
-
|
|
11715
|
+
if (!T && g?.retry) {
|
|
11716
|
+
y++, await O();
|
|
11705
11717
|
return;
|
|
11706
11718
|
} else
|
|
11707
11719
|
l && Ge(
|
|
@@ -11722,38 +11734,38 @@ const lw = async (r, e) => {
|
|
|
11722
11734
|
await O();
|
|
11723
11735
|
}, pw = async (r, e, t, n) => {
|
|
11724
11736
|
const s = nt(), i = Ue(), a = $e(s, i.STOKER_FB_FUNCTIONS_REGION), o = Ke(a, "stoker-writeapi", { timeout: 540 * 1e3 });
|
|
11725
|
-
return
|
|
11737
|
+
return pm(e), (await o({
|
|
11726
11738
|
operation: "create",
|
|
11727
11739
|
path: r,
|
|
11728
11740
|
record: e,
|
|
11729
11741
|
user: t,
|
|
11730
11742
|
id: n
|
|
11731
11743
|
})).data?.result;
|
|
11732
|
-
},
|
|
11744
|
+
}, ym = async (r, e, t, n, s, i) => {
|
|
11733
11745
|
const a = He(), o = hc(), c = ke(), l = fr(), u = je(), f = Fe();
|
|
11734
11746
|
if (r.length === 0)
|
|
11735
11747
|
throw new Error("EMPTY_PATH");
|
|
11736
11748
|
const d = r.at(-1), h = Object.keys(a.collections).includes(d), p = c.disabledCollections?.includes(d);
|
|
11737
11749
|
if (!h || p)
|
|
11738
11750
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11739
|
-
const v = a.collections[d], { labels:
|
|
11740
|
-
if (!
|
|
11751
|
+
const v = a.collections[d], { labels: y, access: O, enableWriteLog: R, softDelete: C } = v, { serverWriteOnly: w } = O, E = lt(y.collection), I = await se(c, ["global", "appName"]), T = n?.retry, g = l.currentUser;
|
|
11752
|
+
if (!g)
|
|
11741
11753
|
throw new Error("NOT_AUTHENTICATED");
|
|
11742
11754
|
if (!f)
|
|
11743
11755
|
throw new Error("PERMISSION_DENIED");
|
|
11744
11756
|
const N = await se(E, [
|
|
11745
11757
|
"collections",
|
|
11746
|
-
|
|
11758
|
+
y.collection,
|
|
11747
11759
|
"custom",
|
|
11748
11760
|
"disableOfflineCreate"
|
|
11749
|
-
]),
|
|
11761
|
+
]), _ = () => {
|
|
11750
11762
|
if (Wt() === "Offline" && (N || w || v.auth && t))
|
|
11751
11763
|
throw new Error("CLIENT_OFFLINE");
|
|
11752
11764
|
};
|
|
11753
|
-
|
|
11754
|
-
const A = Ro(u), b = T?.docId || s || Ae(Mr(u,
|
|
11765
|
+
_();
|
|
11766
|
+
const A = Ro(u), b = T?.docId || s || Ae(Mr(u, y.collection)).id, m = { collection: y.collection };
|
|
11755
11767
|
if (w || v.auth && t) {
|
|
11756
|
-
if (
|
|
11768
|
+
if (_(), v.auth && t) {
|
|
11757
11769
|
if (!t.password)
|
|
11758
11770
|
throw new Error("VALIDATION_ERROR: Password is required");
|
|
11759
11771
|
if (!t.passwordConfirm)
|
|
@@ -11761,7 +11773,7 @@ const lw = async (r, e) => {
|
|
|
11761
11773
|
if (t.password !== t.passwordConfirm)
|
|
11762
11774
|
throw new Error("VALIDATION_ERROR: Passwords do not match");
|
|
11763
11775
|
if (!await se(c, ["global", "firebase", "enableEmulators"])) {
|
|
11764
|
-
|
|
11776
|
+
_();
|
|
11765
11777
|
try {
|
|
11766
11778
|
const { isValid: G } = await pd(l, t.password);
|
|
11767
11779
|
if (!G)
|
|
@@ -11774,16 +11786,16 @@ const lw = async (r, e) => {
|
|
|
11774
11786
|
return i && i(), await pw(r, e, t ? { permissions: t.permissions, password: t.password } : void 0, b);
|
|
11775
11787
|
}
|
|
11776
11788
|
e.id = b;
|
|
11777
|
-
const S = Go("create", r, e, a, I, Wt(),
|
|
11778
|
-
if (C && (S[C.archivedField] = !1), Nt(S), !T && R && Ge("create", "started", S, r, b, v,
|
|
11789
|
+
const S = Go("create", r, e, a, I, Wt(), g.uid, zt.now(), Pr(), !!T);
|
|
11790
|
+
if (C && (S[C.archivedField] = !1), Nt(S), !T && R && Ge("create", "started", S, r, b, v, g.uid), T || (await oe("preOperation", c, E, ["create", S, b, m, A]), await oe("preWrite", c, E, ["create", S, b, m, A])), Yd(v, S, a), Jd(v, S), T || await fg(S, v, E, f.Role), !T)
|
|
11779
11791
|
try {
|
|
11780
|
-
await
|
|
11792
|
+
await sm("create", S, v, E, ["create", S, m, A], a), N && (_(), await oc("create", b, S, v, f));
|
|
11781
11793
|
} catch (M) {
|
|
11782
11794
|
throw new Error(`VALIDATION_ERROR: ${M.message}`);
|
|
11783
11795
|
}
|
|
11784
|
-
if (i && i(), Nt(S),
|
|
11796
|
+
if (i && i(), Nt(S), vy(S, b, v, a, g.uid, f), sc("create", A, r, b, S, a, v, n, o, Co, Ao, Tn, (M) => Ae(u, "system_fields", y.collection, `${y.collection}-${M.name}`, b), (M, $) => Ae(u, "system_unique", y.collection, `Unique-${y.collection}-${M.name}`, $), (M) => Ae(u, "system_fields", y.collection, `${y.collection}-${M}`, b)), A.set(Ae(u, r.join("/"), b), S), !T && R && Ge("create", "written", S, r, b, v, g.uid), await uc("create", r, b, S, m, v, E, A, g.uid, R || !1, f, !!T), T?.type === "unique")
|
|
11785
11797
|
return { docId: b, record: S };
|
|
11786
|
-
R && Ge("create", "success", S, r, b, v,
|
|
11798
|
+
R && Ge("create", "success", S, r, b, v, g.uid);
|
|
11787
11799
|
const k = ["create", S, b, m, !!T], D = [...k];
|
|
11788
11800
|
return await oe("postWrite", c, E, k), await oe("postOperation", c, E, D), { id: b, ...S };
|
|
11789
11801
|
}, yw = async (r, e) => {
|
|
@@ -11800,15 +11812,15 @@ const lw = async (r, e) => {
|
|
|
11800
11812
|
const l = r.at(-1), u = Object.keys(n.collections).includes(l), f = o.disabledCollections?.includes(l);
|
|
11801
11813
|
if (!u || f)
|
|
11802
11814
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
11803
|
-
const d = n.collections[l], { labels: h, access: p, enableWriteLog: v, softDelete:
|
|
11815
|
+
const d = n.collections[l], { labels: h, access: p, enableWriteLog: v, softDelete: y } = d, { serverWriteOnly: O } = p, R = lt(h.collection), C = await se(o, ["global", "appName"]), w = t?.retry, E = i.currentUser;
|
|
11804
11816
|
if (!E)
|
|
11805
11817
|
throw new Error("NOT_AUTHENTICATED");
|
|
11806
11818
|
if (!c)
|
|
11807
11819
|
throw new Error("PERMISSION_DENIED");
|
|
11808
|
-
if (
|
|
11820
|
+
if (y && !d.auth)
|
|
11809
11821
|
return await lc(r, e, {
|
|
11810
|
-
[
|
|
11811
|
-
[
|
|
11822
|
+
[y.archivedField]: !0,
|
|
11823
|
+
[y.timestampField]: Pr()
|
|
11812
11824
|
});
|
|
11813
11825
|
const I = await se(R, [
|
|
11814
11826
|
"collections",
|
|
@@ -11821,77 +11833,84 @@ const lw = async (r, e) => {
|
|
|
11821
11833
|
throw new Error("CLIENT_OFFLINE");
|
|
11822
11834
|
})(), O || d.auth)
|
|
11823
11835
|
return await yw(r, e);
|
|
11824
|
-
if (
|
|
11836
|
+
if (_m(e))
|
|
11825
11837
|
throw new Error("RECORD_BUSY");
|
|
11826
|
-
let
|
|
11838
|
+
let g;
|
|
11827
11839
|
try {
|
|
11828
|
-
|
|
11840
|
+
g = await _r([h.collection], e);
|
|
11829
11841
|
} catch (D) {
|
|
11830
11842
|
throw v && w?.record && D.message.indexOf("NOT_FOUND") !== -1 && await Ge("delete", "failed", w?.record, r, e, d, E.uid, D), D;
|
|
11831
11843
|
}
|
|
11832
|
-
delete
|
|
11833
|
-
const N = Ro(a),
|
|
11834
|
-
Nt(A), !w && v && Ge("delete", "started", A, r, e, d, E.uid), w || (await oe("preOperation", o, R, ["delete", A, e,
|
|
11835
|
-
const m = ["delete", A, e,
|
|
11844
|
+
delete g.id;
|
|
11845
|
+
const N = Ro(a), _ = { collection: h.collection }, A = Go("delete", r, g, n, C, Wt(), E.uid, zt.now(), Pr(), !!w);
|
|
11846
|
+
Nt(A), !w && v && Ge("delete", "started", A, r, e, d, E.uid), w || (await oe("preOperation", o, R, ["delete", A, e, _, N]), await oe("preWrite", o, R, ["delete", A, e, _, N])), Nt(A), by(A, e, d, n, E.uid, c), sc("delete", N, r, e, A, n, d, t, s, Co, Ao, Tn, (D) => Ae(a, "system_fields", h.collection, `${h.collection}-${D.name}`, e), (D, x) => Ae(a, "system_unique", h.collection, `Unique-${h.collection}-${D.name}`, x), (D) => Ae(a, "system_fields", h.collection, `${h.collection}-${D}`, e)), N.delete(Ae(a, r.join("/"), e)), !w && v && Ge("delete", "written", A, r, e, d, E.uid), await uc("delete", r, e, A, _, d, R, N, E.uid, v || !1, c, !!w), v && Ge("delete", "success", { ...A, ...w?.record || {} }, r, e, d, E.uid);
|
|
11847
|
+
const m = ["delete", A, e, _, !!w], S = [...m];
|
|
11836
11848
|
return await oe("postWrite", o, R, m), await oe("postOperation", o, R, S), { id: e, ...A };
|
|
11837
|
-
},
|
|
11849
|
+
}, gm = (r) => {
|
|
11838
11850
|
if (typeof r == "object")
|
|
11839
11851
|
for (const e in r)
|
|
11840
|
-
Object.prototype.hasOwnProperty.call(r, e) && (r[e] === "_DELETE_FIELD" ? r[e] = Tn() :
|
|
11852
|
+
Object.prototype.hasOwnProperty.call(r, e) && (r[e] === "_DELETE_FIELD" ? r[e] = Tn() : gm(r[e]));
|
|
11853
|
+
}, _w = async (r, e) => {
|
|
11854
|
+
const t = nt(), n = Ue(), s = $e(t, n.STOKER_FB_FUNCTIONS_REGION);
|
|
11855
|
+
return (await Ke(s, r)(e)).data;
|
|
11841
11856
|
};
|
|
11842
11857
|
let ht = {};
|
|
11843
|
-
const
|
|
11858
|
+
const vw = async (r, e) => {
|
|
11844
11859
|
const t = fr(), n = mc(), s = t.currentUser;
|
|
11845
11860
|
if (s?.uid !== e.uid)
|
|
11846
11861
|
return;
|
|
11847
11862
|
const i = await vd(pe(Ym(n, "system_write_log"), ge("status", "==", "written"), ge("user", "==", e.uid), et("Last_Write_At", "asc")));
|
|
11848
|
-
|
|
11849
|
-
|
|
11850
|
-
await Od(n);
|
|
11851
|
-
const a = wm();
|
|
11863
|
+
await new Promise((o) => setTimeout(o, 1e4));
|
|
11864
|
+
const a = vm();
|
|
11852
11865
|
if (a?.version)
|
|
11853
11866
|
for (const o of i.docs) {
|
|
11854
11867
|
ht[o.id] ??= 0;
|
|
11855
11868
|
const c = o.data(), { data: l, operation: u, docId: f, collection: d, Collection_Path: h, Last_Write_Version: p } = c;
|
|
11856
|
-
|
|
11869
|
+
await new Promise((O) => setTimeout(O, 1e3));
|
|
11870
|
+
const v = await _w("stoker-writelog", {
|
|
11871
|
+
path: h,
|
|
11872
|
+
id: f,
|
|
11873
|
+
log: o.id
|
|
11874
|
+
});
|
|
11875
|
+
if (!v || v.status !== "written")
|
|
11876
|
+
continue;
|
|
11877
|
+
if (s?.uid !== e.uid)
|
|
11857
11878
|
return;
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
|
|
11869
|
-
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
|
|
11876
|
-
|
|
11877
|
-
}
|
|
11878
|
-
if (console.info(`Retrying pending ${u} operation: ${o.ref.path}`), u === "create" && (ht[f]++, await gm(h, l.data, void 0, {
|
|
11879
|
+
if (a.force && p !== a.version) {
|
|
11880
|
+
Ge(
|
|
11881
|
+
u,
|
|
11882
|
+
"failed",
|
|
11883
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11884
|
+
l.data,
|
|
11885
|
+
h,
|
|
11886
|
+
f,
|
|
11887
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
11888
|
+
r.collections[d],
|
|
11889
|
+
e.uid,
|
|
11890
|
+
`Version mismatch- write log version ${p} not compatible with forced version ${a.version}`,
|
|
11891
|
+
u === "update" ? l.originalRecord : void 0
|
|
11892
|
+
);
|
|
11893
|
+
continue;
|
|
11894
|
+
}
|
|
11895
|
+
const y = localStorage.getItem(`stoker-retry-${f}`);
|
|
11896
|
+
if (y !== "done" && !(y && Date.now() - parseInt(y) < 1e4)) {
|
|
11897
|
+
if (localStorage.setItem(`stoker-retry-${f}`, Date.now().toString()), console.info(`Retrying pending ${u} operation: ${o.ref.path}`), u === "create" && (ht[f]++, await ym(h, l.data, void 0, {
|
|
11879
11898
|
retry: {
|
|
11880
11899
|
type: "offline",
|
|
11881
11900
|
docId: f
|
|
11882
11901
|
}
|
|
11883
11902
|
}).catch((O) => {
|
|
11884
|
-
console.error(O)
|
|
11885
|
-
})), u === "update") {
|
|
11903
|
+
console.error(O);
|
|
11904
|
+
}), ht[f]--, localStorage.setItem(`stoker-retry-${f}`, "done")), u === "update") {
|
|
11886
11905
|
const O = r.collections[d], { softDelete: R } = O;
|
|
11887
|
-
R && l.data?.[R.archivedField] && l.data?.[R.archivedField] !== l.originalRecord?.[R.archivedField] && (l.data[R.timestampField] = Pr()), l.data &&
|
|
11906
|
+
R && l.data?.[R.archivedField] && l.data?.[R.archivedField] !== l.originalRecord?.[R.archivedField] && (l.data[R.timestampField] = Pr()), l.data && gm(l.data), ht[f]++, await lc(h, f, l.data, void 0, {
|
|
11888
11907
|
retry: {
|
|
11889
11908
|
type: "offline",
|
|
11890
11909
|
originalRecord: l.originalRecord
|
|
11891
11910
|
}
|
|
11892
11911
|
}).catch((C) => {
|
|
11893
|
-
console.error(C)
|
|
11894
|
-
});
|
|
11912
|
+
console.error(C);
|
|
11913
|
+
}), ht[f]--, localStorage.setItem(`stoker-retry-${f}`, "done");
|
|
11895
11914
|
}
|
|
11896
11915
|
u === "delete" && (ht[f]++, await gw(h, f, {
|
|
11897
11916
|
retry: {
|
|
@@ -11905,16 +11924,16 @@ const _w = async (r, e) => {
|
|
|
11905
11924
|
}
|
|
11906
11925
|
}
|
|
11907
11926
|
}).catch((O) => {
|
|
11908
|
-
console.error(O)
|
|
11909
|
-
}));
|
|
11927
|
+
console.error(O);
|
|
11928
|
+
}), ht[f]--, localStorage.setItem(`stoker-retry-${f}`, "done"));
|
|
11910
11929
|
}
|
|
11911
11930
|
}
|
|
11912
|
-
},
|
|
11931
|
+
}, _m = (r) => !!ht[r], ww = () => {
|
|
11913
11932
|
ht = {};
|
|
11914
11933
|
};
|
|
11915
11934
|
let ln, Ga = 0;
|
|
11916
|
-
const
|
|
11917
|
-
const r =
|
|
11935
|
+
const bw = async () => {
|
|
11936
|
+
const r = Tm(), e = ke();
|
|
11918
11937
|
return dr(Ae(r, "system_deployment", "latest_deploy"), (n) => {
|
|
11919
11938
|
if (n.exists())
|
|
11920
11939
|
ln = n.data(), Ga++, Ga > 1 && (ln.refresh ? window.location.reload() : Ee(e.onVersionUpdate, [ln, Ga]));
|
|
@@ -11923,10 +11942,10 @@ const ww = async () => {
|
|
|
11923
11942
|
}, (n) => {
|
|
11924
11943
|
throw new Error("Error getting version info", { cause: n.message });
|
|
11925
11944
|
});
|
|
11926
|
-
},
|
|
11945
|
+
}, vm = () => ln;
|
|
11927
11946
|
let So;
|
|
11928
|
-
const
|
|
11929
|
-
const r = ke(), e =
|
|
11947
|
+
const Ow = async () => {
|
|
11948
|
+
const r = ke(), e = Tm();
|
|
11930
11949
|
dr(Ae(e, "system_deployment", "maintenance_mode"), (t) => {
|
|
11931
11950
|
if (t.exists())
|
|
11932
11951
|
So = t.data(), Ee(r.onMaintenanceUpdate, [So.active ? "on" : "off"]);
|
|
@@ -11935,17 +11954,17 @@ const bw = async () => {
|
|
|
11935
11954
|
}, (t) => {
|
|
11936
11955
|
throw new Error("Error getting maintenance status", { cause: t.message });
|
|
11937
11956
|
});
|
|
11938
|
-
},
|
|
11957
|
+
}, Ew = () => So;
|
|
11939
11958
|
let kr, wr = null;
|
|
11940
|
-
const
|
|
11959
|
+
const Sw = () => {
|
|
11941
11960
|
const r = gd(), e = ke();
|
|
11942
11961
|
let t = !1;
|
|
11943
|
-
return Wm(
|
|
11962
|
+
return Vm(Wm(r, ".info/connected"), (s) => {
|
|
11944
11963
|
s.val() === !0 ? (wr && (clearTimeout(wr), wr = null), kr = "Online", Ee(e.onConnectionStatusChange, [kr, !t]), t || (t = !0)) : !wr && t && (wr = setTimeout(() => {
|
|
11945
11964
|
kr = "Offline", Ee(e.onConnectionStatusChange, [kr]);
|
|
11946
11965
|
}, 5e3));
|
|
11947
11966
|
});
|
|
11948
|
-
}, Wt = () => kr,
|
|
11967
|
+
}, Wt = () => kr, Tw = () => navigator.onLine ? "Online" : "Offline", wm = async () => {
|
|
11949
11968
|
const r = ke(), e = fr(), t = e.currentUser;
|
|
11950
11969
|
if (r.preLogout && await Ee(r.preLogout, [t]) === !1)
|
|
11951
11970
|
throw new Error("Operation cancelled by preLogout");
|
|
@@ -11956,9 +11975,9 @@ const Ew = () => {
|
|
|
11956
11975
|
const s = { error: !0, instances: [{ instance: "[DEFAULT]", code: "SIGN_OUT", error: n }] };
|
|
11957
11976
|
await Ee(r.postLogout, [s]);
|
|
11958
11977
|
}
|
|
11959
|
-
},
|
|
11978
|
+
}, Rw = (r) => {
|
|
11960
11979
|
const e = (t) => {
|
|
11961
|
-
typeof t == "string" && t.includes("Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.") && (console.warn("Slow Firestore Connection Detected"), Ee(r.onFirestoreSlowConnection)), typeof t == "string" && t.includes("Using maximum backoff delay to prevent overloading the backend.") && (console.warn("Firestore Load Failure Detected"), Ee(r.onFirestoreLoadFailure)), typeof t == "string" && t.includes("The user's credential is no longer valid. The user must sign in again.") && (console.warn("User Credential Expired"),
|
|
11980
|
+
typeof t == "string" && t.includes("Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.") && (console.warn("Slow Firestore Connection Detected"), Ee(r.onFirestoreSlowConnection)), typeof t == "string" && t.includes("Using maximum backoff delay to prevent overloading the backend.") && (console.warn("Firestore Load Failure Detected"), Ee(r.onFirestoreLoadFailure)), typeof t == "string" && t.includes("The user's credential is no longer valid. The user must sign in again.") && (console.warn("User Credential Expired"), wm()), typeof t == "string" && t.includes("Connection to Indexed Database server lost. Refresh the page to try again") && (console.warn("Indexed Database Connection Lost"), Ee(r.onIndexedDBConnectionLost));
|
|
11962
11981
|
};
|
|
11963
11982
|
window.addEventListener("error", (t) => {
|
|
11964
11983
|
e(t.message);
|
|
@@ -11967,7 +11986,7 @@ const Ew = () => {
|
|
|
11967
11986
|
e(n);
|
|
11968
11987
|
});
|
|
11969
11988
|
};
|
|
11970
|
-
let ft, Tt,
|
|
11989
|
+
let ft, Tt, bm, ye, Om, Dr, fc, dc, qe, Em, Sn = [], ve;
|
|
11971
11990
|
const Ha = {
|
|
11972
11991
|
firestoreWriteApp: {}
|
|
11973
11992
|
}, dt = {
|
|
@@ -11986,17 +12005,17 @@ const Ha = {
|
|
|
11986
12005
|
return ve;
|
|
11987
12006
|
},
|
|
11988
12007
|
getTimezone() {
|
|
11989
|
-
return
|
|
12008
|
+
return bm;
|
|
11990
12009
|
},
|
|
11991
12010
|
getConnectionStatus: Wt,
|
|
11992
|
-
getNetworkStatus:
|
|
12011
|
+
getNetworkStatus: Tw,
|
|
11993
12012
|
getSchema(r = !1) {
|
|
11994
12013
|
const e = Oe(Dr);
|
|
11995
12014
|
if (r) {
|
|
11996
12015
|
for (const t of Object.values(e.collections))
|
|
11997
12016
|
for (const n of t.fields)
|
|
11998
12017
|
if (n.type === "Computed") {
|
|
11999
|
-
const s =
|
|
12018
|
+
const s = Ey(n, lt(t.labels.collection));
|
|
12000
12019
|
s.formula && (n.formula = s.formula);
|
|
12001
12020
|
}
|
|
12002
12021
|
} else
|
|
@@ -12005,7 +12024,7 @@ const Ha = {
|
|
|
12005
12024
|
return e;
|
|
12006
12025
|
},
|
|
12007
12026
|
getCurrentUser() {
|
|
12008
|
-
return
|
|
12027
|
+
return Em;
|
|
12009
12028
|
},
|
|
12010
12029
|
getCurrentUserRoleGroups() {
|
|
12011
12030
|
return Oe(dc);
|
|
@@ -12017,10 +12036,10 @@ const Ha = {
|
|
|
12017
12036
|
return Oe(ye);
|
|
12018
12037
|
},
|
|
12019
12038
|
getCollectionConfigModule(r) {
|
|
12020
|
-
return Oe(
|
|
12039
|
+
return Oe(Om[r]);
|
|
12021
12040
|
},
|
|
12022
|
-
getVersionInfo:
|
|
12023
|
-
getMaintenanceInfo:
|
|
12041
|
+
getVersionInfo: vm,
|
|
12042
|
+
getMaintenanceInfo: Ew,
|
|
12024
12043
|
getCurrentUserPermissions: Fe,
|
|
12025
12044
|
getLoadingState: Eo,
|
|
12026
12045
|
getAppCheck() {
|
|
@@ -12038,35 +12057,35 @@ const Ha = {
|
|
|
12038
12057
|
getFirestoreMaintenance() {
|
|
12039
12058
|
return ze.maintenance;
|
|
12040
12059
|
}
|
|
12041
|
-
},
|
|
12042
|
-
Dr = {}, fc = {}, dc = {}, qe = {},
|
|
12043
|
-
},
|
|
12060
|
+
}, Aw = () => {
|
|
12061
|
+
Dr = {}, fc = {}, dc = {}, qe = {}, ig(), uw(), ww();
|
|
12062
|
+
}, Cw = () => Sn, kw = () => {
|
|
12044
12063
|
Sn = [];
|
|
12045
12064
|
};
|
|
12046
12065
|
let md = !1;
|
|
12047
|
-
const
|
|
12066
|
+
const Bw = async (r, e, t, n) => {
|
|
12048
12067
|
if (ve = t, ft)
|
|
12049
12068
|
return console.error("Stoker is already initialized."), !0;
|
|
12050
|
-
|
|
12069
|
+
km("stoker-client", hp, "web"), Tt = ve.MODE, ye = r.default("web", To, n), bm = await se(ye, ["global", "timezone"]), se(ye, ["global", "roles"]), se(ye, ["global", "appName"]), se(ye, ["global", "auth", "enableMultiFactorAuth"]);
|
|
12051
12070
|
const s = JSON.parse(ve.STOKER_FB_WEB_APP_CONFIG), i = await se(ye, ["global", "firebase", "GDPRSettings"]);
|
|
12052
12071
|
ft = Vn(s, {
|
|
12053
12072
|
automaticDataCollectionEnabled: i || !0
|
|
12054
12073
|
});
|
|
12055
|
-
const a =
|
|
12074
|
+
const a = up(ft);
|
|
12056
12075
|
Tt === "development" && (a.instrumentationEnabled = !1, a.dataCollectionEnabled = !1);
|
|
12057
12076
|
const o = ["firestoreWrite"];
|
|
12058
|
-
for (const
|
|
12059
|
-
Ha[`${
|
|
12077
|
+
for (const _ of o)
|
|
12078
|
+
Ha[`${_}App`] = Vn(s, _);
|
|
12060
12079
|
const { firestoreWriteApp: c } = Ha, l = Vn(s, "maintenance");
|
|
12061
12080
|
ze.maintenance = je(l);
|
|
12062
|
-
const u =
|
|
12063
|
-
if (u.settings.minimumFetchIntervalMillis = 36e5, await
|
|
12081
|
+
const u = fp();
|
|
12082
|
+
if (u.settings.minimumFetchIntervalMillis = 36e5, await dp(u), ve.STOKER_FB_ENABLE_APP_CHECK === "true" && ve.STOKER_FB_APP_CHECK_KEY) {
|
|
12064
12083
|
(Tt === "development" || window.location.hostname === "localhost") && (globalThis.FIREBASE_APPCHECK_DEBUG_TOKEN = !0);
|
|
12065
|
-
const
|
|
12066
|
-
provider: new
|
|
12084
|
+
const _ = {
|
|
12085
|
+
provider: new lp(ve.STOKER_FB_APP_CHECK_KEY),
|
|
12067
12086
|
isTokenAutoRefreshEnabled: !0
|
|
12068
12087
|
};
|
|
12069
|
-
Ct.main = Bn(ft,
|
|
12088
|
+
Ct.main = Bn(ft, _), Ct.firestoreWrite = Bn(c, _), Ct.maintenance = Bn(l, _);
|
|
12070
12089
|
let A = !1;
|
|
12071
12090
|
const b = (m, S) => {
|
|
12072
12091
|
if (console.log(`App Check token error detected for ${S}`), !A)
|
|
@@ -12098,7 +12117,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12098
12117
|
"global",
|
|
12099
12118
|
"firebase",
|
|
12100
12119
|
"enableEmulators"
|
|
12101
|
-
]), v = await se(ye, ["global", "enableUserIDLogging"]),
|
|
12120
|
+
]), v = await se(ye, ["global", "enableUserIDLogging"]), y = await se(ye, [
|
|
12102
12121
|
"global",
|
|
12103
12122
|
"firebase",
|
|
12104
12123
|
"logLevel",
|
|
@@ -12108,24 +12127,24 @@ const zw = async (r, e, t, n) => {
|
|
|
12108
12127
|
"firebase",
|
|
12109
12128
|
"logLevel",
|
|
12110
12129
|
"prod"
|
|
12111
|
-
]), R = await
|
|
12112
|
-
throw new Error("Error checking analytics support.", { cause:
|
|
12130
|
+
]), R = await xm().catch((_) => {
|
|
12131
|
+
throw new Error("Error checking analytics support.", { cause: _ });
|
|
12113
12132
|
});
|
|
12114
|
-
Tt === "production" && f && R &&
|
|
12133
|
+
Tt === "production" && f && R && Nm(ft, d || {}), h && Fm(h);
|
|
12115
12134
|
const C = await se(ye, [
|
|
12116
12135
|
"global",
|
|
12117
12136
|
"auth",
|
|
12118
12137
|
"authPersistenceType"
|
|
12119
12138
|
]), E = {
|
|
12120
12139
|
popupRedirectResolver: void 0,
|
|
12121
|
-
persistence: C === "LOCAL" ? [
|
|
12140
|
+
persistence: C === "LOCAL" ? [Dm, Mm, wc] : C === "SESSION" ? [wc, bc] : [bc]
|
|
12122
12141
|
};
|
|
12123
12142
|
dt.main = vc(ft, E);
|
|
12124
|
-
for (const
|
|
12125
|
-
dt[
|
|
12143
|
+
for (const _ of o)
|
|
12144
|
+
dt[_] = vc(Ha[`${_}App`], E);
|
|
12126
12145
|
const { main: I } = dt;
|
|
12127
|
-
|
|
12128
|
-
if (
|
|
12146
|
+
Pm(I, async (_) => {
|
|
12147
|
+
if (_ && await Ee(ye.preLogin, [_]) === !1)
|
|
12129
12148
|
throw new Error("Operation cancelled by preLogin");
|
|
12130
12149
|
});
|
|
12131
12150
|
const T = await se(ye, [
|
|
@@ -12135,50 +12154,50 @@ const zw = async (r, e, t, n) => {
|
|
|
12135
12154
|
]);
|
|
12136
12155
|
if (Tt === "development" && p) {
|
|
12137
12156
|
if (!T?.includes("Auth")) {
|
|
12138
|
-
const
|
|
12157
|
+
const _ = ve.STOKER_FB_EMULATOR_AUTH_PORT ? parseInt(ve.STOKER_FB_EMULATOR_AUTH_PORT) : 9099;
|
|
12139
12158
|
for (const A of Object.values(dt))
|
|
12140
|
-
|
|
12159
|
+
qm(A, `http://localhost:${_}`);
|
|
12141
12160
|
}
|
|
12142
12161
|
if (!T?.includes("Database")) {
|
|
12143
|
-
const
|
|
12144
|
-
|
|
12162
|
+
const _ = ve.STOKER_FB_EMULATOR_DATABASE_PORT ? parseInt(ve.STOKER_FB_EMULATOR_DATABASE_PORT) : 9e3;
|
|
12163
|
+
zm(gd(), "localhost", _);
|
|
12145
12164
|
}
|
|
12146
12165
|
if (!T?.includes("Firestore")) {
|
|
12147
|
-
const
|
|
12148
|
-
Sc(ze.maintenance, "localhost",
|
|
12166
|
+
const _ = ve.STOKER_FB_EMULATOR_FIRESTORE_PORT ? parseInt(ve.STOKER_FB_EMULATOR_FIRESTORE_PORT) : 8080;
|
|
12167
|
+
Sc(ze.maintenance, "localhost", _);
|
|
12149
12168
|
}
|
|
12150
12169
|
if (!T?.includes("Storage")) {
|
|
12151
|
-
const
|
|
12152
|
-
|
|
12170
|
+
const _ = ve.STOKER_FB_EMULATOR_STORAGE_PORT ? parseInt(ve.STOKER_FB_EMULATOR_STORAGE_PORT) : 9199;
|
|
12171
|
+
ap(op(), "localhost", _);
|
|
12153
12172
|
}
|
|
12154
12173
|
if (!T?.includes("Functions")) {
|
|
12155
|
-
const
|
|
12156
|
-
|
|
12174
|
+
const _ = ve.STOKER_FB_EMULATOR_FUNCTIONS_PORT ? parseInt(ve.STOKER_FB_EMULATOR_FUNCTIONS_PORT) : 5001;
|
|
12175
|
+
cp($e(ft, ve.STOKER_FB_FUNCTIONS_REGION), "localhost", _);
|
|
12157
12176
|
}
|
|
12158
12177
|
}
|
|
12159
|
-
if (
|
|
12160
|
-
const
|
|
12178
|
+
if (bw(), Ow(), Sw(), Tt === "development" && (y ? Yr(y) : Yr("debug")), Tt === "production" && (O ? Yr(O) : Yr("error")), v) {
|
|
12179
|
+
const _ = Wn(I, async (A) => {
|
|
12161
12180
|
if (A) {
|
|
12162
12181
|
const b = JSON.parse(ve.STOKER_FB_WEB_APP_CONFIG);
|
|
12163
|
-
|
|
12182
|
+
Im(() => {
|
|
12164
12183
|
console.log(`Tenant - ${b.projectId} - User - ${A.uid}`);
|
|
12165
12184
|
});
|
|
12166
12185
|
}
|
|
12167
12186
|
});
|
|
12168
|
-
Sn.push(
|
|
12187
|
+
Sn.push(_);
|
|
12169
12188
|
}
|
|
12170
|
-
await Promise.all(Object.values(dt).map((
|
|
12171
|
-
throw new Error(`Error waiting for auth state in ${
|
|
12189
|
+
await Promise.all(Object.values(dt).map((_) => _.authStateReady().catch((A) => {
|
|
12190
|
+
throw new Error(`Error waiting for auth state in ${_.app.name}.`, { cause: A });
|
|
12172
12191
|
})));
|
|
12173
|
-
let
|
|
12174
|
-
for (const
|
|
12175
|
-
|
|
12192
|
+
let g = !1;
|
|
12193
|
+
for (const _ of Object.values(dt))
|
|
12194
|
+
_.currentUser || (g = !0);
|
|
12176
12195
|
let N;
|
|
12177
|
-
return Wn(I, async (
|
|
12178
|
-
if (
|
|
12179
|
-
qe =
|
|
12180
|
-
const A = await
|
|
12181
|
-
|
|
12196
|
+
return Wn(I, async (_) => {
|
|
12197
|
+
if (_) {
|
|
12198
|
+
qe = _;
|
|
12199
|
+
const A = await Lm(qe), { claims: b } = A;
|
|
12200
|
+
Em = {
|
|
12182
12201
|
...qe,
|
|
12183
12202
|
token: {
|
|
12184
12203
|
claims: b
|
|
@@ -12191,7 +12210,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12191
12210
|
H && (Z(), st({}));
|
|
12192
12211
|
});
|
|
12193
12212
|
}));
|
|
12194
|
-
await Promise.all(m), md || (
|
|
12213
|
+
await Promise.all(m), md || (Rw(ye), md = !0), N = await se(ye, ["global", "auth", "offlinePersistenceType"], [qe, b]);
|
|
12195
12214
|
const S = await se(ye, ["global", "auth", "tabManager"], [qe, b]), k = await se(ye, ["global", "auth", "garbageCollectionStrategy"], [qe, b]), D = await se(ye, ["global", "auth", "maxCacheSize"], [qe, b]) || -1, x = await se(ye, ["global", "auth", "maxWriteCacheSize"], [qe, b]);
|
|
12196
12215
|
let M;
|
|
12197
12216
|
const $ = {
|
|
@@ -12224,15 +12243,15 @@ const zw = async (r, e, t, n) => {
|
|
|
12224
12243
|
});
|
|
12225
12244
|
Dr = B.data.schema;
|
|
12226
12245
|
const te = Object.entries(B.data.allRoleGroups).map(([Ce, st]) => [Ce, new Set(st)]);
|
|
12227
|
-
fc = Object.fromEntries(te), dc = B.data.currentUserRoleGroups,
|
|
12246
|
+
fc = Object.fromEntries(te), dc = B.data.currentUserRoleGroups, Om = Oy(Object.keys(Dr.collections), e, "web", To, n);
|
|
12228
12247
|
const Je = await lw(qe, A);
|
|
12229
|
-
Sn.push(...Je), N === "WRITE" &&
|
|
12248
|
+
Sn.push(...Je), N === "WRITE" && vw(Dr, qe), await Ee(ye.postLogin, [qe]);
|
|
12230
12249
|
const Ve = new Event("stoker:ready");
|
|
12231
12250
|
document.dispatchEvent(Ve);
|
|
12232
12251
|
} else if (qe) {
|
|
12233
|
-
|
|
12252
|
+
Aw(), Cw().forEach((k) => {
|
|
12234
12253
|
k();
|
|
12235
|
-
}),
|
|
12254
|
+
}), kw();
|
|
12236
12255
|
const b = new Event("stoker:signOut");
|
|
12237
12256
|
document.dispatchEvent(b);
|
|
12238
12257
|
const m = { error: !1, instances: [] };
|
|
@@ -12262,9 +12281,9 @@ const zw = async (r, e, t, n) => {
|
|
|
12262
12281
|
console.error('Error clearing indexedDB persistence in "firestoreWrite".'), m.error = !0, m.instances.push({ instance: "firestoreWrite", code: "CLEAR_CACHE", error: k });
|
|
12263
12282
|
})), m.error ? console.info("Sign out operation completed with errors.") : console.info("Sign out operation completed successfully."), await Ee(ye.postLogout, [m]);
|
|
12264
12283
|
}
|
|
12265
|
-
}),
|
|
12266
|
-
}, { getEnv: Ue, getTimezone:
|
|
12267
|
-
const [n, s] = [fr(),
|
|
12284
|
+
}), g ? !1 : I.currentUser ? (v && console.info(`${I.currentUser.uid} successfully logged in.`), !0) : !1;
|
|
12285
|
+
}, { getEnv: Ue, getTimezone: Sm, getSchema: He, getCurrentUser: Zw, getCurrentUserRoleGroups: Kr, getAllRoleGroups: hc, getGlobalConfigModule: ke, getCollectionConfigModule: lt, getAppCheck: Gw, getAppCheckFirestoreWrite: Hw, getFirestoreWriteAuth: Iw, getFirestoreWrite: mc, getFirestoreMaintenance: Tm } = To, Kw = async (r, e, t) => {
|
|
12286
|
+
const [n, s] = [fr(), Iw()], i = ke();
|
|
12268
12287
|
if (!r || !e)
|
|
12269
12288
|
throw new Error("Email and password are required.");
|
|
12270
12289
|
try {
|
|
@@ -12273,12 +12292,12 @@ const zw = async (r, e, t, n) => {
|
|
|
12273
12292
|
a = n.currentUser?.uid;
|
|
12274
12293
|
else
|
|
12275
12294
|
try {
|
|
12276
|
-
a = (await
|
|
12295
|
+
a = (await $m(n, r, e)).user.uid;
|
|
12277
12296
|
} catch (c) {
|
|
12278
12297
|
if (c.code === "auth/multi-factor-auth-required")
|
|
12279
12298
|
if (t) {
|
|
12280
12299
|
o ||= await t();
|
|
12281
|
-
const l =
|
|
12300
|
+
const l = jm(n, c), u = Ja.assertionForSignIn(l.hints[0].uid, o);
|
|
12282
12301
|
a = (await l.resolveSignIn(u)).user.uid;
|
|
12283
12302
|
} else
|
|
12284
12303
|
throw new Error("TOTP retrieval function not found.");
|
|
@@ -12291,7 +12310,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12291
12310
|
const h = (await f()).data.customToken;
|
|
12292
12311
|
if (!h)
|
|
12293
12312
|
throw new Error("The user is not authenticated.");
|
|
12294
|
-
await
|
|
12313
|
+
await Um(s, h);
|
|
12295
12314
|
} catch {
|
|
12296
12315
|
throw n && n.currentUser && await yd(n), new Error("The user is not authenticated.");
|
|
12297
12316
|
}
|
|
@@ -12300,13 +12319,13 @@ const zw = async (r, e, t, n) => {
|
|
|
12300
12319
|
} catch (a) {
|
|
12301
12320
|
throw await Ee(i.postLogin, [null, a]), a;
|
|
12302
12321
|
}
|
|
12303
|
-
},
|
|
12322
|
+
}, Yw = (r) => (document.addEventListener("stoker:ready", r), () => {
|
|
12304
12323
|
document.removeEventListener("stoker:ready", r);
|
|
12305
|
-
}),
|
|
12324
|
+
}), Jw = (r) => (document.addEventListener("stoker:signOut", r), () => {
|
|
12306
12325
|
document.removeEventListener("stoker:signOut", r);
|
|
12307
|
-
}),
|
|
12326
|
+
}), Qw = (r) => (document.addEventListener("stoker:permissionsChange", r), () => {
|
|
12308
12327
|
document.removeEventListener("stoker:permissionsChange", r);
|
|
12309
|
-
}),
|
|
12328
|
+
}), Xw = async (r, e) => {
|
|
12310
12329
|
if (r.email) {
|
|
12311
12330
|
const t = ke(), n = await se(t, ["global", "appName"]), s = await Oc(r).getSession().catch((u) => {
|
|
12312
12331
|
throw new Error("Error getting multi-factor session.", { cause: u });
|
|
@@ -12329,7 +12348,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12329
12348
|
});
|
|
12330
12349
|
} else
|
|
12331
12350
|
throw new Error("User must have an email address to enroll in multi-factor authentication.");
|
|
12332
|
-
},
|
|
12351
|
+
}, eb = async (r, e, t) => {
|
|
12333
12352
|
const n = nt(), s = Ue(), i = $e(n, s.STOKER_FB_FUNCTIONS_REGION);
|
|
12334
12353
|
await Ke(i, "stoker-deletefolder")({
|
|
12335
12354
|
path: r || "",
|
|
@@ -12337,13 +12356,13 @@ const zw = async (r, e, t, n) => {
|
|
|
12337
12356
|
collectionPath: e.Collection_Path,
|
|
12338
12357
|
folderName: t
|
|
12339
12358
|
});
|
|
12340
|
-
},
|
|
12359
|
+
}, tb = async () => {
|
|
12341
12360
|
const r = [je(), mc()];
|
|
12342
12361
|
for (const e of Object.values(r))
|
|
12343
|
-
await
|
|
12362
|
+
await np(e).catch((t) => {
|
|
12344
12363
|
throw new Error(`Error waiting for pending writes in ${e.app.name}.`, { cause: t });
|
|
12345
12364
|
});
|
|
12346
|
-
},
|
|
12365
|
+
}, Rm = async (r, e, t, n, s) => {
|
|
12347
12366
|
const i = r.at(-1);
|
|
12348
12367
|
if (!i)
|
|
12349
12368
|
throw new Error("EMPTY_PATH");
|
|
@@ -12353,20 +12372,20 @@ const zw = async (r, e, t, n) => {
|
|
|
12353
12372
|
const o = He(!0), l = Kr()[i], u = je(), f = o.collections[i];
|
|
12354
12373
|
if (!f)
|
|
12355
12374
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12356
|
-
const { labels: d, preloadCache: h } = f, p = ke(), v = Object.keys(o.collections).includes(i),
|
|
12357
|
-
if (!v ||
|
|
12375
|
+
const { labels: d, preloadCache: h } = f, p = ke(), v = Object.keys(o.collections).includes(i), y = p.disabledCollections?.includes(i);
|
|
12376
|
+
if (!v || y)
|
|
12358
12377
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12359
12378
|
const O = lt(d.collection), R = await se(p, [
|
|
12360
12379
|
"global",
|
|
12361
12380
|
"firebase",
|
|
12362
12381
|
"serverTimestampOptions"
|
|
12363
|
-
]), C =
|
|
12382
|
+
]), C = lm(r, e, l);
|
|
12364
12383
|
if (C.length === 0)
|
|
12365
12384
|
throw new Error("PERMISSION_DENIED");
|
|
12366
12385
|
const w = h?.roles?.includes(a.Role), E = { collection: d.collection };
|
|
12367
12386
|
await oe("preOperation", p, O, ["read", void 0, e, E]), await oe("preRead", p, O, [E, C, !1, !0]);
|
|
12368
|
-
const
|
|
12369
|
-
let
|
|
12387
|
+
const g = /* @__PURE__ */ new Map(), N = [];
|
|
12388
|
+
let _ = {};
|
|
12370
12389
|
const A = /* @__PURE__ */ new Map();
|
|
12371
12390
|
typeof s?.relations == "object" && (s.relations.fields = s.relations.fields.map((x) => {
|
|
12372
12391
|
if (typeof x == "string") {
|
|
@@ -12378,21 +12397,21 @@ const zw = async (r, e, t, n) => {
|
|
|
12378
12397
|
return x;
|
|
12379
12398
|
}));
|
|
12380
12399
|
const b = () => {
|
|
12381
|
-
const x =
|
|
12382
|
-
if (x(),
|
|
12383
|
-
if (
|
|
12400
|
+
const x = bd(u, async () => {
|
|
12401
|
+
if (x(), _) {
|
|
12402
|
+
if (om(_, A), !s?.noComputedFields) {
|
|
12384
12403
|
const M = [];
|
|
12385
12404
|
for (const $ of f.fields)
|
|
12386
|
-
$.type === "Computed" && M.push(Ee(() => $.formula(
|
|
12387
|
-
|
|
12405
|
+
$.type === "Computed" && M.push(Ee(() => $.formula(_)).then((G) => {
|
|
12406
|
+
_ && (_[$.name] = G);
|
|
12388
12407
|
}));
|
|
12389
12408
|
await Promise.all(M);
|
|
12390
12409
|
}
|
|
12391
12410
|
if (s?.noEmbeddingFields)
|
|
12392
12411
|
for (const M of f.fields)
|
|
12393
|
-
M.type === "Embedding" && delete
|
|
12412
|
+
M.type === "Embedding" && delete _[M.name];
|
|
12394
12413
|
}
|
|
12395
|
-
t(Oe(
|
|
12414
|
+
t(Oe(_));
|
|
12396
12415
|
});
|
|
12397
12416
|
}, m = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), k = (x) => typeof x == "object" ? x.fields.filter(($) => typeof $ == "object" && _e($) && $t(f, o, a).includes($.collection)) : f.fields.filter(($) => _e($) && $t(f, o, a).includes($.collection)), D = () => new Promise((x) => {
|
|
12398
12417
|
if (!s?.relations) {
|
|
@@ -12403,10 +12422,10 @@ const zw = async (r, e, t, n) => {
|
|
|
12403
12422
|
for (const P of ae)
|
|
12404
12423
|
for (const B of S.values())
|
|
12405
12424
|
B.type === P.type && B.field === P.name && // eslint-disable-next-line security/detect-object-injection
|
|
12406
|
-
!
|
|
12425
|
+
!_[P.name][B.id] && (B.listener(), m.delete(`${P.name}_${B.id}`));
|
|
12407
12426
|
for (const P of ae)
|
|
12408
12427
|
if ("collection" in P) {
|
|
12409
|
-
const B =
|
|
12428
|
+
const B = _[P.name];
|
|
12410
12429
|
if (!B)
|
|
12411
12430
|
continue;
|
|
12412
12431
|
for (const te of Object.keys(B))
|
|
@@ -12417,7 +12436,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12417
12436
|
else
|
|
12418
12437
|
for (const P of ae)
|
|
12419
12438
|
if ("collection" in P) {
|
|
12420
|
-
const B =
|
|
12439
|
+
const B = _[P.name];
|
|
12421
12440
|
if (!B)
|
|
12422
12441
|
continue;
|
|
12423
12442
|
for (const [te, Je] of Object.entries(B))
|
|
@@ -12442,20 +12461,20 @@ const zw = async (r, e, t, n) => {
|
|
|
12442
12461
|
}
|
|
12443
12462
|
B[te] = H, $.set(`${P.name}_${te}`, !0), Array.from($.values()).every((j) => j) && (x({}), b(), oe("postOperation", p, O, [
|
|
12444
12463
|
"read",
|
|
12445
|
-
|
|
12464
|
+
_,
|
|
12446
12465
|
e,
|
|
12447
12466
|
E
|
|
12448
12467
|
]), oe("postRead", p, O, [
|
|
12449
12468
|
E,
|
|
12450
12469
|
C,
|
|
12451
|
-
|
|
12470
|
+
_,
|
|
12452
12471
|
!0
|
|
12453
12472
|
]));
|
|
12454
12473
|
}).catch((H) => {
|
|
12455
12474
|
delete B[te], H.code !== "permission-denied" && n && n(new Error(`Error fetching relation document in collection ${P.collection} with ID ${e} at location ${Je.Collection_Path?.join("/")}`, {
|
|
12456
12475
|
cause: H
|
|
12457
12476
|
}));
|
|
12458
|
-
}) :
|
|
12477
|
+
}) : Rm(
|
|
12459
12478
|
[...Je.Collection_Path],
|
|
12460
12479
|
te,
|
|
12461
12480
|
(H) => {
|
|
@@ -12469,13 +12488,13 @@ const zw = async (r, e, t, n) => {
|
|
|
12469
12488
|
}
|
|
12470
12489
|
B[te] = H, $.set(`${P.name}_${te}`, !0), Array.from($.values()).every((j) => j) && (x({}), b(), oe("postOperation", p, O, [
|
|
12471
12490
|
"read",
|
|
12472
|
-
|
|
12491
|
+
_,
|
|
12473
12492
|
e,
|
|
12474
12493
|
E
|
|
12475
12494
|
]), oe("postRead", p, O, [
|
|
12476
12495
|
E,
|
|
12477
12496
|
C,
|
|
12478
|
-
|
|
12497
|
+
_,
|
|
12479
12498
|
!0
|
|
12480
12499
|
]));
|
|
12481
12500
|
},
|
|
@@ -12505,22 +12524,22 @@ const zw = async (r, e, t, n) => {
|
|
|
12505
12524
|
const M = dr(x, { source: s?.only || (w ? "cache" : "default") }, ($) => {
|
|
12506
12525
|
if ($.exists()) {
|
|
12507
12526
|
const G = $.data({ serverTimestamps: R || "none" });
|
|
12508
|
-
if (
|
|
12527
|
+
if (g.has(x.path) && s?.relations) {
|
|
12509
12528
|
const P = k(s?.relations);
|
|
12510
12529
|
for (const B of P)
|
|
12511
|
-
"collection" in B && G[B.name] && (G[B.name] =
|
|
12530
|
+
"collection" in B && G[B.name] && (G[B.name] = _?.[B.name]);
|
|
12512
12531
|
}
|
|
12513
|
-
|
|
12532
|
+
g.set(x.path, !0), _ ||= {}, _.id ||= $.id, _ = { ..._, ...G }, delete _.Collection_Path_String;
|
|
12514
12533
|
const ae = A.get(x) || /* @__PURE__ */ new Set();
|
|
12515
|
-
|
|
12534
|
+
am(G, ae), A.set(x, ae), g.size === C.length && D().then(() => {
|
|
12516
12535
|
b(), oe("postOperation", p, O, [
|
|
12517
12536
|
"read",
|
|
12518
|
-
|
|
12537
|
+
_,
|
|
12519
12538
|
e,
|
|
12520
12539
|
E
|
|
12521
|
-
]), oe("postRead", p, O, [E, C,
|
|
12540
|
+
]), oe("postRead", p, O, [E, C, _, !0]);
|
|
12522
12541
|
});
|
|
12523
|
-
} else
|
|
12542
|
+
} else _ && (_ = void 0, b(), oe("postOperation", p, O, ["read", void 0, e, E]), oe("postRead", p, O, [E, C, void 0, !0]));
|
|
12524
12543
|
}, ($) => {
|
|
12525
12544
|
n && n($), N.forEach((G) => G());
|
|
12526
12545
|
});
|
|
@@ -12545,17 +12564,17 @@ const zw = async (r, e, t, n) => {
|
|
|
12545
12564
|
if (t?.id !== e)
|
|
12546
12565
|
throw new Error("INPUT_ERROR: Mismatched last cursor IDs");
|
|
12547
12566
|
});
|
|
12548
|
-
},
|
|
12567
|
+
}, rb = async (r, e, t, n, s) => {
|
|
12549
12568
|
const i = r.at(-1);
|
|
12550
12569
|
if (!i)
|
|
12551
12570
|
throw new Error("EMPTY_PATH");
|
|
12552
12571
|
const a = Fe();
|
|
12553
12572
|
if (!a?.Role)
|
|
12554
12573
|
throw new Error("PERMISSION_DENIED");
|
|
12555
|
-
const o = He(!0), l = Kr()[i], u = je(), f = o.collections[i], { labels: d, preloadCache: h, access: p } = f, { serverReadOnly: v } = p,
|
|
12574
|
+
const o = He(!0), l = Kr()[i], u = je(), f = o.collections[i], { labels: d, preloadCache: h, access: p } = f, { serverReadOnly: v } = p, y = ke(), O = Object.keys(o.collections).includes(i), R = y.disabledCollections?.includes(i);
|
|
12556
12575
|
if (!O || R)
|
|
12557
12576
|
throw new Error("COLLECTION_NOT_FOUND");
|
|
12558
|
-
const C = lt(d.collection), w = await se(
|
|
12577
|
+
const C = lt(d.collection), w = await se(y, [
|
|
12559
12578
|
"global",
|
|
12560
12579
|
"firebase",
|
|
12561
12580
|
"serverTimestampOptions"
|
|
@@ -12570,35 +12589,35 @@ const zw = async (r, e, t, n) => {
|
|
|
12570
12589
|
return { pages: 0, count: 0, unsubscribe: () => {
|
|
12571
12590
|
} };
|
|
12572
12591
|
let T = I.map((Z) => pe(Z, ...e));
|
|
12573
|
-
const
|
|
12592
|
+
const g = s?.pagination?.startAfter || s?.pagination?.endBefore || s?.pagination?.startAt || s?.pagination?.endAt || {
|
|
12574
12593
|
first: /* @__PURE__ */ new Map(),
|
|
12575
12594
|
last: /* @__PURE__ */ new Map()
|
|
12576
12595
|
};
|
|
12577
12596
|
if (s?.pagination) {
|
|
12578
12597
|
if (s.pagination.startAfter && s.pagination.endBefore || s.pagination.startAfter && s.pagination.endAt || s.pagination.startAfter && s.pagination.startAt || s.pagination.startAt && s.pagination.endBefore || s.pagination.startAt && s.pagination.endAt || s.pagination.endBefore && s.pagination.endAt)
|
|
12579
12598
|
throw new Error("INPUT_ERROR: Only one of startAfter, startAt, endBefore, or endAt can be provided");
|
|
12580
|
-
const Z = s.pagination.startAfter || s.pagination.endBefore || s.pagination.startAt || s.pagination.endAt, H =
|
|
12599
|
+
const Z = s.pagination.startAfter || s.pagination.endBefore || s.pagination.startAt || s.pagination.endAt, H = Ld(a.Role, f, o);
|
|
12581
12600
|
if (Z && H !== !0)
|
|
12582
12601
|
throw new Error("INPUT_ERROR: Pagination is not allowed when using " + H);
|
|
12583
12602
|
s.pagination.startAfter || s.pagination.endBefore || s.pagination.startAt || s.pagination.endAt ? s.pagination.startAfter ? (Ya(s.pagination.startAfter), T = T.map((j, Y) => {
|
|
12584
12603
|
if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
|
|
12585
12604
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using startAfter");
|
|
12586
|
-
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection), Qa(
|
|
12605
|
+
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection), Qa(g.last.get(Y)));
|
|
12587
12606
|
return s.pagination.number && (W = pe(W, Xt(s.pagination.number))), W;
|
|
12588
12607
|
})) : s.pagination.endBefore ? (Ka(s.pagination.endBefore), T = T.map((j, Y) => {
|
|
12589
12608
|
if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
|
|
12590
12609
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using endBefore");
|
|
12591
|
-
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection), Xa(
|
|
12610
|
+
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection), Xa(g.first.get(Y)));
|
|
12592
12611
|
return s.pagination.number && (W = pe(W, Ir(s.pagination.number))), W;
|
|
12593
12612
|
})) : s.pagination.startAt ? (Ka(s.pagination.startAt), T = T.map((j, Y) => {
|
|
12594
12613
|
if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
|
|
12595
12614
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using startAt");
|
|
12596
|
-
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection),
|
|
12615
|
+
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection), sp(g.first.get(Y)));
|
|
12597
12616
|
return s.pagination.number && (W = pe(W, Ir(s.pagination.number))), W;
|
|
12598
12617
|
})) : s.pagination.endAt && (Ya(s.pagination.endAt), T = T.map((j, Y) => {
|
|
12599
12618
|
if (!s.pagination?.orderByField || !s.pagination.orderByDirection)
|
|
12600
12619
|
throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using endAt");
|
|
12601
|
-
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection),
|
|
12620
|
+
let W = pe(j, et(s.pagination.orderByField, s.pagination.orderByDirection), ip(g.last.get(Y)));
|
|
12602
12621
|
return s.pagination.number && (W = pe(W, Ir(s.pagination.number))), W;
|
|
12603
12622
|
})) : T = T.map((j) => {
|
|
12604
12623
|
let Y = pe(j);
|
|
@@ -12606,7 +12625,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12606
12625
|
});
|
|
12607
12626
|
}
|
|
12608
12627
|
const N = { collection: d.collection };
|
|
12609
|
-
await oe("preOperation",
|
|
12628
|
+
await oe("preOperation", y, C, ["read", void 0, void 0, N]), await oe("preRead", y, C, [N, T, !0, !0]);
|
|
12610
12629
|
let b = !0;
|
|
12611
12630
|
const m = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), k = [], D = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), $ = (Z, H) => {
|
|
12612
12631
|
let j = !0;
|
|
@@ -12615,11 +12634,11 @@ const zw = async (r, e, t, n) => {
|
|
|
12615
12634
|
W === "loaded" || W === "deleted" || (j = !1);
|
|
12616
12635
|
}), m.size === T.length && j) {
|
|
12617
12636
|
b = !1;
|
|
12618
|
-
const Y =
|
|
12637
|
+
const Y = bd(u, () => {
|
|
12619
12638
|
Y();
|
|
12620
12639
|
const W = [];
|
|
12621
12640
|
D.forEach((de) => {
|
|
12622
|
-
|
|
12641
|
+
om(de, x.get(de.id));
|
|
12623
12642
|
for (const X of f.fields)
|
|
12624
12643
|
X.type === "Computed" && W.push(Ee(() => X.formula(de)).then((me) => {
|
|
12625
12644
|
de[X.name] = me;
|
|
@@ -12627,7 +12646,7 @@ const zw = async (r, e, t, n) => {
|
|
|
12627
12646
|
}), Promise.all(W).then(() => {
|
|
12628
12647
|
t(Array.from(D.values()), Z, H), D.forEach((de) => {
|
|
12629
12648
|
const X = ["read", de, de.id, N];
|
|
12630
|
-
oe("postOperation",
|
|
12649
|
+
oe("postOperation", y, C, X), oe("postRead", y, C, [N, I, de, !0]);
|
|
12631
12650
|
});
|
|
12632
12651
|
});
|
|
12633
12652
|
});
|
|
@@ -12651,17 +12670,17 @@ const zw = async (r, e, t, n) => {
|
|
|
12651
12670
|
G[j] ||= /* @__PURE__ */ new Map();
|
|
12652
12671
|
for (const me of W)
|
|
12653
12672
|
for (const K of ae[j].entries()) {
|
|
12654
|
-
const [
|
|
12673
|
+
const [ne, Ie] = K;
|
|
12655
12674
|
Ie.doc === j && Ie.type === me.type && Ie.field === me.name && (!D.has(j) || // eslint-disable-next-line security/detect-object-injection
|
|
12656
|
-
!Z[me.name][
|
|
12675
|
+
!Z[me.name][ne]) && (Ie.listener(), G[j].delete(ne));
|
|
12657
12676
|
}
|
|
12658
12677
|
for (const me of W)
|
|
12659
12678
|
if ("collection" in me) {
|
|
12660
12679
|
const K = Z[me.name];
|
|
12661
12680
|
if (!K)
|
|
12662
12681
|
continue;
|
|
12663
|
-
for (const
|
|
12664
|
-
!K?.[
|
|
12682
|
+
for (const ne of Object.keys(K))
|
|
12683
|
+
!K?.[ne].id && !G[j].has(ne) && (de.set(ne, !1), G[j].has(ne) ? X.set(ne, !0) : G[j].set(ne, !0));
|
|
12665
12684
|
}
|
|
12666
12685
|
if (de.size === 0)
|
|
12667
12686
|
S.set(j, "loaded"), $(H);
|
|
@@ -12671,55 +12690,55 @@ const zw = async (r, e, t, n) => {
|
|
|
12671
12690
|
const K = Z[me.name];
|
|
12672
12691
|
if (!K)
|
|
12673
12692
|
continue;
|
|
12674
|
-
for (const [
|
|
12675
|
-
if (X.has(
|
|
12693
|
+
for (const [ne, Ie] of Object.entries(K))
|
|
12694
|
+
if (X.has(ne)) {
|
|
12676
12695
|
const Gt = async () => {
|
|
12677
|
-
K[
|
|
12696
|
+
K[ne].id ? (de.set(ne, !0), Array.from(de.values()).every((bt) => bt) && S.set(j, "loaded")) : setTimeout(Gt, 100);
|
|
12678
12697
|
};
|
|
12679
12698
|
Gt();
|
|
12680
12699
|
} else {
|
|
12681
12700
|
const Gt = o.collections[me.collection], { access: bt } = Gt, { serverReadOnly: it } = bt;
|
|
12682
|
-
it?.includes(a.Role) ? _r([...Ie.Collection_Path],
|
|
12701
|
+
it?.includes(a.Role) ? _r([...Ie.Collection_Path], ne).then((Se) => {
|
|
12683
12702
|
if (!Se) {
|
|
12684
|
-
delete K[
|
|
12703
|
+
delete K[ne];
|
|
12685
12704
|
return;
|
|
12686
12705
|
}
|
|
12687
|
-
if (!D.has(j) || !K?.[
|
|
12688
|
-
de.set(
|
|
12706
|
+
if (!D.has(j) || !K?.[ne]) {
|
|
12707
|
+
de.set(ne, !0), G[j].delete(ne);
|
|
12689
12708
|
return;
|
|
12690
12709
|
}
|
|
12691
|
-
K[
|
|
12710
|
+
K[ne] = Se, de.set(ne, !0), Array.from(de.values()).every((Ot) => Ot) && (S.set(j, "loaded"), $(H));
|
|
12692
12711
|
}).catch((Se) => {
|
|
12693
|
-
delete K[
|
|
12712
|
+
delete K[ne], Se.code !== "permission-denied" && n && n(new Error(`Error fetching relation document in collection ${me.collection} with ID ${j} at location ${Ie.Collection_Path?.join("/")}`, {
|
|
12694
12713
|
cause: Se
|
|
12695
12714
|
}));
|
|
12696
|
-
}) :
|
|
12715
|
+
}) : Rm(
|
|
12697
12716
|
[...Ie.Collection_Path],
|
|
12698
|
-
|
|
12717
|
+
ne,
|
|
12699
12718
|
(Se) => {
|
|
12700
12719
|
if (!Se) {
|
|
12701
|
-
delete K[
|
|
12720
|
+
delete K[ne];
|
|
12702
12721
|
return;
|
|
12703
12722
|
}
|
|
12704
|
-
if (!D.has(j) || !K?.[
|
|
12705
|
-
ae[j].has(
|
|
12723
|
+
if (!D.has(j) || !K?.[ne]) {
|
|
12724
|
+
ae[j].has(ne) && ae[j].get(ne)?.listener(), de.set(ne, !0), G[j].delete(ne);
|
|
12706
12725
|
return;
|
|
12707
12726
|
}
|
|
12708
|
-
K[
|
|
12727
|
+
K[ne] = Se, de.set(ne, !0), Array.from(de.values()).every((Ot) => Ot) && (S.set(j, "loaded"), $(H));
|
|
12709
12728
|
},
|
|
12710
12729
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12711
12730
|
(Se) => {
|
|
12712
|
-
delete K[
|
|
12731
|
+
delete K[ne], Se.code !== "permission-denied" && n && n(new Error(`Error fetching relation document in collection ${me.collection} with ID ${j} at location ${Ie.Collection_Path?.join("/")}`, {
|
|
12713
12732
|
cause: Se
|
|
12714
12733
|
}));
|
|
12715
12734
|
},
|
|
12716
12735
|
{ ...s, relations: !1 }
|
|
12717
12736
|
).then((Se) => {
|
|
12718
|
-
if (!D.has(j) || !K?.[
|
|
12719
|
-
Se(), G[j].delete(
|
|
12737
|
+
if (!D.has(j) || !K?.[ne]) {
|
|
12738
|
+
Se(), G[j].delete(ne);
|
|
12720
12739
|
return;
|
|
12721
12740
|
}
|
|
12722
|
-
k.push(Se), ae[j].set(
|
|
12741
|
+
k.push(Se), ae[j].set(ne, {
|
|
12723
12742
|
doc: j,
|
|
12724
12743
|
type: me.type,
|
|
12725
12744
|
field: me.name,
|
|
@@ -12742,19 +12761,19 @@ const zw = async (r, e, t, n) => {
|
|
|
12742
12761
|
});
|
|
12743
12762
|
H.id ||= j.id, H = { ...H, ...Y }, delete H.Collection_Path_String;
|
|
12744
12763
|
const W = x.get(j.id) || /* @__PURE__ */ new Map(), de = W.get(Z) || /* @__PURE__ */ new Set();
|
|
12745
|
-
|
|
12764
|
+
am(Y, de), W.set(Z, de), x.set(j.id, W), D.set(j.id, H);
|
|
12746
12765
|
}, Je = s?.only === "cache" || E;
|
|
12747
12766
|
for (const Z of T) {
|
|
12748
12767
|
let H = !0;
|
|
12749
12768
|
const j = dr(Z, { source: Je ? "cache" : "default", includeMetadataChanges: !0 }, (Y) => {
|
|
12750
|
-
(Je || Y.metadata.fromCache === !1) && (m.set(Z, !0),
|
|
12769
|
+
(Je || Y.metadata.fromCache === !1) && (m.set(Z, !0), g.first.set(T.indexOf(Z), Y.docs[0]), g.last.set(T.indexOf(Z), Y.docs.at(-1) || Y.docs[0]), b && s?.relations || $(g, Y.metadata)), m.get(Z) === !0 && (H ? (Y.docs.forEach((W) => {
|
|
12751
12770
|
const de = D.get(W.id) || {}, X = M.get(W.id) || 0;
|
|
12752
12771
|
M.set(W.id, X + 1), te(Z, de, W);
|
|
12753
12772
|
}), H = !1) : Y.docChanges().forEach((W) => {
|
|
12754
12773
|
const de = D.get(W.doc.id) || {}, X = M.get(W.doc.id) || 0;
|
|
12755
12774
|
W.type === "added" && M.set(W.doc.id, X + 1), W.type === "added" || W.type === "modified" ? te(Z, de, W.doc) : W.type === "removed" && (M.set(W.doc.id, X - 1), M.get(W.doc.id) === 0 && (D.delete(W.doc.id), m.size === T.length && s?.relations && (S.set(W.doc.id, "deleted"), B(W.doc.id))));
|
|
12756
|
-
}), m.size === T.length && s?.relations && (D.size === 0 && $(
|
|
12757
|
-
P(W,
|
|
12775
|
+
}), m.size === T.length && s?.relations && (D.size === 0 && $(g, Y.metadata), D.forEach((W) => {
|
|
12776
|
+
P(W, g);
|
|
12758
12777
|
})));
|
|
12759
12778
|
}, (Y) => {
|
|
12760
12779
|
n && n(new Error(`Error fetching documents at location ${r.join("/")}`, { cause: Y })), k.forEach((W) => W());
|
|
@@ -12774,16 +12793,16 @@ const zw = async (r, e, t, n) => {
|
|
|
12774
12793
|
}
|
|
12775
12794
|
}
|
|
12776
12795
|
return { pages: Ce, count: Ve, unsubscribe: (Z) => {
|
|
12777
|
-
Z === "first" && Ka(
|
|
12796
|
+
Z === "first" && Ka(g), Z === "last" && Ya(g), k.forEach((H) => H());
|
|
12778
12797
|
} };
|
|
12779
|
-
},
|
|
12798
|
+
}, nb = async (r, e) => {
|
|
12780
12799
|
const t = nt(), n = Ue(), s = $e(t, n.STOKER_FB_FUNCTIONS_REGION);
|
|
12781
12800
|
return (await Ke(s, "stoker-getfiles")({
|
|
12782
12801
|
collectionPath: e.Collection_Path,
|
|
12783
12802
|
id: e.id,
|
|
12784
12803
|
path: r
|
|
12785
12804
|
})).data.result;
|
|
12786
|
-
},
|
|
12805
|
+
}, xw = async (r, e, t, n, s, i) => {
|
|
12787
12806
|
const a = nt(), o = Ue(), c = $e(a, o.STOKER_FB_FUNCTIONS_REGION);
|
|
12788
12807
|
await Ke(c, "stoker-adminemail")({
|
|
12789
12808
|
subject: r,
|
|
@@ -12793,12 +12812,12 @@ const zw = async (r, e, t, n) => {
|
|
|
12793
12812
|
bcc: s,
|
|
12794
12813
|
replyTo: i
|
|
12795
12814
|
});
|
|
12796
|
-
},
|
|
12815
|
+
}, sb = async (r, e, t, n, s, i, a, o, c) => {
|
|
12797
12816
|
if (Ue().MODE === "development") {
|
|
12798
|
-
await
|
|
12817
|
+
await xw(e, t, n, s, i, a);
|
|
12799
12818
|
return;
|
|
12800
12819
|
}
|
|
12801
|
-
const f = Za(r), d = aw(e), h = t ? dd(t) : void 0, p = n ? dd(n) : void 0, v = s ? Za(s) : void 0,
|
|
12820
|
+
const f = Za(r), d = aw(e), h = t ? dd(t) : void 0, p = n ? dd(n) : void 0, v = s ? Za(s) : void 0, y = i ? Za(i) : void 0, O = a ? En(a) : void 0, R = c ? En(c) : void 0, C = Array.isArray(f) ? f : [f];
|
|
12802
12821
|
if (C.length === 0 || C.length === 1 && !C[0])
|
|
12803
12822
|
throw new Error("No valid email addresses provided");
|
|
12804
12823
|
const w = je(), E = { to: f, message: { subject: d } };
|
|
@@ -12806,101 +12825,98 @@ const zw = async (r, e, t, n) => {
|
|
|
12806
12825
|
const I = Array.isArray(v) ? v : [v];
|
|
12807
12826
|
I.length > 0 && I[0] && (E.cc = v);
|
|
12808
12827
|
}
|
|
12809
|
-
if (
|
|
12810
|
-
const I = Array.isArray(
|
|
12811
|
-
I.length > 0 && I[0] && (E.bcc =
|
|
12828
|
+
if (y) {
|
|
12829
|
+
const I = Array.isArray(y) ? y : [y];
|
|
12830
|
+
I.length > 0 && I[0] && (E.bcc = y);
|
|
12812
12831
|
}
|
|
12813
|
-
O && (E.replyTo = O), o && (E.message.attachments = o), R && (E.from = R), await
|
|
12814
|
-
},
|
|
12832
|
+
O && (E.replyTo = O), o && (E.message.attachments = o), R && (E.from = R), await Od(Mr(w, "system_mail"), E);
|
|
12833
|
+
}, Nw = async (r) => {
|
|
12815
12834
|
const e = nt(), t = Ue(), n = $e(e, t.STOKER_FB_FUNCTIONS_REGION);
|
|
12816
12835
|
await Ke(n, "stoker-adminsms")({
|
|
12817
12836
|
body: r
|
|
12818
12837
|
});
|
|
12819
|
-
},
|
|
12838
|
+
}, ib = async (r, e) => {
|
|
12820
12839
|
if (Ue().MODE === "development") {
|
|
12821
|
-
await
|
|
12840
|
+
await Nw(e);
|
|
12822
12841
|
return;
|
|
12823
12842
|
}
|
|
12824
12843
|
const s = je(), i = { to: r, body: e };
|
|
12825
|
-
await
|
|
12826
|
-
},
|
|
12827
|
-
const e =
|
|
12844
|
+
await Od(Mr(s, "system_messages"), i);
|
|
12845
|
+
}, ab = (r) => {
|
|
12846
|
+
const e = Sm();
|
|
12828
12847
|
return z.fromJSDate(r).setZone(e);
|
|
12829
|
-
},
|
|
12830
|
-
const e =
|
|
12848
|
+
}, Fw = (r) => {
|
|
12849
|
+
const e = Sm();
|
|
12831
12850
|
return z.fromJSDate(r.toDate()).setZone(e);
|
|
12832
|
-
},
|
|
12851
|
+
}, ob = (r, e) => {
|
|
12833
12852
|
const n = z.fromJSDate(r, { zone: e }).offset, i = z.fromJSDate(r).offset, a = n - i;
|
|
12834
12853
|
return z.fromJSDate(r).plus({ minutes: a }).toJSDate();
|
|
12835
|
-
},
|
|
12854
|
+
}, cb = (r, e) => {
|
|
12836
12855
|
const n = z.fromJSDate(r, { zone: e }).offset, i = z.fromJSDate(r).offset, a = n - i;
|
|
12837
12856
|
return z.fromJSDate(r).minus({ minutes: a }).toJSDate();
|
|
12838
|
-
},
|
|
12839
|
-
const t = nt(), n = Ue(), s = $e(t, n.STOKER_FB_FUNCTIONS_REGION);
|
|
12840
|
-
return (await Ke(s, r)(e)).data;
|
|
12841
|
-
};
|
|
12857
|
+
}, lb = (r) => "seconds" in r && "nanoseconds" in r ? Fw(new zt(r.seconds, r.nanoseconds)).toFormat("MMMM d, yyyy '@' h:mm a") : "";
|
|
12842
12858
|
export {
|
|
12843
|
-
|
|
12859
|
+
ym as addRecord,
|
|
12844
12860
|
pw as addRecordServer,
|
|
12845
|
-
|
|
12846
|
-
|
|
12847
|
-
|
|
12848
|
-
|
|
12849
|
-
|
|
12850
|
-
|
|
12861
|
+
Kw as authenticateStoker,
|
|
12862
|
+
_w as callFunction,
|
|
12863
|
+
kw as clearUnsubscribes,
|
|
12864
|
+
ab as convertDateToTimezone,
|
|
12865
|
+
Fw as convertTimestampToTimezone,
|
|
12866
|
+
eb as deleteFolder,
|
|
12851
12867
|
gw as deleteRecord,
|
|
12852
12868
|
yw as deleteRecordServer,
|
|
12853
|
-
|
|
12854
|
-
|
|
12869
|
+
um as deserializeTimestamps,
|
|
12870
|
+
lb as displayDate,
|
|
12855
12871
|
hc as getAllRoleGroups,
|
|
12856
|
-
|
|
12857
|
-
|
|
12872
|
+
Gw as getAppCheck,
|
|
12873
|
+
Hw as getAppCheckFirestoreWrite,
|
|
12858
12874
|
se as getCachedConfigValue,
|
|
12859
12875
|
lt as getCollectionConfigModule,
|
|
12860
12876
|
ic as getCollectionRefs,
|
|
12861
12877
|
Wt as getConnectionStatus,
|
|
12862
|
-
|
|
12878
|
+
Zw as getCurrentUser,
|
|
12863
12879
|
Fe as getCurrentUserPermissions,
|
|
12864
12880
|
Kr as getCurrentUserRoleGroups,
|
|
12865
|
-
|
|
12881
|
+
lm as getDocumentRefs,
|
|
12866
12882
|
Ue as getEnv,
|
|
12867
|
-
|
|
12868
|
-
|
|
12883
|
+
nb as getFiles,
|
|
12884
|
+
Tm as getFirestoreMaintenance,
|
|
12869
12885
|
mc as getFirestoreWrite,
|
|
12870
|
-
|
|
12886
|
+
Iw as getFirestoreWriteAuth,
|
|
12871
12887
|
ke as getGlobalConfigModule,
|
|
12872
12888
|
Eo as getLoadingState,
|
|
12873
|
-
|
|
12874
|
-
|
|
12889
|
+
Ew as getMaintenanceInfo,
|
|
12890
|
+
Tw as getNetworkStatus,
|
|
12875
12891
|
_r as getOne,
|
|
12876
12892
|
dw as getOneServer,
|
|
12877
12893
|
He as getSchema,
|
|
12878
|
-
|
|
12894
|
+
dm as getSome,
|
|
12879
12895
|
fw as getSomeServer,
|
|
12880
|
-
|
|
12881
|
-
|
|
12882
|
-
|
|
12896
|
+
Sm as getTimezone,
|
|
12897
|
+
Cw as getUnsubscribes,
|
|
12898
|
+
vm as getVersionInfo,
|
|
12883
12899
|
Ug as getZodSchema,
|
|
12884
|
-
|
|
12900
|
+
Bw as initializeStoker,
|
|
12885
12901
|
sr as isDeleteSentinel,
|
|
12886
|
-
|
|
12887
|
-
|
|
12888
|
-
|
|
12889
|
-
|
|
12890
|
-
|
|
12891
|
-
|
|
12902
|
+
ob as keepTimezone,
|
|
12903
|
+
Xw as multiFactorEnroll,
|
|
12904
|
+
Qw as onStokerPermissionsChange,
|
|
12905
|
+
Yw as onStokerReady,
|
|
12906
|
+
Jw as onStokerSignOut,
|
|
12907
|
+
zw as preloadCache,
|
|
12892
12908
|
Fr as preloadCollection,
|
|
12893
|
-
|
|
12894
|
-
|
|
12895
|
-
|
|
12896
|
-
|
|
12897
|
-
|
|
12898
|
-
|
|
12899
|
-
|
|
12900
|
-
|
|
12901
|
-
|
|
12909
|
+
cb as removeTimezone,
|
|
12910
|
+
xw as sendAdminEmail,
|
|
12911
|
+
Nw as sendAdminSMS,
|
|
12912
|
+
sb as sendMail,
|
|
12913
|
+
ib as sendMessage,
|
|
12914
|
+
pm as serializeTimestamps,
|
|
12915
|
+
wm as signOut,
|
|
12916
|
+
rb as subscribeMany,
|
|
12917
|
+
Rm as subscribeOne,
|
|
12902
12918
|
Ee as tryPromise,
|
|
12903
12919
|
lc as updateRecord,
|
|
12904
12920
|
mw as updateRecordServer,
|
|
12905
|
-
|
|
12921
|
+
tb as waitForPendingWrites
|
|
12906
12922
|
};
|