@firebase/firestore 4.4.2 → 4.4.3-canary.245dd26e1

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.
@@ -66,7 +66,7 @@ User.MOCK_USER = new User("mock-user");
66
66
  * See the License for the specific language governing permissions and
67
67
  * limitations under the License.
68
68
  */
69
- let S = "10.8.0";
69
+ let S = "10.8.1-canary.245dd26e1";
70
70
 
71
71
  /**
72
72
  * @license
@@ -5844,16 +5844,16 @@ class BloomFilter {
5844
5844
  throw new __PRIVATE_BloomFilterError(`Invalid padding when bitmap length is 0: ${t}`);
5845
5845
  this.Te = 8 * e.length - t,
5846
5846
  // Set the bit count in Integer to avoid repetition in mightContain().
5847
- this.Ee = Integer.fromNumber(this.Te);
5847
+ this.de = Integer.fromNumber(this.Te);
5848
5848
  }
5849
5849
  // Calculate the ith hash value based on the hashed 64bit integers,
5850
5850
  // and calculate its corresponding bit index in the bitmap to be checked.
5851
- de(e, t, n) {
5851
+ Ee(e, t, n) {
5852
5852
  // Calculate hashed value h(i) = h1 + (i * h2).
5853
5853
  let r = e.add(t.multiply(Integer.fromNumber(n)));
5854
5854
  // Wrap if hash value overflow 64bit.
5855
5855
  return 1 === r.compare(le) && (r = new Integer([ r.getBits(0), r.getBits(1) ], 0)),
5856
- r.modulo(this.Ee).toNumber();
5856
+ r.modulo(this.de).toNumber();
5857
5857
  }
5858
5858
  // Return whether the bit on the given index in the bitmap is set to 1.
5859
5859
  Ae(e) {
@@ -5864,7 +5864,7 @@ class BloomFilter {
5864
5864
  if (0 === this.Te) return !1;
5865
5865
  const t = __PRIVATE_getMd5HashValue(e), [n, r] = __PRIVATE_get64BitUints(t);
5866
5866
  for (let e = 0; e < this.hashCount; e++) {
5867
- const t = this.de(n, r, e);
5867
+ const t = this.Ee(n, r, e);
5868
5868
  if (!this.Ae(t)) return !1;
5869
5869
  }
5870
5870
  return !0;
@@ -5877,7 +5877,7 @@ class BloomFilter {
5877
5877
  if (0 === this.Te) return;
5878
5878
  const t = __PRIVATE_getMd5HashValue(e), [n, r] = __PRIVATE_get64BitUints(t);
5879
5879
  for (let e = 0; e < this.hashCount; e++) {
5880
- const t = this.de(n, r, e);
5880
+ const t = this.Ee(n, r, e);
5881
5881
  this.Re(t);
5882
5882
  }
5883
5883
  }
@@ -7598,52 +7598,52 @@ class __PRIVATE_FirestoreIndexValueWriter {
7598
7598
  t.Tt();
7599
7599
  }
7600
7600
  It(e, t) {
7601
- if ("nullValue" in e) this.Et(t, 5); else if ("booleanValue" in e) this.Et(t, 10),
7602
- t.dt(e.booleanValue ? 1 : 0); else if ("integerValue" in e) this.Et(t, 15), t.dt(__PRIVATE_normalizeNumber(e.integerValue)); else if ("doubleValue" in e) {
7601
+ if ("nullValue" in e) this.dt(t, 5); else if ("booleanValue" in e) this.dt(t, 10),
7602
+ t.Et(e.booleanValue ? 1 : 0); else if ("integerValue" in e) this.dt(t, 15), t.Et(__PRIVATE_normalizeNumber(e.integerValue)); else if ("doubleValue" in e) {
7603
7603
  const n = __PRIVATE_normalizeNumber(e.doubleValue);
7604
- isNaN(n) ? this.Et(t, 13) : (this.Et(t, 15), __PRIVATE_isNegativeZero(n) ?
7604
+ isNaN(n) ? this.dt(t, 13) : (this.dt(t, 15), __PRIVATE_isNegativeZero(n) ?
7605
7605
  // -0.0, 0 and 0.0 are all considered the same
7606
- t.dt(0) : t.dt(n));
7606
+ t.Et(0) : t.Et(n));
7607
7607
  } else if ("timestampValue" in e) {
7608
7608
  const n = e.timestampValue;
7609
- this.Et(t, 20), "string" == typeof n ? t.At(n) : (t.At(`${n.seconds || ""}`), t.dt(n.nanos || 0));
7610
- } else if ("stringValue" in e) this.Rt(e.stringValue, t), this.Vt(t); else if ("bytesValue" in e) this.Et(t, 30),
7609
+ this.dt(t, 20), "string" == typeof n ? t.At(n) : (t.At(`${n.seconds || ""}`), t.Et(n.nanos || 0));
7610
+ } else if ("stringValue" in e) this.Rt(e.stringValue, t), this.Vt(t); else if ("bytesValue" in e) this.dt(t, 30),
7611
7611
  t.ft(__PRIVATE_normalizeByteString(e.bytesValue)), this.Vt(t); else if ("referenceValue" in e) this.gt(e.referenceValue, t); else if ("geoPointValue" in e) {
7612
7612
  const n = e.geoPointValue;
7613
- this.Et(t, 45), t.dt(n.latitude || 0), t.dt(n.longitude || 0);
7614
- } else "mapValue" in e ? __PRIVATE_isMaxValue(e) ? this.Et(t, Number.MAX_SAFE_INTEGER) : (this.yt(e.mapValue, t),
7613
+ this.dt(t, 45), t.Et(n.latitude || 0), t.Et(n.longitude || 0);
7614
+ } else "mapValue" in e ? __PRIVATE_isMaxValue(e) ? this.dt(t, Number.MAX_SAFE_INTEGER) : (this.yt(e.mapValue, t),
7615
7615
  this.Vt(t)) : "arrayValue" in e ? (this.wt(e.arrayValue, t), this.Vt(t)) : fail();
7616
7616
  }
7617
7617
  Rt(e, t) {
7618
- this.Et(t, 25), this.St(e, t);
7618
+ this.dt(t, 25), this.St(e, t);
7619
7619
  }
7620
7620
  St(e, t) {
7621
7621
  t.At(e);
7622
7622
  }
7623
7623
  yt(e, t) {
7624
7624
  const n = e.fields || {};
7625
- this.Et(t, 55);
7625
+ this.dt(t, 55);
7626
7626
  for (const e of Object.keys(n)) this.Rt(e, t), this.It(n[e], t);
7627
7627
  }
7628
7628
  wt(e, t) {
7629
7629
  const n = e.values || [];
7630
- this.Et(t, 50);
7630
+ this.dt(t, 50);
7631
7631
  for (const e of n) this.It(e, t);
7632
7632
  }
7633
7633
  gt(e, t) {
7634
- this.Et(t, 37);
7634
+ this.dt(t, 37);
7635
7635
  DocumentKey.fromName(e).path.forEach((e => {
7636
- this.Et(t, 60), this.St(e, t);
7636
+ this.dt(t, 60), this.St(e, t);
7637
7637
  }));
7638
7638
  }
7639
- Et(e, t) {
7640
- e.dt(t);
7639
+ dt(e, t) {
7640
+ e.Et(t);
7641
7641
  }
7642
7642
  Vt(e) {
7643
7643
  // While the SDK does not implement truncation, the truncation marker is
7644
7644
  // used to terminate all variable length values (which are strings, bytes,
7645
7645
  // references, arrays and maps).
7646
- e.dt(2);
7646
+ e.Et(2);
7647
7647
  }
7648
7648
  }
7649
7649
 
@@ -7833,7 +7833,7 @@ class __PRIVATE_AscendingIndexByteEncoder {
7833
7833
  At(e) {
7834
7834
  this.Gt.Ot(e);
7835
7835
  }
7836
- dt(e) {
7836
+ Et(e) {
7837
7837
  this.Gt.Bt(e);
7838
7838
  }
7839
7839
  Tt() {
@@ -7851,7 +7851,7 @@ class __PRIVATE_DescendingIndexByteEncoder {
7851
7851
  At(e) {
7852
7852
  this.Gt.Nt(e);
7853
7853
  }
7854
- dt(e) {
7854
+ Et(e) {
7855
7855
  this.Gt.qt(e);
7856
7856
  }
7857
7857
  Tt() {
@@ -8582,17 +8582,17 @@ class __PRIVATE_IndexedDbIndexManager {
8582
8582
  // combined with the values from the query bounds.
8583
8583
  const _ = (null != t ? t.length : 1) * Math.max(n.length, i.length), a = _ / (null != t ? t.length : 1), u = [];
8584
8584
  for (let c = 0; c < _; ++c) {
8585
- const _ = t ? this.Tn(t[c / a]) : Te, l = this.En(e, _, n[c % a], r), h = this.dn(e, _, i[c % a], s), P = o.map((t => this.En(e, _, t,
8585
+ const _ = t ? this.Tn(t[c / a]) : Te, l = this.dn(e, _, n[c % a], r), h = this.En(e, _, i[c % a], s), P = o.map((t => this.dn(e, _, t,
8586
8586
  /* inclusive= */ !0)));
