@firebase/firestore 3.4.8-canary.5ce067663 → 3.4.8-canary.63caee2a5
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/firestore/lite/index.d.ts +1 -0
- package/dist/firestore/src/api/transaction.d.ts +2 -1
- package/dist/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/firestore/src/api.d.ts +1 -0
- package/dist/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/firestore/src/lite-api/transaction.d.ts +2 -1
- package/dist/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/index.d.ts +24 -1
- package/dist/index.esm2017.js +224 -200
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +158 -135
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +36 -9
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +36 -9
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +95 -71
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +25 -1
- package/dist/lite/firestore/lite/index.d.ts +1 -0
- package/dist/lite/firestore/src/api/transaction.d.ts +2 -1
- package/dist/lite/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/lite/firestore/src/api.d.ts +1 -0
- package/dist/lite/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/lite/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/lite/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/lite/firestore/src/lite-api/transaction.d.ts +2 -1
- package/dist/lite/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/lite/index.browser.esm2017.js +246 -223
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +118 -116
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.d.ts +24 -1
- package/dist/lite/index.node.cjs.js +34 -7
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +34 -7
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +127 -104
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +25 -1
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +28 -28
- package/dist/lite/packages/firestore/lite/index.d.ts +1 -0
- package/dist/lite/packages/firestore/src/api/transaction.d.ts +2 -1
- package/dist/lite/packages/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/lite/packages/firestore/src/api.d.ts +1 -0
- package/dist/lite/packages/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/lite/packages/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/lite/packages/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/lite/packages/firestore/src/lite-api/transaction.d.ts +2 -1
- package/dist/lite/packages/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/lite/private.d.ts +25 -1
- package/dist/packages/firestore/dist/index.esm2017.d.ts +37 -36
- package/dist/packages/firestore/lite/index.d.ts +1 -0
- package/dist/packages/firestore/src/api/transaction.d.ts +2 -1
- package/dist/packages/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/packages/firestore/src/api.d.ts +1 -0
- package/dist/packages/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/packages/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/packages/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/packages/firestore/src/lite-api/transaction.d.ts +2 -1
- package/dist/packages/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/private.d.ts +25 -1
- package/package.json +10 -10
package/dist/index.esm2017.js
CHANGED
|
@@ -66,7 +66,7 @@ C.MOCK_USER = new C("mock-user");
|
|
|
66
66
|
* See the License for the specific language governing permissions and
|
|
67
67
|
* limitations under the License.
|
|
68
68
|
*/
|
|
69
|
-
let x = "9.7.0-canary.
|
|
69
|
+
let x = "9.7.0-canary.63caee2a5";
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* @license
|
|
@@ -1421,14 +1421,14 @@ const It = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1421
1421
|
* Preserving the previous values allows the user to display the last resoled
|
|
1422
1422
|
* value until the backend responds with the timestamp.
|
|
1423
1423
|
*/
|
|
1424
|
-
function
|
|
1424
|
+
function bt(t) {
|
|
1425
1425
|
const e = t.mapValue.fields.__previous_value__;
|
|
1426
|
-
return Rt(e) ?
|
|
1426
|
+
return Rt(e) ? bt(e) : e;
|
|
1427
1427
|
}
|
|
1428
1428
|
|
|
1429
1429
|
/**
|
|
1430
1430
|
* Returns the local time at which this timestamp was first set.
|
|
1431
|
-
*/ function
|
|
1431
|
+
*/ function Pt(t) {
|
|
1432
1432
|
const e = Tt(t.mapValue.fields.__local_write_time__.timestampValue);
|
|
1433
1433
|
return new at(e.seconds, e.nanos);
|
|
1434
1434
|
}
|
|
@@ -1639,7 +1639,7 @@ function Mt(t) {
|
|
|
1639
1639
|
return t.booleanValue === e.booleanValue;
|
|
1640
1640
|
|
|
1641
1641
|
case 4 /* ServerTimestampValue */ :
|
|
1642
|
-
return
|
|
1642
|
+
return Pt(t).isEqual(Pt(e));
|
|
1643
1643
|
|
|
1644
1644
|
case 3 /* TimestampValue */ :
|
|
1645
1645
|
return function(t, e) {
|
|
@@ -1721,7 +1721,7 @@ function $t(t, e) {
|
|
|
1721
1721
|
return Bt(t.timestampValue, e.timestampValue);
|
|
1722
1722
|
|
|
1723
1723
|
case 4 /* ServerTimestampValue */ :
|
|
1724
|
-
return Bt(
|
|
1724
|
+
return Bt(Pt(t), Pt(e));
|
|
1725
1725
|
|
|
1726
1726
|
case 5 /* StringValue */ :
|
|
1727
1727
|
return rt(t.stringValue, e.stringValue);
|
|
@@ -2888,7 +2888,7 @@ function Ae(t) {
|
|
|
2888
2888
|
* Returns the value to use as the lower bound for ascending index segment at
|
|
2889
2889
|
* the provided `fieldPath` (or the upper bound for an descending segment).
|
|
2890
2890
|
*/
|
|
2891
|
-
function
|
|
2891
|
+
function be(t, e, n) {
|
|
2892
2892
|
let s = kt, i = !0;
|
|
2893
2893
|
// Process all filters to find a value for the current field segment
|
|
2894
2894
|
for (const n of Re(t, e)) {
|
|
@@ -2946,7 +2946,7 @@ function Pe(t, e, n) {
|
|
|
2946
2946
|
/**
|
|
2947
2947
|
* Returns the value to use as the upper bound for ascending index segment at
|
|
2948
2948
|
* the provided `fieldPath` (or the lower bound for a descending segment).
|
|
2949
|
-
*/ function
|
|
2949
|
+
*/ function Pe(t, e, n) {
|
|
2950
2950
|
let s = Nt, i = !0;
|
|
2951
2951
|
// Process all filters to find a value for the current field segment
|
|
2952
2952
|
for (const n of Re(t, e)) {
|
|
@@ -3740,7 +3740,7 @@ class En {
|
|
|
3740
3740
|
* applyToLocalView() to implement the actual behavior of applying the mutation
|
|
3741
3741
|
* to some source document (see `setMutationApplyToRemoteDocument()` for an
|
|
3742
3742
|
* example).
|
|
3743
|
-
*/ class
|
|
3743
|
+
*/ class bn {}
|
|
3744
3744
|
|
|
3745
3745
|
/**
|
|
3746
3746
|
* Applies this mutation to the given document for the purposes of computing a
|
|
@@ -3753,7 +3753,7 @@ class En {
|
|
|
3753
3753
|
* invalid document if the client has no knowledge of the pre-mutation state
|
|
3754
3754
|
* of the document.
|
|
3755
3755
|
* @param mutationResult - The result of applying the mutation from the backend.
|
|
3756
|
-
*/ function
|
|
3756
|
+
*/ function Pn(t, e, n) {
|
|
3757
3757
|
t instanceof Cn ? function(t, e, n) {
|
|
3758
3758
|
// Unlike setMutationApplyToLocalView, if we're applying a mutation to a
|
|
3759
3759
|
// remote document the server has accepted the mutation so the precondition
|
|
@@ -3873,14 +3873,14 @@ function Sn(t, e) {
|
|
|
3873
3873
|
/**
|
|
3874
3874
|
* A mutation that creates or replaces the document at the given key with the
|
|
3875
3875
|
* object value contents.
|
|
3876
|
-
*/ class Cn extends
|
|
3876
|
+
*/ class Cn extends bn {
|
|
3877
3877
|
constructor(t, e, n, s = []) {
|
|
3878
3878
|
super(), this.key = t, this.value = e, this.precondition = n, this.fieldTransforms = s,
|
|
3879
3879
|
this.type = 0 /* Set */;
|
|
3880
3880
|
}
|
|
3881
3881
|
}
|
|
3882
3882
|
|
|
3883
|
-
class xn extends
|
|
3883
|
+
class xn extends bn {
|
|
3884
3884
|
constructor(t, e, n, s, i = []) {
|
|
3885
3885
|
super(), this.key = t, this.data = e, this.fieldMask = n, this.precondition = s,
|
|
3886
3886
|
this.fieldTransforms = i, this.type = 1 /* Patch */;
|
|
@@ -3937,13 +3937,13 @@ function Nn(t) {
|
|
|
3937
3937
|
return s;
|
|
3938
3938
|
}
|
|
3939
3939
|
|
|
3940
|
-
/** A mutation that deletes the document at the given key. */ class On extends
|
|
3940
|
+
/** A mutation that deletes the document at the given key. */ class On extends bn {
|
|
3941
3941
|
constructor(t, e) {
|
|
3942
3942
|
super(), this.key = t, this.precondition = e, this.type = 2 /* Delete */ , this.fieldTransforms = [];
|
|
3943
3943
|
}
|
|
3944
3944
|
}
|
|
3945
3945
|
|
|
3946
|
-
class Fn extends
|
|
3946
|
+
class Fn extends bn {
|
|
3947
3947
|
constructor(t, e) {
|
|
3948
3948
|
super(), this.key = t, this.precondition = e, this.type = 3 /* Verify */ , this.fieldTransforms = [];
|
|
3949
3949
|
}
|
|
@@ -4896,7 +4896,7 @@ function As(t) {
|
|
|
4896
4896
|
};
|
|
4897
4897
|
}
|
|
4898
4898
|
|
|
4899
|
-
function
|
|
4899
|
+
function bs(t, e, n) {
|
|
4900
4900
|
const s = ps(t, e.name), i = ws(e.updateTime), r = new te({
|
|
4901
4901
|
mapValue: {
|
|
4902
4902
|
fields: e.fields
|
|
@@ -4905,7 +4905,7 @@ function Ps(t, e, n) {
|
|
|
4905
4905
|
return n && o.setHasCommittedMutations(), n ? o.setHasCommittedMutations() : o;
|
|
4906
4906
|
}
|
|
4907
4907
|
|
|
4908
|
-
function
|
|
4908
|
+
function Ps(t, e) {
|
|
4909
4909
|
return "found" in e ? function(t, e) {
|
|
4910
4910
|
U(!!e.found), e.found.name, e.found.updateTime;
|
|
4911
4911
|
const n = ps(t, e.found.name), s = ws(e.found.updateTime), i = new te({
|
|
@@ -5719,7 +5719,7 @@ class pi {
|
|
|
5719
5719
|
t && this.At.reject(t), this.aborted || (O("SimpleDb", "Aborting transaction:", t ? t.message : "Client-initiated abort"),
|
|
5720
5720
|
this.aborted = !0, this.transaction.abort());
|
|
5721
5721
|
}
|
|
5722
|
-
|
|
5722
|
+
bt() {
|
|
5723
5723
|
// If the browser supports V3 IndexedDB, we invoke commit() explicitly to
|
|
5724
5724
|
// speed up index DB processing if the event loop remains blocks.
|
|
5725
5725
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -5757,7 +5757,7 @@ class pi {
|
|
|
5757
5757
|
* objectstores.
|
|
5758
5758
|
*/
|
|
5759
5759
|
constructor(t, e, n) {
|
|
5760
|
-
this.name = t, this.version = e, this.
|
|
5760
|
+
this.name = t, this.version = e, this.Pt = n;
|
|
5761
5761
|
// NOTE: According to https://bugs.webkit.org/show_bug.cgi?id=197050, the
|
|
5762
5762
|
// bug we're checking for should exist in iOS >= 12.2 and < 13, but for
|
|
5763
5763
|
// whatever reason it's much harder to hit after 12.2 so we only proactively
|
|
@@ -5765,7 +5765,7 @@ class pi {
|
|
|
5765
5765
|
12.2 === Ii.Vt(getUA()) && F("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");
|
|
5766
5766
|
}
|
|
5767
5767
|
/** Deletes the specified database. */ static delete(t) {
|
|
5768
|
-
return O("SimpleDb", "Removing database:", t),
|
|
5768
|
+
return O("SimpleDb", "Removing database:", t), bi(window.indexedDB.deleteDatabase(t)).toPromise();
|
|
5769
5769
|
}
|
|
5770
5770
|
/** Returns true if IndexedDB is available in the current environment. */ static vt() {
|
|
5771
5771
|
if (!isIndexedDBAvailable()) return !1;
|
|
@@ -5831,7 +5831,7 @@ class pi {
|
|
|
5831
5831
|
}, s.onupgradeneeded = t => {
|
|
5832
5832
|
O("SimpleDb", 'Database "' + this.name + '" requires upgrade from version:', t.oldVersion);
|
|
5833
5833
|
const e = t.target.result;
|
|
5834
|
-
this.
|
|
5834
|
+
this.Pt.kt(e, s.transaction, t.oldVersion, this.version).next((() => {
|
|
5835
5835
|
O("SimpleDb", "Database upgrade to version " + this.version + " complete");
|
|
5836
5836
|
}));
|
|
5837
5837
|
};
|
|
@@ -5847,7 +5847,7 @@ class pi {
|
|
|
5847
5847
|
++r;
|
|
5848
5848
|
try {
|
|
5849
5849
|
this.db = await this.Nt(t);
|
|
5850
|
-
const e = pi.open(this.db, t, i ? "readonly" : "readwrite", n), r = s(e).next((t => (e.
|
|
5850
|
+
const e = pi.open(this.db, t, i ? "readonly" : "readwrite", n), r = s(e).next((t => (e.bt(),
|
|
5851
5851
|
t))).catch((t => (
|
|
5852
5852
|
// Abort the transaction if there was an error.
|
|
5853
5853
|
e.abort(t), yi.reject(t)))).toPromise();
|
|
@@ -5908,7 +5908,7 @@ class pi {
|
|
|
5908
5908
|
*
|
|
5909
5909
|
* NOTE: You CANNOT do this with a keysOnly query.
|
|
5910
5910
|
*/ delete() {
|
|
5911
|
-
return
|
|
5911
|
+
return bi(this.Ft.delete());
|
|
5912
5912
|
}
|
|
5913
5913
|
}
|
|
5914
5914
|
|
|
@@ -5940,7 +5940,7 @@ class pi {
|
|
|
5940
5940
|
put(t, e) {
|
|
5941
5941
|
let n;
|
|
5942
5942
|
return void 0 !== e ? (O("SimpleDb", "PUT", this.store.name, t, e), n = this.store.put(e, t)) : (O("SimpleDb", "PUT", this.store.name, "<auto-key>", t),
|
|
5943
|
-
n = this.store.put(t)),
|
|
5943
|
+
n = this.store.put(t)), bi(n);
|
|
5944
5944
|
}
|
|
5945
5945
|
/**
|
|
5946
5946
|
* Adds a new value into an Object Store and returns the new key. Similar to
|
|
@@ -5950,7 +5950,7 @@ class pi {
|
|
|
5950
5950
|
* @returns The key of the value to add.
|
|
5951
5951
|
*/ add(t) {
|
|
5952
5952
|
O("SimpleDb", "ADD", this.store.name, t, t);
|
|
5953
|
-
return
|
|
5953
|
+
return bi(this.store.add(t));
|
|
5954
5954
|
}
|
|
5955
5955
|
/**
|
|
5956
5956
|
* Gets the object with the specified key from the specified store, or null
|
|
@@ -5961,13 +5961,13 @@ class pi {
|
|
|
5961
5961
|
*/ get(t) {
|
|
5962
5962
|
// We're doing an unsafe cast to ValueType.
|
|
5963
5963
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5964
|
-
return
|
|
5964
|
+
return bi(this.store.get(t)).next((e => (
|
|
5965
5965
|
// Normalize nonexistence to null.
|
|
5966
5966
|
void 0 === e && (e = null), O("SimpleDb", "GET", this.store.name, t, e), e)));
|
|
5967
5967
|
}
|
|
5968
5968
|
delete(t) {
|
|
5969
5969
|
O("SimpleDb", "DELETE", this.store.name, t);
|
|
5970
|
-
return
|
|
5970
|
+
return bi(this.store.delete(t));
|
|
5971
5971
|
}
|
|
5972
5972
|
/**
|
|
5973
5973
|
* If we ever need more of the count variants, we can add overloads. For now,
|
|
@@ -5976,7 +5976,7 @@ class pi {
|
|
|
5976
5976
|
* Returns the number of rows in the store.
|
|
5977
5977
|
*/ count() {
|
|
5978
5978
|
O("SimpleDb", "COUNT", this.store.name);
|
|
5979
|
-
return
|
|
5979
|
+
return bi(this.store.count());
|
|
5980
5980
|
}
|
|
5981
5981
|
qt(t, e) {
|
|
5982
5982
|
const n = this.options(t, e);
|
|
@@ -6083,7 +6083,7 @@ class pi {
|
|
|
6083
6083
|
/**
|
|
6084
6084
|
* Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror
|
|
6085
6085
|
* handlers to resolve / reject the PersistencePromise as appropriate.
|
|
6086
|
-
*/ function
|
|
6086
|
+
*/ function bi(t) {
|
|
6087
6087
|
return new yi(((e, n) => {
|
|
6088
6088
|
t.onsuccess = t => {
|
|
6089
6089
|
const n = t.target.result;
|
|
@@ -6096,7 +6096,7 @@ class pi {
|
|
|
6096
6096
|
}
|
|
6097
6097
|
|
|
6098
6098
|
// Guard so we only report the error once.
|
|
6099
|
-
let
|
|
6099
|
+
let Pi = !1;
|
|
6100
6100
|
|
|
6101
6101
|
function Vi(t) {
|
|
6102
6102
|
const e = Ii.Vt(getUA());
|
|
@@ -6105,7 +6105,7 @@ function Vi(t) {
|
|
|
6105
6105
|
if (t.message.indexOf(e) >= 0) {
|
|
6106
6106
|
// Wrap error in a more descriptive one.
|
|
6107
6107
|
const t = new Q("internal", `IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);
|
|
6108
|
-
return
|
|
6108
|
+
return Pi || (Pi = !0,
|
|
6109
6109
|
// Throw a global exception outside of this promise chain, for the user to
|
|
6110
6110
|
// potentially catch.
|
|
6111
6111
|
setTimeout((() => {
|
|
@@ -6187,7 +6187,7 @@ function Si(t, e) {
|
|
|
6187
6187
|
for (let e = 0; e < this.mutations.length; e++) {
|
|
6188
6188
|
const s = this.mutations[e];
|
|
6189
6189
|
if (s.key.isEqual(t.key)) {
|
|
6190
|
-
|
|
6190
|
+
Pn(s, t, n[e]);
|
|
6191
6191
|
}
|
|
6192
6192
|
}
|
|
6193
6193
|
}
|
|
@@ -6373,7 +6373,7 @@ function Si(t, e) {
|
|
|
6373
6373
|
|
|
6374
6374
|
/** Decodes a remote document from storage locally to a Document. */ function Mi(t, e) {
|
|
6375
6375
|
let n;
|
|
6376
|
-
if (e.document) n =
|
|
6376
|
+
if (e.document) n = bs(t.Jt, e.document, !!e.hasCommittedMutations); else if (e.noDocument) {
|
|
6377
6377
|
const t = xt.fromSegments(e.noDocument.path), s = Bi(e.noDocument.readTime);
|
|
6378
6378
|
n = ne.newNoDocument(t, s), e.hasCommittedMutations && n.setHasCommittedMutations();
|
|
6379
6379
|
} else {
|
|
@@ -6874,8 +6874,8 @@ function Zi(t) {
|
|
|
6874
6874
|
/**
|
|
6875
6875
|
* Writes the "infinity" byte sequence that sorts after all other byte
|
|
6876
6876
|
* sequences written in ascending order.
|
|
6877
|
-
*/
|
|
6878
|
-
this.
|
|
6877
|
+
*/ be() {
|
|
6878
|
+
this.Pe(255), this.Pe(255);
|
|
6879
6879
|
}
|
|
6880
6880
|
/**
|
|
6881
6881
|
* Writes the "infinity" byte sequence that sorts before all other byte
|
|
@@ -6917,19 +6917,19 @@ function Zi(t) {
|
|
|
6917
6917
|
}
|
|
6918
6918
|
/** Writes a single byte ascending to the buffer. */ _e(t) {
|
|
6919
6919
|
const e = 255 & t;
|
|
6920
|
-
0 === e ? (this.
|
|
6920
|
+
0 === e ? (this.Pe(0), this.Pe(255)) : 255 === e ? (this.Pe(255), this.Pe(0)) : this.Pe(e);
|
|
6921
6921
|
}
|
|
6922
6922
|
/** Writes a single byte descending to the buffer. */ ge(t) {
|
|
6923
6923
|
const e = 255 & t;
|
|
6924
6924
|
0 === e ? (this.ve(0), this.ve(255)) : 255 === e ? (this.ve(255), this.ve(0)) : this.ve(t);
|
|
6925
6925
|
}
|
|
6926
6926
|
we() {
|
|
6927
|
-
this.
|
|
6927
|
+
this.Pe(0), this.Pe(1);
|
|
6928
6928
|
}
|
|
6929
6929
|
ye() {
|
|
6930
6930
|
this.ve(0), this.ve(1);
|
|
6931
6931
|
}
|
|
6932
|
-
|
|
6932
|
+
Pe(t) {
|
|
6933
6933
|
this.Ae(1), this.buffer[this.position++] = t;
|
|
6934
6934
|
}
|
|
6935
6935
|
ve(t) {
|
|
@@ -6963,7 +6963,7 @@ class er {
|
|
|
6963
6963
|
this.De.Te(t);
|
|
6964
6964
|
}
|
|
6965
6965
|
ee() {
|
|
6966
|
-
this.De.
|
|
6966
|
+
this.De.be();
|
|
6967
6967
|
}
|
|
6968
6968
|
}
|
|
6969
6969
|
|
|
@@ -7401,7 +7401,7 @@ class lr {
|
|
|
7401
7401
|
// For each segment, retrieve a lower bound if there is a suitable filter or
|
|
7402
7402
|
// startAt.
|
|
7403
7403
|
for (const i of re(e)) {
|
|
7404
|
-
const e = 0 /* ASCENDING */ === i.kind ?
|
|
7404
|
+
const e = 0 /* ASCENDING */ === i.kind ? be(t, i.fieldPath, t.startAt) : Pe(t, i.fieldPath, t.startAt);
|
|
7405
7405
|
n.push(e.value), s && (s = e.inclusive);
|
|
7406
7406
|
}
|
|
7407
7407
|
return new Oe(n, s);
|
|
@@ -7416,7 +7416,7 @@ class lr {
|
|
|
7416
7416
|
// For each segment, retrieve an upper bound if there is a suitable filter or
|
|
7417
7417
|
// endAt.
|
|
7418
7418
|
for (const i of re(e)) {
|
|
7419
|
-
const e = 0 /* ASCENDING */ === i.kind ?
|
|
7419
|
+
const e = 0 /* ASCENDING */ === i.kind ? Pe(t, i.fieldPath, t.endAt) : be(t, i.fieldPath, t.endAt);
|
|
7420
7420
|
n.push(e.value), s && (s = e.inclusive);
|
|
7421
7421
|
}
|
|
7422
7422
|
return new Oe(n, s);
|
|
@@ -8176,7 +8176,7 @@ function Er(t) {
|
|
|
8176
8176
|
* generate in-memory target IDs that are transient and can be reused after a
|
|
8177
8177
|
* restart.
|
|
8178
8178
|
*/
|
|
8179
|
-
class
|
|
8179
|
+
class br {
|
|
8180
8180
|
constructor(t) {
|
|
8181
8181
|
this.mn = t;
|
|
8182
8182
|
}
|
|
@@ -8188,11 +8188,11 @@ class Pr {
|
|
|
8188
8188
|
// as there is no differentiation in the protocol layer between an unset
|
|
8189
8189
|
// number and the number '0'. If we were to sent a target with target ID
|
|
8190
8190
|
// '0', the backend would consider it unset and replace it with its own ID.
|
|
8191
|
-
return new
|
|
8191
|
+
return new br(0);
|
|
8192
8192
|
}
|
|
8193
8193
|
static yn() {
|
|
8194
8194
|
// Sync engine assigns target IDs for limbo document detection.
|
|
8195
|
-
return new
|
|
8195
|
+
return new br(-1);
|
|
8196
8196
|
}
|
|
8197
8197
|
}
|
|
8198
8198
|
|
|
@@ -8211,7 +8211,7 @@ class Pr {
|
|
|
8211
8211
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8212
8212
|
* See the License for the specific language governing permissions and
|
|
8213
8213
|
* limitations under the License.
|
|
8214
|
-
*/ class
|
|
8214
|
+
*/ class Pr {
|
|
8215
8215
|
constructor(t, e) {
|
|
8216
8216
|
this.referenceDelegate = t, this.M = e;
|
|
8217
8217
|
}
|
|
@@ -8223,7 +8223,7 @@ class Pr {
|
|
|
8223
8223
|
// out to have a meaningful performance impact.
|
|
8224
8224
|
allocateTargetId(t) {
|
|
8225
8225
|
return this.pn(t).next((e => {
|
|
8226
|
-
const n = new
|
|
8226
|
+
const n = new br(e.highestTargetId);
|
|
8227
8227
|
return e.highestTargetId = n.next(), this.In(t, e).next((() => e.highestTargetId));
|
|
8228
8228
|
}));
|
|
8229
8229
|
}
|
|
@@ -8451,11 +8451,11 @@ class Pr {
|
|
|
8451
8451
|
constructor(t) {
|
|
8452
8452
|
this.An = t, this.buffer = new we(Cr), this.Rn = 0;
|
|
8453
8453
|
}
|
|
8454
|
-
|
|
8454
|
+
bn() {
|
|
8455
8455
|
return ++this.Rn;
|
|
8456
8456
|
}
|
|
8457
|
-
|
|
8458
|
-
const e = [ t, this.
|
|
8457
|
+
Pn(t) {
|
|
8458
|
+
const e = [ t, this.bn() ];
|
|
8459
8459
|
if (this.buffer.size < this.An) this.buffer = this.buffer.add(e); else {
|
|
8460
8460
|
const t = this.buffer.last();
|
|
8461
8461
|
Cr(e, t) < 0 && (this.buffer = this.buffer.delete(t).add(e));
|
|
@@ -8512,7 +8512,7 @@ class Pr {
|
|
|
8512
8512
|
nthSequenceNumber(t, e) {
|
|
8513
8513
|
if (0 === e) return yi.resolve(nt.A);
|
|
8514
8514
|
const n = new xr(e);
|
|
8515
|
-
return this.Dn.forEachTarget(t, (t => n.
|
|
8515
|
+
return this.Dn.forEachTarget(t, (t => n.Pn(t.sequenceNumber))).next((() => this.Dn.xn(t, (t => n.Pn(t))))).next((() => n.maxValue));
|
|
8516
8516
|
}
|
|
8517
8517
|
removeTargets(t, e, n) {
|
|
8518
8518
|
return this.Dn.removeTargets(t, e, n);
|
|
@@ -9444,7 +9444,7 @@ class zr {
|
|
|
9444
9444
|
/** A listener to notify on primary state changes. */
|
|
9445
9445
|
this.cs = t => Promise.resolve(), !zr.vt()) throw new Q(G.UNIMPLEMENTED, "This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");
|
|
9446
9446
|
this.referenceDelegate = new Mr(this, s), this.hs = e + "main", this.M = new ki(u),
|
|
9447
|
-
this.ls = new Ii(this.hs, this.ts, new Qr(this.M)), this.fs = new
|
|
9447
|
+
this.ls = new Ii(this.hs, this.ts, new Qr(this.M)), this.fs = new Pr(this.referenceDelegate, this.M),
|
|
9448
9448
|
this.ds = function(t) {
|
|
9449
9449
|
return new $r(t);
|
|
9450
9450
|
}(this.M), this._s = new ji, this.window && this.window.localStorage ? this.ws = this.window.localStorage : (this.ws = null,
|
|
@@ -9520,7 +9520,7 @@ class zr {
|
|
|
9520
9520
|
if (this.isPrimary) return this.Es(t).next((t => {
|
|
9521
9521
|
t || (this.isPrimary = !1, this.Yn.enqueueRetryable((() => this.cs(!1))));
|
|
9522
9522
|
}));
|
|
9523
|
-
})).next((() => this.As(t))).next((e => this.isPrimary && !e ? this.Rs(t).next((() => !1)) : !!e && this.
|
|
9523
|
+
})).next((() => this.As(t))).next((e => this.isPrimary && !e ? this.Rs(t).next((() => !1)) : !!e && this.bs(t).next((() => !0)))))).catch((t => {
|
|
9524
9524
|
if (Ai(t))
|
|
9525
9525
|
// Proceed with the existing state. Any subsequent access to
|
|
9526
9526
|
// IndexedDB will verify the lease.
|
|
@@ -9533,7 +9533,7 @@ class zr {
|
|
|
9533
9533
|
}));
|
|
9534
9534
|
}
|
|
9535
9535
|
Es(t) {
|
|
9536
|
-
return Hr(t).get("owner").next((t => yi.resolve(this.
|
|
9536
|
+
return Hr(t).get("owner").next((t => yi.resolve(this.Ps(t))));
|
|
9537
9537
|
}
|
|
9538
9538
|
Vs(t) {
|
|
9539
9539
|
return Jr(t).delete(this.clientId);
|
|
@@ -9567,7 +9567,7 @@ class zr {
|
|
|
9567
9567
|
*/ Is() {
|
|
9568
9568
|
this.os = this.Yn.enqueueAfterDelay("client_metadata_refresh" /* ClientMetadataRefresh */ , 4e3, (() => this.gs().then((() => this.vs())).then((() => this.Is()))));
|
|
9569
9569
|
}
|
|
9570
|
-
/** Checks whether `client` is the local client. */
|
|
9570
|
+
/** Checks whether `client` is the local client. */ Ps(t) {
|
|
9571
9571
|
return !!t && t.ownerId === this.clientId;
|
|
9572
9572
|
}
|
|
9573
9573
|
/**
|
|
@@ -9589,8 +9589,8 @@ class zr {
|
|
|
9589
9589
|
// the foreground.
|
|
9590
9590
|
// - the `forceOwningTab` setting was passed in.
|
|
9591
9591
|
if (null !== e && this.Ss(e.leaseTimestampMs, 5e3) && !this.xs(e.ownerId)) {
|
|
9592
|
-
if (this.
|
|
9593
|
-
if (!this.
|
|
9592
|
+
if (this.Ps(e) && this.networkEnabled) return !0;
|
|
9593
|
+
if (!this.Ps(e)) {
|
|
9594
9594
|
if (!e.allowTabSynchronization)
|
|
9595
9595
|
// Fail the `canActAsPrimary` check if the current leaseholder has
|
|
9596
9596
|
// not opted into multi-tab synchronization. If this happens at
|
|
@@ -9681,7 +9681,7 @@ class zr {
|
|
|
9681
9681
|
if (!e) throw F(`Failed to obtain primary lease for action '${t}'.`), this.isPrimary = !1,
|
|
9682
9682
|
this.Yn.enqueueRetryable((() => this.cs(!1))), new Q(G.FAILED_PRECONDITION, mi);
|
|
9683
9683
|
return n(o);
|
|
9684
|
-
})).next((t => this.
|
|
9684
|
+
})).next((t => this.bs(o).next((() => t)))) : this.$s(o).next((() => n(o)))))).then((t => (o.raiseOnCommittedEvent(),
|
|
9685
9685
|
t)));
|
|
9686
9686
|
}
|
|
9687
9687
|
/**
|
|
@@ -9692,13 +9692,13 @@ class zr {
|
|
|
9692
9692
|
// be turned off.
|
|
9693
9693
|
$s(t) {
|
|
9694
9694
|
return Hr(t).get("owner").next((t => {
|
|
9695
|
-
if (null !== t && this.Ss(t.leaseTimestampMs, 5e3) && !this.xs(t.ownerId) && !this.
|
|
9695
|
+
if (null !== t && this.Ss(t.leaseTimestampMs, 5e3) && !this.xs(t.ownerId) && !this.Ps(t) && !(this.Zn || this.allowTabSynchronization && t.allowTabSynchronization)) throw new Q(G.FAILED_PRECONDITION, Wr);
|
|
9696
9696
|
}));
|
|
9697
9697
|
}
|
|
9698
9698
|
/**
|
|
9699
9699
|
* Obtains or extends the new primary lease for the local client. This
|
|
9700
9700
|
* method does not verify that the client is eligible for this lease.
|
|
9701
|
-
*/
|
|
9701
|
+
*/ bs(t) {
|
|
9702
9702
|
const e = {
|
|
9703
9703
|
ownerId: this.clientId,
|
|
9704
9704
|
allowTabSynchronization: this.allowTabSynchronization,
|
|
@@ -9711,7 +9711,7 @@ class zr {
|
|
|
9711
9711
|
}
|
|
9712
9712
|
/** Checks the primary lease and removes it if we are the current primary. */ Rs(t) {
|
|
9713
9713
|
const e = Hr(t);
|
|
9714
|
-
return e.get("owner").next((t => this.
|
|
9714
|
+
return e.get("owner").next((t => this.Ps(t) ? (O("IndexedDbPersistence", "Releasing primary lease."),
|
|
9715
9715
|
e.delete("owner")) : yi.resolve()));
|
|
9716
9716
|
}
|
|
9717
9717
|
/** Verifies that `updateTimeMs` is within `maxAgeMs`. */ Ss(t, e) {
|
|
@@ -10739,14 +10739,14 @@ async function go(t, e, n = Yn()) {
|
|
|
10739
10739
|
const n = new To(t, e);
|
|
10740
10740
|
this.Ti = this.Ti.add(n), this.Ai = this.Ai.add(n);
|
|
10741
10741
|
}
|
|
10742
|
-
/** Add references to the given document keys for the given ID. */
|
|
10742
|
+
/** Add references to the given document keys for the given ID. */ bi(t, e) {
|
|
10743
10743
|
t.forEach((t => this.addReference(t, e)));
|
|
10744
10744
|
}
|
|
10745
10745
|
/**
|
|
10746
10746
|
* Removes a reference to the given document key for the given
|
|
10747
10747
|
* ID.
|
|
10748
10748
|
*/ removeReference(t, e) {
|
|
10749
|
-
this.
|
|
10749
|
+
this.Pi(new To(t, e));
|
|
10750
10750
|
}
|
|
10751
10751
|
Vi(t, e) {
|
|
10752
10752
|
t.forEach((t => this.removeReference(t, e)));
|
|
@@ -10757,13 +10757,13 @@ async function go(t, e, n = Yn()) {
|
|
|
10757
10757
|
*/ vi(t) {
|
|
10758
10758
|
const e = new xt(new _t([])), n = new To(e, t), s = new To(e, t + 1), i = [];
|
|
10759
10759
|
return this.Ai.forEachInRange([ n, s ], (t => {
|
|
10760
|
-
this.
|
|
10760
|
+
this.Pi(t), i.push(t.key);
|
|
10761
10761
|
})), i;
|
|
10762
10762
|
}
|
|
10763
10763
|
Si() {
|
|
10764
|
-
this.Ti.forEach((t => this.
|
|
10764
|
+
this.Ti.forEach((t => this.Pi(t)));
|
|
10765
10765
|
}
|
|
10766
|
-
|
|
10766
|
+
Pi(t) {
|
|
10767
10767
|
this.Ti = this.Ti.delete(t), this.Ai = this.Ai.delete(t);
|
|
10768
10768
|
}
|
|
10769
10769
|
Di(t) {
|
|
@@ -11095,7 +11095,7 @@ class Ro extends Fr {
|
|
|
11095
11095
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11096
11096
|
* See the License for the specific language governing permissions and
|
|
11097
11097
|
* limitations under the License.
|
|
11098
|
-
*/ class
|
|
11098
|
+
*/ class bo {
|
|
11099
11099
|
constructor(t) {
|
|
11100
11100
|
this.persistence = t,
|
|
11101
11101
|
/**
|
|
@@ -11112,7 +11112,7 @@ class Ro extends Fr {
|
|
|
11112
11112
|
* A ordered bidirectional mapping between documents and the remote target
|
|
11113
11113
|
* IDs.
|
|
11114
11114
|
*/
|
|
11115
|
-
this.qi = new Io, this.targetCount = 0, this.Ki =
|
|
11115
|
+
this.qi = new Io, this.targetCount = 0, this.Ki = br.gn();
|
|
11116
11116
|
}
|
|
11117
11117
|
forEachTarget(t, e) {
|
|
11118
11118
|
return this.Li.forEach(((t, n) => e(n))), yi.resolve();
|
|
@@ -11133,7 +11133,7 @@ class Ro extends Fr {
|
|
|
11133
11133
|
Tn(t) {
|
|
11134
11134
|
this.Li.set(t.target, t);
|
|
11135
11135
|
const e = t.targetId;
|
|
11136
|
-
e > this.highestTargetId && (this.Ki = new
|
|
11136
|
+
e > this.highestTargetId && (this.Ki = new br(e), this.highestTargetId = e), t.sequenceNumber > this.Ui && (this.Ui = t.sequenceNumber);
|
|
11137
11137
|
}
|
|
11138
11138
|
addTargetData(t, e) {
|
|
11139
11139
|
return this.Tn(e), this.targetCount += 1, yi.resolve();
|
|
@@ -11161,7 +11161,7 @@ class Ro extends Fr {
|
|
|
11161
11161
|
return yi.resolve(n);
|
|
11162
11162
|
}
|
|
11163
11163
|
addMatchingKeys(t, e, n) {
|
|
11164
|
-
return this.qi.
|
|
11164
|
+
return this.qi.bi(e, n), yi.resolve();
|
|
11165
11165
|
}
|
|
11166
11166
|
removeMatchingKeys(t, e, n) {
|
|
11167
11167
|
this.qi.Vi(e, n);
|
|
@@ -11202,7 +11202,7 @@ class Ro extends Fr {
|
|
|
11202
11202
|
* A memory-backed instance of Persistence. Data is stored only in RAM and
|
|
11203
11203
|
* not persisted across sessions.
|
|
11204
11204
|
*/
|
|
11205
|
-
class
|
|
11205
|
+
class Po {
|
|
11206
11206
|
/**
|
|
11207
11207
|
* The constructor accepts a factory for creating a reference delegate. This
|
|
11208
11208
|
* allows both the delegate and this instance to have strong references to
|
|
@@ -11211,7 +11211,7 @@ class bo {
|
|
|
11211
11211
|
*/
|
|
11212
11212
|
constructor(t, e) {
|
|
11213
11213
|
this.Gi = {}, this.overlays = {}, this.es = new nt(0), this.ns = !1, this.ns = !0,
|
|
11214
|
-
this.referenceDelegate = t(this), this.fs = new
|
|
11214
|
+
this.referenceDelegate = t(this), this.fs = new bo(this);
|
|
11215
11215
|
this.indexManager = new ar, this.ds = function(t) {
|
|
11216
11216
|
return new Ao(t);
|
|
11217
11217
|
}((t => this.referenceDelegate.Qi(t))), this.M = new ki(e), this._s = new yo(this.M);
|
|
@@ -11649,7 +11649,7 @@ class Oo {
|
|
|
11649
11649
|
this.removeItem(Co(this.persistenceKey, t));
|
|
11650
11650
|
}
|
|
11651
11651
|
updateQueryState(t, e, n) {
|
|
11652
|
-
this.
|
|
11652
|
+
this.br(t, e, n);
|
|
11653
11653
|
}
|
|
11654
11654
|
handleUserChange(t, e, n) {
|
|
11655
11655
|
e.forEach((t => {
|
|
@@ -11659,7 +11659,7 @@ class Oo {
|
|
|
11659
11659
|
}));
|
|
11660
11660
|
}
|
|
11661
11661
|
setOnlineState(t) {
|
|
11662
|
-
this.
|
|
11662
|
+
this.Pr(t);
|
|
11663
11663
|
}
|
|
11664
11664
|
notifyBundleLoaded(t) {
|
|
11665
11665
|
this.Vr(t);
|
|
@@ -11749,14 +11749,14 @@ class Oo {
|
|
|
11749
11749
|
const e = Do(this.persistenceKey, this.currentUser, t);
|
|
11750
11750
|
this.removeItem(e);
|
|
11751
11751
|
}
|
|
11752
|
-
|
|
11752
|
+
Pr(t) {
|
|
11753
11753
|
const e = {
|
|
11754
11754
|
clientId: this.ir,
|
|
11755
11755
|
onlineState: t
|
|
11756
11756
|
};
|
|
11757
11757
|
this.storage.setItem(this.mr, JSON.stringify(e));
|
|
11758
11758
|
}
|
|
11759
|
-
|
|
11759
|
+
br(t, e, n) {
|
|
11760
11760
|
const s = Co(this.persistenceKey, t), i = new No(t, e, n);
|
|
11761
11761
|
this.setItem(s, i.er());
|
|
11762
11762
|
}
|
|
@@ -12397,7 +12397,7 @@ class Wo {
|
|
|
12397
12397
|
this.cancel();
|
|
12398
12398
|
// First schedule using the current base (which may be 0 and should be
|
|
12399
12399
|
// honored as such).
|
|
12400
|
-
const e = Math.floor(this.Io + this.
|
|
12400
|
+
const e = Math.floor(this.Io + this.bo()), n = Math.max(0, Date.now() - this.Eo), s = Math.max(0, e - n);
|
|
12401
12401
|
// Guard against lastAttemptTime being in the future due to a clock change.
|
|
12402
12402
|
s > 0 && O("ExponentialBackoff", `Backing off for ${s} ms (base delay: ${this.Io} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`),
|
|
12403
12403
|
this.To = this.Yn.enqueueAfterDelay(this.timerId, s, (() => (this.Eo = Date.now(),
|
|
@@ -12406,13 +12406,13 @@ class Wo {
|
|
|
12406
12406
|
// bounds.
|
|
12407
12407
|
this.Io *= this.yo, this.Io < this.mo && (this.Io = this.mo), this.Io > this.po && (this.Io = this.po);
|
|
12408
12408
|
}
|
|
12409
|
-
|
|
12409
|
+
Po() {
|
|
12410
12410
|
null !== this.To && (this.To.skipDelay(), this.To = null);
|
|
12411
12411
|
}
|
|
12412
12412
|
cancel() {
|
|
12413
12413
|
null !== this.To && (this.To.cancel(), this.To = null);
|
|
12414
12414
|
}
|
|
12415
|
-
/** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */
|
|
12415
|
+
/** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ bo() {
|
|
12416
12416
|
return (Math.random() - .5) * this.Io;
|
|
12417
12417
|
}
|
|
12418
12418
|
}
|
|
@@ -13009,14 +13009,14 @@ function nu(t, e) {
|
|
|
13009
13009
|
// Mark this as something the client is currently listening for.
|
|
13010
13010
|
n._u.set(e.targetId, e), uu(n) ?
|
|
13011
13011
|
// The listen will be sent in onWatchStreamOpen
|
|
13012
|
-
ou(n) :
|
|
13012
|
+
ou(n) : Pu(n).Mo() && iu(n, e));
|
|
13013
13013
|
}
|
|
13014
13014
|
|
|
13015
13015
|
/**
|
|
13016
13016
|
* Removes the listen from server. It is a no-op if the given target id is
|
|
13017
13017
|
* not being listened to.
|
|
13018
13018
|
*/ function su(t, e) {
|
|
13019
|
-
const n = K(t), s =
|
|
13019
|
+
const n = K(t), s = Pu(n);
|
|
13020
13020
|
n._u.delete(e), s.Mo() && ru(n, e), 0 === n._u.size && (s.Mo() ? s.$o() : au(n) &&
|
|
13021
13021
|
// Revert to OnlineState.Unknown if the watch stream is not open and we
|
|
13022
13022
|
// have no listeners, since without any listens to send we cannot
|
|
@@ -13028,7 +13028,7 @@ function nu(t, e) {
|
|
|
13028
13028
|
* We need to increment the the expected number of pending responses we're due
|
|
13029
13029
|
* from watch so we wait for the ack to process any messages from this target.
|
|
13030
13030
|
*/ function iu(t, e) {
|
|
13031
|
-
t.pu.Z(e.targetId),
|
|
13031
|
+
t.pu.Z(e.targetId), Pu(t).Ho(e);
|
|
13032
13032
|
}
|
|
13033
13033
|
|
|
13034
13034
|
/**
|
|
@@ -13036,21 +13036,21 @@ function nu(t, e) {
|
|
|
13036
13036
|
* from watch so we wait for the removal on the server before we process any
|
|
13037
13037
|
* messages from this target.
|
|
13038
13038
|
*/ function ru(t, e) {
|
|
13039
|
-
t.pu.Z(e),
|
|
13039
|
+
t.pu.Z(e), Pu(t).Jo(e);
|
|
13040
13040
|
}
|
|
13041
13041
|
|
|
13042
13042
|
function ou(t) {
|
|
13043
13043
|
t.pu = new os({
|
|
13044
13044
|
getRemoteKeysForTarget: e => t.remoteSyncer.getRemoteKeysForTarget(e),
|
|
13045
13045
|
Et: e => t._u.get(e) || null
|
|
13046
|
-
}),
|
|
13046
|
+
}), Pu(t).start(), t.yu.au();
|
|
13047
13047
|
}
|
|
13048
13048
|
|
|
13049
13049
|
/**
|
|
13050
13050
|
* Returns whether the watch stream should be started because it's necessary
|
|
13051
13051
|
* and has not yet been started.
|
|
13052
13052
|
*/ function uu(t) {
|
|
13053
|
-
return au(t) && !
|
|
13053
|
+
return au(t) && !Pu(t).ko() && t._u.size > 0;
|
|
13054
13054
|
}
|
|
13055
13055
|
|
|
13056
13056
|
function au(t) {
|
|
@@ -13283,7 +13283,7 @@ async function Ru(t, e) {
|
|
|
13283
13283
|
|
|
13284
13284
|
/**
|
|
13285
13285
|
* Toggles the network state when the client gains or loses its primary lease.
|
|
13286
|
-
*/ async function
|
|
13286
|
+
*/ async function bu(t, e) {
|
|
13287
13287
|
const n = K(t);
|
|
13288
13288
|
e ? (n.wu.delete(2 /* IsSecondary */), await tu(n)) : e || (n.wu.add(2 /* IsSecondary */),
|
|
13289
13289
|
await eu(n), n.yu.set("Unknown" /* Unknown */));
|
|
@@ -13296,7 +13296,7 @@ async function Ru(t, e) {
|
|
|
13296
13296
|
*
|
|
13297
13297
|
* PORTING NOTE: On iOS and Android, the WatchStream gets registered on startup.
|
|
13298
13298
|
* This is not done on Web to allow it to be tree-shaken.
|
|
13299
|
-
*/ function
|
|
13299
|
+
*/ function Pu(t) {
|
|
13300
13300
|
return t.Iu || (
|
|
13301
13301
|
// Create stream (but note that it is not started yet).
|
|
13302
13302
|
t.Iu = function(t, e, n) {
|
|
@@ -13656,7 +13656,7 @@ class xu {
|
|
|
13656
13656
|
class ku {
|
|
13657
13657
|
constructor() {
|
|
13658
13658
|
this.queries = new Kn((t => Xe(t)), Ye), this.onlineState = "Unknown" /* Unknown */ ,
|
|
13659
|
-
this.
|
|
13659
|
+
this.bu = new Set;
|
|
13660
13660
|
}
|
|
13661
13661
|
}
|
|
13662
13662
|
|
|
@@ -13671,7 +13671,7 @@ async function Mu(t, e) {
|
|
|
13671
13671
|
}
|
|
13672
13672
|
if (n.queries.set(s, r), r.listeners.push(e),
|
|
13673
13673
|
// Run global snapshot listeners if a consistent snapshot has been emitted.
|
|
13674
|
-
e.
|
|
13674
|
+
e.Pu(n.onlineState), r.Ru) {
|
|
13675
13675
|
e.Vu(r.Ru) && Bu(n);
|
|
13676
13676
|
}
|
|
13677
13677
|
}
|
|
@@ -13710,7 +13710,7 @@ function $u(t, e, n) {
|
|
|
13710
13710
|
|
|
13711
13711
|
// Call all global snapshot listeners that have been set.
|
|
13712
13712
|
function Bu(t) {
|
|
13713
|
-
t.
|
|
13713
|
+
t.bu.forEach((t => {
|
|
13714
13714
|
t.next();
|
|
13715
13715
|
}));
|
|
13716
13716
|
}
|
|
@@ -13749,7 +13749,7 @@ function Bu(t) {
|
|
|
13749
13749
|
onError(t) {
|
|
13750
13750
|
this.vu.error(t);
|
|
13751
13751
|
}
|
|
13752
|
-
/** Returns whether a snapshot was raised. */
|
|
13752
|
+
/** Returns whether a snapshot was raised. */ Pu(t) {
|
|
13753
13753
|
this.onlineState = t;
|
|
13754
13754
|
let e = !1;
|
|
13755
13755
|
return this.Du && !this.Su && this.xu(this.Du, t) && (this.Nu(this.Du), e = !0),
|
|
@@ -13842,7 +13842,7 @@ function Bu(t) {
|
|
|
13842
13842
|
/**
|
|
13843
13843
|
* Converts a BundleDocument to a MutableDocument.
|
|
13844
13844
|
*/ mi(t) {
|
|
13845
|
-
return t.metadata.exists ?
|
|
13845
|
+
return t.metadata.exists ? bs(this.M, t.document, !1) : ne.newNoDocument(this.wi(t.metadata.name), this.gi(t.metadata.readTime));
|
|
13846
13846
|
}
|
|
13847
13847
|
gi(t) {
|
|
13848
13848
|
return ws(t);
|
|
@@ -14124,7 +14124,7 @@ class ju {
|
|
|
14124
14124
|
/**
|
|
14125
14125
|
* Applies an OnlineState change to the view, potentially generating a
|
|
14126
14126
|
* ViewChange if the view's syncState changes as a result.
|
|
14127
|
-
*/
|
|
14127
|
+
*/ Pu(t) {
|
|
14128
14128
|
return this.current && "Offline" /* Offline */ === t ? (
|
|
14129
14129
|
// If we're offline, set `current` to false and then call applyChanges()
|
|
14130
14130
|
// to refresh our syncState and generate a ViewChange as appropriate. We
|
|
@@ -14289,7 +14289,7 @@ class zu {
|
|
|
14289
14289
|
/** Stores user completion handlers, indexed by User and BatchId. */
|
|
14290
14290
|
this.ha = {},
|
|
14291
14291
|
/** Stores user callbacks waiting for all pending writes to be acknowledged. */
|
|
14292
|
-
this.la = new Map, this.fa =
|
|
14292
|
+
this.la = new Map, this.fa = br.yn(), this.onlineState = "Unknown" /* Unknown */ ,
|
|
14293
14293
|
// The primary state is set to `true` or `false` immediately after Firestore
|
|
14294
14294
|
// startup. In the interim, a client should only be considered primary if
|
|
14295
14295
|
// `isPrimary` is true.
|
|
@@ -14306,7 +14306,7 @@ class zu {
|
|
|
14306
14306
|
* subscribed handlers. Returns the initial snapshot.
|
|
14307
14307
|
*/
|
|
14308
14308
|
async function Yu(t, e) {
|
|
14309
|
-
const n =
|
|
14309
|
+
const n = Pa(t);
|
|
14310
14310
|
let s, i;
|
|
14311
14311
|
const r = n.ia.get(e);
|
|
14312
14312
|
if (r)
|
|
@@ -14458,7 +14458,7 @@ async function Yu(t, e) {
|
|
|
14458
14458
|
if (s.isPrimaryClient && 0 /* RemoteStore */ === n || !s.isPrimaryClient && 1 /* SharedClientState */ === n) {
|
|
14459
14459
|
const t = [];
|
|
14460
14460
|
s.ia.forEach(((n, s) => {
|
|
14461
|
-
const i = s.view.
|
|
14461
|
+
const i = s.view.Pu(e);
|
|
14462
14462
|
i.snapshot && t.push(i.snapshot);
|
|
14463
14463
|
})), function(t, e) {
|
|
14464
14464
|
const n = K(t);
|
|
@@ -14467,7 +14467,7 @@ async function Yu(t, e) {
|
|
|
14467
14467
|
n.queries.forEach(((t, n) => {
|
|
14468
14468
|
for (const t of n.listeners)
|
|
14469
14469
|
// Run global snapshot listeners if a consistent snapshot has been emitted.
|
|
14470
|
-
t.
|
|
14470
|
+
t.Pu(e) && (s = !0);
|
|
14471
14471
|
})), s && Bu(n);
|
|
14472
14472
|
}(s.eventManager, e), t.length && s.sa.zo(t), s.onlineState = e, s.isPrimaryClient && s.sharedClientState.setOnlineState(e);
|
|
14473
14473
|
}
|
|
@@ -14771,7 +14771,7 @@ async function pa(t, e, n, s) {
|
|
|
14771
14771
|
// PORTING NOTE: Multi-Tab only.
|
|
14772
14772
|
async function Ia(t, e) {
|
|
14773
14773
|
const n = K(t);
|
|
14774
|
-
if (
|
|
14774
|
+
if (Pa(n), Va(n), !0 === e && !0 !== n.da) {
|
|
14775
14775
|
// Secondary tabs only maintain Views for their local listeners and the
|
|
14776
14776
|
// Views internal state may not be 100% populated (in particular
|
|
14777
14777
|
// secondary tabs don't track syncedDocuments, the set of documents the
|
|
@@ -14779,7 +14779,7 @@ async function Ia(t, e) {
|
|
|
14779
14779
|
// primary, we need to need to make sure that all views for all targets
|
|
14780
14780
|
// match the state on disk.
|
|
14781
14781
|
const t = n.sharedClientState.getAllActiveQueryTargets(), e = await Ta(n, t.toArray());
|
|
14782
|
-
n.da = !0, await
|
|
14782
|
+
n.da = !0, await bu(n.remoteStore, !0);
|
|
14783
14783
|
for (const t of e) nu(n.remoteStore, t);
|
|
14784
14784
|
} else if (!1 === e && !1 !== n.da) {
|
|
14785
14785
|
const t = [];
|
|
@@ -14807,7 +14807,7 @@ async function Ia(t, e) {
|
|
|
14807
14807
|
* tab to a primary tab
|
|
14808
14808
|
*/
|
|
14809
14809
|
// PORTING NOTE: Multi-Tab only.
|
|
14810
|
-
(n), n.da = !1, await
|
|
14810
|
+
(n), n.da = !1, await bu(n.remoteStore, !1);
|
|
14811
14811
|
}
|
|
14812
14812
|
}
|
|
14813
14813
|
|
|
@@ -14888,8 +14888,8 @@ async function Ra(t, e, n, s) {
|
|
|
14888
14888
|
}
|
|
14889
14889
|
}
|
|
14890
14890
|
|
|
14891
|
-
/** Adds or removes Watch targets for queries from different tabs. */ async function
|
|
14892
|
-
const s =
|
|
14891
|
+
/** Adds or removes Watch targets for queries from different tabs. */ async function ba(t, e, n) {
|
|
14892
|
+
const s = Pa(t);
|
|
14893
14893
|
if (s.da) {
|
|
14894
14894
|
for (const t of e) {
|
|
14895
14895
|
if (s.ra.has(t)) {
|
|
@@ -14913,7 +14913,7 @@ async function Ra(t, e, n, s) {
|
|
|
14913
14913
|
}
|
|
14914
14914
|
}
|
|
14915
14915
|
|
|
14916
|
-
function
|
|
14916
|
+
function Pa(t) {
|
|
14917
14917
|
const e = K(t);
|
|
14918
14918
|
return e.remoteStore.remoteSyncer.applyRemoteEvent = ea.bind(null, e), e.remoteStore.remoteSyncer.getRemoteKeysForTarget = ma.bind(null, e),
|
|
14919
14919
|
e.remoteStore.remoteSyncer.rejectListen = sa.bind(null, e), e.sa.zo = Fu.bind(null, e.eventManager),
|
|
@@ -15018,7 +15018,7 @@ class Sa {
|
|
|
15018
15018
|
return no(this.persistence, new to, t.initialUser, this.M);
|
|
15019
15019
|
}
|
|
15020
15020
|
ya(t) {
|
|
15021
|
-
return new
|
|
15021
|
+
return new Po(vo.Yi, this.M);
|
|
15022
15022
|
}
|
|
15023
15023
|
ga(t) {
|
|
15024
15024
|
return new $o;
|
|
@@ -15077,7 +15077,7 @@ class Sa {
|
|
|
15077
15077
|
this.sharedClientState instanceof Fo && (this.sharedClientState.syncEngine = {
|
|
15078
15078
|
$r: pa.bind(null, e),
|
|
15079
15079
|
Br: Ra.bind(null, e),
|
|
15080
|
-
Lr:
|
|
15080
|
+
Lr: ba.bind(null, e),
|
|
15081
15081
|
Fs: Aa.bind(null, e),
|
|
15082
15082
|
Fr: ya.bind(null, e)
|
|
15083
15083
|
}, await this.sharedClientState.start()),
|
|
@@ -15105,7 +15105,7 @@ class Sa {
|
|
|
15105
15105
|
this.eventManager = this.createEventManager(e), this.syncEngine = this.createSyncEngine(e,
|
|
15106
15106
|
/* startAsPrimary=*/ !t.synchronizeTabs), this.sharedClientState.onlineStateHandler = t => na(this.syncEngine, t, 1 /* SharedClientState */),
|
|
15107
15107
|
this.remoteStore.remoteSyncer.handleCredentialChange = wa.bind(null, this.syncEngine),
|
|
15108
|
-
await
|
|
15108
|
+
await bu(this.remoteStore, this.syncEngine.isPrimaryClient));
|
|
15109
15109
|
}
|
|
15110
15110
|
createEventManager(t) {
|
|
15111
15111
|
return new ku;
|
|
@@ -15292,9 +15292,9 @@ class ka {
|
|
|
15292
15292
|
* Internal buffer to hold bundle content, accumulating incomplete element
|
|
15293
15293
|
* content.
|
|
15294
15294
|
*/
|
|
15295
|
-
this.buffer = new Uint8Array, this.
|
|
15295
|
+
this.buffer = new Uint8Array, this.ba = new TextDecoder("utf-8"),
|
|
15296
15296
|
// Read the metadata (which is the first element).
|
|
15297
|
-
this.
|
|
15297
|
+
this.Pa().then((t => {
|
|
15298
15298
|
t && t.Mu() ? 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)}`));
|
|
15299
15299
|
}), (t => this.metadata.reject(t)));
|
|
15300
15300
|
}
|
|
@@ -15306,7 +15306,7 @@ class ka {
|
|
|
15306
15306
|
}
|
|
15307
15307
|
async ma() {
|
|
15308
15308
|
// Makes sure metadata is read before proceeding.
|
|
15309
|
-
return await this.getMetadata(), this.
|
|
15309
|
+
return await this.getMetadata(), this.Pa();
|
|
15310
15310
|
}
|
|
15311
15311
|
/**
|
|
15312
15312
|
* Reads from the head of internal buffer, and pulling more data from
|
|
@@ -15317,10 +15317,10 @@ class ka {
|
|
|
15317
15317
|
*
|
|
15318
15318
|
* Returns either the bundled element, or null if we have reached the end of
|
|
15319
15319
|
* the stream.
|
|
15320
|
-
*/ async
|
|
15320
|
+
*/ async Pa() {
|
|
15321
15321
|
const t = await this.Va();
|
|
15322
15322
|
if (null === t) return null;
|
|
15323
|
-
const e = this.
|
|
15323
|
+
const e = this.ba.decode(t), n = Number(e);
|
|
15324
15324
|
isNaN(n) && this.va(`length string (${e}) is not valid number`);
|
|
15325
15325
|
const s = await this.Sa(n);
|
|
15326
15326
|
return new Uu(JSON.parse(s), t.length + n);
|
|
@@ -15357,7 +15357,7 @@ class ka {
|
|
|
15357
15357
|
for (;this.buffer.length < t; ) {
|
|
15358
15358
|
await this.Ca() && this.va("Reached the end of bundle when more is expected.");
|
|
15359
15359
|
}
|
|
15360
|
-
const e = this.
|
|
15360
|
+
const e = this.ba.decode(this.buffer.slice(0, t));
|
|
15361
15361
|
// Update the internal buffer to drop the read json string.
|
|
15362
15362
|
return this.buffer = this.buffer.slice(t), e;
|
|
15363
15363
|
}
|
|
@@ -15423,7 +15423,7 @@ class Oa {
|
|
|
15423
15423
|
documents: e.map((t => ys(n.M, t)))
|
|
15424
15424
|
}, r = await n._o("BatchGetDocuments", s, i), o = new Map;
|
|
15425
15425
|
r.forEach((t => {
|
|
15426
|
-
const e =
|
|
15426
|
+
const e = Ps(n.M, t);
|
|
15427
15427
|
o.set(e.key.toString(), e);
|
|
15428
15428
|
}));
|
|
15429
15429
|
const u = [];
|
|
@@ -15538,11 +15538,10 @@ class Oa {
|
|
|
15538
15538
|
/**
|
|
15539
15539
|
* TransactionRunner encapsulates the logic needed to run and retry transactions
|
|
15540
15540
|
* with backoff.
|
|
15541
|
-
*/
|
|
15542
|
-
|
|
15543
|
-
|
|
15544
|
-
this.
|
|
15545
|
-
this.xa = 5, this.No = new Wo(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
|
|
15541
|
+
*/ class Fa {
|
|
15542
|
+
constructor(t, e, n, s, i) {
|
|
15543
|
+
this.asyncQueue = t, this.datastore = e, this.options = n, this.updateFunction = s,
|
|
15544
|
+
this.deferred = i, this.xa = n.maxAttempts, this.No = new Wo(this.asyncQueue, "transaction_retry" /* TransactionRetry */);
|
|
15546
15545
|
}
|
|
15547
15546
|
/** Runs the transaction and sets the result on deferred. */ run() {
|
|
15548
15547
|
this.xa -= 1, this.Na();
|
|
@@ -15838,13 +15837,13 @@ function Za(t, e, n = {}) {
|
|
|
15838
15837
|
function tc(t, e) {
|
|
15839
15838
|
const n = new ka(e);
|
|
15840
15839
|
return t.asyncQueue.enqueueAndForget((async () => function(t, e) {
|
|
15841
|
-
K(t).
|
|
15840
|
+
K(t).bu.add(e),
|
|
15842
15841
|
// Immediately fire an initial event, indicating all existing listeners
|
|
15843
15842
|
// are in-sync.
|
|
15844
15843
|
e.next();
|
|
15845
15844
|
}(await Wa(t), n))), () => {
|
|
15846
15845
|
n.Aa(), t.asyncQueue.enqueueAndForget((async () => function(t, e) {
|
|
15847
|
-
K(t).
|
|
15846
|
+
K(t).bu.delete(e);
|
|
15848
15847
|
}(await Wa(t), n)));
|
|
15849
15848
|
};
|
|
15850
15849
|
}
|
|
@@ -15863,14 +15862,14 @@ function tc(t, e) {
|
|
|
15863
15862
|
* accessed with the transaction will not reflect local changes that have not
|
|
15864
15863
|
* been committed. For this reason, it is required that all reads are
|
|
15865
15864
|
* performed before any writes. Transactions must be performed while online.
|
|
15866
|
-
*/ function ec(t, e) {
|
|
15867
|
-
const
|
|
15865
|
+
*/ function ec(t, e, n) {
|
|
15866
|
+
const s = new j;
|
|
15868
15867
|
return t.asyncQueue.enqueueAndForget((async () => {
|
|
15869
|
-
const
|
|
15868
|
+
const i = await function(t) {
|
|
15870
15869
|
return qa(t).then((t => t.datastore));
|
|
15871
15870
|
}(t);
|
|
15872
|
-
new Fa(t.asyncQueue,
|
|
15873
|
-
})),
|
|
15871
|
+
new Fa(t.asyncQueue, i, n, e, s).run();
|
|
15872
|
+
})), s.promise;
|
|
15874
15873
|
}
|
|
15875
15874
|
|
|
15876
15875
|
function nc(t, e, n, s) {
|
|
@@ -16419,7 +16418,7 @@ function Ic(t, e, ...n) {
|
|
|
16419
16418
|
// after page comes into foreground.
|
|
16420
16419
|
this.Qa = () => {
|
|
16421
16420
|
const t = Qo();
|
|
16422
|
-
t && O("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.No.
|
|
16421
|
+
t && O("AsyncQueue", "Visibility state changed to " + t.visibilityState), this.No.Po();
|
|
16423
16422
|
};
|
|
16424
16423
|
const t = Qo();
|
|
16425
16424
|
t && "function" == typeof t.addEventListener && t.addEventListener("visibilitychange", this.Qa);
|
|
@@ -16616,7 +16615,7 @@ function Rc(t) {
|
|
|
16616
16615
|
*/ (t, [ "next", "error", "complete" ]);
|
|
16617
16616
|
}
|
|
16618
16617
|
|
|
16619
|
-
class
|
|
16618
|
+
class bc {
|
|
16620
16619
|
constructor() {
|
|
16621
16620
|
this._progressObserver = {}, this._taskCompletionResolver = new j, this._lastProgress = {
|
|
16622
16621
|
taskState: "Running",
|
|
@@ -16700,7 +16699,7 @@ class Pc {
|
|
|
16700
16699
|
* See the License for the specific language governing permissions and
|
|
16701
16700
|
* limitations under the License.
|
|
16702
16701
|
*/
|
|
16703
|
-
/** DOMException error code constants. */ const
|
|
16702
|
+
/** DOMException error code constants. */ const Pc = -1;
|
|
16704
16703
|
|
|
16705
16704
|
/**
|
|
16706
16705
|
* The Cloud Firestore service interface.
|
|
@@ -16985,7 +16984,7 @@ function Mc(t) {
|
|
|
16985
16984
|
* updates, and completion or error events. It can be used as a
|
|
16986
16985
|
* `Promise<LoadBundleTaskProgress>`.
|
|
16987
16986
|
*/ function Lc(t, e) {
|
|
16988
|
-
const n = Dc(t = hc(t, Vc)), s = new
|
|
16987
|
+
const n = Dc(t = hc(t, Vc)), s = new bc;
|
|
16989
16988
|
return nc(n, t._databaseId, e, s), s;
|
|
16990
16989
|
}
|
|
16991
16990
|
|
|
@@ -17945,7 +17944,7 @@ function yh(t, e, n, s, i) {
|
|
|
17945
17944
|
if (this._converter) {
|
|
17946
17945
|
// We only want to use the converter and create a new DocumentSnapshot
|
|
17947
17946
|
// if a converter has been provided.
|
|
17948
|
-
const e = new
|
|
17947
|
+
const e = new bh(this._firestore, this._userDataWriter, this._key, this._document, this.metadata,
|
|
17949
17948
|
/* converter= */ null);
|
|
17950
17949
|
return this._converter.fromFirestore(e, t);
|
|
17951
17950
|
}
|
|
@@ -17988,7 +17987,7 @@ function yh(t, e, n, s, i) {
|
|
|
17988
17987
|
* `DocumentSnapshot`. Since query results contain only existing documents, the
|
|
17989
17988
|
* `exists` property will always be true and `data()` will never return
|
|
17990
17989
|
* 'undefined'.
|
|
17991
|
-
*/ class
|
|
17990
|
+
*/ class bh extends Rh {
|
|
17992
17991
|
/**
|
|
17993
17992
|
* Retrieves all fields in the document as an `Object`.
|
|
17994
17993
|
*
|
|
@@ -18013,7 +18012,7 @@ function yh(t, e, n, s, i) {
|
|
|
18013
18012
|
* array via the `docs` property or enumerated using the `forEach` method. The
|
|
18014
18013
|
* number of documents can be determined via the `empty` and `size`
|
|
18015
18014
|
* properties.
|
|
18016
|
-
*/ class
|
|
18015
|
+
*/ class Ph {
|
|
18017
18016
|
/** @hideconstructor */
|
|
18018
18017
|
constructor(t, e, n, s) {
|
|
18019
18018
|
this._firestore = t, this._userDataWriter = e, this._snapshot = s, this.metadata = new Ah(s.hasPendingWrites, s.fromCache),
|
|
@@ -18037,7 +18036,7 @@ function yh(t, e, n, s, i) {
|
|
|
18037
18036
|
* @param thisArg - The `this` binding for the callback.
|
|
18038
18037
|
*/ forEach(t, e) {
|
|
18039
18038
|
this._snapshot.docs.forEach((n => {
|
|
18040
|
-
t.call(e, new
|
|
18039
|
+
t.call(e, new bh(this._firestore, this._userDataWriter, n.key, n, new Ah(this._snapshot.mutatedKeys.has(n.key), this._snapshot.fromCache), this.query.converter));
|
|
18041
18040
|
}));
|
|
18042
18041
|
}
|
|
18043
18042
|
/**
|
|
@@ -18058,7 +18057,7 @@ function yh(t, e, n, s, i) {
|
|
|
18058
18057
|
let e = 0;
|
|
18059
18058
|
return t._snapshot.docChanges.map((n => ({
|
|
18060
18059
|
type: "added",
|
|
18061
|
-
doc: new
|
|
18060
|
+
doc: new bh(t._firestore, t._userDataWriter, n.doc.key, n.doc, new Ah(t._snapshot.mutatedKeys.has(n.doc.key), t._snapshot.fromCache), t.query.converter),
|
|
18062
18061
|
oldIndex: -1,
|
|
18063
18062
|
newIndex: e++
|
|
18064
18063
|
})));
|
|
@@ -18068,7 +18067,7 @@ function yh(t, e, n, s, i) {
|
|
|
18068
18067
|
// to lookup the index of a document.
|
|
18069
18068
|
let n = t._snapshot.oldDocs;
|
|
18070
18069
|
return t._snapshot.docChanges.filter((t => e || 3 /* Metadata */ !== t.type)).map((e => {
|
|
18071
|
-
const s = new
|
|
18070
|
+
const s = new bh(t._firestore, t._userDataWriter, e.doc.key, e.doc, new Ah(t._snapshot.mutatedKeys.has(e.doc.key), t._snapshot.fromCache), t.query.converter);
|
|
18072
18071
|
let i = -1, r = -1;
|
|
18073
18072
|
return 0 /* Added */ !== e.type && (i = n.indexOf(e.doc.key), n = n.delete(e.doc.key)),
|
|
18074
18073
|
1 /* Removed */ !== e.type && (n = n.add(e.doc), r = n.indexOf(e.doc.key)), {
|
|
@@ -18109,7 +18108,7 @@ function Vh(t) {
|
|
|
18109
18108
|
* @param right - A snapshot to compare.
|
|
18110
18109
|
* @returns true if the snapshots are equal.
|
|
18111
18110
|
*/ function vh(t, e) {
|
|
18112
|
-
return t instanceof Rh && e instanceof Rh ? 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
|
|
18111
|
+
return t instanceof Rh && e instanceof Rh ? 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 Ph && e instanceof Ph && (t._firestore === e._firestore && Ec(t.query, e.query) && t.metadata.isEqual(e.metadata) && t._snapshot.isEqual(e._snapshot));
|
|
18113
18112
|
}
|
|
18114
18113
|
|
|
18115
18114
|
/**
|
|
@@ -18449,6 +18448,25 @@ function zh(t, e, n) {
|
|
|
18449
18448
|
if (!n.isEqual(e)) throw new Q(G.INVALID_ARGUMENT, `Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`);
|
|
18450
18449
|
}
|
|
18451
18450
|
|
|
18451
|
+
/**
|
|
18452
|
+
* @license
|
|
18453
|
+
* Copyright 2022 Google LLC
|
|
18454
|
+
*
|
|
18455
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18456
|
+
* you may not use this file except in compliance with the License.
|
|
18457
|
+
* You may obtain a copy of the License at
|
|
18458
|
+
*
|
|
18459
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18460
|
+
*
|
|
18461
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18462
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18463
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18464
|
+
* See the License for the specific language governing permissions and
|
|
18465
|
+
* limitations under the License.
|
|
18466
|
+
*/ const Hh = {
|
|
18467
|
+
maxAttempts: 5
|
|
18468
|
+
};
|
|
18469
|
+
|
|
18452
18470
|
/**
|
|
18453
18471
|
* @license
|
|
18454
18472
|
* Copyright 2020 Google LLC
|
|
@@ -18470,7 +18488,8 @@ function zh(t, e, n) {
|
|
|
18470
18488
|
* to the user.
|
|
18471
18489
|
*
|
|
18472
18490
|
* @internal
|
|
18473
|
-
*/
|
|
18491
|
+
*/
|
|
18492
|
+
class Jh {
|
|
18474
18493
|
convertValue(t, e = "none") {
|
|
18475
18494
|
switch (Mt(t)) {
|
|
18476
18495
|
case 0 /* NullValue */ :
|
|
@@ -18525,11 +18544,11 @@ function zh(t, e, n) {
|
|
|
18525
18544
|
convertServerTimestamp(t, e) {
|
|
18526
18545
|
switch (e) {
|
|
18527
18546
|
case "previous":
|
|
18528
|
-
const n =
|
|
18547
|
+
const n = bt(t);
|
|
18529
18548
|
return null == n ? null : this.convertValue(n, e);
|
|
18530
18549
|
|
|
18531
18550
|
case "estimate":
|
|
18532
|
-
return this.convertTimestamp(
|
|
18551
|
+
return this.convertTimestamp(Pt(t));
|
|
18533
18552
|
|
|
18534
18553
|
default:
|
|
18535
18554
|
return null;
|
|
@@ -18574,7 +18593,7 @@ function zh(t, e, n) {
|
|
|
18574
18593
|
* because we want to provide the user with a more specific error message if
|
|
18575
18594
|
* their `set()` or fails due to invalid data originating from a `toFirestore()`
|
|
18576
18595
|
* call.
|
|
18577
|
-
*/ function
|
|
18596
|
+
*/ function Yh(t, e, n) {
|
|
18578
18597
|
let s;
|
|
18579
18598
|
// Cast to `any` in order to satisfy the union type constraint on
|
|
18580
18599
|
// toFirestore().
|
|
@@ -18583,7 +18602,7 @@ function zh(t, e, n) {
|
|
|
18583
18602
|
s;
|
|
18584
18603
|
}
|
|
18585
18604
|
|
|
18586
|
-
class
|
|
18605
|
+
class Xh extends Jh {
|
|
18587
18606
|
constructor(t) {
|
|
18588
18607
|
super(), this.firestore = t;
|
|
18589
18608
|
}
|
|
@@ -18619,7 +18638,7 @@ class Yh extends Hh {
|
|
|
18619
18638
|
* provides methods for adding writes to the write batch. None of the writes
|
|
18620
18639
|
* will be committed (or visible locally) until {@link WriteBatch.commit} is
|
|
18621
18640
|
* called.
|
|
18622
|
-
*/ class
|
|
18641
|
+
*/ class Zh {
|
|
18623
18642
|
/** @hideconstructor */
|
|
18624
18643
|
constructor(t, e) {
|
|
18625
18644
|
this._firestore = t, this._commitHandler = e, this._mutations = [], this._committed = !1,
|
|
@@ -18627,12 +18646,12 @@ class Yh extends Hh {
|
|
|
18627
18646
|
}
|
|
18628
18647
|
set(t, e, n) {
|
|
18629
18648
|
this._verifyNotCommitted();
|
|
18630
|
-
const s =
|
|
18649
|
+
const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, "WriteBatch.set", s._key, i, null !== s.converter, n);
|
|
18631
18650
|
return this._mutations.push(r.toMutation(s._key, An.none())), this;
|
|
18632
18651
|
}
|
|
18633
18652
|
update(t, e, n, ...s) {
|
|
18634
18653
|
this._verifyNotCommitted();
|
|
18635
|
-
const i =
|
|
18654
|
+
const i = tl(t, this._firestore);
|
|
18636
18655
|
// For Compat types, we have to "extract" the underlying types before
|
|
18637
18656
|
// performing validation.
|
|
18638
18657
|
let r;
|
|
@@ -18646,7 +18665,7 @@ class Yh extends Hh {
|
|
|
18646
18665
|
* @returns This `WriteBatch` instance. Used for chaining method calls.
|
|
18647
18666
|
*/ delete(t) {
|
|
18648
18667
|
this._verifyNotCommitted();
|
|
18649
|
-
const e =
|
|
18668
|
+
const e = tl(t, this._firestore);
|
|
18650
18669
|
return this._mutations = this._mutations.concat(new On(e._key, An.none())), this;
|
|
18651
18670
|
}
|
|
18652
18671
|
/**
|
|
@@ -18668,7 +18687,7 @@ class Yh extends Hh {
|
|
|
18668
18687
|
}
|
|
18669
18688
|
}
|
|
18670
18689
|
|
|
18671
|
-
function
|
|
18690
|
+
function tl(t, e) {
|
|
18672
18691
|
if ((t = getModularInstance(t)).firestore !== e) throw new Q(G.INVALID_ARGUMENT, "Provided document reference is from a different Firestore instance.");
|
|
18673
18692
|
return t;
|
|
18674
18693
|
}
|
|
@@ -18726,13 +18745,13 @@ function Zh(t, e) {
|
|
|
18726
18745
|
* @returns A Promise resolved with a `DocumentSnapshot` containing the
|
|
18727
18746
|
* current document contents.
|
|
18728
18747
|
*/
|
|
18729
|
-
function
|
|
18748
|
+
function el(t) {
|
|
18730
18749
|
t = hc(t, wc);
|
|
18731
18750
|
const e = hc(t.firestore, Vc);
|
|
18732
|
-
return Ya(Dc(e), t._key).then((n =>
|
|
18751
|
+
return Ya(Dc(e), t._key).then((n => wl(e, t, n)));
|
|
18733
18752
|
}
|
|
18734
18753
|
|
|
18735
|
-
class
|
|
18754
|
+
class nl extends Jh {
|
|
18736
18755
|
constructor(t) {
|
|
18737
18756
|
super(), this.firestore = t;
|
|
18738
18757
|
}
|
|
@@ -18751,9 +18770,9 @@ class el extends Hh {
|
|
|
18751
18770
|
*
|
|
18752
18771
|
* @returns A `Promise` resolved with a `DocumentSnapshot` containing the
|
|
18753
18772
|
* current document contents.
|
|
18754
|
-
*/ function
|
|
18773
|
+
*/ function sl(t) {
|
|
18755
18774
|
t = hc(t, wc);
|
|
18756
|
-
const e = hc(t.firestore, Vc), n = Dc(e), s = new
|
|
18775
|
+
const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);
|
|
18757
18776
|
return Ja(n, t._key).then((n => new Rh(e, s, t._key, n, new Ah(null !== n && n.hasLocalMutations,
|
|
18758
18777
|
/* fromCache= */ !0), t.converter)));
|
|
18759
18778
|
}
|
|
@@ -18764,12 +18783,12 @@ class el extends Hh {
|
|
|
18764
18783
|
*
|
|
18765
18784
|
* @returns A `Promise` resolved with a `DocumentSnapshot` containing the
|
|
18766
18785
|
* current document contents.
|
|
18767
|
-
*/ function
|
|
18786
|
+
*/ function il(t) {
|
|
18768
18787
|
t = hc(t, wc);
|
|
18769
18788
|
const e = hc(t.firestore, Vc);
|
|
18770
18789
|
return Ya(Dc(e), t._key, {
|
|
18771
18790
|
source: "server"
|
|
18772
|
-
}).then((n =>
|
|
18791
|
+
}).then((n => wl(e, t, n)));
|
|
18773
18792
|
}
|
|
18774
18793
|
|
|
18775
18794
|
/**
|
|
@@ -18781,10 +18800,10 @@ class el extends Hh {
|
|
|
18781
18800
|
* invoke {@link getDocsFromCache} or {@link getDocsFromServer}.
|
|
18782
18801
|
*
|
|
18783
18802
|
* @returns A `Promise` that will be resolved with the results of the query.
|
|
18784
|
-
*/ function
|
|
18803
|
+
*/ function rl(t) {
|
|
18785
18804
|
t = hc(t, mc);
|
|
18786
|
-
const e = hc(t.firestore, Vc), n = Dc(e), s = new
|
|
18787
|
-
return Sh(t._query), Za(n, t._query).then((n => new
|
|
18805
|
+
const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);
|
|
18806
|
+
return Sh(t._query), Za(n, t._query).then((n => new Ph(e, s, t, n)));
|
|
18788
18807
|
}
|
|
18789
18808
|
|
|
18790
18809
|
/**
|
|
@@ -18792,10 +18811,10 @@ class el extends Hh {
|
|
|
18792
18811
|
* Returns an error if the document is not currently cached.
|
|
18793
18812
|
*
|
|
18794
18813
|
* @returns A `Promise` that will be resolved with the results of the query.
|
|
18795
|
-
*/ function
|
|
18814
|
+
*/ function ol(t) {
|
|
18796
18815
|
t = hc(t, mc);
|
|
18797
|
-
const e = hc(t.firestore, Vc), n = Dc(e), s = new
|
|
18798
|
-
return Xa(n, t._query).then((n => new
|
|
18816
|
+
const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);
|
|
18817
|
+
return Xa(n, t._query).then((n => new Ph(e, s, t, n)));
|
|
18799
18818
|
}
|
|
18800
18819
|
|
|
18801
18820
|
/**
|
|
@@ -18803,21 +18822,21 @@ class el extends Hh {
|
|
|
18803
18822
|
* server. Returns an error if the network is not available.
|
|
18804
18823
|
*
|
|
18805
18824
|
* @returns A `Promise` that will be resolved with the results of the query.
|
|
18806
|
-
*/ function
|
|
18825
|
+
*/ function ul(t) {
|
|
18807
18826
|
t = hc(t, mc);
|
|
18808
|
-
const e = hc(t.firestore, Vc), n = Dc(e), s = new
|
|
18827
|
+
const e = hc(t.firestore, Vc), n = Dc(e), s = new nl(e);
|
|
18809
18828
|
return Za(n, t._query, {
|
|
18810
18829
|
source: "server"
|
|
18811
|
-
}).then((n => new
|
|
18830
|
+
}).then((n => new Ph(e, s, t, n)));
|
|
18812
18831
|
}
|
|
18813
18832
|
|
|
18814
|
-
function
|
|
18833
|
+
function al(t, e, n) {
|
|
18815
18834
|
t = hc(t, wc);
|
|
18816
|
-
const s = hc(t.firestore, Vc), i =
|
|
18817
|
-
return
|
|
18835
|
+
const s = hc(t.firestore, Vc), i = Yh(t.converter, e, n);
|
|
18836
|
+
return _l(s, [ eh(th(s), "setDoc", t._key, i, null !== t.converter, n).toMutation(t._key, An.none()) ]);
|
|
18818
18837
|
}
|
|
18819
18838
|
|
|
18820
|
-
function
|
|
18839
|
+
function cl(t, e, n, ...s) {
|
|
18821
18840
|
t = hc(t, wc);
|
|
18822
18841
|
const i = hc(t.firestore, Vc), r = th(i);
|
|
18823
18842
|
let o;
|
|
@@ -18825,7 +18844,7 @@ function al(t, e, n, ...s) {
|
|
|
18825
18844
|
// For Compat types, we have to "extract" the underlying types before
|
|
18826
18845
|
// performing validation.
|
|
18827
18846
|
e = getModularInstance(e)) || e instanceof Kc ? ch(r, "updateDoc", t._key, e, n, s) : ah(r, "updateDoc", t._key, e);
|
|
18828
|
-
return
|
|
18847
|
+
return _l(i, [ o.toMutation(t._key, An.exists(!0)) ]);
|
|
18829
18848
|
}
|
|
18830
18849
|
|
|
18831
18850
|
/**
|
|
@@ -18834,8 +18853,8 @@ function al(t, e, n, ...s) {
|
|
|
18834
18853
|
* @param reference - A reference to the document to delete.
|
|
18835
18854
|
* @returns A Promise resolved once the document has been successfully
|
|
18836
18855
|
* deleted from the backend (note that it won't resolve while you're offline).
|
|
18837
|
-
*/ function
|
|
18838
|
-
return
|
|
18856
|
+
*/ function hl(t) {
|
|
18857
|
+
return _l(hc(t.firestore, Vc), [ new On(t._key, An.none()) ]);
|
|
18839
18858
|
}
|
|
18840
18859
|
|
|
18841
18860
|
/**
|
|
@@ -18847,12 +18866,12 @@ function al(t, e, n, ...s) {
|
|
|
18847
18866
|
* @returns A `Promise` resolved with a `DocumentReference` pointing to the
|
|
18848
18867
|
* newly created document after it has been written to the backend (Note that it
|
|
18849
18868
|
* won't resolve while you're offline).
|
|
18850
|
-
*/ function
|
|
18851
|
-
const n = hc(t.firestore, Vc), s = Ic(t), i =
|
|
18852
|
-
return
|
|
18869
|
+
*/ function ll(t, e) {
|
|
18870
|
+
const n = hc(t.firestore, Vc), s = Ic(t), i = Yh(t.converter, e);
|
|
18871
|
+
return _l(n, [ eh(th(t.firestore), "addDoc", s._key, i, null !== t.converter, {}).toMutation(s._key, An.exists(!1)) ]).then((() => s));
|
|
18853
18872
|
}
|
|
18854
18873
|
|
|
18855
|
-
function
|
|
18874
|
+
function fl(t, ...e) {
|
|
18856
18875
|
var n, s, i;
|
|
18857
18876
|
t = getModularInstance(t);
|
|
18858
18877
|
let r = {
|
|
@@ -18870,17 +18889,17 @@ function ll(t, ...e) {
|
|
|
18870
18889
|
let a, c, h;
|
|
18871
18890
|
if (t instanceof wc) c = hc(t.firestore, Vc), h = Ke(t._key.path), a = {
|
|
18872
18891
|
next: n => {
|
|
18873
|
-
e[o] && e[o](
|
|
18892
|
+
e[o] && e[o](wl(c, t, n));
|
|
18874
18893
|
},
|
|
18875
18894
|
error: e[o + 1],
|
|
18876
18895
|
complete: e[o + 2]
|
|
18877
18896
|
}; else {
|
|
18878
18897
|
const n = hc(t, mc);
|
|
18879
18898
|
c = hc(n.firestore, Vc), h = n._query;
|
|
18880
|
-
const s = new
|
|
18899
|
+
const s = new nl(c);
|
|
18881
18900
|
a = {
|
|
18882
18901
|
next: t => {
|
|
18883
|
-
e[o] && e[o](new
|
|
18902
|
+
e[o] && e[o](new Ph(c, s, n, t));
|
|
18884
18903
|
},
|
|
18885
18904
|
error: e[o + 1],
|
|
18886
18905
|
complete: e[o + 2]
|
|
@@ -18894,7 +18913,7 @@ function ll(t, ...e) {
|
|
|
18894
18913
|
}(Dc(c), h, u, a);
|
|
18895
18914
|
}
|
|
18896
18915
|
|
|
18897
|
-
function
|
|
18916
|
+
function dl(t, e) {
|
|
18898
18917
|
return tc(Dc(t = hc(t, Vc)), Rc(e) ? e : {
|
|
18899
18918
|
next: e
|
|
18900
18919
|
});
|
|
@@ -18903,7 +18922,7 @@ function fl(t, e) {
|
|
|
18903
18922
|
/**
|
|
18904
18923
|
* Locally writes `mutations` on the async queue.
|
|
18905
18924
|
* @internal
|
|
18906
|
-
*/ function
|
|
18925
|
+
*/ function _l(t, e) {
|
|
18907
18926
|
return function(t, e) {
|
|
18908
18927
|
const n = new j;
|
|
18909
18928
|
return t.asyncQueue.enqueueAndForget((async () => ta(await ja(t), e, n))), n.promise;
|
|
@@ -18913,8 +18932,8 @@ function fl(t, e) {
|
|
|
18913
18932
|
/**
|
|
18914
18933
|
* Converts a {@link ViewSnapshot} that contains the single document specified by `ref`
|
|
18915
18934
|
* to a {@link DocumentSnapshot}.
|
|
18916
|
-
*/ function
|
|
18917
|
-
const s = n.docs.get(e._key), i = new
|
|
18935
|
+
*/ function wl(t, e, n) {
|
|
18936
|
+
const s = n.docs.get(e._key), i = new nl(t);
|
|
18918
18937
|
return new Rh(t, i, e._key, s, new Ah(n.hasPendingWrites, n.fromCache), e.converter);
|
|
18919
18938
|
}
|
|
18920
18939
|
|
|
@@ -18940,7 +18959,7 @@ function fl(t, e) {
|
|
|
18940
18959
|
* The `Transaction` object passed to a transaction's `updateFunction` provides
|
|
18941
18960
|
* the methods to read and write data within the transaction context. See
|
|
18942
18961
|
* {@link runTransaction}.
|
|
18943
|
-
*/ class
|
|
18962
|
+
*/ class ml extends class {
|
|
18944
18963
|
/** @hideconstructor */
|
|
18945
18964
|
constructor(t, e) {
|
|
18946
18965
|
this._firestore = t, this._transaction = e, this._dataReader = th(t);
|
|
@@ -18951,7 +18970,7 @@ function fl(t, e) {
|
|
|
18951
18970
|
* @param documentRef - A reference to the document to be read.
|
|
18952
18971
|
* @returns A `DocumentSnapshot` with the read data.
|
|
18953
18972
|
*/ get(t) {
|
|
18954
|
-
const e =
|
|
18973
|
+
const e = tl(t, this._firestore), n = new Xh(this._firestore);
|
|
18955
18974
|
return this._transaction.lookup([ e._key ]).then((t => {
|
|
18956
18975
|
if (!t || 1 !== t.length) return L();
|
|
18957
18976
|
const s = t[0];
|
|
@@ -18961,11 +18980,11 @@ function fl(t, e) {
|
|
|
18961
18980
|
}));
|
|
18962
18981
|
}
|
|
18963
18982
|
set(t, e, n) {
|
|
18964
|
-
const s =
|
|
18983
|
+
const s = tl(t, this._firestore), i = Yh(s.converter, e, n), r = eh(this._dataReader, "Transaction.set", s._key, i, null !== s.converter, n);
|
|
18965
18984
|
return this._transaction.set(s._key, r), this;
|
|
18966
18985
|
}
|
|
18967
18986
|
update(t, e, n, ...s) {
|
|
18968
|
-
const i =
|
|
18987
|
+
const i = tl(t, this._firestore);
|
|
18969
18988
|
// For Compat types, we have to "extract" the underlying types before
|
|
18970
18989
|
// performing validation.
|
|
18971
18990
|
let r;
|
|
@@ -18978,7 +18997,7 @@ function fl(t, e) {
|
|
|
18978
18997
|
* @param documentRef - A reference to the document to be deleted.
|
|
18979
18998
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
18980
18999
|
*/ delete(t) {
|
|
18981
|
-
const e =
|
|
19000
|
+
const e = tl(t, this._firestore);
|
|
18982
19001
|
return this._transaction.delete(e._key), this;
|
|
18983
19002
|
}
|
|
18984
19003
|
} {
|
|
@@ -18994,7 +19013,7 @@ function fl(t, e) {
|
|
|
18994
19013
|
* @param documentRef - A reference to the document to be read.
|
|
18995
19014
|
* @returns A `DocumentSnapshot` with the read data.
|
|
18996
19015
|
*/ get(t) {
|
|
18997
|
-
const e =
|
|
19016
|
+
const e = tl(t, this._firestore), n = new nl(this._firestore);
|
|
18998
19017
|
return super.get(t).then((t => new Rh(this._firestore, n, e._key, t._document, new Ah(
|
|
18999
19018
|
/* hasPendingWrites= */ !1,
|
|
19000
19019
|
/* fromCache= */ !1), e.converter)));
|
|
@@ -19017,8 +19036,13 @@ function fl(t, e) {
|
|
|
19017
19036
|
* (the `updateFunction` returned a failed promise), the promise returned by the
|
|
19018
19037
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
19019
19038
|
* rejected promise with the corresponding failure error is returned.
|
|
19020
|
-
*/ function
|
|
19021
|
-
|
|
19039
|
+
*/ function gl(t, e, n) {
|
|
19040
|
+
t = hc(t, Vc);
|
|
19041
|
+
const s = Object.assign(Object.assign({}, Hh), n);
|
|
19042
|
+
!function(t) {
|
|
19043
|
+
if (t.maxAttempts < 1) throw new Q(G.INVALID_ARGUMENT, "Max attempts must be at least 1");
|
|
19044
|
+
}(s);
|
|
19045
|
+
return ec(Dc(t), (n => e(new ml(t, n))), s);
|
|
19022
19046
|
}
|
|
19023
19047
|
|
|
19024
19048
|
/**
|
|
@@ -19040,14 +19064,14 @@ function fl(t, e) {
|
|
|
19040
19064
|
/**
|
|
19041
19065
|
* Returns a sentinel for use with {@link @firebase/firestore/lite#(updateDoc:1)} or
|
|
19042
19066
|
* {@link @firebase/firestore/lite#(setDoc:1)} with `{merge: true}` to mark a field for deletion.
|
|
19043
|
-
*/ function
|
|
19067
|
+
*/ function yl() {
|
|
19044
19068
|
return new nh("deleteField");
|
|
19045
19069
|
}
|
|
19046
19070
|
|
|
19047
19071
|
/**
|
|
19048
19072
|
* Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
|
|
19049
19073
|
* include a server-generated timestamp in the written data.
|
|
19050
|
-
*/ function
|
|
19074
|
+
*/ function pl() {
|
|
19051
19075
|
return new ih("serverTimestamp");
|
|
19052
19076
|
}
|
|
19053
19077
|
|
|
@@ -19062,7 +19086,7 @@ function fl(t, e) {
|
|
|
19062
19086
|
* @param elements - The elements to union into the array.
|
|
19063
19087
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
19064
19088
|
* `updateDoc()`.
|
|
19065
|
-
*/ function
|
|
19089
|
+
*/ function Il(...t) {
|
|
19066
19090
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
19067
19091
|
// update() since we'd need the Firestore instance to do this.
|
|
19068
19092
|
return new rh("arrayUnion", t);
|
|
@@ -19078,7 +19102,7 @@ function fl(t, e) {
|
|
|
19078
19102
|
* @param elements - The elements to remove from the array.
|
|
19079
19103
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
19080
19104
|
* `updateDoc()`
|
|
19081
|
-
*/ function
|
|
19105
|
+
*/ function Tl(...t) {
|
|
19082
19106
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
19083
19107
|
// update() since we'd need the Firestore instance to do this.
|
|
19084
19108
|
return new oh("arrayRemove", t);
|
|
@@ -19102,7 +19126,7 @@ function fl(t, e) {
|
|
|
19102
19126
|
* @param n - The value to increment by.
|
|
19103
19127
|
* @returns The `FieldValue` sentinel for use in a call to `setDoc()` or
|
|
19104
19128
|
* `updateDoc()`
|
|
19105
|
-
*/ function
|
|
19129
|
+
*/ function El(t) {
|
|
19106
19130
|
return new uh("increment", t);
|
|
19107
19131
|
}
|
|
19108
19132
|
|
|
@@ -19132,8 +19156,8 @@ function fl(t, e) {
|
|
|
19132
19156
|
*
|
|
19133
19157
|
* @returns A {@link WriteBatch} that can be used to atomically execute multiple
|
|
19134
19158
|
* writes.
|
|
19135
|
-
*/ function
|
|
19136
|
-
return Dc(t = hc(t, Vc)), new
|
|
19159
|
+
*/ function Al(t) {
|
|
19160
|
+
return Dc(t = hc(t, Vc)), new Zh(t, (e => _l(t, e)));
|
|
19137
19161
|
}
|
|
19138
19162
|
|
|
19139
19163
|
/**
|
|
@@ -19151,7 +19175,7 @@ function fl(t, e) {
|
|
|
19151
19175
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19152
19176
|
* See the License for the specific language governing permissions and
|
|
19153
19177
|
* limitations under the License.
|
|
19154
|
-
*/ function
|
|
19178
|
+
*/ function Rl(t, e) {
|
|
19155
19179
|
Dc(t = hc(t, Vc));
|
|
19156
19180
|
const n = "string" == typeof e ? function(t) {
|
|
19157
19181
|
try {
|
|
@@ -19163,9 +19187,9 @@ function fl(t, e) {
|
|
|
19163
19187
|
// PORTING NOTE: We don't return an error if the user has not enabled
|
|
19164
19188
|
// persistence since `enableIndexeddbPersistence()` can fail on the Web.
|
|
19165
19189
|
if (Array.isArray(n.indexes)) for (const t of n.indexes) {
|
|
19166
|
-
const e =
|
|
19190
|
+
const e = bl(t, "collectionGroup"), n = [];
|
|
19167
19191
|
if (Array.isArray(t.fields)) for (const e of t.fields) {
|
|
19168
|
-
const t = gh("setIndexConfiguration",
|
|
19192
|
+
const t = gh("setIndexConfiguration", bl(e, "fieldPath"));
|
|
19169
19193
|
"CONTAINS" === e.arrayConfig ? n.push(new oe(t, 2 /* CONTAINS */)) : "ASCENDING" === e.order ? n.push(new oe(t, 0 /* ASCENDING */)) : "DESCENDING" === e.order && n.push(new oe(t, 1 /* DESCENDING */));
|
|
19170
19194
|
}
|
|
19171
19195
|
s.push(new se(se.UNKNOWN_ID, e, n, ue.empty()));
|
|
@@ -19174,7 +19198,7 @@ function fl(t, e) {
|
|
|
19174
19198
|
return Promise.resolve();
|
|
19175
19199
|
}
|
|
19176
19200
|
|
|
19177
|
-
function
|
|
19201
|
+
function bl(t, e) {
|
|
19178
19202
|
if ("string" != typeof t[e]) throw new Q(G.INVALID_ARGUMENT, "Missing string value for: " + e);
|
|
19179
19203
|
return t[e];
|
|
19180
19204
|
}
|
|
@@ -19191,10 +19215,10 @@ function Rl(t, e) {
|
|
|
19191
19215
|
return n = Object.assign({
|
|
19192
19216
|
useFetchStreams: e
|
|
19193
19217
|
}, n), i._setSettings(n), i;
|
|
19194
|
-
}), "PUBLIC")), registerVersion(D, "3.4.8-canary.
|
|
19218
|
+
}), "PUBLIC")), registerVersion(D, "3.4.8-canary.63caee2a5", t),
|
|
19195
19219
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
19196
|
-
registerVersion(D, "3.4.8-canary.
|
|
19220
|
+
registerVersion(D, "3.4.8-canary.63caee2a5", "esm2017");
|
|
19197
19221
|
}();
|
|
19198
19222
|
|
|
19199
|
-
export {
|
|
19223
|
+
export { Jh as AbstractUserDataWriter, Qc as Bytes, Pc as CACHE_SIZE_UNLIMITED, gc as CollectionReference, wc as DocumentReference, Rh as DocumentSnapshot, Kc as FieldPath, jc as FieldValue, Vc as Firestore, Q as FirestoreError, Wc as GeoPoint, bc as LoadBundleTask, mc as Query, Dh as QueryConstraint, bh as QueryDocumentSnapshot, Ph as QuerySnapshot, Ah as SnapshotMetadata, at as Timestamp, ml as Transaction, Zh as WriteBatch, vt as _DatabaseId, xt as _DocumentKey, et as _EmptyAppCheckTokenProvider, z as _EmptyAuthCredentialsProvider, mt as _FieldPath, hc as _cast, q as _debugAssert, yt as _isBase64Available, $ as _logWarn, Rl as _setIndexConfiguration, oc as _validateIsNotUsedTogether, ll as addDoc, Tl as arrayRemove, Il as arrayUnion, Mc as clearIndexedDbPersistence, yc as collection, pc as collectionGroup, _c as connectFirestoreEmulator, hl as deleteDoc, yl as deleteField, $c as disableNetwork, Ic as doc, Gc as documentId, xc as enableIndexedDbPersistence, Nc as enableMultiTabIndexedDbPersistence, Fc as enableNetwork, Gh as endAt, Kh as endBefore, Dc as ensureFirestoreConfigured, _l as executeWrite, el as getDoc, sl as getDocFromCache, il as getDocFromServer, rl as getDocs, ol as getDocsFromCache, ul as getDocsFromServer, Sc as getFirestore, El as increment, vc as initializeFirestore, Fh as limit, $h as limitToLast, Lc as loadBundle, Uc as namedQuery, fl as onSnapshot, dl as onSnapshotsInSync, Mh as orderBy, Ch as query, Ec as queryEqual, Tc as refEqual, gl as runTransaction, pl as serverTimestamp, al as setDoc, M as setLogLevel, vh as snapshotEqual, Uh as startAfter, Lh as startAt, Bc as terminate, cl as updateDoc, Oc as waitForPendingWrites, Nh as where, Al as writeBatch };
|
|
19200
19224
|
//# sourceMappingURL=index.esm2017.js.map
|