@firebase/firestore 1.14.0-canary.daf63c2c → 1.14.0

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.
@@ -267,7 +267,7 @@ var b = {
267
267
  // outstanding so the response is potentially for a previous user (which
268
268
  // user, we can't be sure).
269
269
  if (t.I !== e) throw new A(b.ABORTED, "getToken aborted due to token change.");
270
- return n ? (Le("string" == typeof n.accessToken, "Invalid tokenData returned from getToken():" + n),
270
+ return n ? (Ve("string" == typeof n.accessToken, "Invalid tokenData returned from getToken():" + n),
271
271
  new N(n.accessToken, t.currentUser)) : null;
272
272
  })) : Promise.resolve(null);
273
273
  }, t.prototype.l = function() {
@@ -285,7 +285,7 @@ var b = {
285
285
  // to guarantee to get the actual user.
286
286
  t.prototype.A = function() {
287
287
  var t = this.auth && this.auth.getUid();
288
- return Le(null === t || "string" == typeof t, "Received invalid UID: " + t), new E(t);
288
+ return Ve(null === t || "string" == typeof t, "Received invalid UID: " + t), new E(t);
289
289
  }, t;
290
290
  }(), _ = /** @class */ function() {
291
291
  function t(t, e) {
@@ -331,7 +331,7 @@ var b = {
331
331
  }, t.prototype.toMillis = function() {
332
332
  return 1e3 * this.seconds + this.nanoseconds / 1e6;
333
333
  }, t.prototype.g = function(t) {
334
- return this.seconds === t.seconds ? Ue(this.nanoseconds, t.nanoseconds) : Ue(this.seconds, t.seconds);
334
+ return this.seconds === t.seconds ? Oe(this.nanoseconds, t.nanoseconds) : Oe(this.seconds, t.seconds);
335
335
  }, t.prototype.isEqual = function(t) {
336
336
  return t.seconds === this.seconds && t.nanoseconds === this.nanoseconds;
337
337
  }, t.prototype.toString = function() {
@@ -382,8 +382,8 @@ var b = {
382
382
  */
383
383
  var D = /** @class */ function() {
384
384
  function t(t, e, n) {
385
- void 0 === e ? e = 0 : e > t.length && Ve("offset " + e + " out of range " + t.length),
386
- void 0 === n ? n = t.length - e : n > t.length - e && Ve("length " + n + " out of range " + (t.length - e)),
385
+ void 0 === e ? e = 0 : e > t.length && Le("offset " + e + " out of range " + t.length),
386
+ void 0 === n ? n = t.length - e : n > t.length - e && Le("length " + n + " out of range " + (t.length - e)),
387
387
  this.segments = t, this.offset = e, this.N = n;
388
388
  }
389
389
  return Object.defineProperty(t.prototype, "length", {
@@ -434,7 +434,7 @@ var D = /** @class */ function() {
434
434
  }
435
435
  return t.length < e.length ? -1 : t.length > e.length ? 1 : 0;
436
436
  }, t;
437
- }(), V = /** @class */ function(e) {
437
+ }(), L = /** @class */ function(e) {
438
438
  function n() {
439
439
  return null !== e && e.apply(this, arguments) || this;
440
440
  }
@@ -467,9 +467,9 @@ var D = /** @class */ function() {
467
467
  /**
468
468
  * A slash-separated path for navigating resources (documents and collections)
469
469
  * within Firestore.
470
- */ V.H = new V([]);
470
+ */ L.H = new L([]);
471
471
 
472
- var L = /^[_a-zA-Z][_a-zA-Z0-9]*$/, O = /** @class */ function(e) {
472
+ var V = /^[_a-zA-Z][_a-zA-Z0-9]*$/, U = /** @class */ function(e) {
473
473
  function n() {
474
474
  return null !== e && e.apply(this, arguments) || this;
475
475
  }
@@ -481,7 +481,7 @@ var L = /^[_a-zA-Z][_a-zA-Z0-9]*$/, O = /** @class */ function(e) {
481
481
  * without escaping.
482
482
  */
483
483
  n.J = function(t) {
484
- return L.test(t);
484
+ return V.test(t);
485
485
  }, n.prototype.G = function() {
486
486
  return this.j().map((function(t) {
487
487
  return t = t.replace("\\", "\\\\").replace("`", "\\`"), n.J(t) || (t = "`" + t + "`"),
@@ -530,7 +530,7 @@ var L = /^[_a-zA-Z][_a-zA-Z0-9]*$/, O = /** @class */ function(e) {
530
530
  }, n;
531
531
  }(D);
532
532
 
533
- /** A dot-separated path for navigating sub-objects within a document. */ O.H = new O([]);
533
+ /** A dot-separated path for navigating sub-objects within a document. */ U.H = new U([]);
534
534
 
535
535
  /**
536
536
  * @license
@@ -548,21 +548,21 @@ var L = /^[_a-zA-Z][_a-zA-Z0-9]*$/, O = /** @class */ function(e) {
548
548
  * See the License for the specific language governing permissions and
549
549
  * limitations under the License.
550
550
  */
551
- var U = /** @class */ function() {
551
+ var O = /** @class */ function() {
552
552
  function t(t) {
553
553
  this.path = t;
554
554
  }
555
555
  return t.tt = function(e) {
556
- return new t(V.K(e).$(5));
556
+ return new t(L.K(e).$(5));
557
557
  },
558
558
  /** Returns true if the document is in the specified collectionId. */ t.prototype.et = function(t) {
559
559
  return this.path.length >= 2 && this.path.get(this.path.length - 2) === t;
560
560
  }, t.prototype.isEqual = function(t) {
561
- return null !== t && 0 === V.k(this.path, t.path);
561
+ return null !== t && 0 === L.k(this.path, t.path);
562
562
  }, t.prototype.toString = function() {
563
563
  return this.path.toString();
564
564
  }, t.k = function(t, e) {
565
- return V.k(t.path, e.path);
565
+ return L.k(t.path, e.path);
566
566
  }, t.st = function(t) {
567
567
  return t.length % 2 == 0;
568
568
  },
@@ -573,11 +573,11 @@ var U = /** @class */ function() {
573
573
  * @return A new instance of DocumentKey
574
574
  */
575
575
  t.it = function(e) {
576
- return new t(new V(e.slice()));
576
+ return new t(new L(e.slice()));
577
577
  }, t;
578
578
  }();
579
579
 
580
- U.EMPTY = new U(new V([]));
580
+ O.EMPTY = new O(new L([]));
581
581
 
582
582
  /**
583
583
  * @license
@@ -676,15 +676,15 @@ var C = /** @class */ function() {
676
676
  },
677
677
  // Returns an iterator over the SortedMap.
678
678
  t.prototype.lt = function() {
679
- return new q(this.root, null, this.k, !1);
679
+ return new P(this.root, null, this.k, !1);
680
680
  }, t.prototype._t = function(t) {
681
- return new q(this.root, t, this.k, !1);
681
+ return new P(this.root, t, this.k, !1);
682
682
  }, t.prototype.dt = function() {
683
- return new q(this.root, null, this.k, !0);
683
+ return new P(this.root, null, this.k, !0);
684
684
  }, t.prototype.ft = function(t) {
685
- return new q(this.root, t, this.k, !0);
685
+ return new P(this.root, t, this.k, !0);
686
686
  }, t;
687
- }(), q = /** @class */ function() {
687
+ }(), P = /** @class */ function() {
688
688
  function t(t, e, n, r) {
689
689
  this.wt = r, this.Tt = [];
690
690
  for (var i = 1; !t.q(); ) if (i = e ? n(t.key, e) : 1,
@@ -813,10 +813,10 @@ var C = /** @class */ function() {
813
813
  // In a balanced RB tree, the black-depth (number of black nodes) from root to
814
814
  // leaves is equal on both sides. This function verifies that or asserts.
815
815
  t.prototype.Ct = function() {
816
- if (this.Vt() && this.left.Vt()) throw Ve("Red node has red child(" + this.key + "," + this.value + ")");
817
- if (this.right.Vt()) throw Ve("Right child of (" + this.key + "," + this.value + ") is red");
816
+ if (this.Vt() && this.left.Vt()) throw Le("Red node has red child(" + this.key + "," + this.value + ")");
817
+ if (this.right.Vt()) throw Le("Right child of (" + this.key + "," + this.value + ") is red");
818
818
  var t = this.left.Ct();
819
- if (t !== this.right.Ct()) throw Ve("Black depths differ");
819
+ if (t !== this.right.Ct()) throw Le("Black depths differ");
820
820
  return t + (this.Vt() ? 0 : 1);
821
821
  }, t;
822
822
  }();
@@ -834,31 +834,31 @@ M.EMPTY = new (/** @class */ function() {
834
834
  }
835
835
  return Object.defineProperty(t.prototype, "key", {
836
836
  get: function() {
837
- throw Ve("LLRBEmptyNode has no key.");
837
+ throw Le("LLRBEmptyNode has no key.");
838
838
  },
839
839
  enumerable: !0,
840
840
  configurable: !0
841
841
  }), Object.defineProperty(t.prototype, "value", {
842
842
  get: function() {
843
- throw Ve("LLRBEmptyNode has no value.");
843
+ throw Le("LLRBEmptyNode has no value.");
844
844
  },
845
845
  enumerable: !0,
846
846
  configurable: !0
847
847
  }), Object.defineProperty(t.prototype, "color", {
848
848
  get: function() {
849
- throw Ve("LLRBEmptyNode has no color.");
849
+ throw Le("LLRBEmptyNode has no color.");
850
850
  },
851
851
  enumerable: !0,
852
852
  configurable: !0
853
853
  }), Object.defineProperty(t.prototype, "left", {
854
854
  get: function() {
855
- throw Ve("LLRBEmptyNode has no left child.");
855
+ throw Le("LLRBEmptyNode has no left child.");
856
856
  },
857
857
  enumerable: !0,
858
858
  configurable: !0
859
859
  }), Object.defineProperty(t.prototype, "right", {
860
860
  get: function() {
861
- throw Ve("LLRBEmptyNode has no right child.");
861
+ throw Le("LLRBEmptyNode has no right child.");
862
862
  },
863
863
  enumerable: !0,
864
864
  configurable: !0
@@ -918,7 +918,7 @@ M.EMPTY = new (/** @class */ function() {
918
918
  * NOTE: if provided comparator returns 0 for two elements, we consider them to
919
919
  * be equal!
920
920
  */
921
- var P = /** @class */ function() {
921
+ var q = /** @class */ function() {
922
922
  function t(t) {
923
923
  this.k = t, this.data = new C(this.k);
924
924
  }
@@ -960,9 +960,9 @@ var P = /** @class */ function() {
960
960
  var e = this.data._t(t);
961
961
  return e.Rt() ? e.Et().key : null;
962
962
  }, t.prototype.lt = function() {
963
- return new x(this.data.lt());
963
+ return new F(this.data.lt());
964
964
  }, t.prototype._t = function(t) {
965
- return new x(this.data._t(t));
965
+ return new F(this.data._t(t));
966
966
  },
967
967
  /** Inserts or updates an element */ t.prototype.add = function(t) {
968
968
  return this.rt(this.data.remove(t).nt(t, !0));
@@ -999,7 +999,7 @@ var P = /** @class */ function() {
999
999
  var n = new t(this.k);
1000
1000
  return n.data = e, n;
1001
1001
  }, t;
1002
- }(), x = /** @class */ function() {
1002
+ }(), F = /** @class */ function() {
1003
1003
  function t(t) {
1004
1004
  this.Lt = t;
1005
1005
  }
@@ -1032,7 +1032,7 @@ function G(t) {
1032
1032
  return e;
1033
1033
  }
1034
1034
 
1035
- function F(t, e) {
1035
+ function x(t, e) {
1036
1036
  for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);
1037
1037
  }
1038
1038
 
@@ -1064,7 +1064,7 @@ function j(t) {
1064
1064
  * sent on the wire. This class abstracts away this differentiation by holding
1065
1065
  * the proto byte string in a common class that must be converted into a string
1066
1066
  * before being sent as a proto.
1067
- */ var B = /** @class */ function() {
1067
+ */ var Q = /** @class */ function() {
1068
1068
  function t(t) {
1069
1069
  this.$t = t;
1070
1070
  }
@@ -1089,17 +1089,17 @@ function j(t) {
1089
1089
  }, t.prototype.Mt = function() {
1090
1090
  return 2 * this.$t.length;
1091
1091
  }, t.prototype.C = function(t) {
1092
- return Ue(this.$t, t.$t);
1092
+ return Oe(this.$t, t.$t);
1093
1093
  }, t.prototype.isEqual = function(t) {
1094
1094
  return this.$t === t.$t;
1095
1095
  }, t;
1096
1096
  }();
1097
1097
 
1098
- function z(t) {
1098
+ function B(t) {
1099
1099
  return null == t;
1100
1100
  }
1101
1101
 
1102
- /** Returns whether the value represents -0. */ function Q(t) {
1102
+ /** Returns whether the value represents -0. */ function z(t) {
1103
1103
  // Detect if the value is -0.0. Based on polyfill from
1104
1104
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
1105
1105
  return -0 === t && 1 / t == -1 / 0;
@@ -1140,15 +1140,15 @@ function z(t) {
1140
1140
  * limitations under the License.
1141
1141
  */
1142
1142
  // A RegExp matching ISO 8601 UTC timestamps with optional fraction.
1143
- B.Ut = new B("");
1143
+ Q.Ut = new Q("");
1144
1144
 
1145
1145
  var W = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1146
1146
 
1147
1147
  /** Extracts the backend's type order for the provided value. */ function J(t) {
1148
- return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ? H(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : Ve("Invalid value type: " + JSON.stringify(t));
1148
+ return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ? H(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : Le("Invalid value type: " + JSON.stringify(t));
1149
1149
  }
1150
1150
 
1151
- /** Tests `left` and `right` for equality based on the backend semantics. */ function X(t, e) {
1151
+ /** Tests `left` and `right` for equality based on the backend semantics. */ function Z(t, e) {
1152
1152
  var n = J(t);
1153
1153
  if (n !== J(e)) return !1;
1154
1154
  switch (n) {
@@ -1191,42 +1191,42 @@ var W = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1191
1191
  if ("integerValue" in t && "integerValue" in e) return nt(t.integerValue) === nt(e.integerValue);
1192
1192
  if ("doubleValue" in t && "doubleValue" in e) {
1193
1193
  var n = nt(t.doubleValue), r = nt(e.doubleValue);
1194
- return n === r ? Q(n) === Q(r) : isNaN(n) && isNaN(r);
1194
+ return n === r ? z(n) === z(r) : isNaN(n) && isNaN(r);
1195
1195
  }
1196
1196
  return !1;
1197
1197
  }(t, e);
1198
1198
 
1199
1199
  case 9 /* ArrayValue */ :
1200
- return Ce(t.arrayValue.values || [], e.arrayValue.values || [], X);
1200
+ return Ce(t.arrayValue.values || [], e.arrayValue.values || [], Z);
1201
1201
 
1202
1202
  case 10 /* ObjectValue */ :
1203
1203
  return function(t, e) {
1204
1204
  var n = t.mapValue.fields || {}, r = e.mapValue.fields || {};
1205
1205
  if (G(n) !== G(r)) return !1;
1206
- for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !X(n[i], r[i]))) return !1;
1206
+ for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !Z(n[i], r[i]))) return !1;
1207
1207
  return !0;
1208
1208
  }(t, e);
1209
1209
 
1210
1210
  default:
1211
- return Ve("Unexpected value type: " + JSON.stringify(t));
1211
+ return Le("Unexpected value type: " + JSON.stringify(t));
1212
1212
  }
1213
1213
  }
1214
1214
 
1215
- function K(t, e) {
1215
+ function X(t, e) {
1216
1216
  return void 0 !== (t.values || []).find((function(t) {
1217
- return X(t, e);
1217
+ return Z(t, e);
1218
1218
  }));
1219
1219
  }
1220
1220
 
1221
- function Z(t, e) {
1221
+ function K(t, e) {
1222
1222
  var n = J(t), r = J(e);
1223
- if (n !== r) return Ue(n, r);
1223
+ if (n !== r) return Oe(n, r);
1224
1224
  switch (n) {
1225
1225
  case 0 /* NullValue */ :
1226
1226
  return 0;
1227
1227
 
1228
1228
  case 1 /* BooleanValue */ :
1229
- return Ue(t.booleanValue, e.booleanValue);
1229
+ return Oe(t.booleanValue, e.booleanValue);
1230
1230
 
1231
1231
  case 2 /* NumberValue */ :
1232
1232
  return function(t, e) {
@@ -1243,7 +1243,7 @@ function Z(t, e) {
1243
1243
  return $(Y(t), Y(e));
1244
1244
 
1245
1245
  case 5 /* StringValue */ :
1246
- return Ue(t.stringValue, e.stringValue);
1246
+ return Oe(t.stringValue, e.stringValue);
1247
1247
 
1248
1248
  case 6 /* BlobValue */ :
1249
1249
  return function(t, e) {
@@ -1254,25 +1254,25 @@ function Z(t, e) {
1254
1254
  case 7 /* RefValue */ :
1255
1255
  return function(t, e) {
1256
1256
  for (var n = t.split("/"), r = e.split("/"), i = 0; i < n.length && i < r.length; i++) {
1257
- var o = Ue(n[i], r[i]);
1257
+ var o = Oe(n[i], r[i]);
1258
1258
  if (0 !== o) return o;
1259
1259
  }
1260
- return Ue(n.length, r.length);
1260
+ return Oe(n.length, r.length);
1261
1261
  }(t.referenceValue, e.referenceValue);
1262
1262
 
1263
1263
  case 8 /* GeoPointValue */ :
1264
1264
  return function(t, e) {
1265
- var n = Ue(nt(t.latitude), nt(e.latitude));
1266
- return 0 !== n ? n : Ue(nt(t.longitude), nt(e.longitude));
1265
+ var n = Oe(nt(t.latitude), nt(e.latitude));
1266
+ return 0 !== n ? n : Oe(nt(t.longitude), nt(e.longitude));
1267
1267
  }(t.geoPointValue, e.geoPointValue);
1268
1268
 
1269
1269
  case 9 /* ArrayValue */ :
1270
1270
  return function(t, e) {
1271
1271
  for (var n = t.values || [], r = e.values || [], i = 0; i < n.length && i < r.length; ++i) {
1272
- var o = Z(n[i], r[i]);
1272
+ var o = K(n[i], r[i]);
1273
1273
  if (o) return o;
1274
1274
  }
1275
- return Ue(n.length, r.length);
1275
+ return Oe(n.length, r.length);
1276
1276
  }(t.arrayValue, e.arrayValue);
1277
1277
 
1278
1278
  case 10 /* ObjectValue */ :
@@ -1284,23 +1284,23 @@ function Z(t, e) {
1284
1284
  // canonical IDs are independent of insertion order.
1285
1285
  r.sort(), o.sort();
1286
1286
  for (var s = 0; s < r.length && s < o.length; ++s) {
1287
- var u = Ue(r[s], o[s]);
1287
+ var u = Oe(r[s], o[s]);
1288
1288
  if (0 !== u) return u;
1289
- var a = Z(n[r[s]], i[o[s]]);
1289
+ var a = K(n[r[s]], i[o[s]]);
1290
1290
  if (0 !== a) return a;
1291
1291
  }
1292
- return Ue(r.length, o.length);
1292
+ return Oe(r.length, o.length);
1293
1293
  }(t.mapValue, e.mapValue);
1294
1294
 
1295
1295
  default:
1296
- throw Ve("Invalid value type: " + n);
1296
+ throw Le("Invalid value type: " + n);
1297
1297
  }
1298
1298
  }
1299
1299
 
1300
1300
  function $(t, e) {
1301
- if ("string" == typeof t && "string" == typeof e && t.length === e.length) return Ue(t, e);
1302
- var n = et(t), r = et(e), i = Ue(n.seconds, r.seconds);
1303
- return 0 !== i ? i : Ue(n.nanos, r.nanos);
1301
+ if ("string" == typeof t && "string" == typeof e && t.length === e.length) return Oe(t, e);
1302
+ var n = et(t), r = et(e), i = Oe(n.seconds, r.seconds);
1303
+ return 0 !== i ? i : Oe(n.nanos, r.nanos);
1304
1304
  }
1305
1305
 
1306
1306
  function tt(t) {
@@ -1309,7 +1309,7 @@ function tt(t) {
1309
1309
  var e = et(t);
1310
1310
  return "time(" + e.seconds + "," + e.nanos + ")";
1311
1311
  }(e.timestampValue) : "stringValue" in e ? e.stringValue : "bytesValue" in e ? rt(e.bytesValue).toBase64() : "referenceValue" in e ? (r = e.referenceValue,
1312
- U.tt(r).toString()) : "geoPointValue" in e ? "geo(" + (n = e.geoPointValue).latitude + "," + n.longitude + ")" : "arrayValue" in e ? function(e) {
1312
+ O.tt(r).toString()) : "geoPointValue" in e ? "geo(" + (n = e.geoPointValue).latitude + "," + n.longitude + ")" : "arrayValue" in e ? function(e) {
1313
1313
  for (var n = "[", r = !0, i = 0, o = e.values || []; i < o.length; i++) {
1314
1314
  var s = o[i];
1315
1315
  r ? r = !1 : n += ",", n += t(s);
@@ -1324,7 +1324,7 @@ function tt(t) {
1324
1324
  r ? r = !1 : n += ",", n += s + ":" + t(e.fields[s]);
1325
1325
  }
1326
1326
  return n + "}";
1327
- }(e.mapValue) : Ve("Invalid value type: " + JSON.stringify(e));
1327
+ }(e.mapValue) : Le("Invalid value type: " + JSON.stringify(e));
1328
1328
  var n, r;
1329
1329
  }(t);
1330
1330
  }
@@ -1333,12 +1333,12 @@ function et(t) {
1333
1333
  // The json interface (for the browser) will return an iso timestamp string,
1334
1334
  // while the proto js library (for node) will return a
1335
1335
  // google.protobuf.Timestamp instance.
1336
- if (Le(!!t, "Cannot normalize null or undefined timestamp."), "string" == typeof t) {
1336
+ if (Ve(!!t, "Cannot normalize null or undefined timestamp."), "string" == typeof t) {
1337
1337
  // The date string can have higher precision (nanos) than the Date class
1338
1338
  // (millis), so we do some custom parsing here.
1339
1339
  // Parse the nanos right out of the string.
1340
1340
  var e = 0, n = W.exec(t);
1341
- if (Le(!!n, "invalid timestamp: " + t), n[1]) {
1341
+ if (Ve(!!n, "invalid timestamp: " + t), n[1]) {
1342
1342
  // Pad the fraction out to 9 digits (nanos).
1343
1343
  var r = n[1];
1344
1344
  r = (r + "000000000").substr(0, 9), e = Number(r);
@@ -1365,7 +1365,7 @@ function et(t) {
1365
1365
  }
1366
1366
 
1367
1367
  /** Converts the possible Proto types for Blobs into a ByteString. */ function rt(t) {
1368
- return "string" == typeof t ? B.fromBase64String(t) : B.fromUint8Array(t);
1368
+ return "string" == typeof t ? Q.fromBase64String(t) : Q.fromUint8Array(t);
1369
1369
  }
1370
1370
 
1371
1371
  /** Returns a reference value for the provided database and key. */ function it(t, e) {
@@ -1459,7 +1459,7 @@ var ft = /** @class */ function() {
1459
1459
  }, t.prototype.apply = function(t) {
1460
1460
  for (var e = dt(t), n = function(t) {
1461
1461
  e.some((function(e) {
1462
- return X(e, t);
1462
+ return Z(e, t);
1463
1463
  })) || e.push(t);
1464
1464
  }, r = 0, i = this.elements; r < i.length; r++) {
1465
1465
  n(i[r]);
@@ -1473,7 +1473,7 @@ var ft = /** @class */ function() {
1473
1473
  return null;
1474
1474
  // Array transforms are idempotent and don't require a base value.
1475
1475
  }, t.prototype.isEqual = function(e) {
1476
- return e instanceof t && Ce(this.elements, e.elements, X);
1476
+ return e instanceof t && Ce(this.elements, e.elements, Z);
1477
1477
  }, t;
1478
1478
  }(), lt = /** @class */ function() {
1479
1479
  function t(t) {
@@ -1489,7 +1489,7 @@ var ft = /** @class */ function() {
1489
1489
  }, t.prototype.apply = function(t) {
1490
1490
  for (var e = dt(t), n = function(t) {
1491
1491
  e = e.filter((function(e) {
1492
- return !X(e, t);
1492
+ return !Z(e, t);
1493
1493
  }));
1494
1494
  }, r = 0, i = this.elements; r < i.length; r++) {
1495
1495
  n(i[r]);
@@ -1503,7 +1503,7 @@ var ft = /** @class */ function() {
1503
1503
  return null;
1504
1504
  // Array transforms are idempotent and don't require a base value.
1505
1505
  }, t.prototype.isEqual = function(e) {
1506
- return e instanceof t && Ce(this.elements, e.elements, X);
1506
+ return e instanceof t && Ce(this.elements, e.elements, Z);
1507
1507
  }, t;
1508
1508
  }(), pt = /** @class */ function() {
1509
1509
  function t(t, e) {
@@ -1530,7 +1530,7 @@ var ft = /** @class */ function() {
1530
1530
  };
1531
1531
  var e;
1532
1532
  }, t.prototype.isEqual = function(e) {
1533
- return e instanceof t && X(this.Qt, e.Qt);
1533
+ return e instanceof t && Z(this.Qt, e.Qt);
1534
1534
  }, t.prototype.asNumber = function(t) {
1535
1535
  return nt(t.integerValue || t.doubleValue);
1536
1536
  }, t;
@@ -1573,7 +1573,7 @@ var ft = /** @class */ function() {
1573
1573
  return t.Gt = function(e) {
1574
1574
  return new t(e);
1575
1575
  }, t.zt = function(e) {
1576
- var n = new P(O.k);
1576
+ var n = new q(U.k);
1577
1577
  return e.forEach((function(t) {
1578
1578
  return n = n.add(t);
1579
1579
  })), new t(n);
@@ -1792,7 +1792,7 @@ var wt = /** @class */ function() {
1792
1792
  r.Zt = gt.exists(!0), r;
1793
1793
  }
1794
1794
  return t(n, e), n.prototype.Bt = function(t, e) {
1795
- if (this.Yt(t), Le(null != e.transformResults, "Transform results missing for TransformMutation."),
1795
+ if (this.Yt(t), Ve(null != e.transformResults, "Transform results missing for TransformMutation."),
1796
1796
  !this.Zt.Jt(t))
1797
1797
  // Since the mutation was not rejected, we know that the precondition
1798
1798
  // matched on the backend. We therefore must not have the expected version
@@ -1840,7 +1840,7 @@ var wt = /** @class */ function() {
1840
1840
  */
1841
1841
  n.prototype.ae = function(t, e) {
1842
1842
  var n = [];
1843
- Le(this.fieldTransforms.length === e.length, "server transform result count (" + e.length + ") should match field transform count (" + this.fieldTransforms.length + ")");
1843
+ Ve(this.fieldTransforms.length === e.length, "server transform result count (" + e.length + ") should match field transform count (" + this.fieldTransforms.length + ")");
1844
1844
  for (var r = 0; r < e.length; r++) {
1845
1845
  var i = this.fieldTransforms[r], o = i.transform, s = null;
1846
1846
  t instanceof St && (s = t.field(i.field)), n.push(o.Bt(s, e[r]));
@@ -1902,11 +1902,11 @@ var wt = /** @class */ function() {
1902
1902
  return (r = e.call(this) || this).key = t, r.Zt = n, r.type = 4 /* Verify */ , r;
1903
1903
  }
1904
1904
  return t(n, e), n.prototype.Bt = function(t, e) {
1905
- Ve("VerifyMutation should only be used in Transactions.");
1905
+ Le("VerifyMutation should only be used in Transactions.");
1906
1906
  }, n.prototype.qt = function(t, e, n) {
1907
- Ve("VerifyMutation should only be used in Transactions.");
1907
+ Le("VerifyMutation should only be used in Transactions.");
1908
1908
  }, n.prototype.ee = function(t) {
1909
- Ve("VerifyMutation should only be used in Transactions.");
1909
+ Le("VerifyMutation should only be used in Transactions.");
1910
1910
  }, n.prototype.isEqual = function(t) {
1911
1911
  return t instanceof n && this.key.isEqual(t.key) && this.Zt.isEqual(t.Zt);
1912
1912
  }, n;
@@ -1938,9 +1938,9 @@ var wt = /** @class */ function() {
1938
1938
  t.prototype.se = function() {
1939
1939
  return this._e(this.proto.mapValue);
1940
1940
  }, t.prototype._e = function(t) {
1941
- var e = this, n = new P(O.k);
1942
- return F(t.fields || {}, (function(t, r) {
1943
- var i = new O([ t ]);
1941
+ var e = this, n = new q(U.k);
1942
+ return x(t.fields || {}, (function(t, r) {
1943
+ var i = new U([ t ]);
1944
1944
  if (10 /* ObjectValue */ === J(r)) {
1945
1945
  var o = e._e(r.mapValue).fields;
1946
1946
  o.q() ?
@@ -1957,7 +1957,7 @@ var wt = /** @class */ function() {
1957
1957
  n = n.add(i);
1958
1958
  })), yt.Gt(n);
1959
1959
  }, t.prototype.isEqual = function(t) {
1960
- return X(this.proto, t.proto);
1960
+ return Z(this.proto, t.proto);
1961
1961
  },
1962
1962
  /** Creates a ObjectValueBuilder instance that is based on the current value. */ t.prototype.re = function() {
1963
1963
  return new _t(this);
@@ -2022,7 +2022,7 @@ var _t = /** @class */ function() {
2022
2022
  n.set(t.U(), e);
2023
2023
  },
2024
2024
  /** Returns an ObjectValue with all mutations applied. */ t.prototype.he = function() {
2025
- var t = this.Te(O.H, this.fe);
2025
+ var t = this.Te(U.H, this.fe);
2026
2026
  return null != t ? new Tt(t) : this.de;
2027
2027
  },
2028
2028
  /**
@@ -2056,7 +2056,7 @@ var _t = /** @class */ function() {
2056
2056
  this.key = t, this.version = e;
2057
2057
  }
2058
2058
  return t.me = function(t, e) {
2059
- return U.k(t.key, e.key);
2059
+ return O.k(t.key, e.key);
2060
2060
  }, t;
2061
2061
  }(), St = /** @class */ function(e) {
2062
2062
  function n(t, n, r, i) {
@@ -2082,7 +2082,7 @@ var _t = /** @class */ function() {
2082
2082
  configurable: !0
2083
2083
  }), n.Ie = function(t, e, n) {
2084
2084
  var r = e.field(t), i = n.field(t);
2085
- return null !== r && null !== i ? Z(r, i) : Ve("Trying to compare documents on fields that don't exist");
2085
+ return null !== r && null !== i ? K(r, i) : Le("Trying to compare documents on fields that don't exist");
2086
2086
  }, n;
2087
2087
  }(kt), Rt = /** @class */ function(e) {
2088
2088
  function n(t, n, r) {
@@ -2116,7 +2116,7 @@ var _t = /** @class */ function() {
2116
2116
  }), n.prototype.isEqual = function(t) {
2117
2117
  return t instanceof n && t.version.isEqual(this.version) && t.key.isEqual(this.key);
2118
2118
  }, n;
2119
- }(kt), Vt = /** @class */ function() {
2119
+ }(kt), Lt = /** @class */ function() {
2120
2120
  /**
2121
2121
  * Initializes a Target with a path and optional additional query constraints.
2122
2122
  * Path must currently be empty if this is a collection group query.
@@ -2139,7 +2139,7 @@ var _t = /** @class */ function() {
2139
2139
  return t.canonicalId();
2140
2140
  })).join(","), t += "|ob:", t += this.orderBy.map((function(t) {
2141
2141
  return t.canonicalId();
2142
- })).join(","), z(this.limit) || (t += "|l:", t += this.limit), this.startAt && (t += "|lb:",
2142
+ })).join(","), B(this.limit) || (t += "|l:", t += this.limit), this.startAt && (t += "|lb:",
2143
2143
  t += this.startAt.canonicalId()), this.endAt && (t += "|ub:", t += this.endAt.canonicalId()),
2144
2144
  this.Ae = t;
2145
2145
  }
@@ -2148,7 +2148,7 @@ var _t = /** @class */ function() {
2148
2148
  var t = this.path.G();
2149
2149
  return null !== this.collectionGroup && (t += " collectionGroup=" + this.collectionGroup),
2150
2150
  this.filters.length > 0 && (t += ", filters: [" + this.filters.join(", ") + "]"),
2151
- z(this.limit) || (t += ", limit: " + this.limit), this.orderBy.length > 0 && (t += ", orderBy: [" + this.orderBy.join(", ") + "]"),
2151
+ B(this.limit) || (t += ", limit: " + this.limit), this.orderBy.length > 0 && (t += ", orderBy: [" + this.orderBy.join(", ") + "]"),
2152
2152
  this.startAt && (t += ", startAt: " + this.startAt.canonicalId()), this.endAt && (t += ", endAt: " + this.endAt.canonicalId()),
2153
2153
  "Target(" + t + ")";
2154
2154
  }, t.prototype.isEqual = function(t) {
@@ -2159,9 +2159,9 @@ var _t = /** @class */ function() {
2159
2159
  for (var n = 0; n < this.filters.length; n++) if (!this.filters[n].isEqual(t.filters[n])) return !1;
2160
2160
  return this.collectionGroup === t.collectionGroup && !!this.path.isEqual(t.path) && !!(null !== this.startAt ? this.startAt.isEqual(t.startAt) : null === t.startAt) && (null !== this.endAt ? this.endAt.isEqual(t.endAt) : null === t.endAt);
2161
2161
  }, t.prototype.Pe = function() {
2162
- return U.st(this.path) && null === this.collectionGroup && 0 === this.filters.length;
2162
+ return O.st(this.path) && null === this.collectionGroup && 0 === this.filters.length;
2163
2163
  }, t;
2164
- }(), Lt = /** @class */ function() {
2164
+ }(), Vt = /** @class */ function() {
2165
2165
  /**
2166
2166
  * Initializes a Query with a path and optional additional query constraints.
2167
2167
  * Path must currently be empty if this is a collection group query.
@@ -2185,7 +2185,7 @@ var _t = /** @class */ function() {
2185
2185
  // In order to implicitly add key ordering, we must also add the
2186
2186
  // inequality filter field for it to be a valid query.
2187
2187
  // Note that the default inequality field and key ordering is ascending.
2188
- t.Y() ? this.ge = [ Qt ] : this.ge = [ new zt(t), Qt ]; else {
2188
+ t.Y() ? this.ge = [ zt ] : this.ge = [ new Bt(t), zt ]; else {
2189
2189
  this.ge = [];
2190
2190
  for (var n = !1, r = 0, i = this.Ve; r < i.length; r++) {
2191
2191
  var o = i[r];
@@ -2195,7 +2195,7 @@ var _t = /** @class */ function() {
2195
2195
  // The order of the implicit key ordering always matches the last
2196
2196
  // explicit order by
2197
2197
  var s = this.Ve.length > 0 ? this.Ve[this.Ve.length - 1].dir : Gt.ASCENDING;
2198
- this.ge.push(s === Gt.ASCENDING ? Qt : Ht);
2198
+ this.ge.push(s === Gt.ASCENDING ? zt : Ht);
2199
2199
  }
2200
2200
  }
2201
2201
  }
@@ -2255,15 +2255,15 @@ var _t = /** @class */ function() {
2255
2255
  }, t.prototype.matches = function(t) {
2256
2256
  return this.Be(t) && this.xe(t) && this.Qe(t) && this.We(t);
2257
2257
  }, t.prototype.je = function() {
2258
- return !z(this.limit) && "F" /* First */ === this.pe;
2258
+ return !B(this.limit) && "F" /* First */ === this.pe;
2259
2259
  }, t.prototype.Ge = function() {
2260
- return !z(this.limit) && "L" /* Last */ === this.pe;
2260
+ return !B(this.limit) && "L" /* Last */ === this.pe;
2261
2261
  }, t.prototype.Ce = function() {
2262
2262
  return this.Ve.length > 0 ? this.Ve[0].field : null;
2263
2263
  }, t.prototype.Se = function() {
2264
2264
  for (var t = 0, e = this.filters; t < e.length; t++) {
2265
2265
  var n = e[t];
2266
- if (n instanceof Ut && n.ze()) return n.field;
2266
+ if (n instanceof Ot && n.ze()) return n.field;
2267
2267
  }
2268
2268
  return null;
2269
2269
  },
@@ -2272,7 +2272,7 @@ var _t = /** @class */ function() {
2272
2272
  t.prototype.Ke = function(t) {
2273
2273
  for (var e = 0, n = this.filters; e < n.length; e++) {
2274
2274
  var r = n[e];
2275
- if (r instanceof Ut && t.indexOf(r.op) >= 0) return r.op;
2275
+ if (r instanceof Ot && t.indexOf(r.op) >= 0) return r.op;
2276
2276
  }
2277
2277
  return null;
2278
2278
  }, t.prototype.Pe = function() {
@@ -2285,22 +2285,22 @@ var _t = /** @class */ function() {
2285
2285
  * representation.
2286
2286
  */
2287
2287
  t.prototype.Ue = function() {
2288
- if (!this.ye) if ("F" /* First */ === this.pe) this.ye = new Vt(this.path, this.collectionGroup, this.orderBy, this.filters, this.limit, this.startAt, this.endAt); else {
2288
+ if (!this.ye) if ("F" /* First */ === this.pe) this.ye = new Lt(this.path, this.collectionGroup, this.orderBy, this.filters, this.limit, this.startAt, this.endAt); else {
2289
2289
  for (
2290
2290
  // Flip the orderBy directions since we want the last results
2291
2291
  var t = [], e = 0, n = this.orderBy; e < n.length; e++) {
2292
2292
  var r = n[e], i = r.dir === Gt.DESCENDING ? Gt.ASCENDING : Gt.DESCENDING;
2293
- t.push(new zt(r.field, i));
2293
+ t.push(new Bt(r.field, i));
2294
2294
  }
2295
2295
  // We need to swap the cursors to match the now-flipped query ordering.
2296
- var o = this.endAt ? new Bt(this.endAt.position, !this.endAt.before) : null, s = this.startAt ? new Bt(this.startAt.position, !this.startAt.before) : null;
2296
+ var o = this.endAt ? new Qt(this.endAt.position, !this.endAt.before) : null, s = this.startAt ? new Qt(this.startAt.position, !this.startAt.before) : null;
2297
2297
  // Now return as a LimitType.First query.
2298
- this.ye = new Vt(this.path, this.collectionGroup, t, this.filters, this.limit, o, s);
2298
+ this.ye = new Lt(this.path, this.collectionGroup, t, this.filters, this.limit, o, s);
2299
2299
  }
2300
2300
  return this.ye;
2301
2301
  }, t.prototype.Be = function(t) {
2302
2302
  var e = t.key.path;
2303
- return null !== this.collectionGroup ? t.key.et(this.collectionGroup) && this.path.B(e) : U.st(this.path) ? this.path.isEqual(e) : this.path.W(e);
2303
+ return null !== this.collectionGroup ? t.key.et(this.collectionGroup) && this.path.B(e) : O.st(this.path) ? this.path.isEqual(e) : this.path.W(e);
2304
2304
  },
2305
2305
  /**
2306
2306
  * A document must have a value for every ordering clause in order to show up
@@ -2325,7 +2325,7 @@ var _t = /** @class */ function() {
2325
2325
  t.prototype.We = function(t) {
2326
2326
  return !(this.startAt && !this.startAt.Je(this.orderBy, t) || this.endAt && this.endAt.Je(this.orderBy, t));
2327
2327
  }, t.prototype.be = function(t) {}, t;
2328
- }(), Ot = /** @class */ function() {
2328
+ }(), Ut = /** @class */ function() {
2329
2329
  function t(t) {
2330
2330
  this.name = t;
2331
2331
  }
@@ -2356,7 +2356,7 @@ var _t = /** @class */ function() {
2356
2356
  return t.ARRAY_CONTAINS_ANY;
2357
2357
 
2358
2358
  default:
2359
- return Ve("Unknown FieldFilter operator: " + e);
2359
+ return Le("Unknown FieldFilter operator: " + e);
2360
2360
  }
2361
2361
  }, t.prototype.toString = function() {
2362
2362
  return this.name;
@@ -2384,11 +2384,11 @@ var _t = /** @class */ function() {
2384
2384
  /**
2385
2385
  * The result of a lookup for a given path may be an existing document or a
2386
2386
  * marker that this document does not exist at a given version.
2387
- */ Ot.LESS_THAN = new Ot("<"), Ot.LESS_THAN_OR_EQUAL = new Ot("<="), Ot.EQUAL = new Ot("=="),
2388
- Ot.GREATER_THAN = new Ot(">"), Ot.GREATER_THAN_OR_EQUAL = new Ot(">="), Ot.ARRAY_CONTAINS = new Ot("array-contains"),
2389
- Ot.IN = new Ot("in"), Ot.ARRAY_CONTAINS_ANY = new Ot("array-contains-any");
2387
+ */ Ut.LESS_THAN = new Ut("<"), Ut.LESS_THAN_OR_EQUAL = new Ut("<="), Ut.EQUAL = new Ut("=="),
2388
+ Ut.GREATER_THAN = new Ut(">"), Ut.GREATER_THAN_OR_EQUAL = new Ut(">="), Ut.ARRAY_CONTAINS = new Ut("array-contains"),
2389
+ Ut.IN = new Ut("in"), Ut.ARRAY_CONTAINS_ANY = new Ut("array-contains-any");
2390
2390
 
2391
- var Ut = /** @class */ function(e) {
2391
+ var Ot = /** @class */ function(e) {
2392
2392
  function n(t, n, r) {
2393
2393
  var i = this;
2394
2394
  return (i = e.call(this) || this).field = t, i.op = n, i.value = r, i;
@@ -2396,66 +2396,66 @@ var Ut = /** @class */ function(e) {
2396
2396
  /**
2397
2397
  * Creates a filter based on the provided arguments.
2398
2398
  */ return t(n, e), n.create = function(t, e, r) {
2399
- if (t.Y()) return e === Ot.IN ? new qt(t, r) : new Ct(t, e, r);
2399
+ if (t.Y()) return e === Ut.IN ? new Pt(t, r) : new Ct(t, e, r);
2400
2400
  if (ut(r)) {
2401
- if (e !== Ot.EQUAL) throw new A(b.INVALID_ARGUMENT, "Invalid query. Null supports only equality comparisons.");
2401
+ if (e !== Ut.EQUAL) throw new A(b.INVALID_ARGUMENT, "Invalid query. Null supports only equality comparisons.");
2402
2402
  return new n(t, e, r);
2403
2403
  }
2404
2404
  if (at(r)) {
2405
- if (e !== Ot.EQUAL) throw new A(b.INVALID_ARGUMENT, "Invalid query. NaN supports only equality comparisons.");
2405
+ if (e !== Ut.EQUAL) throw new A(b.INVALID_ARGUMENT, "Invalid query. NaN supports only equality comparisons.");
2406
2406
  return new n(t, e, r);
2407
2407
  }
2408
- return e === Ot.ARRAY_CONTAINS ? new Mt(t, r) : e === Ot.IN ? new Pt(t, r) : e === Ot.ARRAY_CONTAINS_ANY ? new xt(t, r) : new n(t, e, r);
2408
+ return e === Ut.ARRAY_CONTAINS ? new Mt(t, r) : e === Ut.IN ? new qt(t, r) : e === Ut.ARRAY_CONTAINS_ANY ? new Ft(t, r) : new n(t, e, r);
2409
2409
  }, n.prototype.matches = function(t) {
2410
2410
  var e = t.field(this.field);
2411
2411
  // Only compare types with matching backend order (such as double and int).
2412
- return null !== e && J(this.value) === J(e) && this.Ye(Z(e, this.value));
2412
+ return null !== e && J(this.value) === J(e) && this.Ye(K(e, this.value));
2413
2413
  }, n.prototype.Ye = function(t) {
2414
2414
  switch (this.op) {
2415
- case Ot.LESS_THAN:
2415
+ case Ut.LESS_THAN:
2416
2416
  return t < 0;
2417
2417
 
2418
- case Ot.LESS_THAN_OR_EQUAL:
2418
+ case Ut.LESS_THAN_OR_EQUAL:
2419
2419
  return t <= 0;
2420
2420
 
2421
- case Ot.EQUAL:
2421
+ case Ut.EQUAL:
2422
2422
  return 0 === t;
2423
2423
 
2424
- case Ot.GREATER_THAN:
2424
+ case Ut.GREATER_THAN:
2425
2425
  return t > 0;
2426
2426
 
2427
- case Ot.GREATER_THAN_OR_EQUAL:
2427
+ case Ut.GREATER_THAN_OR_EQUAL:
2428
2428
  return t >= 0;
2429
2429
 
2430
2430
  default:
2431
- return Ve("Unknown FieldFilter operator: " + this.op);
2431
+ return Le("Unknown FieldFilter operator: " + this.op);
2432
2432
  }
2433
2433
  }, n.prototype.ze = function() {
2434
- return [ Ot.LESS_THAN, Ot.LESS_THAN_OR_EQUAL, Ot.GREATER_THAN, Ot.GREATER_THAN_OR_EQUAL ].indexOf(this.op) >= 0;
2434
+ return [ Ut.LESS_THAN, Ut.LESS_THAN_OR_EQUAL, Ut.GREATER_THAN, Ut.GREATER_THAN_OR_EQUAL ].indexOf(this.op) >= 0;
2435
2435
  }, n.prototype.canonicalId = function() {
2436
2436
  // TODO(b/29183165): Technically, this won't be unique if two values have
2437
2437
  // the same description, such as the int 3 and the string "3". So we should
2438
2438
  // add the types in here somehow, too.
2439
2439
  return this.field.G() + this.op.toString() + tt(this.value);
2440
2440
  }, n.prototype.isEqual = function(t) {
2441
- return t instanceof n && this.op.isEqual(t.op) && this.field.isEqual(t.field) && X(this.value, t.value);
2441
+ return t instanceof n && this.op.isEqual(t.op) && this.field.isEqual(t.field) && Z(this.value, t.value);
2442
2442
  }, n.prototype.toString = function() {
2443
2443
  return this.field.G() + " " + this.op + " " + tt(this.value);
2444
2444
  }, n;
2445
2445
  }((function() {})), Ct = /** @class */ function(e) {
2446
2446
  function n(t, n, r) {
2447
2447
  var i = this;
2448
- return (i = e.call(this, t, n, r) || this).key = U.tt(r.referenceValue), i;
2448
+ return (i = e.call(this, t, n, r) || this).key = O.tt(r.referenceValue), i;
2449
2449
  }
2450
2450
  return t(n, e), n.prototype.matches = function(t) {
2451
- var e = U.k(t.key, this.key);
2451
+ var e = O.k(t.key, this.key);
2452
2452
  return this.Ye(e);
2453
2453
  }, n;
2454
- }(Ut), qt = /** @class */ function(e) {
2454
+ }(Ot), Pt = /** @class */ function(e) {
2455
2455
  function n(t, n) {
2456
2456
  var r = this;
2457
- return (r = e.call(this, t, Ot.IN, n) || this).keys = (n.arrayValue.values || []).map((function(t) {
2458
- return U.tt(t.referenceValue);
2457
+ return (r = e.call(this, t, Ut.IN, n) || this).keys = (n.arrayValue.values || []).map((function(t) {
2458
+ return O.tt(t.referenceValue);
2459
2459
  })), r;
2460
2460
  }
2461
2461
  return t(n, e), n.prototype.matches = function(t) {
@@ -2463,33 +2463,33 @@ var Ut = /** @class */ function(e) {
2463
2463
  return e.isEqual(t.key);
2464
2464
  }));
2465
2465
  }, n;
2466
- }(Ut), Mt = /** @class */ function(e) {
2466
+ }(Ot), Mt = /** @class */ function(e) {
2467
2467
  function n(t, n) {
2468
- return e.call(this, t, Ot.ARRAY_CONTAINS, n) || this;
2468
+ return e.call(this, t, Ut.ARRAY_CONTAINS, n) || this;
2469
2469
  }
2470
2470
  return t(n, e), n.prototype.matches = function(t) {
2471
2471
  var e = t.field(this.field);
2472
- return st(e) && K(e.arrayValue, this.value);
2472
+ return st(e) && X(e.arrayValue, this.value);
2473
2473
  }, n;
2474
- }(Ut), Pt = /** @class */ function(e) {
2474
+ }(Ot), qt = /** @class */ function(e) {
2475
2475
  function n(t, n) {
2476
- return e.call(this, t, Ot.IN, n) || this;
2476
+ return e.call(this, t, Ut.IN, n) || this;
2477
2477
  }
2478
2478
  return t(n, e), n.prototype.matches = function(t) {
2479
2479
  var e = t.field(this.field);
2480
- return null !== e && K(this.value.arrayValue, e);
2480
+ return null !== e && X(this.value.arrayValue, e);
2481
2481
  }, n;
2482
- }(Ut), xt = /** @class */ function(e) {
2482
+ }(Ot), Ft = /** @class */ function(e) {
2483
2483
  function n(t, n) {
2484
- return e.call(this, t, Ot.ARRAY_CONTAINS_ANY, n) || this;
2484
+ return e.call(this, t, Ut.ARRAY_CONTAINS_ANY, n) || this;
2485
2485
  }
2486
2486
  return t(n, e), n.prototype.matches = function(t) {
2487
2487
  var e = this, n = t.field(this.field);
2488
2488
  return !(!st(n) || !n.arrayValue.values) && n.arrayValue.values.some((function(t) {
2489
- return K(e.value.arrayValue, t);
2489
+ return X(e.value.arrayValue, t);
2490
2490
  }));
2491
2491
  }, n;
2492
- }(Ut), Gt = /** @class */ function() {
2492
+ }(Ot), Gt = /** @class */ function() {
2493
2493
  function t(t) {
2494
2494
  this.name = t;
2495
2495
  }
@@ -2515,7 +2515,7 @@ Gt.DESCENDING = new Gt("desc");
2515
2515
  * after a bound. This is influenced by whether the position is just before or
2516
2516
  * just after the provided values.
2517
2517
  */
2518
- var Ft, jt, Bt = /** @class */ function() {
2518
+ var xt, jt, Qt = /** @class */ function() {
2519
2519
  function t(t, e) {
2520
2520
  this.position = t, this.before = e;
2521
2521
  }
@@ -2532,17 +2532,17 @@ var Ft, jt, Bt = /** @class */ function() {
2532
2532
  t.prototype.Je = function(t, e) {
2533
2533
  for (var n = 0, r = 0; r < this.position.length; r++) {
2534
2534
  var i = t[r], o = this.position[r];
2535
- if (n = i.field.Y() ? U.k(U.tt(o.referenceValue), e.key) : Z(o, e.field(i.field)),
2535
+ if (n = i.field.Y() ? O.k(O.tt(o.referenceValue), e.key) : K(o, e.field(i.field)),
2536
2536
  i.dir === Gt.DESCENDING && (n *= -1), 0 !== n) break;
2537
2537
  }
2538
2538
  return this.before ? n <= 0 : n < 0;
2539
2539
  }, t.prototype.isEqual = function(t) {
2540
2540
  if (null === t) return !1;
2541
2541
  if (this.before !== t.before || this.position.length !== t.position.length) return !1;
2542
- for (var e = 0; e < this.position.length; e++) if (!X(this.position[e], t.position[e])) return !1;
2542
+ for (var e = 0; e < this.position.length; e++) if (!Z(this.position[e], t.position[e])) return !1;
2543
2543
  return !0;
2544
2544
  }, t;
2545
- }(), zt = /** @class */ function() {
2545
+ }(), Bt = /** @class */ function() {
2546
2546
  function t(t, e) {
2547
2547
  this.field = t, void 0 === e && (e = Gt.ASCENDING), this.dir = e, this.Xe = t.Y();
2548
2548
  }
@@ -2556,7 +2556,7 @@ var Ft, jt, Bt = /** @class */ function() {
2556
2556
  return -1 * n;
2557
2557
 
2558
2558
  default:
2559
- return Ve("Unknown direction: " + this.dir);
2559
+ return Le("Unknown direction: " + this.dir);
2560
2560
  }
2561
2561
  }, t.prototype.canonicalId = function() {
2562
2562
  // TODO(b/29183165): Make this collision robust.
@@ -2566,7 +2566,7 @@ var Ft, jt, Bt = /** @class */ function() {
2566
2566
  }, t.prototype.isEqual = function(t) {
2567
2567
  return this.dir === t.dir && this.field.isEqual(t.field);
2568
2568
  }, t;
2569
- }(), Qt = new zt(O.X(), Gt.ASCENDING), Ht = new zt(O.X(), Gt.DESCENDING), Yt = /** @class */ function() {
2569
+ }(), zt = new Bt(U.X(), Gt.ASCENDING), Ht = new Bt(U.X(), Gt.DESCENDING), Yt = /** @class */ function() {
2570
2570
  function t(
2571
2571
  /** The target being listened to. */
2572
2572
  t,
@@ -2594,7 +2594,7 @@ var Ft, jt, Bt = /** @class */ function() {
2594
2594
  * matches the target. The resume token essentially identifies a point in
2595
2595
  * time from which the server should resume sending results.
2596
2596
  */ , s) {
2597
- void 0 === i && (i = R.MIN), void 0 === o && (o = R.MIN), void 0 === s && (s = B.Ut),
2597
+ void 0 === i && (i = R.MIN), void 0 === o && (o = R.MIN), void 0 === s && (s = Q.Ut),
2598
2598
  this.target = t, this.targetId = e, this.Ze = n, this.sequenceNumber = r, this.ts = i,
2599
2599
  this.lastLimboFreeSnapshotVersion = o, this.resumeToken = s;
2600
2600
  }
@@ -2633,7 +2633,7 @@ function(t) {
2633
2633
  function Jt(t) {
2634
2634
  switch (t) {
2635
2635
  case b.OK:
2636
- return Ve("Treated status OK as error");
2636
+ return Le("Treated status OK as error");
2637
2637
 
2638
2638
  case b.CANCELLED:
2639
2639
  case b.UNKNOWN:
@@ -2661,7 +2661,7 @@ function Jt(t) {
2661
2661
  return !0;
2662
2662
 
2663
2663
  default:
2664
- return Ve("Unknown status code: " + t);
2664
+ return Le("Unknown status code: " + t);
2665
2665
  }
2666
2666
  }
2667
2667
 
@@ -2683,65 +2683,65 @@ function Jt(t) {
2683
2683
  *
2684
2684
  * @returns The Code equivalent to the given GRPC status code. Fails if there
2685
2685
  * is no match.
2686
- */ function Xt(t) {
2686
+ */ function Zt(t) {
2687
2687
  if (void 0 === t)
2688
2688
  // This shouldn't normally happen, but in certain error cases (like trying
2689
2689
  // to send invalid proto messages) we may get an error with no GRPC code.
2690
2690
  return Re("GRPC error has no .code"), b.UNKNOWN;
2691
2691
  switch (t) {
2692
- case Ft.OK:
2692
+ case xt.OK:
2693
2693
  return b.OK;
2694
2694
 
2695
- case Ft.CANCELLED:
2695
+ case xt.CANCELLED:
2696
2696
  return b.CANCELLED;
2697
2697
 
2698
- case Ft.UNKNOWN:
2698
+ case xt.UNKNOWN:
2699
2699
  return b.UNKNOWN;
2700
2700
 
2701
- case Ft.DEADLINE_EXCEEDED:
2701
+ case xt.DEADLINE_EXCEEDED:
2702
2702
  return b.DEADLINE_EXCEEDED;
2703
2703
 
2704
- case Ft.RESOURCE_EXHAUSTED:
2704
+ case xt.RESOURCE_EXHAUSTED:
2705
2705
  return b.RESOURCE_EXHAUSTED;
2706
2706
 
2707
- case Ft.INTERNAL:
2707
+ case xt.INTERNAL:
2708
2708
  return b.INTERNAL;
2709
2709
 
2710
- case Ft.UNAVAILABLE:
2710
+ case xt.UNAVAILABLE:
2711
2711
  return b.UNAVAILABLE;
2712
2712
 
2713
- case Ft.UNAUTHENTICATED:
2713
+ case xt.UNAUTHENTICATED:
2714
2714
  return b.UNAUTHENTICATED;
2715
2715
 
2716
- case Ft.INVALID_ARGUMENT:
2716
+ case xt.INVALID_ARGUMENT:
2717
2717
  return b.INVALID_ARGUMENT;
2718
2718
 
2719
- case Ft.NOT_FOUND:
2719
+ case xt.NOT_FOUND:
2720
2720
  return b.NOT_FOUND;
2721
2721
 
2722
- case Ft.ALREADY_EXISTS:
2722
+ case xt.ALREADY_EXISTS:
2723
2723
  return b.ALREADY_EXISTS;
2724
2724
 
2725
- case Ft.PERMISSION_DENIED:
2725
+ case xt.PERMISSION_DENIED:
2726
2726
  return b.PERMISSION_DENIED;
2727
2727
 
2728
- case Ft.FAILED_PRECONDITION:
2728
+ case xt.FAILED_PRECONDITION:
2729
2729
  return b.FAILED_PRECONDITION;
2730
2730
 
2731
- case Ft.ABORTED:
2731
+ case xt.ABORTED:
2732
2732
  return b.ABORTED;
2733
2733
 
2734
- case Ft.OUT_OF_RANGE:
2734
+ case xt.OUT_OF_RANGE:
2735
2735
  return b.OUT_OF_RANGE;
2736
2736
 
2737
- case Ft.UNIMPLEMENTED:
2737
+ case xt.UNIMPLEMENTED:
2738
2738
  return b.UNIMPLEMENTED;
2739
2739
 
2740
- case Ft.DATA_LOSS:
2740
+ case xt.DATA_LOSS:
2741
2741
  return b.DATA_LOSS;
2742
2742
 
2743
2743
  default:
2744
- return Ve("Unknown status code: " + t);
2744
+ return Le("Unknown status code: " + t);
2745
2745
  }
2746
2746
  }
2747
2747
 
@@ -2752,7 +2752,7 @@ function Jt(t) {
2752
2752
  * "UNKNOWN", etc.)
2753
2753
  * @returns The equivalent Code. Non-matching responses are mapped to
2754
2754
  * Code.UNKNOWN.
2755
- */ (jt = Ft || (Ft = {}))[jt.OK = 0] = "OK", jt[jt.CANCELLED = 1] = "CANCELLED",
2755
+ */ (jt = xt || (xt = {}))[jt.OK = 0] = "OK", jt[jt.CANCELLED = 1] = "CANCELLED",
2756
2756
  jt[jt.UNKNOWN = 2] = "UNKNOWN", jt[jt.INVALID_ARGUMENT = 3] = "INVALID_ARGUMENT",
2757
2757
  jt[jt.DEADLINE_EXCEEDED = 4] = "DEADLINE_EXCEEDED", jt[jt.NOT_FOUND = 5] = "NOT_FOUND",
2758
2758
  jt[jt.ALREADY_EXISTS = 6] = "ALREADY_EXISTS", jt[jt.PERMISSION_DENIED = 7] = "PERMISSION_DENIED",
@@ -2777,29 +2777,29 @@ jt[jt.INTERNAL = 13] = "INTERNAL", jt[jt.UNAVAILABLE = 14] = "UNAVAILABLE", jt[j
2777
2777
  * See the License for the specific language governing permissions and
2778
2778
  * limitations under the License.
2779
2779
  */
2780
- var Kt = new C(U.k);
2780
+ var Xt = new C(O.k);
2781
2781
 
2782
- function Zt() {
2783
- return Kt;
2782
+ function Kt() {
2783
+ return Xt;
2784
2784
  }
2785
2785
 
2786
2786
  function $t() {
2787
- return Zt();
2787
+ return Kt();
2788
2788
  }
2789
2789
 
2790
- var te = new C(U.k);
2790
+ var te = new C(O.k);
2791
2791
 
2792
2792
  function ee() {
2793
2793
  return te;
2794
2794
  }
2795
2795
 
2796
- var ne = new C(U.k);
2796
+ var ne = new C(O.k);
2797
2797
 
2798
2798
  function re() {
2799
2799
  return ne;
2800
2800
  }
2801
2801
 
2802
- var ie = new P(U.k);
2802
+ var ie = new q(O.k);
2803
2803
 
2804
2804
  function oe() {
2805
2805
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
@@ -2810,7 +2810,7 @@ function oe() {
2810
2810
  return n;
2811
2811
  }
2812
2812
 
2813
- var se = new P(Ue);
2813
+ var se = new q(Oe);
2814
2814
 
2815
2815
  function ue() {
2816
2816
  return se;
@@ -2843,9 +2843,9 @@ function ue() {
2843
2843
  // We are adding document key comparator to the end as it's the only
2844
2844
  // guaranteed unique property of a document.
2845
2845
  this.k = t ? function(e, n) {
2846
- return t(e, n) || U.k(e.key, n.key);
2846
+ return t(e, n) || O.k(e.key, n.key);
2847
2847
  } : function(t, e) {
2848
- return U.k(t.key, e.key);
2848
+ return O.k(t.key, e.key);
2849
2849
  }, this.rs = ee(), this.hs = new C(this.k)
2850
2850
  /**
2851
2851
  * Returns an empty copy of the existing DocumentSet, using the same
@@ -2911,7 +2911,7 @@ function ue() {
2911
2911
  }, t;
2912
2912
  }(), he = /** @class */ function() {
2913
2913
  function t() {
2914
- this.as = new C(U.k);
2914
+ this.as = new C(O.k);
2915
2915
  }
2916
2916
  return t.prototype.track = function(t) {
2917
2917
  var e = t.doc.key, n = this.as.get(e);
@@ -2940,7 +2940,7 @@ function ue() {
2940
2940
  // Removed->Modified
2941
2941
  // Metadata->Added
2942
2942
  // Removed->Metadata
2943
- Ve("unsupported combination of changes: " + JSON.stringify(t) + " after " + JSON.stringify(n)) : this.as = this.as.nt(e, t);
2943
+ Le("unsupported combination of changes: " + JSON.stringify(t) + " after " + JSON.stringify(n)) : this.as = this.as.nt(e, t);
2944
2944
  }, t.prototype.us = function() {
2945
2945
  var t = [];
2946
2946
  return this.as.ut((function(e, n) {
@@ -3011,7 +3011,7 @@ function ue() {
3011
3011
  // PORTING NOTE: Multi-tab only
3012
3012
  return t.Rs = function(e, n) {
3013
3013
  var r = new Map;
3014
- return r.set(e, le.Is(e, n)), new t(R.MIN, r, ue(), Zt(), oe());
3014
+ return r.set(e, le.Is(e, n)), new t(R.MIN, r, ue(), Kt(), oe());
3015
3015
  }, t;
3016
3016
  }(), le = /** @class */ function() {
3017
3017
  function t(
@@ -3051,7 +3051,7 @@ function ue() {
3051
3051
  */;
3052
3052
  }
3053
3053
  return t.Is = function(e, n) {
3054
- return new t(B.Ut, n, oe(), oe(), oe());
3054
+ return new t(Q.Ut, n, oe(), oe(), oe());
3055
3055
  }, t;
3056
3056
  }(), pe = function(
3057
3057
  /** The new document applies to all of these targets. */
@@ -3081,7 +3081,7 @@ e,
3081
3081
  */
3082
3082
  n
3083
3083
  /** An RPC error indicating why the watch failed. */ , r) {
3084
- void 0 === n && (n = B.Ut), void 0 === r && (r = null), this.state = t, this.targetIds = e,
3084
+ void 0 === n && (n = Q.Ut), void 0 === r && (r = null), this.state = t, this.targetIds = e,
3085
3085
  this.resumeToken = n, this.cause = r;
3086
3086
  }, ve = /** @class */ function() {
3087
3087
  function t() {
@@ -3098,7 +3098,7 @@ n
3098
3098
  */
3099
3099
  this.Ss = we(),
3100
3100
  /** See public getters for explanations of these fields. */
3101
- this.Cs = B.Ut, this.Ds = !1,
3101
+ this.Cs = Q.Ut, this.Ds = !1,
3102
3102
  /**
3103
3103
  * Whether this target state should be included in the next snapshot. We
3104
3104
  * initialize to true so that newly-added targets are included in the next
@@ -3169,7 +3169,7 @@ n
3169
3169
  break;
3170
3170
 
3171
3171
  default:
3172
- Ve("Encountered invalid change type: " + i);
3172
+ Le("Encountered invalid change type: " + i);
3173
3173
  }
3174
3174
  })), new le(this.Cs, this.Ds, t, e, n);
3175
3175
  },
@@ -3195,7 +3195,7 @@ n
3195
3195
  /** The internal state of all tracked targets. */
3196
3196
  this.Ws = new Map,
3197
3197
  /** Keeps track of the documents to update since the last raised snapshot. */
3198
- this.js = Zt(),
3198
+ this.js = Kt(),
3199
3199
  /** A mapping of document keys to their set of target IDs. */
3200
3200
  this.Gs = ge(),
3201
3201
  /**
@@ -3203,7 +3203,7 @@ n
3203
3203
  * known to be inconsistent and their listens needs to be re-established by
3204
3204
  * RemoteStore.
3205
3205
  */
3206
- this.zs = new P(Ue)
3206
+ this.zs = new q(Oe)
3207
3207
  /**
3208
3208
  * Processes and adds the DocumentWatchChange to the current set of changes.
3209
3209
  */;
@@ -3258,7 +3258,7 @@ n
3258
3258
  break;
3259
3259
 
3260
3260
  default:
3261
- Ve("Unknown target watch change state: " + t.state);
3261
+ Le("Unknown target watch change state: " + t.state);
3262
3262
  }
3263
3263
  }));
3264
3264
  },
@@ -3289,9 +3289,9 @@ n
3289
3289
  // another query that will raise this document as part of a snapshot
3290
3290
  // until it is resolved, essentially exposing inconsistency between
3291
3291
  // queries.
3292
- var o = new U(i.path);
3292
+ var o = new O(i.path);
3293
3293
  this.Js(e, o, new Rt(o, R.S()));
3294
- } else Le(1 === n, "Single document existence filter with count: " + n); else this.ni(e) !== n && (
3294
+ } else Ve(1 === n, "Single document existence filter with count: " + n); else this.ni(e) !== n && (
3295
3295
  // Existence filter mismatch: We reset the mapping and raise a new
3296
3296
  // snapshot with `isFromCache:true`.
3297
3297
  this.ei(e), this.zs = this.zs.add(e));
@@ -3315,7 +3315,7 @@ n
3315
3315
  // TODO(dimond): Ideally we would have an explicit lookup target
3316
3316
  // instead resulting in an explicit delete message and we could
3317
3317
  // remove this special logic.
3318
- var s = new U(o.target.path);
3318
+ var s = new O(o.target.path);
3319
3319
  null !== e.js.get(s) || e.hi(i, s) || e.Js(i, s, new Rt(s, t));
3320
3320
  }
3321
3321
  r.ks && (n.set(i, r.$s()), r.Os());
@@ -3334,7 +3334,7 @@ n
3334
3334
  })), i && (r = r.add(t));
3335
3335
  }));
3336
3336
  var i = new fe(t, n, this.zs, this.js, r);
3337
- return this.js = Zt(), this.Gs = ge(), this.zs = new P(Ue), i;
3337
+ return this.js = Kt(), this.Gs = ge(), this.zs = new q(Oe), i;
3338
3338
  },
3339
3339
  /**
3340
3340
  * Adds the provided document to the internal list of document updates and
@@ -3386,7 +3386,7 @@ n
3386
3386
  return e || (e = new ve, this.Ws.set(t, e)), e;
3387
3387
  }, t.prototype.oi = function(t) {
3388
3388
  var e = this.Gs.get(t);
3389
- return e || (e = new P(Ue), this.Gs = this.Gs.nt(t, e)), e;
3389
+ return e || (e = new q(Oe), this.Gs = this.Gs.nt(t, e)), e;
3390
3390
  },
3391
3391
  /**
3392
3392
  * Verifies that the user is still interested in this target (by calling
@@ -3445,11 +3445,11 @@ n
3445
3445
  * DocumentChangeSet keeps track of a set of changes to docs in a query, merging
3446
3446
  * duplicate events for the same doc.
3447
3447
  */ function ge() {
3448
- return new C(U.k);
3448
+ return new C(O.k);
3449
3449
  }
3450
3450
 
3451
3451
  function we() {
3452
- return new C(U.k);
3452
+ return new C(O.k);
3453
3453
  }
3454
3454
 
3455
3455
  /**
@@ -3473,16 +3473,16 @@ function we() {
3473
3473
  t;
3474
3474
  }(), be = function() {
3475
3475
  var t = {};
3476
- return t[Ot.LESS_THAN.name] = "LESS_THAN", t[Ot.LESS_THAN_OR_EQUAL.name] = "LESS_THAN_OR_EQUAL",
3477
- t[Ot.GREATER_THAN.name] = "GREATER_THAN", t[Ot.GREATER_THAN_OR_EQUAL.name] = "GREATER_THAN_OR_EQUAL",
3478
- t[Ot.EQUAL.name] = "EQUAL", t[Ot.ARRAY_CONTAINS.name] = "ARRAY_CONTAINS", t[Ot.IN.name] = "IN",
3479
- t[Ot.ARRAY_CONTAINS_ANY.name] = "ARRAY_CONTAINS_ANY", t;
3476
+ return t[Ut.LESS_THAN.name] = "LESS_THAN", t[Ut.LESS_THAN_OR_EQUAL.name] = "LESS_THAN_OR_EQUAL",
3477
+ t[Ut.GREATER_THAN.name] = "GREATER_THAN", t[Ut.GREATER_THAN_OR_EQUAL.name] = "GREATER_THAN_OR_EQUAL",
3478
+ t[Ut.EQUAL.name] = "EQUAL", t[Ut.ARRAY_CONTAINS.name] = "ARRAY_CONTAINS", t[Ut.IN.name] = "IN",
3479
+ t[Ut.ARRAY_CONTAINS_ANY.name] = "ARRAY_CONTAINS_ANY", t;
3480
3480
  }(), Ae = /** @class */ function() {
3481
3481
  function t(t, e) {
3482
3482
  this.ci = t, this.options = e;
3483
3483
  }
3484
3484
  return t.prototype.li = function(t) {
3485
- var e = void 0 === t.code ? b.UNKNOWN : Xt(t.code);
3485
+ var e = void 0 === t.code ? b.UNKNOWN : Zt(t.code);
3486
3486
  return new A(e, t.message || "");
3487
3487
  },
3488
3488
  /**
@@ -3494,7 +3494,7 @@ function we() {
3494
3494
  * expects a { value: <number> } struct.
3495
3495
  */
3496
3496
  t.prototype._i = function(t) {
3497
- return this.options.di || z(t) ? t : {
3497
+ return this.options.di || B(t) ? t : {
3498
3498
  value: t
3499
3499
  };
3500
3500
  },
@@ -3503,7 +3503,7 @@ function we() {
3503
3503
  */
3504
3504
  t.prototype.fi = function(t) {
3505
3505
  var e;
3506
- return z(e = "object" == typeof t ? t.value : t) ? null : e;
3506
+ return B(e = "object" == typeof t ? t.value : t) ? null : e;
3507
3507
  },
3508
3508
  /**
3509
3509
  * Returns an IntegerValue for `value`.
@@ -3530,7 +3530,7 @@ function we() {
3530
3530
  };
3531
3531
  }
3532
3532
  return {
3533
- doubleValue: Q(t) ? "-0" : t
3533
+ doubleValue: z(t) ? "-0" : t
3534
3534
  };
3535
3535
  },
3536
3536
  /**
@@ -3540,7 +3540,7 @@ function we() {
3540
3540
  */
3541
3541
  t.prototype.wi = function(t) {
3542
3542
  return function(t) {
3543
- return "number" == typeof t && Number.isInteger(t) && !Q(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
3543
+ return "number" == typeof t && Number.isInteger(t) && !z(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
3544
3544
  }(t) ? this.Wt(t) : this.jt(t);
3545
3545
  },
3546
3546
  /**
@@ -3567,25 +3567,25 @@ function we() {
3567
3567
  * Returns a ByteString based on the proto string value.
3568
3568
  */
3569
3569
  t.prototype.mi = function(t) {
3570
- return this.options.di ? (Le(void 0 === t || "string" == typeof t, "value must be undefined or a string when using proto3 Json"),
3571
- B.fromBase64String(t || "")) : (Le(void 0 === t || t instanceof Uint8Array, "value must be undefined or Uint8Array"),
3572
- B.fromUint8Array(t || new Uint8Array));
3570
+ return this.options.di ? (Ve(void 0 === t || "string" == typeof t, "value must be undefined or a string when using proto3 Json"),
3571
+ Q.fromBase64String(t || "")) : (Ve(void 0 === t || t instanceof Uint8Array, "value must be undefined or Uint8Array"),
3572
+ Q.fromUint8Array(t || new Uint8Array));
3573
3573
  }, t.prototype.toVersion = function(t) {
3574
3574
  return this.F(t.F());
3575
3575
  }, t.prototype.fromVersion = function(t) {
3576
- return Le(!!t, "Trying to deserialize version that isn't set"), R.v(this.v(t));
3576
+ return Ve(!!t, "Trying to deserialize version that isn't set"), R.v(this.v(t));
3577
3577
  }, t.prototype.Ei = function(t, e) {
3578
3578
  return this.Ri(e || this.ci).child("documents").child(t).G();
3579
3579
  }, t.prototype.Ii = function(t) {
3580
- var e = V.K(t);
3581
- return Le(Ne(e), "Tried to deserialize invalid key " + e.toString()), e;
3580
+ var e = L.K(t);
3581
+ return Ve(Ne(e), "Tried to deserialize invalid key " + e.toString()), e;
3582
3582
  }, t.prototype.Ai = function(t) {
3583
3583
  return this.Ei(t.path);
3584
3584
  }, t.prototype.tt = function(t) {
3585
3585
  var e = this.Ii(t);
3586
- return Le(e.get(1) === this.ci.projectId, "Tried to deserialize key from different project: " + e.get(1) + " vs " + this.ci.projectId),
3587
- Le(!e.get(3) && !this.ci.database || e.get(3) === this.ci.database, "Tried to deserialize key from different database: " + e.get(3) + " vs " + this.ci.database),
3588
- new U(this.Pi(e));
3586
+ return Ve(e.get(1) === this.ci.projectId, "Tried to deserialize key from different project: " + e.get(1) + " vs " + this.ci.projectId),
3587
+ Ve(!e.get(3) && !this.ci.database || e.get(3) === this.ci.database, "Tried to deserialize key from different database: " + e.get(3) + " vs " + this.ci.database),
3588
+ new O(this.Pi(e));
3589
3589
  }, t.prototype.Vi = function(t) {
3590
3590
  return this.Ei(t);
3591
3591
  }, t.prototype.pi = function(t) {
@@ -3594,17 +3594,17 @@ function we() {
3594
3594
  // "/documents". In v1 all resource paths contain "/documents". Preserve the
3595
3595
  // ability to read the v1beta1 form for compatibility with queries persisted
3596
3596
  // in the local target cache.
3597
- return 4 === e.length ? V.H : this.Pi(e);
3597
+ return 4 === e.length ? L.H : this.Pi(e);
3598
3598
  }, Object.defineProperty(t.prototype, "gi", {
3599
3599
  get: function() {
3600
- return new V([ "projects", this.ci.projectId, "databases", this.ci.database ]).G();
3600
+ return new L([ "projects", this.ci.projectId, "databases", this.ci.database ]).G();
3601
3601
  },
3602
3602
  enumerable: !0,
3603
3603
  configurable: !0
3604
3604
  }), t.prototype.Ri = function(t) {
3605
- return new V([ "projects", t.projectId, "databases", t.database ]);
3605
+ return new L([ "projects", t.projectId, "databases", t.database ]);
3606
3606
  }, t.prototype.Pi = function(t) {
3607
- return Le(t.length > 4 && "documents" === t.get(4), "tried to deserialize invalid key " + t.toString()),
3607
+ return Ve(t.length > 4 && "documents" === t.get(4), "tried to deserialize invalid key " + t.toString()),
3608
3608
  t.$(5);
3609
3609
  },
3610
3610
  /** Creates an api.Document from key and fields (but no create/update time) */ t.prototype.yi = function(t, e) {
@@ -3628,7 +3628,7 @@ function we() {
3628
3628
  hasCommittedMutations: !!e
3629
3629
  });
3630
3630
  }, t.prototype.Si = function(t) {
3631
- Le(!!t.found, "Tried to deserialize a found document from a missing document."),
3631
+ Ve(!!t.found, "Tried to deserialize a found document from a missing document."),
3632
3632
  t.found.name, t.found.updateTime;
3633
3633
  var e = this.tt(t.found.name), n = this.fromVersion(t.found.updateTime), r = new Tt({
3634
3634
  mapValue: {
@@ -3637,12 +3637,12 @@ function we() {
3637
3637
  });
3638
3638
  return new St(e, n, r, {});
3639
3639
  }, t.prototype.Ci = function(t) {
3640
- Le(!!t.missing, "Tried to deserialize a missing document from a found document."),
3641
- Le(!!t.readTime, "Tried to deserialize a missing document without a read time.");
3640
+ Ve(!!t.missing, "Tried to deserialize a missing document from a found document."),
3641
+ Ve(!!t.readTime, "Tried to deserialize a missing document without a read time.");
3642
3642
  var e = this.tt(t.missing), n = this.fromVersion(t.readTime);
3643
3643
  return new Rt(e, n);
3644
3644
  }, t.prototype.Di = function(t) {
3645
- return "found" in t ? this.Si(t) : "missing" in t ? this.Ci(t) : Ve("invalid batch get response: " + JSON.stringify(t));
3645
+ return "found" in t ? this.Si(t) : "missing" in t ? this.Ci(t) : Le("invalid batch get response: " + JSON.stringify(t));
3646
3646
  }, t.prototype.Fi = function(t) {
3647
3647
  var e;
3648
3648
  if ("targetChange" in t) {
@@ -3674,7 +3674,7 @@ function we() {
3674
3674
  var E = this.tt(w.document), b = w.removedTargetIds || [];
3675
3675
  e = new pe([], b, E, null);
3676
3676
  } else {
3677
- if (!("filter" in t)) return Ve("Unknown change type " + JSON.stringify(t));
3677
+ if (!("filter" in t)) return Le("Unknown change type " + JSON.stringify(t));
3678
3678
  t.filter;
3679
3679
  var A = t.filter;
3680
3680
  A.targetId;
@@ -3683,7 +3683,7 @@ function we() {
3683
3683
  }
3684
3684
  return e;
3685
3685
  }, t.prototype.Ni = function(t) {
3686
- return "NO_CHANGE" === t ? 0 /* NoChange */ : "ADD" === t ? 1 /* Added */ : "REMOVE" === t ? 2 /* Removed */ : "CURRENT" === t ? 3 /* Current */ : "RESET" === t ? 4 /* Reset */ : Ve("Got unexpected TargetChange.state: " + t);
3686
+ return "NO_CHANGE" === t ? 0 /* NoChange */ : "ADD" === t ? 1 /* Added */ : "REMOVE" === t ? 2 /* Removed */ : "CURRENT" === t ? 3 /* Current */ : "RESET" === t ? 4 /* Reset */ : Le("Got unexpected TargetChange.state: " + t);
3687
3687
  }, t.prototype.ki = function(t) {
3688
3688
  // We have only reached a consistent snapshot for the entire stream if there
3689
3689
  // is a read_time set and it applies to all targets (i.e. the list of
@@ -3708,7 +3708,7 @@ function we() {
3708
3708
  }))
3709
3709
  }
3710
3710
  }; else {
3711
- if (!(t instanceof It)) return Ve("Unknown mutation type " + t.type);
3711
+ if (!(t instanceof It)) return Le("Unknown mutation type " + t.type);
3712
3712
  e = {
3713
3713
  verify: this.Ai(t.key)
3714
3714
  };
@@ -3737,20 +3737,20 @@ function we() {
3737
3737
  var u = this.tt(t.transform.document), a = t.transform.fieldTransforms.map((function(t) {
3738
3738
  return e.xi(t);
3739
3739
  }));
3740
- return Le(!0 === n.exists, 'Transforms only support precondition "exists == true"'),
3740
+ return Ve(!0 === n.exists, 'Transforms only support precondition "exists == true"'),
3741
3741
  new At(u, a);
3742
3742
  }
3743
3743
  if (t.verify) {
3744
3744
  var h = this.tt(t.verify);
3745
3745
  return new It(h, n);
3746
3746
  }
3747
- return Ve("unknown mutation proto: " + JSON.stringify(t));
3747
+ return Le("unknown mutation proto: " + JSON.stringify(t));
3748
3748
  }, t.prototype.Mi = function(t) {
3749
3749
  return void 0 !== t.updateTime ? {
3750
3750
  updateTime: this.toVersion(t.updateTime)
3751
3751
  } : void 0 !== t.exists ? {
3752
3752
  exists: t.exists
3753
- } : Ve("Unknown precondition");
3753
+ } : Le("Unknown precondition");
3754
3754
  }, t.prototype.qi = function(t) {
3755
3755
  return void 0 !== t.updateTime ? gt.updateTime(this.fromVersion(t.updateTime)) : void 0 !== t.exists ? gt.exists(t.exists) : gt.NONE;
3756
3756
  }, t.prototype.Qi = function(t, e) {
@@ -3768,7 +3768,7 @@ function we() {
3768
3768
  new mt(n, r);
3769
3769
  }, t.prototype.Wi = function(t, e) {
3770
3770
  var n = this;
3771
- return t && t.length > 0 ? (Le(void 0 !== e, "Received a write result without a commit time"),
3771
+ return t && t.length > 0 ? (Ve(void 0 !== e, "Received a write result without a commit time"),
3772
3772
  t.map((function(t) {
3773
3773
  return n.Qi(t, e);
3774
3774
  }))) : [];
@@ -3794,18 +3794,18 @@ function we() {
3794
3794
  fieldPath: t.field.G(),
3795
3795
  increment: e.Qt
3796
3796
  };
3797
- throw Ve("Unknown transform: " + t.transform);
3797
+ throw Le("Unknown transform: " + t.transform);
3798
3798
  }, t.prototype.xi = function(t) {
3799
3799
  var e = null;
3800
- if ("setToServerValue" in t) Le("REQUEST_TIME" === t.setToServerValue, "Unknown server value transform proto: " + JSON.stringify(t)),
3800
+ if ("setToServerValue" in t) Ve("REQUEST_TIME" === t.setToServerValue, "Unknown server value transform proto: " + JSON.stringify(t)),
3801
3801
  e = ct.instance; else if ("appendMissingElements" in t) {
3802
3802
  var n = t.appendMissingElements.values || [];
3803
3803
  e = new ft(n);
3804
3804
  } else if ("removeAllFromArray" in t) {
3805
3805
  var r = t.removeAllFromArray.values || [];
3806
3806
  e = new lt(r);
3807
- } else "increment" in t ? e = new pt(this, t.increment) : Ve("Unknown transform proto: " + JSON.stringify(t));
3808
- var i = O.Z(t.fieldPath);
3807
+ } else "increment" in t ? e = new pt(this, t.increment) : Le("Unknown transform proto: " + JSON.stringify(t));
3808
+ var i = U.Z(t.fieldPath);
3809
3809
  return new vt(i, e);
3810
3810
  }, t.prototype.ji = function(t) {
3811
3811
  return {
@@ -3813,9 +3813,9 @@ function we() {
3813
3813
  };
3814
3814
  }, t.prototype.Gi = function(t) {
3815
3815
  var e = t.documents.length;
3816
- Le(1 === e, "DocumentsTarget contained other than 1 document: " + e);
3816
+ Ve(1 === e, "DocumentsTarget contained other than 1 document: " + e);
3817
3817
  var n = t.documents[0];
3818
- return Lt.ve(this.pi(n)).Ue();
3818
+ return Vt.ve(this.pi(n)).Ue();
3819
3819
  }, t.prototype.zi = function(t) {
3820
3820
  // Dissect the path into parent, collectionId, and optional key filter.
3821
3821
  var e = {
@@ -3837,7 +3837,7 @@ function we() {
3837
3837
  }, t.prototype.Yi = function(t) {
3838
3838
  var e = this.pi(t.parent), n = t.structuredQuery, r = n.from ? n.from.length : 0, i = null;
3839
3839
  if (r > 0) {
3840
- Le(1 === r, "StructuredQuery.from with more than one collection is not supported.");
3840
+ Ve(1 === r, "StructuredQuery.from with more than one collection is not supported.");
3841
3841
  var o = n.from[0];
3842
3842
  o.allDescendants ? i = o.collectionId : e = e.child(o.collectionId);
3843
3843
  }
@@ -3850,7 +3850,7 @@ function we() {
3850
3850
  var h = null;
3851
3851
  n.startAt && (h = this.tn(n.startAt));
3852
3852
  var c = null;
3853
- return n.endAt && (c = this.tn(n.endAt)), new Lt(e, i, u, s, a, "F" /* First */ , h, c).Ue();
3853
+ return n.endAt && (c = this.tn(n.endAt)), new Vt(e, i, u, s, a, "F" /* First */ , h, c).Ue();
3854
3854
  }, t.prototype.en = function(t) {
3855
3855
  var e = this.sn(t.Ze);
3856
3856
  return null == e ? null : {
@@ -3868,7 +3868,7 @@ function we() {
3868
3868
  return "limbo-document";
3869
3869
 
3870
3870
  default:
3871
- return Ve("Unrecognized query purpose: " + t);
3871
+ return Le("Unrecognized query purpose: " + t);
3872
3872
  }
3873
3873
  }, t.prototype.Ue = function(t) {
3874
3874
  var e, n = t.target;
@@ -3882,7 +3882,7 @@ function we() {
3882
3882
  var e = this;
3883
3883
  if (0 !== t.length) {
3884
3884
  var n = t.map((function(t) {
3885
- return t instanceof Ut ? e.in(t) : Ve("Unrecognized filter: " + JSON.stringify(t));
3885
+ return t instanceof Ot ? e.in(t) : Le("Unrecognized filter: " + JSON.stringify(t));
3886
3886
  }));
3887
3887
  return 1 === n.length ? n[0] : {
3888
3888
  compositeFilter: {
@@ -3897,7 +3897,7 @@ function we() {
3897
3897
  return e.Xi(t);
3898
3898
  })).reduce((function(t, e) {
3899
3899
  return t.concat(e);
3900
- })) : Ve("Unknown filter: " + JSON.stringify(t)) : [];
3900
+ })) : Le("Unknown filter: " + JSON.stringify(t)) : [];
3901
3901
  }, t.prototype.Hi = function(t) {
3902
3902
  var e = this;
3903
3903
  if (0 !== t.length) return t.map((function(t) {
@@ -3915,7 +3915,7 @@ function we() {
3915
3915
  };
3916
3916
  }, t.prototype.tn = function(t) {
3917
3917
  var e = !!t.before, n = t.values || [];
3918
- return new Bt(n, e);
3918
+ return new Qt(n, e);
3919
3919
  },
3920
3920
  // visible for testing
3921
3921
  t.prototype.an = function(t) {
@@ -3940,41 +3940,41 @@ function we() {
3940
3940
  }, t.prototype.ln = function(t) {
3941
3941
  switch (t) {
3942
3942
  case "EQUAL":
3943
- return Ot.EQUAL;
3943
+ return Ut.EQUAL;
3944
3944
 
3945
3945
  case "GREATER_THAN":
3946
- return Ot.GREATER_THAN;
3946
+ return Ut.GREATER_THAN;
3947
3947
 
3948
3948
  case "GREATER_THAN_OR_EQUAL":
3949
- return Ot.GREATER_THAN_OR_EQUAL;
3949
+ return Ut.GREATER_THAN_OR_EQUAL;
3950
3950
 
3951
3951
  case "LESS_THAN":
3952
- return Ot.LESS_THAN;
3952
+ return Ut.LESS_THAN;
3953
3953
 
3954
3954
  case "LESS_THAN_OR_EQUAL":
3955
- return Ot.LESS_THAN_OR_EQUAL;
3955
+ return Ut.LESS_THAN_OR_EQUAL;
3956
3956
 
3957
3957
  case "ARRAY_CONTAINS":
3958
- return Ot.ARRAY_CONTAINS;
3958
+ return Ut.ARRAY_CONTAINS;
3959
3959
 
3960
3960
  case "IN":
3961
- return Ot.IN;
3961
+ return Ut.IN;
3962
3962
 
3963
3963
  case "ARRAY_CONTAINS_ANY":
3964
- return Ot.ARRAY_CONTAINS_ANY;
3964
+ return Ut.ARRAY_CONTAINS_ANY;
3965
3965
 
3966
3966
  case "OPERATOR_UNSPECIFIED":
3967
- return Ve("Unspecified operator");
3967
+ return Le("Unspecified operator");
3968
3968
 
3969
3969
  default:
3970
- return Ve("Unknown operator");
3970
+ return Le("Unknown operator");
3971
3971
  }
3972
3972
  }, t.prototype._n = function(t) {
3973
3973
  return {
3974
3974
  fieldPath: t.G()
3975
3975
  };
3976
3976
  }, t.prototype.dn = function(t) {
3977
- return O.Z(t.fieldPath);
3977
+ return U.Z(t.fieldPath);
3978
3978
  },
3979
3979
  // visible for testing
3980
3980
  t.prototype.hn = function(t) {
@@ -3983,13 +3983,13 @@ function we() {
3983
3983
  direction: this.an(t.dir)
3984
3984
  };
3985
3985
  }, t.prototype.on = function(t) {
3986
- return new zt(this.dn(t.field), this.un(t.direction));
3986
+ return new Bt(this.dn(t.field), this.un(t.direction));
3987
3987
  }, t.prototype.rn = function(t) {
3988
- return Ut.create(this.dn(t.fieldFilter.field), this.ln(t.fieldFilter.op), t.fieldFilter.value);
3988
+ return Ot.create(this.dn(t.fieldFilter.field), this.ln(t.fieldFilter.op), t.fieldFilter.value);
3989
3989
  },
3990
3990
  // visible for testing
3991
3991
  t.prototype.in = function(t) {
3992
- if (t.op === Ot.EQUAL) {
3992
+ if (t.op === Ut.EQUAL) {
3993
3993
  if (at(t.value)) return {
3994
3994
  unaryFilter: {
3995
3995
  field: this._n(t.field),
@@ -4014,21 +4014,21 @@ function we() {
4014
4014
  switch (t.unaryFilter.op) {
4015
4015
  case "IS_NAN":
4016
4016
  var e = this.dn(t.unaryFilter.field);
4017
- return Ut.create(e, Ot.EQUAL, {
4017
+ return Ot.create(e, Ut.EQUAL, {
4018
4018
  doubleValue: NaN
4019
4019
  });
4020
4020
 
4021
4021
  case "IS_NULL":
4022
4022
  var n = this.dn(t.unaryFilter.field);
4023
- return Ut.create(n, Ot.EQUAL, {
4023
+ return Ot.create(n, Ut.EQUAL, {
4024
4024
  nullValue: "NULL_VALUE"
4025
4025
  });
4026
4026
 
4027
4027
  case "OPERATOR_UNSPECIFIED":
4028
- return Ve("Unspecified filter");
4028
+ return Le("Unspecified filter");
4029
4029
 
4030
4030
  default:
4031
- return Ve("Unknown filter");
4031
+ return Le("Unknown filter");
4032
4032
  }
4033
4033
  }, t.prototype.$i = function(t) {
4034
4034
  var e = [];
@@ -4039,7 +4039,7 @@ function we() {
4039
4039
  };
4040
4040
  }, t.prototype.Bi = function(t) {
4041
4041
  var e = (t.fieldPaths || []).map((function(t) {
4042
- return O.Z(t);
4042
+ return U.Z(t);
4043
4043
  }));
4044
4044
  return yt.zt(e);
4045
4045
  }, t;
@@ -4078,9 +4078,9 @@ function we() {
4078
4078
  */ var Ie = /** @class */ function() {
4079
4079
  function t() {}
4080
4080
  return t.fn = function(e) {
4081
- t.platform && Ve("Platform already defined"), t.platform = e;
4081
+ t.platform && Le("Platform already defined"), t.platform = e;
4082
4082
  }, t.Ot = function() {
4083
- return t.platform || Ve("Platform not set"), t.platform;
4083
+ return t.platform || Le("Platform not set"), t.platform;
4084
4084
  }, t;
4085
4085
  }(), Te = new o("@firebase/firestore");
4086
4086
 
@@ -4160,7 +4160,7 @@ function Re(t) {
4160
4160
  * Returns `never` and can be used in expressions:
4161
4161
  * @example
4162
4162
  * let futureVar = fail('not implemented yet');
4163
- */ function Ve(t) {
4163
+ */ function Le(t) {
4164
4164
  // Log the failure in addition to throw an exception, just in case the
4165
4165
  // exception is swallowed.
4166
4166
  var e = "FIRESTORE (" + w + ") INTERNAL ASSERTION FAILED: " + t;
@@ -4174,8 +4174,8 @@ function Re(t) {
4174
4174
  */;
4175
4175
  }
4176
4176
 
4177
- function Le(t, e) {
4178
- t || Ve(e);
4177
+ function Ve(t, e) {
4178
+ t || Le(e);
4179
4179
  }
4180
4180
 
4181
4181
  /**
@@ -4193,7 +4193,7 @@ function Le(t, e) {
4193
4193
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4194
4194
  * See the License for the specific language governing permissions and
4195
4195
  * limitations under the License.
4196
- */ var Oe = /** @class */ function() {
4196
+ */ var Ue = /** @class */ function() {
4197
4197
  function t() {}
4198
4198
  return t.Tn = function() {
4199
4199
  for (
@@ -4203,7 +4203,7 @@ function Le(t, e) {
4203
4203
  }, t;
4204
4204
  }();
4205
4205
 
4206
- function Ue(t, e) {
4206
+ function Oe(t, e) {
4207
4207
  return t < e ? -1 : t > e ? 1 : 0;
4208
4208
  }
4209
4209
 
@@ -4228,7 +4228,7 @@ function Ue(t, e) {
4228
4228
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4229
4229
  * See the License for the specific language governing permissions and
4230
4230
  * limitations under the License.
4231
- */ var qe =
4231
+ */ var Pe =
4232
4232
  /**
4233
4233
  * Constructs a DatabaseInfo using the provided host, databaseId and
4234
4234
  * persistenceKey.
@@ -4256,9 +4256,9 @@ function(t, e, n, r, i) {
4256
4256
  }), t.prototype.isEqual = function(e) {
4257
4257
  return e instanceof t && e.projectId === this.projectId && e.database === this.database;
4258
4258
  }, t.prototype.C = function(t) {
4259
- return Ue(this.projectId, t.projectId) || Ue(this.database, t.database);
4259
+ return Oe(this.projectId, t.projectId) || Oe(this.database, t.database);
4260
4260
  }, t;
4261
- }(), Pe = /** @class */ function() {
4261
+ }(), qe = /** @class */ function() {
4262
4262
  function t(t) {
4263
4263
  this.En = t,
4264
4264
  /**
@@ -4296,7 +4296,7 @@ function(t, e, n, r, i) {
4296
4296
  !0;
4297
4297
  return !1;
4298
4298
  }, t.prototype.forEach = function(t) {
4299
- F(this.Rn, (function(e, n) {
4299
+ x(this.Rn, (function(e, n) {
4300
4300
  for (var r = 0, i = n; r < i.length; r++) {
4301
4301
  var o = i[r], s = o[0], u = o[1];
4302
4302
  t(s, u);
@@ -4305,7 +4305,7 @@ function(t, e, n, r, i) {
4305
4305
  }, t.prototype.q = function() {
4306
4306
  return j(this.Rn);
4307
4307
  }, t;
4308
- }(), xe = /** @class */ function() {
4308
+ }(), Fe = /** @class */ function() {
4309
4309
  /**
4310
4310
  * @param batchId The unique ID of this mutation batch.
4311
4311
  * @param localWriteTime The original write time of this mutation.
@@ -4399,16 +4399,16 @@ function(t, e, n, r, i) {
4399
4399
  */;
4400
4400
  }
4401
4401
  return t.from = function(e, n, r, i) {
4402
- Le(e.mutations.length === r.length, "Mutations sent " + e.mutations.length + " must equal results received " + r.length);
4402
+ Ve(e.mutations.length === r.length, "Mutations sent " + e.mutations.length + " must equal results received " + r.length);
4403
4403
  for (var o = re(), s = e.mutations, u = 0; u < s.length; u++) o = o.nt(s[u].key, r[u].version);
4404
4404
  return new t(e, n, r, i, o);
4405
4405
  }, t;
4406
- }(), Fe = /** @class */ function() {
4406
+ }(), xe = /** @class */ function() {
4407
4407
  function t() {
4408
4408
  // A set of outstanding references to a document sorted by key.
4409
- this.gn = new P(je.me),
4409
+ this.gn = new q(je.me),
4410
4410
  // A set of outstanding references to a document sorted by target id.
4411
- this.yn = new P(je.bn)
4411
+ this.yn = new q(je.bn)
4412
4412
  /** Returns true if the reference set contains no references. */;
4413
4413
  }
4414
4414
  return t.prototype.q = function() {
@@ -4441,7 +4441,7 @@ function(t, e, n, r, i) {
4441
4441
  * removed.
4442
4442
  */
4443
4443
  t.prototype.Nn = function(t) {
4444
- var e = this, n = U.EMPTY, r = new je(n, t), i = new je(n, t + 1), o = [];
4444
+ var e = this, n = O.EMPTY, r = new je(n, t), i = new je(n, t + 1), o = [];
4445
4445
  return this.yn.Dt([ r, i ], (function(t) {
4446
4446
  e.Dn(t), o.push(t.key);
4447
4447
  })), o;
@@ -4453,7 +4453,7 @@ function(t, e, n, r, i) {
4453
4453
  }, t.prototype.Dn = function(t) {
4454
4454
  this.gn = this.gn.delete(t), this.yn = this.yn.delete(t);
4455
4455
  }, t.prototype.Ln = function(t) {
4456
- var e = U.EMPTY, n = new je(e, t), r = new je(e, t + 1), i = oe();
4456
+ var e = O.EMPTY, n = new je(e, t), r = new je(e, t + 1), i = oe();
4457
4457
  return this.yn.Dt([ n, r ], (function(t) {
4458
4458
  i = i.add(t.key);
4459
4459
  })), i;
@@ -4467,12 +4467,12 @@ function(t, e, n, r, i) {
4467
4467
  /** Compare by key then by ID */;
4468
4468
  }
4469
4469
  return t.me = function(t, e) {
4470
- return U.k(t.key, e.key) || Ue(t.On, e.On);
4470
+ return O.k(t.key, e.key) || Oe(t.On, e.On);
4471
4471
  },
4472
4472
  /** Compare by ID then by key */ t.bn = function(t, e) {
4473
- return Ue(t.On, e.On) || U.k(t.key, e.key);
4473
+ return Oe(t.On, e.On) || O.k(t.key, e.key);
4474
4474
  }, t;
4475
- }(), Be = /** @class */ function() {
4475
+ }(), Qe = /** @class */ function() {
4476
4476
  function t(t) {
4477
4477
  var e = this;
4478
4478
  // NOTE: next/catchCallback will always point to our own wrapper functions,
@@ -4495,7 +4495,7 @@ function(t, e, n, r, i) {
4495
4495
  return this.next(void 0, t);
4496
4496
  }, t.prototype.next = function(e, n) {
4497
4497
  var r = this;
4498
- return this.Bn && Ve("Called next() or catch() twice for PersistencePromise"), this.Bn = !0,
4498
+ return this.Bn && Le("Called next() or catch() twice for PersistencePromise"), this.Bn = !0,
4499
4499
  this.qn ? this.error ? this.xn(n, this.error) : this.Qn(e, this.result) : new t((function(t, i) {
4500
4500
  r.Mn = function(n) {
4501
4501
  r.Qn(e, n).next(t, i);
@@ -4567,7 +4567,7 @@ function(t, e, n, r, i) {
4567
4567
  r.push(e.call(n, t, i));
4568
4568
  })), this.Gn(r);
4569
4569
  }, t;
4570
- }(), ze = /** @class */ function() {
4570
+ }(), Be = /** @class */ function() {
4571
4571
  function t(t, e, n) {
4572
4572
  this.Kn = t, this.Hn = e, this.Jn = n
4573
4573
  /**
@@ -4621,7 +4621,7 @@ function(t, e, n, r, i) {
4621
4621
  t.prototype.ir = function(t, e) {
4622
4622
  var n = this;
4623
4623
  return this.Hn.nr(t, e).next((function(r) {
4624
- var i = n.er(t, e, r), o = Zt();
4624
+ var i = n.er(t, e, r), o = Kt();
4625
4625
  return i.forEach((function(t, e) {
4626
4626
  // TODO(http://b/32275378): Don't conflate missing / deleted.
4627
4627
  e || (e = new Rt(t, R.S())), o = o.nt(t, e);
@@ -4640,14 +4640,14 @@ function(t, e, n, r, i) {
4640
4640
  return e.Pe() ? this.hr(t, e.path) : e.He() ? this.or(t, e, n) : this.ar(t, e, n);
4641
4641
  }, t.prototype.hr = function(t, e) {
4642
4642
  // Just do a simple document lookup.
4643
- return this.Yn(t, new U(e)).next((function(t) {
4643
+ return this.Yn(t, new O(e)).next((function(t) {
4644
4644
  var e = ee();
4645
4645
  return t instanceof St && (e = e.nt(t.key, t)), e;
4646
4646
  }));
4647
4647
  }, t.prototype.or = function(t, e, n) {
4648
4648
  var r = this, i = e.collectionGroup, o = ee();
4649
4649
  return this.Jn.ur(t, i).next((function(s) {
4650
- return Be.forEach(s, (function(s) {
4650
+ return Qe.forEach(s, (function(s) {
4651
4651
  var u = e.Oe(s.child(i));
4652
4652
  return r.ar(t, u, n).next((function(t) {
4653
4653
  t.forEach((function(t, e) {
@@ -4690,7 +4690,7 @@ function(t, e, n, r, i) {
4690
4690
  })), h;
4691
4691
  }));
4692
4692
  }, t;
4693
- }(), Qe = /** @class */ function() {
4693
+ }(), ze = /** @class */ function() {
4694
4694
  function t(t, e, n, r) {
4695
4695
  this.targetId = t, this.fromCache = e, this._r = n, this.dr = r;
4696
4696
  }
@@ -4922,7 +4922,7 @@ var Ye = function() {
4922
4922
  }));
4923
4923
  return this.Nr.push(i), i;
4924
4924
  }, t.prototype.Ur = function() {
4925
- this.kr && Ve("AsyncQueue is already failed: " + (this.kr.stack || this.kr.message));
4925
+ this.kr && Le("AsyncQueue is already failed: " + (this.kr.stack || this.kr.message));
4926
4926
  },
4927
4927
  /**
4928
4928
  * Verifies there's an operation currently in-progress on the AsyncQueue.
@@ -5000,7 +5000,7 @@ var Ye = function() {
5000
5000
  var e = this.Nr.indexOf(t);
5001
5001
  this.Nr.splice(e, 1);
5002
5002
  }, t;
5003
- }(), Xe = /** @class */ function() {
5003
+ }(), Ze = /** @class */ function() {
5004
5004
  function t(
5005
5005
  // When we attempt to collect, we will only do so if the cache size is greater than this
5006
5006
  // threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.
@@ -5039,8 +5039,8 @@ var Ye = function() {
5039
5039
  * It is created via DelayedOperation.createAndSchedule().
5040
5040
  *
5041
5041
  * Supports cancellation (via cancel()) and early execution (via skipDelay()).
5042
- */ Xe.sh = -1, Xe.ih = 1048576, Xe.nh = 41943040, Xe.th = 10, Xe.eh = 1e3, Xe.rh = new Xe(Xe.nh, Xe.th, Xe.eh),
5043
- Xe.DISABLED = new Xe(Xe.sh, 0, 0);
5042
+ */ Ze.sh = -1, Ze.ih = 1048576, Ze.nh = 41943040, Ze.th = 10, Ze.eh = 1e3, Ze.rh = new Ze(Ze.nh, Ze.th, Ze.eh),
5043
+ Ze.DISABLED = new Ze(Ze.sh, 0, 0);
5044
5044
 
5045
5045
  /**
5046
5046
  * Local storage in the Firestore client. Coordinates persistence components
@@ -5093,7 +5093,7 @@ Xe.DISABLED = new Xe(Xe.sh, 0, 0);
5093
5093
  * (unexpected) failure (e.g. failed assert) and always represent an
5094
5094
  * unrecoverable error (should be caught / reported by the async_queue).
5095
5095
  */
5096
- var Ke = /** @class */ function() {
5096
+ var Xe = /** @class */ function() {
5097
5097
  function t(
5098
5098
  /** Manages our in-memory or durable persistence. */
5099
5099
  t, e, n) {
@@ -5101,17 +5101,17 @@ var Ke = /** @class */ function() {
5101
5101
  /**
5102
5102
  * The set of document references maintained by any local views.
5103
5103
  */
5104
- this.oh = new Fe,
5104
+ this.oh = new xe,
5105
5105
  /**
5106
5106
  * Maps a targetID to data about its target.
5107
5107
  *
5108
5108
  * PORTING NOTE: We are using an immutable data structure on Web to make re-runs
5109
5109
  * of `applyRemoteEvent()` idempotent.
5110
5110
  */
5111
- this.ah = new C(Ue),
5111
+ this.ah = new C(Oe),
5112
5112
  /** Maps a target to its targetID. */
5113
5113
  // TODO(wuandy): Evaluate if TargetId can be part of Target.
5114
- this.uh = new Pe((function(t) {
5114
+ this.uh = new qe((function(t) {
5115
5115
  return t.canonicalId();
5116
5116
  })),
5117
5117
  /**
@@ -5120,7 +5120,7 @@ var Ke = /** @class */ function() {
5120
5120
  * PORTING NOTE: This is only used for multi-tab synchronization.
5121
5121
  */
5122
5122
  this.lh = R.MIN, this.persistence.dh._h(this.oh), this.Hn = t.fh(n), this.wh = t.Th(),
5123
- this.mh = t.Eh(), this.Rh = new ze(this.wh, this.Hn, this.persistence.Ih()), this.hh.Ah(this.Rh)
5123
+ this.mh = t.Eh(), this.Rh = new Be(this.wh, this.Hn, this.persistence.Ih()), this.hh.Ah(this.Rh)
5124
5124
  /** Starts the LocalStore. */;
5125
5125
  }
5126
5126
  return t.prototype.start = function() {
@@ -5148,7 +5148,7 @@ var Ke = /** @class */ function() {
5148
5148
  return i = s, e = o.persistence.fh(t),
5149
5149
  // Recreate our LocalDocumentsView using the new
5150
5150
  // MutationQueue.
5151
- r = new ze(o.wh, e, o.persistence.Ih()), e.ph(n);
5151
+ r = new Be(o.wh, e, o.persistence.Ih()), e.ph(n);
5152
5152
  })).next((function(t) {
5153
5153
  for (var e = [], o = [], s = oe(), u = 0, a = i
5154
5154
  // Union the old/new changed keys.
@@ -5224,7 +5224,7 @@ var Ke = /** @class */ function() {
5224
5224
  var e = this;
5225
5225
  return this.persistence.runTransaction("Lookup mutation documents", "readonly", (function(n) {
5226
5226
  return e.Hn.Fh(n, t).next((function(t) {
5227
- return t ? e.Rh.sr(n, t) : Be.resolve(null);
5227
+ return t ? e.Rh.sr(n, t) : Qe.resolve(null);
5228
5228
  }));
5229
5229
  }));
5230
5230
  },
@@ -5270,7 +5270,7 @@ var Ke = /** @class */ function() {
5270
5270
  return this.persistence.runTransaction("Reject batch", "readwrite-primary", (function(n) {
5271
5271
  var r;
5272
5272
  return e.Hn.Uh(n, t).next((function(t) {
5273
- return Le(null !== t, "Attempt to reject nonexistent batch!"), r = t.keys(), e.Hn.qh(n, t);
5273
+ return Ve(null !== t, "Attempt to reject nonexistent batch!"), r = t.keys(), e.Hn.qh(n, t);
5274
5274
  })).next((function() {
5275
5275
  return e.Hn.Oh(n);
5276
5276
  })).next((function() {
@@ -5352,7 +5352,7 @@ var Ke = /** @class */ function() {
5352
5352
  }
5353
5353
  }
5354
5354
  }));
5355
- var a = Zt(), h = oe();
5355
+ var a = Kt(), h = oe();
5356
5356
  // HACK: The only reason we allow a null snapshot version is so that we
5357
5357
  // can synthesize remote events when we get permission denied errors while
5358
5358
  // trying to resolve the state of a locally cached document that is in
@@ -5383,7 +5383,7 @@ var Ke = /** @class */ function() {
5383
5383
  }));
5384
5384
  u.push(c);
5385
5385
  }
5386
- return Be.Gn(u).next((function() {
5386
+ return Qe.Gn(u).next((function() {
5387
5387
  return s.apply(o);
5388
5388
  })).next((function() {
5389
5389
  return n.Rh.ir(o, a);
@@ -5405,7 +5405,7 @@ var Ke = /** @class */ function() {
5405
5405
  */
5406
5406
  t.Hh = function(t, e, n) {
5407
5407
  // Always persist target data if we don't already have a resume token.
5408
- return Le(e.resumeToken.Mt() > 0, "Attempted to persist target data with no resume token"),
5408
+ return Ve(e.resumeToken.Mt() > 0, "Attempted to persist target data with no resume token"),
5409
5409
  0 === t.resumeToken.Mt() || (e.ts.D() - t.ts.D() >= this.eo || n.Ps.size + n.Vs.size + n.ps.size > 0);
5410
5410
  // Don't allow resume token changes to be buffered indefinitely. This
5411
5411
  // allows us to be reasonably up-to-date after a crash and avoids needing
@@ -5426,8 +5426,8 @@ var Ke = /** @class */ function() {
5426
5426
  }
5427
5427
  }
5428
5428
  return this.persistence.runTransaction("notifyLocalViewChanges", "readwrite", (function(n) {
5429
- return Be.forEach(t, (function(t) {
5430
- return Be.forEach(t.dr, (function(t) {
5429
+ return Qe.forEach(t, (function(t) {
5430
+ return Qe.forEach(t.dr, (function(t) {
5431
5431
  return e.persistence.dh.Cn(n, t);
5432
5432
  }));
5433
5433
  }));
@@ -5472,7 +5472,7 @@ var Ke = /** @class */ function() {
5472
5472
  // This target has been listened to previously, so reuse the
5473
5473
  // previous targetID.
5474
5474
  // TODO(mcg): freshen last accessed date?
5475
- r = i, Be.resolve(r)) : e.mh.ao(n).next((function(i) {
5475
+ r = i, Qe.resolve(r)) : e.mh.ao(n).next((function(i) {
5476
5476
  return r = new Yt(t, i, 0 /* Listen */ , n.Kh), e.mh.uo(n, r).next((function() {
5477
5477
  return r;
5478
5478
  }));
@@ -5490,7 +5490,7 @@ var Ke = /** @class */ function() {
5490
5490
  // Visible for testing.
5491
5491
  t.prototype.oo = function(t, e) {
5492
5492
  var n = this.uh.get(e);
5493
- return void 0 !== n ? Be.resolve(this.ah.get(n)) : this.mh.oo(t, e);
5493
+ return void 0 !== n ? Qe.resolve(this.ah.get(n)) : this.mh.oo(t, e);
5494
5494
  },
5495
5495
  /**
5496
5496
  * Unpin all the documents associated with the given target. If
@@ -5514,7 +5514,7 @@ var Ke = /** @class */ function() {
5514
5514
  // transaction fails since there are no side effects if the target has
5515
5515
  // already been removed.
5516
5516
  var o = n.oh.Nn(t);
5517
- return e ? Be.resolve() : Be.forEach(o, (function(t) {
5517
+ return e ? Qe.resolve() : Qe.forEach(o, (function(t) {
5518
5518
  return n.persistence.dh.Cn(i, t);
5519
5519
  })).next((function() {
5520
5520
  n.persistence.dh.removeTarget(i, r);
@@ -5570,13 +5570,13 @@ var Ke = /** @class */ function() {
5570
5570
  t.prototype.Eo = function(t) {
5571
5571
  this.persistence.Eo(t);
5572
5572
  }, t.prototype.$h = function(t, e, n) {
5573
- var r = this, i = e.batch, o = i.keys(), s = Be.resolve();
5573
+ var r = this, i = e.batch, o = i.keys(), s = Qe.resolve();
5574
5574
  return o.forEach((function(r) {
5575
5575
  s = s.next((function() {
5576
5576
  return n.tr(t, r);
5577
5577
  })).next((function(t) {
5578
5578
  var o = t, s = e.pn.get(r);
5579
- Le(null !== s, "ackVersions should contain every doc in the write."), (!o || o.version.C(s) < 0) && ((o = i.Bt(r, o, e)) &&
5579
+ Ve(null !== s, "ackVersions should contain every doc in the write."), (!o || o.version.C(s) < 0) && ((o = i.Bt(r, o, e)) &&
5580
5580
  // We use the commitVersion as the readTime rather than the
5581
5581
  // document's updateTime since the updateTime is not advanced
5582
5582
  // for updates that do not modify the underlying document.
@@ -5656,7 +5656,7 @@ var Ke = /** @class */ function() {
5656
5656
  *
5657
5657
  * @param err An error returned by a LocalStore operation.
5658
5658
  * @return A Promise that resolves after we recovered, or the original error.
5659
- */ function Ze(t) {
5659
+ */ function Ke(t) {
5660
5660
  return e(this, void 0, void 0, (function() {
5661
5661
  return n(this, (function(e) {
5662
5662
  if (t.code !== b.FAILED_PRECONDITION || "The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab." !== t.message) throw t;
@@ -5815,7 +5815,7 @@ function an(t, e, n, r, i) {
5815
5815
  }(t);
5816
5816
  return e ? "a custom " + e + " object" : "an object";
5817
5817
  }
5818
- return "function" == typeof t ? "a function" : Ve("Unknown wrong type: " + typeof t);
5818
+ return "function" == typeof t ? "a function" : Le("Unknown wrong type: " + typeof t);
5819
5819
  }
5820
5820
 
5821
5821
  function ln(t, e, n) {
@@ -5826,7 +5826,7 @@ function ln(t, e, n) {
5826
5826
  * Validates the provided positional argument is an object, and its keys and
5827
5827
  * values match the expected keys and types provided in optionTypes.
5828
5828
  */ function pn(t, e, n) {
5829
- F(e, (function(e, r) {
5829
+ x(e, (function(e, r) {
5830
5830
  if (n.indexOf(e) < 0) throw new A(b.INVALID_ARGUMENT, "Unknown option '" + e + "' passed to function " + t + "(). Available options: " + n.join(", "));
5831
5831
  }));
5832
5832
  }
@@ -5935,7 +5935,7 @@ function wn() {
5935
5935
  *
5936
5936
  * Note that while you can't hide the constructor in JavaScript code, we are
5937
5937
  * using the hack above to make sure no-one outside this module can call it.
5938
- */ Ke.eo = 3e8;
5938
+ */ Xe.eo = 3e8;
5939
5939
 
5940
5940
  var bn = /** @class */ function() {
5941
5941
  function t(t) {
@@ -5945,13 +5945,13 @@ var bn = /** @class */ function() {
5945
5945
  tn("Blob.fromBase64String", arguments, 1), rn("Blob.fromBase64String", "string", 1, e),
5946
5946
  En();
5947
5947
  try {
5948
- return new t(B.fromBase64String(e));
5948
+ return new t(Q.fromBase64String(e));
5949
5949
  } catch (e) {
5950
5950
  throw new A(b.INVALID_ARGUMENT, "Failed to construct Blob from Base64 string: " + e);
5951
5951
  }
5952
5952
  }, t.fromUint8Array = function(e) {
5953
5953
  if (tn("Blob.fromUint8Array", arguments, 1), wn(), !(e instanceof Uint8Array)) throw dn("Blob.fromUint8Array", "Uint8Array", 1, e);
5954
- return new t(B.fromUint8Array(e));
5954
+ return new t(Q.fromUint8Array(e));
5955
5955
  }, t.prototype.toBase64 = function() {
5956
5956
  return tn("Blob.toBase64", arguments, 0), En(), this.bo.toBase64();
5957
5957
  }, t.prototype.toUint8Array = function() {
@@ -5974,7 +5974,7 @@ var bn = /** @class */ function() {
5974
5974
  if (!(e instanceof Array) || e.length < 1) throw new A(b.INVALID_ARGUMENT, "Function FieldPath() requires its fieldNames argument to be an array with at least " + mn(1, "element") + ".");
5975
5975
  }(0, t);
5976
5976
  for (var n = 0; n < t.length; ++n) if (rn("FieldPath", "string", n, t[n]), 0 === t[n].length) throw new A(b.INVALID_ARGUMENT, "Invalid field name at argument $(i + 1). Field names must not be empty.");
5977
- this.vo = new O(t);
5977
+ this.vo = new U(t);
5978
5978
  }
5979
5979
  return t.documentId = function() {
5980
5980
  return t.So;
@@ -5997,7 +5997,7 @@ var bn = /** @class */ function() {
5997
5997
  * included), but in the cases we currently support documentId(), the net
5998
5998
  * effect is the same.
5999
5999
  */
6000
- Nn.So = new Nn(O.X().G());
6000
+ Nn.So = new Nn(U.X().G());
6001
6001
 
6002
6002
  /**
6003
6003
  * Matches any characters in a field path string that are reserved.
@@ -6085,7 +6085,7 @@ var Sn = /** @class */ function(e) {
6085
6085
  return (n = e.call(this, "FieldValue.increment") || this).Fo = t, n;
6086
6086
  }
6087
6087
  return t(n, e), n;
6088
- }(Tn), Vn = gn(Tn, "Use FieldValue.<field>() instead."), Ln = /** @class */ function() {
6088
+ }(Tn), Ln = gn(Tn, "Use FieldValue.<field>() instead."), Vn = /** @class */ function() {
6089
6089
  function t(t, e) {
6090
6090
  if (tn("GeoPoint", arguments, 2), rn("GeoPoint", "number", 1, t), rn("GeoPoint", "number", 2, e),
6091
6091
  !isFinite(t) || t < -90 || t > 90) throw new A(b.INVALID_ARGUMENT, "Latitude must be a number between -90 and 90, but was: " + t);
@@ -6118,9 +6118,9 @@ var Sn = /** @class */ function(e) {
6118
6118
  * with an underscore.
6119
6119
  */
6120
6120
  t.prototype.g = function(t) {
6121
- return Ue(this.No, t.No) || Ue(this.ko, t.ko);
6121
+ return Oe(this.No, t.No) || Oe(this.ko, t.ko);
6122
6122
  }, t;
6123
- }(), On = /^__.*__$/, Un = /** @class */ function() {
6123
+ }(), Un = /^__.*__$/, On = /** @class */ function() {
6124
6124
  function t(t, e, n) {
6125
6125
  this.data = t, this.se = e, this.fieldTransforms = n;
6126
6126
  }
@@ -6140,7 +6140,7 @@ var Sn = /** @class */ function(e) {
6140
6140
  }, t;
6141
6141
  }();
6142
6142
 
6143
- function qn(t) {
6143
+ function Pn(t) {
6144
6144
  switch (t) {
6145
6145
  case 0 /* Set */ :
6146
6146
  // fall through
@@ -6154,7 +6154,7 @@ function qn(t) {
6154
6154
  return !1;
6155
6155
 
6156
6156
  default:
6157
- throw Ve("Unexpected case for UserDataSource: " + t);
6157
+ throw Le("Unexpected case for UserDataSource: " + t);
6158
6158
  }
6159
6159
  }
6160
6160
 
@@ -6218,32 +6218,32 @@ function qn(t) {
6218
6218
  if (null !== this.path) for (var t = 0; t < this.path.length; t++) this.qo(this.path.get(t));
6219
6219
  }, t.prototype.qo = function(t) {
6220
6220
  if (0 === t.length) throw this.Qo("Document fields must not be empty");
6221
- if (qn(this.$o) && On.test(t)) throw this.Qo('Document fields cannot begin and end with "__"');
6221
+ if (Pn(this.$o) && Un.test(t)) throw this.Qo('Document fields cannot begin and end with "__"');
6222
6222
  }, t;
6223
- }(), Pn = function(t, e) {
6223
+ }(), qn = function(t, e) {
6224
6224
  this.ci = t, this.key = e;
6225
- }, xn = /** @class */ function() {
6225
+ }, Fn = /** @class */ function() {
6226
6226
  function t(t, e) {
6227
6227
  this.serializer = t, this.Wo = e
6228
6228
  /** Parse document data from a non-merge set() call. */;
6229
6229
  }
6230
6230
  return t.prototype.jo = function(t, e) {
6231
- var n = new Mn(0 /* Set */ , t, O.H);
6232
- Fn("Data must be an object, but it was:", n, e);
6231
+ var n = new Mn(0 /* Set */ , t, U.H);
6232
+ xn("Data must be an object, but it was:", n, e);
6233
6233
  var r = this.Go(e, n);
6234
- return new Un(new Tt(r),
6234
+ return new On(new Tt(r),
6235
6235
  /* fieldMask= */ null, n.fieldTransforms);
6236
6236
  },
6237
6237
  /** Parse document data from a set() call with '{merge:true}'. */ t.prototype.zo = function(t, e, n) {
6238
- var r = new Mn(2 /* MergeSet */ , t, O.H);
6239
- Fn("Data must be an object, but it was:", r, e);
6238
+ var r = new Mn(2 /* MergeSet */ , t, U.H);
6239
+ xn("Data must be an object, but it was:", r, e);
6240
6240
  var i, o, s = this.Go(e, r);
6241
6241
  if (n) {
6242
- for (var u = new P(O.k), a = 0, h = n; a < h.length; a++) {
6242
+ for (var u = new q(U.k), a = 0, h = n; a < h.length; a++) {
6243
6243
  var c = h[a], f = void 0;
6244
6244
  if (c instanceof Nn) f = c.vo; else {
6245
- if ("string" != typeof c) throw Ve("Expected stringOrFieldPath to be a string or a FieldPath");
6246
- f = Bn(t, c);
6245
+ if ("string" != typeof c) throw Le("Expected stringOrFieldPath to be a string or a FieldPath");
6246
+ f = Qn(t, c);
6247
6247
  }
6248
6248
  if (!r.contains(f)) throw new A(b.INVALID_ARGUMENT, "Field '" + f + "' is specified in your field mask but missing from your input data.");
6249
6249
  u = u.add(f);
@@ -6252,14 +6252,14 @@ function qn(t) {
6252
6252
  return i.Kt(t.field);
6253
6253
  }));
6254
6254
  } else i = yt.zt(r.se), o = r.fieldTransforms;
6255
- return new Un(new Tt(s), i, o);
6255
+ return new On(new Tt(s), i, o);
6256
6256
  },
6257
6257
  /** Parse update data from an update() call. */ t.prototype.Ko = function(t, e) {
6258
- var n = this, r = new Mn(1 /* Update */ , t, O.H);
6259
- Fn("Data must be an object, but it was:", r, e);
6260
- var i = new P(O.k), o = Tt.le();
6261
- F(e, (function(e, s) {
6262
- var u = Bn(t, e), a = r.Bo(u);
6258
+ var n = this, r = new Mn(1 /* Update */ , t, U.H);
6259
+ xn("Data must be an object, but it was:", r, e);
6260
+ var i = new q(U.k), o = Tt.le();
6261
+ x(e, (function(e, s) {
6262
+ var u = Qn(t, e), a = r.Bo(u);
6263
6263
  if ((s = n.Ho(s, a)) instanceof _n)
6264
6264
  // Add it to the field mask, but don't add anything to updateData.
6265
6265
  i = i.add(u); else {
@@ -6271,10 +6271,10 @@ function qn(t) {
6271
6271
  return new Cn(o.he(), s, r.fieldTransforms);
6272
6272
  },
6273
6273
  /** Parse update data from a list of field/value arguments. */ t.prototype.Yo = function(t, e, n, r) {
6274
- var i = new Mn(1 /* Update */ , t, O.H), o = [ jn(t, e) ], s = [ n ];
6274
+ var i = new Mn(1 /* Update */ , t, U.H), o = [ jn(t, e) ], s = [ n ];
6275
6275
  if (r.length % 2 != 0) throw new A(b.INVALID_ARGUMENT, "Function " + t + "() needs to be called with an even number of arguments that alternate between field names and values.");
6276
6276
  for (var u = 0; u < r.length; u += 2) o.push(jn(t, r[u])), s.push(r[u + 1]);
6277
- for (var a = new P(O.k), h = Tt.le(), c = 0; c < o.length; ++c) {
6277
+ for (var a = new q(U.k), h = Tt.le(), c = 0; c < o.length; ++c) {
6278
6278
  var f = o[c], l = i.Bo(f), p = this.Ho(s[c], l);
6279
6279
  if (p instanceof _n)
6280
6280
  // Add it to the field mask, but don't add anything to updateData.
@@ -6295,14 +6295,14 @@ function qn(t) {
6295
6295
  */
6296
6296
  t.prototype.Xo = function(t, e, n) {
6297
6297
  void 0 === n && (n = !1);
6298
- var r = new Mn(n ? 4 /* ArrayArgument */ : 3 /* Argument */ , t, O.H);
6298
+ var r = new Mn(n ? 4 /* ArrayArgument */ : 3 /* Argument */ , t, U.H);
6299
6299
  return this.Jo(e, r);
6300
6300
  },
6301
6301
  /** Sends data through this.preConverter, handling any thrown errors. */ t.prototype.Ho = function(t, e) {
6302
6302
  try {
6303
6303
  return this.Wo(t);
6304
6304
  } catch (t) {
6305
- var n = zn(t);
6305
+ var n = Bn(t);
6306
6306
  throw e.Qo(n);
6307
6307
  }
6308
6308
  },
@@ -6316,7 +6316,7 @@ function qn(t) {
6316
6316
  * that should not be included in the resulting parsed data.
6317
6317
  */
6318
6318
  t.prototype.Jo = function(t, e) {
6319
- if (Gn(t = this.Ho(t, e))) return Fn("Unsupported field value:", e, t), this.Go(t, e);
6319
+ if (Gn(t = this.Ho(t, e))) return xn("Unsupported field value:", e, t), this.Go(t, e);
6320
6320
  if (t instanceof Tn)
6321
6321
  // FieldValues usually parse into transforms (except FieldValue.delete())
6322
6322
  // in which case we do not want to include this field in our parsed data
@@ -6343,7 +6343,7 @@ function qn(t) {
6343
6343
  return j(t) ?
6344
6344
  // If we encounter an empty object, we explicitly add it to the update
6345
6345
  // mask to ensure that the server creates a map entry.
6346
- e.path && e.path.length > 0 && e.se.push(e.path) : F(t, (function(t, i) {
6346
+ e.path && e.path.length > 0 && e.se.push(e.path) : x(t, (function(t, i) {
6347
6347
  var o = n.Jo(i, e.Uo(t));
6348
6348
  null != o && (r[t] = o);
6349
6349
  })), {
@@ -6373,7 +6373,7 @@ function qn(t) {
6373
6373
  */
6374
6374
  t.prototype.Zo = function(t, e) {
6375
6375
  // Sentinels are only supported with writes, and not within arrays.
6376
- if (!qn(e.$o)) throw e.Qo(t.Co + "() can only be used with update() and set()");
6376
+ if (!Pn(e.$o)) throw e.Qo(t.Co + "() can only be used with update() and set()");
6377
6377
  if (null === e.path) throw e.Qo(t.Co + "() is not currently supported inside arrays");
6378
6378
  if (t instanceof _n) {
6379
6379
  if (2 /* MergeSet */ !== e.$o) throw 1 /* Update */ === e.$o ? e.Qo("FieldValue.delete() can only appear at the top level of your update data") : e.Qo("FieldValue.delete() cannot be used with set() unless you pass {merge:true}");
@@ -6389,7 +6389,7 @@ function qn(t) {
6389
6389
  } else if (t instanceof Dn) {
6390
6390
  var s = this.Xo("FieldValue.increment", t.Fo), u = new pt(this.serializer, s);
6391
6391
  e.fieldTransforms.push(new vt(e.path, u));
6392
- } else Ve("Unknown FieldValue type: " + t);
6392
+ } else Le("Unknown FieldValue type: " + t);
6393
6393
  },
6394
6394
  /**
6395
6395
  * Helper to parse a scalar value (i.e. not an Object, Array, or FieldValue)
@@ -6422,7 +6422,7 @@ function qn(t) {
6422
6422
  timestampValue: this.serializer.F(r)
6423
6423
  };
6424
6424
  }
6425
- if (t instanceof Ln) return {
6425
+ if (t instanceof Vn) return {
6426
6426
  geoPointValue: {
6427
6427
  latitude: t.latitude,
6428
6428
  longitude: t.longitude
@@ -6431,7 +6431,7 @@ function qn(t) {
6431
6431
  if (t instanceof bn) return {
6432
6432
  bytesValue: this.serializer.Ti(t)
6433
6433
  };
6434
- if (t instanceof Pn) return {
6434
+ if (t instanceof qn) return {
6435
6435
  referenceValue: this.serializer.Ei(t.key.path, t.ci)
6436
6436
  };
6437
6437
  throw e.Qo("Unsupported field value: " + fn(t));
@@ -6441,7 +6441,7 @@ function qn(t) {
6441
6441
  // Although array transforms are used with writes, the actual elements
6442
6442
  // being unioned or removed are not considered writes since they cannot
6443
6443
  // contain any FieldValue sentinels, etc.
6444
- var i = new Mn(3 /* Argument */ , t, O.H);
6444
+ var i = new Mn(3 /* Argument */ , t, U.H);
6445
6445
  return n.Jo(e, i.xo(r));
6446
6446
  }));
6447
6447
  }, t;
@@ -6460,10 +6460,10 @@ function qn(t) {
6460
6460
  * to specific FieldValue types other than ObjectValue.
6461
6461
  */
6462
6462
  function Gn(t) {
6463
- return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof S || t instanceof Ln || t instanceof bn || t instanceof Pn || t instanceof Tn);
6463
+ return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof S || t instanceof Vn || t instanceof bn || t instanceof qn || t instanceof Tn);
6464
6464
  }
6465
6465
 
6466
- function Fn(t, e, n) {
6466
+ function xn(t, e, n) {
6467
6467
  if (!Gn(n) || !cn(n)) {
6468
6468
  var r = fn(n);
6469
6469
  throw "an object" === r ? e.Qo(t + " a custom object") : e.Qo(t + " " + r);
@@ -6474,7 +6474,7 @@ function Fn(t, e, n) {
6474
6474
  * Helper that calls fromDotSeparatedString() but wraps any error thrown.
6475
6475
  */ function jn(t, e) {
6476
6476
  if (e instanceof Nn) return e.vo;
6477
- if ("string" == typeof e) return Bn(t, e);
6477
+ if ("string" == typeof e) return Qn(t, e);
6478
6478
  throw new A(b.INVALID_ARGUMENT, "Function " + t + "() called with invalid data. Field path arguments must be of type string or FieldPath.");
6479
6479
  }
6480
6480
 
@@ -6484,7 +6484,7 @@ function Fn(t, e, n) {
6484
6484
  * @param methodName The publicly visible method name
6485
6485
  * @param path The dot-separated string form of a field path which will be split
6486
6486
  * on dots.
6487
- */ function Bn(t, e) {
6487
+ */ function Qn(t, e) {
6488
6488
  try {
6489
6489
  return function(t) {
6490
6490
  if (t.search(In) >= 0) throw new A(b.INVALID_ARGUMENT, "Invalid field path (" + t + "). Paths must not contain '~', '*', '/', '[', or ']'");
@@ -6495,7 +6495,7 @@ function Fn(t, e, n) {
6495
6495
  }
6496
6496
  }(e).vo;
6497
6497
  } catch (e) {
6498
- var n = zn(e);
6498
+ var n = Bn(e);
6499
6499
  throw new A(b.INVALID_ARGUMENT, "Function " + t + "() called with invalid data. " + n);
6500
6500
  }
6501
6501
  }
@@ -6503,7 +6503,7 @@ function Fn(t, e, n) {
6503
6503
  /**
6504
6504
  * Extracts the message from a caught exception, which should be an Error object
6505
6505
  * though JS doesn't guarantee that.
6506
- */ function zn(t) {
6506
+ */ function Bn(t) {
6507
6507
  return t instanceof Error ? t.message : t.toString();
6508
6508
  }
6509
6509
 
@@ -6531,7 +6531,7 @@ function Fn(t, e, n) {
6531
6531
  * backoff curve, and a +/- 50% "jitter" that is calculated and added to the
6532
6532
  * base delay. This prevents clients from accidentally synchronizing their
6533
6533
  * delays causing spikes of load to the backend.
6534
- */ var Qn = /** @class */ function() {
6534
+ */ var zn = /** @class */ function() {
6535
6535
  function t(
6536
6536
  /**
6537
6537
  * The AsyncQueue to run backoff operations on.
@@ -6611,7 +6611,7 @@ function Fn(t, e, n) {
6611
6611
  * getCloseGuardedDispatcher() to invalidate callbacks that happen after
6612
6612
  * close.
6613
6613
  */
6614
- this.Ta = 0, this.ma = null, this.stream = null, this.Ea = new Qn(t, e)
6614
+ this.Ta = 0, this.ma = null, this.stream = null, this.Ea = new zn(t, e)
6615
6615
  /**
6616
6616
  * Returns true if start() has been called and no error has occurred. True
6617
6617
  * indicates the stream is open or in the process of opening (which
@@ -6870,7 +6870,7 @@ function Fn(t, e, n) {
6870
6870
  * PersistentWriteStream manages propagating this value from responses to the
6871
6871
  * next request.
6872
6872
  */
6873
- s.lastStreamToken = B.Ut, s;
6873
+ s.lastStreamToken = Q.Ut, s;
6874
6874
  }
6875
6875
  return t(n, e), Object.defineProperty(n.prototype, "Ua", {
6876
6876
  /**
@@ -6893,7 +6893,7 @@ function Fn(t, e, n) {
6893
6893
  }, n.prototype.onMessage = function(t) {
6894
6894
  if (
6895
6895
  // Always capture the last stream token.
6896
- Le(!!t.streamToken, "Got a write response without a stream token"), this.lastStreamToken = this.serializer.mi(t.streamToken),
6896
+ Ve(!!t.streamToken, "Got a write response without a stream token"), this.lastStreamToken = this.serializer.mi(t.streamToken),
6897
6897
  this.Ma) {
6898
6898
  // A successful first write response means the stream is healthy,
6899
6899
  // Note, that we could consider a successful handshake healthy, however,
@@ -6903,7 +6903,7 @@ function Fn(t, e, n) {
6903
6903
  return this.listener.Ba(n, e);
6904
6904
  }
6905
6905
  // The first response is always the handshake response
6906
- return Le(!t.writeResults || 0 === t.writeResults.length, "Got mutation results for handshake"),
6906
+ return Ve(!t.writeResults || 0 === t.writeResults.length, "Got mutation results for handshake"),
6907
6907
  this.Ma = !0, this.listener.xa();
6908
6908
  },
6909
6909
  /**
@@ -6952,7 +6952,7 @@ function Fn(t, e, n) {
6952
6952
  }))
6953
6953
  };
6954
6954
  return this.Ka("BatchGetDocuments", n).then((function(n) {
6955
- var r = Zt();
6955
+ var r = Kt();
6956
6956
  n.forEach((function(t) {
6957
6957
  var n = e.serializer.Di(t);
6958
6958
  r = r.nt(n.key, n);
@@ -6960,7 +6960,7 @@ function Fn(t, e, n) {
6960
6960
  var i = [];
6961
6961
  return t.forEach((function(t) {
6962
6962
  var e = r.get(t);
6963
- Le(!!e, "Missing entity in write response for " + t), i.push(e);
6963
+ Ve(!!e, "Missing entity in write response for " + t), i.push(e);
6964
6964
  })), i;
6965
6965
  }));
6966
6966
  },
@@ -6980,7 +6980,7 @@ function Fn(t, e, n) {
6980
6980
  throw t.code === b.UNAUTHENTICATED && n.credentials.l(), t;
6981
6981
  }));
6982
6982
  }, t;
6983
- }(), Xn = /** @class */ function() {
6983
+ }(), Zn = /** @class */ function() {
6984
6984
  function t(t) {
6985
6985
  this.Ha = t,
6986
6986
  // The version of each document that was read during this transaction.
@@ -7009,7 +7009,7 @@ function Fn(t, e, n) {
7009
7009
 
7010
7010
  case 1:
7011
7011
  return [ 2 /*return*/ , ((e = n.sent()).forEach((function(t) {
7012
- t instanceof Rt || t instanceof St ? r.eu(t) : Ve("Document in a transaction was a " + t.constructor.name);
7012
+ t instanceof Rt || t instanceof St ? r.eu(t) : Le("Document in a transaction was a " + t.constructor.name);
7013
7013
  })), e) ];
7014
7014
  }
7015
7015
  }));
@@ -7052,7 +7052,7 @@ function Fn(t, e, n) {
7052
7052
  }, t.prototype.eu = function(t) {
7053
7053
  var e;
7054
7054
  if (t instanceof St) e = t.version; else {
7055
- if (!(t instanceof Rt)) throw Ve("Document in a transaction was a " + t.constructor.name);
7055
+ if (!(t instanceof Rt)) throw Le("Document in a transaction was a " + t.constructor.name);
7056
7056
  // For deleted docs, we must use baseVersion 0 when we overwrite them.
7057
7057
  e = R.S();
7058
7058
  }
@@ -7099,7 +7099,7 @@ function Fn(t, e, n) {
7099
7099
  }, t.prototype.write = function(t) {
7100
7100
  this.tu(), this.mutations = this.mutations.concat(t);
7101
7101
  }, t.prototype.tu = function() {}, t;
7102
- }(), Kn = /** @class */ function() {
7102
+ }(), Xn = /** @class */ function() {
7103
7103
  function t(t, e) {
7104
7104
  this.Ar = t, this.iu = e,
7105
7105
  /** The current OnlineState. */
@@ -7168,7 +7168,7 @@ function Fn(t, e, n) {
7168
7168
  }, t.prototype.lu = function() {
7169
7169
  null !== this.ru && (this.ru.cancel(), this.ru = null);
7170
7170
  }, t;
7171
- }(), Zn = /** @class */ function() {
7171
+ }(), Kn = /** @class */ function() {
7172
7172
  function t(
7173
7173
  /**
7174
7174
  * The local store, used to fill the write pipeline with outbound mutations.
@@ -7228,7 +7228,7 @@ function Fn(t, e, n) {
7228
7228
  }));
7229
7229
  }));
7230
7230
  }));
7231
- })), this.Iu = new Kn(i, o),
7231
+ })), this.Iu = new Xn(i, o),
7232
7232
  // Create streams (but note they're not started yet).
7233
7233
  this.Au = this.Ha.ja({
7234
7234
  Na: this.Pu.bind(this),
@@ -7450,7 +7450,7 @@ function Fn(t, e, n) {
7450
7450
  if (n) {
7451
7451
  // Clear the resume token for the target, since we're in a known mismatch
7452
7452
  // state.
7453
- e.fu.set(t, n.ss(B.Ut, n.ts)),
7453
+ e.fu.set(t, n.ss(Q.Ut, n.ts)),
7454
7454
  // Cause a hard reset by unwatching and rewatching immediately, but
7455
7455
  // deliberately don't send a resume token so that we get a full update.
7456
7456
  e.Ou(t);
@@ -7549,7 +7549,7 @@ function Fn(t, e, n) {
7549
7549
  var r = n[e];
7550
7550
  t.gu.qa(r.mutations);
7551
7551
  }
7552
- })).catch(Ze);
7552
+ })).catch(Ke);
7553
7553
  }, t.prototype.Ba = function(t, e) {
7554
7554
  var n = this, r = this.du.shift(), i = Ge.from(r, t, e, this.gu.lastStreamToken);
7555
7555
  return this.Mu.zu(i).then((function() {
@@ -7576,7 +7576,7 @@ function Fn(t, e, n) {
7576
7576
  // no longer valid. Note that the handshake does not count as a write: see
7577
7577
  // comments on isPermanentWriteError for details.
7578
7578
  return Jt(t.code) ? [ 2 /*return*/ , (Se("RemoteStore", "RemoteStore error before completed handshake; resetting stream token: ", this.gu.lastStreamToken),
7579
- this.gu.lastStreamToken = B.Ut, this._u.Qh(B.Ut).catch(Ze)) ] : [ 2 /*return*/ ];
7579
+ this.gu.lastStreamToken = Q.Ut, this._u.Qh(Q.Ut).catch(Ke)) ] : [ 2 /*return*/ ];
7580
7580
  }));
7581
7581
  }));
7582
7582
  }, t.prototype.Ku = function(t) {
@@ -7592,7 +7592,7 @@ function Fn(t, e, n) {
7592
7592
  }));
7593
7593
  }));
7594
7594
  }, t.prototype.Yu = function() {
7595
- return new Xn(this.Ha);
7595
+ return new Zn(this.Ha);
7596
7596
  }, t.prototype.Ru = function() {
7597
7597
  return e(this, void 0, void 0, (function() {
7598
7598
  return n(this, (function(t) {
@@ -7854,7 +7854,7 @@ function Fn(t, e, n) {
7854
7854
  return 0;
7855
7855
 
7856
7856
  default:
7857
- return Ve("Unknown ChangeType: " + t);
7857
+ return Le("Unknown ChangeType: " + t);
7858
7858
  }
7859
7859
  };
7860
7860
  return n(t) - n(e);
@@ -7964,7 +7964,7 @@ function Fn(t, e, n) {
7964
7964
  }, t;
7965
7965
  }(), or = /** @class */ function() {
7966
7966
  function t(t, e, n, r) {
7967
- this.Ar = t, this.Lc = e, this.updateFunction = n, this.gr = r, this.$c = 5, this.Ea = new Qn(this.Ar, "retry_transaction" /* RetryTransaction */)
7967
+ this.Ar = t, this.Lc = e, this.updateFunction = n, this.gr = r, this.$c = 5, this.Ea = new zn(this.Ar, "retry_transaction" /* RetryTransaction */)
7968
7968
  /** Runs the transaction and sets the result on deferred. */;
7969
7969
  }
7970
7970
  return t.prototype.Oc = function() {
@@ -7992,7 +7992,7 @@ function Fn(t, e, n) {
7992
7992
  }, t.prototype.Uc = function(t) {
7993
7993
  try {
7994
7994
  var e = this.updateFunction(t);
7995
- return !z(e) && e.catch && e.then ? e : (this.gr.reject(Error("Transaction callback must return a Promise")),
7995
+ return !B(e) && e.catch && e.then ? e : (this.gr.reject(Error("Transaction callback must return a Promise")),
7996
7996
  null);
7997
7997
  } catch (t) {
7998
7998
  // Do not retry errors thrown by user provided updateFunction.
@@ -8044,7 +8044,7 @@ n) {
8044
8044
  // PORTING NOTE: Manages state synchronization in multi-tab environments.
8045
8045
  n, r, i) {
8046
8046
  this._u = t, this.Lc = e, this.Qc = n, this.currentUser = r, this.Wc = i, this.jc = null,
8047
- this.Gc = new Pe((function(t) {
8047
+ this.Gc = new qe((function(t) {
8048
8048
  return t.canonicalId();
8049
8049
  })), this.zc = new Map,
8050
8050
  /**
@@ -8056,12 +8056,12 @@ n) {
8056
8056
  * Keeps track of the target ID for each document that is in limbo with an
8057
8057
  * active target.
8058
8058
  */
8059
- this.Hc = new C(U.k),
8059
+ this.Hc = new C(O.k),
8060
8060
  /**
8061
8061
  * Keeps track of the information about an active limbo resolution for each
8062
8062
  * active target ID that was started for the purpose of limbo resolution.
8063
8063
  */
8064
- this.Jc = new Map, this.Yc = new Fe,
8064
+ this.Jc = new Map, this.Yc = new xe,
8065
8065
  /** Stores user completion handlers, indexed by User and BatchId. */
8066
8066
  this.Xc = {},
8067
8067
  /** Stores user callbacks waiting for all pending writes to be acknowledged. */
@@ -8175,7 +8175,7 @@ n) {
8175
8175
  // whether any other client is still interested in this target.
8176
8176
  this.Qc.uc(e.targetId), this.Qc.dc(e.targetId) ? [ 3 /*break*/ , 2 ] : [ 4 /*yield*/ , this._u.co(e.targetId, /*keepPersistedTargetData=*/ !1).then((function() {
8177
8177
  i.Qc.lc(e.targetId), i.Lc.$u(e.targetId), i.hl(e.targetId);
8178
- })).catch(Ze) ]) : [ 3 /*break*/ , 3 ];
8178
+ })).catch(Ke) ]) : [ 3 /*break*/ , 3 ];
8179
8179
 
8180
8180
  case 1:
8181
8181
  n.sent(), n.label = 2;
@@ -8264,8 +8264,8 @@ n) {
8264
8264
  n && (
8265
8265
  // Since this is a limbo resolution lookup, it's for a single document
8266
8266
  // and it could be added, modified, or removed, but not a combination.
8267
- Le(t.Ps.size + t.Vs.size + t.ps.size <= 1, "Limbo resolution for single document contains multiple changes."),
8268
- t.Ps.size > 0 ? n.xc = !0 : t.Vs.size > 0 ? Le(n.xc, "Received change for limbo target document without add.") : t.ps.size > 0 && (Le(n.xc, "Received remove for limbo target document without add."),
8267
+ Ve(t.Ps.size + t.Vs.size + t.ps.size <= 1, "Limbo resolution for single document contains multiple changes."),
8268
+ t.Ps.size > 0 ? n.xc = !0 : t.Vs.size > 0 ? Ve(n.xc, "Received change for limbo target document without add.") : t.ps.size > 0 && (Ve(n.xc, "Received remove for limbo target document without add."),
8269
8269
  n.xc = !1));
8270
8270
  })), [ 4 /*yield*/ , this.al(e, t) ];
8271
8271
 
@@ -8274,7 +8274,7 @@ n) {
8274
8274
  return n.sent(), [ 3 /*break*/ , 6 ];
8275
8275
 
8276
8276
  case 4:
8277
- return [ 4 /*yield*/ , Ze(n.sent()) ];
8277
+ return [ 4 /*yield*/ , Ke(n.sent()) ];
8278
8278
 
8279
8279
  case 5:
8280
8280
  return n.sent(), [ 3 /*break*/ , 6 ];
@@ -8313,12 +8313,12 @@ n) {
8313
8313
  this.Qc.ac(t, "rejected", r), e = this.Jc.get(t), (i = e && e.key) ? (
8314
8314
  // Since this query failed, we won't want to manually unlisten to it.
8315
8315
  // So go ahead and remove it from bookkeeping.
8316
- this.Hc = this.Hc.remove(i), this.Jc.delete(t), this.cl(), o = (o = new C(U.k)).nt(i, new Rt(i, R.S())),
8316
+ this.Hc = this.Hc.remove(i), this.Jc.delete(t), this.cl(), o = (o = new C(O.k)).nt(i, new Rt(i, R.S())),
8317
8317
  s = oe().add(i), u = new fe(R.MIN,
8318
8318
  /* targetChanges= */ new Map,
8319
- /* targetMismatches= */ new P(Ue), o, s), [ 2 /*return*/ , this.jh(u) ]) : [ 4 /*yield*/ , this._u.co(t, /* keepPersistedTargetData */ !1).then((function() {
8319
+ /* targetMismatches= */ new q(Oe), o, s), [ 2 /*return*/ , this.jh(u) ]) : [ 4 /*yield*/ , this._u.co(t, /* keepPersistedTargetData */ !1).then((function() {
8320
8320
  return a.hl(t, r);
8321
- })).catch(Ze) ];
8321
+ })).catch(Ke) ];
8322
8322
 
8323
8323
  case 1:
8324
8324
  return n.sent(), [ 2 /*return*/ ];
@@ -8348,7 +8348,7 @@ n) {
8348
8348
  "acknowledged" === r || "rejected" === r ? (
8349
8349
  // NOTE: Both these methods are no-ops for batches that originated from
8350
8350
  // other clients.
8351
- this._l(t, i || null), this._u.To(t)) : Ve("Unknown batchState: " + r), n.label = 4;
8351
+ this._l(t, i || null), this._u.To(t)) : Le("Unknown batchState: " + r), n.label = 4;
8352
8352
 
8353
8353
  case 4:
8354
8354
  return [ 4 /*yield*/ , this.al(e) ];
@@ -8394,7 +8394,7 @@ n) {
8394
8394
  return n.sent(), [ 3 /*break*/ , 6 ];
8395
8395
 
8396
8396
  case 4:
8397
- return [ 4 /*yield*/ , Ze(n.sent()) ];
8397
+ return [ 4 /*yield*/ , Ke(n.sent()) ];
8398
8398
 
8399
8399
  case 5:
8400
8400
  return n.sent(), [ 3 /*break*/ , 6 ];
@@ -8427,7 +8427,7 @@ n) {
8427
8427
  return n.sent(), [ 3 /*break*/ , 6 ];
8428
8428
 
8429
8429
  case 4:
8430
- return [ 4 /*yield*/ , Ze(n.sent()) ];
8430
+ return [ 4 /*yield*/ , Ke(n.sent()) ];
8431
8431
 
8432
8432
  case 5:
8433
8433
  return n.sent(), [ 3 /*break*/ , 6 ];
@@ -8475,7 +8475,7 @@ n) {
8475
8475
  })), this.Zc.clear();
8476
8476
  }, t.prototype.ol = function(t, e) {
8477
8477
  var n = this.Xc[this.currentUser.s()];
8478
- n || (n = new C(Ue)), n = n.nt(t, e), this.Xc[this.currentUser.s()] = n;
8478
+ n || (n = new C(Oe)), n = n.nt(t, e), this.Xc[this.currentUser.s()] = n;
8479
8479
  },
8480
8480
  /**
8481
8481
  * Resolves or rejects the user callback for the given batch and then discards
@@ -8515,7 +8515,7 @@ n) {
8515
8515
  i instanceof nr ? (this.Yc.vn(i.key, t), this.El(i)) : i instanceof rr ? (Se("SyncEngine", "Document no longer in limbo: " + i.key),
8516
8516
  this.Yc.Cn(i.key, t), this.Yc.$n(i.key) ||
8517
8517
  // We removed the last reference for this key
8518
- this.ml(i.key)) : Ve("Unknown limbo change: " + JSON.stringify(i));
8518
+ this.ml(i.key)) : Le("Unknown limbo change: " + JSON.stringify(i));
8519
8519
  }
8520
8520
  }, t.prototype.El = function(t) {
8521
8521
  var e = t.key;
@@ -8533,7 +8533,7 @@ n) {
8533
8533
  t.prototype.cl = function() {
8534
8534
  for (;this.Kc.length > 0 && this.Hc.size < this.Wc; ) {
8535
8535
  var t = this.Kc.shift(), e = this.tl.next();
8536
- this.Jc.set(e, new ur(t)), this.Hc = this.Hc.nt(t, e), this.Lc.listen(new Yt(Lt.ve(t.path).Ue(), e, 2 /* LimboResolution */ , He.Ir));
8536
+ this.Jc.set(e, new ur(t)), this.Hc = this.Hc.nt(t, e), this.Lc.listen(new Yt(Vt.ve(t.path).Ue(), e, 2 /* LimboResolution */ , He.Ir));
8537
8537
  }
8538
8538
  },
8539
8539
  // Visible for testing
@@ -8565,7 +8565,7 @@ n) {
8565
8565
  if (s.rl(u.targetId, o.Cc), o.snapshot) {
8566
8566
  s.isPrimary && s.Qc.ac(u.targetId, o.snapshot.fromCache ? "not-current" : "current"),
8567
8567
  e.push(o.snapshot);
8568
- var a = Qe.wr(u.targetId, o.snapshot);
8568
+ var a = ze.wr(u.targetId, o.snapshot);
8569
8569
  i.push(a);
8570
8570
  }
8571
8571
  })));
@@ -8653,7 +8653,7 @@ n) {
8653
8653
  var t = this;
8654
8654
  this.Jc.forEach((function(e, n) {
8655
8655
  t.Lc.$u(n);
8656
- })), this.Yc.kn(), this.Jc = new Map, this.Hc = new C(U.k);
8656
+ })), this.Yc.kn(), this.Jc = new Map, this.Hc = new C(O.k);
8657
8657
  },
8658
8658
  /**
8659
8659
  * Reconcile the query views of the provided query targets with the state from
@@ -8736,7 +8736,7 @@ n) {
8736
8736
  */
8737
8737
  // PORTING NOTE: Multi-tab only
8738
8738
  t.prototype.Vl = function(t) {
8739
- return new Lt(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, "F" /* First */ , t.startAt, t.endAt);
8739
+ return new Vt(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, "F" /* First */ , t.startAt, t.endAt);
8740
8740
  },
8741
8741
  // PORTING NOTE: Multi-tab only
8742
8742
  t.prototype.wo = function() {
@@ -8783,7 +8783,7 @@ n) {
8783
8783
  return n.sent(), this.hl(t, i), [ 3 /*break*/ , 8 ];
8784
8784
 
8785
8785
  case 7:
8786
- Ve("Unexpected target state: " + r), n.label = 8;
8786
+ Le("Unexpected target state: " + r), n.label = 8;
8787
8787
 
8788
8788
  case 8:
8789
8789
  return [ 2 /*return*/ ];
@@ -8824,7 +8824,7 @@ n) {
8824
8824
  case 0:
8825
8825
  return h.zc.has(t) ? [ 4 /*yield*/ , h._u.co(t, /* keepPersistedTargetData */ !1).then((function() {
8826
8826
  p.Lc.$u(t), p.hl(t);
8827
- })).catch(Ze) ] : [ 3 /*break*/ , 2 ];
8827
+ })).catch(Ke) ] : [ 3 /*break*/ , 2 ];
8828
8828
 
8829
8829
  // Release queries that are still active.
8830
8830
  case 1:
@@ -8876,7 +8876,7 @@ n) {
8876
8876
  this.yl = null, this.targetId = 0, this.bl = [];
8877
8877
  }, cr = /** @class */ function() {
8878
8878
  function t(t) {
8879
- this.Mu = t, this.vl = new Pe((function(t) {
8879
+ this.Mu = t, this.vl = new qe((function(t) {
8880
8880
  return t.canonicalId();
8881
8881
  })), this.onlineState = "Unknown" /* Unknown */ , this.Sl = new Set, this.Mu.subscribe(this);
8882
8882
  }
@@ -9025,7 +9025,7 @@ n) {
9025
9025
  /** Applies the query filter and sorting to the provided documents. */ t.prototype.Ql = function(t, e) {
9026
9026
  // Sort the documents and re-apply the query filter since previously
9027
9027
  // matching documents do not necessarily still match the query.
9028
- var n = new P((function(e, n) {
9028
+ var n = new q((function(e, n) {
9029
9029
  return t.qe(e, n);
9030
9030
  }));
9031
9031
  return e.forEach((function(e, r) {
@@ -9066,9 +9066,9 @@ n) {
9066
9066
  this.Wl = new dr;
9067
9067
  }
9068
9068
  return t.prototype.jl = function(t, e) {
9069
- return this.Wl.add(e), Be.resolve();
9069
+ return this.Wl.add(e), Qe.resolve();
9070
9070
  }, t.prototype.ur = function(t, e) {
9071
- return Be.resolve(this.Wl.getEntries(e));
9071
+ return Qe.resolve(this.Wl.getEntries(e));
9072
9072
  }, t;
9073
9073
  }(), dr = /** @class */ function() {
9074
9074
  function t() {
@@ -9076,13 +9076,13 @@ n) {
9076
9076
  }
9077
9077
  // Returns false if the entry already existed.
9078
9078
  return t.prototype.add = function(t) {
9079
- var e = t.U(), n = t.O(), r = this.index[e] || new P(V.k), i = !r.has(n);
9079
+ var e = t.U(), n = t.O(), r = this.index[e] || new q(L.k), i = !r.has(n);
9080
9080
  return this.index[e] = r.add(n), i;
9081
9081
  }, t.prototype.has = function(t) {
9082
9082
  var e = t.U(), n = t.O(), r = this.index[e];
9083
9083
  return r && r.has(n);
9084
9084
  }, t.prototype.getEntries = function(t) {
9085
- return (this.index[t] || new P(V.k)).j();
9085
+ return (this.index[t] || new q(L.k)).j();
9086
9086
  }, t;
9087
9087
  }(), yr = /** @class */ function() {
9088
9088
  function t(t, e) {
@@ -9098,60 +9098,60 @@ n) {
9098
9098
  * responses the client has processed. Stream tokens are opaque checkpoint
9099
9099
  * markers whose only real value is their inclusion in the next request.
9100
9100
  */
9101
- this.lastStreamToken = B.Ut,
9101
+ this.lastStreamToken = Q.Ut,
9102
9102
  /** An ordered mapping between documents and the mutations batch IDs. */
9103
- this.zl = new P(je.me);
9103
+ this.zl = new q(je.me);
9104
9104
  }
9105
9105
  return t.prototype.Kl = function(t) {
9106
- return Be.resolve(0 === this.Hn.length);
9106
+ return Qe.resolve(0 === this.Hn.length);
9107
9107
  }, t.prototype.Nh = function(t, e, n) {
9108
9108
  var r = e.batchId, i = this.Hl(r, "acknowledged");
9109
- return Le(0 === i, "Can only acknowledge the first batch in the mutation queue"),
9109
+ return Ve(0 === i, "Can only acknowledge the first batch in the mutation queue"),
9110
9110
  // Verify that the batch in the queue is the one to be acknowledged.
9111
- this.Hn[i], this.lastStreamToken = n, Be.resolve();
9111
+ this.Hn[i], this.lastStreamToken = n, Qe.resolve();
9112
9112
  }, t.prototype.xh = function(t) {
9113
- return Be.resolve(this.lastStreamToken);
9113
+ return Qe.resolve(this.lastStreamToken);
9114
9114
  }, t.prototype.Qh = function(t, e) {
9115
- return this.lastStreamToken = e, Be.resolve();
9115
+ return this.lastStreamToken = e, Qe.resolve();
9116
9116
  }, t.prototype.Sh = function(t, e, n, r) {
9117
9117
  var i = this.Gl;
9118
9118
  this.Gl++, this.Hn.length > 0 && this.Hn[this.Hn.length - 1];
9119
- var o = new xe(i, e, n, r);
9119
+ var o = new Fe(i, e, n, r);
9120
9120
  this.Hn.push(o);
9121
9121
  // Track references by document key and index collection parents.
9122
9122
  for (var s = 0, u = r; s < u.length; s++) {
9123
9123
  var a = u[s];
9124
9124
  this.zl = this.zl.add(new je(a.key, i)), this.Jn.jl(t, a.key.path.O());
9125
9125
  }
9126
- return Be.resolve(o);
9126
+ return Qe.resolve(o);
9127
9127
  }, t.prototype.Uh = function(t, e) {
9128
- return Be.resolve(this.Jl(e));
9128
+ return Qe.resolve(this.Jl(e));
9129
9129
  }, t.prototype.Fh = function(t, e) {
9130
9130
  var n = this.Jl(e);
9131
- return Be.resolve(n.keys());
9131
+ return Qe.resolve(n.keys());
9132
9132
  }, t.prototype.no = function(t, e) {
9133
9133
  var n = e + 1, r = this.Yl(n), i = r < 0 ? 0 : r;
9134
9134
  // The requested batchId may still be out of range so normalize it to the
9135
9135
  // start of the queue.
9136
- return Be.resolve(this.Hn.length > i ? this.Hn[i] : null);
9136
+ return Qe.resolve(this.Hn.length > i ? this.Hn[i] : null);
9137
9137
  }, t.prototype.Bh = function() {
9138
- return Be.resolve(0 === this.Hn.length ? -1 : this.Gl - 1);
9138
+ return Qe.resolve(0 === this.Hn.length ? -1 : this.Gl - 1);
9139
9139
  }, t.prototype.ph = function(t) {
9140
- return Be.resolve(this.Hn.slice());
9140
+ return Qe.resolve(this.Hn.slice());
9141
9141
  }, t.prototype.Xn = function(t, e) {
9142
9142
  var n = this, r = new je(e, 0), i = new je(e, Number.POSITIVE_INFINITY), o = [];
9143
9143
  return this.zl.Dt([ r, i ], (function(t) {
9144
9144
  var e = n.Jl(t.On);
9145
9145
  o.push(e);
9146
- })), Be.resolve(o);
9146
+ })), Qe.resolve(o);
9147
9147
  }, t.prototype.nr = function(t, e) {
9148
- var n = this, r = new P(Ue);
9148
+ var n = this, r = new q(Oe);
9149
9149
  return e.forEach((function(t) {
9150
9150
  var e = new je(t, 0), i = new je(t, Number.POSITIVE_INFINITY);
9151
9151
  n.zl.Dt([ e, i ], (function(t) {
9152
9152
  r = r.add(t.On);
9153
9153
  }));
9154
- })), Be.resolve(this.Xl(r));
9154
+ })), Qe.resolve(this.Xl(r));
9155
9155
  }, t.prototype.cr = function(t, e) {
9156
9156
  // Use the query path as a prefix for testing if a document matches the
9157
9157
  // query.
@@ -9160,8 +9160,8 @@ n) {
9160
9160
  // the prefix the document key in this reference must have an even number of
9161
9161
  // segments. The empty segment can be used a suffix of the query path
9162
9162
  // because it precedes all other segments in an ordered traversal.
9163
- U.st(i) || (i = i.child(""));
9164
- var o = new je(new U(i), 0), s = new P(Ue);
9163
+ O.st(i) || (i = i.child(""));
9164
+ var o = new je(new O(i), 0), s = new q(Oe);
9165
9165
  // Find unique batchIDs referenced by all documents potentially matching the
9166
9166
  // query.
9167
9167
  return this.zl.Ft((function(t) {
@@ -9173,7 +9173,7 @@ n) {
9173
9173
  // TODO(mcg): we'll need a different scanner when we implement
9174
9174
  // ancestor queries.
9175
9175
  e.length === r && (s = s.add(t.On)), !0);
9176
- }), o), Be.resolve(this.Xl(s));
9176
+ }), o), Qe.resolve(this.Xl(s));
9177
9177
  }, t.prototype.Xl = function(t) {
9178
9178
  var e = this, n = [];
9179
9179
  // Construct an array of matching batches, sorted by batchID to ensure that
@@ -9184,10 +9184,10 @@ n) {
9184
9184
  })), n;
9185
9185
  }, t.prototype.qh = function(t, e) {
9186
9186
  var n = this;
9187
- Le(0 === this.Hl(e.batchId, "removed"), "Can only remove the first entry of the mutation queue"),
9187
+ Ve(0 === this.Hl(e.batchId, "removed"), "Can only remove the first entry of the mutation queue"),
9188
9188
  this.Hn.shift();
9189
9189
  var r = this.zl;
9190
- return Be.forEach(e.mutations, (function(i) {
9190
+ return Qe.forEach(e.mutations, (function(i) {
9191
9191
  var o = new je(i.key, e.batchId);
9192
9192
  return r = r.delete(o), n.dh.Zl(t, i.key);
9193
9193
  })).next((function() {
@@ -9197,9 +9197,9 @@ n) {
9197
9197
  // No-op since the memory mutation queue does not maintain a separate cache.
9198
9198
  }, t.prototype.$n = function(t, e) {
9199
9199
  var n = new je(e, 0), r = this.zl.Nt(n);
9200
- return Be.resolve(e.isEqual(r && r.key));
9200
+ return Qe.resolve(e.isEqual(r && r.key));
9201
9201
  }, t.prototype.Oh = function(t) {
9202
- return this.Hn.length, Be.resolve();
9202
+ return this.Hn.length, Qe.resolve();
9203
9203
  },
9204
9204
  /**
9205
9205
  * Finds the index of the given batchId in the mutation queue and asserts that
@@ -9244,7 +9244,7 @@ n) {
9244
9244
  function t(t, e) {
9245
9245
  this.Jn = t, this.t_ = e,
9246
9246
  /** Underlying cache of documents and their read times. */
9247
- this.docs = new C(U.k),
9247
+ this.docs = new C(O.k),
9248
9248
  /** Size of all cached documents. */
9249
9249
  this.size = 0
9250
9250
  /**
@@ -9273,15 +9273,15 @@ n) {
9273
9273
  e && (this.docs = this.docs.remove(t), this.size -= e.size);
9274
9274
  }, t.prototype.tr = function(t, e) {
9275
9275
  var n = this.docs.get(e);
9276
- return Be.resolve(n ? n.e_ : null);
9276
+ return Qe.resolve(n ? n.e_ : null);
9277
9277
  }, t.prototype.getEntries = function(t, e) {
9278
9278
  var n = this, r = $t();
9279
9279
  return e.forEach((function(t) {
9280
9280
  var e = n.docs.get(t);
9281
9281
  r = r.nt(t, e ? e.e_ : null);
9282
- })), Be.resolve(r);
9282
+ })), Qe.resolve(r);
9283
9283
  }, t.prototype.rr = function(t, e, n) {
9284
- for (var r = ee(), i = new U(e.path.child("")), o = this.docs._t(i)
9284
+ for (var r = ee(), i = new O(e.path.child("")), o = this.docs._t(i)
9285
9285
  // Documents are ordered by key, so we can use a prefix scan to narrow down
9286
9286
  // the documents we need to match the query against.
9287
9287
  ; o.Rt(); ) {
@@ -9289,21 +9289,21 @@ n) {
9289
9289
  if (!e.path.B(u.path)) break;
9290
9290
  c.C(n) <= 0 || h instanceof St && e.matches(h) && (r = r.nt(h.key, h));
9291
9291
  }
9292
- return Be.resolve(r);
9292
+ return Qe.resolve(r);
9293
9293
  }, t.prototype.s_ = function(t, e) {
9294
- return Be.forEach(this.docs, (function(t) {
9294
+ return Qe.forEach(this.docs, (function(t) {
9295
9295
  return e(t);
9296
9296
  }));
9297
9297
  }, t.prototype.Po = function(t, e) {
9298
9298
  throw new Error("getNewDocumentChanges() is not supported with MemoryPersistence");
9299
9299
  }, t.prototype.po = function(t) {
9300
- return Be.resolve(R.MIN);
9300
+ return Qe.resolve(R.MIN);
9301
9301
  }, t.prototype.kh = function(e) {
9302
9302
  // `trackRemovals` is ignores since the MemoryRemoteDocumentCache keeps
9303
9303
  // a separate changelog and does not need special handling for removals.
9304
9304
  return new t.i_(this);
9305
9305
  }, t.prototype.n_ = function(t) {
9306
- return Be.resolve(this.size);
9306
+ return Qe.resolve(this.size);
9307
9307
  }, t;
9308
9308
  }();
9309
9309
 
@@ -9367,7 +9367,7 @@ vr.i_ = /** @class */ function(e) {
9367
9367
  var e = this, n = [];
9368
9368
  return this.Ch.forEach((function(r, i) {
9369
9369
  i ? n.push(e.c_.Xh(t, i, e.readTime)) : e.c_.Yh(r);
9370
- })), Be.Gn(n);
9370
+ })), Qe.Gn(n);
9371
9371
  }, n.prototype.a_ = function(t, e) {
9372
9372
  return this.c_.tr(t, e);
9373
9373
  }, n.prototype.u_ = function(t, e) {
@@ -9377,7 +9377,7 @@ vr.i_ = /** @class */ function(e) {
9377
9377
  function t() {
9378
9378
  // A mapping of document key to the new cache entry that should be written (or null if any
9379
9379
  // existing cache entry should be removed).
9380
- this.Ch = new Pe((function(t) {
9380
+ this.Ch = new qe((function(t) {
9381
9381
  return t.toString();
9382
9382
  })), this.r_ = !1;
9383
9383
  }
@@ -9423,7 +9423,7 @@ vr.i_ = /** @class */ function(e) {
9423
9423
  t.prototype.tr = function(t, e) {
9424
9424
  this.o_();
9425
9425
  var n = this.Ch.get(e);
9426
- return void 0 !== n ? Be.resolve(n) : this.a_(t, e);
9426
+ return void 0 !== n ? Qe.resolve(n) : this.a_(t, e);
9427
9427
  },
9428
9428
  /**
9429
9429
  * Looks up several entries in the cache, forwarding to
@@ -9472,7 +9472,7 @@ var mr = /** @class */ function() {
9472
9472
  /**
9473
9473
  * Maps a target to the data about that target
9474
9474
  */
9475
- this.l_ = new Pe((function(t) {
9475
+ this.l_ = new qe((function(t) {
9476
9476
  return t.canonicalId();
9477
9477
  })),
9478
9478
  /** The last received snapshot version. */
@@ -9485,68 +9485,68 @@ var mr = /** @class */ function() {
9485
9485
  * A ordered bidirectional mapping between documents and the remote target
9486
9486
  * IDs.
9487
9487
  */
9488
- this.d_ = new Fe, this.targetCount = 0, this.f_ = er.Tc();
9488
+ this.d_ = new xe, this.targetCount = 0, this.f_ = er.Tc();
9489
9489
  }
9490
9490
  return t.prototype.Xs = function(t, e) {
9491
9491
  return this.l_.forEach((function(t, n) {
9492
9492
  return e(n);
9493
- })), Be.resolve();
9493
+ })), Qe.resolve();
9494
9494
  }, t.prototype.Wh = function(t) {
9495
- return Be.resolve(this.lastRemoteSnapshotVersion);
9495
+ return Qe.resolve(this.lastRemoteSnapshotVersion);
9496
9496
  }, t.prototype.w_ = function(t) {
9497
- return Be.resolve(this.__);
9497
+ return Qe.resolve(this.__);
9498
9498
  }, t.prototype.ao = function(t) {
9499
- return this.highestTargetId = this.f_.next(), Be.resolve(this.highestTargetId);
9499
+ return this.highestTargetId = this.f_.next(), Qe.resolve(this.highestTargetId);
9500
9500
  }, t.prototype.to = function(t, e, n) {
9501
9501
  return n && (this.lastRemoteSnapshotVersion = n), e > this.__ && (this.__ = e),
9502
- Be.resolve();
9502
+ Qe.resolve();
9503
9503
  }, t.prototype.T_ = function(t) {
9504
9504
  this.l_.set(t.target, t);
9505
9505
  var e = t.targetId;
9506
9506
  e > this.highestTargetId && (this.f_ = new er(e), this.highestTargetId = e), t.sequenceNumber > this.__ && (this.__ = t.sequenceNumber);
9507
9507
  }, t.prototype.uo = function(t, e) {
9508
- return this.T_(e), this.targetCount += 1, Be.resolve();
9508
+ return this.T_(e), this.targetCount += 1, Qe.resolve();
9509
9509
  }, t.prototype.Jh = function(t, e) {
9510
- return this.T_(e), Be.resolve();
9510
+ return this.T_(e), Qe.resolve();
9511
9511
  }, t.prototype.m_ = function(t, e) {
9512
9512
  return this.l_.delete(e.target), this.d_.Nn(e.targetId), this.targetCount -= 1,
9513
- Be.resolve();
9513
+ Qe.resolve();
9514
9514
  }, t.prototype.E_ = function(t, e, n) {
9515
9515
  var r = this, i = 0, o = [];
9516
9516
  return this.l_.forEach((function(s, u) {
9517
9517
  u.sequenceNumber <= e && null === n.get(u.targetId) && (r.l_.delete(s), o.push(r.R_(t, u.targetId)),
9518
9518
  i++);
9519
- })), Be.Gn(o).next((function() {
9519
+ })), Qe.Gn(o).next((function() {
9520
9520
  return i;
9521
9521
  }));
9522
9522
  }, t.prototype.I_ = function(t) {
9523
- return Be.resolve(this.targetCount);
9523
+ return Qe.resolve(this.targetCount);
9524
9524
  }, t.prototype.oo = function(t, e) {
9525
9525
  var n = this.l_.get(e) || null;
9526
- return Be.resolve(n);
9526
+ return Qe.resolve(n);
9527
9527
  }, t.prototype.ui = function(t, e) {
9528
9528
  // This method is only needed for multi-tab and we can't implement it
9529
9529
  // efficiently without additional data structures.
9530
- return Ve("Not yet implemented.");
9530
+ return Le("Not yet implemented.");
9531
9531
  }, t.prototype.zh = function(t, e, n) {
9532
9532
  this.d_.Sn(e, n);
9533
9533
  var r = this.persistence.dh, i = [];
9534
9534
  return r && e.forEach((function(e) {
9535
9535
  i.push(r.vn(t, e));
9536
- })), Be.Gn(i);
9536
+ })), Qe.Gn(i);
9537
9537
  }, t.prototype.Gh = function(t, e, n) {
9538
9538
  this.d_.Fn(e, n);
9539
9539
  var r = this.persistence.dh, i = [];
9540
9540
  return r && e.forEach((function(e) {
9541
9541
  i.push(r.Cn(t, e));
9542
- })), Be.Gn(i);
9542
+ })), Qe.Gn(i);
9543
9543
  }, t.prototype.R_ = function(t, e) {
9544
- return this.d_.Nn(e), Be.resolve();
9544
+ return this.d_.Nn(e), Qe.resolve();
9545
9545
  }, t.prototype._o = function(t, e) {
9546
9546
  var n = this.d_.Ln(e);
9547
- return Be.resolve(n);
9547
+ return Qe.resolve(n);
9548
9548
  }, t.prototype.$n = function(t, e) {
9549
- return Be.resolve(this.d_.$n(e));
9549
+ return Qe.resolve(this.d_.$n(e));
9550
9550
  }, t;
9551
9551
  }(), gr = /** @class */ function() {
9552
9552
  /**
@@ -9562,9 +9562,7 @@ var mr = /** @class */ function() {
9562
9562
  return n.dh.p_(t);
9563
9563
  }));
9564
9564
  }
9565
- return t.prototype.start = function() {
9566
- return Promise.resolve();
9567
- }, t.prototype.ku = function() {
9565
+ return t.prototype.ku = function() {
9568
9566
  // No durable state to ensure is closed on shutdown.
9569
9567
  return this.V_ = !1, Promise.resolve();
9570
9568
  }, Object.defineProperty(t.prototype, "g_", {
@@ -9607,7 +9605,7 @@ var mr = /** @class */ function() {
9607
9605
  return i.C_(), t;
9608
9606
  }));
9609
9607
  }, t.prototype.D_ = function(t, e) {
9610
- return Be.zn(Object.values(this.A_).map((function(n) {
9608
+ return Qe.zn(Object.values(this.A_).map((function(n) {
9611
9609
  return function() {
9612
9610
  return n.$n(t, e);
9613
9611
  };
@@ -9647,18 +9645,18 @@ var mr = /** @class */ function() {
9647
9645
  }, Object.defineProperty(t.prototype, "M_", {
9648
9646
  get: function() {
9649
9647
  if (this.L_) return this.L_;
9650
- throw Ve("orphanedDocuments is only valid during a transaction.");
9648
+ throw Le("orphanedDocuments is only valid during a transaction.");
9651
9649
  },
9652
9650
  enumerable: !0,
9653
9651
  configurable: !0
9654
9652
  }), t.prototype._h = function(t) {
9655
9653
  this.k_ = t;
9656
9654
  }, t.prototype.vn = function(t, e) {
9657
- return this.M_.delete(e), Be.resolve();
9655
+ return this.M_.delete(e), Qe.resolve();
9658
9656
  }, t.prototype.Cn = function(t, e) {
9659
- return this.M_.add(e), Be.resolve();
9657
+ return this.M_.add(e), Qe.resolve();
9660
9658
  }, t.prototype.Zl = function(t, e) {
9661
- return this.M_.add(e), Be.resolve();
9659
+ return this.M_.add(e), Qe.resolve();
9662
9660
  }, t.prototype.removeTarget = function(t, e) {
9663
9661
  var n = this, r = this.persistence.Eh();
9664
9662
  return r._o(t, e.targetId).next((function(t) {
@@ -9673,7 +9671,7 @@ var mr = /** @class */ function() {
9673
9671
  }, t.prototype.S_ = function(t) {
9674
9672
  var e = this, n = this.persistence.Th().kh();
9675
9673
  // Remove newly orphaned documents.
9676
- return Be.forEach(this.M_, (function(r) {
9674
+ return Qe.forEach(this.M_, (function(r) {
9677
9675
  return e.U_(t, r).next((function(t) {
9678
9676
  t || n.Yh(r);
9679
9677
  }));
@@ -9690,82 +9688,46 @@ var mr = /** @class */ function() {
9690
9688
  return 0;
9691
9689
  }, t.prototype.U_ = function(t, e) {
9692
9690
  var n = this;
9693
- return Be.zn([ function() {
9691
+ return Qe.zn([ function() {
9694
9692
  return n.persistence.Eh().$n(t, e);
9695
9693
  }, function() {
9696
9694
  return n.persistence.D_(t, e);
9697
9695
  }, function() {
9698
- return Be.resolve(n.k_.$n(e));
9696
+ return Qe.resolve(n.k_.$n(e));
9699
9697
  } ]);
9700
9698
  }, t;
9701
- }(), br = /** @class */ function() {
9702
- function t() {}
9703
- return t.prototype.initialize = function(t) {
9699
+ }(), br = "You are using the memory-only build of Firestore. Persistence support is only available via the @firebase/firestore bundle or the firebase-firestore.js build.", Ar = /** @class */ function() {
9700
+ function t(t) {
9701
+ void 0 === t && (t = Er.O_), this.q_ = t;
9702
+ }
9703
+ return t.prototype.initialize = function(t, r, i, o, s, u, a, h) {
9704
9704
  return e(this, void 0, void 0, (function() {
9705
- var r = this;
9706
- return n(this, (function(i) {
9707
- switch (i.label) {
9705
+ var e = this;
9706
+ return n(this, (function(n) {
9707
+ switch (n.label) {
9708
9708
  case 0:
9709
- return this.Qc = this.q_(t), this.persistence = this.B_(t), [ 4 /*yield*/ , this.persistence.start() ];
9709
+ if (h.B_) throw new A(b.FAILED_PRECONDITION, br);
9710
+ return this.persistence = new gr(s, this.q_), this.x_ = null, this.Qc = new tr,
9711
+ this._u = new Xe(this.persistence, new lr, u), this.Lc = new Kn(this._u, o, t, (function(t) {
9712
+ return e.Mu.Dc(t, 0 /* RemoteStore */);
9713
+ }), i.Q_()), this.Mu = new ar(this._u, this.Lc, this.Qc, u, a), this.W_ = new cr(this.Mu),
9714
+ this.Lc.Mu = this.Mu, [ 4 /*yield*/ , this.Lc.start() ];
9710
9715
 
9711
9716
  case 1:
9712
- return i.sent(), this.x_ = this.Q_(t), this._u = this.W_(t), this.Lc = this.j_(t),
9713
- this.Mu = this.G_(t), this.z_ = this.K_(t), this.Qc.iu = function(t) {
9714
- return r.Mu.Dc(t, 1 /* SharedClientState */);
9715
- }, this.Lc.Mu = this.Mu, this.Qc.Mu = this.Mu, [ 4 /*yield*/ , this.Qc.start() ];
9717
+ return n.sent(), [ 4 /*yield*/ , this.Lc.Zu(!0) ];
9716
9718
 
9717
9719
  case 2:
9718
- return i.sent(), [ 4 /*yield*/ , this.Lc.start() ];
9720
+ return n.sent(), [ 4 /*yield*/ , this.Mu.Zu(!0) ];
9719
9721
 
9720
9722
  case 3:
9721
- return i.sent(), [ 4 /*yield*/ , this._u.start() ];
9722
-
9723
- case 4:
9724
- // NOTE: This will immediately call the listener, so we make sure to
9725
- // set it after localStore / remoteStore are started.
9726
- return i.sent(), [ 4 /*yield*/ , this.persistence.y_((function(t) {
9727
- return e(r, void 0, void 0, (function() {
9728
- return n(this, (function(e) {
9729
- switch (e.label) {
9730
- case 0:
9731
- return [ 4 /*yield*/ , this.Mu.Zu(t) ];
9732
-
9733
- case 1:
9734
- return e.sent(), this.x_ && (t && !this.x_.g_ ? this.x_.start(this._u) : t || this.x_.stop()),
9735
- [ 2 /*return*/ ];
9736
- }
9737
- }));
9738
- }));
9739
- })) ];
9740
-
9741
- case 5:
9742
- // NOTE: This will immediately call the listener, so we make sure to
9743
- // set it after localStore / remoteStore are started.
9744
- return i.sent(), [ 2 /*return*/ ];
9723
+ return n.sent(), [ 2 /*return*/ ];
9745
9724
  }
9746
9725
  }));
9747
9726
  }));
9748
- }, t.prototype.K_ = function(t) {
9749
- return new cr(this.Mu);
9750
- }, t.prototype.Q_ = function(t) {
9751
- return null;
9752
- }, t.prototype.W_ = function(t) {
9753
- return new Ke(this.persistence, new lr, t.H_);
9754
- }, t.prototype.B_ = function(t) {
9755
- return new gr(t.clientId, Er.O_);
9756
- }, t.prototype.j_ = function(t) {
9757
- var e = this;
9758
- return new Zn(this._u, t.Ha, t.Ar, (function(t) {
9759
- return e.Mu.Dc(t, 0 /* RemoteStore */);
9760
- }), t.platform.J_());
9761
- }, t.prototype.q_ = function(t) {
9762
- return new tr;
9763
- }, t.prototype.G_ = function(t) {
9764
- return new ar(this._u, this.Lc, this.Qc, t.H_, t.Wc);
9765
- }, t.prototype.clearPersistence = function(t) {
9766
- throw new A(b.FAILED_PRECONDITION, "You are using the memory-only build of Firestore. Persistence support is only available via the @firebase/firestore bundle or the firebase-firestore.js build.");
9727
+ }, t.prototype.clearPersistence = function() {
9728
+ throw new A(b.FAILED_PRECONDITION, br);
9767
9729
  }, t;
9768
- }(), Ar = /** @class */ function() {
9730
+ }(), Nr = /** @class */ function() {
9769
9731
  function t(t, e, n,
9770
9732
  /**
9771
9733
  * Asynchronous queue responsible for all of our internal processing. When
@@ -9776,7 +9738,7 @@ var mr = /** @class */ function() {
9776
9738
  * an async I/O to complete).
9777
9739
  */
9778
9740
  r) {
9779
- this.platform = t, this.Y_ = e, this.credentials = n, this.Ar = r, this.clientId = Oe.Tn()
9741
+ this.platform = t, this.j_ = e, this.credentials = n, this.Ar = r, this.clientId = Ue.Tn()
9780
9742
  /**
9781
9743
  * Starts up the FirestoreClient, returning only whether or not enabling
9782
9744
  * persistence succeeded.
@@ -9816,7 +9778,7 @@ var mr = /** @class */ function() {
9816
9778
  }
9817
9779
  return t.prototype.start = function(t, e) {
9818
9780
  var n = this;
9819
- this.X_();
9781
+ this.G_();
9820
9782
  // We defer our initialization until we get the current user from
9821
9783
  // setChangeListener(). We block the async queue until we got the initial
9822
9784
  // user and the initialization is completed. This will prevent any scheduled
@@ -9833,7 +9795,7 @@ var mr = /** @class */ function() {
9833
9795
  // need to await the completion of initializationDone because the result of
9834
9796
  // this method should not reflect any other kind of failure to start.
9835
9797
  return this.credentials._((function(s) {
9836
- if (!o) return o = !0, Se("FirestoreClient", "Initializing. user=", s.uid), n.Z_(t, e, s, i).then(r.resolve, r.reject);
9798
+ if (!o) return o = !0, Se("FirestoreClient", "Initializing. user=", s.uid), n.z_(t, e, s, i).then(r.resolve, r.reject);
9837
9799
  n.Ar.Cr((function() {
9838
9800
  return n.Xu(s);
9839
9801
  }));
@@ -9845,7 +9807,7 @@ var mr = /** @class */ function() {
9845
9807
  },
9846
9808
  /** Enables the network connection and requeues all pending operations. */ t.prototype.enableNetwork = function() {
9847
9809
  var t = this;
9848
- return this.X_(), this.Ar.enqueue((function() {
9810
+ return this.G_(), this.Ar.enqueue((function() {
9849
9811
  return t.Mu.enableNetwork();
9850
9812
  }));
9851
9813
  },
@@ -9869,30 +9831,21 @@ var mr = /** @class */ function() {
9869
9831
  * continue, i.e. that one of the persistence implementations actually
9870
9832
  * succeeded.
9871
9833
  */
9872
- t.prototype.Z_ = function(t, r, i, o) {
9834
+ t.prototype.z_ = function(t, r, i, o) {
9873
9835
  return e(this, void 0, void 0, (function() {
9874
9836
  var s, u, a, h, c = this;
9875
9837
  return n(this, (function(f) {
9876
9838
  switch (f.label) {
9877
9839
  case 0:
9878
- return f.trys.push([ 0, 3, , 4 ]), [ 4 /*yield*/ , this.platform.td(this.Y_) ];
9840
+ return f.trys.push([ 0, 3, , 4 ]), [ 4 /*yield*/ , this.platform.K_(this.j_) ];
9879
9841
 
9880
9842
  case 1:
9881
- return s = f.sent(), u = this.platform.ed(this.Y_.ci), a = new Jn(this.Ar, s, this.credentials, u),
9882
- [ 4 /*yield*/ , t.initialize({
9883
- Ar: this.Ar,
9884
- Y_: this.Y_,
9885
- platform: this.platform,
9886
- Ha: a,
9887
- clientId: this.clientId,
9888
- H_: i,
9889
- Wc: 100,
9890
- sd: r
9891
- }) ];
9843
+ return s = f.sent(), u = this.platform.H_(this.j_.ci), a = new Jn(this.Ar, s, this.credentials, u),
9844
+ [ 4 /*yield*/ , t.initialize(this.Ar, this.j_, this.platform, a, this.clientId, i, 100, r) ];
9892
9845
 
9893
9846
  case 2:
9894
9847
  return f.sent(), this.persistence = t.persistence, this.Qc = t.Qc, this._u = t._u,
9895
- this.Lc = t.Lc, this.Mu = t.Mu, this.x_ = t.x_, this.nd = t.z_,
9848
+ this.Lc = t.Lc, this.Mu = t.Mu, this.x_ = t.x_, this.J_ = t.W_,
9896
9849
  // When a user calls clearPersistence() in one client, all other clients
9897
9850
  // need to be terminated to allow the delete to succeed.
9898
9851
  this.persistence.b_((function() {
@@ -9914,10 +9867,10 @@ var mr = /** @class */ function() {
9914
9867
  if (h = f.sent(),
9915
9868
  // Regardless of whether or not the retry succeeds, from an user
9916
9869
  // perspective, offline persistence has failed.
9917
- o.reject(h), !this.rd(h)) throw h;
9870
+ o.reject(h), !this.Y_(h)) throw h;
9918
9871
  return [ 2 /*return*/ , (console.warn("Error enabling offline persistence. Falling back to persistence disabled: " + h),
9919
- this.Z_(new br, {
9920
- hd: !1
9872
+ this.z_(new Ar, {
9873
+ B_: !1
9921
9874
  }, i, o)) ];
9922
9875
 
9923
9876
  case 4:
@@ -9930,7 +9883,7 @@ var mr = /** @class */ function() {
9930
9883
  * Decides whether the provided error allows us to gracefully disable
9931
9884
  * persistence (as opposed to crashing the client).
9932
9885
  */
9933
- t.prototype.rd = function(t) {
9886
+ t.prototype.Y_ = function(t) {
9934
9887
  return "FirebaseError" === t.name ? t.code === b.FAILED_PRECONDITION || t.code === b.UNIMPLEMENTED : !("undefined" != typeof DOMException && t instanceof DOMException) ||
9935
9888
  // When the browser is out of quota we could get either quota exceeded
9936
9889
  // or an aborted error depending on whether the error happened during
@@ -9944,7 +9897,7 @@ var mr = /** @class */ function() {
9944
9897
  * Checks that the client has not been terminated. Ensures that other methods on
9945
9898
  * this class cannot be called after the client is terminated.
9946
9899
  */
9947
- t.prototype.X_ = function() {
9900
+ t.prototype.G_ = function() {
9948
9901
  if (this.Ar.Or) throw new A(b.FAILED_PRECONDITION, "The client has already been terminated.");
9949
9902
  }, t.prototype.Xu = function(t) {
9950
9903
  return this.Ar.jr(), Se("FirestoreClient", "Credential Changed. Current user: " + t.uid),
@@ -9952,7 +9905,7 @@ var mr = /** @class */ function() {
9952
9905
  },
9953
9906
  /** Disables the network connection. Pending operations will not complete. */ t.prototype.disableNetwork = function() {
9954
9907
  var t = this;
9955
- return this.X_(), this.Ar.enqueue((function() {
9908
+ return this.G_(), this.Ar.enqueue((function() {
9956
9909
  return t.Mu.disableNetwork();
9957
9910
  }));
9958
9911
  }, t.prototype.terminate = function() {
@@ -9990,37 +9943,37 @@ var mr = /** @class */ function() {
9990
9943
  */
9991
9944
  t.prototype.waitForPendingWrites = function() {
9992
9945
  var t = this;
9993
- this.X_();
9946
+ this.G_();
9994
9947
  var e = new Ye;
9995
9948
  return this.Ar.Cr((function() {
9996
9949
  return t.Mu.fl(e);
9997
9950
  })), e.promise;
9998
9951
  }, t.prototype.listen = function(t, e, n) {
9999
9952
  var r = this;
10000
- this.X_();
9953
+ this.G_();
10001
9954
  var i = new fr(t, e, n);
10002
9955
  return this.Ar.Cr((function() {
10003
- return r.nd.listen(i);
9956
+ return r.J_.listen(i);
10004
9957
  })), i;
10005
9958
  }, t.prototype.$u = function(t) {
10006
9959
  var e = this;
10007
9960
  // Checks for termination but does not raise error, allowing unlisten after
10008
9961
  // termination to be a no-op.
10009
- this.od || this.Ar.Cr((function() {
10010
- return e.nd.$u(t);
9962
+ this.X_ || this.Ar.Cr((function() {
9963
+ return e.J_.$u(t);
10011
9964
  }));
10012
- }, t.prototype.ad = function(t) {
9965
+ }, t.prototype.Z_ = function(t) {
10013
9966
  var e = this;
10014
- return this.X_(), this.Ar.enqueue((function() {
9967
+ return this.G_(), this.Ar.enqueue((function() {
10015
9968
  return e._u.ro(t);
10016
9969
  })).then((function(t) {
10017
9970
  if (t instanceof St) return t;
10018
9971
  if (t instanceof Rt) return null;
10019
9972
  throw new A(b.UNAVAILABLE, "Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)");
10020
9973
  }));
10021
- }, t.prototype.ud = function(t) {
9974
+ }, t.prototype.td = function(t) {
10022
9975
  var r = this;
10023
- return this.X_(), this.Ar.enqueue((function() {
9976
+ return this.G_(), this.Ar.enqueue((function() {
10024
9977
  return e(r, void 0, void 0, (function() {
10025
9978
  var e, r, i;
10026
9979
  return n(this, (function(n) {
@@ -10038,23 +9991,23 @@ var mr = /** @class */ function() {
10038
9991
  }));
10039
9992
  }, t.prototype.write = function(t) {
10040
9993
  var e = this;
10041
- this.X_();
9994
+ this.G_();
10042
9995
  var n = new Ye;
10043
9996
  return this.Ar.Cr((function() {
10044
9997
  return e.Mu.write(t, n);
10045
9998
  })), n.promise;
10046
9999
  }, t.prototype.ci = function() {
10047
- return this.Y_.ci;
10000
+ return this.j_.ci;
10048
10001
  }, t.prototype.Fl = function(t) {
10049
10002
  var e = this;
10050
- this.X_(), this.Ar.Cr((function() {
10051
- return e.nd.Fl(t), Promise.resolve();
10003
+ this.G_(), this.Ar.Cr((function() {
10004
+ return e.J_.Fl(t), Promise.resolve();
10052
10005
  }));
10053
10006
  }, t.prototype.Nl = function(t) {
10054
10007
  // Checks for shutdown but does not raise error, allowing remove after
10055
10008
  // shutdown to be a no-op.
10056
- this.od || this.nd.Nl(t);
10057
- }, Object.defineProperty(t.prototype, "od", {
10009
+ this.X_ || this.J_.Nl(t);
10010
+ }, Object.defineProperty(t.prototype, "X_", {
10058
10011
  get: function() {
10059
10012
  // Technically, the asyncQueue is still running, but only accepting operations
10060
10013
  // related to termination or supposed to be run after termination. It is effectively
@@ -10065,13 +10018,13 @@ var mr = /** @class */ function() {
10065
10018
  configurable: !0
10066
10019
  }), t.prototype.transaction = function(t) {
10067
10020
  var e = this;
10068
- this.X_();
10021
+ this.G_();
10069
10022
  var n = new Ye;
10070
10023
  return this.Ar.Cr((function() {
10071
10024
  return e.Mu.runTransaction(e.Ar, t, n), Promise.resolve();
10072
10025
  })), n.promise;
10073
10026
  }, t;
10074
- }(), Nr = /** @class */ function() {
10027
+ }(), Ir = /** @class */ function() {
10075
10028
  function t(t) {
10076
10029
  this.observer = t,
10077
10030
  /**
@@ -10081,12 +10034,12 @@ var mr = /** @class */ function() {
10081
10034
  this.muted = !1;
10082
10035
  }
10083
10036
  return t.prototype.next = function(t) {
10084
- this.ld(this.observer.next, t);
10037
+ this.ed(this.observer.next, t);
10085
10038
  }, t.prototype.error = function(t) {
10086
- this.ld(this.observer.error, t);
10087
- }, t.prototype._d = function() {
10039
+ this.ed(this.observer.error, t);
10040
+ }, t.prototype.sd = function() {
10088
10041
  this.muted = !0;
10089
- }, t.prototype.ld = function(t, e) {
10042
+ }, t.prototype.ed = function(t, e) {
10090
10043
  var n = this;
10091
10044
  this.muted || setTimeout((function() {
10092
10045
  n.muted || t(e);
@@ -10130,7 +10083,7 @@ var mr = /** @class */ function() {
10130
10083
  * See the License for the specific language governing permissions and
10131
10084
  * limitations under the License.
10132
10085
  */
10133
- function Ir(t) {
10086
+ function Tr(t) {
10134
10087
  /**
10135
10088
  * Returns true if obj is an object and contains at least one of the specified
10136
10089
  * methods.
@@ -10145,11 +10098,11 @@ function Ir(t) {
10145
10098
  }(t);
10146
10099
  }
10147
10100
 
10148
- var Tr = /** @class */ function() {
10101
+ var _r = /** @class */ function() {
10149
10102
  function t(t, e, n, r) {
10150
- this.firestore = t, this.timestampsInSnapshots = e, this.dd = n, this.converter = r;
10103
+ this.firestore = t, this.timestampsInSnapshots = e, this.nd = n, this.converter = r;
10151
10104
  }
10152
- return t.prototype.fd = function(t) {
10105
+ return t.prototype.rd = function(t) {
10153
10106
  switch (J(t)) {
10154
10107
  case 0 /* NullValue */ :
10155
10108
  return null;
@@ -10161,10 +10114,10 @@ var Tr = /** @class */ function() {
10161
10114
  return nt(t.integerValue || t.doubleValue);
10162
10115
 
10163
10116
  case 3 /* TimestampValue */ :
10164
- return this.wd(t.timestampValue);
10117
+ return this.hd(t.timestampValue);
10165
10118
 
10166
10119
  case 4 /* ServerTimestampValue */ :
10167
- return this.Td(t);
10120
+ return this.od(t);
10168
10121
 
10169
10122
  case 5 /* StringValue */ :
10170
10123
  return t.stringValue;
@@ -10173,58 +10126,58 @@ var Tr = /** @class */ function() {
10173
10126
  return new bn(rt(t.bytesValue));
10174
10127
 
10175
10128
  case 7 /* RefValue */ :
10176
- return this.md(t.referenceValue);
10129
+ return this.ad(t.referenceValue);
10177
10130
 
10178
10131
  case 8 /* GeoPointValue */ :
10179
- return new Ln(t.geoPointValue.latitude, t.geoPointValue.longitude);
10132
+ return new Vn(t.geoPointValue.latitude, t.geoPointValue.longitude);
10180
10133
 
10181
10134
  case 9 /* ArrayValue */ :
10182
- return this.Ed(t.arrayValue);
10135
+ return this.ud(t.arrayValue);
10183
10136
 
10184
10137
  case 10 /* ObjectValue */ :
10185
- return this.Rd(t.mapValue);
10138
+ return this.ld(t.mapValue);
10186
10139
 
10187
10140
  default:
10188
- throw Ve("Invalid value type: " + JSON.stringify(t));
10141
+ throw Le("Invalid value type: " + JSON.stringify(t));
10189
10142
  }
10190
- }, t.prototype.Rd = function(t) {
10143
+ }, t.prototype.ld = function(t) {
10191
10144
  var e = this, n = {};
10192
- return F(t.fields || {}, (function(t, r) {
10193
- n[t] = e.fd(r);
10145
+ return x(t.fields || {}, (function(t, r) {
10146
+ n[t] = e.rd(r);
10194
10147
  })), n;
10195
- }, t.prototype.Ed = function(t) {
10148
+ }, t.prototype.ud = function(t) {
10196
10149
  var e = this;
10197
10150
  return (t.values || []).map((function(t) {
10198
- return e.fd(t);
10151
+ return e.rd(t);
10199
10152
  }));
10200
- }, t.prototype.Td = function(t) {
10201
- switch (this.dd) {
10153
+ }, t.prototype.od = function(t) {
10154
+ switch (this.nd) {
10202
10155
  case "previous":
10203
10156
  var e = function t(e) {
10204
10157
  var n = e.mapValue.fields.__previous_value__;
10205
10158
  return H(n) ? t(n) : n;
10206
10159
  }(t);
10207
- return null == e ? null : this.fd(e);
10160
+ return null == e ? null : this.rd(e);
10208
10161
 
10209
10162
  case "estimate":
10210
- return this.wd(Y(t));
10163
+ return this.hd(Y(t));
10211
10164
 
10212
10165
  default:
10213
10166
  return null;
10214
10167
  }
10215
- }, t.prototype.wd = function(t) {
10168
+ }, t.prototype.hd = function(t) {
10216
10169
  var e = et(t), n = new S(e.seconds, e.nanos);
10217
10170
  return this.timestampsInSnapshots ? n : n.toDate();
10218
- }, t.prototype.md = function(t) {
10219
- var e = V.K(t);
10220
- Le(Ne(e), "ReferenceValue is not valid " + t);
10221
- var n = new Me(e.get(1), e.get(3)), r = new U(e.$(5));
10222
- return n.isEqual(this.firestore.Id) ||
10171
+ }, t.prototype.ad = function(t) {
10172
+ var e = L.K(t);
10173
+ Ve(Ne(e), "ReferenceValue is not valid " + t);
10174
+ var n = new Me(e.get(1), e.get(3)), r = new O(e.$(5));
10175
+ return n.isEqual(this.firestore._d) ||
10223
10176
  // TODO(b/64130202): Somehow support foreign references.
10224
- Re("Document " + r + " contains a document reference within a different database (" + n.projectId + "/" + n.database + ") which is not supported. It will be treated as a reference in the current database (" + this.firestore.Id.projectId + "/" + this.firestore.Id.database + ") instead."),
10177
+ Re("Document " + r + " contains a document reference within a different database (" + n.projectId + "/" + n.database + ") which is not supported. It will be treated as a reference in the current database (" + this.firestore._d.projectId + "/" + this.firestore._d.database + ") instead."),
10225
10178
  new Vr(r, this.firestore, this.converter);
10226
10179
  }, t;
10227
- }(), _r = Xe.sh, kr = /** @class */ function() {
10180
+ }(), kr = Ze.sh, Sr = /** @class */ function() {
10228
10181
  function t(t) {
10229
10182
  var e, n;
10230
10183
  if (void 0 === t.host) {
@@ -10239,8 +10192,8 @@ var Tr = /** @class */ function() {
10239
10192
  // whether they set it to true or false...
10240
10193
  !0 === t.timestampsInSnapshots ? Re("The setting 'timestampsInSnapshots: true' is no longer required and should be removed.") : !1 === t.timestampsInSnapshots && Re("Support for 'timestampsInSnapshots: false' will be removed soon. You must update your code to handle Timestamp objects."),
10241
10194
  this.timestampsInSnapshots = null === (n = t.timestampsInSnapshots) || void 0 === n || n,
10242
- un("settings", "number", "cacheSizeBytes", t.cacheSizeBytes), void 0 === t.cacheSizeBytes) this.cacheSizeBytes = Xe.nh; else {
10243
- if (t.cacheSizeBytes !== _r && t.cacheSizeBytes < Xe.ih) throw new A(b.INVALID_ARGUMENT, "cacheSizeBytes must be at least " + Xe.ih);
10195
+ un("settings", "number", "cacheSizeBytes", t.cacheSizeBytes), void 0 === t.cacheSizeBytes) this.cacheSizeBytes = Ze.nh; else {
10196
+ if (t.cacheSizeBytes !== kr && t.cacheSizeBytes < Ze.ih) throw new A(b.INVALID_ARGUMENT, "cacheSizeBytes must be at least " + Ze.ih);
10244
10197
  this.cacheSizeBytes = t.cacheSizeBytes;
10245
10198
  }
10246
10199
  un("settings", "boolean", "experimentalForceLongPolling", t.experimentalForceLongPolling),
@@ -10249,16 +10202,16 @@ var Tr = /** @class */ function() {
10249
10202
  return t.prototype.isEqual = function(t) {
10250
10203
  return this.host === t.host && this.ssl === t.ssl && this.timestampsInSnapshots === t.timestampsInSnapshots && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.forceLongPolling === t.forceLongPolling;
10251
10204
  }, t;
10252
- }(), Sr = /** @class */ function() {
10205
+ }(), Rr = /** @class */ function() {
10253
10206
  // Note: We are using `MemoryComponentProvider` as a default
10254
10207
  // ComponentProvider to ensure backwards compatibility with the format
10255
10208
  // expected by the console build.
10256
10209
  function t(r, i, o) {
10257
10210
  var s = this;
10258
- if (void 0 === o && (o = new br), this.Ad = null,
10211
+ if (void 0 === o && (o = new Ar), this.dd = null,
10259
10212
  // Public for use in tests.
10260
10213
  // TODO(mikelehen): Use modularized initialization instead.
10261
- this.Pd = new Je, this.INTERNAL = {
10214
+ this.fd = new Je, this.INTERNAL = {
10262
10215
  delete: function() {
10263
10216
  return e(s, void 0, void 0, (function() {
10264
10217
  return n(this, (function(t) {
@@ -10266,7 +10219,7 @@ var Tr = /** @class */ function() {
10266
10219
  case 0:
10267
10220
  // The client must be initalized to ensure that all subsequent API usage
10268
10221
  // throws an exception.
10269
- return this.Vd(), [ 4 /*yield*/ , this.pd.terminate() ];
10222
+ return this.wd(), [ 4 /*yield*/ , this.Td.terminate() ];
10270
10223
 
10271
10224
  case 1:
10272
10225
  // The client must be initalized to ensure that all subsequent API usage
@@ -10280,63 +10233,63 @@ var Tr = /** @class */ function() {
10280
10233
  // This is very likely a Firebase app object
10281
10234
  // TODO(b/34177605): Can we somehow use instanceof?
10282
10235
  var u = r;
10283
- this.Ad = u, this.Id = t.gd(u), this.yd = u.name, this.bd = new T(i);
10236
+ this.dd = u, this._d = t.md(u), this.Ed = u.name, this.Rd = new T(i);
10284
10237
  } else {
10285
10238
  var a = r;
10286
10239
  if (!a.projectId) throw new A(b.INVALID_ARGUMENT, "Must provide projectId");
10287
- this.Id = new Me(a.projectId, a.database),
10240
+ this._d = new Me(a.projectId, a.database),
10288
10241
  // Use a default persistenceKey that lines up with FirebaseApp.
10289
- this.yd = "[DEFAULT]", this.bd = new I;
10242
+ this.Ed = "[DEFAULT]", this.Rd = new I;
10290
10243
  }
10291
- this.vd = o, this.Sd = new kr({}), this.Cd = this.Dd(this.Id);
10244
+ this.Id = o, this.Ad = new Sr({}), this.Pd = this.Vd(this._d);
10292
10245
  }
10293
10246
  return t.prototype.settings = function(t) {
10294
10247
  tn("Firestore.settings", arguments, 1), rn("Firestore.settings", "object", 1, t);
10295
- var e = new kr(t);
10296
- if (this.pd && !this.Sd.isEqual(e)) throw new A(b.FAILED_PRECONDITION, "Firestore has already been started and its settings can no longer be changed. You can only call settings() before calling any other methods on a Firestore object.");
10297
- this.Sd = e, void 0 !== e.credentials && (this.bd = function(t) {
10248
+ var e = new Sr(t);
10249
+ if (this.Td && !this.Ad.isEqual(e)) throw new A(b.FAILED_PRECONDITION, "Firestore has already been started and its settings can no longer be changed. You can only call settings() before calling any other methods on a Firestore object.");
10250
+ this.Ad = e, void 0 !== e.credentials && (this.Rd = function(t) {
10298
10251
  if (!t) return new I;
10299
10252
  switch (t.type) {
10300
10253
  case "gapi":
10301
- var e = t.Fd;
10254
+ var e = t.pd;
10302
10255
  // Make sure this really is a Gapi client.
10303
- return Le(!("object" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty), "unexpected gapi interface"),
10256
+ return Ve(!("object" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty), "unexpected gapi interface"),
10304
10257
  new k(e, t.V || "0");
10305
10258
 
10306
10259
  case "provider":
10307
- return t.Fd;
10260
+ return t.pd;
10308
10261
 
10309
10262
  default:
10310
10263
  throw new A(b.INVALID_ARGUMENT, "makeCredentialsProvider failed due to invalid credential type");
10311
10264
  }
10312
10265
  }(e.credentials));
10313
10266
  }, t.prototype.enableNetwork = function() {
10314
- return this.Vd(), this.pd.enableNetwork();
10267
+ return this.wd(), this.Td.enableNetwork();
10315
10268
  }, t.prototype.disableNetwork = function() {
10316
- return this.Vd(), this.pd.disableNetwork();
10269
+ return this.wd(), this.Td.disableNetwork();
10317
10270
  }, t.prototype.enablePersistence = function(t) {
10318
10271
  var e, n;
10319
- if (this.pd) throw new A(b.FAILED_PRECONDITION, "Firestore has already been started and persistence can no longer be enabled. You can only call enablePersistence() before calling any other methods on a Firestore object.");
10272
+ if (this.Td) throw new A(b.FAILED_PRECONDITION, "Firestore has already been started and persistence can no longer be enabled. You can only call enablePersistence() before calling any other methods on a Firestore object.");
10320
10273
  var r = !1;
10321
10274
  return t && (void 0 !== t.experimentalTabSynchronization && Re("The 'experimentalTabSynchronization' setting will be removed. Use 'synchronizeTabs' instead."),
10322
10275
  r = null !== (n = null !== (e = t.synchronizeTabs) && void 0 !== e ? e : t.experimentalTabSynchronization) && void 0 !== n && n),
10323
- this.Nd(this.vd, {
10324
- hd: !0,
10325
- cacheSizeBytes: this.Sd.cacheSizeBytes,
10276
+ this.gd(this.Id, {
10277
+ B_: !0,
10278
+ cacheSizeBytes: this.Ad.cacheSizeBytes,
10326
10279
  synchronizeTabs: r
10327
10280
  });
10328
10281
  }, t.prototype.clearPersistence = function() {
10329
10282
  return e(this, void 0, void 0, (function() {
10330
10283
  var t, r = this;
10331
10284
  return n(this, (function(i) {
10332
- if (void 0 !== this.pd && !this.pd.od) throw new A(b.FAILED_PRECONDITION, "Persistence cannot be cleared after this Firestore instance is initialized.");
10333
- return t = new Ye, [ 2 /*return*/ , (this.Pd.Mr((function() {
10285
+ if (void 0 !== this.Td && !this.Td.X_) throw new A(b.FAILED_PRECONDITION, "Persistence cannot be cleared after this Firestore instance is initialized.");
10286
+ return t = new Ye, [ 2 /*return*/ , (this.fd.Mr((function() {
10334
10287
  return e(r, void 0, void 0, (function() {
10335
10288
  var e, r;
10336
10289
  return n(this, (function(n) {
10337
10290
  switch (n.label) {
10338
10291
  case 0:
10339
- return n.trys.push([ 0, 2, , 3 ]), e = this.kd(), [ 4 /*yield*/ , this.vd.clearPersistence(e) ];
10292
+ return n.trys.push([ 0, 2, , 3 ]), e = this.yd(), [ 4 /*yield*/ , this.Id.clearPersistence(e) ];
10340
10293
 
10341
10294
  case 1:
10342
10295
  return n.sent(), t.resolve(), [ 3 /*break*/ , 3 ];
@@ -10354,58 +10307,58 @@ var Tr = /** @class */ function() {
10354
10307
  }));
10355
10308
  }, t.prototype.terminate = function() {
10356
10309
  return this.app._removeServiceInstance("firestore"), this.INTERNAL.delete();
10357
- }, Object.defineProperty(t.prototype, "Ld", {
10310
+ }, Object.defineProperty(t.prototype, "bd", {
10358
10311
  get: function() {
10359
- return this.Vd(), this.pd.od;
10312
+ return this.wd(), this.Td.X_;
10360
10313
  },
10361
10314
  enumerable: !0,
10362
10315
  configurable: !0
10363
10316
  }), t.prototype.waitForPendingWrites = function() {
10364
- return this.Vd(), this.pd.waitForPendingWrites();
10317
+ return this.wd(), this.Td.waitForPendingWrites();
10365
10318
  }, t.prototype.onSnapshotsInSync = function(t) {
10366
- if (this.Vd(), Ir(t)) return this.$d(t);
10319
+ if (this.wd(), Tr(t)) return this.vd(t);
10367
10320
  rn("Firestore.onSnapshotsInSync", "function", 1, t);
10368
10321
  var e = {
10369
10322
  next: t
10370
10323
  };
10371
- return this.$d(e);
10372
- }, t.prototype.$d = function(t) {
10373
- var e = this, n = new Nr({
10324
+ return this.vd(e);
10325
+ }, t.prototype.vd = function(t) {
10326
+ var e = this, n = new Ir({
10374
10327
  next: function() {
10375
10328
  t.next && t.next();
10376
10329
  },
10377
10330
  error: function(t) {
10378
- throw Ve("Uncaught Error in onSnapshotsInSync");
10331
+ throw Le("Uncaught Error in onSnapshotsInSync");
10379
10332
  }
10380
10333
  });
10381
- return this.pd.Fl(n), function() {
10382
- n._d(), e.pd.Nl(n);
10334
+ return this.Td.Fl(n), function() {
10335
+ n.sd(), e.Td.Nl(n);
10383
10336
  };
10384
- }, t.prototype.Vd = function() {
10385
- return this.pd ||
10337
+ }, t.prototype.wd = function() {
10338
+ return this.Td ||
10386
10339
  // Kick off starting the client but don't actually wait for it.
10387
10340
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
10388
- this.Nd(new br, {
10389
- hd: !1
10390
- }), this.pd;
10391
- }, t.prototype.kd = function() {
10392
- return new qe(this.Id, this.yd, this.Sd.host, this.Sd.ssl, this.Sd.forceLongPolling);
10393
- }, t.prototype.Nd = function(t, e) {
10394
- var n = this.kd();
10395
- return this.pd = new Ar(Ie.Ot(), n, this.bd, this.Pd), this.pd.start(t, e);
10396
- }, t.prototype.Dd = function(t) {
10341
+ this.gd(new Ar, {
10342
+ B_: !1
10343
+ }), this.Td;
10344
+ }, t.prototype.yd = function() {
10345
+ return new Pe(this._d, this.Ed, this.Ad.host, this.Ad.ssl, this.Ad.forceLongPolling);
10346
+ }, t.prototype.gd = function(t, e) {
10347
+ var n = this.yd();
10348
+ return this.Td = new Nr(Ie.Ot(), n, this.Rd, this.fd), this.Td.start(t, e);
10349
+ }, t.prototype.Vd = function(t) {
10397
10350
  var e = new Ae(t, {
10398
10351
  di: Ie.Ot().di
10399
10352
  });
10400
- return new xn(e, (function(e) {
10353
+ return new Fn(e, (function(e) {
10401
10354
  if (e instanceof Vr) {
10402
- var n = t, r = e.firestore.Id;
10355
+ var n = t, r = e.firestore._d;
10403
10356
  if (!r.isEqual(n)) throw new A(b.INVALID_ARGUMENT, "Document reference is for database " + r.projectId + "/" + r.database + " but should be for database " + n.projectId + "/" + n.database);
10404
- return new Pn(t, e.Od);
10357
+ return new qn(t, e.Sd);
10405
10358
  }
10406
10359
  return e;
10407
10360
  }));
10408
- }, t.gd = function(t) {
10361
+ }, t.md = function(t) {
10409
10362
  if (e = t.options, "projectId", !Object.prototype.hasOwnProperty.call(e, "projectId")) throw new A(b.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
10410
10363
  var e, n = t.options.projectId;
10411
10364
  // Export the classes with a private constructor (it will fail if invoked
@@ -10416,29 +10369,29 @@ var Tr = /** @class */ function() {
10416
10369
  return new Me(n);
10417
10370
  }, Object.defineProperty(t.prototype, "app", {
10418
10371
  get: function() {
10419
- if (!this.Ad) throw new A(b.FAILED_PRECONDITION, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
10420
- return this.Ad;
10372
+ if (!this.dd) throw new A(b.FAILED_PRECONDITION, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
10373
+ return this.dd;
10421
10374
  },
10422
10375
  enumerable: !0,
10423
10376
  configurable: !0
10424
10377
  }), t.prototype.collection = function(t) {
10425
10378
  return tn("Firestore.collection", arguments, 1), rn("Firestore.collection", "non-empty string", 1, t),
10426
- this.Vd(), new Mr(V.K(t), this);
10379
+ this.wd(), new qr(L.K(t), this);
10427
10380
  }, t.prototype.doc = function(t) {
10428
10381
  return tn("Firestore.doc", arguments, 1), rn("Firestore.doc", "non-empty string", 1, t),
10429
- this.Vd(), Vr.Md(V.K(t), this);
10382
+ this.wd(), Vr.Cd(L.K(t), this);
10430
10383
  }, t.prototype.collectionGroup = function(t) {
10431
10384
  if (tn("Firestore.collectionGroup", arguments, 1), rn("Firestore.collectionGroup", "non-empty string", 1, t),
10432
10385
  t.indexOf("/") >= 0) throw new A(b.INVALID_ARGUMENT, "Invalid collection ID '" + t + "' passed to function Firestore.collectionGroup(). Collection IDs must not contain '/'.");
10433
- return this.Vd(), new Cr(new Lt(V.H, t), this);
10386
+ return this.wd(), new Pr(new Vt(L.H, t), this);
10434
10387
  }, t.prototype.runTransaction = function(t) {
10435
10388
  var e = this;
10436
10389
  return tn("Firestore.runTransaction", arguments, 1), rn("Firestore.runTransaction", "function", 1, t),
10437
- this.Vd().transaction((function(n) {
10438
- return t(new Rr(e, n));
10390
+ this.wd().transaction((function(n) {
10391
+ return t(new Dr(e, n));
10439
10392
  }));
10440
10393
  }, t.prototype.batch = function() {
10441
- return this.Vd(), new Dr(this);
10394
+ return this.wd(), new Lr(this);
10442
10395
  }, Object.defineProperty(t, "logLevel", {
10443
10396
  get: function() {
10444
10397
  switch (_e()) {
@@ -10476,161 +10429,161 @@ var Tr = /** @class */ function() {
10476
10429
  },
10477
10430
  // Note: this is not a property because the minifier can't work correctly with
10478
10431
  // the way TypeScript compiler outputs properties.
10479
- t.prototype.Ud = function() {
10480
- return this.Sd.timestampsInSnapshots;
10432
+ t.prototype.Dd = function() {
10433
+ return this.Ad.timestampsInSnapshots;
10481
10434
  }, t;
10482
- }(), Rr = /** @class */ function() {
10435
+ }(), Dr = /** @class */ function() {
10483
10436
  function t(t, e) {
10484
- this.qd = t, this.Bd = e;
10437
+ this.Fd = t, this.Nd = e;
10485
10438
  }
10486
10439
  return t.prototype.get = function(t) {
10487
10440
  var e = this;
10488
10441
  tn("Transaction.get", arguments, 1);
10489
- var n = Fr("Transaction.get", t, this.qd);
10490
- return this.Bd.za([ n.Od ]).then((function(t) {
10491
- if (!t || 1 !== t.length) return Ve("Mismatch in docs returned from document lookup.");
10442
+ var n = jr("Transaction.get", t, this.Fd);
10443
+ return this.Nd.za([ n.Sd ]).then((function(t) {
10444
+ if (!t || 1 !== t.length) return Le("Mismatch in docs returned from document lookup.");
10492
10445
  var r = t[0];
10493
- if (r instanceof Rt) return new Or(e.qd, n.Od, null,
10446
+ if (r instanceof Rt) return new Or(e.Fd, n.Sd, null,
10494
10447
  /* fromCache= */ !1,
10495
- /* hasPendingWrites= */ !1, n.xd);
10496
- if (r instanceof St) return new Or(e.qd, n.Od, r,
10448
+ /* hasPendingWrites= */ !1, n.kd);
10449
+ if (r instanceof St) return new Or(e.Fd, n.Sd, r,
10497
10450
  /* fromCache= */ !1,
10498
- /* hasPendingWrites= */ !1, n.xd);
10499
- throw Ve("BatchGetDocumentsRequest returned unexpected document type: " + r.constructor.name);
10451
+ /* hasPendingWrites= */ !1, n.kd);
10452
+ throw Le("BatchGetDocumentsRequest returned unexpected document type: " + r.constructor.name);
10500
10453
  }));
10501
10454
  }, t.prototype.set = function(t, e, n) {
10502
10455
  nn("Transaction.set", arguments, 2, 3);
10503
- var r = Fr("Transaction.set", t, this.qd);
10504
- n = Pr("Transaction.set", n);
10505
- var i = Br(r.xd, e, "Transaction.set"), o = i[0], s = i[1], u = n.merge || n.mergeFields ? this.qd.Cd.zo(s, o, n.mergeFields) : this.qd.Cd.jo(s, o);
10506
- return this.Bd.set(r.Od, u), this;
10456
+ var r = jr("Transaction.set", t, this.Fd);
10457
+ n = Fr("Transaction.set", n);
10458
+ var i = Br(r.kd, e, "Transaction.set"), o = i[0], s = i[1], u = n.merge || n.mergeFields ? this.Fd.Pd.zo(s, o, n.mergeFields) : this.Fd.Pd.jo(s, o);
10459
+ return this.Nd.set(r.Sd, u), this;
10507
10460
  }, t.prototype.update = function(t, e, n) {
10508
10461
  for (var r, i, o = [], s = 3; s < arguments.length; s++) o[s - 3] = arguments[s];
10509
10462
  return "string" == typeof e || e instanceof Nn ? (en("Transaction.update", arguments, 3),
10510
- r = Fr("Transaction.update", t, this.qd), i = this.qd.Cd.Yo("Transaction.update", e, n, o)) : (tn("Transaction.update", arguments, 2),
10511
- r = Fr("Transaction.update", t, this.qd), i = this.qd.Cd.Ko("Transaction.update", e)),
10512
- this.Bd.update(r.Od, i), this;
10463
+ r = jr("Transaction.update", t, this.Fd), i = this.Fd.Pd.Yo("Transaction.update", e, n, o)) : (tn("Transaction.update", arguments, 2),
10464
+ r = jr("Transaction.update", t, this.Fd), i = this.Fd.Pd.Ko("Transaction.update", e)),
10465
+ this.Nd.update(r.Sd, i), this;
10513
10466
  }, t.prototype.delete = function(t) {
10514
10467
  tn("Transaction.delete", arguments, 1);
10515
- var e = Fr("Transaction.delete", t, this.qd);
10516
- return this.Bd.delete(e.Od), this;
10468
+ var e = jr("Transaction.delete", t, this.Fd);
10469
+ return this.Nd.delete(e.Sd), this;
10517
10470
  }, t;
10518
- }(), Dr = /** @class */ function() {
10471
+ }(), Lr = /** @class */ function() {
10519
10472
  function t(t) {
10520
- this.qd = t, this.Qd = [], this.Wd = !1;
10473
+ this.Fd = t, this.Ld = [], this.$d = !1;
10521
10474
  }
10522
10475
  return t.prototype.set = function(t, e, n) {
10523
- nn("WriteBatch.set", arguments, 2, 3), this.jd();
10524
- var r = Fr("WriteBatch.set", t, this.qd);
10525
- n = Pr("WriteBatch.set", n);
10526
- var i = Br(r.xd, e, "WriteBatch.set"), o = i[0], s = i[1], u = n.merge || n.mergeFields ? this.qd.Cd.zo(s, o, n.mergeFields) : this.qd.Cd.jo(s, o);
10527
- return this.Qd = this.Qd.concat(u.Lo(r.Od, gt.NONE)), this;
10476
+ nn("WriteBatch.set", arguments, 2, 3), this.Od();
10477
+ var r = jr("WriteBatch.set", t, this.Fd);
10478
+ n = Fr("WriteBatch.set", n);
10479
+ var i = Br(r.kd, e, "WriteBatch.set"), o = i[0], s = i[1], u = n.merge || n.mergeFields ? this.Fd.Pd.zo(s, o, n.mergeFields) : this.Fd.Pd.jo(s, o);
10480
+ return this.Ld = this.Ld.concat(u.Lo(r.Sd, gt.NONE)), this;
10528
10481
  }, t.prototype.update = function(t, e, n) {
10529
10482
  for (var r, i, o = [], s = 3; s < arguments.length; s++) o[s - 3] = arguments[s];
10530
- return this.jd(), "string" == typeof e || e instanceof Nn ? (en("WriteBatch.update", arguments, 3),
10531
- r = Fr("WriteBatch.update", t, this.qd), i = this.qd.Cd.Yo("WriteBatch.update", e, n, o)) : (tn("WriteBatch.update", arguments, 2),
10532
- r = Fr("WriteBatch.update", t, this.qd), i = this.qd.Cd.Ko("WriteBatch.update", e)),
10533
- this.Qd = this.Qd.concat(i.Lo(r.Od, gt.exists(!0))), this;
10483
+ return this.Od(), "string" == typeof e || e instanceof Nn ? (en("WriteBatch.update", arguments, 3),
10484
+ r = jr("WriteBatch.update", t, this.Fd), i = this.Fd.Pd.Yo("WriteBatch.update", e, n, o)) : (tn("WriteBatch.update", arguments, 2),
10485
+ r = jr("WriteBatch.update", t, this.Fd), i = this.Fd.Pd.Ko("WriteBatch.update", e)),
10486
+ this.Ld = this.Ld.concat(i.Lo(r.Sd, gt.exists(!0))), this;
10534
10487
  }, t.prototype.delete = function(t) {
10535
- tn("WriteBatch.delete", arguments, 1), this.jd();
10536
- var e = Fr("WriteBatch.delete", t, this.qd);
10537
- return this.Qd = this.Qd.concat(new Nt(e.Od, gt.NONE)), this;
10488
+ tn("WriteBatch.delete", arguments, 1), this.Od();
10489
+ var e = jr("WriteBatch.delete", t, this.Fd);
10490
+ return this.Ld = this.Ld.concat(new Nt(e.Sd, gt.NONE)), this;
10538
10491
  }, t.prototype.commit = function() {
10539
- return this.jd(), this.Wd = !0, this.Qd.length > 0 ? this.qd.Vd().write(this.Qd) : Promise.resolve();
10540
- }, t.prototype.jd = function() {
10541
- if (this.Wd) throw new A(b.FAILED_PRECONDITION, "A write batch can no longer be used after commit() has been called.");
10492
+ return this.Od(), this.$d = !0, this.Ld.length > 0 ? this.Fd.wd().write(this.Ld) : Promise.resolve();
10493
+ }, t.prototype.Od = function() {
10494
+ if (this.$d) throw new A(b.FAILED_PRECONDITION, "A write batch can no longer be used after commit() has been called.");
10542
10495
  }, t;
10543
10496
  }(), Vr = /** @class */ function() {
10544
10497
  function t(t, e, n) {
10545
- this.Od = t, this.firestore = e, this.xd = n, this.pd = this.firestore.Vd();
10498
+ this.Sd = t, this.firestore = e, this.kd = n, this.Td = this.firestore.wd();
10546
10499
  }
10547
- return t.Md = function(e, n, r) {
10500
+ return t.Cd = function(e, n, r) {
10548
10501
  if (e.length % 2 != 0) throw new A(b.INVALID_ARGUMENT, "Invalid document reference. Document references must have an even number of segments, but " + e.G() + " has " + e.length);
10549
- return new t(new U(e), n, r);
10502
+ return new t(new O(e), n, r);
10550
10503
  }, Object.defineProperty(t.prototype, "id", {
10551
10504
  get: function() {
10552
- return this.Od.path.U();
10505
+ return this.Sd.path.U();
10553
10506
  },
10554
10507
  enumerable: !0,
10555
10508
  configurable: !0
10556
10509
  }), Object.defineProperty(t.prototype, "parent", {
10557
10510
  get: function() {
10558
- return new Mr(this.Od.path.O(), this.firestore, this.xd);
10511
+ return new qr(this.Sd.path.O(), this.firestore, this.kd);
10559
10512
  },
10560
10513
  enumerable: !0,
10561
10514
  configurable: !0
10562
10515
  }), Object.defineProperty(t.prototype, "path", {
10563
10516
  get: function() {
10564
- return this.Od.path.G();
10517
+ return this.Sd.path.G();
10565
10518
  },
10566
10519
  enumerable: !0,
10567
10520
  configurable: !0
10568
10521
  }), t.prototype.collection = function(t) {
10569
10522
  if (tn("DocumentReference.collection", arguments, 1), rn("DocumentReference.collection", "non-empty string", 1, t),
10570
10523
  !t) throw new A(b.INVALID_ARGUMENT, "Must provide a non-empty collection name to collection()");
10571
- var e = V.K(t);
10572
- return new Mr(this.Od.path.child(e), this.firestore);
10524
+ var e = L.K(t);
10525
+ return new qr(this.Sd.path.child(e), this.firestore);
10573
10526
  }, t.prototype.isEqual = function(e) {
10574
10527
  if (!(e instanceof t)) throw dn("isEqual", "DocumentReference", 1, e);
10575
- return this.firestore === e.firestore && this.Od.isEqual(e.Od) && this.xd === e.xd;
10528
+ return this.firestore === e.firestore && this.Sd.isEqual(e.Sd) && this.kd === e.kd;
10576
10529
  }, t.prototype.set = function(t, e) {
10577
- nn("DocumentReference.set", arguments, 1, 2), e = Pr("DocumentReference.set", e);
10578
- var n = Br(this.xd, t, "DocumentReference.set"), r = n[0], i = n[1], o = e.merge || e.mergeFields ? this.firestore.Cd.zo(i, r, e.mergeFields) : this.firestore.Cd.jo(i, r);
10579
- return this.pd.write(o.Lo(this.Od, gt.NONE));
10530
+ nn("DocumentReference.set", arguments, 1, 2), e = Fr("DocumentReference.set", e);
10531
+ var n = Br(this.kd, t, "DocumentReference.set"), r = n[0], i = n[1], o = e.merge || e.mergeFields ? this.firestore.Pd.zo(i, r, e.mergeFields) : this.firestore.Pd.jo(i, r);
10532
+ return this.Td.write(o.Lo(this.Sd, gt.NONE));
10580
10533
  }, t.prototype.update = function(t, e) {
10581
10534
  for (var n, r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
10582
10535
  return "string" == typeof t || t instanceof Nn ? (en("DocumentReference.update", arguments, 2),
10583
- n = this.firestore.Cd.Yo("DocumentReference.update", t, e, r)) : (tn("DocumentReference.update", arguments, 1),
10584
- n = this.firestore.Cd.Ko("DocumentReference.update", t)), this.pd.write(n.Lo(this.Od, gt.exists(!0)));
10536
+ n = this.firestore.Pd.Yo("DocumentReference.update", t, e, r)) : (tn("DocumentReference.update", arguments, 1),
10537
+ n = this.firestore.Pd.Ko("DocumentReference.update", t)), this.Td.write(n.Lo(this.Sd, gt.exists(!0)));
10585
10538
  }, t.prototype.delete = function() {
10586
- return tn("DocumentReference.delete", arguments, 0), this.pd.write([ new Nt(this.Od, gt.NONE) ]);
10539
+ return tn("DocumentReference.delete", arguments, 0), this.Td.write([ new Nt(this.Sd, gt.NONE) ]);
10587
10540
  }, t.prototype.onSnapshot = function() {
10588
10541
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
10589
10542
  nn("DocumentReference.onSnapshot", arguments, 1, 4);
10590
10543
  var n, r = {
10591
10544
  includeMetadataChanges: !1
10592
10545
  }, i = 0;
10593
- "object" != typeof t[i] || Ir(t[i]) || (pn("DocumentReference.onSnapshot", r = t[i], [ "includeMetadataChanges" ]),
10546
+ "object" != typeof t[i] || Tr(t[i]) || (pn("DocumentReference.onSnapshot", r = t[i], [ "includeMetadataChanges" ]),
10594
10547
  un("DocumentReference.onSnapshot", "boolean", "includeMetadataChanges", r.includeMetadataChanges),
10595
10548
  i++);
10596
10549
  var o = {
10597
10550
  includeMetadataChanges: r.includeMetadataChanges
10598
10551
  };
10599
- return Ir(t[i]) ? n = t[i] : (rn("DocumentReference.onSnapshot", "function", i, t[i]),
10552
+ return Tr(t[i]) ? n = t[i] : (rn("DocumentReference.onSnapshot", "function", i, t[i]),
10600
10553
  on("DocumentReference.onSnapshot", "function", i + 1, t[i + 1]), on("DocumentReference.onSnapshot", "function", i + 2, t[i + 2]),
10601
10554
  n = {
10602
10555
  next: t[i],
10603
10556
  error: t[i + 1],
10604
10557
  complete: t[i + 2]
10605
- }), this.Gd(o, n);
10606
- }, t.prototype.Gd = function(t, e) {
10558
+ }), this.Md(o, n);
10559
+ }, t.prototype.Md = function(t, e) {
10607
10560
  var n = this, r = function(t) {
10608
10561
  console.error("Uncaught Error in onSnapshot:", t);
10609
10562
  };
10610
10563
  e.error && (r = e.error.bind(e));
10611
- var i = new Nr({
10564
+ var i = new Ir({
10612
10565
  next: function(t) {
10613
10566
  if (e.next) {
10614
- var r = t.docs.get(n.Od);
10615
- e.next(new Or(n.firestore, n.Od, r, t.fromCache, t.hasPendingWrites, n.xd));
10567
+ var r = t.docs.get(n.Sd);
10568
+ e.next(new Or(n.firestore, n.Sd, r, t.fromCache, t.hasPendingWrites, n.kd));
10616
10569
  }
10617
10570
  },
10618
10571
  error: r
10619
- }), o = this.pd.listen(Lt.ve(this.Od.path), i, t);
10572
+ }), o = this.Td.listen(Vt.ve(this.Sd.path), i, t);
10620
10573
  return function() {
10621
- i._d(), n.pd.$u(o);
10574
+ i.sd(), n.Td.$u(o);
10622
10575
  };
10623
10576
  }, t.prototype.get = function(t) {
10624
10577
  var e = this;
10625
- return nn("DocumentReference.get", arguments, 0, 1), Gr("DocumentReference.get", t),
10578
+ return nn("DocumentReference.get", arguments, 0, 1), xr("DocumentReference.get", t),
10626
10579
  new Promise((function(n, r) {
10627
- t && "cache" === t.source ? e.firestore.Vd().ad(e.Od).then((function(t) {
10628
- n(new Or(e.firestore, e.Od, t,
10629
- /*fromCache=*/ !0, t instanceof St && t.te, e.xd));
10630
- }), r) : e.zd(n, r, t);
10580
+ t && "cache" === t.source ? e.firestore.wd().Z_(e.Sd).then((function(t) {
10581
+ n(new Or(e.firestore, e.Sd, t,
10582
+ /*fromCache=*/ !0, t instanceof St && t.te, e.kd));
10583
+ }), r) : e.Ud(n, r, t);
10631
10584
  }));
10632
- }, t.prototype.zd = function(t, e, n) {
10633
- var r = this.Gd({
10585
+ }, t.prototype.Ud = function(t, e, n) {
10586
+ var r = this.Md({
10634
10587
  includeMetadataChanges: !0,
10635
10588
  ql: !0
10636
10589
  }, {
@@ -10650,9 +10603,9 @@ var Tr = /** @class */ function() {
10650
10603
  error: e
10651
10604
  });
10652
10605
  }, t.prototype.withConverter = function(e) {
10653
- return new t(this.Od, this.firestore, e);
10606
+ return new t(this.Sd, this.firestore, e);
10654
10607
  }, t;
10655
- }(), Lr = /** @class */ function() {
10608
+ }(), Ur = /** @class */ function() {
10656
10609
  function t(t, e) {
10657
10610
  this.hasPendingWrites = t, this.fromCache = e;
10658
10611
  }
@@ -10661,64 +10614,64 @@ var Tr = /** @class */ function() {
10661
10614
  }, t;
10662
10615
  }(), Or = /** @class */ function() {
10663
10616
  function t(t, e, n, r, i, o) {
10664
- this.qd = t, this.Od = e, this.Kd = n, this.Hd = r, this.Jd = i, this.xd = o;
10617
+ this.Fd = t, this.Sd = e, this.qd = n, this.Bd = r, this.xd = i, this.kd = o;
10665
10618
  }
10666
10619
  return t.prototype.data = function(t) {
10667
- if (nn("DocumentSnapshot.data", arguments, 0, 1), t = xr("DocumentSnapshot.data", t),
10668
- this.Kd) {
10620
+ if (nn("DocumentSnapshot.data", arguments, 0, 1), t = Gr("DocumentSnapshot.data", t),
10621
+ this.qd) {
10669
10622
  // We only want to use the converter and create a new DocumentSnapshot
10670
10623
  // if a converter has been provided.
10671
- if (this.xd) {
10672
- var e = new Ur(this.qd, this.Od, this.Kd, this.Hd, this.Jd);
10673
- return this.xd.fromFirestore(e, t);
10624
+ if (this.kd) {
10625
+ var e = new Cr(this.Fd, this.Sd, this.qd, this.Bd, this.xd);
10626
+ return this.kd.fromFirestore(e, t);
10674
10627
  }
10675
- return new Tr(this.qd, this.qd.Ud(), t.serverTimestamps,
10676
- /* converter= */ void 0).fd(this.Kd.Re());
10628
+ return new _r(this.Fd, this.Fd.Dd(), t.serverTimestamps,
10629
+ /* converter= */ void 0).rd(this.qd.Re());
10677
10630
  }
10678
10631
  }, t.prototype.get = function(t, e) {
10679
- if (nn("DocumentSnapshot.get", arguments, 1, 2), e = xr("DocumentSnapshot.get", e),
10680
- this.Kd) {
10681
- var n = this.Kd.data().field(jn("DocumentSnapshot.get", t));
10682
- if (null !== n) return new Tr(this.qd, this.qd.Ud(), e.serverTimestamps, this.xd).fd(n);
10632
+ if (nn("DocumentSnapshot.get", arguments, 1, 2), e = Gr("DocumentSnapshot.get", e),
10633
+ this.qd) {
10634
+ var n = this.qd.data().field(jn("DocumentSnapshot.get", t));
10635
+ if (null !== n) return new _r(this.Fd, this.Fd.Dd(), e.serverTimestamps, this.kd).rd(n);
10683
10636
  }
10684
10637
  }, Object.defineProperty(t.prototype, "id", {
10685
10638
  get: function() {
10686
- return this.Od.path.U();
10639
+ return this.Sd.path.U();
10687
10640
  },
10688
10641
  enumerable: !0,
10689
10642
  configurable: !0
10690
10643
  }), Object.defineProperty(t.prototype, "ref", {
10691
10644
  get: function() {
10692
- return new Vr(this.Od, this.qd, this.xd);
10645
+ return new Vr(this.Sd, this.Fd, this.kd);
10693
10646
  },
10694
10647
  enumerable: !0,
10695
10648
  configurable: !0
10696
10649
  }), Object.defineProperty(t.prototype, "exists", {
10697
10650
  get: function() {
10698
- return null !== this.Kd;
10651
+ return null !== this.qd;
10699
10652
  },
10700
10653
  enumerable: !0,
10701
10654
  configurable: !0
10702
10655
  }), Object.defineProperty(t.prototype, "metadata", {
10703
10656
  get: function() {
10704
- return new Lr(this.Jd, this.Hd);
10657
+ return new Ur(this.xd, this.Bd);
10705
10658
  },
10706
10659
  enumerable: !0,
10707
10660
  configurable: !0
10708
10661
  }), t.prototype.isEqual = function(e) {
10709
10662
  if (!(e instanceof t)) throw dn("isEqual", "DocumentSnapshot", 1, e);
10710
- return this.qd === e.qd && this.Hd === e.Hd && this.Od.isEqual(e.Od) && (null === this.Kd ? null === e.Kd : this.Kd.isEqual(e.Kd)) && this.xd === e.xd;
10663
+ return this.Fd === e.Fd && this.Bd === e.Bd && this.Sd.isEqual(e.Sd) && (null === this.qd ? null === e.qd : this.qd.isEqual(e.qd)) && this.kd === e.kd;
10711
10664
  }, t;
10712
- }(), Ur = /** @class */ function(e) {
10665
+ }(), Cr = /** @class */ function(e) {
10713
10666
  function n() {
10714
10667
  return null !== e && e.apply(this, arguments) || this;
10715
10668
  }
10716
10669
  return t(n, e), n.prototype.data = function(t) {
10717
10670
  return e.prototype.data.call(this, t);
10718
10671
  }, n;
10719
- }(Or), Cr = /** @class */ function() {
10672
+ }(Or), Pr = /** @class */ function() {
10720
10673
  function t(t, e, n) {
10721
- this.Yd = t, this.firestore = e, this.xd = n;
10674
+ this.Qd = t, this.firestore = e, this.kd = n;
10722
10675
  }
10723
10676
  return t.prototype.where = function(e, n, r) {
10724
10677
  var i;
@@ -10727,26 +10680,26 @@ var Tr = /** @class */ function() {
10727
10680
  return t === r;
10728
10681
  }))) throw new A(b.INVALID_ARGUMENT, "Invalid value " + fn(r) + " provided to function Query.where() for its " + vn(2) + " argument. Acceptable values: " + e.join(", "));
10729
10682
  }(0, [ "<", "<=", "==", ">=", ">", "array-contains", "in", "array-contains-any" ], 0, n);
10730
- var o = jn("Query.where", e), s = Ot.K(n);
10683
+ var o = jn("Query.where", e), s = Ut.K(n);
10731
10684
  if (o.Y()) {
10732
- if (s === Ot.ARRAY_CONTAINS || s === Ot.ARRAY_CONTAINS_ANY) throw new A(b.INVALID_ARGUMENT, "Invalid Query. You can't perform '" + s.toString() + "' queries on FieldPath.documentId().");
10733
- if (s === Ot.IN) {
10734
- this.Xd(r, s);
10685
+ if (s === Ut.ARRAY_CONTAINS || s === Ut.ARRAY_CONTAINS_ANY) throw new A(b.INVALID_ARGUMENT, "Invalid Query. You can't perform '" + s.toString() + "' queries on FieldPath.documentId().");
10686
+ if (s === Ut.IN) {
10687
+ this.Wd(r, s);
10735
10688
  for (var u = [], a = 0, h = r; a < h.length; a++) {
10736
10689
  var c = h[a];
10737
- u.push(this.Zd(c));
10690
+ u.push(this.jd(c));
10738
10691
  }
10739
10692
  i = {
10740
10693
  arrayValue: {
10741
10694
  values: u
10742
10695
  }
10743
10696
  };
10744
- } else i = this.Zd(r);
10745
- } else s !== Ot.IN && s !== Ot.ARRAY_CONTAINS_ANY || this.Xd(r, s), i = this.firestore.Cd.Xo("Query.where", r,
10697
+ } else i = this.jd(r);
10698
+ } else s !== Ut.IN && s !== Ut.ARRAY_CONTAINS_ANY || this.Wd(r, s), i = this.firestore.Pd.Xo("Query.where", r,
10746
10699
  // We only allow nested arrays for IN queries.
10747
- /** allowArrays = */ s === Ot.IN);
10748
- var f = Ut.create(o, s, i);
10749
- return this.tf(f), new t(this.Yd.De(f), this.firestore, this.xd);
10700
+ /** allowArrays = */ s === Ut.IN);
10701
+ var f = Ot.create(o, s, i);
10702
+ return this.Gd(f), new t(this.Qd.De(f), this.firestore, this.kd);
10750
10703
  }, t.prototype.orderBy = function(e, n) {
10751
10704
  var r;
10752
10705
  if (nn("Query.orderBy", arguments, 1, 2), on("Query.orderBy", "non-empty string", 2, n),
@@ -10754,55 +10707,55 @@ var Tr = /** @class */ function() {
10754
10707
  if ("desc" !== n) throw new A(b.INVALID_ARGUMENT, "Function Query.orderBy() has unknown direction '" + n + "', expected 'asc' or 'desc'.");
10755
10708
  r = Gt.DESCENDING;
10756
10709
  }
10757
- if (null !== this.Yd.startAt) throw new A(b.INVALID_ARGUMENT, "Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().");
10758
- if (null !== this.Yd.endAt) throw new A(b.INVALID_ARGUMENT, "Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().");
10759
- var i = jn("Query.orderBy", e), o = new zt(i, r);
10760
- return this.ef(o), new t(this.Yd.Fe(o), this.firestore, this.xd);
10710
+ if (null !== this.Qd.startAt) throw new A(b.INVALID_ARGUMENT, "Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().");
10711
+ if (null !== this.Qd.endAt) throw new A(b.INVALID_ARGUMENT, "Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().");
10712
+ var i = jn("Query.orderBy", e), o = new Bt(i, r);
10713
+ return this.zd(o), new t(this.Qd.Fe(o), this.firestore, this.kd);
10761
10714
  }, t.prototype.limit = function(e) {
10762
10715
  return tn("Query.limit", arguments, 1), rn("Query.limit", "number", 1, e), yn("Query.limit", 1, e),
10763
- new t(this.Yd.Ne(e), this.firestore, this.xd);
10716
+ new t(this.Qd.Ne(e), this.firestore, this.kd);
10764
10717
  }, t.prototype.limitToLast = function(e) {
10765
10718
  return tn("Query.limitToLast", arguments, 1), rn("Query.limitToLast", "number", 1, e),
10766
- yn("Query.limitToLast", 1, e), new t(this.Yd.ke(e), this.firestore, this.xd);
10719
+ yn("Query.limitToLast", 1, e), new t(this.Qd.ke(e), this.firestore, this.kd);
10767
10720
  }, t.prototype.startAt = function(e) {
10768
10721
  for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];
10769
10722
  en("Query.startAt", arguments, 1);
10770
- var i = this.sf("Query.startAt", e, n,
10723
+ var i = this.Kd("Query.startAt", e, n,
10771
10724
  /*before=*/ !0);
10772
- return new t(this.Yd.Le(i), this.firestore, this.xd);
10725
+ return new t(this.Qd.Le(i), this.firestore, this.kd);
10773
10726
  }, t.prototype.startAfter = function(e) {
10774
10727
  for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];
10775
10728
  en("Query.startAfter", arguments, 1);
10776
- var i = this.sf("Query.startAfter", e, n,
10729
+ var i = this.Kd("Query.startAfter", e, n,
10777
10730
  /*before=*/ !1);
10778
- return new t(this.Yd.Le(i), this.firestore, this.xd);
10731
+ return new t(this.Qd.Le(i), this.firestore, this.kd);
10779
10732
  }, t.prototype.endBefore = function(e) {
10780
10733
  for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];
10781
10734
  en("Query.endBefore", arguments, 1);
10782
- var i = this.sf("Query.endBefore", e, n,
10735
+ var i = this.Kd("Query.endBefore", e, n,
10783
10736
  /*before=*/ !0);
10784
- return new t(this.Yd.$e(i), this.firestore, this.xd);
10737
+ return new t(this.Qd.$e(i), this.firestore, this.kd);
10785
10738
  }, t.prototype.endAt = function(e) {
10786
10739
  for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];
10787
10740
  en("Query.endAt", arguments, 1);
10788
- var i = this.sf("Query.endAt", e, n,
10741
+ var i = this.Kd("Query.endAt", e, n,
10789
10742
  /*before=*/ !1);
10790
- return new t(this.Yd.$e(i), this.firestore, this.xd);
10743
+ return new t(this.Qd.$e(i), this.firestore, this.kd);
10791
10744
  }, t.prototype.isEqual = function(e) {
10792
10745
  if (!(e instanceof t)) throw dn("isEqual", "Query", 1, e);
10793
- return this.firestore === e.firestore && this.Yd.isEqual(e.Yd);
10746
+ return this.firestore === e.firestore && this.Qd.isEqual(e.Qd);
10794
10747
  }, t.prototype.withConverter = function(e) {
10795
- return new t(this.Yd, this.firestore, e);
10748
+ return new t(this.Qd, this.firestore, e);
10796
10749
  },
10797
- /** Helper function to create a bound from a document or fields */ t.prototype.sf = function(t, e, n, r) {
10750
+ /** Helper function to create a bound from a document or fields */ t.prototype.Kd = function(t, e, n, r) {
10798
10751
  if (ln(t, 1, e), e instanceof Or) {
10799
10752
  if (n.length > 0) throw new A(b.INVALID_ARGUMENT, "Too many arguments provided to " + t + "().");
10800
10753
  var i = e;
10801
10754
  if (!i.exists) throw new A(b.NOT_FOUND, "Can't use a DocumentSnapshot that doesn't exist for " + t + "().");
10802
- return this.if(i.Kd, r);
10755
+ return this.Hd(i.qd, r);
10803
10756
  }
10804
10757
  var o = [ e ].concat(n);
10805
- return this.nf(t, o, r);
10758
+ return this.Jd(t, o, r);
10806
10759
  },
10807
10760
  /**
10808
10761
  * Create a Bound from a query and a document.
@@ -10815,7 +10768,7 @@ var Tr = /** @class */ function() {
10815
10768
  * of the query or if any of the fields in the order by are an uncommitted
10816
10769
  * server timestamp.
10817
10770
  */
10818
- t.prototype.if = function(t, e) {
10771
+ t.prototype.Hd = function(t, e) {
10819
10772
  // Because people expect to continue/end a query at the exact document
10820
10773
  // provided, we need to use the implicit sort order rather than the explicit
10821
10774
  // sort order, because it's guaranteed to contain the document key. That way
@@ -10823,9 +10776,9 @@ var Tr = /** @class */ function() {
10823
10776
  // the provided document. Without the key (by using the explicit sort
10824
10777
  // orders), multiple documents could match the position, yielding duplicate
10825
10778
  // results.
10826
- for (var n = [], r = 0, i = this.Yd.orderBy; r < i.length; r++) {
10779
+ for (var n = [], r = 0, i = this.Qd.orderBy; r < i.length; r++) {
10827
10780
  var o = i[r];
10828
- if (o.field.Y()) n.push(it(this.firestore.Id, t.key)); else {
10781
+ if (o.field.Y()) n.push(it(this.firestore._d, t.key)); else {
10829
10782
  var s = t.field(o.field);
10830
10783
  if (H(s)) throw new A(b.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field "' + o.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
10831
10784
  if (null === s) {
@@ -10835,67 +10788,67 @@ var Tr = /** @class */ function() {
10835
10788
  n.push(s);
10836
10789
  }
10837
10790
  }
10838
- return new Bt(n, e);
10791
+ return new Qt(n, e);
10839
10792
  },
10840
10793
  /**
10841
10794
  * Converts a list of field values to a Bound for the given query.
10842
10795
  */
10843
- t.prototype.nf = function(t, e, n) {
10796
+ t.prototype.Jd = function(t, e, n) {
10844
10797
  // Use explicit order by's because it has to match the query the user made
10845
- var r = this.Yd.Ve;
10798
+ var r = this.Qd.Ve;
10846
10799
  if (e.length > r.length) throw new A(b.INVALID_ARGUMENT, "Too many arguments provided to " + t + "(). The number of arguments must be less than or equal to the number of Query.orderBy() clauses");
10847
10800
  for (var i = [], o = 0; o < e.length; o++) {
10848
10801
  var s = e[o];
10849
10802
  if (r[o].field.Y()) {
10850
10803
  if ("string" != typeof s) throw new A(b.INVALID_ARGUMENT, "Invalid query. Expected a string for document ID in " + t + "(), but got a " + typeof s);
10851
- if (!this.Yd.He() && -1 !== s.indexOf("/")) throw new A(b.INVALID_ARGUMENT, "Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to " + t + "() must be a plain document ID, but '" + s + "' contains a slash.");
10852
- var u = this.Yd.path.child(V.K(s));
10853
- if (!U.st(u)) throw new A(b.INVALID_ARGUMENT, "Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to " + t + "() must result in a valid document path, but '" + u + "' is not because it contains an odd number of segments.");
10854
- var a = new U(u);
10855
- i.push(it(this.firestore.Id, a));
10804
+ if (!this.Qd.He() && -1 !== s.indexOf("/")) throw new A(b.INVALID_ARGUMENT, "Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to " + t + "() must be a plain document ID, but '" + s + "' contains a slash.");
10805
+ var u = this.Qd.path.child(L.K(s));
10806
+ if (!O.st(u)) throw new A(b.INVALID_ARGUMENT, "Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to " + t + "() must result in a valid document path, but '" + u + "' is not because it contains an odd number of segments.");
10807
+ var a = new O(u);
10808
+ i.push(it(this.firestore._d, a));
10856
10809
  } else {
10857
- var h = this.firestore.Cd.Xo(t, s);
10810
+ var h = this.firestore.Pd.Xo(t, s);
10858
10811
  i.push(h);
10859
10812
  }
10860
10813
  }
10861
- return new Bt(i, n);
10814
+ return new Qt(i, n);
10862
10815
  }, t.prototype.onSnapshot = function() {
10863
10816
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
10864
10817
  nn("Query.onSnapshot", arguments, 1, 4);
10865
10818
  var n, r = {}, i = 0;
10866
- return "object" != typeof t[i] || Ir(t[i]) || (pn("Query.onSnapshot", r = t[i], [ "includeMetadataChanges" ]),
10819
+ return "object" != typeof t[i] || Tr(t[i]) || (pn("Query.onSnapshot", r = t[i], [ "includeMetadataChanges" ]),
10867
10820
  un("Query.onSnapshot", "boolean", "includeMetadataChanges", r.includeMetadataChanges),
10868
- i++), Ir(t[i]) ? n = t[i] : (rn("Query.onSnapshot", "function", i, t[i]), on("Query.onSnapshot", "function", i + 1, t[i + 1]),
10821
+ i++), Tr(t[i]) ? n = t[i] : (rn("Query.onSnapshot", "function", i, t[i]), on("Query.onSnapshot", "function", i + 1, t[i + 1]),
10869
10822
  on("Query.onSnapshot", "function", i + 2, t[i + 2]), n = {
10870
10823
  next: t[i],
10871
10824
  error: t[i + 1],
10872
10825
  complete: t[i + 2]
10873
- }), this.rf(this.Yd), this.Gd(r, n);
10874
- }, t.prototype.Gd = function(t, e) {
10826
+ }), this.Yd(this.Qd), this.Md(r, n);
10827
+ }, t.prototype.Md = function(t, e) {
10875
10828
  var n = this, r = function(t) {
10876
10829
  console.error("Uncaught Error in onSnapshot:", t);
10877
10830
  };
10878
10831
  e.error && (r = e.error.bind(e));
10879
- var i = new Nr({
10832
+ var i = new Ir({
10880
10833
  next: function(t) {
10881
- e.next && e.next(new qr(n.firestore, n.Yd, t, n.xd));
10834
+ e.next && e.next(new Mr(n.firestore, n.Qd, t, n.kd));
10882
10835
  },
10883
10836
  error: r
10884
- }), o = this.firestore.Vd(), s = o.listen(this.Yd, i, t);
10837
+ }), o = this.firestore.wd(), s = o.listen(this.Qd, i, t);
10885
10838
  return function() {
10886
- i._d(), o.$u(s);
10839
+ i.sd(), o.$u(s);
10887
10840
  };
10888
- }, t.prototype.rf = function(t) {
10841
+ }, t.prototype.Yd = function(t) {
10889
10842
  if (t.Ge() && 0 === t.Ve.length) throw new A(b.UNIMPLEMENTED, "limitToLast() queries require specifying at least one orderBy() clause");
10890
10843
  }, t.prototype.get = function(t) {
10891
10844
  var e = this;
10892
- return nn("Query.get", arguments, 0, 1), Gr("Query.get", t), this.rf(this.Yd), new Promise((function(n, r) {
10893
- t && "cache" === t.source ? e.firestore.Vd().ud(e.Yd).then((function(t) {
10894
- n(new qr(e.firestore, e.Yd, t, e.xd));
10895
- }), r) : e.zd(n, r, t);
10845
+ return nn("Query.get", arguments, 0, 1), xr("Query.get", t), this.Yd(this.Qd), new Promise((function(n, r) {
10846
+ t && "cache" === t.source ? e.firestore.wd().td(e.Qd).then((function(t) {
10847
+ n(new Mr(e.firestore, e.Qd, t, e.kd));
10848
+ }), r) : e.Ud(n, r, t);
10896
10849
  }));
10897
- }, t.prototype.zd = function(t, e, n) {
10898
- var r = this.Gd({
10850
+ }, t.prototype.Ud = function(t, e, n) {
10851
+ var r = this.Md({
10899
10852
  includeMetadataChanges: !0,
10900
10853
  ql: !0
10901
10854
  }, {
@@ -10912,17 +10865,17 @@ var Tr = /** @class */ function() {
10912
10865
  * appropriate errors if the value is anything other than a DocumentReference
10913
10866
  * or String, or if the string is malformed.
10914
10867
  */
10915
- t.prototype.Zd = function(t) {
10868
+ t.prototype.jd = function(t) {
10916
10869
  if ("string" == typeof t) {
10917
10870
  if ("" === t) throw new A(b.INVALID_ARGUMENT, "Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");
10918
- if (!this.Yd.He() && -1 !== t.indexOf("/")) throw new A(b.INVALID_ARGUMENT, "Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '" + t + "' contains a '/' character.");
10919
- var e = this.Yd.path.child(V.K(t));
10920
- if (!U.st(e)) throw new A(b.INVALID_ARGUMENT, "Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '" + e + "' is not because it has an odd number of segments (" + e.length + ").");
10921
- return it(this.firestore.Id, new U(e));
10871
+ if (!this.Qd.He() && -1 !== t.indexOf("/")) throw new A(b.INVALID_ARGUMENT, "Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '" + t + "' contains a '/' character.");
10872
+ var e = this.Qd.path.child(L.K(t));
10873
+ if (!O.st(e)) throw new A(b.INVALID_ARGUMENT, "Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '" + e + "' is not because it has an odd number of segments (" + e.length + ").");
10874
+ return it(this.firestore._d, new O(e));
10922
10875
  }
10923
10876
  if (t instanceof Vr) {
10924
10877
  var n = t;
10925
- return it(this.firestore.Id, n.Od);
10878
+ return it(this.firestore._d, n.Sd);
10926
10879
  }
10927
10880
  throw new A(b.INVALID_ARGUMENT, "Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: " + fn(t) + ".");
10928
10881
  },
@@ -10930,43 +10883,43 @@ var Tr = /** @class */ function() {
10930
10883
  * Validates that the value passed into a disjunctrive filter satisfies all
10931
10884
  * array requirements.
10932
10885
  */
10933
- t.prototype.Xd = function(t, e) {
10886
+ t.prototype.Wd = function(t, e) {
10934
10887
  if (!Array.isArray(t) || 0 === t.length) throw new A(b.INVALID_ARGUMENT, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
10935
10888
  if (t.length > 10) throw new A(b.INVALID_ARGUMENT, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
10936
10889
  if (t.indexOf(null) >= 0) throw new A(b.INVALID_ARGUMENT, "Invalid Query. '" + e.toString() + "' filters cannot contain 'null' in the value array.");
10937
10890
  if (t.filter((function(t) {
10938
10891
  return Number.isNaN(t);
10939
10892
  })).length > 0) throw new A(b.INVALID_ARGUMENT, "Invalid Query. '" + e.toString() + "' filters cannot contain 'NaN' in the value array.");
10940
- }, t.prototype.tf = function(t) {
10941
- if (t instanceof Ut) {
10942
- var e = [ Ot.ARRAY_CONTAINS, Ot.ARRAY_CONTAINS_ANY ], n = [ Ot.IN, Ot.ARRAY_CONTAINS_ANY ], r = e.indexOf(t.op) >= 0, i = n.indexOf(t.op) >= 0;
10893
+ }, t.prototype.Gd = function(t) {
10894
+ if (t instanceof Ot) {
10895
+ var e = [ Ut.ARRAY_CONTAINS, Ut.ARRAY_CONTAINS_ANY ], n = [ Ut.IN, Ut.ARRAY_CONTAINS_ANY ], r = e.indexOf(t.op) >= 0, i = n.indexOf(t.op) >= 0;
10943
10896
  if (t.ze()) {
10944
- var o = this.Yd.Se();
10897
+ var o = this.Qd.Se();
10945
10898
  if (null !== o && !o.isEqual(t.field)) throw new A(b.INVALID_ARGUMENT, "Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '" + o.toString() + "' and '" + t.field.toString() + "'");
10946
- var s = this.Yd.Ce();
10947
- null !== s && this.hf(t.field, s);
10899
+ var s = this.Qd.Ce();
10900
+ null !== s && this.Xd(t.field, s);
10948
10901
  } else if (i || r) {
10949
10902
  // You can have at most 1 disjunctive filter and 1 array filter. Check if
10950
10903
  // the new filter conflicts with an existing one.
10951
10904
  var u = null;
10952
- if (i && (u = this.Yd.Ke(n)), null === u && r && (u = this.Yd.Ke(e)), null != u)
10905
+ if (i && (u = this.Qd.Ke(n)), null === u && r && (u = this.Qd.Ke(e)), null != u)
10953
10906
  // We special case when it's a duplicate op to give a slightly clearer error message.
10954
10907
  throw u === t.op ? new A(b.INVALID_ARGUMENT, "Invalid query. You cannot use more than one '" + t.op.toString() + "' filter.") : new A(b.INVALID_ARGUMENT, "Invalid query. You cannot use '" + t.op.toString() + "' filters with '" + u.toString() + "' filters.");
10955
10908
  }
10956
10909
  }
10957
- }, t.prototype.ef = function(t) {
10958
- if (null === this.Yd.Ce()) {
10910
+ }, t.prototype.zd = function(t) {
10911
+ if (null === this.Qd.Ce()) {
10959
10912
  // This is the first order by. It must match any inequality.
10960
- var e = this.Yd.Se();
10961
- null !== e && this.hf(e, t.field);
10913
+ var e = this.Qd.Se();
10914
+ null !== e && this.Xd(e, t.field);
10962
10915
  }
10963
- }, t.prototype.hf = function(t, e) {
10916
+ }, t.prototype.Xd = function(t, e) {
10964
10917
  if (!e.isEqual(t)) throw new A(b.INVALID_ARGUMENT, "Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '" + t.toString() + "' and so you must also use '" + t.toString() + "' as your first Query.orderBy(), but your first Query.orderBy() is on field '" + e.toString() + "' instead.");
10965
10918
  }, t;
10966
- }(), qr = /** @class */ function() {
10919
+ }(), Mr = /** @class */ function() {
10967
10920
  function t(t, e, n, r) {
10968
- this.qd = t, this.af = e, this.uf = n, this.xd = r, this.cf = null, this.lf = null,
10969
- this.metadata = new Lr(n.hasPendingWrites, n.fromCache);
10921
+ this.Fd = t, this.Zd = e, this.tf = n, this.kd = r, this.ef = null, this.sf = null,
10922
+ this.metadata = new Ur(n.hasPendingWrites, n.fromCache);
10970
10923
  }
10971
10924
  return Object.defineProperty(t.prototype, "docs", {
10972
10925
  get: function() {
@@ -10979,33 +10932,33 @@ var Tr = /** @class */ function() {
10979
10932
  configurable: !0
10980
10933
  }), Object.defineProperty(t.prototype, "empty", {
10981
10934
  get: function() {
10982
- return this.uf.docs.q();
10935
+ return this.tf.docs.q();
10983
10936
  },
10984
10937
  enumerable: !0,
10985
10938
  configurable: !0
10986
10939
  }), Object.defineProperty(t.prototype, "size", {
10987
10940
  get: function() {
10988
- return this.uf.docs.size;
10941
+ return this.tf.docs.size;
10989
10942
  },
10990
10943
  enumerable: !0,
10991
10944
  configurable: !0
10992
10945
  }), t.prototype.forEach = function(t, e) {
10993
10946
  var n = this;
10994
10947
  nn("QuerySnapshot.forEach", arguments, 1, 2), rn("QuerySnapshot.forEach", "function", 1, t),
10995
- this.uf.docs.forEach((function(r) {
10996
- t.call(e, n._f(r));
10948
+ this.tf.docs.forEach((function(r) {
10949
+ t.call(e, n.if(r));
10997
10950
  }));
10998
10951
  }, Object.defineProperty(t.prototype, "query", {
10999
10952
  get: function() {
11000
- return new Cr(this.af, this.qd, this.xd);
10953
+ return new Pr(this.Zd, this.Fd, this.kd);
11001
10954
  },
11002
10955
  enumerable: !0,
11003
10956
  configurable: !0
11004
10957
  }), t.prototype.docChanges = function(t) {
11005
10958
  t && (pn("QuerySnapshot.docChanges", t, [ "includeMetadataChanges" ]), un("QuerySnapshot.docChanges", "boolean", "includeMetadataChanges", t.includeMetadataChanges));
11006
10959
  var e = !(!t || !t.includeMetadataChanges);
11007
- if (e && this.uf.ds) throw new A(b.INVALID_ARGUMENT, "To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");
11008
- return this.cf && this.lf === e || (this.cf =
10960
+ if (e && this.tf.ds) throw new A(b.INVALID_ARGUMENT, "To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");
10961
+ return this.ef && this.sf === e || (this.ef =
11009
10962
  /**
11010
10963
  * Calculates the array of firestore.DocumentChange's for a given ViewSnapshot.
11011
10964
  *
@@ -11017,7 +10970,7 @@ var Tr = /** @class */ function() {
11017
10970
  // fast
11018
10971
  var i = 0;
11019
10972
  return n.docChanges.map((function(e) {
11020
- var o = new Ur(t, e.doc.key, e.doc, n.fromCache, n.ls.has(e.doc.key), r);
10973
+ var o = new Cr(t, e.doc.key, e.doc, n.fromCache, n.ls.has(e.doc.key), r);
11021
10974
  return e.doc, {
11022
10975
  type: "added",
11023
10976
  doc: o,
@@ -11032,45 +10985,45 @@ var Tr = /** @class */ function() {
11032
10985
  return n.docChanges.filter((function(t) {
11033
10986
  return e || 3 /* Metadata */ !== t.type;
11034
10987
  })).map((function(e) {
11035
- var i = new Ur(t, e.doc.key, e.doc, n.fromCache, n.ls.has(e.doc.key), r), s = -1, u = -1;
10988
+ var i = new Cr(t, e.doc.key, e.doc, n.fromCache, n.ls.has(e.doc.key), r), s = -1, u = -1;
11036
10989
  return 0 /* Added */ !== e.type && (s = o.indexOf(e.doc.key), o = o.delete(e.doc.key)),
11037
10990
  1 /* Removed */ !== e.type && (u = (o = o.add(e.doc)).indexOf(e.doc.key)), {
11038
- type: jr(e.type),
10991
+ type: Qr(e.type),
11039
10992
  doc: i,
11040
10993
  oldIndex: s,
11041
10994
  newIndex: u
11042
10995
  };
11043
10996
  }));
11044
- }(this.qd, e, this.uf, this.xd), this.lf = e), this.cf;
10997
+ }(this.Fd, e, this.tf, this.kd), this.sf = e), this.ef;
11045
10998
  },
11046
10999
  /** Check the equality. The call can be very expensive. */ t.prototype.isEqual = function(e) {
11047
11000
  if (!(e instanceof t)) throw dn("isEqual", "QuerySnapshot", 1, e);
11048
- return this.qd === e.qd && this.af.isEqual(e.af) && this.uf.isEqual(e.uf) && this.xd === e.xd;
11049
- }, t.prototype._f = function(t) {
11050
- return new Ur(this.qd, t.key, t, this.metadata.fromCache, this.uf.ls.has(t.key), this.xd);
11001
+ return this.Fd === e.Fd && this.Zd.isEqual(e.Zd) && this.tf.isEqual(e.tf) && this.kd === e.kd;
11002
+ }, t.prototype.if = function(t) {
11003
+ return new Cr(this.Fd, t.key, t, this.metadata.fromCache, this.tf.ls.has(t.key), this.kd);
11051
11004
  }, t;
11052
- }(), Mr = /** @class */ function(e) {
11005
+ }(), qr = /** @class */ function(e) {
11053
11006
  function n(t, n, r) {
11054
11007
  var i = this;
11055
- if ((i = e.call(this, Lt.ve(t), n, r) || this).df = t, t.length % 2 != 1) throw new A(b.INVALID_ARGUMENT, "Invalid collection reference. Collection references must have an odd number of segments, but " + t.G() + " has " + t.length);
11008
+ if ((i = e.call(this, Vt.ve(t), n, r) || this).nf = t, t.length % 2 != 1) throw new A(b.INVALID_ARGUMENT, "Invalid collection reference. Collection references must have an odd number of segments, but " + t.G() + " has " + t.length);
11056
11009
  return i;
11057
11010
  }
11058
11011
  return t(n, e), Object.defineProperty(n.prototype, "id", {
11059
11012
  get: function() {
11060
- return this.Yd.path.U();
11013
+ return this.Qd.path.U();
11061
11014
  },
11062
11015
  enumerable: !0,
11063
11016
  configurable: !0
11064
11017
  }), Object.defineProperty(n.prototype, "parent", {
11065
11018
  get: function() {
11066
- var t = this.Yd.path.O();
11067
- return t.q() ? null : new Vr(new U(t), this.firestore);
11019
+ var t = this.Qd.path.O();
11020
+ return t.q() ? null : new Vr(new O(t), this.firestore);
11068
11021
  },
11069
11022
  enumerable: !0,
11070
11023
  configurable: !0
11071
11024
  }), Object.defineProperty(n.prototype, "path", {
11072
11025
  get: function() {
11073
- return this.Yd.path.G();
11026
+ return this.Qd.path.G();
11074
11027
  },
11075
11028
  enumerable: !0,
11076
11029
  configurable: !0
@@ -11078,20 +11031,20 @@ var Tr = /** @class */ function() {
11078
11031
  if (nn("CollectionReference.doc", arguments, 0, 1),
11079
11032
  // We allow omission of 'pathString' but explicitly prohibit passing in both
11080
11033
  // 'undefined' and 'null'.
11081
- 0 === arguments.length && (t = Oe.Tn()), rn("CollectionReference.doc", "non-empty string", 1, t),
11034
+ 0 === arguments.length && (t = Ue.Tn()), rn("CollectionReference.doc", "non-empty string", 1, t),
11082
11035
  "" === t) throw new A(b.INVALID_ARGUMENT, "Document path must be a non-empty string");
11083
- var e = V.K(t);
11084
- return Vr.Md(this.Yd.path.child(e), this.firestore, this.xd);
11036
+ var e = L.K(t);
11037
+ return Vr.Cd(this.Qd.path.child(e), this.firestore, this.kd);
11085
11038
  }, n.prototype.add = function(t) {
11086
- tn("CollectionReference.add", arguments, 1), rn("CollectionReference.add", "object", 1, this.xd ? this.xd.toFirestore(t) : t);
11039
+ tn("CollectionReference.add", arguments, 1), rn("CollectionReference.add", "object", 1, this.kd ? this.kd.toFirestore(t) : t);
11087
11040
  var e = this.doc();
11088
11041
  return e.set(t).then((function() {
11089
11042
  return e;
11090
11043
  }));
11091
11044
  }, n.prototype.withConverter = function(t) {
11092
- return new n(this.df, this.firestore, t);
11045
+ return new n(this.nf, this.firestore, t);
11093
11046
  }, n;
11094
- }(Cr);
11047
+ }(Pr);
11095
11048
 
11096
11049
  /**
11097
11050
  * @license
@@ -11110,7 +11063,7 @@ var Tr = /** @class */ function() {
11110
11063
  * limitations under the License.
11111
11064
  */
11112
11065
  // settings() defaults:
11113
- function Pr(t, e) {
11066
+ function Fr(t, e) {
11114
11067
  if (void 0 === e) return {
11115
11068
  merge: !1
11116
11069
  };
@@ -11125,16 +11078,16 @@ function Pr(t, e) {
11125
11078
  return e;
11126
11079
  }
11127
11080
 
11128
- function xr(t, e) {
11081
+ function Gr(t, e) {
11129
11082
  return void 0 === e ? {} : (pn(t, e, [ "serverTimestamps" ]), an(t, 0, "serverTimestamps", e.serverTimestamps, [ "estimate", "previous", "none" ]),
11130
11083
  e);
11131
11084
  }
11132
11085
 
11133
- function Gr(t, e) {
11086
+ function xr(t, e) {
11134
11087
  on(t, "object", 1, e), e && (pn(t, e, [ "source" ]), an(t, 0, "source", e.source, [ "default", "server", "cache" ]));
11135
11088
  }
11136
11089
 
11137
- function Fr(t, e, n) {
11090
+ function jr(t, e, n) {
11138
11091
  if (e instanceof Vr) {
11139
11092
  if (e.firestore !== n) throw new A(b.INVALID_ARGUMENT, "Provided document reference is from a different Firestore instance.");
11140
11093
  return e;
@@ -11142,7 +11095,7 @@ function Fr(t, e, n) {
11142
11095
  throw dn(t, "DocumentReference", 1, e);
11143
11096
  }
11144
11097
 
11145
- function jr(t) {
11098
+ function Qr(t) {
11146
11099
  switch (t) {
11147
11100
  case 0 /* Added */ :
11148
11101
  return "added";
@@ -11155,7 +11108,7 @@ function jr(t) {
11155
11108
  return "removed";
11156
11109
 
11157
11110
  default:
11158
- return Ve("Unknown change type: " + t);
11111
+ return Le("Unknown change type: " + t);
11159
11112
  }
11160
11113
  }
11161
11114
 
@@ -11172,100 +11125,100 @@ function jr(t) {
11172
11125
  return t ? (r = t.toFirestore(e), n = "toFirestore() in " + n) : r = e, [ r, n ];
11173
11126
  }
11174
11127
 
11175
- var zr = gn(Sr, "Use firebase.firestore() instead."), Qr = gn(Rr, "Use firebase.firestore().runTransaction() instead."), Hr = gn(Dr, "Use firebase.firestore().batch() instead."), Yr = gn(Vr, "Use firebase.firestore().doc() instead."), Wr = gn(Or), Jr = gn(Ur), Xr = gn(Cr), Kr = gn(qr), Zr = gn(Mr, "Use firebase.firestore().collection() instead."), $r = {
11128
+ var zr = gn(Rr, "Use firebase.firestore() instead."), Hr = gn(Dr, "Use firebase.firestore().runTransaction() instead."), Yr = gn(Lr, "Use firebase.firestore().batch() instead."), Wr = gn(Vr, "Use firebase.firestore().doc() instead."), Jr = gn(Or), Zr = gn(Cr), Xr = gn(Pr), Kr = gn(Mr), $r = gn(qr, "Use firebase.firestore().collection() instead."), ti = {
11176
11129
  Firestore: zr,
11177
- GeoPoint: Ln,
11130
+ GeoPoint: Vn,
11178
11131
  Timestamp: S,
11179
11132
  Blob: An,
11180
- Transaction: Qr,
11181
- WriteBatch: Hr,
11182
- DocumentReference: Yr,
11183
- DocumentSnapshot: Wr,
11133
+ Transaction: Hr,
11134
+ WriteBatch: Yr,
11135
+ DocumentReference: Wr,
11136
+ DocumentSnapshot: Jr,
11184
11137
  Query: Xr,
11185
- QueryDocumentSnapshot: Jr,
11138
+ QueryDocumentSnapshot: Zr,
11186
11139
  QuerySnapshot: Kr,
11187
- CollectionReference: Zr,
11140
+ CollectionReference: $r,
11188
11141
  FieldPath: Nn,
11189
- FieldValue: Vn,
11190
- setLogLevel: Sr.setLogLevel,
11191
- CACHE_SIZE_UNLIMITED: _r
11192
- }, ti = /** @class */ function() {
11142
+ FieldValue: Ln,
11143
+ setLogLevel: Rr.setLogLevel,
11144
+ CACHE_SIZE_UNLIMITED: kr
11145
+ }, ei = /** @class */ function() {
11193
11146
  function t() {}
11194
11147
  return t.prototype.mu = function(t) {
11195
11148
  // No-op.
11196
11149
  }, t.prototype.ku = function() {
11197
11150
  // No-op.
11198
11151
  }, t;
11199
- }(), ei = /** @class */ function() {
11152
+ }(), ni = /** @class */ function() {
11200
11153
  function t() {
11201
11154
  var t = this;
11202
- this.ff = function() {
11203
- return t.wf();
11204
- }, this.Tf = function() {
11205
- return t.mf();
11206
- }, this.Ef = [], this.Rf();
11155
+ this.rf = function() {
11156
+ return t.hf();
11157
+ }, this.af = function() {
11158
+ return t.uf();
11159
+ }, this.cf = [], this.lf();
11207
11160
  }
11208
11161
  return t.prototype.mu = function(t) {
11209
- this.Ef.push(t);
11162
+ this.cf.push(t);
11210
11163
  }, t.prototype.ku = function() {
11211
- window.removeEventListener("online", this.ff), window.removeEventListener("offline", this.Tf);
11212
- }, t.prototype.Rf = function() {
11213
- window.addEventListener("online", this.ff), window.addEventListener("offline", this.Tf);
11214
- }, t.prototype.wf = function() {
11164
+ window.removeEventListener("online", this.rf), window.removeEventListener("offline", this.af);
11165
+ }, t.prototype.lf = function() {
11166
+ window.addEventListener("online", this.rf), window.addEventListener("offline", this.af);
11167
+ }, t.prototype.hf = function() {
11215
11168
  Se("ConnectivityMonitor", "Network connectivity changed: AVAILABLE");
11216
- for (var t = 0, e = this.Ef; t < e.length; t++) {
11169
+ for (var t = 0, e = this.cf; t < e.length; t++) {
11217
11170
  (0, e[t])(0 /* AVAILABLE */);
11218
11171
  }
11219
- }, t.prototype.mf = function() {
11172
+ }, t.prototype.uf = function() {
11220
11173
  Se("ConnectivityMonitor", "Network connectivity changed: UNAVAILABLE");
11221
- for (var t = 0, e = this.Ef; t < e.length; t++) {
11174
+ for (var t = 0, e = this.cf; t < e.length; t++) {
11222
11175
  (0, e[t])(1 /* UNAVAILABLE */);
11223
11176
  }
11224
11177
  },
11225
11178
  // TODO(chenbrian): Consider passing in window either into this component or
11226
11179
  // here for testing via FakeWindow.
11227
11180
  /** Checks that all used attributes of window are available. */
11228
- t.If = function() {
11181
+ t._f = function() {
11229
11182
  return "undefined" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;
11230
11183
  }, t;
11231
- }(), ni = /** @class */ function() {
11184
+ }(), ri = /** @class */ function() {
11232
11185
  function t(t) {
11233
- this.Af = t.Af, this.Pf = t.Pf;
11186
+ this.df = t.df, this.ff = t.ff;
11234
11187
  }
11235
11188
  return t.prototype.Na = function(t) {
11236
- this.Vf = t;
11189
+ this.wf = t;
11237
11190
  }, t.prototype.va = function(t) {
11238
- this.pf = t;
11191
+ this.Tf = t;
11239
11192
  }, t.prototype.onMessage = function(t) {
11240
- this.gf = t;
11193
+ this.mf = t;
11241
11194
  }, t.prototype.close = function() {
11242
- this.Pf();
11195
+ this.ff();
11243
11196
  }, t.prototype.send = function(t) {
11244
- this.Af(t);
11245
- }, t.prototype.yf = function() {
11246
- this.Vf();
11247
- }, t.prototype.bf = function(t) {
11248
- this.pf(t);
11249
- }, t.prototype.vf = function(t) {
11250
- this.gf(t);
11197
+ this.df(t);
11198
+ }, t.prototype.Ef = function() {
11199
+ this.wf();
11200
+ }, t.prototype.Rf = function(t) {
11201
+ this.Tf(t);
11202
+ }, t.prototype.If = function(t) {
11203
+ this.mf(t);
11251
11204
  }, t;
11252
- }(), ri = {
11205
+ }(), ii = {
11253
11206
  BatchGetDocuments: "batchGet",
11254
11207
  Commit: "commit"
11255
- }, ii = "gl-js/ fire/" + w, oi = /** @class */ function() {
11208
+ }, oi = "gl-js/ fire/" + w, si = /** @class */ function() {
11256
11209
  function t(t) {
11257
11210
  this.ci = t.ci;
11258
11211
  var e = t.ssl ? "https" : "http";
11259
- this.Sf = e + "://" + t.host, this.forceLongPolling = t.forceLongPolling;
11212
+ this.Af = e + "://" + t.host, this.forceLongPolling = t.forceLongPolling;
11260
11213
  }
11261
11214
  /**
11262
11215
  * Modifies the headers for a request, adding any authorization token if
11263
11216
  * present and any additional headers for the request.
11264
- */ return t.prototype.Cf = function(t, e) {
11217
+ */ return t.prototype.Pf = function(t, e) {
11265
11218
  if (e) for (var n in e.o) e.o.hasOwnProperty(n) && (t[n] = e.o[n]);
11266
- t["X-Goog-Api-Client"] = ii;
11219
+ t["X-Goog-Api-Client"] = oi;
11267
11220
  }, t.prototype.Ga = function(t, e, n) {
11268
- var r = this, i = this.Df(t);
11221
+ var r = this, i = this.Vf(t);
11269
11222
  return new Promise((function(o, s) {
11270
11223
  var u = new d;
11271
11224
  u.listenOnce(y.COMPLETE, (function() {
@@ -11299,7 +11252,7 @@ var zr = gn(Sr, "Use firebase.firestore() instead."), Qr = gn(Rr, "Use firebase.
11299
11252
  break;
11300
11253
 
11301
11254
  default:
11302
- Ve('RPC "' + t + '" failed with unanticipated webchannel error ' + u.getLastErrorCode() + ": " + u.getLastError() + ", giving up.");
11255
+ Le('RPC "' + t + '" failed with unanticipated webchannel error ' + u.getLastErrorCode() + ": " + u.getLastError() + ", giving up.");
11303
11256
  }
11304
11257
  } finally {
11305
11258
  Se("Connection", 'RPC "' + t + '" completed.');
@@ -11320,14 +11273,14 @@ var zr = gn(Sr, "Use firebase.firestore() instead."), Qr = gn(Rr, "Use firebase.
11320
11273
  var c = {
11321
11274
  "Content-Type": "text/plain"
11322
11275
  };
11323
- r.Cf(c, n), u.send(i, "POST", h, c, 15);
11276
+ r.Pf(c, n), u.send(i, "POST", h, c, 15);
11324
11277
  }));
11325
11278
  }, t.prototype.Ka = function(t, e, n) {
11326
11279
  // The REST API automatically aggregates all of the streamed results, so we
11327
11280
  // can just use the normal invoke() method.
11328
11281
  return this.Ga(t, e, n);
11329
11282
  }, t.prototype.ka = function(t, e) {
11330
- var n = [ this.Sf, "/", "google.firestore.v1.Firestore", "/", t, "/channel" ], r = m(), i = {
11283
+ var n = [ this.Af, "/", "google.firestore.v1.Firestore", "/", t, "/channel" ], r = m(), i = {
11331
11284
  // Required for backend stickiness, routing behavior is based on this
11332
11285
  // parameter.
11333
11286
  httpSessionIdParam: "gsessionid",
@@ -11350,7 +11303,7 @@ var zr = gn(Sr, "Use firebase.firestore() instead."), Qr = gn(Rr, "Use firebase.
11350
11303
  },
11351
11304
  forceLongPolling: this.forceLongPolling
11352
11305
  };
11353
- this.Cf(i.initMessageHeaders, e),
11306
+ this.Pf(i.initMessageHeaders, e),
11354
11307
  // Sending the custom headers we just added to request.initMessageHeaders
11355
11308
  // (Authorization, etc.) will trigger the browser to make a CORS preflight
11356
11309
  // request because the XHR will no longer meet the criteria for a "simple"
@@ -11369,12 +11322,12 @@ var zr = gn(Sr, "Use firebase.firestore() instead."), Qr = gn(Rr, "Use firebase.
11369
11322
  u() || a() || h() || c() || f() || l() || (i.httpHeadersOverwriteParam = "$httpHeaders");
11370
11323
  var o = n.join("");
11371
11324
  Se("Connection", "Creating WebChannel: " + o + " " + i);
11372
- var s = r.createWebChannel(o, i), p = !1, d = !1, y = new ni({
11373
- Af: function(t) {
11325
+ var s = r.createWebChannel(o, i), p = !1, d = !1, y = new ri({
11326
+ df: function(t) {
11374
11327
  d ? Se("Connection", "Not sending because WebChannel is closed:", t) : (p || (Se("Connection", "Opening WebChannel transport."),
11375
11328
  s.open(), p = !0), Se("Connection", "WebChannel sending:", t), s.send(t));
11376
11329
  },
11377
- Pf: function() {
11330
+ ff: function() {
11378
11331
  return s.close();
11379
11332
  }
11380
11333
  }), v = function(t, e) {
@@ -11402,14 +11355,14 @@ var zr = gn(Sr, "Use firebase.firestore() instead."), Qr = gn(Rr, "Use firebase.
11402
11355
  return v(g.EventType.OPEN, (function() {
11403
11356
  d || Se("Connection", "WebChannel transport opened.");
11404
11357
  })), v(g.EventType.CLOSE, (function() {
11405
- d || (d = !0, Se("Connection", "WebChannel transport closed"), y.bf());
11358
+ d || (d = !0, Se("Connection", "WebChannel transport closed"), y.Rf());
11406
11359
  })), v(g.EventType.ERROR, (function(t) {
11407
- d || (d = !0, Se("Connection", "WebChannel transport errored:", t), y.bf(new A(b.UNAVAILABLE, "The operation could not be completed")));
11360
+ d || (d = !0, Se("Connection", "WebChannel transport errored:", t), y.Rf(new A(b.UNAVAILABLE, "The operation could not be completed")));
11408
11361
  })), v(g.EventType.MESSAGE, (function(t) {
11409
11362
  var e;
11410
11363
  if (!d) {
11411
11364
  var n = t.data[0];
11412
- Le(!!n, "Got a webchannel message without data.");
11365
+ Ve(!!n, "Got a webchannel message without data.");
11413
11366
  // TODO(b/35143891): There is a bug in One Platform that caused errors
11414
11367
  // (and only errors) to be wrapped in an extra array. To be forward
11415
11368
  // compatible with the bug we need to check either condition. The latter
@@ -11422,26 +11375,26 @@ var zr = gn(Sr, "Use firebase.firestore() instead."), Qr = gn(Rr, "Use firebase.
11422
11375
  var o = i.status, u = function(t) {
11423
11376
  // lookup by string
11424
11377
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11425
- var e = Ft[t];
11426
- if (void 0 !== e) return Xt(e);
11378
+ var e = xt[t];
11379
+ if (void 0 !== e) return Zt(e);
11427
11380
  }(o), a = i.message;
11428
11381
  void 0 === u && (u = b.INTERNAL, a = "Unknown error status: " + o + " with message " + i.message),
11429
11382
  // Mark closed so no further events are propagated
11430
- d = !0, y.bf(new A(u, a)), s.close();
11431
- } else Se("Connection", "WebChannel received:", n), y.vf(n);
11383
+ d = !0, y.Rf(new A(u, a)), s.close();
11384
+ } else Se("Connection", "WebChannel received:", n), y.If(n);
11432
11385
  }
11433
11386
  })), setTimeout((function() {
11434
11387
  // Technically we could/should wait for the WebChannel opened event,
11435
11388
  // but because we want to send the first message with the WebChannel
11436
11389
  // handshake we pretend the channel opened here (asynchronously), and
11437
11390
  // then delay the actual open until the first message is sent.
11438
- y.yf();
11391
+ y.Ef();
11439
11392
  }), 0), y;
11440
11393
  },
11441
11394
  // visible for testing
11442
- t.prototype.Df = function(t) {
11443
- var e = ri[t];
11444
- return this.Sf + "/v1/projects/" + this.ci.projectId + "/databases/" + this.ci.database + "/documents:" + e;
11395
+ t.prototype.Vf = function(t) {
11396
+ var e = ii[t];
11397
+ return this.Af + "/v1/projects/" + this.ci.projectId + "/databases/" + this.ci.database + "/documents:" + e;
11445
11398
  }, t;
11446
11399
  }();
11447
11400
 
@@ -11480,7 +11433,7 @@ var zr = gn(Sr, "Use firebase.firestore() instead."), Qr = gn(Rr, "Use firebase.
11480
11433
  /**
11481
11434
  * Registers the memory-only Firestore build with the components framework.
11482
11435
  */
11483
- function si(t) {
11436
+ function ui(t) {
11484
11437
  /**
11485
11438
  * Configures Firestore as part of the Firebase SDK by calling registerService.
11486
11439
  *
@@ -11491,10 +11444,10 @@ function si(t) {
11491
11444
  !function(t, e) {
11492
11445
  t.INTERNAL.registerComponent(new p("firestore", (function(t) {
11493
11446
  return function(t, e) {
11494
- return new Sr(t, e, new br);
11447
+ return new Rr(t, e, new Ar);
11495
11448
  }(t.getProvider("app").getImmediate(), t.getProvider("auth-internal"));
11496
- }), "PUBLIC" /* PUBLIC */).setServiceProps(Object.assign({}, $r)));
11497
- }(t), t.registerVersion("@firebase/firestore", "1.14.0-canary.daf63c2c");
11449
+ }), "PUBLIC" /* PUBLIC */).setServiceProps(Object.assign({}, ti)));
11450
+ }(t), t.registerVersion("@firebase/firestore", "1.14.0");
11498
11451
  }
11499
11452
 
11500
11453
  /**
@@ -11552,11 +11505,11 @@ Ie.fn(new (/** @class */ function() {
11552
11505
  },
11553
11506
  enumerable: !0,
11554
11507
  configurable: !0
11555
- }), t.prototype.td = function(t) {
11556
- return Promise.resolve(new oi(t));
11557
- }, t.prototype.J_ = function() {
11558
- return ei.If() ? new ei : new ti;
11559
- }, t.prototype.ed = function(t) {
11508
+ }), t.prototype.K_ = function(t) {
11509
+ return Promise.resolve(new si(t));
11510
+ }, t.prototype.Q_ = function() {
11511
+ return ni._f() ? new ni : new ei;
11512
+ }, t.prototype.H_ = function(t) {
11560
11513
  return new Ae(t, {
11561
11514
  di: !0
11562
11515
  });
@@ -11567,7 +11520,7 @@ Ie.fn(new (/** @class */ function() {
11567
11520
  }, t.prototype.btoa = function(t) {
11568
11521
  return btoa(t);
11569
11522
  }, t;
11570
- }())), si(i);
11523
+ }())), ui(i);
11571
11524
 
11572
- export { si as __PRIVATE_registerFirestore };
11525
+ export { ui as __PRIVATE_registerFirestore };
11573
11526
  //# sourceMappingURL=index.memory.esm.js.map