@firebase/firestore 3.4.13 → 3.4.14-canary.47895fe5b

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 (77) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/firestore/src/api/credentials.d.ts +13 -3
  3. package/dist/firestore/src/api/index_configuration.d.ts +7 -8
  4. package/dist/firestore/src/api.d.ts +1 -1
  5. package/dist/firestore/src/local/indexeddb_schema.d.ts +1 -3
  6. package/dist/firestore/src/local/local_store_impl.d.ts +2 -0
  7. package/dist/firestore/src/util/array.d.ts +18 -0
  8. package/dist/firestore/test/unit/local/counting_query_engine.d.ts +11 -0
  9. package/dist/firestore/test/unit/local/local_store_indexeddb.test.d.ts +17 -0
  10. package/dist/firestore/test/unit/specs/index_spec.test.d.ts +17 -0
  11. package/dist/firestore/test/unit/specs/spec_builder.d.ts +5 -0
  12. package/dist/firestore/test/unit/specs/spec_test_runner.d.ts +8 -0
  13. package/dist/firestore/test/unit/util/array.test.d.ts +17 -0
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.esm2017.js +3737 -3589
  16. package/dist/index.esm2017.js.map +1 -1
  17. package/dist/index.esm5.js +3721 -3604
  18. package/dist/index.esm5.js.map +1 -1
  19. package/dist/index.node.cjs.js +250 -53
  20. package/dist/index.node.cjs.js.map +1 -1
  21. package/dist/index.node.mjs +250 -53
  22. package/dist/index.node.mjs.map +1 -1
  23. package/dist/index.rn.js +3676 -3529
  24. package/dist/index.rn.js.map +1 -1
  25. package/dist/internal.d.ts +13 -13
  26. package/dist/lite/firestore/src/api/credentials.d.ts +13 -3
  27. package/dist/lite/firestore/src/api/index_configuration.d.ts +7 -8
  28. package/dist/lite/firestore/src/api.d.ts +1 -1
  29. package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +1 -3
  30. package/dist/lite/firestore/src/local/local_store_impl.d.ts +2 -0
  31. package/dist/lite/firestore/src/util/array.d.ts +18 -0
  32. package/dist/lite/firestore/test/unit/local/counting_query_engine.d.ts +11 -0
  33. package/dist/lite/firestore/test/unit/local/local_store_indexeddb.test.d.ts +17 -0
  34. package/dist/lite/firestore/test/unit/specs/index_spec.test.d.ts +17 -0
  35. package/dist/lite/firestore/test/unit/specs/spec_builder.d.ts +5 -0
  36. package/dist/lite/firestore/test/unit/specs/spec_test_runner.d.ts +8 -0
  37. package/dist/lite/firestore/test/unit/util/array.test.d.ts +17 -0
  38. package/dist/lite/index.browser.esm2017.js +232 -222
  39. package/dist/lite/index.browser.esm2017.js.map +1 -1
  40. package/dist/lite/index.browser.esm5.js +485 -469
  41. package/dist/lite/index.browser.esm5.js.map +1 -1
  42. package/dist/lite/index.node.cjs.js +36 -18
  43. package/dist/lite/index.node.cjs.js.map +1 -1
  44. package/dist/lite/index.node.mjs +36 -18
  45. package/dist/lite/index.node.mjs.map +1 -1
  46. package/dist/lite/index.rn.esm2017.js +232 -222
  47. package/dist/lite/index.rn.esm2017.js.map +1 -1
  48. package/dist/lite/internal.d.ts +3 -0
  49. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +23 -23
  50. package/dist/lite/packages/firestore/src/api/credentials.d.ts +13 -3
  51. package/dist/lite/packages/firestore/src/api/index_configuration.d.ts +7 -8
  52. package/dist/lite/packages/firestore/src/api.d.ts +1 -1
  53. package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +1 -3
  54. package/dist/lite/packages/firestore/src/local/local_store_impl.d.ts +2 -0
  55. package/dist/lite/packages/firestore/src/util/array.d.ts +18 -0
  56. package/dist/lite/packages/firestore/test/unit/local/counting_query_engine.d.ts +11 -0
  57. package/dist/lite/packages/firestore/test/unit/local/local_store_indexeddb.test.d.ts +17 -0
  58. package/dist/lite/packages/firestore/test/unit/specs/index_spec.test.d.ts +17 -0
  59. package/dist/lite/packages/firestore/test/unit/specs/spec_builder.d.ts +5 -0
  60. package/dist/lite/packages/firestore/test/unit/specs/spec_test_runner.d.ts +8 -0
  61. package/dist/lite/packages/firestore/test/unit/util/array.test.d.ts +17 -0
  62. package/dist/lite/private.d.ts +3 -0
  63. package/dist/packages/firestore/dist/index.esm2017.d.ts +193 -193
  64. package/dist/packages/firestore/src/api/credentials.d.ts +13 -3
  65. package/dist/packages/firestore/src/api/index_configuration.d.ts +7 -8
  66. package/dist/packages/firestore/src/api.d.ts +1 -1
  67. package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +1 -3
  68. package/dist/packages/firestore/src/local/local_store_impl.d.ts +2 -0
  69. package/dist/packages/firestore/src/util/array.d.ts +18 -0
  70. package/dist/packages/firestore/test/unit/local/counting_query_engine.d.ts +11 -0
  71. package/dist/packages/firestore/test/unit/local/local_store_indexeddb.test.d.ts +17 -0
  72. package/dist/packages/firestore/test/unit/specs/index_spec.test.d.ts +17 -0
  73. package/dist/packages/firestore/test/unit/specs/spec_builder.d.ts +5 -0
  74. package/dist/packages/firestore/test/unit/specs/spec_test_runner.d.ts +8 -0
  75. package/dist/packages/firestore/test/unit/util/array.test.d.ts +17 -0
  76. package/dist/private.d.ts +4 -1
  77. package/package.json +10 -9
@@ -63,7 +63,7 @@ l.MOCK_USER = new l("mock-user");
63
63
  * See the License for the specific language governing permissions and
64
64
  * limitations under the License.
65
65
  */
66
- let f = "9.9.1";
66
+ let f = "9.9.3-canary.47895fe5b";
67
67
 
