@feedmepos/mf-connect 0.1.98-prod → 0.1.99-prod
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/{Analytic-BHDjuMfN.js → Analytic-CmlJa1WX.js} +11 -11
- package/dist/{App-BSSze_b9.js → App-D0thRELq.js} +811 -665
- package/dist/{Bin-DfzoQbE0.js → Bin-DnkPcZdC.js} +8 -8
- package/dist/{Broadcast-DsqO4SXX.js → Broadcast-o6nSQOsx.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DQ0x2VJp.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BPGzh4u8.js} +6 -6
- package/dist/{Card-VxbqomXV.js → Card-zjezSaRB.js} +18 -18
- package/dist/{Collections-CvD98I3M.js → Collections-48W_jFFS.js} +8 -8
- package/dist/{Credit-BhM2m2L2.js → Credit-CYaCjNVK.js} +8 -8
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DvfrrjHc.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D3SnYlQ0.js} +32 -32
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CPx9U9fU.js → EffectSheet.vue_vue_type_style_index_0_lang-CbpKQj-r.js} +6 -6
- package/dist/{Experience-uWQRb-qf.js → Experience-HmfLlywu.js} +8 -8
- package/dist/{FileSaver.min-DKNoHTvP.js → FileSaver.min-cDraiw9g.js} +1 -1
- package/dist/{Game-BgT3oNx7.js → Game-DHLdDQRi.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-ClqrJbU6.js → ImageInput.vue_vue_type_script_setup_true_lang-DZrmFruC.js} +1 -1
- package/dist/{Index-D3RgVj9V.js → Index-CMm5L1Ph.js} +10 -10
- package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-B6tGeGGC.js +48 -0
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CkCpumzB.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CV4V9qlc.js} +1 -1
- package/dist/{MainLayout-B2RiPsIR.js → MainLayout-iru8naVF.js} +1 -1
- package/dist/{Marketing-FrE7k7eW.js → Marketing-AP8z-pA0.js} +4 -4
- package/dist/{MarketingMaterialEdit-DGNjEUu-.js → MarketingMaterialEdit-HYTdiTvs.js} +6 -6
- package/dist/{Member-CgTagUQ9.js → Member-N_ks2GiW.js} +11 -11
- package/dist/{MemberList-CKbzsDMX.js → MemberList-Cj8EfN0q.js} +26 -26
- package/dist/{MemberTransactions-CnY5cFdv.js → MemberTransactions-DUj4Fq6M.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DqivG_O4.js → MessageInput.vue_vue_type_script_setup_true_lang-ZD6_8BzX.js} +9 -9
- package/dist/{Mission-BGNqy7wQ.js → Mission-DfZ0brqC.js} +9 -9
- package/dist/{Overview-CnpF74wa.js → Overview-BnFPQbSg.js} +18 -18
- package/dist/Overview-kB_HApIc.js +969 -0
- package/dist/{Point-BHgIy7Bz.js → Point-PsWJEEsn.js} +8 -8
- package/dist/{Promotion-CNQvO5Lq.js → Promotion-BsNT1kOG.js} +9 -9
- package/dist/{Queue-CoPBE0UP.js → Queue-Cgw3PgEi.js} +10 -10
- package/dist/{Record-BuDQ15FJ.js → Record-DwzoIz3R.js} +9 -9
- package/dist/Review-kF2wLu5o.js +46 -0
- package/dist/ReviewFacebookCallback-B6RjqR5T.js +238 -0
- package/dist/ReviewGoogleCallback-DjLK1b4-.js +213 -0
- package/dist/{Reward-BQlCO3Dk.js → Reward-C8O5U2NU.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-nhNr_T7D.js → RewardGroup.vue_vue_type_script_setup_true_lang-BqKABBF1.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-lnxwLa8o.js → RuleGroup.vue_vue_type_script_setup_true_lang-DvNyurCW.js} +14 -14
- package/dist/{Segment-DKFAXGzY.js → Segment-BtmeNQnL.js} +24 -24
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-CUR7djaM.js → SelectItems.vue_vue_type_script_setup_true_lang-P4wy1bqG.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CZ3s2W8Q.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DQ93AOeI.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BbilZk82.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-B3P7Ob40.js} +4 -4
- package/dist/{Setting-hrDZ1cQR.js → Setting-D1SQ6TKF.js} +14 -14
- package/dist/{SettingAdvertisements-CQsx4JqQ.js → SettingAdvertisements-pUTX9uu3.js} +12 -12
- package/dist/Settings-Bbd3cMNH.js +228 -0
- package/dist/{Store-Cgmsklnt.js → Store-Dgc-J8Q7.js} +21 -21
- package/dist/{StoreRewards-CrPO4DKG.js → StoreRewards-CJ090vEj.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-yesp6BoT.js → StoreTransactions.vue_vue_type_script_setup_true_lang-B35vDFFq.js} +350 -401
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BnKybdKJ.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-5Aazsvfa.js} +2 -2
- package/dist/{Tier-DgKMMyKr.js → Tier-CKGyFDiY.js} +21 -21
- package/dist/{Title-BKijiEFV.js → Title-DXRex7t9.js} +20 -20
- package/dist/{Transaction-zHL4q_wj.js → Transaction-B1eC-Gln.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DjafpVOa.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-B2GABNUx.js} +6 -6
- package/dist/{Voucher-DW4-SD1w.js → Voucher-Omh_kYVH.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-y2wm2Bcu.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DD2WD_Vt.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BWZUE554.js → ZodTextField.vue_vue_type_script_setup_true_lang-CAtzo8zL.js} +2 -2
- package/dist/{app-B23RANXL.js → app-D8i8XAyR.js} +3589 -2961
- package/dist/app.js +1 -1
- package/dist/{business-BFU-2tpT.js → business-6gZtKQ8L.js} +1 -1
- package/dist/{campaign-BEKKOWya.js → campaign-DIgbywUy.js} +8 -8
- package/dist/{campaign-CwlWx58O.js → campaign-MPUFwgli.js} +1 -1
- package/dist/{campaign.enum-5KIiekYl.js → campaign.enum-CSlbGhc-.js} +1 -1
- package/dist/{campaign.fn-CyWn_KL-.js → campaign.fn-BvxZt-0r.js} +21 -21
- package/dist/{collectible.enum-DmmR-4Nj.js → collectible.enum-20LKRFir.js} +1 -1
- package/dist/{collection.fn-BB1OjBHL.js → collection.fn-03oGQuF_.js} +2 -2
- package/dist/{dto-p31OYANk.js → dto-C5_Te4gk.js} +4 -4
- package/dist/{effect-DNDXE2iM.js → effect-CkurpNMu.js} +1 -1
- package/dist/{email-addresses-DXSkxrZ6.js → email-addresses-CR8pgurp.js} +2 -2
- package/dist/{export-zMj-UAnF.js → export-CfDeISbW.js} +3 -3
- package/dist/google-BQK68wbe.js +5 -0
- package/dist/{helper-D32ml7Qv.js → helper-BQYvN6FL.js} +1 -1
- package/dist/{index-PrTZHXNT.js → index-6FvsyekG.js} +1 -1
- package/dist/{index-Cc15IFUt.js → index-ARC-NYFZ.js} +1 -1
- package/dist/{index-DvHLsdIR.js → index-C9j6OhgK.js} +372 -103
- package/dist/{index-BmmFSQPd.js → index-CH_QL_76.js} +3 -3
- package/dist/index-CJUzQG6t.js +61 -0
- package/dist/{index-9jgqbdnt.js → index-Cv-DbZdw.js} +2 -2
- package/dist/{index-BWHk6oqv.js → index-D6wOnTAl.js} +3 -3
- package/dist/{index-CcnOzrwY.js → index-D8vmbFE5.js} +1 -1
- package/dist/{index-B9-jeiQR.js → index-DW7H-3z4.js} +18 -12
- package/dist/{index-DSGHkaP0.js → index-Dcxjgr6s.js} +1 -1
- package/dist/{index-B2OiTtF5.js → index-Dz130JVH.js} +1 -1
- package/dist/{index-txVWLdtz.js → index-ERqXuFvQ.js} +1 -1
- package/dist/{index-CA09A75h.js → index-hTgJrZR8.js} +3 -3
- package/dist/{index.esm2017-BJG8dqci.js → index.esm2017-DY9Lrb0O.js} +1 -1
- package/dist/{loading-DuZVM_Ow.js → loading-EnU7K0k3.js} +1 -1
- package/dist/{lodash-DqQem5rZ.js → lodash-Cr7KdLib.js} +1 -1
- package/dist/{membership-CvoEzwor.js → membership-B1eIzQDB.js} +3 -3
- package/dist/{money-B9PJ_JYh.js → money-DpUzzEJj.js} +1 -1
- package/dist/{number-GIC15kny.js → number-DAz9zOKI.js} +1 -1
- package/dist/{objectid-CtJ4pTf2.js → objectid-LXOkMCkM.js} +2 -2
- package/dist/{plugins-XAhAFHmZ.js → plugins-DJ13vaqz.js} +3 -3
- package/dist/{reward-Dy0Z6PLL.js → reward-Cmx_swM1.js} +1 -1
- package/dist/{rule-CUu9I1Ly.js → rule-BCzySyr6.js} +3 -3
- package/dist/{rule-builder-DPmaehAO.js → rule-builder-CDkWYBLG.js} +1 -1
- package/dist/{template-BHtdbnoX.js → template-DfnYZzoa.js} +7 -7
- package/dist/{timezone-BE1YhvLN.js → timezone-Beb0XkZC.js} +2 -2
- package/dist/{trigger-BcHfjuiZ.js → trigger-BfQprjI-.js} +5 -5
- package/dist/{useMarketingMaterialActions-YQq4LWOp.js → useMarketingMaterialActions-CagN58AP.js} +3 -3
- package/dist/{usePagination-B1KK2gTx.js → usePagination-XyeJR5ws.js} +1 -1
- package/dist/{user-BTRRi1B3.js → user-l2YG1VjD.js} +1 -1
- package/dist/{vue-i18n-D8NX5Rry.js → vue-i18n-DJXhpQga.js} +162 -162
- package/dist/{xlsx-C9LzK7Kg.js → xlsx-DypdT1NW.js} +1 -1
- package/dist/{zod-D3ciRzE4.js → zod-BM5P7Bti.js} +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as
|
|
6
|
-
import "./index-
|
|
7
|
-
import { components as
|
|
8
|
-
import { u as
|
|
9
|
-
import { C as
|
|
10
|
-
import { R as f } from "./app-
|
|
11
|
-
import { J as
|
|
12
|
-
import { r as
|
|
13
|
-
import { _ as
|
|
14
|
-
import { S as
|
|
15
|
-
const
|
|
1
|
+
import { defineComponent as De, ref as ee, h as Y, computed as ne, watch as xe, resolveComponent as Z, openBlock as H, createElementBlock as pe, createVNode as S, unref as p, createElementVNode as _, toDisplayString as R, createBlock as Ne, withCtx as X, Fragment as It, renderList as cn, onMounted as ln, createCommentVNode as Ae, nextTick as un } from "vue";
|
|
2
|
+
import { useRouter as yt, useRoute as wt, RouterView as dn } from "vue-router";
|
|
3
|
+
import { useCoreStore as me, FeedMeAuth as hn } from "@feedmepos/mf-common";
|
|
4
|
+
import { u as fn } from "./app-wDQR6dpb.js";
|
|
5
|
+
import { u as pn } from "./business-6gZtKQ8L.js";
|
|
6
|
+
import "./index-Dz130JVH.js";
|
|
7
|
+
import { components as Q, useSnackbar as mn, useDialog as gn } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as Tt } from "./vue-i18n-DJXhpQga.js";
|
|
9
|
+
import { C as Xe, m as _n } from "./timezone-Beb0XkZC.js";
|
|
10
|
+
import { R as f, A as vn, a as Qe } from "./app-D8i8XAyR.js";
|
|
11
|
+
import { J as In } from "./JsonViewer-v8_C7l5N.js";
|
|
12
|
+
import { r as Oe, L as yn, g as kt, i as wn, a as Tn, _ as Ze, C as et, b as kn, S as re, c as A, d as K, E as Fe, e as En, f as Et, h as bn, j as Sn, k as bt, l as y, m as Rn, F as Ve, n as An, q as se, o as Pn, p as Cn, s as Nn, t as On, u as Ln } from "./index.esm2017-DY9Lrb0O.js";
|
|
13
|
+
import { _ as $e } from "./tslib.es6-BCqqvLQ_.js";
|
|
14
|
+
import { S as tt, c as Mn } from "./index-Cv-DbZdw.js";
|
|
15
|
+
const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary text-center" }, xn = /* @__PURE__ */ De({
|
|
16
16
|
__name: "NavigationTab",
|
|
17
17
|
setup(n) {
|
|
18
|
-
const { t: e } =
|
|
18
|
+
const { t: e } = Tt(), t = ee(), i = [
|
|
19
19
|
{
|
|
20
20
|
label: e("connect.navigation.analytic"),
|
|
21
21
|
value: f["$connect-ANALYTIC"]
|
|
@@ -57,7 +57,7 @@ const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class
|
|
|
57
57
|
{
|
|
58
58
|
label: e("connect.navigation.point"),
|
|
59
59
|
value: f["$connect-PROGRAM_POINT"],
|
|
60
|
-
badge: () =>
|
|
60
|
+
badge: () => Y(Q.FmPill, { variant: "premium" })
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
label: e("connect.navigation.credit"),
|
|
@@ -66,7 +66,7 @@ const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class
|
|
|
66
66
|
{
|
|
67
67
|
label: e("connect.navigation.game"),
|
|
68
68
|
value: f["$connect-PROGRAM_GAME"],
|
|
69
|
-
badge: () =>
|
|
69
|
+
badge: () => Y(Q.FmPill, { variant: "premium" })
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
label: "Mission",
|
|
@@ -85,19 +85,19 @@ const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class
|
|
|
85
85
|
{
|
|
86
86
|
label: e("connect.navigation.segments"),
|
|
87
87
|
value: f["$connect-LOYALTY_SEGMENT"],
|
|
88
|
-
badge: () =>
|
|
88
|
+
badge: () => Y(Q.FmPill, { variant: "premium" })
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
label: e("connect.navigation.card"),
|
|
92
92
|
value: f["$connect-LOYALTY_CARD"],
|
|
93
|
-
badge: () =>
|
|
93
|
+
badge: () => Y(Q.FmPill, { variant: "premium" })
|
|
94
94
|
}
|
|
95
95
|
]
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
label: e("connect.navigation.referral"),
|
|
99
99
|
value: f["$connect-REFERRAL"],
|
|
100
|
-
badge: () =>
|
|
100
|
+
badge: () => Y(Q.FmPill, { variant: "premium" })
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
label: e("connect.navigation.store"),
|
|
@@ -111,6 +111,10 @@ const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class
|
|
|
111
111
|
label: e("connect.navigation.marketingMaterials"),
|
|
112
112
|
value: f["$connect-MARKETING"]
|
|
113
113
|
},
|
|
114
|
+
{
|
|
115
|
+
label: e("connect.navigation.review"),
|
|
116
|
+
value: f["$connect-REVIEW"]
|
|
117
|
+
},
|
|
114
118
|
{
|
|
115
119
|
label: e("connect.navigation.setting"),
|
|
116
120
|
value: f["$connect-SETTING"]
|
|
@@ -119,15 +123,15 @@ const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class
|
|
|
119
123
|
label: e("connect.navigation.bin"),
|
|
120
124
|
value: f["$connect-BIN"]
|
|
121
125
|
}
|
|
122
|
-
], r =
|
|
126
|
+
], r = yt(), s = wt(), o = i.reduce((d, h) => [...(h.children ?? []).map((m) => m.value), ...d, h.value], []), c = me(), a = ne(() => {
|
|
123
127
|
const d = c.currentCountry.value || "MY";
|
|
124
|
-
return console.log(`[MF] Timezone set to: ${
|
|
128
|
+
return console.log(`[MF] Timezone set to: ${Xe[d]}`), Xe[d];
|
|
125
129
|
});
|
|
126
|
-
|
|
130
|
+
xe(
|
|
127
131
|
() => s,
|
|
128
132
|
(d) => {
|
|
129
|
-
const h = d.matched.map((
|
|
130
|
-
t.value = h.find((
|
|
133
|
+
const h = d.matched.map((m) => m.name).reverse();
|
|
134
|
+
t.value = h.find((m) => o.includes(m));
|
|
131
135
|
},
|
|
132
136
|
{ immediate: !0 }
|
|
133
137
|
);
|
|
@@ -135,24 +139,165 @@ const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class
|
|
|
135
139
|
await r.push({ name: d });
|
|
136
140
|
}
|
|
137
141
|
return (d, h) => {
|
|
138
|
-
var
|
|
139
|
-
const
|
|
140
|
-
return
|
|
141
|
-
|
|
142
|
+
var I;
|
|
143
|
+
const m = Z("FmCollapsibleTabs");
|
|
144
|
+
return H(), pe("div", Un, [
|
|
145
|
+
S(m, {
|
|
142
146
|
class: "border-fm-color-neutral-gray-100 border-r px-4",
|
|
143
|
-
"model-value": (
|
|
147
|
+
"model-value": (I = p(t)) == null ? void 0 : I.toString(),
|
|
144
148
|
items: i,
|
|
145
149
|
"onUpdate:modelValue": l
|
|
146
150
|
}, null, 8, ["model-value"]),
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
151
|
+
_("div", Dn, [
|
|
152
|
+
_("div", null, "Timezone: " + R(p(a).split("/")[1].replace("_", " ")), 1),
|
|
153
|
+
_("div", null, "(UTC" + R(p(_n).tz(p(a)).format("Z")) + ")", 1)
|
|
150
154
|
])
|
|
151
155
|
]);
|
|
152
156
|
};
|
|
153
157
|
}
|
|
158
|
+
}), St = "feedme_connect_marketing_promo_hidden";
|
|
159
|
+
function Fn() {
|
|
160
|
+
try {
|
|
161
|
+
return localStorage.getItem(St) !== null;
|
|
162
|
+
} catch {
|
|
163
|
+
return !1;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function Vn() {
|
|
167
|
+
try {
|
|
168
|
+
localStorage.setItem(St, (/* @__PURE__ */ new Date()).toISOString());
|
|
169
|
+
} catch {
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const $n = { class: "flex flex-col gap-12" }, Hn = { class: "fm-corner-radius-xxl bg-fm-color-primary-oats flex items-start gap-4 self-start px-12 py-4" }, jn = { class: "fm-typo-en-body-sm-600 text-fm-color-primary" }, Wn = { class: "fm-typo-en-title-sm-800 max-w-[560px] leading-[42px]" }, Bn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary max-w-[600px]" }, Gn = { class: "flex flex-col gap-24 pb-8" }, zn = { class: "grid grid-cols-1 gap-16 sm:grid-cols-3 md:grid-cols-3 lg:grid-cols-3" }, qn = { class: "fm-corner-radius-sm bg-fm-color-primary-oats flex h-40 w-40 shrink-0 items-center justify-center" }, Kn = { class: "fm-typo-en-body-lg-600" }, Jn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Yn = { class: "shrink-0" }, Xn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qn = { class: "flex w-full flex-col gap-12 px-[16px]" }, Zn = { class: "flex flex-wrap items-center gap-12" }, ei = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, ti = /* @__PURE__ */ De({
|
|
173
|
+
__name: "AiMarketingPromoDialog",
|
|
174
|
+
setup(n) {
|
|
175
|
+
let e = !1;
|
|
176
|
+
const { t } = Tt(), i = yt(), { sessionUser: r, currentCountry: s } = me(), o = ee(!1), c = [
|
|
177
|
+
{ key: "completeContent", icon: "layers" },
|
|
178
|
+
{ key: "realContext", icon: "storefront" },
|
|
179
|
+
{ key: "socialFormat", icon: "aspect_ratio" }
|
|
180
|
+
], a = ne(() => {
|
|
181
|
+
var w;
|
|
182
|
+
const I = ((w = r.value) == null ? void 0 : w.permissions) ?? [];
|
|
183
|
+
return vn(
|
|
184
|
+
[
|
|
185
|
+
{
|
|
186
|
+
action: Qe.Action.manage,
|
|
187
|
+
subject: Qe.Subject.Business.crm_marketingMaterial
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
I
|
|
191
|
+
).granted;
|
|
192
|
+
}), l = ne(
|
|
193
|
+
() => s.value === "MY" && a.value
|
|
194
|
+
);
|
|
195
|
+
let d = !1;
|
|
196
|
+
xe(
|
|
197
|
+
l,
|
|
198
|
+
(I) => {
|
|
199
|
+
d || !I || (d = !0, !(Fn() || e) && (e = !0, o.value = !0));
|
|
200
|
+
},
|
|
201
|
+
{ immediate: !0 }
|
|
202
|
+
);
|
|
203
|
+
async function h() {
|
|
204
|
+
o.value = !1, await i.push({ name: f["$connect-MARKETING"] });
|
|
205
|
+
}
|
|
206
|
+
function m() {
|
|
207
|
+
Vn(), o.value = !1;
|
|
208
|
+
}
|
|
209
|
+
return (I, w) => {
|
|
210
|
+
const g = Z("FmIcon"), v = Z("FmCard"), T = Z("FmButton"), M = Z("FmDialog");
|
|
211
|
+
return H(), Ne(M, {
|
|
212
|
+
modelValue: o.value,
|
|
213
|
+
"onUpdate:modelValue": w[0] || (w[0] = (k) => o.value = k),
|
|
214
|
+
"min-width": "min(500px, calc(100% - 48px))",
|
|
215
|
+
"max-width": "min(860px, calc(100% - 48px))",
|
|
216
|
+
"max-height": "90vh",
|
|
217
|
+
"dismiss-away": ""
|
|
218
|
+
}, {
|
|
219
|
+
"dialog-header": X(() => [
|
|
220
|
+
_("div", $n, [
|
|
221
|
+
_("div", Hn, [
|
|
222
|
+
S(g, {
|
|
223
|
+
name: "auto_awesome",
|
|
224
|
+
size: "sm",
|
|
225
|
+
color: "primary"
|
|
226
|
+
}),
|
|
227
|
+
_("span", jn, R(p(t)("connect.marketing.whatsNew.badge")), 1)
|
|
228
|
+
]),
|
|
229
|
+
_("h1", Wn, R(p(t)("connect.marketing.whatsNew.title")), 1),
|
|
230
|
+
_("p", Bn, R(p(t)("connect.marketing.whatsNew.subtitle")), 1)
|
|
231
|
+
])
|
|
232
|
+
]),
|
|
233
|
+
"dialog-footer": X(() => [
|
|
234
|
+
_("div", Qn, [
|
|
235
|
+
_("div", Zn, [
|
|
236
|
+
S(T, {
|
|
237
|
+
variant: "primary",
|
|
238
|
+
size: "lg",
|
|
239
|
+
label: p(t)("connect.marketing.whatsNew.cta"),
|
|
240
|
+
"append-icon": "arrow_forward",
|
|
241
|
+
onClick: h
|
|
242
|
+
}, null, 8, ["label"]),
|
|
243
|
+
S(T, {
|
|
244
|
+
variant: "tertiary",
|
|
245
|
+
size: "lg",
|
|
246
|
+
label: p(t)("connect.marketing.whatsNew.dismiss"),
|
|
247
|
+
onClick: m
|
|
248
|
+
}, null, 8, ["label"])
|
|
249
|
+
]),
|
|
250
|
+
_("div", ei, R(p(t)("connect.marketing.whatsNew.footnote")), 1)
|
|
251
|
+
])
|
|
252
|
+
]),
|
|
253
|
+
default: X(() => [
|
|
254
|
+
_("div", Gn, [
|
|
255
|
+
_("div", zn, [
|
|
256
|
+
(H(), pe(It, null, cn(c, (k) => S(v, {
|
|
257
|
+
key: k.key,
|
|
258
|
+
variant: "outlined",
|
|
259
|
+
class: "!h-full flex flex-col gap-8 p-16"
|
|
260
|
+
}, {
|
|
261
|
+
default: X(() => [
|
|
262
|
+
_("div", qn, [
|
|
263
|
+
S(g, {
|
|
264
|
+
name: k.icon,
|
|
265
|
+
size: "md",
|
|
266
|
+
color: "primary"
|
|
267
|
+
}, null, 8, ["name"])
|
|
268
|
+
]),
|
|
269
|
+
_("div", Kn, R(p(t)(`connect.marketing.whatsNew.benefits.${k.key}.title`)), 1),
|
|
270
|
+
_("div", Jn, R(p(t)(
|
|
271
|
+
`connect.marketing.whatsNew.benefits.${k.key}.description`
|
|
272
|
+
)), 1)
|
|
273
|
+
]),
|
|
274
|
+
_: 2
|
|
275
|
+
}, 1024)), 64))
|
|
276
|
+
]),
|
|
277
|
+
S(v, {
|
|
278
|
+
variant: "outlined",
|
|
279
|
+
class: "flex items-start gap-12 p-16"
|
|
280
|
+
}, {
|
|
281
|
+
default: X(() => [
|
|
282
|
+
_("div", Yn, [
|
|
283
|
+
S(g, {
|
|
284
|
+
name: "lightbulb",
|
|
285
|
+
size: "md",
|
|
286
|
+
color: "primary"
|
|
287
|
+
})
|
|
288
|
+
]),
|
|
289
|
+
_("p", Xn, R(p(t)("connect.marketing.whatsNew.callout")), 1)
|
|
290
|
+
]),
|
|
291
|
+
_: 1
|
|
292
|
+
})
|
|
293
|
+
])
|
|
294
|
+
]),
|
|
295
|
+
_: 1
|
|
296
|
+
}, 8, ["modelValue"]);
|
|
297
|
+
};
|
|
298
|
+
}
|
|
154
299
|
});
|
|
155
|
-
var
|
|
300
|
+
var ni = "firebase", ii = "10.12.4";
|
|
156
301
|
/**
|
|
157
302
|
* @license
|
|
158
303
|
* Copyright 2020 Google LLC
|
|
@@ -169,13 +314,13 @@ var Ln = "firebase", Mn = "10.12.4";
|
|
|
169
314
|
* See the License for the specific language governing permissions and
|
|
170
315
|
* limitations under the License.
|
|
171
316
|
*/
|
|
172
|
-
|
|
173
|
-
function
|
|
317
|
+
Oe(ni, ii, "app");
|
|
318
|
+
function Rt() {
|
|
174
319
|
return {
|
|
175
320
|
"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."
|
|
176
321
|
};
|
|
177
322
|
}
|
|
178
|
-
const
|
|
323
|
+
const ri = Rt, At = new Fe("auth", "Firebase", Rt());
|
|
179
324
|
/**
|
|
180
325
|
* @license
|
|
181
326
|
* Copyright 2020 Google LLC
|
|
@@ -192,12 +337,12 @@ const Un = It, Tt = new Ce("auth", "Firebase", It());
|
|
|
192
337
|
* See the License for the specific language governing permissions and
|
|
193
338
|
* limitations under the License.
|
|
194
339
|
*/
|
|
195
|
-
const
|
|
196
|
-
function
|
|
197
|
-
|
|
340
|
+
const ge = new yn("@firebase/auth");
|
|
341
|
+
function si(n, ...e) {
|
|
342
|
+
ge.logLevel <= bt.WARN && ge.warn(`Auth (${re}): ${n}`, ...e);
|
|
198
343
|
}
|
|
199
|
-
function
|
|
200
|
-
|
|
344
|
+
function ue(n, ...e) {
|
|
345
|
+
ge.logLevel <= bt.ERROR && ge.error(`Auth (${re}): ${n}`, ...e);
|
|
201
346
|
}
|
|
202
347
|
/**
|
|
203
348
|
* @license
|
|
@@ -215,38 +360,38 @@ function re(n, ...e) {
|
|
|
215
360
|
* See the License for the specific language governing permissions and
|
|
216
361
|
* limitations under the License.
|
|
217
362
|
*/
|
|
218
|
-
function
|
|
219
|
-
throw
|
|
363
|
+
function O(n, ...e) {
|
|
364
|
+
throw He(n, ...e);
|
|
220
365
|
}
|
|
221
|
-
function
|
|
222
|
-
return
|
|
366
|
+
function E(n, ...e) {
|
|
367
|
+
return He(n, ...e);
|
|
223
368
|
}
|
|
224
|
-
function
|
|
225
|
-
const i = Object.assign(Object.assign({},
|
|
226
|
-
return new
|
|
369
|
+
function Pt(n, e, t) {
|
|
370
|
+
const i = Object.assign(Object.assign({}, ri()), { [e]: t });
|
|
371
|
+
return new Fe("auth", "Firebase", i).create(e, {
|
|
227
372
|
appName: n.name
|
|
228
373
|
});
|
|
229
374
|
}
|
|
230
|
-
function
|
|
231
|
-
return
|
|
375
|
+
function $(n) {
|
|
376
|
+
return Pt(n, "operation-not-supported-in-this-environment", "Operations that alter the current user are not supported in conjunction with FirebaseServerApp");
|
|
232
377
|
}
|
|
233
|
-
function
|
|
378
|
+
function He(n, ...e) {
|
|
234
379
|
if (typeof n != "string") {
|
|
235
380
|
const t = e[0], i = [...e.slice(1)];
|
|
236
381
|
return i[0] && (i[0].appName = n.name), n._errorFactory.create(t, ...i);
|
|
237
382
|
}
|
|
238
|
-
return
|
|
383
|
+
return At.create(n, ...e);
|
|
239
384
|
}
|
|
240
385
|
function u(n, e, ...t) {
|
|
241
386
|
if (!n)
|
|
242
|
-
throw
|
|
387
|
+
throw He(e, ...t);
|
|
243
388
|
}
|
|
244
|
-
function
|
|
389
|
+
function P(n) {
|
|
245
390
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
246
|
-
throw
|
|
391
|
+
throw ue(e), new Error(e);
|
|
247
392
|
}
|
|
248
|
-
function
|
|
249
|
-
n ||
|
|
393
|
+
function L(n, e) {
|
|
394
|
+
n || P(e);
|
|
250
395
|
}
|
|
251
396
|
/**
|
|
252
397
|
* @license
|
|
@@ -264,14 +409,14 @@ function P(n, e) {
|
|
|
264
409
|
* See the License for the specific language governing permissions and
|
|
265
410
|
* limitations under the License.
|
|
266
411
|
*/
|
|
267
|
-
function
|
|
412
|
+
function Le() {
|
|
268
413
|
var n;
|
|
269
414
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
270
415
|
}
|
|
271
|
-
function
|
|
272
|
-
return
|
|
416
|
+
function oi() {
|
|
417
|
+
return nt() === "http:" || nt() === "https:";
|
|
273
418
|
}
|
|
274
|
-
function
|
|
419
|
+
function nt() {
|
|
275
420
|
var n;
|
|
276
421
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.protocol) || null;
|
|
277
422
|
}
|
|
@@ -291,15 +436,15 @@ function Je() {
|
|
|
291
436
|
* See the License for the specific language governing permissions and
|
|
292
437
|
* limitations under the License.
|
|
293
438
|
*/
|
|
294
|
-
function
|
|
439
|
+
function ai() {
|
|
295
440
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
296
441
|
// This is especially true for Cordova apps which have unreliable
|
|
297
442
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
298
443
|
// installed which overwrites the native navigator.onLine value and
|
|
299
444
|
// defines navigator.connection.
|
|
300
|
-
(
|
|
445
|
+
(oi() || kn() || "connection" in navigator) ? navigator.onLine : !0;
|
|
301
446
|
}
|
|
302
|
-
function
|
|
447
|
+
function ci() {
|
|
303
448
|
if (typeof navigator > "u")
|
|
304
449
|
return null;
|
|
305
450
|
const n = navigator;
|
|
@@ -327,12 +472,12 @@ function Vn() {
|
|
|
327
472
|
* See the License for the specific language governing permissions and
|
|
328
473
|
* limitations under the License.
|
|
329
474
|
*/
|
|
330
|
-
class
|
|
475
|
+
class oe {
|
|
331
476
|
constructor(e, t) {
|
|
332
|
-
this.shortDelay = e, this.longDelay = t,
|
|
477
|
+
this.shortDelay = e, this.longDelay = t, L(t > e, "Short delay should be less than long delay!"), this.isMobile = wn() || Tn();
|
|
333
478
|
}
|
|
334
479
|
get() {
|
|
335
|
-
return
|
|
480
|
+
return ai() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
336
481
|
}
|
|
337
482
|
}
|
|
338
483
|
/**
|
|
@@ -351,8 +496,8 @@ class X {
|
|
|
351
496
|
* See the License for the specific language governing permissions and
|
|
352
497
|
* limitations under the License.
|
|
353
498
|
*/
|
|
354
|
-
function
|
|
355
|
-
|
|
499
|
+
function je(n, e) {
|
|
500
|
+
L(n.emulator, "Emulator should always be set here");
|
|
356
501
|
const { url: t } = n.emulator;
|
|
357
502
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
358
503
|
}
|
|
@@ -372,7 +517,7 @@ function Me(n, e) {
|
|
|
372
517
|
* See the License for the specific language governing permissions and
|
|
373
518
|
* limitations under the License.
|
|
374
519
|
*/
|
|
375
|
-
class
|
|
520
|
+
class Ct {
|
|
376
521
|
static initialize(e, t, i) {
|
|
377
522
|
this.fetchImpl = e, t && (this.headersImpl = t), i && (this.responseImpl = i);
|
|
378
523
|
}
|
|
@@ -385,7 +530,7 @@ class wt {
|
|
|
385
530
|
return globalThis.fetch;
|
|
386
531
|
if (typeof fetch < "u")
|
|
387
532
|
return fetch;
|
|
388
|
-
|
|
533
|
+
P("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
389
534
|
}
|
|
390
535
|
static headers() {
|
|
391
536
|
if (this.headersImpl)
|
|
@@ -396,7 +541,7 @@ class wt {
|
|
|
396
541
|
return globalThis.Headers;
|
|
397
542
|
if (typeof Headers < "u")
|
|
398
543
|
return Headers;
|
|
399
|
-
|
|
544
|
+
P("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
400
545
|
}
|
|
401
546
|
static response() {
|
|
402
547
|
if (this.responseImpl)
|
|
@@ -407,7 +552,7 @@ class wt {
|
|
|
407
552
|
return globalThis.Response;
|
|
408
553
|
if (typeof Response < "u")
|
|
409
554
|
return Response;
|
|
410
|
-
|
|
555
|
+
P("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
411
556
|
}
|
|
412
557
|
}
|
|
413
558
|
/**
|
|
@@ -426,7 +571,7 @@ class wt {
|
|
|
426
571
|
* See the License for the specific language governing permissions and
|
|
427
572
|
* limitations under the License.
|
|
428
573
|
*/
|
|
429
|
-
const
|
|
574
|
+
const li = {
|
|
430
575
|
// Custom token errors.
|
|
431
576
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
432
577
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -517,93 +662,93 @@ const $n = {
|
|
|
517
662
|
* See the License for the specific language governing permissions and
|
|
518
663
|
* limitations under the License.
|
|
519
664
|
*/
|
|
520
|
-
const
|
|
521
|
-
function
|
|
665
|
+
const ui = new oe(3e4, 6e4);
|
|
666
|
+
function we(n, e) {
|
|
522
667
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
523
668
|
}
|
|
524
|
-
async function
|
|
525
|
-
return
|
|
669
|
+
async function J(n, e, t, i, r = {}) {
|
|
670
|
+
return Nt(n, r, async () => {
|
|
526
671
|
let s = {}, o = {};
|
|
527
672
|
i && (e === "GET" ? o = i : s = {
|
|
528
673
|
body: JSON.stringify(i)
|
|
529
674
|
});
|
|
530
|
-
const c =
|
|
675
|
+
const c = se(Object.assign({ key: n.config.apiKey }, o)).slice(1), a = await n._getAdditionalHeaders();
|
|
531
676
|
return a[
|
|
532
677
|
"Content-Type"
|
|
533
678
|
/* HttpHeader.CONTENT_TYPE */
|
|
534
679
|
] = "application/json", n.languageCode && (a[
|
|
535
680
|
"X-Firebase-Locale"
|
|
536
681
|
/* HttpHeader.X_FIREBASE_LOCALE */
|
|
537
|
-
] = n.languageCode),
|
|
682
|
+
] = n.languageCode), Ct.fetch()(Lt(n, n.config.apiHost, t, c), Object.assign({
|
|
538
683
|
method: e,
|
|
539
684
|
headers: a,
|
|
540
685
|
referrerPolicy: "no-referrer"
|
|
541
686
|
}, s));
|
|
542
687
|
});
|
|
543
688
|
}
|
|
544
|
-
async function
|
|
689
|
+
async function Nt(n, e, t) {
|
|
545
690
|
n._canInitEmulator = !1;
|
|
546
|
-
const i = Object.assign(Object.assign({},
|
|
691
|
+
const i = Object.assign(Object.assign({}, li), e);
|
|
547
692
|
try {
|
|
548
|
-
const r = new
|
|
693
|
+
const r = new di(n), s = await Promise.race([
|
|
549
694
|
t(),
|
|
550
695
|
r.promise
|
|
551
696
|
]);
|
|
552
697
|
r.clearNetworkTimeout();
|
|
553
698
|
const o = await s.json();
|
|
554
699
|
if ("needConfirmation" in o)
|
|
555
|
-
throw
|
|
700
|
+
throw le(n, "account-exists-with-different-credential", o);
|
|
556
701
|
if (s.ok && !("errorMessage" in o))
|
|
557
702
|
return o;
|
|
558
703
|
{
|
|
559
704
|
const c = s.ok ? o.errorMessage : o.error.message, [a, l] = c.split(" : ");
|
|
560
705
|
if (a === "FEDERATED_USER_ID_ALREADY_LINKED")
|
|
561
|
-
throw
|
|
706
|
+
throw le(n, "credential-already-in-use", o);
|
|
562
707
|
if (a === "EMAIL_EXISTS")
|
|
563
|
-
throw
|
|
708
|
+
throw le(n, "email-already-in-use", o);
|
|
564
709
|
if (a === "USER_DISABLED")
|
|
565
|
-
throw
|
|
710
|
+
throw le(n, "user-disabled", o);
|
|
566
711
|
const d = i[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
|
567
712
|
if (l)
|
|
568
|
-
throw
|
|
569
|
-
|
|
713
|
+
throw Pt(n, d, l);
|
|
714
|
+
O(n, d);
|
|
570
715
|
}
|
|
571
716
|
} catch (r) {
|
|
572
|
-
if (r instanceof
|
|
717
|
+
if (r instanceof Ve)
|
|
573
718
|
throw r;
|
|
574
|
-
|
|
719
|
+
O(n, "network-request-failed", { message: String(r) });
|
|
575
720
|
}
|
|
576
721
|
}
|
|
577
|
-
async function
|
|
578
|
-
const s = await
|
|
579
|
-
return "mfaPendingCredential" in s &&
|
|
722
|
+
async function Ot(n, e, t, i, r = {}) {
|
|
723
|
+
const s = await J(n, e, t, i, r);
|
|
724
|
+
return "mfaPendingCredential" in s && O(n, "multi-factor-auth-required", {
|
|
580
725
|
_serverResponse: s
|
|
581
726
|
}), s;
|
|
582
727
|
}
|
|
583
|
-
function
|
|
728
|
+
function Lt(n, e, t, i) {
|
|
584
729
|
const r = `${e}${t}?${i}`;
|
|
585
|
-
return n.config.emulator ?
|
|
730
|
+
return n.config.emulator ? je(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
586
731
|
}
|
|
587
|
-
class
|
|
732
|
+
class di {
|
|
588
733
|
constructor(e) {
|
|
589
734
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
590
|
-
this.timer = setTimeout(() => i(
|
|
735
|
+
this.timer = setTimeout(() => i(E(
|
|
591
736
|
this.auth,
|
|
592
737
|
"network-request-failed"
|
|
593
738
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
594
|
-
)),
|
|
739
|
+
)), ui.get());
|
|
595
740
|
});
|
|
596
741
|
}
|
|
597
742
|
clearNetworkTimeout() {
|
|
598
743
|
clearTimeout(this.timer);
|
|
599
744
|
}
|
|
600
745
|
}
|
|
601
|
-
function
|
|
746
|
+
function le(n, e, t) {
|
|
602
747
|
const i = {
|
|
603
748
|
appName: n.name
|
|
604
749
|
};
|
|
605
750
|
t.email && (i.email = t.email), t.phoneNumber && (i.phoneNumber = t.phoneNumber);
|
|
606
|
-
const r =
|
|
751
|
+
const r = E(n, e, i);
|
|
607
752
|
return r.customData._tokenResponse = t, r;
|
|
608
753
|
}
|
|
609
754
|
/**
|
|
@@ -622,11 +767,11 @@ function ee(n, e, t) {
|
|
|
622
767
|
* See the License for the specific language governing permissions and
|
|
623
768
|
* limitations under the License.
|
|
624
769
|
*/
|
|
625
|
-
async function
|
|
626
|
-
return
|
|
770
|
+
async function hi(n, e) {
|
|
771
|
+
return J(n, "POST", "/v1/accounts:delete", e);
|
|
627
772
|
}
|
|
628
|
-
async function
|
|
629
|
-
return
|
|
773
|
+
async function Mt(n, e) {
|
|
774
|
+
return J(n, "POST", "/v1/accounts:lookup", e);
|
|
630
775
|
}
|
|
631
776
|
/**
|
|
632
777
|
* @license
|
|
@@ -644,7 +789,7 @@ async function St(n, e) {
|
|
|
644
789
|
* See the License for the specific language governing permissions and
|
|
645
790
|
* limitations under the License.
|
|
646
791
|
*/
|
|
647
|
-
function
|
|
792
|
+
function te(n) {
|
|
648
793
|
if (n)
|
|
649
794
|
try {
|
|
650
795
|
const e = new Date(Number(n));
|
|
@@ -653,8 +798,8 @@ function q(n) {
|
|
|
653
798
|
} catch {
|
|
654
799
|
}
|
|
655
800
|
}
|
|
656
|
-
async function
|
|
657
|
-
const t =
|
|
801
|
+
async function fi(n, e = !1) {
|
|
802
|
+
const t = K(n), i = await t.getIdToken(e), r = We(i);
|
|
658
803
|
u(
|
|
659
804
|
r && r.exp && r.auth_time && r.iat,
|
|
660
805
|
t.auth,
|
|
@@ -665,29 +810,29 @@ async function Bn(n, e = !1) {
|
|
|
665
810
|
return {
|
|
666
811
|
claims: r,
|
|
667
812
|
token: i,
|
|
668
|
-
authTime:
|
|
669
|
-
issuedAtTime:
|
|
670
|
-
expirationTime:
|
|
813
|
+
authTime: te(Pe(r.auth_time)),
|
|
814
|
+
issuedAtTime: te(Pe(r.iat)),
|
|
815
|
+
expirationTime: te(Pe(r.exp)),
|
|
671
816
|
signInProvider: o || null,
|
|
672
817
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
|
673
818
|
};
|
|
674
819
|
}
|
|
675
|
-
function
|
|
820
|
+
function Pe(n) {
|
|
676
821
|
return Number(n) * 1e3;
|
|
677
822
|
}
|
|
678
|
-
function
|
|
823
|
+
function We(n) {
|
|
679
824
|
const [e, t, i] = n.split(".");
|
|
680
825
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
681
|
-
return
|
|
826
|
+
return ue("JWT malformed, contained fewer than 3 sections"), null;
|
|
682
827
|
try {
|
|
683
|
-
const r =
|
|
684
|
-
return r ? JSON.parse(r) : (
|
|
828
|
+
const r = An(t);
|
|
829
|
+
return r ? JSON.parse(r) : (ue("Failed to decode base64 JWT payload"), null);
|
|
685
830
|
} catch (r) {
|
|
686
|
-
return
|
|
831
|
+
return ue("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
687
832
|
}
|
|
688
833
|
}
|
|
689
|
-
function
|
|
690
|
-
const e =
|
|
834
|
+
function it(n) {
|
|
835
|
+
const e = We(n);
|
|
691
836
|
return u(
|
|
692
837
|
e,
|
|
693
838
|
"internal-error"
|
|
@@ -718,16 +863,16 @@ function Ye(n) {
|
|
|
718
863
|
* See the License for the specific language governing permissions and
|
|
719
864
|
* limitations under the License.
|
|
720
865
|
*/
|
|
721
|
-
async function
|
|
866
|
+
async function ie(n, e, t = !1) {
|
|
722
867
|
if (t)
|
|
723
868
|
return e;
|
|
724
869
|
try {
|
|
725
870
|
return await e;
|
|
726
871
|
} catch (i) {
|
|
727
|
-
throw i instanceof
|
|
872
|
+
throw i instanceof Ve && pi(i) && n.auth.currentUser === n && await n.auth.signOut(), i;
|
|
728
873
|
}
|
|
729
874
|
}
|
|
730
|
-
function
|
|
875
|
+
function pi({ code: n }) {
|
|
731
876
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
732
877
|
}
|
|
733
878
|
/**
|
|
@@ -746,7 +891,7 @@ function Gn({ code: n }) {
|
|
|
746
891
|
* See the License for the specific language governing permissions and
|
|
747
892
|
* limitations under the License.
|
|
748
893
|
*/
|
|
749
|
-
class
|
|
894
|
+
class mi {
|
|
750
895
|
constructor(e) {
|
|
751
896
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
752
897
|
}
|
|
@@ -808,12 +953,12 @@ class zn {
|
|
|
808
953
|
* See the License for the specific language governing permissions and
|
|
809
954
|
* limitations under the License.
|
|
810
955
|
*/
|
|
811
|
-
class
|
|
956
|
+
class Me {
|
|
812
957
|
constructor(e, t) {
|
|
813
958
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
814
959
|
}
|
|
815
960
|
_initializeTime() {
|
|
816
|
-
this.lastSignInTime =
|
|
961
|
+
this.lastSignInTime = te(this.lastLoginAt), this.creationTime = te(this.createdAt);
|
|
817
962
|
}
|
|
818
963
|
_copy(e) {
|
|
819
964
|
this.createdAt = e.createdAt, this.lastLoginAt = e.lastLoginAt, this._initializeTime();
|
|
@@ -841,9 +986,9 @@ class Pe {
|
|
|
841
986
|
* See the License for the specific language governing permissions and
|
|
842
987
|
* limitations under the License.
|
|
843
988
|
*/
|
|
844
|
-
async function
|
|
989
|
+
async function _e(n) {
|
|
845
990
|
var e;
|
|
846
|
-
const t = n.auth, i = await n.getIdToken(), r = await
|
|
991
|
+
const t = n.auth, i = await n.getIdToken(), r = await ie(n, Mt(t, { idToken: i }));
|
|
847
992
|
u(
|
|
848
993
|
r == null ? void 0 : r.users.length,
|
|
849
994
|
t,
|
|
@@ -852,7 +997,7 @@ async function le(n) {
|
|
|
852
997
|
);
|
|
853
998
|
const s = r.users[0];
|
|
854
999
|
n._notifyReloadListener(s);
|
|
855
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ?
|
|
1000
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? Ut(s.providerUserInfo) : [], c = _i(n.providerData, o), a = n.isAnonymous, l = !(n.email && s.passwordHash) && !(c != null && c.length), d = a ? l : !1, h = {
|
|
856
1001
|
uid: s.localId,
|
|
857
1002
|
displayName: s.displayName || null,
|
|
858
1003
|
photoURL: s.photoUrl || null,
|
|
@@ -861,21 +1006,21 @@ async function le(n) {
|
|
|
861
1006
|
phoneNumber: s.phoneNumber || null,
|
|
862
1007
|
tenantId: s.tenantId || null,
|
|
863
1008
|
providerData: c,
|
|
864
|
-
metadata: new
|
|
1009
|
+
metadata: new Me(s.createdAt, s.lastLoginAt),
|
|
865
1010
|
isAnonymous: d
|
|
866
1011
|
};
|
|
867
1012
|
Object.assign(n, h);
|
|
868
1013
|
}
|
|
869
|
-
async function
|
|
870
|
-
const e =
|
|
871
|
-
await
|
|
1014
|
+
async function gi(n) {
|
|
1015
|
+
const e = K(n);
|
|
1016
|
+
await _e(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
872
1017
|
}
|
|
873
|
-
function
|
|
1018
|
+
function _i(n, e) {
|
|
874
1019
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
875
1020
|
}
|
|
876
|
-
function
|
|
1021
|
+
function Ut(n) {
|
|
877
1022
|
return n.map((e) => {
|
|
878
|
-
var { providerId: t } = e, i =
|
|
1023
|
+
var { providerId: t } = e, i = $e(e, ["providerId"]);
|
|
879
1024
|
return {
|
|
880
1025
|
providerId: t,
|
|
881
1026
|
uid: i.rawId || "",
|
|
@@ -902,16 +1047,16 @@ function Rt(n) {
|
|
|
902
1047
|
* See the License for the specific language governing permissions and
|
|
903
1048
|
* limitations under the License.
|
|
904
1049
|
*/
|
|
905
|
-
async function
|
|
906
|
-
const t = await
|
|
907
|
-
const i =
|
|
1050
|
+
async function vi(n, e) {
|
|
1051
|
+
const t = await Nt(n, {}, async () => {
|
|
1052
|
+
const i = se({
|
|
908
1053
|
grant_type: "refresh_token",
|
|
909
1054
|
refresh_token: e
|
|
910
|
-
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o =
|
|
1055
|
+
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o = Lt(n, r, "/v1/token", `key=${s}`), c = await n._getAdditionalHeaders();
|
|
911
1056
|
return c[
|
|
912
1057
|
"Content-Type"
|
|
913
1058
|
/* HttpHeader.CONTENT_TYPE */
|
|
914
|
-
] = "application/x-www-form-urlencoded",
|
|
1059
|
+
] = "application/x-www-form-urlencoded", Ct.fetch()(o, {
|
|
915
1060
|
method: "POST",
|
|
916
1061
|
headers: c,
|
|
917
1062
|
body: i
|
|
@@ -923,8 +1068,8 @@ async function Jn(n, e) {
|
|
|
923
1068
|
refreshToken: t.refresh_token
|
|
924
1069
|
};
|
|
925
1070
|
}
|
|
926
|
-
async function
|
|
927
|
-
return
|
|
1071
|
+
async function Ii(n, e) {
|
|
1072
|
+
return J(n, "POST", "/v2/accounts:revokeToken", we(n, e));
|
|
928
1073
|
}
|
|
929
1074
|
/**
|
|
930
1075
|
* @license
|
|
@@ -942,7 +1087,7 @@ async function Yn(n, e) {
|
|
|
942
1087
|
* See the License for the specific language governing permissions and
|
|
943
1088
|
* limitations under the License.
|
|
944
1089
|
*/
|
|
945
|
-
class
|
|
1090
|
+
class G {
|
|
946
1091
|
constructor() {
|
|
947
1092
|
this.refreshToken = null, this.accessToken = null, this.expirationTime = null;
|
|
948
1093
|
}
|
|
@@ -963,7 +1108,7 @@ class $ {
|
|
|
963
1108
|
"internal-error"
|
|
964
1109
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
965
1110
|
);
|
|
966
|
-
const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) :
|
|
1111
|
+
const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) : it(e.idToken);
|
|
967
1112
|
this.updateTokensAndExpiration(e.idToken, e.refreshToken, t);
|
|
968
1113
|
}
|
|
969
1114
|
updateFromIdToken(e) {
|
|
@@ -972,7 +1117,7 @@ class $ {
|
|
|
972
1117
|
"internal-error"
|
|
973
1118
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
974
1119
|
);
|
|
975
|
-
const t =
|
|
1120
|
+
const t = it(e);
|
|
976
1121
|
this.updateTokensAndExpiration(e, null, t);
|
|
977
1122
|
}
|
|
978
1123
|
async getToken(e, t = !1) {
|
|
@@ -987,14 +1132,14 @@ class $ {
|
|
|
987
1132
|
this.refreshToken = null;
|
|
988
1133
|
}
|
|
989
1134
|
async refresh(e, t) {
|
|
990
|
-
const { accessToken: i, refreshToken: r, expiresIn: s } = await
|
|
1135
|
+
const { accessToken: i, refreshToken: r, expiresIn: s } = await vi(e, t);
|
|
991
1136
|
this.updateTokensAndExpiration(i, r, Number(s));
|
|
992
1137
|
}
|
|
993
1138
|
updateTokensAndExpiration(e, t, i) {
|
|
994
1139
|
this.refreshToken = t || null, this.accessToken = e || null, this.expirationTime = Date.now() + i * 1e3;
|
|
995
1140
|
}
|
|
996
1141
|
static fromJSON(e, t) {
|
|
997
|
-
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new
|
|
1142
|
+
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new G();
|
|
998
1143
|
return i && (u(typeof i == "string", "internal-error", {
|
|
999
1144
|
appName: e
|
|
1000
1145
|
}), o.refreshToken = i), r && (u(typeof r == "string", "internal-error", {
|
|
@@ -1014,10 +1159,10 @@ class $ {
|
|
|
1014
1159
|
this.accessToken = e.accessToken, this.refreshToken = e.refreshToken, this.expirationTime = e.expirationTime;
|
|
1015
1160
|
}
|
|
1016
1161
|
_clone() {
|
|
1017
|
-
return Object.assign(new
|
|
1162
|
+
return Object.assign(new G(), this.toJSON());
|
|
1018
1163
|
}
|
|
1019
1164
|
_performRefresh() {
|
|
1020
|
-
return
|
|
1165
|
+
return P("not implemented");
|
|
1021
1166
|
}
|
|
1022
1167
|
}
|
|
1023
1168
|
/**
|
|
@@ -1036,16 +1181,16 @@ class $ {
|
|
|
1036
1181
|
* See the License for the specific language governing permissions and
|
|
1037
1182
|
* limitations under the License.
|
|
1038
1183
|
*/
|
|
1039
|
-
function
|
|
1184
|
+
function U(n, e) {
|
|
1040
1185
|
u(typeof n == "string" || typeof n > "u", "internal-error", { appName: e });
|
|
1041
1186
|
}
|
|
1042
|
-
class
|
|
1187
|
+
class C {
|
|
1043
1188
|
constructor(e) {
|
|
1044
|
-
var { uid: t, auth: i, stsTokenManager: r } = e, s =
|
|
1045
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
1189
|
+
var { uid: t, auth: i, stsTokenManager: r } = e, s = $e(e, ["uid", "auth", "stsTokenManager"]);
|
|
1190
|
+
this.providerId = "firebase", this.proactiveRefresh = new mi(this), this.reloadUserInfo = null, this.reloadListener = null, this.uid = t, this.auth = i, this.stsTokenManager = r, this.accessToken = r.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 Me(s.createdAt || void 0, s.lastLoginAt || void 0);
|
|
1046
1191
|
}
|
|
1047
1192
|
async getIdToken(e) {
|
|
1048
|
-
const t = await
|
|
1193
|
+
const t = await ie(this, this.stsTokenManager.getToken(this.auth, e));
|
|
1049
1194
|
return u(
|
|
1050
1195
|
t,
|
|
1051
1196
|
this.auth,
|
|
@@ -1054,10 +1199,10 @@ class b {
|
|
|
1054
1199
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
1055
1200
|
}
|
|
1056
1201
|
getIdTokenResult(e) {
|
|
1057
|
-
return
|
|
1202
|
+
return fi(this, e);
|
|
1058
1203
|
}
|
|
1059
1204
|
reload() {
|
|
1060
|
-
return
|
|
1205
|
+
return gi(this);
|
|
1061
1206
|
}
|
|
1062
1207
|
_assign(e) {
|
|
1063
1208
|
this !== e && (u(
|
|
@@ -1068,7 +1213,7 @@ class b {
|
|
|
1068
1213
|
), 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));
|
|
1069
1214
|
}
|
|
1070
1215
|
_clone(e) {
|
|
1071
|
-
const t = new
|
|
1216
|
+
const t = new C(Object.assign(Object.assign({}, this), { auth: e, stsTokenManager: this.stsTokenManager._clone() }));
|
|
1072
1217
|
return t.metadata._copy(this.metadata), t;
|
|
1073
1218
|
}
|
|
1074
1219
|
_onReload(e) {
|
|
@@ -1090,13 +1235,13 @@ class b {
|
|
|
1090
1235
|
}
|
|
1091
1236
|
async _updateTokensIfNecessary(e, t = !1) {
|
|
1092
1237
|
let i = !1;
|
|
1093
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await
|
|
1238
|
+
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await _e(this), await this.auth._persistUserIfCurrent(this), i && this.auth._notifyListenersIfCurrent(this);
|
|
1094
1239
|
}
|
|
1095
1240
|
async delete() {
|
|
1096
|
-
if (
|
|
1097
|
-
return Promise.reject(
|
|
1241
|
+
if (A(this.auth.app))
|
|
1242
|
+
return Promise.reject($(this.auth));
|
|
1098
1243
|
const e = await this.getIdToken();
|
|
1099
|
-
return await
|
|
1244
|
+
return await ie(this, hi(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
1100
1245
|
}
|
|
1101
1246
|
toJSON() {
|
|
1102
1247
|
return Object.assign(Object.assign({
|
|
@@ -1124,45 +1269,45 @@ class b {
|
|
|
1124
1269
|
}
|
|
1125
1270
|
static _fromJSON(e, t) {
|
|
1126
1271
|
var i, r, s, o, c, a, l, d;
|
|
1127
|
-
const h = (i = t.displayName) !== null && i !== void 0 ? i : void 0,
|
|
1272
|
+
const h = (i = t.displayName) !== null && i !== void 0 ? i : void 0, m = (r = t.email) !== null && r !== void 0 ? r : void 0, I = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, w = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, g = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, v = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, T = (l = t.createdAt) !== null && l !== void 0 ? l : void 0, M = (d = t.lastLoginAt) !== null && d !== void 0 ? d : void 0, { uid: k, emailVerified: Ke, isAnonymous: Je, providerData: Se, stsTokenManager: Ye } = t;
|
|
1128
1273
|
u(
|
|
1129
|
-
|
|
1274
|
+
k && Ye,
|
|
1130
1275
|
e,
|
|
1131
1276
|
"internal-error"
|
|
1132
1277
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1133
1278
|
);
|
|
1134
|
-
const
|
|
1279
|
+
const on = G.fromJSON(this.name, Ye);
|
|
1135
1280
|
u(
|
|
1136
|
-
typeof
|
|
1281
|
+
typeof k == "string",
|
|
1137
1282
|
e,
|
|
1138
1283
|
"internal-error"
|
|
1139
1284
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1140
|
-
),
|
|
1141
|
-
typeof
|
|
1285
|
+
), U(h, e.name), U(m, e.name), u(
|
|
1286
|
+
typeof Ke == "boolean",
|
|
1142
1287
|
e,
|
|
1143
1288
|
"internal-error"
|
|
1144
1289
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1145
1290
|
), u(
|
|
1146
|
-
typeof
|
|
1291
|
+
typeof Je == "boolean",
|
|
1147
1292
|
e,
|
|
1148
1293
|
"internal-error"
|
|
1149
1294
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1150
|
-
),
|
|
1151
|
-
const
|
|
1152
|
-
uid:
|
|
1295
|
+
), U(I, e.name), U(w, e.name), U(g, e.name), U(v, e.name), U(T, e.name), U(M, e.name);
|
|
1296
|
+
const Re = new C({
|
|
1297
|
+
uid: k,
|
|
1153
1298
|
auth: e,
|
|
1154
|
-
email:
|
|
1155
|
-
emailVerified:
|
|
1299
|
+
email: m,
|
|
1300
|
+
emailVerified: Ke,
|
|
1156
1301
|
displayName: h,
|
|
1157
|
-
isAnonymous:
|
|
1158
|
-
photoURL:
|
|
1159
|
-
phoneNumber:
|
|
1160
|
-
tenantId:
|
|
1161
|
-
stsTokenManager:
|
|
1162
|
-
createdAt:
|
|
1163
|
-
lastLoginAt:
|
|
1302
|
+
isAnonymous: Je,
|
|
1303
|
+
photoURL: w,
|
|
1304
|
+
phoneNumber: I,
|
|
1305
|
+
tenantId: g,
|
|
1306
|
+
stsTokenManager: on,
|
|
1307
|
+
createdAt: T,
|
|
1308
|
+
lastLoginAt: M
|
|
1164
1309
|
});
|
|
1165
|
-
return
|
|
1310
|
+
return Se && Array.isArray(Se) && (Re.providerData = Se.map((an) => Object.assign({}, an))), v && (Re._redirectEventId = v), Re;
|
|
1166
1311
|
}
|
|
1167
1312
|
/**
|
|
1168
1313
|
* Initialize a User from an idToken server response
|
|
@@ -1170,15 +1315,15 @@ class b {
|
|
|
1170
1315
|
* @param idTokenResponse
|
|
1171
1316
|
*/
|
|
1172
1317
|
static async _fromIdTokenResponse(e, t, i = !1) {
|
|
1173
|
-
const r = new
|
|
1318
|
+
const r = new G();
|
|
1174
1319
|
r.updateFromServerResponse(t);
|
|
1175
|
-
const s = new
|
|
1320
|
+
const s = new C({
|
|
1176
1321
|
uid: t.localId,
|
|
1177
1322
|
auth: e,
|
|
1178
1323
|
stsTokenManager: r,
|
|
1179
1324
|
isAnonymous: i
|
|
1180
1325
|
});
|
|
1181
|
-
return await
|
|
1326
|
+
return await _e(s), s;
|
|
1182
1327
|
}
|
|
1183
1328
|
/**
|
|
1184
1329
|
* Initialize a User from an idToken server response
|
|
@@ -1192,9 +1337,9 @@ class b {
|
|
|
1192
1337
|
"internal-error"
|
|
1193
1338
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1194
1339
|
);
|
|
1195
|
-
const s = r.providerUserInfo !== void 0 ?
|
|
1340
|
+
const s = r.providerUserInfo !== void 0 ? Ut(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new G();
|
|
1196
1341
|
c.updateFromIdToken(i);
|
|
1197
|
-
const a = new
|
|
1342
|
+
const a = new C({
|
|
1198
1343
|
uid: r.localId,
|
|
1199
1344
|
auth: e,
|
|
1200
1345
|
stsTokenManager: c,
|
|
@@ -1208,7 +1353,7 @@ class b {
|
|
|
1208
1353
|
phoneNumber: r.phoneNumber || null,
|
|
1209
1354
|
tenantId: r.tenantId || null,
|
|
1210
1355
|
providerData: s,
|
|
1211
|
-
metadata: new
|
|
1356
|
+
metadata: new Me(r.createdAt, r.lastLoginAt),
|
|
1212
1357
|
isAnonymous: !(r.email && r.passwordHash) && !(s != null && s.length)
|
|
1213
1358
|
};
|
|
1214
1359
|
return Object.assign(a, l), a;
|
|
@@ -1230,11 +1375,11 @@ class b {
|
|
|
1230
1375
|
* See the License for the specific language governing permissions and
|
|
1231
1376
|
* limitations under the License.
|
|
1232
1377
|
*/
|
|
1233
|
-
const
|
|
1234
|
-
function
|
|
1235
|
-
|
|
1236
|
-
let e =
|
|
1237
|
-
return e ? (
|
|
1378
|
+
const rt = /* @__PURE__ */ new Map();
|
|
1379
|
+
function N(n) {
|
|
1380
|
+
L(n instanceof Function, "Expected a class definition");
|
|
1381
|
+
let e = rt.get(n);
|
|
1382
|
+
return e ? (L(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), rt.set(n, e), e);
|
|
1238
1383
|
}
|
|
1239
1384
|
/**
|
|
1240
1385
|
* @license
|
|
@@ -1252,7 +1397,7 @@ function S(n) {
|
|
|
1252
1397
|
* See the License for the specific language governing permissions and
|
|
1253
1398
|
* limitations under the License.
|
|
1254
1399
|
*/
|
|
1255
|
-
class
|
|
1400
|
+
class Dt {
|
|
1256
1401
|
constructor() {
|
|
1257
1402
|
this.type = "NONE", this.storage = {};
|
|
1258
1403
|
}
|
|
@@ -1274,8 +1419,8 @@ class Pt {
|
|
|
1274
1419
|
_removeListener(e, t) {
|
|
1275
1420
|
}
|
|
1276
1421
|
}
|
|
1277
|
-
|
|
1278
|
-
const
|
|
1422
|
+
Dt.type = "NONE";
|
|
1423
|
+
const st = Dt;
|
|
1279
1424
|
/**
|
|
1280
1425
|
* @license
|
|
1281
1426
|
* Copyright 2019 Google LLC
|
|
@@ -1292,21 +1437,21 @@ const Qe = Pt;
|
|
|
1292
1437
|
* See the License for the specific language governing permissions and
|
|
1293
1438
|
* limitations under the License.
|
|
1294
1439
|
*/
|
|
1295
|
-
function
|
|
1440
|
+
function de(n, e, t) {
|
|
1296
1441
|
return `firebase:${n}:${e}:${t}`;
|
|
1297
1442
|
}
|
|
1298
|
-
class
|
|
1443
|
+
class z {
|
|
1299
1444
|
constructor(e, t, i) {
|
|
1300
1445
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1301
1446
|
const { config: r, name: s } = this.auth;
|
|
1302
|
-
this.fullUserKey =
|
|
1447
|
+
this.fullUserKey = de(this.userKey, r.apiKey, s), this.fullPersistenceKey = de("persistence", r.apiKey, s), this.boundEventHandler = t._onStorageEvent.bind(t), this.persistence._addListener(this.fullUserKey, this.boundEventHandler);
|
|
1303
1448
|
}
|
|
1304
1449
|
setCurrentUser(e) {
|
|
1305
1450
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
|
1306
1451
|
}
|
|
1307
1452
|
async getCurrentUser() {
|
|
1308
1453
|
const e = await this.persistence._get(this.fullUserKey);
|
|
1309
|
-
return e ?
|
|
1454
|
+
return e ? C._fromJSON(this.auth, e) : null;
|
|
1310
1455
|
}
|
|
1311
1456
|
removeCurrentUser() {
|
|
1312
1457
|
return this.persistence._remove(this.fullUserKey);
|
|
@@ -1326,32 +1471,32 @@ class H {
|
|
|
1326
1471
|
}
|
|
1327
1472
|
static async create(e, t, i = "authUser") {
|
|
1328
1473
|
if (!t.length)
|
|
1329
|
-
return new
|
|
1474
|
+
return new z(N(st), e, i);
|
|
1330
1475
|
const r = (await Promise.all(t.map(async (l) => {
|
|
1331
1476
|
if (await l._isAvailable())
|
|
1332
1477
|
return l;
|
|
1333
1478
|
}))).filter((l) => l);
|
|
1334
|
-
let s = r[0] ||
|
|
1335
|
-
const o =
|
|
1479
|
+
let s = r[0] || N(st);
|
|
1480
|
+
const o = de(i, e.config.apiKey, e.name);
|
|
1336
1481
|
let c = null;
|
|
1337
1482
|
for (const l of t)
|
|
1338
1483
|
try {
|
|
1339
1484
|
const d = await l._get(o);
|
|
1340
1485
|
if (d) {
|
|
1341
|
-
const h =
|
|
1486
|
+
const h = C._fromJSON(e, d);
|
|
1342
1487
|
l !== s && (c = h), s = l;
|
|
1343
1488
|
break;
|
|
1344
1489
|
}
|
|
1345
1490
|
} catch {
|
|
1346
1491
|
}
|
|
1347
1492
|
const a = r.filter((l) => l._shouldAllowMigration);
|
|
1348
|
-
return !s._shouldAllowMigration || !a.length ? new
|
|
1493
|
+
return !s._shouldAllowMigration || !a.length ? new z(s, e, i) : (s = a[0], c && await s._set(o, c.toJSON()), await Promise.all(t.map(async (l) => {
|
|
1349
1494
|
if (l !== s)
|
|
1350
1495
|
try {
|
|
1351
1496
|
await l._remove(o);
|
|
1352
1497
|
} catch {
|
|
1353
1498
|
}
|
|
1354
|
-
})), new
|
|
1499
|
+
})), new z(s, e, i));
|
|
1355
1500
|
}
|
|
1356
1501
|
}
|
|
1357
1502
|
/**
|
|
@@ -1370,29 +1515,29 @@ class H {
|
|
|
1370
1515
|
* See the License for the specific language governing permissions and
|
|
1371
1516
|
* limitations under the License.
|
|
1372
1517
|
*/
|
|
1373
|
-
function
|
|
1518
|
+
function ot(n) {
|
|
1374
1519
|
const e = n.toLowerCase();
|
|
1375
1520
|
if (e.includes("opera/") || e.includes("opr/") || e.includes("opios/"))
|
|
1376
1521
|
return "Opera";
|
|
1377
|
-
if (
|
|
1522
|
+
if (Vt(e))
|
|
1378
1523
|
return "IEMobile";
|
|
1379
1524
|
if (e.includes("msie") || e.includes("trident/"))
|
|
1380
1525
|
return "IE";
|
|
1381
1526
|
if (e.includes("edge/"))
|
|
1382
1527
|
return "Edge";
|
|
1383
|
-
if (
|
|
1528
|
+
if (xt(e))
|
|
1384
1529
|
return "Firefox";
|
|
1385
1530
|
if (e.includes("silk/"))
|
|
1386
1531
|
return "Silk";
|
|
1387
|
-
if (
|
|
1532
|
+
if (Ht(e))
|
|
1388
1533
|
return "Blackberry";
|
|
1389
|
-
if (
|
|
1534
|
+
if (jt(e))
|
|
1390
1535
|
return "Webos";
|
|
1391
|
-
if (
|
|
1536
|
+
if (Be(e))
|
|
1392
1537
|
return "Safari";
|
|
1393
|
-
if ((e.includes("chrome/") ||
|
|
1538
|
+
if ((e.includes("chrome/") || Ft(e)) && !e.includes("edge/"))
|
|
1394
1539
|
return "Chrome";
|
|
1395
|
-
if (
|
|
1540
|
+
if ($t(e))
|
|
1396
1541
|
return "Android";
|
|
1397
1542
|
{
|
|
1398
1543
|
const t = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/, i = n.match(t);
|
|
@@ -1401,42 +1546,42 @@ function Ze(n) {
|
|
|
1401
1546
|
}
|
|
1402
1547
|
return "Other";
|
|
1403
1548
|
}
|
|
1404
|
-
function
|
|
1549
|
+
function xt(n = y()) {
|
|
1405
1550
|
return /firefox\//i.test(n);
|
|
1406
1551
|
}
|
|
1407
|
-
function
|
|
1552
|
+
function Be(n = y()) {
|
|
1408
1553
|
const e = n.toLowerCase();
|
|
1409
1554
|
return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
|
|
1410
1555
|
}
|
|
1411
|
-
function
|
|
1556
|
+
function Ft(n = y()) {
|
|
1412
1557
|
return /crios\//i.test(n);
|
|
1413
1558
|
}
|
|
1414
|
-
function
|
|
1559
|
+
function Vt(n = y()) {
|
|
1415
1560
|
return /iemobile/i.test(n);
|
|
1416
1561
|
}
|
|
1417
|
-
function
|
|
1562
|
+
function $t(n = y()) {
|
|
1418
1563
|
return /android/i.test(n);
|
|
1419
1564
|
}
|
|
1420
|
-
function
|
|
1565
|
+
function Ht(n = y()) {
|
|
1421
1566
|
return /blackberry/i.test(n);
|
|
1422
1567
|
}
|
|
1423
|
-
function
|
|
1568
|
+
function jt(n = y()) {
|
|
1424
1569
|
return /webos/i.test(n);
|
|
1425
1570
|
}
|
|
1426
|
-
function
|
|
1571
|
+
function Te(n = y()) {
|
|
1427
1572
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1428
1573
|
}
|
|
1429
|
-
function
|
|
1574
|
+
function yi(n = y()) {
|
|
1430
1575
|
var e;
|
|
1431
|
-
return
|
|
1576
|
+
return Te(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1432
1577
|
}
|
|
1433
|
-
function
|
|
1434
|
-
return
|
|
1578
|
+
function wi() {
|
|
1579
|
+
return Pn() && document.documentMode === 10;
|
|
1435
1580
|
}
|
|
1436
|
-
function
|
|
1437
|
-
return
|
|
1581
|
+
function Wt(n = y()) {
|
|
1582
|
+
return Te(n) || $t(n) || jt(n) || Ht(n) || /windows phone/i.test(n) || Vt(n);
|
|
1438
1583
|
}
|
|
1439
|
-
function
|
|
1584
|
+
function Ti() {
|
|
1440
1585
|
try {
|
|
1441
1586
|
return !!(window && window !== window.top);
|
|
1442
1587
|
} catch {
|
|
@@ -1459,20 +1604,20 @@ function Zn() {
|
|
|
1459
1604
|
* See the License for the specific language governing permissions and
|
|
1460
1605
|
* limitations under the License.
|
|
1461
1606
|
*/
|
|
1462
|
-
function
|
|
1607
|
+
function Bt(n, e = []) {
|
|
1463
1608
|
let t;
|
|
1464
1609
|
switch (n) {
|
|
1465
1610
|
case "Browser":
|
|
1466
|
-
t =
|
|
1611
|
+
t = ot(y());
|
|
1467
1612
|
break;
|
|
1468
1613
|
case "Worker":
|
|
1469
|
-
t = `${
|
|
1614
|
+
t = `${ot(y())}-${n}`;
|
|
1470
1615
|
break;
|
|
1471
1616
|
default:
|
|
1472
1617
|
t = n;
|
|
1473
1618
|
}
|
|
1474
1619
|
const i = e.length ? e.join(",") : "FirebaseCore-web";
|
|
1475
|
-
return `${t}/JsCore/${
|
|
1620
|
+
return `${t}/JsCore/${re}/${i}`;
|
|
1476
1621
|
}
|
|
1477
1622
|
/**
|
|
1478
1623
|
* @license
|
|
@@ -1490,7 +1635,7 @@ function Dt(n, e = []) {
|
|
|
1490
1635
|
* See the License for the specific language governing permissions and
|
|
1491
1636
|
* limitations under the License.
|
|
1492
1637
|
*/
|
|
1493
|
-
class
|
|
1638
|
+
class ki {
|
|
1494
1639
|
constructor(e) {
|
|
1495
1640
|
this.auth = e, this.queue = [];
|
|
1496
1641
|
}
|
|
@@ -1545,8 +1690,8 @@ class ei {
|
|
|
1545
1690
|
* See the License for the specific language governing permissions and
|
|
1546
1691
|
* limitations under the License.
|
|
1547
1692
|
*/
|
|
1548
|
-
async function
|
|
1549
|
-
return
|
|
1693
|
+
async function Ei(n, e = {}) {
|
|
1694
|
+
return J(n, "GET", "/v2/passwordPolicy", we(n, e));
|
|
1550
1695
|
}
|
|
1551
1696
|
/**
|
|
1552
1697
|
* @license
|
|
@@ -1564,12 +1709,12 @@ async function ti(n, e = {}) {
|
|
|
1564
1709
|
* See the License for the specific language governing permissions and
|
|
1565
1710
|
* limitations under the License.
|
|
1566
1711
|
*/
|
|
1567
|
-
const
|
|
1568
|
-
class
|
|
1712
|
+
const bi = 6;
|
|
1713
|
+
class Si {
|
|
1569
1714
|
constructor(e) {
|
|
1570
1715
|
var t, i, r, s;
|
|
1571
1716
|
const o = e.customStrengthOptions;
|
|
1572
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
|
1717
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : bi, o.maxPasswordLength && (this.customStrengthOptions.maxPasswordLength = o.maxPasswordLength), o.containsLowercaseCharacter !== void 0 && (this.customStrengthOptions.containsLowercaseLetter = o.containsLowercaseCharacter), o.containsUppercaseCharacter !== void 0 && (this.customStrengthOptions.containsUppercaseLetter = o.containsUppercaseCharacter), o.containsNumericCharacter !== void 0 && (this.customStrengthOptions.containsNumericCharacter = o.containsNumericCharacter), o.containsNonAlphanumericCharacter !== void 0 && (this.customStrengthOptions.containsNonAlphanumericCharacter = o.containsNonAlphanumericCharacter), this.enforcementState = e.enforcementState, this.enforcementState === "ENFORCEMENT_STATE_UNSPECIFIED" && (this.enforcementState = "OFF"), this.allowedNonAlphanumericCharacters = (r = (i = e.allowedNonAlphanumericCharacters) === null || i === void 0 ? void 0 : i.join("")) !== null && r !== void 0 ? r : "", this.forceUpgradeOnSignin = (s = e.forceUpgradeOnSignin) !== null && s !== void 0 ? s : !1, this.schemaVersion = e.schemaVersion;
|
|
1573
1718
|
}
|
|
1574
1719
|
validatePassword(e) {
|
|
1575
1720
|
var t, i, r, s, o, c;
|
|
@@ -1652,14 +1797,14 @@ class ii {
|
|
|
1652
1797
|
* See the License for the specific language governing permissions and
|
|
1653
1798
|
* limitations under the License.
|
|
1654
1799
|
*/
|
|
1655
|
-
class
|
|
1800
|
+
class Ri {
|
|
1656
1801
|
constructor(e, t, i, r) {
|
|
1657
|
-
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = i, this.config = r, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new
|
|
1802
|
+
this.app = e, this.heartbeatServiceProvider = t, this.appCheckServiceProvider = i, this.config = r, this.currentUser = null, this.emulatorConfig = null, this.operations = Promise.resolve(), this.authStateSubscription = new at(this), this.idTokenSubscription = new at(this), this.beforeStateQueue = new ki(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 = At, 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 = r.sdkClientVersion;
|
|
1658
1803
|
}
|
|
1659
1804
|
_initializeWithPersistence(e, t) {
|
|
1660
|
-
return t && (this._popupRedirectResolver =
|
|
1805
|
+
return t && (this._popupRedirectResolver = N(t)), this._initializationPromise = this.queue(async () => {
|
|
1661
1806
|
var i, r;
|
|
1662
|
-
if (!this._deleted && (this.persistenceManager = await
|
|
1807
|
+
if (!this._deleted && (this.persistenceManager = await z.create(this, e), !this._deleted)) {
|
|
1663
1808
|
if (!((i = this._popupRedirectResolver) === null || i === void 0) && i._shouldInitProactively)
|
|
1664
1809
|
try {
|
|
1665
1810
|
await this._popupRedirectResolver._initialize(this);
|
|
@@ -1690,7 +1835,7 @@ class ri {
|
|
|
1690
1835
|
}
|
|
1691
1836
|
async initializeCurrentUserFromIdToken(e) {
|
|
1692
1837
|
try {
|
|
1693
|
-
const t = await
|
|
1838
|
+
const t = await Mt(this, { idToken: e }), i = await C._fromGetAccountInfoResponse(this, t, e);
|
|
1694
1839
|
await this.directlySetCurrentUser(i);
|
|
1695
1840
|
} catch (t) {
|
|
1696
1841
|
console.warn("FirebaseServerApp could not login user with provided authIdToken: ", t), await this.directlySetCurrentUser(null);
|
|
@@ -1698,7 +1843,7 @@ class ri {
|
|
|
1698
1843
|
}
|
|
1699
1844
|
async initializeCurrentUser(e) {
|
|
1700
1845
|
var t;
|
|
1701
|
-
if (
|
|
1846
|
+
if (A(this.app)) {
|
|
1702
1847
|
const o = this.app.settings.authIdToken;
|
|
1703
1848
|
return o ? new Promise((c) => {
|
|
1704
1849
|
setTimeout(() => this.initializeCurrentUserFromIdToken(o).then(c, c));
|
|
@@ -1740,7 +1885,7 @@ class ri {
|
|
|
1740
1885
|
}
|
|
1741
1886
|
async reloadAndSetCurrentUserOrClear(e) {
|
|
1742
1887
|
try {
|
|
1743
|
-
await
|
|
1888
|
+
await _e(e);
|
|
1744
1889
|
} catch (t) {
|
|
1745
1890
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
|
1746
1891
|
return this.directlySetCurrentUser(null);
|
|
@@ -1748,15 +1893,15 @@ class ri {
|
|
|
1748
1893
|
return this.directlySetCurrentUser(e);
|
|
1749
1894
|
}
|
|
1750
1895
|
useDeviceLanguage() {
|
|
1751
|
-
this.languageCode =
|
|
1896
|
+
this.languageCode = ci();
|
|
1752
1897
|
}
|
|
1753
1898
|
async _delete() {
|
|
1754
1899
|
this._deleted = !0;
|
|
1755
1900
|
}
|
|
1756
1901
|
async updateCurrentUser(e) {
|
|
1757
|
-
if (
|
|
1758
|
-
return Promise.reject(
|
|
1759
|
-
const t = e ?
|
|
1902
|
+
if (A(this.app))
|
|
1903
|
+
return Promise.reject($(this));
|
|
1904
|
+
const t = e ? K(e) : null;
|
|
1760
1905
|
return t && u(
|
|
1761
1906
|
t.auth.config.apiKey === this.config.apiKey,
|
|
1762
1907
|
this,
|
|
@@ -1776,15 +1921,15 @@ class ri {
|
|
|
1776
1921
|
});
|
|
1777
1922
|
}
|
|
1778
1923
|
async signOut() {
|
|
1779
|
-
return
|
|
1924
|
+
return A(this.app) ? Promise.reject($(this)) : (await this.beforeStateQueue.runMiddleware(null), (this.redirectPersistenceManager || this._popupRedirectResolver) && await this._setRedirectUser(null), this._updateCurrentUser(
|
|
1780
1925
|
null,
|
|
1781
1926
|
/* skipBeforeStateCallbacks */
|
|
1782
1927
|
!0
|
|
1783
1928
|
));
|
|
1784
1929
|
}
|
|
1785
1930
|
setPersistence(e) {
|
|
1786
|
-
return
|
|
1787
|
-
await this.assertedPersistence.setPersistence(
|
|
1931
|
+
return A(this.app) ? Promise.reject($(this)) : this.queue(async () => {
|
|
1932
|
+
await this.assertedPersistence.setPersistence(N(e));
|
|
1788
1933
|
});
|
|
1789
1934
|
}
|
|
1790
1935
|
_getRecaptchaConfig() {
|
|
@@ -1799,14 +1944,14 @@ class ri {
|
|
|
1799
1944
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
1800
1945
|
}
|
|
1801
1946
|
async _updatePasswordPolicy() {
|
|
1802
|
-
const e = await
|
|
1947
|
+
const e = await Ei(this), t = new Si(e);
|
|
1803
1948
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
1804
1949
|
}
|
|
1805
1950
|
_getPersistence() {
|
|
1806
1951
|
return this.assertedPersistence.persistence.type;
|
|
1807
1952
|
}
|
|
1808
1953
|
_updateErrorMap(e) {
|
|
1809
|
-
this._errorFactory = new
|
|
1954
|
+
this._errorFactory = new Fe("auth", "Firebase", e());
|
|
1810
1955
|
}
|
|
1811
1956
|
onAuthStateChanged(e, t, i) {
|
|
1812
1957
|
return this.registerStateListener(this.authStateSubscription, e, t, i);
|
|
@@ -1839,7 +1984,7 @@ class ri {
|
|
|
1839
1984
|
token: e,
|
|
1840
1985
|
idToken: t
|
|
1841
1986
|
};
|
|
1842
|
-
this.tenantId != null && (i.tenantId = this.tenantId), await
|
|
1987
|
+
this.tenantId != null && (i.tenantId = this.tenantId), await Ii(this, i);
|
|
1843
1988
|
}
|
|
1844
1989
|
}
|
|
1845
1990
|
toJSON() {
|
|
@@ -1857,15 +2002,15 @@ class ri {
|
|
|
1857
2002
|
}
|
|
1858
2003
|
async getOrInitRedirectPersistenceManager(e) {
|
|
1859
2004
|
if (!this.redirectPersistenceManager) {
|
|
1860
|
-
const t = e &&
|
|
2005
|
+
const t = e && N(e) || this._popupRedirectResolver;
|
|
1861
2006
|
u(
|
|
1862
2007
|
t,
|
|
1863
2008
|
this,
|
|
1864
2009
|
"argument-error"
|
|
1865
2010
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
1866
|
-
), this.redirectPersistenceManager = await
|
|
2011
|
+
), this.redirectPersistenceManager = await z.create(
|
|
1867
2012
|
this,
|
|
1868
|
-
[
|
|
2013
|
+
[N(t._redirectPersistence)],
|
|
1869
2014
|
"redirectUser"
|
|
1870
2015
|
/* KeyName.REDIRECT_USER */
|
|
1871
2016
|
), this.redirectUser = await this.redirectPersistenceManager.getCurrentUser();
|
|
@@ -1952,7 +2097,7 @@ class ri {
|
|
|
1952
2097
|
), this.persistenceManager;
|
|
1953
2098
|
}
|
|
1954
2099
|
_logFramework(e) {
|
|
1955
|
-
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion =
|
|
2100
|
+
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion = Bt(this.config.clientPlatform, this._getFrameworks()));
|
|
1956
2101
|
}
|
|
1957
2102
|
_getFrameworks() {
|
|
1958
2103
|
return this.frameworks;
|
|
@@ -1982,15 +2127,15 @@ class ri {
|
|
|
1982
2127
|
async _getAppCheckToken() {
|
|
1983
2128
|
var e;
|
|
1984
2129
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
1985
|
-
return t != null && t.error &&
|
|
2130
|
+
return t != null && t.error && si(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
1986
2131
|
}
|
|
1987
2132
|
}
|
|
1988
|
-
function
|
|
1989
|
-
return
|
|
2133
|
+
function ke(n) {
|
|
2134
|
+
return K(n);
|
|
1990
2135
|
}
|
|
1991
|
-
class
|
|
2136
|
+
class at {
|
|
1992
2137
|
constructor(e) {
|
|
1993
|
-
this.auth = e, this.observer = null, this.addObserver =
|
|
2138
|
+
this.auth = e, this.observer = null, this.addObserver = En((t) => this.observer = t);
|
|
1994
2139
|
}
|
|
1995
2140
|
get next() {
|
|
1996
2141
|
return u(
|
|
@@ -2017,7 +2162,7 @@ class et {
|
|
|
2017
2162
|
* See the License for the specific language governing permissions and
|
|
2018
2163
|
* limitations under the License.
|
|
2019
2164
|
*/
|
|
2020
|
-
let
|
|
2165
|
+
let Ge = {
|
|
2021
2166
|
async loadJS() {
|
|
2022
2167
|
throw new Error("Unable to load external scripts");
|
|
2023
2168
|
},
|
|
@@ -2025,16 +2170,16 @@ let Fe = {
|
|
|
2025
2170
|
recaptchaEnterpriseScript: "",
|
|
2026
2171
|
gapiScript: ""
|
|
2027
2172
|
};
|
|
2028
|
-
function
|
|
2029
|
-
|
|
2173
|
+
function Ai(n) {
|
|
2174
|
+
Ge = n;
|
|
2030
2175
|
}
|
|
2031
|
-
function
|
|
2032
|
-
return
|
|
2176
|
+
function Pi(n) {
|
|
2177
|
+
return Ge.loadJS(n);
|
|
2033
2178
|
}
|
|
2034
|
-
function
|
|
2035
|
-
return
|
|
2179
|
+
function Ci() {
|
|
2180
|
+
return Ge.gapiScript;
|
|
2036
2181
|
}
|
|
2037
|
-
function
|
|
2182
|
+
function Ni(n) {
|
|
2038
2183
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
2039
2184
|
}
|
|
2040
2185
|
/**
|
|
@@ -2053,13 +2198,13 @@ function ci(n) {
|
|
|
2053
2198
|
* See the License for the specific language governing permissions and
|
|
2054
2199
|
* limitations under the License.
|
|
2055
2200
|
*/
|
|
2056
|
-
function
|
|
2057
|
-
const t =
|
|
2201
|
+
function Oi(n, e) {
|
|
2202
|
+
const t = Et(n, "auth");
|
|
2058
2203
|
if (t.isInitialized()) {
|
|
2059
2204
|
const r = t.getImmediate(), s = t.getOptions();
|
|
2060
|
-
if (
|
|
2205
|
+
if (Rn(s, e ?? {}))
|
|
2061
2206
|
return r;
|
|
2062
|
-
|
|
2207
|
+
O(
|
|
2063
2208
|
r,
|
|
2064
2209
|
"already-initialized"
|
|
2065
2210
|
/* AuthErrorCode.ALREADY_INITIALIZED */
|
|
@@ -2067,12 +2212,12 @@ function li(n, e) {
|
|
|
2067
2212
|
}
|
|
2068
2213
|
return t.initialize({ options: e });
|
|
2069
2214
|
}
|
|
2070
|
-
function
|
|
2071
|
-
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(
|
|
2215
|
+
function Li(n, e) {
|
|
2216
|
+
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(N);
|
|
2072
2217
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2073
2218
|
}
|
|
2074
|
-
function
|
|
2075
|
-
const i =
|
|
2219
|
+
function Mi(n, e, t) {
|
|
2220
|
+
const i = ke(n);
|
|
2076
2221
|
u(
|
|
2077
2222
|
i._canInitEmulator,
|
|
2078
2223
|
i,
|
|
@@ -2084,38 +2229,38 @@ function di(n, e, t) {
|
|
|
2084
2229
|
"invalid-emulator-scheme"
|
|
2085
2230
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
2086
2231
|
);
|
|
2087
|
-
const r = !1, s =
|
|
2232
|
+
const r = !1, s = Gt(e), { host: o, port: c } = Ui(e), a = c === null ? "" : `:${c}`;
|
|
2088
2233
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
2089
2234
|
host: o,
|
|
2090
2235
|
port: c,
|
|
2091
2236
|
protocol: s.replace(":", ""),
|
|
2092
2237
|
options: Object.freeze({ disableWarnings: r })
|
|
2093
|
-
}),
|
|
2238
|
+
}), Di();
|
|
2094
2239
|
}
|
|
2095
|
-
function
|
|
2240
|
+
function Gt(n) {
|
|
2096
2241
|
const e = n.indexOf(":");
|
|
2097
2242
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
2098
2243
|
}
|
|
2099
|
-
function
|
|
2100
|
-
const e =
|
|
2244
|
+
function Ui(n) {
|
|
2245
|
+
const e = Gt(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
2101
2246
|
if (!t)
|
|
2102
2247
|
return { host: "", port: null };
|
|
2103
2248
|
const i = t[2].split("@").pop() || "", r = /^(\[[^\]]+\])(:|$)/.exec(i);
|
|
2104
2249
|
if (r) {
|
|
2105
2250
|
const s = r[1];
|
|
2106
|
-
return { host: s, port:
|
|
2251
|
+
return { host: s, port: ct(i.substr(s.length + 1)) };
|
|
2107
2252
|
} else {
|
|
2108
2253
|
const [s, o] = i.split(":");
|
|
2109
|
-
return { host: s, port:
|
|
2254
|
+
return { host: s, port: ct(o) };
|
|
2110
2255
|
}
|
|
2111
2256
|
}
|
|
2112
|
-
function
|
|
2257
|
+
function ct(n) {
|
|
2113
2258
|
if (!n)
|
|
2114
2259
|
return null;
|
|
2115
2260
|
const e = Number(n);
|
|
2116
2261
|
return isNaN(e) ? null : e;
|
|
2117
2262
|
}
|
|
2118
|
-
function
|
|
2263
|
+
function Di() {
|
|
2119
2264
|
function n() {
|
|
2120
2265
|
const e = document.createElement("p"), t = e.style;
|
|
2121
2266
|
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);
|
|
@@ -2138,7 +2283,7 @@ function fi() {
|
|
|
2138
2283
|
* See the License for the specific language governing permissions and
|
|
2139
2284
|
* limitations under the License.
|
|
2140
2285
|
*/
|
|
2141
|
-
class
|
|
2286
|
+
class zt {
|
|
2142
2287
|
/** @internal */
|
|
2143
2288
|
constructor(e, t) {
|
|
2144
2289
|
this.providerId = e, this.signInMethod = t;
|
|
@@ -2149,19 +2294,19 @@ class xt {
|
|
|
2149
2294
|
* @returns a JSON-serializable representation of this object.
|
|
2150
2295
|
*/
|
|
2151
2296
|
toJSON() {
|
|
2152
|
-
return
|
|
2297
|
+
return P("not implemented");
|
|
2153
2298
|
}
|
|
2154
2299
|
/** @internal */
|
|
2155
2300
|
_getIdTokenResponse(e) {
|
|
2156
|
-
return
|
|
2301
|
+
return P("not implemented");
|
|
2157
2302
|
}
|
|
2158
2303
|
/** @internal */
|
|
2159
2304
|
_linkToIdToken(e, t) {
|
|
2160
|
-
return
|
|
2305
|
+
return P("not implemented");
|
|
2161
2306
|
}
|
|
2162
2307
|
/** @internal */
|
|
2163
2308
|
_getReauthenticationResolver(e) {
|
|
2164
|
-
return
|
|
2309
|
+
return P("not implemented");
|
|
2165
2310
|
}
|
|
2166
2311
|
}
|
|
2167
2312
|
/**
|
|
@@ -2180,8 +2325,8 @@ class xt {
|
|
|
2180
2325
|
* See the License for the specific language governing permissions and
|
|
2181
2326
|
* limitations under the License.
|
|
2182
2327
|
*/
|
|
2183
|
-
async function
|
|
2184
|
-
return
|
|
2328
|
+
async function q(n, e) {
|
|
2329
|
+
return Ot(n, "POST", "/v1/accounts:signInWithIdp", we(n, e));
|
|
2185
2330
|
}
|
|
2186
2331
|
/**
|
|
2187
2332
|
* @license
|
|
@@ -2199,15 +2344,15 @@ async function j(n, e) {
|
|
|
2199
2344
|
* See the License for the specific language governing permissions and
|
|
2200
2345
|
* limitations under the License.
|
|
2201
2346
|
*/
|
|
2202
|
-
const
|
|
2203
|
-
class
|
|
2347
|
+
const xi = "http://localhost";
|
|
2348
|
+
class j extends zt {
|
|
2204
2349
|
constructor() {
|
|
2205
2350
|
super(...arguments), this.pendingToken = null;
|
|
2206
2351
|
}
|
|
2207
2352
|
/** @internal */
|
|
2208
2353
|
static _fromParams(e) {
|
|
2209
|
-
const t = new
|
|
2210
|
-
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) :
|
|
2354
|
+
const t = new j(e.providerId, e.signInMethod);
|
|
2355
|
+
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) : O(
|
|
2211
2356
|
"argument-error"
|
|
2212
2357
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2213
2358
|
), t;
|
|
@@ -2234,37 +2379,37 @@ class D extends xt {
|
|
|
2234
2379
|
* @returns If the JSON input does not represent an {@link AuthCredential}, null is returned.
|
|
2235
2380
|
*/
|
|
2236
2381
|
static fromJSON(e) {
|
|
2237
|
-
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s =
|
|
2382
|
+
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = $e(t, ["providerId", "signInMethod"]);
|
|
2238
2383
|
if (!i || !r)
|
|
2239
2384
|
return null;
|
|
2240
|
-
const o = new
|
|
2385
|
+
const o = new j(i, r);
|
|
2241
2386
|
return o.idToken = s.idToken || void 0, o.accessToken = s.accessToken || void 0, o.secret = s.secret, o.nonce = s.nonce, o.pendingToken = s.pendingToken || null, o;
|
|
2242
2387
|
}
|
|
2243
2388
|
/** @internal */
|
|
2244
2389
|
_getIdTokenResponse(e) {
|
|
2245
2390
|
const t = this.buildRequest();
|
|
2246
|
-
return
|
|
2391
|
+
return q(e, t);
|
|
2247
2392
|
}
|
|
2248
2393
|
/** @internal */
|
|
2249
2394
|
_linkToIdToken(e, t) {
|
|
2250
2395
|
const i = this.buildRequest();
|
|
2251
|
-
return i.idToken = t,
|
|
2396
|
+
return i.idToken = t, q(e, i);
|
|
2252
2397
|
}
|
|
2253
2398
|
/** @internal */
|
|
2254
2399
|
_getReauthenticationResolver(e) {
|
|
2255
2400
|
const t = this.buildRequest();
|
|
2256
|
-
return t.autoCreate = !1,
|
|
2401
|
+
return t.autoCreate = !1, q(e, t);
|
|
2257
2402
|
}
|
|
2258
2403
|
buildRequest() {
|
|
2259
2404
|
const e = {
|
|
2260
|
-
requestUri:
|
|
2405
|
+
requestUri: xi,
|
|
2261
2406
|
returnSecureToken: !0
|
|
2262
2407
|
};
|
|
2263
2408
|
if (this.pendingToken)
|
|
2264
2409
|
e.pendingToken = this.pendingToken;
|
|
2265
2410
|
else {
|
|
2266
2411
|
const t = {};
|
|
2267
|
-
this.idToken && (t.id_token = this.idToken), this.accessToken && (t.access_token = this.accessToken), this.secret && (t.oauth_token_secret = this.secret), t.providerId = this.providerId, this.nonce && !this.pendingToken && (t.nonce = this.nonce), e.postBody =
|
|
2412
|
+
this.idToken && (t.id_token = this.idToken), this.accessToken && (t.access_token = this.accessToken), this.secret && (t.oauth_token_secret = this.secret), t.providerId = this.providerId, this.nonce && !this.pendingToken && (t.nonce = this.nonce), e.postBody = se(t);
|
|
2268
2413
|
}
|
|
2269
2414
|
return e;
|
|
2270
2415
|
}
|
|
@@ -2285,7 +2430,7 @@ class D extends xt {
|
|
|
2285
2430
|
* See the License for the specific language governing permissions and
|
|
2286
2431
|
* limitations under the License.
|
|
2287
2432
|
*/
|
|
2288
|
-
class
|
|
2433
|
+
class qt {
|
|
2289
2434
|
/**
|
|
2290
2435
|
* Constructor for generic OAuth providers.
|
|
2291
2436
|
*
|
|
@@ -2338,7 +2483,7 @@ class Vt {
|
|
|
2338
2483
|
* See the License for the specific language governing permissions and
|
|
2339
2484
|
* limitations under the License.
|
|
2340
2485
|
*/
|
|
2341
|
-
class
|
|
2486
|
+
class ae extends qt {
|
|
2342
2487
|
constructor() {
|
|
2343
2488
|
super(...arguments), this.scopes = [];
|
|
2344
2489
|
}
|
|
@@ -2373,7 +2518,7 @@ class Q extends Vt {
|
|
|
2373
2518
|
* See the License for the specific language governing permissions and
|
|
2374
2519
|
* limitations under the License.
|
|
2375
2520
|
*/
|
|
2376
|
-
class
|
|
2521
|
+
class D extends ae {
|
|
2377
2522
|
constructor() {
|
|
2378
2523
|
super(
|
|
2379
2524
|
"facebook.com"
|
|
@@ -2393,9 +2538,9 @@ class C extends Q {
|
|
|
2393
2538
|
* @param accessToken - Facebook access token.
|
|
2394
2539
|
*/
|
|
2395
2540
|
static credential(e) {
|
|
2396
|
-
return
|
|
2397
|
-
providerId:
|
|
2398
|
-
signInMethod:
|
|
2541
|
+
return j._fromParams({
|
|
2542
|
+
providerId: D.PROVIDER_ID,
|
|
2543
|
+
signInMethod: D.FACEBOOK_SIGN_IN_METHOD,
|
|
2399
2544
|
accessToken: e
|
|
2400
2545
|
});
|
|
2401
2546
|
}
|
|
@@ -2405,7 +2550,7 @@ class C extends Q {
|
|
|
2405
2550
|
* @param userCredential - The user credential.
|
|
2406
2551
|
*/
|
|
2407
2552
|
static credentialFromResult(e) {
|
|
2408
|
-
return
|
|
2553
|
+
return D.credentialFromTaggedObject(e);
|
|
2409
2554
|
}
|
|
2410
2555
|
/**
|
|
2411
2556
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2414,20 +2559,20 @@ class C extends Q {
|
|
|
2414
2559
|
* @param userCredential - The user credential.
|
|
2415
2560
|
*/
|
|
2416
2561
|
static credentialFromError(e) {
|
|
2417
|
-
return
|
|
2562
|
+
return D.credentialFromTaggedObject(e.customData || {});
|
|
2418
2563
|
}
|
|
2419
2564
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2420
2565
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
2421
2566
|
return null;
|
|
2422
2567
|
try {
|
|
2423
|
-
return
|
|
2568
|
+
return D.credential(e.oauthAccessToken);
|
|
2424
2569
|
} catch {
|
|
2425
2570
|
return null;
|
|
2426
2571
|
}
|
|
2427
2572
|
}
|
|
2428
2573
|
}
|
|
2429
|
-
|
|
2430
|
-
|
|
2574
|
+
D.FACEBOOK_SIGN_IN_METHOD = "facebook.com";
|
|
2575
|
+
D.PROVIDER_ID = "facebook.com";
|
|
2431
2576
|
/**
|
|
2432
2577
|
* @license
|
|
2433
2578
|
* Copyright 2020 Google LLC
|
|
@@ -2444,7 +2589,7 @@ C.PROVIDER_ID = "facebook.com";
|
|
|
2444
2589
|
* See the License for the specific language governing permissions and
|
|
2445
2590
|
* limitations under the License.
|
|
2446
2591
|
*/
|
|
2447
|
-
class
|
|
2592
|
+
class x extends ae {
|
|
2448
2593
|
constructor() {
|
|
2449
2594
|
super(
|
|
2450
2595
|
"google.com"
|
|
@@ -2465,9 +2610,9 @@ class O extends Q {
|
|
|
2465
2610
|
* @param accessToken - Google access token.
|
|
2466
2611
|
*/
|
|
2467
2612
|
static credential(e, t) {
|
|
2468
|
-
return
|
|
2469
|
-
providerId:
|
|
2470
|
-
signInMethod:
|
|
2613
|
+
return j._fromParams({
|
|
2614
|
+
providerId: x.PROVIDER_ID,
|
|
2615
|
+
signInMethod: x.GOOGLE_SIGN_IN_METHOD,
|
|
2471
2616
|
idToken: e,
|
|
2472
2617
|
accessToken: t
|
|
2473
2618
|
});
|
|
@@ -2478,7 +2623,7 @@ class O extends Q {
|
|
|
2478
2623
|
* @param userCredential - The user credential.
|
|
2479
2624
|
*/
|
|
2480
2625
|
static credentialFromResult(e) {
|
|
2481
|
-
return
|
|
2626
|
+
return x.credentialFromTaggedObject(e);
|
|
2482
2627
|
}
|
|
2483
2628
|
/**
|
|
2484
2629
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2487,7 +2632,7 @@ class O extends Q {
|
|
|
2487
2632
|
* @param userCredential - The user credential.
|
|
2488
2633
|
*/
|
|
2489
2634
|
static credentialFromError(e) {
|
|
2490
|
-
return
|
|
2635
|
+
return x.credentialFromTaggedObject(e.customData || {});
|
|
2491
2636
|
}
|
|
2492
2637
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2493
2638
|
if (!e)
|
|
@@ -2496,14 +2641,14 @@ class O extends Q {
|
|
|
2496
2641
|
if (!t && !i)
|
|
2497
2642
|
return null;
|
|
2498
2643
|
try {
|
|
2499
|
-
return
|
|
2644
|
+
return x.credential(t, i);
|
|
2500
2645
|
} catch {
|
|
2501
2646
|
return null;
|
|
2502
2647
|
}
|
|
2503
2648
|
}
|
|
2504
2649
|
}
|
|
2505
|
-
|
|
2506
|
-
|
|
2650
|
+
x.GOOGLE_SIGN_IN_METHOD = "google.com";
|
|
2651
|
+
x.PROVIDER_ID = "google.com";
|
|
2507
2652
|
/**
|
|
2508
2653
|
* @license
|
|
2509
2654
|
* Copyright 2020 Google LLC
|
|
@@ -2520,7 +2665,7 @@ O.PROVIDER_ID = "google.com";
|
|
|
2520
2665
|
* See the License for the specific language governing permissions and
|
|
2521
2666
|
* limitations under the License.
|
|
2522
2667
|
*/
|
|
2523
|
-
class
|
|
2668
|
+
class F extends ae {
|
|
2524
2669
|
constructor() {
|
|
2525
2670
|
super(
|
|
2526
2671
|
"github.com"
|
|
@@ -2533,9 +2678,9 @@ class N extends Q {
|
|
|
2533
2678
|
* @param accessToken - Github access token.
|
|
2534
2679
|
*/
|
|
2535
2680
|
static credential(e) {
|
|
2536
|
-
return
|
|
2537
|
-
providerId:
|
|
2538
|
-
signInMethod:
|
|
2681
|
+
return j._fromParams({
|
|
2682
|
+
providerId: F.PROVIDER_ID,
|
|
2683
|
+
signInMethod: F.GITHUB_SIGN_IN_METHOD,
|
|
2539
2684
|
accessToken: e
|
|
2540
2685
|
});
|
|
2541
2686
|
}
|
|
@@ -2545,7 +2690,7 @@ class N extends Q {
|
|
|
2545
2690
|
* @param userCredential - The user credential.
|
|
2546
2691
|
*/
|
|
2547
2692
|
static credentialFromResult(e) {
|
|
2548
|
-
return
|
|
2693
|
+
return F.credentialFromTaggedObject(e);
|
|
2549
2694
|
}
|
|
2550
2695
|
/**
|
|
2551
2696
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2554,20 +2699,20 @@ class N extends Q {
|
|
|
2554
2699
|
* @param userCredential - The user credential.
|
|
2555
2700
|
*/
|
|
2556
2701
|
static credentialFromError(e) {
|
|
2557
|
-
return
|
|
2702
|
+
return F.credentialFromTaggedObject(e.customData || {});
|
|
2558
2703
|
}
|
|
2559
2704
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2560
2705
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
2561
2706
|
return null;
|
|
2562
2707
|
try {
|
|
2563
|
-
return
|
|
2708
|
+
return F.credential(e.oauthAccessToken);
|
|
2564
2709
|
} catch {
|
|
2565
2710
|
return null;
|
|
2566
2711
|
}
|
|
2567
2712
|
}
|
|
2568
2713
|
}
|
|
2569
|
-
|
|
2570
|
-
|
|
2714
|
+
F.GITHUB_SIGN_IN_METHOD = "github.com";
|
|
2715
|
+
F.PROVIDER_ID = "github.com";
|
|
2571
2716
|
/**
|
|
2572
2717
|
* @license
|
|
2573
2718
|
* Copyright 2020 Google LLC
|
|
@@ -2584,7 +2729,7 @@ N.PROVIDER_ID = "github.com";
|
|
|
2584
2729
|
* See the License for the specific language governing permissions and
|
|
2585
2730
|
* limitations under the License.
|
|
2586
2731
|
*/
|
|
2587
|
-
class
|
|
2732
|
+
class V extends ae {
|
|
2588
2733
|
constructor() {
|
|
2589
2734
|
super(
|
|
2590
2735
|
"twitter.com"
|
|
@@ -2598,9 +2743,9 @@ class L extends Q {
|
|
|
2598
2743
|
* @param secret - Twitter secret.
|
|
2599
2744
|
*/
|
|
2600
2745
|
static credential(e, t) {
|
|
2601
|
-
return
|
|
2602
|
-
providerId:
|
|
2603
|
-
signInMethod:
|
|
2746
|
+
return j._fromParams({
|
|
2747
|
+
providerId: V.PROVIDER_ID,
|
|
2748
|
+
signInMethod: V.TWITTER_SIGN_IN_METHOD,
|
|
2604
2749
|
oauthToken: e,
|
|
2605
2750
|
oauthTokenSecret: t
|
|
2606
2751
|
});
|
|
@@ -2611,7 +2756,7 @@ class L extends Q {
|
|
|
2611
2756
|
* @param userCredential - The user credential.
|
|
2612
2757
|
*/
|
|
2613
2758
|
static credentialFromResult(e) {
|
|
2614
|
-
return
|
|
2759
|
+
return V.credentialFromTaggedObject(e);
|
|
2615
2760
|
}
|
|
2616
2761
|
/**
|
|
2617
2762
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2620,7 +2765,7 @@ class L extends Q {
|
|
|
2620
2765
|
* @param userCredential - The user credential.
|
|
2621
2766
|
*/
|
|
2622
2767
|
static credentialFromError(e) {
|
|
2623
|
-
return
|
|
2768
|
+
return V.credentialFromTaggedObject(e.customData || {});
|
|
2624
2769
|
}
|
|
2625
2770
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2626
2771
|
if (!e)
|
|
@@ -2629,14 +2774,14 @@ class L extends Q {
|
|
|
2629
2774
|
if (!t || !i)
|
|
2630
2775
|
return null;
|
|
2631
2776
|
try {
|
|
2632
|
-
return
|
|
2777
|
+
return V.credential(t, i);
|
|
2633
2778
|
} catch {
|
|
2634
2779
|
return null;
|
|
2635
2780
|
}
|
|
2636
2781
|
}
|
|
2637
2782
|
}
|
|
2638
|
-
|
|
2639
|
-
|
|
2783
|
+
V.TWITTER_SIGN_IN_METHOD = "twitter.com";
|
|
2784
|
+
V.PROVIDER_ID = "twitter.com";
|
|
2640
2785
|
/**
|
|
2641
2786
|
* @license
|
|
2642
2787
|
* Copyright 2020 Google LLC
|
|
@@ -2653,13 +2798,13 @@ L.PROVIDER_ID = "twitter.com";
|
|
|
2653
2798
|
* See the License for the specific language governing permissions and
|
|
2654
2799
|
* limitations under the License.
|
|
2655
2800
|
*/
|
|
2656
|
-
class
|
|
2801
|
+
class W {
|
|
2657
2802
|
constructor(e) {
|
|
2658
2803
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2659
2804
|
}
|
|
2660
2805
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2661
|
-
const s = await
|
|
2662
|
-
return new
|
|
2806
|
+
const s = await C._fromIdTokenResponse(e, i, r), o = lt(i);
|
|
2807
|
+
return new W({
|
|
2663
2808
|
user: s,
|
|
2664
2809
|
providerId: o,
|
|
2665
2810
|
_tokenResponse: i,
|
|
@@ -2672,8 +2817,8 @@ class F {
|
|
|
2672
2817
|
/* reload */
|
|
2673
2818
|
!0
|
|
2674
2819
|
);
|
|
2675
|
-
const r =
|
|
2676
|
-
return new
|
|
2820
|
+
const r = lt(i);
|
|
2821
|
+
return new W({
|
|
2677
2822
|
user: e,
|
|
2678
2823
|
providerId: r,
|
|
2679
2824
|
_tokenResponse: i,
|
|
@@ -2681,7 +2826,7 @@ class F {
|
|
|
2681
2826
|
});
|
|
2682
2827
|
}
|
|
2683
2828
|
}
|
|
2684
|
-
function
|
|
2829
|
+
function lt(n) {
|
|
2685
2830
|
return n.providerId ? n.providerId : "phoneNumber" in n ? "phone" : null;
|
|
2686
2831
|
}
|
|
2687
2832
|
/**
|
|
@@ -2700,10 +2845,10 @@ function nt(n) {
|
|
|
2700
2845
|
* See the License for the specific language governing permissions and
|
|
2701
2846
|
* limitations under the License.
|
|
2702
2847
|
*/
|
|
2703
|
-
class
|
|
2848
|
+
class ve extends Ve {
|
|
2704
2849
|
constructor(e, t, i, r) {
|
|
2705
2850
|
var s;
|
|
2706
|
-
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this,
|
|
2851
|
+
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this, ve.prototype), this.customData = {
|
|
2707
2852
|
appName: e.name,
|
|
2708
2853
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
|
2709
2854
|
_serverResponse: t.customData._serverResponse,
|
|
@@ -2711,17 +2856,17 @@ class ue extends Oe {
|
|
|
2711
2856
|
};
|
|
2712
2857
|
}
|
|
2713
2858
|
static _fromErrorAndOperation(e, t, i, r) {
|
|
2714
|
-
return new
|
|
2859
|
+
return new ve(e, t, i, r);
|
|
2715
2860
|
}
|
|
2716
2861
|
}
|
|
2717
|
-
function
|
|
2862
|
+
function Kt(n, e, t, i) {
|
|
2718
2863
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2719
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
|
2864
|
+
throw s.code === "auth/multi-factor-auth-required" ? ve._fromErrorAndOperation(n, s, e, i) : s;
|
|
2720
2865
|
});
|
|
2721
2866
|
}
|
|
2722
|
-
async function
|
|
2723
|
-
const i = await
|
|
2724
|
-
return
|
|
2867
|
+
async function Fi(n, e, t = !1) {
|
|
2868
|
+
const i = await ie(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2869
|
+
return W._forOperation(n, "link", i);
|
|
2725
2870
|
}
|
|
2726
2871
|
/**
|
|
2727
2872
|
* @license
|
|
@@ -2739,20 +2884,20 @@ async function mi(n, e, t = !1) {
|
|
|
2739
2884
|
* See the License for the specific language governing permissions and
|
|
2740
2885
|
* limitations under the License.
|
|
2741
2886
|
*/
|
|
2742
|
-
async function
|
|
2887
|
+
async function Vi(n, e, t = !1) {
|
|
2743
2888
|
const { auth: i } = n;
|
|
2744
|
-
if (
|
|
2745
|
-
return Promise.reject(
|
|
2889
|
+
if (A(i.app))
|
|
2890
|
+
return Promise.reject($(i));
|
|
2746
2891
|
const r = "reauthenticate";
|
|
2747
2892
|
try {
|
|
2748
|
-
const s = await
|
|
2893
|
+
const s = await ie(n, Kt(i, r, e, n), t);
|
|
2749
2894
|
u(
|
|
2750
2895
|
s.idToken,
|
|
2751
2896
|
i,
|
|
2752
2897
|
"internal-error"
|
|
2753
2898
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
2754
2899
|
);
|
|
2755
|
-
const o =
|
|
2900
|
+
const o = We(s.idToken);
|
|
2756
2901
|
u(
|
|
2757
2902
|
o,
|
|
2758
2903
|
i,
|
|
@@ -2765,9 +2910,9 @@ async function gi(n, e, t = !1) {
|
|
|
2765
2910
|
i,
|
|
2766
2911
|
"user-mismatch"
|
|
2767
2912
|
/* AuthErrorCode.USER_MISMATCH */
|
|
2768
|
-
),
|
|
2913
|
+
), W._forOperation(n, r, s);
|
|
2769
2914
|
} catch (s) {
|
|
2770
|
-
throw (s == null ? void 0 : s.code) === "auth/user-not-found" &&
|
|
2915
|
+
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && O(
|
|
2771
2916
|
i,
|
|
2772
2917
|
"user-mismatch"
|
|
2773
2918
|
/* AuthErrorCode.USER_MISMATCH */
|
|
@@ -2790,10 +2935,10 @@ async function gi(n, e, t = !1) {
|
|
|
2790
2935
|
* See the License for the specific language governing permissions and
|
|
2791
2936
|
* limitations under the License.
|
|
2792
2937
|
*/
|
|
2793
|
-
async function
|
|
2794
|
-
if (
|
|
2795
|
-
return Promise.reject(
|
|
2796
|
-
const i = "signIn", r = await
|
|
2938
|
+
async function $i(n, e, t = !1) {
|
|
2939
|
+
if (A(n.app))
|
|
2940
|
+
return Promise.reject($(n));
|
|
2941
|
+
const i = "signIn", r = await Kt(n, i, e), s = await W._fromIdTokenResponse(n, i, r);
|
|
2797
2942
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2798
2943
|
}
|
|
2799
2944
|
/**
|
|
@@ -2812,8 +2957,8 @@ async function _i(n, e, t = !1) {
|
|
|
2812
2957
|
* See the License for the specific language governing permissions and
|
|
2813
2958
|
* limitations under the License.
|
|
2814
2959
|
*/
|
|
2815
|
-
async function
|
|
2816
|
-
return
|
|
2960
|
+
async function Hi(n, e) {
|
|
2961
|
+
return Ot(n, "POST", "/v1/accounts:signInWithCustomToken", we(n, e));
|
|
2817
2962
|
}
|
|
2818
2963
|
/**
|
|
2819
2964
|
* @license
|
|
@@ -2831,22 +2976,22 @@ async function vi(n, e) {
|
|
|
2831
2976
|
* See the License for the specific language governing permissions and
|
|
2832
2977
|
* limitations under the License.
|
|
2833
2978
|
*/
|
|
2834
|
-
async function
|
|
2835
|
-
if (
|
|
2836
|
-
return Promise.reject(
|
|
2837
|
-
const t =
|
|
2979
|
+
async function ji(n, e) {
|
|
2980
|
+
if (A(n.app))
|
|
2981
|
+
return Promise.reject($(n));
|
|
2982
|
+
const t = ke(n), i = await Hi(t, {
|
|
2838
2983
|
token: e,
|
|
2839
2984
|
returnSecureToken: !0
|
|
2840
|
-
}), r = await
|
|
2985
|
+
}), r = await W._fromIdTokenResponse(t, "signIn", i);
|
|
2841
2986
|
return await t._updateCurrentUser(r.user), r;
|
|
2842
2987
|
}
|
|
2843
|
-
function
|
|
2844
|
-
return
|
|
2988
|
+
function Wi(n, e, t, i) {
|
|
2989
|
+
return K(n).onIdTokenChanged(e, t, i);
|
|
2845
2990
|
}
|
|
2846
|
-
function
|
|
2847
|
-
return
|
|
2991
|
+
function Bi(n, e, t) {
|
|
2992
|
+
return K(n).beforeAuthStateChanged(e, t);
|
|
2848
2993
|
}
|
|
2849
|
-
const
|
|
2994
|
+
const Ie = "__sak";
|
|
2850
2995
|
/**
|
|
2851
2996
|
* @license
|
|
2852
2997
|
* Copyright 2019 Google LLC
|
|
@@ -2863,13 +3008,13 @@ const de = "__sak";
|
|
|
2863
3008
|
* See the License for the specific language governing permissions and
|
|
2864
3009
|
* limitations under the License.
|
|
2865
3010
|
*/
|
|
2866
|
-
class
|
|
3011
|
+
class Jt {
|
|
2867
3012
|
constructor(e, t) {
|
|
2868
3013
|
this.storageRetriever = e, this.type = t;
|
|
2869
3014
|
}
|
|
2870
3015
|
_isAvailable() {
|
|
2871
3016
|
try {
|
|
2872
|
-
return this.storage ? (this.storage.setItem(
|
|
3017
|
+
return this.storage ? (this.storage.setItem(Ie, "1"), this.storage.removeItem(Ie), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
2873
3018
|
} catch {
|
|
2874
3019
|
return Promise.resolve(!1);
|
|
2875
3020
|
}
|
|
@@ -2904,18 +3049,18 @@ class Ht {
|
|
|
2904
3049
|
* See the License for the specific language governing permissions and
|
|
2905
3050
|
* limitations under the License.
|
|
2906
3051
|
*/
|
|
2907
|
-
function
|
|
2908
|
-
const n =
|
|
2909
|
-
return
|
|
3052
|
+
function Gi() {
|
|
3053
|
+
const n = y();
|
|
3054
|
+
return Be(n) || Te(n);
|
|
2910
3055
|
}
|
|
2911
|
-
const
|
|
2912
|
-
class
|
|
3056
|
+
const zi = 1e3, qi = 10;
|
|
3057
|
+
class Yt extends Jt {
|
|
2913
3058
|
constructor() {
|
|
2914
3059
|
super(
|
|
2915
3060
|
() => window.localStorage,
|
|
2916
3061
|
"LOCAL"
|
|
2917
3062
|
/* PersistenceType.LOCAL */
|
|
2918
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
|
3063
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = Gi() && Ti(), this.fallbackToPolling = Wt(), this._shouldAllowMigration = !0;
|
|
2919
3064
|
}
|
|
2920
3065
|
forAllChangedKeys(e) {
|
|
2921
3066
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -2942,7 +3087,7 @@ class jt extends Ht {
|
|
|
2942
3087
|
const o = this.storage.getItem(i);
|
|
2943
3088
|
!t && this.localCache[i] === o || this.notifyListeners(i, o);
|
|
2944
3089
|
}, s = this.storage.getItem(i);
|
|
2945
|
-
|
|
3090
|
+
wi() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(r, qi) : r();
|
|
2946
3091
|
}
|
|
2947
3092
|
notifyListeners(e, t) {
|
|
2948
3093
|
this.localCache[e] = t;
|
|
@@ -2964,7 +3109,7 @@ class jt extends Ht {
|
|
|
2964
3109
|
!0
|
|
2965
3110
|
);
|
|
2966
3111
|
});
|
|
2967
|
-
},
|
|
3112
|
+
}, zi);
|
|
2968
3113
|
}
|
|
2969
3114
|
stopPolling() {
|
|
2970
3115
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -2993,8 +3138,8 @@ class jt extends Ht {
|
|
|
2993
3138
|
await super._remove(e), delete this.localCache[e];
|
|
2994
3139
|
}
|
|
2995
3140
|
}
|
|
2996
|
-
|
|
2997
|
-
const
|
|
3141
|
+
Yt.type = "LOCAL";
|
|
3142
|
+
const Ki = Yt;
|
|
2998
3143
|
/**
|
|
2999
3144
|
* @license
|
|
3000
3145
|
* Copyright 2020 Google LLC
|
|
@@ -3011,7 +3156,7 @@ const bi = jt;
|
|
|
3011
3156
|
* See the License for the specific language governing permissions and
|
|
3012
3157
|
* limitations under the License.
|
|
3013
3158
|
*/
|
|
3014
|
-
class
|
|
3159
|
+
class Xt extends Jt {
|
|
3015
3160
|
constructor() {
|
|
3016
3161
|
super(
|
|
3017
3162
|
() => window.sessionStorage,
|
|
@@ -3024,8 +3169,8 @@ class Wt extends Ht {
|
|
|
3024
3169
|
_removeListener(e, t) {
|
|
3025
3170
|
}
|
|
3026
3171
|
}
|
|
3027
|
-
|
|
3028
|
-
const
|
|
3172
|
+
Xt.type = "SESSION";
|
|
3173
|
+
const Qt = Xt;
|
|
3029
3174
|
/**
|
|
3030
3175
|
* @license
|
|
3031
3176
|
* Copyright 2019 Google LLC
|
|
@@ -3042,7 +3187,7 @@ const Bt = Wt;
|
|
|
3042
3187
|
* See the License for the specific language governing permissions and
|
|
3043
3188
|
* limitations under the License.
|
|
3044
3189
|
*/
|
|
3045
|
-
function
|
|
3190
|
+
function Ji(n) {
|
|
3046
3191
|
return Promise.all(n.map(async (e) => {
|
|
3047
3192
|
try {
|
|
3048
3193
|
return {
|
|
@@ -3073,7 +3218,7 @@ function Si(n) {
|
|
|
3073
3218
|
* See the License for the specific language governing permissions and
|
|
3074
3219
|
* limitations under the License.
|
|
3075
3220
|
*/
|
|
3076
|
-
class
|
|
3221
|
+
class Ee {
|
|
3077
3222
|
constructor(e) {
|
|
3078
3223
|
this.eventTarget = e, this.handlersMap = {}, this.boundEventHandler = this.handleEvent.bind(this);
|
|
3079
3224
|
}
|
|
@@ -3087,7 +3232,7 @@ class ge {
|
|
|
3087
3232
|
const t = this.receivers.find((r) => r.isListeningto(e));
|
|
3088
3233
|
if (t)
|
|
3089
3234
|
return t;
|
|
3090
|
-
const i = new
|
|
3235
|
+
const i = new Ee(e);
|
|
3091
3236
|
return this.receivers.push(i), i;
|
|
3092
3237
|
}
|
|
3093
3238
|
isListeningto(e) {
|
|
@@ -3112,7 +3257,7 @@ class ge {
|
|
|
3112
3257
|
eventId: i,
|
|
3113
3258
|
eventType: r
|
|
3114
3259
|
});
|
|
3115
|
-
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await
|
|
3260
|
+
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await Ji(c);
|
|
3116
3261
|
t.ports[0].postMessage({
|
|
3117
3262
|
status: "done",
|
|
3118
3263
|
eventId: i,
|
|
@@ -3141,7 +3286,7 @@ class ge {
|
|
|
3141
3286
|
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);
|
|
3142
3287
|
}
|
|
3143
3288
|
}
|
|
3144
|
-
|
|
3289
|
+
Ee.receivers = [];
|
|
3145
3290
|
/**
|
|
3146
3291
|
* @license
|
|
3147
3292
|
* Copyright 2020 Google LLC
|
|
@@ -3158,7 +3303,7 @@ ge.receivers = [];
|
|
|
3158
3303
|
* See the License for the specific language governing permissions and
|
|
3159
3304
|
* limitations under the License.
|
|
3160
3305
|
*/
|
|
3161
|
-
function
|
|
3306
|
+
function ze(n = "", e = 10) {
|
|
3162
3307
|
let t = "";
|
|
3163
3308
|
for (let i = 0; i < e; i++)
|
|
3164
3309
|
t += Math.floor(Math.random() * 10);
|
|
@@ -3180,7 +3325,7 @@ function xe(n = "", e = 10) {
|
|
|
3180
3325
|
* See the License for the specific language governing permissions and
|
|
3181
3326
|
* limitations under the License.
|
|
3182
3327
|
*/
|
|
3183
|
-
class
|
|
3328
|
+
class Yi {
|
|
3184
3329
|
constructor(e) {
|
|
3185
3330
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
3186
3331
|
}
|
|
@@ -3214,7 +3359,7 @@ class Ri {
|
|
|
3214
3359
|
);
|
|
3215
3360
|
let s, o;
|
|
3216
3361
|
return new Promise((c, a) => {
|
|
3217
|
-
const l =
|
|
3362
|
+
const l = ze("", 20);
|
|
3218
3363
|
r.port1.start();
|
|
3219
3364
|
const d = setTimeout(() => {
|
|
3220
3365
|
a(new Error(
|
|
@@ -3225,9 +3370,9 @@ class Ri {
|
|
|
3225
3370
|
o = {
|
|
3226
3371
|
messageChannel: r,
|
|
3227
3372
|
onMessage(h) {
|
|
3228
|
-
const
|
|
3229
|
-
if (
|
|
3230
|
-
switch (
|
|
3373
|
+
const m = h;
|
|
3374
|
+
if (m.data.eventId === l)
|
|
3375
|
+
switch (m.data.status) {
|
|
3231
3376
|
case "ack":
|
|
3232
3377
|
clearTimeout(d), s = setTimeout(
|
|
3233
3378
|
() => {
|
|
@@ -3241,7 +3386,7 @@ class Ri {
|
|
|
3241
3386
|
);
|
|
3242
3387
|
break;
|
|
3243
3388
|
case "done":
|
|
3244
|
-
clearTimeout(s), c(
|
|
3389
|
+
clearTimeout(s), c(m.data.response);
|
|
3245
3390
|
break;
|
|
3246
3391
|
default:
|
|
3247
3392
|
clearTimeout(d), clearTimeout(s), a(new Error(
|
|
@@ -3277,11 +3422,11 @@ class Ri {
|
|
|
3277
3422
|
* See the License for the specific language governing permissions and
|
|
3278
3423
|
* limitations under the License.
|
|
3279
3424
|
*/
|
|
3280
|
-
function
|
|
3425
|
+
function b() {
|
|
3281
3426
|
return window;
|
|
3282
3427
|
}
|
|
3283
|
-
function
|
|
3284
|
-
|
|
3428
|
+
function Xi(n) {
|
|
3429
|
+
b().location.href = n;
|
|
3285
3430
|
}
|
|
3286
3431
|
/**
|
|
3287
3432
|
* @license
|
|
@@ -3299,10 +3444,10 @@ function Pi(n) {
|
|
|
3299
3444
|
* See the License for the specific language governing permissions and
|
|
3300
3445
|
* limitations under the License.
|
|
3301
3446
|
*/
|
|
3302
|
-
function
|
|
3303
|
-
return typeof
|
|
3447
|
+
function Zt() {
|
|
3448
|
+
return typeof b().WorkerGlobalScope < "u" && typeof b().importScripts == "function";
|
|
3304
3449
|
}
|
|
3305
|
-
async function
|
|
3450
|
+
async function Qi() {
|
|
3306
3451
|
if (!(navigator != null && navigator.serviceWorker))
|
|
3307
3452
|
return null;
|
|
3308
3453
|
try {
|
|
@@ -3311,12 +3456,12 @@ async function Ai() {
|
|
|
3311
3456
|
return null;
|
|
3312
3457
|
}
|
|
3313
3458
|
}
|
|
3314
|
-
function
|
|
3459
|
+
function Zi() {
|
|
3315
3460
|
var n;
|
|
3316
3461
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3317
3462
|
}
|
|
3318
|
-
function
|
|
3319
|
-
return
|
|
3463
|
+
function er() {
|
|
3464
|
+
return Zt() ? self : null;
|
|
3320
3465
|
}
|
|
3321
3466
|
/**
|
|
3322
3467
|
* @license
|
|
@@ -3334,8 +3479,8 @@ function Oi() {
|
|
|
3334
3479
|
* See the License for the specific language governing permissions and
|
|
3335
3480
|
* limitations under the License.
|
|
3336
3481
|
*/
|
|
3337
|
-
const
|
|
3338
|
-
class
|
|
3482
|
+
const en = "firebaseLocalStorageDb", tr = 1, ye = "firebaseLocalStorage", tn = "fbase_key";
|
|
3483
|
+
class ce {
|
|
3339
3484
|
constructor(e) {
|
|
3340
3485
|
this.request = e;
|
|
3341
3486
|
}
|
|
@@ -3349,55 +3494,55 @@ class Z {
|
|
|
3349
3494
|
});
|
|
3350
3495
|
}
|
|
3351
3496
|
}
|
|
3352
|
-
function
|
|
3353
|
-
return n.transaction([
|
|
3497
|
+
function be(n, e) {
|
|
3498
|
+
return n.transaction([ye], e ? "readwrite" : "readonly").objectStore(ye);
|
|
3354
3499
|
}
|
|
3355
|
-
function
|
|
3356
|
-
const n = indexedDB.deleteDatabase(
|
|
3357
|
-
return new
|
|
3500
|
+
function nr() {
|
|
3501
|
+
const n = indexedDB.deleteDatabase(en);
|
|
3502
|
+
return new ce(n).toPromise();
|
|
3358
3503
|
}
|
|
3359
|
-
function
|
|
3360
|
-
const n = indexedDB.open(
|
|
3504
|
+
function Ue() {
|
|
3505
|
+
const n = indexedDB.open(en, tr);
|
|
3361
3506
|
return new Promise((e, t) => {
|
|
3362
3507
|
n.addEventListener("error", () => {
|
|
3363
3508
|
t(n.error);
|
|
3364
3509
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3365
3510
|
const i = n.result;
|
|
3366
3511
|
try {
|
|
3367
|
-
i.createObjectStore(
|
|
3512
|
+
i.createObjectStore(ye, { keyPath: tn });
|
|
3368
3513
|
} catch (r) {
|
|
3369
3514
|
t(r);
|
|
3370
3515
|
}
|
|
3371
3516
|
}), n.addEventListener("success", async () => {
|
|
3372
3517
|
const i = n.result;
|
|
3373
|
-
i.objectStoreNames.contains(
|
|
3518
|
+
i.objectStoreNames.contains(ye) ? e(i) : (i.close(), await nr(), e(await Ue()));
|
|
3374
3519
|
});
|
|
3375
3520
|
});
|
|
3376
3521
|
}
|
|
3377
|
-
async function
|
|
3378
|
-
const i =
|
|
3379
|
-
[
|
|
3522
|
+
async function ut(n, e, t) {
|
|
3523
|
+
const i = be(n, !0).put({
|
|
3524
|
+
[tn]: e,
|
|
3380
3525
|
value: t
|
|
3381
3526
|
});
|
|
3382
|
-
return new
|
|
3527
|
+
return new ce(i).toPromise();
|
|
3383
3528
|
}
|
|
3384
|
-
async function
|
|
3385
|
-
const t =
|
|
3529
|
+
async function ir(n, e) {
|
|
3530
|
+
const t = be(n, !1).get(e), i = await new ce(t).toPromise();
|
|
3386
3531
|
return i === void 0 ? null : i.value;
|
|
3387
3532
|
}
|
|
3388
|
-
function
|
|
3389
|
-
const t =
|
|
3390
|
-
return new
|
|
3533
|
+
function dt(n, e) {
|
|
3534
|
+
const t = be(n, !0).delete(e);
|
|
3535
|
+
return new ce(t).toPromise();
|
|
3391
3536
|
}
|
|
3392
|
-
const
|
|
3393
|
-
class
|
|
3537
|
+
const rr = 800, sr = 3;
|
|
3538
|
+
class nn {
|
|
3394
3539
|
constructor() {
|
|
3395
3540
|
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(() => {
|
|
3396
3541
|
}, () => {
|
|
3397
3542
|
});
|
|
3398
3543
|
}
|
|
3399
3544
|
async _openDb() {
|
|
3400
|
-
return this.db ? this.db : (this.db = await
|
|
3545
|
+
return this.db ? this.db : (this.db = await Ue(), this.db);
|
|
3401
3546
|
}
|
|
3402
3547
|
async _withRetries(e) {
|
|
3403
3548
|
let t = 0;
|
|
@@ -3406,7 +3551,7 @@ class Kt {
|
|
|
3406
3551
|
const i = await this._openDb();
|
|
3407
3552
|
return await e(i);
|
|
3408
3553
|
} catch (i) {
|
|
3409
|
-
if (t++ >
|
|
3554
|
+
if (t++ > sr)
|
|
3410
3555
|
throw i;
|
|
3411
3556
|
this.db && (this.db.close(), this.db = void 0);
|
|
3412
3557
|
}
|
|
@@ -3416,13 +3561,13 @@ class Kt {
|
|
|
3416
3561
|
* postMessage interface to send these events to the worker ourselves.
|
|
3417
3562
|
*/
|
|
3418
3563
|
async initializeServiceWorkerMessaging() {
|
|
3419
|
-
return
|
|
3564
|
+
return Zt() ? this.initializeReceiver() : this.initializeSender();
|
|
3420
3565
|
}
|
|
3421
3566
|
/**
|
|
3422
3567
|
* As the worker we should listen to events from the main window.
|
|
3423
3568
|
*/
|
|
3424
3569
|
async initializeReceiver() {
|
|
3425
|
-
this.receiver =
|
|
3570
|
+
this.receiver = Ee._getInstance(er()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3426
3571
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3427
3572
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3428
3573
|
"keyChanged"
|
|
@@ -3438,9 +3583,9 @@ class Kt {
|
|
|
3438
3583
|
*/
|
|
3439
3584
|
async initializeSender() {
|
|
3440
3585
|
var e, t;
|
|
3441
|
-
if (this.activeServiceWorker = await
|
|
3586
|
+
if (this.activeServiceWorker = await Qi(), !this.activeServiceWorker)
|
|
3442
3587
|
return;
|
|
3443
|
-
this.sender = new
|
|
3588
|
+
this.sender = new Yi(this.activeServiceWorker);
|
|
3444
3589
|
const i = await this.sender._send(
|
|
3445
3590
|
"ping",
|
|
3446
3591
|
{},
|
|
@@ -3462,7 +3607,7 @@ class Kt {
|
|
|
3462
3607
|
* @param key - Storage key which changed.
|
|
3463
3608
|
*/
|
|
3464
3609
|
async notifyServiceWorker(e) {
|
|
3465
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
3610
|
+
if (!(!this.sender || !this.activeServiceWorker || Zi() !== this.activeServiceWorker))
|
|
3466
3611
|
try {
|
|
3467
3612
|
await this.sender._send(
|
|
3468
3613
|
"keyChanged",
|
|
@@ -3478,8 +3623,8 @@ class Kt {
|
|
|
3478
3623
|
try {
|
|
3479
3624
|
if (!indexedDB)
|
|
3480
3625
|
return !1;
|
|
3481
|
-
const e = await
|
|
3482
|
-
return await
|
|
3626
|
+
const e = await Ue();
|
|
3627
|
+
return await ut(e, Ie, "1"), await dt(e, Ie), !0;
|
|
3483
3628
|
} catch {
|
|
3484
3629
|
}
|
|
3485
3630
|
return !1;
|
|
@@ -3493,19 +3638,19 @@ class Kt {
|
|
|
3493
3638
|
}
|
|
3494
3639
|
}
|
|
3495
3640
|
async _set(e, t) {
|
|
3496
|
-
return this._withPendingWrite(async () => (await this._withRetries((i) =>
|
|
3641
|
+
return this._withPendingWrite(async () => (await this._withRetries((i) => ut(i, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
3497
3642
|
}
|
|
3498
3643
|
async _get(e) {
|
|
3499
|
-
const t = await this._withRetries((i) =>
|
|
3644
|
+
const t = await this._withRetries((i) => ir(i, e));
|
|
3500
3645
|
return this.localCache[e] = t, t;
|
|
3501
3646
|
}
|
|
3502
3647
|
async _remove(e) {
|
|
3503
|
-
return this._withPendingWrite(async () => (await this._withRetries((t) =>
|
|
3648
|
+
return this._withPendingWrite(async () => (await this._withRetries((t) => dt(t, e)), delete this.localCache[e], this.notifyServiceWorker(e)));
|
|
3504
3649
|
}
|
|
3505
3650
|
async _poll() {
|
|
3506
3651
|
const e = await this._withRetries((r) => {
|
|
3507
|
-
const s =
|
|
3508
|
-
return new
|
|
3652
|
+
const s = be(r, !1).getAll();
|
|
3653
|
+
return new ce(s).toPromise();
|
|
3509
3654
|
});
|
|
3510
3655
|
if (!e)
|
|
3511
3656
|
return [];
|
|
@@ -3527,7 +3672,7 @@ class Kt {
|
|
|
3527
3672
|
r(t);
|
|
3528
3673
|
}
|
|
3529
3674
|
startPolling() {
|
|
3530
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
3675
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), rr);
|
|
3531
3676
|
}
|
|
3532
3677
|
stopPolling() {
|
|
3533
3678
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3539,9 +3684,9 @@ class Kt {
|
|
|
3539
3684
|
this.listeners[e] && (this.listeners[e].delete(t), this.listeners[e].size === 0 && delete this.listeners[e]), Object.keys(this.listeners).length === 0 && this.stopPolling();
|
|
3540
3685
|
}
|
|
3541
3686
|
}
|
|
3542
|
-
|
|
3543
|
-
const
|
|
3544
|
-
new
|
|
3687
|
+
nn.type = "LOCAL";
|
|
3688
|
+
const or = nn;
|
|
3689
|
+
new oe(3e4, 6e4);
|
|
3545
3690
|
/**
|
|
3546
3691
|
* @license
|
|
3547
3692
|
* Copyright 2021 Google LLC
|
|
@@ -3558,8 +3703,8 @@ new X(3e4, 6e4);
|
|
|
3558
3703
|
* See the License for the specific language governing permissions and
|
|
3559
3704
|
* limitations under the License.
|
|
3560
3705
|
*/
|
|
3561
|
-
function
|
|
3562
|
-
return e ?
|
|
3706
|
+
function ar(n, e) {
|
|
3707
|
+
return e ? N(e) : (u(
|
|
3563
3708
|
n._popupRedirectResolver,
|
|
3564
3709
|
n,
|
|
3565
3710
|
"argument-error"
|
|
@@ -3582,7 +3727,7 @@ function xi(n, e) {
|
|
|
3582
3727
|
* See the License for the specific language governing permissions and
|
|
3583
3728
|
* limitations under the License.
|
|
3584
3729
|
*/
|
|
3585
|
-
class
|
|
3730
|
+
class qe extends zt {
|
|
3586
3731
|
constructor(e) {
|
|
3587
3732
|
super(
|
|
3588
3733
|
"custom",
|
|
@@ -3591,13 +3736,13 @@ class Ve extends xt {
|
|
|
3591
3736
|
), this.params = e;
|
|
3592
3737
|
}
|
|
3593
3738
|
_getIdTokenResponse(e) {
|
|
3594
|
-
return
|
|
3739
|
+
return q(e, this._buildIdpRequest());
|
|
3595
3740
|
}
|
|
3596
3741
|
_linkToIdToken(e, t) {
|
|
3597
|
-
return
|
|
3742
|
+
return q(e, this._buildIdpRequest(t));
|
|
3598
3743
|
}
|
|
3599
3744
|
_getReauthenticationResolver(e) {
|
|
3600
|
-
return
|
|
3745
|
+
return q(e, this._buildIdpRequest());
|
|
3601
3746
|
}
|
|
3602
3747
|
_buildIdpRequest(e) {
|
|
3603
3748
|
const t = {
|
|
@@ -3612,26 +3757,26 @@ class Ve extends xt {
|
|
|
3612
3757
|
return e && (t.idToken = e), t;
|
|
3613
3758
|
}
|
|
3614
3759
|
}
|
|
3615
|
-
function
|
|
3616
|
-
return
|
|
3760
|
+
function cr(n) {
|
|
3761
|
+
return $i(n.auth, new qe(n), n.bypassAuthState);
|
|
3617
3762
|
}
|
|
3618
|
-
function
|
|
3763
|
+
function lr(n) {
|
|
3619
3764
|
const { auth: e, user: t } = n;
|
|
3620
3765
|
return u(
|
|
3621
3766
|
t,
|
|
3622
3767
|
e,
|
|
3623
3768
|
"internal-error"
|
|
3624
3769
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3625
|
-
),
|
|
3770
|
+
), Vi(t, new qe(n), n.bypassAuthState);
|
|
3626
3771
|
}
|
|
3627
|
-
async function
|
|
3772
|
+
async function ur(n) {
|
|
3628
3773
|
const { auth: e, user: t } = n;
|
|
3629
3774
|
return u(
|
|
3630
3775
|
t,
|
|
3631
3776
|
e,
|
|
3632
3777
|
"internal-error"
|
|
3633
3778
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3634
|
-
),
|
|
3779
|
+
), Fi(t, new qe(n), n.bypassAuthState);
|
|
3635
3780
|
}
|
|
3636
3781
|
/**
|
|
3637
3782
|
* @license
|
|
@@ -3649,7 +3794,7 @@ async function Hi(n) {
|
|
|
3649
3794
|
* See the License for the specific language governing permissions and
|
|
3650
3795
|
* limitations under the License.
|
|
3651
3796
|
*/
|
|
3652
|
-
class
|
|
3797
|
+
class rn {
|
|
3653
3798
|
constructor(e, t, i, r, s = !1) {
|
|
3654
3799
|
this.auth = e, this.resolver = i, this.user = r, this.bypassAuthState = s, this.pendingPromise = null, this.eventManager = null, this.filter = Array.isArray(t) ? t : [t];
|
|
3655
3800
|
}
|
|
@@ -3691,15 +3836,15 @@ class Jt {
|
|
|
3691
3836
|
switch (e) {
|
|
3692
3837
|
case "signInViaPopup":
|
|
3693
3838
|
case "signInViaRedirect":
|
|
3694
|
-
return
|
|
3839
|
+
return cr;
|
|
3695
3840
|
case "linkViaPopup":
|
|
3696
3841
|
case "linkViaRedirect":
|
|
3697
|
-
return
|
|
3842
|
+
return ur;
|
|
3698
3843
|
case "reauthViaPopup":
|
|
3699
3844
|
case "reauthViaRedirect":
|
|
3700
|
-
return
|
|
3845
|
+
return lr;
|
|
3701
3846
|
default:
|
|
3702
|
-
|
|
3847
|
+
O(
|
|
3703
3848
|
this.auth,
|
|
3704
3849
|
"internal-error"
|
|
3705
3850
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -3707,10 +3852,10 @@ class Jt {
|
|
|
3707
3852
|
}
|
|
3708
3853
|
}
|
|
3709
3854
|
resolve(e) {
|
|
3710
|
-
|
|
3855
|
+
L(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.resolve(e), this.unregisterAndCleanUp();
|
|
3711
3856
|
}
|
|
3712
3857
|
reject(e) {
|
|
3713
|
-
|
|
3858
|
+
L(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.reject(e), this.unregisterAndCleanUp();
|
|
3714
3859
|
}
|
|
3715
3860
|
unregisterAndCleanUp() {
|
|
3716
3861
|
this.eventManager && this.eventManager.unregisterConsumer(this), this.pendingPromise = null, this.cleanUp();
|
|
@@ -3732,10 +3877,10 @@ class Jt {
|
|
|
3732
3877
|
* See the License for the specific language governing permissions and
|
|
3733
3878
|
* limitations under the License.
|
|
3734
3879
|
*/
|
|
3735
|
-
const
|
|
3736
|
-
class
|
|
3880
|
+
const dr = new oe(2e3, 1e4);
|
|
3881
|
+
class B extends rn {
|
|
3737
3882
|
constructor(e, t, i, r, s) {
|
|
3738
|
-
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null,
|
|
3883
|
+
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, B.currentPopupAction && B.currentPopupAction.cancel(), B.currentPopupAction = this;
|
|
3739
3884
|
}
|
|
3740
3885
|
async executeNotNull() {
|
|
3741
3886
|
const e = await this.execute();
|
|
@@ -3747,8 +3892,8 @@ class V extends Jt {
|
|
|
3747
3892
|
), e;
|
|
3748
3893
|
}
|
|
3749
3894
|
async onExecution() {
|
|
3750
|
-
|
|
3751
|
-
const e =
|
|
3895
|
+
L(this.filter.length === 1, "Popup operations only handle one event");
|
|
3896
|
+
const e = ze();
|
|
3752
3897
|
this.authWindow = await this.resolver._openPopup(
|
|
3753
3898
|
this.auth,
|
|
3754
3899
|
this.provider,
|
|
@@ -3758,7 +3903,7 @@ class V extends Jt {
|
|
|
3758
3903
|
), this.authWindow.associatedEvent = e, this.resolver._originValidation(this.auth).catch((t) => {
|
|
3759
3904
|
this.reject(t);
|
|
3760
3905
|
}), this.resolver._isIframeWebStorageSupported(this.auth, (t) => {
|
|
3761
|
-
t || this.reject(
|
|
3906
|
+
t || this.reject(E(
|
|
3762
3907
|
this.auth,
|
|
3763
3908
|
"web-storage-unsupported"
|
|
3764
3909
|
/* AuthErrorCode.WEB_STORAGE_UNSUPPORTED */
|
|
@@ -3770,14 +3915,14 @@ class V extends Jt {
|
|
|
3770
3915
|
return ((e = this.authWindow) === null || e === void 0 ? void 0 : e.associatedEvent) || null;
|
|
3771
3916
|
}
|
|
3772
3917
|
cancel() {
|
|
3773
|
-
this.reject(
|
|
3918
|
+
this.reject(E(
|
|
3774
3919
|
this.auth,
|
|
3775
3920
|
"cancelled-popup-request"
|
|
3776
3921
|
/* AuthErrorCode.EXPIRED_POPUP_REQUEST */
|
|
3777
3922
|
));
|
|
3778
3923
|
}
|
|
3779
3924
|
cleanUp() {
|
|
3780
|
-
this.authWindow && this.authWindow.close(), this.pollId && window.clearTimeout(this.pollId), this.authWindow = null, this.pollId = null,
|
|
3925
|
+
this.authWindow && this.authWindow.close(), this.pollId && window.clearTimeout(this.pollId), this.authWindow = null, this.pollId = null, B.currentPopupAction = null;
|
|
3781
3926
|
}
|
|
3782
3927
|
pollUserCancellation() {
|
|
3783
3928
|
const e = () => {
|
|
@@ -3785,7 +3930,7 @@ class V extends Jt {
|
|
|
3785
3930
|
if (!((i = (t = this.authWindow) === null || t === void 0 ? void 0 : t.window) === null || i === void 0) && i.closed) {
|
|
3786
3931
|
this.pollId = window.setTimeout(
|
|
3787
3932
|
() => {
|
|
3788
|
-
this.pollId = null, this.reject(
|
|
3933
|
+
this.pollId = null, this.reject(E(
|
|
3789
3934
|
this.auth,
|
|
3790
3935
|
"popup-closed-by-user"
|
|
3791
3936
|
/* AuthErrorCode.POPUP_CLOSED_BY_USER */
|
|
@@ -3796,12 +3941,12 @@ class V extends Jt {
|
|
|
3796
3941
|
);
|
|
3797
3942
|
return;
|
|
3798
3943
|
}
|
|
3799
|
-
this.pollId = window.setTimeout(e,
|
|
3944
|
+
this.pollId = window.setTimeout(e, dr.get());
|
|
3800
3945
|
};
|
|
3801
3946
|
e();
|
|
3802
3947
|
}
|
|
3803
3948
|
}
|
|
3804
|
-
|
|
3949
|
+
B.currentPopupAction = null;
|
|
3805
3950
|
/**
|
|
3806
3951
|
* @license
|
|
3807
3952
|
* Copyright 2020 Google LLC
|
|
@@ -3818,8 +3963,8 @@ V.currentPopupAction = null;
|
|
|
3818
3963
|
* See the License for the specific language governing permissions and
|
|
3819
3964
|
* limitations under the License.
|
|
3820
3965
|
*/
|
|
3821
|
-
const
|
|
3822
|
-
class
|
|
3966
|
+
const hr = "pendingRedirect", he = /* @__PURE__ */ new Map();
|
|
3967
|
+
class fr extends rn {
|
|
3823
3968
|
constructor(e, t, i = !1) {
|
|
3824
3969
|
super(e, [
|
|
3825
3970
|
"signInViaRedirect",
|
|
@@ -3834,17 +3979,17 @@ class Bi extends Jt {
|
|
|
3834
3979
|
* just return it.
|
|
3835
3980
|
*/
|
|
3836
3981
|
async execute() {
|
|
3837
|
-
let e =
|
|
3982
|
+
let e = he.get(this.auth._key());
|
|
3838
3983
|
if (!e) {
|
|
3839
3984
|
try {
|
|
3840
|
-
const i = await
|
|
3985
|
+
const i = await pr(this.resolver, this.auth) ? await super.execute() : null;
|
|
3841
3986
|
e = () => Promise.resolve(i);
|
|
3842
3987
|
} catch (t) {
|
|
3843
3988
|
e = () => Promise.reject(t);
|
|
3844
3989
|
}
|
|
3845
|
-
|
|
3990
|
+
he.set(this.auth._key(), e);
|
|
3846
3991
|
}
|
|
3847
|
-
return this.bypassAuthState ||
|
|
3992
|
+
return this.bypassAuthState || he.set(this.auth._key(), () => Promise.resolve(null)), e();
|
|
3848
3993
|
}
|
|
3849
3994
|
async onAuthEvent(e) {
|
|
3850
3995
|
if (e.type === "signInViaRedirect")
|
|
@@ -3865,26 +4010,26 @@ class Bi extends Jt {
|
|
|
3865
4010
|
cleanUp() {
|
|
3866
4011
|
}
|
|
3867
4012
|
}
|
|
3868
|
-
async function
|
|
3869
|
-
const t =
|
|
4013
|
+
async function pr(n, e) {
|
|
4014
|
+
const t = _r(e), i = gr(n);
|
|
3870
4015
|
if (!await i._isAvailable())
|
|
3871
4016
|
return !1;
|
|
3872
4017
|
const r = await i._get(t) === "true";
|
|
3873
4018
|
return await i._remove(t), r;
|
|
3874
4019
|
}
|
|
3875
|
-
function
|
|
3876
|
-
|
|
4020
|
+
function mr(n, e) {
|
|
4021
|
+
he.set(n._key(), e);
|
|
3877
4022
|
}
|
|
3878
|
-
function
|
|
3879
|
-
return
|
|
4023
|
+
function gr(n) {
|
|
4024
|
+
return N(n._redirectPersistence);
|
|
3880
4025
|
}
|
|
3881
|
-
function
|
|
3882
|
-
return
|
|
4026
|
+
function _r(n) {
|
|
4027
|
+
return de(hr, n.config.apiKey, n.name);
|
|
3883
4028
|
}
|
|
3884
|
-
async function
|
|
3885
|
-
if (
|
|
3886
|
-
return Promise.reject(
|
|
3887
|
-
const i =
|
|
4029
|
+
async function vr(n, e, t = !1) {
|
|
4030
|
+
if (A(n.app))
|
|
4031
|
+
return Promise.reject($(n));
|
|
4032
|
+
const i = ke(n), r = ar(i, e), o = await new fr(i, r, t).execute();
|
|
3888
4033
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
3889
4034
|
}
|
|
3890
4035
|
/**
|
|
@@ -3903,8 +4048,8 @@ async function Ji(n, e, t = !1) {
|
|
|
3903
4048
|
* See the License for the specific language governing permissions and
|
|
3904
4049
|
* limitations under the License.
|
|
3905
4050
|
*/
|
|
3906
|
-
const
|
|
3907
|
-
class
|
|
4051
|
+
const Ir = 10 * 60 * 1e3;
|
|
4052
|
+
class yr {
|
|
3908
4053
|
constructor(e) {
|
|
3909
4054
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
3910
4055
|
}
|
|
@@ -3920,13 +4065,13 @@ class Xi {
|
|
|
3920
4065
|
let t = !1;
|
|
3921
4066
|
return this.consumers.forEach((i) => {
|
|
3922
4067
|
this.isEventForConsumer(e, i) && (t = !0, this.sendToConsumer(e, i), this.saveEventToCache(e));
|
|
3923
|
-
}), this.hasHandledPotentialRedirect || !
|
|
4068
|
+
}), this.hasHandledPotentialRedirect || !wr(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
3924
4069
|
}
|
|
3925
4070
|
sendToConsumer(e, t) {
|
|
3926
4071
|
var i;
|
|
3927
|
-
if (e.error && !
|
|
4072
|
+
if (e.error && !sn(e)) {
|
|
3928
4073
|
const r = ((i = e.error.code) === null || i === void 0 ? void 0 : i.split("auth/")[1]) || "internal-error";
|
|
3929
|
-
t.onError(
|
|
4074
|
+
t.onError(E(this.auth, r));
|
|
3930
4075
|
} else
|
|
3931
4076
|
t.onAuthEvent(e);
|
|
3932
4077
|
}
|
|
@@ -3935,26 +4080,26 @@ class Xi {
|
|
|
3935
4080
|
return t.filter.includes(e.type) && i;
|
|
3936
4081
|
}
|
|
3937
4082
|
hasEventBeenHandled(e) {
|
|
3938
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
4083
|
+
return Date.now() - this.lastProcessedEventTime >= Ir && this.cachedEventUids.clear(), this.cachedEventUids.has(ht(e));
|
|
3939
4084
|
}
|
|
3940
4085
|
saveEventToCache(e) {
|
|
3941
|
-
this.cachedEventUids.add(
|
|
4086
|
+
this.cachedEventUids.add(ht(e)), this.lastProcessedEventTime = Date.now();
|
|
3942
4087
|
}
|
|
3943
4088
|
}
|
|
3944
|
-
function
|
|
4089
|
+
function ht(n) {
|
|
3945
4090
|
return [n.type, n.eventId, n.sessionId, n.tenantId].filter((e) => e).join("-");
|
|
3946
4091
|
}
|
|
3947
|
-
function
|
|
4092
|
+
function sn({ type: n, error: e }) {
|
|
3948
4093
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
3949
4094
|
}
|
|
3950
|
-
function
|
|
4095
|
+
function wr(n) {
|
|
3951
4096
|
switch (n.type) {
|
|
3952
4097
|
case "signInViaRedirect":
|
|
3953
4098
|
case "linkViaRedirect":
|
|
3954
4099
|
case "reauthViaRedirect":
|
|
3955
4100
|
return !0;
|
|
3956
4101
|
case "unknown":
|
|
3957
|
-
return
|
|
4102
|
+
return sn(n);
|
|
3958
4103
|
default:
|
|
3959
4104
|
return !1;
|
|
3960
4105
|
}
|
|
@@ -3975,8 +4120,8 @@ function Qi(n) {
|
|
|
3975
4120
|
* See the License for the specific language governing permissions and
|
|
3976
4121
|
* limitations under the License.
|
|
3977
4122
|
*/
|
|
3978
|
-
async function
|
|
3979
|
-
return
|
|
4123
|
+
async function Tr(n, e = {}) {
|
|
4124
|
+
return J(n, "GET", "/v1/projects", e);
|
|
3980
4125
|
}
|
|
3981
4126
|
/**
|
|
3982
4127
|
* @license
|
|
@@ -3994,32 +4139,32 @@ async function Zi(n, e = {}) {
|
|
|
3994
4139
|
* See the License for the specific language governing permissions and
|
|
3995
4140
|
* limitations under the License.
|
|
3996
4141
|
*/
|
|
3997
|
-
const
|
|
3998
|
-
async function
|
|
4142
|
+
const kr = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Er = /^https?/;
|
|
4143
|
+
async function br(n) {
|
|
3999
4144
|
if (n.config.emulator)
|
|
4000
4145
|
return;
|
|
4001
|
-
const { authorizedDomains: e } = await
|
|
4146
|
+
const { authorizedDomains: e } = await Tr(n);
|
|
4002
4147
|
for (const t of e)
|
|
4003
4148
|
try {
|
|
4004
|
-
if (
|
|
4149
|
+
if (Sr(t))
|
|
4005
4150
|
return;
|
|
4006
4151
|
} catch {
|
|
4007
4152
|
}
|
|
4008
|
-
|
|
4153
|
+
O(
|
|
4009
4154
|
n,
|
|
4010
4155
|
"unauthorized-domain"
|
|
4011
4156
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
4012
4157
|
);
|
|
4013
4158
|
}
|
|
4014
|
-
function
|
|
4015
|
-
const e =
|
|
4159
|
+
function Sr(n) {
|
|
4160
|
+
const e = Le(), { protocol: t, hostname: i } = new URL(e);
|
|
4016
4161
|
if (n.startsWith("chrome-extension://")) {
|
|
4017
4162
|
const o = new URL(n);
|
|
4018
4163
|
return o.hostname === "" && i === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === i;
|
|
4019
4164
|
}
|
|
4020
|
-
if (!
|
|
4165
|
+
if (!Er.test(t))
|
|
4021
4166
|
return !1;
|
|
4022
|
-
if (
|
|
4167
|
+
if (kr.test(n))
|
|
4023
4168
|
return i === n;
|
|
4024
4169
|
const r = n.replace(/\./g, "\\.");
|
|
4025
4170
|
return new RegExp("^(.+\\." + r + "|" + r + ")$", "i").test(i);
|
|
@@ -4040,9 +4185,9 @@ function ir(n) {
|
|
|
4040
4185
|
* See the License for the specific language governing permissions and
|
|
4041
4186
|
* limitations under the License.
|
|
4042
4187
|
*/
|
|
4043
|
-
const
|
|
4044
|
-
function
|
|
4045
|
-
const n =
|
|
4188
|
+
const Rr = new oe(3e4, 6e4);
|
|
4189
|
+
function ft() {
|
|
4190
|
+
const n = b().___jsl;
|
|
4046
4191
|
if (n != null && n.H) {
|
|
4047
4192
|
for (const e of Object.keys(n.H))
|
|
4048
4193
|
if (n.H[e].r = n.H[e].r || [], n.H[e].L = n.H[e].L || [], n.H[e].r = [...n.H[e].L], n.CP)
|
|
@@ -4050,45 +4195,45 @@ function ot() {
|
|
|
4050
4195
|
n.CP[t] = null;
|
|
4051
4196
|
}
|
|
4052
4197
|
}
|
|
4053
|
-
function
|
|
4198
|
+
function Ar(n) {
|
|
4054
4199
|
return new Promise((e, t) => {
|
|
4055
4200
|
var i, r, s;
|
|
4056
4201
|
function o() {
|
|
4057
|
-
|
|
4202
|
+
ft(), gapi.load("gapi.iframes", {
|
|
4058
4203
|
callback: () => {
|
|
4059
4204
|
e(gapi.iframes.getContext());
|
|
4060
4205
|
},
|
|
4061
4206
|
ontimeout: () => {
|
|
4062
|
-
|
|
4207
|
+
ft(), t(E(
|
|
4063
4208
|
n,
|
|
4064
4209
|
"network-request-failed"
|
|
4065
4210
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4066
4211
|
));
|
|
4067
4212
|
},
|
|
4068
|
-
timeout:
|
|
4213
|
+
timeout: Rr.get()
|
|
4069
4214
|
});
|
|
4070
4215
|
}
|
|
4071
|
-
if (!((r = (i =
|
|
4216
|
+
if (!((r = (i = b().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
4072
4217
|
e(gapi.iframes.getContext());
|
|
4073
|
-
else if (!((s =
|
|
4218
|
+
else if (!((s = b().gapi) === null || s === void 0) && s.load)
|
|
4074
4219
|
o();
|
|
4075
4220
|
else {
|
|
4076
|
-
const c =
|
|
4077
|
-
return
|
|
4078
|
-
gapi.load ? o() : t(
|
|
4221
|
+
const c = Ni("iframefcb");
|
|
4222
|
+
return b()[c] = () => {
|
|
4223
|
+
gapi.load ? o() : t(E(
|
|
4079
4224
|
n,
|
|
4080
4225
|
"network-request-failed"
|
|
4081
4226
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4082
4227
|
));
|
|
4083
|
-
},
|
|
4228
|
+
}, Pi(`${Ci()}?onload=${c}`).catch((a) => t(a));
|
|
4084
4229
|
}
|
|
4085
4230
|
}).catch((e) => {
|
|
4086
|
-
throw
|
|
4231
|
+
throw fe = null, e;
|
|
4087
4232
|
});
|
|
4088
4233
|
}
|
|
4089
|
-
let
|
|
4090
|
-
function
|
|
4091
|
-
return
|
|
4234
|
+
let fe = null;
|
|
4235
|
+
function Pr(n) {
|
|
4236
|
+
return fe = fe || Ar(n), fe;
|
|
4092
4237
|
}
|
|
4093
4238
|
/**
|
|
4094
4239
|
* @license
|
|
@@ -4106,7 +4251,7 @@ function or(n) {
|
|
|
4106
4251
|
* See the License for the specific language governing permissions and
|
|
4107
4252
|
* limitations under the License.
|
|
4108
4253
|
*/
|
|
4109
|
-
const
|
|
4254
|
+
const Cr = new oe(5e3, 15e3), Nr = "__/auth/iframe", Or = "emulator/auth/iframe", Lr = {
|
|
4110
4255
|
style: {
|
|
4111
4256
|
position: "absolute",
|
|
4112
4257
|
top: "-100px",
|
|
@@ -4115,13 +4260,13 @@ const ar = new X(5e3, 15e3), cr = "__/auth/iframe", lr = "emulator/auth/iframe",
|
|
|
4115
4260
|
},
|
|
4116
4261
|
"aria-hidden": "true",
|
|
4117
4262
|
tabindex: "-1"
|
|
4118
|
-
},
|
|
4263
|
+
}, Mr = /* @__PURE__ */ new Map([
|
|
4119
4264
|
["identitytoolkit.googleapis.com", "p"],
|
|
4120
4265
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
4121
4266
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
4122
4267
|
// test
|
|
4123
4268
|
]);
|
|
4124
|
-
function
|
|
4269
|
+
function Ur(n) {
|
|
4125
4270
|
const e = n.config;
|
|
4126
4271
|
u(
|
|
4127
4272
|
e.authDomain,
|
|
@@ -4129,17 +4274,17 @@ function hr(n) {
|
|
|
4129
4274
|
"auth-domain-config-required"
|
|
4130
4275
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
4131
4276
|
);
|
|
4132
|
-
const t = e.emulator ?
|
|
4277
|
+
const t = e.emulator ? je(e, Or) : `https://${n.config.authDomain}/${Nr}`, i = {
|
|
4133
4278
|
apiKey: e.apiKey,
|
|
4134
4279
|
appName: n.name,
|
|
4135
|
-
v:
|
|
4136
|
-
}, r =
|
|
4280
|
+
v: re
|
|
4281
|
+
}, r = Mr.get(n.config.apiHost);
|
|
4137
4282
|
r && (i.eid = r);
|
|
4138
4283
|
const s = n._getFrameworks();
|
|
4139
|
-
return s.length && (i.fw = s.join(",")), `${t}?${
|
|
4284
|
+
return s.length && (i.fw = s.join(",")), `${t}?${se(i).slice(1)}`;
|
|
4140
4285
|
}
|
|
4141
|
-
async function
|
|
4142
|
-
const e = await
|
|
4286
|
+
async function Dr(n) {
|
|
4287
|
+
const e = await Pr(n), t = b().gapi;
|
|
4143
4288
|
return u(
|
|
4144
4289
|
t,
|
|
4145
4290
|
n,
|
|
@@ -4147,24 +4292,24 @@ async function fr(n) {
|
|
|
4147
4292
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4148
4293
|
), e.open({
|
|
4149
4294
|
where: document.body,
|
|
4150
|
-
url:
|
|
4295
|
+
url: Ur(n),
|
|
4151
4296
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
4152
|
-
attributes:
|
|
4297
|
+
attributes: Lr,
|
|
4153
4298
|
dontclear: !0
|
|
4154
4299
|
}, (i) => new Promise(async (r, s) => {
|
|
4155
4300
|
await i.restyle({
|
|
4156
4301
|
// Prevent iframe from closing on mouse out.
|
|
4157
4302
|
setHideOnLeave: !1
|
|
4158
4303
|
});
|
|
4159
|
-
const o =
|
|
4304
|
+
const o = E(
|
|
4160
4305
|
n,
|
|
4161
4306
|
"network-request-failed"
|
|
4162
4307
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4163
|
-
), c =
|
|
4308
|
+
), c = b().setTimeout(() => {
|
|
4164
4309
|
s(o);
|
|
4165
|
-
},
|
|
4310
|
+
}, Cr.get());
|
|
4166
4311
|
function a() {
|
|
4167
|
-
|
|
4312
|
+
b().clearTimeout(c), r(i);
|
|
4168
4313
|
}
|
|
4169
4314
|
i.ping(a).then(a, () => {
|
|
4170
4315
|
s(o);
|
|
@@ -4187,13 +4332,13 @@ async function fr(n) {
|
|
|
4187
4332
|
* See the License for the specific language governing permissions and
|
|
4188
4333
|
* limitations under the License.
|
|
4189
4334
|
*/
|
|
4190
|
-
const
|
|
4335
|
+
const xr = {
|
|
4191
4336
|
location: "yes",
|
|
4192
4337
|
resizable: "yes",
|
|
4193
4338
|
statusbar: "yes",
|
|
4194
4339
|
toolbar: "no"
|
|
4195
|
-
},
|
|
4196
|
-
class
|
|
4340
|
+
}, Fr = 500, Vr = 600, $r = "_blank", Hr = "http://localhost";
|
|
4341
|
+
class pt {
|
|
4197
4342
|
constructor(e) {
|
|
4198
4343
|
this.window = e, this.associatedEvent = null;
|
|
4199
4344
|
}
|
|
@@ -4205,19 +4350,19 @@ class at {
|
|
|
4205
4350
|
}
|
|
4206
4351
|
}
|
|
4207
4352
|
}
|
|
4208
|
-
function
|
|
4353
|
+
function jr(n, e, t, i = Fr, r = Vr) {
|
|
4209
4354
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4210
4355
|
let c = "";
|
|
4211
|
-
const a = Object.assign(Object.assign({},
|
|
4356
|
+
const a = Object.assign(Object.assign({}, xr), {
|
|
4212
4357
|
width: i.toString(),
|
|
4213
4358
|
height: r.toString(),
|
|
4214
4359
|
top: s,
|
|
4215
4360
|
left: o
|
|
4216
|
-
}), l =
|
|
4217
|
-
t && (c =
|
|
4218
|
-
const d = Object.entries(a).reduce((
|
|
4219
|
-
if (
|
|
4220
|
-
return
|
|
4361
|
+
}), l = y().toLowerCase();
|
|
4362
|
+
t && (c = Ft(l) ? $r : t), xt(l) && (e = e || Hr, a.scrollbars = "yes");
|
|
4363
|
+
const d = Object.entries(a).reduce((m, [I, w]) => `${m}${I}=${w},`, "");
|
|
4364
|
+
if (yi(l) && c !== "_self")
|
|
4365
|
+
return Wr(e || "", c), new pt(null);
|
|
4221
4366
|
const h = window.open(e || "", c, d);
|
|
4222
4367
|
u(
|
|
4223
4368
|
h,
|
|
@@ -4229,9 +4374,9 @@ function Ir(n, e, t, i = mr, r = gr) {
|
|
|
4229
4374
|
h.focus();
|
|
4230
4375
|
} catch {
|
|
4231
4376
|
}
|
|
4232
|
-
return new
|
|
4377
|
+
return new pt(h);
|
|
4233
4378
|
}
|
|
4234
|
-
function
|
|
4379
|
+
function Wr(n, e) {
|
|
4235
4380
|
const t = document.createElement("a");
|
|
4236
4381
|
t.href = n, t.target = e;
|
|
4237
4382
|
const i = document.createEvent("MouseEvent");
|
|
@@ -4253,8 +4398,8 @@ function Tr(n, e) {
|
|
|
4253
4398
|
* See the License for the specific language governing permissions and
|
|
4254
4399
|
* limitations under the License.
|
|
4255
4400
|
*/
|
|
4256
|
-
const
|
|
4257
|
-
async function
|
|
4401
|
+
const Br = "__/auth/handler", Gr = "emulator/auth/handler", zr = encodeURIComponent("fac");
|
|
4402
|
+
async function mt(n, e, t, i, r, s) {
|
|
4258
4403
|
u(
|
|
4259
4404
|
n.config.authDomain,
|
|
4260
4405
|
n,
|
|
@@ -4271,15 +4416,15 @@ async function ct(n, e, t, i, r, s) {
|
|
|
4271
4416
|
appName: n.name,
|
|
4272
4417
|
authType: t,
|
|
4273
4418
|
redirectUrl: i,
|
|
4274
|
-
v:
|
|
4419
|
+
v: re,
|
|
4275
4420
|
eventId: r
|
|
4276
4421
|
};
|
|
4277
|
-
if (e instanceof
|
|
4278
|
-
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "",
|
|
4422
|
+
if (e instanceof qt) {
|
|
4423
|
+
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", Cn(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
4279
4424
|
for (const [d, h] of Object.entries({}))
|
|
4280
4425
|
o[d] = h;
|
|
4281
4426
|
}
|
|
4282
|
-
if (e instanceof
|
|
4427
|
+
if (e instanceof ae) {
|
|
4283
4428
|
const d = e.getScopes().filter((h) => h !== "");
|
|
4284
4429
|
d.length > 0 && (o.scopes = d.join(","));
|
|
4285
4430
|
}
|
|
@@ -4287,11 +4432,11 @@ async function ct(n, e, t, i, r, s) {
|
|
|
4287
4432
|
const c = o;
|
|
4288
4433
|
for (const d of Object.keys(c))
|
|
4289
4434
|
c[d] === void 0 && delete c[d];
|
|
4290
|
-
const a = await n._getAppCheckToken(), l = a ? `#${
|
|
4291
|
-
return `${
|
|
4435
|
+
const a = await n._getAppCheckToken(), l = a ? `#${zr}=${encodeURIComponent(a)}` : "";
|
|
4436
|
+
return `${qr(n)}?${se(c).slice(1)}${l}`;
|
|
4292
4437
|
}
|
|
4293
|
-
function
|
|
4294
|
-
return n.emulator ?
|
|
4438
|
+
function qr({ config: n }) {
|
|
4439
|
+
return n.emulator ? je(n, Gr) : `https://${n.authDomain}/${Br}`;
|
|
4295
4440
|
}
|
|
4296
4441
|
/**
|
|
4297
4442
|
* @license
|
|
@@ -4309,30 +4454,30 @@ function kr({ config: n }) {
|
|
|
4309
4454
|
* See the License for the specific language governing permissions and
|
|
4310
4455
|
* limitations under the License.
|
|
4311
4456
|
*/
|
|
4312
|
-
const
|
|
4313
|
-
class
|
|
4457
|
+
const Ce = "webStorageSupport";
|
|
4458
|
+
class Kr {
|
|
4314
4459
|
constructor() {
|
|
4315
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence =
|
|
4460
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Qt, this._completeRedirectFn = vr, this._overrideRedirectResult = mr;
|
|
4316
4461
|
}
|
|
4317
4462
|
// Wrapping in async even though we don't await anywhere in order
|
|
4318
4463
|
// to make sure errors are raised as promise rejections
|
|
4319
4464
|
async _openPopup(e, t, i, r) {
|
|
4320
4465
|
var s;
|
|
4321
|
-
|
|
4322
|
-
const o = await
|
|
4323
|
-
return
|
|
4466
|
+
L((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4467
|
+
const o = await mt(e, t, i, Le(), r);
|
|
4468
|
+
return jr(e, o, ze());
|
|
4324
4469
|
}
|
|
4325
4470
|
async _openRedirect(e, t, i, r) {
|
|
4326
4471
|
await this._originValidation(e);
|
|
4327
|
-
const s = await
|
|
4328
|
-
return
|
|
4472
|
+
const s = await mt(e, t, i, Le(), r);
|
|
4473
|
+
return Xi(s), new Promise(() => {
|
|
4329
4474
|
});
|
|
4330
4475
|
}
|
|
4331
4476
|
_initialize(e) {
|
|
4332
4477
|
const t = e._key();
|
|
4333
4478
|
if (this.eventManagers[t]) {
|
|
4334
4479
|
const { manager: r, promise: s } = this.eventManagers[t];
|
|
4335
|
-
return r ? Promise.resolve(r) : (
|
|
4480
|
+
return r ? Promise.resolve(r) : (L(s, "If manager is not set, promise should be"), s);
|
|
4336
4481
|
}
|
|
4337
4482
|
const i = this.initAndGetManager(e);
|
|
4338
4483
|
return this.eventManagers[t] = { promise: i }, i.catch(() => {
|
|
@@ -4340,7 +4485,7 @@ class br {
|
|
|
4340
4485
|
}), i;
|
|
4341
4486
|
}
|
|
4342
4487
|
async initAndGetManager(e) {
|
|
4343
|
-
const t = await
|
|
4488
|
+
const t = await Dr(e), i = new yr(e);
|
|
4344
4489
|
return t.register("authEvent", (r) => (u(
|
|
4345
4490
|
r == null ? void 0 : r.authEvent,
|
|
4346
4491
|
e,
|
|
@@ -4352,10 +4497,10 @@ class br {
|
|
|
4352
4497
|
}), gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER), this.eventManagers[e._key()] = { manager: i }, this.iframes[e._key()] = t, i;
|
|
4353
4498
|
}
|
|
4354
4499
|
_isIframeWebStorageSupported(e, t) {
|
|
4355
|
-
this.iframes[e._key()].send(
|
|
4500
|
+
this.iframes[e._key()].send(Ce, { type: Ce }, (r) => {
|
|
4356
4501
|
var s;
|
|
4357
|
-
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[
|
|
4358
|
-
o !== void 0 && t(!!o),
|
|
4502
|
+
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[Ce];
|
|
4503
|
+
o !== void 0 && t(!!o), O(
|
|
4359
4504
|
e,
|
|
4360
4505
|
"internal-error"
|
|
4361
4506
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -4364,14 +4509,14 @@ class br {
|
|
|
4364
4509
|
}
|
|
4365
4510
|
_originValidation(e) {
|
|
4366
4511
|
const t = e._key();
|
|
4367
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
4512
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = br(e)), this.originValidationPromises[t];
|
|
4368
4513
|
}
|
|
4369
4514
|
get _shouldInitProactively() {
|
|
4370
|
-
return
|
|
4515
|
+
return Wt() || Be() || Te();
|
|
4371
4516
|
}
|
|
4372
4517
|
}
|
|
4373
|
-
const
|
|
4374
|
-
var
|
|
4518
|
+
const Jr = Kr;
|
|
4519
|
+
var gt = "@firebase/auth", _t = "1.7.5";
|
|
4375
4520
|
/**
|
|
4376
4521
|
* @license
|
|
4377
4522
|
* Copyright 2020 Google LLC
|
|
@@ -4388,7 +4533,7 @@ var lt = "@firebase/auth", ut = "1.7.5";
|
|
|
4388
4533
|
* See the License for the specific language governing permissions and
|
|
4389
4534
|
* limitations under the License.
|
|
4390
4535
|
*/
|
|
4391
|
-
class
|
|
4536
|
+
class Yr {
|
|
4392
4537
|
constructor(e) {
|
|
4393
4538
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
4394
4539
|
}
|
|
@@ -4439,7 +4584,7 @@ class Rr {
|
|
|
4439
4584
|
* See the License for the specific language governing permissions and
|
|
4440
4585
|
* limitations under the License.
|
|
4441
4586
|
*/
|
|
4442
|
-
function
|
|
4587
|
+
function Xr(n) {
|
|
4443
4588
|
switch (n) {
|
|
4444
4589
|
case "Node":
|
|
4445
4590
|
return "node";
|
|
@@ -4455,8 +4600,8 @@ function Pr(n) {
|
|
|
4455
4600
|
return;
|
|
4456
4601
|
}
|
|
4457
4602
|
}
|
|
4458
|
-
function
|
|
4459
|
-
|
|
4603
|
+
function Qr(n) {
|
|
4604
|
+
Ze(new et(
|
|
4460
4605
|
"auth",
|
|
4461
4606
|
(e, { options: t }) => {
|
|
4462
4607
|
const i = e.getProvider("app").getImmediate(), r = e.getProvider("heartbeat"), s = e.getProvider("app-check-internal"), { apiKey: o, authDomain: c } = i.options;
|
|
@@ -4468,9 +4613,9 @@ function Ar(n) {
|
|
|
4468
4613
|
apiHost: "identitytoolkit.googleapis.com",
|
|
4469
4614
|
tokenApiHost: "securetoken.googleapis.com",
|
|
4470
4615
|
apiScheme: "https",
|
|
4471
|
-
sdkClientVersion:
|
|
4472
|
-
}, l = new
|
|
4473
|
-
return
|
|
4616
|
+
sdkClientVersion: Bt(n)
|
|
4617
|
+
}, l = new Ri(i, r, s, a);
|
|
4618
|
+
return Li(l, t), l;
|
|
4474
4619
|
},
|
|
4475
4620
|
"PUBLIC"
|
|
4476
4621
|
/* ComponentType.PUBLIC */
|
|
@@ -4482,21 +4627,21 @@ function Ar(n) {
|
|
|
4482
4627
|
"auth-internal"
|
|
4483
4628
|
/* _ComponentName.AUTH_INTERNAL */
|
|
4484
4629
|
).initialize();
|
|
4485
|
-
})),
|
|
4630
|
+
})), Ze(new et(
|
|
4486
4631
|
"auth-internal",
|
|
4487
4632
|
(e) => {
|
|
4488
|
-
const t =
|
|
4633
|
+
const t = ke(e.getProvider(
|
|
4489
4634
|
"auth"
|
|
4490
4635
|
/* _ComponentName.AUTH */
|
|
4491
4636
|
).getImmediate());
|
|
4492
|
-
return ((i) => new
|
|
4637
|
+
return ((i) => new Yr(i))(t);
|
|
4493
4638
|
},
|
|
4494
4639
|
"PRIVATE"
|
|
4495
4640
|
/* ComponentType.PRIVATE */
|
|
4496
4641
|
).setInstantiationMode(
|
|
4497
4642
|
"EXPLICIT"
|
|
4498
4643
|
/* InstantiationMode.EXPLICIT */
|
|
4499
|
-
)),
|
|
4644
|
+
)), Oe(gt, _t, Xr(n)), Oe(gt, _t, "esm2017");
|
|
4500
4645
|
}
|
|
4501
4646
|
/**
|
|
4502
4647
|
* @license
|
|
@@ -4514,117 +4659,118 @@ function Ar(n) {
|
|
|
4514
4659
|
* See the License for the specific language governing permissions and
|
|
4515
4660
|
* limitations under the License.
|
|
4516
4661
|
*/
|
|
4517
|
-
const
|
|
4518
|
-
let
|
|
4519
|
-
const
|
|
4662
|
+
const Zr = 5 * 60, es = kt("authIdTokenMaxAge") || Zr;
|
|
4663
|
+
let vt = null;
|
|
4664
|
+
const ts = (n) => async (e) => {
|
|
4520
4665
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
4521
|
-
if (i && i >
|
|
4666
|
+
if (i && i > es)
|
|
4522
4667
|
return;
|
|
4523
4668
|
const r = t == null ? void 0 : t.token;
|
|
4524
|
-
|
|
4669
|
+
vt !== r && (vt = r, await fetch(n, {
|
|
4525
4670
|
method: r ? "POST" : "DELETE",
|
|
4526
4671
|
headers: r ? {
|
|
4527
4672
|
Authorization: `Bearer ${r}`
|
|
4528
4673
|
} : {}
|
|
4529
4674
|
}));
|
|
4530
4675
|
};
|
|
4531
|
-
function
|
|
4532
|
-
const e =
|
|
4676
|
+
function ns(n = Sn()) {
|
|
4677
|
+
const e = Et(n, "auth");
|
|
4533
4678
|
if (e.isInitialized())
|
|
4534
4679
|
return e.getImmediate();
|
|
4535
|
-
const t =
|
|
4536
|
-
popupRedirectResolver:
|
|
4680
|
+
const t = Oi(n, {
|
|
4681
|
+
popupRedirectResolver: Jr,
|
|
4537
4682
|
persistence: [
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4683
|
+
or,
|
|
4684
|
+
Ki,
|
|
4685
|
+
Qt
|
|
4541
4686
|
]
|
|
4542
|
-
}), i =
|
|
4687
|
+
}), i = kt("authTokenSyncURL");
|
|
4543
4688
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4544
4689
|
const s = new URL(i, location.origin);
|
|
4545
4690
|
if (location.origin === s.origin) {
|
|
4546
|
-
const o =
|
|
4547
|
-
|
|
4691
|
+
const o = ts(s.toString());
|
|
4692
|
+
Bi(t, o, () => o(t.currentUser)), Wi(t, (c) => o(c));
|
|
4548
4693
|
}
|
|
4549
4694
|
}
|
|
4550
|
-
const r =
|
|
4551
|
-
return r &&
|
|
4695
|
+
const r = bn("auth");
|
|
4696
|
+
return r && Mi(t, `http://${r}`), t;
|
|
4552
4697
|
}
|
|
4553
|
-
function
|
|
4698
|
+
function is() {
|
|
4554
4699
|
var n, e;
|
|
4555
4700
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
4556
4701
|
}
|
|
4557
|
-
|
|
4702
|
+
Ai({
|
|
4558
4703
|
loadJS(n) {
|
|
4559
4704
|
return new Promise((e, t) => {
|
|
4560
4705
|
const i = document.createElement("script");
|
|
4561
4706
|
i.setAttribute("src", n), i.onload = e, i.onerror = (r) => {
|
|
4562
|
-
const s =
|
|
4707
|
+
const s = E(
|
|
4563
4708
|
"internal-error"
|
|
4564
4709
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4565
4710
|
);
|
|
4566
4711
|
s.customData = r, t(s);
|
|
4567
|
-
}, i.type = "text/javascript", i.charset = "UTF-8",
|
|
4712
|
+
}, i.type = "text/javascript", i.charset = "UTF-8", is().appendChild(i);
|
|
4568
4713
|
});
|
|
4569
4714
|
},
|
|
4570
4715
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
4571
4716
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
4572
4717
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
4573
4718
|
});
|
|
4574
|
-
|
|
4719
|
+
Qr(
|
|
4575
4720
|
"Browser"
|
|
4576
4721
|
/* ClientPlatform.BROWSER */
|
|
4577
4722
|
);
|
|
4578
|
-
var
|
|
4579
|
-
const
|
|
4580
|
-
key:
|
|
4723
|
+
var rs = { firebase: { apiKey: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", authDomain: "feedme-253402.firebaseapp.com", databaseURL: "https://feedme-253402.firebaseio.com", projectId: "feedme-253402", storageBucket: "image.feedme.cc", messagingSenderId: "128512026847", appId: "1:128512026847:web:7c5c8ab7e8b90502dc616a", measurementId: "G-LTKS7N2HQS" }, assetBucketUrl: "static.feedme.cc", importFilesBucketUrl: "feedme-253402.appspot.com", clientId: "d5f8840d63dbb758b6c4ee2a5e8b013d15dd25e242c457481326062b83962476" }, ss = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", licensePortalUrl: "https://license.feedme.cc/", marketingV1Portal: "https://marketing-v1.feedme.cc", voucherAppUrl: "https://voucher.feedme.cc/" };
|
|
4724
|
+
const os = {
|
|
4725
|
+
key: 2,
|
|
4581
4726
|
class: "h-full w-full"
|
|
4582
|
-
},
|
|
4727
|
+
}, as = ["src"], Ts = /* @__PURE__ */ De({
|
|
4583
4728
|
__name: "App",
|
|
4584
4729
|
setup(n) {
|
|
4585
|
-
const e =
|
|
4586
|
-
const
|
|
4587
|
-
return `${
|
|
4730
|
+
const e = me(), t = fn(), i = pn(), r = mn(), s = gn(), o = wt(), c = ee(o.query.showHeader !== "false"), a = ee(!1), { currentBusiness: l } = me(), d = ee(!1), h = ne(() => i.version), m = ne(() => {
|
|
4731
|
+
const g = e.currentCountry.value || "MY", v = tt.getIdToken(), T = l.value._id;
|
|
4732
|
+
return `${ss.marketingV1Portal}/b/${T}/marketing/overview?showHeader=false&country=${g}&token=${v}`;
|
|
4588
4733
|
});
|
|
4589
|
-
async function
|
|
4590
|
-
if (
|
|
4734
|
+
async function I() {
|
|
4735
|
+
if (Nn().length) {
|
|
4591
4736
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4592
4737
|
return;
|
|
4593
4738
|
}
|
|
4594
|
-
const
|
|
4595
|
-
await
|
|
4739
|
+
const g = On(rs.firebase), v = await hn.getCustomToken(), T = ns();
|
|
4740
|
+
await ji(T, v), Ln(g), console.log("initFirebase", g);
|
|
4596
4741
|
}
|
|
4597
|
-
const
|
|
4598
|
-
d.value = !1, await
|
|
4742
|
+
const w = async () => {
|
|
4743
|
+
d.value = !1, await un(), console.log("forceRerender"), tt.setBusinessId(l.value._id), await i.readPremium(), !a.value && h.value === "v2" ? e.registerSidebarComponent(xn) : e.hideSidebarToggle(!0), await I(), a.value = !0, d.value = !0;
|
|
4599
4744
|
};
|
|
4600
|
-
return
|
|
4601
|
-
if (
|
|
4602
|
-
const
|
|
4603
|
-
|
|
4745
|
+
return ln(() => {
|
|
4746
|
+
if (Mn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(r, s), !c.value) {
|
|
4747
|
+
const g = document.getElementsByClassName("app-header")[0], v = document.getElementsByClassName("app-sidebar")[0], T = document.getElementsByClassName("app-container")[0], M = document.getElementsByTagName("main")[0];
|
|
4748
|
+
g == null || g.classList.add("!hidden"), v == null || v.classList.add("!pt-0"), T == null || T.classList.add("!pt-0"), M == null || M.classList.add("!pt-0"), e.hideSidebarToggle(!0);
|
|
4604
4749
|
}
|
|
4605
|
-
l.value != null && (console.log("App mounted, forceRerender"),
|
|
4606
|
-
}),
|
|
4750
|
+
l.value != null && (console.log("App mounted, forceRerender"), w());
|
|
4751
|
+
}), xe(
|
|
4607
4752
|
() => e.currentBusiness.value,
|
|
4608
|
-
async (
|
|
4609
|
-
console.log("Current business changed"),
|
|
4753
|
+
async (g, v) => {
|
|
4754
|
+
console.log("Current business changed"), g != null && g._id != v._id && (console.log("forceRerender when business changes", g, v), w());
|
|
4610
4755
|
}
|
|
4611
|
-
), (
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4756
|
+
), (g, v) => (H(), pe(It, null, [
|
|
4757
|
+
p(d) && p(h) === "v2" ? (H(), Ne(p(dn), { key: 0 })) : Ae("", !0),
|
|
4758
|
+
p(d) && p(h) === "v2" && p(c) ? (H(), Ne(ti, { key: 1 })) : Ae("", !0),
|
|
4759
|
+
p(d) && p(h) !== "v2" ? (H(), pe("div", os, [
|
|
4760
|
+
S(In, {
|
|
4761
|
+
json: { url: p(m) }
|
|
4616
4762
|
}, null, 8, ["json"]),
|
|
4617
|
-
|
|
4763
|
+
_("iframe", {
|
|
4618
4764
|
allow: "clipboard-read; clipboard-write",
|
|
4619
4765
|
frameBorder: "0",
|
|
4620
4766
|
height: "100%",
|
|
4621
4767
|
width: "100%",
|
|
4622
|
-
src:
|
|
4623
|
-
}, null, 8,
|
|
4624
|
-
])) :
|
|
4768
|
+
src: p(m)
|
|
4769
|
+
}, null, 8, as)
|
|
4770
|
+
])) : Ae("", !0)
|
|
4625
4771
|
], 64));
|
|
4626
4772
|
}
|
|
4627
4773
|
});
|
|
4628
4774
|
export {
|
|
4629
|
-
|
|
4775
|
+
Ts as default
|
|
4630
4776
|
};
|