@firebase/firestore 3.4.2 → 3.4.3-canary.1b246ae04
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/CHANGELOG.md +8 -0
- package/dist/firestore/src/api/snapshot.d.ts +6 -6
- package/dist/firestore/src/lite-api/snapshot.d.ts +2 -2
- package/dist/firestore/test/integration/bootstrap.d.ts +0 -1
- package/dist/firestore/test/integration/util/events_accumulator.d.ts +2 -2
- package/dist/firestore/test/integration/util/firebase_export.d.ts +6 -14
- package/dist/firestore/test/integration/util/helpers.d.ts +18 -18
- package/dist/firestore/test/integration/util/internal_helpers.d.ts +3 -3
- package/dist/firestore/test/integration/util/settings.d.ts +2 -2
- package/dist/firestore/test/unit/api/{blob.test.d.ts → bytes.test.d.ts} +0 -0
- package/dist/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/firestore/test/util/helpers.d.ts +4 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.esm2017.js +227 -227
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +202 -202
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +2674 -24
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +2675 -25
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +1068 -1068
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +8 -8
- package/dist/lite/firestore/src/api/snapshot.d.ts +6 -6
- package/dist/lite/firestore/src/lite-api/snapshot.d.ts +2 -2
- package/dist/lite/firestore/test/integration/bootstrap.d.ts +0 -1
- package/dist/lite/firestore/test/integration/util/events_accumulator.d.ts +2 -2
- package/dist/lite/firestore/test/integration/util/firebase_export.d.ts +6 -14
- package/dist/lite/firestore/test/integration/util/helpers.d.ts +18 -18
- package/dist/lite/firestore/test/integration/util/internal_helpers.d.ts +3 -3
- package/dist/lite/firestore/test/integration/util/settings.d.ts +2 -2
- package/dist/lite/firestore/test/unit/api/{blob.test.d.ts → bytes.test.d.ts} +0 -0
- package/dist/lite/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/lite/firestore/test/util/helpers.d.ts +4 -6
- package/dist/lite/index.browser.esm2017.js +1149 -1149
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +111 -111
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.d.ts +2 -2
- package/dist/lite/index.node.cjs.js +11 -12
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +11 -12
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +222 -222
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +2 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +110 -110
- package/dist/lite/packages/firestore/src/api/snapshot.d.ts +6 -6
- package/dist/lite/packages/firestore/src/lite-api/snapshot.d.ts +2 -2
- package/dist/lite/packages/firestore/test/integration/bootstrap.d.ts +0 -1
- package/dist/lite/packages/firestore/test/integration/util/events_accumulator.d.ts +2 -2
- package/dist/lite/packages/firestore/test/integration/util/firebase_export.d.ts +6 -14
- package/dist/lite/packages/firestore/test/integration/util/helpers.d.ts +18 -18
- package/dist/lite/packages/firestore/test/integration/util/internal_helpers.d.ts +3 -3
- package/dist/lite/packages/firestore/test/integration/util/settings.d.ts +2 -2
- package/dist/lite/packages/firestore/test/unit/api/{blob.test.d.ts → bytes.test.d.ts} +0 -0
- package/dist/lite/packages/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +4 -6
- package/dist/lite/private.d.ts +2 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +13 -13
- package/dist/packages/firestore/src/api/snapshot.d.ts +6 -6
- package/dist/packages/firestore/src/lite-api/snapshot.d.ts +2 -2
- package/dist/packages/firestore/test/integration/bootstrap.d.ts +0 -1
- package/dist/packages/firestore/test/integration/util/events_accumulator.d.ts +2 -2
- package/dist/packages/firestore/test/integration/util/firebase_export.d.ts +6 -14
- package/dist/packages/firestore/test/integration/util/helpers.d.ts +18 -18
- package/dist/packages/firestore/test/integration/util/internal_helpers.d.ts +3 -3
- package/dist/packages/firestore/test/integration/util/settings.d.ts +2 -2
- package/dist/packages/firestore/test/unit/api/{blob.test.d.ts → bytes.test.d.ts} +0 -0
- package/dist/packages/firestore/test/util/api_helpers.d.ts +1 -1
- package/dist/packages/firestore/test/util/helpers.d.ts +4 -6
- package/dist/private.d.ts +8 -8
- package/package.json +10 -13
- package/dist/firestore/compat/api/blob.d.ts +0 -29
- package/dist/firestore/compat/api/database.d.ts +0 -228
- package/dist/firestore/compat/api/field_path.d.ts +0 -36
- package/dist/firestore/compat/api/field_value.d.ts +0 -29
- package/dist/firestore/compat/api/geo_point.d.ts +0 -17
- package/dist/firestore/compat/api/observer.d.ts +0 -29
- package/dist/firestore/compat/api/timestamp.d.ts +0 -17
- package/dist/firestore/compat/config.d.ts +0 -28
- package/dist/firestore/compat/index.console.d.ts +0 -42
- package/dist/firestore/compat/index.d.ts +0 -49
- package/dist/firestore/compat/index.node.d.ts +0 -22
- package/dist/firestore/compat/index.rn.d.ts +0 -22
- package/dist/firestore/compat/register-module.d.ts +0 -42
- package/dist/firestore/compat/util/input_validation.d.ts +0 -18
- package/dist/lite/firestore/compat/api/blob.d.ts +0 -29
- package/dist/lite/firestore/compat/api/database.d.ts +0 -228
- package/dist/lite/firestore/compat/api/field_path.d.ts +0 -36
- package/dist/lite/firestore/compat/api/field_value.d.ts +0 -29
- package/dist/lite/firestore/compat/api/geo_point.d.ts +0 -17
- package/dist/lite/firestore/compat/api/observer.d.ts +0 -29
- package/dist/lite/firestore/compat/api/timestamp.d.ts +0 -17
- package/dist/lite/firestore/compat/config.d.ts +0 -28
- package/dist/lite/firestore/compat/index.console.d.ts +0 -42
- package/dist/lite/firestore/compat/index.d.ts +0 -49
- package/dist/lite/firestore/compat/index.node.d.ts +0 -22
- package/dist/lite/firestore/compat/index.rn.d.ts +0 -22
- package/dist/lite/firestore/compat/register-module.d.ts +0 -42
- package/dist/lite/firestore/compat/util/input_validation.d.ts +0 -18
- package/dist/lite/packages/firestore/compat/api/blob.d.ts +0 -29
- package/dist/lite/packages/firestore/compat/api/database.d.ts +0 -228
- package/dist/lite/packages/firestore/compat/api/field_path.d.ts +0 -36
- package/dist/lite/packages/firestore/compat/api/field_value.d.ts +0 -29
- package/dist/lite/packages/firestore/compat/api/geo_point.d.ts +0 -17
- package/dist/lite/packages/firestore/compat/api/observer.d.ts +0 -29
- package/dist/lite/packages/firestore/compat/api/timestamp.d.ts +0 -17
- package/dist/lite/packages/firestore/compat/config.d.ts +0 -28
- package/dist/lite/packages/firestore/compat/index.console.d.ts +0 -42
- package/dist/lite/packages/firestore/compat/index.d.ts +0 -49
- package/dist/lite/packages/firestore/compat/index.node.d.ts +0 -22
- package/dist/lite/packages/firestore/compat/index.rn.d.ts +0 -22
- package/dist/lite/packages/firestore/compat/register-module.d.ts +0 -42
- package/dist/lite/packages/firestore/compat/util/input_validation.d.ts +0 -18
- package/dist/lite/src/protos/README.md +0 -2
- package/dist/lite/src/protos/firestore/bundle.proto +0 -121
- package/dist/lite/src/protos/firestore_bundle_proto.ts +0 -93
- package/dist/lite/src/protos/firestore_proto_api.ts +0 -1259
- package/dist/lite/src/protos/google/api/annotations.proto +0 -31
- package/dist/lite/src/protos/google/api/http.proto +0 -370
- package/dist/lite/src/protos/google/firestore/v1/common.proto +0 -84
- package/dist/lite/src/protos/google/firestore/v1/document.proto +0 -151
- package/dist/lite/src/protos/google/firestore/v1/firestore.proto +0 -761
- package/dist/lite/src/protos/google/firestore/v1/query.proto +0 -302
- package/dist/lite/src/protos/google/firestore/v1/write.proto +0 -264
- package/dist/lite/src/protos/google/protobuf/any.proto +0 -155
- package/dist/lite/src/protos/google/protobuf/descriptor.proto +0 -882
- package/dist/lite/src/protos/google/protobuf/empty.proto +0 -52
- package/dist/lite/src/protos/google/protobuf/struct.proto +0 -96
- package/dist/lite/src/protos/google/protobuf/timestamp.proto +0 -137
- package/dist/lite/src/protos/google/protobuf/wrappers.proto +0 -123
- package/dist/lite/src/protos/google/rpc/status.proto +0 -92
- package/dist/lite/src/protos/google/type/latlng.proto +0 -71
- package/dist/lite/src/protos/update.sh +0 -61
- package/dist/packages/firestore/compat/api/blob.d.ts +0 -29
- package/dist/packages/firestore/compat/api/database.d.ts +0 -228
- package/dist/packages/firestore/compat/api/field_path.d.ts +0 -36
- package/dist/packages/firestore/compat/api/field_value.d.ts +0 -29
- package/dist/packages/firestore/compat/api/geo_point.d.ts +0 -17
- package/dist/packages/firestore/compat/api/observer.d.ts +0 -29
- package/dist/packages/firestore/compat/api/timestamp.d.ts +0 -17
- package/dist/packages/firestore/compat/config.d.ts +0 -28
- package/dist/packages/firestore/compat/index.console.d.ts +0 -42
- package/dist/packages/firestore/compat/index.d.ts +0 -49
- package/dist/packages/firestore/compat/index.node.d.ts +0 -22
- package/dist/packages/firestore/compat/index.rn.d.ts +0 -22
- package/dist/packages/firestore/compat/register-module.d.ts +0 -42
- package/dist/packages/firestore/compat/util/input_validation.d.ts +0 -18
- package/dist/src/protos/README.md +0 -2
- package/dist/src/protos/firestore/bundle.proto +0 -121
- package/dist/src/protos/firestore_bundle_proto.ts +0 -93
- package/dist/src/protos/firestore_proto_api.ts +0 -1259
- package/dist/src/protos/google/api/annotations.proto +0 -31
- package/dist/src/protos/google/api/http.proto +0 -370
- package/dist/src/protos/google/firestore/v1/common.proto +0 -84
- package/dist/src/protos/google/firestore/v1/document.proto +0 -151
- package/dist/src/protos/google/firestore/v1/firestore.proto +0 -761
- package/dist/src/protos/google/firestore/v1/query.proto +0 -302
- package/dist/src/protos/google/firestore/v1/write.proto +0 -264
- package/dist/src/protos/google/protobuf/any.proto +0 -155
- package/dist/src/protos/google/protobuf/descriptor.proto +0 -882
- package/dist/src/protos/google/protobuf/empty.proto +0 -52
- package/dist/src/protos/google/protobuf/struct.proto +0 -96
- package/dist/src/protos/google/protobuf/timestamp.proto +0 -137
- package/dist/src/protos/google/protobuf/wrappers.proto +0 -123
- package/dist/src/protos/google/rpc/status.proto +0 -92
- package/dist/src/protos/google/type/latlng.proto +0 -71
- package/dist/src/protos/update.sh +0 -61
package/dist/index.esm5.js
CHANGED
|
@@ -70,7 +70,7 @@ O.MOCK_USER = new O("mock-user");
|
|
|
70
70
|
* See the License for the specific language governing permissions and
|
|
71
71
|
* limitations under the License.
|
|
72
72
|
*/
|
|
73
|
-
var
|
|
73
|
+
var M = "9.6.3-canary.1b246ae04", F = new h("@firebase/firestore");
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* @license
|
|
@@ -90,7 +90,7 @@ var F = "9.6.2", M = new h("@firebase/firestore");
|
|
|
90
90
|
*/
|
|
91
91
|
// Helper methods are needed because variables can't be exported as read/write
|
|
92
92
|
function V() {
|
|
93
|
-
return
|
|
93
|
+
return F.logLevel;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
/**
|
|
@@ -106,22 +106,22 @@ function V() {
|
|
|
106
106
|
* <li><code>`silent` to turn off logging.</li>
|
|
107
107
|
* </ul>
|
|
108
108
|
*/ function q(t) {
|
|
109
|
-
|
|
109
|
+
F.setLogLevel(t);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
function U(t) {
|
|
113
113
|
for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];
|
|
114
|
-
if (
|
|
114
|
+
if (F.logLevel <= f.DEBUG) {
|
|
115
115
|
var i = n.map(K);
|
|
116
|
-
|
|
116
|
+
F.debug.apply(F, e([ "Firestore (" + M + "): " + t ], i));
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
function B(t) {
|
|
121
121
|
for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];
|
|
122
|
-
if (
|
|
122
|
+
if (F.logLevel <= f.ERROR) {
|
|
123
123
|
var i = n.map(K);
|
|
124
|
-
|
|
124
|
+
F.error.apply(F, e([ "Firestore (" + M + "): " + t ], i));
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
@@ -129,9 +129,9 @@ function B(t) {
|
|
|
129
129
|
* @internal
|
|
130
130
|
*/ function j(t) {
|
|
131
131
|
for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];
|
|
132
|
-
if (
|
|
132
|
+
if (F.logLevel <= f.WARN) {
|
|
133
133
|
var i = n.map(K);
|
|
134
|
-
|
|
134
|
+
F.warn.apply(F, e([ "Firestore (" + M + "): " + t ], i));
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
|
|
@@ -191,7 +191,7 @@ function B(t) {
|
|
|
191
191
|
void 0 === t && (t = "Unexpected state");
|
|
192
192
|
// Log the failure in addition to throw an exception, just in case the
|
|
193
193
|
// exception is swallowed.
|
|
194
|
-
var e = "FIRESTORE (" +
|
|
194
|
+
var e = "FIRESTORE (" + M + ") INTERNAL ASSERTION FAILED: " + t;
|
|
195
195
|
// NOTE: We don't use FirestoreError here because these are internal failures
|
|
196
196
|
// that cannot be handled by the user. (Also it would create a circular
|
|
197
197
|
// dependency between the error and assert modules which doesn't work.)
|
|
@@ -1384,7 +1384,7 @@ var St = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1384
1384
|
return "nullValue" in t ? 0 /* NullValue */ : "booleanValue" in t ? 1 /* BooleanValue */ : "integerValue" in t || "doubleValue" in t ? 2 /* NumberValue */ : "timestampValue" in t ? 3 /* TimestampValue */ : "stringValue" in t ? 5 /* StringValue */ : "bytesValue" in t ? 6 /* BlobValue */ : "referenceValue" in t ? 7 /* RefValue */ : "geoPointValue" in t ? 8 /* GeoPointValue */ : "arrayValue" in t ? 9 /* ArrayValue */ : "mapValue" in t ? Dt(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : G();
|
|
1385
1385
|
}
|
|
1386
1386
|
|
|
1387
|
-
/** Tests `left` and `right` for equality based on the backend semantics. */ function
|
|
1387
|
+
/** Tests `left` and `right` for equality based on the backend semantics. */ function Mt(t, e) {
|
|
1388
1388
|
if (t === e) return !0;
|
|
1389
1389
|
var n = Ot(t);
|
|
1390
1390
|
if (n !== Ot(e)) return !1;
|
|
@@ -1434,13 +1434,13 @@ var St = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1434
1434
|
}(t, e);
|
|
1435
1435
|
|
|
1436
1436
|
case 9 /* ArrayValue */ :
|
|
1437
|
-
return ht(t.arrayValue.values || [], e.arrayValue.values || [],
|
|
1437
|
+
return ht(t.arrayValue.values || [], e.arrayValue.values || [], Mt);
|
|
1438
1438
|
|
|
1439
1439
|
case 10 /* ObjectValue */ :
|
|
1440
1440
|
return function(t, e) {
|
|
1441
1441
|
var n = t.mapValue.fields || {}, r = e.mapValue.fields || {};
|
|
1442
1442
|
if (pt(n) !== pt(r)) return !1;
|
|
1443
|
-
for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !
|
|
1443
|
+
for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !Mt(n[i], r[i]))) return !1;
|
|
1444
1444
|
return !0;
|
|
1445
1445
|
}(t, e);
|
|
1446
1446
|
|
|
@@ -1449,9 +1449,9 @@ var St = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1449
1449
|
}
|
|
1450
1450
|
}
|
|
1451
1451
|
|
|
1452
|
-
function
|
|
1452
|
+
function Ft(t, e) {
|
|
1453
1453
|
return void 0 !== (t.values || []).find((function(t) {
|
|
1454
|
-
return
|
|
1454
|
+
return Mt(t, e);
|
|
1455
1455
|
}));
|
|
1456
1456
|
}
|
|
1457
1457
|
|
|
@@ -1699,7 +1699,7 @@ function jt(t, e) {
|
|
|
1699
1699
|
var e = this.field(t.popLast());
|
|
1700
1700
|
Wt(e) && e.mapValue.fields && delete e.mapValue.fields[t.lastSegment()];
|
|
1701
1701
|
}, t.prototype.isEqual = function(t) {
|
|
1702
|
-
return
|
|
1702
|
+
return Mt(this.value, t.value);
|
|
1703
1703
|
},
|
|
1704
1704
|
/**
|
|
1705
1705
|
* Returns the map that contains the leaf element of `path`. If the parent
|
|
@@ -1947,7 +1947,7 @@ function ee(t, e) {
|
|
|
1947
1947
|
for (var n = 0; n < t.orderBy.length; n++) if (!ye(t.orderBy[n], e.orderBy[n])) return !1;
|
|
1948
1948
|
if (t.filters.length !== e.filters.length) return !1;
|
|
1949
1949
|
for (var r = 0; r < t.filters.length; r++) if (i = t.filters[r], o = e.filters[r],
|
|
1950
|
-
i.op !== o.op || !i.field.isEqual(o.field) || !
|
|
1950
|
+
i.op !== o.op || !i.field.isEqual(o.field) || !Mt(i.value, o.value)) return !1;
|
|
1951
1951
|
var i, o;
|
|
1952
1952
|
return t.collectionGroup === e.collectionGroup && !!t.path.isEqual(e.path) && !!me(t.startAt, e.startAt) && me(t.endAt, e.endAt);
|
|
1953
1953
|
}
|
|
@@ -2047,7 +2047,7 @@ var ie = /** @class */ function(e) {
|
|
|
2047
2047
|
}
|
|
2048
2048
|
return t(n, e), n.prototype.matches = function(t) {
|
|
2049
2049
|
var e = t.data.field(this.field);
|
|
2050
|
-
return Gt(e) &&
|
|
2050
|
+
return Gt(e) && Ft(e.arrayValue, this.value);
|
|
2051
2051
|
}, n;
|
|
2052
2052
|
}(re), ce = /** @class */ function(e) {
|
|
2053
2053
|
function n(t, n) {
|
|
@@ -2055,18 +2055,18 @@ var ie = /** @class */ function(e) {
|
|
|
2055
2055
|
}
|
|
2056
2056
|
return t(n, e), n.prototype.matches = function(t) {
|
|
2057
2057
|
var e = t.data.field(this.field);
|
|
2058
|
-
return null !== e &&
|
|
2058
|
+
return null !== e && Ft(this.value.arrayValue, e);
|
|
2059
2059
|
}, n;
|
|
2060
2060
|
}(re), he = /** @class */ function(e) {
|
|
2061
2061
|
function n(t, n) {
|
|
2062
2062
|
return e.call(this, t, "not-in" /* NOT_IN */ , n) || this;
|
|
2063
2063
|
}
|
|
2064
2064
|
return t(n, e), n.prototype.matches = function(t) {
|
|
2065
|
-
if (
|
|
2065
|
+
if (Ft(this.value.arrayValue, {
|
|
2066
2066
|
nullValue: "NULL_VALUE"
|
|
2067
2067
|
})) return !1;
|
|
2068
2068
|
var e = t.data.field(this.field);
|
|
2069
|
-
return null !== e && !
|
|
2069
|
+
return null !== e && !Ft(this.value.arrayValue, e);
|
|
2070
2070
|
}, n;
|
|
2071
2071
|
}(re), fe = /** @class */ function(e) {
|
|
2072
2072
|
function n(t, n) {
|
|
@@ -2075,7 +2075,7 @@ var ie = /** @class */ function(e) {
|
|
|
2075
2075
|
return t(n, e), n.prototype.matches = function(t) {
|
|
2076
2076
|
var e = this, n = t.data.field(this.field);
|
|
2077
2077
|
return !(!Gt(n) || !n.arrayValue.values) && n.arrayValue.values.some((function(t) {
|
|
2078
|
-
return
|
|
2078
|
+
return Ft(e.value.arrayValue, t);
|
|
2079
2079
|
}));
|
|
2080
2080
|
}, n;
|
|
2081
2081
|
}(re), le = function(t, e) {
|
|
@@ -2115,7 +2115,7 @@ function me(t, e) {
|
|
|
2115
2115
|
if (null === t) return null === e;
|
|
2116
2116
|
if (null === e) return !1;
|
|
2117
2117
|
if (t.before !== e.before || t.position.length !== e.position.length) return !1;
|
|
2118
|
-
for (var n = 0; n < t.position.length; n++) if (!
|
|
2118
|
+
for (var n = 0; n < t.position.length; n++) if (!Mt(t.position[n], e.position[n])) return !1;
|
|
2119
2119
|
return !0;
|
|
2120
2120
|
}
|
|
2121
2121
|
|
|
@@ -2367,7 +2367,7 @@ function Pe(t, e, n) {
|
|
|
2367
2367
|
|
|
2368
2368
|
/**
|
|
2369
2369
|
* Returns an IntegerValue for `value`.
|
|
2370
|
-
*/ function
|
|
2370
|
+
*/ function Me(t) {
|
|
2371
2371
|
return {
|
|
2372
2372
|
integerValue: "" + t
|
|
2373
2373
|
};
|
|
@@ -2377,8 +2377,8 @@ function Pe(t, e, n) {
|
|
|
2377
2377
|
* Returns a value for a number that's appropriate to put into a proto.
|
|
2378
2378
|
* The return value is an IntegerValue if it can safely represent the value,
|
|
2379
2379
|
* otherwise a DoubleValue is returned.
|
|
2380
|
-
*/ function
|
|
2381
|
-
return Lt(e) ?
|
|
2380
|
+
*/ function Fe(t, e) {
|
|
2381
|
+
return Lt(e) ? Me(e) : Oe(t, e);
|
|
2382
2382
|
}
|
|
2383
2383
|
|
|
2384
2384
|
/**
|
|
@@ -2429,7 +2429,7 @@ function Pe(t, e, n) {
|
|
|
2429
2429
|
// precision and resolves overflows by reducing precision, we do not
|
|
2430
2430
|
// manually cap overflows at 2^63.
|
|
2431
2431
|
var n = Be(t, e), r = He(n) + He(t.N);
|
|
2432
|
-
return Kt(n) && Kt(t.N) ?
|
|
2432
|
+
return Kt(n) && Kt(t.N) ? Me(r) : Oe(t.k, r);
|
|
2433
2433
|
}(t, e);
|
|
2434
2434
|
}
|
|
2435
2435
|
|
|
@@ -2482,7 +2482,7 @@ function Pe(t, e, n) {
|
|
|
2482
2482
|
/** Transforms an array value via a union operation. */ function Ge(t, e) {
|
|
2483
2483
|
for (var n = Ye(e), r = function(t) {
|
|
2484
2484
|
n.some((function(e) {
|
|
2485
|
-
return
|
|
2485
|
+
return Mt(e, t);
|
|
2486
2486
|
})) || n.push(t);
|
|
2487
2487
|
}, i = 0, o = t.elements; i < o.length; i++) {
|
|
2488
2488
|
r(o[i]);
|
|
@@ -2505,7 +2505,7 @@ function Pe(t, e, n) {
|
|
|
2505
2505
|
function Qe(t, e) {
|
|
2506
2506
|
for (var n = Ye(e), r = function(t) {
|
|
2507
2507
|
n = n.filter((function(e) {
|
|
2508
|
-
return !
|
|
2508
|
+
return !Mt(e, t);
|
|
2509
2509
|
}));
|
|
2510
2510
|
}, i = 0, o = t.elements; i < o.length; i++) {
|
|
2511
2511
|
r(o[i]);
|
|
@@ -2747,7 +2747,7 @@ function on(t, e) {
|
|
|
2747
2747
|
return void 0 === t && void 0 === e || !(!t || !e) && ht(t, e, (function(t, e) {
|
|
2748
2748
|
return function(t, e) {
|
|
2749
2749
|
return t.field.isEqual(e.field) && function(t, e) {
|
|
2750
|
-
return t instanceof Ke && e instanceof Ke || t instanceof ze && e instanceof ze ? ht(t.elements, e.elements,
|
|
2750
|
+
return t instanceof Ke && e instanceof Ke || t instanceof ze && e instanceof ze ? ht(t.elements, e.elements, Mt) : t instanceof We && e instanceof We ? Mt(t.N, e.N) : t instanceof je && e instanceof je;
|
|
2751
2751
|
}(t.transform, e.transform);
|
|
2752
2752
|
}(t, e);
|
|
2753
2753
|
}));
|
|
@@ -3551,7 +3551,7 @@ function Ln() {
|
|
|
3551
3551
|
return t.createSynthesizedTargetChangeForCurrentChange = function(e, n) {
|
|
3552
3552
|
return new t(Et.EMPTY_BYTE_STRING, n, xn(), xn(), xn());
|
|
3553
3553
|
}, t;
|
|
3554
|
-
}(),
|
|
3554
|
+
}(), Mn = function(
|
|
3555
3555
|
/** The new document applies to all of these targets. */
|
|
3556
3556
|
t,
|
|
3557
3557
|
/** The new document is removed from all of these targets. */
|
|
@@ -3564,8 +3564,8 @@ n,
|
|
|
3564
3564
|
*/
|
|
3565
3565
|
r) {
|
|
3566
3566
|
this.$ = t, this.removedTargetIds = e, this.key = n, this.O = r;
|
|
3567
|
-
},
|
|
3568
|
-
this.targetId = t, this.
|
|
3567
|
+
}, Fn = function(t, e) {
|
|
3568
|
+
this.targetId = t, this.M = e;
|
|
3569
3569
|
}, Vn = function(
|
|
3570
3570
|
/** What kind of change occurred to the watch target. */
|
|
3571
3571
|
t,
|
|
@@ -3587,7 +3587,7 @@ n
|
|
|
3587
3587
|
* The number of pending responses (adds or removes) that we are waiting on.
|
|
3588
3588
|
* We only consider targets active that have no pending responses.
|
|
3589
3589
|
*/
|
|
3590
|
-
this.
|
|
3590
|
+
this.F = 0,
|
|
3591
3591
|
/**
|
|
3592
3592
|
* Keeps track of the document changes since the last raised snapshot.
|
|
3593
3593
|
*
|
|
@@ -3626,7 +3626,7 @@ n
|
|
|
3626
3626
|
configurable: !0
|
|
3627
3627
|
}), Object.defineProperty(t.prototype, "K", {
|
|
3628
3628
|
/** Whether this target has pending target adds or target removes. */ get: function() {
|
|
3629
|
-
return 0 !== this.
|
|
3629
|
+
return 0 !== this.F;
|
|
3630
3630
|
},
|
|
3631
3631
|
enumerable: !1,
|
|
3632
3632
|
configurable: !0
|
|
@@ -3681,9 +3681,9 @@ n
|
|
|
3681
3681
|
}, t.prototype.Y = function(t) {
|
|
3682
3682
|
this.q = !0, this.L = this.L.remove(t);
|
|
3683
3683
|
}, t.prototype.X = function() {
|
|
3684
|
-
this.
|
|
3684
|
+
this.F += 1;
|
|
3685
3685
|
}, t.prototype.Z = function() {
|
|
3686
|
-
this.
|
|
3686
|
+
this.F -= 1;
|
|
3687
3687
|
}, t.prototype.tt = function() {
|
|
3688
3688
|
this.q = !0, this.U = !0;
|
|
3689
3689
|
}, t;
|
|
@@ -3777,7 +3777,7 @@ n
|
|
|
3777
3777
|
* `pendingTargetResets`.
|
|
3778
3778
|
*/
|
|
3779
3779
|
t.prototype.dt = function(t) {
|
|
3780
|
-
var e = t.targetId, n = t.
|
|
3780
|
+
var e = t.targetId, n = t.M.count, r = this.wt(e);
|
|
3781
3781
|
if (r) {
|
|
3782
3782
|
var i = r.target;
|
|
3783
3783
|
if (ne(i)) if (0 === n) {
|
|
@@ -4896,7 +4896,7 @@ Or.queryTargetsKeyPath = [ "canonicalId", "targetId" ];
|
|
|
4896
4896
|
* documents and their sequence numbers can be identified efficiently via a scan
|
|
4897
4897
|
* of this store.
|
|
4898
4898
|
*/
|
|
4899
|
-
var
|
|
4899
|
+
var Mr = function(
|
|
4900
4900
|
/**
|
|
4901
4901
|
* The targetId identifying a target or 0 for a sentinel row.
|
|
4902
4902
|
*/
|
|
@@ -4914,13 +4914,13 @@ n) {
|
|
|
4914
4914
|
this.targetId = t, this.path = e, this.sequenceNumber = n;
|
|
4915
4915
|
};
|
|
4916
4916
|
|
|
4917
|
-
/** Name of the IndexedDb object store. */
|
|
4917
|
+
/** Name of the IndexedDb object store. */ Mr.store = "targetDocuments",
|
|
4918
4918
|
/** Keys are automatically assigned via the targetId, path properties. */
|
|
4919
|
-
|
|
4919
|
+
Mr.keyPath = [ "targetId", "path" ],
|
|
4920
4920
|
/** The index name for the reverse index. */
|
|
4921
|
-
|
|
4921
|
+
Mr.documentTargetsIndex = "documentTargetsIndex",
|
|
4922
4922
|
/** We also need to create the reverse index for these properties. */
|
|
4923
|
-
|
|
4923
|
+
Mr.documentTargetsKeyPath = [ "path", "targetId" ];
|
|
4924
4924
|
|
|
4925
4925
|
/**
|
|
4926
4926
|
* A record of global state tracked across all Targets, tracked separately
|
|
@@ -4928,7 +4928,7 @@ Fr.documentTargetsKeyPath = [ "path", "targetId" ];
|
|
|
4928
4928
|
*
|
|
4929
4929
|
* This should be kept in-sync with the proto used in the iOS client.
|
|
4930
4930
|
*/
|
|
4931
|
-
var
|
|
4931
|
+
var Fr = function(
|
|
4932
4932
|
/**
|
|
4933
4933
|
* The highest numbered target id across all targets.
|
|
4934
4934
|
*
|
|
@@ -4961,7 +4961,7 @@ r) {
|
|
|
4961
4961
|
/**
|
|
4962
4962
|
* The key string used for the single object that exists in the
|
|
4963
4963
|
* DbTargetGlobal store.
|
|
4964
|
-
*/
|
|
4964
|
+
*/ Fr.key = "targetGlobalKey", Fr.store = "targetGlobal";
|
|
4965
4965
|
|
|
4966
4966
|
/**
|
|
4967
4967
|
* An object representing an association between a Collection id (e.g. 'messages')
|
|
@@ -5041,7 +5041,7 @@ n) {
|
|
|
5041
5041
|
/** Name of the IndexedDb object store. */ Br.store = "namedQueries", Br.keyPath = "name";
|
|
5042
5042
|
|
|
5043
5043
|
// Visible for testing
|
|
5044
|
-
var jr = e(e([], e(e([], e(e([], e(e([], [ Dr.store, Nr.store, Cr.store, Lr.store, Or.store, Ar.store,
|
|
5044
|
+
var jr = e(e([], e(e([], e(e([], e(e([], [ Dr.store, Nr.store, Cr.store, Lr.store, Or.store, Ar.store, Fr.store, Mr.store ]), [ qr.store ])), [ Pr.store ])), [ Vr.store ])), [ Ur.store, Br.store ]), Kr = "The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.", Gr = /** @class */ function() {
|
|
5045
5045
|
function t() {
|
|
5046
5046
|
this.onCommittedListeners = [];
|
|
5047
5047
|
}
|
|
@@ -5368,7 +5368,7 @@ var jr = e(e([], e(e([], e(e([], e(e([], [ Dr.store, Nr.store, Cr.store, Lr.stor
|
|
|
5368
5368
|
}, t;
|
|
5369
5369
|
}(), Hr = /** @class */ function() {
|
|
5370
5370
|
function t(t) {
|
|
5371
|
-
this.$t = t, this.Ot = !1, this.
|
|
5371
|
+
this.$t = t, this.Ot = !1, this.Mt = null;
|
|
5372
5372
|
}
|
|
5373
5373
|
return Object.defineProperty(t.prototype, "isDone", {
|
|
5374
5374
|
get: function() {
|
|
@@ -5376,9 +5376,9 @@ var jr = e(e([], e(e([], e(e([], e(e([], [ Dr.store, Nr.store, Cr.store, Lr.stor
|
|
|
5376
5376
|
},
|
|
5377
5377
|
enumerable: !1,
|
|
5378
5378
|
configurable: !0
|
|
5379
|
-
}), Object.defineProperty(t.prototype, "
|
|
5379
|
+
}), Object.defineProperty(t.prototype, "Ft", {
|
|
5380
5380
|
get: function() {
|
|
5381
|
-
return this.
|
|
5381
|
+
return this.Mt;
|
|
5382
5382
|
},
|
|
5383
5383
|
enumerable: !1,
|
|
5384
5384
|
configurable: !0
|
|
@@ -5400,7 +5400,7 @@ var jr = e(e([], e(e([], e(e([], e(e([], [ Dr.store, Nr.store, Cr.store, Lr.stor
|
|
|
5400
5400
|
* an index or a primary key.
|
|
5401
5401
|
*/
|
|
5402
5402
|
t.prototype.Lt = function(t) {
|
|
5403
|
-
this.
|
|
5403
|
+
this.Mt = t;
|
|
5404
5404
|
},
|
|
5405
5405
|
/**
|
|
5406
5406
|
* Delete the current cursor value from the object store.
|
|
@@ -5546,7 +5546,7 @@ var jr = e(e([], e(e([], e(e([], e(e([], [ Dr.store, Nr.store, Cr.store, Lr.stor
|
|
|
5546
5546
|
}));
|
|
5547
5547
|
n.push(a);
|
|
5548
5548
|
}
|
|
5549
|
-
o.isDone ? r() : null === o.
|
|
5549
|
+
o.isDone ? r() : null === o.Ft ? i.continue() : i.continue(o.Ft);
|
|
5550
5550
|
} else r();
|
|
5551
5551
|
};
|
|
5552
5552
|
})).next((function() {
|
|
@@ -6607,11 +6607,11 @@ var Di = /** @class */ function() {
|
|
|
6607
6607
|
e(r);
|
|
6608
6608
|
}));
|
|
6609
6609
|
}, t.prototype.oe = function(t) {
|
|
6610
|
-
return
|
|
6610
|
+
return Mi(t).get(Fr.key).next((function(t) {
|
|
6611
6611
|
return z(null !== t), t;
|
|
6612
6612
|
}));
|
|
6613
6613
|
}, t.prototype.ae = function(t, e) {
|
|
6614
|
-
return
|
|
6614
|
+
return Mi(t).put(Fr.key, e);
|
|
6615
6615
|
}, t.prototype.ce = function(t, e) {
|
|
6616
6616
|
return Oi(t).put(yi(this.k, e));
|
|
6617
6617
|
},
|
|
@@ -6646,15 +6646,15 @@ var Di = /** @class */ function() {
|
|
|
6646
6646
|
return i;
|
|
6647
6647
|
}));
|
|
6648
6648
|
}, t.prototype.addMatchingKeys = function(t, e, n) {
|
|
6649
|
-
var r = this, i = [], o =
|
|
6649
|
+
var r = this, i = [], o = Fi(t);
|
|
6650
6650
|
// PORTING NOTE: The reverse index (documentsTargets) is maintained by
|
|
6651
6651
|
// IndexedDb.
|
|
6652
6652
|
return e.forEach((function(e) {
|
|
6653
6653
|
var s = Tr(e.path);
|
|
6654
|
-
i.push(o.put(new
|
|
6654
|
+
i.push(o.put(new Mr(n, s))), i.push(r.referenceDelegate.addReference(t, n, e));
|
|
6655
6655
|
})), zr.waitFor(i);
|
|
6656
6656
|
}, t.prototype.removeMatchingKeys = function(t, e, n) {
|
|
6657
|
-
var r = this, i =
|
|
6657
|
+
var r = this, i = Fi(t);
|
|
6658
6658
|
// PORTING NOTE: The reverse index (documentsTargets) is maintained by
|
|
6659
6659
|
// IndexedDb.
|
|
6660
6660
|
return zr.forEach(e, (function(e) {
|
|
@@ -6662,14 +6662,14 @@ var Di = /** @class */ function() {
|
|
|
6662
6662
|
return zr.waitFor([ i.delete([ n, o ]), r.referenceDelegate.removeReference(t, n, e) ]);
|
|
6663
6663
|
}));
|
|
6664
6664
|
}, t.prototype.removeMatchingKeysForTargetId = function(t, e) {
|
|
6665
|
-
var n =
|
|
6665
|
+
var n = Fi(t), r = IDBKeyRange.bound([ e ], [ e + 1 ],
|
|
6666
6666
|
/*lowerOpen=*/ !1,
|
|
6667
6667
|
/*upperOpen=*/ !0);
|
|
6668
6668
|
return n.delete(r);
|
|
6669
6669
|
}, t.prototype.getMatchingKeysForTargetId = function(t, e) {
|
|
6670
6670
|
var n = IDBKeyRange.bound([ e ], [ e + 1 ],
|
|
6671
6671
|
/*lowerOpen=*/ !1,
|
|
6672
|
-
/*upperOpen=*/ !0), r =
|
|
6672
|
+
/*upperOpen=*/ !0), r = Fi(t), i = xn();
|
|
6673
6673
|
return r.jt({
|
|
6674
6674
|
range: n,
|
|
6675
6675
|
Kt: !0
|
|
@@ -6683,8 +6683,8 @@ var Di = /** @class */ function() {
|
|
|
6683
6683
|
var n = Tr(e.path), r = IDBKeyRange.bound([ n ], [ ft(n) ],
|
|
6684
6684
|
/*lowerOpen=*/ !1,
|
|
6685
6685
|
/*upperOpen=*/ !0), i = 0;
|
|
6686
|
-
return
|
|
6687
|
-
index:
|
|
6686
|
+
return Fi(t).jt({
|
|
6687
|
+
index: Mr.documentTargetsIndex,
|
|
6688
6688
|
Kt: !0,
|
|
6689
6689
|
range: r
|
|
6690
6690
|
}, (function(t, e, n) {
|
|
@@ -6738,14 +6738,14 @@ function Oi(t) {
|
|
|
6738
6738
|
|
|
6739
6739
|
/**
|
|
6740
6740
|
* Helper to get a typed SimpleDbStore for the target globals object store.
|
|
6741
|
-
*/ function
|
|
6742
|
-
return ni(t,
|
|
6741
|
+
*/ function Mi(t) {
|
|
6742
|
+
return ni(t, Fr.store);
|
|
6743
6743
|
}
|
|
6744
6744
|
|
|
6745
6745
|
/**
|
|
6746
6746
|
* Helper to get a typed SimpleDbStore for the document target object store.
|
|
6747
|
-
*/ function
|
|
6748
|
-
return ni(t,
|
|
6747
|
+
*/ function Fi(t) {
|
|
6748
|
+
return ni(t, Mr.store);
|
|
6749
6749
|
}
|
|
6750
6750
|
|
|
6751
6751
|
/**
|
|
@@ -6999,7 +6999,7 @@ function Oi(t) {
|
|
|
6999
6999
|
// Our size accounting requires us to read all documents before
|
|
7000
7000
|
// removing them.
|
|
7001
7001
|
return o++, r.getEntry(t, s).next((function() {
|
|
7002
|
-
return r.removeEntry(s),
|
|
7002
|
+
return r.removeEntry(s), Fi(t).delete([ 0, Tr(s.path) ]);
|
|
7003
7003
|
}));
|
|
7004
7004
|
}));
|
|
7005
7005
|
i.push(u);
|
|
@@ -7024,9 +7024,9 @@ function Oi(t) {
|
|
|
7024
7024
|
* number for the last time the document was accessed.
|
|
7025
7025
|
*/
|
|
7026
7026
|
t.prototype.Ie = function(t, e) {
|
|
7027
|
-
var n, r =
|
|
7027
|
+
var n, r = Fi(t), i = st.I;
|
|
7028
7028
|
return r.jt({
|
|
7029
|
-
index:
|
|
7029
|
+
index: Mr.documentTargetsIndex
|
|
7030
7030
|
}, (function(t, r) {
|
|
7031
7031
|
var o = t[0];
|
|
7032
7032
|
t[1];
|
|
@@ -7058,13 +7058,13 @@ function Oi(t) {
|
|
|
7058
7058
|
* This class is responsible for the scheduling of LRU garbage collection. It handles checking
|
|
7059
7059
|
* whether or not GC is enabled, as well as which delay to use before the next run.
|
|
7060
7060
|
*/ function Gi(t, e) {
|
|
7061
|
-
return
|
|
7061
|
+
return Fi(t).put(
|
|
7062
7062
|
/**
|
|
7063
7063
|
* @returns A value suitable for writing a sentinel row in the target-document
|
|
7064
7064
|
* store.
|
|
7065
7065
|
*/
|
|
7066
7066
|
function(t, e) {
|
|
7067
|
-
return new
|
|
7067
|
+
return new Mr(0, Tr(t.path), e);
|
|
7068
7068
|
}(e, t.currentSequenceNumber));
|
|
7069
7069
|
}
|
|
7070
7070
|
|
|
@@ -7523,7 +7523,7 @@ function Xi(t) {
|
|
|
7523
7523
|
// Brand new clients don't need to drop and recreate--only clients that
|
|
7524
7524
|
// potentially have corrupt data.
|
|
7525
7525
|
0 !== n && (function(t) {
|
|
7526
|
-
t.deleteObjectStore(
|
|
7526
|
+
t.deleteObjectStore(Mr.store), t.deleteObjectStore(Or.store), t.deleteObjectStore(Fr.store);
|
|
7527
7527
|
}(t), $i(t)), s = s.next((function() {
|
|
7528
7528
|
/**
|
|
7529
7529
|
* Creates the target global singleton row.
|
|
@@ -7531,11 +7531,11 @@ function Xi(t) {
|
|
|
7531
7531
|
* @param txn - The version upgrade transaction for indexeddb
|
|
7532
7532
|
*/
|
|
7533
7533
|
return function(t) {
|
|
7534
|
-
var e = t.store(
|
|
7534
|
+
var e = t.store(Fr.store), n = new Fr(
|
|
7535
7535
|
/*highestTargetId=*/ 0,
|
|
7536
7536
|
/*lastListenSequenceNumber=*/ 0, dt.min().toTimestamp(),
|
|
7537
7537
|
/*targetCount=*/ 0);
|
|
7538
|
-
return e.put(
|
|
7538
|
+
return e.put(Fr.key, n);
|
|
7539
7539
|
}(o);
|
|
7540
7540
|
}))), n < 4 && r >= 4 && (0 !== n && (
|
|
7541
7541
|
// Schema version 3 uses auto-generated keys to generate globally unique
|
|
@@ -7630,8 +7630,8 @@ function Xi(t) {
|
|
|
7630
7630
|
* with a sequence number. Missing rows are given the most recently used sequence number.
|
|
7631
7631
|
*/
|
|
7632
7632
|
t.prototype.xe = function(t) {
|
|
7633
|
-
var e = t.store(
|
|
7634
|
-
return t.store(
|
|
7633
|
+
var e = t.store(Mr.store), n = t.store(Lr.store);
|
|
7634
|
+
return t.store(Fr.store).get(Fr.key).next((function(t) {
|
|
7635
7635
|
var r = [];
|
|
7636
7636
|
return n.jt((function(n, i) {
|
|
7637
7637
|
var o = new gt(n), s = function(t) {
|
|
@@ -7639,7 +7639,7 @@ function Xi(t) {
|
|
|
7639
7639
|
}(o);
|
|
7640
7640
|
r.push(e.get(s).next((function(n) {
|
|
7641
7641
|
return n ? zr.resolve() : function(n) {
|
|
7642
|
-
return e.put(new
|
|
7642
|
+
return e.put(new Mr(0, Tr(n), t.highestListenSequenceNumber));
|
|
7643
7643
|
}(o);
|
|
7644
7644
|
})));
|
|
7645
7645
|
})).next((function() {
|
|
@@ -7688,9 +7688,9 @@ function Xi(t) {
|
|
|
7688
7688
|
}();
|
|
7689
7689
|
|
|
7690
7690
|
function $i(t) {
|
|
7691
|
-
t.createObjectStore(
|
|
7692
|
-
keyPath:
|
|
7693
|
-
}).createIndex(
|
|
7691
|
+
t.createObjectStore(Mr.store, {
|
|
7692
|
+
keyPath: Mr.keyPath
|
|
7693
|
+
}).createIndex(Mr.documentTargetsIndex, Mr.documentTargetsKeyPath, {
|
|
7694
7694
|
unique: !0
|
|
7695
7695
|
}),
|
|
7696
7696
|
// NOTE: This is unique only because the TargetId is the suffix.
|
|
@@ -7698,7 +7698,7 @@ function $i(t) {
|
|
|
7698
7698
|
keyPath: Or.keyPath
|
|
7699
7699
|
}).createIndex(Or.queryTargetsIndexName, Or.queryTargetsKeyPath, {
|
|
7700
7700
|
unique: !0
|
|
7701
|
-
}), t.createObjectStore(
|
|
7701
|
+
}), t.createObjectStore(Fr.store);
|
|
7702
7702
|
}
|
|
7703
7703
|
|
|
7704
7704
|
var to = "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.", eo = /** @class */ function() {
|
|
@@ -7714,7 +7714,7 @@ var to = "Failed to obtain exclusive access to the persistence layer. To allow s
|
|
|
7714
7714
|
*/
|
|
7715
7715
|
h) {
|
|
7716
7716
|
if (this.allowTabSynchronization = e, this.persistenceKey = n, this.clientId = r,
|
|
7717
|
-
this.
|
|
7717
|
+
this.Me = o, this.window = s, this.document = a, this.Fe = c, this.Le = h, this.Be = null,
|
|
7718
7718
|
this.Ue = !1, this.isPrimary = !1, this.networkEnabled = !0,
|
|
7719
7719
|
/** Our window.unload handler, if registered. */
|
|
7720
7720
|
this.qe = null, this.inForeground = !1,
|
|
@@ -7753,7 +7753,7 @@ var to = "Failed to obtain exclusive access to the persistence layer. To allow s
|
|
|
7753
7753
|
return t.He.getHighestSequenceNumber(e);
|
|
7754
7754
|
}));
|
|
7755
7755
|
})).then((function(e) {
|
|
7756
|
-
t.Be = new st(e, t.
|
|
7756
|
+
t.Be = new st(e, t.Fe);
|
|
7757
7757
|
})).then((function() {
|
|
7758
7758
|
t.Ue = !0;
|
|
7759
7759
|
})).catch((function(e) {
|
|
@@ -7813,7 +7813,7 @@ var to = "Failed to obtain exclusive access to the persistence layer. To allow s
|
|
|
7813
7813
|
this.networkEnabled !== t && (this.networkEnabled = t,
|
|
7814
7814
|
// Schedule a primary lease refresh for immediate execution. The eventual
|
|
7815
7815
|
// lease update will be propagated via `primaryStateListener`.
|
|
7816
|
-
this.
|
|
7816
|
+
this.Me.enqueueAndForget((function() {
|
|
7817
7817
|
return n(e, void 0, void 0, (function() {
|
|
7818
7818
|
return r(this, (function(t) {
|
|
7819
7819
|
switch (t.label) {
|
|
@@ -7841,7 +7841,7 @@ var to = "Failed to obtain exclusive access to the persistence layer. To allow s
|
|
|
7841
7841
|
return this.runTransaction("updateClientMetadataAndTryBecomePrimary", "readwrite", (function(e) {
|
|
7842
7842
|
return ro(e).put(new qr(t.clientId, Date.now(), t.networkEnabled, t.inForeground)).next((function() {
|
|
7843
7843
|
if (t.isPrimary) return t.rn(e).next((function(e) {
|
|
7844
|
-
e || (t.isPrimary = !1, t.
|
|
7844
|
+
e || (t.isPrimary = !1, t.Me.enqueueRetryable((function() {
|
|
7845
7845
|
return t.We(!1);
|
|
7846
7846
|
})));
|
|
7847
7847
|
}));
|
|
@@ -7863,7 +7863,7 @@ var to = "Failed to obtain exclusive access to the persistence layer. To allow s
|
|
|
7863
7863
|
return U("IndexedDbPersistence", "Releasing owner lease after error during lease refresh", e),
|
|
7864
7864
|
/* isPrimary= */ !1;
|
|
7865
7865
|
})).then((function(e) {
|
|
7866
|
-
t.isPrimary !== e && t.
|
|
7866
|
+
t.isPrimary !== e && t.Me.enqueueRetryable((function() {
|
|
7867
7867
|
return t.We(e);
|
|
7868
7868
|
})), t.isPrimary = e;
|
|
7869
7869
|
}));
|
|
@@ -7925,7 +7925,7 @@ var to = "Failed to obtain exclusive access to the persistence layer. To allow s
|
|
|
7925
7925
|
*/
|
|
7926
7926
|
t.prototype.nn = function() {
|
|
7927
7927
|
var t = this;
|
|
7928
|
-
this.je = this.
|
|
7928
|
+
this.je = this.Me.enqueueAfterDelay("client_metadata_refresh" /* ClientMetadataRefresh */ , 4e3, (function() {
|
|
7929
7929
|
return t.Ze().then((function() {
|
|
7930
7930
|
return t.ln();
|
|
7931
7931
|
})).then((function() {
|
|
@@ -8071,7 +8071,7 @@ var to = "Failed to obtain exclusive access to the persistence layer. To allow s
|
|
|
8071
8071
|
return !!t || r.on(i);
|
|
8072
8072
|
})).next((function(e) {
|
|
8073
8073
|
if (!e) throw B("Failed to obtain primary lease for action '" + t + "'."), r.isPrimary = !1,
|
|
8074
|
-
r.
|
|
8074
|
+
r.Me.enqueueRetryable((function() {
|
|
8075
8075
|
return r.We(!1);
|
|
8076
8076
|
})), new Y(H.FAILED_PRECONDITION, Kr);
|
|
8077
8077
|
return n(i);
|
|
@@ -8121,7 +8121,7 @@ var to = "Failed to obtain exclusive access to the persistence layer. To allow s
|
|
|
8121
8121
|
}, t.prototype.tn = function() {
|
|
8122
8122
|
var t = this;
|
|
8123
8123
|
null !== this.document && "function" == typeof this.document.addEventListener && (this.Ke = function() {
|
|
8124
|
-
t.
|
|
8124
|
+
t.Me.enqueueAndForget((function() {
|
|
8125
8125
|
return t.inForeground = "visible" === t.document.visibilityState, t.Ze();
|
|
8126
8126
|
}));
|
|
8127
8127
|
}, this.document.addEventListener("visibilitychange", this.Ke), this.inForeground = "visible" === this.document.visibilityState);
|
|
@@ -8149,7 +8149,7 @@ var to = "Failed to obtain exclusive access to the persistence layer. To allow s
|
|
|
8149
8149
|
// trigger a bug that prevents Safari from re-opening IndexedDB during
|
|
8150
8150
|
// the next page load.
|
|
8151
8151
|
// See https://bugs.webkit.org/show_bug.cgi?id=226547
|
|
8152
|
-
e.
|
|
8152
|
+
e.Me.enterRestrictedMode(/* purgeExistingTasks= */ !0), e.Me.enqueueAndForget((function() {
|
|
8153
8153
|
return e.shutdown();
|
|
8154
8154
|
}));
|
|
8155
8155
|
}, this.window.addEventListener("pagehide", this.qe));
|
|
@@ -8441,7 +8441,7 @@ var oo = function(t, e) {
|
|
|
8441
8441
|
}(), uo = /** @class */ function() {
|
|
8442
8442
|
function t() {}
|
|
8443
8443
|
/** Sets the document view to query against. */ return t.prototype.On = function(t) {
|
|
8444
|
-
this.
|
|
8444
|
+
this.Mn = t;
|
|
8445
8445
|
},
|
|
8446
8446
|
/** Returns all local documents matching the specified query. */ t.prototype.getDocumentsMatchingQuery = function(t, e, n, r) {
|
|
8447
8447
|
var i = this;
|
|
@@ -8450,10 +8450,10 @@ var oo = function(t, e) {
|
|
|
8450
8450
|
// collection, rather than to perform individual lookups.
|
|
8451
8451
|
return function(t) {
|
|
8452
8452
|
return 0 === t.filters.length && null === t.limit && null == t.startAt && null == t.endAt && (0 === t.explicitOrderBy.length || 1 === t.explicitOrderBy.length && t.explicitOrderBy[0].field.isKeyField());
|
|
8453
|
-
}(e) || n.isEqual(dt.min()) ? this.
|
|
8453
|
+
}(e) || n.isEqual(dt.min()) ? this.Fn(t, e) : this.Mn.vn(t, r).next((function(o) {
|
|
8454
8454
|
var s = i.Ln(e, o);
|
|
8455
|
-
return (Ie(e) || Te(e)) && i.Bn(e.limitType, s, r, n) ? i.
|
|
8456
|
-
i.
|
|
8455
|
+
return (Ie(e) || Te(e)) && i.Bn(e.limitType, s, r, n) ? i.Fn(t, e) : (V() <= f.DEBUG && U("QueryEngine", "Re-using previous result from %s to execute query: %s", n.toString(), xe(e)),
|
|
8456
|
+
i.Mn.getDocumentsMatchingQuery(t, e, n).next((function(t) {
|
|
8457
8457
|
// We merge `previousResults` into `updateResults`, since
|
|
8458
8458
|
// `updateResults` is already a DocumentMap. If a document is
|
|
8459
8459
|
// contained in both lists, then its contents are the same.
|
|
@@ -8498,9 +8498,9 @@ var oo = function(t, e) {
|
|
|
8498
8498
|
// any modifications that don't affect the last document.
|
|
8499
8499
|
var i = "F" /* First */ === t ? e.last() : e.first();
|
|
8500
8500
|
return !!i && (i.hasPendingWrites || i.version.compareTo(r) > 0);
|
|
8501
|
-
}, t.prototype.
|
|
8501
|
+
}, t.prototype.Fn = function(t, e) {
|
|
8502
8502
|
return V() <= f.DEBUG && U("QueryEngine", "Using full collection scan to execute query:", xe(e)),
|
|
8503
|
-
this.
|
|
8503
|
+
this.Mn.getDocumentsMatchingQuery(t, e, dt.min());
|
|
8504
8504
|
}, t;
|
|
8505
8505
|
}(), co = /** @class */ function() {
|
|
8506
8506
|
function t(
|
|
@@ -9676,7 +9676,7 @@ function Eo(t) {
|
|
|
9676
9676
|
// The format of the LocalStorage key that stores the client state is:
|
|
9677
9677
|
// firestore_clients_<persistence_prefix>_<instance_key>
|
|
9678
9678
|
/** Assembles the key for a client state in WebStorage */
|
|
9679
|
-
function
|
|
9679
|
+
function Mo(t, e) {
|
|
9680
9680
|
return "firestore_clients_" + t + "_" + e;
|
|
9681
9681
|
}
|
|
9682
9682
|
|
|
@@ -9686,7 +9686,7 @@ function Fo(t, e) {
|
|
|
9686
9686
|
// or: firestore_mutations_<persistence_prefix>_<batch_id>_<user_uid>
|
|
9687
9687
|
// 'user_uid' is last to avoid needing to escape '_' characters that it might
|
|
9688
9688
|
// contain.
|
|
9689
|
-
/** Assembles the key for a mutation batch in WebStorage */ function
|
|
9689
|
+
/** Assembles the key for a mutation batch in WebStorage */ function Fo(t, e, n) {
|
|
9690
9690
|
var r = "firestore_mutations_" + t + "_" + n;
|
|
9691
9691
|
return e.isAuthenticated() && (r += "_" + e.uid), r;
|
|
9692
9692
|
}
|
|
@@ -9718,7 +9718,7 @@ var qo = /** @class */ function() {
|
|
|
9718
9718
|
return s && o.error && ((s = "string" == typeof o.error.message && "string" == typeof o.error.code) && (i = new Y(o.error.code, o.error.message))),
|
|
9719
9719
|
s ? new t(e, n, o.state, i) : (B("SharedClientState", "Failed to parse mutation state for ID '" + n + "': " + r),
|
|
9720
9720
|
null);
|
|
9721
|
-
}, t.prototype.
|
|
9721
|
+
}, t.prototype.Ms = function() {
|
|
9722
9722
|
var t = {
|
|
9723
9723
|
state: this.state,
|
|
9724
9724
|
updateTimeMs: Date.now()
|
|
@@ -9741,7 +9741,7 @@ var qo = /** @class */ function() {
|
|
|
9741
9741
|
return o && i.error && ((o = "string" == typeof i.error.message && "string" == typeof i.error.code) && (r = new Y(i.error.code, i.error.message))),
|
|
9742
9742
|
o ? new t(e, i.state, r) : (B("SharedClientState", "Failed to parse target state for ID '" + e + "': " + n),
|
|
9743
9743
|
null);
|
|
9744
|
-
}, t.prototype.
|
|
9744
|
+
}, t.prototype.Ms = function() {
|
|
9745
9745
|
var t = {
|
|
9746
9746
|
state: this.state,
|
|
9747
9747
|
updateTimeMs: Date.now()
|
|
@@ -9782,7 +9782,7 @@ var qo = /** @class */ function() {
|
|
|
9782
9782
|
function t() {
|
|
9783
9783
|
this.activeTargetIds = Ln();
|
|
9784
9784
|
}
|
|
9785
|
-
return t.prototype.
|
|
9785
|
+
return t.prototype.Fs = function(t) {
|
|
9786
9786
|
this.activeTargetIds = this.activeTargetIds.add(t);
|
|
9787
9787
|
}, t.prototype.Ls = function(t) {
|
|
9788
9788
|
this.activeTargetIds = this.activeTargetIds.delete(t);
|
|
@@ -9791,7 +9791,7 @@ var qo = /** @class */ function() {
|
|
|
9791
9791
|
* Converts this entry into a JSON-encoded format we can use for WebStorage.
|
|
9792
9792
|
* Does not encode `clientId` as it is part of the key in WebStorage.
|
|
9793
9793
|
*/
|
|
9794
|
-
t.prototype.
|
|
9794
|
+
t.prototype.Ms = function() {
|
|
9795
9795
|
var t = {
|
|
9796
9796
|
activeTargetIds: this.activeTargetIds.toArray(),
|
|
9797
9797
|
updateTimeMs: Date.now()
|
|
@@ -9800,7 +9800,7 @@ var qo = /** @class */ function() {
|
|
|
9800
9800
|
}, t;
|
|
9801
9801
|
}(), Go = /** @class */ function() {
|
|
9802
9802
|
function t(t, e, n, r, i) {
|
|
9803
|
-
this.window = t, this.
|
|
9803
|
+
this.window = t, this.Me = e, this.persistenceKey = n, this.Bs = r, this.syncEngine = null,
|
|
9804
9804
|
this.onlineStateHandler = null, this.sequenceNumberHandler = null, this.Us = this.qs.bind(this),
|
|
9805
9805
|
this.Ks = new wn(ct), this.started = !1,
|
|
9806
9806
|
/**
|
|
@@ -9811,7 +9811,7 @@ var qo = /** @class */ function() {
|
|
|
9811
9811
|
// Escape the special characters mentioned here:
|
|
9812
9812
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
|
|
9813
9813
|
var o = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
9814
|
-
this.storage = this.window.localStorage, this.currentUser = i, this.Qs =
|
|
9814
|
+
this.storage = this.window.localStorage, this.currentUser = i, this.Qs = Mo(this.persistenceKey, this.Bs),
|
|
9815
9815
|
this.Ws =
|
|
9816
9816
|
/** Assembles the key for the current sequence number. */
|
|
9817
9817
|
function(t) {
|
|
@@ -9844,7 +9844,7 @@ var qo = /** @class */ function() {
|
|
|
9844
9844
|
return [ 4 /*yield*/ , this.syncEngine.Tn() ];
|
|
9845
9845
|
|
|
9846
9846
|
case 1:
|
|
9847
|
-
for (t = r.sent(), e = 0, n = t; e < n.length; e++) (i = n[e]) !== this.Bs && (o = this.getItem(
|
|
9847
|
+
for (t = r.sent(), e = 0, n = t; e < n.length; e++) (i = n[e]) !== this.Bs && (o = this.getItem(Mo(this.persistenceKey, i))) && (s = Bo.Os(i, o)) && (this.Ks = this.Ks.insert(s.clientId, s));
|
|
9848
9848
|
for (this.Xs(), (a = this.storage.getItem(this.Js)) && (u = this.Zs(a)) && this.ti(u),
|
|
9849
9849
|
c = 0, h = this.js; c < h.length; c++) f = h[c], this.qs(f);
|
|
9850
9850
|
return this.js = [],
|
|
@@ -9884,7 +9884,7 @@ var qo = /** @class */ function() {
|
|
|
9884
9884
|
r && (e = r.state);
|
|
9885
9885
|
}
|
|
9886
9886
|
}
|
|
9887
|
-
return this.ii.
|
|
9887
|
+
return this.ii.Fs(t), this.Xs(), e;
|
|
9888
9888
|
}, t.prototype.removeLocalQueryTarget = function(t) {
|
|
9889
9889
|
this.ii.Ls(t), this.Xs();
|
|
9890
9890
|
}, t.prototype.isLocalQueryTarget = function(t) {
|
|
@@ -9920,7 +9920,7 @@ var qo = /** @class */ function() {
|
|
|
9920
9920
|
// `Window.addEventListener`.
|
|
9921
9921
|
if (i.storageArea === this.storage) {
|
|
9922
9922
|
if (U("SharedClientState", "EVENT", i.key, i.newValue), i.key === this.Qs) return void B("Received WebStorage notification for local change. Another client might have garbage-collected our state");
|
|
9923
|
-
this.
|
|
9923
|
+
this.Me.enqueueRetryable((function() {
|
|
9924
9924
|
return n(e, void 0, void 0, (function() {
|
|
9925
9925
|
var t, e, n, o, s, a;
|
|
9926
9926
|
return r(this, (function(r) {
|
|
@@ -9957,12 +9957,12 @@ var qo = /** @class */ function() {
|
|
|
9957
9957
|
enumerable: !1,
|
|
9958
9958
|
configurable: !0
|
|
9959
9959
|
}), t.prototype.Xs = function() {
|
|
9960
|
-
this.setItem(this.Qs, this.ii.
|
|
9960
|
+
this.setItem(this.Qs, this.ii.Ms());
|
|
9961
9961
|
}, t.prototype.ni = function(t, e, n) {
|
|
9962
|
-
var r = new qo(this.currentUser, t, e, n), i =
|
|
9963
|
-
this.setItem(i, r.
|
|
9962
|
+
var r = new qo(this.currentUser, t, e, n), i = Fo(this.persistenceKey, this.currentUser, t);
|
|
9963
|
+
this.setItem(i, r.Ms());
|
|
9964
9964
|
}, t.prototype.si = function(t) {
|
|
9965
|
-
var e =
|
|
9965
|
+
var e = Fo(this.persistenceKey, this.currentUser, t);
|
|
9966
9966
|
this.removeItem(e);
|
|
9967
9967
|
}, t.prototype.oi = function(t) {
|
|
9968
9968
|
var e = {
|
|
@@ -9972,7 +9972,7 @@ var qo = /** @class */ function() {
|
|
|
9972
9972
|
this.storage.setItem(this.Js, JSON.stringify(e));
|
|
9973
9973
|
}, t.prototype.ri = function(t, e, n) {
|
|
9974
9974
|
var r = Vo(this.persistenceKey, t), i = new Uo(t, e, n);
|
|
9975
|
-
this.setItem(r, i.
|
|
9975
|
+
this.setItem(r, i.Ms());
|
|
9976
9976
|
}, t.prototype.ai = function() {
|
|
9977
9977
|
this.setItem(this.Ys, "value-not-used");
|
|
9978
9978
|
},
|
|
@@ -10054,7 +10054,7 @@ var qo = /** @class */ function() {
|
|
|
10054
10054
|
}, t.prototype.updateMutationState = function(t, e, n) {
|
|
10055
10055
|
// No op.
|
|
10056
10056
|
}, t.prototype.addLocalQueryTarget = function(t) {
|
|
10057
|
-
return this.pi.
|
|
10057
|
+
return this.pi.Fs(t), this.Ti[t] || "not-current";
|
|
10058
10058
|
}, t.prototype.updateQueryState = function(t, e, n) {
|
|
10059
10059
|
this.Ti[t] = e;
|
|
10060
10060
|
}, t.prototype.removeLocalQueryTarget = function(t) {
|
|
@@ -10138,7 +10138,7 @@ var qo = /** @class */ function() {
|
|
|
10138
10138
|
this.Ci();
|
|
10139
10139
|
}, t.prototype.Oi = function(t) {
|
|
10140
10140
|
this.ki(t);
|
|
10141
|
-
}, t.prototype.
|
|
10141
|
+
}, t.prototype.Mi = function(t) {
|
|
10142
10142
|
this.xi(t);
|
|
10143
10143
|
}, t;
|
|
10144
10144
|
}(), Jo = /** @class */ function(e) {
|
|
@@ -10195,7 +10195,7 @@ var qo = /** @class */ function() {
|
|
|
10195
10195
|
s.send(e, "POST", a, n, 15);
|
|
10196
10196
|
}));
|
|
10197
10197
|
}, n.prototype.Qi = function(t, e, n) {
|
|
10198
|
-
var r = [ this.
|
|
10198
|
+
var r = [ this.Fi, "/", "google.firestore.v1.Firestore", "/", t, "/channel" ], i = D(), o = N(), s = {
|
|
10199
10199
|
// Required for backend stickiness, routing behavior is based on this
|
|
10200
10200
|
// parameter.
|
|
10201
10201
|
httpSessionIdParam: "gsessionid",
|
|
@@ -10304,7 +10304,7 @@ var qo = /** @class */ function() {
|
|
|
10304
10304
|
void 0 === s && (s = H.INTERNAL, a = "Unknown error status: " + o + " with message " + i.message),
|
|
10305
10305
|
// Mark closed so no further events are propagated
|
|
10306
10306
|
h = !0, f.Oi(new Y(s, a)), u.close();
|
|
10307
|
-
} else U("Connection", "WebChannel received:", n), f.
|
|
10307
|
+
} else U("Connection", "WebChannel received:", n), f.Mi(n);
|
|
10308
10308
|
}
|
|
10309
10309
|
})), l(o, R.STAT_EVENT, (function(t) {
|
|
10310
10310
|
t.stat === L.PROXY ? U("Connection", "Detected buffering proxy") : t.stat === L.NOPROXY && U("Connection", "Detected no buffering proxy");
|
|
@@ -10320,7 +10320,7 @@ var qo = /** @class */ function() {
|
|
|
10320
10320
|
function t(t) {
|
|
10321
10321
|
this.databaseInfo = t, this.databaseId = t.databaseId;
|
|
10322
10322
|
var e = t.ssl ? "https" : "http";
|
|
10323
|
-
this.
|
|
10323
|
+
this.Fi = e + "://" + t.host, this.Li = "projects/" + this.databaseId.projectId + "/databases/" + this.databaseId.database + "/documents";
|
|
10324
10324
|
}
|
|
10325
10325
|
return t.prototype.Bi = function(t, e, n, r, i) {
|
|
10326
10326
|
var o = this.Ui(t, e);
|
|
@@ -10342,7 +10342,7 @@ var qo = /** @class */ function() {
|
|
|
10342
10342
|
* present and any additional headers for the request.
|
|
10343
10343
|
*/
|
|
10344
10344
|
t.prototype.qi = function(t, e, n) {
|
|
10345
|
-
t["X-Goog-Api-Client"] = "gl-js/ fire/" +
|
|
10345
|
+
t["X-Goog-Api-Client"] = "gl-js/ fire/" + M,
|
|
10346
10346
|
// Content-Type: text/plain will avoid preflight requests which might
|
|
10347
10347
|
// mess with CORS and redirects by proxies. If we add custom headers
|
|
10348
10348
|
// we will need to change this code to potentially use the $httpOverwrite
|
|
@@ -10355,7 +10355,7 @@ var qo = /** @class */ function() {
|
|
|
10355
10355
|
}));
|
|
10356
10356
|
}, t.prototype.Ui = function(t, e) {
|
|
10357
10357
|
var n = Ho[t];
|
|
10358
|
-
return this.
|
|
10358
|
+
return this.Fi + "/v1/" + e + ":" + n;
|
|
10359
10359
|
}, t;
|
|
10360
10360
|
}());
|
|
10361
10361
|
|
|
@@ -10466,7 +10466,7 @@ function Xo() {
|
|
|
10466
10466
|
* much as 1.5*maxDelayMs.
|
|
10467
10467
|
*/ , i) {
|
|
10468
10468
|
void 0 === n && (n = 1e3), void 0 === r && (r = 1.5), void 0 === i && (i = 6e4),
|
|
10469
|
-
this.
|
|
10469
|
+
this.Me = t, this.timerId = e, this.Wi = n, this.Gi = r, this.zi = i, this.Hi = 0,
|
|
10470
10470
|
this.Ji = null,
|
|
10471
10471
|
/** The last backoff attempt, as epoch milliseconds. */
|
|
10472
10472
|
this.Yi = Date.now(), this.reset();
|
|
@@ -10501,7 +10501,7 @@ function Xo() {
|
|
|
10501
10501
|
var n = Math.floor(this.Hi + this.tr()), r = Math.max(0, Date.now() - this.Yi), i = Math.max(0, n - r);
|
|
10502
10502
|
// Guard against lastAttemptTime being in the future due to a clock change.
|
|
10503
10503
|
i > 0 && U("ExponentialBackoff", "Backing off for " + i + " ms (base delay: " + this.Hi + " ms, delay with jitter: " + n + " ms, last attempt: " + r + " ms ago)"),
|
|
10504
|
-
this.Ji = this.
|
|
10504
|
+
this.Ji = this.Me.enqueueAfterDelay(this.timerId, i, (function() {
|
|
10505
10505
|
return e.Yi = Date.now(), t();
|
|
10506
10506
|
})),
|
|
10507
10507
|
// Apply backoff factor to determine next delay and ensure it is within
|
|
@@ -10517,7 +10517,7 @@ function Xo() {
|
|
|
10517
10517
|
}, t;
|
|
10518
10518
|
}(), es = /** @class */ function() {
|
|
10519
10519
|
function t(t, e, n, r, i, o, s, a) {
|
|
10520
|
-
this.
|
|
10520
|
+
this.Me = t, this.nr = n, this.sr = r, this.ir = i, this.authCredentialsProvider = o,
|
|
10521
10521
|
this.appCheckCredentialsProvider = s, this.listener = a, this.state = 0 /* Initial */ ,
|
|
10522
10522
|
/**
|
|
10523
10523
|
* A close count that's incremented every time the stream is closed; used by
|
|
@@ -10600,7 +10600,7 @@ function Xo() {
|
|
|
10600
10600
|
var t = this;
|
|
10601
10601
|
// Starts the idle time if we are in state 'Open' and are not yet already
|
|
10602
10602
|
// running a timer (in which case the previous idle timeout still applies).
|
|
10603
|
-
this.lr() && null === this.ar && (this.ar = this.
|
|
10603
|
+
this.lr() && null === this.ar && (this.ar = this.Me.enqueueAfterDelay(this.nr, 6e4, (function() {
|
|
10604
10604
|
return t.mr();
|
|
10605
10605
|
})));
|
|
10606
10606
|
},
|
|
@@ -10700,7 +10700,7 @@ function Xo() {
|
|
|
10700
10700
|
var n = this, r = this.Er(this.rr);
|
|
10701
10701
|
this.stream = this.Rr(t, e), this.stream.Di((function() {
|
|
10702
10702
|
r((function() {
|
|
10703
|
-
return n.state = 2 /* Open */ , n.cr = n.
|
|
10703
|
+
return n.state = 2 /* Open */ , n.cr = n.Me.enqueueAfterDelay(n.sr, 1e4, (function() {
|
|
10704
10704
|
return n.lr() && (n.state = 3 /* Healthy */), Promise.resolve();
|
|
10705
10705
|
})), n.listener.Di();
|
|
10706
10706
|
}));
|
|
@@ -10740,7 +10740,7 @@ function Xo() {
|
|
|
10740
10740
|
t.prototype.Er = function(t) {
|
|
10741
10741
|
var e = this;
|
|
10742
10742
|
return function(n) {
|
|
10743
|
-
e.
|
|
10743
|
+
e.Me.enqueueAndForget((function() {
|
|
10744
10744
|
return e.rr === t ? n() : (U("PersistentStream", "stream callback skipped by getCloseGuardedDispatcher."),
|
|
10745
10745
|
Promise.resolve());
|
|
10746
10746
|
}));
|
|
@@ -10782,26 +10782,26 @@ function Xo() {
|
|
|
10782
10782
|
fields: u.document.fields
|
|
10783
10783
|
}
|
|
10784
10784
|
}), l = Xt.newFoundDocument(c, h, f), d = u.targetIds || [], p = u.removedTargetIds || [];
|
|
10785
|
-
n = new
|
|
10785
|
+
n = new Mn(d, p, l.key, l);
|
|
10786
10786
|
} else if ("documentDelete" in e) {
|
|
10787
10787
|
e.documentDelete;
|
|
10788
10788
|
var y = e.documentDelete;
|
|
10789
10789
|
y.document;
|
|
10790
10790
|
var v = $n(t, y.document), m = y.readTime ? Yn(y.readTime) : dt.min(), g = Xt.newNoDocument(v, m), w = y.removedTargetIds || [];
|
|
10791
|
-
n = new
|
|
10791
|
+
n = new Mn([], w, g.key, g);
|
|
10792
10792
|
} else if ("documentRemove" in e) {
|
|
10793
10793
|
e.documentRemove;
|
|
10794
10794
|
var b = e.documentRemove;
|
|
10795
10795
|
b.document;
|
|
10796
10796
|
var I = $n(t, b.document), T = b.removedTargetIds || [];
|
|
10797
|
-
n = new
|
|
10797
|
+
n = new Mn([], T, I, null);
|
|
10798
10798
|
} else {
|
|
10799
10799
|
if (!("filter" in e)) return G();
|
|
10800
10800
|
e.filter;
|
|
10801
10801
|
var E = e.filter;
|
|
10802
10802
|
E.targetId;
|
|
10803
10803
|
var S = E.count || 0, _ = new vn(S), k = E.targetId;
|
|
10804
|
-
n = new
|
|
10804
|
+
n = new Fn(k, _);
|
|
10805
10805
|
}
|
|
10806
10806
|
return n;
|
|
10807
10807
|
}(this.k, t), n = function(t) {
|
|
@@ -10978,13 +10978,13 @@ function Xo() {
|
|
|
10978
10978
|
* maximum defined by MAX_WATCH_STREAM_FAILURES, we'll set the OnlineState to
|
|
10979
10979
|
* Offline.
|
|
10980
10980
|
*/
|
|
10981
|
-
this.
|
|
10981
|
+
this.Mr = 0,
|
|
10982
10982
|
/**
|
|
10983
10983
|
* A timer that elapses after ONLINE_STATE_TIMEOUT_MS, at which point we
|
|
10984
10984
|
* transition from OnlineState.Unknown to OnlineState.Offline without waiting
|
|
10985
10985
|
* for the stream to actually fail (MAX_WATCH_STREAM_FAILURES times).
|
|
10986
10986
|
*/
|
|
10987
|
-
this.
|
|
10987
|
+
this.Fr = null,
|
|
10988
10988
|
/**
|
|
10989
10989
|
* Whether the client should log a warning message if it fails to connect to
|
|
10990
10990
|
* the backend (initially true, cleared after a successful stream, or if we've
|
|
@@ -11001,8 +11001,8 @@ function Xo() {
|
|
|
11001
11001
|
}
|
|
11002
11002
|
return t.prototype.Br = function() {
|
|
11003
11003
|
var t = this;
|
|
11004
|
-
0 === this.
|
|
11005
|
-
return t.
|
|
11004
|
+
0 === this.Mr && (this.Ur("Unknown" /* Unknown */), this.Fr = this.asyncQueue.enqueueAfterDelay("online_state_timeout" /* OnlineStateTimeout */ , 1e4, (function() {
|
|
11005
|
+
return t.Fr = null, t.qr("Backend didn't respond within 10 seconds."), t.Ur("Offline" /* Offline */),
|
|
11006
11006
|
Promise.resolve();
|
|
11007
11007
|
})));
|
|
11008
11008
|
},
|
|
@@ -11013,8 +11013,8 @@ function Xo() {
|
|
|
11013
11013
|
* actually transition to the 'Offline' state.
|
|
11014
11014
|
*/
|
|
11015
11015
|
t.prototype.Kr = function(t) {
|
|
11016
|
-
"Online" /* Online */ === this.state ? this.Ur("Unknown" /* Unknown */) : (this.
|
|
11017
|
-
this.
|
|
11016
|
+
"Online" /* Online */ === this.state ? this.Ur("Unknown" /* Unknown */) : (this.Mr++,
|
|
11017
|
+
this.Mr >= 1 && (this.jr(), this.qr("Connection failed 1 times. Most recent error: " + t.toString()),
|
|
11018
11018
|
this.Ur("Offline" /* Offline */)));
|
|
11019
11019
|
},
|
|
11020
11020
|
/**
|
|
@@ -11025,7 +11025,7 @@ function Xo() {
|
|
|
11025
11025
|
* handleWatchStreamStart() and handleWatchStreamFailure().
|
|
11026
11026
|
*/
|
|
11027
11027
|
t.prototype.set = function(t) {
|
|
11028
|
-
this.jr(), this.
|
|
11028
|
+
this.jr(), this.Mr = 0, "Online" /* Online */ === t && (
|
|
11029
11029
|
// We've connected to watch at least once. Don't warn the developer
|
|
11030
11030
|
// about being offline going forward.
|
|
11031
11031
|
this.Lr = !1), this.Ur(t);
|
|
@@ -11035,7 +11035,7 @@ function Xo() {
|
|
|
11035
11035
|
var e = "Could not reach Cloud Firestore backend. " + t + "\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.";
|
|
11036
11036
|
this.Lr ? (B(e), this.Lr = !1) : U("OnlineStateTracker", e);
|
|
11037
11037
|
}, t.prototype.jr = function() {
|
|
11038
|
-
null !== this.
|
|
11038
|
+
null !== this.Fr && (this.Fr.cancel(), this.Fr = null);
|
|
11039
11039
|
}, t;
|
|
11040
11040
|
}(), ss = function(
|
|
11041
11041
|
/**
|
|
@@ -11369,7 +11369,7 @@ function ws(t, e, i) {
|
|
|
11369
11369
|
return [ 3 /*break*/ , 13 ];
|
|
11370
11370
|
|
|
11371
11371
|
case 6:
|
|
11372
|
-
if (e instanceof
|
|
11372
|
+
if (e instanceof Mn ? t.Yr.ot(e) : e instanceof Fn ? t.Yr.dt(e) : t.Yr.ut(e), i.isEqual(dt.min())) return [ 3 /*break*/ , 13 ];
|
|
11373
11373
|
u.label = 7;
|
|
11374
11374
|
|
|
11375
11375
|
case 7:
|
|
@@ -11997,7 +11997,7 @@ var Rs = /** @class */ function() {
|
|
|
11997
11997
|
t.push(n);
|
|
11998
11998
|
})), t;
|
|
11999
11999
|
}, t;
|
|
12000
|
-
}(),
|
|
12000
|
+
}(), Ms = /** @class */ function() {
|
|
12001
12001
|
function t(t, e, n, r, i, o, s, a) {
|
|
12002
12002
|
this.query = t, this.docs = e, this.oldDocs = n, this.docChanges = r, this.mutatedKeys = i,
|
|
12003
12003
|
this.fromCache = o, this.syncStateChanged = s, this.excludesMetadataChanges = a
|
|
@@ -12026,7 +12026,7 @@ var Rs = /** @class */ function() {
|
|
|
12026
12026
|
for (var r = 0; r < e.length; r++) if (e[r].type !== n[r].type || !e[r].doc.isEqual(n[r].doc)) return !1;
|
|
12027
12027
|
return !0;
|
|
12028
12028
|
}, t;
|
|
12029
|
-
}(),
|
|
12029
|
+
}(), Fs = function() {
|
|
12030
12030
|
this.so = void 0, this.listeners = [];
|
|
12031
12031
|
}, Vs = function() {
|
|
12032
12032
|
this.queries = new zi((function(t) {
|
|
@@ -12059,7 +12059,7 @@ var Rs = /** @class */ function() {
|
|
|
12059
12059
|
return r(this, (function(r) {
|
|
12060
12060
|
switch (r.label) {
|
|
12061
12061
|
case 0:
|
|
12062
|
-
if (n = W(t), i = e.query, o = !1, (s = n.queries.get(i)) || (o = !0, s = new
|
|
12062
|
+
if (n = W(t), i = e.query, o = !1, (s = n.queries.get(i)) || (o = !0, s = new Fs),
|
|
12063
12063
|
!o) return [ 3 /*break*/ , 4 ];
|
|
12064
12064
|
r.label = 1;
|
|
12065
12065
|
|
|
@@ -12150,7 +12150,7 @@ function Ks(t) {
|
|
|
12150
12150
|
var i = r[n];
|
|
12151
12151
|
3 /* Metadata */ !== i.type && e.push(i);
|
|
12152
12152
|
}
|
|
12153
|
-
t = new
|
|
12153
|
+
t = new Ms(t.query, t.docs, t.oldDocs, e, t.mutatedKeys, t.fromCache, t.syncStateChanged,
|
|
12154
12154
|
/* excludesMetadataChanges= */ !0);
|
|
12155
12155
|
}
|
|
12156
12156
|
var o = !1;
|
|
@@ -12186,7 +12186,7 @@ function Ks(t) {
|
|
|
12186
12186
|
// to get here if there were only metadata docChanges and they got
|
|
12187
12187
|
// stripped out.
|
|
12188
12188
|
}, t.prototype.fo = function(t) {
|
|
12189
|
-
t =
|
|
12189
|
+
t = Ms.fromInitialDocuments(t.query, t.docs, t.mutatedKeys, t.fromCache), this.co = !0,
|
|
12190
12190
|
this.ao.next(t);
|
|
12191
12191
|
}, t;
|
|
12192
12192
|
}(), zs = /** @class */ function() {
|
|
@@ -12467,7 +12467,7 @@ function Hs(t) {
|
|
|
12467
12467
|
})), this.So(n);
|
|
12468
12468
|
var s = e ? this.Do() : [], a = 0 === this.Io.size && this.current ? 1 /* Synced */ : 0 /* Local */ , u = a !== this.Eo;
|
|
12469
12469
|
return this.Eo = a, 0 !== o.length || u ? {
|
|
12470
|
-
snapshot: new
|
|
12470
|
+
snapshot: new Ms(this.query, t.Ro, i, o, t.mutatedKeys, 0 /* Local */ === a, u,
|
|
12471
12471
|
/* excludesMetadataChanges= */ !1),
|
|
12472
12472
|
Co: s
|
|
12473
12473
|
} : {
|
|
@@ -12565,7 +12565,7 @@ function Hs(t) {
|
|
|
12565
12565
|
*/
|
|
12566
12566
|
// PORTING NOTE: Multi-tab only.
|
|
12567
12567
|
t.prototype.xo = function() {
|
|
12568
|
-
return
|
|
12568
|
+
return Ms.fromInitialDocuments(this.query, this.Ro, this.mutatedKeys, 0 /* Local */ === this.Eo);
|
|
12569
12569
|
}, t;
|
|
12570
12570
|
}(), Zs = function(
|
|
12571
12571
|
/**
|
|
@@ -12599,9 +12599,9 @@ n) {
|
|
|
12599
12599
|
// PORTING NOTE: Manages state synchronization in multi-tab environments.
|
|
12600
12600
|
r, i, o) {
|
|
12601
12601
|
this.localStore = t, this.remoteStore = e, this.eventManager = n, this.sharedClientState = r,
|
|
12602
|
-
this.currentUser = i, this.maxConcurrentLimboResolutions = o, this.Oo = {}, this.
|
|
12602
|
+
this.currentUser = i, this.maxConcurrentLimboResolutions = o, this.Oo = {}, this.Mo = new zi((function(t) {
|
|
12603
12603
|
return Ce(t);
|
|
12604
|
-
}), Ne), this.
|
|
12604
|
+
}), Ne), this.Fo = new Map,
|
|
12605
12605
|
/**
|
|
12606
12606
|
* The keys of documents that are in limbo for which we haven't yet started a
|
|
12607
12607
|
* limbo resolution query. The strings in this set are the result of calling
|
|
@@ -12651,7 +12651,7 @@ function ea(t, e) {
|
|
|
12651
12651
|
return r(this, (function(r) {
|
|
12652
12652
|
switch (r.label) {
|
|
12653
12653
|
case 0:
|
|
12654
|
-
return n = Ca(t), (s = n.
|
|
12654
|
+
return n = Ca(t), (s = n.Mo.get(e)) ? (
|
|
12655
12655
|
// PORTING NOTE: With Multi-Tab Web, it is possible that a query view
|
|
12656
12656
|
// already exists when EventManager calls us for the first time. This
|
|
12657
12657
|
// happens when the primary tab is already listening to this query on
|
|
@@ -12723,7 +12723,7 @@ function ea(t, e) {
|
|
|
12723
12723
|
return s = l.sent(), a = new Xs(e, s.zn), u = a.Po(s.documents), c = On.createSynthesizedTargetChangeForCurrentChange(i, o && "Offline" /* Offline */ !== t.onlineState),
|
|
12724
12724
|
h = a.applyChanges(u,
|
|
12725
12725
|
/* updateLimboDocuments= */ t.isPrimaryClient, c), ya(t, i, h.Co), f = new Zs(e, i, a),
|
|
12726
|
-
[ 2 /*return*/ , (t.
|
|
12726
|
+
[ 2 /*return*/ , (t.Mo.set(e, f), t.Fo.has(i) ? t.Fo.get(i).push(e) : t.Fo.set(i, [ e ]),
|
|
12727
12727
|
h.snapshot) ];
|
|
12728
12728
|
}
|
|
12729
12729
|
}));
|
|
@@ -12736,9 +12736,9 @@ function ea(t, e) {
|
|
|
12736
12736
|
return r(this, (function(r) {
|
|
12737
12737
|
switch (r.label) {
|
|
12738
12738
|
case 0:
|
|
12739
|
-
return n = W(t), i = n.
|
|
12739
|
+
return n = W(t), i = n.Mo.get(e), (o = n.Fo.get(i.targetId)).length > 1 ? [ 2 /*return*/ , (n.Fo.set(i.targetId, o.filter((function(t) {
|
|
12740
12740
|
return !Ne(t, e);
|
|
12741
|
-
}))), void n.
|
|
12741
|
+
}))), void n.Mo.delete(e)) ] : n.isPrimaryClient ? (
|
|
12742
12742
|
// We need to remove the local query target first to allow us to verify
|
|
12743
12743
|
// whether any other client is still interested in this target.
|
|
12744
12744
|
n.sharedClientState.removeLocalQueryTarget(i.targetId), n.sharedClientState.isActiveQueryTarget(i.targetId) ? [ 3 /*break*/ , 2 ] : [ 4 /*yield*/ , wo(n.localStore, i.targetId,
|
|
@@ -12894,7 +12894,7 @@ function ea(t, e) {
|
|
|
12894
12894
|
// SharedClientState.
|
|
12895
12895
|
if (r.isPrimaryClient && 0 /* RemoteStore */ === n || !r.isPrimaryClient && 1 /* SharedClientState */ === n) {
|
|
12896
12896
|
var i = [];
|
|
12897
|
-
r.
|
|
12897
|
+
r.Mo.forEach((function(t, n) {
|
|
12898
12898
|
var r = n.view.ro(e);
|
|
12899
12899
|
r.snapshot && i.push(r.snapshot);
|
|
12900
12900
|
})), function(t, e) {
|
|
@@ -13108,11 +13108,11 @@ function la(t, e, n) {
|
|
|
13108
13108
|
|
|
13109
13109
|
function da(t, e, n) {
|
|
13110
13110
|
void 0 === n && (n = null), t.sharedClientState.removeLocalQueryTarget(e);
|
|
13111
|
-
for (var r = 0, i = t.
|
|
13111
|
+
for (var r = 0, i = t.Fo.get(e); r < i.length; r++) {
|
|
13112
13112
|
var o = i[r];
|
|
13113
|
-
t.
|
|
13113
|
+
t.Mo.delete(o), n && t.Oo.zo(o, n);
|
|
13114
13114
|
}
|
|
13115
|
-
t.
|
|
13115
|
+
t.Fo.delete(e), t.isPrimaryClient && t.qo.us(e).forEach((function(e) {
|
|
13116
13116
|
t.qo.containsKey(e) ||
|
|
13117
13117
|
// We removed the last reference for this key
|
|
13118
13118
|
pa(t, e);
|
|
@@ -13165,7 +13165,7 @@ function ga(t, e, i) {
|
|
|
13165
13165
|
return r(this, (function(c) {
|
|
13166
13166
|
switch (c.label) {
|
|
13167
13167
|
case 0:
|
|
13168
|
-
return o = W(t), s = [], a = [], u = [], o.
|
|
13168
|
+
return o = W(t), s = [], a = [], u = [], o.Mo.isEmpty() ? [ 3 /*break*/ , 3 ] : (o.Mo.forEach((function(t, n) {
|
|
13169
13169
|
u.push(o.Go(n, e, i).then((function(t) {
|
|
13170
13170
|
if (t) {
|
|
13171
13171
|
o.isPrimaryClient && o.sharedClientState.updateQueryState(n.targetId, t.fromCache ? "not-current" : "current"),
|
|
@@ -13266,10 +13266,10 @@ function wa(t, e) {
|
|
|
13266
13266
|
function ba(t, e) {
|
|
13267
13267
|
var n = W(t), r = n.Uo.get(e);
|
|
13268
13268
|
if (r && r.$o) return xn().add(r.key);
|
|
13269
|
-
var i = xn(), o = n.
|
|
13269
|
+
var i = xn(), o = n.Fo.get(e);
|
|
13270
13270
|
if (!o) return i;
|
|
13271
13271
|
for (var s = 0, a = o; s < a.length; s++) {
|
|
13272
|
-
var u = a[s], c = n.
|
|
13272
|
+
var u = a[s], c = n.Mo.get(u);
|
|
13273
13273
|
i = i.unionWith(c.view.bo);
|
|
13274
13274
|
}
|
|
13275
13275
|
return i;
|
|
@@ -13388,7 +13388,7 @@ function Sa(t, e) {
|
|
|
13388
13388
|
|
|
13389
13389
|
case 3:
|
|
13390
13390
|
return !1 !== e || !1 === n.Wo ? [ 3 /*break*/ , 7 ] : (c = [], h = Promise.resolve(),
|
|
13391
|
-
n.
|
|
13391
|
+
n.Fo.forEach((function(t, e) {
|
|
13392
13392
|
n.sharedClientState.isLocalQueryTarget(e) ? c.push(e) : h = h.then((function() {
|
|
13393
13393
|
return da(n, e), wo(n.localStore, e,
|
|
13394
13394
|
/*keepPersistedTargetData=*/ !0);
|
|
@@ -13427,7 +13427,7 @@ function _a(t, e, i) {
|
|
|
13427
13427
|
n = W(t), i = [], o = [], s = 0, a = e, r.label = 1;
|
|
13428
13428
|
|
|
13429
13429
|
case 1:
|
|
13430
|
-
return s < a.length ? (u = a[s], c = void 0, (h = n.
|
|
13430
|
+
return s < a.length ? (u = a[s], c = void 0, (h = n.Fo.get(u)) && 0 !== h.length ? [ 4 /*yield*/ , go(n.localStore, Ae(h[0])) ] : [ 3 /*break*/ , 7 ]) : [ 3 /*break*/ , 13 ];
|
|
13431
13431
|
|
|
13432
13432
|
case 2:
|
|
13433
13433
|
// For queries that have a local View, we fetch their current state
|
|
@@ -13437,7 +13437,7 @@ function _a(t, e, i) {
|
|
|
13437
13437
|
c = r.sent(), f = 0, l = h, r.label = 3;
|
|
13438
13438
|
|
|
13439
13439
|
case 3:
|
|
13440
|
-
return f < l.length ? (d = l[f], p = n.
|
|
13440
|
+
return f < l.length ? (d = l[f], p = n.Mo.get(d), [ 4 /*yield*/ , Ia(n, p) ]) : [ 3 /*break*/ , 6 ];
|
|
13441
13441
|
|
|
13442
13442
|
case 4:
|
|
13443
13443
|
(y = r.sent()).snapshot && o.push(y.snapshot), r.label = 5;
|
|
@@ -13510,7 +13510,7 @@ function Da(t, e, i, o) {
|
|
|
13510
13510
|
U("SyncEngine", "Ignoring unexpected query state notification."), [ 3 /*break*/ , 8 ]) : [ 3 /*break*/ , 1 ];
|
|
13511
13511
|
|
|
13512
13512
|
case 1:
|
|
13513
|
-
if (!n.
|
|
13513
|
+
if (!n.Fo.has(e)) return [ 3 /*break*/ , 8 ];
|
|
13514
13514
|
switch (i) {
|
|
13515
13515
|
case "current":
|
|
13516
13516
|
case "not-current":
|
|
@@ -13558,7 +13558,7 @@ function Da(t, e, i, o) {
|
|
|
13558
13558
|
o = 0, s = e, p.label = 1;
|
|
13559
13559
|
|
|
13560
13560
|
case 1:
|
|
13561
|
-
return o < s.length ? (a = s[o], n.
|
|
13561
|
+
return o < s.length ? (a = s[o], n.Fo.has(a) ? (
|
|
13562
13562
|
// A target might have been added in a previous attempt
|
|
13563
13563
|
U("SyncEngine", "Adding an already active target " + a), [ 3 /*break*/ , 5 ]) : [ 4 /*yield*/ , Io(n.localStore, a) ]) : [ 3 /*break*/ , 6 ];
|
|
13564
13564
|
|
|
@@ -13580,7 +13580,7 @@ function Da(t, e, i, o) {
|
|
|
13580
13580
|
return r(this, (function(e) {
|
|
13581
13581
|
switch (e.label) {
|
|
13582
13582
|
case 0:
|
|
13583
|
-
return n.
|
|
13583
|
+
return n.Fo.has(t) ? [ 4 /*yield*/ , wo(n.localStore, t,
|
|
13584
13584
|
/* keepPersistedTargetData */ !1).then((function() {
|
|
13585
13585
|
hs(n.remoteStore, t), da(n, t);
|
|
13586
13586
|
})).catch(Vi) ] : [ 3 /*break*/ , 2 ];
|
|
@@ -13901,7 +13901,7 @@ var La = /** @class */ function() {
|
|
|
13901
13901
|
var n = io(t.databaseInfo.databaseId, t.databaseInfo.persistenceKey);
|
|
13902
13902
|
return new Go(e, t.asyncQueue, n, t.clientId, t.initialUser);
|
|
13903
13903
|
}, i;
|
|
13904
|
-
}(Pa),
|
|
13904
|
+
}(Pa), Ma = /** @class */ function() {
|
|
13905
13905
|
function t() {}
|
|
13906
13906
|
return t.prototype.initialize = function(t, e) {
|
|
13907
13907
|
return n(this, void 0, void 0, (function() {
|
|
@@ -13997,7 +13997,7 @@ var La = /** @class */ function() {
|
|
|
13997
13997
|
* @param bytesPerRead - How many bytes each `read()` from the returned reader
|
|
13998
13998
|
* will read.
|
|
13999
13999
|
*/
|
|
14000
|
-
function
|
|
14000
|
+
function Fa(t, e) {
|
|
14001
14001
|
void 0 === e && (e = 10240);
|
|
14002
14002
|
var i = 0;
|
|
14003
14003
|
// The TypeScript definition for ReadableStreamReader changed. We use
|
|
@@ -14712,7 +14712,7 @@ function Qa(t) {
|
|
|
14712
14712
|
switch (e.label) {
|
|
14713
14713
|
case 0:
|
|
14714
14714
|
return t.onlineComponents ? [ 3 /*break*/ , 2 ] : (U("FirestoreClient", "Using default OnlineComponentProvider"),
|
|
14715
|
-
[ 4 /*yield*/ , Ga(t, new
|
|
14715
|
+
[ 4 /*yield*/ , Ga(t, new Ma) ]);
|
|
14716
14716
|
|
|
14717
14717
|
case 1:
|
|
14718
14718
|
e.sent(), e.label = 2;
|
|
@@ -15787,7 +15787,7 @@ function Nu(t) {
|
|
|
15787
15787
|
* @returns A `Promise` that represents successfully enabling persistent storage.
|
|
15788
15788
|
*/ function Cu(t, e) {
|
|
15789
15789
|
Uu(t = uu(t, _u));
|
|
15790
|
-
var n = Du(t), r = t._freezeSettings(), i = new
|
|
15790
|
+
var n = Du(t), r = t._freezeSettings(), i = new Ma;
|
|
15791
15791
|
return Ru(n, i, new Pa(i, r.cacheSizeBytes, null == e ? void 0 : e.forceOwnership));
|
|
15792
15792
|
}
|
|
15793
15793
|
|
|
@@ -15814,7 +15814,7 @@ function Nu(t) {
|
|
|
15814
15814
|
* storage.
|
|
15815
15815
|
*/ function xu(t) {
|
|
15816
15816
|
Uu(t = uu(t, _u));
|
|
15817
|
-
var e = Du(t), n = t._freezeSettings(), r = new
|
|
15817
|
+
var e = Du(t), n = t._freezeSettings(), r = new Ma;
|
|
15818
15818
|
return Ru(e, r, new Oa(r, n.cacheSizeBytes));
|
|
15819
15819
|
}
|
|
15820
15820
|
|
|
@@ -15978,7 +15978,7 @@ function Pu(t) {
|
|
|
15978
15978
|
* operations will be queued until the network is restored.
|
|
15979
15979
|
*
|
|
15980
15980
|
* @returns A `Promise` that is resolved once the network has been disabled.
|
|
15981
|
-
*/ function
|
|
15981
|
+
*/ function Mu(t) {
|
|
15982
15982
|
return function(t) {
|
|
15983
15983
|
var e = this;
|
|
15984
15984
|
return t.asyncQueue.enqueue((function() {
|
|
@@ -16042,7 +16042,7 @@ function Pu(t) {
|
|
|
16042
16042
|
*
|
|
16043
16043
|
* @returns A `Promise` that is resolved when the instance has been successfully
|
|
16044
16044
|
* terminated.
|
|
16045
|
-
*/ function
|
|
16045
|
+
*/ function Fu(t) {
|
|
16046
16046
|
return u(t.app, "firestore"), t._delete()
|
|
16047
16047
|
/**
|
|
16048
16048
|
* Loads a Firestore bundle into the local cache.
|
|
@@ -16064,8 +16064,8 @@ function Vu(t, e) {
|
|
|
16064
16064
|
return function(t, e) {
|
|
16065
16065
|
return new qa(t, e);
|
|
16066
16066
|
}(function(t, e) {
|
|
16067
|
-
if (t instanceof Uint8Array) return
|
|
16068
|
-
if (t instanceof ArrayBuffer) return
|
|
16067
|
+
if (t instanceof Uint8Array) return Fa(t, e);
|
|
16068
|
+
if (t instanceof ArrayBuffer) return Fa(new Uint8Array(t), e);
|
|
16069
16069
|
if (t instanceof ReadableStream) return t.getReader();
|
|
16070
16070
|
throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream");
|
|
16071
16071
|
}("string" == typeof t ? (new TextEncoder).encode(t) : t), e);
|
|
@@ -16427,13 +16427,13 @@ function(t) {
|
|
|
16427
16427
|
}, t.prototype.Oa = function(t) {
|
|
16428
16428
|
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.$a({
|
|
16429
16429
|
path: n,
|
|
16430
|
-
|
|
16430
|
+
Ma: !1
|
|
16431
16431
|
});
|
|
16432
|
-
return r.
|
|
16432
|
+
return r.Fa(t), r;
|
|
16433
16433
|
}, t.prototype.La = function(t) {
|
|
16434
16434
|
var e, n = null === (e = this.path) || void 0 === e ? void 0 : e.child(t), r = this.$a({
|
|
16435
16435
|
path: n,
|
|
16436
|
-
|
|
16436
|
+
Ma: !1
|
|
16437
16437
|
});
|
|
16438
16438
|
return r.ka(), r;
|
|
16439
16439
|
}, t.prototype.Ba = function(t) {
|
|
@@ -16441,7 +16441,7 @@ function(t) {
|
|
|
16441
16441
|
// undefined.
|
|
16442
16442
|
return this.$a({
|
|
16443
16443
|
path: void 0,
|
|
16444
|
-
|
|
16444
|
+
Ma: !0
|
|
16445
16445
|
});
|
|
16446
16446
|
}, t.prototype.Ua = function(t) {
|
|
16447
16447
|
return vc(t, this.settings.methodName, this.settings.qa || !1, this.path, this.settings.Ka);
|
|
@@ -16455,8 +16455,8 @@ function(t) {
|
|
|
16455
16455
|
}, t.prototype.ka = function() {
|
|
16456
16456
|
// TODO(b/34871131): Remove null check once we have proper paths for fields
|
|
16457
16457
|
// within arrays.
|
|
16458
|
-
if (this.path) for (var t = 0; t < this.path.length; t++) this.
|
|
16459
|
-
}, t.prototype.
|
|
16458
|
+
if (this.path) for (var t = 0; t < this.path.length; t++) this.Fa(this.path.get(t));
|
|
16459
|
+
}, t.prototype.Fa = function(t) {
|
|
16460
16460
|
if (0 === t.length) throw this.Ua("Document fields must not be empty");
|
|
16461
16461
|
if (Yu(this.xa) && Qu.test(t)) throw this.Ua('Document fields cannot begin and end with "__"');
|
|
16462
16462
|
}, t;
|
|
@@ -16471,7 +16471,7 @@ function(t) {
|
|
|
16471
16471
|
methodName: e,
|
|
16472
16472
|
Ka: n,
|
|
16473
16473
|
path: bt.emptyPath(),
|
|
16474
|
-
|
|
16474
|
+
Ma: !1,
|
|
16475
16475
|
qa: r
|
|
16476
16476
|
}, this.databaseId, this.k, this.ignoreUndefinedProperties);
|
|
16477
16477
|
}, t;
|
|
@@ -16537,7 +16537,7 @@ var tc = /** @class */ function(e) {
|
|
|
16537
16537
|
xa: 3 /* Argument */ ,
|
|
16538
16538
|
Ka: e.settings.Ka,
|
|
16539
16539
|
methodName: t._methodName,
|
|
16540
|
-
|
|
16540
|
+
Ma: n
|
|
16541
16541
|
}, e.databaseId, e.k, e.ignoreUndefinedProperties);
|
|
16542
16542
|
}
|
|
16543
16543
|
|
|
@@ -16586,7 +16586,7 @@ var nc = /** @class */ function(e) {
|
|
|
16586
16586
|
return (r = e.call(this, t) || this).Wa = n, r;
|
|
16587
16587
|
}
|
|
16588
16588
|
return t(n, e), n.prototype._toFieldTransform = function(t) {
|
|
16589
|
-
var e = new We(t.k,
|
|
16589
|
+
var e = new We(t.k, Fe(t.k, this.Wa));
|
|
16590
16590
|
return new Je(t.path, e);
|
|
16591
16591
|
}, n.prototype.isEqual = function(t) {
|
|
16592
16592
|
// TODO(mrschmidt): Implement isEquals
|
|
@@ -16662,7 +16662,7 @@ var nc = /** @class */ function(e) {
|
|
|
16662
16662
|
// from firestore-exp.
|
|
16663
16663
|
t = I(t))) return lc("Unsupported field value:", e, t), hc(t, e);
|
|
16664
16664
|
if (t instanceof Gu)
|
|
16665
|
-
// FieldValues usually parse into transforms (except
|
|
16665
|
+
// FieldValues usually parse into transforms (except deleteField())
|
|
16666
16666
|
// in which case we do not want to include this field in our parsed data
|
|
16667
16667
|
// (as doing so will overwrite the field directly prior to the transform
|
|
16668
16668
|
// trying to transform it). So we don't add this location to
|
|
@@ -16693,7 +16693,7 @@ var nc = /** @class */ function(e) {
|
|
|
16693
16693
|
// the set of values to be included for the IN query) that may directly
|
|
16694
16694
|
// contain additional arrays (each representing an individual field
|
|
16695
16695
|
// value), so we disable this validation.
|
|
16696
|
-
if (e.settings.
|
|
16696
|
+
if (e.settings.Ma && 4 /* ArrayArgument */ !== e.xa) throw e.Ua("Nested arrays are not supported");
|
|
16697
16697
|
return function(t, e) {
|
|
16698
16698
|
for (var n = [], r = 0, i = 0, o = t; i < o.length; i++) {
|
|
16699
16699
|
var s = cc(o[i], e.Ba(r));
|
|
@@ -16715,7 +16715,7 @@ var nc = /** @class */ function(e) {
|
|
|
16715
16715
|
if (null === (t = I(t))) return {
|
|
16716
16716
|
nullValue: "NULL_VALUE"
|
|
16717
16717
|
};
|
|
16718
|
-
if ("number" == typeof t) return
|
|
16718
|
+
if ("number" == typeof t) return Fe(e.k, t);
|
|
16719
16719
|
if ("boolean" == typeof t) return {
|
|
16720
16720
|
booleanValue: t
|
|
16721
16721
|
};
|
|
@@ -16793,7 +16793,7 @@ function lc(t, e, n) {
|
|
|
16793
16793
|
// FieldPath.
|
|
16794
16794
|
(e = I(e)) instanceof Bu) return e._internalPath;
|
|
16795
16795
|
if ("string" == typeof e) return yc(t, e);
|
|
16796
|
-
throw vc("Field path arguments must be of type string or
|
|
16796
|
+
throw vc("Field path arguments must be of type string or ", t,
|
|
16797
16797
|
/* hasConverter= */ !1,
|
|
16798
16798
|
/* path= */ void 0, n);
|
|
16799
16799
|
}
|
|
@@ -17013,7 +17013,7 @@ function bc(t, e) {
|
|
|
17013
17013
|
* Retrieves all fields in the document as an `Object`. Returns `undefined` if
|
|
17014
17014
|
* the document doesn't exist.
|
|
17015
17015
|
*
|
|
17016
|
-
* By default, `
|
|
17016
|
+
* By default, `serverTimestamp()` values that have not yet been
|
|
17017
17017
|
* set to their final value will be returned as `null`. You can override
|
|
17018
17018
|
* this by passing an options object.
|
|
17019
17019
|
*
|
|
@@ -17039,7 +17039,7 @@ function bc(t, e) {
|
|
|
17039
17039
|
* Retrieves the field specified by `fieldPath`. Returns `undefined` if the
|
|
17040
17040
|
* document or field doesn't exist.
|
|
17041
17041
|
*
|
|
17042
|
-
* By default, a `
|
|
17042
|
+
* By default, a `serverTimestamp()` that has not yet been set to
|
|
17043
17043
|
* its final value will be returned as `null`. You can override this by
|
|
17044
17044
|
* passing an options object.
|
|
17045
17045
|
*
|
|
@@ -17066,7 +17066,7 @@ function bc(t, e) {
|
|
|
17066
17066
|
/**
|
|
17067
17067
|
* Retrieves all fields in the document as an `Object`.
|
|
17068
17068
|
*
|
|
17069
|
-
* By default, `
|
|
17069
|
+
* By default, `serverTimestamp()` values that have not yet been
|
|
17070
17070
|
* set to their final value will be returned as `null`. You can override
|
|
17071
17071
|
* this by passing an options object.
|
|
17072
17072
|
*
|
|
@@ -17257,7 +17257,7 @@ var Cc = /** @class */ function(e) {
|
|
|
17257
17257
|
var e = Zu(t.firestore), n = function(t, e, n, r, i, o, s) {
|
|
17258
17258
|
var a;
|
|
17259
17259
|
if (i.isKeyField()) {
|
|
17260
|
-
if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new Y(H.INVALID_ARGUMENT, "Invalid Query. You can't perform '" + o + "' queries on
|
|
17260
|
+
if ("array-contains" /* ARRAY_CONTAINS */ === o || "array-contains-any" /* ARRAY_CONTAINS_ANY */ === o) throw new Y(H.INVALID_ARGUMENT, "Invalid Query. You can't perform '" + o + "' queries on documentId().");
|
|
17261
17261
|
if ("in" /* IN */ === o || "not-in" /* NOT_IN */ === o) {
|
|
17262
17262
|
zc(s, o);
|
|
17263
17263
|
for (var u = [], c = 0, h = s; c < h.length; c++) {
|
|
@@ -17416,11 +17416,11 @@ var Pc = /** @class */ function(e) {
|
|
|
17416
17416
|
*/;
|
|
17417
17417
|
}
|
|
17418
17418
|
|
|
17419
|
-
function
|
|
17419
|
+
function Mc(t) {
|
|
17420
17420
|
return cu("limitToLast", t), new Pc("limitToLast", t, "L" /* Last */);
|
|
17421
17421
|
}
|
|
17422
17422
|
|
|
17423
|
-
var
|
|
17423
|
+
var Fc = /** @class */ function(e) {
|
|
17424
17424
|
function n(t, n, r) {
|
|
17425
17425
|
var i = this;
|
|
17426
17426
|
return (i = e.call(this) || this).type = t, i.Za = n, i.tc = r, i;
|
|
@@ -17435,12 +17435,12 @@ var Mc = /** @class */ function(e) {
|
|
|
17435
17435
|
|
|
17436
17436
|
function Vc() {
|
|
17437
17437
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
17438
|
-
return new
|
|
17438
|
+
return new Fc("startAt", t, /*before=*/ !0);
|
|
17439
17439
|
}
|
|
17440
17440
|
|
|
17441
17441
|
function qc() {
|
|
17442
17442
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
17443
|
-
return new
|
|
17443
|
+
return new Fc("startAfter", t,
|
|
17444
17444
|
/*before=*/ !1);
|
|
17445
17445
|
}
|
|
17446
17446
|
|
|
@@ -17500,9 +17500,9 @@ function jc() {
|
|
|
17500
17500
|
var c = i[u];
|
|
17501
17501
|
if (s[u].field.isKeyField()) {
|
|
17502
17502
|
if ("string" != typeof c) throw new Y(H.INVALID_ARGUMENT, "Invalid query. Expected a string for document ID in " + r + "(), but got a " + typeof c);
|
|
17503
|
-
if (!_e(t) && -1 !== c.indexOf("/")) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying a collection and ordering by
|
|
17503
|
+
if (!_e(t) && -1 !== c.indexOf("/")) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying a collection and ordering by documentId(), the value passed to " + r + "() must be a plain document ID, but '" + c + "' contains a slash.");
|
|
17504
17504
|
var h = t.path.child(gt.fromString(c));
|
|
17505
|
-
if (!Pt.isDocumentKey(h)) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying a collection group and ordering by
|
|
17505
|
+
if (!Pt.isDocumentKey(h)) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying a collection group and ordering by documentId(), the value passed to " + r + "() must result in a valid document path, but '" + h + "' is not because it contains an odd number of segments.");
|
|
17506
17506
|
var f = new Pt(h);
|
|
17507
17507
|
a.push(jt(e, f));
|
|
17508
17508
|
} else {
|
|
@@ -17516,14 +17516,14 @@ function jc() {
|
|
|
17516
17516
|
|
|
17517
17517
|
function Gc(t, e, n) {
|
|
17518
17518
|
if ("string" == typeof (n = I(n))) {
|
|
17519
|
-
if ("" === n) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying with
|
|
17520
|
-
if (!_e(e) && -1 !== n.indexOf("/")) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying a collection by
|
|
17519
|
+
if ("" === n) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");
|
|
17520
|
+
if (!_e(e) && -1 !== n.indexOf("/")) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '" + n + "' contains a '/' character.");
|
|
17521
17521
|
var r = e.path.child(gt.fromString(n));
|
|
17522
|
-
if (!Pt.isDocumentKey(r)) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying a collection group by
|
|
17522
|
+
if (!Pt.isDocumentKey(r)) throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '" + r + "' is not because it has an odd number of segments (" + r.length + ").");
|
|
17523
17523
|
return jt(t, new Pt(r));
|
|
17524
17524
|
}
|
|
17525
17525
|
if (n instanceof du) return jt(t, n._key);
|
|
17526
|
-
throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying with
|
|
17526
|
+
throw new Y(H.INVALID_ARGUMENT, "Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: " + au(n) + ".");
|
|
17527
17527
|
}
|
|
17528
17528
|
|
|
17529
17529
|
/**
|
|
@@ -18437,14 +18437,14 @@ function hh(t, e) {
|
|
|
18437
18437
|
*/;
|
|
18438
18438
|
}
|
|
18439
18439
|
|
|
18440
|
-
void 0 === dh && (dh = !0),
|
|
18440
|
+
void 0 === dh && (dh = !0), M = i, o(new c("firestore", (function(t, e) {
|
|
18441
18441
|
var n = e.options, r = t.getProvider("app").getImmediate(), i = new _u(r, new tt(t.getProvider("auth-internal")), new it(t.getProvider("app-check-internal")));
|
|
18442
18442
|
return n = Object.assign({
|
|
18443
18443
|
useFetchStreams: dh
|
|
18444
18444
|
}, n), i._setSettings(n), i;
|
|
18445
|
-
}), "PUBLIC")), s(P, "3.4.
|
|
18445
|
+
}), "PUBLIC")), s(P, "3.4.3-canary.1b246ae04", void 0),
|
|
18446
18446
|
// BUILD_TARGET will be replaced by values like esm5, esm2017, cjs5, etc during the compilation
|
|
18447
|
-
s(P, "3.4.
|
|
18447
|
+
s(P, "3.4.3-canary.1b246ae04", "esm5");
|
|
18448
18448
|
|
|
18449
|
-
export { Wc as AbstractUserDataWriter, Ku as Bytes, Su as CACHE_SIZE_UNLIMITED, yu as CollectionReference, du as DocumentReference, Tc as DocumentSnapshot, Bu as FieldPath, Gu as FieldValue, _u as Firestore, Y as FirestoreError, zu as GeoPoint, Eu as LoadBundleTask, pu as Query, Dc as QueryConstraint, Ec as QueryDocumentSnapshot, Sc as QuerySnapshot, Ic as SnapshotMetadata, lt as Timestamp, ph as Transaction, Jc as WriteBatch, eu as _DatabaseId, Pt as _DocumentKey, ot as _EmptyAppCheckTokenProvider, Z as _EmptyAuthCredentialsProvider, bt as _FieldPath, uu as _cast, Q as _debugAssert, Tt as _isBase64Available, j as _logWarn, iu as _validateIsNotUsedTogether, uh as addDoc, wh as arrayRemove, gh as arrayUnion, Lu as clearIndexedDbPersistence, vu as collection, mu as collectionGroup, lu as connectFirestoreEmulator, ah as deleteDoc, vh as deleteField,
|
|
18449
|
+
export { Wc as AbstractUserDataWriter, Ku as Bytes, Su as CACHE_SIZE_UNLIMITED, yu as CollectionReference, du as DocumentReference, Tc as DocumentSnapshot, Bu as FieldPath, Gu as FieldValue, _u as Firestore, Y as FirestoreError, zu as GeoPoint, Eu as LoadBundleTask, pu as Query, Dc as QueryConstraint, Ec as QueryDocumentSnapshot, Sc as QuerySnapshot, Ic as SnapshotMetadata, lt as Timestamp, ph as Transaction, Jc as WriteBatch, eu as _DatabaseId, Pt as _DocumentKey, ot as _EmptyAppCheckTokenProvider, Z as _EmptyAuthCredentialsProvider, bt as _FieldPath, uu as _cast, Q as _debugAssert, Tt as _isBase64Available, j as _logWarn, iu as _validateIsNotUsedTogether, uh as addDoc, wh as arrayRemove, gh as arrayUnion, Lu as clearIndexedDbPersistence, vu as collection, mu as collectionGroup, lu as connectFirestoreEmulator, ah as deleteDoc, vh as deleteField, Mu as disableNetwork, gu as doc, ju as documentId, Cu as enableIndexedDbPersistence, xu as enableMultiTabIndexedDbPersistence, Ou as enableNetwork, jc as endAt, Bc as endBefore, Du as ensureFirestoreConfigured, fh as executeWrite, Zc as getDoc, th as getDocFromCache, eh as getDocFromServer, nh as getDocs, rh as getDocsFromCache, ih as getDocsFromServer, Au as getFirestore, bh as increment, ku as initializeFirestore, Oc as limit, Mc as limitToLast, Vu as loadBundle, qu as namedQuery, ch as onSnapshot, hh as onSnapshotsInSync, Lc as orderBy, Nc as query, bu as queryEqual, wu as refEqual, yh as runTransaction, mh as serverTimestamp, oh as setDoc, q as setLogLevel, kc as snapshotEqual, qc as startAfter, Vc as startAt, Fu as terminate, sh as updateDoc, Pu as waitForPendingWrites, xc as where, Ih as writeBatch };
|
|
18450
18450
|
//# sourceMappingURL=index.esm5.js.map
|