8587
8587
  u.push(...this.createRange(l, h, P));
8588
8588
  }
8589
8589
  return u;
8590
8590
  }
8591
- /** Generates the lower bound for `arrayValue` and `directionalValue`. */ En(e, t, n, r) {
8591
+ /** Generates the lower bound for `arrayValue` and `directionalValue`. */ dn(e, t, n, r) {
8592
8592
  const i = new __PRIVATE_IndexEntry(e, DocumentKey.empty(), t, n);
8593
8593
  return r ? i : i.Jt();
8594
8594
  }
8595
- /** Generates the upper bound for `arrayValue` and `directionalValue`. */ dn(e, t, n, r) {
8595
+ /** Generates the upper bound for `arrayValue` and `directionalValue`. */ En(e, t, n, r) {
8596
8596
  const i = new __PRIVATE_IndexEntry(e, DocumentKey.empty(), t, n);
8597
8597
  return r ? i.Jt() : i;
8598
8598
  }
@@ -8922,7 +8922,7 @@ function __PRIVATE_getMinOffsetFromFieldIndexes(e) {
8922
8922
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8923
8923
  * See the License for the specific language governing permissions and
8924
8924
  * limitations under the License.
8925
- */ const Ee = {
8925
+ */ const de = {
8926
8926
  didRun: !1,
8927
8927
  sequenceNumbersCollected: 0,
8928
8928
  targetsRemoved: 0,
@@ -9655,8 +9655,8 @@ class __PRIVATE_TargetIdGenerator {
9655
9655
  }
9656
9656
  collect(e, t) {
9657
9657
  return -1 === this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", "Garbage collection skipped; disabled"),
9658
- PersistencePromise.resolve(Ee)) : this.getCacheSize(e).next((n => n < this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),
9659
- Ee) : this.Yn(e, t)));
9658
+ PersistencePromise.resolve(de)) : this.getCacheSize(e).next((n => n < this.params.cacheSizeCollectionThreshold ? (__PRIVATE_logDebug("LruGarbageCollector", `Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),
9659
+ de) : this.Yn(e, t)));
9660
9660
  }
9661
9661
  getCacheSize(e) {
9662
9662
  return this.jn.getCacheSize(e);
@@ -10698,7 +10698,7 @@ class OverlayedDocument {
10698
10698
  // A set of outstanding references to a document sorted by key.
10699
10699
  this.Pr = new SortedSet(__PRIVATE_DocReference.Ir),
10700
10700
  // A set of outstanding references to a document sorted by target id.
10701
- this.Tr = new SortedSet(__PRIVATE_DocReference.Er);
10701
+ this.Tr = new SortedSet(__PRIVATE_DocReference.dr);
10702
10702
  }
10703
10703
  /** Returns true if the reference set contains no references. */ isEmpty() {
10704
10704
  return this.Pr.isEmpty();
@@ -10707,7 +10707,7 @@ class OverlayedDocument {
10707
10707
  const n = new __PRIVATE_DocReference(e, t);
10708
10708
  this.Pr = this.Pr.add(n), this.Tr = this.Tr.add(n);
10709
10709
  }
10710
- /** Add references to the given document keys for the given ID. */ dr(e, t) {
10710
+ /** Add references to the given document keys for the given ID. */ Er(e, t) {
10711
10711
  e.forEach((e => this.addReference(e, t)));
10712
10712
  }
10713
10713
  /**
@@ -10754,7 +10754,7 @@ class __PRIVATE_DocReference {
10754
10754
  /** Compare by key then by ID */ static Ir(e, t) {
10755
10755
  return DocumentKey.comparator(e.key, t.key) || __PRIVATE_primitiveComparator(e.pr, t.pr);
10756
10756
  }
10757
- /** Compare by ID then by key */ static Er(e, t) {
10757
+ /** Compare by ID then by key */ static dr(e, t) {
10758
10758
  return __PRIVATE_primitiveComparator(e.pr, t.pr) || DocumentKey.comparator(e.key, t.key);
10759
10759
  }
10760
10760
  }
@@ -11133,7 +11133,7 @@ class __PRIVATE_MemoryRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuf
11133
11133
  return PersistencePromise.resolve(n);
11134
11134
  }
11135
11135
  addMatchingKeys(e, t, n) {
11136
- return this.Nr.dr(t, n), PersistencePromise.resolve();
11136
+ return this.Nr.Er(t, n), PersistencePromise.resolve();
11137
11137
  }
11138
11138
  removeMatchingKeys(e, t, n) {
11139
11139
  this.Nr.Rr(t, n);
@@ -11671,7 +11671,7 @@ function __PRIVATE_createQueryCache(e) {
11671
11671
  }), e.createObjectStore("targetGlobal");
11672
11672
  }
11673
11673
 
11674
- const de = "Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.";
11674
+ const Ee = "Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.";
11675
11675
 
11676
11676
  /**
11677
11677
  * Oldest acceptable age in milliseconds for client metadata before the client
@@ -11749,10 +11749,10 @@ class __PRIVATE_IndexedDbPersistence {
11749
11749
  /** A listener to notify on primary state changes. */
11750
11750
  this.Ii = e => Promise.resolve(), !__PRIVATE_IndexedDbPersistence.D()) throw new FirestoreError(D.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
11751
11751
  this.referenceDelegate = new __PRIVATE_IndexedDbLruDelegateImpl(this, r), this.Ti = t + "main",
11752
- this.serializer = new __PRIVATE_LocalSerializer(_), this.Ei = new __PRIVATE_SimpleDb(this.Ti, this.ui, new __PRIVATE_SchemaConverter(this.serializer)),
11752
+ this.serializer = new __PRIVATE_LocalSerializer(_), this.di = new __PRIVATE_SimpleDb(this.Ti, this.ui, new __PRIVATE_SchemaConverter(this.serializer)),
11753
11753
  this.Qr = new __PRIVATE_IndexedDbTargetCache(this.referenceDelegate, this.serializer),
11754
11754
  this.remoteDocumentCache = __PRIVATE_newIndexedDbRemoteDocumentCache(this.serializer),
11755
- this.$r = new __PRIVATE_IndexedDbBundleCache, this.window && this.window.localStorage ? this.di = this.window.localStorage : (this.di = null,
11755
+ this.$r = new __PRIVATE_IndexedDbBundleCache, this.window && this.window.localStorage ? this.Ei = this.window.localStorage : (this.Ei = null,
11756
11756
  !1 === u && __PRIVATE_logError("IndexedDbPersistence", "LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."));
11757
11757
  }
11758
11758
  /**
@@ -11767,13 +11767,13 @@ class __PRIVATE_IndexedDbPersistence {
11767
11767
  if (!this.isPrimary && !this.allowTabSynchronization)
11768
11768
  // Fail `start()` if `synchronizeTabs` is disabled and we cannot
11769
11769
  // obtain the primary lease.
11770
- throw new FirestoreError(D.FAILED_PRECONDITION, de);
11770
+ throw new FirestoreError(D.FAILED_PRECONDITION, Ee);
11771
11771
  return this.Ri(), this.Vi(), this.mi(), this.runTransaction("getHighestListenSequenceNumber", "readonly", (e => this.Qr.getHighestSequenceNumber(e)));
11772
11772
  })).then((e => {
11773
11773
  this.kr = new __PRIVATE_ListenSequence(e, this._i);
11774
11774
  })).then((() => {
11775
11775
  this.qr = !0;
11776
- })).catch((e => (this.Ei && this.Ei.close(), Promise.reject(e))));
11776
+ })).catch((e => (this.di && this.di.close(), Promise.reject(e))));
11777
11777
  }
11778
11778
  /**
11779
11779
  * Registers a listener that gets called when the primary state of the
@@ -11792,7 +11792,7 @@ class __PRIVATE_IndexedDbPersistence {
11792
11792
  *
11793
11793
  * PORTING NOTE: This is only used for Web multi-tab.
11794
11794
  */ setDatabaseDeletedListener(e) {
11795
- this.Ei.L((async t => {
11795
+ this.di.L((async t => {
11796
11796
  // Check if an attempt is made to delete IndexedDB.
11797
11797
  null === t.newVersion && await e();
11798
11798
  }));
@@ -11864,7 +11864,7 @@ class __PRIVATE_IndexedDbPersistence {
11864
11864
  // Ideally we'd delete the IndexedDb and LocalStorage zombie entries for
11865
11865
  // the client atomically, but we can't. So we opt to delete the IndexedDb
11866
11866
  // entries first to avoid potentially reviving a zombied client.
11867
- if (this.di) for (const t of e) this.di.removeItem(this.Fi(t.clientId));
11867
+ if (this.Ei) for (const t of e) this.Ei.removeItem(this.Fi(t.clientId));
11868
11868
  }
11869
11869
  }
11870
11870
  /**
@@ -11909,7 +11909,7 @@ class __PRIVATE_IndexedDbPersistence {
11909
11909
  // settings is not supported.
11910
11910
  // TODO(b/114226234): Remove this check when `synchronizeTabs` can
11911
11911
  // no longer be turned off.
11912
- throw new FirestoreError(D.FAILED_PRECONDITION, de);
11912
+ throw new FirestoreError(D.FAILED_PRECONDITION, Ee);
11913
11913
  return !1;
11914
11914
  }
11915
11915
  }
@@ -11930,10 +11930,10 @@ class __PRIVATE_IndexedDbPersistence {
11930
11930
  this.Ni(),
11931
11931
  // Use `SimpleDb.runTransaction` directly to avoid failing if another tab
11932
11932
  // has obtained the primary lease.
11933
- await this.Ei.runTransaction("shutdown", "readwrite", [ "owner", "clientMetadata" ], (e => {
11933
+ await this.di.runTransaction("shutdown", "readwrite", [ "owner", "clientMetadata" ], (e => {
11934
11934
  const t = new __PRIVATE_IndexedDbTransaction(e, __PRIVATE_ListenSequence._e);
11935
11935
  return this.yi(t).next((() => this.bi(t)));
11936
- })), this.Ei.close(),
11936
+ })), this.di.close(),
11937
11937
  // Remove the entry marking the client as zombied from LocalStorage since
11938
11938
  // we successfully deleted its metadata from IndexedDb.
11939
11939
  this.Bi();
@@ -11984,7 +11984,7 @@ class __PRIVATE_IndexedDbPersistence {
11984
11984
  let s;
11985
11985
  // Do all transactions as readwrite against all object stores, since we
11986
11986
  // are the only reader/writer.
11987
- return this.Ei.runTransaction(e, r, i, (r => (s = new __PRIVATE_IndexedDbTransaction(r, this.kr ? this.kr.next() : __PRIVATE_ListenSequence._e),
11987
+ return this.di.runTransaction(e, r, i, (r => (s = new __PRIVATE_IndexedDbTransaction(r, this.kr ? this.kr.next() : __PRIVATE_ListenSequence._e),
11988
11988
  "readwrite-primary" === t ? this.gi(s).next((e => !!e || this.pi(s))).next((t => {
11989
11989
  if (!t) throw __PRIVATE_logError(`Failed to obtain primary lease for action '${e}'.`),
11990
11990
  this.isPrimary = !1, this.oi.enqueueRetryable((() => this.Ii(!1))), new FirestoreError(D.FAILED_PRECONDITION, v);
@@ -12000,7 +12000,7 @@ class __PRIVATE_IndexedDbPersistence {
12000
12000
  // be turned off.
12001
12001
  ki(e) {
12002
12002
  return __PRIVATE_primaryClientStore(e).get("owner").next((e => {
12003
- if (null !== e && this.Ci(e.leaseTimestampMs, 5e3) && !this.Mi(e.ownerId) && !this.Si(e) && !(this.ai || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(D.FAILED_PRECONDITION, de);
12003
+ if (null !== e && this.Ci(e.leaseTimestampMs, 5e3) && !this.Mi(e.ownerId) && !this.Si(e) && !(this.ai || this.allowTabSynchronization && e.allowTabSynchronization)) throw new FirestoreError(D.FAILED_PRECONDITION, Ee);
12004
12004
  }));
12005
12005
  }
12006
12006
  /**
@@ -12071,7 +12071,7 @@ class __PRIVATE_IndexedDbPersistence {
12071
12071
  */ Mi(e) {
12072
12072
  var t;
12073
12073
  try {
12074
- const n = null !== (null === (t = this.di) || void 0 === t ? void 0 : t.getItem(this.Fi(e)));
12074
+ const n = null !== (null === (t = this.Ei) || void 0 === t ? void 0 : t.getItem(this.Fi(e)));
12075
12075
  return __PRIVATE_logDebug("IndexedDbPersistence", `Client '${e}' ${n ? "is" : "is not"} zombied in LocalStorage`),
12076
12076
  n;
12077
12077
  } catch (e) {
@@ -12084,16 +12084,16 @@ class __PRIVATE_IndexedDbPersistence {
12084
12084
  * Record client as zombied (a client that had its tab closed). Zombied
12085
12085
  * clients are ignored during primary tab selection.
12086
12086
  */ xi() {
12087
- if (this.di) try {
12088
- this.di.setItem(this.Fi(this.clientId), String(Date.now()));
12087
+ if (this.Ei) try {
12088
+ this.Ei.setItem(this.Fi(this.clientId), String(Date.now()));
12089
12089
  } catch (e) {
12090
12090
  // Gracefully handle if LocalStorage isn't available / working.
12091
12091
  __PRIVATE_logError("Failed to set zombie client id.", e);
12092
12092
  }
12093
12093
  }
12094
12094
  /** Removes the zombied client entry if it exists. */ Bi() {
12095
- if (this.di) try {
12096
- this.di.removeItem(this.Fi(this.clientId));
12095
+ if (this.Ei) try {
12096
+ this.Ei.removeItem(this.Fi(this.clientId));
12097
12097
  } catch (e) {
12098
12098
  // Ignore
12099
12099
  }
@@ -12912,14 +12912,14 @@ class __PRIVATE_MutationMetadata {
12912
12912
  /**
12913
12913
  * Parses a MutationMetadata from its JSON representation in WebStorage.
12914
12914
  * Logs a warning and returns null if the format of the data is not valid.
12915
- */ static Es(e, t, n) {
12915
+ */ static ds(e, t, n) {
12916
12916
  const r = JSON.parse(n);
12917
12917
  let i, s = "object" == typeof r && -1 !== [ "pending", "acknowledged", "rejected" ].indexOf(r.state) && (void 0 === r.error || "object" == typeof r.error);
12918
12918
  return s && r.error && (s = "string" == typeof r.error.message && "string" == typeof r.error.code,
12919
12919
  s && (i = new FirestoreError(r.error.code, r.error.message))), s ? new __PRIVATE_MutationMetadata(e, t, r.state, i) : (__PRIVATE_logError("SharedClientState", `Failed to parse mutation state for ID '${t}': ${n}`),
12920
12920
  null);
12921
12921
  }
12922
- ds() {
12922
+ Es() {
12923
12923
  const e = {
12924
12924
  state: this.state,
12925
12925
  updateTimeMs: Date.now()
@@ -12943,14 +12943,14 @@ class __PRIVATE_QueryTargetMetadata {
12943
12943
  /**
12944
12944
  * Parses a QueryTargetMetadata from its JSON representation in WebStorage.
12945
12945
  * Logs a warning and returns null if the format of the data is not valid.
12946
- */ static Es(e, t) {
12946
+ */ static ds(e, t) {
12947
12947
  const n = JSON.parse(t);
12948
12948
  let r, i = "object" == typeof n && -1 !== [ "not-current", "current", "rejected" ].indexOf(n.state) && (void 0 === n.error || "object" == typeof n.error);
12949
12949
  return i && n.error && (i = "string" == typeof n.error.message && "string" == typeof n.error.code,
12950
12950
  i && (r = new FirestoreError(n.error.code, n.error.message))), i ? new __PRIVATE_QueryTargetMetadata(e, n.state, r) : (__PRIVATE_logError("SharedClientState", `Failed to parse target state for ID '${e}': ${t}`),
12951
12951
  null);
12952
12952
  }
12953
- ds() {
12953
+ Es() {
12954
12954
  const e = {
12955
12955
  state: this.state,
12956
12956
  updateTimeMs: Date.now()
@@ -12972,7 +12972,7 @@ class __PRIVATE_QueryTargetMetadata {
12972
12972
  /**
12973
12973
  * Parses a RemoteClientState from the JSON representation in WebStorage.
12974
12974
  * Logs a warning and returns null if the format of the data is not valid.
12975
- */ static Es(e, t) {
12975
+ */ static ds(e, t) {
12976
12976
  const n = JSON.parse(t);
12977
12977
  let r = "object" == typeof n && n.activeTargetIds instanceof Array, i = __PRIVATE_targetIdSet();
12978
12978
  for (let e = 0; r && e < n.activeTargetIds.length; ++e) r = isSafeInteger(n.activeTargetIds[e]),
@@ -12993,7 +12993,7 @@ class __PRIVATE_QueryTargetMetadata {
12993
12993
  /**
12994
12994
  * Parses a SharedOnlineState from its JSON representation in WebStorage.
12995
12995
  * Logs a warning and returns null if the format of the data is not valid.
12996
- */ static Es(e) {
12996
+ */ static ds(e) {
12997
12997
  const t = JSON.parse(e);
12998
12998
  return "object" == typeof t && -1 !== [ "Unknown", "Online", "Offline" ].indexOf(t.onlineState) && "string" == typeof t.clientId ? new __PRIVATE_SharedOnlineState(t.clientId, t.onlineState) : (__PRIVATE_logError("SharedClientState", `Failed to parse online state: ${e}`),
12999
12999
  null);
@@ -13024,7 +13024,7 @@ class __PRIVATE_LocalClientState {
13024
13024
  /**
13025
13025
  * Converts this entry into a JSON-encoded format we can use for WebStorage.
13026
13026
  * Does not encode `clientId` as it is part of the key in WebStorage.
13027
- */ ds() {
13027
+ */ Es() {
13028
13028
  const e = {
13029
13029
  activeTargetIds: this.activeTargetIds.toArray(),
13030
13030
  updateTimeMs: Date.now()
@@ -13108,7 +13108,7 @@ class __PRIVATE_LocalClientState {
13108
13108
  if (t === this.Vs) continue;
13109
13109
  const e = this.getItem(createWebStorageClientStateKey(this.persistenceKey, t));
13110
13110
  if (e) {
13111
- const n = __PRIVATE_RemoteClientState.Es(t, e);
13111
+ const n = __PRIVATE_RemoteClientState.ds(t, e);
13112
13112
  n && (this.ps = this.ps.insert(n.clientId, n));
13113
13113
  }
13114
13114
  }
@@ -13155,7 +13155,7 @@ class __PRIVATE_LocalClientState {
13155
13155
  if (this.isActiveQueryTarget(e)) {
13156
13156
  const n = this.storage.getItem(createWebStorageQueryTargetMetadataKey(this.persistenceKey, e));
13157
13157
  if (n) {
13158
- const r = __PRIVATE_QueryTargetMetadata.Es(e, n);
13158
+ const r = __PRIVATE_QueryTargetMetadata.ds(e, n);
13159
13159
  r && (t = r.state);
13160
13160
  }
13161
13161
  }
@@ -13261,11 +13261,11 @@ class __PRIVATE_LocalClientState {
13261
13261
  return this.ps.get(this.Vs);
13262
13262
  }
13263
13263
  Ms() {
13264
- this.setItem(this.ws, this.ks.ds());
13264
+ this.setItem(this.ws, this.ks.Es());
13265
13265
  }
13266
13266
  Bs(e, t, n) {
13267
13267
  const r = new __PRIVATE_MutationMetadata(this.currentUser, e, t, n), i = createWebStorageMutationBatchKey(this.persistenceKey, this.currentUser, e);
13268
- this.setItem(i, r.ds());
13268
+ this.setItem(i, r.Es());
13269
13269
  }
13270
13270
  Ls(e) {
13271
13271
  const t = createWebStorageMutationBatchKey(this.persistenceKey, this.currentUser, e);
@@ -13280,7 +13280,7 @@ class __PRIVATE_LocalClientState {
13280
13280
  }
13281
13281
  qs(e, t, n) {
13282
13282
  const r = createWebStorageQueryTargetMetadataKey(this.persistenceKey, e), i = new __PRIVATE_QueryTargetMetadata(e, t, n);
13283
- this.setItem(r, i.ds());
13283
+ this.setItem(r, i.Es());
13284
13284
  }
13285
13285
  Ks(e) {
13286
13286
  const t = JSON.stringify(Array.from(e));
@@ -13298,27 +13298,27 @@ class __PRIVATE_LocalClientState {
13298
13298
  * be parsed.
13299
13299
  */ Ws(e, t) {
13300
13300
  const n = this.$s(e);
13301
- return __PRIVATE_RemoteClientState.Es(n, t);
13301
+ return __PRIVATE_RemoteClientState.ds(n, t);
13302
13302
  }
13303
13303
  /**
13304
13304
  * Parses a mutation batch state in WebStorage. Returns 'null' if the value
13305
13305
  * could not be parsed.
13306
13306
  */ Gs(e, t) {
13307
13307
  const n = this.Ds.exec(e), r = Number(n[1]), i = void 0 !== n[2] ? n[2] : null;
13308
- return __PRIVATE_MutationMetadata.Es(new User(i), r, t);
13308
+ return __PRIVATE_MutationMetadata.ds(new User(i), r, t);
13309
13309
  }
13310
13310
  /**
13311
13311
  * Parses a query target state from WebStorage. Returns 'null' if the value
13312
13312
  * could not be parsed.
13313
13313
  */ js(e, t) {
13314
13314
  const n = this.Cs.exec(e), r = Number(n[1]);
13315
- return __PRIVATE_QueryTargetMetadata.Es(r, t);
13315
+ return __PRIVATE_QueryTargetMetadata.ds(r, t);
13316
13316
  }
13317
13317
  /**
13318
13318
  * Parses an online state from WebStorage. Returns 'null' if the value
13319
13319
  * could not be parsed.
13320
13320
  */ xs(e) {
13321
- return __PRIVATE_SharedOnlineState.Es(e);
13321
+ return __PRIVATE_SharedOnlineState.ds(e);
13322
13322
  }
13323
13323
  Js(e) {
13324
13324
  return JSON.parse(e);
@@ -14376,13 +14376,13 @@ class __PRIVATE_PersistentStream {
14376
14376
  }
14377
14377
  // The first response is always the handshake response
14378
14378
  return __PRIVATE_hardAssert(!e.writeResults || 0 === e.writeResults.length), this.h_ = !0,
14379
- this.listener.E_();
14379
+ this.listener.d_();
14380
14380
  }
14381
14381
  /**
14382
14382
  * Sends an initial streamToken to the server, performing the handshake
14383
14383
  * required to make the StreamingWrite RPC work. Subsequent
14384
14384
  * calls should wait until onHandshakeComplete was called.
14385
- */ d_() {
14385
+ */ E_() {
14386
14386
  // TODO(dimond): Support stream resumption. We intentionally do not set the
14387
14387
  // stream token on the handshake, ignoring any stream token we might have.
14388
14388
  const e = {};
@@ -14905,7 +14905,7 @@ function __PRIVATE_startWriteStream(e) {
14905
14905
  }
14906
14906
 
14907
14907
  async function __PRIVATE_onWriteStreamOpen(e) {
14908
- __PRIVATE_ensureWriteStream(e).d_();
14908
+ __PRIVATE_ensureWriteStream(e).E_();
14909
14909
  }
14910
14910
 
14911
14911
  async function __PRIVATE_onWriteHandshakeComplete(e) {
@@ -15027,7 +15027,7 @@ async function __PRIVATE_remoteStoreHandleCredentialChange(e, t) {
15027
15027
  }(e.datastore, e.asyncQueue, {
15028
15028
  Po: __PRIVATE_onWriteStreamOpen.bind(null, e),
15029
15029
  To: __PRIVATE_onWriteStreamClose.bind(null, e),
15030
- E_: __PRIVATE_onWriteHandshakeComplete.bind(null, e),
15030
+ d_: __PRIVATE_onWriteHandshakeComplete.bind(null, e),
15031
15031
  T_: __PRIVATE_onMutationResult.bind(null, e)
15032
15032
  }), e.F_.push((async t => {
15033
15033
  t ? (e.B_.Zo(),
@@ -15801,19 +15801,19 @@ class __PRIVATE_RemovedLimboDocument {
15801
15801
  * See the License for the specific language governing permissions and
15802
15802
  * limitations under the License.
15803
15803
  */ (e.type, t.type) || this.ua(e.doc, t.doc))), this.Ta(n), r = null != r && r;
15804
- const o = t && !r ? this.Ea() : [], _ = 0 === this.aa.size && this.current && !r ? 1 /* SyncState.Synced */ : 0 /* SyncState.Local */ , a = _ !== this._a;
15804
+ const o = t && !r ? this.da() : [], _ = 0 === this.aa.size && this.current && !r ? 1 /* SyncState.Synced */ : 0 /* SyncState.Local */ , a = _ !== this._a;
15805
15805
  // We are at synced state if there is no limbo docs are waiting to be resolved, view is current
15806
15806
  // with the backend, and the query is not pending to reset due to existence filter mismatch.
15807
15807
  if (this._a = _, 0 !== s.length || a) {
15808
15808
  return {
15809
15809
  snapshot: new ViewSnapshot(this.query, e.ca, i, s, e.mutatedKeys, 0 /* SyncState.Local */ === _, a,
15810
15810
  /* excludesMetadataChanges= */ !1, !!n && n.resumeToken.approximateByteSize() > 0),
15811
- da: o
15811
+ Ea: o
15812
15812
  };
15813
15813
  }
15814
15814
  // no changes
15815
15815
  return {
15816
- da: o
15816
+ Ea: o
15817
15817
  };
15818
15818
  }
15819
15819
  /**
@@ -15832,7 +15832,7 @@ class __PRIVATE_RemovedLimboDocument {
15832
15832
  Xi: !1
15833
15833
  },
15834
15834
  /* limboResolutionEnabled= */ !1)) : {
15835
- da: []
15835
+ Ea: []
15836
15836
  };
15837
15837
  }
15838
15838
  /**
@@ -15850,7 +15850,7 @@ class __PRIVATE_RemovedLimboDocument {
15850
15850
  e && (e.addedDocuments.forEach((e => this.oa = this.oa.add(e))), e.modifiedDocuments.forEach((e => {})),
15851
15851
  e.removedDocuments.forEach((e => this.oa = this.oa.delete(e))), this.current = e.current);
15852
15852
  }
15853
- Ea() {
15853
+ da() {
15854
15854
  // We can only determine limbo documents when we're in-sync with the server.
15855
15855
  if (!this.current) return [];
15856
15856
  // TODO(klimt): Do this incrementally so that it's not quadratic when
@@ -16036,12 +16036,12 @@ async function __PRIVATE_syncEngineListen(e, t) {
16036
16036
  /* usePreviousResults= */ !1).then((({documents: e}) => t.view.ha(e, i))));
16037
16037
  const s = r && r.targetChanges.get(t.targetId), o = r && null != r.targetMismatches.get(t.targetId), _ = t.view.applyChanges(i,
16038
16038
  /* limboResolutionEnabled= */ e.isPrimaryClient, s, o);
16039
- return __PRIVATE_updateTrackedLimbos(e, t.targetId, _.da), _.snapshot;
16039
+ return __PRIVATE_updateTrackedLimbos(e, t.targetId, _.Ea), _.snapshot;
16040
16040
  }(e, t, n, r);
16041
16041
  const s = await __PRIVATE_localStoreExecuteQuery(e.localStore, t,
16042
16042
  /* usePreviousResults= */ !0), o = new __PRIVATE_View(t, s.hs), _ = o.ha(s.documents), a = TargetChange.createSynthesizedTargetChangeForCurrentChange(n, r && "Offline" /* OnlineState.Offline */ !== e.onlineState, i), u = o.applyChanges(_,
16043
16043
  /* limboResolutionEnabled= */ e.isPrimaryClient, a);
16044
- __PRIVATE_updateTrackedLimbos(e, n, u.da);
16044
+ __PRIVATE_updateTrackedLimbos(e, n, u.Ea);
16045
16045
  const c = new __PRIVATE_QueryView(t, n, o);
16046
16046
  return e.ga.set(t, c), e.pa.has(n) ? e.pa.get(n).push(t) : e.pa.set(n, [ t ]), u.snapshot;
16047
16047
  }
@@ -16443,7 +16443,7 @@ function __PRIVATE_syncEngineGetRemoteKeysForTarget(e, t) {
16443
16443
  */ async function __PRIVATE_synchronizeViewAndComputeSnapshot(e, t) {
16444
16444
  const n = __PRIVATE_debugCast(e), r = await __PRIVATE_localStoreExecuteQuery(n.localStore, t.query,
16445
16445
  /* usePreviousResults= */ !0), i = t.view.Ra(r);
16446
- return n.isPrimaryClient && __PRIVATE_updateTrackedLimbos(n, t.targetId, i.da),
16446
+ return n.isPrimaryClient && __PRIVATE_updateTrackedLimbos(n, t.targetId, i.Ea),
16447
16447
  i;
16448
16448
  }
16449
16449
 
@@ -19301,13 +19301,13 @@ function __PRIVATE_isWrite(e) {
19301
19301
  this.settings = e, this.databaseId = t, this.serializer = n, this.ignoreUndefinedProperties = r,
19302
19302
  // Minor hack: If fieldTransforms is undefined, we assume this is an
19303
19303
  // external call and we need to validate the entire path.
19304
- void 0 === i && this.Eu(), this.fieldTransforms = i || [], this.fieldMask = s || [];
19304
+ void 0 === i && this.du(), this.fieldTransforms = i || [], this.fieldMask = s || [];
19305
19305
  }
19306
19306
  get path() {
19307
19307
  return this.settings.path;
19308
19308
  }
19309
- get du() {
19310
- return this.settings.du;
19309
+ get Eu() {
19310
+ return this.settings.Eu;
19311
19311
  }
19312
19312
  /** Returns a new context with the specified settings overwritten. */ Au(e) {
19313
19313
  return new __PRIVATE_ParseContextImpl(Object.assign(Object.assign({}, this.settings), e), this.databaseId, this.serializer, this.ignoreUndefinedProperties, this.fieldTransforms, this.fieldMask);
@@ -19326,7 +19326,7 @@ function __PRIVATE_isWrite(e) {
19326
19326
  path: n,
19327
19327
  Vu: !1
19328
19328
  });
19329
- return r.Eu(), r;
19329
+ return r.du(), r;
19330
19330
  }
19331
19331
  gu(e) {
19332
19332
  // TODO(b/34871131): We don't support array paths right now; so make path
@@ -19342,14 +19342,14 @@ function __PRIVATE_isWrite(e) {
19342
19342
  /** Returns 'true' if 'fieldPath' was traversed when creating this context. */ contains(e) {
19343
19343
  return void 0 !== this.fieldMask.find((t => e.isPrefixOf(t))) || void 0 !== this.fieldTransforms.find((t => e.isPrefixOf(t.field)));
19344
19344
  }
19345
- Eu() {
19345
+ du() {
19346
19346
  // TODO(b/34871131): Remove null check once we have proper paths for fields
19347
19347
  // within arrays.
19348
19348
  if (this.path) for (let e = 0; e < this.path.length; e++) this.mu(this.path.get(e));
19349
19349
  }
19350
19350
  mu(e) {
19351
19351
  if (0 === e.length) throw this.pu("Document fields must not be empty");
19352
- if (__PRIVATE_isWrite(this.du) && ge.test(e)) throw this.pu('Document fields cannot begin and end with "__"');
19352
+ if (__PRIVATE_isWrite(this.Eu) && ge.test(e)) throw this.pu('Document fields cannot begin and end with "__"');
19353
19353
  }
19354
19354
  }
19355
19355
 
@@ -19362,7 +19362,7 @@ function __PRIVATE_isWrite(e) {
19362
19362
  }
19363
19363
  /** Creates a new top-level parse context. */ Su(e, t, n, r = !1) {
19364
19364
  return new __PRIVATE_ParseContextImpl({
19365
- du: e,
19365
+ Eu: e,
19366
19366
  methodName: t,
19367
19367
  wu: n,
19368
19368
  path: FieldPath$1.emptyPath(),
@@ -19396,7 +19396,7 @@ function __PRIVATE_newUserDataReader(e) {
19396
19396
 
19397
19397
  class __PRIVATE_DeleteFieldValueImpl extends FieldValue {
19398
19398
  _toFieldTransform(e) {
19399
- if (2 /* UserDataSource.MergeSet */ !== e.du) throw 1 /* UserDataSource.Update */ === e.du ? e.pu(`${this._methodName}() can only appear at the top level of your update data`) : e.pu(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);
19399
+ if (2 /* UserDataSource.MergeSet */ !== e.Eu) throw 1 /* UserDataSource.Update */ === e.Eu ? e.pu(`${this._methodName}() can only appear at the top level of your update data`) : e.pu(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);
19400
19400
  // No transform to add for a delete, but we need to add it to our
19401
19401
  // fieldMask so it gets deleted.
19402
19402
  return e.fieldMask.push(e.path), null;
@@ -19423,7 +19423,7 @@ class __PRIVATE_DeleteFieldValueImpl extends FieldValue {
19423
19423
  * @param arrayElement - Whether or not the FieldValue has an array.
19424
19424
  */ function __PRIVATE_createSentinelChildContext(e, t, n) {
19425
19425
  return new __PRIVATE_ParseContextImpl({
19426
- du: 3 /* UserDataSource.Argument */ ,
19426
+ Eu: 3 /* UserDataSource.Argument */ ,
19427
19427
  wu: t.settings.wu,
19428
19428
  methodName: e._methodName,
19429
19429
  Vu: n
@@ -19563,7 +19563,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
19563
19563
  */
19564
19564
  return function __PRIVATE_parseSentinelFieldValue(e, t) {
19565
19565
  // Sentinels are only supported with writes, and not within arrays.
19566
- if (!__PRIVATE_isWrite(t.du)) throw t.pu(`${e._methodName}() can only be used with update() and set()`);
19566
+ if (!__PRIVATE_isWrite(t.Eu)) throw t.pu(`${e._methodName}() can only be used with update() and set()`);
19567
19567
  if (!t.path) throw t.pu(`${e._methodName}() is not currently supported inside arrays`);
19568
19568
  const n = e._toFieldTransform(t);
19569
19569
  n && t.fieldTransforms.push(n);
@@ -19588,7 +19588,7 @@ class __PRIVATE_NumericIncrementFieldValueImpl extends FieldValue {
19588
19588
  // the set of values to be included for the IN query) that may directly
19589
19589
  // contain additional arrays (each representing an individual field
19590
19590
  // value), so we disable this validation.
19591
- if (t.settings.Vu && 4 /* UserDataSource.ArrayArgument */ !== t.du) throw t.pu("Nested arrays are not supported");
19591
+ if (t.settings.Vu && 4 /* UserDataSource.ArrayArgument */ !== t.Eu) throw t.pu("Nested arrays are not supported");
19592
19592
  return function __PRIVATE_parseArray(e, t) {
19593
19593
  const n = [];
19594
19594
  let r = 0;
@@ -21827,9 +21827,9 @@ let Se = null;
21827
21827
  return r = Object.assign({
21828
21828
  useFetchStreams: t
21829
21829
  }, r), s._setSettings(r), s;
21830
- }), "PUBLIC").setMultipleInstances(!0)), registerVersion(w, "4.4.2", e),
21830
+ }), "PUBLIC").setMultipleInstances(!0)), registerVersion(w, "4.4.3-canary.245dd26e1", e),
21831
21831
  // BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
21832
- registerVersion(w, "4.4.2", "esm2017");
21832
+ registerVersion(w, "4.4.3-canary.245dd26e1", "esm2017");
21833
21833
  }();
21834
21834
 
21835
21835
  export { AbstractUserDataWriter, AggregateField, AggregateQuerySnapshot, Bytes, fe as CACHE_SIZE_UNLIMITED, CollectionReference, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Firestore, FirestoreError, GeoPoint, LoadBundleTask, PersistentCacheIndexManager, Query, QueryCompositeFilterConstraint, QueryConstraint, QueryDocumentSnapshot, QueryEndAtConstraint, QueryFieldFilterConstraint, QueryLimitConstraint, QueryOrderByConstraint, QuerySnapshot, QueryStartAtConstraint, SnapshotMetadata, Timestamp, Transaction, WriteBatch, __PRIVATE_AutoId as _AutoId, ByteString as _ByteString, DatabaseId as _DatabaseId, DocumentKey as _DocumentKey, __PRIVATE_EmptyAppCheckTokenProvider as _EmptyAppCheckTokenProvider, __PRIVATE_EmptyAuthCredentialsProvider as _EmptyAuthCredentialsProvider, FieldPath$1 as _FieldPath, TestingHooks as _TestingHooks, __PRIVATE_cast as _cast, __PRIVATE_debugAssert as _debugAssert, __PRIVATE_isBase64Available as _isBase64Available, __PRIVATE_logWarn as _logWarn, __PRIVATE_validateIsNotUsedTogether as _validateIsNotUsedTogether, addDoc, aggregateFieldEqual, aggregateQuerySnapshotEqual, and, arrayRemove, arrayUnion, average, clearIndexedDbPersistence, collection, collectionGroup, connectFirestoreEmulator, count, deleteAllPersistentCacheIndexes, deleteDoc, deleteField, disableNetwork, disablePersistentCacheIndexAutoCreation, doc, documentId, enableIndexedDbPersistence, enableMultiTabIndexedDbPersistence, enableNetwork, enablePersistentCacheIndexAutoCreation, endAt, endBefore, ensureFirestoreConfigured, executeWrite, getAggregateFromServer, getCountFromServer, getDoc, getDocFromCache, getDocFromServer, getDocs, getDocsFromCache, getDocsFromServer, getFirestore, getPersistentCacheIndexManager, increment, initializeFirestore, limit, limitToLast, loadBundle, memoryEagerGarbageCollector, memoryLocalCache, memoryLruGarbageCollector, namedQuery, onSnapshot, onSnapshotsInSync, or, orderBy, persistentLocalCache, persistentMultipleTabManager, persistentSingleTabManager, query, queryEqual, refEqual, runTransaction, serverTimestamp, setDoc, setIndexConfiguration, setLogLevel, snapshotEqual, startAfter, startAt, sum, terminate, updateDoc, waitForPendingWrites, where, writeBatch };