@stoker-platform/web-client 0.5.90 → 0.5.91

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.
Files changed (2) hide show
  1. package/dist/bundle.js +765 -761
  2. package/package.json +1 -1
package/dist/bundle.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import { getApp as it, registerVersion as Pm, initializeApp as Hn, setLogLevel as en, onLog as Mm } from "firebase/app";
2
2
  import { isSupported as qm, initializeAnalytics as Lm, setConsent as $m } from "firebase/analytics";
3
- import { getAuth as hr, validatePassword as Ed, initializeAuth as Sc, indexedDBLocalPersistence as jm, browserLocalPersistence as Vm, browserSessionPersistence as Tc, inMemoryPersistence as Rc, beforeAuthStateChanged as Um, connectAuthEmulator as Wm, onAuthStateChanged as Kn, getIdTokenResult as zm, signOut as Sd, signInWithEmailAndPassword as Bm, getMultiFactorResolver as Zm, TotpMultiFactorGenerator as ro, signInWithCustomToken as Gm, multiFactor as Cc } from "firebase/auth";
4
- import { getDatabase as Td, onValue as Hm, ref as Km, connectDatabaseEmulator as Ym } from "firebase/database";
5
- import { where as ye, query as he, collection as $r, and as tn, or as Ac, onSnapshot as mr, doc as Ae, Timestamp as zt, setDoc as Jm, getDoc as Rd, orderBy as rt, limit as er, startAfter as no, endBefore as so, limitToLast as Dr, getDocsFromCache as Cd, getDocsFromServer as Qm, getDocs as Xm, getCountFromServer as Ad, getDocFromCache as ep, getDocFromServer as tp, writeBatch as xo, serverTimestamp as jr, deleteField as xn, arrayRemove as No, arrayUnion as Fo, collectionGroup as rp, getFirestore as kc, initializeFirestore as rn, connectFirestoreEmulator as Ic, persistentLocalCache as xc, persistentSingleTabManager as Nc, persistentMultipleTabManager as Fc, memoryEagerGarbageCollector as np, memoryLruGarbageCollector as sp, memoryLocalCache as ip, getPersistentCacheIndexManager as ap, enablePersistentCacheIndexAutoCreation as op, terminate as cp, clearIndexedDbPersistence as Dc, waitForPendingWrites as lp, onSnapshotsInSync as kd, startAt as up, endAt as fp, addDoc as Id } from "firebase/firestore";
6
- import { connectStorageEmulator as dp, getStorage as hp } from "firebase/storage";
3
+ import { getAuth as hr, validatePassword as Ef, initializeAuth as Sc, indexedDBLocalPersistence as jm, browserLocalPersistence as Vm, browserSessionPersistence as Tc, inMemoryPersistence as Rc, beforeAuthStateChanged as Um, connectAuthEmulator as Wm, onAuthStateChanged as Kn, getIdTokenResult as zm, signOut as Sf, signInWithEmailAndPassword as Bm, getMultiFactorResolver as Zm, TotpMultiFactorGenerator as ro, signInWithCustomToken as Gm, multiFactor as Cc } from "firebase/auth";
4
+ import { getDatabase as Tf, onValue as Hm, ref as Km, connectDatabaseEmulator as Ym } from "firebase/database";
5
+ import { where as ye, query as he, collection as $r, and as tn, or as Ac, onSnapshot as mr, doc as Ae, Timestamp as zt, setDoc as Jm, getDoc as Rf, orderBy as rt, limit as er, startAfter as no, endBefore as so, limitToLast as Dr, getDocsFromCache as Cf, getDocsFromServer as Qm, getDocs as Xm, getCountFromServer as Af, getDocFromCache as ep, getDocFromServer as tp, writeBatch as xo, serverTimestamp as jr, deleteField as xn, arrayRemove as No, arrayUnion as Fo, collectionGroup as rp, getFirestore as kc, initializeFirestore as rn, connectFirestoreEmulator as Ic, persistentLocalCache as xc, persistentSingleTabManager as Nc, persistentMultipleTabManager as Fc, memoryEagerGarbageCollector as np, memoryLruGarbageCollector as sp, memoryLocalCache as ip, getPersistentCacheIndexManager as ap, enablePersistentCacheIndexAutoCreation as op, terminate as cp, clearIndexedDbPersistence as Dc, waitForPendingWrites as lp, onSnapshotsInSync as kf, startAt as up, endAt as dp, addDoc as If } from "firebase/firestore";
6
+ import { connectStorageEmulator as fp, getStorage as hp } from "firebase/storage";
7
7
  import { getFunctions as Ue, httpsCallable as Je, connectFunctionsEmulator as mp } from "firebase/functions";
8
8
  import { ReCaptchaEnterpriseProvider as pp, initializeAppCheck as Yn, onTokenChanged as Jn } from "firebase/app-check";
9
9
  import { getPerformance as gp } from "firebase/performance";
10
10
  import { getRemoteConfig as yp, fetchAndActivate as _p } from "firebase/remote-config";
11
- const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
11
+ const vp = "0.5.90", wp = (t) => !!t.auth, ct = (t, e) => {
12
12
  if (e?.operations)
13
13
  return e.operations.includes(t);
14
- }, Nn = (t, e) => e ? e.Role ? t.access?.includes(e.Role) : !1 : !0, bp = (t, e) => e ? !e.Role || t.restrictCreate === !0 ? !1 : typeof t.restrictCreate == "object" ? t.restrictCreate?.includes(e.Role) : !0 : !0, Op = (t, e) => e ? !e.Role || t.restrictUpdate === !0 ? !1 : typeof t.restrictUpdate == "object" ? t.restrictUpdate?.includes(e.Role) : !0 : !0, te = (t, e) => t.filter((r) => r.name === e)[0], we = (t) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(t.type), xd = (t, e) => {
14
+ }, Nn = (t, e) => e ? e.Role ? t.access?.includes(e.Role) : !1 : !0, bp = (t, e) => e ? !e.Role || t.restrictCreate === !0 ? !1 : typeof t.restrictCreate == "object" ? t.restrictCreate?.includes(e.Role) : !0 : !0, Op = (t, e) => e ? !e.Role || t.restrictUpdate === !0 ? !1 : typeof t.restrictUpdate == "object" ? t.restrictUpdate?.includes(e.Role) : !0 : !0, te = (t, e) => t.filter((r) => r.name === e)[0], we = (t) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(t.type), xf = (t, e) => {
15
15
  const r = {
16
16
  Record_Owner: "recordOwner",
17
17
  Record_User: "recordUser",
@@ -30,7 +30,7 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
30
30
  c.role === e.Role && (!i.assignable?.includes(e.Role) || a?.restrictEntities) && r.push(o);
31
31
  });
32
32
  }), r;
