@firebase/firestore 3.4.9 → 3.4.10-canary.8e952e2ee

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 (147) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/firestore/src/api/transaction.d.ts +2 -0
  3. package/dist/firestore/src/core/component_provider.d.ts +11 -6
  4. package/dist/firestore/src/lite-api/transaction.d.ts +2 -0
  5. package/dist/firestore/src/local/document_overlay_cache.d.ts +5 -0
  6. package/dist/firestore/src/local/index_backfiller.d.ts +44 -0
  7. package/dist/firestore/src/local/index_manager.d.ts +2 -0
  8. package/dist/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
  9. package/dist/firestore/src/local/indexeddb_index_manager.d.ts +1 -0
  10. package/dist/firestore/src/local/indexeddb_schema.d.ts +3 -2
  11. package/dist/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  12. package/dist/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
  13. package/dist/firestore/src/local/local_documents_view.d.ts +64 -9
  14. package/dist/firestore/src/local/local_store.d.ts +9 -0
  15. package/dist/firestore/src/local/lru_garbage_collector_impl.d.ts +5 -5
  16. package/dist/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
  17. package/dist/firestore/src/local/memory_index_manager.d.ts +1 -0
  18. package/dist/firestore/src/local/overlayed_document.d.ts +36 -0
  19. package/dist/firestore/src/local/persistence.d.ts +3 -5
  20. package/dist/firestore/src/local/persistence_promise.d.ts +11 -0
  21. package/dist/firestore/src/local/query_engine.d.ts +1 -1
  22. package/dist/firestore/src/model/collections.d.ts +8 -2
  23. package/dist/firestore/src/model/field_mask.d.ts +6 -0
  24. package/dist/firestore/src/model/mutation.d.ts +19 -1
  25. package/dist/firestore/src/model/mutation_batch.d.ts +8 -4
  26. package/dist/firestore/src/tsdoc-metadata.json +11 -11
  27. package/dist/firestore/src/util/async_queue.d.ts +5 -1
  28. package/dist/firestore/test/unit/local/index_backfiller.test.d.ts +17 -0
  29. package/dist/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
  30. package/dist/firestore/test/unit/specs/spec_test_components.d.ts +5 -3
  31. package/dist/firestore/test/util/helpers.d.ts +13 -0
  32. package/dist/index.d.ts +4 -2
  33. package/dist/index.esm2017.js +10698 -10303
  34. package/dist/index.esm2017.js.map +1 -1
  35. package/dist/index.esm5.js +10986 -10471
  36. package/dist/index.esm5.js.map +1 -1
  37. package/dist/index.node.cjs.js +6349 -5731
  38. package/dist/index.node.cjs.js.map +1 -1
  39. package/dist/index.node.mjs +6349 -5731
  40. package/dist/index.node.mjs.map +1 -1
  41. package/dist/index.rn.js +10687 -10291
  42. package/dist/index.rn.js.map +1 -1
  43. package/dist/internal.d.ts +6137 -5964
  44. package/dist/lite/firestore/src/api/transaction.d.ts +2 -0
  45. package/dist/lite/firestore/src/core/component_provider.d.ts +11 -6
  46. package/dist/lite/firestore/src/lite-api/transaction.d.ts +2 -0
  47. package/dist/lite/firestore/src/local/document_overlay_cache.d.ts +5 -0
  48. package/dist/lite/firestore/src/local/index_backfiller.d.ts +44 -0
  49. package/dist/lite/firestore/src/local/index_manager.d.ts +2 -0
  50. package/dist/lite/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
  51. package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +1 -0
  52. package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +3 -2
  53. package/dist/lite/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  54. package/dist/lite/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
  55. package/dist/lite/firestore/src/local/local_documents_view.d.ts +64 -9
  56. package/dist/lite/firestore/src/local/local_store.d.ts +9 -0
  57. package/dist/lite/firestore/src/local/lru_garbage_collector_impl.d.ts +5 -5
  58. package/dist/lite/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
  59. package/dist/lite/firestore/src/local/memory_index_manager.d.ts +1 -0
  60. package/dist/lite/firestore/src/local/overlayed_document.d.ts +36 -0
  61. package/dist/lite/firestore/src/local/persistence.d.ts +3 -5
  62. package/dist/lite/firestore/src/local/persistence_promise.d.ts +11 -0
  63. package/dist/lite/firestore/src/local/query_engine.d.ts +1 -1
  64. package/dist/lite/firestore/src/model/collections.d.ts +8 -2
  65. package/dist/lite/firestore/src/model/field_mask.d.ts +6 -0
  66. package/dist/lite/firestore/src/model/mutation.d.ts +19 -1
  67. package/dist/lite/firestore/src/model/mutation_batch.d.ts +8 -4
  68. package/dist/lite/firestore/src/util/async_queue.d.ts +5 -1
  69. package/dist/lite/firestore/test/unit/local/index_backfiller.test.d.ts +17 -0
  70. package/dist/lite/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
  71. package/dist/lite/firestore/test/unit/specs/spec_test_components.d.ts +5 -3
  72. package/dist/lite/firestore/test/util/helpers.d.ts +13 -0
  73. package/dist/lite/index.browser.esm2017.js +1220 -738
  74. package/dist/lite/index.browser.esm2017.js.map +1 -1
  75. package/dist/lite/index.browser.esm5.js +1156 -764
  76. package/dist/lite/index.browser.esm5.js.map +1 -1
  77. package/dist/lite/index.d.ts +2 -0
  78. package/dist/lite/index.node.cjs.js +655 -2
  79. package/dist/lite/index.node.cjs.js.map +1 -1
  80. package/dist/lite/index.node.mjs +655 -2
  81. package/dist/lite/index.node.mjs.map +1 -1
  82. package/dist/lite/index.rn.esm2017.js +1184 -702
  83. package/dist/lite/index.rn.esm2017.js.map +1 -1
  84. package/dist/lite/internal.d.ts +2916 -2898
  85. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +106 -104
  86. package/dist/lite/packages/firestore/src/api/transaction.d.ts +2 -0
  87. package/dist/lite/packages/firestore/src/core/component_provider.d.ts +11 -6
  88. package/dist/lite/packages/firestore/src/lite-api/transaction.d.ts +2 -0
  89. package/dist/lite/packages/firestore/src/local/document_overlay_cache.d.ts +5 -0
  90. package/dist/lite/packages/firestore/src/local/index_backfiller.d.ts +44 -0
  91. package/dist/lite/packages/firestore/src/local/index_manager.d.ts +2 -0
  92. package/dist/lite/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
  93. package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +1 -0
  94. package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +3 -2
  95. package/dist/lite/packages/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  96. package/dist/lite/packages/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
  97. package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +64 -9
  98. package/dist/lite/packages/firestore/src/local/local_store.d.ts +9 -0
  99. package/dist/lite/packages/firestore/src/local/lru_garbage_collector_impl.d.ts +5 -5
  100. package/dist/lite/packages/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
  101. package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +1 -0
  102. package/dist/lite/packages/firestore/src/local/overlayed_document.d.ts +36 -0
  103. package/dist/lite/packages/firestore/src/local/persistence.d.ts +3 -5
  104. package/dist/lite/packages/firestore/src/local/persistence_promise.d.ts +11 -0
  105. package/dist/lite/packages/firestore/src/local/query_engine.d.ts +1 -1
  106. package/dist/lite/packages/firestore/src/model/collections.d.ts +8 -2
  107. package/dist/lite/packages/firestore/src/model/field_mask.d.ts +6 -0
  108. package/dist/lite/packages/firestore/src/model/mutation.d.ts +19 -1
  109. package/dist/lite/packages/firestore/src/model/mutation_batch.d.ts +8 -4
  110. package/dist/lite/packages/firestore/src/util/async_queue.d.ts +5 -1
  111. package/dist/lite/packages/firestore/test/unit/local/index_backfiller.test.d.ts +17 -0
  112. package/dist/lite/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
  113. package/dist/lite/packages/firestore/test/unit/specs/spec_test_components.d.ts +5 -3
  114. package/dist/lite/packages/firestore/test/util/helpers.d.ts +13 -0
  115. package/dist/lite/private.d.ts +2776 -2758
  116. package/dist/packages/firestore/dist/index.esm2017.d.ts +203 -201
  117. package/dist/packages/firestore/src/api/transaction.d.ts +2 -0
  118. package/dist/packages/firestore/src/core/component_provider.d.ts +11 -6
  119. package/dist/packages/firestore/src/lite-api/transaction.d.ts +2 -0
  120. package/dist/packages/firestore/src/local/document_overlay_cache.d.ts +5 -0
  121. package/dist/packages/firestore/src/local/index_backfiller.d.ts +44 -0
  122. package/dist/packages/firestore/src/local/index_manager.d.ts +2 -0
  123. package/dist/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
  124. package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +1 -0
  125. package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +3 -2
  126. package/dist/packages/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  127. package/dist/packages/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
  128. package/dist/packages/firestore/src/local/local_documents_view.d.ts +64 -9
  129. package/dist/packages/firestore/src/local/local_store.d.ts +9 -0
  130. package/dist/packages/firestore/src/local/lru_garbage_collector_impl.d.ts +5 -5
  131. package/dist/packages/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
  132. package/dist/packages/firestore/src/local/memory_index_manager.d.ts +1 -0
  133. package/dist/packages/firestore/src/local/overlayed_document.d.ts +36 -0
  134. package/dist/packages/firestore/src/local/persistence.d.ts +3 -5
  135. package/dist/packages/firestore/src/local/persistence_promise.d.ts +11 -0
  136. package/dist/packages/firestore/src/local/query_engine.d.ts +1 -1
  137. package/dist/packages/firestore/src/model/collections.d.ts +8 -2
  138. package/dist/packages/firestore/src/model/field_mask.d.ts +6 -0
  139. package/dist/packages/firestore/src/model/mutation.d.ts +19 -1
  140. package/dist/packages/firestore/src/model/mutation_batch.d.ts +8 -4
  141. package/dist/packages/firestore/src/util/async_queue.d.ts +5 -1
  142. package/dist/packages/firestore/test/unit/local/index_backfiller.test.d.ts +17 -0
  143. package/dist/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
  144. package/dist/packages/firestore/test/unit/specs/spec_test_components.d.ts +5 -3
  145. package/dist/packages/firestore/test/util/helpers.d.ts +13 -0
  146. package/dist/private.d.ts +5845 -5672
  147. package/package.json +19 -17
@@ -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.8.0";
66
+ let f = "9.8.3-canary.8e952e2ee";
67
67
 
