@firebase/firestore 3.4.3-canary.4983f4d5a → 3.4.3-canary.73fcec982

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.
@@ -70,7 +70,7 @@ O.MOCK_USER = new O("mock-user");
70
70
  * See the License for the specific language governing permissions and
71
71
  * limitations under the License.
72
72
  */
73
- var M = "9.6.4-canary.4983f4d5a", F = new h("@firebase/firestore");
73
+ var M = "9.6.4-canary.73fcec982", F = new h("@firebase/firestore");
74
74
 
75
75
  /**
76
76
  * @license
@@ -11232,14 +11232,14 @@ e, i, o, s) {
11232
11232
  // Mark this as something the client is currently listening for.
11233
11233
  n.Wr.set(e.targetId, e), ps(n) ?
11234
11234
  // The listen will be sent in onWatchStreamOpen
11235
- ds(n) : Cs(n).lr() && fs(n, e));
11235
+ ds(n) : xs(n).lr() && fs(n, e));
11236
11236
  }
11237
11237
 
11238
11238
  /**
11239
11239
  * Removes the listen from server. It is a no-op if the given target id is
11240
11240
  * not being listened to.
11241
11241
  */ function hs(t, e) {
11242
- var n = W(t), r = Cs(n);
11242
+ var n = W(t), r = xs(n);
11243
11243
  n.Wr.delete(e), r.lr() && ls(n, e), 0 === n.Wr.size && (r.lr() ? r._r() : ys(n) &&
11244
11244
  // Revert to OnlineState.Unknown if the watch stream is not open and we
11245
11245
  // have no listeners, since without any listens to send we cannot
@@ -11251,7 +11251,7 @@ e, i, o, s) {
11251
11251
  * We need to increment the the expected number of pending responses we're due
11252
11252
  * from watch so we wait for the ack to process any messages from this target.
11253
11253
  */ function fs(t, e) {
11254
- t.Yr.X(e.targetId), Cs(t).Pr(e)
11254
+ t.Yr.X(e.targetId), xs(t).Pr(e)
11255
11255
  /**
11256
11256
  * We need to increment the expected number of pending responses we're due
11257
11257
  * from watch so we wait for the removal on the server before we process any
@@ -11260,7 +11260,7 @@ e, i, o, s) {
11260
11260
  }
11261
11261
 
11262
11262
  function ls(t, e) {
11263
- t.Yr.X(e), Cs(t).vr(e);
11263
+ t.Yr.X(e), xs(t).vr(e);
11264
11264
  }
11265
11265
 
11266
11266
  function ds(t) {
@@ -11271,7 +11271,7 @@ function ds(t) {
11271
11271
  Et: function(e) {
11272
11272
  return t.Wr.get(e) || null;
11273
11273
  }
11274
- }), Cs(t).start(), t.Jr.Br()
11274
+ }), xs(t).start(), t.Jr.Br()
11275
11275
  /**
11276
11276
  * Returns whether the watch stream should be started because it's necessary
11277
11277
  * and has not yet been started.
@@ -11279,7 +11279,7 @@ function ds(t) {
11279
11279
  }
11280
11280
 
11281
11281
  function ps(t) {
11282
- return ys(t) && !Cs(t).hr() && t.Wr.size > 0;
11282
+ return ys(t) && !xs(t).hr() && t.Wr.size > 0;
11283
11283
  }
11284
11284
 
11285
11285
  function ys(t) {
@@ -11501,7 +11501,7 @@ function Ts(t) {
11501
11501
  return r(this, (function(r) {
11502
11502
  switch (r.label) {
11503
11503
  case 0:
11504
- e = W(t), n = xs(e), i = e.Qr.length > 0 ? e.Qr[e.Qr.length - 1].batchId : -1, r.label = 1;
11504
+ e = W(t), n = Rs(e), i = e.Qr.length > 0 ? e.Qr[e.Qr.length - 1].batchId : -1, r.label = 1;
11505
11505
 
11506
11506
  case 1:
11507
11507
  if (!
@@ -11525,7 +11525,7 @@ function Ts(t) {
11525
11525
  return null === (o = r.sent()) ? (0 === e.Qr.length && n._r(), [ 3 /*break*/ , 7 ]) : (i = o.batchId,
11526
11526
  function(t, e) {
11527
11527
  t.Qr.push(e);
11528
- var n = xs(t);
11528
+ var n = Rs(t);
11529
11529
  n.lr() && n.Sr && n.Dr(e.mutations);
11530
11530
  }(e, o), [ 3 /*break*/ , 6 ]);
11531
11531
 
@@ -11546,17 +11546,17 @@ function Ts(t) {
11546
11546
  }
11547
11547
 
11548
11548
  function Es(t) {
11549
- return ys(t) && !xs(t).hr() && t.Qr.length > 0;
11549
+ return ys(t) && !Rs(t).hr() && t.Qr.length > 0;
11550
11550
  }
11551
11551
 
11552
11552
  function Ss(t) {
11553
- xs(t).start();
11553
+ Rs(t).start();
11554
11554
  }
11555
11555
 
11556
11556
  function _s(t) {
11557
11557
  return n(this, void 0, void 0, (function() {
11558
11558
  return r(this, (function(e) {
11559
- return xs(t).kr(), [ 2 /*return*/ ];
11559
+ return Rs(t).kr(), [ 2 /*return*/ ];
11560
11560
  }));
11561
11561
  }));
11562
11562
  }
@@ -11566,7 +11566,7 @@ function As(t) {
11566
11566
  var e, n, i, o;
11567
11567
  return r(this, (function(r) {
11568
11568
  // Send the write pipeline now that the stream is established.
11569
- for (e = xs(t), n = 0, i = t.Qr; n < i.length; n++) o = i[n], e.Dr(o.mutations);
11569
+ for (e = Rs(t), n = 0, i = t.Qr; n < i.length; n++) o = i[n], e.Dr(o.mutations);
11570
11570
  return [ 2 /*return*/ ];
11571
11571
  }));
11572
11572
  }));
