@firebase/firestore 3.4.4-canary.6555aa70f → 3.4.4-canary.aaeab08ac

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.
@@ -1,6 +1,6 @@
1
1
  import { __extends as t, __spreadArray as e, __awaiter as n, __generator as r } from "tslib";
2
2
 
3
- import { SDK_VERSION as i, _registerComponent as o, registerVersion as s, _getProvider, getApp as u, _removeServiceInstance as a } from "@firebase/app";
3
+ import { SDK_VERSION as i, _registerComponent as o, registerVersion as s, _getProvider, getApp as a, _removeServiceInstance as u } from "@firebase/app";
4
4
 
5
5
  import { Component as c } from "@firebase/component";
6
6
 
@@ -70,7 +70,7 @@ O.MOCK_USER = new O("mock-user");
70
70
  * See the License for the specific language governing permissions and
71
71
  * limitations under the License.
72
72
  */
73
- var M = "9.6.5-canary.6555aa70f", F = new h("@firebase/firestore");
73
+ var M = "9.6.5-canary.aaeab08ac", F = new h("@firebase/firestore");
74
74
 
75
75
  /**
76
76
  * @license
@@ -430,14 +430,14 @@ e) {
430
430
  return t.prototype.start = function(t, e) {
431
431
  var i = this, o = this.i, s = function(t) {
432
432
  return i.i !== o ? (o = i.i, e(t)) : Promise.resolve();
433
- }, u = new J;
433
+ }, a = new J;
434
434
  this.o = function() {
435
- i.i++, i.currentUser = i.u(), u.resolve(), u = new J, t.enqueueRetryable((function() {
435
+ i.i++, i.currentUser = i.u(), a.resolve(), a = new J, t.enqueueRetryable((function() {
436
436
  return s(i.currentUser);
437
437
  }));
438
438
  };
439
- var a = function() {
440
- var e = u;
439
+ var u = function() {
440
+ var e = a;
441
441
  t.enqueueRetryable((function() {
442
442
  return n(i, void 0, void 0, (function() {
443
443
  return r(this, (function(t) {
@@ -456,7 +456,7 @@ e) {
456
456
  }));
457
457
  }, c = function(t) {
458
458
  U("FirebaseAuthCredentialsProvider", "Auth detected"), i.auth = t, i.auth.addAuthTokenListener(i.o),
459
- a();
459
+ u();
460
460
  };
461
461
  this.t.onInit((function(t) {
462
462
  return c(t);
@@ -471,9 +471,9 @@ e) {
471
471
  });
472
472
  t ? c(t) : (
473
473
  // If auth is still not available, proceed with `null` user
474
- U("FirebaseAuthCredentialsProvider", "Auth not yet detected"), u.resolve(), u = new J);
474
+ U("FirebaseAuthCredentialsProvider", "Auth not yet detected"), a.resolve(), a = new J);
475
475
  }
476
- }), 0), a();
476
+ }), 0), u();
477
477
  }, t.prototype.getToken = function() {
478
478
  var t = this, e = this.i, n = this.forceRefresh;
479
479
  // Take note of the current value of the tokenCounter so that this method
@@ -605,7 +605,7 @@ e) {
605
605
  *
606
606
  * If `nBytes < 0` , an error will be thrown.
607
607
  */
