@firebase/firestore 3.4.14-canary.fcd4b8ac3 → 3.4.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/firestore/src/api/database.d.ts +34 -3
  3. package/dist/firestore/src/core/database_info.d.ts +4 -0
  4. package/dist/firestore/src/lite-api/database.d.ts +51 -7
  5. package/dist/firestore/test/integration/api/provider.test.d.ts +17 -0
  6. package/dist/firestore/test/integration/util/firebase_export.d.ts +2 -1
  7. package/dist/firestore/test/integration/util/helpers.d.ts +1 -0
  8. package/dist/index.d.ts +14 -3
  9. package/dist/index.esm2017.js +67 -68
  10. package/dist/index.esm2017.js.map +1 -1
  11. package/dist/index.esm5.js +52 -55
  12. package/dist/index.esm5.js.map +1 -1
  13. package/dist/index.node.cjs.js +47 -42
  14. package/dist/index.node.cjs.js.map +1 -1
  15. package/dist/index.node.mjs +47 -42
  16. package/dist/index.node.mjs.map +1 -1
  17. package/dist/index.rn.js +67 -68
  18. package/dist/index.rn.js.map +1 -1
  19. package/dist/internal.d.ts +40 -6
  20. package/dist/lite/firestore/src/api/database.d.ts +34 -3
  21. package/dist/lite/firestore/src/core/database_info.d.ts +4 -0
  22. package/dist/lite/firestore/src/lite-api/database.d.ts +51 -7
  23. package/dist/lite/firestore/test/integration/api/provider.test.d.ts +17 -0
  24. package/dist/lite/firestore/test/integration/util/firebase_export.d.ts +2 -1
  25. package/dist/lite/firestore/test/integration/util/helpers.d.ts +1 -0
  26. package/dist/lite/index.browser.esm2017.js +43 -57
  27. package/dist/lite/index.browser.esm2017.js.map +1 -1
  28. package/dist/lite/index.browser.esm5.js +181 -184
  29. package/dist/lite/index.browser.esm5.js.map +1 -1
  30. package/dist/lite/index.d.ts +15 -4
  31. package/dist/lite/index.node.cjs.js +37 -45
  32. package/dist/lite/index.node.cjs.js.map +1 -1
  33. package/dist/lite/index.node.mjs +37 -45
  34. package/dist/lite/index.node.mjs.map +1 -1
  35. package/dist/lite/index.rn.esm2017.js +43 -57
  36. package/dist/lite/index.rn.esm2017.js.map +1 -1
  37. package/dist/lite/internal.d.ts +55 -7
  38. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +6 -43
  39. package/dist/lite/packages/firestore/src/api/database.d.ts +34 -3
  40. package/dist/lite/packages/firestore/src/core/database_info.d.ts +4 -0
  41. package/dist/lite/packages/firestore/src/lite-api/database.d.ts +51 -7
  42. package/dist/lite/packages/firestore/test/integration/api/provider.test.d.ts +17 -0
  43. package/dist/lite/packages/firestore/test/integration/util/firebase_export.d.ts +2 -1
  44. package/dist/lite/packages/firestore/test/integration/util/helpers.d.ts +1 -0
  45. package/dist/lite/private.d.ts +22 -7
  46. package/dist/packages/firestore/dist/index.esm2017.d.ts +20 -15
  47. package/dist/packages/firestore/src/api/database.d.ts +34 -3
  48. package/dist/packages/firestore/src/core/database_info.d.ts +4 -0
  49. package/dist/packages/firestore/src/lite-api/database.d.ts +51 -7
  50. package/dist/packages/firestore/test/integration/api/provider.test.d.ts +17 -0
  51. package/dist/packages/firestore/test/integration/util/firebase_export.d.ts +2 -1
  52. package/dist/packages/firestore/test/integration/util/helpers.d.ts +1 -0
  53. package/dist/private.d.ts +21 -7
  54. package/package.json +10 -9
@@ -1,6 +1,6 @@
1
1
  import { __extends as t, __awaiter as e, __generator as n, __spreadArray as r } from "tslib";
2
2
 
3
- import { SDK_VERSION as i, _registerComponent as o, registerVersion as a, _getProvider, getApp as s, _removeServiceInstance as u } from "@firebase/app";
3
+ import { SDK_VERSION as i, _registerComponent as o, registerVersion as s, _getProvider, getApp as a, _removeServiceInstance as u } from "@firebase/app";
4
4
 
5
5
  import { Component as c } from "@firebase/component";
6
6
 
@@ -67,7 +67,7 @@ y.MOCK_USER = new y("mock-user");
67
67
  * See the License for the specific language governing permissions and
68
68
  * limitations under the License.
69
69
  */
70
- var m = "9.9.2-canary.fcd4b8ac3", v = new l("@firebase/firestore");
70
+ var m = "9.9.4", v = new l("@firebase/firestore");
71
71
 
72
72
  /**
73
73
  * @license
@@ -367,9 +367,9 @@ e) {
367
367
  * @param useFetchStreams Whether to use the Fetch API instead of
368
368
  * XMLHTTPRequest
369
369
  */