@@ -11601,7 +11601,7 @@ function Ds(t, e) {
11601
11601
  return r(this, (function(i) {
11602
11602
  switch (i.label) {
11603
11603
  case 0:
11604
- return e && xs(t).Sr ? [ 4 /*yield*/ , function(t, e) {
11604
+ return e && Rs(t).Sr ? [ 4 /*yield*/ , function(t, e) {
11605
11605
  return n(this, void 0, void 0, (function() {
11606
11606
  var n, i;
11607
11607
  return r(this, (function(r) {
@@ -11611,7 +11611,7 @@ function Ds(t, e) {
11611
11611
  // In this case it's also unlikely that the server itself is melting
11612
11612
  // down -- this was just a bad request so inhibit backoff on the next
11613
11613
  // restart.
11614
- xs(t).wr(), [ 4 /*yield*/ , Is(t, (function() {
11614
+ Rs(t).wr(), [ 4 /*yield*/ , Is(t, (function() {
11615
11615
  return t.remoteSyncer.rejectFailedWrite(n.batchId, e);
11616
11616
  })) ]) : [ 3 /*break*/ , 3 ];
11617
11617
 
@@ -11651,9 +11651,40 @@ function Ds(t, e) {
11651
11651
  }));
11652
11652
  }
11653
11653
 
11654
+ function Ns(t, e) {
11655
+ return n(this, void 0, void 0, (function() {
11656
+ var n, i;
11657
+ return r(this, (function(r) {
11658
+ switch (r.label) {
11659
+ case 0:
11660
+ return (n = W(t)).asyncQueue.verifyOperationInProgress(), U("RemoteStore", "RemoteStore received new credentials"),
11661
+ i = ys(n),
11662
+ // Tear down and re-create our network streams. This will ensure we get a
11663
+ // fresh auth token for the new user and re-fill the write pipeline with
11664
+ // new mutations from the LocalStore (since mutations are per-user).
11665
+ n.Gr.add(3 /* CredentialChange */), [ 4 /*yield*/ , as(n) ];
11666
+
11667
+ case 1:
11668
+ return r.sent(), i &&
11669
+ // Don't set the network status to Unknown if we are offline.
11670
+ n.Jr.set("Unknown" /* Unknown */), [ 4 /*yield*/ , n.remoteSyncer.handleCredentialChange(e) ];
11671
+
11672
+ case 2:
11673
+ return r.sent(), n.Gr.delete(3 /* CredentialChange */), [ 4 /*yield*/ , us(n) ];
11674
+
11675
+ case 3:
11676
+ // Tear down and re-create our network streams. This will ensure we get a
11677
+ // fresh auth token for the new user and re-fill the write pipeline with
11678
+ // new mutations from the LocalStore (since mutations are per-user).
11679
+ return r.sent(), [ 2 /*return*/ ];
11680
+ }
11681
+ }));
11682
+ }));
11683
+ }
11684
+
11654
11685
  /**
11655
11686
  * Toggles the network state when the client gains or loses its primary lease.
11656
- */ function Ns(t, e) {
11687
+ */ function Cs(t, e) {
11657
11688
  return n(this, void 0, void 0, (function() {
11658
11689
  var n;
11659
11690
  return r(this, (function(r) {
@@ -11687,7 +11718,7 @@ function Ds(t, e) {
11687
11718
  *
11688
11719
  * PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.
11689
11720
  * This is not done on Web to allow it to be tree-shaken.
11690
- */ function Cs(t) {
11721
+ */ function xs(t) {
11691
11722
  var e = this;
11692
11723
  return t.Xr || (
11693
11724
  // Create stream (but note that it is not started yet).
@@ -11727,7 +11758,7 @@ function Ds(t, e) {
11727
11758
  */;
11728
11759
  }
11729
11760
 
11730
- function xs(t) {
11761
+ function Rs(t) {
11731
11762
  var e = this;
11732
11763
  return t.Zr || (
11733
11764
  // Create stream (but note that it is not started yet).
@@ -11792,7 +11823,7 @@ function xs(t) {
11792
11823
  */;
11793
11824
  }
11794
11825
 
11795
- var Rs = /** @class */ function() {
11826
+ var Ls = /** @class */ function() {
11796
11827
  function t(t, e, n, r, i) {
11797
11828
  this.asyncQueue = t, this.timerId = e, this.targetTimeMs = n, this.op = r, this.removalCallback = i,
11798
11829
  this.deferred = new J, this.then = this.deferred.promise.then.bind(this.deferred.promise),
@@ -11861,7 +11892,7 @@ var Rs = /** @class */ function() {
11861
11892
  /**
11862
11893
  * Returns a FirestoreError that can be surfaced to the user if the provided
11863
11894
  * error is an IndexedDbTransactionError. Re-throws the error otherwise.
11864
- */ function Ls(t, e) {
11895
+ */ function Ps(t, e) {
11865
11896
  if (B("AsyncQueue", e + ": " + t), Jr(t)) return new Y(H.UNAVAILABLE, e + ": " + t);
11866
11897
  throw t;
11867
11898
  }
@@ -11887,7 +11918,7 @@ var Rs = /** @class */ function() {
11887
11918
  * in order specified by the provided comparator. We always add a document key
11888
11919
  * comparator on top of what is provided to guarantee document equality based on
11889
11920
  * the key.
11890
- */ var Ps = /** @class */ function() {
11921
+ */ var Os = /** @class */ function() {
11891
11922
  /** The default ordering is by key if the comparator is omitted */
11892
11923
  function t(t) {
11893
11924
  // We are adding document key comparator to the end as it's the only
@@ -11959,7 +11990,7 @@ var Rs = /** @class */ function() {
11959
11990
  var r = new t;
11960
11991
  return r.comparator = this.comparator, r.keyedMap = e, r.sortedSet = n, r;
11961
11992
  }, t;
11962
- }(), Os = /** @class */ function() {
11993
+ }(), Ms = /** @class */ function() {
11963
11994
  function t() {
11964
11995
  this.eo = new wn(Pt.comparator);
11965
11996
  }
@@ -11997,7 +12028,7 @@ var Rs = /** @class */ function() {
11997
12028
  t.push(n);
11998
12029
  })), t;
11999
12030
  }, t;
12000
- }(), Ms = /** @class */ function() {
12031
+ }(), Fs = /** @class */ function() {
12001
12032
  function t(t, e, n, r, i, o, s, u) {
12002
12033
  this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = r, this.mutatedKeys = i,
12003
12034
  this.fromCache = o, this.syncStateChanged = s, this.excludesMetadataChanges = u
@@ -12010,7 +12041,7 @@ var Rs = /** @class */ function() {
12010
12041
  type: 0 /* Added */ ,
12011
12042
  doc: t
12012
12043
  });
12013
- })), new t(e, n, Ps.emptySet(n), o, r, i,
12044
+ })), new t(e, n, Os.emptySet(n), o, r, i,
12014
12045
  /* syncStateChanged= */ !0,
12015
12046
  /* excludesMetadataChanges= */ !1);
12016
12047
  }, Object.defineProperty(t.prototype, "hasPendingWrites", {
@@ -12026,9 +12057,9 @@ var Rs = /** @class */ function() {
12026
12057
  for (var r = 0; r < e.length; r++) if (e[r].type !== n[r].type || !e[r].doc.isEqual(n[r].doc)) return !1;
12027
12058
  return !0;
12028
12059
  }, t;
12029
- }(), Fs = function() {
12060
+ }(), Vs = function() {
12030
12061
  this.so = void 0, this.listeners = [];
12031
- }, Vs = function() {
12062
+ }, qs = function() {
12032
12063
  this.queries = new zi((function(t) {
12033
12064
  return Ce(t);
12034
12065
  }), Ne), this.onlineState = "Unknown" /* Unknown */ , this.io = new Set;
@@ -12053,13 +12084,13 @@ var Rs = /** @class */ function() {
12053
12084
  /**
12054
12085
  * DocumentChangeSet keeps track of a set of changes to docs in a query, merging
12055
12086
  * duplicate events for the same doc.
12056
- */ function qs(t, e) {
12087
+ */ function Us(t, e) {
12057
12088
  return n(this, void 0, void 0, (function() {
12058
12089
  var n, i, o, s, u, a, c;
12059
12090
  return r(this, (function(r) {
12060
12091
  switch (r.label) {
12061
12092
  case 0:
12062
- if (n = W(t), i = e.query, o = !1, (s = n.queries.get(i)) || (o = !0, s = new Fs),
12093
+ if (n = W(t), i = e.query, o = !1, (s = n.queries.get(i)) || (o = !0, s = new Vs),
12063
12094
  !o) return [ 3 /*break*/ , 4 ];
12064
12095
  r.label = 1;
12065
12096
 
@@ -12070,19 +12101,19 @@ var Rs = /** @class */ function() {
12070
12101
  return u.so = r.sent(), [ 3 /*break*/ , 4 ];
12071
12102
 
12072
12103
  case 3:
12073
- return a = r.sent(), c = Ls(a, "Initialization of query '" + xe(e.query) + "' failed"),
12104
+ return a = r.sent(), c = Ps(a, "Initialization of query '" + xe(e.query) + "' failed"),
12074
12105
  [ 2 /*return*/ , void e.onError(c) ];
12075
12106
 
12076
12107
  case 4:
12077
12108
  return n.queries.set(i, s), s.listeners.push(e),
12078
12109
  // Run global snapshot listeners if a consistent snapshot has been emitted.
12079
- e.ro(n.onlineState), s.so && e.oo(s.so) && Ks(n), [ 2 /*return*/ ];
12110
+ e.ro(n.onlineState), s.so && e.oo(s.so) && Gs(n), [ 2 /*return*/ ];
12080
12111
  }
12081
12112
  }));
12082
12113
  }));
12083
12114
  }
12084
12115
 
12085
- function Us(t, e) {
12116
+ function Bs(t, e) {
12086
12117
  return n(this, void 0, void 0, (function() {
12087
12118
  var n, i, o, s, u;
12088
12119
  return r(this, (function(r) {
@@ -12092,7 +12123,7 @@ function Us(t, e) {
12092
12123
  }));
12093
12124
  }
12094
12125
 
12095
- function Bs(t, e) {
12126
+ function js(t, e) {
12096
12127
  for (var n = W(t), r = !1, i = 0, o = e; i < o.length; i++) {
12097
12128
  var s = o[i], u = s.query, a = n.queries.get(u);
12098
12129
  if (a) {
@@ -12102,10 +12133,10 @@ function Bs(t, e) {
12102
12133
  a.so = s;
12103
12134
  }
12104
12135
  }
12105
- r && Ks(n);
12136
+ r && Gs(n);
12106
12137
  }
12107
12138
 
12108
- function js(t, e, n) {
12139
+ function Ks(t, e, n) {
12109
12140
  var r = W(t), i = r.queries.get(e);
12110
12141
  if (i) for (var o = 0, s = i.listeners; o < s.length; o++) {
12111
12142
  s[o].onError(n);
@@ -12116,7 +12147,7 @@ function js(t, e, n) {
12116
12147
  }
12117
12148
 
12118
12149
  // Call all global snapshot listeners that have been set.
12119
- function Ks(t) {
12150
+ function Gs(t) {
12120
12151
  t.io.forEach((function(t) {
12121
12152
  t.next();
12122
12153
  }));
@@ -12127,7 +12158,7 @@ function Ks(t) {
12127
12158
  * when to raise the event.
12128
12159
  *
12129
12160
  * It uses an Observer to dispatch events.
12130
- */ var Gs = /** @class */ function() {
12161
+ */ var zs = /** @class */ function() {
12131
12162
  function t(t, e, n) {
12132
12163
  this.query = t, this.co = e,
12133
12164
  /**
@@ -12150,7 +12181,7 @@ function Ks(t) {
12150
12181
  var i = r[n];
12151
12182
  3 /* Metadata */ !== i.type && e.push(i);
12152
12183
  }
12153
- t = new Ms(t.query, t.docs, t.oldDocs, e, t.mutatedKeys, t.fromCache, t.syncStateChanged,
12184
+ t = new Fs(t.query, t.docs, t.oldDocs, e, t.mutatedKeys, t.fromCache, t.syncStateChanged,
12154
12185
  /* excludesMetadataChanges= */ !0);
12155
12186
  }
12156
12187
  var o = !1;
@@ -12186,10 +12217,10 @@ function Ks(t) {
12186
12217
  // to get here if there were only metadata docChanges and they got
12187
12218
  // stripped out.
12188
12219
  }, t.prototype.fo = function(t) {
12189
- t = Ms.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.ao = !0,
12220
+ t = Fs.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.ao = !0,
12190
12221
  this.co.next(t);
12191
12222
  }, t;
12192
- }(), zs = /** @class */ function() {
12223
+ }(), Qs = /** @class */ function() {
12193
12224
  function t(t,
12194
12225
  // How many bytes this element takes to store in the bundle.
12195
12226
  e) {
@@ -12198,7 +12229,7 @@ function Ks(t) {
12198
12229
  return t.prototype._o = function() {
12199
12230
  return "metadata" in this.payload;
12200
12231
  }, t;
12201
- }(), Qs = /** @class */ function() {
12232
+ }(), Ws = /** @class */ function() {
12202
12233
  function t(t) {
12203
12234
  this.k = t;
12204
12235
  }
@@ -12213,13 +12244,13 @@ function Ks(t) {
12213
12244
  }, t.prototype.Yn = function(t) {
12214
12245
  return Yn(t);
12215
12246
  }, t;
12216
- }(), Ws = /** @class */ function() {
12247
+ }(), Hs = /** @class */ function() {
12217
12248
  function t(t, e, n) {
12218
12249
  this.mo = t, this.localStore = e, this.k = n,
12219
12250
  /** Batched queries to be saved into storage */
12220
12251
  this.queries = [],
12221
12252
  /** Batched documents to be saved into storage */
12222
- this.documents = [], this.progress = Hs(t)
12253
+ this.documents = [], this.progress = Ys(t)
12223
12254
  /**
12224
12255
  * Adds an element from the bundle to the loader.
12225
12256
  *
@@ -12236,7 +12267,7 @@ function Ks(t) {
12236
12267
  ++e), e !== this.progress.documentsLoaded ? (this.progress.documentsLoaded = e,
12237
12268
  Object.assign({}, this.progress)) : null;
12238
12269
  }, t.prototype.po = function(t) {
12239
- for (var e = new Map, n = new Qs(this.k), r = 0, i = t; r < i.length; r++) {
12270
+ for (var e = new Map, n = new Ws(this.k), r = 0, i = t; r < i.length; r++) {
12240
12271
  var o = i[r];
12241
12272
  if (o.metadata.queries) for (var s = n.Hn(o.metadata.name), u = 0, a = o.metadata.queries; u < a.length; u++) {
12242
12273
  var c = a[u], h = (e.get(c) || xn()).add(s);
@@ -12254,7 +12285,7 @@ function Ks(t) {
12254
12285
  return r(this, (function(r) {
12255
12286
  switch (r.label) {
12256
12287
  case 0:
12257
- return [ 4 /*yield*/ , So(this.localStore, new Qs(this.k), this.documents, this.mo.id) ];
12288
+ return [ 4 /*yield*/ , So(this.localStore, new Ws(this.k), this.documents, this.mo.id) ];
12258
12289
 
12259
12290
  case 1:
12260
12291
  t = r.sent(), e = this.po(this.documents), n = 0, i = this.queries, r.label = 2;
@@ -12300,7 +12331,7 @@ function Ks(t) {
12300
12331
  * Returns a `LoadBundleTaskProgress` representing the initial progress of
12301
12332
  * loading a bundle.
12302
12333
  */
12303
- function Hs(t) {
12334
+ function Ys(t) {
12304
12335
  return {
12305
12336
  taskState: "Running",
12306
12337
  documentsLoaded: 0,
@@ -12329,11 +12360,11 @@ function Hs(t) {
12329
12360
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12330
12361
  * See the License for the specific language governing permissions and
12331
12362
  * limitations under the License.
12332
- */ var Ys = function(t) {
12363
+ */ var Js = function(t) {
12333
12364
  this.key = t;
12334
- }, Js = function(t) {
12365
+ }, Xs = function(t) {
12335
12366
  this.key = t;
12336
- }, Xs = /** @class */ function() {
12367
+ }, $s = /** @class */ function() {
12337
12368
  function t(t,
12338
12369
  /** Documents included in the remote target */
12339
12370
  e) {
@@ -12348,7 +12379,7 @@ function Hs(t) {
12348
12379
  /** Documents in the view but not in the remote target */
12349
12380
  this.Io = xn(),
12350
12381
  /** Document Keys that have local changes */
12351
- this.mutatedKeys = xn(), this.Ao = Le(t), this.Ro = new Ps(this.Ao);
12382
+ this.mutatedKeys = xn(), this.Ao = Le(t), this.Ro = new Os(this.Ao);
12352
12383
  }
12353
12384
  return Object.defineProperty(t.prototype, "bo", {
12354
12385
  /**
@@ -12372,7 +12403,7 @@ function Hs(t) {
12372
12403
  * @returns a new set of docs, changes, and refill flag.
12373
12404
  */
12374
12405
  t.prototype.Po = function(t, e) {
12375
- var n = this, r = e ? e.vo : new Os, i = e ? e.Ro : this.Ro, o = e ? e.mutatedKeys : this.mutatedKeys, s = i, u = !1, a = Ie(this.query) && i.size === this.query.limit ? i.last() : null, c = Te(this.query) && i.size === this.query.limit ? i.first() : null;
12406
+ var n = this, r = e ? e.vo : new Ms, i = e ? e.Ro : this.Ro, o = e ? e.mutatedKeys : this.mutatedKeys, s = i, u = !1, a = Ie(this.query) && i.size === this.query.limit ? i.last() : null, c = Te(this.query) && i.size === this.query.limit ? i.first() : null;
12376
12407
  // Drop documents out to meet limit/limitToLast requirement.
12377
12408
  if (t.inorderTraversal((function(t, e) {
12378
12409
  var h = i.get(t), f = Re(n.query, e) ? e : null, l = !!h && n.mutatedKeys.has(h.key), d = !!f && (f.hasLocalMutations ||
@@ -12467,7 +12498,7 @@ function Hs(t) {
12467
12498
  })), this.So(n);
12468
12499
  var s = e ? this.Do() : [], u = 0 === this.Io.size && this.current ? 1 /* Synced */ : 0 /* Local */ , a = u !== this.Eo;
12469
12500
  return this.Eo = u, 0 !== o.length || a ? {
12470
- snapshot: new Ms(this.query, t.Ro, i, o, t.mutatedKeys, 0 /* Local */ === u, a,
12501
+ snapshot: new Fs(this.query, t.Ro, i, o, t.mutatedKeys, 0 /* Local */ === u, a,
12471
12502
  /* excludesMetadataChanges= */ !1),
12472
12503
  Co: s
12473
12504
  } : {
@@ -12487,7 +12518,7 @@ function Hs(t) {
12487
12518
  // true once the client is back online.
12488
12519
  this.current = !1, this.applyChanges({
12489
12520
  Ro: this.Ro,
12490
- vo: new Os,
12521
+ vo: new Ms,
12491
12522
  mutatedKeys: this.mutatedKeys,
12492
12523
  Bn: !1
12493
12524
  },
@@ -12528,9 +12559,9 @@ function Hs(t) {
12528
12559
  // Diff the new limbo docs with the old limbo docs.
12529
12560
  var n = [];
12530
12561
  return e.forEach((function(e) {
12531
- t.Io.has(e) || n.push(new Js(e));
12562
+ t.Io.has(e) || n.push(new Xs(e));
12532
12563
  })), this.Io.forEach((function(t) {
12533
- e.has(t) || n.push(new Ys(t));
12564
+ e.has(t) || n.push(new Js(t));
12534
12565
  })), n;
12535
12566
  },
12536
12567
  /**
@@ -12565,9 +12596,9 @@ function Hs(t) {
12565
12596
  */
12566
12597
  // PORTING NOTE: Multi-tab only.
12567
12598
  t.prototype.xo = function() {
12568
- return Ms.fromInitialDocuments(this.query, this.Ro, this.mutatedKeys, 0 /* Local */ === this.Eo);
12599
+ return Fs.fromInitialDocuments(this.query, this.Ro, this.mutatedKeys, 0 /* Local */ === this.Eo);
12569
12600
  }, t;
12570
- }(), $s = function(
12601
+ }(), Zs = function(
12571
12602
  /**
12572
12603
  * The query itself.
12573
12604
  */
@@ -12585,7 +12616,7 @@ e,
12585
12616
  */
12586
12617
  n) {
12587
12618
  this.query = t, this.targetId = e, this.view = n;
12588
- }, Zs = function(t) {
12619
+ }, tu = function(t) {
12589
12620
  this.key = t,
12590
12621
  /**
12591
12622
  * Set to true once we've received a document. This is used in
@@ -12594,7 +12625,7 @@ n) {
12594
12625
  * the target is CURRENT.
12595
12626
  */
12596
12627
  this.$o = !1;
12597
- }, tu = /** @class */ function() {
12628
+ }, eu = /** @class */ function() {
12598
12629
  function t(t, e, n,
12599
12630
  // PORTING NOTE: Manages state synchronization in multi-tab environments.
12600
12631
  r, i, o) {
@@ -12645,13 +12676,13 @@ n) {
12645
12676
  * server. All the subsequent view snapshots or errors are sent to the
12646
12677
  * subscribed handlers. Returns the initial snapshot.
12647
12678
  */
12648
- function eu(t, e) {
12679
+ function nu(t, e) {
12649
12680
  return n(this, void 0, void 0, (function() {
12650
12681
  var n, i, o, s, u, a;
12651
12682
  return r(this, (function(r) {
12652
12683
  switch (r.label) {
12653
12684
  case 0:
12654
- return n = Cu(t), (s = n.Mo.get(e)) ? (
12685
+ return n = xu(t), (s = n.Mo.get(e)) ? (
12655
12686
  // PORTING NOTE: With Multi-Tab Web, it is possible that a query view
12656
12687
  // already exists when EventManager calls us for the first time. This
12657
12688
  // happens when the primary tab is already listening to this query on
@@ -12665,7 +12696,7 @@ function eu(t, e) {
12665
12696
 
12666
12697
  case 2:
12667
12698
  return u = r.sent(), a = n.sharedClientState.addLocalQueryTarget(u.targetId), i = u.targetId,
12668
- [ 4 /*yield*/ , nu(n, e, i, "current" === a) ];
12699
+ [ 4 /*yield*/ , ru(n, e, i, "current" === a) ];
12669
12700
 
12670
12701
  case 3:
12671
12702
  o = r.sent(), n.isPrimaryClient && cs(n.remoteStore, u), r.label = 4;
@@ -12680,7 +12711,7 @@ function eu(t, e) {
12680
12711
  /**
12681
12712
  * Registers a view for a previously unknown query and computes its initial
12682
12713
  * snapshot.
12683
- */ function nu(t, e, i, o) {
12714
+ */ function ru(t, e, i, o) {
12684
12715
  return n(this, void 0, void 0, (function() {
12685
12716
  var s, u, a, c, h, f;
12686
12717
  return r(this, (function(l) {
@@ -12710,7 +12741,7 @@ function eu(t, e) {
12710
12741
 
12711
12742
  case 2:
12712
12743
  return s = o && o.targetChanges.get(e.targetId), u = e.view.applyChanges(n,
12713
- /* updateLimboDocuments= */ t.isPrimaryClient, s), [ 2 /*return*/ , (yu(t, e.targetId, u.Co),
12744
+ /* updateLimboDocuments= */ t.isPrimaryClient, s), [ 2 /*return*/ , (vu(t, e.targetId, u.Co),
12714
12745
  u.snapshot) ];
12715
12746
  }
12716
12747
  }));
@@ -12720,9 +12751,9 @@ function eu(t, e) {
12720
12751
  /* usePreviousResults= */ !0) ];
12721
12752
 
12722
12753
  case 1:
12723
- return s = l.sent(), u = new Xs(e, s.zn), a = u.Po(s.documents), c = On.createSynthesizedTargetChangeForCurrentChange(i, o && "Offline" /* Offline */ !== t.onlineState),
12754
+ return s = l.sent(), u = new $s(e, s.zn), a = u.Po(s.documents), c = On.createSynthesizedTargetChangeForCurrentChange(i, o && "Offline" /* Offline */ !== t.onlineState),
12724
12755
  h = u.applyChanges(a,
12725
- /* updateLimboDocuments= */ t.isPrimaryClient, c), yu(t, i, h.Co), f = new $s(e, i, u),
12756
+ /* updateLimboDocuments= */ t.isPrimaryClient, c), vu(t, i, h.Co), f = new Zs(e, i, u),
12726
12757
  [ 2 /*return*/ , (t.Mo.set(e, f), t.Fo.has(i) ? t.Fo.get(i).push(e) : t.Fo.set(i, [ e ]),
12727
12758
  h.snapshot) ];
12728
12759
  }
@@ -12730,7 +12761,7 @@ function eu(t, e) {
12730
12761
  }));
12731
12762
  }
12732
12763
 
12733
- /** Stops listening to the query. */ function ru(t, e) {
12764
+ /** Stops listening to the query. */ function iu(t, e) {
12734
12765
  return n(this, void 0, void 0, (function() {
12735
12766
  var n, i, o;
12736
12767
  return r(this, (function(r) {
@@ -12744,7 +12775,7 @@ function eu(t, e) {
12744
12775
  n.sharedClientState.removeLocalQueryTarget(i.targetId), n.sharedClientState.isActiveQueryTarget(i.targetId) ? [ 3 /*break*/ , 2 ] : [ 4 /*yield*/ , wo(n.localStore, i.targetId,
12745
12776
  /*keepPersistedTargetData=*/ !1).then((function() {
12746
12777
  n.sharedClientState.clearQueryState(i.targetId), hs(n.remoteStore, i.targetId),
12747
- du(n, i.targetId);
12778
+ pu(n, i.targetId);
12748
12779
  })).catch(Vi) ]) : [ 3 /*break*/ , 3 ];
12749
12780
 
12750
12781
  case 1:
@@ -12754,7 +12785,7 @@ function eu(t, e) {
12754
12785
  return [ 3 /*break*/ , 5 ];
12755
12786
 
12756
12787
  case 3:
12757
- return du(n, i.targetId), [ 4 /*yield*/ , wo(n.localStore, i.targetId,
12788
+ return pu(n, i.targetId), [ 4 /*yield*/ , wo(n.localStore, i.targetId,
12758
12789
  /*keepPersistedTargetData=*/ !0) ];
12759
12790
 
12760
12791
  case 4:
@@ -12776,13 +12807,13 @@ function eu(t, e) {
12776
12807
  * have completed, *not* when the write was acked by the backend. The
12777
12808
  * userCallback is resolved once the write was acked/rejected by the
12778
12809
  * backend (or failed locally for any other reason).
12779
- */ function iu(t, e, i) {
12810
+ */ function ou(t, e, i) {
12780
12811
  return n(this, void 0, void 0, (function() {
12781
12812
  var n, o, s, u;
12782
12813
  return r(this, (function(r) {
12783
12814
  switch (r.label) {
12784
12815
  case 0:
12785
- n = xu(t), r.label = 1;
12816
+ n = Ru(t), r.label = 1;
12786
12817
 
12787
12818
  case 1:
12788
12819
  return r.trys.push([ 1, 5, , 6 ]), [ 4 /*yield*/ , function(t, e) {
@@ -12820,7 +12851,7 @@ function eu(t, e) {
12820
12851
  return o = r.sent(), n.sharedClientState.addPendingMutation(o.batchId), function(t, e, n) {
12821
12852
  var r = t.Ko[t.currentUser.toKey()];
12822
12853
  r || (r = new wn(ct)), r = r.insert(e, n), t.Ko[t.currentUser.toKey()] = r;
12823
- }(n, o.batchId, i), [ 4 /*yield*/ , gu(n, o.changes) ];
12854
+ }(n, o.batchId, i), [ 4 /*yield*/ , wu(n, o.changes) ];
12824
12855
 
12825
12856
  case 3:
12826
12857
  return r.sent(), [ 4 /*yield*/ , Ts(n.remoteStore) ];
@@ -12829,7 +12860,7 @@ function eu(t, e) {
12829
12860
  return r.sent(), [ 3 /*break*/ , 6 ];
12830
12861
 
12831
12862
  case 5:
12832
- return s = r.sent(), u = Ls(s, "Failed to persist write"), i.reject(u), [ 3 /*break*/ , 6 ];
12863
+ return s = r.sent(), u = Ps(s, "Failed to persist write"), i.reject(u), [ 3 /*break*/ , 6 ];
12833
12864
 
12834
12865
  case 6:
12835
12866
  return [ 2 /*return*/ ];
@@ -12842,7 +12873,7 @@ function eu(t, e) {
12842
12873
  * Applies one remote event to the sync engine, notifying any views of the
12843
12874
  * changes, and releasing any pending mutation batches that would become
12844
12875
  * visible because of the snapshot version the remote event contains.
12845
- */ function ou(t, e) {
12876
+ */ function su(t, e) {
12846
12877
  return n(this, void 0, void 0, (function() {
12847
12878
  var n, i;
12848
12879
  return r(this, (function(r) {
@@ -12864,7 +12895,7 @@ function eu(t, e) {
12864
12895
  z(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1),
12865
12896
  t.addedDocuments.size > 0 ? r.$o = !0 : t.modifiedDocuments.size > 0 ? z(r.$o) : t.removedDocuments.size > 0 && (z(r.$o),
12866
12897
  r.$o = !1));
12867
- })), [ 4 /*yield*/ , gu(n, i, e) ];
12898
+ })), [ 4 /*yield*/ , wu(n, i, e) ];
12868
12899
 
12869
12900
  case 3:
12870
12901
  // Update `receivedDocument` as appropriate for any limbo targets.
@@ -12886,7 +12917,7 @@ function eu(t, e) {
12886
12917
  /**
12887
12918
  * Applies an OnlineState change to the sync engine and notifies any views of
12888
12919
  * the change.
12889
- */ function su(t, e, n) {
12920
+ */ function uu(t, e, n) {
12890
12921
  var r = W(t);
12891
12922
  // If we are the secondary client, we explicitly ignore the remote store's
12892
12923
  // online state (the local client may go offline, even though the primary
@@ -12906,7 +12937,7 @@ function eu(t, e) {
12906
12937
  // Run global snapshot listeners if a consistent snapshot has been emitted.
12907
12938
  o[i].ro(e) && (r = !0);
12908
12939
  }
12909
- })), r && Ks(n);
12940
+ })), r && Gs(n);
12910
12941
  }(r.eventManager, e), i.length && r.Oo.br(i), r.onlineState = e, r.isPrimaryClient && r.sharedClientState.setOnlineState(e);
12911
12942
  }
12912
12943
  }
@@ -12921,7 +12952,7 @@ function eu(t, e) {
12921
12952
  * @param err - A description of the condition that has forced the rejection.
12922
12953
  * Nearly always this will be an indication that the user is no longer
12923
12954
  * authorized to see the data matching the target.
12924
- */ function uu(t, e, i) {
12955
+ */ function au(t, e, i) {
12925
12956
  return n(this, void 0, void 0, (function() {
12926
12957
  var n, o, s, u, a, c;
12927
12958
  return r(this, (function(r) {
@@ -12932,7 +12963,7 @@ function eu(t, e) {
12932
12963
  (s = o && o.key) ? (u = (u = new wn(Pt.comparator)).insert(s, Xt.newNoDocument(s, dt.min())),
12933
12964
  a = xn().add(s), c = new Pn(dt.min(),
12934
12965
  /* targetChanges= */ new Map,
12935
- /* targetMismatches= */ new Tn(ct), u, a), [ 4 /*yield*/ , ou(n, c) ]) : [ 3 /*break*/ , 2 ];
12966
+ /* targetMismatches= */ new Tn(ct), u, a), [ 4 /*yield*/ , su(n, c) ]) : [ 3 /*break*/ , 2 ];
12936
12967
 
12937
12968
  case 1:
12938
12969
  return r.sent(),
@@ -12941,12 +12972,12 @@ function eu(t, e) {
12941
12972
  // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to
12942
12973
  // this query when the RemoteStore restarts the Watch stream, which should
12943
12974
  // re-trigger the target failure.
12944
- n.Bo = n.Bo.remove(s), n.Uo.delete(e), mu(n), [ 3 /*break*/ , 4 ];
12975
+ n.Bo = n.Bo.remove(s), n.Uo.delete(e), gu(n), [ 3 /*break*/ , 4 ];
12945
12976
 
12946
12977
  case 2:
12947
12978
  return [ 4 /*yield*/ , wo(n.localStore, e,
12948
12979
  /* keepPersistedTargetData */ !1).then((function() {
12949
- return du(n, e, i);
12980
+ return pu(n, e, i);
12950
12981
  })).catch(Vi) ];
12951
12982
 
12952
12983
  case 3:
@@ -12959,7 +12990,7 @@ function eu(t, e) {
12959
12990
  }));
12960
12991
  }
12961
12992
 
12962
- function au(t, e) {
12993
+ function cu(t, e) {
12963
12994
  return n(this, void 0, void 0, (function() {
12964
12995
  var n, i, o;
12965
12996
  return r(this, (function(r) {
@@ -12976,8 +13007,8 @@ function au(t, e) {
12976
13007
  // raise events immediately (depending on whether the watcher is caught
12977
13008
  // up), so we raise user callbacks first so that they consistently happen
12978
13009
  // before listen events.
12979
- lu(n, i, /*error=*/ null), fu(n, i), n.sharedClientState.updateMutationState(i, "acknowledged"),
12980
- [ 4 /*yield*/ , gu(n, o) ];
13010
+ du(n, i, /*error=*/ null), lu(n, i), n.sharedClientState.updateMutationState(i, "acknowledged"),
13011
+ [ 4 /*yield*/ , wu(n, o) ];
12981
13012
 
12982
13013
  case 3:
12983
13014
  // The local store may or may not be able to apply the write result and
@@ -12999,7 +13030,7 @@ function au(t, e) {
12999
13030
  }));
13000
13031
  }
13001
13032
 
13002
- function cu(t, e, i) {
13033
+ function hu(t, e, i) {
13003
13034
  return n(this, void 0, void 0, (function() {
13004
13035
  var n, o;
13005
13036
  return r(this, (function(r) {
@@ -13028,8 +13059,8 @@ function cu(t, e, i) {
13028
13059
  // raise events immediately (depending on whether the watcher is caught up),
13029
13060
  // so we raise user callbacks first so that they consistently happen before
13030
13061
  // listen events.
13031
- lu(n, e, i), fu(n, e), n.sharedClientState.updateMutationState(e, "rejected", i),
13032
- [ 4 /*yield*/ , gu(n, o) ];
13062
+ du(n, e, i), lu(n, e), n.sharedClientState.updateMutationState(e, "rejected", i),
13063
+ [ 4 /*yield*/ , wu(n, o) ];
13033
13064
 
13034
13065
  case 3:
13035
13066
  // The local store may or may not be able to apply the write result and
@@ -13054,7 +13085,7 @@ function cu(t, e, i) {
13054
13085
  /**
13055
13086
  * Registers a user callback that resolves when all pending mutations at the moment of calling
13056
13087
  * are acknowledged .
13057
- */ function hu(t, e) {
13088
+ */ function fu(t, e) {
13058
13089
  return n(this, void 0, void 0, (function() {
13059
13090
  var n, i, o, s, u;
13060
13091
  return r(this, (function(r) {
@@ -13076,7 +13107,7 @@ function cu(t, e, i) {
13076
13107
  n.jo.set(i, o), [ 3 /*break*/ , 4 ]);
13077
13108
 
13078
13109
  case 3:
13079
- return s = r.sent(), u = Ls(s, "Initialization of waitForPendingWrites() operation failed"),
13110
+ return s = r.sent(), u = Ps(s, "Initialization of waitForPendingWrites() operation failed"),
13080
13111
  e.reject(u), [ 3 /*break*/ , 4 ];
13081
13112
 
13082
13113
  case 4:
@@ -13089,14 +13120,14 @@ function cu(t, e, i) {
13089
13120
  /**
13090
13121
  * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,
13091
13122
  * if there are any.
13092
- */ function fu(t, e) {
13123
+ */ function lu(t, e) {
13093
13124
  (t.jo.get(e) || []).forEach((function(t) {
13094
13125
  t.resolve();
13095
13126
  })), t.jo.delete(e)
13096
13127
  /** Reject all outstanding callbacks waiting for pending writes to complete. */;
13097
13128
  }
13098
13129
 
13099
- function lu(t, e, n) {
13130
+ function du(t, e, n) {
13100
13131
  var r = W(t), i = r.Ko[r.currentUser.toKey()];
13101
13132
  // NOTE: Mutations restored from persistence won't have callbacks, so it's
13102
13133
  // okay for there to be no callback for this ID.
@@ -13106,7 +13137,7 @@ function lu(t, e, n) {
13106
13137
  }
13107
13138
  }
13108
13139
 
13109
- function du(t, e, n) {
13140
+ function pu(t, e, n) {
13110
13141
  void 0 === n && (n = null), t.sharedClientState.removeLocalQueryTarget(e);
13111
13142
  for (var r = 0, i = t.Fo.get(e); r < i.length; r++) {
13112
13143
  var o = i[r];
@@ -13115,32 +13146,32 @@ function du(t, e, n) {
13115
13146
  t.Fo.delete(e), t.isPrimaryClient && t.qo.us(e).forEach((function(e) {
13116
13147
  t.qo.containsKey(e) ||
13117
13148
  // We removed the last reference for this key
13118
- pu(t, e);
13149
+ yu(t, e);
13119
13150
  }));
13120
13151
  }
13121
13152
 
13122
- function pu(t, e) {
13153
+ function yu(t, e) {
13123
13154
  t.Lo.delete(e.path.canonicalString());
13124
13155
  // It's possible that the target already got removed because the query failed. In that case,
13125
13156
  // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.
13126
13157
  var n = t.Bo.get(e);
13127
- null !== n && (hs(t.remoteStore, n), t.Bo = t.Bo.remove(e), t.Uo.delete(n), mu(t));
13158
+ null !== n && (hs(t.remoteStore, n), t.Bo = t.Bo.remove(e), t.Uo.delete(n), gu(t));
13128
13159
  }
13129
13160
 
13130
- function yu(t, e, n) {
13161
+ function vu(t, e, n) {
13131
13162
  for (var r = 0, i = n; r < i.length; r++) {
13132
13163
  var o = i[r];
13133
- o instanceof Ys ? (t.qo.addReference(o.key, e), vu(t, o)) : o instanceof Js ? (U("SyncEngine", "Document no longer in limbo: " + o.key),
13164
+ o instanceof Js ? (t.qo.addReference(o.key, e), mu(t, o)) : o instanceof Xs ? (U("SyncEngine", "Document no longer in limbo: " + o.key),
13134
13165
  t.qo.removeReference(o.key, e), t.qo.containsKey(o.key) ||
13135
13166
  // We removed the last reference for this key
13136
- pu(t, o.key)) : G();
13167
+ yu(t, o.key)) : G();
13137
13168
  }
13138
13169
  }
13139
13170
 
13140
- function vu(t, e) {
13171
+ function mu(t, e) {
13141
13172
  var n = e.key, r = n.path.canonicalString();
13142
13173
  t.Bo.get(n) || t.Lo.has(r) || (U("SyncEngine", "New document in limbo: " + n), t.Lo.add(r),
13143
- mu(t));
13174
+ gu(t));
13144
13175
  }
13145
13176
 
13146
13177
  /**
@@ -13150,16 +13181,16 @@ function vu(t, e) {
13150
13181
  * Without bounding the number of concurrent resolutions, the server can fail
13151
13182
  * with "resource exhausted" errors which can lead to pathological client
13152
13183
  * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.
13153
- */ function mu(t) {
13184
+ */ function gu(t) {
13154
13185
  for (;t.Lo.size > 0 && t.Bo.size < t.maxConcurrentLimboResolutions; ) {
13155
13186
  var e = t.Lo.values().next().value;
13156
13187
  t.Lo.delete(e);
13157
13188
  var n = new Pt(gt.fromString(e)), r = t.Qo.next();
13158
- t.Uo.set(r, new Zs(n)), t.Bo = t.Bo.insert(n, r), cs(t.remoteStore, new oi(ke(be(n.path)), r, 2 /* LimboResolution */ , st.I));
13189
+ t.Uo.set(r, new tu(n)), t.Bo = t.Bo.insert(n, r), cs(t.remoteStore, new oi(ke(be(n.path)), r, 2 /* LimboResolution */ , st.I));
13159
13190
  }
13160
13191
  }
13161
13192
 
13162
- function gu(t, e, i) {
13193
+ function wu(t, e, i) {
13163
13194
  return n(this, void 0, void 0, (function() {
13164
13195
  var o, s, u, a;
13165
13196
  return r(this, (function(c) {
@@ -13231,7 +13262,7 @@ function gu(t, e, i) {
13231
13262
  }));
13232
13263
  }
13233
13264
 
13234
- function wu(t, e) {
13265
+ function bu(t, e) {
13235
13266
  return n(this, void 0, void 0, (function() {
13236
13267
  var n, i;
13237
13268
  return r(this, (function(r) {
@@ -13251,7 +13282,7 @@ function wu(t, e) {
13251
13282
  })), t.jo.clear();
13252
13283
  }(n),
13253
13284
  // TODO(b/114226417): Consider calling this only in the primary tab.
13254
- n.sharedClientState.handleUserChange(e, i.removedBatchIds, i.addedBatchIds), [ 4 /*yield*/ , gu(n, i.Gn) ];
13285
+ n.sharedClientState.handleUserChange(e, i.removedBatchIds, i.addedBatchIds), [ 4 /*yield*/ , wu(n, i.Gn) ];
13255
13286
 
13256
13287
  case 2:
13257
13288
  r.sent(), r.label = 3;
@@ -13263,7 +13294,7 @@ function wu(t, e) {
13263
13294
  }));
13264
13295
  }
13265
13296
 
13266
- function bu(t, e) {
13297
+ function Iu(t, e) {
13267
13298
  var n = W(t), r = n.Uo.get(e);
13268
13299
  if (r && r.$o) return xn().add(r.key);
13269
13300
  var i = xn(), o = n.Fo.get(e);
@@ -13278,7 +13309,7 @@ function bu(t, e) {
13278
13309
  /**
13279
13310
  * Reconcile the list of synced documents in an existing view with those
13280
13311
  * from persistence.
13281
- */ function Iu(t, e) {
13312
+ */ function Tu(t, e) {
13282
13313
  return n(this, void 0, void 0, (function() {
13283
13314
  var n, i, o;
13284
13315
  return r(this, (function(r) {
@@ -13288,7 +13319,7 @@ function bu(t, e) {
13288
13319
  /* usePreviousResults= */ !0) ];
13289
13320
 
13290
13321
  case 1:
13291
- return i = r.sent(), o = e.view.ko(i), [ 2 /*return*/ , (n.isPrimaryClient && yu(n, e.targetId, o.Co),
13322
+ return i = r.sent(), o = e.view.ko(i), [ 2 /*return*/ , (n.isPrimaryClient && vu(n, e.targetId, o.Co),
13292
13323
  o) ];
13293
13324
  }
13294
13325
  }));
@@ -13300,12 +13331,12 @@ function bu(t, e) {
13300
13331
  * snapshots if needed.
13301
13332
  */
13302
13333
  // PORTING NOTE: Multi-Tab only.
13303
- function Tu(t) {
13334
+ function Eu(t) {
13304
13335
  return n(this, void 0, void 0, (function() {
13305
13336
  var e;
13306
13337
  return r(this, (function(n) {
13307
13338
  return [ 2 /*return*/ , To((e = W(t)).localStore).then((function(t) {
13308
- return gu(e, t);
13339
+ return wu(e, t);
13309
13340
  })) ];
13310
13341
  }));
13311
13342
  }));
@@ -13313,7 +13344,7 @@ function Tu(t) {
13313
13344
 
13314
13345
  /** Applies a mutation state to an existing batch. */
13315
13346
  // PORTING NOTE: Multi-Tab only.
13316
- function Eu(t, e, i, o) {
13347
+ function Su(t, e, i, o) {
13317
13348
  return n(this, void 0, void 0, (function() {
13318
13349
  var n, s;
13319
13350
  return r(this, (function(r) {
@@ -13341,12 +13372,12 @@ function Eu(t, e, i, o) {
13341
13372
  "acknowledged" === i || "rejected" === i ? (
13342
13373
  // NOTE: Both these methods are no-ops for batches that originated from
13343
13374
  // other clients.
13344
- lu(n, e, o || null), fu(n, e), function(t, e) {
13375
+ du(n, e, o || null), lu(n, e), function(t, e) {
13345
13376
  W(W(t).An).ee(e);
13346
13377
  }(n.localStore, e)) : G(), r.label = 4;
13347
13378
 
13348
13379
  case 4:
13349
- return [ 4 /*yield*/ , gu(n, s) ];
13380
+ return [ 4 /*yield*/ , wu(n, s) ];
13350
13381
 
13351
13382
  case 5:
13352
13383
  return r.sent(), [ 3 /*break*/ , 7 ];
@@ -13370,17 +13401,17 @@ function Eu(t, e, i, o) {
13370
13401
 
13371
13402
  /** Applies a query target change from a different tab. */
13372
13403
  // PORTING NOTE: Multi-Tab only.
13373
- function Su(t, e) {
13404
+ function _u(t, e) {
13374
13405
  return n(this, void 0, void 0, (function() {
13375
13406
  var n, i, o, s, u, a, c, h;
13376
13407
  return r(this, (function(r) {
13377
13408
  switch (r.label) {
13378
13409
  case 0:
13379
- return Cu(n = W(t)), xu(n), !0 !== e || !0 === n.Wo ? [ 3 /*break*/ , 3 ] : (i = n.sharedClientState.getAllActiveQueryTargets(),
13380
- [ 4 /*yield*/ , _u(n, i.toArray()) ]);
13410
+ return xu(n = W(t)), Ru(n), !0 !== e || !0 === n.Wo ? [ 3 /*break*/ , 3 ] : (i = n.sharedClientState.getAllActiveQueryTargets(),
13411
+ [ 4 /*yield*/ , Au(n, i.toArray()) ]);
13381
13412
 
13382
13413
  case 1:
13383
- return o = r.sent(), n.Wo = !0, [ 4 /*yield*/ , Ns(n.remoteStore, !0) ];
13414
+ return o = r.sent(), n.Wo = !0, [ 4 /*yield*/ , Cs(n.remoteStore, !0) ];
13384
13415
 
13385
13416
  case 2:
13386
13417
  for (r.sent(), s = 0, u = o; s < u.length; s++) a = u[s], cs(n.remoteStore, a);
@@ -13390,13 +13421,13 @@ function Su(t, e) {
13390
13421
  return !1 !== e || !1 === n.Wo ? [ 3 /*break*/ , 7 ] : (c = [], h = Promise.resolve(),
13391
13422
  n.Fo.forEach((function(t, e) {
13392
13423
  n.sharedClientState.isLocalQueryTarget(e) ? c.push(e) : h = h.then((function() {
13393
- return du(n, e), wo(n.localStore, e,
13424
+ return pu(n, e), wo(n.localStore, e,
13394
13425
  /*keepPersistedTargetData=*/ !0);
13395
13426
  })), hs(n.remoteStore, e);
13396
13427
  })), [ 4 /*yield*/ , h ]);
13397
13428
 
13398
13429
  case 4:
13399
- return r.sent(), [ 4 /*yield*/ , _u(n, c) ];
13430
+ return r.sent(), [ 4 /*yield*/ , Au(n, c) ];
13400
13431
 
13401
13432
  case 5:
13402
13433
  return r.sent(),
@@ -13406,7 +13437,7 @@ function Su(t, e) {
13406
13437
  e.Uo.forEach((function(t, n) {
13407
13438
  hs(e.remoteStore, n);
13408
13439
  })), e.qo.hs(), e.Uo = new Map, e.Bo = new wn(Pt.comparator);
13409
- }(n), n.Wo = !1, [ 4 /*yield*/ , Ns(n.remoteStore, !1) ];
13440
+ }(n), n.Wo = !1, [ 4 /*yield*/ , Cs(n.remoteStore, !1) ];
13410
13441
 
13411
13442
  case 6:
13412
13443
  r.sent(), r.label = 7;
@@ -13418,7 +13449,7 @@ function Su(t, e) {
13418
13449
  }));
13419
13450
  }
13420
13451
 
13421
- function _u(t, e, i) {
13452
+ function Au(t, e, i) {
13422
13453
  return n(this, void 0, void 0, (function() {
13423
13454
  var n, i, o, s, u, a, c, h, f, l, d, p, y, v;
13424
13455
  return r(this, (function(r) {
@@ -13437,7 +13468,7 @@ function _u(t, e, i) {
13437
13468
  c = r.sent(), f = 0, l = h, r.label = 3;
13438
13469
 
13439
13470
  case 3:
13440
- return f < l.length ? (d = l[f], p = n.Mo.get(d), [ 4 /*yield*/ , Iu(n, p) ]) : [ 3 /*break*/ , 6 ];
13471
+ return f < l.length ? (d = l[f], p = n.Mo.get(d), [ 4 /*yield*/ , Tu(n, p) ]) : [ 3 /*break*/ , 6 ];
13441
13472
 
13442
13473
  case 4:
13443
13474
  (y = r.sent()).snapshot && o.push(y.snapshot), r.label = 5;
@@ -13455,7 +13486,7 @@ function _u(t, e, i) {
13455
13486
  return v = r.sent(), [ 4 /*yield*/ , go(n.localStore, v) ];
13456
13487
 
13457
13488
  case 9:
13458
- return c = r.sent(), [ 4 /*yield*/ , nu(n, Au(v), a,
13489
+ return c = r.sent(), [ 4 /*yield*/ , ru(n, ku(v), a,
13459
13490
  /*current=*/ !1) ];
13460
13491
 
13461
13492
  case 10:
@@ -13485,20 +13516,20 @@ function _u(t, e, i) {
13485
13516
  * difference will not cause issues.
13486
13517
  */
13487
13518
  // PORTING NOTE: Multi-Tab only.
13488
- function Au(t) {
13519
+ function ku(t) {
13489
13520
  return we(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, "F" /* First */ , t.startAt, t.endAt);
13490
13521
  }
13491
13522
 
13492
13523
  /** Returns the IDs of the clients that are currently active. */
13493
13524
  // PORTING NOTE: Multi-Tab only.
13494
- function ku(t) {
13525
+ function Du(t) {
13495
13526
  var e = W(t);
13496
13527
  return W(W(e.localStore).persistence).Tn();
13497
13528
  }
13498
13529
 
13499
13530
  /** Applies a query target change from a different tab. */
13500
13531
  // PORTING NOTE: Multi-Tab only.
13501
- function Du(t, e, i, o) {
13532
+ function Nu(t, e, i, o) {
13502
13533
  return n(this, void 0, void 0, (function() {
13503
13534
  var n, s, u;
13504
13535
  return r(this, (function(r) {
@@ -13526,7 +13557,7 @@ function Du(t, e, i, o) {
13526
13557
 
13527
13558
  case 3:
13528
13559
  return s = r.sent(), u = Pn.createSynthesizedRemoteEventForCurrentChange(e, "current" === i),
13529
- [ 4 /*yield*/ , gu(n, s, u) ];
13560
+ [ 4 /*yield*/ , wu(n, s, u) ];
13530
13561
 
13531
13562
  case 4:
13532
13563
  return r.sent(), [ 3 /*break*/ , 8 ];
@@ -13536,7 +13567,7 @@ function Du(t, e, i, o) {
13536
13567
  /* keepPersistedTargetData */ !0) ];
13537
13568
 
13538
13569
  case 6:
13539
- return r.sent(), du(n, e, o), [ 3 /*break*/ , 8 ];
13570
+ return r.sent(), pu(n, e, o), [ 3 /*break*/ , 8 ];
13540
13571
 
13541
13572
  case 7:
13542
13573
  G(), r.label = 8;
@@ -13548,13 +13579,13 @@ function Du(t, e, i, o) {
13548
13579
  }));
13549
13580
  }
13550
13581
 
13551
- /** Adds or removes Watch targets for queries from different tabs. */ function Nu(t, e, i) {
13582
+ /** Adds or removes Watch targets for queries from different tabs. */ function Cu(t, e, i) {
13552
13583
  return n(this, void 0, void 0, (function() {
13553
13584
  var n, o, s, u, a, c, h, f, l, d;
13554
13585
  return r(this, (function(p) {
13555
13586
  switch (p.label) {
13556
13587
  case 0:
13557
- if (!(n = Cu(t)).Wo) return [ 3 /*break*/ , 10 ];
13588
+ if (!(n = xu(t)).Wo) return [ 3 /*break*/ , 10 ];
13558
13589
  o = 0, s = e, p.label = 1;
13559
13590
 
13560
13591
  case 1:
@@ -13566,7 +13597,7 @@ function Du(t, e, i, o) {
13566
13597
  return a = p.sent(), [ 4 /*yield*/ , go(n.localStore, a) ];
13567
13598
 
13568
13599
  case 3:
13569
- return c = p.sent(), [ 4 /*yield*/ , nu(n, Au(a), c.targetId,
13600
+ return c = p.sent(), [ 4 /*yield*/ , ru(n, ku(a), c.targetId,
13570
13601
  /*current=*/ !1) ];
13571
13602
 
13572
13603
  case 4:
@@ -13582,7 +13613,7 @@ function Du(t, e, i, o) {
13582
13613
  case 0:
13583
13614
  return n.Fo.has(t) ? [ 4 /*yield*/ , wo(n.localStore, t,
13584
13615
  /* keepPersistedTargetData */ !1).then((function() {
13585
- hs(n.remoteStore, t), du(n, t);
13616
+ hs(n.remoteStore, t), pu(n, t);
13586
13617
  })).catch(Vi) ] : [ 3 /*break*/ , 2 ];
13587
13618
 
13588
13619
  // Release queries that are still active.
@@ -13612,16 +13643,16 @@ function Du(t, e, i, o) {
13612
13643
  }));
13613
13644
  }
13614
13645
 
13615
- function Cu(t) {
13646
+ function xu(t) {
13616
13647
  var e = W(t);
13617
- return e.remoteStore.remoteSyncer.applyRemoteEvent = ou.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = bu.bind(null, e),
13618
- e.remoteStore.remoteSyncer.rejectListen = uu.bind(null, e), e.Oo.br = Bs.bind(null, e.eventManager),
13619
- e.Oo.zo = js.bind(null, e.eventManager), e;
13648
+ return e.remoteStore.remoteSyncer.applyRemoteEvent = su.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = Iu.bind(null, e),
13649
+ e.remoteStore.remoteSyncer.rejectListen = au.bind(null, e), e.Oo.br = js.bind(null, e.eventManager),
13650
+ e.Oo.zo = Ks.bind(null, e.eventManager), e;
13620
13651
  }
13621
13652
 
13622
- function xu(t) {
13653
+ function Ru(t) {
13623
13654
  var e = W(t);
13624
- return e.remoteStore.remoteSyncer.applySuccessfulWrite = au.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = cu.bind(null, e),
13655
+ return e.remoteStore.remoteSyncer.applySuccessfulWrite = cu.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = hu.bind(null, e),
13625
13656
  e
13626
13657
  /**
13627
13658
  * Loads a Firestore bundle into the SDK. The returned promise resolves when
@@ -13633,7 +13664,7 @@ function xu(t) {
13633
13664
  */;
13634
13665
  }
13635
13666
 
13636
- function Ru(t, e, i) {
13667
+ function Lu(t, e, i) {
13637
13668
  var o = W(t);
13638
13669
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
13639
13670
  (function(t, e, i) {
@@ -13669,7 +13700,7 @@ function Ru(t, e, i) {
13669
13700
  }(n))) ];
13670
13701
 
13671
13702
  case 4:
13672
- return i._updateProgress(Hs(n)), o = new Ws(n, t.localStore, e.k), [ 4 /*yield*/ , e.Ho() ];
13703
+ return i._updateProgress(Ys(n)), o = new Hs(n, t.localStore, e.k), [ 4 /*yield*/ , e.Ho() ];
13673
13704
 
13674
13705
  case 5:
13675
13706
  s = r.sent(), r.label = 6;
@@ -13693,7 +13724,7 @@ function Ru(t, e, i) {
13693
13724
  // TODO(b/160876443): This currently raises snapshots with
13694
13725
  // `fromCache=false` if users already listen to some queries and bundles
13695
13726
  // has newer version.
13696
- return a = r.sent(), [ 4 /*yield*/ , gu(t, a.In,
13727
+ return a = r.sent(), [ 4 /*yield*/ , wu(t, a.In,
13697
13728
  /* remoteEvent */ void 0) ];
13698
13729
 
13699
13730
  case 12:
@@ -13749,7 +13780,7 @@ function Ru(t, e, i) {
13749
13780
  }));
13750
13781
  }
13751
13782
 
13752
- var Lu = /** @class */ function() {
13783
+ var Pu = /** @class */ function() {
13753
13784
  function t() {
13754
13785
  this.synchronizeTabs = !1;
13755
13786
  }
@@ -13790,7 +13821,7 @@ var Lu = /** @class */ function() {
13790
13821
  }));
13791
13822
  }));
13792
13823
  }, t;
13793
- }(), Pu = /** @class */ function(e) {
13824
+ }(), Ou = /** @class */ function(e) {
13794
13825
  function i(t, n, r) {
13795
13826
  var i = this;
13796
13827
  return (i = e.call(this) || this).tc = t, i.cacheSizeBytes = n, i.forceOwnership = r,
@@ -13812,7 +13843,7 @@ var Lu = /** @class */ function() {
13812
13843
 
13813
13844
  case 3:
13814
13845
  // Enqueue writes from a previous session
13815
- return r.sent(), [ 4 /*yield*/ , xu(this.tc.syncEngine) ];
13846
+ return r.sent(), [ 4 /*yield*/ , Ru(this.tc.syncEngine) ];
13816
13847
 
13817
13848
  case 4:
13818
13849
  // Enqueue writes from a previous session
@@ -13844,7 +13875,7 @@ var Lu = /** @class */ function() {
13844
13875
  }, i.prototype.Jo = function(t) {
13845
13876
  return new zo;
13846
13877
  }, i;
13847
- }(Lu), Ou = /** @class */ function(e) {
13878
+ }(Pu), Mu = /** @class */ function(e) {
13848
13879
  function i(t, n) {
13849
13880
  var r = this;
13850
13881
  return (r = e.call(this, t, n, /* forceOwnership= */ !1) || this).tc = t, r.cacheSizeBytes = n,
@@ -13860,11 +13891,11 @@ var Lu = /** @class */ function() {
13860
13891
 
13861
13892
  case 1:
13862
13893
  return s.sent(), i = this.tc.syncEngine, this.sharedClientState instanceof Go ? (this.sharedClientState.syncEngine = {
13863
- mi: Eu.bind(null, i),
13864
- gi: Du.bind(null, i),
13865
- yi: Nu.bind(null, i),
13866
- Tn: ku.bind(null, i),
13867
- _i: Tu.bind(null, i)
13894
+ mi: Su.bind(null, i),
13895
+ gi: Nu.bind(null, i),
13896
+ yi: Cu.bind(null, i),
13897
+ Tn: Du.bind(null, i),
13898
+ _i: Eu.bind(null, i)
13868
13899
  }, [ 4 /*yield*/ , this.sharedClientState.start() ]) : [ 3 /*break*/ , 3 ];
13869
13900
 
13870
13901
  case 2:
@@ -13878,7 +13909,7 @@ var Lu = /** @class */ function() {
13878
13909
  return r(this, (function(e) {
13879
13910
  switch (e.label) {
13880
13911
  case 0:
13881
- return [ 4 /*yield*/ , Su(this.tc.syncEngine, t) ];
13912
+ return [ 4 /*yield*/ , _u(this.tc.syncEngine, t) ];
13882
13913
 
13883
13914
  case 1:
13884
13915
  return e.sent(), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : t || this.gcScheduler.stop()),
@@ -13901,7 +13932,7 @@ var Lu = /** @class */ function() {
13901
13932
  var n = io(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);
13902
13933
  return new Go(e, t.asyncQueue, n, t.clientId, t.initialUser);
13903
13934
  }, i;
13904
- }(Pu), Mu = /** @class */ function() {
13935
+ }(Ou), Fu = /** @class */ function() {
13905
13936
  function t() {}
13906
13937
  return t.prototype.initialize = function(t, e) {
13907
13938
  return n(this, void 0, void 0, (function() {
@@ -13914,9 +13945,9 @@ var Lu = /** @class */ function() {
13914
13945
  this.remoteStore = this.createRemoteStore(e), this.eventManager = this.createEventManager(e),
13915
13946
  this.syncEngine = this.createSyncEngine(e,
13916
13947
  /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = function(t) {
13917
- return su(n.syncEngine, t, 1 /* SharedClientState */);
13918
- }, this.remoteStore.remoteSyncer.handleCredentialChange = wu.bind(null, this.syncEngine),
13919
- [ 4 /*yield*/ , Ns(this.remoteStore, this.syncEngine.isPrimaryClient) ]);
13948
+ return uu(n.syncEngine, t, 1 /* SharedClientState */);
13949
+ }, this.remoteStore.remoteSyncer.handleCredentialChange = bu.bind(null, this.syncEngine),
13950
+ [ 4 /*yield*/ , Cs(this.remoteStore, this.syncEngine.isPrimaryClient) ]);
13920
13951
 
13921
13952
  case 1:
13922
13953
  r.sent(), r.label = 2;
@@ -13927,7 +13958,7 @@ var Lu = /** @class */ function() {
13927
13958
  }));
13928
13959
  }));
13929
13960
  }, t.prototype.createEventManager = function(t) {
13930
- return new Vs;
13961
+ return new qs;
13931
13962
  }, t.prototype.createDatastore = function(t) {
13932
13963
  var e, n = Zo(t.databaseInfo.databaseId), r = (e = t.databaseInfo, new Jo(e));
13933
13964
  /** Return the Platform-specific connectivity monitor. */ return function(t, e, n, r) {
@@ -13936,13 +13967,13 @@ var Lu = /** @class */ function() {
13936
13967
  }, t.prototype.createRemoteStore = function(t) {
13937
13968
  var e, n, r, i, o, s = this;
13938
13969
  return e = this.localStore, n = this.datastore, r = t.asyncQueue, i = function(t) {
13939
- return su(s.syncEngine, t, 0 /* RemoteStore */);
13970
+ return uu(s.syncEngine, t, 0 /* RemoteStore */);
13940
13971
  }, o = Wo.Pt() ? new Wo : new Qo, new ss(e, n, r, i, o);
13941
13972
  }, t.prototype.createSyncEngine = function(t, e) {
13942
13973
  return function(t, e, n,
13943
13974
  // PORTING NOTE: Manages state synchronization in multi-tab environments.
13944
13975
  r, i, o, s) {
13945
- var u = new tu(t, e, n, r, i, o);
13976
+ var u = new eu(t, e, n, r, i, o);
13946
13977
  return s && (u.Wo = !0), u;
13947
13978
  }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e);
13948
13979
  }, t.prototype.terminate = function() {
@@ -13997,7 +14028,7 @@ var Lu = /** @class */ function() {
13997
14028
  * @param bytesPerRead - How many bytes each `read()` from the returned reader
13998
14029
  * will read.
13999
14030
  */
14000
- function Fu(t, e) {
14031
+ function Vu(t, e) {
14001
14032
  void 0 === e && (e = 10240);
14002
14033
  var i = 0;
14003
14034
  // The TypeScript definition for ReadableStreamReader changed. We use
@@ -14070,7 +14101,7 @@ function Fu(t, e) {
14070
14101
  * A wrapper implementation of Observer<T> that will dispatch events
14071
14102
  * asynchronously. To allow immediate silencing, a mute call is added which
14072
14103
  * causes events scheduled to no longer be raised.
14073
- */ var Vu = /** @class */ function() {
14104
+ */ var qu = /** @class */ function() {
14074
14105
  function t(t) {
14075
14106
  this.observer = t,
14076
14107
  /**
@@ -14091,7 +14122,7 @@ function Fu(t, e) {
14091
14122
  n.muted || t(e);
14092
14123
  }), 0);
14093
14124
  }, t;
14094
- }(), qu = /** @class */ function() {
14125
+ }(), Uu = /** @class */ function() {
14095
14126
  function t(
14096
14127
  /** The reader to read from underlying binary bundle data source. */
14097
14128
  t, e) {
@@ -14157,7 +14188,7 @@ function Fu(t, e) {
14157
14188
  [ 4 /*yield*/ , this.ac(n) ]);
14158
14189
 
14159
14190
  case 2:
14160
- return i = r.sent(), [ 2 /*return*/ , new zs(JSON.parse(i), t.length + n) ];
14191
+ return i = r.sent(), [ 2 /*return*/ , new Qs(JSON.parse(i), t.length + n) ];
14161
14192
  }
14162
14193
  }));
14163
14194
  }));
@@ -14251,7 +14282,7 @@ function Fu(t, e) {
14251
14282
  }));
14252
14283
  }));
14253
14284
  }, t;
14254
- }(), Uu = /** @class */ function() {
14285
+ }(), Bu = /** @class */ function() {
14255
14286
  function t(t) {
14256
14287
  this.datastore = t,
14257
14288
  // The version of each document that was read during this transaction.
@@ -14425,7 +14456,7 @@ function Fu(t, e) {
14425
14456
  }, t.prototype.write = function(t) {
14426
14457
  this.ensureCommitNotCalled(), this.mutations.push(t);
14427
14458
  }, t.prototype.ensureCommitNotCalled = function() {}, t;
14428
- }(), Bu = /** @class */ function() {
14459
+ }(), ju = /** @class */ function() {
14429
14460
  function t(t, e, n, r) {
14430
14461
  this.asyncQueue = t, this.datastore = e, this.updateFunction = n, this.deferred = r,
14431
14462
  this.lc = 5, this.ur = new ts(this.asyncQueue, "transaction_retry" /* TransactionRetry */)
@@ -14439,7 +14470,7 @@ function Fu(t, e) {
14439
14470
  return n(t, void 0, void 0, (function() {
14440
14471
  var t, e, n = this;
14441
14472
  return r(this, (function(r) {
14442
- return t = new Uu(this.datastore), (e = this.dc(t)) && e.then((function(e) {
14473
+ return t = new Bu(this.datastore), (e = this.dc(t)) && e.then((function(e) {
14443
14474
  n.asyncQueue.enqueueAndForget((function() {
14444
14475
  return t.commit().then((function() {
14445
14476
  n.deferred.resolve(e);
@@ -14476,7 +14507,7 @@ function Fu(t, e) {
14476
14507
  }
14477
14508
  return !1;
14478
14509
  }, t;
14479
- }(), ju = /** @class */ function() {
14510
+ }(), Ku = /** @class */ function() {
14480
14511
  function t(t, e,
14481
14512
  /**
14482
14513
  * Asynchronous queue responsible for all of our internal processing. When
@@ -14491,6 +14522,8 @@ function Fu(t, e) {
14491
14522
  this.authCredentials = t, this.appCheckCredentials = e, this.asyncQueue = i, this.databaseInfo = o,
14492
14523
  this.user = O.UNAUTHENTICATED, this.clientId = at.A(), this.authCredentialListener = function() {
14493
14524
  return Promise.resolve();
14525
+ }, this.appCheckCredentialListener = function() {
14526
+ return Promise.resolve();
14494
14527
  }, this.authCredentials.start(i, (function(t) {
14495
14528
  return n(s, void 0, void 0, (function() {
14496
14529
  return r(this, (function(e) {
@@ -14503,10 +14536,8 @@ function Fu(t, e) {
14503
14536
  }
14504
14537
  }));
14505
14538
  }));
14506
- })),
14507
- // Register an empty credentials change listener to activate token refresh.
14508
- this.appCheckCredentials.start(i, (function() {
14509
- return Promise.resolve();
14539
+ })), this.appCheckCredentials.start(i, (function(t) {
14540
+ return U("FirestoreClient", "Received new app check token=", t), s.appCheckCredentialListener(t, s.user);
14510
14541
  }));
14511
14542
  }
14512
14543
  return t.prototype.getConfiguration = function() {
@@ -14525,6 +14556,8 @@ function Fu(t, e) {
14525
14556
  }));
14526
14557
  }, t.prototype.setCredentialChangeListener = function(t) {
14527
14558
  this.authCredentialListener = t;
14559
+ }, t.prototype.setAppCheckTokenChangeListener = function(t) {
14560
+ this.appCheckCredentialListener = t;
14528
14561
  },
14529
14562
  /**
14530
14563
  * Checks that the client has not been terminated. Ensures that other methods on
@@ -14561,7 +14594,7 @@ function Fu(t, e) {
14561
14594
  [ 3 /*break*/ , 6 ];
14562
14595
 
14563
14596
  case 5:
14564
- return t = r.sent(), n = Ls(t, "Failed to shutdown persistence"), e.reject(n), [ 3 /*break*/ , 6 ];
14597
+ return t = r.sent(), n = Ps(t, "Failed to shutdown persistence"), e.reject(n), [ 3 /*break*/ , 6 ];
14565
14598
 
14566
14599
  case 6:
14567
14600
  return [ 2 /*return*/ ];
@@ -14593,7 +14626,7 @@ function Fu(t, e) {
14593
14626
  *
14594
14627
  * Takes a bundle stream or buffer, and presents abstractions to read bundled
14595
14628
  * elements out of the underlying content.
14596
- */ function Ku(t, e) {
14629
+ */ function Gu(t, e) {
14597
14630
  return n(this, void 0, void 0, (function() {
14598
14631
  var i, o, s = this;
14599
14632
  return r(this, (function(u) {
@@ -14632,69 +14665,42 @@ function Fu(t, e) {
14632
14665
  }));
14633
14666
  }
14634
14667
 
14635
- function Gu(t, e) {
14668
+ function zu(t, e) {
14636
14669
  return n(this, void 0, void 0, (function() {
14637
- var i, o;
14638
- return r(this, (function(s) {
14639
- switch (s.label) {
14670
+ var n, i;
14671
+ return r(this, (function(r) {
14672
+ switch (r.label) {
14640
14673
  case 0:
14641
- return t.asyncQueue.verifyOperationInProgress(), [ 4 /*yield*/ , zu(t) ];
14674
+ return t.asyncQueue.verifyOperationInProgress(), [ 4 /*yield*/ , Qu(t) ];
14642
14675
 
14643
14676
  case 1:
14644
- return i = s.sent(), U("FirestoreClient", "Initializing OnlineComponentProvider"),
14677
+ return n = r.sent(), U("FirestoreClient", "Initializing OnlineComponentProvider"),
14645
14678
  [ 4 /*yield*/ , t.getConfiguration() ];
14646
14679
 
14647
14680
  case 2:
14648
- return o = s.sent(), [ 4 /*yield*/ , e.initialize(i, o) ];
14681
+ return i = r.sent(), [ 4 /*yield*/ , e.initialize(n, i) ];
14649
14682
 
14650
14683
  case 3:
14651
- return s.sent(),
14684
+ return r.sent(),
14652
14685
  // The CredentialChangeListener of the online component provider takes
14653
14686
  // precedence over the offline component provider.
14654
14687
  t.setCredentialChangeListener((function(t) {
14655
- return function(t, e) {
14656
- return n(this, void 0, void 0, (function() {
14657
- var n, i;
14658
- return r(this, (function(r) {
14659
- switch (r.label) {
14660
- case 0:
14661
- return (n = W(t)).asyncQueue.verifyOperationInProgress(), U("RemoteStore", "RemoteStore received new credentials"),
14662
- i = ys(n),
14663
- // Tear down and re-create our network streams. This will ensure we get a
14664
- // fresh auth token for the new user and re-fill the write pipeline with
14665
- // new mutations from the LocalStore (since mutations are per-user).
14666
- n.Gr.add(3 /* CredentialChange */), [ 4 /*yield*/ , as(n) ];
14667
-
14668
- case 1:
14669
- return r.sent(), i &&
14670
- // Don't set the network status to Unknown if we are offline.
14671
- n.Jr.set("Unknown" /* Unknown */), [ 4 /*yield*/ , n.remoteSyncer.handleCredentialChange(e) ];
14672
-
14673
- case 2:
14674
- return r.sent(), n.Gr.delete(3 /* CredentialChange */), [ 4 /*yield*/ , us(n) ];
14675
-
14676
- case 3:
14677
- // Tear down and re-create our network streams. This will ensure we get a
14678
- // fresh auth token for the new user and re-fill the write pipeline with
14679
- // new mutations from the LocalStore (since mutations are per-user).
14680
- return r.sent(), [ 2 /*return*/ ];
14681
- }
14682
- }));
14683
- }));
14684
- }(e.remoteStore, t);
14688
+ return Ns(e.remoteStore, t);
14689
+ })), t.setAppCheckTokenChangeListener((function(t, n) {
14690
+ return Ns(e.remoteStore, n);
14685
14691
  })), t.onlineComponents = e, [ 2 /*return*/ ];
14686
14692
  }
14687
14693
  }));
14688
14694
  }));
14689
14695
  }
14690
14696
 
14691
- function zu(t) {
14697
+ function Qu(t) {
14692
14698
  return n(this, void 0, void 0, (function() {
14693
14699
  return r(this, (function(e) {
14694
14700
  switch (e.label) {
14695
14701
  case 0:
14696
14702
  return t.offlineComponents ? [ 3 /*break*/ , 2 ] : (U("FirestoreClient", "Using default OfflineComponentProvider"),
14697
- [ 4 /*yield*/ , Ku(t, new Lu) ]);
14703
+ [ 4 /*yield*/ , Gu(t, new Pu) ]);
14698
14704
 
14699
14705
  case 1:
14700
14706
  e.sent(), e.label = 2;
@@ -14706,13 +14712,13 @@ function zu(t) {
14706
14712
  }));
14707
14713
  }
14708
14714
 
14709
- function Qu(t) {
14715
+ function Wu(t) {
14710
14716
  return n(this, void 0, void 0, (function() {
14711
14717
  return r(this, (function(e) {
14712
14718
  switch (e.label) {
14713
14719
  case 0:
14714
14720
  return t.onlineComponents ? [ 3 /*break*/ , 2 ] : (U("FirestoreClient", "Using default OnlineComponentProvider"),
14715
- [ 4 /*yield*/ , Gu(t, new Mu) ]);
14721
+ [ 4 /*yield*/ , zu(t, new Fu) ]);
14716
14722
 
14717
14723
  case 1:
14718
14724
  e.sent(), e.label = 2;
@@ -14724,47 +14730,47 @@ function Qu(t) {
14724
14730
  }));
14725
14731
  }
14726
14732
 
14727
- function Wu(t) {
14728
- return zu(t).then((function(t) {
14733
+ function Hu(t) {
14734
+ return Qu(t).then((function(t) {
14729
14735
  return t.persistence;
14730
14736
  }));
14731
14737
  }
14732
14738
 
14733
- function Hu(t) {
14734
- return zu(t).then((function(t) {
14739
+ function Yu(t) {
14740
+ return Qu(t).then((function(t) {
14735
14741
  return t.localStore;
14736
14742
  }));
14737
14743
  }
14738
14744
 
14739
- function Yu(t) {
14740
- return Qu(t).then((function(t) {
14745
+ function Ju(t) {
14746
+ return Wu(t).then((function(t) {
14741
14747
  return t.remoteStore;
14742
14748
  }));
14743
14749
  }
14744
14750
 
14745
- function Ju(t) {
14746
- return Qu(t).then((function(t) {
14751
+ function Xu(t) {
14752
+ return Wu(t).then((function(t) {
14747
14753
  return t.syncEngine;
14748
14754
  }));
14749
14755
  }
14750
14756
 
14751
- function Xu(t) {
14757
+ function $u(t) {
14752
14758
  return n(this, void 0, void 0, (function() {
14753
14759
  var e, n;
14754
14760
  return r(this, (function(r) {
14755
14761
  switch (r.label) {
14756
14762
  case 0:
14757
- return [ 4 /*yield*/ , Qu(t) ];
14763
+ return [ 4 /*yield*/ , Wu(t) ];
14758
14764
 
14759
14765
  case 1:
14760
- return e = r.sent(), [ 2 /*return*/ , ((n = e.eventManager).onListen = eu.bind(null, e.syncEngine),
14761
- n.onUnlisten = ru.bind(null, e.syncEngine), n) ];
14766
+ return e = r.sent(), [ 2 /*return*/ , ((n = e.eventManager).onListen = nu.bind(null, e.syncEngine),
14767
+ n.onUnlisten = iu.bind(null, e.syncEngine), n) ];
14762
14768
  }
14763
14769
  }));
14764
14770
  }));
14765
14771
  }
14766
14772
 
14767
- /** Enables the network connection and re-enqueues all pending operations. */ function $u(t, e, i) {
14773
+ /** Enables the network connection and re-enqueues all pending operations. */ function Zu(t, e, i) {
14768
14774
  var o = this;
14769
14775
  void 0 === i && (i = {});
14770
14776
  var s = new J;
@@ -14775,12 +14781,12 @@ function Xu(t) {
14775
14781
  switch (r.label) {
14776
14782
  case 0:
14777
14783
  return n = function(t, e, n, r, i) {
14778
- var o = new Vu({
14784
+ var o = new qu({
14779
14785
  next: function(o) {
14780
14786
  // Remove query first before passing event to user to avoid
14781
14787
  // user actions affecting the now stale query.
14782
14788
  e.enqueueAndForget((function() {
14783
- return Us(t, s);
14789
+ return Bs(t, s);
14784
14790
  }));
14785
14791
  var u = o.docs.has(n);
14786
14792
  !u && o.fromCache ?
@@ -14796,12 +14802,12 @@ function Xu(t) {
14796
14802
  error: function(t) {
14797
14803
  return i.reject(t);
14798
14804
  }
14799
- }), s = new Gs(be(n.path), o, {
14805
+ }), s = new zs(be(n.path), o, {
14800
14806
  includeMetadataChanges: !0,
14801
14807
  wo: !0
14802
14808
  });
14803
- return qs(t, s);
14804
- }, [ 4 /*yield*/ , Xu(t) ];
14809
+ return Us(t, s);
14810
+ }, [ 4 /*yield*/ , $u(t) ];
14805
14811
 
14806
14812
  case 1:
14807
14813
  return [ 2 /*return*/ , n.apply(void 0, [ r.sent(), t.asyncQueue, e, i, s ]) ];
@@ -14811,7 +14817,7 @@ function Xu(t) {
14811
14817
  })), s.promise;
14812
14818
  }
14813
14819
 
14814
- function Zu(t, e, i) {
14820
+ function ta(t, e, i) {
14815
14821
  var o = this;
14816
14822
  void 0 === i && (i = {});
14817
14823
  var s = new J;
@@ -14822,23 +14828,23 @@ function Zu(t, e, i) {
14822
14828
  switch (r.label) {
14823
14829
  case 0:
14824
14830
  return n = function(t, e, n, r, i) {
14825
- var o = new Vu({
14831
+ var o = new qu({
14826
14832
  next: function(n) {
14827
14833
  // Remove query first before passing event to user to avoid
14828
14834
  // user actions affecting the now stale query.
14829
14835
  e.enqueueAndForget((function() {
14830
- return Us(t, s);
14836
+ return Bs(t, s);
14831
14837
  })), n.fromCache && "server" === r.source ? i.reject(new Y(H.UNAVAILABLE, 'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')) : i.resolve(n);
14832
14838
  },
14833
14839
  error: function(t) {
14834
14840
  return i.reject(t);
14835
14841
  }
14836
- }), s = new Gs(n, o, {
14842
+ }), s = new zs(n, o, {
14837
14843
  includeMetadataChanges: !0,
14838
14844
  wo: !0
14839
14845
  });
14840
- return qs(t, s);
14841
- }, [ 4 /*yield*/ , Xu(t) ];
14846
+ return Us(t, s);
14847
+ }, [ 4 /*yield*/ , $u(t) ];
14842
14848
 
14843
14849
  case 1:
14844
14850
  return [ 2 /*return*/ , n.apply(void 0, [ r.sent(), t.asyncQueue, e, i, s ]) ];
@@ -14848,7 +14854,7 @@ function Zu(t, e, i) {
14848
14854
  })), s.promise;
14849
14855
  }
14850
14856
 
14851
- var ta =
14857
+ var ea =
14852
14858
  /**
14853
14859
  * Constructs a DatabaseInfo using the provided host, databaseId and
14854
14860
  * persistenceKey.
@@ -14869,7 +14875,7 @@ var ta =
14869
14875
  function(t, e, n, r, i, o, s, u) {
14870
14876
  this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = r, this.ssl = i,
14871
14877
  this.forceLongPolling = o, this.autoDetectLongPolling = s, this.useFetchStreams = u;
14872
- }, ea = /** @class */ function() {
14878
+ }, na = /** @class */ function() {
14873
14879
  function t(t, e) {
14874
14880
  this.projectId = t, this.database = e || "(default)";
14875
14881
  }
@@ -14882,7 +14888,7 @@ function(t, e, n, r, i, o, s, u) {
14882
14888
  }), t.prototype.isEqual = function(e) {
14883
14889
  return e instanceof t && e.projectId === this.projectId && e.database === this.database;
14884
14890
  }, t;
14885
- }(), na = new Map;
14891
+ }(), ra = new Map;
14886
14892
 
14887
14893
  /** The default database name for a project. */
14888
14894
  /**
@@ -14909,28 +14915,28 @@ function(t, e, n, r, i, o, s, u) {
14909
14915
  * See the License for the specific language governing permissions and
14910
14916
  * limitations under the License.
14911
14917
  */
14912
- function ra(t, e, n) {
14918
+ function ia(t, e, n) {
14913
14919
  if (!n) throw new Y(H.INVALID_ARGUMENT, "Function " + t + "() cannot be called with an empty " + e + ".");
14914
14920
  }
14915
14921
 
14916
14922
  /**
14917
14923
  * Validates that two boolean options are not set at the same time.
14918
14924
  * @internal
14919
- */ function ia(t, e, n, r) {
14925
+ */ function oa(t, e, n, r) {
14920
14926
  if (!0 === e && !0 === r) throw new Y(H.INVALID_ARGUMENT, t + " and " + n + " cannot be used together.");
14921
14927
  }
14922
14928
 
14923
14929
  /**
14924
14930
  * Validates that `path` refers to a document (indicated by the fact it contains
14925
14931
  * an even numbers of segments).
14926
- */ function oa(t) {
14932
+ */ function sa(t) {
14927
14933
  if (!Pt.isDocumentKey(t)) throw new Y(H.INVALID_ARGUMENT, "Invalid document reference. Document references must have an even number of segments, but " + t + " has " + t.length + ".");
14928
14934
  }
14929
14935
 
14930
14936
  /**
14931
14937
  * Validates that `path` refers to a collection (indicated by the fact it
14932
14938
  * contains an odd numbers of segments).
14933
- */ function sa(t) {
14939
+ */ function ua(t) {
14934
14940
  if (Pt.isDocumentKey(t)) throw new Y(H.INVALID_ARGUMENT, "Invalid collection reference. Collection references must have an odd number of segments, but " + t + " has " + t.length + ".");
14935
14941
  }
14936
14942
 
@@ -14938,7 +14944,7 @@ function ra(t, e, n) {
14938
14944
  * Returns true if it's a non-null object without a custom prototype
14939
14945
  * (i.e. excludes Array, Date, etc.).
14940
14946
  */
14941
- /** Returns a string describing the type / value of the provided input. */ function ua(t) {
14947
+ /** Returns a string describing the type / value of the provided input. */ function aa(t) {
14942
14948
  if (void 0 === t) return "undefined";
14943
14949
  if (null === t) return "null";
14944
14950
  if ("string" == typeof t) return t.length > 20 && (t = t.substring(0, 20) + "..."),
@@ -14956,7 +14962,7 @@ function ra(t, e, n) {
14956
14962
  return "function" == typeof t ? "a function" : G();
14957
14963
  }
14958
14964
 
14959
- function aa(t,
14965
+ function ca(t,
14960
14966
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14961
14967
  e) {
14962
14968
  if ("_delegate" in t && (
@@ -14964,13 +14970,13 @@ e) {
14964
14970
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14965
14971
  t = t._delegate), !(t instanceof e)) {
14966
14972
  if (e.name === t.constructor.name) throw new Y(H.INVALID_ARGUMENT, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
14967
- var n = ua(t);
14973
+ var n = aa(t);
14968
14974
  throw new Y(H.INVALID_ARGUMENT, "Expected type '" + e.name + "', but it was: " + n);
14969
14975
  }
14970
14976
  return t;
14971
14977
  }
14972
14978
 
14973
- function ca(t, e) {
14979
+ function ha(t, e) {
14974
14980
  if (e <= 0) throw new Y(H.INVALID_ARGUMENT, "Function " + t + "() requires a positive number, but it was: " + e + ".");
14975
14981
  }
14976
14982
 
@@ -14995,7 +15001,7 @@ function ca(t, e) {
14995
15001
  * A concrete type describing all the values that can be applied via a
14996
15002
  * user-supplied `FirestoreSettings` object. This is a separate type so that
14997
15003
  * defaults can be supplied and the value can be checked for equality.
14998
- */ var ha = /** @class */ function() {
15004
+ */ var fa = /** @class */ function() {
14999
15005
  function t(t) {
15000
15006
  var e;
15001
15007
  if (void 0 === t.host) {
@@ -15008,23 +15014,23 @@ function ca(t, e) {
15008
15014
  this.cacheSizeBytes = t.cacheSizeBytes;
15009
15015
  }
15010
15016
  this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling,
15011
- this.useFetchStreams = !!t.useFetchStreams, ia("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling);
15017
+ this.useFetchStreams = !!t.useFetchStreams, oa("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling);
15012
15018
  }
15013
15019
  return t.prototype.isEqual = function(t) {
15014
15020
  return this.host === t.host && this.ssl === t.ssl && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.experimentalForceLongPolling === t.experimentalForceLongPolling && this.experimentalAutoDetectLongPolling === t.experimentalAutoDetectLongPolling && this.ignoreUndefinedProperties === t.ignoreUndefinedProperties && this.useFetchStreams === t.useFetchStreams;
15015
15021
  }, t;
15016
- }(), fa = /** @class */ function() {
15022
+ }(), la = /** @class */ function() {
15017
15023
  /** @hideconstructor */
15018
15024
  function t(t, e, n) {
15019
15025
  this._authCredentials = e, this._appCheckCredentials = n,
15020
15026
  /**
15021
15027
  * Whether it's a Firestore or Firestore Lite instance.
15022
15028
  */
15023
- this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new ha({}),
15024
- this._settingsFrozen = !1, t instanceof ea ? this._databaseId = t : (this._app = t,
15029
+ this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new fa({}),
15030
+ this._settingsFrozen = !1, t instanceof na ? this._databaseId = t : (this._app = t,
15025
15031
  this._databaseId = function(t) {
15026
15032
  if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new Y(H.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
15027
- return new ea(t.options.projectId);
15033
+ return new na(t.options.projectId);
15028
15034
  }(t));
15029
15035
  }
15030
15036
  return Object.defineProperty(t.prototype, "app", {
@@ -15052,7 +15058,7 @@ function ca(t, e) {
15052
15058
  configurable: !0
15053
15059
  }), t.prototype._setSettings = function(t) {
15054
15060
  if (this._settingsFrozen) throw new Y(H.FAILED_PRECONDITION, "Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");
15055
- this._settings = new ha(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
15061
+ this._settings = new fa(t), void 0 !== t.credentials && (this._authCredentials = function(t) {
15056
15062
  if (!t) return new $;
15057
15063
  switch (t.type) {
15058
15064
  case "gapi":
@@ -15094,8 +15100,8 @@ function ca(t, e) {
15094
15100
  * Removes all components associated with the provided instance. Must be called
15095
15101
  * when the `Firestore` instance is terminated.
15096
15102
  */
15097
- return t = this, (e = na.get(t)) && (U("ComponentProvider", "Removing Datastore"),
15098
- na.delete(t), e.terminate()), Promise.resolve();
15103
+ return t = this, (e = ra.get(t)) && (U("ComponentProvider", "Removing Datastore"),
15104
+ ra.delete(t), e.terminate()), Promise.resolve();
15099
15105
  var t, e;
15100
15106
  }, t;
15101
15107
  }();
@@ -15120,10 +15126,10 @@ function ca(t, e) {
15120
15126
  * The Cloud Firestore service interface.
15121
15127
  *
15122
15128
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
15123
- */ function la(t, e, n, r) {
15129
+ */ function da(t, e, n, r) {
15124
15130
  var i;
15125
15131
  void 0 === r && (r = {});
15126
- var o = (t = aa(t, fa))._getSettings();
15132
+ var o = (t = ca(t, la))._getSettings();
15127
15133
  if ("firestore.googleapis.com" !== o.host && o.host !== e && j("Host has been set in both settings() and useEmulator(), emulator host will be used"),
15128
15134
  t._setSettings(Object.assign(Object.assign({}, o), {
15129
15135
  host: e + ":" + n,
@@ -15162,7 +15168,7 @@ function ca(t, e) {
15162
15168
  * A `DocumentReference` refers to a document location in a Firestore database
15163
15169
  * and can be used to write, read, or listen to the location. The document at
15164
15170
  * the referenced location may or may not exist.
15165
- */ var da = /** @class */ function() {
15171
+ */ var pa = /** @class */ function() {
15166
15172
  /** @hideconstructor */
15167
15173
  function t(t,
15168
15174
  /**
@@ -15203,14 +15209,14 @@ function ca(t, e) {
15203
15209
  * The collection this `DocumentReference` belongs to.
15204
15210
  */
15205
15211
  get: function() {
15206
- return new ya(this.firestore, this.converter, this._key.path.popLast());
15212
+ return new va(this.firestore, this.converter, this._key.path.popLast());
15207
15213
  },
15208
15214
  enumerable: !1,
15209
15215
  configurable: !0
15210
15216
  }), t.prototype.withConverter = function(e) {
15211
15217
  return new t(this.firestore, e, this._key);
15212
15218
  }, t;
15213
- }(), pa = /** @class */ function() {
15219
+ }(), ya = /** @class */ function() {
15214
15220
  // This is the lite version of the Query class in the main SDK.
15215
15221
  /** @hideconstructor protected */
15216
15222
  function t(t,
@@ -15225,7 +15231,7 @@ function ca(t, e) {
15225
15231
  return t.prototype.withConverter = function(e) {
15226
15232
  return new t(this.firestore, e, this._query);
15227
15233
  }, t;
15228
- }(), ya = /** @class */ function(e) {
15234
+ }(), va = /** @class */ function(e) {
15229
15235
  /** @hideconstructor */
15230
15236
  function n(t, n, r) {
15231
15237
  var i = this;
@@ -15256,7 +15262,7 @@ function ca(t, e) {
15256
15262
  */
15257
15263
  get: function() {
15258
15264
  var t = this._path.popLast();
15259
- return t.isEmpty() ? null : new da(this.firestore,
15265
+ return t.isEmpty() ? null : new pa(this.firestore,
15260
15266
  /* converter= */ null, new Pt(t));
15261
15267
  },
15262
15268
  enumerable: !1,
@@ -15264,20 +15270,20 @@ function ca(t, e) {
15264
15270
  }), n.prototype.withConverter = function(t) {
15265
15271
  return new n(this.firestore, t, this._path);
15266
15272
  }, n;
15267
- }(pa);
15273
+ }(ya);
15268
15274
 
15269
15275
  /**
15270
15276
  * A `Query` refers to a query which you can read or listen to. You can also
15271
15277
  * construct refined `Query` objects by adding filters and ordering.
15272
- */ function va(t, n) {
15278
+ */ function ma(t, n) {
15273
15279
  for (var r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
15274
- if (t = I(t), ra("collection", "path", n), t instanceof fa) {
15280
+ if (t = I(t), ia("collection", "path", n), t instanceof la) {
15275
15281
  var o = gt.fromString.apply(gt, e([ n ], r));
15276
- return sa(o), new ya(t, /* converter= */ null, o);
15282
+ return ua(o), new va(t, /* converter= */ null, o);
15277
15283
  }
15278
- if (!(t instanceof da || t instanceof ya)) throw new Y(H.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
15284
+ if (!(t instanceof pa || t instanceof va)) throw new Y(H.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
15279
15285
  var s = t._path.child(gt.fromString.apply(gt, e([ n ], r)));
15280
- return sa(s), new ya(t.firestore,
15286
+ return ua(s), new va(t.firestore,
15281
15287
  /* converter= */ null, s);
15282
15288
  }
15283
15289
 
@@ -15293,9 +15299,9 @@ function ca(t, e) {
15293
15299
  * collection or subcollection with this ID as the last segment of its path
15294
15300
  * will be included. Cannot contain a slash.
15295
15301
  * @returns The created `Query`.
15296
- */ function ma(t, e) {
15297
- if (t = aa(t, fa), ra("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new Y(H.INVALID_ARGUMENT, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
15298
- return new pa(t,
15302
+ */ function ga(t, e) {
15303
+ if (t = ca(t, la), ia("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new Y(H.INVALID_ARGUMENT, "Invalid collection ID '" + e + "' passed to function collectionGroup(). Collection IDs must not contain '/'.");
15304
+ return new ya(t,
15299
15305
  /* converter= */ null,
15300
15306
  /**
15301
15307
  * Creates a new Query for a collection group query that matches all documents
@@ -15306,19 +15312,19 @@ function ca(t, e) {
15306
15312
  }(e));
15307
15313
  }
15308
15314
 
15309
- function ga(t, n) {
15315
+ function wa(t, n) {
15310
15316
  for (var r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
15311
15317
  if (t = I(t),
15312
15318
  // We allow omission of 'pathString' but explicitly prohibit passing in both
15313
15319
  // 'undefined' and 'null'.
15314
- 1 === arguments.length && (n = at.A()), ra("doc", "path", n), t instanceof fa) {
15320
+ 1 === arguments.length && (n = at.A()), ia("doc", "path", n), t instanceof la) {
15315
15321
  var o = gt.fromString.apply(gt, e([ n ], r));
15316
- return oa(o), new da(t,
15322
+ return sa(o), new pa(t,
15317
15323
  /* converter= */ null, new Pt(o));
15318
15324
  }
15319
- if (!(t instanceof da || t instanceof ya)) throw new Y(H.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
15325
+ if (!(t instanceof pa || t instanceof va)) throw new Y(H.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
15320
15326
  var s = t._path.child(gt.fromString.apply(gt, e([ n ], r)));
15321
- return oa(s), new da(t.firestore, t instanceof ya ? t.converter : null, new Pt(s));
15327
+ return sa(s), new pa(t.firestore, t instanceof va ? t.converter : null, new Pt(s));
15322
15328
  }
15323
15329
 
15324
15330
  /**
@@ -15328,8 +15334,8 @@ function ga(t, n) {
15328
15334
  * @param right - A reference to compare.
15329
15335
  * @returns true if the references point to the same location in the same
15330
15336
  * Firestore database.
15331
- */ function wa(t, e) {
15332
- return t = I(t), e = I(e), (t instanceof da || t instanceof ya) && (e instanceof da || e instanceof ya) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
15337
+ */ function ba(t, e) {
15338
+ return t = I(t), e = I(e), (t instanceof pa || t instanceof va) && (e instanceof pa || e instanceof va) && t.firestore === e.firestore && t.path === e.path && t.converter === e.converter
15333
15339
  /**
15334
15340
  * Returns true if the provided queries point to the same collection and apply
15335
15341
  * the same constraints.
@@ -15341,8 +15347,8 @@ function ga(t, n) {
15341
15347
  */;
15342
15348
  }
15343
15349
 
15344
- function ba(t, e) {
15345
- return t = I(t), e = I(e), t instanceof pa && e instanceof pa && t.firestore === e.firestore && Ne(t._query, e._query) && t.converter === e.converter
15350
+ function Ia(t, e) {
15351
+ return t = I(t), e = I(e), t instanceof ya && e instanceof ya && t.firestore === e.firestore && Ne(t._query, e._query) && t.converter === e.converter
15346
15352
  /**
15347
15353
  * @license
15348
15354
  * Copyright 2020 Google LLC
@@ -15361,7 +15367,7 @@ function ba(t, e) {
15361
15367
  */;
15362
15368
  }
15363
15369
 
15364
- var Ia = /** @class */ function() {
15370
+ var Ta = /** @class */ function() {
15365
15371
  function t() {
15366
15372
  var t = this;
15367
15373
  // The last promise in the queue.
@@ -15515,7 +15521,7 @@ var Ia = /** @class */ function() {
15515
15521
  this.Pc(),
15516
15522
  // Fast-forward delays for timerIds that have been overriden.
15517
15523
  this.Rc.indexOf(t) > -1 && (e = 0);
15518
- var i = Rs.createAndSchedule(this, t, e, n, (function(t) {
15524
+ var i = Ls.createAndSchedule(this, t, e, n, (function(t) {
15519
15525
  return r.Sc(t);
15520
15526
  }));
15521
15527
  return this.Tc.push(i), i;
@@ -15592,7 +15598,7 @@ var Ia = /** @class */ function() {
15592
15598
  }, t;
15593
15599
  }();
15594
15600
 
15595
- function Ta(t) {
15601
+ function Ea(t) {
15596
15602
  /**
15597
15603
  * Returns true if obj is an object and contains at least one of the specified
15598
15604
  * methods.
@@ -15607,7 +15613,7 @@ function Ta(t) {
15607
15613
  }(t);
15608
15614
  }
15609
15615
 
15610
- var Ea = /** @class */ function() {
15616
+ var Sa = /** @class */ function() {
15611
15617
  function t() {
15612
15618
  this._progressObserver = {}, this._taskCompletionResolver = new J, this._lastProgress = {
15613
15619
  taskState: "Running",
@@ -15679,23 +15685,23 @@ var Ea = /** @class */ function() {
15679
15685
  t.prototype._updateProgress = function(t) {
15680
15686
  this._lastProgress = t, this._progressObserver.next && this._progressObserver.next(t);
15681
15687
  }, t;
15682
- }(), Sa = -1, _a = /** @class */ function(e) {
15688
+ }(), _a = -1, Aa = /** @class */ function(e) {
15683
15689
  /** @hideconstructor */
15684
15690
  function n(t, n, r) {
15685
15691
  var i = this;
15686
15692
  /**
15687
15693
  * Whether it's a {@link Firestore} or Firestore Lite instance.
15688
15694
  */
15689
- return (i = e.call(this, t, n, r) || this).type = "firestore", i._queue = new Ia,
15695
+ return (i = e.call(this, t, n, r) || this).type = "firestore", i._queue = new Ta,
15690
15696
  i._persistenceKey = "name" in t ? t.name : "[DEFAULT]", i;
15691
15697
  }
15692
15698
  return t(n, e), n.prototype._terminate = function() {
15693
15699
  return this._firestoreClient ||
15694
15700
  // The client must be initialized to ensure that all subsequent API
15695
15701
  // usage throws an exception.
15696
- Na(this), this._firestoreClient.terminate();
15702
+ Ca(this), this._firestoreClient.terminate();
15697
15703
  }, n;
15698
- }(fa);
15704
+ }(la);
15699
15705
 
15700
15706
  /**
15701
15707
  * @license
@@ -15725,7 +15731,7 @@ var Ea = /** @class */ function() {
15725
15731
  * @param settings - A settings object to configure the {@link Firestore} instance.
15726
15732
  * @returns A newly initialized {@link Firestore} instance.
15727
15733
  */
15728
- function Aa(t, e) {
15734
+ function ka(t, e) {
15729
15735
  var n = _getProvider(t, "firestore");
15730
15736
  if (n.isInitialized()) {
15731
15737
  var r = n.getImmediate(), i = n.getOptions();
@@ -15746,21 +15752,21 @@ function Aa(t, e) {
15746
15752
  * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
15747
15753
  * instance is associated with.
15748
15754
  * @returns The {@link Firestore} instance of the provided app.
15749
- */ function ka(t) {
15755
+ */ function Da(t) {
15750
15756
  return void 0 === t && (t = u()), _getProvider(t, "firestore").getImmediate();
15751
15757
  }
15752
15758
 
15753
15759
  /**
15754
15760
  * @internal
15755
- */ function Da(t) {
15756
- return t._firestoreClient || Na(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;
15761
+ */ function Na(t) {
15762
+ return t._firestoreClient || Ca(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;
15757
15763
  }
15758
15764
 
15759
- function Na(t) {
15765
+ function Ca(t) {
15760
15766
  var e, n = t._freezeSettings(), r = function(t, e, n, r) {
15761
- return new ta(t, e, n, r.host, r.ssl, r.experimentalForceLongPolling, r.experimentalAutoDetectLongPolling, r.useFetchStreams);
15767
+ return new ea(t, e, n, r.host, r.ssl, r.experimentalForceLongPolling, r.experimentalAutoDetectLongPolling, r.useFetchStreams);
15762
15768
  }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || "", t._persistenceKey, n);
15763
- t._firestoreClient = new ju(t._authCredentials, t._appCheckCredentials, t._queue, r);
15769
+ t._firestoreClient = new Ku(t._authCredentials, t._appCheckCredentials, t._queue, r);
15764
15770
  }
15765
15771
 
15766
15772
  /**
@@ -15785,10 +15791,10 @@ function Na(t) {
15785
15791
  * @param persistenceSettings - Optional settings object to configure
15786
15792
  * persistence.
15787
15793
  * @returns A `Promise` that represents successfully enabling persistent storage.
15788
- */ function Ca(t, e) {
15789
- Ua(t = aa(t, _a));
15790
- var n = Da(t), r = t._freezeSettings(), i = new Mu;
15791
- return Ra(n, i, new Pu(i, r.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));
15794
+ */ function xa(t, e) {
15795
+ Ba(t = ca(t, Aa));
15796
+ var n = Na(t), r = t._freezeSettings(), i = new Fu;
15797
+ return La(n, i, new Ou(i, r.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));
15792
15798
  }
15793
15799
 
15794
15800
  /**
@@ -15812,10 +15818,10 @@ function Na(t) {
15812
15818
  * @param firestore - The {@link Firestore} instance to enable persistence for.
15813
15819
  * @returns A `Promise` that represents successfully enabling persistent
15814
15820
  * storage.
15815
- */ function xa(t) {
15816
- Ua(t = aa(t, _a));
15817
- var e = Da(t), n = t._freezeSettings(), r = new Mu;
15818
- return Ra(e, r, new Ou(r, n.cacheSizeBytes));
15821
+ */ function Ra(t) {
15822
+ Ba(t = ca(t, Aa));
15823
+ var e = Na(t), n = t._freezeSettings(), r = new Fu;
15824
+ return La(e, r, new Mu(r, n.cacheSizeBytes));
15819
15825
  }
15820
15826
 
15821
15827
  /**
@@ -15823,7 +15829,7 @@ function Na(t) {
15823
15829
  * If the operation fails with a recoverable error (see
15824
15830
  * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected
15825
15831
  * but the client remains usable.
15826
- */ function Ra(t, e, i) {
15832
+ */ function La(t, e, i) {
15827
15833
  var o = this, s = new J;
15828
15834
  return t.asyncQueue.enqueue((function() {
15829
15835
  return n(o, void 0, void 0, (function() {
@@ -15831,10 +15837,10 @@ function Na(t) {
15831
15837
  return r(this, (function(r) {
15832
15838
  switch (r.label) {
15833
15839
  case 0:
15834
- return r.trys.push([ 0, 3, , 4 ]), [ 4 /*yield*/ , Ku(t, i) ];
15840
+ return r.trys.push([ 0, 3, , 4 ]), [ 4 /*yield*/ , Gu(t, i) ];
15835
15841
 
15836
15842
  case 1:
15837
- return r.sent(), [ 4 /*yield*/ , Gu(t, e) ];
15843
+ return r.sent(), [ 4 /*yield*/ , zu(t, e) ];
15838
15844
 
15839
15845
  case 2:
15840
15846
  return r.sent(), s.resolve(), [ 3 /*break*/ , 4 ];
@@ -15864,7 +15870,7 @@ function Na(t) {
15864
15870
  }));
15865
15871
  }
15866
15872
 
15867
- function La(t) {
15873
+ function Pa(t) {
15868
15874
  var e = this;
15869
15875
  if (t._initialized && !t._terminated) throw new Y(H.FAILED_PRECONDITION, "Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");
15870
15876
  var i = new J;
@@ -15919,7 +15925,7 @@ function La(t) {
15919
15925
  */;
15920
15926
  }
15921
15927
 
15922
- function Pa(t) {
15928
+ function Oa(t) {
15923
15929
  return function(t) {
15924
15930
  var e = this, i = new J;
15925
15931
  return t.asyncQueue.enqueueAndForget((function() {
@@ -15928,7 +15934,7 @@ function Pa(t) {
15928
15934
  return r(this, (function(n) {
15929
15935
  switch (n.label) {
15930
15936
  case 0:
15931
- return e = hu, [ 4 /*yield*/ , Ju(t) ];
15937
+ return e = fu, [ 4 /*yield*/ , Xu(t) ];
15932
15938
 
15933
15939
  case 1:
15934
15940
  return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), i ]) ];
@@ -15936,7 +15942,7 @@ function Pa(t) {
15936
15942
  }));
15937
15943
  }));
15938
15944
  })), i.promise;
15939
- }(Da(t = aa(t, _a)));
15945
+ }(Na(t = ca(t, Aa)));
15940
15946
  }
15941
15947
 
15942
15948
  /**
@@ -15944,7 +15950,7 @@ function Pa(t) {
15944
15950
  * call to {@link disableNetwork}.
15945
15951
  *
15946
15952
  * @returns A `Promise` that is resolved once the network has been enabled.
15947
- */ function Oa(t) {
15953
+ */ function Ma(t) {
15948
15954
  return function(t) {
15949
15955
  var e = this;
15950
15956
  return t.asyncQueue.enqueue((function() {
@@ -15953,10 +15959,10 @@ function Pa(t) {
15953
15959
  return r(this, (function(r) {
15954
15960
  switch (r.label) {
15955
15961
  case 0:
15956
- return [ 4 /*yield*/ , Wu(t) ];
15962
+ return [ 4 /*yield*/ , Hu(t) ];
15957
15963
 
15958
15964
  case 1:
15959
- return e = r.sent(), [ 4 /*yield*/ , Yu(t) ];
15965
+ return e = r.sent(), [ 4 /*yield*/ , Ju(t) ];
15960
15966
 
15961
15967
  case 2:
15962
15968
  return n = r.sent(), [ 2 /*return*/ , (e.setNetworkEnabled(!0), function(t) {
@@ -15968,7 +15974,7 @@ function Pa(t) {
15968
15974
  }));
15969
15975
  }));
15970
15976
  }
15971
- /** Disables the network connection. Pending operations will not complete. */ (Da(t = aa(t, _a)));
15977
+ /** Disables the network connection. Pending operations will not complete. */ (Na(t = ca(t, Aa)));
15972
15978
  }
15973
15979
 
15974
15980
  /**
@@ -15978,7 +15984,7 @@ function Pa(t) {
15978
15984
  * operations will be queued until the network is restored.
15979
15985
  *
15980
15986
  * @returns A `Promise` that is resolved once the network has been disabled.
15981
- */ function Ma(t) {
15987
+ */ function Fa(t) {
15982
15988
  return function(t) {
15983
15989
  var e = this;
15984
15990
  return t.asyncQueue.enqueue((function() {
@@ -15987,10 +15993,10 @@ function Pa(t) {
15987
15993
  return r(this, (function(o) {
15988
15994
  switch (o.label) {
15989
15995
  case 0:
15990
- return [ 4 /*yield*/ , Wu(t) ];
15996
+ return [ 4 /*yield*/ , Hu(t) ];
15991
15997
 
15992
15998
  case 1:
15993
- return e = o.sent(), [ 4 /*yield*/ , Yu(t) ];
15999
+ return e = o.sent(), [ 4 /*yield*/ , Ju(t) ];
15994
16000
 
15995
16001
  case 2:
15996
16002
  return i = o.sent(), [ 2 /*return*/ , (e.setNetworkEnabled(!1), function(t) {
@@ -16018,7 +16024,7 @@ function Pa(t) {
16018
16024
  * Returns a Promise that resolves when all writes that were pending at the time
16019
16025
  * this method was called received server acknowledgement. An acknowledgement
16020
16026
  * can be either acceptance or rejection.
16021
- */ (Da(t = aa(t, _a)));
16027
+ */ (Na(t = ca(t, Aa)));
16022
16028
  }
16023
16029
 
16024
16030
  /**
@@ -16042,7 +16048,7 @@ function Pa(t) {
16042
16048
  *
16043
16049
  * @returns A `Promise` that is resolved when the instance has been successfully
16044
16050
  * terminated.
16045
- */ function Fa(t) {
16051
+ */ function Va(t) {
16046
16052
  return a(t.app, "firestore"), t._delete()
16047
16053
  /**
16048
16054
  * Loads a Firestore bundle into the local cache.
@@ -16057,15 +16063,15 @@ function Pa(t) {
16057
16063
  */;
16058
16064
  }
16059
16065
 
16060
- function Va(t, e) {
16061
- var i = Da(t = aa(t, _a)), o = new Ea;
16066
+ function qa(t, e) {
16067
+ var i = Na(t = ca(t, Aa)), o = new Sa;
16062
16068
  return function(t, e, i, o) {
16063
16069
  var s = this, u = function(t, e) {
16064
16070
  return function(t, e) {
16065
- return new qu(t, e);
16071
+ return new Uu(t, e);
16066
16072
  }(function(t, e) {
16067
- if (t instanceof Uint8Array) return Fu(t, e);
16068
- if (t instanceof ArrayBuffer) return Fu(new Uint8Array(t), e);
16073
+ if (t instanceof Uint8Array) return Vu(t, e);
16074
+ if (t instanceof ArrayBuffer) return Vu(new Uint8Array(t), e);
16069
16075
  if (t instanceof ReadableStream) return t.getReader();
16070
16076
  throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream");
16071
16077
  }("string" == typeof t ? (new TextEncoder).encode(t) : t), e);
@@ -16076,7 +16082,7 @@ function Va(t, e) {
16076
16082
  return r(this, (function(n) {
16077
16083
  switch (n.label) {
16078
16084
  case 0:
16079
- return e = Ru, [ 4 /*yield*/ , Ju(t) ];
16085
+ return e = Lu, [ 4 /*yield*/ , Xu(t) ];
16080
16086
 
16081
16087
  case 1:
16082
16088
  return e.apply(void 0, [ n.sent(), u, o ]), [ 2 /*return*/ ];
@@ -16099,7 +16105,7 @@ function Va(t, e) {
16099
16105
  */;
16100
16106
  }
16101
16107
 
16102
- function qa(t, e) {
16108
+ function Ua(t, e) {
16103
16109
  return function(t, e) {
16104
16110
  var i = this;
16105
16111
  return t.asyncQueue.enqueue((function() {
@@ -16113,7 +16119,7 @@ function qa(t, e) {
16113
16119
  return n.persistence.runTransaction("Get named query", "readonly", (function(t) {
16114
16120
  return n.Ye.getNamedQuery(t, e);
16115
16121
  }));
16116
- }, [ 4 /*yield*/ , Hu(t) ];
16122
+ }, [ 4 /*yield*/ , Yu(t) ];
16117
16123
 
16118
16124
  case 1:
16119
16125
  return [ 2 /*return*/ , n.apply(void 0, [ r.sent(), e ]) ];
@@ -16121,12 +16127,12 @@ function qa(t, e) {
16121
16127
  }));
16122
16128
  }));
16123
16129
  }));
16124
- }(Da(t = aa(t, _a)), e).then((function(e) {
16125
- return e ? new pa(t, null, e.query) : null;
16130
+ }(Na(t = ca(t, Aa)), e).then((function(e) {
16131
+ return e ? new ya(t, null, e.query) : null;
16126
16132
  }));
16127
16133
  }
16128
16134
 
16129
- function Ua(t) {
16135
+ function Ba(t) {
16130
16136
  if (t._initialized || t._terminated) throw new Y(H.FAILED_PRECONDITION, "Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.");
16131
16137
  }
16132
16138
 
@@ -16169,7 +16175,7 @@ function Ua(t) {
16169
16175
  *
16170
16176
  * Create a `FieldPath` by providing field names. If more than one field
16171
16177
  * name is provided, the path will point to a nested field in a document.
16172
- */ var Ba = /** @class */ function() {
16178
+ */ var ja = /** @class */ function() {
16173
16179
  /**
16174
16180
  * Creates a `FieldPath` from the provided field names. If more than one field
16175
16181
  * name is provided, the path will point to a nested field in a document.
@@ -16194,8 +16200,8 @@ function Ua(t) {
16194
16200
  /**
16195
16201
  * Returns a special sentinel `FieldPath` to refer to the ID of a document.
16196
16202
  * It can be used in queries to sort or filter by the document ID.
16197
- */ function ja() {
16198
- return new Ba("__name__");
16203
+ */ function Ka() {
16204
+ return new ja("__name__");
16199
16205
  }
16200
16206
 
16201
16207
  /**
@@ -16216,7 +16222,7 @@ function Ua(t) {
16216
16222
  */
16217
16223
  /**
16218
16224
  * An immutable object representing an array of bytes.
16219
- */ var Ka = /** @class */ function() {
16225
+ */ var Ga = /** @class */ function() {
16220
16226
  /** @hideconstructor */
16221
16227
  function t(t) {
16222
16228
  this._byteString = t;
@@ -16274,14 +16280,14 @@ function Ua(t) {
16274
16280
  t.prototype.isEqual = function(t) {
16275
16281
  return this._byteString.isEqual(t._byteString);
16276
16282
  }, t;
16277
- }(), Ga =
16283
+ }(), za =
16278
16284
  /**
16279
16285
  * @param _methodName - The public API endpoint that returns this class.
16280
16286
  * @hideconstructor
16281
16287
  */
16282
16288
  function(t) {
16283
16289
  this._methodName = t;
16284
- }, za = /** @class */ function() {
16290
+ }, Qa = /** @class */ function() {
16285
16291
  /**
16286
16292
  * Creates a new immutable `GeoPoint` object with the provided latitude and
16287
16293
  * longitude values.
@@ -16334,14 +16340,14 @@ function(t) {
16334
16340
  t.prototype._compareTo = function(t) {
16335
16341
  return ct(this._lat, t._lat) || ct(this._long, t._long);
16336
16342
  }, t;
16337
- }(), Qa = /^__.*__$/, Wa = /** @class */ function() {
16343
+ }(), Wa = /^__.*__$/, Ha = /** @class */ function() {
16338
16344
  function t(t, e, n) {
16339
16345
  this.data = t, this.fieldMask = e, this.fieldTransforms = n;
16340
16346
  }
16341
16347
  return t.prototype.toMutation = function(t, e) {
16342
16348
  return null !== this.fieldMask ? new an(t, this.data, this.fieldMask, e, this.fieldTransforms) : new un(t, this.data, e, this.fieldTransforms);
16343
16349
  }, t;
16344
- }(), Ha = /** @class */ function() {
16350
+ }(), Ya = /** @class */ function() {
16345
16351
  function t(t,
16346
16352
  // The fieldMask does not include document transforms.
16347
16353
  e, n) {
@@ -16371,7 +16377,7 @@ function(t) {
16371
16377
  /**
16372
16378
  * Sentinel values that can be used when writing document fields with `set()`
16373
16379
  * or `update()`.
16374
- */ function Ya(t) {
16380
+ */ function Ja(t) {
16375
16381
  switch (t) {
16376
16382
  case 0 /* Set */ :
16377
16383
  // fall through
@@ -16389,7 +16395,7 @@ function(t) {
16389
16395
  }
16390
16396
  }
16391
16397
 
16392
- /** A "context" object passed around while parsing user data. */ var Ja = /** @class */ function() {
16398
+ /** A "context" object passed around while parsing user data. */ var Xa = /** @class */ function() {
16393
16399
  /**
16394
16400
  * Initializes a ParseContext with the given source and path.
16395
16401
  *
@@ -16449,7 +16455,7 @@ function(t) {
16449
16455
  Fc: !0
16450
16456
  });
16451
16457
  }, t.prototype.qc = function(t) {
16452
- return vc(t, this.settings.methodName, this.settings.Kc || !1, this.path, this.settings.jc);
16458
+ return mc(t, this.settings.methodName, this.settings.Kc || !1, this.path, this.settings.jc);
16453
16459
  },
16454
16460
  /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ t.prototype.contains = function(t) {
16455
16461
  return void 0 !== this.fieldMask.find((function(e) {
@@ -16463,15 +16469,15 @@ function(t) {
16463
16469
  if (this.path) for (var t = 0; t < this.path.length; t++) this.Lc(this.path.get(t));
16464
16470
  }, t.prototype.Lc = function(t) {
16465
16471
  if (0 === t.length) throw this.qc("Document fields must not be empty");
16466
- if (Ya(this.$c) && Qa.test(t)) throw this.qc('Document fields cannot begin and end with "__"');
16472
+ if (Ja(this.$c) && Wa.test(t)) throw this.qc('Document fields cannot begin and end with "__"');
16467
16473
  }, t;
16468
- }(), Xa = /** @class */ function() {
16474
+ }(), $a = /** @class */ function() {
16469
16475
  function t(t, e, n) {
16470
16476
  this.databaseId = t, this.ignoreUndefinedProperties = e, this.k = n || Zo(t)
16471
16477
  /** Creates a new top-level parse context. */;
16472
16478
  }
16473
16479
  return t.prototype.Qc = function(t, e, n, r) {
16474
- return void 0 === r && (r = !1), new Ja({
16480
+ return void 0 === r && (r = !1), new Xa({
16475
16481
  $c: t,
16476
16482
  methodName: e,
16477
16483
  jc: n,
@@ -16485,30 +16491,30 @@ function(t) {
16485
16491
  /**
16486
16492
  * Helper for parsing raw user input (provided via the API) into internal model
16487
16493
  * classes.
16488
- */ function $a(t) {
16494
+ */ function Za(t) {
16489
16495
  var e = t._freezeSettings(), n = Zo(t._databaseId);
16490
- return new Xa(t._databaseId, !!e.ignoreUndefinedProperties, n);
16496
+ return new $a(t._databaseId, !!e.ignoreUndefinedProperties, n);
16491
16497
  }
16492
16498
 
16493
- /** Parse document data from a set() call. */ function Za(t, e, n, r, i, o) {
16499
+ /** Parse document data from a set() call. */ function tc(t, e, n, r, i, o) {
16494
16500
  void 0 === o && (o = {});
16495
16501
  var s = t.Qc(o.merge || o.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
16496
- lc("Data must be an object, but it was:", s, r);
16497
- var u, a, c = hc(r, s);
16502
+ dc("Data must be an object, but it was:", s, r);
16503
+ var u, a, c = fc(r, s);
16498
16504
  if (o.merge) u = new It(s.fieldMask), a = s.fieldTransforms; else if (o.mergeFields) {
16499
16505
  for (var h = [], f = 0, l = o.mergeFields; f < l.length; f++) {
16500
- var d = dc(e, l[f], n);
16506
+ var d = pc(e, l[f], n);
16501
16507
  if (!s.contains(d)) throw new Y(H.INVALID_ARGUMENT, "Field '" + d + "' is specified in your field mask but missing from your input data.");
16502
- mc(h, d) || h.push(d);
16508
+ gc(h, d) || h.push(d);
16503
16509
  }
16504
16510
  u = new It(h), a = s.fieldTransforms.filter((function(t) {
16505
16511
  return u.covers(t.field);
16506
16512
  }));
16507
16513
  } else u = null, a = s.fieldTransforms;
16508
- return new Wa(new Yt(c), u, a);
16514
+ return new Ha(new Yt(c), u, a);
16509
16515
  }
16510
16516
 
16511
- var tc = /** @class */ function(e) {
16517
+ var ec = /** @class */ function(e) {
16512
16518
  function n() {
16513
16519
  return null !== e && e.apply(this, arguments) || this;
16514
16520
  }
@@ -16520,7 +16526,7 @@ var tc = /** @class */ function(e) {
16520
16526
  }, n.prototype.isEqual = function(t) {
16521
16527
  return t instanceof n;
16522
16528
  }, n;
16523
- }(Ga);
16529
+ }(za);
16524
16530
 
16525
16531
  /**
16526
16532
  * Creates a child context for parsing SerializableFieldValues.
@@ -16537,8 +16543,8 @@ var tc = /** @class */ function(e) {
16537
16543
  * context.
16538
16544
  * @param context - The parent context.
16539
16545
  * @param arrayElement - Whether or not the FieldValue has an array.
16540
- */ function ec(t, e, n) {
16541
- return new Ja({
16546
+ */ function nc(t, e, n) {
16547
+ return new Xa({
16542
16548
  $c: 3 /* Argument */ ,
16543
16549
  jc: e.settings.jc,
16544
16550
  methodName: t._methodName,
@@ -16546,7 +16552,7 @@ var tc = /** @class */ function(e) {
16546
16552
  }, e.databaseId, e.k, e.ignoreUndefinedProperties);
16547
16553
  }
16548
16554
 
16549
- var nc = /** @class */ function(e) {
16555
+ var rc = /** @class */ function(e) {
16550
16556
  function n() {
16551
16557
  return null !== e && e.apply(this, arguments) || this;
16552
16558
  }
@@ -16555,37 +16561,37 @@ var nc = /** @class */ function(e) {
16555
16561
  }, n.prototype.isEqual = function(t) {
16556
16562
  return t instanceof n;
16557
16563
  }, n;
16558
- }(Ga), rc = /** @class */ function(e) {
16564
+ }(za), ic = /** @class */ function(e) {
16559
16565
  function n(t, n) {
16560
16566
  var r = this;
16561
16567
  return (r = e.call(this, t) || this).Wc = n, r;
16562
16568
  }
16563
16569
  return t(n, e), n.prototype._toFieldTransform = function(t) {
16564
- var e = ec(this, t,
16570
+ var e = nc(this, t,
16565
16571
  /*array=*/ !0), n = this.Wc.map((function(t) {
16566
- return cc(t, e);
16572
+ return hc(t, e);
16567
16573
  })), r = new Ke(n);
16568
16574
  return new Je(t.path, r);
16569
16575
  }, n.prototype.isEqual = function(t) {
16570
16576
  // TODO(mrschmidt): Implement isEquals
16571
16577
  return this === t;
16572
16578
  }, n;
16573
- }(Ga), ic = /** @class */ function(e) {
16579
+ }(za), oc = /** @class */ function(e) {
16574
16580
  function n(t, n) {
16575
16581
  var r = this;
16576
16582
  return (r = e.call(this, t) || this).Wc = n, r;
16577
16583
  }
16578
16584
  return t(n, e), n.prototype._toFieldTransform = function(t) {
16579
- var e = ec(this, t,
16585
+ var e = nc(this, t,
16580
16586
  /*array=*/ !0), n = this.Wc.map((function(t) {
16581
- return cc(t, e);
16587
+ return hc(t, e);
16582
16588
  })), r = new ze(n);
16583
16589
  return new Je(t.path, r);
16584
16590
  }, n.prototype.isEqual = function(t) {
16585
16591
  // TODO(mrschmidt): Implement isEquals
16586
16592
  return this === t;
16587
16593
  }, n;
16588
- }(Ga), oc = /** @class */ function(e) {
16594
+ }(za), sc = /** @class */ function(e) {
16589
16595
  function n(t, n) {
16590
16596
  var r = this;
16591
16597
  return (r = e.call(this, t) || this).Gc = n, r;
@@ -16597,50 +16603,50 @@ var nc = /** @class */ function(e) {
16597
16603
  // TODO(mrschmidt): Implement isEquals
16598
16604
  return this === t;
16599
16605
  }, n;
16600
- }(Ga);
16606
+ }(za);
16601
16607
 
16602
- /** Parse update data from an update() call. */ function sc(t, e, n, r) {
16608
+ /** Parse update data from an update() call. */ function uc(t, e, n, r) {
16603
16609
  var i = t.Qc(1 /* Update */ , e, n);
16604
- lc("Data must be an object, but it was:", i, r);
16610
+ dc("Data must be an object, but it was:", i, r);
16605
16611
  var o = [], s = Yt.empty();
16606
16612
  yt(r, (function(t, r) {
16607
- var u = yc(e, t, n);
16613
+ var u = vc(e, t, n);
16608
16614
  // For Compat types, we have to "extract" the underlying types before
16609
16615
  // performing validation.
16610
16616
  r = I(r);
16611
16617
  var a = i.Bc(u);
16612
- if (r instanceof tc)
16618
+ if (r instanceof ec)
16613
16619
  // Add it to the field mask, but don't add anything to updateData.
16614
16620
  o.push(u); else {
16615
- var c = cc(r, a);
16621
+ var c = hc(r, a);
16616
16622
  null != c && (o.push(u), s.set(u, c));
16617
16623
  }
16618
16624
  }));
16619
16625
  var u = new It(o);
16620
- return new Ha(s, u, i.fieldTransforms);
16626
+ return new Ya(s, u, i.fieldTransforms);
16621
16627
  }
16622
16628
 
16623
- /** Parse update data from a list of field/value arguments. */ function uc(t, e, n, r, i, o) {
16624
- var s = t.Qc(1 /* Update */ , e, n), u = [ dc(e, r, n) ], a = [ i ];
16629
+ /** Parse update data from a list of field/value arguments. */ function ac(t, e, n, r, i, o) {
16630
+ var s = t.Qc(1 /* Update */ , e, n), u = [ pc(e, r, n) ], a = [ i ];
16625
16631
  if (o.length % 2 != 0) throw new Y(H.INVALID_ARGUMENT, "Function " + e + "() needs to be called with an even number of arguments that alternate between field names and values.");
16626
- for (var c = 0; c < o.length; c += 2) u.push(dc(e, o[c])), a.push(o[c + 1]);
16632
+ for (var c = 0; c < o.length; c += 2) u.push(pc(e, o[c])), a.push(o[c + 1]);
16627
16633
  // We iterate in reverse order to pick the last value for a field if the
16628
16634
  // user specified the field multiple times.
16629
- for (var h = [], f = Yt.empty(), l = u.length - 1; l >= 0; --l) if (!mc(h, u[l])) {
16635
+ for (var h = [], f = Yt.empty(), l = u.length - 1; l >= 0; --l) if (!gc(h, u[l])) {
16630
16636
  var d = u[l], p = a[l];
16631
16637
  // For Compat types, we have to "extract" the underlying types before
16632
16638
  // performing validation.
16633
16639
  p = I(p);
16634
16640
  var y = s.Bc(d);
16635
- if (p instanceof tc)
16641
+ if (p instanceof ec)
16636
16642
  // Add it to the field mask, but don't add anything to updateData.
16637
16643
  h.push(d); else {
16638
- var v = cc(p, y);
16644
+ var v = hc(p, y);
16639
16645
  null != v && (h.push(d), f.set(d, v));
16640
16646
  }
16641
16647
  }
16642
16648
  var m = new It(h);
16643
- return new Ha(f, m, s.fieldTransforms);
16649
+ return new Ya(f, m, s.fieldTransforms);
16644
16650
  }
16645
16651
 
16646
16652
  /**
@@ -16649,8 +16655,8 @@ var nc = /** @class */ function(e) {
16649
16655
  *
16650
16656
  * @param allowArrays - Whether the query value is an array that may directly
16651
16657
  * contain additional arrays (e.g. the operand of an `in` query).
16652
- */ function ac(t, e, n, r) {
16653
- return void 0 === r && (r = !1), cc(n, t.Qc(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
16658
+ */ function cc(t, e, n, r) {
16659
+ return void 0 === r && (r = !1), hc(n, t.Qc(r ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
16654
16660
  }
16655
16661
 
16656
16662
  /**
@@ -16661,12 +16667,12 @@ var nc = /** @class */ function(e) {
16661
16667
  * the source of the data being parsed, etc.
16662
16668
  * @returns The parsed value, or null if the value was a FieldValue sentinel
16663
16669
  * that should not be included in the resulting parsed data.
16664
- */ function cc(t, e) {
16665
- if (fc(
16670
+ */ function hc(t, e) {
16671
+ if (lc(
16666
16672
  // Unwrap the API type from the Compat SDK. This will return the API type
16667
16673
  // from firestore-exp.
16668
- t = I(t))) return lc("Unsupported field value:", e, t), hc(t, e);
16669
- if (t instanceof Ga)
16674
+ t = I(t))) return dc("Unsupported field value:", e, t), fc(t, e);
16675
+ if (t instanceof za)
16670
16676
  // FieldValues usually parse into transforms (except deleteField())
16671
16677
  // in which case we do not want to include this field in our parsed data
16672
16678
  // (as doing so will overwrite the field directly prior to the transform
@@ -16678,7 +16684,7 @@ var nc = /** @class */ function(e) {
16678
16684
  */
16679
16685
  return function(t, e) {
16680
16686
  // Sentinels are only supported with writes, and not within arrays.
16681
- if (!Ya(e.$c)) throw e.qc(t._methodName + "() can only be used with update() and set()");
16687
+ if (!Ja(e.$c)) throw e.qc(t._methodName + "() can only be used with update() and set()");
16682
16688
  if (!e.path) throw e.qc(t._methodName + "() is not currently supported inside arrays");
16683
16689
  var n = t._toFieldTransform(e);
16684
16690
  n && e.fieldTransforms.push(n);
@@ -16701,7 +16707,7 @@ var nc = /** @class */ function(e) {
16701
16707
  if (e.settings.Fc && 4 /* ArrayArgument */ !== e.$c) throw e.qc("Nested arrays are not supported");
16702
16708
  return function(t, e) {
16703
16709
  for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {
16704
- var s = cc(o[i], e.Uc(r));
16710
+ var s = hc(o[i], e.Uc(r));
16705
16711
  null == s && (
16706
16712
  // Just include nulls in the array for fields being replaced with a
16707
16713
  // sentinel.
@@ -16742,33 +16748,33 @@ var nc = /** @class */ function(e) {
16742
16748
  timestampValue: Qn(e.k, r)
16743
16749
  };
16744
16750
  }
16745
- if (t instanceof za) return {
16751
+ if (t instanceof Qa) return {
16746
16752
  geoPointValue: {
16747
16753
  latitude: t.latitude,
16748
16754
  longitude: t.longitude
16749
16755
  }
16750
16756
  };
16751
- if (t instanceof Ka) return {
16757
+ if (t instanceof Ga) return {
16752
16758
  bytesValue: Wn(e.k, t._byteString)
16753
16759
  };
16754
- if (t instanceof da) {
16760
+ if (t instanceof pa) {
16755
16761
  var i = e.databaseId, o = t.firestore._databaseId;
16756
16762
  if (!o.isEqual(i)) throw e.qc("Document reference is for database " + o.projectId + "/" + o.database + " but should be for database " + i.projectId + "/" + i.database);
16757
16763
  return {
16758
16764
  referenceValue: Jn(t.firestore._databaseId || e.databaseId, t._key.path)
16759
16765
  };
16760
16766
  }
16761
- throw e.qc("Unsupported field value: " + ua(t));
16767
+ throw e.qc("Unsupported field value: " + aa(t));
16762
16768
  }(t, e);
16763
16769
  }
16764
16770
 
16765
- function hc(t, e) {
16771
+ function fc(t, e) {
16766
16772
  var n = {};
16767
16773
  return vt(t) ?
16768
16774
  // If we encounter an empty object, we explicitly add it to the update
16769
16775
  // mask to ensure that the server creates a map entry.
16770
16776
  e.path && e.path.length > 0 && e.fieldMask.push(e.path) : yt(t, (function(t, r) {
16771
- var i = cc(r, e.Mc(t));
16777
+ var i = hc(r, e.Mc(t));
16772
16778
  null != i && (n[t] = i);
16773
16779
  })), {
16774
16780
  mapValue: {
@@ -16777,35 +16783,35 @@ function hc(t, e) {
16777
16783
  };
16778
16784
  }
16779
16785
 
16780
- function fc(t) {
16781
- return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof lt || t instanceof za || t instanceof Ka || t instanceof da || t instanceof Ga);
16786
+ function lc(t) {
16787
+ return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof lt || t instanceof Qa || t instanceof Ga || t instanceof pa || t instanceof za);
16782
16788
  }
16783
16789
 
16784
- function lc(t, e, n) {
16785
- if (!fc(n) || !function(t) {
16790
+ function dc(t, e, n) {
16791
+ if (!lc(n) || !function(t) {
16786
16792
  return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
16787
16793
  }(n)) {
16788
- var r = ua(n);
16794
+ var r = aa(n);
16789
16795
  throw "an object" === r ? e.qc(t + " a custom object") : e.qc(t + " " + r);
16790
16796
  }
16791
16797
  }
16792
16798
 
16793
16799
  /**
16794
16800
  * Helper that calls fromDotSeparatedString() but wraps any error thrown.
16795
- */ function dc(t, e, n) {
16801
+ */ function pc(t, e, n) {
16796
16802
  if (
16797
16803
  // If required, replace the FieldPath Compat class with with the firestore-exp
16798
16804
  // FieldPath.
16799
- (e = I(e)) instanceof Ba) return e._internalPath;
16800
- if ("string" == typeof e) return yc(t, e);
16801
- throw vc("Field path arguments must be of type string or ", t,
16805
+ (e = I(e)) instanceof ja) return e._internalPath;
16806
+ if ("string" == typeof e) return vc(t, e);
16807
+ throw mc("Field path arguments must be of type string or ", t,
16802
16808
  /* hasConverter= */ !1,
16803
16809
  /* path= */ void 0, n);
16804
16810
  }
16805
16811
 
16806
16812
  /**
16807
16813
  * Matches any characters in a field path string that are reserved.
16808
- */ var pc = new RegExp("[~\\*/\\[\\]]");
16814
+ */ var yc = new RegExp("[~\\*/\\[\\]]");
16809
16815
 
16810
16816
  /**
16811
16817
  * Wraps fromDotSeparatedString with an error message about the method that
@@ -16815,20 +16821,20 @@ function lc(t, e, n) {
16815
16821
  * split on dots.
16816
16822
  * @param targetDoc - The document against which the field path will be
16817
16823
  * evaluated.
16818
- */ function yc(t, n, r) {
16819
- if (n.search(pc) >= 0) throw vc("Invalid field path (" + n + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
16824
+ */ function vc(t, n, r) {
16825
+ if (n.search(yc) >= 0) throw mc("Invalid field path (" + n + "). Paths must not contain '~', '*', '/', '[', or ']'", t,
16820
16826
  /* hasConverter= */ !1,
16821
16827
  /* path= */ void 0, r);
16822
16828
  try {
16823
- return (new (Ba.bind.apply(Ba, e([ void 0 ], n.split(".")))))._internalPath;
16829
+ return (new (ja.bind.apply(ja, e([ void 0 ], n.split(".")))))._internalPath;
16824
16830
  } catch (e) {
16825
- throw vc("Invalid field path (" + n + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
16831
+ throw mc("Invalid field path (" + n + "). Paths must not be empty, begin with '.', end with '.', or contain '..'", t,
16826
16832
  /* hasConverter= */ !1,
16827
16833
  /* path= */ void 0, r);
16828
16834
  }
16829
16835
  }
16830
16836
 
16831
- function vc(t, e, n, r, i) {
16837
+ function mc(t, e, n, r, i) {
16832
16838
  var o = r && !r.isEmpty(), s = void 0 !== i, u = "Function " + e + "() called with invalid data";
16833
16839
  n && (u += " (via `toFirestore()`)");
16834
16840
  var a = "";
@@ -16837,7 +16843,7 @@ function vc(t, e, n, r, i) {
16837
16843
  /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */;
16838
16844
  }
16839
16845
 
16840
- function mc(t, e) {
16846
+ function gc(t, e) {
16841
16847
  return t.some((function(t) {
16842
16848
  return t.isEqual(e);
16843
16849
  }));
@@ -16867,7 +16873,7 @@ function mc(t, e) {
16867
16873
  * For a `DocumentSnapshot` that points to a non-existing document, any data
16868
16874
  * access will return 'undefined'. You can use the `exists()` method to
16869
16875
  * explicitly verify a document's existence.
16870
- */ var gc = /** @class */ function() {
16876
+ */ var wc = /** @class */ function() {
16871
16877
  // Note: This class is stripped down version of the DocumentSnapshot in
16872
16878
  // the legacy SDK. The changes are:
16873
16879
  // - No support for SnapshotMetadata.
@@ -16888,7 +16894,7 @@ function mc(t, e) {
16888
16894
  * The `DocumentReference` for the document included in the `DocumentSnapshot`.
16889
16895
  */
16890
16896
  get: function() {
16891
- return new da(this._firestore, this._converter, this._key);
16897
+ return new pa(this._firestore, this._converter, this._key);
16892
16898
  },
16893
16899
  enumerable: !1,
16894
16900
  configurable: !0
@@ -16913,7 +16919,7 @@ function mc(t, e) {
16913
16919
  if (this._converter) {
16914
16920
  // We only want to use the converter and create a new DocumentSnapshot
16915
16921
  // if a converter has been provided.
16916
- var t = new wc(this._firestore, this._userDataWriter, this._key, this._document,
16922
+ var t = new bc(this._firestore, this._userDataWriter, this._key, this._document,
16917
16923
  /* converter= */ null);
16918
16924
  return this._converter.fromFirestore(t);
16919
16925
  }
@@ -16933,11 +16939,11 @@ function mc(t, e) {
16933
16939
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
16934
16940
  t.prototype.get = function(t) {
16935
16941
  if (this._document) {
16936
- var e = this._document.data.field(bc("DocumentSnapshot.get", t));
16942
+ var e = this._document.data.field(Ic("DocumentSnapshot.get", t));
16937
16943
  if (null !== e) return this._userDataWriter.convertValue(e);
16938
16944
  }
16939
16945
  }, t;
16940
- }(), wc = /** @class */ function(e) {
16946
+ }(), bc = /** @class */ function(e) {
16941
16947
  function n() {
16942
16948
  return null !== e && e.apply(this, arguments) || this;
16943
16949
  }
@@ -16949,7 +16955,7 @@ function mc(t, e) {
16949
16955
  */ return t(n, e), n.prototype.data = function() {
16950
16956
  return e.prototype.data.call(this);
16951
16957
  }, n;
16952
- }(gc);
16958
+ }(wc);
16953
16959
 
16954
16960
  /**
16955
16961
  * A `QueryDocumentSnapshot` contains data read from a document in your
@@ -16965,8 +16971,8 @@ function mc(t, e) {
16965
16971
  /**
16966
16972
  * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
16967
16973
  */
16968
- function bc(t, e) {
16969
- return "string" == typeof e ? yc(t, e) : e instanceof Ba ? e._internalPath : e._delegate._internalPath;
16974
+ function Ic(t, e) {
16975
+ return "string" == typeof e ? vc(t, e) : e instanceof ja ? e._internalPath : e._delegate._internalPath;
16970
16976
  }
16971
16977
 
16972
16978
  /**
@@ -16987,7 +16993,7 @@ function bc(t, e) {
16987
16993
  */
16988
16994
  /**
16989
16995
  * Metadata about a snapshot, describing the state of the snapshot.
16990
- */ var Ic = /** @class */ function() {
16996
+ */ var Tc = /** @class */ function() {
16991
16997
  /** @hideconstructor */
16992
16998
  function t(t, e) {
16993
16999
  this.hasPendingWrites = t, this.fromCache = e
@@ -17001,7 +17007,7 @@ function bc(t, e) {
17001
17007
  return t.prototype.isEqual = function(t) {
17002
17008
  return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;
17003
17009
  }, t;
17004
- }(), Tc = /** @class */ function(e) {
17010
+ }(), Ec = /** @class */ function(e) {
17005
17011
  /** @hideconstructor protected */
17006
17012
  function n(t, n, r, i, o, s) {
17007
17013
  var u = this;
@@ -17033,7 +17039,7 @@ function bc(t, e) {
17033
17039
  if (this._converter) {
17034
17040
  // We only want to use the converter and create a new DocumentSnapshot
17035
17041
  // if a converter has been provided.
17036
- var e = new Ec(this._firestore, this._userDataWriter, this._key, this._document, this.metadata,
17042
+ var e = new Sc(this._firestore, this._userDataWriter, this._key, this._document, this.metadata,
17037
17043
  /* converter= */ null);
17038
17044
  return this._converter.fromFirestore(e, t);
17039
17045
  }
@@ -17060,11 +17066,11 @@ function bc(t, e) {
17060
17066
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
17061
17067
  n.prototype.get = function(t, e) {
17062
17068
  if (void 0 === e && (e = {}), this._document) {
17063
- var n = this._document.data.field(bc("DocumentSnapshot.get", t));
17069
+ var n = this._document.data.field(Ic("DocumentSnapshot.get", t));
17064
17070
  if (null !== n) return this._userDataWriter.convertValue(n, e.serverTimestamps);
17065
17071
  }
17066
17072
  }, n;
17067
- }(gc), Ec = /** @class */ function(e) {
17073
+ }(wc), Sc = /** @class */ function(e) {
17068
17074
  function n() {
17069
17075
  return null !== e && e.apply(this, arguments) || this;
17070
17076
  }
@@ -17083,10 +17089,10 @@ function bc(t, e) {
17083
17089
  */ return t(n, e), n.prototype.data = function(t) {
17084
17090
  return void 0 === t && (t = {}), e.prototype.data.call(this, t);
17085
17091
  }, n;
17086
- }(Tc), Sc = /** @class */ function() {
17092
+ }(Ec), _c = /** @class */ function() {
17087
17093
  /** @hideconstructor */
17088
17094
  function t(t, e, n, r) {
17089
- this._firestore = t, this._userDataWriter = e, this._snapshot = r, this.metadata = new Ic(r.hasPendingWrites, r.fromCache),
17095
+ this._firestore = t, this._userDataWriter = e, this._snapshot = r, this.metadata = new Tc(r.hasPendingWrites, r.fromCache),
17090
17096
  this.query = n;
17091
17097
  }
17092
17098
  return Object.defineProperty(t.prototype, "docs", {
@@ -17121,7 +17127,7 @@ function bc(t, e) {
17121
17127
  t.prototype.forEach = function(t, e) {
17122
17128
  var n = this;
17123
17129
  this._snapshot.docs.forEach((function(r) {
17124
- t.call(e, new Ec(n._firestore, n._userDataWriter, r.key, r, new Ic(n._snapshot.mutatedKeys.has(r.key), n._snapshot.fromCache), n.query.converter));
17130
+ t.call(e, new Sc(n._firestore, n._userDataWriter, r.key, r, new Tc(n._snapshot.mutatedKeys.has(r.key), n._snapshot.fromCache), n.query.converter));
17125
17131
  }));
17126
17132
  },
17127
17133
  /**
@@ -17145,7 +17151,7 @@ function bc(t, e) {
17145
17151
  return t._snapshot.docChanges.map((function(e) {
17146
17152
  return {
17147
17153
  type: "added",
17148
- doc: new Ec(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Ic(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter),
17154
+ doc: new Sc(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Tc(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter),
17149
17155
  oldIndex: -1,
17150
17156
  newIndex: n++
17151
17157
  };
@@ -17157,10 +17163,10 @@ function bc(t, e) {
17157
17163
  return t._snapshot.docChanges.filter((function(t) {
17158
17164
  return e || 3 /* Metadata */ !== t.type;
17159
17165
  })).map((function(e) {
17160
- var n = new Ec(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Ic(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter), i = -1, o = -1;
17166
+ var n = new Sc(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Tc(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter), i = -1, o = -1;
17161
17167
  return 0 /* Added */ !== e.type && (i = r.indexOf(e.doc.key), r = r.delete(e.doc.key)),
17162
17168
  1 /* Removed */ !== e.type && (o = (r = r.add(e.doc)).indexOf(e.doc.key)), {
17163
- type: _c(e.type),
17169
+ type: Ac(e.type),
17164
17170
  doc: n,
17165
17171
  oldIndex: i,
17166
17172
  newIndex: o
@@ -17178,7 +17184,7 @@ function bc(t, e) {
17178
17184
  * For a `DocumentSnapshot` that points to a non-existing document, any data
17179
17185
  * access will return 'undefined'. You can use the `exists()` method to
17180
17186
  * explicitly verify a document's existence.
17181
- */ function _c(t) {
17187
+ */ function Ac(t) {
17182
17188
  switch (t) {
17183
17189
  case 0 /* Added */ :
17184
17190
  return "added";
@@ -17203,8 +17209,8 @@ function bc(t, e) {
17203
17209
  * @param left - A snapshot to compare.
17204
17210
  * @param right - A snapshot to compare.
17205
17211
  * @returns true if the snapshots are equal.
17206
- */ function Ac(t, e) {
17207
- return t instanceof Tc && e instanceof Tc ? t._firestore === e._firestore && t._key.isEqual(e._key) && (null === t._document ? null === e._document : t._document.isEqual(e._document)) && t._converter === e._converter : t instanceof Sc && e instanceof Sc && t._firestore === e._firestore && ba(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot);
17212
+ */ function kc(t, e) {
17213
+ return t instanceof Ec && e instanceof Ec ? 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 _c && e instanceof _c && t._firestore === e._firestore && Ia(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot);
17208
17214
  }
17209
17215
 
17210
17216
  /**
@@ -17222,7 +17228,7 @@ function bc(t, e) {
17222
17228
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17223
17229
  * See the License for the specific language governing permissions and
17224
17230
  * limitations under the License.
17225
- */ function kc(t) {
17231
+ */ function Dc(t) {
17226
17232
  if (Te(t) && 0 === t.explicitOrderBy.length) throw new Y(H.UNIMPLEMENTED, "limitToLast() queries require specifying at least one orderBy() clause");
17227
17233
  }
17228
17234
 
@@ -17233,7 +17239,7 @@ function bc(t, e) {
17233
17239
  * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and
17234
17240
  * can then be passed to {@link query} to create a new query instance that
17235
17241
  * also contains this `QueryConstraint`.
17236
- */ var Dc = function() {};
17242
+ */ var Nc = function() {};
17237
17243
 
17238
17244
  /**
17239
17245
  * Creates a new immutable instance of {@link Query} that is extended to also include
@@ -17243,7 +17249,7 @@ function bc(t, e) {
17243
17249
  * @param queryConstraints - The list of {@link QueryConstraint}s to apply.
17244
17250
  * @throws if any of the provided query constraints cannot be combined with the
17245
17251
  * existing or new constraints.
17246
- */ function Nc(t) {
17252
+ */ function Cc(t) {
17247
17253
  for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
17248
17254
  for (var r = 0, i = e; r < i.length; r++) {
17249
17255
  var o = i[r];
@@ -17252,31 +17258,31 @@ function bc(t, e) {
17252
17258
  return t;
17253
17259
  }
17254
17260
 
17255
- var Cc = /** @class */ function(e) {
17261
+ var xc = /** @class */ function(e) {
17256
17262
  function n(t, n, r) {
17257
17263
  var i = this;
17258
17264
  return (i = e.call(this) || this).zc = t, i.Hc = n, i.Jc = r, i.type = "where",
17259
17265
  i;
17260
17266
  }
17261
17267
  return t(n, e), n.prototype._apply = function(t) {
17262
- var e = $a(t.firestore), n = function(t, e, n, r, i, o, s) {
17268
+ var e = Za(t.firestore), n = function(t, e, n, r, i, o, s) {
17263
17269
  var u;
17264
17270
  if (i.isKeyField()) {
17265
17271
  if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new Y(H.INVALID_ARGUMENT, "Invalid Query. You can't perform '" + o + "' queries on documentId().");
17266
17272
  if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
17267
- zc(s, o);
17273
+ Qc(s, o);
17268
17274
  for (var a = [], c = 0, h = s; c < h.length; c++) {
17269
17275
  var f = h[c];
17270
- a.push(Gc(r, t, f));
17276
+ a.push(zc(r, t, f));
17271
17277
  }
17272
17278
  u = {
17273
17279
  arrayValue: {
17274
17280
  values: a
17275
17281
  }
17276
17282
  };
17277
- } else u = Gc(r, t, s);
17278
- } else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || zc(s, o),
17279
- u = ac(n, "where", s,
17283
+ } else u = zc(r, t, s);
17284
+ } else "in" /* IN */ !== o && "not-in" /* NOT_IN */ !== o && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== o || Qc(s, o),
17285
+ u = cc(n, "where", s,
17280
17286
  /* allowArrays= */ "in" /* IN */ === o || "not-in" /* NOT_IN */ === o);
17281
17287
  var l = re.create(i, o, u);
17282
17288
  return function(t, e) {
@@ -17284,7 +17290,7 @@ var Cc = /** @class */ function(e) {
17284
17290
  var n = Se(t);
17285
17291
  if (null !== n && !n.isEqual(e.field)) throw new Y(H.INVALID_ARGUMENT, "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() + "'");
17286
17292
  var r = Ee(t);
17287
- null !== r && Qc(t, e.field, r);
17293
+ null !== r && Wc(t, e.field, r);
17288
17294
  }
17289
17295
  var i = function(t, e) {
17290
17296
  for (var n = 0, r = t.filters; n < r.length; n++) {
@@ -17331,12 +17337,12 @@ var Cc = /** @class */ function(e) {
17331
17337
  throw i === e.op ? new Y(H.INVALID_ARGUMENT, "Invalid query. You cannot use more than one '" + e.op.toString() + "' filter.") : new Y(H.INVALID_ARGUMENT, "Invalid query. You cannot use '" + e.op.toString() + "' filters with '" + i.toString() + "' filters.");
17332
17338
  }(t, l), l;
17333
17339
  }(t._query, 0, e, t.firestore._databaseId, this.zc, this.Hc, this.Jc);
17334
- return new pa(t.firestore, t.converter, function(t, e) {
17340
+ return new ya(t.firestore, t.converter, function(t, e) {
17335
17341
  var n = t.filters.concat([ e ]);
17336
17342
  return new ge(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
17337
17343
  }(t._query, n));
17338
17344
  }, n;
17339
- }(Dc);
17345
+ }(Nc);
17340
17346
 
17341
17347
  /**
17342
17348
  * Creates a {@link QueryConstraint} that enforces that documents must contain the
@@ -17348,12 +17354,12 @@ var Cc = /** @class */ function(e) {
17348
17354
  * "&lt;=", "!=").
17349
17355
  * @param value - The value for comparison
17350
17356
  * @returns The created {@link Query}.
17351
- */ function xc(t, e, n) {
17352
- var r = e, i = bc("where", t);
17353
- return new Cc(i, r, n);
17357
+ */ function Rc(t, e, n) {
17358
+ var r = e, i = Ic("where", t);
17359
+ return new xc(i, r, n);
17354
17360
  }
17355
17361
 
17356
- var Rc = /** @class */ function(e) {
17362
+ var Lc = /** @class */ function(e) {
17357
17363
  function n(t, n) {
17358
17364
  var r = this;
17359
17365
  return (r = e.call(this) || this).zc = t, r.Yc = n, r.type = "orderBy", r;
@@ -17367,17 +17373,17 @@ var Rc = /** @class */ function(e) {
17367
17373
  if (null === Ee(t)) {
17368
17374
  // This is the first order by. It must match any inequality.
17369
17375
  var n = Se(t);
17370
- null !== n && Qc(t, n, e.field);
17376
+ null !== n && Wc(t, n, e.field);
17371
17377
  }
17372
17378
  }(t, r), r;
17373
17379
  }(t._query, this.zc, this.Yc);
17374
- return new pa(t.firestore, t.converter, function(t, e) {
17380
+ return new ya(t.firestore, t.converter, function(t, e) {
17375
17381
  // TODO(dimond): validate that orderBy does not list the same key twice.
17376
17382
  var n = t.explicitOrderBy.concat([ e ]);
17377
17383
  return new ge(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
17378
17384
  }(t._query, e));
17379
17385
  }, n;
17380
- }(Dc);
17386
+ }(Nc);
17381
17387
 
17382
17388
  /**
17383
17389
  * Creates a {@link QueryConstraint} that sorts the query result by the
@@ -17387,29 +17393,29 @@ var Rc = /** @class */ function(e) {
17387
17393
  * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
17388
17394
  * not specified, order will be ascending.
17389
17395
  * @returns The created {@link Query}.
17390
- */ function Lc(t, e) {
17396
+ */ function Pc(t, e) {
17391
17397
  void 0 === e && (e = "asc");
17392
- var n = e, r = bc("orderBy", t);
17393
- return new Rc(r, n);
17398
+ var n = e, r = Ic("orderBy", t);
17399
+ return new Lc(r, n);
17394
17400
  }
17395
17401
 
17396
- var Pc = /** @class */ function(e) {
17402
+ var Oc = /** @class */ function(e) {
17397
17403
  function n(t, n, r) {
17398
17404
  var i = this;
17399
17405
  return (i = e.call(this) || this).type = t, i.Xc = n, i.Zc = r, i;
17400
17406
  }
17401
17407
  return t(n, e), n.prototype._apply = function(t) {
17402
- return new pa(t.firestore, t.converter, De(t._query, this.Xc, this.Zc));
17408
+ return new ya(t.firestore, t.converter, De(t._query, this.Xc, this.Zc));
17403
17409
  }, n;
17404
- }(Dc);
17410
+ }(Nc);
17405
17411
 
17406
17412
  /**
17407
17413
  * Creates a {@link QueryConstraint} that only returns the first matching documents.
17408
17414
  *
17409
17415
  * @param limit - The maximum number of items to return.
17410
17416
  * @returns The created {@link Query}.
17411
- */ function Oc(t) {
17412
- return ca("limit", t), new Pc("limit", t, "F" /* First */)
17417
+ */ function Mc(t) {
17418
+ return ha("limit", t), new Oc("limit", t, "F" /* First */)
17413
17419
  /**
17414
17420
  * Creates a {@link QueryConstraint} that only returns the last matching documents.
17415
17421
  *
@@ -17421,59 +17427,59 @@ var Pc = /** @class */ function(e) {
17421
17427
  */;
17422
17428
  }
17423
17429
 
17424
- function Mc(t) {
17425
- return ca("limitToLast", t), new Pc("limitToLast", t, "L" /* Last */);
17430
+ function Fc(t) {
17431
+ return ha("limitToLast", t), new Oc("limitToLast", t, "L" /* Last */);
17426
17432
  }
17427
17433
 
17428
- var Fc = /** @class */ function(e) {
17434
+ var Vc = /** @class */ function(e) {
17429
17435
  function n(t, n, r) {
17430
17436
  var i = this;
17431
17437
  return (i = e.call(this) || this).type = t, i.ta = n, i.ea = r, i;
17432
17438
  }
17433
17439
  return t(n, e), n.prototype._apply = function(t) {
17434
- var e = Kc(t, this.type, this.ta, this.ea);
17435
- return new pa(t.firestore, t.converter, function(t, e) {
17440
+ var e = Gc(t, this.type, this.ta, this.ea);
17441
+ return new ya(t.firestore, t.converter, function(t, e) {
17436
17442
  return new ge(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
17437
17443
  }(t._query, e));
17438
17444
  }, n;
17439
- }(Dc);
17445
+ }(Nc);
17440
17446
 
17441
- function Vc() {
17447
+ function qc() {
17442
17448
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
17443
- return new Fc("startAt", t, /*before=*/ !0);
17449
+ return new Vc("startAt", t, /*before=*/ !0);
17444
17450
  }
17445
17451
 
17446
- function qc() {
17452
+ function Uc() {
17447
17453
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
17448
- return new Fc("startAfter", t,
17454
+ return new Vc("startAfter", t,
17449
17455
  /*before=*/ !1);
17450
17456
  }
17451
17457
 
17452
- var Uc = /** @class */ function(e) {
17458
+ var Bc = /** @class */ function(e) {
17453
17459
  function n(t, n, r) {
17454
17460
  var i = this;
17455
17461
  return (i = e.call(this) || this).type = t, i.ta = n, i.ea = r, i;
17456
17462
  }
17457
17463
  return t(n, e), n.prototype._apply = function(t) {
17458
- var e = Kc(t, this.type, this.ta, this.ea);
17459
- return new pa(t.firestore, t.converter, function(t, e) {
17464
+ var e = Gc(t, this.type, this.ta, this.ea);
17465
+ return new ya(t.firestore, t.converter, function(t, e) {
17460
17466
  return new ge(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
17461
17467
  }(t._query, e));
17462
17468
  }, n;
17463
- }(Dc);
17469
+ }(Nc);
17464
17470
 
17465
- function Bc() {
17471
+ function jc() {
17466
17472
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
17467
- return new Uc("endBefore", t, /*before=*/ !0);
17473
+ return new Bc("endBefore", t, /*before=*/ !0);
17468
17474
  }
17469
17475
 
17470
- function jc() {
17476
+ function Kc() {
17471
17477
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
17472
- return new Uc("endAt", t, /*before=*/ !1);
17478
+ return new Bc("endAt", t, /*before=*/ !1);
17473
17479
  }
17474
17480
 
17475
- /** Helper function to create a bound from a document or fields */ function Kc(t, e, n, r) {
17476
- if (n[0] = I(n[0]), n[0] instanceof gc) return function(t, e, n, r, i) {
17481
+ /** Helper function to create a bound from a document or fields */ function Gc(t, e, n, r) {
17482
+ if (n[0] = I(n[0]), n[0] instanceof wc) return function(t, e, n, r, i) {
17477
17483
  if (!r) throw new Y(H.NOT_FOUND, "Can't use a DocumentSnapshot that doesn't exist for " + n + "().");
17478
17484
  // Because people expect to continue/end a query at the exact document
17479
17485
  // provided, we need to use the implicit sort order rather than the explicit
@@ -17496,7 +17502,7 @@ function jc() {
17496
17502
  }
17497
17503
  return new le(o, i);
17498
17504
  }(t._query, t.firestore._databaseId, e, n[0]._document, r);
17499
- var i = $a(t.firestore);
17505
+ var i = Za(t.firestore);
17500
17506
  return function(t, e, n, r, i, o) {
17501
17507
  // Use explicit order by's because it has to match the query the user made
17502
17508
  var s = t.explicitOrderBy;
@@ -17511,7 +17517,7 @@ function jc() {
17511
17517
  var f = new Pt(h);
17512
17518
  u.push(jt(e, f));
17513
17519
  } else {
17514
- var l = ac(n, r, c);
17520
+ var l = cc(n, r, c);
17515
17521
  u.push(l);
17516
17522
  }
17517
17523
  }
@@ -17519,7 +17525,7 @@ function jc() {
17519
17525
  }(t._query, t.firestore._databaseId, i, e, n, r);
17520
17526
  }
17521
17527
 
17522
- function Gc(t, e, n) {
17528
+ function zc(t, e, n) {
17523
17529
  if ("string" == typeof (n = I(n))) {
17524
17530
  if ("" === n) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
17525
17531
  if (!_e(e) && -1 !== n.indexOf("/")) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '" + n + "' contains a '/' character.");
@@ -17527,19 +17533,19 @@ function Gc(t, e, n) {
17527
17533
  if (!Pt.isDocumentKey(r)) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '" + r + "' is not because it has an odd number of segments (" + r.length + ").");
17528
17534
  return jt(t, new Pt(r));
17529
17535
  }
17530
- if (n instanceof da) return jt(t, n._key);
17531
- throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + ua(n) + ".");
17536
+ if (n instanceof pa) return jt(t, n._key);
17537
+ throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + aa(n) + ".");
17532
17538
  }
17533
17539
 
17534
17540
  /**
17535
17541
  * Validates that the value passed into a disjunctive filter satisfies all
17536
17542
  * array requirements.
17537
- */ function zc(t, e) {
17543
+ */ function Qc(t, e) {
17538
17544
  if (!Array.isArray(t) || 0 === t.length) throw new Y(H.INVALID_ARGUMENT, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
17539
17545
  if (t.length > 10) throw new Y(H.INVALID_ARGUMENT, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
17540
17546
  }
17541
17547
 
17542
- function Qc(t, e, n) {
17548
+ function Wc(t, e, n) {
17543
17549
  if (!n.isEqual(e)) throw new Y(H.INVALID_ARGUMENT, "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.");
17544
17550
  }
17545
17551
 
@@ -17564,7 +17570,7 @@ function Qc(t, e, n) {
17564
17570
  * to the user.
17565
17571
  *
17566
17572
  * @internal
17567
- */ var Wc = /** @class */ function() {
17573
+ */ var Hc = /** @class */ function() {
17568
17574
  function t() {}
17569
17575
  return t.prototype.convertValue = function(t, e) {
17570
17576
  switch (void 0 === e && (e = "none"), Ot(t)) {
@@ -17610,7 +17616,7 @@ function Qc(t, e, n) {
17610
17616
  r[t] = n.convertValue(i, e);
17611
17617
  })), r;
17612
17618
  }, t.prototype.convertGeoPoint = function(t) {
17613
- return new za(At(t.latitude), At(t.longitude));
17619
+ return new Qa(At(t.latitude), At(t.longitude));
17614
17620
  }, t.prototype.convertArray = function(t, e) {
17615
17621
  var n = this;
17616
17622
  return (t.values || []).map((function(t) {
@@ -17634,7 +17640,7 @@ function Qc(t, e, n) {
17634
17640
  }, t.prototype.convertDocumentKey = function(t, e) {
17635
17641
  var n = gt.fromString(t);
17636
17642
  z(Ir(n));
17637
- var r = new ea(n.get(1), n.get(3)), i = new Pt(n.popFirst(5));
17643
+ var r = new na(n.get(1), n.get(3)), i = new Pt(n.popFirst(5));
17638
17644
  return r.isEqual(e) ||
17639
17645
  // TODO(b/64130202): Somehow support foreign references.
17640
17646
  B("Document " + i + " contains a document reference within a different database (" + r.projectId + "/" + r.database + ") which is not supported. It will be treated as a reference in the current database (" + e.projectId + "/" + e.database + ") instead."),
@@ -17666,41 +17672,41 @@ function Qc(t, e, n) {
17666
17672
  * because we want to provide the user with a more specific error message if
17667
17673
  * their `set()` or fails due to invalid data originating from a `toFirestore()`
17668
17674
  * call.
17669
- */ function Hc(t, e, n) {
17675
+ */ function Yc(t, e, n) {
17670
17676
  // Cast to `any` in order to satisfy the union type constraint on
17671
17677
  // toFirestore().
17672
17678
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
17673
17679
  return t ? n && (n.merge || n.mergeFields) ? t.toFirestore(e, n) : t.toFirestore(e) : e;
17674
17680
  }
17675
17681
 
17676
- var Yc = /** @class */ function(e) {
17682
+ var Jc = /** @class */ function(e) {
17677
17683
  function n(t) {
17678
17684
  var n = this;
17679
17685
  return (n = e.call(this) || this).firestore = t, n;
17680
17686
  }
17681
17687
  return t(n, e), n.prototype.convertBytes = function(t) {
17682
- return new Ka(t);
17688
+ return new Ga(t);
17683
17689
  }, n.prototype.convertReference = function(t) {
17684
17690
  var e = this.convertDocumentKey(t, this.firestore._databaseId);
17685
- return new da(this.firestore, /* converter= */ null, e);
17691
+ return new pa(this.firestore, /* converter= */ null, e);
17686
17692
  }, n;
17687
- }(Wc), Jc = /** @class */ function() {
17693
+ }(Hc), Xc = /** @class */ function() {
17688
17694
  /** @hideconstructor */
17689
17695
  function t(t, e) {
17690
17696
  this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
17691
- this._dataReader = $a(t);
17697
+ this._dataReader = Za(t);
17692
17698
  }
17693
17699
  return t.prototype.set = function(t, e, n) {
17694
17700
  this._verifyNotCommitted();
17695
- var r = Xc(t, this._firestore), i = Hc(r.converter, e, n), o = Za(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
17701
+ var r = $c(t, this._firestore), i = Yc(r.converter, e, n), o = tc(this._dataReader, "WriteBatch.set", r._key, i, null !== r.converter, n);
17696
17702
  return this._mutations.push(o.toMutation(r._key, $e.none())), this;
17697
17703
  }, t.prototype.update = function(t, e, n) {
17698
17704
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
17699
17705
  this._verifyNotCommitted();
17700
- var o, s = Xc(t, this._firestore);
17706
+ var o, s = $c(t, this._firestore);
17701
17707
  // For Compat types, we have to "extract" the underlying types before
17702
17708
  // performing validation.
17703
- return o = "string" == typeof (e = I(e)) || e instanceof Ba ? uc(this._dataReader, "WriteBatch.update", s._key, e, n, r) : sc(this._dataReader, "WriteBatch.update", s._key, e),
17709
+ return o = "string" == typeof (e = I(e)) || e instanceof ja ? ac(this._dataReader, "WriteBatch.update", s._key, e, n, r) : uc(this._dataReader, "WriteBatch.update", s._key, e),
17704
17710
  this._mutations.push(o.toMutation(s._key, $e.exists(!0))), this;
17705
17711
  },
17706
17712
  /**
@@ -17711,7 +17717,7 @@ var Yc = /** @class */ function(e) {
17711
17717
  */
17712
17718
  t.prototype.delete = function(t) {
17713
17719
  this._verifyNotCommitted();
17714
- var e = Xc(t, this._firestore);
17720
+ var e = $c(t, this._firestore);
17715
17721
  return this._mutations = this._mutations.concat(new pn(e._key, $e.none())), this;
17716
17722
  },
17717
17723
  /**
@@ -17756,7 +17762,7 @@ var Yc = /** @class */ function(e) {
17756
17762
  * provides methods for adding writes to the write batch. None of the writes
17757
17763
  * will be committed (or visible locally) until {@link WriteBatch.commit} is
17758
17764
  * called.
17759
- */ function Xc(t, e) {
17765
+ */ function $c(t, e) {
17760
17766
  if ((t = I(t)).firestore !== e) throw new Y(H.INVALID_ARGUMENT, "Provided document reference is from a different Firestore instance.");
17761
17767
  return t;
17762
17768
  }
@@ -17813,26 +17819,26 @@ var Yc = /** @class */ function(e) {
17813
17819
  * @param reference - The reference of the document to fetch.
17814
17820
  * @returns A Promise resolved with a `DocumentSnapshot` containing the
17815
17821
  * current document contents.
17816
- */ function $c(t) {
17817
- t = aa(t, da);
17818
- var e = aa(t.firestore, _a);
17819
- return $u(Da(e), t._key).then((function(n) {
17820
- return lh(e, t, n);
17822
+ */ function Zc(t) {
17823
+ t = ca(t, pa);
17824
+ var e = ca(t.firestore, Aa);
17825
+ return Zu(Na(e), t._key).then((function(n) {
17826
+ return dh(e, t, n);
17821
17827
  }));
17822
17828
  }
17823
17829
 
17824
- var Zc = /** @class */ function(e) {
17830
+ var th = /** @class */ function(e) {
17825
17831
  function n(t) {
17826
17832
  var n = this;
17827
17833
  return (n = e.call(this) || this).firestore = t, n;
17828
17834
  }
17829
17835
  return t(n, e), n.prototype.convertBytes = function(t) {
17830
- return new Ka(t);
17836
+ return new Ga(t);
17831
17837
  }, n.prototype.convertReference = function(t) {
17832
17838
  var e = this.convertDocumentKey(t, this.firestore._databaseId);
17833
- return new da(this.firestore, /* converter= */ null, e);
17839
+ return new pa(this.firestore, /* converter= */ null, e);
17834
17840
  }, n;
17835
- }(Wc);
17841
+ }(Hc);
17836
17842
 
17837
17843
  /**
17838
17844
  * Reads the document referred to by this `DocumentReference` from cache.
@@ -17840,9 +17846,9 @@ var Zc = /** @class */ function(e) {
17840
17846
  *
17841
17847
  * @returns A `Promise` resolved with a `DocumentSnapshot` containing the
17842
17848
  * current document contents.
17843
- */ function th(t) {
17844
- t = aa(t, da);
17845
- var e = aa(t.firestore, _a), i = Da(e), o = new Zc(e);
17849
+ */ function eh(t) {
17850
+ t = ca(t, pa);
17851
+ var e = ca(t.firestore, Aa), i = Na(e), o = new th(e);
17846
17852
  return function(t, e) {
17847
17853
  var i = this, o = new J;
17848
17854
  return t.asyncQueue.enqueueAndForget((function() {
@@ -17869,7 +17875,7 @@ var Zc = /** @class */ function(e) {
17869
17875
  [ 3 /*break*/ , 3 ];
17870
17876
 
17871
17877
  case 2:
17872
- return o = r.sent(), s = Ls(o, "Failed to get document '" + e + " from cache"),
17878
+ return o = r.sent(), s = Ps(o, "Failed to get document '" + e + " from cache"),
17873
17879
  i.reject(s), [ 3 /*break*/ , 3 ];
17874
17880
 
17875
17881
  case 3:
@@ -17877,7 +17883,7 @@ var Zc = /** @class */ function(e) {
17877
17883
  }
17878
17884
  }));
17879
17885
  }));
17880
- }, [ 4 /*yield*/ , Hu(t) ];
17886
+ }, [ 4 /*yield*/ , Yu(t) ];
17881
17887
 
17882
17888
  case 1:
17883
17889
  return [ 2 /*return*/ , i.apply(void 0, [ s.sent(), e, o ]) ];
@@ -17886,7 +17892,7 @@ var Zc = /** @class */ function(e) {
17886
17892
  }));
17887
17893
  })), o.promise;
17888
17894
  }(i, t._key).then((function(n) {
17889
- return new Tc(e, o, t._key, n, new Ic(null !== n && n.hasLocalMutations,
17895
+ return new Ec(e, o, t._key, n, new Tc(null !== n && n.hasLocalMutations,
17890
17896
  /* fromCache= */ !0), t.converter);
17891
17897
  }));
17892
17898
  }
@@ -17897,13 +17903,13 @@ var Zc = /** @class */ function(e) {
17897
17903
  *
17898
17904
  * @returns A `Promise` resolved with a `DocumentSnapshot` containing the
17899
17905
  * current document contents.
17900
- */ function eh(t) {
17901
- t = aa(t, da);
17902
- var e = aa(t.firestore, _a);
17903
- return $u(Da(e), t._key, {
17906
+ */ function nh(t) {
17907
+ t = ca(t, pa);
17908
+ var e = ca(t.firestore, Aa);
17909
+ return Zu(Na(e), t._key, {
17904
17910
  source: "server"
17905
17911
  }).then((function(n) {
17906
- return lh(e, t, n);
17912
+ return dh(e, t, n);
17907
17913
  }));
17908
17914
  }
17909
17915
 
@@ -17916,11 +17922,11 @@ var Zc = /** @class */ function(e) {
17916
17922
  * invoke {@link getDocsFromCache} or {@link getDocsFromServer}.
17917
17923
  *
17918
17924
  * @returns A `Promise` that will be resolved with the results of the query.
17919
- */ function nh(t) {
17920
- t = aa(t, pa);
17921
- var e = aa(t.firestore, _a), n = Da(e), r = new Zc(e);
17922
- return kc(t._query), Zu(n, t._query).then((function(n) {
17923
- return new Sc(e, r, t, n);
17925
+ */ function rh(t) {
17926
+ t = ca(t, ya);
17927
+ var e = ca(t.firestore, Aa), n = Na(e), r = new th(e);
17928
+ return Dc(t._query), ta(n, t._query).then((function(n) {
17929
+ return new _c(e, r, t, n);
17924
17930
  }))
17925
17931
  /**
17926
17932
  * Executes the query and returns the results as a `QuerySnapshot` from cache.
@@ -17930,9 +17936,9 @@ var Zc = /** @class */ function(e) {
17930
17936
  */;
17931
17937
  }
17932
17938
 
17933
- function rh(t) {
17934
- t = aa(t, pa);
17935
- var e = aa(t.firestore, _a), i = Da(e), o = new Zc(e);
17939
+ function ih(t) {
17940
+ t = ca(t, ya);
17941
+ var e = ca(t.firestore, Aa), i = Na(e), o = new th(e);
17936
17942
  return function(t, e) {
17937
17943
  var i = this, o = new J;
17938
17944
  return t.asyncQueue.enqueueAndForget((function() {
@@ -17951,11 +17957,11 @@ function rh(t) {
17951
17957
  /* usePreviousResults= */ !0) ];
17952
17958
 
17953
17959
  case 1:
17954
- return n = r.sent(), o = new Xs(e, n.zn), s = o.Po(n.documents), u = o.applyChanges(s,
17960
+ return n = r.sent(), o = new $s(e, n.zn), s = o.Po(n.documents), u = o.applyChanges(s,
17955
17961
  /* updateLimboDocuments= */ !1), i.resolve(u.snapshot), [ 3 /*break*/ , 3 ];
17956
17962
 
17957
17963
  case 2:
17958
- return a = r.sent(), c = Ls(a, "Failed to execute query '" + e + " against cache"),
17964
+ return a = r.sent(), c = Ps(a, "Failed to execute query '" + e + " against cache"),
17959
17965
  i.reject(c), [ 3 /*break*/ , 3 ];
17960
17966
 
17961
17967
  case 3:
@@ -17963,7 +17969,7 @@ function rh(t) {
17963
17969
  }
17964
17970
  }));
17965
17971
  }));
17966
- }, [ 4 /*yield*/ , Hu(t) ];
17972
+ }, [ 4 /*yield*/ , Yu(t) ];
17967
17973
 
17968
17974
  case 1:
17969
17975
  return [ 2 /*return*/ , i.apply(void 0, [ s.sent(), e, o ]) ];
@@ -17972,7 +17978,7 @@ function rh(t) {
17972
17978
  }));
17973
17979
  })), o.promise;
17974
17980
  }(i, t._query).then((function(n) {
17975
- return new Sc(e, o, t, n);
17981
+ return new _c(e, o, t, n);
17976
17982
  }));
17977
17983
  }
17978
17984
 
@@ -17981,30 +17987,30 @@ function rh(t) {
17981
17987
  * server. Returns an error if the network is not available.
17982
17988
  *
17983
17989
  * @returns A `Promise` that will be resolved with the results of the query.
17984
- */ function ih(t) {
17985
- t = aa(t, pa);
17986
- var e = aa(t.firestore, _a), n = Da(e), r = new Zc(e);
17987
- return Zu(n, t._query, {
17990
+ */ function oh(t) {
17991
+ t = ca(t, ya);
17992
+ var e = ca(t.firestore, Aa), n = Na(e), r = new th(e);
17993
+ return ta(n, t._query, {
17988
17994
  source: "server"
17989
17995
  }).then((function(n) {
17990
- return new Sc(e, r, t, n);
17996
+ return new _c(e, r, t, n);
17991
17997
  }));
17992
17998
  }
17993
17999
 
17994
- function oh(t, e, n) {
17995
- t = aa(t, da);
17996
- var r = aa(t.firestore, _a), i = Hc(t.converter, e, n);
17997
- return fh(r, [ Za($a(r), "setDoc", t._key, i, null !== t.converter, n).toMutation(t._key, $e.none()) ]);
18000
+ function sh(t, e, n) {
18001
+ t = ca(t, pa);
18002
+ var r = ca(t.firestore, Aa), i = Yc(t.converter, e, n);
18003
+ return lh(r, [ tc(Za(r), "setDoc", t._key, i, null !== t.converter, n).toMutation(t._key, $e.none()) ]);
17998
18004
  }
17999
18005
 
18000
- function sh(t, e, n) {
18006
+ function uh(t, e, n) {
18001
18007
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
18002
- t = aa(t, da);
18003
- var o = aa(t.firestore, _a), s = $a(o);
18004
- return fh(o, [ ("string" == typeof (
18008
+ t = ca(t, pa);
18009
+ var o = ca(t.firestore, Aa), s = Za(o);
18010
+ return lh(o, [ ("string" == typeof (
18005
18011
  // For Compat types, we have to "extract" the underlying types before
18006
18012
  // performing validation.
18007
- e = I(e)) || e instanceof Ba ? uc(s, "updateDoc", t._key, e, n, r) : sc(s, "updateDoc", t._key, e)).toMutation(t._key, $e.exists(!0)) ]);
18013
+ e = I(e)) || e instanceof ja ? ac(s, "updateDoc", t._key, e, n, r) : uc(s, "updateDoc", t._key, e)).toMutation(t._key, $e.exists(!0)) ]);
18008
18014
  }
18009
18015
 
18010
18016
  /**
@@ -18013,8 +18019,8 @@ function sh(t, e, n) {
18013
18019
  * @param reference - A reference to the document to delete.
18014
18020
  * @returns A Promise resolved once the document has been successfully
18015
18021
  * deleted from the backend (note that it won't resolve while you're offline).
18016
- */ function uh(t) {
18017
- return fh(aa(t.firestore, _a), [ new pn(t._key, $e.none()) ]);
18022
+ */ function ah(t) {
18023
+ return lh(ca(t.firestore, Aa), [ new pn(t._key, $e.none()) ]);
18018
18024
  }
18019
18025
 
18020
18026
  /**
@@ -18026,55 +18032,55 @@ function sh(t, e, n) {
18026
18032
  * @returns A `Promise` resolved with a `DocumentReference` pointing to the
18027
18033
  * newly created document after it has been written to the backend (Note that it
18028
18034
  * won't resolve while you're offline).
18029
- */ function ah(t, e) {
18030
- var n = aa(t.firestore, _a), r = ga(t), i = Hc(t.converter, e);
18031
- return fh(n, [ Za($a(t.firestore), "addDoc", r._key, i, null !== t.converter, {}).toMutation(r._key, $e.exists(!1)) ]).then((function() {
18035
+ */ function ch(t, e) {
18036
+ var n = ca(t.firestore, Aa), r = wa(t), i = Yc(t.converter, e);
18037
+ return lh(n, [ tc(Za(t.firestore), "addDoc", r._key, i, null !== t.converter, {}).toMutation(r._key, $e.exists(!1)) ]).then((function() {
18032
18038
  return r;
18033
18039
  }));
18034
18040
  }
18035
18041
 
18036
- function ch(t) {
18042
+ function hh(t) {
18037
18043
  for (var e, i, o, s = [], u = 1; u < arguments.length; u++) s[u - 1] = arguments[u];
18038
18044
  t = I(t);
18039
18045
  var a = {
18040
18046
  includeMetadataChanges: !1
18041
18047
  }, c = 0;
18042
- "object" != typeof s[c] || Ta(s[c]) || (a = s[c], c++);
18048
+ "object" != typeof s[c] || Ea(s[c]) || (a = s[c], c++);
18043
18049
  var h, f, l, d = {
18044
18050
  includeMetadataChanges: a.includeMetadataChanges
18045
18051
  };
18046
- if (Ta(s[c])) {
18052
+ if (Ea(s[c])) {
18047
18053
  var p = s[c];
18048
18054
  s[c] = null === (e = p.next) || void 0 === e ? void 0 : e.bind(p), s[c + 1] = null === (i = p.error) || void 0 === i ? void 0 : i.bind(p),
18049
18055
  s[c + 2] = null === (o = p.complete) || void 0 === o ? void 0 : o.bind(p);
18050
18056
  }
18051
- if (t instanceof da) f = aa(t.firestore, _a), l = be(t._key.path), h = {
18057
+ if (t instanceof pa) f = ca(t.firestore, Aa), l = be(t._key.path), h = {
18052
18058
  next: function(e) {
18053
- s[c] && s[c](lh(f, t, e));
18059
+ s[c] && s[c](dh(f, t, e));
18054
18060
  },
18055
18061
  error: s[c + 1],
18056
18062
  complete: s[c + 2]
18057
18063
  }; else {
18058
- var y = aa(t, pa);
18059
- f = aa(y.firestore, _a), l = y._query;
18060
- var v = new Zc(f);
18064
+ var y = ca(t, ya);
18065
+ f = ca(y.firestore, Aa), l = y._query;
18066
+ var v = new th(f);
18061
18067
  h = {
18062
18068
  next: function(t) {
18063
- s[c] && s[c](new Sc(f, v, y, t));
18069
+ s[c] && s[c](new _c(f, v, y, t));
18064
18070
  },
18065
18071
  error: s[c + 1],
18066
18072
  complete: s[c + 2]
18067
- }, kc(t._query);
18073
+ }, Dc(t._query);
18068
18074
  }
18069
18075
  return function(t, e, i, o) {
18070
- var s = this, u = new Vu(o), a = new Gs(e, u, i);
18076
+ var s = this, u = new qu(o), a = new zs(e, u, i);
18071
18077
  return t.asyncQueue.enqueueAndForget((function() {
18072
18078
  return n(s, void 0, void 0, (function() {
18073
18079
  var e;
18074
18080
  return r(this, (function(n) {
18075
18081
  switch (n.label) {
18076
18082
  case 0:
18077
- return e = qs, [ 4 /*yield*/ , Xu(t) ];
18083
+ return e = Us, [ 4 /*yield*/ , $u(t) ];
18078
18084
 
18079
18085
  case 1:
18080
18086
  return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), a ]) ];
@@ -18088,7 +18094,7 @@ function ch(t) {
18088
18094
  return r(this, (function(n) {
18089
18095
  switch (n.label) {
18090
18096
  case 0:
18091
- return e = Us, [ 4 /*yield*/ , Xu(t) ];
18097
+ return e = Bs, [ 4 /*yield*/ , $u(t) ];
18092
18098
 
18093
18099
  case 1:
18094
18100
  return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), a ]) ];
@@ -18097,12 +18103,12 @@ function ch(t) {
18097
18103
  }));
18098
18104
  }));
18099
18105
  };
18100
- }(Da(f), l, d, h);
18106
+ }(Na(f), l, d, h);
18101
18107
  }
18102
18108
 
18103
- function hh(t, e) {
18109
+ function fh(t, e) {
18104
18110
  return function(t, e) {
18105
- var i = this, o = new Vu(e);
18111
+ var i = this, o = new qu(e);
18106
18112
  return t.asyncQueue.enqueueAndForget((function() {
18107
18113
  return n(i, void 0, void 0, (function() {
18108
18114
  var e;
@@ -18114,7 +18120,7 @@ function hh(t, e) {
18114
18120
  // Immediately fire an initial event, indicating all existing listeners
18115
18121
  // are in-sync.
18116
18122
  e.next();
18117
- }, [ 4 /*yield*/ , Xu(t) ];
18123
+ }, [ 4 /*yield*/ , $u(t) ];
18118
18124
 
18119
18125
  case 1:
18120
18126
  return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), o ]) ];
@@ -18130,7 +18136,7 @@ function hh(t, e) {
18130
18136
  case 0:
18131
18137
  return e = function(t, e) {
18132
18138
  W(t).io.delete(e);
18133
- }, [ 4 /*yield*/ , Xu(t) ];
18139
+ }, [ 4 /*yield*/ , $u(t) ];
18134
18140
 
18135
18141
  case 1:
18136
18142
  return [ 2 /*return*/ , e.apply(void 0, [ n.sent(), o ]) ];
@@ -18154,7 +18160,7 @@ function hh(t, e) {
18154
18160
  * been committed. For this reason, it is required that all reads are
18155
18161
  * performed before any writes. Transactions must be performed while online.
18156
18162
  */;
18157
- }(Da(t = aa(t, _a)), Ta(e) ? e : {
18163
+ }(Na(t = ca(t, Aa)), Ea(e) ? e : {
18158
18164
  next: e
18159
18165
  });
18160
18166
  }
@@ -18162,7 +18168,7 @@ function hh(t, e) {
18162
18168
  /**
18163
18169
  * Locally writes `mutations` on the async queue.
18164
18170
  * @internal
18165
- */ function fh(t, e) {
18171
+ */ function lh(t, e) {
18166
18172
  return function(t, e) {
18167
18173
  var i = this, o = new J;
18168
18174
  return t.asyncQueue.enqueueAndForget((function() {
@@ -18171,7 +18177,7 @@ function hh(t, e) {
18171
18177
  return r(this, (function(r) {
18172
18178
  switch (r.label) {
18173
18179
  case 0:
18174
- return n = iu, [ 4 /*yield*/ , Ju(t) ];
18180
+ return n = ou, [ 4 /*yield*/ , Xu(t) ];
18175
18181
 
18176
18182
  case 1:
18177
18183
  return [ 2 /*return*/ , n.apply(void 0, [ r.sent(), e, o ]) ];
@@ -18179,15 +18185,15 @@ function hh(t, e) {
18179
18185
  }));
18180
18186
  }));
18181
18187
  })), o.promise;
18182
- }(Da(t), e);
18188
+ }(Na(t), e);
18183
18189
  }
18184
18190
 
18185
18191
  /**
18186
18192
  * Converts a {@link ViewSnapshot} that contains the single document specified by `ref`
18187
18193
  * to a {@link DocumentSnapshot}.
18188
- */ function lh(t, e, n) {
18189
- var r = n.docs.get(e._key), i = new Zc(t);
18190
- return new Tc(t, i, e._key, r, new Ic(n.hasPendingWrites, n.fromCache), e.converter);
18194
+ */ function dh(t, e, n) {
18195
+ var r = n.docs.get(e._key), i = new th(t);
18196
+ return new Ec(t, i, e._key, r, new Tc(n.hasPendingWrites, n.fromCache), e.converter);
18191
18197
  }
18192
18198
 
18193
18199
  /**
@@ -18212,7 +18218,7 @@ function hh(t, e) {
18212
18218
  * The `Transaction` object passed to a transaction's `updateFunction` provides
18213
18219
  * the methods to read and write data within the transaction context. See
18214
18220
  * {@link runTransaction}.
18215
- */ var dh = /** @class */ function(e) {
18221
+ */ var ph = /** @class */ function(e) {
18216
18222
  // This class implements the same logic as the Transaction API in the Lite SDK
18217
18223
  // but is subclassed in order to return its own DocumentSnapshot types.
18218
18224
  /** @hideconstructor */
@@ -18226,9 +18232,9 @@ function hh(t, e) {
18226
18232
  * @param documentRef - A reference to the document to be read.
18227
18233
  * @returns A `DocumentSnapshot` with the read data.
18228
18234
  */ return t(n, e), n.prototype.get = function(t) {
18229
- var n = this, r = Xc(t, this._firestore), i = new Zc(this._firestore);
18235
+ var n = this, r = $c(t, this._firestore), i = new th(this._firestore);
18230
18236
  return e.prototype.get.call(this, t).then((function(t) {
18231
- return new Tc(n._firestore, i, r._key, t._document, new Ic(
18237
+ return new Ec(n._firestore, i, r._key, t._document, new Tc(
18232
18238
  /* hasPendingWrites= */ !1,
18233
18239
  /* fromCache= */ !1), r.converter);
18234
18240
  }));
@@ -18236,7 +18242,7 @@ function hh(t, e) {
18236
18242
  }(/** @class */ function() {
18237
18243
  /** @hideconstructor */
18238
18244
  function t(t, e) {
18239
- this._firestore = t, this._transaction = e, this._dataReader = $a(t)
18245
+ this._firestore = t, this._transaction = e, this._dataReader = Za(t)
18240
18246
  /**
18241
18247
  * Reads the document referenced by the provided {@link DocumentReference}.
18242
18248
  *
@@ -18245,23 +18251,23 @@ function hh(t, e) {
18245
18251
  */;
18246
18252
  }
18247
18253
  return t.prototype.get = function(t) {
18248
- var e = this, n = Xc(t, this._firestore), r = new Yc(this._firestore);
18254
+ var e = this, n = $c(t, this._firestore), r = new Jc(this._firestore);
18249
18255
  return this._transaction.lookup([ n._key ]).then((function(t) {
18250
18256
  if (!t || 1 !== t.length) return G();
18251
18257
  var i = t[0];
18252
- if (i.isFoundDocument()) return new gc(e._firestore, r, i.key, i, n.converter);
18253
- if (i.isNoDocument()) return new gc(e._firestore, r, n._key, null, n.converter);
18258
+ if (i.isFoundDocument()) return new wc(e._firestore, r, i.key, i, n.converter);
18259
+ if (i.isNoDocument()) return new wc(e._firestore, r, n._key, null, n.converter);
18254
18260
  throw G();
18255
18261
  }));
18256
18262
  }, t.prototype.set = function(t, e, n) {
18257
- var r = Xc(t, this._firestore), i = Hc(r.converter, e, n), o = Za(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
18263
+ var r = $c(t, this._firestore), i = Yc(r.converter, e, n), o = tc(this._dataReader, "Transaction.set", r._key, i, null !== r.converter, n);
18258
18264
  return this._transaction.set(r._key, o), this;
18259
18265
  }, t.prototype.update = function(t, e, n) {
18260
18266
  for (var r = [], i = 3; i < arguments.length; i++) r[i - 3] = arguments[i];
18261
- var o, s = Xc(t, this._firestore);
18267
+ var o, s = $c(t, this._firestore);
18262
18268
  // For Compat types, we have to "extract" the underlying types before
18263
18269
  // performing validation.
18264
- return o = "string" == typeof (e = I(e)) || e instanceof Ba ? uc(this._dataReader, "Transaction.update", s._key, e, n, r) : sc(this._dataReader, "Transaction.update", s._key, e),
18270
+ return o = "string" == typeof (e = I(e)) || e instanceof ja ? ac(this._dataReader, "Transaction.update", s._key, e, n, r) : uc(this._dataReader, "Transaction.update", s._key, e),
18265
18271
  this._transaction.update(s._key, o), this;
18266
18272
  },
18267
18273
  /**
@@ -18271,7 +18277,7 @@ function hh(t, e) {
18271
18277
  * @returns This `Transaction` instance. Used for chaining method calls.
18272
18278
  */
18273
18279
  t.prototype.delete = function(t) {
18274
- var e = Xc(t, this._firestore);
18280
+ var e = $c(t, this._firestore);
18275
18281
  return this._transaction.delete(e._key), this;
18276
18282
  }, t;
18277
18283
  }());
@@ -18292,7 +18298,7 @@ function hh(t, e) {
18292
18298
  * (the `updateFunction` returned a failed promise), the promise returned by the
18293
18299
  * `updateFunction `is returned here. Otherwise, if the transaction failed, a
18294
18300
  * rejected promise with the corresponding failure error is returned.
18295
- */ function ph(t, e) {
18301
+ */ function yh(t, e) {
18296
18302
  return function(t, e) {
18297
18303
  var i = this, o = new J;
18298
18304
  return t.asyncQueue.enqueueAndForget((function() {
@@ -18302,19 +18308,19 @@ function hh(t, e) {
18302
18308
  switch (r.label) {
18303
18309
  case 0:
18304
18310
  return [ 4 /*yield*/ , function(t) {
18305
- return Qu(t).then((function(t) {
18311
+ return Wu(t).then((function(t) {
18306
18312
  return t.datastore;
18307
18313
  }));
18308
18314
  }(t) ];
18309
18315
 
18310
18316
  case 1:
18311
- return n = r.sent(), new Bu(t.asyncQueue, n, e, o).run(), [ 2 /*return*/ ];
18317
+ return n = r.sent(), new ju(t.asyncQueue, n, e, o).run(), [ 2 /*return*/ ];
18312
18318
  }
18313
18319
  }));
18314
18320
  }));
18315
18321
  })), o.promise;
18316
- }(Da(t = aa(t, _a)), (function(n) {
18317
- return e(new dh(t, n));
18322
+ }(Na(t = ca(t, Aa)), (function(n) {
18323
+ return e(new ph(t, n));
18318
18324
  }));
18319
18325
  }
18320
18326
 
@@ -18337,15 +18343,15 @@ function hh(t, e) {
18337
18343
  /**
18338
18344
  * Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
18339
18345
  * {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
18340
- */ function yh() {
18341
- return new tc("deleteField");
18346
+ */ function vh() {
18347
+ return new ec("deleteField");
18342
18348
  }
18343
18349
 
18344
18350
  /**
18345
18351
  * Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
18346
18352
  * include a server-generated timestamp in the written data.
18347
- */ function vh() {
18348
- return new nc("serverTimestamp");
18353
+ */ function mh() {
18354
+ return new rc("serverTimestamp");
18349
18355
  }
18350
18356
 
18351
18357
  /**
@@ -18359,11 +18365,11 @@ function hh(t, e) {
18359
18365
  * @param elements - The elements to union into the array.
18360
18366
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
18361
18367
  * `updateDoc()`.
18362
- */ function mh() {
18368
+ */ function gh() {
18363
18369
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
18364
18370
  // NOTE: We don't actually parse the data until it's used in set() or
18365
18371
  // update() since we'd need the Firestore instance to do this.
18366
- return new rc("arrayUnion", t);
18372
+ return new ic("arrayUnion", t);
18367
18373
  }
18368
18374
 
18369
18375
  /**
@@ -18376,11 +18382,11 @@ function hh(t, e) {
18376
18382
  * @param elements - The elements to remove from the array.
18377
18383
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
18378
18384
  * `updateDoc()`
18379
- */ function gh() {
18385
+ */ function wh() {
18380
18386
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
18381
18387
  // NOTE: We don't actually parse the data until it's used in set() or
18382
18388
  // update() since we'd need the Firestore instance to do this.
18383
- return new ic("arrayRemove", t);
18389
+ return new oc("arrayRemove", t);
18384
18390
  }
18385
18391
 
18386
18392
  /**
@@ -18401,8 +18407,8 @@ function hh(t, e) {
18401
18407
  * @param n - The value to increment by.
18402
18408
  * @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
18403
18409
  * `updateDoc()`
18404
- */ function wh(t) {
18405
- return new oc("increment", t);
18410
+ */ function bh(t) {
18411
+ return new sc("increment", t);
18406
18412
  }
18407
18413
 
18408
18414
  /**
@@ -18431,14 +18437,14 @@ function hh(t, e) {
18431
18437
  *
18432
18438
  * @returns A {@link WriteBatch} that can be used to atomically execute multiple
18433
18439
  * writes.
18434
- */ function bh(t) {
18435
- return Da(t = aa(t, _a)), new Jc(t, (function(e) {
18436
- return fh(t, e);
18440
+ */ function Ih(t) {
18441
+ return Na(t = ca(t, Aa)), new Xc(t, (function(e) {
18442
+ return lh(t, e);
18437
18443
  }))
18438
18444
  /** An index component consisting of field path and index type. */;
18439
18445
  }
18440
18446
 
18441
- var Ih, Th = function(
18447
+ var Th, Eh = function(
18442
18448
  /** The field path of the component. */
18443
18449
  t,
18444
18450
  /** The fields sorting order. */
@@ -18461,8 +18467,8 @@ e) {
18461
18467
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18462
18468
  * See the License for the specific language governing permissions and
18463
18469
  * limitations under the License.
18464
- */ function Eh(t, e) {
18465
- Da(t = aa(t, _a));
18470
+ */ function Sh(t, e) {
18471
+ Na(t = ca(t, Aa));
18466
18472
  var n = "string" == typeof e ? function(t) {
18467
18473
  try {
18468
18474
  return JSON.parse(t);
@@ -18474,18 +18480,18 @@ e) {
18474
18480
  // persistence since `enableIndexeddbPersistence()` can fail on the Web.
18475
18481
  if (Array.isArray(n.indexes)) for (var r = 0, i = n.indexes; r < i.length; r++) {
18476
18482
  var o = i[r];
18477
- Sh(o, "collectionGroup");
18483
+ _h(o, "collectionGroup");
18478
18484
  var s = [];
18479
18485
  if (Array.isArray(o.fields)) for (var u = 0, a = o.fields; u < a.length; u++) {
18480
- var c = a[u], h = yc("setIndexConfiguration", Sh(c, "fieldPath"));
18481
- "CONTAINS" === c.arrayConfig ? s.push(new Th(h, 2 /* CONTAINS */)) : "ASCENDING" === c.order ? s.push(new Th(h, 0 /* ASCENDING */)) : "DESCENDING" === c.order && s.push(new Th(h, 1 /* DESCENDING */));
18486
+ var c = a[u], h = vc("setIndexConfiguration", _h(c, "fieldPath"));
18487
+ "CONTAINS" === c.arrayConfig ? s.push(new Eh(h, 2 /* CONTAINS */)) : "ASCENDING" === c.order ? s.push(new Eh(h, 0 /* ASCENDING */)) : "DESCENDING" === c.order && s.push(new Eh(h, 1 /* DESCENDING */));
18482
18488
  }
18483
18489
  }
18484
18490
  // TODO(indexing): Configure indexes
18485
18491
  return Promise.resolve();
18486
18492
  }
18487
18493
 
18488
- function Sh(t, e) {
18494
+ function _h(t, e) {
18489
18495
  if ("string" != typeof t[e]) throw new Y(H.INVALID_ARGUMENT, "Missing string value for: " + e);
18490
18496
  return t[e];
18491
18497
  }
@@ -18494,14 +18500,14 @@ function Sh(t, e) {
18494
18500
  * Cloud Firestore
18495
18501
  *
18496
18502
  * @packageDocumentation
18497
- */ void 0 === Ih && (Ih = !0), M = i, o(new c("firestore", (function(t, e) {
18498
- var n = e.options, r = t.getProvider("app").getImmediate(), i = new _a(r, new tt(t.getProvider("auth-internal")), new it(t.getProvider("app-check-internal")));
18503
+ */ void 0 === Th && (Th = !0), M = i, o(new c("firestore", (function(t, e) {
18504
+ var n = e.options, r = t.getProvider("app").getImmediate(), i = new Aa(r, new tt(t.getProvider("auth-internal")), new it(t.getProvider("app-check-internal")));
18499
18505
  return n = Object.assign({
18500
- useFetchStreams: Ih
18506
+ useFetchStreams: Th
18501
18507
  }, n), i._setSettings(n), i;
18502
- }), "PUBLIC")), s(P, "3.4.3-canary.4983f4d5a", void 0),
18508
+ }), "PUBLIC")), s(P, "3.4.3-canary.73fcec982", void 0),
18503
18509
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
18504
- s(P, "3.4.3-canary.4983f4d5a", "esm5");
18510
+ s(P, "3.4.3-canary.73fcec982", "esm5");
18505
18511
 
18506
- export { Wc as AbstractUserDataWriter, Ka as Bytes, Sa as CACHE_SIZE_UNLIMITED, ya as CollectionReference, da as DocumentReference, Tc as DocumentSnapshot, Ba as FieldPath, Ga as FieldValue, _a as Firestore, Y as FirestoreError, za as GeoPoint, Ea as LoadBundleTask, pa as Query, Dc as QueryConstraint, Ec as QueryDocumentSnapshot, Sc as QuerySnapshot, Ic as SnapshotMetadata, lt as Timestamp, dh as Transaction, Jc as WriteBatch, ea as _DatabaseId, Pt as _DocumentKey, ot as _EmptyAppCheckTokenProvider, $ as _EmptyAuthCredentialsProvider, bt as _FieldPath, aa as _cast, Q as _debugAssert, Tt as _isBase64Available, j as _logWarn, Eh as _setIndexConfiguration, ia as _validateIsNotUsedTogether, ah as addDoc, gh as arrayRemove, mh as arrayUnion, La as clearIndexedDbPersistence, va as collection, ma as collectionGroup, la as connectFirestoreEmulator, uh as deleteDoc, yh as deleteField, Ma as disableNetwork, ga as doc, ja as documentId, Ca as enableIndexedDbPersistence, xa as enableMultiTabIndexedDbPersistence, Oa as enableNetwork, jc as endAt, Bc as endBefore, Da as ensureFirestoreConfigured, fh as executeWrite, $c as getDoc, th as getDocFromCache, eh as getDocFromServer, nh as getDocs, rh as getDocsFromCache, ih as getDocsFromServer, ka as getFirestore, wh as increment, Aa as initializeFirestore, Oc as limit, Mc as limitToLast, Va as loadBundle, qa as namedQuery, ch as onSnapshot, hh as onSnapshotsInSync, Lc as orderBy, Nc as query, ba as queryEqual, wa as refEqual, ph as runTransaction, vh as serverTimestamp, oh as setDoc, q as setLogLevel, Ac as snapshotEqual, qc as startAfter, Vc as startAt, Fa as terminate, sh as updateDoc, Pa as waitForPendingWrites, xc as where, bh as writeBatch };
18512
+ export { Hc as AbstractUserDataWriter, Ga as Bytes, _a as CACHE_SIZE_UNLIMITED, va as CollectionReference, pa as DocumentReference, Ec as DocumentSnapshot, ja as FieldPath, za as FieldValue, Aa as Firestore, Y as FirestoreError, Qa as GeoPoint, Sa as LoadBundleTask, ya as Query, Nc as QueryConstraint, Sc as QueryDocumentSnapshot, _c as QuerySnapshot, Tc as SnapshotMetadata, lt as Timestamp, ph as Transaction, Xc as WriteBatch, na as _DatabaseId, Pt as _DocumentKey, ot as _EmptyAppCheckTokenProvider, $ as _EmptyAuthCredentialsProvider, bt as _FieldPath, ca as _cast, Q as _debugAssert, Tt as _isBase64Available, j as _logWarn, Sh as _setIndexConfiguration, oa as _validateIsNotUsedTogether, ch as addDoc, wh as arrayRemove, gh as arrayUnion, Pa as clearIndexedDbPersistence, ma as collection, ga as collectionGroup, da as connectFirestoreEmulator, ah as deleteDoc, vh as deleteField, Fa as disableNetwork, wa as doc, Ka as documentId, xa as enableIndexedDbPersistence, Ra as enableMultiTabIndexedDbPersistence, Ma as enableNetwork, Kc as endAt, jc as endBefore, Na as ensureFirestoreConfigured, lh as executeWrite, Zc as getDoc, eh as getDocFromCache, nh as getDocFromServer, rh as getDocs, ih as getDocsFromCache, oh as getDocsFromServer, Da as getFirestore, bh as increment, ka as initializeFirestore, Mc as limit, Fc as limitToLast, qa as loadBundle, Ua as namedQuery, hh as onSnapshot, fh as onSnapshotsInSync, Pc as orderBy, Cc as query, Ia as queryEqual, ba as refEqual, yh as runTransaction, mh as serverTimestamp, sh as setDoc, q as setLogLevel, kc as snapshotEqual, Uc as startAfter, qc as startAt, Va as terminate, uh as updateDoc, Oa as waitForPendingWrites, Rc as where, Ih as writeBatch };
18507
18513
  //# sourceMappingURL=index.esm5.js.map