608
- function ut(t) {
608
+ function at(t) {
609
609
  // Polyfills for IE and WebWorker by using `self` and `msCrypto` when `crypto` is not available.
610
610
  var e =
611
611
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -633,14 +633,14 @@ function ut(t) {
633
633
  * limitations under the License.
634
634
  */ st.I = -1;
635
635
 
636
- var at = /** @class */ function() {
636
+ var ut = /** @class */ function() {
637
637
  function t() {}
638
638
  return t.A = function() {
639
639
  for (
640
640
  // Alphanumeric characters
641
641
  var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", e = Math.floor(256 / t.length) * t.length, n = ""
642
642
  // The largest byte value that is a multiple of `char.length`.
643
- ; n.length < 20; ) for (var r = ut(40), i = 0; i < r.length; ++i)
643
+ ; n.length < 20; ) for (var r = at(40), i = 0; i < r.length; ++i)
644
644
  // Only accept values that are [0, maxMultiple), this ensures they can
645
645
  // be evenly mapped to indices of `chars` via a modulo operation.
646
646
  n.length < 20 && r[i] < e && (n += t.charAt(r[i] % t.length));
@@ -1039,13 +1039,13 @@ function vt(t) {
1039
1039
  if (0 === r.length) throw new Y(H.INVALID_ARGUMENT, "Invalid field path (" + t + "). Paths must not be empty, begin with '.', end with '.', or contain '..'");
1040
1040
  e.push(r), r = "";
1041
1041
  }, s = !1; i < t.length; ) {
1042
- var u = t[i];
1043
- if ("\\" === u) {
1042
+ var a = t[i];
1043
+ if ("\\" === a) {
1044
1044
  if (i + 1 === t.length) throw new Y(H.INVALID_ARGUMENT, "Path has trailing escape character: " + t);
1045
- var a = t[i + 1];
1046
- if ("\\" !== a && "." !== a && "`" !== a) throw new Y(H.INVALID_ARGUMENT, "Path has invalid escape sequence: " + t);
1047
- r += a, i += 2;
1048
- } else "`" === u ? (s = !s, i++) : "." !== u || s ? (r += u, i++) : (o(), i++);
1045
+ var u = t[i + 1];
1046
+ if ("\\" !== u && "." !== u && "`" !== u) throw new Y(H.INVALID_ARGUMENT, "Path has invalid escape sequence: " + t);
1047
+ r += u, i += 2;
1048
+ } else "`" === a ? (s = !s, i++) : "." !== a || s ? (r += a, i++) : (o(), i++);
1049
1049
  }
1050
1050
  if (o(), s) throw new Y(H.INVALID_ARGUMENT, "Unterminated ` in path: " + t);
1051
1051
  return new n(e);
@@ -1524,10 +1524,10 @@ function Vt(t, e) {
1524
1524
  // canonical IDs are independent of insertion order.
1525
1525
  r.sort(), o.sort();
1526
1526
  for (var s = 0; s < r.length && s < o.length; ++s) {
1527
- var u = ct(r[s], o[s]);
1528
- if (0 !== u) return u;
1529
- var a = Vt(n[r[s]], i[o[s]]);
1527
+ var a = ct(r[s], o[s]);
1530
1528
  if (0 !== a) return a;
1529
+ var u = Vt(n[r[s]], i[o[s]]);
1530
+ if (0 !== u) return u;
1531
1531
  }
1532
1532
  return ct(r.length, o.length);
1533
1533
  }(t.mapValue, e.mapValue);
@@ -1753,8 +1753,8 @@ function jt(t, e) {
1753
1753
  // For nested and non-empty ObjectValues, add the FieldPath of the
1754
1754
  // leaf nodes.
1755
1755
  for (var o = 0, s = i; o < s.length; o++) {
1756
- var u = s[o];
1757
- e.push(r.child(u));
1756
+ var a = s[o];
1757
+ e.push(r.child(a));
1758
1758
  }
1759
1759
  } else
1760
1760
  // For nested and non-empty ObjectValues, add the FieldPath of the leaf
@@ -1969,7 +1969,7 @@ var re = /** @class */ function(e) {
1969
1969
  /**
1970
1970
  * Creates a filter based on the provided arguments.
1971
1971
  */ return t(n, e), n.create = function(t, e, r) {
1972
- return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.P(t, e, r) : new ie(t, e, r) : "array-contains" /* ARRAY_CONTAINS */ === e ? new ae(t, r) : "in" /* IN */ === e ? new ce(t, r) : "not-in" /* NOT_IN */ === e ? new he(t, r) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new fe(t, r) : new n(t, e, r);
1972
+ return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.P(t, e, r) : new ie(t, e, r) : "array-contains" /* ARRAY_CONTAINS */ === e ? new ue(t, r) : "in" /* IN */ === e ? new ce(t, r) : "not-in" /* NOT_IN */ === e ? new he(t, r) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new fe(t, r) : new n(t, e, r);
1973
1973
  }, n.P = function(t, e, n) {
1974
1974
  return "in" /* IN */ === e ? new oe(t, n) : new se(t, n);
1975
1975
  }, n.prototype.matches = function(t) {
@@ -2018,7 +2018,7 @@ var ie = /** @class */ function(e) {
2018
2018
  }(re), oe = /** @class */ function(e) {
2019
2019
  function n(t, n) {
2020
2020
  var r = this;
2021
- return (r = e.call(this, t, "in" /* IN */ , n) || this).keys = ue("in" /* IN */ , n),
2021
+ return (r = e.call(this, t, "in" /* IN */ , n) || this).keys = ae("in" /* IN */ , n),
2022
2022
  r;
2023
2023
  }
2024
2024
  return t(n, e), n.prototype.matches = function(t) {
@@ -2029,7 +2029,7 @@ var ie = /** @class */ function(e) {
2029
2029
  }(re), se = /** @class */ function(e) {
2030
2030
  function n(t, n) {
2031
2031
  var r = this;
2032
- return (r = e.call(this, t, "not-in" /* NOT_IN */ , n) || this).keys = ue("not-in" /* NOT_IN */ , n),
2032
+ return (r = e.call(this, t, "not-in" /* NOT_IN */ , n) || this).keys = ae("not-in" /* NOT_IN */ , n),
2033
2033
  r;
2034
2034
  }
2035
2035
  return t(n, e), n.prototype.matches = function(t) {
@@ -2039,14 +2039,14 @@ var ie = /** @class */ function(e) {
2039
2039
  }, n;
2040
2040
  }(re);
2041
2041
 
2042
- /** Filter that matches on key fields within an array. */ function ue(t, e) {
2042
+ /** Filter that matches on key fields within an array. */ function ae(t, e) {
2043
2043
  var n;
2044
2044
  return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((function(t) {
2045
2045
  return Pt.fromName(t.referenceValue);
2046
2046
  }));
2047
2047
  }
2048
2048
 
2049
- /** A Filter that implements the array-contains operator. */ var ae = /** @class */ function(e) {
2049
+ /** A Filter that implements the array-contains operator. */ var ue = /** @class */ function(e) {
2050
2050
  function n(t, n) {
2051
2051
  return e.call(this, t, "array-contains" /* ARRAY_CONTAINS */ , n) || this;
2052
2052
  }
@@ -2151,18 +2151,18 @@ function me(t, e) {
2151
2151
  * Initializes a Query with a path and optional additional query constraints.
2152
2152
  * Path must currently be empty if this is a collection group query.
2153
2153
  */
2154
- function(t, e, n, r, i, o /* First */ , s, u) {
2154
+ function(t, e, n, r, i, o /* First */ , s, a) {
2155
2155
  void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
2156
2156
  void 0 === i && (i = null), void 0 === o && (o = "F"), void 0 === s && (s = null),
2157
- void 0 === u && (u = null), this.path = t, this.collectionGroup = e, this.explicitOrderBy = n,
2158
- this.filters = r, this.limit = i, this.limitType = o, this.startAt = s, this.endAt = u,
2157
+ void 0 === a && (a = null), this.path = t, this.collectionGroup = e, this.explicitOrderBy = n,
2158
+ this.filters = r, this.limit = i, this.limitType = o, this.startAt = s, this.endAt = a,
2159
2159
  this.S = null,
2160
2160
  // The corresponding `Target` of this `Query` instance.
2161
2161
  this.D = null, this.startAt, this.endAt;
2162
2162
  };
2163
2163
 
2164
- /** Creates a new Query instance with the options provided. */ function we(t, e, n, r, i, o, s, u) {
2165
- return new ge(t, e, n, r, i, o, s, u);
2164
+ /** Creates a new Query instance with the options provided. */ function we(t, e, n, r, i, o, s, a) {
2165
+ return new ge(t, e, n, r, i, o, s, a);
2166
2166
  }
2167
2167
 
2168
2168
  /** Creates a new Query for a query that matches all documents at `path` */ function be(t) {
@@ -2220,14 +2220,14 @@ function Se(t) {
2220
2220
  // Note that the default inequality field and key ordering is ascending.
2221
2221
  n.isKeyField() || e.S.push(new pe(n)), e.S.push(new pe(bt.keyField(), "asc" /* ASCENDING */)); else {
2222
2222
  for (var i = !1, o = 0, s = e.explicitOrderBy; o < s.length; o++) {
2223
- var u = s[o];
2224
- e.S.push(u), u.field.isKeyField() && (i = !0);
2223
+ var a = s[o];
2224
+ e.S.push(a), a.field.isKeyField() && (i = !0);
2225
2225
  }
2226
2226
  if (!i) {
2227
2227
  // The order of the implicit key ordering always matches the last
2228
2228
  // explicit order by
2229
- var a = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : "asc" /* ASCENDING */;
2230
- e.S.push(new pe(bt.keyField(), a));
2229
+ var u = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : "asc" /* ASCENDING */;
2230
+ e.S.push(new pe(bt.keyField(), u));
2231
2231
  }
2232
2232
  }
2233
2233
  }
@@ -2246,9 +2246,9 @@ function Se(t) {
2246
2246
  n.push(new pe(o.field, s));
2247
2247
  }
2248
2248
  // We need to swap the cursors to match the now-flipped query ordering.
2249
- var u = e.endAt ? new le(e.endAt.position, !e.endAt.before) : null, a = e.startAt ? new le(e.startAt.position, !e.startAt.before) : null;
2249
+ var a = e.endAt ? new le(e.endAt.position, !e.endAt.before) : null, u = e.startAt ? new le(e.startAt.position, !e.startAt.before) : null;
2250
2250
  // Now return as a LimitType.First query.
2251
- e.D = Zt(e.path, e.collectionGroup, n, e.filters, e.limit, u, a);
2251
+ e.D = Zt(e.path, e.collectionGroup, n, e.filters, e.limit, a, u);
2252
2252
  }
2253
2253
  return e.D;
2254
2254
  }
@@ -2309,8 +2309,8 @@ function xe(t) {
2309
2309
  function Le(t) {
2310
2310
  return function(e, n) {
2311
2311
  for (var r = !1, i = 0, o = Ae(t); i < o.length; i++) {
2312
- var s = o[i], u = Pe(s, e, n);
2313
- if (0 !== u) return u;
2312
+ var s = o[i], a = Pe(s, e, n);
2313
+ if (0 !== a) return a;
2314
2314
  r = r || s.field.isKeyField();
2315
2315
  }
2316
2316
  return 0;
@@ -2675,13 +2675,13 @@ e) {
2675
2675
  * of the document.
2676
2676
  * @param mutationResult - The result of applying the mutation from the backend.
2677
2677
  */ function en(t, e, n) {
2678
- t instanceof un ? function(t, e, n) {
2678
+ t instanceof an ? function(t, e, n) {
2679
2679
  // Unlike setMutationApplyToLocalView, if we're applying a mutation to a
2680
2680
  // remote document the server has accepted the mutation so the precondition
2681
2681
  // must have held.
2682
2682
  var r = t.value.clone(), i = hn(t.fieldTransforms, e, n.transformResults);
2683
2683
  r.setAll(i), e.convertToFoundDocument(n.version, r).setHasCommittedMutations();
2684
- }(t, e, n) : t instanceof an ? function(t, e, n) {
2684
+ }(t, e, n) : t instanceof un ? function(t, e, n) {
2685
2685
  if (Ze(t.precondition, e)) {
2686
2686
  var r = hn(t.fieldTransforms, e, n.transformResults), i = e.data;
2687
2687
  i.setAll(cn(t)), i.setAll(r), e.convertToFoundDocument(n.version, i).setHasCommittedMutations();
@@ -2706,12 +2706,12 @@ e) {
2706
2706
  * @param localWriteTime - A timestamp indicating the local write time of the
2707
2707
  * batch this mutation is a part of.
2708
2708
  */ function nn(t, e, n) {
2709
- t instanceof un ? function(t, e, n) {
2709
+ t instanceof an ? function(t, e, n) {
2710
2710
  if (Ze(t.precondition, e)) {
2711
2711
  var r = t.value.clone(), i = fn(t.fieldTransforms, n, e);
2712
2712
  r.setAll(i), e.convertToFoundDocument(sn(e), r).setHasLocalMutations();
2713
2713
  }
2714
- }(t, e, n) : t instanceof an ? function(t, e, n) {
2714
+ }(t, e, n) : t instanceof un ? function(t, e, n) {
2715
2715
  if (Ze(t.precondition, e)) {
2716
2716
  var r = fn(t.fieldTransforms, n, e), i = e.data;
2717
2717
  i.setAll(cn(t)), i.setAll(r), e.convertToFoundDocument(sn(e), i).setHasLocalMutations();
@@ -2741,8 +2741,8 @@ e) {
2741
2741
  * idempotent mutations.
2742
2742
  */ function rn(t, e) {
2743
2743
  for (var n = null, r = 0, i = t.fieldTransforms; r < i.length; r++) {
2744
- var o = i[r], s = e.data.field(o.field), u = Be(o.transform, s || null);
2745
- null != u && (null == n && (n = Yt.empty()), n.set(o.field, u));
2744
+ var o = i[r], s = e.data.field(o.field), a = Be(o.transform, s || null);
2745
+ null != a && (null == n && (n = Yt.empty()), n.set(o.field, a));
2746
2746
  }
2747
2747
  return n || null;
2748
2748
  }
@@ -2771,7 +2771,7 @@ function on(t, e) {
2771
2771
  /**
2772
2772
  * A mutation that creates or replaces the document at the given key with the
2773
2773
  * object value contents.
2774
- */ var un = /** @class */ function(e) {
2774
+ */ var an = /** @class */ function(e) {
2775
2775
  function n(t, n, r, i) {
2776
2776
  void 0 === i && (i = []);
2777
2777
  var o = this;
@@ -2779,7 +2779,7 @@ function on(t, e) {
2779
2779
  o.type = 0 /* Set */ , o;
2780
2780
  }
2781
2781
  return t(n, e), n;
2782
- }(tn), an = /** @class */ function(e) {
2782
+ }(tn), un = /** @class */ function(e) {
2783
2783
  function n(t, n, r, i, o) {
2784
2784
  void 0 === o && (o = []);
2785
2785
  var s = this;
@@ -2814,8 +2814,8 @@ function hn(t, e, n) {
2814
2814
  var r = new Map;
2815
2815
  z(t.length === n.length);
2816
2816
  for (var i = 0; i < n.length; i++) {
2817
- var o = t[i], s = o.transform, u = e.data.field(o.field);
2818
- r.set(o.field, Ue(s, u, n[i]));
2817
+ var o = t[i], s = o.transform, a = e.data.field(o.field);
2818
+ r.set(o.field, Ue(s, a, n[i]));
2819
2819
  }
2820
2820
  return r;
2821
2821
  }
@@ -2833,8 +2833,8 @@ function hn(t, e, n) {
2833
2833
  * @returns The transform results list.
2834
2834
  */ function fn(t, e, n) {
2835
2835
  for (var r = new Map, i = 0, o = t; i < o.length; i++) {
2836
- var s = o[i], u = s.transform, a = n.data.field(s.field);
2837
- r.set(s.field, qe(u, a, e));
2836
+ var s = o[i], a = s.transform, u = n.data.field(s.field);
2837
+ r.set(s.field, qe(a, u, e));
2838
2838
  }
2839
2839
  return r;
2840
2840
  }
@@ -4079,11 +4079,11 @@ function ir(t, e, n) {
4079
4079
 
4080
4080
  function or(t, e) {
4081
4081
  var n;
4082
- if (e instanceof un) n = {
4082
+ if (e instanceof an) n = {
4083
4083
  update: rr(t, e.key, e.value)
4084
4084
  }; else if (e instanceof pn) n = {
4085
4085
  delete: Xn(t, e.key)
4086
- }; else if (e instanceof an) n = {
4086
+ }; else if (e instanceof un) n = {
4087
4087
  update: rr(t, e.key, e.data),
4088
4088
  updateMask: wr(e.fieldMask)
4089
4089
  }; else {
@@ -4157,28 +4157,28 @@ function sr(t, e) {
4157
4157
  return bt.fromServerFormat(t);
4158
4158
  })));
4159
4159
  }(e.updateMask);
4160
- return new an(i, o, s, n, r);
4160
+ return new un(i, o, s, n, r);
4161
4161
  }
4162
- return new un(i, o, n, r);
4162
+ return new an(i, o, n, r);
4163
4163
  }
4164
4164
  if (e.delete) {
4165
- var u = $n(t, e.delete);
4166
- return new pn(u, n);
4165
+ var a = $n(t, e.delete);
4166
+ return new pn(a, n);
4167
4167
  }
4168
4168
  if (e.verify) {
4169
- var a = $n(t, e.verify);
4170
- return new yn(a, n);
4169
+ var u = $n(t, e.verify);
4170
+ return new yn(u, n);
4171
4171
  }
4172
4172
  return G();
4173
4173
  }
4174
4174
 
4175
- function ur(t, e) {
4175
+ function ar(t, e) {
4176
4176
  return {
4177
4177
  documents: [ Zn(t, e.path) ]
4178
4178
  };
4179
4179
  }
4180
4180
 
4181
- function ar(t, e) {
4181
+ function ur(t, e) {
4182
4182
  // Dissect the path into parent, collectionId, and optional key filter.
4183
4183
  var n = {
4184
4184
  structuredQuery: {}
@@ -4269,8 +4269,8 @@ function cr(t) {
4269
4269
  }
4270
4270
  var s = [];
4271
4271
  n.where && (s = hr(n.where));
4272
- var u = [];
4273
- n.orderBy && (u = n.orderBy.map((function(t) {
4272
+ var a = [];
4273
+ n.orderBy && (a = n.orderBy.map((function(t) {
4274
4274
  return function(t) {
4275
4275
  return new pe(vr(t.field),
4276
4276
  // visible for testing
@@ -4288,15 +4288,15 @@ function cr(t) {
4288
4288
  }(t.direction));
4289
4289
  }(t);
4290
4290
  })));
4291
- var a = null;
4292
- n.limit && (a = function(t) {
4291
+ var u = null;
4292
+ n.limit && (u = function(t) {
4293
4293
  var e;
4294
4294
  return xt(e = "object" == typeof t ? t.value : t) ? null : e;
4295
4295
  }(n.limit));
4296
4296
  var c = null;
4297
4297
  n.startAt && (c = lr(n.startAt));
4298
4298
  var h = null;
4299
- return n.endAt && (h = lr(n.endAt)), we(e, i, u, s, a, "F" /* First */ , c, h);
4299
+ return n.endAt && (h = lr(n.endAt)), we(e, i, a, s, u, "F" /* First */ , c, h);
4300
4300
  }
4301
4301
 
4302
4302
  function hr(t) {
@@ -4486,11 +4486,11 @@ function br(t) {
4486
4486
  var s = t.indexOf("", o);
4487
4487
  switch ((s < 0 || s > n) && G(), t.charAt(s + 1)) {
4488
4488
  case "":
4489
- var u = t.substring(o, s), a = void 0;
4489
+ var a = t.substring(o, s), u = void 0;
4490
4490
  0 === i.length ?
4491
4491
  // Avoid copying for the common case of a segment that excludes \0
4492
4492
  // and \001
4493
- a = u : (a = i += u, i = ""), r.push(a);
4493
+ u = a : (u = i += a, i = ""), r.push(u);
4494
4494
  break;
4495
4495
 
4496
4496
  case "":
@@ -5307,39 +5307,39 @@ var Br = e(e([], e(e([], e(e([], e(e([], [ kr.store, Dr.store, Nr.store, Rr.stor
5307
5307
  });
5308
5308
  }, t.prototype.runTransaction = function(t, e, i, o) {
5309
5309
  return n(this, void 0, void 0, (function() {
5310
- var n, s, u, a, c;
5310
+ var n, s, a, u, c;
5311
5311
  return r(this, (function(h) {
5312
5312
  switch (h.label) {
5313
5313
  case 0:
5314
- n = "readonly" === e, s = 0, u = function() {
5315
- var e, u, c, h, f;
5314
+ n = "readonly" === e, s = 0, a = function() {
5315
+ var e, a, c, h, f;
5316
5316
  return r(this, (function(r) {
5317
5317
  switch (r.label) {
5318
5318
  case 0:
5319
5319
  ++s, r.label = 1;
5320
5320
 
5321
5321
  case 1:
5322
- return r.trys.push([ 1, 4, , 5 ]), [ 4 /*yield*/ , a.Ct(t) ];
5322
+ return r.trys.push([ 1, 4, , 5 ]), [ 4 /*yield*/ , u.Ct(t) ];
5323
5323
 
5324
5324
  case 2:
5325
5325
  // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to
5326
5326
  // fire), but still return the original transactionFnResult back to the
5327
5327
  // caller.
5328
- return a.db = r.sent(), e = zr.open(a.db, t, n ? "readonly" : "readwrite", i), u = o(e).catch((function(t) {
5328
+ return u.db = r.sent(), e = zr.open(u.db, t, n ? "readonly" : "readwrite", i), a = o(e).catch((function(t) {
5329
5329
  // Abort the transaction if there was an error.
5330
5330
  return e.abort(t), Gr.reject(t);
5331
- })).toPromise(), c = {}, u.catch((function() {})), [ 4 /*yield*/ , e.At ];
5331
+ })).toPromise(), c = {}, a.catch((function() {})), [ 4 /*yield*/ , e.At ];
5332
5332
 
5333
5333
  case 3:
5334
5334
  return [ 2 /*return*/ , (c.value = (
5335
5335
  // Wait for the transaction to complete (i.e. IndexedDb's onsuccess event to
5336
5336
  // fire), but still return the original transactionFnResult back to the
5337
5337
  // caller.
5338
- r.sent(), u), c) ];
5338
+ r.sent(), a), c) ];
5339
5339
 
5340
5340
  case 4:
5341
5341
  return h = r.sent(), f = "FirebaseError" !== h.name && s < 3, U("SimpleDb", "Transaction failed with error:", h.message, "Retrying:", f),
5342
- a.close(), f ? [ 3 /*break*/ , 5 ] : [ 2 /*return*/ , {
5342
+ u.close(), f ? [ 3 /*break*/ , 5 ] : [ 2 /*return*/ , {
5343
5343
  value: Promise.reject(h)
5344
5344
  } ];
5345
5345
 
@@ -5347,10 +5347,10 @@ var Br = e(e([], e(e([], e(e([], e(e([], [ kr.store, Dr.store, Nr.store, Rr.stor
5347
5347
  return [ 2 /*return*/ ];
5348
5348
  }
5349
5349
  }));
5350
- }, a = this, h.label = 1;
5350
+ }, u = this, h.label = 1;
5351
5351
 
5352
5352
  case 1:
5353
- return [ 5 /*yield**/ , u() ];
5353
+ return [ 5 /*yield**/ , a() ];
5354
5354
 
5355
5355
  case 2:
5356
5356
  if ("object" == typeof (c = h.sent())) return [ 2 /*return*/ , c.value ];
@@ -5542,10 +5542,10 @@ var Br = e(e([], e(e([], e(e([], e(e([], [ kr.store, Dr.store, Nr.store, Rr.stor
5542
5542
  if (i) {
5543
5543
  var o = new Wr(i), s = e(i.primaryKey, i.value, o);
5544
5544
  if (s instanceof Gr) {
5545
- var u = s.catch((function(t) {
5545
+ var a = s.catch((function(t) {
5546
5546
  return o.done(), Gr.reject(t);
5547
5547
  }));
5548
- n.push(u);
5548
+ n.push(a);
5549
5549
  }
5550
5550
  o.isDone ? r() : null === o.Ft ? i.continue() : i.continue(o.Ft);
5551
5551
  } else r();
@@ -5812,8 +5812,8 @@ function ei(t, e) {
5812
5812
  /** Encodes a document for storage locally. */;
5813
5813
  }
5814
5814
 
5815
- function ui(t, e) {
5816
- var n = ai(e.readTime), r = e.key.path.popLast().toArray();
5815
+ function ai(t, e) {
5816
+ var n = ui(e.readTime), r = e.key.path.popLast().toArray();
5817
5817
  if (e.isFoundDocument()) {
5818
5818
  var i = function(t, e) {
5819
5819
  return {
@@ -5827,10 +5827,10 @@ function ui(t, e) {
5827
5827
  /* noDocument= */ null, i, o, n, r);
5828
5828
  }
5829
5829
  if (e.isNoDocument()) {
5830
- var s = e.key.path.toArray(), u = hi(e.version), a = e.hasCommittedMutations;
5830
+ var s = e.key.path.toArray(), a = hi(e.version), u = e.hasCommittedMutations;
5831
5831
  return new Rr(
5832
- /* unknownDocument= */ null, new Cr(s, u),
5833
- /* document= */ null, a, n, r);
5832
+ /* unknownDocument= */ null, new Cr(s, a),
5833
+ /* document= */ null, u, n, r);
5834
5834
  }
5835
5835
  if (e.isUnknownDocument()) {
5836
5836
  var c = e.key.path.toArray(), h = hi(e.version);
@@ -5842,7 +5842,7 @@ function ui(t, e) {
5842
5842
  return G();
5843
5843
  }
5844
5844
 
5845
- function ai(t) {
5845
+ function ui(t) {
5846
5846
  var e = t.toTimestamp();
5847
5847
  return [ e.seconds, e.nanoseconds ];
5848
5848
  }
@@ -5881,8 +5881,8 @@ function fi(t) {
5881
5881
  }
5882
5882
  var s = e.mutations.map((function(e) {
5883
5883
  return sr(t.Gt, e);
5884
- })), u = lt.fromMillis(e.localWriteTimeMs);
5885
- return new ni(e.batchId, u, n, s);
5884
+ })), a = lt.fromMillis(e.localWriteTimeMs);
5885
+ return new ni(e.batchId, a, n, s);
5886
5886
  }
5887
5887
 
5888
5888
  /** Decodes a DbTarget into TargetData */ function di(t) {
@@ -5896,7 +5896,7 @@ function fi(t) {
5896
5896
 
5897
5897
  function pi(t, e) {
5898
5898
  var n, r = hi(e.snapshotVersion), i = hi(e.lastLimboFreeSnapshotVersion);
5899
- n = ne(e.target) ? ur(t.Gt, e.target) : ar(t.Gt, e.target);
5899
+ n = ne(e.target) ? ar(t.Gt, e.target) : ur(t.Gt, e.target);
5900
5900
  // We can't store the resumeToken as a ByteString in IndexedDb, so we
5901
5901
  // convert it to a base64 string for storage.
5902
5902
  var o = e.resumeToken.toBase64();
@@ -6150,13 +6150,13 @@ function Ti(t) {
6150
6150
  * @returns A PersistencePromise of the document mutations that were removed.
6151
6151
  */
6152
6152
  function _i(t, e, n) {
6153
- var r = t.store(Dr.store), i = t.store(Nr.store), o = [], s = IDBKeyRange.only(n.batchId), u = 0, a = r.jt({
6153
+ var r = t.store(Dr.store), i = t.store(Nr.store), o = [], s = IDBKeyRange.only(n.batchId), a = 0, u = r.jt({
6154
6154
  range: s
6155
6155
  }, (function(t, e, n) {
6156
- return u++, n.delete();
6156
+ return a++, n.delete();
6157
6157
  }));
6158
- o.push(a.next((function() {
6159
- z(1 === u);
6158
+ o.push(u.next((function() {
6159
+ z(1 === a);
6160
6160
  })));
6161
6161
  for (var c = [], h = 0, f = n.mutations; h < f.length; h++) {
6162
6162
  var l = f[h], d = Nr.key(e, l.key.path, n.batchId);
@@ -6253,27 +6253,27 @@ var ki = /** @class */ function() {
6253
6253
  // See: https://bugs.chromium.org/p/chromium/issues/detail?id=701972
6254
6254
  // We write an empty object to obtain key
6255
6255
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6256
- return s.add({}).next((function(u) {
6257
- z("number" == typeof u);
6258
- for (var a = new ni(u, e, n, r), c = function(t, e, n) {
6256
+ return s.add({}).next((function(a) {
6257
+ z("number" == typeof a);
6258
+ for (var u = new ni(a, e, n, r), c = function(t, e, n) {
6259
6259
  var r = n.baseMutations.map((function(e) {
6260
6260
  return or(t.Gt, e);
6261
6261
  })), i = n.mutations.map((function(e) {
6262
6262
  return or(t.Gt, e);
6263
6263
  }));
6264
6264
  return new Dr(e, n.batchId, n.localWriteTime.toMillis(), r, i);
6265
- }(i.k, i.userId, a), h = [], f = new Tn((function(t, e) {
6265
+ }(i.k, i.userId, u), h = [], f = new Tn((function(t, e) {
6266
6266
  return ct(t.canonicalString(), e.canonicalString());
6267
6267
  })), l = 0, d = r; l < d.length; l++) {
6268
- var p = d[l], y = Nr.key(i.userId, p.key.path, u);
6268
+ var p = d[l], y = Nr.key(i.userId, p.key.path, a);
6269
6269
  f = f.add(p.key.path.popLast()), h.push(s.put(c)), h.push(o.put(y, Nr.PLACEHOLDER));
6270
6270
  }
6271
6271
  return f.forEach((function(e) {
6272
6272
  h.push(i.Jt.addToCollectionParentIndex(t, e));
6273
6273
  })), t.addOnCommittedListener((function() {
6274
- i.Yt[u] = a.keys();
6274
+ i.Yt[a] = u.keys();
6275
6275
  })), Gr.waitFor(h).next((function() {
6276
- return a;
6276
+ return u;
6277
6277
  }));
6278
6278
  }));
6279
6279
  }, t.prototype.lookupMutationBatch = function(t, e) {
@@ -6333,7 +6333,7 @@ var ki = /** @class */ function() {
6333
6333
  return Ci(t).jt({
6334
6334
  range: i
6335
6335
  }, (function(r, i, s) {
6336
- var u = r[0], a = r[1], c = r[2], h = Sr(a);
6336
+ var a = r[0], u = r[1], c = r[2], h = Sr(u);
6337
6337
  // Only consider rows matching exactly the specific key of
6338
6338
  // interest. Note that because we order by path first, and we
6339
6339
  // order terminators before path separators, we'll encounter all
@@ -6341,7 +6341,7 @@ var ki = /** @class */ function() {
6341
6341
  // the rows for documentKey will occur before any rows for
6342
6342
  // documents nested in a subcollection beneath documentKey so we
6343
6343
  // can stop as soon as we hit any such row.
6344
- if (u === n.userId && e.path.isEqual(h))
6344
+ if (a === n.userId && e.path.isEqual(h))
6345
6345
  // Look up the mutation batch in the store.
6346
6346
  return Ni(t).get(c).next((function(t) {
6347
6347
  if (!t) throw G();
@@ -6354,10 +6354,10 @@ var ki = /** @class */ function() {
6354
6354
  }, t.prototype.getAllMutationBatchesAffectingDocumentKeys = function(t, e) {
6355
6355
  var n = this, r = new Tn(ct), i = [];
6356
6356
  return e.forEach((function(e) {
6357
- var o = Nr.prefixForPath(n.userId, e.path), s = IDBKeyRange.lowerBound(o), u = Ci(t).jt({
6357
+ var o = Nr.prefixForPath(n.userId, e.path), s = IDBKeyRange.lowerBound(o), a = Ci(t).jt({
6358
6358
  range: s
6359
6359
  }, (function(t, i, o) {
6360
- var s = t[0], u = t[1], a = t[2], c = Sr(u);
6360
+ var s = t[0], a = t[1], u = t[2], c = Sr(a);
6361
6361
  // Only consider rows matching exactly the specific key of
6362
6362
  // interest. Note that because we order by path first, and we
6363
6363
  // order terminators before path separators, we'll encounter all
@@ -6365,27 +6365,27 @@ var ki = /** @class */ function() {
6365
6365
  // the rows for documentKey will occur before any rows for
6366
6366
  // documents nested in a subcollection beneath documentKey so we
6367
6367
  // can stop as soon as we hit any such row.
6368
- s === n.userId && e.path.isEqual(c) ? r = r.add(a) : o.done();
6368
+ s === n.userId && e.path.isEqual(c) ? r = r.add(u) : o.done();
6369
6369
  }));
6370
- i.push(u);
6370
+ i.push(a);
6371
6371
  })), Gr.waitFor(i).next((function() {
6372
6372
  return n.te(t, r);
6373
6373
  }));
6374
6374
  }, t.prototype.getAllMutationBatchesAffectingQuery = function(t, e) {
6375
- var n = this, r = e.path, i = r.length + 1, o = Nr.prefixForPath(this.userId, r), s = IDBKeyRange.lowerBound(o), u = new Tn(ct);
6375
+ var n = this, r = e.path, i = r.length + 1, o = Nr.prefixForPath(this.userId, r), s = IDBKeyRange.lowerBound(o), a = new Tn(ct);
6376
6376
  return Ci(t).jt({
6377
6377
  range: s
6378
6378
  }, (function(t, e, o) {
6379
- var s = t[0], a = t[1], c = t[2], h = Sr(a);
6379
+ var s = t[0], u = t[1], c = t[2], h = Sr(u);
6380
6380
  s === n.userId && r.isPrefixOf(h) ?
6381
6381
  // Rows with document keys more than one segment longer than the
6382
6382
  // query path can't be matches. For example, a query on 'rooms'
6383
6383
  // can't match the document /rooms/abc/messages/xyx.
6384
6384
  // TODO(mcg): we'll need a different scanner when we implement
6385
6385
  // ancestor queries.
6386
- h.length === i && (u = u.add(c)) : o.done();
6386
+ h.length === i && (a = a.add(c)) : o.done();
6387
6387
  })).next((function() {
6388
- return n.te(t, u);
6388
+ return n.te(t, a);
6389
6389
  }));
6390
6390
  }, t.prototype.te = function(t, e) {
6391
6391
  var n = this, r = [], i = [];
@@ -6460,8 +6460,8 @@ var ki = /** @class */ function() {
6460
6460
  range: o,
6461
6461
  Kt: !0
6462
6462
  }, (function(t, n, r) {
6463
- var o = t[0], u = t[1];
6464
- /*batchID*/ t[2], o === e && u === i && (s = !0),
6463
+ var o = t[0], a = t[1];
6464
+ /*batchID*/ t[2], o === e && a === i && (s = !0),
6465
6465
  r.done();
6466
6466
  })).next((function() {
6467
6467
  return s;
@@ -6591,9 +6591,9 @@ var ki = /** @class */ function() {
6591
6591
  */
6592
6592
  t.prototype.removeTargets = function(t, e, n) {
6593
6593
  var r = this, i = 0, o = [];
6594
- return Pi(t).jt((function(s, u) {
6595
- var a = di(u);
6596
- a.sequenceNumber <= e && null === n.get(a.targetId) && (i++, o.push(r.removeTargetData(t, a)));
6594
+ return Pi(t).jt((function(s, a) {
6595
+ var u = di(a);
6596
+ u.sequenceNumber <= e && null === n.get(u.targetId) && (i++, o.push(r.removeTargetData(t, u)));
6597
6597
  })).next((function() {
6598
6598
  return Gr.waitFor(o);
6599
6599
  })).next((function() {
@@ -6921,7 +6921,7 @@ function Pi(t) {
6921
6921
  }, t.prototype.getCacheSize = function(t) {
6922
6922
  return this.ge.getCacheSize(t);
6923
6923
  }, t.prototype.Te = function(t, e) {
6924
- var n, r, i, o, s, u, a, c = this, h = Date.now();
6924
+ var n, r, i, o, s, a, u, c = this, h = Date.now();
6925
6925
  return this.calculateTargetCount(t, this.params.percentileToCollect).next((function(e) {
6926
6926
  // Cap at the configured max
6927
6927
  return e > c.params.maximumSequenceNumbersToCollect ? (U("LruGarbageCollector", "Capping sequence numbers to collect down to the maximum of " + c.params.maximumSequenceNumbersToCollect + " from " + e),
@@ -6929,9 +6929,9 @@ function Pi(t) {
6929
6929
  })).next((function(r) {
6930
6930
  return n = r, s = Date.now(), c.removeTargets(t, n, e);
6931
6931
  })).next((function(e) {
6932
- return i = e, u = Date.now(), c.removeOrphanedDocuments(t, n);
6932
+ return i = e, a = Date.now(), c.removeOrphanedDocuments(t, n);
6933
6933
  })).next((function(t) {
6934
- return a = Date.now(), V() <= f.DEBUG && U("LruGarbageCollector", "LRU Garbage Collection\n\tCounted targets in " + (o - h) + "ms\n\tDetermined least recently used " + r + " in " + (s - o) + "ms\n\tRemoved " + i + " targets in " + (u - s) + "ms\n\tRemoved " + t + " documents in " + (a - u) + "ms\nTotal Duration: " + (a - h) + "ms"),
6934
+ return u = Date.now(), V() <= f.DEBUG && U("LruGarbageCollector", "LRU Garbage Collection\n\tCounted targets in " + (o - h) + "ms\n\tDetermined least recently used " + r + " in " + (s - o) + "ms\n\tRemoved " + i + " targets in " + (a - s) + "ms\n\tRemoved " + t + " documents in " + (u - a) + "ms\nTotal Duration: " + (u - h) + "ms"),
6935
6935
  Gr.resolve({
6936
6936
  didRun: !0,
6937
6937
  sequenceNumbersCollected: r,
@@ -6994,17 +6994,17 @@ function Pi(t) {
6994
6994
  }(t, e);
6995
6995
  }, t.prototype.removeOrphanedDocuments = function(t, e) {
6996
6996
  var n = this, r = this.db.getRemoteDocumentCache().newChangeBuffer(), i = [], o = 0;
6997
- return this.Ie(t, (function(s, u) {
6998
- if (u <= e) {
6999
- var a = n.Ae(t, s).next((function(e) {
6997
+ return this.Ie(t, (function(s, a) {
6998
+ if (a <= e) {
6999
+ var u = n.Ae(t, s).next((function(e) {
7000
7000
  if (!e)
7001
7001
  // Our size accounting requires us to read all documents before
7002
7002
  // removing them.
7003
7003
  return o++, r.getEntry(t, s).next((function() {
7004
- return r.removeEntry(s), Mi(t).delete([ 0, Ir(s.path) ]);
7004
+ return r.removeEntry(s, dt.min()), Mi(t).delete([ 0, Ir(s.path) ]);
7005
7005
  }));
7006
7006
  }));
7007
- i.push(a);
7007
+ i.push(u);
7008
7008
  }
7009
7009
  })).next((function() {
7010
7010
  return Gr.waitFor(i);
@@ -7032,7 +7032,7 @@ function Pi(t) {
7032
7032
  }, (function(t, r) {
7033
7033
  var o = t[0];
7034
7034
  t[1];
7035
- var s = r.path, u = r.sequenceNumber;
7035
+ var s = r.path, a = r.sequenceNumber;
7036
7036
  0 === o ? (
7037
7037
  // if nextToReport is valid, report it, this is a new key so the
7038
7038
  // last one must not be a member of any targets.
@@ -7041,7 +7041,7 @@ function Pi(t) {
7041
7041
  // might report, if we don't find any targets for this document.
7042
7042
  // Note that the sequence number must be defined when the targetId
7043
7043
  // is 0.
7044
- i = u, n = s) :
7044
+ i = a, n = s) :
7045
7045
  // set nextToReport to be invalid, we know we don't need to report
7046
7046
  // this one since we found a target for it.
7047
7047
  i = st.I;
@@ -7106,8 +7106,8 @@ function Pi(t) {
7106
7106
  return t.prototype.get = function(t) {
7107
7107
  var e = this.mapKeyFn(t), n = this.inner[e];
7108
7108
  if (void 0 !== n) for (var r = 0, i = n; r < i.length; r++) {
7109
- var o = i[r], s = o[0], u = o[1];
7110
- if (this.equalsFn(s, t)) return u;
7109
+ var o = i[r], s = o[0], a = o[1];
7110
+ if (this.equalsFn(s, t)) return a;
7111
7111
  }
7112
7112
  }, t.prototype.has = function(t) {
7113
7113
  return void 0 !== this.get(t);
@@ -7131,8 +7131,8 @@ function Pi(t) {
7131
7131
  }, t.prototype.forEach = function(t) {
7132
7132
  yt(this.inner, (function(e, n) {
7133
7133
  for (var r = 0, i = n; r < i.length; r++) {
7134
- var o = i[r], s = o[0], u = o[1];
7135
- t(s, u);
7134
+ var o = i[r], s = o[0], a = o[1];
7135
+ t(s, a);
7136
7136
  }
7137
7137
  }));
7138
7138
  }, t.prototype.isEmpty = function() {
@@ -7311,14 +7311,14 @@ function Pi(t) {
7311
7311
  if (n.isEqual(dt.min())) {
7312
7312
  // Documents are ordered by key, so we can use a prefix scan to narrow
7313
7313
  // down the documents we need to match the query against.
7314
- var u = e.path.toArray();
7315
- s.range = IDBKeyRange.lowerBound(u);
7314
+ var a = e.path.toArray();
7315
+ s.range = IDBKeyRange.lowerBound(a);
7316
7316
  } else {
7317
7317
  // Execute an index-free query and filter by read time. This is safe
7318
7318
  // since all document changes to queries that have a
7319
7319
  // lastLimboFreeSnapshotVersion (`sinceReadTime`) have a read time set.
7320
- var a = e.path.toArray(), c = ai(n);
7321
- s.range = IDBKeyRange.lowerBound([ a, c ],
7320
+ var u = e.path.toArray(), c = ui(n);
7321
+ s.range = IDBKeyRange.lowerBound([ u, c ],
7322
7322
  /* open= */ !0), s.index = Rr.collectionReadTimeIndex;
7323
7323
  }
7324
7324
  return Yi(t).jt(s, (function(t, n, s) {
@@ -7328,8 +7328,8 @@ function Pi(t) {
7328
7328
  // shouldn't match it. Fix this by discarding rows with document keys
7329
7329
  // more than one segment longer than the query path.
7330
7330
  if (t.length === o) {
7331
- var u = r.be(Pt.fromSegments(t), n);
7332
- e.path.isPrefixOf(u.key.path) ? Re(e, u) && (i = i.insert(u.key, u)) : s.done();
7331
+ var a = r.be(Pt.fromSegments(t), n);
7332
+ e.path.isPrefixOf(a.key.path) ? Re(e, a) && (i = i.insert(a.key, a)) : s.done();
7333
7333
  }
7334
7334
  })).next((function() {
7335
7335
  return i;
@@ -7381,18 +7381,18 @@ function Pi(t) {
7381
7381
  return ct(t.canonicalString(), e.canonicalString());
7382
7382
  }));
7383
7383
  return this.changes.forEach((function(o, s) {
7384
- var u = e.Ce.get(o);
7384
+ var a = e.Ce.get(o);
7385
7385
  if (s.isValidDocument()) {
7386
- var a = ui(e.De.k, s);
7386
+ var u = ai(e.De.k, s);
7387
7387
  i = i.add(o.path.popLast());
7388
- var c = Ai(a);
7389
- r += c - u, n.push(e.De.addEntry(t, o, a));
7390
- } else if (r -= u, e.trackRemovals) {
7388
+ var c = Ai(u);
7389
+ r += c - a, n.push(e.De.addEntry(t, o, u));
7390
+ } else if (r -= a, e.trackRemovals) {
7391
7391
  // In order to track removals, we store a "sentinel delete" in the
7392
7392
  // RemoteDocumentCache. This entry is represented by a NoDocument
7393
7393
  // with a version of 0 and ignored by `maybeDecodeDocument()` but
7394
7394
  // preserved in `getNewDocumentChanges()`.
7395
- var h = ui(e.De.k, s.convertToNoDocument(dt.min()));
7395
+ var h = ai(e.De.k, s.convertToNoDocument(dt.min()));
7396
7396
  n.push(e.De.addEntry(t, o, h));
7397
7397
  } else n.push(e.De.removeEntry(t, o));
7398
7398
  })), i.forEach((function(r) {
@@ -7698,14 +7698,14 @@ var Zi = "Failed to obtain exclusive access to the persistence layer. To allow s
7698
7698
  * Whether to synchronize the in-memory state of multiple tabs and share
7699
7699
  * access to local persistence.
7700
7700
  */
7701
- e, n, r, i, o, s, u, a, c,
7701
+ e, n, r, i, o, s, a, u, c,
7702
7702
  /**
7703
7703
  * If set to true, forcefully obtains database access. Existing tabs will
7704
7704
  * no longer be able to access IndexedDB.
7705
7705
  */
7706
7706
  h) {
7707
7707
  if (this.allowTabSynchronization = e, this.persistenceKey = n, this.clientId = r,
7708
- this.Me = o, this.window = s, this.document = u, this.Fe = c, this.Le = h, this.Be = null,
7708
+ this.Me = o, this.window = s, this.document = a, this.Fe = c, this.Le = h, this.Be = null,
7709
7709
  this.Ue = !1, this.isPrimary = !1, this.networkEnabled = !0,
7710
7710
  /** Our window.unload handler, if registered. */
7711
7711
  this.qe = null, this.inForeground = !1,
@@ -7719,7 +7719,7 @@ var Zi = "Failed to obtain exclusive access to the persistence layer. To allow s
7719
7719
  this.We = function(t) {
7720
7720
  return Promise.resolve();
7721
7721
  }, !t.Pt()) throw new Y(H.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
7722
- this.referenceDelegate = new ji(this, i), this.Ge = n + "main", this.k = new oi(a),
7722
+ this.referenceDelegate = new ji(this, i), this.Ge = n + "main", this.k = new oi(u),
7723
7723
  this.ze = new Qr(this.Ge, 11, new Xi(this.k)), this.He = new Li(this.referenceDelegate, this.k),
7724
7724
  this.Jt = new Ii, this.Je = function(t, e) {
7725
7725
  return new Qi(t, e);
@@ -8363,11 +8363,11 @@ var io = function(t, e) {
8363
8363
  var r = this, i = e.collectionGroup, o = kn();
8364
8364
  return this.Jt.getCollectionParents(t, i).next((function(s) {
8365
8365
  return Gr.forEach(s, (function(s) {
8366
- var u = function(t, e) {
8366
+ var a = function(t, e) {
8367
8367
  return new ge(e,
8368
8368
  /*collectionGroup=*/ null, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
8369
8369
  }(e, s.child(i));
8370
- return r.Cn(t, u, n).next((function(t) {
8370
+ return r.Cn(t, a, n).next((function(t) {
8371
8371
  t.forEach((function(t, e) {
8372
8372
  o = o.insert(t, e);
8373
8373
  }));
@@ -8384,11 +8384,11 @@ var io = function(t, e) {
8384
8384
  })).next((function(e) {
8385
8385
  return i = e, o.Nn(t, i, r).next((function(t) {
8386
8386
  r = t;
8387
- for (var e = 0, n = i; e < n.length; e++) for (var o = n[e], s = 0, u = o.mutations; s < u.length; s++) {
8388
- var a = u[s], c = a.key, h = r.get(c);
8387
+ for (var e = 0, n = i; e < n.length; e++) for (var o = n[e], s = 0, a = o.mutations; s < a.length; s++) {
8388
+ var u = a[s], c = u.key, h = r.get(c);
8389
8389
  null == h && (
8390
8390
  // Create invalid document to apply mutations on top of
8391
- h = Xt.newInvalidDocument(c), r = r.insert(c, h)), nn(a, h, o.localWriteTime), h.isFoundDocument() || (r = r.remove(c));
8391
+ h = Xt.newInvalidDocument(c), r = r.insert(c, h)), nn(u, h, o.localWriteTime), h.isFoundDocument() || (r = r.remove(c));
8392
8392
  }
8393
8393
  }));
8394
8394
  })).next((function() {
@@ -8399,9 +8399,9 @@ var io = function(t, e) {
8399
8399
  })), r;
8400
8400
  }));
8401
8401
  }, t.prototype.Nn = function(t, e, n) {
8402
- for (var r = Cn(), i = 0, o = e; i < o.length; i++) for (var s = 0, u = o[i].mutations; s < u.length; s++) {
8403
- var a = u[s];
8404
- a instanceof an && null === n.get(a.key) && (r = r.add(a.key));
8402
+ for (var r = Cn(), i = 0, o = e; i < o.length; i++) for (var s = 0, a = o[i].mutations; s < a.length; s++) {
8403
+ var u = a[s];
8404
+ u instanceof un && null === n.get(u.key) && (r = r.add(u.key));
8405
8405
  }
8406
8406
  var c = n;
8407
8407
  return this.Je.getEntries(t, r).next((function(t) {
@@ -8416,20 +8416,20 @@ var io = function(t, e) {
8416
8416
  }
8417
8417
  return t.$n = function(e, n) {
8418
8418
  for (var r = Cn(), i = Cn(), o = 0, s = n.docChanges; o < s.length; o++) {
8419
- var u = s[o];
8420
- switch (u.type) {
8419
+ var a = s[o];
8420
+ switch (a.type) {
8421
8421
  case 0 /* Added */ :
8422
- r = r.add(u.doc.key);
8422
+ r = r.add(a.doc.key);
8423
8423
  break;
8424
8424
 
8425
8425
  case 1 /* Removed */ :
8426
- i = i.add(u.doc.key);
8426
+ i = i.add(a.doc.key);
8427
8427
  // do nothing
8428
8428
  }
8429
8429
  }
8430
8430
  return new t(e, n.fromCache, r, i);
8431
8431
  }, t;
8432
- }(), uo = /** @class */ function() {
8432
+ }(), ao = /** @class */ function() {
8433
8433
  function t() {}
8434
8434
  /** Sets the document view to query against. */ return t.prototype.On = function(t) {
8435
8435
  this.Mn = t;
@@ -8493,7 +8493,7 @@ var io = function(t, e) {
8493
8493
  return V() <= f.DEBUG && U("QueryEngine", "Using full collection scan to execute query:", xe(e)),
8494
8494
  this.Mn.getDocumentsMatchingQuery(t, e, dt.min());
8495
8495
  }, t;
8496
- }(), ao = /** @class */ function() {
8496
+ }(), uo = /** @class */ function() {
8497
8497
  function t(
8498
8498
  /** Manages our in-memory or durable persistence. */
8499
8499
  t, e, n, r) {
@@ -8551,7 +8551,7 @@ var io = function(t, e) {
8551
8551
  */ function co(
8552
8552
  /** Manages our in-memory or durable persistence. */
8553
8553
  t, e, n, r) {
8554
- return new ao(t, e, n, r);
8554
+ return new uo(t, e, n, r);
8555
8555
  }
8556
8556
 
8557
8557
  /**
@@ -8578,10 +8578,10 @@ function ho(t, e) {
8578
8578
  // MutationQueue.
8579
8579
  o = new oo(n.Qn, i, n.persistence.getIndexManager()), i.getAllMutationBatches(t);
8580
8580
  })).next((function(e) {
8581
- for (var n = [], i = [], s = Cn(), u = 0, a = r
8581
+ for (var n = [], i = [], s = Cn(), a = 0, u = r
8582
8582
  // Union the old/new changed keys.
8583
- ; u < a.length; u++) {
8584
- var c = a[u];
8583
+ ; a < u.length; a++) {
8584
+ var c = u[a];
8585
8585
  n.push(c.batchId);
8586
8586
  for (var h = 0, f = c.mutations; h < f.length; h++) {
8587
8587
  var l = f[h];
@@ -8693,18 +8693,18 @@ function ho(t, e) {
8693
8693
  // Reset newTargetDataByTargetMap in case this transaction gets re-run.
8694
8694
  i = n.qn;
8695
8695
  var s = [];
8696
- e.targetChanges.forEach((function(o, u) {
8697
- var a = i.get(u);
8698
- if (a) {
8696
+ e.targetChanges.forEach((function(o, a) {
8697
+ var u = i.get(a);
8698
+ if (u) {
8699
8699
  // Only update the remote keys if the target is still active. This
8700
8700
  // ensures that we can persist the updated target data along with
8701
8701
  // the updated assignment.
8702
- s.push(n.He.removeMatchingKeys(t, o.removedDocuments, u).next((function() {
8703
- return n.He.addMatchingKeys(t, o.addedDocuments, u);
8702
+ s.push(n.He.removeMatchingKeys(t, o.removedDocuments, a).next((function() {
8703
+ return n.He.addMatchingKeys(t, o.addedDocuments, a);
8704
8704
  })));
8705
- var c = a.withSequenceNumber(t.currentSequenceNumber);
8706
- e.targetMismatches.has(u) ? c = c.withResumeToken(Et.EMPTY_BYTE_STRING, dt.min()).withLastLimboFreeSnapshotVersion(dt.min()) : o.resumeToken.approximateByteSize() > 0 && (c = c.withResumeToken(o.resumeToken, r)),
8707
- i = i.insert(u, c),
8705
+ var c = u.withSequenceNumber(t.currentSequenceNumber);
8706
+ e.targetMismatches.has(a) ? c = c.withResumeToken(Et.EMPTY_BYTE_STRING, dt.min()).withLastLimboFreeSnapshotVersion(dt.min()) : o.resumeToken.approximateByteSize() > 0 && (c = c.withResumeToken(o.resumeToken, r)),
8707
+ i = i.insert(a, c),
8708
8708
  // Update the target data if there are target changes (or if
8709
8709
  // sufficient time has passed since the last update).
8710
8710
  /**
@@ -8727,10 +8727,10 @@ function ho(t, e) {
8727
8727
  // we may not get time to do anything interesting while the current tab is
8728
8728
  // closing.
8729
8729
  e.snapshotVersion.toMicroseconds() - t.snapshotVersion.toMicroseconds() >= 3e8 || n.addedDocuments.size + n.modifiedDocuments.size + n.removedDocuments.size > 0);
8730
- }(a, c, o) && s.push(n.He.updateTargetData(t, c));
8730
+ }(u, c, o) && s.push(n.He.updateTargetData(t, c));
8731
8731
  }
8732
8732
  }));
8733
- var u = _n();
8733
+ var a = _n();
8734
8734
  // HACK: The only reason we allow a null snapshot version is so that we
8735
8735
  // can synthesize remote events when we get permission denied errors while
8736
8736
  // trying to resolve the state of a locally cached document that is in
@@ -8741,19 +8741,19 @@ function ho(t, e) {
8741
8741
  // Each loop iteration only affects its "own" doc, so it's safe to get all the remote
8742
8742
  // documents in advance in a single call.
8743
8743
  s.push(yo(t, o, e.documentUpdates).next((function(t) {
8744
- u = t;
8744
+ a = t;
8745
8745
  }))), !r.isEqual(dt.min())) {
8746
- var a = n.He.getLastRemoteSnapshotVersion(t).next((function(e) {
8746
+ var u = n.He.getLastRemoteSnapshotVersion(t).next((function(e) {
8747
8747
  return n.He.setTargetsMetadata(t, t.currentSequenceNumber, r);
8748
8748
  }));
8749
- s.push(a);
8749
+ s.push(u);
8750
8750
  }
8751
8751
  return Gr.waitFor(s).next((function() {
8752
8752
  return o.apply(t);
8753
8753
  })).next((function() {
8754
- return n.Wn.Vn(t, u);
8754
+ return n.Wn.Vn(t, a);
8755
8755
  })).next((function() {
8756
- return u;
8756
+ return a;
8757
8757
  }));
8758
8758
  })).then((function(t) {
8759
8759
  return n.qn = i, t;
@@ -8860,7 +8860,7 @@ function vo(t, e) {
8860
8860
  // PORTING NOTE: `keepPersistedTargetData` is multi-tab only.
8861
8861
  function go(t, e, i) {
8862
8862
  return n(this, void 0, void 0, (function() {
8863
- var n, o, s, u;
8863
+ var n, o, s, a;
8864
8864
  return r(this, (function(r) {
8865
8865
  switch (r.label) {
8866
8866
  case 0:
@@ -8878,13 +8878,13 @@ function go(t, e, i) {
8878
8878
  return [ 3 /*break*/ , 5 ];
8879
8879
 
8880
8880
  case 4:
8881
- if (!Yr(u = r.sent())) throw u;
8881
+ if (!Yr(a = r.sent())) throw a;
8882
8882
  // All `releaseTarget` does is record the final metadata state for the
8883
8883
  // target, but we've been recording this periodically during target
8884
8884
  // activity. If we lose this write this could cause a very slight
8885
8885
  // difference in the order of target deletion during GC, but we
8886
8886
  // don't define exact LRU semantics so this is acceptable.
8887
- return U("LocalStore", "Failed to update sequence numbers for target " + e + ": " + u),
8887
+ return U("LocalStore", "Failed to update sequence numbers for target " + e + ": " + a),
8888
8888
  [ 3 /*break*/ , 5 ];
8889
8889
 
8890
8890
  case 5:
@@ -8943,10 +8943,10 @@ function Io(t) {
8943
8943
  var e = W(t);
8944
8944
  return e.persistence.runTransaction("Get new document changes", "readonly", (function(t) {
8945
8945
  return function(t, e, n) {
8946
- var r = W(t), i = _n(), o = ai(n), s = Yi(e), u = IDBKeyRange.lowerBound(o, !0);
8946
+ var r = W(t), i = _n(), o = ui(n), s = Yi(e), a = IDBKeyRange.lowerBound(o, !0);
8947
8947
  return s.jt({
8948
8948
  index: Rr.readTimeIndex,
8949
- range: u
8949
+ range: a
8950
8950
  }, (function(t, e) {
8951
8951
  // Unlike `getEntry()` and others, `getNewDocumentChanges()` parses
8952
8952
  // the documents directly since we want to keep sentinel deletes.
@@ -9009,13 +9009,13 @@ function To(t) {
9009
9009
  * queue.
9010
9010
  */ function Eo(t, e, i, o) {
9011
9011
  return n(this, void 0, void 0, (function() {
9012
- var n, s, u, a, c, h, f, l, d, p;
9012
+ var n, s, a, u, c, h, f, l, d, p;
9013
9013
  return r(this, (function(r) {
9014
9014
  switch (r.label) {
9015
9015
  case 0:
9016
- for (n = W(t), s = Cn(), u = _n(), a = 0, c = i; a < c.length; a++) h = c[a], f = e.Hn(h.metadata.name),
9016
+ for (n = W(t), s = Cn(), a = _n(), u = 0, c = i; u < c.length; u++) h = c[u], f = e.Hn(h.metadata.name),
9017
9017
  h.document && (s = s.add(f)), (l = e.Jn(h)).setReadTime(e.Yn(h.metadata.readTime)),
9018
- u = u.insert(f, l);
9018
+ a = a.insert(f, l);
9019
9019
  return d = n.Qn.newChangeBuffer({
9020
9020
  trackRemovals: !0
9021
9021
  }), [ 4 /*yield*/ , mo(n, function(t) {
@@ -9028,7 +9028,7 @@ function To(t) {
9028
9028
  // Allocates a target to hold all document keys from the bundle, such that
9029
9029
  // they will not get garbage collected right away.
9030
9030
  return p = r.sent(), [ 2 /*return*/ , n.persistence.runTransaction("Apply bundle documents", "readwrite", (function(t) {
9031
- return yo(t, d, u).next((function(e) {
9031
+ return yo(t, d, a).next((function(e) {
9032
9032
  return d.apply(t), e;
9033
9033
  })).next((function(e) {
9034
9034
  return n.He.removeMatchingKeysForTargetId(t, p.targetId).next((function() {
@@ -9210,9 +9210,9 @@ function To(t) {
9210
9210
  var o = new ni(i, e, n, r);
9211
9211
  this.An.push(o);
9212
9212
  // Track references by document key and index collection parents.
9213
- for (var s = 0, u = r; s < u.length; s++) {
9214
- var a = u[s];
9215
- this.ws = this.ws.add(new ko(a.key, i)), this.Jt.addToCollectionParentIndex(t, a.key.path.popLast());
9213
+ for (var s = 0, a = r; s < a.length; s++) {
9214
+ var u = a[s];
9215
+ this.ws = this.ws.add(new ko(u.key, i)), this.Jt.addToCollectionParentIndex(t, u.key.path.popLast());
9216
9216
  }
9217
9217
  return Gr.resolve(o);
9218
9218
  }, t.prototype.lookupMutationBatch = function(t, e) {
@@ -9372,9 +9372,9 @@ function To(t) {
9372
9372
  // Documents are ordered by key, so we can use a prefix scan to narrow down
9373
9373
  // the documents we need to match the query against.
9374
9374
  ; o.hasNext(); ) {
9375
- var s = o.getNext(), u = s.key, a = s.value.document;
9376
- if (!e.path.isPrefixOf(u.path)) break;
9377
- a.readTime.compareTo(n) <= 0 || Re(e, a) && (r = r.insert(a.key, a.mutableCopy()));
9375
+ var s = o.getNext(), a = s.key, u = s.value.document;
9376
+ if (!e.path.isPrefixOf(a.path)) break;
9377
+ u.readTime.compareTo(n) <= 0 || Re(e, u) && (r = r.insert(u.key, u.mutableCopy()));
9378
9378
  }
9379
9379
  return Gr.resolve(r);
9380
9380
  }, t.prototype.Es = function(t, e) {
@@ -9450,8 +9450,8 @@ function To(t) {
9450
9450
  Gr.resolve();
9451
9451
  }, t.prototype.removeTargets = function(t, e, n) {
9452
9452
  var r = this, i = 0, o = [];
9453
- return this.Is.forEach((function(s, u) {
9454
- u.sequenceNumber <= e && null === n.get(u.targetId) && (r.Is.delete(s), o.push(r.removeMatchingKeysForTargetId(t, u.targetId)),
9453
+ return this.Is.forEach((function(s, a) {
9454
+ a.sequenceNumber <= e && null === n.get(a.targetId) && (r.Is.delete(s), o.push(r.removeMatchingKeysForTargetId(t, a.targetId)),
9455
9455
  i++);
9456
9456
  })), Gr.waitFor(o).next((function() {
9457
9457
  return i;
@@ -9588,7 +9588,7 @@ function To(t) {
9588
9588
  return Gr.forEach(this.xs, (function(r) {
9589
9589
  var i = Pt.fromPath(r);
9590
9590
  return e.$s(t, i).next((function(t) {
9591
- t || n.removeEntry(i);
9591
+ t || n.removeEntry(i, dt.min());
9592
9592
  }));
9593
9593
  })).next((function() {
9594
9594
  return e.Ns = null, n.apply(t);
@@ -9824,7 +9824,7 @@ var Vo = /** @class */ function() {
9824
9824
  return !(!t || !t.localStorage);
9825
9825
  }, t.prototype.start = function() {
9826
9826
  return n(this, void 0, void 0, (function() {
9827
- var t, e, n, i, o, s, u, a, c, h, f, l = this;
9827
+ var t, e, n, i, o, s, a, u, c, h, f, l = this;
9828
9828
  return r(this, (function(r) {
9829
9829
  switch (r.label) {
9830
9830
  case 0:
@@ -9832,7 +9832,7 @@ var Vo = /** @class */ function() {
9832
9832
 
9833
9833
  case 1:
9834
9834
  for (t = r.sent(), e = 0, n = t; e < n.length; e++) (i = n[e]) !== this.Bs && (o = this.getItem(Oo(this.persistenceKey, i))) && (s = Uo.Os(i, o)) && (this.Ks = this.Ks.insert(s.clientId, s));
9835
- for (this.Xs(), (u = this.storage.getItem(this.Js)) && (a = this.Zs(u)) && this.ti(a),
9835
+ for (this.Xs(), (a = this.storage.getItem(this.Js)) && (u = this.Zs(a)) && this.ti(u),
9836
9836
  c = 0, h = this.js; c < h.length; c++) f = h[c], this.qs(f);
9837
9837
  return this.js = [],
9838
9838
  // Register a window unload hook to remove the client metadata entry from
@@ -9909,7 +9909,7 @@ var Vo = /** @class */ function() {
9909
9909
  if (U("SharedClientState", "EVENT", i.key, i.newValue), i.key === this.Qs) return void B("Received WebStorage notification for local change. Another client might have garbage-collected our state");
9910
9910
  this.Me.enqueueRetryable((function() {
9911
9911
  return n(e, void 0, void 0, (function() {
9912
- var t, e, n, o, s, u;
9912
+ var t, e, n, o, s, a;
9913
9913
  return r(this, (function(r) {
9914
9914
  if (this.started) {
9915
9915
  if (null !== i.key) if (this.Gs.test(i.key)) {
@@ -9921,7 +9921,7 @@ var Vo = /** @class */ function() {
9921
9921
  if (null !== i.newValue && (o = this.di(i.key, i.newValue))) return [ 2 /*return*/ , this.wi(o) ];
9922
9922
  } else if (i.key === this.Js) {
9923
9923
  if (null !== i.newValue && (s = this.Zs(i.newValue))) return [ 2 /*return*/ , this.ti(s) ];
9924
- } else if (i.key === this.Ws) u = function(t) {
9924
+ } else if (i.key === this.Ws) a = function(t) {
9925
9925
  var e = st.I;
9926
9926
  if (null != t) try {
9927
9927
  var n = JSON.parse(t);
@@ -9930,7 +9930,7 @@ var Vo = /** @class */ function() {
9930
9930
  B("SharedClientState", "Failed to read sequence number from WebStorage", t);
9931
9931
  }
9932
9932
  return e;
9933
- }(i.newValue), u !== st.I && this.sequenceNumberHandler(u); else if (i.key === this.Ys) return [ 2 /*return*/ , this.syncEngine._i() ];
9933
+ }(i.newValue), a !== st.I && this.sequenceNumberHandler(a); else if (i.key === this.Ys) return [ 2 /*return*/ , this.syncEngine._i() ];
9934
9934
  } else this.js.push(i);
9935
9935
  return [ 2 /*return*/ ];
9936
9936
  }));
@@ -10011,12 +10011,12 @@ var Vo = /** @class */ function() {
10011
10011
  }, t.prototype.wi = function(t) {
10012
10012
  return this.syncEngine.gi(t.targetId, t.state, t.error);
10013
10013
  }, t.prototype.ui = function(t, e) {
10014
- var n = this, r = e ? this.Ks.insert(t, e) : this.Ks.remove(t), i = this.ei(this.Ks), o = this.ei(r), s = [], u = [];
10014
+ var n = this, r = e ? this.Ks.insert(t, e) : this.Ks.remove(t), i = this.ei(this.Ks), o = this.ei(r), s = [], a = [];
10015
10015
  return o.forEach((function(t) {
10016
10016
  i.has(t) || s.push(t);
10017
10017
  })), i.forEach((function(t) {
10018
- o.has(t) || u.push(t);
10019
- })), this.syncEngine.yi(s, u).then((function() {
10018
+ o.has(t) || a.push(t);
10019
+ })), this.syncEngine.yi(s, a).then((function() {
10020
10020
  n.Ks = r;
10021
10021
  }));
10022
10022
  }, t.prototype.ti = function(t) {
@@ -10159,11 +10159,11 @@ var Vo = /** @class */ function() {
10159
10159
  n > 0) {
10160
10160
  var r = s.getResponseJson().error;
10161
10161
  if (r && r.status && r.message) {
10162
- var u = function(t) {
10162
+ var a = function(t) {
10163
10163
  var e = t.toLowerCase().replace(/_/g, "-");
10164
10164
  return Object.values(H).indexOf(e) >= 0 ? e : H.UNKNOWN;
10165
10165
  }(r.status);
10166
- o(new Y(u, r.message));
10166
+ o(new Y(a, r.message));
10167
10167
  } else o(new Y(H.UNKNOWN, "Server responded with status " + s.getStatus()));
10168
10168
  } else
10169
10169
  // If we received an HTTP_ERROR but there's no status code,
@@ -10178,8 +10178,8 @@ var Vo = /** @class */ function() {
10178
10178
  U("Connection", 'RPC "' + t + '" completed.');
10179
10179
  }
10180
10180
  }));
10181
- var u = JSON.stringify(r);
10182
- s.send(e, "POST", u, n, 15);
10181
+ var a = JSON.stringify(r);
10182
+ s.send(e, "POST", a, n, 15);
10183
10183
  }));
10184
10184
  }, n.prototype.Qi = function(t, e, n) {
10185
10185
  var r = [ this.Fi, "/", "google.firestore.v1.Firestore", "/", t, "/channel" ], i = D(), o = N(), s = {
@@ -10223,15 +10223,15 @@ var Vo = /** @class */ function() {
10223
10223
  // known to (sometimes) not include an Origin. See
10224
10224
  // https://github.com/firebase/firebase-js-sdk/issues/1491.
10225
10225
  y() || v() || m() || g() || w() || b() || (s.httpHeadersOverwriteParam = "$httpHeaders");
10226
- var u = r.join("");
10227
- U("Connection", "Creating WebChannel: " + u, s);
10228
- var a = i.createWebChannel(u, s), c = !1, h = !1, f = new Ho({
10226
+ var a = r.join("");
10227
+ U("Connection", "Creating WebChannel: " + a, s);
10228
+ var u = i.createWebChannel(a, s), c = !1, h = !1, f = new Ho({
10229
10229
  Vi: function(t) {
10230
10230
  h ? U("Connection", "Not sending because WebChannel is closed:", t) : (c || (U("Connection", "Opening WebChannel transport."),
10231
- a.open(), c = !0), U("Connection", "WebChannel sending:", t), a.send(t));
10231
+ u.open(), c = !0), U("Connection", "WebChannel sending:", t), u.send(t));
10232
10232
  },
10233
10233
  Si: function() {
10234
- return a.close();
10234
+ return u.close();
10235
10235
  }
10236
10236
  }), l = function(t, e, n) {
10237
10237
  // TODO(dimond): closure typing seems broken because WebChannel does
@@ -10255,13 +10255,13 @@ var Vo = /** @class */ function() {
10255
10255
  // exception and rethrow using a setTimeout so they become visible again.
10256
10256
  // Note that eventually this function could go away if we are confident
10257
10257
  // enough the code is exception free.
10258
- return l(a, x.EventType.OPEN, (function() {
10258
+ return l(u, x.EventType.OPEN, (function() {
10259
10259
  h || U("Connection", "WebChannel transport opened.");
10260
- })), l(a, x.EventType.CLOSE, (function() {
10260
+ })), l(u, x.EventType.CLOSE, (function() {
10261
10261
  h || (h = !0, U("Connection", "WebChannel transport closed"), f.Oi());
10262
- })), l(a, x.EventType.ERROR, (function(t) {
10262
+ })), l(u, x.EventType.ERROR, (function(t) {
10263
10263
  h || (h = !0, j("Connection", "WebChannel transport errored:", t), f.Oi(new Y(H.UNAVAILABLE, "The operation could not be completed")));
10264
- })), l(a, x.EventType.MESSAGE, (function(t) {
10264
+ })), l(u, x.EventType.MESSAGE, (function(t) {
10265
10265
  var e;
10266
10266
  if (!h) {
10267
10267
  var n = t.data[0];
@@ -10287,10 +10287,10 @@ var Vo = /** @class */ function() {
10287
10287
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10288
10288
  var e = ln[t];
10289
10289
  if (void 0 !== e) return gn(e);
10290
- }(o), u = i.message;
10291
- void 0 === s && (s = H.INTERNAL, u = "Unknown error status: " + o + " with message " + i.message),
10290
+ }(o), a = i.message;
10291
+ void 0 === s && (s = H.INTERNAL, a = "Unknown error status: " + o + " with message " + i.message),
10292
10292
  // Mark closed so no further events are propagated
10293
- h = !0, f.Oi(new Y(s, u)), a.close();
10293
+ h = !0, f.Oi(new Y(s, a)), u.close();
10294
10294
  } else U("Connection", "WebChannel received:", n), f.Mi(n);
10295
10295
  }
10296
10296
  })), l(o, R.STAT_EVENT, (function(t) {
@@ -10503,9 +10503,9 @@ function Jo() {
10503
10503
  return (Math.random() - .5) * this.Hi;
10504
10504
  }, t;
10505
10505
  }(), ts = /** @class */ function() {
10506
- function t(t, e, n, r, i, o, s, u) {
10506
+ function t(t, e, n, r, i, o, s, a) {
10507
10507
  this.Me = t, this.nr = n, this.sr = r, this.ir = i, this.authCredentialsProvider = o,
10508
- this.appCheckCredentialsProvider = s, this.listener = u, this.state = 0 /* Initial */ ,
10508
+ this.appCheckCredentialsProvider = s, this.listener = a, this.state = 0 /* Initial */ ,
10509
10509
  /**
10510
10510
  * A close count that's incremented every time the stream is closed; used by
10511
10511
  * getCloseGuardedDispatcher() to invalidate callbacks that happen after
@@ -10735,9 +10735,9 @@ function Jo() {
10735
10735
  }, t;
10736
10736
  }(), es = /** @class */ function(e) {
10737
10737
  function n(t, n, r, i, o, s) {
10738
- var u = this;
10739
- return (u = e.call(this, t, "listen_stream_connection_backoff" /* ListenStreamConnectionBackoff */ , "listen_stream_idle" /* ListenStreamIdle */ , "health_check_timeout" /* HealthCheckTimeout */ , n, r, i, s) || this).k = o,
10740
- u;
10738
+ var a = this;
10739
+ return (a = e.call(this, t, "listen_stream_connection_backoff" /* ListenStreamConnectionBackoff */ , "listen_stream_idle" /* ListenStreamIdle */ , "health_check_timeout" /* HealthCheckTimeout */ , n, r, i, s) || this).k = o,
10740
+ a;
10741
10741
  }
10742
10742
  return t(n, e), n.prototype.Rr = function(t, e) {
10743
10743
  return this.ir.Qi("Listen", t, e);
@@ -10755,20 +10755,20 @@ function Jo() {
10755
10755
  }(e.targetChange.targetChangeType || "NO_CHANGE"), i = e.targetChange.targetIds || [], o = function(t, e) {
10756
10756
  return t.C ? (z(void 0 === e || "string" == typeof e), Et.fromBase64String(e || "")) : (z(void 0 === e || e instanceof Uint8Array),
10757
10757
  Et.fromUint8Array(e || new Uint8Array));
10758
- }(t, e.targetChange.resumeToken), s = e.targetChange.cause, u = s && function(t) {
10758
+ }(t, e.targetChange.resumeToken), s = e.targetChange.cause, a = s && function(t) {
10759
10759
  var e = void 0 === t.code ? H.UNKNOWN : gn(t.code);
10760
10760
  return new Y(e, t.message || "");
10761
10761
  }(s);
10762
- n = new Fn(r, i, o, u || null);
10762
+ n = new Fn(r, i, o, a || null);
10763
10763
  } else if ("documentChange" in e) {
10764
10764
  e.documentChange;
10765
- var a = e.documentChange;
10766
- a.document, a.document.name, a.document.updateTime;
10767
- var c = $n(t, a.document.name), h = Hn(a.document.updateTime), f = new Yt({
10765
+ var u = e.documentChange;
10766
+ u.document, u.document.name, u.document.updateTime;
10767
+ var c = $n(t, u.document.name), h = Hn(u.document.updateTime), f = new Yt({
10768
10768
  mapValue: {
10769
- fields: a.document.fields
10769
+ fields: u.document.fields
10770
10770
  }
10771
- }), l = Xt.newFoundDocument(c, h, f), d = a.targetIds || [], p = a.removedTargetIds || [];
10771
+ }), l = Xt.newFoundDocument(c, h, f), d = u.targetIds || [], p = u.removedTargetIds || [];
10772
10772
  n = new On(d, p, l.key, l);
10773
10773
  } else if ("documentDelete" in e) {
10774
10774
  e.documentDelete;
@@ -10812,9 +10812,9 @@ function Jo() {
10812
10812
  e.database = er(this.k), e.addTarget = function(t, e) {
10813
10813
  var n, r = e.target;
10814
10814
  return (n = ne(r) ? {
10815
- documents: ur(t, r)
10815
+ documents: ar(t, r)
10816
10816
  } : {
10817
- query: ar(t, r)
10817
+ query: ur(t, r)
10818
10818
  }).targetId = e.targetId, e.resumeToken.approximateByteSize() > 0 ? n.resumeToken = Qn(t, e.resumeToken) : e.snapshotVersion.compareTo(dt.min()) > 0 && (
10819
10819
  // TODO(wuandy): Consider removing above check because it is most likely true.
10820
10820
  // Right now, many tests depend on this behaviour though (leaving min() out
@@ -10853,9 +10853,9 @@ function Jo() {
10853
10853
  }, n;
10854
10854
  }(ts), ns = /** @class */ function(e) {
10855
10855
  function n(t, n, r, i, o, s) {
10856
- var u = this;
10857
- return (u = e.call(this, t, "write_stream_connection_backoff" /* WriteStreamConnectionBackoff */ , "write_stream_idle" /* WriteStreamIdle */ , "health_check_timeout" /* HealthCheckTimeout */ , n, r, i, s) || this).k = o,
10858
- u.Vr = !1, u;
10856
+ var a = this;
10857
+ return (a = e.call(this, t, "write_stream_connection_backoff" /* WriteStreamConnectionBackoff */ , "write_stream_idle" /* WriteStreamIdle */ , "health_check_timeout" /* HealthCheckTimeout */ , n, r, i, s) || this).k = o,
10858
+ a.Vr = !1, a;
10859
10859
  }
10860
10860
  return t(n, e), Object.defineProperty(n.prototype, "Sr", {
10861
10861
  /**
@@ -11031,7 +11031,7 @@ function Jo() {
11031
11031
  t,
11032
11032
  /** The client-side proxy for interacting with the backend. */
11033
11033
  e, i, o, s) {
11034
- var u = this;
11034
+ var a = this;
11035
11035
  this.localStore = t, this.datastore = e, this.asyncQueue = i, this.remoteSyncer = {},
11036
11036
  /**
11037
11037
  * A list of up to MAX_PENDING_WRITES writes that we have fetched from the
@@ -11075,7 +11075,7 @@ e, i, o, s) {
11075
11075
  */
11076
11076
  this.zr = [], this.Hr = s, this.Hr.Ei((function(t) {
11077
11077
  i.enqueueAndForget((function() {
11078
- return n(u, void 0, void 0, (function() {
11078
+ return n(a, void 0, void 0, (function() {
11079
11079
  return r(this, (function(t) {
11080
11080
  switch (t.label) {
11081
11081
  case 0:
@@ -11086,7 +11086,7 @@ e, i, o, s) {
11086
11086
  return r(this, (function(n) {
11087
11087
  switch (n.label) {
11088
11088
  case 0:
11089
- return (e = W(t)).Gr.add(4 /* ConnectivityChange */), [ 4 /*yield*/ , us(e) ];
11089
+ return (e = W(t)).Gr.add(4 /* ConnectivityChange */), [ 4 /*yield*/ , as(e) ];
11090
11090
 
11091
11091
  case 1:
11092
11092
  return n.sent(), e.Jr.set("Unknown" /* Unknown */), e.Gr.delete(4 /* ConnectivityChange */),
@@ -11186,7 +11186,7 @@ e, i, o, s) {
11186
11186
  /**
11187
11187
  * Temporarily disables the network. The network can be re-enabled using
11188
11188
  * enableNetwork().
11189
- */ function us(t) {
11189
+ */ function as(t) {
11190
11190
  return n(this, void 0, void 0, (function() {
11191
11191
  var e, n;
11192
11192
  return r(this, (function(r) {
@@ -11213,7 +11213,7 @@ e, i, o, s) {
11213
11213
  /**
11214
11214
  * Starts new listen for the given target. Uses resume token if provided. It
11215
11215
  * is a no-op if the target of given `TargetData` is already being listened to.
11216
- */ function as(t, e) {
11216
+ */ function us(t, e) {
11217
11217
  var n = W(t);
11218
11218
  n.Wr.has(e.targetId) || (
11219
11219
  // Mark this as something the client is currently listening for.
@@ -11303,17 +11303,17 @@ function ms(t, e) {
11303
11303
 
11304
11304
  function gs(t, e, i) {
11305
11305
  return n(this, void 0, void 0, (function() {
11306
- var o, s, u;
11307
- return r(this, (function(a) {
11308
- switch (a.label) {
11306
+ var o, s, a;
11307
+ return r(this, (function(u) {
11308
+ switch (u.label) {
11309
11309
  case 0:
11310
11310
  if (t.Jr.set("Online" /* Online */), !(e instanceof Fn && 2 /* Removed */ === e.state && e.cause))
11311
11311
  // Mark the client as online since we got a message from the server
11312
11312
  return [ 3 /*break*/ , 6 ];
11313
- a.label = 1;
11313
+ u.label = 1;
11314
11314
 
11315
11315
  case 1:
11316
- return a.trys.push([ 1, 3, , 5 ]), [ 4 /*yield*/ ,
11316
+ return u.trys.push([ 1, 3, , 5 ]), [ 4 /*yield*/ ,
11317
11317
  /** Handles an error on a target */
11318
11318
  function(t, e) {
11319
11319
  return n(this, void 0, void 0, (function() {
@@ -11343,27 +11343,27 @@ function gs(t, e, i) {
11343
11343
  }(t, e) ];
11344
11344
 
11345
11345
  case 2:
11346
- return a.sent(), [ 3 /*break*/ , 5 ];
11346
+ return u.sent(), [ 3 /*break*/ , 5 ];
11347
11347
 
11348
11348
  case 3:
11349
- return o = a.sent(), U("RemoteStore", "Failed to remove targets %s: %s ", e.targetIds.join(","), o),
11349
+ return o = u.sent(), U("RemoteStore", "Failed to remove targets %s: %s ", e.targetIds.join(","), o),
11350
11350
  [ 4 /*yield*/ , ws(t, o) ];
11351
11351
 
11352
11352
  case 4:
11353
- return a.sent(), [ 3 /*break*/ , 5 ];
11353
+ return u.sent(), [ 3 /*break*/ , 5 ];
11354
11354
 
11355
11355
  case 5:
11356
11356
  return [ 3 /*break*/ , 13 ];
11357
11357
 
11358
11358
  case 6:
11359
11359
  if (e instanceof On ? t.Yr.ot(e) : e instanceof Mn ? t.Yr.dt(e) : t.Yr.ut(e), i.isEqual(dt.min())) return [ 3 /*break*/ , 13 ];
11360
- a.label = 7;
11360
+ u.label = 7;
11361
11361
 
11362
11362
  case 7:
11363
- return a.trys.push([ 7, 11, , 13 ]), [ 4 /*yield*/ , lo(t.localStore) ];
11363
+ return u.trys.push([ 7, 11, , 13 ]), [ 4 /*yield*/ , lo(t.localStore) ];
11364
11364
 
11365
11365
  case 8:
11366
- return s = a.sent(), i.compareTo(s) >= 0 ? [ 4 /*yield*/ ,
11366
+ return s = u.sent(), i.compareTo(s) >= 0 ? [ 4 /*yield*/ ,
11367
11367
  /**
11368
11368
  * Takes a batch of changes from the Datastore, repackages them as a
11369
11369
  * RemoteEvent, and passes that on to the listener, which is typically the
@@ -11406,16 +11406,16 @@ function gs(t, e, i) {
11406
11406
  case 9:
11407
11407
  // We have received a target change with a global snapshot if the snapshot
11408
11408
  // version is not equal to SnapshotVersion.min().
11409
- a.sent(), a.label = 10;
11409
+ u.sent(), u.label = 10;
11410
11410
 
11411
11411
  case 10:
11412
11412
  return [ 3 /*break*/ , 13 ];
11413
11413
 
11414
11414
  case 11:
11415
- return U("RemoteStore", "Failed to raise snapshot:", u = a.sent()), [ 4 /*yield*/ , ws(t, u) ];
11415
+ return U("RemoteStore", "Failed to raise snapshot:", a = u.sent()), [ 4 /*yield*/ , ws(t, a) ];
11416
11416
 
11417
11417
  case 12:
11418
- return a.sent(), [ 3 /*break*/ , 13 ];
11418
+ return u.sent(), [ 3 /*break*/ , 13 ];
11419
11419
 
11420
11420
  case 13:
11421
11421
  return [ 2 /*return*/ ];
@@ -11440,7 +11440,7 @@ function gs(t, e, i) {
11440
11440
  case 0:
11441
11441
  if (!Yr(e)) throw e;
11442
11442
  // Disable network and raise offline snapshots
11443
- return t.Gr.add(1 /* IndexedDbFailed */), [ 4 /*yield*/ , us(t) ];
11443
+ return t.Gr.add(1 /* IndexedDbFailed */), [ 4 /*yield*/ , as(t) ];
11444
11444
 
11445
11445
  case 1:
11446
11446
  // Disable network and raise offline snapshots
@@ -11649,7 +11649,7 @@ function Ds(t, e) {
11649
11649
  // Tear down and re-create our network streams. This will ensure we get a
11650
11650
  // fresh auth token for the new user and re-fill the write pipeline with
11651
11651
  // new mutations from the LocalStore (since mutations are per-user).
11652
- n.Gr.add(3 /* CredentialChange */), [ 4 /*yield*/ , us(n) ];
11652
+ n.Gr.add(3 /* CredentialChange */), [ 4 /*yield*/ , as(n) ];
11653
11653
 
11654
11654
  case 1:
11655
11655
  return r.sent(), i &&
@@ -11683,7 +11683,7 @@ function Ds(t, e) {
11683
11683
  return r.sent(), [ 3 /*break*/ , 5 ];
11684
11684
 
11685
11685
  case 2:
11686
- return e ? [ 3 /*break*/ , 4 ] : (n.Gr.add(2 /* IsSecondary */), [ 4 /*yield*/ , us(n) ]);
11686
+ return e ? [ 3 /*break*/ , 4 ] : (n.Gr.add(2 /* IsSecondary */), [ 4 /*yield*/ , as(n) ]);
11687
11687
 
11688
11688
  case 3:
11689
11689
  r.sent(), n.Jr.set("Unknown" /* Unknown */), r.label = 4;
@@ -12016,9 +12016,9 @@ var Rs = /** @class */ function() {
12016
12016
  })), t;
12017
12017
  }, t;
12018
12018
  }(), Ms = /** @class */ function() {
12019
- function t(t, e, n, r, i, o, s, u) {
12019
+ function t(t, e, n, r, i, o, s, a) {
12020
12020
  this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = r, this.mutatedKeys = i,
12021
- this.fromCache = o, this.syncStateChanged = s, this.excludesMetadataChanges = u
12021
+ this.fromCache = o, this.syncStateChanged = s, this.excludesMetadataChanges = a
12022
12022
  /** Returns a view snapshot as if all documents in the snapshot were added. */;
12023
12023
  }
12024
12024
  return t.fromInitialDocuments = function(e, n, r, i) {
@@ -12073,7 +12073,7 @@ var Rs = /** @class */ function() {
12073
12073
  * duplicate events for the same doc.
12074
12074
  */ function qs(t, e) {
12075
12075
  return n(this, void 0, void 0, (function() {
12076
- var n, i, o, s, u, a, c;
12076
+ var n, i, o, s, a, u, c;
12077
12077
  return r(this, (function(r) {
12078
12078
  switch (r.label) {
12079
12079
  case 0:
@@ -12082,13 +12082,13 @@ var Rs = /** @class */ function() {
12082
12082
  r.label = 1;
12083
12083
 
12084
12084
  case 1:
12085
- return r.trys.push([ 1, 3, , 4 ]), u = s, [ 4 /*yield*/ , n.onListen(i) ];
12085
+ return r.trys.push([ 1, 3, , 4 ]), a = s, [ 4 /*yield*/ , n.onListen(i) ];
12086
12086
 
12087
12087
  case 2:
12088
- return u.so = r.sent(), [ 3 /*break*/ , 4 ];
12088
+ return a.so = r.sent(), [ 3 /*break*/ , 4 ];
12089
12089
 
12090
12090
  case 3:
12091
- return a = r.sent(), c = Ls(a, "Initialization of query '" + xe(e.query) + "' failed"),
12091
+ return u = r.sent(), c = Ls(u, "Initialization of query '" + xe(e.query) + "' failed"),
12092
12092
  [ 2 /*return*/ , void e.onError(c) ];
12093
12093
 
12094
12094
  case 4:
@@ -12102,9 +12102,9 @@ var Rs = /** @class */ function() {
12102
12102
 
12103
12103
  function Us(t, e) {
12104
12104
  return n(this, void 0, void 0, (function() {
12105
- var n, i, o, s, u;
12105
+ var n, i, o, s, a;
12106
12106
  return r(this, (function(r) {
12107
- return n = W(t), i = e.query, o = !1, (s = n.queries.get(i)) && (u = s.listeners.indexOf(e)) >= 0 && (s.listeners.splice(u, 1),
12107
+ return n = W(t), i = e.query, o = !1, (s = n.queries.get(i)) && (a = s.listeners.indexOf(e)) >= 0 && (s.listeners.splice(a, 1),
12108
12108
  o = 0 === s.listeners.length), o ? [ 2 /*return*/ , (n.queries.delete(i), n.onUnlisten(i)) ] : [ 2 /*return*/ ];
12109
12109
  }));
12110
12110
  }));
@@ -12112,12 +12112,12 @@ function Us(t, e) {
12112
12112
 
12113
12113
  function Bs(t, e) {
12114
12114
  for (var n = W(t), r = !1, i = 0, o = e; i < o.length; i++) {
12115
- var s = o[i], u = s.query, a = n.queries.get(u);
12116
- if (a) {
12117
- for (var c = 0, h = a.listeners; c < h.length; c++) {
12115
+ var s = o[i], a = s.query, u = n.queries.get(a);
12116
+ if (u) {
12117
+ for (var c = 0, h = u.listeners; c < h.length; c++) {
12118
12118
  h[c].oo(s) && (r = !0);
12119
12119
  }
12120
- a.so = s;
12120
+ u.so = s;
12121
12121
  }
12122
12122
  }
12123
12123
  r && Ks(n);
@@ -12256,8 +12256,8 @@ function Ks(t) {
12256
12256
  }, t.prototype.po = function(t) {
12257
12257
  for (var e = new Map, n = new Qs(this.k), r = 0, i = t; r < i.length; r++) {
12258
12258
  var o = i[r];
12259
- if (o.metadata.queries) for (var s = n.Hn(o.metadata.name), u = 0, a = o.metadata.queries; u < a.length; u++) {
12260
- var c = a[u], h = (e.get(c) || Cn()).add(s);
12259
+ if (o.metadata.queries) for (var s = n.Hn(o.metadata.name), a = 0, u = o.metadata.queries; a < u.length; a++) {
12260
+ var c = u[a], h = (e.get(c) || Cn()).add(s);
12261
12261
  e.set(c, h);
12262
12262
  }
12263
12263
  }
@@ -12390,7 +12390,7 @@ function Hs(t) {
12390
12390
  * @returns a new set of docs, changes, and refill flag.
12391
12391
  */
12392
12392
  t.prototype.Po = function(t, e) {
12393
- var n = this, r = e ? e.vo : new Os, i = e ? e.Ro : this.Ro, o = e ? e.mutatedKeys : this.mutatedKeys, s = i, u = !1, a = Ie(this.query) && i.size === this.query.limit ? i.last() : null, c = Te(this.query) && i.size === this.query.limit ? i.first() : null;
12393
+ var n = this, r = e ? e.vo : new Os, i = e ? e.Ro : this.Ro, o = e ? e.mutatedKeys : this.mutatedKeys, s = i, a = !1, u = Ie(this.query) && i.size === this.query.limit ? i.last() : null, c = Te(this.query) && i.size === this.query.limit ? i.first() : null;
12394
12394
  // Drop documents out to meet limit/limitToLast requirement.
12395
12395
  if (t.inorderTraversal((function(t, e) {
12396
12396
  var h = i.get(t), f = Re(n.query, e) ? e : null, l = !!h && n.mutatedKeys.has(h.key), d = !!f && (f.hasLocalMutations ||
@@ -12404,21 +12404,21 @@ function Hs(t) {
12404
12404
  }), p = !0) : n.Vo(h, f) || (r.track({
12405
12405
  type: 2 /* Modified */ ,
12406
12406
  doc: f
12407
- }), p = !0, (a && n.Ao(f, a) > 0 || c && n.Ao(f, c) < 0) && (
12407
+ }), p = !0, (u && n.Ao(f, u) > 0 || c && n.Ao(f, c) < 0) && (
12408
12408
  // This doc moved from inside the limit to outside the limit.
12409
12409
  // That means there may be some other doc in the local cache
12410
12410
  // that should be included instead.
12411
- u = !0)) : !h && f ? (r.track({
12411
+ a = !0)) : !h && f ? (r.track({
12412
12412
  type: 0 /* Added */ ,
12413
12413
  doc: f
12414
12414
  }), p = !0) : h && !f && (r.track({
12415
12415
  type: 1 /* Removed */ ,
12416
12416
  doc: h
12417
- }), p = !0, (a || c) && (
12417
+ }), p = !0, (u || c) && (
12418
12418
  // A doc was removed from a full limit query. We'll need to
12419
12419
  // requery from the local cache to see if we know about some other
12420
12420
  // doc that should be in the results.
12421
- u = !0)), p && (f ? (s = s.add(f), o = d ? o.add(t) : o.delete(t)) : (s = s.delete(t),
12421
+ a = !0)), p && (f ? (s = s.add(f), o = d ? o.add(t) : o.delete(t)) : (s = s.delete(t),
12422
12422
  o = o.delete(t)));
12423
12423
  })), Ie(this.query) || Te(this.query)) for (;s.size > this.query.limit; ) {
12424
12424
  var h = Ie(this.query) ? s.last() : s.first();
@@ -12430,7 +12430,7 @@ function Hs(t) {
12430
12430
  return {
12431
12431
  Ro: s,
12432
12432
  vo: r,
12433
- Bn: u,
12433
+ Bn: a,
12434
12434
  mutatedKeys: o
12435
12435
  };
12436
12436
  }, t.prototype.Vo = function(t, e) {
@@ -12483,9 +12483,9 @@ function Hs(t) {
12483
12483
  return n(t) - n(e);
12484
12484
  }(t.type, e.type) || r.Ao(t.doc, e.doc);
12485
12485
  })), this.So(n);
12486
- var s = e ? this.Do() : [], u = 0 === this.Io.size && this.current ? 1 /* Synced */ : 0 /* Local */ , a = u !== this.Eo;
12487
- return this.Eo = u, 0 !== o.length || a ? {
12488
- snapshot: new Ms(this.query, t.Ro, i, o, t.mutatedKeys, 0 /* Local */ === u, a,
12486
+ var s = e ? this.Do() : [], a = 0 === this.Io.size && this.current ? 1 /* Synced */ : 0 /* Local */ , u = a !== this.Eo;
12487
+ return this.Eo = a, 0 !== o.length || u ? {
12488
+ snapshot: new Ms(this.query, t.Ro, i, o, t.mutatedKeys, 0 /* Local */ === a, u,
12489
12489
  /* excludesMetadataChanges= */ !1),
12490
12490
  Co: s
12491
12491
  } : {
@@ -12612,7 +12612,7 @@ n) {
12612
12612
  * the target is CURRENT.
12613
12613
  */
12614
12614
  this.$o = !1;
12615
- }, tu = /** @class */ function() {
12615
+ }, ta = /** @class */ function() {
12616
12616
  function t(t, e, n,
12617
12617
  // PORTING NOTE: Manages state synchronization in multi-tab environments.
12618
12618
  r, i, o) {
@@ -12663,13 +12663,13 @@ n) {
12663
12663
  * server. All the subsequent view snapshots or errors are sent to the
12664
12664
  * subscribed handlers. Returns the initial snapshot.
12665
12665
  */
12666
- function eu(t, e) {
12666
+ function ea(t, e) {
12667
12667
  return n(this, void 0, void 0, (function() {
12668
- var n, i, o, s, u, a;
12668
+ var n, i, o, s, a, u;
12669
12669
  return r(this, (function(r) {
12670
12670
  switch (r.label) {
12671
12671
  case 0:
12672
- return n = Cu(t), (s = n.Mo.get(e)) ? (
12672
+ return n = Ca(t), (s = n.Mo.get(e)) ? (
12673
12673
  // PORTING NOTE: With Multi-Tab Web, it is possible that a query view
12674
12674
  // already exists when EventManager calls us for the first time. This
12675
12675
  // happens when the primary tab is already listening to this query on
@@ -12682,11 +12682,11 @@ function eu(t, e) {
12682
12682
  return [ 4 /*yield*/ , mo(n.localStore, ke(e)) ];
12683
12683
 
12684
12684
  case 2:
12685
- return u = r.sent(), a = n.sharedClientState.addLocalQueryTarget(u.targetId), i = u.targetId,
12686
- [ 4 /*yield*/ , nu(n, e, i, "current" === a) ];
12685
+ return a = r.sent(), u = n.sharedClientState.addLocalQueryTarget(a.targetId), i = a.targetId,
12686
+ [ 4 /*yield*/ , na(n, e, i, "current" === u) ];
12687
12687
 
12688
12688
  case 3:
12689
- o = r.sent(), n.isPrimaryClient && as(n.remoteStore, u), r.label = 4;
12689
+ o = r.sent(), n.isPrimaryClient && us(n.remoteStore, a), r.label = 4;
12690
12690
 
12691
12691
  case 4:
12692
12692
  return [ 2 /*return*/ , o ];
@@ -12698,9 +12698,9 @@ function eu(t, e) {
12698
12698
  /**
12699
12699
  * Registers a view for a previously unknown query and computes its initial
12700
12700
  * snapshot.
12701
- */ function nu(t, e, i, o) {
12701
+ */ function na(t, e, i, o) {
12702
12702
  return n(this, void 0, void 0, (function() {
12703
- var s, u, a, c, h, f;
12703
+ var s, a, u, c, h, f;
12704
12704
  return r(this, (function(l) {
12705
12705
  switch (l.label) {
12706
12706
  case 0:
@@ -12710,7 +12710,7 @@ function eu(t, e) {
12710
12710
  return t.Go = function(e, i, o) {
12711
12711
  return function(t, e, i, o) {
12712
12712
  return n(this, void 0, void 0, (function() {
12713
- var n, s, u;
12713
+ var n, s, a;
12714
12714
  return r(this, (function(r) {
12715
12715
  switch (r.label) {
12716
12716
  case 0:
@@ -12727,9 +12727,9 @@ function eu(t, e) {
12727
12727
  n = r.sent(), r.label = 2;
12728
12728
 
12729
12729
  case 2:
12730
- return s = o && o.targetChanges.get(e.targetId), u = e.view.applyChanges(n,
12731
- /* updateLimboDocuments= */ t.isPrimaryClient, s), [ 2 /*return*/ , (yu(t, e.targetId, u.Co),
12732
- u.snapshot) ];
12730
+ return s = o && o.targetChanges.get(e.targetId), a = e.view.applyChanges(n,
12731
+ /* updateLimboDocuments= */ t.isPrimaryClient, s), [ 2 /*return*/ , (ya(t, e.targetId, a.Co),
12732
+ a.snapshot) ];
12733
12733
  }
12734
12734
  }));
12735
12735
  }));
@@ -12738,9 +12738,9 @@ function eu(t, e) {
12738
12738
  /* usePreviousResults= */ !0) ];
12739
12739
 
12740
12740
  case 1:
12741
- return s = l.sent(), u = new Xs(e, s.zn), a = u.Po(s.documents), c = Pn.createSynthesizedTargetChangeForCurrentChange(i, o && "Offline" /* Offline */ !== t.onlineState),
12742
- h = u.applyChanges(a,
12743
- /* updateLimboDocuments= */ t.isPrimaryClient, c), yu(t, i, h.Co), f = new $s(e, i, u),
12741
+ return s = l.sent(), a = new Xs(e, s.zn), u = a.Po(s.documents), c = Pn.createSynthesizedTargetChangeForCurrentChange(i, o && "Offline" /* Offline */ !== t.onlineState),
12742
+ h = a.applyChanges(u,
12743
+ /* updateLimboDocuments= */ t.isPrimaryClient, c), ya(t, i, h.Co), f = new $s(e, i, a),
12744
12744
  [ 2 /*return*/ , (t.Mo.set(e, f), t.Fo.has(i) ? t.Fo.get(i).push(e) : t.Fo.set(i, [ e ]),
12745
12745
  h.snapshot) ];
12746
12746
  }
@@ -12748,7 +12748,7 @@ function eu(t, e) {
12748
12748
  }));
12749
12749
  }
12750
12750
 
12751
- /** Stops listening to the query. */ function ru(t, e) {
12751
+ /** Stops listening to the query. */ function ra(t, e) {
12752
12752
  return n(this, void 0, void 0, (function() {
12753
12753
  var n, i, o;
12754
12754
  return r(this, (function(r) {
@@ -12762,7 +12762,7 @@ function eu(t, e) {
12762
12762
  n.sharedClientState.removeLocalQueryTarget(i.targetId), n.sharedClientState.isActiveQueryTarget(i.targetId) ? [ 3 /*break*/ , 2 ] : [ 4 /*yield*/ , go(n.localStore, i.targetId,
12763
12763
  /*keepPersistedTargetData=*/ !1).then((function() {
12764
12764
  n.sharedClientState.clearQueryState(i.targetId), cs(n.remoteStore, i.targetId),
12765
- du(n, i.targetId);
12765
+ da(n, i.targetId);
12766
12766
  })).catch(Fi) ]) : [ 3 /*break*/ , 3 ];
12767
12767
 
12768
12768
  case 1:
@@ -12772,7 +12772,7 @@ function eu(t, e) {
12772
12772
  return [ 3 /*break*/ , 5 ];
12773
12773
 
12774
12774
  case 3:
12775
- return du(n, i.targetId), [ 4 /*yield*/ , go(n.localStore, i.targetId,
12775
+ return da(n, i.targetId), [ 4 /*yield*/ , go(n.localStore, i.targetId,
12776
12776
  /*keepPersistedTargetData=*/ !0) ];
12777
12777
 
12778
12778
  case 4:
@@ -12794,13 +12794,13 @@ function eu(t, e) {
12794
12794
  * have completed, *not* when the write was acked by the backend. The
12795
12795
  * userCallback is resolved once the write was acked/rejected by the
12796
12796
  * backend (or failed locally for any other reason).
12797
- */ function iu(t, e, i) {
12797
+ */ function ia(t, e, i) {
12798
12798
  return n(this, void 0, void 0, (function() {
12799
- var n, o, s, u;
12799
+ var n, o, s, a;
12800
12800
  return r(this, (function(r) {
12801
12801
  switch (r.label) {
12802
12802
  case 0:
12803
- n = xu(t), r.label = 1;
12803
+ n = xa(t), r.label = 1;
12804
12804
 
12805
12805
  case 1:
12806
12806
  return r.trys.push([ 1, 5, , 6 ]), [ 4 /*yield*/ , function(t, e) {
@@ -12816,13 +12816,13 @@ function eu(t, e) {
12816
12816
  // later used to guarantee consistent values and prevents flicker
12817
12817
  // even if the backend sends us an update that already includes our
12818
12818
  // transform.
12819
- var s = [], u = 0, a = e; u < a.length; u++) {
12820
- var c = a[u], h = rn(c, n.get(c.key));
12819
+ var s = [], a = 0, u = e; a < u.length; a++) {
12820
+ var c = u[a], h = rn(c, n.get(c.key));
12821
12821
  null != h &&
12822
12822
  // NOTE: The base state should only be applied if there's some
12823
12823
  // existing document to override, so use a Precondition of
12824
12824
  // exists=true
12825
- s.push(new an(c.key, h, Jt(h.value.mapValue), $e.exists(!0)));
12825
+ s.push(new un(c.key, h, Jt(h.value.mapValue), $e.exists(!0)));
12826
12826
  }
12827
12827
  return r.An.addMutationBatch(t, i, s, e);
12828
12828
  }));
@@ -12838,7 +12838,7 @@ function eu(t, e) {
12838
12838
  return o = r.sent(), n.sharedClientState.addPendingMutation(o.batchId), function(t, e, n) {
12839
12839
  var r = t.Ko[t.currentUser.toKey()];
12840
12840
  r || (r = new wn(ct)), r = r.insert(e, n), t.Ko[t.currentUser.toKey()] = r;
12841
- }(n, o.batchId, i), [ 4 /*yield*/ , gu(n, o.changes) ];
12841
+ }(n, o.batchId, i), [ 4 /*yield*/ , ga(n, o.changes) ];
12842
12842
 
12843
12843
  case 3:
12844
12844
  return r.sent(), [ 4 /*yield*/ , Is(n.remoteStore) ];
@@ -12847,7 +12847,7 @@ function eu(t, e) {
12847
12847
  return r.sent(), [ 3 /*break*/ , 6 ];
12848
12848
 
12849
12849
  case 5:
12850
- return s = r.sent(), u = Ls(s, "Failed to persist write"), i.reject(u), [ 3 /*break*/ , 6 ];
12850
+ return s = r.sent(), a = Ls(s, "Failed to persist write"), i.reject(a), [ 3 /*break*/ , 6 ];
12851
12851
 
12852
12852
  case 6:
12853
12853
  return [ 2 /*return*/ ];
@@ -12860,7 +12860,7 @@ function eu(t, e) {
12860
12860
  * Applies one remote event to the sync engine, notifying any views of the
12861
12861
  * changes, and releasing any pending mutation batches that would become
12862
12862
  * visible because of the snapshot version the remote event contains.
12863
- */ function ou(t, e) {
12863
+ */ function oa(t, e) {
12864
12864
  return n(this, void 0, void 0, (function() {
12865
12865
  var n, i;
12866
12866
  return r(this, (function(r) {
@@ -12882,7 +12882,7 @@ function eu(t, e) {
12882
12882
  z(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1),
12883
12883
  t.addedDocuments.size > 0 ? r.$o = !0 : t.modifiedDocuments.size > 0 ? z(r.$o) : t.removedDocuments.size > 0 && (z(r.$o),
12884
12884
  r.$o = !1));
12885
- })), [ 4 /*yield*/ , gu(n, i, e) ];
12885
+ })), [ 4 /*yield*/ , ga(n, i, e) ];
12886
12886
 
12887
12887
  case 3:
12888
12888
  // Update `receivedDocument` as appropriate for any limbo targets.
@@ -12904,7 +12904,7 @@ function eu(t, e) {
12904
12904
  /**
12905
12905
  * Applies an OnlineState change to the sync engine and notifies any views of
12906
12906
  * the change.
12907
- */ function su(t, e, n) {
12907
+ */ function sa(t, e, n) {
12908
12908
  var r = W(t);
12909
12909
  // If we are the secondary client, we explicitly ignore the remote store's
12910
12910
  // online state (the local client may go offline, even though the primary
@@ -12939,18 +12939,22 @@ function eu(t, e) {
12939
12939
  * @param err - A description of the condition that has forced the rejection.
12940
12940
  * Nearly always this will be an indication that the user is no longer
12941
12941
  * authorized to see the data matching the target.
12942
- */ function uu(t, e, i) {
12942
+ */ function aa(t, e, i) {
12943
12943
  return n(this, void 0, void 0, (function() {
12944
- var n, o, s, u, a, c;
12944
+ var n, o, s, a, u, c;
12945
12945
  return r(this, (function(r) {
12946
12946
  switch (r.label) {
12947
12947
  case 0:
12948
12948
  // PORTING NOTE: Multi-tab only.
12949
12949
  return (n = W(t)).sharedClientState.updateQueryState(e, "rejected", i), o = n.Uo.get(e),
12950
- (s = o && o.key) ? (u = (u = new wn(Pt.comparator)).insert(s, Xt.newNoDocument(s, dt.min())),
12951
- a = Cn().add(s), c = new Ln(dt.min(),
12950
+ (s = o && o.key) ? (
12951
+ // TODO(b/217189216): This limbo document should ideally have a read time,
12952
+ // so that it is picked up by any read-time based scans. The backend,
12953
+ // however, does not send a read time for target removals.
12954
+ a = (a = new wn(Pt.comparator)).insert(s, Xt.newNoDocument(s, dt.min())), u = Cn().add(s),
12955
+ c = new Ln(dt.min(),
12952
12956
  /* targetChanges= */ new Map,
12953
- /* targetMismatches= */ new Tn(ct), u, a), [ 4 /*yield*/ , ou(n, c) ]) : [ 3 /*break*/ , 2 ];
12957
+ /* targetMismatches= */ new Tn(ct), a, u), [ 4 /*yield*/ , oa(n, c) ]) : [ 3 /*break*/ , 2 ];
12954
12958
 
12955
12959
  case 1:
12956
12960
  return r.sent(),
@@ -12959,12 +12963,12 @@ function eu(t, e) {
12959
12963
  // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to
12960
12964
  // this query when the RemoteStore restarts the Watch stream, which should
12961
12965
  // re-trigger the target failure.
12962
- n.Bo = n.Bo.remove(s), n.Uo.delete(e), mu(n), [ 3 /*break*/ , 4 ];
12966
+ n.Bo = n.Bo.remove(s), n.Uo.delete(e), ma(n), [ 3 /*break*/ , 4 ];
12963
12967
 
12964
12968
  case 2:
12965
12969
  return [ 4 /*yield*/ , go(n.localStore, e,
12966
12970
  /* keepPersistedTargetData */ !1).then((function() {
12967
- return du(n, e, i);
12971
+ return da(n, e, i);
12968
12972
  })).catch(Fi) ];
12969
12973
 
12970
12974
  case 3:
@@ -12977,7 +12981,7 @@ function eu(t, e) {
12977
12981
  }));
12978
12982
  }
12979
12983
 
12980
- function au(t, e) {
12984
+ function ua(t, e) {
12981
12985
  return n(this, void 0, void 0, (function() {
12982
12986
  var n, i, o;
12983
12987
  return r(this, (function(r) {
@@ -12994,8 +12998,8 @@ function au(t, e) {
12994
12998
  // raise events immediately (depending on whether the watcher is caught
12995
12999
  // up), so we raise user callbacks first so that they consistently happen
12996
13000
  // before listen events.
12997
- lu(n, i, /*error=*/ null), fu(n, i), n.sharedClientState.updateMutationState(i, "acknowledged"),
12998
- [ 4 /*yield*/ , gu(n, o) ];
13001
+ la(n, i, /*error=*/ null), fa(n, i), n.sharedClientState.updateMutationState(i, "acknowledged"),
13002
+ [ 4 /*yield*/ , ga(n, o) ];
12999
13003
 
13000
13004
  case 3:
13001
13005
  // The local store may or may not be able to apply the write result and
@@ -13017,7 +13021,7 @@ function au(t, e) {
13017
13021
  }));
13018
13022
  }
13019
13023
 
13020
- function cu(t, e, i) {
13024
+ function ca(t, e, i) {
13021
13025
  return n(this, void 0, void 0, (function() {
13022
13026
  var n, o;
13023
13027
  return r(this, (function(r) {
@@ -13046,8 +13050,8 @@ function cu(t, e, i) {
13046
13050
  // raise events immediately (depending on whether the watcher is caught up),
13047
13051
  // so we raise user callbacks first so that they consistently happen before
13048
13052
  // listen events.
13049
- lu(n, e, i), fu(n, e), n.sharedClientState.updateMutationState(e, "rejected", i),
13050
- [ 4 /*yield*/ , gu(n, o) ];
13053
+ la(n, e, i), fa(n, e), n.sharedClientState.updateMutationState(e, "rejected", i),
13054
+ [ 4 /*yield*/ , ga(n, o) ];
13051
13055
 
13052
13056
  case 3:
13053
13057
  // The local store may or may not be able to apply the write result and
@@ -13072,9 +13076,9 @@ function cu(t, e, i) {
13072
13076
  /**
13073
13077
  * Registers a user callback that resolves when all pending mutations at the moment of calling
13074
13078
  * are acknowledged .
13075
- */ function hu(t, e) {
13079
+ */ function ha(t, e) {
13076
13080
  return n(this, void 0, void 0, (function() {
13077
- var n, i, o, s, u;
13081
+ var n, i, o, s, a;
13078
13082
  return r(this, (function(r) {
13079
13083
  switch (r.label) {
13080
13084
  case 0:
@@ -13094,8 +13098,8 @@ function cu(t, e, i) {
13094
13098
  n.jo.set(i, o), [ 3 /*break*/ , 4 ]);
13095
13099
 
13096
13100
  case 3:
13097
- return s = r.sent(), u = Ls(s, "Initialization of waitForPendingWrites() operation failed"),
13098
- e.reject(u), [ 3 /*break*/ , 4 ];
13101
+ return s = r.sent(), a = Ls(s, "Initialization of waitForPendingWrites() operation failed"),
13102
+ e.reject(a), [ 3 /*break*/ , 4 ];
13099
13103
 
13100
13104
  case 4:
13101
13105
  return [ 2 /*return*/ ];
@@ -13107,14 +13111,14 @@ function cu(t, e, i) {
13107
13111
  /**
13108
13112
  * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,
13109
13113
  * if there are any.
13110
- */ function fu(t, e) {
13114
+ */ function fa(t, e) {
13111
13115
  (t.jo.get(e) || []).forEach((function(t) {
13112
13116
  t.resolve();
13113
13117
  })), t.jo.delete(e)
13114
13118
  /** Reject all outstanding callbacks waiting for pending writes to complete. */;
13115
13119
  }
13116
13120
 
13117
- function lu(t, e, n) {
13121
+ function la(t, e, n) {
13118
13122
  var r = W(t), i = r.Ko[r.currentUser.toKey()];
13119
13123
  // NOTE: Mutations restored from persistence won't have callbacks, so it's
13120
13124
  // okay for there to be no callback for this ID.
@@ -13124,7 +13128,7 @@ function lu(t, e, n) {
13124
13128
  }
13125
13129
  }
13126
13130
 
13127
- function du(t, e, n) {
13131
+ function da(t, e, n) {
13128
13132
  void 0 === n && (n = null), t.sharedClientState.removeLocalQueryTarget(e);
13129
13133
  for (var r = 0, i = t.Fo.get(e); r < i.length; r++) {
13130
13134
  var o = i[r];
@@ -13133,32 +13137,32 @@ function du(t, e, n) {
13133
13137
  t.Fo.delete(e), t.isPrimaryClient && t.qo.us(e).forEach((function(e) {
13134
13138
  t.qo.containsKey(e) ||
13135
13139
  // We removed the last reference for this key
13136
- pu(t, e);
13140
+ pa(t, e);
13137
13141
  }));
13138
13142
  }
13139
13143
 
13140
- function pu(t, e) {
13144
+ function pa(t, e) {
13141
13145
  t.Lo.delete(e.path.canonicalString());
13142
13146
  // It's possible that the target already got removed because the query failed. In that case,
13143
13147
  // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.
13144
13148
  var n = t.Bo.get(e);
13145
- null !== n && (cs(t.remoteStore, n), t.Bo = t.Bo.remove(e), t.Uo.delete(n), mu(t));
13149
+ null !== n && (cs(t.remoteStore, n), t.Bo = t.Bo.remove(e), t.Uo.delete(n), ma(t));
13146
13150
  }
13147
13151
 
13148
- function yu(t, e, n) {
13152
+ function ya(t, e, n) {
13149
13153
  for (var r = 0, i = n; r < i.length; r++) {
13150
13154
  var o = i[r];
13151
- o instanceof Ys ? (t.qo.addReference(o.key, e), vu(t, o)) : o instanceof Js ? (U("SyncEngine", "Document no longer in limbo: " + o.key),
13155
+ o instanceof Ys ? (t.qo.addReference(o.key, e), va(t, o)) : o instanceof Js ? (U("SyncEngine", "Document no longer in limbo: " + o.key),
13152
13156
  t.qo.removeReference(o.key, e), t.qo.containsKey(o.key) ||
13153
13157
  // We removed the last reference for this key
13154
- pu(t, o.key)) : G();
13158
+ pa(t, o.key)) : G();
13155
13159
  }
13156
13160
  }
13157
13161
 
13158
- function vu(t, e) {
13162
+ function va(t, e) {
13159
13163
  var n = e.key, r = n.path.canonicalString();
13160
13164
  t.Bo.get(n) || t.Lo.has(r) || (U("SyncEngine", "New document in limbo: " + n), t.Lo.add(r),
13161
- mu(t));
13165
+ ma(t));
13162
13166
  }
13163
13167
 
13164
13168
  /**
@@ -13168,36 +13172,36 @@ function vu(t, e) {
13168
13172
  * Without bounding the number of concurrent resolutions, the server can fail
13169
13173
  * with "resource exhausted" errors which can lead to pathological client
13170
13174
  * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.
13171
- */ function mu(t) {
13175
+ */ function ma(t) {
13172
13176
  for (;t.Lo.size > 0 && t.Bo.size < t.maxConcurrentLimboResolutions; ) {
13173
13177
  var e = t.Lo.values().next().value;
13174
13178
  t.Lo.delete(e);
13175
13179
  var n = new Pt(gt.fromString(e)), r = t.Qo.next();
13176
- t.Uo.set(r, new Zs(n)), t.Bo = t.Bo.insert(n, r), as(t.remoteStore, new ii(ke(be(n.path)), r, 2 /* LimboResolution */ , st.I));
13180
+ t.Uo.set(r, new Zs(n)), t.Bo = t.Bo.insert(n, r), us(t.remoteStore, new ii(ke(be(n.path)), r, 2 /* LimboResolution */ , st.I));
13177
13181
  }
13178
13182
  }
13179
13183
 
13180
- function gu(t, e, i) {
13184
+ function ga(t, e, i) {
13181
13185
  return n(this, void 0, void 0, (function() {
13182
- var o, s, u, a;
13186
+ var o, s, a, u;
13183
13187
  return r(this, (function(c) {
13184
13188
  switch (c.label) {
13185
13189
  case 0:
13186
- return o = W(t), s = [], u = [], a = [], o.Mo.isEmpty() ? [ 3 /*break*/ , 3 ] : (o.Mo.forEach((function(t, n) {
13187
- a.push(o.Go(n, e, i).then((function(t) {
13190
+ return o = W(t), s = [], a = [], u = [], o.Mo.isEmpty() ? [ 3 /*break*/ , 3 ] : (o.Mo.forEach((function(t, n) {
13191
+ u.push(o.Go(n, e, i).then((function(t) {
13188
13192
  if (t) {
13189
13193
  o.isPrimaryClient && o.sharedClientState.updateQueryState(n.targetId, t.fromCache ? "not-current" : "current"),
13190
13194
  s.push(t);
13191
13195
  var e = so.$n(n.targetId, t);
13192
- u.push(e);
13196
+ a.push(e);
13193
13197
  }
13194
13198
  })));
13195
- })), [ 4 /*yield*/ , Promise.all(a) ]);
13199
+ })), [ 4 /*yield*/ , Promise.all(u) ]);
13196
13200
 
13197
13201
  case 1:
13198
13202
  return c.sent(), o.Oo.br(s), [ 4 /*yield*/ , function(t, e) {
13199
13203
  return n(this, void 0, void 0, (function() {
13200
- var n, i, o, s, u, a, c, h, f;
13204
+ var n, i, o, s, a, u, c, h, f;
13201
13205
  return r(this, (function(r) {
13202
13206
  switch (r.label) {
13203
13207
  case 0:
@@ -13229,15 +13233,15 @@ function gu(t, e, i) {
13229
13233
  [ 3 /*break*/ , 4 ];
13230
13234
 
13231
13235
  case 4:
13232
- for (o = 0, s = e; o < s.length; o++) u = s[o], a = u.targetId, u.fromCache || (c = n.qn.get(a),
13236
+ for (o = 0, s = e; o < s.length; o++) a = s[o], u = a.targetId, a.fromCache || (c = n.qn.get(u),
13233
13237
  h = c.snapshotVersion, f = c.withLastLimboFreeSnapshotVersion(h),
13234
13238
  // Advance the last limbo free snapshot version
13235
- n.qn = n.qn.insert(a, f));
13239
+ n.qn = n.qn.insert(u, f));
13236
13240
  return [ 2 /*return*/ ];
13237
13241
  }
13238
13242
  }));
13239
13243
  }));
13240
- }(o.localStore, u) ];
13244
+ }(o.localStore, a) ];
13241
13245
 
13242
13246
  case 2:
13243
13247
  c.sent(), c.label = 3;
@@ -13249,7 +13253,7 @@ function gu(t, e, i) {
13249
13253
  }));
13250
13254
  }
13251
13255
 
13252
- function wu(t, e) {
13256
+ function wa(t, e) {
13253
13257
  return n(this, void 0, void 0, (function() {
13254
13258
  var n, i;
13255
13259
  return r(this, (function(r) {
@@ -13269,7 +13273,7 @@ function wu(t, e) {
13269
13273
  })), t.jo.clear();
13270
13274
  }(n),
13271
13275
  // TODO(b/114226417): Consider calling this only in the primary tab.
13272
- n.sharedClientState.handleUserChange(e, i.removedBatchIds, i.addedBatchIds), [ 4 /*yield*/ , gu(n, i.Gn) ];
13276
+ n.sharedClientState.handleUserChange(e, i.removedBatchIds, i.addedBatchIds), [ 4 /*yield*/ , ga(n, i.Gn) ];
13273
13277
 
13274
13278
  case 2:
13275
13279
  r.sent(), r.label = 3;
@@ -13281,13 +13285,13 @@ function wu(t, e) {
13281
13285
  }));
13282
13286
  }
13283
13287
 
13284
- function bu(t, e) {
13288
+ function ba(t, e) {
13285
13289
  var n = W(t), r = n.Uo.get(e);
13286
13290
  if (r && r.$o) return Cn().add(r.key);
13287
13291
  var i = Cn(), o = n.Fo.get(e);
13288
13292
  if (!o) return i;
13289
- for (var s = 0, u = o; s < u.length; s++) {
13290
- var a = u[s], c = n.Mo.get(a);
13293
+ for (var s = 0, a = o; s < a.length; s++) {
13294
+ var u = a[s], c = n.Mo.get(u);
13291
13295
  i = i.unionWith(c.view.bo);
13292
13296
  }
13293
13297
  return i;
@@ -13296,7 +13300,7 @@ function bu(t, e) {
13296
13300
  /**
13297
13301
  * Reconcile the list of synced documents in an existing view with those
13298
13302
  * from persistence.
13299
- */ function Iu(t, e) {
13303
+ */ function Ia(t, e) {
13300
13304
  return n(this, void 0, void 0, (function() {
13301
13305
  var n, i, o;
13302
13306
  return r(this, (function(r) {
@@ -13306,7 +13310,7 @@ function bu(t, e) {
13306
13310
  /* usePreviousResults= */ !0) ];
13307
13311
 
13308
13312
  case 1:
13309
- return i = r.sent(), o = e.view.ko(i), [ 2 /*return*/ , (n.isPrimaryClient && yu(n, e.targetId, o.Co),
13313
+ return i = r.sent(), o = e.view.ko(i), [ 2 /*return*/ , (n.isPrimaryClient && ya(n, e.targetId, o.Co),
13310
13314
  o) ];
13311
13315
  }
13312
13316
  }));
@@ -13318,12 +13322,12 @@ function bu(t, e) {
13318
13322
  * snapshots if needed.
13319
13323
  */
13320
13324
  // PORTING NOTE: Multi-Tab only.
13321
- function Tu(t) {
13325
+ function Ta(t) {
13322
13326
  return n(this, void 0, void 0, (function() {
13323
13327
  var e;
13324
13328
  return r(this, (function(n) {
13325
13329
  return [ 2 /*return*/ , Io((e = W(t)).localStore).then((function(t) {
13326
- return gu(e, t);
13330
+ return ga(e, t);
13327
13331
  })) ];
13328
13332
  }));
13329
13333
  }));
@@ -13331,7 +13335,7 @@ function Tu(t) {
13331
13335
 
13332
13336
  /** Applies a mutation state to an existing batch. */
13333
13337
  // PORTING NOTE: Multi-Tab only.
13334
- function Eu(t, e, i, o) {
13338
+ function Ea(t, e, i, o) {
13335
13339
  return n(this, void 0, void 0, (function() {
13336
13340
  var n, s;
13337
13341
  return r(this, (function(r) {
@@ -13359,12 +13363,12 @@ function Eu(t, e, i, o) {
13359
13363
  "acknowledged" === i || "rejected" === i ? (
13360
13364
  // NOTE: Both these methods are no-ops for batches that originated from
13361
13365
  // other clients.
13362
- lu(n, e, o || null), fu(n, e), function(t, e) {
13366
+ la(n, e, o || null), fa(n, e), function(t, e) {
13363
13367
  W(W(t).An).ee(e);
13364
13368
  }(n.localStore, e)) : G(), r.label = 4;
13365
13369
 
13366
13370
  case 4:
13367
- return [ 4 /*yield*/ , gu(n, s) ];
13371
+ return [ 4 /*yield*/ , ga(n, s) ];
13368
13372
 
13369
13373
  case 5:
13370
13374
  return r.sent(), [ 3 /*break*/ , 7 ];
@@ -13388,33 +13392,33 @@ function Eu(t, e, i, o) {
13388
13392
 
13389
13393
  /** Applies a query target change from a different tab. */
13390
13394
  // PORTING NOTE: Multi-Tab only.
13391
- function Su(t, e) {
13395
+ function Sa(t, e) {
13392
13396
  return n(this, void 0, void 0, (function() {
13393
- var n, i, o, s, u, a, c, h;
13397
+ var n, i, o, s, a, u, c, h;
13394
13398
  return r(this, (function(r) {
13395
13399
  switch (r.label) {
13396
13400
  case 0:
13397
- return Cu(n = W(t)), xu(n), !0 !== e || !0 === n.Wo ? [ 3 /*break*/ , 3 ] : (i = n.sharedClientState.getAllActiveQueryTargets(),
13398
- [ 4 /*yield*/ , _u(n, i.toArray()) ]);
13401
+ return Ca(n = W(t)), xa(n), !0 !== e || !0 === n.Wo ? [ 3 /*break*/ , 3 ] : (i = n.sharedClientState.getAllActiveQueryTargets(),
13402
+ [ 4 /*yield*/ , _a(n, i.toArray()) ]);
13399
13403
 
13400
13404
  case 1:
13401
13405
  return o = r.sent(), n.Wo = !0, [ 4 /*yield*/ , Ns(n.remoteStore, !0) ];
13402
13406
 
13403
13407
  case 2:
13404
- for (r.sent(), s = 0, u = o; s < u.length; s++) a = u[s], as(n.remoteStore, a);
13408
+ for (r.sent(), s = 0, a = o; s < a.length; s++) u = a[s], us(n.remoteStore, u);
13405
13409
  return [ 3 /*break*/ , 7 ];
13406
13410
 
13407
13411
  case 3:
13408
13412
  return !1 !== e || !1 === n.Wo ? [ 3 /*break*/ , 7 ] : (c = [], h = Promise.resolve(),
13409
13413
  n.Fo.forEach((function(t, e) {
13410
13414
  n.sharedClientState.isLocalQueryTarget(e) ? c.push(e) : h = h.then((function() {
13411
- return du(n, e), go(n.localStore, e,
13415
+ return da(n, e), go(n.localStore, e,
13412
13416
  /*keepPersistedTargetData=*/ !0);
13413
13417
  })), cs(n.remoteStore, e);
13414
13418
  })), [ 4 /*yield*/ , h ]);
13415
13419
 
13416
13420
  case 4:
13417
- return r.sent(), [ 4 /*yield*/ , _u(n, c) ];
13421
+ return r.sent(), [ 4 /*yield*/ , _a(n, c) ];
13418
13422
 
13419
13423
  case 5:
13420
13424
  return r.sent(),
@@ -13436,16 +13440,16 @@ function Su(t, e) {
13436
13440
  }));
13437
13441
  }
13438
13442
 
13439
- function _u(t, e, i) {
13443
+ function _a(t, e, i) {
13440
13444
  return n(this, void 0, void 0, (function() {
13441
- var n, i, o, s, u, a, c, h, f, l, d, p, y, v;
13445
+ var n, i, o, s, a, u, c, h, f, l, d, p, y, v;
13442
13446
  return r(this, (function(r) {
13443
13447
  switch (r.label) {
13444
13448
  case 0:
13445
- n = W(t), i = [], o = [], s = 0, u = e, r.label = 1;
13449
+ n = W(t), i = [], o = [], s = 0, a = e, r.label = 1;
13446
13450
 
13447
13451
  case 1:
13448
- return s < u.length ? (a = u[s], c = void 0, (h = n.Fo.get(a)) && 0 !== h.length ? [ 4 /*yield*/ , mo(n.localStore, ke(h[0])) ] : [ 3 /*break*/ , 7 ]) : [ 3 /*break*/ , 13 ];
13452
+ return s < a.length ? (u = a[s], c = void 0, (h = n.Fo.get(u)) && 0 !== h.length ? [ 4 /*yield*/ , mo(n.localStore, ke(h[0])) ] : [ 3 /*break*/ , 7 ]) : [ 3 /*break*/ , 13 ];
13449
13453
 
13450
13454
  case 2:
13451
13455
  // For queries that have a local View, we fetch their current state
@@ -13455,7 +13459,7 @@ function _u(t, e, i) {
13455
13459
  c = r.sent(), f = 0, l = h, r.label = 3;
13456
13460
 
13457
13461
  case 3:
13458
- return f < l.length ? (d = l[f], p = n.Mo.get(d), [ 4 /*yield*/ , Iu(n, p) ]) : [ 3 /*break*/ , 6 ];
13462
+ return f < l.length ? (d = l[f], p = n.Mo.get(d), [ 4 /*yield*/ , Ia(n, p) ]) : [ 3 /*break*/ , 6 ];
13459
13463
 
13460
13464
  case 4:
13461
13465
  (y = r.sent()).snapshot && o.push(y.snapshot), r.label = 5;
@@ -13467,13 +13471,13 @@ function _u(t, e, i) {
13467
13471
  return [ 3 /*break*/ , 11 ];
13468
13472
 
13469
13473
  case 7:
13470
- return [ 4 /*yield*/ , bo(n.localStore, a) ];
13474
+ return [ 4 /*yield*/ , bo(n.localStore, u) ];
13471
13475
 
13472
13476
  case 8:
13473
13477
  return v = r.sent(), [ 4 /*yield*/ , mo(n.localStore, v) ];
13474
13478
 
13475
13479
  case 9:
13476
- return c = r.sent(), [ 4 /*yield*/ , nu(n, Au(v), a,
13480
+ return c = r.sent(), [ 4 /*yield*/ , na(n, Aa(v), u,
13477
13481
  /*current=*/ !1) ];
13478
13482
 
13479
13483
  case 10:
@@ -13503,22 +13507,22 @@ function _u(t, e, i) {
13503
13507
  * difference will not cause issues.
13504
13508
  */
13505
13509
  // PORTING NOTE: Multi-Tab only.
13506
- function Au(t) {
13510
+ function Aa(t) {
13507
13511
  return we(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, "F" /* First */ , t.startAt, t.endAt);
13508
13512
  }
13509
13513
 
13510
13514
  /** Returns the IDs of the clients that are currently active. */
13511
13515
  // PORTING NOTE: Multi-Tab only.
13512
- function ku(t) {
13516
+ function ka(t) {
13513
13517
  var e = W(t);
13514
13518
  return W(W(e.localStore).persistence).Tn();
13515
13519
  }
13516
13520
 
13517
13521
  /** Applies a query target change from a different tab. */
13518
13522
  // PORTING NOTE: Multi-Tab only.
13519
- function Du(t, e, i, o) {
13523
+ function Da(t, e, i, o) {
13520
13524
  return n(this, void 0, void 0, (function() {
13521
- var n, s, u;
13525
+ var n, s, a;
13522
13526
  return r(this, (function(r) {
13523
13527
  switch (r.label) {
13524
13528
  case 0:
@@ -13543,8 +13547,8 @@ function Du(t, e, i, o) {
13543
13547
  return [ 4 /*yield*/ , Io(n.localStore) ];
13544
13548
 
13545
13549
  case 3:
13546
- return s = r.sent(), u = Ln.createSynthesizedRemoteEventForCurrentChange(e, "current" === i),
13547
- [ 4 /*yield*/ , gu(n, s, u) ];
13550
+ return s = r.sent(), a = Ln.createSynthesizedRemoteEventForCurrentChange(e, "current" === i),
13551
+ [ 4 /*yield*/ , ga(n, s, a) ];
13548
13552
 
13549
13553
  case 4:
13550
13554
  return r.sent(), [ 3 /*break*/ , 8 ];
@@ -13554,7 +13558,7 @@ function Du(t, e, i, o) {
13554
13558
  /* keepPersistedTargetData */ !0) ];
13555
13559
 
13556
13560
  case 6:
13557
- return r.sent(), du(n, e, o), [ 3 /*break*/ , 8 ];
13561
+ return r.sent(), da(n, e, o), [ 3 /*break*/ , 8 ];
13558
13562
 
13559
13563
  case 7:
13560
13564
  G(), r.label = 8;
@@ -13566,29 +13570,29 @@ function Du(t, e, i, o) {
13566
13570
  }));
13567
13571
  }
13568
13572
 
13569
- /** Adds or removes Watch targets for queries from different tabs. */ function Nu(t, e, i) {
13573
+ /** Adds or removes Watch targets for queries from different tabs. */ function Na(t, e, i) {
13570
13574
  return n(this, void 0, void 0, (function() {
13571
- var n, o, s, u, a, c, h, f, l, d;
13575
+ var n, o, s, a, u, c, h, f, l, d;
13572
13576
  return r(this, (function(p) {
13573
13577
  switch (p.label) {
13574
13578
  case 0:
13575
- if (!(n = Cu(t)).Wo) return [ 3 /*break*/ , 10 ];
13579
+ if (!(n = Ca(t)).Wo) return [ 3 /*break*/ , 10 ];
13576
13580
  o = 0, s = e, p.label = 1;
13577
13581
 
13578
13582
  case 1:
13579
- return o < s.length ? (u = s[o], n.Fo.has(u) ? (
13583
+ return o < s.length ? (a = s[o], n.Fo.has(a) ? (
13580
13584
  // A target might have been added in a previous attempt
13581
- U("SyncEngine", "Adding an already active target " + u), [ 3 /*break*/ , 5 ]) : [ 4 /*yield*/ , bo(n.localStore, u) ]) : [ 3 /*break*/ , 6 ];
13585
+ U("SyncEngine", "Adding an already active target " + a), [ 3 /*break*/ , 5 ]) : [ 4 /*yield*/ , bo(n.localStore, a) ]) : [ 3 /*break*/ , 6 ];
13582
13586
 
13583
13587
  case 2:
13584
- return a = p.sent(), [ 4 /*yield*/ , mo(n.localStore, a) ];
13588
+ return u = p.sent(), [ 4 /*yield*/ , mo(n.localStore, u) ];
13585
13589
 
13586
13590
  case 3:
13587
- return c = p.sent(), [ 4 /*yield*/ , nu(n, Au(a), c.targetId,
13591
+ return c = p.sent(), [ 4 /*yield*/ , na(n, Aa(u), c.targetId,
13588
13592
  /*current=*/ !1) ];
13589
13593
 
13590
13594
  case 4:
13591
- p.sent(), as(n.remoteStore, c), p.label = 5;
13595
+ p.sent(), us(n.remoteStore, c), p.label = 5;
13592
13596
 
13593
13597
  case 5:
13594
13598
  return o++, [ 3 /*break*/ , 1 ];
@@ -13600,7 +13604,7 @@ function Du(t, e, i, o) {
13600
13604
  case 0:
13601
13605
  return n.Fo.has(t) ? [ 4 /*yield*/ , go(n.localStore, t,
13602
13606
  /* keepPersistedTargetData */ !1).then((function() {
13603
- cs(n.remoteStore, t), du(n, t);
13607
+ cs(n.remoteStore, t), da(n, t);
13604
13608
  })).catch(Fi) ] : [ 3 /*break*/ , 2 ];
13605
13609
 
13606
13610
  // Release queries that are still active.
@@ -13630,16 +13634,16 @@ function Du(t, e, i, o) {
13630
13634
  }));
13631
13635
  }
13632
13636
 
13633
- function Cu(t) {
13637
+ function Ca(t) {
13634
13638
  var e = W(t);
13635
- return e.remoteStore.remoteSyncer.applyRemoteEvent = ou.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = bu.bind(null, e),
13636
- e.remoteStore.remoteSyncer.rejectListen = uu.bind(null, e), e.Oo.br = Bs.bind(null, e.eventManager),
13639
+ return e.remoteStore.remoteSyncer.applyRemoteEvent = oa.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = ba.bind(null, e),
13640
+ e.remoteStore.remoteSyncer.rejectListen = aa.bind(null, e), e.Oo.br = Bs.bind(null, e.eventManager),
13637
13641
  e.Oo.zo = js.bind(null, e.eventManager), e;
13638
13642
  }
13639
13643
 
13640
- function xu(t) {
13644
+ function xa(t) {
13641
13645
  var e = W(t);
13642
- return e.remoteStore.remoteSyncer.applySuccessfulWrite = au.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = cu.bind(null, e),
13646
+ return e.remoteStore.remoteSyncer.applySuccessfulWrite = ua.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = ca.bind(null, e),
13643
13647
  e
13644
13648
  /**
13645
13649
  * Loads a Firestore bundle into the SDK. The returned promise resolves when
@@ -13651,12 +13655,12 @@ function xu(t) {
13651
13655
  */;
13652
13656
  }
13653
13657
 
13654
- function Ru(t, e, i) {
13658
+ function Ra(t, e, i) {
13655
13659
  var o = W(t);
13656
13660
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
13657
13661
  (function(t, e, i) {
13658
13662
  return n(this, void 0, void 0, (function() {
13659
- var n, o, s, u, a, c;
13663
+ var n, o, s, a, u, c;
13660
13664
  return r(this, (function(r) {
13661
13665
  switch (r.label) {
13662
13666
  case 0:
@@ -13696,7 +13700,7 @@ function Ru(t, e, i) {
13696
13700
  return s ? [ 4 /*yield*/ , o.yo(s) ] : [ 3 /*break*/ , 10 ];
13697
13701
 
13698
13702
  case 7:
13699
- return (u = r.sent()) && i._updateProgress(u), [ 4 /*yield*/ , e.Ho() ];
13703
+ return (a = r.sent()) && i._updateProgress(a), [ 4 /*yield*/ , e.Ho() ];
13700
13704
 
13701
13705
  case 8:
13702
13706
  s = r.sent(), r.label = 9;
@@ -13711,7 +13715,7 @@ function Ru(t, e, i) {
13711
13715
  // TODO(b/160876443): This currently raises snapshots with
13712
13716
  // `fromCache=false` if users already listen to some queries and bundles
13713
13717
  // has newer version.
13714
- return a = r.sent(), [ 4 /*yield*/ , gu(t, a.In,
13718
+ return u = r.sent(), [ 4 /*yield*/ , ga(t, u.In,
13715
13719
  /* remoteEvent */ void 0) ];
13716
13720
 
13717
13721
  case 12:
@@ -13731,7 +13735,7 @@ function Ru(t, e, i) {
13731
13735
  // `fromCache=false` if users already listen to some queries and bundles
13732
13736
  // has newer version.
13733
13737
  // Save metadata, so loading the same bundle will skip.
13734
- return r.sent(), i._completeWith(a.progress), [ 3 /*break*/ , 15 ];
13738
+ return r.sent(), i._completeWith(u.progress), [ 3 /*break*/ , 15 ];
13735
13739
 
13736
13740
  case 14:
13737
13741
  return j("SyncEngine", "Loading bundle failed with " + (c = r.sent())), i._failWith(c),
@@ -13767,7 +13771,7 @@ function Ru(t, e, i) {
13767
13771
  }));
13768
13772
  }
13769
13773
 
13770
- var Lu = /** @class */ function() {
13774
+ var La = /** @class */ function() {
13771
13775
  function t() {
13772
13776
  this.synchronizeTabs = !1;
13773
13777
  }
@@ -13787,7 +13791,7 @@ var Lu = /** @class */ function() {
13787
13791
  }, t.prototype.Xo = function(t) {
13788
13792
  return null;
13789
13793
  }, t.prototype.Zo = function(t) {
13790
- return co(this.persistence, new uo, t.initialUser, this.k);
13794
+ return co(this.persistence, new ao, t.initialUser, this.k);
13791
13795
  }, t.prototype.Yo = function(t) {
13792
13796
  return new Ro(Po.ks, this.k);
13793
13797
  }, t.prototype.Jo = function(t) {
@@ -13808,7 +13812,7 @@ var Lu = /** @class */ function() {
13808
13812
  }));
13809
13813
  }));
13810
13814
  }, t;
13811
- }(), Pu = /** @class */ function(e) {
13815
+ }(), Pa = /** @class */ function(e) {
13812
13816
  function i(t, n, r) {
13813
13817
  var i = this;
13814
13818
  return (i = e.call(this) || this).tc = t, i.cacheSizeBytes = n, i.forceOwnership = r,
@@ -13830,7 +13834,7 @@ var Lu = /** @class */ function() {
13830
13834
 
13831
13835
  case 3:
13832
13836
  // Enqueue writes from a previous session
13833
- return r.sent(), [ 4 /*yield*/ , xu(this.tc.syncEngine) ];
13837
+ return r.sent(), [ 4 /*yield*/ , xa(this.tc.syncEngine) ];
13834
13838
 
13835
13839
  case 4:
13836
13840
  // Enqueue writes from a previous session
@@ -13852,7 +13856,7 @@ var Lu = /** @class */ function() {
13852
13856
  }));
13853
13857
  }));
13854
13858
  }, i.prototype.Zo = function(t) {
13855
- return co(this.persistence, new uo, t.initialUser, this.k);
13859
+ return co(this.persistence, new ao, t.initialUser, this.k);
13856
13860
  }, i.prototype.Xo = function(t) {
13857
13861
  var e = this.persistence.referenceDelegate.garbageCollector;
13858
13862
  return new Ui(e, t.asyncQueue);
@@ -13862,7 +13866,7 @@ var Lu = /** @class */ function() {
13862
13866
  }, i.prototype.Jo = function(t) {
13863
13867
  return new Go;
13864
13868
  }, i;
13865
- }(Lu), Ou = /** @class */ function(e) {
13869
+ }(La), Oa = /** @class */ function(e) {
13866
13870
  function i(t, n) {
13867
13871
  var r = this;
13868
13872
  return (r = e.call(this, t, n, /* forceOwnership= */ !1) || this).tc = t, r.cacheSizeBytes = n,
@@ -13878,11 +13882,11 @@ var Lu = /** @class */ function() {
13878
13882
 
13879
13883
  case 1:
13880
13884
  return s.sent(), i = this.tc.syncEngine, this.sharedClientState instanceof Ko ? (this.sharedClientState.syncEngine = {
13881
- mi: Eu.bind(null, i),
13882
- gi: Du.bind(null, i),
13883
- yi: Nu.bind(null, i),
13884
- Tn: ku.bind(null, i),
13885
- _i: Tu.bind(null, i)
13885
+ mi: Ea.bind(null, i),
13886
+ gi: Da.bind(null, i),
13887
+ yi: Na.bind(null, i),
13888
+ Tn: ka.bind(null, i),
13889
+ _i: Ta.bind(null, i)
13886
13890
  }, [ 4 /*yield*/ , this.sharedClientState.start() ]) : [ 3 /*break*/ , 3 ];
13887
13891
 
13888
13892
  case 2:
@@ -13896,7 +13900,7 @@ var Lu = /** @class */ function() {
13896
13900
  return r(this, (function(e) {
13897
13901
  switch (e.label) {
13898
13902
  case 0:
13899
- return [ 4 /*yield*/ , Su(this.tc.syncEngine, t) ];
13903
+ return [ 4 /*yield*/ , Sa(this.tc.syncEngine, t) ];
13900
13904
 
13901
13905
  case 1:
13902
13906
  return e.sent(), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : t || this.gcScheduler.stop()),
@@ -13919,7 +13923,7 @@ var Lu = /** @class */ function() {
13919
13923
  var n = ro(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);
13920
13924
  return new Ko(e, t.asyncQueue, n, t.clientId, t.initialUser);
13921
13925
  }, i;
13922
- }(Pu), Mu = /** @class */ function() {
13926
+ }(Pa), Ma = /** @class */ function() {
13923
13927
  function t() {}
13924
13928
  return t.prototype.initialize = function(t, e) {
13925
13929
  return n(this, void 0, void 0, (function() {
@@ -13932,8 +13936,8 @@ var Lu = /** @class */ function() {
13932
13936
  this.remoteStore = this.createRemoteStore(e), this.eventManager = this.createEventManager(e),
13933
13937
  this.syncEngine = this.createSyncEngine(e,
13934
13938
  /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = function(t) {
13935
- return su(n.syncEngine, t, 1 /* SharedClientState */);
13936
- }, this.remoteStore.remoteSyncer.handleCredentialChange = wu.bind(null, this.syncEngine),
13939
+ return sa(n.syncEngine, t, 1 /* SharedClientState */);
13940
+ }, this.remoteStore.remoteSyncer.handleCredentialChange = wa.bind(null, this.syncEngine),
13937
13941
  [ 4 /*yield*/ , Ns(this.remoteStore, this.syncEngine.isPrimaryClient) ]);
13938
13942
 
13939
13943
  case 1:
@@ -13954,14 +13958,14 @@ var Lu = /** @class */ function() {
13954
13958
  }, t.prototype.createRemoteStore = function(t) {
13955
13959
  var e, n, r, i, o, s = this;
13956
13960
  return e = this.localStore, n = this.datastore, r = t.asyncQueue, i = function(t) {
13957
- return su(s.syncEngine, t, 0 /* RemoteStore */);
13961
+ return sa(s.syncEngine, t, 0 /* RemoteStore */);
13958
13962
  }, o = Qo.Pt() ? new Qo : new zo, new os(e, n, r, i, o);
13959
13963
  }, t.prototype.createSyncEngine = function(t, e) {
13960
13964
  return function(t, e, n,
13961
13965
  // PORTING NOTE: Manages state synchronization in multi-tab environments.
13962
13966
  r, i, o, s) {
13963
- var u = new tu(t, e, n, r, i, o);
13964
- return s && (u.Wo = !0), u;
13967
+ var a = new ta(t, e, n, r, i, o);
13968
+ return s && (a.Wo = !0), a;
13965
13969
  }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e);
13966
13970
  }, t.prototype.terminate = function() {
13967
13971
  return function(t) {
@@ -13971,7 +13975,7 @@ var Lu = /** @class */ function() {
13971
13975
  switch (n.label) {
13972
13976
  case 0:
13973
13977
  return e = W(t), U("RemoteStore", "RemoteStore shutting down."), e.Gr.add(5 /* Shutdown */),
13974
- [ 4 /*yield*/ , us(e) ];
13978
+ [ 4 /*yield*/ , as(e) ];
13975
13979
 
13976
13980
  case 1:
13977
13981
  return n.sent(), e.Hr.shutdown(),
@@ -14015,7 +14019,7 @@ var Lu = /** @class */ function() {
14015
14019
  * @param bytesPerRead - How many bytes each `read()` from the returned reader
14016
14020
  * will read.
14017
14021
  */
14018
- function Fu(t, e) {
14022
+ function Fa(t, e) {
14019
14023
  void 0 === e && (e = 10240);
14020
14024
  var i = 0;
14021
14025
  // The TypeScript definition for ReadableStreamReader changed. We use
@@ -14088,7 +14092,7 @@ function Fu(t, e) {
14088
14092
  * A wrapper implementation of Observer<T> that will dispatch events
14089
14093
  * asynchronously. To allow immediate silencing, a mute call is added which
14090
14094
  * causes events scheduled to no longer be raised.
14091
- */ var Vu = /** @class */ function() {
14095
+ */ var Va = /** @class */ function() {
14092
14096
  function t(t) {
14093
14097
  this.observer = t,
14094
14098
  /**
@@ -14109,7 +14113,7 @@ function Fu(t, e) {
14109
14113
  n.muted || t(e);
14110
14114
  }), 0);
14111
14115
  }, t;
14112
- }(), qu = /** @class */ function() {
14116
+ }(), qa = /** @class */ function() {
14113
14117
  function t(
14114
14118
  /** The reader to read from underlying binary bundle data source. */
14115
14119
  t, e) {
@@ -14269,7 +14273,7 @@ function Fu(t, e) {
14269
14273
  }));
14270
14274
  }));
14271
14275
  }, t;
14272
- }(), Uu = /** @class */ function() {
14276
+ }(), Ua = /** @class */ function() {
14273
14277
  function t(t) {
14274
14278
  this.datastore = t,
14275
14279
  // The version of each document that was read during this transaction.
@@ -14296,7 +14300,7 @@ function Fu(t, e) {
14296
14300
  if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new Y(H.INVALID_ARGUMENT, "Firestore transactions require all reads to be executed before all writes.");
14297
14301
  return [ 4 /*yield*/ , function(t, e) {
14298
14302
  return n(this, void 0, void 0, (function() {
14299
- var n, i, o, s, u, a;
14303
+ var n, i, o, s, a, u;
14300
14304
  return r(this, (function(r) {
14301
14305
  switch (r.label) {
14302
14306
  case 0:
@@ -14307,7 +14311,7 @@ function Fu(t, e) {
14307
14311
  }, [ 4 /*yield*/ , n.ji("BatchGetDocuments", i, o) ];
14308
14312
 
14309
14313
  case 1:
14310
- return s = r.sent(), u = new Map, s.forEach((function(t) {
14314
+ return s = r.sent(), a = new Map, s.forEach((function(t) {
14311
14315
  var e = function(t, e) {
14312
14316
  return "found" in e ? function(t, e) {
14313
14317
  z(!!e.found), e.found.name, e.found.updateTime;
@@ -14323,11 +14327,11 @@ function Fu(t, e) {
14323
14327
  return Xt.newNoDocument(n, r);
14324
14328
  }(t, e) : G();
14325
14329
  }(n.k, t);
14326
- u.set(e.key.toString(), e);
14327
- })), a = [], [ 2 /*return*/ , (e.forEach((function(t) {
14328
- var e = u.get(t.toString());
14329
- z(!!e), a.push(e);
14330
- })), a) ];
14330
+ a.set(e.key.toString(), e);
14331
+ })), u = [], [ 2 /*return*/ , (e.forEach((function(t) {
14332
+ var e = a.get(t.toString());
14333
+ z(!!e), u.push(e);
14334
+ })), u) ];
14331
14335
  }
14332
14336
  }));
14333
14337
  }));
@@ -14443,7 +14447,7 @@ function Fu(t, e) {
14443
14447
  }, t.prototype.write = function(t) {
14444
14448
  this.ensureCommitNotCalled(), this.mutations.push(t);
14445
14449
  }, t.prototype.ensureCommitNotCalled = function() {}, t;
14446
- }(), Bu = /** @class */ function() {
14450
+ }(), Ba = /** @class */ function() {
14447
14451
  function t(t, e, n, r) {
14448
14452
  this.asyncQueue = t, this.datastore = e, this.updateFunction = n, this.deferred = r,
14449
14453
  this.lc = 5, this.ur = new Zo(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
@@ -14457,7 +14461,7 @@ function Fu(t, e) {
14457
14461
  return n(t, void 0, void 0, (function() {
14458
14462
  var t, e, n = this;
14459
14463
  return r(this, (function(r) {
14460
- return t = new Uu(this.datastore), (e = this.dc(t)) && e.then((function(e) {
14464
+ return t = new Ua(this.datastore), (e = this.dc(t)) && e.then((function(e) {
14461
14465
  n.asyncQueue.enqueueAndForget((function() {
14462
14466
  return t.commit().then((function() {
14463
14467
  n.deferred.resolve(e);
@@ -14494,7 +14498,7 @@ function Fu(t, e) {
14494
14498
  }
14495
14499
  return !1;
14496
14500
  }, t;
14497
- }(), ju = /** @class */ function() {
14501
+ }(), ja = /** @class */ function() {
14498
14502
  function t(t, e,
14499
14503
  /**
14500
14504
  * Asynchronous queue responsible for all of our internal processing. When
@@ -14507,7 +14511,7 @@ function Fu(t, e) {
14507
14511
  i, o) {
14508
14512
  var s = this;
14509
14513
  this.authCredentials = t, this.appCheckCredentials = e, this.asyncQueue = i, this.databaseInfo = o,
14510
- this.user = O.UNAUTHENTICATED, this.clientId = at.A(), this.authCredentialListener = function() {
14514
+ this.user = O.UNAUTHENTICATED, this.clientId = ut.A(), this.authCredentialListener = function() {
14511
14515
  return Promise.resolve();
14512
14516
  }, this.appCheckCredentialListener = function() {
14513
14517
  return Promise.resolve();
@@ -14613,20 +14617,20 @@ function Fu(t, e) {
14613
14617
  *
14614
14618
  * Takes a bundle stream or buffer, and presents abstractions to read bundled
14615
14619
  * elements out of the underlying content.
14616
- */ function Ku(t, e) {
14620
+ */ function Ka(t, e) {
14617
14621
  return n(this, void 0, void 0, (function() {
14618
14622
  var i, o, s = this;
14619
- return r(this, (function(u) {
14620
- switch (u.label) {
14623
+ return r(this, (function(a) {
14624
+ switch (a.label) {
14621
14625
  case 0:
14622
14626
  return t.asyncQueue.verifyOperationInProgress(), U("FirestoreClient", "Initializing OfflineComponentProvider"),
14623
14627
  [ 4 /*yield*/ , t.getConfiguration() ];
14624
14628
 
14625
14629
  case 1:
14626
- return i = u.sent(), [ 4 /*yield*/ , e.initialize(i) ];
14630
+ return i = a.sent(), [ 4 /*yield*/ , e.initialize(i) ];
14627
14631
 
14628
14632
  case 2:
14629
- return u.sent(), o = i.initialUser, t.setCredentialChangeListener((function(t) {
14633
+ return a.sent(), o = i.initialUser, t.setCredentialChangeListener((function(t) {
14630
14634
  return n(s, void 0, void 0, (function() {
14631
14635
  return r(this, (function(n) {
14632
14636
  switch (n.label) {
@@ -14652,13 +14656,13 @@ function Fu(t, e) {
14652
14656
  }));
14653
14657
  }
14654
14658
 
14655
- function Gu(t, e) {
14659
+ function Ga(t, e) {
14656
14660
  return n(this, void 0, void 0, (function() {
14657
14661
  var n, i;
14658
14662
  return r(this, (function(r) {
14659
14663
  switch (r.label) {
14660
14664
  case 0:
14661
- return t.asyncQueue.verifyOperationInProgress(), [ 4 /*yield*/ , zu(t) ];
14665
+ return t.asyncQueue.verifyOperationInProgress(), [ 4 /*yield*/ , za(t) ];
14662
14666
 
14663
14667
  case 1:
14664
14668
  return n = r.sent(), U("FirestoreClient", "Initializing OnlineComponentProvider"),
@@ -14681,13 +14685,13 @@ function Gu(t, e) {
14681
14685
  }));
14682
14686
  }
14683
14687
 
14684
- function zu(t) {
14688
+ function za(t) {
14685
14689
  return n(this, void 0, void 0, (function() {
14686
14690
  return r(this, (function(e) {
14687
14691
  switch (e.label) {
14688
14692
  case 0:
14689
14693
  return t.offlineComponents ? [ 3 /*break*/ , 2 ] : (U("FirestoreClient", "Using default OfflineComponentProvider"),
14690
- [ 4 /*yield*/ , Ku(t, new Lu) ]);
14694
+ [ 4 /*yield*/ , Ka(t, new La) ]);
14691
14695
 
14692
14696
  case 1:
14693
14697
  e.sent(), e.label = 2;
@@ -14699,13 +14703,13 @@ function zu(t) {
14699
14703
  }));
14700
14704
  }
14701
14705
 
14702
- function Qu(t) {
14706
+ function Qa(t) {
14703
14707
  return n(this, void 0, void 0, (function() {
14704
14708
  return r(this, (function(e) {
14705
14709
  switch (e.label) {
14706
14710
  case 0:
14707
14711
  return t.onlineComponents ? [ 3 /*break*/ , 2 ] : (U("FirestoreClient", "Using default OnlineComponentProvider"),
14708
- [ 4 /*yield*/ , Gu(t, new Mu) ]);
14712
+ [ 4 /*yield*/ , Ga(t, new Ma) ]);
14709
14713
 
14710
14714
  case 1:
14711
14715
  e.sent(), e.label = 2;
@@ -14717,47 +14721,47 @@ function Qu(t) {
14717
14721
  }));
14718
14722
  }
14719
14723
 
14720
- function Wu(t) {
14721
- return zu(t).then((function(t) {
14724
+ function Wa(t) {
14725
+ return za(t).then((function(t) {
14722
14726
  return t.persistence;
14723
14727
  }));
14724
14728
  }
14725
14729
 
14726
- function Hu(t) {
14727
- return zu(t).then((function(t) {
14730
+ function Ha(t) {
14731
+ return za(t).then((function(t) {
14728
14732
  return t.localStore;
14729
14733
  }));
14730
14734
  }
14731
14735
 
14732
- function Yu(t) {
14733
- return Qu(t).then((function(t) {
14736
+ function Ya(t) {
14737
+ return Qa(t).then((function(t) {
14734
14738
  return t.remoteStore;
14735
14739
  }));
14736
14740
  }
14737
14741
 
14738
- function Ju(t) {
14739
- return Qu(t).then((function(t) {
14742
+ function Ja(t) {
14743
+ return Qa(t).then((function(t) {
14740
14744
  return t.syncEngine;
14741
14745
  }));
14742
14746
  }
14743
14747
 
14744
- function Xu(t) {
14748
+ function Xa(t) {
14745
14749
  return n(this, void 0, void 0, (function() {
14746
14750
  var e, n;
14747
14751
  return r(this, (function(r) {
14748
14752
  switch (r.label) {
14749
14753
  case 0:
14750
- return [ 4 /*yield*/ , Qu(t) ];
14754
+ return [ 4 /*yield*/ , Qa(t) ];
14751
14755
 
14752
14756
  case 1:
14753
- return e = r.sent(), [ 2 /*return*/ , ((n = e.eventManager).onListen = eu.bind(null, e.syncEngine),
14754
- n.onUnlisten = ru.bind(null, e.syncEngine), n) ];
14757
+ return e = r.sent(), [ 2 /*return*/ , ((n = e.eventManager).onListen = ea.bind(null, e.syncEngine),
14758
+ n.onUnlisten = ra.bind(null, e.syncEngine), n) ];
14755
14759
  }
14756
14760
  }));
14757
14761
  }));
14758
14762
  }
14759
14763
 
14760
- /** Enables the network connection and re-enqueues all pending operations. */ function $u(t, e, i) {
14764
+ /** Enables the network connection and re-enqueues all pending operations. */ function $a(t, e, i) {
14761
14765
  var o = this;
14762
14766
  void 0 === i && (i = {});
14763
14767
  var s = new J;
@@ -14768,15 +14772,15 @@ function Xu(t) {
14768
14772
  switch (r.label) {
14769
14773
  case 0:
14770
14774
  return n = function(t, e, n, r, i) {
14771
- var o = new Vu({
14775
+ var o = new Va({
14772
14776
  next: function(o) {
14773
14777
  // Remove query first before passing event to user to avoid
14774
14778
  // user actions affecting the now stale query.
14775
14779
  e.enqueueAndForget((function() {
14776
14780
  return Us(t, s);
14777
14781
  }));
14778
- var u = o.docs.has(n);
14779
- !u && o.fromCache ?
14782
+ var a = o.docs.has(n);
14783
+ !a && o.fromCache ?
14780
14784
  // TODO(dimond): If we're online and the document doesn't
14781
14785
  // exist then we resolve with a doc.exists set to false. If
14782
14786
  // we're offline however, we reject the Promise in this
@@ -14784,7 +14788,7 @@ function Xu(t) {
14784
14788
  // the server so we can deliver that even when you're
14785
14789
  // offline 2) Actually reject the Promise in the online case
14786
14790
  // if the document doesn't exist.
14787
- i.reject(new Y(H.UNAVAILABLE, "Failed to get document because the client is offline.")) : u && o.fromCache && r && "server" === r.source ? i.reject(new Y(H.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')) : i.resolve(o);
14791
+ i.reject(new Y(H.UNAVAILABLE, "Failed to get document because the client is offline.")) : a && o.fromCache && r && "server" === r.source ? i.reject(new Y(H.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')) : i.resolve(o);
14788
14792
  },
14789
14793
  error: function(t) {
14790
14794
  return i.reject(t);
@@ -14794,7 +14798,7 @@ function Xu(t) {
14794
14798
  wo: !0
14795
14799
  });
14796
14800
  return qs(t, s);
14797
- }, [ 4 /*yield*/ , Xu(t) ];
14801
+ }, [ 4 /*yield*/ , Xa(t) ];
14798
14802
 
14799
14803
  case 1:
14800
14804
  return [ 2 /*return*/ , n.apply(void 0, [ r.sent(), t.asyncQueue, e, i, s ]) ];
@@ -14804,7 +14808,7 @@ function Xu(t) {
14804
14808
  })), s.promise;
14805
14809
  }
14806
14810
 
14807
- function Zu(t, e, i) {
14811
+ function Za(t, e, i) {
14808
14812
  var o = this;
14809
14813
  void 0 === i && (i = {});
14810
14814
  var s = new J;
@@ -14815,7 +14819,7 @@ function Zu(t, e, i) {
14815
14819
  switch (r.label) {
14816
14820
  case 0:
14817
14821
  return n = function(t, e, n, r, i) {
14818
- var o = new Vu({
14822
+ var o = new Va({
14819
14823
  next: function(n) {
14820
14824
  // Remove query first before passing event to user to avoid
14821
14825
  // user actions affecting the now stale query.
@@ -14831,7 +14835,7 @@ function Zu(t, e, i) {
14831
14835
  wo: !0
14832
14836
  });
14833
14837
  return qs(t, s);
14834
- }, [ 4 /*yield*/ , Xu(t) ];
14838
+ }, [ 4 /*yield*/ , Xa(t) ];
14835
14839
 
14836
14840
  case 1:
14837
14841
  return [ 2 /*return*/ , n.apply(void 0, [ r.sent(), t.asyncQueue, e, i, s ]) ];
@@ -14841,7 +14845,7 @@ function Zu(t, e, i) {
14841
14845
  })), s.promise;
14842
14846
  }
14843
14847
 
14844
- var ta =
14848
+ var tu =
14845
14849
  /**
14846
14850
  * Constructs a DatabaseInfo using the provided host, databaseId and
14847
14851
  * persistenceKey.
@@ -14859,10 +14863,10 @@ var ta =
14859
14863
  * @param useFetchStreams Whether to use the Fetch API instead of
14860
14864
  * XMLHTTPRequest
14861
14865
  */
14862
- function(t, e, n, r, i, o, s, u) {
14866
+ function(t, e, n, r, i, o, s, a) {
14863
14867
  this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = r, this.ssl = i,
14864
- this.forceLongPolling = o, this.autoDetectLongPolling = s, this.useFetchStreams = u;
14865
- }, ea = /** @class */ function() {
14868
+ this.forceLongPolling = o, this.autoDetectLongPolling = s, this.useFetchStreams = a;
14869
+ }, eu = /** @class */ function() {
14866
14870
  function t(t, e) {
14867
14871
  this.projectId = t, this.database = e || "(default)";
14868
14872
  }
@@ -14875,7 +14879,7 @@ function(t, e, n, r, i, o, s, u) {
14875
14879
  }), t.prototype.isEqual = function(e) {
14876
14880
  return e instanceof t && e.projectId === this.projectId && e.database === this.database;
14877
14881
  }, t;
14878
- }(), na = new Map;
14882
+ }(), nu = new Map;
14879
14883
 
14880
14884
  /** The default database name for a project. */
14881
14885
  /**
@@ -14902,28 +14906,28 @@ function(t, e, n, r, i, o, s, u) {
14902
14906
  * See the License for the specific language governing permissions and
14903
14907
  * limitations under the License.
14904
14908
  */
14905
- function ra(t, e, n) {
14909
+ function ru(t, e, n) {
14906
14910
  if (!n) throw new Y(H.INVALID_ARGUMENT, "Function " + t + "() cannot be called with an empty " + e + ".");
14907
14911
  }
14908
14912
 
14909
14913
  /**
14910
14914
  * Validates that two boolean options are not set at the same time.
14911
14915
  * @internal
14912
- */ function ia(t, e, n, r) {
14916
+ */ function iu(t, e, n, r) {
14913
14917
  if (!0 === e && !0 === r) throw new Y(H.INVALID_ARGUMENT, t + " and " + n + " cannot be used together.");
14914
14918
  }
14915
14919
 
14916
14920
  /**
14917
14921
  * Validates that `path` refers to a document (indicated by the fact it contains
14918
14922
  * an even numbers of segments).
14919
- */ function oa(t) {
14923
+ */ function ou(t) {
14920
14924
  if (!Pt.isDocumentKey(t)) throw new Y(H.INVALID_ARGUMENT, "Invalid document reference. Document references must have an even number of segments, but " + t + " has " + t.length + ".");
14921
14925
  }
14922
14926
 
14923
14927
  /**
14924
14928
  * Validates that `path` refers to a collection (indicated by the fact it
14925
14929
  * contains an odd numbers of segments).
14926
- */ function sa(t) {
14930
+ */ function su(t) {
14927
14931
  if (Pt.isDocumentKey(t)) throw new Y(H.INVALID_ARGUMENT, "Invalid collection reference. Collection references must have an odd number of segments, but " + t + " has " + t.length + ".");
14928
14932
  }
14929
14933
 
@@ -14931,7 +14935,7 @@ function ra(t, e, n) {
14931
14935
  * Returns true if it's a non-null object without a custom prototype
14932
14936
  * (i.e. excludes Array, Date, etc.).
14933
14937
  */
14934
- /** Returns a string describing the type / value of the provided input. */ function ua(t) {
14938
+ /** Returns a string describing the type / value of the provided input. */ function au(t) {
14935
14939
  if (void 0 === t) return "undefined";
14936
14940
  if (null === t) return "null";
14937
14941
  if ("string" == typeof t) return t.length > 20 && (t = t.substring(0, 20) + "..."),
@@ -14949,7 +14953,7 @@ function ra(t, e, n) {
14949
14953
  return "function" == typeof t ? "a function" : G();
14950
14954
  }
14951
14955
 
14952
- function aa(t,
14956
+ function uu(t,
14953
14957
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14954
14958
  e) {
14955
14959
  if ("_delegate" in t && (
@@ -14957,13 +14961,13 @@ e) {
14957
14961
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14958
14962
  t = t._delegate), !(t instanceof e)) {
14959
14963
  if (e.name === t.constructor.name) throw new Y(H.INVALID_ARGUMENT, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
14960
- var n = ua(t);
14964
+ var n = au(t);
14961
14965
  throw new Y(H.INVALID_ARGUMENT, "Expected type '" + e.name + "', but it was: " + n);
14962
14966
  }
14963
14967
  return t;
14964
14968
  }
14965
14969
 
14966
- function ca(t, e) {
14970
+ function cu(t, e) {
14967
14971
  if (e <= 0) throw new Y(H.INVALID_ARGUMENT, "Function " + t + "() requires a positive number, but it was: " + e + ".");
14968
14972
  }
14969
14973
 
@@ -14988,7 +14992,7 @@ function ca(t, e) {
14988
14992
  * A concrete type describing all the values that can be applied via a
14989
14993
  * user-supplied `FirestoreSettings` object. This is a separate type so that
14990
14994
  * defaults can be supplied and the value can be checked for equality.
14991
- */ var ha = /** @class */ function() {
14995
+ */ var hu = /** @class */ function() {
14992
14996
  function t(t) {
14993
14997
  var e;
14994
14998
  if (void 0 === t.host) {
@@ -15001,23 +15005,23 @@ function ca(t, e) {
15001
15005
  this.cacheSizeBytes = t.cacheSizeBytes;
15002
15006
  }
15003
15007
  this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling,
15004
- this.useFetchStreams = !!t.useFetchStreams, ia("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling);
15008
+ this.useFetchStreams = !!t.useFetchStreams, iu("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling);
15005
15009
  }
15006
15010
  return t.prototype.isEqual = function(t) {
15007
15011
  return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;
15008
15012
  }, t;
15009
- }(), fa = /** @class */ function() {
15013
+ }(), fu = /** @class */ function() {
15010
15014
  /** @hideconstructor */
15011
15015
  function t(t, e, n) {
15012
15016
  this._authCredentials = e, this._appCheckCredentials = n,
15013
15017
  /**
15014
15018
  * Whether it's a Firestore or Firestore Lite instance.
15015
15019
  */
15016
- this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new ha({}),
15017
- this._settingsFrozen = !1, t instanceof ea ? this._databaseId = t : (this._app = t,
15020
+ this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new hu({}),
15021
+ this._settingsFrozen = !1, t instanceof eu ? this._databaseId = t : (this._app = t,
15018
15022
  this._databaseId = function(t) {
15019
15023
  if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new Y(H.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
15020
- return new ea(t.options.projectId);
15024
+ return new eu(t.options.projectId);
15021
15025
  }(t));
15022
15026
  }
15023
15027
  return Object.defineProperty(t.prototype, "app", {
@@ -15045,7 +15049,7 @@ function ca(t, e) {
15045
15049
  configurable: !0
15046
15050
  }), t.prototype._setSettings = function(t) {
15047
15051
  if (this._settingsFrozen) throw new Y(H.FAILED_PRECONDITION, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
15048
- this._settings = new ha(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
15052
+ this._settings = new hu(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
15049
15053
  if (!t) return new $;
15050
15054
  switch (t.type) {
15051
15055
  case "gapi":
@@ -15087,8 +15091,8 @@ function ca(t, e) {
15087
15091
  * Removes all components associated with the provided instance. Must be called
15088
15092
  * when the `Firestore` instance is terminated.
15089
15093
  */
15090
- return t = this, (e = na.get(t)) && (U("ComponentProvider", "Removing Datastore"),
15091
- na.delete(t), e.terminate()), Promise.resolve();
15094
+ return t = this, (e = nu.get(t)) && (U("ComponentProvider", "Removing Datastore"),
15095
+ nu.delete(t), e.terminate()), Promise.resolve();
15092
15096
  var t, e;
15093
15097
  }, t;
15094
15098
  }();
@@ -15113,25 +15117,25 @@ function ca(t, e) {
15113
15117
  * The Cloud Firestore service interface.
15114
15118
  *
15115
15119
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
15116
- */ function la(t, e, n, r) {
15120
+ */ function lu(t, e, n, r) {
15117
15121
  var i;
15118
15122
  void 0 === r && (r = {});
15119
- var o = (t = aa(t, fa))._getSettings();
15123
+ var o = (t = uu(t, fu))._getSettings();
15120
15124
  if ("firestore.googleapis.com" !== o.host && o.host !== e && j("Host has been set in both settings() and useEmulator(), emulator host will be used"),
15121
15125
  t._setSettings(Object.assign(Object.assign({}, o), {
15122
15126
  host: e + ":" + n,
15123
15127
  ssl: !1
15124
15128
  })), r.mockUserToken) {
15125
- var s, u;
15126
- if ("string" == typeof r.mockUserToken) s = r.mockUserToken, u = O.MOCK_USER; else {
15129
+ var s, a;
15130
+ if ("string" == typeof r.mockUserToken) s = r.mockUserToken, a = O.MOCK_USER; else {
15127
15131
  // Let createMockUserToken validate first (catches common mistakes like
15128
15132
  // invalid field "uid" and missing field "sub" / "user_id".)
15129
15133
  s = T(r.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);
15130
- var a = r.mockUserToken.sub || r.mockUserToken.user_id;
15131
- if (!a) throw new Y(H.INVALID_ARGUMENT, "mockUserToken must contain 'sub' or 'user_id' field!");
15132
- u = new O(a);
15134
+ var u = r.mockUserToken.sub || r.mockUserToken.user_id;
15135
+ if (!u) throw new Y(H.INVALID_ARGUMENT, "mockUserToken must contain 'sub' or 'user_id' field!");
15136
+ a = new O(u);
15133
15137
  }
15134
- t._authCredentials = new Z(new X(s, u));
15138
+ t._authCredentials = new Z(new X(s, a));
15135
15139
  }
15136
15140
  }
15137
15141
 
@@ -15155,7 +15159,7 @@ function ca(t, e) {
15155
15159
  * A `DocumentReference` refers to a document location in a Firestore database
15156
15160
  * and can be used to write, read, or listen to the location. The document at
15157
15161
  * the referenced location may or may not exist.
15158
- */ var da = /** @class */ function() {
15162
+ */ var du = /** @class */ function() {
15159
15163
  /** @hideconstructor */
15160
15164
  function t(t,
15161
15165
  /**
@@ -15196,14 +15200,14 @@ function ca(t, e) {
15196
15200
  * The collection this `DocumentReference` belongs to.
15197
15201
  */
15198
15202
  get: function() {
15199
- return new ya(this.firestore, this.converter, this._key.path.popLast());
15203
+ return new yu(this.firestore, this.converter, this._key.path.popLast());
15200
15204
  },
15201
15205
  enumerable: !1,
15202
15206
  configurable: !0
15203
15207
  }), t.prototype.withConverter = function(e) {
15204
15208
  return new t(this.firestore, e, this._key);
15205
15209
  }, t;
15206
- }(), pa = /** @class */ function() {
15210
+ }(), pu = /** @class */ function() {
15207
15211
  // This is the lite version of the Query class in the main SDK.
15208
15212
  /** @hideconstructor protected */
15209
15213
  function t(t,
@@ -15218,7 +15222,7 @@ function ca(t, e) {
15218
15222
  return t.prototype.withConverter = function(e) {
15219
15223
  return new t(this.firestore, e, this._query);
15220
15224
  }, t;
15221
- }(), ya = /** @class */ function(e) {
15225
+ }(), yu = /** @class */ function(e) {
15222
15226
  /** @hideconstructor */
15223
15227
  function n(t, n, r) {
15224
15228
  var i = this;
@@ -15249,7 +15253,7 @@ function ca(t, e) {
15249
15253
  */
15250
15254
  get: function() {
15251
15255
  var t = this._path.popLast();
15252
- return t.isEmpty() ? null : new da(this.firestore,
15256
+ return t.isEmpty() ? null : new du(this.firestore,
15253
15257
  /* converter= */ null, new Pt(t));
15254
15258
  },
15255
15259
  enumerable: !1,
@@ -15257,20 +15261,20 @@ function ca(t, e) {
15257
15261
  }), n.prototype.withConverter = function(t) {
15258
15262
  return new n(this.firestore, t, this._path);
15259
15263
  }, n;
15260
- }(pa);
15264
+ }(pu);
15261
15265
 
15262
15266
  /**
15263
15267
  * A `Query` refers to a query which you can read or listen to. You can also
15264
15268
  * construct refined `Query` objects by adding filters and ordering.
15265
- */ function va(t, n) {
15269
+ */ function vu(t, n) {
15266
15270
  for (var r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
15267
- if (t = I(t), ra("collection", "path", n), t instanceof fa) {
15271
+ if (t = I(t), ru("collection", "path", n), t instanceof fu) {
15268
15272
  var o = gt.fromString.apply(gt, e([ n ], r));
15269
- return sa(o), new ya(t, /* converter= */ null, o);
15273
+ return su(o), new yu(t, /* converter= */ null, o);
15270
15274
  }
15271
- if (!(t instanceof da || t instanceof ya)) throw new Y(H.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
15275
+ if (!(t instanceof du || t instanceof yu)) throw new Y(H.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
15272
15276
  var s = t._path.child(gt.fromString.apply(gt, e([ n ], r)));
15273
- return sa(s), new ya(t.firestore,
15277
+ return su(s), new yu(t.firestore,
15274
15278
  /* converter= */ null, s);
15275
15279
  }
15276
15280
 
@@ -15286,9 +15290,9 @@ function ca(t, e) {
15286
15290
  * collection or subcollection with this ID as the last segment of its path
15287
15291
  * will be included. Cannot contain a slash.
15288
15292
  * @returns The created `Query`.
15289
- */ function ma(t, e) {
15290
- if (t = aa(t, fa), ra("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new Y(H.INVALID_ARGUMENT, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
15291
- return new pa(t,
15293
+ */ function mu(t, e) {
15294
+ if (t = uu(t, fu), ru("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new Y(H.INVALID_ARGUMENT, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
15295
+ return new pu(t,
15292
15296
  /* converter= */ null,
15293
15297
  /**
15294
15298
  * Creates a new Query for a collection group query that matches all documents
@@ -15299,19 +15303,19 @@ function ca(t, e) {
15299
15303
  }(e));
15300
15304
  }
15301
15305
 
15302
- function ga(t, n) {
15306
+ function gu(t, n) {
15303
15307
  for (var r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
15304
15308
  if (t = I(t),
15305
15309
  // We allow omission of 'pathString' but explicitly prohibit passing in both
15306
15310
  // 'undefined' and 'null'.
15307
- 1 === arguments.length && (n = at.A()), ra("doc", "path", n), t instanceof fa) {
15311
+ 1 === arguments.length && (n = ut.A()), ru("doc", "path", n), t instanceof fu) {
15308
15312
  var o = gt.fromString.apply(gt, e([ n ], r));
15309
- return oa(o), new da(t,
15313
+ return ou(o), new du(t,
15310
15314
  /* converter= */ null, new Pt(o));
15311
15315
  }
15312
- if (!(t instanceof da || t instanceof ya)) throw new Y(H.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
15316
+ if (!(t instanceof du || t instanceof yu)) throw new Y(H.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
15313
15317
  var s = t._path.child(gt.fromString.apply(gt, e([ n ], r)));
15314
- return oa(s), new da(t.firestore, t instanceof ya ? t.converter : null, new Pt(s));
15318
+ return ou(s), new du(t.firestore, t instanceof yu ? t.converter : null, new Pt(s));
15315
15319
  }
15316
15320
 
15317
15321
  /**
@@ -15321,8 +15325,8 @@ function ga(t, n) {
15321
15325
  * @param right - A reference to compare.
15322
15326
  * @returns true if the references point to the same location in the same
15323
15327
  * Firestore database.
15324
- */ function wa(t, e) {
15325
- return t = I(t), e = I(e), (t instanceof da || t instanceof ya) && (e instanceof da || e instanceof ya) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
15328
+ */ function wu(t, e) {
15329
+ return t = I(t), e = I(e), (t instanceof du || t instanceof yu) && (e instanceof du || e instanceof yu) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
15326
15330
  /**
15327
15331
  * Returns true if the provided queries point to the same collection and apply
15328
15332
  * the same constraints.
@@ -15334,8 +15338,8 @@ function ga(t, n) {
15334
15338
  */;
15335
15339
  }
15336
15340
 
15337
- function ba(t, e) {
15338
- return t = I(t), e = I(e), t instanceof pa && e instanceof pa && t.firestore === e.firestore && Ne(t._query, e._query) && t.converter === e.converter
15341
+ function bu(t, e) {
15342
+ return t = I(t), e = I(e), t instanceof pu && e instanceof pu && t.firestore === e.firestore && Ne(t._query, e._query) && t.converter === e.converter
15339
15343
  /**
15340
15344
  * @license
15341
15345
  * Copyright 2020 Google LLC
@@ -15354,7 +15358,7 @@ function ba(t, e) {
15354
15358
  */;
15355
15359
  }
15356
15360
 
15357
- var Ia = /** @class */ function() {
15361
+ var Iu = /** @class */ function() {
15358
15362
  function t() {
15359
15363
  var t = this;
15360
15364
  // The last promise in the queue.
@@ -15585,7 +15589,7 @@ var Ia = /** @class */ function() {
15585
15589
  }, t;
15586
15590
  }();
15587
15591
 
15588
- function Ta(t) {
15592
+ function Tu(t) {
15589
15593
  /**
15590
15594
  * Returns true if obj is an object and contains at least one of the specified
15591
15595
  * methods.
@@ -15600,7 +15604,7 @@ function Ta(t) {
15600
15604
  }(t);
15601
15605
  }
15602
15606
 
15603
- var Ea = /** @class */ function() {
15607
+ var Eu = /** @class */ function() {
15604
15608
  function t() {
15605
15609
  this._progressObserver = {}, this._taskCompletionResolver = new J, this._lastProgress = {
15606
15610
  taskState: "Running",
@@ -15672,23 +15676,23 @@ var Ea = /** @class */ function() {
15672
15676
  t.prototype._updateProgress = function(t) {
15673
15677
  this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t);
15674
15678
  }, t;
15675
- }(), Sa = -1, _a = /** @class */ function(e) {
15679
+ }(), Su = -1, _u = /** @class */ function(e) {
15676
15680
  /** @hideconstructor */
15677
15681
  function n(t, n, r) {
15678
15682
  var i = this;
15679
15683
  /**
15680
15684
  * Whether it's a {@link Firestore} or Firestore Lite instance.
15681
15685
  */
15682
- return (i = e.call(this, t, n, r) || this).type = "firestore", i._queue = new Ia,
15686
+ return (i = e.call(this, t, n, r) || this).type = "firestore", i._queue = new Iu,
15683
15687
  i._persistenceKey = "name" in t ? t.name : "[DEFAULT]", i;
15684
15688
  }
15685
15689
  return t(n, e), n.prototype._terminate = function() {
15686
15690
  return this._firestoreClient ||
15687
15691
  // The client must be initialized to ensure that all subsequent API
15688
15692
  // usage throws an exception.
15689
- Na(this), this._firestoreClient.terminate();
15693
+ Nu(this), this._firestoreClient.terminate();
15690
15694
  }, n;
15691
- }(fa);
15695
+ }(fu);
15692
15696
 
15693
15697
  /**
15694
15698
  * @license
@@ -15718,7 +15722,7 @@ var Ea = /** @class */ function() {
15718
15722
  * @param settings - A settings object to configure the {@link Firestore} instance.
15719
15723
  * @returns A newly initialized {@link Firestore} instance.
15720
15724
  */
15721
- function Aa(t, e) {
15725
+ function Au(t, e) {
15722
15726
  var n = _getProvider(t, "firestore");
15723
15727
  if (n.isInitialized()) {
15724
15728
  var r = n.getImmediate(), i = n.getOptions();
@@ -15739,21 +15743,21 @@ function Aa(t, e) {
15739
15743
  * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
15740
15744
  * instance is associated with.
15741
15745
  * @returns The {@link Firestore} instance of the provided app.
15742
- */ function ka(t) {
15743
- return void 0 === t && (t = u()), _getProvider(t, "firestore").getImmediate();
15746
+ */ function ku(t) {
15747
+ return void 0 === t && (t = a()), _getProvider(t, "firestore").getImmediate();
15744
15748
  }
15745
15749
 
15746
15750
  /**
15747
15751
  * @internal
15748
- */ function Da(t) {
15749
- return t._firestoreClient || Na(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;
15752
+ */ function Du(t) {
15753
+ return t._firestoreClient || Nu(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;
15750
15754
  }
15751
15755
 
15752
- function Na(t) {
15756
+ function Nu(t) {
15753
15757
  var e, n = t._freezeSettings(), r = function(t, e, n, r) {
15754
- return new ta(t, e, n, r.host, r.ssl, r.experimentalForceLongPolling, r.experimentalAutoDetectLongPolling, r.useFetchStreams);
15758
+ return new tu(t, e, n, r.host, r.ssl, r.experimentalForceLongPolling, r.experimentalAutoDetectLongPolling, r.useFetchStreams);
15755
15759
  }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || "", t._persistenceKey, n);
15756
- t._firestoreClient = new ju(t._authCredentials, t._appCheckCredentials, t._queue, r);
15760
+ t._firestoreClient = new ja(t._authCredentials, t._appCheckCredentials, t._queue, r);
15757
15761
  }
15758
15762
 
15759
15763
  /**
@@ -15778,10 +15782,10 @@ function Na(t) {
15778
15782
  * @param persistenceSettings - Optional settings object to configure
15779
15783
  * persistence.
15780
15784
  * @returns A `Promise` that represents successfully enabling persistent storage.
15781
- */ function Ca(t, e) {
15782
- Ua(t = aa(t, _a));
15783
- var n = Da(t), r = t._freezeSettings(), i = new Mu;
15784
- return Ra(n, i, new Pu(i, r.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));
15785
+ */ function Cu(t, e) {
15786
+ Uu(t = uu(t, _u));
15787
+ var n = Du(t), r = t._freezeSettings(), i = new Ma;
15788
+ return Ru(n, i, new Pa(i, r.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));
15785
15789
  }
15786
15790
 
15787
15791
  /**
@@ -15805,10 +15809,10 @@ function Na(t) {
15805
15809
  * @param firestore - The {@link Firestore} instance to enable persistence for.
15806
15810
  * @returns A `Promise` that represents successfully enabling persistent
15807
15811
  * storage.
15808
- */ function xa(t) {
15809
- Ua(t = aa(t, _a));
15810
- var e = Da(t), n = t._freezeSettings(), r = new Mu;
15811
- return Ra(e, r, new Ou(r, n.cacheSizeBytes));
15812
+ */ function xu(t) {
15813
+ Uu(t = uu(t, _u));
15814
+ var e = Du(t), n = t._freezeSettings(), r = new Ma;
15815
+ return Ru(e, r, new Oa(r, n.cacheSizeBytes));
15812
15816
  }
15813
15817
 
15814
15818
  /**
@@ -15816,7 +15820,7 @@ function Na(t) {
15816
15820
  * If the operation fails with a recoverable error (see
15817
15821
  * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected
15818
15822
  * but the client remains usable.
15819
- */ function Ra(t, e, i) {
15823
+ */ function Ru(t, e, i) {
15820
15824
  var o = this, s = new J;
15821
15825
  return t.asyncQueue.enqueue((function() {
15822
15826
  return n(o, void 0, void 0, (function() {
@@ -15824,10 +15828,10 @@ function Na(t) {
15824
15828
  return r(this, (function(r) {
15825
15829
  switch (r.label) {
15826
15830
  case 0:
15827
- return r.trys.push([ 0, 3, , 4 ]), [ 4 /*yield*/ , Ku(t, i) ];
15831
+ return r.trys.push([ 0, 3, , 4 ]), [ 4 /*yield*/ , Ka(t, i) ];
15828
15832
 
15829
15833
  case 1:
15830
- return r.sent(), [ 4 /*yield*/ , Gu(t, e) ];
15834
+ return r.sent(), [ 4 /*yield*/ , Ga(t, e) ];
15831
15835
 
15832
15836
  case 2:
15833
15837
  return r.sent(), s.resolve(), [ 3 /*break*/ , 4 ];
@@ -15857,7 +15861,7 @@ function Na(t) {
15857
15861
  }));
15858
15862
  }
15859
15863
 
15860
- function La(t) {
15864
+ function Lu(t) {
15861
15865
  var e = this;
15862
15866
  if (t._initialized && !t._terminated) throw new Y(H.FAILED_PRECONDITION, "Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");
15863
15867
  var i = new J;
@@ -15912,7 +15916,7 @@ function La(t) {
15912
15916
  */;
15913
15917
  }
15914
15918
 
15915
- function Pa(t) {
15919
+ function Pu(t) {
15916
15920
  return function(t) {
15917
15921
  var e = this, i = new J;
15918
15922
  return t.asyncQueue.enqueueAndForget((function() {
@@ -15921,7 +15925,7 @@ function Pa(t) {
15921
15925
  return r(this, (function(n) {
15922
15926
  switch (n.label) {
15923
15927
  case 0:
15924
- return e = hu, [ 4 /*yield*/ , Ju(t) ];
15928
+ return e = ha, [ 4 /*yield*/ , Ja(t) ];
15925
15929
 
15926
15930
  case 1:
15927
15931
  return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), i ]) ];
@@ -15929,7 +15933,7 @@ function Pa(t) {
15929
15933
  }));
15930
15934
  }));
15931
15935
  })), i.promise;
15932
- }(Da(t = aa(t, _a)));
15936
+ }(Du(t = uu(t, _u)));
15933
15937
  }
15934
15938
 
15935
15939
  /**
@@ -15937,7 +15941,7 @@ function Pa(t) {
15937
15941
  * call to {@link disableNetwork}.
15938
15942
  *
15939
15943
  * @returns A `Promise` that is resolved once the network has been enabled.
15940
- */ function Oa(t) {
15944
+ */ function Ou(t) {
15941
15945
  return function(t) {
15942
15946
  var e = this;
15943
15947
  return t.asyncQueue.enqueue((function() {
@@ -15946,10 +15950,10 @@ function Pa(t) {
15946
15950
  return r(this, (function(r) {
15947
15951
  switch (r.label) {
15948
15952
  case 0:
15949
- return [ 4 /*yield*/ , Wu(t) ];
15953
+ return [ 4 /*yield*/ , Wa(t) ];
15950
15954
 
15951
15955
  case 1:
15952
- return e = r.sent(), [ 4 /*yield*/ , Yu(t) ];
15956
+ return e = r.sent(), [ 4 /*yield*/ , Ya(t) ];
15953
15957
 
15954
15958
  case 2:
15955
15959
  return n = r.sent(), [ 2 /*return*/ , (e.setNetworkEnabled(!0), function(t) {
@@ -15961,7 +15965,7 @@ function Pa(t) {
15961
15965
  }));
15962
15966
  }));
15963
15967
  }
15964
- /** Disables the network connection. Pending operations will not complete. */ (Da(t = aa(t, _a)));
15968
+ /** Disables the network connection. Pending operations will not complete. */ (Du(t = uu(t, _u)));
15965
15969
  }
15966
15970
 
15967
15971
  /**
@@ -15971,7 +15975,7 @@ function Pa(t) {
15971
15975
  * operations will be queued until the network is restored.
15972
15976
  *
15973
15977
  * @returns A `Promise` that is resolved once the network has been disabled.
15974
- */ function Ma(t) {
15978
+ */ function Mu(t) {
15975
15979
  return function(t) {
15976
15980
  var e = this;
15977
15981
  return t.asyncQueue.enqueue((function() {
@@ -15980,10 +15984,10 @@ function Pa(t) {
15980
15984
  return r(this, (function(o) {
15981
15985
  switch (o.label) {
15982
15986
  case 0:
15983
- return [ 4 /*yield*/ , Wu(t) ];
15987
+ return [ 4 /*yield*/ , Wa(t) ];
15984
15988
 
15985
15989
  case 1:
15986
- return e = o.sent(), [ 4 /*yield*/ , Yu(t) ];
15990
+ return e = o.sent(), [ 4 /*yield*/ , Ya(t) ];
15987
15991
 
15988
15992
  case 2:
15989
15993
  return i = o.sent(), [ 2 /*return*/ , (e.setNetworkEnabled(!1), function(t) {
@@ -15992,7 +15996,7 @@ function Pa(t) {
15992
15996
  return r(this, (function(n) {
15993
15997
  switch (n.label) {
15994
15998
  case 0:
15995
- return (e = W(t)).Gr.add(0 /* UserDisabled */), [ 4 /*yield*/ , us(e) ];
15999
+ return (e = W(t)).Gr.add(0 /* UserDisabled */), [ 4 /*yield*/ , as(e) ];
15996
16000
 
15997
16001
  case 1:
15998
16002
  return n.sent(),
@@ -16011,7 +16015,7 @@ function Pa(t) {
16011
16015
  * Returns a Promise that resolves when all writes that were pending at the time
16012
16016
  * this method was called received server acknowledgement. An acknowledgement
16013
16017
  * can be either acceptance or rejection.
16014
- */ (Da(t = aa(t, _a)));
16018
+ */ (Du(t = uu(t, _u)));
16015
16019
  }
16016
16020
 
16017
16021
  /**
@@ -16035,8 +16039,8 @@ function Pa(t) {
16035
16039
  *
16036
16040
  * @returns A `Promise` that is resolved when the instance has been successfully
16037
16041
  * terminated.
16038
- */ function Fa(t) {
16039
- return a(t.app, "firestore"), t._delete()
16042
+ */ function Fu(t) {
16043
+ return u(t.app, "firestore"), t._delete()
16040
16044
  /**
16041
16045
  * Loads a Firestore bundle into the local cache.
16042
16046
  *
@@ -16050,15 +16054,15 @@ function Pa(t) {
16050
16054
  */;
16051
16055
  }
16052
16056
 
16053
- function Va(t, e) {
16054
- var i = Da(t = aa(t, _a)), o = new Ea;
16057
+ function Vu(t, e) {
16058
+ var i = Du(t = uu(t, _u)), o = new Eu;
16055
16059
  return function(t, e, i, o) {
16056
- var s = this, u = function(t, e) {
16060
+ var s = this, a = function(t, e) {
16057
16061
  return function(t, e) {
16058
- return new qu(t, e);
16062
+ return new qa(t, e);
16059
16063
  }(function(t, e) {
16060
- if (t instanceof Uint8Array) return Fu(t, e);
16061
- if (t instanceof ArrayBuffer) return Fu(new Uint8Array(t), e);
16064
+ if (t instanceof Uint8Array) return Fa(t, e);
16065
+ if (t instanceof ArrayBuffer) return Fa(new Uint8Array(t), e);
16062
16066
  if (t instanceof ReadableStream) return t.getReader();
16063
16067
  throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream");
16064
16068
  }("string" == typeof t ? (new TextEncoder).encode(t) : t), e);
@@ -16069,10 +16073,10 @@ function Va(t, e) {
16069
16073
  return r(this, (function(n) {
16070
16074
  switch (n.label) {
16071
16075
  case 0:
16072
- return e = Ru, [ 4 /*yield*/ , Ju(t) ];
16076
+ return e = Ra, [ 4 /*yield*/ , Ja(t) ];
16073
16077
 
16074
16078
  case 1:
16075
- return e.apply(void 0, [ n.sent(), u, o ]), [ 2 /*return*/ ];
16079
+ return e.apply(void 0, [ n.sent(), a, o ]), [ 2 /*return*/ ];
16076
16080
  }
16077
16081
  }));
16078
16082
  }));
@@ -16092,7 +16096,7 @@ function Va(t, e) {
16092
16096
  */;
16093
16097
  }
16094
16098
 
16095
- function qa(t, e) {
16099
+ function qu(t, e) {
16096
16100
  return function(t, e) {
16097
16101
  var i = this;
16098
16102
  return t.asyncQueue.enqueue((function() {
@@ -16106,7 +16110,7 @@ function qa(t, e) {
16106
16110
  return n.persistence.runTransaction("Get named query", "readonly", (function(t) {
16107
16111
  return n.Ye.getNamedQuery(t, e);
16108
16112
  }));
16109
- }, [ 4 /*yield*/ , Hu(t) ];
16113
+ }, [ 4 /*yield*/ , Ha(t) ];
16110
16114
 
16111
16115
  case 1:
16112
16116
  return [ 2 /*return*/ , n.apply(void 0, [ r.sent(), e ]) ];
@@ -16114,12 +16118,12 @@ function qa(t, e) {
16114
16118
  }));
16115
16119
  }));
16116
16120
  }));
16117
- }(Da(t = aa(t, _a)), e).then((function(e) {
16118
- return e ? new pa(t, null, e.query) : null;
16121
+ }(Du(t = uu(t, _u)), e).then((function(e) {
16122
+ return e ? new pu(t, null, e.query) : null;
16119
16123
  }));
16120
16124
  }
16121
16125
 
16122
- function Ua(t) {
16126
+ function Uu(t) {
16123
16127
  if (t._initialized || t._terminated) throw new Y(H.FAILED_PRECONDITION, "Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.");
16124
16128
  }
16125
16129
 
@@ -16162,7 +16166,7 @@ function Ua(t) {
16162
16166
  *
16163
16167
  * Create a `FieldPath` by providing field names. If more than one field
16164
16168
  * name is provided, the path will point to a nested field in a document.
16165
- */ var Ba = /** @class */ function() {
16169
+ */ var Bu = /** @class */ function() {
16166
16170
  /**
16167
16171
  * Creates a `FieldPath` from the provided field names. If more than one field
16168
16172
  * name is provided, the path will point to a nested field in a document.
@@ -16187,8 +16191,8 @@ function Ua(t) {
16187
16191
  /**
16188
16192
  * Returns a special sentinel `FieldPath` to refer to the ID of a document.
16189
16193
  * It can be used in queries to sort or filter by the document ID.
16190
- */ function ja() {
16191
- return new Ba("__name__");
16194
+ */ function ju() {
16195
+ return new Bu("__name__");
16192
16196
  }
16193
16197
 
16194
16198
  /**
@@ -16209,7 +16213,7 @@ function Ua(t) {
16209
16213
  */
16210
16214
  /**
16211
16215
  * An immutable object representing an array of bytes.
16212
- */ var Ka = /** @class */ function() {
16216
+ */ var Ku = /** @class */ function() {
16213
16217
  /** @hideconstructor */
16214
16218
  function t(t) {
16215
16219
  this._byteString = t;
@@ -16267,14 +16271,14 @@ function Ua(t) {
16267
16271
  t.prototype.isEqual = function(t) {
16268
16272
  return this._byteString.isEqual(t._byteString);
16269
16273
  }, t;
16270
- }(), Ga =
16274
+ }(), Gu =
16271
16275
  /**
16272
16276
  * @param _methodName - The public API endpoint that returns this class.
16273
16277
  * @hideconstructor
16274
16278
  */
16275
16279
  function(t) {
16276
16280
  this._methodName = t;
16277
- }, za = /** @class */ function() {
16281
+ }, zu = /** @class */ function() {
16278
16282
  /**
16279
16283
  * Creates a new immutable `GeoPoint` object with the provided latitude and
16280
16284
  * longitude values.
@@ -16327,21 +16331,21 @@ function(t) {
16327
16331
  t.prototype._compareTo = function(t) {
16328
16332
  return ct(this._lat, t._lat) || ct(this._long, t._long);
16329
16333
  }, t;
16330
- }(), Qa = /^__.*__$/, Wa = /** @class */ function() {
16334
+ }(), Qu = /^__.*__$/, Wu = /** @class */ function() {
16331
16335
  function t(t, e, n) {
16332
16336
  this.data = t, this.fieldMask = e, this.fieldTransforms = n;
16333
16337
  }
16334
16338
  return t.prototype.toMutation = function(t, e) {
16335
- return null !== this.fieldMask ? new an(t, this.data, this.fieldMask, e, this.fieldTransforms) : new un(t, this.data, e, this.fieldTransforms);
16339
+ return null !== this.fieldMask ? new un(t, this.data, this.fieldMask, e, this.fieldTransforms) : new an(t, this.data, e, this.fieldTransforms);
16336
16340
  }, t;
16337
- }(), Ha = /** @class */ function() {
16341
+ }(), Hu = /** @class */ function() {
16338
16342
  function t(t,
16339
16343
  // The fieldMask does not include document transforms.
16340
16344
  e, n) {
16341
16345
  this.data = t, this.fieldMask = e, this.fieldTransforms = n;
16342
16346
  }
16343
16347
  return t.prototype.toMutation = function(t, e) {
16344
- return new an(t, this.data, this.fieldMask, e, this.fieldTransforms);
16348
+ return new un(t, this.data, this.fieldMask, e, this.fieldTransforms);
16345
16349
  }, t;
16346
16350
  }();
16347
16351
 
@@ -16364,7 +16368,7 @@ function(t) {
16364
16368
  /**
16365
16369
  * Sentinel values that can be used when writing document fields with `set()`
16366
16370
  * or `update()`.
16367
- */ function Ya(t) {
16371
+ */ function Yu(t) {
16368
16372
  switch (t) {
16369
16373
  case 0 /* Set */ :
16370
16374
  // fall through
@@ -16382,7 +16386,7 @@ function(t) {
16382
16386
  }
16383
16387
  }
16384
16388
 
16385
- /** A "context" object passed around while parsing user data. */ var Ja = /** @class */ function() {
16389
+ /** A "context" object passed around while parsing user data. */ var Ju = /** @class */ function() {
16386
16390
  /**
16387
16391
  * Initializes a ParseContext with the given source and path.
16388
16392
  *
@@ -16456,15 +16460,15 @@ function(t) {
16456
16460
  if (this.path) for (var t = 0; t < this.path.length; t++) this.Lc(this.path.get(t));
16457
16461
  }, t.prototype.Lc = function(t) {
16458
16462
  if (0 === t.length) throw this.qc("Document fields must not be empty");
16459
- if (Ya(this.$c) && Qa.test(t)) throw this.qc('Document fields cannot begin and end with "__"');
16463
+ if (Yu(this.$c) && Qu.test(t)) throw this.qc('Document fields cannot begin and end with "__"');
16460
16464
  }, t;
16461
- }(), Xa = /** @class */ function() {
16465
+ }(), Xu = /** @class */ function() {
16462
16466
  function t(t, e, n) {
16463
16467
  this.databaseId = t, this.ignoreUndefinedProperties = e, this.k = n || $o(t)
16464
16468
  /** Creates a new top-level parse context. */;
16465
16469
  }
16466
16470
  return t.prototype.Qc = function(t, e, n, r) {
16467
- return void 0 === r && (r = !1), new Ja({
16471
+ return void 0 === r && (r = !1), new Ju({
16468
16472
  $c: t,
16469
16473
  methodName: e,
16470
16474
  jc: n,
@@ -16478,27 +16482,27 @@ function(t) {
16478
16482
  /**
16479
16483
  * Helper for parsing raw user input (provided via the API) into internal model
16480
16484
  * classes.
16481
- */ function $a(t) {
16485
+ */ function $u(t) {
16482
16486
  var e = t._freezeSettings(), n = $o(t._databaseId);
16483
- return new Xa(t._databaseId, !!e.ignoreUndefinedProperties, n);
16487
+ return new Xu(t._databaseId, !!e.ignoreUndefinedProperties, n);
16484
16488
  }
16485
16489
 
16486
- /** Parse document data from a set() call. */ function Za(t, e, n, r, i, o) {
16490
+ /** Parse document data from a set() call. */ function Zu(t, e, n, r, i, o) {
16487
16491
  void 0 === o && (o = {});
16488
16492
  var s = t.Qc(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
16489
16493
  lc("Data must be an object, but it was:", s, r);
16490
- var u, a, c = hc(r, s);
16491
- if (o.merge) u = new It(s.fieldMask), a = s.fieldTransforms; else if (o.mergeFields) {
16494
+ var a, u, c = hc(r, s);
16495
+ if (o.merge) a = new It(s.fieldMask), u = s.fieldTransforms; else if (o.mergeFields) {
16492
16496
  for (var h = [], f = 0, l = o.mergeFields; f < l.length; f++) {
16493
16497
  var d = dc(e, l[f], n);
16494
16498
  if (!s.contains(d)) throw new Y(H.INVALID_ARGUMENT, "Field '" + d + "' is specified in your field mask but missing from your input data.");
16495
16499
  mc(h, d) || h.push(d);
16496
16500
  }
16497
- u = new It(h), a = s.fieldTransforms.filter((function(t) {
16498
- return u.covers(t.field);
16501
+ a = new It(h), u = s.fieldTransforms.filter((function(t) {
16502
+ return a.covers(t.field);
16499
16503
  }));
16500
- } else u = null, a = s.fieldTransforms;
16501
- return new Wa(new Yt(c), u, a);
16504
+ } else a = null, u = s.fieldTransforms;
16505
+ return new Wu(new Yt(c), a, u);
16502
16506
  }
16503
16507
 
16504
16508
  var tc = /** @class */ function(e) {
@@ -16513,7 +16517,7 @@ var tc = /** @class */ function(e) {
16513
16517
  }, n.prototype.isEqual = function(t) {
16514
16518
  return t instanceof n;
16515
16519
  }, n;
16516
- }(Ga);
16520
+ }(Gu);
16517
16521
 
16518
16522
  /**
16519
16523
  * Creates a child context for parsing SerializableFieldValues.
@@ -16531,7 +16535,7 @@ var tc = /** @class */ function(e) {
16531
16535
  * @param context - The parent context.
16532
16536
  * @param arrayElement - Whether or not the FieldValue has an array.
16533
16537
  */ function ec(t, e, n) {
16534
- return new Ja({
16538
+ return new Ju({
16535
16539
  $c: 3 /* Argument */ ,
16536
16540
  jc: e.settings.jc,
16537
16541
  methodName: t._methodName,
@@ -16548,7 +16552,7 @@ var nc = /** @class */ function(e) {
16548
16552
  }, n.prototype.isEqual = function(t) {
16549
16553
  return t instanceof n;
16550
16554
  }, n;
16551
- }(Ga), rc = /** @class */ function(e) {
16555
+ }(Gu), rc = /** @class */ function(e) {
16552
16556
  function n(t, n) {
16553
16557
  var r = this;
16554
16558
  return (r = e.call(this, t) || this).Wc = n, r;
@@ -16563,7 +16567,7 @@ var nc = /** @class */ function(e) {
16563
16567
  // TODO(mrschmidt): Implement isEquals
16564
16568
  return this === t;
16565
16569
  }, n;
16566
- }(Ga), ic = /** @class */ function(e) {
16570
+ }(Gu), ic = /** @class */ function(e) {
16567
16571
  function n(t, n) {
16568
16572
  var r = this;
16569
16573
  return (r = e.call(this, t) || this).Wc = n, r;
@@ -16578,7 +16582,7 @@ var nc = /** @class */ function(e) {
16578
16582
  // TODO(mrschmidt): Implement isEquals
16579
16583
  return this === t;
16580
16584
  }, n;
16581
- }(Ga), oc = /** @class */ function(e) {
16585
+ }(Gu), oc = /** @class */ function(e) {
16582
16586
  function n(t, n) {
16583
16587
  var r = this;
16584
16588
  return (r = e.call(this, t) || this).Gc = n, r;
@@ -16590,37 +16594,37 @@ var nc = /** @class */ function(e) {
16590
16594
  // TODO(mrschmidt): Implement isEquals
16591
16595
  return this === t;
16592
16596
  }, n;
16593
- }(Ga);
16597
+ }(Gu);
16594
16598
 
16595
16599
  /** Parse update data from an update() call. */ function sc(t, e, n, r) {
16596
16600
  var i = t.Qc(1 /* Update */ , e, n);
16597
16601
  lc("Data must be an object, but it was:", i, r);
16598
16602
  var o = [], s = Yt.empty();
16599
16603
  yt(r, (function(t, r) {
16600
- var u = yc(e, t, n);
16604
+ var a = yc(e, t, n);
16601
16605
  // For Compat types, we have to "extract" the underlying types before
16602
16606
  // performing validation.
16603
16607
  r = I(r);
16604
- var a = i.Bc(u);
16608
+ var u = i.Bc(a);
16605
16609
  if (r instanceof tc)
16606
16610
  // Add it to the field mask, but don't add anything to updateData.
16607
- o.push(u); else {
16608
- var c = cc(r, a);
16609
- null != c && (o.push(u), s.set(u, c));
16611
+ o.push(a); else {
16612
+ var c = cc(r, u);
16613
+ null != c && (o.push(a), s.set(a, c));
16610
16614
  }
16611
16615
  }));
16612
- var u = new It(o);
16613
- return new Ha(s, u, i.fieldTransforms);
16616
+ var a = new It(o);
16617
+ return new Hu(s, a, i.fieldTransforms);
16614
16618
  }
16615
16619
 
16616
- /** Parse update data from a list of field/value arguments. */ function uc(t, e, n, r, i, o) {
16617
- var s = t.Qc(1 /* Update */ , e, n), u = [ dc(e, r, n) ], a = [ i ];
16620
+ /** Parse update data from a list of field/value arguments. */ function ac(t, e, n, r, i, o) {
16621
+ var s = t.Qc(1 /* Update */ , e, n), a = [ dc(e, r, n) ], u = [ i ];
16618
16622
  if (o.length % 2 != 0) throw new Y(H.INVALID_ARGUMENT, "Function " + e + "() needs to be called with an even number of arguments that alternate between field names and values.");
16619
- for (var c = 0; c < o.length; c += 2) u.push(dc(e, o[c])), a.push(o[c + 1]);
16623
+ for (var c = 0; c < o.length; c += 2) a.push(dc(e, o[c])), u.push(o[c + 1]);
16620
16624
  // We iterate in reverse order to pick the last value for a field if the
16621
16625
  // user specified the field multiple times.
16622
- for (var h = [], f = Yt.empty(), l = u.length - 1; l >= 0; --l) if (!mc(h, u[l])) {
16623
- var d = u[l], p = a[l];
16626
+ for (var h = [], f = Yt.empty(), l = a.length - 1; l >= 0; --l) if (!mc(h, a[l])) {
16627
+ var d = a[l], p = u[l];
16624
16628
  // For Compat types, we have to "extract" the underlying types before
16625
16629
  // performing validation.
16626
16630
  p = I(p);
@@ -16633,7 +16637,7 @@ var nc = /** @class */ function(e) {
16633
16637
  }
16634
16638
  }
16635
16639
  var m = new It(h);
16636
- return new Ha(f, m, s.fieldTransforms);
16640
+ return new Hu(f, m, s.fieldTransforms);
16637
16641
  }
16638
16642
 
16639
16643
  /**
@@ -16642,7 +16646,7 @@ var nc = /** @class */ function(e) {
16642
16646
  *
16643
16647
  * @param allowArrays - Whether the query value is an array that may directly
16644
16648
  * contain additional arrays (e.g. the operand of an `in` query).
16645
- */ function ac(t, e, n, r) {
16649
+ */ function uc(t, e, n, r) {
16646
16650
  return void 0 === r && (r = !1), cc(n, t.Qc(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
16647
16651
  }
16648
16652
 
@@ -16659,7 +16663,7 @@ var nc = /** @class */ function(e) {
16659
16663
  // Unwrap the API type from the Compat SDK. This will return the API type
16660
16664
  // from firestore-exp.
16661
16665
  t = I(t))) return lc("Unsupported field value:", e, t), hc(t, e);
16662
- if (t instanceof Ga)
16666
+ if (t instanceof Gu)
16663
16667
  // FieldValues usually parse into transforms (except deleteField())
16664
16668
  // in which case we do not want to include this field in our parsed data
16665
16669
  // (as doing so will overwrite the field directly prior to the transform
@@ -16671,7 +16675,7 @@ var nc = /** @class */ function(e) {
16671
16675
  */
16672
16676
  return function(t, e) {
16673
16677
  // Sentinels are only supported with writes, and not within arrays.
16674
- if (!Ya(e.$c)) throw e.qc(t._methodName + "() can only be used with update() and set()");
16678
+ if (!Yu(e.$c)) throw e.qc(t._methodName + "() can only be used with update() and set()");
16675
16679
  if (!e.path) throw e.qc(t._methodName + "() is not currently supported inside arrays");
16676
16680
  var n = t._toFieldTransform(e);
16677
16681
  n && e.fieldTransforms.push(n);
@@ -16735,23 +16739,23 @@ var nc = /** @class */ function(e) {
16735
16739
  timestampValue: zn(e.k, r)
16736
16740
  };
16737
16741
  }
16738
- if (t instanceof za) return {
16742
+ if (t instanceof zu) return {
16739
16743
  geoPointValue: {
16740
16744
  latitude: t.latitude,
16741
16745
  longitude: t.longitude
16742
16746
  }
16743
16747
  };
16744
- if (t instanceof Ka) return {
16748
+ if (t instanceof Ku) return {
16745
16749
  bytesValue: Qn(e.k, t._byteString)
16746
16750
  };
16747
- if (t instanceof da) {
16751
+ if (t instanceof du) {
16748
16752
  var i = e.databaseId, o = t.firestore._databaseId;
16749
16753
  if (!o.isEqual(i)) throw e.qc("Document reference is for database " + o.projectId + "/" + o.database + " but should be for database " + i.projectId + "/" + i.database);
16750
16754
  return {
16751
16755
  referenceValue: Yn(t.firestore._databaseId || e.databaseId, t._key.path)
16752
16756
  };
16753
16757
  }
16754
- throw e.qc("Unsupported field value: " + ua(t));
16758
+ throw e.qc("Unsupported field value: " + au(t));
16755
16759
  }(t, e);
16756
16760
  }
16757
16761
 
@@ -16771,14 +16775,14 @@ function hc(t, e) {
16771
16775
  }
16772
16776
 
16773
16777
  function fc(t) {
16774
- return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof lt || t instanceof za || t instanceof Ka || t instanceof da || t instanceof Ga);
16778
+ return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof lt || t instanceof zu || t instanceof Ku || t instanceof du || t instanceof Gu);
16775
16779
  }
16776
16780
 
16777
16781
  function lc(t, e, n) {
16778
16782
  if (!fc(n) || !function(t) {
16779
16783
  return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
16780
16784
  }(n)) {
16781
- var r = ua(n);
16785
+ var r = au(n);
16782
16786
  throw "an object" === r ? e.qc(t + " a custom object") : e.qc(t + " " + r);
16783
16787
  }
16784
16788
  }
@@ -16789,7 +16793,7 @@ function lc(t, e, n) {
16789
16793
  if (
16790
16794
  // If required, replace the FieldPath Compat class with with the firestore-exp
16791
16795
  // FieldPath.
16792
- (e = I(e)) instanceof Ba) return e._internalPath;
16796
+ (e = I(e)) instanceof Bu) return e._internalPath;
16793
16797
  if ("string" == typeof e) return yc(t, e);
16794
16798
  throw vc("Field path arguments must be of type string or ", t,
16795
16799
  /* hasConverter= */ !1,
@@ -16813,7 +16817,7 @@ function lc(t, e, n) {
16813
16817
  /* hasConverter= */ !1,
16814
16818
  /* path= */ void 0, r);
16815
16819
  try {
16816
- return (new (Ba.bind.apply(Ba, e([ void 0 ], n.split(".")))))._internalPath;
16820
+ return (new (Bu.bind.apply(Bu, e([ void 0 ], n.split(".")))))._internalPath;
16817
16821
  } catch (e) {
16818
16822
  throw vc("Invalid field path (" + n + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
16819
16823
  /* hasConverter= */ !1,
@@ -16822,11 +16826,11 @@ function lc(t, e, n) {
16822
16826
  }
16823
16827
 
16824
16828
  function vc(t, e, n, r, i) {
16825
- var o = r && !r.isEmpty(), s = void 0 !== i, u = "Function " + e + "() called with invalid data";
16826
- n && (u += " (via `toFirestore()`)");
16827
- var a = "";
16828
- return (o || s) && (a += " (found", o && (a += " in field " + r), s && (a += " in document " + i),
16829
- a += ")"), new Y(H.INVALID_ARGUMENT, (u += ". ") + t + a)
16829
+ var o = r && !r.isEmpty(), s = void 0 !== i, a = "Function " + e + "() called with invalid data";
16830
+ n && (a += " (via `toFirestore()`)");
16831
+ var u = "";
16832
+ return (o || s) && (u += " (found", o && (u += " in field " + r), s && (u += " in document " + i),
16833
+ u += ")"), new Y(H.INVALID_ARGUMENT, (a += ". ") + t + u)
16830
16834
  /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
16831
16835
  }
16832
16836
 
@@ -16881,7 +16885,7 @@ function mc(t, e) {
16881
16885
  * The `DocumentReference` for the document included in the `DocumentSnapshot`.
16882
16886
  */
16883
16887
  get: function() {
16884
- return new da(this._firestore, this._converter, this._key);
16888
+ return new du(this._firestore, this._converter, this._key);
16885
16889
  },
16886
16890
  enumerable: !1,
16887
16891
  configurable: !0
@@ -16959,7 +16963,7 @@ function mc(t, e) {
16959
16963
  * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
16960
16964
  */
16961
16965
  function bc(t, e) {
16962
- return "string" == typeof e ? yc(t, e) : e instanceof Ba ? e._internalPath : e._delegate._internalPath;
16966
+ return "string" == typeof e ? yc(t, e) : e instanceof Bu ? e._internalPath : e._delegate._internalPath;
16963
16967
  }
16964
16968
 
16965
16969
  /**
@@ -16997,9 +17001,9 @@ function bc(t, e) {
16997
17001
  }(), Tc = /** @class */ function(e) {
16998
17002
  /** @hideconstructor protected */
16999
17003
  function n(t, n, r, i, o, s) {
17000
- var u = this;
17001
- return (u = e.call(this, t, n, r, i, s) || this)._firestore = t, u._firestoreImpl = t,
17002
- u.metadata = o, u;
17004
+ var a = this;
17005
+ return (a = e.call(this, t, n, r, i, s) || this)._firestore = t, a._firestoreImpl = t,
17006
+ a.metadata = o, a;
17003
17007
  }
17004
17008
  /**
17005
17009
  * Property of the `DocumentSnapshot` that signals whether or not the data
@@ -17197,7 +17201,7 @@ function bc(t, e) {
17197
17201
  * @param right - A snapshot to compare.
17198
17202
  * @returns true if the snapshots are equal.
17199
17203
  */ function Ac(t, e) {
17200
- return t instanceof Tc && e instanceof Tc ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Sc && e instanceof Sc && t._firestore === e._firestore && ba(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot);
17204
+ return t instanceof Tc && e instanceof Tc ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Sc && e instanceof Sc && t._firestore === e._firestore && bu(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot);
17201
17205
  }
17202
17206
 
17203
17207
  /**
@@ -17252,26 +17256,26 @@ var Cc = /** @class */ function(e) {
17252
17256
  i;
17253
17257
  }
17254
17258
  return t(n, e), n.prototype._apply = function(t) {
17255
- var e = $a(t.firestore), n = function(t, e, n, r, i, o, s) {
17256
- var u;
17259
+ var e = $u(t.firestore), n = function(t, e, n, r, i, o, s) {
17260
+ var a;
17257
17261
  if (i.isKeyField()) {
17258
17262
  if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new Y(H.INVALID_ARGUMENT, "Invalid Query. You can't perform '" + o + "' queries on documentId().");
17259
17263
  if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
17260
17264
  zc(s, o);
17261
- for (var a = [], c = 0, h = s; c < h.length; c++) {
17265
+ for (var u = [], c = 0, h = s; c < h.length; c++) {
17262
17266
  var f = h[c];
17263
- a.push(Gc(r, t, f));
17267
+ u.push(Gc(r, t, f));
17264
17268
  }
17265
- u = {
17269
+ a = {
17266
17270
  arrayValue: {
17267
- values: a
17271
+ values: u
17268
17272
  }
17269
17273
  };
17270
- } else u = Gc(r, t, s);
17274
+ } else a = Gc(r, t, s);
17271
17275
  } else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || zc(s, o),
17272
- u = ac(n, "where", s,
17276
+ a = uc(n, "where", s,
17273
17277
  /* allowArrays= */ "in" /* IN */ === o || "not-in" /* NOT_IN */ === o);
17274
- var l = re.create(i, o, u);
17278
+ var l = re.create(i, o, a);
17275
17279
  return function(t, e) {
17276
17280
  if (e.V()) {
17277
17281
  var n = Se(t);
@@ -17324,7 +17328,7 @@ var Cc = /** @class */ function(e) {
17324
17328
  throw i === e.op ? new Y(H.INVALID_ARGUMENT, "Invalid query. You cannot use more than one '" + e.op.toString() + "' filter.") : new Y(H.INVALID_ARGUMENT, "Invalid query. You cannot use '" + e.op.toString() + "' filters with '" + i.toString() + "' filters.");
17325
17329
  }(t, l), l;
17326
17330
  }(t._query, 0, e, t.firestore._databaseId, this.zc, this.Hc, this.Jc);
17327
- return new pa(t.firestore, t.converter, function(t, e) {
17331
+ return new pu(t.firestore, t.converter, function(t, e) {
17328
17332
  var n = t.filters.concat([ e ]);
17329
17333
  return new ge(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
17330
17334
  }(t._query, n));
@@ -17364,7 +17368,7 @@ var Rc = /** @class */ function(e) {
17364
17368
  }
17365
17369
  }(t, r), r;
17366
17370
  }(t._query, this.zc, this.Yc);
17367
- return new pa(t.firestore, t.converter, function(t, e) {
17371
+ return new pu(t.firestore, t.converter, function(t, e) {
17368
17372
  // TODO(dimond): validate that orderBy does not list the same key twice.
17369
17373
  var n = t.explicitOrderBy.concat([ e ]);
17370
17374
  return new ge(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
@@ -17392,7 +17396,7 @@ var Pc = /** @class */ function(e) {
17392
17396
  return (i = e.call(this) || this).type = t, i.Xc = n, i.Zc = r, i;
17393
17397
  }
17394
17398
  return t(n, e), n.prototype._apply = function(t) {
17395
- return new pa(t.firestore, t.converter, De(t._query, this.Xc, this.Zc));
17399
+ return new pu(t.firestore, t.converter, De(t._query, this.Xc, this.Zc));
17396
17400
  }, n;
17397
17401
  }(Dc);
17398
17402
 
@@ -17402,7 +17406,7 @@ var Pc = /** @class */ function(e) {
17402
17406
  * @param limit - The maximum number of items to return.
17403
17407
  * @returns The created {@link Query}.
17404
17408
  */ function Oc(t) {
17405
- return ca("limit", t), new Pc("limit", t, "F" /* First */)
17409
+ return cu("limit", t), new Pc("limit", t, "F" /* First */)
17406
17410
  /**
17407
17411
  * Creates a {@link QueryConstraint} that only returns the last matching documents.
17408
17412
  *
@@ -17415,7 +17419,7 @@ var Pc = /** @class */ function(e) {
17415
17419
  }
17416
17420
 
17417
17421
  function Mc(t) {
17418
- return ca("limitToLast", t), new Pc("limitToLast", t, "L" /* Last */);
17422
+ return cu("limitToLast", t), new Pc("limitToLast", t, "L" /* Last */);
17419
17423
  }
17420
17424
 
17421
17425
  var Fc = /** @class */ function(e) {
@@ -17425,7 +17429,7 @@ var Fc = /** @class */ function(e) {
17425
17429
  }
17426
17430
  return t(n, e), n.prototype._apply = function(t) {
17427
17431
  var e = Kc(t, this.type, this.ta, this.ea);
17428
- return new pa(t.firestore, t.converter, function(t, e) {
17432
+ return new pu(t.firestore, t.converter, function(t, e) {
17429
17433
  return new ge(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
17430
17434
  }(t._query, e));
17431
17435
  }, n;
@@ -17449,7 +17453,7 @@ var Uc = /** @class */ function(e) {
17449
17453
  }
17450
17454
  return t(n, e), n.prototype._apply = function(t) {
17451
17455
  var e = Kc(t, this.type, this.ta, this.ea);
17452
- return new pa(t.firestore, t.converter, function(t, e) {
17456
+ return new pu(t.firestore, t.converter, function(t, e) {
17453
17457
  return new ge(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
17454
17458
  }(t._query, e));
17455
17459
  }, n;
@@ -17475,13 +17479,13 @@ function jc() {
17475
17479
  // the provided document. Without the key (by using the explicit sort
17476
17480
  // orders), multiple documents could match the position, yielding duplicate
17477
17481
  // results.
17478
- for (var o = [], s = 0, u = Ae(t); s < u.length; s++) {
17479
- var a = u[s];
17480
- if (a.field.isKeyField()) o.push(jt(e, r.key)); else {
17481
- var c = r.data.field(a.field);
17482
- if (Dt(c)) throw new Y(H.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field "' + a.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
17482
+ for (var o = [], s = 0, a = Ae(t); s < a.length; s++) {
17483
+ var u = a[s];
17484
+ if (u.field.isKeyField()) o.push(jt(e, r.key)); else {
17485
+ var c = r.data.field(u.field);
17486
+ if (Dt(c)) throw new Y(H.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field "' + u.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
17483
17487
  if (null === c) {
17484
- var h = a.field.canonicalString();
17488
+ var h = u.field.canonicalString();
17485
17489
  throw new Y(H.INVALID_ARGUMENT, "Invalid query. You are trying to start or end a query using a document for which the field '" + h + "' (used as the orderBy) does not exist.");
17486
17490
  }
17487
17491
  o.push(c);
@@ -17489,26 +17493,26 @@ function jc() {
17489
17493
  }
17490
17494
  return new le(o, i);
17491
17495
  }(t._query, t.firestore._databaseId, e, n[0]._document, r);
17492
- var i = $a(t.firestore);
17496
+ var i = $u(t.firestore);
17493
17497
  return function(t, e, n, r, i, o) {
17494
17498
  // Use explicit order by's because it has to match the query the user made
17495
17499
  var s = t.explicitOrderBy;
17496
17500
  if (i.length > s.length) throw new Y(H.INVALID_ARGUMENT, "Too many arguments provided to " + r + "(). The number of arguments must be less than or equal to the number of orderBy() clauses");
17497
- for (var u = [], a = 0; a < i.length; a++) {
17498
- var c = i[a];
17499
- if (s[a].field.isKeyField()) {
17501
+ for (var a = [], u = 0; u < i.length; u++) {
17502
+ var c = i[u];
17503
+ if (s[u].field.isKeyField()) {
17500
17504
  if ("string" != typeof c) throw new Y(H.INVALID_ARGUMENT, "Invalid query. Expected a string for document ID in " + r + "(), but got a " + typeof c);
17501
17505
  if (!_e(t) && -1 !== c.indexOf("/")) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying a collection and ordering by documentId(), the value passed to " + r + "() must be a plain document ID, but '" + c + "' contains a slash.");
17502
17506
  var h = t.path.child(gt.fromString(c));
17503
17507
  if (!Pt.isDocumentKey(h)) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying a collection group and ordering by documentId(), the value passed to " + r + "() must result in a valid document path, but '" + h + "' is not because it contains an odd number of segments.");
17504
17508
  var f = new Pt(h);
17505
- u.push(jt(e, f));
17509
+ a.push(jt(e, f));
17506
17510
  } else {
17507
- var l = ac(n, r, c);
17508
- u.push(l);
17511
+ var l = uc(n, r, c);
17512
+ a.push(l);
17509
17513
  }
17510
17514
  }
17511
- return new le(u, o);
17515
+ return new le(a, o);
17512
17516
  }(t._query, t.firestore._databaseId, i, e, n, r);
17513
17517
  }
17514
17518
 
@@ -17520,8 +17524,8 @@ function Gc(t, e, n) {
17520
17524
  if (!Pt.isDocumentKey(r)) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '" + r + "' is not because it has an odd number of segments (" + r.length + ").");
17521
17525
  return jt(t, new Pt(r));
17522
17526
  }
17523
- if (n instanceof da) return jt(t, n._key);
17524
- throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + ua(n) + ".");
17527
+ if (n instanceof du) return jt(t, n._key);
17528
+ throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + au(n) + ".");
17525
17529
  }
17526
17530
 
17527
17531
  /**
@@ -17603,7 +17607,7 @@ function Qc(t, e, n) {
17603
17607
  r[t] = n.convertValue(i, e);
17604
17608
  })), r;
17605
17609
  }, t.prototype.convertGeoPoint = function(t) {
17606
- return new za(At(t.latitude), At(t.longitude));
17610
+ return new zu(At(t.latitude), At(t.longitude));
17607
17611
  }, t.prototype.convertArray = function(t, e) {
17608
17612
  var n = this;
17609
17613
  return (t.values || []).map((function(t) {
@@ -17627,7 +17631,7 @@ function Qc(t, e, n) {
17627
17631
  }, t.prototype.convertDocumentKey = function(t, e) {
17628
17632
  var n = gt.fromString(t);
17629
17633
  z(br(n));
17630
- var r = new ea(n.get(1), n.get(3)), i = new Pt(n.popFirst(5));
17634
+ var r = new eu(n.get(1), n.get(3)), i = new Pt(n.popFirst(5));
17631
17635
  return r.isEqual(e) ||
17632
17636
  // TODO(b/64130202): Somehow support foreign references.
17633
17637
  B("Document " + i + " contains a document reference within a different database (" + r.projectId + "/" + r.database + ") which is not supported. It will be treated as a reference in the current database (" + e.projectId + "/" + e.database + ") instead."),
@@ -17672,20 +17676,20 @@ var Yc = /** @class */ function(e) {
17672
17676
  return (n = e.call(this) || this).firestore = t, n;
17673
17677
  }
17674
17678
  return t(n, e), n.prototype.convertBytes = function(t) {
17675
- return new Ka(t);
17679
+ return new Ku(t);
17676
17680
  }, n.prototype.convertReference = function(t) {
17677
17681
  var e = this.convertDocumentKey(t, this.firestore._databaseId);
17678
- return new da(this.firestore, /* converter= */ null, e);
17682
+ return new du(this.firestore, /* converter= */ null, e);
17679
17683
  }, n;
17680
17684
  }(Wc), Jc = /** @class */ function() {
17681
17685
  /** @hideconstructor */
17682
17686
  function t(t, e) {
17683
17687
  this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
17684
- this._dataReader = $a(t);
17688
+ this._dataReader = $u(t);
17685
17689
  }
17686
17690
  return t.prototype.set = function(t, e, n) {
17687
17691
  this._verifyNotCommitted();
17688
- var r = Xc(t, this._firestore), i = Hc(r.converter, e, n), o = Za(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
17692
+ var r = Xc(t, this._firestore), i = Hc(r.converter, e, n), o = Zu(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
17689
17693
  return this._mutations.push(o.toMutation(r._key, $e.none())), this;
17690
17694
  }, t.prototype.update = function(t, e, n) {
17691
17695
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
@@ -17693,7 +17697,7 @@ var Yc = /** @class */ function(e) {
17693
17697
  var o, s = Xc(t, this._firestore);
17694
17698
  // For Compat types, we have to "extract" the underlying types before
17695
17699
  // performing validation.
17696
- return o = "string" == typeof (e = I(e)) || e instanceof Ba ? uc(this._dataReader, "WriteBatch.update", s._key, e, n, r) : sc(this._dataReader, "WriteBatch.update", s._key, e),
17700
+ return o = "string" == typeof (e = I(e)) || e instanceof Bu ? ac(this._dataReader, "WriteBatch.update", s._key, e, n, r) : sc(this._dataReader, "WriteBatch.update", s._key, e),
17697
17701
  this._mutations.push(o.toMutation(s._key, $e.exists(!0))), this;
17698
17702
  },
17699
17703
  /**
@@ -17807,9 +17811,9 @@ var Yc = /** @class */ function(e) {
17807
17811
  * @returns A Promise resolved with a `DocumentSnapshot` containing the
17808
17812
  * current document contents.
17809
17813
  */ function $c(t) {
17810
- t = aa(t, da);
17811
- var e = aa(t.firestore, _a);
17812
- return $u(Da(e), t._key).then((function(n) {
17814
+ t = uu(t, du);
17815
+ var e = uu(t.firestore, _u);
17816
+ return $a(Du(e), t._key).then((function(n) {
17813
17817
  return lh(e, t, n);
17814
17818
  }));
17815
17819
  }
@@ -17820,10 +17824,10 @@ var Zc = /** @class */ function(e) {
17820
17824
  return (n = e.call(this) || this).firestore = t, n;
17821
17825
  }
17822
17826
  return t(n, e), n.prototype.convertBytes = function(t) {
17823
- return new Ka(t);
17827
+ return new Ku(t);
17824
17828
  }, n.prototype.convertReference = function(t) {
17825
17829
  var e = this.convertDocumentKey(t, this.firestore._databaseId);
17826
- return new da(this.firestore, /* converter= */ null, e);
17830
+ return new du(this.firestore, /* converter= */ null, e);
17827
17831
  }, n;
17828
17832
  }(Wc);
17829
17833
 
@@ -17834,8 +17838,8 @@ var Zc = /** @class */ function(e) {
17834
17838
  * @returns A `Promise` resolved with a `DocumentSnapshot` containing the
17835
17839
  * current document contents.
17836
17840
  */ function th(t) {
17837
- t = aa(t, da);
17838
- var e = aa(t.firestore, _a), i = Da(e), o = new Zc(e);
17841
+ t = uu(t, du);
17842
+ var e = uu(t.firestore, _u), i = Du(e), o = new Zc(e);
17839
17843
  return function(t, e) {
17840
17844
  var i = this, o = new J;
17841
17845
  return t.asyncQueue.enqueueAndForget((function() {
@@ -17870,7 +17874,7 @@ var Zc = /** @class */ function(e) {
17870
17874
  }
17871
17875
  }));
17872
17876
  }));
17873
- }, [ 4 /*yield*/ , Hu(t) ];
17877
+ }, [ 4 /*yield*/ , Ha(t) ];
17874
17878
 
17875
17879
  case 1:
17876
17880
  return [ 2 /*return*/ , i.apply(void 0, [ s.sent(), e, o ]) ];
@@ -17891,9 +17895,9 @@ var Zc = /** @class */ function(e) {
17891
17895
  * @returns A `Promise` resolved with a `DocumentSnapshot` containing the
17892
17896
  * current document contents.
17893
17897
  */ function eh(t) {
17894
- t = aa(t, da);
17895
- var e = aa(t.firestore, _a);
17896
- return $u(Da(e), t._key, {
17898
+ t = uu(t, du);
17899
+ var e = uu(t.firestore, _u);
17900
+ return $a(Du(e), t._key, {
17897
17901
  source: "server"
17898
17902
  }).then((function(n) {
17899
17903
  return lh(e, t, n);
@@ -17910,9 +17914,9 @@ var Zc = /** @class */ function(e) {
17910
17914
  *
17911
17915
  * @returns A `Promise` that will be resolved with the results of the query.
17912
17916
  */ function nh(t) {
17913
- t = aa(t, pa);
17914
- var e = aa(t.firestore, _a), n = Da(e), r = new Zc(e);
17915
- return kc(t._query), Zu(n, t._query).then((function(n) {
17917
+ t = uu(t, pu);
17918
+ var e = uu(t.firestore, _u), n = Du(e), r = new Zc(e);
17919
+ return kc(t._query), Za(n, t._query).then((function(n) {
17916
17920
  return new Sc(e, r, t, n);
17917
17921
  }))
17918
17922
  /**
@@ -17924,8 +17928,8 @@ var Zc = /** @class */ function(e) {
17924
17928
  }
17925
17929
 
17926
17930
  function rh(t) {
17927
- t = aa(t, pa);
17928
- var e = aa(t.firestore, _a), i = Da(e), o = new Zc(e);
17931
+ t = uu(t, pu);
17932
+ var e = uu(t.firestore, _u), i = Du(e), o = new Zc(e);
17929
17933
  return function(t, e) {
17930
17934
  var i = this, o = new J;
17931
17935
  return t.asyncQueue.enqueueAndForget((function() {
@@ -17936,7 +17940,7 @@ function rh(t) {
17936
17940
  case 0:
17937
17941
  return i = function(t, e, i) {
17938
17942
  return n(this, void 0, void 0, (function() {
17939
- var n, o, s, u, a, c;
17943
+ var n, o, s, a, u, c;
17940
17944
  return r(this, (function(r) {
17941
17945
  switch (r.label) {
17942
17946
  case 0:
@@ -17944,11 +17948,11 @@ function rh(t) {
17944
17948
  /* usePreviousResults= */ !0) ];
17945
17949
 
17946
17950
  case 1:
17947
- return n = r.sent(), o = new Xs(e, n.zn), s = o.Po(n.documents), u = o.applyChanges(s,
17948
- /* updateLimboDocuments= */ !1), i.resolve(u.snapshot), [ 3 /*break*/ , 3 ];
17951
+ return n = r.sent(), o = new Xs(e, n.zn), s = o.Po(n.documents), a = o.applyChanges(s,
17952
+ /* updateLimboDocuments= */ !1), i.resolve(a.snapshot), [ 3 /*break*/ , 3 ];
17949
17953
 
17950
17954
  case 2:
17951
- return a = r.sent(), c = Ls(a, "Failed to execute query '" + e + " against cache"),
17955
+ return u = r.sent(), c = Ls(u, "Failed to execute query '" + e + " against cache"),
17952
17956
  i.reject(c), [ 3 /*break*/ , 3 ];
17953
17957
 
17954
17958
  case 3:
@@ -17956,7 +17960,7 @@ function rh(t) {
17956
17960
  }
17957
17961
  }));
17958
17962
  }));
17959
- }, [ 4 /*yield*/ , Hu(t) ];
17963
+ }, [ 4 /*yield*/ , Ha(t) ];
17960
17964
 
17961
17965
  case 1:
17962
17966
  return [ 2 /*return*/ , i.apply(void 0, [ s.sent(), e, o ]) ];
@@ -17975,9 +17979,9 @@ function rh(t) {
17975
17979
  *
17976
17980
  * @returns A `Promise` that will be resolved with the results of the query.
17977
17981
  */ function ih(t) {
17978
- t = aa(t, pa);
17979
- var e = aa(t.firestore, _a), n = Da(e), r = new Zc(e);
17980
- return Zu(n, t._query, {
17982
+ t = uu(t, pu);
17983
+ var e = uu(t.firestore, _u), n = Du(e), r = new Zc(e);
17984
+ return Za(n, t._query, {
17981
17985
  source: "server"
17982
17986
  }).then((function(n) {
17983
17987
  return new Sc(e, r, t, n);
@@ -17985,19 +17989,19 @@ function rh(t) {
17985
17989
  }
17986
17990
 
17987
17991
  function oh(t, e, n) {
17988
- t = aa(t, da);
17989
- var r = aa(t.firestore, _a), i = Hc(t.converter, e, n);
17990
- return fh(r, [ Za($a(r), "setDoc", t._key, i, null !== t.converter, n).toMutation(t._key, $e.none()) ]);
17992
+ t = uu(t, du);
17993
+ var r = uu(t.firestore, _u), i = Hc(t.converter, e, n);
17994
+ return fh(r, [ Zu($u(r), "setDoc", t._key, i, null !== t.converter, n).toMutation(t._key, $e.none()) ]);
17991
17995
  }
17992
17996
 
17993
17997
  function sh(t, e, n) {
17994
17998
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
17995
- t = aa(t, da);
17996
- var o = aa(t.firestore, _a), s = $a(o);
17999
+ t = uu(t, du);
18000
+ var o = uu(t.firestore, _u), s = $u(o);
17997
18001
  return fh(o, [ ("string" == typeof (
17998
18002
  // For Compat types, we have to "extract" the underlying types before
17999
18003
  // performing validation.
18000
- e = I(e)) || e instanceof Ba ? uc(s, "updateDoc", t._key, e, n, r) : sc(s, "updateDoc", t._key, e)).toMutation(t._key, $e.exists(!0)) ]);
18004
+ e = I(e)) || e instanceof Bu ? ac(s, "updateDoc", t._key, e, n, r) : sc(s, "updateDoc", t._key, e)).toMutation(t._key, $e.exists(!0)) ]);
18001
18005
  }
18002
18006
 
18003
18007
  /**
@@ -18006,8 +18010,8 @@ function sh(t, e, n) {
18006
18010
  * @param reference - A reference to the document to delete.
18007
18011
  * @returns A Promise resolved once the document has been successfully
18008
18012
  * deleted from the backend (note that it won't resolve while you're offline).
18009
- */ function uh(t) {
18010
- return fh(aa(t.firestore, _a), [ new pn(t._key, $e.none()) ]);
18013
+ */ function ah(t) {
18014
+ return fh(uu(t.firestore, _u), [ new pn(t._key, $e.none()) ]);
18011
18015
  }
18012
18016
 
18013
18017
  /**
@@ -18019,37 +18023,37 @@ function sh(t, e, n) {
18019
18023
  * @returns A `Promise` resolved with a `DocumentReference` pointing to the
18020
18024
  * newly created document after it has been written to the backend (Note that it
18021
18025
  * won't resolve while you're offline).
18022
- */ function ah(t, e) {
18023
- var n = aa(t.firestore, _a), r = ga(t), i = Hc(t.converter, e);
18024
- return fh(n, [ Za($a(t.firestore), "addDoc", r._key, i, null !== t.converter, {}).toMutation(r._key, $e.exists(!1)) ]).then((function() {
18026
+ */ function uh(t, e) {
18027
+ var n = uu(t.firestore, _u), r = gu(t), i = Hc(t.converter, e);
18028
+ return fh(n, [ Zu($u(t.firestore), "addDoc", r._key, i, null !== t.converter, {}).toMutation(r._key, $e.exists(!1)) ]).then((function() {
18025
18029
  return r;
18026
18030
  }));
18027
18031
  }
18028
18032
 
18029
18033
  function ch(t) {
18030
- for (var e, i, o, s = [], u = 1; u < arguments.length; u++) s[u - 1] = arguments[u];
18034
+ for (var e, i, o, s = [], a = 1; a < arguments.length; a++) s[a - 1] = arguments[a];
18031
18035
  t = I(t);
18032
- var a = {
18036
+ var u = {
18033
18037
  includeMetadataChanges: !1
18034
18038
  }, c = 0;
18035
- "object" != typeof s[c] || Ta(s[c]) || (a = s[c], c++);
18039
+ "object" != typeof s[c] || Tu(s[c]) || (u = s[c], c++);
18036
18040
  var h, f, l, d = {
18037
- includeMetadataChanges: a.includeMetadataChanges
18041
+ includeMetadataChanges: u.includeMetadataChanges
18038
18042
  };
18039
- if (Ta(s[c])) {
18043
+ if (Tu(s[c])) {
18040
18044
  var p = s[c];
18041
18045
  s[c] = null === (e = p.next) || void 0 === e ? void 0 : e.bind(p), s[c + 1] = null === (i = p.error) || void 0 === i ? void 0 : i.bind(p),
18042
18046
  s[c + 2] = null === (o = p.complete) || void 0 === o ? void 0 : o.bind(p);
18043
18047
  }
18044
- if (t instanceof da) f = aa(t.firestore, _a), l = be(t._key.path), h = {
18048
+ if (t instanceof du) f = uu(t.firestore, _u), l = be(t._key.path), h = {
18045
18049
  next: function(e) {
18046
18050
  s[c] && s[c](lh(f, t, e));
18047
18051
  },
18048
18052
  error: s[c + 1],
18049
18053
  complete: s[c + 2]
18050
18054
  }; else {
18051
- var y = aa(t, pa);
18052
- f = aa(y.firestore, _a), l = y._query;
18055
+ var y = uu(t, pu);
18056
+ f = uu(y.firestore, _u), l = y._query;
18053
18057
  var v = new Zc(f);
18054
18058
  h = {
18055
18059
  next: function(t) {
@@ -18060,42 +18064,42 @@ function ch(t) {
18060
18064
  }, kc(t._query);
18061
18065
  }
18062
18066
  return function(t, e, i, o) {
18063
- var s = this, u = new Vu(o), a = new Gs(e, u, i);
18067
+ var s = this, a = new Va(o), u = new Gs(e, a, i);
18064
18068
  return t.asyncQueue.enqueueAndForget((function() {
18065
18069
  return n(s, void 0, void 0, (function() {
18066
18070
  var e;
18067
18071
  return r(this, (function(n) {
18068
18072
  switch (n.label) {
18069
18073
  case 0:
18070
- return e = qs, [ 4 /*yield*/ , Xu(t) ];
18074
+ return e = qs, [ 4 /*yield*/ , Xa(t) ];
18071
18075
 
18072
18076
  case 1:
18073
- return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), a ]) ];
18077
+ return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), u ]) ];
18074
18078
  }
18075
18079
  }));
18076
18080
  }));
18077
18081
  })), function() {
18078
- u.nc(), t.asyncQueue.enqueueAndForget((function() {
18082
+ a.nc(), t.asyncQueue.enqueueAndForget((function() {
18079
18083
  return n(s, void 0, void 0, (function() {
18080
18084
  var e;
18081
18085
  return r(this, (function(n) {
18082
18086
  switch (n.label) {
18083
18087
  case 0:
18084
- return e = Us, [ 4 /*yield*/ , Xu(t) ];
18088
+ return e = Us, [ 4 /*yield*/ , Xa(t) ];
18085
18089
 
18086
18090
  case 1:
18087
- return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), a ]) ];
18091
+ return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), u ]) ];
18088
18092
  }
18089
18093
  }));
18090
18094
  }));
18091
18095
  }));
18092
18096
  };
18093
- }(Da(f), l, d, h);
18097
+ }(Du(f), l, d, h);
18094
18098
  }
18095
18099
 
18096
18100
  function hh(t, e) {
18097
18101
  return function(t, e) {
18098
- var i = this, o = new Vu(e);
18102
+ var i = this, o = new Va(e);
18099
18103
  return t.asyncQueue.enqueueAndForget((function() {
18100
18104
  return n(i, void 0, void 0, (function() {
18101
18105
  var e;
@@ -18107,7 +18111,7 @@ function hh(t, e) {
18107
18111
  // Immediately fire an initial event, indicating all existing listeners
18108
18112
  // are in-sync.
18109
18113
  e.next();
18110
- }, [ 4 /*yield*/ , Xu(t) ];
18114
+ }, [ 4 /*yield*/ , Xa(t) ];
18111
18115
 
18112
18116
  case 1:
18113
18117
  return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), o ]) ];
@@ -18123,7 +18127,7 @@ function hh(t, e) {
18123
18127
  case 0:
18124
18128
  return e = function(t, e) {
18125
18129
  W(t).io.delete(e);
18126
- }, [ 4 /*yield*/ , Xu(t) ];
18130
+ }, [ 4 /*yield*/ , Xa(t) ];
18127
18131
 
18128
18132
  case 1:
18129
18133
  return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), o ]) ];
@@ -18147,7 +18151,7 @@ function hh(t, e) {
18147
18151
  * been committed. For this reason, it is required that all reads are
18148
18152
  * performed before any writes. Transactions must be performed while online.
18149
18153
  */;
18150
- }(Da(t = aa(t, _a)), Ta(e) ? e : {
18154
+ }(Du(t = uu(t, _u)), Tu(e) ? e : {
18151
18155
  next: e
18152
18156
  });
18153
18157
  }
@@ -18164,7 +18168,7 @@ function hh(t, e) {
18164
18168
  return r(this, (function(r) {
18165
18169
  switch (r.label) {
18166
18170
  case 0:
18167
- return n = iu, [ 4 /*yield*/ , Ju(t) ];
18171
+ return n = ia, [ 4 /*yield*/ , Ja(t) ];
18168
18172
 
18169
18173
  case 1:
18170
18174
  return [ 2 /*return*/ , n.apply(void 0, [ r.sent(), e, o ]) ];
@@ -18172,7 +18176,7 @@ function hh(t, e) {
18172
18176
  }));
18173
18177
  }));
18174
18178
  })), o.promise;
18175
- }(Da(t), e);
18179
+ }(Du(t), e);
18176
18180
  }
18177
18181
 
18178
18182
  /**
@@ -18229,7 +18233,7 @@ function hh(t, e) {
18229
18233
  }(/** @class */ function() {
18230
18234
  /** @hideconstructor */
18231
18235
  function t(t, e) {
18232
- this._firestore = t, this._transaction = e, this._dataReader = $a(t)
18236
+ this._firestore = t, this._transaction = e, this._dataReader = $u(t)
18233
18237
  /**
18234
18238
  * Reads the document referenced by the provided {@link DocumentReference}.
18235
18239
  *
@@ -18247,14 +18251,14 @@ function hh(t, e) {
18247
18251
  throw G();
18248
18252
  }));
18249
18253
  }, t.prototype.set = function(t, e, n) {
18250
- var r = Xc(t, this._firestore), i = Hc(r.converter, e, n), o = Za(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
18254
+ var r = Xc(t, this._firestore), i = Hc(r.converter, e, n), o = Zu(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
18251
18255
  return this._transaction.set(r._key, o), this;
18252
18256
  }, t.prototype.update = function(t, e, n) {
18253
18257
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
18254
18258
  var o, s = Xc(t, this._firestore);
18255
18259
  // For Compat types, we have to "extract" the underlying types before
18256
18260
  // performing validation.
18257
- return o = "string" == typeof (e = I(e)) || e instanceof Ba ? uc(this._dataReader, "Transaction.update", s._key, e, n, r) : sc(this._dataReader, "Transaction.update", s._key, e),
18261
+ return o = "string" == typeof (e = I(e)) || e instanceof Bu ? ac(this._dataReader, "Transaction.update", s._key, e, n, r) : sc(this._dataReader, "Transaction.update", s._key, e),
18258
18262
  this._transaction.update(s._key, o), this;
18259
18263
  },
18260
18264
  /**
@@ -18295,18 +18299,18 @@ function hh(t, e) {
18295
18299
  switch (r.label) {
18296
18300
  case 0:
18297
18301
  return [ 4 /*yield*/ , function(t) {
18298
- return Qu(t).then((function(t) {
18302
+ return Qa(t).then((function(t) {
18299
18303
  return t.datastore;
18300
18304
  }));
18301
18305
  }(t) ];
18302
18306
 
18303
18307
  case 1:
18304
- return n = r.sent(), new Bu(t.asyncQueue, n, e, o).run(), [ 2 /*return*/ ];
18308
+ return n = r.sent(), new Ba(t.asyncQueue, n, e, o).run(), [ 2 /*return*/ ];
18305
18309
  }
18306
18310
  }));
18307
18311
  }));
18308
18312
  })), o.promise;
18309
- }(Da(t = aa(t, _a)), (function(n) {
18313
+ }(Du(t = uu(t, _u)), (function(n) {
18310
18314
  return e(new dh(t, n));
18311
18315
  }));
18312
18316
  }
@@ -18425,7 +18429,7 @@ function hh(t, e) {
18425
18429
  * @returns A {@link WriteBatch} that can be used to atomically execute multiple
18426
18430
  * writes.
18427
18431
  */ function bh(t) {
18428
- return Da(t = aa(t, _a)), new Jc(t, (function(e) {
18432
+ return Du(t = uu(t, _u)), new Jc(t, (function(e) {
18429
18433
  return fh(t, e);
18430
18434
  }))
18431
18435
  /**
@@ -18544,7 +18548,7 @@ e) {
18544
18548
  * limitations under the License.
18545
18549
  */
18546
18550
  function Ah(t, e) {
18547
- Da(t = aa(t, _a));
18551
+ Du(t = uu(t, _u));
18548
18552
  var n = "string" == typeof e ? function(t) {
18549
18553
  try {
18550
18554
  return JSON.parse(t);
@@ -18555,12 +18559,12 @@ function Ah(t, e) {
18555
18559
  // PORTING NOTE: We don't return an error if the user has not enabled
18556
18560
  // persistence since `enableIndexeddbPersistence()` can fail on the Web.
18557
18561
  if (Array.isArray(n.indexes)) for (var i = 0, o = n.indexes; i < o.length; i++) {
18558
- var s = o[i], u = kh(s, "collectionGroup"), a = [];
18562
+ var s = o[i], a = kh(s, "collectionGroup"), u = [];
18559
18563
  if (Array.isArray(s.fields)) for (var c = 0, h = s.fields; c < h.length; c++) {
18560
18564
  var f = h[c], l = yc("setIndexConfiguration", kh(f, "fieldPath"));
18561
- "CONTAINS" === f.arrayConfig ? a.push(new Eh(l, 2 /* CONTAINS */)) : "ASCENDING" === f.order ? a.push(new Eh(l, 0 /* ASCENDING */)) : "DESCENDING" === f.order && a.push(new Eh(l, 1 /* DESCENDING */));
18565
+ "CONTAINS" === f.arrayConfig ? u.push(new Eh(l, 2 /* CONTAINS */)) : "ASCENDING" === f.order ? u.push(new Eh(l, 0 /* ASCENDING */)) : "DESCENDING" === f.order && u.push(new Eh(l, 1 /* DESCENDING */));
18562
18566
  }
18563
- r.push(new Ih(Ih.ia, u, a, Sh.empty()));
18567
+ r.push(new Ih(Ih.ia, a, u, Sh.empty()));
18564
18568
  }
18565
18569
  // TODO(indexing): Configure indexes
18566
18570
  return Promise.resolve();
@@ -18576,13 +18580,13 @@ function kh(t, e) {
18576
18580
  *
18577
18581
  * @packageDocumentation
18578
18582
  */ void 0 === Th && (Th = !0), M = i, o(new c("firestore", (function(t, e) {
18579
- var n = e.options, r = t.getProvider("app").getImmediate(), i = new _a(r, new tt(t.getProvider("auth-internal")), new it(t.getProvider("app-check-internal")));
18583
+ var n = e.options, r = t.getProvider("app").getImmediate(), i = new _u(r, new tt(t.getProvider("auth-internal")), new it(t.getProvider("app-check-internal")));
18580
18584
  return n = Object.assign({
18581
18585
  useFetchStreams: Th
18582
18586
  }, n), i._setSettings(n), i;
18583
- }), "PUBLIC")), s(P, "3.4.4-canary.6555aa70f", void 0),
18587
+ }), "PUBLIC")), s(P, "3.4.4-canary.aaeab08ac", void 0),
18584
18588
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
18585
- s(P, "3.4.4-canary.6555aa70f", "esm5");
18589
+ s(P, "3.4.4-canary.aaeab08ac", "esm5");
18586
18590
 
18587
- export { Wc as AbstractUserDataWriter, Ka as Bytes, Sa as CACHE_SIZE_UNLIMITED, ya as CollectionReference, da as DocumentReference, Tc as DocumentSnapshot, Ba as FieldPath, Ga as FieldValue, _a as Firestore, Y as FirestoreError, za as GeoPoint, Ea as LoadBundleTask, pa as Query, Dc as QueryConstraint, Ec as QueryDocumentSnapshot, Sc as QuerySnapshot, Ic as SnapshotMetadata, lt as Timestamp, dh as Transaction, Jc as WriteBatch, ea as _DatabaseId, Pt as _DocumentKey, ot as _EmptyAppCheckTokenProvider, $ as _EmptyAuthCredentialsProvider, bt as _FieldPath, aa as _cast, Q as _debugAssert, Tt as _isBase64Available, j as _logWarn, Ah as _setIndexConfiguration, ia as _validateIsNotUsedTogether, ah as addDoc, gh as arrayRemove, mh as arrayUnion, La as clearIndexedDbPersistence, va as collection, ma as collectionGroup, la as connectFirestoreEmulator, uh as deleteDoc, yh as deleteField, Ma as disableNetwork, ga as doc, ja as documentId, Ca as enableIndexedDbPersistence, xa as enableMultiTabIndexedDbPersistence, Oa as enableNetwork, jc as endAt, Bc as endBefore, Da as ensureFirestoreConfigured, fh as executeWrite, $c as getDoc, th as getDocFromCache, eh as getDocFromServer, nh as getDocs, rh as getDocsFromCache, ih as getDocsFromServer, ka as getFirestore, wh as increment, Aa as initializeFirestore, Oc as limit, Mc as limitToLast, Va as loadBundle, qa as namedQuery, ch as onSnapshot, hh as onSnapshotsInSync, Lc as orderBy, Nc as query, ba as queryEqual, wa as refEqual, ph as runTransaction, vh as serverTimestamp, oh as setDoc, q as setLogLevel, Ac as snapshotEqual, qc as startAfter, Vc as startAt, Fa as terminate, sh as updateDoc, Pa as waitForPendingWrites, xc as where, bh as writeBatch };
18591
+ export { Wc as AbstractUserDataWriter, Ku as Bytes, Su as CACHE_SIZE_UNLIMITED, yu as CollectionReference, du as DocumentReference, Tc as DocumentSnapshot, Bu as FieldPath, Gu as FieldValue, _u as Firestore, Y as FirestoreError, zu as GeoPoint, Eu as LoadBundleTask, pu as Query, Dc as QueryConstraint, Ec as QueryDocumentSnapshot, Sc as QuerySnapshot, Ic as SnapshotMetadata, lt as Timestamp, dh as Transaction, Jc as WriteBatch, eu as _DatabaseId, Pt as _DocumentKey, ot as _EmptyAppCheckTokenProvider, $ as _EmptyAuthCredentialsProvider, bt as _FieldPath, uu as _cast, Q as _debugAssert, Tt as _isBase64Available, j as _logWarn, Ah as _setIndexConfiguration, iu as _validateIsNotUsedTogether, uh as addDoc, gh as arrayRemove, mh as arrayUnion, Lu as clearIndexedDbPersistence, vu as collection, mu as collectionGroup, lu as connectFirestoreEmulator, ah as deleteDoc, yh as deleteField, Mu as disableNetwork, gu as doc, ju as documentId, Cu as enableIndexedDbPersistence, xu as enableMultiTabIndexedDbPersistence, Ou as enableNetwork, jc as endAt, Bc as endBefore, Du as ensureFirestoreConfigured, fh as executeWrite, $c as getDoc, th as getDocFromCache, eh as getDocFromServer, nh as getDocs, rh as getDocsFromCache, ih as getDocsFromServer, ku as getFirestore, wh as increment, Au as initializeFirestore, Oc as limit, Mc as limitToLast, Vu as loadBundle, qu as namedQuery, ch as onSnapshot, hh as onSnapshotsInSync, Lc as orderBy, Nc as query, bu as queryEqual, wu as refEqual, ph as runTransaction, vh as serverTimestamp, oh as setDoc, q as setLogLevel, Ac as snapshotEqual, qc as startAfter, Vc as startAt, Fu as terminate, sh as updateDoc, Pu as waitForPendingWrites, xc as where, bh as writeBatch };
18588
18592
  //# sourceMappingURL=index.esm5.js.map