370
- function(t, e, n, r, i, o, a, s) {
370
+ function(t, e, n, r, i, o, s, a) {
371
371
  this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = r, this.ssl = i,
372
- this.forceLongPolling = o, this.autoDetectLongPolling = a, this.useFetchStreams = s;
372
+ this.forceLongPolling = o, this.autoDetectLongPolling = s, this.useFetchStreams = a;
373
373
  }, J = /** @class */ function() {
374
374
  function t(t, e) {
375
375
  this.projectId = t, this.database = e || "(default)";
@@ -463,10 +463,10 @@ function(t, e, n, r, i, o, a, s) {
463
463
  // sequences (e.g. __id123__) and just passes them through raw (they exist
464
464
  // for legacy reasons and should not be used frequently).
465
465
  for (var r = [], i = 0, o = t; i < o.length; i++) {
466
- var a = o[i];
467
- if (a.indexOf("//") >= 0) throw new M(V, "Invalid segment (" + a + "). Paths must not contain // in them.");
466
+ var s = o[i];
467
+ if (s.indexOf("//") >= 0) throw new M(V, "Invalid segment (" + s + "). Paths must not contain // in them.");
468
468
  // Strip leading and traling slashed.
469
- r.push.apply(r, a.split("/").filter((function(t) {
469
+ r.push.apply(r, s.split("/").filter((function(t) {
470
470
  return t.length > 0;
471
471
  })));
472
472
  }
@@ -521,16 +521,16 @@ function(t, e, n, r, i, o, a, s) {
521
521
  for (var e = [], r = "", i = 0, o = function() {
522
522
  if (0 === r.length) throw new M(V, "Invalid field path (" + t + "). Paths must not be empty, begin with '.', end with '.', or contain '..'");
523
523
  e.push(r), r = "";
524
- }, a = !1; i < t.length; ) {
525
- var s = t[i];
526
- if ("\\" === s) {
524
+ }, s = !1; i < t.length; ) {
525
+ var a = t[i];
526
+ if ("\\" === a) {
527
527
  if (i + 1 === t.length) throw new M(V, "Path has trailing escape character: " + t);
528
528
  var u = t[i + 1];
529
529
  if ("\\" !== u && "." !== u && "`" !== u) throw new M(V, "Path has invalid escape sequence: " + t);
530
530
  r += u, i += 2;
531
- } else "`" === s ? (a = !a, i++) : "." !== s || a ? (r += s, i++) : (o(), i++);
531
+ } else "`" === a ? (s = !s, i++) : "." !== a || s ? (r += a, i++) : (o(), i++);
532
532
  }
533
- if (o(), a) throw new M(V, "Unterminated ` in path: " + t);
533
+ if (o(), s) throw new M(V, "Unterminated ` in path: " + t);
534
534
  return new n(e);
535
535
  }, n.emptyPath = function() {
536
536
  return new n([]);
@@ -623,7 +623,7 @@ function rt(t, e, n) {
623
623
  * Returns true if it's a non-null object without a custom prototype
624
624
  * (i.e. excludes Array, Date, etc.).
625
625
  */
626
- /** Returns a string describing the type / value of the provided input. */ function at(t) {
626
+ /** Returns a string describing the type / value of the provided input. */ function st(t) {
627
627
  if (void 0 === t) return "undefined";
628
628
  if (null === t) return "null";
629
629
  if ("string" == typeof t) return t.length > 20 && (t = t.substring(0, 20) + "..."),
@@ -641,7 +641,7 @@ function rt(t, e, n) {
641
641
  return "function" == typeof t ? "a function" : E();
642
642
  }
643
643
 
644
- function st(t,
644
+ function at(t,
645
645
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
646
646
  e) {
647
647
  if ("_delegate" in t && (
@@ -649,7 +649,7 @@ e) {
649
649
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
650
650
  t = t._delegate), !(t instanceof e)) {
651
651
  if (e.name === t.constructor.name) throw new M(V, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
652
- var n = at(t);
652
+ var n = st(t);
653
653
  throw new M(V, "Expected type '" + e.name + "', but it was: " + n);
654
654
  }
655
655
  return t;
@@ -868,7 +868,7 @@ var yt = /** @class */ function(r) {
868
868
  throw new Error("Not supported by FetchConnection");
869
869
  }, i.prototype.A = function(t, r, i, o) {
870
870
  return e(this, void 0, void 0, (function() {
871
- var t, e, a;
871
+ var t, e, s;
872
872
  return n(this, (function(n) {
873
873
  switch (n.label) {
874
874
  case 0:
@@ -885,7 +885,7 @@ var yt = /** @class */ function(r) {
885
885
  return e = n.sent(), [ 3 /*break*/ , 4 ];
886
886
 
887
887
  case 3:
888
- throw a = n.sent(), new M(dt(a.status), "Request failed with error: " + a.statusText);
888
+ throw s = n.sent(), new M(dt(s.status), "Request failed with error: " + s.statusText);
889
889
 
890
890
  case 4:
891
891
  if (!e.ok) throw new M(dt(e.status), "Request failed with error: " + e.statusText);
@@ -903,8 +903,8 @@ var yt = /** @class */ function(r) {
903
903
  return t.prototype.v = function(t, e, n, r, i) {
904
904
  var o = this.T(t, e);
905
905
  w("RestConnection", "Sending: ", o, n);
906
- var a = {};
907
- return this.I(a, r, i), this.A(t, o, a, n).then((function(t) {
906
+ var s = {};
907
+ return this.I(s, r, i), this.A(t, o, s, n).then((function(t) {
908
908
  return w("RestConnection", "Received: ", t), t;
909
909
  }), (function(e) {
910
910
  throw _("RestConnection", t + " failed with error: ", e, "url: ", o, "request:", n),
@@ -1688,8 +1688,8 @@ var At = /** @class */ function() {
1688
1688
  var o = i[r];
1689
1689
  n = n.add(o);
1690
1690
  }
1691
- for (var a = 0, s = e; a < s.length; a++) {
1692
- var u = s[a];
1691
+ for (var s = 0, a = e; s < a.length; s++) {
1692
+ var u = a[s];
1693
1693
  n = n.add(u);
1694
1694
  }
1695
1695
  return new t(n.toArray());
@@ -2032,10 +2032,10 @@ function Bt(t, e) {
2032
2032
  // elements out of order. We need to re-sort the elements to ensure that
2033
2033
  // canonical IDs are independent of insertion order.
2034
2034
  r.sort(), o.sort();
2035
- for (var a = 0; a < r.length && a < o.length; ++a) {
2036
- var s = gt(r[a], o[a]);
2037
- if (0 !== s) return s;
2038
- var u = Bt(n[r[a]], i[o[a]]);
2035
+ for (var s = 0; s < r.length && s < o.length; ++s) {
2036
+ var a = gt(r[s], o[s]);
2037
+ if (0 !== a) return a;
2038
+ var u = Bt(n[r[s]], i[o[s]]);
2039
2039
  if (0 !== u) return u;
2040
2040
  }
2041
2041
  return gt(r.length, o.length);
@@ -2141,8 +2141,8 @@ var Xt = /** @class */ function() {
2141
2141
  t.forEach((function(t, o) {
2142
2142
  if (!n.isImmediateParentOf(o)) {
2143
2143
  // Insert the accumulated changes at this parent location
2144
- var a = e.getFieldsMap(n);
2145
- e.applyChanges(a, r, i), r = {}, i = [], n = o.popLast();
2144
+ var s = e.getFieldsMap(n);
2145
+ e.applyChanges(s, r, i), r = {}, i = [], n = o.popLast();
2146
2146
  }
2147
2147
  t ? r[o.lastSegment()] = Yt(t) : i.push(o.lastSegment());
2148
2148
  }));
@@ -2289,11 +2289,11 @@ var Xt = /** @class */ function() {
2289
2289
  }, t.prototype.toString = function() {
2290
2290
  return "Document(" + this.key + ", " + this.version + ", " + JSON.stringify(this.data.value) + ", {documentType: " + this.documentType + "}), {documentState: " + this.documentState + "})";
2291
2291
  }, t;
2292
- }(), Zt = function(t, e, n, r, i, o, a) {
2292
+ }(), Zt = function(t, e, n, r, i, o, s) {
2293
2293
  void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
2294
- void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null),
2294
+ void 0 === i && (i = null), void 0 === o && (o = null), void 0 === s && (s = null),
2295
2295
  this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = r, this.limit = i,
2296
- this.startAt = o, this.endAt = a, this.D = null;
2296
+ this.startAt = o, this.endAt = s, this.D = null;
2297
2297
  };
2298
2298
 
2299
2299
  /**
@@ -2330,10 +2330,10 @@ var Xt = /** @class */ function() {
2330
2330
  * using this factory method, because `Query` provides an implicit `orderBy`
2331
2331
  * property.
2332
2332
  */
2333
- function $t(t, e, n, r, i, o, a) {
2333
+ function $t(t, e, n, r, i, o, s) {
2334
2334
  return void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
2335
- void 0 === i && (i = null), void 0 === o && (o = null), void 0 === a && (a = null),
2336
- new Zt(t, e, n, r, i, o, a);
2335
+ void 0 === i && (i = null), void 0 === o && (o = null), void 0 === s && (s = null),
2336
+ new Zt(t, e, n, r, i, o, s);
2337
2337
  }
2338
2338
 
2339
2339
  var te = /** @class */ function(e) {
@@ -2344,7 +2344,7 @@ var te = /** @class */ function(e) {
2344
2344
  /**
2345
2345
  * Creates a filter based on the provided arguments.
2346
2346
  */ return t(n, e), n.create = function(t, e, r) {
2347
- return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.$(t, e, r) : new ee(t, e, r) : "array-contains" /* ARRAY_CONTAINS */ === e ? new oe(t, r) : "in" /* IN */ === e ? new ae(t, r) : "not-in" /* NOT_IN */ === e ? new se(t, r) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new ue(t, r) : new n(t, e, r);
2347
+ return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.$(t, e, r) : new ee(t, e, r) : "array-contains" /* ARRAY_CONTAINS */ === e ? new oe(t, r) : "in" /* IN */ === e ? new se(t, r) : "not-in" /* NOT_IN */ === e ? new ae(t, r) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new ue(t, r) : new n(t, e, r);
2348
2348
  }, n.$ = function(t, e, n) {
2349
2349
  return "in" /* IN */ === e ? new ne(t, n) : new re(t, n);
2350
2350
  }, n.prototype.matches = function(t) {
@@ -2427,7 +2427,7 @@ var te = /** @class */ function(e) {
2427
2427
  var e = t.data.field(this.field);
2428
2428
  return Kt(e) && Ut(e.arrayValue, this.value);
2429
2429
  }, n;
2430
- }(te), ae = /** @class */ function(e) {
2430
+ }(te), se = /** @class */ function(e) {
2431
2431
  function n(t, n) {
2432
2432
  return e.call(this, t, "in" /* IN */ , n) || this;
2433
2433
  }
@@ -2435,7 +2435,7 @@ var te = /** @class */ function(e) {
2435
2435
  var e = t.data.field(this.field);
2436
2436
  return null !== e && Ut(this.value.arrayValue, e);
2437
2437
  }, n;
2438
- }(te), se = /** @class */ function(e) {
2438
+ }(te), ae = /** @class */ function(e) {
2439
2439
  function n(t, n) {
2440
2440
  return e.call(this, t, "not-in" /* NOT_IN */ , n) || this;
2441
2441
  }
@@ -2501,11 +2501,11 @@ function he(t, e) {
2501
2501
  * Initializes a Query with a path and optional additional query constraints.
2502
2502
  * Path must currently be empty if this is a collection group query.
2503
2503
  */
2504
- function(t, e, n, r, i, o /* First */ , a, s) {
2504
+ function(t, e, n, r, i, o /* First */ , s, a) {
2505
2505
  void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []),
2506
- void 0 === i && (i = null), void 0 === o && (o = "F"), void 0 === a && (a = null),
2507
- void 0 === s && (s = null), this.path = t, this.collectionGroup = e, this.explicitOrderBy = n,
2508
- this.filters = r, this.limit = i, this.limitType = o, this.startAt = a, this.endAt = s,
2506
+ void 0 === i && (i = null), void 0 === o && (o = "F"), void 0 === s && (s = null),
2507
+ void 0 === a && (a = null), this.path = t, this.collectionGroup = e, this.explicitOrderBy = n,
2508
+ this.filters = r, this.limit = i, this.limitType = o, this.startAt = s, this.endAt = a,
2509
2509
  this.q = null,
2510
2510
  // The corresponding `Target` of this `Query` instance.
2511
2511
  this.O = null, this.startAt, this.endAt;
@@ -2548,9 +2548,9 @@ function ye(t) {
2548
2548
  // inequality filter field for it to be a valid query.
2549
2549
  // Note that the default inequality field and key ordering is ascending.
2550
2550
  n.isKeyField() || e.q.push(new le(n)), e.q.push(new le(et.keyField(), "asc" /* ASCENDING */)); else {
2551
- for (var i = !1, o = 0, a = e.explicitOrderBy; o < a.length; o++) {
2552
- var s = a[o];
2553
- e.q.push(s), s.field.isKeyField() && (i = !0);
2551
+ for (var i = !1, o = 0, s = e.explicitOrderBy; o < s.length; o++) {
2552
+ var a = s[o];
2553
+ e.q.push(a), a.field.isKeyField() && (i = !0);
2554
2554
  }
2555
2555
  if (!i) {
2556
2556
  // The order of the implicit key ordering always matches the last
@@ -2571,13 +2571,13 @@ function ye(t) {
2571
2571
  for (
2572
2572
  // Flip the orderBy directions since we want the last results
2573
2573
  var n = [], r = 0, i = ve(e); r < i.length; r++) {
2574
- var o = i[r], a = "desc" /* DESCENDING */ === o.dir ? "asc" /* ASCENDING */ : "desc" /* DESCENDING */;
2575
- n.push(new le(o.field, a));
2574
+ var o = i[r], s = "desc" /* DESCENDING */ === o.dir ? "asc" /* ASCENDING */ : "desc" /* DESCENDING */;
2575
+ n.push(new le(o.field, s));
2576
2576
  }
2577
2577
  // We need to swap the cursors to match the now-flipped query ordering.
2578
- var s = e.endAt ? new ce(e.endAt.position, e.endAt.inclusive) : null, u = e.startAt ? new ce(e.startAt.position, e.startAt.inclusive) : null;
2578
+ var a = e.endAt ? new ce(e.endAt.position, e.endAt.inclusive) : null, u = e.startAt ? new ce(e.startAt.position, e.startAt.inclusive) : null;
2579
2579
  // Now return as a LimitType.First query.
2580
- e.O = $t(e.path, e.collectionGroup, n, e.filters, e.limit, s, u);
2580
+ e.O = $t(e.path, e.collectionGroup, n, e.filters, e.limit, a, u);
2581
2581
  }
2582
2582
  return e.O;
2583
2583
  }
@@ -2716,9 +2716,9 @@ function we(t, e) {
2716
2716
  }(Ae), Pe = /** @class */ function(e) {
2717
2717
  function n(t, n, r, i, o) {
2718
2718
  void 0 === o && (o = []);
2719
- var a = this;
2720
- return (a = e.call(this) || this).key = t, a.data = n, a.fieldMask = r, a.precondition = i,
2721
- a.fieldTransforms = o, a.type = 1 /* Patch */ , a;
2719
+ var s = this;
2720
+ return (s = e.call(this) || this).key = t, s.data = n, s.fieldMask = r, s.precondition = i,
2721
+ s.fieldTransforms = o, s.type = 1 /* Patch */ , s;
2722
2722
  }
2723
2723
  return t(n, e), n.prototype.getFieldMask = function() {
2724
2724
  return this.fieldMask;
@@ -2990,8 +2990,8 @@ function Ye(t) {
2990
2990
  /** Invokes the provided RPC with auth and AppCheck tokens. */ n.prototype.v = function(t, e, n) {
2991
2991
  var r = this;
2992
2992
  return this.et(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((function(i) {
2993
- var o = i[0], a = i[1];
2994
- return r.Z.v(t, e, n, o, a);
2993
+ var o = i[0], s = i[1];
2994
+ return r.Z.v(t, e, n, o, s);
2995
2995
  })).catch((function(t) {
2996
2996
  throw "FirebaseError" === t.name ? (t.code === F && (r.authCredentials.invalidateToken(),
2997
2997
  r.appCheckCredentials.invalidateToken()), t) : new M(A, t.toString());
@@ -3000,8 +3000,8 @@ function Ye(t) {
3000
3000
  /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ n.prototype.R = function(t, e, n, r) {
3001
3001
  var i = this;
3002
3002
  return this.et(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((function(o) {
3003
- var a = o[0], s = o[1];
3004
- return i.Z.R(t, e, n, a, s, r);
3003
+ var s = o[0], a = o[1];
3004
+ return i.Z.R(t, e, n, s, a, r);
3005
3005
  })).catch((function(t) {
3006
3006
  throw "FirebaseError" === t.name ? (t.code === F && (i.authCredentials.invalidateToken(),
3007
3007
  i.appCheckCredentials.invalidateToken()), t) : new M(A, t.toString());
@@ -3106,7 +3106,7 @@ function $e(t, r) {
3106
3106
 
3107
3107
  function tn(t, r) {
3108
3108
  return e(this, void 0, void 0, (function() {
3109
- var e, i, o, a, s, u;
3109
+ var e, i, o, s, a, u;
3110
3110
  return n(this, (function(n) {
3111
3111
  switch (n.label) {
3112
3112
  case 0:
@@ -3117,7 +3117,7 @@ function tn(t, r) {
3117
3117
  }, [ 4 /*yield*/ , e.R("BatchGetDocuments", i, o, r.length) ];
3118
3118
 
3119
3119
  case 1:
3120
- return a = n.sent(), s = new Map, a.forEach((function(t) {
3120
+ return s = n.sent(), a = new Map, s.forEach((function(t) {
3121
3121
  var n = function(t, e) {
3122
3122
  return "found" in e ? function(t, e) {
3123
3123
  k(!!e.found), e.found.name, e.found.updateTime;
@@ -3133,9 +3133,9 @@ function tn(t, r) {
3133
3133
  return Jt.newNoDocument(n, r);
3134
3134
  }(t, e) : E();
3135
3135
  }(e.C, t);
3136
- s.set(n.key.toString(), n);
3136
+ a.set(n.key.toString(), n);
3137
3137
  })), u = [], [ 2 /*return*/ , (r.forEach((function(t) {
3138
- var e = s.get(t.toString());
3138
+ var e = a.get(t.toString());
3139
3139
  k(!!e), u.push(e);
3140
3140
  })), u) ];
3141
3141
  }
@@ -3222,14 +3222,14 @@ function en(t, r) {
3222
3222
  }));
3223
3223
  }(e.orderBy);
3224
3224
  o && (n.structuredQuery.orderBy = o);
3225
- var a, s = function(t, e) {
3225
+ var s, a = function(t, e) {
3226
3226
  return t.k || ct(e) ? e : {
3227
3227
  value: e
3228
3228
  };
3229
3229
  }(t, e.limit);
3230
- return null !== s && (n.structuredQuery.limit = s), e.startAt && (n.structuredQuery.startAt = {
3231
- before: (a = e.startAt).inclusive,
3232
- values: a.position
3230
+ return null !== a && (n.structuredQuery.limit = a), e.startAt && (n.structuredQuery.startAt = {
3231
+ before: (s = e.startAt).inclusive,
3232
+ values: s.position
3233
3233
  }), e.endAt && (n.structuredQuery.endAt = function(t) {
3234
3234
  return {
3235
3235
  before: !t.inclusive,
@@ -3249,8 +3249,8 @@ function en(t, r) {
3249
3249
  mapValue: {
3250
3250
  fields: e.fields
3251
3251
  }
3252
- }), a = Jt.newFoundDocument(r, i, o);
3253
- return a;
3252
+ }), s = Jt.newFoundDocument(r, i, o);
3253
+ return s;
3254
3254
  }(e.C, t.document);
3255
3255
  })) ];
3256
3256
  }
@@ -3289,13 +3289,13 @@ function en(t, r) {
3289
3289
  w("ComponentProvider", "Initializing Datastore");
3290
3290
  var e = function(t) {
3291
3291
  return new yt(t, fetch.bind(null));
3292
- }((i = t._databaseId, o = t.app.options.appId || "", a = t._persistenceKey, s = t._freezeSettings(),
3293
- new X(i, o, a, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), n = Xe(t._databaseId), r = function(t, e, n, r) {
3292
+ }((i = t._databaseId, o = t.app.options.appId || "", s = t._persistenceKey, a = t._freezeSettings(),
3293
+ new X(i, o, s, a.host, a.ssl, a.experimentalForceLongPolling, a.experimentalAutoDetectLongPolling, a.useFetchStreams))), n = Xe(t._databaseId), r = function(t, e, n, r) {
3294
3294
  return new Ze(t, e, n, r);
3295
3295
  }(t._authCredentials, t._appCheckCredentials, e, n);
3296
3296
  nn.set(t, r);
3297
3297
  }
3298
- var i, o, a, s;
3298
+ var i, o, s, a;
3299
3299
  /**
3300
3300
  * @license
3301
3301
  * Copyright 2018 Google LLC
@@ -3342,19 +3342,16 @@ function en(t, r) {
3342
3342
  return t.prototype.isEqual = function(t) {
3343
3343
  return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;
3344
3344
  }, t;
3345
- }(), an = /** @class */ function() {
3345
+ }(), sn = /** @class */ function() {
3346
3346
  /** @hideconstructor */
3347
- function t(t, e, n) {
3348
- this._authCredentials = e, this._appCheckCredentials = n,
3347
+ function t(t, e, n, r) {
3348
+ this._authCredentials = t, this._appCheckCredentials = e, this._databaseId = n,
3349
+ this._app = r,
3349
3350
  /**
3350
3351
  * Whether it's a Firestore or Firestore Lite instance.
3351
3352
  */
3352
3353
  this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new on({}),
3353
- this._settingsFrozen = !1, t instanceof J ? this._databaseId = t : (this._app = t,
3354
- this._databaseId = function(t) {
3355
- if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new M(V, '"projectId" not provided in firebase.initializeApp.');
3356
- return new J(t.options.projectId);
3357
- }(t));
3354
+ this._settingsFrozen = !1;
3358
3355
  }
3359
3356
  return Object.defineProperty(t.prototype, "app", {
3360
3357
  /**
@@ -3443,24 +3440,21 @@ function en(t, r) {
3443
3440
  * The Cloud Firestore service interface.
3444
3441
  *
3445
3442
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
3446
- */ function sn(t, e) {
3447
- var n = _getProvider(t, "firestore/lite");
3448
- if (n.isInitialized()) throw new M(R, "Firestore can only be initialized once per app.");
3449
- return n.initialize({
3450
- options: e
3443
+ */ function an(t, e, n) {
3444
+ n || (n = "(default)");
3445
+ var r = _getProvider(t, "firestore/lite");
3446
+ if (r.isInitialized(n)) throw new M(R, "Firestore can only be initialized once per app.");
3447
+ return r.initialize({
3448
+ options: e,
3449
+ instanceIdentifier: n
3451
3450
  });
3452
3451
  }
3453
3452
 
3454
- /**
3455
- * Returns the existing `Firestore` instance that is associated with the
3456
- * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
3457
- * instance with default settings.
3458
- *
3459
- * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned `Firestore`
3460
- * instance is associated with.
3461
- * @returns The `Firestore` instance of the provided app.
3462
- */ function un(t) {
3463
- return void 0 === t && (t = s()), _getProvider(t, "firestore/lite").getImmediate();
3453
+ function un(t, e) {
3454
+ var n = "object" == typeof t ? t : a(), r = "string" == typeof t ? t : e || "(default)";
3455
+ return _getProvider(n, "firestore/lite").getImmediate({
3456
+ identifier: r
3457
+ });
3464
3458
  }
3465
3459
 
3466
3460
  /**
@@ -3478,22 +3472,22 @@ function en(t, r) {
3478
3472
  */ function cn(t, e, n, r) {
3479
3473
  var i;
3480
3474
  void 0 === r && (r = {});
3481
- var o = (t = st(t, an))._getSettings();
3475
+ var o = (t = at(t, sn))._getSettings();
3482
3476
  if ("firestore.googleapis.com" !== o.host && o.host !== e && _("Host has been set in both settings() and useEmulator(), emulator host will be used"),
3483
3477
  t._setSettings(Object.assign(Object.assign({}, o), {
3484
3478
  host: e + ":" + n,
3485
3479
  ssl: !1
3486
3480
  })), r.mockUserToken) {
3487
- var a, s;
3488
- if ("string" == typeof r.mockUserToken) a = r.mockUserToken, s = y.MOCK_USER; else {
3481
+ var s, a;
3482
+ if ("string" == typeof r.mockUserToken) s = r.mockUserToken, a = y.MOCK_USER; else {
3489
3483
  // Let createMockUserToken validate first (catches common mistakes like
3490
3484
  // invalid field "uid" and missing field "sub" / "user_id".)
3491
- a = d(r.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);
3485
+ s = d(r.mockUserToken, null === (i = t._app) || void 0 === i ? void 0 : i.options.projectId);
3492
3486
  var u = r.mockUserToken.sub || r.mockUserToken.user_id;
3493
3487
  if (!u) throw new M(V, "mockUserToken must contain 'sub' or 'user_id' field!");
3494
- s = new y(u);
3488
+ a = new y(u);
3495
3489
  }
3496
- t._authCredentials = new z(new B(a, s));
3490
+ t._authCredentials = new z(new B(s, a));
3497
3491
  }
3498
3492
  }
3499
3493
 
@@ -3517,7 +3511,7 @@ function en(t, r) {
3517
3511
  * @returns A `Promise` that is resolved when the instance has been successfully
3518
3512
  * terminated.
3519
3513
  */ function ln(t) {
3520
- return t = st(t, an), u(t.app, "firestore/lite"), t._delete()
3514
+ return t = at(t, sn), u(t.app, "firestore/lite"), t._delete()
3521
3515
  /**
3522
3516
  * @license
3523
3517
  * Copyright 2020 Google LLC
@@ -3666,14 +3660,14 @@ var fn = /** @class */ function() {
3666
3660
  * construct refined `Query` objects by adding filters and ordering.
3667
3661
  */ function dn(t, e) {
3668
3662
  for (var n = [], i = 2; i < arguments.length; i++) n[i - 2] = arguments[i];
3669
- if (t = p(t), rt("collection", "path", e), t instanceof an) {
3663
+ if (t = p(t), rt("collection", "path", e), t instanceof sn) {
3670
3664
  var o = $.fromString.apply($, r([ e ], n));
3671
3665
  return ot(o), new pn(t, /* converter= */ null, o);
3672
3666
  }
3673
3667
  if (!(t instanceof fn || t instanceof pn)) throw new M(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3674
- var a = t._path.child($.fromString.apply($, r([ e ], n)));
3675
- return ot(a), new pn(t.firestore,
3676
- /* converter= */ null, a);
3668
+ var s = t._path.child($.fromString.apply($, r([ e ], n)));
3669
+ return ot(s), new pn(t.firestore,
3670
+ /* converter= */ null, s);
3677
3671
  }
3678
3672
 
3679
3673
  // TODO(firestorelite): Consider using ErrorFactory -
@@ -3689,7 +3683,7 @@ var fn = /** @class */ function() {
3689
3683
  * will be included. Cannot contain a slash.
3690
3684
  * @returns The created `Query`.
3691
3685
  */ function yn(t, e) {
3692
- if (t = st(t, an), rt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new M(V, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
3686
+ if (t = at(t, sn), rt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new M(V, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
3693
3687
  return new hn(t,
3694
3688
  /* converter= */ null,
3695
3689
  /**
@@ -3706,14 +3700,14 @@ function mn(t, e) {
3706
3700
  if (t = p(t),
3707
3701
  // We allow omission of 'pathString' but explicitly prohibit passing in both
3708
3702
  // 'undefined' and 'null'.
3709
- 1 === arguments.length && (e = vt.N()), rt("doc", "path", e), t instanceof an) {
3703
+ 1 === arguments.length && (e = vt.N()), rt("doc", "path", e), t instanceof sn) {
3710
3704
  var o = $.fromString.apply($, r([ e ], n));
3711
3705
  return it(o), new fn(t,
3712
3706
  /* converter= */ null, new nt(o));
3713
3707
  }
3714
3708
  if (!(t instanceof fn || t instanceof pn)) throw new M(V, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3715
- var a = t._path.child($.fromString.apply($, r([ e ], n)));
3716
- return it(a), new fn(t.firestore, t instanceof pn ? t.converter : null, new nt(a));
3709
+ var s = t._path.child($.fromString.apply($, r([ e ], n)));
3710
+ return it(s), new fn(t.firestore, t instanceof pn ? t.converter : null, new nt(s));
3717
3711
  }
3718
3712
 
3719
3713
  /**
@@ -4098,20 +4092,20 @@ function(t) {
4098
4092
 
4099
4093
  /** Parse document data from a set() call. */ function Nn(t, e, n, r, i, o) {
4100
4094
  void 0 === o && (o = {});
4101
- var a = t.dt(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
4102
- zn("Data must be an object, but it was:", a, r);
4103
- var s, u, c = Bn(r, a);
4104
- if (o.merge) s = new Pt(a.fieldMask), u = a.fieldTransforms; else if (o.mergeFields) {
4095
+ var s = t.dt(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
4096
+ zn("Data must be an object, but it was:", s, r);
4097
+ var a, u, c = Bn(r, s);
4098
+ if (o.merge) a = new Pt(s.fieldMask), u = s.fieldTransforms; else if (o.mergeFields) {
4105
4099
  for (var l = [], f = 0, h = o.mergeFields; f < h.length; f++) {
4106
4100
  var p = Kn(e, h[f], n);
4107
- if (!a.contains(p)) throw new M(V, "Field '" + p + "' is specified in your field mask but missing from your input data.");
4101
+ if (!s.contains(p)) throw new M(V, "Field '" + p + "' is specified in your field mask but missing from your input data.");
4108
4102
  Yn(l, p) || l.push(p);
4109
4103
  }
4110
- s = new Pt(l), u = a.fieldTransforms.filter((function(t) {
4111
- return s.covers(t.field);
4104
+ a = new Pt(l), u = s.fieldTransforms.filter((function(t) {
4105
+ return a.covers(t.field);
4112
4106
  }));
4113
- } else s = null, u = a.fieldTransforms;
4114
- return new Sn(new Xt(c), s, u);
4107
+ } else a = null, u = s.fieldTransforms;
4108
+ return new Sn(new Xt(c), a, u);
4115
4109
  }
4116
4110
 
4117
4111
  var Fn = /** @class */ function(e) {
@@ -4208,36 +4202,36 @@ var Rn = /** @class */ function(e) {
4208
4202
  /** Parse update data from an update() call. */ function Ln(t, e, n, r) {
4209
4203
  var i = t.dt(1 /* Update */ , e, n);
4210
4204
  zn("Data must be an object, but it was:", i, r);
4211
- var o = [], a = Xt.empty();
4205
+ var o = [], s = Xt.empty();
4212
4206
  Et(r, (function(t, r) {
4213
- var s = Qn(e, t, n);
4207
+ var a = Qn(e, t, n);
4214
4208
  // For Compat types, we have to "extract" the underlying types before
4215
4209
  // performing validation.
4216
4210
  r = p(r);
4217
- var u = i.ct(s);
4211
+ var u = i.ct(a);
4218
4212
  if (r instanceof Fn)
4219
4213
  // Add it to the field mask, but don't add anything to updateData.
4220
- o.push(s); else {
4214
+ o.push(a); else {
4221
4215
  var c = Un(r, u);
4222
- null != c && (o.push(s), a.set(s, c));
4216
+ null != c && (o.push(a), s.set(a, c));
4223
4217
  }
4224
4218
  }));
4225
- var s = new Pt(o);
4226
- return new In(a, s, i.fieldTransforms);
4219
+ var a = new Pt(o);
4220
+ return new In(s, a, i.fieldTransforms);
4227
4221
  }
4228
4222
 
4229
4223
  /** Parse update data from a list of field/value arguments. */ function jn(t, e, n, r, i, o) {
4230
- var a = t.dt(1 /* Update */ , e, n), s = [ Kn(e, r, n) ], u = [ i ];
4224
+ var s = t.dt(1 /* Update */ , e, n), a = [ Kn(e, r, n) ], u = [ i ];
4231
4225
  if (o.length % 2 != 0) throw new M(V, "Function " + e + "() needs to be called with an even number of arguments that alternate between field names and values.");
4232
- for (var c = 0; c < o.length; c += 2) s.push(Kn(e, o[c])), u.push(o[c + 1]);
4226
+ for (var c = 0; c < o.length; c += 2) a.push(Kn(e, o[c])), u.push(o[c + 1]);
4233
4227
  // We iterate in reverse order to pick the last value for a field if the
4234
4228
  // user specified the field multiple times.
4235
- for (var l = [], f = Xt.empty(), h = s.length - 1; h >= 0; --h) if (!Yn(l, s[h])) {
4236
- var d = s[h], y = u[h];
4229
+ for (var l = [], f = Xt.empty(), h = a.length - 1; h >= 0; --h) if (!Yn(l, a[h])) {
4230
+ var d = a[h], y = u[h];
4237
4231
  // For Compat types, we have to "extract" the underlying types before
4238
4232
  // performing validation.
4239
4233
  y = p(y);
4240
- var m = a.ct(d);
4234
+ var m = s.ct(d);
4241
4235
  if (y instanceof Fn)
4242
4236
  // Add it to the field mask, but don't add anything to updateData.
4243
4237
  l.push(d); else {
@@ -4246,7 +4240,7 @@ var Rn = /** @class */ function(e) {
4246
4240
  }
4247
4241
  }
4248
4242
  var g = new Pt(l);
4249
- return new In(f, g, a.fieldTransforms);
4243
+ return new In(f, g, s.fieldTransforms);
4250
4244
  }
4251
4245
 
4252
4246
  /**
@@ -4307,13 +4301,13 @@ var Rn = /** @class */ function(e) {
4307
4301
  if (e.settings.ot && 4 /* ArrayArgument */ !== e.rt) throw e.ht("Nested arrays are not supported");
4308
4302
  return function(t, e) {
4309
4303
  for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {
4310
- var a = Un(o[i], e.at(r));
4311
- null == a && (
4304
+ var s = Un(o[i], e.at(r));
4305
+ null == s && (
4312
4306
  // Just include nulls in the array for fields being replaced with a
4313
4307
  // sentinel.
4314
- a = {
4308
+ s = {
4315
4309
  nullValue: "NULL_VALUE"
4316
- }), n.push(a), r++;
4310
+ }), n.push(s), r++;
4317
4311
  }
4318
4312
  return {
4319
4313
  arrayValue: {
@@ -4364,7 +4358,7 @@ var Rn = /** @class */ function(e) {
4364
4358
  referenceValue: je(t.firestore._databaseId || e.databaseId, t._key.path)
4365
4359
  };
4366
4360
  }
4367
- throw e.ht("Unsupported field value: " + at(t));
4361
+ throw e.ht("Unsupported field value: " + st(t));
4368
4362
  }(t, e);
4369
4363
  }
4370
4364
 
@@ -4394,7 +4388,7 @@ function zn(t, e, n) {
4394
4388
  if (!Gn(n) || !function(t) {
4395
4389
  return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
4396
4390
  }(n)) {
4397
- var r = at(n);
4391
+ var r = st(n);
4398
4392
  throw "an object" === r ? e.ht(t + " a custom object") : e.ht(t + " " + r);
4399
4393
  }
4400
4394
  }
@@ -4438,11 +4432,11 @@ function zn(t, e, n) {
4438
4432
  }
4439
4433
 
4440
4434
  function Hn(t, e, n, r, i) {
4441
- var o = r && !r.isEmpty(), a = void 0 !== i, s = "Function " + e + "() called with invalid data";
4442
- n && (s += " (via `toFirestore()`)");
4435
+ var o = r && !r.isEmpty(), s = void 0 !== i, a = "Function " + e + "() called with invalid data";
4436
+ n && (a += " (via `toFirestore()`)");
4443
4437
  var u = "";
4444
- return (o || a) && (u += " (found", o && (u += " in field " + r), a && (u += " in document " + i),
4445
- u += ")"), new M(V, (s += ". ") + t + u)
4438
+ return (o || s) && (u += " (found", o && (u += " in field " + r), s && (u += " in document " + i),
4439
+ u += ")"), new M(V, (a += ". ") + t + u)
4446
4440
  /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
4447
4441
  }
4448
4442
 
@@ -4672,26 +4666,26 @@ var rr = /** @class */ function(e) {
4672
4666
  i;
4673
4667
  }
4674
4668
  return t(n, e), n.prototype._apply = function(t) {
4675
- var e = Dn(t.firestore), n = function(t, e, n, r, i, o, a) {
4676
- var s;
4669
+ var e = Dn(t.firestore), n = function(t, e, n, r, i, o, s) {
4670
+ var a;
4677
4671
  if (i.isKeyField()) {
4678
4672
  if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new M(V, "Invalid Query. You can't perform '" + o + "' queries on documentId().");
4679
4673
  if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
4680
- gr(a, o);
4681
- for (var u = [], c = 0, l = a; c < l.length; c++) {
4674
+ gr(s, o);
4675
+ for (var u = [], c = 0, l = s; c < l.length; c++) {
4682
4676
  var f = l[c];
4683
4677
  u.push(vr(r, t, f));
4684
4678
  }
4685
- s = {
4679
+ a = {
4686
4680
  arrayValue: {
4687
4681
  values: u
4688
4682
  }
4689
4683
  };
4690
- } else s = vr(r, t, a);
4691
- } else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || gr(a, o),
4692
- s = Mn(n, "where", a,
4684
+ } else a = vr(r, t, s);
4685
+ } else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || gr(s, o),
4686
+ a = Mn(n, "where", s,
4693
4687
  /* allowArrays= */ "in" /* IN */ === o || "not-in" /* NOT_IN */ === o);
4694
- var h = te.create(i, o, s);
4688
+ var h = te.create(i, o, a);
4695
4689
  return function(t, e) {
4696
4690
  if (e.S()) {
4697
4691
  var n = ye(t);
@@ -4800,13 +4794,13 @@ var or = /** @class */ function(e) {
4800
4794
  * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
4801
4795
  * not specified, order will be ascending.
4802
4796
  * @returns The created {@link Query}.
4803
- */ function ar(t, e) {
4797
+ */ function sr(t, e) {
4804
4798
  void 0 === e && (e = "asc");
4805
4799
  var n = e, r = tr("orderBy", t);
4806
4800
  return new or(r, n);
4807
4801
  }
4808
4802
 
4809
- var sr = /** @class */ function(e) {
4803
+ var ar = /** @class */ function(e) {
4810
4804
  function n(t, n, r) {
4811
4805
  var i = this;
4812
4806
  return (i = e.call(this) || this).type = t, i.Et = n, i.Tt = r, i;
@@ -4824,7 +4818,7 @@ var sr = /** @class */ function(e) {
4824
4818
  * @param limit - The maximum number of items to return.
4825
4819
  * @returns The created {@link Query}.
4826
4820
  */ function ur(t) {
4827
- return ut("limit", t), new sr("limit", t, "F" /* First */)
4821
+ return ut("limit", t), new ar("limit", t, "F" /* First */)
4828
4822
  /**
4829
4823
  * Creates a {@link QueryConstraint} that only returns the last matching documents.
4830
4824
  *
@@ -4837,7 +4831,7 @@ var sr = /** @class */ function(e) {
4837
4831
  }
4838
4832
 
4839
4833
  function cr(t) {
4840
- return ut("limitToLast", t), new sr("limitToLast", t, "L" /* Last */);
4834
+ return ut("limitToLast", t), new ar("limitToLast", t, "L" /* Last */);
4841
4835
  }
4842
4836
 
4843
4837
  var lr = /** @class */ function(e) {
@@ -4899,8 +4893,8 @@ function yr() {
4899
4893
  // the provided document. Without the key (by using the explicit sort
4900
4894
  // orders), multiple documents could match the position, yielding duplicate
4901
4895
  // results.
4902
- for (var o = [], a = 0, s = ve(t); a < s.length; a++) {
4903
- var u = s[a];
4896
+ for (var o = [], s = 0, a = ve(t); s < a.length; s++) {
4897
+ var u = a[s];
4904
4898
  if (u.field.isKeyField()) o.push(zt(e, r.key)); else {
4905
4899
  var c = r.data.field(u.field);
4906
4900
  if (qt(c)) throw new M(V, 'Invalid query. You are trying to start or end a query using a document for which the field "' + u.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
@@ -4916,23 +4910,23 @@ function yr() {
4916
4910
  var i = Dn(t.firestore);
4917
4911
  return function(t, e, n, r, i, o) {
4918
4912
  // Use explicit order by's because it has to match the query the user made
4919
- var a = t.explicitOrderBy;
4920
- if (i.length > a.length) throw new M(V, "Too many arguments provided to " + r + "(). The number of arguments must be less than or equal to the number of orderBy() clauses");
4921
- for (var s = [], u = 0; u < i.length; u++) {
4913
+ var s = t.explicitOrderBy;
4914
+ if (i.length > s.length) throw new M(V, "Too many arguments provided to " + r + "(). The number of arguments must be less than or equal to the number of orderBy() clauses");
4915
+ for (var a = [], u = 0; u < i.length; u++) {
4922
4916
  var c = i[u];
4923
- if (a[u].field.isKeyField()) {
4917
+ if (s[u].field.isKeyField()) {
4924
4918
  if ("string" != typeof c) throw new M(V, "Invalid query. Expected a string for document ID in " + r + "(), but got a " + typeof c);
4925
4919
  if (!me(t) && -1 !== c.indexOf("/")) throw new M(V, "Invalid query. When querying a collection and ordering by documentId(), the value passed to " + r + "() must be a plain document ID, but '" + c + "' contains a slash.");
4926
4920
  var l = t.path.child($.fromString(c));
4927
4921
  if (!nt.isDocumentKey(l)) throw new M(V, "Invalid query. When querying a collection group and ordering by documentId(), the value passed to " + r + "() must result in a valid document path, but '" + l + "' is not because it contains an odd number of segments.");
4928
4922
  var f = new nt(l);
4929
- s.push(zt(e, f));
4923
+ a.push(zt(e, f));
4930
4924
  } else {
4931
4925
  var h = Mn(n, r, c);
4932
- s.push(h);
4926
+ a.push(h);
4933
4927
  }
4934
4928
  }
4935
- return new ce(s, o);
4929
+ return new ce(a, o);
4936
4930
  }(t._query, t.firestore._databaseId, i, e, n, r);
4937
4931
  }
4938
4932
 
@@ -4945,7 +4939,7 @@ function vr(t, e, n) {
4945
4939
  return zt(t, new nt(r));
4946
4940
  }
4947
4941
  if (n instanceof fn) return zt(t, n._key);
4948
- throw new M(V, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + at(n) + ".");
4942
+ throw new M(V, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + st(n) + ".");
4949
4943
  }
4950
4944
 
4951
4945
  /**
@@ -5115,7 +5109,7 @@ var _r = /** @class */ function(e) {
5115
5109
  * @returns A Promise resolved with a `DocumentSnapshot` containing the current
5116
5110
  * document contents.
5117
5111
  */ function Tr(t) {
5118
- var e = rn((t = st(t, fn)).firestore), n = new _r(t.firestore);
5112
+ var e = rn((t = at(t, fn)).firestore), n = new _r(t.firestore);
5119
5113
  return tn(e, [ t._key ]).then((function(e) {
5120
5114
  k(1 === e.length);
5121
5115
  var r = e[0];
@@ -5137,7 +5131,7 @@ var _r = /** @class */ function(e) {
5137
5131
  */ function Er(t) {
5138
5132
  !function(t) {
5139
5133
  if ("L" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new M(x, "limitToLast() queries require specifying at least one orderBy() clause");
5140
- }((t = st(t, hn))._query);
5134
+ }((t = at(t, hn))._query);
5141
5135
  var e = rn(t.firestore), n = new _r(t.firestore);
5142
5136
  return en(e, t._query).then((function(e) {
5143
5137
  var r = e.map((function(e) {
@@ -5152,16 +5146,16 @@ var _r = /** @class */ function(e) {
5152
5146
  }
5153
5147
 
5154
5148
  function kr(t, e, n) {
5155
- var r = br((t = st(t, fn)).converter, e, n), i = Nn(Dn(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
5149
+ var r = br((t = at(t, fn)).converter, e, n), i = Nn(Dn(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
5156
5150
  return $e(rn(t.firestore), [ i.toMutation(t._key, Ie.none()) ]);
5157
5151
  }
5158
5152
 
5159
5153
  function Sr(t, e, n) {
5160
5154
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
5161
- var o, a = Dn((t = st(t, fn)).firestore);
5155
+ var o, s = Dn((t = at(t, fn)).firestore);
5162
5156
  // For Compat types, we have to "extract" the underlying types before
5163
5157
  // performing validation.
5164
- return o = "string" == typeof (e = p(e)) || e instanceof wn ? jn(a, "updateDoc", t._key, e, n, r) : Ln(a, "updateDoc", t._key, e),
5158
+ return o = "string" == typeof (e = p(e)) || e instanceof wn ? jn(s, "updateDoc", t._key, e, n, r) : Ln(s, "updateDoc", t._key, e),
5165
5159
  $e(rn(t.firestore), [ o.toMutation(t._key, Ie.exists(!0)) ]);
5166
5160
  }
5167
5161
 
@@ -5177,7 +5171,7 @@ function Sr(t, e, n) {
5177
5171
  * @returns A `Promise` resolved once the document has been successfully
5178
5172
  * deleted from the backend.
5179
5173
  */ function Ir(t) {
5180
- return $e(rn((t = st(t, fn)).firestore), [ new De(t._key, Ie.none()) ]);
5174
+ return $e(rn((t = at(t, fn)).firestore), [ new De(t._key, Ie.none()) ]);
5181
5175
  }
5182
5176
 
5183
5177
  /**
@@ -5195,7 +5189,7 @@ function Sr(t, e, n) {
5195
5189
  * @returns A `Promise` resolved with a `DocumentReference` pointing to the
5196
5190
  * newly created document after it has been written to the backend.
5197
5191
  */ function Ar(t, e) {
5198
- var n = mn(t = st(t, pn)), r = br(t.converter, e), i = Nn(Dn(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
5192
+ var n = mn(t = at(t, pn)), r = br(t.converter, e), i = Nn(Dn(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
5199
5193
  return $e(rn(t.firestore), [ i.toMutation(n._key, Ie.exists(!1)) ]).then((function() {
5200
5194
  return n;
5201
5195
  }));
@@ -5324,11 +5318,11 @@ function Sr(t, e, n) {
5324
5318
  }, t.prototype.update = function(t, e, n) {
5325
5319
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
5326
5320
  this._verifyNotCommitted();
5327
- var o, a = Rr(t, this._firestore);
5321
+ var o, s = Rr(t, this._firestore);
5328
5322
  // For Compat types, we have to "extract" the underlying types before
5329
5323
  // performing validation.
5330
- return o = "string" == typeof (e = p(e)) || e instanceof wn ? jn(this._dataReader, "WriteBatch.update", a._key, e, n, r) : Ln(this._dataReader, "WriteBatch.update", a._key, e),
5331
- this._mutations.push(o.toMutation(a._key, Ie.exists(!0))), this;
5324
+ return o = "string" == typeof (e = p(e)) || e instanceof wn ? jn(this._dataReader, "WriteBatch.update", s._key, e, n, r) : Ln(this._dataReader, "WriteBatch.update", s._key, e),
5325
+ this._mutations.push(o.toMutation(s._key, Ie.exists(!0))), this;
5332
5326
  },
5333
5327
  /**
5334
5328
  * Deletes the document referred to by the provided {@link DocumentReference}.
@@ -5378,7 +5372,7 @@ function Rr(t, e) {
5378
5372
  * @returns A `WriteBatch` that can be used to atomically execute multiple
5379
5373
  * writes.
5380
5374
  */ function qr(t) {
5381
- var e = rn(t = st(t, an));
5375
+ var e = rn(t = at(t, sn));
5382
5376
  return new Or(t, (function(t) {
5383
5377
  return $e(e, t);
5384
5378
  }));
@@ -5477,7 +5471,7 @@ function Rr(t, e) {
5477
5471
  var e;
5478
5472
  if (t.isFoundDocument()) e = t.version; else {
5479
5473
  if (!t.isNoDocument()) throw E();
5480
- // For deleted docs, we must use baseVersion 0 when we overwrite them.
5474
+ // Represent a deleted doc using SnapshotVersion.min().
5481
5475
  e = _t.min();
5482
5476
  }
5483
5477
  var n = this.readVersions.get(t.key.toString());
@@ -5493,7 +5487,7 @@ function Rr(t, e) {
5493
5487
  */
5494
5488
  t.prototype.precondition = function(t) {
5495
5489
  var e = this.readVersions.get(t.toString());
5496
- return !this.writtenDocs.has(t.toString()) && e ? Ie.updateTime(e) : Ie.none();
5490
+ return !this.writtenDocs.has(t.toString()) && e ? e.isEqual(_t.min()) ? Ie.exists(!1) : Ie.updateTime(e) : Ie.none();
5497
5491
  },
5498
5492
  /**
5499
5493
  * Returns the precondition for a document if the operation is an update.
@@ -5703,8 +5697,8 @@ function Rr(t, e) {
5703
5697
  */;
5704
5698
  }
5705
5699
  return t.createAndSchedule = function(e, n, r, i, o) {
5706
- var a = new t(e, n, Date.now() + r, i, o);
5707
- return a.start(r), a;
5700
+ var s = new t(e, n, Date.now() + r, i, o);
5701
+ return s.start(r), s;
5708
5702
  },
5709
5703
  /**
5710
5704
  * Starts the timer. This is called immediately after construction by
@@ -5997,11 +5991,11 @@ function Rr(t, e) {
5997
5991
  return this._transaction.set(r._key, o), this;
5998
5992
  }, t.prototype.update = function(t, e, n) {
5999
5993
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
6000
- var o, a = Rr(t, this._firestore);
5994
+ var o, s = Rr(t, this._firestore);
6001
5995
  // For Compat types, we have to "extract" the underlying types before
6002
5996
  // performing validation.
6003
- return o = "string" == typeof (e = p(e)) || e instanceof wn ? jn(this._dataReader, "Transaction.update", a._key, e, n, r) : Ln(this._dataReader, "Transaction.update", a._key, e),
6004
- this._transaction.update(a._key, o), this;
5997
+ return o = "string" == typeof (e = p(e)) || e instanceof wn ? jn(this._dataReader, "Transaction.update", s._key, e, n, r) : Ln(this._dataReader, "Transaction.update", s._key, e),
5998
+ this._transaction.update(s._key, o), this;
6005
5999
  },
6006
6000
  /**
6007
6001
  * Deletes the document referred to by the provided {@link DocumentReference}.
@@ -6051,7 +6045,7 @@ function Rr(t, e) {
6051
6045
  * rejected promise with the corresponding failure error is returned.
6052
6046
  */
6053
6047
  function Gr(t, e, n) {
6054
- var r = rn(t = st(t, an)), i = Object.assign(Object.assign({}, xr), n);
6048
+ var r = rn(t = at(t, sn)), i = Object.assign(Object.assign({}, xr), n);
6055
6049
  !function(t) {
6056
6050
  if (t.maxAttempts < 1) throw new M(V, "Max attempts must be at least 1");
6057
6051
  }(i);
@@ -6070,11 +6064,14 @@ function Gr(t, e, n) {
6070
6064
  }
6071
6065
 
6072
6066
  m = i + "_lite", o(new c("firestore/lite", (function(t, e) {
6073
- var n = e.options, r = t.getProvider("app").getImmediate(), i = new an(r, new K(t.getProvider("auth-internal")), new Y(t.getProvider("app-check-internal")));
6074
- return n && i._setSettings(n), i;
6075
- }), "PUBLIC")),
6067
+ var n = e.instanceIdentifier, r = e.options, i = t.getProvider("app").getImmediate(), o = new sn(new K(t.getProvider("auth-internal")), new Y(t.getProvider("app-check-internal")), function(t, e) {
6068
+ if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new M(V, '"projectId" not provided in firebase.initializeApp.');
6069
+ return new J(t.options.projectId, e);
6070
+ }(i, n), i);
6071
+ return r && o._setSettings(r), o;
6072
+ }), "PUBLIC").setMultipleInstances(!0)),
6076
6073
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
6077
- a("firestore-lite", "3.4.14-canary.fcd4b8ac3", ""), a("firestore-lite", "3.4.14-canary.fcd4b8ac3", "esm5");
6074
+ s("firestore-lite", "3.4.15", ""), s("firestore-lite", "3.4.15", "esm5");
6078
6075
 
6079
- export { _n as Bytes, pn as CollectionReference, fn as DocumentReference, Xn as DocumentSnapshot, wn as FieldPath, Tn as FieldValue, an as Firestore, M as FirestoreError, En as GeoPoint, hn as Query, er as QueryConstraint, Jn as QueryDocumentSnapshot, Zn as QuerySnapshot, bt as Timestamp, Br as Transaction, Or as WriteBatch, Ar as addDoc, Nr as arrayRemove, Dr as arrayUnion, dn as collection, yn as collectionGroup, cn as connectFirestoreEmulator, Ir as deleteDoc, Vr as deleteField, mn as doc, bn as documentId, yr as endAt, dr as endBefore, Tr as getDoc, Er as getDocs, un as getFirestore, Fr as increment, sn as initializeFirestore, ur as limit, cr as limitToLast, ar as orderBy, nr as query, gn as queryEqual, vn as refEqual, Gr as runTransaction, Pr as serverTimestamp, kr as setDoc, g as setLogLevel, $n as snapshotEqual, hr as startAfter, fr as startAt, ln as terminate, Sr as updateDoc, ir as where, qr as writeBatch };
6076
+ export { _n as Bytes, pn as CollectionReference, fn as DocumentReference, Xn as DocumentSnapshot, wn as FieldPath, Tn as FieldValue, sn as Firestore, M as FirestoreError, En as GeoPoint, hn as Query, er as QueryConstraint, Jn as QueryDocumentSnapshot, Zn as QuerySnapshot, bt as Timestamp, Br as Transaction, Or as WriteBatch, Ar as addDoc, Nr as arrayRemove, Dr as arrayUnion, dn as collection, yn as collectionGroup, cn as connectFirestoreEmulator, Ir as deleteDoc, Vr as deleteField, mn as doc, bn as documentId, yr as endAt, dr as endBefore, Tr as getDoc, Er as getDocs, un as getFirestore, Fr as increment, an as initializeFirestore, ur as limit, cr as limitToLast, sr as orderBy, nr as query, gn as queryEqual, vn as refEqual, Gr as runTransaction, Pr as serverTimestamp, kr as setDoc, g as setLogLevel, $n as snapshotEqual, hr as startAfter, fr as startAt, ln as terminate, Sr as updateDoc, ir as where, qr as writeBatch };
6080
6077
  //# sourceMappingURL=index.browser.esm5.js.map