@firebase/firestore 3.0.2-canary.ba9cba4e3 → 3.0.2-canary.dfe65ff9b

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.
package/dist/index.rn.js CHANGED
@@ -2,9 +2,9 @@ import { _getProvider, getApp as t, _removeServiceInstance as e, _registerCompon
2
2
 
3
3
  import { Component as r } from "@firebase/component";
4
4
 
5
- import { Logger as o, LogLevel as a } from "@firebase/logger";
5
+ import { Logger as o, LogLevel as c } from "@firebase/logger";
6
6
 
7
- import { base64 as c, getUA as u, isIndexedDBAvailable as h, isSafari as l, isMobileCordova as f, isReactNative as d, isElectron as w, isIE as _, isUWP as m, isBrowserExtension as g, createMockUserToken as y, getModularInstance as p, deepEqual as E } from "@firebase/util";
7
+ import { base64 as a, getUA as u, isIndexedDBAvailable as h, isSafari as l, isMobileCordova as f, isReactNative as d, isElectron as w, isIE as _, isUWP as m, isBrowserExtension as g, createMockUserToken as y, getModularInstance as p, deepEqual as E } from "@firebase/util";
8
8
 
9
9
  import { XhrIo as T, EventType as I, ErrorCode as A, createWebChannelTransport as R, getStatEventTarget as b, FetchXmlHttpFactory as P, WebChannel as v, Event as V, Stat as S } from "@firebase/webchannel-wrapper";
10
10
 
@@ -68,7 +68,7 @@ D.MOCK_USER = new D("mock-user");
68
68
  * See the License for the specific language governing permissions and
69
69
  * limitations under the License.
70
70
  */
71
- let C = "9.0.2-canary.ba9cba4e3";
71
+ let C = "9.0.2-canary.dfe65ff9b";
72
72
 
73
73
  /**
74
74
  * @license
@@ -110,14 +110,14 @@ function x() {
110
110
  }
111
111
 
112
112
  function $(t, ...e) {
113
- if (N.logLevel <= a.DEBUG) {
113
+ if (N.logLevel <= c.DEBUG) {
114
114
  const n = e.map(M);
115
115
  N.debug(`Firestore (${C}): ${t}`, ...n);
116
116
  }
117
117
  }
118
118
 
119
119
  function O(t, ...e) {
120
- if (N.logLevel <= a.ERROR) {
120
+ if (N.logLevel <= c.ERROR) {
121
121
  const n = e.map(M);
122
122
  N.error(`Firestore (${C}): ${t}`, ...n);
123
123
  }
@@ -126,7 +126,7 @@ function O(t, ...e) {
126
126
  /**
127
127
  * @internal
128
128
  */ function F(t, ...e) {
129
- if (N.logLevel <= a.WARN) {
129
+ if (N.logLevel <= c.WARN) {
130
130
  const n = e.map(M);
131
131
  N.warn(`Firestore (${C}): ${t}`, ...n);
132
132
  }
@@ -906,11 +906,11 @@ class it {
906
906
  return e;
907
907
  }
908
908
 
909
- function at(t, e) {
909
+ function ct(t, e) {
910
910
  for (const n in t) Object.prototype.hasOwnProperty.call(t, n) && e(n, t[n]);
911
911
  }
912
912
 
913
- function ct(t) {
913
+ function at(t) {
914
914
  for (const e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1;
915
915
  return !0;
916
916
  }
@@ -1174,7 +1174,7 @@ function wt(t) {
1174
1174
  // We use `decodeStringToByteArray()` instead of `decodeString()` since
1175
1175
  // `decodeString()` returns Unicode strings, which doesn't match the values
1176
1176
  // returned by `atob()`'s Latin1 representation.
1177
- c.decodeStringToByteArray(t, false));
1177
+ a.decodeStringToByteArray(t, false));
1178
1178
  }
1179
1179
 
1180
1180
  /** Converts a binary string to a Base64 encoded string. */
@@ -1234,7 +1234,7 @@ function _t() {
1234
1234
  return function(t) {
1235
1235
  const e = [];
1236
1236
  for (let n = 0; n < t.length; n++) e[n] = t.charCodeAt(n);
1237
- return c.encodeByteArray(e, !1);
1237
+ return a.encodeByteArray(e, !1);
1238
1238
  }(this.binaryString);
1239
1239
  }
1240
1240
  toUint8Array() {
@@ -1716,7 +1716,7 @@ function Ft(t) {
1716
1716
  fields: {}
1717
1717
  }
1718
1718
  };
1719
- return at(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = Ut(n))), e;
1719
+ return ct(t.mapValue.fields, ((t, n) => e.mapValue.fields[t] = Ut(n))), e;
1720
1720
  }
1721
1721
  if (t.arrayValue) {
1722
1722
  const e = {
@@ -1831,7 +1831,7 @@ function Ft(t) {
1831
1831
  * Modifies `fieldsMap` by adding, replacing or deleting the specified
1832
1832
  * entries.
1833
1833
  */ applyChanges(t, e, n) {
1834
- at(e, ((e, n) => t[e] = n));
1834
+ ct(e, ((e, n) => t[e] = n));
1835
1835
  for (const e of n) delete t[e];
1836
1836
  }
1837
1837
  clone() {
@@ -1843,7 +1843,7 @@ function Ft(t) {
1843
1843
  * Returns a FieldMask built from all fields in a MapValue.
1844
1844
  */ function Kt(t) {
1845
1845
  const e = [];
1846
- return at(t.fields, ((t, n) => {
1846
+ return ct(t.fields, ((t, n) => {
1847
1847
  const s = new ft([ t ]);
1848
1848
  if (Bt(n)) {
1849
1849
  const t = Kt(n.mapValue).fields;
@@ -2019,7 +2019,7 @@ function Gt(t) {
2019
2019
  // TODO(b/29183165): Make this collision robust.
2020
2020
  return t.field.canonicalString() + t.dir;
2021
2021
  }(t))).join(","), Rt(e.limit) || (t += "|l:", t += e.limit), e.startAt && (t += "|lb:",
2022
- t += ce(e.startAt)), e.endAt && (t += "|ub:", t += ce(e.endAt)), e.A = t;
2022
+ t += ae(e.startAt)), e.endAt && (t += "|ub:", t += ae(e.endAt)), e.A = t;
2023
2023
  }
2024
2024
  return e.A;
2025
2025
  }
@@ -2034,7 +2034,7 @@ function zt(t) {
2034
2034
  /** Filter that matches on key fields (i.e. '__name__'). */ })).join(", ")}]`),
2035
2035
  Rt(t.limit) || (e += ", limit: " + t.limit), t.orderBy.length > 0 && (e += `, orderBy: [${t.orderBy.map((t => function(t) {
2036
2036
  return `${t.field.canonicalString()} (${t.dir})`;
2037
- }(t))).join(", ")}]`), t.startAt && (e += ", startAt: " + ce(t.startAt)), t.endAt && (e += ", endAt: " + ce(t.endAt)),
2037
+ }(t))).join(", ")}]`), t.startAt && (e += ", startAt: " + ae(t.startAt)), t.endAt && (e += ", endAt: " + ae(t.endAt)),
2038
2038
  `Target(${e})`;
2039
2039
  }
2040
2040
 
@@ -2196,13 +2196,13 @@ function ne(t, e) {
2196
2196
  * Bound provides a function to determine whether a document comes before or
2197
2197
  * after a bound. This is influenced by whether the position is just before or
2198
2198
  * just after the provided values.
2199
- */ class ae {
2199
+ */ class ce {
2200
2200
  constructor(t, e) {
2201
2201
  this.position = t, this.before = e;
2202
2202
  }
2203
2203
  }
2204
2204
 
2205
- function ce(t) {
2205
+ function ae(t) {
2206
2206
  // TODO(b/29183165): Make this collision robust.
2207
2207
  return `${t.before ? "b" : "a"}:${t.position.map((t => xt(t))).join(",")}`;
2208
2208
  }
@@ -2271,16 +2271,16 @@ function fe(t, e) {
2271
2271
  * Initializes a Query with a path and optional additional query constraints.
2272
2272
  * Path must currently be empty if this is a collection group query.
2273
2273
  */
2274
- constructor(t, e = null, n = [], s = [], i = null, r = "F" /* First */ , o = null, a = null) {
2274
+ constructor(t, e = null, n = [], s = [], i = null, r = "F" /* First */ , o = null, c = null) {
2275
2275
  this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = s,
2276
- this.limit = i, this.limitType = r, this.startAt = o, this.endAt = a, this.V = null,
2276
+ this.limit = i, this.limitType = r, this.startAt = o, this.endAt = c, this.V = null,
2277
2277
  // The corresponding `Target` of this `Query` instance.
2278
2278
  this.S = null, this.startAt, this.endAt;
2279
2279
  }
2280
2280
  }
2281
2281
 
2282
- /** Creates a new Query instance with the options provided. */ function we(t, e, n, s, i, r, o, a) {
2283
- return new de(t, e, n, s, i, r, o, a);
2282
+ /** Creates a new Query instance with the options provided. */ function we(t, e, n, s, i, r, o, c) {
2283
+ return new de(t, e, n, s, i, r, o, c);
2284
2284
  }
2285
2285
 
2286
2286
  /** Creates a new Query for a query that matches all documents at `path` */ function _e(t) {
@@ -2360,7 +2360,7 @@ function Ee(t) {
2360
2360
  t.push(new ue(n.field, e));
2361
2361
  }
2362
2362
  // We need to swap the cursors to match the now-flipped query ordering.
2363
- const n = e.endAt ? new ae(e.endAt.position, !e.endAt.before) : null, s = e.startAt ? new ae(e.startAt.position, !e.startAt.before) : null;
2363
+ const n = e.endAt ? new ce(e.endAt.position, !e.endAt.before) : null, s = e.startAt ? new ce(e.startAt.position, !e.startAt.before) : null;
2364
2364
  // Now return as a LimitType.First query.
2365
2365
  e.S = Wt(e.path, e.collectionGroup, t, e.filters, e.limit, n, s);
2366
2366
  }
@@ -2817,7 +2817,7 @@ class Ge {
2817
2817
  // The mutation failed to apply (e.g. a document ID created with add()
2818
2818
  // caused a name collision).
2819
2819
  return;
2820
- const s = t.value.clone(), i = an(t.fieldTransforms, n, e);
2820
+ const s = t.value.clone(), i = cn(t.fieldTransforms, n, e);
2821
2821
  s.setAll(i), e.convertToFoundDocument(en(e), s).setHasLocalMutations();
2822
2822
  }
2823
2823
  /**
@@ -2834,7 +2834,7 @@ class Ge {
2834
2834
  * ignored.
2835
2835
  */ (t, e, n) : t instanceof sn ? function(t, e, n) {
2836
2836
  if (!He(t.precondition, e)) return;
2837
- const s = an(t.fieldTransforms, n, e), i = e.data;
2837
+ const s = cn(t.fieldTransforms, n, e), i = e.data;
2838
2838
  i.setAll(rn(t)), i.setAll(s), e.convertToFoundDocument(en(e), i).setHasLocalMutations();
2839
2839
  }
2840
2840
  /**
@@ -2934,8 +2934,8 @@ function rn(t) {
2934
2934
  const s = new Map;
2935
2935
  B(t.length === n.length);
2936
2936
  for (let i = 0; i < n.length; i++) {
2937
- const r = t[i], o = r.transform, a = e.data.field(r.field);
2938
- s.set(r.field, $e(o, a, n[i]));
2937
+ const r = t[i], o = r.transform, c = e.data.field(r.field);
2938
+ s.set(r.field, $e(o, c, n[i]));
2939
2939
  }
2940
2940
  return s;
2941
2941
  }
@@ -2951,7 +2951,7 @@ function rn(t) {
2951
2951
  * @param mutableDocument - The current state of the document after applying all
2952
2952
  * previous mutations.
2953
2953
  * @returns The transform results list.
2954
- */ function an(t, e, n) {
2954
+ */ function cn(t, e, n) {
2955
2955
  const s = new Map;
2956
2956
  for (const i of t) {
2957
2957
  const t = i.transform, r = n.data.field(i.field);
@@ -2960,7 +2960,7 @@ function rn(t) {
2960
2960
  return s;
2961
2961
  }
2962
2962
 
2963
- /** A mutation that deletes the document at the given key. */ class cn extends Je {
2963
+ /** A mutation that deletes the document at the given key. */ class an extends Je {
2964
2964
  constructor(t, e) {
2965
2965
  super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];
2966
2966
  }
@@ -3951,10 +3951,10 @@ class On {
3951
3951
  /**
3952
3952
  * Processes and adds the DocumentWatchChange to the current set of changes.
3953
3953
  */ rt(t) {
3954
- for (const e of t.k) t.$ && t.$.isFoundDocument() ? this.ot(e, t.$) : this.at(e, t.key, t.$);
3955
- for (const e of t.removedTargetIds) this.at(e, t.key, t.$);
3954
+ for (const e of t.k) t.$ && t.$.isFoundDocument() ? this.ot(e, t.$) : this.ct(e, t.key, t.$);
3955
+ for (const e of t.removedTargetIds) this.ct(e, t.key, t.$);
3956
3956
  }
3957
- /** Processes and adds the WatchTargetChange to the current set of changes. */ ct(t) {
3957
+ /** Processes and adds the WatchTargetChange to the current set of changes. */ at(t) {
3958
3958
  this.forEachTarget(t, (e => {
3959
3959
  const n = this.ut(e);
3960
3960
  switch (t.state) {
@@ -4022,7 +4022,7 @@ class On {
4022
4022
  // until it is resolved, essentially exposing inconsistency between
4023
4023
  // queries.
4024
4024
  const n = new vt(t.path);
4025
- this.at(e, n, jt.newNoDocument(n, rt.min()));
4025
+ this.ct(e, n, jt.newNoDocument(n, rt.min()));
4026
4026
  } else B(1 === n); else {
4027
4027
  this.wt(e) !== n && (
4028
4028
  // Existence filter mismatch: We reset the mapping and raise a new
@@ -4049,7 +4049,7 @@ class On {
4049
4049
  // instead resulting in an explicit delete message and we could
4050
4050
  // remove this special logic.
4051
4051
  const e = new vt(i.target.path);
4052
- null !== this.nt.get(e) || this.gt(s, e) || this.at(s, e, jt.newNoDocument(e, t));
4052
+ null !== this.nt.get(e) || this.gt(s, e) || this.ct(s, e, jt.newNoDocument(e, t));
4053
4053
  }
4054
4054
  n.K && (e.set(s, n.W()), n.G());
4055
4055
  }
@@ -4088,7 +4088,7 @@ class On {
4088
4088
  * to update the remote document cache.
4089
4089
  */
4090
4090
  // Visible for testing.
4091
- at(t, e, n) {
4091
+ ct(t, e, n) {
4092
4092
  if (!this.ht(t)) return;
4093
4093
  const s = this.ut(t);
4094
4094
  this.gt(t, e) ? s.H(e, 1 /* Removed */) :
@@ -4143,7 +4143,7 @@ class On {
4143
4143
  */ lt(t) {
4144
4144
  this.et.set(t, new $n);
4145
4145
  this.tt.getRemoteKeysForTarget(t).forEach((e => {
4146
- this.at(t, e, /*updatedDocument=*/ null);
4146
+ this.ct(t, e, /*updatedDocument=*/ null);
4147
4147
  }));
4148
4148
  }
4149
4149
  /**
@@ -4340,7 +4340,7 @@ function ss(t, e) {
4340
4340
  }(e.targetChange.targetChangeType || "NO_CHANGE"), i = e.targetChange.targetIds || [], r = function(t, e) {
4341
4341
  return t.D ? (B(void 0 === e || "string" == typeof e), mt.fromBase64String(e || "")) : (B(void 0 === e || e instanceof Uint8Array),
4342
4342
  mt.fromUint8Array(e || new Uint8Array));
4343
- }(t, e.targetChange.resumeToken), o = e.targetChange.cause, a = o && function(t) {
4343
+ }(t, e.targetChange.resumeToken), o = e.targetChange.cause, c = o && function(t) {
4344
4344
  const e = void 0 === t.code ? K.UNKNOWN : wn(t.code);
4345
4345
  return new j(e, t.message || "");
4346
4346
  }
@@ -4352,7 +4352,7 @@ function ss(t, e) {
4352
4352
  * our generated proto interfaces say Int32Value must be. But GRPC actually
4353
4353
  * expects a { value: <number> } struct.
4354
4354
  */ (o);
4355
- n = new kn(s, i, r, a || null);
4355
+ n = new kn(s, i, r, c || null);
4356
4356
  } else if ("documentChange" in e) {
4357
4357
  e.documentChange;
4358
4358
  const s = e.documentChange;
@@ -4361,14 +4361,14 @@ function ss(t, e) {
4361
4361
  mapValue: {
4362
4362
  fields: s.document.fields
4363
4363
  }
4364
- }), a = jt.newFoundDocument(i, r, o), c = s.targetIds || [], u = s.removedTargetIds || [];
4365
- n = new Nn(c, u, a.key, a);
4364
+ }), c = jt.newFoundDocument(i, r, o), a = s.targetIds || [], u = s.removedTargetIds || [];
4365
+ n = new Nn(a, u, c.key, c);
4366
4366
  } else if ("documentDelete" in e) {
4367
4367
  e.documentDelete;
4368
4368
  const s = e.documentDelete;
4369
4369
  s.document;
4370
- const i = Hn(t, s.document), r = s.readTime ? Qn(s.readTime) : rt.min(), o = jt.newNoDocument(i, r), a = s.removedTargetIds || [];
4371
- n = new Nn([], a, o.key, o);
4370
+ const i = Hn(t, s.document), r = s.readTime ? Qn(s.readTime) : rt.min(), o = jt.newNoDocument(i, r), c = s.removedTargetIds || [];
4371
+ n = new Nn([], c, o.key, o);
4372
4372
  } else if ("documentRemove" in e) {
4373
4373
  e.documentRemove;
4374
4374
  const s = e.documentRemove;
@@ -4392,7 +4392,7 @@ function is(t, e) {
4392
4392
  let n;
4393
4393
  if (e instanceof nn) n = {
4394
4394
  update: ts(t, e.key, e.value)
4395
- }; else if (e instanceof cn) n = {
4395
+ }; else if (e instanceof an) n = {
4396
4396
  delete: zn(t, e.key)
4397
4397
  }; else if (e instanceof sn) n = {
4398
4398
  update: ts(t, e.key, e.data),
@@ -4468,7 +4468,7 @@ function rs(t, e) {
4468
4468
  }
4469
4469
  if (e.delete) {
4470
4470
  const s = Hn(t, e.delete);
4471
- return new cn(s, n);
4471
+ return new an(s, n);
4472
4472
  }
4473
4473
  if (e.verify) {
4474
4474
  const s = Hn(t, e.verify);
@@ -4491,13 +4491,13 @@ function os(t, e) {
4491
4491
  }(t, e)))) : [];
4492
4492
  }
4493
4493
 
4494
- function as(t, e) {
4494
+ function cs(t, e) {
4495
4495
  return {
4496
4496
  documents: [ Jn(t, e.path) ]
4497
4497
  };
4498
4498
  }
4499
4499
 
4500
- function cs(t, e) {
4500
+ function as(t, e) {
4501
4501
  // Dissect the path into parent, collectionId, and optional key filter.
4502
4502
  const n = {
4503
4503
  structuredQuery: {}
@@ -4611,15 +4611,15 @@ function us(t) {
4611
4611
  // visible for testing
4612
4612
  (t.direction));
4613
4613
  }(t))));
4614
- let a = null;
4615
- n.limit && (a = function(t) {
4614
+ let c = null;
4615
+ n.limit && (c = function(t) {
4616
4616
  let e;
4617
4617
  return e = "object" == typeof t ? t.value : t, Rt(e) ? null : e;
4618
4618
  }(n.limit));
4619
- let c = null;
4620
- n.startAt && (c = ds(n.startAt));
4619
+ let a = null;
4620
+ n.startAt && (a = ds(n.startAt));
4621
4621
  let u = null;
4622
- return n.endAt && (u = ds(n.endAt)), we(e, i, o, r, a, "F" /* First */ , c, u);
4622
+ return n.endAt && (u = ds(n.endAt)), we(e, i, o, r, c, "F" /* First */ , a, u);
4623
4623
  }
4624
4624
 
4625
4625
  function hs(t, e) {
@@ -4656,7 +4656,7 @@ function fs(t) {
4656
4656
 
4657
4657
  function ds(t) {
4658
4658
  const e = !!t.before, n = t.values || [];
4659
- return new ae(n, e);
4659
+ return new ce(n, e);
4660
4660
  }
4661
4661
 
4662
4662
  // visible for testing
@@ -6206,7 +6206,7 @@ function ni(t, e) {
6206
6206
  }
6207
6207
  }
6208
6208
 
6209
- /** Decodes a remote document from storage locally to a Document. */ function ai(t, e) {
6209
+ /** Decodes a remote document from storage locally to a Document. */ function ci(t, e) {
6210
6210
  if (e.document) return es(t.Wt, e.document, !!e.hasCommittedMutations);
6211
6211
  if (e.noDocument) {
6212
6212
  const t = vt.fromSegments(e.noDocument.path), n = fi(e.noDocument.readTime), s = jt.newNoDocument(t, n);
@@ -6219,7 +6219,7 @@ function ni(t, e) {
6219
6219
  return L();
6220
6220
  }
6221
6221
 
6222
- /** Encodes a document for storage locally. */ function ci(t, e, n) {
6222
+ /** Encodes a document for storage locally. */ function ai(t, e, n) {
6223
6223
  const s = ui(n), i = e.key.path.popLast().toArray();
6224
6224
  if (e.isFoundDocument()) {
6225
6225
  const n = function(t, e) {
@@ -6303,7 +6303,7 @@ function di(t, e) {
6303
6303
  /** Encodes TargetData into a DbTarget for storage locally. */ function _i(t, e) {
6304
6304
  const n = li(e.snapshotVersion), s = li(e.lastLimboFreeSnapshotVersion);
6305
6305
  let i;
6306
- i = Jt(e.target) ? as(t.Wt, e.target) : cs(t.Wt, e.target);
6306
+ i = Jt(e.target) ? cs(t.Wt, e.target) : as(t.Wt, e.target);
6307
6307
  // We can't store the resumeToken as a ByteString in IndexedDb, so we
6308
6308
  // convert it to a base64 string for storage.
6309
6309
  const r = e.resumeToken.toBase64();
@@ -6587,12 +6587,12 @@ class bi {
6587
6587
  */
6588
6588
  function Pi(t, e, n) {
6589
6589
  const s = t.store(Ss.store), i = t.store(Ds.store), r = [], o = IDBKeyRange.only(n.batchId);
6590
- let a = 0;
6591
- const c = s.Kt({
6590
+ let c = 0;
6591
+ const a = s.Kt({
6592
6592
  range: o
6593
- }, ((t, e, n) => (a++, n.delete())));
6594
- r.push(c.next((() => {
6595
- B(1 === a);
6593
+ }, ((t, e, n) => (c++, n.delete())));
6594
+ r.push(a.next((() => {
6595
+ B(1 === c);
6596
6596
  })));
6597
6597
  const u = [];
6598
6598
  for (const t of n.mutations) {
@@ -6692,20 +6692,20 @@ class Vi {
6692
6692
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6693
6693
  return r.add({}).next((o => {
6694
6694
  B("number" == typeof o);
6695
- const a = new si(o, e, n, s), c = function(t, e, n) {
6695
+ const c = new si(o, e, n, s), a = function(t, e, n) {
6696
6696
  const s = n.baseMutations.map((e => is(t.Wt, e))), i = n.mutations.map((e => is(t.Wt, e)));
6697
6697
  return new Ss(e, n.batchId, n.localWriteTime.toMillis(), s, i);
6698
- }(this.N, this.userId, a), u = [];
6698
+ }(this.N, this.userId, c), u = [];
6699
6699
  let h = new yn(((t, e) => et(t.canonicalString(), e.canonicalString())));
6700
6700
  for (const t of s) {
6701
6701
  const e = Ds.key(this.userId, t.key.path, o);
6702
- h = h.add(t.key.path.popLast()), u.push(r.put(c)), u.push(i.put(e, Ds.PLACEHOLDER));
6702
+ h = h.add(t.key.path.popLast()), u.push(r.put(a)), u.push(i.put(e, Ds.PLACEHOLDER));
6703
6703
  }
6704
6704
  return h.forEach((e => {
6705
6705
  u.push(this.Ht.addToCollectionParentIndex(t, e));
6706
6706
  })), t.addOnCommittedListener((() => {
6707
- this.Jt[o] = a.keys();
6708
- })), Qs.waitFor(u).next((() => a));
6707
+ this.Jt[o] = c.keys();
6708
+ })), Qs.waitFor(u).next((() => c));
6709
6709
  }));
6710
6710
  }
6711
6711
  lookupMutationBatch(t, e) {
@@ -6759,7 +6759,7 @@ class Vi {
6759
6759
  return Ci(t).Kt({
6760
6760
  range: s
6761
6761
  }, ((n, s, r) => {
6762
- const [o, a, c] = n, u = bs(a);
6762
+ const [o, c, a] = n, u = bs(c);
6763
6763
  // Only consider rows matching exactly the specific key of
6764
6764
  // interest. Note that because we order by path first, and we
6765
6765
  // order terminators before path separators, we'll encounter all
@@ -6769,7 +6769,7 @@ class Vi {
6769
6769
  // can stop as soon as we hit any such row.
6770
6770
  if (o === this.userId && e.path.isEqual(u))
6771
6771
  // Look up the mutation batch in the store.
6772
- return Di(t).get(c).next((t => {
6772
+ return Di(t).get(a).next((t => {
6773
6773
  if (!t) throw L();
6774
6774
  B(t.userId === this.userId), i.push(di(this.N, t));
6775
6775
  }));
@@ -6783,7 +6783,7 @@ class Vi {
6783
6783
  const i = Ds.prefixForPath(this.userId, e.path), r = IDBKeyRange.lowerBound(i), o = Ci(t).Kt({
6784
6784
  range: r
6785
6785
  }, ((t, s, i) => {
6786
- const [r, o, a] = t, c = bs(o);
6786
+ const [r, o, c] = t, a = bs(o);
6787
6787
  // Only consider rows matching exactly the specific key of
6788
6788
  // interest. Note that because we order by path first, and we
6789
6789
  // order terminators before path separators, we'll encounter all
@@ -6791,7 +6791,7 @@ class Vi {
6791
6791
  // the rows for documentKey will occur before any rows for
6792
6792
  // documents nested in a subcollection beneath documentKey so we
6793
6793
  // can stop as soon as we hit any such row.
6794
- r === this.userId && e.path.isEqual(c) ? n = n.add(a) : i.done();
6794
+ r === this.userId && e.path.isEqual(a) ? n = n.add(c) : i.done();
6795
6795
  }));
6796
6796
  s.push(o);
6797
6797
  })), Qs.waitFor(s).next((() => this.Zt(t, n)));
@@ -6805,14 +6805,14 @@ class Vi {
6805
6805
  return Ci(t).Kt({
6806
6806
  range: r
6807
6807
  }, ((t, e, i) => {
6808
- const [r, a, c] = t, u = bs(a);
6808
+ const [r, c, a] = t, u = bs(c);
6809
6809
  r === this.userId && n.isPrefixOf(u) ?
6810
6810
  // Rows with document keys more than one segment longer than the
6811
6811
  // query path can't be matches. For example, a query on 'rooms'
6812
6812
  // can't match the document /rooms/abc/messages/xyx.
6813
6813
  // TODO(mcg): we'll need a different scanner when we implement
6814
6814
  // ancestor queries.
6815
- u.length === s && (o = o.add(c)) : i.done();
6815
+ u.length === s && (o = o.add(a)) : i.done();
6816
6816
  })).next((() => this.Zt(t, o)));
6817
6817
  }
6818
6818
  Zt(t, e) {
@@ -6881,8 +6881,8 @@ class Vi {
6881
6881
  range: r,
6882
6882
  qt: !0
6883
6883
  }, ((t, n, s) => {
6884
- const [r, a, /*batchID*/ c] = t;
6885
- r === e && a === i && (o = !0), s.done();
6884
+ const [r, c, /*batchID*/ a] = t;
6885
+ r === e && c === i && (o = !0), s.done();
6886
6886
  })).next((() => o));
6887
6887
  }
6888
6888
 
@@ -6999,11 +6999,11 @@ class xi {
6999
6999
  e > s.highestListenSequenceNumber && (s.highestListenSequenceNumber = e), this.oe(t, s))));
7000
7000
  }
7001
7001
  addTargetData(t, e) {
7002
- return this.ae(t, e).next((() => this.re(t).next((n => (n.targetCount += 1, this.ce(e, n),
7002
+ return this.ce(t, e).next((() => this.re(t).next((n => (n.targetCount += 1, this.ae(e, n),
7003
7003
  this.oe(t, n))))));
7004
7004
  }
7005
7005
  updateTargetData(t, e) {
7006
- return this.ae(t, e);
7006
+ return this.ce(t, e);
7007
7007
  }
7008
7008
  removeTargetData(t, e) {
7009
7009
  return this.removeMatchingKeysForTargetId(t, e.targetId).next((() => $i(t).delete(e.targetId))).next((() => this.re(t))).next((e => (B(e.targetCount > 0),
@@ -7017,8 +7017,8 @@ class xi {
7017
7017
  let s = 0;
7018
7018
  const i = [];
7019
7019
  return $i(t).Kt(((r, o) => {
7020
- const a = wi(o);
7021
- a.sequenceNumber <= e && null === n.get(a.targetId) && (s++, i.push(this.removeTargetData(t, a)));
7020
+ const c = wi(o);
7021
+ c.sequenceNumber <= e && null === n.get(c.targetId) && (s++, i.push(this.removeTargetData(t, c)));
7022
7022
  })).next((() => Qs.waitFor(i))).next((() => s));
7023
7023
  }
7024
7024
  /**
@@ -7035,14 +7035,14 @@ class xi {
7035
7035
  oe(t, e) {
7036
7036
  return Oi(t).put(Fs.key, e);
7037
7037
  }
7038
- ae(t, e) {
7038
+ ce(t, e) {
7039
7039
  return $i(t).put(_i(this.N, e));
7040
7040
  }
7041
7041
  /**
7042
7042
  * In-place updates the provided metadata to account for values in the given
7043
7043
  * TargetData. Saving is done separately. Returns true if there were any
7044
7044
  * changes to the metadata.
7045
- */ ce(t, e) {
7045
+ */ ae(t, e) {
7046
7046
  let n = !1;
7047
7047
  return t.targetId > e.highestTargetId && (e.highestTargetId = t.targetId, n = !0),
7048
7048
  t.sequenceNumber > e.highestListenSequenceNumber && (e.highestListenSequenceNumber = t.sequenceNumber,
@@ -7287,16 +7287,16 @@ class xi {
7287
7287
  return this.me.getCacheSize(t);
7288
7288
  }
7289
7289
  pe(t, e) {
7290
- let n, s, i, r, o, c, u;
7290
+ let n, s, i, r, o, a, u;
7291
7291
  const h = Date.now();
7292
7292
  return this.calculateTargetCount(t, this.params.percentileToCollect).next((e => (
7293
7293
  // Cap at the configured max
7294
7294
  e > this.params.maximumSequenceNumbersToCollect ? ($("LruGarbageCollector", `Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`),
7295
7295
  s = this.params.maximumSequenceNumbersToCollect) : s = e, r = Date.now(), this.nthSequenceNumber(t, s)))).next((s => (n = s,
7296
- o = Date.now(), this.removeTargets(t, n, e)))).next((e => (i = e, c = Date.now(),
7296
+ o = Date.now(), this.removeTargets(t, n, e)))).next((e => (i = e, a = Date.now(),
7297
7297
  this.removeOrphanedDocuments(t, n)))).next((t => {
7298
- if (u = Date.now(), x() <= a.DEBUG) {
7299
- $("LruGarbageCollector", `LRU Garbage Collection\n\tCounted targets in ${r - h}ms\n\tDetermined least recently used ${s} in ` + (o - r) + "ms\n" + `\tRemoved ${i} targets in ` + (c - o) + "ms\n" + `\tRemoved ${t} documents in ` + (u - c) + "ms\n" + `Total Duration: ${u - h}ms`);
7298
+ if (u = Date.now(), x() <= c.DEBUG) {
7299
+ $("LruGarbageCollector", `LRU Garbage Collection\n\tCounted targets in ${r - h}ms\n\tDetermined least recently used ${s} in ` + (o - r) + "ms\n" + `\tRemoved ${i} targets in ` + (a - o) + "ms\n" + `\tRemoved ${t} documents in ` + (u - a) + "ms\n" + `Total Duration: ${u - h}ms`);
7300
7300
  }
7301
7301
  return Qs.resolve({
7302
7302
  didRun: !0,
@@ -7494,12 +7494,12 @@ function ji(t, e) {
7494
7494
  return !1;
7495
7495
  }
7496
7496
  forEach(t) {
7497
- at(this.inner, ((e, n) => {
7497
+ ct(this.inner, ((e, n) => {
7498
7498
  for (const [e, s] of n) t(e, s);
7499
7499
  }));
7500
7500
  }
7501
7501
  isEmpty() {
7502
- return ct(this.inner);
7502
+ return at(this.inner);
7503
7503
  }
7504
7504
  }
7505
7505
 
@@ -7733,7 +7733,7 @@ function ji(t, e) {
7733
7733
  // shouldn't match it. Fix this by discarding rows with document keys
7734
7734
  // more than one segment longer than the query path.
7735
7735
  if (t.length !== i) return;
7736
- const o = ai(this.N, n);
7736
+ const o = ci(this.N, n);
7737
7737
  e.path.isPrefixOf(o.key.path) ? ve(e, o) && (s = s.insert(o.key, o)) : r.done();
7738
7738
  })).next((() => s));
7739
7739
  }
@@ -7754,7 +7754,7 @@ function ji(t, e) {
7754
7754
  * corresponds to the format used for sentinel deletes).
7755
7755
  */ Re(t, e) {
7756
7756
  if (e) {
7757
- const t = ai(this.N, e);
7757
+ const t = ci(this.N, e);
7758
7758
  // Whether the document is a sentinel removal and should only be used in the
7759
7759
  // `getNewDocumentChanges()`
7760
7760
  if (!(t.isNoDocument() && t.version.isEqual(rt.min()))) return t;
@@ -7793,16 +7793,16 @@ class zi extends Wi {
7793
7793
  return this.changes.forEach(((i, r) => {
7794
7794
  const o = this.De.get(i);
7795
7795
  if (r.document.isValidDocument()) {
7796
- const a = ci(this.Se.N, r.document, this.getReadTime(i));
7796
+ const c = ai(this.Se.N, r.document, this.getReadTime(i));
7797
7797
  s = s.add(i.path.popLast());
7798
- const c = vi(a);
7799
- n += c - o, e.push(this.Se.addEntry(t, i, a));
7798
+ const a = vi(c);
7799
+ n += a - o, e.push(this.Se.addEntry(t, i, c));
7800
7800
  } else if (n -= o, this.trackRemovals) {
7801
7801
  // In order to track removals, we store a "sentinel delete" in the
7802
7802
  // RemoteDocumentCache. This entry is represented by a NoDocument
7803
7803
  // with a version of 0 and ignored by `maybeDecodeDocument()` but
7804
7804
  // preserved in `getNewDocumentChanges()`.
7805
- const n = ci(this.Se.N, jt.newNoDocument(i, rt.min()), this.getReadTime(i));
7805
+ const n = ai(this.Se.N, jt.newNoDocument(i, rt.min()), this.getReadTime(i));
7806
7806
  e.push(this.Se.addEntry(t, i, n));
7807
7807
  } else e.push(this.Se.removeEntry(t, i));
7808
7808
  })), s.forEach((n => {
@@ -8126,14 +8126,14 @@ class er {
8126
8126
  * Whether to synchronize the in-memory state of multiple tabs and share
8127
8127
  * access to local persistence.
8128
8128
  */
8129
- t, e, n, s, i, r, o, a, c,
8129
+ t, e, n, s, i, r, o, c, a,
8130
8130
  /**
8131
8131
  * If set to true, forcefully obtains database access. Existing tabs will
8132
8132
  * no longer be able to access IndexedDB.
8133
8133
  */
8134
8134
  u) {
8135
8135
  if (this.allowTabSynchronization = t, this.persistenceKey = e, this.clientId = n,
8136
- this.Oe = i, this.window = r, this.document = o, this.Fe = c, this.Me = u, this.Le = null,
8136
+ this.Oe = i, this.window = r, this.document = o, this.Fe = a, this.Me = u, this.Le = null,
8137
8137
  this.Be = !1, this.isPrimary = !1, this.networkEnabled = !0,
8138
8138
  /** Our window.unload handler, if registered. */
8139
8139
  this.Ue = null, this.inForeground = !1,
@@ -8145,7 +8145,7 @@ class er {
8145
8145
  this.je = Number.NEGATIVE_INFINITY,
8146
8146
  /** A listener to notify on primary state changes. */
8147
8147
  this.Qe = t => Promise.resolve(), !er.bt()) throw new j(K.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
8148
- this.referenceDelegate = new Ki(this, s), this.We = e + "main", this.N = new oi(a),
8148
+ this.referenceDelegate = new Ki(this, s), this.We = e + "main", this.N = new oi(c),
8149
8149
  this.Ge = new Gs(this.We, 11, new Xi(this.N)), this.ze = new ki(this.referenceDelegate, this.N),
8150
8150
  this.Ht = new Ii, this.He = function(t, e) {
8151
8151
  return new Gi(t, e);
@@ -8223,7 +8223,7 @@ class er {
8223
8223
  if (this.isPrimary) return this.sn(t).next((t => {
8224
8224
  t || (this.isPrimary = !1, this.Oe.enqueueRetryable((() => this.Qe(!1))));
8225
8225
  }));
8226
- })).next((() => this.rn(t))).next((e => this.isPrimary && !e ? this.on(t).next((() => !1)) : !!e && this.an(t).next((() => !0)))))).catch((t => {
8226
+ })).next((() => this.rn(t))).next((e => this.isPrimary && !e ? this.on(t).next((() => !1)) : !!e && this.cn(t).next((() => !0)))))).catch((t => {
8227
8227
  if (Js(t))
8228
8228
  // Proceed with the existing state. Any subsequent access to
8229
8229
  // IndexedDB will verify the lease.
@@ -8236,7 +8236,7 @@ class er {
8236
8236
  }));
8237
8237
  }
8238
8238
  sn(t) {
8239
- return nr(t).get(vs.key).next((t => Qs.resolve(this.cn(t))));
8239
+ return nr(t).get(vs.key).next((t => Qs.resolve(this.an(t))));
8240
8240
  }
8241
8241
  un(t) {
8242
8242
  return sr(t).delete(this.clientId);
@@ -8270,7 +8270,7 @@ class er {
8270
8270
  */ en() {
8271
8271
  this.Ke = this.Oe.enqueueAfterDelay("client_metadata_refresh" /* ClientMetadataRefresh */ , 4e3, (() => this.Xe().then((() => this.hn())).then((() => this.en()))));
8272
8272
  }
8273
- /** Checks whether `client` is the local client. */ cn(t) {
8273
+ /** Checks whether `client` is the local client. */ an(t) {
8274
8274
  return !!t && t.ownerId === this.clientId;
8275
8275
  }
8276
8276
  /**
@@ -8292,8 +8292,8 @@ class er {
8292
8292
  // the foreground.
8293
8293
  // - the `forceOwningTab` setting was passed in.
8294
8294
  if (null !== e && this.ln(e.leaseTimestampMs, 5e3) && !this.wn(e.ownerId)) {
8295
- if (this.cn(e) && this.networkEnabled) return !0;
8296
- if (!this.cn(e)) {
8295
+ if (this.an(e) && this.networkEnabled) return !0;
8296
+ if (!this.an(e)) {
8297
8297
  if (!e.allowTabSynchronization)
8298
8298
  // Fail the `canActAsPrimary` check if the current leaseholder has
8299
8299
  // not opted into multi-tab synchronization. If this happens at
@@ -8379,7 +8379,7 @@ class er {
8379
8379
  if (!e) throw O(`Failed to obtain primary lease for action '${t}'.`), this.isPrimary = !1,
8380
8380
  this.Oe.enqueueRetryable((() => this.Qe(!1))), new j(K.FAILED_PRECONDITION, Ks);
8381
8381
  return n(i);
8382
- })).next((t => this.an(i).next((() => t)))) : this.En(i).next((() => n(i)))))).then((t => (i.raiseOnCommittedEvent(),
8382
+ })).next((t => this.cn(i).next((() => t)))) : this.En(i).next((() => n(i)))))).then((t => (i.raiseOnCommittedEvent(),
8383
8383
  t)));
8384
8384
  }
8385
8385
  /**
@@ -8390,13 +8390,13 @@ class er {
8390
8390
  // be turned off.
8391
8391
  En(t) {
8392
8392
  return nr(t).get(vs.key).next((t => {
8393
- if (null !== t && this.ln(t.leaseTimestampMs, 5e3) && !this.wn(t.ownerId) && !this.cn(t) && !(this.Me || this.allowTabSynchronization && t.allowTabSynchronization)) throw new j(K.FAILED_PRECONDITION, tr);
8393
+ if (null !== t && this.ln(t.leaseTimestampMs, 5e3) && !this.wn(t.ownerId) && !this.an(t) && !(this.Me || this.allowTabSynchronization && t.allowTabSynchronization)) throw new j(K.FAILED_PRECONDITION, tr);
8394
8394
  }));
8395
8395
  }
8396
8396
  /**
8397
8397
  * Obtains or extends the new primary lease for the local client. This
8398
8398
  * method does not verify that the client is eligible for this lease.
8399
- */ an(t) {
8399
+ */ cn(t) {
8400
8400
  const e = new vs(this.clientId, this.allowTabSynchronization, Date.now());
8401
8401
  return nr(t).put(vs.key, e);
8402
8402
  }
@@ -8405,7 +8405,7 @@ class er {
8405
8405
  }
8406
8406
  /** Checks the primary lease and removes it if we are the current primary. */ on(t) {
8407
8407
  const e = nr(t);
8408
- return e.get(vs.key).next((t => this.cn(t) ? ($("IndexedDbPersistence", "Releasing primary lease."),
8408
+ return e.get(vs.key).next((t => this.an(t) ? ($("IndexedDbPersistence", "Releasing primary lease."),
8409
8409
  e.delete(vs.key)) : Qs.resolve()));
8410
8410
  }
8411
8411
  /** Verifies that `updateTimeMs` is within `maxAgeMs`. */ ln(t, e) {
@@ -8685,7 +8685,7 @@ class rr {
8685
8685
  * A set of changes to what documents are currently in view and out of view for
8686
8686
  * a given query. These changes are sent to the LocalStore by the View (via
8687
8687
  * the SyncEngine) and are used to pin / unpin documents as appropriate.
8688
- */ class ar {
8688
+ */ class cr {
8689
8689
  constructor(t, e, n, s) {
8690
8690
  this.targetId = t, this.fromCache = e, this.Nn = n, this.xn = s;
8691
8691
  }
@@ -8700,7 +8700,7 @@ class rr {
8700
8700
  s = s.add(t.doc.key);
8701
8701
  // do nothing
8702
8702
  }
8703
- return new ar(t, e.fromCache, n, s);
8703
+ return new cr(t, e.fromCache, n, s);
8704
8704
  }
8705
8705
  }
8706
8706
 
@@ -8737,7 +8737,7 @@ class rr {
8737
8737
  * another document that is in the local cache.
8738
8738
  *
8739
8739
  * - Queries that have never been CURRENT or free of limbo documents.
8740
- */ class cr {
8740
+ */ class ar {
8741
8741
  /** Sets the document view to query against. */
8742
8742
  $n(t) {
8743
8743
  this.On = t;
@@ -8750,7 +8750,7 @@ class rr {
8750
8750
  return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.explicitOrderBy.length || 1 === t.explicitOrderBy.length && t.explicitOrderBy[0].field.isKeyField());
8751
8751
  }(e) || n.isEqual(rt.min()) ? this.Fn(t, e) : this.On.Pn(t, s).next((i => {
8752
8752
  const r = this.Mn(e, i);
8753
- return (me(e) || ge(e)) && this.Ln(e.limitType, r, s, n) ? this.Fn(t, e) : (x() <= a.DEBUG && $("QueryEngine", "Re-using previous result from %s to execute query: %s", n.toString(), Pe(e)),
8753
+ return (me(e) || ge(e)) && this.Ln(e.limitType, r, s, n) ? this.Fn(t, e) : (x() <= c.DEBUG && $("QueryEngine", "Re-using previous result from %s to execute query: %s", n.toString(), Pe(e)),
8754
8754
  this.On.getDocumentsMatchingQuery(t, e, n).next((t => (
8755
8755
  // We merge `previousResults` into `updateResults`, since
8756
8756
  // `updateResults` is already a DocumentMap. If a document is
@@ -8796,7 +8796,7 @@ class rr {
8796
8796
  return !!i && (i.hasPendingWrites || i.version.compareTo(s) > 0);
8797
8797
  }
8798
8798
  Fn(t, e) {
8799
- return x() <= a.DEBUG && $("QueryEngine", "Using full collection scan to execute query:", Pe(e)),
8799
+ return x() <= c.DEBUG && $("QueryEngine", "Using full collection scan to execute query:", Pe(e)),
8800
8800
  this.On.getDocumentsMatchingQuery(t, e, rt.min());
8801
8801
  }
8802
8802
  }
@@ -8976,16 +8976,16 @@ function dr(t) {
8976
8976
  i = n.Un;
8977
8977
  const o = [];
8978
8978
  e.targetChanges.forEach(((e, r) => {
8979
- const a = i.get(r);
8980
- if (!a) return;
8979
+ const c = i.get(r);
8980
+ if (!c) return;
8981
8981
  // Only update the remote keys if the target is still active. This
8982
8982
  // ensures that we can persist the updated target data along with
8983
8983
  // the updated assignment.
8984
8984
  o.push(n.ze.removeMatchingKeys(t, e.removedDocuments, r).next((() => n.ze.addMatchingKeys(t, e.addedDocuments, r))));
8985
- const c = e.resumeToken;
8985
+ const a = e.resumeToken;
8986
8986
  // Update the resume token if the change includes one.
8987
- if (c.approximateByteSize() > 0) {
8988
- const u = a.withResumeToken(c, s).withSequenceNumber(t.currentSequenceNumber);
8987
+ if (a.approximateByteSize() > 0) {
8988
+ const u = c.withResumeToken(a, s).withSequenceNumber(t.currentSequenceNumber);
8989
8989
  i = i.insert(r, u),
8990
8990
  // Update the target data if there are target changes (or if
8991
8991
  // sufficient time has passed since the last update).
@@ -9018,10 +9018,10 @@ function dr(t) {
9018
9018
  }
9019
9019
  /**
9020
9020
  * Notifies local store of the changed views to locally pin documents.
9021
- */ (a, u, e) && o.push(n.ze.updateTargetData(t, u));
9021
+ */ (c, u, e) && o.push(n.ze.updateTargetData(t, u));
9022
9022
  }
9023
9023
  }));
9024
- let a = Tn();
9024
+ let c = Tn();
9025
9025
  // HACK: The only reason we allow a null snapshot version is so that we
9026
9026
  // can synthesize remote events when we get permission denied errors while
9027
9027
  // trying to resolve the state of a locally cached document that is in
@@ -9032,12 +9032,12 @@ function dr(t) {
9032
9032
  // Each loop iteration only affects its "own" doc, so it's safe to get all the remote
9033
9033
  // documents in advance in a single call.
9034
9034
  o.push(_r(t, r, e.documentUpdates, s, void 0).next((t => {
9035
- a = t;
9035
+ c = t;
9036
9036
  }))), !s.isEqual(rt.min())) {
9037
9037
  const e = n.ze.getLastRemoteSnapshotVersion(t).next((e => n.ze.setTargetsMetadata(t, t.currentSequenceNumber, s)));
9038
9038
  o.push(e);
9039
9039
  }
9040
- return Qs.waitFor(o).next((() => r.apply(t))).next((() => n.Qn.vn(t, a))).next((() => a));
9040
+ return Qs.waitFor(o).next((() => r.apply(t))).next((() => n.Qn.vn(t, c))).next((() => c));
9041
9041
  })).then((t => (n.Un = i, t)));
9042
9042
  }
9043
9043
 
@@ -9064,7 +9064,7 @@ i) {
9064
9064
  return n.forEach((t => r = r.add(t))), e.getEntries(t, r).next((t => {
9065
9065
  let r = Tn();
9066
9066
  return n.forEach(((n, o) => {
9067
- const a = t.get(n), c = (null == i ? void 0 : i.get(n)) || s;
9067
+ const c = t.get(n), a = (null == i ? void 0 : i.get(n)) || s;
9068
9068
  // Note: The order of the steps below is important, since we want
9069
9069
  // to ensure that rejected limbo resolutions (which fabricate
9070
9070
  // NoDocuments with SnapshotVersion.min()) never add documents to
@@ -9073,8 +9073,8 @@ i) {
9073
9073
  // NoDocuments with SnapshotVersion.min() are used in manufactured
9074
9074
  // events. We remove these documents from cache since we lost
9075
9075
  // access.
9076
- e.removeEntry(n, c), r = r.insert(n, o)) : !a.isValidDocument() || o.version.compareTo(a.version) > 0 || 0 === o.version.compareTo(a.version) && a.hasPendingWrites ? (e.addEntry(o, c),
9077
- r = r.insert(n, o)) : $("LocalStore", "Ignoring outdated watch update for ", n, ". Current version:", a.version, " Watch version:", o.version);
9076
+ e.removeEntry(n, a), r = r.insert(n, o)) : !c.isValidDocument() || o.version.compareTo(c.version) > 0 || 0 === o.version.compareTo(c.version) && c.hasPendingWrites ? (e.addEntry(o, a),
9077
+ r = r.insert(n, o)) : $("LocalStore", "Ignoring outdated watch update for ", n, ". Current version:", c.version, " Watch version:", o.version);
9078
9078
  })), r;
9079
9079
  }));
9080
9080
  }
@@ -9192,14 +9192,14 @@ function Tr(t) {
9192
9192
  return e.persistence.runTransaction("Get new document changes", "readonly", (t => function(t, e, n) {
9193
9193
  const s = q(t);
9194
9194
  let i = Tn(), r = ui(n);
9195
- const o = Ji(e), a = IDBKeyRange.lowerBound(r, !0);
9195
+ const o = Ji(e), c = IDBKeyRange.lowerBound(r, !0);
9196
9196
  return o.Kt({
9197
9197
  index: xs.readTimeIndex,
9198
- range: a
9198
+ range: c
9199
9199
  }, ((t, e) => {
9200
9200
  // Unlike `getEntry()` and others, `getNewDocumentChanges()` parses
9201
9201
  // the documents directly since we want to keep sentinel deletes.
9202
- const n = ai(s.N, e);
9202
+ const n = ci(s.N, e);
9203
9203
  i = i.insert(n.key, n), r = e.readTime;
9204
9204
  })).next((() => ({
9205
9205
  Tn: i,
@@ -9252,12 +9252,12 @@ async function Ir(t) {
9252
9252
  */
9253
9253
  async function Ar(t, e, n, s) {
9254
9254
  const i = q(t);
9255
- let r = vn(), o = Tn(), a = bn();
9255
+ let r = vn(), o = Tn(), c = bn();
9256
9256
  for (const t of n) {
9257
9257
  const n = e.zn(t.metadata.name);
9258
- t.document && (r = r.add(n)), o = o.insert(n, e.Hn(t)), a = a.insert(n, e.Jn(t.metadata.readTime));
9258
+ t.document && (r = r.add(n)), o = o.insert(n, e.Hn(t)), c = c.insert(n, e.Jn(t.metadata.readTime));
9259
9259
  }
9260
- const c = i.jn.newChangeBuffer({
9260
+ const a = i.jn.newChangeBuffer({
9261
9261
  trackRemovals: !0
9262
9262
  }), u = await gr(i, function(t) {
9263
9263
  // It is OK that the path used for the query is not valid, because this will
@@ -9266,7 +9266,7 @@ async function Ar(t, e, n, s) {
9266
9266
  }(s));
9267
9267
  // Allocates a target to hold all document keys from the bundle, such that
9268
9268
  // they will not get garbage collected right away.
9269
- return i.persistence.runTransaction("Apply bundle documents", "readwrite", (t => _r(t, c, o, rt.min(), a).next((e => (c.apply(t),
9269
+ return i.persistence.runTransaction("Apply bundle documents", "readwrite", (t => _r(t, a, o, rt.min(), c).next((e => (a.apply(t),
9270
9270
  e))).next((e => i.ze.removeMatchingKeysForTargetId(t, u.targetId).next((() => i.ze.addMatchingKeys(t, r, u.targetId))).next((() => i.Qn.vn(t, e))).next((() => e))))));
9271
9271
  }
9272
9272
 
@@ -9769,16 +9769,16 @@ class Dr extends Wi {
9769
9769
  return n && (this.lastRemoteSnapshotVersion = n), e > this.Is && (this.Is = e),
9770
9770
  Qs.resolve();
9771
9771
  }
9772
- ae(t) {
9772
+ ce(t) {
9773
9773
  this.Ts.set(t.target, t);
9774
9774
  const e = t.targetId;
9775
9775
  e > this.highestTargetId && (this.Rs = new xi(e), this.highestTargetId = e), t.sequenceNumber > this.Is && (this.Is = t.sequenceNumber);
9776
9776
  }
9777
9777
  addTargetData(t, e) {
9778
- return this.ae(e), this.targetCount += 1, Qs.resolve();
9778
+ return this.ce(e), this.targetCount += 1, Qs.resolve();
9779
9779
  }
9780
9780
  updateTargetData(t, e) {
9781
- return this.ae(e), Qs.resolve();
9781
+ return this.ce(e), Qs.resolve();
9782
9782
  }
9783
9783
  removeTargetData(t, e) {
9784
9784
  return this.Ts.delete(e.target), this.As.cs(e.targetId), this.targetCount -= 1,
@@ -10321,12 +10321,12 @@ class qr {
10321
10321
  if (this.started) {
10322
10322
  if (null !== e.key) if (this.Ws.test(e.key)) {
10323
10323
  if (null == e.newValue) {
10324
- const t = this.ai(e.key);
10325
- return this.ci(t, null);
10324
+ const t = this.ci(e.key);
10325
+ return this.ai(t, null);
10326
10326
  }
10327
10327
  {
10328
10328
  const t = this.ui(e.key, e.newValue);
10329
- if (t) return this.ci(t.clientId, t);
10329
+ if (t) return this.ai(t.clientId, t);
10330
10330
  }
10331
10331
  } else if (this.Gs.test(e.key)) {
10332
10332
  if (null !== e.newValue) {
@@ -10396,7 +10396,7 @@ class qr {
10396
10396
  /**
10397
10397
  * Parses a client state key in WebStorage. Returns null if the key does not
10398
10398
  * match the expected key format.
10399
- */ ai(t) {
10399
+ */ ci(t) {
10400
10400
  const e = this.Ws.exec(t);
10401
10401
  return e ? e[1] : null;
10402
10402
  }
@@ -10404,7 +10404,7 @@ class qr {
10404
10404
  * Parses a client state in WebStorage. Returns 'null' if the value could not
10405
10405
  * be parsed.
10406
10406
  */ ui(t, e) {
10407
- const n = this.ai(t);
10407
+ const n = this.ci(t);
10408
10408
  return Br.$s(n, e);
10409
10409
  }
10410
10410
  /**
@@ -10434,7 +10434,7 @@ class qr {
10434
10434
  di(t) {
10435
10435
  return this.syncEngine.mi(t.targetId, t.state, t.error);
10436
10436
  }
10437
- ci(t, e) {
10437
+ ai(t, e) {
10438
10438
  const n = e ? this.qs.insert(t, e) : this.qs.remove(t), s = this.ti(this.qs), i = this.ti(n), r = [], o = [];
10439
10439
  return i.forEach((t => {
10440
10440
  s.has(t) || r.push(t);
@@ -10760,8 +10760,8 @@ class {
10760
10760
  $("Connection", 'RPC "' + t + '" completed.');
10761
10761
  }
10762
10762
  }));
10763
- const a = JSON.stringify(s);
10764
- o.send(e, "POST", a, n, 15);
10763
+ const c = JSON.stringify(s);
10764
+ o.send(e, "POST", c, n, 15);
10765
10765
  }));
10766
10766
  }
10767
10767
  ji(t, e) {
@@ -10808,22 +10808,22 @@ class {
10808
10808
  f() || d() || w() || _() || m() || g() || (r.httpHeadersOverwriteParam = "$httpHeaders");
10809
10809
  const o = n.join("");
10810
10810
  $("Connection", "Creating WebChannel: " + o, r);
10811
- const a = s.createWebChannel(o, r);
10811
+ const c = s.createWebChannel(o, r);
10812
10812
  // WebChannel supports sending the first message with the handshake - saving
10813
10813
  // a network round trip. However, it will have to call send in the same
10814
10814
  // JS event loop as open. In order to enforce this, we delay actually
10815
10815
  // opening the WebChannel until send is called. Whether we have called
10816
10816
  // open is tracked with this variable.
10817
- let c = !1, u = !1;
10817
+ let a = !1, u = !1;
10818
10818
  // A flag to determine whether the stream was closed (by us or through an
10819
10819
  // error/close event) to avoid delivering multiple close events or sending
10820
10820
  // on a closed stream
10821
10821
  const h = new zr({
10822
10822
  vi: t => {
10823
- u ? $("Connection", "Not sending because WebChannel is closed:", t) : (c || ($("Connection", "Opening WebChannel transport."),
10824
- a.open(), c = !0), $("Connection", "WebChannel sending:", t), a.send(t));
10823
+ u ? $("Connection", "Not sending because WebChannel is closed:", t) : (a || ($("Connection", "Opening WebChannel transport."),
10824
+ c.open(), a = !0), $("Connection", "WebChannel sending:", t), c.send(t));
10825
10825
  },
10826
- Vi: () => a.close()
10826
+ Vi: () => c.close()
10827
10827
  }), l = (t, e, n) => {
10828
10828
  // TODO(dimond): closure typing seems broken because WebChannel does
10829
10829
  // not implement goog.events.Listenable
@@ -10841,13 +10841,13 @@ class {
10841
10841
  // exception and rethrow using a setTimeout so they become visible again.
10842
10842
  // Note that eventually this function could go away if we are confident
10843
10843
  // enough the code is exception free.
10844
- return l(a, v.EventType.OPEN, (() => {
10844
+ return l(c, v.EventType.OPEN, (() => {
10845
10845
  u || $("Connection", "WebChannel transport opened.");
10846
- })), l(a, v.EventType.CLOSE, (() => {
10846
+ })), l(c, v.EventType.CLOSE, (() => {
10847
10847
  u || (u = !0, $("Connection", "WebChannel transport closed"), h.$i());
10848
- })), l(a, v.EventType.ERROR, (t => {
10848
+ })), l(c, v.EventType.ERROR, (t => {
10849
10849
  u || (u = !0, F("Connection", "WebChannel transport errored:", t), h.$i(new j(K.UNAVAILABLE, "The operation could not be completed")));
10850
- })), l(a, v.EventType.MESSAGE, (t => {
10850
+ })), l(c, v.EventType.MESSAGE, (t => {
10851
10851
  var e;
10852
10852
  if (!u) {
10853
10853
  const n = t.data[0];
@@ -10877,7 +10877,7 @@ class {
10877
10877
  }(t), n = i.message;
10878
10878
  void 0 === e && (e = K.INTERNAL, n = "Unknown error status: " + t + " with message " + i.message),
10879
10879
  // Mark closed so no further events are propagated
10880
- u = !0, h.$i(new j(e, n)), a.close();
10880
+ u = !0, h.$i(new j(e, n)), c.close();
10881
10881
  } else $("Connection", "WebChannel received:", n), h.Oi(n);
10882
10882
  }
10883
10883
  })), l(i, V.STAT_EVENT, (t => {
@@ -11108,13 +11108,13 @@ class to {
11108
11108
  * encompasses respecting backoff, getting auth tokens, and starting the
11109
11109
  * actual RPC). Use isOpen() to determine if the stream is open and ready for
11110
11110
  * outbound requests.
11111
- */ ar() {
11111
+ */ cr() {
11112
11112
  return 1 /* Starting */ === this.state || 2 /* Open */ === this.state || 4 /* Backoff */ === this.state;
11113
11113
  }
11114
11114
  /**
11115
11115
  * Returns true if the underlying RPC is open (the onOpen() listener has been
11116
11116
  * called) and the stream is ready for outbound requests.
11117
- */ cr() {
11117
+ */ ar() {
11118
11118
  return 2 /* Open */ === this.state;
11119
11119
  }
11120
11120
  /**
@@ -11132,7 +11132,7 @@ class to {
11132
11132
  *
11133
11133
  * When stop returns, isStarted() and isOpen() will both return false.
11134
11134
  */ async stop() {
11135
- this.ar() && await this.close(0 /* Initial */);
11135
+ this.cr() && await this.close(0 /* Initial */);
11136
11136
  }
11137
11137
  /**
11138
11138
  * After an error the stream will usually back off on the next attempt to
@@ -11156,13 +11156,13 @@ class to {
11156
11156
  */ lr() {
11157
11157
  // Starts the idle time if we are in state 'Open' and are not yet already
11158
11158
  // running a timer (in which case the previous idle timeout still applies).
11159
- this.cr() && null === this.ir && (this.ir = this.Oe.enqueueAfterDelay(this.er, 6e4, (() => this.dr())));
11159
+ this.ar() && null === this.ir && (this.ir = this.Oe.enqueueAfterDelay(this.er, 6e4, (() => this.dr())));
11160
11160
  }
11161
11161
  /** Sends a message to the underlying stream. */ wr(t) {
11162
11162
  this._r(), this.stream.send(t);
11163
11163
  }
11164
11164
  /** Called by the idle timer when the stream should close due to inactivity. */ async dr() {
11165
- if (this.cr())
11165
+ if (this.ar())
11166
11166
  // When timing out an idle stream there's no reason to force the stream into backoff when
11167
11167
  // it restarts so set the stream state to Initial instead of Error.
11168
11168
  return this.close(0 /* Initial */);
@@ -11303,9 +11303,9 @@ class to {
11303
11303
  let n;
11304
11304
  const s = e.target;
11305
11305
  return n = Jt(s) ? {
11306
- documents: as(t, s)
11306
+ documents: cs(t, s)
11307
11307
  } : {
11308
- query: cs(t, s)
11308
+ query: as(t, s)
11309
11309
  }, n.targetId = e.targetId, e.resumeToken.approximateByteSize() > 0 ? n.resumeToken = Kn(t, e.resumeToken) : e.snapshotVersion.compareTo(rt.min()) > 0 && (
11310
11310
  // TODO(wuandy): Consider removing above check because it is most likely true.
11311
11311
  // Right now, many tests depend on this behaviour though (leaving min() out
@@ -11597,7 +11597,7 @@ class io {
11597
11597
  _o(this) && ($("RemoteStore", "Restarting streams for network reachability change."),
11598
11598
  await async function(t) {
11599
11599
  const e = q(t);
11600
- e.Kr.add(4 /* ConnectivityChange */), await ao(e), e.Wr.set("Unknown" /* Unknown */),
11600
+ e.Kr.add(4 /* ConnectivityChange */), await co(e), e.Wr.set("Unknown" /* Unknown */),
11601
11601
  e.Kr.delete(4 /* ConnectivityChange */), await oo(e);
11602
11602
  }(this));
11603
11603
  }));
@@ -11612,7 +11612,7 @@ async function oo(t) {
11612
11612
  /**
11613
11613
  * Temporarily disables the network. The network can be re-enabled using
11614
11614
  * enableNetwork().
11615
- */ async function ao(t) {
11615
+ */ async function co(t) {
11616
11616
  for (const e of t.jr) await e(/* enabled= */ !1);
11617
11617
  }
11618
11618
 
@@ -11620,13 +11620,13 @@ async function oo(t) {
11620
11620
  * Starts new listen for the given target. Uses resume token if provided. It
11621
11621
  * is a no-op if the target of given `TargetData` is already being listened to.
11622
11622
  */
11623
- function co(t, e) {
11623
+ function ao(t, e) {
11624
11624
  const n = q(t);
11625
11625
  n.qr.has(e.targetId) || (
11626
11626
  // Mark this as something the client is currently listening for.
11627
11627
  n.qr.set(e.targetId, e), wo(n) ?
11628
11628
  // The listen will be sent in onWatchStreamOpen
11629
- fo(n) : No(n).cr() && ho(n, e));
11629
+ fo(n) : No(n).ar() && ho(n, e));
11630
11630
  }
11631
11631
 
11632
11632
  /**
@@ -11634,7 +11634,7 @@ function co(t, e) {
11634
11634
  * not being listened to.
11635
11635
  */ function uo(t, e) {
11636
11636
  const n = q(t), s = No(n);
11637
- n.qr.delete(e), s.cr() && lo(n, e), 0 === n.qr.size && (s.cr() ? s.lr() : _o(n) &&
11637
+ n.qr.delete(e), s.ar() && lo(n, e), 0 === n.qr.size && (s.ar() ? s.lr() : _o(n) &&
11638
11638
  // Revert to OnlineState.Unknown if the watch stream is not open and we
11639
11639
  // have no listeners, since without any listens to send we cannot
11640
11640
  // confirm if the stream is healthy and upgrade to OnlineState.Online.
@@ -11667,7 +11667,7 @@ function fo(t) {
11667
11667
  * Returns whether the watch stream should be started because it's necessary
11668
11668
  * and has not yet been started.
11669
11669
  */ function wo(t) {
11670
- return _o(t) && !No(t).ar() && t.qr.size > 0;
11670
+ return _o(t) && !No(t).cr() && t.qr.size > 0;
11671
11671
  }
11672
11672
 
11673
11673
  function _o(t) {
@@ -11720,7 +11720,7 @@ async function po(t, e, n) {
11720
11720
  } catch (n) {
11721
11721
  $("RemoteStore", "Failed to remove targets %s: %s ", e.targetIds.join(","), n),
11722
11722
  await Eo(t, n);
11723
- } else if (e instanceof Nn ? t.Gr.rt(e) : e instanceof xn ? t.Gr.ft(e) : t.Gr.ct(e),
11723
+ } else if (e instanceof Nn ? t.Gr.rt(e) : e instanceof xn ? t.Gr.ft(e) : t.Gr.at(e),
11724
11724
  !n.isEqual(rt.min())) try {
11725
11725
  const e = await dr(t.localStore);
11726
11726
  n.compareTo(e) >= 0 &&
@@ -11781,7 +11781,7 @@ async function po(t, e, n) {
11781
11781
  if (!Js(e)) throw e;
11782
11782
  t.Kr.add(1 /* IndexedDbFailed */),
11783
11783
  // Disable network and raise offline snapshots
11784
- await ao(t), t.Wr.set("Offline" /* Offline */), n || (
11784
+ await co(t), t.Wr.set("Offline" /* Offline */), n || (
11785
11785
  // Use a simple read operation to determine if IndexedDB recovered.
11786
11786
  // Ideally, we would expose a health check directly on SimpleDb, but
11787
11787
  // RemoteStore only has access to persistence through LocalStore.
@@ -11829,11 +11829,11 @@ async function Io(t) {
11829
11829
  */ function Ro(t, e) {
11830
11830
  t.Ur.push(e);
11831
11831
  const n = xo(t);
11832
- n.cr() && n.br && n.Pr(e.mutations);
11832
+ n.ar() && n.br && n.Pr(e.mutations);
11833
11833
  }
11834
11834
 
11835
11835
  function bo(t) {
11836
- return _o(t) && !xo(t).ar() && t.Ur.length > 0;
11836
+ return _o(t) && !xo(t).cr() && t.Ur.length > 0;
11837
11837
  }
11838
11838
 
11839
11839
  function Po(t) {
@@ -11891,7 +11891,7 @@ async function Do(t, e) {
11891
11891
  async function Co(t, e) {
11892
11892
  const n = q(t);
11893
11893
  e ? (n.Kr.delete(2 /* IsSecondary */), await oo(n)) : e || (n.Kr.add(2 /* IsSecondary */),
11894
- await ao(n), n.Wr.set("Unknown" /* Unknown */));
11894
+ await co(n), n.Wr.set("Unknown" /* Unknown */));
11895
11895
  }
11896
11896
 
11897
11897
  /**
@@ -12206,9 +12206,9 @@ class ko {
12206
12206
  }
12207
12207
 
12208
12208
  class Mo {
12209
- constructor(t, e, n, s, i, r, o, a) {
12209
+ constructor(t, e, n, s, i, r, o, c) {
12210
12210
  this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = s, this.mutatedKeys = i,
12211
- this.fromCache = r, this.syncStateChanged = o, this.excludesMetadataChanges = a;
12211
+ this.fromCache = r, this.syncStateChanged = o, this.excludesMetadataChanges = c;
12212
12212
  }
12213
12213
  /** Returns a view snapshot as if all documents in the snapshot were added. */ static fromInitialDocuments(t, e, n, s) {
12214
12214
  const i = [];
@@ -12348,7 +12348,7 @@ function Qo(t) {
12348
12348
  /* excludesMetadataChanges= */ !0);
12349
12349
  }
12350
12350
  let e = !1;
12351
- return this.io ? this.oo(t) && (this.so.next(t), e = !0) : this.ao(t, this.onlineState) && (this.co(t),
12351
+ return this.io ? this.oo(t) && (this.so.next(t), e = !0) : this.co(t, this.onlineState) && (this.ao(t),
12352
12352
  e = !0), this.ro = t, e;
12353
12353
  }
12354
12354
  onError(t) {
@@ -12357,10 +12357,10 @@ function Qo(t) {
12357
12357
  /** Returns whether a snapshot was raised. */ eo(t) {
12358
12358
  this.onlineState = t;
12359
12359
  let e = !1;
12360
- return this.ro && !this.io && this.ao(this.ro, t) && (this.co(this.ro), e = !0),
12360
+ return this.ro && !this.io && this.co(this.ro, t) && (this.ao(this.ro), e = !0),
12361
12361
  e;
12362
12362
  }
12363
- ao(t, e) {
12363
+ co(t, e) {
12364
12364
  // Always raise the first event when we're synced
12365
12365
  if (!t.fromCache) return !0;
12366
12366
  // NOTE: We consider OnlineState.Unknown as online (it should become Offline
@@ -12383,7 +12383,7 @@ function Qo(t) {
12383
12383
  // to get here if there were only metadata docChanges and they got
12384
12384
  // stripped out.
12385
12385
  }
12386
- co(t) {
12386
+ ao(t) {
12387
12387
  t = Mo.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.io = !0,
12388
12388
  this.so.next(t);
12389
12389
  }
@@ -12591,7 +12591,7 @@ class Xo {
12591
12591
  // deletes. So we keep this doc at the old limit to compare the updates to.
12592
12592
  // Note that this should never get used in a refill (when previousChanges is
12593
12593
  // set), because there will only be adds -- no deletes or updates.
12594
- const a = me(this.query) && s.size === this.query.limit ? s.last() : null, c = ge(this.query) && s.size === this.query.limit ? s.first() : null;
12594
+ const c = me(this.query) && s.size === this.query.limit ? s.last() : null, a = ge(this.query) && s.size === this.query.limit ? s.first() : null;
12595
12595
  // Drop documents out to meet limit/limitToLast requirement.
12596
12596
  if (t.inorderTraversal(((t, e) => {
12597
12597
  const u = s.get(t), h = ve(this.query, e) ? e : null, l = !!u && this.mutatedKeys.has(u.key), f = !!h && (h.hasLocalMutations ||
@@ -12607,7 +12607,7 @@ class Xo {
12607
12607
  }), d = !0) : this.Ro(u, h) || (n.track({
12608
12608
  type: 2 /* Modified */ ,
12609
12609
  doc: h
12610
- }), d = !0, (a && this.po(h, a) > 0 || c && this.po(h, c) < 0) && (
12610
+ }), d = !0, (c && this.po(h, c) > 0 || a && this.po(h, a) < 0) && (
12611
12611
  // This doc moved from inside the limit to outside the limit.
12612
12612
  // That means there may be some other doc in the local cache
12613
12613
  // that should be included instead.
@@ -12618,7 +12618,7 @@ class Xo {
12618
12618
  }), d = !0) : u && !h && (n.track({
12619
12619
  type: 1 /* Removed */ ,
12620
12620
  doc: u
12621
- }), d = !0, (a || c) && (
12621
+ }), d = !0, (c || a) && (
12622
12622
  // A doc was removed from a full limit query. We'll need to
12623
12623
  // requery from the local cache to see if we know about some other
12624
12624
  // doc that should be in the results.
@@ -12702,10 +12702,10 @@ class Xo {
12702
12702
  * See the License for the specific language governing permissions and
12703
12703
  * limitations under the License.
12704
12704
  */ (t.type, e.type) || this.po(t.doc, e.doc))), this.bo(n);
12705
- const r = e ? this.Po() : [], o = 0 === this.yo.size && this.current ? 1 /* Synced */ : 0 /* Local */ , a = o !== this.mo;
12706
- if (this.mo = o, 0 !== i.length || a) {
12705
+ const r = e ? this.Po() : [], o = 0 === this.yo.size && this.current ? 1 /* Synced */ : 0 /* Local */ , c = o !== this.mo;
12706
+ if (this.mo = o, 0 !== i.length || c) {
12707
12707
  return {
12708
- snapshot: new Mo(this.query, t.Eo, s, i, t.mutatedKeys, 0 /* Local */ === o, a,
12708
+ snapshot: new Mo(this.query, t.Eo, s, i, t.mutatedKeys, 0 /* Local */ === o, c,
12709
12709
  /* excludesMetadataChanges= */ !1),
12710
12710
  vo: r
12711
12711
  };
@@ -12806,7 +12806,7 @@ class Xo {
12806
12806
  * QueryView contains all of the data that SyncEngine needs to keep track of for
12807
12807
  * a particular query.
12808
12808
  */
12809
- class ta {
12809
+ class tc {
12810
12810
  constructor(
12811
12811
  /**
12812
12812
  * The query itself.
@@ -12828,7 +12828,7 @@ class ta {
12828
12828
  }
12829
12829
  }
12830
12830
 
12831
- /** Tracks a limbo resolution. */ class ea {
12831
+ /** Tracks a limbo resolution. */ class ec {
12832
12832
  constructor(t) {
12833
12833
  this.key = t,
12834
12834
  /**
@@ -12853,7 +12853,7 @@ class ta {
12853
12853
  * the class is not exported so they are only accessible from this module.
12854
12854
  * This is useful to implement optional features (like bundles) in free
12855
12855
  * functions, such that they are tree-shakeable.
12856
- */ class na {
12856
+ */ class nc {
12857
12857
  constructor(t, e, n,
12858
12858
  // PORTING NOTE: Manages state synchronization in multi-tab environments.
12859
12859
  s, i, r) {
@@ -12899,8 +12899,8 @@ class ta {
12899
12899
  * server. All the subsequent view snapshots or errors are sent to the
12900
12900
  * subscribed handlers. Returns the initial snapshot.
12901
12901
  */
12902
- async function sa(t, e) {
12903
- const n = Na(t);
12902
+ async function sc(t, e) {
12903
+ const n = Nc(t);
12904
12904
  let s, i;
12905
12905
  const r = n.xo.get(e);
12906
12906
  if (r)
@@ -12912,7 +12912,7 @@ async function sa(t, e) {
12912
12912
  // case and calls `listen` to obtain this ID.
12913
12913
  s = r.targetId, n.sharedClientState.addLocalQueryTarget(s), i = r.view.Do(); else {
12914
12914
  const t = await gr(n.localStore, Ie(e)), r = n.sharedClientState.addLocalQueryTarget(t.targetId);
12915
- s = t.targetId, i = await ia(n, e, s, "current" === r), n.isPrimaryClient && co(n.remoteStore, t);
12915
+ s = t.targetId, i = await ic(n, e, s, "current" === r), n.isPrimaryClient && ao(n.remoteStore, t);
12916
12916
  }
12917
12917
  return i;
12918
12918
  }
@@ -12920,7 +12920,7 @@ async function sa(t, e) {
12920
12920
  /**
12921
12921
  * Registers a view for a previously unknown query and computes its initial
12922
12922
  * snapshot.
12923
- */ async function ia(t, e, n, s) {
12923
+ */ async function ic(t, e, n, s) {
12924
12924
  // PORTING NOTE: On Web only, we inject the code that registers new Limbo
12925
12925
  // targets based on view changes. This allows us to only depend on Limbo
12926
12926
  // changes when user code includes queries.
@@ -12934,17 +12934,17 @@ async function sa(t, e) {
12934
12934
  /* usePreviousResults= */ !1).then((({documents: t}) => e.view.Io(t, i))));
12935
12935
  const r = s && s.targetChanges.get(e.targetId), o = e.view.applyChanges(i,
12936
12936
  /* updateLimboDocuments= */ t.isPrimaryClient, r);
12937
- return ga(t, e.targetId, o.vo), o.snapshot;
12937
+ return gc(t, e.targetId, o.vo), o.snapshot;
12938
12938
  }(t, e, n, s);
12939
12939
  const i = await pr(t.localStore, e,
12940
- /* usePreviousResults= */ !0), r = new Zo(e, i.Gn), o = r.Io(i.documents), a = Cn.createSynthesizedTargetChangeForCurrentChange(n, s && "Offline" /* Offline */ !== t.onlineState), c = r.applyChanges(o,
12941
- /* updateLimboDocuments= */ t.isPrimaryClient, a);
12942
- ga(t, n, c.vo);
12943
- const u = new ta(e, n, r);
12944
- return t.xo.set(e, u), t.ko.has(n) ? t.ko.get(n).push(e) : t.ko.set(n, [ e ]), c.snapshot;
12940
+ /* usePreviousResults= */ !0), r = new Zo(e, i.Gn), o = r.Io(i.documents), c = Cn.createSynthesizedTargetChangeForCurrentChange(n, s && "Offline" /* Offline */ !== t.onlineState), a = r.applyChanges(o,
12941
+ /* updateLimboDocuments= */ t.isPrimaryClient, c);
12942
+ gc(t, n, a.vo);
12943
+ const u = new tc(e, n, r);
12944
+ return t.xo.set(e, u), t.ko.has(n) ? t.ko.get(n).push(e) : t.ko.set(n, [ e ]), a.snapshot;
12945
12945
  }
12946
12946
 
12947
- /** Stops listening to the query. */ async function ra(t, e) {
12947
+ /** Stops listening to the query. */ async function rc(t, e) {
12948
12948
  const n = q(t), s = n.xo.get(e), i = n.ko.get(s.targetId);
12949
12949
  if (i.length > 1) return n.ko.set(s.targetId, i.filter((t => !Re(t, e)))), void n.xo.delete(e);
12950
12950
  // No other queries are mapped to the target, clean up the query and the target.
@@ -12955,9 +12955,9 @@ async function sa(t, e) {
12955
12955
  n.sharedClientState.isActiveQueryTarget(s.targetId) || await yr(n.localStore, s.targetId,
12956
12956
  /*keepPersistedTargetData=*/ !1).then((() => {
12957
12957
  n.sharedClientState.clearQueryState(s.targetId), uo(n.remoteStore, s.targetId),
12958
- _a(n, s.targetId);
12958
+ _c(n, s.targetId);
12959
12959
  })).catch(Mi);
12960
- } else _a(n, s.targetId), await yr(n.localStore, s.targetId,
12960
+ } else _c(n, s.targetId), await yr(n.localStore, s.targetId,
12961
12961
  /*keepPersistedTargetData=*/ !0);
12962
12962
  }
12963
12963
 
@@ -12970,8 +12970,8 @@ async function sa(t, e) {
12970
12970
  * have completed, *not* when the write was acked by the backend. The
12971
12971
  * userCallback is resolved once the write was acked/rejected by the
12972
12972
  * backend (or failed locally for any other reason).
12973
- */ async function oa(t, e, n) {
12974
- const s = xa(t);
12973
+ */ async function oc(t, e, n) {
12974
+ const s = xc(t);
12975
12975
  try {
12976
12976
  const t = await function(t, e) {
12977
12977
  const n = q(t), s = it.now(), i = e.reduce(((t, e) => t.add(e.key)), vn());
@@ -13006,7 +13006,7 @@ async function sa(t, e) {
13006
13006
  /**
13007
13007
  * Resolves or rejects the user callback for the given batch and then discards
13008
13008
  * it.
13009
- */ (s, t.batchId, n), await Ea(s, t.changes), await Io(s.remoteStore);
13009
+ */ (s, t.batchId, n), await Ec(s, t.changes), await Io(s.remoteStore);
13010
13010
  } catch (t) {
13011
13011
  // If we can't persist the mutation, we reject the user callback and
13012
13012
  // don't send the mutation. The user can then retry the write.
@@ -13019,7 +13019,7 @@ async function sa(t, e) {
13019
13019
  * Applies one remote event to the sync engine, notifying any views of the
13020
13020
  * changes, and releasing any pending mutation batches that would become
13021
13021
  * visible because of the snapshot version the remote event contains.
13022
- */ async function aa(t, e) {
13022
+ */ async function cc(t, e) {
13023
13023
  const n = q(t);
13024
13024
  try {
13025
13025
  const t = await wr(n.localStore, e);
@@ -13032,7 +13032,7 @@ async function sa(t, e) {
13032
13032
  B(t.addedDocuments.size + t.modifiedDocuments.size + t.removedDocuments.size <= 1),
13033
13033
  t.addedDocuments.size > 0 ? s.Co = !0 : t.modifiedDocuments.size > 0 ? B(s.Co) : t.removedDocuments.size > 0 && (B(s.Co),
13034
13034
  s.Co = !1));
13035
- })), await Ea(n, t, e);
13035
+ })), await Ec(n, t, e);
13036
13036
  } catch (t) {
13037
13037
  await Mi(t);
13038
13038
  }
@@ -13041,7 +13041,7 @@ async function sa(t, e) {
13041
13041
  /**
13042
13042
  * Applies an OnlineState change to the sync engine and notifies any views of
13043
13043
  * the change.
13044
- */ function ca(t, e, n) {
13044
+ */ function ac(t, e, n) {
13045
13045
  const s = q(t);
13046
13046
  // If we are the secondary client, we explicitly ignore the remote store's
13047
13047
  // online state (the local client may go offline, even though the primary
@@ -13075,7 +13075,7 @@ async function sa(t, e) {
13075
13075
  * @param err - A description of the condition that has forced the rejection.
13076
13076
  * Nearly always this will be an indication that the user is no longer
13077
13077
  * authorized to see the data matching the target.
13078
- */ async function ua(t, e, n) {
13078
+ */ async function uc(t, e, n) {
13079
13079
  const s = q(t);
13080
13080
  // PORTING NOTE: Multi-tab only.
13081
13081
  s.sharedClientState.updateQueryState(e, "rejected", n);
@@ -13092,18 +13092,18 @@ async function sa(t, e) {
13092
13092
  const n = vn().add(r), i = new Dn(rt.min(),
13093
13093
  /* targetChanges= */ new Map,
13094
13094
  /* targetMismatches= */ new yn(et), t, n);
13095
- await aa(s, i),
13095
+ await cc(s, i),
13096
13096
  // Since this query failed, we won't want to manually unlisten to it.
13097
13097
  // We only remove it from bookkeeping after we successfully applied the
13098
13098
  // RemoteEvent. If `applyRemoteEvent()` throws, we want to re-listen to
13099
13099
  // this query when the RemoteStore restarts the Watch stream, which should
13100
13100
  // re-trigger the target failure.
13101
- s.Oo = s.Oo.remove(r), s.Fo.delete(e), pa(s);
13101
+ s.Oo = s.Oo.remove(r), s.Fo.delete(e), pc(s);
13102
13102
  } else await yr(s.localStore, e,
13103
- /* keepPersistedTargetData */ !1).then((() => _a(s, e, n))).catch(Mi);
13103
+ /* keepPersistedTargetData */ !1).then((() => _c(s, e, n))).catch(Mi);
13104
13104
  }
13105
13105
 
13106
- async function ha(t, e) {
13106
+ async function hc(t, e) {
13107
13107
  const n = q(t), s = e.batch.batchId;
13108
13108
  try {
13109
13109
  const t = await fr(n.localStore, e);
@@ -13111,14 +13111,14 @@ async function ha(t, e) {
13111
13111
  // raise events immediately (depending on whether the watcher is caught
13112
13112
  // up), so we raise user callbacks first so that they consistently happen
13113
13113
  // before listen events.
13114
- wa(n, s, /*error=*/ null), da(n, s), n.sharedClientState.updateMutationState(s, "acknowledged"),
13115
- await Ea(n, t);
13114
+ wc(n, s, /*error=*/ null), dc(n, s), n.sharedClientState.updateMutationState(s, "acknowledged"),
13115
+ await Ec(n, t);
13116
13116
  } catch (t) {
13117
13117
  await Mi(t);
13118
13118
  }
13119
13119
  }
13120
13120
 
13121
- async function la(t, e, n) {
13121
+ async function lc(t, e, n) {
13122
13122
  const s = q(t);
13123
13123
  try {
13124
13124
  const t = await function(t, e) {
@@ -13138,8 +13138,8 @@ async function la(t, e, n) {
13138
13138
  // raise events immediately (depending on whether the watcher is caught up),
13139
13139
  // so we raise user callbacks first so that they consistently happen before
13140
13140
  // listen events.
13141
- wa(s, e, n), da(s, e), s.sharedClientState.updateMutationState(e, "rejected", n),
13142
- await Ea(s, t);
13141
+ wc(s, e, n), dc(s, e), s.sharedClientState.updateMutationState(e, "rejected", n),
13142
+ await Ec(s, t);
13143
13143
  } catch (n) {
13144
13144
  await Mi(n);
13145
13145
  }
@@ -13148,7 +13148,7 @@ async function la(t, e, n) {
13148
13148
  /**
13149
13149
  * Registers a user callback that resolves when all pending mutations at the moment of calling
13150
13150
  * are acknowledged .
13151
- */ async function fa(t, e) {
13151
+ */ async function fc(t, e) {
13152
13152
  const n = q(t);
13153
13153
  _o(n.remoteStore) || $("SyncEngine", "The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.");
13154
13154
  try {
@@ -13170,13 +13170,13 @@ async function la(t, e, n) {
13170
13170
  /**
13171
13171
  * Triggers the callbacks that are waiting for this batch id to get acknowledged by server,
13172
13172
  * if there are any.
13173
- */ function da(t, e) {
13173
+ */ function dc(t, e) {
13174
13174
  (t.Bo.get(e) || []).forEach((t => {
13175
13175
  t.resolve();
13176
13176
  })), t.Bo.delete(e);
13177
13177
  }
13178
13178
 
13179
- /** Reject all outstanding callbacks waiting for pending writes to complete. */ function wa(t, e, n) {
13179
+ /** Reject all outstanding callbacks waiting for pending writes to complete. */ function wc(t, e, n) {
13180
13180
  const s = q(t);
13181
13181
  let i = s.Lo[s.currentUser.toKey()];
13182
13182
  // NOTE: Mutations restored from persistence won't have callbacks, so it's
@@ -13187,39 +13187,39 @@ async function la(t, e, n) {
13187
13187
  }
13188
13188
  }
13189
13189
 
13190
- function _a(t, e, n = null) {
13190
+ function _c(t, e, n = null) {
13191
13191
  t.sharedClientState.removeLocalQueryTarget(e);
13192
13192
  for (const s of t.ko.get(e)) t.xo.delete(s), n && t.No.jo(s, n);
13193
13193
  if (t.ko.delete(e), t.isPrimaryClient) {
13194
13194
  t.Mo.cs(e).forEach((e => {
13195
13195
  t.Mo.containsKey(e) ||
13196
13196
  // We removed the last reference for this key
13197
- ma(t, e);
13197
+ mc(t, e);
13198
13198
  }));
13199
13199
  }
13200
13200
  }
13201
13201
 
13202
- function ma(t, e) {
13202
+ function mc(t, e) {
13203
13203
  t.$o.delete(e.path.canonicalString());
13204
13204
  // It's possible that the target already got removed because the query failed. In that case,
13205
13205
  // the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.
13206
13206
  const n = t.Oo.get(e);
13207
- null !== n && (uo(t.remoteStore, n), t.Oo = t.Oo.remove(e), t.Fo.delete(n), pa(t));
13207
+ null !== n && (uo(t.remoteStore, n), t.Oo = t.Oo.remove(e), t.Fo.delete(n), pc(t));
13208
13208
  }
13209
13209
 
13210
- function ga(t, e, n) {
13211
- for (const s of n) if (s instanceof Yo) t.Mo.addReference(s.key, e), ya(t, s); else if (s instanceof Xo) {
13210
+ function gc(t, e, n) {
13211
+ for (const s of n) if (s instanceof Yo) t.Mo.addReference(s.key, e), yc(t, s); else if (s instanceof Xo) {
13212
13212
  $("SyncEngine", "Document no longer in limbo: " + s.key), t.Mo.removeReference(s.key, e);
13213
13213
  t.Mo.containsKey(s.key) ||
13214
13214
  // We removed the last reference for this key
13215
- ma(t, s.key);
13215
+ mc(t, s.key);
13216
13216
  } else L();
13217
13217
  }
13218
13218
 
13219
- function ya(t, e) {
13219
+ function yc(t, e) {
13220
13220
  const n = e.key, s = n.path.canonicalString();
13221
13221
  t.Oo.get(n) || t.$o.has(s) || ($("SyncEngine", "New document in limbo: " + n), t.$o.add(s),
13222
- pa(t));
13222
+ pc(t));
13223
13223
  }
13224
13224
 
13225
13225
  /**
@@ -13229,23 +13229,23 @@ function ya(t, e) {
13229
13229
  * Without bounding the number of concurrent resolutions, the server can fail
13230
13230
  * with "resource exhausted" errors which can lead to pathological client
13231
13231
  * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683.
13232
- */ function pa(t) {
13232
+ */ function pc(t) {
13233
13233
  for (;t.$o.size > 0 && t.Oo.size < t.maxConcurrentLimboResolutions; ) {
13234
13234
  const e = t.$o.values().next().value;
13235
13235
  t.$o.delete(e);
13236
13236
  const n = new vt(ht.fromString(e)), s = t.Uo.next();
13237
- t.Fo.set(s, new ea(n)), t.Oo = t.Oo.insert(n, s), co(t.remoteStore, new ri(Ie(_e(n.path)), s, 2 /* LimboResolution */ , X.T));
13237
+ t.Fo.set(s, new ec(n)), t.Oo = t.Oo.insert(n, s), ao(t.remoteStore, new ri(Ie(_e(n.path)), s, 2 /* LimboResolution */ , X.T));
13238
13238
  }
13239
13239
  }
13240
13240
 
13241
- async function Ea(t, e, n) {
13241
+ async function Ec(t, e, n) {
13242
13242
  const s = q(t), i = [], r = [], o = [];
13243
- s.xo.isEmpty() || (s.xo.forEach(((t, a) => {
13244
- o.push(s.Ko(a, e, n).then((t => {
13243
+ s.xo.isEmpty() || (s.xo.forEach(((t, c) => {
13244
+ o.push(s.Ko(c, e, n).then((t => {
13245
13245
  if (t) {
13246
- s.isPrimaryClient && s.sharedClientState.updateQueryState(a.targetId, t.fromCache ? "not-current" : "current"),
13246
+ s.isPrimaryClient && s.sharedClientState.updateQueryState(c.targetId, t.fromCache ? "not-current" : "current"),
13247
13247
  i.push(t);
13248
- const e = ar.kn(a.targetId, t);
13248
+ const e = cr.kn(c.targetId, t);
13249
13249
  r.push(e);
13250
13250
  }
13251
13251
  })));
@@ -13272,7 +13272,7 @@ async function Ea(t, e, n) {
13272
13272
  }(s.localStore, r));
13273
13273
  }
13274
13274
 
13275
- async function Ta(t, e) {
13275
+ async function Tc(t, e) {
13276
13276
  const n = q(t);
13277
13277
  if (!n.currentUser.isEqual(e)) {
13278
13278
  $("SyncEngine", "User change. New user:", e.toKey());
@@ -13287,11 +13287,11 @@ async function Ta(t, e) {
13287
13287
  })), t.Bo.clear();
13288
13288
  }(n, "'waitForPendingWrites' promise is rejected due to a user change."),
13289
13289
  // TODO(b/114226417): Consider calling this only in the primary tab.
13290
- n.sharedClientState.handleUserChange(e, t.removedBatchIds, t.addedBatchIds), await Ea(n, t.Wn);
13290
+ n.sharedClientState.handleUserChange(e, t.removedBatchIds, t.addedBatchIds), await Ec(n, t.Wn);
13291
13291
  }
13292
13292
  }
13293
13293
 
13294
- function Ia(t, e) {
13294
+ function Ic(t, e) {
13295
13295
  const n = q(t), s = n.Fo.get(e);
13296
13296
  if (s && s.Co) return vn().add(s.key);
13297
13297
  {
@@ -13309,10 +13309,10 @@ function Ia(t, e) {
13309
13309
  /**
13310
13310
  * Reconcile the list of synced documents in an existing view with those
13311
13311
  * from persistence.
13312
- */ async function Aa(t, e) {
13312
+ */ async function Ac(t, e) {
13313
13313
  const n = q(t), s = await pr(n.localStore, e.query,
13314
13314
  /* usePreviousResults= */ !0), i = e.view.So(s);
13315
- return n.isPrimaryClient && ga(n, e.targetId, i.vo), i;
13315
+ return n.isPrimaryClient && gc(n, e.targetId, i.vo), i;
13316
13316
  }
13317
13317
 
13318
13318
  /**
@@ -13320,14 +13320,14 @@ function Ia(t, e) {
13320
13320
  * snapshots if needed.
13321
13321
  */
13322
13322
  // PORTING NOTE: Multi-Tab only.
13323
- async function Ra(t) {
13323
+ async function Rc(t) {
13324
13324
  const e = q(t);
13325
- return Tr(e.localStore).then((t => Ea(e, t)));
13325
+ return Tr(e.localStore).then((t => Ec(e, t)));
13326
13326
  }
13327
13327
 
13328
13328
  /** Applies a mutation state to an existing batch. */
13329
13329
  // PORTING NOTE: Multi-Tab only.
13330
- async function ba(t, e, n, s) {
13330
+ async function bc(t, e, n, s) {
13331
13331
  const i = q(t), r = await function(t, e) {
13332
13332
  const n = q(t), s = q(n.In);
13333
13333
  return n.persistence.runTransaction("Lookup mutation documents", "readonly", (t => s.Xt(t, e).next((e => e ? n.Qn.Pn(t, e) : Qs.resolve(null)))));
@@ -13341,11 +13341,11 @@ async function ba(t, e, n, s) {
13341
13341
  await Io(i.remoteStore) : "acknowledged" === n || "rejected" === n ? (
13342
13342
  // NOTE: Both these methods are no-ops for batches that originated from
13343
13343
  // other clients.
13344
- wa(i, e, s || null), da(i, e), function(t, e) {
13344
+ wc(i, e, s || null), dc(i, e), function(t, e) {
13345
13345
  q(q(t).In).te(e);
13346
13346
  }
13347
13347
  // PORTING NOTE: Multi-Tab only.
13348
- (i.localStore, e)) : L(), await Ea(i, r)) :
13348
+ (i.localStore, e)) : L(), await Ec(i, r)) :
13349
13349
  // A throttled tab may not have seen the mutation before it was completed
13350
13350
  // and removed from the mutation queue, in which case we won't have cached
13351
13351
  // the affected documents. In this case we can safely ignore the update
@@ -13358,26 +13358,26 @@ async function ba(t, e, n, s) {
13358
13358
 
13359
13359
  /** Applies a query target change from a different tab. */
13360
13360
  // PORTING NOTE: Multi-Tab only.
13361
- async function Pa(t, e) {
13361
+ async function Pc(t, e) {
13362
13362
  const n = q(t);
13363
- if (Na(n), xa(n), !0 === e && !0 !== n.qo) {
13363
+ if (Nc(n), xc(n), !0 === e && !0 !== n.qo) {
13364
13364
  // Secondary tabs only maintain Views for their local listeners and the
13365
13365
  // Views internal state may not be 100% populated (in particular
13366
13366
  // secondary tabs don't track syncedDocuments, the set of documents the
13367
13367
  // server considers to be in the target). So when a secondary becomes
13368
13368
  // primary, we need to need to make sure that all views for all targets
13369
13369
  // match the state on disk.
13370
- const t = n.sharedClientState.getAllActiveQueryTargets(), e = await va(n, t.toArray());
13370
+ const t = n.sharedClientState.getAllActiveQueryTargets(), e = await vc(n, t.toArray());
13371
13371
  n.qo = !0, await Co(n.remoteStore, !0);
13372
- for (const t of e) co(n.remoteStore, t);
13372
+ for (const t of e) ao(n.remoteStore, t);
13373
13373
  } else if (!1 === e && !1 !== n.qo) {
13374
13374
  const t = [];
13375
13375
  let e = Promise.resolve();
13376
13376
  n.ko.forEach(((s, i) => {
13377
- n.sharedClientState.isLocalQueryTarget(i) ? t.push(i) : e = e.then((() => (_a(n, i),
13377
+ n.sharedClientState.isLocalQueryTarget(i) ? t.push(i) : e = e.then((() => (_c(n, i),
13378
13378
  yr(n.localStore, i,
13379
13379
  /*keepPersistedTargetData=*/ !0)))), uo(n.remoteStore, i);
13380
- })), await e, await va(n, t),
13380
+ })), await e, await vc(n, t),
13381
13381
  // PORTING NOTE: Multi-Tab only.
13382
13382
  function(t) {
13383
13383
  const e = q(t);
@@ -13400,7 +13400,7 @@ async function Pa(t, e) {
13400
13400
  }
13401
13401
  }
13402
13402
 
13403
- async function va(t, e, n) {
13403
+ async function vc(t, e, n) {
13404
13404
  const s = q(t), i = [], r = [];
13405
13405
  for (const t of e) {
13406
13406
  let e;
@@ -13412,14 +13412,14 @@ async function va(t, e, n) {
13412
13412
  // state (the list of syncedDocuments may have gotten out of sync).
13413
13413
  e = await gr(s.localStore, Ie(n[0]));
13414
13414
  for (const t of n) {
13415
- const e = s.xo.get(t), n = await Aa(s, e);
13415
+ const e = s.xo.get(t), n = await Ac(s, e);
13416
13416
  n.snapshot && r.push(n.snapshot);
13417
13417
  }
13418
13418
  } else {
13419
13419
  // For queries that never executed on this client, we need to
13420
13420
  // allocate the target in LocalStore and initialize a new View.
13421
13421
  const n = await Er(s.localStore, t);
13422
- e = await gr(s.localStore, n), await ia(s, Va(n), t,
13422
+ e = await gr(s.localStore, n), await ic(s, Vc(n), t,
13423
13423
  /*current=*/ !1);
13424
13424
  }
13425
13425
  i.push(e);
@@ -13438,20 +13438,20 @@ async function va(t, e, n) {
13438
13438
  * difference will not cause issues.
13439
13439
  */
13440
13440
  // PORTING NOTE: Multi-Tab only.
13441
- function Va(t) {
13441
+ function Vc(t) {
13442
13442
  return we(t.path, t.collectionGroup, t.orderBy, t.filters, t.limit, "F" /* First */ , t.startAt, t.endAt);
13443
13443
  }
13444
13444
 
13445
13445
  /** Returns the IDs of the clients that are currently active. */
13446
13446
  // PORTING NOTE: Multi-Tab only.
13447
- function Sa(t) {
13447
+ function Sc(t) {
13448
13448
  const e = q(t);
13449
13449
  return q(q(e.localStore).persistence).pn();
13450
13450
  }
13451
13451
 
13452
13452
  /** Applies a query target change from a different tab. */
13453
13453
  // PORTING NOTE: Multi-Tab only.
13454
- async function Da(t, e, n, s) {
13454
+ async function Dc(t, e, n, s) {
13455
13455
  const i = q(t);
13456
13456
  if (i.qo)
13457
13457
  // If we receive a target state notification via WebStorage, we are
@@ -13461,13 +13461,13 @@ async function Da(t, e, n, s) {
13461
13461
  case "not-current":
13462
13462
  {
13463
13463
  const t = await Tr(i.localStore), s = Dn.createSynthesizedRemoteEventForCurrentChange(e, "current" === n);
13464
- await Ea(i, t, s);
13464
+ await Ec(i, t, s);
13465
13465
  break;
13466
13466
  }
13467
13467
 
13468
13468
  case "rejected":
13469
13469
  await yr(i.localStore, e,
13470
- /* keepPersistedTargetData */ !0), _a(i, e, s);
13470
+ /* keepPersistedTargetData */ !0), _c(i, e, s);
13471
13471
  break;
13472
13472
 
13473
13473
  default:
@@ -13475,8 +13475,8 @@ async function Da(t, e, n, s) {
13475
13475
  }
13476
13476
  }
13477
13477
 
13478
- /** Adds or removes Watch targets for queries from different tabs. */ async function Ca(t, e, n) {
13479
- const s = Na(t);
13478
+ /** Adds or removes Watch targets for queries from different tabs. */ async function Cc(t, e, n) {
13479
+ const s = Nc(t);
13480
13480
  if (s.qo) {
13481
13481
  for (const t of e) {
13482
13482
  if (s.ko.has(t)) {
@@ -13485,8 +13485,8 @@ async function Da(t, e, n, s) {
13485
13485
  continue;
13486
13486
  }
13487
13487
  const e = await Er(s.localStore, t), n = await gr(s.localStore, e);
13488
- await ia(s, Va(e), n.targetId,
13489
- /*current=*/ !1), co(s.remoteStore, n);
13488
+ await ic(s, Vc(e), n.targetId,
13489
+ /*current=*/ !1), ao(s.remoteStore, n);
13490
13490
  }
13491
13491
  for (const t of n)
13492
13492
  // Check that the target is still active since the target might have been
@@ -13495,21 +13495,21 @@ async function Da(t, e, n, s) {
13495
13495
  // Release queries that are still active.
13496
13496
  await yr(s.localStore, t,
13497
13497
  /* keepPersistedTargetData */ !1).then((() => {
13498
- uo(s.remoteStore, t), _a(s, t);
13498
+ uo(s.remoteStore, t), _c(s, t);
13499
13499
  })).catch(Mi);
13500
13500
  }
13501
13501
  }
13502
13502
 
13503
- function Na(t) {
13503
+ function Nc(t) {
13504
13504
  const e = q(t);
13505
- return e.remoteStore.remoteSyncer.applyRemoteEvent = aa.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = Ia.bind(null, e),
13506
- e.remoteStore.remoteSyncer.rejectListen = ua.bind(null, e), e.No.Tr = Ko.bind(null, e.eventManager),
13505
+ return e.remoteStore.remoteSyncer.applyRemoteEvent = cc.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = Ic.bind(null, e),
13506
+ e.remoteStore.remoteSyncer.rejectListen = uc.bind(null, e), e.No.Tr = Ko.bind(null, e.eventManager),
13507
13507
  e.No.jo = jo.bind(null, e.eventManager), e;
13508
13508
  }
13509
13509
 
13510
- function xa(t) {
13510
+ function xc(t) {
13511
13511
  const e = q(t);
13512
- return e.remoteStore.remoteSyncer.applySuccessfulWrite = ha.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = la.bind(null, e),
13512
+ return e.remoteStore.remoteSyncer.applySuccessfulWrite = hc.bind(null, e), e.remoteStore.remoteSyncer.rejectFailedWrite = lc.bind(null, e),
13513
13513
  e;
13514
13514
  }
13515
13515
 
@@ -13520,7 +13520,7 @@ function xa(t) {
13520
13520
  * @param syncEngine - SyncEngine to use.
13521
13521
  * @param bundleReader - Bundle to load into the SDK.
13522
13522
  * @param task - LoadBundleTask used to update the loading progress to public API.
13523
- */ function ka(t, e, n) {
13523
+ */ function kc(t, e, n) {
13524
13524
  const s = q(t);
13525
13525
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
13526
13526
  (async function(t, e, n) {
@@ -13552,7 +13552,7 @@ function xa(t) {
13552
13552
  // TODO(b/160876443): This currently raises snapshots with
13553
13553
  // `fromCache=false` if users already listen to some queries and bundles
13554
13554
  // has newer version.
13555
- await Ea(t, o.Tn,
13555
+ await Ec(t, o.Tn,
13556
13556
  /* remoteEvent */ void 0),
13557
13557
  // Save metadata, so loading the same bundle will skip.
13558
13558
  await function(t, e) {
@@ -13591,7 +13591,7 @@ function xa(t) {
13591
13591
  }));
13592
13592
  }
13593
13593
 
13594
- class $a {
13594
+ class $c {
13595
13595
  constructor() {
13596
13596
  this.synchronizeTabs = !1;
13597
13597
  }
@@ -13603,7 +13603,7 @@ class $a {
13603
13603
  return null;
13604
13604
  }
13605
13605
  Ho(t) {
13606
- return hr(this.persistence, new cr, t.initialUser, this.N);
13606
+ return hr(this.persistence, new ar, t.initialUser, this.N);
13607
13607
  }
13608
13608
  Go(t) {
13609
13609
  return new Nr(kr.Ns, this.N);
@@ -13619,21 +13619,21 @@ class $a {
13619
13619
 
13620
13620
  /**
13621
13621
  * Provides all components needed for Firestore with IndexedDB persistence.
13622
- */ class Oa extends $a {
13622
+ */ class Oc extends $c {
13623
13623
  constructor(t, e, n) {
13624
13624
  super(), this.Jo = t, this.cacheSizeBytes = e, this.forceOwnership = n, this.synchronizeTabs = !1;
13625
13625
  }
13626
13626
  async initialize(t) {
13627
13627
  await super.initialize(t), await Ir(this.localStore), await this.Jo.initialize(this, t),
13628
13628
  // Enqueue writes from a previous session
13629
- await xa(this.Jo.syncEngine), await Io(this.Jo.remoteStore),
13629
+ await xc(this.Jo.syncEngine), await Io(this.Jo.remoteStore),
13630
13630
  // NOTE: This will immediately call the listener, so we make sure to
13631
13631
  // set it after localStore / remoteStore are started.
13632
13632
  await this.persistence.nn((() => (this.gcScheduler && !this.gcScheduler.started && this.gcScheduler.start(this.localStore),
13633
13633
  Promise.resolve())));
13634
13634
  }
13635
13635
  Ho(t) {
13636
- return hr(this.persistence, new cr, t.initialUser, this.N);
13636
+ return hr(this.persistence, new ar, t.initialUser, this.N);
13637
13637
  }
13638
13638
  zo(t) {
13639
13639
  const e = this.persistence.referenceDelegate.garbageCollector;
@@ -13655,7 +13655,7 @@ class $a {
13655
13655
  * In the legacy client, this provider is used to provide both multi-tab and
13656
13656
  * non-multi-tab persistence since we cannot tell at build time whether
13657
13657
  * `synchronizeTabs` will be enabled.
13658
- */ class Fa extends Oa {
13658
+ */ class Fc extends Oc {
13659
13659
  constructor(t, e) {
13660
13660
  super(t, e, /* forceOwnership= */ !1), this.Jo = t, this.cacheSizeBytes = e, this.synchronizeTabs = !0;
13661
13661
  }
@@ -13663,16 +13663,16 @@ class $a {
13663
13663
  await super.initialize(t);
13664
13664
  const e = this.Jo.syncEngine;
13665
13665
  this.sharedClientState instanceof Kr && (this.sharedClientState.syncEngine = {
13666
- _i: ba.bind(null, e),
13667
- mi: Da.bind(null, e),
13668
- gi: Ca.bind(null, e),
13669
- pn: Sa.bind(null, e),
13670
- wi: Ra.bind(null, e)
13666
+ _i: bc.bind(null, e),
13667
+ mi: Dc.bind(null, e),
13668
+ gi: Cc.bind(null, e),
13669
+ pn: Sc.bind(null, e),
13670
+ wi: Rc.bind(null, e)
13671
13671
  }, await this.sharedClientState.start()),
13672
13672
  // NOTE: This will immediately call the listener, so we make sure to
13673
13673
  // set it after localStore / remoteStore are started.
13674
13674
  await this.persistence.nn((async t => {
13675
- await Pa(this.Jo.syncEngine, t), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : t || this.gcScheduler.stop());
13675
+ await Pc(this.Jo.syncEngine, t), this.gcScheduler && (t && !this.gcScheduler.started ? this.gcScheduler.start(this.localStore) : t || this.gcScheduler.stop());
13676
13676
  }));
13677
13677
  }
13678
13678
  Wo(t) {
@@ -13686,13 +13686,13 @@ class $a {
13686
13686
  /**
13687
13687
  * Initializes and wires the components that are needed to interface with the
13688
13688
  * network.
13689
- */ class Ma {
13689
+ */ class Mc {
13690
13690
  async initialize(t, e) {
13691
13691
  this.localStore || (this.localStore = t.localStore, this.sharedClientState = t.sharedClientState,
13692
13692
  this.datastore = this.createDatastore(e), this.remoteStore = this.createRemoteStore(e),
13693
13693
  this.eventManager = this.createEventManager(e), this.syncEngine = this.createSyncEngine(e,
13694
- /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => ca(this.syncEngine, t, 1 /* SharedClientState */),
13695
- this.remoteStore.remoteSyncer.handleCredentialChange = Ta.bind(null, this.syncEngine),
13694
+ /* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => ac(this.syncEngine, t, 1 /* SharedClientState */),
13695
+ this.remoteStore.remoteSyncer.handleCredentialChange = Tc.bind(null, this.syncEngine),
13696
13696
  await Co(this.remoteStore, this.syncEngine.isPrimaryClient));
13697
13697
  }
13698
13698
  createEventManager(t) {
@@ -13706,7 +13706,7 @@ class $a {
13706
13706
  }(t.credentials, n, e);
13707
13707
  }
13708
13708
  createRemoteStore(t) {
13709
- return e = this.localStore, n = this.datastore, s = t.asyncQueue, i = t => ca(this.syncEngine, t, 0 /* RemoteStore */),
13709
+ return e = this.localStore, n = this.datastore, s = t.asyncQueue, i = t => ac(this.syncEngine, t, 0 /* RemoteStore */),
13710
13710
  r = Wr.bt() ? new Wr : new Qr, new ro(e, n, s, i, r);
13711
13711
  var e, n, s, i, r;
13712
13712
  /** Re-enables the network. Idempotent. */ }
@@ -13714,14 +13714,14 @@ class $a {
13714
13714
  return function(t, e, n,
13715
13715
  // PORTING NOTE: Manages state synchronization in multi-tab environments.
13716
13716
  s, i, r, o) {
13717
- const a = new na(t, e, n, s, i, r);
13718
- return o && (a.qo = !0), a;
13717
+ const c = new nc(t, e, n, s, i, r);
13718
+ return o && (c.qo = !0), c;
13719
13719
  }(this.localStore, this.remoteStore, this.eventManager, this.sharedClientState, t.initialUser, t.maxConcurrentLimboResolutions, e);
13720
13720
  }
13721
13721
  terminate() {
13722
13722
  return async function(t) {
13723
13723
  const e = q(t);
13724
- $("RemoteStore", "RemoteStore shutting down."), e.Kr.add(5 /* Shutdown */), await ao(e),
13724
+ $("RemoteStore", "RemoteStore shutting down."), e.Kr.add(5 /* Shutdown */), await co(e),
13725
13725
  e.Qr.shutdown(),
13726
13726
  // Set the OnlineState to Unknown (rather than Offline) to avoid potentially
13727
13727
  // triggering spurious listener events with cached data, etc.
@@ -13757,7 +13757,7 @@ class $a {
13757
13757
  * @param bytesPerRead - How many bytes each `read()` from the returned reader
13758
13758
  * will read.
13759
13759
  */
13760
- function La(t, e = 10240) {
13760
+ function Lc(t, e = 10240) {
13761
13761
  let n = 0;
13762
13762
  // The TypeScript definition for ReadableStreamReader changed. We use
13763
13763
  // `any` here to allow this code to compile with different versions.
@@ -13823,7 +13823,7 @@ function La(t, e = 10240) {
13823
13823
  * asynchronously. To allow immediate silencing, a mute call is added which
13824
13824
  * causes events scheduled to no longer be raised.
13825
13825
  */
13826
- class Ba {
13826
+ class Bc {
13827
13827
  constructor(t) {
13828
13828
  this.observer = t,
13829
13829
  /**
@@ -13869,7 +13869,7 @@ class Ba {
13869
13869
  *
13870
13870
  * Takes a bundle stream or buffer, and presents abstractions to read bundled
13871
13871
  * elements out of the underlying content.
13872
- */ class Ua {
13872
+ */ class Uc {
13873
13873
  constructor(
13874
13874
  /** The reader to read from underlying binary bundle data source. */
13875
13875
  t, e) {
@@ -13880,9 +13880,9 @@ class Ba {
13880
13880
  * Internal buffer to hold bundle content, accumulating incomplete element
13881
13881
  * content.
13882
13882
  */
13883
- this.buffer = new Uint8Array, this.ta = new TextDecoder("utf-8"),
13883
+ this.buffer = new Uint8Array, this.tc = new TextDecoder("utf-8"),
13884
13884
  // Read the metadata (which is the first element).
13885
- this.ea().then((t => {
13885
+ this.ec().then((t => {
13886
13886
  t && t.ho() ? this.metadata.resolve(t.payload.metadata) : this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\n ${JSON.stringify(null == t ? void 0 : t.payload)}`));
13887
13887
  }), (t => this.metadata.reject(t)));
13888
13888
  }
@@ -13894,7 +13894,7 @@ class Ba {
13894
13894
  }
13895
13895
  async Qo() {
13896
13896
  // Makes sure metadata is read before proceeding.
13897
- return await this.getMetadata(), this.ea();
13897
+ return await this.getMetadata(), this.ec();
13898
13898
  }
13899
13899
  /**
13900
13900
  * Reads from the head of internal buffer, and pulling more data from
@@ -13905,15 +13905,15 @@ class Ba {
13905
13905
  *
13906
13906
  * Returns either the bundled element, or null if we have reached the end of
13907
13907
  * the stream.
13908
- */ async ea() {
13909
- const t = await this.na();
13908
+ */ async ec() {
13909
+ const t = await this.nc();
13910
13910
  if (null === t) return null;
13911
- const e = this.ta.decode(t), n = Number(e);
13912
- isNaN(n) && this.sa(`length string (${e}) is not valid number`);
13913
- const s = await this.ia(n);
13911
+ const e = this.tc.decode(t), n = Number(e);
13912
+ isNaN(n) && this.sc(`length string (${e}) is not valid number`);
13913
+ const s = await this.ic(n);
13914
13914
  return new Go(JSON.parse(s), t.length + n);
13915
13915
  }
13916
- /** First index of '{' from the underlying buffer. */ ra() {
13916
+ /** First index of '{' from the underlying buffer. */ rc() {
13917
13917
  return this.buffer.findIndex((t => t === "{".charCodeAt(0)));
13918
13918
  }
13919
13919
  /**
@@ -13921,17 +13921,17 @@ class Ba {
13921
13921
  * return the content.
13922
13922
  *
13923
13923
  * If reached end of the stream, returns a null.
13924
- */ async na() {
13925
- for (;this.ra() < 0; ) {
13926
- if (await this.oa()) break;
13924
+ */ async nc() {
13925
+ for (;this.rc() < 0; ) {
13926
+ if (await this.oc()) break;
13927
13927
  }
13928
13928
  // Broke out of the loop because underlying stream is closed, and there
13929
13929
  // happens to be no more data to process.
13930
13930
  if (0 === this.buffer.length) return null;
13931
- const t = this.ra();
13931
+ const t = this.rc();
13932
13932
  // Broke out of the loop because underlying stream is closed, but still
13933
13933
  // cannot find an open bracket.
13934
- t < 0 && this.sa("Reached the end of bundle when a length string is expected.");
13934
+ t < 0 && this.sc("Reached the end of bundle when a length string is expected.");
13935
13935
  const e = this.buffer.slice(0, t);
13936
13936
  // Update the internal buffer to drop the read length.
13937
13937
  return this.buffer = this.buffer.slice(t), e;
@@ -13941,22 +13941,22 @@ class Ba {
13941
13941
  * number of bytes, pulling more data from the underlying stream if needed.
13942
13942
  *
13943
13943
  * Returns a string decoded from the read bytes.
13944
- */ async ia(t) {
13944
+ */ async ic(t) {
13945
13945
  for (;this.buffer.length < t; ) {
13946
- await this.oa() && this.sa("Reached the end of bundle when more is expected.");
13946
+ await this.oc() && this.sc("Reached the end of bundle when more is expected.");
13947
13947
  }
13948
- const e = this.ta.decode(this.buffer.slice(0, t));
13948
+ const e = this.tc.decode(this.buffer.slice(0, t));
13949
13949
  // Update the internal buffer to drop the read json string.
13950
13950
  return this.buffer = this.buffer.slice(t), e;
13951
13951
  }
13952
- sa(t) {
13952
+ sc(t) {
13953
13953
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
13954
13954
  throw this.Zo.cancel(), new Error(`Invalid bundle format: ${t}`);
13955
13955
  }
13956
13956
  /**
13957
13957
  * Pulls more data from underlying stream to internal buffer.
13958
13958
  * Returns a boolean indicating whether the stream is finished.
13959
- */ async oa() {
13959
+ */ async oc() {
13960
13960
  const t = await this.Zo.read();
13961
13961
  if (!t.done) {
13962
13962
  const e = new Uint8Array(this.buffer.length + t.value.length);
@@ -13986,7 +13986,7 @@ class Ba {
13986
13986
  * Internal transaction object responsible for accumulating the mutations to
13987
13987
  * perform and the base versions for any documents read.
13988
13988
  */
13989
- class qa {
13989
+ class qc {
13990
13990
  constructor(t) {
13991
13991
  this.datastore = t,
13992
13992
  // The version of each document that was read during this transaction.
@@ -14014,11 +14014,11 @@ class qa {
14014
14014
  const e = ns(n.N, t);
14015
14015
  o.set(e.key.toString(), e);
14016
14016
  }));
14017
- const a = [];
14017
+ const c = [];
14018
14018
  return e.forEach((t => {
14019
14019
  const e = o.get(t.toString());
14020
- B(!!e), a.push(e);
14021
- })), a;
14020
+ B(!!e), c.push(e);
14021
+ })), c;
14022
14022
  }(this.datastore, t);
14023
14023
  return e.forEach((t => this.recordVersion(t))), e;
14024
14024
  }
@@ -14034,7 +14034,7 @@ class qa {
14034
14034
  this.writtenDocs.add(t.toString());
14035
14035
  }
14036
14036
  delete(t) {
14037
- this.write(new cn(t, this.precondition(t))), this.writtenDocs.add(t.toString());
14037
+ this.write(new an(t, this.precondition(t))), this.writtenDocs.add(t.toString());
14038
14038
  }
14039
14039
  async commit() {
14040
14040
  if (this.ensureCommitNotCalled(), this.lastWriteError) throw this.lastWriteError;
@@ -14127,29 +14127,29 @@ class qa {
14127
14127
  * TransactionRunner encapsulates the logic needed to run and retry transactions
14128
14128
  * with backoff.
14129
14129
  */
14130
- class Ka {
14130
+ class Kc {
14131
14131
  constructor(t, e, n, s) {
14132
14132
  this.asyncQueue = t, this.datastore = e, this.updateFunction = n, this.deferred = s,
14133
- this.aa = 5, this.rr = new Zr(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
14133
+ this.cc = 5, this.rr = new Zr(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
14134
14134
  }
14135
14135
  /** Runs the transaction and sets the result on deferred. */ run() {
14136
- this.aa -= 1, this.ca();
14136
+ this.cc -= 1, this.ac();
14137
14137
  }
14138
- ca() {
14138
+ ac() {
14139
14139
  this.rr.Xi((async () => {
14140
- const t = new qa(this.datastore), e = this.ua(t);
14140
+ const t = new qc(this.datastore), e = this.uc(t);
14141
14141
  e && e.then((e => {
14142
14142
  this.asyncQueue.enqueueAndForget((() => t.commit().then((() => {
14143
14143
  this.deferred.resolve(e);
14144
14144
  })).catch((t => {
14145
- this.ha(t);
14145
+ this.hc(t);
14146
14146
  }))));
14147
14147
  })).catch((t => {
14148
- this.ha(t);
14148
+ this.hc(t);
14149
14149
  }));
14150
14150
  }));
14151
14151
  }
14152
- ua(t) {
14152
+ uc(t) {
14153
14153
  try {
14154
14154
  const e = this.updateFunction(t);
14155
14155
  return !Rt(e) && e.catch && e.then ? e : (this.deferred.reject(Error("Transaction callback must return a Promise")),
@@ -14159,11 +14159,11 @@ class Ka {
14159
14159
  return this.deferred.reject(t), null;
14160
14160
  }
14161
14161
  }
14162
- ha(t) {
14163
- this.aa > 0 && this.la(t) ? (this.aa -= 1, this.asyncQueue.enqueueAndForget((() => (this.ca(),
14162
+ hc(t) {
14163
+ this.cc > 0 && this.lc(t) ? (this.cc -= 1, this.asyncQueue.enqueueAndForget((() => (this.ac(),
14164
14164
  Promise.resolve())))) : this.deferred.reject(t);
14165
14165
  }
14166
- la(t) {
14166
+ lc(t) {
14167
14167
  if ("FirebaseError" === t.name) {
14168
14168
  // In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and
14169
14169
  // non-matching document versions with ABORTED. These errors should be retried.
@@ -14195,7 +14195,7 @@ class Ka {
14195
14195
  * pieces of the client SDK architecture. It is responsible for creating the
14196
14196
  * async queue that is shared by all of the other components in the system.
14197
14197
  */
14198
- class ja {
14198
+ class jc {
14199
14199
  constructor(t,
14200
14200
  /**
14201
14201
  * Asynchronous queue responsible for all of our internal processing. When
@@ -14249,7 +14249,7 @@ class ja {
14249
14249
  }
14250
14250
  }
14251
14251
 
14252
- async function Qa(t, e) {
14252
+ async function Qc(t, e) {
14253
14253
  t.asyncQueue.verifyOperationInProgress(), $("FirestoreClient", "Initializing OfflineComponentProvider");
14254
14254
  const n = await t.getConfiguration();
14255
14255
  await e.initialize(n);
@@ -14262,9 +14262,9 @@ async function Qa(t, e) {
14262
14262
  e.persistence.setDatabaseDeletedListener((() => t.terminate())), t.offlineComponents = e;
14263
14263
  }
14264
14264
 
14265
- async function Wa(t, e) {
14265
+ async function Wc(t, e) {
14266
14266
  t.asyncQueue.verifyOperationInProgress();
14267
- const n = await Ga(t);
14267
+ const n = await Gc(t);
14268
14268
  $("FirestoreClient", "Initializing OnlineComponentProvider");
14269
14269
  const s = await t.getConfiguration();
14270
14270
  await e.initialize(n, s),
@@ -14277,48 +14277,48 @@ async function Wa(t, e) {
14277
14277
  // Tear down and re-create our network streams. This will ensure we get a
14278
14278
  // fresh auth token for the new user and re-fill the write pipeline with
14279
14279
  // new mutations from the LocalStore (since mutations are per-user).
14280
- n.Kr.add(3 /* CredentialChange */), await ao(n), s &&
14280
+ n.Kr.add(3 /* CredentialChange */), await co(n), s &&
14281
14281
  // Don't set the network status to Unknown if we are offline.
14282
14282
  n.Wr.set("Unknown" /* Unknown */), await n.remoteSyncer.handleCredentialChange(e),
14283
14283
  n.Kr.delete(3 /* CredentialChange */), await oo(n);
14284
14284
  }(e.remoteStore, t))), t.onlineComponents = e;
14285
14285
  }
14286
14286
 
14287
- async function Ga(t) {
14287
+ async function Gc(t) {
14288
14288
  return t.offlineComponents || ($("FirestoreClient", "Using default OfflineComponentProvider"),
14289
- await Qa(t, new $a)), t.offlineComponents;
14289
+ await Qc(t, new $c)), t.offlineComponents;
14290
14290
  }
14291
14291
 
14292
- async function za(t) {
14292
+ async function zc(t) {
14293
14293
  return t.onlineComponents || ($("FirestoreClient", "Using default OnlineComponentProvider"),
14294
- await Wa(t, new Ma)), t.onlineComponents;
14294
+ await Wc(t, new Mc)), t.onlineComponents;
14295
14295
  }
14296
14296
 
14297
- function Ha(t) {
14298
- return Ga(t).then((t => t.persistence));
14297
+ function Hc(t) {
14298
+ return Gc(t).then((t => t.persistence));
14299
14299
  }
14300
14300
 
14301
- function Ja(t) {
14302
- return Ga(t).then((t => t.localStore));
14301
+ function Jc(t) {
14302
+ return Gc(t).then((t => t.localStore));
14303
14303
  }
14304
14304
 
14305
- function Ya(t) {
14306
- return za(t).then((t => t.remoteStore));
14305
+ function Yc(t) {
14306
+ return zc(t).then((t => t.remoteStore));
14307
14307
  }
14308
14308
 
14309
- function Xa(t) {
14310
- return za(t).then((t => t.syncEngine));
14309
+ function Xc(t) {
14310
+ return zc(t).then((t => t.syncEngine));
14311
14311
  }
14312
14312
 
14313
- async function Za(t) {
14314
- const e = await za(t), n = e.eventManager;
14315
- return n.onListen = sa.bind(null, e.syncEngine), n.onUnlisten = ra.bind(null, e.syncEngine),
14313
+ async function Zc(t) {
14314
+ const e = await zc(t), n = e.eventManager;
14315
+ return n.onListen = sc.bind(null, e.syncEngine), n.onUnlisten = rc.bind(null, e.syncEngine),
14316
14316
  n;
14317
14317
  }
14318
14318
 
14319
- /** Enables the network connection and re-enqueues all pending operations. */ function tc(t) {
14319
+ /** Enables the network connection and re-enqueues all pending operations. */ function ta(t) {
14320
14320
  return t.asyncQueue.enqueue((async () => {
14321
- const e = await Ha(t), n = await Ya(t);
14321
+ const e = await Hc(t), n = await Yc(t);
14322
14322
  return e.setNetworkEnabled(!0), function(t) {
14323
14323
  const e = q(t);
14324
14324
  return e.Kr.delete(0 /* UserDisabled */), oo(e);
@@ -14326,12 +14326,12 @@ async function Za(t) {
14326
14326
  }));
14327
14327
  }
14328
14328
 
14329
- /** Disables the network connection. Pending operations will not complete. */ function ec(t) {
14329
+ /** Disables the network connection. Pending operations will not complete. */ function ea(t) {
14330
14330
  return t.asyncQueue.enqueue((async () => {
14331
- const e = await Ha(t), n = await Ya(t);
14331
+ const e = await Hc(t), n = await Yc(t);
14332
14332
  return e.setNetworkEnabled(!1), async function(t) {
14333
14333
  const e = q(t);
14334
- e.Kr.add(0 /* UserDisabled */), await ao(e),
14334
+ e.Kr.add(0 /* UserDisabled */), await co(e),
14335
14335
  // Set the OnlineState to Offline so get()s return from cache, etc.
14336
14336
  e.Wr.set("Offline" /* Offline */);
14337
14337
  }(n);
@@ -14342,7 +14342,7 @@ async function Za(t) {
14342
14342
  * Returns a Promise that resolves when all writes that were pending at the time
14343
14343
  * this method was called received server acknowledgement. An acknowledgement
14344
14344
  * can be either acceptance or rejection.
14345
- */ function nc(t, e) {
14345
+ */ function na(t, e) {
14346
14346
  const n = new Q;
14347
14347
  return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {
14348
14348
  try {
@@ -14359,19 +14359,19 @@ async function Za(t) {
14359
14359
  /**
14360
14360
  * Retrieves a latency-compensated document from the backend via a
14361
14361
  * SnapshotListener.
14362
- */ (await Ja(t), e, n))), n.promise;
14362
+ */ (await Jc(t), e, n))), n.promise;
14363
14363
  }
14364
14364
 
14365
- function sc(t, e, n = {}) {
14365
+ function sa(t, e, n = {}) {
14366
14366
  const s = new Q;
14367
14367
  return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {
14368
- const r = new Ba({
14368
+ const r = new Bc({
14369
14369
  next: r => {
14370
14370
  // Remove query first before passing event to user to avoid
14371
14371
  // user actions affecting the now stale query.
14372
14372
  e.enqueueAndForget((() => qo(t, o)));
14373
- const a = r.docs.has(n);
14374
- !a && r.fromCache ?
14373
+ const c = r.docs.has(n);
14374
+ !c && r.fromCache ?
14375
14375
  // TODO(dimond): If we're online and the document doesn't
14376
14376
  // exist then we resolve with a doc.exists set to false. If
14377
14377
  // we're offline however, we reject the Promise in this
@@ -14379,7 +14379,7 @@ function sc(t, e, n = {}) {
14379
14379
  // the server so we can deliver that even when you're
14380
14380
  // offline 2) Actually reject the Promise in the online case
14381
14381
  // if the document doesn't exist.
14382
- i.reject(new j(K.UNAVAILABLE, "Failed to get document because the client is offline.")) : a && r.fromCache && s && "server" === s.source ? i.reject(new j(K.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')) : i.resolve(r);
14382
+ i.reject(new j(K.UNAVAILABLE, "Failed to get document because the client is offline.")) : c && r.fromCache && s && "server" === s.source ? i.reject(new j(K.UNAVAILABLE, 'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')) : i.resolve(r);
14383
14383
  },
14384
14384
  error: t => i.reject(t)
14385
14385
  }), o = new Wo(_e(n.path), r, {
@@ -14387,10 +14387,10 @@ function sc(t, e, n = {}) {
14387
14387
  uo: !0
14388
14388
  });
14389
14389
  return Uo(t, o);
14390
- }(await Za(t), t.asyncQueue, e, n, s))), s.promise;
14390
+ }(await Zc(t), t.asyncQueue, e, n, s))), s.promise;
14391
14391
  }
14392
14392
 
14393
- function ic(t, e) {
14393
+ function ia(t, e) {
14394
14394
  const n = new Q;
14395
14395
  return t.asyncQueue.enqueueAndForget((async () => async function(t, e, n) {
14396
14396
  try {
@@ -14406,13 +14406,13 @@ function ic(t, e) {
14406
14406
  /**
14407
14407
  * Retrieves a latency-compensated query snapshot from the backend via a
14408
14408
  * SnapshotListener.
14409
- */ (await Ja(t), e, n))), n.promise;
14409
+ */ (await Jc(t), e, n))), n.promise;
14410
14410
  }
14411
14411
 
14412
- function rc(t, e, n = {}) {
14412
+ function ra(t, e, n = {}) {
14413
14413
  const s = new Q;
14414
14414
  return t.asyncQueue.enqueueAndForget((async () => function(t, e, n, s, i) {
14415
- const r = new Ba({
14415
+ const r = new Bc({
14416
14416
  next: n => {
14417
14417
  // Remove query first before passing event to user to avoid
14418
14418
  // user actions affecting the now stale query.
@@ -14424,20 +14424,20 @@ function rc(t, e, n = {}) {
14424
14424
  uo: !0
14425
14425
  });
14426
14426
  return Uo(t, o);
14427
- }(await Za(t), t.asyncQueue, e, n, s))), s.promise;
14427
+ }(await Zc(t), t.asyncQueue, e, n, s))), s.promise;
14428
14428
  }
14429
14429
 
14430
- function oc(t, e) {
14431
- const n = new Ba(e);
14430
+ function oa(t, e) {
14431
+ const n = new Bc(e);
14432
14432
  return t.asyncQueue.enqueueAndForget((async () => function(t, e) {
14433
14433
  q(t).Zr.add(e),
14434
14434
  // Immediately fire an initial event, indicating all existing listeners
14435
14435
  // are in-sync.
14436
14436
  e.next();
14437
- }(await Za(t), n))), () => {
14437
+ }(await Zc(t), n))), () => {
14438
14438
  n.Xo(), t.asyncQueue.enqueueAndForget((async () => function(t, e) {
14439
14439
  q(t).Zr.delete(e);
14440
- }(await Za(t), n)));
14440
+ }(await Zc(t), n)));
14441
14441
  };
14442
14442
  }
14443
14443
 
@@ -14455,25 +14455,25 @@ function oc(t, e) {
14455
14455
  * accessed with the transaction will not reflect local changes that have not
14456
14456
  * been committed. For this reason, it is required that all reads are
14457
14457
  * performed before any writes. Transactions must be performed while online.
14458
- */ function ac(t, e) {
14458
+ */ function ca(t, e) {
14459
14459
  const n = new Q;
14460
14460
  return t.asyncQueue.enqueueAndForget((async () => {
14461
14461
  const s = await function(t) {
14462
- return za(t).then((t => t.datastore));
14462
+ return zc(t).then((t => t.datastore));
14463
14463
  }(t);
14464
- new Ka(t.asyncQueue, s, e, n).run();
14464
+ new Kc(t.asyncQueue, s, e, n).run();
14465
14465
  })), n.promise;
14466
14466
  }
14467
14467
 
14468
- function cc(t, e, n, s) {
14468
+ function aa(t, e, n, s) {
14469
14469
  const i = function(t, e) {
14470
14470
  let n;
14471
14471
  n = "string" == typeof t ? (new TextEncoder).encode(t) : t;
14472
14472
  return function(t, e) {
14473
- return new Ua(t, e);
14473
+ return new Uc(t, e);
14474
14474
  }(function(t, e) {
14475
- if (t instanceof Uint8Array) return La(t, e);
14476
- if (t instanceof ArrayBuffer) return La(new Uint8Array(t), e);
14475
+ if (t instanceof Uint8Array) return Lc(t, e);
14476
+ if (t instanceof ArrayBuffer) return Lc(new Uint8Array(t), e);
14477
14477
  if (t instanceof ReadableStream) return t.getReader();
14478
14478
  throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream");
14479
14479
  }(n), e);
@@ -14495,18 +14495,18 @@ function cc(t, e, n, s) {
14495
14495
  * limitations under the License.
14496
14496
  */ (n, Xr(e));
14497
14497
  t.asyncQueue.enqueueAndForget((async () => {
14498
- ka(await Xa(t), i, s);
14498
+ kc(await Xc(t), i, s);
14499
14499
  }));
14500
14500
  }
14501
14501
 
14502
- function uc(t, e) {
14502
+ function ua(t, e) {
14503
14503
  return t.asyncQueue.enqueue((async () => function(t, e) {
14504
14504
  const n = q(t);
14505
14505
  return n.persistence.runTransaction("Get named query", "readonly", (t => n.Je.getNamedQuery(t, e)));
14506
- }(await Ja(t), e)));
14506
+ }(await Jc(t), e)));
14507
14507
  }
14508
14508
 
14509
- class hc {
14509
+ class ha {
14510
14510
  /**
14511
14511
  * Constructs a DatabaseInfo using the provided host, databaseId and
14512
14512
  * persistenceKey.
@@ -14524,9 +14524,9 @@ class hc {
14524
14524
  * @param useFetchStreams Whether to use the Fetch API instead of
14525
14525
  * XMLHTTPRequest
14526
14526
  */
14527
- constructor(t, e, n, s, i, r, o, a) {
14527
+ constructor(t, e, n, s, i, r, o, c) {
14528
14528
  this.databaseId = t, this.appId = e, this.persistenceKey = n, this.host = s, this.ssl = i,
14529
- this.forceLongPolling = r, this.autoDetectLongPolling = o, this.useFetchStreams = a;
14529
+ this.forceLongPolling = r, this.autoDetectLongPolling = o, this.useFetchStreams = c;
14530
14530
  }
14531
14531
  }
14532
14532
 
@@ -14535,7 +14535,7 @@ class hc {
14535
14535
  * Represents the database ID a Firestore client is associated with.
14536
14536
  * @internal
14537
14537
  */
14538
- class lc {
14538
+ class la {
14539
14539
  constructor(t, e) {
14540
14540
  this.projectId = t, this.database = e || "(default)";
14541
14541
  }
@@ -14543,7 +14543,7 @@ class lc {
14543
14543
  return "(default)" === this.database;
14544
14544
  }
14545
14545
  isEqual(t) {
14546
- return t instanceof lc && t.projectId === this.projectId && t.database === this.database;
14546
+ return t instanceof la && t.projectId === this.projectId && t.database === this.database;
14547
14547
  }
14548
14548
  }
14549
14549
 
@@ -14562,7 +14562,7 @@ class lc {
14562
14562
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14563
14563
  * See the License for the specific language governing permissions and
14564
14564
  * limitations under the License.
14565
- */ const fc = new Map;
14565
+ */ const fa = new Map;
14566
14566
 
14567
14567
  /**
14568
14568
  * An instance map that ensures only one Datastore exists per Firestore
@@ -14584,28 +14584,28 @@ class lc {
14584
14584
  * See the License for the specific language governing permissions and
14585
14585
  * limitations under the License.
14586
14586
  */
14587
- function dc(t, e, n) {
14587
+ function da(t, e, n) {
14588
14588
  if (!n) throw new j(K.INVALID_ARGUMENT, `Function ${t}() cannot be called with an empty ${e}.`);
14589
14589
  }
14590
14590
 
14591
14591
  /**
14592
14592
  * Validates that two boolean options are not set at the same time.
14593
14593
  * @internal
14594
- */ function wc(t, e, n, s) {
14594
+ */ function wa(t, e, n, s) {
14595
14595
  if (!0 === e && !0 === s) throw new j(K.INVALID_ARGUMENT, `${t} and ${n} cannot be used together.`);
14596
14596
  }
14597
14597
 
14598
14598
  /**
14599
14599
  * Validates that `path` refers to a document (indicated by the fact it contains
14600
14600
  * an even numbers of segments).
14601
- */ function _c(t) {
14601
+ */ function _a(t) {
14602
14602
  if (!vt.isDocumentKey(t)) throw new j(K.INVALID_ARGUMENT, `Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`);
14603
14603
  }
14604
14604
 
14605
14605
  /**
14606
14606
  * Validates that `path` refers to a collection (indicated by the fact it
14607
14607
  * contains an odd numbers of segments).
14608
- */ function mc(t) {
14608
+ */ function ma(t) {
14609
14609
  if (vt.isDocumentKey(t)) throw new j(K.INVALID_ARGUMENT, `Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`);
14610
14610
  }
14611
14611
 
@@ -14614,7 +14614,7 @@ function dc(t, e, n) {
14614
14614
  * (i.e. excludes Array, Date, etc.).
14615
14615
  */
14616
14616
  /** Returns a string describing the type / value of the provided input. */
14617
- function gc(t) {
14617
+ function ga(t) {
14618
14618
  if (void 0 === t) return "undefined";
14619
14619
  if (null === t) return "null";
14620
14620
  if ("string" == typeof t) return t.length > 20 && (t = `${t.substring(0, 20)}...`),
@@ -14646,7 +14646,7 @@ function gc(t) {
14646
14646
  return "function" == typeof t ? "a function" : L();
14647
14647
  }
14648
14648
 
14649
- function yc(t,
14649
+ function ya(t,
14650
14650
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14651
14651
  e) {
14652
14652
  if ("_delegate" in t && (
@@ -14655,14 +14655,14 @@ e) {
14655
14655
  t = t._delegate), !(t instanceof e)) {
14656
14656
  if (e.name === t.constructor.name) throw new j(K.INVALID_ARGUMENT, "Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");
14657
14657
  {
14658
- const n = gc(t);
14658
+ const n = ga(t);
14659
14659
  throw new j(K.INVALID_ARGUMENT, `Expected type '${e.name}', but it was: ${n}`);
14660
14660
  }
14661
14661
  }
14662
14662
  return t;
14663
14663
  }
14664
14664
 
14665
- function pc(t, e) {
14665
+ function pa(t, e) {
14666
14666
  if (e <= 0) throw new j(K.INVALID_ARGUMENT, `Function ${t}() requires a positive number, but it was: ${e}.`);
14667
14667
  }
14668
14668
 
@@ -14688,7 +14688,7 @@ function pc(t, e) {
14688
14688
  * user-supplied `FirestoreSettings` object. This is a separate type so that
14689
14689
  * defaults can be supplied and the value can be checked for equality.
14690
14690
  */
14691
- class Ec {
14691
+ class Ea {
14692
14692
  constructor(t) {
14693
14693
  var e;
14694
14694
  if (void 0 === t.host) {
@@ -14701,7 +14701,7 @@ class Ec {
14701
14701
  this.cacheSizeBytes = t.cacheSizeBytes;
14702
14702
  }
14703
14703
  this.experimentalForceLongPolling = !!t.experimentalForceLongPolling, this.experimentalAutoDetectLongPolling = !!t.experimentalAutoDetectLongPolling,
14704
- this.useFetchStreams = !!t.useFetchStreams, wc("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling);
14704
+ this.useFetchStreams = !!t.useFetchStreams, wa("experimentalForceLongPolling", t.experimentalForceLongPolling, "experimentalAutoDetectLongPolling", t.experimentalAutoDetectLongPolling);
14705
14705
  }
14706
14706
  isEqual(t) {
14707
14707
  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;
@@ -14728,18 +14728,18 @@ class Ec {
14728
14728
  * The Cloud Firestore service interface.
14729
14729
  *
14730
14730
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
14731
- */ class Tc {
14731
+ */ class Ta {
14732
14732
  /** @hideconstructor */
14733
14733
  constructor(t, e) {
14734
14734
  this._credentials = e,
14735
14735
  /**
14736
14736
  * Whether it's a Firestore or Firestore Lite instance.
14737
14737
  */
14738
- this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new Ec({}),
14739
- this._settingsFrozen = !1, t instanceof lc ? this._databaseId = t : (this._app = t,
14738
+ this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new Ea({}),
14739
+ this._settingsFrozen = !1, t instanceof la ? this._databaseId = t : (this._app = t,
14740
14740
  this._databaseId = function(t) {
14741
14741
  if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new j(K.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
14742
- return new lc(t.options.projectId);
14742
+ return new la(t.options.projectId);
14743
14743
  }
14744
14744
  /**
14745
14745
  * Modify this instance to communicate with the Cloud Firestore emulator.
@@ -14770,7 +14770,7 @@ class Ec {
14770
14770
  }
14771
14771
  _setSettings(t) {
14772
14772
  if (this._settingsFrozen) throw new j(K.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.");
14773
- this._settings = new Ec(t), void 0 !== t.credentials && (this._credentials = function(t) {
14773
+ this._settings = new Ea(t), void 0 !== t.credentials && (this._credentials = function(t) {
14774
14774
  if (!t) return new G;
14775
14775
  switch (t.type) {
14776
14776
  case "gapi":
@@ -14815,15 +14815,15 @@ class Ec {
14815
14815
  * when the `Firestore` instance is terminated.
14816
14816
  */
14817
14817
  return function(t) {
14818
- const e = fc.get(t);
14819
- e && ($("ComponentProvider", "Removing Datastore"), fc.delete(t), e.terminate());
14818
+ const e = fa.get(t);
14819
+ e && ($("ComponentProvider", "Removing Datastore"), fa.delete(t), e.terminate());
14820
14820
  }(this), Promise.resolve();
14821
14821
  }
14822
14822
  }
14823
14823
 
14824
- function Ic(t, e, n, s = {}) {
14824
+ function Ia(t, e, n, s = {}) {
14825
14825
  var i;
14826
- const r = (t = yc(t, Tc))._getSettings();
14826
+ const r = (t = ya(t, Ta))._getSettings();
14827
14827
  if ("firestore.googleapis.com" !== r.host && r.host !== e && F("Host has been set in both settings() and useEmulator(), emulator host will be used"),
14828
14828
  t._setSettings(Object.assign(Object.assign({}, r), {
14829
14829
  host: `${e}:${n}`,
@@ -14862,7 +14862,7 @@ function Ic(t, e, n, s = {}) {
14862
14862
  * A `DocumentReference` refers to a document location in a Firestore database
14863
14863
  * and can be used to write, read, or listen to the location. The document at
14864
14864
  * the referenced location may or may not exist.
14865
- */ class Ac {
14865
+ */ class Aa {
14866
14866
  /** @hideconstructor */
14867
14867
  constructor(t,
14868
14868
  /**
@@ -14890,17 +14890,17 @@ function Ic(t, e, n, s = {}) {
14890
14890
  /**
14891
14891
  * The collection this `DocumentReference` belongs to.
14892
14892
  */ get parent() {
14893
- return new bc(this.firestore, this.converter, this._key.path.popLast());
14893
+ return new ba(this.firestore, this.converter, this._key.path.popLast());
14894
14894
  }
14895
14895
  withConverter(t) {
14896
- return new Ac(this.firestore, t, this._key);
14896
+ return new Aa(this.firestore, t, this._key);
14897
14897
  }
14898
14898
  }
14899
14899
 
14900
14900
  /**
14901
14901
  * A `Query` refers to a query which you can read or listen to. You can also
14902
14902
  * construct refined `Query` objects by adding filters and ordering.
14903
- */ class Rc {
14903
+ */ class Ra {
14904
14904
  // This is the lite version of the Query class in the main SDK.
14905
14905
  /** @hideconstructor protected */
14906
14906
  constructor(t,
@@ -14913,14 +14913,14 @@ function Ic(t, e, n, s = {}) {
14913
14913
  this.type = "query", this.firestore = t;
14914
14914
  }
14915
14915
  withConverter(t) {
14916
- return new Rc(this.firestore, t, this._query);
14916
+ return new Ra(this.firestore, t, this._query);
14917
14917
  }
14918
14918
  }
14919
14919
 
14920
14920
  /**
14921
14921
  * A `CollectionReference` object can be used for adding documents, getting
14922
14922
  * document references, and querying for documents (using {@link query}).
14923
- */ class bc extends Rc {
14923
+ */ class ba extends Ra {
14924
14924
  /** @hideconstructor */
14925
14925
  constructor(t, e, n) {
14926
14926
  super(t, e, _e(n)), this._path = n,
@@ -14941,23 +14941,23 @@ function Ic(t, e, n, s = {}) {
14941
14941
  * subcollection. If this isn't a subcollection, the reference is null.
14942
14942
  */ get parent() {
14943
14943
  const t = this._path.popLast();
14944
- return t.isEmpty() ? null : new Ac(this.firestore,
14944
+ return t.isEmpty() ? null : new Aa(this.firestore,
14945
14945
  /* converter= */ null, new vt(t));
14946
14946
  }
14947
14947
  withConverter(t) {
14948
- return new bc(this.firestore, t, this._path);
14948
+ return new ba(this.firestore, t, this._path);
14949
14949
  }
14950
14950
  }
14951
14951
 
14952
- function Pc(t, e, ...n) {
14953
- if (t = p(t), dc("collection", "path", e), t instanceof Tc) {
14952
+ function Pa(t, e, ...n) {
14953
+ if (t = p(t), da("collection", "path", e), t instanceof Ta) {
14954
14954
  const s = ht.fromString(e, ...n);
14955
- return mc(s), new bc(t, /* converter= */ null, s);
14955
+ return ma(s), new ba(t, /* converter= */ null, s);
14956
14956
  }
14957
14957
  {
14958
- if (!(t instanceof Ac || t instanceof bc)) throw new j(K.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
14958
+ if (!(t instanceof Aa || t instanceof ba)) throw new j(K.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
14959
14959
  const s = t._path.child(ht.fromString(e, ...n));
14960
- return mc(s), new bc(t.firestore,
14960
+ return ma(s), new ba(t.firestore,
14961
14961
  /* converter= */ null, s);
14962
14962
  }
14963
14963
  }
@@ -14974,9 +14974,9 @@ function Pc(t, e, ...n) {
14974
14974
  * collection or subcollection with this ID as the last segment of its path
14975
14975
  * will be included. Cannot contain a slash.
14976
14976
  * @returns The created `Query`.
14977
- */ function vc(t, e) {
14978
- if (t = yc(t, Tc), dc("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new j(K.INVALID_ARGUMENT, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
14979
- return new Rc(t,
14977
+ */ function va(t, e) {
14978
+ if (t = ya(t, Ta), da("collectionGroup", "collection id", e), e.indexOf("/") >= 0) throw new j(K.INVALID_ARGUMENT, `Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);
14979
+ return new Ra(t,
14980
14980
  /* converter= */ null,
14981
14981
  /**
14982
14982
  * Creates a new Query for a collection group query that matches all documents
@@ -14987,19 +14987,19 @@ function Pc(t, e, ...n) {
14987
14987
  }(e));
14988
14988
  }
14989
14989
 
14990
- function Vc(t, e, ...n) {
14990
+ function Va(t, e, ...n) {
14991
14991
  if (t = p(t),
14992
14992
  // We allow omission of 'pathString' but explicitly prohibit passing in both
14993
14993
  // 'undefined' and 'null'.
14994
- 1 === arguments.length && (e = tt.I()), dc("doc", "path", e), t instanceof Tc) {
14994
+ 1 === arguments.length && (e = tt.I()), da("doc", "path", e), t instanceof Ta) {
14995
14995
  const s = ht.fromString(e, ...n);
14996
- return _c(s), new Ac(t,
14996
+ return _a(s), new Aa(t,
14997
14997
  /* converter= */ null, new vt(s));
14998
14998
  }
14999
14999
  {
15000
- if (!(t instanceof Ac || t instanceof bc)) throw new j(K.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
15000
+ if (!(t instanceof Aa || t instanceof ba)) throw new j(K.INVALID_ARGUMENT, "Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");
15001
15001
  const s = t._path.child(ht.fromString(e, ...n));
15002
- return _c(s), new Ac(t.firestore, t instanceof bc ? t.converter : null, new vt(s));
15002
+ return _a(s), new Aa(t.firestore, t instanceof ba ? t.converter : null, new vt(s));
15003
15003
  }
15004
15004
  }
15005
15005
 
@@ -15010,8 +15010,8 @@ function Vc(t, e, ...n) {
15010
15010
  * @param right - A reference to compare.
15011
15011
  * @returns true if the references point to the same location in the same
15012
15012
  * Firestore database.
15013
- */ function Sc(t, e) {
15014
- return t = p(t), e = p(e), (t instanceof Ac || t instanceof bc) && (e instanceof Ac || e instanceof bc) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);
15013
+ */ function Sa(t, e) {
15014
+ return t = p(t), e = p(e), (t instanceof Aa || t instanceof ba) && (e instanceof Aa || e instanceof ba) && (t.firestore === e.firestore && t.path === e.path && t.converter === e.converter);
15015
15015
  }
15016
15016
 
15017
15017
  /**
@@ -15022,8 +15022,8 @@ function Vc(t, e, ...n) {
15022
15022
  * @param right - A `Query` to compare.
15023
15023
  * @returns true if the references point to the same location in the same
15024
15024
  * Firestore database.
15025
- */ function Dc(t, e) {
15026
- return t = p(t), e = p(e), t instanceof Rc && e instanceof Rc && (t.firestore === e.firestore && Re(t._query, e._query) && t.converter === e.converter);
15025
+ */ function Da(t, e) {
15026
+ return t = p(t), e = p(e), t instanceof Ra && e instanceof Ra && (t.firestore === e.firestore && Re(t._query, e._query) && t.converter === e.converter);
15027
15027
  }
15028
15028
 
15029
15029
  /**
@@ -15041,42 +15041,42 @@ function Vc(t, e, ...n) {
15041
15041
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15042
15042
  * See the License for the specific language governing permissions and
15043
15043
  * limitations under the License.
15044
- */ class Cc {
15044
+ */ class Ca {
15045
15045
  constructor() {
15046
15046
  // The last promise in the queue.
15047
- this.fa = Promise.resolve(),
15047
+ this.fc = Promise.resolve(),
15048
15048
  // A list of retryable operations. Retryable operations are run in order and
15049
15049
  // retried with backoff.
15050
- this.da = [],
15050
+ this.dc = [],
15051
15051
  // Is this AsyncQueue being shut down? Once it is set to true, it will not
15052
15052
  // be changed again.
15053
- this.wa = !1,
15053
+ this.wc = !1,
15054
15054
  // Operations scheduled to be queued in the future. Operations are
15055
15055
  // automatically removed after they are run or canceled.
15056
- this._a = [],
15056
+ this._c = [],
15057
15057
  // visible for testing
15058
- this.ma = null,
15058
+ this.mc = null,
15059
15059
  // Flag set while there's an outstanding AsyncQueue operation, used for
15060
15060
  // assertion sanity-checks.
15061
- this.ga = !1,
15061
+ this.gc = !1,
15062
15062
  // Enabled during shutdown on Safari to prevent future access to IndexedDB.
15063
- this.ya = !1,
15063
+ this.yc = !1,
15064
15064
  // List of TimerIds to fast-forward delays for.
15065
- this.pa = [],
15065
+ this.Ec = [],
15066
15066
  // Backoff timer used to schedule retries for retryable operations
15067
15067
  this.rr = new Zr(this, "async_queue_retry" /* AsyncQueueRetry */),
15068
15068
  // Visibility handler that triggers an immediate retry of all retryable
15069
15069
  // operations. Meant to speed up recovery when we regain file system access
15070
15070
  // after page comes into foreground.
15071
- this.Ea = () => {
15071
+ this.Tc = () => {
15072
15072
  const t = Yr();
15073
15073
  t && $("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.rr.tr();
15074
15074
  };
15075
15075
  const t = Yr();
15076
- t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.Ea);
15076
+ t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.Tc);
15077
15077
  }
15078
15078
  get isShuttingDown() {
15079
- return this.wa;
15079
+ return this.wc;
15080
15080
  }
15081
15081
  /**
15082
15082
  * Adds a new operation to the queue without waiting for it to complete (i.e.
@@ -15086,44 +15086,44 @@ function Vc(t, e, ...n) {
15086
15086
  this.enqueue(t);
15087
15087
  }
15088
15088
  enqueueAndForgetEvenWhileRestricted(t) {
15089
- this.Ta(),
15089
+ this.Ic(),
15090
15090
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
15091
- this.Ia(t);
15091
+ this.Ac(t);
15092
15092
  }
15093
15093
  enterRestrictedMode(t) {
15094
- if (!this.wa) {
15095
- this.wa = !0, this.ya = t || !1;
15094
+ if (!this.wc) {
15095
+ this.wc = !0, this.yc = t || !1;
15096
15096
  const e = Yr();
15097
- e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Ea);
15097
+ e && "function" == typeof e.removeEventListener && e.removeEventListener("visibilitychange", this.Tc);
15098
15098
  }
15099
15099
  }
15100
15100
  enqueue(t) {
15101
- if (this.Ta(), this.wa)
15101
+ if (this.Ic(), this.wc)
15102
15102
  // Return a Promise which never resolves.
15103
15103
  return new Promise((() => {}));
15104
15104
  // Create a deferred Promise that we can return to the callee. This
15105
15105
  // allows us to return a "hanging Promise" only to the callee and still
15106
15106
  // advance the queue even when the operation is not run.
15107
15107
  const e = new Q;
15108
- return this.Ia((() => this.wa && this.ya ? Promise.resolve() : (t().then(e.resolve, e.reject),
15108
+ return this.Ac((() => this.wc && this.yc ? Promise.resolve() : (t().then(e.resolve, e.reject),
15109
15109
  e.promise))).then((() => e.promise));
15110
15110
  }
15111
15111
  enqueueRetryable(t) {
15112
- this.enqueueAndForget((() => (this.da.push(t), this.Aa())));
15112
+ this.enqueueAndForget((() => (this.dc.push(t), this.Rc())));
15113
15113
  }
15114
15114
  /**
15115
15115
  * Runs the next operation from the retryable queue. If the operation fails,
15116
15116
  * reschedules with backoff.
15117
- */ async Aa() {
15118
- if (0 !== this.da.length) {
15117
+ */ async Rc() {
15118
+ if (0 !== this.dc.length) {
15119
15119
  try {
15120
- await this.da[0](), this.da.shift(), this.rr.reset();
15120
+ await this.dc[0](), this.dc.shift(), this.rr.reset();
15121
15121
  } catch (t) {
15122
15122
  if (!Js(t)) throw t;
15123
15123
  // Failure will be handled by AsyncQueue
15124
15124
  $("AsyncQueue", "Operation failed with retryable error: " + t);
15125
15125
  }
15126
- this.da.length > 0 &&
15126
+ this.dc.length > 0 &&
15127
15127
  // If there are additional operations, we re-schedule `retryNextOp()`.
15128
15128
  // This is necessary to run retryable operations that failed during
15129
15129
  // their initial attempt since we don't know whether they are already
@@ -15134,12 +15134,12 @@ function Vc(t, e, ...n) {
15134
15134
  // Since `backoffAndRun()` cancels an existing backoff and schedules a
15135
15135
  // new backoff on every call, there is only ever a single additional
15136
15136
  // operation in the queue.
15137
- this.rr.Xi((() => this.Aa()));
15137
+ this.rr.Xi((() => this.Rc()));
15138
15138
  }
15139
15139
  }
15140
- Ia(t) {
15141
- const e = this.fa.then((() => (this.ga = !0, t().catch((t => {
15142
- this.ma = t, this.ga = !1;
15140
+ Ac(t) {
15141
+ const e = this.fc.then((() => (this.gc = !0, t().catch((t => {
15142
+ this.mc = t, this.gc = !1;
15143
15143
  // Re-throw the error so that this.tail becomes a rejected Promise and
15144
15144
  // all further attempts to chain (via .then) will just short-circuit
15145
15145
  // and return the rejected Promise.
@@ -15170,38 +15170,38 @@ function Vc(t, e, ...n) {
15170
15170
  * See the License for the specific language governing permissions and
15171
15171
  * limitations under the License.
15172
15172
  */ (t)), t;
15173
- })).then((t => (this.ga = !1, t))))));
15174
- return this.fa = e, e;
15173
+ })).then((t => (this.gc = !1, t))))));
15174
+ return this.fc = e, e;
15175
15175
  }
15176
15176
  enqueueAfterDelay(t, e, n) {
15177
- this.Ta(),
15177
+ this.Ic(),
15178
15178
  // Fast-forward delays for timerIds that have been overriden.
15179
- this.pa.indexOf(t) > -1 && (e = 0);
15180
- const s = ko.createAndSchedule(this, t, e, n, (t => this.Ra(t)));
15181
- return this._a.push(s), s;
15179
+ this.Ec.indexOf(t) > -1 && (e = 0);
15180
+ const s = ko.createAndSchedule(this, t, e, n, (t => this.bc(t)));
15181
+ return this._c.push(s), s;
15182
15182
  }
15183
- Ta() {
15184
- this.ma && L();
15183
+ Ic() {
15184
+ this.mc && L();
15185
15185
  }
15186
15186
  verifyOperationInProgress() {}
15187
15187
  /**
15188
15188
  * Waits until all currently queued tasks are finished executing. Delayed
15189
15189
  * operations are not run.
15190
- */ async ba() {
15190
+ */ async Pc() {
15191
15191
  // Operations in the queue prior to draining may have enqueued additional
15192
15192
  // operations. Keep draining the queue until the tail is no longer advanced,
15193
15193
  // which indicates that no more new operations were enqueued and that all
15194
15194
  // operations were executed.
15195
15195
  let t;
15196
15196
  do {
15197
- t = this.fa, await t;
15198
- } while (t !== this.fa);
15197
+ t = this.fc, await t;
15198
+ } while (t !== this.fc);
15199
15199
  }
15200
15200
  /**
15201
15201
  * For Tests: Determine if a delayed operation with a particular TimerId
15202
15202
  * exists.
15203
- */ Pa(t) {
15204
- for (const e of this._a) if (e.timerId === t) return !0;
15203
+ */ vc(t) {
15204
+ for (const e of this._c) if (e.timerId === t) return !0;
15205
15205
  return !1;
15206
15206
  }
15207
15207
  /**
@@ -15210,28 +15210,28 @@ function Vc(t, e, ...n) {
15210
15210
  * @param lastTimerId - Delayed operations up to and including this TimerId
15211
15211
  * will be drained. Pass TimerId.All to run all delayed operations.
15212
15212
  * @returns a Promise that resolves once all operations have been run.
15213
- */ va(t) {
15213
+ */ Vc(t) {
15214
15214
  // Note that draining may generate more delayed ops, so we do that first.
15215
- return this.ba().then((() => {
15215
+ return this.Pc().then((() => {
15216
15216
  // Run ops in the same order they'd run if they ran naturally.
15217
- this._a.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));
15218
- for (const e of this._a) if (e.skipDelay(), "all" /* All */ !== t && e.timerId === t) break;
15219
- return this.ba();
15217
+ this._c.sort(((t, e) => t.targetTimeMs - e.targetTimeMs));
15218
+ for (const e of this._c) if (e.skipDelay(), "all" /* All */ !== t && e.timerId === t) break;
15219
+ return this.Pc();
15220
15220
  }));
15221
15221
  }
15222
15222
  /**
15223
15223
  * For Tests: Skip all subsequent delays for a timer id.
15224
- */ Va(t) {
15225
- this.pa.push(t);
15224
+ */ Sc(t) {
15225
+ this.Ec.push(t);
15226
15226
  }
15227
- /** Called once a DelayedOperation is run or canceled. */ Ra(t) {
15227
+ /** Called once a DelayedOperation is run or canceled. */ bc(t) {
15228
15228
  // NOTE: indexOf / slice are O(n), but delayedOperations is expected to be small.
15229
- const e = this._a.indexOf(t);
15230
- this._a.splice(e, 1);
15229
+ const e = this._c.indexOf(t);
15230
+ this._c.splice(e, 1);
15231
15231
  }
15232
15232
  }
15233
15233
 
15234
- function Nc(t) {
15234
+ function Na(t) {
15235
15235
  /**
15236
15236
  * Returns true if obj is an object and contains at least one of the specified
15237
15237
  * methods.
@@ -15266,7 +15266,7 @@ function Nc(t) {
15266
15266
  */ (t, [ "next", "error", "complete" ]);
15267
15267
  }
15268
15268
 
15269
- class xc {
15269
+ class xa {
15270
15270
  constructor() {
15271
15271
  this._progressObserver = {}, this._taskCompletionResolver = new Q, this._lastProgress = {
15272
15272
  taskState: "Running",
@@ -15350,27 +15350,27 @@ class xc {
15350
15350
  * See the License for the specific language governing permissions and
15351
15351
  * limitations under the License.
15352
15352
  */
15353
- /** DOMException error code constants. */ const kc = -1;
15353
+ /** DOMException error code constants. */ const ka = -1;
15354
15354
 
15355
15355
  /**
15356
15356
  * The Cloud Firestore service interface.
15357
15357
  *
15358
15358
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
15359
15359
  */
15360
- class $c extends Tc {
15360
+ class $a extends Ta {
15361
15361
  /** @hideconstructor */
15362
15362
  constructor(t, e) {
15363
15363
  super(t, e),
15364
15364
  /**
15365
15365
  * Whether it's a {@link Firestore} or Firestore Lite instance.
15366
15366
  */
15367
- this.type = "firestore", this._queue = new Cc, this._persistenceKey = "name" in t ? t.name : "[DEFAULT]";
15367
+ this.type = "firestore", this._queue = new Ca, this._persistenceKey = "name" in t ? t.name : "[DEFAULT]";
15368
15368
  }
15369
15369
  _terminate() {
15370
15370
  return this._firestoreClient ||
15371
15371
  // The client must be initialized to ensure that all subsequent API
15372
15372
  // usage throws an exception.
15373
- Lc(this), this._firestoreClient.terminate();
15373
+ La(this), this._firestoreClient.terminate();
15374
15374
  }
15375
15375
  }
15376
15376
 
@@ -15384,7 +15384,7 @@ class $c extends Tc {
15384
15384
  * be associated.
15385
15385
  * @param settings - A settings object to configure the {@link Firestore} instance.
15386
15386
  * @returns A newly initialized {@link Firestore} instance.
15387
- */ function Oc(t, e) {
15387
+ */ function Oa(t, e) {
15388
15388
  const n = _getProvider(t, "firestore");
15389
15389
  if (n.isInitialized()) {
15390
15390
  const t = n.getImmediate(), s = n.getOptions();
@@ -15405,22 +15405,22 @@ class $c extends Tc {
15405
15405
  * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
15406
15406
  * instance is associated with.
15407
15407
  * @returns The {@link Firestore} instance of the provided app.
15408
- */ function Fc(e = t()) {
15408
+ */ function Fa(e = t()) {
15409
15409
  return _getProvider(e, "firestore").getImmediate();
15410
15410
  }
15411
15411
 
15412
15412
  /**
15413
15413
  * @internal
15414
- */ function Mc(t) {
15415
- return t._firestoreClient || Lc(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;
15414
+ */ function Ma(t) {
15415
+ return t._firestoreClient || La(t), t._firestoreClient.verifyNotTerminated(), t._firestoreClient;
15416
15416
  }
15417
15417
 
15418
- function Lc(t) {
15418
+ function La(t) {
15419
15419
  var e;
15420
15420
  const n = t._freezeSettings(), s = function(t, e, n, s) {
15421
- return new hc(t, e, n, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams);
15421
+ return new ha(t, e, n, s.host, s.ssl, s.experimentalForceLongPolling, s.experimentalAutoDetectLongPolling, s.useFetchStreams);
15422
15422
  }(t._databaseId, (null === (e = t._app) || void 0 === e ? void 0 : e.options.appId) || "", t._persistenceKey, n);
15423
- t._firestoreClient = new ja(t._credentials, t._queue, s);
15423
+ t._firestoreClient = new jc(t._credentials, t._queue, s);
15424
15424
  }
15425
15425
 
15426
15426
  /**
@@ -15445,10 +15445,10 @@ function Lc(t) {
15445
15445
  * @param persistenceSettings - Optional settings object to configure
15446
15446
  * persistence.
15447
15447
  * @returns A `Promise` that represents successfully enabling persistent storage.
15448
- */ function Bc(t, e) {
15449
- Jc(t = yc(t, $c));
15450
- const n = Mc(t), s = t._freezeSettings(), i = new Ma;
15451
- return qc(n, i, new Oa(i, s.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));
15448
+ */ function Ba(t, e) {
15449
+ Ja(t = ya(t, $a));
15450
+ const n = Ma(t), s = t._freezeSettings(), i = new Mc;
15451
+ return qa(n, i, new Oc(i, s.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));
15452
15452
  }
15453
15453
 
15454
15454
  /**
@@ -15472,10 +15472,10 @@ function Lc(t) {
15472
15472
  * @param firestore - The {@link Firestore} instance to enable persistence for.
15473
15473
  * @returns A `Promise` that represents successfully enabling persistent
15474
15474
  * storage.
15475
- */ function Uc(t) {
15476
- Jc(t = yc(t, $c));
15477
- const e = Mc(t), n = t._freezeSettings(), s = new Ma;
15478
- return qc(e, s, new Fa(s, n.cacheSizeBytes));
15475
+ */ function Ua(t) {
15476
+ Ja(t = ya(t, $a));
15477
+ const e = Ma(t), n = t._freezeSettings(), s = new Mc;
15478
+ return qa(e, s, new Fc(s, n.cacheSizeBytes));
15479
15479
  }
15480
15480
 
15481
15481
  /**
@@ -15483,11 +15483,11 @@ function Lc(t) {
15483
15483
  * If the operation fails with a recoverable error (see
15484
15484
  * `canRecoverFromIndexedDbError()` below), the returned Promise is rejected
15485
15485
  * but the client remains usable.
15486
- */ function qc(t, e, n) {
15486
+ */ function qa(t, e, n) {
15487
15487
  const s = new Q;
15488
15488
  return t.asyncQueue.enqueue((async () => {
15489
15489
  try {
15490
- await Qa(t, n), await Wa(t, e), s.resolve();
15490
+ await Qc(t, n), await Wc(t, e), s.resolve();
15491
15491
  } catch (t) {
15492
15492
  if (!
15493
15493
  /**
@@ -15541,7 +15541,7 @@ function Lc(t) {
15541
15541
  })).then((() => s.promise));
15542
15542
  }
15543
15543
 
15544
- function Kc(t) {
15544
+ function Ka(t) {
15545
15545
  if (t._initialized && !t._terminated) throw new j(K.FAILED_PRECONDITION, "Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");
15546
15546
  const e = new Q;
15547
15547
  return t._queue.enqueueAndForgetEvenWhileRestricted((async () => {
@@ -15572,11 +15572,11 @@ function Kc(t) {
15572
15572
  *
15573
15573
  * @returns A `Promise` which resolves when all currently pending writes have been
15574
15574
  * acknowledged by the backend.
15575
- */ function jc(t) {
15575
+ */ function ja(t) {
15576
15576
  return function(t) {
15577
15577
  const e = new Q;
15578
- return t.asyncQueue.enqueueAndForget((async () => fa(await Xa(t), e))), e.promise;
15579
- }(Mc(t = yc(t, $c)));
15578
+ return t.asyncQueue.enqueueAndForget((async () => fc(await Xc(t), e))), e.promise;
15579
+ }(Ma(t = ya(t, $a)));
15580
15580
  }
15581
15581
 
15582
15582
  /**
@@ -15584,8 +15584,8 @@ function Kc(t) {
15584
15584
  * call to {@link disableNetwork}.
15585
15585
  *
15586
15586
  * @returns A `Promise` that is resolved once the network has been enabled.
15587
- */ function Qc(t) {
15588
- return tc(Mc(t = yc(t, $c)));
15587
+ */ function Qa(t) {
15588
+ return ta(Ma(t = ya(t, $a)));
15589
15589
  }
15590
15590
 
15591
15591
  /**
@@ -15595,8 +15595,8 @@ function Kc(t) {
15595
15595
  * operations will be queued until the network is restored.
15596
15596
  *
15597
15597
  * @returns A `Promise` that is resolved once the network has been disabled.
15598
- */ function Wc(t) {
15599
- return ec(Mc(t = yc(t, $c)));
15598
+ */ function Wa(t) {
15599
+ return ea(Ma(t = ya(t, $a)));
15600
15600
  }
15601
15601
 
15602
15602
  /**
@@ -15620,7 +15620,7 @@ function Kc(t) {
15620
15620
  *
15621
15621
  * @returns A `Promise` that is resolved when the instance has been successfully
15622
15622
  * terminated.
15623
- */ function Gc(t) {
15623
+ */ function Ga(t) {
15624
15624
  return e(t.app, "firestore"), t._delete();
15625
15625
  }
15626
15626
 
@@ -15634,9 +15634,9 @@ function Kc(t) {
15634
15634
  * @returns
15635
15635
  * A `LoadBundleTask` object, which notifies callers with progress updates, and completion
15636
15636
  * or error events. It can be used as a `Promise<LoadBundleTaskProgress>`.
15637
- */ function zc(t, e) {
15638
- const n = Mc(t = yc(t, $c)), s = new xc;
15639
- return cc(n, t._databaseId, e, s), s;
15637
+ */ function za(t, e) {
15638
+ const n = Ma(t = ya(t, $a)), s = new xa;
15639
+ return aa(n, t._databaseId, e, s), s;
15640
15640
  }
15641
15641
 
15642
15642
  /**
@@ -15645,11 +15645,11 @@ function Kc(t) {
15645
15645
  * The named queries are packaged into bundles on the server side (along
15646
15646
  * with resulting documents), and loaded to local cache using `loadBundle`. Once in local
15647
15647
  * cache, use this method to extract a {@link Query} by name.
15648
- */ function Hc(t, e) {
15649
- return uc(Mc(t = yc(t, $c)), e).then((e => e ? new Rc(t, null, e.query) : null));
15648
+ */ function Ha(t, e) {
15649
+ return ua(Ma(t = ya(t, $a)), e).then((e => e ? new Ra(t, null, e.query) : null));
15650
15650
  }
15651
15651
 
15652
- function Jc(t) {
15652
+ function Ja(t) {
15653
15653
  if (t._initialized || t._terminated) throw new j(K.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.");
15654
15654
  }
15655
15655
 
@@ -15693,7 +15693,7 @@ function Jc(t) {
15693
15693
  * Create a `FieldPath` by providing field names. If more than one field
15694
15694
  * name is provided, the path will point to a nested field in a document.
15695
15695
  */
15696
- class Yc {
15696
+ class Ya {
15697
15697
  /**
15698
15698
  * Creates a `FieldPath` from the provided field names. If more than one field
15699
15699
  * name is provided, the path will point to a nested field in a document.
@@ -15717,8 +15717,8 @@ class Yc {
15717
15717
  /**
15718
15718
  * Returns a special sentinel `FieldPath` to refer to the ID of a document.
15719
15719
  * It can be used in queries to sort or filter by the document ID.
15720
- */ function Xc() {
15721
- return new Yc("__name__");
15720
+ */ function Xa() {
15721
+ return new Ya("__name__");
15722
15722
  }
15723
15723
 
15724
15724
  /**
@@ -15739,7 +15739,7 @@ class Yc {
15739
15739
  */
15740
15740
  /**
15741
15741
  * An immutable object representing an array of bytes.
15742
- */ class Zc {
15742
+ */ class Za {
15743
15743
  /** @hideconstructor */
15744
15744
  constructor(t) {
15745
15745
  this._byteString = t;
@@ -15751,7 +15751,7 @@ class Yc {
15751
15751
  * @param base64 - The Base64 string used to create the `Bytes` object.
15752
15752
  */ static fromBase64String(t) {
15753
15753
  try {
15754
- return new Zc(mt.fromBase64String(t));
15754
+ return new Za(mt.fromBase64String(t));
15755
15755
  } catch (t) {
15756
15756
  throw new j(K.INVALID_ARGUMENT, "Failed to construct data from Base64 string: " + t);
15757
15757
  }
@@ -15761,7 +15761,7 @@ class Yc {
15761
15761
  *
15762
15762
  * @param array - The Uint8Array used to create the `Bytes` object.
15763
15763
  */ static fromUint8Array(t) {
15764
- return new Zc(mt.fromUint8Array(t));
15764
+ return new Za(mt.fromUint8Array(t));
15765
15765
  }
15766
15766
  /**
15767
15767
  * Returns the underlying bytes as a Base64-encoded string.
@@ -15967,102 +15967,102 @@ function ru(t) {
15967
15967
  this.settings = t, this.databaseId = e, this.N = n, this.ignoreUndefinedProperties = s,
15968
15968
  // Minor hack: If fieldTransforms is undefined, we assume this is an
15969
15969
  // external call and we need to validate the entire path.
15970
- void 0 === i && this.Sa(), this.fieldTransforms = i || [], this.fieldMask = r || [];
15970
+ void 0 === i && this.Dc(), this.fieldTransforms = i || [], this.fieldMask = r || [];
15971
15971
  }
15972
15972
  get path() {
15973
15973
  return this.settings.path;
15974
15974
  }
15975
- get Da() {
15976
- return this.settings.Da;
15975
+ get Cc() {
15976
+ return this.settings.Cc;
15977
15977
  }
15978
- /** Returns a new context with the specified settings overwritten. */ Ca(t) {
15978
+ /** Returns a new context with the specified settings overwritten. */ Nc(t) {
15979
15979
  return new ou(Object.assign(Object.assign({}, this.settings), t), this.databaseId, this.N, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
15980
15980
  }
15981
- Na(t) {
15981
+ xc(t) {
15982
15982
  var e;
15983
- const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.Ca({
15983
+ const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.Nc({
15984
15984
  path: n,
15985
- xa: !1
15985
+ kc: !1
15986
15986
  });
15987
- return s.ka(t), s;
15987
+ return s.$c(t), s;
15988
15988
  }
15989
- $a(t) {
15989
+ Oc(t) {
15990
15990
  var e;
15991
- const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.Ca({
15991
+ const n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), s = this.Nc({
15992
15992
  path: n,
15993
- xa: !1
15993
+ kc: !1
15994
15994
  });
15995
- return s.Sa(), s;
15995
+ return s.Dc(), s;
15996
15996
  }
15997
- Oa(t) {
15997
+ Fc(t) {
15998
15998
  // TODO(b/34871131): We don't support array paths right now; so make path
15999
15999
  // undefined.
16000
- return this.Ca({
16000
+ return this.Nc({
16001
16001
  path: void 0,
16002
- xa: !0
16002
+ kc: !0
16003
16003
  });
16004
16004
  }
16005
- Fa(t) {
16006
- return Pu(t, this.settings.methodName, this.settings.Ma || !1, this.path, this.settings.La);
16005
+ Mc(t) {
16006
+ return Pu(t, this.settings.methodName, this.settings.Lc || !1, this.path, this.settings.Bc);
16007
16007
  }
16008
16008
  /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ contains(t) {
16009
16009
  return void 0 !== this.fieldMask.find((e => t.isPrefixOf(e))) || void 0 !== this.fieldTransforms.find((e => t.isPrefixOf(e.field)));
16010
16010
  }
16011
- Sa() {
16011
+ Dc() {
16012
16012
  // TODO(b/34871131): Remove null check once we have proper paths for fields
16013
16013
  // within arrays.
16014
- if (this.path) for (let t = 0; t < this.path.length; t++) this.ka(this.path.get(t));
16014
+ if (this.path) for (let t = 0; t < this.path.length; t++) this.$c(this.path.get(t));
16015
16015
  }
16016
- ka(t) {
16017
- if (0 === t.length) throw this.Fa("Document fields must not be empty");
16018
- if (ru(this.Da) && nu.test(t)) throw this.Fa('Document fields cannot begin and end with "__"');
16016
+ $c(t) {
16017
+ if (0 === t.length) throw this.Mc("Document fields must not be empty");
16018
+ if (ru(this.Cc) && nu.test(t)) throw this.Mc('Document fields cannot begin and end with "__"');
16019
16019
  }
16020
16020
  }
16021
16021
 
16022
16022
  /**
16023
16023
  * Helper for parsing raw user input (provided via the API) into internal model
16024
16024
  * classes.
16025
- */ class au {
16025
+ */ class cu {
16026
16026
  constructor(t, e, n) {
16027
16027
  this.databaseId = t, this.ignoreUndefinedProperties = e, this.N = n || Xr(t);
16028
16028
  }
16029
- /** Creates a new top-level parse context. */ Ba(t, e, n, s = !1) {
16029
+ /** Creates a new top-level parse context. */ Uc(t, e, n, s = !1) {
16030
16030
  return new ou({
16031
- Da: t,
16031
+ Cc: t,
16032
16032
  methodName: e,
16033
- La: n,
16033
+ Bc: n,
16034
16034
  path: ft.emptyPath(),
16035
- xa: !1,
16036
- Ma: s
16035
+ kc: !1,
16036
+ Lc: s
16037
16037
  }, this.databaseId, this.N, this.ignoreUndefinedProperties);
16038
16038
  }
16039
16039
  }
16040
16040
 
16041
- function cu(t) {
16041
+ function au(t) {
16042
16042
  const e = t._freezeSettings(), n = Xr(t._databaseId);
16043
- return new au(t._databaseId, !!e.ignoreUndefinedProperties, n);
16043
+ return new cu(t._databaseId, !!e.ignoreUndefinedProperties, n);
16044
16044
  }
16045
16045
 
16046
16046
  /** Parse document data from a set() call. */ function uu(t, e, n, s, i, r = {}) {
16047
- const o = t.Ba(r.merge || r.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
16047
+ const o = t.Uc(r.merge || r.mergeFields ? 2 /* MergeSet */ : 0 /* Set */ , e, n, i);
16048
16048
  Iu("Data must be an object, but it was:", o, s);
16049
- const a = Eu(s, o);
16050
- let c, u;
16051
- if (r.merge) c = new dt(o.fieldMask), u = o.fieldTransforms; else if (r.mergeFields) {
16049
+ const c = Eu(s, o);
16050
+ let a, u;
16051
+ if (r.merge) a = new dt(o.fieldMask), u = o.fieldTransforms; else if (r.mergeFields) {
16052
16052
  const t = [];
16053
16053
  for (const s of r.mergeFields) {
16054
16054
  const i = Au(e, s, n);
16055
16055
  if (!o.contains(i)) throw new j(K.INVALID_ARGUMENT, `Field '${i}' is specified in your field mask but missing from your input data.`);
16056
16056
  vu(t, i) || t.push(i);
16057
16057
  }
16058
- c = new dt(t), u = o.fieldTransforms.filter((t => c.covers(t.field)));
16059
- } else c = null, u = o.fieldTransforms;
16060
- return new su(new qt(a), c, u);
16058
+ a = new dt(t), u = o.fieldTransforms.filter((t => a.covers(t.field)));
16059
+ } else a = null, u = o.fieldTransforms;
16060
+ return new su(new qt(c), a, u);
16061
16061
  }
16062
16062
 
16063
16063
  class hu extends tu {
16064
16064
  _toFieldTransform(t) {
16065
- if (2 /* MergeSet */ !== t.Da) throw 1 /* Update */ === t.Da ? t.Fa(`${this._methodName}() can only appear at the top level of your update data`) : t.Fa(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);
16065
+ if (2 /* MergeSet */ !== t.Cc) throw 1 /* Update */ === t.Cc ? t.Mc(`${this._methodName}() can only appear at the top level of your update data`) : t.Mc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);
16066
16066
  // No transform to add for a delete, but we need to add it to our
16067
16067
  // fieldMask so it gets deleted.
16068
16068
  return t.fieldMask.push(t.path), null;
@@ -16089,10 +16089,10 @@ class hu extends tu {
16089
16089
  * @param arrayElement - Whether or not the FieldValue has an array.
16090
16090
  */ function lu(t, e, n) {
16091
16091
  return new ou({
16092
- Da: 3 /* Argument */ ,
16093
- La: e.settings.La,
16092
+ Cc: 3 /* Argument */ ,
16093
+ Bc: e.settings.Bc,
16094
16094
  methodName: t._methodName,
16095
- xa: n
16095
+ kc: n
16096
16096
  }, e.databaseId, e.N, e.ignoreUndefinedProperties);
16097
16097
  }
16098
16098
 
@@ -16107,11 +16107,11 @@ class fu extends tu {
16107
16107
 
16108
16108
  class du extends tu {
16109
16109
  constructor(t, e) {
16110
- super(t), this.Ua = e;
16110
+ super(t), this.qc = e;
16111
16111
  }
16112
16112
  _toFieldTransform(t) {
16113
16113
  const e = lu(this, t,
16114
- /*array=*/ !0), n = this.Ua.map((t => pu(t, e))), s = new Me(n);
16114
+ /*array=*/ !0), n = this.qc.map((t => pu(t, e))), s = new Me(n);
16115
16115
  return new Qe(t.path, s);
16116
16116
  }
16117
16117
  isEqual(t) {
@@ -16122,11 +16122,11 @@ class du extends tu {
16122
16122
 
16123
16123
  class wu extends tu {
16124
16124
  constructor(t, e) {
16125
- super(t), this.Ua = e;
16125
+ super(t), this.qc = e;
16126
16126
  }
16127
16127
  _toFieldTransform(t) {
16128
16128
  const e = lu(this, t,
16129
- /*array=*/ !0), n = this.Ua.map((t => pu(t, e))), s = new Be(n);
16129
+ /*array=*/ !0), n = this.qc.map((t => pu(t, e))), s = new Be(n);
16130
16130
  return new Qe(t.path, s);
16131
16131
  }
16132
16132
  isEqual(t) {
@@ -16137,10 +16137,10 @@ class wu extends tu {
16137
16137
 
16138
16138
  class _u extends tu {
16139
16139
  constructor(t, e) {
16140
- super(t), this.qa = e;
16140
+ super(t), this.Kc = e;
16141
16141
  }
16142
16142
  _toFieldTransform(t) {
16143
- const e = new qe(t.N, Ne(t.N, this.qa));
16143
+ const e = new qe(t.N, Ne(t.N, this.Kc));
16144
16144
  return new Qe(t.path, e);
16145
16145
  }
16146
16146
  isEqual(t) {
@@ -16150,40 +16150,40 @@ class _u extends tu {
16150
16150
  }
16151
16151
 
16152
16152
  /** Parse update data from an update() call. */ function mu(t, e, n, s) {
16153
- const i = t.Ba(1 /* Update */ , e, n);
16153
+ const i = t.Uc(1 /* Update */ , e, n);
16154
16154
  Iu("Data must be an object, but it was:", i, s);
16155
16155
  const r = [], o = qt.empty();
16156
- at(s, ((t, s) => {
16157
- const a = bu(e, t, n);
16156
+ ct(s, ((t, s) => {
16157
+ const c = bu(e, t, n);
16158
16158
  // For Compat types, we have to "extract" the underlying types before
16159
16159
  // performing validation.
16160
16160
  s = p(s);
16161
- const c = i.$a(a);
16161
+ const a = i.Oc(c);
16162
16162
  if (s instanceof hu)
16163
16163
  // Add it to the field mask, but don't add anything to updateData.
16164
- r.push(a); else {
16165
- const t = pu(s, c);
16166
- null != t && (r.push(a), o.set(a, t));
16164
+ r.push(c); else {
16165
+ const t = pu(s, a);
16166
+ null != t && (r.push(c), o.set(c, t));
16167
16167
  }
16168
16168
  }));
16169
- const a = new dt(r);
16170
- return new iu(o, a, i.fieldTransforms);
16169
+ const c = new dt(r);
16170
+ return new iu(o, c, i.fieldTransforms);
16171
16171
  }
16172
16172
 
16173
16173
  /** Parse update data from a list of field/value arguments. */ function gu(t, e, n, s, i, r) {
16174
- const o = t.Ba(1 /* Update */ , e, n), a = [ Au(e, s, n) ], c = [ i ];
16174
+ const o = t.Uc(1 /* Update */ , e, n), c = [ Au(e, s, n) ], a = [ i ];
16175
16175
  if (r.length % 2 != 0) throw new j(K.INVALID_ARGUMENT, `Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);
16176
- for (let t = 0; t < r.length; t += 2) a.push(Au(e, r[t])), c.push(r[t + 1]);
16176
+ for (let t = 0; t < r.length; t += 2) c.push(Au(e, r[t])), a.push(r[t + 1]);
16177
16177
  const u = [], h = qt.empty();
16178
16178
  // We iterate in reverse order to pick the last value for a field if the
16179
16179
  // user specified the field multiple times.
16180
- for (let t = a.length - 1; t >= 0; --t) if (!vu(u, a[t])) {
16181
- const e = a[t];
16182
- let n = c[t];
16180
+ for (let t = c.length - 1; t >= 0; --t) if (!vu(u, c[t])) {
16181
+ const e = c[t];
16182
+ let n = a[t];
16183
16183
  // For Compat types, we have to "extract" the underlying types before
16184
16184
  // performing validation.
16185
16185
  n = p(n);
16186
- const s = o.$a(e);
16186
+ const s = o.Oc(e);
16187
16187
  if (n instanceof hu)
16188
16188
  // Add it to the field mask, but don't add anything to updateData.
16189
16189
  u.push(e); else {
@@ -16202,7 +16202,7 @@ class _u extends tu {
16202
16202
  * @param allowArrays - Whether the query value is an array that may directly
16203
16203
  * contain additional arrays (e.g. the operand of an `in` query).
16204
16204
  */ function yu(t, e, n, s = !1) {
16205
- return pu(n, t.Ba(s ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
16205
+ return pu(n, t.Uc(s ? 4 /* ArrayArgument */ : 3 /* Argument */ , e));
16206
16206
  }
16207
16207
 
16208
16208
  /**
@@ -16230,8 +16230,8 @@ class _u extends tu {
16230
16230
  */
16231
16231
  return function(t, e) {
16232
16232
  // Sentinels are only supported with writes, and not within arrays.
16233
- if (!ru(e.Da)) throw e.Fa(`${t._methodName}() can only be used with update() and set()`);
16234
- if (!e.path) throw e.Fa(`${t._methodName}() is not currently supported inside arrays`);
16233
+ if (!ru(e.Cc)) throw e.Mc(`${t._methodName}() can only be used with update() and set()`);
16234
+ if (!e.path) throw e.Mc(`${t._methodName}() is not currently supported inside arrays`);
16235
16235
  const n = t._toFieldTransform(e);
16236
16236
  n && e.fieldTransforms.push(n);
16237
16237
  }
@@ -16255,12 +16255,12 @@ class _u extends tu {
16255
16255
  // the set of values to be included for the IN query) that may directly
16256
16256
  // contain additional arrays (each representing an individual field
16257
16257
  // value), so we disable this validation.
16258
- if (e.settings.xa && 4 /* ArrayArgument */ !== e.Da) throw e.Fa("Nested arrays are not supported");
16258
+ if (e.settings.kc && 4 /* ArrayArgument */ !== e.Cc) throw e.Mc("Nested arrays are not supported");
16259
16259
  return function(t, e) {
16260
16260
  const n = [];
16261
16261
  let s = 0;
16262
16262
  for (const i of t) {
16263
- let t = pu(i, e.Oa(s));
16263
+ let t = pu(i, e.Fc(s));
16264
16264
  null == t && (
16265
16265
  // Just include nulls in the array for fields being replaced with a
16266
16266
  // sentinel.
@@ -16307,17 +16307,17 @@ class _u extends tu {
16307
16307
  longitude: t.longitude
16308
16308
  }
16309
16309
  };
16310
- if (t instanceof Zc) return {
16310
+ if (t instanceof Za) return {
16311
16311
  bytesValue: Kn(e.N, t._byteString)
16312
16312
  };
16313
- if (t instanceof Ac) {
16313
+ if (t instanceof Aa) {
16314
16314
  const n = e.databaseId, s = t.firestore._databaseId;
16315
- if (!s.isEqual(n)) throw e.Fa(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);
16315
+ if (!s.isEqual(n)) throw e.Mc(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);
16316
16316
  return {
16317
16317
  referenceValue: Wn(t.firestore._databaseId || e.databaseId, t._key.path)
16318
16318
  };
16319
16319
  }
16320
- throw e.Fa(`Unsupported field value: ${gc(t)}`);
16320
+ throw e.Mc(`Unsupported field value: ${ga(t)}`);
16321
16321
  }
16322
16322
  /**
16323
16323
  * Checks whether an object looks like a JSON object that should be converted
@@ -16330,11 +16330,11 @@ class _u extends tu {
16330
16330
 
16331
16331
  function Eu(t, e) {
16332
16332
  const n = {};
16333
- return ct(t) ?
16333
+ return at(t) ?
16334
16334
  // If we encounter an empty object, we explicitly add it to the update
16335
16335
  // mask to ensure that the server creates a map entry.
16336
- e.path && e.path.length > 0 && e.fieldMask.push(e.path) : at(t, ((t, s) => {
16337
- const i = pu(s, e.Na(t));
16336
+ e.path && e.path.length > 0 && e.fieldMask.push(e.path) : ct(t, ((t, s) => {
16337
+ const i = pu(s, e.xc(t));
16338
16338
  null != i && (n[t] = i);
16339
16339
  })), {
16340
16340
  mapValue: {
@@ -16344,15 +16344,15 @@ function Eu(t, e) {
16344
16344
  }
16345
16345
 
16346
16346
  function Tu(t) {
16347
- return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof it || t instanceof eu || t instanceof Zc || t instanceof Ac || t instanceof tu);
16347
+ return !("object" != typeof t || null === t || t instanceof Array || t instanceof Date || t instanceof it || t instanceof eu || t instanceof Za || t instanceof Aa || t instanceof tu);
16348
16348
  }
16349
16349
 
16350
16350
  function Iu(t, e, n) {
16351
16351
  if (!Tu(n) || !function(t) {
16352
16352
  return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
16353
16353
  }(n)) {
16354
- const s = gc(n);
16355
- throw "an object" === s ? e.Fa(t + " a custom object") : e.Fa(t + " " + s);
16354
+ const s = ga(n);
16355
+ throw "an object" === s ? e.Mc(t + " a custom object") : e.Mc(t + " " + s);
16356
16356
  }
16357
16357
  }
16358
16358
 
@@ -16362,7 +16362,7 @@ function Iu(t, e, n) {
16362
16362
  if ((
16363
16363
  // If required, replace the FieldPath Compat class with with the firestore-exp
16364
16364
  // FieldPath.
16365
- e = p(e)) instanceof Yc) return e._internalPath;
16365
+ e = p(e)) instanceof Ya) return e._internalPath;
16366
16366
  if ("string" == typeof e) return bu(t, e);
16367
16367
  throw Pu("Field path arguments must be of type string or FieldPath.", t,
16368
16368
  /* hasConverter= */ !1,
@@ -16386,7 +16386,7 @@ function Iu(t, e, n) {
16386
16386
  /* hasConverter= */ !1,
16387
16387
  /* path= */ void 0, n);
16388
16388
  try {
16389
- return new Yc(...e.split("."))._internalPath;
16389
+ return new Ya(...e.split("."))._internalPath;
16390
16390
  } catch (s) {
16391
16391
  throw Pu(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`, t,
16392
16392
  /* hasConverter= */ !1,
@@ -16396,11 +16396,11 @@ function Iu(t, e, n) {
16396
16396
 
16397
16397
  function Pu(t, e, n, s, i) {
16398
16398
  const r = s && !s.isEmpty(), o = void 0 !== i;
16399
- let a = `Function ${e}() called with invalid data`;
16400
- n && (a += " (via `toFirestore()`)"), a += ". ";
16401
- let c = "";
16402
- return (r || o) && (c += " (found", r && (c += ` in field ${s}`), o && (c += ` in document ${i}`),
16403
- c += ")"), new j(K.INVALID_ARGUMENT, a + t + c);
16399
+ let c = `Function ${e}() called with invalid data`;
16400
+ n && (c += " (via `toFirestore()`)"), c += ". ";
16401
+ let a = "";
16402
+ return (r || o) && (a += " (found", r && (a += ` in field ${s}`), o && (a += ` in document ${i}`),
16403
+ a += ")"), new j(K.INVALID_ARGUMENT, c + t + a);
16404
16404
  }
16405
16405
 
16406
16406
  /** Checks `haystack` if FieldPath `needle` is present. Runs in O(n). */ function vu(t, e) {
@@ -16447,7 +16447,7 @@ function Pu(t, e, n, s, i) {
16447
16447
  /**
16448
16448
  * The `DocumentReference` for the document included in the `DocumentSnapshot`.
16449
16449
  */ get ref() {
16450
- return new Ac(this._firestore, this._converter, this._key);
16450
+ return new Aa(this._firestore, this._converter, this._key);
16451
16451
  }
16452
16452
  /**
16453
16453
  * Signals whether or not the document at the snapshot's location exists.
@@ -16518,7 +16518,7 @@ function Pu(t, e, n, s, i) {
16518
16518
  /**
16519
16519
  * Helper that calls `fromDotSeparatedString()` but wraps any error thrown.
16520
16520
  */ function Du(t, e) {
16521
- return "string" == typeof e ? bu(t, e) : e instanceof Yc ? e._internalPath : e._delegate._internalPath;
16521
+ return "string" == typeof e ? bu(t, e) : e instanceof Ya ? e._internalPath : e._delegate._internalPath;
16522
16522
  }
16523
16523
 
16524
16524
  /**
@@ -16755,7 +16755,7 @@ function $u(t) {
16755
16755
  * @param right - A snapshot to compare.
16756
16756
  * @returns true if the snapshots are equal.
16757
16757
  */ function Ou(t, e) {
16758
- return t instanceof Nu && e instanceof Nu ? 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 ku && e instanceof ku && (t._firestore === e._firestore && Dc(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));
16758
+ return t instanceof Nu && e instanceof Nu ? 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 ku && e instanceof ku && (t._firestore === e._firestore && Da(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));
16759
16759
  }
16760
16760
 
16761
16761
  /**
@@ -16801,27 +16801,27 @@ function $u(t) {
16801
16801
 
16802
16802
  class Bu extends Mu {
16803
16803
  constructor(t, e, n) {
16804
- super(), this.Ka = t, this.ja = e, this.Qa = n, this.type = "where";
16804
+ super(), this.jc = t, this.Qc = e, this.Wc = n, this.type = "where";
16805
16805
  }
16806
16806
  _apply(t) {
16807
- const e = cu(t.firestore), n = function(t, e, n, s, i, r, o) {
16808
- let a;
16807
+ const e = au(t.firestore), n = function(t, e, n, s, i, r, o) {
16808
+ let c;
16809
16809
  if (i.isKeyField()) {
16810
16810
  if ("array-contains" /* ARRAY_CONTAINS */ === r || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === r) throw new j(K.INVALID_ARGUMENT, `Invalid Query. You can't perform '${r}' queries on FieldPath.documentId().`);
16811
16811
  if ("in" /* IN */ === r || "not-in" /* NOT_IN */ === r) {
16812
16812
  eh(o, r);
16813
16813
  const e = [];
16814
16814
  for (const n of o) e.push(th(s, t, n));
16815
- a = {
16815
+ c = {
16816
16816
  arrayValue: {
16817
16817
  values: e
16818
16818
  }
16819
16819
  };
16820
- } else a = th(s, t, o);
16820
+ } else c = th(s, t, o);
16821
16821
  } else "in" /* IN */ !== r && "not-in" /* NOT_IN */ !== r && "array-contains-any" /* ARRAY_CONTAINS_ANY */ !== r || eh(o, r),
16822
- a = yu(n, e, o,
16822
+ c = yu(n, e, o,
16823
16823
  /* allowArrays= */ "in" /* IN */ === r || "not-in" /* NOT_IN */ === r);
16824
- const c = Yt.create(i, r, a);
16824
+ const a = Yt.create(i, r, c);
16825
16825
  return function(t, e) {
16826
16826
  if (e.v()) {
16827
16827
  const n = pe(t);
@@ -16869,9 +16869,9 @@ class Bu extends Mu {
16869
16869
  if (null !== n)
16870
16870
  // Special case when it's a duplicate op to give a slightly clearer error message.
16871
16871
  throw n === e.op ? new j(K.INVALID_ARGUMENT, `Invalid query. You cannot use more than one '${e.op.toString()}' filter.`) : new j(K.INVALID_ARGUMENT, `Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`);
16872
- }(t, c), c;
16873
- }(t._query, "where", e, t.firestore._databaseId, this.Ka, this.ja, this.Qa);
16874
- return new Rc(t.firestore, t.converter, function(t, e) {
16872
+ }(t, a), a;
16873
+ }(t._query, "where", e, t.firestore._databaseId, this.jc, this.Qc, this.Wc);
16874
+ return new Ra(t.firestore, t.converter, function(t, e) {
16875
16875
  const n = t.filters.concat([ e ]);
16876
16876
  return new de(t.path, t.collectionGroup, t.explicitOrderBy.slice(), n, t.limit, t.limitType, t.startAt, t.endAt);
16877
16877
  }(t._query, n));
@@ -16895,7 +16895,7 @@ class Bu extends Mu {
16895
16895
 
16896
16896
  class qu extends Mu {
16897
16897
  constructor(t, e) {
16898
- super(), this.Ka = t, this.Wa = e, this.type = "orderBy";
16898
+ super(), this.jc = t, this.Gc = e, this.type = "orderBy";
16899
16899
  }
16900
16900
  _apply(t) {
16901
16901
  const e = function(t, e, n) {
@@ -16920,8 +16920,8 @@ class qu extends Mu {
16920
16920
  * Will throw if the document does not contain all fields of the order by
16921
16921
  * of the query or if any of the fields in the order by are an uncommitted
16922
16922
  * server timestamp.
16923
- */ (t._query, this.Ka, this.Wa);
16924
- return new Rc(t.firestore, t.converter, function(t, e) {
16923
+ */ (t._query, this.jc, this.Gc);
16924
+ return new Ra(t.firestore, t.converter, function(t, e) {
16925
16925
  // TODO(dimond): validate that orderBy does not list the same key twice.
16926
16926
  const n = t.explicitOrderBy.concat([ e ]);
16927
16927
  return new de(t.path, t.collectionGroup, n, t.filters.slice(), t.limit, t.limitType, t.startAt, t.endAt);
@@ -16944,10 +16944,10 @@ class qu extends Mu {
16944
16944
 
16945
16945
  class ju extends Mu {
16946
16946
  constructor(t, e, n) {
16947
- super(), this.type = t, this.Ga = e, this.za = n;
16947
+ super(), this.type = t, this.zc = e, this.Hc = n;
16948
16948
  }
16949
16949
  _apply(t) {
16950
- return new Rc(t.firestore, t.converter, Ae(t._query, this.Ga, this.za));
16950
+ return new Ra(t.firestore, t.converter, Ae(t._query, this.zc, this.Hc));
16951
16951
  }
16952
16952
  }
16953
16953
 
@@ -16957,7 +16957,7 @@ class ju extends Mu {
16957
16957
  * @param limit - The maximum number of items to return.
16958
16958
  * @returns The created {@link Query}.
16959
16959
  */ function Qu(t) {
16960
- return pc("limit", t), new ju("limit", t, "F" /* First */);
16960
+ return pa("limit", t), new ju("limit", t, "F" /* First */);
16961
16961
  }
16962
16962
 
16963
16963
  /**
@@ -16969,16 +16969,16 @@ class ju extends Mu {
16969
16969
  * @param limit - The maximum number of items to return.
16970
16970
  * @returns The created {@link Query}.
16971
16971
  */ function Wu(t) {
16972
- return pc("limitToLast", t), new ju("limitToLast", t, "L" /* Last */);
16972
+ return pa("limitToLast", t), new ju("limitToLast", t, "L" /* Last */);
16973
16973
  }
16974
16974
 
16975
16975
  class Gu extends Mu {
16976
16976
  constructor(t, e, n) {
16977
- super(), this.type = t, this.Ha = e, this.Ja = n;
16977
+ super(), this.type = t, this.Jc = e, this.Yc = n;
16978
16978
  }
16979
16979
  _apply(t) {
16980
- const e = Zu(t, this.type, this.Ha, this.Ja);
16981
- return new Rc(t.firestore, t.converter, function(t, e) {
16980
+ const e = Zu(t, this.type, this.Jc, this.Yc);
16981
+ return new Ra(t.firestore, t.converter, function(t, e) {
16982
16982
  return new de(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, e, t.endAt);
16983
16983
  }(t._query, e));
16984
16984
  }
@@ -16995,11 +16995,11 @@ function Hu(...t) {
16995
16995
 
16996
16996
  class Ju extends Mu {
16997
16997
  constructor(t, e, n) {
16998
- super(), this.type = t, this.Ha = e, this.Ja = n;
16998
+ super(), this.type = t, this.Jc = e, this.Yc = n;
16999
16999
  }
17000
17000
  _apply(t) {
17001
- const e = Zu(t, this.type, this.Ha, this.Ja);
17002
- return new Rc(t.firestore, t.converter, function(t, e) {
17001
+ const e = Zu(t, this.type, this.Jc, this.Yc);
17002
+ return new Ra(t.firestore, t.converter, function(t, e) {
17003
17003
  return new de(t.path, t.collectionGroup, t.explicitOrderBy.slice(), t.filters.slice(), t.limit, t.limitType, t.startAt, e);
17004
17004
  }(t._query, e));
17005
17005
  }
@@ -17033,33 +17033,33 @@ function Xu(...t) {
17033
17033
  }
17034
17034
  r.push(t);
17035
17035
  }
17036
- return new ae(r, i);
17036
+ return new ce(r, i);
17037
17037
  }
17038
17038
  /**
17039
17039
  * Converts a list of field values to a `Bound` for the given query.
17040
17040
  */ (t._query, t.firestore._databaseId, e, n[0]._document, s);
17041
17041
  {
17042
- const i = cu(t.firestore);
17042
+ const i = au(t.firestore);
17043
17043
  return function(t, e, n, s, i, r) {
17044
17044
  // Use explicit order by's because it has to match the query the user made
17045
17045
  const o = t.explicitOrderBy;
17046
17046
  if (i.length > o.length) throw new j(K.INVALID_ARGUMENT, `Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);
17047
- const a = [];
17047
+ const c = [];
17048
17048
  for (let r = 0; r < i.length; r++) {
17049
- const c = i[r];
17049
+ const a = i[r];
17050
17050
  if (o[r].field.isKeyField()) {
17051
- if ("string" != typeof c) throw new j(K.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${s}(), but got a ${typeof c}`);
17052
- if (!Ee(t) && -1 !== c.indexOf("/")) throw new j(K.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to ${s}() must be a plain document ID, but '${c}' contains a slash.`);
17053
- const n = t.path.child(ht.fromString(c));
17051
+ if ("string" != typeof a) throw new j(K.INVALID_ARGUMENT, `Invalid query. Expected a string for document ID in ${s}(), but got a ${typeof a}`);
17052
+ if (!Ee(t) && -1 !== a.indexOf("/")) throw new j(K.INVALID_ARGUMENT, `Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to ${s}() must be a plain document ID, but '${a}' contains a slash.`);
17053
+ const n = t.path.child(ht.fromString(a));
17054
17054
  if (!vt.isDocumentKey(n)) throw new j(K.INVALID_ARGUMENT, `Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to ${s}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);
17055
17055
  const i = new vt(n);
17056
- a.push($t(e, i));
17056
+ c.push($t(e, i));
17057
17057
  } else {
17058
- const t = yu(n, s, c);
17059
- a.push(t);
17058
+ const t = yu(n, s, a);
17059
+ c.push(t);
17060
17060
  }
17061
17061
  }
17062
- return new ae(a, r);
17062
+ return new ce(c, r);
17063
17063
  }
17064
17064
  /**
17065
17065
  * Parses the given `documentIdValue` into a `ReferenceValue`, throwing
@@ -17077,8 +17077,8 @@ function th(t, e, n) {
17077
17077
  if (!vt.isDocumentKey(s)) throw new j(K.INVALID_ARGUMENT, `Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);
17078
17078
  return $t(t, new vt(s));
17079
17079
  }
17080
- if (n instanceof Ac) return $t(t, n._key);
17081
- throw new j(K.INVALID_ARGUMENT, `Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: ${gc(n)}.`);
17080
+ if (n instanceof Aa) return $t(t, n._key);
17081
+ throw new j(K.INVALID_ARGUMENT, `Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: ${ga(n)}.`);
17082
17082
  }
17083
17083
 
17084
17084
  /**
@@ -17156,7 +17156,7 @@ function nh(t, e, n) {
17156
17156
  }
17157
17157
  convertObject(t, e) {
17158
17158
  const n = {};
17159
- return at(t.fields, ((t, s) => {
17159
+ return ct(t.fields, ((t, s) => {
17160
17160
  n[t] = this.convertValue(s, e);
17161
17161
  })), n;
17162
17162
  }
@@ -17186,7 +17186,7 @@ function nh(t, e, n) {
17186
17186
  convertDocumentKey(t, e) {
17187
17187
  const n = ht.fromString(t);
17188
17188
  B(Ts(n));
17189
- const s = new lc(n.get(1), n.get(3)), i = new vt(n.popFirst(5));
17189
+ const s = new la(n.get(1), n.get(3)), i = new vt(n.popFirst(5));
17190
17190
  return s.isEqual(e) ||
17191
17191
  // TODO(b/64130202): Somehow support foreign references.
17192
17192
  O(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`),
@@ -17232,11 +17232,11 @@ class rh extends sh {
17232
17232
  super(), this.firestore = t;
17233
17233
  }
17234
17234
  convertBytes(t) {
17235
- return new Zc(t);
17235
+ return new Za(t);
17236
17236
  }
17237
17237
  convertReference(t) {
17238
17238
  const e = this.convertDocumentKey(t, this.firestore._databaseId);
17239
- return new Ac(this.firestore, /* converter= */ null, e);
17239
+ return new Aa(this.firestore, /* converter= */ null, e);
17240
17240
  }
17241
17241
  }
17242
17242
 
@@ -17267,20 +17267,20 @@ class rh extends sh {
17267
17267
  /** @hideconstructor */
17268
17268
  constructor(t, e) {
17269
17269
  this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
17270
- this._dataReader = cu(t);
17270
+ this._dataReader = au(t);
17271
17271
  }
17272
17272
  set(t, e, n) {
17273
17273
  this._verifyNotCommitted();
17274
- const s = ah(t, this._firestore), i = ih(s.converter, e, n), r = uu(this._dataReader, "WriteBatch.set", s._key, i, null !== s.converter, n);
17274
+ const s = ch(t, this._firestore), i = ih(s.converter, e, n), r = uu(this._dataReader, "WriteBatch.set", s._key, i, null !== s.converter, n);
17275
17275
  return this._mutations.push(r.toMutation(s._key, ze.none())), this;
17276
17276
  }
17277
17277
  update(t, e, n, ...s) {
17278
17278
  this._verifyNotCommitted();
17279
- const i = ah(t, this._firestore);
17279
+ const i = ch(t, this._firestore);
17280
17280
  // For Compat types, we have to "extract" the underlying types before
17281
17281
  // performing validation.
17282
17282
  let r;
17283
- return r = "string" == typeof (e = p(e)) || e instanceof Yc ? gu(this._dataReader, "WriteBatch.update", i._key, e, n, s) : mu(this._dataReader, "WriteBatch.update", i._key, e),
17283
+ return r = "string" == typeof (e = p(e)) || e instanceof Ya ? gu(this._dataReader, "WriteBatch.update", i._key, e, n, s) : mu(this._dataReader, "WriteBatch.update", i._key, e),
17284
17284
  this._mutations.push(r.toMutation(i._key, ze.exists(!0))), this;
17285
17285
  }
17286
17286
  /**
@@ -17290,8 +17290,8 @@ class rh extends sh {
17290
17290
  * @returns This `WriteBatch` instance. Used for chaining method calls.
17291
17291
  */ delete(t) {
17292
17292
  this._verifyNotCommitted();
17293
- const e = ah(t, this._firestore);
17294
- return this._mutations = this._mutations.concat(new cn(e._key, ze.none())), this;
17293
+ const e = ch(t, this._firestore);
17294
+ return this._mutations = this._mutations.concat(new an(e._key, ze.none())), this;
17295
17295
  }
17296
17296
  /**
17297
17297
  * Commits all of the writes in this write batch as a single atomic unit.
@@ -17312,7 +17312,7 @@ class rh extends sh {
17312
17312
  }
17313
17313
  }
17314
17314
 
17315
- function ah(t, e) {
17315
+ function ch(t, e) {
17316
17316
  if ((t = p(t)).firestore !== e) throw new j(K.INVALID_ARGUMENT, "Provided document reference is from a different Firestore instance.");
17317
17317
  return t;
17318
17318
  }
@@ -17370,10 +17370,10 @@ function ah(t, e) {
17370
17370
  * @returns A Promise resolved with a `DocumentSnapshot` containing the
17371
17371
  * current document contents.
17372
17372
  */
17373
- function ch(t) {
17374
- t = yc(t, Ac);
17375
- const e = yc(t.firestore, $c);
17376
- return sc(Mc(e), t._key).then((n => Ih(e, t, n)));
17373
+ function ah(t) {
17374
+ t = ya(t, Aa);
17375
+ const e = ya(t.firestore, $a);
17376
+ return sa(Ma(e), t._key).then((n => Ih(e, t, n)));
17377
17377
  }
17378
17378
 
17379
17379
  class uh extends sh {
@@ -17381,11 +17381,11 @@ class uh extends sh {
17381
17381
  super(), this.firestore = t;
17382
17382
  }
17383
17383
  convertBytes(t) {
17384
- return new Zc(t);
17384
+ return new Za(t);
17385
17385
  }
17386
17386
  convertReference(t) {
17387
17387
  const e = this.convertDocumentKey(t, this.firestore._databaseId);
17388
- return new Ac(this.firestore, /* converter= */ null, e);
17388
+ return new Aa(this.firestore, /* converter= */ null, e);
17389
17389
  }
17390
17390
  }
17391
17391
 
@@ -17396,9 +17396,9 @@ class uh extends sh {
17396
17396
  * @returns A `Promise` resolved with a `DocumentSnapshot` containing the
17397
17397
  * current document contents.
17398
17398
  */ function hh(t) {
17399
- t = yc(t, Ac);
17400
- const e = yc(t.firestore, $c), n = Mc(e), s = new uh(e);
17401
- return nc(n, t._key).then((n => new Nu(e, s, t._key, n, new Cu(null !== n && n.hasLocalMutations,
17399
+ t = ya(t, Aa);
17400
+ const e = ya(t.firestore, $a), n = Ma(e), s = new uh(e);
17401
+ return na(n, t._key).then((n => new Nu(e, s, t._key, n, new Cu(null !== n && n.hasLocalMutations,
17402
17402
  /* fromCache= */ !0), t.converter)));
17403
17403
  }
17404
17404
 
@@ -17409,9 +17409,9 @@ class uh extends sh {
17409
17409
  * @returns A `Promise` resolved with a `DocumentSnapshot` containing the
17410
17410
  * current document contents.
17411
17411
  */ function lh(t) {
17412
- t = yc(t, Ac);
17413
- const e = yc(t.firestore, $c);
17414
- return sc(Mc(e), t._key, {
17412
+ t = ya(t, Aa);
17413
+ const e = ya(t.firestore, $a);
17414
+ return sa(Ma(e), t._key, {
17415
17415
  source: "server"
17416
17416
  }).then((n => Ih(e, t, n)));
17417
17417
  }
@@ -17426,9 +17426,9 @@ class uh extends sh {
17426
17426
  *
17427
17427
  * @returns A `Promise` that will be resolved with the results of the query.
17428
17428
  */ function fh(t) {
17429
- t = yc(t, Rc);
17430
- const e = yc(t.firestore, $c), n = Mc(e), s = new uh(e);
17431
- return Fu(t._query), rc(n, t._query).then((n => new ku(e, s, t, n)));
17429
+ t = ya(t, Ra);
17430
+ const e = ya(t.firestore, $a), n = Ma(e), s = new uh(e);
17431
+ return Fu(t._query), ra(n, t._query).then((n => new ku(e, s, t, n)));
17432
17432
  }
17433
17433
 
17434
17434
  /**
@@ -17437,9 +17437,9 @@ class uh extends sh {
17437
17437
  *
17438
17438
  * @returns A `Promise` that will be resolved with the results of the query.
17439
17439
  */ function dh(t) {
17440
- t = yc(t, Rc);
17441
- const e = yc(t.firestore, $c), n = Mc(e), s = new uh(e);
17442
- return ic(n, t._query).then((n => new ku(e, s, t, n)));
17440
+ t = ya(t, Ra);
17441
+ const e = ya(t.firestore, $a), n = Ma(e), s = new uh(e);
17442
+ return ia(n, t._query).then((n => new ku(e, s, t, n)));
17443
17443
  }
17444
17444
 
17445
17445
  /**
@@ -17448,27 +17448,27 @@ class uh extends sh {
17448
17448
  *
17449
17449
  * @returns A `Promise` that will be resolved with the results of the query.
17450
17450
  */ function wh(t) {
17451
- t = yc(t, Rc);
17452
- const e = yc(t.firestore, $c), n = Mc(e), s = new uh(e);
17453
- return rc(n, t._query, {
17451
+ t = ya(t, Ra);
17452
+ const e = ya(t.firestore, $a), n = Ma(e), s = new uh(e);
17453
+ return ra(n, t._query, {
17454
17454
  source: "server"
17455
17455
  }).then((n => new ku(e, s, t, n)));
17456
17456
  }
17457
17457
 
17458
17458
  function _h(t, e, n) {
17459
- t = yc(t, Ac);
17460
- const s = yc(t.firestore, $c), i = ih(t.converter, e, n);
17461
- return Th(s, [ uu(cu(s), "setDoc", t._key, i, null !== t.converter, n).toMutation(t._key, ze.none()) ]);
17459
+ t = ya(t, Aa);
17460
+ const s = ya(t.firestore, $a), i = ih(t.converter, e, n);
17461
+ return Th(s, [ uu(au(s), "setDoc", t._key, i, null !== t.converter, n).toMutation(t._key, ze.none()) ]);
17462
17462
  }
17463
17463
 
17464
17464
  function mh(t, e, n, ...s) {
17465
- t = yc(t, Ac);
17466
- const i = yc(t.firestore, $c), r = cu(i);
17465
+ t = ya(t, Aa);
17466
+ const i = ya(t.firestore, $a), r = au(i);
17467
17467
  let o;
17468
17468
  o = "string" == typeof (
17469
17469
  // For Compat types, we have to "extract" the underlying types before
17470
17470
  // performing validation.
17471
- e = p(e)) || e instanceof Yc ? gu(r, "updateDoc", t._key, e, n, s) : mu(r, "updateDoc", t._key, e);
17471
+ e = p(e)) || e instanceof Ya ? gu(r, "updateDoc", t._key, e, n, s) : mu(r, "updateDoc", t._key, e);
17472
17472
  return Th(i, [ o.toMutation(t._key, ze.exists(!0)) ]);
17473
17473
  }
17474
17474
 
@@ -17479,7 +17479,7 @@ function mh(t, e, n, ...s) {
17479
17479
  * @returns A Promise resolved once the document has been successfully
17480
17480
  * deleted from the backend (note that it won't resolve while you're offline).
17481
17481
  */ function gh(t) {
17482
- return Th(yc(t.firestore, $c), [ new cn(t._key, ze.none()) ]);
17482
+ return Th(ya(t.firestore, $a), [ new an(t._key, ze.none()) ]);
17483
17483
  }
17484
17484
 
17485
17485
  /**
@@ -17492,8 +17492,8 @@ function mh(t, e, n, ...s) {
17492
17492
  * newly created document after it has been written to the backend (Note that it
17493
17493
  * won't resolve while you're offline).
17494
17494
  */ function yh(t, e) {
17495
- const n = yc(t.firestore, $c), s = Vc(t), i = ih(t.converter, e);
17496
- return Th(n, [ uu(cu(t.firestore), "addDoc", s._key, i, null !== t.converter, {}).toMutation(s._key, ze.exists(!1)) ]).then((() => s));
17495
+ const n = ya(t.firestore, $a), s = Va(t), i = ih(t.converter, e);
17496
+ return Th(n, [ uu(au(t.firestore), "addDoc", s._key, i, null !== t.converter, {}).toMutation(s._key, ze.exists(!1)) ]).then((() => s));
17497
17497
  }
17498
17498
 
17499
17499
  function ph(t, ...e) {
@@ -17502,27 +17502,27 @@ function ph(t, ...e) {
17502
17502
  let r = {
17503
17503
  includeMetadataChanges: !1
17504
17504
  }, o = 0;
17505
- "object" != typeof e[o] || Nc(e[o]) || (r = e[o], o++);
17506
- const a = {
17505
+ "object" != typeof e[o] || Na(e[o]) || (r = e[o], o++);
17506
+ const c = {
17507
17507
  includeMetadataChanges: r.includeMetadataChanges
17508
17508
  };
17509
- if (Nc(e[o])) {
17509
+ if (Na(e[o])) {
17510
17510
  const t = e[o];
17511
17511
  e[o] = null === (n = t.next) || void 0 === n ? void 0 : n.bind(t), e[o + 1] = null === (s = t.error) || void 0 === s ? void 0 : s.bind(t),
17512
17512
  e[o + 2] = null === (i = t.complete) || void 0 === i ? void 0 : i.bind(t);
17513
17513
  }
17514
- let c, u, h;
17515
- if (t instanceof Ac) u = yc(t.firestore, $c), h = _e(t._key.path), c = {
17514
+ let a, u, h;
17515
+ if (t instanceof Aa) u = ya(t.firestore, $a), h = _e(t._key.path), a = {
17516
17516
  next: n => {
17517
17517
  e[o] && e[o](Ih(u, t, n));
17518
17518
  },
17519
17519
  error: e[o + 1],
17520
17520
  complete: e[o + 2]
17521
17521
  }; else {
17522
- const n = yc(t, Rc);
17523
- u = yc(n.firestore, $c), h = n._query;
17522
+ const n = ya(t, Ra);
17523
+ u = ya(n.firestore, $a), h = n._query;
17524
17524
  const s = new uh(u);
17525
- c = {
17525
+ a = {
17526
17526
  next: t => {
17527
17527
  e[o] && e[o](new ku(u, s, n, t));
17528
17528
  },
@@ -17531,15 +17531,15 @@ function ph(t, ...e) {
17531
17531
  }, Fu(t._query);
17532
17532
  }
17533
17533
  return function(t, e, n, s) {
17534
- const i = new Ba(s), r = new Wo(e, i, n);
17535
- return t.asyncQueue.enqueueAndForget((async () => Uo(await Za(t), r))), () => {
17536
- i.Xo(), t.asyncQueue.enqueueAndForget((async () => qo(await Za(t), r)));
17534
+ const i = new Bc(s), r = new Wo(e, i, n);
17535
+ return t.asyncQueue.enqueueAndForget((async () => Uo(await Zc(t), r))), () => {
17536
+ i.Xo(), t.asyncQueue.enqueueAndForget((async () => qo(await Zc(t), r)));
17537
17537
  };
17538
- }(Mc(u), h, a, c);
17538
+ }(Ma(u), h, c, a);
17539
17539
  }
17540
17540
 
17541
17541
  function Eh(t, e) {
17542
- return oc(Mc(t = yc(t, $c)), Nc(e) ? e : {
17542
+ return oa(Ma(t = ya(t, $a)), Na(e) ? e : {
17543
17543
  next: e
17544
17544
  });
17545
17545
  }
@@ -17550,8 +17550,8 @@ function Eh(t, e) {
17550
17550
  */ function Th(t, e) {
17551
17551
  return function(t, e) {
17552
17552
  const n = new Q;
17553
- return t.asyncQueue.enqueueAndForget((async () => oa(await Xa(t), e, n))), n.promise;
17554
- }(Mc(t), e);
17553
+ return t.asyncQueue.enqueueAndForget((async () => oc(await Xc(t), e, n))), n.promise;
17554
+ }(Ma(t), e);
17555
17555
  }
17556
17556
 
17557
17557
  /**
@@ -17587,7 +17587,7 @@ function Eh(t, e) {
17587
17587
  */ class Ah extends class {
17588
17588
  /** @hideconstructor */
17589
17589
  constructor(t, e) {
17590
- this._firestore = t, this._transaction = e, this._dataReader = cu(t);
17590
+ this._firestore = t, this._transaction = e, this._dataReader = au(t);
17591
17591
  }
17592
17592
  /**
17593
17593
  * Reads the document referenced by the provided {@link DocumentReference}.
@@ -17595,7 +17595,7 @@ function Eh(t, e) {
17595
17595
  * @param documentRef - A reference to the document to be read.
17596
17596
  * @returns A `DocumentSnapshot` with the read data.
17597
17597
  */ get(t) {
17598
- const e = ah(t, this._firestore), n = new rh(this._firestore);
17598
+ const e = ch(t, this._firestore), n = new rh(this._firestore);
17599
17599
  return this._transaction.lookup([ e._key ]).then((t => {
17600
17600
  if (!t || 1 !== t.length) return L();
17601
17601
  const s = t[0];
@@ -17605,15 +17605,15 @@ function Eh(t, e) {
17605
17605
  }));
17606
17606
  }
17607
17607
  set(t, e, n) {
17608
- const s = ah(t, this._firestore), i = ih(s.converter, e, n), r = uu(this._dataReader, "Transaction.set", s._key, i, null !== s.converter, n);
17608
+ const s = ch(t, this._firestore), i = ih(s.converter, e, n), r = uu(this._dataReader, "Transaction.set", s._key, i, null !== s.converter, n);
17609
17609
  return this._transaction.set(s._key, r), this;
17610
17610
  }
17611
17611
  update(t, e, n, ...s) {
17612
- const i = ah(t, this._firestore);
17612
+ const i = ch(t, this._firestore);
17613
17613
  // For Compat types, we have to "extract" the underlying types before
17614
17614
  // performing validation.
17615
17615
  let r;
17616
- return r = "string" == typeof (e = p(e)) || e instanceof Yc ? gu(this._dataReader, "Transaction.update", i._key, e, n, s) : mu(this._dataReader, "Transaction.update", i._key, e),
17616
+ return r = "string" == typeof (e = p(e)) || e instanceof Ya ? gu(this._dataReader, "Transaction.update", i._key, e, n, s) : mu(this._dataReader, "Transaction.update", i._key, e),
17617
17617
  this._transaction.update(i._key, r), this;
17618
17618
  }
17619
17619
  /**
@@ -17622,7 +17622,7 @@ function Eh(t, e) {
17622
17622
  * @param documentRef - A reference to the document to be deleted.
17623
17623
  * @returns This `Transaction` instance. Used for chaining method calls.
17624
17624
  */ delete(t) {
17625
- const e = ah(t, this._firestore);
17625
+ const e = ch(t, this._firestore);
17626
17626
  return this._transaction.delete(e._key), this;
17627
17627
  }
17628
17628
  } {
@@ -17638,7 +17638,7 @@ function Eh(t, e) {
17638
17638
  * @param documentRef - A reference to the document to be read.
17639
17639
  * @returns A `DocumentSnapshot` with the read data.
17640
17640
  */ get(t) {
17641
- const e = ah(t, this._firestore), n = new uh(this._firestore);
17641
+ const e = ch(t, this._firestore), n = new uh(this._firestore);
17642
17642
  return super.get(t).then((t => new Nu(this._firestore, n, e._key, t._document, new Cu(
17643
17643
  /* hasPendingWrites= */ !1,
17644
17644
  /* fromCache= */ !1), e.converter)));
@@ -17662,7 +17662,7 @@ function Eh(t, e) {
17662
17662
  * `updateFunction `is returned here. Otherwise, if the transaction failed, a
17663
17663
  * rejected promise with the corresponding failure error is returned.
17664
17664
  */ function Rh(t, e) {
17665
- return ac(Mc(t), (n => e(new Ah(t, n))));
17665
+ return ca(Ma(t), (n => e(new Ah(t, n))));
17666
17666
  }
17667
17667
 
17668
17668
  /**
@@ -17777,7 +17777,7 @@ function Eh(t, e) {
17777
17777
  * @returns A {@link WriteBatch} that can be used to atomically execute multiple
17778
17778
  * writes.
17779
17779
  */ function Dh(t) {
17780
- return Mc(t = yc(t, $c)), new oh(t, (e => Th(t, e)));
17780
+ return Ma(t = ya(t, $a)), new oh(t, (e => Th(t, e)));
17781
17781
  }
17782
17782
 
17783
17783
  /**
@@ -17800,11 +17800,11 @@ function Eh(t, e) {
17800
17800
  Ch = "rn", function(t) {
17801
17801
  C = t;
17802
17802
  }(i), n(new r("firestore", ((t, {options: e}) => {
17803
- const n = t.getProvider("app").getImmediate(), s = new $c(n, new H(t.getProvider("auth-internal")));
17803
+ const n = t.getProvider("app").getImmediate(), s = new $a(n, new H(t.getProvider("auth-internal")));
17804
17804
  return e = Object.assign({
17805
17805
  useFetchStreams: !0
17806
17806
  }, e), s._setSettings(e), s;
17807
- }), "PUBLIC" /* PUBLIC */)), s("@firebase/firestore", "3.0.2-canary.ba9cba4e3", Ch);
17807
+ }), "PUBLIC" /* PUBLIC */)), s("@firebase/firestore", "3.0.2-canary.dfe65ff9b", Ch);
17808
17808
 
17809
- export { sh as AbstractUserDataWriter, Zc as Bytes, kc as CACHE_SIZE_UNLIMITED, bc as CollectionReference, Ac as DocumentReference, Nu as DocumentSnapshot, Yc as FieldPath, tu as FieldValue, $c as Firestore, j as FirestoreError, eu as GeoPoint, xc as LoadBundleTask, Rc as Query, Mu as QueryConstraint, xu as QueryDocumentSnapshot, ku as QuerySnapshot, Cu as SnapshotMetadata, it as Timestamp, Ah as Transaction, oh as WriteBatch, lc as _DatabaseId, vt as _DocumentKey, G as _EmptyCredentialsProvider, ft as _FieldPath, yc as _cast, U as _debugAssert, _t as _isBase64Available, F as _logWarn, wc as _validateIsNotUsedTogether, yh as addDoc, Vh as arrayRemove, vh as arrayUnion, Kc as clearIndexedDbPersistence, Pc as collection, vc as collectionGroup, Ic as connectFirestoreEmulator, gh as deleteDoc, bh as deleteField, Wc as disableNetwork, Vc as doc, Xc as documentId, Bc as enableIndexedDbPersistence, Uc as enableMultiTabIndexedDbPersistence, Qc as enableNetwork, Xu as endAt, Yu as endBefore, Mc as ensureFirestoreConfigured, Th as executeWrite, ch as getDoc, hh as getDocFromCache, lh as getDocFromServer, fh as getDocs, dh as getDocsFromCache, wh as getDocsFromServer, Fc as getFirestore, Sh as increment, Oc as initializeFirestore, Qu as limit, Wu as limitToLast, zc as loadBundle, Hc as namedQuery, ph as onSnapshot, Eh as onSnapshotsInSync, Ku as orderBy, Lu as query, Dc as queryEqual, Sc as refEqual, Rh as runTransaction, Ph as serverTimestamp, _h as setDoc, k as setLogLevel, Ou as snapshotEqual, Hu as startAfter, zu as startAt, Gc as terminate, mh as updateDoc, jc as waitForPendingWrites, Uu as where, Dh as writeBatch };
17809
+ export { sh as AbstractUserDataWriter, Za as Bytes, ka as CACHE_SIZE_UNLIMITED, ba as CollectionReference, Aa as DocumentReference, Nu as DocumentSnapshot, Ya as FieldPath, tu as FieldValue, $a as Firestore, j as FirestoreError, eu as GeoPoint, xa as LoadBundleTask, Ra as Query, Mu as QueryConstraint, xu as QueryDocumentSnapshot, ku as QuerySnapshot, Cu as SnapshotMetadata, it as Timestamp, Ah as Transaction, oh as WriteBatch, la as _DatabaseId, vt as _DocumentKey, G as _EmptyCredentialsProvider, ft as _FieldPath, ya as _cast, U as _debugAssert, _t as _isBase64Available, F as _logWarn, wa as _validateIsNotUsedTogether, yh as addDoc, Vh as arrayRemove, vh as arrayUnion, Ka as clearIndexedDbPersistence, Pa as collection, va as collectionGroup, Ia as connectFirestoreEmulator, gh as deleteDoc, bh as deleteField, Wa as disableNetwork, Va as doc, Xa as documentId, Ba as enableIndexedDbPersistence, Ua as enableMultiTabIndexedDbPersistence, Qa as enableNetwork, Xu as endAt, Yu as endBefore, Ma as ensureFirestoreConfigured, Th as executeWrite, ah as getDoc, hh as getDocFromCache, lh as getDocFromServer, fh as getDocs, dh as getDocsFromCache, wh as getDocsFromServer, Fa as getFirestore, Sh as increment, Oa as initializeFirestore, Qu as limit, Wu as limitToLast, za as loadBundle, Ha as namedQuery, ph as onSnapshot, Eh as onSnapshotsInSync, Ku as orderBy, Lu as query, Da as queryEqual, Sa as refEqual, Rh as runTransaction, Ph as serverTimestamp, _h as setDoc, k as setLogLevel, Ou as snapshotEqual, Hu as startAfter, zu as startAt, Ga as terminate, mh as updateDoc, ja as waitForPendingWrites, Uu as where, Dh as writeBatch };
17810
17810
  //# sourceMappingURL=index.rn.js.map