@stoker-platform/node-client 0.5.2 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import ze from "lodash/isEqual.js";
2
- import Uo from "lodash/merge.js";
3
- import Wo from "lodash/set.js";
2
+ import Wo from "lodash/merge.js";
3
+ import jo from "lodash/set.js";
4
4
  import ye from "lodash/cloneDeep.js";
5
- import { getApp as ti, initializeApp as ni, applicationDefault as si } from "firebase-admin/app";
5
+ import { getApp as ni, initializeApp as si, applicationDefault as ri } from "firebase-admin/app";
6
6
  import { getFirestore as ue, Timestamp as lt, FieldValue as me } from "firebase-admin/firestore";
7
- import { spawn as jo } from "node:child_process";
8
- import { getDatabase as ri } from "firebase-admin/database";
7
+ import { spawn as Zo } from "node:child_process";
8
+ import { getDatabase as ii } from "firebase-admin/database";
9
9
  import { getAuth as gt } from "firebase-admin/auth";
10
10
  const jn = (n) => !!n.auth, Te = (n, e) => {
11
11
  if (e?.operations)
12
12
  return e.operations.includes(n);
13
- }, Zn = (n, e) => e ? e.Role ? n.access?.includes(e.Role) : !1 : !0, Zo = (n, e) => n.restrictCreate === !0 ? !1 : e && typeof n.restrictCreate == "object" ? e.Role ? n.restrictCreate?.includes(e.Role) : !1 : !0, ii = (n, e) => n.restrictUpdate === !0 ? !1 : e && typeof n.restrictUpdate == "object" ? e.Role ? n.restrictUpdate?.includes(e.Role) : !1 : !0, rr = (n, e, t) => {
13
+ }, Zn = (n, e) => e ? e.Role ? n.access?.includes(e.Role) : !1 : !0, zo = (n, e) => n.restrictCreate === !0 ? !1 : e && typeof n.restrictCreate == "object" ? e.Role ? n.restrictCreate?.includes(e.Role) : !1 : !0, oi = (n, e) => n.restrictUpdate === !0 ? !1 : e && typeof n.restrictUpdate == "object" ? e.Role ? n.restrictUpdate?.includes(e.Role) : !1 : !0, rr = (n, e, t) => {
14
14
  const { labels: s } = n;
15
15
  return t.collections && // eslint-disable-next-line security/detect-object-injection
16
- Te("Update", t.collections[s.collection]) && (!e.access || Zn(e, t)) && ii(e, t) && !(n.auth && !t.collections?.[s.collection].auth && ["Enabled", "Role", "Name", "Email", "Photo_URL"].includes(e.name));
17
- }, W = (n, e) => n.filter((t) => t.name === e)[0], K = (n) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(n.type), oi = (n, e) => {
16
+ Te("Update", t.collections[s.collection]) && (!e.access || Zn(e, t)) && oi(e, t) && !(n.auth && !t.collections?.[s.collection].auth && ["Enabled", "Role", "Name", "Email", "Photo_URL"].includes(e.name));
17
+ }, W = (n, e) => n.filter((t) => t.name === e)[0], K = (n) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(n.type), ai = (n, e) => {
18
18
  const t = {
19
19
  Record_Owner: "recordOwner",
20
20
  Record_User: "recordUser",
@@ -33,7 +33,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
33
33
  l.role === e.Role && (!i.assignable?.includes(e.Role) || o?.restrictEntities) && t.push(a);
34
34
  });
35
35
  }), t;
36
- }, ai = (n, e, t) => {
36
+ }, li = (n, e, t) => {
37
37
  const s = [], { access: r } = n, { entityRestrictions: i } = r;
38
38
  return i?.parentFilters?.forEach((o) => {
39
39
  if (!o.roles.some((d) => d.role === t.Role))
@@ -51,7 +51,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
51
51
  d.role === t.Role && (!h.assignable?.includes(t.Role) || c?.restrictEntities) && s.push({ parentFilter: o, parentRestriction: f });
52
52
  });
53
53
  }), s;
54
- }, li = (n, e, t) => {
54
+ }, ci = (n, e, t) => {
55
55
  const s = Object.values(e.collections), { labels: r } = n, i = [];
56
56
  for (const o of s) {
57
57
  const { fields: a } = o;
@@ -61,14 +61,14 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
61
61
  !i.find((h) => h.field === c.field) && c.roles.includes(t.Role) && i.push(c);
62
62
  }
63
63
  return i;
64
- }, zo = (n, e, t, s, r, i) => {
64
+ }, qo = (n, e, t, s, r, i) => {
65
65
  const { fields: o } = e, a = r.collections?.[e.labels.collection];
66
66
  let l = !0;
67
67
  if (!a) {
68
68
  l = !1;
69
69
  return;
70
70
  }
71
- const c = oi(e, r), u = Ls(e, r), h = ai(e, t, r);
71
+ const c = ai(e, r), u = Ls(e, r), h = li(e, t, r);
72
72
  c?.filter((p) => p.type === "Record_Owner").forEach((p) => {
73
73
  "operations" in p && p.operations && !p.operations.includes(n) || i.Created_By !== s && (l = !1);
74
74
  }), c?.filter((p) => p.type === "Record_User").forEach((p) => {
@@ -154,13 +154,13 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
154
154
  return l = !1, l;
155
155
  Te(n, a) || (l = !1);
156
156
  const u = Ls(e, r)?.filter((h) => h.type === "Individual").length > 0;
157
- return n === "Create" && u && (l = !1), zo(n, e, t, s, r, i) || (l = !1), l;
158
- }, ci = (n, e, t) => {
157
+ return n === "Create" && u && (l = !1), qo(n, e, t, s, r, i) || (l = !1), l;
158
+ }, ui = (n, e, t) => {
159
159
  const { labels: s } = n, r = [];
160
160
  for (const i of Object.values(e.collections))
161
161
  ;
162
162
  return r;
163
- }, qo = (n, e) => {
163
+ }, Bo = (n, e) => {
164
164
  let t = !0, s = "";
165
165
  return Object.keys(e).forEach((r) => {
166
166
  if (!["Doc_ID", "Role", "Collection", "Enabled", "collections"].includes(r)) {
@@ -247,7 +247,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
247
247
  });
248
248
  }
249
249
  }), s && console.error(`PERMISSION_DENIED: ${s}`)), t;
250
- }, Bo = (n, e, t) => {
250
+ }, Ho = (n, e, t) => {
251
251
  let s = !0, r = "";
252
252
  Object.values(n.collections).filter((i) => i.auth).forEach((i) => {
253
253
  if (e.collections?.[i.labels.collection]?.auth && !i.access.auth?.includes(e.Role)) {
@@ -334,7 +334,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
334
334
  }
335
335
  }
336
336
  return r && console.error(`PERMISSION_DENIED: ${r}`), s;
337
- }, Ho = (n, e, t, s, r, i, o, a, l) => {
337
+ }, Go = (n, e, t, s, r, i, o, a, l) => {
338
338
  const { access: c } = e, { permissionWriteRestrictions: u } = c;
339
339
  let h = !0, f = "";
340
340
  const d = u?.filter((m) => s === m.userRole);
@@ -378,7 +378,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
378
378
  }
379
379
  });
380
380
  }), f && console.error(`PERMISSION_DENIED: ${f}`), h);
381
- }, Go = (n, e, t, s) => {
381
+ }, Yo = (n, e, t, s) => {
382
382
  let r = !0, i = "";
383
383
  return Object.values(n.collections).forEach((o) => {
384
384
  const a = t.collections?.[o.labels.collection], l = s?.collections?.[o.labels.collection], c = e?.collections?.[o.labels.collection];
@@ -420,7 +420,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
420
420
  if (i) {
421
421
  if (!o?.Role)
422
422
  return d = "Current user does not have a role", f = !1, f;
423
- if (!Ho(n, s, r, o.Role, e.Role, a, c, c?.Role, l))
423
+ if (!Go(n, s, r, o.Role, e.Role, a, c, c?.Role, l))
424
424
  return f = !1, f;
425
425
  if (n === "update" && u !== "delete" && c?.User_ID && e.User_ID !== c.User_ID)
426
426
  return d = "User ID does not match original user ID", f = !1, f;
@@ -429,7 +429,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
429
429
  if (n === "delete" && i === e.User_ID)
430
430
  return d = "User cannot delete their own record", f = !1, f;
431
431
  }
432
- return n === "delete" || u === "delete" || !a ? f : a.Role ? (qo(r, a) || (f = !1), a.Collection && a.Collection !== h.collection ? (d = "Permissions collection does not match record collection", f = !1, f) : a.Role !== e.Role ? (d = "Permissions role does not match record role", f = !1, f) : a.Enabled !== void 0 && !!a.Enabled != !!e.Enabled ? (d = "Permissions enabled state does not match record enabled state", f = !1, f) : a.Doc_ID && a.Doc_ID !== t ? (d = "Permissions doc ID does not match record doc ID", f = !1, f) : !Bo(r, a, a.Role) || i && o && l && !Go(r, o, a, l) ? (f = !1, f) : (d && console.error(`PERMISSION_DENIED: ${d}`), f)) : (d = "Permissions do not have a role", f = !1, f);
432
+ return n === "delete" || u === "delete" || !a ? f : a.Role ? (Bo(r, a) || (f = !1), a.Collection && a.Collection !== h.collection ? (d = "Permissions collection does not match record collection", f = !1, f) : a.Role !== e.Role ? (d = "Permissions role does not match record role", f = !1, f) : a.Enabled !== void 0 && !!a.Enabled != !!e.Enabled ? (d = "Permissions enabled state does not match record enabled state", f = !1, f) : a.Doc_ID && a.Doc_ID !== t ? (d = "Permissions doc ID does not match record doc ID", f = !1, f) : !Ho(r, a, a.Role) || i && o && l && !Yo(r, o, a, l) ? (f = !1, f) : (d && console.error(`PERMISSION_DENIED: ${d}`), f)) : (d = "Permissions do not have a role", f = !1, f);
433
433
  }, ir = (n, e, t, s, r, i, o) => {
434
434
  const { labels: a, fields: l } = t, c = i?.collections?.[a.collection];
435
435
  let u = !0;
@@ -439,7 +439,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
439
439
  !it("Create", t, s, r, i, n) && (u = !1), t.auth && o && (r && !jn(c) && (u = !1), Vs("create", n, e, t, s, r, i, o) || (u = !1));
440
440
  for (const h of l) {
441
441
  const f = n[h.name];
442
- h.access && !Zn(h, i) && f !== void 0 && (u = !1), f !== void 0 && !Zo(h, i) && (u = !1);
442
+ h.access && !Zn(h, i) && f !== void 0 && (u = !1), f !== void 0 && !zo(h, i) && (u = !1);
443
443
  }
444
444
  if (!u)
445
445
  throw new Error("PERMISSION_DENIED");
@@ -457,18 +457,18 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
457
457
  !it("Update", s, r, i, o, d)) && (m = !1, O = "Authenticated user does not have Update access to this document"), a && (i && !jn(f) && (m = !1, O = "Authenticated user does not have Auth access for this collection"), Vs("update", d, t, s, r, i, o, l, c, e, a) || (O = "Authenticated user does not have sufficient write access for this record", m = !1));
458
458
  for (const y of h) {
459
459
  const w = n[y.name];
460
- y.access && !Zn(y, o) && w !== void 0 && (O = `Authenticated user does not have access to field ${y.name}`, m = !1), w !== void 0 && !ii(y, o) && (O = `Authenticated user does not have Update access to field ${y.name}`, m = !1);
460
+ y.access && !Zn(y, o) && w !== void 0 && (O = `Authenticated user does not have access to field ${y.name}`, m = !1), w !== void 0 && !oi(y, o) && (O = `Authenticated user does not have Update access to field ${y.name}`, m = !1);
461
461
  }
462
462
  if (!m)
463
463
  throw O && console.error(`PERMISSION_DENIED: ${O}`), new Error("PERMISSION_DENIED");
464
- }, Yo = (n, e, t, s, r, i) => {
464
+ }, Jo = (n, e, t, s, r, i) => {
465
465
  const { labels: o } = t, a = i.collections?.[o.collection];
466
466
  let l = !0;
467
467
  if (!a)
468
468
  throw new Error("PERMISSION_DENIED");
469
469
  if (Te("Delete", a) || (l = !1), it("Delete", t, s, r, i, n) || (l = !1), t.auth && n.User_ID && (jn(a) || (l = !1), Vs("delete", n, e, t, s, r, i) || (l = !1)), !l)
470
470
  throw new Error("PERMISSION_DENIED");
471
- }, Jo = async (n, e, t, s, r) => {
471
+ }, Qo = async (n, e, t, s, r) => {
472
472
  const { labels: i } = e, o = r.collections?.[i.collection];
473
473
  let a = !0;
474
474
  if (!o) {
@@ -477,7 +477,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
477
477
  }
478
478
  if (Te("Read", o) || (a = !1), it("Read", e, t, s, r, n) || (a = !1), !a)
479
479
  throw new Error("PERMISSION_DENIED");
480
- }, Qo = async (n, e, t, s, r) => {
480
+ }, Ko = async (n, e, t, s, r) => {
481
481
  const { labels: i } = e, o = r.collections?.[i.collection];
482
482
  let a = !0;
483
483
  if (!o) {
@@ -488,11 +488,11 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
488
488
  it("Read", e, t, s, r, l) || (a = !1);
489
489
  }), !a)
490
490
  throw new Error("PERMISSION_DENIED");
491
- }, Ko = (n, e, t) => {
491
+ }, Xo = (n, e, t) => {
492
492
  const { access: s } = n;
493
493
  return s.operations.assignable === !0 || typeof s.operations.assignable == "object" && s.operations.assignable.includes(e) || // eslint-disable-next-line security/detect-object-injection
494
494
  s.operations[t]?.includes(e);
495
- }, Xo = (n, e, t) => {
495
+ }, ea = (n, e, t) => {
496
496
  const { access: s } = e, { entityRestrictions: r } = s;
497
497
  if (r?.restrictions) {
498
498
  for (const i of r.restrictions)
@@ -515,7 +515,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
515
515
  return `${i.type} parent filter`;
516
516
  }
517
517
  return !0;
518
- }, ea = (n, e, t, s, r) => {
518
+ }, ta = (n, e, t, s, r) => {
519
519
  const i = {};
520
520
  for (const o of n) {
521
521
  const l = e[o].default(t, s, r);
@@ -533,7 +533,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
533
533
  }, qt = (n, e) => n && typeof n == "function" ? e ? n(...e) : n() : n, ie = async (n, e) => {
534
534
  let t = n;
535
535
  return n && (typeof n == "function" || typeof n.then == "function") && (e ? t = await n(...e) : t = await n()), t;
536
- }, su = async (n, e, t, s) => {
536
+ }, ru = async (n, e, t, s) => {
537
537
  for (const u of e)
538
538
  if (u === "__proto__" || u === "constructor" || u === "prototype")
539
539
  throw new Error("Invalid config path: prototype pollution keys are not allowed");
@@ -565,10 +565,10 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
565
565
  if (d !== void 0) {
566
566
  if (d === "__proto__" || d === "constructor" || d === "prototype")
567
567
  throw new Error("Invalid config path: prototype pollution keys are not allowed");
568
- f === e.length - 1 ? Wo(h, e.join("."), c) : (u[d] ||= {}, u = u[d]);
568
+ f === e.length - 1 ? jo(h, e.join("."), c) : (u[d] ||= {}, u = u[d]);
569
569
  }
570
570
  }
571
- Uo(Xn, h);
571
+ Wo(Xn, h);
572
572
  }
573
573
  return c;
574
574
  }, ct = (n, e, t) => {
@@ -582,7 +582,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
582
582
  c.field == n.name && (i = !0);
583
583
  }
584
584
  return i;
585
- }, ui = (n, e) => {
585
+ }, di = (n, e) => {
586
586
  const t = Object.values(e.collections), { labels: s } = n, r = {};
587
587
  return t.forEach((i) => {
588
588
  const { labels: o, fields: a } = i;
@@ -649,7 +649,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
649
649
  required: !0
650
650
  };
651
651
  return t && (s.values = t), s;
652
- }), di = (n, e) => {
652
+ }), fi = (n, e) => {
653
653
  const t = [], { access: s, fields: r } = n, { attributeRestrictions: i, entityRestrictions: o } = s, a = zn();
654
654
  return i && i.forEach((l) => {
655
655
  if (l.roles.some((c) => c.role === e))
@@ -691,7 +691,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
691
691
  break;
692
692
  }
693
693
  })), [...new Set(t)];
694
- }, ta = (n, e) => {
694
+ }, na = (n, e) => {
695
695
  const t = [], { fields: s, roleSystemFields: r, preloadCache: i, queries: o } = n, a = zn();
696
696
  return t.push({
697
697
  name: "Collection_Path",
@@ -706,15 +706,15 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
706
706
  }), o?.forEach((c) => {
707
707
  const u = W(s.concat(a), c.field);
708
708
  (!c.roles || c.roles.includes(e)) && u && (!u.access || u.access?.includes(e)) && pt.includes(c.field) && t.push(W(a, c.field));
709
- }), di(n, e).forEach((c) => {
709
+ }), fi(n, e).forEach((c) => {
710
710
  pt.includes(c.name) && t.push(W(a, c.name));
711
711
  }), [...new Set(t)];
712
- }, na = (n, e, t) => {
712
+ }, sa = (n, e, t) => {
713
713
  const s = [], { fields: r, preloadCache: i } = e, o = zn();
714
714
  i?.range && i.range.fields.forEach((c) => {
715
715
  pt.includes(c) ? s.push(W(o, c)) : s.push(W(r, c));
716
716
  });
717
- const a = /* @__PURE__ */ new Set(), l = ui(e, t);
717
+ const a = /* @__PURE__ */ new Set(), l = di(e, t);
718
718
  return Object.entries(l).map(([c, u]) => {
719
719
  n.name === c && Object.values(u).forEach((h) => {
720
720
  h.forEach((f) => {
@@ -722,7 +722,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
722
722
  });
723
723
  });
724
724
  }), a.forEach((c) => {
725
- s.push(...di(e, c));
725
+ s.push(...fi(e, c));
726
726
  }), [...new Set(s)];
727
727
  }, dn = (n, e, t) => {
728
728
  const s = [], { fields: r, softDelete: i } = e;
@@ -735,7 +735,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
735
735
  type: "String",
736
736
  required: !0
737
737
  });
