@firebase/firestore 1.14.0-canary.daf63c2c → 1.14.0
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/dist/index.esm2017.d.ts +2 -2
- package/dist/dist/index.memory.esm2017.d.ts +2 -2
- package/dist/index.cjs.js +872 -874
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +933 -935
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm2017.js +746 -780
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.memory.cjs.js +604 -651
- package/dist/index.memory.cjs.js.map +1 -1
- package/dist/index.memory.esm.js +882 -929
- package/dist/index.memory.esm.js.map +1 -1
- package/dist/index.memory.esm2017.js +387 -422
- package/dist/index.memory.esm2017.js.map +1 -1
- package/dist/index.memory.node.cjs.js +21 -81
- package/dist/index.memory.node.cjs.js.map +1 -1
- package/dist/index.memory.node.esm2017.js +19 -64
- package/dist/index.memory.node.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +110 -117
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.esm2017.js +66 -96
- package/dist/index.node.esm2017.js.map +1 -1
- package/dist/lib/src/core/component_provider.d.ts +19 -35
- package/dist/lib/src/local/indexeddb_persistence.d.ts +2 -2
- package/dist/lib/src/local/memory_persistence.d.ts +0 -1
- package/dist/lib/src/local/persistence.d.ts +0 -2
- package/dist/src/core/component_provider.d.ts +19 -35
- package/dist/src/local/indexeddb_persistence.d.ts +2 -2
- package/dist/src/local/memory_persistence.d.ts +0 -1
- package/dist/src/local/persistence.d.ts +0 -2
- package/package.json +12 -12
package/dist/index.memory.cjs.js
CHANGED
|
@@ -1057,7 +1057,7 @@ function V(t) {
|
|
|
1057
1057
|
return null == t;
|
|
1058
1058
|
}
|
|
1059
1059
|
|
|
1060
|
-
/** Returns whether the value represents -0. */ function
|
|
1060
|
+
/** Returns whether the value represents -0. */ function U(t) {
|
|
1061
1061
|
// Detect if the value is -0.0. Based on polyfill from
|
|
1062
1062
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
1063
1063
|
return -0 === t && 1 / t == -1 / 0;
|
|
@@ -1066,7 +1066,7 @@ function V(t) {
|
|
|
1066
1066
|
/**
|
|
1067
1067
|
* Returns whether a value is an integer and in the safe integer range
|
|
1068
1068
|
* @param value The value to test for being an integer and in the safe range
|
|
1069
|
-
*/ function
|
|
1069
|
+
*/ function C(t) {
|
|
1070
1070
|
var e, n;
|
|
1071
1071
|
return "server_timestamp" === (null === (n = ((null === (e = null == t ? void 0 : t.mapValue) || void 0 === e ? void 0 : e.fields) || {}).__type__) || void 0 === n ? void 0 : n.stringValue);
|
|
1072
1072
|
}
|
|
@@ -1076,8 +1076,8 @@ function V(t) {
|
|
|
1076
1076
|
*/
|
|
1077
1077
|
/**
|
|
1078
1078
|
* Returns the local time at which this timestamp was first set.
|
|
1079
|
-
*/ function
|
|
1080
|
-
var e =
|
|
1079
|
+
*/ function O(t) {
|
|
1080
|
+
var e = Q(t.mapValue.fields.__local_write_time__.timestampValue);
|
|
1081
1081
|
return new v(e.seconds, e.nanos);
|
|
1082
1082
|
}
|
|
1083
1083
|
|
|
@@ -1100,15 +1100,15 @@ function V(t) {
|
|
|
1100
1100
|
// A RegExp matching ISO 8601 UTC timestamps with optional fraction.
|
|
1101
1101
|
D.Ut = new D("");
|
|
1102
1102
|
|
|
1103
|
-
var
|
|
1103
|
+
var P = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
1104
1104
|
|
|
1105
|
-
/** Extracts the backend's type order for the provided value. */ function
|
|
1106
|
-
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 ?
|
|
1105
|
+
/** Extracts the backend's type order for the provided value. */ function q(t) {
|
|
1106
|
+
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 ? C(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : we("Invalid value type: " + JSON.stringify(t));
|
|
1107
1107
|
}
|
|
1108
1108
|
|
|
1109
|
-
/** Tests `left` and `right` for equality based on the backend semantics. */ function
|
|
1110
|
-
var n =
|
|
1111
|
-
if (n !==
|
|
1109
|
+
/** Tests `left` and `right` for equality based on the backend semantics. */ function M(t, e) {
|
|
1110
|
+
var n = q(t);
|
|
1111
|
+
if (n !== q(e)) return !1;
|
|
1112
1112
|
switch (n) {
|
|
1113
1113
|
case 0 /* NullValue */ :
|
|
1114
1114
|
return !0;
|
|
@@ -1117,14 +1117,14 @@ var q = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1117
1117
|
return t.booleanValue === e.booleanValue;
|
|
1118
1118
|
|
|
1119
1119
|
case 4 /* ServerTimestampValue */ :
|
|
1120
|
-
return
|
|
1120
|
+
return O(t).isEqual(O(e));
|
|
1121
1121
|
|
|
1122
1122
|
case 3 /* TimestampValue */ :
|
|
1123
1123
|
return function(t, e) {
|
|
1124
1124
|
if ("string" == typeof t.timestampValue && "string" == typeof e.timestampValue && t.timestampValue.length === e.timestampValue.length)
|
|
1125
1125
|
// Use string equality for ISO 8601 timestamps
|
|
1126
1126
|
return t.timestampValue === e.timestampValue;
|
|
1127
|
-
var n =
|
|
1127
|
+
var n = Q(t.timestampValue), r = Q(e.timestampValue);
|
|
1128
1128
|
return n.seconds === r.seconds && n.nanos === r.nanos;
|
|
1129
1129
|
}(t, e);
|
|
1130
1130
|
|
|
@@ -1133,7 +1133,7 @@ var q = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1133
1133
|
|
|
1134
1134
|
case 6 /* BlobValue */ :
|
|
1135
1135
|
return function(t, e) {
|
|
1136
|
-
return
|
|
1136
|
+
return z(t.bytesValue).isEqual(z(e.bytesValue));
|
|
1137
1137
|
}(t, e);
|
|
1138
1138
|
|
|
1139
1139
|
case 7 /* RefValue */ :
|
|
@@ -1141,27 +1141,27 @@ var q = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1141
1141
|
|
|
1142
1142
|
case 8 /* GeoPointValue */ :
|
|
1143
1143
|
return function(t, e) {
|
|
1144
|
-
return
|
|
1144
|
+
return B(t.geoPointValue.latitude) === B(e.geoPointValue.latitude) && B(t.geoPointValue.longitude) === B(e.geoPointValue.longitude);
|
|
1145
1145
|
}(t, e);
|
|
1146
1146
|
|
|
1147
1147
|
case 2 /* NumberValue */ :
|
|
1148
1148
|
return function(t, e) {
|
|
1149
|
-
if ("integerValue" in t && "integerValue" in e) return
|
|
1149
|
+
if ("integerValue" in t && "integerValue" in e) return B(t.integerValue) === B(e.integerValue);
|
|
1150
1150
|
if ("doubleValue" in t && "doubleValue" in e) {
|
|
1151
|
-
var n =
|
|
1152
|
-
return n === r ?
|
|
1151
|
+
var n = B(t.doubleValue), r = B(e.doubleValue);
|
|
1152
|
+
return n === r ? U(n) === U(r) : isNaN(n) && isNaN(r);
|
|
1153
1153
|
}
|
|
1154
1154
|
return !1;
|
|
1155
1155
|
}(t, e);
|
|
1156
1156
|
|
|
1157
1157
|
case 9 /* ArrayValue */ :
|
|
1158
|
-
return Ae(t.arrayValue.values || [], e.arrayValue.values || [],
|
|
1158
|
+
return Ae(t.arrayValue.values || [], e.arrayValue.values || [], M);
|
|
1159
1159
|
|
|
1160
1160
|
case 10 /* ObjectValue */ :
|
|
1161
1161
|
return function(t, e) {
|
|
1162
1162
|
var n = t.mapValue.fields || {}, r = e.mapValue.fields || {};
|
|
1163
1163
|
if (S(n) !== S(r)) return !1;
|
|
1164
|
-
for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !
|
|
1164
|
+
for (var i in n) if (n.hasOwnProperty(i) && (void 0 === r[i] || !M(n[i], r[i]))) return !1;
|
|
1165
1165
|
return !0;
|
|
1166
1166
|
}(t, e);
|
|
1167
1167
|
|
|
@@ -1170,14 +1170,14 @@ var q = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);
|
|
|
1170
1170
|
}
|
|
1171
1171
|
}
|
|
1172
1172
|
|
|
1173
|
-
function
|
|
1173
|
+
function F(t, e) {
|
|
1174
1174
|
return void 0 !== (t.values || []).find((function(t) {
|
|
1175
|
-
return
|
|
1175
|
+
return M(t, e);
|
|
1176
1176
|
}));
|
|
1177
1177
|
}
|
|
1178
1178
|
|
|
1179
1179
|
function G(t, e) {
|
|
1180
|
-
var n =
|
|
1180
|
+
var n = q(t), r = q(e);
|
|
1181
1181
|
if (n !== r) return be(n, r);
|
|
1182
1182
|
switch (n) {
|
|
1183
1183
|
case 0 /* NullValue */ :
|
|
@@ -1188,24 +1188,24 @@ function G(t, e) {
|
|
|
1188
1188
|
|
|
1189
1189
|
case 2 /* NumberValue */ :
|
|
1190
1190
|
return function(t, e) {
|
|
1191
|
-
var n =
|
|
1191
|
+
var n = B(t.integerValue || t.doubleValue), r = B(e.integerValue || e.doubleValue);
|
|
1192
1192
|
return n < r ? -1 : n > r ? 1 : n === r ? 0 :
|
|
1193
1193
|
// one or both are NaN.
|
|
1194
1194
|
isNaN(n) ? isNaN(r) ? 0 : -1 : 1;
|
|
1195
1195
|
}(t, e);
|
|
1196
1196
|
|
|
1197
1197
|
case 3 /* TimestampValue */ :
|
|
1198
|
-
return
|
|
1198
|
+
return x(t.timestampValue, e.timestampValue);
|
|
1199
1199
|
|
|
1200
1200
|
case 4 /* ServerTimestampValue */ :
|
|
1201
|
-
return
|
|
1201
|
+
return x(O(t), O(e));
|
|
1202
1202
|
|
|
1203
1203
|
case 5 /* StringValue */ :
|
|
1204
1204
|
return be(t.stringValue, e.stringValue);
|
|
1205
1205
|
|
|
1206
1206
|
case 6 /* BlobValue */ :
|
|
1207
1207
|
return function(t, e) {
|
|
1208
|
-
var n =
|
|
1208
|
+
var n = z(t), r = z(e);
|
|
1209
1209
|
return n.C(r);
|
|
1210
1210
|
}(t.bytesValue, e.bytesValue);
|
|
1211
1211
|
|
|
@@ -1220,8 +1220,8 @@ function G(t, e) {
|
|
|
1220
1220
|
|
|
1221
1221
|
case 8 /* GeoPointValue */ :
|
|
1222
1222
|
return function(t, e) {
|
|
1223
|
-
var n = be(
|
|
1224
|
-
return 0 !== n ? n : be(
|
|
1223
|
+
var n = be(B(t.latitude), B(e.latitude));
|
|
1224
|
+
return 0 !== n ? n : be(B(t.longitude), B(e.longitude));
|
|
1225
1225
|
}(t.geoPointValue, e.geoPointValue);
|
|
1226
1226
|
|
|
1227
1227
|
case 9 /* ArrayValue */ :
|
|
@@ -1255,18 +1255,18 @@ function G(t, e) {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
}
|
|
1257
1257
|
|
|
1258
|
-
function
|
|
1258
|
+
function x(t, e) {
|
|
1259
1259
|
if ("string" == typeof t && "string" == typeof e && t.length === e.length) return be(t, e);
|
|
1260
|
-
var n =
|
|
1260
|
+
var n = Q(t), r = Q(e), i = be(n.seconds, r.seconds);
|
|
1261
1261
|
return 0 !== i ? i : be(n.nanos, r.nanos);
|
|
1262
1262
|
}
|
|
1263
1263
|
|
|
1264
1264
|
function j(t) {
|
|
1265
1265
|
return function t(e) {
|
|
1266
1266
|
return "nullValue" in e ? "null" : "booleanValue" in e ? "" + e.booleanValue : "integerValue" in e ? "" + e.integerValue : "doubleValue" in e ? "" + e.doubleValue : "timestampValue" in e ? function(t) {
|
|
1267
|
-
var e =
|
|
1267
|
+
var e = Q(t);
|
|
1268
1268
|
return "time(" + e.seconds + "," + e.nanos + ")";
|
|
1269
|
-
}(e.timestampValue) : "stringValue" in e ? e.stringValue : "bytesValue" in e ?
|
|
1269
|
+
}(e.timestampValue) : "stringValue" in e ? e.stringValue : "bytesValue" in e ? z(e.bytesValue).toBase64() : "referenceValue" in e ? (r = e.referenceValue,
|
|
1270
1270
|
b.tt(r).toString()) : "geoPointValue" in e ? "geo(" + (n = e.geoPointValue).latitude + "," + n.longitude + ")" : "arrayValue" in e ? function(e) {
|
|
1271
1271
|
for (var n = "[", r = !0, i = 0, o = e.values || []; i < o.length; i++) {
|
|
1272
1272
|
var s = o[i];
|
|
@@ -1287,7 +1287,7 @@ function j(t) {
|
|
|
1287
1287
|
}(t);
|
|
1288
1288
|
}
|
|
1289
1289
|
|
|
1290
|
-
function
|
|
1290
|
+
function Q(t) {
|
|
1291
1291
|
// The json interface (for the browser) will return an iso timestamp string,
|
|
1292
1292
|
// while the proto js library (for node) will return a
|
|
1293
1293
|
// google.protobuf.Timestamp instance.
|
|
@@ -1295,7 +1295,7 @@ function B(t) {
|
|
|
1295
1295
|
// The date string can have higher precision (nanos) than the Date class
|
|
1296
1296
|
// (millis), so we do some custom parsing here.
|
|
1297
1297
|
// Parse the nanos right out of the string.
|
|
1298
|
-
var e = 0, n =
|
|
1298
|
+
var e = 0, n = P.exec(t);
|
|
1299
1299
|
if (_e(!!n, "invalid timestamp: " + t), n[1]) {
|
|
1300
1300
|
// Pad the fraction out to 9 digits (nanos).
|
|
1301
1301
|
var r = n[1];
|
|
@@ -1309,20 +1309,20 @@ function B(t) {
|
|
|
1309
1309
|
};
|
|
1310
1310
|
}
|
|
1311
1311
|
return {
|
|
1312
|
-
seconds:
|
|
1313
|
-
nanos:
|
|
1312
|
+
seconds: B(t.seconds),
|
|
1313
|
+
nanos: B(t.nanos)
|
|
1314
1314
|
};
|
|
1315
1315
|
}
|
|
1316
1316
|
|
|
1317
1317
|
/**
|
|
1318
1318
|
* Converts the possible Proto types for numbers into a JavaScript number.
|
|
1319
1319
|
* Returns 0 if the value is not numeric.
|
|
1320
|
-
*/ function
|
|
1320
|
+
*/ function B(t) {
|
|
1321
1321
|
// TODO(bjornick): Handle int64 greater than 53 bits.
|
|
1322
1322
|
return "number" == typeof t ? t : "string" == typeof t ? Number(t) : 0;
|
|
1323
1323
|
}
|
|
1324
1324
|
|
|
1325
|
-
/** Converts the possible Proto types for Blobs into a ByteString. */ function
|
|
1325
|
+
/** Converts the possible Proto types for Blobs into a ByteString. */ function z(t) {
|
|
1326
1326
|
return "string" == typeof t ? D.fromBase64String(t) : D.fromUint8Array(t);
|
|
1327
1327
|
}
|
|
1328
1328
|
|
|
@@ -1345,11 +1345,11 @@ function B(t) {
|
|
|
1345
1345
|
return !!t && "nullValue" in t;
|
|
1346
1346
|
}
|
|
1347
1347
|
|
|
1348
|
-
/** Returns true if `value` is NaN. */ function
|
|
1348
|
+
/** Returns true if `value` is NaN. */ function Z(t) {
|
|
1349
1349
|
return !!t && "doubleValue" in t && isNaN(Number(t.doubleValue));
|
|
1350
1350
|
}
|
|
1351
1351
|
|
|
1352
|
-
/** Returns true if `value` is a MapValue. */ function
|
|
1352
|
+
/** Returns true if `value` is a MapValue. */ function X(t) {
|
|
1353
1353
|
return !!t && "mapValue" in t;
|
|
1354
1354
|
}
|
|
1355
1355
|
|
|
@@ -1369,7 +1369,7 @@ function B(t) {
|
|
|
1369
1369
|
* See the License for the specific language governing permissions and
|
|
1370
1370
|
* limitations under the License.
|
|
1371
1371
|
*/
|
|
1372
|
-
/** Transforms a value into a server-generated timestamp. */ var
|
|
1372
|
+
/** Transforms a value into a server-generated timestamp. */ var K = /** @class */ function() {
|
|
1373
1373
|
function t() {}
|
|
1374
1374
|
return t.prototype.qt = function(t, e) {
|
|
1375
1375
|
return function(t, e) {
|
|
@@ -1400,7 +1400,7 @@ function B(t) {
|
|
|
1400
1400
|
}, t;
|
|
1401
1401
|
}();
|
|
1402
1402
|
|
|
1403
|
-
|
|
1403
|
+
K.instance = new K;
|
|
1404
1404
|
|
|
1405
1405
|
/** Transforms an array value via a union operation. */
|
|
1406
1406
|
var $ = /** @class */ function() {
|
|
@@ -1417,7 +1417,7 @@ var $ = /** @class */ function() {
|
|
|
1417
1417
|
}, t.prototype.apply = function(t) {
|
|
1418
1418
|
for (var e = nt(t), n = function(t) {
|
|
1419
1419
|
e.some((function(e) {
|
|
1420
|
-
return
|
|
1420
|
+
return M(e, t);
|
|
1421
1421
|
})) || e.push(t);
|
|
1422
1422
|
}, r = 0, i = this.elements; r < i.length; r++) {
|
|
1423
1423
|
n(i[r]);
|
|
@@ -1431,7 +1431,7 @@ var $ = /** @class */ function() {
|
|
|
1431
1431
|
return null;
|
|
1432
1432
|
// Array transforms are idempotent and don't require a base value.
|
|
1433
1433
|
}, t.prototype.isEqual = function(e) {
|
|
1434
|
-
return e instanceof t && Ae(this.elements, e.elements,
|
|
1434
|
+
return e instanceof t && Ae(this.elements, e.elements, M);
|
|
1435
1435
|
}, t;
|
|
1436
1436
|
}(), tt = /** @class */ function() {
|
|
1437
1437
|
function t(t) {
|
|
@@ -1447,7 +1447,7 @@ var $ = /** @class */ function() {
|
|
|
1447
1447
|
}, t.prototype.apply = function(t) {
|
|
1448
1448
|
for (var e = nt(t), n = function(t) {
|
|
1449
1449
|
e = e.filter((function(e) {
|
|
1450
|
-
return !
|
|
1450
|
+
return !M(e, t);
|
|
1451
1451
|
}));
|
|
1452
1452
|
}, r = 0, i = this.elements; r < i.length; r++) {
|
|
1453
1453
|
n(i[r]);
|
|
@@ -1461,7 +1461,7 @@ var $ = /** @class */ function() {
|
|
|
1461
1461
|
return null;
|
|
1462
1462
|
// Array transforms are idempotent and don't require a base value.
|
|
1463
1463
|
}, t.prototype.isEqual = function(e) {
|
|
1464
|
-
return e instanceof t && Ae(this.elements, e.elements,
|
|
1464
|
+
return e instanceof t && Ae(this.elements, e.elements, M);
|
|
1465
1465
|
}, t;
|
|
1466
1466
|
}(), et = /** @class */ function() {
|
|
1467
1467
|
function t(t, e) {
|
|
@@ -1488,9 +1488,9 @@ var $ = /** @class */ function() {
|
|
|
1488
1488
|
};
|
|
1489
1489
|
var e;
|
|
1490
1490
|
}, t.prototype.isEqual = function(e) {
|
|
1491
|
-
return e instanceof t &&
|
|
1491
|
+
return e instanceof t && M(this.Qt, e.Qt);
|
|
1492
1492
|
}, t.prototype.asNumber = function(t) {
|
|
1493
|
-
return
|
|
1493
|
+
return B(t.integerValue || t.doubleValue);
|
|
1494
1494
|
}, t;
|
|
1495
1495
|
}();
|
|
1496
1496
|
|
|
@@ -1885,7 +1885,7 @@ var ut = /** @class */ function() {
|
|
|
1885
1885
|
if (t.q()) return this.proto;
|
|
1886
1886
|
for (var e = this.proto, n = 0; n < t.length - 1; ++n) {
|
|
1887
1887
|
if (!e.mapValue.fields) return null;
|
|
1888
|
-
if (!
|
|
1888
|
+
if (!X(e = e.mapValue.fields[t.get(n)])) return null;
|
|
1889
1889
|
}
|
|
1890
1890
|
return (e = (e.mapValue.fields || {})[t.U()]) || null;
|
|
1891
1891
|
},
|
|
@@ -1899,7 +1899,7 @@ var ut = /** @class */ function() {
|
|
|
1899
1899
|
var e = this, n = new T(E.k);
|
|
1900
1900
|
return R(t.fields || {}, (function(t, r) {
|
|
1901
1901
|
var i = new E([ t ]);
|
|
1902
|
-
if (10 /* ObjectValue */ ===
|
|
1902
|
+
if (10 /* ObjectValue */ === q(r)) {
|
|
1903
1903
|
var o = e._e(r.mapValue).fields;
|
|
1904
1904
|
o.q() ?
|
|
1905
1905
|
// Preserve the empty map by adding it to the FieldMask.
|
|
@@ -1915,7 +1915,7 @@ var ut = /** @class */ function() {
|
|
|
1915
1915
|
n = n.add(i);
|
|
1916
1916
|
})), rt.Gt(n);
|
|
1917
1917
|
}, t.prototype.isEqual = function(t) {
|
|
1918
|
-
return
|
|
1918
|
+
return M(this.proto, t.proto);
|
|
1919
1919
|
},
|
|
1920
1920
|
/** Creates a ObjectValueBuilder instance that is based on the current value. */ t.prototype.re = function() {
|
|
1921
1921
|
return new dt(this);
|
|
@@ -1971,7 +1971,7 @@ var dt = /** @class */ function() {
|
|
|
1971
1971
|
var i = t.get(r), o = n.get(i);
|
|
1972
1972
|
o instanceof Map ?
|
|
1973
1973
|
// Re-use a previously created map
|
|
1974
|
-
n = o : o && 10 /* ObjectValue */ ===
|
|
1974
|
+
n = o : o && 10 /* ObjectValue */ === q(o) ? (
|
|
1975
1975
|
// Convert the existing Protobuf MapValue into a map
|
|
1976
1976
|
o = new Map(Object.entries(o.mapValue.fields || {})), n.set(i, o), n = o) : (
|
|
1977
1977
|
// Create an empty map to represent the current nesting level
|
|
@@ -1996,7 +1996,7 @@ var dt = /** @class */ function() {
|
|
|
1996
1996
|
* were applied.
|
|
1997
1997
|
*/
|
|
1998
1998
|
t.prototype.Te = function(t, e) {
|
|
1999
|
-
var n = this, r = !1, i = this.de.field(t), o =
|
|
1999
|
+
var n = this, r = !1, i = this.de.field(t), o = X(i) ? // If there is already data at the current path, base our
|
|
2000
2000
|
Object.assign({}, i.mapValue.fields) : {};
|
|
2001
2001
|
return e.forEach((function(e, i) {
|
|
2002
2002
|
if (e instanceof Map) {
|
|
@@ -2143,7 +2143,7 @@ var dt = /** @class */ function() {
|
|
|
2143
2143
|
// In order to implicitly add key ordering, we must also add the
|
|
2144
2144
|
// inequality filter field for it to be a valid query.
|
|
2145
2145
|
// Note that the default inequality field and key ordering is ascending.
|
|
2146
|
-
t.Y() ? this.ge = [
|
|
2146
|
+
t.Y() ? this.ge = [ Ut ] : this.ge = [ new Vt(t), Ut ]; else {
|
|
2147
2147
|
this.ge = [];
|
|
2148
2148
|
for (var n = !1, r = 0, i = this.Ve; r < i.length; r++) {
|
|
2149
2149
|
var o = i[r];
|
|
@@ -2153,7 +2153,7 @@ var dt = /** @class */ function() {
|
|
|
2153
2153
|
// The order of the implicit key ordering always matches the last
|
|
2154
2154
|
// explicit order by
|
|
2155
2155
|
var s = this.Ve.length > 0 ? this.Ve[this.Ve.length - 1].dir : St.ASCENDING;
|
|
2156
|
-
this.ge.push(s === St.ASCENDING ?
|
|
2156
|
+
this.ge.push(s === St.ASCENDING ? Ut : Ct);
|
|
2157
2157
|
}
|
|
2158
2158
|
}
|
|
2159
2159
|
}
|
|
@@ -2359,7 +2359,7 @@ var bt = /** @class */ function(t) {
|
|
|
2359
2359
|
if (e !== Et.EQUAL) throw new c(h.INVALID_ARGUMENT, "Invalid query. Null supports only equality comparisons.");
|
|
2360
2360
|
return new n(t, e, r);
|
|
2361
2361
|
}
|
|
2362
|
-
if (
|
|
2362
|
+
if (Z(r)) {
|
|
2363
2363
|
if (e !== Et.EQUAL) throw new c(h.INVALID_ARGUMENT, "Invalid query. NaN supports only equality comparisons.");
|
|
2364
2364
|
return new n(t, e, r);
|
|
2365
2365
|
}
|
|
@@ -2367,7 +2367,7 @@ var bt = /** @class */ function(t) {
|
|
|
2367
2367
|
}, n.prototype.matches = function(t) {
|
|
2368
2368
|
var e = t.field(this.field);
|
|
2369
2369
|
// Only compare types with matching backend order (such as double and int).
|
|
2370
|
-
return null !== e &&
|
|
2370
|
+
return null !== e && q(this.value) === q(e) && this.Ye(G(e, this.value));
|
|
2371
2371
|
}, n.prototype.Ye = function(t) {
|
|
2372
2372
|
switch (this.op) {
|
|
2373
2373
|
case Et.LESS_THAN:
|
|
@@ -2396,7 +2396,7 @@ var bt = /** @class */ function(t) {
|
|
|
2396
2396
|
// add the types in here somehow, too.
|
|
2397
2397
|
return this.field.G() + this.op.toString() + j(this.value);
|
|
2398
2398
|
}, n.prototype.isEqual = function(t) {
|
|
2399
|
-
return t instanceof n && this.op.isEqual(t.op) && this.field.isEqual(t.field) &&
|
|
2399
|
+
return t instanceof n && this.op.isEqual(t.op) && this.field.isEqual(t.field) && M(this.value, t.value);
|
|
2400
2400
|
}, n.prototype.toString = function() {
|
|
2401
2401
|
return this.field.G() + " " + this.op + " " + j(this.value);
|
|
2402
2402
|
}, n;
|
|
@@ -2427,7 +2427,7 @@ var bt = /** @class */ function(t) {
|
|
|
2427
2427
|
}
|
|
2428
2428
|
return e.__extends(n, t), n.prototype.matches = function(t) {
|
|
2429
2429
|
var e = t.field(this.field);
|
|
2430
|
-
return W(e) &&
|
|
2430
|
+
return W(e) && F(e.arrayValue, this.value);
|
|
2431
2431
|
}, n;
|
|
2432
2432
|
}(bt), Tt = /** @class */ function(t) {
|
|
2433
2433
|
function n(e, n) {
|
|
@@ -2435,7 +2435,7 @@ var bt = /** @class */ function(t) {
|
|
|
2435
2435
|
}
|
|
2436
2436
|
return e.__extends(n, t), n.prototype.matches = function(t) {
|
|
2437
2437
|
var e = t.field(this.field);
|
|
2438
|
-
return null !== e &&
|
|
2438
|
+
return null !== e && F(this.value.arrayValue, e);
|
|
2439
2439
|
}, n;
|
|
2440
2440
|
}(bt), kt = /** @class */ function(t) {
|
|
2441
2441
|
function n(e, n) {
|
|
@@ -2444,7 +2444,7 @@ var bt = /** @class */ function(t) {
|
|
|
2444
2444
|
return e.__extends(n, t), n.prototype.matches = function(t) {
|
|
2445
2445
|
var e = this, n = t.field(this.field);
|
|
2446
2446
|
return !(!W(n) || !n.arrayValue.values) && n.arrayValue.values.some((function(t) {
|
|
2447
|
-
return
|
|
2447
|
+
return F(e.value.arrayValue, t);
|
|
2448
2448
|
}));
|
|
2449
2449
|
}, n;
|
|
2450
2450
|
}(bt), St = /** @class */ function() {
|
|
@@ -2497,7 +2497,7 @@ var Rt, Lt, Dt = /** @class */ function() {
|
|
|
2497
2497
|
}, t.prototype.isEqual = function(t) {
|
|
2498
2498
|
if (null === t) return !1;
|
|
2499
2499
|
if (this.before !== t.before || this.position.length !== t.position.length) return !1;
|
|
2500
|
-
for (var e = 0; e < this.position.length; e++) if (!
|
|
2500
|
+
for (var e = 0; e < this.position.length; e++) if (!M(this.position[e], t.position[e])) return !1;
|
|
2501
2501
|
return !0;
|
|
2502
2502
|
}, t;
|
|
2503
2503
|
}(), Vt = /** @class */ function() {
|
|
@@ -2524,7 +2524,7 @@ var Rt, Lt, Dt = /** @class */ function() {
|
|
|
2524
2524
|
}, t.prototype.isEqual = function(t) {
|
|
2525
2525
|
return this.dir === t.dir && this.field.isEqual(t.field);
|
|
2526
2526
|
}, t;
|
|
2527
|
-
}(),
|
|
2527
|
+
}(), Ut = new Vt(E.X(), St.ASCENDING), Ct = new Vt(E.X(), St.DESCENDING), Ot = /** @class */ function() {
|
|
2528
2528
|
function t(
|
|
2529
2529
|
/** The target being listened to. */
|
|
2530
2530
|
t,
|
|
@@ -2573,7 +2573,7 @@ var Rt, Lt, Dt = /** @class */ function() {
|
|
|
2573
2573
|
t.prototype.ns = function(e) {
|
|
2574
2574
|
return new t(this.target, this.targetId, this.Ze, this.sequenceNumber, this.ts, e, this.resumeToken);
|
|
2575
2575
|
}, t;
|
|
2576
|
-
}(),
|
|
2576
|
+
}(), Pt =
|
|
2577
2577
|
// TODO(b/33078163): just use simplest form of existence filter for now
|
|
2578
2578
|
function(t) {
|
|
2579
2579
|
this.count = t;
|
|
@@ -2588,7 +2588,7 @@ function(t) {
|
|
|
2588
2588
|
*
|
|
2589
2589
|
* See isPermanentWriteError for classifying write errors.
|
|
2590
2590
|
*/
|
|
2591
|
-
function
|
|
2591
|
+
function qt(t) {
|
|
2592
2592
|
switch (t) {
|
|
2593
2593
|
case h.OK:
|
|
2594
2594
|
return we("Treated status OK as error");
|
|
@@ -2641,7 +2641,7 @@ function Mt(t) {
|
|
|
2641
2641
|
*
|
|
2642
2642
|
* @returns The Code equivalent to the given GRPC status code. Fails if there
|
|
2643
2643
|
* is no match.
|
|
2644
|
-
*/ function
|
|
2644
|
+
*/ function Mt(t) {
|
|
2645
2645
|
if (void 0 === t)
|
|
2646
2646
|
// This shouldn't normally happen, but in certain error cases (like trying
|
|
2647
2647
|
// to send invalid proto messages) we may get an error with no GRPC code.
|
|
@@ -2735,26 +2735,26 @@ Lt[Lt.INTERNAL = 13] = "INTERNAL", Lt[Lt.UNAVAILABLE = 14] = "UNAVAILABLE", Lt[L
|
|
|
2735
2735
|
* See the License for the specific language governing permissions and
|
|
2736
2736
|
* limitations under the License.
|
|
2737
2737
|
*/
|
|
2738
|
-
var
|
|
2738
|
+
var Ft = new A(b.k);
|
|
2739
2739
|
|
|
2740
2740
|
function Gt() {
|
|
2741
|
-
return
|
|
2741
|
+
return Ft;
|
|
2742
2742
|
}
|
|
2743
2743
|
|
|
2744
|
-
function
|
|
2744
|
+
function xt() {
|
|
2745
2745
|
return Gt();
|
|
2746
2746
|
}
|
|
2747
2747
|
|
|
2748
2748
|
var jt = new A(b.k);
|
|
2749
2749
|
|
|
2750
|
-
function
|
|
2750
|
+
function Qt() {
|
|
2751
2751
|
return jt;
|
|
2752
2752
|
}
|
|
2753
2753
|
|
|
2754
|
-
var
|
|
2754
|
+
var Bt = new A(b.k);
|
|
2755
2755
|
|
|
2756
|
-
function
|
|
2757
|
-
return
|
|
2756
|
+
function zt() {
|
|
2757
|
+
return Bt;
|
|
2758
2758
|
}
|
|
2759
2759
|
|
|
2760
2760
|
var Ht = new T(b.k);
|
|
@@ -2795,7 +2795,7 @@ function Jt() {
|
|
|
2795
2795
|
* in order specified by the provided comparator. We always add a document key
|
|
2796
2796
|
* comparator on top of what is provided to guarantee document equality based on
|
|
2797
2797
|
* the key.
|
|
2798
|
-
*/ var
|
|
2798
|
+
*/ var Zt = /** @class */ function() {
|
|
2799
2799
|
/** The default ordering is by key if the comparator is omitted */
|
|
2800
2800
|
function t(t) {
|
|
2801
2801
|
// We are adding document key comparator to the end as it's the only
|
|
@@ -2804,7 +2804,7 @@ function Jt() {
|
|
|
2804
2804
|
return t(e, n) || b.k(e.key, n.key);
|
|
2805
2805
|
} : function(t, e) {
|
|
2806
2806
|
return b.k(t.key, e.key);
|
|
2807
|
-
}, this.rs =
|
|
2807
|
+
}, this.rs = Qt(), this.hs = new A(this.k)
|
|
2808
2808
|
/**
|
|
2809
2809
|
* Returns an empty copy of the existing DocumentSet, using the same
|
|
2810
2810
|
* comparator.
|
|
@@ -2867,7 +2867,7 @@ function Jt() {
|
|
|
2867
2867
|
var r = new t;
|
|
2868
2868
|
return r.k = this.k, r.rs = e, r.hs = n, r;
|
|
2869
2869
|
}, t;
|
|
2870
|
-
}(),
|
|
2870
|
+
}(), Xt = /** @class */ function() {
|
|
2871
2871
|
function t() {
|
|
2872
2872
|
this.as = new A(b.k);
|
|
2873
2873
|
}
|
|
@@ -2905,7 +2905,7 @@ function Jt() {
|
|
|
2905
2905
|
t.push(n);
|
|
2906
2906
|
})), t;
|
|
2907
2907
|
}, t;
|
|
2908
|
-
}(),
|
|
2908
|
+
}(), Kt = /** @class */ function() {
|
|
2909
2909
|
function t(t, e, n, r, i, o, s, u) {
|
|
2910
2910
|
this.query = t, this.docs = e, this.cs = n, this.docChanges = r, this.ls = i, this.fromCache = o,
|
|
2911
2911
|
this._s = s, this.ds = u
|
|
@@ -2918,7 +2918,7 @@ function Jt() {
|
|
|
2918
2918
|
type: 0 /* Added */ ,
|
|
2919
2919
|
doc: t
|
|
2920
2920
|
});
|
|
2921
|
-
})), new t(e, n,
|
|
2921
|
+
})), new t(e, n, Zt.os(n), o, r, i,
|
|
2922
2922
|
/* syncStateChanged= */ !0,
|
|
2923
2923
|
/* excludesMetadataChanges= */ !1);
|
|
2924
2924
|
}, Object.defineProperty(t.prototype, "hasPendingWrites", {
|
|
@@ -3440,7 +3440,7 @@ function ue() {
|
|
|
3440
3440
|
this.ci = t, this.options = e;
|
|
3441
3441
|
}
|
|
3442
3442
|
return t.prototype.li = function(t) {
|
|
3443
|
-
var e = void 0 === t.code ? h.UNKNOWN :
|
|
3443
|
+
var e = void 0 === t.code ? h.UNKNOWN : Mt(t.code);
|
|
3444
3444
|
return new c(e, t.message || "");
|
|
3445
3445
|
},
|
|
3446
3446
|
/**
|
|
@@ -3488,7 +3488,7 @@ function ue() {
|
|
|
3488
3488
|
};
|
|
3489
3489
|
}
|
|
3490
3490
|
return {
|
|
3491
|
-
doubleValue:
|
|
3491
|
+
doubleValue: U(t) ? "-0" : t
|
|
3492
3492
|
};
|
|
3493
3493
|
},
|
|
3494
3494
|
/**
|
|
@@ -3498,7 +3498,7 @@ function ue() {
|
|
|
3498
3498
|
*/
|
|
3499
3499
|
t.prototype.wi = function(t) {
|
|
3500
3500
|
return function(t) {
|
|
3501
|
-
return "number" == typeof t && Number.isInteger(t) && !
|
|
3501
|
+
return "number" == typeof t && Number.isInteger(t) && !U(t) && t <= Number.MAX_SAFE_INTEGER && t >= Number.MIN_SAFE_INTEGER;
|
|
3502
3502
|
}(t) ? this.Wt(t) : this.jt(t);
|
|
3503
3503
|
},
|
|
3504
3504
|
/**
|
|
@@ -3510,7 +3510,7 @@ function ue() {
|
|
|
3510
3510
|
nanos: t.nanoseconds
|
|
3511
3511
|
};
|
|
3512
3512
|
}, t.prototype.v = function(t) {
|
|
3513
|
-
var e =
|
|
3513
|
+
var e = Q(t);
|
|
3514
3514
|
return new v(e.seconds, e.nanos);
|
|
3515
3515
|
},
|
|
3516
3516
|
/**
|
|
@@ -3636,7 +3636,7 @@ function ue() {
|
|
|
3636
3636
|
t.filter;
|
|
3637
3637
|
var A = t.filter;
|
|
3638
3638
|
A.targetId;
|
|
3639
|
-
var N = A.count || 0, I = new
|
|
3639
|
+
var N = A.count || 0, I = new Pt(N), T = A.targetId;
|
|
3640
3640
|
e = new ne(T, I);
|
|
3641
3641
|
}
|
|
3642
3642
|
return e;
|
|
@@ -3732,7 +3732,7 @@ function ue() {
|
|
|
3732
3732
|
}))) : [];
|
|
3733
3733
|
}, t.prototype.Oi = function(t) {
|
|
3734
3734
|
var e = t.transform;
|
|
3735
|
-
if (e instanceof
|
|
3735
|
+
if (e instanceof K) return {
|
|
3736
3736
|
fieldPath: t.field.G(),
|
|
3737
3737
|
setToServerValue: "REQUEST_TIME"
|
|
3738
3738
|
};
|
|
@@ -3756,7 +3756,7 @@ function ue() {
|
|
|
3756
3756
|
}, t.prototype.xi = function(t) {
|
|
3757
3757
|
var e = null;
|
|
3758
3758
|
if ("setToServerValue" in t) _e("REQUEST_TIME" === t.setToServerValue, "Unknown server value transform proto: " + JSON.stringify(t)),
|
|
3759
|
-
e =
|
|
3759
|
+
e = K.instance; else if ("appendMissingElements" in t) {
|
|
3760
3760
|
var n = t.appendMissingElements.values || [];
|
|
3761
3761
|
e = new $(n);
|
|
3762
3762
|
} else if ("removeAllFromArray" in t) {
|
|
@@ -3948,7 +3948,7 @@ function ue() {
|
|
|
3948
3948
|
// visible for testing
|
|
3949
3949
|
t.prototype.in = function(t) {
|
|
3950
3950
|
if (t.op === Et.EQUAL) {
|
|
3951
|
-
if (
|
|
3951
|
+
if (Z(t.value)) return {
|
|
3952
3952
|
unaryFilter: {
|
|
3953
3953
|
field: this._n(t.field),
|
|
3954
3954
|
op: "IS_NAN"
|
|
@@ -4358,7 +4358,7 @@ function(t, e, n, r, i) {
|
|
|
4358
4358
|
}
|
|
4359
4359
|
return t.from = function(e, n, r, i) {
|
|
4360
4360
|
_e(e.mutations.length === r.length, "Mutations sent " + e.mutations.length + " must equal results received " + r.length);
|
|
4361
|
-
for (var o =
|
|
4361
|
+
for (var o = zt(), s = e.mutations, u = 0; u < s.length; u++) o = o.nt(s[u].key, r[u].version);
|
|
4362
4362
|
return new t(e, n, r, i, o);
|
|
4363
4363
|
}, t;
|
|
4364
4364
|
}(), Re = /** @class */ function() {
|
|
@@ -4552,7 +4552,7 @@ function(t, e, n, r, i) {
|
|
|
4552
4552
|
// Returns the view of the given `docs` as they would appear after applying
|
|
4553
4553
|
// all mutations in the given `batches`.
|
|
4554
4554
|
t.prototype.er = function(t, e, n) {
|
|
4555
|
-
var r =
|
|
4555
|
+
var r = xt();
|
|
4556
4556
|
return e.forEach((function(t, e) {
|
|
4557
4557
|
for (var i = 0, o = n; i < o.length; i++) {
|
|
4558
4558
|
e = o[i].qt(t, e);
|
|
@@ -4599,11 +4599,11 @@ function(t, e, n, r, i) {
|
|
|
4599
4599
|
}, t.prototype.hr = function(t, e) {
|
|
4600
4600
|
// Just do a simple document lookup.
|
|
4601
4601
|
return this.Yn(t, new b(e)).next((function(t) {
|
|
4602
|
-
var e =
|
|
4602
|
+
var e = Qt();
|
|
4603
4603
|
return t instanceof vt && (e = e.nt(t.key, t)), e;
|
|
4604
4604
|
}));
|
|
4605
4605
|
}, t.prototype.or = function(t, e, n) {
|
|
4606
|
-
var r = this, i = e.collectionGroup, o =
|
|
4606
|
+
var r = this, i = e.collectionGroup, o = Qt();
|
|
4607
4607
|
return this.Jn.ur(t, i).next((function(s) {
|
|
4608
4608
|
return De.forEach(s, (function(s) {
|
|
4609
4609
|
var u = e.Oe(s.child(i));
|
|
@@ -4648,7 +4648,7 @@ function(t, e, n, r, i) {
|
|
|
4648
4648
|
})), h;
|
|
4649
4649
|
}));
|
|
4650
4650
|
}, t;
|
|
4651
|
-
}(),
|
|
4651
|
+
}(), Ue = /** @class */ function() {
|
|
4652
4652
|
function t(t, e, n, r) {
|
|
4653
4653
|
this.targetId = t, this.fromCache = e, this._r = n, this.dr = r;
|
|
4654
4654
|
}
|
|
@@ -4667,7 +4667,7 @@ function(t, e, n, r, i) {
|
|
|
4667
4667
|
}
|
|
4668
4668
|
return new t(e, n.fromCache, r, i);
|
|
4669
4669
|
}, t;
|
|
4670
|
-
}(),
|
|
4670
|
+
}(), Ce = /** @class */ function() {
|
|
4671
4671
|
function t(t, e) {
|
|
4672
4672
|
var n = this;
|
|
4673
4673
|
this.previousValue = t, e && (e.Tr = function(t) {
|
|
@@ -4685,7 +4685,7 @@ function(t, e, n, r, i) {
|
|
|
4685
4685
|
}();
|
|
4686
4686
|
|
|
4687
4687
|
/** The default database name for a project. */
|
|
4688
|
-
/** Represents the database ID a Firestore client is associated with. */
|
|
4688
|
+
/** Represents the database ID a Firestore client is associated with. */ Ce.Ir = -1;
|
|
4689
4689
|
|
|
4690
4690
|
/**
|
|
4691
4691
|
* @license
|
|
@@ -4703,14 +4703,14 @@ function(t, e, n, r, i) {
|
|
|
4703
4703
|
* See the License for the specific language governing permissions and
|
|
4704
4704
|
* limitations under the License.
|
|
4705
4705
|
*/
|
|
4706
|
-
var
|
|
4706
|
+
var Oe = function() {
|
|
4707
4707
|
var t = this;
|
|
4708
4708
|
this.promise = new Promise((function(e, n) {
|
|
4709
4709
|
t.resolve = e, t.reject = n;
|
|
4710
4710
|
}));
|
|
4711
|
-
},
|
|
4711
|
+
}, Pe = /** @class */ function() {
|
|
4712
4712
|
function t(t, e, n, r, i) {
|
|
4713
|
-
this.Ar = t, this.Pr = e, this.Vr = n, this.op = r, this.pr = i, this.gr = new
|
|
4713
|
+
this.Ar = t, this.Pr = e, this.Vr = n, this.op = r, this.pr = i, this.gr = new Oe,
|
|
4714
4714
|
this.then = this.gr.promise.then.bind(this.gr.promise), this.catch = this.gr.promise.catch.bind(this.gr.promise),
|
|
4715
4715
|
// It's normal for the deferred promise to be canceled (due to cancellation)
|
|
4716
4716
|
// and so we attach a dummy catch callback to avoid
|
|
@@ -4771,7 +4771,7 @@ var Ce = function() {
|
|
|
4771
4771
|
}, t.prototype.clearTimeout = function() {
|
|
4772
4772
|
null !== this.br && (this.pr(this), clearTimeout(this.br), this.br = null);
|
|
4773
4773
|
}, t;
|
|
4774
|
-
}(),
|
|
4774
|
+
}(), qe = /** @class */ function() {
|
|
4775
4775
|
function t() {
|
|
4776
4776
|
// The last promise in the queue.
|
|
4777
4777
|
this.Dr = Promise.resolve(),
|
|
@@ -4875,7 +4875,7 @@ var Ce = function() {
|
|
|
4875
4875
|
this.Ur(),
|
|
4876
4876
|
// Fast-forward delays for timerIds that have been overriden.
|
|
4877
4877
|
this.$r.indexOf(t) > -1 && (e = 0);
|
|
4878
|
-
var i =
|
|
4878
|
+
var i = Pe.yr(this, t, e, n, (function(t) {
|
|
4879
4879
|
return r.Wr(t);
|
|
4880
4880
|
}));
|
|
4881
4881
|
return this.Nr.push(i), i;
|
|
@@ -4958,7 +4958,7 @@ var Ce = function() {
|
|
|
4958
4958
|
var e = this.Nr.indexOf(t);
|
|
4959
4959
|
this.Nr.splice(e, 1);
|
|
4960
4960
|
}, t;
|
|
4961
|
-
}(),
|
|
4961
|
+
}(), Me = /** @class */ function() {
|
|
4962
4962
|
function t(
|
|
4963
4963
|
// When we attempt to collect, we will only do so if the cache size is greater than this
|
|
4964
4964
|
// threshold. Passing `COLLECTION_DISABLED` here will cause collection to always be skipped.
|
|
@@ -4997,8 +4997,8 @@ var Ce = function() {
|
|
|
4997
4997
|
* It is created via DelayedOperation.createAndSchedule().
|
|
4998
4998
|
*
|
|
4999
4999
|
* Supports cancellation (via cancel()) and early execution (via skipDelay()).
|
|
5000
|
-
*/
|
|
5001
|
-
|
|
5000
|
+
*/ Me.sh = -1, Me.ih = 1048576, Me.nh = 41943040, Me.th = 10, Me.eh = 1e3, Me.rh = new Me(Me.nh, Me.th, Me.eh),
|
|
5001
|
+
Me.DISABLED = new Me(Me.sh, 0, 0);
|
|
5002
5002
|
|
|
5003
5003
|
/**
|
|
5004
5004
|
* Local storage in the Firestore client. Coordinates persistence components
|
|
@@ -5051,7 +5051,7 @@ Pe.DISABLED = new Pe(Pe.sh, 0, 0);
|
|
|
5051
5051
|
* (unexpected) failure (e.g. failed assert) and always represent an
|
|
5052
5052
|
* unrecoverable error (should be caught / reported by the async_queue).
|
|
5053
5053
|
*/
|
|
5054
|
-
var
|
|
5054
|
+
var Fe = /** @class */ function() {
|
|
5055
5055
|
function t(
|
|
5056
5056
|
/** Manages our in-memory or durable persistence. */
|
|
5057
5057
|
t, e, n) {
|
|
@@ -5431,7 +5431,7 @@ var xe = /** @class */ function() {
|
|
|
5431
5431
|
// previous targetID.
|
|
5432
5432
|
// TODO(mcg): freshen last accessed date?
|
|
5433
5433
|
r = i, De.resolve(r)) : e.mh.ao(n).next((function(i) {
|
|
5434
|
-
return r = new
|
|
5434
|
+
return r = new Ot(t, i, 0 /* Listen */ , n.Kh), e.mh.uo(n, r).next((function() {
|
|
5435
5435
|
return r;
|
|
5436
5436
|
}));
|
|
5437
5437
|
}));
|
|
@@ -5645,7 +5645,7 @@ var xe = /** @class */ function() {
|
|
|
5645
5645
|
* Forward the magic "arguments" variable as second parameter on which the
|
|
5646
5646
|
* parameter validation is performed:
|
|
5647
5647
|
* validateNoArgs('myFunction', arguments);
|
|
5648
|
-
*/ function
|
|
5648
|
+
*/ function xe(t, e) {
|
|
5649
5649
|
if (0 !== e.length) throw new c(h.INVALID_ARGUMENT, "Function " + t + "() does not support arguments, but was called with " + on(e.length, "argument") + ".");
|
|
5650
5650
|
}
|
|
5651
5651
|
|
|
@@ -5666,7 +5666,7 @@ var xe = /** @class */ function() {
|
|
|
5666
5666
|
* Forward the magic "arguments" variable as second parameter on which the
|
|
5667
5667
|
* parameter validation is performed:
|
|
5668
5668
|
* validateAtLeastNumberOfArgs('myFunction', arguments, 2);
|
|
5669
|
-
*/ function
|
|
5669
|
+
*/ function Qe(t, e, n) {
|
|
5670
5670
|
if (e.length < n) throw new c(h.INVALID_ARGUMENT, "Function " + t + "() requires at least " + on(n, "argument") + ", but was called with " + on(e.length, "argument") + ".");
|
|
5671
5671
|
}
|
|
5672
5672
|
|
|
@@ -5677,7 +5677,7 @@ var xe = /** @class */ function() {
|
|
|
5677
5677
|
* Forward the magic "arguments" variable as second parameter on which the
|
|
5678
5678
|
* parameter validation is performed:
|
|
5679
5679
|
* validateBetweenNumberOfArgs('myFunction', arguments, 2, 3);
|
|
5680
|
-
*/ function
|
|
5680
|
+
*/ function Be(t, e, n, r) {
|
|
5681
5681
|
if (e.length < n || e.length > r) throw new c(h.INVALID_ARGUMENT, "Function " + t + "() requires between " + n + " and " + r + " arguments, but was called with " + on(e.length, "argument") + ".");
|
|
5682
5682
|
}
|
|
5683
5683
|
|
|
@@ -5688,22 +5688,22 @@ var xe = /** @class */ function() {
|
|
|
5688
5688
|
/**
|
|
5689
5689
|
* Validates the provided positional argument has the native JavaScript type
|
|
5690
5690
|
* using typeof checks.
|
|
5691
|
-
*/ function
|
|
5692
|
-
|
|
5691
|
+
*/ function ze(t, e, n, r) {
|
|
5692
|
+
Ze(t, e, rn(n) + " argument", r);
|
|
5693
5693
|
}
|
|
5694
5694
|
|
|
5695
5695
|
/**
|
|
5696
5696
|
* Validates the provided argument has the native JavaScript type using
|
|
5697
5697
|
* typeof checks or is undefined.
|
|
5698
5698
|
*/ function He(t, e, n, r) {
|
|
5699
|
-
void 0 !== r &&
|
|
5699
|
+
void 0 !== r && ze(t, e, n, r);
|
|
5700
5700
|
}
|
|
5701
5701
|
|
|
5702
5702
|
/**
|
|
5703
5703
|
* Validates the provided named option has the native JavaScript type using
|
|
5704
5704
|
* typeof checks.
|
|
5705
5705
|
*/ function Ye(t, e, n, r) {
|
|
5706
|
-
|
|
5706
|
+
Ze(t, e, n + " option", r);
|
|
5707
5707
|
}
|
|
5708
5708
|
|
|
5709
5709
|
/**
|
|
@@ -5725,9 +5725,9 @@ function Je(t, e, n, r, i) {
|
|
|
5725
5725
|
for (var o = [], s = 0, u = i; s < u.length; s++) {
|
|
5726
5726
|
var a = u[s];
|
|
5727
5727
|
if (a === r) return;
|
|
5728
|
-
o.push(
|
|
5728
|
+
o.push(Ke(a));
|
|
5729
5729
|
}
|
|
5730
|
-
var f =
|
|
5730
|
+
var f = Ke(r);
|
|
5731
5731
|
throw new c(h.INVALID_ARGUMENT, "Invalid value " + f + " provided to function " + t + '() for option "' + n + '". Acceptable values: ' + o.join(", "));
|
|
5732
5732
|
}(t, 0, n, r, i);
|
|
5733
5733
|
}
|
|
@@ -5740,9 +5740,9 @@ function Je(t, e, n, r, i) {
|
|
|
5740
5740
|
* @param position Position of the argument in `functionName`.
|
|
5741
5741
|
* @param argument Arugment to validate.
|
|
5742
5742
|
*/
|
|
5743
|
-
/** Helper to validate the type of a provided input. */ function
|
|
5744
|
-
if (!("object" === e ?
|
|
5745
|
-
var i =
|
|
5743
|
+
/** Helper to validate the type of a provided input. */ function Ze(t, e, n, r) {
|
|
5744
|
+
if (!("object" === e ? Xe(r) : "non-empty string" === e ? "string" == typeof r && "" !== r : typeof r === e)) {
|
|
5745
|
+
var i = Ke(r);
|
|
5746
5746
|
throw new c(h.INVALID_ARGUMENT, "Function " + t + "() requires its " + n + " to be of type " + e + ", but it was: " + i);
|
|
5747
5747
|
}
|
|
5748
5748
|
}
|
|
@@ -5750,11 +5750,11 @@ function Je(t, e, n, r, i) {
|
|
|
5750
5750
|
/**
|
|
5751
5751
|
* Returns true if it's a non-null object without a custom prototype
|
|
5752
5752
|
* (i.e. excludes Array, Date, etc.).
|
|
5753
|
-
*/ function
|
|
5753
|
+
*/ function Xe(t) {
|
|
5754
5754
|
return "object" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));
|
|
5755
5755
|
}
|
|
5756
5756
|
|
|
5757
|
-
/** Returns a string describing the type / value of the provided input. */ function
|
|
5757
|
+
/** Returns a string describing the type / value of the provided input. */ function Ke(t) {
|
|
5758
5758
|
if (void 0 === t) return "undefined";
|
|
5759
5759
|
if (null === t) return "null";
|
|
5760
5760
|
if ("string" == typeof t) return t.length > 20 && (t = t.substring(0, 20) + "..."),
|
|
@@ -5793,7 +5793,7 @@ function $e(t, e, n) {
|
|
|
5793
5793
|
* Helper method to throw an error that the provided argument did not pass
|
|
5794
5794
|
* an instanceof check.
|
|
5795
5795
|
*/ function en(t, e, n, r) {
|
|
5796
|
-
var i =
|
|
5796
|
+
var i = Ke(r);
|
|
5797
5797
|
return new c(h.INVALID_ARGUMENT, "Function " + t + "() requires its " + rn(n) + " argument to be a " + e + ", but it was: " + i);
|
|
5798
5798
|
}
|
|
5799
5799
|
|
|
@@ -5893,14 +5893,14 @@ function un() {
|
|
|
5893
5893
|
*
|
|
5894
5894
|
* Note that while you can't hide the constructor in JavaScript code, we are
|
|
5895
5895
|
* using the hack above to make sure no-one outside this module can call it.
|
|
5896
|
-
*/
|
|
5896
|
+
*/ Fe.eo = 3e8;
|
|
5897
5897
|
|
|
5898
5898
|
var hn = /** @class */ function() {
|
|
5899
5899
|
function t(t) {
|
|
5900
5900
|
an(), this.bo = t;
|
|
5901
5901
|
}
|
|
5902
5902
|
return t.fromBase64String = function(e) {
|
|
5903
|
-
je("Blob.fromBase64String", arguments, 1),
|
|
5903
|
+
je("Blob.fromBase64String", arguments, 1), ze("Blob.fromBase64String", "string", 1, e),
|
|
5904
5904
|
an();
|
|
5905
5905
|
try {
|
|
5906
5906
|
return new t(D.fromBase64String(e));
|
|
@@ -5931,7 +5931,7 @@ var hn = /** @class */ function() {
|
|
|
5931
5931
|
!function(t, e, n, r) {
|
|
5932
5932
|
if (!(e instanceof Array) || e.length < 1) throw new c(h.INVALID_ARGUMENT, "Function FieldPath() requires its fieldNames argument to be an array with at least " + on(1, "element") + ".");
|
|
5933
5933
|
}(0, t);
|
|
5934
|
-
for (var n = 0; n < t.length; ++n) if (
|
|
5934
|
+
for (var n = 0; n < t.length; ++n) if (ze("FieldPath", "string", n, t[n]), 0 === t[n].length) throw new c(h.INVALID_ARGUMENT, "Invalid field name at argument $(i + 1). Field names must not be empty.");
|
|
5935
5935
|
this.vo = new E(t);
|
|
5936
5936
|
}
|
|
5937
5937
|
return t.documentId = function() {
|
|
@@ -5965,21 +5965,21 @@ var ln = new RegExp("[~\\*/\\[\\]]"), pn = /** @class */ function() {
|
|
|
5965
5965
|
this.Co = t;
|
|
5966
5966
|
}
|
|
5967
5967
|
return t.delete = function() {
|
|
5968
|
-
return
|
|
5968
|
+
return xe("FieldValue.delete", arguments), dn.instance;
|
|
5969
5969
|
}, t.serverTimestamp = function() {
|
|
5970
|
-
return
|
|
5970
|
+
return xe("FieldValue.serverTimestamp", arguments), yn.instance;
|
|
5971
5971
|
}, t.arrayUnion = function() {
|
|
5972
5972
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5973
5973
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
5974
5974
|
// update() since we need access to the Firestore instance.
|
|
5975
|
-
return
|
|
5975
|
+
return Qe("FieldValue.arrayUnion", arguments, 1), new vn(t);
|
|
5976
5976
|
}, t.arrayRemove = function() {
|
|
5977
5977
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
5978
5978
|
// NOTE: We don't actually parse the data until it's used in set() or
|
|
5979
5979
|
// update() since we need access to the Firestore instance.
|
|
5980
|
-
return
|
|
5980
|
+
return Qe("FieldValue.arrayRemove", arguments, 1), new mn(t);
|
|
5981
5981
|
}, t.increment = function(t) {
|
|
5982
|
-
return
|
|
5982
|
+
return ze("FieldValue.increment", "number", 1, t), je("FieldValue.increment", arguments, 1),
|
|
5983
5983
|
new gn(t);
|
|
5984
5984
|
}, t.prototype.isEqual = function(t) {
|
|
5985
5985
|
return this === t;
|
|
@@ -6045,7 +6045,7 @@ var vn = /** @class */ function(t) {
|
|
|
6045
6045
|
return e.__extends(n, t), n;
|
|
6046
6046
|
}(pn), wn = sn(pn, "Use FieldValue.<field>() instead."), _n = /** @class */ function() {
|
|
6047
6047
|
function t(t, e) {
|
|
6048
|
-
if (je("GeoPoint", arguments, 2),
|
|
6048
|
+
if (je("GeoPoint", arguments, 2), ze("GeoPoint", "number", 1, t), ze("GeoPoint", "number", 2, e),
|
|
6049
6049
|
!isFinite(t) || t < -90 || t > 90) throw new c(h.INVALID_ARGUMENT, "Latitude must be a number between -90 and 90, but was: " + t);
|
|
6050
6050
|
if (!isFinite(e) || e < -180 || e > 180) throw new c(h.INVALID_ARGUMENT, "Longitude must be a number between -180 and 180, but was: " + e);
|
|
6051
6051
|
this.No = t, this.ko = e;
|
|
@@ -6338,7 +6338,7 @@ function Nn(t) {
|
|
|
6338
6338
|
// No transform to add for a delete, but we need to add it to our
|
|
6339
6339
|
// fieldMask so it gets deleted.
|
|
6340
6340
|
e.se.push(e.path);
|
|
6341
|
-
} else if (t instanceof yn) e.fieldTransforms.push(new it(e.path,
|
|
6341
|
+
} else if (t instanceof yn) e.fieldTransforms.push(new it(e.path, K.instance)); else if (t instanceof vn) {
|
|
6342
6342
|
var n = this.sa(t.Co, t.Do), r = new $(n);
|
|
6343
6343
|
e.fieldTransforms.push(new it(e.path, r));
|
|
6344
6344
|
} else if (t instanceof mn) {
|
|
@@ -6392,7 +6392,7 @@ function Nn(t) {
|
|
|
6392
6392
|
if (t instanceof Tn) return {
|
|
6393
6393
|
referenceValue: this.serializer.Ei(t.key.path, t.ci)
|
|
6394
6394
|
};
|
|
6395
|
-
throw e.Qo("Unsupported field value: " +
|
|
6395
|
+
throw e.Qo("Unsupported field value: " + Ke(t));
|
|
6396
6396
|
}, t.prototype.sa = function(t, e) {
|
|
6397
6397
|
var n = this;
|
|
6398
6398
|
return e.map((function(e, r) {
|
|
@@ -6422,8 +6422,8 @@ function Sn(t) {
|
|
|
6422
6422
|
}
|
|
6423
6423
|
|
|
6424
6424
|
function Rn(t, e, n) {
|
|
6425
|
-
if (!Sn(n) || !
|
|
6426
|
-
var r =
|
|
6425
|
+
if (!Sn(n) || !Xe(n)) {
|
|
6426
|
+
var r = Ke(n);
|
|
6427
6427
|
throw "an object" === r ? e.Qo(t + " a custom object") : e.Qo(t + " " + r);
|
|
6428
6428
|
}
|
|
6429
6429
|
}
|
|
@@ -6489,7 +6489,7 @@ function Rn(t, e, n) {
|
|
|
6489
6489
|
* backoff curve, and a +/- 50% "jitter" that is calculated and added to the
|
|
6490
6490
|
* base delay. This prevents clients from accidentally synchronizing their
|
|
6491
6491
|
* delays causing spikes of load to the backend.
|
|
6492
|
-
*/ var
|
|
6492
|
+
*/ var Un = /** @class */ function() {
|
|
6493
6493
|
function t(
|
|
6494
6494
|
/**
|
|
6495
6495
|
* The AsyncQueue to run backoff operations on.
|
|
@@ -6561,7 +6561,7 @@ function Rn(t, e, n) {
|
|
|
6561
6561
|
/** Returns a random value in the range [-currentBaseMs/2, currentBaseMs/2] */ t.prototype._a = function() {
|
|
6562
6562
|
return (Math.random() - .5) * this.oa;
|
|
6563
6563
|
}, t;
|
|
6564
|
-
}(),
|
|
6564
|
+
}(), Cn = /** @class */ function() {
|
|
6565
6565
|
function t(t, e, n, r, i, o) {
|
|
6566
6566
|
this.ia = t, this.da = n, this.fa = r, this.wa = i, this.listener = o, this.state = 0 /* Initial */ ,
|
|
6567
6567
|
/**
|
|
@@ -6569,7 +6569,7 @@ function Rn(t, e, n) {
|
|
|
6569
6569
|
* getCloseGuardedDispatcher() to invalidate callbacks that happen after
|
|
6570
6570
|
* close.
|
|
6571
6571
|
*/
|
|
6572
|
-
this.Ta = 0, this.ma = null, this.stream = null, this.Ea = new
|
|
6572
|
+
this.Ta = 0, this.ma = null, this.stream = null, this.Ea = new Un(t, e)
|
|
6573
6573
|
/**
|
|
6574
6574
|
* Returns true if start() has been called and no error has occurred. True
|
|
6575
6575
|
* indicates the stream is open or in the process of opening (which
|
|
@@ -6781,7 +6781,7 @@ function Rn(t, e, n) {
|
|
|
6781
6781
|
}));
|
|
6782
6782
|
};
|
|
6783
6783
|
}, t;
|
|
6784
|
-
}(),
|
|
6784
|
+
}(), On = /** @class */ function(t) {
|
|
6785
6785
|
function n(e, n, r, i, o) {
|
|
6786
6786
|
var s = this;
|
|
6787
6787
|
return (s = t.call(this, e, "listen_stream_connection_backoff" /* ListenStreamConnectionBackoff */ , "listen_stream_idle" /* ListenStreamIdle */ , n, r, o) || this).serializer = i,
|
|
@@ -6815,7 +6815,7 @@ function Rn(t, e, n) {
|
|
|
6815
6815
|
var e = {};
|
|
6816
6816
|
e.database = this.serializer.gi, e.removeTarget = t, this.ga(e);
|
|
6817
6817
|
}, n;
|
|
6818
|
-
}(
|
|
6818
|
+
}(Cn), Pn = /** @class */ function(t) {
|
|
6819
6819
|
function n(e, n, r, i, o) {
|
|
6820
6820
|
var s = this;
|
|
6821
6821
|
return (s = t.call(this, e, "write_stream_connection_backoff" /* WriteStreamConnectionBackoff */ , "write_stream_idle" /* WriteStreamIdle */ , n, r, o) || this).serializer = i,
|
|
@@ -6884,14 +6884,14 @@ function Rn(t, e, n) {
|
|
|
6884
6884
|
};
|
|
6885
6885
|
this.ga(n);
|
|
6886
6886
|
}, n;
|
|
6887
|
-
}(
|
|
6887
|
+
}(Cn), qn = /** @class */ function() {
|
|
6888
6888
|
function t(t, e, n, r) {
|
|
6889
6889
|
this.ia = t, this.fa = e, this.credentials = n, this.serializer = r;
|
|
6890
6890
|
}
|
|
6891
6891
|
return t.prototype.Wa = function(t) {
|
|
6892
|
-
return new
|
|
6892
|
+
return new Pn(this.ia, this.fa, this.credentials, this.serializer, t);
|
|
6893
6893
|
}, t.prototype.ja = function(t) {
|
|
6894
|
-
return new
|
|
6894
|
+
return new On(this.ia, this.fa, this.credentials, this.serializer, t);
|
|
6895
6895
|
}, t.prototype.commit = function(t) {
|
|
6896
6896
|
var e = this, n = {
|
|
6897
6897
|
database: this.serializer.gi,
|
|
@@ -6938,11 +6938,11 @@ function Rn(t, e, n) {
|
|
|
6938
6938
|
throw t.code === h.UNAUTHENTICATED && n.credentials.l(), t;
|
|
6939
6939
|
}));
|
|
6940
6940
|
}, t;
|
|
6941
|
-
}(),
|
|
6941
|
+
}(), Mn = /** @class */ function() {
|
|
6942
6942
|
function t(t) {
|
|
6943
6943
|
this.Ha = t,
|
|
6944
6944
|
// The version of each document that was read during this transaction.
|
|
6945
|
-
this.Ja =
|
|
6945
|
+
this.Ja = zt(), this.mutations = [], this.Ya = !1,
|
|
6946
6946
|
/**
|
|
6947
6947
|
* A deferred usage error that occurred previously in this transaction that
|
|
6948
6948
|
* will cause the transaction to fail once it actually commits.
|
|
@@ -7057,7 +7057,7 @@ function Rn(t, e, n) {
|
|
|
7057
7057
|
}, t.prototype.write = function(t) {
|
|
7058
7058
|
this.tu(), this.mutations = this.mutations.concat(t);
|
|
7059
7059
|
}, t.prototype.tu = function() {}, t;
|
|
7060
|
-
}(),
|
|
7060
|
+
}(), Fn = /** @class */ function() {
|
|
7061
7061
|
function t(t, e) {
|
|
7062
7062
|
this.Ar = t, this.iu = e,
|
|
7063
7063
|
/** The current OnlineState. */
|
|
@@ -7186,7 +7186,7 @@ function Rn(t, e, n) {
|
|
|
7186
7186
|
}));
|
|
7187
7187
|
}));
|
|
7188
7188
|
}));
|
|
7189
|
-
})), this.Iu = new
|
|
7189
|
+
})), this.Iu = new Fn(r, i),
|
|
7190
7190
|
// Create streams (but note they're not started yet).
|
|
7191
7191
|
this.Au = this.Ha.ja({
|
|
7192
7192
|
Na: this.Pu.bind(this),
|
|
@@ -7416,7 +7416,7 @@ function Rn(t, e, n) {
|
|
|
7416
7416
|
// mismatch, but don't actually retain that in listenTargets. This ensures
|
|
7417
7417
|
// that we flag the first re-listen this way without impacting future
|
|
7418
7418
|
// listens of this target (that might happen e.g. on reconnect).
|
|
7419
|
-
var r = new
|
|
7419
|
+
var r = new Ot(n.target, t, 1 /* ExistenceFilterMismatch */ , n.sequenceNumber);
|
|
7420
7420
|
e.Lu(r);
|
|
7421
7421
|
}
|
|
7422
7422
|
})), this.Mu.jh(n);
|
|
@@ -7533,7 +7533,7 @@ function Rn(t, e, n) {
|
|
|
7533
7533
|
// Reset the token if it's a permanent error, signaling the write stream is
|
|
7534
7534
|
// no longer valid. Note that the handshake does not count as a write: see
|
|
7535
7535
|
// comments on isPermanentWriteError for details.
|
|
7536
|
-
return
|
|
7536
|
+
return qt(t.code) ? [ 2 /*return*/ , (ve("RemoteStore", "RemoteStore error before completed handshake; resetting stream token: ", this.gu.lastStreamToken),
|
|
7537
7537
|
this.gu.lastStreamToken = D.Ut, this._u.Qh(D.Ut).catch(Ge)) ] : [ 2 /*return*/ ];
|
|
7538
7538
|
}));
|
|
7539
7539
|
}));
|
|
@@ -7543,14 +7543,14 @@ function Rn(t, e, n) {
|
|
|
7543
7543
|
return e.__generator(this, (function(e) {
|
|
7544
7544
|
// Only handle permanent errors here. If it's transient, just let the retry
|
|
7545
7545
|
// logic kick in.
|
|
7546
|
-
return
|
|
7546
|
+
return qt(r = t.code) && r !== h.ABORTED ? (n = this.du.shift(), [ 2 /*return*/ , (this.gu.Pa(),
|
|
7547
7547
|
this.Mu.Ju(n.batchId, t).then((function() {
|
|
7548
7548
|
return i.Du();
|
|
7549
7549
|
}))) ]) : [ 2 /*return*/ ];
|
|
7550
7550
|
}));
|
|
7551
7551
|
}));
|
|
7552
7552
|
}, t.prototype.Yu = function() {
|
|
7553
|
-
return new
|
|
7553
|
+
return new Mn(this.Ha);
|
|
7554
7554
|
}, t.prototype.Ru = function() {
|
|
7555
7555
|
return e.__awaiter(this, void 0, void 0, (function() {
|
|
7556
7556
|
return e.__generator(this, (function(t) {
|
|
@@ -7615,7 +7615,7 @@ function Rn(t, e, n) {
|
|
|
7615
7615
|
}));
|
|
7616
7616
|
}));
|
|
7617
7617
|
}, t;
|
|
7618
|
-
}(),
|
|
7618
|
+
}(), xn = /** @class */ function() {
|
|
7619
7619
|
function t() {
|
|
7620
7620
|
this.activeTargetIds = Jt();
|
|
7621
7621
|
}
|
|
@@ -7637,7 +7637,7 @@ function Rn(t, e, n) {
|
|
|
7637
7637
|
}, t;
|
|
7638
7638
|
}(), jn = /** @class */ function() {
|
|
7639
7639
|
function t() {
|
|
7640
|
-
this.ic = new
|
|
7640
|
+
this.ic = new xn, this.nc = {}, this.Mu = null, this.iu = null, this.Tr = null;
|
|
7641
7641
|
}
|
|
7642
7642
|
return t.prototype.rc = function(t) {
|
|
7643
7643
|
// No op.
|
|
@@ -7658,13 +7658,13 @@ function Rn(t, e, n) {
|
|
|
7658
7658
|
}, t.prototype.dc = function(t) {
|
|
7659
7659
|
return this.ic.activeTargetIds.has(t);
|
|
7660
7660
|
}, t.prototype.start = function() {
|
|
7661
|
-
return this.ic = new
|
|
7661
|
+
return this.ic = new xn, Promise.resolve();
|
|
7662
7662
|
}, t.prototype.Vh = function(t, e, n) {
|
|
7663
7663
|
// No op.
|
|
7664
7664
|
}, t.prototype.fc = function(t) {
|
|
7665
7665
|
// No op.
|
|
7666
7666
|
}, t.prototype.ku = function() {}, t.prototype.Rr = function(t) {}, t;
|
|
7667
|
-
}(),
|
|
7667
|
+
}(), Qn = /** @class */ function() {
|
|
7668
7668
|
function t(t) {
|
|
7669
7669
|
this.wc = t;
|
|
7670
7670
|
}
|
|
@@ -7680,9 +7680,9 @@ function Rn(t, e, n) {
|
|
|
7680
7680
|
// Sync engine assigns target IDs for limbo document detection.
|
|
7681
7681
|
return new t(-1);
|
|
7682
7682
|
}, t;
|
|
7683
|
-
}(),
|
|
7683
|
+
}(), Bn = function(t) {
|
|
7684
7684
|
this.key = t;
|
|
7685
|
-
},
|
|
7685
|
+
}, zn = function(t) {
|
|
7686
7686
|
this.key = t;
|
|
7687
7687
|
}, Hn = /** @class */ function() {
|
|
7688
7688
|
function t(t,
|
|
@@ -7699,7 +7699,7 @@ function Rn(t, e, n) {
|
|
|
7699
7699
|
/** Documents in the view but not in the remote target */
|
|
7700
7700
|
this.Ic = Yt(),
|
|
7701
7701
|
/** Document Keys that have local changes */
|
|
7702
|
-
this.ls = Yt(), this.Ac = new
|
|
7702
|
+
this.ls = Yt(), this.Ac = new Zt(t.qe.bind(t));
|
|
7703
7703
|
}
|
|
7704
7704
|
return Object.defineProperty(t.prototype, "Pc", {
|
|
7705
7705
|
/**
|
|
@@ -7723,7 +7723,7 @@ function Rn(t, e, n) {
|
|
|
7723
7723
|
* @return a new set of docs, changes, and refill flag.
|
|
7724
7724
|
*/
|
|
7725
7725
|
t.prototype.Vc = function(t, e) {
|
|
7726
|
-
var n = this, r = e ? e.pc : new
|
|
7726
|
+
var n = this, r = e ? e.pc : new Xt, i = e ? e.Ac : this.Ac, o = e ? e.ls : this.ls, s = i, u = !1, a = this.query.je() && i.size === this.query.limit ? i.last() : null, h = this.query.Ge() && i.size === this.query.limit ? i.first() : null;
|
|
7727
7727
|
// Drop documents out to meet limit/limitToLast requirement.
|
|
7728
7728
|
if (t.ut((function(t, e) {
|
|
7729
7729
|
var c = i.get(t), f = e instanceof vt ? e : null;
|
|
@@ -7820,7 +7820,7 @@ function Rn(t, e, n) {
|
|
|
7820
7820
|
})), this.vc(n);
|
|
7821
7821
|
var s = e ? this.Sc() : [], u = 0 === this.Ic.size && this.As ? 1 /* Synced */ : 0 /* Local */ , a = u !== this.Rc;
|
|
7822
7822
|
return this.Rc = u, 0 !== o.length || a ? {
|
|
7823
|
-
snapshot: new
|
|
7823
|
+
snapshot: new Kt(this.query, t.Ac, i, o, t.ls, 0 /* Local */ === u, a,
|
|
7824
7824
|
/* excludesMetadataChanges= */ !1),
|
|
7825
7825
|
Cc: s
|
|
7826
7826
|
} : {
|
|
@@ -7840,7 +7840,7 @@ function Rn(t, e, n) {
|
|
|
7840
7840
|
// true once the client is back online.
|
|
7841
7841
|
this.As = !1, this.bc({
|
|
7842
7842
|
Ac: this.Ac,
|
|
7843
|
-
pc: new
|
|
7843
|
+
pc: new Xt,
|
|
7844
7844
|
ls: this.ls,
|
|
7845
7845
|
yc: !1
|
|
7846
7846
|
},
|
|
@@ -7881,9 +7881,9 @@ function Rn(t, e, n) {
|
|
|
7881
7881
|
// Diff the new limbo docs with the old limbo docs.
|
|
7882
7882
|
var n = [];
|
|
7883
7883
|
return e.forEach((function(e) {
|
|
7884
|
-
t.Ic.has(e) || n.push(new
|
|
7884
|
+
t.Ic.has(e) || n.push(new zn(e));
|
|
7885
7885
|
})), this.Ic.forEach((function(t) {
|
|
7886
|
-
e.has(t) || n.push(new
|
|
7886
|
+
e.has(t) || n.push(new Bn(t));
|
|
7887
7887
|
})), n;
|
|
7888
7888
|
},
|
|
7889
7889
|
/**
|
|
@@ -7918,11 +7918,11 @@ function Rn(t, e, n) {
|
|
|
7918
7918
|
*/
|
|
7919
7919
|
// PORTING NOTE: Multi-tab only.
|
|
7920
7920
|
t.prototype.kc = function() {
|
|
7921
|
-
return
|
|
7921
|
+
return Kt.fs(this.query, this.Ac, this.ls, 0 /* Local */ === this.Rc);
|
|
7922
7922
|
}, t;
|
|
7923
7923
|
}(), Yn = /** @class */ function() {
|
|
7924
7924
|
function t(t, e, n, r) {
|
|
7925
|
-
this.Ar = t, this.Lc = e, this.updateFunction = n, this.gr = r, this.$c = 5, this.Ea = new
|
|
7925
|
+
this.Ar = t, this.Lc = e, this.updateFunction = n, this.gr = r, this.$c = 5, this.Ea = new Un(this.Ar, "retry_transaction" /* RetryTransaction */)
|
|
7926
7926
|
/** Runs the transaction and sets the result on deferred. */;
|
|
7927
7927
|
}
|
|
7928
7928
|
return t.prototype.Oc = function() {
|
|
@@ -7966,7 +7966,7 @@ function Rn(t, e, n) {
|
|
|
7966
7966
|
// In transactions, the backend will fail outdated reads with FAILED_PRECONDITION and
|
|
7967
7967
|
// non-matching document versions with ABORTED. These errors should be retried.
|
|
7968
7968
|
var e = t.code;
|
|
7969
|
-
return "aborted" === e || "failed-precondition" === e || !
|
|
7969
|
+
return "aborted" === e || "failed-precondition" === e || !qt(e);
|
|
7970
7970
|
}
|
|
7971
7971
|
return !1;
|
|
7972
7972
|
}, t;
|
|
@@ -7997,7 +7997,7 @@ n) {
|
|
|
7997
7997
|
* the target is CURRENT.
|
|
7998
7998
|
*/
|
|
7999
7999
|
this.xc = !1;
|
|
8000
|
-
},
|
|
8000
|
+
}, Zn = /** @class */ function() {
|
|
8001
8001
|
function t(t, e,
|
|
8002
8002
|
// PORTING NOTE: Manages state synchronization in multi-tab environments.
|
|
8003
8003
|
n, r, i) {
|
|
@@ -8023,7 +8023,7 @@ n) {
|
|
|
8023
8023
|
/** Stores user completion handlers, indexed by User and BatchId. */
|
|
8024
8024
|
this.Xc = {},
|
|
8025
8025
|
/** Stores user callbacks waiting for all pending writes to be acknowledged. */
|
|
8026
|
-
this.Zc = new Map, this.tl =
|
|
8026
|
+
this.Zc = new Map, this.tl = Qn.mc(),
|
|
8027
8027
|
// The primary state is set to `true` or `false` immediately after Firestore
|
|
8028
8028
|
// startup. In the interim, a client should only be considered primary if
|
|
8029
8029
|
// `isPrimary` is true.
|
|
@@ -8470,7 +8470,7 @@ n) {
|
|
|
8470
8470
|
}, t.prototype.rl = function(t, e) {
|
|
8471
8471
|
for (var n = 0, r = e; n < r.length; n++) {
|
|
8472
8472
|
var i = r[n];
|
|
8473
|
-
i instanceof
|
|
8473
|
+
i instanceof Bn ? (this.Yc.vn(i.key, t), this.El(i)) : i instanceof zn ? (ve("SyncEngine", "Document no longer in limbo: " + i.key),
|
|
8474
8474
|
this.Yc.Cn(i.key, t), this.Yc.$n(i.key) ||
|
|
8475
8475
|
// We removed the last reference for this key
|
|
8476
8476
|
this.ml(i.key)) : we("Unknown limbo change: " + JSON.stringify(i));
|
|
@@ -8491,7 +8491,7 @@ n) {
|
|
|
8491
8491
|
t.prototype.cl = function() {
|
|
8492
8492
|
for (;this.Kc.length > 0 && this.Hc.size < this.Wc; ) {
|
|
8493
8493
|
var t = this.Kc.shift(), e = this.tl.next();
|
|
8494
|
-
this.Jc.set(e, new Jn(t)), this.Hc = this.Hc.nt(t, e), this.Lc.listen(new
|
|
8494
|
+
this.Jc.set(e, new Jn(t)), this.Hc = this.Hc.nt(t, e), this.Lc.listen(new Ot(_t.ve(t.path).Ue(), e, 2 /* LimboResolution */ , Ce.Ir));
|
|
8495
8495
|
}
|
|
8496
8496
|
},
|
|
8497
8497
|
// Visible for testing
|
|
@@ -8523,7 +8523,7 @@ n) {
|
|
|
8523
8523
|
if (s.rl(u.targetId, o.Cc), o.snapshot) {
|
|
8524
8524
|
s.isPrimary && s.Qc.ac(u.targetId, o.snapshot.fromCache ? "not-current" : "current"),
|
|
8525
8525
|
r.push(o.snapshot);
|
|
8526
|
-
var a =
|
|
8526
|
+
var a = Ue.wr(u.targetId, o.snapshot);
|
|
8527
8527
|
i.push(a);
|
|
8528
8528
|
}
|
|
8529
8529
|
})));
|
|
@@ -8830,9 +8830,9 @@ n) {
|
|
|
8830
8830
|
}
|
|
8831
8831
|
return n;
|
|
8832
8832
|
}, t;
|
|
8833
|
-
}(),
|
|
8833
|
+
}(), Xn = function() {
|
|
8834
8834
|
this.yl = null, this.targetId = 0, this.bl = [];
|
|
8835
|
-
},
|
|
8835
|
+
}, Kn = /** @class */ function() {
|
|
8836
8836
|
function t(t) {
|
|
8837
8837
|
this.Mu = t, this.vl = new Te((function(t) {
|
|
8838
8838
|
return t.canonicalId();
|
|
@@ -8840,7 +8840,7 @@ n) {
|
|
|
8840
8840
|
}
|
|
8841
8841
|
return t.prototype.listen = function(t) {
|
|
8842
8842
|
var e = t.query, n = !1, r = this.vl.get(e);
|
|
8843
|
-
return r || (n = !0, r = new
|
|
8843
|
+
return r || (n = !0, r = new Xn, this.vl.set(e, r)), r.bl.push(t),
|
|
8844
8844
|
// Run global snapshot listeners if a consistent snapshot has been emitted.
|
|
8845
8845
|
t.Dc(this.onlineState), r.yl && t.Cl(r.yl) && this.Dl(), n ? this.Mu.listen(e).then((function(t) {
|
|
8846
8846
|
return r.targetId = t, t;
|
|
@@ -8918,7 +8918,7 @@ n) {
|
|
|
8918
8918
|
var i = r[n];
|
|
8919
8919
|
3 /* Metadata */ !== i.type && e.push(i);
|
|
8920
8920
|
}
|
|
8921
|
-
t = new
|
|
8921
|
+
t = new Kt(t.query, t.docs, t.cs, e, t.ls, t.fromCache, t._s,
|
|
8922
8922
|
/* excludesMetadataChanges= */ !0);
|
|
8923
8923
|
}
|
|
8924
8924
|
var o = !1;
|
|
@@ -8954,7 +8954,7 @@ n) {
|
|
|
8954
8954
|
// to get here if there were only metadata docChanges and they got
|
|
8955
8955
|
// stripped out.
|
|
8956
8956
|
}, t.prototype.Ul = function(t) {
|
|
8957
|
-
t =
|
|
8957
|
+
t = Kt.fs(t.query, t.docs, t.ls, t.fromCache), this.Ll = !0, this.kl.next(t);
|
|
8958
8958
|
}, t;
|
|
8959
8959
|
}(), tr = /** @class */ function() {
|
|
8960
8960
|
function t() {}
|
|
@@ -9233,13 +9233,13 @@ n) {
|
|
|
9233
9233
|
var n = this.docs.get(e);
|
|
9234
9234
|
return De.resolve(n ? n.e_ : null);
|
|
9235
9235
|
}, t.prototype.getEntries = function(t, e) {
|
|
9236
|
-
var n = this, r =
|
|
9236
|
+
var n = this, r = xt();
|
|
9237
9237
|
return e.forEach((function(t) {
|
|
9238
9238
|
var e = n.docs.get(t);
|
|
9239
9239
|
r = r.nt(t, e ? e.e_ : null);
|
|
9240
9240
|
})), De.resolve(r);
|
|
9241
9241
|
}, t.prototype.rr = function(t, e, n) {
|
|
9242
|
-
for (var r =
|
|
9242
|
+
for (var r = Qt(), i = new b(e.path.child("")), o = this.docs._t(i)
|
|
9243
9243
|
// Documents are ordered by key, so we can use a prefix scan to narrow down
|
|
9244
9244
|
// the documents we need to match the query against.
|
|
9245
9245
|
; o.Rt(); ) {
|
|
@@ -9443,7 +9443,7 @@ var or = /** @class */ function() {
|
|
|
9443
9443
|
* A ordered bidirectional mapping between documents and the remote target
|
|
9444
9444
|
* IDs.
|
|
9445
9445
|
*/
|
|
9446
|
-
this.d_ = new Re, this.targetCount = 0, this.f_ =
|
|
9446
|
+
this.d_ = new Re, this.targetCount = 0, this.f_ = Qn.Tc();
|
|
9447
9447
|
}
|
|
9448
9448
|
return t.prototype.Xs = function(t, e) {
|
|
9449
9449
|
return this.l_.forEach((function(t, n) {
|
|
@@ -9461,7 +9461,7 @@ var or = /** @class */ function() {
|
|
|
9461
9461
|
}, t.prototype.T_ = function(t) {
|
|
9462
9462
|
this.l_.set(t.target, t);
|
|
9463
9463
|
var e = t.targetId;
|
|
9464
|
-
e > this.highestTargetId && (this.f_ = new
|
|
9464
|
+
e > this.highestTargetId && (this.f_ = new Qn(e), this.highestTargetId = e), t.sequenceNumber > this.__ && (this.__ = t.sequenceNumber);
|
|
9465
9465
|
}, t.prototype.uo = function(t, e) {
|
|
9466
9466
|
return this.T_(e), this.targetCount += 1, De.resolve();
|
|
9467
9467
|
}, t.prototype.Jh = function(t, e) {
|
|
@@ -9515,14 +9515,12 @@ var or = /** @class */ function() {
|
|
|
9515
9515
|
*/
|
|
9516
9516
|
function t(t, e) {
|
|
9517
9517
|
var n = this;
|
|
9518
|
-
this.clientId = t, this.A_ = {}, this.P_ = new
|
|
9518
|
+
this.clientId = t, this.A_ = {}, this.P_ = new Ce(0), this.V_ = !1, this.V_ = !0,
|
|
9519
9519
|
this.dh = e(this), this.mh = new or(this), this.Jn = new er, this.Kn = new ir(this.Jn, (function(t) {
|
|
9520
9520
|
return n.dh.p_(t);
|
|
9521
9521
|
}));
|
|
9522
9522
|
}
|
|
9523
|
-
return t.prototype.
|
|
9524
|
-
return Promise.resolve();
|
|
9525
|
-
}, t.prototype.ku = function() {
|
|
9523
|
+
return t.prototype.ku = function() {
|
|
9526
9524
|
// No durable state to ensure is closed on shutdown.
|
|
9527
9525
|
return this.V_ = !1, Promise.resolve();
|
|
9528
9526
|
}, Object.defineProperty(t.prototype, "g_", {
|
|
@@ -9656,74 +9654,38 @@ var or = /** @class */ function() {
|
|
|
9656
9654
|
return De.resolve(n.k_.$n(e));
|
|
9657
9655
|
} ]);
|
|
9658
9656
|
}, t;
|
|
9659
|
-
}(), hr = /** @class */ function() {
|
|
9660
|
-
function t() {
|
|
9661
|
-
|
|
9657
|
+
}(), hr = "You are using the memory-only build of Firestore. Persistence support is only available via the @firebase/firestore bundle or the firebase-firestore.js build.", cr = /** @class */ function() {
|
|
9658
|
+
function t(t) {
|
|
9659
|
+
void 0 === t && (t = ar.O_), this.q_ = t;
|
|
9660
|
+
}
|
|
9661
|
+
return t.prototype.initialize = function(t, n, r, i, o, s, u, a) {
|
|
9662
9662
|
return e.__awaiter(this, void 0, void 0, (function() {
|
|
9663
9663
|
var n = this;
|
|
9664
|
-
return e.__generator(this, (function(
|
|
9665
|
-
switch (
|
|
9664
|
+
return e.__generator(this, (function(e) {
|
|
9665
|
+
switch (e.label) {
|
|
9666
9666
|
case 0:
|
|
9667
|
-
|
|
9667
|
+
if (a.B_) throw new c(h.FAILED_PRECONDITION, hr);
|
|
9668
|
+
return this.persistence = new sr(o, this.q_), this.x_ = null, this.Qc = new jn,
|
|
9669
|
+
this._u = new Fe(this.persistence, new tr, s), this.Lc = new Gn(this._u, i, t, (function(t) {
|
|
9670
|
+
return n.Mu.Dc(t, 0 /* RemoteStore */);
|
|
9671
|
+
}), r.Q_()), this.Mu = new Zn(this._u, this.Lc, this.Qc, s, u), this.W_ = new Kn(this.Mu),
|
|
9672
|
+
this.Lc.Mu = this.Mu, [ 4 /*yield*/ , this.Lc.start() ];
|
|
9668
9673
|
|
|
9669
9674
|
case 1:
|
|
9670
|
-
return
|
|
9671
|
-
this.Mu = this.G_(t), this.z_ = this.K_(t), this.Qc.iu = function(t) {
|
|
9672
|
-
return n.Mu.Dc(t, 1 /* SharedClientState */);
|
|
9673
|
-
}, this.Lc.Mu = this.Mu, this.Qc.Mu = this.Mu, [ 4 /*yield*/ , this.Qc.start() ];
|
|
9675
|
+
return e.sent(), [ 4 /*yield*/ , this.Lc.Zu(!0) ];
|
|
9674
9676
|
|
|
9675
9677
|
case 2:
|
|
9676
|
-
return
|
|
9678
|
+
return e.sent(), [ 4 /*yield*/ , this.Mu.Zu(!0) ];
|
|
9677
9679
|
|
|
9678
9680
|
case 3:
|
|
9679
|
-
return
|
|
9680
|
-
|
|
9681
|
-
case 4:
|
|
9682
|
-
// NOTE: This will immediately call the listener, so we make sure to
|
|
9683
|
-
// set it after localStore / remoteStore are started.
|
|
9684
|
-
return r.sent(), [ 4 /*yield*/ , this.persistence.y_((function(t) {
|
|
9685
|
-
return e.__awaiter(n, void 0, void 0, (function() {
|
|
9686
|
-
return e.__generator(this, (function(e) {
|
|
9687
|
-
switch (e.label) {
|
|
9688
|
-
case 0:
|
|
9689
|
-
return [ 4 /*yield*/ , this.Mu.Zu(t) ];
|
|
9690
|
-
|
|
9691
|
-
case 1:
|
|
9692
|
-
return e.sent(), this.x_ && (t && !this.x_.g_ ? this.x_.start(this._u) : t || this.x_.stop()),
|
|
9693
|
-
[ 2 /*return*/ ];
|
|
9694
|
-
}
|
|
9695
|
-
}));
|
|
9696
|
-
}));
|
|
9697
|
-
})) ];
|
|
9698
|
-
|
|
9699
|
-
case 5:
|
|
9700
|
-
// NOTE: This will immediately call the listener, so we make sure to
|
|
9701
|
-
// set it after localStore / remoteStore are started.
|
|
9702
|
-
return r.sent(), [ 2 /*return*/ ];
|
|
9681
|
+
return e.sent(), [ 2 /*return*/ ];
|
|
9703
9682
|
}
|
|
9704
9683
|
}));
|
|
9705
9684
|
}));
|
|
9706
|
-
}, t.prototype.
|
|
9707
|
-
|
|
9708
|
-
}, t.prototype.Q_ = function(t) {
|
|
9709
|
-
return null;
|
|
9710
|
-
}, t.prototype.W_ = function(t) {
|
|
9711
|
-
return new xe(this.persistence, new tr, t.H_);
|
|
9712
|
-
}, t.prototype.B_ = function(t) {
|
|
9713
|
-
return new sr(t.clientId, ar.O_);
|
|
9714
|
-
}, t.prototype.j_ = function(t) {
|
|
9715
|
-
var e = this;
|
|
9716
|
-
return new Gn(this._u, t.Ha, t.Ar, (function(t) {
|
|
9717
|
-
return e.Mu.Dc(t, 0 /* RemoteStore */);
|
|
9718
|
-
}), t.platform.J_());
|
|
9719
|
-
}, t.prototype.q_ = function(t) {
|
|
9720
|
-
return new jn;
|
|
9721
|
-
}, t.prototype.G_ = function(t) {
|
|
9722
|
-
return new Xn(this._u, this.Lc, this.Qc, t.H_, t.Wc);
|
|
9723
|
-
}, t.prototype.clearPersistence = function(t) {
|
|
9724
|
-
throw new c(h.FAILED_PRECONDITION, "You are using the memory-only build of Firestore. Persistence support is only available via the @firebase/firestore bundle or the firebase-firestore.js build.");
|
|
9685
|
+
}, t.prototype.clearPersistence = function() {
|
|
9686
|
+
throw new c(h.FAILED_PRECONDITION, hr);
|
|
9725
9687
|
}, t;
|
|
9726
|
-
}(),
|
|
9688
|
+
}(), fr = /** @class */ function() {
|
|
9727
9689
|
function t(t, e, n,
|
|
9728
9690
|
/**
|
|
9729
9691
|
* Asynchronous queue responsible for all of our internal processing. When
|
|
@@ -9734,7 +9696,7 @@ var or = /** @class */ function() {
|
|
|
9734
9696
|
* an async I/O to complete).
|
|
9735
9697
|
*/
|
|
9736
9698
|
r) {
|
|
9737
|
-
this.platform = t, this.
|
|
9699
|
+
this.platform = t, this.j_ = e, this.credentials = n, this.Ar = r, this.clientId = Ee.Tn()
|
|
9738
9700
|
/**
|
|
9739
9701
|
* Starts up the FirestoreClient, returning only whether or not enabling
|
|
9740
9702
|
* persistence succeeded.
|
|
@@ -9774,14 +9736,14 @@ var or = /** @class */ function() {
|
|
|
9774
9736
|
}
|
|
9775
9737
|
return t.prototype.start = function(t, e) {
|
|
9776
9738
|
var n = this;
|
|
9777
|
-
this.
|
|
9739
|
+
this.G_();
|
|
9778
9740
|
// We defer our initialization until we get the current user from
|
|
9779
9741
|
// setChangeListener(). We block the async queue until we got the initial
|
|
9780
9742
|
// user and the initialization is completed. This will prevent any scheduled
|
|
9781
9743
|
// work from happening before initialization is completed.
|
|
9782
9744
|
// If initializationDone resolved then the FirestoreClient is in a usable
|
|
9783
9745
|
// state.
|
|
9784
|
-
var r = new
|
|
9746
|
+
var r = new Oe, i = new Oe, o = !1;
|
|
9785
9747
|
// If usePersistence is true, certain classes of errors while starting are
|
|
9786
9748
|
// recoverable but only by falling back to persistence disabled.
|
|
9787
9749
|
// If there's an error in the first case but not in recovery we cannot
|
|
@@ -9791,7 +9753,7 @@ var or = /** @class */ function() {
|
|
|
9791
9753
|
// need to await the completion of initializationDone because the result of
|
|
9792
9754
|
// this method should not reflect any other kind of failure to start.
|
|
9793
9755
|
return this.credentials._((function(s) {
|
|
9794
|
-
if (!o) return o = !0, ve("FirestoreClient", "Initializing. user=", s.uid), n.
|
|
9756
|
+
if (!o) return o = !0, ve("FirestoreClient", "Initializing. user=", s.uid), n.z_(t, e, s, i).then(r.resolve, r.reject);
|
|
9795
9757
|
n.Ar.Cr((function() {
|
|
9796
9758
|
return n.Xu(s);
|
|
9797
9759
|
}));
|
|
@@ -9803,7 +9765,7 @@ var or = /** @class */ function() {
|
|
|
9803
9765
|
},
|
|
9804
9766
|
/** Enables the network connection and requeues all pending operations. */ t.prototype.enableNetwork = function() {
|
|
9805
9767
|
var t = this;
|
|
9806
|
-
return this.
|
|
9768
|
+
return this.G_(), this.Ar.enqueue((function() {
|
|
9807
9769
|
return t.Mu.enableNetwork();
|
|
9808
9770
|
}));
|
|
9809
9771
|
},
|
|
@@ -9827,30 +9789,21 @@ var or = /** @class */ function() {
|
|
|
9827
9789
|
* continue, i.e. that one of the persistence implementations actually
|
|
9828
9790
|
* succeeded.
|
|
9829
9791
|
*/
|
|
9830
|
-
t.prototype.
|
|
9792
|
+
t.prototype.z_ = function(t, n, r, i) {
|
|
9831
9793
|
return e.__awaiter(this, void 0, void 0, (function() {
|
|
9832
9794
|
var o, s, u, a, h = this;
|
|
9833
9795
|
return e.__generator(this, (function(c) {
|
|
9834
9796
|
switch (c.label) {
|
|
9835
9797
|
case 0:
|
|
9836
|
-
return c.trys.push([ 0, 3, , 4 ]), [ 4 /*yield*/ , this.platform.
|
|
9798
|
+
return c.trys.push([ 0, 3, , 4 ]), [ 4 /*yield*/ , this.platform.K_(this.j_) ];
|
|
9837
9799
|
|
|
9838
9800
|
case 1:
|
|
9839
|
-
return o = c.sent(), s = this.platform.
|
|
9840
|
-
[ 4 /*yield*/ , t.initialize(
|
|
9841
|
-
Ar: this.Ar,
|
|
9842
|
-
Y_: this.Y_,
|
|
9843
|
-
platform: this.platform,
|
|
9844
|
-
Ha: u,
|
|
9845
|
-
clientId: this.clientId,
|
|
9846
|
-
H_: r,
|
|
9847
|
-
Wc: 100,
|
|
9848
|
-
sd: n
|
|
9849
|
-
}) ];
|
|
9801
|
+
return o = c.sent(), s = this.platform.H_(this.j_.ci), u = new qn(this.Ar, o, this.credentials, s),
|
|
9802
|
+
[ 4 /*yield*/ , t.initialize(this.Ar, this.j_, this.platform, u, this.clientId, r, 100, n) ];
|
|
9850
9803
|
|
|
9851
9804
|
case 2:
|
|
9852
9805
|
return c.sent(), this.persistence = t.persistence, this.Qc = t.Qc, this._u = t._u,
|
|
9853
|
-
this.Lc = t.Lc, this.Mu = t.Mu, this.x_ = t.x_, this.
|
|
9806
|
+
this.Lc = t.Lc, this.Mu = t.Mu, this.x_ = t.x_, this.J_ = t.W_,
|
|
9854
9807
|
// When a user calls clearPersistence() in one client, all other clients
|
|
9855
9808
|
// need to be terminated to allow the delete to succeed.
|
|
9856
9809
|
this.persistence.b_((function() {
|
|
@@ -9872,10 +9825,10 @@ var or = /** @class */ function() {
|
|
|
9872
9825
|
if (a = c.sent(),
|
|
9873
9826
|
// Regardless of whether or not the retry succeeds, from an user
|
|
9874
9827
|
// perspective, offline persistence has failed.
|
|
9875
|
-
i.reject(a), !this.
|
|
9828
|
+
i.reject(a), !this.Y_(a)) throw a;
|
|
9876
9829
|
return [ 2 /*return*/ , (console.warn("Error enabling offline persistence. Falling back to persistence disabled: " + a),
|
|
9877
|
-
this.
|
|
9878
|
-
|
|
9830
|
+
this.z_(new cr, {
|
|
9831
|
+
B_: !1
|
|
9879
9832
|
}, r, i)) ];
|
|
9880
9833
|
|
|
9881
9834
|
case 4:
|
|
@@ -9888,7 +9841,7 @@ var or = /** @class */ function() {
|
|
|
9888
9841
|
* Decides whether the provided error allows us to gracefully disable
|
|
9889
9842
|
* persistence (as opposed to crashing the client).
|
|
9890
9843
|
*/
|
|
9891
|
-
t.prototype.
|
|
9844
|
+
t.prototype.Y_ = function(t) {
|
|
9892
9845
|
return "FirebaseError" === t.name ? t.code === h.FAILED_PRECONDITION || t.code === h.UNIMPLEMENTED : !("undefined" != typeof DOMException && t instanceof DOMException) ||
|
|
9893
9846
|
// When the browser is out of quota we could get either quota exceeded
|
|
9894
9847
|
// or an aborted error depending on whether the error happened during
|
|
@@ -9902,7 +9855,7 @@ var or = /** @class */ function() {
|
|
|
9902
9855
|
* Checks that the client has not been terminated. Ensures that other methods on
|
|
9903
9856
|
* this class cannot be called after the client is terminated.
|
|
9904
9857
|
*/
|
|
9905
|
-
t.prototype.
|
|
9858
|
+
t.prototype.G_ = function() {
|
|
9906
9859
|
if (this.Ar.Or) throw new c(h.FAILED_PRECONDITION, "The client has already been terminated.");
|
|
9907
9860
|
}, t.prototype.Xu = function(t) {
|
|
9908
9861
|
return this.Ar.jr(), ve("FirestoreClient", "Credential Changed. Current user: " + t.uid),
|
|
@@ -9910,7 +9863,7 @@ var or = /** @class */ function() {
|
|
|
9910
9863
|
},
|
|
9911
9864
|
/** Disables the network connection. Pending operations will not complete. */ t.prototype.disableNetwork = function() {
|
|
9912
9865
|
var t = this;
|
|
9913
|
-
return this.
|
|
9866
|
+
return this.G_(), this.Ar.enqueue((function() {
|
|
9914
9867
|
return t.Mu.disableNetwork();
|
|
9915
9868
|
}));
|
|
9916
9869
|
}, t.prototype.terminate = function() {
|
|
@@ -9948,37 +9901,37 @@ var or = /** @class */ function() {
|
|
|
9948
9901
|
*/
|
|
9949
9902
|
t.prototype.waitForPendingWrites = function() {
|
|
9950
9903
|
var t = this;
|
|
9951
|
-
this.
|
|
9952
|
-
var e = new
|
|
9904
|
+
this.G_();
|
|
9905
|
+
var e = new Oe;
|
|
9953
9906
|
return this.Ar.Cr((function() {
|
|
9954
9907
|
return t.Mu.fl(e);
|
|
9955
9908
|
})), e.promise;
|
|
9956
9909
|
}, t.prototype.listen = function(t, e, n) {
|
|
9957
9910
|
var r = this;
|
|
9958
|
-
this.
|
|
9911
|
+
this.G_();
|
|
9959
9912
|
var i = new $n(t, e, n);
|
|
9960
9913
|
return this.Ar.Cr((function() {
|
|
9961
|
-
return r.
|
|
9914
|
+
return r.J_.listen(i);
|
|
9962
9915
|
})), i;
|
|
9963
9916
|
}, t.prototype.$u = function(t) {
|
|
9964
9917
|
var e = this;
|
|
9965
9918
|
// Checks for termination but does not raise error, allowing unlisten after
|
|
9966
9919
|
// termination to be a no-op.
|
|
9967
|
-
this.
|
|
9968
|
-
return e.
|
|
9920
|
+
this.X_ || this.Ar.Cr((function() {
|
|
9921
|
+
return e.J_.$u(t);
|
|
9969
9922
|
}));
|
|
9970
|
-
}, t.prototype.
|
|
9923
|
+
}, t.prototype.Z_ = function(t) {
|
|
9971
9924
|
var e = this;
|
|
9972
|
-
return this.
|
|
9925
|
+
return this.G_(), this.Ar.enqueue((function() {
|
|
9973
9926
|
return e._u.ro(t);
|
|
9974
9927
|
})).then((function(t) {
|
|
9975
9928
|
if (t instanceof vt) return t;
|
|
9976
9929
|
if (t instanceof mt) return null;
|
|
9977
9930
|
throw new c(h.UNAVAILABLE, "Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)");
|
|
9978
9931
|
}));
|
|
9979
|
-
}, t.prototype.
|
|
9932
|
+
}, t.prototype.td = function(t) {
|
|
9980
9933
|
var n = this;
|
|
9981
|
-
return this.
|
|
9934
|
+
return this.G_(), this.Ar.enqueue((function() {
|
|
9982
9935
|
return e.__awaiter(n, void 0, void 0, (function() {
|
|
9983
9936
|
var n, r, i;
|
|
9984
9937
|
return e.__generator(this, (function(e) {
|
|
@@ -9996,23 +9949,23 @@ var or = /** @class */ function() {
|
|
|
9996
9949
|
}));
|
|
9997
9950
|
}, t.prototype.write = function(t) {
|
|
9998
9951
|
var e = this;
|
|
9999
|
-
this.
|
|
10000
|
-
var n = new
|
|
9952
|
+
this.G_();
|
|
9953
|
+
var n = new Oe;
|
|
10001
9954
|
return this.Ar.Cr((function() {
|
|
10002
9955
|
return e.Mu.write(t, n);
|
|
10003
9956
|
})), n.promise;
|
|
10004
9957
|
}, t.prototype.ci = function() {
|
|
10005
|
-
return this.
|
|
9958
|
+
return this.j_.ci;
|
|
10006
9959
|
}, t.prototype.Fl = function(t) {
|
|
10007
9960
|
var e = this;
|
|
10008
|
-
this.
|
|
10009
|
-
return e.
|
|
9961
|
+
this.G_(), this.Ar.Cr((function() {
|
|
9962
|
+
return e.J_.Fl(t), Promise.resolve();
|
|
10010
9963
|
}));
|
|
10011
9964
|
}, t.prototype.Nl = function(t) {
|
|
10012
9965
|
// Checks for shutdown but does not raise error, allowing remove after
|
|
10013
9966
|
// shutdown to be a no-op.
|
|
10014
|
-
this.
|
|
10015
|
-
}, Object.defineProperty(t.prototype, "
|
|
9967
|
+
this.X_ || this.J_.Nl(t);
|
|
9968
|
+
}, Object.defineProperty(t.prototype, "X_", {
|
|
10016
9969
|
get: function() {
|
|
10017
9970
|
// Technically, the asyncQueue is still running, but only accepting operations
|
|
10018
9971
|
// related to termination or supposed to be run after termination. It is effectively
|
|
@@ -10023,13 +9976,13 @@ var or = /** @class */ function() {
|
|
|
10023
9976
|
configurable: !0
|
|
10024
9977
|
}), t.prototype.transaction = function(t) {
|
|
10025
9978
|
var e = this;
|
|
10026
|
-
this.
|
|
10027
|
-
var n = new
|
|
9979
|
+
this.G_();
|
|
9980
|
+
var n = new Oe;
|
|
10028
9981
|
return this.Ar.Cr((function() {
|
|
10029
9982
|
return e.Mu.runTransaction(e.Ar, t, n), Promise.resolve();
|
|
10030
9983
|
})), n.promise;
|
|
10031
9984
|
}, t;
|
|
10032
|
-
}(),
|
|
9985
|
+
}(), lr = /** @class */ function() {
|
|
10033
9986
|
function t(t) {
|
|
10034
9987
|
this.observer = t,
|
|
10035
9988
|
/**
|
|
@@ -10039,12 +9992,12 @@ var or = /** @class */ function() {
|
|
|
10039
9992
|
this.muted = !1;
|
|
10040
9993
|
}
|
|
10041
9994
|
return t.prototype.next = function(t) {
|
|
10042
|
-
this.
|
|
9995
|
+
this.ed(this.observer.next, t);
|
|
10043
9996
|
}, t.prototype.error = function(t) {
|
|
10044
|
-
this.
|
|
10045
|
-
}, t.prototype.
|
|
9997
|
+
this.ed(this.observer.error, t);
|
|
9998
|
+
}, t.prototype.sd = function() {
|
|
10046
9999
|
this.muted = !0;
|
|
10047
|
-
}, t.prototype.
|
|
10000
|
+
}, t.prototype.ed = function(t, e) {
|
|
10048
10001
|
var n = this;
|
|
10049
10002
|
this.muted || setTimeout((function() {
|
|
10050
10003
|
n.muted || t(e);
|
|
@@ -10088,7 +10041,7 @@ var or = /** @class */ function() {
|
|
|
10088
10041
|
* See the License for the specific language governing permissions and
|
|
10089
10042
|
* limitations under the License.
|
|
10090
10043
|
*/
|
|
10091
|
-
function
|
|
10044
|
+
function pr(t) {
|
|
10092
10045
|
/**
|
|
10093
10046
|
* Returns true if obj is an object and contains at least one of the specified
|
|
10094
10047
|
* methods.
|
|
@@ -10103,12 +10056,12 @@ function lr(t) {
|
|
|
10103
10056
|
}(t);
|
|
10104
10057
|
}
|
|
10105
10058
|
|
|
10106
|
-
var
|
|
10059
|
+
var dr = /** @class */ function() {
|
|
10107
10060
|
function t(t, e, n, r) {
|
|
10108
|
-
this.firestore = t, this.timestampsInSnapshots = e, this.
|
|
10061
|
+
this.firestore = t, this.timestampsInSnapshots = e, this.nd = n, this.converter = r;
|
|
10109
10062
|
}
|
|
10110
|
-
return t.prototype.
|
|
10111
|
-
switch (
|
|
10063
|
+
return t.prototype.rd = function(t) {
|
|
10064
|
+
switch (q(t)) {
|
|
10112
10065
|
case 0 /* NullValue */ :
|
|
10113
10066
|
return null;
|
|
10114
10067
|
|
|
@@ -10116,73 +10069,73 @@ var pr = /** @class */ function() {
|
|
|
10116
10069
|
return t.booleanValue;
|
|
10117
10070
|
|
|
10118
10071
|
case 2 /* NumberValue */ :
|
|
10119
|
-
return
|
|
10072
|
+
return B(t.integerValue || t.doubleValue);
|
|
10120
10073
|
|
|
10121
10074
|
case 3 /* TimestampValue */ :
|
|
10122
|
-
return this.
|
|
10075
|
+
return this.hd(t.timestampValue);
|
|
10123
10076
|
|
|
10124
10077
|
case 4 /* ServerTimestampValue */ :
|
|
10125
|
-
return this.
|
|
10078
|
+
return this.od(t);
|
|
10126
10079
|
|
|
10127
10080
|
case 5 /* StringValue */ :
|
|
10128
10081
|
return t.stringValue;
|
|
10129
10082
|
|
|
10130
10083
|
case 6 /* BlobValue */ :
|
|
10131
|
-
return new hn(
|
|
10084
|
+
return new hn(z(t.bytesValue));
|
|
10132
10085
|
|
|
10133
10086
|
case 7 /* RefValue */ :
|
|
10134
|
-
return this.
|
|
10087
|
+
return this.ad(t.referenceValue);
|
|
10135
10088
|
|
|
10136
10089
|
case 8 /* GeoPointValue */ :
|
|
10137
10090
|
return new _n(t.geoPointValue.latitude, t.geoPointValue.longitude);
|
|
10138
10091
|
|
|
10139
10092
|
case 9 /* ArrayValue */ :
|
|
10140
|
-
return this.
|
|
10093
|
+
return this.ud(t.arrayValue);
|
|
10141
10094
|
|
|
10142
10095
|
case 10 /* ObjectValue */ :
|
|
10143
|
-
return this.
|
|
10096
|
+
return this.ld(t.mapValue);
|
|
10144
10097
|
|
|
10145
10098
|
default:
|
|
10146
10099
|
throw we("Invalid value type: " + JSON.stringify(t));
|
|
10147
10100
|
}
|
|
10148
|
-
}, t.prototype.
|
|
10101
|
+
}, t.prototype.ld = function(t) {
|
|
10149
10102
|
var e = this, n = {};
|
|
10150
10103
|
return R(t.fields || {}, (function(t, r) {
|
|
10151
|
-
n[t] = e.
|
|
10104
|
+
n[t] = e.rd(r);
|
|
10152
10105
|
})), n;
|
|
10153
|
-
}, t.prototype.
|
|
10106
|
+
}, t.prototype.ud = function(t) {
|
|
10154
10107
|
var e = this;
|
|
10155
10108
|
return (t.values || []).map((function(t) {
|
|
10156
|
-
return e.
|
|
10109
|
+
return e.rd(t);
|
|
10157
10110
|
}));
|
|
10158
|
-
}, t.prototype.
|
|
10159
|
-
switch (this.
|
|
10111
|
+
}, t.prototype.od = function(t) {
|
|
10112
|
+
switch (this.nd) {
|
|
10160
10113
|
case "previous":
|
|
10161
10114
|
var e = function t(e) {
|
|
10162
10115
|
var n = e.mapValue.fields.__previous_value__;
|
|
10163
|
-
return
|
|
10116
|
+
return C(n) ? t(n) : n;
|
|
10164
10117
|
}(t);
|
|
10165
|
-
return null == e ? null : this.
|
|
10118
|
+
return null == e ? null : this.rd(e);
|
|
10166
10119
|
|
|
10167
10120
|
case "estimate":
|
|
10168
|
-
return this.
|
|
10121
|
+
return this.hd(O(t));
|
|
10169
10122
|
|
|
10170
10123
|
default:
|
|
10171
10124
|
return null;
|
|
10172
10125
|
}
|
|
10173
|
-
}, t.prototype.
|
|
10174
|
-
var e =
|
|
10126
|
+
}, t.prototype.hd = function(t) {
|
|
10127
|
+
var e = Q(t), n = new v(e.seconds, e.nanos);
|
|
10175
10128
|
return this.timestampsInSnapshots ? n : n.toDate();
|
|
10176
|
-
}, t.prototype.
|
|
10129
|
+
}, t.prototype.ad = function(t) {
|
|
10177
10130
|
var e = w.K(t);
|
|
10178
10131
|
_e(fe(e), "ReferenceValue is not valid " + t);
|
|
10179
10132
|
var n = new Ie(e.get(1), e.get(3)), r = new b(e.$(5));
|
|
10180
|
-
return n.isEqual(this.firestore.
|
|
10133
|
+
return n.isEqual(this.firestore._d) ||
|
|
10181
10134
|
// TODO(b/64130202): Somehow support foreign references.
|
|
10182
|
-
me("Document " + r + " contains a document reference within a different database (" + n.projectId + "/" + n.database + ") which is not supported. It will be treated as a reference in the current database (" + this.firestore.
|
|
10183
|
-
new
|
|
10135
|
+
me("Document " + r + " contains a document reference within a different database (" + n.projectId + "/" + n.database + ") which is not supported. It will be treated as a reference in the current database (" + this.firestore._d.projectId + "/" + this.firestore._d.database + ") instead."),
|
|
10136
|
+
new _r(r, this.firestore, this.converter);
|
|
10184
10137
|
}, t;
|
|
10185
|
-
}(),
|
|
10138
|
+
}(), yr = Me.sh, vr = /** @class */ function() {
|
|
10186
10139
|
function t(t) {
|
|
10187
10140
|
var e, n;
|
|
10188
10141
|
if (void 0 === t.host) {
|
|
@@ -10197,8 +10150,8 @@ var pr = /** @class */ function() {
|
|
|
10197
10150
|
// whether they set it to true or false...
|
|
10198
10151
|
!0 === t.timestampsInSnapshots ? me("The setting 'timestampsInSnapshots: true' is no longer required and should be removed.") : !1 === t.timestampsInSnapshots && me("Support for 'timestampsInSnapshots: false' will be removed soon. You must update your code to handle Timestamp objects."),
|
|
10199
10152
|
this.timestampsInSnapshots = null === (n = t.timestampsInSnapshots) || void 0 === n || n,
|
|
10200
|
-
We("settings", "number", "cacheSizeBytes", t.cacheSizeBytes), void 0 === t.cacheSizeBytes) this.cacheSizeBytes =
|
|
10201
|
-
if (t.cacheSizeBytes !==
|
|
10153
|
+
We("settings", "number", "cacheSizeBytes", t.cacheSizeBytes), void 0 === t.cacheSizeBytes) this.cacheSizeBytes = Me.nh; else {
|
|
10154
|
+
if (t.cacheSizeBytes !== yr && t.cacheSizeBytes < Me.ih) throw new c(h.INVALID_ARGUMENT, "cacheSizeBytes must be at least " + Me.ih);
|
|
10202
10155
|
this.cacheSizeBytes = t.cacheSizeBytes;
|
|
10203
10156
|
}
|
|
10204
10157
|
We("settings", "boolean", "experimentalForceLongPolling", t.experimentalForceLongPolling),
|
|
@@ -10207,16 +10160,16 @@ var pr = /** @class */ function() {
|
|
|
10207
10160
|
return t.prototype.isEqual = function(t) {
|
|
10208
10161
|
return this.host === t.host && this.ssl === t.ssl && this.timestampsInSnapshots === t.timestampsInSnapshots && this.credentials === t.credentials && this.cacheSizeBytes === t.cacheSizeBytes && this.forceLongPolling === t.forceLongPolling;
|
|
10209
10162
|
}, t;
|
|
10210
|
-
}(),
|
|
10163
|
+
}(), mr = /** @class */ function() {
|
|
10211
10164
|
// Note: We are using `MemoryComponentProvider` as a default
|
|
10212
10165
|
// ComponentProvider to ensure backwards compatibility with the format
|
|
10213
10166
|
// expected by the console build.
|
|
10214
10167
|
function t(n, r, i) {
|
|
10215
10168
|
var o = this;
|
|
10216
|
-
if (void 0 === i && (i = new
|
|
10169
|
+
if (void 0 === i && (i = new cr), this.dd = null,
|
|
10217
10170
|
// Public for use in tests.
|
|
10218
10171
|
// TODO(mikelehen): Use modularized initialization instead.
|
|
10219
|
-
this.
|
|
10172
|
+
this.fd = new qe, this.INTERNAL = {
|
|
10220
10173
|
delete: function() {
|
|
10221
10174
|
return e.__awaiter(o, void 0, void 0, (function() {
|
|
10222
10175
|
return e.__generator(this, (function(t) {
|
|
@@ -10224,7 +10177,7 @@ var pr = /** @class */ function() {
|
|
|
10224
10177
|
case 0:
|
|
10225
10178
|
// The client must be initalized to ensure that all subsequent API usage
|
|
10226
10179
|
// throws an exception.
|
|
10227
|
-
return this.
|
|
10180
|
+
return this.wd(), [ 4 /*yield*/ , this.Td.terminate() ];
|
|
10228
10181
|
|
|
10229
10182
|
case 1:
|
|
10230
10183
|
// The client must be initalized to ensure that all subsequent API usage
|
|
@@ -10238,63 +10191,63 @@ var pr = /** @class */ function() {
|
|
|
10238
10191
|
// This is very likely a Firebase app object
|
|
10239
10192
|
// TODO(b/34177605): Can we somehow use instanceof?
|
|
10240
10193
|
var s = n;
|
|
10241
|
-
this.
|
|
10194
|
+
this.dd = s, this._d = t.md(s), this.Ed = s.name, this.Rd = new p(r);
|
|
10242
10195
|
} else {
|
|
10243
10196
|
var u = n;
|
|
10244
10197
|
if (!u.projectId) throw new c(h.INVALID_ARGUMENT, "Must provide projectId");
|
|
10245
|
-
this.
|
|
10198
|
+
this._d = new Ie(u.projectId, u.database),
|
|
10246
10199
|
// Use a default persistenceKey that lines up with FirebaseApp.
|
|
10247
|
-
this.
|
|
10200
|
+
this.Ed = "[DEFAULT]", this.Rd = new l;
|
|
10248
10201
|
}
|
|
10249
|
-
this.
|
|
10202
|
+
this.Id = i, this.Ad = new vr({}), this.Pd = this.Vd(this._d);
|
|
10250
10203
|
}
|
|
10251
10204
|
return t.prototype.settings = function(t) {
|
|
10252
|
-
je("Firestore.settings", arguments, 1),
|
|
10253
|
-
var e = new
|
|
10254
|
-
if (this.
|
|
10255
|
-
this.
|
|
10205
|
+
je("Firestore.settings", arguments, 1), ze("Firestore.settings", "object", 1, t);
|
|
10206
|
+
var e = new vr(t);
|
|
10207
|
+
if (this.Td && !this.Ad.isEqual(e)) throw new c(h.FAILED_PRECONDITION, "Firestore has already been started and its settings can no longer be changed. You can only call settings() before calling any other methods on a Firestore object.");
|
|
10208
|
+
this.Ad = e, void 0 !== e.credentials && (this.Rd = function(t) {
|
|
10256
10209
|
if (!t) return new l;
|
|
10257
10210
|
switch (t.type) {
|
|
10258
10211
|
case "gapi":
|
|
10259
|
-
var e = t.
|
|
10212
|
+
var e = t.pd;
|
|
10260
10213
|
// Make sure this really is a Gapi client.
|
|
10261
10214
|
return _e(!("object" != typeof e || null === e || !e.auth || !e.auth.getAuthHeaderValueForFirstParty), "unexpected gapi interface"),
|
|
10262
10215
|
new y(e, t.V || "0");
|
|
10263
10216
|
|
|
10264
10217
|
case "provider":
|
|
10265
|
-
return t.
|
|
10218
|
+
return t.pd;
|
|
10266
10219
|
|
|
10267
10220
|
default:
|
|
10268
10221
|
throw new c(h.INVALID_ARGUMENT, "makeCredentialsProvider failed due to invalid credential type");
|
|
10269
10222
|
}
|
|
10270
10223
|
}(e.credentials));
|
|
10271
10224
|
}, t.prototype.enableNetwork = function() {
|
|
10272
|
-
return this.
|
|
10225
|
+
return this.wd(), this.Td.enableNetwork();
|
|
10273
10226
|
}, t.prototype.disableNetwork = function() {
|
|
10274
|
-
return this.
|
|
10227
|
+
return this.wd(), this.Td.disableNetwork();
|
|
10275
10228
|
}, t.prototype.enablePersistence = function(t) {
|
|
10276
10229
|
var e, n;
|
|
10277
|
-
if (this.
|
|
10230
|
+
if (this.Td) throw new c(h.FAILED_PRECONDITION, "Firestore has already been started and persistence can no longer be enabled. You can only call enablePersistence() before calling any other methods on a Firestore object.");
|
|
10278
10231
|
var r = !1;
|
|
10279
10232
|
return t && (void 0 !== t.experimentalTabSynchronization && me("The 'experimentalTabSynchronization' setting will be removed. Use 'synchronizeTabs' instead."),
|
|
10280
10233
|
r = null !== (n = null !== (e = t.synchronizeTabs) && void 0 !== e ? e : t.experimentalTabSynchronization) && void 0 !== n && n),
|
|
10281
|
-
this.
|
|
10282
|
-
|
|
10283
|
-
cacheSizeBytes: this.
|
|
10234
|
+
this.gd(this.Id, {
|
|
10235
|
+
B_: !0,
|
|
10236
|
+
cacheSizeBytes: this.Ad.cacheSizeBytes,
|
|
10284
10237
|
synchronizeTabs: r
|
|
10285
10238
|
});
|
|
10286
10239
|
}, t.prototype.clearPersistence = function() {
|
|
10287
10240
|
return e.__awaiter(this, void 0, void 0, (function() {
|
|
10288
10241
|
var t, n = this;
|
|
10289
10242
|
return e.__generator(this, (function(r) {
|
|
10290
|
-
if (void 0 !== this.
|
|
10291
|
-
return t = new
|
|
10243
|
+
if (void 0 !== this.Td && !this.Td.X_) throw new c(h.FAILED_PRECONDITION, "Persistence cannot be cleared after this Firestore instance is initialized.");
|
|
10244
|
+
return t = new Oe, [ 2 /*return*/ , (this.fd.Mr((function() {
|
|
10292
10245
|
return e.__awaiter(n, void 0, void 0, (function() {
|
|
10293
10246
|
var n, r;
|
|
10294
10247
|
return e.__generator(this, (function(e) {
|
|
10295
10248
|
switch (e.label) {
|
|
10296
10249
|
case 0:
|
|
10297
|
-
return e.trys.push([ 0, 2, , 3 ]), n = this.
|
|
10250
|
+
return e.trys.push([ 0, 2, , 3 ]), n = this.yd(), [ 4 /*yield*/ , this.Id.clearPersistence(n) ];
|
|
10298
10251
|
|
|
10299
10252
|
case 1:
|
|
10300
10253
|
return e.sent(), t.resolve(), [ 3 /*break*/ , 3 ];
|
|
@@ -10312,23 +10265,23 @@ var pr = /** @class */ function() {
|
|
|
10312
10265
|
}));
|
|
10313
10266
|
}, t.prototype.terminate = function() {
|
|
10314
10267
|
return this.app._removeServiceInstance("firestore"), this.INTERNAL.delete();
|
|
10315
|
-
}, Object.defineProperty(t.prototype, "
|
|
10268
|
+
}, Object.defineProperty(t.prototype, "bd", {
|
|
10316
10269
|
get: function() {
|
|
10317
|
-
return this.
|
|
10270
|
+
return this.wd(), this.Td.X_;
|
|
10318
10271
|
},
|
|
10319
10272
|
enumerable: !0,
|
|
10320
10273
|
configurable: !0
|
|
10321
10274
|
}), t.prototype.waitForPendingWrites = function() {
|
|
10322
|
-
return this.
|
|
10275
|
+
return this.wd(), this.Td.waitForPendingWrites();
|
|
10323
10276
|
}, t.prototype.onSnapshotsInSync = function(t) {
|
|
10324
|
-
if (this.
|
|
10325
|
-
|
|
10277
|
+
if (this.wd(), pr(t)) return this.vd(t);
|
|
10278
|
+
ze("Firestore.onSnapshotsInSync", "function", 1, t);
|
|
10326
10279
|
var e = {
|
|
10327
10280
|
next: t
|
|
10328
10281
|
};
|
|
10329
|
-
return this
|
|
10330
|
-
}, t.prototype
|
|
10331
|
-
var e = this, n = new
|
|
10282
|
+
return this.vd(e);
|
|
10283
|
+
}, t.prototype.vd = function(t) {
|
|
10284
|
+
var e = this, n = new lr({
|
|
10332
10285
|
next: function() {
|
|
10333
10286
|
t.next && t.next();
|
|
10334
10287
|
},
|
|
@@ -10336,34 +10289,34 @@ var pr = /** @class */ function() {
|
|
|
10336
10289
|
throw we("Uncaught Error in onSnapshotsInSync");
|
|
10337
10290
|
}
|
|
10338
10291
|
});
|
|
10339
|
-
return this.
|
|
10340
|
-
n.
|
|
10292
|
+
return this.Td.Fl(n), function() {
|
|
10293
|
+
n.sd(), e.Td.Nl(n);
|
|
10341
10294
|
};
|
|
10342
|
-
}, t.prototype.
|
|
10343
|
-
return this.
|
|
10295
|
+
}, t.prototype.wd = function() {
|
|
10296
|
+
return this.Td ||
|
|
10344
10297
|
// Kick off starting the client but don't actually wait for it.
|
|
10345
10298
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
10346
|
-
this.
|
|
10347
|
-
|
|
10348
|
-
}), this.
|
|
10349
|
-
}, t.prototype.
|
|
10350
|
-
return new Ne(this.
|
|
10351
|
-
}, t.prototype.
|
|
10352
|
-
var n = this.
|
|
10353
|
-
return this.
|
|
10354
|
-
}, t.prototype.
|
|
10299
|
+
this.gd(new cr, {
|
|
10300
|
+
B_: !1
|
|
10301
|
+
}), this.Td;
|
|
10302
|
+
}, t.prototype.yd = function() {
|
|
10303
|
+
return new Ne(this._d, this.Ed, this.Ad.host, this.Ad.ssl, this.Ad.forceLongPolling);
|
|
10304
|
+
}, t.prototype.gd = function(t, e) {
|
|
10305
|
+
var n = this.yd();
|
|
10306
|
+
return this.Td = new fr(le.Ot(), n, this.Rd, this.fd), this.Td.start(t, e);
|
|
10307
|
+
}, t.prototype.Vd = function(t) {
|
|
10355
10308
|
var e = new ce(t, {
|
|
10356
10309
|
di: le.Ot().di
|
|
10357
10310
|
});
|
|
10358
10311
|
return new kn(e, (function(e) {
|
|
10359
|
-
if (e instanceof
|
|
10360
|
-
var n = t, r = e.firestore.
|
|
10312
|
+
if (e instanceof _r) {
|
|
10313
|
+
var n = t, r = e.firestore._d;
|
|
10361
10314
|
if (!r.isEqual(n)) throw new c(h.INVALID_ARGUMENT, "Document reference is for database " + r.projectId + "/" + r.database + " but should be for database " + n.projectId + "/" + n.database);
|
|
10362
|
-
return new Tn(t, e.
|
|
10315
|
+
return new Tn(t, e.Sd);
|
|
10363
10316
|
}
|
|
10364
10317
|
return e;
|
|
10365
10318
|
}));
|
|
10366
|
-
}, t.
|
|
10319
|
+
}, t.md = function(t) {
|
|
10367
10320
|
if (e = t.options, "projectId", !Object.prototype.hasOwnProperty.call(e, "projectId")) throw new c(h.INVALID_ARGUMENT, '"projectId" not provided in firebase.initializeApp.');
|
|
10368
10321
|
var e, n = t.options.projectId;
|
|
10369
10322
|
// Export the classes with a private constructor (it will fail if invoked
|
|
@@ -10374,29 +10327,29 @@ var pr = /** @class */ function() {
|
|
|
10374
10327
|
return new Ie(n);
|
|
10375
10328
|
}, Object.defineProperty(t.prototype, "app", {
|
|
10376
10329
|
get: function() {
|
|
10377
|
-
if (!this.
|
|
10378
|
-
return this.
|
|
10330
|
+
if (!this.dd) throw new c(h.FAILED_PRECONDITION, "Firestore was not initialized using the Firebase SDK. 'app' is not available");
|
|
10331
|
+
return this.dd;
|
|
10379
10332
|
},
|
|
10380
10333
|
enumerable: !0,
|
|
10381
10334
|
configurable: !0
|
|
10382
10335
|
}), t.prototype.collection = function(t) {
|
|
10383
|
-
return je("Firestore.collection", arguments, 1),
|
|
10384
|
-
this.
|
|
10336
|
+
return je("Firestore.collection", arguments, 1), ze("Firestore.collection", "non-empty string", 1, t),
|
|
10337
|
+
this.wd(), new Tr(w.K(t), this);
|
|
10385
10338
|
}, t.prototype.doc = function(t) {
|
|
10386
|
-
return je("Firestore.doc", arguments, 1),
|
|
10387
|
-
this.
|
|
10339
|
+
return je("Firestore.doc", arguments, 1), ze("Firestore.doc", "non-empty string", 1, t),
|
|
10340
|
+
this.wd(), _r.Cd(w.K(t), this);
|
|
10388
10341
|
}, t.prototype.collectionGroup = function(t) {
|
|
10389
|
-
if (je("Firestore.collectionGroup", arguments, 1),
|
|
10342
|
+
if (je("Firestore.collectionGroup", arguments, 1), ze("Firestore.collectionGroup", "non-empty string", 1, t),
|
|
10390
10343
|
t.indexOf("/") >= 0) throw new c(h.INVALID_ARGUMENT, "Invalid collection ID '" + t + "' passed to function Firestore.collectionGroup(). Collection IDs must not contain '/'.");
|
|
10391
|
-
return this.
|
|
10344
|
+
return this.wd(), new Nr(new _t(w.H, t), this);
|
|
10392
10345
|
}, t.prototype.runTransaction = function(t) {
|
|
10393
10346
|
var e = this;
|
|
10394
|
-
return je("Firestore.runTransaction", arguments, 1),
|
|
10395
|
-
this.
|
|
10396
|
-
return t(new
|
|
10347
|
+
return je("Firestore.runTransaction", arguments, 1), ze("Firestore.runTransaction", "function", 1, t),
|
|
10348
|
+
this.wd().transaction((function(n) {
|
|
10349
|
+
return t(new gr(e, n));
|
|
10397
10350
|
}));
|
|
10398
10351
|
}, t.prototype.batch = function() {
|
|
10399
|
-
return this.
|
|
10352
|
+
return this.wd(), new wr(this);
|
|
10400
10353
|
}, Object.defineProperty(t, "logLevel", {
|
|
10401
10354
|
get: function() {
|
|
10402
10355
|
switch (de()) {
|
|
@@ -10414,7 +10367,7 @@ var pr = /** @class */ function() {
|
|
|
10414
10367
|
enumerable: !0,
|
|
10415
10368
|
configurable: !0
|
|
10416
10369
|
}), t.setLogLevel = function(t) {
|
|
10417
|
-
switch (je("Firestore.setLogLevel", arguments, 1),
|
|
10370
|
+
switch (je("Firestore.setLogLevel", arguments, 1), ze("Firestore.setLogLevel", "non-empty string", 1, t),
|
|
10418
10371
|
t) {
|
|
10419
10372
|
case "debug":
|
|
10420
10373
|
ye(r.LogLevel.DEBUG);
|
|
@@ -10434,161 +10387,161 @@ var pr = /** @class */ function() {
|
|
|
10434
10387
|
},
|
|
10435
10388
|
// Note: this is not a property because the minifier can't work correctly with
|
|
10436
10389
|
// the way TypeScript compiler outputs properties.
|
|
10437
|
-
t.prototype.
|
|
10438
|
-
return this.
|
|
10390
|
+
t.prototype.Dd = function() {
|
|
10391
|
+
return this.Ad.timestampsInSnapshots;
|
|
10439
10392
|
}, t;
|
|
10440
|
-
}(),
|
|
10393
|
+
}(), gr = /** @class */ function() {
|
|
10441
10394
|
function t(t, e) {
|
|
10442
|
-
this.
|
|
10395
|
+
this.Fd = t, this.Nd = e;
|
|
10443
10396
|
}
|
|
10444
10397
|
return t.prototype.get = function(t) {
|
|
10445
10398
|
var e = this;
|
|
10446
10399
|
je("Transaction.get", arguments, 1);
|
|
10447
|
-
var n =
|
|
10448
|
-
return this.
|
|
10400
|
+
var n = Lr("Transaction.get", t, this.Fd);
|
|
10401
|
+
return this.Nd.za([ n.Sd ]).then((function(t) {
|
|
10449
10402
|
if (!t || 1 !== t.length) return we("Mismatch in docs returned from document lookup.");
|
|
10450
10403
|
var r = t[0];
|
|
10451
|
-
if (r instanceof mt) return new
|
|
10404
|
+
if (r instanceof mt) return new br(e.Fd, n.Sd, null,
|
|
10452
10405
|
/* fromCache= */ !1,
|
|
10453
|
-
/* hasPendingWrites= */ !1, n.
|
|
10454
|
-
if (r instanceof vt) return new
|
|
10406
|
+
/* hasPendingWrites= */ !1, n.kd);
|
|
10407
|
+
if (r instanceof vt) return new br(e.Fd, n.Sd, r,
|
|
10455
10408
|
/* fromCache= */ !1,
|
|
10456
|
-
/* hasPendingWrites= */ !1, n.
|
|
10409
|
+
/* hasPendingWrites= */ !1, n.kd);
|
|
10457
10410
|
throw we("BatchGetDocumentsRequest returned unexpected document type: " + r.constructor.name);
|
|
10458
10411
|
}));
|
|
10459
10412
|
}, t.prototype.set = function(t, e, n) {
|
|
10460
|
-
|
|
10461
|
-
var r =
|
|
10462
|
-
n =
|
|
10463
|
-
var i =
|
|
10464
|
-
return this.
|
|
10413
|
+
Be("Transaction.set", arguments, 2, 3);
|
|
10414
|
+
var r = Lr("Transaction.set", t, this.Fd);
|
|
10415
|
+
n = kr("Transaction.set", n);
|
|
10416
|
+
var i = Vr(r.kd, e, "Transaction.set"), o = i[0], s = i[1], u = n.merge || n.mergeFields ? this.Fd.Pd.zo(s, o, n.mergeFields) : this.Fd.Pd.jo(s, o);
|
|
10417
|
+
return this.Nd.set(r.Sd, u), this;
|
|
10465
10418
|
}, t.prototype.update = function(t, e, n) {
|
|
10466
10419
|
for (var r, i, o = [], s = 3; s < arguments.length; s++) o[s - 3] = arguments[s];
|
|
10467
|
-
return "string" == typeof e || e instanceof fn ? (
|
|
10468
|
-
r =
|
|
10469
|
-
r =
|
|
10470
|
-
this.
|
|
10420
|
+
return "string" == typeof e || e instanceof fn ? (Qe("Transaction.update", arguments, 3),
|
|
10421
|
+
r = Lr("Transaction.update", t, this.Fd), i = this.Fd.Pd.Yo("Transaction.update", e, n, o)) : (je("Transaction.update", arguments, 2),
|
|
10422
|
+
r = Lr("Transaction.update", t, this.Fd), i = this.Fd.Pd.Ko("Transaction.update", e)),
|
|
10423
|
+
this.Nd.update(r.Sd, i), this;
|
|
10471
10424
|
}, t.prototype.delete = function(t) {
|
|
10472
10425
|
je("Transaction.delete", arguments, 1);
|
|
10473
|
-
var e =
|
|
10474
|
-
return this.
|
|
10426
|
+
var e = Lr("Transaction.delete", t, this.Fd);
|
|
10427
|
+
return this.Nd.delete(e.Sd), this;
|
|
10475
10428
|
}, t;
|
|
10476
|
-
}(),
|
|
10429
|
+
}(), wr = /** @class */ function() {
|
|
10477
10430
|
function t(t) {
|
|
10478
|
-
this.
|
|
10431
|
+
this.Fd = t, this.Ld = [], this.$d = !1;
|
|
10479
10432
|
}
|
|
10480
10433
|
return t.prototype.set = function(t, e, n) {
|
|
10481
|
-
|
|
10482
|
-
var r =
|
|
10483
|
-
n =
|
|
10484
|
-
var i =
|
|
10485
|
-
return this.
|
|
10434
|
+
Be("WriteBatch.set", arguments, 2, 3), this.Od();
|
|
10435
|
+
var r = Lr("WriteBatch.set", t, this.Fd);
|
|
10436
|
+
n = kr("WriteBatch.set", n);
|
|
10437
|
+
var i = Vr(r.kd, e, "WriteBatch.set"), o = i[0], s = i[1], u = n.merge || n.mergeFields ? this.Fd.Pd.zo(s, o, n.mergeFields) : this.Fd.Pd.jo(s, o);
|
|
10438
|
+
return this.Ld = this.Ld.concat(u.Lo(r.Sd, st.NONE)), this;
|
|
10486
10439
|
}, t.prototype.update = function(t, e, n) {
|
|
10487
10440
|
for (var r, i, o = [], s = 3; s < arguments.length; s++) o[s - 3] = arguments[s];
|
|
10488
|
-
return this.
|
|
10489
|
-
r =
|
|
10490
|
-
r =
|
|
10491
|
-
this.
|
|
10441
|
+
return this.Od(), "string" == typeof e || e instanceof fn ? (Qe("WriteBatch.update", arguments, 3),
|
|
10442
|
+
r = Lr("WriteBatch.update", t, this.Fd), i = this.Fd.Pd.Yo("WriteBatch.update", e, n, o)) : (je("WriteBatch.update", arguments, 2),
|
|
10443
|
+
r = Lr("WriteBatch.update", t, this.Fd), i = this.Fd.Pd.Ko("WriteBatch.update", e)),
|
|
10444
|
+
this.Ld = this.Ld.concat(i.Lo(r.Sd, st.exists(!0))), this;
|
|
10492
10445
|
}, t.prototype.delete = function(t) {
|
|
10493
|
-
je("WriteBatch.delete", arguments, 1), this.
|
|
10494
|
-
var e =
|
|
10495
|
-
return this.
|
|
10446
|
+
je("WriteBatch.delete", arguments, 1), this.Od();
|
|
10447
|
+
var e = Lr("WriteBatch.delete", t, this.Fd);
|
|
10448
|
+
return this.Ld = this.Ld.concat(new ft(e.Sd, st.NONE)), this;
|
|
10496
10449
|
}, t.prototype.commit = function() {
|
|
10497
|
-
return this.
|
|
10498
|
-
}, t.prototype.
|
|
10499
|
-
if (this
|
|
10450
|
+
return this.Od(), this.$d = !0, this.Ld.length > 0 ? this.Fd.wd().write(this.Ld) : Promise.resolve();
|
|
10451
|
+
}, t.prototype.Od = function() {
|
|
10452
|
+
if (this.$d) throw new c(h.FAILED_PRECONDITION, "A write batch can no longer be used after commit() has been called.");
|
|
10500
10453
|
}, t;
|
|
10501
|
-
}(),
|
|
10454
|
+
}(), _r = /** @class */ function() {
|
|
10502
10455
|
function t(t, e, n) {
|
|
10503
|
-
this.
|
|
10456
|
+
this.Sd = t, this.firestore = e, this.kd = n, this.Td = this.firestore.wd();
|
|
10504
10457
|
}
|
|
10505
|
-
return t.
|
|
10458
|
+
return t.Cd = function(e, n, r) {
|
|
10506
10459
|
if (e.length % 2 != 0) throw new c(h.INVALID_ARGUMENT, "Invalid document reference. Document references must have an even number of segments, but " + e.G() + " has " + e.length);
|
|
10507
10460
|
return new t(new b(e), n, r);
|
|
10508
10461
|
}, Object.defineProperty(t.prototype, "id", {
|
|
10509
10462
|
get: function() {
|
|
10510
|
-
return this.
|
|
10463
|
+
return this.Sd.path.U();
|
|
10511
10464
|
},
|
|
10512
10465
|
enumerable: !0,
|
|
10513
10466
|
configurable: !0
|
|
10514
10467
|
}), Object.defineProperty(t.prototype, "parent", {
|
|
10515
10468
|
get: function() {
|
|
10516
|
-
return new
|
|
10469
|
+
return new Tr(this.Sd.path.O(), this.firestore, this.kd);
|
|
10517
10470
|
},
|
|
10518
10471
|
enumerable: !0,
|
|
10519
10472
|
configurable: !0
|
|
10520
10473
|
}), Object.defineProperty(t.prototype, "path", {
|
|
10521
10474
|
get: function() {
|
|
10522
|
-
return this.
|
|
10475
|
+
return this.Sd.path.G();
|
|
10523
10476
|
},
|
|
10524
10477
|
enumerable: !0,
|
|
10525
10478
|
configurable: !0
|
|
10526
10479
|
}), t.prototype.collection = function(t) {
|
|
10527
|
-
if (je("DocumentReference.collection", arguments, 1),
|
|
10480
|
+
if (je("DocumentReference.collection", arguments, 1), ze("DocumentReference.collection", "non-empty string", 1, t),
|
|
10528
10481
|
!t) throw new c(h.INVALID_ARGUMENT, "Must provide a non-empty collection name to collection()");
|
|
10529
10482
|
var e = w.K(t);
|
|
10530
|
-
return new
|
|
10483
|
+
return new Tr(this.Sd.path.child(e), this.firestore);
|
|
10531
10484
|
}, t.prototype.isEqual = function(e) {
|
|
10532
10485
|
if (!(e instanceof t)) throw en("isEqual", "DocumentReference", 1, e);
|
|
10533
|
-
return this.firestore === e.firestore && this.
|
|
10486
|
+
return this.firestore === e.firestore && this.Sd.isEqual(e.Sd) && this.kd === e.kd;
|
|
10534
10487
|
}, t.prototype.set = function(t, e) {
|
|
10535
|
-
|
|
10536
|
-
var n =
|
|
10537
|
-
return this.
|
|
10488
|
+
Be("DocumentReference.set", arguments, 1, 2), e = kr("DocumentReference.set", e);
|
|
10489
|
+
var n = Vr(this.kd, t, "DocumentReference.set"), r = n[0], i = n[1], o = e.merge || e.mergeFields ? this.firestore.Pd.zo(i, r, e.mergeFields) : this.firestore.Pd.jo(i, r);
|
|
10490
|
+
return this.Td.write(o.Lo(this.Sd, st.NONE));
|
|
10538
10491
|
}, t.prototype.update = function(t, e) {
|
|
10539
10492
|
for (var n, r = [], i = 2; i < arguments.length; i++) r[i - 2] = arguments[i];
|
|
10540
|
-
return "string" == typeof t || t instanceof fn ? (
|
|
10541
|
-
n = this.firestore.
|
|
10542
|
-
n = this.firestore.
|
|
10493
|
+
return "string" == typeof t || t instanceof fn ? (Qe("DocumentReference.update", arguments, 2),
|
|
10494
|
+
n = this.firestore.Pd.Yo("DocumentReference.update", t, e, r)) : (je("DocumentReference.update", arguments, 1),
|
|
10495
|
+
n = this.firestore.Pd.Ko("DocumentReference.update", t)), this.Td.write(n.Lo(this.Sd, st.exists(!0)));
|
|
10543
10496
|
}, t.prototype.delete = function() {
|
|
10544
|
-
return je("DocumentReference.delete", arguments, 0), this.
|
|
10497
|
+
return je("DocumentReference.delete", arguments, 0), this.Td.write([ new ft(this.Sd, st.NONE) ]);
|
|
10545
10498
|
}, t.prototype.onSnapshot = function() {
|
|
10546
10499
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
10547
|
-
|
|
10500
|
+
Be("DocumentReference.onSnapshot", arguments, 1, 4);
|
|
10548
10501
|
var n, r = {
|
|
10549
10502
|
includeMetadataChanges: !1
|
|
10550
10503
|
}, i = 0;
|
|
10551
|
-
"object" != typeof t[i] ||
|
|
10504
|
+
"object" != typeof t[i] || pr(t[i]) || (tn("DocumentReference.onSnapshot", r = t[i], [ "includeMetadataChanges" ]),
|
|
10552
10505
|
We("DocumentReference.onSnapshot", "boolean", "includeMetadataChanges", r.includeMetadataChanges),
|
|
10553
10506
|
i++);
|
|
10554
10507
|
var o = {
|
|
10555
10508
|
includeMetadataChanges: r.includeMetadataChanges
|
|
10556
10509
|
};
|
|
10557
|
-
return
|
|
10510
|
+
return pr(t[i]) ? n = t[i] : (ze("DocumentReference.onSnapshot", "function", i, t[i]),
|
|
10558
10511
|
He("DocumentReference.onSnapshot", "function", i + 1, t[i + 1]), He("DocumentReference.onSnapshot", "function", i + 2, t[i + 2]),
|
|
10559
10512
|
n = {
|
|
10560
10513
|
next: t[i],
|
|
10561
10514
|
error: t[i + 1],
|
|
10562
10515
|
complete: t[i + 2]
|
|
10563
|
-
}), this.
|
|
10564
|
-
}, t.prototype.
|
|
10516
|
+
}), this.Md(o, n);
|
|
10517
|
+
}, t.prototype.Md = function(t, e) {
|
|
10565
10518
|
var n = this, r = function(t) {
|
|
10566
10519
|
console.error("Uncaught Error in onSnapshot:", t);
|
|
10567
10520
|
};
|
|
10568
10521
|
e.error && (r = e.error.bind(e));
|
|
10569
|
-
var i = new
|
|
10522
|
+
var i = new lr({
|
|
10570
10523
|
next: function(t) {
|
|
10571
10524
|
if (e.next) {
|
|
10572
|
-
var r = t.docs.get(n.
|
|
10573
|
-
e.next(new
|
|
10525
|
+
var r = t.docs.get(n.Sd);
|
|
10526
|
+
e.next(new br(n.firestore, n.Sd, r, t.fromCache, t.hasPendingWrites, n.kd));
|
|
10574
10527
|
}
|
|
10575
10528
|
},
|
|
10576
10529
|
error: r
|
|
10577
|
-
}), o = this.
|
|
10530
|
+
}), o = this.Td.listen(_t.ve(this.Sd.path), i, t);
|
|
10578
10531
|
return function() {
|
|
10579
|
-
i.
|
|
10532
|
+
i.sd(), n.Td.$u(o);
|
|
10580
10533
|
};
|
|
10581
10534
|
}, t.prototype.get = function(t) {
|
|
10582
10535
|
var e = this;
|
|
10583
|
-
return
|
|
10536
|
+
return Be("DocumentReference.get", arguments, 0, 1), Rr("DocumentReference.get", t),
|
|
10584
10537
|
new Promise((function(n, r) {
|
|
10585
|
-
t && "cache" === t.source ? e.firestore.
|
|
10586
|
-
n(new
|
|
10587
|
-
/*fromCache=*/ !0, t instanceof vt && t.te, e.
|
|
10588
|
-
}), r) : e.
|
|
10538
|
+
t && "cache" === t.source ? e.firestore.wd().Z_(e.Sd).then((function(t) {
|
|
10539
|
+
n(new br(e.firestore, e.Sd, t,
|
|
10540
|
+
/*fromCache=*/ !0, t instanceof vt && t.te, e.kd));
|
|
10541
|
+
}), r) : e.Ud(n, r, t);
|
|
10589
10542
|
}));
|
|
10590
|
-
}, t.prototype.
|
|
10591
|
-
var r = this.
|
|
10543
|
+
}, t.prototype.Ud = function(t, e, n) {
|
|
10544
|
+
var r = this.Md({
|
|
10592
10545
|
includeMetadataChanges: !0,
|
|
10593
10546
|
ql: !0
|
|
10594
10547
|
}, {
|
|
@@ -10608,159 +10561,159 @@ var pr = /** @class */ function() {
|
|
|
10608
10561
|
error: e
|
|
10609
10562
|
});
|
|
10610
10563
|
}, t.prototype.withConverter = function(e) {
|
|
10611
|
-
return new t(this.
|
|
10564
|
+
return new t(this.Sd, this.firestore, e);
|
|
10612
10565
|
}, t;
|
|
10613
|
-
}(),
|
|
10566
|
+
}(), Er = /** @class */ function() {
|
|
10614
10567
|
function t(t, e) {
|
|
10615
10568
|
this.hasPendingWrites = t, this.fromCache = e;
|
|
10616
10569
|
}
|
|
10617
10570
|
return t.prototype.isEqual = function(t) {
|
|
10618
10571
|
return this.hasPendingWrites === t.hasPendingWrites && this.fromCache === t.fromCache;
|
|
10619
10572
|
}, t;
|
|
10620
|
-
}(),
|
|
10573
|
+
}(), br = /** @class */ function() {
|
|
10621
10574
|
function t(t, e, n, r, i, o) {
|
|
10622
|
-
this.
|
|
10575
|
+
this.Fd = t, this.Sd = e, this.qd = n, this.Bd = r, this.xd = i, this.kd = o;
|
|
10623
10576
|
}
|
|
10624
10577
|
return t.prototype.data = function(t) {
|
|
10625
|
-
if (
|
|
10626
|
-
this.
|
|
10578
|
+
if (Be("DocumentSnapshot.data", arguments, 0, 1), t = Sr("DocumentSnapshot.data", t),
|
|
10579
|
+
this.qd) {
|
|
10627
10580
|
// We only want to use the converter and create a new DocumentSnapshot
|
|
10628
10581
|
// if a converter has been provided.
|
|
10629
|
-
if (this.
|
|
10630
|
-
var e = new
|
|
10631
|
-
return this.
|
|
10582
|
+
if (this.kd) {
|
|
10583
|
+
var e = new Ar(this.Fd, this.Sd, this.qd, this.Bd, this.xd);
|
|
10584
|
+
return this.kd.fromFirestore(e, t);
|
|
10632
10585
|
}
|
|
10633
|
-
return new
|
|
10634
|
-
/* converter= */ void 0).
|
|
10586
|
+
return new dr(this.Fd, this.Fd.Dd(), t.serverTimestamps,
|
|
10587
|
+
/* converter= */ void 0).rd(this.qd.Re());
|
|
10635
10588
|
}
|
|
10636
10589
|
}, t.prototype.get = function(t, e) {
|
|
10637
|
-
if (
|
|
10638
|
-
this.
|
|
10639
|
-
var n = this.
|
|
10640
|
-
if (null !== n) return new
|
|
10590
|
+
if (Be("DocumentSnapshot.get", arguments, 1, 2), e = Sr("DocumentSnapshot.get", e),
|
|
10591
|
+
this.qd) {
|
|
10592
|
+
var n = this.qd.data().field(Ln("DocumentSnapshot.get", t));
|
|
10593
|
+
if (null !== n) return new dr(this.Fd, this.Fd.Dd(), e.serverTimestamps, this.kd).rd(n);
|
|
10641
10594
|
}
|
|
10642
10595
|
}, Object.defineProperty(t.prototype, "id", {
|
|
10643
10596
|
get: function() {
|
|
10644
|
-
return this.
|
|
10597
|
+
return this.Sd.path.U();
|
|
10645
10598
|
},
|
|
10646
10599
|
enumerable: !0,
|
|
10647
10600
|
configurable: !0
|
|
10648
10601
|
}), Object.defineProperty(t.prototype, "ref", {
|
|
10649
10602
|
get: function() {
|
|
10650
|
-
return new
|
|
10603
|
+
return new _r(this.Sd, this.Fd, this.kd);
|
|
10651
10604
|
},
|
|
10652
10605
|
enumerable: !0,
|
|
10653
10606
|
configurable: !0
|
|
10654
10607
|
}), Object.defineProperty(t.prototype, "exists", {
|
|
10655
10608
|
get: function() {
|
|
10656
|
-
return null !== this.
|
|
10609
|
+
return null !== this.qd;
|
|
10657
10610
|
},
|
|
10658
10611
|
enumerable: !0,
|
|
10659
10612
|
configurable: !0
|
|
10660
10613
|
}), Object.defineProperty(t.prototype, "metadata", {
|
|
10661
10614
|
get: function() {
|
|
10662
|
-
return new
|
|
10615
|
+
return new Er(this.xd, this.Bd);
|
|
10663
10616
|
},
|
|
10664
10617
|
enumerable: !0,
|
|
10665
10618
|
configurable: !0
|
|
10666
10619
|
}), t.prototype.isEqual = function(e) {
|
|
10667
10620
|
if (!(e instanceof t)) throw en("isEqual", "DocumentSnapshot", 1, e);
|
|
10668
|
-
return this.
|
|
10621
|
+
return this.Fd === e.Fd && this.Bd === e.Bd && this.Sd.isEqual(e.Sd) && (null === this.qd ? null === e.qd : this.qd.isEqual(e.qd)) && this.kd === e.kd;
|
|
10669
10622
|
}, t;
|
|
10670
|
-
}(),
|
|
10623
|
+
}(), Ar = /** @class */ function(t) {
|
|
10671
10624
|
function n() {
|
|
10672
10625
|
return null !== t && t.apply(this, arguments) || this;
|
|
10673
10626
|
}
|
|
10674
10627
|
return e.__extends(n, t), n.prototype.data = function(e) {
|
|
10675
10628
|
return t.prototype.data.call(this, e);
|
|
10676
10629
|
}, n;
|
|
10677
|
-
}(
|
|
10630
|
+
}(br), Nr = /** @class */ function() {
|
|
10678
10631
|
function t(t, e, n) {
|
|
10679
|
-
this.
|
|
10632
|
+
this.Qd = t, this.firestore = e, this.kd = n;
|
|
10680
10633
|
}
|
|
10681
10634
|
return t.prototype.where = function(e, n, r) {
|
|
10682
10635
|
var i;
|
|
10683
10636
|
je("Query.where", arguments, 3), $e("Query.where", 3, r), function(t, e, n, r) {
|
|
10684
10637
|
if (!e.some((function(t) {
|
|
10685
10638
|
return t === r;
|
|
10686
|
-
}))) throw new c(h.INVALID_ARGUMENT, "Invalid value " +
|
|
10639
|
+
}))) throw new c(h.INVALID_ARGUMENT, "Invalid value " + Ke(r) + " provided to function Query.where() for its " + rn(2) + " argument. Acceptable values: " + e.join(", "));
|
|
10687
10640
|
}(0, [ "<", "<=", "==", ">=", ">", "array-contains", "in", "array-contains-any" ], 0, n);
|
|
10688
10641
|
var o = Ln("Query.where", e), s = Et.K(n);
|
|
10689
10642
|
if (o.Y()) {
|
|
10690
10643
|
if (s === Et.ARRAY_CONTAINS || s === Et.ARRAY_CONTAINS_ANY) throw new c(h.INVALID_ARGUMENT, "Invalid Query. You can't perform '" + s.toString() + "' queries on FieldPath.documentId().");
|
|
10691
10644
|
if (s === Et.IN) {
|
|
10692
|
-
this.
|
|
10645
|
+
this.Wd(r, s);
|
|
10693
10646
|
for (var u = [], a = 0, f = r; a < f.length; a++) {
|
|
10694
10647
|
var l = f[a];
|
|
10695
|
-
u.push(this.
|
|
10648
|
+
u.push(this.jd(l));
|
|
10696
10649
|
}
|
|
10697
10650
|
i = {
|
|
10698
10651
|
arrayValue: {
|
|
10699
10652
|
values: u
|
|
10700
10653
|
}
|
|
10701
10654
|
};
|
|
10702
|
-
} else i = this.
|
|
10703
|
-
} else s !== Et.IN && s !== Et.ARRAY_CONTAINS_ANY || this.
|
|
10655
|
+
} else i = this.jd(r);
|
|
10656
|
+
} else s !== Et.IN && s !== Et.ARRAY_CONTAINS_ANY || this.Wd(r, s), i = this.firestore.Pd.Xo("Query.where", r,
|
|
10704
10657
|
// We only allow nested arrays for IN queries.
|
|
10705
10658
|
/** allowArrays = */ s === Et.IN);
|
|
10706
10659
|
var p = bt.create(o, s, i);
|
|
10707
|
-
return this.
|
|
10660
|
+
return this.Gd(p), new t(this.Qd.De(p), this.firestore, this.kd);
|
|
10708
10661
|
}, t.prototype.orderBy = function(e, n) {
|
|
10709
10662
|
var r;
|
|
10710
|
-
if (
|
|
10663
|
+
if (Be("Query.orderBy", arguments, 1, 2), He("Query.orderBy", "non-empty string", 2, n),
|
|
10711
10664
|
void 0 === n || "asc" === n) r = St.ASCENDING; else {
|
|
10712
10665
|
if ("desc" !== n) throw new c(h.INVALID_ARGUMENT, "Function Query.orderBy() has unknown direction '" + n + "', expected 'asc' or 'desc'.");
|
|
10713
10666
|
r = St.DESCENDING;
|
|
10714
10667
|
}
|
|
10715
|
-
if (null !== this.
|
|
10716
|
-
if (null !== this.
|
|
10668
|
+
if (null !== this.Qd.startAt) throw new c(h.INVALID_ARGUMENT, "Invalid query. You must not call Query.startAt() or Query.startAfter() before calling Query.orderBy().");
|
|
10669
|
+
if (null !== this.Qd.endAt) throw new c(h.INVALID_ARGUMENT, "Invalid query. You must not call Query.endAt() or Query.endBefore() before calling Query.orderBy().");
|
|
10717
10670
|
var i = Ln("Query.orderBy", e), o = new Vt(i, r);
|
|
10718
|
-
return this.
|
|
10671
|
+
return this.zd(o), new t(this.Qd.Fe(o), this.firestore, this.kd);
|
|
10719
10672
|
}, t.prototype.limit = function(e) {
|
|
10720
|
-
return je("Query.limit", arguments, 1),
|
|
10721
|
-
new t(this.
|
|
10673
|
+
return je("Query.limit", arguments, 1), ze("Query.limit", "number", 1, e), nn("Query.limit", 1, e),
|
|
10674
|
+
new t(this.Qd.Ne(e), this.firestore, this.kd);
|
|
10722
10675
|
}, t.prototype.limitToLast = function(e) {
|
|
10723
|
-
return je("Query.limitToLast", arguments, 1),
|
|
10724
|
-
nn("Query.limitToLast", 1, e), new t(this.
|
|
10676
|
+
return je("Query.limitToLast", arguments, 1), ze("Query.limitToLast", "number", 1, e),
|
|
10677
|
+
nn("Query.limitToLast", 1, e), new t(this.Qd.ke(e), this.firestore, this.kd);
|
|
10725
10678
|
}, t.prototype.startAt = function(e) {
|
|
10726
10679
|
for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];
|
|
10727
|
-
|
|
10728
|
-
var i = this.
|
|
10680
|
+
Qe("Query.startAt", arguments, 1);
|
|
10681
|
+
var i = this.Kd("Query.startAt", e, n,
|
|
10729
10682
|
/*before=*/ !0);
|
|
10730
|
-
return new t(this.
|
|
10683
|
+
return new t(this.Qd.Le(i), this.firestore, this.kd);
|
|
10731
10684
|
}, t.prototype.startAfter = function(e) {
|
|
10732
10685
|
for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];
|
|
10733
|
-
|
|
10734
|
-
var i = this.
|
|
10686
|
+
Qe("Query.startAfter", arguments, 1);
|
|
10687
|
+
var i = this.Kd("Query.startAfter", e, n,
|
|
10735
10688
|
/*before=*/ !1);
|
|
10736
|
-
return new t(this.
|
|
10689
|
+
return new t(this.Qd.Le(i), this.firestore, this.kd);
|
|
10737
10690
|
}, t.prototype.endBefore = function(e) {
|
|
10738
10691
|
for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];
|
|
10739
|
-
|
|
10740
|
-
var i = this.
|
|
10692
|
+
Qe("Query.endBefore", arguments, 1);
|
|
10693
|
+
var i = this.Kd("Query.endBefore", e, n,
|
|
10741
10694
|
/*before=*/ !0);
|
|
10742
|
-
return new t(this.
|
|
10695
|
+
return new t(this.Qd.$e(i), this.firestore, this.kd);
|
|
10743
10696
|
}, t.prototype.endAt = function(e) {
|
|
10744
10697
|
for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r];
|
|
10745
|
-
|
|
10746
|
-
var i = this.
|
|
10698
|
+
Qe("Query.endAt", arguments, 1);
|
|
10699
|
+
var i = this.Kd("Query.endAt", e, n,
|
|
10747
10700
|
/*before=*/ !1);
|
|
10748
|
-
return new t(this.
|
|
10701
|
+
return new t(this.Qd.$e(i), this.firestore, this.kd);
|
|
10749
10702
|
}, t.prototype.isEqual = function(e) {
|
|
10750
10703
|
if (!(e instanceof t)) throw en("isEqual", "Query", 1, e);
|
|
10751
|
-
return this.firestore === e.firestore && this.
|
|
10704
|
+
return this.firestore === e.firestore && this.Qd.isEqual(e.Qd);
|
|
10752
10705
|
}, t.prototype.withConverter = function(e) {
|
|
10753
|
-
return new t(this.
|
|
10706
|
+
return new t(this.Qd, this.firestore, e);
|
|
10754
10707
|
},
|
|
10755
|
-
/** Helper function to create a bound from a document or fields */ t.prototype.
|
|
10756
|
-
if ($e(t, 1, e), e instanceof
|
|
10708
|
+
/** Helper function to create a bound from a document or fields */ t.prototype.Kd = function(t, e, n, r) {
|
|
10709
|
+
if ($e(t, 1, e), e instanceof br) {
|
|
10757
10710
|
if (n.length > 0) throw new c(h.INVALID_ARGUMENT, "Too many arguments provided to " + t + "().");
|
|
10758
10711
|
var i = e;
|
|
10759
10712
|
if (!i.exists) throw new c(h.NOT_FOUND, "Can't use a DocumentSnapshot that doesn't exist for " + t + "().");
|
|
10760
|
-
return this.
|
|
10713
|
+
return this.Hd(i.qd, r);
|
|
10761
10714
|
}
|
|
10762
10715
|
var o = [ e ].concat(n);
|
|
10763
|
-
return this.
|
|
10716
|
+
return this.Jd(t, o, r);
|
|
10764
10717
|
},
|
|
10765
10718
|
/**
|
|
10766
10719
|
* Create a Bound from a query and a document.
|
|
@@ -10773,7 +10726,7 @@ var pr = /** @class */ function() {
|
|
|
10773
10726
|
* of the query or if any of the fields in the order by are an uncommitted
|
|
10774
10727
|
* server timestamp.
|
|
10775
10728
|
*/
|
|
10776
|
-
t.prototype.
|
|
10729
|
+
t.prototype.Hd = function(t, e) {
|
|
10777
10730
|
// Because people expect to continue/end a query at the exact document
|
|
10778
10731
|
// provided, we need to use the implicit sort order rather than the explicit
|
|
10779
10732
|
// sort order, because it's guaranteed to contain the document key. That way
|
|
@@ -10781,11 +10734,11 @@ var pr = /** @class */ function() {
|
|
|
10781
10734
|
// the provided document. Without the key (by using the explicit sort
|
|
10782
10735
|
// orders), multiple documents could match the position, yielding duplicate
|
|
10783
10736
|
// results.
|
|
10784
|
-
for (var n = [], r = 0, i = this.
|
|
10737
|
+
for (var n = [], r = 0, i = this.Qd.orderBy; r < i.length; r++) {
|
|
10785
10738
|
var o = i[r];
|
|
10786
|
-
if (o.field.Y()) n.push(H(this.firestore.
|
|
10739
|
+
if (o.field.Y()) n.push(H(this.firestore._d, t.key)); else {
|
|
10787
10740
|
var s = t.field(o.field);
|
|
10788
|
-
if (
|
|
10741
|
+
if (C(s)) throw new c(h.INVALID_ARGUMENT, 'Invalid query. You are trying to start or end a query using a document for which the field "' + o.field + '" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');
|
|
10789
10742
|
if (null === s) {
|
|
10790
10743
|
var u = o.field.G();
|
|
10791
10744
|
throw new c(h.INVALID_ARGUMENT, "Invalid query. You are trying to start or end a query using a document for which the field '" + u + "' (used as the orderBy) does not exist.");
|
|
@@ -10798,62 +10751,62 @@ var pr = /** @class */ function() {
|
|
|
10798
10751
|
/**
|
|
10799
10752
|
* Converts a list of field values to a Bound for the given query.
|
|
10800
10753
|
*/
|
|
10801
|
-
t.prototype.
|
|
10754
|
+
t.prototype.Jd = function(t, e, n) {
|
|
10802
10755
|
// Use explicit order by's because it has to match the query the user made
|
|
10803
|
-
var r = this.
|
|
10756
|
+
var r = this.Qd.Ve;
|
|
10804
10757
|
if (e.length > r.length) throw new c(h.INVALID_ARGUMENT, "Too many arguments provided to " + t + "(). The number of arguments must be less than or equal to the number of Query.orderBy() clauses");
|
|
10805
10758
|
for (var i = [], o = 0; o < e.length; o++) {
|
|
10806
10759
|
var s = e[o];
|
|
10807
10760
|
if (r[o].field.Y()) {
|
|
10808
10761
|
if ("string" != typeof s) throw new c(h.INVALID_ARGUMENT, "Invalid query. Expected a string for document ID in " + t + "(), but got a " + typeof s);
|
|
10809
|
-
if (!this.
|
|
10810
|
-
var u = this.
|
|
10762
|
+
if (!this.Qd.He() && -1 !== s.indexOf("/")) throw new c(h.INVALID_ARGUMENT, "Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to " + t + "() must be a plain document ID, but '" + s + "' contains a slash.");
|
|
10763
|
+
var u = this.Qd.path.child(w.K(s));
|
|
10811
10764
|
if (!b.st(u)) throw new c(h.INVALID_ARGUMENT, "Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to " + t + "() must result in a valid document path, but '" + u + "' is not because it contains an odd number of segments.");
|
|
10812
10765
|
var a = new b(u);
|
|
10813
|
-
i.push(H(this.firestore.
|
|
10766
|
+
i.push(H(this.firestore._d, a));
|
|
10814
10767
|
} else {
|
|
10815
|
-
var f = this.firestore.
|
|
10768
|
+
var f = this.firestore.Pd.Xo(t, s);
|
|
10816
10769
|
i.push(f);
|
|
10817
10770
|
}
|
|
10818
10771
|
}
|
|
10819
10772
|
return new Dt(i, n);
|
|
10820
10773
|
}, t.prototype.onSnapshot = function() {
|
|
10821
10774
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
10822
|
-
|
|
10775
|
+
Be("Query.onSnapshot", arguments, 1, 4);
|
|
10823
10776
|
var n, r = {}, i = 0;
|
|
10824
|
-
return "object" != typeof t[i] ||
|
|
10777
|
+
return "object" != typeof t[i] || pr(t[i]) || (tn("Query.onSnapshot", r = t[i], [ "includeMetadataChanges" ]),
|
|
10825
10778
|
We("Query.onSnapshot", "boolean", "includeMetadataChanges", r.includeMetadataChanges),
|
|
10826
|
-
i++),
|
|
10779
|
+
i++), pr(t[i]) ? n = t[i] : (ze("Query.onSnapshot", "function", i, t[i]), He("Query.onSnapshot", "function", i + 1, t[i + 1]),
|
|
10827
10780
|
He("Query.onSnapshot", "function", i + 2, t[i + 2]), n = {
|
|
10828
10781
|
next: t[i],
|
|
10829
10782
|
error: t[i + 1],
|
|
10830
10783
|
complete: t[i + 2]
|
|
10831
|
-
}), this.
|
|
10832
|
-
}, t.prototype.
|
|
10784
|
+
}), this.Yd(this.Qd), this.Md(r, n);
|
|
10785
|
+
}, t.prototype.Md = function(t, e) {
|
|
10833
10786
|
var n = this, r = function(t) {
|
|
10834
10787
|
console.error("Uncaught Error in onSnapshot:", t);
|
|
10835
10788
|
};
|
|
10836
10789
|
e.error && (r = e.error.bind(e));
|
|
10837
|
-
var i = new
|
|
10790
|
+
var i = new lr({
|
|
10838
10791
|
next: function(t) {
|
|
10839
|
-
e.next && e.next(new
|
|
10792
|
+
e.next && e.next(new Ir(n.firestore, n.Qd, t, n.kd));
|
|
10840
10793
|
},
|
|
10841
10794
|
error: r
|
|
10842
|
-
}), o = this.firestore.
|
|
10795
|
+
}), o = this.firestore.wd(), s = o.listen(this.Qd, i, t);
|
|
10843
10796
|
return function() {
|
|
10844
|
-
i.
|
|
10797
|
+
i.sd(), o.$u(s);
|
|
10845
10798
|
};
|
|
10846
|
-
}, t.prototype.
|
|
10799
|
+
}, t.prototype.Yd = function(t) {
|
|
10847
10800
|
if (t.Ge() && 0 === t.Ve.length) throw new c(h.UNIMPLEMENTED, "limitToLast() queries require specifying at least one orderBy() clause");
|
|
10848
10801
|
}, t.prototype.get = function(t) {
|
|
10849
10802
|
var e = this;
|
|
10850
|
-
return
|
|
10851
|
-
t && "cache" === t.source ? e.firestore.
|
|
10852
|
-
n(new
|
|
10853
|
-
}), r) : e.
|
|
10803
|
+
return Be("Query.get", arguments, 0, 1), Rr("Query.get", t), this.Yd(this.Qd), new Promise((function(n, r) {
|
|
10804
|
+
t && "cache" === t.source ? e.firestore.wd().td(e.Qd).then((function(t) {
|
|
10805
|
+
n(new Ir(e.firestore, e.Qd, t, e.kd));
|
|
10806
|
+
}), r) : e.Ud(n, r, t);
|
|
10854
10807
|
}));
|
|
10855
|
-
}, t.prototype.
|
|
10856
|
-
var r = this.
|
|
10808
|
+
}, t.prototype.Ud = function(t, e, n) {
|
|
10809
|
+
var r = this.Md({
|
|
10857
10810
|
includeMetadataChanges: !0,
|
|
10858
10811
|
ql: !0
|
|
10859
10812
|
}, {
|
|
@@ -10870,61 +10823,61 @@ var pr = /** @class */ function() {
|
|
|
10870
10823
|
* appropriate errors if the value is anything other than a DocumentReference
|
|
10871
10824
|
* or String, or if the string is malformed.
|
|
10872
10825
|
*/
|
|
10873
|
-
t.prototype.
|
|
10826
|
+
t.prototype.jd = function(t) {
|
|
10874
10827
|
if ("string" == typeof t) {
|
|
10875
10828
|
if ("" === t) throw new c(h.INVALID_ARGUMENT, "Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");
|
|
10876
|
-
if (!this.
|
|
10877
|
-
var e = this.
|
|
10829
|
+
if (!this.Qd.He() && -1 !== t.indexOf("/")) throw new c(h.INVALID_ARGUMENT, "Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '" + t + "' contains a '/' character.");
|
|
10830
|
+
var e = this.Qd.path.child(w.K(t));
|
|
10878
10831
|
if (!b.st(e)) throw new c(h.INVALID_ARGUMENT, "Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '" + e + "' is not because it has an odd number of segments (" + e.length + ").");
|
|
10879
|
-
return H(this.firestore.
|
|
10832
|
+
return H(this.firestore._d, new b(e));
|
|
10880
10833
|
}
|
|
10881
|
-
if (t instanceof
|
|
10834
|
+
if (t instanceof _r) {
|
|
10882
10835
|
var n = t;
|
|
10883
|
-
return H(this.firestore.
|
|
10836
|
+
return H(this.firestore._d, n.Sd);
|
|
10884
10837
|
}
|
|
10885
|
-
throw new c(h.INVALID_ARGUMENT, "Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: " +
|
|
10838
|
+
throw new c(h.INVALID_ARGUMENT, "Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: " + Ke(t) + ".");
|
|
10886
10839
|
},
|
|
10887
10840
|
/**
|
|
10888
10841
|
* Validates that the value passed into a disjunctrive filter satisfies all
|
|
10889
10842
|
* array requirements.
|
|
10890
10843
|
*/
|
|
10891
|
-
t.prototype.
|
|
10844
|
+
t.prototype.Wd = function(t, e) {
|
|
10892
10845
|
if (!Array.isArray(t) || 0 === t.length) throw new c(h.INVALID_ARGUMENT, "Invalid Query. A non-empty array is required for '" + e.toString() + "' filters.");
|
|
10893
10846
|
if (t.length > 10) throw new c(h.INVALID_ARGUMENT, "Invalid Query. '" + e.toString() + "' filters support a maximum of 10 elements in the value array.");
|
|
10894
10847
|
if (t.indexOf(null) >= 0) throw new c(h.INVALID_ARGUMENT, "Invalid Query. '" + e.toString() + "' filters cannot contain 'null' in the value array.");
|
|
10895
10848
|
if (t.filter((function(t) {
|
|
10896
10849
|
return Number.isNaN(t);
|
|
10897
10850
|
})).length > 0) throw new c(h.INVALID_ARGUMENT, "Invalid Query. '" + e.toString() + "' filters cannot contain 'NaN' in the value array.");
|
|
10898
|
-
}, t.prototype.
|
|
10851
|
+
}, t.prototype.Gd = function(t) {
|
|
10899
10852
|
if (t instanceof bt) {
|
|
10900
10853
|
var e = [ Et.ARRAY_CONTAINS, Et.ARRAY_CONTAINS_ANY ], n = [ Et.IN, Et.ARRAY_CONTAINS_ANY ], r = e.indexOf(t.op) >= 0, i = n.indexOf(t.op) >= 0;
|
|
10901
10854
|
if (t.ze()) {
|
|
10902
|
-
var o = this.
|
|
10855
|
+
var o = this.Qd.Se();
|
|
10903
10856
|
if (null !== o && !o.isEqual(t.field)) throw new c(h.INVALID_ARGUMENT, "Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '" + o.toString() + "' and '" + t.field.toString() + "'");
|
|
10904
|
-
var s = this.
|
|
10905
|
-
null !== s && this.
|
|
10857
|
+
var s = this.Qd.Ce();
|
|
10858
|
+
null !== s && this.Xd(t.field, s);
|
|
10906
10859
|
} else if (i || r) {
|
|
10907
10860
|
// You can have at most 1 disjunctive filter and 1 array filter. Check if
|
|
10908
10861
|
// the new filter conflicts with an existing one.
|
|
10909
10862
|
var u = null;
|
|
10910
|
-
if (i && (u = this.
|
|
10863
|
+
if (i && (u = this.Qd.Ke(n)), null === u && r && (u = this.Qd.Ke(e)), null != u)
|
|
10911
10864
|
// We special case when it's a duplicate op to give a slightly clearer error message.
|
|
10912
10865
|
throw u === t.op ? new c(h.INVALID_ARGUMENT, "Invalid query. You cannot use more than one '" + t.op.toString() + "' filter.") : new c(h.INVALID_ARGUMENT, "Invalid query. You cannot use '" + t.op.toString() + "' filters with '" + u.toString() + "' filters.");
|
|
10913
10866
|
}
|
|
10914
10867
|
}
|
|
10915
|
-
}, t.prototype.
|
|
10916
|
-
if (null === this.
|
|
10868
|
+
}, t.prototype.zd = function(t) {
|
|
10869
|
+
if (null === this.Qd.Ce()) {
|
|
10917
10870
|
// This is the first order by. It must match any inequality.
|
|
10918
|
-
var e = this.
|
|
10919
|
-
null !== e && this.
|
|
10871
|
+
var e = this.Qd.Se();
|
|
10872
|
+
null !== e && this.Xd(e, t.field);
|
|
10920
10873
|
}
|
|
10921
|
-
}, t.prototype.
|
|
10874
|
+
}, t.prototype.Xd = function(t, e) {
|
|
10922
10875
|
if (!e.isEqual(t)) throw new c(h.INVALID_ARGUMENT, "Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '" + t.toString() + "' and so you must also use '" + t.toString() + "' as your first Query.orderBy(), but your first Query.orderBy() is on field '" + e.toString() + "' instead.");
|
|
10923
10876
|
}, t;
|
|
10924
|
-
}(),
|
|
10877
|
+
}(), Ir = /** @class */ function() {
|
|
10925
10878
|
function t(t, e, n, r) {
|
|
10926
|
-
this.
|
|
10927
|
-
this.metadata = new
|
|
10879
|
+
this.Fd = t, this.Zd = e, this.tf = n, this.kd = r, this.ef = null, this.sf = null,
|
|
10880
|
+
this.metadata = new Er(n.hasPendingWrites, n.fromCache);
|
|
10928
10881
|
}
|
|
10929
10882
|
return Object.defineProperty(t.prototype, "docs", {
|
|
10930
10883
|
get: function() {
|
|
@@ -10937,33 +10890,33 @@ var pr = /** @class */ function() {
|
|
|
10937
10890
|
configurable: !0
|
|
10938
10891
|
}), Object.defineProperty(t.prototype, "empty", {
|
|
10939
10892
|
get: function() {
|
|
10940
|
-
return this.
|
|
10893
|
+
return this.tf.docs.q();
|
|
10941
10894
|
},
|
|
10942
10895
|
enumerable: !0,
|
|
10943
10896
|
configurable: !0
|
|
10944
10897
|
}), Object.defineProperty(t.prototype, "size", {
|
|
10945
10898
|
get: function() {
|
|
10946
|
-
return this.
|
|
10899
|
+
return this.tf.docs.size;
|
|
10947
10900
|
},
|
|
10948
10901
|
enumerable: !0,
|
|
10949
10902
|
configurable: !0
|
|
10950
10903
|
}), t.prototype.forEach = function(t, e) {
|
|
10951
10904
|
var n = this;
|
|
10952
|
-
|
|
10953
|
-
this.
|
|
10954
|
-
t.call(e, n.
|
|
10905
|
+
Be("QuerySnapshot.forEach", arguments, 1, 2), ze("QuerySnapshot.forEach", "function", 1, t),
|
|
10906
|
+
this.tf.docs.forEach((function(r) {
|
|
10907
|
+
t.call(e, n.if(r));
|
|
10955
10908
|
}));
|
|
10956
10909
|
}, Object.defineProperty(t.prototype, "query", {
|
|
10957
10910
|
get: function() {
|
|
10958
|
-
return new
|
|
10911
|
+
return new Nr(this.Zd, this.Fd, this.kd);
|
|
10959
10912
|
},
|
|
10960
10913
|
enumerable: !0,
|
|
10961
10914
|
configurable: !0
|
|
10962
10915
|
}), t.prototype.docChanges = function(t) {
|
|
10963
10916
|
t && (tn("QuerySnapshot.docChanges", t, [ "includeMetadataChanges" ]), We("QuerySnapshot.docChanges", "boolean", "includeMetadataChanges", t.includeMetadataChanges));
|
|
10964
10917
|
var e = !(!t || !t.includeMetadataChanges);
|
|
10965
|
-
if (e && this.
|
|
10966
|
-
return this.
|
|
10918
|
+
if (e && this.tf.ds) throw new c(h.INVALID_ARGUMENT, "To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");
|
|
10919
|
+
return this.ef && this.sf === e || (this.ef =
|
|
10967
10920
|
/**
|
|
10968
10921
|
* Calculates the array of firestore.DocumentChange's for a given ViewSnapshot.
|
|
10969
10922
|
*
|
|
@@ -10975,7 +10928,7 @@ var pr = /** @class */ function() {
|
|
|
10975
10928
|
// fast
|
|
10976
10929
|
var i = 0;
|
|
10977
10930
|
return n.docChanges.map((function(e) {
|
|
10978
|
-
var o = new
|
|
10931
|
+
var o = new Ar(t, e.doc.key, e.doc, n.fromCache, n.ls.has(e.doc.key), r);
|
|
10979
10932
|
return e.doc, {
|
|
10980
10933
|
type: "added",
|
|
10981
10934
|
doc: o,
|
|
@@ -10990,66 +10943,66 @@ var pr = /** @class */ function() {
|
|
|
10990
10943
|
return n.docChanges.filter((function(t) {
|
|
10991
10944
|
return e || 3 /* Metadata */ !== t.type;
|
|
10992
10945
|
})).map((function(e) {
|
|
10993
|
-
var i = new
|
|
10946
|
+
var i = new Ar(t, e.doc.key, e.doc, n.fromCache, n.ls.has(e.doc.key), r), s = -1, u = -1;
|
|
10994
10947
|
return 0 /* Added */ !== e.type && (s = o.indexOf(e.doc.key), o = o.delete(e.doc.key)),
|
|
10995
10948
|
1 /* Removed */ !== e.type && (u = (o = o.add(e.doc)).indexOf(e.doc.key)), {
|
|
10996
|
-
type:
|
|
10949
|
+
type: Dr(e.type),
|
|
10997
10950
|
doc: i,
|
|
10998
10951
|
oldIndex: s,
|
|
10999
10952
|
newIndex: u
|
|
11000
10953
|
};
|
|
11001
10954
|
}));
|
|
11002
|
-
}(this.
|
|
10955
|
+
}(this.Fd, e, this.tf, this.kd), this.sf = e), this.ef;
|
|
11003
10956
|
},
|
|
11004
10957
|
/** Check the equality. The call can be very expensive. */ t.prototype.isEqual = function(e) {
|
|
11005
10958
|
if (!(e instanceof t)) throw en("isEqual", "QuerySnapshot", 1, e);
|
|
11006
|
-
return this.
|
|
11007
|
-
}, t.prototype.
|
|
11008
|
-
return new
|
|
10959
|
+
return this.Fd === e.Fd && this.Zd.isEqual(e.Zd) && this.tf.isEqual(e.tf) && this.kd === e.kd;
|
|
10960
|
+
}, t.prototype.if = function(t) {
|
|
10961
|
+
return new Ar(this.Fd, t.key, t, this.metadata.fromCache, this.tf.ls.has(t.key), this.kd);
|
|
11009
10962
|
}, t;
|
|
11010
|
-
}(),
|
|
10963
|
+
}(), Tr = /** @class */ function(t) {
|
|
11011
10964
|
function n(e, n, r) {
|
|
11012
10965
|
var i = this;
|
|
11013
|
-
if ((i = t.call(this, _t.ve(e), n, r) || this).
|
|
10966
|
+
if ((i = t.call(this, _t.ve(e), n, r) || this).nf = e, e.length % 2 != 1) throw new c(h.INVALID_ARGUMENT, "Invalid collection reference. Collection references must have an odd number of segments, but " + e.G() + " has " + e.length);
|
|
11014
10967
|
return i;
|
|
11015
10968
|
}
|
|
11016
10969
|
return e.__extends(n, t), Object.defineProperty(n.prototype, "id", {
|
|
11017
10970
|
get: function() {
|
|
11018
|
-
return this.
|
|
10971
|
+
return this.Qd.path.U();
|
|
11019
10972
|
},
|
|
11020
10973
|
enumerable: !0,
|
|
11021
10974
|
configurable: !0
|
|
11022
10975
|
}), Object.defineProperty(n.prototype, "parent", {
|
|
11023
10976
|
get: function() {
|
|
11024
|
-
var t = this.
|
|
11025
|
-
return t.q() ? null : new
|
|
10977
|
+
var t = this.Qd.path.O();
|
|
10978
|
+
return t.q() ? null : new _r(new b(t), this.firestore);
|
|
11026
10979
|
},
|
|
11027
10980
|
enumerable: !0,
|
|
11028
10981
|
configurable: !0
|
|
11029
10982
|
}), Object.defineProperty(n.prototype, "path", {
|
|
11030
10983
|
get: function() {
|
|
11031
|
-
return this.
|
|
10984
|
+
return this.Qd.path.G();
|
|
11032
10985
|
},
|
|
11033
10986
|
enumerable: !0,
|
|
11034
10987
|
configurable: !0
|
|
11035
10988
|
}), n.prototype.doc = function(t) {
|
|
11036
|
-
if (
|
|
10989
|
+
if (Be("CollectionReference.doc", arguments, 0, 1),
|
|
11037
10990
|
// We allow omission of 'pathString' but explicitly prohibit passing in both
|
|
11038
10991
|
// 'undefined' and 'null'.
|
|
11039
|
-
0 === arguments.length && (t = Ee.Tn()),
|
|
10992
|
+
0 === arguments.length && (t = Ee.Tn()), ze("CollectionReference.doc", "non-empty string", 1, t),
|
|
11040
10993
|
"" === t) throw new c(h.INVALID_ARGUMENT, "Document path must be a non-empty string");
|
|
11041
10994
|
var e = w.K(t);
|
|
11042
|
-
return
|
|
10995
|
+
return _r.Cd(this.Qd.path.child(e), this.firestore, this.kd);
|
|
11043
10996
|
}, n.prototype.add = function(t) {
|
|
11044
|
-
je("CollectionReference.add", arguments, 1),
|
|
10997
|
+
je("CollectionReference.add", arguments, 1), ze("CollectionReference.add", "object", 1, this.kd ? this.kd.toFirestore(t) : t);
|
|
11045
10998
|
var e = this.doc();
|
|
11046
10999
|
return e.set(t).then((function() {
|
|
11047
11000
|
return e;
|
|
11048
11001
|
}));
|
|
11049
11002
|
}, n.prototype.withConverter = function(t) {
|
|
11050
|
-
return new n(this.
|
|
11003
|
+
return new n(this.nf, this.firestore, t);
|
|
11051
11004
|
}, n;
|
|
11052
|
-
}(
|
|
11005
|
+
}(Nr);
|
|
11053
11006
|
|
|
11054
11007
|
/**
|
|
11055
11008
|
* @license
|
|
@@ -11068,14 +11021,14 @@ var pr = /** @class */ function() {
|
|
|
11068
11021
|
* limitations under the License.
|
|
11069
11022
|
*/
|
|
11070
11023
|
// settings() defaults:
|
|
11071
|
-
function
|
|
11024
|
+
function kr(t, e) {
|
|
11072
11025
|
if (void 0 === e) return {
|
|
11073
11026
|
merge: !1
|
|
11074
11027
|
};
|
|
11075
11028
|
if (tn(t, e, [ "merge", "mergeFields" ]), We(t, "boolean", "merge", e.merge), function(t, e, n, r, i) {
|
|
11076
11029
|
void 0 !== r && function(t, e, n, r, i) {
|
|
11077
|
-
if (!(r instanceof Array)) throw new c(h.INVALID_ARGUMENT, "Function " + t + "() requires its " + e + " option to be an array, but it was: " +
|
|
11078
|
-
for (var o = 0; o < r.length; ++o) if (!i(r[o])) throw new c(h.INVALID_ARGUMENT, "Function " + t + "() requires all " + e + " elements to be " + n + ", but the value at index " + o + " was: " +
|
|
11030
|
+
if (!(r instanceof Array)) throw new c(h.INVALID_ARGUMENT, "Function " + t + "() requires its " + e + " option to be an array, but it was: " + Ke(r));
|
|
11031
|
+
for (var o = 0; o < r.length; ++o) if (!i(r[o])) throw new c(h.INVALID_ARGUMENT, "Function " + t + "() requires all " + e + " elements to be " + n + ", but the value at index " + o + " was: " + Ke(r[o]));
|
|
11079
11032
|
}(t, e, n, r, i);
|
|
11080
11033
|
}(t, "mergeFields", "a string or a FieldPath", e.mergeFields, (function(t) {
|
|
11081
11034
|
return "string" == typeof t || t instanceof fn;
|
|
@@ -11083,24 +11036,24 @@ function Tr(t, e) {
|
|
|
11083
11036
|
return e;
|
|
11084
11037
|
}
|
|
11085
11038
|
|
|
11086
|
-
function
|
|
11039
|
+
function Sr(t, e) {
|
|
11087
11040
|
return void 0 === e ? {} : (tn(t, e, [ "serverTimestamps" ]), Je(t, 0, "serverTimestamps", e.serverTimestamps, [ "estimate", "previous", "none" ]),
|
|
11088
11041
|
e);
|
|
11089
11042
|
}
|
|
11090
11043
|
|
|
11091
|
-
function
|
|
11044
|
+
function Rr(t, e) {
|
|
11092
11045
|
He(t, "object", 1, e), e && (tn(t, e, [ "source" ]), Je(t, 0, "source", e.source, [ "default", "server", "cache" ]));
|
|
11093
11046
|
}
|
|
11094
11047
|
|
|
11095
|
-
function
|
|
11096
|
-
if (e instanceof
|
|
11048
|
+
function Lr(t, e, n) {
|
|
11049
|
+
if (e instanceof _r) {
|
|
11097
11050
|
if (e.firestore !== n) throw new c(h.INVALID_ARGUMENT, "Provided document reference is from a different Firestore instance.");
|
|
11098
11051
|
return e;
|
|
11099
11052
|
}
|
|
11100
11053
|
throw en(t, "DocumentReference", 1, e);
|
|
11101
11054
|
}
|
|
11102
11055
|
|
|
11103
|
-
function
|
|
11056
|
+
function Dr(t) {
|
|
11104
11057
|
switch (t) {
|
|
11105
11058
|
case 0 /* Added */ :
|
|
11106
11059
|
return "added";
|
|
@@ -11125,29 +11078,29 @@ function Lr(t) {
|
|
|
11125
11078
|
* because we want to provide the user with a more specific error message if
|
|
11126
11079
|
* their set() or fails due to invalid data originating from a toFirestore()
|
|
11127
11080
|
* call.
|
|
11128
|
-
*/ function
|
|
11081
|
+
*/ function Vr(t, e, n) {
|
|
11129
11082
|
var r;
|
|
11130
11083
|
return t ? (r = t.toFirestore(e), n = "toFirestore() in " + n) : r = e, [ r, n ];
|
|
11131
11084
|
}
|
|
11132
11085
|
|
|
11133
|
-
var
|
|
11134
|
-
Firestore:
|
|
11086
|
+
var Ur = sn(mr, "Use firebase.firestore() instead."), Cr = sn(gr, "Use firebase.firestore().runTransaction() instead."), Or = sn(wr, "Use firebase.firestore().batch() instead."), Pr = sn(_r, "Use firebase.firestore().doc() instead."), qr = sn(br), Mr = sn(Ar), Fr = sn(Nr), Gr = sn(Ir), xr = sn(Tr, "Use firebase.firestore().collection() instead."), jr = {
|
|
11087
|
+
Firestore: Ur,
|
|
11135
11088
|
GeoPoint: _n,
|
|
11136
11089
|
Timestamp: v,
|
|
11137
11090
|
Blob: cn,
|
|
11138
|
-
Transaction:
|
|
11139
|
-
WriteBatch:
|
|
11140
|
-
DocumentReference:
|
|
11091
|
+
Transaction: Cr,
|
|
11092
|
+
WriteBatch: Or,
|
|
11093
|
+
DocumentReference: Pr,
|
|
11141
11094
|
DocumentSnapshot: qr,
|
|
11142
|
-
Query:
|
|
11095
|
+
Query: Fr,
|
|
11143
11096
|
QueryDocumentSnapshot: Mr,
|
|
11144
|
-
QuerySnapshot:
|
|
11145
|
-
CollectionReference:
|
|
11097
|
+
QuerySnapshot: Gr,
|
|
11098
|
+
CollectionReference: xr,
|
|
11146
11099
|
FieldPath: fn,
|
|
11147
11100
|
FieldValue: wn,
|
|
11148
|
-
setLogLevel:
|
|
11149
|
-
CACHE_SIZE_UNLIMITED:
|
|
11150
|
-
},
|
|
11101
|
+
setLogLevel: mr.setLogLevel,
|
|
11102
|
+
CACHE_SIZE_UNLIMITED: yr
|
|
11103
|
+
}, Qr = /** @class */ function() {
|
|
11151
11104
|
function t() {}
|
|
11152
11105
|
return t.prototype.mu = function(t) {
|
|
11153
11106
|
// No-op.
|
|
@@ -11157,73 +11110,73 @@ var Vr = sn(vr, "Use firebase.firestore() instead."), Or = sn(mr, "Use firebase.
|
|
|
11157
11110
|
}(), Br = /** @class */ function() {
|
|
11158
11111
|
function t() {
|
|
11159
11112
|
var t = this;
|
|
11160
|
-
this.
|
|
11161
|
-
return t.
|
|
11162
|
-
}, this.
|
|
11163
|
-
return t.
|
|
11164
|
-
}, this.
|
|
11113
|
+
this.rf = function() {
|
|
11114
|
+
return t.hf();
|
|
11115
|
+
}, this.af = function() {
|
|
11116
|
+
return t.uf();
|
|
11117
|
+
}, this.cf = [], this.lf();
|
|
11165
11118
|
}
|
|
11166
11119
|
return t.prototype.mu = function(t) {
|
|
11167
|
-
this.
|
|
11120
|
+
this.cf.push(t);
|
|
11168
11121
|
}, t.prototype.ku = function() {
|
|
11169
|
-
window.removeEventListener("online", this.
|
|
11170
|
-
}, t.prototype.
|
|
11171
|
-
window.addEventListener("online", this.
|
|
11172
|
-
}, t.prototype.
|
|
11122
|
+
window.removeEventListener("online", this.rf), window.removeEventListener("offline", this.af);
|
|
11123
|
+
}, t.prototype.lf = function() {
|
|
11124
|
+
window.addEventListener("online", this.rf), window.addEventListener("offline", this.af);
|
|
11125
|
+
}, t.prototype.hf = function() {
|
|
11173
11126
|
ve("ConnectivityMonitor", "Network connectivity changed: AVAILABLE");
|
|
11174
|
-
for (var t = 0, e = this.
|
|
11127
|
+
for (var t = 0, e = this.cf; t < e.length; t++) {
|
|
11175
11128
|
(0, e[t])(0 /* AVAILABLE */);
|
|
11176
11129
|
}
|
|
11177
|
-
}, t.prototype.
|
|
11130
|
+
}, t.prototype.uf = function() {
|
|
11178
11131
|
ve("ConnectivityMonitor", "Network connectivity changed: UNAVAILABLE");
|
|
11179
|
-
for (var t = 0, e = this.
|
|
11132
|
+
for (var t = 0, e = this.cf; t < e.length; t++) {
|
|
11180
11133
|
(0, e[t])(1 /* UNAVAILABLE */);
|
|
11181
11134
|
}
|
|
11182
11135
|
},
|
|
11183
11136
|
// TODO(chenbrian): Consider passing in window either into this component or
|
|
11184
11137
|
// here for testing via FakeWindow.
|
|
11185
11138
|
/** Checks that all used attributes of window are available. */
|
|
11186
|
-
t.
|
|
11139
|
+
t._f = function() {
|
|
11187
11140
|
return "undefined" != typeof window && void 0 !== window.addEventListener && void 0 !== window.removeEventListener;
|
|
11188
11141
|
}, t;
|
|
11189
11142
|
}(), zr = /** @class */ function() {
|
|
11190
11143
|
function t(t) {
|
|
11191
|
-
this.
|
|
11144
|
+
this.df = t.df, this.ff = t.ff;
|
|
11192
11145
|
}
|
|
11193
11146
|
return t.prototype.Na = function(t) {
|
|
11194
|
-
this.
|
|
11147
|
+
this.wf = t;
|
|
11195
11148
|
}, t.prototype.va = function(t) {
|
|
11196
|
-
this.
|
|
11149
|
+
this.Tf = t;
|
|
11197
11150
|
}, t.prototype.onMessage = function(t) {
|
|
11198
|
-
this.
|
|
11151
|
+
this.mf = t;
|
|
11199
11152
|
}, t.prototype.close = function() {
|
|
11200
|
-
this.
|
|
11153
|
+
this.ff();
|
|
11201
11154
|
}, t.prototype.send = function(t) {
|
|
11202
|
-
this.
|
|
11203
|
-
}, t.prototype.
|
|
11204
|
-
this.
|
|
11205
|
-
}, t.prototype.
|
|
11206
|
-
this.
|
|
11207
|
-
}, t.prototype.
|
|
11208
|
-
this.
|
|
11155
|
+
this.df(t);
|
|
11156
|
+
}, t.prototype.Ef = function() {
|
|
11157
|
+
this.wf();
|
|
11158
|
+
}, t.prototype.Rf = function(t) {
|
|
11159
|
+
this.Tf(t);
|
|
11160
|
+
}, t.prototype.If = function(t) {
|
|
11161
|
+
this.mf(t);
|
|
11209
11162
|
}, t;
|
|
11210
|
-
}(),
|
|
11163
|
+
}(), Hr = {
|
|
11211
11164
|
BatchGetDocuments: "batchGet",
|
|
11212
11165
|
Commit: "commit"
|
|
11213
|
-
},
|
|
11166
|
+
}, Yr = "gl-js/ fire/" + u, Wr = /** @class */ function() {
|
|
11214
11167
|
function t(t) {
|
|
11215
11168
|
this.ci = t.ci;
|
|
11216
11169
|
var e = t.ssl ? "https" : "http";
|
|
11217
|
-
this.
|
|
11170
|
+
this.Af = e + "://" + t.host, this.forceLongPolling = t.forceLongPolling;
|
|
11218
11171
|
}
|
|
11219
11172
|
/**
|
|
11220
11173
|
* Modifies the headers for a request, adding any authorization token if
|
|
11221
11174
|
* present and any additional headers for the request.
|
|
11222
|
-
*/ return t.prototype.
|
|
11175
|
+
*/ return t.prototype.Pf = function(t, e) {
|
|
11223
11176
|
if (e) for (var n in e.o) e.o.hasOwnProperty(n) && (t[n] = e.o[n]);
|
|
11224
|
-
t["X-Goog-Api-Client"] =
|
|
11177
|
+
t["X-Goog-Api-Client"] = Yr;
|
|
11225
11178
|
}, t.prototype.Ga = function(t, e, n) {
|
|
11226
|
-
var r = this, i = this.
|
|
11179
|
+
var r = this, i = this.Vf(t);
|
|
11227
11180
|
return new Promise((function(o, u) {
|
|
11228
11181
|
var a = new s.XhrIo;
|
|
11229
11182
|
a.listenOnce(s.EventType.COMPLETE, (function() {
|
|
@@ -11278,14 +11231,14 @@ var Vr = sn(vr, "Use firebase.firestore() instead."), Or = sn(mr, "Use firebase.
|
|
|
11278
11231
|
var p = {
|
|
11279
11232
|
"Content-Type": "text/plain"
|
|
11280
11233
|
};
|
|
11281
|
-
r.
|
|
11234
|
+
r.Pf(p, n), a.send(i, "POST", l, p, 15);
|
|
11282
11235
|
}));
|
|
11283
11236
|
}, t.prototype.Ka = function(t, e, n) {
|
|
11284
11237
|
// The REST API automatically aggregates all of the streamed results, so we
|
|
11285
11238
|
// can just use the normal invoke() method.
|
|
11286
11239
|
return this.Ga(t, e, n);
|
|
11287
11240
|
}, t.prototype.ka = function(t, e) {
|
|
11288
|
-
var n = [ this.
|
|
11241
|
+
var n = [ this.Af, "/", "google.firestore.v1.Firestore", "/", t, "/channel" ], r = s.createWebChannelTransport(), o = {
|
|
11289
11242
|
// Required for backend stickiness, routing behavior is based on this
|
|
11290
11243
|
// parameter.
|
|
11291
11244
|
httpSessionIdParam: "gsessionid",
|
|
@@ -11308,7 +11261,7 @@ var Vr = sn(vr, "Use firebase.firestore() instead."), Or = sn(mr, "Use firebase.
|
|
|
11308
11261
|
},
|
|
11309
11262
|
forceLongPolling: this.forceLongPolling
|
|
11310
11263
|
};
|
|
11311
|
-
this.
|
|
11264
|
+
this.Pf(o.initMessageHeaders, e),
|
|
11312
11265
|
// Sending the custom headers we just added to request.initMessageHeaders
|
|
11313
11266
|
// (Authorization, etc.) will trigger the browser to make a CORS preflight
|
|
11314
11267
|
// request because the XHR will no longer meet the criteria for a "simple"
|
|
@@ -11328,11 +11281,11 @@ var Vr = sn(vr, "Use firebase.firestore() instead."), Or = sn(mr, "Use firebase.
|
|
|
11328
11281
|
var u = n.join("");
|
|
11329
11282
|
ve("Connection", "Creating WebChannel: " + u + " " + o);
|
|
11330
11283
|
var a = r.createWebChannel(u, o), f = !1, l = !1, p = new zr({
|
|
11331
|
-
|
|
11284
|
+
df: function(t) {
|
|
11332
11285
|
l ? ve("Connection", "Not sending because WebChannel is closed:", t) : (f || (ve("Connection", "Opening WebChannel transport."),
|
|
11333
11286
|
a.open(), f = !0), ve("Connection", "WebChannel sending:", t), a.send(t));
|
|
11334
11287
|
},
|
|
11335
|
-
|
|
11288
|
+
ff: function() {
|
|
11336
11289
|
return a.close();
|
|
11337
11290
|
}
|
|
11338
11291
|
}), d = function(t, e) {
|
|
@@ -11360,9 +11313,9 @@ var Vr = sn(vr, "Use firebase.firestore() instead."), Or = sn(mr, "Use firebase.
|
|
|
11360
11313
|
return d(s.WebChannel.EventType.OPEN, (function() {
|
|
11361
11314
|
l || ve("Connection", "WebChannel transport opened.");
|
|
11362
11315
|
})), d(s.WebChannel.EventType.CLOSE, (function() {
|
|
11363
|
-
l || (l = !0, ve("Connection", "WebChannel transport closed"), p.
|
|
11316
|
+
l || (l = !0, ve("Connection", "WebChannel transport closed"), p.Rf());
|
|
11364
11317
|
})), d(s.WebChannel.EventType.ERROR, (function(t) {
|
|
11365
|
-
l || (l = !0, ve("Connection", "WebChannel transport errored:", t), p.
|
|
11318
|
+
l || (l = !0, ve("Connection", "WebChannel transport errored:", t), p.Rf(new c(h.UNAVAILABLE, "The operation could not be completed")));
|
|
11366
11319
|
})), d(s.WebChannel.EventType.MESSAGE, (function(t) {
|
|
11367
11320
|
var e;
|
|
11368
11321
|
if (!l) {
|
|
@@ -11381,25 +11334,25 @@ var Vr = sn(vr, "Use firebase.firestore() instead."), Or = sn(mr, "Use firebase.
|
|
|
11381
11334
|
// lookup by string
|
|
11382
11335
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11383
11336
|
var e = Rt[t];
|
|
11384
|
-
if (void 0 !== e) return
|
|
11337
|
+
if (void 0 !== e) return Mt(e);
|
|
11385
11338
|
}(o), u = i.message;
|
|
11386
11339
|
void 0 === s && (s = h.INTERNAL, u = "Unknown error status: " + o + " with message " + i.message),
|
|
11387
11340
|
// Mark closed so no further events are propagated
|
|
11388
|
-
l = !0, p.
|
|
11389
|
-
} else ve("Connection", "WebChannel received:", n), p.
|
|
11341
|
+
l = !0, p.Rf(new c(s, u)), a.close();
|
|
11342
|
+
} else ve("Connection", "WebChannel received:", n), p.If(n);
|
|
11390
11343
|
}
|
|
11391
11344
|
})), setTimeout((function() {
|
|
11392
11345
|
// Technically we could/should wait for the WebChannel opened event,
|
|
11393
11346
|
// but because we want to send the first message with the WebChannel
|
|
11394
11347
|
// handshake we pretend the channel opened here (asynchronously), and
|
|
11395
11348
|
// then delay the actual open until the first message is sent.
|
|
11396
|
-
p.
|
|
11349
|
+
p.Ef();
|
|
11397
11350
|
}), 0), p;
|
|
11398
11351
|
},
|
|
11399
11352
|
// visible for testing
|
|
11400
|
-
t.prototype.
|
|
11401
|
-
var e =
|
|
11402
|
-
return this.
|
|
11353
|
+
t.prototype.Vf = function(t) {
|
|
11354
|
+
var e = Hr[t];
|
|
11355
|
+
return this.Af + "/v1/projects/" + this.ci.projectId + "/databases/" + this.ci.database + "/documents:" + e;
|
|
11403
11356
|
}, t;
|
|
11404
11357
|
}();
|
|
11405
11358
|
|
|
@@ -11438,7 +11391,7 @@ var Vr = sn(vr, "Use firebase.firestore() instead."), Or = sn(mr, "Use firebase.
|
|
|
11438
11391
|
/**
|
|
11439
11392
|
* Registers the memory-only Firestore build with the components framework.
|
|
11440
11393
|
*/
|
|
11441
|
-
function
|
|
11394
|
+
function Jr(t) {
|
|
11442
11395
|
/**
|
|
11443
11396
|
* Configures Firestore as part of the Firebase SDK by calling registerService.
|
|
11444
11397
|
*
|
|
@@ -11449,10 +11402,10 @@ function Wr(t) {
|
|
|
11449
11402
|
!function(t, e) {
|
|
11450
11403
|
t.INTERNAL.registerComponent(new o.Component("firestore", (function(t) {
|
|
11451
11404
|
return function(t, e) {
|
|
11452
|
-
return new
|
|
11405
|
+
return new mr(t, e, new cr);
|
|
11453
11406
|
}(t.getProvider("app").getImmediate(), t.getProvider("auth-internal"));
|
|
11454
|
-
}), "PUBLIC" /* PUBLIC */).setServiceProps(Object.assign({},
|
|
11455
|
-
}(t), t.registerVersion("@firebase/firestore", "1.14.0
|
|
11407
|
+
}), "PUBLIC" /* PUBLIC */).setServiceProps(Object.assign({}, jr)));
|
|
11408
|
+
}(t), t.registerVersion("@firebase/firestore", "1.14.0");
|
|
11456
11409
|
}
|
|
11457
11410
|
|
|
11458
11411
|
/**
|
|
@@ -11510,11 +11463,11 @@ le.fn(new (/** @class */ function() {
|
|
|
11510
11463
|
},
|
|
11511
11464
|
enumerable: !0,
|
|
11512
11465
|
configurable: !0
|
|
11513
|
-
}), t.prototype.
|
|
11514
|
-
return Promise.resolve(new
|
|
11515
|
-
}, t.prototype.
|
|
11516
|
-
return Br.
|
|
11517
|
-
}, t.prototype.
|
|
11466
|
+
}), t.prototype.K_ = function(t) {
|
|
11467
|
+
return Promise.resolve(new Wr(t));
|
|
11468
|
+
}, t.prototype.Q_ = function() {
|
|
11469
|
+
return Br._f() ? new Br : new Qr;
|
|
11470
|
+
}, t.prototype.H_ = function(t) {
|
|
11518
11471
|
return new ce(t, {
|
|
11519
11472
|
di: !0
|
|
11520
11473
|
});
|
|
@@ -11525,5 +11478,5 @@ le.fn(new (/** @class */ function() {
|
|
|
11525
11478
|
}, t.prototype.btoa = function(t) {
|
|
11526
11479
|
return btoa(t);
|
|
11527
11480
|
}, t;
|
|
11528
|
-
}())),
|
|
11481
|
+
}())), Jr(n), exports.__PRIVATE_registerFirestore = Jr;
|
|
11529
11482
|
//# sourceMappingURL=index.memory.cjs.js.map
|