@laboratoria/sdk-js 8.0.0-alpha.0 → 8.0.0-beta.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/laboratoria-sdk-es.js +405 -395
- package/dist/laboratoria-sdk-umd.js +79 -94
- package/package.json +6 -6
@@ -116,9 +116,9 @@ const Qt = function(n) {
|
|
116
116
|
this.init_();
|
117
117
|
const t = e ? this.byteToCharMapWebSafe_ : this.byteToCharMap_, r = [];
|
118
118
|
for (let i = 0; i < n.length; i += 3) {
|
119
|
-
const s = n[i], o = i + 1 < n.length, a = o ? n[i + 1] : 0, c = i + 2 < n.length, u = c ? n[i + 2] : 0,
|
120
|
-
let
|
121
|
-
c || (O = 64, o || (
|
119
|
+
const s = n[i], o = i + 1 < n.length, a = o ? n[i + 1] : 0, c = i + 2 < n.length, u = c ? n[i + 2] : 0, y = s >> 2, b = (s & 3) << 4 | a >> 4;
|
120
|
+
let A = (a & 15) << 2 | u >> 6, O = u & 63;
|
121
|
+
c || (O = 64, o || (A = 64)), r.push(t[y], t[b], t[A], t[O]);
|
122
122
|
}
|
123
123
|
return r.join("");
|
124
124
|
},
|
@@ -170,8 +170,8 @@ const Qt = function(n) {
|
|
170
170
|
const b = i < n.length ? t[n.charAt(i)] : 64;
|
171
171
|
if (++i, s == null || a == null || u == null || b == null)
|
172
172
|
throw new zn();
|
173
|
-
const
|
174
|
-
if (r.push(
|
173
|
+
const A = s << 2 | a >> 4;
|
174
|
+
if (r.push(A), u !== 64) {
|
175
175
|
const O = a << 4 & 240 | u >> 2;
|
176
176
|
if (r.push(O), b !== 64) {
|
177
177
|
const N = u << 6 & 192 | b;
|
@@ -199,11 +199,11 @@ class zn extends Error {
|
|
199
199
|
super(...arguments), this.name = "DecodeBase64StringError";
|
200
200
|
}
|
201
201
|
}
|
202
|
-
const
|
202
|
+
const qn = function(n) {
|
203
203
|
const e = Qt(n);
|
204
204
|
return Xt.encodeByteArray(e, !0);
|
205
205
|
}, Zt = function(n) {
|
206
|
-
return
|
206
|
+
return qn(n).replace(/\./g, "");
|
207
207
|
}, en = function(n) {
|
208
208
|
try {
|
209
209
|
return Xt.decodeString(n, !0);
|
@@ -228,7 +228,7 @@ const Jn = function(n) {
|
|
228
228
|
* See the License for the specific language governing permissions and
|
229
229
|
* limitations under the License.
|
230
230
|
*/
|
231
|
-
function
|
231
|
+
function Jn() {
|
232
232
|
if (typeof self < "u")
|
233
233
|
return self;
|
234
234
|
if (typeof window < "u")
|
@@ -253,7 +253,7 @@ function qn() {
|
|
253
253
|
* See the License for the specific language governing permissions and
|
254
254
|
* limitations under the License.
|
255
255
|
*/
|
256
|
-
const Gn = () =>
|
256
|
+
const Gn = () => Jn().__FIREBASE_DEFAULTS__, Kn = () => {
|
257
257
|
if (typeof process > "u" || typeof process.env > "u")
|
258
258
|
return;
|
259
259
|
const n = process.env.__FIREBASE_DEFAULTS__;
|
@@ -1043,21 +1043,21 @@ let Xe = {
|
|
1043
1043
|
return n instanceof IDBTransaction && (e === "done" || e === "store") ? !0 : e in n;
|
1044
1044
|
}
|
1045
1045
|
};
|
1046
|
-
function
|
1046
|
+
function Sr(n) {
|
1047
1047
|
Xe = n(Xe);
|
1048
1048
|
}
|
1049
|
-
function
|
1049
|
+
function Ar(n) {
|
1050
1050
|
return n === IDBDatabase.prototype.transaction && !("objectStoreNames" in IDBTransaction.prototype) ? function(e, ...t) {
|
1051
|
-
const r = n.call(
|
1051
|
+
const r = n.call(qe(this), e, ...t);
|
1052
1052
|
return on.set(r, e.sort ? e.sort() : [e]), Y(r);
|
1053
1053
|
} : wr().includes(n) ? function(...e) {
|
1054
|
-
return n.apply(
|
1054
|
+
return n.apply(qe(this), e), Y(sn.get(this));
|
1055
1055
|
} : function(...e) {
|
1056
|
-
return Y(n.apply(
|
1056
|
+
return Y(n.apply(qe(this), e));
|
1057
1057
|
};
|
1058
1058
|
}
|
1059
1059
|
function Cr(n) {
|
1060
|
-
return typeof n == "function" ?
|
1060
|
+
return typeof n == "function" ? Ar(n) : (n instanceof IDBTransaction && Tr(n), br(n, Ir()) ? new Proxy(n, Xe) : n);
|
1061
1061
|
}
|
1062
1062
|
function Y(n) {
|
1063
1063
|
if (n instanceof IDBRequest)
|
@@ -1067,7 +1067,7 @@ function Y(n) {
|
|
1067
1067
|
const e = Cr(n);
|
1068
1068
|
return e !== n && (ze.set(n, e), ct.set(e, n)), e;
|
1069
1069
|
}
|
1070
|
-
const
|
1070
|
+
const qe = (n) => ct.get(n);
|
1071
1071
|
function Rr(n, e, { blocked: t, upgrade: r, blocking: i, terminated: s } = {}) {
|
1072
1072
|
const o = indexedDB.open(n, e), a = Y(o);
|
1073
1073
|
return r && o.addEventListener("upgradeneeded", (c) => {
|
@@ -1082,12 +1082,12 @@ function Rr(n, e, { blocked: t, upgrade: r, blocking: i, terminated: s } = {}) {
|
|
1082
1082
|
}).catch(() => {
|
1083
1083
|
}), a;
|
1084
1084
|
}
|
1085
|
-
const Pr = ["get", "getKey", "getAll", "getAllKeys", "count"], Or = ["put", "add", "delete", "clear"],
|
1085
|
+
const Pr = ["get", "getKey", "getAll", "getAllKeys", "count"], Or = ["put", "add", "delete", "clear"], Je = /* @__PURE__ */ new Map();
|
1086
1086
|
function wt(n, e) {
|
1087
1087
|
if (!(n instanceof IDBDatabase && !(e in n) && typeof e == "string"))
|
1088
1088
|
return;
|
1089
|
-
if (
|
1090
|
-
return
|
1089
|
+
if (Je.get(e))
|
1090
|
+
return Je.get(e);
|
1091
1091
|
const t = e.replace(/FromIndex$/, ""), r = e !== t, i = Or.includes(t);
|
1092
1092
|
if (
|
1093
1093
|
// Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
|
@@ -1102,9 +1102,9 @@ function wt(n, e) {
|
|
1102
1102
|
i && c.done
|
1103
1103
|
]))[0];
|
1104
1104
|
};
|
1105
|
-
return
|
1105
|
+
return Je.set(e, s), s;
|
1106
1106
|
}
|
1107
|
-
|
1107
|
+
Sr((n) => ({
|
1108
1108
|
...n,
|
1109
1109
|
get: (e, t, r) => wt(e, t) || n.get(e, t, r),
|
1110
1110
|
has: (e, t) => !!wt(e, t) || n.has(e, t)
|
@@ -1145,7 +1145,7 @@ function Nr(n) {
|
|
1145
1145
|
const e = n.getComponent();
|
1146
1146
|
return (e == null ? void 0 : e.type) === "VERSION";
|
1147
1147
|
}
|
1148
|
-
const Ze = "@firebase/app", Et = "0.10.
|
1148
|
+
const Ze = "@firebase/app", Et = "0.10.5";
|
1149
1149
|
/**
|
1150
1150
|
* @license
|
1151
1151
|
* Copyright 2019 Google LLC
|
@@ -1162,7 +1162,7 @@ const Ze = "@firebase/app", Et = "0.10.2";
|
|
1162
1162
|
* See the License for the specific language governing permissions and
|
1163
1163
|
* limitations under the License.
|
1164
1164
|
*/
|
1165
|
-
const ne = new rn("@firebase/app"), Dr = "@firebase/app-compat", Lr = "@firebase/analytics-compat", $r = "@firebase/analytics", Mr = "@firebase/app-check-compat", Ur = "@firebase/app-check", jr = "@firebase/auth", Fr = "@firebase/auth-compat", Br = "@firebase/database", Vr = "@firebase/database-compat", Hr = "@firebase/functions", xr = "@firebase/functions-compat", Wr = "@firebase/installations", zr = "@firebase/installations-compat",
|
1165
|
+
const ne = new rn("@firebase/app"), Dr = "@firebase/app-compat", Lr = "@firebase/analytics-compat", $r = "@firebase/analytics", Mr = "@firebase/app-check-compat", Ur = "@firebase/app-check", jr = "@firebase/auth", Fr = "@firebase/auth-compat", Br = "@firebase/database", Vr = "@firebase/database-compat", Hr = "@firebase/functions", xr = "@firebase/functions-compat", Wr = "@firebase/installations", zr = "@firebase/installations-compat", qr = "@firebase/messaging", Jr = "@firebase/messaging-compat", Gr = "@firebase/performance", Kr = "@firebase/performance-compat", Yr = "@firebase/remote-config", Qr = "@firebase/remote-config-compat", Xr = "@firebase/storage", Zr = "@firebase/storage-compat", ei = "@firebase/firestore", ti = "@firebase/vertexai-preview", ni = "@firebase/firestore-compat", ri = "firebase", ii = "10.12.2";
|
1166
1166
|
/**
|
1167
1167
|
* @license
|
1168
1168
|
* Copyright 2019 Google LLC
|
@@ -1179,7 +1179,7 @@ const ne = new rn("@firebase/app"), Dr = "@firebase/app-compat", Lr = "@firebase
|
|
1179
1179
|
* See the License for the specific language governing permissions and
|
1180
1180
|
* limitations under the License.
|
1181
1181
|
*/
|
1182
|
-
const et = "[DEFAULT]",
|
1182
|
+
const et = "[DEFAULT]", si = {
|
1183
1183
|
[Ze]: "fire-core",
|
1184
1184
|
[Dr]: "fire-core-compat",
|
1185
1185
|
[$r]: "fire-analytics",
|
@@ -1194,8 +1194,8 @@ const et = "[DEFAULT]", ii = {
|
|
1194
1194
|
[xr]: "fire-fn-compat",
|
1195
1195
|
[Wr]: "fire-iid",
|
1196
1196
|
[zr]: "fire-iid-compat",
|
1197
|
-
[
|
1198
|
-
[
|
1197
|
+
[qr]: "fire-fcm",
|
1198
|
+
[Jr]: "fire-fcm-compat",
|
1199
1199
|
[Gr]: "fire-perf",
|
1200
1200
|
[Kr]: "fire-perf-compat",
|
1201
1201
|
[Yr]: "fire-rc",
|
@@ -1203,9 +1203,10 @@ const et = "[DEFAULT]", ii = {
|
|
1203
1203
|
[Xr]: "fire-gcs",
|
1204
1204
|
[Zr]: "fire-gcs-compat",
|
1205
1205
|
[ei]: "fire-fst",
|
1206
|
-
[
|
1206
|
+
[ni]: "fire-fst-compat",
|
1207
|
+
[ti]: "fire-vertex",
|
1207
1208
|
"fire-js": "fire-js",
|
1208
|
-
[
|
1209
|
+
[ri]: "fire-js-all"
|
1209
1210
|
};
|
1210
1211
|
/**
|
1211
1212
|
* @license
|
@@ -1223,7 +1224,7 @@ const et = "[DEFAULT]", ii = {
|
|
1223
1224
|
* See the License for the specific language governing permissions and
|
1224
1225
|
* limitations under the License.
|
1225
1226
|
*/
|
1226
|
-
const Ne = /* @__PURE__ */ new Map(),
|
1227
|
+
const Ne = /* @__PURE__ */ new Map(), oi = /* @__PURE__ */ new Map(), tt = /* @__PURE__ */ new Map();
|
1227
1228
|
function Tt(n, e) {
|
1228
1229
|
try {
|
1229
1230
|
n.container.addComponent(e);
|
@@ -1238,7 +1239,7 @@ function me(n) {
|
|
1238
1239
|
tt.set(e, n);
|
1239
1240
|
for (const t of Ne.values())
|
1240
1241
|
Tt(t, n);
|
1241
|
-
for (const t of
|
1242
|
+
for (const t of oi.values())
|
1242
1243
|
Tt(t, n);
|
1243
1244
|
return !0;
|
1244
1245
|
}
|
@@ -1265,7 +1266,7 @@ function j(n) {
|
|
1265
1266
|
* See the License for the specific language governing permissions and
|
1266
1267
|
* limitations under the License.
|
1267
1268
|
*/
|
1268
|
-
const
|
1269
|
+
const ai = {
|
1269
1270
|
"no-app": "No Firebase App '{$appName}' has been created - call initializeApp() first",
|
1270
1271
|
"bad-app-name": "Illegal App name: '{$appName}'",
|
1271
1272
|
"duplicate-app": "Firebase App named '{$appName}' already exists with different options or config",
|
@@ -1280,7 +1281,7 @@ const oi = {
|
|
1280
1281
|
"idb-delete": "Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.",
|
1281
1282
|
"finalization-registry-not-supported": "FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.",
|
1282
1283
|
"invalid-server-app-environment": "FirebaseServerApp is not for use in browser environments."
|
1283
|
-
}, Q = new be("app", "Firebase",
|
1284
|
+
}, Q = new be("app", "Firebase", ai);
|
1284
1285
|
/**
|
1285
1286
|
* @license
|
1286
1287
|
* Copyright 2019 Google LLC
|
@@ -1297,7 +1298,7 @@ const oi = {
|
|
1297
1298
|
* See the License for the specific language governing permissions and
|
1298
1299
|
* limitations under the License.
|
1299
1300
|
*/
|
1300
|
-
class
|
1301
|
+
class ci {
|
1301
1302
|
constructor(e, t, r) {
|
1302
1303
|
this._isDeleted = !1, this._options = Object.assign({}, e), this._config = Object.assign({}, t), this._name = t.name, this._automaticDataCollectionEnabled = t.automaticDataCollectionEnabled, this._container = r, this.container.addComponent(new de(
|
1303
1304
|
"app",
|
@@ -1355,7 +1356,7 @@ class ai {
|
|
1355
1356
|
* See the License for the specific language governing permissions and
|
1356
1357
|
* limitations under the License.
|
1357
1358
|
*/
|
1358
|
-
const we =
|
1359
|
+
const we = ii;
|
1359
1360
|
function cn(n, e = {}) {
|
1360
1361
|
let t = n;
|
1361
1362
|
typeof e != "object" && (e = { name: e });
|
@@ -1378,10 +1379,10 @@ function cn(n, e = {}) {
|
|
1378
1379
|
const o = new gr(i);
|
1379
1380
|
for (const c of tt.values())
|
1380
1381
|
o.addComponent(c);
|
1381
|
-
const a = new
|
1382
|
+
const a = new ci(t, r, o);
|
1382
1383
|
return Ne.set(i, a), a;
|
1383
1384
|
}
|
1384
|
-
function
|
1385
|
+
function li(n = et) {
|
1385
1386
|
const e = Ne.get(n);
|
1386
1387
|
if (!e && n === et && tn())
|
1387
1388
|
return cn();
|
@@ -1391,7 +1392,7 @@ function ci(n = et) {
|
|
1391
1392
|
}
|
1392
1393
|
function oe(n, e, t) {
|
1393
1394
|
var r;
|
1394
|
-
let i = (r =
|
1395
|
+
let i = (r = si[n]) !== null && r !== void 0 ? r : n;
|
1395
1396
|
t && (i += `-${t}`);
|
1396
1397
|
const s = i.match(/\s|\//), o = e.match(/\s|\//);
|
1397
1398
|
if (s || o) {
|
@@ -1424,10 +1425,10 @@ function oe(n, e, t) {
|
|
1424
1425
|
* See the License for the specific language governing permissions and
|
1425
1426
|
* limitations under the License.
|
1426
1427
|
*/
|
1427
|
-
const
|
1428
|
+
const di = "firebase-heartbeat-database", ui = 1, ye = "firebase-heartbeat-store";
|
1428
1429
|
let Ge = null;
|
1429
1430
|
function ln() {
|
1430
|
-
return Ge || (Ge = Rr(
|
1431
|
+
return Ge || (Ge = Rr(di, ui, {
|
1431
1432
|
upgrade: (n, e) => {
|
1432
1433
|
switch (e) {
|
1433
1434
|
case 0:
|
@@ -1444,7 +1445,7 @@ function ln() {
|
|
1444
1445
|
});
|
1445
1446
|
})), Ge;
|
1446
1447
|
}
|
1447
|
-
async function
|
1448
|
+
async function hi(n) {
|
1448
1449
|
try {
|
1449
1450
|
const t = (await ln()).transaction(ye), r = await t.objectStore(ye).get(dn(n));
|
1450
1451
|
return await t.done, r;
|
@@ -1459,7 +1460,7 @@ async function ui(n) {
|
|
1459
1460
|
}
|
1460
1461
|
}
|
1461
1462
|
}
|
1462
|
-
async function
|
1463
|
+
async function St(n, e) {
|
1463
1464
|
try {
|
1464
1465
|
const r = (await ln()).transaction(ye, "readwrite");
|
1465
1466
|
await r.objectStore(ye).put(e, dn(n)), await r.done;
|
@@ -1493,12 +1494,12 @@ function dn(n) {
|
|
1493
1494
|
* See the License for the specific language governing permissions and
|
1494
1495
|
* limitations under the License.
|
1495
1496
|
*/
|
1496
|
-
const
|
1497
|
-
class
|
1497
|
+
const fi = 1024, pi = 30 * 24 * 60 * 60 * 1e3;
|
1498
|
+
class gi {
|
1498
1499
|
constructor(e) {
|
1499
1500
|
this.container = e, this._heartbeatsCache = null;
|
1500
1501
|
const t = this.container.getProvider("app").getImmediate();
|
1501
|
-
this._storage = new
|
1502
|
+
this._storage = new yi(t), this._heartbeatsCachePromise = this._storage.read().then((r) => (this._heartbeatsCache = r, r));
|
1502
1503
|
}
|
1503
1504
|
/**
|
1504
1505
|
* Called to report a heartbeat. The function will generate
|
@@ -1509,11 +1510,11 @@ class pi {
|
|
1509
1510
|
*/
|
1510
1511
|
async triggerHeartbeat() {
|
1511
1512
|
var e, t;
|
1512
|
-
const i = this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(), s =
|
1513
|
+
const i = this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(), s = At();
|
1513
1514
|
if (!(((e = this._heartbeatsCache) === null || e === void 0 ? void 0 : e.heartbeats) == null && (this._heartbeatsCache = await this._heartbeatsCachePromise, ((t = this._heartbeatsCache) === null || t === void 0 ? void 0 : t.heartbeats) == null)) && !(this._heartbeatsCache.lastSentHeartbeatDate === s || this._heartbeatsCache.heartbeats.some((o) => o.date === s)))
|
1514
1515
|
return this._heartbeatsCache.heartbeats.push({ date: s, agent: i }), this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter((o) => {
|
1515
1516
|
const a = new Date(o.date).valueOf();
|
1516
|
-
return Date.now() - a <=
|
1517
|
+
return Date.now() - a <= pi;
|
1517
1518
|
}), this._storage.overwrite(this._heartbeatsCache);
|
1518
1519
|
}
|
1519
1520
|
/**
|
@@ -1527,14 +1528,14 @@ class pi {
|
|
1527
1528
|
var e;
|
1528
1529
|
if (this._heartbeatsCache === null && await this._heartbeatsCachePromise, ((e = this._heartbeatsCache) === null || e === void 0 ? void 0 : e.heartbeats) == null || this._heartbeatsCache.heartbeats.length === 0)
|
1529
1530
|
return "";
|
1530
|
-
const t =
|
1531
|
+
const t = At(), { heartbeatsToSend: r, unsentEntries: i } = mi(this._heartbeatsCache.heartbeats), s = Zt(JSON.stringify({ version: 2, heartbeats: r }));
|
1531
1532
|
return this._heartbeatsCache.lastSentHeartbeatDate = t, i.length > 0 ? (this._heartbeatsCache.heartbeats = i, await this._storage.overwrite(this._heartbeatsCache)) : (this._heartbeatsCache.heartbeats = [], this._storage.overwrite(this._heartbeatsCache)), s;
|
1532
1533
|
}
|
1533
1534
|
}
|
1534
|
-
function
|
1535
|
+
function At() {
|
1535
1536
|
return (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
|
1536
1537
|
}
|
1537
|
-
function
|
1538
|
+
function mi(n, e = fi) {
|
1538
1539
|
const t = [];
|
1539
1540
|
let r = n.slice();
|
1540
1541
|
for (const i of n) {
|
@@ -1558,7 +1559,7 @@ function gi(n, e = hi) {
|
|
1558
1559
|
unsentEntries: r
|
1559
1560
|
};
|
1560
1561
|
}
|
1561
|
-
class
|
1562
|
+
class yi {
|
1562
1563
|
constructor(e) {
|
1563
1564
|
this.app = e, this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();
|
1564
1565
|
}
|
@@ -1570,7 +1571,7 @@ class mi {
|
|
1570
1571
|
*/
|
1571
1572
|
async read() {
|
1572
1573
|
if (await this._canUseIndexedDBPromise) {
|
1573
|
-
const t = await
|
1574
|
+
const t = await hi(this.app);
|
1574
1575
|
return t != null && t.heartbeats ? t : { heartbeats: [] };
|
1575
1576
|
} else
|
1576
1577
|
return { heartbeats: [] };
|
@@ -1580,7 +1581,7 @@ class mi {
|
|
1580
1581
|
var t;
|
1581
1582
|
if (await this._canUseIndexedDBPromise) {
|
1582
1583
|
const i = await this.read();
|
1583
|
-
return
|
1584
|
+
return St(this.app, {
|
1584
1585
|
lastSentHeartbeatDate: (t = e.lastSentHeartbeatDate) !== null && t !== void 0 ? t : i.lastSentHeartbeatDate,
|
1585
1586
|
heartbeats: e.heartbeats
|
1586
1587
|
});
|
@@ -1592,7 +1593,7 @@ class mi {
|
|
1592
1593
|
var t;
|
1593
1594
|
if (await this._canUseIndexedDBPromise) {
|
1594
1595
|
const i = await this.read();
|
1595
|
-
return
|
1596
|
+
return St(this.app, {
|
1596
1597
|
lastSentHeartbeatDate: (t = e.lastSentHeartbeatDate) !== null && t !== void 0 ? t : i.lastSentHeartbeatDate,
|
1597
1598
|
heartbeats: [
|
1598
1599
|
...i.heartbeats,
|
@@ -1625,7 +1626,7 @@ function Ct(n) {
|
|
1625
1626
|
* See the License for the specific language governing permissions and
|
1626
1627
|
* limitations under the License.
|
1627
1628
|
*/
|
1628
|
-
function
|
1629
|
+
function _i(n) {
|
1629
1630
|
me(new de(
|
1630
1631
|
"platform-logger",
|
1631
1632
|
(e) => new kr(e),
|
@@ -1633,13 +1634,13 @@ function yi(n) {
|
|
1633
1634
|
/* ComponentType.PRIVATE */
|
1634
1635
|
)), me(new de(
|
1635
1636
|
"heartbeat",
|
1636
|
-
(e) => new
|
1637
|
+
(e) => new gi(e),
|
1637
1638
|
"PRIVATE"
|
1638
1639
|
/* ComponentType.PRIVATE */
|
1639
1640
|
)), oe(Ze, Et, n), oe(Ze, Et, "esm2017"), oe("fire-js", "");
|
1640
1641
|
}
|
1641
|
-
|
1642
|
-
var
|
1642
|
+
_i("");
|
1643
|
+
var vi = "firebase", bi = "10.12.2";
|
1643
1644
|
/**
|
1644
1645
|
* @license
|
1645
1646
|
* Copyright 2020 Google LLC
|
@@ -1656,7 +1657,7 @@ var _i = "firebase", vi = "10.11.1";
|
|
1656
1657
|
* See the License for the specific language governing permissions and
|
1657
1658
|
* limitations under the License.
|
1658
1659
|
*/
|
1659
|
-
oe(
|
1660
|
+
oe(vi, bi, "app");
|
1660
1661
|
function lt(n, e) {
|
1661
1662
|
var t = {};
|
1662
1663
|
for (var r in n)
|
@@ -1671,7 +1672,7 @@ function un() {
|
|
1671
1672
|
"dependent-sdk-initialized-before-auth": "Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."
|
1672
1673
|
};
|
1673
1674
|
}
|
1674
|
-
const
|
1675
|
+
const Ii = un, hn = new be("auth", "Firebase", un());
|
1675
1676
|
/**
|
1676
1677
|
* @license
|
1677
1678
|
* Copyright 2020 Google LLC
|
@@ -1689,7 +1690,7 @@ const bi = un, hn = new be("auth", "Firebase", un());
|
|
1689
1690
|
* limitations under the License.
|
1690
1691
|
*/
|
1691
1692
|
const De = new rn("@firebase/auth");
|
1692
|
-
function
|
1693
|
+
function wi(n, ...e) {
|
1693
1694
|
De.logLevel <= T.WARN && De.warn(`Auth (${we}): ${n}`, ...e);
|
1694
1695
|
}
|
1695
1696
|
function Ce(n, ...e) {
|
@@ -1718,7 +1719,7 @@ function $(n, ...e) {
|
|
1718
1719
|
return dt(n, ...e);
|
1719
1720
|
}
|
1720
1721
|
function fn(n, e, t) {
|
1721
|
-
const r = Object.assign(Object.assign({},
|
1722
|
+
const r = Object.assign(Object.assign({}, Ii()), { [e]: t });
|
1722
1723
|
return new be("auth", "Firebase", r).create(e, {
|
1723
1724
|
appName: n.name
|
1724
1725
|
});
|
@@ -1733,7 +1734,7 @@ function dt(n, ...e) {
|
|
1733
1734
|
}
|
1734
1735
|
return hn.create(n, ...e);
|
1735
1736
|
}
|
1736
|
-
function
|
1737
|
+
function v(n, e, ...t) {
|
1737
1738
|
if (!n)
|
1738
1739
|
throw dt(e, ...t);
|
1739
1740
|
}
|
@@ -1764,7 +1765,7 @@ function nt() {
|
|
1764
1765
|
var n;
|
1765
1766
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
1766
1767
|
}
|
1767
|
-
function
|
1768
|
+
function Ei() {
|
1768
1769
|
return Rt() === "http:" || Rt() === "https:";
|
1769
1770
|
}
|
1770
1771
|
function Rt() {
|
@@ -1787,15 +1788,15 @@ function Rt() {
|
|
1787
1788
|
* See the License for the specific language governing permissions and
|
1788
1789
|
* limitations under the License.
|
1789
1790
|
*/
|
1790
|
-
function
|
1791
|
+
function Ti() {
|
1791
1792
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
1792
1793
|
// This is especially true for Cordova apps which have unreliable
|
1793
1794
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
1794
1795
|
// installed which overwrites the native navigator.onLine value and
|
1795
1796
|
// defines navigator.connection.
|
1796
|
-
(
|
1797
|
+
(Ei() || er() || "connection" in navigator) ? navigator.onLine : !0;
|
1797
1798
|
}
|
1798
|
-
function
|
1799
|
+
function Si() {
|
1799
1800
|
if (typeof navigator > "u")
|
1800
1801
|
return null;
|
1801
1802
|
const n = navigator;
|
@@ -1828,7 +1829,7 @@ class Ee {
|
|
1828
1829
|
this.shortDelay = e, this.longDelay = t, H(t > e, "Short delay should be less than long delay!"), this.isMobile = Zn() || tr();
|
1829
1830
|
}
|
1830
1831
|
get() {
|
1831
|
-
return
|
1832
|
+
return Ti() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
1832
1833
|
}
|
1833
1834
|
}
|
1834
1835
|
/**
|
@@ -2013,7 +2014,7 @@ const Ai = {
|
|
2013
2014
|
* See the License for the specific language governing permissions and
|
2014
2015
|
* limitations under the License.
|
2015
2016
|
*/
|
2016
|
-
const
|
2017
|
+
const Ci = new Ee(3e4, 6e4);
|
2017
2018
|
function ee(n, e) {
|
2018
2019
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
2019
2020
|
}
|
@@ -2041,28 +2042,28 @@ async function gn(n, e, t) {
|
|
2041
2042
|
n._canInitEmulator = !1;
|
2042
2043
|
const r = Object.assign(Object.assign({}, Ai), e);
|
2043
2044
|
try {
|
2044
|
-
const i = new
|
2045
|
+
const i = new Pi(n), s = await Promise.race([
|
2045
2046
|
t(),
|
2046
2047
|
i.promise
|
2047
2048
|
]);
|
2048
2049
|
i.clearNetworkTimeout();
|
2049
2050
|
const o = await s.json();
|
2050
2051
|
if ("needConfirmation" in o)
|
2051
|
-
throw
|
2052
|
+
throw Ae(n, "account-exists-with-different-credential", o);
|
2052
2053
|
if (s.ok && !("errorMessage" in o))
|
2053
2054
|
return o;
|
2054
2055
|
{
|
2055
2056
|
const a = s.ok ? o.errorMessage : o.error.message, [c, u] = a.split(" : ");
|
2056
2057
|
if (c === "FEDERATED_USER_ID_ALREADY_LINKED")
|
2057
|
-
throw
|
2058
|
+
throw Ae(n, "credential-already-in-use", o);
|
2058
2059
|
if (c === "EMAIL_EXISTS")
|
2059
|
-
throw
|
2060
|
+
throw Ae(n, "email-already-in-use", o);
|
2060
2061
|
if (c === "USER_DISABLED")
|
2061
|
-
throw
|
2062
|
-
const
|
2062
|
+
throw Ae(n, "user-disabled", o);
|
2063
|
+
const y = r[c] || c.toLowerCase().replace(/[_\s]+/g, "-");
|
2063
2064
|
if (u)
|
2064
|
-
throw fn(n,
|
2065
|
-
L(n,
|
2065
|
+
throw fn(n, y, u);
|
2066
|
+
L(n, y);
|
2066
2067
|
}
|
2067
2068
|
} catch (i) {
|
2068
2069
|
if (i instanceof Z)
|
@@ -2080,7 +2081,7 @@ function mn(n, e, t, r) {
|
|
2080
2081
|
const i = `${e}${t}?${r}`;
|
2081
2082
|
return n.config.emulator ? ut(n.config, i) : `${n.config.apiScheme}://${i}`;
|
2082
2083
|
}
|
2083
|
-
function
|
2084
|
+
function Ri(n) {
|
2084
2085
|
switch (n) {
|
2085
2086
|
case "ENFORCE":
|
2086
2087
|
return "ENFORCE";
|
@@ -2092,21 +2093,21 @@ function Ci(n) {
|
|
2092
2093
|
return "ENFORCEMENT_STATE_UNSPECIFIED";
|
2093
2094
|
}
|
2094
2095
|
}
|
2095
|
-
class
|
2096
|
+
class Pi {
|
2096
2097
|
constructor(e) {
|
2097
2098
|
this.auth = e, this.timer = null, this.promise = new Promise((t, r) => {
|
2098
2099
|
this.timer = setTimeout(() => r($(
|
2099
2100
|
this.auth,
|
2100
2101
|
"network-request-failed"
|
2101
2102
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
2102
|
-
)),
|
2103
|
+
)), Ci.get());
|
2103
2104
|
});
|
2104
2105
|
}
|
2105
2106
|
clearNetworkTimeout() {
|
2106
2107
|
clearTimeout(this.timer);
|
2107
2108
|
}
|
2108
2109
|
}
|
2109
|
-
function
|
2110
|
+
function Ae(n, e, t) {
|
2110
2111
|
const r = {
|
2111
2112
|
appName: n.name
|
2112
2113
|
};
|
@@ -2117,7 +2118,7 @@ function Se(n, e, t) {
|
|
2117
2118
|
function Pt(n) {
|
2118
2119
|
return n !== void 0 && n.enterprise !== void 0;
|
2119
2120
|
}
|
2120
|
-
class
|
2121
|
+
class Oi {
|
2121
2122
|
constructor(e) {
|
2122
2123
|
if (this.siteKey = "", this.recaptchaEnforcementState = [], e.recaptchaKey === void 0)
|
2123
2124
|
throw new Error("recaptchaKey undefined");
|
@@ -2134,7 +2135,7 @@ class Pi {
|
|
2134
2135
|
return null;
|
2135
2136
|
for (const t of this.recaptchaEnforcementState)
|
2136
2137
|
if (t.provider && t.provider === e)
|
2137
|
-
return
|
2138
|
+
return Ri(t.enforcementState);
|
2138
2139
|
return null;
|
2139
2140
|
}
|
2140
2141
|
/**
|
@@ -2147,7 +2148,7 @@ class Pi {
|
|
2147
2148
|
return this.getProviderEnforcementState(e) === "ENFORCE" || this.getProviderEnforcementState(e) === "AUDIT";
|
2148
2149
|
}
|
2149
2150
|
}
|
2150
|
-
async function
|
2151
|
+
async function ki(n, e) {
|
2151
2152
|
return W(n, "GET", "/v2/recaptchaConfig", ee(n, e));
|
2152
2153
|
}
|
2153
2154
|
/**
|
@@ -2166,7 +2167,7 @@ async function Oi(n, e) {
|
|
2166
2167
|
* See the License for the specific language governing permissions and
|
2167
2168
|
* limitations under the License.
|
2168
2169
|
*/
|
2169
|
-
async function
|
2170
|
+
async function Ni(n, e) {
|
2170
2171
|
return W(n, "POST", "/v1/accounts:delete", e);
|
2171
2172
|
}
|
2172
2173
|
async function yn(n, e) {
|
@@ -2197,9 +2198,9 @@ function ge(n) {
|
|
2197
2198
|
} catch {
|
2198
2199
|
}
|
2199
2200
|
}
|
2200
|
-
async function
|
2201
|
+
async function Di(n, e = !1) {
|
2201
2202
|
const t = x(n), r = await t.getIdToken(e), i = ht(r);
|
2202
|
-
|
2203
|
+
v(
|
2203
2204
|
i && i.exp && i.auth_time && i.iat,
|
2204
2205
|
t.auth,
|
2205
2206
|
"internal-error"
|
@@ -2232,15 +2233,15 @@ function ht(n) {
|
|
2232
2233
|
}
|
2233
2234
|
function Ot(n) {
|
2234
2235
|
const e = ht(n);
|
2235
|
-
return
|
2236
|
+
return v(
|
2236
2237
|
e,
|
2237
2238
|
"internal-error"
|
2238
2239
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2239
|
-
),
|
2240
|
+
), v(
|
2240
2241
|
typeof e.exp < "u",
|
2241
2242
|
"internal-error"
|
2242
2243
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2243
|
-
),
|
2244
|
+
), v(
|
2244
2245
|
typeof e.iat < "u",
|
2245
2246
|
"internal-error"
|
2246
2247
|
/* AuthErrorCode.INTERNAL_ERROR */
|
@@ -2268,10 +2269,10 @@ async function _e(n, e, t = !1) {
|
|
2268
2269
|
try {
|
2269
2270
|
return await e;
|
2270
2271
|
} catch (r) {
|
2271
|
-
throw r instanceof Z &&
|
2272
|
+
throw r instanceof Z && Li(r) && n.auth.currentUser === n && await n.auth.signOut(), r;
|
2272
2273
|
}
|
2273
2274
|
}
|
2274
|
-
function
|
2275
|
+
function Li({ code: n }) {
|
2275
2276
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
2276
2277
|
}
|
2277
2278
|
/**
|
@@ -2290,7 +2291,7 @@ function Di({ code: n }) {
|
|
2290
2291
|
* See the License for the specific language governing permissions and
|
2291
2292
|
* limitations under the License.
|
2292
2293
|
*/
|
2293
|
-
class
|
2294
|
+
class $i {
|
2294
2295
|
constructor(e) {
|
2295
2296
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
2296
2297
|
}
|
@@ -2388,7 +2389,7 @@ class rt {
|
|
2388
2389
|
async function Le(n) {
|
2389
2390
|
var e;
|
2390
2391
|
const t = n.auth, r = await n.getIdToken(), i = await _e(n, yn(t, { idToken: r }));
|
2391
|
-
|
2392
|
+
v(
|
2392
2393
|
i == null ? void 0 : i.users.length,
|
2393
2394
|
t,
|
2394
2395
|
"internal-error"
|
@@ -2396,7 +2397,7 @@ async function Le(n) {
|
|
2396
2397
|
);
|
2397
2398
|
const s = i.users[0];
|
2398
2399
|
n._notifyReloadListener(s);
|
2399
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? _n(s.providerUserInfo) : [], a =
|
2400
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? _n(s.providerUserInfo) : [], a = Ui(n.providerData, o), c = n.isAnonymous, u = !(n.email && s.passwordHash) && !(a != null && a.length), y = c ? u : !1, b = {
|
2400
2401
|
uid: s.localId,
|
2401
2402
|
displayName: s.displayName || null,
|
2402
2403
|
photoURL: s.photoUrl || null,
|
@@ -2406,15 +2407,15 @@ async function Le(n) {
|
|
2406
2407
|
tenantId: s.tenantId || null,
|
2407
2408
|
providerData: a,
|
2408
2409
|
metadata: new rt(s.createdAt, s.lastLoginAt),
|
2409
|
-
isAnonymous:
|
2410
|
+
isAnonymous: y
|
2410
2411
|
};
|
2411
2412
|
Object.assign(n, b);
|
2412
2413
|
}
|
2413
|
-
async function
|
2414
|
+
async function Mi(n) {
|
2414
2415
|
const e = x(n);
|
2415
2416
|
await Le(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
2416
2417
|
}
|
2417
|
-
function
|
2418
|
+
function Ui(n, e) {
|
2418
2419
|
return [...n.filter((r) => !e.some((i) => i.providerId === r.providerId)), ...e];
|
2419
2420
|
}
|
2420
2421
|
function _n(n) {
|
@@ -2446,7 +2447,7 @@ function _n(n) {
|
|
2446
2447
|
* See the License for the specific language governing permissions and
|
2447
2448
|
* limitations under the License.
|
2448
2449
|
*/
|
2449
|
-
async function
|
2450
|
+
async function ji(n, e) {
|
2450
2451
|
const t = await gn(n, {}, async () => {
|
2451
2452
|
const r = Ie({
|
2452
2453
|
grant_type: "refresh_token",
|
@@ -2467,7 +2468,7 @@ async function Ui(n, e) {
|
|
2467
2468
|
refreshToken: t.refresh_token
|
2468
2469
|
};
|
2469
2470
|
}
|
2470
|
-
async function
|
2471
|
+
async function Fi(n, e) {
|
2471
2472
|
return W(n, "POST", "/v2/accounts:revokeToken", ee(n, e));
|
2472
2473
|
}
|
2473
2474
|
/**
|
@@ -2494,15 +2495,15 @@ class ae {
|
|
2494
2495
|
return !this.expirationTime || Date.now() > this.expirationTime - 3e4;
|
2495
2496
|
}
|
2496
2497
|
updateFromServerResponse(e) {
|
2497
|
-
|
2498
|
+
v(
|
2498
2499
|
e.idToken,
|
2499
2500
|
"internal-error"
|
2500
2501
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2501
|
-
),
|
2502
|
+
), v(
|
2502
2503
|
typeof e.idToken < "u",
|
2503
2504
|
"internal-error"
|
2504
2505
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2505
|
-
),
|
2506
|
+
), v(
|
2506
2507
|
typeof e.refreshToken < "u",
|
2507
2508
|
"internal-error"
|
2508
2509
|
/* AuthErrorCode.INTERNAL_ERROR */
|
@@ -2511,7 +2512,7 @@ class ae {
|
|
2511
2512
|
this.updateTokensAndExpiration(e.idToken, e.refreshToken, t);
|
2512
2513
|
}
|
2513
2514
|
updateFromIdToken(e) {
|
2514
|
-
|
2515
|
+
v(
|
2515
2516
|
e.length !== 0,
|
2516
2517
|
"internal-error"
|
2517
2518
|
/* AuthErrorCode.INTERNAL_ERROR */
|
@@ -2520,7 +2521,7 @@ class ae {
|
|
2520
2521
|
this.updateTokensAndExpiration(e, null, t);
|
2521
2522
|
}
|
2522
2523
|
async getToken(e, t = !1) {
|
2523
|
-
return !t && this.accessToken && !this.isExpired ? this.accessToken : (
|
2524
|
+
return !t && this.accessToken && !this.isExpired ? this.accessToken : (v(
|
2524
2525
|
this.refreshToken,
|
2525
2526
|
e,
|
2526
2527
|
"user-token-expired"
|
@@ -2531,7 +2532,7 @@ class ae {
|
|
2531
2532
|
this.refreshToken = null;
|
2532
2533
|
}
|
2533
2534
|
async refresh(e, t) {
|
2534
|
-
const { accessToken: r, refreshToken: i, expiresIn: s } = await
|
2535
|
+
const { accessToken: r, refreshToken: i, expiresIn: s } = await ji(e, t);
|
2535
2536
|
this.updateTokensAndExpiration(r, i, Number(s));
|
2536
2537
|
}
|
2537
2538
|
updateTokensAndExpiration(e, t, r) {
|
@@ -2539,11 +2540,11 @@ class ae {
|
|
2539
2540
|
}
|
2540
2541
|
static fromJSON(e, t) {
|
2541
2542
|
const { refreshToken: r, accessToken: i, expirationTime: s } = t, o = new ae();
|
2542
|
-
return r && (
|
2543
|
+
return r && (v(typeof r == "string", "internal-error", {
|
2543
2544
|
appName: e
|
2544
|
-
}), o.refreshToken = r), i && (
|
2545
|
+
}), o.refreshToken = r), i && (v(typeof i == "string", "internal-error", {
|
2545
2546
|
appName: e
|
2546
|
-
}), o.accessToken = i), s && (
|
2547
|
+
}), o.accessToken = i), s && (v(typeof s == "number", "internal-error", {
|
2547
2548
|
appName: e
|
2548
2549
|
}), o.expirationTime = s), o;
|
2549
2550
|
}
|
@@ -2581,16 +2582,16 @@ class ae {
|
|
2581
2582
|
* limitations under the License.
|
2582
2583
|
*/
|
2583
2584
|
function z(n, e) {
|
2584
|
-
|
2585
|
+
v(typeof n == "string" || typeof n > "u", "internal-error", { appName: e });
|
2585
2586
|
}
|
2586
2587
|
class B {
|
2587
2588
|
constructor(e) {
|
2588
2589
|
var { uid: t, auth: r, stsTokenManager: i } = e, s = lt(e, ["uid", "auth", "stsTokenManager"]);
|
2589
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
2590
|
+
this.providerId = "firebase", this.proactiveRefresh = new $i(this), this.reloadUserInfo = null, this.reloadListener = null, this.uid = t, this.auth = r, this.stsTokenManager = i, this.accessToken = i.accessToken, this.displayName = s.displayName || null, this.email = s.email || null, this.emailVerified = s.emailVerified || !1, this.phoneNumber = s.phoneNumber || null, this.photoURL = s.photoURL || null, this.isAnonymous = s.isAnonymous || !1, this.tenantId = s.tenantId || null, this.providerData = s.providerData ? [...s.providerData] : [], this.metadata = new rt(s.createdAt || void 0, s.lastLoginAt || void 0);
|
2590
2591
|
}
|
2591
2592
|
async getIdToken(e) {
|
2592
2593
|
const t = await _e(this, this.stsTokenManager.getToken(this.auth, e));
|
2593
|
-
return
|
2594
|
+
return v(
|
2594
2595
|
t,
|
2595
2596
|
this.auth,
|
2596
2597
|
"internal-error"
|
@@ -2598,13 +2599,13 @@ class B {
|
|
2598
2599
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
2599
2600
|
}
|
2600
2601
|
getIdTokenResult(e) {
|
2601
|
-
return
|
2602
|
+
return Di(this, e);
|
2602
2603
|
}
|
2603
2604
|
reload() {
|
2604
|
-
return
|
2605
|
+
return Mi(this);
|
2605
2606
|
}
|
2606
2607
|
_assign(e) {
|
2607
|
-
this !== e && (
|
2608
|
+
this !== e && (v(
|
2608
2609
|
this.uid === e.uid,
|
2609
2610
|
this.auth,
|
2610
2611
|
"internal-error"
|
@@ -2616,7 +2617,7 @@ class B {
|
|
2616
2617
|
return t.metadata._copy(this.metadata), t;
|
2617
2618
|
}
|
2618
2619
|
_onReload(e) {
|
2619
|
-
|
2620
|
+
v(
|
2620
2621
|
!this.reloadListener,
|
2621
2622
|
this.auth,
|
2622
2623
|
"internal-error"
|
@@ -2640,7 +2641,7 @@ class B {
|
|
2640
2641
|
if (j(this.auth.app))
|
2641
2642
|
return Promise.reject(X(this.auth));
|
2642
2643
|
const e = await this.getIdToken();
|
2643
|
-
return await _e(this,
|
2644
|
+
return await _e(this, Ni(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
2644
2645
|
}
|
2645
2646
|
toJSON() {
|
2646
2647
|
return Object.assign(Object.assign({
|
@@ -2667,46 +2668,46 @@ class B {
|
|
2667
2668
|
return this.stsTokenManager.refreshToken || "";
|
2668
2669
|
}
|
2669
2670
|
static _fromJSON(e, t) {
|
2670
|
-
var r, i, s, o, a, c, u,
|
2671
|
-
const b = (r = t.displayName) !== null && r !== void 0 ? r : void 0,
|
2672
|
-
|
2671
|
+
var r, i, s, o, a, c, u, y;
|
2672
|
+
const b = (r = t.displayName) !== null && r !== void 0 ? r : void 0, A = (i = t.email) !== null && i !== void 0 ? i : void 0, O = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, N = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, _ = (a = t.tenantId) !== null && a !== void 0 ? a : void 0, I = (c = t._redirectEventId) !== null && c !== void 0 ? c : void 0, k = (u = t.createdAt) !== null && u !== void 0 ? u : void 0, C = (y = t.lastLoginAt) !== null && y !== void 0 ? y : void 0, { uid: U, emailVerified: D, isAnonymous: l, providerData: m, stsTokenManager: d } = t;
|
2673
|
+
v(
|
2673
2674
|
U && d,
|
2674
2675
|
e,
|
2675
2676
|
"internal-error"
|
2676
2677
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2677
2678
|
);
|
2678
2679
|
const w = ae.fromJSON(this.name, d);
|
2679
|
-
|
2680
|
+
v(
|
2680
2681
|
typeof U == "string",
|
2681
2682
|
e,
|
2682
2683
|
"internal-error"
|
2683
2684
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2684
|
-
), z(b, e.name), z(
|
2685
|
+
), z(b, e.name), z(A, e.name), v(
|
2685
2686
|
typeof D == "boolean",
|
2686
2687
|
e,
|
2687
2688
|
"internal-error"
|
2688
2689
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2689
|
-
),
|
2690
|
+
), v(
|
2690
2691
|
typeof l == "boolean",
|
2691
2692
|
e,
|
2692
2693
|
"internal-error"
|
2693
2694
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2694
|
-
), z(O, e.name), z(N, e.name), z(
|
2695
|
+
), z(O, e.name), z(N, e.name), z(_, e.name), z(I, e.name), z(k, e.name), z(C, e.name);
|
2695
2696
|
const E = new B({
|
2696
2697
|
uid: U,
|
2697
2698
|
auth: e,
|
2698
|
-
email:
|
2699
|
+
email: A,
|
2699
2700
|
emailVerified: D,
|
2700
2701
|
displayName: b,
|
2701
2702
|
isAnonymous: l,
|
2702
2703
|
photoURL: N,
|
2703
2704
|
phoneNumber: O,
|
2704
|
-
tenantId:
|
2705
|
+
tenantId: _,
|
2705
2706
|
stsTokenManager: w,
|
2706
2707
|
createdAt: k,
|
2707
2708
|
lastLoginAt: C
|
2708
2709
|
});
|
2709
|
-
return m && Array.isArray(m) && (E.providerData = m.map((
|
2710
|
+
return m && Array.isArray(m) && (E.providerData = m.map((S) => Object.assign({}, S))), I && (E._redirectEventId = I), E;
|
2710
2711
|
}
|
2711
2712
|
/**
|
2712
2713
|
* Initialize a User from an idToken server response
|
@@ -2731,7 +2732,7 @@ class B {
|
|
2731
2732
|
*/
|
2732
2733
|
static async _fromGetAccountInfoResponse(e, t, r) {
|
2733
2734
|
const i = t.users[0];
|
2734
|
-
|
2735
|
+
v(
|
2735
2736
|
i.localId !== void 0,
|
2736
2737
|
"internal-error"
|
2737
2738
|
/* AuthErrorCode.INTERNAL_ERROR */
|
@@ -2880,9 +2881,9 @@ class ce {
|
|
2880
2881
|
let a = null;
|
2881
2882
|
for (const u of t)
|
2882
2883
|
try {
|
2883
|
-
const
|
2884
|
-
if (
|
2885
|
-
const b = B._fromJSON(e,
|
2884
|
+
const y = await u._get(o);
|
2885
|
+
if (y) {
|
2886
|
+
const b = B._fromJSON(e, y);
|
2886
2887
|
u !== s && (a = b), s = u;
|
2887
2888
|
break;
|
2888
2889
|
}
|
@@ -2930,7 +2931,7 @@ function Dt(n) {
|
|
2930
2931
|
return "Silk";
|
2931
2932
|
if (Tn(e))
|
2932
2933
|
return "Blackberry";
|
2933
|
-
if (
|
2934
|
+
if (Sn(e))
|
2934
2935
|
return "Webos";
|
2935
2936
|
if (ft(e))
|
2936
2937
|
return "Safari";
|
@@ -2964,23 +2965,23 @@ function En(n = P()) {
|
|
2964
2965
|
function Tn(n = P()) {
|
2965
2966
|
return /blackberry/i.test(n);
|
2966
2967
|
}
|
2967
|
-
function
|
2968
|
+
function Sn(n = P()) {
|
2968
2969
|
return /webos/i.test(n);
|
2969
2970
|
}
|
2970
2971
|
function Be(n = P()) {
|
2971
2972
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
2972
2973
|
}
|
2973
|
-
function
|
2974
|
+
function Bi(n = P()) {
|
2974
2975
|
var e;
|
2975
2976
|
return Be(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
2976
2977
|
}
|
2977
|
-
function
|
2978
|
+
function Vi() {
|
2978
2979
|
return nr() && document.documentMode === 10;
|
2979
2980
|
}
|
2980
|
-
function
|
2981
|
-
return Be(n) || En(n) ||
|
2981
|
+
function An(n = P()) {
|
2982
|
+
return Be(n) || En(n) || Sn(n) || Tn(n) || /windows phone/i.test(n) || wn(n);
|
2982
2983
|
}
|
2983
|
-
function
|
2984
|
+
function Hi() {
|
2984
2985
|
try {
|
2985
2986
|
return !!(window && window !== window.top);
|
2986
2987
|
} catch {
|
@@ -3034,7 +3035,7 @@ function Cn(n, e = []) {
|
|
3034
3035
|
* See the License for the specific language governing permissions and
|
3035
3036
|
* limitations under the License.
|
3036
3037
|
*/
|
3037
|
-
class
|
3038
|
+
class xi {
|
3038
3039
|
constructor(e) {
|
3039
3040
|
this.auth = e, this.queue = [];
|
3040
3041
|
}
|
@@ -3089,7 +3090,7 @@ class Hi {
|
|
3089
3090
|
* See the License for the specific language governing permissions and
|
3090
3091
|
* limitations under the License.
|
3091
3092
|
*/
|
3092
|
-
async function
|
3093
|
+
async function Wi(n, e = {}) {
|
3093
3094
|
return W(n, "GET", "/v2/passwordPolicy", ee(n, e));
|
3094
3095
|
}
|
3095
3096
|
/**
|
@@ -3108,12 +3109,12 @@ async function xi(n, e = {}) {
|
|
3108
3109
|
* See the License for the specific language governing permissions and
|
3109
3110
|
* limitations under the License.
|
3110
3111
|
*/
|
3111
|
-
const
|
3112
|
-
class
|
3112
|
+
const zi = 6;
|
3113
|
+
class qi {
|
3113
3114
|
constructor(e) {
|
3114
3115
|
var t, r, i, s;
|
3115
3116
|
const o = e.customStrengthOptions;
|
3116
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
3117
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : zi, o.maxPasswordLength && (this.customStrengthOptions.maxPasswordLength = o.maxPasswordLength), o.containsLowercaseCharacter !== void 0 && (this.customStrengthOptions.containsLowercaseLetter = o.containsLowercaseCharacter), o.containsUppercaseCharacter !== void 0 && (this.customStrengthOptions.containsUppercaseLetter = o.containsUppercaseCharacter), o.containsNumericCharacter !== void 0 && (this.customStrengthOptions.containsNumericCharacter = o.containsNumericCharacter), o.containsNonAlphanumericCharacter !== void 0 && (this.customStrengthOptions.containsNonAlphanumericCharacter = o.containsNonAlphanumericCharacter), this.enforcementState = e.enforcementState, this.enforcementState === "ENFORCEMENT_STATE_UNSPECIFIED" && (this.enforcementState = "OFF"), this.allowedNonAlphanumericCharacters = (i = (r = e.allowedNonAlphanumericCharacters) === null || r === void 0 ? void 0 : r.join("")) !== null && i !== void 0 ? i : "", this.forceUpgradeOnSignin = (s = e.forceUpgradeOnSignin) !== null && s !== void 0 ? s : !1, this.schemaVersion = e.schemaVersion;
|
3117
3118
|
}
|
3118
3119
|
validatePassword(e) {
|
3119
3120
|
var t, r, i, s, o, a;
|
@@ -3198,7 +3199,7 @@ class zi {
|
|
3198
3199
|
*/
|
3199
3200
|
class Ji {
|
3200
3201
|
constructor(e, t, r, i) {
|
3201
|
-
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = r, this.config = i, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new Lt(this), this.idTokenSubscription = new Lt(this), this.beforeStateQueue = new
|
3202
|
+
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = r, this.config = i, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new Lt(this), this.idTokenSubscription = new Lt(this), this.beforeStateQueue = new xi(this), this.redirectUser = null, this.isProactiveRefreshEnabled = !1, this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION = 1, this._canInitEmulator = !0, this._isInitialized = !1, this._deleted = !1, this._initializationPromise = null, this._popupRedirectResolver = null, this._errorFactory = hn, this._agentRecaptchaConfig = null, this._tenantRecaptchaConfigs = {}, this._projectPasswordPolicy = null, this._tenantPasswordPolicies = {}, this.lastNotifiedUid = void 0, this.languageCode = null, this.tenantId = null, this.settings = { appVerificationDisabledForTesting: !1 }, this.frameworks = [], this.name = e.name, this.clientVersion = i.sdkClientVersion;
|
3202
3203
|
}
|
3203
3204
|
_initializeWithPersistence(e, t) {
|
3204
3205
|
return t && (this._popupRedirectResolver = V(t)), this._initializationPromise = this.queue(async () => {
|
@@ -3266,7 +3267,7 @@ class Ji {
|
|
3266
3267
|
}
|
3267
3268
|
return i ? this.reloadAndSetCurrentUserOrClear(i) : this.directlySetCurrentUser(null);
|
3268
3269
|
}
|
3269
|
-
return
|
3270
|
+
return v(
|
3270
3271
|
this._popupRedirectResolver,
|
3271
3272
|
this,
|
3272
3273
|
"argument-error"
|
@@ -3292,7 +3293,7 @@ class Ji {
|
|
3292
3293
|
return this.directlySetCurrentUser(e);
|
3293
3294
|
}
|
3294
3295
|
useDeviceLanguage() {
|
3295
|
-
this.languageCode =
|
3296
|
+
this.languageCode = Si();
|
3296
3297
|
}
|
3297
3298
|
async _delete() {
|
3298
3299
|
this._deleted = !0;
|
@@ -3301,7 +3302,7 @@ class Ji {
|
|
3301
3302
|
if (j(this.app))
|
3302
3303
|
return Promise.reject(X(this));
|
3303
3304
|
const t = e ? x(e) : null;
|
3304
|
-
return t &&
|
3305
|
+
return t && v(
|
3305
3306
|
t.auth.config.apiKey === this.config.apiKey,
|
3306
3307
|
this,
|
3307
3308
|
"invalid-user-token"
|
@@ -3310,7 +3311,7 @@ class Ji {
|
|
3310
3311
|
}
|
3311
3312
|
async _updateCurrentUser(e, t = !1) {
|
3312
3313
|
if (!this._deleted)
|
3313
|
-
return e &&
|
3314
|
+
return e && v(
|
3314
3315
|
this.tenantId === e.tenantId,
|
3315
3316
|
this,
|
3316
3317
|
"tenant-id-mismatch"
|
@@ -3343,7 +3344,7 @@ class Ji {
|
|
3343
3344
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
3344
3345
|
}
|
3345
3346
|
async _updatePasswordPolicy() {
|
3346
|
-
const e = await
|
3347
|
+
const e = await Wi(this), t = new qi(e);
|
3347
3348
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
3348
3349
|
}
|
3349
3350
|
_getPersistence() {
|
@@ -3383,7 +3384,7 @@ class Ji {
|
|
3383
3384
|
token: e,
|
3384
3385
|
idToken: t
|
3385
3386
|
};
|
3386
|
-
this.tenantId != null && (r.tenantId = this.tenantId), await
|
3387
|
+
this.tenantId != null && (r.tenantId = this.tenantId), await Fi(this, r);
|
3387
3388
|
}
|
3388
3389
|
}
|
3389
3390
|
toJSON() {
|
@@ -3402,7 +3403,7 @@ class Ji {
|
|
3402
3403
|
async getOrInitRedirectPersistenceManager(e) {
|
3403
3404
|
if (!this.redirectPersistenceManager) {
|
3404
3405
|
const t = e && V(e) || this._popupRedirectResolver;
|
3405
|
-
|
3406
|
+
v(
|
3406
3407
|
t,
|
3407
3408
|
this,
|
3408
3409
|
"argument-error"
|
@@ -3457,7 +3458,7 @@ class Ji {
|
|
3457
3458
|
const s = typeof t == "function" ? t : t.next.bind(t);
|
3458
3459
|
let o = !1;
|
3459
3460
|
const a = this._isInitialized ? Promise.resolve() : this._initializationPromise;
|
3460
|
-
if (
|
3461
|
+
if (v(
|
3461
3462
|
a,
|
3462
3463
|
this,
|
3463
3464
|
"internal-error"
|
@@ -3488,7 +3489,7 @@ class Ji {
|
|
3488
3489
|
return this.operations = this.operations.then(e, e), this.operations;
|
3489
3490
|
}
|
3490
3491
|
get assertedPersistence() {
|
3491
|
-
return
|
3492
|
+
return v(
|
3492
3493
|
this.persistenceManager,
|
3493
3494
|
this,
|
3494
3495
|
"internal-error"
|
@@ -3526,7 +3527,7 @@ class Ji {
|
|
3526
3527
|
async _getAppCheckToken() {
|
3527
3528
|
var e;
|
3528
3529
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
3529
|
-
return t != null && t.error &&
|
3530
|
+
return t != null && t.error && wi(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
3530
3531
|
}
|
3531
3532
|
}
|
3532
3533
|
function ie(n) {
|
@@ -3537,7 +3538,7 @@ class Lt {
|
|
3537
3538
|
this.auth = e, this.observer = null, this.addObserver = lr((t) => this.observer = t);
|
3538
3539
|
}
|
3539
3540
|
get next() {
|
3540
|
-
return
|
3541
|
+
return v(
|
3541
3542
|
this.observer,
|
3542
3543
|
this.auth,
|
3543
3544
|
"internal-error"
|
@@ -3569,30 +3570,30 @@ let Ve = {
|
|
3569
3570
|
recaptchaEnterpriseScript: "",
|
3570
3571
|
gapiScript: ""
|
3571
3572
|
};
|
3572
|
-
function
|
3573
|
+
function Gi(n) {
|
3573
3574
|
Ve = n;
|
3574
3575
|
}
|
3575
3576
|
function Rn(n) {
|
3576
3577
|
return Ve.loadJS(n);
|
3577
3578
|
}
|
3578
|
-
function
|
3579
|
+
function Ki() {
|
3579
3580
|
return Ve.recaptchaEnterpriseScript;
|
3580
3581
|
}
|
3581
|
-
function
|
3582
|
+
function Yi() {
|
3582
3583
|
return Ve.gapiScript;
|
3583
3584
|
}
|
3584
|
-
function
|
3585
|
+
function Qi(n) {
|
3585
3586
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
3586
3587
|
}
|
3587
|
-
const
|
3588
|
-
class
|
3588
|
+
const Xi = "recaptcha-enterprise", Zi = "NO_RECAPTCHA";
|
3589
|
+
class es {
|
3589
3590
|
/**
|
3590
3591
|
*
|
3591
3592
|
* @param authExtern - The corresponding Firebase {@link Auth} instance.
|
3592
3593
|
*
|
3593
3594
|
*/
|
3594
3595
|
constructor(e) {
|
3595
|
-
this.type =
|
3596
|
+
this.type = Xi, this.auth = ie(e);
|
3596
3597
|
}
|
3597
3598
|
/**
|
3598
3599
|
* Executes the verification process.
|
@@ -3608,7 +3609,7 @@ class Zi {
|
|
3608
3609
|
return s._tenantRecaptchaConfigs[s.tenantId].siteKey;
|
3609
3610
|
}
|
3610
3611
|
return new Promise(async (o, a) => {
|
3611
|
-
|
3612
|
+
ki(s, {
|
3612
3613
|
clientType: "CLIENT_TYPE_WEB",
|
3613
3614
|
version: "RECAPTCHA_ENTERPRISE"
|
3614
3615
|
/* RecaptchaVersion.ENTERPRISE */
|
@@ -3616,7 +3617,7 @@ class Zi {
|
|
3616
3617
|
if (c.recaptchaKey === void 0)
|
3617
3618
|
a(new Error("recaptcha Enterprise site key undefined"));
|
3618
3619
|
else {
|
3619
|
-
const u = new
|
3620
|
+
const u = new Oi(c);
|
3620
3621
|
return s.tenantId == null ? s._agentRecaptchaConfig = u : s._tenantRecaptchaConfigs[s.tenantId] = u, o(u.siteKey);
|
3621
3622
|
}
|
3622
3623
|
}).catch((c) => {
|
@@ -3630,7 +3631,7 @@ class Zi {
|
|
3630
3631
|
c.enterprise.execute(s, { action: e }).then((u) => {
|
3631
3632
|
o(u);
|
3632
3633
|
}).catch(() => {
|
3633
|
-
o(
|
3634
|
+
o(Zi);
|
3634
3635
|
});
|
3635
3636
|
}) : a(Error("No reCAPTCHA enterprise script loaded."));
|
3636
3637
|
}
|
@@ -3643,7 +3644,7 @@ class Zi {
|
|
3643
3644
|
o(new Error("RecaptchaVerifier is only supported in browser"));
|
3644
3645
|
return;
|
3645
3646
|
}
|
3646
|
-
let c =
|
3647
|
+
let c = Ki();
|
3647
3648
|
c.length !== 0 && (c += a), Rn(c).then(() => {
|
3648
3649
|
i(a, s, o);
|
3649
3650
|
}).catch((u) => {
|
@@ -3657,7 +3658,7 @@ class Zi {
|
|
3657
3658
|
}
|
3658
3659
|
}
|
3659
3660
|
async function $t(n, e, t, r = !1) {
|
3660
|
-
const i = new
|
3661
|
+
const i = new es(n);
|
3661
3662
|
let s;
|
3662
3663
|
try {
|
3663
3664
|
s = await i.verify(t);
|
@@ -3719,7 +3720,7 @@ async function it(n, e, t, r) {
|
|
3719
3720
|
* See the License for the specific language governing permissions and
|
3720
3721
|
* limitations under the License.
|
3721
3722
|
*/
|
3722
|
-
function
|
3723
|
+
function ts(n, e) {
|
3723
3724
|
const t = an(n, "auth");
|
3724
3725
|
if (t.isInitialized()) {
|
3725
3726
|
const i = t.getImmediate(), s = t.getOptions();
|
@@ -3733,36 +3734,36 @@ function es(n, e) {
|
|
3733
3734
|
}
|
3734
3735
|
return t.initialize({ options: e });
|
3735
3736
|
}
|
3736
|
-
function
|
3737
|
+
function ns(n, e) {
|
3737
3738
|
const t = (e == null ? void 0 : e.persistence) || [], r = (Array.isArray(t) ? t : [t]).map(V);
|
3738
3739
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(r, e == null ? void 0 : e.popupRedirectResolver);
|
3739
3740
|
}
|
3740
|
-
function
|
3741
|
+
function rs(n, e, t) {
|
3741
3742
|
const r = ie(n);
|
3742
|
-
|
3743
|
+
v(
|
3743
3744
|
r._canInitEmulator,
|
3744
3745
|
r,
|
3745
3746
|
"emulator-config-failed"
|
3746
3747
|
/* AuthErrorCode.EMULATOR_CONFIG_FAILED */
|
3747
|
-
),
|
3748
|
+
), v(
|
3748
3749
|
/^https?:\/\//.test(e),
|
3749
3750
|
r,
|
3750
3751
|
"invalid-emulator-scheme"
|
3751
3752
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
3752
3753
|
);
|
3753
|
-
const i =
|
3754
|
+
const i = !1, s = Pn(e), { host: o, port: a } = is(e), c = a === null ? "" : `:${a}`;
|
3754
3755
|
r.config.emulator = { url: `${s}//${o}${c}/` }, r.settings.appVerificationDisabledForTesting = !0, r.emulatorConfig = Object.freeze({
|
3755
3756
|
host: o,
|
3756
3757
|
port: a,
|
3757
3758
|
protocol: s.replace(":", ""),
|
3758
3759
|
options: Object.freeze({ disableWarnings: i })
|
3759
|
-
}),
|
3760
|
+
}), ss();
|
3760
3761
|
}
|
3761
3762
|
function Pn(n) {
|
3762
3763
|
const e = n.indexOf(":");
|
3763
3764
|
return e < 0 ? "" : n.substr(0, e + 1);
|
3764
3765
|
}
|
3765
|
-
function
|
3766
|
+
function is(n) {
|
3766
3767
|
const e = Pn(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
3767
3768
|
if (!t)
|
3768
3769
|
return { host: "", port: null };
|
@@ -3781,7 +3782,7 @@ function Mt(n) {
|
|
3781
3782
|
const e = Number(n);
|
3782
3783
|
return isNaN(e) ? null : e;
|
3783
3784
|
}
|
3784
|
-
function
|
3785
|
+
function ss() {
|
3785
3786
|
function n() {
|
3786
3787
|
const e = document.createElement("p"), t = e.style;
|
3787
3788
|
e.innerText = "Running in emulator mode. Do not use with production credentials.", t.position = "fixed", t.width = "100%", t.backgroundColor = "#ffffff", t.border = ".1em solid #000000", t.color = "#b50000", t.bottom = "0px", t.left = "0px", t.margin = "0px", t.zIndex = "10000", t.textAlign = "center", e.classList.add("firebase-emulator-warning"), document.body.appendChild(e);
|
@@ -3830,7 +3831,7 @@ class pt {
|
|
3830
3831
|
return F("not implemented");
|
3831
3832
|
}
|
3832
3833
|
}
|
3833
|
-
async function
|
3834
|
+
async function os(n, e) {
|
3834
3835
|
return W(n, "POST", "/v1/accounts:signUp", e);
|
3835
3836
|
}
|
3836
3837
|
/**
|
@@ -3849,14 +3850,14 @@ async function ss(n, e) {
|
|
3849
3850
|
* See the License for the specific language governing permissions and
|
3850
3851
|
* limitations under the License.
|
3851
3852
|
*/
|
3852
|
-
async function
|
3853
|
+
async function as(n, e) {
|
3853
3854
|
return Fe(n, "POST", "/v1/accounts:signInWithPassword", ee(n, e));
|
3854
3855
|
}
|
3855
|
-
async function
|
3856
|
+
async function cs(n, e) {
|
3856
3857
|
return W(n, "POST", "/v1/accounts:sendOobCode", ee(n, e));
|
3857
3858
|
}
|
3858
|
-
async function
|
3859
|
-
return
|
3859
|
+
async function ls(n, e) {
|
3860
|
+
return cs(n, e);
|
3860
3861
|
}
|
3861
3862
|
/**
|
3862
3863
|
* @license
|
@@ -3874,10 +3875,10 @@ async function cs(n, e) {
|
|
3874
3875
|
* See the License for the specific language governing permissions and
|
3875
3876
|
* limitations under the License.
|
3876
3877
|
*/
|
3877
|
-
async function
|
3878
|
+
async function ds(n, e) {
|
3878
3879
|
return Fe(n, "POST", "/v1/accounts:signInWithEmailLink", ee(n, e));
|
3879
3880
|
}
|
3880
|
-
async function
|
3881
|
+
async function us(n, e) {
|
3881
3882
|
return Fe(n, "POST", "/v1/accounts:signInWithEmailLink", ee(n, e));
|
3882
3883
|
}
|
3883
3884
|
/**
|
@@ -3952,9 +3953,9 @@ class ve extends pt {
|
|
3952
3953
|
clientType: "CLIENT_TYPE_WEB"
|
3953
3954
|
/* RecaptchaClientType.WEB */
|
3954
3955
|
};
|
3955
|
-
return it(e, t, "signInWithPassword",
|
3956
|
+
return it(e, t, "signInWithPassword", as);
|
3956
3957
|
case "emailLink":
|
3957
|
-
return
|
3958
|
+
return ds(e, {
|
3958
3959
|
email: this._email,
|
3959
3960
|
oobCode: this._password
|
3960
3961
|
});
|
@@ -3978,9 +3979,9 @@ class ve extends pt {
|
|
3978
3979
|
clientType: "CLIENT_TYPE_WEB"
|
3979
3980
|
/* RecaptchaClientType.WEB */
|
3980
3981
|
};
|
3981
|
-
return it(e, r, "signUpPassword",
|
3982
|
+
return it(e, r, "signUpPassword", os);
|
3982
3983
|
case "emailLink":
|
3983
|
-
return
|
3984
|
+
return us(e, {
|
3984
3985
|
idToken: t,
|
3985
3986
|
email: this._email,
|
3986
3987
|
oobCode: this._password
|
@@ -4033,7 +4034,7 @@ async function le(n, e) {
|
|
4033
4034
|
* See the License for the specific language governing permissions and
|
4034
4035
|
* limitations under the License.
|
4035
4036
|
*/
|
4036
|
-
const
|
4037
|
+
const hs = "http://localhost";
|
4037
4038
|
class re extends pt {
|
4038
4039
|
constructor() {
|
4039
4040
|
super(...arguments), this.pendingToken = null;
|
@@ -4091,7 +4092,7 @@ class re extends pt {
|
|
4091
4092
|
}
|
4092
4093
|
buildRequest() {
|
4093
4094
|
const e = {
|
4094
|
-
requestUri:
|
4095
|
+
requestUri: hs,
|
4095
4096
|
returnSecureToken: !0
|
4096
4097
|
};
|
4097
4098
|
if (this.pendingToken)
|
@@ -4119,7 +4120,7 @@ class re extends pt {
|
|
4119
4120
|
* See the License for the specific language governing permissions and
|
4120
4121
|
* limitations under the License.
|
4121
4122
|
*/
|
4122
|
-
function
|
4123
|
+
function fs(n) {
|
4123
4124
|
switch (n) {
|
4124
4125
|
case "recoverEmail":
|
4125
4126
|
return "RECOVER_EMAIL";
|
@@ -4137,7 +4138,7 @@ function hs(n) {
|
|
4137
4138
|
return null;
|
4138
4139
|
}
|
4139
4140
|
}
|
4140
|
-
function
|
4141
|
+
function ps(n) {
|
4141
4142
|
const e = fe(pe(n)).link, t = e ? fe(pe(e)).deep_link_id : null, r = fe(pe(n)).deep_link_id;
|
4142
4143
|
return (r ? fe(pe(r)).link : null) || r || t || e || n;
|
4143
4144
|
}
|
@@ -4150,12 +4151,12 @@ class gt {
|
|
4150
4151
|
*/
|
4151
4152
|
constructor(e) {
|
4152
4153
|
var t, r, i, s, o, a;
|
4153
|
-
const c = fe(pe(e)), u = (t = c.apiKey) !== null && t !== void 0 ? t : null,
|
4154
|
-
|
4155
|
-
u &&
|
4154
|
+
const c = fe(pe(e)), u = (t = c.apiKey) !== null && t !== void 0 ? t : null, y = (r = c.oobCode) !== null && r !== void 0 ? r : null, b = fs((i = c.mode) !== null && i !== void 0 ? i : null);
|
4155
|
+
v(
|
4156
|
+
u && y && b,
|
4156
4157
|
"argument-error"
|
4157
4158
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
4158
|
-
), this.apiKey = u, this.operation = b, this.code =
|
4159
|
+
), this.apiKey = u, this.operation = b, this.code = y, this.continueUrl = (s = c.continueUrl) !== null && s !== void 0 ? s : null, this.languageCode = (o = c.languageCode) !== null && o !== void 0 ? o : null, this.tenantId = (a = c.tenantId) !== null && a !== void 0 ? a : null;
|
4159
4160
|
}
|
4160
4161
|
/**
|
4161
4162
|
* Parses the email action link string and returns an {@link ActionCodeURL} if the link is valid,
|
@@ -4167,7 +4168,7 @@ class gt {
|
|
4167
4168
|
* @public
|
4168
4169
|
*/
|
4169
4170
|
static parseLink(e) {
|
4170
|
-
const t =
|
4171
|
+
const t = ps(e);
|
4171
4172
|
try {
|
4172
4173
|
return new gt(t);
|
4173
4174
|
} catch {
|
@@ -4240,7 +4241,7 @@ class he {
|
|
4240
4241
|
*/
|
4241
4242
|
static credentialWithLink(e, t) {
|
4242
4243
|
const r = gt.parseLink(t);
|
4243
|
-
return
|
4244
|
+
return v(
|
4244
4245
|
r,
|
4245
4246
|
"argument-error"
|
4246
4247
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
@@ -4354,7 +4355,7 @@ class Te extends On {
|
|
4354
4355
|
* See the License for the specific language governing permissions and
|
4355
4356
|
* limitations under the License.
|
4356
4357
|
*/
|
4357
|
-
class
|
4358
|
+
class q extends Te {
|
4358
4359
|
constructor() {
|
4359
4360
|
super(
|
4360
4361
|
"facebook.com"
|
@@ -4375,8 +4376,8 @@ class J extends Te {
|
|
4375
4376
|
*/
|
4376
4377
|
static credential(e) {
|
4377
4378
|
return re._fromParams({
|
4378
|
-
providerId:
|
4379
|
-
signInMethod:
|
4379
|
+
providerId: q.PROVIDER_ID,
|
4380
|
+
signInMethod: q.FACEBOOK_SIGN_IN_METHOD,
|
4380
4381
|
accessToken: e
|
4381
4382
|
});
|
4382
4383
|
}
|
@@ -4386,7 +4387,7 @@ class J extends Te {
|
|
4386
4387
|
* @param userCredential - The user credential.
|
4387
4388
|
*/
|
4388
4389
|
static credentialFromResult(e) {
|
4389
|
-
return
|
4390
|
+
return q.credentialFromTaggedObject(e);
|
4390
4391
|
}
|
4391
4392
|
/**
|
4392
4393
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
@@ -4395,20 +4396,20 @@ class J extends Te {
|
|
4395
4396
|
* @param userCredential - The user credential.
|
4396
4397
|
*/
|
4397
4398
|
static credentialFromError(e) {
|
4398
|
-
return
|
4399
|
+
return q.credentialFromTaggedObject(e.customData || {});
|
4399
4400
|
}
|
4400
4401
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
4401
4402
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
4402
4403
|
return null;
|
4403
4404
|
try {
|
4404
|
-
return
|
4405
|
+
return q.credential(e.oauthAccessToken);
|
4405
4406
|
} catch {
|
4406
4407
|
return null;
|
4407
4408
|
}
|
4408
4409
|
}
|
4409
4410
|
}
|
4410
|
-
|
4411
|
-
|
4411
|
+
q.FACEBOOK_SIGN_IN_METHOD = "facebook.com";
|
4412
|
+
q.PROVIDER_ID = "facebook.com";
|
4412
4413
|
/**
|
4413
4414
|
* @license
|
4414
4415
|
* Copyright 2020 Google LLC
|
@@ -4425,7 +4426,7 @@ J.PROVIDER_ID = "facebook.com";
|
|
4425
4426
|
* See the License for the specific language governing permissions and
|
4426
4427
|
* limitations under the License.
|
4427
4428
|
*/
|
4428
|
-
class
|
4429
|
+
class J extends Te {
|
4429
4430
|
constructor() {
|
4430
4431
|
super(
|
4431
4432
|
"google.com"
|
@@ -4447,8 +4448,8 @@ class q extends Te {
|
|
4447
4448
|
*/
|
4448
4449
|
static credential(e, t) {
|
4449
4450
|
return re._fromParams({
|
4450
|
-
providerId:
|
4451
|
-
signInMethod:
|
4451
|
+
providerId: J.PROVIDER_ID,
|
4452
|
+
signInMethod: J.GOOGLE_SIGN_IN_METHOD,
|
4452
4453
|
idToken: e,
|
4453
4454
|
accessToken: t
|
4454
4455
|
});
|
@@ -4459,7 +4460,7 @@ class q extends Te {
|
|
4459
4460
|
* @param userCredential - The user credential.
|
4460
4461
|
*/
|
4461
4462
|
static credentialFromResult(e) {
|
4462
|
-
return
|
4463
|
+
return J.credentialFromTaggedObject(e);
|
4463
4464
|
}
|
4464
4465
|
/**
|
4465
4466
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
@@ -4468,7 +4469,7 @@ class q extends Te {
|
|
4468
4469
|
* @param userCredential - The user credential.
|
4469
4470
|
*/
|
4470
4471
|
static credentialFromError(e) {
|
4471
|
-
return
|
4472
|
+
return J.credentialFromTaggedObject(e.customData || {});
|
4472
4473
|
}
|
4473
4474
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
4474
4475
|
if (!e)
|
@@ -4477,14 +4478,14 @@ class q extends Te {
|
|
4477
4478
|
if (!t && !r)
|
4478
4479
|
return null;
|
4479
4480
|
try {
|
4480
|
-
return
|
4481
|
+
return J.credential(t, r);
|
4481
4482
|
} catch {
|
4482
4483
|
return null;
|
4483
4484
|
}
|
4484
4485
|
}
|
4485
4486
|
}
|
4486
|
-
|
4487
|
-
|
4487
|
+
J.GOOGLE_SIGN_IN_METHOD = "google.com";
|
4488
|
+
J.PROVIDER_ID = "google.com";
|
4488
4489
|
/**
|
4489
4490
|
* @license
|
4490
4491
|
* Copyright 2020 Google LLC
|
@@ -4700,7 +4701,7 @@ function kn(n, e, t, r) {
|
|
4700
4701
|
throw s.code === "auth/multi-factor-auth-required" ? $e._fromErrorAndOperation(n, s, e, r) : s;
|
4701
4702
|
});
|
4702
4703
|
}
|
4703
|
-
async function
|
4704
|
+
async function gs(n, e, t = !1) {
|
4704
4705
|
const r = await _e(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
4705
4706
|
return ue._forOperation(n, "link", r);
|
4706
4707
|
}
|
@@ -4720,28 +4721,28 @@ async function ps(n, e, t = !1) {
|
|
4720
4721
|
* See the License for the specific language governing permissions and
|
4721
4722
|
* limitations under the License.
|
4722
4723
|
*/
|
4723
|
-
async function
|
4724
|
+
async function ms(n, e, t = !1) {
|
4724
4725
|
const { auth: r } = n;
|
4725
4726
|
if (j(r.app))
|
4726
4727
|
return Promise.reject(X(r));
|
4727
4728
|
const i = "reauthenticate";
|
4728
4729
|
try {
|
4729
4730
|
const s = await _e(n, kn(r, i, e, n), t);
|
4730
|
-
|
4731
|
+
v(
|
4731
4732
|
s.idToken,
|
4732
4733
|
r,
|
4733
4734
|
"internal-error"
|
4734
4735
|
/* AuthErrorCode.INTERNAL_ERROR */
|
4735
4736
|
);
|
4736
4737
|
const o = ht(s.idToken);
|
4737
|
-
|
4738
|
+
v(
|
4738
4739
|
o,
|
4739
4740
|
r,
|
4740
4741
|
"internal-error"
|
4741
4742
|
/* AuthErrorCode.INTERNAL_ERROR */
|
4742
4743
|
);
|
4743
4744
|
const { sub: a } = o;
|
4744
|
-
return
|
4745
|
+
return v(
|
4745
4746
|
n.uid === a,
|
4746
4747
|
r,
|
4747
4748
|
"user-mismatch"
|
@@ -4777,49 +4778,9 @@ async function Nn(n, e, t = !1) {
|
|
4777
4778
|
const r = "signIn", i = await kn(n, r, e), s = await ue._fromIdTokenResponse(n, r, i);
|
4778
4779
|
return t || await n._updateCurrentUser(s.user), s;
|
4779
4780
|
}
|
4780
|
-
async function
|
4781
|
+
async function ys(n, e) {
|
4781
4782
|
return Nn(ie(n), e);
|
4782
4783
|
}
|
4783
|
-
/**
|
4784
|
-
* @license
|
4785
|
-
* Copyright 2020 Google LLC
|
4786
|
-
*
|
4787
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
4788
|
-
* you may not use this file except in compliance with the License.
|
4789
|
-
* You may obtain a copy of the License at
|
4790
|
-
*
|
4791
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
4792
|
-
*
|
4793
|
-
* Unless required by applicable law or agreed to in writing, software
|
4794
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
4795
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
4796
|
-
* See the License for the specific language governing permissions and
|
4797
|
-
* limitations under the License.
|
4798
|
-
*/
|
4799
|
-
function ys(n, e, t) {
|
4800
|
-
var r;
|
4801
|
-
y(
|
4802
|
-
((r = t.url) === null || r === void 0 ? void 0 : r.length) > 0,
|
4803
|
-
n,
|
4804
|
-
"invalid-continue-uri"
|
4805
|
-
/* AuthErrorCode.INVALID_CONTINUE_URI */
|
4806
|
-
), y(
|
4807
|
-
typeof t.dynamicLinkDomain > "u" || t.dynamicLinkDomain.length > 0,
|
4808
|
-
n,
|
4809
|
-
"invalid-dynamic-link-domain"
|
4810
|
-
/* AuthErrorCode.INVALID_DYNAMIC_LINK_DOMAIN */
|
4811
|
-
), e.continueUrl = t.url, e.dynamicLinkDomain = t.dynamicLinkDomain, e.canHandleCodeInApp = t.handleCodeInApp, t.iOS && (y(
|
4812
|
-
t.iOS.bundleId.length > 0,
|
4813
|
-
n,
|
4814
|
-
"missing-ios-bundle-id"
|
4815
|
-
/* AuthErrorCode.MISSING_IOS_BUNDLE_ID */
|
4816
|
-
), e.iOSBundleId = t.iOS.bundleId), t.android && (y(
|
4817
|
-
t.android.packageName.length > 0,
|
4818
|
-
n,
|
4819
|
-
"missing-android-pkg-name"
|
4820
|
-
/* AuthErrorCode.MISSING_ANDROID_PACKAGE_NAME */
|
4821
|
-
), e.androidInstallApp = t.android.installApp, e.androidMinimumVersionCode = t.android.minimumVersion, e.androidPackageName = t.android.packageName);
|
4822
|
-
}
|
4823
4784
|
/**
|
4824
4785
|
* @license
|
4825
4786
|
* Copyright 2020 Google LLC
|
@@ -4841,16 +4802,16 @@ async function _s(n) {
|
|
4841
4802
|
e._getPasswordPolicyInternal() && await e._updatePasswordPolicy();
|
4842
4803
|
}
|
4843
4804
|
async function vs(n, e, t) {
|
4844
|
-
const r = ie(n)
|
4805
|
+
const r = ie(n);
|
4806
|
+
await it(r, {
|
4845
4807
|
requestType: "PASSWORD_RESET",
|
4846
4808
|
email: e,
|
4847
4809
|
clientType: "CLIENT_TYPE_WEB"
|
4848
4810
|
/* RecaptchaClientType.WEB */
|
4849
|
-
};
|
4850
|
-
t && ys(r, i, t), await it(r, i, "getOobCode", cs);
|
4811
|
+
}, "getOobCode", ls);
|
4851
4812
|
}
|
4852
4813
|
function bs(n, e, t) {
|
4853
|
-
return j(n.app) ? Promise.reject(X(n)) :
|
4814
|
+
return j(n.app) ? Promise.reject(X(n)) : ys(x(n), he.credential(e, t)).catch(async (r) => {
|
4854
4815
|
throw r.code === "auth/password-does-not-meet-requirements" && _s(n), r;
|
4855
4816
|
});
|
4856
4817
|
}
|
@@ -4924,18 +4885,18 @@ class Dn {
|
|
4924
4885
|
* See the License for the specific language governing permissions and
|
4925
4886
|
* limitations under the License.
|
4926
4887
|
*/
|
4927
|
-
function
|
4888
|
+
function Ss() {
|
4928
4889
|
const n = P();
|
4929
4890
|
return ft(n) || Be(n);
|
4930
4891
|
}
|
4931
|
-
const
|
4892
|
+
const As = 1e3, Cs = 10;
|
4932
4893
|
class Ln extends Dn {
|
4933
4894
|
constructor() {
|
4934
4895
|
super(
|
4935
4896
|
() => window.localStorage,
|
4936
4897
|
"LOCAL"
|
4937
4898
|
/* PersistenceType.LOCAL */
|
4938
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
4899
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = Ss() && Hi(), this.fallbackToPolling = An(), this._shouldAllowMigration = !0;
|
4939
4900
|
}
|
4940
4901
|
forAllChangedKeys(e) {
|
4941
4902
|
for (const t of Object.keys(this.listeners)) {
|
@@ -4962,7 +4923,7 @@ class Ln extends Dn {
|
|
4962
4923
|
const o = this.storage.getItem(r);
|
4963
4924
|
!t && this.localCache[r] === o || this.notifyListeners(r, o);
|
4964
4925
|
}, s = this.storage.getItem(r);
|
4965
|
-
|
4926
|
+
Vi() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(i, Cs) : i();
|
4966
4927
|
}
|
4967
4928
|
notifyListeners(e, t) {
|
4968
4929
|
this.localCache[e] = t;
|
@@ -4984,7 +4945,7 @@ class Ln extends Dn {
|
|
4984
4945
|
!0
|
4985
4946
|
);
|
4986
4947
|
});
|
4987
|
-
},
|
4948
|
+
}, As);
|
4988
4949
|
}
|
4989
4950
|
stopPolling() {
|
4990
4951
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
@@ -5236,7 +5197,7 @@ class Os {
|
|
5236
5197
|
return new Promise((a, c) => {
|
5237
5198
|
const u = mt("", 20);
|
5238
5199
|
i.port1.start();
|
5239
|
-
const
|
5200
|
+
const y = setTimeout(() => {
|
5240
5201
|
c(new Error(
|
5241
5202
|
"unsupported_event"
|
5242
5203
|
/* _MessageError.UNSUPPORTED_EVENT */
|
@@ -5245,11 +5206,11 @@ class Os {
|
|
5245
5206
|
o = {
|
5246
5207
|
messageChannel: i,
|
5247
5208
|
onMessage(b) {
|
5248
|
-
const
|
5249
|
-
if (
|
5250
|
-
switch (
|
5209
|
+
const A = b;
|
5210
|
+
if (A.data.eventId === u)
|
5211
|
+
switch (A.data.status) {
|
5251
5212
|
case "ack":
|
5252
|
-
clearTimeout(
|
5213
|
+
clearTimeout(y), s = setTimeout(
|
5253
5214
|
() => {
|
5254
5215
|
c(new Error(
|
5255
5216
|
"timeout"
|
@@ -5261,10 +5222,10 @@ class Os {
|
|
5261
5222
|
);
|
5262
5223
|
break;
|
5263
5224
|
case "done":
|
5264
|
-
clearTimeout(s), a(
|
5225
|
+
clearTimeout(s), a(A.data.response);
|
5265
5226
|
break;
|
5266
5227
|
default:
|
5267
|
-
clearTimeout(
|
5228
|
+
clearTimeout(y), clearTimeout(s), c(new Error(
|
5268
5229
|
"invalid_response"
|
5269
5230
|
/* _MessageError.INVALID_RESPONSE */
|
5270
5231
|
));
|
@@ -5355,7 +5316,7 @@ function Ls() {
|
|
5355
5316
|
* limitations under the License.
|
5356
5317
|
*/
|
5357
5318
|
const jn = "firebaseLocalStorageDb", $s = 1, Ue = "firebaseLocalStorage", Fn = "fbase_key";
|
5358
|
-
class
|
5319
|
+
class Se {
|
5359
5320
|
constructor(e) {
|
5360
5321
|
this.request = e;
|
5361
5322
|
}
|
@@ -5374,7 +5335,7 @@ function xe(n, e) {
|
|
5374
5335
|
}
|
5375
5336
|
function Ms() {
|
5376
5337
|
const n = indexedDB.deleteDatabase(jn);
|
5377
|
-
return new
|
5338
|
+
return new Se(n).toPromise();
|
5378
5339
|
}
|
5379
5340
|
function st() {
|
5380
5341
|
const n = indexedDB.open(jn, $s);
|
@@ -5399,15 +5360,15 @@ async function jt(n, e, t) {
|
|
5399
5360
|
[Fn]: e,
|
5400
5361
|
value: t
|
5401
5362
|
});
|
5402
|
-
return new
|
5363
|
+
return new Se(r).toPromise();
|
5403
5364
|
}
|
5404
5365
|
async function Us(n, e) {
|
5405
|
-
const t = xe(n, !1).get(e), r = await new
|
5366
|
+
const t = xe(n, !1).get(e), r = await new Se(t).toPromise();
|
5406
5367
|
return r === void 0 ? null : r.value;
|
5407
5368
|
}
|
5408
5369
|
function Ft(n, e) {
|
5409
5370
|
const t = xe(n, !0).delete(e);
|
5410
|
-
return new
|
5371
|
+
return new Se(t).toPromise();
|
5411
5372
|
}
|
5412
5373
|
const js = 800, Fs = 3;
|
5413
5374
|
class Bn {
|
@@ -5525,7 +5486,7 @@ class Bn {
|
|
5525
5486
|
async _poll() {
|
5526
5487
|
const e = await this._withRetries((i) => {
|
5527
5488
|
const s = xe(i, !1).getAll();
|
5528
|
-
return new
|
5489
|
+
return new Se(s).toPromise();
|
5529
5490
|
});
|
5530
5491
|
if (!e)
|
5531
5492
|
return [];
|
@@ -5579,7 +5540,7 @@ new Ee(3e4, 6e4);
|
|
5579
5540
|
* limitations under the License.
|
5580
5541
|
*/
|
5581
5542
|
function Vs(n, e) {
|
5582
|
-
return e ? V(e) : (
|
5543
|
+
return e ? V(e) : (v(
|
5583
5544
|
n._popupRedirectResolver,
|
5584
5545
|
n,
|
5585
5546
|
"argument-error"
|
@@ -5637,21 +5598,21 @@ function Hs(n) {
|
|
5637
5598
|
}
|
5638
5599
|
function xs(n) {
|
5639
5600
|
const { auth: e, user: t } = n;
|
5640
|
-
return
|
5601
|
+
return v(
|
5641
5602
|
t,
|
5642
5603
|
e,
|
5643
5604
|
"internal-error"
|
5644
5605
|
/* AuthErrorCode.INTERNAL_ERROR */
|
5645
|
-
),
|
5606
|
+
), ms(t, new yt(n), n.bypassAuthState);
|
5646
5607
|
}
|
5647
5608
|
async function Ws(n) {
|
5648
5609
|
const { auth: e, user: t } = n;
|
5649
|
-
return
|
5610
|
+
return v(
|
5650
5611
|
t,
|
5651
5612
|
e,
|
5652
5613
|
"internal-error"
|
5653
5614
|
/* AuthErrorCode.INTERNAL_ERROR */
|
5654
|
-
),
|
5615
|
+
), gs(t, new yt(n), n.bypassAuthState);
|
5655
5616
|
}
|
5656
5617
|
/**
|
5657
5618
|
* @license
|
@@ -5759,7 +5720,7 @@ class se extends Vn {
|
|
5759
5720
|
}
|
5760
5721
|
async executeNotNull() {
|
5761
5722
|
const e = await this.execute();
|
5762
|
-
return
|
5723
|
+
return v(
|
5763
5724
|
e,
|
5764
5725
|
this.auth,
|
5765
5726
|
"internal-error"
|
@@ -5838,8 +5799,8 @@ se.currentPopupAction = null;
|
|
5838
5799
|
* See the License for the specific language governing permissions and
|
5839
5800
|
* limitations under the License.
|
5840
5801
|
*/
|
5841
|
-
const
|
5842
|
-
class
|
5802
|
+
const qs = "pendingRedirect", Pe = /* @__PURE__ */ new Map();
|
5803
|
+
class Js extends Vn {
|
5843
5804
|
constructor(e, t, r = !1) {
|
5844
5805
|
super(e, [
|
5845
5806
|
"signInViaRedirect",
|
@@ -5899,12 +5860,12 @@ function Ys(n) {
|
|
5899
5860
|
return V(n._redirectPersistence);
|
5900
5861
|
}
|
5901
5862
|
function Qs(n) {
|
5902
|
-
return Re(
|
5863
|
+
return Re(qs, n.config.apiKey, n.name);
|
5903
5864
|
}
|
5904
5865
|
async function Xs(n, e, t = !1) {
|
5905
5866
|
if (j(n.app))
|
5906
5867
|
return Promise.reject(X(n));
|
5907
|
-
const r = ie(n), i = Vs(r, e), o = await new
|
5868
|
+
const r = ie(n), i = Vs(r, e), o = await new Js(r, i, t).execute();
|
5908
5869
|
return o && !t && (delete o.user._redirectEventId, await r._persistUserIfCurrent(o.user), await r._setRedirectUser(null, e)), o;
|
5909
5870
|
}
|
5910
5871
|
/**
|
@@ -6093,14 +6054,14 @@ function co(n) {
|
|
6093
6054
|
else if (!((s = M().gapi) === null || s === void 0) && s.load)
|
6094
6055
|
o();
|
6095
6056
|
else {
|
6096
|
-
const a =
|
6057
|
+
const a = Qi("iframefcb");
|
6097
6058
|
return M()[a] = () => {
|
6098
6059
|
gapi.load ? o() : t($(
|
6099
6060
|
n,
|
6100
6061
|
"network-request-failed"
|
6101
6062
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
6102
6063
|
));
|
6103
|
-
}, Rn(`${
|
6064
|
+
}, Rn(`${Yi()}?onload=${a}`).catch((c) => t(c));
|
6104
6065
|
}
|
6105
6066
|
}).catch((e) => {
|
6106
6067
|
throw Oe = null, e;
|
@@ -6143,7 +6104,7 @@ const uo = new Ee(5e3, 15e3), ho = "__/auth/iframe", fo = "emulator/auth/iframe"
|
|
6143
6104
|
]);
|
6144
6105
|
function mo(n) {
|
6145
6106
|
const e = n.config;
|
6146
|
-
|
6107
|
+
v(
|
6147
6108
|
e.authDomain,
|
6148
6109
|
n,
|
6149
6110
|
"auth-domain-config-required"
|
@@ -6160,7 +6121,7 @@ function mo(n) {
|
|
6160
6121
|
}
|
6161
6122
|
async function yo(n) {
|
6162
6123
|
const e = await lo(n), t = M().gapi;
|
6163
|
-
return
|
6124
|
+
return v(
|
6164
6125
|
t,
|
6165
6126
|
n,
|
6166
6127
|
"internal-error"
|
@@ -6235,11 +6196,11 @@ function Eo(n, e, t, r = vo, i = bo) {
|
|
6235
6196
|
left: o
|
6236
6197
|
}), u = P().toLowerCase();
|
6237
6198
|
t && (a = In(u) ? Io : t), bn(u) && (e = e || wo, c.scrollbars = "yes");
|
6238
|
-
const
|
6239
|
-
if (
|
6199
|
+
const y = Object.entries(c).reduce((A, [O, N]) => `${A}${O}=${N},`, "");
|
6200
|
+
if (Bi(u) && a !== "_self")
|
6240
6201
|
return To(e || "", a), new Ht(null);
|
6241
|
-
const b = window.open(e || "", a,
|
6242
|
-
|
6202
|
+
const b = window.open(e || "", a, y);
|
6203
|
+
v(
|
6243
6204
|
b,
|
6244
6205
|
n,
|
6245
6206
|
"popup-blocked"
|
@@ -6273,14 +6234,14 @@ function To(n, e) {
|
|
6273
6234
|
* See the License for the specific language governing permissions and
|
6274
6235
|
* limitations under the License.
|
6275
6236
|
*/
|
6276
|
-
const
|
6237
|
+
const So = "__/auth/handler", Ao = "emulator/auth/handler", Co = encodeURIComponent("fac");
|
6277
6238
|
async function xt(n, e, t, r, i, s) {
|
6278
|
-
|
6239
|
+
v(
|
6279
6240
|
n.config.authDomain,
|
6280
6241
|
n,
|
6281
6242
|
"auth-domain-config-required"
|
6282
6243
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
6283
|
-
),
|
6244
|
+
), v(
|
6284
6245
|
n.config.apiKey,
|
6285
6246
|
n,
|
6286
6247
|
"invalid-api-key"
|
@@ -6296,22 +6257,22 @@ async function xt(n, e, t, r, i, s) {
|
|
6296
6257
|
};
|
6297
6258
|
if (e instanceof On) {
|
6298
6259
|
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", cr(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
6299
|
-
for (const [
|
6300
|
-
o[
|
6260
|
+
for (const [y, b] of Object.entries({}))
|
6261
|
+
o[y] = b;
|
6301
6262
|
}
|
6302
6263
|
if (e instanceof Te) {
|
6303
|
-
const
|
6304
|
-
|
6264
|
+
const y = e.getScopes().filter((b) => b !== "");
|
6265
|
+
y.length > 0 && (o.scopes = y.join(","));
|
6305
6266
|
}
|
6306
6267
|
n.tenantId && (o.tid = n.tenantId);
|
6307
6268
|
const a = o;
|
6308
|
-
for (const
|
6309
|
-
a[
|
6269
|
+
for (const y of Object.keys(a))
|
6270
|
+
a[y] === void 0 && delete a[y];
|
6310
6271
|
const c = await n._getAppCheckToken(), u = c ? `#${Co}=${encodeURIComponent(c)}` : "";
|
6311
6272
|
return `${Ro(n)}?${Ie(a).slice(1)}${u}`;
|
6312
6273
|
}
|
6313
6274
|
function Ro({ config: n }) {
|
6314
|
-
return n.emulator ? ut(n,
|
6275
|
+
return n.emulator ? ut(n, Ao) : `https://${n.authDomain}/${So}`;
|
6315
6276
|
}
|
6316
6277
|
/**
|
6317
6278
|
* @license
|
@@ -6361,7 +6322,7 @@ class Po {
|
|
6361
6322
|
}
|
6362
6323
|
async initAndGetManager(e) {
|
6363
6324
|
const t = await yo(e), r = new eo(e);
|
6364
|
-
return t.register("authEvent", (i) => (
|
6325
|
+
return t.register("authEvent", (i) => (v(
|
6365
6326
|
i == null ? void 0 : i.authEvent,
|
6366
6327
|
e,
|
6367
6328
|
"invalid-auth-event"
|
@@ -6387,11 +6348,11 @@ class Po {
|
|
6387
6348
|
return this.originValidationPromises[t] || (this.originValidationPromises[t] = so(e)), this.originValidationPromises[t];
|
6388
6349
|
}
|
6389
6350
|
get _shouldInitProactively() {
|
6390
|
-
return
|
6351
|
+
return An() || ft() || Be();
|
6391
6352
|
}
|
6392
6353
|
}
|
6393
6354
|
const Oo = Po;
|
6394
|
-
var Wt = "@firebase/auth", zt = "1.7.
|
6355
|
+
var Wt = "@firebase/auth", zt = "1.7.4";
|
6395
6356
|
/**
|
6396
6357
|
* @license
|
6397
6358
|
* Copyright 2020 Google LLC
|
@@ -6433,7 +6394,7 @@ class ko {
|
|
6433
6394
|
t && (this.internalListeners.delete(e), t(), this.updateProactiveRefresh());
|
6434
6395
|
}
|
6435
6396
|
assertAuthConfigured() {
|
6436
|
-
|
6397
|
+
v(
|
6437
6398
|
this.auth._initializationPromise,
|
6438
6399
|
"dependent-sdk-initialized-before-auth"
|
6439
6400
|
/* AuthErrorCode.DEPENDENT_SDK_INIT_BEFORE_AUTH */
|
@@ -6480,7 +6441,7 @@ function Do(n) {
|
|
6480
6441
|
"auth",
|
6481
6442
|
(e, { options: t }) => {
|
6482
6443
|
const r = e.getProvider("app").getImmediate(), i = e.getProvider("heartbeat"), s = e.getProvider("app-check-internal"), { apiKey: o, authDomain: a } = r.options;
|
6483
|
-
|
6444
|
+
v(o && !o.includes(":"), "invalid-api-key", { appName: r.name });
|
6484
6445
|
const c = {
|
6485
6446
|
apiKey: o,
|
6486
6447
|
authDomain: a,
|
@@ -6490,7 +6451,7 @@ function Do(n) {
|
|
6490
6451
|
apiScheme: "https",
|
6491
6452
|
sdkClientVersion: Cn(n)
|
6492
6453
|
}, u = new Ji(r, i, s, c);
|
6493
|
-
return
|
6454
|
+
return ns(u, t), u;
|
6494
6455
|
},
|
6495
6456
|
"PUBLIC"
|
6496
6457
|
/* ComponentType.PUBLIC */
|
@@ -6535,24 +6496,24 @@ function Do(n) {
|
|
6535
6496
|
* limitations under the License.
|
6536
6497
|
*/
|
6537
6498
|
const Lo = 5 * 60, $o = nn("authIdTokenMaxAge") || Lo;
|
6538
|
-
let
|
6499
|
+
let qt = null;
|
6539
6500
|
const Mo = (n) => async (e) => {
|
6540
6501
|
const t = e && await e.getIdTokenResult(), r = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
6541
6502
|
if (r && r > $o)
|
6542
6503
|
return;
|
6543
6504
|
const i = t == null ? void 0 : t.token;
|
6544
|
-
|
6505
|
+
qt !== i && (qt = i, await fetch(n, {
|
6545
6506
|
method: i ? "POST" : "DELETE",
|
6546
6507
|
headers: i ? {
|
6547
6508
|
Authorization: `Bearer ${i}`
|
6548
6509
|
} : {}
|
6549
6510
|
}));
|
6550
6511
|
};
|
6551
|
-
function Uo(n =
|
6512
|
+
function Uo(n = li()) {
|
6552
6513
|
const e = an(n, "auth");
|
6553
6514
|
if (e.isInitialized())
|
6554
6515
|
return e.getImmediate();
|
6555
|
-
const t =
|
6516
|
+
const t = ts(n, {
|
6556
6517
|
popupRedirectResolver: Oo,
|
6557
6518
|
persistence: [
|
6558
6519
|
Bs,
|
@@ -6568,13 +6529,13 @@ function Uo(n = ci()) {
|
|
6568
6529
|
}
|
6569
6530
|
}
|
6570
6531
|
const i = Qn("auth");
|
6571
|
-
return i &&
|
6532
|
+
return i && rs(t, `http://${i}`), t;
|
6572
6533
|
}
|
6573
6534
|
function jo() {
|
6574
6535
|
var n, e;
|
6575
6536
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
6576
6537
|
}
|
6577
|
-
|
6538
|
+
Gi({
|
6578
6539
|
loadJS(n) {
|
6579
6540
|
return new Promise((e, t) => {
|
6580
6541
|
const r = document.createElement("script");
|
@@ -6609,29 +6570,29 @@ var xn = { exports: {} };
|
|
6609
6570
|
function r(l, m) {
|
6610
6571
|
return l << m | l >>> 32 - m;
|
6611
6572
|
}
|
6612
|
-
function i(l, m, d, w, E,
|
6613
|
-
return t(r(t(t(m, l), t(w,
|
6573
|
+
function i(l, m, d, w, E, S) {
|
6574
|
+
return t(r(t(t(m, l), t(w, S)), E), d);
|
6614
6575
|
}
|
6615
|
-
function s(l, m, d, w, E,
|
6616
|
-
return i(m & d | ~m & w, l, m, E,
|
6576
|
+
function s(l, m, d, w, E, S, R) {
|
6577
|
+
return i(m & d | ~m & w, l, m, E, S, R);
|
6617
6578
|
}
|
6618
|
-
function o(l, m, d, w, E,
|
6619
|
-
return i(m & w | d & ~w, l, m, E,
|
6579
|
+
function o(l, m, d, w, E, S, R) {
|
6580
|
+
return i(m & w | d & ~w, l, m, E, S, R);
|
6620
6581
|
}
|
6621
|
-
function a(l, m, d, w, E,
|
6622
|
-
return i(m ^ d ^ w, l, m, E,
|
6582
|
+
function a(l, m, d, w, E, S, R) {
|
6583
|
+
return i(m ^ d ^ w, l, m, E, S, R);
|
6623
6584
|
}
|
6624
|
-
function c(l, m, d, w, E,
|
6625
|
-
return i(d ^ (m | ~w), l, m, E,
|
6585
|
+
function c(l, m, d, w, E, S, R) {
|
6586
|
+
return i(d ^ (m | ~w), l, m, E, S, R);
|
6626
6587
|
}
|
6627
6588
|
function u(l, m) {
|
6628
6589
|
l[m >> 5] |= 128 << m % 32, l[(m + 64 >>> 9 << 4) + 14] = m;
|
6629
|
-
var d, w, E,
|
6590
|
+
var d, w, E, S, R, h = 1732584193, f = -271733879, p = -1732584194, g = 271733878;
|
6630
6591
|
for (d = 0; d < l.length; d += 16)
|
6631
|
-
w = h, E = f,
|
6592
|
+
w = h, E = f, S = p, R = g, h = s(h, f, p, g, l[d], 7, -680876936), g = s(g, h, f, p, l[d + 1], 12, -389564586), p = s(p, g, h, f, l[d + 2], 17, 606105819), f = s(f, p, g, h, l[d + 3], 22, -1044525330), h = s(h, f, p, g, l[d + 4], 7, -176418897), g = s(g, h, f, p, l[d + 5], 12, 1200080426), p = s(p, g, h, f, l[d + 6], 17, -1473231341), f = s(f, p, g, h, l[d + 7], 22, -45705983), h = s(h, f, p, g, l[d + 8], 7, 1770035416), g = s(g, h, f, p, l[d + 9], 12, -1958414417), p = s(p, g, h, f, l[d + 10], 17, -42063), f = s(f, p, g, h, l[d + 11], 22, -1990404162), h = s(h, f, p, g, l[d + 12], 7, 1804603682), g = s(g, h, f, p, l[d + 13], 12, -40341101), p = s(p, g, h, f, l[d + 14], 17, -1502002290), f = s(f, p, g, h, l[d + 15], 22, 1236535329), h = o(h, f, p, g, l[d + 1], 5, -165796510), g = o(g, h, f, p, l[d + 6], 9, -1069501632), p = o(p, g, h, f, l[d + 11], 14, 643717713), f = o(f, p, g, h, l[d], 20, -373897302), h = o(h, f, p, g, l[d + 5], 5, -701558691), g = o(g, h, f, p, l[d + 10], 9, 38016083), p = o(p, g, h, f, l[d + 15], 14, -660478335), f = o(f, p, g, h, l[d + 4], 20, -405537848), h = o(h, f, p, g, l[d + 9], 5, 568446438), g = o(g, h, f, p, l[d + 14], 9, -1019803690), p = o(p, g, h, f, l[d + 3], 14, -187363961), f = o(f, p, g, h, l[d + 8], 20, 1163531501), h = o(h, f, p, g, l[d + 13], 5, -1444681467), g = o(g, h, f, p, l[d + 2], 9, -51403784), p = o(p, g, h, f, l[d + 7], 14, 1735328473), f = o(f, p, g, h, l[d + 12], 20, -1926607734), h = a(h, f, p, g, l[d + 5], 4, -378558), g = a(g, h, f, p, l[d + 8], 11, -2022574463), p = a(p, g, h, f, l[d + 11], 16, 1839030562), f = a(f, p, g, h, l[d + 14], 23, -35309556), h = a(h, f, p, g, l[d + 1], 4, -1530992060), g = a(g, h, f, p, l[d + 4], 11, 1272893353), p = a(p, g, h, f, l[d + 7], 16, -155497632), f = a(f, p, g, h, l[d + 10], 23, -1094730640), h = a(h, f, p, g, l[d + 13], 4, 681279174), g = a(g, h, f, p, l[d], 11, -358537222), p = a(p, g, h, f, l[d + 3], 16, -722521979), f = a(f, p, g, h, l[d + 6], 23, 76029189), h = a(h, f, p, g, l[d + 9], 4, -640364487), g = a(g, h, f, p, l[d + 12], 11, -421815835), p = a(p, g, h, f, l[d + 15], 16, 530742520), f = a(f, p, g, h, l[d + 2], 23, -995338651), h = c(h, f, p, g, l[d], 6, -198630844), g = c(g, h, f, p, l[d + 7], 10, 1126891415), p = c(p, g, h, f, l[d + 14], 15, -1416354905), f = c(f, p, g, h, l[d + 5], 21, -57434055), h = c(h, f, p, g, l[d + 12], 6, 1700485571), g = c(g, h, f, p, l[d + 3], 10, -1894986606), p = c(p, g, h, f, l[d + 10], 15, -1051523), f = c(f, p, g, h, l[d + 1], 21, -2054922799), h = c(h, f, p, g, l[d + 8], 6, 1873313359), g = c(g, h, f, p, l[d + 15], 10, -30611744), p = c(p, g, h, f, l[d + 6], 15, -1560198380), f = c(f, p, g, h, l[d + 13], 21, 1309151649), h = c(h, f, p, g, l[d + 4], 6, -145523070), g = c(g, h, f, p, l[d + 11], 10, -1120210379), p = c(p, g, h, f, l[d + 2], 15, 718787259), f = c(f, p, g, h, l[d + 9], 21, -343485551), h = t(h, w), f = t(f, E), p = t(p, S), g = t(g, R);
|
6632
6593
|
return [h, f, p, g];
|
6633
6594
|
}
|
6634
|
-
function
|
6595
|
+
function y(l) {
|
6635
6596
|
var m, d = "", w = l.length * 32;
|
6636
6597
|
for (m = 0; m < w; m += 8)
|
6637
6598
|
d += String.fromCharCode(l[m >> 5] >>> m % 32 & 255);
|
@@ -6646,14 +6607,14 @@ var xn = { exports: {} };
|
|
6646
6607
|
d[m >> 5] |= (l.charCodeAt(m / 8) & 255) << m % 32;
|
6647
6608
|
return d;
|
6648
6609
|
}
|
6649
|
-
function
|
6650
|
-
return
|
6610
|
+
function A(l) {
|
6611
|
+
return y(u(b(l), l.length * 8));
|
6651
6612
|
}
|
6652
6613
|
function O(l, m) {
|
6653
|
-
var d, w = b(l), E = [],
|
6654
|
-
for (E[15] =
|
6655
|
-
E[d] = w[d] ^ 909522486,
|
6656
|
-
return R = u(E.concat(b(m)), 512 + m.length * 8),
|
6614
|
+
var d, w = b(l), E = [], S = [], R;
|
6615
|
+
for (E[15] = S[15] = void 0, w.length > 16 && (w = u(w, l.length * 8)), d = 0; d < 16; d += 1)
|
6616
|
+
E[d] = w[d] ^ 909522486, S[d] = w[d] ^ 1549556828;
|
6617
|
+
return R = u(E.concat(b(m)), 512 + m.length * 8), y(u(S.concat(R), 640));
|
6657
6618
|
}
|
6658
6619
|
function N(l) {
|
6659
6620
|
var m = "0123456789abcdef", d = "", w, E;
|
@@ -6661,17 +6622,17 @@ var xn = { exports: {} };
|
|
6661
6622
|
w = l.charCodeAt(E), d += m.charAt(w >>> 4 & 15) + m.charAt(w & 15);
|
6662
6623
|
return d;
|
6663
6624
|
}
|
6664
|
-
function
|
6625
|
+
function _(l) {
|
6665
6626
|
return unescape(encodeURIComponent(l));
|
6666
6627
|
}
|
6667
6628
|
function I(l) {
|
6668
|
-
return
|
6629
|
+
return A(_(l));
|
6669
6630
|
}
|
6670
6631
|
function k(l) {
|
6671
6632
|
return N(I(l));
|
6672
6633
|
}
|
6673
6634
|
function C(l, m) {
|
6674
|
-
return O(
|
6635
|
+
return O(_(l), _(m));
|
6675
6636
|
}
|
6676
6637
|
function U(l, m) {
|
6677
6638
|
return N(C(l, m));
|
@@ -6741,10 +6702,10 @@ const Ho = /* @__PURE__ */ Bo(Vo), _t = (n, e) => async (t, r = {}) => {
|
|
6741
6702
|
}, Wo = (n = {}) => Object.keys(n).length ? `?q=${JSON.stringify(n)}` : "", zo = (n) => [...n].reduce(
|
6742
6703
|
(e, t) => t === t.toUpperCase() ? `${e}-${t.toLowerCase()}` : `${e}${t}`,
|
6743
6704
|
""
|
6744
|
-
),
|
6705
|
+
), qo = (n) => `${n[0].toLowerCase()}${n.slice(1)}`, Jo = (n) => {
|
6745
6706
|
const e = zo(n);
|
6746
6707
|
return (t, r) => `/${e}${t ? `/${encodeURIComponent(t)}` : ""}${Wo(r)}`;
|
6747
|
-
},
|
6708
|
+
}, Jt = (n, e) => {
|
6748
6709
|
const t = Array.isArray(e.inputProps);
|
6749
6710
|
return Object.keys(n).reduce(
|
6750
6711
|
(r, i) => {
|
@@ -6762,8 +6723,8 @@ const Ho = /* @__PURE__ */ Bo(Vo), _t = (n, e) => async (t, r = {}) => {
|
|
6762
6723
|
primaryKey: n || "id",
|
6763
6724
|
properties: Object.keys(e || {}).reduce(
|
6764
6725
|
(r, i) => {
|
6765
|
-
var b,
|
6766
|
-
const s = e[i] || {}, { type: o, isScalar: a, isRequired: c, isRef: u = !1 } = typeof s.type == "string" ? s.type === "array" ? s.enum ? { type: "string", isScalar: !1, isRequired: !1 } : (b = s.items) != null && b.$ref ? { type: s.items.$ref.split("/").pop(), isScalar: !1, isRequired: !1, isRef: !0 } : { type: (
|
6726
|
+
var b, A;
|
6727
|
+
const s = e[i] || {}, { type: o, isScalar: a, isRequired: c, isRef: u = !1 } = typeof s.type == "string" ? s.type === "array" ? s.enum ? { type: "string", isScalar: !1, isRequired: !1 } : (b = s.items) != null && b.$ref ? { type: s.items.$ref.split("/").pop(), isScalar: !1, isRequired: !1, isRef: !0 } : { type: (A = s.items) == null ? void 0 : A.type, isScalar: !1, isRequired: !1 } : { type: s.format === "date-time" ? "date" : s.type, isScalar: !0, isRequired: !0 } : Array.isArray(s.type) ? s.type.length === 2 ? { type: s.format === "date-time" ? "date" : s.type[0], isScalar: !0, isRequired: !1 } : { type: "json", isScalar: !0, isRequired: s.type.includes("null") } : s.$ref ? { type: s.$ref.split("/").pop(), isScalar: !0, isRequired: !0, isRef: !0 } : { type: s.anyOf[0].$ref.split("/").pop(), isScalar: !0, isRequired: !1, isRef: !0 }, y = s.inputType || (o === "integer" ? "number" : o);
|
6767
6728
|
return {
|
6768
6729
|
...r,
|
6769
6730
|
[i]: {
|
@@ -6772,7 +6733,7 @@ const Ho = /* @__PURE__ */ Bo(Vo), _t = (n, e) => async (t, r = {}) => {
|
|
6772
6733
|
isScalar: a,
|
6773
6734
|
isRequired: typeof s.isRequired == "boolean" ? s.isRequired : c,
|
6774
6735
|
isRef: u,
|
6775
|
-
inputType:
|
6736
|
+
inputType: y
|
6776
6737
|
}
|
6777
6738
|
};
|
6778
6739
|
},
|
@@ -6780,53 +6741,53 @@ const Ho = /* @__PURE__ */ Bo(Vo), _t = (n, e) => async (t, r = {}) => {
|
|
6780
6741
|
),
|
6781
6742
|
...t
|
6782
6743
|
}), Ko = (n, e, t, r = {}, i = {}) => {
|
6783
|
-
const s = Go(r), { primaryKey: o, properties: a } = s, c = xo(s), u =
|
6744
|
+
const s = Go(r), { primaryKey: o, properties: a } = s, c = xo(s), u = Jo(t), y = (..._) => _t(n, e.authUser)(..._), b = ({ data: _, ...I }) => y(u(null, I), {
|
6784
6745
|
method: "POST",
|
6785
|
-
body:
|
6786
|
-
}),
|
6746
|
+
body: Jt(_, s)
|
6747
|
+
}), A = ({ data: _, ...I }) => {
|
6787
6748
|
const { where: k, ...C } = I;
|
6788
|
-
return
|
6749
|
+
return y(u(k[o], C), {
|
6789
6750
|
method: "PUT",
|
6790
|
-
body:
|
6751
|
+
body: Jt(_, s)
|
6791
6752
|
});
|
6792
|
-
}, O = (
|
6793
|
-
if (!
|
6794
|
-
return
|
6795
|
-
const I = Object.keys(
|
6753
|
+
}, O = (_) => {
|
6754
|
+
if (!_)
|
6755
|
+
return _;
|
6756
|
+
const I = Object.keys(_).reduce(
|
6796
6757
|
(k, C) => {
|
6797
6758
|
var E;
|
6798
6759
|
const U = a[C] || {}, { type: D, isScalar: l, isRef: m, format: d, items: w } = U;
|
6799
6760
|
if (m) {
|
6800
|
-
const
|
6761
|
+
const S = qo(D);
|
6801
6762
|
return l ? {
|
6802
6763
|
...k,
|
6803
|
-
[C]: i[
|
6764
|
+
[C]: i[S].parse(_[C])
|
6804
6765
|
} : {
|
6805
6766
|
...k,
|
6806
|
-
[C]: typeof ((E = i[
|
6767
|
+
[C]: typeof ((E = i[S]) == null ? void 0 : E.parse) == "function" ? _[C].map((R) => i[S].parse(R)) : _[C]
|
6807
6768
|
};
|
6808
6769
|
}
|
6809
6770
|
return {
|
6810
6771
|
...k,
|
6811
|
-
[C]: D === "date" &&
|
6772
|
+
[C]: D === "date" && _[C] ? new Date(_[C]) : _[C]
|
6812
6773
|
};
|
6813
6774
|
},
|
6814
6775
|
{}
|
6815
6776
|
);
|
6816
6777
|
return typeof s.parse == "function" ? s.parse(I) : I;
|
6817
6778
|
}, N = Object.keys(a || {}).reduce(
|
6818
|
-
(
|
6819
|
-
all:
|
6820
|
-
oneToOne:
|
6821
|
-
requiredOneToOne:
|
6822
|
-
}) : a[I].isRef && a[I].isScalar ? Object.assign(
|
6823
|
-
all:
|
6824
|
-
oneToOne:
|
6825
|
-
optionalOneToOne:
|
6826
|
-
}) : a[I].isRef ? Object.assign(
|
6827
|
-
all:
|
6828
|
-
oneToMany:
|
6829
|
-
}) :
|
6779
|
+
(_, I) => a[I].isRef && a[I].isScalar && a[I].isRequired ? Object.assign(_, {
|
6780
|
+
all: _.all.concat(I),
|
6781
|
+
oneToOne: _.oneToOne.concat(I),
|
6782
|
+
requiredOneToOne: _.requiredOneToOne.concat(I)
|
6783
|
+
}) : a[I].isRef && a[I].isScalar ? Object.assign(_, {
|
6784
|
+
all: _.all.concat(I),
|
6785
|
+
oneToOne: _.oneToOne.concat(I),
|
6786
|
+
optionalOneToOne: _.optionalOneToOne.concat(I)
|
6787
|
+
}) : a[I].isRef ? Object.assign(_, {
|
6788
|
+
all: _.all.concat(I),
|
6789
|
+
oneToMany: _.oneToMany.concat(I)
|
6790
|
+
}) : _,
|
6830
6791
|
{
|
6831
6792
|
all: [],
|
6832
6793
|
oneToOne: [],
|
@@ -6845,24 +6806,24 @@ const Ho = /* @__PURE__ */ Bo(Vo), _t = (n, e) => async (t, r = {}) => {
|
|
6845
6806
|
parse: O,
|
6846
6807
|
validateAttr: c.validateAttr,
|
6847
6808
|
validate: c.validate,
|
6848
|
-
findMany: (
|
6849
|
-
findById: (
|
6809
|
+
findMany: (_) => y(u(null, _)).then((I) => I.map(O)),
|
6810
|
+
findById: (_, I) => y(u(_, I)).then(O),
|
6850
6811
|
create: b,
|
6851
|
-
update:
|
6852
|
-
upsert: (
|
6853
|
-
delete: (
|
6854
|
-
stats: () =>
|
6855
|
-
search: (
|
6812
|
+
update: A,
|
6813
|
+
upsert: (_) => _.where[o] ? A({ where: _.where, data: _.update }) : b({ data: _.create }),
|
6814
|
+
delete: (_) => y(u(_), { method: "DELETE" }),
|
6815
|
+
stats: () => y(u("_stats")),
|
6816
|
+
search: (_, I = {}) => {
|
6856
6817
|
var d;
|
6857
|
-
const { searchProps: k } = s, U =
|
6818
|
+
const { searchProps: k } = s, U = _.split(" ").reduce(
|
6858
6819
|
(w, E) => [
|
6859
6820
|
...w,
|
6860
6821
|
{
|
6861
6822
|
OR: k.reduce(
|
6862
|
-
(
|
6823
|
+
(S, R) => {
|
6863
6824
|
const h = R.split(".");
|
6864
6825
|
return [
|
6865
|
-
...
|
6826
|
+
...S,
|
6866
6827
|
h.reduceRight(
|
6867
6828
|
(f, p) => ({ [p]: f }),
|
6868
6829
|
{ contains: E, mode: "insensitive" }
|
@@ -6875,7 +6836,7 @@ const Ho = /* @__PURE__ */ Bo(Vo), _t = (n, e) => async (t, r = {}) => {
|
|
6875
6836
|
],
|
6876
6837
|
[]
|
6877
6838
|
), D = { ...I.select, ...I.include }, l = (d = s.defaultProps) != null && d.length ? Object.assign(...s.defaultProps.map((w) => ({ [w]: !0 }))) : null, m = Object.keys(D).length ? D : l;
|
6878
|
-
return
|
6839
|
+
return y(u(null, {
|
6879
6840
|
where: {
|
6880
6841
|
...I.where,
|
6881
6842
|
AND: U
|
@@ -8189,6 +8150,12 @@ const Ho = /* @__PURE__ */ Bo(Vo), _t = (n, e) => async (t, r = {}) => {
|
|
8189
8150
|
projectVersion: {
|
8190
8151
|
type: "string"
|
8191
8152
|
},
|
8153
|
+
projectVariant: {
|
8154
|
+
type: [
|
8155
|
+
"string",
|
8156
|
+
"null"
|
8157
|
+
]
|
8158
|
+
},
|
8192
8159
|
links: {
|
8193
8160
|
type: "array",
|
8194
8161
|
items: {
|
@@ -9231,6 +9198,35 @@ const Ho = /* @__PURE__ */ Bo(Vo), _t = (n, e) => async (t, r = {}) => {
|
|
9231
9198
|
$ref: "#/definitions/Track"
|
9232
9199
|
}
|
9233
9200
|
}
|
9201
|
+
},
|
9202
|
+
JobSeenLocation: {
|
9203
|
+
type: "object",
|
9204
|
+
properties: {
|
9205
|
+
id: {
|
9206
|
+
type: "integer"
|
9207
|
+
},
|
9208
|
+
createdAt: {
|
9209
|
+
type: "string",
|
9210
|
+
format: "date-time"
|
9211
|
+
},
|
9212
|
+
updatedAt: {
|
9213
|
+
type: "string",
|
9214
|
+
format: "date-time"
|
9215
|
+
},
|
9216
|
+
createdBy: {
|
9217
|
+
type: [
|
9218
|
+
"string",
|
9219
|
+
"null"
|
9220
|
+
]
|
9221
|
+
},
|
9222
|
+
location: {
|
9223
|
+
type: "string"
|
9224
|
+
},
|
9225
|
+
seenTimes: {
|
9226
|
+
type: "integer",
|
9227
|
+
default: 1
|
9228
|
+
}
|
9229
|
+
}
|
9234
9230
|
}
|
9235
9231
|
}, ea = "object", ta = {
|
9236
9232
|
country: {
|
@@ -9346,6 +9342,9 @@ const Ho = /* @__PURE__ */ Bo(Vo), _t = (n, e) => async (t, r = {}) => {
|
|
9346
9342
|
},
|
9347
9343
|
jobReviewTrack: {
|
9348
9344
|
$ref: "#/definitions/JobReviewTrack"
|
9345
|
+
},
|
9346
|
+
jobSeenLocation: {
|
9347
|
+
$ref: "#/definitions/JobSeenLocation"
|
9349
9348
|
}
|
9350
9349
|
}, ot = {
|
9351
9350
|
$schema: Xo,
|
@@ -9669,19 +9668,29 @@ const Ho = /* @__PURE__ */ Bo(Vo), _t = (n, e) => async (t, r = {}) => {
|
|
9669
9668
|
getEntries: async (t) => await _t(n, e.authUser)(`/gcp-logs?q=${JSON.stringify(t)}`)
|
9670
9669
|
}
|
9671
9670
|
}), Kt = (n) => typeof n == "string" ? { id: n } : n, Yt = (n) => {
|
9672
|
-
var
|
9673
|
-
|
9671
|
+
var t;
|
9672
|
+
const e = {
|
9674
9673
|
...n,
|
9675
9674
|
...!!n.learningObjectives && {
|
9676
9675
|
learningObjectives: n.learningObjectives.map(Kt)
|
9677
9676
|
},
|
9678
|
-
...!!((
|
9679
|
-
variants: n.variants.map((
|
9680
|
-
...
|
9681
|
-
learningObjectives:
|
9677
|
+
...!!((t = n.variants) != null && t.length) && {
|
9678
|
+
variants: n.variants.map((r) => ({
|
9679
|
+
...r,
|
9680
|
+
learningObjectives: r.learningObjectives.map(Kt)
|
9682
9681
|
}))
|
9683
9682
|
}
|
9684
9683
|
};
|
9684
|
+
return Object.assign(e, {
|
9685
|
+
getCombinedLearningObjectives: (r) => {
|
9686
|
+
var o;
|
9687
|
+
const i = (o = e.variants) == null ? void 0 : o.find(({ name: a }) => a === r);
|
9688
|
+
return [
|
9689
|
+
...(i == null ? void 0 : i.learningObjectives) || [],
|
9690
|
+
...e.learningObjectives || []
|
9691
|
+
];
|
9692
|
+
}
|
9693
|
+
});
|
9685
9694
|
}, sa = (n, e) => {
|
9686
9695
|
const t = _t(n, e.authUser);
|
9687
9696
|
return {
|
@@ -9742,19 +9751,19 @@ const Ho = /* @__PURE__ */ Bo(Vo), _t = (n, e) => async (t, r = {}) => {
|
|
9742
9751
|
...sa(t, s),
|
9743
9752
|
...o,
|
9744
9753
|
auth: {
|
9745
|
-
onChange: (u) => Es(i, (
|
9746
|
-
if (!
|
9754
|
+
onChange: (u) => Es(i, (y) => {
|
9755
|
+
if (!y)
|
9747
9756
|
return Object.assign(s, { authUser: null, user: null }), u(s);
|
9748
|
-
Object.assign(s, { authUser:
|
9757
|
+
Object.assign(s, { authUser: y }), o.user.findById(y.uid).then((b) => {
|
9749
9758
|
Object.assign(s, { user: b }), u(s);
|
9750
9759
|
}).catch((b) => {
|
9751
9760
|
console.error(b), Object.assign(s, { authUser: null, user: null }), u(s);
|
9752
9761
|
});
|
9753
9762
|
}),
|
9754
|
-
signIn: (u,
|
9763
|
+
signIn: (u, y) => bs(
|
9755
9764
|
i,
|
9756
9765
|
u,
|
9757
|
-
|
9766
|
+
y
|
9758
9767
|
),
|
9759
9768
|
signOut: () => Ts(i),
|
9760
9769
|
sendPasswordResetEmail: (u) => vs(i, u)
|
@@ -9771,5 +9780,6 @@ export {
|
|
9771
9780
|
aa as formatTime,
|
9772
9781
|
ha as getAgeAt,
|
9773
9782
|
ga as loadFromLocalStorage,
|
9774
|
-
pa as parseCurrency
|
9783
|
+
pa as parseCurrency,
|
9784
|
+
Yt as parseProject
|
9775
9785
|
};
|