68
68
  /**
69
69
  * @license
@@ -190,14 +190,14 @@ function p(t, ...e) {
190
190
  * given message if it did.
191
191
  *
192
192
  * Messages are stripped in production builds.
193
- */ function b(t, e) {
193
+ */ function v(t, e) {
194
194
  t || g();
195
195
  }
196
196
 
197
197
  /**
198
198
  * Casts `obj` to `T`. In non-production builds, verifies that `obj` is an
199
199
  * instance of `T` before casting.
200
- */ function v(t,
200
+ */ function b(t,
201
201
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
202
202
  e) {
203
203
  return t;
@@ -218,9 +218,9 @@ e) {
218
218
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
219
219
  * See the License for the specific language governing permissions and
220
220
  * limitations under the License.
221
- */ const E = "ok", T = "cancelled", A = "unknown", I = "invalid-argument", R = "deadline-exceeded", P = "not-found", V = "already-exists", D = "permission-denied", N = "unauthenticated", $ = "resource-exhausted", S = "failed-precondition", x = "aborted", F = "out-of-range", q = "unimplemented", O = "internal", C = "unavailable", L = "data-loss";
221
+ */ const E = "ok", T = "cancelled", I = "unknown", A = "invalid-argument", R = "deadline-exceeded", P = "not-found", V = "already-exists", N = "permission-denied", D = "unauthenticated", $ = "resource-exhausted", x = "failed-precondition", F = "aborted", S = "out-of-range", q = "unimplemented", O = "internal", k = "unavailable", C = "data-loss";
222
222
 
223
- /** An error returned by a Firestore operation. */ class U extends FirebaseError {
223
+ /** An error returned by a Firestore operation. */ class L extends FirebaseError {
224
224
  /** @hideconstructor */
225
225
  constructor(
226
226
  /**
@@ -254,7 +254,7 @@ e) {
254
254
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
255
255
  * See the License for the specific language governing permissions and
256
256
  * limitations under the License.
257
- */ class k {
257
+ */ class M {
258
258
  constructor() {
259
259
  this.promise = new Promise(((t, e) => {
260
260
  this.resolve = t, this.reject = e;
@@ -277,7 +277,7 @@ e) {
277
277
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
278
278
  * See the License for the specific language governing permissions and
279
279
  * limitations under the License.
280
- */ class j {
280
+ */ class U {
281
281
  constructor(t, e) {
282
282
  this.user = e, this.type = "OAuth", this.headers = new Map, this.headers.set("Authorization", `Bearer ${t}`);
283
283
  }
@@ -286,7 +286,7 @@ e) {
286
286
  /**
287
287
  * A CredentialsProvider that always yields an empty token.
288
288
  * @internal
289
- */ class M {
289
+ */ class j {
290
290
  getToken() {
291
291
  return Promise.resolve(null);
292
292
  }
@@ -332,8 +332,8 @@ e) {
332
332
  }));
333
333
  }
334
334
  getToken() {
335
- return this.auth ? this.auth.getToken().then((t => t ? (b("string" == typeof t.accessToken),
336
- new j(t.accessToken, new l(this.auth.getUid()))) : null)) : Promise.resolve(null);
335
+ return this.auth ? this.auth.getToken().then((t => t ? (v("string" == typeof t.accessToken),
336
+ new U(t.accessToken, new l(this.auth.getUid()))) : null)) : Promise.resolve(null);
337
337
  }
338
338
  invalidateToken() {}
339
339
  start(t, e) {}
@@ -358,7 +358,7 @@ e) {
358
358
  * Provides user credentials required for the Firestore JavaScript SDK
359
359
  * to authenticate the user, using technique that is only available
360
360
  * to applications hosted by Google.
361
- */ class Q {
361
+ */ class W {
362
362
  constructor(t, e, n) {
363
363
  this.t = t, this.i = e, this.o = n;
364
364
  }
@@ -373,21 +373,21 @@ e) {
373
373
  invalidateToken() {}
374
374
  }
375
375
 
376
- class W {
376
+ class K {
377
377
  constructor(t) {
378
378
  this.value = t, this.type = "AppCheck", this.headers = new Map, t && t.length > 0 && this.headers.set("x-firebase-appcheck", this.value);
379
379
  }
380
380
  }
381
381
 
382
- /** AppCheck token provider for the Lite SDK. */ class Y {
382
+ /** AppCheck token provider for the Lite SDK. */ class Q {
383
383
  constructor(t) {
384
384
  this.u = t, this.appCheck = null, t.onInit((t => {
385
385
  this.appCheck = t;
386
386
  }));
387
387
  }
388
388
  getToken() {
389
- return this.appCheck ? this.appCheck.getToken().then((t => t ? (b("string" == typeof t.token),
390
- new W(t.token)) : null)) : Promise.resolve(null);
389
+ return this.appCheck ? this.appCheck.getToken().then((t => t ? (v("string" == typeof t.token),
390
+ new K(t.token)) : null)) : Promise.resolve(null);
391
391
  }
392
392
  invalidateToken() {}
393
393
  start(t, e) {}
@@ -414,7 +414,7 @@ class W {
414
414
  * See the License for the specific language governing permissions and
415
415
  * limitations under the License.
416
416
  */
417
- class H {
417
+ class Y {
418
418
  /**
419
419
  * Constructs a DatabaseInfo using the provided host, databaseId and
420
420
  * persistenceKey.
@@ -443,18 +443,18 @@ class H {
443
443
  * Represents the database ID a Firestore client is associated with.
444
444
  * @internal
445
445
  */
446
- class K {
446
+ class H {
447
447
  constructor(t, e) {
448
448
  this.projectId = t, this.database = e || "(default)";
449
449
  }
450
450
  static empty() {
451
- return new K("", "");
451
+ return new H("", "");
452
452
  }
453
453
  get isDefaultDatabase() {
454
454
  return "(default)" === this.database;
455
455
  }
456
456
  isEqual(t) {
457
- return t instanceof K && t.projectId === this.projectId && t.database === this.database;
457
+ return t instanceof H && t.projectId === this.projectId && t.database === this.database;
458
458
  }
459
459
  }
460
460
 
@@ -570,7 +570,7 @@ class J {
570
570
  // for legacy reasons and should not be used frequently).
571
571
  const e = [];
572
572
  for (const n of t) {
573
- if (n.indexOf("//") >= 0) throw new U(I, `Invalid segment (${n}). Paths must not contain // in them.`);
573
+ if (n.indexOf("//") >= 0) throw new L(A, `Invalid segment (${n}). Paths must not contain // in them.`);
574
574
  // Strip leading and traling slashed.
575
575
  e.push(...n.split("/").filter((t => t.length > 0)));
576
576
  }
@@ -626,20 +626,20 @@ const Z = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
626
626
  const e = [];
627
627
  let n = "", r = 0;
628
628
  const s = () => {
629
- if (0 === n.length) throw new U(I, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
629
+ if (0 === n.length) throw new L(A, `Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);
630
630
  e.push(n), n = "";
631
631
  };
632
632
  let i = !1;
633
633
  for (;r < t.length; ) {
634
634
  const e = t[r];
635
635
  if ("\\" === e) {
636
- if (r + 1 === t.length) throw new U(I, "Path has trailing escape character: " + t);
636
+ if (r + 1 === t.length) throw new L(A, "Path has trailing escape character: " + t);
637
637
  const e = t[r + 1];
638
- if ("\\" !== e && "." !== e && "`" !== e) throw new U(I, "Path has invalid escape sequence: " + t);
638
+ if ("\\" !== e && "." !== e && "`" !== e) throw new L(A, "Path has invalid escape sequence: " + t);
639
639
  n += e, r += 2;
640
640
  } else "`" === e ? (i = !i, r++) : "." !== e || i ? (n += e, r++) : (s(), r++);
641
641
  }
642
- if (s(), i) throw new U(I, "Unterminated ` in path: " + t);
642
+ if (s(), i) throw new L(A, "Unterminated ` in path: " + t);
643
643
  return new tt(e);
644
644
  }
645
645
  static emptyPath() {
@@ -728,7 +728,7 @@ const Z = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
728
728
  * See the License for the specific language governing permissions and
729
729
  * limitations under the License.
730
730
  */ function nt(t, e, n) {
731
- if (!n) throw new U(I, `Function ${t}() cannot be called with an empty ${e}.`);
731
+ if (!n) throw new L(A, `Function ${t}() cannot be called with an empty ${e}.`);
732
732
  }
733
733
 
734
734
  /**
@@ -740,14 +740,14 @@ const Z = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
740
740
  * an even numbers of segments).
741
741
  */
742
742
  function rt(t) {
743
- if (!et.isDocumentKey(t)) throw new U(I, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);
743
+ if (!et.isDocumentKey(t)) throw new L(A, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);
744
744
  }
745
745
 
746
746
  /**
747
747
  * Validates that `path` refers to a collection (indicated by the fact it
748
748
  * contains an odd numbers of segments).
749
749
  */ function st(t) {
750
- if (et.isDocumentKey(t)) throw new U(I, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);
750
+ if (et.isDocumentKey(t)) throw new L(A, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);
751
751
  }
752
752
 
753
753
  /**
@@ -791,17 +791,17 @@ e) {
791
791
  // Unwrap Compat types
792
792
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
793
793
  t = t._delegate), !(t instanceof e)) {
794
- if (e.name === t.constructor.name) throw new U(I, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
794
+ if (e.name === t.constructor.name) throw new L(A, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
795
795
  {
796
796
  const n = it(t);
797
- throw new U(I, `Expected type '${e.name}', but it was: ${n}`);
797
+ throw new L(A, `Expected type '${e.name}', but it was: ${n}`);
798
798
  }
799
799
  }
800
800
  return t;
801
801
  }
802
802
 
803
803
  function ut(t, e) {
804
- if (e <= 0) throw new U(I, `Function ${t}() requires a positive number, but it was: ${e}.`);
804
+ if (e <= 0) throw new L(A, `Function ${t}() requires a positive number, but it was: ${e}.`);
805
805
  }
806
806
 
807
807
  /**
@@ -899,7 +899,7 @@ var lt, ft;
899
899
  * Code.UNKNOWN.
900
900
  */
901
901
  function dt(t) {
902
- if (void 0 === t) return p("RPC_ERROR", "HTTP error has no status"), A;
902
+ if (void 0 === t) return p("RPC_ERROR", "HTTP error has no status"), I;
903
903
  // The canonical error codes for Google APIs [1] specify mapping onto HTTP
904
904
  // status codes but the mapping is not bijective. In each case of ambiguity
905
905
  // this function chooses a primary error.
@@ -913,18 +913,18 @@ function dt(t) {
913
913
 
914
914
  case 400:
915
915
  // Bad Request
916
- return S;
916
+ return x;
917
917
 
918
918
  // Other possibilities based on the forward mapping
919
919
  // return Code.INVALID_ARGUMENT;
920
920
  // return Code.OUT_OF_RANGE;
921
921
  case 401:
922
922
  // Unauthorized
923
- return N;
923
+ return D;
924
924
 
925
925
  case 403:
926
926
  // Forbidden
927
- return D;
927
+ return N;
928
928
 
929
929
  case 404:
930
930
  // Not Found
@@ -932,13 +932,13 @@ function dt(t) {
932
932
 
933
933
  case 409:
934
934
  // Conflict
935
- return x;
935
+ return F;
936
936
 
937
937
  // Other possibilities:
938
938
  // return Code.ALREADY_EXISTS;
939
939
  case 416:
940
940
  // Range Not Satisfiable
941
- return F;
941
+ return S;
942
942
 
943
943
  case 429:
944
944
  // Too Many Requests
@@ -950,7 +950,7 @@ function dt(t) {
950
950
 
951
951
  case 500:
952
952
  // Internal Server Error
953
- return A;
953
+ return I;
954
954
 
955
955
  // Other possibilities:
956
956
  // return Code.INTERNAL;
@@ -961,14 +961,14 @@ function dt(t) {
961
961
 
962
962
  case 503:
963
963
  // Service Unavailable
964
- return C;
964
+ return k;
965
965
 
966
966
  case 504:
967
967
  // Gateway Timeout
968
968
  return R;
969
969
 
970
970
  default:
971
- return t >= 200 && t < 300 ? E : t >= 400 && t < 500 ? S : t >= 500 && t < 600 ? O : A;
971
+ return t >= 200 && t < 300 ? E : t >= 400 && t < 500 ? x : t >= 500 && t < 600 ? O : I;
972
972
  }
973
973
  }
974
974
 
@@ -1048,24 +1048,24 @@ class {
1048
1048
  * @param fetchImpl - `fetch` or a Polyfill that implements the fetch API.
1049
1049
  */
1050
1050
  constructor(t, e) {
1051
- super(t), this.A = e;
1051
+ super(t), this.I = e;
1052
1052
  }
1053
- I(t, e) {
1053
+ A(t, e) {
1054
1054
  throw new Error("Not supported by FetchConnection");
1055
1055
  }
1056
1056
  async v(t, e, n, r) {
1057
1057
  const s = JSON.stringify(r);
1058
1058
  let i;
1059
1059
  try {
1060
- i = await this.A(e, {
1060
+ i = await this.I(e, {
1061
1061
  method: "POST",
1062
1062
  headers: n,
1063
1063
  body: s
1064
1064
  });
1065
1065
  } catch (t) {
1066
- throw new U(dt(t.status), "Request failed with error: " + t.statusText);
1066
+ throw new L(dt(t.status), "Request failed with error: " + t.statusText);
1067
1067
  }
1068
- if (!i.ok) throw new U(dt(i.status), "Request failed with error: " + i.statusText);
1068
+ if (!i.ok) throw new L(dt(i.status), "Request failed with error: " + i.statusText);
1069
1069
  return i.json();
1070
1070
  }
1071
1071
  }
@@ -1211,11 +1211,11 @@ class gt {
1211
1211
  * The fractions of a second at nanosecond resolution.*
1212
1212
  */
1213
1213
  e) {
1214
- if (this.seconds = t, this.nanoseconds = e, e < 0) throw new U(I, "Timestamp nanoseconds out of range: " + e);
1215
- if (e >= 1e9) throw new U(I, "Timestamp nanoseconds out of range: " + e);
1216
- if (t < -62135596800) throw new U(I, "Timestamp seconds out of range: " + t);
1214
+ if (this.seconds = t, this.nanoseconds = e, e < 0) throw new L(A, "Timestamp nanoseconds out of range: " + e);
1215
+ if (e >= 1e9) throw new L(A, "Timestamp nanoseconds out of range: " + e);
1216
+ if (t < -62135596800) throw new L(A, "Timestamp seconds out of range: " + t);
1217
1217
  // This will break in the year 10,000.
1218
- if (t >= 253402300800) throw new U(I, "Timestamp seconds out of range: " + t);
1218
+ if (t >= 253402300800) throw new L(A, "Timestamp seconds out of range: " + t);
1219
1219
  }
1220
1220
  /**
1221
1221
  * Creates a new timestamp with the current date, with millisecond precision.
@@ -1320,18 +1320,18 @@ class gt {
1320
1320
  /**
1321
1321
  * A version of a document in Firestore. This corresponds to the version
1322
1322
  * timestamp, such as update_time or read_time.
1323
- */ class bt {
1323
+ */ class vt {
1324
1324
  constructor(t) {
1325
1325
  this.timestamp = t;
1326
1326
  }
1327
1327
  static fromTimestamp(t) {
1328
- return new bt(t);
1328
+ return new vt(t);
1329
1329
  }
1330
1330
  static min() {
1331
- return new bt(new gt(0, 0));
1331
+ return new vt(new gt(0, 0));
1332
1332
  }
1333
1333
  static max() {
1334
- return new bt(new gt(253402300799, 999999999));
1334
+ return new vt(new gt(253402300799, 999999999));
1335
1335
  }
1336
1336
  compareTo(t) {
1337
1337
  return this.timestamp._compareTo(t.timestamp);
@@ -1366,7 +1366,7 @@ class gt {
1366
1366
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1367
1367
  * See the License for the specific language governing permissions and
1368
1368
  * limitations under the License.
1369
- */ function vt(t) {
1369
+ */ function bt(t) {
1370
1370
  let e = 0;
1371
1371
  for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e++;
1372
1372
  return e;
@@ -1376,6 +1376,462 @@ function Et(t, e) {
1376
1376
  for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);
1377
1377
  }
1378
1378
 
1379
+ /**
1380
+ * @license
1381
+ * Copyright 2017 Google LLC
1382
+ *
1383
+ * Licensed under the Apache License, Version 2.0 (the "License");
1384
+ * you may not use this file except in compliance with the License.
1385
+ * You may obtain a copy of the License at
1386
+ *
1387
+ * http://www.apache.org/licenses/LICENSE-2.0
1388
+ *
1389
+ * Unless required by applicable law or agreed to in writing, software
1390
+ * distributed under the License is distributed on an "AS IS" BASIS,
1391
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1392
+ * See the License for the specific language governing permissions and
1393
+ * limitations under the License.
1394
+ */
1395
+ // An immutable sorted map implementation, based on a Left-leaning Red-Black
1396
+ // tree.
1397
+ class Tt {
1398
+ constructor(t, e) {
1399
+ this.comparator = t, this.root = e || At.EMPTY;
1400
+ }
1401
+ // Returns a copy of the map, with the specified key/value added or replaced.
1402
+ insert(t, e) {
1403
+ return new Tt(this.comparator, this.root.insert(t, e, this.comparator).copy(null, null, At.BLACK, null, null));
1404
+ }
1405
+ // Returns a copy of the map, with the specified key removed.
1406
+ remove(t) {
1407
+ return new Tt(this.comparator, this.root.remove(t, this.comparator).copy(null, null, At.BLACK, null, null));
1408
+ }
1409
+ // Returns the value of the node with the given key, or null.
1410
+ get(t) {
1411
+ let e = this.root;
1412
+ for (;!e.isEmpty(); ) {
1413
+ const n = this.comparator(t, e.key);
1414
+ if (0 === n) return e.value;
1415
+ n < 0 ? e = e.left : n > 0 && (e = e.right);
1416
+ }
1417
+ return null;
1418
+ }
1419
+ // Returns the index of the element in this sorted map, or -1 if it doesn't
1420
+ // exist.
1421
+ indexOf(t) {
1422
+ // Number of nodes that were pruned when descending right
1423
+ let e = 0, n = this.root;
1424
+ for (;!n.isEmpty(); ) {
1425
+ const r = this.comparator(t, n.key);
1426
+ if (0 === r) return e + n.left.size;
1427
+ r < 0 ? n = n.left : (
1428
+ // Count all nodes left of the node plus the node itself
1429
+ e += n.left.size + 1, n = n.right);
1430
+ }
1431
+ // Node not found
1432
+ return -1;
1433
+ }
1434
+ isEmpty() {
1435
+ return this.root.isEmpty();
1436
+ }
1437
+ // Returns the total number of nodes in the map.
1438
+ get size() {
1439
+ return this.root.size;
1440
+ }
1441
+ // Returns the minimum key in the map.
1442
+ minKey() {
1443
+ return this.root.minKey();
1444
+ }
1445
+ // Returns the maximum key in the map.
1446
+ maxKey() {
1447
+ return this.root.maxKey();
1448
+ }
1449
+ // Traverses the map in key order and calls the specified action function
1450
+ // for each key/value pair. If action returns true, traversal is aborted.
1451
+ // Returns the first truthy value returned by action, or the last falsey
1452
+ // value returned by action.
1453
+ inorderTraversal(t) {
1454
+ return this.root.inorderTraversal(t);
1455
+ }
1456
+ forEach(t) {
1457
+ this.inorderTraversal(((e, n) => (t(e, n), !1)));
1458
+ }
1459
+ toString() {
1460
+ const t = [];
1461
+ return this.inorderTraversal(((e, n) => (t.push(`${e}:${n}`), !1))), `{${t.join(", ")}}`;
1462
+ }
1463
+ // Traverses the map in reverse key order and calls the specified action
1464
+ // function for each key/value pair. If action returns true, traversal is
1465
+ // aborted.
1466
+ // Returns the first truthy value returned by action, or the last falsey
1467
+ // value returned by action.
1468
+ reverseTraversal(t) {
1469
+ return this.root.reverseTraversal(t);
1470
+ }
1471
+ // Returns an iterator over the SortedMap.
1472
+ getIterator() {
1473
+ return new It(this.root, null, this.comparator, !1);
1474
+ }
1475
+ getIteratorFrom(t) {
1476
+ return new It(this.root, t, this.comparator, !1);
1477
+ }
1478
+ getReverseIterator() {
1479
+ return new It(this.root, null, this.comparator, !0);
1480
+ }
1481
+ getReverseIteratorFrom(t) {
1482
+ return new It(this.root, t, this.comparator, !0);
1483
+ }
1484
+ }
1485
+
1486
+ // end SortedMap
1487
+ // An iterator over an LLRBNode.
1488
+ class It {
1489
+ constructor(t, e, n, r) {
1490
+ this.isReverse = r, this.nodeStack = [];
1491
+ let s = 1;
1492
+ for (;!t.isEmpty(); ) if (s = e ? n(t.key, e) : 1,
1493
+ // flip the comparison if we're going in reverse
1494
+ e && r && (s *= -1), s < 0)
1495
+ // This node is less than our start key. ignore it
1496
+ t = this.isReverse ? t.left : t.right; else {
1497
+ if (0 === s) {
1498
+ // This node is exactly equal to our start key. Push it on the stack,
1499
+ // but stop iterating;
1500
+ this.nodeStack.push(t);
1501
+ break;
1502
+ }
1503
+ // This node is greater than our start key, add it to the stack and move
1504
+ // to the next one
1505
+ this.nodeStack.push(t), t = this.isReverse ? t.right : t.left;
1506
+ }
1507
+ }
1508
+ getNext() {
1509
+ let t = this.nodeStack.pop();
1510
+ const e = {
1511
+ key: t.key,
1512
+ value: t.value
1513
+ };
1514
+ if (this.isReverse) for (t = t.left; !t.isEmpty(); ) this.nodeStack.push(t), t = t.right; else for (t = t.right; !t.isEmpty(); ) this.nodeStack.push(t),
1515
+ t = t.left;
1516
+ return e;
1517
+ }
1518
+ hasNext() {
1519
+ return this.nodeStack.length > 0;
1520
+ }
1521
+ peek() {
1522
+ if (0 === this.nodeStack.length) return null;
1523
+ const t = this.nodeStack[this.nodeStack.length - 1];
1524
+ return {
1525
+ key: t.key,
1526
+ value: t.value
1527
+ };
1528
+ }
1529
+ }
1530
+
1531
+ // end SortedMapIterator
1532
+ // Represents a node in a Left-leaning Red-Black tree.
1533
+ class At {
1534
+ constructor(t, e, n, r, s) {
1535
+ this.key = t, this.value = e, this.color = null != n ? n : At.RED, this.left = null != r ? r : At.EMPTY,
1536
+ this.right = null != s ? s : At.EMPTY, this.size = this.left.size + 1 + this.right.size;
1537
+ }
1538
+ // Returns a copy of the current node, optionally replacing pieces of it.
1539
+ copy(t, e, n, r, s) {
1540
+ return new At(null != t ? t : this.key, null != e ? e : this.value, null != n ? n : this.color, null != r ? r : this.left, null != s ? s : this.right);
1541
+ }
1542
+ isEmpty() {
1543
+ return !1;
1544
+ }
1545
+ // Traverses the tree in key order and calls the specified action function
1546
+ // for each node. If action returns true, traversal is aborted.
1547
+ // Returns the first truthy value returned by action, or the last falsey
1548
+ // value returned by action.
1549
+ inorderTraversal(t) {
1550
+ return this.left.inorderTraversal(t) || t(this.key, this.value) || this.right.inorderTraversal(t);
1551
+ }
1552
+ // Traverses the tree in reverse key order and calls the specified action
1553
+ // function for each node. If action returns true, traversal is aborted.
1554
+ // Returns the first truthy value returned by action, or the last falsey
1555
+ // value returned by action.
1556
+ reverseTraversal(t) {
1557
+ return this.right.reverseTraversal(t) || t(this.key, this.value) || this.left.reverseTraversal(t);
1558
+ }
1559
+ // Returns the minimum node in the tree.
1560
+ min() {
1561
+ return this.left.isEmpty() ? this : this.left.min();
1562
+ }
1563
+ // Returns the maximum key in the tree.
1564
+ minKey() {
1565
+ return this.min().key;
1566
+ }
1567
+ // Returns the maximum key in the tree.
1568
+ maxKey() {
1569
+ return this.right.isEmpty() ? this.key : this.right.maxKey();
1570
+ }
1571
+ // Returns new tree, with the key/value added.
1572
+ insert(t, e, n) {
1573
+ let r = this;
1574
+ const s = n(t, r.key);
1575
+ return r = s < 0 ? r.copy(null, null, null, r.left.insert(t, e, n), null) : 0 === s ? r.copy(null, e, null, null, null) : r.copy(null, null, null, null, r.right.insert(t, e, n)),
1576
+ r.fixUp();
1577
+ }
1578
+ removeMin() {
1579
+ if (this.left.isEmpty()) return At.EMPTY;
1580
+ let t = this;
1581
+ return t.left.isRed() || t.left.left.isRed() || (t = t.moveRedLeft()), t = t.copy(null, null, null, t.left.removeMin(), null),
1582
+ t.fixUp();
1583
+ }
1584
+ // Returns new tree, with the specified item removed.
1585
+ remove(t, e) {
1586
+ let n, r = this;
1587
+ if (e(t, r.key) < 0) r.left.isEmpty() || r.left.isRed() || r.left.left.isRed() || (r = r.moveRedLeft()),
1588
+ r = r.copy(null, null, null, r.left.remove(t, e), null); else {
1589
+ if (r.left.isRed() && (r = r.rotateRight()), r.right.isEmpty() || r.right.isRed() || r.right.left.isRed() || (r = r.moveRedRight()),
1590
+ 0 === e(t, r.key)) {
1591
+ if (r.right.isEmpty()) return At.EMPTY;
1592
+ n = r.right.min(), r = r.copy(n.key, n.value, null, null, r.right.removeMin());
1593
+ }
1594
+ r = r.copy(null, null, null, null, r.right.remove(t, e));
1595
+ }
1596
+ return r.fixUp();
1597
+ }
1598
+ isRed() {
1599
+ return this.color;
1600
+ }
1601
+ // Returns new tree after performing any needed rotations.
1602
+ fixUp() {
1603
+ let t = this;
1604
+ return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()),
1605
+ t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;
1606
+ }
1607
+ moveRedLeft() {
1608
+ let t = this.colorFlip();
1609
+ return t.right.left.isRed() && (t = t.copy(null, null, null, null, t.right.rotateRight()),
1610
+ t = t.rotateLeft(), t = t.colorFlip()), t;
1611
+ }
1612
+ moveRedRight() {
1613
+ let t = this.colorFlip();
1614
+ return t.left.left.isRed() && (t = t.rotateRight(), t = t.colorFlip()), t;
1615
+ }
1616
+ rotateLeft() {
1617
+ const t = this.copy(null, null, At.RED, null, this.right.left);
1618
+ return this.right.copy(null, null, this.color, t, null);
1619
+ }
1620
+ rotateRight() {
1621
+ const t = this.copy(null, null, At.RED, this.left.right, null);
1622
+ return this.left.copy(null, null, this.color, null, t);
1623
+ }
1624
+ colorFlip() {
1625
+ const t = this.left.copy(null, null, !this.left.color, null, null), e = this.right.copy(null, null, !this.right.color, null, null);
1626
+ return this.copy(null, null, !this.color, t, e);
1627
+ }
1628
+ // For testing.
1629
+ checkMaxDepth() {
1630
+ const t = this.check();
1631
+ return Math.pow(2, t) <= this.size + 1;
1632
+ }
1633
+ // In a balanced RB tree, the black-depth (number of black nodes) from root to
1634
+ // leaves is equal on both sides. This function verifies that or asserts.
1635
+ check() {
1636
+ if (this.isRed() && this.left.isRed()) throw g();
1637
+ if (this.right.isRed()) throw g();
1638
+ const t = this.left.check();
1639
+ if (t !== this.right.check()) throw g();
1640
+ return t + (this.isRed() ? 0 : 1);
1641
+ }
1642
+ }
1643
+
1644
+ // end LLRBNode
1645
+ // Empty node is shared between all LLRB trees.
1646
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1647
+ At.EMPTY = null, At.RED = !0, At.BLACK = !1;
1648
+
1649
+ // end LLRBEmptyNode
1650
+ At.EMPTY = new
1651
+ // Represents an empty node (a leaf node in the Red-Black Tree).
1652
+ class {
1653
+ constructor() {
1654
+ this.size = 0;
1655
+ }
1656
+ get key() {
1657
+ throw g();
1658
+ }
1659
+ get value() {
1660
+ throw g();
1661
+ }
1662
+ get color() {
1663
+ throw g();
1664
+ }
1665
+ get left() {
1666
+ throw g();
1667
+ }
1668
+ get right() {
1669
+ throw g();
1670
+ }
1671
+ // Returns a copy of the current node.
1672
+ copy(t, e, n, r, s) {
1673
+ return this;
1674
+ }
1675
+ // Returns a copy of the tree, with the specified key/value added.
1676
+ insert(t, e, n) {
1677
+ return new At(t, e);
1678
+ }
1679
+ // Returns a copy of the tree, with the specified key removed.
1680
+ remove(t, e) {
1681
+ return this;
1682
+ }
1683
+ isEmpty() {
1684
+ return !0;
1685
+ }
1686
+ inorderTraversal(t) {
1687
+ return !1;
1688
+ }
1689
+ reverseTraversal(t) {
1690
+ return !1;
1691
+ }
1692
+ minKey() {
1693
+ return null;
1694
+ }
1695
+ maxKey() {
1696
+ return null;
1697
+ }
1698
+ isRed() {
1699
+ return !1;
1700
+ }
1701
+ // For testing.
1702
+ checkMaxDepth() {
1703
+ return !0;
1704
+ }
1705
+ check() {
1706
+ return 0;
1707
+ }
1708
+ };
1709
+
1710
+ /**
1711
+ * @license
1712
+ * Copyright 2017 Google LLC
1713
+ *
1714
+ * Licensed under the Apache License, Version 2.0 (the "License");
1715
+ * you may not use this file except in compliance with the License.
1716
+ * You may obtain a copy of the License at
1717
+ *
1718
+ * http://www.apache.org/licenses/LICENSE-2.0
1719
+ *
1720
+ * Unless required by applicable law or agreed to in writing, software
1721
+ * distributed under the License is distributed on an "AS IS" BASIS,
1722
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1723
+ * See the License for the specific language governing permissions and
1724
+ * limitations under the License.
1725
+ */
1726
+ /**
1727
+ * SortedSet is an immutable (copy-on-write) collection that holds elements
1728
+ * in order specified by the provided comparator.
1729
+ *
1730
+ * NOTE: if provided comparator returns 0 for two elements, we consider them to
1731
+ * be equal!
1732
+ */
1733
+ class Rt {
1734
+ constructor(t) {
1735
+ this.comparator = t, this.data = new Tt(this.comparator);
1736
+ }
1737
+ has(t) {
1738
+ return null !== this.data.get(t);
1739
+ }
1740
+ first() {
1741
+ return this.data.minKey();
1742
+ }
1743
+ last() {
1744
+ return this.data.maxKey();
1745
+ }
1746
+ get size() {
1747
+ return this.data.size;
1748
+ }
1749
+ indexOf(t) {
1750
+ return this.data.indexOf(t);
1751
+ }
1752
+ /** Iterates elements in order defined by "comparator" */ forEach(t) {
1753
+ this.data.inorderTraversal(((e, n) => (t(e), !1)));
1754
+ }
1755
+ /** Iterates over `elem`s such that: range[0] &lt;= elem &lt; range[1]. */ forEachInRange(t, e) {
1756
+ const n = this.data.getIteratorFrom(t[0]);
1757
+ for (;n.hasNext(); ) {
1758
+ const r = n.getNext();
1759
+ if (this.comparator(r.key, t[1]) >= 0) return;
1760
+ e(r.key);
1761
+ }
1762
+ }
1763
+ /**
1764
+ * Iterates over `elem`s such that: start &lt;= elem until false is returned.
1765
+ */ forEachWhile(t, e) {
1766
+ let n;
1767
+ for (n = void 0 !== e ? this.data.getIteratorFrom(e) : this.data.getIterator(); n.hasNext(); ) {
1768
+ if (!t(n.getNext().key)) return;
1769
+ }
1770
+ }
1771
+ /** Finds the least element greater than or equal to `elem`. */ firstAfterOrEqual(t) {
1772
+ const e = this.data.getIteratorFrom(t);
1773
+ return e.hasNext() ? e.getNext().key : null;
1774
+ }
1775
+ getIterator() {
1776
+ return new Pt(this.data.getIterator());
1777
+ }
1778
+ getIteratorFrom(t) {
1779
+ return new Pt(this.data.getIteratorFrom(t));
1780
+ }
1781
+ /** Inserts or updates an element */ add(t) {
1782
+ return this.copy(this.data.remove(t).insert(t, !0));
1783
+ }
1784
+ /** Deletes an element */ delete(t) {
1785
+ return this.has(t) ? this.copy(this.data.remove(t)) : this;
1786
+ }
1787
+ isEmpty() {
1788
+ return this.data.isEmpty();
1789
+ }
1790
+ unionWith(t) {
1791
+ let e = this;
1792
+ // Make sure `result` always refers to the larger one of the two sets.
1793
+ return e.size < t.size && (e = t, t = this), t.forEach((t => {
1794
+ e = e.add(t);
1795
+ })), e;
1796
+ }
1797
+ isEqual(t) {
1798
+ if (!(t instanceof Rt)) return !1;
1799
+ if (this.size !== t.size) return !1;
1800
+ const e = this.data.getIterator(), n = t.data.getIterator();
1801
+ for (;e.hasNext(); ) {
1802
+ const t = e.getNext().key, r = n.getNext().key;
1803
+ if (0 !== this.comparator(t, r)) return !1;
1804
+ }
1805
+ return !0;
1806
+ }
1807
+ toArray() {
1808
+ const t = [];
1809
+ return this.forEach((e => {
1810
+ t.push(e);
1811
+ })), t;
1812
+ }
1813
+ toString() {
1814
+ const t = [];
1815
+ return this.forEach((e => t.push(e))), "SortedSet(" + t.toString() + ")";
1816
+ }
1817
+ copy(t) {
1818
+ const e = new Rt(this.comparator);
1819
+ return e.data = t, e;
1820
+ }
1821
+ }
1822
+
1823
+ class Pt {
1824
+ constructor(t) {
1825
+ this.iter = t;
1826
+ }
1827
+ getNext() {
1828
+ return this.iter.getNext().key;
1829
+ }
1830
+ hasNext() {
1831
+ return this.iter.hasNext();
1832
+ }
1833
+ }
1834
+
1379
1835
  /**
1380
1836
  * @license
1381
1837
  * Copyright 2020 Google LLC
@@ -1401,14 +1857,25 @@ function Et(t, e) {
1401
1857
  * foo.bar - Overwrites only the field bar of the object foo.
1402
1858
  * If foo is not an object, foo is replaced with an object
1403
1859
  * containing foo
1404
- */
1405
- class Tt {
1860
+ */ class Vt {
1406
1861
  constructor(t) {
1407
1862
  this.fields = t,
1408
1863
  // TODO(dimond): validation of FieldMask
1409
1864
  // Sort the field mask to support `FieldMask.isEqual()` and assert below.
1410
1865
  t.sort(tt.comparator);
1411
1866
  }
1867
+ static empty() {
1868
+ return new Vt([]);
1869
+ }
1870
+ /**
1871
+ * Returns a new FieldMask object that is the result of adding all the given
1872
+ * fields paths to this field mask.
1873
+ */ unionWith(t) {
1874
+ let e = new Rt(tt.comparator);
1875
+ for (const t of this.fields) e = e.add(t);
1876
+ for (const n of t) e = e.add(n);
1877
+ return new Vt(e.toArray());
1878
+ }
1412
1879
  /**
1413
1880
  * Verifies that `fieldPath` is included by at least one field in this field
1414
1881
  * mask.
@@ -1465,13 +1932,13 @@ class Tt {
1465
1932
  * before being sent as a proto.
1466
1933
  * @internal
1467
1934
  */
1468
- class At {
1935
+ class Nt {
1469
1936
  constructor(t) {
1470
1937
  this.binaryString = t;
1471
1938
  }
1472
1939
  static fromBase64String(t) {
1473
1940
  const e = atob(t);
1474
- return new At(e);
1941
+ return new Nt(e);
1475
1942
  }
1476
1943
  static fromUint8Array(t) {
1477
1944
  // TODO(indexing); Remove the copy of the byte string here as this method
@@ -1488,7 +1955,7 @@ class At {
1488
1955
  /**
1489
1956
  * Helper function to convert a binary string to an Uint8Array.
1490
1957
  */ (t);
1491
- return new At(e);
1958
+ return new Nt(e);
1492
1959
  }
1493
1960
  [Symbol.iterator]() {
1494
1961
  let t = 0;
@@ -1543,24 +2010,24 @@ class At {
1543
2010
  }
1544
2011
  }
1545
2012
 
1546
- At.EMPTY_BYTE_STRING = new At("");
2013
+ Nt.EMPTY_BYTE_STRING = new Nt("");
1547
2014
 
1548
- const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
2015
+ const Dt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1549
2016
 
1550
2017
  /**
1551
2018
  * Converts the possible Proto values for a timestamp value into a "seconds and
1552
2019
  * nanos" representation.
1553
- */ function Rt(t) {
2020
+ */ function $t(t) {
1554
2021
  // The json interface (for the browser) will return an iso timestamp string,
1555
2022
  // while the proto js library (for node) will return a
1556
2023
  // google.protobuf.Timestamp instance.
1557
- if (b(!!t), "string" == typeof t) {
2024
+ if (v(!!t), "string" == typeof t) {
1558
2025
  // The date string can have higher precision (nanos) than the Date class
1559
2026
  // (millis), so we do some custom parsing here.
1560
2027
  // Parse the nanos right out of the string.
1561
2028
  let e = 0;
1562
- const n = It.exec(t);
1563
- if (b(!!n), n[1]) {
2029
+ const n = Dt.exec(t);
2030
+ if (v(!!n), n[1]) {
1564
2031
  // Pad the fraction out to 9 digits (nanos).
1565
2032
  let t = n[1];
1566
2033
  t = (t + "000000000").substr(0, 9), e = Number(t);
@@ -1573,21 +2040,21 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1573
2040
  };
1574
2041
  }
1575
2042
  return {
1576
- seconds: Pt(t.seconds),
1577
- nanos: Pt(t.nanos)
2043
+ seconds: xt(t.seconds),
2044
+ nanos: xt(t.nanos)
1578
2045
  };
1579
2046
  }
1580
2047
 
1581
2048
  /**
1582
2049
  * Converts the possible Proto types for numbers into a JavaScript number.
1583
2050
  * Returns 0 if the value is not numeric.
1584
- */ function Pt(t) {
2051
+ */ function xt(t) {
1585
2052
  // TODO(bjornick): Handle int64 greater than 53 bits.
1586
2053
  return "number" == typeof t ? t : "string" == typeof t ? Number(t) : 0;
1587
2054
  }
1588
2055
 
1589
- /** Converts the possible Proto types for Blobs into a ByteString. */ function Vt(t) {
1590
- return "string" == typeof t ? At.fromBase64String(t) : At.fromUint8Array(t);
2056
+ /** Converts the possible Proto types for Blobs into a ByteString. */ function Ft(t) {
2057
+ return "string" == typeof t ? Nt.fromBase64String(t) : Nt.fromUint8Array(t);
1591
2058
  }
1592
2059
 
1593
2060
  /**
@@ -1623,7 +2090,7 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1623
2090
  * FieldValueOptions to value().
1624
2091
  * - With respect to other ServerTimestampValues, they sort by their
1625
2092
  * localWriteTime.
1626
- */ function Dt(t) {
2093
+ */ function St(t) {
1627
2094
  var e, n;
1628
2095
  return "server_timestamp" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);
1629
2096
  }
@@ -1633,15 +2100,15 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1633
2100
  *
1634
2101
  * Preserving the previous values allows the user to display the last resoled
1635
2102
  * value until the backend responds with the timestamp.
1636
- */ function Nt(t) {
2103
+ */ function qt(t) {
1637
2104
  const e = t.mapValue.fields.__previous_value__;
1638
- return Dt(e) ? Nt(e) : e;
2105
+ return St(e) ? qt(e) : e;
1639
2106
  }
1640
2107
 
1641
2108
  /**
1642
2109
  * Returns the local time at which this timestamp was first set.
1643
- */ function $t(t) {
1644
- const e = Rt(t.mapValue.fields.__local_write_time__.timestampValue);
2110
+ */ function Ot(t) {
2111
+ const e = $t(t.mapValue.fields.__local_write_time__.timestampValue);
1645
2112
  return new gt(e.seconds, e.nanos);
1646
2113
  }
1647
2114
 
@@ -1660,7 +2127,7 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1660
2127
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1661
2128
  * See the License for the specific language governing permissions and
1662
2129
  * limitations under the License.
1663
- */ const St = {
2130
+ */ const kt = {
1664
2131
  fields: {
1665
2132
  __type__: {
1666
2133
  stringValue: "__max__"
@@ -1669,8 +2136,8 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
1669
2136
  };
1670
2137
 
1671
2138
  /** Extracts the backend's type order for the provided value. */
1672
- function xt(t) {
1673
- return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ? Dt(t) ? 4 /* ServerTimestampValue */ :
2139
+ function Ct(t) {
2140
+ return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ? St(t) ? 4 /* ServerTimestampValue */ :
1674
2141
  /** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */
1675
2142
  function(t) {
1676
2143
  return "__max__" === (((t.mapValue || {}).fields || {}).__type__ || {}).stringValue;
@@ -1697,10 +2164,10 @@ function xt(t) {
1697
2164
  */ (t) ? 9007199254740991 /* MaxValue */ : 10 /* ObjectValue */ : g();
1698
2165
  }
1699
2166
 
1700
- /** Tests `left` and `right` for equality based on the backend semantics. */ function Ft(t, e) {
2167
+ /** Tests `left` and `right` for equality based on the backend semantics. */ function Lt(t, e) {
1701
2168
  if (t === e) return !0;
1702
- const n = xt(t);
1703
- if (n !== xt(e)) return !1;
2169
+ const n = Ct(t);
2170
+ if (n !== Ct(e)) return !1;
1704
2171
  switch (n) {
1705
2172
  case 0 /* NullValue */ :
1706
2173
  case 9007199254740991 /* MaxValue */ :
@@ -1710,14 +2177,14 @@ function xt(t) {
1710
2177
  return t.booleanValue === e.booleanValue;
1711
2178
 
1712
2179
  case 4 /* ServerTimestampValue */ :
1713
- return $t(t).isEqual($t(e));
2180
+ return Ot(t).isEqual(Ot(e));
1714
2181
 
1715
2182
  case 3 /* TimestampValue */ :
1716
2183
  return function(t, e) {
1717
2184
  if ("string" == typeof t.timestampValue && "string" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length)
1718
2185
  // Use string equality for ISO 8601 timestamps
1719
2186
  return t.timestampValue === e.timestampValue;
1720
- const n = Rt(t.timestampValue), r = Rt(e.timestampValue);
2187
+ const n = $t(t.timestampValue), r = $t(e.timestampValue);
1721
2188
  return n.seconds === r.seconds && n.nanos === r.nanos;
1722
2189
  }(t, e);
1723
2190
 
@@ -1726,7 +2193,7 @@ function xt(t) {
1726
2193
 
1727
2194
  case 6 /* BlobValue */ :
1728
2195
  return function(t, e) {
1729
- return Vt(t.bytesValue).isEqual(Vt(e.bytesValue));
2196
+ return Ft(t.bytesValue).isEqual(Ft(e.bytesValue));
1730
2197
  }(t, e);
1731
2198
 
1732
2199
  case 7 /* RefValue */ :
@@ -1734,27 +2201,27 @@ function xt(t) {
1734
2201
 
1735
2202
  case 8 /* GeoPointValue */ :
1736
2203
  return function(t, e) {
1737
- return Pt(t.geoPointValue.latitude) === Pt(e.geoPointValue.latitude) && Pt(t.geoPointValue.longitude) === Pt(e.geoPointValue.longitude);
2204
+ return xt(t.geoPointValue.latitude) === xt(e.geoPointValue.latitude) && xt(t.geoPointValue.longitude) === xt(e.geoPointValue.longitude);
1738
2205
  }(t, e);
1739
2206
 
1740
2207
  case 2 /* NumberValue */ :
1741
2208
  return function(t, e) {
1742
- if ("integerValue" in t && "integerValue" in e) return Pt(t.integerValue) === Pt(e.integerValue);
2209
+ if ("integerValue" in t && "integerValue" in e) return xt(t.integerValue) === xt(e.integerValue);
1743
2210
  if ("doubleValue" in t && "doubleValue" in e) {
1744
- const n = Pt(t.doubleValue), r = Pt(e.doubleValue);
2211
+ const n = xt(t.doubleValue), r = xt(e.doubleValue);
1745
2212
  return n === r ? at(n) === at(r) : isNaN(n) && isNaN(r);
1746
2213
  }
1747
2214
  return !1;
1748
2215
  }(t, e);
1749
2216
 
1750
2217
  case 9 /* ArrayValue */ :
1751
- return _t(t.arrayValue.values || [], e.arrayValue.values || [], Ft);
2218
+ return _t(t.arrayValue.values || [], e.arrayValue.values || [], Lt);
1752
2219
 
1753
2220
  case 10 /* ObjectValue */ :
1754
2221
  return function(t, e) {
1755
2222
  const n = t.mapValue.fields || {}, r = e.mapValue.fields || {};
1756
- if (vt(n) !== vt(r)) return !1;
1757
- for (const t in n) if (n.hasOwnProperty(t) && (void 0 === r[t] || !Ft(n[t], r[t]))) return !1;
2223
+ if (bt(n) !== bt(r)) return !1;
2224
+ for (const t in n) if (n.hasOwnProperty(t) && (void 0 === r[t] || !Lt(n[t], r[t]))) return !1;
1758
2225
  return !0;
1759
2226
  }
1760
2227
  /** Returns true if the ArrayValue contains the specified element. */ (t, e);
@@ -1764,13 +2231,13 @@ function xt(t) {
1764
2231
  }
1765
2232
  }
1766
2233
 
1767
- function qt(t, e) {
1768
- return void 0 !== (t.values || []).find((t => Ft(t, e)));
2234
+ function Mt(t, e) {
2235
+ return void 0 !== (t.values || []).find((t => Lt(t, e)));
1769
2236
  }
1770
2237
 
1771
- function Ot(t, e) {
2238
+ function Ut(t, e) {
1772
2239
  if (t === e) return 0;
1773
- const n = xt(t), r = xt(e);
2240
+ const n = Ct(t), r = Ct(e);
1774
2241
  if (n !== r) return yt(n, r);
1775
2242
  switch (n) {
1776
2243
  case 0 /* NullValue */ :
@@ -1782,24 +2249,24 @@ function Ot(t, e) {
1782
2249
 
1783
2250
  case 2 /* NumberValue */ :
1784
2251
  return function(t, e) {
1785
- const n = Pt(t.integerValue || t.doubleValue), r = Pt(e.integerValue || e.doubleValue);
2252
+ const n = xt(t.integerValue || t.doubleValue), r = xt(e.integerValue || e.doubleValue);
1786
2253
  return n < r ? -1 : n > r ? 1 : n === r ? 0 :
1787
2254
  // one or both are NaN.
1788
2255
  isNaN(n) ? isNaN(r) ? 0 : -1 : 1;
1789
2256
  }(t, e);
1790
2257
 
1791
2258
  case 3 /* TimestampValue */ :
1792
- return Ct(t.timestampValue, e.timestampValue);
2259
+ return jt(t.timestampValue, e.timestampValue);
1793
2260
 
1794
2261
  case 4 /* ServerTimestampValue */ :
1795
- return Ct($t(t), $t(e));
2262
+ return jt(Ot(t), Ot(e));
1796
2263
 
1797
2264
  case 5 /* StringValue */ :
1798
2265
  return yt(t.stringValue, e.stringValue);
1799
2266
 
1800
2267
  case 6 /* BlobValue */ :
1801
2268
  return function(t, e) {
1802
- const n = Vt(t), r = Vt(e);
2269
+ const n = Ft(t), r = Ft(e);
1803
2270
  return n.compareTo(r);
1804
2271
  }(t.bytesValue, e.bytesValue);
1805
2272
 
@@ -1815,16 +2282,16 @@ function Ot(t, e) {
1815
2282
 
1816
2283
  case 8 /* GeoPointValue */ :
1817
2284
  return function(t, e) {
1818
- const n = yt(Pt(t.latitude), Pt(e.latitude));
2285
+ const n = yt(xt(t.latitude), xt(e.latitude));
1819
2286
  if (0 !== n) return n;
1820
- return yt(Pt(t.longitude), Pt(e.longitude));
2287
+ return yt(xt(t.longitude), xt(e.longitude));
1821
2288
  }(t.geoPointValue, e.geoPointValue);
1822
2289
 
1823
2290
  case 9 /* ArrayValue */ :
1824
2291
  return function(t, e) {
1825
2292
  const n = t.values || [], r = e.values || [];
1826
2293
  for (let t = 0; t < n.length && t < r.length; ++t) {
1827
- const e = Ot(n[t], r[t]);
2294
+ const e = Ut(n[t], r[t]);
1828
2295
  if (e) return e;
1829
2296
  }
1830
2297
  return yt(n.length, r.length);
@@ -1832,9 +2299,9 @@ function Ot(t, e) {
1832
2299
 
1833
2300
  case 10 /* ObjectValue */ :
1834
2301
  return function(t, e) {
1835
- if (t === St && e === St) return 0;
1836
- if (t === St) return 1;
1837
- if (e === St) return -1;
2302
+ if (t === kt && e === kt) return 0;
2303
+ if (t === kt) return 1;
2304
+ if (e === kt) return -1;
1838
2305
  const n = t.fields || {}, r = Object.keys(n), s = e.fields || {}, i = Object.keys(s);
1839
2306
  // Even though MapValues are likely sorted correctly based on their insertion
1840
2307
  // order (e.g. when received from the backend), local modifications can bring
@@ -1844,7 +2311,7 @@ function Ot(t, e) {
1844
2311
  for (let t = 0; t < r.length && t < i.length; ++t) {
1845
2312
  const e = yt(r[t], i[t]);
1846
2313
  if (0 !== e) return e;
1847
- const o = Ot(n[r[t]], s[i[t]]);
2314
+ const o = Ut(n[r[t]], s[i[t]]);
1848
2315
  if (0 !== o) return o;
1849
2316
  }
1850
2317
  return yt(r.length, i.length);
@@ -1856,35 +2323,35 @@ function Ot(t, e) {
1856
2323
  }
1857
2324
  }
1858
2325
 
1859
- function Ct(t, e) {
2326
+ function jt(t, e) {
1860
2327
  if ("string" == typeof t && "string" == typeof e && t.length === e.length) return yt(t, e);
1861
- const n = Rt(t), r = Rt(e), s = yt(n.seconds, r.seconds);
2328
+ const n = $t(t), r = $t(e), s = yt(n.seconds, r.seconds);
1862
2329
  return 0 !== s ? s : yt(n.nanos, r.nanos);
1863
2330
  }
1864
2331
 
1865
- function Lt(t, e) {
2332
+ function Bt(t, e) {
1866
2333
  return {
1867
2334
  referenceValue: `projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`
1868
2335
  };
1869
2336
  }
1870
2337
 
1871
- /** Returns true if `value` is an ArrayValue. */ function Ut(t) {
2338
+ /** Returns true if `value` is an ArrayValue. */ function zt(t) {
1872
2339
  return !!t && "arrayValue" in t;
1873
2340
  }
1874
2341
 
1875
- /** Returns true if `value` is a NullValue. */ function kt(t) {
2342
+ /** Returns true if `value` is a NullValue. */ function Gt(t) {
1876
2343
  return !!t && "nullValue" in t;
1877
2344
  }
1878
2345
 
1879
- /** Returns true if `value` is NaN. */ function jt(t) {
2346
+ /** Returns true if `value` is NaN. */ function Wt(t) {
1880
2347
  return !!t && "doubleValue" in t && isNaN(Number(t.doubleValue));
1881
2348
  }
1882
2349
 
1883
- /** Returns true if `value` is a MapValue. */ function Mt(t) {
2350
+ /** Returns true if `value` is a MapValue. */ function Kt(t) {
1884
2351
  return !!t && "mapValue" in t;
1885
2352
  }
1886
2353
 
1887
- /** Creates a deep copy of `source`. */ function Bt(t) {
2354
+ /** Creates a deep copy of `source`. */ function Qt(t) {
1888
2355
  if (t.geoPointValue) return {
1889
2356
  geoPointValue: Object.assign({}, t.geoPointValue)
1890
2357
  };
@@ -1897,7 +2364,7 @@ function Lt(t, e) {
1897
2364
  fields: {}
1898
2365
  }
1899
2366
  };
1900
- return Et(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = Bt(n))), e;
2367
+ return Et(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = Qt(n))), e;
1901
2368
  }
1902
2369
  if (t.arrayValue) {
1903
2370
  const e = {
@@ -1905,18 +2372,18 @@ function Lt(t, e) {
1905
2372
  values: []
1906
2373
  }
1907
2374
  };
1908
- for (let n = 0; n < (t.arrayValue.values || []).length; ++n) e.arrayValue.values[n] = Bt(t.arrayValue.values[n]);
2375
+ for (let n = 0; n < (t.arrayValue.values || []).length; ++n) e.arrayValue.values[n] = Qt(t.arrayValue.values[n]);
1909
2376
  return e;
1910
2377
  }
1911
2378
  return Object.assign({}, t);
1912
2379
  }
1913
2380
 
1914
- class zt {
2381
+ class Yt {
1915
2382
  constructor(t) {
1916
2383
  this.value = t;
1917
2384
  }
1918
2385
  static empty() {
1919
- return new zt({
2386
+ return new Yt({
1920
2387
  mapValue: {}
1921
2388
  });
1922
2389
  }
@@ -1930,7 +2397,7 @@ class zt {
1930
2397
  {
1931
2398
  let e = this.value;
1932
2399
  for (let n = 0; n < t.length - 1; ++n) if (e = (e.mapValue.fields || {})[t.get(n)],
1933
- !Mt(e)) return null;
2400
+ !Kt(e)) return null;
1934
2401
  return e = (e.mapValue.fields || {})[t.lastSegment()], e || null;
1935
2402
  }
1936
2403
  }
@@ -1940,7 +2407,7 @@ class zt {
1940
2407
  * @param path - The field path to set.
1941
2408
  * @param value - The value to set.
1942
2409
  */ set(t, e) {
1943
- this.getFieldsMap(t.popLast())[t.lastSegment()] = Bt(e);
2410
+ this.getFieldsMap(t.popLast())[t.lastSegment()] = Qt(e);
1944
2411
  }
1945
2412
  /**
1946
2413
  * Sets the provided fields to the provided values.
@@ -1954,7 +2421,7 @@ class zt {
1954
2421
  const t = this.getFieldsMap(e);
1955
2422
  this.applyChanges(t, n, r), n = {}, r = [], e = s.popLast();
1956
2423
  }
1957
- t ? n[s.lastSegment()] = Bt(t) : r.push(s.lastSegment());
2424
+ t ? n[s.lastSegment()] = Qt(t) : r.push(s.lastSegment());
1958
2425
  }));
1959
2426
  const s = this.getFieldsMap(e);
1960
2427
  this.applyChanges(s, n, r);
@@ -1966,10 +2433,10 @@ class zt {
1966
2433
  * @param path - The field path to remove.
1967
2434
  */ delete(t) {
1968
2435
  const e = this.field(t.popLast());
1969
- Mt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];
2436
+ Kt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];
1970
2437
  }
1971
2438
  isEqual(t) {
1972
- return Ft(this.value, t.value);
2439
+ return Lt(this.value, t.value);
1973
2440
  }
1974
2441
  /**
1975
2442
  * Returns the map that contains the leaf element of `path`. If the parent
@@ -1981,7 +2448,7 @@ class zt {
1981
2448
  });
1982
2449
  for (let n = 0; n < t.length; ++n) {
1983
2450
  let r = e.mapValue.fields[t.get(n)];
1984
- Mt(r) && r.mapValue.fields || (r = {
2451
+ Kt(r) && r.mapValue.fields || (r = {
1985
2452
  mapValue: {
1986
2453
  fields: {}
1987
2454
  }
@@ -1997,7 +2464,7 @@ class zt {
1997
2464
  for (const e of n) delete t[e];
1998
2465
  }
1999
2466
  clone() {
2000
- return new zt(Bt(this.value));
2467
+ return new Yt(Qt(this.value));
2001
2468
  }
2002
2469
  }
2003
2470
 
@@ -2026,7 +2493,7 @@ class zt {
2026
2493
  * not transition to one of these states even after all mutations have been
2027
2494
  * applied, `isValidDocument()` returns false and the document should be removed
2028
2495
  * from all views.
2029
- */ class Gt {
2496
+ */ class Ht {
2030
2497
  constructor(t, e, n, r, s, i) {
2031
2498
  this.key = t, this.documentType = e, this.version = n, this.readTime = r, this.data = s,
2032
2499
  this.documentState = i;
@@ -2035,23 +2502,23 @@ class zt {
2035
2502
  * Creates a document with no known version or data, but which can serve as
2036
2503
  * base document for mutations.
2037
2504
  */ static newInvalidDocument(t) {
2038
- return new Gt(t, 0 /* INVALID */ , bt.min(), bt.min(), zt.empty(), 0 /* SYNCED */);
2505
+ return new Ht(t, 0 /* INVALID */ , vt.min(), vt.min(), Yt.empty(), 0 /* SYNCED */);
2039
2506
  }
2040
2507
  /**
2041
2508
  * Creates a new document that is known to exist with the given data at the
2042
2509
  * given version.
2043
2510
  */ static newFoundDocument(t, e, n) {
2044
- return new Gt(t, 1 /* FOUND_DOCUMENT */ , e, bt.min(), n, 0 /* SYNCED */);
2511
+ return new Ht(t, 1 /* FOUND_DOCUMENT */ , e, vt.min(), n, 0 /* SYNCED */);
2045
2512
  }
2046
2513
  /** Creates a new document that is known to not exist at the given version. */ static newNoDocument(t, e) {
2047
- return new Gt(t, 2 /* NO_DOCUMENT */ , e, bt.min(), zt.empty(), 0 /* SYNCED */);
2514
+ return new Ht(t, 2 /* NO_DOCUMENT */ , e, vt.min(), Yt.empty(), 0 /* SYNCED */);
2048
2515
  }
2049
2516
  /**
2050
2517
  * Creates a new document that is known to exist at the given version but
2051
2518
  * whose data is not known (e.g. a document that was updated without a known
2052
2519
  * base document).
2053
2520
  */ static newUnknownDocument(t, e) {
2054
- return new Gt(t, 3 /* UNKNOWN_DOCUMENT */ , e, bt.min(), zt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
2521
+ return new Ht(t, 3 /* UNKNOWN_DOCUMENT */ , e, vt.min(), Yt.empty(), 2 /* HAS_COMMITTED_MUTATIONS */);
2055
2522
  }
2056
2523
  /**
2057
2524
  * Changes the document type to indicate that it exists and that its version
@@ -2064,7 +2531,7 @@ class zt {
2064
2531
  * Changes the document type to indicate that it doesn't exist at the given
2065
2532
  * version.
2066
2533
  */ convertToNoDocument(t) {
2067
- return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = zt.empty(),
2534
+ return this.version = t, this.documentType = 2 /* NO_DOCUMENT */ , this.data = Yt.empty(),
2068
2535
  this.documentState = 0 /* SYNCED */ , this;
2069
2536
  }
2070
2537
  /**
@@ -2072,14 +2539,15 @@ class zt {
2072
2539
  * that its data is not known (e.g. a document that was updated without a known
2073
2540
  * base document).
2074
2541
  */ convertToUnknownDocument(t) {
2075
- return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = zt.empty(),
2542
+ return this.version = t, this.documentType = 3 /* UNKNOWN_DOCUMENT */ , this.data = Yt.empty(),
2076
2543
  this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
2077
2544
  }
2078
2545
  setHasCommittedMutations() {
2079
2546
  return this.documentState = 2 /* HAS_COMMITTED_MUTATIONS */ , this;
2080
2547
  }
2081
2548
  setHasLocalMutations() {
2082
- return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this;
2549
+ return this.documentState = 1 /* HAS_LOCAL_MUTATIONS */ , this.version = vt.min(),
2550
+ this;
2083
2551
  }
2084
2552
  setReadTime(t) {
2085
2553
  return this.readTime = t, this;
@@ -2106,10 +2574,10 @@ class zt {
2106
2574
  return 3 /* UNKNOWN_DOCUMENT */ === this.documentType;
2107
2575
  }
2108
2576
  isEqual(t) {
2109
- return t instanceof Gt && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);
2577
+ return t instanceof Ht && this.key.isEqual(t.key) && this.version.isEqual(t.version) && this.documentType === t.documentType && this.documentState === t.documentState && this.data.isEqual(t.data);
2110
2578
  }
2111
2579
  mutableCopy() {
2112
- return new Gt(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);
2580
+ return new Ht(this.key, this.documentType, this.version, this.readTime, this.data.clone(), this.documentState);
2113
2581
  }
2114
2582
  toString() {
2115
2583
  return `Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`;
@@ -2133,7 +2601,7 @@ class zt {
2133
2601
  * limitations under the License.
2134
2602
  */
2135
2603
  // Visible for testing
2136
- class Qt {
2604
+ class Jt {
2137
2605
  constructor(t, e = null, n = [], r = [], s = null, i = null, o = null) {
2138
2606
  this.path = t, this.collectionGroup = e, this.orderBy = n, this.filters = r, this.limit = s,
2139
2607
  this.startAt = i, this.endAt = o, this.P = null;
@@ -2147,29 +2615,29 @@ class Qt {
2147
2615
  * NOTE: you should always construct `Target` from `Query.toTarget` instead of
2148
2616
  * using this factory method, because `Query` provides an implicit `orderBy`
2149
2617
  * property.
2150
- */ function Wt(t, e = null, n = [], r = [], s = null, i = null, o = null) {
2151
- return new Qt(t, e, n, r, s, i, o);
2618
+ */ function Xt(t, e = null, n = [], r = [], s = null, i = null, o = null) {
2619
+ return new Jt(t, e, n, r, s, i, o);
2152
2620
  }
2153
2621
 
2154
- class Yt extends class {} {
2622
+ class Zt extends class {} {
2155
2623
  constructor(t, e, n) {
2156
2624
  super(), this.field = t, this.op = e, this.value = n;
2157
2625
  }
2158
2626
  /**
2159
2627
  * Creates a filter based on the provided arguments.
2160
2628
  */ static create(t, e, n) {
2161
- return t.isKeyField() ? "in" /* IN */ === e || "not-in" /* NOT_IN */ === e ? this.V(t, e, n) : new Ht(t, e, n) : "array-contains" /* ARRAY_CONTAINS */ === e ? new Zt(t, n) : "in" /* IN */ === e ? new te(t, n) : "not-in" /* NOT_IN */ === e ? new ee(t, n) : "array-contains-any" /* ARRAY_CONTAINS_ANY */ === e ? new ne(t, n) : new Yt(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);
2162
2630
  }
2163
2631
  static V(t, e, n) {
2164
- return "in" /* IN */ === e ? new Kt(t, n) : new Jt(t, n);
2632
+ return "in" /* IN */ === e ? new ee(t, n) : new ne(t, n);
2165
2633
  }
2166
2634
  matches(t) {
2167
2635
  const e = t.data.field(this.field);
2168
2636
  // Types do not have to match in NOT_EQUAL filters.
2169
- return "!=" /* NOT_EQUAL */ === this.op ? null !== e && this.D(Ot(e, this.value)) : null !== e && xt(this.value) === xt(e) && this.D(Ot(e, this.value));
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));
2170
2638
  // Only compare types with matching backend order (such as double and int).
2171
2639
  }
2172
- D(t) {
2640
+ N(t) {
2173
2641
  switch (this.op) {
2174
2642
  case "<" /* LESS_THAN */ :
2175
2643
  return t < 0;
@@ -2193,85 +2661,85 @@ class Yt extends class {} {
2193
2661
  return g();
2194
2662
  }
2195
2663
  }
2196
- N() {
2664
+ D() {
2197
2665
  return [ "<" /* LESS_THAN */ , "<=" /* LESS_THAN_OR_EQUAL */ , ">" /* GREATER_THAN */ , ">=" /* GREATER_THAN_OR_EQUAL */ , "!=" /* NOT_EQUAL */ , "not-in" /* NOT_IN */ ].indexOf(this.op) >= 0;
2198
2666
  }
2199
2667
  }
2200
2668
 
2201
2669
  /** Filter that matches on key fields (i.e. '__name__'). */
2202
- class Ht extends Yt {
2670
+ class te extends Zt {
2203
2671
  constructor(t, e, n) {
2204
2672
  super(t, e, n), this.key = et.fromName(n.referenceValue);
2205
2673
  }
2206
2674
  matches(t) {
2207
2675
  const e = et.comparator(t.key, this.key);
2208
- return this.D(e);
2676
+ return this.N(e);
2209
2677
  }
2210
2678
  }
2211
2679
 
2212
- /** Filter that matches on key fields within an array. */ class Kt extends Yt {
2680
+ /** Filter that matches on key fields within an array. */ class ee extends Zt {
2213
2681
  constructor(t, e) {
2214
- super(t, "in" /* IN */ , e), this.keys = Xt("in" /* IN */ , e);
2682
+ super(t, "in" /* IN */ , e), this.keys = re("in" /* IN */ , e);
2215
2683
  }
2216
2684
  matches(t) {
2217
2685
  return this.keys.some((e => e.isEqual(t.key)));
2218
2686
  }
2219
2687
  }
2220
2688
 
2221
- /** Filter that matches on key fields not present within an array. */ class Jt extends Yt {
2689
+ /** Filter that matches on key fields not present within an array. */ class ne extends Zt {
2222
2690
  constructor(t, e) {
2223
- super(t, "not-in" /* NOT_IN */ , e), this.keys = Xt("not-in" /* NOT_IN */ , e);
2691
+ super(t, "not-in" /* NOT_IN */ , e), this.keys = re("not-in" /* NOT_IN */ , e);
2224
2692
  }
2225
2693
  matches(t) {
2226
2694
  return !this.keys.some((e => e.isEqual(t.key)));
2227
2695
  }
2228
2696
  }
2229
2697
 
2230
- function Xt(t, e) {
2698
+ function re(t, e) {
2231
2699
  var n;
2232
2700
  return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((t => et.fromName(t.referenceValue)));
2233
2701
  }
2234
2702
 
2235
- /** A Filter that implements the array-contains operator. */ class Zt extends Yt {
2703
+ /** A Filter that implements the array-contains operator. */ class se extends Zt {
2236
2704
  constructor(t, e) {
2237
2705
  super(t, "array-contains" /* ARRAY_CONTAINS */ , e);
2238
2706
  }
2239
2707
  matches(t) {
2240
2708
  const e = t.data.field(this.field);
2241
- return Ut(e) && qt(e.arrayValue, this.value);
2709
+ return zt(e) && Mt(e.arrayValue, this.value);
2242
2710
  }
2243
2711
  }
2244
2712
 
2245
- /** A Filter that implements the IN operator. */ class te extends Yt {
2713
+ /** A Filter that implements the IN operator. */ class ie extends Zt {
2246
2714
  constructor(t, e) {
2247
2715
  super(t, "in" /* IN */ , e);
2248
2716
  }
2249
2717
  matches(t) {
2250
2718
  const e = t.data.field(this.field);
2251
- return null !== e && qt(this.value.arrayValue, e);
2719
+ return null !== e && Mt(this.value.arrayValue, e);
2252
2720
  }
2253
2721
  }
2254
2722
 
2255
- /** A Filter that implements the not-in operator. */ class ee extends Yt {
2723
+ /** A Filter that implements the not-in operator. */ class oe extends Zt {
2256
2724
  constructor(t, e) {
2257
2725
  super(t, "not-in" /* NOT_IN */ , e);
2258
2726
  }
2259
2727
  matches(t) {
2260
- if (qt(this.value.arrayValue, {
2728
+ if (Mt(this.value.arrayValue, {
2261
2729
  nullValue: "NULL_VALUE"
2262
2730
  })) return !1;
2263
2731
  const e = t.data.field(this.field);
2264
- return null !== e && !qt(this.value.arrayValue, e);
2732
+ return null !== e && !Mt(this.value.arrayValue, e);
2265
2733
  }
2266
2734
  }
2267
2735
 
2268
- /** A Filter that implements the array-contains-any operator. */ class ne extends Yt {
2736
+ /** A Filter that implements the array-contains-any operator. */ class ue extends Zt {
2269
2737
  constructor(t, e) {
2270
2738
  super(t, "array-contains-any" /* ARRAY_CONTAINS_ANY */ , e);
2271
2739
  }
2272
2740
  matches(t) {
2273
2741
  const e = t.data.field(this.field);
2274
- return !(!Ut(e) || !e.arrayValue.values) && e.arrayValue.values.some((t => qt(this.value.arrayValue, t)));
2742
+ return !(!zt(e) || !e.arrayValue.values) && e.arrayValue.values.some((t => Mt(this.value.arrayValue, t)));
2275
2743
  }
2276
2744
  }
2277
2745
 
@@ -2288,7 +2756,7 @@ function Xt(t, e) {
2288
2756
  * Bound provides a function to determine whether a document comes before or
2289
2757
  * after a bound. This is influenced by whether the position is just before or
2290
2758
  * just after the provided values.
2291
- */ class re {
2759
+ */ class ce {
2292
2760
  constructor(t, e) {
2293
2761
  this.position = t, this.inclusive = e;
2294
2762
  }
@@ -2296,22 +2764,22 @@ function Xt(t, e) {
2296
2764
 
2297
2765
  /**
2298
2766
  * An ordering on a field, in some Direction. Direction defaults to ASCENDING.
2299
- */ class se {
2767
+ */ class ae {
2300
2768
  constructor(t, e = "asc" /* ASCENDING */) {
2301
2769
  this.field = t, this.dir = e;
2302
2770
  }
2303
2771
  }
2304
2772
 
2305
- function ie(t, e) {
2773
+ function he(t, e) {
2306
2774
  return t.dir === e.dir && t.field.isEqual(e.field);
2307
2775
  }
2308
2776
 
2309
- function oe(t, e) {
2777
+ function le(t, e) {
2310
2778
  if (null === t) return null === e;
2311
2779
  if (null === e) return !1;
2312
2780
  if (t.inclusive !== e.inclusive || t.position.length !== e.position.length) return !1;
2313
2781
  for (let n = 0; n < t.position.length; n++) {
2314
- if (!Ft(t.position[n], e.position[n])) return !1;
2782
+ if (!Lt(t.position[n], e.position[n])) return !1;
2315
2783
  }
2316
2784
  return !0;
2317
2785
  }
@@ -2338,7 +2806,7 @@ function oe(t, e) {
2338
2806
  * query the RemoteStore results.
2339
2807
  *
2340
2808
  * Visible for testing.
2341
- */ class ue {
2809
+ */ class fe {
2342
2810
  /**
2343
2811
  * Initializes a Query with a path and optional additional query constraints.
2344
2812
  * Path must currently be empty if this is a collection group query.
@@ -2347,16 +2815,16 @@ function oe(t, e) {
2347
2815
  this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = r,
2348
2816
  this.limit = s, this.limitType = i, this.startAt = o, this.endAt = u, this.$ = null,
2349
2817
  // The corresponding `Target` of this `Query` instance.
2350
- this.S = null, this.startAt, this.endAt;
2818
+ this.F = null, this.startAt, this.endAt;
2351
2819
  }
2352
2820
  }
2353
2821
 
2354
- /** Creates a new Query for a query that matches all documents at `path` */ function ce(t) {
2822
+ /** Creates a new Query for a query that matches all documents at `path` */ function de(t) {
2355
2823
  return t.explicitOrderBy.length > 0 ? t.explicitOrderBy[0].field : null;
2356
2824
  }
2357
2825
 
2358
- function ae(t) {
2359
- for (const e of t.filters) if (e.N()) return e.field;
2826
+ function we(t) {
2827
+ for (const e of t.filters) if (e.D()) return e.field;
2360
2828
  return null;
2361
2829
  }
2362
2830
 
@@ -2368,7 +2836,7 @@ function ae(t) {
2368
2836
  * Returns whether the query matches a collection group rather than a specific
2369
2837
  * collection.
2370
2838
  */
2371
- function he(t) {
2839
+ function me(t) {
2372
2840
  return null !== t.collectionGroup;
2373
2841
  }
2374
2842
 
@@ -2376,23 +2844,23 @@ function he(t) {
2376
2844
  * Returns the implicit order by constraint that is used to execute the Query,
2377
2845
  * which can be different from the order by constraints the user provided (e.g.
2378
2846
  * the SDK and backend always orders by `__name__`).
2379
- */ function le(t) {
2380
- const e = v(t);
2847
+ */ function pe(t) {
2848
+ const e = b(t);
2381
2849
  if (null === e.$) {
2382
2850
  e.$ = [];
2383
- const t = ae(e), n = ce(e);
2851
+ const t = we(e), n = de(e);
2384
2852
  if (null !== t && null === n)
2385
2853
  // In order to implicitly add key ordering, we must also add the
2386
2854
  // inequality filter field for it to be a valid query.
2387
2855
  // Note that the default inequality field and key ordering is ascending.
2388
- t.isKeyField() || e.$.push(new se(t)), e.$.push(new se(tt.keyField(), "asc" /* ASCENDING */)); else {
2856
+ t.isKeyField() || e.$.push(new ae(t)), e.$.push(new ae(tt.keyField(), "asc" /* ASCENDING */)); else {
2389
2857
  let t = !1;
2390
2858
  for (const n of e.explicitOrderBy) e.$.push(n), n.field.isKeyField() && (t = !0);
2391
2859
  if (!t) {
2392
2860
  // The order of the implicit key ordering always matches the last
2393
2861
  // explicit order by
2394
2862
  const t = e.explicitOrderBy.length > 0 ? e.explicitOrderBy[e.explicitOrderBy.length - 1].dir : "asc" /* ASCENDING */;
2395
- e.$.push(new se(tt.keyField(), t));
2863
+ e.$.push(new ae(tt.keyField(), t));
2396
2864
  }
2397
2865
  }
2398
2866
  }
@@ -2401,34 +2869,34 @@ function he(t) {
2401
2869
 
2402
2870
  /**
2403
2871
  * Converts this `Query` instance to it's corresponding `Target` representation.
2404
- */ function fe(t) {
2405
- const e = v(t);
2406
- if (!e.S) if ("F" /* First */ === e.limitType) e.S = Wt(e.path, e.collectionGroup, le(e), e.filters, e.limit, e.startAt, e.endAt); else {
2872
+ */ function ye(t) {
2873
+ 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 {
2407
2875
  // Flip the orderBy directions since we want the last results
2408
2876
  const t = [];
2409
- for (const n of le(e)) {
2877
+ for (const n of pe(e)) {
2410
2878
  const e = "desc" /* DESCENDING */ === n.dir ? "asc" /* ASCENDING */ : "desc" /* DESCENDING */;
2411
- t.push(new se(n.field, e));
2879
+ t.push(new ae(n.field, e));
2412
2880
  }
2413
2881
  // We need to swap the cursors to match the now-flipped query ordering.
2414
- const n = e.endAt ? new re(e.endAt.position, e.endAt.inclusive) : null, r = e.startAt ? new re(e.startAt.position, e.startAt.inclusive) : null;
2882
+ 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;
2415
2883
  // Now return as a LimitType.First query.
2416
- e.S = Wt(e.path, e.collectionGroup, t, e.filters, e.limit, n, r);
2884
+ e.F = Xt(e.path, e.collectionGroup, t, e.filters, e.limit, n, r);
2417
2885
  }
2418
- return e.S;
2886
+ return e.F;
2419
2887
  }
2420
2888
 
2421
- function de(t, e) {
2889
+ function _e(t, e) {
2422
2890
  return function(t, e) {
2423
2891
  if (t.limit !== e.limit) return !1;
2424
2892
  if (t.orderBy.length !== e.orderBy.length) return !1;
2425
- for (let n = 0; n < t.orderBy.length; n++) if (!ie(t.orderBy[n], e.orderBy[n])) return !1;
2893
+ for (let n = 0; n < t.orderBy.length; n++) if (!he(t.orderBy[n], e.orderBy[n])) return !1;
2426
2894
  if (t.filters.length !== e.filters.length) return !1;
2427
2895
  for (let s = 0; s < t.filters.length; s++) if (n = t.filters[s], r = e.filters[s],
2428
- n.op !== r.op || !n.field.isEqual(r.field) || !Ft(n.value, r.value)) return !1;
2896
+ n.op !== r.op || !n.field.isEqual(r.field) || !Lt(n.value, r.value)) return !1;
2429
2897
  var n, r;
2430
- return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!oe(t.startAt, e.startAt) && oe(t.endAt, e.endAt);
2431
- }(fe(t), fe(e)) && t.limitType === e.limitType;
2898
+ return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!le(t.startAt, e.startAt) && le(t.endAt, e.endAt);
2899
+ }(ye(t), ye(e)) && t.limitType === e.limitType;
2432
2900
  }
2433
2901
 
2434
2902
  /**
@@ -2456,7 +2924,7 @@ function de(t, e) {
2456
2924
  * The return value is an IntegerValue if it can safely represent the value,
2457
2925
  * otherwise a DoubleValue is returned.
2458
2926
  */
2459
- function we(t, e) {
2927
+ function ge(t, e) {
2460
2928
  return function(t) {
2461
2929
  return "number" == typeof t && Number.isInteger(t) && !at(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
2462
2930
  }(e) ?
@@ -2468,7 +2936,7 @@ function we(t, e) {
2468
2936
  integerValue: "" + t
2469
2937
  };
2470
2938
  }(e) : function(t, e) {
2471
- if (t.F) {
2939
+ if (t.S) {
2472
2940
  if (isNaN(e)) return {
2473
2941
  doubleValue: "NaN"
2474
2942
  };
@@ -2501,7 +2969,7 @@ function we(t, e) {
2501
2969
  * See the License for the specific language governing permissions and
2502
2970
  * limitations under the License.
2503
2971
  */
2504
- /** Used to represent a field transform on a mutation. */ class me {
2972
+ /** Used to represent a field transform on a mutation. */ class ve {
2505
2973
  constructor() {
2506
2974
  // Make sure that the structural type of `TransformOperation` is unique.
2507
2975
  // See https://github.com/microsoft/TypeScript/issues/5451
@@ -2509,15 +2977,15 @@ function we(t, e) {
2509
2977
  }
2510
2978
  }
2511
2979
 
2512
- /** Transforms a value into a server-generated timestamp. */ class pe extends me {}
2980
+ /** Transforms a value into a server-generated timestamp. */ class be extends ve {}
2513
2981
 
2514
- /** Transforms an array value via a union operation. */ class ye extends me {
2982
+ /** Transforms an array value via a union operation. */ class Ee extends ve {
2515
2983
  constructor(t) {
2516
2984
  super(), this.elements = t;
2517
2985
  }
2518
2986
  }
2519
2987
 
2520
- /** Transforms an array value via a remove operation. */ class _e extends me {
2988
+ /** Transforms an array value via a remove operation. */ class Te extends ve {
2521
2989
  constructor(t) {
2522
2990
  super(), this.elements = t;
2523
2991
  }
@@ -2528,7 +2996,7 @@ function we(t, e) {
2528
2996
  * transforms. Converts all field values to integers or doubles, but unlike the
2529
2997
  * backend does not cap integer values at 2^63. Instead, JavaScript number
2530
2998
  * arithmetic is used and precision loss can occur for values greater than 2^53.
2531
- */ class ge extends me {
2999
+ */ class Ie extends ve {
2532
3000
  constructor(t, e) {
2533
3001
  super(), this.q = t, this.O = e;
2534
3002
  }
@@ -2550,7 +3018,7 @@ function we(t, e) {
2550
3018
  * See the License for the specific language governing permissions and
2551
3019
  * limitations under the License.
2552
3020
  */
2553
- /** A field path and the TransformOperation to perform upon it. */ class be {
3021
+ /** A field path and the TransformOperation to perform upon it. */ class Ae {
2554
3022
  constructor(t, e) {
2555
3023
  this.field = t, this.transform = e;
2556
3024
  }
@@ -2560,18 +3028,18 @@ function we(t, e) {
2560
3028
  * Encodes a precondition for a mutation. This follows the model that the
2561
3029
  * backend accepts with the special case of an explicit "empty" precondition
2562
3030
  * (meaning no precondition).
2563
- */ class ve {
3031
+ */ class Re {
2564
3032
  constructor(t, e) {
2565
3033
  this.updateTime = t, this.exists = e;
2566
3034
  }
2567
3035
  /** Creates a new empty Precondition. */ static none() {
2568
- return new ve;
3036
+ return new Re;
2569
3037
  }
2570
3038
  /** Creates a new Precondition with an exists flag. */ static exists(t) {
2571
- return new ve(void 0, t);
3039
+ return new Re(void 0, t);
2572
3040
  }
2573
3041
  /** Creates a new Precondition based on a version a document exists at. */ static updateTime(t) {
2574
- return new ve(t);
3042
+ return new Re(t);
2575
3043
  }
2576
3044
  /** Returns whether this Precondition is empty. */ get isNone() {
2577
3045
  return void 0 === this.updateTime && void 0 === this.exists;
@@ -2624,16 +3092,19 @@ function we(t, e) {
2624
3092
  * applyToLocalView() to implement the actual behavior of applying the mutation
2625
3093
  * to some source document (see `setMutationApplyToRemoteDocument()` for an
2626
3094
  * example).
2627
- */ class Ee {}
3095
+ */ class Pe {}
2628
3096
 
2629
3097
  /**
2630
3098
  * A mutation that creates or replaces the document at the given key with the
2631
3099
  * object value contents.
2632
- */ class Te extends Ee {
3100
+ */ class Ve extends Pe {
2633
3101
  constructor(t, e, n, r = []) {
2634
3102
  super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = r,
2635
3103
  this.type = 0 /* Set */;
2636
3104
  }
3105
+ getFieldMask() {
3106
+ return null;
3107
+ }
2637
3108
  }
2638
3109
 
2639
3110
  /**
@@ -2648,17 +3119,23 @@ function we(t, e) {
2648
3119
  * is deleted.
2649
3120
  * * When a field is not in the mask but is in the values, the values map is
2650
3121
  * ignored.
2651
- */ class Ae extends Ee {
3122
+ */ class Ne extends Pe {
2652
3123
  constructor(t, e, n, r, s = []) {
2653
3124
  super(), this.key = t, this.data = e, this.fieldMask = n, this.precondition = r,
2654
3125
  this.fieldTransforms = s, this.type = 1 /* Patch */;
2655
3126
  }
3127
+ getFieldMask() {
3128
+ return this.fieldMask;
3129
+ }
2656
3130
  }
2657
3131
 
2658
- /** A mutation that deletes the document at the given key. */ class Ie extends Ee {
3132
+ /** A mutation that deletes the document at the given key. */ class De extends Pe {
2659
3133
  constructor(t, e) {
2660
3134
  super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];
2661
3135
  }
3136
+ getFieldMask() {
3137
+ return null;
3138
+ }
2662
3139
  }
2663
3140
 
2664
3141
  /**
@@ -2667,10 +3144,13 @@ function we(t, e) {
2667
3144
  *
2668
3145
  * The `verify` operation is only used in Transactions, and this class serves
2669
3146
  * primarily to facilitate serialization into protos.
2670
- */ class Re extends Ee {
3147
+ */ class $e extends Pe {
2671
3148
  constructor(t, e) {
2672
3149
  super(), this.key = t, this.precondition = e, this.type = 3 /* Verify */ , this.fieldTransforms = [];
2673
3150
  }
3151
+ getFieldMask() {
3152
+ return null;
3153
+ }
2674
3154
  }
2675
3155
 
2676
3156
  /**
@@ -2688,13 +3168,13 @@ function we(t, e) {
2688
3168
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2689
3169
  * See the License for the specific language governing permissions and
2690
3170
  * limitations under the License.
2691
- */ const Pe = (() => {
3171
+ */ const xe = (() => {
2692
3172
  const t = {
2693
3173
  asc: "ASCENDING",
2694
3174
  desc: "DESCENDING"
2695
3175
  };
2696
3176
  return t;
2697
- })(), Ve = (() => {
3177
+ })(), Fe = (() => {
2698
3178
  const t = {
2699
3179
  "<": "LESS_THAN",
2700
3180
  "<=": "LESS_THAN_OR_EQUAL",
@@ -2724,9 +3204,9 @@ function we(t, e) {
2724
3204
  * TODO(klimt): We can remove the databaseId argument if we keep the full
2725
3205
  * resource name in documents.
2726
3206
  */
2727
- class De {
3207
+ class Se {
2728
3208
  constructor(t, e) {
2729
- this.databaseId = t, this.F = e;
3209
+ this.databaseId = t, this.S = e;
2730
3210
  }
2731
3211
  }
2732
3212
 
@@ -2741,8 +3221,8 @@ class De {
2741
3221
  /**
2742
3222
  * Returns a value for a Date that's appropriate to put into a proto.
2743
3223
  */
2744
- function Ne(t, e) {
2745
- if (t.F) {
3224
+ function qe(t, e) {
3225
+ if (t.S) {
2746
3226
  return `${new Date(1e3 * e.seconds).toISOString().replace(/\.\d*/, "").replace("Z", "")}.${("000000000" + e.nanoseconds).slice(-9)}Z`;
2747
3227
  }
2748
3228
  return {
@@ -2756,129 +3236,129 @@ function Ne(t, e) {
2756
3236
  *
2757
3237
  * Visible for testing.
2758
3238
  */
2759
- function $e(t, e) {
2760
- return t.F ? e.toBase64() : e.toUint8Array();
3239
+ function Oe(t, e) {
3240
+ return t.S ? e.toBase64() : e.toUint8Array();
2761
3241
  }
2762
3242
 
2763
- function Se(t, e) {
2764
- return Ne(t, e.toTimestamp());
3243
+ function ke(t, e) {
3244
+ return qe(t, e.toTimestamp());
2765
3245
  }
2766
3246
 
2767
- function xe(t) {
2768
- return b(!!t), bt.fromTimestamp(function(t) {
2769
- const e = Rt(t);
3247
+ function Ce(t) {
3248
+ return v(!!t), vt.fromTimestamp(function(t) {
3249
+ const e = $t(t);
2770
3250
  return new gt(e.seconds, e.nanos);
2771
3251
  }(t));
2772
3252
  }
2773
3253
 
2774
- function Fe(t, e) {
3254
+ function Le(t, e) {
2775
3255
  return function(t) {
2776
3256
  return new X([ "projects", t.projectId, "databases", t.database ]);
2777
3257
  }(t).child("documents").child(e).canonicalString();
2778
3258
  }
2779
3259
 
2780
- function qe(t, e) {
2781
- return Fe(t.databaseId, e.path);
3260
+ function Me(t, e) {
3261
+ return Le(t.databaseId, e.path);
2782
3262
  }
2783
3263
 
2784
- function Oe(t, e) {
3264
+ function Ue(t, e) {
2785
3265
  const n = function(t) {
2786
3266
  const e = X.fromString(t);
2787
- return b(We(e)), e;
3267
+ return v(Xe(e)), e;
2788
3268
  }(e);
2789
- if (n.get(1) !== t.databaseId.projectId) throw new U(I, "Tried to deserialize key from different project: " + n.get(1) + " vs " + t.databaseId.projectId);
2790
- if (n.get(3) !== t.databaseId.database) throw new U(I, "Tried to deserialize key from different database: " + n.get(3) + " vs " + t.databaseId.database);
2791
- return new et((b((r = n).length > 4 && "documents" === r.get(4)), r.popFirst(5)));
3269
+ if (n.get(1) !== t.databaseId.projectId) throw new L(A, "Tried to deserialize key from different project: " + n.get(1) + " vs " + t.databaseId.projectId);
3270
+ if (n.get(3) !== t.databaseId.database) throw new L(A, "Tried to deserialize key from different database: " + n.get(3) + " vs " + t.databaseId.database);
3271
+ return new et((v((r = n).length > 4 && "documents" === r.get(4)), r.popFirst(5)));
2792
3272
  var r;
2793
3273
  /** Creates a Document proto from key and fields (but no create/update time) */}
2794
3274
 
2795
- function Ce(t, e) {
2796
- return Fe(t.databaseId, e);
3275
+ function je(t, e) {
3276
+ return Le(t.databaseId, e);
2797
3277
  }
2798
3278
 
2799
- function Le(t) {
3279
+ function Be(t) {
2800
3280
  return new X([ "projects", t.databaseId.projectId, "databases", t.databaseId.database ]).canonicalString();
2801
3281
  }
2802
3282
 
2803
- function Ue(t, e, n) {
3283
+ function ze(t, e, n) {
2804
3284
  return {
2805
- name: qe(t, e),
3285
+ name: Me(t, e),
2806
3286
  fields: n.value.mapValue.fields
2807
3287
  };
2808
3288
  }
2809
3289
 
2810
- function ke(t, e) {
3290
+ function Ge(t, e) {
2811
3291
  return "found" in e ? function(t, e) {
2812
- b(!!e.found), e.found.name, e.found.updateTime;
2813
- const n = Oe(t, e.found.name), r = xe(e.found.updateTime), s = new zt({
3292
+ v(!!e.found), e.found.name, e.found.updateTime;
3293
+ const n = Ue(t, e.found.name), r = Ce(e.found.updateTime), s = new Yt({
2814
3294
  mapValue: {
2815
3295
  fields: e.found.fields
2816
3296
  }
2817
3297
  });
2818
- return Gt.newFoundDocument(n, r, s);
3298
+ return Ht.newFoundDocument(n, r, s);
2819
3299
  }(t, e) : "missing" in e ? function(t, e) {
2820
- b(!!e.missing), b(!!e.readTime);
2821
- const n = Oe(t, e.missing), r = xe(e.readTime);
2822
- return Gt.newNoDocument(n, r);
3300
+ v(!!e.missing), v(!!e.readTime);
3301
+ const n = Ue(t, e.missing), r = Ce(e.readTime);
3302
+ return Ht.newNoDocument(n, r);
2823
3303
  }(t, e) : g();
2824
3304
  }
2825
3305
 
2826
- function je(t, e) {
3306
+ function We(t, e) {
2827
3307
  let n;
2828
- if (e instanceof Te) n = {
2829
- update: Ue(t, e.key, e.value)
2830
- }; else if (e instanceof Ie) n = {
2831
- delete: qe(t, e.key)
2832
- }; else if (e instanceof Ae) n = {
2833
- update: Ue(t, e.key, e.data),
2834
- updateMask: Qe(e.fieldMask)
3308
+ if (e instanceof Ve) n = {
3309
+ update: ze(t, e.key, e.value)
3310
+ }; else if (e instanceof De) n = {
3311
+ delete: Me(t, e.key)
3312
+ }; else if (e instanceof Ne) n = {
3313
+ update: ze(t, e.key, e.data),
3314
+ updateMask: Je(e.fieldMask)
2835
3315
  }; else {
2836
- if (!(e instanceof Re)) return g();
3316
+ if (!(e instanceof $e)) return g();
2837
3317
  n = {
2838
- verify: qe(t, e.key)
3318
+ verify: Me(t, e.key)
2839
3319
  };
2840
3320
  }
2841
3321
  return e.fieldTransforms.length > 0 && (n.updateTransforms = e.fieldTransforms.map((t => function(t, e) {
2842
3322
  const n = e.transform;
2843
- if (n instanceof pe) return {
3323
+ if (n instanceof be) return {
2844
3324
  fieldPath: e.field.canonicalString(),
2845
3325
  setToServerValue: "REQUEST_TIME"
2846
3326
  };
2847
- if (n instanceof ye) return {
3327
+ if (n instanceof Ee) return {
2848
3328
  fieldPath: e.field.canonicalString(),
2849
3329
  appendMissingElements: {
2850
3330
  values: n.elements
2851
3331
  }
2852
3332
  };
2853
- if (n instanceof _e) return {
3333
+ if (n instanceof Te) return {
2854
3334
  fieldPath: e.field.canonicalString(),
2855
3335
  removeAllFromArray: {
2856
3336
  values: n.elements
2857
3337
  }
2858
3338
  };
2859
- if (n instanceof ge) return {
3339
+ if (n instanceof Ie) return {
2860
3340
  fieldPath: e.field.canonicalString(),
2861
3341
  increment: n.O
2862
3342
  };
2863
3343
  throw g();
2864
3344
  }(0, t)))), e.precondition.isNone || (n.currentDocument = function(t, e) {
2865
3345
  return void 0 !== e.updateTime ? {
2866
- updateTime: Se(t, e.updateTime)
3346
+ updateTime: ke(t, e.updateTime)
2867
3347
  } : void 0 !== e.exists ? {
2868
3348
  exists: e.exists
2869
3349
  } : g();
2870
3350
  }(t, e.precondition)), n;
2871
3351
  }
2872
3352
 
2873
- function Me(t, e) {
3353
+ function Ke(t, e) {
2874
3354
  // Dissect the path into parent, collectionId, and optional key filter.
2875
3355
  const n = {
2876
3356
  structuredQuery: {}
2877
3357
  }, r = e.path;
2878
- null !== e.collectionGroup ? (n.parent = Ce(t, r), n.structuredQuery.from = [ {
3358
+ null !== e.collectionGroup ? (n.parent = je(t, r), n.structuredQuery.from = [ {
2879
3359
  collectionId: e.collectionGroup,
2880
3360
  allDescendants: !0
2881
- } ]) : (n.parent = Ce(t, r.popLast()), n.structuredQuery.from = [ {
3361
+ } ]) : (n.parent = je(t, r.popLast()), n.structuredQuery.from = [ {
2882
3362
  collectionId: r.lastSegment()
2883
3363
  } ]);
2884
3364
  const s = function(t) {
@@ -2887,36 +3367,36 @@ function Me(t, e) {
2887
3367
  // visible for testing
2888
3368
  function(t) {
2889
3369
  if ("==" /* EQUAL */ === t.op) {
2890
- if (jt(t.value)) return {
3370
+ if (Wt(t.value)) return {
2891
3371
  unaryFilter: {
2892
- field: Ge(t.field),
3372
+ field: He(t.field),
2893
3373
  op: "IS_NAN"
2894
3374
  }
2895
3375
  };
2896
- if (kt(t.value)) return {
3376
+ if (Gt(t.value)) return {
2897
3377
  unaryFilter: {
2898
- field: Ge(t.field),
3378
+ field: He(t.field),
2899
3379
  op: "IS_NULL"
2900
3380
  }
2901
3381
  };
2902
3382
  } else if ("!=" /* NOT_EQUAL */ === t.op) {
2903
- if (jt(t.value)) return {
3383
+ if (Wt(t.value)) return {
2904
3384
  unaryFilter: {
2905
- field: Ge(t.field),
3385
+ field: He(t.field),
2906
3386
  op: "IS_NOT_NAN"
2907
3387
  }
2908
3388
  };
2909
- if (kt(t.value)) return {
3389
+ if (Gt(t.value)) return {
2910
3390
  unaryFilter: {
2911
- field: Ge(t.field),
3391
+ field: He(t.field),
2912
3392
  op: "IS_NOT_NULL"
2913
3393
  }
2914
3394
  };
2915
3395
  }
2916
3396
  return {
2917
3397
  fieldFilter: {
2918
- field: Ge(t.field),
2919
- op: ze(t.op),
3398
+ field: He(t.field),
3399
+ op: Ye(t.op),
2920
3400
  value: t.value
2921
3401
  }
2922
3402
  };
@@ -2936,14 +3416,14 @@ function Me(t, e) {
2936
3416
  // visible for testing
2937
3417
  function(t) {
2938
3418
  return {
2939
- field: Ge(t.field),
2940
- direction: Be(t.dir)
3419
+ field: He(t.field),
3420
+ direction: Qe(t.dir)
2941
3421
  };
2942
3422
  }(t)));
2943
3423
  }(e.orderBy);
2944
3424
  i && (n.structuredQuery.orderBy = i);
2945
3425
  const o = function(t, e) {
2946
- return t.F || ct(e) ? e : {
3426
+ return t.S || ct(e) ? e : {
2947
3427
  value: e
2948
3428
  };
2949
3429
  }(t, e.limit);
@@ -2961,29 +3441,29 @@ function Me(t, e) {
2961
3441
  (e.endAt)), n;
2962
3442
  }
2963
3443
 
2964
- function Be(t) {
2965
- return Pe[t];
3444
+ function Qe(t) {
3445
+ return xe[t];
2966
3446
  }
2967
3447
 
2968
3448
  // visible for testing
2969
- function ze(t) {
2970
- return Ve[t];
3449
+ function Ye(t) {
3450
+ return Fe[t];
2971
3451
  }
2972
3452
 
2973
- function Ge(t) {
3453
+ function He(t) {
2974
3454
  return {
2975
3455
  fieldPath: t.canonicalString()
2976
3456
  };
2977
3457
  }
2978
3458
 
2979
- function Qe(t) {
3459
+ function Je(t) {
2980
3460
  const e = [];
2981
3461
  return t.fields.forEach((t => e.push(t.canonicalString()))), {
2982
3462
  fieldPaths: e
2983
3463
  };
2984
3464
  }
2985
3465
 
2986
- function We(t) {
3466
+ function Xe(t) {
2987
3467
  // Resource names have at least 4 components (project ID, database ID)
2988
3468
  return t.length >= 4 && "projects" === t.get(0) && "databases" === t.get(2);
2989
3469
  }
@@ -3003,8 +3483,8 @@ function We(t) {
3003
3483
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3004
3484
  * See the License for the specific language governing permissions and
3005
3485
  * limitations under the License.
3006
- */ function Ye(t) {
3007
- return new De(t, /* useProto3Json= */ !0);
3486
+ */ function Ze(t) {
3487
+ return new Se(t, /* useProto3Json= */ !0);
3008
3488
  }
3009
3489
 
3010
3490
  /**
@@ -3032,7 +3512,7 @@ function We(t) {
3032
3512
  * base delay. This prevents clients from accidentally synchronizing their
3033
3513
  * delays causing spikes of load to the backend.
3034
3514
  */
3035
- class He {
3515
+ class tn {
3036
3516
  constructor(
3037
3517
  /**
3038
3518
  * The AsyncQueue to run backoff operations on.
@@ -3057,7 +3537,7 @@ class He {
3057
3537
  * Note that jitter will still be applied, so the actual delay could be as
3058
3538
  * much as 1.5*maxDelayMs.
3059
3539
  */ , s = 6e4) {
3060
- this.C = t, this.timerId = e, this.L = n, this.U = r, this.k = s, this.j = 0, this.M = null,
3540
+ this.k = t, this.timerId = e, this.C = n, this.L = r, this.M = s, this.U = 0, this.j = null,
3061
3541
  /** The last backoff attempt, as epoch milliseconds. */
3062
3542
  this.B = Date.now(), this.reset();
3063
3543
  }
@@ -3068,13 +3548,13 @@ class He {
3068
3548
  * (i.e. due to an error), initialDelayMs (plus jitter) will be used, and
3069
3549
  * subsequent ones will increase according to the backoffFactor.
3070
3550
  */ reset() {
3071
- this.j = 0;
3551
+ this.U = 0;
3072
3552
  }
3073
3553
  /**
3074
3554
  * Resets the backoff delay to the maximum delay (e.g. for use after a
3075
3555
  * RESOURCE_EXHAUSTED error).
3076
3556
  */ G() {
3077
- this.j = this.k;
3557
+ this.U = this.M;
3078
3558
  }
3079
3559
  /**
3080
3560
  * Returns a promise that resolves after currentDelayMs, and increases the
@@ -3085,23 +3565,23 @@ class He {
3085
3565
  this.cancel();
3086
3566
  // First schedule using the current base (which may be 0 and should be
3087
3567
  // honored as such).
3088
- const e = Math.floor(this.j + this.Y()), n = Math.max(0, Date.now() - this.B), r = Math.max(0, e - n);
3568
+ const e = Math.floor(this.U + this.K()), n = Math.max(0, Date.now() - this.B), r = Math.max(0, e - n);
3089
3569
  // Guard against lastAttemptTime being in the future due to a clock change.
3090
- r > 0 && m("ExponentialBackoff", `Backing off for ${r} ms (base delay: ${this.j} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`),
3091
- this.M = this.C.enqueueAfterDelay(this.timerId, r, (() => (this.B = Date.now(),
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(),
3092
3572
  t()))),
3093
3573
  // Apply backoff factor to determine next delay and ensure it is within
3094
3574
  // bounds.
3095
- this.j *= this.U, this.j < this.L && (this.j = this.L), this.j > this.k && (this.j = this.k);
3575
+ this.U *= this.L, this.U < this.C && (this.U = this.C), this.U > this.M && (this.U = this.M);
3096
3576
  }
3097
- H() {
3098
- null !== this.M && (this.M.skipDelay(), this.M = null);
3577
+ Y() {
3578
+ null !== this.j && (this.j.skipDelay(), this.j = null);
3099
3579
  }
3100
3580
  cancel() {
3101
- null !== this.M && (this.M.cancel(), this.M = null);
3581
+ null !== this.j && (this.j.cancel(), this.j = null);
3102
3582
  }
3103
- /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ Y() {
3104
- return (Math.random() - .5) * this.j;
3583
+ /** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ K() {
3584
+ return (Math.random() - .5) * this.U;
3105
3585
  }
3106
3586
  }
3107
3587
 
@@ -3130,24 +3610,24 @@ class He {
3130
3610
  * An implementation of Datastore that exposes additional state for internal
3131
3611
  * consumption.
3132
3612
  */
3133
- class Ke extends class {} {
3613
+ class en extends class {} {
3134
3614
  constructor(t, e, n, r) {
3135
- super(), this.authCredentials = t, this.appCheckCredentials = e, this.K = n, this.q = r,
3615
+ super(), this.authCredentials = t, this.appCheckCredentials = e, this.H = n, this.q = r,
3136
3616
  this.J = !1;
3137
3617
  }
3138
3618
  X() {
3139
- if (this.J) throw new U(S, "The client has already been terminated.");
3619
+ if (this.J) throw new L(x, "The client has already been terminated.");
3140
3620
  }
3141
3621
  /** Invokes the provided RPC with auth and AppCheck tokens. */ m(t, e, n) {
3142
- return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([r, s]) => this.K.m(t, e, n, r, s))).catch((t => {
3143
- throw "FirebaseError" === t.name ? (t.code === N && (this.authCredentials.invalidateToken(),
3144
- this.appCheckCredentials.invalidateToken()), t) : new U(A, t.toString());
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 => {
3623
+ throw "FirebaseError" === t.name ? (t.code === D && (this.authCredentials.invalidateToken(),
3624
+ this.appCheckCredentials.invalidateToken()), t) : new L(I, t.toString());
3145
3625
  }));
3146
3626
  }
3147
3627
  /** Invokes the provided RPC with streamed results with auth and AppCheck tokens. */ T(t, e, n) {
3148
- return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([r, s]) => this.K.T(t, e, n, r, s))).catch((t => {
3149
- throw "FirebaseError" === t.name ? (t.code === N && (this.authCredentials.invalidateToken(),
3150
- this.appCheckCredentials.invalidateToken()), t) : new U(A, t.toString());
3628
+ return this.X(), Promise.all([ this.authCredentials.getToken(), this.appCheckCredentials.getToken() ]).then((([r, s]) => this.H.T(t, e, n, r, s))).catch((t => {
3629
+ throw "FirebaseError" === t.name ? (t.code === D && (this.authCredentials.invalidateToken(),
3630
+ this.appCheckCredentials.invalidateToken()), t) : new L(I, t.toString());
3151
3631
  }));
3152
3632
  }
3153
3633
  terminate() {
@@ -3157,38 +3637,38 @@ class Ke extends class {} {
3157
3637
 
3158
3638
  // TODO(firestorexp): Make sure there is only one Datastore instance per
3159
3639
  // firestore-exp client.
3160
- async function Je(t, e) {
3161
- const n = v(t), r = Le(n.q) + "/documents", s = {
3162
- writes: e.map((t => je(n.q, t)))
3640
+ 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)))
3163
3643
  };
3164
3644
  await n.m("Commit", r, s);
3165
3645
  }
3166
3646
 
3167
- async function Xe(t, e) {
3168
- const n = v(t), r = Le(n.q) + "/documents", s = {
3169
- documents: e.map((t => qe(n.q, t)))
3647
+ 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)))
3170
3650
  }, i = await n.T("BatchGetDocuments", r, s), o = new Map;
3171
3651
  i.forEach((t => {
3172
- const e = ke(n.q, t);
3652
+ const e = Ge(n.q, t);
3173
3653
  o.set(e.key.toString(), e);
3174
3654
  }));
3175
3655
  const u = [];
3176
3656
  return e.forEach((t => {
3177
3657
  const e = o.get(t.toString());
3178
- b(!!e), u.push(e);
3658
+ v(!!e), u.push(e);
3179
3659
  })), u;
3180
3660
  }
3181
3661
 
3182
- async function Ze(t, e) {
3183
- const n = v(t), r = Me(n.q, fe(e));
3662
+ async function sn(t, e) {
3663
+ const n = b(t), r = Ke(n.q, ye(e));
3184
3664
  return (await n.T("RunQuery", r.parent, {
3185
3665
  structuredQuery: r.structuredQuery
3186
3666
  })).filter((t => !!t.document)).map((t => function(t, e, n) {
3187
- const r = Oe(t, e.name), s = xe(e.updateTime), i = new zt({
3667
+ const r = Ue(t, e.name), s = Ce(e.updateTime), i = new Yt({
3188
3668
  mapValue: {
3189
3669
  fields: e.fields
3190
3670
  }
3191
- }), o = Gt.newFoundDocument(r, s, i);
3671
+ }), o = Ht.newFoundDocument(r, s, i);
3192
3672
  return n && o.setHasCommittedMutations(), n ? o.setHasCommittedMutations() : o;
3193
3673
  }(n.q, t.document, void 0)));
3194
3674
  }
@@ -3208,7 +3688,7 @@ async function Ze(t, e) {
3208
3688
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3209
3689
  * See the License for the specific language governing permissions and
3210
3690
  * limitations under the License.
3211
- */ const tn = new Map;
3691
+ */ const on = new Map;
3212
3692
 
3213
3693
  /**
3214
3694
  * An instance map that ensures only one Datastore exists per Firestore
@@ -3219,17 +3699,17 @@ async function Ze(t, e) {
3219
3699
  * instance. Callers must invoke removeComponents() when the Firestore
3220
3700
  * instance is terminated.
3221
3701
  */
3222
- function en(t) {
3223
- if (t._terminated) throw new U(S, "The client has already been terminated.");
3224
- if (!tn.has(t)) {
3702
+ function un(t) {
3703
+ if (t._terminated) throw new L(x, "The client has already been terminated.");
3704
+ if (!on.has(t)) {
3225
3705
  m("ComponentProvider", "Initializing Datastore");
3226
3706
  const i = function(t) {
3227
3707
  return new wt(t, fetch.bind(null));
3228
3708
  }((e = t._databaseId, n = t.app.options.appId || "", r = t._persistenceKey, s = t._freezeSettings(),
3229
- new H(e, n, r, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), o = Ye(t._databaseId), u = function(t, e, n, r) {
3230
- return new Ke(t, e, n, r);
3709
+ new Y(e, n, r, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams))), o = Ze(t._databaseId), u = function(t, e, n, r) {
3710
+ return new en(t, e, n, r);
3231
3711
  }(t._authCredentials, t._appCheckCredentials, i, o);
3232
- tn.set(t, u);
3712
+ on.set(t, u);
3233
3713
  }
3234
3714
  var e, n, r, s;
3235
3715
  /**
@@ -3247,7 +3727,7 @@ function en(t) {
3247
3727
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3248
3728
  * See the License for the specific language governing permissions and
3249
3729
  * limitations under the License.
3250
- */ return tn.get(t);
3730
+ */ return on.get(t);
3251
3731
  }
3252
3732
 
3253
3733
  /**
@@ -3259,21 +3739,21 @@ function en(t) {
3259
3739
  * user-supplied `FirestoreSettings` object. This is a separate type so that
3260
3740
  * defaults can be supplied and the value can be checked for equality.
3261
3741
  */
3262
- class nn {
3742
+ class cn {
3263
3743
  constructor(t) {
3264
3744
  var e;
3265
3745
  if (void 0 === t.host) {
3266
- if (void 0 !== t.ssl) throw new U(I, "Can't provide ssl option if host option is not set");
3746
+ if (void 0 !== t.ssl) throw new L(A, "Can't provide ssl option if host option is not set");
3267
3747
  this.host = "firestore.googleapis.com", this.ssl = true;
3268
3748
  } else this.host = t.host, this.ssl = null === (e = t.ssl) || void 0 === e || e;
3269
3749
  if (this.credentials = t.credentials, this.ignoreUndefinedProperties = !!t.ignoreUndefinedProperties,
3270
3750
  void 0 === t.cacheSizeBytes) this.cacheSizeBytes = 41943040; else {
3271
- if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new U(I, "cacheSizeBytes must be at least 1048576");
3751
+ if (-1 !== t.cacheSizeBytes && t.cacheSizeBytes < 1048576) throw new L(A, "cacheSizeBytes must be at least 1048576");
3272
3752
  this.cacheSizeBytes = t.cacheSizeBytes;
3273
3753
  }
3274
3754
  this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling,
3275
3755
  this.useFetchStreams = !!t.useFetchStreams, function(t, e, n, r) {
3276
- if (!0 === e && !0 === r) throw new U(I, `${t} and ${n} cannot be used together.`);
3756
+ if (!0 === e && !0 === r) throw new L(A, `${t} and ${n} cannot be used together.`);
3277
3757
  }("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling);
3278
3758
  }
3279
3759
  isEqual(t) {
@@ -3301,18 +3781,18 @@ class nn {
3301
3781
  * The Cloud Firestore service interface.
3302
3782
  *
3303
3783
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
3304
- */ class rn {
3784
+ */ class an {
3305
3785
  /** @hideconstructor */
3306
3786
  constructor(t, e, n) {
3307
3787
  this._authCredentials = e, this._appCheckCredentials = n,
3308
3788
  /**
3309
3789
  * Whether it's a Firestore or Firestore Lite instance.
3310
3790
  */
3311
- this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new nn({}),
3312
- this._settingsFrozen = !1, t instanceof K ? this._databaseId = t : (this._app = t,
3791
+ this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new cn({}),
3792
+ this._settingsFrozen = !1, t instanceof H ? this._databaseId = t : (this._app = t,
3313
3793
  this._databaseId = function(t) {
3314
- if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new U(I, '"projectId" not provided in firebase.initializeApp.');
3315
- return new K(t.options.projectId);
3794
+ if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new L(A, '"projectId" not provided in firebase.initializeApp.');
3795
+ return new H(t.options.projectId);
3316
3796
  }
3317
3797
  /**
3318
3798
  * Initializes a new instance of Cloud Firestore with the provided settings.
@@ -3330,7 +3810,7 @@ class nn {
3330
3810
  * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
3331
3811
  * instance.
3332
3812
  */ get app() {
3333
- if (!this._app) throw new U(S, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
3813
+ if (!this._app) throw new L(x, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
3334
3814
  return this._app;
3335
3815
  }
3336
3816
  get _initialized() {
@@ -3340,21 +3820,21 @@ class nn {
3340
3820
  return void 0 !== this._terminateTask;
3341
3821
  }
3342
3822
  _setSettings(t) {
3343
- if (this._settingsFrozen) throw new U(S, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
3344
- this._settings = new nn(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
3345
- if (!t) return new M;
3823
+ if (this._settingsFrozen) throw new L(x, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
3824
+ this._settings = new cn(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
3825
+ if (!t) return new j;
3346
3826
  switch (t.type) {
3347
3827
  case "gapi":
3348
3828
  const e = t.client;
3349
3829
  // Make sure this really is a Gapi client.
3350
- return b(!("object" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)),
3351
- new Q(e, t.sessionIndex || "0", t.iamToken || null);
3830
+ return v(!("object" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty)),
3831
+ new W(e, t.sessionIndex || "0", t.iamToken || null);
3352
3832
 
3353
3833
  case "provider":
3354
3834
  return t.client;
3355
3835
 
3356
3836
  default:
3357
- throw new U(I, "makeAuthCredentialsProvider failed due to invalid credential type");
3837
+ throw new L(A, "makeAuthCredentialsProvider failed due to invalid credential type");
3358
3838
  }
3359
3839
  }(t.credentials));
3360
3840
  }
@@ -3382,15 +3862,15 @@ class nn {
3382
3862
  * Only ever called once.
3383
3863
  */ _terminate() {
3384
3864
  return function(t) {
3385
- const e = tn.get(t);
3386
- e && (m("ComponentProvider", "Removing Datastore"), tn.delete(t), e.terminate());
3865
+ const e = on.get(t);
3866
+ e && (m("ComponentProvider", "Removing Datastore"), on.delete(t), e.terminate());
3387
3867
  }(this), Promise.resolve();
3388
3868
  }
3389
3869
  }
3390
3870
 
3391
- function sn(t, e) {
3871
+ function hn(t, e) {
3392
3872
  const n = _getProvider(t, "firestore/lite");
3393
- if (n.isInitialized()) throw new U(S, "Firestore can only be initialized once per app.");
3873
+ if (n.isInitialized()) throw new L(x, "Firestore can only be initialized once per app.");
3394
3874
  return n.initialize({
3395
3875
  options: e
3396
3876
  });
@@ -3404,7 +3884,7 @@ function sn(t, e) {
3404
3884
  * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned `Firestore`
3405
3885
  * instance is associated with.
3406
3886
  * @returns The `Firestore` instance of the provided app.
3407
- */ function on(e = getApp()) {
3887
+ */ function ln(e = getApp()) {
3408
3888
  return _getProvider(e, "firestore/lite").getImmediate();
3409
3889
  }
3410
3890
 
@@ -3420,9 +3900,9 @@ function sn(t, e) {
3420
3900
  * @param port - the emulator port (ex: 9000).
3421
3901
  * @param options.mockUserToken - the mock auth token to use for unit testing
3422
3902
  * Security Rules.
3423
- */ function un(t, e, n, r = {}) {
3903
+ */ function fn(t, e, n, r = {}) {
3424
3904
  var s;
3425
- const i = (t = ot(t, rn))._getSettings();
3905
+ const i = (t = ot(t, an))._getSettings();
3426
3906
  if ("firestore.googleapis.com" !== i.host && i.host !== e && y("Host has been set in both settings() and useEmulator(), emulator host will be used"),
3427
3907
  t._setSettings(Object.assign(Object.assign({}, i), {
3428
3908
  host: `${e}:${n}`,
@@ -3434,10 +3914,10 @@ function sn(t, e) {
3434
3914
  // invalid field "uid" and missing field "sub" / "user_id".)
3435
3915
  e = createMockUserToken(r.mockUserToken, null === (s = t._app) || void 0 === s ? void 0 : s.options.projectId);
3436
3916
  const i = r.mockUserToken.sub || r.mockUserToken.user_id;
3437
- if (!i) throw new U(I, "mockUserToken must contain 'sub' or 'user_id' field!");
3917
+ if (!i) throw new L(A, "mockUserToken must contain 'sub' or 'user_id' field!");
3438
3918
  n = new l(i);
3439
3919
  }
3440
- t._authCredentials = new B(new j(e, n));
3920
+ t._authCredentials = new B(new U(e, n));
3441
3921
  }
3442
3922
  }
3443
3923
 
@@ -3460,8 +3940,8 @@ function sn(t, e) {
3460
3940
  * @param firestore - The `Firestore` instance to terminate.
3461
3941
  * @returns A `Promise` that is resolved when the instance has been successfully
3462
3942
  * terminated.
3463
- */ function cn(t) {
3464
- return t = ot(t, rn), _removeServiceInstance(t.app, "firestore/lite"), t._delete();
3943
+ */ function dn(t) {
3944
+ return t = ot(t, an), _removeServiceInstance(t.app, "firestore/lite"), t._delete();
3465
3945
  }
3466
3946
 
3467
3947
  /**
@@ -3501,7 +3981,7 @@ function sn(t, e) {
3501
3981
  * and can be used to write, read, or listen to the location. The document at
3502
3982
  * the referenced location may or may not exist.
3503
3983
  */
3504
- class an {
3984
+ class wn {
3505
3985
  /** @hideconstructor */
3506
3986
  constructor(t,
3507
3987
  /**
@@ -3529,17 +4009,17 @@ class an {
3529
4009
  /**
3530
4010
  * The collection this `DocumentReference` belongs to.
3531
4011
  */ get parent() {
3532
- return new ln(this.firestore, this.converter, this._key.path.popLast());
4012
+ return new pn(this.firestore, this.converter, this._key.path.popLast());
3533
4013
  }
3534
4014
  withConverter(t) {
3535
- return new an(this.firestore, t, this._key);
4015
+ return new wn(this.firestore, t, this._key);
3536
4016
  }
3537
4017
  }
3538
4018
 
3539
4019
  /**
3540
4020
  * A `Query` refers to a query which you can read or listen to. You can also
3541
4021
  * construct refined `Query` objects by adding filters and ordering.
3542
- */ class hn {
4022
+ */ class mn {
3543
4023
  // This is the lite version of the Query class in the main SDK.
3544
4024
  /** @hideconstructor protected */
3545
4025
  constructor(t,
@@ -3552,17 +4032,17 @@ class an {
3552
4032
  this.type = "query", this.firestore = t;
3553
4033
  }
3554
4034
  withConverter(t) {
3555
- return new hn(this.firestore, t, this._query);
4035
+ return new mn(this.firestore, t, this._query);
3556
4036
  }
3557
4037
  }
3558
4038
 
3559
4039
  /**
3560
4040
  * A `CollectionReference` object can be used for adding documents, getting
3561
4041
  * document references, and querying for documents (using {@link query}).
3562
- */ class ln extends hn {
4042
+ */ class pn extends mn {
3563
4043
  /** @hideconstructor */
3564
4044
  constructor(t, e, n) {
3565
- super(t, e, new ue(n)), this._path = n,
4045
+ super(t, e, new fe(n)), this._path = n,
3566
4046
  /** The type of this Firestore reference. */
3567
4047
  this.type = "collection";
3568
4048
  }
@@ -3580,23 +4060,23 @@ class an {
3580
4060
  * subcollection. If this isn't a subcollection, the reference is null.
3581
4061
  */ get parent() {
3582
4062
  const t = this._path.popLast();
3583
- return t.isEmpty() ? null : new an(this.firestore,
4063
+ return t.isEmpty() ? null : new wn(this.firestore,
3584
4064
  /* converter= */ null, new et(t));
3585
4065
  }
3586
4066
  withConverter(t) {
3587
- return new ln(this.firestore, t, this._path);
4067
+ return new pn(this.firestore, t, this._path);
3588
4068
  }
3589
4069
  }
3590
4070
 
3591
- function fn(t, e, ...n) {
3592
- if (t = getModularInstance(t), nt("collection", "path", e), t instanceof rn) {
4071
+ function yn(t, e, ...n) {
4072
+ if (t = getModularInstance(t), nt("collection", "path", e), t instanceof an) {
3593
4073
  const r = X.fromString(e, ...n);
3594
- return st(r), new ln(t, /* converter= */ null, r);
4074
+ return st(r), new pn(t, /* converter= */ null, r);
3595
4075
  }
3596
4076
  {
3597
- if (!(t instanceof an || t instanceof ln)) throw new U(I, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4077
+ if (!(t instanceof wn || t instanceof pn)) throw new L(A, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3598
4078
  const r = t._path.child(X.fromString(e, ...n));
3599
- return st(r), new ln(t.firestore,
4079
+ return st(r), new pn(t.firestore,
3600
4080
  /* converter= */ null, r);
3601
4081
  }
3602
4082
  }
@@ -3613,32 +4093,32 @@ function fn(t, e, ...n) {
3613
4093
  * collection or subcollection with this ID as the last segment of its path
3614
4094
  * will be included. Cannot contain a slash.
3615
4095
  * @returns The created `Query`.
3616
- */ function dn(t, e) {
3617
- if (t = ot(t, rn), nt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new U(I, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
3618
- return new hn(t,
4096
+ */ function _n(t, e) {
4097
+ if (t = ot(t, an), nt("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new L(A, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
4098
+ return new mn(t,
3619
4099
  /* converter= */ null,
3620
4100
  /**
3621
4101
  * Creates a new Query for a collection group query that matches all documents
3622
4102
  * within the provided collection group.
3623
4103
  */
3624
4104
  function(t) {
3625
- return new ue(X.emptyPath(), t);
4105
+ return new fe(X.emptyPath(), t);
3626
4106
  }(e));
3627
4107
  }
3628
4108
 
3629
- function wn(t, e, ...n) {
4109
+ function gn(t, e, ...n) {
3630
4110
  if (t = getModularInstance(t),
3631
4111
  // We allow omission of 'pathString' but explicitly prohibit passing in both
3632
4112
  // 'undefined' and 'null'.
3633
- 1 === arguments.length && (e = pt.R()), nt("doc", "path", e), t instanceof rn) {
4113
+ 1 === arguments.length && (e = pt.R()), nt("doc", "path", e), t instanceof an) {
3634
4114
  const r = X.fromString(e, ...n);
3635
- return rt(r), new an(t,
4115
+ return rt(r), new wn(t,
3636
4116
  /* converter= */ null, new et(r));
3637
4117
  }
3638
4118
  {
3639
- if (!(t instanceof an || t instanceof ln)) throw new U(I, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
4119
+ if (!(t instanceof wn || t instanceof pn)) throw new L(A, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
3640
4120
  const r = t._path.child(X.fromString(e, ...n));
3641
- return rt(r), new an(t.firestore, t instanceof ln ? t.converter : null, new et(r));
4121
+ return rt(r), new wn(t.firestore, t instanceof pn ? t.converter : null, new et(r));
3642
4122
  }
3643
4123
  }
3644
4124
 
@@ -3649,8 +4129,8 @@ function wn(t, e, ...n) {
3649
4129
  * @param right - A reference to compare.
3650
4130
  * @returns true if the references point to the same location in the same
3651
4131
  * Firestore database.
3652
- */ function mn(t, e) {
3653
- return t = getModularInstance(t), e = getModularInstance(e), (t instanceof an || t instanceof ln) && (e instanceof an || e instanceof ln) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);
4132
+ */ function vn(t, e) {
4133
+ return t = getModularInstance(t), e = getModularInstance(e), (t instanceof wn || t instanceof pn) && (e instanceof wn || e instanceof pn) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);
3654
4134
  }
3655
4135
 
3656
4136
  /**
@@ -3661,8 +4141,8 @@ function wn(t, e, ...n) {
3661
4141
  * @param right - A `Query` to compare.
3662
4142
  * @returns true if the references point to the same location in the same
3663
4143
  * Firestore database.
3664
- */ function pn(t, e) {
3665
- return t = getModularInstance(t), e = getModularInstance(e), t instanceof hn && e instanceof hn && (t.firestore === e.firestore && de(t._query, e._query) && t.converter === e.converter);
4144
+ */ function bn(t, e) {
4145
+ return t = getModularInstance(t), e = getModularInstance(e), t instanceof mn && e instanceof mn && (t.firestore === e.firestore && _e(t._query, e._query) && t.converter === e.converter);
3666
4146
  }
3667
4147
 
3668
4148
  /**
@@ -3688,7 +4168,7 @@ function wn(t, e, ...n) {
3688
4168
  *
3689
4169
  * Create a `FieldPath` by providing field names. If more than one field
3690
4170
  * name is provided, the path will point to a nested field in a document.
3691
- */ class yn {
4171
+ */ class En {
3692
4172
  /**
3693
4173
  * Creates a `FieldPath` from the provided field names. If more than one field
3694
4174
  * name is provided, the path will point to a nested field in a document.
@@ -3696,7 +4176,7 @@ function wn(t, e, ...n) {
3696
4176
  * @param fieldNames - A list of field names.
3697
4177
  */
3698
4178
  constructor(...t) {
3699
- for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new U(I, "Invalid field name at argument $(i + 1). Field names must not be empty.");
4179
+ for (let e = 0; e < t.length; ++e) if (0 === t[e].length) throw new L(A, "Invalid field name at argument $(i + 1). Field names must not be empty.");
3700
4180
  this._internalPath = new tt(t);
3701
4181
  }
3702
4182
  /**
@@ -3712,8 +4192,8 @@ function wn(t, e, ...n) {
3712
4192
  /**
3713
4193
  * Returns a special sentinel `FieldPath` to refer to the ID of a document.
3714
4194
  * It can be used in queries to sort or filter by the document ID.
3715
- */ function _n() {
3716
- return new yn("__name__");
4195
+ */ function Tn() {
4196
+ return new En("__name__");
3717
4197
  }
3718
4198
 
3719
4199
  /**
@@ -3734,7 +4214,7 @@ function wn(t, e, ...n) {
3734
4214
  */
3735
4215
  /**
3736
4216
  * An immutable object representing an array of bytes.
3737
- */ class gn {
4217
+ */ class In {
3738
4218
  /** @hideconstructor */
3739
4219
  constructor(t) {
3740
4220
  this._byteString = t;
@@ -3746,9 +4226,9 @@ function wn(t, e, ...n) {
3746
4226
  * @param base64 - The Base64 string used to create the `Bytes` object.
3747
4227
  */ static fromBase64String(t) {
3748
4228
  try {
3749
- return new gn(At.fromBase64String(t));
4229
+ return new In(Nt.fromBase64String(t));
3750
4230
  } catch (t) {
3751
- throw new U(I, "Failed to construct data from Base64 string: " + t);
4231
+ throw new L(A, "Failed to construct data from Base64 string: " + t);
3752
4232
  }
3753
4233
  }
3754
4234
  /**
@@ -3756,7 +4236,7 @@ function wn(t, e, ...n) {
3756
4236
  *
3757
4237
  * @param array - The Uint8Array used to create the `Bytes` object.
3758
4238
  */ static fromUint8Array(t) {
3759
- return new gn(At.fromUint8Array(t));
4239
+ return new In(Nt.fromUint8Array(t));
3760
4240
  }
3761
4241
  /**
3762
4242
  * Returns the underlying bytes as a Base64-encoded string.
@@ -3808,7 +4288,7 @@ function wn(t, e, ...n) {
3808
4288
  /**
3809
4289
  * Sentinel values that can be used when writing document fields with `set()`
3810
4290
  * or `update()`.
3811
- */ class bn {
4291
+ */ class An {
3812
4292
  /**
3813
4293
  * @param _methodName - The public API endpoint that returns this class.
3814
4294
  * @hideconstructor
@@ -3840,7 +4320,7 @@ function wn(t, e, ...n) {
3840
4320
  *
3841
4321
  * Latitude values are in the range of [-90, 90].
3842
4322
  * Longitude values are in the range of [-180, 180].
3843
- */ class vn {
4323
+ */ class Rn {
3844
4324
  /**
3845
4325
  * Creates a new immutable `GeoPoint` object with the provided latitude and
3846
4326
  * longitude values.
@@ -3848,8 +4328,8 @@ function wn(t, e, ...n) {
3848
4328
  * @param longitude - The longitude as number between -180 and 180.
3849
4329
  */
3850
4330
  constructor(t, e) {
3851
- if (!isFinite(t) || t < -90 || t > 90) throw new U(I, "Latitude must be a number between -90 and 90, but was: " + t);
3852
- if (!isFinite(e) || e < -180 || e > 180) throw new U(I, "Longitude must be a number between -180 and 180, but was: " + e);
4331
+ if (!isFinite(t) || t < -90 || t > 90) throw new L(A, "Latitude must be a number between -90 and 90, but was: " + t);
4332
+ if (!isFinite(e) || e < -180 || e > 180) throw new L(A, "Longitude must be a number between -180 and 180, but was: " + e);
3853
4333
  this._lat = t, this._long = e;
3854
4334
  }
3855
4335
  /**
@@ -3899,29 +4379,29 @@ function wn(t, e, ...n) {
3899
4379
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3900
4380
  * See the License for the specific language governing permissions and
3901
4381
  * limitations under the License.
3902
- */ const En = /^__.*__$/;
4382
+ */ const Pn = /^__.*__$/;
3903
4383
 
3904
- /** The result of parsing document data (e.g. for a setData call). */ class Tn {
4384
+ /** The result of parsing document data (e.g. for a setData call). */ class Vn {
3905
4385
  constructor(t, e, n) {
3906
4386
  this.data = t, this.fieldMask = e, this.fieldTransforms = n;
3907
4387
  }
3908
4388
  toMutation(t, e) {
3909
- return null !== this.fieldMask ? new Ae(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Te(t, this.data, e, this.fieldTransforms);
4389
+ return null !== this.fieldMask ? new Ne(t, this.data, this.fieldMask, e, this.fieldTransforms) : new Ve(t, this.data, e, this.fieldTransforms);
3910
4390
  }
3911
4391
  }
3912
4392
 
3913
- /** The result of parsing "update" data (i.e. for an updateData call). */ class An {
4393
+ /** The result of parsing "update" data (i.e. for an updateData call). */ class Nn {
3914
4394
  constructor(t,
3915
4395
  // The fieldMask does not include document transforms.
3916
4396
  e, n) {
3917
4397
  this.data = t, this.fieldMask = e, this.fieldTransforms = n;
3918
4398
  }
3919
4399
  toMutation(t, e) {
3920
- return new Ae(t, this.data, this.fieldMask, e, this.fieldTransforms);
4400
+ return new Ne(t, this.data, this.fieldMask, e, this.fieldTransforms);
3921
4401
  }
3922
4402
  }
3923
4403
 
3924
- function In(t) {
4404
+ function Dn(t) {
3925
4405
  switch (t) {
3926
4406
  case 0 /* Set */ :
3927
4407
  // fall through
@@ -3939,7 +4419,7 @@ function In(t) {
3939
4419
  }
3940
4420
  }
3941
4421
 
3942
- /** A "context" object passed around while parsing user data. */ class Rn {
4422
+ /** A "context" object passed around while parsing user data. */ class $n {
3943
4423
  /**
3944
4424
  * Initializes a ParseContext with the given source and path.
3945
4425
  *
@@ -3971,7 +4451,7 @@ function In(t) {
3971
4451
  return this.settings.tt;
3972
4452
  }
3973
4453
  /** Returns a new context with the specified settings overwritten. */ et(t) {
3974
- return new Rn(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.q, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
4454
+ return new $n(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.q, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
3975
4455
  }
3976
4456
  nt(t) {
3977
4457
  var e;
@@ -3998,7 +4478,7 @@ function In(t) {
3998
4478
  });
3999
4479
  }
4000
4480
  ut(t) {
4001
- return Qn(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
4481
+ return Jn(t, this.settings.methodName, this.settings.ct || !1, this.path, this.settings.at);
4002
4482
  }
4003
4483
  /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ contains(t) {
4004
4484
  return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));
@@ -4010,19 +4490,19 @@ function In(t) {
4010
4490
  }
4011
4491
  st(t) {
4012
4492
  if (0 === t.length) throw this.ut("Document fields must not be empty");
4013
- if (In(this.tt) && En.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
4493
+ if (Dn(this.tt) && Pn.test(t)) throw this.ut('Document fields cannot begin and end with "__"');
4014
4494
  }
4015
4495
  }
4016
4496
 
4017
4497
  /**
4018
4498
  * Helper for parsing raw user input (provided via the API) into internal model
4019
4499
  * classes.
4020
- */ class Pn {
4500
+ */ class xn {
4021
4501
  constructor(t, e, n) {
4022
- this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n || Ye(t);
4502
+ this.databaseId = t, this.ignoreUndefinedProperties = e, this.q = n || Ze(t);
4023
4503
  }
4024
4504
  /** Creates a new top-level parse context. */ ht(t, e, n, r = !1) {
4025
- return new Rn({
4505
+ return new $n({
4026
4506
  tt: t,
4027
4507
  methodName: e,
4028
4508
  at: n,
@@ -4033,29 +4513,29 @@ function In(t) {
4033
4513
  }
4034
4514
  }
4035
4515
 
4036
- function Vn(t) {
4037
- const e = t._freezeSettings(), n = Ye(t._databaseId);
4038
- return new Pn(t._databaseId, !!e.ignoreUndefinedProperties, n);
4516
+ function Fn(t) {
4517
+ const e = t._freezeSettings(), n = Ze(t._databaseId);
4518
+ return new xn(t._databaseId, !!e.ignoreUndefinedProperties, n);
4039
4519
  }
4040
4520
 
4041
- /** Parse document data from a set() call. */ function Dn(t, e, n, r, s, i = {}) {
4521
+ /** Parse document data from a set() call. */ function Sn(t, e, n, r, s, i = {}) {
4042
4522
  const o = t.ht(i.merge || i.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, s);
4043
- Mn("Data must be an object, but it was:", o, r);
4044
- const u = kn(r, o);
4523
+ Kn("Data must be an object, but it was:", o, r);
4524
+ const u = Gn(r, o);
4045
4525
  let c, a;
4046
- if (i.merge) c = new Tt(o.fieldMask), a = o.fieldTransforms; else if (i.mergeFields) {
4526
+ if (i.merge) c = new Vt(o.fieldMask), a = o.fieldTransforms; else if (i.mergeFields) {
4047
4527
  const t = [];
4048
4528
  for (const r of i.mergeFields) {
4049
- const s = Bn(e, r, n);
4050
- if (!o.contains(s)) throw new U(I, `Field '${s}' is specified in your field mask but missing from your input data.`);
4051
- Wn(t, s) || t.push(s);
4529
+ const s = Qn(e, r, n);
4530
+ if (!o.contains(s)) throw new L(A, `Field '${s}' is specified in your field mask but missing from your input data.`);
4531
+ Xn(t, s) || t.push(s);
4052
4532
  }
4053
- c = new Tt(t), a = o.fieldTransforms.filter((t => c.covers(t.field)));
4533
+ c = new Vt(t), a = o.fieldTransforms.filter((t => c.covers(t.field)));
4054
4534
  } else c = null, a = o.fieldTransforms;
4055
- return new Tn(new zt(u), c, a);
4535
+ return new Vn(new Yt(u), c, a);
4056
4536
  }
4057
4537
 
4058
- class Nn extends bn {
4538
+ class qn extends An {
4059
4539
  _toFieldTransform(t) {
4060
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}`);
4061
4541
  // No transform to add for a delete, but we need to add it to our
@@ -4063,7 +4543,7 @@ class Nn extends bn {
4063
4543
  return t.fieldMask.push(t.path), null;
4064
4544
  }
4065
4545
  isEqual(t) {
4066
- return t instanceof Nn;
4546
+ return t instanceof qn;
4067
4547
  }
4068
4548
  }
4069
4549
 
@@ -4082,8 +4562,8 @@ class Nn extends bn {
4082
4562
  * context.
4083
4563
  * @param context - The parent context.
4084
4564
  * @param arrayElement - Whether or not the FieldValue has an array.
4085
- */ function $n(t, e, n) {
4086
- return new Rn({
4565
+ */ function On(t, e, n) {
4566
+ return new $n({
4087
4567
  tt: 3 /* Argument */ ,
4088
4568
  at: e.settings.at,
4089
4569
  methodName: t._methodName,
@@ -4091,23 +4571,23 @@ class Nn extends bn {
4091
4571
  }, e.databaseId, e.q, e.ignoreUndefinedProperties);
4092
4572
  }
4093
4573
 
4094
- class Sn extends bn {
4574
+ class kn extends An {
4095
4575
  _toFieldTransform(t) {
4096
- return new be(t.path, new pe);
4576
+ return new Ae(t.path, new be);
4097
4577
  }
4098
4578
  isEqual(t) {
4099
- return t instanceof Sn;
4579
+ return t instanceof kn;
4100
4580
  }
4101
4581
  }
4102
4582
 
4103
- class xn extends bn {
4583
+ class Cn extends An {
4104
4584
  constructor(t, e) {
4105
4585
  super(t), this.lt = e;
4106
4586
  }
4107
4587
  _toFieldTransform(t) {
4108
- const e = $n(this, t,
4109
- /*array=*/ !0), n = this.lt.map((t => Un(t, e))), r = new ye(n);
4110
- return new be(t.path, r);
4588
+ const e = On(this, t,
4589
+ /*array=*/ !0), n = this.lt.map((t => zn(t, e))), r = new Ee(n);
4590
+ return new Ae(t.path, r);
4111
4591
  }
4112
4592
  isEqual(t) {
4113
4593
  // TODO(mrschmidt): Implement isEquals
@@ -4115,14 +4595,14 @@ class xn extends bn {
4115
4595
  }
4116
4596
  }
4117
4597
 
4118
- class Fn extends bn {
4598
+ class Ln extends An {
4119
4599
  constructor(t, e) {
4120
4600
  super(t), this.lt = e;
4121
4601
  }
4122
4602
  _toFieldTransform(t) {
4123
- const e = $n(this, t,
4124
- /*array=*/ !0), n = this.lt.map((t => Un(t, e))), r = new _e(n);
4125
- return new be(t.path, r);
4603
+ const e = On(this, t,
4604
+ /*array=*/ !0), n = this.lt.map((t => zn(t, e))), r = new Te(n);
4605
+ return new Ae(t.path, r);
4126
4606
  }
4127
4607
  isEqual(t) {
4128
4608
  // TODO(mrschmidt): Implement isEquals
@@ -4130,13 +4610,13 @@ class Fn extends bn {
4130
4610
  }
4131
4611
  }
4132
4612
 
4133
- class qn extends bn {
4613
+ class Mn extends An {
4134
4614
  constructor(t, e) {
4135
4615
  super(t), this.ft = e;
4136
4616
  }
4137
4617
  _toFieldTransform(t) {
4138
- const e = new ge(t.q, we(t.q, this.ft));
4139
- return new be(t.path, e);
4618
+ const e = new Ie(t.q, ge(t.q, this.ft));
4619
+ return new Ae(t.path, e);
4140
4620
  }
4141
4621
  isEqual(t) {
4142
4622
  // TODO(mrschmidt): Implement isEquals
@@ -4144,50 +4624,50 @@ class qn extends bn {
4144
4624
  }
4145
4625
  }
4146
4626
 
4147
- /** Parse update data from an update() call. */ function On(t, e, n, r) {
4627
+ /** Parse update data from an update() call. */ function Un(t, e, n, r) {
4148
4628
  const s = t.ht(1 /* Update */ , e, n);
4149
- Mn("Data must be an object, but it was:", s, r);
4150
- const i = [], o = zt.empty();
4629
+ Kn("Data must be an object, but it was:", s, r);
4630
+ const i = [], o = Yt.empty();
4151
4631
  Et(r, ((t, r) => {
4152
- const u = Gn(e, t, n);
4632
+ const u = Hn(e, t, n);
4153
4633
  // For Compat types, we have to "extract" the underlying types before
4154
4634
  // performing validation.
4155
4635
  r = getModularInstance(r);
4156
4636
  const c = s.it(u);
4157
- if (r instanceof Nn)
4637
+ if (r instanceof qn)
4158
4638
  // Add it to the field mask, but don't add anything to updateData.
4159
4639
  i.push(u); else {
4160
- const t = Un(r, c);
4640
+ const t = zn(r, c);
4161
4641
  null != t && (i.push(u), o.set(u, t));
4162
4642
  }
4163
4643
  }));
4164
- const u = new Tt(i);
4165
- return new An(o, u, s.fieldTransforms);
4644
+ const u = new Vt(i);
4645
+ return new Nn(o, u, s.fieldTransforms);
4166
4646
  }
4167
4647
 
4168
- /** Parse update data from a list of field/value arguments. */ function Cn(t, e, n, r, s, i) {
4169
- const o = t.ht(1 /* Update */ , e, n), u = [ Bn(e, r, n) ], c = [ s ];
4170
- if (i.length % 2 != 0) throw new U(I, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);
4171
- for (let t = 0; t < i.length; t += 2) u.push(Bn(e, i[t])), c.push(i[t + 1]);
4172
- const a = [], l = zt.empty();
4648
+ /** 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 ];
4650
+ 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
+ for (let t = 0; t < i.length; t += 2) u.push(Qn(e, i[t])), c.push(i[t + 1]);
4652
+ const a = [], l = Yt.empty();
4173
4653
  // We iterate in reverse order to pick the last value for a field if the
4174
4654
  // user specified the field multiple times.
4175
- for (let t = u.length - 1; t >= 0; --t) if (!Wn(a, u[t])) {
4655
+ for (let t = u.length - 1; t >= 0; --t) if (!Xn(a, u[t])) {
4176
4656
  const e = u[t];
4177
4657
  let n = c[t];
4178
4658
  // For Compat types, we have to "extract" the underlying types before
4179
4659
  // performing validation.
4180
4660
  n = getModularInstance(n);
4181
4661
  const r = o.it(e);
4182
- if (n instanceof Nn)
4662
+ if (n instanceof qn)
4183
4663
  // Add it to the field mask, but don't add anything to updateData.
4184
4664
  a.push(e); else {
4185
- const t = Un(n, r);
4665
+ const t = zn(n, r);
4186
4666
  null != t && (a.push(e), l.set(e, t));
4187
4667
  }
4188
4668
  }
4189
- const f = new Tt(a);
4190
- return new An(l, f, o.fieldTransforms);
4669
+ const f = new Vt(a);
4670
+ return new Nn(l, f, o.fieldTransforms);
4191
4671
  }
4192
4672
 
4193
4673
  /**
@@ -4196,8 +4676,8 @@ class qn extends bn {
4196
4676
  *
4197
4677
  * @param allowArrays - Whether the query value is an array that may directly
4198
4678
  * contain additional arrays (e.g. the operand of an `in` query).
4199
- */ function Ln(t, e, n, r = !1) {
4200
- return Un(n, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
4679
+ */ function Bn(t, e, n, r = !1) {
4680
+ return zn(n, t.ht(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
4201
4681
  }
4202
4682
 
4203
4683
  /**
@@ -4208,12 +4688,12 @@ class qn extends bn {
4208
4688
  * the source of the data being parsed, etc.
4209
4689
  * @returns The parsed value, or null if the value was a FieldValue sentinel
4210
4690
  * that should not be included in the resulting parsed data.
4211
- */ function Un(t, e) {
4212
- if (jn(
4691
+ */ function zn(t, e) {
4692
+ if (Wn(
4213
4693
  // Unwrap the API type from the Compat SDK. This will return the API type
4214
4694
  // from firestore-exp.
4215
- t = getModularInstance(t))) return Mn("Unsupported field value:", e, t), kn(t, e);
4216
- if (t instanceof bn)
4695
+ t = getModularInstance(t))) return Kn("Unsupported field value:", e, t), Gn(t, e);
4696
+ if (t instanceof An)
4217
4697
  // FieldValues usually parse into transforms (except deleteField())
4218
4698
  // in which case we do not want to include this field in our parsed data
4219
4699
  // (as doing so will overwrite the field directly prior to the transform
@@ -4225,7 +4705,7 @@ class qn extends bn {
4225
4705
  */
4226
4706
  return function(t, e) {
4227
4707
  // Sentinels are only supported with writes, and not within arrays.
4228
- if (!In(e.tt)) throw e.ut(`${t._methodName}() can only be used with update() and set()`);
4708
+ if (!Dn(e.tt)) throw e.ut(`${t._methodName}() can only be used with update() and set()`);
4229
4709
  if (!e.path) throw e.ut(`${t._methodName}() is not currently supported inside arrays`);
4230
4710
  const n = t._toFieldTransform(e);
4231
4711
  n && e.fieldTransforms.push(n);
@@ -4255,7 +4735,7 @@ class qn extends bn {
4255
4735
  const n = [];
4256
4736
  let r = 0;
4257
4737
  for (const s of t) {
4258
- let t = Un(s, e.ot(r));
4738
+ let t = zn(s, e.ot(r));
4259
4739
  null == t && (
4260
4740
  // Just include nulls in the array for fields being replaced with a
4261
4741
  // sentinel.
@@ -4274,7 +4754,7 @@ class qn extends bn {
4274
4754
  if (null === (t = getModularInstance(t))) return {
4275
4755
  nullValue: "NULL_VALUE"
4276
4756
  };
4277
- if ("number" == typeof t) return we(e.q, t);
4757
+ if ("number" == typeof t) return ge(e.q, t);
4278
4758
  if ("boolean" == typeof t) return {
4279
4759
  booleanValue: t
4280
4760
  };
@@ -4284,7 +4764,7 @@ class qn extends bn {
4284
4764
  if (t instanceof Date) {
4285
4765
  const n = gt.fromDate(t);
4286
4766
  return {
4287
- timestampValue: Ne(e.q, n)
4767
+ timestampValue: qe(e.q, n)
4288
4768
  };
4289
4769
  }
4290
4770
  if (t instanceof gt) {
@@ -4293,23 +4773,23 @@ class qn extends bn {
4293
4773
  // truncation immediately without waiting for the backend to do that.
4294
4774
  const n = new gt(t.seconds, 1e3 * Math.floor(t.nanoseconds / 1e3));
4295
4775
  return {
4296
- timestampValue: Ne(e.q, n)
4776
+ timestampValue: qe(e.q, n)
4297
4777
  };
4298
4778
  }
4299
- if (t instanceof vn) return {
4779
+ if (t instanceof Rn) return {
4300
4780
  geoPointValue: {
4301
4781
  latitude: t.latitude,
4302
4782
  longitude: t.longitude
4303
4783
  }
4304
4784
  };
4305
- if (t instanceof gn) return {
4306
- bytesValue: $e(e.q, t._byteString)
4785
+ if (t instanceof In) return {
4786
+ bytesValue: Oe(e.q, t._byteString)
4307
4787
  };
4308
- if (t instanceof an) {
4788
+ if (t instanceof wn) {
4309
4789
  const n = e.databaseId, r = t.firestore._databaseId;
4310
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}`);
4311
4791
  return {
4312
- referenceValue: Fe(t.firestore._databaseId || e.databaseId, t._key.path)
4792
+ referenceValue: Le(t.firestore._databaseId || e.databaseId, t._key.path)
4313
4793
  };
4314
4794
  }
4315
4795
  throw e.ut(`Unsupported field value: ${it(t)}`);
@@ -4323,13 +4803,13 @@ class qn extends bn {
4323
4803
  */ (t, e);
4324
4804
  }
4325
4805
 
4326
- function kn(t, e) {
4806
+ function Gn(t, e) {
4327
4807
  const n = {};
4328
4808
  return !function(t) {
4329
4809
  for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;
4330
4810
  return !0;
4331
4811
  }(t) ? Et(t, ((t, r) => {
4332
- const s = Un(r, e.nt(t));
4812
+ const s = zn(r, e.nt(t));
4333
4813
  null != s && (n[t] = s);
4334
4814
  })) :
4335
4815
  // If we encounter an empty object, we explicitly add it to the update
@@ -4341,12 +4821,12 @@ function kn(t, e) {
4341
4821
  };
4342
4822
  }
4343
4823
 
4344
- function jn(t) {
4345
- return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof gt || t instanceof vn || t instanceof gn || t instanceof an || t instanceof bn);
4824
+ function Wn(t) {
4825
+ return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof gt || t instanceof Rn || t instanceof In || t instanceof wn || t instanceof An);
4346
4826
  }
4347
4827
 
4348
- function Mn(t, e, n) {
4349
- if (!jn(n) || !function(t) {
4828
+ function Kn(t, e, n) {
4829
+ if (!Wn(n) || !function(t) {
4350
4830
  return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
4351
4831
  }(n)) {
4352
4832
  const r = it(n);
@@ -4356,20 +4836,20 @@ function Mn(t, e, n) {
4356
4836
 
4357
4837
  /**
4358
4838
  * Helper that calls fromDotSeparatedString() but wraps any error thrown.
4359
- */ function Bn(t, e, n) {
4839
+ */ function Qn(t, e, n) {
4360
4840
  if ((
4361
4841
  // If required, replace the FieldPath Compat class with with the firestore-exp
4362
4842
  // FieldPath.
4363
- e = getModularInstance(e)) instanceof yn) return e._internalPath;
4364
- if ("string" == typeof e) return Gn(t, e);
4365
- throw Qn("Field path arguments must be of type string or ", t,
4843
+ e = getModularInstance(e)) instanceof En) return e._internalPath;
4844
+ if ("string" == typeof e) return Hn(t, e);
4845
+ throw Jn("Field path arguments must be of type string or ", t,
4366
4846
  /* hasConverter= */ !1,
4367
4847
  /* path= */ void 0, n);
4368
4848
  }
4369
4849
 
4370
4850
  /**
4371
4851
  * Matches any characters in a field path string that are reserved.
4372
- */ const zn = new RegExp("[~\\*/\\[\\]]");
4852
+ */ const Yn = new RegExp("[~\\*/\\[\\]]");
4373
4853
 
4374
4854
  /**
4375
4855
  * Wraps fromDotSeparatedString with an error message about the method that
@@ -4379,29 +4859,29 @@ function Mn(t, e, n) {
4379
4859
  * split on dots.
4380
4860
  * @param targetDoc - The document against which the field path will be
4381
4861
  * evaluated.
4382
- */ function Gn(t, e, n) {
4383
- if (e.search(zn) >= 0) throw Qn(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t,
4862
+ */ function Hn(t, e, n) {
4863
+ if (e.search(Yn) >= 0) throw Jn(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`, t,
4384
4864
  /* hasConverter= */ !1,
4385
4865
  /* path= */ void 0, n);
4386
4866
  try {
4387
- return new yn(...e.split("."))._internalPath;
4867
+ return new En(...e.split("."))._internalPath;
4388
4868
  } catch (r) {
4389
- throw Qn(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t,
4869
+ throw Jn(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t,
4390
4870
  /* hasConverter= */ !1,
4391
4871
  /* path= */ void 0, n);
4392
4872
  }
4393
4873
  }
4394
4874
 
4395
- function Qn(t, e, n, r, s) {
4875
+ function Jn(t, e, n, r, s) {
4396
4876
  const i = r && !r.isEmpty(), o = void 0 !== s;
4397
4877
  let u = `Function ${e}() called with invalid data`;
4398
4878
  n && (u += " (via `toFirestore()`)"), u += ". ";
4399
4879
  let c = "";
4400
4880
  return (i || o) && (c += " (found", i && (c += ` in field ${r}`), o && (c += ` in document ${s}`),
4401
- c += ")"), new U(I, u + t + c);
4881
+ c += ")"), new L(A, u + t + c);
4402
4882
  }
4403
4883
 
4404
- /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function Wn(t, e) {
4884
+ /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function Xn(t, e) {
4405
4885
  return t.some((t => t.isEqual(e)));
4406
4886
  }
4407
4887
 
@@ -4429,7 +4909,7 @@ function Qn(t, e, n, r, s) {
4429
4909
  * For a `DocumentSnapshot` that points to a non-existing document, any data
4430
4910
  * access will return 'undefined'. You can use the `exists()` method to
4431
4911
  * explicitly verify a document's existence.
4432
- */ class Yn {
4912
+ */ class Zn {
4433
4913
  // Note: This class is stripped down version of the DocumentSnapshot in
4434
4914
  // the legacy SDK. The changes are:
4435
4915
  // - No support for SnapshotMetadata.
@@ -4445,7 +4925,7 @@ function Qn(t, e, n, r, s) {
4445
4925
  /**
4446
4926
  * The `DocumentReference` for the document included in the `DocumentSnapshot`.
4447
4927
  */ get ref() {
4448
- return new an(this._firestore, this._converter, this._key);
4928
+ return new wn(this._firestore, this._converter, this._key);
4449
4929
  }
4450
4930
  /**
4451
4931
  * Signals whether or not the document at the snapshot's location exists.
@@ -4465,7 +4945,7 @@ function Qn(t, e, n, r, s) {
4465
4945
  if (this._converter) {
4466
4946
  // We only want to use the converter and create a new DocumentSnapshot
4467
4947
  // if a converter has been provided.
4468
- const t = new Hn(this._firestore, this._userDataWriter, this._key, this._document,
4948
+ const t = new tr(this._firestore, this._userDataWriter, this._key, this._document,
4469
4949
  /* converter= */ null);
4470
4950
  return this._converter.fromFirestore(t);
4471
4951
  }
@@ -4485,7 +4965,7 @@ function Qn(t, e, n, r, s) {
4485
4965
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4486
4966
  get(t) {
4487
4967
  if (this._document) {
4488
- const e = this._document.data.field(Xn("DocumentSnapshot.get", t));
4968
+ const e = this._document.data.field(rr("DocumentSnapshot.get", t));
4489
4969
  if (null !== e) return this._userDataWriter.convertValue(e);
4490
4970
  }
4491
4971
  }
@@ -4501,7 +4981,7 @@ function Qn(t, e, n, r, s) {
4501
4981
  * `DocumentSnapshot`. Since query results contain only existing documents, the
4502
4982
  * `exists` property will always be true and `data()` will never return
4503
4983
  * 'undefined'.
4504
- */ class Hn extends Yn {
4984
+ */ class tr extends Zn {
4505
4985
  /**
4506
4986
  * Retrieves all fields in the document as an `Object`.
4507
4987
  *
@@ -4519,7 +4999,7 @@ function Qn(t, e, n, r, s) {
4519
4999
  * array via the `docs` property or enumerated using the `forEach` method. The
4520
5000
  * number of documents can be determined via the `empty` and `size`
4521
5001
  * properties.
4522
- */ class Kn {
5002
+ */ class er {
4523
5003
  /** @hideconstructor */
4524
5004
  constructor(t, e) {
4525
5005
  this._docs = e, this.query = t;
@@ -4550,14 +5030,14 @@ function Qn(t, e, n, r, s) {
4550
5030
  * @param left - A snapshot to compare.
4551
5031
  * @param right - A snapshot to compare.
4552
5032
  * @returns true if the snapshots are equal.
4553
- */ function Jn(t, e) {
4554
- return t = getModularInstance(t), e = getModularInstance(e), t instanceof Yn && e instanceof Yn ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Kn && e instanceof Kn && (pn(t.query, e.query) && _t(t.docs, e.docs, Jn));
5033
+ */ function nr(t, e) {
5034
+ return t = getModularInstance(t), e = getModularInstance(e), t instanceof Zn && e instanceof Zn ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof er && e instanceof er && (bn(t.query, e.query) && _t(t.docs, e.docs, nr));
4555
5035
  }
4556
5036
 
4557
5037
  /**
4558
5038
  * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
4559
- */ function Xn(t, e) {
4560
- return "string" == typeof e ? Gn(t, e) : e instanceof yn ? e._internalPath : e._delegate._internalPath;
5039
+ */ function rr(t, e) {
5040
+ return "string" == typeof e ? Hn(t, e) : e instanceof En ? e._internalPath : e._delegate._internalPath;
4561
5041
  }
4562
5042
 
4563
5043
  /**
@@ -4584,7 +5064,7 @@ function Qn(t, e, n, r, s) {
4584
5064
  * can then be passed to {@link query} to create a new query instance that
4585
5065
  * also contains this `QueryConstraint`.
4586
5066
  */
4587
- class Zn {}
5067
+ class sr {}
4588
5068
 
4589
5069
  /**
4590
5070
  * Creates a new immutable instance of {@link Query} that is extended to also include
@@ -4594,40 +5074,40 @@ class Zn {}
4594
5074
  * @param queryConstraints - The list of {@link QueryConstraint}s to apply.
4595
5075
  * @throws if any of the provided query constraints cannot be combined with the
4596
5076
  * existing or new constraints.
4597
- */ function tr(t, ...e) {
5077
+ */ function ir(t, ...e) {
4598
5078
  for (const n of e) t = n._apply(t);
4599
5079
  return t;
4600
5080
  }
4601
5081
 
4602
- class er extends Zn {
5082
+ class or extends sr {
4603
5083
  constructor(t, e, n) {
4604
5084
  super(), this.dt = t, this.wt = e, this.yt = n, this.type = "where";
4605
5085
  }
4606
5086
  _apply(t) {
4607
- const e = Vn(t.firestore), n = function(t, e, n, r, s, i, o) {
5087
+ const e = Fn(t.firestore), n = function(t, e, n, r, s, i, o) {
4608
5088
  let u;
4609
5089
  if (s.isKeyField()) {
4610
- if ("array-contains" /* ARRAY_CONTAINS */ === i || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === i) throw new U(I, `Invalid Query. You can't perform '${i}' queries on documentId().`);
5090
+ if ("array-contains" /* ARRAY_CONTAINS */ === i || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === i) throw new L(A, `Invalid Query. You can't perform '${i}' queries on documentId().`);
4611
5091
  if ("in" /* IN */ === i || "not-in" /* NOT_IN */ === i) {
4612
- pr(o, i);
5092
+ br(o, i);
4613
5093
  const e = [];
4614
- for (const n of o) e.push(mr(r, t, n));
5094
+ for (const n of o) e.push(vr(r, t, n));
4615
5095
  u = {
4616
5096
  arrayValue: {
4617
5097
  values: e
4618
5098
  }
4619
5099
  };
4620
- } else u = mr(r, t, o);
4621
- } else "in" /* IN */ !== i && "not-in" /* NOT_IN */ !== i && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== i || pr(o, i),
4622
- u = Ln(n, e, o,
5100
+ } else u = vr(r, t, o);
5101
+ } else "in" /* IN */ !== i && "not-in" /* NOT_IN */ !== i && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== i || br(o, i),
5102
+ u = Bn(n, e, o,
4623
5103
  /* allowArrays= */ "in" /* IN */ === i || "not-in" /* NOT_IN */ === i);
4624
- const c = Yt.create(s, i, u);
5104
+ const c = Zt.create(s, i, u);
4625
5105
  return function(t, e) {
4626
- if (e.N()) {
4627
- const n = ae(t);
4628
- if (null !== n && !n.isEqual(e.field)) throw new U(I, `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()}'`);
4629
- const r = ce(t);
4630
- null !== r && yr(t, e.field, r);
5106
+ if (e.D()) {
5107
+ const n = we(t);
5108
+ 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
+ const r = de(t);
5110
+ null !== r && Er(t, e.field, r);
4631
5111
  }
4632
5112
  const n = function(t, e) {
4633
5113
  for (const n of t.filters) if (e.indexOf(n.op) >= 0) return n.op;
@@ -4668,12 +5148,12 @@ class er extends Zn {
4668
5148
  }(e.op));
4669
5149
  if (null !== n)
4670
5150
  // Special case when it's a duplicate op to give a slightly clearer error message.
4671
- throw n === e.op ? new U(I, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new U(I, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);
5151
+ 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.`);
4672
5152
  }(t, c), c;
4673
5153
  }(t._query, "where", e, t.firestore._databaseId, this.dt, this.wt, this.yt);
4674
- return new hn(t.firestore, t.converter, function(t, e) {
5154
+ return new mn(t.firestore, t.converter, function(t, e) {
4675
5155
  const n = t.filters.concat([ e ]);
4676
- return new ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
5156
+ return new fe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
4677
5157
  }(t._query, n));
4678
5158
  }
4679
5159
  }
@@ -4688,25 +5168,25 @@ class er extends Zn {
4688
5168
  * "&lt;=", "!=").
4689
5169
  * @param value - The value for comparison
4690
5170
  * @returns The created {@link Query}.
4691
- */ function nr(t, e, n) {
4692
- const r = e, s = Xn("where", t);
4693
- return new er(s, r, n);
5171
+ */ function ur(t, e, n) {
5172
+ const r = e, s = rr("where", t);
5173
+ return new or(s, r, n);
4694
5174
  }
4695
5175
 
4696
- class rr extends Zn {
5176
+ class cr extends sr {
4697
5177
  constructor(t, e) {
4698
5178
  super(), this.dt = t, this._t = e, this.type = "orderBy";
4699
5179
  }
4700
5180
  _apply(t) {
4701
5181
  const e = function(t, e, n) {
4702
- if (null !== t.startAt) throw new U(I, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
4703
- if (null !== t.endAt) throw new U(I, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
4704
- const r = new se(e, n);
5182
+ if (null !== t.startAt) throw new L(A, "Invalid query. You must not call startAt() or startAfter() before calling orderBy().");
5183
+ if (null !== t.endAt) throw new L(A, "Invalid query. You must not call endAt() or endBefore() before calling orderBy().");
5184
+ const r = new ae(e, n);
4705
5185
  return function(t, e) {
4706
- if (null === ce(t)) {
5186
+ if (null === de(t)) {
4707
5187
  // This is the first order by. It must match any inequality.
4708
- const n = ae(t);
4709
- null !== n && yr(t, n, e.field);
5188
+ const n = we(t);
5189
+ null !== n && Er(t, n, e.field);
4710
5190
  }
4711
5191
  }(t, r), r;
4712
5192
  }
@@ -4721,10 +5201,10 @@ class rr extends Zn {
4721
5201
  * of the query or if any of the fields in the order by are an uncommitted
4722
5202
  * server timestamp.
4723
5203
  */ (t._query, this.dt, this._t);
4724
- return new hn(t.firestore, t.converter, function(t, e) {
5204
+ return new mn(t.firestore, t.converter, function(t, e) {
4725
5205
  // TODO(dimond): validate that orderBy does not list the same key twice.
4726
5206
  const n = t.explicitOrderBy.concat([ e ]);
4727
- return new ue(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
5207
+ return new fe(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
4728
5208
  }(t._query, e));
4729
5209
  }
4730
5210
  }
@@ -4737,19 +5217,19 @@ class rr extends Zn {
4737
5217
  * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
4738
5218
  * not specified, order will be ascending.
4739
5219
  * @returns The created {@link Query}.
4740
- */ function sr(t, e = "asc") {
4741
- const n = e, r = Xn("orderBy", t);
4742
- return new rr(r, n);
5220
+ */ function ar(t, e = "asc") {
5221
+ const n = e, r = rr("orderBy", t);
5222
+ return new cr(r, n);
4743
5223
  }
4744
5224
 
4745
- class ir extends Zn {
5225
+ class hr extends sr {
4746
5226
  constructor(t, e, n) {
4747
- super(), this.type = t, this.gt = e, this.bt = n;
5227
+ super(), this.type = t, this.gt = e, this.vt = n;
4748
5228
  }
4749
5229
  _apply(t) {
4750
- return new hn(t.firestore, t.converter, function(t, e, n) {
4751
- return new ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), e, n, t.startAt, t.endAt);
4752
- }(t._query, this.gt, this.bt));
5230
+ return new mn(t.firestore, t.converter, function(t, e, n) {
5231
+ 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));
4753
5233
  }
4754
5234
  }
4755
5235
 
@@ -4758,8 +5238,8 @@ class ir extends Zn {
4758
5238
  *
4759
5239
  * @param limit - The maximum number of items to return.
4760
5240
  * @returns The created {@link Query}.
4761
- */ function or(t) {
4762
- return ut("limit", t), new ir("limit", t, "F" /* First */);
5241
+ */ function lr(t) {
5242
+ return ut("limit", t), new hr("limit", t, "F" /* First */);
4763
5243
  }
4764
5244
 
4765
5245
  /**
@@ -4770,56 +5250,56 @@ class ir extends Zn {
4770
5250
  *
4771
5251
  * @param limit - The maximum number of items to return.
4772
5252
  * @returns The created {@link Query}.
4773
- */ function ur(t) {
4774
- return ut("limitToLast", t), new ir("limitToLast", t, "L" /* Last */);
5253
+ */ function fr(t) {
5254
+ return ut("limitToLast", t), new hr("limitToLast", t, "L" /* Last */);
4775
5255
  }
4776
5256
 
4777
- class cr extends Zn {
5257
+ class dr extends sr {
4778
5258
  constructor(t, e, n) {
4779
- super(), this.type = t, this.vt = e, this.Et = n;
5259
+ super(), this.type = t, this.bt = e, this.Et = n;
4780
5260
  }
4781
5261
  _apply(t) {
4782
- const e = wr(t, this.type, this.vt, this.Et);
4783
- return new hn(t.firestore, t.converter, function(t, e) {
4784
- return new ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
5262
+ const e = gr(t, this.type, this.bt, this.Et);
5263
+ return new mn(t.firestore, t.converter, function(t, e) {
5264
+ return new fe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
4785
5265
  }(t._query, e));
4786
5266
  }
4787
5267
  }
4788
5268
 
4789
- function ar(...t) {
4790
- return new cr("startAt", t,
5269
+ function wr(...t) {
5270
+ return new dr("startAt", t,
4791
5271
  /*inclusive=*/ !0);
4792
5272
  }
4793
5273
 
4794
- function hr(...t) {
4795
- return new cr("startAfter", t,
5274
+ function mr(...t) {
5275
+ return new dr("startAfter", t,
4796
5276
  /*inclusive=*/ !1);
4797
5277
  }
4798
5278
 
4799
- class lr extends Zn {
5279
+ class pr extends sr {
4800
5280
  constructor(t, e, n) {
4801
- super(), this.type = t, this.vt = e, this.Et = n;
5281
+ super(), this.type = t, this.bt = e, this.Et = n;
4802
5282
  }
4803
5283
  _apply(t) {
4804
- const e = wr(t, this.type, this.vt, this.Et);
4805
- return new hn(t.firestore, t.converter, function(t, e) {
4806
- return new ue(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
5284
+ const e = gr(t, this.type, this.bt, this.Et);
5285
+ return new mn(t.firestore, t.converter, function(t, e) {
5286
+ return new fe(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
4807
5287
  }(t._query, e));
4808
5288
  }
4809
5289
  }
4810
5290
 
4811
- function fr(...t) {
4812
- return new lr("endBefore", t,
5291
+ function yr(...t) {
5292
+ return new pr("endBefore", t,
4813
5293
  /*inclusive=*/ !1);
4814
5294
  }
4815
5295
 
4816
- function dr(...t) {
4817
- return new lr("endAt", t, /*inclusive=*/ !0);
5296
+ function _r(...t) {
5297
+ return new pr("endAt", t, /*inclusive=*/ !0);
4818
5298
  }
4819
5299
 
4820
- /** Helper function to create a bound from a document or fields */ function wr(t, e, n, r) {
4821
- if (n[0] = getModularInstance(n[0]), n[0] instanceof Yn) return function(t, e, n, r, s) {
4822
- if (!r) throw new U(P, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);
5300
+ /** Helper function to create a bound from a document or fields */ function gr(t, e, n, r) {
5301
+ if (n[0] = getModularInstance(n[0]), n[0] instanceof Zn) return function(t, e, n, r, s) {
5302
+ if (!r) throw new L(P, `Can't use a DocumentSnapshot that doesn't exist for ${n}().`);
4823
5303
  const i = [];
4824
5304
  // Because people expect to continue/end a query at the exact document
4825
5305
  // provided, we need to use the implicit sort order rather than the explicit
@@ -4828,42 +5308,42 @@ function dr(...t) {
4828
5308
  // the provided document. Without the key (by using the explicit sort
4829
5309
  // orders), multiple documents could match the position, yielding duplicate
4830
5310
  // results.
4831
- for (const n of le(t)) if (n.field.isKeyField()) i.push(Lt(e, r.key)); else {
5311
+ for (const n of pe(t)) if (n.field.isKeyField()) i.push(Bt(e, r.key)); else {
4832
5312
  const t = r.data.field(n.field);
4833
- if (Dt(t)) throw new U(I, 'Invalid query. You are trying to start or end a query using a document for which the field "' + n.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
5313
+ if (St(t)) throw new L(A, 'Invalid query. You are trying to start or end a query using a document for which the field "' + n.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
4834
5314
  if (null === t) {
4835
5315
  const t = n.field.canonicalString();
4836
- throw new U(I, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);
5316
+ throw new L(A, `Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`);
4837
5317
  }
4838
5318
  i.push(t);
4839
5319
  }
4840
- return new re(i, s);
5320
+ return new ce(i, s);
4841
5321
  }
4842
5322
  /**
4843
5323
  * Converts a list of field values to a `Bound` for the given query.
4844
5324
  */ (t._query, t.firestore._databaseId, e, n[0]._document, r);
4845
5325
  {
4846
- const s = Vn(t.firestore);
5326
+ const s = Fn(t.firestore);
4847
5327
  return function(t, e, n, r, s, i) {
4848
5328
  // Use explicit order by's because it has to match the query the user made
4849
5329
  const o = t.explicitOrderBy;
4850
- if (s.length > o.length) throw new U(I, `Too many arguments provided to ${r}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
5330
+ if (s.length > o.length) throw new L(A, `Too many arguments provided to ${r}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
4851
5331
  const u = [];
4852
5332
  for (let i = 0; i < s.length; i++) {
4853
5333
  const c = s[i];
4854
5334
  if (o[i].field.isKeyField()) {
4855
- if ("string" != typeof c) throw new U(I, `Invalid query. Expected a string for document ID in ${r}(), but got a ${typeof c}`);
4856
- if (!he(t) && -1 !== c.indexOf("/")) throw new U(I, `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.`);
5335
+ if ("string" != typeof c) throw new L(A, `Invalid query. Expected a string for document ID in ${r}(), but got a ${typeof c}`);
5336
+ if (!me(t) && -1 !== c.indexOf("/")) throw new L(A, `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.`);
4857
5337
  const n = t.path.child(X.fromString(c));
4858
- if (!et.isDocumentKey(n)) throw new U(I, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${r}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);
5338
+ if (!et.isDocumentKey(n)) throw new L(A, `Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${r}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);
4859
5339
  const s = new et(n);
4860
- u.push(Lt(e, s));
5340
+ u.push(Bt(e, s));
4861
5341
  } else {
4862
- const t = Ln(n, r, c);
5342
+ const t = Bn(n, r, c);
4863
5343
  u.push(t);
4864
5344
  }
4865
5345
  }
4866
- return new re(u, i);
5346
+ return new ce(u, i);
4867
5347
  }
4868
5348
  /**
4869
5349
  * Parses the given `documentIdValue` into a `ReferenceValue`, throwing
@@ -4873,28 +5353,28 @@ function dr(...t) {
4873
5353
  }
4874
5354
  }
4875
5355
 
4876
- function mr(t, e, n) {
5356
+ function vr(t, e, n) {
4877
5357
  if ("string" == typeof (n = getModularInstance(n))) {
4878
- if ("" === n) throw new U(I, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
4879
- if (!he(e) && -1 !== n.indexOf("/")) throw new U(I, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);
5358
+ if ("" === n) throw new L(A, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
5359
+ if (!me(e) && -1 !== n.indexOf("/")) throw new L(A, `Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);
4880
5360
  const r = e.path.child(X.fromString(n));
4881
- if (!et.isDocumentKey(r)) throw new U(I, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);
4882
- return Lt(t, new et(r));
5361
+ if (!et.isDocumentKey(r)) throw new L(A, `Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);
5362
+ return Bt(t, new et(r));
4883
5363
  }
4884
- if (n instanceof an) return Lt(t, n._key);
4885
- throw new U(I, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${it(n)}.`);
5364
+ if (n instanceof wn) return Bt(t, n._key);
5365
+ throw new L(A, `Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${it(n)}.`);
4886
5366
  }
4887
5367
 
4888
5368
  /**
4889
5369
  * Validates that the value passed into a disjunctive filter satisfies all
4890
5370
  * array requirements.
4891
- */ function pr(t, e) {
4892
- if (!Array.isArray(t) || 0 === t.length) throw new U(I, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);
4893
- if (t.length > 10) throw new U(I, `Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`);
5371
+ */ function br(t, e) {
5372
+ if (!Array.isArray(t) || 0 === t.length) throw new L(A, `Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);
5373
+ if (t.length > 10) throw new L(A, `Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`);
4894
5374
  }
4895
5375
 
4896
- function yr(t, e, n) {
4897
- if (!n.isEqual(e)) throw new U(I, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`);
5376
+ function Er(t, e, n) {
5377
+ if (!n.isEqual(e)) throw new L(A, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`);
4898
5378
  }
4899
5379
 
4900
5380
  /**
@@ -4944,7 +5424,7 @@ function yr(t, e, n) {
4944
5424
  * their `set()` or fails due to invalid data originating from a `toFirestore()`
4945
5425
  * call.
4946
5426
  */
4947
- function _r(t, e, n) {
5427
+ function Tr(t, e, n) {
4948
5428
  let r;
4949
5429
  // Cast to `any` in order to satisfy the union type constraint on
4950
5430
  // toFirestore().
@@ -4953,9 +5433,9 @@ function _r(t, e, n) {
4953
5433
  r;
4954
5434
  }
4955
5435
 
4956
- class gr extends class {
5436
+ class Ir extends class {
4957
5437
  convertValue(t, e = "none") {
4958
- switch (xt(t)) {
5438
+ switch (Ct(t)) {
4959
5439
  case 0 /* NullValue */ :
4960
5440
  return null;
4961
5441
 
@@ -4963,7 +5443,7 @@ class gr extends class {
4963
5443
  return t.booleanValue;
4964
5444
 
4965
5445
  case 2 /* NumberValue */ :
4966
- return Pt(t.integerValue || t.doubleValue);
5446
+ return xt(t.integerValue || t.doubleValue);
4967
5447
 
4968
5448
  case 3 /* TimestampValue */ :
4969
5449
  return this.convertTimestamp(t.timestampValue);
@@ -4975,7 +5455,7 @@ class gr extends class {
4975
5455
  return t.stringValue;
4976
5456
 
4977
5457
  case 6 /* BlobValue */ :
4978
- return this.convertBytes(Vt(t.bytesValue));
5458
+ return this.convertBytes(Ft(t.bytesValue));
4979
5459
 
4980
5460
  case 7 /* RefValue */ :
4981
5461
  return this.convertReference(t.referenceValue);
@@ -5000,7 +5480,7 @@ class gr extends class {
5000
5480
  })), n;
5001
5481
  }
5002
5482
  convertGeoPoint(t) {
5003
- return new vn(Pt(t.latitude), Pt(t.longitude));
5483
+ return new Rn(xt(t.latitude), xt(t.longitude));
5004
5484
  }
5005
5485
  convertArray(t, e) {
5006
5486
  return (t.values || []).map((t => this.convertValue(t, e)));
@@ -5008,24 +5488,24 @@ class gr extends class {
5008
5488
  convertServerTimestamp(t, e) {
5009
5489
  switch (e) {
5010
5490
  case "previous":
5011
- const n = Nt(t);
5491
+ const n = qt(t);
5012
5492
  return null == n ? null : this.convertValue(n, e);
5013
5493
 
5014
5494
  case "estimate":
5015
- return this.convertTimestamp($t(t));
5495
+ return this.convertTimestamp(Ot(t));
5016
5496
 
5017
5497
  default:
5018
5498
  return null;
5019
5499
  }
5020
5500
  }
5021
5501
  convertTimestamp(t) {
5022
- const e = Rt(t);
5502
+ const e = $t(t);
5023
5503
  return new gt(e.seconds, e.nanos);
5024
5504
  }
5025
5505
  convertDocumentKey(t, e) {
5026
5506
  const n = X.fromString(t);
5027
- b(We(n));
5028
- const r = new K(n.get(1), n.get(3)), s = new et(n.popFirst(5));
5507
+ v(Xe(n));
5508
+ const r = new H(n.get(1), n.get(3)), s = new et(n.popFirst(5));
5029
5509
  return r.isEqual(e) ||
5030
5510
  // TODO(b/64130202): Somehow support foreign references.
5031
5511
  p(`Document ${s} contains a document reference within a different database (${r.projectId}/${r.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`),
@@ -5036,11 +5516,11 @@ class gr extends class {
5036
5516
  super(), this.firestore = t;
5037
5517
  }
5038
5518
  convertBytes(t) {
5039
- return new gn(t);
5519
+ return new In(t);
5040
5520
  }
5041
5521
  convertReference(t) {
5042
5522
  const e = this.convertDocumentKey(t, this.firestore._databaseId);
5043
- return new an(this.firestore, /* converter= */ null, e);
5523
+ return new wn(this.firestore, /* converter= */ null, e);
5044
5524
  }
5045
5525
  }
5046
5526
 
@@ -5056,12 +5536,12 @@ class gr extends class {
5056
5536
  * @param reference - The reference of the document to fetch.
5057
5537
  * @returns A Promise resolved with a `DocumentSnapshot` containing the current
5058
5538
  * document contents.
5059
- */ function br(t) {
5060
- const e = en((t = ot(t, an)).firestore), n = new gr(t.firestore);
5061
- return Xe(e, [ t._key ]).then((e => {
5062
- b(1 === e.length);
5539
+ */ function Ar(t) {
5540
+ const e = un((t = ot(t, wn)).firestore), n = new Ir(t.firestore);
5541
+ return rn(e, [ t._key ]).then((e => {
5542
+ v(1 === e.length);
5063
5543
  const r = e[0];
5064
- return new Yn(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
5544
+ return new Zn(t.firestore, n, t._key, r.isFoundDocument() ? r : null, t.converter);
5065
5545
  }));
5066
5546
  }
5067
5547
 
@@ -5076,33 +5556,33 @@ class gr extends class {
5076
5556
  *
5077
5557
  * @param query - The `Query` to execute.
5078
5558
  * @returns A Promise that will be resolved with the results of the query.
5079
- */ function vr(t) {
5559
+ */ function Rr(t) {
5080
5560
  !function(t) {
5081
- if ("L" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new U(q, "limitToLast() queries require specifying at least one orderBy() clause");
5082
- }((t = ot(t, hn))._query);
5083
- const e = en(t.firestore), n = new gr(t.firestore);
5084
- return Ze(e, t._query).then((e => {
5085
- const r = e.map((e => new Hn(t.firestore, n, e.key, e, t.converter)));
5561
+ if ("L" /* Last */ === t.limitType && 0 === t.explicitOrderBy.length) throw new L(q, "limitToLast() queries require specifying at least one orderBy() clause");
5562
+ }((t = ot(t, mn))._query);
5563
+ const e = un(t.firestore), n = new Ir(t.firestore);
5564
+ return sn(e, t._query).then((e => {
5565
+ const r = e.map((e => new tr(t.firestore, n, e.key, e, t.converter)));
5086
5566
  return "L" /* Last */ === t._query.limitType &&
5087
5567
  // Limit to last queries reverse the orderBy constraint that was
5088
5568
  // specified by the user. As such, we need to reverse the order of the
5089
5569
  // results to return the documents in the expected order.
5090
- r.reverse(), new Kn(t, r);
5570
+ r.reverse(), new er(t, r);
5091
5571
  }));
5092
5572
  }
5093
5573
 
5094
- function Er(t, e, n) {
5095
- const r = _r((t = ot(t, an)).converter, e, n), s = Dn(Vn(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
5096
- return Je(en(t.firestore), [ s.toMutation(t._key, ve.none()) ]);
5574
+ function Pr(t, e, n) {
5575
+ const r = Tr((t = ot(t, wn)).converter, e, n), s = Sn(Fn(t.firestore), "setDoc", t._key, r, null !== t.converter, n);
5576
+ return nn(un(t.firestore), [ s.toMutation(t._key, Re.none()) ]);
5097
5577
  }
5098
5578
 
5099
- function Tr(t, e, n, ...r) {
5100
- const s = Vn((t = ot(t, an)).firestore);
5579
+ function Vr(t, e, n, ...r) {
5580
+ const s = Fn((t = ot(t, wn)).firestore);
5101
5581
  // For Compat types, we have to "extract" the underlying types before
5102
5582
  // performing validation.
5103
5583
  let i;
5104
- i = "string" == typeof (e = getModularInstance(e)) || e instanceof yn ? Cn(s, "updateDoc", t._key, e, n, r) : On(s, "updateDoc", t._key, e);
5105
- return Je(en(t.firestore), [ i.toMutation(t._key, ve.exists(!0)) ]);
5584
+ i = "string" == typeof (e = getModularInstance(e)) || e instanceof En ? jn(s, "updateDoc", t._key, e, n, r) : Un(s, "updateDoc", t._key, e);
5585
+ return nn(un(t.firestore), [ i.toMutation(t._key, Re.exists(!0)) ]);
5106
5586
  }
5107
5587
 
5108
5588
  /**
@@ -5116,8 +5596,8 @@ function Tr(t, e, n, ...r) {
5116
5596
  * @param reference - A reference to the document to delete.
5117
5597
  * @returns A `Promise` resolved once the document has been successfully
5118
5598
  * deleted from the backend.
5119
- */ function Ar(t) {
5120
- return Je(en((t = ot(t, an)).firestore), [ new Ie(t._key, ve.none()) ]);
5599
+ */ function Nr(t) {
5600
+ return nn(un((t = ot(t, wn)).firestore), [ new De(t._key, Re.none()) ]);
5121
5601
  }
5122
5602
 
5123
5603
  /**
@@ -5134,9 +5614,9 @@ function Tr(t, e, n, ...r) {
5134
5614
  * @throws Error - If the provided input is not a valid Firestore document.
5135
5615
  * @returns A `Promise` resolved with a `DocumentReference` pointing to the
5136
5616
  * newly created document after it has been written to the backend.
5137
- */ function Ir(t, e) {
5138
- const n = wn(t = ot(t, ln)), r = _r(t.converter, e), s = Dn(Vn(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
5139
- return Je(en(t.firestore), [ s.toMutation(n._key, ve.exists(!1)) ]).then((() => n));
5617
+ */ function Dr(t, e) {
5618
+ const n = gn(t = ot(t, pn)), r = Tr(t.converter, e), s = Sn(Fn(t.firestore), "addDoc", n._key, r, null !== n.converter, {});
5619
+ return nn(un(t.firestore), [ s.toMutation(n._key, Re.exists(!1)) ]).then((() => n));
5140
5620
  }
5141
5621
 
5142
5622
  /**
@@ -5158,15 +5638,15 @@ function Tr(t, e, n, ...r) {
5158
5638
  /**
5159
5639
  * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
5160
5640
  * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
5161
- */ function Rr() {
5162
- return new Nn("deleteField");
5641
+ */ function $r() {
5642
+ return new qn("deleteField");
5163
5643
  }
5164
5644
 
5165
5645
  /**
5166
5646
  * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
5167
5647
  * include a server-generated timestamp in the written data.
5168
- */ function Pr() {
5169
- return new Sn("serverTimestamp");
5648
+ */ function xr() {
5649
+ return new kn("serverTimestamp");
5170
5650
  }
5171
5651
 
5172
5652
  /**
@@ -5180,10 +5660,10 @@ function Tr(t, e, n, ...r) {
5180
5660
  * @param elements - The elements to union into the array.
5181
5661
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
5182
5662
  * `updateDoc()`.
5183
- */ function Vr(...t) {
5663
+ */ function Fr(...t) {
5184
5664
  // NOTE: We don't actually parse the data until it's used in set() or
5185
5665
  // update() since we'd need the Firestore instance to do this.
5186
- return new xn("arrayUnion", t);
5666
+ return new Cn("arrayUnion", t);
5187
5667
  }
5188
5668
 
5189
5669
  /**
@@ -5196,10 +5676,10 @@ function Tr(t, e, n, ...r) {
5196
5676
  * @param elements - The elements to remove from the array.
5197
5677
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
5198
5678
  * `updateDoc()`
5199
- */ function Dr(...t) {
5679
+ */ function Sr(...t) {
5200
5680
  // NOTE: We don't actually parse the data until it's used in set() or
5201
5681
  // update() since we'd need the Firestore instance to do this.
5202
- return new Fn("arrayRemove", t);
5682
+ return new Ln("arrayRemove", t);
5203
5683
  }
5204
5684
 
5205
5685
  /**
@@ -5220,8 +5700,8 @@ function Tr(t, e, n, ...r) {
5220
5700
  * @param n - The value to increment by.
5221
5701
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
5222
5702
  * `updateDoc()`
5223
- */ function Nr(t) {
5224
- return new qn("increment", t);
5703
+ */ function qr(t) {
5704
+ return new Mn("increment", t);
5225
5705
  }
5226
5706
 
5227
5707
  /**
@@ -5247,25 +5727,25 @@ function Tr(t, e, n, ...r) {
5247
5727
  * provides methods for adding writes to the write batch. None of the writes
5248
5728
  * will be committed (or visible locally) until {@link WriteBatch.commit} is
5249
5729
  * called.
5250
- */ class $r {
5730
+ */ class Or {
5251
5731
  /** @hideconstructor */
5252
5732
  constructor(t, e) {
5253
5733
  this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
5254
- this._dataReader = Vn(t);
5734
+ this._dataReader = Fn(t);
5255
5735
  }
5256
5736
  set(t, e, n) {
5257
5737
  this._verifyNotCommitted();
5258
- const r = Sr(t, this._firestore), s = _r(r.converter, e, n), i = Dn(this._dataReader, "WriteBatch.set", r._key, s, null !== r.converter, n);
5259
- return this._mutations.push(i.toMutation(r._key, ve.none())), this;
5738
+ const r = kr(t, this._firestore), s = Tr(r.converter, e, n), i = Sn(this._dataReader, "WriteBatch.set", r._key, s, null !== r.converter, n);
5739
+ return this._mutations.push(i.toMutation(r._key, Re.none())), this;
5260
5740
  }
5261
5741
  update(t, e, n, ...r) {
5262
5742
  this._verifyNotCommitted();
5263
- const s = Sr(t, this._firestore);
5743
+ const s = kr(t, this._firestore);
5264
5744
  // For Compat types, we have to "extract" the underlying types before
5265
5745
  // performing validation.
5266
5746
  let i;
5267
- return i = "string" == typeof (e = getModularInstance(e)) || e instanceof yn ? Cn(this._dataReader, "WriteBatch.update", s._key, e, n, r) : On(this._dataReader, "WriteBatch.update", s._key, e),
5268
- this._mutations.push(i.toMutation(s._key, ve.exists(!0))), this;
5747
+ return i = "string" == typeof (e = getModularInstance(e)) || e instanceof En ? jn(this._dataReader, "WriteBatch.update", s._key, e, n, r) : Un(this._dataReader, "WriteBatch.update", s._key, e),
5748
+ this._mutations.push(i.toMutation(s._key, Re.exists(!0))), this;
5269
5749
  }
5270
5750
  /**
5271
5751
  * Deletes the document referred to by the provided {@link DocumentReference}.
@@ -5274,8 +5754,8 @@ function Tr(t, e, n, ...r) {
5274
5754
  * @returns This `WriteBatch` instance. Used for chaining method calls.
5275
5755
  */ delete(t) {
5276
5756
  this._verifyNotCommitted();
5277
- const e = Sr(t, this._firestore);
5278
- return this._mutations = this._mutations.concat(new Ie(e._key, ve.none())), this;
5757
+ const e = kr(t, this._firestore);
5758
+ return this._mutations = this._mutations.concat(new De(e._key, Re.none())), this;
5279
5759
  }
5280
5760
  /**
5281
5761
  * Commits all of the writes in this write batch as a single atomic unit.
@@ -5292,12 +5772,12 @@ function Tr(t, e, n, ...r) {
5292
5772
  return this._verifyNotCommitted(), this._committed = !0, this._mutations.length > 0 ? this._commitHandler(this._mutations) : Promise.resolve();
5293
5773
  }
5294
5774
  _verifyNotCommitted() {
5295
- if (this._committed) throw new U(S, "A write batch can no longer be used after commit() has been called.");
5775
+ if (this._committed) throw new L(x, "A write batch can no longer be used after commit() has been called.");
5296
5776
  }
5297
5777
  }
5298
5778
 
5299
- function Sr(t, e) {
5300
- if ((t = getModularInstance(t)).firestore !== e) throw new U(I, "Provided document reference is from a different Firestore instance.");
5779
+ function kr(t, e) {
5780
+ if ((t = getModularInstance(t)).firestore !== e) throw new L(A, "Provided document reference is from a different Firestore instance.");
5301
5781
  return t;
5302
5782
  }
5303
5783
 
@@ -5313,9 +5793,9 @@ function Sr(t, e) {
5313
5793
  *
5314
5794
  * @returns A `WriteBatch` that can be used to atomically execute multiple
5315
5795
  * writes.
5316
- */ function xr(t) {
5317
- const e = en(t = ot(t, rn));
5318
- return new $r(t, (t => Je(e, t)));
5796
+ */ function Cr(t) {
5797
+ const e = un(t = ot(t, an));
5798
+ return new Or(t, (t => nn(e, t)));
5319
5799
  }
5320
5800
 
5321
5801
  /**
@@ -5337,7 +5817,7 @@ function Sr(t, e) {
5337
5817
  /**
5338
5818
  * Internal transaction object responsible for accumulating the mutations to
5339
5819
  * perform and the base versions for any documents read.
5340
- */ class Fr {
5820
+ */ class Lr {
5341
5821
  constructor(t) {
5342
5822
  this.datastore = t,
5343
5823
  // The version of each document that was read during this transaction.
@@ -5356,8 +5836,8 @@ function Sr(t, e) {
5356
5836
  this.writtenDocs = new Set;
5357
5837
  }
5358
5838
  async lookup(t) {
5359
- if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new U(I, "Firestore transactions require all reads to be executed before all writes.");
5360
- const e = await Xe(this.datastore, t);
5839
+ if (this.ensureCommitNotCalled(), this.mutations.length > 0) throw new L(A, "Firestore transactions require all reads to be executed before all writes.");
5840
+ const e = await rn(this.datastore, t);
5361
5841
  return e.forEach((t => this.recordVersion(t))), e;
5362
5842
  }
5363
5843
  set(t, e) {
@@ -5372,7 +5852,7 @@ function Sr(t, e) {
5372
5852
  this.writtenDocs.add(t.toString());
5373
5853
  }
5374
5854
  delete(t) {
5375
- this.write(new Ie(t, this.precondition(t))), this.writtenDocs.add(t.toString());
5855
+ this.write(new De(t, this.precondition(t))), this.writtenDocs.add(t.toString());
5376
5856
  }
5377
5857
  async commit() {
5378
5858
  if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError;
@@ -5385,21 +5865,21 @@ function Sr(t, e) {
5385
5865
  // a `verify` operation.
5386
5866
  t.forEach(((t, e) => {
5387
5867
  const n = et.fromPath(e);
5388
- this.mutations.push(new Re(n, this.precondition(n)));
5389
- })), await Je(this.datastore, this.mutations), this.committed = !0;
5868
+ this.mutations.push(new $e(n, this.precondition(n)));
5869
+ })), await nn(this.datastore, this.mutations), this.committed = !0;
5390
5870
  }
5391
5871
  recordVersion(t) {
5392
5872
  let e;
5393
5873
  if (t.isFoundDocument()) e = t.version; else {
5394
5874
  if (!t.isNoDocument()) throw g();
5395
5875
  // For deleted docs, we must use baseVersion 0 when we overwrite them.
5396
- e = bt.min();
5876
+ e = vt.min();
5397
5877
  }
5398
5878
  const n = this.readVersions.get(t.key.toString());
5399
5879
  if (n) {
5400
5880
  if (!e.isEqual(n))
5401
5881
  // This transaction will fail no matter what.
5402
- throw new U(x, "Document version changed between two reads.");
5882
+ throw new L(F, "Document version changed between two reads.");
5403
5883
  } else this.readVersions.set(t.key.toString(), e);
5404
5884
  }
5405
5885
  /**
@@ -5407,7 +5887,7 @@ function Sr(t, e) {
5407
5887
  * as a precondition, or no precondition if it was not read.
5408
5888
  */ precondition(t) {
5409
5889
  const e = this.readVersions.get(t.toString());
5410
- return !this.writtenDocs.has(t.toString()) && e ? ve.updateTime(e) : ve.none();
5890
+ return !this.writtenDocs.has(t.toString()) && e ? Re.updateTime(e) : Re.none();
5411
5891
  }
5412
5892
  /**
5413
5893
  * Returns the precondition for a document if the operation is an update.
@@ -5416,7 +5896,7 @@ function Sr(t, e) {
5416
5896
  // The first time a document is written, we want to take into account the
5417
5897
  // read time and existence
5418
5898
  if (!this.writtenDocs.has(t.toString()) && e) {
5419
- if (e.isEqual(bt.min()))
5899
+ if (e.isEqual(vt.min()))
5420
5900
  // The document doesn't exist, so fail the transaction.
5421
5901
  // This has to be validated locally because you can't send a
5422
5902
  // precondition that a document does not exist without changing the
@@ -5426,13 +5906,13 @@ function Sr(t, e) {
5426
5906
  // express that to the backend, we have to validate locally.
5427
5907
  // Note: this can change once we can send separate verify writes in the
5428
5908
  // transaction.
5429
- throw new U(I, "Can't update a document that doesn't exist.");
5909
+ throw new L(A, "Can't update a document that doesn't exist.");
5430
5910
  // Document exists, base precondition on document update time.
5431
- return ve.updateTime(e);
5911
+ return Re.updateTime(e);
5432
5912
  }
5433
5913
  // Document was not read, so we just use the preconditions for a blind
5434
5914
  // update.
5435
- return ve.exists(!0);
5915
+ return Re.exists(!0);
5436
5916
  }
5437
5917
  write(t) {
5438
5918
  this.ensureCommitNotCalled(), this.mutations.push(t);
@@ -5455,7 +5935,7 @@ function Sr(t, e) {
5455
5935
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5456
5936
  * See the License for the specific language governing permissions and
5457
5937
  * limitations under the License.
5458
- */ const qr = {
5938
+ */ const Mr = {
5459
5939
  maxAttempts: 5
5460
5940
  };
5461
5941
 
@@ -5479,17 +5959,17 @@ function Sr(t, e) {
5479
5959
  * TransactionRunner encapsulates the logic needed to run and retry transactions
5480
5960
  * with backoff.
5481
5961
  */
5482
- class Or {
5962
+ class Ur {
5483
5963
  constructor(t, e, n, r, s) {
5484
5964
  this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = r,
5485
- this.deferred = s, this.Tt = n.maxAttempts, this.At = new He(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
5965
+ this.deferred = s, this.Tt = n.maxAttempts, this.It = new tn(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
5486
5966
  }
5487
5967
  /** Runs the transaction and sets the result on deferred. */ run() {
5488
- this.Tt -= 1, this.It();
5968
+ this.Tt -= 1, this.At();
5489
5969
  }
5490
- It() {
5491
- this.At.W((async () => {
5492
- const t = new Fr(this.datastore), e = this.Rt(t);
5970
+ At() {
5971
+ this.It.W((async () => {
5972
+ const t = new Lr(this.datastore), e = this.Rt(t);
5493
5973
  e && e.then((e => {
5494
5974
  this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {
5495
5975
  this.deferred.resolve(e);
@@ -5512,7 +5992,7 @@ class Or {
5512
5992
  }
5513
5993
  }
5514
5994
  Pt(t) {
5515
- this.Tt > 0 && this.Vt(t) ? (this.Tt -= 1, this.asyncQueue.enqueueAndForget((() => (this.It(),
5995
+ this.Tt > 0 && this.Vt(t) ? (this.Tt -= 1, this.asyncQueue.enqueueAndForget((() => (this.At(),
5516
5996
  Promise.resolve())))) : this.deferred.reject(t);
5517
5997
  }
5518
5998
  Vt(t) {
@@ -5533,28 +6013,28 @@ class Or {
5533
6013
  return g();
5534
6014
 
5535
6015
  case T:
5536
- case A:
6016
+ case I:
5537
6017
  case R:
5538
6018
  case $:
5539
6019
  case O:
5540
- case C:
6020
+ case k:
5541
6021
  // Unauthenticated means something went wrong with our token and we need
5542
6022
  // to retry with new credentials which will happen automatically.
5543
- case N:
6023
+ case D:
5544
6024
  return !1;
5545
6025
 
5546
- case I:
6026
+ case A:
5547
6027
  case P:
5548
6028
  case V:
5549
- case D:
5550
- case S:
6029
+ case N:
6030
+ case x:
5551
6031
  // Aborted might be retried in some scenarios, but that is dependant on
5552
6032
  // the context and should handled individually by the calling code.
5553
6033
  // See https://cloud.google.com/apis/design/errors.
5554
- case x:
5555
- case F:
6034
+ case F:
6035
+ case S:
5556
6036
  case q:
5557
- case L:
6037
+ case C:
5558
6038
  return !0;
5559
6039
  }
5560
6040
  }(e);
@@ -5579,7 +6059,7 @@ class Or {
5579
6059
  * See the License for the specific language governing permissions and
5580
6060
  * limitations under the License.
5581
6061
  */
5582
- /** The Platform's 'document' implementation or null if not available. */ function Cr() {
6062
+ /** The Platform's 'document' implementation or null if not available. */ function jr() {
5583
6063
  // `document` is not always available, e.g. in ReactNative and WebWorkers.
5584
6064
  // eslint-disable-next-line no-restricted-globals
5585
6065
  return "undefined" != typeof document ? document : null;
@@ -5611,10 +6091,10 @@ class Or {
5611
6091
  * Note: We implement `PromiseLike` instead of `Promise`, as the `Promise` type
5612
6092
  * in newer versions of TypeScript defines `finally`, which is not available in
5613
6093
  * IE.
5614
- */ class Lr {
6094
+ */ class Br {
5615
6095
  constructor(t, e, n, r, s) {
5616
6096
  this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = s,
5617
- this.deferred = new k, this.then = this.deferred.promise.then.bind(this.deferred.promise),
6097
+ this.deferred = new M, this.then = this.deferred.promise.then.bind(this.deferred.promise),
5618
6098
  // It's normal for the deferred promise to be canceled (due to cancellation)
5619
6099
  // and so we attach a dummy catch callback to avoid
5620
6100
  // 'UnhandledPromiseRejectionWarning' log spam.
@@ -5634,7 +6114,7 @@ class Or {
5634
6114
  * PORTING NOTE: This exists to prevent making removeDelayedOperation() and
5635
6115
  * the DelayedOperation class public.
5636
6116
  */ static createAndSchedule(t, e, n, r, s) {
5637
- const i = Date.now() + n, o = new Lr(t, e, i, r, s);
6117
+ const i = Date.now() + n, o = new Br(t, e, i, r, s);
5638
6118
  return o.start(n), o;
5639
6119
  }
5640
6120
  /**
@@ -5656,7 +6136,7 @@ class Or {
5656
6136
  * As long as the operation has not yet been run, calling cancel() provides a
5657
6137
  * guarantee that the operation will not be run.
5658
6138
  */ cancel(t) {
5659
- null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new U(T, "Operation cancelled" + (t ? ": " + t : ""))));
6139
+ null !== this.timerHandle && (this.clearTimeout(), this.deferred.reject(new L(T, "Operation cancelled" + (t ? ": " + t : ""))));
5660
6140
  }
5661
6141
  handleDelayElapsed() {
5662
6142
  this.asyncQueue.enqueueAndForget((() => null !== this.timerHandle ? (this.clearTimeout(),
@@ -5683,39 +6163,39 @@ class Or {
5683
6163
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5684
6164
  * See the License for the specific language governing permissions and
5685
6165
  * limitations under the License.
5686
- */ class Ur {
6166
+ */ class zr {
5687
6167
  constructor() {
5688
6168
  // The last promise in the queue.
5689
- this.Dt = Promise.resolve(),
6169
+ this.Nt = Promise.resolve(),
5690
6170
  // A list of retryable operations. Retryable operations are run in order and
5691
6171
  // retried with backoff.
5692
- this.Nt = [],
6172
+ this.Dt = [],
5693
6173
  // Is this AsyncQueue being shut down? Once it is set to true, it will not
5694
6174
  // be changed again.
5695
6175
  this.$t = !1,
5696
6176
  // Operations scheduled to be queued in the future. Operations are
5697
6177
  // automatically removed after they are run or canceled.
5698
- this.St = [],
6178
+ this.xt = [],
5699
6179
  // visible for testing
5700
- this.xt = null,
6180
+ this.Ft = null,
5701
6181
  // Flag set while there's an outstanding AsyncQueue operation, used for
5702
6182
  // assertion sanity-checks.
5703
- this.Ft = !1,
6183
+ this.St = !1,
5704
6184
  // Enabled during shutdown on Safari to prevent future access to IndexedDB.
5705
6185
  this.qt = !1,
5706
6186
  // List of TimerIds to fast-forward delays for.
5707
6187
  this.Ot = [],
5708
6188
  // Backoff timer used to schedule retries for retryable operations
5709
- this.At = new He(this, "async_queue_retry" /* AsyncQueueRetry */),
6189
+ this.It = new tn(this, "async_queue_retry" /* AsyncQueueRetry */),
5710
6190
  // Visibility handler that triggers an immediate retry of all retryable
5711
6191
  // operations. Meant to speed up recovery when we regain file system access
5712
6192
  // after page comes into foreground.
5713
- this.Ct = () => {
5714
- const t = Cr();
5715
- t && m("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.At.H();
6193
+ this.kt = () => {
6194
+ const t = jr();
6195
+ t && m("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.It.Y();
5716
6196
  };
5717
- const t = Cr();
5718
- t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.Ct);
6197
+ const t = jr();
6198
+ t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.kt);
5719
6199
  }
5720
6200
  get isShuttingDown() {
5721
6201
  return this.$t;
@@ -5728,38 +6208,38 @@ class Or {
5728
6208
  this.enqueue(t);
5729
6209
  }
5730
6210
  enqueueAndForgetEvenWhileRestricted(t) {
5731
- this.Lt(),
6211
+ this.Ct(),
5732
6212
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
5733
- this.Ut(t);
6213
+ this.Lt(t);
5734
6214
  }
5735
6215
  enterRestrictedMode(t) {
5736
6216
  if (!this.$t) {
5737
6217
  this.$t = !0, this.qt = t || !1;
5738
- const e = Cr();
5739
- e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Ct);
6218
+ const e = jr();
6219
+ e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.kt);
5740
6220
  }
5741
6221
  }
5742
6222
  enqueue(t) {
5743
- if (this.Lt(), this.$t)
6223
+ if (this.Ct(), this.$t)
5744
6224
  // Return a Promise which never resolves.
5745
6225
  return new Promise((() => {}));
5746
6226
  // Create a deferred Promise that we can return to the callee. This
5747
6227
  // allows us to return a "hanging Promise" only to the callee and still
5748
6228
  // advance the queue even when the operation is not run.
5749
- const e = new k;
5750
- return this.Ut((() => this.$t && this.qt ? Promise.resolve() : (t().then(e.resolve, e.reject),
6229
+ const e = new M;
6230
+ return this.Lt((() => this.$t && this.qt ? Promise.resolve() : (t().then(e.resolve, e.reject),
5751
6231
  e.promise))).then((() => e.promise));
5752
6232
  }
5753
6233
  enqueueRetryable(t) {
5754
- this.enqueueAndForget((() => (this.Nt.push(t), this.kt())));
6234
+ this.enqueueAndForget((() => (this.Dt.push(t), this.Mt())));
5755
6235
  }
5756
6236
  /**
5757
6237
  * Runs the next operation from the retryable queue. If the operation fails,
5758
6238
  * reschedules with backoff.
5759
- */ async kt() {
5760
- if (0 !== this.Nt.length) {
6239
+ */ async Mt() {
6240
+ if (0 !== this.Dt.length) {
5761
6241
  try {
5762
- await this.Nt[0](), this.Nt.shift(), this.At.reset();
6242
+ await this.Dt[0](), this.Dt.shift(), this.It.reset();
5763
6243
  } catch (t) {
5764
6244
  if (!
5765
6245
  /**
@@ -5803,7 +6283,7 @@ class Or {
5803
6283
  // Failure will be handled by AsyncQueue
5804
6284
  m("AsyncQueue", "Operation failed with retryable error: " + t);
5805
6285
  }
5806
- this.Nt.length > 0 &&
6286
+ this.Dt.length > 0 &&
5807
6287
  // If there are additional operations, we re-schedule `retryNextOp()`.
5808
6288
  // This is necessary to run retryable operations that failed during
5809
6289
  // their initial attempt since we don't know whether they are already
@@ -5814,12 +6294,12 @@ class Or {
5814
6294
  // Since `backoffAndRun()` cancels an existing backoff and schedules a
5815
6295
  // new backoff on every call, there is only ever a single additional
5816
6296
  // operation in the queue.
5817
- this.At.W((() => this.kt()));
6297
+ this.It.W((() => this.Mt()));
5818
6298
  }
5819
6299
  }
5820
- Ut(t) {
5821
- const e = this.Dt.then((() => (this.Ft = !0, t().catch((t => {
5822
- this.xt = t, this.Ft = !1;
6300
+ Lt(t) {
6301
+ const e = this.Nt.then((() => (this.St = !0, t().catch((t => {
6302
+ this.Ft = t, this.St = !1;
5823
6303
  const e =
5824
6304
  /**
5825
6305
  * Chrome includes Error.message in Error.stack. Other browsers do not.
@@ -5860,38 +6340,38 @@ class Or {
5860
6340
  // all further attempts to chain (via .then) will just short-circuit
5861
6341
  // and return the rejected Promise.
5862
6342
  throw p("INTERNAL UNHANDLED ERROR: ", e), t;
5863
- })).then((t => (this.Ft = !1, t))))));
5864
- return this.Dt = e, e;
6343
+ })).then((t => (this.St = !1, t))))));
6344
+ return this.Nt = e, e;
5865
6345
  }
5866
6346
  enqueueAfterDelay(t, e, n) {
5867
- this.Lt(),
6347
+ this.Ct(),
5868
6348
  // Fast-forward delays for timerIds that have been overriden.
5869
6349
  this.Ot.indexOf(t) > -1 && (e = 0);
5870
- const r = Lr.createAndSchedule(this, t, e, n, (t => this.jt(t)));
5871
- return this.St.push(r), r;
6350
+ const r = Br.createAndSchedule(this, t, e, n, (t => this.Ut(t)));
6351
+ return this.xt.push(r), r;
5872
6352
  }
5873
- Lt() {
5874
- this.xt && g();
6353
+ Ct() {
6354
+ this.Ft && g();
5875
6355
  }
5876
6356
  verifyOperationInProgress() {}
5877
6357
  /**
5878
6358
  * Waits until all currently queued tasks are finished executing. Delayed
5879
6359
  * operations are not run.
5880
- */ async Mt() {
6360
+ */ async jt() {
5881
6361
  // Operations in the queue prior to draining may have enqueued additional
5882
6362
  // operations. Keep draining the queue until the tail is no longer advanced,
5883
6363
  // which indicates that no more new operations were enqueued and that all
5884
6364
  // operations were executed.
5885
6365
  let t;
5886
6366
  do {
5887
- t = this.Dt, await t;
5888
- } while (t !== this.Dt);
6367
+ t = this.Nt, await t;
6368
+ } while (t !== this.Nt);
5889
6369
  }
5890
6370
  /**
5891
6371
  * For Tests: Determine if a delayed operation with a particular TimerId
5892
6372
  * exists.
5893
6373
  */ Bt(t) {
5894
- for (const e of this.St) if (e.timerId === t) return !0;
6374
+ for (const e of this.xt) if (e.timerId === t) return !0;
5895
6375
  return !1;
5896
6376
  }
5897
6377
  /**
@@ -5902,11 +6382,11 @@ class Or {
5902
6382
  * @returns a Promise that resolves once all operations have been run.
5903
6383
  */ zt(t) {
5904
6384
  // Note that draining may generate more delayed ops, so we do that first.
5905
- return this.Mt().then((() => {
6385
+ return this.jt().then((() => {
5906
6386
  // Run ops in the same order they'd run if they ran naturally.
5907
- this.St.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));
5908
- for (const e of this.St) if (e.skipDelay(), "all" /* All */ !== t && e.timerId === t) break;
5909
- return this.Mt();
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();
5910
6390
  }));
5911
6391
  }
5912
6392
  /**
@@ -5914,17 +6394,17 @@ class Or {
5914
6394
  */ Gt(t) {
5915
6395
  this.Ot.push(t);
5916
6396
  }
5917
- /** Called once a DelayedOperation is run or canceled. */ jt(t) {
6397
+ /** Called once a DelayedOperation is run or canceled. */ Ut(t) {
5918
6398
  // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.
5919
- const e = this.St.indexOf(t);
5920
- this.St.splice(e, 1);
6399
+ const e = this.xt.indexOf(t);
6400
+ this.xt.splice(e, 1);
5921
6401
  }
5922
6402
  }
5923
6403
 
5924
- class kr {
6404
+ class Gr {
5925
6405
  /** @hideconstructor */
5926
6406
  constructor(t, e) {
5927
- this._firestore = t, this._transaction = e, this._dataReader = Vn(t);
6407
+ this._firestore = t, this._transaction = e, this._dataReader = Fn(t);
5928
6408
  }
5929
6409
  /**
5930
6410
  * Reads the document referenced by the provided {@link DocumentReference}.
@@ -5932,25 +6412,25 @@ class kr {
5932
6412
  * @param documentRef - A reference to the document to be read.
5933
6413
  * @returns A `DocumentSnapshot` with the read data.
5934
6414
  */ get(t) {
5935
- const e = Sr(t, this._firestore), n = new gr(this._firestore);
6415
+ const e = kr(t, this._firestore), n = new Ir(this._firestore);
5936
6416
  return this._transaction.lookup([ e._key ]).then((t => {
5937
6417
  if (!t || 1 !== t.length) return g();
5938
6418
  const r = t[0];
5939
- if (r.isFoundDocument()) return new Yn(this._firestore, n, r.key, r, e.converter);
5940
- if (r.isNoDocument()) return new Yn(this._firestore, n, e._key, null, e.converter);
6419
+ if (r.isFoundDocument()) return new Zn(this._firestore, n, r.key, r, e.converter);
6420
+ if (r.isNoDocument()) return new Zn(this._firestore, n, e._key, null, e.converter);
5941
6421
  throw g();
5942
6422
  }));
5943
6423
  }
5944
6424
  set(t, e, n) {
5945
- const r = Sr(t, this._firestore), s = _r(r.converter, e, n), i = Dn(this._dataReader, "Transaction.set", r._key, s, null !== r.converter, n);
6425
+ const r = kr(t, this._firestore), s = Tr(r.converter, e, n), i = Sn(this._dataReader, "Transaction.set", r._key, s, null !== r.converter, n);
5946
6426
  return this._transaction.set(r._key, i), this;
5947
6427
  }
5948
6428
  update(t, e, n, ...r) {
5949
- const s = Sr(t, this._firestore);
6429
+ const s = kr(t, this._firestore);
5950
6430
  // For Compat types, we have to "extract" the underlying types before
5951
6431
  // performing validation.
5952
6432
  let i;
5953
- return i = "string" == typeof (e = getModularInstance(e)) || e instanceof yn ? Cn(this._dataReader, "Transaction.update", s._key, e, n, r) : On(this._dataReader, "Transaction.update", s._key, e),
6433
+ return i = "string" == typeof (e = getModularInstance(e)) || e instanceof En ? jn(this._dataReader, "Transaction.update", s._key, e, n, r) : Un(this._dataReader, "Transaction.update", s._key, e),
5954
6434
  this._transaction.update(s._key, i), this;
5955
6435
  }
5956
6436
  /**
@@ -5959,7 +6439,7 @@ class kr {
5959
6439
  * @param documentRef - A reference to the document to be deleted.
5960
6440
  * @returns This `Transaction` instance. Used for chaining method calls.
5961
6441
  */ delete(t) {
5962
- const e = Sr(t, this._firestore);
6442
+ const e = kr(t, this._firestore);
5963
6443
  return this._transaction.delete(e._key), this;
5964
6444
  }
5965
6445
  }
@@ -5976,17 +6456,19 @@ class kr {
5976
6456
  * transaction against.
5977
6457
  * @param updateFunction - The function to execute within the transaction
5978
6458
  * context.
6459
+ * @param options - An options object to configure maximum number of attempts to
6460
+ * commit.
5979
6461
  * @returns If the transaction completed successfully or was explicitly aborted
5980
6462
  * (the `updateFunction` returned a failed promise), the promise returned by the
5981
6463
  * `updateFunction `is returned here. Otherwise, if the transaction failed, a
5982
6464
  * rejected promise with the corresponding failure error is returned.
5983
- */ function jr(t, e, n) {
5984
- const r = en(t = ot(t, rn)), s = Object.assign(Object.assign({}, qr), n);
6465
+ */ function Wr(t, e, n) {
6466
+ const r = un(t = ot(t, an)), s = Object.assign(Object.assign({}, Mr), n);
5985
6467
  !function(t) {
5986
- if (t.maxAttempts < 1) throw new U(I, "Max attempts must be at least 1");
6468
+ if (t.maxAttempts < 1) throw new L(A, "Max attempts must be at least 1");
5987
6469
  }(s);
5988
- const i = new k;
5989
- return new Or(new Ur, r, s, (n => e(new kr(t, n))), i).run(), i.promise;
6470
+ const i = new M;
6471
+ return new Ur(new zr, r, s, (n => e(new Gr(t, n))), i).run(), i.promise;
5990
6472
  }
5991
6473
 
5992
6474
  /**
@@ -5999,11 +6481,11 @@ class kr {
5999
6481
  */ !function(t) {
6000
6482
  f = t;
6001
6483
  }(`${SDK_VERSION}_lite`), _registerComponent(new Component("firestore/lite", ((t, {options: e}) => {
6002
- const n = t.getProvider("app").getImmediate(), r = new rn(n, new z(t.getProvider("auth-internal")), new Y(t.getProvider("app-check-internal")));
6484
+ const n = t.getProvider("app").getImmediate(), r = new an(n, new z(t.getProvider("auth-internal")), new Q(t.getProvider("app-check-internal")));
6003
6485
  return e && r._setSettings(e), r;
6004
6486
  }), "PUBLIC")),
6005
6487
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
6006
- registerVersion("firestore-lite", "3.4.9", ""), registerVersion("firestore-lite", "3.4.9", "esm2017");
6488
+ registerVersion("firestore-lite", "3.4.10-canary.8e952e2ee", ""), registerVersion("firestore-lite", "3.4.10-canary.8e952e2ee", "esm2017");
6007
6489
 
6008
- export { gn as Bytes, ln as CollectionReference, an as DocumentReference, Yn as DocumentSnapshot, yn as FieldPath, bn as FieldValue, rn as Firestore, U as FirestoreError, vn as GeoPoint, hn as Query, Zn as QueryConstraint, Hn as QueryDocumentSnapshot, Kn as QuerySnapshot, gt as Timestamp, kr as Transaction, $r as WriteBatch, Ir as addDoc, Dr as arrayRemove, Vr as arrayUnion, fn as collection, dn as collectionGroup, un as connectFirestoreEmulator, Ar as deleteDoc, Rr as deleteField, wn as doc, _n as documentId, dr as endAt, fr as endBefore, br as getDoc, vr as getDocs, on as getFirestore, Nr as increment, sn as initializeFirestore, or as limit, ur as limitToLast, sr as orderBy, tr as query, pn as queryEqual, mn as refEqual, jr as runTransaction, Pr as serverTimestamp, Er as setDoc, w as setLogLevel, Jn as snapshotEqual, hr as startAfter, ar as startAt, cn as terminate, Tr as updateDoc, nr as where, xr as writeBatch };
6490
+ 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 };
6009
6491
  //# sourceMappingURL=index.browser.esm2017.js.map