68
68
  /**
69
69
  * @license
@@ -347,10 +347,22 @@ e) {
347
347
  * recover from unauthenticated errors (see b/33147818 for context), but it's
348
348
  * safer to keep the implementation as-is.
349
349
  */ class G {
350
- constructor(t, e, n) {
351
- this.type = "FirstParty", this.user = l.FIRST_PARTY, this.headers = new Map, this.headers.set("X-Goog-AuthUser", e);
352
- const r = t.auth.getAuthHeaderValueForFirstParty([]);
353
- r && this.headers.set("Authorization", r), n && this.headers.set("X-Goog-Iam-Authorization-Token", n);
350
+ constructor(t, e, n, r) {
351
+ this.t = t, this.i = e, this.o = n, this.u = r, this.type = "FirstParty", this.user = l.FIRST_PARTY,
352
+ this.h = new Map;
353
+ }
354
+ /** Gets an authorization token, using a provided factory function, or falling back to First Party GAPI. */ l() {
355
+ return this.u ? this.u() : (
356
+ // Make sure this really is a Gapi client.
357
+ v(!("object" != typeof this.t || null === this.t || !this.t.auth || !this.t.auth.getAuthHeaderValueForFirstParty)),
358
+ this.t.auth.getAuthHeaderValueForFirstParty([]));
359
+ }
360
+ get headers() {
361
+ this.h.set("X-Goog-AuthUser", this.i);
362
+ // Use array notation to prevent minification
363
+ const t = this.l();
364
+ return t && this.h.set("Authorization", t), this.o && this.h.set("X-Goog-Iam-Authorization-Token", this.o),
365
+ this.h;
354
366
  }
355
367
  }
356
368
 
@@ -359,11 +371,11 @@ e) {
359
371
  * to authenticate the user, using technique that is only available
360
372
  * to applications hosted by Google.
361
373
  */ class W {
362
- constructor(t, e, n) {
363
- this.t = t, this.i = e, this.o = n;
374
+ constructor(t, e, n, r) {
375
+ this.t = t, this.i = e, this.o = n, this.u = r;
364
376
  }
365
377
  getToken() {
366
- return Promise.resolve(new G(this.t, this.i, this.o));
378
+ return Promise.resolve(new G(this.t, this.i, this.o, this.u));
367
379
  }
368
380
  start(t, e) {
369
381
  // Fire with initial uid.
@@ -381,7 +393,7 @@ class K {
381
393
 
382
394
  /** AppCheck token provider for the Lite SDK. */ class Q {
383
395
  constructor(t) {
384
- this.u = t, this.appCheck = null, t.onInit((t => {
396
+ this.m = t, this.appCheck = null, t.onInit((t => {
385
397
  this.appCheck = t;
386
398
  }));
387
399
  }
@@ -1009,27 +1021,27 @@ class {
1009
1021
  constructor(t) {
1010
1022
  this.databaseInfo = t, this.databaseId = t.databaseId;
1011
1023
  const e = t.ssl ? "https" : "http";
1012
- this.h = e + "://" + t.host, this.l = "projects/" + this.databaseId.projectId + "/databases/" + this.databaseId.database + "/documents";
1024
+ this.p = e + "://" + t.host, this.g = "projects/" + this.databaseId.projectId + "/databases/" + this.databaseId.database + "/documents";
1013
1025
  }
1014
- m(t, e, n, r, s) {
1015
- const i = this.p(t, e);
1026
+ v(t, e, n, r, s) {
1027
+ const i = this.T(t, e);
1016
1028
  m("RestConnection", "Sending: ", i, n);
1017
1029
  const o = {};
1018
- return this.g(o, r, s), this.v(t, i, o, n).then((t => (m("RestConnection", "Received: ", t),
1030
+ return this.I(o, r, s), this.A(t, i, o, n).then((t => (m("RestConnection", "Received: ", t),
1019
1031
  t)), (e => {
1020
1032
  throw y("RestConnection", `${t} failed with error: `, e, "url: ", i, "request:", n),
1021
1033
  e;
1022
1034
  }));
1023
1035
  }
1024
- T(t, e, n, r, s, i) {
1036
+ R(t, e, n, r, s, i) {
1025
1037
  // The REST API automatically aggregates all of the streamed results, so we
1026
1038
  // can just use the normal invoke() method.
1027
- return this.m(t, e, n, r, s);
1039
+ return this.v(t, e, n, r, s);
1028
1040
  }
1029
1041
  /**
1030
1042
  * Modifies the headers for a request, adding any authorization token if
1031
1043
  * present and any additional headers for the request.
1032
- */ g(t, e, n) {
1044
+ */ I(t, e, n) {
1033
1045
  t["X-Goog-Api-Client"] = "gl-js/ fire/" + f,
1034
1046
  // Content-Type: text/plain will avoid preflight requests which might
1035
1047
  // mess with CORS and redirects by proxies. If we add custom headers
@@ -1038,9 +1050,9 @@ class {
1038
1050
  t["Content-Type"] = "text/plain", this.databaseInfo.appId && (t["X-Firebase-GMPID"] = this.databaseInfo.appId),
1039
1051
  e && e.headers.forEach(((e, n) => t[n] = e)), n && n.headers.forEach(((e, n) => t[n] = e));
1040
1052
  }
1041
- p(t, e) {
1053
+ T(t, e) {
1042
1054
  const n = ht[t];
1043
- return `${this.h}/v1/${e}:${n}`;
1055
+ return `${this.p}/v1/${e}:${n}`;
1044
1056
  }
1045
1057
  } {
1046
1058
  /**
@@ -1048,16 +1060,16 @@ class {
1048
1060
  * @param fetchImpl - `fetch` or a Polyfill that implements the fetch API.
1049
1061
  */
1050
1062
  constructor(t, e) {
1051
- super(t), this.I = e;
1063
+ super(t), this.P = e;
1052
1064
  }
1053
- A(t, e) {
1065
+ V(t, e) {
1054
1066
  throw new Error("Not supported by FetchConnection");
1055
1067
  }
1056
- async v(t, e, n, r) {
1068
+ async A(t, e, n, r) {
1057
1069
  const s = JSON.stringify(r);
1058
1070
  let i;
1059
1071
  try {
1060
- i = await this.I(e, {
1072
+ i = await this.P(e, {
1061
1073
  method: "POST",
1062
1074
  headers: n,
1063
1075
  body: s
@@ -1135,7 +1147,7 @@ function mt(t) {
1135
1147
  * See the License for the specific language governing permissions and
1136
1148
  * limitations under the License.
1137
1149
  */ class pt {
1138
- static R() {
1150
+ static N() {
1139
1151
  // Alphanumeric characters
1140
1152
  const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", e = Math.floor(256 / t.length) * t.length;
1141
1153
  // The largest byte value that is a multiple of `char.length`.
@@ -2604,7 +2616,7 @@ class Yt {
2604
2616
  class Jt {
2605
2617
  constructor(t, e = null, n = [], r = [], s = null, i = null, o = null) {
2606
2618
  this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = r, this.limit = s,
2607
- this.startAt = i, this.endAt = o, this.P = null;
2619
+ this.startAt = i, this.endAt = o, this.D = null;
2608
2620
  }
2609
2621
  }
2610
2622
 
@@ -2626,18 +2638,18 @@ class Zt extends class {} {
2626
2638
  /**
2627
2639
  * Creates a filter based on the provided arguments.
2628
2640
  */ static create(t, e, n) {
2629
- return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.V(t, e, n) : new te(t, e, n) : "array-contains" /* ARRAY_CONTAINS */ === e ? new se(t, n) : "in" /* IN */ === e ? new ie(t, n) : "not-in" /* NOT_IN */ === e ? new oe(t, n) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new ue(t, n) : new Zt(t, e, n);
2641
+ return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.$(t, e, n) : new te(t, e, n) : "array-contains" /* ARRAY_CONTAINS */ === e ? new se(t, n) : "in" /* IN */ === e ? new ie(t, n) : "not-in" /* NOT_IN */ === e ? new oe(t, n) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new ue(t, n) : new Zt(t, e, n);
2630
2642
  }
2631
- static V(t, e, n) {
2643
+ static $(t, e, n) {
2632
2644
  return "in" /* IN */ === e ? new ee(t, n) : new ne(t, n);
2633
2645
  }
2634
2646
  matches(t) {
2635
2647
  const e = t.data.field(this.field);
2636
2648
  // Types do not have to match in NOT_EQUAL filters.
2637
- return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.N(Ut(e, this.value)) : null !== e && Ct(this.value) === Ct(e) && this.N(Ut(e, this.value));
2649
+ return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.F(Ut(e, this.value)) : null !== e && Ct(this.value) === Ct(e) && this.F(Ut(e, this.value));
2638
2650
  // Only compare types with matching backend order (such as double and int).
2639
2651
  }
2640
- N(t) {
2652
+ F(t) {
2641
2653
  switch (this.op) {
2642
2654
  case "<" /* LESS_THAN */ :
2643
2655
  return t < 0;
@@ -2661,7 +2673,7 @@ class Zt extends class {} {
2661
2673
  return g();
2662
2674
  }
2663
2675
  }
2664
- D() {
2676
+ S() {
2665
2677
  return [ "<" /* LESS_THAN */ , "<=" /* LESS_THAN_OR_EQUAL */ , ">" /* GREATER_THAN */ , ">=" /* GREATER_THAN_OR_EQUAL */ , "!=" /* NOT_EQUAL */ , "not-in" /* NOT_IN */ ].indexOf(this.op) >= 0;
2666
2678
  }
2667
2679
  }
@@ -2673,7 +2685,7 @@ class te extends Zt {
2673
2685
  }
2674
2686
  matches(t) {
2675
2687
  const e = et.comparator(t.key, this.key);
2676
- return this.N(e);
2688
+ return this.F(e);
2677
2689
  }
2678
2690
  }
2679
2691
 
@@ -2813,9 +2825,9 @@ function le(t, e) {
2813
2825
  */
2814
2826
  constructor(t, e = null, n = [], r = [], s = null, i = "F" /* First */ , o = null, u = null) {
2815
2827
  this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = r,
2816
- this.limit = s, this.limitType = i, this.startAt = o, this.endAt = u, this.$ = null,
2828
+ this.limit = s, this.limitType = i, this.startAt = o, this.endAt = u, this.q = null,
2817
2829
  // The corresponding `Target` of this `Query` instance.
2818
- this.F = null, this.startAt, this.endAt;
2830
+ this.O = null, this.startAt, this.endAt;
2819
2831
  }
2820
2832
  }
2821
2833
 
@@ -2824,7 +2836,7 @@ function le(t, e) {
2824
2836
  }
2825
2837
 
2826
2838
  function we(t) {
2827
- for (const e of t.filters) if (e.D()) return e.field;
2839
+ for (const e of t.filters) if (e.S()) return e.field;
2828
2840
  return null;
2829
2841
  }
2830
2842
 
@@ -2846,32 +2858,32 @@ function me(t) {
2846
2858
  * the SDK and backend always orders by `__name__`).
2847
2859
  */ function pe(t) {
2848
2860
  const e = b(t);
2849
- if (null === e.$) {
2850
- e.$ = [];
2861
+ if (null === e.q) {
2862
+ e.q = [];
2851
2863
  const t = we(e), n = de(e);
2852
2864
  if (null !== t && null === n)
2853
2865
  // In order to implicitly add key ordering, we must also add the
2854
2866
  // inequality filter field for it to be a valid query.
2855
2867
  // Note that the default inequality field and key ordering is ascending.
2856
- t.isKeyField() || e.$.push(new ae(t)), e.$.push(new ae(tt.keyField(), "asc" /* ASCENDING */)); else {
2868
+ t.isKeyField() || e.q.push(new ae(t)), e.q.push(new ae(tt.keyField(), "asc" /* ASCENDING */)); else {
2857
2869
  let t = !1;
2858
- for (const n of e.explicitOrderBy) e.$.push(n), n.field.isKeyField() && (t = !0);
2870
+ for (const n of e.explicitOrderBy) e.q.push(n), n.field.isKeyField() && (t = !0);
2859
2871
  if (!t) {
2860
2872
  // The order of the implicit key ordering always matches the last
2861
2873
  // explicit order by
2862
2874
  const t = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : "asc" /* ASCENDING */;
2863
- e.$.push(new ae(tt.keyField(), t));
2875
+ e.q.push(new ae(tt.keyField(), t));
2864
2876
  }
2865
2877
  }
2866
2878
  }
2867
- return e.$;
2879
+ return e.q;
2868
2880
  }
2869
2881
 
2870
2882
  /**
2871
2883
  * Converts this `Query` instance to it's corresponding `Target` representation.
2872
2884
  */ function ye(t) {
2873
2885
  const e = b(t);
2874
- if (!e.F) if ("F" /* First */ === e.limitType) e.F = Xt(e.path, e.collectionGroup, pe(e), e.filters, e.limit, e.startAt, e.endAt); else {
2886
+ if (!e.O) if ("F" /* First */ === e.limitType) e.O = Xt(e.path, e.collectionGroup, pe(e), e.filters, e.limit, e.startAt, e.endAt); else {
2875
2887
  // Flip the orderBy directions since we want the last results
2876
2888
  const t = [];
2877
2889
  for (const n of pe(e)) {
@@ -2881,9 +2893,9 @@ function me(t) {
2881
2893
  // We need to swap the cursors to match the now-flipped query ordering.
2882
2894
  const n = e.endAt ? new ce(e.endAt.position, e.endAt.inclusive) : null, r = e.startAt ? new ce(e.startAt.position, e.startAt.inclusive) : null;
2883
2895
  // Now return as a LimitType.First query.
2884
- e.F = Xt(e.path, e.collectionGroup, t, e.filters, e.limit, n, r);
2896
+ e.O = Xt(e.path, e.collectionGroup, t, e.filters, e.limit, n, r);
2885
2897
  }
2886
- return e.F;
2898
+ return e.O;
2887
2899
  }
2888
2900
 
2889
2901
  function _e(t, e) {
@@ -2936,7 +2948,7 @@ function ge(t, e) {
2936
2948
  integerValue: "" + t
2937
2949
  };
2938
2950
  }(e) : function(t, e) {
2939
- if (t.S) {
2951
+ if (t.k) {
2940
2952
  if (isNaN(e)) return {
2941
2953
  doubleValue: "NaN"
2942
2954
  };
@@ -2998,7 +3010,7 @@ function ge(t, e) {
2998
3010
  * arithmetic is used and precision loss can occur for values greater than 2^53.
2999
3011
  */ class Ie extends ve {
3000
3012
  constructor(t, e) {
3001
- super(), this.q = t, this.O = e;
3013
+ super(), this.C = t, this.L = e;
3002
3014
  }
3003
3015
  }
3004
3016
 
@@ -3206,7 +3218,7 @@ function ge(t, e) {
3206
3218
  */
3207
3219
  class Se {
3208
3220
  constructor(t, e) {
3209
- this.databaseId = t, this.S = e;
3221
+ this.databaseId = t, this.k = e;
3210
3222
  }
3211
3223
  }
3212
3224
 
@@ -3222,7 +3234,7 @@ class Se {
3222
3234
  * Returns a value for a Date that's appropriate to put into a proto.
3223
3235
  */
3224
3236
  function qe(t, e) {
3225
- if (t.S) {
3237
+ if (t.k) {
3226
3238
  return `${new Date(1e3 * e.seconds).toISOString().replace(/\.\d*/, "").replace("Z", "")}.${("000000000" + e.nanoseconds).slice(-9)}Z`;
3227
3239
  }
3228
3240
  return {
@@ -3237,7 +3249,7 @@ function qe(t, e) {
3237
3249
  * Visible for testing.
3238
3250
  */
3239
3251
  function Oe(t, e) {
3240
- return t.S ? e.toBase64() : e.toUint8Array();
3252
+ return t.k ? e.toBase64() : e.toUint8Array();
3241
3253
  }
3242
3254
 
3243
3255
  function ke(t, e) {
@@ -3338,7 +3350,7 @@ function We(t, e) {
3338
3350
  };
3339
3351
  if (n instanceof Ie) return {
3340
3352
  fieldPath: e.field.canonicalString(),
3341
- increment: n.O
3353
+ increment: n.L
3342
3354
  };
3343
3355
  throw g();
3344
3356
  }(0, t)))), e.precondition.isNone || (n.currentDocument = function(t, e) {
@@ -3423,7 +3435,7 @@ function Ke(t, e) {
3423
3435
  }(e.orderBy);
3424
3436
  i && (n.structuredQuery.orderBy = i);
3425
3437
  const o = function(t, e) {
3426
- return t.S || ct(e) ? e : {
3438
+ return t.k || ct(e) ? e : {
3427
3439
  value: e
3428
3440
  };
3429
3441
  }(t, e.limit);
@@ -3537,9 +3549,9 @@ class tn {
3537
3549
  * Note that jitter will still be applied, so the actual delay could be as
3538
3550
  * much as 1.5*maxDelayMs.
3539
3551
  */ , s = 6e4) {
3540
- this.k = t, this.timerId = e, this.C = n, this.L = r, this.M = s, this.U = 0, this.j = null,
3552
+ this.M = t, this.timerId = e, this.U = n, this.j = r, this.B = s, this.G = 0, this.W = null,
3541
3553
  /** The last backoff attempt, as epoch milliseconds. */
3542
- this.B = Date.now(), this.reset();
3554
+ this.K = Date.now(), this.reset();
3543
3555
  }
3544
3556
  /**
3545
3557
  * Resets the backoff delay.
@@ -3548,40 +3560,40 @@ class tn {
3548
3560
  * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and
3549
3561
  * subsequent ones will increase according to the backoffFactor.
3550
3562
  */ reset() {
3551
- this.U = 0;
3563
+ this.G = 0;
3552
3564
  }
3553
3565
  /**
3554
3566
  * Resets the backoff delay to the maximum delay (e.g. for use after a
3555
3567
  * RESOURCE_EXHAUSTED error).
3556
- */ G() {
3557
- this.U = this.M;
3568
+ */ Y() {
3569
+ this.G = this.B;
3558
3570
  }
3559
3571
  /**
3560
3572
  * Returns a promise that resolves after currentDelayMs, and increases the
3561
3573
  * delay for any subsequent attempts. If there was a pending backoff operation
3562
3574
  * already, it will be canceled.
3563
- */ W(t) {
3575
+ */ H(t) {
3564
3576
  // Cancel any pending backoff operation.
3565
3577
  this.cancel();
3566
3578
  // First schedule using the current base (which may be 0 and should be
3567
3579
  // honored as such).
3568
- const e = Math.floor(this.U + this.K()), n = Math.max(0, Date.now() - this.B), r = Math.max(0, e - n);
3580
+ const e = Math.floor(this.G + this.J()), n = Math.max(0, Date.now() - this.K), r = Math.max(0, e - n);
3569
3581
  // Guard against lastAttemptTime being in the future due to a clock change.
3570
- r > 0 && m("ExponentialBackoff", `Backing off for ${r} ms (base delay: ${this.U} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`),
3571
- this.j = this.k.enqueueAfterDelay(this.timerId, r, (() => (this.B = Date.now(),
3582
+ r > 0 && m("ExponentialBackoff", `Backing off for ${r} ms (base delay: ${this.G} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`),
3583
+ this.W = this.M.enqueueAfterDelay(this.timerId, r, (() => (this.K = Date.now(),
3572
3584
  t()))),
3573
3585
  // Apply backoff factor to determine next delay and ensure it is within
3574
3586
  // bounds.
3575
- this.U *= this.L, this.U < this.C && (this.U = this.C), this.U > this.M && (this.U = this.M);
3587
+ this.G *= this.j, this.G < this.U && (this.G = this.U), this.G > this.B && (this.G = this.B);
3576
3588
  }
3577
- Y() {
3578
- null !== this.j && (this.j.skipDelay(), this.j = null);
3589
+ X() {
3590
+ null !== this.W && (this.W.skipDelay(), this.W = null);
3579
3591
  }
3580
3592
  cancel() {
3581
- null !== this.j && (this.j.cancel(), this.j = null);
3593
+ null !== this.W && (this.W.cancel(), this.W = null);
3582
3594
  }
3583
- /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ K() {
3584
- return (Math.random() - .5) * this.U;
3595
+ /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ J() {
3596
+ return (Math.random() - .5) * this.G;
3585
3597
  }
3586
3598
  }
3587
3599
 
@@ -3612,44 +3624,44 @@ class tn {
3612
3624
  */
3613
3625
  class en extends class {} {
3614
3626
  constructor(t, e, n, r) {
3615
- super(), this.authCredentials = t, this.appCheckCredentials = e, this.H = n, this.q = r,
3616
- this.J = !1;
3627
+ super(), this.authCredentials = t, this.appCheckCredentials = e, this.Z = n, this.C = r,
3628
+ this.tt = !1;
3617
3629
  }
3618
- X() {
3619
- if (this.J) throw new L(x, "The client has already been terminated.");
3630
+ et() {
3631
+ if (this.tt) throw new L(x, "The client has already been terminated.");
3620
3632
  }
3621
- /** Invokes the provided RPC with auth and AppCheck tokens. */ m(t, e, n) {
3622
- return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([r, s]) => this.H.m(t, e, n, r, s))).catch((t => {
3633
+ /** Invokes the provided RPC with auth and AppCheck tokens. */ v(t, e, n) {
3634
+ return this.et(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([r, s]) => this.Z.v(t, e, n, r, s))).catch((t => {
3623
3635
  throw "FirebaseError" === t.name ? (t.code === D && (this.authCredentials.invalidateToken(),
3624
3636
  this.appCheckCredentials.invalidateToken()), t) : new L(I, t.toString());
3625
3637
  }));
3626
3638
  }
3627
- /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ T(t, e, n, r) {
3628
- return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.H.T(t, e, n, s, i, r))).catch((t => {
3639
+ /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ R(t, e, n, r) {
3640
+ return this.et(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([s, i]) => this.Z.R(t, e, n, s, i, r))).catch((t => {
3629
3641
  throw "FirebaseError" === t.name ? (t.code === D && (this.authCredentials.invalidateToken(),
3630
3642
  this.appCheckCredentials.invalidateToken()), t) : new L(I, t.toString());
3631
3643
  }));
3632
3644
  }
3633
3645
  terminate() {
3634
- this.J = !0;
3646
+ this.tt = !0;
3635
3647
  }
3636
3648
  }
3637
3649
 
3638
3650
  // TODO(firestorexp): Make sure there is only one Datastore instance per
3639
3651
  // firestore-exp client.
3640
3652
  async function nn(t, e) {
3641
- const n = b(t), r = Be(n.q) + "/documents", s = {
3642
- writes: e.map((t => We(n.q, t)))
3653
+ const n = b(t), r = Be(n.C) + "/documents", s = {
3654
+ writes: e.map((t => We(n.C, t)))
3643
3655
  };
3644
- await n.m("Commit", r, s);
3656
+ await n.v("Commit", r, s);
3645
3657
  }
3646
3658
 
3647
3659
  async function rn(t, e) {
3648
- const n = b(t), r = Be(n.q) + "/documents", s = {
3649
- documents: e.map((t => Me(n.q, t)))
3650
- }, i = await n.T("BatchGetDocuments", r, s, e.length), o = new Map;
3660
+ const n = b(t), r = Be(n.C) + "/documents", s = {
3661
+ documents: e.map((t => Me(n.C, t)))
3662
+ }, i = await n.R("BatchGetDocuments", r, s, e.length), o = new Map;
3651
3663
  i.forEach((t => {
3652
- const e = Ge(n.q, t);
3664
+ const e = Ge(n.C, t);
3653
3665
  o.set(e.key.toString(), e);
3654
3666
  }));
3655
3667
  const u = [];
@@ -3660,8 +3672,8 @@ async function rn(t, e) {
3660
3672
  }
3661
3673
 
3662
3674
  async function sn(t, e) {
3663
- const n = b(t), r = Ke(n.q, ye(e));
3664
- return (await n.T("RunQuery", r.parent, {
3675
+ const n = b(t), r = Ke(n.C, ye(e));
3676
+ return (await n.R("RunQuery", r.parent, {
3665
3677
  structuredQuery: r.structuredQuery
3666
3678
  })).filter((t => !!t.document)).map((t => function(t, e, n) {
3667
3679
  const r = Ue(t, e.name), s = Ce(e.updateTime), i = new Yt({
@@ -3670,7 +3682,7 @@ async function sn(t, e) {
3670
3682
  }
3671
3683
  }), o = Ht.newFoundDocument(r, s, i);
3672
3684
  return n && o.setHasCommittedMutations(), n ? o.setHasCommittedMutations() : o;
3673
- }(n.q, t.document, void 0)));
3685
+ }(n.C, t.document, void 0)));
3674
3686
  }
3675
3687
 
3676
3688
  /**
@@ -3826,9 +3838,7 @@ class cn {
3826
3838
  switch (t.type) {
3827
3839
  case "gapi":
3828
3840
  const e = t.client;
3829
- // Make sure this really is a Gapi client.
3830
- return v(!("object" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)),
3831
- new W(e, t.sessionIndex || "0", t.iamToken || null);
3841
+ return new W(e, t.sessionIndex || "0", t.iamToken || null, t.authTokenFactory || null);
3832
3842
 
3833
3843
  case "provider":
3834
3844
  return t.client;
@@ -4110,7 +4120,7 @@ function gn(t, e, ...n) {
4110
4120
  if (t = getModularInstance(t),
4111
4121
  // We allow omission of 'pathString' but explicitly prohibit passing in both
4112
4122
  // 'undefined' and 'null'.
4113
- 1 === arguments.length && (e = pt.R()), nt("doc", "path", e), t instanceof an) {
4123
+ 1 === arguments.length && (e = pt.N()), nt("doc", "path", e), t instanceof an) {
4114
4124
  const r = X.fromString(e, ...n);
4115
4125
  return rt(r), new wn(t,
4116
4126
  /* converter= */ null, new et(r));
@@ -4439,58 +4449,58 @@ function Dn(t) {
4439
4449
  * compromised).
4440
4450
  */
4441
4451
  constructor(t, e, n, r, s, i) {
4442
- this.settings = t, this.databaseId = e, this.q = n, this.ignoreUndefinedProperties = r,
4452
+ this.settings = t, this.databaseId = e, this.C = n, this.ignoreUndefinedProperties = r,
4443
4453
  // Minor hack: If fieldTransforms is undefined, we assume this is an
4444
4454
  // external call and we need to validate the entire path.
4445
- void 0 === s && this.Z(), this.fieldTransforms = s || [], this.fieldMask = i || [];
4455
+ void 0 === s && this.nt(), this.fieldTransforms = s || [], this.fieldMask = i || [];
4446
4456
  }
4447
4457
  get path() {
4448
4458
  return this.settings.path;
4449
4459
  }
4450
- get tt() {
4451
- return this.settings.tt;
4460
+ get rt() {
4461
+ return this.settings.rt;
4452
4462
  }
4453
- /** Returns a new context with the specified settings overwritten. */ et(t) {
4454
- return new $n(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.q, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
4463
+ /** Returns a new context with the specified settings overwritten. */ st(t) {
4464
+ return new $n(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.C, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
4455
4465
  }
4456
- nt(t) {
4466
+ it(t) {
4457
4467
  var e;
4458
- const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.et({
4468
+ const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.st({
4459
4469
  path: n,
4460
- rt: !1
4470
+ ot: !1
4461
4471
  });
4462
- return r.st(t), r;
4472
+ return r.ut(t), r;
4463
4473
  }
4464
- it(t) {
4474
+ ct(t) {
4465
4475
  var e;
4466
- const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.et({
4476
+ const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.st({
4467
4477
  path: n,
4468
- rt: !1
4478
+ ot: !1
4469
4479
  });
4470
- return r.Z(), r;
4480
+ return r.nt(), r;
4471
4481
  }
4472
- ot(t) {
4482
+ at(t) {
4473
4483
  // TODO(b/34871131): We don't support array paths right now; so make path
4474
4484
  // undefined.
4475
- return this.et({
4485
+ return this.st({
4476
4486
  path: void 0,
4477
- rt: !0
4487
+ ot: !0
4478
4488
  });
4479
4489
  }
4480
- ut(t) {
4481
- return Jn(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
4490
+ ht(t) {
4491
+ return Jn(t, this.settings.methodName, this.settings.lt || !1, this.path, this.settings.ft);
4482
4492
  }
4483
4493
  /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ contains(t) {
4484
4494
  return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));
4485
4495
  }
4486
- Z() {
4496
+ nt() {
4487
4497
  // TODO(b/34871131): Remove null check once we have proper paths for fields
4488
4498
  // within arrays.
4489
- if (this.path) for (let t = 0; t < this.path.length; t++) this.st(this.path.get(t));
4499
+ if (this.path) for (let t = 0; t < this.path.length; t++) this.ut(this.path.get(t));
4490
4500
  }
4491
- st(t) {
4492
- if (0 === t.length) throw this.ut("Document fields must not be empty");
4493
- if (Dn(this.tt) && Pn.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
4501
+ ut(t) {
4502
+ if (0 === t.length) throw this.ht("Document fields must not be empty");
4503
+ if (Dn(this.rt) && Pn.test(t)) throw this.ht('Document fields cannot begin and end with "__"');
4494
4504
  }
4495
4505
  }
4496
4506
 
@@ -4499,17 +4509,17 @@ function Dn(t) {
4499
4509
  * classes.
4500
4510
  */ class xn {
4501
4511
  constructor(t, e, n) {
4502
- this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n || Ze(t);
4512
+ this.databaseId = t, this.ignoreUndefinedProperties = e, this.C = n || Ze(t);
4503
4513
  }
4504
- /** Creates a new top-level parse context. */ ht(t, e, n, r = !1) {
4514
+ /** Creates a new top-level parse context. */ dt(t, e, n, r = !1) {
4505
4515
  return new $n({
4506
- tt: t,
4516
+ rt: t,
4507
4517
  methodName: e,
4508
- at: n,
4518
+ ft: n,
4509
4519
  path: tt.emptyPath(),
4510
- rt: !1,
4511
- ct: r
4512
- }, this.databaseId, this.q, this.ignoreUndefinedProperties);
4520
+ ot: !1,
4521
+ lt: r
4522
+ }, this.databaseId, this.C, this.ignoreUndefinedProperties);
4513
4523
  }
4514
4524
  }
4515
4525
 
@@ -4519,7 +4529,7 @@ function Fn(t) {
4519
4529
  }
4520
4530
 
4521
4531
  /** Parse document data from a set() call. */ function Sn(t, e, n, r, s, i = {}) {
4522
- const o = t.ht(i.merge || i.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, s);
4532
+ const o = t.dt(i.merge || i.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, s);
4523
4533
  Kn("Data must be an object, but it was:", o, r);
4524
4534
  const u = Gn(r, o);
4525
4535
  let c, a;
@@ -4537,7 +4547,7 @@ function Fn(t) {
4537
4547
 
4538
4548
  class qn extends An {
4539
4549
  _toFieldTransform(t) {
4540
- if (2 /* MergeSet */ !== t.tt) throw 1 /* Update */ === t.tt ? t.ut(`${this._methodName}() can only appear at the top level of your update data`) : t.ut(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);
4550
+ if (2 /* MergeSet */ !== t.rt) throw 1 /* Update */ === t.rt ? t.ht(`${this._methodName}() can only appear at the top level of your update data`) : t.ht(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);
4541
4551
  // No transform to add for a delete, but we need to add it to our
4542
4552
  // fieldMask so it gets deleted.
4543
4553
  return t.fieldMask.push(t.path), null;
@@ -4564,11 +4574,11 @@ class qn extends An {
4564
4574
  * @param arrayElement - Whether or not the FieldValue has an array.
4565
4575
  */ function On(t, e, n) {
4566
4576
  return new $n({
4567
- tt: 3 /* Argument */ ,
4568
- at: e.settings.at,
4577
+ rt: 3 /* Argument */ ,
4578
+ ft: e.settings.ft,
4569
4579
  methodName: t._methodName,
4570
- rt: n
4571
- }, e.databaseId, e.q, e.ignoreUndefinedProperties);
4580
+ ot: n
4581
+ }, e.databaseId, e.C, e.ignoreUndefinedProperties);
4572
4582
  }
4573
4583
 
4574
4584
  class kn extends An {
@@ -4582,11 +4592,11 @@ class kn extends An {
4582
4592
 
4583
4593
  class Cn extends An {
4584
4594
  constructor(t, e) {
4585
- super(t), this.lt = e;
4595
+ super(t), this.wt = e;
4586
4596
  }
4587
4597
  _toFieldTransform(t) {
4588
4598
  const e = On(this, t,
4589
- /*array=*/ !0), n = this.lt.map((t => zn(t, e))), r = new Ee(n);
4599
+ /*array=*/ !0), n = this.wt.map((t => zn(t, e))), r = new Ee(n);
4590
4600
  return new Ae(t.path, r);
4591
4601
  }
4592
4602
  isEqual(t) {
@@ -4597,11 +4607,11 @@ class Cn extends An {
4597
4607
 
4598
4608
  class Ln extends An {
4599
4609
  constructor(t, e) {
4600
- super(t), this.lt = e;
4610
+ super(t), this.wt = e;
4601
4611
  }
4602
4612
  _toFieldTransform(t) {
4603
4613
  const e = On(this, t,
4604
- /*array=*/ !0), n = this.lt.map((t => zn(t, e))), r = new Te(n);
4614
+ /*array=*/ !0), n = this.wt.map((t => zn(t, e))), r = new Te(n);
4605
4615
  return new Ae(t.path, r);
4606
4616
  }
4607
4617
  isEqual(t) {
@@ -4612,10 +4622,10 @@ class Ln extends An {
4612
4622
 
4613
4623
  class Mn extends An {
4614
4624
  constructor(t, e) {
4615
- super(t), this.ft = e;
4625
+ super(t), this.yt = e;
4616
4626
  }
4617
4627
  _toFieldTransform(t) {
4618
- const e = new Ie(t.q, ge(t.q, this.ft));
4628
+ const e = new Ie(t.C, ge(t.C, this.yt));
4619
4629
  return new Ae(t.path, e);
4620
4630
  }
4621
4631
  isEqual(t) {
@@ -4625,7 +4635,7 @@ class Mn extends An {
4625
4635
  }
4626
4636
 
4627
4637
  /** Parse update data from an update() call. */ function Un(t, e, n, r) {
4628
- const s = t.ht(1 /* Update */ , e, n);
4638
+ const s = t.dt(1 /* Update */ , e, n);
4629
4639
  Kn("Data must be an object, but it was:", s, r);
4630
4640
  const i = [], o = Yt.empty();
4631
4641
  Et(r, ((t, r) => {
@@ -4633,7 +4643,7 @@ class Mn extends An {
4633
4643
  // For Compat types, we have to "extract" the underlying types before
4634
4644
  // performing validation.
4635
4645
  r = getModularInstance(r);
4636
- const c = s.it(u);
4646
+ const c = s.ct(u);
4637
4647
  if (r instanceof qn)
4638
4648
  // Add it to the field mask, but don't add anything to updateData.
4639
4649
  i.push(u); else {
@@ -4646,7 +4656,7 @@ class Mn extends An {
4646
4656
  }
4647
4657
 
4648
4658
  /** Parse update data from a list of field/value arguments. */ function jn(t, e, n, r, s, i) {
4649
- const o = t.ht(1 /* Update */ , e, n), u = [ Qn(e, r, n) ], c = [ s ];
4659
+ const o = t.dt(1 /* Update */ , e, n), u = [ Qn(e, r, n) ], c = [ s ];
4650
4660
  if (i.length % 2 != 0) throw new L(A, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);
4651
4661
  for (let t = 0; t < i.length; t += 2) u.push(Qn(e, i[t])), c.push(i[t + 1]);
4652
4662
  const a = [], l = Yt.empty();
@@ -4658,7 +4668,7 @@ class Mn extends An {
4658
4668
  // For Compat types, we have to "extract" the underlying types before
4659
4669
  // performing validation.
4660
4670
  n = getModularInstance(n);
4661
- const r = o.it(e);
4671
+ const r = o.ct(e);
4662
4672
  if (n instanceof qn)
4663
4673
  // Add it to the field mask, but don't add anything to updateData.
4664
4674
  a.push(e); else {
@@ -4677,7 +4687,7 @@ class Mn extends An {
4677
4687
  * @param allowArrays - Whether the query value is an array that may directly
4678
4688
  * contain additional arrays (e.g. the operand of an `in` query).
4679
4689
  */ function Bn(t, e, n, r = !1) {
4680
- return zn(n, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
4690
+ return zn(n, t.dt(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
4681
4691
  }
4682
4692
 
4683
4693
  /**
@@ -4705,8 +4715,8 @@ class Mn extends An {
4705
4715
  */
4706
4716
  return function(t, e) {
4707
4717
  // Sentinels are only supported with writes, and not within arrays.
4708
- if (!Dn(e.tt)) throw e.ut(`${t._methodName}() can only be used with update() and set()`);
4709
- if (!e.path) throw e.ut(`${t._methodName}() is not currently supported inside arrays`);
4718
+ if (!Dn(e.rt)) throw e.ht(`${t._methodName}() can only be used with update() and set()`);
4719
+ if (!e.path) throw e.ht(`${t._methodName}() is not currently supported inside arrays`);
4710
4720
  const n = t._toFieldTransform(e);
4711
4721
  n && e.fieldTransforms.push(n);
4712
4722
  }
@@ -4730,12 +4740,12 @@ class Mn extends An {
4730
4740
  // the set of values to be included for the IN query) that may directly
4731
4741
  // contain additional arrays (each representing an individual field
4732
4742
  // value), so we disable this validation.
4733
- if (e.settings.rt && 4 /* ArrayArgument */ !== e.tt) throw e.ut("Nested arrays are not supported");
4743
+ if (e.settings.ot && 4 /* ArrayArgument */ !== e.rt) throw e.ht("Nested arrays are not supported");
4734
4744
  return function(t, e) {
4735
4745
  const n = [];
4736
4746
  let r = 0;
4737
4747
  for (const s of t) {
4738
- let t = zn(s, e.ot(r));
4748
+ let t = zn(s, e.at(r));
4739
4749
  null == t && (
4740
4750
  // Just include nulls in the array for fields being replaced with a
4741
4751
  // sentinel.
@@ -4754,7 +4764,7 @@ class Mn extends An {
4754
4764
  if (null === (t = getModularInstance(t))) return {
4755
4765
  nullValue: "NULL_VALUE"
4756
4766
  };
4757
- if ("number" == typeof t) return ge(e.q, t);
4767
+ if ("number" == typeof t) return ge(e.C, t);
4758
4768
  if ("boolean" == typeof t) return {
4759
4769
  booleanValue: t
4760
4770
  };
@@ -4764,7 +4774,7 @@ class Mn extends An {
4764
4774
  if (t instanceof Date) {
4765
4775
  const n = gt.fromDate(t);
4766
4776
  return {
4767
- timestampValue: qe(e.q, n)
4777
+ timestampValue: qe(e.C, n)
4768
4778
  };
4769
4779
  }
4770
4780
  if (t instanceof gt) {
@@ -4773,7 +4783,7 @@ class Mn extends An {
4773
4783
  // truncation immediately without waiting for the backend to do that.
4774
4784
  const n = new gt(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
4775
4785
  return {
4776
- timestampValue: qe(e.q, n)
4786
+ timestampValue: qe(e.C, n)
4777
4787
  };
4778
4788
  }
4779
4789
  if (t instanceof Rn) return {
@@ -4783,16 +4793,16 @@ class Mn extends An {
4783
4793
  }
4784
4794
  };
4785
4795
  if (t instanceof In) return {
4786
- bytesValue: Oe(e.q, t._byteString)
4796
+ bytesValue: Oe(e.C, t._byteString)
4787
4797
  };
4788
4798
  if (t instanceof wn) {
4789
4799
  const n = e.databaseId, r = t.firestore._databaseId;
4790
- if (!r.isEqual(n)) throw e.ut(`Document reference is for database ${r.projectId}/${r.database} but should be for database ${n.projectId}/${n.database}`);
4800
+ if (!r.isEqual(n)) throw e.ht(`Document reference is for database ${r.projectId}/${r.database} but should be for database ${n.projectId}/${n.database}`);
4791
4801
  return {
4792
4802
  referenceValue: Le(t.firestore._databaseId || e.databaseId, t._key.path)
4793
4803
  };
4794
4804
  }
4795
- throw e.ut(`Unsupported field value: ${it(t)}`);
4805
+ throw e.ht(`Unsupported field value: ${it(t)}`);
4796
4806
  }
4797
4807
  /**
4798
4808
  * Checks whether an object looks like a JSON object that should be converted
@@ -4809,7 +4819,7 @@ function Gn(t, e) {
4809
4819
  for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;
4810
4820
  return !0;
4811
4821
  }(t) ? Et(t, ((t, r) => {
4812
- const s = zn(r, e.nt(t));
4822
+ const s = zn(r, e.it(t));
4813
4823
  null != s && (n[t] = s);
4814
4824
  })) :
4815
4825
  // If we encounter an empty object, we explicitly add it to the update
@@ -4830,7 +4840,7 @@ function Kn(t, e, n) {
4830
4840
  return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
4831
4841
  }(n)) {
4832
4842
  const r = it(n);
4833
- throw "an object" === r ? e.ut(t + " a custom object") : e.ut(t + " " + r);
4843
+ throw "an object" === r ? e.ht(t + " a custom object") : e.ht(t + " " + r);
4834
4844
  }
4835
4845
  }
4836
4846
 
@@ -5081,7 +5091,7 @@ class sr {}
5081
5091
 
5082
5092
  class or extends sr {
5083
5093
  constructor(t, e, n) {
5084
- super(), this.dt = t, this.wt = e, this.yt = n, this.type = "where";
5094
+ super(), this._t = t, this.gt = e, this.vt = n, this.type = "where";
5085
5095
  }
5086
5096
  _apply(t) {
5087
5097
  const e = Fn(t.firestore), n = function(t, e, n, r, s, i, o) {
@@ -5103,7 +5113,7 @@ class or extends sr {
5103
5113
  /* allowArrays= */ "in" /* IN */ === i || "not-in" /* NOT_IN */ === i);
5104
5114
  const c = Zt.create(s, i, u);
5105
5115
  return function(t, e) {
5106
- if (e.D()) {
5116
+ if (e.S()) {
5107
5117
  const n = we(t);
5108
5118
  if (null !== n && !n.isEqual(e.field)) throw new L(A, `Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);
5109
5119
  const r = de(t);
@@ -5150,7 +5160,7 @@ class or extends sr {
5150
5160
  // Special case when it's a duplicate op to give a slightly clearer error message.
5151
5161
  throw n === e.op ? new L(A, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new L(A, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);
5152
5162
  }(t, c), c;
5153
- }(t._query, "where", e, t.firestore._databaseId, this.dt, this.wt, this.yt);
5163
+ }(t._query, "where", e, t.firestore._databaseId, this._t, this.gt, this.vt);
5154
5164
  return new mn(t.firestore, t.converter, function(t, e) {
5155
5165
  const n = t.filters.concat([ e ]);
5156
5166
  return new fe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
@@ -5175,7 +5185,7 @@ class or extends sr {
5175
5185
 
5176
5186
  class cr extends sr {
5177
5187
  constructor(t, e) {
5178
- super(), this.dt = t, this._t = e, this.type = "orderBy";
5188
+ super(), this._t = t, this.bt = e, this.type = "orderBy";
5179
5189
  }
5180
5190
  _apply(t) {
5181
5191
  const e = function(t, e, n) {
@@ -5200,7 +5210,7 @@ class cr extends sr {
5200
5210
  * Will throw if the document does not contain all fields of the order by
5201
5211
  * of the query or if any of the fields in the order by are an uncommitted
5202
5212
  * server timestamp.
5203
- */ (t._query, this.dt, this._t);
5213
+ */ (t._query, this._t, this.bt);
5204
5214
  return new mn(t.firestore, t.converter, function(t, e) {
5205
5215
  // TODO(dimond): validate that orderBy does not list the same key twice.
5206
5216
  const n = t.explicitOrderBy.concat([ e ]);
@@ -5224,12 +5234,12 @@ class cr extends sr {
5224
5234
 
5225
5235
  class hr extends sr {
5226
5236
  constructor(t, e, n) {
5227
- super(), this.type = t, this.gt = e, this.vt = n;
5237
+ super(), this.type = t, this.Et = e, this.Tt = n;
5228
5238
  }
5229
5239
  _apply(t) {
5230
5240
  return new mn(t.firestore, t.converter, function(t, e, n) {
5231
5241
  return new fe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
5232
- }(t._query, this.gt, this.vt));
5242
+ }(t._query, this.Et, this.Tt));
5233
5243
  }
5234
5244
  }
5235
5245
 
@@ -5256,10 +5266,10 @@ class hr extends sr {
5256
5266
 
5257
5267
  class dr extends sr {
5258
5268
  constructor(t, e, n) {
5259
- super(), this.type = t, this.bt = e, this.Et = n;
5269
+ super(), this.type = t, this.It = e, this.At = n;
5260
5270
  }
5261
5271
  _apply(t) {
5262
- const e = gr(t, this.type, this.bt, this.Et);
5272
+ const e = gr(t, this.type, this.It, this.At);
5263
5273
  return new mn(t.firestore, t.converter, function(t, e) {
5264
5274
  return new fe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
5265
5275
  }(t._query, e));
@@ -5278,10 +5288,10 @@ function mr(...t) {
5278
5288
 
5279
5289
  class pr extends sr {
5280
5290
  constructor(t, e, n) {
5281
- super(), this.type = t, this.bt = e, this.Et = n;
5291
+ super(), this.type = t, this.It = e, this.At = n;
5282
5292
  }
5283
5293
  _apply(t) {
5284
- const e = gr(t, this.type, this.bt, this.Et);
5294
+ const e = gr(t, this.type, this.It, this.At);
5285
5295
  return new mn(t.firestore, t.converter, function(t, e) {
5286
5296
  return new fe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
5287
5297
  }(t._query, e));
@@ -5962,26 +5972,26 @@ function kr(t, e) {
5962
5972
  class Ur {
5963
5973
  constructor(t, e, n, r, s) {
5964
5974
  this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = r,
5965
- this.deferred = s, this.Tt = n.maxAttempts, this.It = new tn(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
5975
+ this.deferred = s, this.Rt = n.maxAttempts, this.Pt = new tn(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
5966
5976
  }
5967
5977
  /** Runs the transaction and sets the result on deferred. */ run() {
5968
- this.Tt -= 1, this.At();
5978
+ this.Rt -= 1, this.Vt();
5969
5979
  }
5970
- At() {
5971
- this.It.W((async () => {
5972
- const t = new Lr(this.datastore), e = this.Rt(t);
5980
+ Vt() {
5981
+ this.Pt.H((async () => {
5982
+ const t = new Lr(this.datastore), e = this.Nt(t);
5973
5983
  e && e.then((e => {
5974
5984
  this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {
5975
5985
  this.deferred.resolve(e);
5976
5986
  })).catch((t => {
5977
- this.Pt(t);
5987
+ this.Dt(t);
5978
5988
  }))));
5979
5989
  })).catch((t => {
5980
- this.Pt(t);
5990
+ this.Dt(t);
5981
5991
  }));
5982
5992
  }));
5983
5993
  }
5984
- Rt(t) {
5994
+ Nt(t) {
5985
5995
  try {
5986
5996
  const e = this.updateFunction(t);
5987
5997
  return !ct(e) && e.catch && e.then ? e : (this.deferred.reject(Error("Transaction callback must return a Promise")),
@@ -5991,11 +6001,11 @@ class Ur {
5991
6001
  return this.deferred.reject(t), null;
5992
6002
  }
5993
6003
  }
5994
- Pt(t) {
5995
- this.Tt > 0 && this.Vt(t) ? (this.Tt -= 1, this.asyncQueue.enqueueAndForget((() => (this.At(),
6004
+ Dt(t) {
6005
+ this.Rt > 0 && this.$t(t) ? (this.Rt -= 1, this.asyncQueue.enqueueAndForget((() => (this.Vt(),
5996
6006
  Promise.resolve())))) : this.deferred.reject(t);
5997
6007
  }
5998
- Vt(t) {
6008
+ $t(t) {
5999
6009
  if ("FirebaseError" === t.name) {
6000
6010
  // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and
6001
6011
  // non-matching document versions with ABORTED. These errors should be retried.
@@ -6166,39 +6176,39 @@ class Ur {
6166
6176
  */ class zr {
6167
6177
  constructor() {
6168
6178
  // The last promise in the queue.
6169
- this.Nt = Promise.resolve(),
6179
+ this.xt = Promise.resolve(),
6170
6180
  // A list of retryable operations. Retryable operations are run in order and
6171
6181
  // retried with backoff.
6172
- this.Dt = [],
6182
+ this.Ft = [],
6173
6183
  // Is this AsyncQueue being shut down? Once it is set to true, it will not
6174
6184
  // be changed again.
6175
- this.$t = !1,
6185
+ this.St = !1,
6176
6186
  // Operations scheduled to be queued in the future. Operations are
6177
6187
  // automatically removed after they are run or canceled.
6178
- this.xt = [],
6188
+ this.qt = [],
6179
6189
  // visible for testing
6180
- this.Ft = null,
6190
+ this.Ot = null,
6181
6191
  // Flag set while there's an outstanding AsyncQueue operation, used for
6182
6192
  // assertion sanity-checks.
6183
- this.St = !1,
6193
+ this.kt = !1,
6184
6194
  // Enabled during shutdown on Safari to prevent future access to IndexedDB.
6185
- this.qt = !1,
6195
+ this.Ct = !1,
6186
6196
  // List of TimerIds to fast-forward delays for.
6187
- this.Ot = [],
6197
+ this.Lt = [],
6188
6198
  // Backoff timer used to schedule retries for retryable operations
6189
- this.It = new tn(this, "async_queue_retry" /* AsyncQueueRetry */),
6199
+ this.Pt = new tn(this, "async_queue_retry" /* AsyncQueueRetry */),
6190
6200
  // Visibility handler that triggers an immediate retry of all retryable
6191
6201
  // operations. Meant to speed up recovery when we regain file system access
6192
6202
  // after page comes into foreground.
6193
- this.kt = () => {
6203
+ this.Mt = () => {
6194
6204
  const t = jr();
6195
- t && m("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.It.Y();
6205
+ t && m("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.Pt.X();
6196
6206
  };
6197
6207
  const t = jr();
6198
- t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.kt);
6208
+ t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.Mt);
6199
6209
  }
6200
6210
  get isShuttingDown() {
6201
- return this.$t;
6211
+ return this.St;
6202
6212
  }
6203
6213
  /**
6204
6214
  * Adds a new operation to the queue without waiting for it to complete (i.e.
@@ -6208,38 +6218,38 @@ class Ur {
6208
6218
  this.enqueue(t);
6209
6219
  }
6210
6220
  enqueueAndForgetEvenWhileRestricted(t) {
6211
- this.Ct(),
6221
+ this.Ut(),
6212
6222
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
6213
- this.Lt(t);
6223
+ this.jt(t);
6214
6224
  }
6215
6225
  enterRestrictedMode(t) {
6216
- if (!this.$t) {
6217
- this.$t = !0, this.qt = t || !1;
6226
+ if (!this.St) {
6227
+ this.St = !0, this.Ct = t || !1;
6218
6228
  const e = jr();
6219
- e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.kt);
6229
+ e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Mt);
6220
6230
  }
6221
6231
  }
6222
6232
  enqueue(t) {
6223
- if (this.Ct(), this.$t)
6233
+ if (this.Ut(), this.St)
6224
6234
  // Return a Promise which never resolves.
6225
6235
  return new Promise((() => {}));
6226
6236
  // Create a deferred Promise that we can return to the callee. This
6227
6237
  // allows us to return a "hanging Promise" only to the callee and still
6228
6238
  // advance the queue even when the operation is not run.
6229
6239
  const e = new M;
6230
- return this.Lt((() => this.$t && this.qt ? Promise.resolve() : (t().then(e.resolve, e.reject),
6240
+ return this.jt((() => this.St && this.Ct ? Promise.resolve() : (t().then(e.resolve, e.reject),
6231
6241
  e.promise))).then((() => e.promise));
6232
6242
  }
6233
6243
  enqueueRetryable(t) {
6234
- this.enqueueAndForget((() => (this.Dt.push(t), this.Mt())));
6244
+ this.enqueueAndForget((() => (this.Ft.push(t), this.Bt())));
6235
6245
  }
6236
6246
  /**
6237
6247
  * Runs the next operation from the retryable queue. If the operation fails,
6238
6248
  * reschedules with backoff.
6239
- */ async Mt() {
6240
- if (0 !== this.Dt.length) {
6249
+ */ async Bt() {
6250
+ if (0 !== this.Ft.length) {
6241
6251
  try {
6242
- await this.Dt[0](), this.Dt.shift(), this.It.reset();
6252
+ await this.Ft[0](), this.Ft.shift(), this.Pt.reset();
6243
6253
  } catch (t) {
6244
6254
  if (!
6245
6255
  /**
@@ -6283,7 +6293,7 @@ class Ur {
6283
6293
  // Failure will be handled by AsyncQueue
6284
6294
  m("AsyncQueue", "Operation failed with retryable error: " + t);
6285
6295
  }
6286
- this.Dt.length > 0 &&
6296
+ this.Ft.length > 0 &&
6287
6297
  // If there are additional operations, we re-schedule `retryNextOp()`.
6288
6298
  // This is necessary to run retryable operations that failed during
6289
6299
  // their initial attempt since we don't know whether they are already
@@ -6294,12 +6304,12 @@ class Ur {
6294
6304
  // Since `backoffAndRun()` cancels an existing backoff and schedules a
6295
6305
  // new backoff on every call, there is only ever a single additional
6296
6306
  // operation in the queue.
6297
- this.It.W((() => this.Mt()));
6307
+ this.Pt.H((() => this.Bt()));
6298
6308
  }
6299
6309
  }
6300
- Lt(t) {
6301
- const e = this.Nt.then((() => (this.St = !0, t().catch((t => {
6302
- this.Ft = t, this.St = !1;
6310
+ jt(t) {
6311
+ const e = this.xt.then((() => (this.kt = !0, t().catch((t => {
6312
+ this.Ot = t, this.kt = !1;
6303
6313
  const e =
6304
6314
  /**
6305
6315
  * Chrome includes Error.message in Error.stack. Other browsers do not.
@@ -6340,38 +6350,38 @@ class Ur {
6340
6350
  // all further attempts to chain (via .then) will just short-circuit
6341
6351
  // and return the rejected Promise.
6342
6352
  throw p("INTERNAL UNHANDLED ERROR: ", e), t;
6343
- })).then((t => (this.St = !1, t))))));
6344
- return this.Nt = e, e;
6353
+ })).then((t => (this.kt = !1, t))))));
6354
+ return this.xt = e, e;
6345
6355
  }
6346
6356
  enqueueAfterDelay(t, e, n) {
6347
- this.Ct(),
6357
+ this.Ut(),
6348
6358
  // Fast-forward delays for timerIds that have been overriden.
6349
- this.Ot.indexOf(t) > -1 && (e = 0);
6350
- const r = Br.createAndSchedule(this, t, e, n, (t => this.Ut(t)));
6351
- return this.xt.push(r), r;
6359
+ this.Lt.indexOf(t) > -1 && (e = 0);
6360
+ const r = Br.createAndSchedule(this, t, e, n, (t => this.zt(t)));
6361
+ return this.qt.push(r), r;
6352
6362
  }
6353
- Ct() {
6354
- this.Ft && g();
6363
+ Ut() {
6364
+ this.Ot && g();
6355
6365
  }
6356
6366
  verifyOperationInProgress() {}
6357
6367
  /**
6358
6368
  * Waits until all currently queued tasks are finished executing. Delayed
6359
6369
  * operations are not run.
6360
- */ async jt() {
6370
+ */ async Gt() {
6361
6371
  // Operations in the queue prior to draining may have enqueued additional
6362
6372
  // operations. Keep draining the queue until the tail is no longer advanced,
6363
6373
  // which indicates that no more new operations were enqueued and that all
6364
6374
  // operations were executed.
6365
6375
  let t;
6366
6376
  do {
6367
- t = this.Nt, await t;
6368
- } while (t !== this.Nt);
6377
+ t = this.xt, await t;
6378
+ } while (t !== this.xt);
6369
6379
  }
6370
6380
  /**
6371
6381
  * For Tests: Determine if a delayed operation with a particular TimerId
6372
6382
  * exists.
6373
- */ Bt(t) {
6374
- for (const e of this.xt) if (e.timerId === t) return !0;
6383
+ */ Wt(t) {
6384
+ for (const e of this.qt) if (e.timerId === t) return !0;
6375
6385
  return !1;
6376
6386
  }
6377
6387
  /**
@@ -6380,24 +6390,24 @@ class Ur {
6380
6390
  * @param lastTimerId - Delayed operations up to and including this TimerId
6381
6391
  * will be drained. Pass TimerId.All to run all delayed operations.
6382
6392
  * @returns a Promise that resolves once all operations have been run.
6383
- */ zt(t) {
6393
+ */ Kt(t) {
6384
6394
  // Note that draining may generate more delayed ops, so we do that first.
6385
- return this.jt().then((() => {
6395
+ return this.Gt().then((() => {
6386
6396
  // Run ops in the same order they'd run if they ran naturally.
6387
- this.xt.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));
6388
- for (const e of this.xt) if (e.skipDelay(), "all" /* All */ !== t && e.timerId === t) break;
6389
- return this.jt();
6397
+ this.qt.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));
6398
+ for (const e of this.qt) if (e.skipDelay(), "all" /* All */ !== t && e.timerId === t) break;
6399
+ return this.Gt();
6390
6400
  }));
6391
6401
  }
6392
6402
  /**
6393
6403
  * For Tests: Skip all subsequent delays for a timer id.
6394
- */ Gt(t) {
6395
- this.Ot.push(t);
6404
+ */ Qt(t) {
6405
+ this.Lt.push(t);
6396
6406
  }
6397
- /** Called once a DelayedOperation is run or canceled. */ Ut(t) {
6407
+ /** Called once a DelayedOperation is run or canceled. */ zt(t) {
6398
6408
  // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.
6399
- const e = this.xt.indexOf(t);
6400
- this.xt.splice(e, 1);
6409
+ const e = this.qt.indexOf(t);
6410
+ this.qt.splice(e, 1);
6401
6411
  }
6402
6412
  }
6403
6413
 
@@ -6485,7 +6495,7 @@ class Gr {
6485
6495
  return e && r._setSettings(e), r;
6486
6496
  }), "PUBLIC")),
6487
6497
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
6488
- registerVersion("firestore-lite", "3.4.13", ""), registerVersion("firestore-lite", "3.4.13", "esm2017");
6498
+ registerVersion("firestore-lite", "3.4.14-canary.47895fe5b", ""), registerVersion("firestore-lite", "3.4.14-canary.47895fe5b", "esm2017");
6489
6499
 
6490
6500
  export { In as Bytes, pn as CollectionReference, wn as DocumentReference, Zn as DocumentSnapshot, En as FieldPath, An as FieldValue, an as Firestore, L as FirestoreError, Rn as GeoPoint, mn as Query, sr as QueryConstraint, tr as QueryDocumentSnapshot, er as QuerySnapshot, gt as Timestamp, Gr as Transaction, Or as WriteBatch, Dr as addDoc, Sr as arrayRemove, Fr as arrayUnion, yn as collection, _n as collectionGroup, fn as connectFirestoreEmulator, Nr as deleteDoc, $r as deleteField, gn as doc, Tn as documentId, _r as endAt, yr as endBefore, Ar as getDoc, Rr as getDocs, ln as getFirestore, qr as increment, hn as initializeFirestore, lr as limit, fr as limitToLast, ar as orderBy, ir as query, bn as queryEqual, vn as refEqual, Wr as runTransaction, xr as serverTimestamp, Pr as setDoc, w as setLogLevel, nr as snapshotEqual, mr as startAfter, wr as startAt, dn as terminate, Vr as updateDoc, ur as where, Cr as writeBatch };
6491
6501
  //# sourceMappingURL=index.browser.esm2017.js.map