738
- const o = [], a = ui(e, t);
738
+ const o = [], a = di(e, t);
739
739
  if (Object.values(a).forEach((l) => {
740
740
  Object.keys(l).forEach((c) => {
741
741
  t.collections[c].fields.forEach((h) => {
@@ -750,13 +750,13 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
750
750
  const l = W(r, i.archivedField);
751
751
  l && s.push(l);
752
752
  }
753
- return s.push(...na(n, e, t)), [...new Set(s)];
754
- }, fi = (n, e) => {
753
+ return s.push(...sa(n, e, t)), [...new Set(s)];
754
+ }, hi = (n, e) => {
755
755
  const { preloadCache: t } = n, s = /* @__PURE__ */ new Set();
756
756
  for (const r of e.config.roles) {
757
- if (!Ko(n, r, "read"))
757
+ if (!Xo(n, r, "read"))
758
758
  continue;
759
- const i = ta(n, r);
759
+ const i = na(n, r);
760
760
  let o = !1;
761
761
  if (s.size === 0)
762
762
  s.add({ key: "1", roles: [r], fields: i }), o = !0;
@@ -766,12 +766,12 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
766
766
  o || s.add({ key: (s.size + 1).toString(), roles: [r], fields: i });
767
767
  }
768
768
  return s;
769
- }, hi = (n, e, t) => {
770
- const s = fi(e, t);
769
+ }, mi = (n, e, t) => {
770
+ const s = hi(e, t);
771
771
  for (const r of s.values())
772
772
  if (r.roles.includes(n))
773
773
  return r;
774
- }, sa = (n, e) => {
774
+ }, ra = (n, e) => {
775
775
  const { fields: t } = e, s = zn(), r = [];
776
776
  return [...t, ...s.filter((o) => o.name !== "id")].forEach((o) => {
777
777
  n?.fields.some((a) => a.name === o.name) || r.push(o);
@@ -779,7 +779,7 @@ const jn = (n) => !!n.auth, Te = (n, e) => {
779
779
  }, Us = (n, e, t) => {
780
780
  const s = {};
781
781
  return Object.values(n.collections).forEach((r) => {
782
- const i = fi(r, n), o = Array.from(i);
782
+ const i = hi(r, n), o = Array.from(i);
783
783
  o.map((a) => (a.fields.forEach((l) => {
784
784
  }), a)), s[r.labels.collection] = new Set(o);
785
785
  }), s;
@@ -852,7 +852,7 @@ const Ws = (n, e, t, s, r, i, o, a, l, c) => (n == "create" && (t.Collection_Pat
852
852
  wt(n, n.fields).forEach((s) => {
853
853
  e[s.name] ? e[`${s.name}_Lowercase`] = e[s.name].toLowerCase() : delete e[`${s.name}_Lowercase`];
854
854
  });
855
- }, ra = async (n, e, t, s) => {
855
+ }, ia = async (n, e, t, s) => {
856
856
  const { fields: r } = e;
857
857
  for (const i of t.fields) {
858
858
  const o = W(r, i.name);
@@ -1086,11 +1086,11 @@ const ws = (n, e) => {
1086
1086
  }
1087
1087
  return { message: t };
1088
1088
  };
1089
- let ia = ws;
1090
- function oa() {
1091
- return ia;
1089
+ let oa = ws;
1090
+ function aa() {
1091
+ return oa;
1092
1092
  }
1093
- const aa = (n) => {
1093
+ const la = (n) => {
1094
1094
  const { data: e, path: t, errorMaps: s, issueData: r } = n, i = [...t, ...r.path || []], o = {
1095
1095
  ...r,
1096
1096
  path: i
@@ -1112,7 +1112,7 @@ const aa = (n) => {
1112
1112
  };
1113
1113
  };
1114
1114
  function L(n, e) {
1115
- const t = oa(), s = aa({
1115
+ const t = aa(), s = la({
1116
1116
  issueData: e,
1117
1117
  data: n.data,
1118
1118
  path: n.path,
@@ -1394,7 +1394,7 @@ class X {
1394
1394
  });
1395
1395
  }
1396
1396
  brand() {
1397
- return new Ia({
1397
+ return new Da({
1398
1398
  typeName: G.ZodBranded,
1399
1399
  type: this,
1400
1400
  ...J(this._def)
@@ -1429,28 +1429,28 @@ class X {
1429
1429
  return this.safeParse(null).success;
1430
1430
  }
1431
1431
  }
1432
- const la = /^c[^\s-]{8,}$/i, ca = /^[0-9a-z]+$/, ua = /^[0-9A-HJKMNP-TV-Z]{26}$/i, da = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, fa = /^[a-z0-9_-]{21}$/i, ha = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, ma = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, pa = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ya = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1432
+ const ca = /^c[^\s-]{8,}$/i, ua = /^[0-9a-z]+$/, da = /^[0-9A-HJKMNP-TV-Z]{26}$/i, fa = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, ha = /^[a-z0-9_-]{21}$/i, ma = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, pa = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, ya = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ga = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
1433
1433
  let ns;
1434
- const ga = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, wa = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, _a = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Ea = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, va = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Oa = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, mi = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", ka = new RegExp(`^${mi}$`);
1435
- function pi(n) {
1434
+ const wa = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, _a = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Ea = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, va = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Oa = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ka = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, pi = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", ba = new RegExp(`^${pi}$`);
1435
+ function yi(n) {
1436
1436
  let e = "[0-5]\\d";
1437
1437
  n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`);
1438
1438
  const t = n.precision ? "+" : "?";
1439
1439
  return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
1440
1440
  }
1441
- function ba(n) {
1442
- return new RegExp(`^${pi(n)}$`);
1443
- }
1444
1441
  function Sa(n) {
1445
- let e = `${mi}T${pi(n)}`;
1442
+ return new RegExp(`^${yi(n)}$`);
1443
+ }
1444
+ function Ta(n) {
1445
+ let e = `${pi}T${yi(n)}`;
1446
1446
  const t = [];
1447
1447
  return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
1448
1448
  }
1449
- function Ta(n, e) {
1450
- return !!((e === "v4" || !e) && ga.test(n) || (e === "v6" || !e) && _a.test(n));
1451
- }
1452
1449
  function Ra(n, e) {
1453
- if (!ha.test(n))
1450
+ return !!((e === "v4" || !e) && wa.test(n) || (e === "v6" || !e) && Ea.test(n));
1451
+ }
1452
+ function Na(n, e) {
1453
+ if (!ma.test(n))
1454
1454
  return !1;
1455
1455
  try {
1456
1456
  const [t] = n.split(".");
@@ -1462,8 +1462,8 @@ function Ra(n, e) {
1462
1462
  return !1;
1463
1463
  }
1464
1464
  }
1465
- function Na(n, e) {
1466
- return !!((e === "v4" || !e) && wa.test(n) || (e === "v6" || !e) && Ea.test(n));
1465
+ function xa(n, e) {
1466
+ return !!((e === "v4" || !e) && _a.test(n) || (e === "v6" || !e) && va.test(n));
1467
1467
  }
1468
1468
  class qe extends X {
1469
1469
  _parse(e) {
@@ -1514,43 +1514,43 @@ class qe extends X {
1514
1514
  message: i.message
1515
1515
  }), s.dirty());
1516
1516
  } else if (i.kind === "email")
1517
- pa.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1517
+ ya.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1518
1518
  validation: "email",
1519
1519
  code: I.invalid_string,
1520
1520
  message: i.message
1521
1521
  }), s.dirty());
1522
1522
  else if (i.kind === "emoji")
1523
- ns || (ns = new RegExp(ya, "u")), ns.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1523
+ ns || (ns = new RegExp(ga, "u")), ns.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1524
1524
  validation: "emoji",
1525
1525
  code: I.invalid_string,
1526
1526
  message: i.message
1527
1527
  }), s.dirty());
1528
1528
  else if (i.kind === "uuid")
1529
- da.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1529
+ fa.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1530
1530
  validation: "uuid",
1531
1531
  code: I.invalid_string,
1532
1532
  message: i.message
1533
1533
  }), s.dirty());
1534
1534
  else if (i.kind === "nanoid")
1535
- fa.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1535
+ ha.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1536
1536
  validation: "nanoid",
1537
1537
  code: I.invalid_string,
1538
1538
  message: i.message
1539
1539
  }), s.dirty());
1540
1540
  else if (i.kind === "cuid")
1541
- la.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1541
+ ca.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1542
1542
  validation: "cuid",
1543
1543
  code: I.invalid_string,
1544
1544
  message: i.message
1545
1545
  }), s.dirty());
1546
1546
  else if (i.kind === "cuid2")
1547
- ca.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1547
+ ua.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1548
1548
  validation: "cuid2",
1549
1549
  code: I.invalid_string,
1550
1550
  message: i.message
1551
1551
  }), s.dirty());
1552
1552
  else if (i.kind === "ulid")
1553
- ua.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1553
+ da.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1554
1554
  validation: "ulid",
1555
1555
  code: I.invalid_string,
1556
1556
  message: i.message
@@ -1581,39 +1581,39 @@ class qe extends X {
1581
1581
  code: I.invalid_string,
1582
1582
  validation: { endsWith: i.value },
1583
1583
  message: i.message
1584
- }), s.dirty()) : i.kind === "datetime" ? Sa(i).test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1584
+ }), s.dirty()) : i.kind === "datetime" ? Ta(i).test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1585
1585
  code: I.invalid_string,
1586
1586
  validation: "datetime",
1587
1587
  message: i.message
1588
- }), s.dirty()) : i.kind === "date" ? ka.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1588
+ }), s.dirty()) : i.kind === "date" ? ba.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1589
1589
  code: I.invalid_string,
1590
1590
  validation: "date",
1591
1591
  message: i.message
1592
- }), s.dirty()) : i.kind === "time" ? ba(i).test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1592
+ }), s.dirty()) : i.kind === "time" ? Sa(i).test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1593
1593
  code: I.invalid_string,
1594
1594
  validation: "time",
1595
1595
  message: i.message
1596
- }), s.dirty()) : i.kind === "duration" ? ma.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1596
+ }), s.dirty()) : i.kind === "duration" ? pa.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1597
1597
  validation: "duration",
1598
1598
  code: I.invalid_string,
1599
1599
  message: i.message
1600
- }), s.dirty()) : i.kind === "ip" ? Ta(e.data, i.version) || (r = this._getOrReturnCtx(e, r), L(r, {
1600
+ }), s.dirty()) : i.kind === "ip" ? Ra(e.data, i.version) || (r = this._getOrReturnCtx(e, r), L(r, {
1601
1601
  validation: "ip",
1602
1602
  code: I.invalid_string,
1603
1603
  message: i.message
1604
- }), s.dirty()) : i.kind === "jwt" ? Ra(e.data, i.alg) || (r = this._getOrReturnCtx(e, r), L(r, {
1604
+ }), s.dirty()) : i.kind === "jwt" ? Na(e.data, i.alg) || (r = this._getOrReturnCtx(e, r), L(r, {
1605
1605
  validation: "jwt",
1606
1606
  code: I.invalid_string,
1607
1607
  message: i.message
1608
- }), s.dirty()) : i.kind === "cidr" ? Na(e.data, i.version) || (r = this._getOrReturnCtx(e, r), L(r, {
1608
+ }), s.dirty()) : i.kind === "cidr" ? xa(e.data, i.version) || (r = this._getOrReturnCtx(e, r), L(r, {
1609
1609
  validation: "cidr",
1610
1610
  code: I.invalid_string,
1611
1611
  message: i.message
1612
- }), s.dirty()) : i.kind === "base64" ? va.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1612
+ }), s.dirty()) : i.kind === "base64" ? Oa.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1613
1613
  validation: "base64",
1614
1614
  code: I.invalid_string,
1615
1615
  message: i.message
1616
- }), s.dirty()) : i.kind === "base64url" ? Oa.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1616
+ }), s.dirty()) : i.kind === "base64url" ? ka.test(e.data) || (r = this._getOrReturnCtx(e, r), L(r, {
1617
1617
  validation: "base64url",
1618
1618
  code: I.invalid_string,
1619
1619
  message: i.message
@@ -1848,7 +1848,7 @@ qe.create = (n) => new qe({
1848
1848
  coerce: n?.coerce ?? !1,
1849
1849
  ...J(n)
1850
1850
  });
1851
- function xa(n, e) {
1851
+ function Ia(n, e) {
1852
1852
  const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, i = Number.parseInt(n.toFixed(r).replace(".", "")), o = Number.parseInt(e.toFixed(r).replace(".", ""));
1853
1853
  return i % o / 10 ** r;
1854
1854
  }
@@ -1887,7 +1887,7 @@ class It extends X {
1887
1887
  inclusive: i.inclusive,
1888
1888
  exact: !1,
1889
1889
  message: i.message
1890
- }), r.dirty()) : i.kind === "multipleOf" ? xa(e.data, i.value) !== 0 && (s = this._getOrReturnCtx(e, s), L(s, {
1890
+ }), r.dirty()) : i.kind === "multipleOf" ? Ia(e.data, i.value) !== 0 && (s = this._getOrReturnCtx(e, s), L(s, {
1891
1891
  code: I.not_multiple_of,
1892
1892
  multipleOf: i.value,
1893
1893
  message: i.message
@@ -2711,7 +2711,7 @@ class fe extends X {
2711
2711
  });
2712
2712
  }
2713
2713
  keyof() {
2714
- return yi(te.objectKeys(this.shape));
2714
+ return gi(te.objectKeys(this.shape));
2715
2715
  }
2716
2716
  }
2717
2717
  fe.create = (n, e) => new fe({
@@ -3110,7 +3110,7 @@ ks.create = (n, e) => new ks({
3110
3110
  typeName: G.ZodLiteral,
3111
3111
  ...J(e)
3112
3112
  });
3113
- function yi(n, e) {
3113
+ function gi(n, e) {
3114
3114
  return new Dt({
3115
3115
  values: n,
3116
3116
  typeName: G.ZodEnum,
@@ -3171,7 +3171,7 @@ class Dt extends X {
3171
3171
  });
3172
3172
  }
3173
3173
  }
3174
- Dt.create = yi;
3174
+ Dt.create = gi;
3175
3175
  class gr extends X {
3176
3176
  _parse(e) {
3177
3177
  const t = te.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
@@ -3424,7 +3424,7 @@ wr.create = (n) => new wr({
3424
3424
  typeName: G.ZodNaN,
3425
3425
  ...J(n)
3426
3426
  });
3427
- class Ia extends X {
3427
+ class Da extends X {
3428
3428
  _parse(e) {
3429
3429
  const { ctx: t } = this._processInputParams(e), s = t.data;
3430
3430
  return this._def.type._parse({
@@ -3508,7 +3508,7 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
3508
3508
  message: "Value is not a valid timestamp"
3509
3509
  }), _r = () => ge().refine((n) => n && (n._methodName === "serverTimestamp" || n.constructor.name === "ServerTimestampTransform"), {
3510
3510
  message: "Value is not a valid server timestamp"
3511
- }), gi = (n, e) => {
3511
+ }), wi = (n, e) => {
3512
3512
  const t = {};
3513
3513
  if (n.includeFields) {
3514
3514
  const s = e.collections[n.collection];
@@ -3525,10 +3525,10 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
3525
3525
  Collection_Path: _t(be()),
3526
3526
  ...t
3527
3527
  });
3528
- }, Da = (n, e) => {
3529
- let t = rn(gi(n, e));
3528
+ }, Aa = (n, e) => {
3529
+ let t = rn(wi(n, e));
3530
3530
  return n.required || (t = t.optional()), t;
3531
- }, Aa = (n) => {
3531
+ }, Ca = (n) => {
3532
3532
  let e = _t(Oe([be().length(20), be().length(28)]));
3533
3533
  return ["OneToOne", "OneToMany"].includes(n.type) ? e = e.max(1) : (n.min && (e = e.min(n.min)), n.max && (e = e.max(n.max)), n.length && (e = e.length(n.length))), n.required ? e = e.nonempty() : e = e.optional(), e;
3534
3534
  }, Mn = (n, e, t) => {
@@ -3580,7 +3580,7 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
3580
3580
  break;
3581
3581
  }
3582
3582
  return !K(e) && e.nullable && (i = i.nullable()), e.required || (i = i.optional()), i;
3583
- }, Ca = (n, e, t) => {
3583
+ }, $a = (n, e, t) => {
3584
3584
  const s = {
3585
3585
  Collection_Path: _t(be()),
3586
3586
  Last_Write_App: be(),
@@ -3596,7 +3596,7 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
3596
3596
  n === "create" && (s.Saved_At = _r()), n === "update" && (s.Saved_At = wn(), s.Collection_Path = s.Collection_Path.optional(), s.id = s.id.optional(), s.Created_At = s.Created_At.optional(), s.Saved_At = s.Saved_At.optional(), s.Created_By = s.Created_By.optional());
3597
3597
  const r = ft(e, e.fields), i = Array.from(r).map((l) => l.name);
3598
3598
  e.fields.forEach((l) => {
3599
- K(l) ? (s[l.name] = Da(l, t), s[`${l.name}_Array`] = Aa(l), i.includes(l.name) && (s[`${l.name}_Single`] = gi(l, t), l.required || (s[`${l.name}_Single`] = s[`${l.name}_Single`].optional())), l.length && (s[l.name] = s[l.name].refine((c) => l.length && c && Object.keys(c).length === l.length, {
3599
+ K(l) ? (s[l.name] = Aa(l, t), s[`${l.name}_Array`] = Ca(l), i.includes(l.name) && (s[`${l.name}_Single`] = wi(l, t), l.required || (s[`${l.name}_Single`] = s[`${l.name}_Single`].optional())), l.length && (s[l.name] = s[l.name].refine((c) => l.length && c && Object.keys(c).length === l.length, {
3600
3600
  message: `Value must contain ${l.length} item(s)`
3601
3601
  })), l.min && (s[l.name] = s[l.name].refine((c) => l.min && c && Object.keys(c).length >= l.min, {
3602
3602
  message: `Value must contain at least ${l.min} item(s)`
@@ -3611,24 +3611,24 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
3611
3611
  };
3612
3612
  class Et extends Error {
3613
3613
  }
3614
- class $a extends Et {
3614
+ class Ma extends Et {
3615
3615
  constructor(e) {
3616
3616
  super(`Invalid DateTime: ${e.toMessage()}`);
3617
3617
  }
3618
3618
  }
3619
- class Ma extends Et {
3619
+ class Fa extends Et {
3620
3620
  constructor(e) {
3621
3621
  super(`Invalid Interval: ${e.toMessage()}`);
3622
3622
  }
3623
3623
  }
3624
- class Fa extends Et {
3624
+ class Pa extends Et {
3625
3625
  constructor(e) {
3626
3626
  super(`Invalid Duration: ${e.toMessage()}`);
3627
3627
  }
3628
3628
  }
3629
3629
  class St extends Et {
3630
3630
  }
3631
- class wi extends Et {
3631
+ class _i extends Et {
3632
3632
  constructor(e) {
3633
3633
  super(`Invalid unit ${e}`);
3634
3634
  }
@@ -3644,103 +3644,103 @@ const $ = "numeric", Pe = "short", Se = "long", Fn = {
3644
3644
  year: $,
3645
3645
  month: $,
3646
3646
  day: $
3647
- }, _i = {
3647
+ }, Ei = {
3648
3648
  year: $,
3649
3649
  month: Pe,
3650
3650
  day: $
3651
- }, Pa = {
3651
+ }, La = {
3652
3652
  year: $,
3653
3653
  month: Pe,
3654
3654
  day: $,
3655
3655
  weekday: Pe
3656
- }, Ei = {
3656
+ }, vi = {
3657
3657
  year: $,
3658
3658
  month: Se,
3659
3659
  day: $
3660
- }, vi = {
3660
+ }, Oi = {
3661
3661
  year: $,
3662
3662
  month: Se,
3663
3663
  day: $,
3664
3664
  weekday: Se
3665
- }, Oi = {
3665
+ }, ki = {
3666
3666
  hour: $,
3667
3667
  minute: $
3668
- }, ki = {
3668
+ }, bi = {
3669
3669
  hour: $,
3670
3670
  minute: $,
3671
3671
  second: $
3672
- }, bi = {
3672
+ }, Si = {
3673
3673
  hour: $,
3674
3674
  minute: $,
3675
3675
  second: $,
3676
3676
  timeZoneName: Pe
3677
- }, Si = {
3677
+ }, Ti = {
3678
3678
  hour: $,
3679
3679
  minute: $,
3680
3680
  second: $,
3681
3681
  timeZoneName: Se
3682
- }, Ti = {
3682
+ }, Ri = {
3683
3683
  hour: $,
3684
3684
  minute: $,
3685
3685
  hourCycle: "h23"
3686
- }, Ri = {
3686
+ }, Ni = {
3687
3687
  hour: $,
3688
3688
  minute: $,
3689
3689
  second: $,
3690
3690
  hourCycle: "h23"
3691
- }, Ni = {
3691
+ }, xi = {
3692
3692
  hour: $,
3693
3693
  minute: $,
3694
3694
  second: $,
3695
3695
  hourCycle: "h23",
3696
3696
  timeZoneName: Pe
3697
- }, xi = {
3697
+ }, Ii = {
3698
3698
  hour: $,
3699
3699
  minute: $,
3700
3700
  second: $,
3701
3701
  hourCycle: "h23",
3702
3702
  timeZoneName: Se
3703
- }, Ii = {
3703
+ }, Di = {
3704
3704
  year: $,
3705
3705
  month: $,
3706
3706
  day: $,
3707
3707
  hour: $,
3708
3708
  minute: $
3709
- }, Di = {
3709
+ }, Ai = {
3710
3710
  year: $,
3711
3711
  month: $,
3712
3712
  day: $,
3713
3713
  hour: $,
3714
3714
  minute: $,
3715
3715
  second: $
3716
- }, Ai = {
3716
+ }, Ci = {
3717
3717
  year: $,
3718
3718
  month: Pe,
3719
3719
  day: $,
3720
3720
  hour: $,
3721
3721
  minute: $
3722
- }, Ci = {
3722
+ }, $i = {
3723
3723
  year: $,
3724
3724
  month: Pe,
3725
3725
  day: $,
3726
3726
  hour: $,
3727
3727
  minute: $,
3728
3728
  second: $
3729
- }, La = {
3729
+ }, Va = {
3730
3730
  year: $,
3731
3731
  month: Pe,
3732
3732
  day: $,
3733
3733
  weekday: Pe,
3734
3734
  hour: $,
3735
3735
  minute: $
3736
- }, $i = {
3736
+ }, Mi = {
3737
3737
  year: $,
3738
3738
  month: Se,
3739
3739
  day: $,
3740
3740
  hour: $,
3741
3741
  minute: $,
3742
3742
  timeZoneName: Pe
3743
- }, Mi = {
3743
+ }, Fi = {
3744
3744
  year: $,
3745
3745
  month: Se,
3746
3746
  day: $,
@@ -3748,7 +3748,7 @@ const $ = "numeric", Pe = "short", Se = "long", Fn = {
3748
3748
  minute: $,
3749
3749
  second: $,
3750
3750
  timeZoneName: Pe
3751
- }, Fi = {
3751
+ }, Pi = {
3752
3752
  year: $,
3753
3753
  month: Se,
3754
3754
  day: $,
@@ -3756,7 +3756,7 @@ const $ = "numeric", Pe = "short", Se = "long", Fn = {
3756
3756
  hour: $,
3757
3757
  minute: $,
3758
3758
  timeZoneName: Se
3759
- }, Pi = {
3759
+ }, Li = {
3760
3760
  year: $,
3761
3761
  month: Se,
3762
3762
  day: $,
@@ -3873,7 +3873,7 @@ class qn extends on {
3873
3873
  }
3874
3874
  /** @override **/
3875
3875
  offsetName(e, { format: t, locale: s }) {
3876
- return Gi(e, t, s);
3876
+ return Yi(e, t, s);
3877
3877
  }
3878
3878
  /** @override **/
3879
3879
  formatOffset(e, t) {
@@ -3893,7 +3893,7 @@ class qn extends on {
3893
3893
  }
3894
3894
  }
3895
3895
  const Rs = /* @__PURE__ */ new Map();
3896
- function Va(n) {
3896
+ function Ua(n) {
3897
3897
  let e = Rs.get(n);
3898
3898
  return e === void 0 && (e = new Intl.DateTimeFormat("en-US", {
3899
3899
  hour12: !1,
@@ -3907,7 +3907,7 @@ function Va(n) {
3907
3907
  era: "short"
3908
3908
  }), Rs.set(n, e)), e;
3909
3909
  }
3910
- const Ua = {
3910
+ const Wa = {
3911
3911
  year: 0,
3912
3912
  month: 1,
3913
3913
  day: 2,
@@ -3916,14 +3916,14 @@ const Ua = {
3916
3916
  minute: 5,
3917
3917
  second: 6
3918
3918
  };
3919
- function Wa(n, e) {
3919
+ function ja(n, e) {
3920
3920
  const t = n.format(e).replace(/\u200E/g, ""), s = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t), [, r, i, o, a, l, c, u] = s;
3921
3921
  return [o, r, i, a, l, c, u];
3922
3922
  }
3923
- function ja(n, e) {
3923
+ function Za(n, e) {
3924
3924
  const t = n.formatToParts(e), s = [];
3925
3925
  for (let r = 0; r < t.length; r++) {
3926
- const { type: i, value: o } = t[r], a = Ua[i];
3926
+ const { type: i, value: o } = t[r], a = Wa[i];
3927
3927
  i === "era" ? s[a] = o : H(a) || (s[a] = parseInt(o, 10));
3928
3928
  }
3929
3929
  return s;
@@ -4011,7 +4011,7 @@ class He extends on {
4011
4011
  * @return {string}
4012
4012
  */
4013
4013
  offsetName(e, { format: t, locale: s }) {
4014
- return Gi(e, t, s, this.name);
4014
+ return Yi(e, t, s, this.name);
4015
4015
  }
4016
4016
  /**
4017
4017
  * Returns the offset's value as a string
@@ -4034,8 +4034,8 @@ class He extends on {
4034
4034
  if (!this.valid) return NaN;
4035
4035
  const t = new Date(e);
4036
4036
  if (isNaN(t)) return NaN;
4037
- const s = Va(this.name);
4038
- let [r, i, o, a, l, c, u] = s.formatToParts ? ja(s, t) : Wa(s, t);
4037
+ const s = Ua(this.name);
4038
+ let [r, i, o, a, l, c, u] = s.formatToParts ? Za(s, t) : ja(s, t);
4039
4039
  a === "BC" && (r = -Math.abs(r) + 1);
4040
4040
  const f = Hn({
4041
4041
  year: r,
@@ -4069,7 +4069,7 @@ class He extends on {
4069
4069
  }
4070
4070
  }
4071
4071
  let Er = {};
4072
- function Za(n, e = {}) {
4072
+ function za(n, e = {}) {
4073
4073
  const t = JSON.stringify([n, e]);
4074
4074
  let s = Er[t];
4075
4075
  return s || (s = new Intl.ListFormat(n, e), Er[t] = s), s;
@@ -4081,36 +4081,36 @@ function xs(n, e = {}) {
4081
4081
  return s === void 0 && (s = new Intl.DateTimeFormat(n, e), Ns.set(t, s)), s;
4082
4082
  }
4083
4083
  const Is = /* @__PURE__ */ new Map();
4084
- function za(n, e = {}) {
4084
+ function qa(n, e = {}) {
4085
4085
  const t = JSON.stringify([n, e]);
4086
4086
  let s = Is.get(t);
4087
4087
  return s === void 0 && (s = new Intl.NumberFormat(n, e), Is.set(t, s)), s;
4088
4088
  }
4089
4089
  const Ds = /* @__PURE__ */ new Map();
4090
- function qa(n, e = {}) {
4090
+ function Ba(n, e = {}) {
4091
4091
  const { base: t, ...s } = e, r = JSON.stringify([n, s]);
4092
4092
  let i = Ds.get(r);
4093
4093
  return i === void 0 && (i = new Intl.RelativeTimeFormat(n, e), Ds.set(r, i)), i;
4094
4094
  }
4095
4095
  let Ht = null;
4096
- function Ba() {
4096
+ function Ha() {
4097
4097
  return Ht || (Ht = new Intl.DateTimeFormat().resolvedOptions().locale, Ht);
4098
4098
  }
4099
4099
  const As = /* @__PURE__ */ new Map();
4100
- function Li(n) {
4100
+ function Vi(n) {
4101
4101
  let e = As.get(n);
4102
4102
  return e === void 0 && (e = new Intl.DateTimeFormat(n).resolvedOptions(), As.set(n, e)), e;
4103
4103
  }
4104
4104
  const Cs = /* @__PURE__ */ new Map();
4105
- function Ha(n) {
4105
+ function Ga(n) {
4106
4106
  let e = Cs.get(n);
4107
4107
  if (!e) {
4108
4108
  const t = new Intl.Locale(n);
4109
- e = "getWeekInfo" in t ? t.getWeekInfo() : t.weekInfo, "minimalDays" in e || (e = { ...Vi, ...e }), Cs.set(n, e);
4109
+ e = "getWeekInfo" in t ? t.getWeekInfo() : t.weekInfo, "minimalDays" in e || (e = { ...Ui, ...e }), Cs.set(n, e);
4110
4110
  }
4111
4111
  return e;
4112
4112
  }
4113
- function Ga(n) {
4113
+ function Ya(n) {
4114
4114
  const e = n.indexOf("-x-");
4115
4115
  e !== -1 && (n = n.substring(0, e));
4116
4116
  const t = n.indexOf("-u-");
@@ -4128,10 +4128,10 @@ function Ga(n) {
4128
4128
  return [r, i, o];
4129
4129
  }
4130
4130
  }
4131
- function Ya(n, e, t) {
4131
+ function Ja(n, e, t) {
4132
4132
  return (t || e) && (n.includes("-u-") || (n += "-u"), t && (n += `-ca-${t}`), e && (n += `-nu-${e}`)), n;
4133
4133
  }
4134
- function Ja(n) {
4134
+ function Qa(n) {
4135
4135
  const e = [];
4136
4136
  for (let t = 1; t <= 12; t++) {
4137
4137
  const s = V.utc(2009, t, 1);
@@ -4139,7 +4139,7 @@ function Ja(n) {
4139
4139
  }
4140
4140
  return e;
4141
4141
  }
4142
- function Qa(n) {
4142
+ function Ka(n) {
4143
4143
  const e = [];
4144
4144
  for (let t = 1; t <= 7; t++) {
4145
4145
  const s = V.utc(2016, 11, 13 + t);
@@ -4151,16 +4151,16 @@ function fn(n, e, t, s) {
4151
4151
  const r = n.listingMode();
4152
4152
  return r === "error" ? null : r === "en" ? t(e) : s(e);
4153
4153
  }
4154
- function Ka(n) {
4155
- return n.numberingSystem && n.numberingSystem !== "latn" ? !1 : n.numberingSystem === "latn" || !n.locale || n.locale.startsWith("en") || Li(n.locale).numberingSystem === "latn";
4154
+ function Xa(n) {
4155
+ return n.numberingSystem && n.numberingSystem !== "latn" ? !1 : n.numberingSystem === "latn" || !n.locale || n.locale.startsWith("en") || Vi(n.locale).numberingSystem === "latn";
4156
4156
  }
4157
- class Xa {
4157
+ class el {
4158
4158
  constructor(e, t, s) {
4159
4159
  this.padTo = s.padTo || 0, this.floor = s.floor || !1;
4160
4160
  const { padTo: r, floor: i, ...o } = s;
4161
4161
  if (!t || Object.keys(o).length > 0) {
4162
4162
  const a = { useGrouping: !1, ...s };
4163
- s.padTo > 0 && (a.minimumIntegerDigits = s.padTo), this.inf = za(e, a);
4163
+ s.padTo > 0 && (a.minimumIntegerDigits = s.padTo), this.inf = qa(e, a);
4164
4164
  }
4165
4165
  }
4166
4166
  format(e) {
@@ -4173,7 +4173,7 @@ class Xa {
4173
4173
  }
4174
4174
  }
4175
4175
  }
4176
- class el {
4176
+ class tl {
4177
4177
  constructor(e, t, s) {
4178
4178
  this.opts = s, this.originalZone = void 0;
4179
4179
  let r;
@@ -4209,18 +4209,18 @@ class el {
4209
4209
  return this.dtf.resolvedOptions();
4210
4210
  }
4211
4211
  }
4212
- class tl {
4212
+ class nl {
4213
4213
  constructor(e, t, s) {
4214
- this.opts = { style: "long", ...s }, !t && Bi() && (this.rtf = qa(e, s));
4214
+ this.opts = { style: "long", ...s }, !t && Hi() && (this.rtf = Ba(e, s));
4215
4215
  }
4216
4216
  format(e, t) {
4217
- return this.rtf ? this.rtf.format(e, t) : kl(t, e, this.opts.numeric, this.opts.style !== "long");
4217
+ return this.rtf ? this.rtf.format(e, t) : bl(t, e, this.opts.numeric, this.opts.style !== "long");
4218
4218
  }
4219
4219
  formatToParts(e, t) {
4220
4220
  return this.rtf ? this.rtf.formatToParts(e, t) : [];
4221
4221
  }
4222
4222
  }
4223
- const Vi = {
4223
+ const Ui = {
4224
4224
  firstDay: 1,
4225
4225
  minimalDays: 4,
4226
4226
  weekend: [6, 7]
@@ -4236,7 +4236,7 @@ class se {
4236
4236
  );
4237
4237
  }
4238
4238
  static create(e, t, s, r, i = !1) {
4239
- const o = e || ce.defaultLocale, a = o || (i ? "en-US" : Ba()), l = t || ce.defaultNumberingSystem, c = s || ce.defaultOutputCalendar, u = Ms(r) || ce.defaultWeekSettings;
4239
+ const o = e || ce.defaultLocale, a = o || (i ? "en-US" : Ha()), l = t || ce.defaultNumberingSystem, c = s || ce.defaultOutputCalendar, u = Ms(r) || ce.defaultWeekSettings;
4240
4240
  return new se(a, l, c, u, o);
4241
4241
  }
4242
4242
  static resetCache() {
@@ -4246,11 +4246,11 @@ class se {
4246
4246
  return se.create(e, t, s, r);
4247
4247
  }
4248
4248
  constructor(e, t, s, r, i) {
4249
- const [o, a, l] = Ga(e);
4250
- this.locale = o, this.numberingSystem = t || a || null, this.outputCalendar = s || l || null, this.weekSettings = r, this.intl = Ya(this.locale, this.numberingSystem, this.outputCalendar), this.weekdaysCache = { format: {}, standalone: {} }, this.monthsCache = { format: {}, standalone: {} }, this.meridiemCache = null, this.eraCache = {}, this.specifiedLocale = i, this.fastNumbersCached = null;
4249
+ const [o, a, l] = Ya(e);
4250
+ this.locale = o, this.numberingSystem = t || a || null, this.outputCalendar = s || l || null, this.weekSettings = r, this.intl = Ja(this.locale, this.numberingSystem, this.outputCalendar), this.weekdaysCache = { format: {}, standalone: {} }, this.monthsCache = { format: {}, standalone: {} }, this.meridiemCache = null, this.eraCache = {}, this.specifiedLocale = i, this.fastNumbersCached = null;
4251
4251
  }
4252
4252
  get fastNumbers() {
4253
- return this.fastNumbersCached == null && (this.fastNumbersCached = Ka(this)), this.fastNumbersCached;
4253
+ return this.fastNumbersCached == null && (this.fastNumbersCached = Xa(this)), this.fastNumbersCached;
4254
4254
  }
4255
4255
  listingMode() {
4256
4256
  const e = this.isEnglish(), t = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory");
@@ -4272,21 +4272,21 @@ class se {
4272
4272
  return this.clone({ ...e, defaultToEN: !1 });
4273
4273
  }
4274
4274
  months(e, t = !1) {
4275
- return fn(this, e, Qi, () => {
4275
+ return fn(this, e, Ki, () => {
4276
4276
  const s = this.intl === "ja" || this.intl.startsWith("ja-");
4277
4277
  t &= !s;
4278
4278
  const r = t ? { month: e, day: "numeric" } : { month: e }, i = t ? "format" : "standalone";
4279
4279
  if (!this.monthsCache[i][e]) {
4280
4280
  const o = s ? (a) => this.dtFormatter(a, r).format() : (a) => this.extract(a, r, "month");
4281
- this.monthsCache[i][e] = Ja(o);
4281
+ this.monthsCache[i][e] = Qa(o);
4282
4282
  }
4283
4283
  return this.monthsCache[i][e];
4284
4284
  });
4285
4285
  }
4286
4286
  weekdays(e, t = !1) {
4287
- return fn(this, e, eo, () => {
4287
+ return fn(this, e, to, () => {
4288
4288
  const s = t ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, r = t ? "format" : "standalone";
4289
- return this.weekdaysCache[r][e] || (this.weekdaysCache[r][e] = Qa(
4289
+ return this.weekdaysCache[r][e] || (this.weekdaysCache[r][e] = Ka(
4290
4290
  (i) => this.extract(i, s, "weekday")
4291
4291
  )), this.weekdaysCache[r][e];
4292
4292
  });
@@ -4295,7 +4295,7 @@ class se {
4295
4295
  return fn(
4296
4296
  this,
4297
4297
  void 0,
4298
- () => to,
4298
+ () => no,
4299
4299
  () => {
4300
4300
  if (!this.meridiemCache) {
4301
4301
  const e = { hour: "numeric", hourCycle: "h12" };
@@ -4308,7 +4308,7 @@ class se {
4308
4308
  );
4309
4309
  }
4310
4310
  eras(e) {
4311
- return fn(this, e, no, () => {
4311
+ return fn(this, e, so, () => {
4312
4312
  const t = { era: e };
4313
4313
  return this.eraCache[e] || (this.eraCache[e] = [V.utc(-40, 1, 1), V.utc(2017, 1, 1)].map(
4314
4314
  (s) => this.extract(s, t, "era")
@@ -4320,22 +4320,22 @@ class se {
4320
4320
  return o ? o.value : null;
4321
4321
  }
4322
4322
  numberFormatter(e = {}) {
4323
- return new Xa(this.intl, e.forceSimple || this.fastNumbers, e);
4323
+ return new el(this.intl, e.forceSimple || this.fastNumbers, e);
4324
4324
  }
4325
4325
  dtFormatter(e, t = {}) {
4326
- return new el(e, this.intl, t);
4326
+ return new tl(e, this.intl, t);
4327
4327
  }
4328
4328
  relFormatter(e = {}) {
4329
- return new tl(this.intl, this.isEnglish(), e);
4329
+ return new nl(this.intl, this.isEnglish(), e);
4330
4330
  }
4331
4331
  listFormatter(e = {}) {
4332
- return Za(this.intl, e);
4332
+ return za(this.intl, e);
4333
4333
  }
4334
4334
  isEnglish() {
4335
- return this.locale === "en" || this.locale.toLowerCase() === "en-us" || Li(this.intl).locale.startsWith("en-us");
4335
+ return this.locale === "en" || this.locale.toLowerCase() === "en-us" || Vi(this.intl).locale.startsWith("en-us");
4336
4336
  }
4337
4337
  getWeekSettings() {
4338
- return this.weekSettings ? this.weekSettings : Hi() ? Ha(this.locale) : Vi;
4338
+ return this.weekSettings ? this.weekSettings : Gi() ? Ga(this.locale) : Ui;
4339
4339
  }
4340
4340
  getStartOfWeek() {
4341
4341
  return this.getWeekSettings().firstDay;
@@ -4473,7 +4473,7 @@ class Ee extends on {
4473
4473
  return !0;
4474
4474
  }
4475
4475
  }
4476
- class nl extends on {
4476
+ class sl extends on {
4477
4477
  constructor(e) {
4478
4478
  super(), this.zoneName = e;
4479
4479
  }
@@ -4515,10 +4515,10 @@ function tt(n, e) {
4515
4515
  return e;
4516
4516
  if (n instanceof on)
4517
4517
  return n;
4518
- if (ll(n)) {
4518
+ if (cl(n)) {
4519
4519
  const t = n.toLowerCase();
4520
4520
  return t === "default" ? e : t === "local" || t === "system" ? qn.instance : t === "utc" || t === "gmt" ? Ee.utcInstance : Ee.parseSpecifier(t) || He.create(n);
4521
- } else return rt(n) ? Ee.instance(n) : typeof n == "object" && "offset" in n && typeof n.offset == "function" ? n : new nl(n);
4521
+ } else return rt(n) ? Ee.instance(n) : typeof n == "object" && "offset" in n && typeof n.offset == "function" ? n : new sl(n);
4522
4522
  }
4523
4523
  const Zs = {
4524
4524
  arab: "[٠-٩]",
@@ -4562,15 +4562,15 @@ const Zs = {
4562
4562
  telu: [3174, 3183],
4563
4563
  thai: [3664, 3673],
4564
4564
  tibt: [3872, 3881]
4565
- }, sl = Zs.hanidec.replace(/[\[|\]]/g, "").split("");
4566
- function rl(n) {
4565
+ }, rl = Zs.hanidec.replace(/[\[|\]]/g, "").split("");
4566
+ function il(n) {
4567
4567
  let e = parseInt(n, 10);
4568
4568
  if (isNaN(e)) {
4569
4569
  e = "";
4570
4570
  for (let t = 0; t < n.length; t++) {
4571
4571
  const s = n.charCodeAt(t);
4572
4572
  if (n[t].search(Zs.hanidec) !== -1)
4573
- e += sl.indexOf(n[t]);
4573
+ e += rl.indexOf(n[t]);
4574
4574
  else
4575
4575
  for (const r in vr) {
4576
4576
  const [i, o] = vr[r];
@@ -4582,7 +4582,7 @@ function rl(n) {
4582
4582
  return e;
4583
4583
  }
4584
4584
  const $s = /* @__PURE__ */ new Map();
4585
- function il() {
4585
+ function ol() {
4586
4586
  $s.clear();
4587
4587
  }
4588
4588
  function Ce({ numberingSystem: n }, e = "") {
@@ -4729,7 +4729,7 @@ class ce {
4729
4729
  * @return {void}
4730
4730
  */
4731
4731
  static resetCaches() {
4732
- se.resetCache(), He.resetCache(), V.resetCache(), il();
4732
+ se.resetCache(), He.resetCache(), V.resetCache(), ol();
4733
4733
  }
4734
4734
  }
4735
4735
  class Fe {
@@ -4740,7 +4740,7 @@ class Fe {
4740
4740
  return this.explanation ? `${this.reason}: ${this.explanation}` : this.reason;
4741
4741
  }
4742
4742
  }
4743
- const Ui = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Wi = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
4743
+ const Wi = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], ji = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
4744
4744
  function Ne(n, e) {
4745
4745
  return new Fe(
4746
4746
  "unit out of range",
@@ -4753,18 +4753,18 @@ function zs(n, e, t) {
4753
4753
  const r = s.getUTCDay();
4754
4754
  return r === 0 ? 7 : r;
4755
4755
  }
4756
- function ji(n, e, t) {
4757
- return t + (an(n) ? Wi : Ui)[e - 1];
4756
+ function Zi(n, e, t) {
4757
+ return t + (an(n) ? ji : Wi)[e - 1];
4758
4758
  }
4759
- function Zi(n, e) {
4760
- const t = an(n) ? Wi : Ui, s = t.findIndex((i) => i < e), r = e - t[s];
4759
+ function zi(n, e) {
4760
+ const t = an(n) ? ji : Wi, s = t.findIndex((i) => i < e), r = e - t[s];
4761
4761
  return { month: s + 1, day: r };
4762
4762
  }
4763
4763
  function qs(n, e) {
4764
4764
  return (n - e + 7) % 7 + 1;
4765
4765
  }
4766
4766
  function Pn(n, e = 4, t = 1) {
4767
- const { year: s, month: r, day: i } = n, o = ji(s, r, i), a = qs(zs(s, r, i), t);
4767
+ const { year: s, month: r, day: i } = n, o = Zi(s, r, i), a = qs(zs(s, r, i), t);
4768
4768
  let l = Math.floor((o - a + 14 - e) / 7), c;
4769
4769
  return l < 1 ? (c = s - 1, l = nn(c, e, t)) : l > nn(s, e, t) ? (c = s + 1, l = 1) : c = s, { weekYear: c, weekNumber: l, weekday: a, ...Yn(n) };
4770
4770
  }
@@ -4772,15 +4772,15 @@ function Ir(n, e = 4, t = 1) {
4772
4772
  const { weekYear: s, weekNumber: r, weekday: i } = n, o = qs(zs(s, 1, e), t), a = Rt(s);
4773
4773
  let l = r * 7 + i - o - 7 + e, c;
4774
4774
  l < 1 ? (c = s - 1, l += Rt(c)) : l > a ? (c = s + 1, l -= Rt(s)) : c = s;
4775
- const { month: u, day: h } = Zi(c, l);
4775
+ const { month: u, day: h } = zi(c, l);
4776
4776
  return { year: c, month: u, day: h, ...Yn(n) };
4777
4777
  }
4778
4778
  function as(n) {
4779
- const { year: e, month: t, day: s } = n, r = ji(e, t, s);
4779
+ const { year: e, month: t, day: s } = n, r = Zi(e, t, s);
4780
4780
  return { year: e, ordinal: r, ...Yn(n) };
4781
4781
  }
4782
4782
  function Dr(n) {
4783
- const { year: e, ordinal: t } = n, { month: s, day: r } = Zi(e, t);
4783
+ const { year: e, ordinal: t } = n, { month: s, day: r } = zi(e, t);
4784
4784
  return { year: e, month: s, day: r, ...Yn(n) };
4785
4785
  }
4786
4786
  function Ar(n, e) {
@@ -4796,7 +4796,7 @@ function Ar(n, e) {
4796
4796
  } else
4797
4797
  return { minDaysInFirstWeek: 4, startOfWeek: 1 };
4798
4798
  }
4799
- function ol(n, e = 4, t = 1) {
4799
+ function al(n, e = 4, t = 1) {
4800
4800
  const s = Bn(n.weekYear), r = xe(
4801
4801
  n.weekNumber,
4802
4802
  1,
@@ -4804,15 +4804,15 @@ function ol(n, e = 4, t = 1) {
4804
4804
  ), i = xe(n.weekday, 1, 7);
4805
4805
  return s ? r ? i ? !1 : Ne("weekday", n.weekday) : Ne("week", n.weekNumber) : Ne("weekYear", n.weekYear);
4806
4806
  }
4807
- function al(n) {
4807
+ function ll(n) {
4808
4808
  const e = Bn(n.year), t = xe(n.ordinal, 1, Rt(n.year));
4809
4809
  return e ? t ? !1 : Ne("ordinal", n.ordinal) : Ne("year", n.year);
4810
4810
  }
4811
- function zi(n) {
4811
+ function qi(n) {
4812
4812
  const e = Bn(n.year), t = xe(n.month, 1, 12), s = xe(n.day, 1, Ln(n.year, n.month));
4813
4813
  return e ? t ? s ? !1 : Ne("day", n.day) : Ne("month", n.month) : Ne("year", n.year);
4814
4814
  }
4815
- function qi(n) {
4815
+ function Bi(n) {
4816
4816
  const { hour: e, minute: t, second: s, millisecond: r } = n, i = xe(e, 0, 23) || e === 24 && t === 0 && s === 0 && r === 0, o = xe(t, 0, 59), a = xe(s, 0, 59), l = xe(r, 0, 999);
4817
4817
  return i ? o ? a ? l ? !1 : Ne("millisecond", r) : Ne("second", s) : Ne("minute", t) : Ne("hour", e);
4818
4818
  }
@@ -4825,27 +4825,27 @@ function rt(n) {
4825
4825
  function Bn(n) {
4826
4826
  return typeof n == "number" && n % 1 === 0;
4827
4827
  }
4828
- function ll(n) {
4828
+ function cl(n) {
4829
4829
  return typeof n == "string";
4830
4830
  }
4831
- function cl(n) {
4831
+ function ul(n) {
4832
4832
  return Object.prototype.toString.call(n) === "[object Date]";
4833
4833
  }
4834
- function Bi() {
4834
+ function Hi() {
4835
4835
  try {
4836
4836
  return typeof Intl < "u" && !!Intl.RelativeTimeFormat;
4837
4837
  } catch {
4838
4838
  return !1;
4839
4839
  }
4840
4840
  }
4841
- function Hi() {
4841
+ function Gi() {
4842
4842
  try {
4843
4843
  return typeof Intl < "u" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype);
4844
4844
  } catch {
4845
4845
  return !1;
4846
4846
  }
4847
4847
  }
4848
- function ul(n) {
4848
+ function dl(n) {
4849
4849
  return Array.isArray(n) ? n : [n];
4850
4850
  }
4851
4851
  function Cr(n, e, t) {
@@ -4855,7 +4855,7 @@ function Cr(n, e, t) {
4855
4855
  return s && t(s[0], i[0]) === s[0] ? s : i;
4856
4856
  }, null)[1];
4857
4857
  }
4858
- function dl(n, e) {
4858
+ function fl(n, e) {
4859
4859
  return e.reduce((t, s) => (t[s] = n[s], t), {});
4860
4860
  }
4861
4861
  function $t(n, e) {
@@ -4877,7 +4877,7 @@ function Ms(n) {
4877
4877
  function xe(n, e, t) {
4878
4878
  return Bn(n) && n >= e && n <= t;
4879
4879
  }
4880
- function fl(n, e) {
4880
+ function hl(n, e) {
4881
4881
  return n - e * Math.floor(n / e);
4882
4882
  }
4883
4883
  function he(n, e = 2) {
@@ -4923,7 +4923,7 @@ function Rt(n) {
4923
4923
  return an(n) ? 366 : 365;
4924
4924
  }
4925
4925
  function Ln(n, e) {
4926
- const t = fl(e - 1, 12) + 1, s = n + (e - t) / 12;
4926
+ const t = hl(e - 1, 12) + 1, s = n + (e - t) / 12;
4927
4927
  return t === 2 ? an(s) ? 29 : 28 : [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][t - 1];
4928
4928
  }
4929
4929
  function Hn(n) {
@@ -4948,7 +4948,7 @@ function nn(n, e = 4, t = 1) {
4948
4948
  function Fs(n) {
4949
4949
  return n > 99 ? n : n > ce.twoDigitCutoffYear ? 1900 + n : 2e3 + n;
4950
4950
  }
4951
- function Gi(n, e, t, s = null) {
4951
+ function Yi(n, e, t, s = null) {
4952
4952
  const r = new Date(n), i = {
4953
4953
  hourCycle: "h23",
4954
4954
  year: "numeric",
@@ -4967,7 +4967,7 @@ function Gn(n, e) {
4967
4967
  const s = parseInt(e, 10) || 0, r = t < 0 || Object.is(t, -0) ? -s : s;
4968
4968
  return t * 60 + r;
4969
4969
  }
4970
- function Yi(n) {
4970
+ function Ji(n) {
4971
4971
  const e = Number(n);
4972
4972
  if (typeof n == "boolean" || n === "" || !Number.isFinite(e))
4973
4973
  throw new we(`Invalid unit value ${n}`);
@@ -4979,7 +4979,7 @@ function Vn(n, e) {
4979
4979
  if ($t(n, s)) {
4980
4980
  const r = n[s];
4981
4981
  if (r == null) continue;
4982
- t[e(s)] = Yi(r);
4982
+ t[e(s)] = Ji(r);
4983
4983
  }
4984
4984
  return t;
4985
4985
  }
@@ -4997,9 +4997,9 @@ function Xt(n, e) {
4997
4997
  }
4998
4998
  }
4999
4999
  function Yn(n) {
5000
- return dl(n, ["hour", "minute", "second", "millisecond"]);
5000
+ return fl(n, ["hour", "minute", "second", "millisecond"]);
5001
5001
  }
5002
- const hl = [
5002
+ const ml = [
5003
5003
  "January",
5004
5004
  "February",
5005
5005
  "March",
@@ -5012,7 +5012,7 @@ const hl = [
5012
5012
  "October",
5013
5013
  "November",
5014
5014
  "December"
5015
- ], Ji = [
5015
+ ], Qi = [
5016
5016
  "Jan",
5017
5017
  "Feb",
5018
5018
  "Mar",
@@ -5025,15 +5025,15 @@ const hl = [
5025
5025
  "Oct",
5026
5026
  "Nov",
5027
5027
  "Dec"
5028
- ], ml = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
5029
- function Qi(n) {
5028
+ ], pl = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
5029
+ function Ki(n) {
5030
5030
  switch (n) {
5031
5031
  case "narrow":
5032
- return [...ml];
5032
+ return [...pl];
5033
5033
  case "short":
5034
- return [...Ji];
5034
+ return [...Qi];
5035
5035
  case "long":
5036
- return [...hl];
5036
+ return [...ml];
5037
5037
  case "numeric":
5038
5038
  return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
5039
5039
  case "2-digit":
@@ -5042,7 +5042,7 @@ function Qi(n) {
5042
5042
  return null;
5043
5043
  }
5044
5044
  }
5045
- const Ki = [
5045
+ const Xi = [
5046
5046
  "Monday",
5047
5047
  "Tuesday",
5048
5048
  "Wednesday",
@@ -5050,47 +5050,47 @@ const Ki = [
5050
5050
  "Friday",
5051
5051
  "Saturday",
5052
5052
  "Sunday"
5053
- ], Xi = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], pl = ["M", "T", "W", "T", "F", "S", "S"];
5054
- function eo(n) {
5053
+ ], eo = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], yl = ["M", "T", "W", "T", "F", "S", "S"];
5054
+ function to(n) {
5055
5055
  switch (n) {
5056
5056
  case "narrow":
5057
- return [...pl];
5057
+ return [...yl];
5058
5058
  case "short":
5059
- return [...Xi];
5059
+ return [...eo];
5060
5060
  case "long":
5061
- return [...Ki];
5061
+ return [...Xi];
5062
5062
  case "numeric":
5063
5063
  return ["1", "2", "3", "4", "5", "6", "7"];
5064
5064
  default:
5065
5065
  return null;
5066
5066
  }
5067
5067
  }
5068
- const to = ["AM", "PM"], yl = ["Before Christ", "Anno Domini"], gl = ["BC", "AD"], wl = ["B", "A"];
5069
- function no(n) {
5068
+ const no = ["AM", "PM"], gl = ["Before Christ", "Anno Domini"], wl = ["BC", "AD"], _l = ["B", "A"];
5069
+ function so(n) {
5070
5070
  switch (n) {
5071
5071
  case "narrow":
5072
- return [...wl];
5072
+ return [..._l];
5073
5073
  case "short":
5074
- return [...gl];
5074
+ return [...wl];
5075
5075
  case "long":
5076
- return [...yl];
5076
+ return [...gl];
5077
5077
  default:
5078
5078
  return null;
5079
5079
  }
5080
5080
  }
5081
- function _l(n) {
5082
- return to[n.hour < 12 ? 0 : 1];
5083
- }
5084
- function El(n, e) {
5085
- return eo(e)[n.weekday - 1];
5081
+ function El(n) {
5082
+ return no[n.hour < 12 ? 0 : 1];
5086
5083
  }
5087
5084
  function vl(n, e) {
5088
- return Qi(e)[n.month - 1];
5085
+ return to(e)[n.weekday - 1];
5089
5086
  }
5090
5087
  function Ol(n, e) {
5091
- return no(e)[n.year < 0 ? 0 : 1];
5088
+ return Ki(e)[n.month - 1];
5089
+ }
5090
+ function kl(n, e) {
5091
+ return so(e)[n.year < 0 ? 0 : 1];
5092
5092
  }
5093
- function kl(n, e, t = "always", s = !1) {
5093
+ function bl(n, e, t = "always", s = !1) {
5094
5094
  const r = {
5095
5095
  years: ["year", "yr."],
5096
5096
  quarters: ["quarter", "qtr."],
@@ -5121,27 +5121,27 @@ function Mr(n, e) {
5121
5121
  s.literal ? t += s.val : t += e(s.val);
5122
5122
  return t;
5123
5123
  }
5124
- const bl = {
5124
+ const Sl = {
5125
5125
  D: Fn,
5126
- DD: _i,
5127
- DDD: Ei,
5128
- DDDD: vi,
5129
- t: Oi,
5130
- tt: ki,
5131
- ttt: bi,
5132
- tttt: Si,
5133
- T: Ti,
5134
- TT: Ri,
5135
- TTT: Ni,
5136
- TTTT: xi,
5137
- f: Ii,
5138
- ff: Ai,
5139
- fff: $i,
5140
- ffff: Fi,
5141
- F: Di,
5142
- FF: Ci,
5143
- FFF: Mi,
5144
- FFFF: Pi
5126
+ DD: Ei,
5127
+ DDD: vi,
5128
+ DDDD: Oi,
5129
+ t: ki,
5130
+ tt: bi,
5131
+ ttt: Si,
5132
+ tttt: Ti,
5133
+ T: Ri,
5134
+ TT: Ni,
5135
+ TTT: xi,
5136
+ TTTT: Ii,
5137
+ f: Di,
5138
+ ff: Ci,
5139
+ fff: Mi,
5140
+ ffff: Pi,
5141
+ F: Ai,
5142
+ FF: $i,
5143
+ FFF: Fi,
5144
+ FFFF: Li
5145
5145
  };
5146
5146
  class _e {
5147
5147
  static create(e, t = {}) {
@@ -5160,7 +5160,7 @@ class _e {
5160
5160
  return s.length > 0 && i.push({ literal: r || /^\s+$/.test(s), val: s }), i;
5161
5161
  }
5162
5162
  static macroTokenToFormatOpts(e) {
5163
- return bl[e];
5163
+ return Sl[e];
5164
5164
  }
5165
5165
  constructor(e, t) {
5166
5166
  this.opts = t, this.loc = e, this.systemLoc = null;
@@ -5190,13 +5190,13 @@ class _e {
5190
5190
  return t > 0 && (r.padTo = t), s && (r.signDisplay = s), this.loc.numberFormatter(r).format(e);
5191
5191
  }
5192
5192
  formatDateTimeFromString(e, t) {
5193
- const s = this.loc.listingMode() === "en", r = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", i = (d, m) => this.loc.extract(e, d, m), o = (d) => e.isOffsetFixed && e.offset === 0 && d.allowZ ? "Z" : e.isValid ? e.zone.formatOffset(e.ts, d.format) : "", a = () => s ? _l(e) : i({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), l = (d, m) => s ? vl(e, d) : i(m ? { month: d } : { month: d, day: "numeric" }, "month"), c = (d, m) => s ? El(e, d) : i(
5193
+ const s = this.loc.listingMode() === "en", r = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", i = (d, m) => this.loc.extract(e, d, m), o = (d) => e.isOffsetFixed && e.offset === 0 && d.allowZ ? "Z" : e.isValid ? e.zone.formatOffset(e.ts, d.format) : "", a = () => s ? El(e) : i({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), l = (d, m) => s ? Ol(e, d) : i(m ? { month: d } : { month: d, day: "numeric" }, "month"), c = (d, m) => s ? vl(e, d) : i(
5194
5194
  m ? { weekday: d } : { weekday: d, month: "long", day: "numeric" },
5195
5195
  "weekday"
5196
5196
  ), u = (d) => {
5197
5197
  const m = _e.macroTokenToFormatOpts(d);
5198
5198
  return m ? this.formatWithSystemDefault(e, m) : d;
5199
- }, h = (d) => s ? Ol(e, d) : i({ era: d }, "era"), f = (d) => {
5199
+ }, h = (d) => s ? kl(e, d) : i({ era: d }, "era"), f = (d) => {
5200
5200
  switch (d) {
5201
5201
  // ms
5202
5202
  case "S":
@@ -5383,7 +5383,7 @@ class _e {
5383
5383
  return Mr(o, i(l, c));
5384
5384
  }
5385
5385
  }
5386
- const so = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
5386
+ const ro = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
5387
5387
  function Ft(...n) {
5388
5388
  const e = n.reduce((t, s) => t + s.source, "");
5389
5389
  return RegExp(`^${e}$`);
@@ -5407,7 +5407,7 @@ function Lt(n, ...e) {
5407
5407
  }
5408
5408
  return [null, null];
5409
5409
  }
5410
- function ro(...n) {
5410
+ function io(...n) {
5411
5411
  return (e, t) => {
5412
5412
  const s = {};
5413
5413
  let r;
@@ -5416,14 +5416,14 @@ function ro(...n) {
5416
5416
  return [s, null, t + r];
5417
5417
  };
5418
5418
  }
5419
- const io = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, Sl = `(?:${io.source}?(?:\\[(${so.source})\\])?)?`, Gs = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, oo = RegExp(`${Gs.source}${Sl}`), Ys = RegExp(`(?:[Tt]${oo.source})?`), Tl = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, Rl = /(\d{4})-?W(\d\d)(?:-?(\d))?/, Nl = /(\d{4})-?(\d{3})/, xl = ro("weekYear", "weekNumber", "weekDay"), Il = ro("year", "ordinal"), Dl = /(\d{4})-(\d\d)-(\d\d)/, ao = RegExp(
5420
- `${Gs.source} ?(?:${io.source}|(${so.source}))?`
5421
- ), Al = RegExp(`(?: ${ao.source})?`);
5419
+ const oo = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, Tl = `(?:${oo.source}?(?:\\[(${ro.source})\\])?)?`, Gs = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, ao = RegExp(`${Gs.source}${Tl}`), Ys = RegExp(`(?:[Tt]${ao.source})?`), Rl = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, Nl = /(\d{4})-?W(\d\d)(?:-?(\d))?/, xl = /(\d{4})-?(\d{3})/, Il = io("weekYear", "weekNumber", "weekDay"), Dl = io("year", "ordinal"), Al = /(\d{4})-(\d\d)-(\d\d)/, lo = RegExp(
5420
+ `${Gs.source} ?(?:${oo.source}|(${ro.source}))?`
5421
+ ), Cl = RegExp(`(?: ${lo.source})?`);
5422
5422
  function Nt(n, e, t) {
5423
5423
  const s = n[e];
5424
5424
  return H(s) ? t : et(s);
5425
5425
  }
5426
- function Cl(n, e) {
5426
+ function $l(n, e) {
5427
5427
  return [{
5428
5428
  year: Nt(n, e),
5429
5429
  month: Nt(n, e + 1, 1),
@@ -5446,8 +5446,8 @@ function cn(n, e) {
5446
5446
  const t = n[e] ? He.create(n[e]) : null;
5447
5447
  return [{}, t, e + 1];
5448
5448
  }
5449
- const $l = RegExp(`^T?${Gs.source}$`), Ml = /^-?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)?)?)$/;
5450
- function Fl(n) {
5449
+ const Ml = RegExp(`^T?${Gs.source}$`), Fl = /^-?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)?)?)$/;
5450
+ function Pl(n) {
5451
5451
  const [e, t, s, r, i, o, a, l, c] = n, u = e[0] === "-", h = l && l[0] === "-", f = (d, m = !1) => d !== void 0 && (m || d && u) ? -d : d;
5452
5452
  return [
5453
5453
  {
@@ -5462,7 +5462,7 @@ function Fl(n) {
5462
5462
  }
5463
5463
  ];
5464
5464
  }
5465
- const Pl = {
5465
+ const Ll = {
5466
5466
  GMT: 0,
5467
5467
  EDT: -240,
5468
5468
  EST: -300,
@@ -5476,15 +5476,15 @@ const Pl = {
5476
5476
  function Js(n, e, t, s, r, i, o) {
5477
5477
  const a = {
5478
5478
  year: e.length === 2 ? Fs(et(e)) : et(e),
5479
- month: Ji.indexOf(t) + 1,
5479
+ month: Qi.indexOf(t) + 1,
5480
5480
  day: et(s),
5481
5481
  hour: et(r),
5482
5482
  minute: et(i)
5483
5483
  };
5484
- return o && (a.second = et(o)), n && (a.weekday = n.length > 3 ? Ki.indexOf(n) + 1 : Xi.indexOf(n) + 1), a;
5484
+ return o && (a.second = et(o)), n && (a.weekday = n.length > 3 ? Xi.indexOf(n) + 1 : eo.indexOf(n) + 1), a;
5485
5485
  }
5486
- const Ll = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;
5487
- function Vl(n) {
5486
+ const Vl = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;
5487
+ function Ul(n) {
5488
5488
  const [
5489
5489
  ,
5490
5490
  e,
@@ -5500,27 +5500,22 @@ function Vl(n) {
5500
5500
  h
5501
5501
  ] = n, f = Js(e, r, s, t, i, o, a);
5502
5502
  let d;
5503
- return l ? d = Pl[l] : c ? d = 0 : d = Gn(u, h), [f, new Ee(d)];
5503
+ return l ? d = Ll[l] : c ? d = 0 : d = Gn(u, h), [f, new Ee(d)];
5504
5504
  }
5505
- function Ul(n) {
5505
+ function Wl(n) {
5506
5506
  return n.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
5507
5507
  }
5508
- const Wl = /^(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$/, jl = /^(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$/, Zl = /^(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})$/;
5508
+ const jl = /^(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$/, Zl = /^(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$/, zl = /^(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})$/;
5509
5509
  function Fr(n) {
5510
5510
  const [, e, t, s, r, i, o, a] = n;
5511
5511
  return [Js(e, r, s, t, i, o, a), Ee.utcInstance];
5512
5512
  }
5513
- function zl(n) {
5513
+ function ql(n) {
5514
5514
  const [, e, t, s, r, i, o, a] = n;
5515
5515
  return [Js(e, a, t, s, r, i, o), Ee.utcInstance];
5516
5516
  }
5517
- const ql = Ft(Tl, Ys), Bl = Ft(Rl, Ys), Hl = Ft(Nl, Ys), Gl = Ft(oo), lo = Pt(
5518
- Cl,
5519
- Vt,
5520
- ln,
5521
- cn
5522
- ), Yl = Pt(
5523
- xl,
5517
+ const Bl = Ft(Rl, Ys), Hl = Ft(Nl, Ys), Gl = Ft(xl, Ys), Yl = Ft(ao), co = Pt(
5518
+ $l,
5524
5519
  Vt,
5525
5520
  ln,
5526
5521
  cn
@@ -5530,50 +5525,55 @@ const ql = Ft(Tl, Ys), Bl = Ft(Rl, Ys), Hl = Ft(Nl, Ys), Gl = Ft(oo), lo = Pt(
5530
5525
  ln,
5531
5526
  cn
5532
5527
  ), Ql = Pt(
5528
+ Dl,
5529
+ Vt,
5530
+ ln,
5531
+ cn
5532
+ ), Kl = Pt(
5533
5533
  Vt,
5534
5534
  ln,
5535
5535
  cn
5536
5536
  );
5537
- function Kl(n) {
5537
+ function Xl(n) {
5538
5538
  return Lt(
5539
5539
  n,
5540
- [ql, lo],
5541
- [Bl, Yl],
5540
+ [Bl, co],
5542
5541
  [Hl, Jl],
5543
- [Gl, Ql]
5542
+ [Gl, Ql],
5543
+ [Yl, Kl]
5544
5544
  );
5545
5545
  }
5546
- function Xl(n) {
5547
- return Lt(Ul(n), [Ll, Vl]);
5548
- }
5549
5546
  function ec(n) {
5547
+ return Lt(Wl(n), [Vl, Ul]);
5548
+ }
5549
+ function tc(n) {
5550
5550
  return Lt(
5551
5551
  n,
5552
- [Wl, Fr],
5553
5552
  [jl, Fr],
5554
- [Zl, zl]
5553
+ [Zl, Fr],
5554
+ [zl, ql]
5555
5555
  );
5556
5556
  }
5557
- function tc(n) {
5558
- return Lt(n, [Ml, Fl]);
5557
+ function nc(n) {
5558
+ return Lt(n, [Fl, Pl]);
5559
5559
  }
5560
- const nc = Pt(Vt);
5561
- function sc(n) {
5562
- return Lt(n, [$l, nc]);
5560
+ const sc = Pt(Vt);
5561
+ function rc(n) {
5562
+ return Lt(n, [Ml, sc]);
5563
5563
  }
5564
- const rc = Ft(Dl, Al), ic = Ft(ao), oc = Pt(
5564
+ const ic = Ft(Al, Cl), oc = Ft(lo), ac = Pt(
5565
5565
  Vt,
5566
5566
  ln,
5567
5567
  cn
5568
5568
  );
5569
- function ac(n) {
5569
+ function lc(n) {
5570
5570
  return Lt(
5571
5571
  n,
5572
- [rc, lo],
5573
- [ic, oc]
5572
+ [ic, co],
5573
+ [oc, ac]
5574
5574
  );
5575
5575
  }
5576
- const Pr = "Invalid Duration", co = {
5576
+ const Pr = "Invalid Duration", uo = {
5577
5577
  weeks: {
5578
5578
  days: 7,
5579
5579
  hours: 168,
@@ -5590,7 +5590,7 @@ const Pr = "Invalid Duration", co = {
5590
5590
  hours: { minutes: 60, seconds: 3600, milliseconds: 3600 * 1e3 },
5591
5591
  minutes: { seconds: 60, milliseconds: 60 * 1e3 },
5592
5592
  seconds: { milliseconds: 1e3 }
5593
- }, lc = {
5593
+ }, cc = {
5594
5594
  years: {
5595
5595
  quarters: 4,
5596
5596
  months: 12,
@@ -5618,8 +5618,8 @@ const Pr = "Invalid Duration", co = {
5618
5618
  seconds: 720 * 60 * 60,
5619
5619
  milliseconds: 720 * 60 * 60 * 1e3
5620
5620
  },
5621
- ...co
5622
- }, Re = 146097 / 400, vt = 146097 / 4800, cc = {
5621
+ ...uo
5622
+ }, Re = 146097 / 400, vt = 146097 / 4800, uc = {
5623
5623
  years: {
5624
5624
  quarters: 4,
5625
5625
  months: 12,
@@ -5647,7 +5647,7 @@ const Pr = "Invalid Duration", co = {
5647
5647
  seconds: vt * 24 * 60 * 60,
5648
5648
  milliseconds: vt * 24 * 60 * 60 * 1e3
5649
5649
  },
5650
- ...co
5650
+ ...uo
5651
5651
  }, mt = [
5652
5652
  "years",
5653
5653
  "quarters",
@@ -5658,7 +5658,7 @@ const Pr = "Invalid Duration", co = {
5658
5658
  "minutes",
5659
5659
  "seconds",
5660
5660
  "milliseconds"
5661
- ], uc = mt.slice(0).reverse();
5661
+ ], dc = mt.slice(0).reverse();
5662
5662
  function Ze(n, e, t = !1) {
5663
5663
  const s = {
5664
5664
  values: t ? e.values : { ...n.values, ...e.values || {} },
@@ -5668,14 +5668,14 @@ function Ze(n, e, t = !1) {
5668
5668
  };
5669
5669
  return new ee(s);
5670
5670
  }
5671
- function uo(n, e) {
5671
+ function fo(n, e) {
5672
5672
  let t = e.milliseconds ?? 0;
5673
- for (const s of uc.slice(1))
5673
+ for (const s of dc.slice(1))
5674
5674
  e[s] && (t += e[s] * n[s].milliseconds);
5675
5675
  return t;
5676
5676
  }
5677
5677
  function Lr(n, e) {
5678
- const t = uo(n, e) < 0 ? -1 : 1;
5678
+ const t = fo(n, e) < 0 ? -1 : 1;
5679
5679
  mt.reduceRight((s, r) => {
5680
5680
  if (H(e[r]))
5681
5681
  return s;
@@ -5706,7 +5706,7 @@ class ee {
5706
5706
  */
5707
5707
  constructor(e) {
5708
5708
  const t = e.conversionAccuracy === "longterm" || !1;
5709
- let s = t ? cc : lc;
5709
+ let s = t ? uc : cc;
5710
5710
  e.matrix && (s = e.matrix), this.values = e.values, this.loc = e.loc || se.create(), this.conversionAccuracy = t ? "longterm" : "casual", this.invalid = e.invalid || null, this.matrix = s, this.isLuxonDuration = !0;
5711
5711
  }
5712
5712
  /**
@@ -5789,7 +5789,7 @@ class ee {
5789
5789
  * @return {Duration}
5790
5790
  */
5791
5791
  static fromISO(e, t) {
5792
- const [s] = tc(e);
5792
+ const [s] = nc(e);
5793
5793
  return s ? ee.fromObject(s, t) : ee.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
5794
5794
  }
5795
5795
  /**
@@ -5809,7 +5809,7 @@ class ee {
5809
5809
  * @return {Duration}
5810
5810
  */
5811
5811
  static fromISOTime(e, t) {
5812
- const [s] = sc(e);
5812
+ const [s] = rc(e);
5813
5813
  return s ? ee.fromObject(s, t) : ee.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
5814
5814
  }
5815
5815
  /**
@@ -5823,7 +5823,7 @@ class ee {
5823
5823
  throw new we("need to specify a reason the Duration is invalid");
5824
5824
  const s = e instanceof Fe ? e : new Fe(e, t);
5825
5825
  if (ce.throwOnInvalid)
5826
- throw new Fa(s);
5826
+ throw new Pa(s);
5827
5827
  return new ee({ invalid: s });
5828
5828
  }
5829
5829
  /**
@@ -5850,7 +5850,7 @@ class ee {
5850
5850
  millisecond: "milliseconds",
5851
5851
  milliseconds: "milliseconds"
5852
5852
  }[e && e.toLowerCase()];
5853
- if (!t) throw new wi(e);
5853
+ if (!t) throw new _i(e);
5854
5854
  return t;
5855
5855
  }
5856
5856
  /**
@@ -6010,7 +6010,7 @@ class ee {
6010
6010
  * @return {number}
6011
6011
  */
6012
6012
  toMillis() {
6013
- return this.isValid ? uo(this.matrix, this.values) : NaN;
6013
+ return this.isValid ? fo(this.matrix, this.values) : NaN;
6014
6014
  }
6015
6015
  /**
6016
6016
  * Returns an milliseconds value of this Duration. Alias of {@link toMillis}
@@ -6052,7 +6052,7 @@ class ee {
6052
6052
  if (!this.isValid) return this;
6053
6053
  const t = {};
6054
6054
  for (const s of Object.keys(this.values))
6055
- t[s] = Yi(e(this.values[s], s));
6055
+ t[s] = Ji(e(this.values[s], s));
6056
6056
  return Ze(this, { values: t }, !0);
6057
6057
  }
6058
6058
  /**
@@ -6297,7 +6297,7 @@ class ee {
6297
6297
  }
6298
6298
  }
6299
6299
  const Ot = "Invalid Interval";
6300
- function dc(n, e) {
6300
+ function fc(n, e) {
6301
6301
  return !n || !n.isValid ? le.invalid("missing or invalid start") : !e || !e.isValid ? le.invalid("missing or invalid end") : e < n ? le.invalid(
6302
6302
  "end before start",
6303
6303
  `The end of an interval must be after its start, but you had start=${n.toISO()} and end=${e.toISO()}`
@@ -6321,7 +6321,7 @@ class le {
6321
6321
  throw new we("need to specify a reason the Interval is invalid");
6322
6322
  const s = e instanceof Fe ? e : new Fe(e, t);
6323
6323
  if (ce.throwOnInvalid)
6324
- throw new Ma(s);
6324
+ throw new Fa(s);
6325
6325
  return new le({ invalid: s });
6326
6326
  }
6327
6327
  /**
@@ -6331,7 +6331,7 @@ class le {
6331
6331
  * @return {Interval}
6332
6332
  */
6333
6333
  static fromDateTimes(e, t) {
6334
- const s = zt(e), r = zt(t), i = dc(s, r);
6334
+ const s = zt(e), r = zt(t), i = fc(s, r);
6335
6335
  return i ?? new le({
6336
6336
  start: s,
6337
6337
  end: r
@@ -6931,14 +6931,14 @@ class hn {
6931
6931
  * @return {Object}
6932
6932
  */
6933
6933
  static features() {
6934
- return { relative: Bi(), localeWeek: Hi() };
6934
+ return { relative: Hi(), localeWeek: Gi() };
6935
6935
  }
6936
6936
  }
6937
6937
  function Ur(n, e) {
6938
6938
  const t = (r) => r.toUTC(0, { keepLocalTime: !0 }).startOf("day").valueOf(), s = t(e) - t(n);
6939
6939
  return Math.floor(ee.fromMillis(s).as("days"));
6940
6940
  }
6941
- function fc(n, e, t) {
6941
+ function hc(n, e, t) {
6942
6942
  const s = [
6943
6943
  ["years", (l, c) => c.year - l.year],
6944
6944
  ["quarters", (l, c) => c.quarter - l.quarter + (c.year - l.year) * 4],
@@ -6957,8 +6957,8 @@ function fc(n, e, t) {
6957
6957
  t.indexOf(l) >= 0 && (o = l, r[l] = c(n, e), a = i.plus(r), a > e ? (r[l]--, n = i.plus(r), n > e && (a = n, r[l]--, n = i.plus(r))) : n = a);
6958
6958
  return [n, r, a, o];
6959
6959
  }
6960
- function hc(n, e, t, s) {
6961
- let [r, i, o, a] = fc(n, e, t);
6960
+ function mc(n, e, t, s) {
6961
+ let [r, i, o, a] = hc(n, e, t);
6962
6962
  const l = e - r, c = t.filter(
6963
6963
  (h) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(h) >= 0
6964
6964
  );
@@ -6966,20 +6966,20 @@ function hc(n, e, t, s) {
6966
6966
  const u = ee.fromObject(i, s);
6967
6967
  return c.length > 0 ? ee.fromMillis(l, s).shiftTo(...c).plus(u) : u;
6968
6968
  }
6969
- const mc = "missing Intl.DateTimeFormat.formatToParts support";
6969
+ const pc = "missing Intl.DateTimeFormat.formatToParts support";
6970
6970
  function ne(n, e = (t) => t) {
6971
- return { regex: n, deser: ([t]) => e(rl(t)) };
6971
+ return { regex: n, deser: ([t]) => e(il(t)) };
6972
6972
  }
6973
- const pc = " ", fo = `[ ${pc}]`, ho = new RegExp(fo, "g");
6974
- function yc(n) {
6975
- return n.replace(/\./g, "\\.?").replace(ho, fo);
6973
+ const yc = " ", ho = `[ ${yc}]`, mo = new RegExp(ho, "g");
6974
+ function gc(n) {
6975
+ return n.replace(/\./g, "\\.?").replace(mo, ho);
6976
6976
  }
6977
6977
  function Wr(n) {
6978
- return n.replace(/\./g, "").replace(ho, " ").toLowerCase();
6978
+ return n.replace(/\./g, "").replace(mo, " ").toLowerCase();
6979
6979
  }
6980
6980
  function $e(n, e) {
6981
6981
  return n === null ? null : {
6982
- regex: RegExp(n.map(yc).join("|")),
6982
+ regex: RegExp(n.map(gc).join("|")),
6983
6983
  deser: ([t]) => n.findIndex((s) => Wr(t) === Wr(s)) + e
6984
6984
  };
6985
6985
  }
@@ -6989,11 +6989,11 @@ function jr(n, e) {
6989
6989
  function mn(n) {
6990
6990
  return { regex: n, deser: ([e]) => e };
6991
6991
  }
6992
- function gc(n) {
6992
+ function wc(n) {
6993
6993
  return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
6994
6994
  }
6995
- function wc(n, e) {
6996
- const t = Ce(e), s = Ce(e, "{2}"), r = Ce(e, "{3}"), i = Ce(e, "{4}"), o = Ce(e, "{6}"), a = Ce(e, "{1,2}"), l = Ce(e, "{1,3}"), c = Ce(e, "{1,6}"), u = Ce(e, "{1,9}"), h = Ce(e, "{2,4}"), f = Ce(e, "{4,6}"), d = (y) => ({ regex: RegExp(gc(y.val)), deser: ([w]) => w, literal: !0 }), O = ((y) => {
6995
+ function _c(n, e) {
6996
+ const t = Ce(e), s = Ce(e, "{2}"), r = Ce(e, "{3}"), i = Ce(e, "{4}"), o = Ce(e, "{6}"), a = Ce(e, "{1,2}"), l = Ce(e, "{1,3}"), c = Ce(e, "{1,6}"), u = Ce(e, "{1,9}"), h = Ce(e, "{2,4}"), f = Ce(e, "{4,6}"), d = (y) => ({ regex: RegExp(wc(y.val)), deser: ([w]) => w, literal: !0 }), O = ((y) => {
6997
6997
  if (n.literal)
6998
6998
  return d(y);
6999
6999
  switch (y.val) {
@@ -7114,11 +7114,11 @@ function wc(n, e) {
7114
7114
  return d(y);
7115
7115
  }
7116
7116
  })(n) || {
7117
- invalidReason: mc
7117
+ invalidReason: pc
7118
7118
  };
7119
7119
  return O.token = n, O;
7120
7120
  }
7121
- const _c = {
7121
+ const Ec = {
7122
7122
  year: {
7123
7123
  "2-digit": "yy",
7124
7124
  numeric: "yyyyy"
@@ -7160,7 +7160,7 @@ const _c = {
7160
7160
  short: "ZZZ"
7161
7161
  }
7162
7162
  };
7163
- function Ec(n, e, t) {
7163
+ function vc(n, e, t) {
7164
7164
  const { type: s, value: r } = n;
7165
7165
  if (s === "literal") {
7166
7166
  const l = /^\s+$/.test(r);
@@ -7172,17 +7172,17 @@ function Ec(n, e, t) {
7172
7172
  const i = e[s];
7173
7173
  let o = s;
7174
7174
  s === "hour" && (e.hour12 != null ? o = e.hour12 ? "hour12" : "hour24" : e.hourCycle != null ? e.hourCycle === "h11" || e.hourCycle === "h12" ? o = "hour12" : o = "hour24" : o = t.hour12 ? "hour12" : "hour24");
7175
- let a = _c[o];
7175
+ let a = Ec[o];
7176
7176
  if (typeof a == "object" && (a = a[i]), a)
7177
7177
  return {
7178
7178
  literal: !1,
7179
7179
  val: a
7180
7180
  };
7181
7181
  }
7182
- function vc(n) {
7182
+ function Oc(n) {
7183
7183
  return [`^${n.map((t) => t.regex).reduce((t, s) => `${t}(${s.source})`, "")}$`, n];
7184
7184
  }
7185
- function Oc(n, e, t) {
7185
+ function kc(n, e, t) {
7186
7186
  const s = n.match(e);
7187
7187
  if (s) {
7188
7188
  const r = {};
@@ -7196,7 +7196,7 @@ function Oc(n, e, t) {
7196
7196
  } else
7197
7197
  return [s, {}];
7198
7198
  }
7199
- function kc(n) {
7199
+ function bc(n) {
7200
7200
  const e = (i) => {
7201
7201
  switch (i) {
7202
7202
  case "S":
@@ -7237,28 +7237,28 @@ function kc(n) {
7237
7237
  }, {}), t, s];
7238
7238
  }
7239
7239
  let ls = null;
7240
- function bc() {
7240
+ function Sc() {
7241
7241
  return ls || (ls = V.fromMillis(1555555555555)), ls;
7242
7242
  }
7243
- function Sc(n, e) {
7243
+ function Tc(n, e) {
7244
7244
  if (n.literal)
7245
7245
  return n;
7246
- const t = _e.macroTokenToFormatOpts(n.val), s = go(t, e);
7246
+ const t = _e.macroTokenToFormatOpts(n.val), s = wo(t, e);
7247
7247
  return s == null || s.includes(void 0) ? n : s;
7248
7248
  }
7249
- function mo(n, e) {
7250
- return Array.prototype.concat(...n.map((t) => Sc(t, e)));
7249
+ function po(n, e) {
7250
+ return Array.prototype.concat(...n.map((t) => Tc(t, e)));
7251
7251
  }
7252
- class po {
7252
+ class yo {
7253
7253
  constructor(e, t) {
7254
- if (this.locale = e, this.format = t, this.tokens = mo(_e.parseFormat(t), e), this.units = this.tokens.map((s) => wc(s, e)), this.disqualifyingUnit = this.units.find((s) => s.invalidReason), !this.disqualifyingUnit) {
7255
- const [s, r] = vc(this.units);
7254
+ if (this.locale = e, this.format = t, this.tokens = po(_e.parseFormat(t), e), this.units = this.tokens.map((s) => _c(s, e)), this.disqualifyingUnit = this.units.find((s) => s.invalidReason), !this.disqualifyingUnit) {
7255
+ const [s, r] = Oc(this.units);
7256
7256
  this.regex = RegExp(s, "i"), this.handlers = r;
7257
7257
  }
7258
7258
  }
7259
7259
  explainFromTokens(e) {
7260
7260
  if (this.isValid) {
7261
- const [t, s] = Oc(e, this.regex, this.handlers), [r, i, o] = s ? kc(s) : [null, null, void 0];
7261
+ const [t, s] = kc(e, this.regex, this.handlers), [r, i, o] = s ? bc(s) : [null, null, void 0];
7262
7262
  if ($t(s, "a") && $t(s, "H"))
7263
7263
  throw new St(
7264
7264
  "Can't include meridiem when specifying 24-hour format"
@@ -7283,18 +7283,18 @@ class po {
7283
7283
  return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;
7284
7284
  }
7285
7285
  }
7286
- function yo(n, e, t) {
7287
- return new po(n, t).explainFromTokens(e);
7286
+ function go(n, e, t) {
7287
+ return new yo(n, t).explainFromTokens(e);
7288
7288
  }
7289
- function Tc(n, e, t) {
7290
- const { result: s, zone: r, specificOffset: i, invalidReason: o } = yo(n, e, t);
7289
+ function Rc(n, e, t) {
7290
+ const { result: s, zone: r, specificOffset: i, invalidReason: o } = go(n, e, t);
7291
7291
  return [s, r, i, o];
7292
7292
  }
7293
- function go(n, e) {
7293
+ function wo(n, e) {
7294
7294
  if (!n)
7295
7295
  return null;
7296
- const s = _e.create(e, n).dtFormatter(bc()), r = s.formatToParts(), i = s.resolvedOptions();
7297
- return r.map((o) => Ec(o, n, i));
7296
+ const s = _e.create(e, n).dtFormatter(Sc()), r = s.formatToParts(), i = s.resolvedOptions();
7297
+ return r.map((o) => vc(o, n, i));
7298
7298
  }
7299
7299
  const cs = "Invalid DateTime", Zr = 864e13;
7300
7300
  function Gt(n) {
@@ -7321,7 +7321,7 @@ function dt(n, e) {
7321
7321
  };
7322
7322
  return new V({ ...t, ...e, old: t });
7323
7323
  }
7324
- function wo(n, e, t) {
7324
+ function _o(n, e, t) {
7325
7325
  let s = n - e * 60 * 1e3;
7326
7326
  const r = t.offset(s);
7327
7327
  if (e === r)
@@ -7344,7 +7344,7 @@ function pn(n, e) {
7344
7344
  };
7345
7345
  }
7346
7346
  function _n(n, e, t) {
7347
- return wo(Hn(n), e, t);
7347
+ return _o(Hn(n), e, t);
7348
7348
  }
7349
7349
  function zr(n, e) {
7350
7350
  const t = n.o, s = n.c.year + Math.trunc(e.years), r = n.c.month + Math.trunc(e.months) + Math.trunc(e.quarters) * 3, i = {
@@ -7363,7 +7363,7 @@ function zr(n, e) {
7363
7363
  seconds: e.seconds,
7364
7364
  milliseconds: e.milliseconds
7365
7365
  }).as("milliseconds"), a = Hn(i);
7366
- let [l, c] = wo(a, t, n.zone);
7366
+ let [l, c] = _o(a, t, n.zone);
7367
7367
  return o !== 0 && (l += o, c = n.zone.offset(l)), { ts: l, o: c };
7368
7368
  }
7369
7369
  function kt(n, e, t, s, r, i) {
@@ -7417,27 +7417,27 @@ function qr(n, e, t, s, r, i, o) {
7417
7417
  }
7418
7418
  return r && (n.isOffsetFixed && n.offset === 0 && !i ? l += "Z" : n.o < 0 ? (l += "-", l += he(Math.trunc(-n.o / 60)), l += ":", l += he(Math.trunc(-n.o % 60))) : (l += "+", l += he(Math.trunc(n.o / 60)), l += ":", l += he(Math.trunc(n.o % 60)))), i && (l += "[" + n.zone.ianaName + "]"), l;
7419
7419
  }
7420
- const _o = {
7420
+ const Eo = {
7421
7421
  month: 1,
7422
7422
  day: 1,
7423
7423
  hour: 0,
7424
7424
  minute: 0,
7425
7425
  second: 0,
7426
7426
  millisecond: 0
7427
- }, Rc = {
7427
+ }, Nc = {
7428
7428
  weekNumber: 1,
7429
7429
  weekday: 1,
7430
7430
  hour: 0,
7431
7431
  minute: 0,
7432
7432
  second: 0,
7433
7433
  millisecond: 0
7434
- }, Nc = {
7434
+ }, xc = {
7435
7435
  ordinal: 1,
7436
7436
  hour: 0,
7437
7437
  minute: 0,
7438
7438
  second: 0,
7439
7439
  millisecond: 0
7440
- }, En = ["year", "month", "day", "hour", "minute", "second", "millisecond"], xc = [
7440
+ }, En = ["year", "month", "day", "hour", "minute", "second", "millisecond"], Ic = [
7441
7441
  "weekYear",
7442
7442
  "weekNumber",
7443
7443
  "weekday",
@@ -7445,7 +7445,7 @@ const _o = {
7445
7445
  "minute",
7446
7446
  "second",
7447
7447
  "millisecond"
7448
- ], Ic = ["year", "ordinal", "hour", "minute", "second", "millisecond"];
7448
+ ], Dc = ["year", "ordinal", "hour", "minute", "second", "millisecond"];
7449
7449
  function vn(n) {
7450
7450
  const e = {
7451
7451
  year: "year",
@@ -7473,7 +7473,7 @@ function vn(n) {
7473
7473
  weekyears: "weekYear",
7474
7474
  ordinal: "ordinal"
7475
7475
  }[n.toLowerCase()];
7476
- if (!e) throw new wi(n);
7476
+ if (!e) throw new _i(n);
7477
7477
  return e;
7478
7478
  }
7479
7479
  function Br(n) {
@@ -7491,7 +7491,7 @@ function Br(n) {
7491
7491
  return vn(n);
7492
7492
  }
7493
7493
  }
7494
- function Dc(n) {
7494
+ function Ac(n) {
7495
7495
  if (Yt === void 0 && (Yt = ce.now()), n.type !== "iana")
7496
7496
  return n.offset(Yt);
7497
7497
  const e = n.name;
@@ -7508,11 +7508,11 @@ function Hr(n, e) {
7508
7508
  r = ce.now();
7509
7509
  else {
7510
7510
  for (const l of En)
7511
- H(n[l]) && (n[l] = _o[l]);
7512
- const o = zi(n) || qi(n);
7511
+ H(n[l]) && (n[l] = Eo[l]);
7512
+ const o = qi(n) || Bi(n);
7513
7513
  if (o)
7514
7514
  return V.invalid(o);
7515
- const a = Dc(t);
7515
+ const a = Ac(t);
7516
7516
  [r, i] = _n(n, a, t);
7517
7517
  }
7518
7518
  return new V({ ts: r, zone: t, loc: s, o: i });
@@ -7625,7 +7625,7 @@ class V {
7625
7625
  * @return {DateTime}
7626
7626
  */
7627
7627
  static fromJSDate(e, t = {}) {
7628
- const s = cl(e) ? e.valueOf() : NaN;
7628
+ const s = ul(e) ? e.valueOf() : NaN;
7629
7629
  if (Number.isNaN(s))
7630
7630
  return V.invalid("invalid input");
7631
7631
  const r = tt(t.zone, ce.defaultZone);
@@ -7724,13 +7724,13 @@ class V {
7724
7724
  throw new St("Can't mix ordinal dates with month/day");
7725
7725
  const O = m || i.weekday && !d;
7726
7726
  let y, w, b = pn(l, c);
7727
- O ? (y = xc, w = Rc, b = Pn(b, o, a)) : u ? (y = Ic, w = Nc, b = as(b)) : (y = En, w = _o);
7727
+ O ? (y = Ic, w = Nc, b = Pn(b, o, a)) : u ? (y = Dc, w = xc, b = as(b)) : (y = En, w = Eo);
7728
7728
  let N = !1;
7729
7729
  for (const g of y) {
7730
7730
  const k = i[g];
7731
7731
  H(k) ? N ? i[g] = w[g] : i[g] = b[g] : N = !0;
7732
7732
  }
7733
- const p = O ? ol(i, o, a) : u ? al(i) : zi(i), T = p || qi(i);
7733
+ const p = O ? al(i, o, a) : u ? ll(i) : qi(i), T = p || Bi(i);
7734
7734
  if (T)
7735
7735
  return V.invalid(T);
7736
7736
  const C = O ? Ir(i, o, a) : u ? Dr(i) : i, [v, Z] = _n(C, c, s), x = new V({
@@ -7762,7 +7762,7 @@ class V {
7762
7762
  * @return {DateTime}
7763
7763
  */
7764
7764
  static fromISO(e, t = {}) {
7765
- const [s, r] = Kl(e);
7765
+ const [s, r] = Xl(e);
7766
7766
  return kt(s, r, t, "ISO 8601", e);
7767
7767
  }
7768
7768
  /**
@@ -7781,7 +7781,7 @@ class V {
7781
7781
  * @return {DateTime}
7782
7782
  */
7783
7783
  static fromRFC2822(e, t = {}) {
7784
- const [s, r] = Xl(e);
7784
+ const [s, r] = ec(e);
7785
7785
  return kt(s, r, t, "RFC 2822", e);
7786
7786
  }
7787
7787
  /**
@@ -7801,7 +7801,7 @@ class V {
7801
7801
  * @return {DateTime}
7802
7802
  */
7803
7803
  static fromHTTP(e, t = {}) {
7804
- const [s, r] = ec(e);
7804
+ const [s, r] = tc(e);
7805
7805
  return kt(s, r, t, "HTTP", t);
7806
7806
  }
7807
7807
  /**
@@ -7825,7 +7825,7 @@ class V {
7825
7825
  locale: r,
7826
7826
  numberingSystem: i,
7827
7827
  defaultToEN: !0
7828
- }), [a, l, c, u] = Tc(o, e, t);
7828
+ }), [a, l, c, u] = Rc(o, e, t);
7829
7829
  return u ? V.invalid(u) : kt(a, l, s, `format ${t}`, e, c);
7830
7830
  }
7831
7831
  /**
@@ -7856,7 +7856,7 @@ class V {
7856
7856
  * @return {DateTime}
7857
7857
  */
7858
7858
  static fromSQL(e, t = {}) {
7859
- const [s, r] = ac(e);
7859
+ const [s, r] = lc(e);
7860
7860
  return kt(s, r, t, "SQL", e);
7861
7861
  }
7862
7862
  /**
@@ -7870,7 +7870,7 @@ class V {
7870
7870
  throw new we("need to specify a reason the DateTime is invalid");
7871
7871
  const s = e instanceof Fe ? e : new Fe(e, t);
7872
7872
  if (ce.throwOnInvalid)
7873
- throw new $a(s);
7873
+ throw new Ma(s);
7874
7874
  return new V({ invalid: s });
7875
7875
  }
7876
7876
  /**
@@ -7888,7 +7888,7 @@ class V {
7888
7888
  * @returns {string}
7889
7889
  */
7890
7890
  static parseFormatForOpts(e, t = {}) {
7891
- const s = go(e, se.fromObject(t));
7891
+ const s = wo(e, se.fromObject(t));
7892
7892
  return s ? s.map((r) => r ? r.val : null).join("") : null;
7893
7893
  }
7894
7894
  /**
@@ -7899,7 +7899,7 @@ class V {
7899
7899
  * @returns {string}
7900
7900
  */
7901
7901
  static expandFormat(e, t = {}) {
7902
- return mo(_e.parseFormat(e), se.fromObject(t)).map((r) => r.val).join("");
7902
+ return po(_e.parseFormat(e), se.fromObject(t)).map((r) => r.val).join("");
7903
7903
  }
7904
7904
  static resetCache() {
7905
7905
  Yt = void 0, Ps.clear();
@@ -8759,7 +8759,7 @@ class V {
8759
8759
  diff(e, t = "milliseconds", s = {}) {
8760
8760
  if (!this.isValid || !e.isValid)
8761
8761
  return ee.invalid("created by diffing an invalid DateTime");
8762
- const r = { locale: this.locale, numberingSystem: this.numberingSystem, ...s }, i = ul(t).map(ee.normalizeUnit), o = e.valueOf() > this.valueOf(), a = o ? this : e, l = o ? e : this, c = hc(a, l, i, r);
8762
+ const r = { locale: this.locale, numberingSystem: this.numberingSystem, ...s }, i = dl(t).map(ee.normalizeUnit), o = e.valueOf() > this.valueOf(), a = o ? this : e, l = o ? e : this, c = mc(a, l, i, r);
8763
8763
  return o ? c.negate() : c;
8764
8764
  }
8765
8765
  /**
@@ -8892,7 +8892,7 @@ class V {
8892
8892
  numberingSystem: i,
8893
8893
  defaultToEN: !0
8894
8894
  });
8895
- return yo(o, e, t);
8895
+ return go(o, e, t);
8896
8896
  }
8897
8897
  /**
8898
8898
  * @deprecated use fromFormatExplain instead
@@ -8918,7 +8918,7 @@ class V {
8918
8918
  numberingSystem: r,
8919
8919
  defaultToEN: !0
8920
8920
  });
8921
- return new po(i, e);
8921
+ return new yo(i, e);
8922
8922
  }
8923
8923
  /**
8924
8924
  * Create a DateTime from an input string and format parser.
@@ -8967,147 +8967,147 @@ class V {
8967
8967
  * @type {Object}
8968
8968
  */
8969
8969
  static get DATE_MED() {
8970
- return _i;
8970
+ return Ei;
8971
8971
  }
8972
8972
  /**
8973
8973
  * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'
8974
8974
  * @type {Object}
8975
8975
  */
8976
8976
  static get DATE_MED_WITH_WEEKDAY() {
8977
- return Pa;
8977
+ return La;
8978
8978
  }
8979
8979
  /**
8980
8980
  * {@link DateTime#toLocaleString} format like 'October 14, 1983'
8981
8981
  * @type {Object}
8982
8982
  */
8983
8983
  static get DATE_FULL() {
8984
- return Ei;
8984
+ return vi;
8985
8985
  }
8986
8986
  /**
8987
8987
  * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'
8988
8988
  * @type {Object}
8989
8989
  */
8990
8990
  static get DATE_HUGE() {
8991
- return vi;
8991
+ return Oi;
8992
8992
  }
8993
8993
  /**
8994
8994
  * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.
8995
8995
  * @type {Object}
8996
8996
  */
8997
8997
  static get TIME_SIMPLE() {
8998
- return Oi;
8998
+ return ki;
8999
8999
  }
9000
9000
  /**
9001
9001
  * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.
9002
9002
  * @type {Object}
9003
9003
  */
9004
9004
  static get TIME_WITH_SECONDS() {
9005
- return ki;
9005
+ return bi;
9006
9006
  }
9007
9007
  /**
9008
9008
  * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.
9009
9009
  * @type {Object}
9010
9010
  */
9011
9011
  static get TIME_WITH_SHORT_OFFSET() {
9012
- return bi;
9012
+ return Si;
9013
9013
  }
9014
9014
  /**
9015
9015
  * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.
9016
9016
  * @type {Object}
9017
9017
  */
9018
9018
  static get TIME_WITH_LONG_OFFSET() {
9019
- return Si;
9019
+ return Ti;
9020
9020
  }
9021
9021
  /**
9022
9022
  * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.
9023
9023
  * @type {Object}
9024
9024
  */
9025
9025
  static get TIME_24_SIMPLE() {
9026
- return Ti;
9026
+ return Ri;
9027
9027
  }
9028
9028
  /**
9029
9029
  * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.
9030
9030
  * @type {Object}
9031
9031
  */
9032
9032
  static get TIME_24_WITH_SECONDS() {
9033
- return Ri;
9033
+ return Ni;
9034
9034
  }
9035
9035
  /**
9036
9036
  * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.
9037
9037
  * @type {Object}
9038
9038
  */
9039
9039
  static get TIME_24_WITH_SHORT_OFFSET() {
9040
- return Ni;
9040
+ return xi;
9041
9041
  }
9042
9042
  /**
9043
9043
  * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.
9044
9044
  * @type {Object}
9045
9045
  */
9046
9046
  static get TIME_24_WITH_LONG_OFFSET() {
9047
- return xi;
9047
+ return Ii;
9048
9048
  }
9049
9049
  /**
9050
9050
  * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.
9051
9051
  * @type {Object}
9052
9052
  */
9053
9053
  static get DATETIME_SHORT() {
9054
- return Ii;
9054
+ return Di;
9055
9055
  }
9056
9056
  /**
9057
9057
  * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.
9058
9058
  * @type {Object}
9059
9059
  */
9060
9060
  static get DATETIME_SHORT_WITH_SECONDS() {
9061
- return Di;
9061
+ return Ai;
9062
9062
  }
9063
9063
  /**
9064
9064
  * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.
9065
9065
  * @type {Object}
9066
9066
  */
9067
9067
  static get DATETIME_MED() {
9068
- return Ai;
9068
+ return Ci;
9069
9069
  }
9070
9070
  /**
9071
9071
  * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.
9072
9072
  * @type {Object}
9073
9073
  */
9074
9074
  static get DATETIME_MED_WITH_SECONDS() {
9075
- return Ci;
9075
+ return $i;
9076
9076
  }
9077
9077
  /**
9078
9078
  * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.
9079
9079
  * @type {Object}
9080
9080
  */
9081
9081
  static get DATETIME_MED_WITH_WEEKDAY() {
9082
- return La;
9082
+ return Va;
9083
9083
  }
9084
9084
  /**
9085
9085
  * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.
9086
9086
  * @type {Object}
9087
9087
  */
9088
9088
  static get DATETIME_FULL() {
9089
- return $i;
9089
+ return Mi;
9090
9090
  }
9091
9091
  /**
9092
9092
  * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.
9093
9093
  * @type {Object}
9094
9094
  */
9095
9095
  static get DATETIME_FULL_WITH_SECONDS() {
9096
- return Mi;
9096
+ return Fi;
9097
9097
  }
9098
9098
  /**
9099
9099
  * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.
9100
9100
  * @type {Object}
9101
9101
  */
9102
9102
  static get DATETIME_HUGE() {
9103
- return Fi;
9103
+ return Pi;
9104
9104
  }
9105
9105
  /**
9106
9106
  * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.
9107
9107
  * @type {Object}
9108
9108
  */
9109
9109
  static get DATETIME_HUGE_WITH_SECONDS() {
9110
- return Pi;
9110
+ return Li;
9111
9111
  }
9112
9112
  }
9113
9113
  function zt(n) {
@@ -9121,7 +9121,7 @@ function zt(n) {
9121
9121
  `Unknown datetime argument: ${n}, of type ${typeof n}`
9122
9122
  );
9123
9123
  }
9124
- const Ac = (n, e) => {
9124
+ const Cc = (n, e) => {
9125
9125
  const t = {};
9126
9126
  if (n.includeFields) {
9127
9127
  const s = e.collections[n.collection];
@@ -9129,23 +9129,23 @@ const Ac = (n, e) => {
9129
9129
  return rn(ge());
9130
9130
  n.includeFields.forEach((r) => {
9131
9131
  const i = s.fields.find((o) => o.name === r);
9132
- i ? t[r] = Eo(i)?.nullable() : t[r] = ge();
9132
+ i ? t[r] = vo(i)?.nullable() : t[r] = ge();
9133
9133
  });
9134
9134
  }
9135
9135
  return We({
9136
9136
  Collection_Path: _t(be()),
9137
9137
  ...t
9138
9138
  });
9139
- }, Cc = (n, e, t, s) => {
9140
- let r = We({}).catchall(Ac(n, e)), i;
9139
+ }, $c = (n, e, t, s) => {
9140
+ let r = We({}).catchall(Cc(n, e)), i;
9141
9141
  if (!s && t) {
9142
9142
  const o = Ie(n, t);
9143
9143
  i = qt(o.admin?.skipFormRequiredValidation);
9144
9144
  }
9145
9145
  return (!n.required || i) && (r = r.optional()), r;
9146
- }, $c = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds !== void 0 || n._seconds !== void 0 && n._nanoseconds !== void 0), {
9146
+ }, Mc = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds !== void 0 || n._seconds !== void 0 && n._nanoseconds !== void 0), {
9147
9147
  message: "Must be a valid date"
9148
- }), Eo = (n, e, t) => {
9148
+ }), vo = (n, e, t) => {
9149
9149
  let s;
9150
9150
  const r = `${qt(n.description)}
9151
9151
 
@@ -9185,7 +9185,7 @@ const Ac = (n, e) => {
9185
9185
  t ? (s = We({
9186
9186
  seconds: ht(),
9187
9187
  nanoseconds: ht()
9188
- }), n.min && n.max ? s = s.describe(`${r}Must be between ${V.fromMillis(n.min).toLocaleString(V.DATE_MED)} and ${V.fromMillis(n.max).toLocaleString(V.DATE_MED)}`) : n.min ? s = s.describe(`${r}Must be greater than or equal to ${V.fromMillis(n.min).toLocaleString(V.DATE_MED)}`) : n.max ? s = s.describe(`${r}Must be less than or equal to ${V.fromMillis(n.max).toLocaleString(V.DATE_MED)}`) : r && (s = s.describe(r.trim()))) : (s = $c(), n.min && (s = s.refine((l) => l.toMillis() >= n.min, {
9188
+ }), n.min && n.max ? s = s.describe(`${r}Must be between ${V.fromMillis(n.min).toLocaleString(V.DATE_MED)} and ${V.fromMillis(n.max).toLocaleString(V.DATE_MED)}`) : n.min ? s = s.describe(`${r}Must be greater than or equal to ${V.fromMillis(n.min).toLocaleString(V.DATE_MED)}`) : n.max ? s = s.describe(`${r}Must be less than or equal to ${V.fromMillis(n.max).toLocaleString(V.DATE_MED)}`) : r && (s = s.describe(r.trim()))) : (s = Mc(), n.min && (s = s.refine((l) => l.toMillis() >= n.min, {
9189
9189
  message: `Must be greater than or equal to ${V.fromMillis(n.min).toLocaleString(V.DATE_MED)}`
9190
9190
  })), n.max && (s = s.refine((l) => l.toMillis() <= n.max, {
9191
9191
  message: `Must be less than or equal to ${V.fromMillis(n.max).toLocaleString(V.DATE_MED)}`
@@ -9208,16 +9208,16 @@ const Ac = (n, e) => {
9208
9208
  s = ge();
9209
9209
  }
9210
9210
  return (!n.required || i || o) && (s = s.optional()), s;
9211
- }, ru = (n, e, t, s, r) => {
9211
+ }, iu = (n, e, t, s, r) => {
9212
9212
  const { auth: i, softDelete: o } = n, a = {};
9213
9213
  n.fields.forEach((c) => {
9214
- c.type === "Embedding" || s && c.type === "Computed" || s && (c.name === o?.archivedField || c.name === o?.timestampField) || (K(c) ? (a[c.name] = Cc(c, e, t, s), s ? (c.length && (a[c.name] = a[c.name].describe(`Must contain ${c.length} item(s)`)), c.min && (a[c.name] = a[c.name].describe(`Must contain at least ${c.min} item(s)`)), c.max && (a[c.name] = a[c.name].describe(`Must contain at most ${c.max} item(s)`))) : (c.length && (a[c.name] = a[c.name].refine((u) => c.length && u && Object.keys(u).length === c.length, {
9214
+ c.type === "Embedding" || s && c.type === "Computed" || s && (c.name === o?.archivedField || c.name === o?.timestampField) || (K(c) ? (a[c.name] = $c(c, e, t, s), s ? (c.length && (a[c.name] = a[c.name].describe(`Must contain ${c.length} item(s)`)), c.min && (a[c.name] = a[c.name].describe(`Must contain at least ${c.min} item(s)`)), c.max && (a[c.name] = a[c.name].describe(`Must contain at most ${c.max} item(s)`))) : (c.length && (a[c.name] = a[c.name].refine((u) => c.length && u && Object.keys(u).length === c.length, {
9215
9215
  message: `Must contain ${c.length} item(s)`
9216
9216
  })), c.min && (a[c.name] = a[c.name].refine((u) => c.min && u && Object.keys(u).length >= c.min, {
9217
9217
  message: `Must contain at least ${c.min} item(s)`
9218
9218
  })), c.max && (a[c.name] = a[c.name].refine((u) => c.max && (!u || Object.keys(u).length <= c.max), {
9219
9219
  message: `Must contain at most ${c.max} item(s)`
9220
- })))) : a[c.name] = Eo(c, t, s), r && (a[c.name] = a[c.name].optional()));
9220
+ })))) : a[c.name] = vo(c, t, s), r && (a[c.name] = a[c.name].optional()));
9221
9221
  }), !s && i && (a.operation = Oe([ke("create"), ke("update"), ke("delete")]).optional(), a.password = be().optional(), a.passwordConfirm = be().optional(), Object.values(e.collections).forEach((c) => {
9222
9222
  a[`auth-${c.labels.collection}`] = Kt().optional(), a[`operations-${c.labels.collection}`] = _t(Oe([ke("Read"), ke("Create"), ke("Update"), ke("Delete")])).optional(), a[`restrict-${c.labels.collection}`] = Kt().optional(), c.access.attributeRestrictions?.forEach((u) => {
9223
9223
  a[`attribute-${c.labels.collection}-${u.type}`] = Kt().optional();
@@ -9240,7 +9240,7 @@ const Ac = (n, e) => {
9240
9240
  await Jr(s.custom?.preValidate, r);
9241
9241
  for (const a of s.fields)
9242
9242
  await Jr(a.custom?.preValidate, r);
9243
- return Ca(n, t, i).parse(e), e;
9243
+ return $a(n, t, i).parse(e), e;
9244
9244
  }, Qs = (n, e, t, s, r, i, o, a, l, c, u, h, f, d, m, O, y, w, b, N, p) => {
9245
9245
  const { fields: T } = o;
9246
9246
  T.filter((g) => "unique" in g && g.unique).forEach((g) => {
@@ -9258,7 +9258,7 @@ const Ac = (n, e) => {
9258
9258
  });
9259
9259
  const C = l[o.labels.collection];
9260
9260
  for (const g of C) {
9261
- const k = sa(g, o), _ = { ...r };
9261
+ const k = ra(g, o), _ = { ...r };
9262
9262
  k.forEach((A) => {
9263
9263
  delete _[A.name], delete _[`${A.name}_Array`], delete _[`${A.name}_Single`], delete _[`${A.name}_Lowercase`];
9264
9264
  }), Object.keys(_).length > 0 && (n === "create" && (_.Collection_Path ||= t, _.Collection_Path_String = t.join("/"), e.set(m(g.key), _)), n === "update" && e.update(m(g.key), _), n === "delete" && e.delete(m(g.key)), p && p.size++);
@@ -9413,7 +9413,7 @@ const Ac = (n, e) => {
9413
9413
  if (e = e.replace(/\0/g, ""), e = e.replace(/[\x00-\x08\x0B-\x1F\x7F]/g, ""), e = e.trim(), e.length > 254)
9414
9414
  throw new Error("Email address is too long");
9415
9415
  return e;
9416
- }, hs = (n) => n ? Array.isArray(n) ? n.map((s) => Un(s)).filter((s) => s.length > 0) : Un(n) || "" : "", Mc = (n) => {
9416
+ }, hs = (n) => n ? Array.isArray(n) ? n.map((s) => Un(s)).filter((s) => s.length > 0) : Un(n) || "" : "", Fc = (n) => {
9417
9417
  if (!n || typeof n != "string")
9418
9418
  return "";
9419
9419
  let e = n.replace(/[\r\n]/g, " ");
@@ -9430,7 +9430,7 @@ const Ac = (n, e) => {
9430
9430
  `), e.length > 5e6)
9431
9431
  throw new Error("Email body is too long");
9432
9432
  return e;
9433
- }, Fc = async (n, e) => {
9433
+ }, Pc = async (n, e) => {
9434
9434
  const t = {};
9435
9435
  for (const s of e)
9436
9436
  t[s] = await import(
@@ -9439,7 +9439,7 @@ const Ac = (n, e) => {
9439
9439
  );
9440
9440
  return t;
9441
9441
  };
9442
- let ms, vo, On, Oo, Jt, ko, kn, bn, ps = 0;
9442
+ let ms, Oo, On, ko, Jt, bo, kn, bn, ps = 0, Xr = !1;
9443
9443
  const Tt = {
9444
9444
  getTenant() {
9445
9445
  if (!On)
@@ -9450,10 +9450,10 @@ const Tt = {
9450
9450
  On = n;
9451
9451
  },
9452
9452
  getMode() {
9453
- return vo;
9453
+ return Oo;
9454
9454
  },
9455
9455
  getTimezone() {
9456
- return Oo;
9456
+ return ko;
9457
9457
  },
9458
9458
  getGlobalConfigModule() {
9459
9459
  return ye(Jt);
@@ -9461,7 +9461,7 @@ const Tt = {
9461
9461
  getCustomizationFile(n, e) {
9462
9462
  if (!Object.keys(e.collections).includes(n))
9463
9463
  throw new Error("PERMISSION_DENIED");
9464
- const t = ea([n], ko, "node", Tt);
9464
+ const t = ta([n], bo, "node", Tt);
9465
9465
  return ye(t?.[n]);
9466
9466
  },
9467
9467
  getVersionInfo() {
@@ -9470,33 +9470,33 @@ const Tt = {
9470
9470
  getMaintenanceInfo() {
9471
9471
  return bn;
9472
9472
  }
9473
- }, iu = async (n, e, t, s, r) => {
9474
- if (e && (On = e), vo = n, ms && !r)
9473
+ }, ou = async (n, e, t, s, r) => {
9474
+ const i = !!Xr;
9475
+ if (Xr = !0, e && (On = e), Oo = n, ms && !r)
9475
9476
  return Tt;
9476
9477
  if (!process.env.STOKER_FB_WEB_APP_CONFIG)
9477
9478
  throw new Error("STOKER_FB_WEB_APP_CONFIG not set.");
9478
- const i = process.env.STOKER_FB_WEB_APP_CONFIG, o = JSON.parse(i), l = (await import(
9479
+ const o = process.env.STOKER_FB_WEB_APP_CONFIG, a = JSON.parse(o), c = (await import(
9479
9480
  /* @vite-ignore */
9480
9481
  t
9481
9482
  )).default;
9482
- Jt = l("node", Tt), !r && n === "development" && (process.env.FIREBASE_AUTH_EMULATOR_HOST = "127.0.0.1:9099", process.env.FIREBASE_DATABASE_EMULATOR_HOST = "127.0.0.1:9000", process.env.FIRESTORE_EMULATOR_HOST = "127.0.0.1:8080", process.env.FIREBASE_STORAGE_EMULATOR_HOST = "127.0.0.1:9199");
9483
- let c = !1;
9483
+ Jt = c("node", Tt), !r && n === "development" && (process.env.FIREBASE_AUTH_EMULATOR_HOST = "127.0.0.1:9099", process.env.FIREBASE_DATABASE_EMULATOR_HOST = "127.0.0.1:9000", process.env.FIRESTORE_EMULATOR_HOST = "127.0.0.1:8080", process.env.FIREBASE_STORAGE_EMULATOR_HOST = "127.0.0.1:9199");
9484
9484
  try {
9485
- ms = ti(), c = !0;
9485
+ ms = ni();
9486
9486
  } catch {
9487
- ms = ni({
9488
- credential: si(),
9489
- databaseURL: o.databaseURL,
9490
- storageBucket: o.storageBucket,
9491
- projectId: o.projectId
9487
+ ms = si({
9488
+ credential: ri(),
9489
+ databaseURL: a.databaseURL,
9490
+ storageBucket: a.storageBucket,
9491
+ projectId: a.projectId
9492
9492
  });
9493
9493
  }
9494
9494
  const u = await Ge();
9495
- return ko = await Fc(s, Object.keys(u.collections)), Oo = await ie(Jt.timezone), c || ue().collection("system_deployment").doc("maintenance_mode").onSnapshot((h) => {
9495
+ return bo = await Pc(s, Object.keys(u.collections)), ko = await ie(Jt.timezone), i || ue().collection("system_deployment").doc("maintenance_mode").onSnapshot((h) => {
9496
9496
  h.exists ? (bn = h.data(), ie(Jt.onMaintenanceUpdate, ["node", bn.active ? "on" : "off"])) : console.error("Maintenance status not found");
9497
9497
  }, (h) => {
9498
9498
  console.error(h.message);
9499
- }), c || ue().collection("system_deployment").doc("latest_deploy").onSnapshot((h) => {
9499
+ }), i || ue().collection("system_deployment").doc("latest_deploy").onSnapshot((h) => {
9500
9500
  h.exists ? (kn = h.data(), ps++, ps > 1 && ie(Jt.onVersionUpdate, ["node", kn, ps])) : console.error("Version info not found");
9501
9501
  }, (h) => {
9502
9502
  console.error(h.message);
@@ -9506,8 +9506,8 @@ const Tt = {
9506
9506
  };
9507
9507
  f();
9508
9508
  }), Tt;
9509
- }, { getTenant: Ye, setTenant: ou, getMode: bo, getTimezone: So, getGlobalConfigModule: Ut, getCustomizationFile: Je, getVersionInfo: au, getMaintenanceInfo: lu } = Tt, cu = async (n, e, t, s) => new Promise((r, i) => {
9510
- const o = jo(n, e, { cwd: t || process.cwd(), env: { ...process.env, ...s } });
9509
+ }, { getTenant: Ye, setTenant: au, getMode: So, getTimezone: To, getGlobalConfigModule: Ut, getCustomizationFile: Je, getVersionInfo: lu, getMaintenanceInfo: cu } = Tt, uu = async (n, e, t, s) => new Promise((r, i) => {
9510
+ const o = Zo(n, e, { cwd: t || process.cwd(), env: { ...process.env, ...s } });
9511
9511
  let a = "";
9512
9512
  const l = () => {
9513
9513
  o.kill("SIGINT");
@@ -9523,23 +9523,23 @@ const Tt = {
9523
9523
  }), o.on("exit", (h) => {
9524
9524
  u(), h === 0 ? r(a) : i();
9525
9525
  }), process.on("SIGINT", l), process.on("SIGTERM", c);
9526
- }), uu = async () => {
9526
+ }), du = async () => {
9527
9527
  const n = process.env.STOKER_FB_WEB_APP_CONFIG;
9528
9528
  if (!n)
9529
9529
  throw new Error("Firebase web app config not found");
9530
9530
  const e = JSON.parse(n);
9531
9531
  try {
9532
- return ti();
9532
+ return ni();
9533
9533
  } catch {
9534
- return ni({
9535
- credential: si(),
9534
+ return si({
9535
+ credential: ri(),
9536
9536
  databaseURL: e.databaseURL,
9537
9537
  storageBucket: e.storageBucket,
9538
9538
  projectId: e.projectId
9539
9539
  });
9540
9540
  }
9541
9541
  }, Ge = async (n = !1) => {
9542
- const s = await ri().ref("schema").orderByChild("published_time").limitToLast(1).get(), r = Object.values(s.val())[0];
9542
+ const s = await ii().ref("schema").orderByChild("published_time").limitToLast(1).get(), r = Object.values(s.val())[0];
9543
9543
  if (n) {
9544
9544
  for (const i of Object.values(r.collections))
9545
9545
  for (const o of i.fields)
@@ -9551,8 +9551,8 @@ const Tt = {
9551
9551
  for (const i of Object.values(r.collections))
9552
9552
  i.fields = i.fields.filter((o) => o.type !== "Computed");
9553
9553
  return r;
9554
- }, du = async () => {
9555
- const t = await ri().ref("schema").orderByChild("published_time").limitToLast(2).get();
9554
+ }, fu = async () => {
9555
+ const t = await ii().ref("schema").orderByChild("published_time").limitToLast(2).get();
9556
9556
  if (!(t.numChildren() < 2))
9557
9557
  return Object.values(t.val())[0];
9558
9558
  }, De = (n, e, t) => {
@@ -9560,7 +9560,7 @@ const Tt = {
9560
9560
  for (let r = 0; r < e.length; r++)
9561
9561
  r % 2 === 0 ? s = s.collection(e[r]) : s = s.doc(e[r]);
9562
9562
  return s;
9563
- }, Pc = (n, e, t, s, r) => {
9563
+ }, Lc = (n, e, t, s, r) => {
9564
9564
  const i = ue(), o = e.at(-1);
9565
9565
  if (!o)
9566
9566
  throw new Error("EMPTY_PATH");
@@ -9570,8 +9570,8 @@ const Tt = {
9570
9570
  const d = r.collections?.[l.collection];
9571
9571
  if (!r.Role)
9572
9572
  throw new Error("PERMISSION_DENIED");
9573
- const m = d && Te("Read", d), O = li(a, t, r), y = oi(a, r), w = Ls(a, r), b = ai(a, t, r), N = (E = []) => {
9574
- const D = [], R = hi(r.Role, a, t);
9573
+ const m = d && Te("Read", d), O = ci(a, t, r), y = ai(a, r), w = Ls(a, r), b = li(a, t, r), N = (E = []) => {
9574
+ const D = [], R = mi(r.Role, a, t);
9575
9575
  if (!R)
9576
9576
  throw new Error("PERMISSION_DENIED");
9577
9577
  if (m) {
@@ -9785,7 +9785,7 @@ const Tt = {
9785
9785
  } else
9786
9786
  throw new Error("PERMISSION_DENIED");
9787
9787
  else return [f];
9788
- }, To = (n, e, t, s, r) => {
9788
+ }, Ro = (n, e, t, s, r) => {
9789
9789
  const i = ue(), o = e.at(-1);
9790
9790
  if (!o)
9791
9791
  throw new Error("EMPTY_PATH");
@@ -9794,7 +9794,7 @@ const Tt = {
9794
9794
  const u = r.collections?.[l.collection];
9795
9795
  if (!r.Role)
9796
9796
  throw new Error("PERMISSION_DENIED");
9797
- const h = u && Te("Read", u), f = li(a, s, r), d = [], m = hi(r.Role, a, s);
9797
+ const h = u && Te("Read", u), f = ci(a, s, r), d = [], m = mi(r.Role, a, s);
9798
9798
  if (!m)
9799
9799
  throw new Error("PERMISSION_DENIED");
9800
9800
  if (h)
@@ -9805,14 +9805,14 @@ const Tt = {
9805
9805
  return d;
9806
9806
  } else
9807
9807
  return [c.doc(t)];
9808
- }, Ro = async (n, e, t, s, r, i, o, a, l, c) => {
9809
- const u = t.at(-2), h = ci(r.collections[u], r).map((m) => m.labels.collection);
9808
+ }, No = async (n, e, t, s, r, i, o, a, l, c) => {
9809
+ const u = t.at(-2), h = ui(r.collections[u], r).map((m) => m.labels.collection);
9810
9810
  s.collections ? s.collections.forEach((m) => {
9811
9811
  if (!h.includes(m))
9812
9812
  throw new Error(`SCHEMA_ERROR: Collection ${m} not found in subcollections of ${u}`);
9813
9813
  }) : s.collections = h;
9814
9814
  const f = s.depth - 1, d = s.collections.map(async (m) => {
9815
- const O = await No([...t, m], s.constraints, {
9815
+ const O = await xo([...t, m], s.constraints, {
9816
9816
  user: a,
9817
9817
  pagination: s.limit,
9818
9818
  providedTransaction: l,
@@ -9825,7 +9825,7 @@ const Tt = {
9825
9825
  e[m].map((y) => Xs(n, y, [...t, m, y.id], i, r, void 0, a, l, c))
9826
9826
  ), f > 0 && await Promise.all(
9827
9827
  // eslint-disable-next-line security/detect-object-injection
9828
- e[m].map((y) => Ro(n, y, [...t, m, y.id], { depth: f }, r, i, o, a, l, c))
9828
+ e[m].map((y) => No(n, y, [...t, m, y.id], { depth: f }, r, i, o, a, l, c))
9829
9829
  );
9830
9830
  });
9831
9831
  await Promise.all(d);
@@ -9868,7 +9868,7 @@ const Tt = {
9868
9868
  }
9869
9869
  }
9870
9870
  await Promise.all(h);
9871
- }, No = async (n, e, t) => {
9871
+ }, xo = async (n, e, t) => {
9872
9872
  if (t?.subcollections?.depth && t.subcollections.depth > 10)
9873
9873
  throw new Error("INPUT_ERROR: Subcollections depth cannot exceed 10");
9874
9874
  if (t?.relations?.depth && t.relations.depth > 10)
@@ -9907,7 +9907,7 @@ const Tt = {
9907
9907
  if (!O.Enabled)
9908
9908
  throw new Error("PERMISSION_DENIED");
9909
9909
  }
9910
- let v = Pc(s, n, m, t?.user, O);
9910
+ let v = Lc(s, n, m, t?.user, O);
9911
9911
  if (v.length === 0)
9912
9912
  return { cursor: {}, pages: 0, docs: [] };
9913
9913
  if (e && (v = v.map((A) => (e.forEach(([E, D, R]) => {
@@ -9920,7 +9920,7 @@ const Tt = {
9920
9920
  throw new Error("INPUT_ERROR: startAfter and endBefore cannot be provided together");
9921
9921
  const A = t.pagination.startAfter || t.pagination.endBefore;
9922
9922
  if (t?.user) {
9923
- const E = Xo(O.Role, p, m);
9923
+ const E = ea(O.Role, p, m);
9924
9924
  if (A && E !== !0)
9925
9925
  throw new Error("INPUT_ERROR: Pagination is not allowed when using " + E);
9926
9926
  }
@@ -9947,7 +9947,7 @@ const Tt = {
9947
9947
  }
9948
9948
  for (const A of a.values()) {
9949
9949
  const E = [], D = [...A.Collection_Path, A.id];
9950
- t?.subcollections && E.push(Ro(
9950
+ t?.subcollections && E.push(No(
9951
9951
  s,
9952
9952
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
9953
9953
  a.get(A.id),
@@ -10003,19 +10003,19 @@ const Tt = {
10003
10003
  const R = ["read", A, A.id, Z];
10004
10004
  await ae("postOperation", y, C, R), await ae("postRead", y, C, [Z, v, A, !1]);
10005
10005
  }
10006
- t?.user && await Qo(Array.from(a.values()), p, m, t.user, O);
10006
+ t?.user && await Ko(Array.from(a.values()), p, m, t.user, O);
10007
10007
  };
10008
10008
  return t?.providedTransaction ? await l(t.providedTransaction) : await r.runTransaction(async (c) => {
10009
10009
  await l(c);
10010
10010
  }, { readOnly: !0 }), { cursor: o, pages: i, docs: Array.from(a.values()) };
10011
- }, xo = async (n, e, t, s, r, i, o, a) => {
10012
- const l = s.at(-2), c = ci(i.collections[l], i).map((f) => f.labels.collection);
10011
+ }, Io = async (n, e, t, s, r, i, o, a) => {
10012
+ const l = s.at(-2), c = ui(i.collections[l], i).map((f) => f.labels.collection);
10013
10013
  r.collections ? r.collections.forEach((f) => {
10014
10014
  if (!c.includes(f))
10015
10015
  throw new Error(`SCHEMA_ERROR: Collection ${f} not found in subcollections of ${l}`);
10016
10016
  }) : r.collections = c;
10017
10017
  const u = r.depth - 1, h = r.collections.map(async (f) => {
10018
- const d = await No([...s, f], r.constraints || [], {
10018
+ const d = await xo([...s, f], r.constraints || [], {
10019
10019
  user: a,
10020
10020
  relations: o,
10021
10021
  pagination: r.limit,
@@ -10026,12 +10026,12 @@ const Tt = {
10026
10026
  t[f] = d.docs, u > 0 && await Promise.all(
10027
10027
  // eslint-disable-next-line security/detect-object-injection
10028
10028
  t[f].map(async (m) => {
10029
- await xo(n, e, m, [...s, f, m.id], { depth: u }, i, o, a);
10029
+ await Io(n, e, m, [...s, f, m.id], { depth: u }, i, o, a);
10030
10030
  })
10031
10031
  );
10032
10032
  });
10033
10033
  await Promise.all(h);
10034
- }, Io = async (n, e, t, s, r, i, o, a, l) => {
10034
+ }, Do = async (n, e, t, s, r, i, o, a, l) => {
10035
10035
  const c = s.at(-2);
10036
10036
  i.fields ||= r.collections[c].fields.filter((f) => K(f));
10037
10037
  const u = i.depth - 1, h = [];
@@ -10048,7 +10048,7 @@ const Tt = {
10048
10048
  noEmbeddingFields: l
10049
10049
  }).then((w) => {
10050
10050
  if (d[m] = w, u > 0)
10051
- return Io(
10051
+ return Do(
10052
10052
  n,
10053
10053
  e,
10054
10054
  // eslint-disable-next-line security/detect-object-injection
@@ -10109,7 +10109,7 @@ const Tt = {
10109
10109
  }
10110
10110
  if (t?.user && (!T || !Te("Read", T)))
10111
10111
  throw new Error("PERMISSION_DENIED");
10112
- const C = To(s, n, e, f, d);
10112
+ const C = Ro(s, n, e, f, d);
10113
10113
  if (C.length === 0)
10114
10114
  throw new Error("PERMISSION_DENIED");
10115
10115
  const v = {};
@@ -10122,7 +10122,7 @@ const Tt = {
10122
10122
  } else
10123
10123
  throw new Error(`NOT_FOUND: Document with ID ${e} does not exist at location ${n?.join("/") || N.collection}`);
10124
10124
  const _ = [], A = n ? [...n, e] : [N.collection, e];
10125
- if (t?.subcollections && _.push(xo(s, a, i, A, t.subcollections, f, void 0, t.user)), t?.relations && (t.relations.fields && (t.relations.fields = t.relations.fields.map((R) => {
10125
+ if (t?.subcollections && _.push(Io(s, a, i, A, t.subcollections, f, void 0, t.user)), t?.relations && (t.relations.fields && (t.relations.fields = t.relations.fields.map((R) => {
10126
10126
  if (typeof R == "string") {
10127
10127
  const F = b.fields.find((M) => M.name === R);
10128
10128
  if (F)
@@ -10130,7 +10130,7 @@ const Tt = {
10130
10130
  throw new Error(`SCHEMA_ERROR: Field ${R} not found in collection ${O}`);
10131
10131
  }
10132
10132
  return R;
10133
- })), _.push(Io(s, a, i, A, f, t.relations, t.user, t.noComputedFields, t.noEmbeddingFields))), await Promise.all(_), !t?.noComputedFields) {
10133
+ })), _.push(Do(s, a, i, A, f, t.relations, t.user, t.noComputedFields, t.noEmbeddingFields))), await Promise.all(_), !t?.noComputedFields) {
10134
10134
  for (const R of b.fields)
10135
10135
  if (R.type === "Computed") {
10136
10136
  const F = Ie(R, p);
@@ -10151,12 +10151,12 @@ const Tt = {
10151
10151
  (!P || !Q) && (K(M) ? (delete i[M.name], delete i[`${M.name}_Array`], delete i[`${M.name}_Single`]) : delete i[M.name]);
10152
10152
  }
10153
10153
  }
10154
- await ae("postOperation", m, p, ["read", i, e, v]), await ae("postRead", m, p, [v, C, i, !1]), t?.user && await Jo(i, b, f, t.user, d);
10154
+ await ae("postOperation", m, p, ["read", i, e, v]), await ae("postRead", m, p, [v, C, i, !1]), t?.user && await Qo(i, b, f, t.user, d);
10155
10155
  };
10156
10156
  return t?.providedTransaction ? await o(t.providedTransaction) : await r.runTransaction(async (a) => {
10157
10157
  await o(a);
10158
10158
  }, { readOnly: !0 }), i;
10159
- }, Do = async (n, e, t, s, r, i, o, a) => {
10159
+ }, Ao = async (n, e, t, s, r, i, o, a) => {
10160
10160
  const l = ue(), c = Je(r.labels.collection, i), u = r.labels.collection, h = r.fields.filter((d) => "unique" in d && d.unique), f = [];
10161
10161
  if (await Promise.all(h.map(async (d) => {
10162
10162
  {
@@ -10219,14 +10219,14 @@ ${i}`);
10219
10219
  })()
10220
10220
  ]), r.length > 0)
10221
10221
  throw new Error(r.join(", "));
10222
- }, Ao = async (n, e, t, s, r, i, o, a, l) => {
10223
- const c = ue(), u = bo(), h = process.env.ADMIN_EMAIL;
10222
+ }, Co = async (n, e, t, s, r, i, o, a, l) => {
10223
+ const c = ue(), u = So(), h = process.env.ADMIN_EMAIL;
10224
10224
  if (u === "development" || process.env.FIRESTORE_EMULATOR_HOST)
10225
10225
  if (h)
10226
10226
  n = h;
10227
10227
  else
10228
10228
  throw new Error("Admin email not set");
10229
- const f = hs(n), d = Mc(e), m = t ? Kr(t) : void 0, O = s ? Kr(s) : void 0, y = r ? hs(r) : void 0, w = i ? hs(i) : void 0, b = o ? Un(o) : void 0, N = l ? Un(l) : void 0, p = Array.isArray(f) ? f : [f];
10229
+ const f = hs(n), d = Fc(e), m = t ? Kr(t) : void 0, O = s ? Kr(s) : void 0, y = r ? hs(r) : void 0, w = i ? hs(i) : void 0, b = o ? Un(o) : void 0, N = l ? Un(l) : void 0, p = Array.isArray(f) ? f : [f];
10230
10230
  if (p.length === 0 || p.length === 1 && !p[0])
10231
10231
  throw new Error("No valid email addresses provided");
10232
10232
  const T = { to: f, message: { subject: d } };
@@ -10239,7 +10239,7 @@ ${i}`);
10239
10239
  C.length > 0 && C[0] && (T.bcc = w);
10240
10240
  }
10241
10241
  b && (T.replyTo = b), a && (T.message.attachments = a), N && (T.from = N), await c.collection("system_mail").add(T);
10242
- }, Co = async (n, e, t, s, r, i, o) => {
10242
+ }, $o = async (n, e, t, s, r, i, o) => {
10243
10243
  const a = gt(), l = ue(), c = "USER_ERROR", u = async (d, m) => {
10244
10244
  try {
10245
10245
  await un(d);
@@ -10296,7 +10296,7 @@ ${i}`);
10296
10296
  if (d) {
10297
10297
  const m = `https://${a.app.options.projectId}.firebaseapp.com/__/auth/action${d}`, O = await ie(t.appName), y = t?.mail?.emailVerification && t.mail.emailVerification(m, O);
10298
10298
  try {
10299
- await Ao(r.Email, y?.subject || "Please verify your email address", void 0, y?.html || `Please verify your email address by clicking the link:
10299
+ await Co(r.Email, y?.subject || "Please verify your email address", void 0, y?.html || `Please verify your email address by clicking the link:
10300
10300
  </br>
10301
10301
  </br>
10302
10302
  <a href="${m}">${m}</a>`);
@@ -10319,14 +10319,14 @@ ${i}`);
10319
10319
  throw new Error("PERMISSION_DENIED");
10320
10320
  } else if (n.length > 1)
10321
10321
  throw new Error("PERMISSION_DENIED");
10322
- }, Wn = (n) => n !== null && typeof n == "object" && !Array.isArray(n), fu = (n) => {
10322
+ }, Wn = (n) => n !== null && typeof n == "object" && !Array.isArray(n), hu = (n) => {
10323
10323
  const e = (t) => {
10324
10324
  Object.entries(t).forEach(([s, r]) => {
10325
10325
  Wn(r) && Object.keys(r).length === 2 && typeof r.seconds == "number" && typeof r.nanoseconds == "number" ? t[s] = new lt(r.seconds, r.nanoseconds) : Wn(r) && e(r);
10326
10326
  });
10327
10327
  };
10328
10328
  e(n);
10329
- }, $o = (n) => {
10329
+ }, Mo = (n) => {
10330
10330
  const e = (t) => {
10331
10331
  Object.entries(t).forEach(([s, r]) => {
10332
10332
  Wn(r) && Object.keys(r).length === 2 && typeof r._seconds == "number" && typeof r._nanoseconds == "number" ? t[s] = new lt(r._seconds, r._nanoseconds) : Wn(r) && e(r);
@@ -10337,7 +10337,7 @@ ${i}`);
10337
10337
  if (typeof n == "object")
10338
10338
  for (const e in n)
10339
10339
  Object.prototype.hasOwnProperty.call(n, e) && (n[e] === "_DELETE_FIELD" ? n[e] = me.delete() : tr(n[e]));
10340
- }, Lc = (n, e, t) => {
10340
+ }, Vc = (n, e, t) => {
10341
10341
  if (K(t) && t.includeFields) {
10342
10342
  const s = {};
10343
10343
  return t.includeFields.forEach((r) => {
@@ -10349,7 +10349,7 @@ ${i}`);
10349
10349
  }), s;
10350
10350
  }
10351
10351
  return {};
10352
- }, Xr = async (n, e, t, s, r, i, o) => {
10352
+ }, ei = async (n, e, t, s, r, i, o) => {
10353
10353
  if (!K(t) || !t.enforceHierarchy)
10354
10354
  return;
10355
10355
  const { fields: a } = e, l = ue(), c = Object.entries(s[t.name]);
@@ -10371,15 +10371,15 @@ ${i}`);
10371
10371
  delete e[n.name][t], e[`${n.name}_Array`] = e[`${n.name}_Array`]?.filter((s) => s !== t), delete e[`${n.name}_Single`];
10372
10372
  }, ys = async (n, e, t, s, r) => {
10373
10373
  e[n.name] ||= {}, e[n.name][s] = t, e[`${n.name}_Array`] ||= [], e[`${n.name}_Array`].push(s), r && (e[`${n.name}_Single`] = t);
10374
- }, Vc = (n, e, t, s, r, i) => {
10374
+ }, Uc = (n, e, t, s, r, i) => {
10375
10375
  const o = [], a = [];
10376
10376
  for (const l of s.fields)
10377
10377
  K(l) && l.twoWay && l.collection === t && ((n === "Create" || !i?.[l.name]?.[e]) && r[l.name]?.[e] && o.push(l), n === "Update" && i?.[l.name]?.[e] && !r[l.name]?.[e] && a.push(l));
10378
10378
  return { addedFields: o, removedFields: a };
10379
- }, Mo = async (n, e, t, s, r, i, o, a, l, c, u, h) => {
10379
+ }, Fo = async (n, e, t, s, r, i, o, a, l, c, u, h) => {
10380
10380
  const { fields: f } = i, d = ue(), m = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map();
10381
10381
  for (const w of f)
10382
- K(w) && ["OneToOne", "OneToMany"].includes(w.type) && w.enforceHierarchy && s[w.name] && (n === "Create" || n === "Update" && !ze(h?.[w.name], s[w.name])) && await Xr(e, i, w, s, a, l);
10382
+ K(w) && ["OneToOne", "OneToMany"].includes(w.type) && w.enforceHierarchy && s[w.name] && (n === "Create" || n === "Update" && !ze(h?.[w.name], s[w.name])) && await ei(e, i, w, s, a, l);
10383
10383
  for (const w of f)
10384
10384
  if (K(w) && w.twoWay) {
10385
10385
  const b = o.collections[w.collection], N = W(b.fields, w.twoWay), p = ft(b, [N]);
@@ -10410,7 +10410,7 @@ ${i}`);
10410
10410
  ...x[N.name],
10411
10411
  [t]: {
10412
10412
  Collection_Path: s.Collection_Path,
10413
- ...Lc(i, s, N)
10413
+ ...Vc(i, s, N)
10414
10414
  }
10415
10415
  };
10416
10416
  x[N.name] = k, x[`${N.name}_Array`] ||= [], x[`${N.name}_Array`].push(t), p.size === 1 && (x[`${N.name}_Single`] = k), y.set(w.collection, {
@@ -10454,7 +10454,7 @@ ${i}`);
10454
10454
  for (const [w, b] of y.entries()) {
10455
10455
  const N = o.collections[w], p = Je(w, o);
10456
10456
  for (const [T, C] of Object.entries(b)) {
10457
- const { addedFields: v, removedFields: Z } = Vc(n, T, w, i, s, h);
10457
+ const { addedFields: v, removedFields: Z } = Uc(n, T, w, i, s, h);
10458
10458
  if (c && u) {
10459
10459
  for (const x of v) {
10460
10460
  const g = W(N.fields, x.twoWay);
@@ -10523,12 +10523,12 @@ ${i}`);
10523
10523
  }
10524
10524
  for (const x of v) {
10525
10525
  const g = W(N.fields, x.twoWay);
10526
- ["OneToOne", "OneToMany"].includes(g.type) && K(g) && g.enforceHierarchy && await Xr(e, N, g, C, a, l, !0);
10526
+ ["OneToOne", "OneToMany"].includes(g.type) && K(g) && g.enforceHierarchy && await ei(e, N, g, C, a, l, !0);
10527
10527
  }
10528
10528
  }
10529
10529
  }
10530
10530
  return m;
10531
- }, Fo = (n, e, t) => {
10531
+ }, Po = (n, e, t) => {
10532
10532
  n === "create" && pt.forEach((s) => {
10533
10533
  if (!ze(e[s], t[s]))
10534
10534
  throw new Error(`Updating system fields in hooks is not allowed: ${s}`);
@@ -10539,7 +10539,7 @@ ${i}`);
10539
10539
  if (!["id", "Collection_Path", "Created_At", "Saved_At", "Created_By"].includes(s) && !ze(e[s], t[s]))
10540
10540
  throw new Error(`Updating system fields in hooks is not allowed: ${s}`);
10541
10541
  }));
10542
- }, Po = (n, e, t, s) => {
10542
+ }, Lo = (n, e, t, s) => {
10543
10543
  const { softDelete: r } = e;
10544
10544
  if (!r)
10545
10545
  return;
@@ -10564,7 +10564,7 @@ ${i}`);
10564
10564
  return !1;
10565
10565
  }
10566
10566
  return !0;
10567
- }, Uc = 10, Wc = async (n, e) => {
10567
+ }, Wc = 10, jc = async (n, e) => {
10568
10568
  if (n.length === 0)
10569
10569
  return;
10570
10570
  const t = Math.min(e, n.length);
@@ -10576,7 +10576,7 @@ ${i}`);
10576
10576
  }
10577
10577
  };
10578
10578
  await Promise.all(Array.from({ length: t }, r));
10579
- }, Lo = async (n, e, t, s, r, i, o) => {
10579
+ }, Vo = async (n, e, t, s, r, i, o) => {
10580
10580
  for (const [a, l] of Object.entries(e?.collections || {})) {
10581
10581
  if (!r.collections[a])
10582
10582
  throw new Error("PERMISSION_DENIED");
@@ -10625,10 +10625,10 @@ ${i}`);
10625
10625
  }
10626
10626
  }
10627
10627
  }
10628
- await Wc(d, Uc);
10628
+ await jc(d, Wc);
10629
10629
  }
10630
10630
  }
10631
- }, hu = async (n, e, t, s, r, i, o) => {
10631
+ }, mu = async (n, e, t, s, r, i, o) => {
10632
10632
  const a = Ye(), l = Ut();
10633
10633
  let c = await Ge();
10634
10634
  if (n.length === 0)
@@ -10640,19 +10640,19 @@ ${i}`);
10640
10640
  let Z;
10641
10641
  s && await er(n, d);
10642
10642
  const x = De(p, n, a), g = o || x.doc().id;
10643
- i = i || {}, i.collection = m.collection, e.id = g, $o(e), tr(e);
10643
+ i = i || {}, i.collection = m.collection, e.id = g, Mo(e), tr(e);
10644
10644
  const k = Ws("create", n, e, c, N, "Online", s || "System", lt.now(), me.serverTimestamp()), _ = ye(k);
10645
- w && (k[w.archivedField] = !1), Ve(e), y && await Mt("create", "started", k, a, n, g, d), await ae("preOperation", l, b, ["create", k, g, i]), await ae("preWrite", l, b, ["create", k, g, i]), Tn(d, k, c), Rn(d, k), await ra(k, d, b, v), Ve(k);
10645
+ w && (k[w.archivedField] = !1), Ve(e), y && await Mt("create", "started", k, a, n, g, d), await ae("preOperation", l, b, ["create", k, g, i]), await ae("preWrite", l, b, ["create", k, g, i]), Tn(d, k, c), Rn(d, k), await ia(k, d, b, v), Ve(k);
10646
10646
  try {
10647
10647
  if (d.auth && t && !t.password)
10648
10648
  throw new Error("Password is required");
10649
- await Do("create", a, g, k, d, c), await sn("create", k, d, b, ["create", k, i], c);
10649
+ await Ao("create", a, g, k, d, c), await sn("create", k, d, b, ["create", k, i], c);
10650
10650
  } catch (P) {
10651
10651
  throw new Error(`VALIDATION_ERROR: ${P.message}`);
10652
10652
  }
10653
10653
  Ve(k), e.id = g, w && (k[w.archivedField] = !1), Tn(d, k, c), Rn(d, k);
10654
10654
  try {
10655
- Fo("create", k, _), Po("create", d, k), await sn("create", k, d, b, ["create", k, i], c);
10655
+ Po("create", k, _), Lo("create", d, k), await sn("create", k, d, b, ["create", k, i], c);
10656
10656
  } catch (P) {
10657
10657
  throw new Error(`VALIDATION_ERROR: ${P.message}`);
10658
10658
  }
@@ -10715,13 +10715,13 @@ ${i}`);
10715
10715
  throw new Error(`VALIDATION_ERROR: ${oe.name} "${k[oe.name]}" is invalid`);
10716
10716
  }
10717
10717
  });
10718
- await Promise.all(pe), ir(k, g, d, c, s, Z, t?.permissions), t?.permissions && s && Z && await Lo(P, t.permissions, s, Z, c), ir(k, g, d, c, s, Z, t?.permissions);
10718
+ await Promise.all(pe), ir(k, g, d, c, s, Z, t?.permissions), t?.permissions && s && Z && await Vo(P, t.permissions, s, Z, c), ir(k, g, d, c, s, Z, t?.permissions);
10719
10719
  };
10720
10720
  if (d.auth && t) {
10721
10721
  await p.runTransaction(async (j) => {
10722
10722
  await D(j);
10723
10723
  }, { maxAttempts: 10 });
10724
- const P = await Co(
10724
+ const P = await $o(
10725
10725
  a,
10726
10726
  g,
10727
10727
  l,
@@ -10736,7 +10736,7 @@ ${i}`);
10736
10736
  try {
10737
10737
  const P = { size: 1 };
10738
10738
  await p.runTransaction(async (j) => {
10739
- await D(j, P), r?.noTwoWay || await Mo("Create", a, g, k, k, d, c, j, P, s, Z);
10739
+ await D(j, P), r?.noTwoWay || await Fo("Create", a, g, k, k, d, c, j, P, s, Z);
10740
10740
  const Q = Us(c);
10741
10741
  Qs("create", j, n, g, k, c, d, r, Q, me.arrayUnion, me.arrayRemove, me.delete, (S) => p.collection("tenants").doc(a).collection("system_fields").doc(m.collection).collection(`${m.collection}-${S.name}`).doc(g), (S, q) => p.collection("tenants").doc(a).collection("system_unique").doc(m.collection).collection(`Unique-${m.collection}-${S.name}`).doc(q), (S) => p.collection("tenants").doc(a).collection("system_fields").doc(m.collection).collection(`${m.collection}-${S}`).doc(g), (S, q) => De(p, S, a).doc(q), (S, q, B) => p.collection("tenants").doc(a).collection("system_fields").doc(S.collection).collection(`${S.collection}-${q}`).doc(B), (S, q, B) => p.collection("tenants").doc(a).collection("system_fields").doc(S.collection).collection(`${S.collection}-${q.replaceAll(" ", "-")}`).doc(B), void 0, void 0, P), j.set(x.doc(g), k);
10742
10742
  }, { maxAttempts: 10 });
@@ -10783,7 +10783,7 @@ ${i}`);
10783
10783
  }
10784
10784
  if (l)
10785
10785
  throw new Error(`ROLLBACK_FAILED: ${s}`);
10786
- }, jc = async (n, e, t, s, r, i, o, a, l, c, u) => {
10786
+ }, Zc = async (n, e, t, s, r, i, o, a, l, c, u) => {
10787
10787
  const h = gt(), f = ue(), d = a?.customClaims || {}, m = "USER_ERROR";
10788
10788
  let O = "";
10789
10789
  if (n === "create") {
@@ -10792,7 +10792,7 @@ ${i}`);
10792
10792
  if (!l)
10793
10793
  throw new Error("VALIDATION_ERROR: Permissions are required");
10794
10794
  try {
10795
- O = await Co(e, t, s, r, i, l, u);
10795
+ O = await $o(e, t, s, r, i, l, u);
10796
10796
  } catch (y) {
10797
10797
  throw new Error(y.message);
10798
10798
  }
@@ -10839,7 +10839,7 @@ ${i}`);
10839
10839
  if (b) {
10840
10840
  const N = `https://${h.app.options.projectId}.firebaseapp.com/__/auth/action${b}`, p = await ie(s.appName), T = s?.mail?.emailVerification && s.mail.emailVerification(N, p);
10841
10841
  try {
10842
- await Ao(i.Email, T?.subject || "Please verify your email address", void 0, T?.html || `Please verify your email address by clicking the link:
10842
+ await Co(i.Email, T?.subject || "Please verify your email address", void 0, T?.html || `Please verify your email address by clicking the link:
10843
10843
  </br>
10844
10844
  </br>
10845
10845
  <a href="${N}">${N}</a>`);
@@ -10857,7 +10857,7 @@ ${i}`);
10857
10857
  }
10858
10858
  if (O)
10859
10859
  return O;
10860
- }, Zc = async (n, e, t) => {
10860
+ }, zc = async (n, e, t) => {
10861
10861
  const s = Ye(), r = ue(), i = [e];
10862
10862
  t && t.trim() !== "" && i.push(t), i.sort();
10863
10863
  const o = [];
@@ -10869,7 +10869,7 @@ ${i}`);
10869
10869
  }
10870
10870
  for (const a of o)
10871
10871
  n.set(a, { locked: !0 });
10872
- }, ei = async (n, e) => {
10872
+ }, ti = async (n, e) => {
10873
10873
  const t = Ye(), s = ue(), r = [n];
10874
10874
  e && e.trim() !== "" && r.push(e), r.sort();
10875
10875
  const i = s.batch();
@@ -10878,7 +10878,7 @@ ${i}`);
10878
10878
  i.delete(a);
10879
10879
  }
10880
10880
  await i.commit();
10881
- }, zc = async (n, e, t, s, r, i, o) => {
10881
+ }, qc = async (n, e, t, s, r, i, o) => {
10882
10882
  const a = Ye(), l = Ut();
10883
10883
  let c = await Ge(!0);
10884
10884
  if (n.length === 0)
@@ -10914,7 +10914,7 @@ ${i}`);
10914
10914
  if (s?.operation === "delete" && s.permissions)
10915
10915
  throw new Error("VALIDATION_ERROR: Permissions are not allowed for delete operations");
10916
10916
  const Z = d.auth && s?.operation === "create", x = d.auth && s?.operation === "delete", g = d.auth && !Z && !x && (s?.operation === "update" || t.Role || t.Enabled !== void 0 || t.Name || t.Email || t.Photo_URL), k = (S) => S.User_ID && (d.auth && !Z && !x && s?.operation === "update" || t.Role && t.Role !== S.Role || t.Enabled !== void 0 && t.Enabled !== S.Enabled || t.Name && t.Name !== S.Name || t.Email && t.Email !== S.Email || t.Photo_URL && t.Photo_URL !== S.Photo_URL);
10917
- delete t.id, $o(t), tr(t);
10917
+ delete t.id, Mo(t), tr(t);
10918
10918
  const _ = Ws("update", n, t, c, b, "Online", r || "System", lt.now(), me.serverTimestamp()), A = ye(_);
10919
10919
  for (const S of O)
10920
10920
  !K(S) && Me(_[S.name]) && S.nullable && (_[S.name] = null);
@@ -10934,7 +10934,7 @@ ${i}`);
10934
10934
  if (Z && !s.password)
10935
10935
  throw new Error("Password is required");
10936
10936
  const S = { ...v, ..._ };
10937
- await Do("update", a, e, S, d, c), nt(S), await sn("update", S, d, w, ["update", _, o, void 0, ye(v)], c);
10937
+ await Ao("update", a, e, S, d, c), nt(S), await sn("update", S, d, w, ["update", _, o, void 0, ye(v)], c);
10938
10938
  } catch (S) {
10939
10939
  throw new Error(`VALIDATION_ERROR: ${S.message}`);
10940
10940
  }
@@ -10943,7 +10943,7 @@ ${i}`);
10943
10943
  !K(S) && Me(_[S.name]) && S.nullable && (_[S.name] = null);
10944
10944
  try {
10945
10945
  const S = { ...v, ..._ };
10946
- nt(S), Po("update", d, _, v), Fo("update", _, A), await sn("update", S, d, w, ["update", _, o, void 0, v], c);
10946
+ nt(S), Lo("update", d, _, v), Po("update", _, A), await sn("update", S, d, w, ["update", _, o, void 0, v], c);
10947
10947
  } catch (S) {
10948
10948
  throw new Error(`VALIDATION_ERROR: ${S.message}`);
10949
10949
  }
@@ -10980,7 +10980,7 @@ ${i}`);
10980
10980
  if (!T.Enabled)
10981
10981
  throw new Error("PERMISSION_DENIED");
10982
10982
  }
10983
- if (B && (B.size += To(a, n, e, c, T).length), Z && v.User_ID || x && !v.User_ID)
10983
+ if (B && (B.size += Ro(a, n, e, c, T).length), Z && v.User_ID || x && !v.User_ID)
10984
10984
  throw new Error("USER_ERROR");
10985
10985
  if (k(v)) {
10986
10986
  const de = await S.get(p.collection("tenants").doc(a).collection("system_user_permissions").doc(v.User_ID));
@@ -11028,7 +11028,7 @@ ${i}`);
11028
11028
  throw new Error("PERMISSION_DENIED");
11029
11029
  }
11030
11030
  }
11031
- or(_, v, e, d, c, r, T, s?.operation ? s.operation : g ? "update" : void 0, s?.permissions, R), s?.permissions && r && T && await Lo(S, s.permissions, r, T, c, R, B), or(_, v, e, d, c, r, T, s?.operation ? s.operation : g ? "update" : void 0, s?.permissions, R), q && (Z || k(v) || x) && await Zc(S, e, v.User_ID);
11031
+ or(_, v, e, d, c, r, T, s?.operation ? s.operation : g ? "update" : void 0, s?.permissions, R), s?.permissions && r && T && await Vo(S, s.permissions, r, T, c, R, B), or(_, v, e, d, c, r, T, s?.operation ? s.operation : g ? "update" : void 0, s?.permissions, R), q && (Z || k(v) || x) && await zc(S, e, v.User_ID);
11032
11032
  };
11033
11033
  (Z || g || x) && await p.runTransaction(async (S) => {
11034
11034
  await F(S, !0);
@@ -11044,7 +11044,7 @@ ${i}`);
11044
11044
  }
11045
11045
  const q = { ...v, ..._ };
11046
11046
  nt(q);
11047
- const B = await jc(s?.operation || "update", a, e, l, m.collection, q, v, S, s?.permissions, R, s?.password);
11047
+ const B = await Zc(s?.operation || "update", a, e, l, m.collection, q, v, S, s?.permissions, R, s?.password);
11048
11048
  Z && (_.User_ID = B), x && (_.User_ID = me.delete());
11049
11049
  }
11050
11050
  try {
@@ -11053,7 +11053,7 @@ ${i}`);
11053
11053
  const re = { ...v, ..._ };
11054
11054
  await F(B, !1, q);
11055
11055
  let Qe;
11056
- i?.noTwoWay || (Qe = await Mo("Update", a, e, re, _, d, c, B, q, r, T, v));
11056
+ i?.noTwoWay || (Qe = await Fo("Update", a, e, re, _, d, c, B, q, r, T, v));
11057
11057
  const Wt = Us(c);
11058
11058
  Qs("update", B, n, e, _, c, d, i, Wt, me.arrayUnion, me.arrayRemove, me.delete, (pe) => p.collection("tenants").doc(a).collection("system_fields").doc(m.collection).collection(`${m.collection}-${pe.name}`).doc(e), (pe, oe) => p.collection("tenants").doc(a).collection("system_unique").doc(m.collection).collection(`Unique-${m.collection}-${pe.name}`).doc(oe), (pe) => p.collection("tenants").doc(a).collection("system_fields").doc(m.collection).collection(`${m.collection}-${pe}`).doc(e), (pe, oe) => De(p, pe, a).doc(oe), (pe, oe, Le) => p.collection("tenants").doc(a).collection("system_fields").doc(pe.collection).collection(`${pe.collection}-${oe}`).doc(Le), (pe, oe, Le) => p.collection("tenants").doc(a).collection("system_fields").doc(pe.collection).collection(`${pe.collection}-${oe.replaceAll(" ", "-")}`).doc(Le), v, Qe, q), B.update(C.doc(e), _);
11059
11059
  }, { maxAttempts: 10 });
@@ -11073,11 +11073,11 @@ ${i}`);
11073
11073
  }), await Mt("update", re?.resolved ? "success" : "failed", _, a, n, e, d, re?.resolved ? void 0 : q, v)), !re?.resolved)
11074
11074
  throw Z && await un(v), k(v) && await Qt(v.User_ID, S, R, "USER_ERROR"), x && await p.collection("tenants").doc(a).collection(m.collection).doc(e).update({ User_ID: me.delete() }), q;
11075
11075
  }
11076
- (Z || k(v) || x) && await Qr(ei, [e, v.User_ID]).catch(() => {
11076
+ (Z || k(v) || x) && await Qr(ti, [e, v.User_ID]).catch(() => {
11077
11077
  throw new Error("USER_ERROR");
11078
11078
  });
11079
11079
  } catch (S) {
11080
- throw (Z || k(v) || x) && await Qr(ei, [e, v.User_ID]).catch(() => {
11080
+ throw (Z || k(v) || x) && await Qr(ti, [e, v.User_ID]).catch(() => {
11081
11081
  throw new Error("USER_ERROR");
11082
11082
  }), S;
11083
11083
  }
@@ -11085,7 +11085,7 @@ ${i}`);
11085
11085
  await ae("postWrite", l, w, M), await ae("postOperation", l, w, P);
11086
11086
  const j = { ...v, ..._ };
11087
11087
  return nt(j), { id: e, ...j };
11088
- }, mu = async (n, e, t, s, r) => {
11088
+ }, pu = async (n, e, t, s, r) => {
11089
11089
  const i = Ye(), o = Ut();
11090
11090
  let a = await Ge();
11091
11091
  if (n.length === 0)
@@ -11095,7 +11095,7 @@ ${i}`);
11095
11095
  throw new Error("COLLECTION_NOT_FOUND");
11096
11096
  const h = a.collections[l], { labels: f, auth: d, enableWriteLog: m, softDelete: O } = h, y = Je(f.collection, a), w = await ie(o.appName);
11097
11097
  if (O && !d && !s?.force)
11098
- return await zc(n, e, { [O.archivedField]: !0, [O.timestampField]: me.serverTimestamp() }, void 0, t);
11098
+ return await qc(n, e, { [O.archivedField]: !0, [O.timestampField]: me.serverTimestamp() }, void 0, t);
11099
11099
  const b = ue();
11100
11100
  let N;
11101
11101
  t && await er(n, h);
@@ -11125,7 +11125,7 @@ ${i}`);
11125
11125
  throw new Error("USER_ERROR");
11126
11126
  if (!N.Enabled)
11127
11127
  throw new Error("PERMISSION_DENIED");
11128
- Yo(C, e, h, a, t, N);
11128
+ Jo(C, e, h, a, t, N);
11129
11129
  }
11130
11130
  if (t && N?.Role) {
11131
11131
  const j = N.Role;
@@ -11151,8 +11151,8 @@ ${i}`);
11151
11151
  }
11152
11152
  const k = ["delete", C, e, r], _ = [...k];
11153
11153
  return await ae("postWrite", o, y, k), await ae("postOperation", o, y, _), { id: e, ...C };
11154
- }, pu = async (n, e) => {
11155
- const t = ue(), s = bo(), r = process.env.ADMIN_SMS;
11154
+ }, yu = async (n, e) => {
11155
+ const t = ue(), s = So(), r = process.env.ADMIN_SMS;
11156
11156
  if (s === "development")
11157
11157
  if (r)
11158
11158
  n = r;
@@ -11160,73 +11160,73 @@ ${i}`);
11160
11160
  throw new Error("Admin phone not set");
11161
11161
  const i = { to: n, body: e };
11162
11162
  await t.collection("system_messages").add(i);
11163
- }, qc = (n) => n !== null && typeof n == "object", yu = (n) => {
11163
+ }, Bc = (n) => n !== null && typeof n == "object", gu = (n) => {
11164
11164
  const e = (t) => {
11165
11165
  Object.entries(t).forEach(([s, r]) => {
11166
11166
  r instanceof lt ? t[s] = {
11167
11167
  _seconds: r.seconds,
11168
11168
  _nanoseconds: r.nanoseconds
11169
- } : qc(r) && e(r);
11169
+ } : Bc(r) && e(r);
11170
11170
  });
11171
11171
  };
11172
11172
  e(n);
11173
- }, gu = async (n) => await gt().getUser(n), wu = (n) => {
11174
- const e = So();
11173
+ }, wu = async (n) => await gt().getUser(n), _u = (n) => {
11174
+ const e = To();
11175
11175
  return V.fromJSDate(n).setZone(e);
11176
- }, Bc = (n) => {
11177
- const e = So();
11176
+ }, Hc = (n) => {
11177
+ const e = To();
11178
11178
  return V.fromJSDate(n.toDate()).setZone(e);
11179
- }, _u = (n, e) => {
11179
+ }, Eu = (n, e) => {
11180
11180
  const s = V.fromJSDate(n, { zone: e }).offset, i = V.fromJSDate(n).offset, o = s - i;
11181
11181
  return V.fromJSDate(n).plus({ minutes: o }).toJSDate();
11182
- }, Eu = (n, e) => {
11182
+ }, vu = (n, e) => {
11183
11183
  const s = V.fromJSDate(n, { zone: e }).offset, i = V.fromJSDate(n).offset, o = s - i;
11184
11184
  return V.fromJSDate(n).minus({ minutes: o }).toJSDate();
11185
- }, vu = (n) => "seconds" in n && "nanoseconds" in n ? Bc(new lt(n.seconds, n.nanoseconds)).toFormat("MMMM d, yyyy '@' h:mm a") : "";
11185
+ }, Ou = (n) => "seconds" in n && "nanoseconds" in n ? Hc(new lt(n.seconds, n.nanoseconds)).toFormat("MMMM d, yyyy '@' h:mm a") : "";
11186
11186
  export {
11187
- hu as addRecord,
11188
- Co as addUser,
11189
- wu as convertDateToTimezone,
11190
- Bc as convertTimestampToTimezone,
11191
- mu as deleteRecord,
11187
+ mu as addRecord,
11188
+ $o as addUser,
11189
+ _u as convertDateToTimezone,
11190
+ Hc as convertTimestampToTimezone,
11191
+ pu as deleteRecord,
11192
11192
  un as deleteUser,
11193
11193
  tr as deserializeDeleteSentinels,
11194
- $o as deserializeTimestamps,
11195
- fu as deserializeTimestampsWithoutUnderscores,
11196
- vu as displayDate,
11194
+ Mo as deserializeTimestamps,
11195
+ hu as deserializeTimestampsWithoutUnderscores,
11196
+ Ou as displayDate,
11197
11197
  Ge as fetchCurrentSchema,
11198
- du as fetchLastSchema,
11199
- su as getCachedConfigValue,
11200
- Pc as getCollectionRefs,
11198
+ fu as fetchLastSchema,
11199
+ ru as getCachedConfigValue,
11200
+ Lc as getCollectionRefs,
11201
11201
  Je as getCustomizationFile,
11202
- Fc as getCustomizationFiles,
11203
- To as getDocumentRefs,
11202
+ Pc as getCustomizationFiles,
11203
+ Ro as getDocumentRefs,
11204
11204
  De as getFirestorePathRef,
11205
11205
  Ut as getGlobalConfigModule,
11206
- ru as getInputSchema,
11207
- lu as getMaintenanceInfo,
11208
- bo as getMode,
11206
+ iu as getInputSchema,
11207
+ cu as getMaintenanceInfo,
11208
+ So as getMode,
11209
11209
  at as getOne,
11210
- No as getSome,
11210
+ xo as getSome,
11211
11211
  Ye as getTenant,
11212
- So as getTimezone,
11213
- gu as getUser,
11214
- au as getVersionInfo,
11215
- Ca as getZodSchema,
11216
- uu as initializeFirebase,
11217
- iu as initializeStoker,
11212
+ To as getTimezone,
11213
+ wu as getUser,
11214
+ lu as getVersionInfo,
11215
+ $a as getZodSchema,
11216
+ du as initializeFirebase,
11217
+ ou as initializeStoker,
11218
11218
  Me as isDeleteSentinel,
11219
- _u as keepTimezone,
11220
- Eu as removeTimezone,
11221
- cu as runChildProcess,
11222
- Ao as sendMail,
11223
- pu as sendMessage,
11224
- yu as serializeTimestamps,
11225
- ou as setTenant,
11219
+ Eu as keepTimezone,
11220
+ vu as removeTimezone,
11221
+ uu as runChildProcess,
11222
+ Co as sendMail,
11223
+ yu as sendMessage,
11224
+ gu as serializeTimestamps,
11225
+ au as setTenant,
11226
11226
  ie as tryPromise,
11227
- zc as updateRecord,
11228
- jc as updateUser,
11229
- Mo as validateRelations,
11230
- Po as validateSoftDelete,
11227
+ qc as updateRecord,
11228
+ Zc as updateUser,
11229
+ Fo as validateRelations,
11230
+ Lo as validateSoftDelete,
11231
11231
  Mt as writeLog
11232
11232
  };