@feedmepos/mf-connect 0.1.98-beta.25 → 0.1.98-beta.26
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/{App-BUkc5aGq.js → App-B6glKEk7.js} +372 -370
- package/dist/{AuditLogs-O7UuoX5c.js → AuditLogs-Ber2K2Fb.js} +9 -9
- package/dist/{Bin-utXmjy04.js → Bin-D8kHjDKf.js} +8 -8
- package/dist/{Broadcast-BXb3L9vb.js → Broadcast-B94Y4oee.js} +11 -11
- package/dist/{CampaignAnalytic-f2UrBdrb.js → CampaignAnalytic-CyKSu99y.js} +5 -5
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-qrbmOhxw.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DGxHk6uY.js} +6 -6
- package/dist/{Card-CiF29-ep.js → Card-_K73RBSm.js} +18 -18
- package/dist/{Collections-DjJAxfqr.js → Collections-M70J7ALM.js} +8 -8
- package/dist/{Credit-D65U3Mdl.js → Credit-OJ-vdBxc.js} +12 -12
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-kjITylzB.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CN_ojxTj.js} +31 -31
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-C3Ta6s9S.js → EffectSheet.vue_vue_type_style_index_0_lang-BxjuxD5K.js} +6 -6
- package/dist/{Experience-B-neMliv.js → Experience-CZADIFzP.js} +12 -12
- package/dist/{FileSaver.min-D_qB65E0.js → FileSaver.min-C8PAW7mn.js} +1 -1
- package/dist/{Game-CU-duk50.js → Game-B7l9QFSa.js} +13 -13
- package/dist/{Grab-02ynkxG_.js → Grab-P5Xj34zP.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-sII_cTjf.js → ImageInput.vue_vue_type_script_setup_true_lang-CePnr1uQ.js} +1 -1
- package/dist/{Index-C_ICP-nb.js → Index-sWceq11a.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DWozAtMr.js → LocationPicker.vue_vue_type_script_setup_true_lang-5R0M7vsi.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CxpbTL6_.js → LottieAnimation.vue_vue_type_script_setup_true_lang-ZtTaIPA4.js} +1 -1
- package/dist/{LoyaltyDashboard-ANhYEhn9.js → LoyaltyDashboard-CEMcKNoR.js} +7 -7
- package/dist/{MainLayout-DjCakvvf.js → MainLayout-DUqXwwWw.js} +1 -1
- package/dist/{Marketing-Bw2npH05.js → Marketing-DNxDfSaT.js} +4 -4
- package/dist/{MarketingMaterialEdit-BNoAIuyZ.js → MarketingMaterialEdit-Dy8Q_lMy.js} +6 -6
- package/dist/{Member-C4EpamRW.js → Member-DyCWkDyy.js} +11 -11
- package/dist/{MemberList-y0SWjf3X.js → MemberList-0njYsriB.js} +25 -25
- package/dist/{MemberTransactions-Cwa6AavM.js → MemberTransactions-mbyuLAoi.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-zRMC-NP-.js → MessageInput.vue_vue_type_script_setup_true_lang-Bz399HMJ.js} +9 -9
- package/dist/{Mission-CwrB453m.js → Mission-BOQ9qS6P.js} +13 -13
- package/dist/{Overview-CqQw7xG2.js → Overview-BSj2B-aw.js} +3 -3
- package/dist/{Overview-CmRM41RF.js → Overview-DdlBonwh.js} +18 -18
- package/dist/{Point-DBpQfV_q.js → Point-DnykpwZN.js} +12 -12
- package/dist/{Promotion-DdQ-9QUR.js → Promotion-DQgG0pq2.js} +13 -13
- package/dist/{Queue-CiRdKJTr.js → Queue-BuQk_ZzS.js} +10 -10
- package/dist/{Record-BQCngT_O.js → Record-CeYLUZzh.js} +9 -9
- package/dist/{Review-t_qrIwh7.js → Review-BVgDaqr4.js} +2 -2
- package/dist/{ReviewFacebookCallback-DbVZiPeu.js → ReviewFacebookCallback-Cd5plYuS.js} +5 -5
- package/dist/{ReviewGoogleCallback-CwGRMYUs.js → ReviewGoogleCallback-1c9fba3u.js} +5 -5
- package/dist/{Reward-Br9YkO2a.js → Reward-CbxxhNxM.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-6kqf9yMz.js → RewardGroup.vue_vue_type_script_setup_true_lang-Mm-QwApd.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CFFvNIH9.js → RuleGroup.vue_vue_type_script_setup_true_lang-CtX041Mf.js} +14 -14
- package/dist/{Segment-9n7t0khE.js → Segment-Cb404fiv.js} +24 -24
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BPL_Hxnr.js → SelectItems.vue_vue_type_script_setup_true_lang-r2kYyAJg.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-hwXFD_Ld.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DlYRIL1g.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DMOpJQVx.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-Bo8REDQ3.js} +4 -4
- package/dist/{Setting-C9TnOMTz.js → Setting-BKNaVe3o.js} +14 -14
- package/dist/{SettingAdvertisements-D3Xn8WL_.js → SettingAdvertisements-CIb8dJw-.js} +12 -12
- package/dist/{Settings-B0TwpyFp.js → Settings-QIrAY-Qb.js} +5 -5
- package/dist/{Store-BHnY9YF8.js → Store-D5DekNIS.js} +21 -21
- package/dist/{StoreRewards-DCXfXrFi.js → StoreRewards-CK9cv6PB.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BAgCtiFt.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DwFvFUw7.js} +20 -20
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-inq-VGDD.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-XkHaE1oD.js} +2 -2
- package/dist/{Tier-gnazDCzR.js → Tier-BsTolJGJ.js} +24 -24
- package/dist/{Title-C_jzhw_j.js → Title-CBtGuQ1G.js} +21 -21
- package/dist/{Transaction-Bj3U8pL-.js → Transaction-l_ijkhP0.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-B9aEpCH1.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-B8ZbJYEJ.js} +6 -6
- package/dist/{Voucher-sFbU-h2q.js → Voucher-DKuQkekS.js} +14 -14
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-InHSzrhq.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BqwXxmaX.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-C3U7fQA0.js → ZodTextField.vue_vue_type_script_setup_true_lang-DYO0crif.js} +2 -2
- package/dist/{app-DD555RoJ.js → app-BZv3K2Ar.js} +236 -236
- package/dist/app.js +1 -1
- package/dist/{business-DB9iO7Br.js → business-CQ2PeIc5.js} +1 -1
- package/dist/{campaign-CUGDinxc.js → campaign-C1qnp7Oy.js} +2 -2
- package/dist/{campaign-C_IFsOFJ.js → campaign-DWJ-1vIs.js} +7 -7
- package/dist/{campaign.fn-DhIa046T.js → campaign.fn-DwntQh7C.js} +171 -171
- package/dist/{collection.fn-Fvh1-Ues.js → collection.fn-B6lPfVbM.js} +2 -2
- package/dist/{duplicateCampaign-D9uyOAo7.js → duplicateCampaign-DCL_NGO0.js} +2 -2
- package/dist/{effect-BCgEuLWD.js → effect-DPbpixEB.js} +1 -1
- package/dist/{email-addresses-ChRY6KhW.js → email-addresses-dbgjTH_V.js} +2 -2
- package/dist/{export-CHuBo3Oe.js → export-BDrvA-Ea.js} +3 -3
- package/dist/{helper-BMuPxXHz.js → helper-DFaMGL6s.js} +1 -1
- package/dist/{index-DMuut12l.js → index-99sg9bkE.js} +1 -1
- package/dist/{index-DcMgvEkW.js → index-B-ffCrHz.js} +1 -1
- package/dist/{index-DDYUDa5o.js → index-BAyNExOB.js} +1 -1
- package/dist/{index-mGE3CR_Z.js → index-BaFWAJdR.js} +164 -160
- package/dist/{index-DpFxMnDl.js → index-BlW2eRWp.js} +2 -2
- package/dist/{index-D0bz-VSI.js → index-C_tW-UlJ.js} +572 -564
- package/dist/{index-BjbLHyVR.js → index-CrOMkbfE.js} +1 -1
- package/dist/{index-BjKdQANx.js → index-CttqAV4U.js} +1 -1
- package/dist/{index-BFgyb0xe.js → index-D48wWXFx.js} +1 -1
- package/dist/{index-dLwefFXg.js → index-DCBkRZPS.js} +6 -6
- package/dist/{index-Crngflkf.js → index-DHwh6RwR.js} +2 -2
- package/dist/{index-DVh28Oij.js → index-JI9xC_zj.js} +6 -6
- package/dist/{index-DTjO7hFy.js → index-c7lDRguo.js} +1 -1
- package/dist/{index-BopyNUfY.js → index-dSJvPERR.js} +1 -1
- package/dist/{index-BdFkgh36.js → index-hJZ1hw8m.js} +3 -3
- package/dist/{index.esm2017-Cwaa2wfa.js → index.esm2017-CKdWVukX.js} +1 -1
- package/dist/{loading-BE7pUUKN.js → loading-BLdUDxXv.js} +1 -1
- package/dist/{lodash-Dcq8KZCh.js → lodash-BOzga6Zd.js} +1 -1
- package/dist/{membership-CQ78NVn1.js → membership-B7v23lsV.js} +2 -2
- package/dist/{money-DLDz7_gN.js → money-Bfgr4ebR.js} +1 -1
- package/dist/{number-DQMN1AmH.js → number-D6VAT6Ci.js} +1 -1
- package/dist/{objectid-B4YBmdlp.js → objectid-BV5fUbOE.js} +15 -15
- package/dist/{plugins-DbeOdVQ-.js → plugins-C_OisvGx.js} +3 -3
- package/dist/{reward-D-D963m9.js → reward-BD3vRbNS.js} +1 -1
- package/dist/{rule-BC1vgjDM.js → rule-DUM3oM3M.js} +3 -3
- package/dist/{rule-builder-Dofsh9-S.js → rule-builder-DJelRmN2.js} +1 -1
- package/dist/{template-CGbtF7kT.js → template-OYwN2C3V.js} +6 -6
- package/dist/{timezone-gBL4cClP.js → timezone-Bavrvqxg.js} +1 -1
- package/dist/{trigger-DHJAM1e1.js → trigger-DAwlfSzC.js} +5 -5
- package/dist/{useMarketingMaterialActions-C-XqowqA.js → useMarketingMaterialActions-DNAFAsdY.js} +3 -3
- package/dist/{usePagination-Cykc6WhN.js → usePagination-BVmlLK1x.js} +1 -1
- package/dist/{user-B0Fxtar6.js → user-DwM_VolV.js} +1 -1
- package/dist/{vue-i18n-DdRQZOJW.js → vue-i18n-C-Zawpf_.js} +650 -650
- package/dist/{xlsx-DMH5cwZ3.js → xlsx-DP37ywaz.js} +1 -1
- package/dist/{zod-DAB4kEFl.js → zod-FTYTR20x.js} +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as De, ref as
|
|
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
2
|
import { useRouter as yt, useRoute as wt, RouterView as dn } from "vue-router";
|
|
3
|
-
import { useCoreStore as
|
|
3
|
+
import { useCoreStore as me, FeedMeAuth as hn } from "@feedmepos/mf-common";
|
|
4
4
|
import { u as fn } from "./app-wDQR6dpb.js";
|
|
5
|
-
import { u as pn } from "./business-
|
|
6
|
-
import "./index-
|
|
7
|
-
import { components as
|
|
8
|
-
import { u as Tt } from "./vue-i18n-
|
|
9
|
-
import { m as _n } from "./index-
|
|
10
|
-
import { C as Xe } from "./timezone-
|
|
11
|
-
import { R as f, A as vn, a as Qe } from "./app-
|
|
5
|
+
import { u as pn } from "./business-CQ2PeIc5.js";
|
|
6
|
+
import "./index-B-ffCrHz.js";
|
|
7
|
+
import { components as Q, useSnackbar as mn, useDialog as gn } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as Tt } from "./vue-i18n-C-Zawpf_.js";
|
|
9
|
+
import { m as _n } from "./index-BAyNExOB.js";
|
|
10
|
+
import { C as Xe } from "./timezone-Bavrvqxg.js";
|
|
11
|
+
import { R as f, A as vn, a as Qe } from "./app-BZv3K2Ar.js";
|
|
12
12
|
import { J as In } from "./JsonViewer-v8_C7l5N.js";
|
|
13
|
-
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
|
|
13
|
+
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-CKdWVukX.js";
|
|
14
14
|
import { _ as $e } from "./tslib.es6-BCqqvLQ_.js";
|
|
15
|
-
import { S as tt, c as Mn } from "./index-
|
|
15
|
+
import { S as tt, c as Mn } from "./index-BlW2eRWp.js";
|
|
16
16
|
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({
|
|
17
17
|
__name: "NavigationTab",
|
|
18
18
|
setup(n) {
|
|
19
|
-
const { t: e } = Tt(), t =
|
|
19
|
+
const { t: e } = Tt(), t = ee(), i = [
|
|
20
20
|
{
|
|
21
21
|
label: e("connect.navigation.analytic"),
|
|
22
22
|
value: f["$connect-ANALYTIC"]
|
|
@@ -62,7 +62,7 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
62
62
|
{
|
|
63
63
|
label: e("connect.navigation.point"),
|
|
64
64
|
value: f["$connect-PROGRAM_POINT"],
|
|
65
|
-
badge: () =>
|
|
65
|
+
badge: () => Y(Q.FmPill, { variant: "premium" })
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
label: e("connect.navigation.credit"),
|
|
@@ -71,7 +71,7 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
71
71
|
{
|
|
72
72
|
label: e("connect.navigation.game"),
|
|
73
73
|
value: f["$connect-PROGRAM_GAME"],
|
|
74
|
-
badge: () =>
|
|
74
|
+
badge: () => Y(Q.FmPill, { variant: "premium" })
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
label: "Mission",
|
|
@@ -90,19 +90,19 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
90
90
|
{
|
|
91
91
|
label: e("connect.navigation.segments"),
|
|
92
92
|
value: f["$connect-LOYALTY_SEGMENT"],
|
|
93
|
-
badge: () =>
|
|
93
|
+
badge: () => Y(Q.FmPill, { variant: "premium" })
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
label: e("connect.navigation.card"),
|
|
97
97
|
value: f["$connect-LOYALTY_CARD"],
|
|
98
|
-
badge: () =>
|
|
98
|
+
badge: () => Y(Q.FmPill, { variant: "premium" })
|
|
99
99
|
}
|
|
100
100
|
]
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
label: e("connect.navigation.referral"),
|
|
104
104
|
value: f["$connect-REFERRAL"],
|
|
105
|
-
badge: () =>
|
|
105
|
+
badge: () => Y(Q.FmPill, { variant: "premium" })
|
|
106
106
|
},
|
|
107
107
|
{
|
|
108
108
|
label: e("connect.navigation.store"),
|
|
@@ -132,15 +132,15 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
132
132
|
label: e("connect.navigation.bin"),
|
|
133
133
|
value: f["$connect-BIN"]
|
|
134
134
|
}
|
|
135
|
-
], r = yt(), s = wt(), o = i.reduce((d, h) => [...(h.children ?? []).map((
|
|
135
|
+
], r = yt(), s = wt(), o = i.reduce((d, h) => [...(h.children ?? []).map((m) => m.value), ...d, h.value], []), c = me(), a = ne(() => {
|
|
136
136
|
const d = c.currentCountry.value || "MY";
|
|
137
137
|
return console.log(`[MF] Timezone set to: ${Xe[d]}`), Xe[d];
|
|
138
138
|
});
|
|
139
139
|
xe(
|
|
140
140
|
() => s,
|
|
141
141
|
(d) => {
|
|
142
|
-
const h = d.matched.map((
|
|
143
|
-
t.value = h.find((
|
|
142
|
+
const h = d.matched.map((m) => m.name).reverse();
|
|
143
|
+
t.value = h.find((m) => o.includes(m));
|
|
144
144
|
},
|
|
145
145
|
{ immediate: !0 }
|
|
146
146
|
);
|
|
@@ -148,18 +148,18 @@ const Un = { class: "flex flex-col h-full justify-between py-16" }, Dn = { class
|
|
|
148
148
|
await r.push({ name: d });
|
|
149
149
|
}
|
|
150
150
|
return (d, h) => {
|
|
151
|
-
var
|
|
152
|
-
const
|
|
153
|
-
return
|
|
154
|
-
|
|
151
|
+
var I;
|
|
152
|
+
const m = Z("FmCollapsibleTabs");
|
|
153
|
+
return H(), pe("div", Un, [
|
|
154
|
+
S(m, {
|
|
155
155
|
class: "border-fm-color-neutral-gray-100 border-r px-4",
|
|
156
|
-
"model-value": (
|
|
156
|
+
"model-value": (I = p(t)) == null ? void 0 : I.toString(),
|
|
157
157
|
items: i,
|
|
158
158
|
"onUpdate:modelValue": l
|
|
159
159
|
}, null, 8, ["model-value"]),
|
|
160
160
|
_("div", Dn, [
|
|
161
|
-
_("div", null, "Timezone: " +
|
|
162
|
-
_("div", null, "(UTC" +
|
|
161
|
+
_("div", null, "Timezone: " + R(p(a).split("/")[1].replace("_", " ")), 1),
|
|
162
|
+
_("div", null, "(UTC" + R(p(_n).tz(p(a)).format("Z")) + ")", 1)
|
|
163
163
|
])
|
|
164
164
|
]);
|
|
165
165
|
};
|
|
@@ -182,13 +182,13 @@ const $n = { class: "flex flex-col gap-12" }, Hn = { class: "fm-corner-radius-xx
|
|
|
182
182
|
__name: "AiMarketingPromoDialog",
|
|
183
183
|
setup(n) {
|
|
184
184
|
let e = !1;
|
|
185
|
-
const { t } = Tt(), i = yt(), { sessionUser: r } =
|
|
185
|
+
const { t } = Tt(), i = yt(), { sessionUser: r, currentCountry: s } = me(), o = ee(!1), c = [
|
|
186
186
|
{ key: "completeContent", icon: "layers" },
|
|
187
187
|
{ key: "realContext", icon: "storefront" },
|
|
188
188
|
{ key: "socialFormat", icon: "aspect_ratio" }
|
|
189
|
-
],
|
|
190
|
-
var
|
|
191
|
-
const
|
|
189
|
+
], a = ne(() => {
|
|
190
|
+
var w;
|
|
191
|
+
const I = ((w = r.value) == null ? void 0 : w.permissions) ?? [];
|
|
192
192
|
return vn(
|
|
193
193
|
[
|
|
194
194
|
{
|
|
@@ -196,104 +196,106 @@ const $n = { class: "flex flex-col gap-12" }, Hn = { class: "fm-corner-radius-xx
|
|
|
196
196
|
subject: Qe.Subject.Business.crm_marketingMaterial
|
|
197
197
|
}
|
|
198
198
|
],
|
|
199
|
-
|
|
199
|
+
I
|
|
200
200
|
).granted;
|
|
201
|
-
})
|
|
202
|
-
|
|
201
|
+
}), l = ne(
|
|
202
|
+
() => s.value === "MY" && a.value
|
|
203
|
+
);
|
|
204
|
+
let d = !1;
|
|
203
205
|
xe(
|
|
204
|
-
|
|
205
|
-
(
|
|
206
|
-
|
|
206
|
+
l,
|
|
207
|
+
(I) => {
|
|
208
|
+
d || !I || (d = !0, !(Fn() || e) && (e = !0, o.value = !0));
|
|
207
209
|
},
|
|
208
210
|
{ immediate: !0 }
|
|
209
211
|
);
|
|
210
|
-
async function
|
|
211
|
-
|
|
212
|
+
async function h() {
|
|
213
|
+
o.value = !1, await i.push({ name: f["$connect-MARKETING"] });
|
|
212
214
|
}
|
|
213
|
-
function
|
|
214
|
-
Vn(),
|
|
215
|
+
function m() {
|
|
216
|
+
Vn(), o.value = !1;
|
|
215
217
|
}
|
|
216
|
-
return (
|
|
217
|
-
const
|
|
218
|
-
return
|
|
219
|
-
modelValue:
|
|
220
|
-
"onUpdate:modelValue":
|
|
218
|
+
return (I, w) => {
|
|
219
|
+
const g = Z("FmIcon"), v = Z("FmCard"), T = Z("FmButton"), M = Z("FmDialog");
|
|
220
|
+
return H(), Ne(M, {
|
|
221
|
+
modelValue: o.value,
|
|
222
|
+
"onUpdate:modelValue": w[0] || (w[0] = (k) => o.value = k),
|
|
221
223
|
"min-width": "min(500px, calc(100% - 48px))",
|
|
222
224
|
"max-width": "min(860px, calc(100% - 48px))",
|
|
223
225
|
"max-height": "90vh",
|
|
224
226
|
"dismiss-away": ""
|
|
225
227
|
}, {
|
|
226
|
-
"dialog-header":
|
|
228
|
+
"dialog-header": X(() => [
|
|
227
229
|
_("div", $n, [
|
|
228
230
|
_("div", Hn, [
|
|
229
|
-
|
|
231
|
+
S(g, {
|
|
230
232
|
name: "auto_awesome",
|
|
231
233
|
size: "sm",
|
|
232
234
|
color: "primary"
|
|
233
235
|
}),
|
|
234
|
-
_("span", jn,
|
|
236
|
+
_("span", jn, R(p(t)("connect.marketing.whatsNew.badge")), 1)
|
|
235
237
|
]),
|
|
236
|
-
_("h1", Wn,
|
|
237
|
-
_("p", Gn,
|
|
238
|
+
_("h1", Wn, R(p(t)("connect.marketing.whatsNew.title")), 1),
|
|
239
|
+
_("p", Gn, R(p(t)("connect.marketing.whatsNew.subtitle")), 1)
|
|
238
240
|
])
|
|
239
241
|
]),
|
|
240
|
-
"dialog-footer":
|
|
242
|
+
"dialog-footer": X(() => [
|
|
241
243
|
_("div", Qn, [
|
|
242
244
|
_("div", Zn, [
|
|
243
|
-
|
|
245
|
+
S(T, {
|
|
244
246
|
variant: "primary",
|
|
245
247
|
size: "lg",
|
|
246
|
-
label:
|
|
248
|
+
label: p(t)("connect.marketing.whatsNew.cta"),
|
|
247
249
|
"append-icon": "arrow_forward",
|
|
248
|
-
onClick:
|
|
250
|
+
onClick: h
|
|
249
251
|
}, null, 8, ["label"]),
|
|
250
|
-
|
|
252
|
+
S(T, {
|
|
251
253
|
variant: "tertiary",
|
|
252
254
|
size: "lg",
|
|
253
|
-
label:
|
|
254
|
-
onClick:
|
|
255
|
+
label: p(t)("connect.marketing.whatsNew.dismiss"),
|
|
256
|
+
onClick: m
|
|
255
257
|
}, null, 8, ["label"])
|
|
256
258
|
]),
|
|
257
|
-
_("div", ei,
|
|
259
|
+
_("div", ei, R(p(t)("connect.marketing.whatsNew.footnote")), 1)
|
|
258
260
|
])
|
|
259
261
|
]),
|
|
260
|
-
default:
|
|
262
|
+
default: X(() => [
|
|
261
263
|
_("div", Bn, [
|
|
262
264
|
_("div", zn, [
|
|
263
|
-
(
|
|
264
|
-
key:
|
|
265
|
+
(H(), pe(It, null, cn(c, (k) => S(v, {
|
|
266
|
+
key: k.key,
|
|
265
267
|
variant: "outlined",
|
|
266
268
|
class: "!h-full flex flex-col gap-8 p-16"
|
|
267
269
|
}, {
|
|
268
|
-
default:
|
|
270
|
+
default: X(() => [
|
|
269
271
|
_("div", qn, [
|
|
270
|
-
|
|
271
|
-
name:
|
|
272
|
+
S(g, {
|
|
273
|
+
name: k.icon,
|
|
272
274
|
size: "md",
|
|
273
275
|
color: "primary"
|
|
274
276
|
}, null, 8, ["name"])
|
|
275
277
|
]),
|
|
276
|
-
_("div", Kn,
|
|
277
|
-
_("div", Jn,
|
|
278
|
-
`connect.marketing.whatsNew.benefits.${
|
|
278
|
+
_("div", Kn, R(p(t)(`connect.marketing.whatsNew.benefits.${k.key}.title`)), 1),
|
|
279
|
+
_("div", Jn, R(p(t)(
|
|
280
|
+
`connect.marketing.whatsNew.benefits.${k.key}.description`
|
|
279
281
|
)), 1)
|
|
280
282
|
]),
|
|
281
283
|
_: 2
|
|
282
284
|
}, 1024)), 64))
|
|
283
285
|
]),
|
|
284
|
-
|
|
286
|
+
S(v, {
|
|
285
287
|
variant: "outlined",
|
|
286
288
|
class: "flex items-start gap-12 p-16"
|
|
287
289
|
}, {
|
|
288
|
-
default:
|
|
290
|
+
default: X(() => [
|
|
289
291
|
_("div", Yn, [
|
|
290
|
-
|
|
292
|
+
S(g, {
|
|
291
293
|
name: "lightbulb",
|
|
292
294
|
size: "md",
|
|
293
295
|
color: "primary"
|
|
294
296
|
})
|
|
295
297
|
]),
|
|
296
|
-
_("p", Xn,
|
|
298
|
+
_("p", Xn, R(p(t)("connect.marketing.whatsNew.callout")), 1)
|
|
297
299
|
]),
|
|
298
300
|
_: 1
|
|
299
301
|
})
|
|
@@ -344,12 +346,12 @@ const ri = Rt, At = new Fe("auth", "Firebase", Rt());
|
|
|
344
346
|
* See the License for the specific language governing permissions and
|
|
345
347
|
* limitations under the License.
|
|
346
348
|
*/
|
|
347
|
-
const
|
|
349
|
+
const ge = new yn("@firebase/auth");
|
|
348
350
|
function si(n, ...e) {
|
|
349
|
-
|
|
351
|
+
ge.logLevel <= bt.WARN && ge.warn(`Auth (${re}): ${n}`, ...e);
|
|
350
352
|
}
|
|
351
|
-
function
|
|
352
|
-
|
|
353
|
+
function ue(n, ...e) {
|
|
354
|
+
ge.logLevel <= bt.ERROR && ge.error(`Auth (${re}): ${n}`, ...e);
|
|
353
355
|
}
|
|
354
356
|
/**
|
|
355
357
|
* @license
|
|
@@ -367,10 +369,10 @@ function ce(n, ...e) {
|
|
|
367
369
|
* See the License for the specific language governing permissions and
|
|
368
370
|
* limitations under the License.
|
|
369
371
|
*/
|
|
370
|
-
function
|
|
372
|
+
function O(n, ...e) {
|
|
371
373
|
throw He(n, ...e);
|
|
372
374
|
}
|
|
373
|
-
function
|
|
375
|
+
function E(n, ...e) {
|
|
374
376
|
return He(n, ...e);
|
|
375
377
|
}
|
|
376
378
|
function Pt(n, e, t) {
|
|
@@ -379,7 +381,7 @@ function Pt(n, e, t) {
|
|
|
379
381
|
appName: n.name
|
|
380
382
|
});
|
|
381
383
|
}
|
|
382
|
-
function
|
|
384
|
+
function $(n) {
|
|
383
385
|
return Pt(n, "operation-not-supported-in-this-environment", "Operations that alter the current user are not supported in conjunction with FirebaseServerApp");
|
|
384
386
|
}
|
|
385
387
|
function He(n, ...e) {
|
|
@@ -393,12 +395,12 @@ function u(n, e, ...t) {
|
|
|
393
395
|
if (!n)
|
|
394
396
|
throw He(e, ...t);
|
|
395
397
|
}
|
|
396
|
-
function
|
|
398
|
+
function P(n) {
|
|
397
399
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
398
|
-
throw
|
|
400
|
+
throw ue(e), new Error(e);
|
|
399
401
|
}
|
|
400
|
-
function
|
|
401
|
-
n ||
|
|
402
|
+
function L(n, e) {
|
|
403
|
+
n || P(e);
|
|
402
404
|
}
|
|
403
405
|
/**
|
|
404
406
|
* @license
|
|
@@ -479,9 +481,9 @@ function ci() {
|
|
|
479
481
|
* See the License for the specific language governing permissions and
|
|
480
482
|
* limitations under the License.
|
|
481
483
|
*/
|
|
482
|
-
class
|
|
484
|
+
class oe {
|
|
483
485
|
constructor(e, t) {
|
|
484
|
-
this.shortDelay = e, this.longDelay = t,
|
|
486
|
+
this.shortDelay = e, this.longDelay = t, L(t > e, "Short delay should be less than long delay!"), this.isMobile = wn() || Tn();
|
|
485
487
|
}
|
|
486
488
|
get() {
|
|
487
489
|
return ai() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
@@ -504,7 +506,7 @@ class re {
|
|
|
504
506
|
* limitations under the License.
|
|
505
507
|
*/
|
|
506
508
|
function je(n, e) {
|
|
507
|
-
|
|
509
|
+
L(n.emulator, "Emulator should always be set here");
|
|
508
510
|
const { url: t } = n.emulator;
|
|
509
511
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
510
512
|
}
|
|
@@ -537,7 +539,7 @@ class Ct {
|
|
|
537
539
|
return globalThis.fetch;
|
|
538
540
|
if (typeof fetch < "u")
|
|
539
541
|
return fetch;
|
|
540
|
-
|
|
542
|
+
P("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
541
543
|
}
|
|
542
544
|
static headers() {
|
|
543
545
|
if (this.headersImpl)
|
|
@@ -548,7 +550,7 @@ class Ct {
|
|
|
548
550
|
return globalThis.Headers;
|
|
549
551
|
if (typeof Headers < "u")
|
|
550
552
|
return Headers;
|
|
551
|
-
|
|
553
|
+
P("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
552
554
|
}
|
|
553
555
|
static response() {
|
|
554
556
|
if (this.responseImpl)
|
|
@@ -559,7 +561,7 @@ class Ct {
|
|
|
559
561
|
return globalThis.Response;
|
|
560
562
|
if (typeof Response < "u")
|
|
561
563
|
return Response;
|
|
562
|
-
|
|
564
|
+
P("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
563
565
|
}
|
|
564
566
|
}
|
|
565
567
|
/**
|
|
@@ -669,17 +671,17 @@ const li = {
|
|
|
669
671
|
* See the License for the specific language governing permissions and
|
|
670
672
|
* limitations under the License.
|
|
671
673
|
*/
|
|
672
|
-
const ui = new
|
|
673
|
-
function
|
|
674
|
+
const ui = new oe(3e4, 6e4);
|
|
675
|
+
function we(n, e) {
|
|
674
676
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
675
677
|
}
|
|
676
|
-
async function
|
|
678
|
+
async function J(n, e, t, i, r = {}) {
|
|
677
679
|
return Nt(n, r, async () => {
|
|
678
680
|
let s = {}, o = {};
|
|
679
681
|
i && (e === "GET" ? o = i : s = {
|
|
680
682
|
body: JSON.stringify(i)
|
|
681
683
|
});
|
|
682
|
-
const c =
|
|
684
|
+
const c = se(Object.assign({ key: n.config.apiKey }, o)).slice(1), a = await n._getAdditionalHeaders();
|
|
683
685
|
return a[
|
|
684
686
|
"Content-Type"
|
|
685
687
|
/* HttpHeader.CONTENT_TYPE */
|
|
@@ -704,31 +706,31 @@ async function Nt(n, e, t) {
|
|
|
704
706
|
r.clearNetworkTimeout();
|
|
705
707
|
const o = await s.json();
|
|
706
708
|
if ("needConfirmation" in o)
|
|
707
|
-
throw
|
|
709
|
+
throw le(n, "account-exists-with-different-credential", o);
|
|
708
710
|
if (s.ok && !("errorMessage" in o))
|
|
709
711
|
return o;
|
|
710
712
|
{
|
|
711
713
|
const c = s.ok ? o.errorMessage : o.error.message, [a, l] = c.split(" : ");
|
|
712
714
|
if (a === "FEDERATED_USER_ID_ALREADY_LINKED")
|
|
713
|
-
throw
|
|
715
|
+
throw le(n, "credential-already-in-use", o);
|
|
714
716
|
if (a === "EMAIL_EXISTS")
|
|
715
|
-
throw
|
|
717
|
+
throw le(n, "email-already-in-use", o);
|
|
716
718
|
if (a === "USER_DISABLED")
|
|
717
|
-
throw
|
|
719
|
+
throw le(n, "user-disabled", o);
|
|
718
720
|
const d = i[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
|
719
721
|
if (l)
|
|
720
722
|
throw Pt(n, d, l);
|
|
721
|
-
|
|
723
|
+
O(n, d);
|
|
722
724
|
}
|
|
723
725
|
} catch (r) {
|
|
724
726
|
if (r instanceof Ve)
|
|
725
727
|
throw r;
|
|
726
|
-
|
|
728
|
+
O(n, "network-request-failed", { message: String(r) });
|
|
727
729
|
}
|
|
728
730
|
}
|
|
729
731
|
async function Ot(n, e, t, i, r = {}) {
|
|
730
|
-
const s = await
|
|
731
|
-
return "mfaPendingCredential" in s &&
|
|
732
|
+
const s = await J(n, e, t, i, r);
|
|
733
|
+
return "mfaPendingCredential" in s && O(n, "multi-factor-auth-required", {
|
|
732
734
|
_serverResponse: s
|
|
733
735
|
}), s;
|
|
734
736
|
}
|
|
@@ -739,7 +741,7 @@ function Lt(n, e, t, i) {
|
|
|
739
741
|
class di {
|
|
740
742
|
constructor(e) {
|
|
741
743
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
742
|
-
this.timer = setTimeout(() => i(
|
|
744
|
+
this.timer = setTimeout(() => i(E(
|
|
743
745
|
this.auth,
|
|
744
746
|
"network-request-failed"
|
|
745
747
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
@@ -750,12 +752,12 @@ class di {
|
|
|
750
752
|
clearTimeout(this.timer);
|
|
751
753
|
}
|
|
752
754
|
}
|
|
753
|
-
function
|
|
755
|
+
function le(n, e, t) {
|
|
754
756
|
const i = {
|
|
755
757
|
appName: n.name
|
|
756
758
|
};
|
|
757
759
|
t.email && (i.email = t.email), t.phoneNumber && (i.phoneNumber = t.phoneNumber);
|
|
758
|
-
const r =
|
|
760
|
+
const r = E(n, e, i);
|
|
759
761
|
return r.customData._tokenResponse = t, r;
|
|
760
762
|
}
|
|
761
763
|
/**
|
|
@@ -775,10 +777,10 @@ function ae(n, e, t) {
|
|
|
775
777
|
* limitations under the License.
|
|
776
778
|
*/
|
|
777
779
|
async function hi(n, e) {
|
|
778
|
-
return
|
|
780
|
+
return J(n, "POST", "/v1/accounts:delete", e);
|
|
779
781
|
}
|
|
780
782
|
async function Mt(n, e) {
|
|
781
|
-
return
|
|
783
|
+
return J(n, "POST", "/v1/accounts:lookup", e);
|
|
782
784
|
}
|
|
783
785
|
/**
|
|
784
786
|
* @license
|
|
@@ -796,7 +798,7 @@ async function Mt(n, e) {
|
|
|
796
798
|
* See the License for the specific language governing permissions and
|
|
797
799
|
* limitations under the License.
|
|
798
800
|
*/
|
|
799
|
-
function
|
|
801
|
+
function te(n) {
|
|
800
802
|
if (n)
|
|
801
803
|
try {
|
|
802
804
|
const e = new Date(Number(n));
|
|
@@ -806,7 +808,7 @@ function ee(n) {
|
|
|
806
808
|
}
|
|
807
809
|
}
|
|
808
810
|
async function fi(n, e = !1) {
|
|
809
|
-
const t =
|
|
811
|
+
const t = K(n), i = await t.getIdToken(e), r = We(i);
|
|
810
812
|
u(
|
|
811
813
|
r && r.exp && r.auth_time && r.iat,
|
|
812
814
|
t.auth,
|
|
@@ -817,9 +819,9 @@ async function fi(n, e = !1) {
|
|
|
817
819
|
return {
|
|
818
820
|
claims: r,
|
|
819
821
|
token: i,
|
|
820
|
-
authTime:
|
|
821
|
-
issuedAtTime:
|
|
822
|
-
expirationTime:
|
|
822
|
+
authTime: te(Pe(r.auth_time)),
|
|
823
|
+
issuedAtTime: te(Pe(r.iat)),
|
|
824
|
+
expirationTime: te(Pe(r.exp)),
|
|
823
825
|
signInProvider: o || null,
|
|
824
826
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
|
825
827
|
};
|
|
@@ -830,12 +832,12 @@ function Pe(n) {
|
|
|
830
832
|
function We(n) {
|
|
831
833
|
const [e, t, i] = n.split(".");
|
|
832
834
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
833
|
-
return
|
|
835
|
+
return ue("JWT malformed, contained fewer than 3 sections"), null;
|
|
834
836
|
try {
|
|
835
837
|
const r = An(t);
|
|
836
|
-
return r ? JSON.parse(r) : (
|
|
838
|
+
return r ? JSON.parse(r) : (ue("Failed to decode base64 JWT payload"), null);
|
|
837
839
|
} catch (r) {
|
|
838
|
-
return
|
|
840
|
+
return ue("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
839
841
|
}
|
|
840
842
|
}
|
|
841
843
|
function it(n) {
|
|
@@ -870,7 +872,7 @@ function it(n) {
|
|
|
870
872
|
* See the License for the specific language governing permissions and
|
|
871
873
|
* limitations under the License.
|
|
872
874
|
*/
|
|
873
|
-
async function
|
|
875
|
+
async function ie(n, e, t = !1) {
|
|
874
876
|
if (t)
|
|
875
877
|
return e;
|
|
876
878
|
try {
|
|
@@ -965,7 +967,7 @@ class Me {
|
|
|
965
967
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
966
968
|
}
|
|
967
969
|
_initializeTime() {
|
|
968
|
-
this.lastSignInTime =
|
|
970
|
+
this.lastSignInTime = te(this.lastLoginAt), this.creationTime = te(this.createdAt);
|
|
969
971
|
}
|
|
970
972
|
_copy(e) {
|
|
971
973
|
this.createdAt = e.createdAt, this.lastLoginAt = e.lastLoginAt, this._initializeTime();
|
|
@@ -993,9 +995,9 @@ class Me {
|
|
|
993
995
|
* See the License for the specific language governing permissions and
|
|
994
996
|
* limitations under the License.
|
|
995
997
|
*/
|
|
996
|
-
async function
|
|
998
|
+
async function _e(n) {
|
|
997
999
|
var e;
|
|
998
|
-
const t = n.auth, i = await n.getIdToken(), r = await
|
|
1000
|
+
const t = n.auth, i = await n.getIdToken(), r = await ie(n, Mt(t, { idToken: i }));
|
|
999
1001
|
u(
|
|
1000
1002
|
r == null ? void 0 : r.users.length,
|
|
1001
1003
|
t,
|
|
@@ -1019,8 +1021,8 @@ async function ge(n) {
|
|
|
1019
1021
|
Object.assign(n, h);
|
|
1020
1022
|
}
|
|
1021
1023
|
async function gi(n) {
|
|
1022
|
-
const e =
|
|
1023
|
-
await
|
|
1024
|
+
const e = K(n);
|
|
1025
|
+
await _e(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
1024
1026
|
}
|
|
1025
1027
|
function _i(n, e) {
|
|
1026
1028
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
@@ -1056,7 +1058,7 @@ function Ut(n) {
|
|
|
1056
1058
|
*/
|
|
1057
1059
|
async function vi(n, e) {
|
|
1058
1060
|
const t = await Nt(n, {}, async () => {
|
|
1059
|
-
const i =
|
|
1061
|
+
const i = se({
|
|
1060
1062
|
grant_type: "refresh_token",
|
|
1061
1063
|
refresh_token: e
|
|
1062
1064
|
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o = Lt(n, r, "/v1/token", `key=${s}`), c = await n._getAdditionalHeaders();
|
|
@@ -1076,7 +1078,7 @@ async function vi(n, e) {
|
|
|
1076
1078
|
};
|
|
1077
1079
|
}
|
|
1078
1080
|
async function Ii(n, e) {
|
|
1079
|
-
return
|
|
1081
|
+
return J(n, "POST", "/v2/accounts:revokeToken", we(n, e));
|
|
1080
1082
|
}
|
|
1081
1083
|
/**
|
|
1082
1084
|
* @license
|
|
@@ -1094,7 +1096,7 @@ async function Ii(n, e) {
|
|
|
1094
1096
|
* See the License for the specific language governing permissions and
|
|
1095
1097
|
* limitations under the License.
|
|
1096
1098
|
*/
|
|
1097
|
-
class
|
|
1099
|
+
class B {
|
|
1098
1100
|
constructor() {
|
|
1099
1101
|
this.refreshToken = null, this.accessToken = null, this.expirationTime = null;
|
|
1100
1102
|
}
|
|
@@ -1146,7 +1148,7 @@ class G {
|
|
|
1146
1148
|
this.refreshToken = t || null, this.accessToken = e || null, this.expirationTime = Date.now() + i * 1e3;
|
|
1147
1149
|
}
|
|
1148
1150
|
static fromJSON(e, t) {
|
|
1149
|
-
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new
|
|
1151
|
+
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new B();
|
|
1150
1152
|
return i && (u(typeof i == "string", "internal-error", {
|
|
1151
1153
|
appName: e
|
|
1152
1154
|
}), o.refreshToken = i), r && (u(typeof r == "string", "internal-error", {
|
|
@@ -1166,10 +1168,10 @@ class G {
|
|
|
1166
1168
|
this.accessToken = e.accessToken, this.refreshToken = e.refreshToken, this.expirationTime = e.expirationTime;
|
|
1167
1169
|
}
|
|
1168
1170
|
_clone() {
|
|
1169
|
-
return Object.assign(new
|
|
1171
|
+
return Object.assign(new B(), this.toJSON());
|
|
1170
1172
|
}
|
|
1171
1173
|
_performRefresh() {
|
|
1172
|
-
return
|
|
1174
|
+
return P("not implemented");
|
|
1173
1175
|
}
|
|
1174
1176
|
}
|
|
1175
1177
|
/**
|
|
@@ -1188,16 +1190,16 @@ class G {
|
|
|
1188
1190
|
* See the License for the specific language governing permissions and
|
|
1189
1191
|
* limitations under the License.
|
|
1190
1192
|
*/
|
|
1191
|
-
function
|
|
1193
|
+
function U(n, e) {
|
|
1192
1194
|
u(typeof n == "string" || typeof n > "u", "internal-error", { appName: e });
|
|
1193
1195
|
}
|
|
1194
|
-
class
|
|
1196
|
+
class C {
|
|
1195
1197
|
constructor(e) {
|
|
1196
1198
|
var { uid: t, auth: i, stsTokenManager: r } = e, s = $e(e, ["uid", "auth", "stsTokenManager"]);
|
|
1197
1199
|
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);
|
|
1198
1200
|
}
|
|
1199
1201
|
async getIdToken(e) {
|
|
1200
|
-
const t = await
|
|
1202
|
+
const t = await ie(this, this.stsTokenManager.getToken(this.auth, e));
|
|
1201
1203
|
return u(
|
|
1202
1204
|
t,
|
|
1203
1205
|
this.auth,
|
|
@@ -1220,7 +1222,7 @@ class P {
|
|
|
1220
1222
|
), 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));
|
|
1221
1223
|
}
|
|
1222
1224
|
_clone(e) {
|
|
1223
|
-
const t = new
|
|
1225
|
+
const t = new C(Object.assign(Object.assign({}, this), { auth: e, stsTokenManager: this.stsTokenManager._clone() }));
|
|
1224
1226
|
return t.metadata._copy(this.metadata), t;
|
|
1225
1227
|
}
|
|
1226
1228
|
_onReload(e) {
|
|
@@ -1242,13 +1244,13 @@ class P {
|
|
|
1242
1244
|
}
|
|
1243
1245
|
async _updateTokensIfNecessary(e, t = !1) {
|
|
1244
1246
|
let i = !1;
|
|
1245
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await
|
|
1247
|
+
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);
|
|
1246
1248
|
}
|
|
1247
1249
|
async delete() {
|
|
1248
|
-
if (
|
|
1249
|
-
return Promise.reject(
|
|
1250
|
+
if (A(this.auth.app))
|
|
1251
|
+
return Promise.reject($(this.auth));
|
|
1250
1252
|
const e = await this.getIdToken();
|
|
1251
|
-
return await
|
|
1253
|
+
return await ie(this, hi(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
1252
1254
|
}
|
|
1253
1255
|
toJSON() {
|
|
1254
1256
|
return Object.assign(Object.assign({
|
|
@@ -1276,20 +1278,20 @@ class P {
|
|
|
1276
1278
|
}
|
|
1277
1279
|
static _fromJSON(e, t) {
|
|
1278
1280
|
var i, r, s, o, c, a, l, d;
|
|
1279
|
-
const h = (i = t.displayName) !== null && i !== void 0 ? i : void 0,
|
|
1281
|
+
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;
|
|
1280
1282
|
u(
|
|
1281
|
-
|
|
1283
|
+
k && Ye,
|
|
1282
1284
|
e,
|
|
1283
1285
|
"internal-error"
|
|
1284
1286
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1285
1287
|
);
|
|
1286
|
-
const on =
|
|
1288
|
+
const on = B.fromJSON(this.name, Ye);
|
|
1287
1289
|
u(
|
|
1288
|
-
typeof
|
|
1290
|
+
typeof k == "string",
|
|
1289
1291
|
e,
|
|
1290
1292
|
"internal-error"
|
|
1291
1293
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1292
|
-
),
|
|
1294
|
+
), U(h, e.name), U(m, e.name), u(
|
|
1293
1295
|
typeof Ke == "boolean",
|
|
1294
1296
|
e,
|
|
1295
1297
|
"internal-error"
|
|
@@ -1299,20 +1301,20 @@ class P {
|
|
|
1299
1301
|
e,
|
|
1300
1302
|
"internal-error"
|
|
1301
1303
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1302
|
-
),
|
|
1303
|
-
const Re = new
|
|
1304
|
-
uid:
|
|
1304
|
+
), U(I, e.name), U(w, e.name), U(g, e.name), U(v, e.name), U(T, e.name), U(M, e.name);
|
|
1305
|
+
const Re = new C({
|
|
1306
|
+
uid: k,
|
|
1305
1307
|
auth: e,
|
|
1306
|
-
email:
|
|
1308
|
+
email: m,
|
|
1307
1309
|
emailVerified: Ke,
|
|
1308
1310
|
displayName: h,
|
|
1309
1311
|
isAnonymous: Je,
|
|
1310
|
-
photoURL:
|
|
1311
|
-
phoneNumber:
|
|
1312
|
+
photoURL: w,
|
|
1313
|
+
phoneNumber: I,
|
|
1312
1314
|
tenantId: g,
|
|
1313
1315
|
stsTokenManager: on,
|
|
1314
|
-
createdAt:
|
|
1315
|
-
lastLoginAt:
|
|
1316
|
+
createdAt: T,
|
|
1317
|
+
lastLoginAt: M
|
|
1316
1318
|
});
|
|
1317
1319
|
return Se && Array.isArray(Se) && (Re.providerData = Se.map((an) => Object.assign({}, an))), v && (Re._redirectEventId = v), Re;
|
|
1318
1320
|
}
|
|
@@ -1322,15 +1324,15 @@ class P {
|
|
|
1322
1324
|
* @param idTokenResponse
|
|
1323
1325
|
*/
|
|
1324
1326
|
static async _fromIdTokenResponse(e, t, i = !1) {
|
|
1325
|
-
const r = new
|
|
1327
|
+
const r = new B();
|
|
1326
1328
|
r.updateFromServerResponse(t);
|
|
1327
|
-
const s = new
|
|
1329
|
+
const s = new C({
|
|
1328
1330
|
uid: t.localId,
|
|
1329
1331
|
auth: e,
|
|
1330
1332
|
stsTokenManager: r,
|
|
1331
1333
|
isAnonymous: i
|
|
1332
1334
|
});
|
|
1333
|
-
return await
|
|
1335
|
+
return await _e(s), s;
|
|
1334
1336
|
}
|
|
1335
1337
|
/**
|
|
1336
1338
|
* Initialize a User from an idToken server response
|
|
@@ -1344,9 +1346,9 @@ class P {
|
|
|
1344
1346
|
"internal-error"
|
|
1345
1347
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1346
1348
|
);
|
|
1347
|
-
const s = r.providerUserInfo !== void 0 ? Ut(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new
|
|
1349
|
+
const s = r.providerUserInfo !== void 0 ? Ut(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new B();
|
|
1348
1350
|
c.updateFromIdToken(i);
|
|
1349
|
-
const a = new
|
|
1351
|
+
const a = new C({
|
|
1350
1352
|
uid: r.localId,
|
|
1351
1353
|
auth: e,
|
|
1352
1354
|
stsTokenManager: c,
|
|
@@ -1383,10 +1385,10 @@ class P {
|
|
|
1383
1385
|
* limitations under the License.
|
|
1384
1386
|
*/
|
|
1385
1387
|
const rt = /* @__PURE__ */ new Map();
|
|
1386
|
-
function
|
|
1387
|
-
|
|
1388
|
+
function N(n) {
|
|
1389
|
+
L(n instanceof Function, "Expected a class definition");
|
|
1388
1390
|
let e = rt.get(n);
|
|
1389
|
-
return e ? (
|
|
1391
|
+
return e ? (L(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), rt.set(n, e), e);
|
|
1390
1392
|
}
|
|
1391
1393
|
/**
|
|
1392
1394
|
* @license
|
|
@@ -1444,21 +1446,21 @@ const st = Dt;
|
|
|
1444
1446
|
* See the License for the specific language governing permissions and
|
|
1445
1447
|
* limitations under the License.
|
|
1446
1448
|
*/
|
|
1447
|
-
function
|
|
1449
|
+
function de(n, e, t) {
|
|
1448
1450
|
return `firebase:${n}:${e}:${t}`;
|
|
1449
1451
|
}
|
|
1450
|
-
class
|
|
1452
|
+
class z {
|
|
1451
1453
|
constructor(e, t, i) {
|
|
1452
1454
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1453
1455
|
const { config: r, name: s } = this.auth;
|
|
1454
|
-
this.fullUserKey =
|
|
1456
|
+
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);
|
|
1455
1457
|
}
|
|
1456
1458
|
setCurrentUser(e) {
|
|
1457
1459
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
|
1458
1460
|
}
|
|
1459
1461
|
async getCurrentUser() {
|
|
1460
1462
|
const e = await this.persistence._get(this.fullUserKey);
|
|
1461
|
-
return e ?
|
|
1463
|
+
return e ? C._fromJSON(this.auth, e) : null;
|
|
1462
1464
|
}
|
|
1463
1465
|
removeCurrentUser() {
|
|
1464
1466
|
return this.persistence._remove(this.fullUserKey);
|
|
@@ -1478,32 +1480,32 @@ class B {
|
|
|
1478
1480
|
}
|
|
1479
1481
|
static async create(e, t, i = "authUser") {
|
|
1480
1482
|
if (!t.length)
|
|
1481
|
-
return new
|
|
1483
|
+
return new z(N(st), e, i);
|
|
1482
1484
|
const r = (await Promise.all(t.map(async (l) => {
|
|
1483
1485
|
if (await l._isAvailable())
|
|
1484
1486
|
return l;
|
|
1485
1487
|
}))).filter((l) => l);
|
|
1486
|
-
let s = r[0] ||
|
|
1487
|
-
const o =
|
|
1488
|
+
let s = r[0] || N(st);
|
|
1489
|
+
const o = de(i, e.config.apiKey, e.name);
|
|
1488
1490
|
let c = null;
|
|
1489
1491
|
for (const l of t)
|
|
1490
1492
|
try {
|
|
1491
1493
|
const d = await l._get(o);
|
|
1492
1494
|
if (d) {
|
|
1493
|
-
const h =
|
|
1495
|
+
const h = C._fromJSON(e, d);
|
|
1494
1496
|
l !== s && (c = h), s = l;
|
|
1495
1497
|
break;
|
|
1496
1498
|
}
|
|
1497
1499
|
} catch {
|
|
1498
1500
|
}
|
|
1499
1501
|
const a = r.filter((l) => l._shouldAllowMigration);
|
|
1500
|
-
return !s._shouldAllowMigration || !a.length ? new
|
|
1502
|
+
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) => {
|
|
1501
1503
|
if (l !== s)
|
|
1502
1504
|
try {
|
|
1503
1505
|
await l._remove(o);
|
|
1504
1506
|
} catch {
|
|
1505
1507
|
}
|
|
1506
|
-
})), new
|
|
1508
|
+
})), new z(s, e, i));
|
|
1507
1509
|
}
|
|
1508
1510
|
}
|
|
1509
1511
|
/**
|
|
@@ -1575,18 +1577,18 @@ function Ht(n = y()) {
|
|
|
1575
1577
|
function jt(n = y()) {
|
|
1576
1578
|
return /webos/i.test(n);
|
|
1577
1579
|
}
|
|
1578
|
-
function
|
|
1580
|
+
function Te(n = y()) {
|
|
1579
1581
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1580
1582
|
}
|
|
1581
1583
|
function yi(n = y()) {
|
|
1582
1584
|
var e;
|
|
1583
|
-
return
|
|
1585
|
+
return Te(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1584
1586
|
}
|
|
1585
1587
|
function wi() {
|
|
1586
1588
|
return Pn() && document.documentMode === 10;
|
|
1587
1589
|
}
|
|
1588
1590
|
function Wt(n = y()) {
|
|
1589
|
-
return
|
|
1591
|
+
return Te(n) || $t(n) || jt(n) || Ht(n) || /windows phone/i.test(n) || Vt(n);
|
|
1590
1592
|
}
|
|
1591
1593
|
function Ti() {
|
|
1592
1594
|
try {
|
|
@@ -1624,7 +1626,7 @@ function Gt(n, e = []) {
|
|
|
1624
1626
|
t = n;
|
|
1625
1627
|
}
|
|
1626
1628
|
const i = e.length ? e.join(",") : "FirebaseCore-web";
|
|
1627
|
-
return `${t}/JsCore/${
|
|
1629
|
+
return `${t}/JsCore/${re}/${i}`;
|
|
1628
1630
|
}
|
|
1629
1631
|
/**
|
|
1630
1632
|
* @license
|
|
@@ -1698,7 +1700,7 @@ class ki {
|
|
|
1698
1700
|
* limitations under the License.
|
|
1699
1701
|
*/
|
|
1700
1702
|
async function Ei(n, e = {}) {
|
|
1701
|
-
return
|
|
1703
|
+
return J(n, "GET", "/v2/passwordPolicy", we(n, e));
|
|
1702
1704
|
}
|
|
1703
1705
|
/**
|
|
1704
1706
|
* @license
|
|
@@ -1809,9 +1811,9 @@ class Ri {
|
|
|
1809
1811
|
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;
|
|
1810
1812
|
}
|
|
1811
1813
|
_initializeWithPersistence(e, t) {
|
|
1812
|
-
return t && (this._popupRedirectResolver =
|
|
1814
|
+
return t && (this._popupRedirectResolver = N(t)), this._initializationPromise = this.queue(async () => {
|
|
1813
1815
|
var i, r;
|
|
1814
|
-
if (!this._deleted && (this.persistenceManager = await
|
|
1816
|
+
if (!this._deleted && (this.persistenceManager = await z.create(this, e), !this._deleted)) {
|
|
1815
1817
|
if (!((i = this._popupRedirectResolver) === null || i === void 0) && i._shouldInitProactively)
|
|
1816
1818
|
try {
|
|
1817
1819
|
await this._popupRedirectResolver._initialize(this);
|
|
@@ -1842,7 +1844,7 @@ class Ri {
|
|
|
1842
1844
|
}
|
|
1843
1845
|
async initializeCurrentUserFromIdToken(e) {
|
|
1844
1846
|
try {
|
|
1845
|
-
const t = await Mt(this, { idToken: e }), i = await
|
|
1847
|
+
const t = await Mt(this, { idToken: e }), i = await C._fromGetAccountInfoResponse(this, t, e);
|
|
1846
1848
|
await this.directlySetCurrentUser(i);
|
|
1847
1849
|
} catch (t) {
|
|
1848
1850
|
console.warn("FirebaseServerApp could not login user with provided authIdToken: ", t), await this.directlySetCurrentUser(null);
|
|
@@ -1850,7 +1852,7 @@ class Ri {
|
|
|
1850
1852
|
}
|
|
1851
1853
|
async initializeCurrentUser(e) {
|
|
1852
1854
|
var t;
|
|
1853
|
-
if (
|
|
1855
|
+
if (A(this.app)) {
|
|
1854
1856
|
const o = this.app.settings.authIdToken;
|
|
1855
1857
|
return o ? new Promise((c) => {
|
|
1856
1858
|
setTimeout(() => this.initializeCurrentUserFromIdToken(o).then(c, c));
|
|
@@ -1892,7 +1894,7 @@ class Ri {
|
|
|
1892
1894
|
}
|
|
1893
1895
|
async reloadAndSetCurrentUserOrClear(e) {
|
|
1894
1896
|
try {
|
|
1895
|
-
await
|
|
1897
|
+
await _e(e);
|
|
1896
1898
|
} catch (t) {
|
|
1897
1899
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
|
1898
1900
|
return this.directlySetCurrentUser(null);
|
|
@@ -1906,9 +1908,9 @@ class Ri {
|
|
|
1906
1908
|
this._deleted = !0;
|
|
1907
1909
|
}
|
|
1908
1910
|
async updateCurrentUser(e) {
|
|
1909
|
-
if (
|
|
1910
|
-
return Promise.reject(
|
|
1911
|
-
const t = e ?
|
|
1911
|
+
if (A(this.app))
|
|
1912
|
+
return Promise.reject($(this));
|
|
1913
|
+
const t = e ? K(e) : null;
|
|
1912
1914
|
return t && u(
|
|
1913
1915
|
t.auth.config.apiKey === this.config.apiKey,
|
|
1914
1916
|
this,
|
|
@@ -1928,15 +1930,15 @@ class Ri {
|
|
|
1928
1930
|
});
|
|
1929
1931
|
}
|
|
1930
1932
|
async signOut() {
|
|
1931
|
-
return
|
|
1933
|
+
return A(this.app) ? Promise.reject($(this)) : (await this.beforeStateQueue.runMiddleware(null), (this.redirectPersistenceManager || this._popupRedirectResolver) && await this._setRedirectUser(null), this._updateCurrentUser(
|
|
1932
1934
|
null,
|
|
1933
1935
|
/* skipBeforeStateCallbacks */
|
|
1934
1936
|
!0
|
|
1935
1937
|
));
|
|
1936
1938
|
}
|
|
1937
1939
|
setPersistence(e) {
|
|
1938
|
-
return
|
|
1939
|
-
await this.assertedPersistence.setPersistence(
|
|
1940
|
+
return A(this.app) ? Promise.reject($(this)) : this.queue(async () => {
|
|
1941
|
+
await this.assertedPersistence.setPersistence(N(e));
|
|
1940
1942
|
});
|
|
1941
1943
|
}
|
|
1942
1944
|
_getRecaptchaConfig() {
|
|
@@ -2009,15 +2011,15 @@ class Ri {
|
|
|
2009
2011
|
}
|
|
2010
2012
|
async getOrInitRedirectPersistenceManager(e) {
|
|
2011
2013
|
if (!this.redirectPersistenceManager) {
|
|
2012
|
-
const t = e &&
|
|
2014
|
+
const t = e && N(e) || this._popupRedirectResolver;
|
|
2013
2015
|
u(
|
|
2014
2016
|
t,
|
|
2015
2017
|
this,
|
|
2016
2018
|
"argument-error"
|
|
2017
2019
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2018
|
-
), this.redirectPersistenceManager = await
|
|
2020
|
+
), this.redirectPersistenceManager = await z.create(
|
|
2019
2021
|
this,
|
|
2020
|
-
[
|
|
2022
|
+
[N(t._redirectPersistence)],
|
|
2021
2023
|
"redirectUser"
|
|
2022
2024
|
/* KeyName.REDIRECT_USER */
|
|
2023
2025
|
), this.redirectUser = await this.redirectPersistenceManager.getCurrentUser();
|
|
@@ -2137,8 +2139,8 @@ class Ri {
|
|
|
2137
2139
|
return t != null && t.error && si(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
2138
2140
|
}
|
|
2139
2141
|
}
|
|
2140
|
-
function
|
|
2141
|
-
return
|
|
2142
|
+
function ke(n) {
|
|
2143
|
+
return K(n);
|
|
2142
2144
|
}
|
|
2143
2145
|
class at {
|
|
2144
2146
|
constructor(e) {
|
|
@@ -2211,7 +2213,7 @@ function Oi(n, e) {
|
|
|
2211
2213
|
const r = t.getImmediate(), s = t.getOptions();
|
|
2212
2214
|
if (Rn(s, e ?? {}))
|
|
2213
2215
|
return r;
|
|
2214
|
-
|
|
2216
|
+
O(
|
|
2215
2217
|
r,
|
|
2216
2218
|
"already-initialized"
|
|
2217
2219
|
/* AuthErrorCode.ALREADY_INITIALIZED */
|
|
@@ -2220,11 +2222,11 @@ function Oi(n, e) {
|
|
|
2220
2222
|
return t.initialize({ options: e });
|
|
2221
2223
|
}
|
|
2222
2224
|
function Li(n, e) {
|
|
2223
|
-
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(
|
|
2225
|
+
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(N);
|
|
2224
2226
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2225
2227
|
}
|
|
2226
2228
|
function Mi(n, e, t) {
|
|
2227
|
-
const i =
|
|
2229
|
+
const i = ke(n);
|
|
2228
2230
|
u(
|
|
2229
2231
|
i._canInitEmulator,
|
|
2230
2232
|
i,
|
|
@@ -2301,19 +2303,19 @@ class zt {
|
|
|
2301
2303
|
* @returns a JSON-serializable representation of this object.
|
|
2302
2304
|
*/
|
|
2303
2305
|
toJSON() {
|
|
2304
|
-
return
|
|
2306
|
+
return P("not implemented");
|
|
2305
2307
|
}
|
|
2306
2308
|
/** @internal */
|
|
2307
2309
|
_getIdTokenResponse(e) {
|
|
2308
|
-
return
|
|
2310
|
+
return P("not implemented");
|
|
2309
2311
|
}
|
|
2310
2312
|
/** @internal */
|
|
2311
2313
|
_linkToIdToken(e, t) {
|
|
2312
|
-
return
|
|
2314
|
+
return P("not implemented");
|
|
2313
2315
|
}
|
|
2314
2316
|
/** @internal */
|
|
2315
2317
|
_getReauthenticationResolver(e) {
|
|
2316
|
-
return
|
|
2318
|
+
return P("not implemented");
|
|
2317
2319
|
}
|
|
2318
2320
|
}
|
|
2319
2321
|
/**
|
|
@@ -2332,8 +2334,8 @@ class zt {
|
|
|
2332
2334
|
* See the License for the specific language governing permissions and
|
|
2333
2335
|
* limitations under the License.
|
|
2334
2336
|
*/
|
|
2335
|
-
async function
|
|
2336
|
-
return Ot(n, "POST", "/v1/accounts:signInWithIdp",
|
|
2337
|
+
async function q(n, e) {
|
|
2338
|
+
return Ot(n, "POST", "/v1/accounts:signInWithIdp", we(n, e));
|
|
2337
2339
|
}
|
|
2338
2340
|
/**
|
|
2339
2341
|
* @license
|
|
@@ -2352,14 +2354,14 @@ async function z(n, e) {
|
|
|
2352
2354
|
* limitations under the License.
|
|
2353
2355
|
*/
|
|
2354
2356
|
const xi = "http://localhost";
|
|
2355
|
-
class
|
|
2357
|
+
class j extends zt {
|
|
2356
2358
|
constructor() {
|
|
2357
2359
|
super(...arguments), this.pendingToken = null;
|
|
2358
2360
|
}
|
|
2359
2361
|
/** @internal */
|
|
2360
2362
|
static _fromParams(e) {
|
|
2361
|
-
const t = new
|
|
2362
|
-
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) :
|
|
2363
|
+
const t = new j(e.providerId, e.signInMethod);
|
|
2364
|
+
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(
|
|
2363
2365
|
"argument-error"
|
|
2364
2366
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2365
2367
|
), t;
|
|
@@ -2389,23 +2391,23 @@ class $ extends zt {
|
|
|
2389
2391
|
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = $e(t, ["providerId", "signInMethod"]);
|
|
2390
2392
|
if (!i || !r)
|
|
2391
2393
|
return null;
|
|
2392
|
-
const o = new
|
|
2394
|
+
const o = new j(i, r);
|
|
2393
2395
|
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;
|
|
2394
2396
|
}
|
|
2395
2397
|
/** @internal */
|
|
2396
2398
|
_getIdTokenResponse(e) {
|
|
2397
2399
|
const t = this.buildRequest();
|
|
2398
|
-
return
|
|
2400
|
+
return q(e, t);
|
|
2399
2401
|
}
|
|
2400
2402
|
/** @internal */
|
|
2401
2403
|
_linkToIdToken(e, t) {
|
|
2402
2404
|
const i = this.buildRequest();
|
|
2403
|
-
return i.idToken = t,
|
|
2405
|
+
return i.idToken = t, q(e, i);
|
|
2404
2406
|
}
|
|
2405
2407
|
/** @internal */
|
|
2406
2408
|
_getReauthenticationResolver(e) {
|
|
2407
2409
|
const t = this.buildRequest();
|
|
2408
|
-
return t.autoCreate = !1,
|
|
2410
|
+
return t.autoCreate = !1, q(e, t);
|
|
2409
2411
|
}
|
|
2410
2412
|
buildRequest() {
|
|
2411
2413
|
const e = {
|
|
@@ -2416,7 +2418,7 @@ class $ extends zt {
|
|
|
2416
2418
|
e.pendingToken = this.pendingToken;
|
|
2417
2419
|
else {
|
|
2418
2420
|
const t = {};
|
|
2419
|
-
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 =
|
|
2421
|
+
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);
|
|
2420
2422
|
}
|
|
2421
2423
|
return e;
|
|
2422
2424
|
}
|
|
@@ -2490,7 +2492,7 @@ class qt {
|
|
|
2490
2492
|
* See the License for the specific language governing permissions and
|
|
2491
2493
|
* limitations under the License.
|
|
2492
2494
|
*/
|
|
2493
|
-
class
|
|
2495
|
+
class ae extends qt {
|
|
2494
2496
|
constructor() {
|
|
2495
2497
|
super(...arguments), this.scopes = [];
|
|
2496
2498
|
}
|
|
@@ -2525,7 +2527,7 @@ class se extends qt {
|
|
|
2525
2527
|
* See the License for the specific language governing permissions and
|
|
2526
2528
|
* limitations under the License.
|
|
2527
2529
|
*/
|
|
2528
|
-
class
|
|
2530
|
+
class D extends ae {
|
|
2529
2531
|
constructor() {
|
|
2530
2532
|
super(
|
|
2531
2533
|
"facebook.com"
|
|
@@ -2545,9 +2547,9 @@ class M extends se {
|
|
|
2545
2547
|
* @param accessToken - Facebook access token.
|
|
2546
2548
|
*/
|
|
2547
2549
|
static credential(e) {
|
|
2548
|
-
return
|
|
2549
|
-
providerId:
|
|
2550
|
-
signInMethod:
|
|
2550
|
+
return j._fromParams({
|
|
2551
|
+
providerId: D.PROVIDER_ID,
|
|
2552
|
+
signInMethod: D.FACEBOOK_SIGN_IN_METHOD,
|
|
2551
2553
|
accessToken: e
|
|
2552
2554
|
});
|
|
2553
2555
|
}
|
|
@@ -2557,7 +2559,7 @@ class M extends se {
|
|
|
2557
2559
|
* @param userCredential - The user credential.
|
|
2558
2560
|
*/
|
|
2559
2561
|
static credentialFromResult(e) {
|
|
2560
|
-
return
|
|
2562
|
+
return D.credentialFromTaggedObject(e);
|
|
2561
2563
|
}
|
|
2562
2564
|
/**
|
|
2563
2565
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2566,20 +2568,20 @@ class M extends se {
|
|
|
2566
2568
|
* @param userCredential - The user credential.
|
|
2567
2569
|
*/
|
|
2568
2570
|
static credentialFromError(e) {
|
|
2569
|
-
return
|
|
2571
|
+
return D.credentialFromTaggedObject(e.customData || {});
|
|
2570
2572
|
}
|
|
2571
2573
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2572
2574
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
2573
2575
|
return null;
|
|
2574
2576
|
try {
|
|
2575
|
-
return
|
|
2577
|
+
return D.credential(e.oauthAccessToken);
|
|
2576
2578
|
} catch {
|
|
2577
2579
|
return null;
|
|
2578
2580
|
}
|
|
2579
2581
|
}
|
|
2580
2582
|
}
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
+
D.FACEBOOK_SIGN_IN_METHOD = "facebook.com";
|
|
2584
|
+
D.PROVIDER_ID = "facebook.com";
|
|
2583
2585
|
/**
|
|
2584
2586
|
* @license
|
|
2585
2587
|
* Copyright 2020 Google LLC
|
|
@@ -2596,7 +2598,7 @@ M.PROVIDER_ID = "facebook.com";
|
|
|
2596
2598
|
* See the License for the specific language governing permissions and
|
|
2597
2599
|
* limitations under the License.
|
|
2598
2600
|
*/
|
|
2599
|
-
class
|
|
2601
|
+
class x extends ae {
|
|
2600
2602
|
constructor() {
|
|
2601
2603
|
super(
|
|
2602
2604
|
"google.com"
|
|
@@ -2617,9 +2619,9 @@ class U extends se {
|
|
|
2617
2619
|
* @param accessToken - Google access token.
|
|
2618
2620
|
*/
|
|
2619
2621
|
static credential(e, t) {
|
|
2620
|
-
return
|
|
2621
|
-
providerId:
|
|
2622
|
-
signInMethod:
|
|
2622
|
+
return j._fromParams({
|
|
2623
|
+
providerId: x.PROVIDER_ID,
|
|
2624
|
+
signInMethod: x.GOOGLE_SIGN_IN_METHOD,
|
|
2623
2625
|
idToken: e,
|
|
2624
2626
|
accessToken: t
|
|
2625
2627
|
});
|
|
@@ -2630,7 +2632,7 @@ class U extends se {
|
|
|
2630
2632
|
* @param userCredential - The user credential.
|
|
2631
2633
|
*/
|
|
2632
2634
|
static credentialFromResult(e) {
|
|
2633
|
-
return
|
|
2635
|
+
return x.credentialFromTaggedObject(e);
|
|
2634
2636
|
}
|
|
2635
2637
|
/**
|
|
2636
2638
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2639,7 +2641,7 @@ class U extends se {
|
|
|
2639
2641
|
* @param userCredential - The user credential.
|
|
2640
2642
|
*/
|
|
2641
2643
|
static credentialFromError(e) {
|
|
2642
|
-
return
|
|
2644
|
+
return x.credentialFromTaggedObject(e.customData || {});
|
|
2643
2645
|
}
|
|
2644
2646
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2645
2647
|
if (!e)
|
|
@@ -2648,14 +2650,14 @@ class U extends se {
|
|
|
2648
2650
|
if (!t && !i)
|
|
2649
2651
|
return null;
|
|
2650
2652
|
try {
|
|
2651
|
-
return
|
|
2653
|
+
return x.credential(t, i);
|
|
2652
2654
|
} catch {
|
|
2653
2655
|
return null;
|
|
2654
2656
|
}
|
|
2655
2657
|
}
|
|
2656
2658
|
}
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
+
x.GOOGLE_SIGN_IN_METHOD = "google.com";
|
|
2660
|
+
x.PROVIDER_ID = "google.com";
|
|
2659
2661
|
/**
|
|
2660
2662
|
* @license
|
|
2661
2663
|
* Copyright 2020 Google LLC
|
|
@@ -2672,7 +2674,7 @@ U.PROVIDER_ID = "google.com";
|
|
|
2672
2674
|
* See the License for the specific language governing permissions and
|
|
2673
2675
|
* limitations under the License.
|
|
2674
2676
|
*/
|
|
2675
|
-
class
|
|
2677
|
+
class F extends ae {
|
|
2676
2678
|
constructor() {
|
|
2677
2679
|
super(
|
|
2678
2680
|
"github.com"
|
|
@@ -2685,9 +2687,9 @@ class D extends se {
|
|
|
2685
2687
|
* @param accessToken - Github access token.
|
|
2686
2688
|
*/
|
|
2687
2689
|
static credential(e) {
|
|
2688
|
-
return
|
|
2689
|
-
providerId:
|
|
2690
|
-
signInMethod:
|
|
2690
|
+
return j._fromParams({
|
|
2691
|
+
providerId: F.PROVIDER_ID,
|
|
2692
|
+
signInMethod: F.GITHUB_SIGN_IN_METHOD,
|
|
2691
2693
|
accessToken: e
|
|
2692
2694
|
});
|
|
2693
2695
|
}
|
|
@@ -2697,7 +2699,7 @@ class D extends se {
|
|
|
2697
2699
|
* @param userCredential - The user credential.
|
|
2698
2700
|
*/
|
|
2699
2701
|
static credentialFromResult(e) {
|
|
2700
|
-
return
|
|
2702
|
+
return F.credentialFromTaggedObject(e);
|
|
2701
2703
|
}
|
|
2702
2704
|
/**
|
|
2703
2705
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2706,20 +2708,20 @@ class D extends se {
|
|
|
2706
2708
|
* @param userCredential - The user credential.
|
|
2707
2709
|
*/
|
|
2708
2710
|
static credentialFromError(e) {
|
|
2709
|
-
return
|
|
2711
|
+
return F.credentialFromTaggedObject(e.customData || {});
|
|
2710
2712
|
}
|
|
2711
2713
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2712
2714
|
if (!e || !("oauthAccessToken" in e) || !e.oauthAccessToken)
|
|
2713
2715
|
return null;
|
|
2714
2716
|
try {
|
|
2715
|
-
return
|
|
2717
|
+
return F.credential(e.oauthAccessToken);
|
|
2716
2718
|
} catch {
|
|
2717
2719
|
return null;
|
|
2718
2720
|
}
|
|
2719
2721
|
}
|
|
2720
2722
|
}
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
+
F.GITHUB_SIGN_IN_METHOD = "github.com";
|
|
2724
|
+
F.PROVIDER_ID = "github.com";
|
|
2723
2725
|
/**
|
|
2724
2726
|
* @license
|
|
2725
2727
|
* Copyright 2020 Google LLC
|
|
@@ -2736,7 +2738,7 @@ D.PROVIDER_ID = "github.com";
|
|
|
2736
2738
|
* See the License for the specific language governing permissions and
|
|
2737
2739
|
* limitations under the License.
|
|
2738
2740
|
*/
|
|
2739
|
-
class
|
|
2741
|
+
class V extends ae {
|
|
2740
2742
|
constructor() {
|
|
2741
2743
|
super(
|
|
2742
2744
|
"twitter.com"
|
|
@@ -2750,9 +2752,9 @@ class x extends se {
|
|
|
2750
2752
|
* @param secret - Twitter secret.
|
|
2751
2753
|
*/
|
|
2752
2754
|
static credential(e, t) {
|
|
2753
|
-
return
|
|
2754
|
-
providerId:
|
|
2755
|
-
signInMethod:
|
|
2755
|
+
return j._fromParams({
|
|
2756
|
+
providerId: V.PROVIDER_ID,
|
|
2757
|
+
signInMethod: V.TWITTER_SIGN_IN_METHOD,
|
|
2756
2758
|
oauthToken: e,
|
|
2757
2759
|
oauthTokenSecret: t
|
|
2758
2760
|
});
|
|
@@ -2763,7 +2765,7 @@ class x extends se {
|
|
|
2763
2765
|
* @param userCredential - The user credential.
|
|
2764
2766
|
*/
|
|
2765
2767
|
static credentialFromResult(e) {
|
|
2766
|
-
return
|
|
2768
|
+
return V.credentialFromTaggedObject(e);
|
|
2767
2769
|
}
|
|
2768
2770
|
/**
|
|
2769
2771
|
* Used to extract the underlying {@link OAuthCredential} from a {@link AuthError} which was
|
|
@@ -2772,7 +2774,7 @@ class x extends se {
|
|
|
2772
2774
|
* @param userCredential - The user credential.
|
|
2773
2775
|
*/
|
|
2774
2776
|
static credentialFromError(e) {
|
|
2775
|
-
return
|
|
2777
|
+
return V.credentialFromTaggedObject(e.customData || {});
|
|
2776
2778
|
}
|
|
2777
2779
|
static credentialFromTaggedObject({ _tokenResponse: e }) {
|
|
2778
2780
|
if (!e)
|
|
@@ -2781,14 +2783,14 @@ class x extends se {
|
|
|
2781
2783
|
if (!t || !i)
|
|
2782
2784
|
return null;
|
|
2783
2785
|
try {
|
|
2784
|
-
return
|
|
2786
|
+
return V.credential(t, i);
|
|
2785
2787
|
} catch {
|
|
2786
2788
|
return null;
|
|
2787
2789
|
}
|
|
2788
2790
|
}
|
|
2789
2791
|
}
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
+
V.TWITTER_SIGN_IN_METHOD = "twitter.com";
|
|
2793
|
+
V.PROVIDER_ID = "twitter.com";
|
|
2792
2794
|
/**
|
|
2793
2795
|
* @license
|
|
2794
2796
|
* Copyright 2020 Google LLC
|
|
@@ -2805,13 +2807,13 @@ x.PROVIDER_ID = "twitter.com";
|
|
|
2805
2807
|
* See the License for the specific language governing permissions and
|
|
2806
2808
|
* limitations under the License.
|
|
2807
2809
|
*/
|
|
2808
|
-
class
|
|
2810
|
+
class W {
|
|
2809
2811
|
constructor(e) {
|
|
2810
2812
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2811
2813
|
}
|
|
2812
2814
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2813
|
-
const s = await
|
|
2814
|
-
return new
|
|
2815
|
+
const s = await C._fromIdTokenResponse(e, i, r), o = lt(i);
|
|
2816
|
+
return new W({
|
|
2815
2817
|
user: s,
|
|
2816
2818
|
providerId: o,
|
|
2817
2819
|
_tokenResponse: i,
|
|
@@ -2825,7 +2827,7 @@ class H {
|
|
|
2825
2827
|
!0
|
|
2826
2828
|
);
|
|
2827
2829
|
const r = lt(i);
|
|
2828
|
-
return new
|
|
2830
|
+
return new W({
|
|
2829
2831
|
user: e,
|
|
2830
2832
|
providerId: r,
|
|
2831
2833
|
_tokenResponse: i,
|
|
@@ -2852,10 +2854,10 @@ function lt(n) {
|
|
|
2852
2854
|
* See the License for the specific language governing permissions and
|
|
2853
2855
|
* limitations under the License.
|
|
2854
2856
|
*/
|
|
2855
|
-
class
|
|
2857
|
+
class ve extends Ve {
|
|
2856
2858
|
constructor(e, t, i, r) {
|
|
2857
2859
|
var s;
|
|
2858
|
-
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this,
|
|
2860
|
+
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this, ve.prototype), this.customData = {
|
|
2859
2861
|
appName: e.name,
|
|
2860
2862
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
|
2861
2863
|
_serverResponse: t.customData._serverResponse,
|
|
@@ -2863,17 +2865,17 @@ class _e extends Ve {
|
|
|
2863
2865
|
};
|
|
2864
2866
|
}
|
|
2865
2867
|
static _fromErrorAndOperation(e, t, i, r) {
|
|
2866
|
-
return new
|
|
2868
|
+
return new ve(e, t, i, r);
|
|
2867
2869
|
}
|
|
2868
2870
|
}
|
|
2869
2871
|
function Kt(n, e, t, i) {
|
|
2870
2872
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2871
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
|
2873
|
+
throw s.code === "auth/multi-factor-auth-required" ? ve._fromErrorAndOperation(n, s, e, i) : s;
|
|
2872
2874
|
});
|
|
2873
2875
|
}
|
|
2874
2876
|
async function Fi(n, e, t = !1) {
|
|
2875
|
-
const i = await
|
|
2876
|
-
return
|
|
2877
|
+
const i = await ie(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2878
|
+
return W._forOperation(n, "link", i);
|
|
2877
2879
|
}
|
|
2878
2880
|
/**
|
|
2879
2881
|
* @license
|
|
@@ -2893,11 +2895,11 @@ async function Fi(n, e, t = !1) {
|
|
|
2893
2895
|
*/
|
|
2894
2896
|
async function Vi(n, e, t = !1) {
|
|
2895
2897
|
const { auth: i } = n;
|
|
2896
|
-
if (
|
|
2897
|
-
return Promise.reject(
|
|
2898
|
+
if (A(i.app))
|
|
2899
|
+
return Promise.reject($(i));
|
|
2898
2900
|
const r = "reauthenticate";
|
|
2899
2901
|
try {
|
|
2900
|
-
const s = await
|
|
2902
|
+
const s = await ie(n, Kt(i, r, e, n), t);
|
|
2901
2903
|
u(
|
|
2902
2904
|
s.idToken,
|
|
2903
2905
|
i,
|
|
@@ -2917,9 +2919,9 @@ async function Vi(n, e, t = !1) {
|
|
|
2917
2919
|
i,
|
|
2918
2920
|
"user-mismatch"
|
|
2919
2921
|
/* AuthErrorCode.USER_MISMATCH */
|
|
2920
|
-
),
|
|
2922
|
+
), W._forOperation(n, r, s);
|
|
2921
2923
|
} catch (s) {
|
|
2922
|
-
throw (s == null ? void 0 : s.code) === "auth/user-not-found" &&
|
|
2924
|
+
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && O(
|
|
2923
2925
|
i,
|
|
2924
2926
|
"user-mismatch"
|
|
2925
2927
|
/* AuthErrorCode.USER_MISMATCH */
|
|
@@ -2943,9 +2945,9 @@ async function Vi(n, e, t = !1) {
|
|
|
2943
2945
|
* limitations under the License.
|
|
2944
2946
|
*/
|
|
2945
2947
|
async function $i(n, e, t = !1) {
|
|
2946
|
-
if (
|
|
2947
|
-
return Promise.reject(
|
|
2948
|
-
const i = "signIn", r = await Kt(n, i, e), s = await
|
|
2948
|
+
if (A(n.app))
|
|
2949
|
+
return Promise.reject($(n));
|
|
2950
|
+
const i = "signIn", r = await Kt(n, i, e), s = await W._fromIdTokenResponse(n, i, r);
|
|
2949
2951
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2950
2952
|
}
|
|
2951
2953
|
/**
|
|
@@ -2965,7 +2967,7 @@ async function $i(n, e, t = !1) {
|
|
|
2965
2967
|
* limitations under the License.
|
|
2966
2968
|
*/
|
|
2967
2969
|
async function Hi(n, e) {
|
|
2968
|
-
return Ot(n, "POST", "/v1/accounts:signInWithCustomToken",
|
|
2970
|
+
return Ot(n, "POST", "/v1/accounts:signInWithCustomToken", we(n, e));
|
|
2969
2971
|
}
|
|
2970
2972
|
/**
|
|
2971
2973
|
* @license
|
|
@@ -2984,21 +2986,21 @@ async function Hi(n, e) {
|
|
|
2984
2986
|
* limitations under the License.
|
|
2985
2987
|
*/
|
|
2986
2988
|
async function ji(n, e) {
|
|
2987
|
-
if (
|
|
2988
|
-
return Promise.reject(
|
|
2989
|
-
const t =
|
|
2989
|
+
if (A(n.app))
|
|
2990
|
+
return Promise.reject($(n));
|
|
2991
|
+
const t = ke(n), i = await Hi(t, {
|
|
2990
2992
|
token: e,
|
|
2991
2993
|
returnSecureToken: !0
|
|
2992
|
-
}), r = await
|
|
2994
|
+
}), r = await W._fromIdTokenResponse(t, "signIn", i);
|
|
2993
2995
|
return await t._updateCurrentUser(r.user), r;
|
|
2994
2996
|
}
|
|
2995
2997
|
function Wi(n, e, t, i) {
|
|
2996
|
-
return
|
|
2998
|
+
return K(n).onIdTokenChanged(e, t, i);
|
|
2997
2999
|
}
|
|
2998
3000
|
function Gi(n, e, t) {
|
|
2999
|
-
return
|
|
3001
|
+
return K(n).beforeAuthStateChanged(e, t);
|
|
3000
3002
|
}
|
|
3001
|
-
const
|
|
3003
|
+
const Ie = "__sak";
|
|
3002
3004
|
/**
|
|
3003
3005
|
* @license
|
|
3004
3006
|
* Copyright 2019 Google LLC
|
|
@@ -3021,7 +3023,7 @@ class Jt {
|
|
|
3021
3023
|
}
|
|
3022
3024
|
_isAvailable() {
|
|
3023
3025
|
try {
|
|
3024
|
-
return this.storage ? (this.storage.setItem(
|
|
3026
|
+
return this.storage ? (this.storage.setItem(Ie, "1"), this.storage.removeItem(Ie), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
3025
3027
|
} catch {
|
|
3026
3028
|
return Promise.resolve(!1);
|
|
3027
3029
|
}
|
|
@@ -3058,7 +3060,7 @@ class Jt {
|
|
|
3058
3060
|
*/
|
|
3059
3061
|
function Bi() {
|
|
3060
3062
|
const n = y();
|
|
3061
|
-
return Ge(n) ||
|
|
3063
|
+
return Ge(n) || Te(n);
|
|
3062
3064
|
}
|
|
3063
3065
|
const zi = 1e3, qi = 10;
|
|
3064
3066
|
class Yt extends Jt {
|
|
@@ -3225,7 +3227,7 @@ function Ji(n) {
|
|
|
3225
3227
|
* See the License for the specific language governing permissions and
|
|
3226
3228
|
* limitations under the License.
|
|
3227
3229
|
*/
|
|
3228
|
-
class
|
|
3230
|
+
class Ee {
|
|
3229
3231
|
constructor(e) {
|
|
3230
3232
|
this.eventTarget = e, this.handlersMap = {}, this.boundEventHandler = this.handleEvent.bind(this);
|
|
3231
3233
|
}
|
|
@@ -3239,7 +3241,7 @@ class ke {
|
|
|
3239
3241
|
const t = this.receivers.find((r) => r.isListeningto(e));
|
|
3240
3242
|
if (t)
|
|
3241
3243
|
return t;
|
|
3242
|
-
const i = new
|
|
3244
|
+
const i = new Ee(e);
|
|
3243
3245
|
return this.receivers.push(i), i;
|
|
3244
3246
|
}
|
|
3245
3247
|
isListeningto(e) {
|
|
@@ -3293,7 +3295,7 @@ class ke {
|
|
|
3293
3295
|
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);
|
|
3294
3296
|
}
|
|
3295
3297
|
}
|
|
3296
|
-
|
|
3298
|
+
Ee.receivers = [];
|
|
3297
3299
|
/**
|
|
3298
3300
|
* @license
|
|
3299
3301
|
* Copyright 2020 Google LLC
|
|
@@ -3377,9 +3379,9 @@ class Yi {
|
|
|
3377
3379
|
o = {
|
|
3378
3380
|
messageChannel: r,
|
|
3379
3381
|
onMessage(h) {
|
|
3380
|
-
const
|
|
3381
|
-
if (
|
|
3382
|
-
switch (
|
|
3382
|
+
const m = h;
|
|
3383
|
+
if (m.data.eventId === l)
|
|
3384
|
+
switch (m.data.status) {
|
|
3383
3385
|
case "ack":
|
|
3384
3386
|
clearTimeout(d), s = setTimeout(
|
|
3385
3387
|
() => {
|
|
@@ -3393,7 +3395,7 @@ class Yi {
|
|
|
3393
3395
|
);
|
|
3394
3396
|
break;
|
|
3395
3397
|
case "done":
|
|
3396
|
-
clearTimeout(s), c(
|
|
3398
|
+
clearTimeout(s), c(m.data.response);
|
|
3397
3399
|
break;
|
|
3398
3400
|
default:
|
|
3399
3401
|
clearTimeout(d), clearTimeout(s), a(new Error(
|
|
@@ -3429,11 +3431,11 @@ class Yi {
|
|
|
3429
3431
|
* See the License for the specific language governing permissions and
|
|
3430
3432
|
* limitations under the License.
|
|
3431
3433
|
*/
|
|
3432
|
-
function
|
|
3434
|
+
function b() {
|
|
3433
3435
|
return window;
|
|
3434
3436
|
}
|
|
3435
3437
|
function Xi(n) {
|
|
3436
|
-
|
|
3438
|
+
b().location.href = n;
|
|
3437
3439
|
}
|
|
3438
3440
|
/**
|
|
3439
3441
|
* @license
|
|
@@ -3452,7 +3454,7 @@ function Xi(n) {
|
|
|
3452
3454
|
* limitations under the License.
|
|
3453
3455
|
*/
|
|
3454
3456
|
function Zt() {
|
|
3455
|
-
return typeof
|
|
3457
|
+
return typeof b().WorkerGlobalScope < "u" && typeof b().importScripts == "function";
|
|
3456
3458
|
}
|
|
3457
3459
|
async function Qi() {
|
|
3458
3460
|
if (!(navigator != null && navigator.serviceWorker))
|
|
@@ -3486,8 +3488,8 @@ function er() {
|
|
|
3486
3488
|
* See the License for the specific language governing permissions and
|
|
3487
3489
|
* limitations under the License.
|
|
3488
3490
|
*/
|
|
3489
|
-
const en = "firebaseLocalStorageDb", tr = 1,
|
|
3490
|
-
class
|
|
3491
|
+
const en = "firebaseLocalStorageDb", tr = 1, ye = "firebaseLocalStorage", tn = "fbase_key";
|
|
3492
|
+
class ce {
|
|
3491
3493
|
constructor(e) {
|
|
3492
3494
|
this.request = e;
|
|
3493
3495
|
}
|
|
@@ -3501,12 +3503,12 @@ class oe {
|
|
|
3501
3503
|
});
|
|
3502
3504
|
}
|
|
3503
3505
|
}
|
|
3504
|
-
function
|
|
3505
|
-
return n.transaction([
|
|
3506
|
+
function be(n, e) {
|
|
3507
|
+
return n.transaction([ye], e ? "readwrite" : "readonly").objectStore(ye);
|
|
3506
3508
|
}
|
|
3507
3509
|
function nr() {
|
|
3508
3510
|
const n = indexedDB.deleteDatabase(en);
|
|
3509
|
-
return new
|
|
3511
|
+
return new ce(n).toPromise();
|
|
3510
3512
|
}
|
|
3511
3513
|
function Ue() {
|
|
3512
3514
|
const n = indexedDB.open(en, tr);
|
|
@@ -3516,30 +3518,30 @@ function Ue() {
|
|
|
3516
3518
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3517
3519
|
const i = n.result;
|
|
3518
3520
|
try {
|
|
3519
|
-
i.createObjectStore(
|
|
3521
|
+
i.createObjectStore(ye, { keyPath: tn });
|
|
3520
3522
|
} catch (r) {
|
|
3521
3523
|
t(r);
|
|
3522
3524
|
}
|
|
3523
3525
|
}), n.addEventListener("success", async () => {
|
|
3524
3526
|
const i = n.result;
|
|
3525
|
-
i.objectStoreNames.contains(
|
|
3527
|
+
i.objectStoreNames.contains(ye) ? e(i) : (i.close(), await nr(), e(await Ue()));
|
|
3526
3528
|
});
|
|
3527
3529
|
});
|
|
3528
3530
|
}
|
|
3529
3531
|
async function ut(n, e, t) {
|
|
3530
|
-
const i =
|
|
3532
|
+
const i = be(n, !0).put({
|
|
3531
3533
|
[tn]: e,
|
|
3532
3534
|
value: t
|
|
3533
3535
|
});
|
|
3534
|
-
return new
|
|
3536
|
+
return new ce(i).toPromise();
|
|
3535
3537
|
}
|
|
3536
3538
|
async function ir(n, e) {
|
|
3537
|
-
const t =
|
|
3539
|
+
const t = be(n, !1).get(e), i = await new ce(t).toPromise();
|
|
3538
3540
|
return i === void 0 ? null : i.value;
|
|
3539
3541
|
}
|
|
3540
3542
|
function dt(n, e) {
|
|
3541
|
-
const t =
|
|
3542
|
-
return new
|
|
3543
|
+
const t = be(n, !0).delete(e);
|
|
3544
|
+
return new ce(t).toPromise();
|
|
3543
3545
|
}
|
|
3544
3546
|
const rr = 800, sr = 3;
|
|
3545
3547
|
class nn {
|
|
@@ -3574,7 +3576,7 @@ class nn {
|
|
|
3574
3576
|
* As the worker we should listen to events from the main window.
|
|
3575
3577
|
*/
|
|
3576
3578
|
async initializeReceiver() {
|
|
3577
|
-
this.receiver =
|
|
3579
|
+
this.receiver = Ee._getInstance(er()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3578
3580
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3579
3581
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3580
3582
|
"keyChanged"
|
|
@@ -3631,7 +3633,7 @@ class nn {
|
|
|
3631
3633
|
if (!indexedDB)
|
|
3632
3634
|
return !1;
|
|
3633
3635
|
const e = await Ue();
|
|
3634
|
-
return await ut(e,
|
|
3636
|
+
return await ut(e, Ie, "1"), await dt(e, Ie), !0;
|
|
3635
3637
|
} catch {
|
|
3636
3638
|
}
|
|
3637
3639
|
return !1;
|
|
@@ -3656,8 +3658,8 @@ class nn {
|
|
|
3656
3658
|
}
|
|
3657
3659
|
async _poll() {
|
|
3658
3660
|
const e = await this._withRetries((r) => {
|
|
3659
|
-
const s =
|
|
3660
|
-
return new
|
|
3661
|
+
const s = be(r, !1).getAll();
|
|
3662
|
+
return new ce(s).toPromise();
|
|
3661
3663
|
});
|
|
3662
3664
|
if (!e)
|
|
3663
3665
|
return [];
|
|
@@ -3693,7 +3695,7 @@ class nn {
|
|
|
3693
3695
|
}
|
|
3694
3696
|
nn.type = "LOCAL";
|
|
3695
3697
|
const or = nn;
|
|
3696
|
-
new
|
|
3698
|
+
new oe(3e4, 6e4);
|
|
3697
3699
|
/**
|
|
3698
3700
|
* @license
|
|
3699
3701
|
* Copyright 2021 Google LLC
|
|
@@ -3711,7 +3713,7 @@ new re(3e4, 6e4);
|
|
|
3711
3713
|
* limitations under the License.
|
|
3712
3714
|
*/
|
|
3713
3715
|
function ar(n, e) {
|
|
3714
|
-
return e ?
|
|
3716
|
+
return e ? N(e) : (u(
|
|
3715
3717
|
n._popupRedirectResolver,
|
|
3716
3718
|
n,
|
|
3717
3719
|
"argument-error"
|
|
@@ -3743,13 +3745,13 @@ class qe extends zt {
|
|
|
3743
3745
|
), this.params = e;
|
|
3744
3746
|
}
|
|
3745
3747
|
_getIdTokenResponse(e) {
|
|
3746
|
-
return
|
|
3748
|
+
return q(e, this._buildIdpRequest());
|
|
3747
3749
|
}
|
|
3748
3750
|
_linkToIdToken(e, t) {
|
|
3749
|
-
return
|
|
3751
|
+
return q(e, this._buildIdpRequest(t));
|
|
3750
3752
|
}
|
|
3751
3753
|
_getReauthenticationResolver(e) {
|
|
3752
|
-
return
|
|
3754
|
+
return q(e, this._buildIdpRequest());
|
|
3753
3755
|
}
|
|
3754
3756
|
_buildIdpRequest(e) {
|
|
3755
3757
|
const t = {
|
|
@@ -3851,7 +3853,7 @@ class rn {
|
|
|
3851
3853
|
case "reauthViaRedirect":
|
|
3852
3854
|
return lr;
|
|
3853
3855
|
default:
|
|
3854
|
-
|
|
3856
|
+
O(
|
|
3855
3857
|
this.auth,
|
|
3856
3858
|
"internal-error"
|
|
3857
3859
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -3859,10 +3861,10 @@ class rn {
|
|
|
3859
3861
|
}
|
|
3860
3862
|
}
|
|
3861
3863
|
resolve(e) {
|
|
3862
|
-
|
|
3864
|
+
L(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.resolve(e), this.unregisterAndCleanUp();
|
|
3863
3865
|
}
|
|
3864
3866
|
reject(e) {
|
|
3865
|
-
|
|
3867
|
+
L(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.reject(e), this.unregisterAndCleanUp();
|
|
3866
3868
|
}
|
|
3867
3869
|
unregisterAndCleanUp() {
|
|
3868
3870
|
this.eventManager && this.eventManager.unregisterConsumer(this), this.pendingPromise = null, this.cleanUp();
|
|
@@ -3884,10 +3886,10 @@ class rn {
|
|
|
3884
3886
|
* See the License for the specific language governing permissions and
|
|
3885
3887
|
* limitations under the License.
|
|
3886
3888
|
*/
|
|
3887
|
-
const dr = new
|
|
3888
|
-
class
|
|
3889
|
+
const dr = new oe(2e3, 1e4);
|
|
3890
|
+
class G extends rn {
|
|
3889
3891
|
constructor(e, t, i, r, s) {
|
|
3890
|
-
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null,
|
|
3892
|
+
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, G.currentPopupAction && G.currentPopupAction.cancel(), G.currentPopupAction = this;
|
|
3891
3893
|
}
|
|
3892
3894
|
async executeNotNull() {
|
|
3893
3895
|
const e = await this.execute();
|
|
@@ -3899,7 +3901,7 @@ class W extends rn {
|
|
|
3899
3901
|
), e;
|
|
3900
3902
|
}
|
|
3901
3903
|
async onExecution() {
|
|
3902
|
-
|
|
3904
|
+
L(this.filter.length === 1, "Popup operations only handle one event");
|
|
3903
3905
|
const e = ze();
|
|
3904
3906
|
this.authWindow = await this.resolver._openPopup(
|
|
3905
3907
|
this.auth,
|
|
@@ -3910,7 +3912,7 @@ class W extends rn {
|
|
|
3910
3912
|
), this.authWindow.associatedEvent = e, this.resolver._originValidation(this.auth).catch((t) => {
|
|
3911
3913
|
this.reject(t);
|
|
3912
3914
|
}), this.resolver._isIframeWebStorageSupported(this.auth, (t) => {
|
|
3913
|
-
t || this.reject(
|
|
3915
|
+
t || this.reject(E(
|
|
3914
3916
|
this.auth,
|
|
3915
3917
|
"web-storage-unsupported"
|
|
3916
3918
|
/* AuthErrorCode.WEB_STORAGE_UNSUPPORTED */
|
|
@@ -3922,14 +3924,14 @@ class W extends rn {
|
|
|
3922
3924
|
return ((e = this.authWindow) === null || e === void 0 ? void 0 : e.associatedEvent) || null;
|
|
3923
3925
|
}
|
|
3924
3926
|
cancel() {
|
|
3925
|
-
this.reject(
|
|
3927
|
+
this.reject(E(
|
|
3926
3928
|
this.auth,
|
|
3927
3929
|
"cancelled-popup-request"
|
|
3928
3930
|
/* AuthErrorCode.EXPIRED_POPUP_REQUEST */
|
|
3929
3931
|
));
|
|
3930
3932
|
}
|
|
3931
3933
|
cleanUp() {
|
|
3932
|
-
this.authWindow && this.authWindow.close(), this.pollId && window.clearTimeout(this.pollId), this.authWindow = null, this.pollId = null,
|
|
3934
|
+
this.authWindow && this.authWindow.close(), this.pollId && window.clearTimeout(this.pollId), this.authWindow = null, this.pollId = null, G.currentPopupAction = null;
|
|
3933
3935
|
}
|
|
3934
3936
|
pollUserCancellation() {
|
|
3935
3937
|
const e = () => {
|
|
@@ -3937,7 +3939,7 @@ class W extends rn {
|
|
|
3937
3939
|
if (!((i = (t = this.authWindow) === null || t === void 0 ? void 0 : t.window) === null || i === void 0) && i.closed) {
|
|
3938
3940
|
this.pollId = window.setTimeout(
|
|
3939
3941
|
() => {
|
|
3940
|
-
this.pollId = null, this.reject(
|
|
3942
|
+
this.pollId = null, this.reject(E(
|
|
3941
3943
|
this.auth,
|
|
3942
3944
|
"popup-closed-by-user"
|
|
3943
3945
|
/* AuthErrorCode.POPUP_CLOSED_BY_USER */
|
|
@@ -3953,7 +3955,7 @@ class W extends rn {
|
|
|
3953
3955
|
e();
|
|
3954
3956
|
}
|
|
3955
3957
|
}
|
|
3956
|
-
|
|
3958
|
+
G.currentPopupAction = null;
|
|
3957
3959
|
/**
|
|
3958
3960
|
* @license
|
|
3959
3961
|
* Copyright 2020 Google LLC
|
|
@@ -3970,7 +3972,7 @@ W.currentPopupAction = null;
|
|
|
3970
3972
|
* See the License for the specific language governing permissions and
|
|
3971
3973
|
* limitations under the License.
|
|
3972
3974
|
*/
|
|
3973
|
-
const hr = "pendingRedirect",
|
|
3975
|
+
const hr = "pendingRedirect", he = /* @__PURE__ */ new Map();
|
|
3974
3976
|
class fr extends rn {
|
|
3975
3977
|
constructor(e, t, i = !1) {
|
|
3976
3978
|
super(e, [
|
|
@@ -3986,7 +3988,7 @@ class fr extends rn {
|
|
|
3986
3988
|
* just return it.
|
|
3987
3989
|
*/
|
|
3988
3990
|
async execute() {
|
|
3989
|
-
let e =
|
|
3991
|
+
let e = he.get(this.auth._key());
|
|
3990
3992
|
if (!e) {
|
|
3991
3993
|
try {
|
|
3992
3994
|
const i = await pr(this.resolver, this.auth) ? await super.execute() : null;
|
|
@@ -3994,9 +3996,9 @@ class fr extends rn {
|
|
|
3994
3996
|
} catch (t) {
|
|
3995
3997
|
e = () => Promise.reject(t);
|
|
3996
3998
|
}
|
|
3997
|
-
|
|
3999
|
+
he.set(this.auth._key(), e);
|
|
3998
4000
|
}
|
|
3999
|
-
return this.bypassAuthState ||
|
|
4001
|
+
return this.bypassAuthState || he.set(this.auth._key(), () => Promise.resolve(null)), e();
|
|
4000
4002
|
}
|
|
4001
4003
|
async onAuthEvent(e) {
|
|
4002
4004
|
if (e.type === "signInViaRedirect")
|
|
@@ -4025,18 +4027,18 @@ async function pr(n, e) {
|
|
|
4025
4027
|
return await i._remove(t), r;
|
|
4026
4028
|
}
|
|
4027
4029
|
function mr(n, e) {
|
|
4028
|
-
|
|
4030
|
+
he.set(n._key(), e);
|
|
4029
4031
|
}
|
|
4030
4032
|
function gr(n) {
|
|
4031
|
-
return
|
|
4033
|
+
return N(n._redirectPersistence);
|
|
4032
4034
|
}
|
|
4033
4035
|
function _r(n) {
|
|
4034
|
-
return
|
|
4036
|
+
return de(hr, n.config.apiKey, n.name);
|
|
4035
4037
|
}
|
|
4036
4038
|
async function vr(n, e, t = !1) {
|
|
4037
|
-
if (
|
|
4038
|
-
return Promise.reject(
|
|
4039
|
-
const i =
|
|
4039
|
+
if (A(n.app))
|
|
4040
|
+
return Promise.reject($(n));
|
|
4041
|
+
const i = ke(n), r = ar(i, e), o = await new fr(i, r, t).execute();
|
|
4040
4042
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
4041
4043
|
}
|
|
4042
4044
|
/**
|
|
@@ -4078,7 +4080,7 @@ class yr {
|
|
|
4078
4080
|
var i;
|
|
4079
4081
|
if (e.error && !sn(e)) {
|
|
4080
4082
|
const r = ((i = e.error.code) === null || i === void 0 ? void 0 : i.split("auth/")[1]) || "internal-error";
|
|
4081
|
-
t.onError(
|
|
4083
|
+
t.onError(E(this.auth, r));
|
|
4082
4084
|
} else
|
|
4083
4085
|
t.onAuthEvent(e);
|
|
4084
4086
|
}
|
|
@@ -4128,7 +4130,7 @@ function wr(n) {
|
|
|
4128
4130
|
* limitations under the License.
|
|
4129
4131
|
*/
|
|
4130
4132
|
async function Tr(n, e = {}) {
|
|
4131
|
-
return
|
|
4133
|
+
return J(n, "GET", "/v1/projects", e);
|
|
4132
4134
|
}
|
|
4133
4135
|
/**
|
|
4134
4136
|
* @license
|
|
@@ -4157,7 +4159,7 @@ async function br(n) {
|
|
|
4157
4159
|
return;
|
|
4158
4160
|
} catch {
|
|
4159
4161
|
}
|
|
4160
|
-
|
|
4162
|
+
O(
|
|
4161
4163
|
n,
|
|
4162
4164
|
"unauthorized-domain"
|
|
4163
4165
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
@@ -4192,9 +4194,9 @@ function Sr(n) {
|
|
|
4192
4194
|
* See the License for the specific language governing permissions and
|
|
4193
4195
|
* limitations under the License.
|
|
4194
4196
|
*/
|
|
4195
|
-
const Rr = new
|
|
4197
|
+
const Rr = new oe(3e4, 6e4);
|
|
4196
4198
|
function ft() {
|
|
4197
|
-
const n =
|
|
4199
|
+
const n = b().___jsl;
|
|
4198
4200
|
if (n != null && n.H) {
|
|
4199
4201
|
for (const e of Object.keys(n.H))
|
|
4200
4202
|
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)
|
|
@@ -4211,7 +4213,7 @@ function Ar(n) {
|
|
|
4211
4213
|
e(gapi.iframes.getContext());
|
|
4212
4214
|
},
|
|
4213
4215
|
ontimeout: () => {
|
|
4214
|
-
ft(), t(
|
|
4216
|
+
ft(), t(E(
|
|
4215
4217
|
n,
|
|
4216
4218
|
"network-request-failed"
|
|
4217
4219
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
@@ -4220,14 +4222,14 @@ function Ar(n) {
|
|
|
4220
4222
|
timeout: Rr.get()
|
|
4221
4223
|
});
|
|
4222
4224
|
}
|
|
4223
|
-
if (!((r = (i =
|
|
4225
|
+
if (!((r = (i = b().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
4224
4226
|
e(gapi.iframes.getContext());
|
|
4225
|
-
else if (!((s =
|
|
4227
|
+
else if (!((s = b().gapi) === null || s === void 0) && s.load)
|
|
4226
4228
|
o();
|
|
4227
4229
|
else {
|
|
4228
4230
|
const c = Ni("iframefcb");
|
|
4229
|
-
return
|
|
4230
|
-
gapi.load ? o() : t(
|
|
4231
|
+
return b()[c] = () => {
|
|
4232
|
+
gapi.load ? o() : t(E(
|
|
4231
4233
|
n,
|
|
4232
4234
|
"network-request-failed"
|
|
4233
4235
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
@@ -4235,12 +4237,12 @@ function Ar(n) {
|
|
|
4235
4237
|
}, Pi(`${Ci()}?onload=${c}`).catch((a) => t(a));
|
|
4236
4238
|
}
|
|
4237
4239
|
}).catch((e) => {
|
|
4238
|
-
throw
|
|
4240
|
+
throw fe = null, e;
|
|
4239
4241
|
});
|
|
4240
4242
|
}
|
|
4241
|
-
let
|
|
4243
|
+
let fe = null;
|
|
4242
4244
|
function Pr(n) {
|
|
4243
|
-
return
|
|
4245
|
+
return fe = fe || Ar(n), fe;
|
|
4244
4246
|
}
|
|
4245
4247
|
/**
|
|
4246
4248
|
* @license
|
|
@@ -4258,7 +4260,7 @@ function Pr(n) {
|
|
|
4258
4260
|
* See the License for the specific language governing permissions and
|
|
4259
4261
|
* limitations under the License.
|
|
4260
4262
|
*/
|
|
4261
|
-
const Cr = new
|
|
4263
|
+
const Cr = new oe(5e3, 15e3), Nr = "__/auth/iframe", Or = "emulator/auth/iframe", Lr = {
|
|
4262
4264
|
style: {
|
|
4263
4265
|
position: "absolute",
|
|
4264
4266
|
top: "-100px",
|
|
@@ -4284,14 +4286,14 @@ function Ur(n) {
|
|
|
4284
4286
|
const t = e.emulator ? je(e, Or) : `https://${n.config.authDomain}/${Nr}`, i = {
|
|
4285
4287
|
apiKey: e.apiKey,
|
|
4286
4288
|
appName: n.name,
|
|
4287
|
-
v:
|
|
4289
|
+
v: re
|
|
4288
4290
|
}, r = Mr.get(n.config.apiHost);
|
|
4289
4291
|
r && (i.eid = r);
|
|
4290
4292
|
const s = n._getFrameworks();
|
|
4291
|
-
return s.length && (i.fw = s.join(",")), `${t}?${
|
|
4293
|
+
return s.length && (i.fw = s.join(",")), `${t}?${se(i).slice(1)}`;
|
|
4292
4294
|
}
|
|
4293
4295
|
async function Dr(n) {
|
|
4294
|
-
const e = await Pr(n), t =
|
|
4296
|
+
const e = await Pr(n), t = b().gapi;
|
|
4295
4297
|
return u(
|
|
4296
4298
|
t,
|
|
4297
4299
|
n,
|
|
@@ -4308,15 +4310,15 @@ async function Dr(n) {
|
|
|
4308
4310
|
// Prevent iframe from closing on mouse out.
|
|
4309
4311
|
setHideOnLeave: !1
|
|
4310
4312
|
});
|
|
4311
|
-
const o =
|
|
4313
|
+
const o = E(
|
|
4312
4314
|
n,
|
|
4313
4315
|
"network-request-failed"
|
|
4314
4316
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4315
|
-
), c =
|
|
4317
|
+
), c = b().setTimeout(() => {
|
|
4316
4318
|
s(o);
|
|
4317
4319
|
}, Cr.get());
|
|
4318
4320
|
function a() {
|
|
4319
|
-
|
|
4321
|
+
b().clearTimeout(c), r(i);
|
|
4320
4322
|
}
|
|
4321
4323
|
i.ping(a).then(a, () => {
|
|
4322
4324
|
s(o);
|
|
@@ -4367,7 +4369,7 @@ function jr(n, e, t, i = Fr, r = Vr) {
|
|
|
4367
4369
|
left: o
|
|
4368
4370
|
}), l = y().toLowerCase();
|
|
4369
4371
|
t && (c = Ft(l) ? $r : t), xt(l) && (e = e || Hr, a.scrollbars = "yes");
|
|
4370
|
-
const d = Object.entries(a).reduce((
|
|
4372
|
+
const d = Object.entries(a).reduce((m, [I, w]) => `${m}${I}=${w},`, "");
|
|
4371
4373
|
if (yi(l) && c !== "_self")
|
|
4372
4374
|
return Wr(e || "", c), new pt(null);
|
|
4373
4375
|
const h = window.open(e || "", c, d);
|
|
@@ -4423,7 +4425,7 @@ async function mt(n, e, t, i, r, s) {
|
|
|
4423
4425
|
appName: n.name,
|
|
4424
4426
|
authType: t,
|
|
4425
4427
|
redirectUrl: i,
|
|
4426
|
-
v:
|
|
4428
|
+
v: re,
|
|
4427
4429
|
eventId: r
|
|
4428
4430
|
};
|
|
4429
4431
|
if (e instanceof qt) {
|
|
@@ -4431,7 +4433,7 @@ async function mt(n, e, t, i, r, s) {
|
|
|
4431
4433
|
for (const [d, h] of Object.entries({}))
|
|
4432
4434
|
o[d] = h;
|
|
4433
4435
|
}
|
|
4434
|
-
if (e instanceof
|
|
4436
|
+
if (e instanceof ae) {
|
|
4435
4437
|
const d = e.getScopes().filter((h) => h !== "");
|
|
4436
4438
|
d.length > 0 && (o.scopes = d.join(","));
|
|
4437
4439
|
}
|
|
@@ -4440,7 +4442,7 @@ async function mt(n, e, t, i, r, s) {
|
|
|
4440
4442
|
for (const d of Object.keys(c))
|
|
4441
4443
|
c[d] === void 0 && delete c[d];
|
|
4442
4444
|
const a = await n._getAppCheckToken(), l = a ? `#${zr}=${encodeURIComponent(a)}` : "";
|
|
4443
|
-
return `${qr(n)}?${
|
|
4445
|
+
return `${qr(n)}?${se(c).slice(1)}${l}`;
|
|
4444
4446
|
}
|
|
4445
4447
|
function qr({ config: n }) {
|
|
4446
4448
|
return n.emulator ? je(n, Br) : `https://${n.authDomain}/${Gr}`;
|
|
@@ -4470,7 +4472,7 @@ class Kr {
|
|
|
4470
4472
|
// to make sure errors are raised as promise rejections
|
|
4471
4473
|
async _openPopup(e, t, i, r) {
|
|
4472
4474
|
var s;
|
|
4473
|
-
|
|
4475
|
+
L((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4474
4476
|
const o = await mt(e, t, i, Le(), r);
|
|
4475
4477
|
return jr(e, o, ze());
|
|
4476
4478
|
}
|
|
@@ -4484,7 +4486,7 @@ class Kr {
|
|
|
4484
4486
|
const t = e._key();
|
|
4485
4487
|
if (this.eventManagers[t]) {
|
|
4486
4488
|
const { manager: r, promise: s } = this.eventManagers[t];
|
|
4487
|
-
return r ? Promise.resolve(r) : (
|
|
4489
|
+
return r ? Promise.resolve(r) : (L(s, "If manager is not set, promise should be"), s);
|
|
4488
4490
|
}
|
|
4489
4491
|
const i = this.initAndGetManager(e);
|
|
4490
4492
|
return this.eventManagers[t] = { promise: i }, i.catch(() => {
|
|
@@ -4507,7 +4509,7 @@ class Kr {
|
|
|
4507
4509
|
this.iframes[e._key()].send(Ce, { type: Ce }, (r) => {
|
|
4508
4510
|
var s;
|
|
4509
4511
|
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[Ce];
|
|
4510
|
-
o !== void 0 && t(!!o),
|
|
4512
|
+
o !== void 0 && t(!!o), O(
|
|
4511
4513
|
e,
|
|
4512
4514
|
"internal-error"
|
|
4513
4515
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -4519,7 +4521,7 @@ class Kr {
|
|
|
4519
4521
|
return this.originValidationPromises[t] || (this.originValidationPromises[t] = br(e)), this.originValidationPromises[t];
|
|
4520
4522
|
}
|
|
4521
4523
|
get _shouldInitProactively() {
|
|
4522
|
-
return Wt() || Ge() ||
|
|
4524
|
+
return Wt() || Ge() || Te();
|
|
4523
4525
|
}
|
|
4524
4526
|
}
|
|
4525
4527
|
const Jr = Kr;
|
|
@@ -4637,7 +4639,7 @@ function Qr(n) {
|
|
|
4637
4639
|
})), Ze(new et(
|
|
4638
4640
|
"auth-internal",
|
|
4639
4641
|
(e) => {
|
|
4640
|
-
const t =
|
|
4642
|
+
const t = ke(e.getProvider(
|
|
4641
4643
|
"auth"
|
|
4642
4644
|
/* _ComponentName.AUTH */
|
|
4643
4645
|
).getImmediate());
|
|
@@ -4711,7 +4713,7 @@ Ai({
|
|
|
4711
4713
|
return new Promise((e, t) => {
|
|
4712
4714
|
const i = document.createElement("script");
|
|
4713
4715
|
i.setAttribute("src", n), i.onload = e, i.onerror = (r) => {
|
|
4714
|
-
const s =
|
|
4716
|
+
const s = E(
|
|
4715
4717
|
"internal-error"
|
|
4716
4718
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4717
4719
|
);
|
|
@@ -4734,45 +4736,45 @@ const os = {
|
|
|
4734
4736
|
}, as = ["src"], ks = /* @__PURE__ */ De({
|
|
4735
4737
|
__name: "App",
|
|
4736
4738
|
setup(n) {
|
|
4737
|
-
const e =
|
|
4738
|
-
const g = e.currentCountry.value || "MY", v = tt.getIdToken(),
|
|
4739
|
-
return `${ss.marketingV1Portal}/b/${
|
|
4739
|
+
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(() => {
|
|
4740
|
+
const g = e.currentCountry.value || "MY", v = tt.getIdToken(), T = l.value._id;
|
|
4741
|
+
return `${ss.marketingV1Portal}/b/${T}/marketing/overview?showHeader=false&country=${g}&token=${v}`;
|
|
4740
4742
|
});
|
|
4741
|
-
async function
|
|
4743
|
+
async function I() {
|
|
4742
4744
|
if (Nn().length) {
|
|
4743
4745
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4744
4746
|
return;
|
|
4745
4747
|
}
|
|
4746
|
-
const g = On(rs.firebase), v = await hn.getCustomToken(),
|
|
4747
|
-
await ji(
|
|
4748
|
+
const g = On(rs.firebase), v = await hn.getCustomToken(), T = ns();
|
|
4749
|
+
await ji(T, v), Ln(g), console.log("initFirebase", g);
|
|
4748
4750
|
}
|
|
4749
|
-
const
|
|
4750
|
-
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
|
|
4751
|
+
const w = async () => {
|
|
4752
|
+
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;
|
|
4751
4753
|
};
|
|
4752
4754
|
return ln(() => {
|
|
4753
4755
|
if (Mn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(r, s), !c.value) {
|
|
4754
|
-
const g = document.getElementsByClassName("app-header")[0], v = document.getElementsByClassName("app-sidebar")[0],
|
|
4755
|
-
g == null || g.classList.add("!hidden"), v == null || v.classList.add("!pt-0"),
|
|
4756
|
+
const g = document.getElementsByClassName("app-header")[0], v = document.getElementsByClassName("app-sidebar")[0], T = document.getElementsByClassName("app-container")[0], M = document.getElementsByTagName("main")[0];
|
|
4757
|
+
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);
|
|
4756
4758
|
}
|
|
4757
|
-
l.value != null && (console.log("App mounted, forceRerender"),
|
|
4759
|
+
l.value != null && (console.log("App mounted, forceRerender"), w());
|
|
4758
4760
|
}), xe(
|
|
4759
4761
|
() => e.currentBusiness.value,
|
|
4760
4762
|
async (g, v) => {
|
|
4761
|
-
console.log("Current business changed"), g != null && g._id != v._id && (console.log("forceRerender when business changes", g, v),
|
|
4763
|
+
console.log("Current business changed"), g != null && g._id != v._id && (console.log("forceRerender when business changes", g, v), w());
|
|
4762
4764
|
}
|
|
4763
|
-
), (g, v) => (
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
json: { url: m
|
|
4765
|
+
), (g, v) => (H(), pe(It, null, [
|
|
4766
|
+
p(d) && p(h) === "v2" ? (H(), Ne(p(dn), { key: 0 })) : Ae("", !0),
|
|
4767
|
+
p(d) && p(h) === "v2" && p(c) ? (H(), Ne(ti, { key: 1 })) : Ae("", !0),
|
|
4768
|
+
p(d) && p(h) !== "v2" ? (H(), pe("div", os, [
|
|
4769
|
+
S(In, {
|
|
4770
|
+
json: { url: p(m) }
|
|
4769
4771
|
}, null, 8, ["json"]),
|
|
4770
4772
|
_("iframe", {
|
|
4771
4773
|
allow: "clipboard-read; clipboard-write",
|
|
4772
4774
|
frameBorder: "0",
|
|
4773
4775
|
height: "100%",
|
|
4774
4776
|
width: "100%",
|
|
4775
|
-
src: m
|
|
4777
|
+
src: p(m)
|
|
4776
4778
|
}, null, 8, as)
|
|
4777
4779
|
])) : Ae("", !0)
|
|
4778
4780
|
], 64));
|