33
- }, Nd = (t, e, r) => {
33
+ }, Nf = (t, e, r) => {
34
34
  const n = [], { access: s } = t, { entityRestrictions: i } = s;
35
35
  return i?.parentFilters?.forEach((a) => {
36
36
  if (!a.roles.some((h) => h.role === r.Role))
@@ -38,14 +38,14 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
38
38
  const o = a.collectionField, c = te(t.fields, o);
39
39
  if (!we(c))
40
40
  throw new Error("PERMISSION_DENIED");
41
- const l = r.collections?.[c.collection], f = e.collections[c.collection].access.entityRestrictions;
42
- if (!f)
43
- throw new Error("PERMISSION_DENIED");
44
- const d = f.restrictions?.find((h) => h.type === a.type && h.roles.some((p) => p.role === r.Role));
41
+ const l = r.collections?.[c.collection], d = e.collections[c.collection].access.entityRestrictions;
45
42
  if (!d)
46
43
  throw new Error("PERMISSION_DENIED");
47
- d.roles.forEach((h) => {
48
- h.role === r.Role && (!f.assignable?.includes(r.Role) || l?.restrictEntities) && n.push({ parentFilter: a, parentRestriction: d });
44
+ const f = d.restrictions?.find((h) => h.type === a.type && h.roles.some((p) => p.role === r.Role));
45
+ if (!f)
46
+ throw new Error("PERMISSION_DENIED");
47
+ f.roles.forEach((h) => {
48
+ h.role === r.Role && (!d.assignable?.includes(r.Role) || l?.restrictEntities) && n.push({ parentFilter: a, parentRestriction: f });
49
49
  });
50
50
  }), n;
51
51
  }, Fn = (t, e, r) => {
@@ -55,7 +55,7 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
55
55
  for (const c of o)
56
56
  if (!(c.access && !Nn(c, r)) && r.Role && we(c) && c.collection === s.collection && c.dependencyFields)
57
57
  for (const l of c.dependencyFields)
58
- !i.find((f) => f.field === l.field) && l.roles.includes(r.Role) && i.push(l);
58
+ !i.find((d) => d.field === l.field) && l.roles.includes(r.Role) && i.push(l);
59
59
  }
60
60
  return i;
61
61
  }, Ep = (t, e, r, n, s, i, a) => {
@@ -65,7 +65,7 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
65
65
  l = !1;
66
66
  return;
67
67
  }
68
- const u = xd(e, s), f = Do(e, s), d = Nd(e, r, s);
68
+ const u = xf(e, s), d = Do(e, s), f = Nf(e, r, s);
69
69
  u?.filter((y) => y.type === "Record_Owner").forEach((y) => {
70
70
  "operations" in y && y.operations && !y.operations.includes(t) || i.Created_By !== n && (l = !1);
71
71
  }), u?.filter((y) => y.type === "Record_User").forEach((y) => {
@@ -80,15 +80,15 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
80
80
  E.type === "Array" ? R.values?.some((_) => i[E.name].includes(_)) || (l = !1) : R.values?.includes(i[E.name]) || (l = !1);
81
81
  });
82
82
  let h = !0, p = !1;
83
- f?.filter((y) => y.type === "Individual").forEach(() => {
83
+ d?.filter((y) => y.type === "Individual").forEach(() => {
84
84
  p = !0, c?.individualEntities?.includes(i.id) || (h = !1);
85
85
  });
86
86
  let b = !0, g = !1;
87
- if (f?.filter((y) => y.type === "Parent").forEach((y) => {
87
+ if (d?.filter((y) => y.type === "Parent").forEach((y) => {
88
88
  g = !0;
89
89
  const E = te(o, y.collectionField);
90
90
  c?.parentEntities?.some((R) => i[`${E.name}_Array`].includes(R)) || (b = !1);
91
- }), f?.filter((y) => y.type === "Parent_Property").forEach((y) => {
91
+ }), d?.filter((y) => y.type === "Parent_Property").forEach((y) => {
92
92
  g = !0;
93
93
  const E = te(o, y.collectionField), R = te(o, y.propertyField);
94
94
  Object.entries(c?.parentPropertyEntities || {}).some((_) => {
@@ -105,7 +105,7 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
105
105
  return;
106
106
  }
107
107
  let O = !0, S = !1;
108
- d?.filter((y) => y.parentFilter.type === "Individual").forEach((y) => {
108
+ f?.filter((y) => y.parentFilter.type === "Individual").forEach((y) => {
109
109
  S = !0;
110
110
  const { parentFilter: E } = y, R = te(o, E.collectionField), _ = s.collections?.[R.collection];
111
111
  if (!_) {
@@ -115,7 +115,7 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
115
115
  _.individualEntities?.some((N) => i[`${R.name}_Array`].includes(N)) || (O = !1);
116
116
  });
117
117
  let C = !0, x = !1;
118
- if (d?.filter((y) => y.parentFilter.type === "Parent").forEach((y) => {
118
+ if (f?.filter((y) => y.parentFilter.type === "Parent").forEach((y) => {
119
119
  x = !0;
120
120
  const { parentFilter: E } = y, R = te(o, E.collectionField), _ = te(o, E.parentCollectionField), N = s.collections?.[R.collection];
121
121
  if (!N) {
@@ -123,7 +123,7 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
123
123
  return;
124
124
  }
125
125
  N.parentEntities?.some((v) => i[`${_.name}_Array`].includes(v)) || (C = !1);
126
- }), d?.filter((y) => y.parentFilter.type === "Parent_Property").forEach((y) => {
126
+ }), f?.filter((y) => y.parentFilter.type === "Parent_Property").forEach((y) => {
127
127
  x = !0;
128
128
  const { parentFilter: E } = y, R = te(o, E.collectionField), _ = te(o, E.parentPropertyField), N = te(o, E.parentCollectionField), v = s.collections?.[R.collection];
129
129
  if (!v) {
@@ -150,7 +150,7 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
150
150
  if (!o || !s.Role)
151
151
  return c = !1, c;
152
152
  ct(t, o) || (c = !1);
153
- const u = Do(e, s)?.filter((f) => f.type === "Individual").length > 0;
153
+ const u = Do(e, s)?.filter((d) => d.type === "Individual").length > 0;
154
154
  return t === "Create" && u && (c = !1), Ep(t, e, r, n, s, i) || (c = !1), c;
155
155
  }, $t = (t, e, r) => {
156
156
  const n = [];
@@ -164,7 +164,7 @@ const vp = "0.5.89", wp = (t) => !!t.auth, ct = (t, e) => {
164
164
  (!r || ct("Read", a) || Fn(t, e, r)) && n.push(s.collection);
165
165
  }
166
166
  return Array.from(new Set(n));
167
- }, Fd = (t, e, r) => {
167
+ }, Ff = (t, e, r) => {
168
168
  const { labels: n } = t, s = [];
169
169
  for (const i of Object.values(e.collections)) {
170
170
  const a = r?.collections?.[i.labels.collection];
@@ -306,25 +306,25 @@ function Np() {
306
306
  return ls = t, ls;
307
307
  }
308
308
  var us, Gc;
309
- function Dd() {
309
+ function Df() {
310
310
  if (Gc) return us;
311
311
  Gc = 1;
312
312
  var t = typeof nn == "object" && nn && nn.Object === Object && nn;
313
313
  return us = t, us;
314
314
  }
315
- var fs, Hc;
315
+ var ds, Hc;
316
316
  function ut() {
317
- if (Hc) return fs;
317
+ if (Hc) return ds;
318
318
  Hc = 1;
319
- var t = Dd(), e = typeof self == "object" && self && self.Object === Object && self, r = t || e || Function("return this")();
320
- return fs = r, fs;
319
+ var t = Df(), e = typeof self == "object" && self && self.Object === Object && self, r = t || e || Function("return this")();
320
+ return ds = r, ds;
321
321
  }
322
- var ds, Kc;
322
+ var fs, Kc;
323
323
  function Br() {
324
- if (Kc) return ds;
324
+ if (Kc) return fs;
325
325
  Kc = 1;
326
326
  var t = ut(), e = t.Symbol;
327
- return ds = e, ds;
327
+ return fs = e, fs;
328
328
  }
329
329
  var hs, Yc;
330
330
  function Fp() {
@@ -407,7 +407,7 @@ function Mp() {
407
407
  return vs = r, vs;
408
408
  }
409
409
  var ws, nl;
410
- function Pd() {
410
+ function Pf() {
411
411
  if (nl) return ws;
412
412
  nl = 1;
413
413
  var t = Function.prototype, e = t.toString;
@@ -430,16 +430,16 @@ var bs, sl;
430
430
  function qp() {
431
431
  if (sl) return bs;
432
432
  sl = 1;
433
- var t = Po(), e = Mp(), r = vt(), n = Pd(), s = /[\\^$.*+?()[\]{}|]/g, i = /^\[object .+?Constructor\]$/, a = Function.prototype, o = Object.prototype, c = a.toString, l = o.hasOwnProperty, u = RegExp(
433
+ var t = Po(), e = Mp(), r = vt(), n = Pf(), 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
- function f(d) {
437
- if (!r(d) || e(d))
436
+ function d(f) {
437
+ if (!r(f) || e(f))
438
438
  return !1;
439
- var h = t(d) ? u : i;
440
- return h.test(n(d));
439
+ var h = t(f) ? u : i;
440
+ return h.test(n(f));
441
441
  }
442
- return bs = f, bs;
442
+ return bs = d, bs;
443
443
  }
444
444
  var Os, il;
445
445
  function Lp() {
@@ -495,10 +495,10 @@ function jp() {
495
495
  }
496
496
  return Cs = t, Cs;
497
497
  }
498
- var As, fl;
498
+ var As, dl;
499
499
  function Vp() {
500
- if (fl) return As;
501
- fl = 1;
500
+ if (dl) return As;
501
+ dl = 1;
502
502
  var t = qn(), e = "__lodash_hash_undefined__", r = Object.prototype, n = r.hasOwnProperty;
503
503
  function s(i) {
504
504
  var a = this.__data__;
@@ -510,10 +510,10 @@ function Vp() {
510
510
  }
511
511
  return As = s, As;
512
512
  }
513
- var ks, dl;
513
+ var ks, fl;
514
514
  function Up() {
515
- if (dl) return ks;
516
- dl = 1;
515
+ if (fl) return ks;
516
+ fl = 1;
517
517
  var t = qn(), e = Object.prototype, r = e.hasOwnProperty;
518
518
  function n(s) {
519
519
  var i = this.__data__;
@@ -718,22 +718,22 @@ function rg() {
718
718
  return Zs = t, Zs;
719
719
  }
720
720
  var Gs, Il;
721
- function Md() {
721
+ function Mf() {
722
722
  if (Il) return Gs;
723
723
  Il = 1;
724
724
  var t = eg(), e = tg(), r = rg(), n = 1, s = 2;
725
- function i(a, o, c, l, u, f) {
726
- var d = c & n, h = a.length, p = o.length;
727
- if (h != p && !(d && p > h))
725
+ function i(a, o, c, l, u, d) {
726
+ var f = c & n, h = a.length, p = o.length;
727
+ if (h != p && !(f && p > h))
728
728
  return !1;
729
- var b = f.get(a), g = f.get(o);
729
+ var b = d.get(a), g = d.get(o);
730
730
  if (b && g)
731
731
  return b == o && g == a;
732
732
  var O = -1, S = !0, C = c & s ? new t() : void 0;
733
- for (f.set(a, o), f.set(o, a); ++O < h; ) {
733
+ for (d.set(a, o), d.set(o, a); ++O < h; ) {
734
734
  var x = a[O], y = o[O];
735
735
  if (l)
736
- var E = d ? l(y, x, O, o, a, f) : l(x, y, O, a, o, f);
736
+ var E = f ? l(y, x, O, o, a, d) : l(x, y, O, a, o, d);
737
737
  if (E !== void 0) {
738
738
  if (E)
739
739
  continue;
@@ -742,23 +742,23 @@ function Md() {
742
742
  }
743
743
  if (C) {
744
744
  if (!e(o, function(R, _) {
745
- if (!r(C, _) && (x === R || u(x, R, c, l, f)))
745
+ if (!r(C, _) && (x === R || u(x, R, c, l, d)))
746
746
  return C.push(_);
747
747
  })) {
748
748
  S = !1;
749
749
  break;
750
750
  }
751
- } else if (!(x === y || u(x, y, c, l, f))) {
751
+ } else if (!(x === y || u(x, y, c, l, d))) {
752
752
  S = !1;
753
753
  break;
754
754
  }
755
755
  }
756
- return f.delete(a), f.delete(o), S;
756
+ return d.delete(a), d.delete(o), S;
757
757
  }
758
758
  return Gs = i, Gs;
759
759
  }
760
760
  var Hs, xl;
761
- function qd() {
761
+ function qf() {
762
762
  if (xl) return Hs;
763
763
  xl = 1;
764
764
  var t = ut(), e = t.Uint8Array;
@@ -792,7 +792,7 @@ var Js, Dl;
792
792
  function ig() {
793
793
  if (Dl) return Js;
794
794
  Dl = 1;
795
- var t = Br(), e = qd(), r = zr(), n = Md(), s = ng(), i = sg(), 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]", b = "[object String]", g = "[object Symbol]", O = "[object ArrayBuffer]", S = "[object DataView]", C = t ? t.prototype : void 0, x = C ? C.valueOf : void 0;
795
+ var t = Br(), e = qf(), r = zr(), n = Mf(), s = ng(), i = sg(), a = 1, o = 2, c = "[object Boolean]", l = "[object Date]", u = "[object Error]", d = "[object Map]", f = "[object Number]", h = "[object RegExp]", p = "[object Set]", b = "[object String]", g = "[object Symbol]", O = "[object ArrayBuffer]", S = "[object DataView]", C = t ? t.prototype : void 0, x = C ? C.valueOf : void 0;
796
796
  function y(E, R, _, N, v, w, I) {
797
797
  switch (_) {
798
798
  case S:
@@ -803,14 +803,14 @@ function ig() {
803
803
  return !(E.byteLength != R.byteLength || !w(new e(E), new e(R)));
804
804
  case c:
805
805
  case l:
806
- case d:
806
+ case f:
807
807
  return r(+E, +R);
808
808
  case u:
809
809
  return E.name == R.name && E.message == R.message;
810
810
  case h:
811
811
  case b:
812
812
  return E == R + "";
813
- case f:
813
+ case d:
814
814
  var m = s;
815
815
  case p:
816
816
  var T = N & a;
@@ -831,7 +831,7 @@ function ig() {
831
831
  return Js = y, Js;
832
832
  }
833
833
  var Qs, Pl;
834
- function Ld() {
834
+ function Lf() {
835
835
  if (Pl) return Qs;
836
836
  Pl = 1;
837
837
  function t(e, r) {
@@ -849,10 +849,10 @@ function Ft() {
849
849
  return Xs = t, Xs;
850
850
  }
851
851
  var ei, ql;
852
- function $d() {
852
+ function $f() {
853
853
  if (ql) return ei;
854
854
  ql = 1;
855
- var t = Ld(), e = Ft();
855
+ var t = Lf(), e = Ft();
856
856
  function r(n, s, i) {
857
857
  var a = s(n);
858
858
  return e(n) ? a : t(a, i(n));
@@ -873,7 +873,7 @@ function ag() {
873
873
  return ti = t, ti;
874
874
  }
875
875
  var ri, $l;
876
- function jd() {
876
+ function jf() {
877
877
  if ($l) return ri;
878
878
  $l = 1;
879
879
  function t() {
@@ -885,7 +885,7 @@ var ni, jl;
885
885
  function $o() {
886
886
  if (jl) return ni;
887
887
  jl = 1;
888
- var t = ag(), e = jd(), r = Object.prototype, n = r.propertyIsEnumerable, s = Object.getOwnPropertySymbols, i = s ? function(a) {
888
+ var t = ag(), e = jf(), r = Object.prototype, n = r.propertyIsEnumerable, s = Object.getOwnPropertySymbols, i = s ? function(a) {
889
889
  return a == null ? [] : (a = Object(a), t(s(a), function(o) {
890
890
  return n.call(a, o);
891
891
  }));
@@ -923,7 +923,7 @@ function cg() {
923
923
  return ai = n, ai;
924
924
  }
925
925
  var oi, zl;
926
- function Vd() {
926
+ function Vf() {
927
927
  if (zl) return oi;
928
928
  zl = 1;
929
929
  var t = cg(), e = wt(), r = Object.prototype, n = r.hasOwnProperty, s = r.propertyIsEnumerable, i = t(/* @__PURE__ */ (function() {
@@ -962,7 +962,7 @@ function jo() {
962
962
  return li = r, li;
963
963
  }
964
964
  var ui, Hl;
965
- function Ud() {
965
+ function Uf() {
966
966
  if (Hl) return ui;
967
967
  Hl = 1;
968
968
  var t = 9007199254740991;
@@ -971,34 +971,34 @@ function Ud() {
971
971
  }
972
972
  return ui = e, ui;
973
973
  }
974
- var fi, Kl;
974
+ var di, Kl;
975
975
  function ug() {
976
- if (Kl) return fi;
976
+ if (Kl) return di;
977
977
  Kl = 1;
978
- var t = pr(), e = Ud(), r = 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]", b = "[object WeakMap]", g = "[object ArrayBuffer]", O = "[object DataView]", S = "[object Float32Array]", C = "[object Float64Array]", x = "[object Int8Array]", y = "[object Int16Array]", E = "[object Int32Array]", R = "[object Uint8Array]", _ = "[object Uint8ClampedArray]", N = "[object Uint16Array]", v = "[object Uint32Array]", w = {};
979
- w[S] = w[C] = w[x] = w[y] = w[E] = w[R] = w[_] = w[N] = w[v] = !0, w[n] = w[s] = w[g] = w[i] = w[O] = w[a] = w[o] = w[c] = w[l] = w[u] = w[f] = w[d] = w[h] = w[p] = w[b] = !1;
978
+ var t = pr(), e = Uf(), r = 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]", d = "[object Object]", f = "[object RegExp]", h = "[object Set]", p = "[object String]", b = "[object WeakMap]", g = "[object ArrayBuffer]", O = "[object DataView]", S = "[object Float32Array]", C = "[object Float64Array]", x = "[object Int8Array]", y = "[object Int16Array]", E = "[object Int32Array]", R = "[object Uint8Array]", _ = "[object Uint8ClampedArray]", N = "[object Uint16Array]", v = "[object Uint32Array]", w = {};
979
+ w[S] = w[C] = w[x] = w[y] = w[E] = w[R] = w[_] = w[N] = w[v] = !0, w[n] = w[s] = w[g] = w[i] = w[O] = w[a] = w[o] = w[c] = w[l] = w[u] = w[d] = w[f] = w[h] = w[p] = w[b] = !1;
980
980
  function I(m) {
981
981
  return r(m) && e(m.length) && !!w[t(m)];
982
982
  }
983
- return fi = I, fi;
983
+ return di = I, di;
984
984
  }
985
- var di, Yl;
985
+ var fi, Yl;
986
986
  function Vo() {
987
- if (Yl) return di;
987
+ if (Yl) return fi;
988
988
  Yl = 1;
989
989
  function t(e) {
990
990
  return function(r) {
991
991
  return e(r);
992
992
  };
993
993
  }
994
- return di = t, di;
994
+ return fi = t, fi;
995
995
  }
996
996
  var Rr = { exports: {} };
997
997
  Rr.exports;
998
998
  var Jl;
999
999
  function Uo() {
1000
1000
  return Jl || (Jl = 1, (function(t, e) {
1001
- var r = Dd(), n = e && !e.nodeType && e, s = n && !0 && t && !t.nodeType && t, i = s && s.exports === n, a = i && r.process, o = (function() {
1001
+ var r = Df(), n = e && !e.nodeType && e, s = n && !0 && t && !t.nodeType && t, i = s && s.exports === n, a = i && r.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");
@@ -1016,12 +1016,12 @@ function Wo() {
1016
1016
  return hi = s, hi;
1017
1017
  }
1018
1018
  var mi, Xl;
1019
- function Wd() {
1019
+ function Wf() {
1020
1020
  if (Xl) return mi;
1021
1021
  Xl = 1;
1022
- var t = og(), e = Vd(), r = Ft(), n = $n(), s = jo(), i = Wo(), a = Object.prototype, o = a.hasOwnProperty;
1022
+ var t = og(), e = Vf(), r = Ft(), n = $n(), s = jo(), i = Wo(), a = Object.prototype, o = a.hasOwnProperty;
1023
1023
  function c(l, u) {
1024
- var f = r(l), d = !f && e(l), h = !f && !d && n(l), p = !f && !d && !h && i(l), b = f || d || h || p, g = b ? t(l.length, String) : [], O = g.length;
1024
+ var d = r(l), f = !d && e(l), h = !d && !f && n(l), p = !d && !f && !h && i(l), b = d || f || h || p, g = b ? t(l.length, String) : [], O = g.length;
1025
1025
  for (var S in l)
1026
1026
  (u || o.call(l, S)) && !(b && // Safari 9 has enumerable `arguments.length` in strict mode.
1027
1027
  (S == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
@@ -1044,7 +1044,7 @@ function zo() {
1044
1044
  return pi = e, pi;
1045
1045
  }
1046
1046
  var gi, tu;
1047
- function zd() {
1047
+ function zf() {
1048
1048
  if (tu) return gi;
1049
1049
  tu = 1;
1050
1050
  function t(e, r) {
@@ -1055,17 +1055,17 @@ function zd() {
1055
1055
  return gi = t, gi;
1056
1056
  }
1057
1057
  var yi, ru;
1058
- function fg() {
1058
+ function dg() {
1059
1059
  if (ru) return yi;
1060
1060
  ru = 1;
1061
- var t = zd(), e = t(Object.keys, Object);
1061
+ var t = zf(), e = t(Object.keys, Object);
1062
1062
  return yi = e, yi;
1063
1063
  }
1064
1064
  var _i, nu;
1065
- function dg() {
1065
+ function fg() {
1066
1066
  if (nu) return _i;
1067
1067
  nu = 1;
1068
- var t = zo(), e = fg(), r = Object.prototype, n = r.hasOwnProperty;
1068
+ var t = zo(), e = dg(), r = Object.prototype, n = r.hasOwnProperty;
1069
1069
  function s(i) {
1070
1070
  if (!t(i))
1071
1071
  return e(i);
@@ -1080,7 +1080,7 @@ var vi, su;
1080
1080
  function jn() {
1081
1081
  if (su) return vi;
1082
1082
  su = 1;
1083
- var t = Po(), e = Ud();
1083
+ var t = Po(), e = Uf();
1084
1084
  function r(n) {
1085
1085
  return n != null && e(n.length) && !t(n);
1086
1086
  }
@@ -1090,17 +1090,17 @@ var wi, iu;
1090
1090
  function Bo() {
1091
1091
  if (iu) return wi;
1092
1092
  iu = 1;
1093
- var t = Wd(), e = dg(), r = jn();
1093
+ var t = Wf(), e = fg(), r = jn();
1094
1094
  function n(s) {
1095
1095
  return r(s) ? t(s) : e(s);
1096
1096
  }
1097
1097
  return wi = n, wi;
1098
1098
  }
1099
1099
  var bi, au;
1100
- function Bd() {
1100
+ function Bf() {
1101
1101
  if (au) return bi;
1102
1102
  au = 1;
1103
- var t = $d(), e = $o(), r = Bo();
1103
+ var t = $f(), e = $o(), r = Bo();
1104
1104
  function n(s) {
1105
1105
  return t(s, r, e);
1106
1106
  }
@@ -1110,14 +1110,14 @@ var Oi, ou;
1110
1110
  function hg() {
1111
1111
  if (ou) return Oi;
1112
1112
  ou = 1;
1113
- var t = Bd(), e = 1, r = Object.prototype, n = r.hasOwnProperty;
1113
+ var t = Bf(), e = 1, r = Object.prototype, n = r.hasOwnProperty;
1114
1114
  function s(i, a, o, c, l, u) {
1115
- var f = o & e, d = t(i), h = d.length, p = t(a), b = p.length;
1116
- if (h != b && !f)
1115
+ var d = o & e, f = t(i), h = f.length, p = t(a), b = p.length;
1116
+ if (h != b && !d)
1117
1117
  return !1;
1118
1118
  for (var g = h; g--; ) {
1119
- var O = d[g];
1120
- if (!(f ? O in a : n.call(a, O)))
1119
+ var O = f[g];
1120
+ if (!(d ? O in a : n.call(a, O)))
1121
1121
  return !1;
1122
1122
  }
1123
1123
  var S = u.get(i), C = u.get(a);
@@ -1125,11 +1125,11 @@ function hg() {
1125
1125
  return S == a && C == i;
1126
1126
  var x = !0;
1127
1127
  u.set(i, a), u.set(a, i);
1128
- for (var y = f; ++g < h; ) {
1129
- O = d[g];
1128
+ for (var y = d; ++g < h; ) {
1129
+ O = f[g];
1130
1130
  var E = i[O], R = a[O];
1131
1131
  if (c)
1132
- var _ = f ? c(R, E, O, a, i, u) : c(E, R, O, i, a, u);
1132
+ var _ = d ? c(R, E, O, a, i, u) : c(E, R, O, i, a, u);
1133
1133
  if (!(_ === void 0 ? E === R || l(E, R, o, c, u) : _)) {
1134
1134
  x = !1;
1135
1135
  break;
@@ -1165,24 +1165,24 @@ function gg() {
1165
1165
  var t = Bt(), e = ut(), r = t(e, "Set");
1166
1166
  return Ti = r, Ti;
1167
1167
  }
1168
- var Ri, fu;
1168
+ var Ri, du;
1169
1169
  function yg() {
1170
- if (fu) return Ri;
1171
- fu = 1;
1170
+ if (du) return Ri;
1171
+ du = 1;
1172
1172
  var t = Bt(), e = ut(), r = t(e, "WeakMap");
1173
1173
  return Ri = r, Ri;
1174
1174
  }
1175
- var Ci, du;
1175
+ var Ci, fu;
1176
1176
  function Vn() {
1177
- if (du) return Ci;
1178
- du = 1;
1179
- var t = mg(), e = Mo(), r = pg(), n = gg(), s = yg(), i = pr(), a = Pd(), o = "[object Map]", c = "[object Object]", l = "[object Promise]", u = "[object Set]", f = "[object WeakMap]", d = "[object DataView]", h = a(t), p = a(e), b = a(r), g = a(n), O = a(s), S = i;
1180
- return (t && S(new t(new ArrayBuffer(1))) != d || e && S(new e()) != o || r && S(r.resolve()) != l || n && S(new n()) != u || s && S(new s()) != f) && (S = function(C) {
1177
+ if (fu) return Ci;
1178
+ fu = 1;
1179
+ var t = mg(), e = Mo(), r = pg(), n = gg(), s = yg(), i = pr(), a = Pf(), o = "[object Map]", c = "[object Object]", l = "[object Promise]", u = "[object Set]", d = "[object WeakMap]", f = "[object DataView]", h = a(t), p = a(e), b = a(r), g = a(n), O = a(s), S = i;
1180
+ return (t && S(new t(new ArrayBuffer(1))) != f || e && S(new e()) != o || r && S(r.resolve()) != l || n && S(new n()) != u || s && S(new s()) != d) && (S = function(C) {
1181
1181
  var x = i(C), y = x == c ? C.constructor : void 0, E = y ? a(y) : "";
1182
1182
  if (E)
1183
1183
  switch (E) {
1184
1184
  case h:
1185
- return d;
1185
+ return f;
1186
1186
  case p:
1187
1187
  return o;
1188
1188
  case b:
@@ -1190,7 +1190,7 @@ function Vn() {
1190
1190
  case g:
1191
1191
  return u;
1192
1192
  case O:
1193
- return f;
1193
+ return d;
1194
1194
  }
1195
1195
  return x;
1196
1196
  }), Ci = S, Ci;
@@ -1199,11 +1199,11 @@ var Ai, hu;
1199
1199
  function _g() {
1200
1200
  if (hu) return Ai;
1201
1201
  hu = 1;
1202
- var t = Lo(), e = Md(), r = ig(), n = hg(), s = Vn(), i = Ft(), a = $n(), o = Wo(), c = 1, l = "[object Arguments]", u = "[object Array]", f = "[object Object]", d = Object.prototype, h = d.hasOwnProperty;
1202
+ var t = Lo(), e = Mf(), r = ig(), n = hg(), s = Vn(), i = Ft(), a = $n(), o = Wo(), c = 1, l = "[object Arguments]", u = "[object Array]", d = "[object Object]", f = Object.prototype, h = f.hasOwnProperty;
1203
1203
  function p(b, g, O, S, C, x) {
1204
1204
  var y = i(b), E = i(g), R = y ? u : s(b), _ = E ? u : s(g);
1205
- R = R == l ? f : R, _ = _ == l ? f : _;
1206
- var N = R == f, v = _ == f, w = R == _;
1205
+ R = R == l ? d : R, _ = _ == l ? d : _;
1206
+ var N = R == d, v = _ == d, w = R == _;
1207
1207
  if (w && a(b)) {
1208
1208
  if (!a(g))
1209
1209
  return !1;
@@ -1245,15 +1245,15 @@ function wg() {
1245
1245
  var bg = wg();
1246
1246
  const Og = /* @__PURE__ */ Dn(bg), Eg = (t, e, r, n, s, i, a, o, c) => {
1247
1247
  const { access: l } = e, { permissionWriteRestrictions: u } = l;
1248
- let f = !0, d = "";
1248
+ let d = !0, f = "";
1249
1249
  const h = u?.filter((p) => n === p.userRole);
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) => {
1250
+ return h?.length && !h.some((p) => p.recordRole === s) ? (f = `User ${n} does not have write access to record with role ${s}`, d = !1, d) : (u?.forEach((p) => {
1251
1251
  n === p.userRole && p.recordRole;
1252
- }), d && console.error(`PERMISSION_DENIED: ${d}`), f);
1252
+ }), f && console.error(`PERMISSION_DENIED: ${f}`), d);
1253
1253
  }, Sg = (t, e, r, n, s, i, a, o, c, l, u) => {
1254
- const { labels: f } = n;
1255
- let d = !0;
1256
- return (!e.Role || i && (!a?.Role || !Eg(t, n, s, a.Role, e.Role) || i === e.User_ID)) && (d = !1), d;
1254
+ const { labels: d } = n;
1255
+ let f = !0;
1256
+ return (!e.Role || i && (!a?.Role || !Eg(t, n, s, a.Role, e.Role) || i === e.User_ID)) && (f = !1), f;
1257
1257
  }, Tg = (t, e, r, n, s, i, a) => {
1258
1258
  const { labels: o, fields: c } = r, l = i?.collections?.[o.collection];
1259
1259
  let u = !0;
@@ -1261,9 +1261,9 @@ const Og = /* @__PURE__ */ Dn(bg), Eg = (t, e, r, n, s, i, a, o, c) => {
1261
1261
  throw new Error("PERMISSION_DENIED");
1262
1262
  s && !ct("Create", l) && (u = !1), s && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1263
1263
  !pn("Create", r, n, s, i, t) && (u = !1), r.auth;
1264
- for (const f of c) {
1265
- const d = t[f.name];
1266
- f.access && !Nn(f, i) && d !== void 0 && (u = !1), d !== void 0 && !bp(f, i) && (u = !1);
1264
+ for (const d of c) {
1265
+ const f = t[d.name];
1266
+ d.access && !Nn(d, i) && f !== void 0 && (u = !1), f !== void 0 && !bp(d, i) && (u = !1);
1267
1267
  }
1268
1268
  if (!u)
1269
1269
  throw new Error("PERMISSION_DENIED");
@@ -1271,16 +1271,16 @@ const Og = /* @__PURE__ */ Dn(bg), Eg = (t, e, r, n, s, i, a, o, c) => {
1271
1271
  for (const e in t)
1272
1272
  Object.prototype.hasOwnProperty.call(t, e) && (ar(t[e]) ? delete t[e] : typeof t[e] == "object" && t[e] !== null && rr(t[e]));
1273
1273
  }, Rg = (t, e, r, n, s, i, a, o, c, l) => {
1274
- const { labels: u, fields: f } = n, d = a?.collections?.[u.collection], h = { ...e, ...t };
1274
+ const { labels: u, fields: d } = n, f = a?.collections?.[u.collection], h = { ...e, ...t };
1275
1275
  rr(h);
1276
1276
  let p = !0, b = "";
1277
- if (i && !d)
1277
+ if (i && !f)
1278
1278
  throw new Error("PERMISSION_DENIED");
1279
- i && !ct("Update", d) && (p = !1, b = "Authenticated user does not have Update access to this collection"), i && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1279
+ i && !ct("Update", f) && (p = !1, b = "Authenticated user does not have Update access to this collection"), i && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1280
1280
  (!pn("Update", n, s, i, a, e) || // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1281
1281
  !pn("Update", n, s, i, a, h)) && (p = !1, b = "Authenticated user does not have Update access to this document"), i && n.softDelete && h[n.softDelete.archivedField] !== e[n.softDelete.archivedField] && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1282
- !ct("Delete", d) && (p = !1, b = "Authenticated user does not have Delete or Restore access to this document");
1283
- for (const g of f) {
1282
+ !ct("Delete", f) && (p = !1, b = "Authenticated user does not have Delete or Restore access to this document");
1283
+ for (const g of d) {
1284
1284
  const O = t[g.name];
1285
1285
  g.access && !Nn(g, a) && O !== void 0 && (b = `Authenticated user does not have access to field ${g.name}`, p = !1), O !== void 0 && !Op(g, a) && (b = `Authenticated user does not have Update access to field ${g.name}`, p = !1);
1286
1286
  }
@@ -1293,7 +1293,7 @@ const Og = /* @__PURE__ */ Dn(bg), Eg = (t, e, r, n, s, i, a, o, c) => {
1293
1293
  throw new Error("PERMISSION_DENIED");
1294
1294
  if (ct("Delete", o) || (c = !1), pn("Delete", r, n, s, i, t) || (c = !1), r.auth && t.User_ID && (wp(o) || (c = !1), Sg("delete", t, e, r, n, s, i) || (c = !1)), !c)
1295
1295
  throw new Error("PERMISSION_DENIED");
1296
- }, Zd = (t, e, r) => {
1296
+ }, Zf = (t, e, r) => {
1297
1297
  const { access: n } = e, { entityRestrictions: s } = n;
1298
1298
  if (s?.restrictions) {
1299
1299
  for (const i of s.restrictions)
@@ -1330,7 +1330,7 @@ const Og = /* @__PURE__ */ Dn(bg), Eg = (t, e, r, n, s, i, a, o, c) => {
1330
1330
  return i;
1331
1331
  }, kg = (t, e) => e.fields.filter((r) => r.name === t.name)[0];
1332
1332
  var xi, gu;
1333
- function Gd() {
1333
+ function Gf() {
1334
1334
  if (gu) return xi;
1335
1335
  gu = 1;
1336
1336
  var t = Bt(), e = (function() {
@@ -1346,7 +1346,7 @@ var Ni, yu;
1346
1346
  function Zo() {
1347
1347
  if (yu) return Ni;
1348
1348
  yu = 1;
1349
- var t = Gd();
1349
+ var t = Gf();
1350
1350
  function e(r, n, s) {
1351
1351
  n == "__proto__" && t ? t(r, n, {
1352
1352
  configurable: !0,
@@ -1358,7 +1358,7 @@ function Zo() {
1358
1358
  return Ni = e, Ni;
1359
1359
  }
1360
1360
  var Fi, _u;
1361
- function Hd() {
1361
+ function Hf() {
1362
1362
  if (_u) return Fi;
1363
1363
  _u = 1;
1364
1364
  var t = Zo(), e = zr();
@@ -1393,14 +1393,14 @@ function xg() {
1393
1393
  var Cr = { exports: {} };
1394
1394
  Cr.exports;
1395
1395
  var bu;
1396
- function Kd() {
1396
+ function Kf() {
1397
1397
  return bu || (bu = 1, (function(t, e) {
1398
1398
  var r = ut(), n = e && !e.nodeType && e, s = n && !0 && t && !t.nodeType && t, i = s && s.exports === n, a = i ? r.Buffer : void 0, o = a ? a.allocUnsafe : void 0;
1399
1399
  function c(l, u) {
1400
1400
  if (u)
1401
1401
  return l.slice();
1402
- var f = l.length, d = o ? o(f) : new l.constructor(f);
1403
- return l.copy(d), d;
1402
+ var d = l.length, f = o ? o(d) : new l.constructor(d);
1403
+ return l.copy(f), f;
1404
1404
  }
1405
1405
  t.exports = c;
1406
1406
  })(Cr, Cr.exports)), Cr.exports;
@@ -1409,7 +1409,7 @@ var Mi, Ou;
1409
1409
  function Go() {
1410
1410
  if (Ou) return Mi;
1411
1411
  Ou = 1;
1412
- var t = qd();
1412
+ var t = qf();
1413
1413
  function e(r) {
1414
1414
  var n = new r.constructor(r.byteLength);
1415
1415
  return new t(n).set(new t(r)), n;
@@ -1417,7 +1417,7 @@ function Go() {
1417
1417
  return Mi = e, Mi;
1418
1418
  }
1419
1419
  var qi, Eu;
1420
- function Yd() {
1420
+ function Yf() {
1421
1421
  if (Eu) return qi;
1422
1422
  Eu = 1;
1423
1423
  var t = Go();
@@ -1428,7 +1428,7 @@ function Yd() {
1428
1428
  return qi = e, qi;
1429
1429
  }
1430
1430
  var Li, Su;
1431
- function Jd() {
1431
+ function Jf() {
1432
1432
  if (Su) return Li;
1433
1433
  Su = 1;
1434
1434
  function t(e, r) {
@@ -1462,11 +1462,11 @@ var ji, Ru;
1462
1462
  function Ho() {
1463
1463
  if (Ru) return ji;
1464
1464
  Ru = 1;
1465
- var t = zd(), e = t(Object.getPrototypeOf, Object);
1465
+ var t = zf(), e = t(Object.getPrototypeOf, Object);
1466
1466
  return ji = e, ji;
1467
1467
  }
1468
1468
  var Vi, Cu;
1469
- function Qd() {
1469
+ function Qf() {
1470
1470
  if (Cu) return Vi;
1471
1471
  Cu = 1;
1472
1472
  var t = Ng(), e = Ho(), r = zo();
@@ -1493,16 +1493,16 @@ function Dg() {
1493
1493
  function l(u) {
1494
1494
  if (!r(u) || t(u) != n)
1495
1495
  return !1;
1496
- var f = e(u);
1497
- if (f === null)
1496
+ var d = e(u);
1497
+ if (d === null)
1498
1498
  return !0;
1499
- var d = o.call(f, "constructor") && f.constructor;
1500
- return typeof d == "function" && d instanceof d && a.call(d) == c;
1499
+ var f = o.call(d, "constructor") && d.constructor;
1500
+ return typeof f == "function" && f instanceof f && a.call(f) == c;
1501
1501
  }
1502
1502
  return Wi = l, Wi;
1503
1503
  }
1504
1504
  var zi, Iu;
1505
- function Xd() {
1505
+ function Xf() {
1506
1506
  if (Iu) return zi;
1507
1507
  Iu = 1;
1508
1508
  function t(e, r) {
@@ -1531,8 +1531,8 @@ function Zr() {
1531
1531
  var o = !i;
1532
1532
  i || (i = {});
1533
1533
  for (var c = -1, l = s.length; ++c < l; ) {
1534
- var u = s[c], f = a ? a(i[u], n[u], u, i, n) : void 0;
1535
- f === void 0 && (f = n[u]), o ? e(i, u, f) : t(i, u, f);
1534
+ var u = s[c], d = a ? a(i[u], n[u], u, i, n) : void 0;
1535
+ d === void 0 && (d = n[u]), o ? e(i, u, d) : t(i, u, d);
1536
1536
  }
1537
1537
  return i;
1538
1538
  }
@@ -1570,7 +1570,7 @@ var Ki, Pu;
1570
1570
  function Gr() {
1571
1571
  if (Pu) return Ki;
1572
1572
  Pu = 1;
1573
- var t = Wd(), e = Mg(), r = jn();
1573
+ var t = Wf(), e = Mg(), r = jn();
1574
1574
  function n(s) {
1575
1575
  return r(s) ? t(s, !0) : e(s);
1576
1576
  }
@@ -1590,7 +1590,7 @@ var Ji, qu;
1590
1590
  function Lg() {
1591
1591
  if (qu) return Ji;
1592
1592
  qu = 1;
1593
- var t = Hd(), e = Kd(), r = Yd(), n = Jd(), s = Qd(), i = Vd(), a = Ft(), o = Fg(), c = $n(), l = Po(), u = vt(), f = Dg(), d = Wo(), h = Xd(), p = qg();
1593
+ var t = Hf(), e = Kf(), r = Yf(), n = Jf(), s = Qf(), i = Vf(), a = Ft(), o = Fg(), c = $n(), l = Po(), u = vt(), d = Dg(), f = Wo(), h = Xf(), p = qg();
1594
1594
  function b(g, O, S, C, x, y, E) {
1595
1595
  var R = h(g, S), _ = h(O, S), N = E.get(_);
1596
1596
  if (N) {
@@ -1599,8 +1599,8 @@ function Lg() {
1599
1599
  }
1600
1600
  var v = y ? y(R, _, S + "", g, O, E) : void 0, w = v === void 0;
1601
1601
  if (w) {
1602
- var I = a(_), m = !I && c(_), T = !I && !m && d(_);
1603
- v = _, I || m || T ? a(R) ? v = R : o(R) ? v = n(R) : m ? (w = !1, v = e(_, !0)) : T ? (w = !1, v = r(_, !0)) : v = [] : f(_) || i(_) ? (v = R, i(R) ? v = p(R) : (!u(R) || l(R)) && (v = s(_))) : w = !1;
1602
+ var I = a(_), m = !I && c(_), T = !I && !m && f(_);
1603
+ v = _, I || m || T ? a(R) ? v = R : o(R) ? v = n(R) : m ? (w = !1, v = e(_, !0)) : T ? (w = !1, v = r(_, !0)) : v = [] : d(_) || i(_) ? (v = R, i(R) ? v = p(R) : (!u(R) || l(R)) && (v = s(_))) : w = !1;
1604
1604
  }
1605
1605
  w && (E.set(_, v), x(v, _, C, y, E), E.delete(_)), t(g, S, v);
1606
1606
  }
@@ -1610,13 +1610,13 @@ var Qi, Lu;
1610
1610
  function $g() {
1611
1611
  if (Lu) return Qi;
1612
1612
  Lu = 1;
1613
- var t = Lo(), e = Hd(), r = xg(), n = Lg(), s = vt(), i = Gr(), a = Xd();
1614
- function o(c, l, u, f, d) {
1613
+ var t = Lo(), e = Hf(), r = xg(), n = Lg(), s = vt(), i = Gr(), a = Xf();
1614
+ function o(c, l, u, d, f) {
1615
1615
  c !== l && r(l, function(h, p) {
1616
- if (d || (d = new t()), s(h))
1617
- n(c, l, p, u, o, f, d);
1616
+ if (f || (f = new t()), s(h))
1617
+ n(c, l, p, u, o, d, f);
1618
1618
  else {
1619
- var b = f ? f(a(c, p), h, p + "", c, l, d) : void 0;
1619
+ var b = d ? d(a(c, p), h, p + "", c, l, f) : void 0;
1620
1620
  b === void 0 && (b = h), e(c, p, b);
1621
1621
  }
1622
1622
  }, i);
@@ -1683,7 +1683,7 @@ var na, Wu;
1683
1683
  function Wg() {
1684
1684
  if (Wu) return na;
1685
1685
  Wu = 1;
1686
- var t = Ug(), e = Gd(), r = eh(), n = e ? function(s, i) {
1686
+ var t = Ug(), e = Gf(), r = eh(), n = e ? function(s, i) {
1687
1687
  return e(s, "toString", {
1688
1688
  configurable: !0,
1689
1689
  enumerable: !1,
@@ -1780,9 +1780,9 @@ function Yo() {
1780
1780
  }
1781
1781
  return ua = n, ua;
1782
1782
  }
1783
- var fa, Ju;
1783
+ var da, Ju;
1784
1784
  function Qg() {
1785
- if (Ju) return fa;
1785
+ if (Ju) return da;
1786
1786
  Ju = 1;
1787
1787
  var t = Ft(), e = Yo(), r = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, n = /^\w*$/;
1788
1788
  function s(i, a) {
@@ -1791,11 +1791,11 @@ function Qg() {
1791
1791
  var o = typeof i;
1792
1792
  return o == "number" || o == "symbol" || o == "boolean" || i == null || e(i) ? !0 : n.test(i) || !r.test(i) || a != null && i in Object(a);
1793
1793
  }
1794
- return fa = s, fa;
1794
+ return da = s, da;
1795
1795
  }
1796
- var da, Qu;
1796
+ var fa, Qu;
1797
1797
  function Xg() {
1798
- if (Qu) return da;
1798
+ if (Qu) return fa;
1799
1799
  Qu = 1;
1800
1800
  var t = qo(), e = "Expected a function";
1801
1801
  function r(n, s) {
@@ -1810,7 +1810,7 @@ function Xg() {
1810
1810
  };
1811
1811
  return i.cache = new (r.Cache || t)(), i;
1812
1812
  }
1813
- return r.Cache = t, da = r, da;
1813
+ return r.Cache = t, fa = r, fa;
1814
1814
  }
1815
1815
  var ha, Xu;
1816
1816
  function ey() {
@@ -1825,10 +1825,10 @@ function ey() {
1825
1825
  }
1826
1826
  return ha = r, ha;
1827
1827
  }
1828
- var ma, ef;
1828
+ var ma, ed;
1829
1829
  function ty() {
1830
- if (ef) return ma;
1831
- ef = 1;
1830
+ if (ed) return ma;
1831
+ ed = 1;
1832
1832
  var t = ey(), e = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, r = /\\(\\)?/g, n = t(function(s) {
1833
1833
  var i = [];
1834
1834
  return s.charCodeAt(0) === 46 && i.push(""), s.replace(e, function(a, o, c, l) {
@@ -1837,10 +1837,10 @@ function ty() {
1837
1837
  });
1838
1838
  return ma = n, ma;
1839
1839
  }
1840
- var pa, tf;
1840
+ var pa, td;
1841
1841
  function ry() {
1842
- if (tf) return pa;
1843
- tf = 1;
1842
+ if (td) return pa;
1843
+ td = 1;
1844
1844
  function t(e, r) {
1845
1845
  for (var n = -1, s = e == null ? 0 : e.length, i = Array(s); ++n < s; )
1846
1846
  i[n] = r(e[n], n, e);
@@ -1848,10 +1848,10 @@ function ry() {
1848
1848
  }
1849
1849
  return pa = t, pa;
1850
1850
  }
1851
- var ga, rf;
1851
+ var ga, rd;
1852
1852
  function ny() {
1853
- if (rf) return ga;
1854
- rf = 1;
1853
+ if (rd) return ga;
1854
+ rd = 1;
1855
1855
  var t = Br(), e = ry(), r = Ft(), n = Yo(), s = t ? t.prototype : void 0, i = s ? s.toString : void 0;
1856
1856
  function a(o) {
1857
1857
  if (typeof o == "string")
@@ -1865,30 +1865,30 @@ function ny() {
1865
1865
  }
1866
1866
  return ga = a, ga;
1867
1867
  }
1868
- var ya, nf;
1868
+ var ya, nd;
1869
1869
  function sy() {
1870
- if (nf) return ya;
1871
- nf = 1;
1870
+ if (nd) return ya;
1871
+ nd = 1;
1872
1872
  var t = ny();
1873
1873
  function e(r) {
1874
1874
  return r == null ? "" : t(r);
1875
1875
  }
1876
1876
  return ya = e, ya;
1877
1877
  }
1878
- var _a, sf;
1878
+ var _a, sd;
1879
1879
  function iy() {
1880
- if (sf) return _a;
1881
- sf = 1;
1880
+ if (sd) return _a;
1881
+ sd = 1;
1882
1882
  var t = Ft(), e = Qg(), r = ty(), n = sy();
1883
1883
  function s(i, a) {
1884
1884
  return t(i) ? i : e(i, a) ? [i] : r(n(i));
1885
1885
  }
1886
1886
  return _a = s, _a;
1887
1887
  }
1888
- var va, af;
1888
+ var va, id;
1889
1889
  function ay() {
1890
- if (af) return va;
1891
- af = 1;
1890
+ if (id) return va;
1891
+ id = 1;
1892
1892
  var t = Yo();
1893
1893
  function e(r) {
1894
1894
  if (typeof r == "string" || t(r))
@@ -1898,20 +1898,20 @@ function ay() {
1898
1898
  }
1899
1899
  return va = e, va;
1900
1900
  }
1901
- var wa, of;
1901
+ var wa, ad;
1902
1902
  function oy() {
1903
- if (of) return wa;
1904
- of = 1;
1903
+ if (ad) return wa;
1904
+ ad = 1;
1905
1905
  var t = Ko(), e = iy(), r = jo(), n = vt(), s = ay();
1906
1906
  function i(a, o, c, l) {
1907
1907
  if (!n(a))
1908
1908
  return a;
1909
1909
  o = e(o, a);
1910
- for (var u = -1, f = o.length, d = f - 1, h = a; h != null && ++u < f; ) {
1910
+ for (var u = -1, d = o.length, f = d - 1, h = a; h != null && ++u < d; ) {
1911
1911
  var p = s(o[u]), b = c;
1912
1912
  if (p === "__proto__" || p === "constructor" || p === "prototype")
1913
1913
  return a;
1914
- if (u != d) {
1914
+ if (u != f) {
1915
1915
  var g = h[p];
1916
1916
  b = l ? l(g, p, h) : void 0, b === void 0 && (b = n(g) ? g : r(o[u + 1]) ? [] : {});
1917
1917
  }
@@ -1921,10 +1921,10 @@ function oy() {
1921
1921
  }
1922
1922
  return wa = i, wa;
1923
1923
  }
1924
- var ba, cf;
1924
+ var ba, od;
1925
1925
  function cy() {
1926
- if (cf) return ba;
1927
- cf = 1;
1926
+ if (od) return ba;
1927
+ od = 1;
1928
1928
  var t = oy();
1929
1929
  function e(r, n, s) {
1930
1930
  return r == null ? r : t(r, n, s);
@@ -1935,7 +1935,7 @@ var ly = cy();
1935
1935
  const uy = /* @__PURE__ */ Dn(ly), Pr = {
1936
1936
  global: {},
1937
1937
  collections: {}
1938
- }, fy = () => {
1938
+ }, dy = () => {
1939
1939
  Pr.global = {}, Pr.collections = {};
1940
1940
  }, be = async (t, e) => {
1941
1941
  let r = t;
@@ -1966,19 +1966,19 @@ const uy = /* @__PURE__ */ Dn(ly), Pr = {
1966
1966
  let l;
1967
1967
  if (c && (l = await be(o, r)), l) {
1968
1968
  let u = Pr;
1969
- const f = {};
1970
- for (let d = 0; d < e.length; d++) {
1971
- const h = e[d];
1969
+ const d = {};
1970
+ for (let f = 0; f < e.length; f++) {
1971
+ const h = e[f];
1972
1972
  if (h !== void 0) {
1973
1973
  if (h === "__proto__" || h === "constructor" || h === "prototype")
1974
1974
  throw new Error("Invalid config path: prototype pollution keys are not allowed");
1975
- d === e.length - 1 ? uy(f, e.join("."), l) : (u[h] ||= {}, u = u[h]);
1975
+ f === e.length - 1 ? uy(d, e.join("."), l) : (u[h] ||= {}, u = u[h]);
1976
1976
  }
1977
1977
  }
1978
- Jg(Pr, f);
1978
+ Jg(Pr, d);
1979
1979
  }
1980
1980
  return l;
1981
- }, dy = (t, e, r) => {
1981
+ }, fy = (t, e, r) => {
1982
1982
  const n = Object.values(r.collections), { labels: s } = e;
1983
1983
  let i = !1;
1984
1984
  for (const a of n) {
@@ -2105,9 +2105,9 @@ const uy = /* @__PURE__ */ Dn(ly), Pr = {
2105
2105
  });
2106
2106
  const o = /* @__PURE__ */ new Set(), c = th(e, r);
2107
2107
  return Object.entries(c).map(([l, u]) => {
2108
- t.name === l && Object.values(u).forEach((f) => {
2109
- f.forEach((d) => {
2110
- o.add(d);
2108
+ t.name === l && Object.values(u).forEach((d) => {
2109
+ d.forEach((f) => {
2110
+ o.add(f);
2111
2111
  });
2112
2112
  });
2113
2113
  }), o.forEach((l) => {
@@ -2127,9 +2127,9 @@ const uy = /* @__PURE__ */ Dn(ly), Pr = {
2127
2127
  const a = [], o = th(e, r);
2128
2128
  if (Object.values(o).forEach((c) => {
2129
2129
  Object.keys(c).forEach((l) => {
2130
- r.collections[l].fields.forEach((f) => {
2131
- we(f) && f.collection === e.labels.collection && f.dependencyFields?.some((d) => d.field === t.name) && f.constraints && f.constraints.forEach((d) => {
2132
- a.push(d[0]);
2130
+ r.collections[l].fields.forEach((d) => {
2131
+ we(d) && d.collection === e.labels.collection && d.dependencyFields?.some((f) => f.field === t.name) && d.constraints && d.constraints.forEach((f) => {
2132
+ a.push(f[0]);
2133
2133
  });
2134
2134
  });
2135
2135
  });
@@ -2227,7 +2227,7 @@ const Qo = (t, e, r, n, s, i, a, o, c, l) => (t === "create" && (r.Collection_Pa
2227
2227
  for (const i of s)
2228
2228
  n && i.access && !i.access.includes(n) || ("autoIncrement" in i && i.autoIncrement && !t[i.name] && (t[i.name] = "Pending"), !we(i) && i.nullable && t[i.name] === void 0 && (t[i.name] = null));
2229
2229
  };
2230
- var fe;
2230
+ var de;
2231
2231
  (function(t) {
2232
2232
  t.assertEqual = (s) => {
2233
2233
  };
@@ -2263,16 +2263,16 @@ var fe;
2263
2263
  return s.map((a) => typeof a == "string" ? `'${a}'` : a).join(i);
2264
2264
  }
2265
2265
  t.joinValues = n, t.jsonStringifyReplacer = (s, i) => typeof i == "bigint" ? i.toString() : i;
2266
- })(fe || (fe = {}));
2267
- var lf;
2266
+ })(de || (de = {}));
2267
+ var cd;
2268
2268
  (function(t) {
2269
2269
  t.mergeShapes = (e, r) => ({
2270
2270
  ...e,
2271
2271
  ...r
2272
2272
  // second overwrites first
2273
2273
  });
2274
- })(lf || (lf = {}));
2275
- const W = fe.arrayToEnum([
2274
+ })(cd || (cd = {}));
2275
+ const W = de.arrayToEnum([
2276
2276
  "string",
2277
2277
  "nan",
2278
2278
  "number",
@@ -2314,7 +2314,7 @@ const W = fe.arrayToEnum([
2314
2314
  default:
2315
2315
  return W.unknown;
2316
2316
  }
2317
- }, P = fe.arrayToEnum([
2317
+ }, P = de.arrayToEnum([
2318
2318
  "invalid_type",
2319
2319
  "invalid_literal",
2320
2320
  "custom",
@@ -2376,7 +2376,7 @@ class yt extends Error {
2376
2376
  return this.message;
2377
2377
  }
2378
2378
  get message() {
2379
- return JSON.stringify(this.issues, fe.jsonStringifyReplacer, 2);
2379
+ return JSON.stringify(this.issues, de.jsonStringifyReplacer, 2);
2380
2380
  }
2381
2381
  get isEmpty() {
2382
2382
  return this.issues.length === 0;
@@ -2403,19 +2403,19 @@ const io = (t, e) => {
2403
2403
  t.received === W.undefined ? r = "Required" : r = `Expected ${t.expected}, received ${t.received}`;
2404
2404
  break;
2405
2405
  case P.invalid_literal:
2406
- r = `Invalid literal value, expected ${JSON.stringify(t.expected, fe.jsonStringifyReplacer)}`;
2406
+ r = `Invalid literal value, expected ${JSON.stringify(t.expected, de.jsonStringifyReplacer)}`;
2407
2407
  break;
2408
2408
  case P.unrecognized_keys:
2409
- r = `Unrecognized key(s) in object: ${fe.joinValues(t.keys, ", ")}`;
2409
+ r = `Unrecognized key(s) in object: ${de.joinValues(t.keys, ", ")}`;
2410
2410
  break;
2411
2411
  case P.invalid_union:
2412
2412
  r = "Invalid input";
2413
2413
  break;
2414
2414
  case P.invalid_union_discriminator:
2415
- r = `Invalid discriminator value. Expected ${fe.joinValues(t.options)}`;
2415
+ r = `Invalid discriminator value. Expected ${de.joinValues(t.options)}`;
2416
2416
  break;
2417
2417
  case P.invalid_enum_value:
2418
- r = `Invalid enum value. Expected ${fe.joinValues(t.options)}, received '${t.received}'`;
2418
+ r = `Invalid enum value. Expected ${de.joinValues(t.options)}, received '${t.received}'`;
2419
2419
  break;
2420
2420
  case P.invalid_arguments:
2421
2421
  r = "Invalid function arguments";
@@ -2427,7 +2427,7 @@ const io = (t, e) => {
2427
2427
  r = "Invalid date";
2428
2428
  break;
2429
2429
  case P.invalid_string:
2430
- typeof t.validation == "object" ? "includes" in t.validation ? (r = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (r = `${r} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? r = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? r = `Invalid input: must end with "${t.validation.endsWith}"` : fe.assertNever(t.validation) : t.validation !== "regex" ? r = `Invalid ${t.validation}` : r = "Invalid";
2430
+ typeof t.validation == "object" ? "includes" in t.validation ? (r = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (r = `${r} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? r = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? r = `Invalid input: must end with "${t.validation.endsWith}"` : de.assertNever(t.validation) : t.validation !== "regex" ? r = `Invalid ${t.validation}` : r = "Invalid";
2431
2431
  break;
2432
2432
  case P.too_small:
2433
2433
  t.type === "array" ? r = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? r = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? r = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "bigint" ? r = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? r = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : r = "Invalid input";
@@ -2448,7 +2448,7 @@ const io = (t, e) => {
2448
2448
  r = "Number must be finite";
2449
2449
  break;
2450
2450
  default:
2451
- r = e.defaultError, fe.assertNever(t);
2451
+ r = e.defaultError, de.assertNever(t);
2452
2452
  }
2453
2453
  return { message: r };
2454
2454
  };
@@ -2495,7 +2495,7 @@ function j(t, e) {
2495
2495
  });
2496
2496
  t.common.issues.push(n);
2497
2497
  }
2498
- class qe {
2498
+ class Le {
2499
2499
  constructor() {
2500
2500
  this.value = "valid";
2501
2501
  }
@@ -2523,7 +2523,7 @@ class qe {
2523
2523
  value: a
2524
2524
  });
2525
2525
  }
2526
- return qe.mergeObjectSync(e, n);
2526
+ return Le.mergeObjectSync(e, n);
2527
2527
  }
2528
2528
  static mergeObjectSync(e, r) {
2529
2529
  const n = {};
@@ -2538,7 +2538,7 @@ class qe {
2538
2538
  }
2539
2539
  const ee = Object.freeze({
2540
2540
  status: "aborted"
2541
- }), Ar = (t) => ({ status: "dirty", value: t }), Qe = (t) => ({ status: "valid", value: t }), uf = (t) => t.status === "aborted", ff = (t) => t.status === "dirty", or = (t) => t.status === "valid", gn = (t) => typeof Promise < "u" && t instanceof Promise;
2541
+ }), Ar = (t) => ({ status: "dirty", value: t }), Qe = (t) => ({ status: "valid", value: t }), ld = (t) => t.status === "aborted", ud = (t) => t.status === "dirty", or = (t) => t.status === "valid", gn = (t) => typeof Promise < "u" && t instanceof Promise;
2542
2542
  var B;
2543
2543
  (function(t) {
2544
2544
  t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
@@ -2551,7 +2551,7 @@ class lt {
2551
2551
  return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
2552
2552
  }
2553
2553
  }
2554
- const df = (t, e) => {
2554
+ const dd = (t, e) => {
2555
2555
  if (or(e))
2556
2556
  return { success: !0, data: e.value };
2557
2557
  if (!t.common.issues.length)
@@ -2596,7 +2596,7 @@ class ce {
2596
2596
  }
2597
2597
  _processInputParams(e) {
2598
2598
  return {
2599
- status: new qe(),
2599
+ status: new Le(),
2600
2600
  ctx: {
2601
2601
  common: e.parent.common,
2602
2602
  data: e.data,
@@ -2636,7 +2636,7 @@ class ce {
2636
2636
  data: e,
2637
2637
  parsedType: Tt(e)
2638
2638
  }, s = this._parseSync({ data: e, path: n.path, parent: n });
2639
- return df(n, s);
2639
+ return dd(n, s);
2640
2640
  }
2641
2641
  "~validate"(e) {
2642
2642
  const r = {
@@ -2689,7 +2689,7 @@ class ce {
2689
2689
  data: e,
2690
2690
  parsedType: Tt(e)
2691
2691
  }, s = this._parse({ data: e, path: n.path, parent: n }), i = await (gn(s) ? s : Promise.resolve(s));
2692
- return df(n, i);
2692
+ return dd(n, i);
2693
2693
  }
2694
2694
  refine(e, r) {
2695
2695
  const n = (s) => typeof r == "string" || typeof r > "u" ? { message: r } : typeof r == "function" ? r(s) : r;
@@ -2725,7 +2725,7 @@ class ce {
2725
2725
  return kt.create(this, this._def);
2726
2726
  }
2727
2727
  nullable() {
2728
- return fr.create(this, this._def);
2728
+ return dr.create(this, this._def);
2729
2729
  }
2730
2730
  nullish() {
2731
2731
  return this.nullable().optional();
@@ -2841,7 +2841,7 @@ class gt extends ce {
2841
2841
  received: i.parsedType
2842
2842
  }), ee;
2843
2843
  }
2844
- const n = new qe();
2844
+ const n = new Le();
2845
2845
  let s;
2846
2846
  for (const i of this._def.checks)
2847
2847
  if (i.kind === "min")
@@ -2983,7 +2983,7 @@ class gt extends ce {
2983
2983
  validation: "base64url",
2984
2984
  code: P.invalid_string,
2985
2985
  message: i.message
2986
- }), n.dirty()) : fe.assertNever(i);
2986
+ }), n.dirty()) : de.assertNever(i);
2987
2987
  return { status: n.value, value: e.data };
2988
2988
  }
2989
2989
  _regex(e, r, n) {
@@ -3232,9 +3232,9 @@ class cr extends ce {
3232
3232
  }), ee;
3233
3233
  }
3234
3234
  let n;
3235
- const s = new qe();
3235
+ const s = new Le();
3236
3236
  for (const i of this._def.checks)
3237
- i.kind === "int" ? fe.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), j(n, {
3237
+ i.kind === "int" ? de.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), j(n, {
3238
3238
  code: P.invalid_type,
3239
3239
  expected: "integer",
3240
3240
  received: "float",
@@ -3260,7 +3260,7 @@ class cr extends ce {
3260
3260
  }), s.dirty()) : i.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), j(n, {
3261
3261
  code: P.not_finite,
3262
3262
  message: i.message
3263
- }), s.dirty()) : fe.assertNever(i);
3263
+ }), s.dirty()) : de.assertNever(i);
3264
3264
  return { status: s.value, value: e.data };
3265
3265
  }
3266
3266
  gte(e, r) {
@@ -3372,7 +3372,7 @@ class cr extends ce {
3372
3372
  return e;
3373
3373
  }
3374
3374
  get isInt() {
3375
- return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && fe.isInteger(e.value));
3375
+ return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && de.isInteger(e.value));
3376
3376
  }
3377
3377
  get isFinite() {
3378
3378
  let e = null, r = null;
@@ -3404,7 +3404,7 @@ class Vr extends ce {
3404
3404
  if (this._getType(e) !== W.bigint)
3405
3405
  return this._getInvalidInput(e);
3406
3406
  let n;
3407
- const s = new qe();
3407
+ const s = new Le();
3408
3408
  for (const i of this._def.checks)
3409
3409
  i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (n = this._getOrReturnCtx(e, n), j(n, {
3410
3410
  code: P.too_small,
@@ -3422,7 +3422,7 @@ class Vr extends ce {
3422
3422
  code: P.not_multiple_of,
3423
3423
  multipleOf: i.value,
3424
3424
  message: i.message
3425
- }), s.dirty()) : fe.assertNever(i);
3425
+ }), s.dirty()) : de.assertNever(i);
3426
3426
  return { status: s.value, value: e.data };
3427
3427
  }
3428
3428
  _getInvalidInput(e) {
@@ -3557,7 +3557,7 @@ class yn extends ce {
3557
3557
  code: P.invalid_date
3558
3558
  }), ee;
3559
3559
  }
3560
- const n = new qe();
3560
+ const n = new Le();
3561
3561
  let s;
3562
3562
  for (const i of this._def.checks)
3563
3563
  i.kind === "min" ? e.data.getTime() < i.value && (s = this._getOrReturnCtx(e, s), j(s, {
@@ -3574,7 +3574,7 @@ class yn extends ce {
3574
3574
  exact: !1,
3575
3575
  maximum: i.value,
3576
3576
  type: "date"
3577
- }), n.dirty()) : fe.assertNever(i);
3577
+ }), n.dirty()) : de.assertNever(i);
3578
3578
  return {
3579
3579
  status: n.value,
3580
3580
  value: new Date(e.data.getTime())
@@ -3619,7 +3619,7 @@ yn.create = (t) => new yn({
3619
3619
  typeName: Q.ZodDate,
3620
3620
  ...se(t)
3621
3621
  });
3622
- class hf extends ce {
3622
+ class fd extends ce {
3623
3623
  _parse(e) {
3624
3624
  if (this._getType(e) !== W.symbol) {
3625
3625
  const n = this._getOrReturnCtx(e);
@@ -3632,11 +3632,11 @@ class hf extends ce {
3632
3632
  return Qe(e.data);
3633
3633
  }
3634
3634
  }
3635
- hf.create = (t) => new hf({
3635
+ fd.create = (t) => new fd({
3636
3636
  typeName: Q.ZodSymbol,
3637
3637
  ...se(t)
3638
3638
  });
3639
- class mf extends ce {
3639
+ class hd extends ce {
3640
3640
  _parse(e) {
3641
3641
  if (this._getType(e) !== W.undefined) {
3642
3642
  const n = this._getOrReturnCtx(e);
@@ -3649,11 +3649,11 @@ class mf extends ce {
3649
3649
  return Qe(e.data);
3650
3650
  }
3651
3651
  }
3652
- mf.create = (t) => new mf({
3652
+ hd.create = (t) => new hd({
3653
3653
  typeName: Q.ZodUndefined,
3654
3654
  ...se(t)
3655
3655
  });
3656
- class pf extends ce {
3656
+ class md extends ce {
3657
3657
  _parse(e) {
3658
3658
  if (this._getType(e) !== W.null) {
3659
3659
  const n = this._getOrReturnCtx(e);
@@ -3666,7 +3666,7 @@ class pf extends ce {
3666
3666
  return Qe(e.data);
3667
3667
  }
3668
3668
  }
3669
- pf.create = (t) => new pf({
3669
+ md.create = (t) => new md({
3670
3670
  typeName: Q.ZodNull,
3671
3671
  ...se(t)
3672
3672
  });
@@ -3682,7 +3682,7 @@ oo.create = (t) => new oo({
3682
3682
  typeName: Q.ZodAny,
3683
3683
  ...se(t)
3684
3684
  });
3685
- class gf extends ce {
3685
+ class pd extends ce {
3686
3686
  constructor() {
3687
3687
  super(...arguments), this._unknown = !0;
3688
3688
  }
@@ -3690,7 +3690,7 @@ class gf extends ce {
3690
3690
  return Qe(e.data);
3691
3691
  }
3692
3692
  }
3693
- gf.create = (t) => new gf({
3693
+ pd.create = (t) => new pd({
3694
3694
  typeName: Q.ZodUnknown,
3695
3695
  ...se(t)
3696
3696
  });
@@ -3708,7 +3708,7 @@ Nt.create = (t) => new Nt({
3708
3708
  typeName: Q.ZodNever,
3709
3709
  ...se(t)
3710
3710
  });
3711
- class yf extends ce {
3711
+ class gd extends ce {
3712
3712
  _parse(e) {
3713
3713
  if (this._getType(e) !== W.undefined) {
3714
3714
  const n = this._getOrReturnCtx(e);
@@ -3721,7 +3721,7 @@ class yf extends ce {
3721
3721
  return Qe(e.data);
3722
3722
  }
3723
3723
  }
3724
- yf.create = (t) => new yf({
3724
+ gd.create = (t) => new gd({
3725
3725
  typeName: Q.ZodVoid,
3726
3726
  ...se(t)
3727
3727
  });
@@ -3761,9 +3761,9 @@ class ot extends ce {
3761
3761
  exact: !1,
3762
3762
  message: s.maxLength.message
3763
3763
  }), n.dirty()), r.common.async)
3764
- return Promise.all([...r.data].map((a, o) => s.type._parseAsync(new lt(r, a, r.path, o)))).then((a) => qe.mergeArray(n, a));
3764
+ return Promise.all([...r.data].map((a, o) => s.type._parseAsync(new lt(r, a, r.path, o)))).then((a) => Le.mergeArray(n, a));
3765
3765
  const i = [...r.data].map((a, o) => s.type._parseSync(new lt(r, a, r.path, o)));
3766
- return qe.mergeArray(n, i);
3766
+ return Le.mergeArray(n, i);
3767
3767
  }
3768
3768
  get element() {
3769
3769
  return this._def.type;
@@ -3812,7 +3812,7 @@ function Xt(t) {
3812
3812
  } else return t instanceof ot ? new ot({
3813
3813
  ...t._def,
3814
3814
  type: Xt(t.element)
3815
- }) : t instanceof kt ? kt.create(Xt(t.unwrap())) : t instanceof fr ? fr.create(Xt(t.unwrap())) : t instanceof Ut ? Ut.create(t.items.map((e) => Xt(e))) : t;
3815
+ }) : t instanceof kt ? kt.create(Xt(t.unwrap())) : t instanceof dr ? dr.create(Xt(t.unwrap())) : t instanceof Ut ? Ut.create(t.items.map((e) => Xt(e))) : t;
3816
3816
  }
3817
3817
  class Re extends ce {
3818
3818
  constructor() {
@@ -3821,7 +3821,7 @@ class Re extends ce {
3821
3821
  _getCached() {
3822
3822
  if (this._cached !== null)
3823
3823
  return this._cached;
3824
- const e = this._def.shape(), r = fe.objectKeys(e);
3824
+ const e = this._def.shape(), r = de.objectKeys(e);
3825
3825
  return this._cached = { shape: e, keys: r }, this._cached;
3826
3826
  }
3827
3827
  _parse(e) {
@@ -3839,10 +3839,10 @@ class Re extends ce {
3839
3839
  a.includes(l) || o.push(l);
3840
3840
  const c = [];
3841
3841
  for (const l of a) {
3842
- const u = i[l], f = s.data[l];
3842
+ const u = i[l], d = s.data[l];
3843
3843
  c.push({
3844
3844
  key: { status: "valid", value: l },
3845
- value: u._parse(new lt(s, f, s.path, l)),
3845
+ value: u._parse(new lt(s, d, s.path, l)),
3846
3846
  alwaysSet: l in s.data
3847
3847
  });
3848
3848
  }
@@ -3863,11 +3863,11 @@ class Re extends ce {
3863
3863
  } else {
3864
3864
  const l = this._def.catchall;
3865
3865
  for (const u of o) {
3866
- const f = s.data[u];
3866
+ const d = s.data[u];
3867
3867
  c.push({
3868
3868
  key: { status: "valid", value: u },
3869
3869
  value: l._parse(
3870
- new lt(s, f, s.path, u)
3870
+ new lt(s, d, s.path, u)
3871
3871
  //, ctx.child(key), value, getParsedType(value)
3872
3872
  ),
3873
3873
  alwaysSet: u in s.data
@@ -3877,15 +3877,15 @@ class Re extends ce {
3877
3877
  return s.common.async ? Promise.resolve().then(async () => {
3878
3878
  const l = [];
3879
3879
  for (const u of c) {
3880
- const f = await u.key, d = await u.value;
3880
+ const d = await u.key, f = await u.value;
3881
3881
  l.push({
3882
- key: f,
3883
- value: d,
3882
+ key: d,
3883
+ value: f,
3884
3884
  alwaysSet: u.alwaysSet
3885
3885
  });
3886
3886
  }
3887
3887
  return l;
3888
- }).then((l) => qe.mergeObjectSync(n, l)) : qe.mergeObjectSync(n, c);
3888
+ }).then((l) => Le.mergeObjectSync(n, l)) : Le.mergeObjectSync(n, c);
3889
3889
  }
3890
3890
  get shape() {
3891
3891
  return this._def.shape();
@@ -4027,7 +4027,7 @@ class Re extends ce {
4027
4027
  }
4028
4028
  pick(e) {
4029
4029
  const r = {};
4030
- for (const n of fe.objectKeys(e))
4030
+ for (const n of de.objectKeys(e))
4031
4031
  e[n] && this.shape[n] && (r[n] = this.shape[n]);
4032
4032
  return new Re({
4033
4033
  ...this._def,
@@ -4036,7 +4036,7 @@ class Re extends ce {
4036
4036
  }
4037
4037
  omit(e) {
4038
4038
  const r = {};
4039
- for (const n of fe.objectKeys(this.shape))
4039
+ for (const n of de.objectKeys(this.shape))
4040
4040
  e[n] || (r[n] = this.shape[n]);
4041
4041
  return new Re({
4042
4042
  ...this._def,
@@ -4051,7 +4051,7 @@ class Re extends ce {
4051
4051
  }
4052
4052
  partial(e) {
4053
4053
  const r = {};
4054
- for (const n of fe.objectKeys(this.shape)) {
4054
+ for (const n of de.objectKeys(this.shape)) {
4055
4055
  const s = this.shape[n];
4056
4056
  e && !e[n] ? r[n] = s : r[n] = s.optional();
4057
4057
  }
@@ -4062,7 +4062,7 @@ class Re extends ce {
4062
4062
  }
4063
4063
  required(e) {
4064
4064
  const r = {};
4065
- for (const n of fe.objectKeys(this.shape))
4065
+ for (const n of de.objectKeys(this.shape))
4066
4066
  if (e && !e[n])
4067
4067
  r[n] = this.shape[n];
4068
4068
  else {
@@ -4077,7 +4077,7 @@ class Re extends ce {
4077
4077
  });
4078
4078
  }
4079
4079
  keyof() {
4080
- return oh(fe.objectKeys(this.shape));
4080
+ return oh(de.objectKeys(this.shape));
4081
4081
  }
4082
4082
  }
4083
4083
  Re.create = (t, e) => new Re({
@@ -4179,7 +4179,7 @@ function co(t, e) {
4179
4179
  if (t === e)
4180
4180
  return { valid: !0, data: t };
4181
4181
  if (r === W.object && n === W.object) {
4182
- const s = fe.objectKeys(e), i = fe.objectKeys(t).filter((o) => s.indexOf(o) !== -1), a = { ...t, ...e };
4182
+ const s = de.objectKeys(e), i = de.objectKeys(t).filter((o) => s.indexOf(o) !== -1), a = { ...t, ...e };
4183
4183
  for (const o of i) {
4184
4184
  const c = co(t[o], e[o]);
4185
4185
  if (!c.valid)
@@ -4203,10 +4203,10 @@ function co(t, e) {
4203
4203
  class vn extends ce {
4204
4204
  _parse(e) {
4205
4205
  const { status: r, ctx: n } = this._processInputParams(e), s = (i, a) => {
4206
- if (uf(i) || uf(a))
4206
+ if (ld(i) || ld(a))
4207
4207
  return ee;
4208
4208
  const o = co(i.value, a.value);
4209
- return o.valid ? ((ff(i) || ff(a)) && r.dirty(), { status: r.value, value: o.data }) : (j(n, {
4209
+ return o.valid ? ((ud(i) || ud(a)) && r.dirty(), { status: r.value, value: o.data }) : (j(n, {
4210
4210
  code: P.invalid_intersection_types
4211
4211
  }), ee);
4212
4212
  };
@@ -4266,7 +4266,7 @@ class Ut extends ce {
4266
4266
  const c = this._def.items[o] || this._def.rest;
4267
4267
  return c ? c._parse(new lt(n, a, n.path, o)) : null;
4268
4268
  }).filter((a) => !!a);
4269
- return n.common.async ? Promise.all(i).then((a) => qe.mergeArray(r, a)) : qe.mergeArray(r, i);
4269
+ return n.common.async ? Promise.all(i).then((a) => Le.mergeArray(r, a)) : Le.mergeArray(r, i);
4270
4270
  }
4271
4271
  get items() {
4272
4272
  return this._def.items;
@@ -4310,7 +4310,7 @@ class wn extends ce {
4310
4310
  value: a._parse(new lt(n, n.data[o], n.path, o)),
4311
4311
  alwaysSet: o in n.data
4312
4312
  });
4313
- return n.common.async ? qe.mergeObjectAsync(r, s) : qe.mergeObjectSync(r, s);
4313
+ return n.common.async ? Le.mergeObjectAsync(r, s) : Le.mergeObjectSync(r, s);
4314
4314
  }
4315
4315
  get element() {
4316
4316
  return this._def.valueType;
@@ -4329,7 +4329,7 @@ class wn extends ce {
4329
4329
  });
4330
4330
  }
4331
4331
  }
4332
- class _f extends ce {
4332
+ class yd extends ce {
4333
4333
  get keySchema() {
4334
4334
  return this._def.keyType;
4335
4335
  }
@@ -4371,7 +4371,7 @@ class _f extends ce {
4371
4371
  }
4372
4372
  }
4373
4373
  }
4374
- _f.create = (t, e, r) => new _f({
4374
+ yd.create = (t, e, r) => new yd({
4375
4375
  valueType: e,
4376
4376
  keyType: t,
4377
4377
  typeName: Q.ZodMap,
@@ -4441,7 +4441,7 @@ Ur.create = (t, e) => new Ur({
4441
4441
  typeName: Q.ZodSet,
4442
4442
  ...se(e)
4443
4443
  });
4444
- class vf extends ce {
4444
+ class _d extends ce {
4445
4445
  get schema() {
4446
4446
  return this._def.getter();
4447
4447
  }
@@ -4450,7 +4450,7 @@ class vf extends ce {
4450
4450
  return this._def.getter()._parse({ data: r.data, path: r.path, parent: r });
4451
4451
  }
4452
4452
  }
4453
- vf.create = (t, e) => new vf({
4453
+ _d.create = (t, e) => new _d({
4454
4454
  getter: t,
4455
4455
  typeName: Q.ZodLazy,
4456
4456
  ...se(e)
@@ -4488,7 +4488,7 @@ class lr extends ce {
4488
4488
  if (typeof e.data != "string") {
4489
4489
  const r = this._getOrReturnCtx(e), n = this._def.values;
4490
4490
  return j(r, {
4491
- expected: fe.joinValues(n),
4491
+ expected: de.joinValues(n),
4492
4492
  received: r.parsedType,
4493
4493
  code: P.invalid_type
4494
4494
  }), ee;
@@ -4538,19 +4538,19 @@ class lr extends ce {
4538
4538
  }
4539
4539
  }
4540
4540
  lr.create = oh;
4541
- class wf extends ce {
4541
+ class vd extends ce {
4542
4542
  _parse(e) {
4543
- const r = fe.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
4543
+ const r = de.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
4544
4544
  if (n.parsedType !== W.string && n.parsedType !== W.number) {
4545
- const s = fe.objectValues(r);
4545
+ const s = de.objectValues(r);
4546
4546
  return j(n, {
4547
- expected: fe.joinValues(s),
4547
+ expected: de.joinValues(s),
4548
4548
  received: n.parsedType,
4549
4549
  code: P.invalid_type
4550
4550
  }), ee;
4551
4551
  }
4552
- if (this._cache || (this._cache = new Set(fe.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
4553
- const s = fe.objectValues(r);
4552
+ if (this._cache || (this._cache = new Set(de.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
4553
+ const s = de.objectValues(r);
4554
4554
  return j(n, {
4555
4555
  received: n.data,
4556
4556
  code: P.invalid_enum_value,
@@ -4563,7 +4563,7 @@ class wf extends ce {
4563
4563
  return this._def.values;
4564
4564
  }
4565
4565
  }
4566
- wf.create = (t, e) => new wf({
4566
+ vd.create = (t, e) => new vd({
4567
4567
  values: t,
4568
4568
  typeName: Q.ZodNativeEnum,
4569
4569
  ...se(e)
@@ -4669,7 +4669,7 @@ class ur extends ce {
4669
4669
  status: r.value,
4670
4670
  value: o
4671
4671
  })) : ee);
4672
- fe.assertNever(s);
4672
+ de.assertNever(s);
4673
4673
  }
4674
4674
  }
4675
4675
  ur.create = (t, e, r) => new ur({
@@ -4697,7 +4697,7 @@ kt.create = (t, e) => new kt({
4697
4697
  typeName: Q.ZodOptional,
4698
4698
  ...se(e)
4699
4699
  });
4700
- class fr extends ce {
4700
+ class dr extends ce {
4701
4701
  _parse(e) {
4702
4702
  return this._getType(e) === W.null ? Qe(null) : this._def.innerType._parse(e);
4703
4703
  }
@@ -4705,7 +4705,7 @@ class fr extends ce {
4705
4705
  return this._def.innerType;
4706
4706
  }
4707
4707
  }
4708
- fr.create = (t, e) => new fr({
4708
+ dr.create = (t, e) => new dr({
4709
4709
  innerType: t,
4710
4710
  typeName: Q.ZodNullable,
4711
4711
  ...se(e)
@@ -4773,7 +4773,7 @@ fo.create = (t, e) => new fo({
4773
4773
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
4774
4774
  ...se(e)
4775
4775
  });
4776
- class bf extends ce {
4776
+ class wd extends ce {
4777
4777
  _parse(e) {
4778
4778
  if (this._getType(e) !== W.nan) {
4779
4779
  const n = this._getOrReturnCtx(e);
@@ -4786,7 +4786,7 @@ class bf extends ce {
4786
4786
  return { status: "valid", value: e.data };
4787
4787
  }
4788
4788
  }
4789
- bf.create = (t) => new bf({
4789
+ wd.create = (t) => new wd({
4790
4790
  typeName: Q.ZodNaN,
4791
4791
  ...se(t)
4792
4792
  });
@@ -4869,10 +4869,10 @@ Ut.create;
4869
4869
  const ec = wn.create, po = lo.create, go = lr.create;
4870
4870
  bn.create;
4871
4871
  kt.create;
4872
- fr.create;
4872
+ dr.create;
4873
4873
  const un = () => jt().refine((t) => t && (t.seconds !== void 0 && t.nanoseconds !== void 0 || t._seconds !== void 0 && t._nanoseconds !== void 0), {
4874
4874
  message: "Value is not a valid timestamp"
4875
- }), Of = () => jt().refine((t) => t && (t._methodName === "serverTimestamp" || t.constructor.name === "ServerTimestampTransform"), {
4875
+ }), bd = () => jt().refine((t) => t && (t._methodName === "serverTimestamp" || t.constructor.name === "ServerTimestampTransform"), {
4876
4876
  message: "Value is not a valid server timestamp"
4877
4877
  }), lh = (t, e, r) => {
4878
4878
  const n = {};
@@ -4952,7 +4952,7 @@ const un = () => jt().refine((t) => t && (t.seconds !== void 0 && t.nanoseconds
4952
4952
  Collection_Path: Un(at()),
4953
4953
  Last_Write_App: at(),
4954
4954
  Last_Write_At: un(),
4955
- Last_Save_At: Of(),
4955
+ Last_Save_At: bd(),
4956
4956
  Last_Write_By: On([at().length(28), po("System")]),
4957
4957
  Last_Write_Connection_Status: go(["Online", "Offline"]),
4958
4958
  Last_Write_Version: mo().int(),
@@ -4960,7 +4960,7 @@ const un = () => jt().refine((t) => t && (t.seconds !== void 0 && t.nanoseconds
4960
4960
  Created_At: un(),
4961
4961
  Created_By: On([at().length(28), po("System")])
4962
4962
  };
4963
- t === "create" && (n.Saved_At = Of()), t === "update" && (n.Saved_At = un(), 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());
4963
+ t === "create" && (n.Saved_At = bd()), t === "update" && (n.Saved_At = un(), 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());
4964
4964
  const s = nh(e, e.fields), i = Array.from(s).map((c) => c.name);
4965
4965
  e.fields.forEach((c) => {
4966
4966
  we(c) ? (n[c.name] = Zy(c, r), n[`${c.name}_Array`] = Gy(c), i.includes(c.name) && (n[`${c.name}_Single`] = lh(c, r, !0), c.required || (n[`${c.name}_Single`] = n[`${c.name}_Single`].optional())), c.length && (n[c.name] = n[c.name].refine((l) => c.length && l && Object.keys(l).length === c.length, {
@@ -5011,7 +5011,7 @@ const $ = "numeric", st = "short", Ve = "long", Sn = {
5011
5011
  year: $,
5012
5012
  month: $,
5013
5013
  day: $
5014
- }, fh = {
5014
+ }, dh = {
5015
5015
  year: $,
5016
5016
  month: st,
5017
5017
  day: $
@@ -5020,7 +5020,7 @@ const $ = "numeric", st = "short", Ve = "long", Sn = {
5020
5020
  month: st,
5021
5021
  day: $,
5022
5022
  weekday: st
5023
- }, dh = {
5023
+ }, fh = {
5024
5024
  year: $,
5025
5025
  month: Ve,
5026
5026
  day: $
@@ -5404,7 +5404,7 @@ class _t extends Kr {
5404
5404
  const n = e_(this.name);
5405
5405
  let [s, i, a, o, c, l, u] = n.formatToParts ? n_(n, r) : r_(n, r);
5406
5406
  o === "BC" && (s = -Math.abs(s) + 1);
5407
- const d = Bn({
5407
+ const f = Bn({
5408
5408
  year: s,
5409
5409
  month: i,
5410
5410
  day: a,
@@ -5415,7 +5415,7 @@ class _t extends Kr {
5415
5415
  });
5416
5416
  let h = +r;
5417
5417
  const p = h % 1e3;
5418
- return h -= p >= 0 ? p : 1e3 + p, (d - h) / (60 * 1e3);
5418
+ return h -= p >= 0 ? p : 1e3 + p, (f - h) / (60 * 1e3);
5419
5419
  }
5420
5420
  /**
5421
5421
  * Return whether this Zone is equal to another zone
@@ -5435,11 +5435,11 @@ class _t extends Kr {
5435
5435
  return this.valid;
5436
5436
  }
5437
5437
  }
5438
- let Ef = {};
5438
+ let Od = {};
5439
5439
  function s_(t, e = {}) {
5440
5440
  const r = JSON.stringify([t, e]);
5441
- let n = Ef[r];
5442
- return n || (n = new Intl.ListFormat(t, e), Ef[r] = n), n;
5441
+ let n = Od[r];
5442
+ return n || (n = new Intl.ListFormat(t, e), Od[r] = n), n;
5443
5443
  }
5444
5444
  const _o = /* @__PURE__ */ new Map();
5445
5445
  function vo(t, e = {}) {
@@ -5498,7 +5498,7 @@ function l_(t) {
5498
5498
  function u_(t, e, r) {
5499
5499
  return (r || e) && (t.includes("-u-") || (t += "-u"), r && (t += `-ca-${r}`), e && (t += `-nu-${e}`)), t;
5500
5500
  }
5501
- function f_(t) {
5501
+ function d_(t) {
5502
5502
  const e = [];
5503
5503
  for (let r = 1; r <= 12; r++) {
5504
5504
  const n = G.utc(2009, r, 1);
@@ -5506,7 +5506,7 @@ function f_(t) {
5506
5506
  }
5507
5507
  return e;
5508
5508
  }
5509
- function d_(t) {
5509
+ function f_(t) {
5510
5510
  const e = [];
5511
5511
  for (let r = 1; r <= 7; r++) {
5512
5512
  const n = G.utc(2016, 11, 13 + r);
@@ -5645,7 +5645,7 @@ class me {
5645
5645
  const s = r ? { month: e, day: "numeric" } : { month: e }, i = r ? "format" : "standalone";
5646
5646
  if (!this.monthsCache[i][e]) {
5647
5647
  const a = n ? (o) => this.dtFormatter(o, s).format() : (o) => this.extract(o, s, "month");
5648
- this.monthsCache[i][e] = f_(a);
5648
+ this.monthsCache[i][e] = d_(a);
5649
5649
  }
5650
5650
  return this.monthsCache[i][e];
5651
5651
  });
@@ -5653,7 +5653,7 @@ class me {
5653
5653
  weekdays(e, r = !1) {
5654
5654
  return sn(this, e, Zh, () => {
5655
5655
  const n = r ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, s = r ? "format" : "standalone";
5656
- return this.weekdaysCache[s][e] || (this.weekdaysCache[s][e] = d_(
5656
+ return this.weekdaysCache[s][e] || (this.weekdaysCache[s][e] = f_(
5657
5657
  (i) => this.extract(i, n, "weekday")
5658
5658
  )), this.weekdaysCache[s][e];
5659
5659
  });
@@ -5721,13 +5721,13 @@ class me {
5721
5721
  }
5722
5722
  }
5723
5723
  let Ra = null;
5724
- class Me extends Kr {
5724
+ class qe extends Kr {
5725
5725
  /**
5726
5726
  * Get a singleton instance of UTC
5727
5727
  * @return {FixedOffsetZone}
5728
5728
  */
5729
5729
  static get utcInstance() {
5730
- return Ra === null && (Ra = new Me(0)), Ra;
5730
+ return Ra === null && (Ra = new qe(0)), Ra;
5731
5731
  }
5732
5732
  /**
5733
5733
  * Get an instance with a specified offset
@@ -5735,7 +5735,7 @@ class Me extends Kr {
5735
5735
  * @return {FixedOffsetZone}
5736
5736
  */
5737
5737
  static instance(e) {
5738
- return e === 0 ? Me.utcInstance : new Me(e);
5738
+ return e === 0 ? qe.utcInstance : new qe(e);
5739
5739
  }
5740
5740
  /**
5741
5741
  * Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6"
@@ -5749,7 +5749,7 @@ class Me extends Kr {
5749
5749
  if (e) {
5750
5750
  const r = e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);
5751
5751
  if (r)
5752
- return new Me(Zn(r[1], r[2]));
5752
+ return new qe(Zn(r[1], r[2]));
5753
5753
  }
5754
5754
  return null;
5755
5755
  }
@@ -5884,8 +5884,8 @@ function At(t, e) {
5884
5884
  return t;
5885
5885
  if (E_(t)) {
5886
5886
  const r = t.toLowerCase();
5887
- return r === "default" ? e : r === "local" || r === "system" ? Wn.instance : r === "utc" || r === "gmt" ? Me.utcInstance : Me.parseSpecifier(r) || _t.create(t);
5888
- } else return It(t) ? Me.instance(t) : typeof t == "object" && "offset" in t && typeof t.offset == "function" ? t : new y_(t);
5887
+ return r === "default" ? e : r === "local" || r === "system" ? Wn.instance : r === "utc" || r === "gmt" ? qe.utcInstance : qe.parseSpecifier(r) || _t.create(t);
5888
+ } else return It(t) ? qe.instance(t) : typeof t == "object" && "offset" in t && typeof t.offset == "function" ? t : new y_(t);
5889
5889
  }
5890
5890
  const tc = {
5891
5891
  arab: "[٠-٩]",
@@ -5909,7 +5909,7 @@ const tc = {
5909
5909
  thai: "[๐-๙]",
5910
5910
  tibt: "[༠-༩]",
5911
5911
  latn: "\\d"
5912
- }, Sf = {
5912
+ }, Ed = {
5913
5913
  arab: [1632, 1641],
5914
5914
  arabext: [1776, 1785],
5915
5915
  bali: [6992, 7001],
@@ -5939,8 +5939,8 @@ function v_(t) {
5939
5939
  if (t[r].search(tc.hanidec) !== -1)
5940
5940
  e += __.indexOf(t[r]);
5941
5941
  else
5942
- for (const s in Sf) {
5943
- const [i, a] = Sf[s];
5942
+ for (const s in Ed) {
5943
+ const [i, a] = Ed[s];
5944
5944
  n >= i && n <= a && (e += n - i);
5945
5945
  }
5946
5946
  }
@@ -5959,14 +5959,14 @@ function et({ numberingSystem: t }, e = "") {
5959
5959
  let s = n.get(e);
5960
5960
  return s === void 0 && (s = new RegExp(`${tc[r]}${e}`), n.set(e, s)), s;
5961
5961
  }
5962
- let Tf = () => Date.now(), Rf = "system", Cf = null, Af = null, kf = null, If = 60, xf, Nf = null;
5962
+ let Sd = () => Date.now(), Td = "system", Rd = null, Cd = null, Ad = null, kd = 60, Id, xd = null;
5963
5963
  class Se {
5964
5964
  /**
5965
5965
  * Get the callback for returning the current timestamp.
5966
5966
  * @type {function}
5967
5967
  */
5968
5968
  static get now() {
5969
- return Tf;
5969
+ return Sd;
5970
5970
  }
5971
5971
  /**
5972
5972
  * Set the callback for returning the current timestamp.
@@ -5976,7 +5976,7 @@ class Se {
5976
5976
  * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time
5977
5977
  */
5978
5978
  static set now(e) {
5979
- Tf = e;
5979
+ Sd = e;
5980
5980
  }
5981
5981
  /**
5982
5982
  * Set the default time zone to create DateTimes in. Does not affect existing instances.
@@ -5984,7 +5984,7 @@ class Se {
5984
5984
  * @type {string}
5985
5985
  */
5986
5986
  static set defaultZone(e) {
5987
- Rf = e;
5987
+ Td = e;
5988
5988
  }
5989
5989
  /**
5990
5990
  * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.
@@ -5992,49 +5992,49 @@ class Se {
5992
5992
  * @type {Zone}
5993
5993
  */
5994
5994
  static get defaultZone() {
5995
- return At(Rf, Wn.instance);
5995
+ return At(Td, Wn.instance);
5996
5996
  }
5997
5997
  /**
5998
5998
  * Get the default locale to create DateTimes with. Does not affect existing instances.
5999
5999
  * @type {string}
6000
6000
  */
6001
6001
  static get defaultLocale() {
6002
- return Cf;
6002
+ return Rd;
6003
6003
  }
6004
6004
  /**
6005
6005
  * Set the default locale to create DateTimes with. Does not affect existing instances.
6006
6006
  * @type {string}
6007
6007
  */
6008
6008
  static set defaultLocale(e) {
6009
- Cf = e;
6009
+ Rd = e;
6010
6010
  }
6011
6011
  /**
6012
6012
  * Get the default numbering system to create DateTimes with. Does not affect existing instances.
6013
6013
  * @type {string}
6014
6014
  */
6015
6015
  static get defaultNumberingSystem() {
6016
- return Af;
6016
+ return Cd;
6017
6017
  }
6018
6018
  /**
6019
6019
  * Set the default numbering system to create DateTimes with. Does not affect existing instances.
6020
6020
  * @type {string}
6021
6021
  */
6022
6022
  static set defaultNumberingSystem(e) {
6023
- Af = e;
6023
+ Cd = e;
6024
6024
  }
6025
6025
  /**
6026
6026
  * Get the default output calendar to create DateTimes with. Does not affect existing instances.
6027
6027
  * @type {string}
6028
6028
  */
6029
6029
  static get defaultOutputCalendar() {
6030
- return kf;
6030
+ return Ad;
6031
6031
  }
6032
6032
  /**
6033
6033
  * Set the default output calendar to create DateTimes with. Does not affect existing instances.
6034
6034
  * @type {string}
6035
6035
  */
6036
6036
  static set defaultOutputCalendar(e) {
6037
- kf = e;
6037
+ Ad = e;
6038
6038
  }
6039
6039
  /**
6040
6040
  * @typedef {Object} WeekSettings
@@ -6046,7 +6046,7 @@ class Se {
6046
6046
  * @return {WeekSettings|null}
6047
6047
  */
6048
6048
  static get defaultWeekSettings() {
6049
- return Nf;
6049
+ return xd;
6050
6050
  }
6051
6051
  /**
6052
6052
  * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and
@@ -6056,14 +6056,14 @@ class Se {
6056
6056
  * @param {WeekSettings|null} weekSettings
6057
6057
  */
6058
6058
  static set defaultWeekSettings(e) {
6059
- Nf = To(e);
6059
+ xd = To(e);
6060
6060
  }
6061
6061
  /**
6062
6062
  * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.
6063
6063
  * @type {number}
6064
6064
  */
6065
6065
  static get twoDigitCutoffYear() {
6066
- return If;
6066
+ return kd;
6067
6067
  }
6068
6068
  /**
6069
6069
  * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.
@@ -6075,21 +6075,21 @@ class Se {
6075
6075
  * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50
6076
6076
  */
6077
6077
  static set twoDigitCutoffYear(e) {
6078
- If = e % 100;
6078
+ kd = e % 100;
6079
6079
  }
6080
6080
  /**
6081
6081
  * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
6082
6082
  * @type {boolean}
6083
6083
  */
6084
6084
  static get throwOnInvalid() {
6085
- return xf;
6085
+ return Id;
6086
6086
  }
6087
6087
  /**
6088
6088
  * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
6089
6089
  * @type {boolean}
6090
6090
  */
6091
6091
  static set throwOnInvalid(e) {
6092
- xf = e;
6092
+ Id = e;
6093
6093
  }
6094
6094
  /**
6095
6095
  * Reset Luxon's global caches. Should only be necessary in testing scenarios.
@@ -6135,22 +6135,22 @@ function Tn(t, e = 4, r = 1) {
6135
6135
  let c = Math.floor((a - o + 14 - e) / 7), l;
6136
6136
  return c < 1 ? (l = n - 1, c = Wr(l, e, r)) : c > Wr(n, e, r) ? (l = n + 1, c = 1) : l = n, { weekYear: l, weekNumber: c, weekday: o, ...Gn(t) };
6137
6137
  }
6138
- function Ff(t, e = 4, r = 1) {
6138
+ function Nd(t, e = 4, r = 1) {
6139
6139
  const { weekYear: n, weekNumber: s, weekday: i } = t, a = nc(rc(n, 1, e), r), o = nr(n);
6140
6140
  let c = s * 7 + i - a - 7 + e, l;
6141
6141
  c < 1 ? (l = n - 1, c += nr(l)) : c > o ? (l = n + 1, c -= nr(n)) : l = n;
6142
- const { month: u, day: f } = Ph(l, c);
6143
- return { year: l, month: u, day: f, ...Gn(t) };
6142
+ const { month: u, day: d } = Ph(l, c);
6143
+ return { year: l, month: u, day: d, ...Gn(t) };
6144
6144
  }
6145
6145
  function Ca(t) {
6146
6146
  const { year: e, month: r, day: n } = t, s = Dh(e, r, n);
6147
6147
  return { year: e, ordinal: s, ...Gn(t) };
6148
6148
  }
6149
- function Df(t) {
6149
+ function Fd(t) {
6150
6150
  const { year: e, ordinal: r } = t, { month: n, day: s } = Ph(e, r);
6151
6151
  return { year: e, month: n, day: s, ...Gn(t) };
6152
6152
  }
6153
- function Pf(t, e) {
6153
+ function Dd(t, e) {
6154
6154
  if (!J(t.localWeekday) || !J(t.localWeekNumber) || !J(t.localWeekYear)) {
6155
6155
  if (!J(t.weekday) || !J(t.weekNumber) || !J(t.weekYear))
6156
6156
  throw new tr(
@@ -6215,7 +6215,7 @@ function $h() {
6215
6215
  function T_(t) {
6216
6216
  return Array.isArray(t) ? t : [t];
6217
6217
  }
6218
- function Mf(t, e, r) {
6218
+ function Pd(t, e, r) {
6219
6219
  if (t.length !== 0)
6220
6220
  return t.reduce((n, s) => {
6221
6221
  const i = [e(s), s];
@@ -6225,7 +6225,7 @@ function Mf(t, e, r) {
6225
6225
  function R_(t, e) {
6226
6226
  return e.reduce((r, n) => (r[n] = t[n], r), {});
6227
6227
  }
6228
- function dr(t, e) {
6228
+ function fr(t, e) {
6229
6229
  return Object.prototype.hasOwnProperty.call(t, e);
6230
6230
  }
6231
6231
  function To(t) {
@@ -6305,11 +6305,11 @@ function Bn(t) {
6305
6305
  );
6306
6306
  return t.year < 100 && t.year >= 0 && (e = new Date(e), e.setUTCFullYear(t.year, t.month - 1, t.day)), +e;
6307
6307
  }
6308
- function qf(t, e, r) {
6308
+ function Md(t, e, r) {
6309
6309
  return -nc(rc(t, 1, e), r) + e - 1;
6310
6310
  }
6311
6311
  function Wr(t, e = 4, r = 1) {
6312
- const n = qf(t, e, r), s = qf(t + 1, e, r);
6312
+ const n = Md(t, e, r), s = Md(t + 1, e, r);
6313
6313
  return (nr(t) - n + s) / 7;
6314
6314
  }
6315
6315
  function Ro(t) {
@@ -6343,7 +6343,7 @@ function Vh(t) {
6343
6343
  function Cn(t, e) {
6344
6344
  const r = {};
6345
6345
  for (const n in t)
6346
- if (dr(t, n)) {
6346
+ if (fr(t, n)) {
6347
6347
  const s = t[n];
6348
6348
  if (s == null) continue;
6349
6349
  r[e(n)] = Vh(s);
@@ -6469,20 +6469,20 @@ function L_(t, e, r = "always", n = !1) {
6469
6469
  seconds: ["second", "sec."]
6470
6470
  }, i = ["hours", "minutes", "seconds"].indexOf(t) === -1;
6471
6471
  if (r === "auto" && i) {
6472
- const f = t === "days";
6472
+ const d = t === "days";
6473
6473
  switch (e) {
6474
6474
  case 1:
6475
- return f ? "tomorrow" : `next ${s[t][0]}`;
6475
+ return d ? "tomorrow" : `next ${s[t][0]}`;
6476
6476
  case -1:
6477
- return f ? "yesterday" : `last ${s[t][0]}`;
6477
+ return d ? "yesterday" : `last ${s[t][0]}`;
6478
6478
  case 0:
6479
- return f ? "today" : `this ${s[t][0]}`;
6479
+ return d ? "today" : `this ${s[t][0]}`;
6480
6480
  }
6481
6481
  }
6482
6482
  const a = Object.is(e, -0) || e < 0, o = Math.abs(e), c = o === 1, l = s[t], u = n ? c ? l[1] : l[2] || l[1] : c ? s[t][0] : t;
6483
6483
  return a ? `${o} ${u} ago` : `in ${o} ${u}`;
6484
6484
  }
6485
- function Lf(t, e) {
6485
+ function qd(t, e) {
6486
6486
  let r = "";
6487
6487
  for (const n of t)
6488
6488
  n.literal ? r += n.val : r += e(n.val);
@@ -6490,8 +6490,8 @@ function Lf(t, e) {
6490
6490
  }
6491
6491
  const $_ = {
6492
6492
  D: Sn,
6493
- DD: fh,
6494
- DDD: dh,
6493
+ DD: dh,
6494
+ DDD: fh,
6495
6495
  DDDD: hh,
6496
6496
  t: mh,
6497
6497
  tt: ph,
@@ -6563,7 +6563,7 @@ class De {
6563
6563
  ), u = (h) => {
6564
6564
  const p = De.macroTokenToFormatOpts(h);
6565
6565
  return p ? this.formatWithSystemDefault(e, p) : h;
6566
- }, f = (h) => n ? q_(e, h) : i({ era: h }, "era"), d = (h) => {
6566
+ }, d = (h) => n ? q_(e, h) : i({ era: h }, "era"), f = (h) => {
6567
6567
  switch (h) {
6568
6568
  // ms
6569
6569
  case "S":
@@ -6669,11 +6669,11 @@ class De {
6669
6669
  return s ? i({ year: "numeric" }, "year") : this.num(e.year, 6);
6670
6670
  // eras
6671
6671
  case "G":
6672
- return f("short");
6672
+ return d("short");
6673
6673
  case "GG":
6674
- return f("long");
6674
+ return d("long");
6675
6675
  case "GGGGG":
6676
- return f("narrow");
6676
+ return d("narrow");
6677
6677
  case "kk":
6678
6678
  return this.num(e.weekYear.toString().slice(-2), 2);
6679
6679
  case "kkkk":
@@ -6706,7 +6706,7 @@ class De {
6706
6706
  return u(h);
6707
6707
  }
6708
6708
  };
6709
- return Lf(De.parseFormat(r), d);
6709
+ return qd(De.parseFormat(r), f);
6710
6710
  }
6711
6711
  formatDurationFromString(e, r) {
6712
6712
  const n = this.opts.signMode === "negativeLargestOnly" ? -1 : 1, s = (u) => {
@@ -6730,16 +6730,16 @@ class De {
6730
6730
  default:
6731
6731
  return null;
6732
6732
  }
6733
- }, i = (u, f) => (d) => {
6734
- const h = s(d);
6733
+ }, i = (u, d) => (f) => {
6734
+ const h = s(f);
6735
6735
  if (h) {
6736
- const p = f.isNegativeDuration && h !== f.largestUnit ? n : 1;
6736
+ const p = d.isNegativeDuration && h !== d.largestUnit ? n : 1;
6737
6737
  let b;
6738
- return this.opts.signMode === "negativeLargestOnly" && h !== f.largestUnit ? b = "never" : this.opts.signMode === "all" ? b = "always" : b = "auto", this.num(u.get(h) * p, d.length, b);
6738
+ return this.opts.signMode === "negativeLargestOnly" && h !== d.largestUnit ? b = "never" : this.opts.signMode === "all" ? b = "always" : b = "auto", this.num(u.get(h) * p, f.length, b);
6739
6739
  } else
6740
- return d;
6740
+ return f;
6741
6741
  }, a = De.parseFormat(r), o = a.reduce(
6742
- (u, { literal: f, val: d }) => f ? u : u.concat(d),
6742
+ (u, { literal: d, val: f }) => d ? u : u.concat(f),
6743
6743
  []
6744
6744
  ), c = e.shiftTo(...o.map(s).filter((u) => u)), l = {
6745
6745
  isNegativeDuration: c < 0,
@@ -6747,7 +6747,7 @@ class De {
6747
6747
  // in order
6748
6748
  largestUnit: Object.keys(c.values)[0]
6749
6749
  };
6750
- return Lf(a, i(c, l));
6750
+ return qd(a, i(c, l));
6751
6751
  }
6752
6752
  }
6753
6753
  const Kh = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
@@ -6806,7 +6806,7 @@ function vr(t, e) {
6806
6806
  }, null, e + 4];
6807
6807
  }
6808
6808
  function Jr(t, e) {
6809
- const r = !t[e] && !t[e + 1], n = Zn(t[e + 1], t[e + 2]), s = r ? null : Me.instance(n);
6809
+ const r = !t[e] && !t[e + 1], n = Zn(t[e + 1], t[e + 2]), s = r ? null : qe.instance(n);
6810
6810
  return [{}, s, e + 3];
6811
6811
  }
6812
6812
  function Qr(t, e) {
@@ -6815,17 +6815,17 @@ function Qr(t, e) {
6815
6815
  }
6816
6816
  const K_ = RegExp(`^T?${ac.source}$`), Y_ = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;
6817
6817
  function J_(t) {
6818
- const [e, r, n, s, i, a, o, c, l] = t, u = e[0] === "-", f = c && c[0] === "-", d = (h, p = !1) => h !== void 0 && (p || h && u) ? -h : h;
6818
+ const [e, r, n, s, i, a, o, c, l] = t, u = e[0] === "-", d = c && c[0] === "-", f = (h, p = !1) => h !== void 0 && (p || h && u) ? -h : h;
6819
6819
  return [
6820
6820
  {
6821
- years: d(Mt(r)),
6822
- months: d(Mt(n)),
6823
- weeks: d(Mt(s)),
6824
- days: d(Mt(i)),
6825
- hours: d(Mt(a)),
6826
- minutes: d(Mt(o)),
6827
- seconds: d(Mt(c), c === "-0"),
6828
- milliseconds: d(sc(l), f)
6821
+ years: f(Mt(r)),
6822
+ months: f(Mt(n)),
6823
+ weeks: f(Mt(s)),
6824
+ days: f(Mt(i)),
6825
+ hours: f(Mt(a)),
6826
+ minutes: f(Mt(o)),
6827
+ seconds: f(Mt(c), c === "-0"),
6828
+ milliseconds: f(sc(l), d)
6829
6829
  }
6830
6830
  ];
6831
6831
  }
@@ -6864,22 +6864,22 @@ function ev(t) {
6864
6864
  c,
6865
6865
  l,
6866
6866
  u,
6867
- f
6868
- ] = t, d = cc(e, s, n, r, i, a, o);
6867
+ d
6868
+ ] = t, f = cc(e, s, n, r, i, a, o);
6869
6869
  let h;
6870
- return c ? h = Q_[c] : l ? h = 0 : h = Zn(u, f), [d, new Me(h)];
6870
+ return c ? h = Q_[c] : l ? h = 0 : h = Zn(u, d), [f, new qe(h)];
6871
6871
  }
6872
6872
  function tv(t) {
6873
6873
  return t.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
6874
6874
  }
6875
6875
  const rv = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, nv = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, sv = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;
6876
- function $f(t) {
6876
+ function Ld(t) {
6877
6877
  const [, e, r, n, s, i, a, o] = t;
6878
- return [cc(e, s, n, r, i, a, o), Me.utcInstance];
6878
+ return [cc(e, s, n, r, i, a, o), qe.utcInstance];
6879
6879
  }
6880
6880
  function iv(t) {
6881
6881
  const [, e, r, n, s, i, a, o] = t;
6882
- return [cc(e, o, r, n, s, i, a), Me.utcInstance];
6882
+ return [cc(e, o, r, n, s, i, a), qe.utcInstance];
6883
6883
  }
6884
6884
  const av = gr(V_, oc), ov = gr(U_, oc), cv = gr(W_, oc), lv = gr(Qh), em = yr(
6885
6885
  H_,
@@ -6891,12 +6891,12 @@ const av = gr(V_, oc), ov = gr(U_, oc), cv = gr(W_, oc), lv = gr(Qh), em = yr(
6891
6891
  vr,
6892
6892
  Jr,
6893
6893
  Qr
6894
- ), fv = yr(
6894
+ ), dv = yr(
6895
6895
  B_,
6896
6896
  vr,
6897
6897
  Jr,
6898
6898
  Qr
6899
- ), dv = yr(
6899
+ ), fv = yr(
6900
6900
  vr,
6901
6901
  Jr,
6902
6902
  Qr
@@ -6906,8 +6906,8 @@ function hv(t) {
6906
6906
  t,
6907
6907
  [av, em],
6908
6908
  [ov, uv],
6909
- [cv, fv],
6910
- [lv, dv]
6909
+ [cv, dv],
6910
+ [lv, fv]
6911
6911
  );
6912
6912
  }
6913
6913
  function mv(t) {
@@ -6916,8 +6916,8 @@ function mv(t) {
6916
6916
  function pv(t) {
6917
6917
  return _r(
6918
6918
  t,
6919
- [rv, $f],
6920
- [nv, $f],
6919
+ [rv, Ld],
6920
+ [nv, Ld],
6921
6921
  [sv, iv]
6922
6922
  );
6923
6923
  }
@@ -6940,7 +6940,7 @@ function Ov(t) {
6940
6940
  [wv, bv]
6941
6941
  );
6942
6942
  }
6943
- const jf = "Invalid Duration", tm = {
6943
+ const $d = "Invalid Duration", tm = {
6944
6944
  weeks: {
6945
6945
  days: 7,
6946
6946
  hours: 168,
@@ -7026,7 +7026,7 @@ const jf = "Invalid Duration", tm = {
7026
7026
  "seconds",
7027
7027
  "milliseconds"
7028
7028
  ], Tv = Vt.slice(0).reverse();
7029
- function dt(t, e, r = !1) {
7029
+ function ft(t, e, r = !1) {
7030
7030
  const n = {
7031
7031
  values: r ? e.values : { ...t.values, ...e.values || {} },
7032
7032
  loc: t.loc.clone(e.loc),
@@ -7041,7 +7041,7 @@ function rm(t, e) {
7041
7041
  e[n] && (r += e[n] * t[n].milliseconds);
7042
7042
  return r;
7043
7043
  }
7044
- function Vf(t, e) {
7044
+ function jd(t, e) {
7045
7045
  const r = rm(t, e) < 0 ? -1 : 1;
7046
7046
  Vt.reduceRight((n, s) => {
7047
7047
  if (J(e[s]))
@@ -7061,7 +7061,7 @@ function Vf(t, e) {
7061
7061
  return s;
7062
7062
  }, null);
7063
7063
  }
7064
- function Uf(t) {
7064
+ function Vd(t) {
7065
7065
  const e = {};
7066
7066
  for (const [r, n] of Object.entries(t))
7067
7067
  n !== 0 && (e[r] = n);
@@ -7274,7 +7274,7 @@ class le {
7274
7274
  ...r,
7275
7275
  floor: r.round !== !1 && r.floor !== !1
7276
7276
  };
7277
- return this.isValid ? De.create(this.loc, n).formatDurationFromString(this, e) : jf;
7277
+ return this.isValid ? De.create(this.loc, n).formatDurationFromString(this, e) : $d;
7278
7278
  }
7279
7279
  /**
7280
7280
  * Returns a string representation of a Duration with all units included.
@@ -7293,7 +7293,7 @@ class le {
7293
7293
  * ```
7294
7294
  */
7295
7295
  toHuman(e = {}) {
7296
- if (!this.isValid) return jf;
7296
+ if (!this.isValid) return $d;
7297
7297
  const r = e.showZeros !== !1, n = Vt.map((s) => {
7298
7298
  const i = this.values[s];
7299
7299
  return J(i) || i === 0 && !r ? null : this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...e, unit: s.slice(0, -1) }).format(i);
@@ -7395,8 +7395,8 @@ class le {
7395
7395
  if (!this.isValid) return this;
7396
7396
  const r = le.fromDurationLike(e), n = {};
7397
7397
  for (const s of Vt)
7398
- (dr(r.values, s) || dr(this.values, s)) && (n[s] = r.get(s) + this.get(s));
7399
- return dt(this, { values: n }, !0);
7398
+ (fr(r.values, s) || fr(this.values, s)) && (n[s] = r.get(s) + this.get(s));
7399
+ return ft(this, { values: n }, !0);
7400
7400
  }
7401
7401
  /**
7402
7402
  * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.
@@ -7420,7 +7420,7 @@ class le {
7420
7420
  const r = {};
7421
7421
  for (const n of Object.keys(this.values))
7422
7422
  r[n] = Vh(e(this.values[n], n));
7423
- return dt(this, { values: r }, !0);
7423
+ return ft(this, { values: r }, !0);
7424
7424
  }
7425
7425
  /**
7426
7426
  * Get the value of unit.
@@ -7443,7 +7443,7 @@ class le {
7443
7443
  set(e) {
7444
7444
  if (!this.isValid) return this;
7445
7445
  const r = { ...this.values, ...Cn(e, le.normalizeUnit) };
7446
- return dt(this, { values: r });
7446
+ return ft(this, { values: r });
7447
7447
  }
7448
7448
  /**
7449
7449
  * "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration.
@@ -7452,7 +7452,7 @@ class le {
7452
7452
  */
7453
7453
  reconfigure({ locale: e, numberingSystem: r, conversionAccuracy: n, matrix: s } = {}) {
7454
7454
  const a = { loc: this.loc.clone({ locale: e, numberingSystem: r }), matrix: s, conversionAccuracy: n };
7455
- return dt(this, a);
7455
+ return ft(this, a);
7456
7456
  }
7457
7457
  /**
7458
7458
  * Return the length of the duration in the specified unit.
@@ -7483,7 +7483,7 @@ class le {
7483
7483
  normalize() {
7484
7484
  if (!this.isValid) return this;
7485
7485
  const e = this.toObject();
7486
- return Vf(this.matrix, e), dt(this, { values: e }, !0);
7486
+ return jd(this.matrix, e), ft(this, { values: e }, !0);
7487
7487
  }
7488
7488
  /**
7489
7489
  * Rescale units to its largest representation
@@ -7492,8 +7492,8 @@ class le {
7492
7492
  */
7493
7493
  rescale() {
7494
7494
  if (!this.isValid) return this;
7495
- const e = Uf(this.normalize().shiftToAll().toObject());
7496
- return dt(this, { values: e }, !0);
7495
+ const e = Vd(this.normalize().shiftToAll().toObject());
7496
+ return ft(this, { values: e }, !0);
7497
7497
  }
7498
7498
  /**
7499
7499
  * Convert this Duration into its representation in a different set of units.
@@ -7519,7 +7519,7 @@ class le {
7519
7519
  } else It(s[a]) && (n[a] = s[a]);
7520
7520
  for (const a in n)
7521
7521
  n[a] !== 0 && (r[i] += a === i ? n[a] : n[a] / this.matrix[i][a]);
7522
- return Vf(this.matrix, r), dt(this, { values: r }, !0);
7522
+ return jd(this.matrix, r), ft(this, { values: r }, !0);
7523
7523
  }
7524
7524
  /**
7525
7525
  * Shift this Duration to all available units.
@@ -7548,7 +7548,7 @@ class le {
7548
7548
  const e = {};
7549
7549
  for (const r of Object.keys(this.values))
7550
7550
  e[r] = this.values[r] === 0 ? 0 : -this.values[r];
7551
- return dt(this, { values: e }, !0);
7551
+ return ft(this, { values: e }, !0);
7552
7552
  }
7553
7553
  /**
7554
7554
  * Removes all units with values equal to 0 from this Duration.
@@ -7557,8 +7557,8 @@ class le {
7557
7557
  */
7558
7558
  removeZeros() {
7559
7559
  if (!this.isValid) return this;
7560
- const e = Uf(this.values);
7561
- return dt(this, { values: e }, !0);
7560
+ const e = Vd(this.values);
7561
+ return ft(this, { values: e }, !0);
7562
7562
  }
7563
7563
  /**
7564
7564
  * Get the years.
@@ -8301,7 +8301,7 @@ class an {
8301
8301
  return { relative: Lh(), localeWeek: $h() };
8302
8302
  }
8303
8303
  }
8304
- function Wf(t, e) {
8304
+ function Ud(t, e) {
8305
8305
  const r = (s) => s.toUTC(0, { keepLocalTime: !0 }).startOf("day").valueOf(), n = r(e) - r(t);
8306
8306
  return Math.floor(le.fromMillis(n).as("days"));
8307
8307
  }
@@ -8313,11 +8313,11 @@ function Cv(t, e, r) {
8313
8313
  [
8314
8314
  "weeks",
8315
8315
  (c, l) => {
8316
- const u = Wf(c, l);
8316
+ const u = Ud(c, l);
8317
8317
  return (u - u % 7) / 7;
8318
8318
  }
8319
8319
  ],
8320
- ["days", Wf]
8320
+ ["days", Ud]
8321
8321
  ], s = {}, i = t;
8322
8322
  let a, o;
8323
8323
  for (const [c, l] of n)
@@ -8327,30 +8327,30 @@ function Cv(t, e, r) {
8327
8327
  function Av(t, e, r, n) {
8328
8328
  let [s, i, a, o] = Cv(t, e, r);
8329
8329
  const c = e - s, l = r.filter(
8330
- (f) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(f) >= 0
8330
+ (d) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(d) >= 0
8331
8331
  );
8332
8332
  l.length === 0 && (a < e && (a = s.plus({ [o]: 1 })), a !== s && (i[o] = (i[o] || 0) + c / (a - s)));
8333
8333
  const u = le.fromObject(i, n);
8334
8334
  return l.length > 0 ? le.fromMillis(c, n).shiftTo(...l).plus(u) : u;
8335
8335
  }
8336
8336
  const kv = "missing Intl.DateTimeFormat.formatToParts support";
8337
- function de(t, e = (r) => r) {
8337
+ function fe(t, e = (r) => r) {
8338
8338
  return { regex: t, deser: ([r]) => e(v_(r)) };
8339
8339
  }
8340
8340
  const Iv = " ", nm = `[ ${Iv}]`, sm = new RegExp(nm, "g");
8341
8341
  function xv(t) {
8342
8342
  return t.replace(/\./g, "\\.?").replace(sm, nm);
8343
8343
  }
8344
- function zf(t) {
8344
+ function Wd(t) {
8345
8345
  return t.replace(/\./g, "").replace(sm, " ").toLowerCase();
8346
8346
  }
8347
8347
  function tt(t, e) {
8348
8348
  return t === null ? null : {
8349
8349
  regex: RegExp(t.map(xv).join("|")),
8350
- deser: ([r]) => t.findIndex((n) => zf(r) === zf(n)) + e
8350
+ deser: ([r]) => t.findIndex((n) => Wd(r) === Wd(n)) + e
8351
8351
  };
8352
8352
  }
8353
- function Bf(t, e) {
8353
+ function zd(t, e) {
8354
8354
  return { regex: t, deser: ([, r, n]) => Zn(r, n), groups: e };
8355
8355
  }
8356
8356
  function on(t) {
@@ -8360,7 +8360,7 @@ function Nv(t) {
8360
8360
  return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
8361
8361
  }
8362
8362
  function Fv(t, e) {
8363
- const r = et(e), n = et(e, "{2}"), s = et(e, "{3}"), i = et(e, "{4}"), a = et(e, "{6}"), o = et(e, "{1,2}"), c = et(e, "{1,3}"), l = et(e, "{1,6}"), u = et(e, "{1,9}"), f = et(e, "{2,4}"), d = et(e, "{4,6}"), h = (g) => ({ regex: RegExp(Nv(g.val)), deser: ([O]) => O, literal: !0 }), b = ((g) => {
8363
+ const r = et(e), n = et(e, "{2}"), s = et(e, "{3}"), i = et(e, "{4}"), a = et(e, "{6}"), o = et(e, "{1,2}"), c = et(e, "{1,3}"), l = et(e, "{1,6}"), u = et(e, "{1,9}"), d = et(e, "{2,4}"), f = et(e, "{4,6}"), h = (g) => ({ regex: RegExp(Nv(g.val)), deser: ([O]) => O, literal: !0 }), b = ((g) => {
8364
8364
  if (t.literal)
8365
8365
  return h(g);
8366
8366
  switch (g.val) {
@@ -8371,90 +8371,90 @@ function Fv(t, e) {
8371
8371
  return tt(e.eras("long"), 0);
8372
8372
  // years
8373
8373
  case "y":
8374
- return de(l);
8374
+ return fe(l);
8375
8375
  case "yy":
8376
- return de(f, Ro);
8376
+ return fe(d, Ro);
8377
8377
  case "yyyy":
8378
- return de(i);
8378
+ return fe(i);
8379
8379
  case "yyyyy":
8380
- return de(d);
8380
+ return fe(f);
8381
8381
  case "yyyyyy":
8382
- return de(a);
8382
+ return fe(a);
8383
8383
  // months
8384
8384
  case "M":
8385
- return de(o);
8385
+ return fe(o);
8386
8386
  case "MM":
8387
- return de(n);
8387
+ return fe(n);
8388
8388
  case "MMM":
8389
8389
  return tt(e.months("short", !0), 1);
8390
8390
  case "MMMM":
8391
8391
  return tt(e.months("long", !0), 1);
8392
8392
  case "L":
8393
- return de(o);
8393
+ return fe(o);
8394
8394
  case "LL":
8395
- return de(n);
8395
+ return fe(n);
8396
8396
  case "LLL":
8397
8397
  return tt(e.months("short", !1), 1);
8398
8398
  case "LLLL":
8399
8399
  return tt(e.months("long", !1), 1);
8400
8400
  // dates
8401
8401
  case "d":
8402
- return de(o);
8402
+ return fe(o);
8403
8403
  case "dd":
8404
- return de(n);
8404
+ return fe(n);
8405
8405
  // ordinals
8406
8406
  case "o":
8407
- return de(c);
8407
+ return fe(c);
8408
8408
  case "ooo":
8409
- return de(s);
8409
+ return fe(s);
8410
8410
  // time
8411
8411
  case "HH":
8412
- return de(n);
8412
+ return fe(n);
8413
8413
  case "H":
8414
- return de(o);
8414
+ return fe(o);
8415
8415
  case "hh":
8416
- return de(n);
8416
+ return fe(n);
8417
8417
  case "h":
8418
- return de(o);
8418
+ return fe(o);
8419
8419
  case "mm":
8420
- return de(n);
8420
+ return fe(n);
8421
8421
  case "m":
8422
- return de(o);
8422
+ return fe(o);
8423
8423
  case "q":
8424
- return de(o);
8424
+ return fe(o);
8425
8425
  case "qq":
8426
- return de(n);
8426
+ return fe(n);
8427
8427
  case "s":
8428
- return de(o);
8428
+ return fe(o);
8429
8429
  case "ss":
8430
- return de(n);
8430
+ return fe(n);
8431
8431
  case "S":
8432
- return de(c);
8432
+ return fe(c);
8433
8433
  case "SSS":
8434
- return de(s);
8434
+ return fe(s);
8435
8435
  case "u":
8436
8436
  return on(u);
8437
8437
  case "uu":
8438
8438
  return on(o);
8439
8439
  case "uuu":
8440
- return de(r);
8440
+ return fe(r);
8441
8441
  // meridiem
8442
8442
  case "a":
8443
8443
  return tt(e.meridiems(), 0);
8444
8444
  // weekYear (k)
8445
8445
  case "kkkk":
8446
- return de(i);
8446
+ return fe(i);
8447
8447
  case "kk":
8448
- return de(f, Ro);
8448
+ return fe(d, Ro);
8449
8449
  // weekNumber (W)
8450
8450
  case "W":
8451
- return de(o);
8451
+ return fe(o);
8452
8452
  case "WW":
8453
- return de(n);
8453
+ return fe(n);
8454
8454
  // weekdays
8455
8455
  case "E":
8456
8456
  case "c":
8457
- return de(r);
8457
+ return fe(r);
8458
8458
  case "EEE":
8459
8459
  return tt(e.weekdays("short", !1), 1);
8460
8460
  case "EEEE":
@@ -8466,9 +8466,9 @@ function Fv(t, e) {
8466
8466
  // offset/zone
8467
8467
  case "Z":
8468
8468
  case "ZZ":
8469
- return Bf(new RegExp(`([+-]${o.source})(?::(${n.source}))?`), 2);
8469
+ return zd(new RegExp(`([+-]${o.source})(?::(${n.source}))?`), 2);
8470
8470
  case "ZZZ":
8471
- return Bf(new RegExp(`([+-]${o.source})(${n.source})?`), 2);
8471
+ return zd(new RegExp(`([+-]${o.source})(${n.source})?`), 2);
8472
8472
  // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing
8473
8473
  // because we don't have any way to figure out what they are
8474
8474
  case "z":
@@ -8555,7 +8555,7 @@ function qv(t, e, r) {
8555
8555
  const s = {};
8556
8556
  let i = 1;
8557
8557
  for (const a in r)
8558
- if (dr(r, a)) {
8558
+ if (fr(r, a)) {
8559
8559
  const o = r[a], c = o.groups ? o.groups + 1 : 1;
8560
8560
  !o.literal && o.token && (s[o.token.val[0]] = o.deser(n.slice(i, i + c))), i += c;
8561
8561
  }
@@ -8598,7 +8598,7 @@ function Lv(t) {
8598
8598
  }
8599
8599
  };
8600
8600
  let r = null, n;
8601
- return J(t.z) || (r = _t.create(t.z)), J(t.Z) || (r || (r = new Me(t.Z)), n = t.Z), J(t.q) || (t.M = (t.q - 1) * 3 + 1), J(t.h) || (t.h < 12 && t.a === 1 ? t.h += 12 : t.h === 12 && t.a === 0 && (t.h = 0)), t.G === 0 && t.y && (t.y = -t.y), J(t.u) || (t.S = sc(t.u)), [Object.keys(t).reduce((i, a) => {
8601
+ return J(t.z) || (r = _t.create(t.z)), J(t.Z) || (r || (r = new qe(t.Z)), n = t.Z), J(t.q) || (t.M = (t.q - 1) * 3 + 1), J(t.h) || (t.h < 12 && t.a === 1 ? t.h += 12 : t.h === 12 && t.a === 0 && (t.h = 0)), t.G === 0 && t.y && (t.y = -t.y), J(t.u) || (t.S = sc(t.u)), [Object.keys(t).reduce((i, a) => {
8602
8602
  const o = e(a);
8603
8603
  return o && (i[o] = t[a]), i;
8604
8604
  }, {}), r, n];
@@ -8626,7 +8626,7 @@ class am {
8626
8626
  explainFromTokens(e) {
8627
8627
  if (this.isValid) {
8628
8628
  const [r, n] = qv(e, this.regex, this.handlers), [s, i, a] = n ? Lv(n) : [null, null, void 0];
8629
- if (dr(n, "a") && dr(n, "H"))
8629
+ if (fr(n, "a") && fr(n, "H"))
8630
8630
  throw new tr(
8631
8631
  "Can't include meridiem when specifying 24-hour format"
8632
8632
  );
@@ -8663,7 +8663,7 @@ function cm(t, e) {
8663
8663
  const n = De.create(e, t).dtFormatter($v()), s = n.formatToParts(), i = n.resolvedOptions();
8664
8664
  return s.map((a) => Pv(a, t, i));
8665
8665
  }
8666
- const ka = "Invalid DateTime", Zf = 864e13;
8666
+ const ka = "Invalid DateTime", Bd = 864e13;
8667
8667
  function Ir(t) {
8668
8668
  return new nt("unsupported zone", `the zone "${t.name}" is not supported`);
8669
8669
  }
@@ -8710,10 +8710,10 @@ function cn(t, e) {
8710
8710
  millisecond: r.getUTCMilliseconds()
8711
8711
  };
8712
8712
  }
8713
- function fn(t, e, r) {
8713
+ function dn(t, e, r) {
8714
8714
  return lm(Bn(t), e, r);
8715
8715
  }
8716
- function Gf(t, e) {
8716
+ function Zd(t, e) {
8717
8717
  const r = t.o, n = t.c.year + Math.trunc(e.years), s = t.c.month + Math.trunc(e.months) + Math.trunc(e.quarters) * 3, i = {
8718
8718
  ...t.c,
8719
8719
  year: n,
@@ -8763,7 +8763,7 @@ function Na(t, e, r) {
8763
8763
  } else if (s += Ce(t.c.month), r === "month") return s;
8764
8764
  return s += Ce(t.c.day), s;
8765
8765
  }
8766
- function Hf(t, e, r, n, s, i, a) {
8766
+ function Gd(t, e, r, n, s, i, a) {
8767
8767
  let o = !r || t.c.millisecond !== 0 || t.c.second !== 0, c = "";
8768
8768
  switch (a) {
8769
8769
  case "day":
@@ -8804,7 +8804,7 @@ const um = {
8804
8804
  minute: 0,
8805
8805
  second: 0,
8806
8806
  millisecond: 0
8807
- }, dn = ["year", "month", "day", "hour", "minute", "second", "millisecond"], zv = [
8807
+ }, fn = ["year", "month", "day", "hour", "minute", "second", "millisecond"], zv = [
8808
8808
  "weekYear",
8809
8809
  "weekNumber",
8810
8810
  "weekday",
@@ -8843,7 +8843,7 @@ function hn(t) {
8843
8843
  if (!e) throw new uh(t);
8844
8844
  return e;
8845
8845
  }
8846
- function Kf(t) {
8846
+ function Hd(t) {
8847
8847
  switch (t.toLowerCase()) {
8848
8848
  case "localweekday":
8849
8849
  case "localweekdays":
@@ -8865,7 +8865,7 @@ function Zv(t) {
8865
8865
  let r = Co.get(e);
8866
8866
  return r === void 0 && (r = t.offset(xr), Co.set(e, r)), r;
8867
8867
  }
8868
- function Yf(t, e) {
8868
+ function Kd(t, e) {
8869
8869
  const r = At(e.zone, Se.defaultZone);
8870
8870
  if (!r.isValid)
8871
8871
  return G.invalid(Ir(r));
@@ -8874,17 +8874,17 @@ function Yf(t, e) {
8874
8874
  if (J(t.year))
8875
8875
  s = Se.now();
8876
8876
  else {
8877
- for (const c of dn)
8877
+ for (const c of fn)
8878
8878
  J(t[c]) && (t[c] = um[c]);
8879
8879
  const a = Mh(t) || qh(t);
8880
8880
  if (a)
8881
8881
  return G.invalid(a);
8882
8882
  const o = Zv(r);
8883
- [s, i] = fn(t, o, r);
8883
+ [s, i] = dn(t, o, r);
8884
8884
  }
8885
8885
  return new G({ ts: s, zone: r, loc: n, o: i });
8886
8886
  }
8887
- function Jf(t, e, r) {
8887
+ function Yd(t, e, r) {
8888
8888
  const n = J(r.round) ? !0 : r.round, s = J(r.rounding) ? "trunc" : r.rounding, i = (o, c) => (o = ic(o, n || r.calendary ? 0 : 2, r.calendary ? "round" : s), e.loc.clone(r).relFormatter(r).format(o, c)), a = (o) => r.calendary ? e.hasSame(t, o) ? 0 : e.startOf(o).diff(t.startOf(o), o).get(o) : e.diff(t, o).get(o);
8889
8889
  if (r.unit)
8890
8890
  return i(a(r.unit), r.unit);
@@ -8895,7 +8895,7 @@ function Jf(t, e, r) {
8895
8895
  }
8896
8896
  return i(t > e ? -0 : 0, r.units[r.units.length - 1]);
8897
8897
  }
8898
- function Qf(t) {
8898
+ function Jd(t) {
8899
8899
  let e = {}, r;
8900
8900
  return t.length > 0 && typeof t[t.length - 1] == "object" ? (e = t[t.length - 1], r = Array.from(t).slice(0, t.length - 1)) : r = Array.from(t), [e, r];
8901
8901
  }
@@ -8952,8 +8952,8 @@ class G {
8952
8952
  * @return {DateTime}
8953
8953
  */
8954
8954
  static local() {
8955
- const [e, r] = Qf(arguments), [n, s, i, a, o, c, l] = r;
8956
- return Yf({ year: n, month: s, day: i, hour: a, minute: o, second: c, millisecond: l }, e);
8955
+ const [e, r] = Jd(arguments), [n, s, i, a, o, c, l] = r;
8956
+ return Kd({ year: n, month: s, day: i, hour: a, minute: o, second: c, millisecond: l }, e);
8957
8957
  }
8958
8958
  /**
8959
8959
  * Create a DateTime in UTC
@@ -8981,8 +8981,8 @@ class G {
8981
8981
  * @return {DateTime}
8982
8982
  */
8983
8983
  static utc() {
8984
- const [e, r] = Qf(arguments), [n, s, i, a, o, c, l] = r;
8985
- return e.zone = Me.utcInstance, Yf({ year: n, month: s, day: i, hour: a, minute: o, second: c, millisecond: l }, e);
8984
+ const [e, r] = Jd(arguments), [n, s, i, a, o, c, l] = r;
8985
+ return e.zone = qe.utcInstance, Kd({ year: n, month: s, day: i, hour: a, minute: o, second: c, millisecond: l }, e);
8986
8986
  }
8987
8987
  /**
8988
8988
  * Create a DateTime from a JavaScript Date object. Uses the default zone.
@@ -9015,7 +9015,7 @@ class G {
9015
9015
  */
9016
9016
  static fromMillis(e, r = {}) {
9017
9017
  if (It(e))
9018
- return e < -Zf || e > Zf ? G.invalid("Timestamp out of range") : new G({
9018
+ return e < -Bd || e > Bd ? G.invalid("Timestamp out of range") : new G({
9019
9019
  ts: e,
9020
9020
  zone: At(r.zone, Se.defaultZone),
9021
9021
  loc: me.fromObject(r)
@@ -9082,16 +9082,16 @@ class G {
9082
9082
  const n = At(r.zone, Se.defaultZone);
9083
9083
  if (!n.isValid)
9084
9084
  return G.invalid(Ir(n));
9085
- const s = me.fromObject(r), i = Cn(e, Kf), { minDaysInFirstWeek: a, startOfWeek: o } = Pf(i, s), c = Se.now(), l = J(r.specificOffset) ? n.offset(c) : r.specificOffset, u = !J(i.ordinal), f = !J(i.year), d = !J(i.month) || !J(i.day), h = f || d, p = i.weekYear || i.weekNumber;
9085
+ const s = me.fromObject(r), i = Cn(e, Hd), { minDaysInFirstWeek: a, startOfWeek: o } = Dd(i, s), c = Se.now(), l = J(r.specificOffset) ? n.offset(c) : r.specificOffset, u = !J(i.ordinal), d = !J(i.year), f = !J(i.month) || !J(i.day), h = d || f, p = i.weekYear || i.weekNumber;
9086
9086
  if ((h || u) && p)
9087
9087
  throw new tr(
9088
9088
  "Can't mix weekYear/weekNumber units with year/month/day or ordinals"
9089
9089
  );
9090
- if (d && u)
9090
+ if (f && u)
9091
9091
  throw new tr("Can't mix ordinal dates with month/day");
9092
9092
  const b = p || i.weekday && !h;
9093
9093
  let g, O, S = cn(c, l);
9094
- b ? (g = zv, O = Uv, S = Tn(S, a, o)) : u ? (g = Bv, O = Wv, S = Ca(S)) : (g = dn, O = um);
9094
+ b ? (g = zv, O = Uv, S = Tn(S, a, o)) : u ? (g = Bv, O = Wv, S = Ca(S)) : (g = fn, O = um);
9095
9095
  let C = !1;
9096
9096
  for (const v of g) {
9097
9097
  const w = i[v];
@@ -9100,7 +9100,7 @@ class G {
9100
9100
  const x = b ? b_(i, a, o) : u ? O_(i) : Mh(i), y = x || qh(i);
9101
9101
  if (y)
9102
9102
  return G.invalid(y);
9103
- const E = b ? Ff(i, a, o) : u ? Df(i) : i, [R, _] = fn(E, l, n), N = new G({
9103
+ const E = b ? Nd(i, a, o) : u ? Fd(i) : i, [R, _] = dn(E, l, n), N = new G({
9104
9104
  ts: R,
9105
9105
  zone: n,
9106
9106
  o: _,
@@ -9570,8 +9570,8 @@ class G {
9570
9570
  const e = 864e5, r = 6e4, n = Bn(this.c), s = this.zone.offset(n - e), i = this.zone.offset(n + e), a = this.zone.offset(n - s * r), o = this.zone.offset(n - i * r);
9571
9571
  if (a === o)
9572
9572
  return [this];
9573
- const c = n - a * r, l = n - o * r, u = cn(c, a), f = cn(l, o);
9574
- return u.hour === f.hour && u.minute === f.minute && u.second === f.second && u.millisecond === f.millisecond ? [qt(this, { ts: c }), qt(this, { ts: l })] : [this];
9573
+ const c = n - a * r, l = n - o * r, u = cn(c, a), d = cn(l, o);
9574
+ return u.hour === d.hour && u.minute === d.minute && u.second === d.second && u.millisecond === d.millisecond ? [qt(this, { ts: c }), qt(this, { ts: l })] : [this];
9575
9575
  }
9576
9576
  /**
9577
9577
  * Returns true if this DateTime is in a leap year, false otherwise
@@ -9646,7 +9646,7 @@ class G {
9646
9646
  * @return {DateTime}
9647
9647
  */
9648
9648
  toUTC(e = 0, r = {}) {
9649
- return this.setZone(Me.instance(e), r);
9649
+ return this.setZone(qe.instance(e), r);
9650
9650
  }
9651
9651
  /**
9652
9652
  * "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.
@@ -9673,7 +9673,7 @@ class G {
9673
9673
  let s = this.ts;
9674
9674
  if (r || n) {
9675
9675
  const i = e.offset(this.ts), a = this.toObject();
9676
- [s] = fn(a, i, e);
9676
+ [s] = dn(a, i, e);
9677
9677
  }
9678
9678
  return qt(this, { ts: s, zone: e });
9679
9679
  } else
@@ -9713,21 +9713,21 @@ class G {
9713
9713
  */
9714
9714
  set(e) {
9715
9715
  if (!this.isValid) return this;
9716
- const r = Cn(e, Kf), { minDaysInFirstWeek: n, startOfWeek: s } = Pf(r, this.loc), i = !J(r.weekYear) || !J(r.weekNumber) || !J(r.weekday), a = !J(r.ordinal), o = !J(r.year), c = !J(r.month) || !J(r.day), l = o || c, u = r.weekYear || r.weekNumber;
9716
+ const r = Cn(e, Hd), { minDaysInFirstWeek: n, startOfWeek: s } = Dd(r, this.loc), i = !J(r.weekYear) || !J(r.weekNumber) || !J(r.weekday), a = !J(r.ordinal), o = !J(r.year), c = !J(r.month) || !J(r.day), l = o || c, u = r.weekYear || r.weekNumber;
9717
9717
  if ((l || a) && u)
9718
9718
  throw new tr(
9719
9719
  "Can't mix weekYear/weekNumber units with year/month/day or ordinals"
9720
9720
  );
9721
9721
  if (c && a)
9722
9722
  throw new tr("Can't mix ordinal dates with month/day");
9723
- let f;
9724
- i ? f = Ff(
9723
+ let d;
9724
+ i ? d = Nd(
9725
9725
  { ...Tn(this.c, n, s), ...r },
9726
9726
  n,
9727
9727
  s
9728
- ) : J(r.ordinal) ? (f = { ...this.toObject(), ...r }, J(r.day) && (f.day = Math.min(Rn(f.year, f.month), f.day))) : f = Df({ ...Ca(this.c), ...r });
9729
- const [d, h] = fn(f, this.o, this.zone);
9730
- return qt(this, { ts: d, o: h });
9728
+ ) : J(r.ordinal) ? (d = { ...this.toObject(), ...r }, J(r.day) && (d.day = Math.min(Rn(d.year, d.month), d.day))) : d = Fd({ ...Ca(this.c), ...r });
9729
+ const [f, h] = dn(d, this.o, this.zone);
9730
+ return qt(this, { ts: f, o: h });
9731
9731
  }
9732
9732
  /**
9733
9733
  * Add a period of time to this DateTime and return the resulting DateTime
@@ -9745,7 +9745,7 @@ class G {
9745
9745
  plus(e) {
9746
9746
  if (!this.isValid) return this;
9747
9747
  const r = le.fromDurationLike(e);
9748
- return qt(this, Gf(this, r));
9748
+ return qt(this, Zd(this, r));
9749
9749
  }
9750
9750
  /**
9751
9751
  * Subtract a period of time to this DateTime and return the resulting DateTime
@@ -9756,7 +9756,7 @@ class G {
9756
9756
  minus(e) {
9757
9757
  if (!this.isValid) return this;
9758
9758
  const r = le.fromDurationLike(e).negate();
9759
- return qt(this, Gf(this, r));
9759
+ return qt(this, Zd(this, r));
9760
9760
  }
9761
9761
  /**
9762
9762
  * "Set" this DateTime to the beginning of a unit of time.
@@ -9906,7 +9906,7 @@ class G {
9906
9906
  a = hn(a);
9907
9907
  const o = e === "extended";
9908
9908
  let c = Na(this, o, a);
9909
- return dn.indexOf(a) >= 3 && (c += "T"), c += Hf(
9909
+ return fn.indexOf(a) >= 3 && (c += "T"), c += Gd(
9910
9910
  this,
9911
9911
  o,
9912
9912
  r,
@@ -9963,7 +9963,7 @@ class G {
9963
9963
  format: a = "extended",
9964
9964
  precision: o = "milliseconds"
9965
9965
  } = {}) {
9966
- return this.isValid ? (o = hn(o), (s && dn.indexOf(o) >= 3 ? "T" : "") + Hf(
9966
+ return this.isValid ? (o = hn(o), (s && fn.indexOf(o) >= 3 ? "T" : "") + Gd(
9967
9967
  this,
9968
9968
  a === "extended",
9969
9969
  r,
@@ -10197,7 +10197,7 @@ class G {
10197
10197
  if (!this.isValid) return null;
10198
10198
  const r = e.base || G.fromObject({}, { zone: this.zone }), n = e.padding ? this < r ? -e.padding : e.padding : 0;
10199
10199
  let s = ["years", "months", "days", "hours", "minutes", "seconds"], i = e.unit;
10200
- return Array.isArray(e.unit) && (s = e.unit, i = void 0), Jf(r, this.plus(n), {
10200
+ return Array.isArray(e.unit) && (s = e.unit, i = void 0), Yd(r, this.plus(n), {
10201
10201
  ...e,
10202
10202
  numeric: "always",
10203
10203
  units: s,
@@ -10218,7 +10218,7 @@ class G {
10218
10218
  * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago"
10219
10219
  */
10220
10220
  toRelativeCalendar(e = {}) {
10221
- return this.isValid ? Jf(e.base || G.fromObject({}, { zone: this.zone }), this, {
10221
+ return this.isValid ? Yd(e.base || G.fromObject({}, { zone: this.zone }), this, {
10222
10222
  ...e,
10223
10223
  numeric: "auto",
10224
10224
  units: ["years", "months", "days"],
@@ -10233,7 +10233,7 @@ class G {
10233
10233
  static min(...e) {
10234
10234
  if (!e.every(G.isDateTime))
10235
10235
  throw new Fe("min requires all arguments be DateTimes");
10236
- return Mf(e, (r) => r.valueOf(), Math.min);
10236
+ return Pd(e, (r) => r.valueOf(), Math.min);
10237
10237
  }
10238
10238
  /**
10239
10239
  * Return the max of several date times
@@ -10243,7 +10243,7 @@ class G {
10243
10243
  static max(...e) {
10244
10244
  if (!e.every(G.isDateTime))
10245
10245
  throw new Fe("max requires all arguments be DateTimes");
10246
- return Mf(e, (r) => r.valueOf(), Math.max);
10246
+ return Pd(e, (r) => r.valueOf(), Math.max);
10247
10247
  }
10248
10248
  // MISC
10249
10249
  /**
@@ -10334,7 +10334,7 @@ class G {
10334
10334
  * @type {Object}
10335
10335
  */
10336
10336
  static get DATE_MED() {
10337
- return fh;
10337
+ return dh;
10338
10338
  }
10339
10339
  /**
10340
10340
  * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'
@@ -10348,7 +10348,7 @@ class G {
10348
10348
  * @type {Object}
10349
10349
  */
10350
10350
  static get DATE_FULL() {
10351
- return dh;
10351
+ return fh;
10352
10352
  }
10353
10353
  /**
10354
10354
  * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'
@@ -10488,18 +10488,18 @@ function Er(t) {
10488
10488
  `Unknown datetime argument: ${t}, of type ${typeof t}`
10489
10489
  );
10490
10490
  }
10491
- const Xf = async (t, e) => {
10491
+ const Qd = async (t, e) => {
10492
10492
  if (t) {
10493
10493
  const r = await be(t, [e]);
10494
10494
  if (!r.valid)
10495
10495
  throw new Error(r.message);
10496
10496
  }
10497
- }, fm = async (t, e, r, n, s, i) => {
10498
- await Xf(n.custom?.preValidate, s);
10497
+ }, dm = async (t, e, r, n, s, i) => {
10498
+ await Qd(n.custom?.preValidate, s);
10499
10499
  for (const o of n.fields)
10500
- await Xf(o.custom?.preValidate, s);
10500
+ await Qd(o.custom?.preValidate, s);
10501
10501
  return Hy(t, r, i).parse(e), e;
10502
- }, lc = (t, e, r, n, s, i, a, o, c, l, u, f, d, h, p, b, g, O, S, C, x) => {
10502
+ }, lc = (t, e, r, n, s, i, a, o, c, l, u, d, f, h, p, b, g, O, S, C, x) => {
10503
10503
  const { fields: y } = a;
10504
10504
  y.filter((_) => "unique" in _ && _.unique).forEach((_) => {
10505
10505
  t !== "delete" && (typeof s[_.name] == "string" || typeof s[_.name] == "number") && e.set(h(_, s[_.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||")), {
@@ -10507,11 +10507,11 @@ const Xf = async (t, e) => {
10507
10507
  Collection_Path: r
10508
10508
  });
10509
10509
  }), y.forEach((_) => {
10510
- if (dy(_, a, i)) {
10510
+ if (fy(_, a, i)) {
10511
10511
  const N = py(_, a, i), v = {};
10512
10512
  s[_.name] !== void 0 && (v[_.name] = s[_.name], we(_) && (v[`${_.name}_Array`] = s[`${_.name}_Array`])), N.forEach((w) => {
10513
10513
  s[w.name] !== void 0 && (we(w) ? v[`${w.name}_Array`] = s[`${w.name}_Array`] : v[w.name] = s[w.name]);
10514
- }), Object.keys(v).length > 0 && (t === "create" && (v.Collection_Path = r, v.Collection_Path_String = r.join("/"), e.set(d(_), v)), t === "update" && e.update(d(_), v), t === "delete" && e.delete(d(_)));
10514
+ }), Object.keys(v).length > 0 && (t === "create" && (v.Collection_Path = r, v.Collection_Path_String = r.join("/"), e.set(f(_), v)), t === "update" && e.update(f(_), v), t === "delete" && e.delete(f(_)));
10515
10515
  }
10516
10516
  });
10517
10517
  const E = c[a.labels.collection];
@@ -10533,10 +10533,10 @@ const Xf = async (t, e) => {
10533
10533
  throw new Error("VALIDATION_ERROR: batchSize is required");
10534
10534
  }
10535
10535
  };
10536
- var Fa, ed;
10536
+ var Fa, Xd;
10537
10537
  function Gv() {
10538
- if (ed) return Fa;
10539
- ed = 1;
10538
+ if (Xd) return Fa;
10539
+ Xd = 1;
10540
10540
  function t(e, r) {
10541
10541
  for (var n = -1, s = e == null ? 0 : e.length; ++n < s && r(e[n], n, e) !== !1; )
10542
10542
  ;
@@ -10544,71 +10544,71 @@ function Gv() {
10544
10544
  }
10545
10545
  return Fa = t, Fa;
10546
10546
  }
10547
- var Da, td;
10547
+ var Da, ef;
10548
10548
  function Hv() {
10549
- if (td) return Da;
10550
- td = 1;
10549
+ if (ef) return Da;
10550
+ ef = 1;
10551
10551
  var t = Zr(), e = Bo();
10552
10552
  function r(n, s) {
10553
10553
  return n && t(s, e(s), n);
10554
10554
  }
10555
10555
  return Da = r, Da;
10556
10556
  }
10557
- var Pa, rd;
10557
+ var Pa, tf;
10558
10558
  function Kv() {
10559
- if (rd) return Pa;
10560
- rd = 1;
10559
+ if (tf) return Pa;
10560
+ tf = 1;
10561
10561
  var t = Zr(), e = Gr();
10562
10562
  function r(n, s) {
10563
10563
  return n && t(s, e(s), n);
10564
10564
  }
10565
10565
  return Pa = r, Pa;
10566
10566
  }
10567
- var Ma, nd;
10567
+ var Ma, rf;
10568
10568
  function Yv() {
10569
- if (nd) return Ma;
10570
- nd = 1;
10569
+ if (rf) return Ma;
10570
+ rf = 1;
10571
10571
  var t = Zr(), e = $o();
10572
10572
  function r(n, s) {
10573
10573
  return t(n, e(n), s);
10574
10574
  }
10575
10575
  return Ma = r, Ma;
10576
10576
  }
10577
- var qa, sd;
10578
- function dm() {
10579
- if (sd) return qa;
10580
- sd = 1;
10581
- var t = Ld(), e = Ho(), r = $o(), n = jd(), s = Object.getOwnPropertySymbols, i = s ? function(a) {
10577
+ var qa, nf;
10578
+ function fm() {
10579
+ if (nf) return qa;
10580
+ nf = 1;
10581
+ var t = Lf(), e = Ho(), r = $o(), n = jf(), s = Object.getOwnPropertySymbols, i = s ? function(a) {
10582
10582
  for (var o = []; a; )
10583
10583
  t(o, r(a)), a = e(a);
10584
10584
  return o;
10585
10585
  } : n;
10586
10586
  return qa = i, qa;
10587
10587
  }
10588
- var La, id;
10588
+ var La, sf;
10589
10589
  function Jv() {
10590
- if (id) return La;
10591
- id = 1;
10592
- var t = Zr(), e = dm();
10590
+ if (sf) return La;
10591
+ sf = 1;
10592
+ var t = Zr(), e = fm();
10593
10593
  function r(n, s) {
10594
10594
  return t(n, e(n), s);
10595
10595
  }
10596
10596
  return La = r, La;
10597
10597
  }
10598
- var $a, ad;
10598
+ var $a, af;
10599
10599
  function Qv() {
10600
- if (ad) return $a;
10601
- ad = 1;
10602
- var t = $d(), e = dm(), r = Gr();
10600
+ if (af) return $a;
10601
+ af = 1;
10602
+ var t = $f(), e = fm(), r = Gr();
10603
10603
  function n(s) {
10604
10604
  return t(s, r, e);
10605
10605
  }
10606
10606
  return $a = n, $a;
10607
10607
  }
10608
- var ja, od;
10608
+ var ja, of;
10609
10609
  function Xv() {
10610
- if (od) return ja;
10611
- od = 1;
10610
+ if (of) return ja;
10611
+ of = 1;
10612
10612
  var t = Object.prototype, e = t.hasOwnProperty;
10613
10613
  function r(n) {
10614
10614
  var s = n.length, i = new n.constructor(s);
@@ -10616,10 +10616,10 @@ function Xv() {
10616
10616
  }
10617
10617
  return ja = r, ja;
10618
10618
  }
10619
- var Va, cd;
10619
+ var Va, cf;
10620
10620
  function ew() {
10621
- if (cd) return Va;
10622
- cd = 1;
10621
+ if (cf) return Va;
10622
+ cf = 1;
10623
10623
  var t = Go();
10624
10624
  function e(r, n) {
10625
10625
  var s = n ? t(r.buffer) : r.buffer;
@@ -10627,10 +10627,10 @@ function ew() {
10627
10627
  }
10628
10628
  return Va = e, Va;
10629
10629
  }
10630
- var Ua, ld;
10630
+ var Ua, lf;
10631
10631
  function tw() {
10632
- if (ld) return Ua;
10633
- ld = 1;
10632
+ if (lf) return Ua;
10633
+ lf = 1;
10634
10634
  var t = /\w*$/;
10635
10635
  function e(r) {
10636
10636
  var n = new r.constructor(r.source, t.exec(r));
@@ -10638,21 +10638,21 @@ function tw() {
10638
10638
  }
10639
10639
  return Ua = e, Ua;
10640
10640
  }
10641
- var Wa, ud;
10641
+ var Wa, uf;
10642
10642
  function rw() {
10643
- if (ud) return Wa;
10644
- ud = 1;
10643
+ if (uf) return Wa;
10644
+ uf = 1;
10645
10645
  var t = Br(), e = t ? t.prototype : void 0, r = e ? e.valueOf : void 0;
10646
10646
  function n(s) {
10647
10647
  return r ? Object(r.call(s)) : {};
10648
10648
  }
10649
10649
  return Wa = n, Wa;
10650
10650
  }
10651
- var za, fd;
10651
+ var za, df;
10652
10652
  function nw() {
10653
- if (fd) return za;
10654
- fd = 1;
10655
- var t = Go(), e = ew(), r = tw(), n = rw(), s = Yd(), 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]", b = "[object Float32Array]", g = "[object Float64Array]", O = "[object Int8Array]", S = "[object Int16Array]", C = "[object Int32Array]", x = "[object Uint8Array]", y = "[object Uint8ClampedArray]", E = "[object Uint16Array]", R = "[object Uint32Array]";
10653
+ if (df) return za;
10654
+ df = 1;
10655
+ var t = Go(), e = ew(), r = tw(), n = rw(), s = Yf(), i = "[object Boolean]", a = "[object Date]", o = "[object Map]", c = "[object Number]", l = "[object RegExp]", u = "[object Set]", d = "[object String]", f = "[object Symbol]", h = "[object ArrayBuffer]", p = "[object DataView]", b = "[object Float32Array]", g = "[object Float64Array]", O = "[object Int8Array]", S = "[object Int16Array]", C = "[object Int32Array]", x = "[object Uint8Array]", y = "[object Uint8ClampedArray]", E = "[object Uint16Array]", R = "[object Uint32Array]";
10656
10656
  function _(N, v, w) {
10657
10657
  var I = N.constructor;
10658
10658
  switch (v) {
@@ -10676,101 +10676,101 @@ function nw() {
10676
10676
  case o:
10677
10677
  return new I();
10678
10678
  case c:
10679
- case f:
10679
+ case d:
10680
10680
  return new I(N);
10681
10681
  case l:
10682
10682
  return r(N);
10683
10683
  case u:
10684
10684
  return new I();
10685
- case d:
10685
+ case f:
10686
10686
  return n(N);
10687
10687
  }
10688
10688
  }
10689
10689
  return za = _, za;
10690
10690
  }
10691
- var Ba, dd;
10691
+ var Ba, ff;
10692
10692
  function sw() {
10693
- if (dd) return Ba;
10694
- dd = 1;
10693
+ if (ff) return Ba;
10694
+ ff = 1;
10695
10695
  var t = Vn(), e = wt(), r = "[object Map]";
10696
10696
  function n(s) {
10697
10697
  return e(s) && t(s) == r;
10698
10698
  }
10699
10699
  return Ba = n, Ba;
10700
10700
  }
10701
- var Za, hd;
10701
+ var Za, hf;
10702
10702
  function iw() {
10703
- if (hd) return Za;
10704
- hd = 1;
10703
+ if (hf) return Za;
10704
+ hf = 1;
10705
10705
  var t = sw(), e = Vo(), r = Uo(), n = r && r.isMap, s = n ? e(n) : t;
10706
10706
  return Za = s, Za;
10707
10707
  }
10708
- var Ga, md;
10708
+ var Ga, mf;
10709
10709
  function aw() {
10710
- if (md) return Ga;
10711
- md = 1;
10710
+ if (mf) return Ga;
10711
+ mf = 1;
10712
10712
  var t = Vn(), e = wt(), r = "[object Set]";
10713
10713
  function n(s) {
10714
10714
  return e(s) && t(s) == r;
10715
10715
  }
10716
10716
  return Ga = n, Ga;
10717
10717
  }
10718
- var Ha, pd;
10718
+ var Ha, pf;
10719
10719
  function ow() {
10720
- if (pd) return Ha;
10721
- pd = 1;
10720
+ if (pf) return Ha;
10721
+ pf = 1;
10722
10722
  var t = aw(), e = Vo(), r = Uo(), n = r && r.isSet, s = n ? e(n) : t;
10723
10723
  return Ha = s, Ha;
10724
10724
  }
10725
- var Ka, gd;
10725
+ var Ka, gf;
10726
10726
  function cw() {
10727
- if (gd) return Ka;
10728
- gd = 1;
10729
- var t = Lo(), e = Gv(), r = Ko(), n = Hv(), s = Kv(), i = Kd(), a = Jd(), o = Yv(), c = Jv(), l = Bd(), u = Qv(), f = Vn(), d = Xv(), h = nw(), p = Qd(), b = Ft(), g = $n(), O = iw(), S = vt(), C = ow(), x = Bo(), y = Gr(), E = 1, R = 2, _ = 4, N = "[object Arguments]", v = "[object Array]", w = "[object Boolean]", I = "[object Date]", m = "[object Error]", T = "[object Function]", A = "[object GeneratorFunction]", L = "[object Map]", k = "[object Number]", M = "[object Object]", F = "[object RegExp]", Z = "[object Set]", re = "[object String]", oe = "[object Symbol]", z = "[object WeakMap]", V = "[object ArrayBuffer]", K = "[object DataView]", xe = "[object Float32Array]", Te = "[object Float64Array]", Xe = "[object Int8Array]", bt = "[object Int16Array]", br = "[object Int32Array]", q = "[object Uint8Array]", Y = "[object Uint8ClampedArray]", U = "[object Uint16Array]", H = "[object Uint32Array]", D = {};
10727
+ if (gf) return Ka;
10728
+ gf = 1;
10729
+ var t = Lo(), e = Gv(), r = Ko(), n = Hv(), s = Kv(), i = Kf(), a = Jf(), o = Yv(), c = Jv(), l = Bf(), u = Qv(), d = Vn(), f = Xv(), h = nw(), p = Qf(), b = Ft(), g = $n(), O = iw(), S = vt(), C = ow(), x = Bo(), y = Gr(), E = 1, R = 2, _ = 4, N = "[object Arguments]", v = "[object Array]", w = "[object Boolean]", I = "[object Date]", m = "[object Error]", T = "[object Function]", A = "[object GeneratorFunction]", L = "[object Map]", k = "[object Number]", M = "[object Object]", F = "[object RegExp]", Z = "[object Set]", re = "[object String]", oe = "[object Symbol]", z = "[object WeakMap]", V = "[object ArrayBuffer]", K = "[object DataView]", xe = "[object Float32Array]", Te = "[object Float64Array]", Xe = "[object Int8Array]", bt = "[object Int16Array]", br = "[object Int32Array]", q = "[object Uint8Array]", Y = "[object Uint8ClampedArray]", U = "[object Uint16Array]", H = "[object Uint32Array]", D = {};
10730
10730
  D[N] = D[v] = D[V] = D[K] = D[w] = D[I] = D[xe] = D[Te] = D[Xe] = D[bt] = D[br] = D[L] = D[k] = D[M] = D[F] = D[Z] = D[re] = D[oe] = D[q] = D[Y] = D[U] = D[H] = !0, D[m] = D[T] = D[z] = !1;
10731
- function ue(X, pe, _e, ae, Le, $e) {
10731
+ function ue(X, pe, _e, ae, $e, je) {
10732
10732
  var ke, Gt = pe & E, Or = pe & R, Ne = pe & _;
10733
- if (_e && (ke = Le ? _e(X, ae, Le, $e) : _e(X)), ke !== void 0)
10733
+ if (_e && (ke = $e ? _e(X, ae, $e, je) : _e(X)), ke !== void 0)
10734
10734
  return ke;
10735
10735
  if (!S(X))
10736
10736
  return X;
10737
10737
  var Ht = b(X);
10738
10738
  if (Ht) {
10739
- if (ke = d(X), !Gt)
10739
+ if (ke = f(X), !Gt)
10740
10740
  return a(X, ke);
10741
10741
  } else {
10742
- var Kt = f(X), bc = Kt == T || Kt == A;
10742
+ var Kt = d(X), bc = Kt == T || Kt == A;
10743
10743
  if (g(X))
10744
10744
  return i(X, Gt);
10745
- if (Kt == M || Kt == N || bc && !Le) {
10745
+ if (Kt == M || Kt == N || bc && !$e) {
10746
10746
  if (ke = Or || bc ? {} : p(X), !Gt)
10747
10747
  return Or ? c(X, s(ke, X)) : o(X, n(ke, X));
10748
10748
  } else {
10749
10749
  if (!D[Kt])
10750
- return Le ? X : {};
10750
+ return $e ? X : {};
10751
10751
  ke = h(X, Kt, Gt);
10752
10752
  }
10753
10753
  }
10754
- $e || ($e = new t());
10755
- var Oc = $e.get(X);
10754
+ je || (je = new t());
10755
+ var Oc = je.get(X);
10756
10756
  if (Oc)
10757
10757
  return Oc;
10758
- $e.set(X, ke), C(X) ? X.forEach(function(Ot) {
10759
- ke.add(ue(Ot, pe, _e, Ot, X, $e));
10758
+ je.set(X, ke), C(X) ? X.forEach(function(Ot) {
10759
+ ke.add(ue(Ot, pe, _e, Ot, X, je));
10760
10760
  }) : O(X) && X.forEach(function(Ot, Pt) {
10761
- ke.set(Pt, ue(Ot, pe, _e, Pt, X, $e));
10761
+ ke.set(Pt, ue(Ot, pe, _e, Pt, X, je));
10762
10762
  });
10763
10763
  var Dm = Ne ? Or ? u : l : Or ? y : x, Ec = Ht ? void 0 : Dm(X);
10764
10764
  return e(Ec || X, function(Ot, Pt) {
10765
- Ec && (Pt = Ot, Ot = X[Pt]), r(ke, Pt, ue(Ot, pe, _e, Pt, X, $e));
10765
+ Ec && (Pt = Ot, Ot = X[Pt]), r(ke, Pt, ue(Ot, pe, _e, Pt, X, je));
10766
10766
  }), ke;
10767
10767
  }
10768
10768
  return Ka = ue, Ka;
10769
10769
  }
10770
- var Ya, yd;
10770
+ var Ya, yf;
10771
10771
  function lw() {
10772
- if (yd) return Ya;
10773
- yd = 1;
10772
+ if (yf) return Ya;
10773
+ yf = 1;
10774
10774
  var t = cw(), e = 1, r = 4;
10775
10775
  function n(s) {
10776
10776
  return t(s, e | r);
@@ -10781,7 +10781,7 @@ var uw = lw();
10781
10781
  const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
10782
10782
  for (const e in t)
10783
10783
  Object.prototype.hasOwnProperty.call(t, e) && (t[e] === void 0 ? delete t[e] : typeof t[e] == "object" && t[e] !== null && xt(t[e]));
10784
- }, fw = (t, e) => {
10784
+ }, dw = (t, e) => {
10785
10785
  let r, n;
10786
10786
  if (typeof t.start == "object")
10787
10787
  r = t.start;
@@ -10814,7 +10814,7 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
10814
10814
  typeof t.end == "number" && (s = s.plus({ days: t.end })), t.endOffsetDays && (s = s.plus({ days: t.endOffsetDays })), t.endOffsetHours && (s = s.plus({ hours: t.endOffsetHours })), n = s.toJSDate();
10815
10815
  }
10816
10816
  return { start: r, end: n };
10817
- }, dw = (t) => {
10817
+ }, fw = (t) => {
10818
10818
  if (t = t.toString(), /[/]|^\.+$|^__.*__$/.test(t))
10819
10819
  return !1;
10820
10820
  try {
@@ -10853,7 +10853,7 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
10853
10853
  if (e = e.replace(/\0/g, ""), e = e.replace(/[\x00-\x08\x0B-\x1F\x7F]/g, ""), e = e.trim(), e.length > 998)
10854
10854
  throw new Error("Email subject is too long");
10855
10855
  return e;
10856
- }, _d = (t) => {
10856
+ }, _f = (t) => {
10857
10857
  if (!t || typeof t != "string")
10858
10858
  return "";
10859
10859
  let e = t.replace(/\0/g, "");
@@ -10867,10 +10867,10 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
10867
10867
  const r = ze(), n = Dt(), s = We(), i = Pe(), a = t.at(-1);
10868
10868
  if (!a)
10869
10869
  throw new Error("EMPTY_PATH");
10870
- const o = s.collections[a], { labels: c, fields: l, preloadCache: u } = o, f = ft(a), d = i.collections?.[c.collection];
10870
+ const o = s.collections[a], { labels: c, fields: l, preloadCache: u } = o, d = dt(a), f = i.collections?.[c.collection];
10871
10871
  if (!i.Role)
10872
10872
  throw new Error("PERMISSION_DENIED");
10873
- const h = d && ct("Read", d), p = Fn(o, s, i), b = xd(o, i), g = Do(o, i), O = Nd(o, s, i), S = (m = []) => {
10873
+ const h = f && ct("Read", f), p = Fn(o, s, i), b = xf(o, i), g = Do(o, i), O = Nf(o, s, i), S = (m = []) => {
10874
10874
  const T = [];
10875
10875
  if (h)
10876
10876
  T.push(he($r(r, "tenants", n, "system_fields", c.collection, `${c.collection}-${e.key}`), ye("Collection_Path_String", "==", t.join("/")), ...m));
@@ -10895,7 +10895,7 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
10895
10895
  }
10896
10896
  }
10897
10897
  u?.roles.includes(i.Role) && u.range && y(u.range.fields.length);
10898
- const E = f.admin?.statusField;
10898
+ const E = d.admin?.statusField;
10899
10899
  E && !u?.roles.includes(i.Role) && y(Math.max(E.active?.length || 0, E.archived?.length || 0));
10900
10900
  const R = x === 0 ? 30 : Math.max(1, Math.floor(30 / x)), _ = [];
10901
10901
  C.filter((m) => m.type === "Record_Owner").forEach(() => _.push(ye("Created_By", "==", i.User_ID))), C.filter((m) => m.type === "Record_User").forEach((m) => {
@@ -10914,7 +10914,7 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
10914
10914
  });
10915
10915
  const N = [];
10916
10916
  g.filter((m) => m.type === "Individual").forEach((m) => {
10917
- const T = d?.individualEntities, A = [];
10917
+ const T = f?.individualEntities, A = [];
10918
10918
  if (T) {
10919
10919
  const L = m.singleQuery ? m.singleQuery : R;
10920
10920
  for (let k = 0; k < T.length; k += L) {
@@ -10964,7 +10964,7 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
10964
10964
  if ("collectionField" in m) {
10965
10965
  const T = te(l, m.collectionField);
10966
10966
  if ("collection" in T) {
10967
- const A = d?.parentEntities, L = [];
10967
+ const A = f?.parentEntities, L = [];
10968
10968
  if (A) {
10969
10969
  const k = m.singleQuery ? m.singleQuery : R;
10970
10970
  for (let M = 0; M < A.length; M += k) {
@@ -11016,7 +11016,7 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
11016
11016
  if ("collectionField" in m && "propertyField" in m) {
11017
11017
  const T = te(l, m.collectionField), A = te(l, m.propertyField);
11018
11018
  if ("collection" in T) {
11019
- const L = d?.parentPropertyEntities || {};
11019
+ const L = f?.parentPropertyEntities || {};
11020
11020
  Object.entries(L).forEach(([k, M]) => {
11021
11021
  if (M.length > 0) {
11022
11022
  const F = [];
@@ -11079,14 +11079,14 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
11079
11079
  n.includes(s) || r.includes(s) || await ir(s, t?.[s].constraints, t?.[s].range, t?.[s].orQueries, t);
11080
11080
  return Nr;
11081
11081
  }, Ao = () => pm, pw = () => Nr, gw = async (t, e, r, n, s) => {
11082
- const { labels: i, preloadCache: a } = t, c = Xr()[i.collection], l = Ie(), u = ft(i.collection), f = Pe();
11083
- if (!f?.Role)
11082
+ const { labels: i, preloadCache: a } = t, c = Xr()[i.collection], l = Ie(), u = dt(i.collection), d = Pe();
11083
+ if (!d?.Role)
11084
11084
  throw new Error("PERMISSION_DENIED");
11085
- if (!a?.roles.includes(f.Role))
11085
+ if (!a?.roles.includes(d.Role))
11086
11086
  return;
11087
- const d = pw();
11087
+ const f = pw();
11088
11088
  let h = i.collection;
11089
- s && (h = s, d[h] ||= []), d[h] && d[h].forEach((g) => g()), await ne(l, ["global", "timezone"]), e ||= await ne(u, [
11089
+ s && (h = s, f[h] ||= []), f[h] && f[h].forEach((g) => g()), await ne(l, ["global", "timezone"]), e ||= await ne(u, [
11090
11090
  "collections",
11091
11091
  i.collection,
11092
11092
  "custom",
@@ -11099,7 +11099,7 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
11099
11099
  ]), s || (r ||= a.range);
11100
11100
  const p = uc([i.collection], c).map((g) => {
11101
11101
  if (r) {
11102
- const { start: O, end: S } = fw(r), C = r.fields.filter((y) => !r.ranges?.some((E) => E.includes(y))).map((y) => tn(ye(y, ">=", O), ye(y, "<=", S))), x = r.ranges?.map((y) => tn(ye(y[0], "<=", S), ye(y[1], ">=", O)));
11102
+ const { start: O, end: S } = dw(r), C = r.fields.filter((y) => !r.ranges?.some((E) => E.includes(y))).map((y) => tn(ye(y, ">=", O), ye(y, "<=", S))), x = r.ranges?.map((y) => tn(ye(y[0], "<=", S), ye(y[1], ">=", O)));
11103
11103
  g = he(g, Ac(...C, ...x || []));
11104
11104
  }
11105
11105
  return n && (g = he(g, tn(Ac(...n.map((O) => ye(...O)))))), e && (g = he(g, tn(...e.map((O) => ye(...O))))), g;
@@ -11116,23 +11116,23 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
11116
11116
  }, (y) => {
11117
11117
  console.error(`${h} - ${y.message}`), O(y);
11118
11118
  });
11119
- d[h].push(x);
11119
+ f[h].push(x);
11120
11120
  });
11121
11121
  });
11122
11122
  }, ir = async (t, e, r, n, s, i) => {
11123
11123
  const a = We(), o = Pe();
11124
11124
  if (!o?.Role)
11125
11125
  throw new Error("PERMISSION_DENIED");
11126
- const c = a.collections[t], { labels: l, preloadCache: u } = c, f = Ao();
11127
- let d = l.collection;
11128
- if (i && (d = i), f[d] === "Loading" || !u?.roles.includes(o.Role))
11126
+ const c = a.collections[t], { labels: l, preloadCache: u } = c, d = Ao();
11127
+ let f = l.collection;
11128
+ if (i && (f = i), d[f] === "Loading" || !u?.roles.includes(o.Role))
11129
11129
  return;
11130
11130
  const h = o.collections?.[t];
11131
11131
  if (!(h && ct("Read", h) || Fn(c, a, o).length > 0)) {
11132
- f[d] = "Error";
11132
+ d[f] = "Error";
11133
11133
  return;
11134
11134
  }
11135
- f[d] = "Loading";
11135
+ d[f] = "Loading";
11136
11136
  const p = new Event(`stoker:loading:${t}`);
11137
11137
  document.dispatchEvent(p);
11138
11138
  try {
@@ -11148,11 +11148,11 @@ const ve = /* @__PURE__ */ Dn(uw), xt = (t) => {
11148
11148
  x || await ir(S, void 0, void 0, void 0, s);
11149
11149
  }
11150
11150
  }
11151
- f[d] = "Loaded";
11151
+ d[f] = "Loaded";
11152
11152
  const b = new Event(`stoker:loaded:${t}`);
11153
11153
  document.dispatchEvent(b);
11154
11154
  } catch (b) {
11155
- throw f[d] = "Error", b;
11155
+ throw d[f] = "Error", b;
11156
11156
  }
11157
11157
  };
11158
11158
  let Lt = null;
@@ -11161,8 +11161,8 @@ const yw = async (t, e) => {
11161
11161
  if (!e.claims.doc)
11162
11162
  throw new Error("User document ID not found in claims");
11163
11163
  let o = !1, c = null;
11164
- return await new Promise((u, f) => {
11165
- const d = mr(Ae(s, "tenants", n, "system_user_permissions", t.uid), (h) => {
11164
+ return await new Promise((u, d) => {
11165
+ const f = mr(Ae(s, "tenants", n, "system_user_permissions", t.uid), (h) => {
11166
11166
  if (h.exists()) {
11167
11167
  if (Lt = h.data(), Lt.User_ID = h.id, !Lt.Role)
11168
11168
  throw new Error("PERMISSION_DENIED");
@@ -11184,20 +11184,20 @@ const yw = async (t, e) => {
11184
11184
  }
11185
11185
  c = Lt;
11186
11186
  } else
11187
- f(new Error("Permissions not found"));
11187
+ d(new Error("Permissions not found"));
11188
11188
  }, (h) => {
11189
- f(new Error(`Error getting permissions for user ${t.uid}`, { cause: h }));
11189
+ d(new Error(`Error getting permissions for user ${t.uid}`, { cause: h }));
11190
11190
  });
11191
- r.push(d);
11191
+ r.push(f);
11192
11192
  }), r;
11193
11193
  }, Pe = () => Lt, _w = () => {
11194
11194
  Lt = null;
11195
- }, fc = (t) => {
11195
+ }, dc = (t) => {
11196
11196
  if (typeof t == "object")
11197
11197
  for (const e in t)
11198
- Object.prototype.hasOwnProperty.call(t, e) && (ar(t[e]) ? t[e] = "_DELETE_FIELD" : fc(t[e]));
11198
+ Object.prototype.hasOwnProperty.call(t, e) && (ar(t[e]) ? t[e] = "_DELETE_FIELD" : dc(t[e]));
11199
11199
  }, Ye = async (t, e, r, n, s, i, a, o, c) => {
11200
- const l = Dt(), { labels: u } = i, f = Ie(), d = wc(), h = await ne(f, ["global", "firebase", "writeLogTTL"]), p = {
11200
+ const l = Dt(), { labels: u } = i, d = Ie(), f = wc(), h = await ne(d, ["global", "firebase", "writeLogTTL"]), p = {
11201
11201
  operation: t,
11202
11202
  collection: u.collection,
11203
11203
  docId: s,
@@ -11216,12 +11216,12 @@ const yw = async (t, e) => {
11216
11216
  p.TTL = zt.fromDate(C);
11217
11217
  }
11218
11218
  const b = ve(r);
11219
- t !== "delete" && (p.data.data = b, e === "written" && fc(p.data.data)), t !== "delete" && e !== "written" && rr(b), t === "update" && (p.data.originalRecord = ve(c)), t !== "delete" && ["started", "written"].includes(e) && (delete p.data.data.Saved_At, delete p.data.data.Last_Save_At), e === "failed" && (p.data.error = JSON.stringify(o));
11220
- const g = r.Last_Write_At, O = Ae(d, "tenants", l, n.join("/"), s, "system_write_log", `${a}-${g.valueOf()}`);
11219
+ t !== "delete" && (p.data.data = b, e === "written" && dc(p.data.data)), t !== "delete" && e !== "written" && rr(b), t === "update" && (p.data.originalRecord = ve(c)), t !== "delete" && ["started", "written"].includes(e) && (delete p.data.data.Saved_At, delete p.data.data.Last_Save_At), e === "failed" && (p.data.error = JSON.stringify(o));
11220
+ const g = r.Last_Write_At, O = Ae(f, "tenants", l, n.join("/"), s, "system_write_log", `${a}-${g.valueOf()}`);
11221
11221
  Jm(O, p).catch((S) => {
11222
11222
  console.error(`Error saving "${e}" ${t} log entry for record ${s} in ${u.collection} collection.`, { cause: S });
11223
11223
  });
11224
- }, dc = async (t, e, r, n, s) => {
11224
+ }, fc = async (t, e, r, n, s) => {
11225
11225
  const i = Dt(), a = ze(), o = n.labels.collection, c = n.fields.filter((u) => "unique" in u && u.unique), l = [];
11226
11226
  if (!s.Role)
11227
11227
  throw new Error("No role found in permissions");
@@ -11229,13 +11229,13 @@ const yw = async (t, e) => {
11229
11229
  if (!u.access || u.access.includes(s.Role)) {
11230
11230
  if (r[u.name] === void 0 || ar(r[u.name]))
11231
11231
  return;
11232
- const f = r[u.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||");
11233
- if (!dw(f))
11232
+ const d = r[u.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||");
11233
+ if (!fw(d))
11234
11234
  l.push(`${u.name} "${r[u.name]}" is invalid`);
11235
11235
  else {
11236
- const d = await Rd(Ae(a, "tenants", i, "system_unique", o, `Unique-${o}-${u.name}`, f)).catch(() => {
11236
+ const f = await Rf(Ae(a, "tenants", i, "system_unique", o, `Unique-${o}-${u.name}`, d)).catch(() => {
11237
11237
  });
11238
- d?.exists() && !(t === "update" && d.data().id === e) && l.push(`${u.name} "${r[u.name]}" already exists`);
11238
+ f?.exists() && !(t === "update" && f.data().id === e) && l.push(`${u.name} "${r[u.name]}" already exists`);
11239
11239
  }
11240
11240
  }
11241
11241
  })), l.length > 0)
@@ -11247,17 +11247,17 @@ const yw = async (t, e) => {
11247
11247
  const c = i.collections[o], { labels: l } = c, u = a.collections?.[l.collection];
11248
11248
  if (!a.Role)
11249
11249
  throw new Error("PERMISSION_DENIED");
11250
- const f = u && ct("Read", u), d = Fn(c, i, a), h = [];
11251
- if (f)
11250
+ const d = u && ct("Read", u), f = Fn(c, i, a), h = [];
11251
+ if (d)
11252
11252
  h.push(Ae(n, "tenants", s, "system_fields", l.collection, `${l.collection}-${r.key}`, e));
11253
- else if (d)
11254
- for (const p of d)
11253
+ else if (f)
11254
+ for (const p of f)
11255
11255
  h.push(Ae(n, "tenants", s, "system_fields", l.collection, `${l.collection}-${p.field}`, e));
11256
11256
  return h;
11257
- }, vd = (t) => t !== null && typeof t == "object" && !Array.isArray(t), ym = (t) => {
11257
+ }, vf = (t) => t !== null && typeof t == "object" && !Array.isArray(t), ym = (t) => {
11258
11258
  const e = (r) => {
11259
11259
  Object.entries(r).forEach(([n, s]) => {
11260
- vd(s) && Object.keys(s).length === 2 && typeof s._seconds == "number" && typeof s._nanoseconds == "number" ? r[n] = new zt(s._seconds, s._nanoseconds) : vd(s) && e(s);
11260
+ vf(s) && Object.keys(s).length === 2 && typeof s._seconds == "number" && typeof s._nanoseconds == "number" ? r[n] = new zt(s._seconds, s._nanoseconds) : vf(s) && e(s);
11261
11261
  });
11262
11262
  };
11263
11263
  e(t);
@@ -11272,15 +11272,15 @@ const yw = async (t, e) => {
11272
11272
  stream: !0
11273
11273
  });
11274
11274
  else {
11275
- const { stream: u, data: f } = await o.stream({
11275
+ const { stream: u, data: d } = await o.stream({
11276
11276
  path: t,
11277
11277
  constraints: a,
11278
11278
  options: r,
11279
11279
  stream: !0
11280
11280
  });
11281
- for await (const d of u)
11282
- console.log(d.data.result.records.length);
11283
- c = { data: await f };
11281
+ for await (const f of u)
11282
+ console.log(f.data.result.records.length);
11283
+ c = { data: await d };
11284
11284
  }
11285
11285
  const l = c.data;
11286
11286
  for (const u of l.result.records)
@@ -11290,29 +11290,29 @@ const yw = async (t, e) => {
11290
11290
  const o = Pe();
11291
11291
  if (!o)
11292
11292
  throw new Error("PERMISSIONS_NOT_FOUND");
11293
- const c = e.at(-2), l = Fd(n.collections[c], n, o).map((d) => d.labels.collection);
11294
- r.collections ? r.collections.forEach((d) => {
11295
- if (!l.includes(d))
11296
- throw new Error(`SCHEMA_ERROR: Collection ${d} not found in subcollections of ${c}`);
11293
+ const c = e.at(-2), l = Ff(n.collections[c], n, o).map((f) => f.labels.collection);
11294
+ r.collections ? r.collections.forEach((f) => {
11295
+ if (!l.includes(f))
11296
+ throw new Error(`SCHEMA_ERROR: Collection ${f} not found in subcollections of ${c}`);
11297
11297
  }) : r.collections = l;
11298
- const u = r.depth - 1, f = r.collections.map(async (d) => {
11299
- const h = await vm([...e, d], {
11298
+ const u = r.depth - 1, d = r.collections.map(async (f) => {
11299
+ const h = await vm([...e, f], {
11300
11300
  constraints: r.constraints,
11301
11301
  only: i,
11302
11302
  pagination: r.limit,
11303
11303
  noEmbeddingFields: a
11304
11304
  }).catch((p) => {
11305
- throw p.code === "permission-denied" && console.info(`PERMISSION_DENIED for subcollection ${d} for document at ${e.join("/")}`), p;
11305
+ throw p.code === "permission-denied" && console.info(`PERMISSION_DENIED for subcollection ${f} for document at ${e.join("/")}`), p;
11306
11306
  });
11307
- t[d] = h.records, s && await Promise.all(
11307
+ t[f] = h.records, s && await Promise.all(
11308
11308
  // eslint-disable-next-line security/detect-object-injection
11309
- t[d].map((p) => hc(p, [...e, d, p.id], s, n, i, a))
11309
+ t[f].map((p) => hc(p, [...e, f, p.id], s, n, i, a))
11310
11310
  ), u > 0 && await Promise.all(
11311
11311
  // eslint-disable-next-line security/detect-object-injection
11312
- t[d].map((p) => _m(p, [...e, d, p.id], { depth: u }, n, s, i, a))
11312
+ t[f].map((p) => _m(p, [...e, f, p.id], { depth: u }, n, s, i, a))
11313
11313
  );
11314
11314
  });
11315
- await Promise.all(f);
11315
+ await Promise.all(d);
11316
11316
  }, hc = async (t, e, r, n, s, i) => {
11317
11317
  if (!Pe())
11318
11318
  throw new Error("PERMISSIONS_NOT_FOUND");
@@ -11321,16 +11321,16 @@ const yw = async (t, e) => {
11321
11321
  const c = r.depth - 1, l = [];
11322
11322
  for (const u of r.fields)
11323
11323
  if ("collection" in u) {
11324
- const f = t[u.name];
11325
- if (!f)
11324
+ const d = t[u.name];
11325
+ if (!d)
11326
11326
  continue;
11327
- const d = Object.keys(f);
11328
- for (const h of d) {
11329
- const p = f[h], b = wr(p.Collection_Path, h, { only: s, noEmbeddingFields: i }).then((g) => {
11330
- if (f[h] = g, c > 0)
11327
+ const f = Object.keys(d);
11328
+ for (const h of f) {
11329
+ const p = d[h], b = wr(p.Collection_Path, h, { only: s, noEmbeddingFields: i }).then((g) => {
11330
+ if (d[h] = g, c > 0)
11331
11331
  return hc(
11332
11332
  // eslint-disable-next-line security/detect-object-injection
11333
- f[h],
11333
+ d[h],
11334
11334
  [...p.Collection_Path, h],
11335
11335
  { depth: c },
11336
11336
  n,
@@ -11339,7 +11339,7 @@ const yw = async (t, e) => {
11339
11339
  );
11340
11340
  }).catch((g) => {
11341
11341
  if (g.message.includes("NOT_FOUND") || g.code === "permission-denied")
11342
- delete f[h];
11342
+ delete d[h];
11343
11343
  else
11344
11344
  throw g;
11345
11345
  });
@@ -11360,17 +11360,17 @@ const yw = async (t, e) => {
11360
11360
  const r = e?.constraints, n = t.at(-1);
11361
11361
  if (!n)
11362
11362
  throw new Error("EMPTY_PATH");
11363
- const s = We(!0), a = Xr()[n], o = s.collections[n], { labels: c, access: l, preloadCache: u } = o, { serverReadOnly: f } = l, d = Ie(), h = Object.keys(s.collections).includes(n), p = d.disabledCollections?.includes(n);
11363
+ const s = We(!0), a = Xr()[n], o = s.collections[n], { labels: c, access: l, preloadCache: u } = o, { serverReadOnly: d } = l, f = Ie(), h = Object.keys(s.collections).includes(n), p = f.disabledCollections?.includes(n);
11364
11364
  if (!h || p)
11365
11365
  throw new Error("COLLECTION_NOT_FOUND");
11366
- const b = await ft(c.collection), g = await ne(d, [
11366
+ const b = await dt(c.collection), g = await ne(f, [
11367
11367
  "global",
11368
11368
  "firebase",
11369
11369
  "serverTimestampOptions"
11370
11370
  ]), O = Pe();
11371
11371
  if (!O?.Role)
11372
11372
  throw new Error("PERMISSIONS_DENIED");
11373
- if (f?.includes(O.Role))
11373
+ if (d?.includes(O.Role))
11374
11374
  return await vw(t, r, e);
11375
11375
  const S = uc(t, a);
11376
11376
  if (S.length === 0)
@@ -11383,16 +11383,16 @@ const yw = async (t, e) => {
11383
11383
  if (e?.pagination) {
11384
11384
  if (e.pagination.startAfter && e.pagination.endBefore)
11385
11385
  throw new Error("INPUT_ERROR: startAfter and endBefore cannot be provided together");
11386
- const m = e.pagination.startAfter || e.pagination.endBefore, T = Zd(O.Role, o, s);
11386
+ const m = e.pagination.startAfter || e.pagination.endBefore, T = Zf(O.Role, o, s);
11387
11387
  if (m && T !== !0)
11388
11388
  throw new Error("INPUT_ERROR: Pagination is not allowed when using " + T);
11389
11389
  e.pagination.orderByField && e.pagination.orderByDirection ? e.pagination.startAfter || e.pagination.endBefore ? e.pagination.startAfter ? C = C.map((A, L) => he(A, rt(e.pagination.orderByField, e.pagination.orderByDirection), no(x.last.get(L)), er(e.pagination.number))) : C = C.map((A, L) => he(A, rt(e.pagination.orderByField, e.pagination.orderByDirection), so(x.first.get(L)), Dr(e.pagination.number))) : C = C.map((A) => he(A, rt(e.pagination.orderByField, e.pagination.orderByDirection), er(e.pagination.number))) : !e.pagination.startAfter && !e.pagination.endBefore ? C = C.map((A) => he(A, er(e.pagination.number))) : e.pagination.startAfter ? C = C.map((A, L) => he(A, no(x.last.get(L)), er(e.pagination.number))) : C = C.map((A, L) => he(A, so(x.first.get(L)), Dr(e.pagination.number)));
11390
11390
  }
11391
11391
  const y = { collection: c.collection };
11392
- await ie("preOperation", d, b, { operation: "read", context: y }), await ie("preRead", d, b, { context: y, refs: C, multiple: !0, listener: !1 });
11392
+ await ie("preOperation", f, b, { operation: "read", context: y }), await ie("preRead", f, b, { context: y, refs: C, multiple: !0, listener: !1 });
11393
11393
  const _ = /* @__PURE__ */ new Map(), N = C.map(async (m) => {
11394
11394
  let T;
11395
- return e?.only === "cache" ? T = await Cd(m) : e?.only === "server" ? T = await Qm(m) : T = await Xm(m), T;
11395
+ return e?.only === "cache" ? T = await Cf(m) : e?.only === "server" ? T = await Qm(m) : T = await Xm(m), T;
11396
11396
  }), v = await Promise.all(N);
11397
11397
  for (const m of v) {
11398
11398
  for (const T of m.docs) {
@@ -11405,10 +11405,10 @@ const yw = async (t, e) => {
11405
11405
  x.first.set(v.indexOf(m), m.docs[0]), x.last.set(v.indexOf(m), m.docs.at(-1) || m.docs[0]);
11406
11406
  }
11407
11407
  let w;
11408
- if (e?.pagination && !u?.roles.includes(O?.Role) && !f?.includes(O?.Role)) {
11408
+ if (e?.pagination && !u?.roles.includes(O?.Role) && !d?.includes(O?.Role)) {
11409
11409
  let m = he(S[0], ...r || []);
11410
11410
  e.pagination.orderByField && e.pagination.orderByDirection && (m = he(m, rt(e.pagination.orderByField, e.pagination.orderByDirection)));
11411
- const T = await Ad(m).catch(() => {
11411
+ const T = await Af(m).catch(() => {
11412
11412
  });
11413
11413
  if (T) {
11414
11414
  const A = T.data().count, L = e.pagination.number;
@@ -11452,7 +11452,7 @@ const yw = async (t, e) => {
11452
11452
  })), e?.noEmbeddingFields && F.type === "Embedding" && delete m[F.name];
11453
11453
  await Promise.all(L);
11454
11454
  const k = { operation: "read", data: m, recordId: m.id, context: y };
11455
- await ie("postOperation", d, b, k), await ie("postRead", d, b, { context: y, refs: S, record: m, listener: !1 });
11455
+ await ie("postOperation", f, b, k), await ie("postRead", f, b, { context: y, refs: S, record: m, listener: !1 });
11456
11456
  }
11457
11457
  return { cursor: x, pages: w, records: Array.from(_.values()) };
11458
11458
  }, ww = async (t, e, r) => {
@@ -11466,24 +11466,24 @@ const yw = async (t, e) => {
11466
11466
  const a = Pe();
11467
11467
  if (!a)
11468
11468
  throw new Error("PERMISSIONS_NOT_FOUND");
11469
- const o = e.at(-2), c = Fd(n.collections[o], n, a).map((f) => f.labels.collection);
11470
- r.collections ? r.collections.forEach((f) => {
11471
- if (!c.includes(f))
11472
- throw new Error(`SCHEMA_ERROR: Collection ${f} not found in subcollections of ${o}`);
11469
+ const o = e.at(-2), c = Ff(n.collections[o], n, a).map((d) => d.labels.collection);
11470
+ r.collections ? r.collections.forEach((d) => {
11471
+ if (!c.includes(d))
11472
+ throw new Error(`SCHEMA_ERROR: Collection ${d} not found in subcollections of ${o}`);
11473
11473
  }) : r.collections = c;
11474
- const l = r.depth - 1, u = r.collections.map(async (f) => {
11475
- const d = await vm([...e, f], {
11474
+ const l = r.depth - 1, u = r.collections.map(async (d) => {
11475
+ const f = await vm([...e, d], {
11476
11476
  constraints: r.constraints || [],
11477
11477
  only: i,
11478
11478
  relations: s,
11479
11479
  pagination: r.limit
11480
11480
  }).catch((h) => {
11481
- throw h.code === "permission-denied" && console.info(`PERMISSION_DENIED for subcollection ${f} for document at ${e.join("/")}`), h;
11481
+ throw h.code === "permission-denied" && console.info(`PERMISSION_DENIED for subcollection ${d} for document at ${e.join("/")}`), h;
11482
11482
  });
11483
- t[f] = d.records, l > 0 && await Promise.all(
11483
+ t[d] = f.records, l > 0 && await Promise.all(
11484
11484
  // eslint-disable-next-line security/detect-object-injection
11485
- t[f].map(async (h) => {
11486
- await wm(h, [...e, f, h.id], { depth: l }, n, s, i);
11485
+ t[d].map(async (h) => {
11486
+ await wm(h, [...e, d, h.id], { depth: l }, n, s, i);
11487
11487
  })
11488
11488
  );
11489
11489
  });
@@ -11492,23 +11492,23 @@ const yw = async (t, e) => {
11492
11492
  if (!Pe())
11493
11493
  throw new Error("PERMISSIONS_NOT_FOUND");
11494
11494
  const c = e.at(-2);
11495
- r.fields ||= n.collections[c].fields.filter((f) => we(f));
11495
+ r.fields ||= n.collections[c].fields.filter((d) => we(d));
11496
11496
  const l = r.depth - 1, u = [];
11497
- for (const f of r.fields)
11498
- if ("collection" in f) {
11499
- const d = t[f.name];
11500
- if (!d)
11497
+ for (const d of r.fields)
11498
+ if ("collection" in d) {
11499
+ const f = t[d.name];
11500
+ if (!f)
11501
11501
  continue;
11502
- for (const [h, p] of Object.entries(d)) {
11502
+ for (const [h, p] of Object.entries(f)) {
11503
11503
  const b = wr(p.Collection_Path, h, {
11504
11504
  only: s,
11505
11505
  noComputedFields: i,
11506
11506
  noEmbeddingFields: a
11507
11507
  }).then((g) => {
11508
- if (d[h] = g, l > 0)
11508
+ if (f[h] = g, l > 0)
11509
11509
  return bm(
11510
11510
  // eslint-disable-next-line security/detect-object-injection
11511
- d[h],
11511
+ f[h],
11512
11512
  [...p.Collection_Path, h],
11513
11513
  { depth: l },
11514
11514
  n,
@@ -11518,7 +11518,7 @@ const yw = async (t, e) => {
11518
11518
  );
11519
11519
  }).catch((g) => {
11520
11520
  if (g.message.includes("NOT_FOUND") || g.code === "permission-denied")
11521
- delete d[h];
11521
+ delete f[h];
11522
11522
  else
11523
11523
  throw g;
11524
11524
  });
@@ -11541,7 +11541,7 @@ const yw = async (t, e) => {
11541
11541
  "global",
11542
11542
  "firebase",
11543
11543
  "serverTimestampOptions"
11544
- ]), f = s.collections[n], { labels: d, access: h } = f, { serverReadOnly: p } = h, b = ft(d.collection), g = Pe();
11544
+ ]), d = s.collections[n], { labels: f, access: h } = d, { serverReadOnly: p } = h, b = dt(f.collection), g = Pe();
11545
11545
  if (!g?.Role)
11546
11546
  throw new Error("PERMISSIONS_DENIED");
11547
11547
  if (p?.includes(g.Role))
@@ -11549,31 +11549,31 @@ const yw = async (t, e) => {
11549
11549
  const O = gm(t, e, a);
11550
11550
  if (O.length === 0)
11551
11551
  throw new Error("PERMISSION_DENIED");
11552
- const S = { collection: d.collection };
11552
+ const S = { collection: f.collection };
11553
11553
  await ie("preOperation", o, b, { operation: "read", recordId: e, context: S }), await ie("preRead", o, b, { context: S, refs: O, multiple: !1, listener: !1 });
11554
11554
  let y = {};
11555
11555
  const E = O.map(async (I) => {
11556
11556
  let m;
11557
- if (r?.only === "cache" ? m = await ep(I) : r?.only === "server" ? m = await tp(I) : m = await Rd(I), !m.exists())
11558
- throw new Error(`NOT_FOUND: Document with ID ${e} does not exist at location ${t?.join("/") || d.collection}`);
11557
+ if (r?.only === "cache" ? m = await ep(I) : r?.only === "server" ? m = await tp(I) : m = await Rf(I), !m.exists())
11558
+ throw new Error(`NOT_FOUND: Document with ID ${e} does not exist at location ${t?.join("/") || f.collection}`);
11559
11559
  return { id: m.id, data: m.data({ serverTimestamps: u || "none" }) };
11560
11560
  }), R = await Promise.all(E);
11561
11561
  for (const I of R)
11562
11562
  y.id ||= I.id, y = { ...y, ...I.data }, delete y.Collection_Path_String;
11563
- const _ = [], N = t ? [...t, e] : [d.collection, e];
11563
+ const _ = [], N = t ? [...t, e] : [f.collection, e];
11564
11564
  if (r?.subcollections && _.push(wm(y, N, ve(r.subcollections), s, ve(r?.relations), r?.only)), r?.relations && (r.relations.fields && (r.relations.fields = r.relations.fields.map((I) => {
11565
11565
  if (typeof I == "string") {
11566
- const m = f.fields.find((T) => T.name === I);
11566
+ const m = d.fields.find((T) => T.name === I);
11567
11567
  if (m)
11568
11568
  return m;
11569
11569
  throw new Error(`SCHEMA_ERROR: Field ${I} not found in collection ${n}`);
11570
11570
  }
11571
11571
  return I;
11572
11572
  })), _.push(bm(y, N, ve(r.relations), s, r?.only, r?.noComputedFields, r?.noEmbeddingFields))), await Promise.all(_), !r?.noComputedFields)
11573
- for (const I of f.fields)
11573
+ for (const I of d.fields)
11574
11574
  I.type === "Computed" && (y[I.name] = await I.formula(y));
11575
11575
  if (r?.noEmbeddingFields)
11576
- for (const I of f.fields)
11576
+ for (const I of d.fields)
11577
11577
  I.type === "Embedding" && delete y[I.name];
11578
11578
  return await ie("postOperation", o, b, { operation: "read", data: y, recordId: e, context: S }), await ie("postRead", o, b, { context: S, refs: O, record: y, listener: !1 }), y;
11579
11579
  }, bw = (t) => t !== null && typeof t == "object", Om = (t) => {
@@ -11588,7 +11588,7 @@ const yw = async (t, e) => {
11588
11588
  e(t);
11589
11589
  }, Ow = async (t, e, r, n) => {
11590
11590
  const s = it(), i = Be(), a = Ue(s, i.STOKER_FB_FUNCTIONS_REGION), o = Je(a, "stoker-writeapi", { timeout: 540 * 1e3 }), c = ve(r);
11591
- return Om(c), fc(c), (await o({
11591
+ return Om(c), dc(c), (await o({
11592
11592
  operation: "update",
11593
11593
  path: t,
11594
11594
  id: e,
@@ -11596,23 +11596,23 @@ const yw = async (t, e) => {
11596
11596
  user: n
11597
11597
  })).data?.result;
11598
11598
  }, mc = async (t, e, r, n) => {
11599
- const s = n?.user, i = Dt(), a = We(), o = We(!0), c = vc(), l = Ie(), u = hr(), f = ze(), d = Pe();
11599
+ const s = n?.user, i = Dt(), a = We(), o = We(!0), c = vc(), l = Ie(), u = hr(), d = ze(), f = Pe();
11600
11600
  if (t.length === 0)
11601
11601
  throw new Error("EMPTY_PATH");
11602
11602
  const h = t.at(-1), p = Object.keys(a.collections).includes(h), b = l.disabledCollections?.includes(h);
11603
11603
  if (!p || b)
11604
11604
  throw new Error("COLLECTION_NOT_FOUND");
11605
- const g = a.collections[h], { labels: O, access: S, fields: C, enableWriteLog: x } = g, { serverWriteOnly: y } = S, E = ft(O.collection), R = await ne(l, ["global", "appName"]), _ = n?.retry, N = u.currentUser;
11605
+ const g = a.collections[h], { labels: O, access: S, fields: C, enableWriteLog: x } = g, { serverWriteOnly: y } = S, E = dt(O.collection), R = await ne(l, ["global", "appName"]), _ = n?.retry, N = u.currentUser;
11606
11606
  if (!N)
11607
11607
  throw new Error("NOT_AUTHENTICATED");
11608
- if (!d)
11608
+ if (!f)
11609
11609
  throw new Error("PERMISSION_DENIED");
11610
11610
  if (Tm(e))
11611
11611
  throw new Error("RECORD_BUSY");
11612
11612
  const v = _?.originalRecord || n?.originalRecord || await wr(t, e, { noComputedFields: !0, noEmbeddingFields: !0 });
11613
11613
  for (const V of o.collections[h].fields)
11614
11614
  V.type === "Computed" && (delete r[V.name], delete v[V.name]);
11615
- const w = xo(f), I = { collection: O.collection }, m = g.fields.filter((V) => V.saveToAuthToken), T = g.auth && s?.operation === "create", A = g.auth && s?.operation === "delete", L = g.auth && !T && !A && (s?.operation === "update" || r.Role || r.Enabled !== void 0 || r.Name || r.Email || r.Photo_URL || m.some((V) => r[V.name] !== void 0)), k = await ne(E, [
11615
+ const w = xo(d), I = { collection: O.collection }, m = g.fields.filter((V) => V.saveToAuthToken), T = g.auth && s?.operation === "create", A = g.auth && s?.operation === "delete", L = g.auth && !T && !A && (s?.operation === "update" || r.Role || r.Enabled !== void 0 || r.Name || r.Email || r.Photo_URL || m.some((V) => r[V.name] !== void 0)), k = await ne(E, [
11616
11616
  "collections",
11617
11617
  O.collection,
11618
11618
  "custom",
@@ -11632,7 +11632,7 @@ const yw = async (t, e) => {
11632
11632
  if (!await ne(l, ["global", "firebase", "enableEmulators"])) {
11633
11633
  M();
11634
11634
  try {
11635
- const { isValid: Te } = await Ed(u, s.password);
11635
+ const { isValid: Te } = await Ef(u, s.password);
11636
11636
  if (!Te)
11637
11637
  throw new Error("Please create a stronger password");
11638
11638
  } catch (Te) {
@@ -11676,11 +11676,11 @@ const yw = async (t, e) => {
11676
11676
  if (Mr(g, F, a), sh(g, F), !_)
11677
11677
  try {
11678
11678
  const V = { ...v, ...F };
11679
- rr(V), await fm("update", V, g, E, { operation: "update", record: V, context: I, batch: w, originalRecord: ve(v) }, a), k && (M(), await dc("update", e, F, g, d));
11679
+ rr(V), await dm("update", V, g, E, { operation: "update", record: V, context: I, batch: w, originalRecord: ve(v) }, a), k && (M(), await fc("update", e, F, g, f));
11680
11680
  } catch (V) {
11681
11681
  throw new Error(`VALIDATION_ERROR: ${V.message}`);
11682
11682
  }
11683
- if (Rg(F, v, e, g, a, N.uid, d), xt(F), lc("update", w, t, e, F, a, g, n, c, Fo, No, xn, (V) => Ae(f, "tenants", i, "system_fields", O.collection, `${O.collection}-${V.name}`, e), (V, K) => Ae(f, "tenants", i, "system_unique", O.collection, `Unique-${O.collection}-${V.name}`, K), (V) => Ae(f, "tenants", i, "system_fields", O.collection, `${O.collection}-${V}`, e)), w.update(Ae(f, "tenants", i, t.join("/"), e), F), !_ && x && Ye("update", "written", F, t, e, g, N.uid, void 0, v), await pc("update", t, e, F, I, g, E, w, N.uid, x || !1, d, !!_, v), _?.type === "unique") {
11683
+ if (Rg(F, v, e, g, a, N.uid, f), xt(F), lc("update", w, t, e, F, a, g, n, c, Fo, No, xn, (V) => Ae(d, "tenants", i, "system_fields", O.collection, `${O.collection}-${V.name}`, e), (V, K) => Ae(d, "tenants", i, "system_unique", O.collection, `Unique-${O.collection}-${V.name}`, K), (V) => Ae(d, "tenants", i, "system_fields", O.collection, `${O.collection}-${V}`, e)), w.update(Ae(d, "tenants", i, t.join("/"), e), F), !_ && x && Ye("update", "written", F, t, e, g, N.uid, void 0, v), await pc("update", t, e, F, I, g, E, w, N.uid, x || !1, f, !!_, v), _?.type === "unique") {
11684
11684
  const V = { ...v, ...F };
11685
11685
  return rr(V), { id: e, ...V };
11686
11686
  }
@@ -11696,7 +11696,7 @@ const yw = async (t, e) => {
11696
11696
  await ie("postWrite", l, E, Z), await ie("postOperation", l, E, re);
11697
11697
  const oe = { ...v, ...F };
11698
11698
  return rr(oe), { id: e, ...oe };
11699
- }, pc = async (t, e, r, n, s, i, a, o, c, l, u, f, d) => {
11699
+ }, pc = async (t, e, r, n, s, i, a, o, c, l, u, d, f) => {
11700
11700
  const h = We(), p = Ie(), { labels: b } = i;
11701
11701
  let g = 0;
11702
11702
  const O = async () => {
@@ -11713,7 +11713,7 @@ const yw = async (t, e) => {
11713
11713
  ]);
11714
11714
  if (S.code === "unavailable" && await be(p.onIndexedDBConnectionLost), t !== "delete" && S.code === "permission-denied")
11715
11715
  try {
11716
- await dc(t, r, n, i, u);
11716
+ await fc(t, r, n, i, u);
11717
11717
  } catch (N) {
11718
11718
  const v = N.message.split(", "), w = [], I = [];
11719
11719
  let m = !1;
@@ -11740,7 +11740,7 @@ const yw = async (t, e) => {
11740
11740
  retry: {
11741
11741
  type: "unique",
11742
11742
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11743
- originalRecord: d
11743
+ originalRecord: f
11744
11744
  }
11745
11745
  });
11746
11746
  return;
@@ -11754,9 +11754,9 @@ const yw = async (t, e) => {
11754
11754
  context: s,
11755
11755
  error: y,
11756
11756
  batch: o,
11757
- retry: f,
11757
+ retry: d,
11758
11758
  retries: g,
11759
- originalRecord: t === "update" ? d : void 0
11759
+ originalRecord: t === "update" ? f : void 0
11760
11760
  }, R = S.code === "unavailable", _ = await ie("postWriteError", p, a, E);
11761
11761
  if (_?.resolved)
11762
11762
  return;
@@ -11774,7 +11774,7 @@ const yw = async (t, e) => {
11774
11774
  c,
11775
11775
  y,
11776
11776
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11777
- t === "update" ? d : void 0
11777
+ t === "update" ? f : void 0
11778
11778
  );
11779
11779
  throw y;
11780
11780
  }
@@ -11793,10 +11793,10 @@ const yw = async (t, e) => {
11793
11793
  const n = r?.user, s = Dt(), i = We(), a = vc(), o = Ie(), c = hr(), l = ze(), u = Pe();
11794
11794
  if (t.length === 0)
11795
11795
  throw new Error("EMPTY_PATH");
11796
- const f = t.at(-1), d = Object.keys(i.collections).includes(f), h = o.disabledCollections?.includes(f);
11797
- if (!d || h)
11796
+ const d = t.at(-1), f = Object.keys(i.collections).includes(d), h = o.disabledCollections?.includes(d);
11797
+ if (!f || h)
11798
11798
  throw new Error("COLLECTION_NOT_FOUND");
11799
- const p = i.collections[f], { labels: b, access: g, enableWriteLog: O, softDelete: S } = p, { serverWriteOnly: C } = g, x = ft(b.collection), y = await ne(o, ["global", "appName"]), E = r?.retry, R = c.currentUser;
11799
+ const p = i.collections[d], { labels: b, access: g, enableWriteLog: O, softDelete: S } = p, { serverWriteOnly: C } = g, x = dt(b.collection), y = await ne(o, ["global", "appName"]), E = r?.retry, R = c.currentUser;
11800
11800
  if (!R)
11801
11801
  throw new Error("NOT_AUTHENTICATED");
11802
11802
  if (!u)
@@ -11823,7 +11823,7 @@ const yw = async (t, e) => {
11823
11823
  if (!await ne(o, ["global", "firebase", "enableEmulators"])) {
11824
11824
  N();
11825
11825
  try {
11826
- const { isValid: Z } = await Ed(c, n.password);
11826
+ const { isValid: Z } = await Ef(c, n.password);
11827
11827
  if (!Z)
11828
11828
  throw new Error("Please create a stronger password");
11829
11829
  } catch (Z) {
@@ -11854,7 +11854,7 @@ const yw = async (t, e) => {
11854
11854
  batch: v
11855
11855
  })), Mr(p, m, i), sh(p, m), E || await _y(m, p, x, u.Role), !E)
11856
11856
  try {
11857
- await fm("create", m, p, x, { operation: "create", record: m, context: I, batch: v }, i), _ && (N(), await dc("create", w, m, p, u));
11857
+ await dm("create", m, p, x, { operation: "create", record: m, context: I, batch: v }, i), _ && (N(), await fc("create", w, m, p, u));
11858
11858
  } catch (k) {
11859
11859
  throw new Error(`VALIDATION_ERROR: ${k.message}`);
11860
11860
  }
@@ -11880,10 +11880,10 @@ const yw = async (t, e) => {
11880
11880
  const n = Dt(), s = We(), i = vc(), a = hr(), o = ze(), c = Ie(), l = Pe();
11881
11881
  if (t.length === 0)
11882
11882
  throw new Error("EMPTY_PATH");
11883
- const u = t.at(-1), f = Object.keys(s.collections).includes(u), d = c.disabledCollections?.includes(u);
11884
- if (!f || d)
11883
+ const u = t.at(-1), d = Object.keys(s.collections).includes(u), f = c.disabledCollections?.includes(u);
11884
+ if (!d || f)
11885
11885
  throw new Error("COLLECTION_NOT_FOUND");
11886
- const h = s.collections[u], { labels: p, access: b, enableWriteLog: g, softDelete: O } = h, { serverWriteOnly: S } = b, C = ft(p.collection), x = await ne(c, ["global", "appName"]), y = r?.retry, E = a.currentUser;
11886
+ const h = s.collections[u], { labels: p, access: b, enableWriteLog: g, softDelete: O } = h, { serverWriteOnly: S } = b, C = dt(p.collection), x = await ne(c, ["global", "appName"]), y = r?.retry, E = a.currentUser;
11887
11887
  if (!E)
11888
11888
  throw new Error("NOT_AUTHENTICATED");
11889
11889
  if (!l)
@@ -11948,17 +11948,17 @@ const Cw = async (t, e) => {
11948
11948
  const r = hr(), n = wc(), s = r.currentUser;
11949
11949
  if (s?.uid !== e.uid)
11950
11950
  return;
11951
- const i = await Cd(he(rp(n, "system_write_log"), ye("status", "==", "written"), ye("user", "==", e.uid), rt("Last_Write_At", "asc")));
11951
+ const i = await Cf(he(rp(n, "system_write_log"), ye("status", "==", "written"), ye("user", "==", e.uid), rt("Last_Write_At", "asc")));
11952
11952
  await new Promise((o) => setTimeout(o, 1e4));
11953
11953
  const a = Rm();
11954
11954
  if (a?.version)
11955
11955
  for (const o of i.docs) {
11956
11956
  pt[o.id] ??= 0;
11957
- const c = o.data(), { data: l, operation: u, docId: f, collection: d, Collection_Path: h, Last_Write_Version: p } = c;
11957
+ const c = o.data(), { data: l, operation: u, docId: d, collection: f, Collection_Path: h, Last_Write_Version: p } = c;
11958
11958
  await new Promise((O) => setTimeout(O, 1e3));
11959
11959
  const b = await Rw("stoker-writelog", {
11960
11960
  path: h,
11961
- id: f,
11961
+ id: d,
11962
11962
  log: o.id
11963
11963
  });
11964
11964
  if (!b || b.status !== "written")
@@ -11972,36 +11972,36 @@ const Cw = async (t, e) => {
11972
11972
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11973
11973
  l.data,
11974
11974
  h,
11975
- f,
11975
+ d,
11976
11976
  // eslint-disable-next-line security/detect-object-injection
11977
- t.collections[d],
11977
+ t.collections[f],
11978
11978
  e.uid,
11979
11979
  `Version mismatch- write log version ${p} not compatible with forced version ${a.version}`,
11980
11980
  u === "update" ? l.originalRecord : void 0
11981
11981
  );
11982
11982
  continue;
11983
11983
  }
11984
- const g = localStorage.getItem(`stoker-retry-${f}`);
11984
+ const g = localStorage.getItem(`stoker-retry-${d}`);
11985
11985
  if (g !== "done" && !(g && Date.now() - parseInt(g) < 1e4)) {
11986
- if (localStorage.setItem(`stoker-retry-${f}`, Date.now().toString()), console.info(`Retrying pending ${u} operation: ${o.ref.path}`), u === "create" && (pt[f]++, await Em(h, l.data, {
11986
+ if (localStorage.setItem(`stoker-retry-${d}`, Date.now().toString()), console.info(`Retrying pending ${u} operation: ${o.ref.path}`), u === "create" && (pt[d]++, await Em(h, l.data, {
11987
11987
  retry: {
11988
11988
  type: "offline",
11989
- docId: f
11989
+ docId: d
11990
11990
  }
11991
11991
  }).catch((O) => {
11992
11992
  console.error(O);
11993
- }), pt[f]--, localStorage.setItem(`stoker-retry-${f}`, "done")), u === "update") {
11994
- const O = t.collections[d], { softDelete: S } = O;
11995
- S && l.data?.[S.archivedField] && l.data?.[S.archivedField] !== l.originalRecord?.[S.archivedField] && (l.data[S.timestampField] = jr()), l.data && Sm(l.data), pt[f]++, await mc(h, f, l.data, {
11993
+ }), pt[d]--, localStorage.setItem(`stoker-retry-${d}`, "done")), u === "update") {
11994
+ const O = t.collections[f], { softDelete: S } = O;
11995
+ S && l.data?.[S.archivedField] && l.data?.[S.archivedField] !== l.originalRecord?.[S.archivedField] && (l.data[S.timestampField] = jr()), l.data && Sm(l.data), pt[d]++, await mc(h, d, l.data, {
11996
11996
  retry: {
11997
11997
  type: "offline",
11998
11998
  originalRecord: l.originalRecord
11999
11999
  }
12000
12000
  }).catch((C) => {
12001
12001
  console.error(C);
12002
- }), pt[f]--, localStorage.setItem(`stoker-retry-${f}`, "done");
12002
+ }), pt[d]--, localStorage.setItem(`stoker-retry-${d}`, "done");
12003
12003
  }
12004
- u === "delete" && (pt[f]++, await Tw(h, f, {
12004
+ u === "delete" && (pt[d]++, await Tw(h, d, {
12005
12005
  retry: {
12006
12006
  type: "offline",
12007
12007
  record: {
@@ -12014,7 +12014,7 @@ const Cw = async (t, e) => {
12014
12014
  }
12015
12015
  }).catch((O) => {
12016
12016
  console.error(O);
12017
- }), pt[f]--, localStorage.setItem(`stoker-retry-${f}`, "done"));
12017
+ }), pt[d]--, localStorage.setItem(`stoker-retry-${d}`, "done"));
12018
12018
  }
12019
12019
  }
12020
12020
  }, Tm = (t) => !!pt[t], Aw = () => {
@@ -12040,7 +12040,7 @@ const Iw = async () => {
12040
12040
  }, xw = () => ko;
12041
12041
  let Fr, Sr = null;
12042
12042
  const Nw = () => {
12043
- const t = Td(), e = Ie();
12043
+ const t = Tf(), e = Ie();
12044
12044
  let r = !1;
12045
12045
  return Hm(Km(t, ".info/connected"), (s) => {
12046
12046
  s.val() === !0 ? (Sr && (clearTimeout(Sr), Sr = null), Fr = "Online", be(e.onConnectionStatusChange, [Fr, !r]), r || (r = !0)) : !Sr && r && (Sr = setTimeout(() => {
@@ -12084,13 +12084,13 @@ let kn;
12084
12084
  const Pw = (t, e) => {
12085
12085
  const r = mw(t, e);
12086
12086
  kn = r === "(default)" ? void 0 : r;
12087
- }, Mw = () => kn, ze = () => kn ? kc(kn) : kc(), wd = () => {
12087
+ }, Mw = () => kn, ze = () => kn ? kc(kn) : kc(), wf = () => {
12088
12088
  if (typeof navigator > "u")
12089
12089
  return {};
12090
12090
  const t = navigator.userAgent;
12091
12091
  return /iPad|iPhone|iPod/.test(t) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1 ? { experimentalForceLongPolling: !0 } : /Safari/i.test(t) && !/Chrome|Chromium|CriOS|EdgiOS|Edg\/|OPR|FxiOS/i.test(t) ? { experimentalForceLongPolling: !0 } : {};
12092
12092
  };
12093
- let ht, gc, St, Am, ge, km, Lr, yc, _c, je, Im, In = [], Oe;
12093
+ let ht, gc, St, Am, ge, km, Lr, yc, _c, Me, Im, In = [], Oe;
12094
12094
  const Xa = {
12095
12095
  firestoreWriteApp: {}
12096
12096
  }, mt = {
@@ -12122,7 +12122,7 @@ const Xa = {
12122
12122
  for (const r of Object.values(e.collections))
12123
12123
  for (const n of r.fields)
12124
12124
  if (n.type === "Computed") {
12125
- const s = kg(n, ft(r.labels.collection));
12125
+ const s = kg(n, dt(r.labels.collection));
12126
12126
  s.formula && (n.formula = s.formula);
12127
12127
  }
12128
12128
  } else
@@ -12166,11 +12166,11 @@ const Xa = {
12166
12166
  return Ge.maintenance;
12167
12167
  }
12168
12168
  }, qw = () => {
12169
- gc = "", Lr = {}, yc = {}, _c = {}, je = {}, fy(), _w(), Aw();
12169
+ gc = "", Lr = {}, yc = {}, _c = {}, Me = {}, dy(), _w(), Aw();
12170
12170
  }, Lw = () => In, $w = () => {
12171
12171
  In = [];
12172
12172
  };
12173
- let bd = !1, Od = 0;
12173
+ let bf = !1, Of = 0;
12174
12174
  const tb = async (t, e, r, n) => {
12175
12175
  if (Oe = r, ht)
12176
12176
  return console.error("Stoker is already initialized."), !0;
@@ -12187,9 +12187,9 @@ const tb = async (t, e, r, n) => {
12187
12187
  for (const w of c)
12188
12188
  Xa[`${w}App`] = Hn(s, w);
12189
12189
  const { firestoreWriteApp: l } = Xa, u = Hn(s, "maintenance");
12190
- Ge.maintenance = rn(u, wd(), i);
12191
- const f = yp();
12192
- if (f.settings.minimumFetchIntervalMillis = 36e5, await _p(f), Oe.STOKER_FB_ENABLE_APP_CHECK === "true" && Oe.STOKER_FB_APP_CHECK_KEY) {
12190
+ Ge.maintenance = rn(u, wf(), i);
12191
+ const d = yp();
12192
+ if (d.settings.minimumFetchIntervalMillis = 36e5, await _p(d), Oe.STOKER_FB_ENABLE_APP_CHECK === "true" && Oe.STOKER_FB_APP_CHECK_KEY) {
12193
12193
  (St === "development" || window.location.hostname === "localhost") && (globalThis.FIREBASE_APPCHECK_DEBUG_TOKEN = !0);
12194
12194
  const w = {
12195
12195
  provider: new pp(Oe.STOKER_FB_APP_CHECK_KEY),
@@ -12211,7 +12211,7 @@ const tb = async (t, e, r, n) => {
12211
12211
  }, (T) => m(T, "firestoreWrite")), Jn(Ct.maintenance, () => {
12212
12212
  }, (T) => m(T, "maintenance"));
12213
12213
  }
12214
- const d = await ne(ge, [
12214
+ const f = await ne(ge, [
12215
12215
  "global",
12216
12216
  "firebase",
12217
12217
  "enableAnalytics"
@@ -12240,7 +12240,7 @@ const tb = async (t, e, r, n) => {
12240
12240
  ]), C = await qm().catch((w) => {
12241
12241
  throw new Error("Error checking analytics support.", { cause: w });
12242
12242
  });
12243
- St === "production" && d && C && Lm(ht, h || {}), p && $m(p);
12243
+ St === "production" && f && C && Lm(ht, h || {}), p && $m(p);
12244
12244
  const x = await ne(ge, [
12245
12245
  "global",
12246
12246
  "auth",
@@ -12270,7 +12270,7 @@ const tb = async (t, e, r, n) => {
12270
12270
  }
12271
12271
  if (!_?.includes("Database")) {
12272
12272
  const w = Oe.STOKER_FB_EMULATOR_DATABASE_PORT ? parseInt(Oe.STOKER_FB_EMULATOR_DATABASE_PORT) : 9e3;
12273
- Ym(Td(), "localhost", w);
12273
+ Ym(Tf(), "localhost", w);
12274
12274
  }
12275
12275
  if (!_?.includes("Firestore")) {
12276
12276
  const w = Oe.STOKER_FB_EMULATOR_FIRESTORE_PORT ? parseInt(Oe.STOKER_FB_EMULATOR_FIRESTORE_PORT) : 8080;
@@ -12278,7 +12278,7 @@ const tb = async (t, e, r, n) => {
12278
12278
  }
12279
12279
  if (!_?.includes("Storage")) {
12280
12280
  const w = Oe.STOKER_FB_EMULATOR_STORAGE_PORT ? parseInt(Oe.STOKER_FB_EMULATOR_STORAGE_PORT) : 9199;
12281
- dp(hp(), "localhost", w);
12281
+ fp(hp(), "localhost", w);
12282
12282
  }
12283
12283
  if (!_?.includes("Functions")) {
12284
12284
  const w = Oe.STOKER_FB_EMULATOR_FUNCTIONS_PORT ? parseInt(Oe.STOKER_FB_EMULATOR_FUNCTIONS_PORT) : 5001;
@@ -12304,15 +12304,19 @@ const tb = async (t, e, r, n) => {
12304
12304
  w.currentUser || (N = !0);
12305
12305
  let v;
12306
12306
  return Kn(R, async (w) => {
12307
- const I = ++Od, m = () => I !== Od;
12307
+ if (w && Me?.uid && w.uid !== Me.uid) {
12308
+ window.location.reload();
12309
+ return;
12310
+ }
12311
+ const I = ++Of, m = () => I !== Of;
12308
12312
  if (w) {
12309
- je = w;
12310
- const T = await zm(je);
12313
+ Me = w;
12314
+ const T = await zm(Me);
12311
12315
  if (m())
12312
12316
  return;
12313
12317
  const { claims: A } = T;
12314
12318
  gc = A.tenant, Im = {
12315
- ...je,
12319
+ ...Me,
12316
12320
  token: {
12317
12321
  claims: A
12318
12322
  }
@@ -12326,8 +12330,8 @@ const tb = async (t, e, r, n) => {
12326
12330
  }));
12327
12331
  if (await Promise.all(L), m())
12328
12332
  return;
12329
- bd || (Dw(ge), bd = !0), v = await ne(ge, ["global", "auth", "offlinePersistenceType"], [je, A]);
12330
- const k = await ne(ge, ["global", "auth", "tabManager"], [je, A]), M = await ne(ge, ["global", "auth", "garbageCollectionStrategy"], [je, A]), F = await ne(ge, ["global", "auth", "maxCacheSize"], [je, A]) || -1, Z = await ne(ge, ["global", "auth", "maxWriteCacheSize"], [je, A]);
12333
+ bf || (Dw(ge), bf = !0), v = await ne(ge, ["global", "auth", "offlinePersistenceType"], [Me, A]);
12334
+ const k = await ne(ge, ["global", "auth", "tabManager"], [Me, A]), M = await ne(ge, ["global", "auth", "garbageCollectionStrategy"], [Me, A]), F = await ne(ge, ["global", "auth", "maxCacheSize"], [Me, A]) || -1, Z = await ne(ge, ["global", "auth", "maxWriteCacheSize"], [Me, A]);
12331
12335
  if (m())
12332
12336
  return;
12333
12337
  let re;
@@ -12348,7 +12352,7 @@ const tb = async (t, e, r, n) => {
12348
12352
  garbageCollector: V
12349
12353
  })
12350
12354
  };
12351
- const K = wd();
12355
+ const K = wf();
12352
12356
  if (Ge.main = rn(ht, {
12353
12357
  ...re,
12354
12358
  ...K
@@ -12375,12 +12379,12 @@ const tb = async (t, e, r, n) => {
12375
12379
  Lr = Te.data.schema;
12376
12380
  const Xe = Object.entries(Te.data.allRoleGroups).map(([q, Y]) => [q, new Set(Y)]);
12377
12381
  yc = Object.fromEntries(Xe), _c = Te.data.currentUserRoleGroups, km = Ag(Object.keys(Lr.collections), e, "web", Io, n);
12378
- const bt = await yw(je, T);
12379
- if (m() || (In.push(...bt), v === "WRITE" && Cw(Lr, je), await be(ge.postLogin, [je]), m()))
12382
+ const bt = await yw(Me, T);
12383
+ if (m() || (In.push(...bt), v === "WRITE" && Cw(Lr, Me), await be(ge.postLogin, [Me]), m()))
12380
12384
  return;
12381
12385
  const br = new Event("stoker:ready");
12382
12386
  document.dispatchEvent(br);
12383
- } else if (je) {
12387
+ } else if (Me) {
12384
12388
  qw(), Lw().forEach((M) => {
12385
12389
  M();
12386
12390
  }), $w();
@@ -12388,7 +12392,7 @@ const tb = async (t, e, r, n) => {
12388
12392
  document.dispatchEvent(A);
12389
12393
  const L = { error: !1, instances: [] };
12390
12394
  await Promise.all(Object.values(mt).map(async (M) => {
12391
- M.currentUser && await Sd(M).catch((F) => {
12395
+ M.currentUser && await Sf(M).catch((F) => {
12392
12396
  L.error = !0, L.instances.push({
12393
12397
  instance: M.app.name,
12394
12398
  code: "SIGN_OUT",
@@ -12414,7 +12418,7 @@ const tb = async (t, e, r, n) => {
12414
12418
  })), L.error ? console.info("Sign out operation completed with errors.") : console.info("Sign out operation completed successfully."), await be(ge.postLogout, [L]);
12415
12419
  }
12416
12420
  }), N ? !1 : R.currentUser ? (g && console.info(`${R.currentUser.uid} successfully logged in.`), !0) : !1;
12417
- }, { getTenant: Dt, getEnv: Be, getTimezone: xm, getSchema: We, getCurrentUser: rb, getCurrentUserRoleGroups: Xr, getAllRoleGroups: vc, getGlobalConfigModule: Ie, getCollectionConfigModule: ft, getAppCheck: nb, getAppCheckFirestoreWrite: sb, getFirestoreWriteAuth: jw, getFirestoreWrite: wc, getFirestoreMaintenance: Nm } = Io, ib = async (t, e, r) => {
12421
+ }, { getTenant: Dt, getEnv: Be, getTimezone: xm, getSchema: We, getCurrentUser: rb, getCurrentUserRoleGroups: Xr, getAllRoleGroups: vc, getGlobalConfigModule: Ie, getCollectionConfigModule: dt, getAppCheck: nb, getAppCheckFirestoreWrite: sb, getFirestoreWriteAuth: jw, getFirestoreWrite: wc, getFirestoreMaintenance: Nm } = Io, ib = async (t, e, r) => {
12418
12422
  const [n, s] = [hr(), jw()], i = Ie();
12419
12423
  if (!t || !e)
12420
12424
  throw new Error("Email and password are required.");
@@ -12437,14 +12441,14 @@ const tb = async (t, e, r, n) => {
12437
12441
  throw c;
12438
12442
  }
12439
12443
  if (!s.currentUser) {
12440
- const c = it(), l = Be(), u = Ue(c, l.STOKER_FB_FUNCTIONS_REGION), f = Je(u, "stoker-customtoken");
12444
+ const c = it(), l = Be(), u = Ue(c, l.STOKER_FB_FUNCTIONS_REGION), d = Je(u, "stoker-customtoken");
12441
12445
  try {
12442
- const h = (await f()).data.customToken;
12446
+ const h = (await d()).data.customToken;
12443
12447
  if (!h)
12444
12448
  throw new Error("The user is not authenticated.");
12445
12449
  await Gm(s, h);
12446
12450
  } catch {
12447
- throw n && n.currentUser && await Sd(n), new Error("The user is not authenticated.");
12451
+ throw n && n.currentUser && await Sf(n), new Error("The user is not authenticated.");
12448
12452
  }
12449
12453
  }
12450
12454
  console.info(`${a} successfully logged in.`);
@@ -12488,7 +12492,7 @@ const tb = async (t, e, r, n) => {
12488
12492
  collectionPath: e.Collection_Path,
12489
12493
  folderName: r
12490
12494
  });
12491
- }, fb = async () => {
12495
+ }, db = async () => {
12492
12496
  const t = [ze(), wc()];
12493
12497
  for (const e of Object.values(t))
12494
12498
  await lp(e).catch((r) => {
@@ -12501,27 +12505,27 @@ const tb = async (t, e, r, n) => {
12501
12505
  const a = Pe();
12502
12506
  if (!a?.Role)
12503
12507
  throw new Error("PERMISSIONS_NOT_FOUND");
12504
- const o = We(!0), l = Xr()[i], u = ze(), f = o.collections[i];
12505
- if (!f)
12508
+ const o = We(!0), l = Xr()[i], u = ze(), d = o.collections[i];
12509
+ if (!d)
12506
12510
  throw new Error("COLLECTION_NOT_FOUND");
12507
- const { labels: d, preloadCache: h } = f, p = Ie(), b = Object.keys(o.collections).includes(i), g = p.disabledCollections?.includes(i);
12511
+ const { labels: f, preloadCache: h } = d, p = Ie(), b = Object.keys(o.collections).includes(i), g = p.disabledCollections?.includes(i);
12508
12512
  if (!b || g)
12509
12513
  throw new Error("COLLECTION_NOT_FOUND");
12510
- const O = ft(d.collection), S = await ne(p, [
12514
+ const O = dt(f.collection), S = await ne(p, [
12511
12515
  "global",
12512
12516
  "firebase",
12513
12517
  "serverTimestampOptions"
12514
12518
  ]), C = gm(t, e, l);
12515
12519
  if (C.length === 0)
12516
12520
  throw new Error("PERMISSION_DENIED");
12517
- const x = h?.roles?.includes(a.Role), y = { collection: d.collection };
12521
+ const x = h?.roles?.includes(a.Role), y = { collection: f.collection };
12518
12522
  await ie("preOperation", p, O, { operation: "read", recordId: e, context: y }), await ie("preRead", p, O, { context: y, refs: C, multiple: !1, listener: !0 });
12519
12523
  const _ = /* @__PURE__ */ new Map(), N = [];
12520
12524
  let v = {};
12521
12525
  const w = /* @__PURE__ */ new Map();
12522
12526
  typeof s?.relations == "object" && (s.relations.fields = s.relations.fields.map((k) => {
12523
12527
  if (typeof k == "string") {
12524
- const M = f.fields.find((F) => F.name === k);
12528
+ const M = d.fields.find((F) => F.name === k);
12525
12529
  if (M)
12526
12530
  return M;
12527
12531
  throw new Error(`SCHEMA_ERROR: Field ${k} not found in collection ${i}`);
@@ -12529,23 +12533,23 @@ const tb = async (t, e, r, n) => {
12529
12533
  return k;
12530
12534
  }));
12531
12535
  const I = () => {
12532
- const k = kd(u, async () => {
12536
+ const k = kf(u, async () => {
12533
12537
  if (k(), v) {
12534
12538
  if (mm(v, w), !s?.noComputedFields) {
12535
12539
  const M = [];
12536
- for (const F of f.fields)
12540
+ for (const F of d.fields)
12537
12541
  F.type === "Computed" && M.push(be(() => F.formula(v)).then((Z) => {
12538
12542
  v && (v[F.name] = Z);
12539
12543
  }));
12540
12544
  await Promise.all(M);
12541
12545
  }
12542
12546
  if (s?.noEmbeddingFields)
12543
- for (const M of f.fields)
12547
+ for (const M of d.fields)
12544
12548
  M.type === "Embedding" && delete v[M.name];
12545
12549
  }
12546
12550
  r(ve(v));
12547
12551
  });
12548
- }, m = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), A = (k) => typeof k == "object" ? k.fields.filter((F) => typeof F == "object" && we(F) && $t(f, o, a).includes(F.collection)) : f.fields.filter((F) => we(F) && $t(f, o, a).includes(F.collection)), L = (k) => new Promise((M) => {
12552
+ }, m = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), A = (k) => typeof k == "object" ? k.fields.filter((F) => typeof F == "object" && we(F) && $t(d, o, a).includes(F.collection)) : d.fields.filter((F) => we(F) && $t(d, o, a).includes(F.collection)), L = (k) => new Promise((M) => {
12549
12553
  if (!s?.relations) {
12550
12554
  M({});
12551
12555
  return;
@@ -12712,17 +12716,17 @@ const tb = async (t, e, r, n) => {
12712
12716
  if (r?.id !== e)
12713
12717
  throw new Error("INPUT_ERROR: Mismatched last cursor IDs");
12714
12718
  });
12715
- }, db = async (t, e, r, n) => {
12719
+ }, fb = async (t, e, r, n) => {
12716
12720
  const s = n?.constraints, i = t.at(-1);
12717
12721
  if (!i)
12718
12722
  throw new Error("EMPTY_PATH");
12719
12723
  const a = Pe();
12720
12724
  if (!a?.Role)
12721
12725
  throw new Error("PERMISSION_DENIED");
12722
- const o = We(!0), l = Xr()[i], u = ze(), f = o.collections[i], { labels: d, preloadCache: h, access: p } = f, { serverReadOnly: b } = p, g = Ie(), O = Object.keys(o.collections).includes(i), S = g.disabledCollections?.includes(i);
12726
+ const o = We(!0), l = Xr()[i], u = ze(), d = o.collections[i], { labels: f, preloadCache: h, access: p } = d, { serverReadOnly: b } = p, g = Ie(), O = Object.keys(o.collections).includes(i), S = g.disabledCollections?.includes(i);
12723
12727
  if (!O || S)
12724
12728
  throw new Error("COLLECTION_NOT_FOUND");
12725
- const C = ft(d.collection), x = await ne(g, [
12729
+ const C = dt(f.collection), x = await ne(g, [
12726
12730
  "global",
12727
12731
  "firebase",
12728
12732
  "serverTimestampOptions"
@@ -12744,7 +12748,7 @@ const tb = async (t, e, r, n) => {
12744
12748
  if (n?.pagination) {
12745
12749
  if (n.pagination.startAfter && n.pagination.endBefore || n.pagination.startAfter && n.pagination.endAt || n.pagination.startAfter && n.pagination.startAt || n.pagination.startAt && n.pagination.endBefore || n.pagination.startAt && n.pagination.endAt || n.pagination.endBefore && n.pagination.endAt)
12746
12750
  throw new Error("INPUT_ERROR: Only one of startAfter, startAt, endBefore, or endAt can be provided");
12747
- const q = n.pagination.startAfter || n.pagination.endBefore || n.pagination.startAt || n.pagination.endAt, Y = Zd(a.Role, f, o);
12751
+ const q = n.pagination.startAfter || n.pagination.endBefore || n.pagination.startAt || n.pagination.endAt, Y = Zf(a.Role, d, o);
12748
12752
  if (q && Y !== !0)
12749
12753
  throw new Error("INPUT_ERROR: Pagination is not allowed when using " + Y);
12750
12754
  n.pagination.startAfter || n.pagination.endBefore || n.pagination.startAt || n.pagination.endAt ? n.pagination.startAfter ? (to(n.pagination.startAfter), R = R.map((U, H) => {
@@ -12765,21 +12769,21 @@ const tb = async (t, e, r, n) => {
12765
12769
  })) : n.pagination.endAt && (to(n.pagination.endAt), R = R.map((U, H) => {
12766
12770
  if (!n.pagination?.orderByField || !n.pagination.orderByDirection)
12767
12771
  throw new Error("INPUT_ERROR: orderByField and orderByDirection must be provided when using endAt");
12768
- let D = he(U, rt(n.pagination.orderByField, n.pagination.orderByDirection), fp(N.last.get(H)));
12772
+ let D = he(U, rt(n.pagination.orderByField, n.pagination.orderByDirection), dp(N.last.get(H)));
12769
12773
  return n.pagination.number && (D = he(D, Dr(n.pagination.number))), D;
12770
12774
  })) : R = R.map((U) => {
12771
12775
  let H = he(U);
12772
12776
  return n.pagination?.orderByField && n.pagination.orderByDirection && (H = he(U, rt(n.pagination.orderByField, n.pagination.orderByDirection))), n.pagination.number && (H = he(H, er(n.pagination.number))), H;
12773
12777
  });
12774
12778
  }
12775
- const v = { collection: d.collection };
12779
+ const v = { collection: f.collection };
12776
12780
  await ie("preOperation", g, C, { operation: "read", context: v }), await ie("preRead", g, C, { context: v, refs: R, multiple: !0, listener: !0 });
12777
12781
  let m = !0;
12778
12782
  const T = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), L = [], k = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map(), Z = (q, Y, U) => {
12779
12783
  const H = [];
12780
12784
  k.forEach((D) => {
12781
12785
  mm(D, M.get(D.id));
12782
- for (const ue of f.fields)
12786
+ for (const ue of d.fields)
12783
12787
  ue.type === "Computed" && !n?.noComputedFields && H.push(be(ue.formula, [D, U]).then((X) => {
12784
12788
  D[ue.name] = X;
12785
12789
  })), n?.noEmbeddingFields && ue.type === "Embedding" && delete D[ue.name];
@@ -12801,7 +12805,7 @@ const tb = async (t, e, r, n) => {
12801
12805
  D === "loaded" || D === "deleted" || (U = !1);
12802
12806
  }), T.size === _.length && U) {
12803
12807
  m = !1;
12804
- const H = kd(u, () => {
12808
+ const H = kf(u, () => {
12805
12809
  H(), !n?.noComputedFields && C?.admin?.retriever ? be(C.admin.retriever).then((D) => {
12806
12810
  Z(q, Y, D);
12807
12811
  }) : Z(q, Y);
@@ -12810,7 +12814,7 @@ const tb = async (t, e, r, n) => {
12810
12814
  };
12811
12815
  typeof n?.relations == "object" && (n.relations.fields = n.relations.fields.map((q) => {
12812
12816
  if (typeof q == "string") {
12813
- const Y = f.fields.find((U) => U.name === q);
12817
+ const Y = d.fields.find((U) => U.name === q);
12814
12818
  if (Y)
12815
12819
  return Y;
12816
12820
  throw new Error(`SCHEMA_ERROR: Field ${q} not found in collection ${i}`);
@@ -12822,13 +12826,13 @@ const tb = async (t, e, r, n) => {
12822
12826
  return;
12823
12827
  const U = q.id;
12824
12828
  A.set(U, "loading"), z[U] ||= /* @__PURE__ */ new Map();
12825
- const H = ve(n?.relations), D = typeof H == "object" ? H.fields.filter((pe) => typeof pe == "object" && we(pe) && $t(f, o, a).includes(pe.collection)) : f.fields.filter((pe) => we(pe) && $t(f, o, a).includes(pe.collection)), ue = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map();
12829
+ const H = ve(n?.relations), D = typeof H == "object" ? H.fields.filter((pe) => typeof pe == "object" && we(pe) && $t(d, o, a).includes(pe.collection)) : d.fields.filter((pe) => we(pe) && $t(d, o, a).includes(pe.collection)), ue = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map();
12826
12830
  oe[U] ||= /* @__PURE__ */ new Map();
12827
12831
  for (const pe of D)
12828
12832
  for (const _e of z[U].entries()) {
12829
- const [ae, Le] = _e;
12830
- Le.doc === U && Le.type === pe.type && Le.field === pe.name && (!k.has(U) || // eslint-disable-next-line security/detect-object-injection
12831
- !q[pe.name][ae]) && (Le.listener(), oe[U].delete(ae));
12833
+ const [ae, $e] = _e;
12834
+ $e.doc === U && $e.type === pe.type && $e.field === pe.name && (!k.has(U) || // eslint-disable-next-line security/detect-object-injection
12835
+ !q[pe.name][ae]) && ($e.listener(), oe[U].delete(ae));
12832
12836
  }
12833
12837
  for (const pe of D)
12834
12838
  if ("collection" in pe) {
@@ -12846,15 +12850,15 @@ const tb = async (t, e, r, n) => {
12846
12850
  const _e = q[pe.name];
12847
12851
  if (!_e)
12848
12852
  continue;
12849
- for (const [ae, Le] of Object.entries(_e))
12853
+ for (const [ae, $e] of Object.entries(_e))
12850
12854
  if (X.has(ae)) {
12851
- const $e = async () => {
12852
- _e[ae].id ? (ue.set(ae, !0), Array.from(ue.values()).every((ke) => ke) && A.set(U, "loaded")) : setTimeout($e, 100);
12855
+ const je = async () => {
12856
+ _e[ae].id ? (ue.set(ae, !0), Array.from(ue.values()).every((ke) => ke) && A.set(U, "loaded")) : setTimeout(je, 100);
12853
12857
  };
12854
- $e();
12858
+ je();
12855
12859
  } else {
12856
- const $e = o.collections[pe.collection], { access: ke } = $e, { serverReadOnly: Gt } = ke;
12857
- Gt?.includes(a.Role) ? wr([...Le.Collection_Path], ae).then((Ne) => {
12860
+ const je = o.collections[pe.collection], { access: ke } = je, { serverReadOnly: Gt } = ke;
12861
+ Gt?.includes(a.Role) ? wr([...$e.Collection_Path], ae).then((Ne) => {
12858
12862
  if (!Ne) {
12859
12863
  delete _e[ae];
12860
12864
  return;
@@ -12865,11 +12869,11 @@ const tb = async (t, e, r, n) => {
12865
12869
  }
12866
12870
  _e[ae] = Ne, ue.set(ae, !0), Array.from(ue.values()).every((Ht) => Ht) && (A.set(U, "loaded"), re(Y));
12867
12871
  }).catch((Ne) => {
12868
- delete _e[ae], Ne.code !== "permission-denied" && r && r(new Error(`Error fetching relation document in collection ${pe.collection} with ID ${U} at location ${Le.Collection_Path?.join("/")}`, {
12872
+ delete _e[ae], Ne.code !== "permission-denied" && r && r(new Error(`Error fetching relation document in collection ${pe.collection} with ID ${U} at location ${$e.Collection_Path?.join("/")}`, {
12869
12873
  cause: Ne
12870
12874
  }));
12871
12875
  }) : Fm(
12872
- [...Le.Collection_Path],
12876
+ [...$e.Collection_Path],
12873
12877
  ae,
12874
12878
  (Ne) => {
12875
12879
  if (!Ne) {
@@ -12884,7 +12888,7 @@ const tb = async (t, e, r, n) => {
12884
12888
  },
12885
12889
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12886
12890
  (Ne) => {
12887
- delete _e[ae], Ne.code !== "permission-denied" && r && r(new Error(`Error fetching relation document in collection ${pe.collection} with ID ${U} at location ${Le.Collection_Path?.join("/")}`, {
12891
+ delete _e[ae], Ne.code !== "permission-denied" && r && r(new Error(`Error fetching relation document in collection ${pe.collection} with ID ${U} at location ${$e.Collection_Path?.join("/")}`, {
12888
12892
  cause: Ne
12889
12893
  }));
12890
12894
  },
@@ -12904,7 +12908,7 @@ const tb = async (t, e, r, n) => {
12904
12908
  }
12905
12909
  }
12906
12910
  }, K = (q) => {
12907
- const Y = ve(n?.relations), U = typeof Y == "object" ? Y.fields.filter((H) => typeof H == "object" && we(H) && $t(f, o, a).includes(H.collection)) : f.fields.filter((H) => we(H) && $t(f, o, a).includes(H.collection));
12911
+ const Y = ve(n?.relations), U = typeof Y == "object" ? Y.fields.filter((H) => typeof H == "object" && we(H) && $t(d, o, a).includes(H.collection)) : d.fields.filter((H) => we(H) && $t(d, o, a).includes(H.collection));
12908
12912
  for (const H of U)
12909
12913
  if (z[q])
12910
12914
  for (const D of z[q].entries()) {
@@ -12919,7 +12923,7 @@ const tb = async (t, e, r, n) => {
12919
12923
  const D = M.get(U.id) || /* @__PURE__ */ new Map(), ue = D.get(q) || /* @__PURE__ */ new Set();
12920
12924
  hm(H, ue), D.set(q, ue), M.set(U.id, D), k.set(U.id, Y);
12921
12925
  }, Te = n?.only === "cache" || y && n?.only !== "default";
12922
- if (y && n?.tempCache && await ir(d.collection, n.tempCache?.constraints, void 0, void 0, void 0, n.tempCache?.label), n?.multipleQueries) {
12926
+ if (y && n?.tempCache && await ir(f.collection, n.tempCache?.constraints, void 0, void 0, void 0, n.tempCache?.label), n?.multipleQueries) {
12923
12927
  const q = [];
12924
12928
  for (const Y of n.multipleQueries)
12925
12929
  q.push(he(R[0], ...Y));
@@ -12947,7 +12951,7 @@ const tb = async (t, e, r, n) => {
12947
12951
  if (n?.pagination && !h?.roles.includes(a.Role) && !b?.includes(a.Role)) {
12948
12952
  let q = he(E[0], ...s || []);
12949
12953
  n.pagination.orderByField && n.pagination.orderByDirection && (q = he(q, rt(n.pagination.orderByField, n.pagination.orderByDirection)));
12950
- const Y = await Ad(q).catch(() => {
12954
+ const Y = await Af(q).catch(() => {
12951
12955
  });
12952
12956
  if (Y) {
12953
12957
  Xe = Y.data().count;
@@ -12980,10 +12984,10 @@ const tb = async (t, e, r, n) => {
12980
12984
  await Vw(e, r, n, s, i, a);
12981
12985
  return;
12982
12986
  }
12983
- const f = Ja(t), d = hw(e), h = r ? _d(r) : void 0, p = n ? _d(n) : void 0, b = s ? Ja(s) : void 0, g = i ? Ja(i) : void 0, O = a ? An(a) : void 0, S = c ? An(c) : void 0, C = Array.isArray(f) ? f : [f];
12987
+ const d = Ja(t), f = hw(e), h = r ? _f(r) : void 0, p = n ? _f(n) : void 0, b = s ? Ja(s) : void 0, g = i ? Ja(i) : void 0, O = a ? An(a) : void 0, S = c ? An(c) : void 0, C = Array.isArray(d) ? d : [d];
12984
12988
  if (C.length === 0 || C.length === 1 && !C[0])
12985
12989
  throw new Error("No valid email addresses provided");
12986
- const x = ze(), y = { to: f, message: { subject: d } };
12990
+ const x = ze(), y = { to: d, message: { subject: f } };
12987
12991
  if (h && (y.message.text = h), p && (y.message.html = p), b) {
12988
12992
  const E = Array.isArray(b) ? b : [b];
12989
12993
  E.length > 0 && E[0] && (y.cc = b);
@@ -12992,7 +12996,7 @@ const tb = async (t, e, r, n) => {
12992
12996
  const E = Array.isArray(g) ? g : [g];
12993
12997
  E.length > 0 && E[0] && (y.bcc = g);
12994
12998
  }
12995
- O && (y.replyTo = O), o && (y.message.attachments = o), S && (y.from = S), await Id($r(x, "system_mail"), y);
12999
+ O && (y.replyTo = O), o && (y.message.attachments = o), S && (y.from = S), await If($r(x, "system_mail"), y);
12996
13000
  }, Uw = async (t) => {
12997
13001
  const e = it(), r = Be(), n = Ue(e, r.STOKER_FB_FUNCTIONS_REGION);
12998
13002
  await Je(n, "stoker-adminsms")({
@@ -13004,7 +13008,7 @@ const tb = async (t, e, r, n) => {
13004
13008
  return;
13005
13009
  }
13006
13010
  const s = ze(), i = { to: t, body: e };
13007
- await Id($r(s, "system_messages"), i);
13011
+ await If($r(s, "system_messages"), i);
13008
13012
  }, gb = (t) => {
13009
13013
  const e = xm();
13010
13014
  return G.fromJSDate(t).setZone(e);
@@ -13035,7 +13039,7 @@ export {
13035
13039
  nb as getAppCheck,
13036
13040
  sb as getAppCheckFirestoreWrite,
13037
13041
  ne as getCachedConfigValue,
13038
- ft as getCollectionConfigModule,
13042
+ dt as getCollectionConfigModule,
13039
13043
  uc as getCollectionRefs,
13040
13044
  Wt as getConnectionStatus,
13041
13045
  rb as getCurrentUser,
@@ -13079,10 +13083,10 @@ export {
13079
13083
  pb as sendMessage,
13080
13084
  Om as serializeTimestamps,
13081
13085
  Cm as signOut,
13082
- db as subscribeMany,
13086
+ fb as subscribeMany,
13083
13087
  Fm as subscribeOne,
13084
13088
  be as tryPromise,
13085
13089
  mc as updateRecord,
13086
13090
  Ow as updateRecordServer,
13087
- fb as waitForPendingWrites
13091
+ db as waitForPendingWrites
13088
13092
  };