@feedmepos/mf-payment 1.4.44 → 1.4.45
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/{OnboardForm-BHwzJNnl.js → OnboardForm-Dg-Te6WA.js} +2 -2
- package/dist/{OnboardForm-D-p05sjq.js → OnboardForm-Hg1J1NNW.js} +2 -2
- package/dist/{OnboardSubmission-DjwHpqdD.js → OnboardSubmission-D63wk5mc.js} +2 -2
- package/dist/{OnboardSubmission-BUp1Q-al.js → OnboardSubmission-MghAocun.js} +1 -1
- package/dist/{PayoutAccount-C6HJIzYS.js → PayoutAccount-CzwUi6sF.js} +1 -1
- package/dist/{PayoutAccount-C6IwKGOz.js → PayoutAccount-DNrMzfE3.js} +3 -3
- package/dist/{RestaurantSelector.vue_vue_type_script_setup_true_lang-CxX3_Xyg.js → RestaurantSelector.vue_vue_type_script_setup_true_lang-Bzj_sdSY.js} +24 -24
- package/dist/{Settlement-C_rIV3fu.js → Settlement-CWX5RKwL.js} +1 -1
- package/dist/{TransactionOld-CDxar7K3.js → TransactionOld-CCzonxUD.js} +1 -1
- package/dist/{app-DmIXP-hM.js → app-DawA1Qw3.js} +800 -769
- package/dist/app.js +1 -1
- package/dist/{index-DAuJC2FO.js → index-BtqPYPV8.js} +1 -1
- package/dist/package.json +3 -2
- package/dist/{payout-account-eSXqQE97.js → payout-account-n8CrfMda.js} +2 -2
- package/dist/{plugins-DK1OMbz2.js → plugins--j00wPbu.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +3 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { createRouter as Ln, createWebHistory as Mn, useRouter as Un, useRoute as xn } from "vue-router";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
2
|
+
import { routes as Fn, FmApp as Bn } from "@feedmepos/mf-financing";
|
|
3
|
+
import { computed as Lt, watch as q, defineComponent as Mt, ref as $n, resolveComponent as Ut, openBlock as xt, createBlock as Ft, h as Hn, onMounted as Vn, onBeforeMount as jn, unref as Wn } from "vue";
|
|
4
|
+
import { useCoreStore as We, useI18n as zn } from "@feedmepos/mf-common";
|
|
5
|
+
import { defineStore as Gn } from "pinia";
|
|
6
|
+
import { components as qn } from "@feedmepos/ui-library";
|
|
7
|
+
const Kn = {
|
|
7
8
|
components: {
|
|
8
9
|
select: "Select filter entity",
|
|
9
10
|
restaurant: "Restaurant",
|
|
@@ -178,9 +179,9 @@ const Gn = {
|
|
|
178
179
|
service2: "SoftPOS Card Payment"
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
|
-
},
|
|
182
|
-
payment:
|
|
183
|
-
},
|
|
182
|
+
}, Jn = {
|
|
183
|
+
payment: Kn
|
|
184
|
+
}, Yn = {
|
|
184
185
|
components: {
|
|
185
186
|
select: "选择筛选对象",
|
|
186
187
|
restaurant: "餐厅",
|
|
@@ -355,8 +356,8 @@ const Gn = {
|
|
|
355
356
|
service2: "SoftPOS银行卡支付"
|
|
356
357
|
}
|
|
357
358
|
}
|
|
358
|
-
},
|
|
359
|
-
payment:
|
|
359
|
+
}, Xn = {
|
|
360
|
+
payment: Yn
|
|
360
361
|
}, le = [
|
|
361
362
|
{
|
|
362
363
|
path: "/admin/restaurants",
|
|
@@ -383,7 +384,7 @@ const Gn = {
|
|
|
383
384
|
sidebarDisplay: "Payout Accounts",
|
|
384
385
|
section: "payment-gateway"
|
|
385
386
|
},
|
|
386
|
-
component: () => import("./PayoutAccount-
|
|
387
|
+
component: () => import("./PayoutAccount-CzwUi6sF.js")
|
|
387
388
|
},
|
|
388
389
|
{
|
|
389
390
|
path: "/admin/payout-accounts/:accountId",
|
|
@@ -401,7 +402,7 @@ const Gn = {
|
|
|
401
402
|
sidebarDisplay: "Payment Onboarding",
|
|
402
403
|
section: "payment-gateway"
|
|
403
404
|
},
|
|
404
|
-
component: () => import("./OnboardSubmission-
|
|
405
|
+
component: () => import("./OnboardSubmission-MghAocun.js")
|
|
405
406
|
},
|
|
406
407
|
{
|
|
407
408
|
path: "/admin/onboarding/:submissionId",
|
|
@@ -410,7 +411,7 @@ const Gn = {
|
|
|
410
411
|
meta: {
|
|
411
412
|
parent: "mf-payment-admin.onboard-submission"
|
|
412
413
|
},
|
|
413
|
-
component: () => import("./OnboardForm-
|
|
414
|
+
component: () => import("./OnboardForm-Dg-Te6WA.js")
|
|
414
415
|
},
|
|
415
416
|
{
|
|
416
417
|
path: "/admin/terminal/pos",
|
|
@@ -508,7 +509,7 @@ const Gn = {
|
|
|
508
509
|
},
|
|
509
510
|
component: () => import("./SettlementTransactions-DYAlKO__.js")
|
|
510
511
|
}
|
|
511
|
-
],
|
|
512
|
+
], ue = [
|
|
512
513
|
{
|
|
513
514
|
path: "",
|
|
514
515
|
redirect: { name: "mf-payment-payout-account" }
|
|
@@ -516,7 +517,7 @@ const Gn = {
|
|
|
516
517
|
{
|
|
517
518
|
path: "/payout-account",
|
|
518
519
|
name: "mf-payment-payout-account",
|
|
519
|
-
component: () => import("./PayoutAccount-
|
|
520
|
+
component: () => import("./PayoutAccount-DNrMzfE3.js"),
|
|
520
521
|
meta: {
|
|
521
522
|
sidebarDisplay: "i18n:payment.routes.payout_account"
|
|
522
523
|
}
|
|
@@ -524,7 +525,7 @@ const Gn = {
|
|
|
524
525
|
{
|
|
525
526
|
path: "/onboard-submission",
|
|
526
527
|
name: "mf-payment-onboard-submission",
|
|
527
|
-
component: () => import("./OnboardSubmission-
|
|
528
|
+
component: () => import("./OnboardSubmission-D63wk5mc.js"),
|
|
528
529
|
meta: {
|
|
529
530
|
sidebarDisplay: "i18n:payment.routes.onboard_submission",
|
|
530
531
|
region: { MY: !0 }
|
|
@@ -534,7 +535,7 @@ const Gn = {
|
|
|
534
535
|
path: "/onboard-submission/:type/:submission?",
|
|
535
536
|
name: "mf-payment-onboard-submission-form",
|
|
536
537
|
props: !0,
|
|
537
|
-
component: () => import("./OnboardForm-
|
|
538
|
+
component: () => import("./OnboardForm-Hg1J1NNW.js"),
|
|
538
539
|
meta: {
|
|
539
540
|
parent: "mf-payment-onboard-submission"
|
|
540
541
|
}
|
|
@@ -542,7 +543,7 @@ const Gn = {
|
|
|
542
543
|
{
|
|
543
544
|
path: "/transaction-old",
|
|
544
545
|
name: "mf-payment-old-transaction",
|
|
545
|
-
component: () => import("./TransactionOld-
|
|
546
|
+
component: () => import("./TransactionOld-CCzonxUD.js"),
|
|
546
547
|
meta: {
|
|
547
548
|
sidebarDisplay: "i18n:payment.routes.transaction"
|
|
548
549
|
}
|
|
@@ -559,7 +560,7 @@ const Gn = {
|
|
|
559
560
|
{
|
|
560
561
|
path: "/settlement",
|
|
561
562
|
name: "mf-payment-settlement",
|
|
562
|
-
component: () => import("./Settlement-
|
|
563
|
+
component: () => import("./Settlement-CWX5RKwL.js"),
|
|
563
564
|
meta: {
|
|
564
565
|
sidebarDisplay: "i18n:payment.routes.settlement"
|
|
565
566
|
}
|
|
@@ -572,8 +573,18 @@ const Gn = {
|
|
|
572
573
|
meta: {
|
|
573
574
|
parent: "mf-payment-settlement"
|
|
574
575
|
}
|
|
575
|
-
}
|
|
576
|
-
|
|
576
|
+
},
|
|
577
|
+
...Fn.map((n) => ({
|
|
578
|
+
...n,
|
|
579
|
+
meta: {
|
|
580
|
+
...n.meta,
|
|
581
|
+
section: "financing"
|
|
582
|
+
},
|
|
583
|
+
path: `/financing${n.path}`,
|
|
584
|
+
component: Bn,
|
|
585
|
+
children: n
|
|
586
|
+
}))
|
|
587
|
+
], Qn = Gn("mf-payment-iframe", () => {
|
|
577
588
|
const n = {
|
|
578
589
|
isIframe: !1
|
|
579
590
|
}, e = Lt(() => n);
|
|
@@ -625,7 +636,7 @@ const Bt = function(n) {
|
|
|
625
636
|
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);
|
|
626
637
|
}
|
|
627
638
|
return e;
|
|
628
|
-
},
|
|
639
|
+
}, Zn = function(n) {
|
|
629
640
|
const e = [];
|
|
630
641
|
let t = 0, r = 0;
|
|
631
642
|
for (; t < n.length; ) {
|
|
@@ -703,9 +714,9 @@ const Bt = function(n) {
|
|
|
703
714
|
this.init_();
|
|
704
715
|
const t = e ? this.byteToCharMapWebSafe_ : this.byteToCharMap_, r = [];
|
|
705
716
|
for (let i = 0; i < n.length; i += 3) {
|
|
706
|
-
const s = n[i], a = i + 1 < n.length, c = a ? n[i + 1] : 0, o = i + 2 < n.length,
|
|
707
|
-
let
|
|
708
|
-
o || (g = 64, a || (
|
|
717
|
+
const s = n[i], a = i + 1 < n.length, c = a ? n[i + 1] : 0, o = i + 2 < n.length, u = o ? n[i + 2] : 0, l = s >> 2, d = (s & 3) << 4 | c >> 4;
|
|
718
|
+
let f = (c & 15) << 2 | u >> 6, g = u & 63;
|
|
719
|
+
o || (g = 64, a || (f = 64)), r.push(t[l], t[d], t[f], t[g]);
|
|
709
720
|
}
|
|
710
721
|
return r.join("");
|
|
711
722
|
},
|
|
@@ -729,7 +740,7 @@ const Bt = function(n) {
|
|
|
729
740
|
* @return string representing the decoded value.
|
|
730
741
|
*/
|
|
731
742
|
decodeString(n, e) {
|
|
732
|
-
return this.HAS_NATIVE_SUPPORT && !e ? atob(n) :
|
|
743
|
+
return this.HAS_NATIVE_SUPPORT && !e ? atob(n) : Zn(this.decodeStringToByteArray(n, e));
|
|
733
744
|
},
|
|
734
745
|
/**
|
|
735
746
|
* Base64-decode a string.
|
|
@@ -752,17 +763,17 @@ const Bt = function(n) {
|
|
|
752
763
|
for (let i = 0; i < n.length; ) {
|
|
753
764
|
const s = t[n.charAt(i++)], c = i < n.length ? t[n.charAt(i)] : 0;
|
|
754
765
|
++i;
|
|
755
|
-
const
|
|
766
|
+
const u = i < n.length ? t[n.charAt(i)] : 64;
|
|
756
767
|
++i;
|
|
757
|
-
const
|
|
758
|
-
if (++i, s == null || c == null ||
|
|
759
|
-
throw new
|
|
760
|
-
const
|
|
761
|
-
if (r.push(
|
|
762
|
-
const g = c << 4 & 240 |
|
|
763
|
-
if (r.push(g),
|
|
764
|
-
const
|
|
765
|
-
r.push(
|
|
768
|
+
const d = i < n.length ? t[n.charAt(i)] : 64;
|
|
769
|
+
if (++i, s == null || c == null || u == null || d == null)
|
|
770
|
+
throw new er();
|
|
771
|
+
const f = s << 2 | c >> 4;
|
|
772
|
+
if (r.push(f), u !== 64) {
|
|
773
|
+
const g = c << 4 & 240 | u >> 2;
|
|
774
|
+
if (r.push(g), d !== 64) {
|
|
775
|
+
const v = u << 6 & 192 | d;
|
|
776
|
+
r.push(v);
|
|
766
777
|
}
|
|
767
778
|
}
|
|
768
779
|
}
|
|
@@ -781,16 +792,16 @@ const Bt = function(n) {
|
|
|
781
792
|
}
|
|
782
793
|
}
|
|
783
794
|
};
|
|
784
|
-
class
|
|
795
|
+
class er extends Error {
|
|
785
796
|
constructor() {
|
|
786
797
|
super(...arguments), this.name = "DecodeBase64StringError";
|
|
787
798
|
}
|
|
788
799
|
}
|
|
789
|
-
const
|
|
800
|
+
const tr = function(n) {
|
|
790
801
|
const e = Bt(n);
|
|
791
802
|
return $t.encodeByteArray(e, !0);
|
|
792
|
-
},
|
|
793
|
-
return
|
|
803
|
+
}, de = function(n) {
|
|
804
|
+
return tr(n).replace(/\./g, "");
|
|
794
805
|
}, Ht = function(n) {
|
|
795
806
|
try {
|
|
796
807
|
return $t.decodeString(n, !0);
|
|
@@ -815,7 +826,7 @@ const Zn = function(n) {
|
|
|
815
826
|
* See the License for the specific language governing permissions and
|
|
816
827
|
* limitations under the License.
|
|
817
828
|
*/
|
|
818
|
-
function
|
|
829
|
+
function nr() {
|
|
819
830
|
if (typeof self < "u")
|
|
820
831
|
return self;
|
|
821
832
|
if (typeof window < "u")
|
|
@@ -840,13 +851,13 @@ function er() {
|
|
|
840
851
|
* See the License for the specific language governing permissions and
|
|
841
852
|
* limitations under the License.
|
|
842
853
|
*/
|
|
843
|
-
const
|
|
854
|
+
const rr = () => nr().__FIREBASE_DEFAULTS__, ir = () => {
|
|
844
855
|
if (typeof process > "u" || typeof process.env > "u")
|
|
845
856
|
return;
|
|
846
857
|
const n = process.env.__FIREBASE_DEFAULTS__;
|
|
847
858
|
if (n)
|
|
848
859
|
return JSON.parse(n);
|
|
849
|
-
},
|
|
860
|
+
}, sr = () => {
|
|
850
861
|
if (typeof document > "u")
|
|
851
862
|
return;
|
|
852
863
|
let n;
|
|
@@ -859,7 +870,7 @@ const tr = () => er().__FIREBASE_DEFAULTS__, nr = () => {
|
|
|
859
870
|
return e && JSON.parse(e);
|
|
860
871
|
}, ze = () => {
|
|
861
872
|
try {
|
|
862
|
-
return
|
|
873
|
+
return rr() || ir() || sr();
|
|
863
874
|
} catch (n) {
|
|
864
875
|
console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);
|
|
865
876
|
return;
|
|
@@ -867,7 +878,7 @@ const tr = () => er().__FIREBASE_DEFAULTS__, nr = () => {
|
|
|
867
878
|
}, Vt = (n) => {
|
|
868
879
|
var e, t;
|
|
869
880
|
return (t = (e = ze()) === null || e === void 0 ? void 0 : e.emulatorHosts) === null || t === void 0 ? void 0 : t[n];
|
|
870
|
-
},
|
|
881
|
+
}, Fa = (n) => {
|
|
871
882
|
const e = Vt(n);
|
|
872
883
|
if (!e)
|
|
873
884
|
return;
|
|
@@ -899,7 +910,7 @@ const tr = () => er().__FIREBASE_DEFAULTS__, nr = () => {
|
|
|
899
910
|
* See the License for the specific language governing permissions and
|
|
900
911
|
* limitations under the License.
|
|
901
912
|
*/
|
|
902
|
-
class
|
|
913
|
+
class ar {
|
|
903
914
|
constructor() {
|
|
904
915
|
this.reject = () => {
|
|
905
916
|
}, this.resolve = () => {
|
|
@@ -935,7 +946,7 @@ class ir {
|
|
|
935
946
|
* See the License for the specific language governing permissions and
|
|
936
947
|
* limitations under the License.
|
|
937
948
|
*/
|
|
938
|
-
function
|
|
949
|
+
function Ba(n, e) {
|
|
939
950
|
if (n.uid)
|
|
940
951
|
throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');
|
|
941
952
|
const t = {
|
|
@@ -959,8 +970,8 @@ function Ua(n, e) {
|
|
|
959
970
|
}
|
|
960
971
|
}, n);
|
|
961
972
|
return [
|
|
962
|
-
|
|
963
|
-
|
|
973
|
+
de(JSON.stringify(t)),
|
|
974
|
+
de(JSON.stringify(a)),
|
|
964
975
|
""
|
|
965
976
|
].join(".");
|
|
966
977
|
}
|
|
@@ -983,33 +994,33 @@ function Ua(n, e) {
|
|
|
983
994
|
function m() {
|
|
984
995
|
return typeof navigator < "u" && typeof navigator.userAgent == "string" ? navigator.userAgent : "";
|
|
985
996
|
}
|
|
986
|
-
function
|
|
997
|
+
function or() {
|
|
987
998
|
return typeof window < "u" && // @ts-ignore Setting up an broadly applicable index signature for Window
|
|
988
999
|
// just to deal with this case would probably be a bad idea.
|
|
989
1000
|
!!(window.cordova || window.phonegap || window.PhoneGap) && /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(m());
|
|
990
1001
|
}
|
|
991
|
-
function
|
|
1002
|
+
function cr() {
|
|
992
1003
|
return typeof navigator < "u" && navigator.userAgent === "Cloudflare-Workers";
|
|
993
1004
|
}
|
|
994
|
-
function
|
|
1005
|
+
function lr() {
|
|
995
1006
|
const n = typeof chrome == "object" ? chrome.runtime : typeof browser == "object" ? browser.runtime : void 0;
|
|
996
1007
|
return typeof n == "object" && n.id !== void 0;
|
|
997
1008
|
}
|
|
998
|
-
function
|
|
1009
|
+
function ur() {
|
|
999
1010
|
return typeof navigator == "object" && navigator.product === "ReactNative";
|
|
1000
1011
|
}
|
|
1001
|
-
function
|
|
1012
|
+
function dr() {
|
|
1002
1013
|
const n = m();
|
|
1003
1014
|
return n.indexOf("MSIE ") >= 0 || n.indexOf("Trident/") >= 0;
|
|
1004
1015
|
}
|
|
1005
|
-
function
|
|
1016
|
+
function hr() {
|
|
1006
1017
|
try {
|
|
1007
1018
|
return typeof indexedDB == "object";
|
|
1008
1019
|
} catch {
|
|
1009
1020
|
return !1;
|
|
1010
1021
|
}
|
|
1011
1022
|
}
|
|
1012
|
-
function
|
|
1023
|
+
function fr() {
|
|
1013
1024
|
return new Promise((n, e) => {
|
|
1014
1025
|
try {
|
|
1015
1026
|
let t = !0;
|
|
@@ -1043,10 +1054,10 @@ function dr() {
|
|
|
1043
1054
|
* See the License for the specific language governing permissions and
|
|
1044
1055
|
* limitations under the License.
|
|
1045
1056
|
*/
|
|
1046
|
-
const
|
|
1047
|
-
class
|
|
1057
|
+
const pr = "FirebaseError";
|
|
1058
|
+
class M extends Error {
|
|
1048
1059
|
constructor(e, t, r) {
|
|
1049
|
-
super(t), this.code = e, this.customData = r, this.name =
|
|
1060
|
+
super(t), this.code = e, this.customData = r, this.name = pr, Object.setPrototypeOf(this, M.prototype), Error.captureStackTrace && Error.captureStackTrace(this, Q.prototype.create);
|
|
1050
1061
|
}
|
|
1051
1062
|
}
|
|
1052
1063
|
class Q {
|
|
@@ -1054,24 +1065,24 @@ class Q {
|
|
|
1054
1065
|
this.service = e, this.serviceName = t, this.errors = r;
|
|
1055
1066
|
}
|
|
1056
1067
|
create(e, ...t) {
|
|
1057
|
-
const r = t[0] || {}, i = `${this.service}/${e}`, s = this.errors[e], a = s ?
|
|
1058
|
-
return new
|
|
1068
|
+
const r = t[0] || {}, i = `${this.service}/${e}`, s = this.errors[e], a = s ? mr(s, r) : "Error", c = `${this.serviceName}: ${a} (${i}).`;
|
|
1069
|
+
return new M(i, c, r);
|
|
1059
1070
|
}
|
|
1060
1071
|
}
|
|
1061
|
-
function
|
|
1062
|
-
return n.replace(
|
|
1072
|
+
function mr(n, e) {
|
|
1073
|
+
return n.replace(gr, (t, r) => {
|
|
1063
1074
|
const i = e[r];
|
|
1064
1075
|
return i != null ? String(i) : `<${r}?>`;
|
|
1065
1076
|
});
|
|
1066
1077
|
}
|
|
1067
|
-
const
|
|
1068
|
-
function
|
|
1078
|
+
const gr = /\{\$([^}]+)}/g;
|
|
1079
|
+
function _r(n) {
|
|
1069
1080
|
for (const e in n)
|
|
1070
1081
|
if (Object.prototype.hasOwnProperty.call(n, e))
|
|
1071
1082
|
return !1;
|
|
1072
1083
|
return !0;
|
|
1073
1084
|
}
|
|
1074
|
-
function
|
|
1085
|
+
function he(n, e) {
|
|
1075
1086
|
if (n === e)
|
|
1076
1087
|
return !0;
|
|
1077
1088
|
const t = Object.keys(n), r = Object.keys(e);
|
|
@@ -1080,7 +1091,7 @@ function de(n, e) {
|
|
|
1080
1091
|
return !1;
|
|
1081
1092
|
const s = n[i], a = e[i];
|
|
1082
1093
|
if (ot(s) && ot(a)) {
|
|
1083
|
-
if (!
|
|
1094
|
+
if (!he(s, a))
|
|
1084
1095
|
return !1;
|
|
1085
1096
|
} else if (s !== a)
|
|
1086
1097
|
return !1;
|
|
@@ -1117,11 +1128,11 @@ function Z(n) {
|
|
|
1117
1128
|
}) : e.push(encodeURIComponent(t) + "=" + encodeURIComponent(r));
|
|
1118
1129
|
return e.length ? "&" + e.join("&") : "";
|
|
1119
1130
|
}
|
|
1120
|
-
function
|
|
1121
|
-
const t = new
|
|
1131
|
+
function yr(n, e) {
|
|
1132
|
+
const t = new vr(n, e);
|
|
1122
1133
|
return t.subscribe.bind(t);
|
|
1123
1134
|
}
|
|
1124
|
-
class
|
|
1135
|
+
class vr {
|
|
1125
1136
|
/**
|
|
1126
1137
|
* @param executor Function which can make calls to a single Observer
|
|
1127
1138
|
* as a proxy.
|
|
@@ -1159,7 +1170,7 @@ class _r {
|
|
|
1159
1170
|
let i;
|
|
1160
1171
|
if (e === void 0 && t === void 0 && r === void 0)
|
|
1161
1172
|
throw new Error("Missing Observer.");
|
|
1162
|
-
|
|
1173
|
+
br(e, [
|
|
1163
1174
|
"next",
|
|
1164
1175
|
"error",
|
|
1165
1176
|
"complete"
|
|
@@ -1167,7 +1178,7 @@ class _r {
|
|
|
1167
1178
|
next: e,
|
|
1168
1179
|
error: t,
|
|
1169
1180
|
complete: r
|
|
1170
|
-
}, i.next === void 0 && (i.next =
|
|
1181
|
+
}, i.next === void 0 && (i.next = Ae), i.error === void 0 && (i.error = Ae), i.complete === void 0 && (i.complete = Ae);
|
|
1171
1182
|
const s = this.unsubscribeOne.bind(this, this.observers.length);
|
|
1172
1183
|
return this.finalized && this.task.then(() => {
|
|
1173
1184
|
try {
|
|
@@ -1205,7 +1216,7 @@ class _r {
|
|
|
1205
1216
|
}));
|
|
1206
1217
|
}
|
|
1207
1218
|
}
|
|
1208
|
-
function
|
|
1219
|
+
function br(n, e) {
|
|
1209
1220
|
if (typeof n != "object" || n === null)
|
|
1210
1221
|
return !1;
|
|
1211
1222
|
for (const t of e)
|
|
@@ -1213,7 +1224,7 @@ function yr(n, e) {
|
|
|
1213
1224
|
return !0;
|
|
1214
1225
|
return !1;
|
|
1215
1226
|
}
|
|
1216
|
-
function
|
|
1227
|
+
function Ae() {
|
|
1217
1228
|
}
|
|
1218
1229
|
/**
|
|
1219
1230
|
* @license
|
|
@@ -1273,7 +1284,7 @@ class W {
|
|
|
1273
1284
|
* See the License for the specific language governing permissions and
|
|
1274
1285
|
* limitations under the License.
|
|
1275
1286
|
*/
|
|
1276
|
-
const
|
|
1287
|
+
const U = "[DEFAULT]";
|
|
1277
1288
|
/**
|
|
1278
1289
|
* @license
|
|
1279
1290
|
* Copyright 2019 Google LLC
|
|
@@ -1290,7 +1301,7 @@ const M = "[DEFAULT]";
|
|
|
1290
1301
|
* See the License for the specific language governing permissions and
|
|
1291
1302
|
* limitations under the License.
|
|
1292
1303
|
*/
|
|
1293
|
-
class
|
|
1304
|
+
class Ir {
|
|
1294
1305
|
constructor(e, t) {
|
|
1295
1306
|
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();
|
|
1296
1307
|
}
|
|
@@ -1301,7 +1312,7 @@ class vr {
|
|
|
1301
1312
|
get(e) {
|
|
1302
1313
|
const t = this.normalizeInstanceIdentifier(e);
|
|
1303
1314
|
if (!this.instancesDeferred.has(t)) {
|
|
1304
|
-
const r = new
|
|
1315
|
+
const r = new ar();
|
|
1305
1316
|
if (this.instancesDeferred.set(t, r), this.isInitialized(t) || this.shouldAutoInitialize())
|
|
1306
1317
|
try {
|
|
1307
1318
|
const i = this.getOrInitializeService({
|
|
@@ -1341,9 +1352,9 @@ class vr {
|
|
|
1341
1352
|
if (this.component)
|
|
1342
1353
|
throw Error(`Component for ${this.name} has already been provided`);
|
|
1343
1354
|
if (this.component = e, !!this.shouldAutoInitialize()) {
|
|
1344
|
-
if (
|
|
1355
|
+
if (Er(e))
|
|
1345
1356
|
try {
|
|
1346
|
-
this.getOrInitializeService({ instanceIdentifier:
|
|
1357
|
+
this.getOrInitializeService({ instanceIdentifier: U });
|
|
1347
1358
|
} catch {
|
|
1348
1359
|
}
|
|
1349
1360
|
for (const [t, r] of this.instancesDeferred.entries()) {
|
|
@@ -1358,7 +1369,7 @@ class vr {
|
|
|
1358
1369
|
}
|
|
1359
1370
|
}
|
|
1360
1371
|
}
|
|
1361
|
-
clearInstance(e =
|
|
1372
|
+
clearInstance(e = U) {
|
|
1362
1373
|
this.instancesDeferred.delete(e), this.instancesOptions.delete(e), this.instances.delete(e);
|
|
1363
1374
|
}
|
|
1364
1375
|
// app.delete() will call this method on every provider to delete the services
|
|
@@ -1373,10 +1384,10 @@ class vr {
|
|
|
1373
1384
|
isComponentSet() {
|
|
1374
1385
|
return this.component != null;
|
|
1375
1386
|
}
|
|
1376
|
-
isInitialized(e =
|
|
1387
|
+
isInitialized(e = U) {
|
|
1377
1388
|
return this.instances.has(e);
|
|
1378
1389
|
}
|
|
1379
|
-
getOptions(e =
|
|
1390
|
+
getOptions(e = U) {
|
|
1380
1391
|
return this.instancesOptions.get(e) || {};
|
|
1381
1392
|
}
|
|
1382
1393
|
initialize(e = {}) {
|
|
@@ -1428,7 +1439,7 @@ class vr {
|
|
|
1428
1439
|
getOrInitializeService({ instanceIdentifier: e, options: t = {} }) {
|
|
1429
1440
|
let r = this.instances.get(e);
|
|
1430
1441
|
if (!r && this.component && (r = this.component.instanceFactory(this.container, {
|
|
1431
|
-
instanceIdentifier:
|
|
1442
|
+
instanceIdentifier: wr(e),
|
|
1432
1443
|
options: t
|
|
1433
1444
|
}), this.instances.set(e, r), this.instancesOptions.set(e, t), this.invokeOnInitCallbacks(r, e), this.component.onInstanceCreated))
|
|
1434
1445
|
try {
|
|
@@ -1437,17 +1448,17 @@ class vr {
|
|
|
1437
1448
|
}
|
|
1438
1449
|
return r || null;
|
|
1439
1450
|
}
|
|
1440
|
-
normalizeInstanceIdentifier(e =
|
|
1441
|
-
return this.component ? this.component.multipleInstances ? e :
|
|
1451
|
+
normalizeInstanceIdentifier(e = U) {
|
|
1452
|
+
return this.component ? this.component.multipleInstances ? e : U : e;
|
|
1442
1453
|
}
|
|
1443
1454
|
shouldAutoInitialize() {
|
|
1444
1455
|
return !!this.component && this.component.instantiationMode !== "EXPLICIT";
|
|
1445
1456
|
}
|
|
1446
1457
|
}
|
|
1447
|
-
function
|
|
1448
|
-
return n ===
|
|
1458
|
+
function wr(n) {
|
|
1459
|
+
return n === U ? void 0 : n;
|
|
1449
1460
|
}
|
|
1450
|
-
function
|
|
1461
|
+
function Er(n) {
|
|
1451
1462
|
return n.instantiationMode === "EAGER";
|
|
1452
1463
|
}
|
|
1453
1464
|
/**
|
|
@@ -1466,7 +1477,7 @@ function Ir(n) {
|
|
|
1466
1477
|
* See the License for the specific language governing permissions and
|
|
1467
1478
|
* limitations under the License.
|
|
1468
1479
|
*/
|
|
1469
|
-
class
|
|
1480
|
+
class Tr {
|
|
1470
1481
|
constructor(e) {
|
|
1471
1482
|
this.name = e, this.providers = /* @__PURE__ */ new Map();
|
|
1472
1483
|
}
|
|
@@ -1498,7 +1509,7 @@ class wr {
|
|
|
1498
1509
|
getProvider(e) {
|
|
1499
1510
|
if (this.providers.has(e))
|
|
1500
1511
|
return this.providers.get(e);
|
|
1501
|
-
const t = new
|
|
1512
|
+
const t = new Ir(e, this);
|
|
1502
1513
|
return this.providers.set(e, t), t;
|
|
1503
1514
|
}
|
|
1504
1515
|
getProviders() {
|
|
@@ -1521,27 +1532,27 @@ class wr {
|
|
|
1521
1532
|
* See the License for the specific language governing permissions and
|
|
1522
1533
|
* limitations under the License.
|
|
1523
1534
|
*/
|
|
1524
|
-
var
|
|
1535
|
+
var p;
|
|
1525
1536
|
(function(n) {
|
|
1526
1537
|
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";
|
|
1527
|
-
})(
|
|
1528
|
-
const
|
|
1529
|
-
debug:
|
|
1530
|
-
verbose:
|
|
1531
|
-
info:
|
|
1532
|
-
warn:
|
|
1533
|
-
error:
|
|
1534
|
-
silent:
|
|
1535
|
-
},
|
|
1536
|
-
[
|
|
1537
|
-
[
|
|
1538
|
-
[
|
|
1539
|
-
[
|
|
1540
|
-
[
|
|
1541
|
-
},
|
|
1538
|
+
})(p || (p = {}));
|
|
1539
|
+
const Sr = {
|
|
1540
|
+
debug: p.DEBUG,
|
|
1541
|
+
verbose: p.VERBOSE,
|
|
1542
|
+
info: p.INFO,
|
|
1543
|
+
warn: p.WARN,
|
|
1544
|
+
error: p.ERROR,
|
|
1545
|
+
silent: p.SILENT
|
|
1546
|
+
}, kr = p.INFO, Ar = {
|
|
1547
|
+
[p.DEBUG]: "log",
|
|
1548
|
+
[p.VERBOSE]: "log",
|
|
1549
|
+
[p.INFO]: "info",
|
|
1550
|
+
[p.WARN]: "warn",
|
|
1551
|
+
[p.ERROR]: "error"
|
|
1552
|
+
}, Rr = (n, e, ...t) => {
|
|
1542
1553
|
if (e < n.logLevel)
|
|
1543
1554
|
return;
|
|
1544
|
-
const r = (/* @__PURE__ */ new Date()).toISOString(), i =
|
|
1555
|
+
const r = (/* @__PURE__ */ new Date()).toISOString(), i = Ar[e];
|
|
1545
1556
|
if (i)
|
|
1546
1557
|
console[i](`[${r}] ${n.name}:`, ...t);
|
|
1547
1558
|
else
|
|
@@ -1555,19 +1566,19 @@ class zt {
|
|
|
1555
1566
|
* @param name The name that the logs will be associated with
|
|
1556
1567
|
*/
|
|
1557
1568
|
constructor(e) {
|
|
1558
|
-
this.name = e, this._logLevel =
|
|
1569
|
+
this.name = e, this._logLevel = kr, this._logHandler = Rr, this._userLogHandler = null;
|
|
1559
1570
|
}
|
|
1560
1571
|
get logLevel() {
|
|
1561
1572
|
return this._logLevel;
|
|
1562
1573
|
}
|
|
1563
1574
|
set logLevel(e) {
|
|
1564
|
-
if (!(e in
|
|
1575
|
+
if (!(e in p))
|
|
1565
1576
|
throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);
|
|
1566
1577
|
this._logLevel = e;
|
|
1567
1578
|
}
|
|
1568
1579
|
// Workaround for setter/getter having to be the same type.
|
|
1569
1580
|
setLogLevel(e) {
|
|
1570
|
-
this._logLevel = typeof e == "string" ?
|
|
1581
|
+
this._logLevel = typeof e == "string" ? Sr[e] : e;
|
|
1571
1582
|
}
|
|
1572
1583
|
get logHandler() {
|
|
1573
1584
|
return this._logHandler;
|
|
@@ -1587,24 +1598,24 @@ class zt {
|
|
|
1587
1598
|
* The functions below are all based on the `console` interface
|
|
1588
1599
|
*/
|
|
1589
1600
|
debug(...e) {
|
|
1590
|
-
this._userLogHandler && this._userLogHandler(this,
|
|
1601
|
+
this._userLogHandler && this._userLogHandler(this, p.DEBUG, ...e), this._logHandler(this, p.DEBUG, ...e);
|
|
1591
1602
|
}
|
|
1592
1603
|
log(...e) {
|
|
1593
|
-
this._userLogHandler && this._userLogHandler(this,
|
|
1604
|
+
this._userLogHandler && this._userLogHandler(this, p.VERBOSE, ...e), this._logHandler(this, p.VERBOSE, ...e);
|
|
1594
1605
|
}
|
|
1595
1606
|
info(...e) {
|
|
1596
|
-
this._userLogHandler && this._userLogHandler(this,
|
|
1607
|
+
this._userLogHandler && this._userLogHandler(this, p.INFO, ...e), this._logHandler(this, p.INFO, ...e);
|
|
1597
1608
|
}
|
|
1598
1609
|
warn(...e) {
|
|
1599
|
-
this._userLogHandler && this._userLogHandler(this,
|
|
1610
|
+
this._userLogHandler && this._userLogHandler(this, p.WARN, ...e), this._logHandler(this, p.WARN, ...e);
|
|
1600
1611
|
}
|
|
1601
1612
|
error(...e) {
|
|
1602
|
-
this._userLogHandler && this._userLogHandler(this,
|
|
1613
|
+
this._userLogHandler && this._userLogHandler(this, p.ERROR, ...e), this._logHandler(this, p.ERROR, ...e);
|
|
1603
1614
|
}
|
|
1604
1615
|
}
|
|
1605
|
-
const
|
|
1616
|
+
const Cr = (n, e) => e.some((t) => n instanceof t);
|
|
1606
1617
|
let ct, lt;
|
|
1607
|
-
function
|
|
1618
|
+
function Pr() {
|
|
1608
1619
|
return ct || (ct = [
|
|
1609
1620
|
IDBDatabase,
|
|
1610
1621
|
IDBObjectStore,
|
|
@@ -1613,20 +1624,20 @@ function Rr() {
|
|
|
1613
1624
|
IDBTransaction
|
|
1614
1625
|
]);
|
|
1615
1626
|
}
|
|
1616
|
-
function
|
|
1627
|
+
function Or() {
|
|
1617
1628
|
return lt || (lt = [
|
|
1618
1629
|
IDBCursor.prototype.advance,
|
|
1619
1630
|
IDBCursor.prototype.continue,
|
|
1620
1631
|
IDBCursor.prototype.continuePrimaryKey
|
|
1621
1632
|
]);
|
|
1622
1633
|
}
|
|
1623
|
-
const Gt = /* @__PURE__ */ new WeakMap(),
|
|
1624
|
-
function
|
|
1634
|
+
const Gt = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap();
|
|
1635
|
+
function Dr(n) {
|
|
1625
1636
|
const e = new Promise((t, r) => {
|
|
1626
1637
|
const i = () => {
|
|
1627
1638
|
n.removeEventListener("success", s), n.removeEventListener("error", a);
|
|
1628
1639
|
}, s = () => {
|
|
1629
|
-
t(
|
|
1640
|
+
t(D(n.result)), i();
|
|
1630
1641
|
}, a = () => {
|
|
1631
1642
|
r(n.error), i();
|
|
1632
1643
|
};
|
|
@@ -1637,8 +1648,8 @@ function Pr(n) {
|
|
|
1637
1648
|
}).catch(() => {
|
|
1638
1649
|
}), Ge.set(e, n), e;
|
|
1639
1650
|
}
|
|
1640
|
-
function
|
|
1641
|
-
if (
|
|
1651
|
+
function Nr(n) {
|
|
1652
|
+
if (Ue.has(n))
|
|
1642
1653
|
return;
|
|
1643
1654
|
const e = new Promise((t, r) => {
|
|
1644
1655
|
const i = () => {
|
|
@@ -1650,19 +1661,19 @@ function Or(n) {
|
|
|
1650
1661
|
};
|
|
1651
1662
|
n.addEventListener("complete", s), n.addEventListener("error", a), n.addEventListener("abort", a);
|
|
1652
1663
|
});
|
|
1653
|
-
|
|
1664
|
+
Ue.set(n, e);
|
|
1654
1665
|
}
|
|
1655
|
-
let
|
|
1666
|
+
let xe = {
|
|
1656
1667
|
get(n, e, t) {
|
|
1657
1668
|
if (n instanceof IDBTransaction) {
|
|
1658
1669
|
if (e === "done")
|
|
1659
|
-
return
|
|
1670
|
+
return Ue.get(n);
|
|
1660
1671
|
if (e === "objectStoreNames")
|
|
1661
1672
|
return n.objectStoreNames || qt.get(n);
|
|
1662
1673
|
if (e === "store")
|
|
1663
1674
|
return t.objectStoreNames[1] ? void 0 : t.objectStore(t.objectStoreNames[0]);
|
|
1664
1675
|
}
|
|
1665
|
-
return
|
|
1676
|
+
return D(n[e]);
|
|
1666
1677
|
},
|
|
1667
1678
|
set(n, e, t) {
|
|
1668
1679
|
return n[e] = t, !0;
|
|
@@ -1671,68 +1682,68 @@ let Ue = {
|
|
|
1671
1682
|
return n instanceof IDBTransaction && (e === "done" || e === "store") ? !0 : e in n;
|
|
1672
1683
|
}
|
|
1673
1684
|
};
|
|
1674
|
-
function
|
|
1675
|
-
|
|
1685
|
+
function Lr(n) {
|
|
1686
|
+
xe = n(xe);
|
|
1676
1687
|
}
|
|
1677
|
-
function
|
|
1688
|
+
function Mr(n) {
|
|
1678
1689
|
return n === IDBDatabase.prototype.transaction && !("objectStoreNames" in IDBTransaction.prototype) ? function(e, ...t) {
|
|
1679
|
-
const r = n.call(
|
|
1680
|
-
return qt.set(r, e.sort ? e.sort() : [e]),
|
|
1681
|
-
} :
|
|
1682
|
-
return n.apply(
|
|
1690
|
+
const r = n.call(Ce(this), e, ...t);
|
|
1691
|
+
return qt.set(r, e.sort ? e.sort() : [e]), D(r);
|
|
1692
|
+
} : Or().includes(n) ? function(...e) {
|
|
1693
|
+
return n.apply(Ce(this), e), D(Gt.get(this));
|
|
1683
1694
|
} : function(...e) {
|
|
1684
|
-
return
|
|
1695
|
+
return D(n.apply(Ce(this), e));
|
|
1685
1696
|
};
|
|
1686
1697
|
}
|
|
1687
|
-
function
|
|
1688
|
-
return typeof n == "function" ?
|
|
1698
|
+
function Ur(n) {
|
|
1699
|
+
return typeof n == "function" ? Mr(n) : (n instanceof IDBTransaction && Nr(n), Cr(n, Pr()) ? new Proxy(n, xe) : n);
|
|
1689
1700
|
}
|
|
1690
|
-
function
|
|
1701
|
+
function D(n) {
|
|
1691
1702
|
if (n instanceof IDBRequest)
|
|
1692
|
-
return
|
|
1693
|
-
if (
|
|
1694
|
-
return
|
|
1695
|
-
const e =
|
|
1696
|
-
return e !== n && (
|
|
1697
|
-
}
|
|
1698
|
-
const
|
|
1699
|
-
function
|
|
1700
|
-
const a = indexedDB.open(n, e), c =
|
|
1703
|
+
return Dr(n);
|
|
1704
|
+
if (Re.has(n))
|
|
1705
|
+
return Re.get(n);
|
|
1706
|
+
const e = Ur(n);
|
|
1707
|
+
return e !== n && (Re.set(n, e), Ge.set(e, n)), e;
|
|
1708
|
+
}
|
|
1709
|
+
const Ce = (n) => Ge.get(n);
|
|
1710
|
+
function xr(n, e, { blocked: t, upgrade: r, blocking: i, terminated: s } = {}) {
|
|
1711
|
+
const a = indexedDB.open(n, e), c = D(a);
|
|
1701
1712
|
return r && a.addEventListener("upgradeneeded", (o) => {
|
|
1702
|
-
r(
|
|
1713
|
+
r(D(a.result), o.oldVersion, o.newVersion, D(a.transaction), o);
|
|
1703
1714
|
}), t && a.addEventListener("blocked", (o) => t(
|
|
1704
1715
|
// Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
|
|
1705
1716
|
o.oldVersion,
|
|
1706
1717
|
o.newVersion,
|
|
1707
1718
|
o
|
|
1708
1719
|
)), c.then((o) => {
|
|
1709
|
-
s && o.addEventListener("close", () => s()), i && o.addEventListener("versionchange", (
|
|
1720
|
+
s && o.addEventListener("close", () => s()), i && o.addEventListener("versionchange", (u) => i(u.oldVersion, u.newVersion, u));
|
|
1710
1721
|
}).catch(() => {
|
|
1711
1722
|
}), c;
|
|
1712
1723
|
}
|
|
1713
|
-
const
|
|
1724
|
+
const Fr = ["get", "getKey", "getAll", "getAllKeys", "count"], Br = ["put", "add", "delete", "clear"], Pe = /* @__PURE__ */ new Map();
|
|
1714
1725
|
function ut(n, e) {
|
|
1715
1726
|
if (!(n instanceof IDBDatabase && !(e in n) && typeof e == "string"))
|
|
1716
1727
|
return;
|
|
1717
|
-
if (
|
|
1718
|
-
return
|
|
1719
|
-
const t = e.replace(/FromIndex$/, ""), r = e !== t, i =
|
|
1728
|
+
if (Pe.get(e))
|
|
1729
|
+
return Pe.get(e);
|
|
1730
|
+
const t = e.replace(/FromIndex$/, ""), r = e !== t, i = Br.includes(t);
|
|
1720
1731
|
if (
|
|
1721
1732
|
// Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
|
|
1722
|
-
!(t in (r ? IDBIndex : IDBObjectStore).prototype) || !(i ||
|
|
1733
|
+
!(t in (r ? IDBIndex : IDBObjectStore).prototype) || !(i || Fr.includes(t))
|
|
1723
1734
|
)
|
|
1724
1735
|
return;
|
|
1725
1736
|
const s = async function(a, ...c) {
|
|
1726
1737
|
const o = this.transaction(a, i ? "readwrite" : "readonly");
|
|
1727
|
-
let
|
|
1728
|
-
return r && (
|
|
1729
|
-
|
|
1738
|
+
let u = o.store;
|
|
1739
|
+
return r && (u = u.index(c.shift())), (await Promise.all([
|
|
1740
|
+
u[t](...c),
|
|
1730
1741
|
i && o.done
|
|
1731
1742
|
]))[0];
|
|
1732
1743
|
};
|
|
1733
|
-
return
|
|
1744
|
+
return Pe.set(e, s), s;
|
|
1734
1745
|
}
|
|
1735
|
-
|
|
1746
|
+
Lr((n) => ({
|
|
1736
1747
|
...n,
|
|
1737
1748
|
get: (e, t, r) => ut(e, t) || n.get(e, t, r),
|
|
1738
1749
|
has: (e, t) => !!ut(e, t) || n.has(e, t)
|
|
@@ -1753,7 +1764,7 @@ Dr((n) => ({
|
|
|
1753
1764
|
* See the License for the specific language governing permissions and
|
|
1754
1765
|
* limitations under the License.
|
|
1755
1766
|
*/
|
|
1756
|
-
class
|
|
1767
|
+
class $r {
|
|
1757
1768
|
constructor(e) {
|
|
1758
1769
|
this.container = e;
|
|
1759
1770
|
}
|
|
@@ -1761,7 +1772,7 @@ class Fr {
|
|
|
1761
1772
|
// auth token refresh, and installations will send this string.
|
|
1762
1773
|
getPlatformInfoString() {
|
|
1763
1774
|
return this.container.getProviders().map((t) => {
|
|
1764
|
-
if (
|
|
1775
|
+
if (Hr(t)) {
|
|
1765
1776
|
const r = t.getImmediate();
|
|
1766
1777
|
return `${r.library}/${r.version}`;
|
|
1767
1778
|
} else
|
|
@@ -1769,11 +1780,11 @@ class Fr {
|
|
|
1769
1780
|
}).filter((t) => t).join(" ");
|
|
1770
1781
|
}
|
|
1771
1782
|
}
|
|
1772
|
-
function
|
|
1783
|
+
function Hr(n) {
|
|
1773
1784
|
const e = n.getComponent();
|
|
1774
1785
|
return (e == null ? void 0 : e.type) === "VERSION";
|
|
1775
1786
|
}
|
|
1776
|
-
const
|
|
1787
|
+
const Fe = "@firebase/app", dt = "0.10.13";
|
|
1777
1788
|
/**
|
|
1778
1789
|
* @license
|
|
1779
1790
|
* Copyright 2019 Google LLC
|
|
@@ -1790,7 +1801,7 @@ const xe = "@firebase/app", dt = "0.10.13";
|
|
|
1790
1801
|
* See the License for the specific language governing permissions and
|
|
1791
1802
|
* limitations under the License.
|
|
1792
1803
|
*/
|
|
1793
|
-
const
|
|
1804
|
+
const T = new zt("@firebase/app"), Vr = "@firebase/app-compat", jr = "@firebase/analytics-compat", Wr = "@firebase/analytics", zr = "@firebase/app-check-compat", Gr = "@firebase/app-check", qr = "@firebase/auth", Kr = "@firebase/auth-compat", Jr = "@firebase/database", Yr = "@firebase/data-connect", Xr = "@firebase/database-compat", Qr = "@firebase/functions", Zr = "@firebase/functions-compat", ei = "@firebase/installations", ti = "@firebase/installations-compat", ni = "@firebase/messaging", ri = "@firebase/messaging-compat", ii = "@firebase/performance", si = "@firebase/performance-compat", ai = "@firebase/remote-config", oi = "@firebase/remote-config-compat", ci = "@firebase/storage", li = "@firebase/storage-compat", ui = "@firebase/firestore", di = "@firebase/vertexai-preview", hi = "@firebase/firestore-compat", fi = "firebase", pi = "10.14.1";
|
|
1794
1805
|
/**
|
|
1795
1806
|
* @license
|
|
1796
1807
|
* Copyright 2019 Google LLC
|
|
@@ -1807,35 +1818,35 @@ const E = new zt("@firebase/app"), $r = "@firebase/app-compat", Hr = "@firebase/
|
|
|
1807
1818
|
* See the License for the specific language governing permissions and
|
|
1808
1819
|
* limitations under the License.
|
|
1809
1820
|
*/
|
|
1810
|
-
const
|
|
1811
|
-
[
|
|
1812
|
-
[
|
|
1813
|
-
[
|
|
1814
|
-
[
|
|
1815
|
-
[
|
|
1816
|
-
[
|
|
1817
|
-
[
|
|
1818
|
-
[
|
|
1819
|
-
[
|
|
1820
|
-
[
|
|
1821
|
-
[
|
|
1822
|
-
[
|
|
1823
|
-
[
|
|
1824
|
-
[
|
|
1825
|
-
[
|
|
1826
|
-
[
|
|
1827
|
-
[
|
|
1828
|
-
[
|
|
1829
|
-
[
|
|
1830
|
-
[
|
|
1831
|
-
[
|
|
1832
|
-
[
|
|
1833
|
-
[
|
|
1834
|
-
[
|
|
1835
|
-
[
|
|
1836
|
-
[
|
|
1821
|
+
const Be = "[DEFAULT]", mi = {
|
|
1822
|
+
[Fe]: "fire-core",
|
|
1823
|
+
[Vr]: "fire-core-compat",
|
|
1824
|
+
[Wr]: "fire-analytics",
|
|
1825
|
+
[jr]: "fire-analytics-compat",
|
|
1826
|
+
[Gr]: "fire-app-check",
|
|
1827
|
+
[zr]: "fire-app-check-compat",
|
|
1828
|
+
[qr]: "fire-auth",
|
|
1829
|
+
[Kr]: "fire-auth-compat",
|
|
1830
|
+
[Jr]: "fire-rtdb",
|
|
1831
|
+
[Yr]: "fire-data-connect",
|
|
1832
|
+
[Xr]: "fire-rtdb-compat",
|
|
1833
|
+
[Qr]: "fire-fn",
|
|
1834
|
+
[Zr]: "fire-fn-compat",
|
|
1835
|
+
[ei]: "fire-iid",
|
|
1836
|
+
[ti]: "fire-iid-compat",
|
|
1837
|
+
[ni]: "fire-fcm",
|
|
1838
|
+
[ri]: "fire-fcm-compat",
|
|
1839
|
+
[ii]: "fire-perf",
|
|
1840
|
+
[si]: "fire-perf-compat",
|
|
1841
|
+
[ai]: "fire-rc",
|
|
1842
|
+
[oi]: "fire-rc-compat",
|
|
1843
|
+
[ci]: "fire-gcs",
|
|
1844
|
+
[li]: "fire-gcs-compat",
|
|
1845
|
+
[ui]: "fire-fst",
|
|
1846
|
+
[hi]: "fire-fst-compat",
|
|
1847
|
+
[di]: "fire-vertex",
|
|
1837
1848
|
"fire-js": "fire-js",
|
|
1838
|
-
[
|
|
1849
|
+
[fi]: "fire-js-all"
|
|
1839
1850
|
};
|
|
1840
1851
|
/**
|
|
1841
1852
|
* @license
|
|
@@ -1853,22 +1864,22 @@ const Fe = "[DEFAULT]", fi = {
|
|
|
1853
1864
|
* See the License for the specific language governing permissions and
|
|
1854
1865
|
* limitations under the License.
|
|
1855
1866
|
*/
|
|
1856
|
-
const
|
|
1867
|
+
const fe = /* @__PURE__ */ new Map(), gi = /* @__PURE__ */ new Map(), $e = /* @__PURE__ */ new Map();
|
|
1857
1868
|
function ht(n, e) {
|
|
1858
1869
|
try {
|
|
1859
1870
|
n.container.addComponent(e);
|
|
1860
1871
|
} catch (t) {
|
|
1861
|
-
|
|
1872
|
+
T.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`, t);
|
|
1862
1873
|
}
|
|
1863
1874
|
}
|
|
1864
1875
|
function J(n) {
|
|
1865
1876
|
const e = n.name;
|
|
1866
|
-
if (
|
|
1867
|
-
return
|
|
1868
|
-
|
|
1869
|
-
for (const t of
|
|
1877
|
+
if ($e.has(e))
|
|
1878
|
+
return T.debug(`There were multiple attempts to register component ${e}.`), !1;
|
|
1879
|
+
$e.set(e, n);
|
|
1880
|
+
for (const t of fe.values())
|
|
1870
1881
|
ht(t, n);
|
|
1871
|
-
for (const t of
|
|
1882
|
+
for (const t of gi.values())
|
|
1872
1883
|
ht(t, n);
|
|
1873
1884
|
return !0;
|
|
1874
1885
|
}
|
|
@@ -1876,7 +1887,7 @@ function Kt(n, e) {
|
|
|
1876
1887
|
const t = n.container.getProvider("heartbeat").getImmediate({ optional: !0 });
|
|
1877
1888
|
return t && t.triggerHeartbeat(), n.container.getProvider(e);
|
|
1878
1889
|
}
|
|
1879
|
-
function
|
|
1890
|
+
function b(n) {
|
|
1880
1891
|
return n.settings !== void 0;
|
|
1881
1892
|
}
|
|
1882
1893
|
/**
|
|
@@ -1895,7 +1906,7 @@ function v(n) {
|
|
|
1895
1906
|
* See the License for the specific language governing permissions and
|
|
1896
1907
|
* limitations under the License.
|
|
1897
1908
|
*/
|
|
1898
|
-
const
|
|
1909
|
+
const _i = {
|
|
1899
1910
|
"no-app": "No Firebase App '{$appName}' has been created - call initializeApp() first",
|
|
1900
1911
|
"bad-app-name": "Illegal App name: '{$appName}'",
|
|
1901
1912
|
"duplicate-app": "Firebase App named '{$appName}' already exists with different options or config",
|
|
@@ -1910,7 +1921,7 @@ const mi = {
|
|
|
1910
1921
|
"idb-delete": "Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.",
|
|
1911
1922
|
"finalization-registry-not-supported": "FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.",
|
|
1912
1923
|
"invalid-server-app-environment": "FirebaseServerApp is not for use in browser environments."
|
|
1913
|
-
},
|
|
1924
|
+
}, N = new Q("app", "Firebase", _i);
|
|
1914
1925
|
/**
|
|
1915
1926
|
* @license
|
|
1916
1927
|
* Copyright 2019 Google LLC
|
|
@@ -1927,7 +1938,7 @@ const mi = {
|
|
|
1927
1938
|
* See the License for the specific language governing permissions and
|
|
1928
1939
|
* limitations under the License.
|
|
1929
1940
|
*/
|
|
1930
|
-
class
|
|
1941
|
+
class yi {
|
|
1931
1942
|
constructor(e, t, r) {
|
|
1932
1943
|
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 W(
|
|
1933
1944
|
"app",
|
|
@@ -1966,7 +1977,7 @@ class gi {
|
|
|
1966
1977
|
*/
|
|
1967
1978
|
checkDestroyed() {
|
|
1968
1979
|
if (this.isDeleted)
|
|
1969
|
-
throw
|
|
1980
|
+
throw N.create("app-deleted", { appName: this._name });
|
|
1970
1981
|
}
|
|
1971
1982
|
}
|
|
1972
1983
|
/**
|
|
@@ -1985,50 +1996,50 @@ class gi {
|
|
|
1985
1996
|
* See the License for the specific language governing permissions and
|
|
1986
1997
|
* limitations under the License.
|
|
1987
1998
|
*/
|
|
1988
|
-
const ee =
|
|
1999
|
+
const ee = pi;
|
|
1989
2000
|
function Jt(n, e = {}) {
|
|
1990
2001
|
let t = n;
|
|
1991
2002
|
typeof e != "object" && (e = { name: e });
|
|
1992
|
-
const r = Object.assign({ name:
|
|
2003
|
+
const r = Object.assign({ name: Be, automaticDataCollectionEnabled: !1 }, e), i = r.name;
|
|
1993
2004
|
if (typeof i != "string" || !i)
|
|
1994
|
-
throw
|
|
2005
|
+
throw N.create("bad-app-name", {
|
|
1995
2006
|
appName: String(i)
|
|
1996
2007
|
});
|
|
1997
2008
|
if (t || (t = jt()), !t)
|
|
1998
|
-
throw
|
|
2009
|
+
throw N.create(
|
|
1999
2010
|
"no-options"
|
|
2000
2011
|
/* AppError.NO_OPTIONS */
|
|
2001
2012
|
);
|
|
2002
|
-
const s =
|
|
2013
|
+
const s = fe.get(i);
|
|
2003
2014
|
if (s) {
|
|
2004
|
-
if (
|
|
2015
|
+
if (he(t, s.options) && he(r, s.config))
|
|
2005
2016
|
return s;
|
|
2006
|
-
throw
|
|
2017
|
+
throw N.create("duplicate-app", { appName: i });
|
|
2007
2018
|
}
|
|
2008
|
-
const a = new
|
|
2009
|
-
for (const o of
|
|
2019
|
+
const a = new Tr(i);
|
|
2020
|
+
for (const o of $e.values())
|
|
2010
2021
|
a.addComponent(o);
|
|
2011
|
-
const c = new
|
|
2012
|
-
return
|
|
2022
|
+
const c = new yi(t, r, a);
|
|
2023
|
+
return fe.set(i, c), c;
|
|
2013
2024
|
}
|
|
2014
|
-
function
|
|
2015
|
-
const e =
|
|
2016
|
-
if (!e && n ===
|
|
2025
|
+
function vi(n = Be) {
|
|
2026
|
+
const e = fe.get(n);
|
|
2027
|
+
if (!e && n === Be && jt())
|
|
2017
2028
|
return Jt();
|
|
2018
2029
|
if (!e)
|
|
2019
|
-
throw
|
|
2030
|
+
throw N.create("no-app", { appName: n });
|
|
2020
2031
|
return e;
|
|
2021
2032
|
}
|
|
2022
2033
|
function $(n, e, t) {
|
|
2023
2034
|
var r;
|
|
2024
|
-
let i = (r =
|
|
2035
|
+
let i = (r = mi[n]) !== null && r !== void 0 ? r : n;
|
|
2025
2036
|
t && (i += `-${t}`);
|
|
2026
2037
|
const s = i.match(/\s|\//), a = e.match(/\s|\//);
|
|
2027
2038
|
if (s || a) {
|
|
2028
2039
|
const c = [
|
|
2029
2040
|
`Unable to register library "${i}" with version "${e}":`
|
|
2030
2041
|
];
|
|
2031
|
-
s && c.push(`library name "${i}" contains illegal characters (whitespace or "/")`), s && a && c.push("and"), a && c.push(`version name "${e}" contains illegal characters (whitespace or "/")`),
|
|
2042
|
+
s && c.push(`library name "${i}" contains illegal characters (whitespace or "/")`), s && a && c.push("and"), a && c.push(`version name "${e}" contains illegal characters (whitespace or "/")`), T.warn(c.join(" "));
|
|
2032
2043
|
return;
|
|
2033
2044
|
}
|
|
2034
2045
|
J(new W(
|
|
@@ -2054,10 +2065,10 @@ function $(n, e, t) {
|
|
|
2054
2065
|
* See the License for the specific language governing permissions and
|
|
2055
2066
|
* limitations under the License.
|
|
2056
2067
|
*/
|
|
2057
|
-
const
|
|
2058
|
-
let
|
|
2068
|
+
const bi = "firebase-heartbeat-database", Ii = 1, Y = "firebase-heartbeat-store";
|
|
2069
|
+
let Oe = null;
|
|
2059
2070
|
function Yt() {
|
|
2060
|
-
return
|
|
2071
|
+
return Oe || (Oe = xr(bi, Ii, {
|
|
2061
2072
|
upgrade: (n, e) => {
|
|
2062
2073
|
switch (e) {
|
|
2063
2074
|
case 0:
|
|
@@ -2069,23 +2080,23 @@ function Yt() {
|
|
|
2069
2080
|
}
|
|
2070
2081
|
}
|
|
2071
2082
|
}).catch((n) => {
|
|
2072
|
-
throw
|
|
2083
|
+
throw N.create("idb-open", {
|
|
2073
2084
|
originalErrorMessage: n.message
|
|
2074
2085
|
});
|
|
2075
|
-
})),
|
|
2086
|
+
})), Oe;
|
|
2076
2087
|
}
|
|
2077
|
-
async function
|
|
2088
|
+
async function wi(n) {
|
|
2078
2089
|
try {
|
|
2079
2090
|
const t = (await Yt()).transaction(Y), r = await t.objectStore(Y).get(Xt(n));
|
|
2080
2091
|
return await t.done, r;
|
|
2081
2092
|
} catch (e) {
|
|
2082
|
-
if (e instanceof
|
|
2083
|
-
|
|
2093
|
+
if (e instanceof M)
|
|
2094
|
+
T.warn(e.message);
|
|
2084
2095
|
else {
|
|
2085
|
-
const t =
|
|
2096
|
+
const t = N.create("idb-get", {
|
|
2086
2097
|
originalErrorMessage: e == null ? void 0 : e.message
|
|
2087
2098
|
});
|
|
2088
|
-
|
|
2099
|
+
T.warn(t.message);
|
|
2089
2100
|
}
|
|
2090
2101
|
}
|
|
2091
2102
|
}
|
|
@@ -2094,13 +2105,13 @@ async function ft(n, e) {
|
|
|
2094
2105
|
const r = (await Yt()).transaction(Y, "readwrite");
|
|
2095
2106
|
await r.objectStore(Y).put(e, Xt(n)), await r.done;
|
|
2096
2107
|
} catch (t) {
|
|
2097
|
-
if (t instanceof
|
|
2098
|
-
|
|
2108
|
+
if (t instanceof M)
|
|
2109
|
+
T.warn(t.message);
|
|
2099
2110
|
else {
|
|
2100
|
-
const r =
|
|
2111
|
+
const r = N.create("idb-set", {
|
|
2101
2112
|
originalErrorMessage: t == null ? void 0 : t.message
|
|
2102
2113
|
});
|
|
2103
|
-
|
|
2114
|
+
T.warn(r.message);
|
|
2104
2115
|
}
|
|
2105
2116
|
}
|
|
2106
2117
|
}
|
|
@@ -2123,12 +2134,12 @@ function Xt(n) {
|
|
|
2123
2134
|
* See the License for the specific language governing permissions and
|
|
2124
2135
|
* limitations under the License.
|
|
2125
2136
|
*/
|
|
2126
|
-
const
|
|
2127
|
-
class
|
|
2137
|
+
const Ei = 1024, Ti = 30 * 24 * 60 * 60 * 1e3;
|
|
2138
|
+
class Si {
|
|
2128
2139
|
constructor(e) {
|
|
2129
2140
|
this.container = e, this._heartbeatsCache = null;
|
|
2130
2141
|
const t = this.container.getProvider("app").getImmediate();
|
|
2131
|
-
this._storage = new
|
|
2142
|
+
this._storage = new Ai(t), this._heartbeatsCachePromise = this._storage.read().then((r) => (this._heartbeatsCache = r, r));
|
|
2132
2143
|
}
|
|
2133
2144
|
/**
|
|
2134
2145
|
* Called to report a heartbeat. The function will generate
|
|
@@ -2143,10 +2154,10 @@ class Ei {
|
|
|
2143
2154
|
const i = this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(), s = pt();
|
|
2144
2155
|
return ((e = this._heartbeatsCache) === null || e === void 0 ? void 0 : e.heartbeats) == null && (this._heartbeatsCache = await this._heartbeatsCachePromise, ((t = this._heartbeatsCache) === null || t === void 0 ? void 0 : t.heartbeats) == null) || this._heartbeatsCache.lastSentHeartbeatDate === s || this._heartbeatsCache.heartbeats.some((a) => a.date === s) ? void 0 : (this._heartbeatsCache.heartbeats.push({ date: s, agent: i }), this._heartbeatsCache.heartbeats = this._heartbeatsCache.heartbeats.filter((a) => {
|
|
2145
2156
|
const c = new Date(a.date).valueOf();
|
|
2146
|
-
return Date.now() - c <=
|
|
2157
|
+
return Date.now() - c <= Ti;
|
|
2147
2158
|
}), this._storage.overwrite(this._heartbeatsCache));
|
|
2148
2159
|
} catch (r) {
|
|
2149
|
-
|
|
2160
|
+
T.warn(r);
|
|
2150
2161
|
}
|
|
2151
2162
|
}
|
|
2152
2163
|
/**
|
|
@@ -2161,17 +2172,17 @@ class Ei {
|
|
|
2161
2172
|
try {
|
|
2162
2173
|
if (this._heartbeatsCache === null && await this._heartbeatsCachePromise, ((e = this._heartbeatsCache) === null || e === void 0 ? void 0 : e.heartbeats) == null || this._heartbeatsCache.heartbeats.length === 0)
|
|
2163
2174
|
return "";
|
|
2164
|
-
const t = pt(), { heartbeatsToSend: r, unsentEntries: i } =
|
|
2175
|
+
const t = pt(), { heartbeatsToSend: r, unsentEntries: i } = ki(this._heartbeatsCache.heartbeats), s = de(JSON.stringify({ version: 2, heartbeats: r }));
|
|
2165
2176
|
return this._heartbeatsCache.lastSentHeartbeatDate = t, i.length > 0 ? (this._heartbeatsCache.heartbeats = i, await this._storage.overwrite(this._heartbeatsCache)) : (this._heartbeatsCache.heartbeats = [], this._storage.overwrite(this._heartbeatsCache)), s;
|
|
2166
2177
|
} catch (t) {
|
|
2167
|
-
return
|
|
2178
|
+
return T.warn(t), "";
|
|
2168
2179
|
}
|
|
2169
2180
|
}
|
|
2170
2181
|
}
|
|
2171
2182
|
function pt() {
|
|
2172
2183
|
return (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
|
|
2173
2184
|
}
|
|
2174
|
-
function
|
|
2185
|
+
function ki(n, e = Ei) {
|
|
2175
2186
|
const t = [];
|
|
2176
2187
|
let r = n.slice();
|
|
2177
2188
|
for (const i of n) {
|
|
@@ -2195,19 +2206,19 @@ function Ti(n, e = Ii) {
|
|
|
2195
2206
|
unsentEntries: r
|
|
2196
2207
|
};
|
|
2197
2208
|
}
|
|
2198
|
-
class
|
|
2209
|
+
class Ai {
|
|
2199
2210
|
constructor(e) {
|
|
2200
2211
|
this.app = e, this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();
|
|
2201
2212
|
}
|
|
2202
2213
|
async runIndexedDBEnvironmentCheck() {
|
|
2203
|
-
return
|
|
2214
|
+
return hr() ? fr().then(() => !0).catch(() => !1) : !1;
|
|
2204
2215
|
}
|
|
2205
2216
|
/**
|
|
2206
2217
|
* Read all heartbeats.
|
|
2207
2218
|
*/
|
|
2208
2219
|
async read() {
|
|
2209
2220
|
if (await this._canUseIndexedDBPromise) {
|
|
2210
|
-
const t = await
|
|
2221
|
+
const t = await wi(this.app);
|
|
2211
2222
|
return t != null && t.heartbeats ? t : { heartbeats: [] };
|
|
2212
2223
|
} else
|
|
2213
2224
|
return { heartbeats: [] };
|
|
@@ -2241,7 +2252,7 @@ class Si {
|
|
|
2241
2252
|
}
|
|
2242
2253
|
}
|
|
2243
2254
|
function mt(n) {
|
|
2244
|
-
return
|
|
2255
|
+
return de(
|
|
2245
2256
|
// heartbeatsCache wrapper properties
|
|
2246
2257
|
JSON.stringify({ version: 2, heartbeats: n })
|
|
2247
2258
|
).length;
|
|
@@ -2262,21 +2273,21 @@ function mt(n) {
|
|
|
2262
2273
|
* See the License for the specific language governing permissions and
|
|
2263
2274
|
* limitations under the License.
|
|
2264
2275
|
*/
|
|
2265
|
-
function
|
|
2276
|
+
function Ri(n) {
|
|
2266
2277
|
J(new W(
|
|
2267
2278
|
"platform-logger",
|
|
2268
|
-
(e) => new
|
|
2279
|
+
(e) => new $r(e),
|
|
2269
2280
|
"PRIVATE"
|
|
2270
2281
|
/* ComponentType.PRIVATE */
|
|
2271
2282
|
)), J(new W(
|
|
2272
2283
|
"heartbeat",
|
|
2273
|
-
(e) => new
|
|
2284
|
+
(e) => new Si(e),
|
|
2274
2285
|
"PRIVATE"
|
|
2275
2286
|
/* ComponentType.PRIVATE */
|
|
2276
|
-
)), $(
|
|
2287
|
+
)), $(Fe, dt, n), $(Fe, dt, "esm2017"), $("fire-js", "");
|
|
2277
2288
|
}
|
|
2278
|
-
|
|
2279
|
-
var
|
|
2289
|
+
Ri("");
|
|
2290
|
+
var Ci = "firebase", Pi = "10.14.1";
|
|
2280
2291
|
/**
|
|
2281
2292
|
* @license
|
|
2282
2293
|
* Copyright 2020 Google LLC
|
|
@@ -2293,7 +2304,7 @@ var Ai = "firebase", Ri = "10.14.1";
|
|
|
2293
2304
|
* See the License for the specific language governing permissions and
|
|
2294
2305
|
* limitations under the License.
|
|
2295
2306
|
*/
|
|
2296
|
-
$(
|
|
2307
|
+
$(Ci, Pi, "app");
|
|
2297
2308
|
var gt = function() {
|
|
2298
2309
|
return gt = Object.assign || function(e) {
|
|
2299
2310
|
for (var t, r = 1, i = arguments.length; r < i; r++) {
|
|
@@ -2316,7 +2327,7 @@ function Qt() {
|
|
|
2316
2327
|
"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."
|
|
2317
2328
|
};
|
|
2318
2329
|
}
|
|
2319
|
-
const
|
|
2330
|
+
const Oi = Qt, Zt = new Q("auth", "Firebase", Qt());
|
|
2320
2331
|
/**
|
|
2321
2332
|
* @license
|
|
2322
2333
|
* Copyright 2020 Google LLC
|
|
@@ -2333,12 +2344,12 @@ const Ci = Qt, Zt = new Q("auth", "Firebase", Qt());
|
|
|
2333
2344
|
* See the License for the specific language governing permissions and
|
|
2334
2345
|
* limitations under the License.
|
|
2335
2346
|
*/
|
|
2336
|
-
const
|
|
2337
|
-
function
|
|
2338
|
-
|
|
2347
|
+
const pe = new zt("@firebase/auth");
|
|
2348
|
+
function Di(n, ...e) {
|
|
2349
|
+
pe.logLevel <= p.WARN && pe.warn(`Auth (${ee}): ${n}`, ...e);
|
|
2339
2350
|
}
|
|
2340
2351
|
function se(n, ...e) {
|
|
2341
|
-
|
|
2352
|
+
pe.logLevel <= p.ERROR && pe.error(`Auth (${ee}): ${n}`, ...e);
|
|
2342
2353
|
}
|
|
2343
2354
|
/**
|
|
2344
2355
|
* @license
|
|
@@ -2356,19 +2367,19 @@ function se(n, ...e) {
|
|
|
2356
2367
|
* See the License for the specific language governing permissions and
|
|
2357
2368
|
* limitations under the License.
|
|
2358
2369
|
*/
|
|
2359
|
-
function
|
|
2370
|
+
function S(n, ...e) {
|
|
2360
2371
|
throw Ke(n, ...e);
|
|
2361
2372
|
}
|
|
2362
2373
|
function _(n, ...e) {
|
|
2363
2374
|
return Ke(n, ...e);
|
|
2364
2375
|
}
|
|
2365
2376
|
function en(n, e, t) {
|
|
2366
|
-
const r = Object.assign(Object.assign({},
|
|
2377
|
+
const r = Object.assign(Object.assign({}, Oi()), { [e]: t });
|
|
2367
2378
|
return new Q("auth", "Firebase", r).create(e, {
|
|
2368
2379
|
appName: n.name
|
|
2369
2380
|
});
|
|
2370
2381
|
}
|
|
2371
|
-
function
|
|
2382
|
+
function L(n) {
|
|
2372
2383
|
return en(n, "operation-not-supported-in-this-environment", "Operations that alter the current user are not supported in conjunction with FirebaseServerApp");
|
|
2373
2384
|
}
|
|
2374
2385
|
function Ke(n, ...e) {
|
|
@@ -2378,16 +2389,16 @@ function Ke(n, ...e) {
|
|
|
2378
2389
|
}
|
|
2379
2390
|
return Zt.create(n, ...e);
|
|
2380
2391
|
}
|
|
2381
|
-
function
|
|
2392
|
+
function h(n, e, ...t) {
|
|
2382
2393
|
if (!n)
|
|
2383
2394
|
throw Ke(e, ...t);
|
|
2384
2395
|
}
|
|
2385
|
-
function
|
|
2396
|
+
function I(n) {
|
|
2386
2397
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
2387
2398
|
throw se(e), new Error(e);
|
|
2388
2399
|
}
|
|
2389
|
-
function
|
|
2390
|
-
n ||
|
|
2400
|
+
function k(n, e) {
|
|
2401
|
+
n || I(e);
|
|
2391
2402
|
}
|
|
2392
2403
|
/**
|
|
2393
2404
|
* @license
|
|
@@ -2405,11 +2416,11 @@ function S(n, e) {
|
|
|
2405
2416
|
* See the License for the specific language governing permissions and
|
|
2406
2417
|
* limitations under the License.
|
|
2407
2418
|
*/
|
|
2408
|
-
function
|
|
2419
|
+
function He() {
|
|
2409
2420
|
var n;
|
|
2410
2421
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
2411
2422
|
}
|
|
2412
|
-
function
|
|
2423
|
+
function Ni() {
|
|
2413
2424
|
return _t() === "http:" || _t() === "https:";
|
|
2414
2425
|
}
|
|
2415
2426
|
function _t() {
|
|
@@ -2432,15 +2443,15 @@ function _t() {
|
|
|
2432
2443
|
* See the License for the specific language governing permissions and
|
|
2433
2444
|
* limitations under the License.
|
|
2434
2445
|
*/
|
|
2435
|
-
function
|
|
2446
|
+
function Li() {
|
|
2436
2447
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
2437
2448
|
// This is especially true for Cordova apps which have unreliable
|
|
2438
2449
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
2439
2450
|
// installed which overwrites the native navigator.onLine value and
|
|
2440
2451
|
// defines navigator.connection.
|
|
2441
|
-
(
|
|
2452
|
+
(Ni() || lr() || "connection" in navigator) ? navigator.onLine : !0;
|
|
2442
2453
|
}
|
|
2443
|
-
function
|
|
2454
|
+
function Mi() {
|
|
2444
2455
|
if (typeof navigator > "u")
|
|
2445
2456
|
return null;
|
|
2446
2457
|
const n = navigator;
|
|
@@ -2470,10 +2481,10 @@ function Ni() {
|
|
|
2470
2481
|
*/
|
|
2471
2482
|
class te {
|
|
2472
2483
|
constructor(e, t) {
|
|
2473
|
-
this.shortDelay = e, this.longDelay = t,
|
|
2484
|
+
this.shortDelay = e, this.longDelay = t, k(t > e, "Short delay should be less than long delay!"), this.isMobile = or() || ur();
|
|
2474
2485
|
}
|
|
2475
2486
|
get() {
|
|
2476
|
-
return
|
|
2487
|
+
return Li() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
2477
2488
|
}
|
|
2478
2489
|
}
|
|
2479
2490
|
/**
|
|
@@ -2493,7 +2504,7 @@ class te {
|
|
|
2493
2504
|
* limitations under the License.
|
|
2494
2505
|
*/
|
|
2495
2506
|
function Je(n, e) {
|
|
2496
|
-
|
|
2507
|
+
k(n.emulator, "Emulator should always be set here");
|
|
2497
2508
|
const { url: t } = n.emulator;
|
|
2498
2509
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
2499
2510
|
}
|
|
@@ -2526,7 +2537,7 @@ class tn {
|
|
|
2526
2537
|
return globalThis.fetch;
|
|
2527
2538
|
if (typeof fetch < "u")
|
|
2528
2539
|
return fetch;
|
|
2529
|
-
|
|
2540
|
+
I("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
2530
2541
|
}
|
|
2531
2542
|
static headers() {
|
|
2532
2543
|
if (this.headersImpl)
|
|
@@ -2537,7 +2548,7 @@ class tn {
|
|
|
2537
2548
|
return globalThis.Headers;
|
|
2538
2549
|
if (typeof Headers < "u")
|
|
2539
2550
|
return Headers;
|
|
2540
|
-
|
|
2551
|
+
I("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
2541
2552
|
}
|
|
2542
2553
|
static response() {
|
|
2543
2554
|
if (this.responseImpl)
|
|
@@ -2548,7 +2559,7 @@ class tn {
|
|
|
2548
2559
|
return globalThis.Response;
|
|
2549
2560
|
if (typeof Response < "u")
|
|
2550
2561
|
return Response;
|
|
2551
|
-
|
|
2562
|
+
I("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
2552
2563
|
}
|
|
2553
2564
|
}
|
|
2554
2565
|
/**
|
|
@@ -2567,7 +2578,7 @@ class tn {
|
|
|
2567
2578
|
* See the License for the specific language governing permissions and
|
|
2568
2579
|
* limitations under the License.
|
|
2569
2580
|
*/
|
|
2570
|
-
const
|
|
2581
|
+
const Ui = {
|
|
2571
2582
|
// Custom token errors.
|
|
2572
2583
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
2573
2584
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -2658,8 +2669,8 @@ const Li = {
|
|
|
2658
2669
|
* See the License for the specific language governing permissions and
|
|
2659
2670
|
* limitations under the License.
|
|
2660
2671
|
*/
|
|
2661
|
-
const
|
|
2662
|
-
function
|
|
2672
|
+
const xi = new te(3e4, 6e4);
|
|
2673
|
+
function ve(n, e) {
|
|
2663
2674
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
2664
2675
|
}
|
|
2665
2676
|
async function G(n, e, t, r, i = {}) {
|
|
@@ -2676,18 +2687,18 @@ async function G(n, e, t, r, i = {}) {
|
|
|
2676
2687
|
"X-Firebase-Locale"
|
|
2677
2688
|
/* HttpHeader.X_FIREBASE_LOCALE */
|
|
2678
2689
|
] = n.languageCode);
|
|
2679
|
-
const
|
|
2690
|
+
const u = Object.assign({
|
|
2680
2691
|
method: e,
|
|
2681
2692
|
headers: o
|
|
2682
2693
|
}, s);
|
|
2683
|
-
return
|
|
2694
|
+
return cr() || (u.referrerPolicy = "no-referrer"), tn.fetch()(sn(n, n.config.apiHost, t, c), u);
|
|
2684
2695
|
});
|
|
2685
2696
|
}
|
|
2686
2697
|
async function nn(n, e, t) {
|
|
2687
2698
|
n._canInitEmulator = !1;
|
|
2688
|
-
const r = Object.assign(Object.assign({},
|
|
2699
|
+
const r = Object.assign(Object.assign({}, Ui), e);
|
|
2689
2700
|
try {
|
|
2690
|
-
const i = new
|
|
2701
|
+
const i = new Fi(n), s = await Promise.race([
|
|
2691
2702
|
t(),
|
|
2692
2703
|
i.promise
|
|
2693
2704
|
]);
|
|
@@ -2698,27 +2709,27 @@ async function nn(n, e, t) {
|
|
|
2698
2709
|
if (s.ok && !("errorMessage" in a))
|
|
2699
2710
|
return a;
|
|
2700
2711
|
{
|
|
2701
|
-
const c = s.ok ? a.errorMessage : a.error.message, [o,
|
|
2712
|
+
const c = s.ok ? a.errorMessage : a.error.message, [o, u] = c.split(" : ");
|
|
2702
2713
|
if (o === "FEDERATED_USER_ID_ALREADY_LINKED")
|
|
2703
2714
|
throw ie(n, "credential-already-in-use", a);
|
|
2704
2715
|
if (o === "EMAIL_EXISTS")
|
|
2705
2716
|
throw ie(n, "email-already-in-use", a);
|
|
2706
2717
|
if (o === "USER_DISABLED")
|
|
2707
2718
|
throw ie(n, "user-disabled", a);
|
|
2708
|
-
const
|
|
2709
|
-
if (
|
|
2710
|
-
throw en(n,
|
|
2711
|
-
|
|
2719
|
+
const l = r[o] || o.toLowerCase().replace(/[_\s]+/g, "-");
|
|
2720
|
+
if (u)
|
|
2721
|
+
throw en(n, l, u);
|
|
2722
|
+
S(n, l);
|
|
2712
2723
|
}
|
|
2713
2724
|
} catch (i) {
|
|
2714
|
-
if (i instanceof
|
|
2725
|
+
if (i instanceof M)
|
|
2715
2726
|
throw i;
|
|
2716
|
-
|
|
2727
|
+
S(n, "network-request-failed", { message: String(i) });
|
|
2717
2728
|
}
|
|
2718
2729
|
}
|
|
2719
2730
|
async function rn(n, e, t, r, i = {}) {
|
|
2720
2731
|
const s = await G(n, e, t, r, i);
|
|
2721
|
-
return "mfaPendingCredential" in s &&
|
|
2732
|
+
return "mfaPendingCredential" in s && S(n, "multi-factor-auth-required", {
|
|
2722
2733
|
_serverResponse: s
|
|
2723
2734
|
}), s;
|
|
2724
2735
|
}
|
|
@@ -2726,14 +2737,14 @@ function sn(n, e, t, r) {
|
|
|
2726
2737
|
const i = `${e}${t}?${r}`;
|
|
2727
2738
|
return n.config.emulator ? Je(n.config, i) : `${n.config.apiScheme}://${i}`;
|
|
2728
2739
|
}
|
|
2729
|
-
class
|
|
2740
|
+
class Fi {
|
|
2730
2741
|
constructor(e) {
|
|
2731
2742
|
this.auth = e, this.timer = null, this.promise = new Promise((t, r) => {
|
|
2732
2743
|
this.timer = setTimeout(() => r(_(
|
|
2733
2744
|
this.auth,
|
|
2734
2745
|
"network-request-failed"
|
|
2735
2746
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
2736
|
-
)),
|
|
2747
|
+
)), xi.get());
|
|
2737
2748
|
});
|
|
2738
2749
|
}
|
|
2739
2750
|
clearNetworkTimeout() {
|
|
@@ -2764,7 +2775,7 @@ function ie(n, e, t) {
|
|
|
2764
2775
|
* See the License for the specific language governing permissions and
|
|
2765
2776
|
* limitations under the License.
|
|
2766
2777
|
*/
|
|
2767
|
-
async function
|
|
2778
|
+
async function Bi(n, e) {
|
|
2768
2779
|
return G(n, "POST", "/v1/accounts:delete", e);
|
|
2769
2780
|
}
|
|
2770
2781
|
async function an(n, e) {
|
|
@@ -2795,9 +2806,9 @@ function K(n) {
|
|
|
2795
2806
|
} catch {
|
|
2796
2807
|
}
|
|
2797
2808
|
}
|
|
2798
|
-
async function
|
|
2809
|
+
async function $i(n, e = !1) {
|
|
2799
2810
|
const t = z(n), r = await t.getIdToken(e), i = Ye(r);
|
|
2800
|
-
|
|
2811
|
+
h(
|
|
2801
2812
|
i && i.exp && i.auth_time && i.iat,
|
|
2802
2813
|
t.auth,
|
|
2803
2814
|
"internal-error"
|
|
@@ -2807,14 +2818,14 @@ async function Fi(n, e = !1) {
|
|
|
2807
2818
|
return {
|
|
2808
2819
|
claims: i,
|
|
2809
2820
|
token: r,
|
|
2810
|
-
authTime: K(
|
|
2811
|
-
issuedAtTime: K(
|
|
2812
|
-
expirationTime: K(
|
|
2821
|
+
authTime: K(De(i.auth_time)),
|
|
2822
|
+
issuedAtTime: K(De(i.iat)),
|
|
2823
|
+
expirationTime: K(De(i.exp)),
|
|
2813
2824
|
signInProvider: a || null,
|
|
2814
2825
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
|
2815
2826
|
};
|
|
2816
2827
|
}
|
|
2817
|
-
function
|
|
2828
|
+
function De(n) {
|
|
2818
2829
|
return Number(n) * 1e3;
|
|
2819
2830
|
}
|
|
2820
2831
|
function Ye(n) {
|
|
@@ -2830,15 +2841,15 @@ function Ye(n) {
|
|
|
2830
2841
|
}
|
|
2831
2842
|
function yt(n) {
|
|
2832
2843
|
const e = Ye(n);
|
|
2833
|
-
return
|
|
2844
|
+
return h(
|
|
2834
2845
|
e,
|
|
2835
2846
|
"internal-error"
|
|
2836
2847
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
2837
|
-
),
|
|
2848
|
+
), h(
|
|
2838
2849
|
typeof e.exp < "u",
|
|
2839
2850
|
"internal-error"
|
|
2840
2851
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
2841
|
-
),
|
|
2852
|
+
), h(
|
|
2842
2853
|
typeof e.iat < "u",
|
|
2843
2854
|
"internal-error"
|
|
2844
2855
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -2866,10 +2877,10 @@ async function X(n, e, t = !1) {
|
|
|
2866
2877
|
try {
|
|
2867
2878
|
return await e;
|
|
2868
2879
|
} catch (r) {
|
|
2869
|
-
throw r instanceof
|
|
2880
|
+
throw r instanceof M && Hi(r) && n.auth.currentUser === n && await n.auth.signOut(), r;
|
|
2870
2881
|
}
|
|
2871
2882
|
}
|
|
2872
|
-
function
|
|
2883
|
+
function Hi({ code: n }) {
|
|
2873
2884
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
2874
2885
|
}
|
|
2875
2886
|
/**
|
|
@@ -2888,7 +2899,7 @@ function Bi({ code: n }) {
|
|
|
2888
2899
|
* See the License for the specific language governing permissions and
|
|
2889
2900
|
* limitations under the License.
|
|
2890
2901
|
*/
|
|
2891
|
-
class
|
|
2902
|
+
class Vi {
|
|
2892
2903
|
constructor(e) {
|
|
2893
2904
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
2894
2905
|
}
|
|
@@ -2950,7 +2961,7 @@ class $i {
|
|
|
2950
2961
|
* See the License for the specific language governing permissions and
|
|
2951
2962
|
* limitations under the License.
|
|
2952
2963
|
*/
|
|
2953
|
-
class
|
|
2964
|
+
class Ve {
|
|
2954
2965
|
constructor(e, t) {
|
|
2955
2966
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
2956
2967
|
}
|
|
@@ -2983,10 +2994,10 @@ class He {
|
|
|
2983
2994
|
* See the License for the specific language governing permissions and
|
|
2984
2995
|
* limitations under the License.
|
|
2985
2996
|
*/
|
|
2986
|
-
async function
|
|
2997
|
+
async function me(n) {
|
|
2987
2998
|
var e;
|
|
2988
2999
|
const t = n.auth, r = await n.getIdToken(), i = await X(n, an(t, { idToken: r }));
|
|
2989
|
-
|
|
3000
|
+
h(
|
|
2990
3001
|
i == null ? void 0 : i.users.length,
|
|
2991
3002
|
t,
|
|
2992
3003
|
"internal-error"
|
|
@@ -2994,7 +3005,7 @@ async function pe(n) {
|
|
|
2994
3005
|
);
|
|
2995
3006
|
const s = i.users[0];
|
|
2996
3007
|
n._notifyReloadListener(s);
|
|
2997
|
-
const a = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? on(s.providerUserInfo) : [], c =
|
|
3008
|
+
const a = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? on(s.providerUserInfo) : [], c = Wi(n.providerData, a), o = n.isAnonymous, u = !(n.email && s.passwordHash) && !(c != null && c.length), l = o ? u : !1, d = {
|
|
2998
3009
|
uid: s.localId,
|
|
2999
3010
|
displayName: s.displayName || null,
|
|
3000
3011
|
photoURL: s.photoUrl || null,
|
|
@@ -3003,16 +3014,16 @@ async function pe(n) {
|
|
|
3003
3014
|
phoneNumber: s.phoneNumber || null,
|
|
3004
3015
|
tenantId: s.tenantId || null,
|
|
3005
3016
|
providerData: c,
|
|
3006
|
-
metadata: new
|
|
3007
|
-
isAnonymous:
|
|
3017
|
+
metadata: new Ve(s.createdAt, s.lastLoginAt),
|
|
3018
|
+
isAnonymous: l
|
|
3008
3019
|
};
|
|
3009
|
-
Object.assign(n,
|
|
3020
|
+
Object.assign(n, d);
|
|
3010
3021
|
}
|
|
3011
|
-
async function
|
|
3022
|
+
async function ji(n) {
|
|
3012
3023
|
const e = z(n);
|
|
3013
|
-
await
|
|
3024
|
+
await me(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
3014
3025
|
}
|
|
3015
|
-
function
|
|
3026
|
+
function Wi(n, e) {
|
|
3016
3027
|
return [...n.filter((r) => !e.some((i) => i.providerId === r.providerId)), ...e];
|
|
3017
3028
|
}
|
|
3018
3029
|
function on(n) {
|
|
@@ -3044,7 +3055,7 @@ function on(n) {
|
|
|
3044
3055
|
* See the License for the specific language governing permissions and
|
|
3045
3056
|
* limitations under the License.
|
|
3046
3057
|
*/
|
|
3047
|
-
async function
|
|
3058
|
+
async function zi(n, e) {
|
|
3048
3059
|
const t = await nn(n, {}, async () => {
|
|
3049
3060
|
const r = Z({
|
|
3050
3061
|
grant_type: "refresh_token",
|
|
@@ -3065,8 +3076,8 @@ async function ji(n, e) {
|
|
|
3065
3076
|
refreshToken: t.refresh_token
|
|
3066
3077
|
};
|
|
3067
3078
|
}
|
|
3068
|
-
async function
|
|
3069
|
-
return G(n, "POST", "/v2/accounts:revokeToken",
|
|
3079
|
+
async function Gi(n, e) {
|
|
3080
|
+
return G(n, "POST", "/v2/accounts:revokeToken", ve(n, e));
|
|
3070
3081
|
}
|
|
3071
3082
|
/**
|
|
3072
3083
|
* @license
|
|
@@ -3092,15 +3103,15 @@ class H {
|
|
|
3092
3103
|
return !this.expirationTime || Date.now() > this.expirationTime - 3e4;
|
|
3093
3104
|
}
|
|
3094
3105
|
updateFromServerResponse(e) {
|
|
3095
|
-
|
|
3106
|
+
h(
|
|
3096
3107
|
e.idToken,
|
|
3097
3108
|
"internal-error"
|
|
3098
3109
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3099
|
-
),
|
|
3110
|
+
), h(
|
|
3100
3111
|
typeof e.idToken < "u",
|
|
3101
3112
|
"internal-error"
|
|
3102
3113
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3103
|
-
),
|
|
3114
|
+
), h(
|
|
3104
3115
|
typeof e.refreshToken < "u",
|
|
3105
3116
|
"internal-error"
|
|
3106
3117
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -3109,7 +3120,7 @@ class H {
|
|
|
3109
3120
|
this.updateTokensAndExpiration(e.idToken, e.refreshToken, t);
|
|
3110
3121
|
}
|
|
3111
3122
|
updateFromIdToken(e) {
|
|
3112
|
-
|
|
3123
|
+
h(
|
|
3113
3124
|
e.length !== 0,
|
|
3114
3125
|
"internal-error"
|
|
3115
3126
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -3118,7 +3129,7 @@ class H {
|
|
|
3118
3129
|
this.updateTokensAndExpiration(e, null, t);
|
|
3119
3130
|
}
|
|
3120
3131
|
async getToken(e, t = !1) {
|
|
3121
|
-
return !t && this.accessToken && !this.isExpired ? this.accessToken : (
|
|
3132
|
+
return !t && this.accessToken && !this.isExpired ? this.accessToken : (h(
|
|
3122
3133
|
this.refreshToken,
|
|
3123
3134
|
e,
|
|
3124
3135
|
"user-token-expired"
|
|
@@ -3129,7 +3140,7 @@ class H {
|
|
|
3129
3140
|
this.refreshToken = null;
|
|
3130
3141
|
}
|
|
3131
3142
|
async refresh(e, t) {
|
|
3132
|
-
const { accessToken: r, refreshToken: i, expiresIn: s } = await
|
|
3143
|
+
const { accessToken: r, refreshToken: i, expiresIn: s } = await zi(e, t);
|
|
3133
3144
|
this.updateTokensAndExpiration(r, i, Number(s));
|
|
3134
3145
|
}
|
|
3135
3146
|
updateTokensAndExpiration(e, t, r) {
|
|
@@ -3137,11 +3148,11 @@ class H {
|
|
|
3137
3148
|
}
|
|
3138
3149
|
static fromJSON(e, t) {
|
|
3139
3150
|
const { refreshToken: r, accessToken: i, expirationTime: s } = t, a = new H();
|
|
3140
|
-
return r && (
|
|
3151
|
+
return r && (h(typeof r == "string", "internal-error", {
|
|
3141
3152
|
appName: e
|
|
3142
|
-
}), a.refreshToken = r), i && (
|
|
3153
|
+
}), a.refreshToken = r), i && (h(typeof i == "string", "internal-error", {
|
|
3143
3154
|
appName: e
|
|
3144
|
-
}), a.accessToken = i), s && (
|
|
3155
|
+
}), a.accessToken = i), s && (h(typeof s == "number", "internal-error", {
|
|
3145
3156
|
appName: e
|
|
3146
3157
|
}), a.expirationTime = s), a;
|
|
3147
3158
|
}
|
|
@@ -3159,7 +3170,7 @@ class H {
|
|
|
3159
3170
|
return Object.assign(new H(), this.toJSON());
|
|
3160
3171
|
}
|
|
3161
3172
|
_performRefresh() {
|
|
3162
|
-
return
|
|
3173
|
+
return I("not implemented");
|
|
3163
3174
|
}
|
|
3164
3175
|
}
|
|
3165
3176
|
/**
|
|
@@ -3178,17 +3189,17 @@ class H {
|
|
|
3178
3189
|
* See the License for the specific language governing permissions and
|
|
3179
3190
|
* limitations under the License.
|
|
3180
3191
|
*/
|
|
3181
|
-
function
|
|
3182
|
-
|
|
3192
|
+
function A(n, e) {
|
|
3193
|
+
h(typeof n == "string" || typeof n > "u", "internal-error", { appName: e });
|
|
3183
3194
|
}
|
|
3184
|
-
class
|
|
3195
|
+
class w {
|
|
3185
3196
|
constructor(e) {
|
|
3186
3197
|
var { uid: t, auth: r, stsTokenManager: i } = e, s = qe(e, ["uid", "auth", "stsTokenManager"]);
|
|
3187
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
3198
|
+
this.providerId = "firebase", this.proactiveRefresh = new Vi(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 Ve(s.createdAt || void 0, s.lastLoginAt || void 0);
|
|
3188
3199
|
}
|
|
3189
3200
|
async getIdToken(e) {
|
|
3190
3201
|
const t = await X(this, this.stsTokenManager.getToken(this.auth, e));
|
|
3191
|
-
return
|
|
3202
|
+
return h(
|
|
3192
3203
|
t,
|
|
3193
3204
|
this.auth,
|
|
3194
3205
|
"internal-error"
|
|
@@ -3196,13 +3207,13 @@ class I {
|
|
|
3196
3207
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
3197
3208
|
}
|
|
3198
3209
|
getIdTokenResult(e) {
|
|
3199
|
-
return
|
|
3210
|
+
return $i(this, e);
|
|
3200
3211
|
}
|
|
3201
3212
|
reload() {
|
|
3202
|
-
return
|
|
3213
|
+
return ji(this);
|
|
3203
3214
|
}
|
|
3204
3215
|
_assign(e) {
|
|
3205
|
-
this !== e && (
|
|
3216
|
+
this !== e && (h(
|
|
3206
3217
|
this.uid === e.uid,
|
|
3207
3218
|
this.auth,
|
|
3208
3219
|
"internal-error"
|
|
@@ -3210,11 +3221,11 @@ class I {
|
|
|
3210
3221
|
), 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));
|
|
3211
3222
|
}
|
|
3212
3223
|
_clone(e) {
|
|
3213
|
-
const t = new
|
|
3224
|
+
const t = new w(Object.assign(Object.assign({}, this), { auth: e, stsTokenManager: this.stsTokenManager._clone() }));
|
|
3214
3225
|
return t.metadata._copy(this.metadata), t;
|
|
3215
3226
|
}
|
|
3216
3227
|
_onReload(e) {
|
|
3217
|
-
|
|
3228
|
+
h(
|
|
3218
3229
|
!this.reloadListener,
|
|
3219
3230
|
this.auth,
|
|
3220
3231
|
"internal-error"
|
|
@@ -3232,13 +3243,13 @@ class I {
|
|
|
3232
3243
|
}
|
|
3233
3244
|
async _updateTokensIfNecessary(e, t = !1) {
|
|
3234
3245
|
let r = !1;
|
|
3235
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), r = !0), t && await
|
|
3246
|
+
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), r = !0), t && await me(this), await this.auth._persistUserIfCurrent(this), r && this.auth._notifyListenersIfCurrent(this);
|
|
3236
3247
|
}
|
|
3237
3248
|
async delete() {
|
|
3238
|
-
if (
|
|
3239
|
-
return Promise.reject(
|
|
3249
|
+
if (b(this.auth.app))
|
|
3250
|
+
return Promise.reject(L(this.auth));
|
|
3240
3251
|
const e = await this.getIdToken();
|
|
3241
|
-
return await X(this,
|
|
3252
|
+
return await X(this, Bi(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
3242
3253
|
}
|
|
3243
3254
|
toJSON() {
|
|
3244
3255
|
return Object.assign(Object.assign({
|
|
@@ -3265,46 +3276,46 @@ class I {
|
|
|
3265
3276
|
return this.stsTokenManager.refreshToken || "";
|
|
3266
3277
|
}
|
|
3267
3278
|
static _fromJSON(e, t) {
|
|
3268
|
-
var r, i, s, a, c, o,
|
|
3269
|
-
const
|
|
3270
|
-
|
|
3271
|
-
|
|
3279
|
+
var r, i, s, a, c, o, u, l;
|
|
3280
|
+
const d = (r = t.displayName) !== null && r !== void 0 ? r : void 0, f = (i = t.email) !== null && i !== void 0 ? i : void 0, g = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, v = (a = t.photoURL) !== null && a !== void 0 ? a : void 0, tt = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, Ee = (o = t._redirectEventId) !== null && o !== void 0 ? o : void 0, nt = (u = t.createdAt) !== null && u !== void 0 ? u : void 0, rt = (l = t.lastLoginAt) !== null && l !== void 0 ? l : void 0, { uid: Te, emailVerified: it, isAnonymous: st, providerData: Se, stsTokenManager: at } = t;
|
|
3281
|
+
h(
|
|
3282
|
+
Te && at,
|
|
3272
3283
|
e,
|
|
3273
3284
|
"internal-error"
|
|
3274
3285
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3275
3286
|
);
|
|
3276
3287
|
const Dn = H.fromJSON(this.name, at);
|
|
3277
|
-
|
|
3278
|
-
typeof
|
|
3288
|
+
h(
|
|
3289
|
+
typeof Te == "string",
|
|
3279
3290
|
e,
|
|
3280
3291
|
"internal-error"
|
|
3281
3292
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3282
|
-
),
|
|
3293
|
+
), A(d, e.name), A(f, e.name), h(
|
|
3283
3294
|
typeof it == "boolean",
|
|
3284
3295
|
e,
|
|
3285
3296
|
"internal-error"
|
|
3286
3297
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3287
|
-
),
|
|
3298
|
+
), h(
|
|
3288
3299
|
typeof st == "boolean",
|
|
3289
3300
|
e,
|
|
3290
3301
|
"internal-error"
|
|
3291
3302
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3292
|
-
),
|
|
3293
|
-
const
|
|
3294
|
-
uid:
|
|
3303
|
+
), A(g, e.name), A(v, e.name), A(tt, e.name), A(Ee, e.name), A(nt, e.name), A(rt, e.name);
|
|
3304
|
+
const ke = new w({
|
|
3305
|
+
uid: Te,
|
|
3295
3306
|
auth: e,
|
|
3296
|
-
email:
|
|
3307
|
+
email: f,
|
|
3297
3308
|
emailVerified: it,
|
|
3298
|
-
displayName:
|
|
3309
|
+
displayName: d,
|
|
3299
3310
|
isAnonymous: st,
|
|
3300
|
-
photoURL:
|
|
3311
|
+
photoURL: v,
|
|
3301
3312
|
phoneNumber: g,
|
|
3302
3313
|
tenantId: tt,
|
|
3303
3314
|
stsTokenManager: Dn,
|
|
3304
3315
|
createdAt: nt,
|
|
3305
3316
|
lastLoginAt: rt
|
|
3306
3317
|
});
|
|
3307
|
-
return
|
|
3318
|
+
return Se && Array.isArray(Se) && (ke.providerData = Se.map((Nn) => Object.assign({}, Nn))), Ee && (ke._redirectEventId = Ee), ke;
|
|
3308
3319
|
}
|
|
3309
3320
|
/**
|
|
3310
3321
|
* Initialize a User from an idToken server response
|
|
@@ -3314,13 +3325,13 @@ class I {
|
|
|
3314
3325
|
static async _fromIdTokenResponse(e, t, r = !1) {
|
|
3315
3326
|
const i = new H();
|
|
3316
3327
|
i.updateFromServerResponse(t);
|
|
3317
|
-
const s = new
|
|
3328
|
+
const s = new w({
|
|
3318
3329
|
uid: t.localId,
|
|
3319
3330
|
auth: e,
|
|
3320
3331
|
stsTokenManager: i,
|
|
3321
3332
|
isAnonymous: r
|
|
3322
3333
|
});
|
|
3323
|
-
return await
|
|
3334
|
+
return await me(s), s;
|
|
3324
3335
|
}
|
|
3325
3336
|
/**
|
|
3326
3337
|
* Initialize a User from an idToken server response
|
|
@@ -3329,19 +3340,19 @@ class I {
|
|
|
3329
3340
|
*/
|
|
3330
3341
|
static async _fromGetAccountInfoResponse(e, t, r) {
|
|
3331
3342
|
const i = t.users[0];
|
|
3332
|
-
|
|
3343
|
+
h(
|
|
3333
3344
|
i.localId !== void 0,
|
|
3334
3345
|
"internal-error"
|
|
3335
3346
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3336
3347
|
);
|
|
3337
3348
|
const s = i.providerUserInfo !== void 0 ? on(i.providerUserInfo) : [], a = !(i.email && i.passwordHash) && !(s != null && s.length), c = new H();
|
|
3338
3349
|
c.updateFromIdToken(r);
|
|
3339
|
-
const o = new
|
|
3350
|
+
const o = new w({
|
|
3340
3351
|
uid: i.localId,
|
|
3341
3352
|
auth: e,
|
|
3342
3353
|
stsTokenManager: c,
|
|
3343
3354
|
isAnonymous: a
|
|
3344
|
-
}),
|
|
3355
|
+
}), u = {
|
|
3345
3356
|
uid: i.localId,
|
|
3346
3357
|
displayName: i.displayName || null,
|
|
3347
3358
|
photoURL: i.photoUrl || null,
|
|
@@ -3350,10 +3361,10 @@ class I {
|
|
|
3350
3361
|
phoneNumber: i.phoneNumber || null,
|
|
3351
3362
|
tenantId: i.tenantId || null,
|
|
3352
3363
|
providerData: s,
|
|
3353
|
-
metadata: new
|
|
3364
|
+
metadata: new Ve(i.createdAt, i.lastLoginAt),
|
|
3354
3365
|
isAnonymous: !(i.email && i.passwordHash) && !(s != null && s.length)
|
|
3355
3366
|
};
|
|
3356
|
-
return Object.assign(o,
|
|
3367
|
+
return Object.assign(o, u), o;
|
|
3357
3368
|
}
|
|
3358
3369
|
}
|
|
3359
3370
|
/**
|
|
@@ -3373,10 +3384,10 @@ class I {
|
|
|
3373
3384
|
* limitations under the License.
|
|
3374
3385
|
*/
|
|
3375
3386
|
const vt = /* @__PURE__ */ new Map();
|
|
3376
|
-
function
|
|
3377
|
-
|
|
3387
|
+
function E(n) {
|
|
3388
|
+
k(n instanceof Function, "Expected a class definition");
|
|
3378
3389
|
let e = vt.get(n);
|
|
3379
|
-
return e ? (
|
|
3390
|
+
return e ? (k(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), vt.set(n, e), e);
|
|
3380
3391
|
}
|
|
3381
3392
|
/**
|
|
3382
3393
|
* @license
|
|
@@ -3448,7 +3459,7 @@ class V {
|
|
|
3448
3459
|
}
|
|
3449
3460
|
async getCurrentUser() {
|
|
3450
3461
|
const e = await this.persistence._get(this.fullUserKey);
|
|
3451
|
-
return e ?
|
|
3462
|
+
return e ? w._fromJSON(this.auth, e) : null;
|
|
3452
3463
|
}
|
|
3453
3464
|
removeCurrentUser() {
|
|
3454
3465
|
return this.persistence._remove(this.fullUserKey);
|
|
@@ -3468,29 +3479,29 @@ class V {
|
|
|
3468
3479
|
}
|
|
3469
3480
|
static async create(e, t, r = "authUser") {
|
|
3470
3481
|
if (!t.length)
|
|
3471
|
-
return new V(
|
|
3472
|
-
const i = (await Promise.all(t.map(async (
|
|
3473
|
-
if (await
|
|
3474
|
-
return
|
|
3475
|
-
}))).filter((
|
|
3476
|
-
let s = i[0] ||
|
|
3482
|
+
return new V(E(bt), e, r);
|
|
3483
|
+
const i = (await Promise.all(t.map(async (u) => {
|
|
3484
|
+
if (await u._isAvailable())
|
|
3485
|
+
return u;
|
|
3486
|
+
}))).filter((u) => u);
|
|
3487
|
+
let s = i[0] || E(bt);
|
|
3477
3488
|
const a = ae(r, e.config.apiKey, e.name);
|
|
3478
3489
|
let c = null;
|
|
3479
|
-
for (const
|
|
3490
|
+
for (const u of t)
|
|
3480
3491
|
try {
|
|
3481
|
-
const
|
|
3482
|
-
if (
|
|
3483
|
-
const
|
|
3484
|
-
|
|
3492
|
+
const l = await u._get(a);
|
|
3493
|
+
if (l) {
|
|
3494
|
+
const d = w._fromJSON(e, l);
|
|
3495
|
+
u !== s && (c = d), s = u;
|
|
3485
3496
|
break;
|
|
3486
3497
|
}
|
|
3487
3498
|
} catch {
|
|
3488
3499
|
}
|
|
3489
|
-
const o = i.filter((
|
|
3490
|
-
return !s._shouldAllowMigration || !o.length ? new V(s, e, r) : (s = o[0], c && await s._set(a, c.toJSON()), await Promise.all(t.map(async (
|
|
3491
|
-
if (
|
|
3500
|
+
const o = i.filter((u) => u._shouldAllowMigration);
|
|
3501
|
+
return !s._shouldAllowMigration || !o.length ? new V(s, e, r) : (s = o[0], c && await s._set(a, c.toJSON()), await Promise.all(t.map(async (u) => {
|
|
3502
|
+
if (u !== s)
|
|
3492
3503
|
try {
|
|
3493
|
-
await
|
|
3504
|
+
await u._remove(a);
|
|
3494
3505
|
} catch {
|
|
3495
3506
|
}
|
|
3496
3507
|
})), new V(s, e, r));
|
|
@@ -3568,12 +3579,12 @@ function mn(n = m()) {
|
|
|
3568
3579
|
function Xe(n = m()) {
|
|
3569
3580
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
3570
3581
|
}
|
|
3571
|
-
function
|
|
3582
|
+
function qi(n = m()) {
|
|
3572
3583
|
var e;
|
|
3573
3584
|
return Xe(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
3574
3585
|
}
|
|
3575
|
-
function
|
|
3576
|
-
return
|
|
3586
|
+
function Ki() {
|
|
3587
|
+
return dr() && document.documentMode === 10;
|
|
3577
3588
|
}
|
|
3578
3589
|
function gn(n = m()) {
|
|
3579
3590
|
return Xe(n) || fn(n) || mn(n) || pn(n) || /windows phone/i.test(n) || hn(n);
|
|
@@ -3625,7 +3636,7 @@ function _n(n, e = []) {
|
|
|
3625
3636
|
* See the License for the specific language governing permissions and
|
|
3626
3637
|
* limitations under the License.
|
|
3627
3638
|
*/
|
|
3628
|
-
class
|
|
3639
|
+
class Ji {
|
|
3629
3640
|
constructor(e) {
|
|
3630
3641
|
this.auth = e, this.queue = [];
|
|
3631
3642
|
}
|
|
@@ -3680,8 +3691,8 @@ class qi {
|
|
|
3680
3691
|
* See the License for the specific language governing permissions and
|
|
3681
3692
|
* limitations under the License.
|
|
3682
3693
|
*/
|
|
3683
|
-
async function
|
|
3684
|
-
return G(n, "GET", "/v2/passwordPolicy",
|
|
3694
|
+
async function Yi(n, e = {}) {
|
|
3695
|
+
return G(n, "GET", "/v2/passwordPolicy", ve(n, e));
|
|
3685
3696
|
}
|
|
3686
3697
|
/**
|
|
3687
3698
|
* @license
|
|
@@ -3699,12 +3710,12 @@ async function Ki(n, e = {}) {
|
|
|
3699
3710
|
* See the License for the specific language governing permissions and
|
|
3700
3711
|
* limitations under the License.
|
|
3701
3712
|
*/
|
|
3702
|
-
const
|
|
3703
|
-
class
|
|
3713
|
+
const Xi = 6;
|
|
3714
|
+
class Qi {
|
|
3704
3715
|
constructor(e) {
|
|
3705
3716
|
var t, r, i, s;
|
|
3706
3717
|
const a = e.customStrengthOptions;
|
|
3707
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = a.minPasswordLength) !== null && t !== void 0 ? t :
|
|
3718
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = a.minPasswordLength) !== null && t !== void 0 ? t : Xi, a.maxPasswordLength && (this.customStrengthOptions.maxPasswordLength = a.maxPasswordLength), a.containsLowercaseCharacter !== void 0 && (this.customStrengthOptions.containsLowercaseLetter = a.containsLowercaseCharacter), a.containsUppercaseCharacter !== void 0 && (this.customStrengthOptions.containsUppercaseLetter = a.containsUppercaseCharacter), a.containsNumericCharacter !== void 0 && (this.customStrengthOptions.containsNumericCharacter = a.containsNumericCharacter), a.containsNonAlphanumericCharacter !== void 0 && (this.customStrengthOptions.containsNonAlphanumericCharacter = a.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;
|
|
3708
3719
|
}
|
|
3709
3720
|
validatePassword(e) {
|
|
3710
3721
|
var t, r, i, s, a, c;
|
|
@@ -3787,12 +3798,12 @@ class Yi {
|
|
|
3787
3798
|
* See the License for the specific language governing permissions and
|
|
3788
3799
|
* limitations under the License.
|
|
3789
3800
|
*/
|
|
3790
|
-
class
|
|
3801
|
+
class Zi {
|
|
3791
3802
|
constructor(e, t, r, i) {
|
|
3792
|
-
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 wt(this), this.idTokenSubscription = new wt(this), this.beforeStateQueue = new
|
|
3803
|
+
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 wt(this), this.idTokenSubscription = new wt(this), this.beforeStateQueue = new Ji(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 = Zt, 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;
|
|
3793
3804
|
}
|
|
3794
3805
|
_initializeWithPersistence(e, t) {
|
|
3795
|
-
return t && (this._popupRedirectResolver =
|
|
3806
|
+
return t && (this._popupRedirectResolver = E(t)), this._initializationPromise = this.queue(async () => {
|
|
3796
3807
|
var r, i;
|
|
3797
3808
|
if (!this._deleted && (this.persistenceManager = await V.create(this, e), !this._deleted)) {
|
|
3798
3809
|
if (!((r = this._popupRedirectResolver) === null || r === void 0) && r._shouldInitProactively)
|
|
@@ -3825,7 +3836,7 @@ class Xi {
|
|
|
3825
3836
|
}
|
|
3826
3837
|
async initializeCurrentUserFromIdToken(e) {
|
|
3827
3838
|
try {
|
|
3828
|
-
const t = await an(this, { idToken: e }), r = await
|
|
3839
|
+
const t = await an(this, { idToken: e }), r = await w._fromGetAccountInfoResponse(this, t, e);
|
|
3829
3840
|
await this.directlySetCurrentUser(r);
|
|
3830
3841
|
} catch (t) {
|
|
3831
3842
|
console.warn("FirebaseServerApp could not login user with provided authIdToken: ", t), await this.directlySetCurrentUser(null);
|
|
@@ -3833,7 +3844,7 @@ class Xi {
|
|
|
3833
3844
|
}
|
|
3834
3845
|
async initializeCurrentUser(e) {
|
|
3835
3846
|
var t;
|
|
3836
|
-
if (
|
|
3847
|
+
if (b(this.app)) {
|
|
3837
3848
|
const a = this.app.settings.authIdToken;
|
|
3838
3849
|
return a ? new Promise((c) => {
|
|
3839
3850
|
setTimeout(() => this.initializeCurrentUserFromIdToken(a).then(c, c));
|
|
@@ -3857,7 +3868,7 @@ class Xi {
|
|
|
3857
3868
|
}
|
|
3858
3869
|
return i ? this.reloadAndSetCurrentUserOrClear(i) : this.directlySetCurrentUser(null);
|
|
3859
3870
|
}
|
|
3860
|
-
return
|
|
3871
|
+
return h(
|
|
3861
3872
|
this._popupRedirectResolver,
|
|
3862
3873
|
this,
|
|
3863
3874
|
"argument-error"
|
|
@@ -3875,7 +3886,7 @@ class Xi {
|
|
|
3875
3886
|
}
|
|
3876
3887
|
async reloadAndSetCurrentUserOrClear(e) {
|
|
3877
3888
|
try {
|
|
3878
|
-
await
|
|
3889
|
+
await me(e);
|
|
3879
3890
|
} catch (t) {
|
|
3880
3891
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
|
3881
3892
|
return this.directlySetCurrentUser(null);
|
|
@@ -3883,16 +3894,16 @@ class Xi {
|
|
|
3883
3894
|
return this.directlySetCurrentUser(e);
|
|
3884
3895
|
}
|
|
3885
3896
|
useDeviceLanguage() {
|
|
3886
|
-
this.languageCode =
|
|
3897
|
+
this.languageCode = Mi();
|
|
3887
3898
|
}
|
|
3888
3899
|
async _delete() {
|
|
3889
3900
|
this._deleted = !0;
|
|
3890
3901
|
}
|
|
3891
3902
|
async updateCurrentUser(e) {
|
|
3892
|
-
if (
|
|
3893
|
-
return Promise.reject(
|
|
3903
|
+
if (b(this.app))
|
|
3904
|
+
return Promise.reject(L(this));
|
|
3894
3905
|
const t = e ? z(e) : null;
|
|
3895
|
-
return t &&
|
|
3906
|
+
return t && h(
|
|
3896
3907
|
t.auth.config.apiKey === this.config.apiKey,
|
|
3897
3908
|
this,
|
|
3898
3909
|
"invalid-user-token"
|
|
@@ -3901,7 +3912,7 @@ class Xi {
|
|
|
3901
3912
|
}
|
|
3902
3913
|
async _updateCurrentUser(e, t = !1) {
|
|
3903
3914
|
if (!this._deleted)
|
|
3904
|
-
return e &&
|
|
3915
|
+
return e && h(
|
|
3905
3916
|
this.tenantId === e.tenantId,
|
|
3906
3917
|
this,
|
|
3907
3918
|
"tenant-id-mismatch"
|
|
@@ -3911,15 +3922,15 @@ class Xi {
|
|
|
3911
3922
|
});
|
|
3912
3923
|
}
|
|
3913
3924
|
async signOut() {
|
|
3914
|
-
return
|
|
3925
|
+
return b(this.app) ? Promise.reject(L(this)) : (await this.beforeStateQueue.runMiddleware(null), (this.redirectPersistenceManager || this._popupRedirectResolver) && await this._setRedirectUser(null), this._updateCurrentUser(
|
|
3915
3926
|
null,
|
|
3916
3927
|
/* skipBeforeStateCallbacks */
|
|
3917
3928
|
!0
|
|
3918
3929
|
));
|
|
3919
3930
|
}
|
|
3920
3931
|
setPersistence(e) {
|
|
3921
|
-
return
|
|
3922
|
-
await this.assertedPersistence.setPersistence(
|
|
3932
|
+
return b(this.app) ? Promise.reject(L(this)) : this.queue(async () => {
|
|
3933
|
+
await this.assertedPersistence.setPersistence(E(e));
|
|
3923
3934
|
});
|
|
3924
3935
|
}
|
|
3925
3936
|
_getRecaptchaConfig() {
|
|
@@ -3934,7 +3945,7 @@ class Xi {
|
|
|
3934
3945
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
3935
3946
|
}
|
|
3936
3947
|
async _updatePasswordPolicy() {
|
|
3937
|
-
const e = await
|
|
3948
|
+
const e = await Yi(this), t = new Qi(e);
|
|
3938
3949
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
3939
3950
|
}
|
|
3940
3951
|
_getPersistence() {
|
|
@@ -3974,7 +3985,7 @@ class Xi {
|
|
|
3974
3985
|
token: e,
|
|
3975
3986
|
idToken: t
|
|
3976
3987
|
};
|
|
3977
|
-
this.tenantId != null && (r.tenantId = this.tenantId), await
|
|
3988
|
+
this.tenantId != null && (r.tenantId = this.tenantId), await Gi(this, r);
|
|
3978
3989
|
}
|
|
3979
3990
|
}
|
|
3980
3991
|
toJSON() {
|
|
@@ -3992,15 +4003,15 @@ class Xi {
|
|
|
3992
4003
|
}
|
|
3993
4004
|
async getOrInitRedirectPersistenceManager(e) {
|
|
3994
4005
|
if (!this.redirectPersistenceManager) {
|
|
3995
|
-
const t = e &&
|
|
3996
|
-
|
|
4006
|
+
const t = e && E(e) || this._popupRedirectResolver;
|
|
4007
|
+
h(
|
|
3997
4008
|
t,
|
|
3998
4009
|
this,
|
|
3999
4010
|
"argument-error"
|
|
4000
4011
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
4001
4012
|
), this.redirectPersistenceManager = await V.create(
|
|
4002
4013
|
this,
|
|
4003
|
-
[
|
|
4014
|
+
[E(t._redirectPersistence)],
|
|
4004
4015
|
"redirectUser"
|
|
4005
4016
|
/* KeyName.REDIRECT_USER */
|
|
4006
4017
|
), this.redirectUser = await this.redirectPersistenceManager.getCurrentUser();
|
|
@@ -4048,7 +4059,7 @@ class Xi {
|
|
|
4048
4059
|
const s = typeof t == "function" ? t : t.next.bind(t);
|
|
4049
4060
|
let a = !1;
|
|
4050
4061
|
const c = this._isInitialized ? Promise.resolve() : this._initializationPromise;
|
|
4051
|
-
if (
|
|
4062
|
+
if (h(
|
|
4052
4063
|
c,
|
|
4053
4064
|
this,
|
|
4054
4065
|
"internal-error"
|
|
@@ -4079,7 +4090,7 @@ class Xi {
|
|
|
4079
4090
|
return this.operations = this.operations.then(e, e), this.operations;
|
|
4080
4091
|
}
|
|
4081
4092
|
get assertedPersistence() {
|
|
4082
|
-
return
|
|
4093
|
+
return h(
|
|
4083
4094
|
this.persistenceManager,
|
|
4084
4095
|
this,
|
|
4085
4096
|
"internal-error"
|
|
@@ -4117,18 +4128,18 @@ class Xi {
|
|
|
4117
4128
|
async _getAppCheckToken() {
|
|
4118
4129
|
var e;
|
|
4119
4130
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
4120
|
-
return t != null && t.error &&
|
|
4131
|
+
return t != null && t.error && Di(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
4121
4132
|
}
|
|
4122
4133
|
}
|
|
4123
|
-
function
|
|
4134
|
+
function be(n) {
|
|
4124
4135
|
return z(n);
|
|
4125
4136
|
}
|
|
4126
4137
|
class wt {
|
|
4127
4138
|
constructor(e) {
|
|
4128
|
-
this.auth = e, this.observer = null, this.addObserver =
|
|
4139
|
+
this.auth = e, this.observer = null, this.addObserver = yr((t) => this.observer = t);
|
|
4129
4140
|
}
|
|
4130
4141
|
get next() {
|
|
4131
|
-
return
|
|
4142
|
+
return h(
|
|
4132
4143
|
this.observer,
|
|
4133
4144
|
this.auth,
|
|
4134
4145
|
"internal-error"
|
|
@@ -4160,16 +4171,16 @@ let Qe = {
|
|
|
4160
4171
|
recaptchaEnterpriseScript: "",
|
|
4161
4172
|
gapiScript: ""
|
|
4162
4173
|
};
|
|
4163
|
-
function
|
|
4174
|
+
function es(n) {
|
|
4164
4175
|
Qe = n;
|
|
4165
4176
|
}
|
|
4166
|
-
function
|
|
4177
|
+
function ts(n) {
|
|
4167
4178
|
return Qe.loadJS(n);
|
|
4168
4179
|
}
|
|
4169
|
-
function
|
|
4180
|
+
function ns() {
|
|
4170
4181
|
return Qe.gapiScript;
|
|
4171
4182
|
}
|
|
4172
|
-
function
|
|
4183
|
+
function rs(n) {
|
|
4173
4184
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
4174
4185
|
}
|
|
4175
4186
|
/**
|
|
@@ -4188,13 +4199,13 @@ function ts(n) {
|
|
|
4188
4199
|
* See the License for the specific language governing permissions and
|
|
4189
4200
|
* limitations under the License.
|
|
4190
4201
|
*/
|
|
4191
|
-
function
|
|
4202
|
+
function is(n, e) {
|
|
4192
4203
|
const t = Kt(n, "auth");
|
|
4193
4204
|
if (t.isInitialized()) {
|
|
4194
4205
|
const i = t.getImmediate(), s = t.getOptions();
|
|
4195
|
-
if (
|
|
4206
|
+
if (he(s, e ?? {}))
|
|
4196
4207
|
return i;
|
|
4197
|
-
|
|
4208
|
+
S(
|
|
4198
4209
|
i,
|
|
4199
4210
|
"already-initialized"
|
|
4200
4211
|
/* AuthErrorCode.ALREADY_INITIALIZED */
|
|
@@ -4202,36 +4213,36 @@ function ns(n, e) {
|
|
|
4202
4213
|
}
|
|
4203
4214
|
return t.initialize({ options: e });
|
|
4204
4215
|
}
|
|
4205
|
-
function
|
|
4206
|
-
const t = (e == null ? void 0 : e.persistence) || [], r = (Array.isArray(t) ? t : [t]).map(
|
|
4216
|
+
function ss(n, e) {
|
|
4217
|
+
const t = (e == null ? void 0 : e.persistence) || [], r = (Array.isArray(t) ? t : [t]).map(E);
|
|
4207
4218
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(r, e == null ? void 0 : e.popupRedirectResolver);
|
|
4208
4219
|
}
|
|
4209
|
-
function
|
|
4210
|
-
const r =
|
|
4211
|
-
|
|
4220
|
+
function as(n, e, t) {
|
|
4221
|
+
const r = be(n);
|
|
4222
|
+
h(
|
|
4212
4223
|
r._canInitEmulator,
|
|
4213
4224
|
r,
|
|
4214
4225
|
"emulator-config-failed"
|
|
4215
4226
|
/* AuthErrorCode.EMULATOR_CONFIG_FAILED */
|
|
4216
|
-
),
|
|
4227
|
+
), h(
|
|
4217
4228
|
/^https?:\/\//.test(e),
|
|
4218
4229
|
r,
|
|
4219
4230
|
"invalid-emulator-scheme"
|
|
4220
4231
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
4221
4232
|
);
|
|
4222
|
-
const i = !1, s = yn(e), { host: a, port: c } =
|
|
4233
|
+
const i = !1, s = yn(e), { host: a, port: c } = os(e), o = c === null ? "" : `:${c}`;
|
|
4223
4234
|
r.config.emulator = { url: `${s}//${a}${o}/` }, r.settings.appVerificationDisabledForTesting = !0, r.emulatorConfig = Object.freeze({
|
|
4224
4235
|
host: a,
|
|
4225
4236
|
port: c,
|
|
4226
4237
|
protocol: s.replace(":", ""),
|
|
4227
4238
|
options: Object.freeze({ disableWarnings: i })
|
|
4228
|
-
}),
|
|
4239
|
+
}), cs();
|
|
4229
4240
|
}
|
|
4230
4241
|
function yn(n) {
|
|
4231
4242
|
const e = n.indexOf(":");
|
|
4232
4243
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
4233
4244
|
}
|
|
4234
|
-
function
|
|
4245
|
+
function os(n) {
|
|
4235
4246
|
const e = yn(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
4236
4247
|
if (!t)
|
|
4237
4248
|
return { host: "", port: null };
|
|
@@ -4250,7 +4261,7 @@ function Et(n) {
|
|
|
4250
4261
|
const e = Number(n);
|
|
4251
4262
|
return isNaN(e) ? null : e;
|
|
4252
4263
|
}
|
|
4253
|
-
function
|
|
4264
|
+
function cs() {
|
|
4254
4265
|
function n() {
|
|
4255
4266
|
const e = document.createElement("p"), t = e.style;
|
|
4256
4267
|
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);
|
|
@@ -4284,19 +4295,19 @@ class vn {
|
|
|
4284
4295
|
* @returns a JSON-serializable representation of this object.
|
|
4285
4296
|
*/
|
|
4286
4297
|
toJSON() {
|
|
4287
|
-
return
|
|
4298
|
+
return I("not implemented");
|
|
4288
4299
|
}
|
|
4289
4300
|
/** @internal */
|
|
4290
4301
|
_getIdTokenResponse(e) {
|
|
4291
|
-
return
|
|
4302
|
+
return I("not implemented");
|
|
4292
4303
|
}
|
|
4293
4304
|
/** @internal */
|
|
4294
4305
|
_linkToIdToken(e, t) {
|
|
4295
|
-
return
|
|
4306
|
+
return I("not implemented");
|
|
4296
4307
|
}
|
|
4297
4308
|
/** @internal */
|
|
4298
4309
|
_getReauthenticationResolver(e) {
|
|
4299
|
-
return
|
|
4310
|
+
return I("not implemented");
|
|
4300
4311
|
}
|
|
4301
4312
|
}
|
|
4302
4313
|
/**
|
|
@@ -4316,7 +4327,7 @@ class vn {
|
|
|
4316
4327
|
* limitations under the License.
|
|
4317
4328
|
*/
|
|
4318
4329
|
async function j(n, e) {
|
|
4319
|
-
return rn(n, "POST", "/v1/accounts:signInWithIdp",
|
|
4330
|
+
return rn(n, "POST", "/v1/accounts:signInWithIdp", ve(n, e));
|
|
4320
4331
|
}
|
|
4321
4332
|
/**
|
|
4322
4333
|
* @license
|
|
@@ -4334,15 +4345,15 @@ async function j(n, e) {
|
|
|
4334
4345
|
* See the License for the specific language governing permissions and
|
|
4335
4346
|
* limitations under the License.
|
|
4336
4347
|
*/
|
|
4337
|
-
const
|
|
4338
|
-
class
|
|
4348
|
+
const ls = "http://localhost";
|
|
4349
|
+
class x extends vn {
|
|
4339
4350
|
constructor() {
|
|
4340
4351
|
super(...arguments), this.pendingToken = null;
|
|
4341
4352
|
}
|
|
4342
4353
|
/** @internal */
|
|
4343
4354
|
static _fromParams(e) {
|
|
4344
|
-
const t = new
|
|
4345
|
-
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) :
|
|
4355
|
+
const t = new x(e.providerId, e.signInMethod);
|
|
4356
|
+
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) : S(
|
|
4346
4357
|
"argument-error"
|
|
4347
4358
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
4348
4359
|
), t;
|
|
@@ -4372,7 +4383,7 @@ class U extends vn {
|
|
|
4372
4383
|
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: r, signInMethod: i } = t, s = qe(t, ["providerId", "signInMethod"]);
|
|
4373
4384
|
if (!r || !i)
|
|
4374
4385
|
return null;
|
|
4375
|
-
const a = new
|
|
4386
|
+
const a = new x(r, i);
|
|
4376
4387
|
return a.idToken = s.idToken || void 0, a.accessToken = s.accessToken || void 0, a.secret = s.secret, a.nonce = s.nonce, a.pendingToken = s.pendingToken || null, a;
|
|
4377
4388
|
}
|
|
4378
4389
|
/** @internal */
|
|
@@ -4392,7 +4403,7 @@ class U extends vn {
|
|
|
4392
4403
|
}
|
|
4393
4404
|
buildRequest() {
|
|
4394
4405
|
const e = {
|
|
4395
|
-
requestUri:
|
|
4406
|
+
requestUri: ls,
|
|
4396
4407
|
returnSecureToken: !0
|
|
4397
4408
|
};
|
|
4398
4409
|
if (this.pendingToken)
|
|
@@ -4508,7 +4519,7 @@ class ne extends bn {
|
|
|
4508
4519
|
* See the License for the specific language governing permissions and
|
|
4509
4520
|
* limitations under the License.
|
|
4510
4521
|
*/
|
|
4511
|
-
class
|
|
4522
|
+
class R extends ne {
|
|
4512
4523
|
constructor() {
|
|
4513
4524
|
super(
|
|
4514
4525
|
"facebook.com"
|
|
@@ -4528,9 +4539,9 @@ class A extends ne {
|
|
|
4528
4539
|
* @param accessToken - Facebook access token.
|
|
4529
4540
|
*/
|
|
4530
4541
|
static credential(e) {
|
|
4531
|
-
return
|
|
4532
|
-
providerId:
|
|
4533
|
-
signInMethod:
|
|
4542
|
+
return x._fromParams({
|
|
4543
|
+
providerId: R.PROVIDER_ID,
|
|
4544
|
+
signInMethod: R.FACEBOOK_SIGN_IN_METHOD,
|
|
4534
4545
|
accessToken: e
|
|
4535
4546
|
});
|
|
4536
4547
|
}
|
|
@@ -4540,7 +4551,7 @@ class A extends ne {
|
|
|
4540
4551
|
* @param userCredential - The user credential.
|
|
4541
4552
|
*/
|
|
4542
4553
|
static credentialFromResult(e) {
|
|
4543
|
-
return
|
|
4554
|
+
return R.credentialFromTaggedObject(e);
|
|
4544
4555
|
}
|
|
4545
4556
|
/**
|
|
4546
4557
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -4549,20 +4560,20 @@ class A extends ne {
|
|
|
4549
4560
|
* @param userCredential - The user credential.
|
|
4550
4561
|
*/
|
|
4551
4562
|
static credentialFromError(e) {
|
|
4552
|
-
return
|
|
4563
|
+
return R.credentialFromTaggedObject(e.customData || {});
|
|
4553
4564
|
}
|
|
4554
4565
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
4555
4566
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
4556
4567
|
return null;
|
|
4557
4568
|
try {
|
|
4558
|
-
return
|
|
4569
|
+
return R.credential(e.oauthAccessToken);
|
|
4559
4570
|
} catch {
|
|
4560
4571
|
return null;
|
|
4561
4572
|
}
|
|
4562
4573
|
}
|
|
4563
4574
|
}
|
|
4564
|
-
|
|
4565
|
-
|
|
4575
|
+
R.FACEBOOK_SIGN_IN_METHOD = "facebook.com";
|
|
4576
|
+
R.PROVIDER_ID = "facebook.com";
|
|
4566
4577
|
/**
|
|
4567
4578
|
* @license
|
|
4568
4579
|
* Copyright 2020 Google LLC
|
|
@@ -4579,7 +4590,7 @@ A.PROVIDER_ID = "facebook.com";
|
|
|
4579
4590
|
* See the License for the specific language governing permissions and
|
|
4580
4591
|
* limitations under the License.
|
|
4581
4592
|
*/
|
|
4582
|
-
class
|
|
4593
|
+
class C extends ne {
|
|
4583
4594
|
constructor() {
|
|
4584
4595
|
super(
|
|
4585
4596
|
"google.com"
|
|
@@ -4600,9 +4611,9 @@ class R extends ne {
|
|
|
4600
4611
|
* @param accessToken - Google access token.
|
|
4601
4612
|
*/
|
|
4602
4613
|
static credential(e, t) {
|
|
4603
|
-
return
|
|
4604
|
-
providerId:
|
|
4605
|
-
signInMethod:
|
|
4614
|
+
return x._fromParams({
|
|
4615
|
+
providerId: C.PROVIDER_ID,
|
|
4616
|
+
signInMethod: C.GOOGLE_SIGN_IN_METHOD,
|
|
4606
4617
|
idToken: e,
|
|
4607
4618
|
accessToken: t
|
|
4608
4619
|
});
|
|
@@ -4613,7 +4624,7 @@ class R extends ne {
|
|
|
4613
4624
|
* @param userCredential - The user credential.
|
|
4614
4625
|
*/
|
|
4615
4626
|
static credentialFromResult(e) {
|
|
4616
|
-
return
|
|
4627
|
+
return C.credentialFromTaggedObject(e);
|
|
4617
4628
|
}
|
|
4618
4629
|
/**
|
|
4619
4630
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -4622,7 +4633,7 @@ class R extends ne {
|
|
|
4622
4633
|
* @param userCredential - The user credential.
|
|
4623
4634
|
*/
|
|
4624
4635
|
static credentialFromError(e) {
|
|
4625
|
-
return
|
|
4636
|
+
return C.credentialFromTaggedObject(e.customData || {});
|
|
4626
4637
|
}
|
|
4627
4638
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
4628
4639
|
if (!e)
|
|
@@ -4631,14 +4642,14 @@ class R extends ne {
|
|
|
4631
4642
|
if (!t && !r)
|
|
4632
4643
|
return null;
|
|
4633
4644
|
try {
|
|
4634
|
-
return
|
|
4645
|
+
return C.credential(t, r);
|
|
4635
4646
|
} catch {
|
|
4636
4647
|
return null;
|
|
4637
4648
|
}
|
|
4638
4649
|
}
|
|
4639
4650
|
}
|
|
4640
|
-
|
|
4641
|
-
|
|
4651
|
+
C.GOOGLE_SIGN_IN_METHOD = "google.com";
|
|
4652
|
+
C.PROVIDER_ID = "google.com";
|
|
4642
4653
|
/**
|
|
4643
4654
|
* @license
|
|
4644
4655
|
* Copyright 2020 Google LLC
|
|
@@ -4655,7 +4666,7 @@ R.PROVIDER_ID = "google.com";
|
|
|
4655
4666
|
* See the License for the specific language governing permissions and
|
|
4656
4667
|
* limitations under the License.
|
|
4657
4668
|
*/
|
|
4658
|
-
class
|
|
4669
|
+
class P extends ne {
|
|
4659
4670
|
constructor() {
|
|
4660
4671
|
super(
|
|
4661
4672
|
"github.com"
|
|
@@ -4668,9 +4679,9 @@ class C extends ne {
|
|
|
4668
4679
|
* @param accessToken - GitHub access token.
|
|
4669
4680
|
*/
|
|
4670
4681
|
static credential(e) {
|
|
4671
|
-
return
|
|
4672
|
-
providerId:
|
|
4673
|
-
signInMethod:
|
|
4682
|
+
return x._fromParams({
|
|
4683
|
+
providerId: P.PROVIDER_ID,
|
|
4684
|
+
signInMethod: P.GITHUB_SIGN_IN_METHOD,
|
|
4674
4685
|
accessToken: e
|
|
4675
4686
|
});
|
|
4676
4687
|
}
|
|
@@ -4680,7 +4691,7 @@ class C extends ne {
|
|
|
4680
4691
|
* @param userCredential - The user credential.
|
|
4681
4692
|
*/
|
|
4682
4693
|
static credentialFromResult(e) {
|
|
4683
|
-
return
|
|
4694
|
+
return P.credentialFromTaggedObject(e);
|
|
4684
4695
|
}
|
|
4685
4696
|
/**
|
|
4686
4697
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -4689,20 +4700,20 @@ class C extends ne {
|
|
|
4689
4700
|
* @param userCredential - The user credential.
|
|
4690
4701
|
*/
|
|
4691
4702
|
static credentialFromError(e) {
|
|
4692
|
-
return
|
|
4703
|
+
return P.credentialFromTaggedObject(e.customData || {});
|
|
4693
4704
|
}
|
|
4694
4705
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
4695
4706
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
4696
4707
|
return null;
|
|
4697
4708
|
try {
|
|
4698
|
-
return
|
|
4709
|
+
return P.credential(e.oauthAccessToken);
|
|
4699
4710
|
} catch {
|
|
4700
4711
|
return null;
|
|
4701
4712
|
}
|
|
4702
4713
|
}
|
|
4703
4714
|
}
|
|
4704
|
-
|
|
4705
|
-
|
|
4715
|
+
P.GITHUB_SIGN_IN_METHOD = "github.com";
|
|
4716
|
+
P.PROVIDER_ID = "github.com";
|
|
4706
4717
|
/**
|
|
4707
4718
|
* @license
|
|
4708
4719
|
* Copyright 2020 Google LLC
|
|
@@ -4719,7 +4730,7 @@ C.PROVIDER_ID = "github.com";
|
|
|
4719
4730
|
* See the License for the specific language governing permissions and
|
|
4720
4731
|
* limitations under the License.
|
|
4721
4732
|
*/
|
|
4722
|
-
class
|
|
4733
|
+
class O extends ne {
|
|
4723
4734
|
constructor() {
|
|
4724
4735
|
super(
|
|
4725
4736
|
"twitter.com"
|
|
@@ -4733,9 +4744,9 @@ class P extends ne {
|
|
|
4733
4744
|
* @param secret - Twitter secret.
|
|
4734
4745
|
*/
|
|
4735
4746
|
static credential(e, t) {
|
|
4736
|
-
return
|
|
4737
|
-
providerId:
|
|
4738
|
-
signInMethod:
|
|
4747
|
+
return x._fromParams({
|
|
4748
|
+
providerId: O.PROVIDER_ID,
|
|
4749
|
+
signInMethod: O.TWITTER_SIGN_IN_METHOD,
|
|
4739
4750
|
oauthToken: e,
|
|
4740
4751
|
oauthTokenSecret: t
|
|
4741
4752
|
});
|
|
@@ -4746,7 +4757,7 @@ class P extends ne {
|
|
|
4746
4757
|
* @param userCredential - The user credential.
|
|
4747
4758
|
*/
|
|
4748
4759
|
static credentialFromResult(e) {
|
|
4749
|
-
return
|
|
4760
|
+
return O.credentialFromTaggedObject(e);
|
|
4750
4761
|
}
|
|
4751
4762
|
/**
|
|
4752
4763
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -4755,7 +4766,7 @@ class P extends ne {
|
|
|
4755
4766
|
* @param userCredential - The user credential.
|
|
4756
4767
|
*/
|
|
4757
4768
|
static credentialFromError(e) {
|
|
4758
|
-
return
|
|
4769
|
+
return O.credentialFromTaggedObject(e.customData || {});
|
|
4759
4770
|
}
|
|
4760
4771
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
4761
4772
|
if (!e)
|
|
@@ -4764,14 +4775,14 @@ class P extends ne {
|
|
|
4764
4775
|
if (!t || !r)
|
|
4765
4776
|
return null;
|
|
4766
4777
|
try {
|
|
4767
|
-
return
|
|
4778
|
+
return O.credential(t, r);
|
|
4768
4779
|
} catch {
|
|
4769
4780
|
return null;
|
|
4770
4781
|
}
|
|
4771
4782
|
}
|
|
4772
4783
|
}
|
|
4773
|
-
|
|
4774
|
-
|
|
4784
|
+
O.TWITTER_SIGN_IN_METHOD = "twitter.com";
|
|
4785
|
+
O.PROVIDER_ID = "twitter.com";
|
|
4775
4786
|
/**
|
|
4776
4787
|
* @license
|
|
4777
4788
|
* Copyright 2020 Google LLC
|
|
@@ -4788,13 +4799,13 @@ P.PROVIDER_ID = "twitter.com";
|
|
|
4788
4799
|
* See the License for the specific language governing permissions and
|
|
4789
4800
|
* limitations under the License.
|
|
4790
4801
|
*/
|
|
4791
|
-
class
|
|
4802
|
+
class F {
|
|
4792
4803
|
constructor(e) {
|
|
4793
4804
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
4794
4805
|
}
|
|
4795
4806
|
static async _fromIdTokenResponse(e, t, r, i = !1) {
|
|
4796
|
-
const s = await
|
|
4797
|
-
return new
|
|
4807
|
+
const s = await w._fromIdTokenResponse(e, r, i), a = Tt(r);
|
|
4808
|
+
return new F({
|
|
4798
4809
|
user: s,
|
|
4799
4810
|
providerId: a,
|
|
4800
4811
|
_tokenResponse: r,
|
|
@@ -4808,7 +4819,7 @@ class x {
|
|
|
4808
4819
|
!0
|
|
4809
4820
|
);
|
|
4810
4821
|
const i = Tt(r);
|
|
4811
|
-
return new
|
|
4822
|
+
return new F({
|
|
4812
4823
|
user: e,
|
|
4813
4824
|
providerId: i,
|
|
4814
4825
|
_tokenResponse: r,
|
|
@@ -4835,10 +4846,10 @@ function Tt(n) {
|
|
|
4835
4846
|
* See the License for the specific language governing permissions and
|
|
4836
4847
|
* limitations under the License.
|
|
4837
4848
|
*/
|
|
4838
|
-
class
|
|
4849
|
+
class ge extends M {
|
|
4839
4850
|
constructor(e, t, r, i) {
|
|
4840
4851
|
var s;
|
|
4841
|
-
super(t.code, t.message), this.operationType = r, this.user = i, Object.setPrototypeOf(this,
|
|
4852
|
+
super(t.code, t.message), this.operationType = r, this.user = i, Object.setPrototypeOf(this, ge.prototype), this.customData = {
|
|
4842
4853
|
appName: e.name,
|
|
4843
4854
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
|
4844
4855
|
_serverResponse: t.customData._serverResponse,
|
|
@@ -4846,17 +4857,17 @@ class me extends L {
|
|
|
4846
4857
|
};
|
|
4847
4858
|
}
|
|
4848
4859
|
static _fromErrorAndOperation(e, t, r, i) {
|
|
4849
|
-
return new
|
|
4860
|
+
return new ge(e, t, r, i);
|
|
4850
4861
|
}
|
|
4851
4862
|
}
|
|
4852
4863
|
function In(n, e, t, r) {
|
|
4853
4864
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
4854
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
|
4865
|
+
throw s.code === "auth/multi-factor-auth-required" ? ge._fromErrorAndOperation(n, s, e, r) : s;
|
|
4855
4866
|
});
|
|
4856
4867
|
}
|
|
4857
|
-
async function
|
|
4868
|
+
async function us(n, e, t = !1) {
|
|
4858
4869
|
const r = await X(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
4859
|
-
return
|
|
4870
|
+
return F._forOperation(n, "link", r);
|
|
4860
4871
|
}
|
|
4861
4872
|
/**
|
|
4862
4873
|
* @license
|
|
@@ -4874,35 +4885,35 @@ async function cs(n, e, t = !1) {
|
|
|
4874
4885
|
* See the License for the specific language governing permissions and
|
|
4875
4886
|
* limitations under the License.
|
|
4876
4887
|
*/
|
|
4877
|
-
async function
|
|
4888
|
+
async function ds(n, e, t = !1) {
|
|
4878
4889
|
const { auth: r } = n;
|
|
4879
|
-
if (
|
|
4880
|
-
return Promise.reject(
|
|
4890
|
+
if (b(r.app))
|
|
4891
|
+
return Promise.reject(L(r));
|
|
4881
4892
|
const i = "reauthenticate";
|
|
4882
4893
|
try {
|
|
4883
4894
|
const s = await X(n, In(r, i, e, n), t);
|
|
4884
|
-
|
|
4895
|
+
h(
|
|
4885
4896
|
s.idToken,
|
|
4886
4897
|
r,
|
|
4887
4898
|
"internal-error"
|
|
4888
4899
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4889
4900
|
);
|
|
4890
4901
|
const a = Ye(s.idToken);
|
|
4891
|
-
|
|
4902
|
+
h(
|
|
4892
4903
|
a,
|
|
4893
4904
|
r,
|
|
4894
4905
|
"internal-error"
|
|
4895
4906
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4896
4907
|
);
|
|
4897
4908
|
const { sub: c } = a;
|
|
4898
|
-
return
|
|
4909
|
+
return h(
|
|
4899
4910
|
n.uid === c,
|
|
4900
4911
|
r,
|
|
4901
4912
|
"user-mismatch"
|
|
4902
4913
|
/* AuthErrorCode.USER_MISMATCH */
|
|
4903
|
-
),
|
|
4914
|
+
), F._forOperation(n, i, s);
|
|
4904
4915
|
} catch (s) {
|
|
4905
|
-
throw (s == null ? void 0 : s.code) === "auth/user-not-found" &&
|
|
4916
|
+
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && S(
|
|
4906
4917
|
r,
|
|
4907
4918
|
"user-mismatch"
|
|
4908
4919
|
/* AuthErrorCode.USER_MISMATCH */
|
|
@@ -4925,10 +4936,10 @@ async function ls(n, e, t = !1) {
|
|
|
4925
4936
|
* See the License for the specific language governing permissions and
|
|
4926
4937
|
* limitations under the License.
|
|
4927
4938
|
*/
|
|
4928
|
-
async function
|
|
4929
|
-
if (
|
|
4930
|
-
return Promise.reject(
|
|
4931
|
-
const r = "signIn", i = await In(n, r, e), s = await
|
|
4939
|
+
async function hs(n, e, t = !1) {
|
|
4940
|
+
if (b(n.app))
|
|
4941
|
+
return Promise.reject(L(n));
|
|
4942
|
+
const r = "signIn", i = await In(n, r, e), s = await F._fromIdTokenResponse(n, r, i);
|
|
4932
4943
|
return t || await n._updateCurrentUser(s.user), s;
|
|
4933
4944
|
}
|
|
4934
4945
|
/**
|
|
@@ -4947,8 +4958,8 @@ async function us(n, e, t = !1) {
|
|
|
4947
4958
|
* See the License for the specific language governing permissions and
|
|
4948
4959
|
* limitations under the License.
|
|
4949
4960
|
*/
|
|
4950
|
-
async function
|
|
4951
|
-
return rn(n, "POST", "/v1/accounts:signInWithCustomToken",
|
|
4961
|
+
async function fs(n, e) {
|
|
4962
|
+
return rn(n, "POST", "/v1/accounts:signInWithCustomToken", ve(n, e));
|
|
4952
4963
|
}
|
|
4953
4964
|
/**
|
|
4954
4965
|
* @license
|
|
@@ -4966,22 +4977,22 @@ async function ds(n, e) {
|
|
|
4966
4977
|
* See the License for the specific language governing permissions and
|
|
4967
4978
|
* limitations under the License.
|
|
4968
4979
|
*/
|
|
4969
|
-
async function
|
|
4970
|
-
if (
|
|
4971
|
-
return Promise.reject(
|
|
4972
|
-
const t =
|
|
4980
|
+
async function ps(n, e) {
|
|
4981
|
+
if (b(n.app))
|
|
4982
|
+
return Promise.reject(L(n));
|
|
4983
|
+
const t = be(n), r = await fs(t, {
|
|
4973
4984
|
token: e,
|
|
4974
4985
|
returnSecureToken: !0
|
|
4975
|
-
}), i = await
|
|
4986
|
+
}), i = await F._fromIdTokenResponse(t, "signIn", r);
|
|
4976
4987
|
return await t._updateCurrentUser(i.user), i;
|
|
4977
4988
|
}
|
|
4978
|
-
function
|
|
4989
|
+
function ms(n, e, t, r) {
|
|
4979
4990
|
return z(n).onIdTokenChanged(e, t, r);
|
|
4980
4991
|
}
|
|
4981
|
-
function
|
|
4992
|
+
function gs(n, e, t) {
|
|
4982
4993
|
return z(n).beforeAuthStateChanged(e, t);
|
|
4983
4994
|
}
|
|
4984
|
-
const
|
|
4995
|
+
const _e = "__sak";
|
|
4985
4996
|
/**
|
|
4986
4997
|
* @license
|
|
4987
4998
|
* Copyright 2019 Google LLC
|
|
@@ -5004,7 +5015,7 @@ class wn {
|
|
|
5004
5015
|
}
|
|
5005
5016
|
_isAvailable() {
|
|
5006
5017
|
try {
|
|
5007
|
-
return this.storage ? (this.storage.setItem(
|
|
5018
|
+
return this.storage ? (this.storage.setItem(_e, "1"), this.storage.removeItem(_e), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
5008
5019
|
} catch {
|
|
5009
5020
|
return Promise.resolve(!1);
|
|
5010
5021
|
}
|
|
@@ -5039,7 +5050,7 @@ class wn {
|
|
|
5039
5050
|
* See the License for the specific language governing permissions and
|
|
5040
5051
|
* limitations under the License.
|
|
5041
5052
|
*/
|
|
5042
|
-
const
|
|
5053
|
+
const _s = 1e3, ys = 10;
|
|
5043
5054
|
class En extends wn {
|
|
5044
5055
|
constructor() {
|
|
5045
5056
|
super(
|
|
@@ -5067,7 +5078,7 @@ class En extends wn {
|
|
|
5067
5078
|
const a = this.storage.getItem(r);
|
|
5068
5079
|
!t && this.localCache[r] === a || this.notifyListeners(r, a);
|
|
5069
5080
|
}, s = this.storage.getItem(r);
|
|
5070
|
-
|
|
5081
|
+
Ki() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(i, ys) : i();
|
|
5071
5082
|
}
|
|
5072
5083
|
notifyListeners(e, t) {
|
|
5073
5084
|
this.localCache[e] = t;
|
|
@@ -5089,7 +5100,7 @@ class En extends wn {
|
|
|
5089
5100
|
!0
|
|
5090
5101
|
);
|
|
5091
5102
|
});
|
|
5092
|
-
},
|
|
5103
|
+
}, _s);
|
|
5093
5104
|
}
|
|
5094
5105
|
stopPolling() {
|
|
5095
5106
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -5119,7 +5130,7 @@ class En extends wn {
|
|
|
5119
5130
|
}
|
|
5120
5131
|
}
|
|
5121
5132
|
En.type = "LOCAL";
|
|
5122
|
-
const
|
|
5133
|
+
const vs = En;
|
|
5123
5134
|
/**
|
|
5124
5135
|
* @license
|
|
5125
5136
|
* Copyright 2020 Google LLC
|
|
@@ -5167,7 +5178,7 @@ const Sn = Tn;
|
|
|
5167
5178
|
* See the License for the specific language governing permissions and
|
|
5168
5179
|
* limitations under the License.
|
|
5169
5180
|
*/
|
|
5170
|
-
function
|
|
5181
|
+
function bs(n) {
|
|
5171
5182
|
return Promise.all(n.map(async (e) => {
|
|
5172
5183
|
try {
|
|
5173
5184
|
return {
|
|
@@ -5198,7 +5209,7 @@ function ys(n) {
|
|
|
5198
5209
|
* See the License for the specific language governing permissions and
|
|
5199
5210
|
* limitations under the License.
|
|
5200
5211
|
*/
|
|
5201
|
-
class
|
|
5212
|
+
class Ie {
|
|
5202
5213
|
constructor(e) {
|
|
5203
5214
|
this.eventTarget = e, this.handlersMap = {}, this.boundEventHandler = this.handleEvent.bind(this);
|
|
5204
5215
|
}
|
|
@@ -5212,7 +5223,7 @@ class be {
|
|
|
5212
5223
|
const t = this.receivers.find((i) => i.isListeningto(e));
|
|
5213
5224
|
if (t)
|
|
5214
5225
|
return t;
|
|
5215
|
-
const r = new
|
|
5226
|
+
const r = new Ie(e);
|
|
5216
5227
|
return this.receivers.push(r), r;
|
|
5217
5228
|
}
|
|
5218
5229
|
isListeningto(e) {
|
|
@@ -5237,7 +5248,7 @@ class be {
|
|
|
5237
5248
|
eventId: r,
|
|
5238
5249
|
eventType: i
|
|
5239
5250
|
});
|
|
5240
|
-
const c = Array.from(a).map(async (
|
|
5251
|
+
const c = Array.from(a).map(async (u) => u(t.origin, s)), o = await bs(c);
|
|
5241
5252
|
t.ports[0].postMessage({
|
|
5242
5253
|
status: "done",
|
|
5243
5254
|
eventId: r,
|
|
@@ -5266,7 +5277,7 @@ class be {
|
|
|
5266
5277
|
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);
|
|
5267
5278
|
}
|
|
5268
5279
|
}
|
|
5269
|
-
|
|
5280
|
+
Ie.receivers = [];
|
|
5270
5281
|
/**
|
|
5271
5282
|
* @license
|
|
5272
5283
|
* Copyright 2020 Google LLC
|
|
@@ -5305,7 +5316,7 @@ function Ze(n = "", e = 10) {
|
|
|
5305
5316
|
* See the License for the specific language governing permissions and
|
|
5306
5317
|
* limitations under the License.
|
|
5307
5318
|
*/
|
|
5308
|
-
class
|
|
5319
|
+
class Is {
|
|
5309
5320
|
constructor(e) {
|
|
5310
5321
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
5311
5322
|
}
|
|
@@ -5339,9 +5350,9 @@ class vs {
|
|
|
5339
5350
|
);
|
|
5340
5351
|
let s, a;
|
|
5341
5352
|
return new Promise((c, o) => {
|
|
5342
|
-
const
|
|
5353
|
+
const u = Ze("", 20);
|
|
5343
5354
|
i.port1.start();
|
|
5344
|
-
const
|
|
5355
|
+
const l = setTimeout(() => {
|
|
5345
5356
|
o(new Error(
|
|
5346
5357
|
"unsupported_event"
|
|
5347
5358
|
/* _MessageError.UNSUPPORTED_EVENT */
|
|
@@ -5349,12 +5360,12 @@ class vs {
|
|
|
5349
5360
|
}, r);
|
|
5350
5361
|
a = {
|
|
5351
5362
|
messageChannel: i,
|
|
5352
|
-
onMessage(
|
|
5353
|
-
const
|
|
5354
|
-
if (
|
|
5355
|
-
switch (
|
|
5363
|
+
onMessage(d) {
|
|
5364
|
+
const f = d;
|
|
5365
|
+
if (f.data.eventId === u)
|
|
5366
|
+
switch (f.data.status) {
|
|
5356
5367
|
case "ack":
|
|
5357
|
-
clearTimeout(
|
|
5368
|
+
clearTimeout(l), s = setTimeout(
|
|
5358
5369
|
() => {
|
|
5359
5370
|
o(new Error(
|
|
5360
5371
|
"timeout"
|
|
@@ -5366,10 +5377,10 @@ class vs {
|
|
|
5366
5377
|
);
|
|
5367
5378
|
break;
|
|
5368
5379
|
case "done":
|
|
5369
|
-
clearTimeout(s), c(
|
|
5380
|
+
clearTimeout(s), c(f.data.response);
|
|
5370
5381
|
break;
|
|
5371
5382
|
default:
|
|
5372
|
-
clearTimeout(
|
|
5383
|
+
clearTimeout(l), clearTimeout(s), o(new Error(
|
|
5373
5384
|
"invalid_response"
|
|
5374
5385
|
/* _MessageError.INVALID_RESPONSE */
|
|
5375
5386
|
));
|
|
@@ -5378,7 +5389,7 @@ class vs {
|
|
|
5378
5389
|
}
|
|
5379
5390
|
}, this.handlers.add(a), i.port1.addEventListener("message", a.onMessage), this.target.postMessage({
|
|
5380
5391
|
eventType: e,
|
|
5381
|
-
eventId:
|
|
5392
|
+
eventId: u,
|
|
5382
5393
|
data: t
|
|
5383
5394
|
}, [i.port2]);
|
|
5384
5395
|
}).finally(() => {
|
|
@@ -5405,7 +5416,7 @@ class vs {
|
|
|
5405
5416
|
function y() {
|
|
5406
5417
|
return window;
|
|
5407
5418
|
}
|
|
5408
|
-
function
|
|
5419
|
+
function ws(n) {
|
|
5409
5420
|
y().location.href = n;
|
|
5410
5421
|
}
|
|
5411
5422
|
/**
|
|
@@ -5427,7 +5438,7 @@ function bs(n) {
|
|
|
5427
5438
|
function kn() {
|
|
5428
5439
|
return typeof y().WorkerGlobalScope < "u" && typeof y().importScripts == "function";
|
|
5429
5440
|
}
|
|
5430
|
-
async function
|
|
5441
|
+
async function Es() {
|
|
5431
5442
|
if (!(navigator != null && navigator.serviceWorker))
|
|
5432
5443
|
return null;
|
|
5433
5444
|
try {
|
|
@@ -5436,11 +5447,11 @@ async function Is() {
|
|
|
5436
5447
|
return null;
|
|
5437
5448
|
}
|
|
5438
5449
|
}
|
|
5439
|
-
function
|
|
5450
|
+
function Ts() {
|
|
5440
5451
|
var n;
|
|
5441
5452
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
5442
5453
|
}
|
|
5443
|
-
function
|
|
5454
|
+
function Ss() {
|
|
5444
5455
|
return kn() ? self : null;
|
|
5445
5456
|
}
|
|
5446
5457
|
/**
|
|
@@ -5459,7 +5470,7 @@ function Es() {
|
|
|
5459
5470
|
* See the License for the specific language governing permissions and
|
|
5460
5471
|
* limitations under the License.
|
|
5461
5472
|
*/
|
|
5462
|
-
const An = "firebaseLocalStorageDb",
|
|
5473
|
+
const An = "firebaseLocalStorageDb", ks = 1, ye = "firebaseLocalStorage", Rn = "fbase_key";
|
|
5463
5474
|
class re {
|
|
5464
5475
|
constructor(e) {
|
|
5465
5476
|
this.request = e;
|
|
@@ -5474,47 +5485,47 @@ class re {
|
|
|
5474
5485
|
});
|
|
5475
5486
|
}
|
|
5476
5487
|
}
|
|
5477
|
-
function
|
|
5478
|
-
return n.transaction([
|
|
5488
|
+
function we(n, e) {
|
|
5489
|
+
return n.transaction([ye], e ? "readwrite" : "readonly").objectStore(ye);
|
|
5479
5490
|
}
|
|
5480
|
-
function
|
|
5491
|
+
function As() {
|
|
5481
5492
|
const n = indexedDB.deleteDatabase(An);
|
|
5482
5493
|
return new re(n).toPromise();
|
|
5483
5494
|
}
|
|
5484
|
-
function
|
|
5485
|
-
const n = indexedDB.open(An,
|
|
5495
|
+
function je() {
|
|
5496
|
+
const n = indexedDB.open(An, ks);
|
|
5486
5497
|
return new Promise((e, t) => {
|
|
5487
5498
|
n.addEventListener("error", () => {
|
|
5488
5499
|
t(n.error);
|
|
5489
5500
|
}), n.addEventListener("upgradeneeded", () => {
|
|
5490
5501
|
const r = n.result;
|
|
5491
5502
|
try {
|
|
5492
|
-
r.createObjectStore(
|
|
5503
|
+
r.createObjectStore(ye, { keyPath: Rn });
|
|
5493
5504
|
} catch (i) {
|
|
5494
5505
|
t(i);
|
|
5495
5506
|
}
|
|
5496
5507
|
}), n.addEventListener("success", async () => {
|
|
5497
5508
|
const r = n.result;
|
|
5498
|
-
r.objectStoreNames.contains(
|
|
5509
|
+
r.objectStoreNames.contains(ye) ? e(r) : (r.close(), await As(), e(await je()));
|
|
5499
5510
|
});
|
|
5500
5511
|
});
|
|
5501
5512
|
}
|
|
5502
5513
|
async function St(n, e, t) {
|
|
5503
|
-
const r =
|
|
5514
|
+
const r = we(n, !0).put({
|
|
5504
5515
|
[Rn]: e,
|
|
5505
5516
|
value: t
|
|
5506
5517
|
});
|
|
5507
5518
|
return new re(r).toPromise();
|
|
5508
5519
|
}
|
|
5509
|
-
async function
|
|
5510
|
-
const t =
|
|
5520
|
+
async function Rs(n, e) {
|
|
5521
|
+
const t = we(n, !1).get(e), r = await new re(t).toPromise();
|
|
5511
5522
|
return r === void 0 ? null : r.value;
|
|
5512
5523
|
}
|
|
5513
5524
|
function kt(n, e) {
|
|
5514
|
-
const t =
|
|
5525
|
+
const t = we(n, !0).delete(e);
|
|
5515
5526
|
return new re(t).toPromise();
|
|
5516
5527
|
}
|
|
5517
|
-
const
|
|
5528
|
+
const Cs = 800, Ps = 3;
|
|
5518
5529
|
class Cn {
|
|
5519
5530
|
constructor() {
|
|
5520
5531
|
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(() => {
|
|
@@ -5522,7 +5533,7 @@ class Cn {
|
|
|
5522
5533
|
});
|
|
5523
5534
|
}
|
|
5524
5535
|
async _openDb() {
|
|
5525
|
-
return this.db ? this.db : (this.db = await
|
|
5536
|
+
return this.db ? this.db : (this.db = await je(), this.db);
|
|
5526
5537
|
}
|
|
5527
5538
|
async _withRetries(e) {
|
|
5528
5539
|
let t = 0;
|
|
@@ -5531,7 +5542,7 @@ class Cn {
|
|
|
5531
5542
|
const r = await this._openDb();
|
|
5532
5543
|
return await e(r);
|
|
5533
5544
|
} catch (r) {
|
|
5534
|
-
if (t++ >
|
|
5545
|
+
if (t++ > Ps)
|
|
5535
5546
|
throw r;
|
|
5536
5547
|
this.db && (this.db.close(), this.db = void 0);
|
|
5537
5548
|
}
|
|
@@ -5547,7 +5558,7 @@ class Cn {
|
|
|
5547
5558
|
* As the worker we should listen to events from the main window.
|
|
5548
5559
|
*/
|
|
5549
5560
|
async initializeReceiver() {
|
|
5550
|
-
this.receiver =
|
|
5561
|
+
this.receiver = Ie._getInstance(Ss()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
5551
5562
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
5552
5563
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
5553
5564
|
"keyChanged"
|
|
@@ -5563,9 +5574,9 @@ class Cn {
|
|
|
5563
5574
|
*/
|
|
5564
5575
|
async initializeSender() {
|
|
5565
5576
|
var e, t;
|
|
5566
|
-
if (this.activeServiceWorker = await
|
|
5577
|
+
if (this.activeServiceWorker = await Es(), !this.activeServiceWorker)
|
|
5567
5578
|
return;
|
|
5568
|
-
this.sender = new
|
|
5579
|
+
this.sender = new Is(this.activeServiceWorker);
|
|
5569
5580
|
const r = await this.sender._send(
|
|
5570
5581
|
"ping",
|
|
5571
5582
|
{},
|
|
@@ -5587,7 +5598,7 @@ class Cn {
|
|
|
5587
5598
|
* @param key - Storage key which changed.
|
|
5588
5599
|
*/
|
|
5589
5600
|
async notifyServiceWorker(e) {
|
|
5590
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
5601
|
+
if (!(!this.sender || !this.activeServiceWorker || Ts() !== this.activeServiceWorker))
|
|
5591
5602
|
try {
|
|
5592
5603
|
await this.sender._send(
|
|
5593
5604
|
"keyChanged",
|
|
@@ -5603,8 +5614,8 @@ class Cn {
|
|
|
5603
5614
|
try {
|
|
5604
5615
|
if (!indexedDB)
|
|
5605
5616
|
return !1;
|
|
5606
|
-
const e = await
|
|
5607
|
-
return await St(e,
|
|
5617
|
+
const e = await je();
|
|
5618
|
+
return await St(e, _e, "1"), await kt(e, _e), !0;
|
|
5608
5619
|
} catch {
|
|
5609
5620
|
}
|
|
5610
5621
|
return !1;
|
|
@@ -5621,7 +5632,7 @@ class Cn {
|
|
|
5621
5632
|
return this._withPendingWrite(async () => (await this._withRetries((r) => St(r, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
5622
5633
|
}
|
|
5623
5634
|
async _get(e) {
|
|
5624
|
-
const t = await this._withRetries((r) =>
|
|
5635
|
+
const t = await this._withRetries((r) => Rs(r, e));
|
|
5625
5636
|
return this.localCache[e] = t, t;
|
|
5626
5637
|
}
|
|
5627
5638
|
async _remove(e) {
|
|
@@ -5629,7 +5640,7 @@ class Cn {
|
|
|
5629
5640
|
}
|
|
5630
5641
|
async _poll() {
|
|
5631
5642
|
const e = await this._withRetries((i) => {
|
|
5632
|
-
const s =
|
|
5643
|
+
const s = we(i, !1).getAll();
|
|
5633
5644
|
return new re(s).toPromise();
|
|
5634
5645
|
});
|
|
5635
5646
|
if (!e)
|
|
@@ -5652,7 +5663,7 @@ class Cn {
|
|
|
5652
5663
|
i(t);
|
|
5653
5664
|
}
|
|
5654
5665
|
startPolling() {
|
|
5655
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
5666
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), Cs);
|
|
5656
5667
|
}
|
|
5657
5668
|
stopPolling() {
|
|
5658
5669
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -5665,7 +5676,7 @@ class Cn {
|
|
|
5665
5676
|
}
|
|
5666
5677
|
}
|
|
5667
5678
|
Cn.type = "LOCAL";
|
|
5668
|
-
const
|
|
5679
|
+
const Os = Cn;
|
|
5669
5680
|
new te(3e4, 6e4);
|
|
5670
5681
|
/**
|
|
5671
5682
|
* @license
|
|
@@ -5683,8 +5694,8 @@ new te(3e4, 6e4);
|
|
|
5683
5694
|
* See the License for the specific language governing permissions and
|
|
5684
5695
|
* limitations under the License.
|
|
5685
5696
|
*/
|
|
5686
|
-
function
|
|
5687
|
-
return e ?
|
|
5697
|
+
function Ds(n, e) {
|
|
5698
|
+
return e ? E(e) : (h(
|
|
5688
5699
|
n._popupRedirectResolver,
|
|
5689
5700
|
n,
|
|
5690
5701
|
"argument-error"
|
|
@@ -5737,26 +5748,26 @@ class et extends vn {
|
|
|
5737
5748
|
return e && (t.idToken = e), t;
|
|
5738
5749
|
}
|
|
5739
5750
|
}
|
|
5740
|
-
function
|
|
5741
|
-
return
|
|
5751
|
+
function Ns(n) {
|
|
5752
|
+
return hs(n.auth, new et(n), n.bypassAuthState);
|
|
5742
5753
|
}
|
|
5743
|
-
function
|
|
5754
|
+
function Ls(n) {
|
|
5744
5755
|
const { auth: e, user: t } = n;
|
|
5745
|
-
return
|
|
5756
|
+
return h(
|
|
5746
5757
|
t,
|
|
5747
5758
|
e,
|
|
5748
5759
|
"internal-error"
|
|
5749
5760
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
5750
|
-
),
|
|
5761
|
+
), ds(t, new et(n), n.bypassAuthState);
|
|
5751
5762
|
}
|
|
5752
|
-
async function
|
|
5763
|
+
async function Ms(n) {
|
|
5753
5764
|
const { auth: e, user: t } = n;
|
|
5754
|
-
return
|
|
5765
|
+
return h(
|
|
5755
5766
|
t,
|
|
5756
5767
|
e,
|
|
5757
5768
|
"internal-error"
|
|
5758
5769
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
5759
|
-
),
|
|
5770
|
+
), us(t, new et(n), n.bypassAuthState);
|
|
5760
5771
|
}
|
|
5761
5772
|
/**
|
|
5762
5773
|
* @license
|
|
@@ -5805,8 +5816,8 @@ class Pn {
|
|
|
5805
5816
|
};
|
|
5806
5817
|
try {
|
|
5807
5818
|
this.resolve(await this.getIdpTask(c)(o));
|
|
5808
|
-
} catch (
|
|
5809
|
-
this.reject(
|
|
5819
|
+
} catch (u) {
|
|
5820
|
+
this.reject(u);
|
|
5810
5821
|
}
|
|
5811
5822
|
}
|
|
5812
5823
|
onError(e) {
|
|
@@ -5816,15 +5827,15 @@ class Pn {
|
|
|
5816
5827
|
switch (e) {
|
|
5817
5828
|
case "signInViaPopup":
|
|
5818
5829
|
case "signInViaRedirect":
|
|
5819
|
-
return
|
|
5830
|
+
return Ns;
|
|
5820
5831
|
case "linkViaPopup":
|
|
5821
5832
|
case "linkViaRedirect":
|
|
5822
|
-
return
|
|
5833
|
+
return Ms;
|
|
5823
5834
|
case "reauthViaPopup":
|
|
5824
5835
|
case "reauthViaRedirect":
|
|
5825
|
-
return
|
|
5836
|
+
return Ls;
|
|
5826
5837
|
default:
|
|
5827
|
-
|
|
5838
|
+
S(
|
|
5828
5839
|
this.auth,
|
|
5829
5840
|
"internal-error"
|
|
5830
5841
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -5832,10 +5843,10 @@ class Pn {
|
|
|
5832
5843
|
}
|
|
5833
5844
|
}
|
|
5834
5845
|
resolve(e) {
|
|
5835
|
-
|
|
5846
|
+
k(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.resolve(e), this.unregisterAndCleanUp();
|
|
5836
5847
|
}
|
|
5837
5848
|
reject(e) {
|
|
5838
|
-
|
|
5849
|
+
k(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.reject(e), this.unregisterAndCleanUp();
|
|
5839
5850
|
}
|
|
5840
5851
|
unregisterAndCleanUp() {
|
|
5841
5852
|
this.eventManager && this.eventManager.unregisterConsumer(this), this.pendingPromise = null, this.cleanUp();
|
|
@@ -5857,14 +5868,14 @@ class Pn {
|
|
|
5857
5868
|
* See the License for the specific language governing permissions and
|
|
5858
5869
|
* limitations under the License.
|
|
5859
5870
|
*/
|
|
5860
|
-
const
|
|
5871
|
+
const Us = new te(2e3, 1e4);
|
|
5861
5872
|
class B extends Pn {
|
|
5862
5873
|
constructor(e, t, r, i, s) {
|
|
5863
5874
|
super(e, t, i, s), this.provider = r, this.authWindow = null, this.pollId = null, B.currentPopupAction && B.currentPopupAction.cancel(), B.currentPopupAction = this;
|
|
5864
5875
|
}
|
|
5865
5876
|
async executeNotNull() {
|
|
5866
5877
|
const e = await this.execute();
|
|
5867
|
-
return
|
|
5878
|
+
return h(
|
|
5868
5879
|
e,
|
|
5869
5880
|
this.auth,
|
|
5870
5881
|
"internal-error"
|
|
@@ -5872,7 +5883,7 @@ class B extends Pn {
|
|
|
5872
5883
|
), e;
|
|
5873
5884
|
}
|
|
5874
5885
|
async onExecution() {
|
|
5875
|
-
|
|
5886
|
+
k(this.filter.length === 1, "Popup operations only handle one event");
|
|
5876
5887
|
const e = Ze();
|
|
5877
5888
|
this.authWindow = await this.resolver._openPopup(
|
|
5878
5889
|
this.auth,
|
|
@@ -5921,7 +5932,7 @@ class B extends Pn {
|
|
|
5921
5932
|
);
|
|
5922
5933
|
return;
|
|
5923
5934
|
}
|
|
5924
|
-
this.pollId = window.setTimeout(e,
|
|
5935
|
+
this.pollId = window.setTimeout(e, Us.get());
|
|
5925
5936
|
};
|
|
5926
5937
|
e();
|
|
5927
5938
|
}
|
|
@@ -5943,8 +5954,8 @@ B.currentPopupAction = null;
|
|
|
5943
5954
|
* See the License for the specific language governing permissions and
|
|
5944
5955
|
* limitations under the License.
|
|
5945
5956
|
*/
|
|
5946
|
-
const
|
|
5947
|
-
class
|
|
5957
|
+
const xs = "pendingRedirect", oe = /* @__PURE__ */ new Map();
|
|
5958
|
+
class Fs extends Pn {
|
|
5948
5959
|
constructor(e, t, r = !1) {
|
|
5949
5960
|
super(e, [
|
|
5950
5961
|
"signInViaRedirect",
|
|
@@ -5962,7 +5973,7 @@ class Us extends Pn {
|
|
|
5962
5973
|
let e = oe.get(this.auth._key());
|
|
5963
5974
|
if (!e) {
|
|
5964
5975
|
try {
|
|
5965
|
-
const r = await
|
|
5976
|
+
const r = await Bs(this.resolver, this.auth) ? await super.execute() : null;
|
|
5966
5977
|
e = () => Promise.resolve(r);
|
|
5967
5978
|
} catch (t) {
|
|
5968
5979
|
e = () => Promise.reject(t);
|
|
@@ -5990,26 +6001,26 @@ class Us extends Pn {
|
|
|
5990
6001
|
cleanUp() {
|
|
5991
6002
|
}
|
|
5992
6003
|
}
|
|
5993
|
-
async function
|
|
5994
|
-
const t =
|
|
6004
|
+
async function Bs(n, e) {
|
|
6005
|
+
const t = Vs(e), r = Hs(n);
|
|
5995
6006
|
if (!await r._isAvailable())
|
|
5996
6007
|
return !1;
|
|
5997
6008
|
const i = await r._get(t) === "true";
|
|
5998
6009
|
return await r._remove(t), i;
|
|
5999
6010
|
}
|
|
6000
|
-
function
|
|
6011
|
+
function $s(n, e) {
|
|
6001
6012
|
oe.set(n._key(), e);
|
|
6002
6013
|
}
|
|
6003
|
-
function
|
|
6004
|
-
return
|
|
6014
|
+
function Hs(n) {
|
|
6015
|
+
return E(n._redirectPersistence);
|
|
6005
6016
|
}
|
|
6006
|
-
function
|
|
6007
|
-
return ae(
|
|
6017
|
+
function Vs(n) {
|
|
6018
|
+
return ae(xs, n.config.apiKey, n.name);
|
|
6008
6019
|
}
|
|
6009
|
-
async function
|
|
6010
|
-
if (
|
|
6011
|
-
return Promise.reject(
|
|
6012
|
-
const r =
|
|
6020
|
+
async function js(n, e, t = !1) {
|
|
6021
|
+
if (b(n.app))
|
|
6022
|
+
return Promise.reject(L(n));
|
|
6023
|
+
const r = be(n), i = Ds(r, e), a = await new Fs(r, i, t).execute();
|
|
6013
6024
|
return a && !t && (delete a.user._redirectEventId, await r._persistUserIfCurrent(a.user), await r._setRedirectUser(null, e)), a;
|
|
6014
6025
|
}
|
|
6015
6026
|
/**
|
|
@@ -6028,8 +6039,8 @@ async function Hs(n, e, t = !1) {
|
|
|
6028
6039
|
* See the License for the specific language governing permissions and
|
|
6029
6040
|
* limitations under the License.
|
|
6030
6041
|
*/
|
|
6031
|
-
const
|
|
6032
|
-
class
|
|
6042
|
+
const Ws = 10 * 60 * 1e3;
|
|
6043
|
+
class zs {
|
|
6033
6044
|
constructor(e) {
|
|
6034
6045
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
6035
6046
|
}
|
|
@@ -6045,7 +6056,7 @@ class js {
|
|
|
6045
6056
|
let t = !1;
|
|
6046
6057
|
return this.consumers.forEach((r) => {
|
|
6047
6058
|
this.isEventForConsumer(e, r) && (t = !0, this.sendToConsumer(e, r), this.saveEventToCache(e));
|
|
6048
|
-
}), this.hasHandledPotentialRedirect || !
|
|
6059
|
+
}), this.hasHandledPotentialRedirect || !Gs(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
6049
6060
|
}
|
|
6050
6061
|
sendToConsumer(e, t) {
|
|
6051
6062
|
var r;
|
|
@@ -6060,7 +6071,7 @@ class js {
|
|
|
6060
6071
|
return t.filter.includes(e.type) && r;
|
|
6061
6072
|
}
|
|
6062
6073
|
hasEventBeenHandled(e) {
|
|
6063
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
6074
|
+
return Date.now() - this.lastProcessedEventTime >= Ws && this.cachedEventUids.clear(), this.cachedEventUids.has(At(e));
|
|
6064
6075
|
}
|
|
6065
6076
|
saveEventToCache(e) {
|
|
6066
6077
|
this.cachedEventUids.add(At(e)), this.lastProcessedEventTime = Date.now();
|
|
@@ -6072,7 +6083,7 @@ function At(n) {
|
|
|
6072
6083
|
function On({ type: n, error: e }) {
|
|
6073
6084
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
6074
6085
|
}
|
|
6075
|
-
function
|
|
6086
|
+
function Gs(n) {
|
|
6076
6087
|
switch (n.type) {
|
|
6077
6088
|
case "signInViaRedirect":
|
|
6078
6089
|
case "linkViaRedirect":
|
|
@@ -6100,7 +6111,7 @@ function Ws(n) {
|
|
|
6100
6111
|
* See the License for the specific language governing permissions and
|
|
6101
6112
|
* limitations under the License.
|
|
6102
6113
|
*/
|
|
6103
|
-
async function
|
|
6114
|
+
async function qs(n, e = {}) {
|
|
6104
6115
|
return G(n, "GET", "/v1/projects", e);
|
|
6105
6116
|
}
|
|
6106
6117
|
/**
|
|
@@ -6119,32 +6130,32 @@ async function zs(n, e = {}) {
|
|
|
6119
6130
|
* See the License for the specific language governing permissions and
|
|
6120
6131
|
* limitations under the License.
|
|
6121
6132
|
*/
|
|
6122
|
-
const
|
|
6123
|
-
async function
|
|
6133
|
+
const Ks = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Js = /^https?/;
|
|
6134
|
+
async function Ys(n) {
|
|
6124
6135
|
if (n.config.emulator)
|
|
6125
6136
|
return;
|
|
6126
|
-
const { authorizedDomains: e } = await
|
|
6137
|
+
const { authorizedDomains: e } = await qs(n);
|
|
6127
6138
|
for (const t of e)
|
|
6128
6139
|
try {
|
|
6129
|
-
if (
|
|
6140
|
+
if (Xs(t))
|
|
6130
6141
|
return;
|
|
6131
6142
|
} catch {
|
|
6132
6143
|
}
|
|
6133
|
-
|
|
6144
|
+
S(
|
|
6134
6145
|
n,
|
|
6135
6146
|
"unauthorized-domain"
|
|
6136
6147
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
6137
6148
|
);
|
|
6138
6149
|
}
|
|
6139
|
-
function
|
|
6140
|
-
const e =
|
|
6150
|
+
function Xs(n) {
|
|
6151
|
+
const e = He(), { protocol: t, hostname: r } = new URL(e);
|
|
6141
6152
|
if (n.startsWith("chrome-extension://")) {
|
|
6142
6153
|
const a = new URL(n);
|
|
6143
6154
|
return a.hostname === "" && r === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && a.hostname === r;
|
|
6144
6155
|
}
|
|
6145
|
-
if (!
|
|
6156
|
+
if (!Js.test(t))
|
|
6146
6157
|
return !1;
|
|
6147
|
-
if (
|
|
6158
|
+
if (Ks.test(n))
|
|
6148
6159
|
return r === n;
|
|
6149
6160
|
const i = n.replace(/\./g, "\\.");
|
|
6150
6161
|
return new RegExp("^(.+\\." + i + "|" + i + ")$", "i").test(r);
|
|
@@ -6165,7 +6176,7 @@ function Js(n) {
|
|
|
6165
6176
|
* See the License for the specific language governing permissions and
|
|
6166
6177
|
* limitations under the License.
|
|
6167
6178
|
*/
|
|
6168
|
-
const
|
|
6179
|
+
const Qs = new te(3e4, 6e4);
|
|
6169
6180
|
function Rt() {
|
|
6170
6181
|
const n = y().___jsl;
|
|
6171
6182
|
if (n != null && n.H) {
|
|
@@ -6175,7 +6186,7 @@ function Rt() {
|
|
|
6175
6186
|
n.CP[t] = null;
|
|
6176
6187
|
}
|
|
6177
6188
|
}
|
|
6178
|
-
function
|
|
6189
|
+
function Zs(n) {
|
|
6179
6190
|
return new Promise((e, t) => {
|
|
6180
6191
|
var r, i, s;
|
|
6181
6192
|
function a() {
|
|
@@ -6190,7 +6201,7 @@ function Xs(n) {
|
|
|
6190
6201
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
6191
6202
|
));
|
|
6192
6203
|
},
|
|
6193
|
-
timeout:
|
|
6204
|
+
timeout: Qs.get()
|
|
6194
6205
|
});
|
|
6195
6206
|
}
|
|
6196
6207
|
if (!((i = (r = y().gapi) === null || r === void 0 ? void 0 : r.iframes) === null || i === void 0) && i.Iframe)
|
|
@@ -6198,22 +6209,22 @@ function Xs(n) {
|
|
|
6198
6209
|
else if (!((s = y().gapi) === null || s === void 0) && s.load)
|
|
6199
6210
|
a();
|
|
6200
6211
|
else {
|
|
6201
|
-
const c =
|
|
6212
|
+
const c = rs("iframefcb");
|
|
6202
6213
|
return y()[c] = () => {
|
|
6203
6214
|
gapi.load ? a() : t(_(
|
|
6204
6215
|
n,
|
|
6205
6216
|
"network-request-failed"
|
|
6206
6217
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
6207
6218
|
));
|
|
6208
|
-
},
|
|
6219
|
+
}, ts(`${ns()}?onload=${c}`).catch((o) => t(o));
|
|
6209
6220
|
}
|
|
6210
6221
|
}).catch((e) => {
|
|
6211
6222
|
throw ce = null, e;
|
|
6212
6223
|
});
|
|
6213
6224
|
}
|
|
6214
6225
|
let ce = null;
|
|
6215
|
-
function
|
|
6216
|
-
return ce = ce ||
|
|
6226
|
+
function ea(n) {
|
|
6227
|
+
return ce = ce || Zs(n), ce;
|
|
6217
6228
|
}
|
|
6218
6229
|
/**
|
|
6219
6230
|
* @license
|
|
@@ -6231,7 +6242,7 @@ function Qs(n) {
|
|
|
6231
6242
|
* See the License for the specific language governing permissions and
|
|
6232
6243
|
* limitations under the License.
|
|
6233
6244
|
*/
|
|
6234
|
-
const
|
|
6245
|
+
const ta = new te(5e3, 15e3), na = "__/auth/iframe", ra = "emulator/auth/iframe", ia = {
|
|
6235
6246
|
style: {
|
|
6236
6247
|
position: "absolute",
|
|
6237
6248
|
top: "-100px",
|
|
@@ -6240,41 +6251,41 @@ const Zs = new te(5e3, 15e3), ea = "__/auth/iframe", ta = "emulator/auth/iframe"
|
|
|
6240
6251
|
},
|
|
6241
6252
|
"aria-hidden": "true",
|
|
6242
6253
|
tabindex: "-1"
|
|
6243
|
-
},
|
|
6254
|
+
}, sa = /* @__PURE__ */ new Map([
|
|
6244
6255
|
["identitytoolkit.googleapis.com", "p"],
|
|
6245
6256
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
6246
6257
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
6247
6258
|
// test
|
|
6248
6259
|
]);
|
|
6249
|
-
function
|
|
6260
|
+
function aa(n) {
|
|
6250
6261
|
const e = n.config;
|
|
6251
|
-
|
|
6262
|
+
h(
|
|
6252
6263
|
e.authDomain,
|
|
6253
6264
|
n,
|
|
6254
6265
|
"auth-domain-config-required"
|
|
6255
6266
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
6256
6267
|
);
|
|
6257
|
-
const t = e.emulator ? Je(e,
|
|
6268
|
+
const t = e.emulator ? Je(e, ra) : `https://${n.config.authDomain}/${na}`, r = {
|
|
6258
6269
|
apiKey: e.apiKey,
|
|
6259
6270
|
appName: n.name,
|
|
6260
6271
|
v: ee
|
|
6261
|
-
}, i =
|
|
6272
|
+
}, i = sa.get(n.config.apiHost);
|
|
6262
6273
|
i && (r.eid = i);
|
|
6263
6274
|
const s = n._getFrameworks();
|
|
6264
6275
|
return s.length && (r.fw = s.join(",")), `${t}?${Z(r).slice(1)}`;
|
|
6265
6276
|
}
|
|
6266
|
-
async function
|
|
6267
|
-
const e = await
|
|
6268
|
-
return
|
|
6277
|
+
async function oa(n) {
|
|
6278
|
+
const e = await ea(n), t = y().gapi;
|
|
6279
|
+
return h(
|
|
6269
6280
|
t,
|
|
6270
6281
|
n,
|
|
6271
6282
|
"internal-error"
|
|
6272
6283
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
6273
6284
|
), e.open({
|
|
6274
6285
|
where: document.body,
|
|
6275
|
-
url:
|
|
6286
|
+
url: aa(n),
|
|
6276
6287
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
6277
|
-
attributes:
|
|
6288
|
+
attributes: ia,
|
|
6278
6289
|
dontclear: !0
|
|
6279
6290
|
}, (r) => new Promise(async (i, s) => {
|
|
6280
6291
|
await r.restyle({
|
|
@@ -6287,7 +6298,7 @@ async function sa(n) {
|
|
|
6287
6298
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
6288
6299
|
), c = y().setTimeout(() => {
|
|
6289
6300
|
s(a);
|
|
6290
|
-
},
|
|
6301
|
+
}, ta.get());
|
|
6291
6302
|
function o() {
|
|
6292
6303
|
y().clearTimeout(c), i(r);
|
|
6293
6304
|
}
|
|
@@ -6312,12 +6323,12 @@ async function sa(n) {
|
|
|
6312
6323
|
* See the License for the specific language governing permissions and
|
|
6313
6324
|
* limitations under the License.
|
|
6314
6325
|
*/
|
|
6315
|
-
const
|
|
6326
|
+
const ca = {
|
|
6316
6327
|
location: "yes",
|
|
6317
6328
|
resizable: "yes",
|
|
6318
6329
|
statusbar: "yes",
|
|
6319
6330
|
toolbar: "no"
|
|
6320
|
-
},
|
|
6331
|
+
}, la = 500, ua = 600, da = "_blank", ha = "http://localhost";
|
|
6321
6332
|
class Ct {
|
|
6322
6333
|
constructor(e) {
|
|
6323
6334
|
this.window = e, this.associatedEvent = null;
|
|
@@ -6330,33 +6341,33 @@ class Ct {
|
|
|
6330
6341
|
}
|
|
6331
6342
|
}
|
|
6332
6343
|
}
|
|
6333
|
-
function
|
|
6344
|
+
function fa(n, e, t, r = la, i = ua) {
|
|
6334
6345
|
const s = Math.max((window.screen.availHeight - i) / 2, 0).toString(), a = Math.max((window.screen.availWidth - r) / 2, 0).toString();
|
|
6335
6346
|
let c = "";
|
|
6336
|
-
const o = Object.assign(Object.assign({},
|
|
6347
|
+
const o = Object.assign(Object.assign({}, ca), {
|
|
6337
6348
|
width: r.toString(),
|
|
6338
6349
|
height: i.toString(),
|
|
6339
6350
|
top: s,
|
|
6340
6351
|
left: a
|
|
6341
|
-
}),
|
|
6342
|
-
t && (c = dn(
|
|
6343
|
-
const
|
|
6344
|
-
if (
|
|
6345
|
-
return
|
|
6346
|
-
const
|
|
6347
|
-
|
|
6348
|
-
|
|
6352
|
+
}), u = m().toLowerCase();
|
|
6353
|
+
t && (c = dn(u) ? da : t), ln(u) && (e = e || ha, o.scrollbars = "yes");
|
|
6354
|
+
const l = Object.entries(o).reduce((f, [g, v]) => `${f}${g}=${v},`, "");
|
|
6355
|
+
if (qi(u) && c !== "_self")
|
|
6356
|
+
return pa(e || "", c), new Ct(null);
|
|
6357
|
+
const d = window.open(e || "", c, l);
|
|
6358
|
+
h(
|
|
6359
|
+
d,
|
|
6349
6360
|
n,
|
|
6350
6361
|
"popup-blocked"
|
|
6351
6362
|
/* AuthErrorCode.POPUP_BLOCKED */
|
|
6352
6363
|
);
|
|
6353
6364
|
try {
|
|
6354
|
-
|
|
6365
|
+
d.focus();
|
|
6355
6366
|
} catch {
|
|
6356
6367
|
}
|
|
6357
|
-
return new Ct(
|
|
6368
|
+
return new Ct(d);
|
|
6358
6369
|
}
|
|
6359
|
-
function
|
|
6370
|
+
function pa(n, e) {
|
|
6360
6371
|
const t = document.createElement("a");
|
|
6361
6372
|
t.href = n, t.target = e;
|
|
6362
6373
|
const r = document.createEvent("MouseEvent");
|
|
@@ -6378,14 +6389,14 @@ function ha(n, e) {
|
|
|
6378
6389
|
* See the License for the specific language governing permissions and
|
|
6379
6390
|
* limitations under the License.
|
|
6380
6391
|
*/
|
|
6381
|
-
const
|
|
6392
|
+
const ma = "__/auth/handler", ga = "emulator/auth/handler", _a = encodeURIComponent("fac");
|
|
6382
6393
|
async function Pt(n, e, t, r, i, s) {
|
|
6383
|
-
|
|
6394
|
+
h(
|
|
6384
6395
|
n.config.authDomain,
|
|
6385
6396
|
n,
|
|
6386
6397
|
"auth-domain-config-required"
|
|
6387
6398
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
6388
|
-
),
|
|
6399
|
+
), h(
|
|
6389
6400
|
n.config.apiKey,
|
|
6390
6401
|
n,
|
|
6391
6402
|
"invalid-api-key"
|
|
@@ -6400,23 +6411,23 @@ async function Pt(n, e, t, r, i, s) {
|
|
|
6400
6411
|
eventId: i
|
|
6401
6412
|
};
|
|
6402
6413
|
if (e instanceof bn) {
|
|
6403
|
-
e.setDefaultLanguage(n.languageCode), a.providerId = e.providerId || "",
|
|
6404
|
-
for (const [
|
|
6405
|
-
a[
|
|
6414
|
+
e.setDefaultLanguage(n.languageCode), a.providerId = e.providerId || "", _r(e.getCustomParameters()) || (a.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
6415
|
+
for (const [l, d] of Object.entries({}))
|
|
6416
|
+
a[l] = d;
|
|
6406
6417
|
}
|
|
6407
6418
|
if (e instanceof ne) {
|
|
6408
|
-
const
|
|
6409
|
-
|
|
6419
|
+
const l = e.getScopes().filter((d) => d !== "");
|
|
6420
|
+
l.length > 0 && (a.scopes = l.join(","));
|
|
6410
6421
|
}
|
|
6411
6422
|
n.tenantId && (a.tid = n.tenantId);
|
|
6412
6423
|
const c = a;
|
|
6413
|
-
for (const
|
|
6414
|
-
c[
|
|
6415
|
-
const o = await n._getAppCheckToken(),
|
|
6416
|
-
return `${
|
|
6424
|
+
for (const l of Object.keys(c))
|
|
6425
|
+
c[l] === void 0 && delete c[l];
|
|
6426
|
+
const o = await n._getAppCheckToken(), u = o ? `#${_a}=${encodeURIComponent(o)}` : "";
|
|
6427
|
+
return `${ya(n)}?${Z(c).slice(1)}${u}`;
|
|
6417
6428
|
}
|
|
6418
|
-
function
|
|
6419
|
-
return n.emulator ? Je(n,
|
|
6429
|
+
function ya({ config: n }) {
|
|
6430
|
+
return n.emulator ? Je(n, ga) : `https://${n.authDomain}/${ma}`;
|
|
6420
6431
|
}
|
|
6421
6432
|
/**
|
|
6422
6433
|
* @license
|
|
@@ -6434,30 +6445,30 @@ function ga({ config: n }) {
|
|
|
6434
6445
|
* See the License for the specific language governing permissions and
|
|
6435
6446
|
* limitations under the License.
|
|
6436
6447
|
*/
|
|
6437
|
-
const
|
|
6438
|
-
class
|
|
6448
|
+
const Ne = "webStorageSupport";
|
|
6449
|
+
class va {
|
|
6439
6450
|
constructor() {
|
|
6440
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Sn, this._completeRedirectFn =
|
|
6451
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Sn, this._completeRedirectFn = js, this._overrideRedirectResult = $s;
|
|
6441
6452
|
}
|
|
6442
6453
|
// Wrapping in async even though we don't await anywhere in order
|
|
6443
6454
|
// to make sure errors are raised as promise rejections
|
|
6444
6455
|
async _openPopup(e, t, r, i) {
|
|
6445
6456
|
var s;
|
|
6446
|
-
|
|
6447
|
-
const a = await Pt(e, t, r,
|
|
6448
|
-
return
|
|
6457
|
+
k((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
6458
|
+
const a = await Pt(e, t, r, He(), i);
|
|
6459
|
+
return fa(e, a, Ze());
|
|
6449
6460
|
}
|
|
6450
6461
|
async _openRedirect(e, t, r, i) {
|
|
6451
6462
|
await this._originValidation(e);
|
|
6452
|
-
const s = await Pt(e, t, r,
|
|
6453
|
-
return
|
|
6463
|
+
const s = await Pt(e, t, r, He(), i);
|
|
6464
|
+
return ws(s), new Promise(() => {
|
|
6454
6465
|
});
|
|
6455
6466
|
}
|
|
6456
6467
|
_initialize(e) {
|
|
6457
6468
|
const t = e._key();
|
|
6458
6469
|
if (this.eventManagers[t]) {
|
|
6459
6470
|
const { manager: i, promise: s } = this.eventManagers[t];
|
|
6460
|
-
return i ? Promise.resolve(i) : (
|
|
6471
|
+
return i ? Promise.resolve(i) : (k(s, "If manager is not set, promise should be"), s);
|
|
6461
6472
|
}
|
|
6462
6473
|
const r = this.initAndGetManager(e);
|
|
6463
6474
|
return this.eventManagers[t] = { promise: r }, r.catch(() => {
|
|
@@ -6465,8 +6476,8 @@ class _a {
|
|
|
6465
6476
|
}), r;
|
|
6466
6477
|
}
|
|
6467
6478
|
async initAndGetManager(e) {
|
|
6468
|
-
const t = await
|
|
6469
|
-
return t.register("authEvent", (i) => (
|
|
6479
|
+
const t = await oa(e), r = new zs(e);
|
|
6480
|
+
return t.register("authEvent", (i) => (h(
|
|
6470
6481
|
i == null ? void 0 : i.authEvent,
|
|
6471
6482
|
e,
|
|
6472
6483
|
"invalid-auth-event"
|
|
@@ -6477,10 +6488,10 @@ class _a {
|
|
|
6477
6488
|
}), gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER), this.eventManagers[e._key()] = { manager: r }, this.iframes[e._key()] = t, r;
|
|
6478
6489
|
}
|
|
6479
6490
|
_isIframeWebStorageSupported(e, t) {
|
|
6480
|
-
this.iframes[e._key()].send(
|
|
6491
|
+
this.iframes[e._key()].send(Ne, { type: Ne }, (i) => {
|
|
6481
6492
|
var s;
|
|
6482
|
-
const a = (s = i == null ? void 0 : i[0]) === null || s === void 0 ? void 0 : s[
|
|
6483
|
-
a !== void 0 && t(!!a),
|
|
6493
|
+
const a = (s = i == null ? void 0 : i[0]) === null || s === void 0 ? void 0 : s[Ne];
|
|
6494
|
+
a !== void 0 && t(!!a), S(
|
|
6484
6495
|
e,
|
|
6485
6496
|
"internal-error"
|
|
6486
6497
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -6489,13 +6500,13 @@ class _a {
|
|
|
6489
6500
|
}
|
|
6490
6501
|
_originValidation(e) {
|
|
6491
6502
|
const t = e._key();
|
|
6492
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
6503
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Ys(e)), this.originValidationPromises[t];
|
|
6493
6504
|
}
|
|
6494
6505
|
get _shouldInitProactively() {
|
|
6495
6506
|
return gn() || un() || Xe();
|
|
6496
6507
|
}
|
|
6497
6508
|
}
|
|
6498
|
-
const
|
|
6509
|
+
const ba = va;
|
|
6499
6510
|
var Ot = "@firebase/auth", Dt = "1.7.9";
|
|
6500
6511
|
/**
|
|
6501
6512
|
* @license
|
|
@@ -6513,7 +6524,7 @@ var Ot = "@firebase/auth", Dt = "1.7.9";
|
|
|
6513
6524
|
* See the License for the specific language governing permissions and
|
|
6514
6525
|
* limitations under the License.
|
|
6515
6526
|
*/
|
|
6516
|
-
class
|
|
6527
|
+
class Ia {
|
|
6517
6528
|
constructor(e) {
|
|
6518
6529
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
6519
6530
|
}
|
|
@@ -6538,7 +6549,7 @@ class va {
|
|
|
6538
6549
|
t && (this.internalListeners.delete(e), t(), this.updateProactiveRefresh());
|
|
6539
6550
|
}
|
|
6540
6551
|
assertAuthConfigured() {
|
|
6541
|
-
|
|
6552
|
+
h(
|
|
6542
6553
|
this.auth._initializationPromise,
|
|
6543
6554
|
"dependent-sdk-initialized-before-auth"
|
|
6544
6555
|
/* AuthErrorCode.DEPENDENT_SDK_INIT_BEFORE_AUTH */
|
|
@@ -6564,7 +6575,7 @@ class va {
|
|
|
6564
6575
|
* See the License for the specific language governing permissions and
|
|
6565
6576
|
* limitations under the License.
|
|
6566
6577
|
*/
|
|
6567
|
-
function
|
|
6578
|
+
function wa(n) {
|
|
6568
6579
|
switch (n) {
|
|
6569
6580
|
case "Node":
|
|
6570
6581
|
return "node";
|
|
@@ -6580,12 +6591,12 @@ function ba(n) {
|
|
|
6580
6591
|
return;
|
|
6581
6592
|
}
|
|
6582
6593
|
}
|
|
6583
|
-
function
|
|
6594
|
+
function Ea(n) {
|
|
6584
6595
|
J(new W(
|
|
6585
6596
|
"auth",
|
|
6586
6597
|
(e, { options: t }) => {
|
|
6587
6598
|
const r = e.getProvider("app").getImmediate(), i = e.getProvider("heartbeat"), s = e.getProvider("app-check-internal"), { apiKey: a, authDomain: c } = r.options;
|
|
6588
|
-
|
|
6599
|
+
h(a && !a.includes(":"), "invalid-api-key", { appName: r.name });
|
|
6589
6600
|
const o = {
|
|
6590
6601
|
apiKey: a,
|
|
6591
6602
|
authDomain: c,
|
|
@@ -6594,8 +6605,8 @@ function Ia(n) {
|
|
|
6594
6605
|
tokenApiHost: "securetoken.googleapis.com",
|
|
6595
6606
|
apiScheme: "https",
|
|
6596
6607
|
sdkClientVersion: _n(n)
|
|
6597
|
-
},
|
|
6598
|
-
return
|
|
6608
|
+
}, u = new Zi(r, i, s, o);
|
|
6609
|
+
return ss(u, t), u;
|
|
6599
6610
|
},
|
|
6600
6611
|
"PUBLIC"
|
|
6601
6612
|
/* ComponentType.PUBLIC */
|
|
@@ -6610,18 +6621,18 @@ function Ia(n) {
|
|
|
6610
6621
|
})), J(new W(
|
|
6611
6622
|
"auth-internal",
|
|
6612
6623
|
(e) => {
|
|
6613
|
-
const t =
|
|
6624
|
+
const t = be(e.getProvider(
|
|
6614
6625
|
"auth"
|
|
6615
6626
|
/* _ComponentName.AUTH */
|
|
6616
6627
|
).getImmediate());
|
|
6617
|
-
return ((r) => new
|
|
6628
|
+
return ((r) => new Ia(r))(t);
|
|
6618
6629
|
},
|
|
6619
6630
|
"PRIVATE"
|
|
6620
6631
|
/* ComponentType.PRIVATE */
|
|
6621
6632
|
).setInstantiationMode(
|
|
6622
6633
|
"EXPLICIT"
|
|
6623
6634
|
/* InstantiationMode.EXPLICIT */
|
|
6624
|
-
)), $(Ot, Dt,
|
|
6635
|
+
)), $(Ot, Dt, wa(n)), $(Ot, Dt, "esm2017");
|
|
6625
6636
|
}
|
|
6626
6637
|
/**
|
|
6627
6638
|
* @license
|
|
@@ -6639,11 +6650,11 @@ function Ia(n) {
|
|
|
6639
6650
|
* See the License for the specific language governing permissions and
|
|
6640
6651
|
* limitations under the License.
|
|
6641
6652
|
*/
|
|
6642
|
-
const
|
|
6653
|
+
const Ta = 5 * 60, Sa = Wt("authIdTokenMaxAge") || Ta;
|
|
6643
6654
|
let Nt = null;
|
|
6644
|
-
const
|
|
6655
|
+
const ka = (n) => async (e) => {
|
|
6645
6656
|
const t = e && await e.getIdTokenResult(), r = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
6646
|
-
if (r && r >
|
|
6657
|
+
if (r && r > Sa)
|
|
6647
6658
|
return;
|
|
6648
6659
|
const i = t == null ? void 0 : t.token;
|
|
6649
6660
|
Nt !== i && (Nt = i, await fetch(n, {
|
|
@@ -6653,33 +6664,33 @@ const Ta = (n) => async (e) => {
|
|
|
6653
6664
|
} : {}
|
|
6654
6665
|
}));
|
|
6655
6666
|
};
|
|
6656
|
-
function
|
|
6667
|
+
function Aa(n = vi()) {
|
|
6657
6668
|
const e = Kt(n, "auth");
|
|
6658
6669
|
if (e.isInitialized())
|
|
6659
6670
|
return e.getImmediate();
|
|
6660
|
-
const t =
|
|
6661
|
-
popupRedirectResolver:
|
|
6671
|
+
const t = is(n, {
|
|
6672
|
+
popupRedirectResolver: ba,
|
|
6662
6673
|
persistence: [
|
|
6663
|
-
|
|
6664
|
-
|
|
6674
|
+
Os,
|
|
6675
|
+
vs,
|
|
6665
6676
|
Sn
|
|
6666
6677
|
]
|
|
6667
6678
|
}), r = Wt("authTokenSyncURL");
|
|
6668
6679
|
if (r && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
6669
6680
|
const s = new URL(r, location.origin);
|
|
6670
6681
|
if (location.origin === s.origin) {
|
|
6671
|
-
const a =
|
|
6672
|
-
|
|
6682
|
+
const a = ka(s.toString());
|
|
6683
|
+
gs(t, a, () => a(t.currentUser)), ms(t, (c) => a(c));
|
|
6673
6684
|
}
|
|
6674
6685
|
}
|
|
6675
6686
|
const i = Vt("auth");
|
|
6676
|
-
return i &&
|
|
6687
|
+
return i && as(t, `http://${i}`), t;
|
|
6677
6688
|
}
|
|
6678
|
-
function
|
|
6689
|
+
function Ra() {
|
|
6679
6690
|
var n, e;
|
|
6680
6691
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
6681
6692
|
}
|
|
6682
|
-
|
|
6693
|
+
es({
|
|
6683
6694
|
loadJS(n) {
|
|
6684
6695
|
return new Promise((e, t) => {
|
|
6685
6696
|
const r = document.createElement("script");
|
|
@@ -6689,21 +6700,21 @@ Qi({
|
|
|
6689
6700
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
6690
6701
|
);
|
|
6691
6702
|
s.customData = i, t(s);
|
|
6692
|
-
}, r.type = "text/javascript", r.charset = "UTF-8",
|
|
6703
|
+
}, r.type = "text/javascript", r.charset = "UTF-8", Ra().appendChild(r);
|
|
6693
6704
|
});
|
|
6694
6705
|
},
|
|
6695
6706
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
6696
6707
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
6697
6708
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
6698
6709
|
});
|
|
6699
|
-
|
|
6710
|
+
Ea(
|
|
6700
6711
|
"Browser"
|
|
6701
6712
|
/* ClientPlatform.BROWSER */
|
|
6702
6713
|
);
|
|
6703
|
-
const
|
|
6714
|
+
const Ca = Ln({
|
|
6704
6715
|
history: Mn(),
|
|
6705
6716
|
routes: [
|
|
6706
|
-
...
|
|
6717
|
+
...ue,
|
|
6707
6718
|
...le,
|
|
6708
6719
|
{
|
|
6709
6720
|
path: "/forbidden",
|
|
@@ -6712,91 +6723,111 @@ const Aa = Ln({
|
|
|
6712
6723
|
}
|
|
6713
6724
|
]
|
|
6714
6725
|
});
|
|
6715
|
-
let
|
|
6716
|
-
|
|
6726
|
+
let Le, Me;
|
|
6727
|
+
Ca.beforeEach(async (n) => {
|
|
6717
6728
|
const {
|
|
6718
6729
|
sessionUser: e,
|
|
6719
6730
|
currentRestaurant: t,
|
|
6720
6731
|
currentBusiness: r,
|
|
6721
6732
|
readRestaurants: i,
|
|
6722
6733
|
changeRestaurant: s
|
|
6723
|
-
} =
|
|
6734
|
+
} = We();
|
|
6724
6735
|
if (n.name.startsWith("mf-payment-admin")) {
|
|
6725
6736
|
if (!e.value) {
|
|
6726
|
-
|
|
6727
|
-
const o = q(e, (
|
|
6728
|
-
var
|
|
6729
|
-
|
|
6730
|
-
(((
|
|
6737
|
+
Le || (Le = new Promise((c) => {
|
|
6738
|
+
const o = q(e, (u) => {
|
|
6739
|
+
var l, d;
|
|
6740
|
+
u && (o(), c(
|
|
6741
|
+
(((l = e.value) == null ? void 0 : l.role.isStaff) || ((d = e.value) == null ? void 0 : d.role.isAdmin)) ?? !1
|
|
6731
6742
|
));
|
|
6732
6743
|
});
|
|
6733
6744
|
}));
|
|
6734
|
-
const a = await
|
|
6745
|
+
const a = await Le;
|
|
6735
6746
|
return a || { name: "mf-payment-forbidden" };
|
|
6736
6747
|
}
|
|
6737
6748
|
return !0;
|
|
6738
6749
|
}
|
|
6739
|
-
return !r.value || !t.value ? (
|
|
6750
|
+
return !r.value || !t.value ? (Me || (Me = Promise.all([
|
|
6740
6751
|
new Promise(async (a) => {
|
|
6741
6752
|
const c = q(r, (o) => {
|
|
6742
6753
|
o && (c(), a(!0));
|
|
6743
6754
|
});
|
|
6744
6755
|
}),
|
|
6745
6756
|
new Promise(async (a) => {
|
|
6746
|
-
const c = q(t, (
|
|
6747
|
-
|
|
6757
|
+
const c = q(t, (u) => {
|
|
6758
|
+
u && (c(), a(!0));
|
|
6748
6759
|
}), o = await i();
|
|
6749
6760
|
await s(o == null ? void 0 : o.at(0));
|
|
6750
6761
|
})
|
|
6751
|
-
]).then((a) => !0)),
|
|
6762
|
+
]).then((a) => !0)), Me) : !0;
|
|
6752
6763
|
});
|
|
6753
|
-
const
|
|
6764
|
+
const Pa = /* @__PURE__ */ Mt({
|
|
6754
6765
|
__name: "AppSidebar",
|
|
6755
6766
|
setup(n) {
|
|
6756
|
-
const e =
|
|
6767
|
+
const e = We(), t = Un(), { t: r } = zn(), i = $n(t.currentRoute.value.name);
|
|
6757
6768
|
q(t.currentRoute, () => {
|
|
6758
6769
|
let l = t.currentRoute.value.name;
|
|
6759
6770
|
t.currentRoute.value.meta.parent && (l = t.currentRoute.value.meta.parent), i.value = l;
|
|
6760
6771
|
});
|
|
6761
|
-
const s =
|
|
6762
|
-
var
|
|
6763
|
-
if (!((
|
|
6772
|
+
const s = ue.map((l) => {
|
|
6773
|
+
var g, v;
|
|
6774
|
+
if (!((g = l.meta) != null && g.sidebarDisplay) || l.meta.region && !((v = l.meta.region) != null && v[e.currentCountry.value]) || l.meta.section)
|
|
6764
6775
|
return;
|
|
6765
|
-
const
|
|
6766
|
-
label:
|
|
6776
|
+
const d = l.meta.sidebarDisplay, f = {
|
|
6777
|
+
label: d.startsWith("i18n:") ? r(d.replaceAll("i18n:", "")) : d,
|
|
6767
6778
|
value: l.name,
|
|
6768
6779
|
action: () => {
|
|
6769
6780
|
if (t.currentRoute.value.name !== l.name)
|
|
6770
6781
|
return t.push({ name: l.name });
|
|
6771
6782
|
}
|
|
6772
6783
|
};
|
|
6773
|
-
return l.meta.sidebarNew && (
|
|
6784
|
+
return l.meta.sidebarNew && (f.badge = () => Hn(qn.FmPill, { label: "New" })), f;
|
|
6774
6785
|
}).filter((l) => !!l), a = le.map((l) => {
|
|
6775
|
-
var
|
|
6776
|
-
if ((
|
|
6786
|
+
var d;
|
|
6787
|
+
if ((d = l.meta) != null && d.sidebarDisplay && !l.meta.section)
|
|
6777
6788
|
return {
|
|
6778
|
-
label: l.meta.sidebarDisplay,
|
|
6789
|
+
label: l.meta.sidebarDisplay.startsWith("i18n:") ? r(l.meta.sidebarDisplay.replaceAll("i18n:", "")) : l.meta.sidebarDisplay,
|
|
6779
6790
|
value: l.name,
|
|
6780
6791
|
action: () => {
|
|
6781
6792
|
if (t.currentRoute.value.name !== l.name)
|
|
6782
6793
|
return t.push({ name: l.name });
|
|
6783
6794
|
}
|
|
6784
6795
|
};
|
|
6785
|
-
}).filter((l) => !!l), c = (l) =>
|
|
6786
|
-
var
|
|
6787
|
-
if ((
|
|
6796
|
+
}).filter((l) => !!l), c = (l) => ue.map((d) => {
|
|
6797
|
+
var f;
|
|
6798
|
+
if ((f = d.meta) != null && f.sidebarDisplay && d.meta.section === l)
|
|
6788
6799
|
return {
|
|
6789
|
-
label:
|
|
6790
|
-
value:
|
|
6800
|
+
label: d.meta.sidebarDisplay.startsWith("i18n:") ? r(d.meta.sidebarDisplay.replaceAll("i18n:", "")) : d.meta.sidebarDisplay,
|
|
6801
|
+
value: d.name,
|
|
6791
6802
|
action: () => {
|
|
6792
|
-
if (t.currentRoute.value.name !==
|
|
6793
|
-
return t.push({ name:
|
|
6803
|
+
if (t.currentRoute.value.name !== d.name)
|
|
6804
|
+
return t.push({ name: d.name });
|
|
6794
6805
|
}
|
|
6795
6806
|
};
|
|
6796
|
-
}).filter((
|
|
6797
|
-
var
|
|
6807
|
+
}).filter((d) => !!d), o = (l) => le.map((d) => {
|
|
6808
|
+
var f;
|
|
6809
|
+
if ((f = d.meta) != null && f.sidebarDisplay && d.meta.section === l)
|
|
6810
|
+
return {
|
|
6811
|
+
label: d.meta.sidebarDisplay,
|
|
6812
|
+
value: d.name,
|
|
6813
|
+
action: () => {
|
|
6814
|
+
if (t.currentRoute.value.name !== d.name)
|
|
6815
|
+
return t.push({ name: d.name });
|
|
6816
|
+
}
|
|
6817
|
+
};
|
|
6818
|
+
}).filter((d) => !!d), u = Lt(() => {
|
|
6819
|
+
var d, f;
|
|
6798
6820
|
const l = [...s];
|
|
6799
|
-
return
|
|
6821
|
+
return l.push({
|
|
6822
|
+
label: "",
|
|
6823
|
+
value: "divider",
|
|
6824
|
+
disabled: !0
|
|
6825
|
+
}), l.push({
|
|
6826
|
+
label: r("financing.title"),
|
|
6827
|
+
icon: "credit_score",
|
|
6828
|
+
value: "divider",
|
|
6829
|
+
disabled: !0
|
|
6830
|
+
}), l.push(...c("financing")), ((d = e.sessionUser.value) != null && d.role.isStaff || (f = e.sessionUser.value) != null && f.role.isAdmin) && (l.push({
|
|
6800
6831
|
label: "",
|
|
6801
6832
|
value: "divider",
|
|
6802
6833
|
disabled: !0
|
|
@@ -6805,7 +6836,7 @@ const Ra = /* @__PURE__ */ Mt({
|
|
|
6805
6836
|
icon: "desktop_windows",
|
|
6806
6837
|
value: "divider",
|
|
6807
6838
|
disabled: !0
|
|
6808
|
-
}), l.push(...
|
|
6839
|
+
}), l.push(...o("device")), l.push({
|
|
6809
6840
|
label: "",
|
|
6810
6841
|
value: "divider",
|
|
6811
6842
|
disabled: !0
|
|
@@ -6814,7 +6845,7 @@ const Ra = /* @__PURE__ */ Mt({
|
|
|
6814
6845
|
icon: "account_balance",
|
|
6815
6846
|
value: "divider",
|
|
6816
6847
|
disabled: !0
|
|
6817
|
-
}), l.push(...
|
|
6848
|
+
}), l.push(...o("payment-gateway")), l.push({
|
|
6818
6849
|
label: "",
|
|
6819
6850
|
value: "divider",
|
|
6820
6851
|
disabled: !0
|
|
@@ -6825,56 +6856,56 @@ const Ra = /* @__PURE__ */ Mt({
|
|
|
6825
6856
|
disabled: !0
|
|
6826
6857
|
}), l.push(...a)), l;
|
|
6827
6858
|
});
|
|
6828
|
-
return (l,
|
|
6829
|
-
const
|
|
6830
|
-
return xt(), Ft(
|
|
6859
|
+
return (l, d) => {
|
|
6860
|
+
const f = Ut("FmCollapsibleTabs");
|
|
6861
|
+
return xt(), Ft(f, {
|
|
6831
6862
|
modelValue: i.value,
|
|
6832
|
-
"onUpdate:modelValue":
|
|
6833
|
-
items:
|
|
6863
|
+
"onUpdate:modelValue": d[0] || (d[0] = (g) => i.value = g),
|
|
6864
|
+
items: u.value,
|
|
6834
6865
|
class: "py-16 px-8 w-[240px]"
|
|
6835
6866
|
}, null, 8, ["modelValue", "items"]);
|
|
6836
6867
|
};
|
|
6837
6868
|
}
|
|
6838
6869
|
});
|
|
6839
|
-
var
|
|
6840
|
-
const
|
|
6870
|
+
var Oa = { authClientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4", googleMap: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com" };
|
|
6871
|
+
const $a = /* @__PURE__ */ Mt({
|
|
6841
6872
|
__name: "App",
|
|
6842
6873
|
setup(n) {
|
|
6843
|
-
const { state: e } =
|
|
6874
|
+
const { state: e } = Qn(), t = We(), r = xn(), i = Jt(Oa.firebase);
|
|
6844
6875
|
async function s() {
|
|
6845
6876
|
const a = t.sessionUser.value;
|
|
6846
6877
|
if (!a || !a.token) return;
|
|
6847
|
-
const c = await a.getCustomToken(), o =
|
|
6848
|
-
await
|
|
6878
|
+
const c = await a.getCustomToken(), o = Aa(i);
|
|
6879
|
+
await ps(o, c);
|
|
6849
6880
|
}
|
|
6850
|
-
return s(), q(t.sessionUser, s),
|
|
6881
|
+
return s(), q(t.sessionUser, s), Vn(() => {
|
|
6851
6882
|
e.isIframe && parent.postMessage({ event: "ready" }, "*");
|
|
6852
|
-
}),
|
|
6853
|
-
t.registerSidebarComponent(
|
|
6883
|
+
}), jn(() => {
|
|
6884
|
+
t.registerSidebarComponent(Pa);
|
|
6854
6885
|
}), (a, c) => {
|
|
6855
6886
|
const o = Ut("RouterView");
|
|
6856
6887
|
return xt(), Ft(o, {
|
|
6857
|
-
key:
|
|
6888
|
+
key: Wn(r).path
|
|
6858
6889
|
});
|
|
6859
6890
|
};
|
|
6860
6891
|
}
|
|
6861
|
-
}),
|
|
6862
|
-
"en-US":
|
|
6863
|
-
"zh-CN":
|
|
6864
|
-
},
|
|
6892
|
+
}), Ha = {
|
|
6893
|
+
"en-US": Jn,
|
|
6894
|
+
"zh-CN": Xn
|
|
6895
|
+
}, Va = [...le, ...ue];
|
|
6865
6896
|
export {
|
|
6866
6897
|
W as C,
|
|
6867
|
-
|
|
6898
|
+
M as F,
|
|
6868
6899
|
ee as S,
|
|
6869
6900
|
gt as _,
|
|
6870
6901
|
J as a,
|
|
6871
6902
|
Kt as b,
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6903
|
+
Fa as c,
|
|
6904
|
+
vi as d,
|
|
6905
|
+
Ba as e,
|
|
6906
|
+
Va as f,
|
|
6876
6907
|
z as g,
|
|
6877
|
-
|
|
6878
|
-
|
|
6908
|
+
$a as h,
|
|
6909
|
+
Ha as i,
|
|
6879
6910
|
$ as r
|
|
6880
6911
|
};
|