@laboratoria/sdk-js 6.0.0 → 6.1.0-beta.1
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 +1188 -833
- package/dist/laboratoria-sdk-umd.js +97 -97
- package/package.json +5 -5
@@ -30,7 +30,7 @@
|
|
30
30
|
* See the License for the specific language governing permissions and
|
31
31
|
* limitations under the License.
|
32
32
|
*/
|
33
|
-
const
|
33
|
+
const qt = function(n) {
|
34
34
|
const e = [];
|
35
35
|
let t = 0;
|
36
36
|
for (let r = 0; r < n.length; r++) {
|
@@ -38,7 +38,7 @@ const Gt = function(n) {
|
|
38
38
|
i < 128 ? e[t++] = i : i < 2048 ? (e[t++] = i >> 6 | 192, e[t++] = i & 63 | 128) : (i & 64512) === 55296 && r + 1 < n.length && (n.charCodeAt(r + 1) & 64512) === 56320 ? (i = 65536 + ((i & 1023) << 10) + (n.charCodeAt(++r) & 1023), e[t++] = i >> 18 | 240, e[t++] = i >> 12 & 63 | 128, e[t++] = i >> 6 & 63 | 128, e[t++] = i & 63 | 128) : (e[t++] = i >> 12 | 224, e[t++] = i >> 6 & 63 | 128, e[t++] = i & 63 | 128);
|
39
39
|
}
|
40
40
|
return e;
|
41
|
-
},
|
41
|
+
}, Mn = function(n) {
|
42
42
|
const e = [];
|
43
43
|
let t = 0, r = 0;
|
44
44
|
for (; t < n.length; ) {
|
@@ -57,7 +57,7 @@ const Gt = function(n) {
|
|
57
57
|
}
|
58
58
|
}
|
59
59
|
return e.join("");
|
60
|
-
},
|
60
|
+
}, zt = {
|
61
61
|
/**
|
62
62
|
* Maps bytes to characters.
|
63
63
|
*/
|
@@ -131,7 +131,7 @@ const Gt = function(n) {
|
|
131
131
|
* @return The base64 encoded string.
|
132
132
|
*/
|
133
133
|
encodeString(n, e) {
|
134
|
-
return this.HAS_NATIVE_SUPPORT && !e ? btoa(n) : this.encodeByteArray(
|
134
|
+
return this.HAS_NATIVE_SUPPORT && !e ? btoa(n) : this.encodeByteArray(qt(n), e);
|
135
135
|
},
|
136
136
|
/**
|
137
137
|
* Base64-decode a string.
|
@@ -142,7 +142,7 @@ const Gt = function(n) {
|
|
142
142
|
* @return string representing the decoded value.
|
143
143
|
*/
|
144
144
|
decodeString(n, e) {
|
145
|
-
return this.HAS_NATIVE_SUPPORT && !e ? atob(n) :
|
145
|
+
return this.HAS_NATIVE_SUPPORT && !e ? atob(n) : Mn(this.decodeStringToByteArray(n, e));
|
146
146
|
},
|
147
147
|
/**
|
148
148
|
* Base64-decode a string.
|
@@ -169,7 +169,7 @@ const Gt = function(n) {
|
|
169
169
|
++i;
|
170
170
|
const b = i < n.length ? t[n.charAt(i)] : 64;
|
171
171
|
if (++i, s == null || c == null || u == null || b == null)
|
172
|
-
throw new
|
172
|
+
throw new Un();
|
173
173
|
const A = s << 2 | c >> 4;
|
174
174
|
if (r.push(A), u !== 64) {
|
175
175
|
const P = c << 4 & 240 | u >> 2;
|
@@ -194,19 +194,19 @@ const Gt = function(n) {
|
|
194
194
|
}
|
195
195
|
}
|
196
196
|
};
|
197
|
-
class
|
197
|
+
class Un extends Error {
|
198
198
|
constructor() {
|
199
199
|
super(...arguments), this.name = "DecodeBase64StringError";
|
200
200
|
}
|
201
201
|
}
|
202
|
-
const
|
203
|
-
const e =
|
204
|
-
return
|
202
|
+
const jn = function(n) {
|
203
|
+
const e = qt(n);
|
204
|
+
return zt.encodeByteArray(e, !0);
|
205
205
|
}, Jt = function(n) {
|
206
|
-
return
|
207
|
-
},
|
206
|
+
return jn(n).replace(/\./g, "");
|
207
|
+
}, Gt = function(n) {
|
208
208
|
try {
|
209
|
-
return
|
209
|
+
return zt.decodeString(n, !0);
|
210
210
|
} catch (e) {
|
211
211
|
console.error("base64Decode failed: ", e);
|
212
212
|
}
|
@@ -228,7 +228,7 @@ const Vn = 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 Bn() {
|
232
232
|
if (typeof self < "u")
|
233
233
|
return self;
|
234
234
|
if (typeof window < "u")
|
@@ -253,13 +253,13 @@ function Hn() {
|
|
253
253
|
* See the License for the specific language governing permissions and
|
254
254
|
* limitations under the License.
|
255
255
|
*/
|
256
|
-
const
|
256
|
+
const Fn = () => Bn().__FIREBASE_DEFAULTS__, Hn = () => {
|
257
257
|
if (typeof process > "u" || typeof process.env > "u")
|
258
258
|
return;
|
259
259
|
const n = process.env.__FIREBASE_DEFAULTS__;
|
260
260
|
if (n)
|
261
261
|
return JSON.parse(n);
|
262
|
-
},
|
262
|
+
}, Vn = () => {
|
263
263
|
if (typeof document > "u")
|
264
264
|
return;
|
265
265
|
let n;
|
@@ -268,24 +268,24 @@ const Wn = () => Hn().__FIREBASE_DEFAULTS__, xn = () => {
|
|
268
268
|
} catch {
|
269
269
|
return;
|
270
270
|
}
|
271
|
-
const e = n &&
|
271
|
+
const e = n && Gt(n[1]);
|
272
272
|
return e && JSON.parse(e);
|
273
|
-
},
|
273
|
+
}, st = () => {
|
274
274
|
try {
|
275
|
-
return
|
275
|
+
return Fn() || Hn() || Vn();
|
276
276
|
} catch (n) {
|
277
277
|
console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);
|
278
278
|
return;
|
279
279
|
}
|
280
|
-
},
|
280
|
+
}, Wn = (n) => {
|
281
281
|
var e, t;
|
282
|
-
return (t = (e =
|
283
|
-
},
|
282
|
+
return (t = (e = st()) === null || e === void 0 ? void 0 : e.emulatorHosts) === null || t === void 0 ? void 0 : t[n];
|
283
|
+
}, Kt = () => {
|
284
284
|
var n;
|
285
|
-
return (n =
|
286
|
-
},
|
285
|
+
return (n = st()) === null || n === void 0 ? void 0 : n.config;
|
286
|
+
}, Yt = (n) => {
|
287
287
|
var e;
|
288
|
-
return (e =
|
288
|
+
return (e = st()) === null || e === void 0 ? void 0 : e[`_${n}`];
|
289
289
|
};
|
290
290
|
/**
|
291
291
|
* @license
|
@@ -303,7 +303,7 @@ const Wn = () => Hn().__FIREBASE_DEFAULTS__, xn = () => {
|
|
303
303
|
* See the License for the specific language governing permissions and
|
304
304
|
* limitations under the License.
|
305
305
|
*/
|
306
|
-
class
|
306
|
+
class xn {
|
307
307
|
constructor() {
|
308
308
|
this.reject = () => {
|
309
309
|
}, this.resolve = () => {
|
@@ -342,30 +342,30 @@ class Gn {
|
|
342
342
|
function R() {
|
343
343
|
return typeof navigator < "u" && typeof navigator.userAgent == "string" ? navigator.userAgent : "";
|
344
344
|
}
|
345
|
-
function
|
345
|
+
function qn() {
|
346
346
|
return typeof window < "u" && // @ts-ignore Setting up an broadly applicable index signature for Window
|
347
347
|
// just to deal with this case would probably be a bad idea.
|
348
348
|
!!(window.cordova || window.phonegap || window.PhoneGap) && /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(R());
|
349
349
|
}
|
350
|
-
function
|
350
|
+
function zn() {
|
351
351
|
const n = typeof chrome == "object" ? chrome.runtime : typeof browser == "object" ? browser.runtime : void 0;
|
352
352
|
return typeof n == "object" && n.id !== void 0;
|
353
353
|
}
|
354
|
-
function
|
354
|
+
function Jn() {
|
355
355
|
return typeof navigator == "object" && navigator.product === "ReactNative";
|
356
356
|
}
|
357
|
-
function
|
357
|
+
function Gn() {
|
358
358
|
const n = R();
|
359
359
|
return n.indexOf("MSIE ") >= 0 || n.indexOf("Trident/") >= 0;
|
360
360
|
}
|
361
|
-
function
|
361
|
+
function Kn() {
|
362
362
|
try {
|
363
363
|
return typeof indexedDB == "object";
|
364
364
|
} catch {
|
365
365
|
return !1;
|
366
366
|
}
|
367
367
|
}
|
368
|
-
function
|
368
|
+
function Yn() {
|
369
369
|
return new Promise((n, e) => {
|
370
370
|
try {
|
371
371
|
let t = !0;
|
@@ -399,10 +399,10 @@ function Zn() {
|
|
399
399
|
* See the License for the specific language governing permissions and
|
400
400
|
* limitations under the License.
|
401
401
|
*/
|
402
|
-
const
|
403
|
-
class
|
402
|
+
const Qn = "FirebaseError";
|
403
|
+
class G extends Error {
|
404
404
|
constructor(e, t, r) {
|
405
|
-
super(t), this.code = e, this.customData = r, this.name =
|
405
|
+
super(t), this.code = e, this.customData = r, this.name = Qn, Object.setPrototypeOf(this, G.prototype), Error.captureStackTrace && Error.captureStackTrace(this, _e.prototype.create);
|
406
406
|
}
|
407
407
|
}
|
408
408
|
class _e {
|
@@ -410,24 +410,24 @@ class _e {
|
|
410
410
|
this.service = e, this.serviceName = t, this.errors = r;
|
411
411
|
}
|
412
412
|
create(e, ...t) {
|
413
|
-
const r = t[0] || {}, i = `${this.service}/${e}`, s = this.errors[e], o = s ?
|
414
|
-
return new
|
413
|
+
const r = t[0] || {}, i = `${this.service}/${e}`, s = this.errors[e], o = s ? Xn(s, r) : "Error", c = `${this.serviceName}: ${o} (${i}).`;
|
414
|
+
return new G(i, c, r);
|
415
415
|
}
|
416
416
|
}
|
417
|
-
function
|
418
|
-
return n.replace(
|
417
|
+
function Xn(n, e) {
|
418
|
+
return n.replace(Zn, (t, r) => {
|
419
419
|
const i = e[r];
|
420
420
|
return i != null ? String(i) : `<${r}?>`;
|
421
421
|
});
|
422
422
|
}
|
423
|
-
const
|
424
|
-
function
|
423
|
+
const Zn = /\{\$([^}]+)}/g;
|
424
|
+
function er(n) {
|
425
425
|
for (const e in n)
|
426
426
|
if (Object.prototype.hasOwnProperty.call(n, e))
|
427
427
|
return !1;
|
428
428
|
return !0;
|
429
429
|
}
|
430
|
-
function
|
430
|
+
function Pe(n, e) {
|
431
431
|
if (n === e)
|
432
432
|
return !0;
|
433
433
|
const t = Object.keys(n), r = Object.keys(e);
|
@@ -435,8 +435,8 @@ function ke(n, e) {
|
|
435
435
|
if (!r.includes(i))
|
436
436
|
return !1;
|
437
437
|
const s = n[i], o = e[i];
|
438
|
-
if (
|
439
|
-
if (!
|
438
|
+
if (yt(s) && yt(o)) {
|
439
|
+
if (!Pe(s, o))
|
440
440
|
return !1;
|
441
441
|
} else if (s !== o)
|
442
442
|
return !1;
|
@@ -446,7 +446,7 @@ function ke(n, e) {
|
|
446
446
|
return !1;
|
447
447
|
return !0;
|
448
448
|
}
|
449
|
-
function
|
449
|
+
function yt(n) {
|
450
450
|
return n !== null && typeof n == "object";
|
451
451
|
}
|
452
452
|
/**
|
@@ -489,11 +489,11 @@ function ue(n) {
|
|
489
489
|
const t = n.indexOf("#", e);
|
490
490
|
return n.substring(e, t > 0 ? t : void 0);
|
491
491
|
}
|
492
|
-
function
|
493
|
-
const t = new
|
492
|
+
function tr(n, e) {
|
493
|
+
const t = new nr(n, e);
|
494
494
|
return t.subscribe.bind(t);
|
495
495
|
}
|
496
|
-
class
|
496
|
+
class nr {
|
497
497
|
/**
|
498
498
|
* @param executor Function which can make calls to a single Observer
|
499
499
|
* as a proxy.
|
@@ -531,7 +531,7 @@ class sr {
|
|
531
531
|
let i;
|
532
532
|
if (e === void 0 && t === void 0 && r === void 0)
|
533
533
|
throw new Error("Missing Observer.");
|
534
|
-
|
534
|
+
rr(e, [
|
535
535
|
"next",
|
536
536
|
"error",
|
537
537
|
"complete"
|
@@ -539,7 +539,7 @@ class sr {
|
|
539
539
|
next: e,
|
540
540
|
error: t,
|
541
541
|
complete: r
|
542
|
-
}, i.next === void 0 && (i.next =
|
542
|
+
}, i.next === void 0 && (i.next = Ve), i.error === void 0 && (i.error = Ve), i.complete === void 0 && (i.complete = Ve);
|
543
543
|
const s = this.unsubscribeOne.bind(this, this.observers.length);
|
544
544
|
return this.finalized && this.task.then(() => {
|
545
545
|
try {
|
@@ -577,7 +577,7 @@ class sr {
|
|
577
577
|
}));
|
578
578
|
}
|
579
579
|
}
|
580
|
-
function
|
580
|
+
function rr(n, e) {
|
581
581
|
if (typeof n != "object" || n === null)
|
582
582
|
return !1;
|
583
583
|
for (const t of e)
|
@@ -585,7 +585,7 @@ function or(n, e) {
|
|
585
585
|
return !0;
|
586
586
|
return !1;
|
587
587
|
}
|
588
|
-
function
|
588
|
+
function Ve() {
|
589
589
|
}
|
590
590
|
/**
|
591
591
|
* @license
|
@@ -603,7 +603,7 @@ function xe() {
|
|
603
603
|
* See the License for the specific language governing permissions and
|
604
604
|
* limitations under the License.
|
605
605
|
*/
|
606
|
-
function
|
606
|
+
function B(n) {
|
607
607
|
return n && n._delegate ? n._delegate : n;
|
608
608
|
}
|
609
609
|
class ae {
|
@@ -645,7 +645,7 @@ class ae {
|
|
645
645
|
* See the License for the specific language governing permissions and
|
646
646
|
* limitations under the License.
|
647
647
|
*/
|
648
|
-
const
|
648
|
+
const Q = "[DEFAULT]";
|
649
649
|
/**
|
650
650
|
* @license
|
651
651
|
* Copyright 2019 Google LLC
|
@@ -662,7 +662,7 @@ const X = "[DEFAULT]";
|
|
662
662
|
* See the License for the specific language governing permissions and
|
663
663
|
* limitations under the License.
|
664
664
|
*/
|
665
|
-
class
|
665
|
+
class ir {
|
666
666
|
constructor(e, t) {
|
667
667
|
this.name = e, this.container = t, this.component = null, this.instances = /* @__PURE__ */ new Map(), this.instancesDeferred = /* @__PURE__ */ new Map(), this.instancesOptions = /* @__PURE__ */ new Map(), this.onInitCallbacks = /* @__PURE__ */ new Map();
|
668
668
|
}
|
@@ -673,7 +673,7 @@ class ar {
|
|
673
673
|
get(e) {
|
674
674
|
const t = this.normalizeInstanceIdentifier(e);
|
675
675
|
if (!this.instancesDeferred.has(t)) {
|
676
|
-
const r = new
|
676
|
+
const r = new xn();
|
677
677
|
if (this.instancesDeferred.set(t, r), this.isInitialized(t) || this.shouldAutoInitialize())
|
678
678
|
try {
|
679
679
|
const i = this.getOrInitializeService({
|
@@ -713,9 +713,9 @@ class ar {
|
|
713
713
|
if (this.component)
|
714
714
|
throw Error(`Component for ${this.name} has already been provided`);
|
715
715
|
if (this.component = e, !!this.shouldAutoInitialize()) {
|
716
|
-
if (
|
716
|
+
if (or(e))
|
717
717
|
try {
|
718
|
-
this.getOrInitializeService({ instanceIdentifier:
|
718
|
+
this.getOrInitializeService({ instanceIdentifier: Q });
|
719
719
|
} catch {
|
720
720
|
}
|
721
721
|
for (const [t, r] of this.instancesDeferred.entries()) {
|
@@ -730,7 +730,7 @@ class ar {
|
|
730
730
|
}
|
731
731
|
}
|
732
732
|
}
|
733
|
-
clearInstance(e =
|
733
|
+
clearInstance(e = Q) {
|
734
734
|
this.instancesDeferred.delete(e), this.instancesOptions.delete(e), this.instances.delete(e);
|
735
735
|
}
|
736
736
|
// app.delete() will call this method on every provider to delete the services
|
@@ -745,10 +745,10 @@ class ar {
|
|
745
745
|
isComponentSet() {
|
746
746
|
return this.component != null;
|
747
747
|
}
|
748
|
-
isInitialized(e =
|
748
|
+
isInitialized(e = Q) {
|
749
749
|
return this.instances.has(e);
|
750
750
|
}
|
751
|
-
getOptions(e =
|
751
|
+
getOptions(e = Q) {
|
752
752
|
return this.instancesOptions.get(e) || {};
|
753
753
|
}
|
754
754
|
initialize(e = {}) {
|
@@ -800,7 +800,7 @@ class ar {
|
|
800
800
|
getOrInitializeService({ instanceIdentifier: e, options: t = {} }) {
|
801
801
|
let r = this.instances.get(e);
|
802
802
|
if (!r && this.component && (r = this.component.instanceFactory(this.container, {
|
803
|
-
instanceIdentifier:
|
803
|
+
instanceIdentifier: sr(e),
|
804
804
|
options: t
|
805
805
|
}), this.instances.set(e, r), this.instancesOptions.set(e, t), this.invokeOnInitCallbacks(r, e), this.component.onInstanceCreated))
|
806
806
|
try {
|
@@ -809,17 +809,17 @@ class ar {
|
|
809
809
|
}
|
810
810
|
return r || null;
|
811
811
|
}
|
812
|
-
normalizeInstanceIdentifier(e =
|
813
|
-
return this.component ? this.component.multipleInstances ? e :
|
812
|
+
normalizeInstanceIdentifier(e = Q) {
|
813
|
+
return this.component ? this.component.multipleInstances ? e : Q : e;
|
814
814
|
}
|
815
815
|
shouldAutoInitialize() {
|
816
816
|
return !!this.component && this.component.instantiationMode !== "EXPLICIT";
|
817
817
|
}
|
818
818
|
}
|
819
|
-
function
|
820
|
-
return n ===
|
819
|
+
function sr(n) {
|
820
|
+
return n === Q ? void 0 : n;
|
821
821
|
}
|
822
|
-
function
|
822
|
+
function or(n) {
|
823
823
|
return n.instantiationMode === "EAGER";
|
824
824
|
}
|
825
825
|
/**
|
@@ -838,7 +838,7 @@ function lr(n) {
|
|
838
838
|
* See the License for the specific language governing permissions and
|
839
839
|
* limitations under the License.
|
840
840
|
*/
|
841
|
-
class
|
841
|
+
class ar {
|
842
842
|
constructor(e) {
|
843
843
|
this.name = e, this.providers = /* @__PURE__ */ new Map();
|
844
844
|
}
|
@@ -870,7 +870,7 @@ class dr {
|
|
870
870
|
getProvider(e) {
|
871
871
|
if (this.providers.has(e))
|
872
872
|
return this.providers.get(e);
|
873
|
-
const t = new
|
873
|
+
const t = new ir(e, this);
|
874
874
|
return this.providers.set(e, t), t;
|
875
875
|
}
|
876
876
|
getProviders() {
|
@@ -897,29 +897,29 @@ var T;
|
|
897
897
|
(function(n) {
|
898
898
|
n[n.DEBUG = 0] = "DEBUG", n[n.VERBOSE = 1] = "VERBOSE", n[n.INFO = 2] = "INFO", n[n.WARN = 3] = "WARN", n[n.ERROR = 4] = "ERROR", n[n.SILENT = 5] = "SILENT";
|
899
899
|
})(T || (T = {}));
|
900
|
-
const
|
900
|
+
const cr = {
|
901
901
|
debug: T.DEBUG,
|
902
902
|
verbose: T.VERBOSE,
|
903
903
|
info: T.INFO,
|
904
904
|
warn: T.WARN,
|
905
905
|
error: T.ERROR,
|
906
906
|
silent: T.SILENT
|
907
|
-
},
|
907
|
+
}, lr = T.INFO, dr = {
|
908
908
|
[T.DEBUG]: "log",
|
909
909
|
[T.VERBOSE]: "log",
|
910
910
|
[T.INFO]: "info",
|
911
911
|
[T.WARN]: "warn",
|
912
912
|
[T.ERROR]: "error"
|
913
|
-
},
|
913
|
+
}, ur = (n, e, ...t) => {
|
914
914
|
if (e < n.logLevel)
|
915
915
|
return;
|
916
|
-
const r = (/* @__PURE__ */ new Date()).toISOString(), i =
|
916
|
+
const r = (/* @__PURE__ */ new Date()).toISOString(), i = dr[e];
|
917
917
|
if (i)
|
918
918
|
console[i](`[${r}] ${n.name}:`, ...t);
|
919
919
|
else
|
920
920
|
throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`);
|
921
921
|
};
|
922
|
-
class
|
922
|
+
class Qt {
|
923
923
|
/**
|
924
924
|
* Gives you an instance of a Logger to capture messages according to
|
925
925
|
* Firebase's logging scheme.
|
@@ -927,7 +927,7 @@ class Zt {
|
|
927
927
|
* @param name The name that the logs will be associated with
|
928
928
|
*/
|
929
929
|
constructor(e) {
|
930
|
-
this.name = e, this._logLevel =
|
930
|
+
this.name = e, this._logLevel = lr, this._logHandler = ur, this._userLogHandler = null;
|
931
931
|
}
|
932
932
|
get logLevel() {
|
933
933
|
return this._logLevel;
|
@@ -939,7 +939,7 @@ class Zt {
|
|
939
939
|
}
|
940
940
|
// Workaround for setter/getter having to be the same type.
|
941
941
|
setLogLevel(e) {
|
942
|
-
this._logLevel = typeof e == "string" ?
|
942
|
+
this._logLevel = typeof e == "string" ? cr[e] : e;
|
943
943
|
}
|
944
944
|
get logHandler() {
|
945
945
|
return this._logHandler;
|
@@ -974,10 +974,10 @@ class Zt {
|
|
974
974
|
this._userLogHandler && this._userLogHandler(this, T.ERROR, ...e), this._logHandler(this, T.ERROR, ...e);
|
975
975
|
}
|
976
976
|
}
|
977
|
-
const
|
978
|
-
let
|
979
|
-
function
|
980
|
-
return
|
977
|
+
const hr = (n, e) => e.some((t) => n instanceof t);
|
978
|
+
let _t, vt;
|
979
|
+
function fr() {
|
980
|
+
return _t || (_t = [
|
981
981
|
IDBDatabase,
|
982
982
|
IDBObjectStore,
|
983
983
|
IDBIndex,
|
@@ -985,32 +985,32 @@ function mr() {
|
|
985
985
|
IDBTransaction
|
986
986
|
]);
|
987
987
|
}
|
988
|
-
function
|
989
|
-
return
|
988
|
+
function pr() {
|
989
|
+
return vt || (vt = [
|
990
990
|
IDBCursor.prototype.advance,
|
991
991
|
IDBCursor.prototype.continue,
|
992
992
|
IDBCursor.prototype.continuePrimaryKey
|
993
993
|
]);
|
994
994
|
}
|
995
|
-
const
|
996
|
-
function
|
995
|
+
const Xt = /* @__PURE__ */ new WeakMap(), Xe = /* @__PURE__ */ new WeakMap(), Zt = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap();
|
996
|
+
function gr(n) {
|
997
997
|
const e = new Promise((t, r) => {
|
998
998
|
const i = () => {
|
999
999
|
n.removeEventListener("success", s), n.removeEventListener("error", o);
|
1000
1000
|
}, s = () => {
|
1001
|
-
t(
|
1001
|
+
t(z(n.result)), i();
|
1002
1002
|
}, o = () => {
|
1003
1003
|
r(n.error), i();
|
1004
1004
|
};
|
1005
1005
|
n.addEventListener("success", s), n.addEventListener("error", o);
|
1006
1006
|
});
|
1007
1007
|
return e.then((t) => {
|
1008
|
-
t instanceof IDBCursor &&
|
1008
|
+
t instanceof IDBCursor && Xt.set(t, n);
|
1009
1009
|
}).catch(() => {
|
1010
|
-
}),
|
1010
|
+
}), ot.set(e, n), e;
|
1011
1011
|
}
|
1012
|
-
function
|
1013
|
-
if (
|
1012
|
+
function mr(n) {
|
1013
|
+
if (Xe.has(n))
|
1014
1014
|
return;
|
1015
1015
|
const e = new Promise((t, r) => {
|
1016
1016
|
const i = () => {
|
@@ -1022,19 +1022,19 @@ function vr(n) {
|
|
1022
1022
|
};
|
1023
1023
|
n.addEventListener("complete", s), n.addEventListener("error", o), n.addEventListener("abort", o);
|
1024
1024
|
});
|
1025
|
-
|
1025
|
+
Xe.set(n, e);
|
1026
1026
|
}
|
1027
|
-
let
|
1027
|
+
let Ze = {
|
1028
1028
|
get(n, e, t) {
|
1029
1029
|
if (n instanceof IDBTransaction) {
|
1030
1030
|
if (e === "done")
|
1031
|
-
return
|
1031
|
+
return Xe.get(n);
|
1032
1032
|
if (e === "objectStoreNames")
|
1033
|
-
return n.objectStoreNames ||
|
1033
|
+
return n.objectStoreNames || Zt.get(n);
|
1034
1034
|
if (e === "store")
|
1035
1035
|
return t.objectStoreNames[1] ? void 0 : t.objectStore(t.objectStoreNames[0]);
|
1036
1036
|
}
|
1037
|
-
return
|
1037
|
+
return z(n[e]);
|
1038
1038
|
},
|
1039
1039
|
set(n, e, t) {
|
1040
1040
|
return n[e] = t, !0;
|
@@ -1043,35 +1043,35 @@ let tt = {
|
|
1043
1043
|
return n instanceof IDBTransaction && (e === "done" || e === "store") ? !0 : e in n;
|
1044
1044
|
}
|
1045
1045
|
};
|
1046
|
-
function
|
1047
|
-
|
1046
|
+
function yr(n) {
|
1047
|
+
Ze = n(Ze);
|
1048
1048
|
}
|
1049
|
-
function
|
1049
|
+
function _r(n) {
|
1050
1050
|
return n === IDBDatabase.prototype.transaction && !("objectStoreNames" in IDBTransaction.prototype) ? function(e, ...t) {
|
1051
|
-
const r = n.call(
|
1052
|
-
return
|
1053
|
-
} :
|
1054
|
-
return n.apply(
|
1051
|
+
const r = n.call(xe(this), e, ...t);
|
1052
|
+
return Zt.set(r, e.sort ? e.sort() : [e]), z(r);
|
1053
|
+
} : pr().includes(n) ? function(...e) {
|
1054
|
+
return n.apply(xe(this), e), z(Xt.get(this));
|
1055
1055
|
} : function(...e) {
|
1056
|
-
return
|
1056
|
+
return z(n.apply(xe(this), e));
|
1057
1057
|
};
|
1058
1058
|
}
|
1059
|
-
function
|
1060
|
-
return typeof n == "function" ?
|
1059
|
+
function vr(n) {
|
1060
|
+
return typeof n == "function" ? _r(n) : (n instanceof IDBTransaction && mr(n), hr(n, fr()) ? new Proxy(n, Ze) : n);
|
1061
1061
|
}
|
1062
|
-
function
|
1062
|
+
function z(n) {
|
1063
1063
|
if (n instanceof IDBRequest)
|
1064
|
-
return
|
1065
|
-
if (
|
1066
|
-
return
|
1067
|
-
const e =
|
1068
|
-
return e !== n && (
|
1069
|
-
}
|
1070
|
-
const
|
1071
|
-
function
|
1072
|
-
const o = indexedDB.open(n, e), c =
|
1064
|
+
return gr(n);
|
1065
|
+
if (We.has(n))
|
1066
|
+
return We.get(n);
|
1067
|
+
const e = vr(n);
|
1068
|
+
return e !== n && (We.set(n, e), ot.set(e, n)), e;
|
1069
|
+
}
|
1070
|
+
const xe = (n) => ot.get(n);
|
1071
|
+
function br(n, e, { blocked: t, upgrade: r, blocking: i, terminated: s } = {}) {
|
1072
|
+
const o = indexedDB.open(n, e), c = z(o);
|
1073
1073
|
return r && o.addEventListener("upgradeneeded", (a) => {
|
1074
|
-
r(
|
1074
|
+
r(z(o.result), a.oldVersion, a.newVersion, z(o.transaction), a);
|
1075
1075
|
}), t && o.addEventListener("blocked", (a) => t(
|
1076
1076
|
// Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
|
1077
1077
|
a.oldVersion,
|
@@ -1082,16 +1082,16 @@ function Er(n, e, { blocked: t, upgrade: r, blocking: i, terminated: s } = {}) {
|
|
1082
1082
|
}).catch(() => {
|
1083
1083
|
}), c;
|
1084
1084
|
}
|
1085
|
-
const
|
1086
|
-
function
|
1085
|
+
const Ir = ["get", "getKey", "getAll", "getAllKeys", "count"], wr = ["put", "add", "delete", "clear"], qe = /* @__PURE__ */ new Map();
|
1086
|
+
function bt(n, e) {
|
1087
1087
|
if (!(n instanceof IDBDatabase && !(e in n) && typeof e == "string"))
|
1088
1088
|
return;
|
1089
|
-
if (
|
1090
|
-
return
|
1091
|
-
const t = e.replace(/FromIndex$/, ""), r = e !== t, i =
|
1089
|
+
if (qe.get(e))
|
1090
|
+
return qe.get(e);
|
1091
|
+
const t = e.replace(/FromIndex$/, ""), r = e !== t, i = wr.includes(t);
|
1092
1092
|
if (
|
1093
1093
|
// Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
|
1094
|
-
!(t in (r ? IDBIndex : IDBObjectStore).prototype) || !(i ||
|
1094
|
+
!(t in (r ? IDBIndex : IDBObjectStore).prototype) || !(i || Ir.includes(t))
|
1095
1095
|
)
|
1096
1096
|
return;
|
1097
1097
|
const s = async function(o, ...c) {
|
@@ -1102,12 +1102,12 @@ function It(n, e) {
|
|
1102
1102
|
i && a.done
|
1103
1103
|
]))[0];
|
1104
1104
|
};
|
1105
|
-
return
|
1105
|
+
return qe.set(e, s), s;
|
1106
1106
|
}
|
1107
|
-
|
1107
|
+
yr((n) => ({
|
1108
1108
|
...n,
|
1109
|
-
get: (e, t, r) =>
|
1110
|
-
has: (e, t) => !!
|
1109
|
+
get: (e, t, r) => bt(e, t) || n.get(e, t, r),
|
1110
|
+
has: (e, t) => !!bt(e, t) || n.has(e, t)
|
1111
1111
|
}));
|
1112
1112
|
/**
|
1113
1113
|
* @license
|
@@ -1125,7 +1125,7 @@ br((n) => ({
|
|
1125
1125
|
* See the License for the specific language governing permissions and
|
1126
1126
|
* limitations under the License.
|
1127
1127
|
*/
|
1128
|
-
class
|
1128
|
+
class Er {
|
1129
1129
|
constructor(e) {
|
1130
1130
|
this.container = e;
|
1131
1131
|
}
|
@@ -1133,7 +1133,7 @@ class Sr {
|
|
1133
1133
|
// auth token refresh, and installations will send this string.
|
1134
1134
|
getPlatformInfoString() {
|
1135
1135
|
return this.container.getProviders().map((t) => {
|
1136
|
-
if (
|
1136
|
+
if (Tr(t)) {
|
1137
1137
|
const r = t.getImmediate();
|
1138
1138
|
return `${r.library}/${r.version}`;
|
1139
1139
|
} else
|
@@ -1141,11 +1141,11 @@ class Sr {
|
|
1141
1141
|
}).filter((t) => t).join(" ");
|
1142
1142
|
}
|
1143
1143
|
}
|
1144
|
-
function
|
1144
|
+
function Tr(n) {
|
1145
1145
|
const e = n.getComponent();
|
1146
1146
|
return (e == null ? void 0 : e.type) === "VERSION";
|
1147
1147
|
}
|
1148
|
-
const
|
1148
|
+
const et = "@firebase/app", It = "0.9.20";
|
1149
1149
|
/**
|
1150
1150
|
* @license
|
1151
1151
|
* Copyright 2019 Google LLC
|
@@ -1162,7 +1162,7 @@ const nt = "@firebase/app", wt = "0.9.18";
|
|
1162
1162
|
* See the License for the specific language governing permissions and
|
1163
1163
|
* limitations under the License.
|
1164
1164
|
*/
|
1165
|
-
const Z = new
|
1165
|
+
const Z = new Qt("@firebase/app"), Ar = "@firebase/app-compat", Sr = "@firebase/analytics-compat", Cr = "@firebase/analytics", Rr = "@firebase/app-check-compat", Pr = "@firebase/app-check", Or = "@firebase/auth", kr = "@firebase/auth-compat", Nr = "@firebase/database", Dr = "@firebase/database-compat", Lr = "@firebase/functions", $r = "@firebase/functions-compat", Mr = "@firebase/installations", Ur = "@firebase/installations-compat", jr = "@firebase/messaging", Br = "@firebase/messaging-compat", Fr = "@firebase/performance", Hr = "@firebase/performance-compat", Vr = "@firebase/remote-config", Wr = "@firebase/remote-config-compat", xr = "@firebase/storage", qr = "@firebase/storage-compat", zr = "@firebase/firestore", Jr = "@firebase/firestore-compat", Gr = "firebase", Kr = "10.5.0";
|
1166
1166
|
/**
|
1167
1167
|
* @license
|
1168
1168
|
* Copyright 2019 Google LLC
|
@@ -1179,33 +1179,33 @@ const Z = new Zt("@firebase/app"), Rr = "@firebase/app-compat", Pr = "@firebase/
|
|
1179
1179
|
* See the License for the specific language governing permissions and
|
1180
1180
|
* limitations under the License.
|
1181
1181
|
*/
|
1182
|
-
const
|
1183
|
-
[
|
1184
|
-
[
|
1185
|
-
[
|
1186
|
-
[
|
1187
|
-
[
|
1188
|
-
[
|
1189
|
-
[
|
1190
|
-
[
|
1191
|
-
[
|
1192
|
-
[
|
1193
|
-
[
|
1194
|
-
[
|
1195
|
-
[
|
1196
|
-
[
|
1197
|
-
[
|
1198
|
-
[
|
1199
|
-
[
|
1200
|
-
[
|
1201
|
-
[
|
1202
|
-
[
|
1203
|
-
[
|
1204
|
-
[
|
1205
|
-
[
|
1206
|
-
[
|
1182
|
+
const tt = "[DEFAULT]", Yr = {
|
1183
|
+
[et]: "fire-core",
|
1184
|
+
[Ar]: "fire-core-compat",
|
1185
|
+
[Cr]: "fire-analytics",
|
1186
|
+
[Sr]: "fire-analytics-compat",
|
1187
|
+
[Pr]: "fire-app-check",
|
1188
|
+
[Rr]: "fire-app-check-compat",
|
1189
|
+
[Or]: "fire-auth",
|
1190
|
+
[kr]: "fire-auth-compat",
|
1191
|
+
[Nr]: "fire-rtdb",
|
1192
|
+
[Dr]: "fire-rtdb-compat",
|
1193
|
+
[Lr]: "fire-fn",
|
1194
|
+
[$r]: "fire-fn-compat",
|
1195
|
+
[Mr]: "fire-iid",
|
1196
|
+
[Ur]: "fire-iid-compat",
|
1197
|
+
[jr]: "fire-fcm",
|
1198
|
+
[Br]: "fire-fcm-compat",
|
1199
|
+
[Fr]: "fire-perf",
|
1200
|
+
[Hr]: "fire-perf-compat",
|
1201
|
+
[Vr]: "fire-rc",
|
1202
|
+
[Wr]: "fire-rc-compat",
|
1203
|
+
[xr]: "fire-gcs",
|
1204
|
+
[qr]: "fire-gcs-compat",
|
1205
|
+
[zr]: "fire-fst",
|
1206
|
+
[Jr]: "fire-fst-compat",
|
1207
1207
|
"fire-js": "fire-js",
|
1208
|
-
[
|
1208
|
+
[Gr]: "fire-js-all"
|
1209
1209
|
};
|
1210
1210
|
/**
|
1211
1211
|
* @license
|
@@ -1223,8 +1223,8 @@ const rt = "[DEFAULT]", Zr = {
|
|
1223
1223
|
* See the License for the specific language governing permissions and
|
1224
1224
|
* limitations under the License.
|
1225
1225
|
*/
|
1226
|
-
const
|
1227
|
-
function
|
1226
|
+
const Oe = /* @__PURE__ */ new Map(), nt = /* @__PURE__ */ new Map();
|
1227
|
+
function Qr(n, e) {
|
1228
1228
|
try {
|
1229
1229
|
n.container.addComponent(e);
|
1230
1230
|
} catch (t) {
|
@@ -1233,14 +1233,14 @@ function ei(n, e) {
|
|
1233
1233
|
}
|
1234
1234
|
function fe(n) {
|
1235
1235
|
const e = n.name;
|
1236
|
-
if (
|
1236
|
+
if (nt.has(e))
|
1237
1237
|
return Z.debug(`There were multiple attempts to register component ${e}.`), !1;
|
1238
|
-
|
1239
|
-
for (const t of
|
1240
|
-
|
1238
|
+
nt.set(e, n);
|
1239
|
+
for (const t of Oe.values())
|
1240
|
+
Qr(t, n);
|
1241
1241
|
return !0;
|
1242
1242
|
}
|
1243
|
-
function
|
1243
|
+
function en(n, e) {
|
1244
1244
|
const t = n.container.getProvider("heartbeat").getImmediate({ optional: !0 });
|
1245
1245
|
return t && t.triggerHeartbeat(), n.container.getProvider(e);
|
1246
1246
|
}
|
@@ -1260,7 +1260,7 @@ function nn(n, e) {
|
|
1260
1260
|
* See the License for the specific language governing permissions and
|
1261
1261
|
* limitations under the License.
|
1262
1262
|
*/
|
1263
|
-
const
|
1263
|
+
const Xr = {
|
1264
1264
|
"no-app": "No Firebase App '{$appName}' has been created - call initializeApp() first",
|
1265
1265
|
"bad-app-name": "Illegal App name: '{$appName}",
|
1266
1266
|
"duplicate-app": "Firebase App named '{$appName}' already exists with different options or config",
|
@@ -1272,7 +1272,7 @@ const ti = {
|
|
1272
1272
|
"idb-get": "Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.",
|
1273
1273
|
"idb-set": "Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.",
|
1274
1274
|
"idb-delete": "Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."
|
1275
|
-
},
|
1275
|
+
}, J = new _e("app", "Firebase", Xr);
|
1276
1276
|
/**
|
1277
1277
|
* @license
|
1278
1278
|
* Copyright 2019 Google LLC
|
@@ -1289,7 +1289,7 @@ const ti = {
|
|
1289
1289
|
* See the License for the specific language governing permissions and
|
1290
1290
|
* limitations under the License.
|
1291
1291
|
*/
|
1292
|
-
class
|
1292
|
+
class Zr {
|
1293
1293
|
constructor(e, t, r) {
|
1294
1294
|
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 ae(
|
1295
1295
|
"app",
|
@@ -1328,7 +1328,7 @@ class ni {
|
|
1328
1328
|
*/
|
1329
1329
|
checkDestroyed() {
|
1330
1330
|
if (this.isDeleted)
|
1331
|
-
throw
|
1331
|
+
throw J.create("app-deleted", { appName: this._name });
|
1332
1332
|
}
|
1333
1333
|
}
|
1334
1334
|
/**
|
@@ -1347,43 +1347,43 @@ class ni {
|
|
1347
1347
|
* See the License for the specific language governing permissions and
|
1348
1348
|
* limitations under the License.
|
1349
1349
|
*/
|
1350
|
-
const be =
|
1351
|
-
function
|
1350
|
+
const be = Kr;
|
1351
|
+
function tn(n, e = {}) {
|
1352
1352
|
let t = n;
|
1353
1353
|
typeof e != "object" && (e = { name: e });
|
1354
|
-
const r = Object.assign({ name:
|
1354
|
+
const r = Object.assign({ name: tt, automaticDataCollectionEnabled: !1 }, e), i = r.name;
|
1355
1355
|
if (typeof i != "string" || !i)
|
1356
|
-
throw
|
1356
|
+
throw J.create("bad-app-name", {
|
1357
1357
|
appName: String(i)
|
1358
1358
|
});
|
1359
|
-
if (t || (t =
|
1360
|
-
throw
|
1359
|
+
if (t || (t = Kt()), !t)
|
1360
|
+
throw J.create(
|
1361
1361
|
"no-options"
|
1362
1362
|
/* AppError.NO_OPTIONS */
|
1363
1363
|
);
|
1364
|
-
const s =
|
1364
|
+
const s = Oe.get(i);
|
1365
1365
|
if (s) {
|
1366
|
-
if (
|
1366
|
+
if (Pe(t, s.options) && Pe(r, s.config))
|
1367
1367
|
return s;
|
1368
|
-
throw
|
1368
|
+
throw J.create("duplicate-app", { appName: i });
|
1369
1369
|
}
|
1370
|
-
const o = new
|
1371
|
-
for (const a of
|
1370
|
+
const o = new ar(i);
|
1371
|
+
for (const a of nt.values())
|
1372
1372
|
o.addComponent(a);
|
1373
|
-
const c = new
|
1374
|
-
return
|
1373
|
+
const c = new Zr(t, r, o);
|
1374
|
+
return Oe.set(i, c), c;
|
1375
1375
|
}
|
1376
|
-
function
|
1377
|
-
const e =
|
1378
|
-
if (!e && n ===
|
1379
|
-
return
|
1376
|
+
function ei(n = tt) {
|
1377
|
+
const e = Oe.get(n);
|
1378
|
+
if (!e && n === tt && Kt())
|
1379
|
+
return tn();
|
1380
1380
|
if (!e)
|
1381
|
-
throw
|
1381
|
+
throw J.create("no-app", { appName: n });
|
1382
1382
|
return e;
|
1383
1383
|
}
|
1384
1384
|
function ie(n, e, t) {
|
1385
1385
|
var r;
|
1386
|
-
let i = (r =
|
1386
|
+
let i = (r = Yr[n]) !== null && r !== void 0 ? r : n;
|
1387
1387
|
t && (i += `-${t}`);
|
1388
1388
|
const s = i.match(/\s|\//), o = e.match(/\s|\//);
|
1389
1389
|
if (s || o) {
|
@@ -1416,10 +1416,10 @@ function ie(n, e, t) {
|
|
1416
1416
|
* See the License for the specific language governing permissions and
|
1417
1417
|
* limitations under the License.
|
1418
1418
|
*/
|
1419
|
-
const
|
1420
|
-
let
|
1421
|
-
function
|
1422
|
-
return
|
1419
|
+
const ti = "firebase-heartbeat-database", ni = 1, pe = "firebase-heartbeat-store";
|
1420
|
+
let ze = null;
|
1421
|
+
function nn() {
|
1422
|
+
return ze || (ze = br(ti, ni, {
|
1423
1423
|
upgrade: (n, e) => {
|
1424
1424
|
switch (e) {
|
1425
1425
|
case 0:
|
@@ -1427,41 +1427,41 @@ function sn() {
|
|
1427
1427
|
}
|
1428
1428
|
}
|
1429
1429
|
}).catch((n) => {
|
1430
|
-
throw
|
1430
|
+
throw J.create("idb-open", {
|
1431
1431
|
originalErrorMessage: n.message
|
1432
1432
|
});
|
1433
|
-
})),
|
1433
|
+
})), ze;
|
1434
1434
|
}
|
1435
|
-
async function
|
1435
|
+
async function ri(n) {
|
1436
1436
|
try {
|
1437
|
-
return await (await
|
1437
|
+
return await (await nn()).transaction(pe).objectStore(pe).get(rn(n));
|
1438
1438
|
} catch (e) {
|
1439
|
-
if (e instanceof
|
1439
|
+
if (e instanceof G)
|
1440
1440
|
Z.warn(e.message);
|
1441
1441
|
else {
|
1442
|
-
const t =
|
1442
|
+
const t = J.create("idb-get", {
|
1443
1443
|
originalErrorMessage: e == null ? void 0 : e.message
|
1444
1444
|
});
|
1445
1445
|
Z.warn(t.message);
|
1446
1446
|
}
|
1447
1447
|
}
|
1448
1448
|
}
|
1449
|
-
async function
|
1449
|
+
async function wt(n, e) {
|
1450
1450
|
try {
|
1451
|
-
const r = (await
|
1452
|
-
await r.objectStore(pe).put(e,
|
1451
|
+
const r = (await nn()).transaction(pe, "readwrite");
|
1452
|
+
await r.objectStore(pe).put(e, rn(n)), await r.done;
|
1453
1453
|
} catch (t) {
|
1454
|
-
if (t instanceof
|
1454
|
+
if (t instanceof G)
|
1455
1455
|
Z.warn(t.message);
|
1456
1456
|
else {
|
1457
|
-
const r =
|
1457
|
+
const r = J.create("idb-set", {
|
1458
1458
|
originalErrorMessage: t == null ? void 0 : t.message
|
1459
1459
|
});
|
1460
1460
|
Z.warn(r.message);
|
1461
1461
|
}
|
1462
1462
|
}
|
1463
1463
|
}
|
1464
|
-
function
|
1464
|
+
function rn(n) {
|
1465
1465
|
return `${n.name}!${n.options.appId}`;
|
1466
1466
|
}
|
1467
1467
|
/**
|
@@ -1480,12 +1480,12 @@ function on(n) {
|
|
1480
1480
|
* See the License for the specific language governing permissions and
|
1481
1481
|
* limitations under the License.
|
1482
1482
|
*/
|
1483
|
-
const
|
1484
|
-
class
|
1483
|
+
const ii = 1024, si = 30 * 24 * 60 * 60 * 1e3;
|
1484
|
+
class oi {
|
1485
1485
|
constructor(e) {
|
1486
1486
|
this.container = e, this._heartbeatsCache = null;
|
1487
1487
|
const t = this.container.getProvider("app").getImmediate();
|
1488
|
-
this._storage = new
|
1488
|
+
this._storage = new ci(t), this._heartbeatsCachePromise = this._storage.read().then((r) => (this._heartbeatsCache = r, r));
|
1489
1489
|
}
|
1490
1490
|
/**
|
1491
1491
|
* Called to report a heartbeat. The function will generate
|
@@ -1495,11 +1495,11 @@ class li {
|
|
1495
1495
|
* already logged, subsequent calls to this function in the same day will be ignored.
|
1496
1496
|
*/
|
1497
1497
|
async triggerHeartbeat() {
|
1498
|
-
const t = this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(), r =
|
1498
|
+
const t = this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(), r = Et();
|
1499
1499
|
if (this._heartbeatsCache === null && (this._heartbeatsCache = await this._heartbeatsCachePromise), !(this._heartbeatsCache.lastSentHeartbeatDate === r || this._heartbeatsCache.heartbeats.some((i) => i.date === r)))
|
1500
1500
|
return this._heartbeatsCache.heartbeats.push({ date: r, agent: t }), this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter((i) => {
|
1501
1501
|
const s = new Date(i.date).valueOf();
|
1502
|
-
return Date.now() - s <=
|
1502
|
+
return Date.now() - s <= si;
|
1503
1503
|
}), this._storage.overwrite(this._heartbeatsCache);
|
1504
1504
|
}
|
1505
1505
|
/**
|
@@ -1512,27 +1512,27 @@ class li {
|
|
1512
1512
|
async getHeartbeatsHeader() {
|
1513
1513
|
if (this._heartbeatsCache === null && await this._heartbeatsCachePromise, this._heartbeatsCache === null || this._heartbeatsCache.heartbeats.length === 0)
|
1514
1514
|
return "";
|
1515
|
-
const e =
|
1515
|
+
const e = Et(), { heartbeatsToSend: t, unsentEntries: r } = ai(this._heartbeatsCache.heartbeats), i = Jt(JSON.stringify({ version: 2, heartbeats: t }));
|
1516
1516
|
return this._heartbeatsCache.lastSentHeartbeatDate = e, r.length > 0 ? (this._heartbeatsCache.heartbeats = r, await this._storage.overwrite(this._heartbeatsCache)) : (this._heartbeatsCache.heartbeats = [], this._storage.overwrite(this._heartbeatsCache)), i;
|
1517
1517
|
}
|
1518
1518
|
}
|
1519
|
-
function
|
1519
|
+
function Et() {
|
1520
1520
|
return (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
|
1521
1521
|
}
|
1522
|
-
function
|
1522
|
+
function ai(n, e = ii) {
|
1523
1523
|
const t = [];
|
1524
1524
|
let r = n.slice();
|
1525
1525
|
for (const i of n) {
|
1526
1526
|
const s = t.find((o) => o.agent === i.agent);
|
1527
1527
|
if (s) {
|
1528
|
-
if (s.dates.push(i.date),
|
1528
|
+
if (s.dates.push(i.date), Tt(t) > e) {
|
1529
1529
|
s.dates.pop();
|
1530
1530
|
break;
|
1531
1531
|
}
|
1532
1532
|
} else if (t.push({
|
1533
1533
|
agent: i.agent,
|
1534
1534
|
dates: [i.date]
|
1535
|
-
}),
|
1535
|
+
}), Tt(t) > e) {
|
1536
1536
|
t.pop();
|
1537
1537
|
break;
|
1538
1538
|
}
|
@@ -1543,25 +1543,25 @@ function di(n, e = ai) {
|
|
1543
1543
|
unsentEntries: r
|
1544
1544
|
};
|
1545
1545
|
}
|
1546
|
-
class
|
1546
|
+
class ci {
|
1547
1547
|
constructor(e) {
|
1548
1548
|
this.app = e, this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();
|
1549
1549
|
}
|
1550
1550
|
async runIndexedDBEnvironmentCheck() {
|
1551
|
-
return
|
1551
|
+
return Kn() ? Yn().then(() => !0).catch(() => !1) : !1;
|
1552
1552
|
}
|
1553
1553
|
/**
|
1554
1554
|
* Read all heartbeats.
|
1555
1555
|
*/
|
1556
1556
|
async read() {
|
1557
|
-
return await this._canUseIndexedDBPromise ? await
|
1557
|
+
return await this._canUseIndexedDBPromise ? await ri(this.app) || { heartbeats: [] } : { heartbeats: [] };
|
1558
1558
|
}
|
1559
1559
|
// overwrite the storage with the provided heartbeats
|
1560
1560
|
async overwrite(e) {
|
1561
1561
|
var t;
|
1562
1562
|
if (await this._canUseIndexedDBPromise) {
|
1563
1563
|
const i = await this.read();
|
1564
|
-
return
|
1564
|
+
return wt(this.app, {
|
1565
1565
|
lastSentHeartbeatDate: (t = e.lastSentHeartbeatDate) !== null && t !== void 0 ? t : i.lastSentHeartbeatDate,
|
1566
1566
|
heartbeats: e.heartbeats
|
1567
1567
|
});
|
@@ -1573,7 +1573,7 @@ class ui {
|
|
1573
1573
|
var t;
|
1574
1574
|
if (await this._canUseIndexedDBPromise) {
|
1575
1575
|
const i = await this.read();
|
1576
|
-
return
|
1576
|
+
return wt(this.app, {
|
1577
1577
|
lastSentHeartbeatDate: (t = e.lastSentHeartbeatDate) !== null && t !== void 0 ? t : i.lastSentHeartbeatDate,
|
1578
1578
|
heartbeats: [
|
1579
1579
|
...i.heartbeats,
|
@@ -1584,7 +1584,7 @@ class ui {
|
|
1584
1584
|
return;
|
1585
1585
|
}
|
1586
1586
|
}
|
1587
|
-
function
|
1587
|
+
function Tt(n) {
|
1588
1588
|
return Jt(
|
1589
1589
|
// heartbeatsCache wrapper properties
|
1590
1590
|
JSON.stringify({ version: 2, heartbeats: n })
|
@@ -1606,21 +1606,21 @@ function At(n) {
|
|
1606
1606
|
* See the License for the specific language governing permissions and
|
1607
1607
|
* limitations under the License.
|
1608
1608
|
*/
|
1609
|
-
function
|
1609
|
+
function li(n) {
|
1610
1610
|
fe(new ae(
|
1611
1611
|
"platform-logger",
|
1612
|
-
(e) => new
|
1612
|
+
(e) => new Er(e),
|
1613
1613
|
"PRIVATE"
|
1614
1614
|
/* ComponentType.PRIVATE */
|
1615
1615
|
)), fe(new ae(
|
1616
1616
|
"heartbeat",
|
1617
|
-
(e) => new
|
1617
|
+
(e) => new oi(e),
|
1618
1618
|
"PRIVATE"
|
1619
1619
|
/* ComponentType.PRIVATE */
|
1620
|
-
)), ie(
|
1620
|
+
)), ie(et, It, n), ie(et, It, "esm2017"), ie("fire-js", "");
|
1621
1621
|
}
|
1622
|
-
|
1623
|
-
var
|
1622
|
+
li("");
|
1623
|
+
var di = "firebase", ui = "10.5.0";
|
1624
1624
|
/**
|
1625
1625
|
* @license
|
1626
1626
|
* Copyright 2020 Google LLC
|
@@ -1637,8 +1637,8 @@ var fi = "firebase", pi = "10.3.1";
|
|
1637
1637
|
* See the License for the specific language governing permissions and
|
1638
1638
|
* limitations under the License.
|
1639
1639
|
*/
|
1640
|
-
ie(
|
1641
|
-
function
|
1640
|
+
ie(di, ui, "app");
|
1641
|
+
function at(n, e) {
|
1642
1642
|
var t = {};
|
1643
1643
|
for (var r in n)
|
1644
1644
|
Object.prototype.hasOwnProperty.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
|
@@ -1647,22 +1647,22 @@ function lt(n, e) {
|
|
1647
1647
|
e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(n, r[i]) && (t[r[i]] = n[r[i]]);
|
1648
1648
|
return t;
|
1649
1649
|
}
|
1650
|
-
function
|
1650
|
+
function At(n) {
|
1651
1651
|
return n !== void 0 && n.enterprise !== void 0;
|
1652
1652
|
}
|
1653
|
-
class
|
1653
|
+
class hi {
|
1654
1654
|
constructor(e) {
|
1655
1655
|
if (this.siteKey = "", this.emailPasswordEnabled = !1, e.recaptchaKey === void 0)
|
1656
1656
|
throw new Error("recaptchaKey undefined");
|
1657
1657
|
this.siteKey = e.recaptchaKey.split("/")[3], this.emailPasswordEnabled = e.recaptchaEnforcementState.some((t) => t.provider === "EMAIL_PASSWORD_PROVIDER" && t.enforcementState !== "OFF");
|
1658
1658
|
}
|
1659
1659
|
}
|
1660
|
-
function
|
1660
|
+
function sn() {
|
1661
1661
|
return {
|
1662
1662
|
"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."
|
1663
1663
|
};
|
1664
1664
|
}
|
1665
|
-
const
|
1665
|
+
const fi = sn, on = new _e("auth", "Firebase", sn());
|
1666
1666
|
/**
|
1667
1667
|
* @license
|
1668
1668
|
* Copyright 2020 Google LLC
|
@@ -1679,12 +1679,12 @@ const mi = an, cn = new _e("auth", "Firebase", an());
|
|
1679
1679
|
* See the License for the specific language governing permissions and
|
1680
1680
|
* limitations under the License.
|
1681
1681
|
*/
|
1682
|
-
const
|
1683
|
-
function
|
1684
|
-
|
1682
|
+
const ke = new Qt("@firebase/auth");
|
1683
|
+
function pi(n, ...e) {
|
1684
|
+
ke.logLevel <= T.WARN && ke.warn(`Auth (${be}): ${n}`, ...e);
|
1685
1685
|
}
|
1686
|
-
function
|
1687
|
-
|
1686
|
+
function Ae(n, ...e) {
|
1687
|
+
ke.logLevel <= T.ERROR && ke.error(`Auth (${be}): ${n}`, ...e);
|
1688
1688
|
}
|
1689
1689
|
/**
|
1690
1690
|
* @license
|
@@ -1702,35 +1702,35 @@ function Ce(n, ...e) {
|
|
1702
1702
|
* See the License for the specific language governing permissions and
|
1703
1703
|
* limitations under the License.
|
1704
1704
|
*/
|
1705
|
-
function
|
1706
|
-
throw
|
1705
|
+
function N(n, ...e) {
|
1706
|
+
throw ct(n, ...e);
|
1707
1707
|
}
|
1708
1708
|
function L(n, ...e) {
|
1709
|
-
return
|
1709
|
+
return ct(n, ...e);
|
1710
1710
|
}
|
1711
|
-
function
|
1712
|
-
const r = Object.assign(Object.assign({},
|
1711
|
+
function gi(n, e, t) {
|
1712
|
+
const r = Object.assign(Object.assign({}, fi()), { [e]: t });
|
1713
1713
|
return new _e("auth", "Firebase", r).create(e, {
|
1714
1714
|
appName: n.name
|
1715
1715
|
});
|
1716
1716
|
}
|
1717
|
-
function
|
1717
|
+
function ct(n, ...e) {
|
1718
1718
|
if (typeof n != "string") {
|
1719
1719
|
const t = e[0], r = [...e.slice(1)];
|
1720
1720
|
return r[0] && (r[0].appName = n.name), n._errorFactory.create(t, ...r);
|
1721
1721
|
}
|
1722
|
-
return
|
1722
|
+
return on.create(n, ...e);
|
1723
1723
|
}
|
1724
1724
|
function _(n, e, ...t) {
|
1725
1725
|
if (!n)
|
1726
|
-
throw
|
1726
|
+
throw ct(e, ...t);
|
1727
1727
|
}
|
1728
|
-
function
|
1728
|
+
function M(n) {
|
1729
1729
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
1730
|
-
throw
|
1730
|
+
throw Ae(e), new Error(e);
|
1731
1731
|
}
|
1732
1732
|
function j(n, e) {
|
1733
|
-
n ||
|
1733
|
+
n || M(e);
|
1734
1734
|
}
|
1735
1735
|
/**
|
1736
1736
|
* @license
|
@@ -1748,14 +1748,14 @@ function j(n, e) {
|
|
1748
1748
|
* See the License for the specific language governing permissions and
|
1749
1749
|
* limitations under the License.
|
1750
1750
|
*/
|
1751
|
-
function
|
1751
|
+
function rt() {
|
1752
1752
|
var n;
|
1753
1753
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
1754
1754
|
}
|
1755
|
-
function
|
1756
|
-
return
|
1755
|
+
function mi() {
|
1756
|
+
return St() === "http:" || St() === "https:";
|
1757
1757
|
}
|
1758
|
-
function
|
1758
|
+
function St() {
|
1759
1759
|
var n;
|
1760
1760
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.protocol) || null;
|
1761
1761
|
}
|
@@ -1775,15 +1775,15 @@ function Ct() {
|
|
1775
1775
|
* See the License for the specific language governing permissions and
|
1776
1776
|
* limitations under the License.
|
1777
1777
|
*/
|
1778
|
-
function
|
1778
|
+
function yi() {
|
1779
1779
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
1780
1780
|
// This is especially true for Cordova apps which have unreliable
|
1781
1781
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
1782
1782
|
// installed which overwrites the native navigator.onLine value and
|
1783
1783
|
// defines navigator.connection.
|
1784
|
-
(
|
1784
|
+
(mi() || zn() || "connection" in navigator) ? navigator.onLine : !0;
|
1785
1785
|
}
|
1786
|
-
function
|
1786
|
+
function _i() {
|
1787
1787
|
if (typeof navigator > "u")
|
1788
1788
|
return null;
|
1789
1789
|
const n = navigator;
|
@@ -1813,10 +1813,10 @@ function Ii() {
|
|
1813
1813
|
*/
|
1814
1814
|
class Ie {
|
1815
1815
|
constructor(e, t) {
|
1816
|
-
this.shortDelay = e, this.longDelay = t, j(t > e, "Short delay should be less than long delay!"), this.isMobile =
|
1816
|
+
this.shortDelay = e, this.longDelay = t, j(t > e, "Short delay should be less than long delay!"), this.isMobile = qn() || Jn();
|
1817
1817
|
}
|
1818
1818
|
get() {
|
1819
|
-
return
|
1819
|
+
return yi() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
1820
1820
|
}
|
1821
1821
|
}
|
1822
1822
|
/**
|
@@ -1835,7 +1835,7 @@ class Ie {
|
|
1835
1835
|
* See the License for the specific language governing permissions and
|
1836
1836
|
* limitations under the License.
|
1837
1837
|
*/
|
1838
|
-
function
|
1838
|
+
function lt(n, e) {
|
1839
1839
|
j(n.emulator, "Emulator should always be set here");
|
1840
1840
|
const { url: t } = n.emulator;
|
1841
1841
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
@@ -1856,7 +1856,7 @@ function ut(n, e) {
|
|
1856
1856
|
* See the License for the specific language governing permissions and
|
1857
1857
|
* limitations under the License.
|
1858
1858
|
*/
|
1859
|
-
class
|
1859
|
+
class an {
|
1860
1860
|
static initialize(e, t, r) {
|
1861
1861
|
this.fetchImpl = e, t && (this.headersImpl = t), r && (this.responseImpl = r);
|
1862
1862
|
}
|
@@ -1865,21 +1865,21 @@ class ln {
|
|
1865
1865
|
return this.fetchImpl;
|
1866
1866
|
if (typeof self < "u" && "fetch" in self)
|
1867
1867
|
return self.fetch;
|
1868
|
-
|
1868
|
+
M("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
1869
1869
|
}
|
1870
1870
|
static headers() {
|
1871
1871
|
if (this.headersImpl)
|
1872
1872
|
return this.headersImpl;
|
1873
1873
|
if (typeof self < "u" && "Headers" in self)
|
1874
1874
|
return self.Headers;
|
1875
|
-
|
1875
|
+
M("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
1876
1876
|
}
|
1877
1877
|
static response() {
|
1878
1878
|
if (this.responseImpl)
|
1879
1879
|
return this.responseImpl;
|
1880
1880
|
if (typeof self < "u" && "Response" in self)
|
1881
1881
|
return self.Response;
|
1882
|
-
|
1882
|
+
M("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
1883
1883
|
}
|
1884
1884
|
}
|
1885
1885
|
/**
|
@@ -1898,7 +1898,7 @@ class ln {
|
|
1898
1898
|
* See the License for the specific language governing permissions and
|
1899
1899
|
* limitations under the License.
|
1900
1900
|
*/
|
1901
|
-
const
|
1901
|
+
const vi = {
|
1902
1902
|
// Custom token errors.
|
1903
1903
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
1904
1904
|
// This can only happen if the SDK sends a bad request.
|
@@ -1986,12 +1986,12 @@ const wi = {
|
|
1986
1986
|
* See the License for the specific language governing permissions and
|
1987
1987
|
* limitations under the License.
|
1988
1988
|
*/
|
1989
|
-
const
|
1989
|
+
const bi = new Ie(3e4, 6e4);
|
1990
1990
|
function te(n, e) {
|
1991
1991
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
1992
1992
|
}
|
1993
|
-
async function
|
1994
|
-
return
|
1993
|
+
async function K(n, e, t, r, i = {}) {
|
1994
|
+
return cn(n, i, async () => {
|
1995
1995
|
let s = {}, o = {};
|
1996
1996
|
r && (e === "GET" ? o = r : s = {
|
1997
1997
|
body: JSON.stringify(r)
|
@@ -2003,71 +2003,71 @@ async function J(n, e, t, r, i = {}) {
|
|
2003
2003
|
] = "application/json", n.languageCode && (a[
|
2004
2004
|
"X-Firebase-Locale"
|
2005
2005
|
/* HttpHeader.X_FIREBASE_LOCALE */
|
2006
|
-
] = n.languageCode),
|
2006
|
+
] = n.languageCode), an.fetch()(ln(n, n.config.apiHost, t, c), Object.assign({
|
2007
2007
|
method: e,
|
2008
2008
|
headers: a,
|
2009
2009
|
referrerPolicy: "no-referrer"
|
2010
2010
|
}, s));
|
2011
2011
|
});
|
2012
2012
|
}
|
2013
|
-
async function
|
2013
|
+
async function cn(n, e, t) {
|
2014
2014
|
n._canInitEmulator = !1;
|
2015
|
-
const r = Object.assign(Object.assign({},
|
2015
|
+
const r = Object.assign(Object.assign({}, vi), e);
|
2016
2016
|
try {
|
2017
|
-
const i = new
|
2017
|
+
const i = new Ii(n), s = await Promise.race([
|
2018
2018
|
t(),
|
2019
2019
|
i.promise
|
2020
2020
|
]);
|
2021
2021
|
i.clearNetworkTimeout();
|
2022
2022
|
const o = await s.json();
|
2023
2023
|
if ("needConfirmation" in o)
|
2024
|
-
throw
|
2024
|
+
throw Te(n, "account-exists-with-different-credential", o);
|
2025
2025
|
if (s.ok && !("errorMessage" in o))
|
2026
2026
|
return o;
|
2027
2027
|
{
|
2028
2028
|
const c = s.ok ? o.errorMessage : o.error.message, [a, u] = c.split(" : ");
|
2029
2029
|
if (a === "FEDERATED_USER_ID_ALREADY_LINKED")
|
2030
|
-
throw
|
2030
|
+
throw Te(n, "credential-already-in-use", o);
|
2031
2031
|
if (a === "EMAIL_EXISTS")
|
2032
|
-
throw
|
2032
|
+
throw Te(n, "email-already-in-use", o);
|
2033
2033
|
if (a === "USER_DISABLED")
|
2034
|
-
throw
|
2034
|
+
throw Te(n, "user-disabled", o);
|
2035
2035
|
const y = r[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
2036
2036
|
if (u)
|
2037
|
-
throw
|
2038
|
-
|
2037
|
+
throw gi(n, y, u);
|
2038
|
+
N(n, y);
|
2039
2039
|
}
|
2040
2040
|
} catch (i) {
|
2041
|
-
if (i instanceof
|
2041
|
+
if (i instanceof G)
|
2042
2042
|
throw i;
|
2043
|
-
|
2043
|
+
N(n, "network-request-failed", { message: String(i) });
|
2044
2044
|
}
|
2045
2045
|
}
|
2046
|
-
async function
|
2047
|
-
const s = await
|
2048
|
-
return "mfaPendingCredential" in s &&
|
2046
|
+
async function je(n, e, t, r, i = {}) {
|
2047
|
+
const s = await K(n, e, t, r, i);
|
2048
|
+
return "mfaPendingCredential" in s && N(n, "multi-factor-auth-required", {
|
2049
2049
|
_serverResponse: s
|
2050
2050
|
}), s;
|
2051
2051
|
}
|
2052
|
-
function
|
2052
|
+
function ln(n, e, t, r) {
|
2053
2053
|
const i = `${e}${t}?${r}`;
|
2054
|
-
return n.config.emulator ?
|
2054
|
+
return n.config.emulator ? lt(n.config, i) : `${n.config.apiScheme}://${i}`;
|
2055
2055
|
}
|
2056
|
-
class
|
2056
|
+
class Ii {
|
2057
2057
|
constructor(e) {
|
2058
2058
|
this.auth = e, this.timer = null, this.promise = new Promise((t, r) => {
|
2059
2059
|
this.timer = setTimeout(() => r(L(
|
2060
2060
|
this.auth,
|
2061
2061
|
"network-request-failed"
|
2062
2062
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
2063
|
-
)),
|
2063
|
+
)), bi.get());
|
2064
2064
|
});
|
2065
2065
|
}
|
2066
2066
|
clearNetworkTimeout() {
|
2067
2067
|
clearTimeout(this.timer);
|
2068
2068
|
}
|
2069
2069
|
}
|
2070
|
-
function
|
2070
|
+
function Te(n, e, t) {
|
2071
2071
|
const r = {
|
2072
2072
|
appName: n.name
|
2073
2073
|
};
|
@@ -2075,8 +2075,8 @@ function Se(n, e, t) {
|
|
2075
2075
|
const i = L(n, e, r);
|
2076
2076
|
return i.customData._tokenResponse = t, i;
|
2077
2077
|
}
|
2078
|
-
async function
|
2079
|
-
return
|
2078
|
+
async function wi(n, e) {
|
2079
|
+
return K(n, "GET", "/v2/recaptchaConfig", te(n, e));
|
2080
2080
|
}
|
2081
2081
|
/**
|
2082
2082
|
* @license
|
@@ -2094,11 +2094,11 @@ async function Ai(n, e) {
|
|
2094
2094
|
* See the License for the specific language governing permissions and
|
2095
2095
|
* limitations under the License.
|
2096
2096
|
*/
|
2097
|
-
async function
|
2098
|
-
return
|
2097
|
+
async function Ei(n, e) {
|
2098
|
+
return K(n, "POST", "/v1/accounts:delete", e);
|
2099
2099
|
}
|
2100
|
-
async function
|
2101
|
-
return
|
2100
|
+
async function Ti(n, e) {
|
2101
|
+
return K(n, "POST", "/v1/accounts:lookup", e);
|
2102
2102
|
}
|
2103
2103
|
/**
|
2104
2104
|
* @license
|
@@ -2125,8 +2125,8 @@ function he(n) {
|
|
2125
2125
|
} catch {
|
2126
2126
|
}
|
2127
2127
|
}
|
2128
|
-
async function
|
2129
|
-
const t =
|
2128
|
+
async function Ai(n, e = !1) {
|
2129
|
+
const t = B(n), r = await t.getIdToken(e), i = dt(r);
|
2130
2130
|
_(
|
2131
2131
|
i && i.exp && i.auth_time && i.iat,
|
2132
2132
|
t.auth,
|
@@ -2147,19 +2147,19 @@ async function Ri(n, e = !1) {
|
|
2147
2147
|
function Je(n) {
|
2148
2148
|
return Number(n) * 1e3;
|
2149
2149
|
}
|
2150
|
-
function
|
2150
|
+
function dt(n) {
|
2151
2151
|
const [e, t, r] = n.split(".");
|
2152
2152
|
if (e === void 0 || t === void 0 || r === void 0)
|
2153
|
-
return
|
2153
|
+
return Ae("JWT malformed, contained fewer than 3 sections"), null;
|
2154
2154
|
try {
|
2155
|
-
const i =
|
2156
|
-
return i ? JSON.parse(i) : (
|
2155
|
+
const i = Gt(t);
|
2156
|
+
return i ? JSON.parse(i) : (Ae("Failed to decode base64 JWT payload"), null);
|
2157
2157
|
} catch (i) {
|
2158
|
-
return
|
2158
|
+
return Ae("Caught error parsing JWT payload as JSON", i == null ? void 0 : i.toString()), null;
|
2159
2159
|
}
|
2160
2160
|
}
|
2161
|
-
function
|
2162
|
-
const e =
|
2161
|
+
function Si(n) {
|
2162
|
+
const e = dt(n);
|
2163
2163
|
return _(
|
2164
2164
|
e,
|
2165
2165
|
"internal-error"
|
@@ -2196,10 +2196,10 @@ async function ge(n, e, t = !1) {
|
|
2196
2196
|
try {
|
2197
2197
|
return await e;
|
2198
2198
|
} catch (r) {
|
2199
|
-
throw r instanceof
|
2199
|
+
throw r instanceof G && Ci(r) && n.auth.currentUser === n && await n.auth.signOut(), r;
|
2200
2200
|
}
|
2201
2201
|
}
|
2202
|
-
function
|
2202
|
+
function Ci({ code: n }) {
|
2203
2203
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
2204
2204
|
}
|
2205
2205
|
/**
|
@@ -2218,7 +2218,7 @@ function Oi({ code: n }) {
|
|
2218
2218
|
* See the License for the specific language governing permissions and
|
2219
2219
|
* limitations under the License.
|
2220
2220
|
*/
|
2221
|
-
class
|
2221
|
+
class Ri {
|
2222
2222
|
constructor(e) {
|
2223
2223
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
2224
2224
|
}
|
@@ -2280,7 +2280,7 @@ class ki {
|
|
2280
2280
|
* See the License for the specific language governing permissions and
|
2281
2281
|
* limitations under the License.
|
2282
2282
|
*/
|
2283
|
-
class
|
2283
|
+
class dn {
|
2284
2284
|
constructor(e, t) {
|
2285
2285
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
2286
2286
|
}
|
@@ -2313,9 +2313,9 @@ class hn {
|
|
2313
2313
|
* See the License for the specific language governing permissions and
|
2314
2314
|
* limitations under the License.
|
2315
2315
|
*/
|
2316
|
-
async function
|
2316
|
+
async function Ne(n) {
|
2317
2317
|
var e;
|
2318
|
-
const t = n.auth, r = await n.getIdToken(), i = await ge(n,
|
2318
|
+
const t = n.auth, r = await n.getIdToken(), i = await ge(n, Ti(t, { idToken: r }));
|
2319
2319
|
_(
|
2320
2320
|
i == null ? void 0 : i.users.length,
|
2321
2321
|
t,
|
@@ -2324,7 +2324,7 @@ async function Le(n) {
|
|
2324
2324
|
);
|
2325
2325
|
const s = i.users[0];
|
2326
2326
|
n._notifyReloadListener(s);
|
2327
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ?
|
2327
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? ki(s.providerUserInfo) : [], c = Oi(n.providerData, o), a = n.isAnonymous, u = !(n.email && s.passwordHash) && !(c != null && c.length), y = a ? u : !1, b = {
|
2328
2328
|
uid: s.localId,
|
2329
2329
|
displayName: s.displayName || null,
|
2330
2330
|
photoURL: s.photoUrl || null,
|
@@ -2333,21 +2333,21 @@ async function Le(n) {
|
|
2333
2333
|
phoneNumber: s.phoneNumber || null,
|
2334
2334
|
tenantId: s.tenantId || null,
|
2335
2335
|
providerData: c,
|
2336
|
-
metadata: new
|
2336
|
+
metadata: new dn(s.createdAt, s.lastLoginAt),
|
2337
2337
|
isAnonymous: y
|
2338
2338
|
};
|
2339
2339
|
Object.assign(n, b);
|
2340
2340
|
}
|
2341
|
-
async function
|
2342
|
-
const e =
|
2343
|
-
await
|
2341
|
+
async function Pi(n) {
|
2342
|
+
const e = B(n);
|
2343
|
+
await Ne(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
2344
2344
|
}
|
2345
|
-
function
|
2345
|
+
function Oi(n, e) {
|
2346
2346
|
return [...n.filter((r) => !e.some((i) => i.providerId === r.providerId)), ...e];
|
2347
2347
|
}
|
2348
|
-
function
|
2348
|
+
function ki(n) {
|
2349
2349
|
return n.map((e) => {
|
2350
|
-
var { providerId: t } = e, r =
|
2350
|
+
var { providerId: t } = e, r = at(e, ["providerId"]);
|
2351
2351
|
return {
|
2352
2352
|
providerId: t,
|
2353
2353
|
uid: r.rawId || "",
|
@@ -2374,16 +2374,16 @@ function Li(n) {
|
|
2374
2374
|
* See the License for the specific language governing permissions and
|
2375
2375
|
* limitations under the License.
|
2376
2376
|
*/
|
2377
|
-
async function
|
2378
|
-
const t = await
|
2377
|
+
async function Ni(n, e) {
|
2378
|
+
const t = await cn(n, {}, async () => {
|
2379
2379
|
const r = ve({
|
2380
2380
|
grant_type: "refresh_token",
|
2381
2381
|
refresh_token: e
|
2382
|
-
}).slice(1), { tokenApiHost: i, apiKey: s } = n.config, o =
|
2382
|
+
}).slice(1), { tokenApiHost: i, apiKey: s } = n.config, o = ln(n, i, "/v1/token", `key=${s}`), c = await n._getAdditionalHeaders();
|
2383
2383
|
return c[
|
2384
2384
|
"Content-Type"
|
2385
2385
|
/* HttpHeader.CONTENT_TYPE */
|
2386
|
-
] = "application/x-www-form-urlencoded",
|
2386
|
+
] = "application/x-www-form-urlencoded", an.fetch()(o, {
|
2387
2387
|
method: "POST",
|
2388
2388
|
headers: c,
|
2389
2389
|
body: r
|
@@ -2432,7 +2432,7 @@ class me {
|
|
2432
2432
|
"internal-error"
|
2433
2433
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2434
2434
|
);
|
2435
|
-
const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) :
|
2435
|
+
const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) : Si(e.idToken);
|
2436
2436
|
this.updateTokensAndExpiration(e.idToken, e.refreshToken, t);
|
2437
2437
|
}
|
2438
2438
|
async getToken(e, t = !1) {
|
@@ -2447,7 +2447,7 @@ class me {
|
|
2447
2447
|
this.refreshToken = null;
|
2448
2448
|
}
|
2449
2449
|
async refresh(e, t) {
|
2450
|
-
const { accessToken: r, refreshToken: i, expiresIn: s } = await
|
2450
|
+
const { accessToken: r, refreshToken: i, expiresIn: s } = await Ni(e, t);
|
2451
2451
|
this.updateTokensAndExpiration(r, i, Number(s));
|
2452
2452
|
}
|
2453
2453
|
updateTokensAndExpiration(e, t, r) {
|
@@ -2477,7 +2477,7 @@ class me {
|
|
2477
2477
|
return Object.assign(new me(), this.toJSON());
|
2478
2478
|
}
|
2479
2479
|
_performRefresh() {
|
2480
|
-
return
|
2480
|
+
return M("not implemented");
|
2481
2481
|
}
|
2482
2482
|
}
|
2483
2483
|
/**
|
@@ -2496,13 +2496,13 @@ class me {
|
|
2496
2496
|
* See the License for the specific language governing permissions and
|
2497
2497
|
* limitations under the License.
|
2498
2498
|
*/
|
2499
|
-
function
|
2499
|
+
function H(n, e) {
|
2500
2500
|
_(typeof n == "string" || typeof n > "u", "internal-error", { appName: e });
|
2501
2501
|
}
|
2502
|
-
class
|
2502
|
+
class X {
|
2503
2503
|
constructor(e) {
|
2504
|
-
var { uid: t, auth: r, stsTokenManager: i } = e, s =
|
2505
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
2504
|
+
var { uid: t, auth: r, stsTokenManager: i } = e, s = at(e, ["uid", "auth", "stsTokenManager"]);
|
2505
|
+
this.providerId = "firebase", this.proactiveRefresh = new Ri(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 dn(s.createdAt || void 0, s.lastLoginAt || void 0);
|
2506
2506
|
}
|
2507
2507
|
async getIdToken(e) {
|
2508
2508
|
const t = await ge(this, this.stsTokenManager.getToken(this.auth, e));
|
@@ -2514,10 +2514,10 @@ class Q {
|
|
2514
2514
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
2515
2515
|
}
|
2516
2516
|
getIdTokenResult(e) {
|
2517
|
-
return
|
2517
|
+
return Ai(this, e);
|
2518
2518
|
}
|
2519
2519
|
reload() {
|
2520
|
-
return
|
2520
|
+
return Pi(this);
|
2521
2521
|
}
|
2522
2522
|
_assign(e) {
|
2523
2523
|
this !== e && (_(
|
@@ -2528,7 +2528,7 @@ class Q {
|
|
2528
2528
|
), this.displayName = e.displayName, this.photoURL = e.photoURL, this.email = e.email, this.emailVerified = e.emailVerified, this.phoneNumber = e.phoneNumber, this.isAnonymous = e.isAnonymous, this.tenantId = e.tenantId, this.providerData = e.providerData.map((t) => Object.assign({}, t)), this.metadata._copy(e.metadata), this.stsTokenManager._assign(e.stsTokenManager));
|
2529
2529
|
}
|
2530
2530
|
_clone(e) {
|
2531
|
-
const t = new
|
2531
|
+
const t = new X(Object.assign(Object.assign({}, this), { auth: e, stsTokenManager: this.stsTokenManager._clone() }));
|
2532
2532
|
return t.metadata._copy(this.metadata), t;
|
2533
2533
|
}
|
2534
2534
|
_onReload(e) {
|
@@ -2550,11 +2550,11 @@ class Q {
|
|
2550
2550
|
}
|
2551
2551
|
async _updateTokensIfNecessary(e, t = !1) {
|
2552
2552
|
let r = !1;
|
2553
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), r = !0), t && await
|
2553
|
+
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), r = !0), t && await Ne(this), await this.auth._persistUserIfCurrent(this), r && this.auth._notifyListenersIfCurrent(this);
|
2554
2554
|
}
|
2555
2555
|
async delete() {
|
2556
2556
|
const e = await this.getIdToken();
|
2557
|
-
return await ge(this,
|
2557
|
+
return await ge(this, Ei(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
2558
2558
|
}
|
2559
2559
|
toJSON() {
|
2560
2560
|
return Object.assign(Object.assign({
|
@@ -2582,7 +2582,7 @@ class Q {
|
|
2582
2582
|
}
|
2583
2583
|
static _fromJSON(e, t) {
|
2584
2584
|
var r, i, s, o, c, a, u, y;
|
2585
|
-
const b = (r = t.displayName) !== null && r !== void 0 ? r : void 0, A = (i = t.email) !== null && i !== void 0 ? i : void 0, P = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, k = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, v = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, I = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0,
|
2585
|
+
const b = (r = t.displayName) !== null && r !== void 0 ? r : void 0, A = (i = t.email) !== null && i !== void 0 ? i : void 0, P = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, k = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, v = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, I = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, D = (u = t.createdAt) !== null && u !== void 0 ? u : void 0, C = (y = t.lastLoginAt) !== null && y !== void 0 ? y : void 0, { uid: Y, emailVerified: F, isAnonymous: l, providerData: m, stsTokenManager: d } = t;
|
2586
2586
|
_(
|
2587
2587
|
Y && d,
|
2588
2588
|
e,
|
@@ -2595,8 +2595,8 @@ class Q {
|
|
2595
2595
|
e,
|
2596
2596
|
"internal-error"
|
2597
2597
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2598
|
-
),
|
2599
|
-
typeof
|
2598
|
+
), H(b, e.name), H(A, e.name), _(
|
2599
|
+
typeof F == "boolean",
|
2600
2600
|
e,
|
2601
2601
|
"internal-error"
|
2602
2602
|
/* AuthErrorCode.INTERNAL_ERROR */
|
@@ -2605,19 +2605,19 @@ class Q {
|
|
2605
2605
|
e,
|
2606
2606
|
"internal-error"
|
2607
2607
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2608
|
-
),
|
2609
|
-
const E = new
|
2608
|
+
), H(P, e.name), H(k, e.name), H(v, e.name), H(I, e.name), H(D, e.name), H(C, e.name);
|
2609
|
+
const E = new X({
|
2610
2610
|
uid: Y,
|
2611
2611
|
auth: e,
|
2612
2612
|
email: A,
|
2613
|
-
emailVerified:
|
2613
|
+
emailVerified: F,
|
2614
2614
|
displayName: b,
|
2615
2615
|
isAnonymous: l,
|
2616
2616
|
photoURL: k,
|
2617
2617
|
phoneNumber: P,
|
2618
2618
|
tenantId: v,
|
2619
2619
|
stsTokenManager: w,
|
2620
|
-
createdAt:
|
2620
|
+
createdAt: D,
|
2621
2621
|
lastLoginAt: C
|
2622
2622
|
});
|
2623
2623
|
return m && Array.isArray(m) && (E.providerData = m.map((S) => Object.assign({}, S))), I && (E._redirectEventId = I), E;
|
@@ -2630,13 +2630,13 @@ class Q {
|
|
2630
2630
|
static async _fromIdTokenResponse(e, t, r = !1) {
|
2631
2631
|
const i = new me();
|
2632
2632
|
i.updateFromServerResponse(t);
|
2633
|
-
const s = new
|
2633
|
+
const s = new X({
|
2634
2634
|
uid: t.localId,
|
2635
2635
|
auth: e,
|
2636
2636
|
stsTokenManager: i,
|
2637
2637
|
isAnonymous: r
|
2638
2638
|
});
|
2639
|
-
return await
|
2639
|
+
return await Ne(s), s;
|
2640
2640
|
}
|
2641
2641
|
}
|
2642
2642
|
/**
|
@@ -2655,11 +2655,11 @@ class Q {
|
|
2655
2655
|
* See the License for the specific language governing permissions and
|
2656
2656
|
* limitations under the License.
|
2657
2657
|
*/
|
2658
|
-
const
|
2658
|
+
const Ct = /* @__PURE__ */ new Map();
|
2659
2659
|
function U(n) {
|
2660
2660
|
j(n instanceof Function, "Expected a class definition");
|
2661
|
-
let e =
|
2662
|
-
return e ? (j(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(),
|
2661
|
+
let e = Ct.get(n);
|
2662
|
+
return e ? (j(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), Ct.set(n, e), e);
|
2663
2663
|
}
|
2664
2664
|
/**
|
2665
2665
|
* @license
|
@@ -2677,7 +2677,7 @@ function U(n) {
|
|
2677
2677
|
* See the License for the specific language governing permissions and
|
2678
2678
|
* limitations under the License.
|
2679
2679
|
*/
|
2680
|
-
class
|
2680
|
+
class un {
|
2681
2681
|
constructor() {
|
2682
2682
|
this.type = "NONE", this.storage = {};
|
2683
2683
|
}
|
@@ -2699,8 +2699,8 @@ class fn {
|
|
2699
2699
|
_removeListener(e, t) {
|
2700
2700
|
}
|
2701
2701
|
}
|
2702
|
-
|
2703
|
-
const
|
2702
|
+
un.type = "NONE";
|
2703
|
+
const Rt = un;
|
2704
2704
|
/**
|
2705
2705
|
* @license
|
2706
2706
|
* Copyright 2019 Google LLC
|
@@ -2717,21 +2717,21 @@ const Pt = fn;
|
|
2717
2717
|
* See the License for the specific language governing permissions and
|
2718
2718
|
* limitations under the License.
|
2719
2719
|
*/
|
2720
|
-
function
|
2720
|
+
function Se(n, e, t) {
|
2721
2721
|
return `firebase:${n}:${e}:${t}`;
|
2722
2722
|
}
|
2723
2723
|
class se {
|
2724
2724
|
constructor(e, t, r) {
|
2725
2725
|
this.persistence = e, this.auth = t, this.userKey = r;
|
2726
2726
|
const { config: i, name: s } = this.auth;
|
2727
|
-
this.fullUserKey =
|
2727
|
+
this.fullUserKey = Se(this.userKey, i.apiKey, s), this.fullPersistenceKey = Se("persistence", i.apiKey, s), this.boundEventHandler = t._onStorageEvent.bind(t), this.persistence._addListener(this.fullUserKey, this.boundEventHandler);
|
2728
2728
|
}
|
2729
2729
|
setCurrentUser(e) {
|
2730
2730
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
2731
2731
|
}
|
2732
2732
|
async getCurrentUser() {
|
2733
2733
|
const e = await this.persistence._get(this.fullUserKey);
|
2734
|
-
return e ?
|
2734
|
+
return e ? X._fromJSON(this.auth, e) : null;
|
2735
2735
|
}
|
2736
2736
|
removeCurrentUser() {
|
2737
2737
|
return this.persistence._remove(this.fullUserKey);
|
@@ -2751,19 +2751,19 @@ class se {
|
|
2751
2751
|
}
|
2752
2752
|
static async create(e, t, r = "authUser") {
|
2753
2753
|
if (!t.length)
|
2754
|
-
return new se(U(
|
2754
|
+
return new se(U(Rt), e, r);
|
2755
2755
|
const i = (await Promise.all(t.map(async (u) => {
|
2756
2756
|
if (await u._isAvailable())
|
2757
2757
|
return u;
|
2758
2758
|
}))).filter((u) => u);
|
2759
|
-
let s = i[0] || U(
|
2760
|
-
const o =
|
2759
|
+
let s = i[0] || U(Rt);
|
2760
|
+
const o = Se(r, e.config.apiKey, e.name);
|
2761
2761
|
let c = null;
|
2762
2762
|
for (const u of t)
|
2763
2763
|
try {
|
2764
2764
|
const y = await u._get(o);
|
2765
2765
|
if (y) {
|
2766
|
-
const b =
|
2766
|
+
const b = X._fromJSON(e, y);
|
2767
2767
|
u !== s && (c = b), s = u;
|
2768
2768
|
break;
|
2769
2769
|
}
|
@@ -2795,29 +2795,29 @@ class se {
|
|
2795
2795
|
* See the License for the specific language governing permissions and
|
2796
2796
|
* limitations under the License.
|
2797
2797
|
*/
|
2798
|
-
function
|
2798
|
+
function Pt(n) {
|
2799
2799
|
const e = n.toLowerCase();
|
2800
2800
|
if (e.includes("opera/") || e.includes("opr/") || e.includes("opios/"))
|
2801
2801
|
return "Opera";
|
2802
|
-
if (
|
2802
|
+
if (pn(e))
|
2803
2803
|
return "IEMobile";
|
2804
2804
|
if (e.includes("msie") || e.includes("trident/"))
|
2805
2805
|
return "IE";
|
2806
2806
|
if (e.includes("edge/"))
|
2807
2807
|
return "Edge";
|
2808
|
-
if (
|
2808
|
+
if (hn(e))
|
2809
2809
|
return "Firefox";
|
2810
2810
|
if (e.includes("silk/"))
|
2811
2811
|
return "Silk";
|
2812
|
-
if (
|
2812
|
+
if (mn(e))
|
2813
2813
|
return "Blackberry";
|
2814
|
-
if (
|
2814
|
+
if (yn(e))
|
2815
2815
|
return "Webos";
|
2816
|
-
if (
|
2816
|
+
if (ut(e))
|
2817
2817
|
return "Safari";
|
2818
|
-
if ((e.includes("chrome/") ||
|
2818
|
+
if ((e.includes("chrome/") || fn(e)) && !e.includes("edge/"))
|
2819
2819
|
return "Chrome";
|
2820
|
-
if (
|
2820
|
+
if (gn(e))
|
2821
2821
|
return "Android";
|
2822
2822
|
{
|
2823
2823
|
const t = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/, r = n.match(t);
|
@@ -2826,42 +2826,42 @@ function Ot(n) {
|
|
2826
2826
|
}
|
2827
2827
|
return "Other";
|
2828
2828
|
}
|
2829
|
-
function
|
2829
|
+
function hn(n = R()) {
|
2830
2830
|
return /firefox\//i.test(n);
|
2831
2831
|
}
|
2832
|
-
function
|
2832
|
+
function ut(n = R()) {
|
2833
2833
|
const e = n.toLowerCase();
|
2834
2834
|
return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
|
2835
2835
|
}
|
2836
|
-
function
|
2836
|
+
function fn(n = R()) {
|
2837
2837
|
return /crios\//i.test(n);
|
2838
2838
|
}
|
2839
|
-
function
|
2839
|
+
function pn(n = R()) {
|
2840
2840
|
return /iemobile/i.test(n);
|
2841
2841
|
}
|
2842
|
-
function
|
2842
|
+
function gn(n = R()) {
|
2843
2843
|
return /android/i.test(n);
|
2844
2844
|
}
|
2845
|
-
function
|
2845
|
+
function mn(n = R()) {
|
2846
2846
|
return /blackberry/i.test(n);
|
2847
2847
|
}
|
2848
|
-
function
|
2848
|
+
function yn(n = R()) {
|
2849
2849
|
return /webos/i.test(n);
|
2850
2850
|
}
|
2851
|
-
function
|
2851
|
+
function Be(n = R()) {
|
2852
2852
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
2853
2853
|
}
|
2854
|
-
function
|
2854
|
+
function Di(n = R()) {
|
2855
2855
|
var e;
|
2856
|
-
return
|
2856
|
+
return Be(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
2857
2857
|
}
|
2858
|
-
function
|
2859
|
-
return
|
2858
|
+
function Li() {
|
2859
|
+
return Gn() && document.documentMode === 10;
|
2860
2860
|
}
|
2861
|
-
function
|
2862
|
-
return
|
2861
|
+
function _n(n = R()) {
|
2862
|
+
return Be(n) || gn(n) || yn(n) || mn(n) || /windows phone/i.test(n) || pn(n);
|
2863
2863
|
}
|
2864
|
-
function
|
2864
|
+
function $i() {
|
2865
2865
|
try {
|
2866
2866
|
return !!(window && window !== window.top);
|
2867
2867
|
} catch {
|
@@ -2884,14 +2884,14 @@ function ji() {
|
|
2884
2884
|
* See the License for the specific language governing permissions and
|
2885
2885
|
* limitations under the License.
|
2886
2886
|
*/
|
2887
|
-
function
|
2887
|
+
function vn(n, e = []) {
|
2888
2888
|
let t;
|
2889
2889
|
switch (n) {
|
2890
2890
|
case "Browser":
|
2891
|
-
t =
|
2891
|
+
t = Pt(R());
|
2892
2892
|
break;
|
2893
2893
|
case "Worker":
|
2894
|
-
t = `${
|
2894
|
+
t = `${Pt(R())}-${n}`;
|
2895
2895
|
break;
|
2896
2896
|
default:
|
2897
2897
|
t = n;
|
@@ -2915,7 +2915,7 @@ function In(n, e = []) {
|
|
2915
2915
|
* See the License for the specific language governing permissions and
|
2916
2916
|
* limitations under the License.
|
2917
2917
|
*/
|
2918
|
-
class
|
2918
|
+
class Mi {
|
2919
2919
|
constructor(e) {
|
2920
2920
|
this.auth = e, this.queue = [];
|
2921
2921
|
}
|
@@ -2970,8 +2970,8 @@ class Fi {
|
|
2970
2970
|
* See the License for the specific language governing permissions and
|
2971
2971
|
* limitations under the License.
|
2972
2972
|
*/
|
2973
|
-
async function
|
2974
|
-
return
|
2973
|
+
async function Ui(n, e = {}) {
|
2974
|
+
return K(n, "GET", "/v2/passwordPolicy", te(n, e));
|
2975
2975
|
}
|
2976
2976
|
/**
|
2977
2977
|
* @license
|
@@ -2989,12 +2989,12 @@ async function Bi(n, e = {}) {
|
|
2989
2989
|
* See the License for the specific language governing permissions and
|
2990
2990
|
* limitations under the License.
|
2991
2991
|
*/
|
2992
|
-
const
|
2993
|
-
class
|
2992
|
+
const ji = 6;
|
2993
|
+
class Bi {
|
2994
2994
|
constructor(e) {
|
2995
2995
|
var t, r, i, s;
|
2996
2996
|
const o = e.customStrengthOptions;
|
2997
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
2997
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : ji, 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;
|
2998
2998
|
}
|
2999
2999
|
validatePassword(e) {
|
3000
3000
|
var t, r, i, s, o, c;
|
@@ -3077,9 +3077,9 @@ class Hi {
|
|
3077
3077
|
* See the License for the specific language governing permissions and
|
3078
3078
|
* limitations under the License.
|
3079
3079
|
*/
|
3080
|
-
class
|
3080
|
+
class Fi {
|
3081
3081
|
constructor(e, t, r, i) {
|
3082
|
-
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
|
3082
|
+
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 Ot(this), this.idTokenSubscription = new Ot(this), this.beforeStateQueue = new Mi(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 = on, 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;
|
3083
3083
|
}
|
3084
3084
|
_initializeWithPersistence(e, t) {
|
3085
3085
|
return t && (this._popupRedirectResolver = U(t)), this._initializationPromise = this.queue(async () => {
|
@@ -3151,7 +3151,7 @@ class Wi {
|
|
3151
3151
|
}
|
3152
3152
|
async reloadAndSetCurrentUserOrClear(e) {
|
3153
3153
|
try {
|
3154
|
-
await
|
3154
|
+
await Ne(e);
|
3155
3155
|
} catch (t) {
|
3156
3156
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
3157
3157
|
return this.directlySetCurrentUser(null);
|
@@ -3159,13 +3159,13 @@ class Wi {
|
|
3159
3159
|
return this.directlySetCurrentUser(e);
|
3160
3160
|
}
|
3161
3161
|
useDeviceLanguage() {
|
3162
|
-
this.languageCode =
|
3162
|
+
this.languageCode = _i();
|
3163
3163
|
}
|
3164
3164
|
async _delete() {
|
3165
3165
|
this._deleted = !0;
|
3166
3166
|
}
|
3167
3167
|
async updateCurrentUser(e) {
|
3168
|
-
const t = e ?
|
3168
|
+
const t = e ? B(e) : null;
|
3169
3169
|
return t && _(
|
3170
3170
|
t.auth.config.apiKey === this.config.apiKey,
|
3171
3171
|
this,
|
@@ -3208,7 +3208,7 @@ class Wi {
|
|
3208
3208
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
3209
3209
|
}
|
3210
3210
|
async _updatePasswordPolicy() {
|
3211
|
-
const e = await
|
3211
|
+
const e = await Ui(this), t = new Bi(e);
|
3212
3212
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
3213
3213
|
}
|
3214
3214
|
_getPersistence() {
|
@@ -3347,7 +3347,7 @@ class Wi {
|
|
3347
3347
|
), this.persistenceManager;
|
3348
3348
|
}
|
3349
3349
|
_logFramework(e) {
|
3350
|
-
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion =
|
3350
|
+
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion = vn(this.config.clientPlatform, this._getFrameworks()));
|
3351
3351
|
}
|
3352
3352
|
_getFrameworks() {
|
3353
3353
|
return this.frameworks;
|
@@ -3377,15 +3377,15 @@ class Wi {
|
|
3377
3377
|
async _getAppCheckToken() {
|
3378
3378
|
var e;
|
3379
3379
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
3380
|
-
return t != null && t.error &&
|
3380
|
+
return t != null && t.error && pi(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
3381
3381
|
}
|
3382
3382
|
}
|
3383
3383
|
function ne(n) {
|
3384
|
-
return
|
3384
|
+
return B(n);
|
3385
3385
|
}
|
3386
|
-
class
|
3386
|
+
class Ot {
|
3387
3387
|
constructor(e) {
|
3388
|
-
this.auth = e, this.observer = null, this.addObserver =
|
3388
|
+
this.auth = e, this.observer = null, this.addObserver = tr((t) => this.observer = t);
|
3389
3389
|
}
|
3390
3390
|
get next() {
|
3391
3391
|
return _(
|
@@ -3412,11 +3412,11 @@ class kt {
|
|
3412
3412
|
* See the License for the specific language governing permissions and
|
3413
3413
|
* limitations under the License.
|
3414
3414
|
*/
|
3415
|
-
function
|
3415
|
+
function Hi() {
|
3416
3416
|
var n, e;
|
3417
3417
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
3418
3418
|
}
|
3419
|
-
function
|
3419
|
+
function bn(n) {
|
3420
3420
|
return new Promise((e, t) => {
|
3421
3421
|
const r = document.createElement("script");
|
3422
3422
|
r.setAttribute("src", n), r.onload = e, r.onerror = (i) => {
|
@@ -3425,21 +3425,21 @@ function wn(n) {
|
|
3425
3425
|
/* AuthErrorCode.INTERNAL_ERROR */
|
3426
3426
|
);
|
3427
3427
|
s.customData = i, t(s);
|
3428
|
-
}, r.type = "text/javascript", r.charset = "UTF-8",
|
3428
|
+
}, r.type = "text/javascript", r.charset = "UTF-8", Hi().appendChild(r);
|
3429
3429
|
});
|
3430
3430
|
}
|
3431
|
-
function
|
3431
|
+
function Vi(n) {
|
3432
3432
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
3433
3433
|
}
|
3434
|
-
const
|
3435
|
-
class
|
3434
|
+
const Wi = "https://www.google.com/recaptcha/enterprise.js?render=", xi = "recaptcha-enterprise", qi = "NO_RECAPTCHA";
|
3435
|
+
class zi {
|
3436
3436
|
/**
|
3437
3437
|
*
|
3438
3438
|
* @param authExtern - The corresponding Firebase {@link Auth} instance.
|
3439
3439
|
*
|
3440
3440
|
*/
|
3441
3441
|
constructor(e) {
|
3442
|
-
this.type =
|
3442
|
+
this.type = xi, this.auth = ne(e);
|
3443
3443
|
}
|
3444
3444
|
/**
|
3445
3445
|
* Executes the verification process.
|
@@ -3455,7 +3455,7 @@ class Ji {
|
|
3455
3455
|
return s._tenantRecaptchaConfigs[s.tenantId].siteKey;
|
3456
3456
|
}
|
3457
3457
|
return new Promise(async (o, c) => {
|
3458
|
-
|
3458
|
+
wi(s, {
|
3459
3459
|
clientType: "CLIENT_TYPE_WEB",
|
3460
3460
|
version: "RECAPTCHA_ENTERPRISE"
|
3461
3461
|
/* RecaptchaVersion.ENTERPRISE */
|
@@ -3463,7 +3463,7 @@ class Ji {
|
|
3463
3463
|
if (a.recaptchaKey === void 0)
|
3464
3464
|
c(new Error("recaptcha Enterprise site key undefined"));
|
3465
3465
|
else {
|
3466
|
-
const u = new
|
3466
|
+
const u = new hi(a);
|
3467
3467
|
return s.tenantId == null ? s._agentRecaptchaConfig = u : s._tenantRecaptchaConfigs[s.tenantId] = u, o(u.siteKey);
|
3468
3468
|
}
|
3469
3469
|
}).catch((a) => {
|
@@ -3473,24 +3473,24 @@ class Ji {
|
|
3473
3473
|
}
|
3474
3474
|
function i(s, o, c) {
|
3475
3475
|
const a = window.grecaptcha;
|
3476
|
-
|
3476
|
+
At(a) ? a.enterprise.ready(() => {
|
3477
3477
|
a.enterprise.execute(s, { action: e }).then((u) => {
|
3478
3478
|
o(u);
|
3479
3479
|
}).catch(() => {
|
3480
|
-
o(
|
3480
|
+
o(qi);
|
3481
3481
|
});
|
3482
3482
|
}) : c(Error("No reCAPTCHA enterprise script loaded."));
|
3483
3483
|
}
|
3484
3484
|
return new Promise((s, o) => {
|
3485
3485
|
r(this.auth).then((c) => {
|
3486
|
-
if (!t &&
|
3486
|
+
if (!t && At(window.grecaptcha))
|
3487
3487
|
i(c, s, o);
|
3488
3488
|
else {
|
3489
3489
|
if (typeof window > "u") {
|
3490
3490
|
o(new Error("RecaptchaVerifier is only supported in browser"));
|
3491
3491
|
return;
|
3492
3492
|
}
|
3493
|
-
|
3493
|
+
bn(Wi + c).then(() => {
|
3494
3494
|
i(c, s, o);
|
3495
3495
|
}).catch((a) => {
|
3496
3496
|
o(a);
|
@@ -3502,8 +3502,8 @@ class Ji {
|
|
3502
3502
|
});
|
3503
3503
|
}
|
3504
3504
|
}
|
3505
|
-
async function
|
3506
|
-
const i = new
|
3505
|
+
async function De(n, e, t, r = !1) {
|
3506
|
+
const i = new zi(n);
|
3507
3507
|
let s;
|
3508
3508
|
try {
|
3509
3509
|
s = await i.verify(t);
|
@@ -3535,13 +3535,13 @@ async function Me(n, e, t, r = !1) {
|
|
3535
3535
|
* See the License for the specific language governing permissions and
|
3536
3536
|
* limitations under the License.
|
3537
3537
|
*/
|
3538
|
-
function
|
3539
|
-
const t =
|
3538
|
+
function Ji(n, e) {
|
3539
|
+
const t = en(n, "auth");
|
3540
3540
|
if (t.isInitialized()) {
|
3541
3541
|
const i = t.getImmediate(), s = t.getOptions();
|
3542
|
-
if (
|
3542
|
+
if (Pe(s, e ?? {}))
|
3543
3543
|
return i;
|
3544
|
-
|
3544
|
+
N(
|
3545
3545
|
i,
|
3546
3546
|
"already-initialized"
|
3547
3547
|
/* AuthErrorCode.ALREADY_INITIALIZED */
|
@@ -3549,11 +3549,11 @@ function Yi(n, e) {
|
|
3549
3549
|
}
|
3550
3550
|
return t.initialize({ options: e });
|
3551
3551
|
}
|
3552
|
-
function
|
3552
|
+
function Gi(n, e) {
|
3553
3553
|
const t = (e == null ? void 0 : e.persistence) || [], r = (Array.isArray(t) ? t : [t]).map(U);
|
3554
3554
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(r, e == null ? void 0 : e.popupRedirectResolver);
|
3555
3555
|
}
|
3556
|
-
function
|
3556
|
+
function Ki(n, e, t) {
|
3557
3557
|
const r = ne(n);
|
3558
3558
|
_(
|
3559
3559
|
r._canInitEmulator,
|
@@ -3566,38 +3566,38 @@ function Qi(n, e, t) {
|
|
3566
3566
|
"invalid-emulator-scheme"
|
3567
3567
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
3568
3568
|
);
|
3569
|
-
const i = !!(t != null && t.disableWarnings), s =
|
3569
|
+
const i = !!(t != null && t.disableWarnings), s = In(e), { host: o, port: c } = Yi(e), a = c === null ? "" : `:${c}`;
|
3570
3570
|
r.config.emulator = { url: `${s}//${o}${a}/` }, r.settings.appVerificationDisabledForTesting = !0, r.emulatorConfig = Object.freeze({
|
3571
3571
|
host: o,
|
3572
3572
|
port: c,
|
3573
3573
|
protocol: s.replace(":", ""),
|
3574
3574
|
options: Object.freeze({ disableWarnings: i })
|
3575
|
-
}), i ||
|
3575
|
+
}), i || Qi();
|
3576
3576
|
}
|
3577
|
-
function
|
3577
|
+
function In(n) {
|
3578
3578
|
const e = n.indexOf(":");
|
3579
3579
|
return e < 0 ? "" : n.substr(0, e + 1);
|
3580
3580
|
}
|
3581
|
-
function
|
3582
|
-
const e =
|
3581
|
+
function Yi(n) {
|
3582
|
+
const e = In(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
3583
3583
|
if (!t)
|
3584
3584
|
return { host: "", port: null };
|
3585
3585
|
const r = t[2].split("@").pop() || "", i = /^(\[[^\]]+\])(:|$)/.exec(r);
|
3586
3586
|
if (i) {
|
3587
3587
|
const s = i[1];
|
3588
|
-
return { host: s, port:
|
3588
|
+
return { host: s, port: kt(r.substr(s.length + 1)) };
|
3589
3589
|
} else {
|
3590
3590
|
const [s, o] = r.split(":");
|
3591
|
-
return { host: s, port:
|
3591
|
+
return { host: s, port: kt(o) };
|
3592
3592
|
}
|
3593
3593
|
}
|
3594
|
-
function
|
3594
|
+
function kt(n) {
|
3595
3595
|
if (!n)
|
3596
3596
|
return null;
|
3597
3597
|
const e = Number(n);
|
3598
3598
|
return isNaN(e) ? null : e;
|
3599
3599
|
}
|
3600
|
-
function
|
3600
|
+
function Qi() {
|
3601
3601
|
function n() {
|
3602
3602
|
const e = document.createElement("p"), t = e.style;
|
3603
3603
|
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);
|
@@ -3620,7 +3620,7 @@ function es() {
|
|
3620
3620
|
* See the License for the specific language governing permissions and
|
3621
3621
|
* limitations under the License.
|
3622
3622
|
*/
|
3623
|
-
class
|
3623
|
+
class ht {
|
3624
3624
|
/** @internal */
|
3625
3625
|
constructor(e, t) {
|
3626
3626
|
this.providerId = e, this.signInMethod = t;
|
@@ -3631,23 +3631,23 @@ class pt {
|
|
3631
3631
|
* @returns a JSON-serializable representation of this object.
|
3632
3632
|
*/
|
3633
3633
|
toJSON() {
|
3634
|
-
return
|
3634
|
+
return M("not implemented");
|
3635
3635
|
}
|
3636
3636
|
/** @internal */
|
3637
3637
|
_getIdTokenResponse(e) {
|
3638
|
-
return
|
3638
|
+
return M("not implemented");
|
3639
3639
|
}
|
3640
3640
|
/** @internal */
|
3641
3641
|
_linkToIdToken(e, t) {
|
3642
|
-
return
|
3642
|
+
return M("not implemented");
|
3643
3643
|
}
|
3644
3644
|
/** @internal */
|
3645
3645
|
_getReauthenticationResolver(e) {
|
3646
|
-
return
|
3646
|
+
return M("not implemented");
|
3647
3647
|
}
|
3648
3648
|
}
|
3649
|
-
async function
|
3650
|
-
return
|
3649
|
+
async function Xi(n, e) {
|
3650
|
+
return K(n, "POST", "/v1/accounts:update", e);
|
3651
3651
|
}
|
3652
3652
|
/**
|
3653
3653
|
* @license
|
@@ -3665,14 +3665,14 @@ async function ts(n, e) {
|
|
3665
3665
|
* See the License for the specific language governing permissions and
|
3666
3666
|
* limitations under the License.
|
3667
3667
|
*/
|
3668
|
-
async function
|
3669
|
-
return
|
3668
|
+
async function Ge(n, e) {
|
3669
|
+
return je(n, "POST", "/v1/accounts:signInWithPassword", te(n, e));
|
3670
3670
|
}
|
3671
|
-
async function
|
3672
|
-
return
|
3671
|
+
async function Zi(n, e) {
|
3672
|
+
return K(n, "POST", "/v1/accounts:sendOobCode", te(n, e));
|
3673
3673
|
}
|
3674
|
-
async function
|
3675
|
-
return
|
3674
|
+
async function Ke(n, e) {
|
3675
|
+
return Zi(n, e);
|
3676
3676
|
}
|
3677
3677
|
/**
|
3678
3678
|
* @license
|
@@ -3690,11 +3690,11 @@ async function Xe(n, e) {
|
|
3690
3690
|
* See the License for the specific language governing permissions and
|
3691
3691
|
* limitations under the License.
|
3692
3692
|
*/
|
3693
|
-
async function
|
3694
|
-
return
|
3693
|
+
async function es(n, e) {
|
3694
|
+
return je(n, "POST", "/v1/accounts:signInWithEmailLink", te(n, e));
|
3695
3695
|
}
|
3696
|
-
async function
|
3697
|
-
return
|
3696
|
+
async function ts(n, e) {
|
3697
|
+
return je(n, "POST", "/v1/accounts:signInWithEmailLink", te(n, e));
|
3698
3698
|
}
|
3699
3699
|
/**
|
3700
3700
|
* @license
|
@@ -3712,7 +3712,7 @@ async function is(n, e) {
|
|
3712
3712
|
* See the License for the specific language governing permissions and
|
3713
3713
|
* limitations under the License.
|
3714
3714
|
*/
|
3715
|
-
class ye extends
|
3715
|
+
class ye extends ht {
|
3716
3716
|
/** @internal */
|
3717
3717
|
constructor(e, t, r, i = null) {
|
3718
3718
|
super("password", r), this._email = e, this._password = t, this._tenantId = i;
|
@@ -3770,34 +3770,34 @@ class ye extends pt {
|
|
3770
3770
|
/* RecaptchaClientType.WEB */
|
3771
3771
|
};
|
3772
3772
|
if (!((t = e._getRecaptchaConfig()) === null || t === void 0) && t.emailPasswordEnabled) {
|
3773
|
-
const i = await
|
3773
|
+
const i = await De(
|
3774
3774
|
e,
|
3775
3775
|
r,
|
3776
3776
|
"signInWithPassword"
|
3777
3777
|
/* RecaptchaActionName.SIGN_IN_WITH_PASSWORD */
|
3778
3778
|
);
|
3779
|
-
return
|
3779
|
+
return Ge(e, i);
|
3780
3780
|
} else
|
3781
|
-
return
|
3781
|
+
return Ge(e, r).catch(async (i) => {
|
3782
3782
|
if (i.code === "auth/missing-recaptcha-token") {
|
3783
3783
|
console.log("Sign-in with email address and password is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow.");
|
3784
|
-
const s = await
|
3784
|
+
const s = await De(
|
3785
3785
|
e,
|
3786
3786
|
r,
|
3787
3787
|
"signInWithPassword"
|
3788
3788
|
/* RecaptchaActionName.SIGN_IN_WITH_PASSWORD */
|
3789
3789
|
);
|
3790
|
-
return
|
3790
|
+
return Ge(e, s);
|
3791
3791
|
} else
|
3792
3792
|
return Promise.reject(i);
|
3793
3793
|
});
|
3794
3794
|
case "emailLink":
|
3795
|
-
return
|
3795
|
+
return es(e, {
|
3796
3796
|
email: this._email,
|
3797
3797
|
oobCode: this._password
|
3798
3798
|
});
|
3799
3799
|
default:
|
3800
|
-
|
3800
|
+
N(
|
3801
3801
|
e,
|
3802
3802
|
"internal-error"
|
3803
3803
|
/* AuthErrorCode.INTERNAL_ERROR */
|
@@ -3808,20 +3808,20 @@ class ye extends pt {
|
|
3808
3808
|
async _linkToIdToken(e, t) {
|
3809
3809
|
switch (this.signInMethod) {
|
3810
3810
|
case "password":
|
3811
|
-
return
|
3811
|
+
return Xi(e, {
|
3812
3812
|
idToken: t,
|
3813
3813
|
returnSecureToken: !0,
|
3814
3814
|
email: this._email,
|
3815
3815
|
password: this._password
|
3816
3816
|
});
|
3817
3817
|
case "emailLink":
|
3818
|
-
return
|
3818
|
+
return ts(e, {
|
3819
3819
|
idToken: t,
|
3820
3820
|
email: this._email,
|
3821
3821
|
oobCode: this._password
|
3822
3822
|
});
|
3823
3823
|
default:
|
3824
|
-
|
3824
|
+
N(
|
3825
3825
|
e,
|
3826
3826
|
"internal-error"
|
3827
3827
|
/* AuthErrorCode.INTERNAL_ERROR */
|
@@ -3850,7 +3850,7 @@ class ye extends pt {
|
|
3850
3850
|
* limitations under the License.
|
3851
3851
|
*/
|
3852
3852
|
async function oe(n, e) {
|
3853
|
-
return
|
3853
|
+
return je(n, "POST", "/v1/accounts:signInWithIdp", te(n, e));
|
3854
3854
|
}
|
3855
3855
|
/**
|
3856
3856
|
* @license
|
@@ -3868,15 +3868,15 @@ async function oe(n, e) {
|
|
3868
3868
|
* See the License for the specific language governing permissions and
|
3869
3869
|
* limitations under the License.
|
3870
3870
|
*/
|
3871
|
-
const
|
3872
|
-
class ee extends
|
3871
|
+
const ns = "http://localhost";
|
3872
|
+
class ee extends ht {
|
3873
3873
|
constructor() {
|
3874
3874
|
super(...arguments), this.pendingToken = null;
|
3875
3875
|
}
|
3876
3876
|
/** @internal */
|
3877
3877
|
static _fromParams(e) {
|
3878
3878
|
const t = new ee(e.providerId, e.signInMethod);
|
3879
|
-
return e.idToken || e.accessToken ? (e.idToken && (t.idToken = e.idToken), e.accessToken && (t.accessToken = e.accessToken), e.nonce && !e.pendingToken && (t.nonce = e.nonce), e.pendingToken && (t.pendingToken = e.pendingToken)) : e.oauthToken && e.oauthTokenSecret ? (t.accessToken = e.oauthToken, t.secret = e.oauthTokenSecret) :
|
3879
|
+
return e.idToken || e.accessToken ? (e.idToken && (t.idToken = e.idToken), e.accessToken && (t.accessToken = e.accessToken), e.nonce && !e.pendingToken && (t.nonce = e.nonce), e.pendingToken && (t.pendingToken = e.pendingToken)) : e.oauthToken && e.oauthTokenSecret ? (t.accessToken = e.oauthToken, t.secret = e.oauthTokenSecret) : N(
|
3880
3880
|
"argument-error"
|
3881
3881
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
3882
3882
|
), t;
|
@@ -3903,7 +3903,7 @@ class ee extends pt {
|
|
3903
3903
|
* @returns If the JSON input does not represent an {@link AuthCredential}, null is returned.
|
3904
3904
|
*/
|
3905
3905
|
static fromJSON(e) {
|
3906
|
-
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: r, signInMethod: i } = t, s =
|
3906
|
+
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: r, signInMethod: i } = t, s = at(t, ["providerId", "signInMethod"]);
|
3907
3907
|
if (!r || !i)
|
3908
3908
|
return null;
|
3909
3909
|
const o = new ee(r, i);
|
@@ -3926,7 +3926,7 @@ class ee extends pt {
|
|
3926
3926
|
}
|
3927
3927
|
buildRequest() {
|
3928
3928
|
const e = {
|
3929
|
-
requestUri:
|
3929
|
+
requestUri: ns,
|
3930
3930
|
returnSecureToken: !0
|
3931
3931
|
};
|
3932
3932
|
if (this.pendingToken)
|
@@ -3954,7 +3954,7 @@ class ee extends pt {
|
|
3954
3954
|
* See the License for the specific language governing permissions and
|
3955
3955
|
* limitations under the License.
|
3956
3956
|
*/
|
3957
|
-
function
|
3957
|
+
function rs(n) {
|
3958
3958
|
switch (n) {
|
3959
3959
|
case "recoverEmail":
|
3960
3960
|
return "RECOVER_EMAIL";
|
@@ -3972,11 +3972,11 @@ function os(n) {
|
|
3972
3972
|
return null;
|
3973
3973
|
}
|
3974
3974
|
}
|
3975
|
-
function
|
3975
|
+
function is(n) {
|
3976
3976
|
const e = de(ue(n)).link, t = e ? de(ue(e)).deep_link_id : null, r = de(ue(n)).deep_link_id;
|
3977
3977
|
return (r ? de(ue(r)).link : null) || r || t || e || n;
|
3978
3978
|
}
|
3979
|
-
class
|
3979
|
+
class ft {
|
3980
3980
|
/**
|
3981
3981
|
* @param actionLink - The link from which to extract the URL.
|
3982
3982
|
* @returns The {@link ActionCodeURL} object, or null if the link is invalid.
|
@@ -3985,7 +3985,7 @@ class gt {
|
|
3985
3985
|
*/
|
3986
3986
|
constructor(e) {
|
3987
3987
|
var t, r, i, s, o, c;
|
3988
|
-
const a = de(ue(e)), u = (t = a.apiKey) !== null && t !== void 0 ? t : null, y = (r = a.oobCode) !== null && r !== void 0 ? r : null, b =
|
3988
|
+
const a = de(ue(e)), u = (t = a.apiKey) !== null && t !== void 0 ? t : null, y = (r = a.oobCode) !== null && r !== void 0 ? r : null, b = rs((i = a.mode) !== null && i !== void 0 ? i : null);
|
3989
3989
|
_(
|
3990
3990
|
u && y && b,
|
3991
3991
|
"argument-error"
|
@@ -4002,9 +4002,9 @@ class gt {
|
|
4002
4002
|
* @public
|
4003
4003
|
*/
|
4004
4004
|
static parseLink(e) {
|
4005
|
-
const t =
|
4005
|
+
const t = is(e);
|
4006
4006
|
try {
|
4007
|
-
return new
|
4007
|
+
return new ft(t);
|
4008
4008
|
} catch {
|
4009
4009
|
return null;
|
4010
4010
|
}
|
@@ -4074,7 +4074,7 @@ class le {
|
|
4074
4074
|
* @returns - The auth provider credential.
|
4075
4075
|
*/
|
4076
4076
|
static credentialWithLink(e, t) {
|
4077
|
-
const r =
|
4077
|
+
const r = ft.parseLink(t);
|
4078
4078
|
return _(
|
4079
4079
|
r,
|
4080
4080
|
"argument-error"
|
@@ -4101,7 +4101,7 @@ le.EMAIL_LINK_SIGN_IN_METHOD = "emailLink";
|
|
4101
4101
|
* See the License for the specific language governing permissions and
|
4102
4102
|
* limitations under the License.
|
4103
4103
|
*/
|
4104
|
-
class
|
4104
|
+
class wn {
|
4105
4105
|
/**
|
4106
4106
|
* Constructor for generic OAuth providers.
|
4107
4107
|
*
|
@@ -4154,7 +4154,7 @@ class Tn {
|
|
4154
4154
|
* See the License for the specific language governing permissions and
|
4155
4155
|
* limitations under the License.
|
4156
4156
|
*/
|
4157
|
-
class we extends
|
4157
|
+
class we extends wn {
|
4158
4158
|
constructor() {
|
4159
4159
|
super(...arguments), this.scopes = [];
|
4160
4160
|
}
|
@@ -4189,7 +4189,7 @@ class we extends Tn {
|
|
4189
4189
|
* See the License for the specific language governing permissions and
|
4190
4190
|
* limitations under the License.
|
4191
4191
|
*/
|
4192
|
-
class
|
4192
|
+
class V extends we {
|
4193
4193
|
constructor() {
|
4194
4194
|
super(
|
4195
4195
|
"facebook.com"
|
@@ -4210,8 +4210,8 @@ class H extends we {
|
|
4210
4210
|
*/
|
4211
4211
|
static credential(e) {
|
4212
4212
|
return ee._fromParams({
|
4213
|
-
providerId:
|
4214
|
-
signInMethod:
|
4213
|
+
providerId: V.PROVIDER_ID,
|
4214
|
+
signInMethod: V.FACEBOOK_SIGN_IN_METHOD,
|
4215
4215
|
accessToken: e
|
4216
4216
|
});
|
4217
4217
|
}
|
@@ -4221,7 +4221,7 @@ class H extends we {
|
|
4221
4221
|
* @param userCredential - The user credential.
|
4222
4222
|
*/
|
4223
4223
|
static credentialFromResult(e) {
|
4224
|
-
return
|
4224
|
+
return V.credentialFromTaggedObject(e);
|
4225
4225
|
}
|
4226
4226
|
/**
|
4227
4227
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
@@ -4230,20 +4230,20 @@ class H extends we {
|
|
4230
4230
|
* @param userCredential - The user credential.
|
4231
4231
|
*/
|
4232
4232
|
static credentialFromError(e) {
|
4233
|
-
return
|
4233
|
+
return V.credentialFromTaggedObject(e.customData || {});
|
4234
4234
|
}
|
4235
4235
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
4236
4236
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
4237
4237
|
return null;
|
4238
4238
|
try {
|
4239
|
-
return
|
4239
|
+
return V.credential(e.oauthAccessToken);
|
4240
4240
|
} catch {
|
4241
4241
|
return null;
|
4242
4242
|
}
|
4243
4243
|
}
|
4244
4244
|
}
|
4245
|
-
|
4246
|
-
|
4245
|
+
V.FACEBOOK_SIGN_IN_METHOD = "facebook.com";
|
4246
|
+
V.PROVIDER_ID = "facebook.com";
|
4247
4247
|
/**
|
4248
4248
|
* @license
|
4249
4249
|
* Copyright 2020 Google LLC
|
@@ -4400,7 +4400,7 @@ x.PROVIDER_ID = "github.com";
|
|
4400
4400
|
* See the License for the specific language governing permissions and
|
4401
4401
|
* limitations under the License.
|
4402
4402
|
*/
|
4403
|
-
class
|
4403
|
+
class q extends we {
|
4404
4404
|
constructor() {
|
4405
4405
|
super(
|
4406
4406
|
"twitter.com"
|
@@ -4415,8 +4415,8 @@ class z extends we {
|
|
4415
4415
|
*/
|
4416
4416
|
static credential(e, t) {
|
4417
4417
|
return ee._fromParams({
|
4418
|
-
providerId:
|
4419
|
-
signInMethod:
|
4418
|
+
providerId: q.PROVIDER_ID,
|
4419
|
+
signInMethod: q.TWITTER_SIGN_IN_METHOD,
|
4420
4420
|
oauthToken: e,
|
4421
4421
|
oauthTokenSecret: t
|
4422
4422
|
});
|
@@ -4427,7 +4427,7 @@ class z extends we {
|
|
4427
4427
|
* @param userCredential - The user credential.
|
4428
4428
|
*/
|
4429
4429
|
static credentialFromResult(e) {
|
4430
|
-
return
|
4430
|
+
return q.credentialFromTaggedObject(e);
|
4431
4431
|
}
|
4432
4432
|
/**
|
4433
4433
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
@@ -4436,7 +4436,7 @@ class z extends we {
|
|
4436
4436
|
* @param userCredential - The user credential.
|
4437
4437
|
*/
|
4438
4438
|
static credentialFromError(e) {
|
4439
|
-
return
|
4439
|
+
return q.credentialFromTaggedObject(e.customData || {});
|
4440
4440
|
}
|
4441
4441
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
4442
4442
|
if (!e)
|
@@ -4445,14 +4445,14 @@ class z extends we {
|
|
4445
4445
|
if (!t || !r)
|
4446
4446
|
return null;
|
4447
4447
|
try {
|
4448
|
-
return
|
4448
|
+
return q.credential(t, r);
|
4449
4449
|
} catch {
|
4450
4450
|
return null;
|
4451
4451
|
}
|
4452
4452
|
}
|
4453
4453
|
}
|
4454
|
-
|
4455
|
-
|
4454
|
+
q.TWITTER_SIGN_IN_METHOD = "twitter.com";
|
4455
|
+
q.PROVIDER_ID = "twitter.com";
|
4456
4456
|
/**
|
4457
4457
|
* @license
|
4458
4458
|
* Copyright 2020 Google LLC
|
@@ -4474,7 +4474,7 @@ class ce {
|
|
4474
4474
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
4475
4475
|
}
|
4476
4476
|
static async _fromIdTokenResponse(e, t, r, i = !1) {
|
4477
|
-
const s = await
|
4477
|
+
const s = await X._fromIdTokenResponse(e, r, i), o = Nt(r);
|
4478
4478
|
return new ce({
|
4479
4479
|
user: s,
|
4480
4480
|
providerId: o,
|
@@ -4516,10 +4516,10 @@ function Nt(n) {
|
|
4516
4516
|
* See the License for the specific language governing permissions and
|
4517
4517
|
* limitations under the License.
|
4518
4518
|
*/
|
4519
|
-
class
|
4519
|
+
class Le extends G {
|
4520
4520
|
constructor(e, t, r, i) {
|
4521
4521
|
var s;
|
4522
|
-
super(t.code, t.message), this.operationType = r, this.user = i, Object.setPrototypeOf(this,
|
4522
|
+
super(t.code, t.message), this.operationType = r, this.user = i, Object.setPrototypeOf(this, Le.prototype), this.customData = {
|
4523
4523
|
appName: e.name,
|
4524
4524
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
4525
4525
|
_serverResponse: t.customData._serverResponse,
|
@@ -4527,15 +4527,15 @@ class $e extends K {
|
|
4527
4527
|
};
|
4528
4528
|
}
|
4529
4529
|
static _fromErrorAndOperation(e, t, r, i) {
|
4530
|
-
return new
|
4530
|
+
return new Le(e, t, r, i);
|
4531
4531
|
}
|
4532
4532
|
}
|
4533
|
-
function
|
4533
|
+
function En(n, e, t, r) {
|
4534
4534
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
4535
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
4535
|
+
throw s.code === "auth/multi-factor-auth-required" ? Le._fromErrorAndOperation(n, s, e, r) : s;
|
4536
4536
|
});
|
4537
4537
|
}
|
4538
|
-
async function
|
4538
|
+
async function ss(n, e, t = !1) {
|
4539
4539
|
const r = await ge(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
4540
4540
|
return ce._forOperation(n, "link", r);
|
4541
4541
|
}
|
@@ -4555,17 +4555,17 @@ async function cs(n, e, t = !1) {
|
|
4555
4555
|
* See the License for the specific language governing permissions and
|
4556
4556
|
* limitations under the License.
|
4557
4557
|
*/
|
4558
|
-
async function
|
4558
|
+
async function os(n, e, t = !1) {
|
4559
4559
|
const { auth: r } = n, i = "reauthenticate";
|
4560
4560
|
try {
|
4561
|
-
const s = await ge(n,
|
4561
|
+
const s = await ge(n, En(r, i, e, n), t);
|
4562
4562
|
_(
|
4563
4563
|
s.idToken,
|
4564
4564
|
r,
|
4565
4565
|
"internal-error"
|
4566
4566
|
/* AuthErrorCode.INTERNAL_ERROR */
|
4567
4567
|
);
|
4568
|
-
const o =
|
4568
|
+
const o = dt(s.idToken);
|
4569
4569
|
_(
|
4570
4570
|
o,
|
4571
4571
|
r,
|
@@ -4580,7 +4580,7 @@ async function ls(n, e, t = !1) {
|
|
4580
4580
|
/* AuthErrorCode.USER_MISMATCH */
|
4581
4581
|
), ce._forOperation(n, i, s);
|
4582
4582
|
} catch (s) {
|
4583
|
-
throw (s == null ? void 0 : s.code) === "auth/user-not-found" &&
|
4583
|
+
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && N(
|
4584
4584
|
r,
|
4585
4585
|
"user-mismatch"
|
4586
4586
|
/* AuthErrorCode.USER_MISMATCH */
|
@@ -4603,12 +4603,12 @@ async function ls(n, e, t = !1) {
|
|
4603
4603
|
* See the License for the specific language governing permissions and
|
4604
4604
|
* limitations under the License.
|
4605
4605
|
*/
|
4606
|
-
async function
|
4607
|
-
const r = "signIn", i = await
|
4606
|
+
async function Tn(n, e, t = !1) {
|
4607
|
+
const r = "signIn", i = await En(n, r, e), s = await ce._fromIdTokenResponse(n, r, i);
|
4608
4608
|
return t || await n._updateCurrentUser(s.user), s;
|
4609
4609
|
}
|
4610
|
-
async function
|
4611
|
-
return
|
4610
|
+
async function as(n, e) {
|
4611
|
+
return Tn(ne(n), e);
|
4612
4612
|
}
|
4613
4613
|
/**
|
4614
4614
|
* @license
|
@@ -4626,7 +4626,7 @@ async function ds(n, e) {
|
|
4626
4626
|
* See the License for the specific language governing permissions and
|
4627
4627
|
* limitations under the License.
|
4628
4628
|
*/
|
4629
|
-
function
|
4629
|
+
function Ye(n, e, t) {
|
4630
4630
|
var r;
|
4631
4631
|
_(
|
4632
4632
|
((r = t.url) === null || r === void 0 ? void 0 : r.length) > 0,
|
@@ -4666,11 +4666,11 @@ function Qe(n, e, t) {
|
|
4666
4666
|
* See the License for the specific language governing permissions and
|
4667
4667
|
* limitations under the License.
|
4668
4668
|
*/
|
4669
|
-
async function
|
4669
|
+
async function cs(n) {
|
4670
4670
|
const e = ne(n);
|
4671
4671
|
e._getPasswordPolicyInternal() && await e._updatePasswordPolicy();
|
4672
4672
|
}
|
4673
|
-
async function
|
4673
|
+
async function ls(n, e, t) {
|
4674
4674
|
var r;
|
4675
4675
|
const i = ne(n), s = {
|
4676
4676
|
requestType: "PASSWORD_RESET",
|
@@ -4679,36 +4679,36 @@ async function hs(n, e, t) {
|
|
4679
4679
|
/* RecaptchaClientType.WEB */
|
4680
4680
|
};
|
4681
4681
|
if (!((r = i._getRecaptchaConfig()) === null || r === void 0) && r.emailPasswordEnabled) {
|
4682
|
-
const o = await
|
4683
|
-
t &&
|
4682
|
+
const o = await De(i, s, "getOobCode", !0);
|
4683
|
+
t && Ye(i, o, t), await Ke(i, o);
|
4684
4684
|
} else
|
4685
|
-
t &&
|
4685
|
+
t && Ye(i, s, t), await Ke(i, s).catch(async (o) => {
|
4686
4686
|
if (o.code === "auth/missing-recaptcha-token") {
|
4687
4687
|
console.log("Password resets are protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the password reset flow.");
|
4688
|
-
const c = await
|
4689
|
-
t &&
|
4688
|
+
const c = await De(i, s, "getOobCode", !0);
|
4689
|
+
t && Ye(i, c, t), await Ke(i, c);
|
4690
4690
|
} else
|
4691
4691
|
return Promise.reject(o);
|
4692
4692
|
});
|
4693
4693
|
}
|
4694
|
-
function
|
4695
|
-
return
|
4696
|
-
throw r.code === "auth/password-does-not-meet-requirements" &&
|
4694
|
+
function ds(n, e, t) {
|
4695
|
+
return as(B(n), le.credential(e, t)).catch(async (r) => {
|
4696
|
+
throw r.code === "auth/password-does-not-meet-requirements" && cs(n), r;
|
4697
4697
|
});
|
4698
4698
|
}
|
4699
|
-
function
|
4700
|
-
return
|
4699
|
+
function us(n, e, t, r) {
|
4700
|
+
return B(n).onIdTokenChanged(e, t, r);
|
4701
4701
|
}
|
4702
|
-
function
|
4703
|
-
return
|
4702
|
+
function hs(n, e, t) {
|
4703
|
+
return B(n).beforeAuthStateChanged(e, t);
|
4704
4704
|
}
|
4705
|
-
function
|
4706
|
-
return
|
4705
|
+
function fs(n, e, t, r) {
|
4706
|
+
return B(n).onAuthStateChanged(e, t, r);
|
4707
4707
|
}
|
4708
|
-
function
|
4709
|
-
return
|
4708
|
+
function ps(n) {
|
4709
|
+
return B(n).signOut();
|
4710
4710
|
}
|
4711
|
-
const
|
4711
|
+
const $e = "__sak";
|
4712
4712
|
/**
|
4713
4713
|
* @license
|
4714
4714
|
* Copyright 2019 Google LLC
|
@@ -4725,13 +4725,13 @@ const Ue = "__sak";
|
|
4725
4725
|
* See the License for the specific language governing permissions and
|
4726
4726
|
* limitations under the License.
|
4727
4727
|
*/
|
4728
|
-
class
|
4728
|
+
class An {
|
4729
4729
|
constructor(e, t) {
|
4730
4730
|
this.storageRetriever = e, this.type = t;
|
4731
4731
|
}
|
4732
4732
|
_isAvailable() {
|
4733
4733
|
try {
|
4734
|
-
return this.storage ? (this.storage.setItem(
|
4734
|
+
return this.storage ? (this.storage.setItem($e, "1"), this.storage.removeItem($e), Promise.resolve(!0)) : Promise.resolve(!1);
|
4735
4735
|
} catch {
|
4736
4736
|
return Promise.resolve(!1);
|
4737
4737
|
}
|
@@ -4766,18 +4766,18 @@ class Cn {
|
|
4766
4766
|
* See the License for the specific language governing permissions and
|
4767
4767
|
* limitations under the License.
|
4768
4768
|
*/
|
4769
|
-
function
|
4769
|
+
function gs() {
|
4770
4770
|
const n = R();
|
4771
|
-
return
|
4771
|
+
return ut(n) || Be(n);
|
4772
4772
|
}
|
4773
|
-
const
|
4774
|
-
class
|
4773
|
+
const ms = 1e3, ys = 10;
|
4774
|
+
class Sn extends An {
|
4775
4775
|
constructor() {
|
4776
4776
|
super(
|
4777
4777
|
() => window.localStorage,
|
4778
4778
|
"LOCAL"
|
4779
4779
|
/* PersistenceType.LOCAL */
|
4780
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
4780
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = gs() && $i(), this.fallbackToPolling = _n(), this._shouldAllowMigration = !0;
|
4781
4781
|
}
|
4782
4782
|
forAllChangedKeys(e) {
|
4783
4783
|
for (const t of Object.keys(this.listeners)) {
|
@@ -4804,7 +4804,7 @@ class Rn extends Cn {
|
|
4804
4804
|
const o = this.storage.getItem(r);
|
4805
4805
|
!t && this.localCache[r] === o || this.notifyListeners(r, o);
|
4806
4806
|
}, s = this.storage.getItem(r);
|
4807
|
-
|
4807
|
+
Li() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(i, ys) : i();
|
4808
4808
|
}
|
4809
4809
|
notifyListeners(e, t) {
|
4810
4810
|
this.localCache[e] = t;
|
@@ -4826,7 +4826,7 @@ class Rn extends Cn {
|
|
4826
4826
|
!0
|
4827
4827
|
);
|
4828
4828
|
});
|
4829
|
-
},
|
4829
|
+
}, ms);
|
4830
4830
|
}
|
4831
4831
|
stopPolling() {
|
4832
4832
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
@@ -4855,8 +4855,8 @@ class Rn extends Cn {
|
|
4855
4855
|
await super._remove(e), delete this.localCache[e];
|
4856
4856
|
}
|
4857
4857
|
}
|
4858
|
-
|
4859
|
-
const
|
4858
|
+
Sn.type = "LOCAL";
|
4859
|
+
const _s = Sn;
|
4860
4860
|
/**
|
4861
4861
|
* @license
|
4862
4862
|
* Copyright 2020 Google LLC
|
@@ -4873,7 +4873,7 @@ const Is = Rn;
|
|
4873
4873
|
* See the License for the specific language governing permissions and
|
4874
4874
|
* limitations under the License.
|
4875
4875
|
*/
|
4876
|
-
class
|
4876
|
+
class Cn extends An {
|
4877
4877
|
constructor() {
|
4878
4878
|
super(
|
4879
4879
|
() => window.sessionStorage,
|
@@ -4886,8 +4886,8 @@ class Pn extends Cn {
|
|
4886
4886
|
_removeListener(e, t) {
|
4887
4887
|
}
|
4888
4888
|
}
|
4889
|
-
|
4890
|
-
const
|
4889
|
+
Cn.type = "SESSION";
|
4890
|
+
const Rn = Cn;
|
4891
4891
|
/**
|
4892
4892
|
* @license
|
4893
4893
|
* Copyright 2019 Google LLC
|
@@ -4904,7 +4904,7 @@ const On = Pn;
|
|
4904
4904
|
* See the License for the specific language governing permissions and
|
4905
4905
|
* limitations under the License.
|
4906
4906
|
*/
|
4907
|
-
function
|
4907
|
+
function vs(n) {
|
4908
4908
|
return Promise.all(n.map(async (e) => {
|
4909
4909
|
try {
|
4910
4910
|
return {
|
@@ -4935,7 +4935,7 @@ function ws(n) {
|
|
4935
4935
|
* See the License for the specific language governing permissions and
|
4936
4936
|
* limitations under the License.
|
4937
4937
|
*/
|
4938
|
-
class
|
4938
|
+
class Fe {
|
4939
4939
|
constructor(e) {
|
4940
4940
|
this.eventTarget = e, this.handlersMap = {}, this.boundEventHandler = this.handleEvent.bind(this);
|
4941
4941
|
}
|
@@ -4949,7 +4949,7 @@ class He {
|
|
4949
4949
|
const t = this.receivers.find((i) => i.isListeningto(e));
|
4950
4950
|
if (t)
|
4951
4951
|
return t;
|
4952
|
-
const r = new
|
4952
|
+
const r = new Fe(e);
|
4953
4953
|
return this.receivers.push(r), r;
|
4954
4954
|
}
|
4955
4955
|
isListeningto(e) {
|
@@ -4974,7 +4974,7 @@ class He {
|
|
4974
4974
|
eventId: r,
|
4975
4975
|
eventType: i
|
4976
4976
|
});
|
4977
|
-
const c = Array.from(o).map(async (u) => u(t.origin, s)), a = await
|
4977
|
+
const c = Array.from(o).map(async (u) => u(t.origin, s)), a = await vs(c);
|
4978
4978
|
t.ports[0].postMessage({
|
4979
4979
|
status: "done",
|
4980
4980
|
eventId: r,
|
@@ -5003,7 +5003,7 @@ class He {
|
|
5003
5003
|
this.handlersMap[e] && t && this.handlersMap[e].delete(t), (!t || this.handlersMap[e].size === 0) && delete this.handlersMap[e], Object.keys(this.handlersMap).length === 0 && this.eventTarget.removeEventListener("message", this.boundEventHandler);
|
5004
5004
|
}
|
5005
5005
|
}
|
5006
|
-
|
5006
|
+
Fe.receivers = [];
|
5007
5007
|
/**
|
5008
5008
|
* @license
|
5009
5009
|
* Copyright 2020 Google LLC
|
@@ -5020,7 +5020,7 @@ He.receivers = [];
|
|
5020
5020
|
* See the License for the specific language governing permissions and
|
5021
5021
|
* limitations under the License.
|
5022
5022
|
*/
|
5023
|
-
function
|
5023
|
+
function pt(n = "", e = 10) {
|
5024
5024
|
let t = "";
|
5025
5025
|
for (let r = 0; r < e; r++)
|
5026
5026
|
t += Math.floor(Math.random() * 10);
|
@@ -5042,7 +5042,7 @@ function mt(n = "", e = 10) {
|
|
5042
5042
|
* See the License for the specific language governing permissions and
|
5043
5043
|
* limitations under the License.
|
5044
5044
|
*/
|
5045
|
-
class
|
5045
|
+
class bs {
|
5046
5046
|
constructor(e) {
|
5047
5047
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
5048
5048
|
}
|
@@ -5076,7 +5076,7 @@ class Es {
|
|
5076
5076
|
);
|
5077
5077
|
let s, o;
|
5078
5078
|
return new Promise((c, a) => {
|
5079
|
-
const u =
|
5079
|
+
const u = pt("", 20);
|
5080
5080
|
i.port1.start();
|
5081
5081
|
const y = setTimeout(() => {
|
5082
5082
|
a(new Error(
|
@@ -5139,11 +5139,11 @@ class Es {
|
|
5139
5139
|
* See the License for the specific language governing permissions and
|
5140
5140
|
* limitations under the License.
|
5141
5141
|
*/
|
5142
|
-
function
|
5142
|
+
function $() {
|
5143
5143
|
return window;
|
5144
5144
|
}
|
5145
|
-
function
|
5146
|
-
|
5145
|
+
function Is(n) {
|
5146
|
+
$().location.href = n;
|
5147
5147
|
}
|
5148
5148
|
/**
|
5149
5149
|
* @license
|
@@ -5161,10 +5161,10 @@ function Ts(n) {
|
|
5161
5161
|
* See the License for the specific language governing permissions and
|
5162
5162
|
* limitations under the License.
|
5163
5163
|
*/
|
5164
|
-
function
|
5165
|
-
return typeof
|
5164
|
+
function Pn() {
|
5165
|
+
return typeof $().WorkerGlobalScope < "u" && typeof $().importScripts == "function";
|
5166
5166
|
}
|
5167
|
-
async function
|
5167
|
+
async function ws() {
|
5168
5168
|
if (!(navigator != null && navigator.serviceWorker))
|
5169
5169
|
return null;
|
5170
5170
|
try {
|
@@ -5173,12 +5173,12 @@ async function As() {
|
|
5173
5173
|
return null;
|
5174
5174
|
}
|
5175
5175
|
}
|
5176
|
-
function
|
5176
|
+
function Es() {
|
5177
5177
|
var n;
|
5178
5178
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
5179
5179
|
}
|
5180
|
-
function
|
5181
|
-
return
|
5180
|
+
function Ts() {
|
5181
|
+
return Pn() ? self : null;
|
5182
5182
|
}
|
5183
5183
|
/**
|
5184
5184
|
* @license
|
@@ -5196,7 +5196,7 @@ function Cs() {
|
|
5196
5196
|
* See the License for the specific language governing permissions and
|
5197
5197
|
* limitations under the License.
|
5198
5198
|
*/
|
5199
|
-
const
|
5199
|
+
const On = "firebaseLocalStorageDb", As = 1, Me = "firebaseLocalStorage", kn = "fbase_key";
|
5200
5200
|
class Ee {
|
5201
5201
|
constructor(e) {
|
5202
5202
|
this.request = e;
|
@@ -5211,55 +5211,55 @@ class Ee {
|
|
5211
5211
|
});
|
5212
5212
|
}
|
5213
5213
|
}
|
5214
|
-
function
|
5215
|
-
return n.transaction([
|
5214
|
+
function He(n, e) {
|
5215
|
+
return n.transaction([Me], e ? "readwrite" : "readonly").objectStore(Me);
|
5216
5216
|
}
|
5217
|
-
function
|
5218
|
-
const n = indexedDB.deleteDatabase(
|
5217
|
+
function Ss() {
|
5218
|
+
const n = indexedDB.deleteDatabase(On);
|
5219
5219
|
return new Ee(n).toPromise();
|
5220
5220
|
}
|
5221
|
-
function
|
5222
|
-
const n = indexedDB.open(
|
5221
|
+
function it() {
|
5222
|
+
const n = indexedDB.open(On, As);
|
5223
5223
|
return new Promise((e, t) => {
|
5224
5224
|
n.addEventListener("error", () => {
|
5225
5225
|
t(n.error);
|
5226
5226
|
}), n.addEventListener("upgradeneeded", () => {
|
5227
5227
|
const r = n.result;
|
5228
5228
|
try {
|
5229
|
-
r.createObjectStore(
|
5229
|
+
r.createObjectStore(Me, { keyPath: kn });
|
5230
5230
|
} catch (i) {
|
5231
5231
|
t(i);
|
5232
5232
|
}
|
5233
5233
|
}), n.addEventListener("success", async () => {
|
5234
5234
|
const r = n.result;
|
5235
|
-
r.objectStoreNames.contains(
|
5235
|
+
r.objectStoreNames.contains(Me) ? e(r) : (r.close(), await Ss(), e(await it()));
|
5236
5236
|
});
|
5237
5237
|
});
|
5238
5238
|
}
|
5239
|
-
async function
|
5240
|
-
const r =
|
5241
|
-
[
|
5239
|
+
async function Dt(n, e, t) {
|
5240
|
+
const r = He(n, !0).put({
|
5241
|
+
[kn]: e,
|
5242
5242
|
value: t
|
5243
5243
|
});
|
5244
5244
|
return new Ee(r).toPromise();
|
5245
5245
|
}
|
5246
|
-
async function
|
5247
|
-
const t =
|
5246
|
+
async function Cs(n, e) {
|
5247
|
+
const t = He(n, !1).get(e), r = await new Ee(t).toPromise();
|
5248
5248
|
return r === void 0 ? null : r.value;
|
5249
5249
|
}
|
5250
|
-
function
|
5251
|
-
const t =
|
5250
|
+
function Lt(n, e) {
|
5251
|
+
const t = He(n, !0).delete(e);
|
5252
5252
|
return new Ee(t).toPromise();
|
5253
5253
|
}
|
5254
|
-
const
|
5255
|
-
class
|
5254
|
+
const Rs = 800, Ps = 3;
|
5255
|
+
class Nn {
|
5256
5256
|
constructor() {
|
5257
5257
|
this.type = "LOCAL", this._shouldAllowMigration = !0, this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.pendingWrites = 0, this.receiver = null, this.sender = null, this.serviceWorkerReceiverAvailable = !1, this.activeServiceWorker = null, this._workerInitializationPromise = this.initializeServiceWorkerMessaging().then(() => {
|
5258
5258
|
}, () => {
|
5259
5259
|
});
|
5260
5260
|
}
|
5261
5261
|
async _openDb() {
|
5262
|
-
return this.db ? this.db : (this.db = await
|
5262
|
+
return this.db ? this.db : (this.db = await it(), this.db);
|
5263
5263
|
}
|
5264
5264
|
async _withRetries(e) {
|
5265
5265
|
let t = 0;
|
@@ -5268,7 +5268,7 @@ class Ln {
|
|
5268
5268
|
const r = await this._openDb();
|
5269
5269
|
return await e(r);
|
5270
5270
|
} catch (r) {
|
5271
|
-
if (t++ >
|
5271
|
+
if (t++ > Ps)
|
5272
5272
|
throw r;
|
5273
5273
|
this.db && (this.db.close(), this.db = void 0);
|
5274
5274
|
}
|
@@ -5278,13 +5278,13 @@ class Ln {
|
|
5278
5278
|
* postMessage interface to send these events to the worker ourselves.
|
5279
5279
|
*/
|
5280
5280
|
async initializeServiceWorkerMessaging() {
|
5281
|
-
return
|
5281
|
+
return Pn() ? this.initializeReceiver() : this.initializeSender();
|
5282
5282
|
}
|
5283
5283
|
/**
|
5284
5284
|
* As the worker we should listen to events from the main window.
|
5285
5285
|
*/
|
5286
5286
|
async initializeReceiver() {
|
5287
|
-
this.receiver =
|
5287
|
+
this.receiver = Fe._getInstance(Ts()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
5288
5288
|
keyProcessed: (await this._poll()).includes(t.key)
|
5289
5289
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
5290
5290
|
"keyChanged"
|
@@ -5300,9 +5300,9 @@ class Ln {
|
|
5300
5300
|
*/
|
5301
5301
|
async initializeSender() {
|
5302
5302
|
var e, t;
|
5303
|
-
if (this.activeServiceWorker = await
|
5303
|
+
if (this.activeServiceWorker = await ws(), !this.activeServiceWorker)
|
5304
5304
|
return;
|
5305
|
-
this.sender = new
|
5305
|
+
this.sender = new bs(this.activeServiceWorker);
|
5306
5306
|
const r = await this.sender._send(
|
5307
5307
|
"ping",
|
5308
5308
|
{},
|
@@ -5324,7 +5324,7 @@ class Ln {
|
|
5324
5324
|
* @param key - Storage key which changed.
|
5325
5325
|
*/
|
5326
5326
|
async notifyServiceWorker(e) {
|
5327
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
5327
|
+
if (!(!this.sender || !this.activeServiceWorker || Es() !== this.activeServiceWorker))
|
5328
5328
|
try {
|
5329
5329
|
await this.sender._send(
|
5330
5330
|
"keyChanged",
|
@@ -5340,8 +5340,8 @@ class Ln {
|
|
5340
5340
|
try {
|
5341
5341
|
if (!indexedDB)
|
5342
5342
|
return !1;
|
5343
|
-
const e = await
|
5344
|
-
return await
|
5343
|
+
const e = await it();
|
5344
|
+
return await Dt(e, $e, "1"), await Lt(e, $e), !0;
|
5345
5345
|
} catch {
|
5346
5346
|
}
|
5347
5347
|
return !1;
|
@@ -5355,18 +5355,18 @@ class Ln {
|
|
5355
5355
|
}
|
5356
5356
|
}
|
5357
5357
|
async _set(e, t) {
|
5358
|
-
return this._withPendingWrite(async () => (await this._withRetries((r) =>
|
5358
|
+
return this._withPendingWrite(async () => (await this._withRetries((r) => Dt(r, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
5359
5359
|
}
|
5360
5360
|
async _get(e) {
|
5361
|
-
const t = await this._withRetries((r) =>
|
5361
|
+
const t = await this._withRetries((r) => Cs(r, e));
|
5362
5362
|
return this.localCache[e] = t, t;
|
5363
5363
|
}
|
5364
5364
|
async _remove(e) {
|
5365
|
-
return this._withPendingWrite(async () => (await this._withRetries((t) =>
|
5365
|
+
return this._withPendingWrite(async () => (await this._withRetries((t) => Lt(t, e)), delete this.localCache[e], this.notifyServiceWorker(e)));
|
5366
5366
|
}
|
5367
5367
|
async _poll() {
|
5368
5368
|
const e = await this._withRetries((i) => {
|
5369
|
-
const s =
|
5369
|
+
const s = He(i, !1).getAll();
|
5370
5370
|
return new Ee(s).toPromise();
|
5371
5371
|
});
|
5372
5372
|
if (!e)
|
@@ -5388,7 +5388,7 @@ class Ln {
|
|
5388
5388
|
i(t);
|
5389
5389
|
}
|
5390
5390
|
startPolling() {
|
5391
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
5391
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), Rs);
|
5392
5392
|
}
|
5393
5393
|
stopPolling() {
|
5394
5394
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
@@ -5400,8 +5400,8 @@ class Ln {
|
|
5400
5400
|
this.listeners[e] && (this.listeners[e].delete(t), this.listeners[e].size === 0 && delete this.listeners[e]), Object.keys(this.listeners).length === 0 && this.stopPolling();
|
5401
5401
|
}
|
5402
5402
|
}
|
5403
|
-
|
5404
|
-
const
|
5403
|
+
Nn.type = "LOCAL";
|
5404
|
+
const Os = Nn;
|
5405
5405
|
new Ie(3e4, 6e4);
|
5406
5406
|
/**
|
5407
5407
|
* @license
|
@@ -5419,7 +5419,7 @@ new Ie(3e4, 6e4);
|
|
5419
5419
|
* See the License for the specific language governing permissions and
|
5420
5420
|
* limitations under the License.
|
5421
5421
|
*/
|
5422
|
-
function
|
5422
|
+
function ks(n, e) {
|
5423
5423
|
return e ? U(e) : (_(
|
5424
5424
|
n._popupRedirectResolver,
|
5425
5425
|
n,
|
@@ -5443,7 +5443,7 @@ function Ls(n, e) {
|
|
5443
5443
|
* See the License for the specific language governing permissions and
|
5444
5444
|
* limitations under the License.
|
5445
5445
|
*/
|
5446
|
-
class
|
5446
|
+
class gt extends ht {
|
5447
5447
|
constructor(e) {
|
5448
5448
|
super(
|
5449
5449
|
"custom",
|
@@ -5473,26 +5473,26 @@ class yt extends pt {
|
|
5473
5473
|
return e && (t.idToken = e), t;
|
5474
5474
|
}
|
5475
5475
|
}
|
5476
|
-
function
|
5477
|
-
return
|
5476
|
+
function Ns(n) {
|
5477
|
+
return Tn(n.auth, new gt(n), n.bypassAuthState);
|
5478
5478
|
}
|
5479
|
-
function
|
5479
|
+
function Ds(n) {
|
5480
5480
|
const { auth: e, user: t } = n;
|
5481
5481
|
return _(
|
5482
5482
|
t,
|
5483
5483
|
e,
|
5484
5484
|
"internal-error"
|
5485
5485
|
/* AuthErrorCode.INTERNAL_ERROR */
|
5486
|
-
),
|
5486
|
+
), os(t, new gt(n), n.bypassAuthState);
|
5487
5487
|
}
|
5488
|
-
async function
|
5488
|
+
async function Ls(n) {
|
5489
5489
|
const { auth: e, user: t } = n;
|
5490
5490
|
return _(
|
5491
5491
|
t,
|
5492
5492
|
e,
|
5493
5493
|
"internal-error"
|
5494
5494
|
/* AuthErrorCode.INTERNAL_ERROR */
|
5495
|
-
),
|
5495
|
+
), ss(t, new gt(n), n.bypassAuthState);
|
5496
5496
|
}
|
5497
5497
|
/**
|
5498
5498
|
* @license
|
@@ -5510,7 +5510,7 @@ async function Us(n) {
|
|
5510
5510
|
* See the License for the specific language governing permissions and
|
5511
5511
|
* limitations under the License.
|
5512
5512
|
*/
|
5513
|
-
class
|
5513
|
+
class Dn {
|
5514
5514
|
constructor(e, t, r, i, s = !1) {
|
5515
5515
|
this.auth = e, this.resolver = r, this.user = i, this.bypassAuthState = s, this.pendingPromise = null, this.eventManager = null, this.filter = Array.isArray(t) ? t : [t];
|
5516
5516
|
}
|
@@ -5552,15 +5552,15 @@ class Mn {
|
|
5552
5552
|
switch (e) {
|
5553
5553
|
case "signInViaPopup":
|
5554
5554
|
case "signInViaRedirect":
|
5555
|
-
return
|
5555
|
+
return Ns;
|
5556
5556
|
case "linkViaPopup":
|
5557
5557
|
case "linkViaRedirect":
|
5558
|
-
return
|
5558
|
+
return Ls;
|
5559
5559
|
case "reauthViaPopup":
|
5560
5560
|
case "reauthViaRedirect":
|
5561
|
-
return
|
5561
|
+
return Ds;
|
5562
5562
|
default:
|
5563
|
-
|
5563
|
+
N(
|
5564
5564
|
this.auth,
|
5565
5565
|
"internal-error"
|
5566
5566
|
/* AuthErrorCode.INTERNAL_ERROR */
|
@@ -5593,8 +5593,8 @@ class Mn {
|
|
5593
5593
|
* See the License for the specific language governing permissions and
|
5594
5594
|
* limitations under the License.
|
5595
5595
|
*/
|
5596
|
-
const
|
5597
|
-
class re extends
|
5596
|
+
const $s = new Ie(2e3, 1e4);
|
5597
|
+
class re extends Dn {
|
5598
5598
|
constructor(e, t, r, i, s) {
|
5599
5599
|
super(e, t, i, s), this.provider = r, this.authWindow = null, this.pollId = null, re.currentPopupAction && re.currentPopupAction.cancel(), re.currentPopupAction = this;
|
5600
5600
|
}
|
@@ -5609,7 +5609,7 @@ class re extends Mn {
|
|
5609
5609
|
}
|
5610
5610
|
async onExecution() {
|
5611
5611
|
j(this.filter.length === 1, "Popup operations only handle one event");
|
5612
|
-
const e =
|
5612
|
+
const e = pt();
|
5613
5613
|
this.authWindow = await this.resolver._openPopup(
|
5614
5614
|
this.auth,
|
5615
5615
|
this.provider,
|
@@ -5657,7 +5657,7 @@ class re extends Mn {
|
|
5657
5657
|
);
|
5658
5658
|
return;
|
5659
5659
|
}
|
5660
|
-
this.pollId = window.setTimeout(e,
|
5660
|
+
this.pollId = window.setTimeout(e, $s.get());
|
5661
5661
|
};
|
5662
5662
|
e();
|
5663
5663
|
}
|
@@ -5679,8 +5679,8 @@ re.currentPopupAction = null;
|
|
5679
5679
|
* See the License for the specific language governing permissions and
|
5680
5680
|
* limitations under the License.
|
5681
5681
|
*/
|
5682
|
-
const
|
5683
|
-
class
|
5682
|
+
const Ms = "pendingRedirect", Ce = /* @__PURE__ */ new Map();
|
5683
|
+
class Us extends Dn {
|
5684
5684
|
constructor(e, t, r = !1) {
|
5685
5685
|
super(e, [
|
5686
5686
|
"signInViaRedirect",
|
@@ -5695,17 +5695,17 @@ class Bs extends Mn {
|
|
5695
5695
|
* just return it.
|
5696
5696
|
*/
|
5697
5697
|
async execute() {
|
5698
|
-
let e =
|
5698
|
+
let e = Ce.get(this.auth._key());
|
5699
5699
|
if (!e) {
|
5700
5700
|
try {
|
5701
|
-
const r = await
|
5701
|
+
const r = await js(this.resolver, this.auth) ? await super.execute() : null;
|
5702
5702
|
e = () => Promise.resolve(r);
|
5703
5703
|
} catch (t) {
|
5704
5704
|
e = () => Promise.reject(t);
|
5705
5705
|
}
|
5706
|
-
|
5706
|
+
Ce.set(this.auth._key(), e);
|
5707
5707
|
}
|
5708
|
-
return this.bypassAuthState ||
|
5708
|
+
return this.bypassAuthState || Ce.set(this.auth._key(), () => Promise.resolve(null)), e();
|
5709
5709
|
}
|
5710
5710
|
async onAuthEvent(e) {
|
5711
5711
|
if (e.type === "signInViaRedirect")
|
@@ -5726,24 +5726,24 @@ class Bs extends Mn {
|
|
5726
5726
|
cleanUp() {
|
5727
5727
|
}
|
5728
5728
|
}
|
5729
|
-
async function
|
5730
|
-
const t =
|
5729
|
+
async function js(n, e) {
|
5730
|
+
const t = Hs(e), r = Fs(n);
|
5731
5731
|
if (!await r._isAvailable())
|
5732
5732
|
return !1;
|
5733
5733
|
const i = await r._get(t) === "true";
|
5734
5734
|
return await r._remove(t), i;
|
5735
5735
|
}
|
5736
|
-
function
|
5737
|
-
|
5736
|
+
function Bs(n, e) {
|
5737
|
+
Ce.set(n._key(), e);
|
5738
5738
|
}
|
5739
|
-
function
|
5739
|
+
function Fs(n) {
|
5740
5740
|
return U(n._redirectPersistence);
|
5741
5741
|
}
|
5742
|
-
function
|
5743
|
-
return
|
5742
|
+
function Hs(n) {
|
5743
|
+
return Se(Ms, n.config.apiKey, n.name);
|
5744
5744
|
}
|
5745
|
-
async function
|
5746
|
-
const r = ne(n), i =
|
5745
|
+
async function Vs(n, e, t = !1) {
|
5746
|
+
const r = ne(n), i = ks(r, e), o = await new Us(r, i, t).execute();
|
5747
5747
|
return o && !t && (delete o.user._redirectEventId, await r._persistUserIfCurrent(o.user), await r._setRedirectUser(null, e)), o;
|
5748
5748
|
}
|
5749
5749
|
/**
|
@@ -5762,8 +5762,8 @@ async function zs(n, e, t = !1) {
|
|
5762
5762
|
* See the License for the specific language governing permissions and
|
5763
5763
|
* limitations under the License.
|
5764
5764
|
*/
|
5765
|
-
const
|
5766
|
-
class
|
5765
|
+
const Ws = 10 * 60 * 1e3;
|
5766
|
+
class xs {
|
5767
5767
|
constructor(e) {
|
5768
5768
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
5769
5769
|
}
|
@@ -5779,11 +5779,11 @@ class Gs {
|
|
5779
5779
|
let t = !1;
|
5780
5780
|
return this.consumers.forEach((r) => {
|
5781
5781
|
this.isEventForConsumer(e, r) && (t = !0, this.sendToConsumer(e, r), this.saveEventToCache(e));
|
5782
|
-
}), this.hasHandledPotentialRedirect || !
|
5782
|
+
}), this.hasHandledPotentialRedirect || !qs(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
5783
5783
|
}
|
5784
5784
|
sendToConsumer(e, t) {
|
5785
5785
|
var r;
|
5786
|
-
if (e.error &&
|
5786
|
+
if (e.error && !Ln(e)) {
|
5787
5787
|
const i = ((r = e.error.code) === null || r === void 0 ? void 0 : r.split("auth/")[1]) || "internal-error";
|
5788
5788
|
t.onError(L(this.auth, i));
|
5789
5789
|
} else
|
@@ -5794,7 +5794,7 @@ class Gs {
|
|
5794
5794
|
return t.filter.includes(e.type) && r;
|
5795
5795
|
}
|
5796
5796
|
hasEventBeenHandled(e) {
|
5797
|
-
return Date.now() - this.lastProcessedEventTime >=
|
5797
|
+
return Date.now() - this.lastProcessedEventTime >= Ws && this.cachedEventUids.clear(), this.cachedEventUids.has($t(e));
|
5798
5798
|
}
|
5799
5799
|
saveEventToCache(e) {
|
5800
5800
|
this.cachedEventUids.add($t(e)), this.lastProcessedEventTime = Date.now();
|
@@ -5803,17 +5803,17 @@ class Gs {
|
|
5803
5803
|
function $t(n) {
|
5804
5804
|
return [n.type, n.eventId, n.sessionId, n.tenantId].filter((e) => e).join("-");
|
5805
5805
|
}
|
5806
|
-
function
|
5806
|
+
function Ln({ type: n, error: e }) {
|
5807
5807
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
5808
5808
|
}
|
5809
|
-
function
|
5809
|
+
function qs(n) {
|
5810
5810
|
switch (n.type) {
|
5811
5811
|
case "signInViaRedirect":
|
5812
5812
|
case "linkViaRedirect":
|
5813
5813
|
case "reauthViaRedirect":
|
5814
5814
|
return !0;
|
5815
5815
|
case "unknown":
|
5816
|
-
return
|
5816
|
+
return Ln(n);
|
5817
5817
|
default:
|
5818
5818
|
return !1;
|
5819
5819
|
}
|
@@ -5834,8 +5834,8 @@ function Ks(n) {
|
|
5834
5834
|
* See the License for the specific language governing permissions and
|
5835
5835
|
* limitations under the License.
|
5836
5836
|
*/
|
5837
|
-
async function
|
5838
|
-
return
|
5837
|
+
async function zs(n, e = {}) {
|
5838
|
+
return K(n, "GET", "/v1/projects", e);
|
5839
5839
|
}
|
5840
5840
|
/**
|
5841
5841
|
* @license
|
@@ -5853,32 +5853,32 @@ async function Js(n, e = {}) {
|
|
5853
5853
|
* See the License for the specific language governing permissions and
|
5854
5854
|
* limitations under the License.
|
5855
5855
|
*/
|
5856
|
-
const
|
5857
|
-
async function
|
5856
|
+
const Js = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Gs = /^https?/;
|
5857
|
+
async function Ks(n) {
|
5858
5858
|
if (n.config.emulator)
|
5859
5859
|
return;
|
5860
|
-
const { authorizedDomains: e } = await
|
5860
|
+
const { authorizedDomains: e } = await zs(n);
|
5861
5861
|
for (const t of e)
|
5862
5862
|
try {
|
5863
|
-
if (
|
5863
|
+
if (Ys(t))
|
5864
5864
|
return;
|
5865
5865
|
} catch {
|
5866
5866
|
}
|
5867
|
-
|
5867
|
+
N(
|
5868
5868
|
n,
|
5869
5869
|
"unauthorized-domain"
|
5870
5870
|
/* AuthErrorCode.INVALID_ORIGIN */
|
5871
5871
|
);
|
5872
5872
|
}
|
5873
|
-
function
|
5874
|
-
const e =
|
5873
|
+
function Ys(n) {
|
5874
|
+
const e = rt(), { protocol: t, hostname: r } = new URL(e);
|
5875
5875
|
if (n.startsWith("chrome-extension://")) {
|
5876
5876
|
const o = new URL(n);
|
5877
5877
|
return o.hostname === "" && r === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === r;
|
5878
5878
|
}
|
5879
|
-
if (!
|
5879
|
+
if (!Gs.test(t))
|
5880
5880
|
return !1;
|
5881
|
-
if (
|
5881
|
+
if (Js.test(n))
|
5882
5882
|
return r === n;
|
5883
5883
|
const i = n.replace(/\./g, "\\.");
|
5884
5884
|
return new RegExp("^(.+\\." + i + "|" + i + ")$", "i").test(r);
|
@@ -5899,9 +5899,9 @@ function Zs(n) {
|
|
5899
5899
|
* See the License for the specific language governing permissions and
|
5900
5900
|
* limitations under the License.
|
5901
5901
|
*/
|
5902
|
-
const
|
5903
|
-
function
|
5904
|
-
const n =
|
5902
|
+
const Qs = new Ie(3e4, 6e4);
|
5903
|
+
function Mt() {
|
5904
|
+
const n = $().___jsl;
|
5905
5905
|
if (n != null && n.H) {
|
5906
5906
|
for (const e of Object.keys(n.H))
|
5907
5907
|
if (n.H[e].r = n.H[e].r || [], n.H[e].L = n.H[e].L || [], n.H[e].r = [...n.H[e].L], n.CP)
|
@@ -5909,45 +5909,45 @@ function Ut() {
|
|
5909
5909
|
n.CP[t] = null;
|
5910
5910
|
}
|
5911
5911
|
}
|
5912
|
-
function
|
5912
|
+
function Xs(n) {
|
5913
5913
|
return new Promise((e, t) => {
|
5914
5914
|
var r, i, s;
|
5915
5915
|
function o() {
|
5916
|
-
|
5916
|
+
Mt(), gapi.load("gapi.iframes", {
|
5917
5917
|
callback: () => {
|
5918
5918
|
e(gapi.iframes.getContext());
|
5919
5919
|
},
|
5920
5920
|
ontimeout: () => {
|
5921
|
-
|
5921
|
+
Mt(), t(L(
|
5922
5922
|
n,
|
5923
5923
|
"network-request-failed"
|
5924
5924
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
5925
5925
|
));
|
5926
5926
|
},
|
5927
|
-
timeout:
|
5927
|
+
timeout: Qs.get()
|
5928
5928
|
});
|
5929
5929
|
}
|
5930
|
-
if (!((i = (r =
|
5930
|
+
if (!((i = (r = $().gapi) === null || r === void 0 ? void 0 : r.iframes) === null || i === void 0) && i.Iframe)
|
5931
5931
|
e(gapi.iframes.getContext());
|
5932
|
-
else if (!((s =
|
5932
|
+
else if (!((s = $().gapi) === null || s === void 0) && s.load)
|
5933
5933
|
o();
|
5934
5934
|
else {
|
5935
|
-
const c =
|
5936
|
-
return
|
5935
|
+
const c = Vi("iframefcb");
|
5936
|
+
return $()[c] = () => {
|
5937
5937
|
gapi.load ? o() : t(L(
|
5938
5938
|
n,
|
5939
5939
|
"network-request-failed"
|
5940
5940
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
5941
5941
|
));
|
5942
|
-
},
|
5942
|
+
}, bn(`https://apis.google.com/js/api.js?onload=${c}`).catch((a) => t(a));
|
5943
5943
|
}
|
5944
5944
|
}).catch((e) => {
|
5945
|
-
throw
|
5945
|
+
throw Re = null, e;
|
5946
5946
|
});
|
5947
5947
|
}
|
5948
|
-
let
|
5949
|
-
function
|
5950
|
-
return
|
5948
|
+
let Re = null;
|
5949
|
+
function Zs(n) {
|
5950
|
+
return Re = Re || Xs(n), Re;
|
5951
5951
|
}
|
5952
5952
|
/**
|
5953
5953
|
* @license
|
@@ -5965,7 +5965,7 @@ function no(n) {
|
|
5965
5965
|
* See the License for the specific language governing permissions and
|
5966
5966
|
* limitations under the License.
|
5967
5967
|
*/
|
5968
|
-
const
|
5968
|
+
const eo = new Ie(5e3, 15e3), to = "__/auth/iframe", no = "emulator/auth/iframe", ro = {
|
5969
5969
|
style: {
|
5970
5970
|
position: "absolute",
|
5971
5971
|
top: "-100px",
|
@@ -5974,13 +5974,13 @@ const ro = new Ie(5e3, 15e3), io = "__/auth/iframe", so = "emulator/auth/iframe"
|
|
5974
5974
|
},
|
5975
5975
|
"aria-hidden": "true",
|
5976
5976
|
tabindex: "-1"
|
5977
|
-
},
|
5977
|
+
}, io = /* @__PURE__ */ new Map([
|
5978
5978
|
["identitytoolkit.googleapis.com", "p"],
|
5979
5979
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
5980
5980
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
5981
5981
|
// test
|
5982
5982
|
]);
|
5983
|
-
function
|
5983
|
+
function so(n) {
|
5984
5984
|
const e = n.config;
|
5985
5985
|
_(
|
5986
5986
|
e.authDomain,
|
@@ -5988,17 +5988,17 @@ function co(n) {
|
|
5988
5988
|
"auth-domain-config-required"
|
5989
5989
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
5990
5990
|
);
|
5991
|
-
const t = e.emulator ?
|
5991
|
+
const t = e.emulator ? lt(e, no) : `https://${n.config.authDomain}/${to}`, r = {
|
5992
5992
|
apiKey: e.apiKey,
|
5993
5993
|
appName: n.name,
|
5994
5994
|
v: be
|
5995
|
-
}, i =
|
5995
|
+
}, i = io.get(n.config.apiHost);
|
5996
5996
|
i && (r.eid = i);
|
5997
5997
|
const s = n._getFrameworks();
|
5998
5998
|
return s.length && (r.fw = s.join(",")), `${t}?${ve(r).slice(1)}`;
|
5999
5999
|
}
|
6000
|
-
async function
|
6001
|
-
const e = await
|
6000
|
+
async function oo(n) {
|
6001
|
+
const e = await Zs(n), t = $().gapi;
|
6002
6002
|
return _(
|
6003
6003
|
t,
|
6004
6004
|
n,
|
@@ -6006,9 +6006,9 @@ async function lo(n) {
|
|
6006
6006
|
/* AuthErrorCode.INTERNAL_ERROR */
|
6007
6007
|
), e.open({
|
6008
6008
|
where: document.body,
|
6009
|
-
url:
|
6009
|
+
url: so(n),
|
6010
6010
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
6011
|
-
attributes:
|
6011
|
+
attributes: ro,
|
6012
6012
|
dontclear: !0
|
6013
6013
|
}, (r) => new Promise(async (i, s) => {
|
6014
6014
|
await r.restyle({
|
@@ -6019,11 +6019,11 @@ async function lo(n) {
|
|
6019
6019
|
n,
|
6020
6020
|
"network-request-failed"
|
6021
6021
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
6022
|
-
), c =
|
6022
|
+
), c = $().setTimeout(() => {
|
6023
6023
|
s(o);
|
6024
|
-
},
|
6024
|
+
}, eo.get());
|
6025
6025
|
function a() {
|
6026
|
-
|
6026
|
+
$().clearTimeout(c), i(r);
|
6027
6027
|
}
|
6028
6028
|
r.ping(a).then(a, () => {
|
6029
6029
|
s(o);
|
@@ -6046,13 +6046,13 @@ async function lo(n) {
|
|
6046
6046
|
* See the License for the specific language governing permissions and
|
6047
6047
|
* limitations under the License.
|
6048
6048
|
*/
|
6049
|
-
const
|
6049
|
+
const ao = {
|
6050
6050
|
location: "yes",
|
6051
6051
|
resizable: "yes",
|
6052
6052
|
statusbar: "yes",
|
6053
6053
|
toolbar: "no"
|
6054
|
-
},
|
6055
|
-
class
|
6054
|
+
}, co = 500, lo = 600, uo = "_blank", ho = "http://localhost";
|
6055
|
+
class Ut {
|
6056
6056
|
constructor(e) {
|
6057
6057
|
this.window = e, this.associatedEvent = null;
|
6058
6058
|
}
|
@@ -6064,19 +6064,19 @@ class jt {
|
|
6064
6064
|
}
|
6065
6065
|
}
|
6066
6066
|
}
|
6067
|
-
function
|
6067
|
+
function fo(n, e, t, r = co, i = lo) {
|
6068
6068
|
const s = Math.max((window.screen.availHeight - i) / 2, 0).toString(), o = Math.max((window.screen.availWidth - r) / 2, 0).toString();
|
6069
6069
|
let c = "";
|
6070
|
-
const a = Object.assign(Object.assign({},
|
6070
|
+
const a = Object.assign(Object.assign({}, ao), {
|
6071
6071
|
width: r.toString(),
|
6072
6072
|
height: i.toString(),
|
6073
6073
|
top: s,
|
6074
6074
|
left: o
|
6075
6075
|
}), u = R().toLowerCase();
|
6076
|
-
t && (c =
|
6076
|
+
t && (c = fn(u) ? uo : t), hn(u) && (e = e || ho, a.scrollbars = "yes");
|
6077
6077
|
const y = Object.entries(a).reduce((A, [P, k]) => `${A}${P}=${k},`, "");
|
6078
|
-
if (
|
6079
|
-
return
|
6078
|
+
if (Di(u) && c !== "_self")
|
6079
|
+
return po(e || "", c), new Ut(null);
|
6080
6080
|
const b = window.open(e || "", c, y);
|
6081
6081
|
_(
|
6082
6082
|
b,
|
@@ -6088,9 +6088,9 @@ function mo(n, e, t, r = ho, i = fo) {
|
|
6088
6088
|
b.focus();
|
6089
6089
|
} catch {
|
6090
6090
|
}
|
6091
|
-
return new
|
6091
|
+
return new Ut(b);
|
6092
6092
|
}
|
6093
|
-
function
|
6093
|
+
function po(n, e) {
|
6094
6094
|
const t = document.createElement("a");
|
6095
6095
|
t.href = n, t.target = e;
|
6096
6096
|
const r = document.createEvent("MouseEvent");
|
@@ -6112,8 +6112,8 @@ function yo(n, e) {
|
|
6112
6112
|
* See the License for the specific language governing permissions and
|
6113
6113
|
* limitations under the License.
|
6114
6114
|
*/
|
6115
|
-
const
|
6116
|
-
async function
|
6115
|
+
const go = "__/auth/handler", mo = "emulator/auth/handler", yo = encodeURIComponent("fac");
|
6116
|
+
async function jt(n, e, t, r, i, s) {
|
6117
6117
|
_(
|
6118
6118
|
n.config.authDomain,
|
6119
6119
|
n,
|
@@ -6133,8 +6133,8 @@ async function Ft(n, e, t, r, i, s) {
|
|
6133
6133
|
v: be,
|
6134
6134
|
eventId: i
|
6135
6135
|
};
|
6136
|
-
if (e instanceof
|
6137
|
-
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "",
|
6136
|
+
if (e instanceof wn) {
|
6137
|
+
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", er(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
6138
6138
|
for (const [y, b] of Object.entries(s || {}))
|
6139
6139
|
o[y] = b;
|
6140
6140
|
}
|
@@ -6146,11 +6146,11 @@ async function Ft(n, e, t, r, i, s) {
|
|
6146
6146
|
const c = o;
|
6147
6147
|
for (const y of Object.keys(c))
|
6148
6148
|
c[y] === void 0 && delete c[y];
|
6149
|
-
const a = await n._getAppCheckToken(), u = a ? `#${
|
6150
|
-
return `${
|
6149
|
+
const a = await n._getAppCheckToken(), u = a ? `#${yo}=${encodeURIComponent(a)}` : "";
|
6150
|
+
return `${_o(n)}?${ve(c).slice(1)}${u}`;
|
6151
6151
|
}
|
6152
|
-
function
|
6153
|
-
return n.emulator ?
|
6152
|
+
function _o({ config: n }) {
|
6153
|
+
return n.emulator ? lt(n, mo) : `https://${n.authDomain}/${go}`;
|
6154
6154
|
}
|
6155
6155
|
/**
|
6156
6156
|
* @license
|
@@ -6168,23 +6168,23 @@ function Io({ config: n }) {
|
|
6168
6168
|
* See the License for the specific language governing permissions and
|
6169
6169
|
* limitations under the License.
|
6170
6170
|
*/
|
6171
|
-
const
|
6172
|
-
class
|
6171
|
+
const Qe = "webStorageSupport";
|
6172
|
+
class vo {
|
6173
6173
|
constructor() {
|
6174
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence =
|
6174
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Rn, this._completeRedirectFn = Vs, this._overrideRedirectResult = Bs;
|
6175
6175
|
}
|
6176
6176
|
// Wrapping in async even though we don't await anywhere in order
|
6177
6177
|
// to make sure errors are raised as promise rejections
|
6178
6178
|
async _openPopup(e, t, r, i) {
|
6179
6179
|
var s;
|
6180
6180
|
j((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
6181
|
-
const o = await
|
6182
|
-
return
|
6181
|
+
const o = await jt(e, t, r, rt(), i);
|
6182
|
+
return fo(e, o, pt());
|
6183
6183
|
}
|
6184
6184
|
async _openRedirect(e, t, r, i) {
|
6185
6185
|
await this._originValidation(e);
|
6186
|
-
const s = await
|
6187
|
-
return
|
6186
|
+
const s = await jt(e, t, r, rt(), i);
|
6187
|
+
return Is(s), new Promise(() => {
|
6188
6188
|
});
|
6189
6189
|
}
|
6190
6190
|
_initialize(e) {
|
@@ -6199,7 +6199,7 @@ class wo {
|
|
6199
6199
|
}), r;
|
6200
6200
|
}
|
6201
6201
|
async initAndGetManager(e) {
|
6202
|
-
const t = await
|
6202
|
+
const t = await oo(e), r = new xs(e);
|
6203
6203
|
return t.register("authEvent", (i) => (_(
|
6204
6204
|
i == null ? void 0 : i.authEvent,
|
6205
6205
|
e,
|
@@ -6211,10 +6211,10 @@ class wo {
|
|
6211
6211
|
}), gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER), this.eventManagers[e._key()] = { manager: r }, this.iframes[e._key()] = t, r;
|
6212
6212
|
}
|
6213
6213
|
_isIframeWebStorageSupported(e, t) {
|
6214
|
-
this.iframes[e._key()].send(
|
6214
|
+
this.iframes[e._key()].send(Qe, { type: Qe }, (i) => {
|
6215
6215
|
var s;
|
6216
|
-
const o = (s = i == null ? void 0 : i[0]) === null || s === void 0 ? void 0 : s[
|
6217
|
-
o !== void 0 && t(!!o),
|
6216
|
+
const o = (s = i == null ? void 0 : i[0]) === null || s === void 0 ? void 0 : s[Qe];
|
6217
|
+
o !== void 0 && t(!!o), N(
|
6218
6218
|
e,
|
6219
6219
|
"internal-error"
|
6220
6220
|
/* AuthErrorCode.INTERNAL_ERROR */
|
@@ -6223,14 +6223,14 @@ class wo {
|
|
6223
6223
|
}
|
6224
6224
|
_originValidation(e) {
|
6225
6225
|
const t = e._key();
|
6226
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
6226
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Ks(e)), this.originValidationPromises[t];
|
6227
6227
|
}
|
6228
6228
|
get _shouldInitProactively() {
|
6229
|
-
return
|
6229
|
+
return _n() || ut() || Be();
|
6230
6230
|
}
|
6231
6231
|
}
|
6232
|
-
const
|
6233
|
-
var Bt = "@firebase/auth",
|
6232
|
+
const bo = vo;
|
6233
|
+
var Bt = "@firebase/auth", Ft = "1.3.0";
|
6234
6234
|
/**
|
6235
6235
|
* @license
|
6236
6236
|
* Copyright 2020 Google LLC
|
@@ -6247,7 +6247,7 @@ var Bt = "@firebase/auth", Vt = "1.3.0";
|
|
6247
6247
|
* See the License for the specific language governing permissions and
|
6248
6248
|
* limitations under the License.
|
6249
6249
|
*/
|
6250
|
-
class
|
6250
|
+
class Io {
|
6251
6251
|
constructor(e) {
|
6252
6252
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
6253
6253
|
}
|
@@ -6298,7 +6298,7 @@ class To {
|
|
6298
6298
|
* See the License for the specific language governing permissions and
|
6299
6299
|
* limitations under the License.
|
6300
6300
|
*/
|
6301
|
-
function
|
6301
|
+
function wo(n) {
|
6302
6302
|
switch (n) {
|
6303
6303
|
case "Node":
|
6304
6304
|
return "node";
|
@@ -6312,7 +6312,7 @@ function Ao(n) {
|
|
6312
6312
|
return;
|
6313
6313
|
}
|
6314
6314
|
}
|
6315
|
-
function
|
6315
|
+
function Eo(n) {
|
6316
6316
|
fe(new ae(
|
6317
6317
|
"auth",
|
6318
6318
|
(e, { options: t }) => {
|
@@ -6325,9 +6325,9 @@ function So(n) {
|
|
6325
6325
|
apiHost: "identitytoolkit.googleapis.com",
|
6326
6326
|
tokenApiHost: "securetoken.googleapis.com",
|
6327
6327
|
apiScheme: "https",
|
6328
|
-
sdkClientVersion:
|
6329
|
-
}, u = new
|
6330
|
-
return
|
6328
|
+
sdkClientVersion: vn(n)
|
6329
|
+
}, u = new Fi(r, i, s, a);
|
6330
|
+
return Gi(u, t), u;
|
6331
6331
|
},
|
6332
6332
|
"PUBLIC"
|
6333
6333
|
/* ComponentType.PUBLIC */
|
@@ -6346,14 +6346,14 @@ function So(n) {
|
|
6346
6346
|
"auth"
|
6347
6347
|
/* _ComponentName.AUTH */
|
6348
6348
|
).getImmediate());
|
6349
|
-
return ((r) => new
|
6349
|
+
return ((r) => new Io(r))(t);
|
6350
6350
|
},
|
6351
6351
|
"PRIVATE"
|
6352
6352
|
/* ComponentType.PRIVATE */
|
6353
6353
|
).setInstantiationMode(
|
6354
6354
|
"EXPLICIT"
|
6355
6355
|
/* InstantiationMode.EXPLICIT */
|
6356
|
-
)), ie(Bt,
|
6356
|
+
)), ie(Bt, Ft, wo(n)), ie(Bt, Ft, "esm2017");
|
6357
6357
|
}
|
6358
6358
|
/**
|
6359
6359
|
* @license
|
@@ -6371,11 +6371,11 @@ function So(n) {
|
|
6371
6371
|
* See the License for the specific language governing permissions and
|
6372
6372
|
* limitations under the License.
|
6373
6373
|
*/
|
6374
|
-
const
|
6374
|
+
const To = 5 * 60, Ao = Yt("authIdTokenMaxAge") || To;
|
6375
6375
|
let Ht = null;
|
6376
|
-
const
|
6376
|
+
const So = (n) => async (e) => {
|
6377
6377
|
const t = e && await e.getIdTokenResult(), r = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
6378
|
-
if (r && r >
|
6378
|
+
if (r && r > Ao)
|
6379
6379
|
return;
|
6380
6380
|
const i = t == null ? void 0 : t.token;
|
6381
6381
|
Ht !== i && (Ht = i, await fetch(n, {
|
@@ -6385,34 +6385,34 @@ const Po = (n) => async (e) => {
|
|
6385
6385
|
} : {}
|
6386
6386
|
}));
|
6387
6387
|
};
|
6388
|
-
function
|
6389
|
-
const e =
|
6388
|
+
function Co(n = ei()) {
|
6389
|
+
const e = en(n, "auth");
|
6390
6390
|
if (e.isInitialized())
|
6391
6391
|
return e.getImmediate();
|
6392
|
-
const t =
|
6393
|
-
popupRedirectResolver:
|
6392
|
+
const t = Ji(n, {
|
6393
|
+
popupRedirectResolver: bo,
|
6394
6394
|
persistence: [
|
6395
|
-
|
6396
|
-
|
6397
|
-
|
6395
|
+
Os,
|
6396
|
+
_s,
|
6397
|
+
Rn
|
6398
6398
|
]
|
6399
|
-
}), r =
|
6399
|
+
}), r = Yt("authTokenSyncURL");
|
6400
6400
|
if (r) {
|
6401
|
-
const s =
|
6402
|
-
|
6401
|
+
const s = So(r);
|
6402
|
+
hs(t, s, () => s(t.currentUser)), us(t, (o) => s(o));
|
6403
6403
|
}
|
6404
|
-
const i =
|
6405
|
-
return i &&
|
6404
|
+
const i = Wn("auth");
|
6405
|
+
return i && Ki(t, `http://${i}`), t;
|
6406
6406
|
}
|
6407
|
-
|
6407
|
+
Eo(
|
6408
6408
|
"Browser"
|
6409
6409
|
/* ClientPlatform.BROWSER */
|
6410
6410
|
);
|
6411
|
-
var
|
6412
|
-
function
|
6411
|
+
var Ro = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
6412
|
+
function Po(n) {
|
6413
6413
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
6414
6414
|
}
|
6415
|
-
var
|
6415
|
+
var $n = { exports: {} };
|
6416
6416
|
(function(n) {
|
6417
6417
|
(function(e) {
|
6418
6418
|
function t(l, m) {
|
@@ -6480,7 +6480,7 @@ var Un = { exports: {} };
|
|
6480
6480
|
function I(l) {
|
6481
6481
|
return A(v(l));
|
6482
6482
|
}
|
6483
|
-
function
|
6483
|
+
function D(l) {
|
6484
6484
|
return k(I(l));
|
6485
6485
|
}
|
6486
6486
|
function C(l, m) {
|
@@ -6489,14 +6489,14 @@ var Un = { exports: {} };
|
|
6489
6489
|
function Y(l, m) {
|
6490
6490
|
return k(C(l, m));
|
6491
6491
|
}
|
6492
|
-
function
|
6493
|
-
return m ? d ? C(m, l) : Y(m, l) : d ? I(l) :
|
6492
|
+
function F(l, m, d) {
|
6493
|
+
return m ? d ? C(m, l) : Y(m, l) : d ? I(l) : D(l);
|
6494
6494
|
}
|
6495
|
-
n.exports ? n.exports =
|
6496
|
-
})(
|
6497
|
-
})(
|
6498
|
-
var
|
6499
|
-
const
|
6495
|
+
n.exports ? n.exports = F : e.md5 = F;
|
6496
|
+
})(Ro);
|
6497
|
+
})($n);
|
6498
|
+
var Oo = $n.exports;
|
6499
|
+
const ko = /* @__PURE__ */ Po(Oo), mt = (n, e) => async (t, r = {}) => {
|
6500
6500
|
const i = e ? await e.getIdToken() : null, s = await fetch(`${n}${t}`, {
|
6501
6501
|
mode: "cors",
|
6502
6502
|
...r,
|
@@ -6514,7 +6514,7 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
6514
6514
|
body: o
|
6515
6515
|
});
|
6516
6516
|
return o;
|
6517
|
-
},
|
6517
|
+
}, No = (n) => {
|
6518
6518
|
const e = n.properties || {}, t = n.inputProps || Object.keys(e), r = (i, s) => {
|
6519
6519
|
const o = e[i] || {};
|
6520
6520
|
if ([null, void 0].includes(s))
|
@@ -6551,13 +6551,13 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
6551
6551
|
),
|
6552
6552
|
validateAttr: r
|
6553
6553
|
};
|
6554
|
-
},
|
6554
|
+
}, Do = (n = {}) => Object.keys(n).length ? `?q=${JSON.stringify(n)}` : "", Lo = (n) => [...n].reduce(
|
6555
6555
|
(e, t) => t === t.toUpperCase() ? `${e}-${t.toLowerCase()}` : `${e}${t}`,
|
6556
6556
|
""
|
6557
|
-
),
|
6558
|
-
const e =
|
6559
|
-
return (t, r) => `/${e}${t ? `/${encodeURIComponent(t)}` : ""}${
|
6560
|
-
},
|
6557
|
+
), $o = (n) => `${n[0].toLowerCase()}${n.slice(1)}`, Mo = (n) => {
|
6558
|
+
const e = Lo(n);
|
6559
|
+
return (t, r) => `/${e}${t ? `/${encodeURIComponent(t)}` : ""}${Do(r)}`;
|
6560
|
+
}, Vt = (n, e) => {
|
6561
6561
|
const t = Array.isArray(e.inputProps);
|
6562
6562
|
return Object.keys(n).reduce(
|
6563
6563
|
(r, i) => {
|
@@ -6571,7 +6571,7 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
6571
6571
|
},
|
6572
6572
|
{}
|
6573
6573
|
);
|
6574
|
-
},
|
6574
|
+
}, Uo = ({ primaryKey: n, properties: e, ...t }) => ({
|
6575
6575
|
primaryKey: n || "id",
|
6576
6576
|
properties: Object.keys(e || {}).reduce(
|
6577
6577
|
(r, i) => {
|
@@ -6592,36 +6592,36 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
6592
6592
|
{}
|
6593
6593
|
),
|
6594
6594
|
...t
|
6595
|
-
}),
|
6596
|
-
const s =
|
6595
|
+
}), jo = (n, e, t, r = {}, i = {}) => {
|
6596
|
+
const s = Uo(r), { primaryKey: o, properties: c } = s, a = No(s), u = Mo(t), y = (...v) => mt(n, e.authUser)(...v), b = ({ data: v, ...I }) => y(u(null, I), {
|
6597
6597
|
method: "POST",
|
6598
|
-
body:
|
6598
|
+
body: Vt(v, s)
|
6599
6599
|
}), A = ({ data: v, ...I }) => {
|
6600
|
-
const { where:
|
6601
|
-
return y(u(
|
6600
|
+
const { where: D, ...C } = I;
|
6601
|
+
return y(u(D[o], C), {
|
6602
6602
|
method: "PUT",
|
6603
|
-
body:
|
6603
|
+
body: Vt(v, s)
|
6604
6604
|
});
|
6605
6605
|
}, P = (v) => {
|
6606
6606
|
if (!v)
|
6607
6607
|
return v;
|
6608
6608
|
const I = Object.keys(v).reduce(
|
6609
|
-
(
|
6609
|
+
(D, C) => {
|
6610
6610
|
var E;
|
6611
|
-
const Y = c[C] || {}, { type:
|
6611
|
+
const Y = c[C] || {}, { type: F, isScalar: l, isRef: m, format: d, items: w } = Y;
|
6612
6612
|
if (m) {
|
6613
|
-
const S =
|
6613
|
+
const S = $o(F);
|
6614
6614
|
return l ? {
|
6615
|
-
...
|
6615
|
+
...D,
|
6616
6616
|
[C]: i[S].parse(v[C])
|
6617
6617
|
} : {
|
6618
|
-
...
|
6618
|
+
...D,
|
6619
6619
|
[C]: typeof ((E = i[S]) == null ? void 0 : E.parse) == "function" ? v[C].map((O) => i[S].parse(O)) : v[C]
|
6620
6620
|
};
|
6621
6621
|
}
|
6622
6622
|
return {
|
6623
|
-
...
|
6624
|
-
[C]:
|
6623
|
+
...D,
|
6624
|
+
[C]: F === "date" && v[C] ? new Date(v[C]) : v[C]
|
6625
6625
|
};
|
6626
6626
|
},
|
6627
6627
|
{}
|
@@ -6666,11 +6666,11 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
6666
6666
|
delete: (v) => y(u(v), { method: "DELETE" }),
|
6667
6667
|
stats: () => y(u("_stats"))
|
6668
6668
|
};
|
6669
|
-
},
|
6669
|
+
}, Bo = (n, e, t) => Object.keys(t.properties).reduce(
|
6670
6670
|
(r, i) => {
|
6671
6671
|
const s = t.properties[i].$ref.split("/").pop();
|
6672
6672
|
return Object.assign(r, {
|
6673
|
-
[i]:
|
6673
|
+
[i]: jo(
|
6674
6674
|
n,
|
6675
6675
|
e,
|
6676
6676
|
t.definitions[s].plural || `${i}s`,
|
@@ -6680,7 +6680,7 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
6680
6680
|
});
|
6681
6681
|
},
|
6682
6682
|
{}
|
6683
|
-
),
|
6683
|
+
), Fo = (n, e) => Object.keys(n.definitions).reduce(
|
6684
6684
|
(t, r) => ({
|
6685
6685
|
...t,
|
6686
6686
|
[r]: e[r] ? {
|
@@ -6699,7 +6699,7 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
6699
6699
|
} : n.definitions[r]
|
6700
6700
|
}),
|
6701
6701
|
{}
|
6702
|
-
),
|
6702
|
+
), Ho = "http://json-schema.org/draft-07/schema#", Vo = {
|
6703
6703
|
Country: {
|
6704
6704
|
type: "object",
|
6705
6705
|
properties: {
|
@@ -7009,10 +7009,10 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
7009
7009
|
$ref: "#/definitions/ActivityLogEntry"
|
7010
7010
|
}
|
7011
7011
|
},
|
7012
|
-
|
7012
|
+
jobReviews: {
|
7013
7013
|
type: "array",
|
7014
7014
|
items: {
|
7015
|
-
$ref: "#/definitions/
|
7015
|
+
$ref: "#/definitions/JobReview"
|
7016
7016
|
}
|
7017
7017
|
},
|
7018
7018
|
jobApplications: {
|
@@ -7020,6 +7020,12 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
7020
7020
|
items: {
|
7021
7021
|
$ref: "#/definitions/JobApplication"
|
7022
7022
|
}
|
7023
|
+
},
|
7024
|
+
studentProjecTeamMembers: {
|
7025
|
+
type: "array",
|
7026
|
+
items: {
|
7027
|
+
$ref: "#/definitions/StudentProjecTeamMember"
|
7028
|
+
}
|
7023
7029
|
}
|
7024
7030
|
}
|
7025
7031
|
},
|
@@ -7045,6 +7051,18 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
7045
7051
|
items: {
|
7046
7052
|
$ref: "#/definitions/Program"
|
7047
7053
|
}
|
7054
|
+
},
|
7055
|
+
crawlerQueries: {
|
7056
|
+
type: "array",
|
7057
|
+
items: {
|
7058
|
+
$ref: "#/definitions/CrawlerQuery"
|
7059
|
+
}
|
7060
|
+
},
|
7061
|
+
jobProfileTypes: {
|
7062
|
+
type: "array",
|
7063
|
+
items: {
|
7064
|
+
$ref: "#/definitions/JobProfileType"
|
7065
|
+
}
|
7048
7066
|
}
|
7049
7067
|
}
|
7050
7068
|
},
|
@@ -7286,6 +7304,12 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
7286
7304
|
items: {
|
7287
7305
|
$ref: "#/definitions/JobApplication"
|
7288
7306
|
}
|
7307
|
+
},
|
7308
|
+
studentProjects: {
|
7309
|
+
type: "array",
|
7310
|
+
items: {
|
7311
|
+
$ref: "#/definitions/StudentProject"
|
7312
|
+
}
|
7289
7313
|
}
|
7290
7314
|
}
|
7291
7315
|
},
|
@@ -7842,7 +7866,9 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
7842
7866
|
"challenge",
|
7843
7867
|
"application_filter",
|
7844
7868
|
"application_filter_bypass",
|
7845
|
-
"application_cohort_change"
|
7869
|
+
"application_cohort_change",
|
7870
|
+
"project_assessment",
|
7871
|
+
"project_assessment_request"
|
7846
7872
|
]
|
7847
7873
|
},
|
7848
7874
|
data: {
|
@@ -7869,6 +7895,96 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
7869
7895
|
}
|
7870
7896
|
}
|
7871
7897
|
},
|
7898
|
+
StudentProject: {
|
7899
|
+
type: "object",
|
7900
|
+
properties: {
|
7901
|
+
id: {
|
7902
|
+
type: "integer"
|
7903
|
+
},
|
7904
|
+
createdAt: {
|
7905
|
+
type: "string",
|
7906
|
+
format: "date-time"
|
7907
|
+
},
|
7908
|
+
updatedAt: {
|
7909
|
+
type: "string",
|
7910
|
+
format: "date-time"
|
7911
|
+
},
|
7912
|
+
createdBy: {
|
7913
|
+
type: "string"
|
7914
|
+
},
|
7915
|
+
projectSlug: {
|
7916
|
+
type: "string"
|
7917
|
+
},
|
7918
|
+
projectVersion: {
|
7919
|
+
type: "string"
|
7920
|
+
},
|
7921
|
+
cohort: {
|
7922
|
+
$ref: "#/definitions/Cohort"
|
7923
|
+
},
|
7924
|
+
links: {
|
7925
|
+
type: "array",
|
7926
|
+
items: {
|
7927
|
+
$ref: "#/definitions/StudentProjectLink"
|
7928
|
+
}
|
7929
|
+
},
|
7930
|
+
team: {
|
7931
|
+
type: "array",
|
7932
|
+
items: {
|
7933
|
+
$ref: "#/definitions/StudentProjecTeamMember"
|
7934
|
+
}
|
7935
|
+
}
|
7936
|
+
}
|
7937
|
+
},
|
7938
|
+
StudentProjecTeamMember: {
|
7939
|
+
type: "object",
|
7940
|
+
properties: {
|
7941
|
+
id: {
|
7942
|
+
type: "integer"
|
7943
|
+
},
|
7944
|
+
createdAt: {
|
7945
|
+
type: "string",
|
7946
|
+
format: "date-time"
|
7947
|
+
},
|
7948
|
+
updatedAt: {
|
7949
|
+
type: "string",
|
7950
|
+
format: "date-time"
|
7951
|
+
},
|
7952
|
+
createdBy: {
|
7953
|
+
type: "string"
|
7954
|
+
},
|
7955
|
+
studentProject: {
|
7956
|
+
$ref: "#/definitions/StudentProject"
|
7957
|
+
},
|
7958
|
+
user: {
|
7959
|
+
$ref: "#/definitions/User"
|
7960
|
+
}
|
7961
|
+
}
|
7962
|
+
},
|
7963
|
+
StudentProjectLink: {
|
7964
|
+
type: "object",
|
7965
|
+
properties: {
|
7966
|
+
id: {
|
7967
|
+
type: "integer"
|
7968
|
+
},
|
7969
|
+
createdAt: {
|
7970
|
+
type: "string",
|
7971
|
+
format: "date-time"
|
7972
|
+
},
|
7973
|
+
updatedAt: {
|
7974
|
+
type: "string",
|
7975
|
+
format: "date-time"
|
7976
|
+
},
|
7977
|
+
createdBy: {
|
7978
|
+
type: "string"
|
7979
|
+
},
|
7980
|
+
url: {
|
7981
|
+
type: "string"
|
7982
|
+
},
|
7983
|
+
studentProject: {
|
7984
|
+
$ref: "#/definitions/StudentProject"
|
7985
|
+
}
|
7986
|
+
}
|
7987
|
+
},
|
7872
7988
|
Contract: {
|
7873
7989
|
type: "object",
|
7874
7990
|
properties: {
|
@@ -8402,10 +8518,10 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
8402
8518
|
}
|
8403
8519
|
]
|
8404
8520
|
},
|
8405
|
-
|
8521
|
+
reviews: {
|
8406
8522
|
type: "array",
|
8407
8523
|
items: {
|
8408
|
-
$ref: "#/definitions/
|
8524
|
+
$ref: "#/definitions/JobReview"
|
8409
8525
|
}
|
8410
8526
|
},
|
8411
8527
|
applications: {
|
@@ -8413,10 +8529,22 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
8413
8529
|
items: {
|
8414
8530
|
$ref: "#/definitions/JobApplication"
|
8415
8531
|
}
|
8532
|
+
},
|
8533
|
+
crawlerQueries: {
|
8534
|
+
type: "array",
|
8535
|
+
items: {
|
8536
|
+
$ref: "#/definitions/JobCrawlerQuery"
|
8537
|
+
}
|
8538
|
+
},
|
8539
|
+
crawlerLocations: {
|
8540
|
+
type: "array",
|
8541
|
+
items: {
|
8542
|
+
$ref: "#/definitions/JobCrawlerLocation"
|
8543
|
+
}
|
8416
8544
|
}
|
8417
8545
|
}
|
8418
8546
|
},
|
8419
|
-
|
8547
|
+
JobProfileType: {
|
8420
8548
|
type: "object",
|
8421
8549
|
properties: {
|
8422
8550
|
id: {
|
@@ -8430,26 +8558,60 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
8430
8558
|
type: "string",
|
8431
8559
|
format: "date-time"
|
8432
8560
|
},
|
8433
|
-
|
8434
|
-
type:
|
8561
|
+
createdBy: {
|
8562
|
+
type: [
|
8563
|
+
"string",
|
8564
|
+
"null"
|
8565
|
+
]
|
8435
8566
|
},
|
8436
|
-
|
8567
|
+
name: {
|
8568
|
+
type: "string"
|
8569
|
+
},
|
8570
|
+
learningObjectives: {
|
8437
8571
|
type: [
|
8572
|
+
"number",
|
8438
8573
|
"string",
|
8574
|
+
"boolean",
|
8575
|
+
"object",
|
8576
|
+
"array",
|
8439
8577
|
"null"
|
8440
|
-
],
|
8441
|
-
enum: [
|
8442
|
-
"design",
|
8443
|
-
"front_end",
|
8444
|
-
"angular",
|
8445
|
-
"react",
|
8446
|
-
"vue",
|
8447
|
-
"back_end",
|
8448
|
-
"full_stack",
|
8449
|
-
"ux",
|
8450
|
-
"other"
|
8451
8578
|
]
|
8452
8579
|
},
|
8580
|
+
track: {
|
8581
|
+
anyOf: [
|
8582
|
+
{
|
8583
|
+
$ref: "#/definitions/Track"
|
8584
|
+
},
|
8585
|
+
{
|
8586
|
+
type: "null"
|
8587
|
+
}
|
8588
|
+
]
|
8589
|
+
},
|
8590
|
+
reviews: {
|
8591
|
+
type: "array",
|
8592
|
+
items: {
|
8593
|
+
$ref: "#/definitions/JobReviewProfileType"
|
8594
|
+
}
|
8595
|
+
}
|
8596
|
+
}
|
8597
|
+
},
|
8598
|
+
JobReview: {
|
8599
|
+
type: "object",
|
8600
|
+
properties: {
|
8601
|
+
id: {
|
8602
|
+
type: "integer"
|
8603
|
+
},
|
8604
|
+
createdAt: {
|
8605
|
+
type: "string",
|
8606
|
+
format: "date-time"
|
8607
|
+
},
|
8608
|
+
updatedAt: {
|
8609
|
+
type: "string",
|
8610
|
+
format: "date-time"
|
8611
|
+
},
|
8612
|
+
isValid: {
|
8613
|
+
type: "boolean"
|
8614
|
+
},
|
8453
8615
|
invalidReason: {
|
8454
8616
|
type: [
|
8455
8617
|
"string",
|
@@ -8473,6 +8635,40 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
8473
8635
|
},
|
8474
8636
|
job: {
|
8475
8637
|
$ref: "#/definitions/Job"
|
8638
|
+
},
|
8639
|
+
profileTypes: {
|
8640
|
+
type: "array",
|
8641
|
+
items: {
|
8642
|
+
$ref: "#/definitions/JobReviewProfileType"
|
8643
|
+
}
|
8644
|
+
}
|
8645
|
+
}
|
8646
|
+
},
|
8647
|
+
JobReviewProfileType: {
|
8648
|
+
type: "object",
|
8649
|
+
properties: {
|
8650
|
+
id: {
|
8651
|
+
type: "integer"
|
8652
|
+
},
|
8653
|
+
createdAt: {
|
8654
|
+
type: "string",
|
8655
|
+
format: "date-time"
|
8656
|
+
},
|
8657
|
+
updatedAt: {
|
8658
|
+
type: "string",
|
8659
|
+
format: "date-time"
|
8660
|
+
},
|
8661
|
+
createdBy: {
|
8662
|
+
type: [
|
8663
|
+
"string",
|
8664
|
+
"null"
|
8665
|
+
]
|
8666
|
+
},
|
8667
|
+
review: {
|
8668
|
+
$ref: "#/definitions/JobReview"
|
8669
|
+
},
|
8670
|
+
profileType: {
|
8671
|
+
$ref: "#/definitions/JobProfileType"
|
8476
8672
|
}
|
8477
8673
|
}
|
8478
8674
|
},
|
@@ -8558,8 +8754,137 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
8558
8754
|
]
|
8559
8755
|
}
|
8560
8756
|
}
|
8757
|
+
},
|
8758
|
+
CrawlerQuery: {
|
8759
|
+
type: "object",
|
8760
|
+
properties: {
|
8761
|
+
id: {
|
8762
|
+
type: "integer"
|
8763
|
+
},
|
8764
|
+
createdAt: {
|
8765
|
+
type: "string",
|
8766
|
+
format: "date-time"
|
8767
|
+
},
|
8768
|
+
updatedAt: {
|
8769
|
+
type: "string",
|
8770
|
+
format: "date-time"
|
8771
|
+
},
|
8772
|
+
createdBy: {
|
8773
|
+
type: [
|
8774
|
+
"string",
|
8775
|
+
"null"
|
8776
|
+
]
|
8777
|
+
},
|
8778
|
+
query: {
|
8779
|
+
type: "string"
|
8780
|
+
},
|
8781
|
+
enabled: {
|
8782
|
+
type: "boolean",
|
8783
|
+
default: !0
|
8784
|
+
},
|
8785
|
+
track: {
|
8786
|
+
$ref: "#/definitions/Track"
|
8787
|
+
},
|
8788
|
+
jobs: {
|
8789
|
+
type: "array",
|
8790
|
+
items: {
|
8791
|
+
$ref: "#/definitions/JobCrawlerQuery"
|
8792
|
+
}
|
8793
|
+
}
|
8794
|
+
}
|
8795
|
+
},
|
8796
|
+
JobCrawlerQuery: {
|
8797
|
+
type: "object",
|
8798
|
+
properties: {
|
8799
|
+
id: {
|
8800
|
+
type: "integer"
|
8801
|
+
},
|
8802
|
+
createdAt: {
|
8803
|
+
type: "string",
|
8804
|
+
format: "date-time"
|
8805
|
+
},
|
8806
|
+
updatedAt: {
|
8807
|
+
type: "string",
|
8808
|
+
format: "date-time"
|
8809
|
+
},
|
8810
|
+
createdBy: {
|
8811
|
+
type: [
|
8812
|
+
"string",
|
8813
|
+
"null"
|
8814
|
+
]
|
8815
|
+
},
|
8816
|
+
job: {
|
8817
|
+
$ref: "#/definitions/Job"
|
8818
|
+
},
|
8819
|
+
query: {
|
8820
|
+
$ref: "#/definitions/CrawlerQuery"
|
8821
|
+
}
|
8822
|
+
}
|
8823
|
+
},
|
8824
|
+
CrawlerLocation: {
|
8825
|
+
type: "object",
|
8826
|
+
properties: {
|
8827
|
+
id: {
|
8828
|
+
type: "integer"
|
8829
|
+
},
|
8830
|
+
createdAt: {
|
8831
|
+
type: "string",
|
8832
|
+
format: "date-time"
|
8833
|
+
},
|
8834
|
+
updatedAt: {
|
8835
|
+
type: "string",
|
8836
|
+
format: "date-time"
|
8837
|
+
},
|
8838
|
+
createdBy: {
|
8839
|
+
type: [
|
8840
|
+
"string",
|
8841
|
+
"null"
|
8842
|
+
]
|
8843
|
+
},
|
8844
|
+
name: {
|
8845
|
+
type: "string"
|
8846
|
+
},
|
8847
|
+
enabled: {
|
8848
|
+
type: "boolean",
|
8849
|
+
default: !0
|
8850
|
+
},
|
8851
|
+
jobs: {
|
8852
|
+
type: "array",
|
8853
|
+
items: {
|
8854
|
+
$ref: "#/definitions/JobCrawlerLocation"
|
8855
|
+
}
|
8856
|
+
}
|
8857
|
+
}
|
8858
|
+
},
|
8859
|
+
JobCrawlerLocation: {
|
8860
|
+
type: "object",
|
8861
|
+
properties: {
|
8862
|
+
id: {
|
8863
|
+
type: "integer"
|
8864
|
+
},
|
8865
|
+
createdAt: {
|
8866
|
+
type: "string",
|
8867
|
+
format: "date-time"
|
8868
|
+
},
|
8869
|
+
updatedAt: {
|
8870
|
+
type: "string",
|
8871
|
+
format: "date-time"
|
8872
|
+
},
|
8873
|
+
createdBy: {
|
8874
|
+
type: [
|
8875
|
+
"string",
|
8876
|
+
"null"
|
8877
|
+
]
|
8878
|
+
},
|
8879
|
+
job: {
|
8880
|
+
$ref: "#/definitions/Job"
|
8881
|
+
},
|
8882
|
+
location: {
|
8883
|
+
$ref: "#/definitions/CrawlerLocation"
|
8884
|
+
}
|
8885
|
+
}
|
8561
8886
|
}
|
8562
|
-
},
|
8887
|
+
}, Wo = "object", xo = {
|
8563
8888
|
country: {
|
8564
8889
|
$ref: "#/definitions/Country"
|
8565
8890
|
},
|
@@ -8611,6 +8936,15 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
8611
8936
|
activityLogEntry: {
|
8612
8937
|
$ref: "#/definitions/ActivityLogEntry"
|
8613
8938
|
},
|
8939
|
+
studentProject: {
|
8940
|
+
$ref: "#/definitions/StudentProject"
|
8941
|
+
},
|
8942
|
+
studentProjecTeamMember: {
|
8943
|
+
$ref: "#/definitions/StudentProjecTeamMember"
|
8944
|
+
},
|
8945
|
+
studentProjectLink: {
|
8946
|
+
$ref: "#/definitions/StudentProjectLink"
|
8947
|
+
},
|
8614
8948
|
contract: {
|
8615
8949
|
$ref: "#/definitions/Contract"
|
8616
8950
|
},
|
@@ -8632,18 +8966,36 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
8632
8966
|
job: {
|
8633
8967
|
$ref: "#/definitions/Job"
|
8634
8968
|
},
|
8635
|
-
|
8636
|
-
$ref: "#/definitions/
|
8969
|
+
jobProfileType: {
|
8970
|
+
$ref: "#/definitions/JobProfileType"
|
8971
|
+
},
|
8972
|
+
jobReview: {
|
8973
|
+
$ref: "#/definitions/JobReview"
|
8974
|
+
},
|
8975
|
+
jobReviewProfileType: {
|
8976
|
+
$ref: "#/definitions/JobReviewProfileType"
|
8637
8977
|
},
|
8638
8978
|
jobApplication: {
|
8639
8979
|
$ref: "#/definitions/JobApplication"
|
8640
|
-
}
|
8641
|
-
|
8642
|
-
|
8643
|
-
|
8644
|
-
|
8645
|
-
|
8646
|
-
},
|
8980
|
+
},
|
8981
|
+
crawlerQuery: {
|
8982
|
+
$ref: "#/definitions/CrawlerQuery"
|
8983
|
+
},
|
8984
|
+
jobCrawlerQuery: {
|
8985
|
+
$ref: "#/definitions/JobCrawlerQuery"
|
8986
|
+
},
|
8987
|
+
crawlerLocation: {
|
8988
|
+
$ref: "#/definitions/CrawlerLocation"
|
8989
|
+
},
|
8990
|
+
jobCrawlerLocation: {
|
8991
|
+
$ref: "#/definitions/JobCrawlerLocation"
|
8992
|
+
}
|
8993
|
+
}, Wt = {
|
8994
|
+
$schema: Ho,
|
8995
|
+
definitions: Vo,
|
8996
|
+
type: Wo,
|
8997
|
+
properties: xo
|
8998
|
+
}, qo = 60 * 60 * 1e3, xt = 24 * qo, zo = {
|
8647
8999
|
Country: {
|
8648
9000
|
primaryKey: "code",
|
8649
9001
|
plural: "countries",
|
@@ -8691,7 +9043,7 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
8691
9043
|
}
|
8692
9044
|
},
|
8693
9045
|
parse: (n) => {
|
8694
|
-
const e = n.github ? `https://github.com/${n.github}.png?size=` : `https://www.gravatar.com/avatar/${
|
9046
|
+
const e = n.github ? `https://github.com/${n.github}.png?size=` : `https://www.gravatar.com/avatar/${ko(n.email)}?s=`;
|
8695
9047
|
return {
|
8696
9048
|
...n,
|
8697
9049
|
fullName: `${n.firstName || ""}${n.lastName ? ` ${n.lastName}` : ""}`,
|
@@ -8755,7 +9107,7 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
8755
9107
|
) < e ? t = "placement_ended" : n.placementStart < e && (t = "placement_started");
|
8756
9108
|
}
|
8757
9109
|
!t && n.end < e && (t = "ended"), !t && n.start < e && (t = "started");
|
8758
|
-
const r = n.admissionEnd ? +n.admissionEnd +
|
9110
|
+
const r = n.admissionEnd ? +n.admissionEnd + xt : !1;
|
8759
9111
|
!t && r && r < e && (t = "admission_ended"), !t && n.admissionStart && n.admissionStart < e && (t = "admission_started"), !t && n.admissionStart && n.admissionEnd && (t = "planned"), t || (t = "draft");
|
8760
9112
|
const i = n.start > e && n.vacancies ? n.vacancies : ((s = n._count) == null ? void 0 : s.students) || ((o = n.students) == null ? void 0 : o.length) || 0;
|
8761
9113
|
return {
|
@@ -8891,7 +9243,7 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
8891
9243
|
return n;
|
8892
9244
|
const t = Date.now();
|
8893
9245
|
let r;
|
8894
|
-
return n.isReady ? r = "ready" : e && !n.bypassFilters ? r = "rejected" : n.createdAt < t - 90 *
|
9246
|
+
return n.isReady ? r = "ready" : e && !n.bypassFilters ? r = "rejected" : n.createdAt < t - 90 * xt ? r = "expired" : ((o = n.cohort) == null ? void 0 : o.status) !== "admission_started" ? r = "admission_ended" : r = "active", {
|
8895
9247
|
...n,
|
8896
9248
|
status: r
|
8897
9249
|
};
|
@@ -8916,78 +9268,81 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
8916
9268
|
plural: "universities",
|
8917
9269
|
searchProps: ["name"]
|
8918
9270
|
},
|
8919
|
-
Job: {
|
8920
|
-
// inputProps: [],
|
8921
|
-
// properties: {},
|
8922
|
-
},
|
8923
9271
|
Company: {
|
8924
9272
|
plural: "companies"
|
8925
|
-
|
8926
|
-
|
9273
|
+
},
|
9274
|
+
CrawlerQuery: {
|
9275
|
+
plural: "crawlerQueries"
|
9276
|
+
},
|
9277
|
+
JobCrawlerQuery: {
|
9278
|
+
plural: "jobCrawlerQueries"
|
8927
9279
|
}
|
8928
|
-
},
|
8929
|
-
...
|
8930
|
-
...
|
8931
|
-
definitions:
|
9280
|
+
}, Jo = (n, e) => ({
|
9281
|
+
...Bo(n, e, {
|
9282
|
+
...Wt,
|
9283
|
+
definitions: Fo(Wt, zo)
|
8932
9284
|
}),
|
8933
9285
|
gcpLog: {
|
8934
|
-
getEntries: async (t) => await
|
8935
|
-
}
|
8936
|
-
}), Xo = "https://api.github.com/repos/Laboratoria/bootcamp/releases", Te = "https://raw.githubusercontent.com/Laboratoria/bootcamp", Ae = () => fetch(`${Xo}/latest`).then((n) => n.json()).then(({ tag_name: n }) => n), Qo = async (n) => fetch(`${Te}/${n || await Ae()}/dist/projects.json`).then((e) => e.json()), Zo = async (n, e) => fetch(`${Te}/${e || await Ae()}/dist/projects/${n}.json`).then((t) => t.json()), ea = async (n) => fetch(`${Te}/${n || await Ae()}/dist/topics.json`).then((e) => e.json()), ta = async (n, e) => fetch(`${Te}/${e || await Ae()}/dist/topics/${n}.json`).then((t) => t.json()), na = async (n) => fetch(`${Te}/${n || await Ae()}/dist/learning-objectives.json`).then((e) => e.json()), qt = (n) => (e) => e.filter((t) => !(n.locale && n.locale !== t.locale || n.track && n.track !== t.track)), ra = () => ({
|
8937
|
-
project: {
|
8938
|
-
findMany: (n = {}) => Qo(n.tag).then(qt(n)),
|
8939
|
-
findById: (n, e = {}) => Zo(n, e.tag)
|
8940
|
-
},
|
8941
|
-
topic: {
|
8942
|
-
findMany: (n = {}) => ea(n.tag).then(qt(n)),
|
8943
|
-
findById: (n, e = {}) => ta(n, e.tag)
|
8944
|
-
},
|
8945
|
-
learningObjective: {
|
8946
|
-
findMany: (n = {}) => na(n.tag)
|
9286
|
+
getEntries: async (t) => await mt(n, e.authUser)(`/gcp-logs?q=${JSON.stringify(t)}`)
|
8947
9287
|
}
|
8948
|
-
}),
|
9288
|
+
}), Go = (n, e) => {
|
9289
|
+
const t = mt(n, e.authUser);
|
9290
|
+
return {
|
9291
|
+
project: {
|
9292
|
+
findMany: (r = {}) => t(`/projects?q=${JSON.stringify(r)}`),
|
9293
|
+
findBySlug: (r, i = {}) => t(`/projects/${r}?q=${JSON.stringify(i)}`)
|
9294
|
+
},
|
9295
|
+
topic: {
|
9296
|
+
findMany: (r = {}) => t(`/topics?q=${JSON.stringify(r)}`),
|
9297
|
+
findBySlug: (r, i = {}) => t(`/topics/${r}?q=${JSON.stringify(i)}`)
|
9298
|
+
},
|
9299
|
+
learningObjective: {
|
9300
|
+
findMany: (r = {}) => t(`/learning-objectives?q=${JSON.stringify(r)}`)
|
9301
|
+
}
|
9302
|
+
};
|
9303
|
+
}, Ue = (n) => n > 9 ? `${n}` : `0${n}`, Ko = (n) => `${Ue(n.getUTCDate())}/${Ue(n.getUTCMonth() + 1)}/${n.getUTCFullYear()}`, Yo = (n) => `${Ue(n.getUTCHours())}:${Ue(n.getUTCMinutes())}:${n.getUTCSeconds()} UTC`, Zo = (n) => `${Ko(n)} ${Yo(n)}`, Qo = {
|
8949
9304
|
es: "es-ES",
|
8950
9305
|
pt: "pt-BR"
|
8951
|
-
},
|
9306
|
+
}, ea = (n, e = "es", t = !1) => new Intl.DateTimeFormat(Qo[e], {
|
8952
9307
|
...t && {
|
8953
9308
|
year: "numeric"
|
8954
9309
|
},
|
8955
9310
|
month: "long",
|
8956
9311
|
day: "numeric",
|
8957
9312
|
timeZone: "UTC"
|
8958
|
-
}).format(new Date(n)),
|
9313
|
+
}).format(new Date(n)), ta = (n, e) => {
|
8959
9314
|
let t = e.getFullYear() - n.getFullYear();
|
8960
9315
|
const r = e.getMonth() - n.getMonth();
|
8961
9316
|
return (r < 0 || r === 0 && e.getDate() < n.getDate()) && t--, t;
|
8962
|
-
},
|
9317
|
+
}, Xo = (n, e, t) => new Intl.NumberFormat(
|
8963
9318
|
`${n}-${e}`,
|
8964
9319
|
{ currency: t }
|
8965
|
-
),
|
9320
|
+
), na = (n, e, t, r) => Xo(
|
8966
9321
|
e,
|
8967
9322
|
t,
|
8968
9323
|
r
|
8969
|
-
).format(n),
|
9324
|
+
).format(n), ra = (n) => parseInt(n.replace(/[,\.]/g, ""), 10), ia = (n) => {
|
8970
9325
|
try {
|
8971
9326
|
return JSON.parse(window.localStorage.getItem(n));
|
8972
9327
|
} catch {
|
8973
9328
|
return null;
|
8974
9329
|
}
|
8975
|
-
},
|
9330
|
+
}, sa = ({
|
8976
9331
|
firebaseApiKey: n = "AIzaSyAXbaEbpq8NOfn0r8mIrcoHvoGRkJThwdc",
|
8977
9332
|
firebaseProject: e = "laboratoria-la",
|
8978
9333
|
coreApiUrl: t = "https://us-central1-outpost-272720.cloudfunctions.net/core-api"
|
8979
9334
|
} = {}) => {
|
8980
|
-
const r =
|
9335
|
+
const r = tn({
|
8981
9336
|
apiKey: n,
|
8982
9337
|
authDomain: `${e}.firebaseapp.com`,
|
8983
9338
|
databaseURL: `https://${e}.firebaseio.com`,
|
8984
9339
|
projectId: e
|
8985
|
-
}), i =
|
9340
|
+
}), i = Co(r), s = { authUser: void 0, user: void 0 }, o = Jo(t, s);
|
8986
9341
|
return {
|
8987
|
-
...
|
9342
|
+
...Go(t, s),
|
8988
9343
|
...o,
|
8989
9344
|
auth: {
|
8990
|
-
onChange: (u) =>
|
9345
|
+
onChange: (u) => fs(i, (y) => {
|
8991
9346
|
if (!y)
|
8992
9347
|
return Object.assign(s, { authUser: null, user: null }), u(s);
|
8993
9348
|
Object.assign(s, { authUser: y }), o.user.findById(y.uid).then((b) => {
|
@@ -8996,25 +9351,25 @@ const Lo = /* @__PURE__ */ Do(No), jn = (n, e) => async (t, r = {}) => {
|
|
8996
9351
|
console.error(b), Object.assign(s, { authUser: null, user: null }), u(s);
|
8997
9352
|
});
|
8998
9353
|
}),
|
8999
|
-
signIn: (u, y) =>
|
9354
|
+
signIn: (u, y) => ds(
|
9000
9355
|
i,
|
9001
9356
|
u,
|
9002
9357
|
y
|
9003
9358
|
),
|
9004
|
-
signOut: () =>
|
9005
|
-
sendPasswordResetEmail: (u) =>
|
9359
|
+
signOut: () => ps(i),
|
9360
|
+
sendPasswordResetEmail: (u) => ls(i, u)
|
9006
9361
|
},
|
9007
9362
|
firebaseApp: r
|
9008
9363
|
};
|
9009
9364
|
};
|
9010
9365
|
export {
|
9011
|
-
|
9012
|
-
|
9013
|
-
|
9014
|
-
|
9015
|
-
|
9016
|
-
|
9017
|
-
|
9018
|
-
|
9019
|
-
|
9366
|
+
sa as createApp,
|
9367
|
+
na as formatCurrency,
|
9368
|
+
Ko as formatDate,
|
9369
|
+
Zo as formatDateTime,
|
9370
|
+
ea as formatMonth,
|
9371
|
+
Yo as formatTime,
|
9372
|
+
ta as getAgeAt,
|
9373
|
+
ia as loadFromLocalStorage,
|
9374
|
+
ra as parseCurrency
|
9020
9375
|
};
|