@feedmepos/mf-connect 0.1.98-beta.85 → 0.1.98-beta.87
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/README.md +62 -5
- package/dist/{App-BxA547CP.js → App-DZzCW6yw.js} +586 -569
- package/dist/{AuditLogs-DjsuO-ou.js → AuditLogs-C5s1oYtj.js} +12 -12
- package/dist/{Bin-Cp1JuoPV.js → Bin-B1e-qVtO.js} +8 -8
- package/dist/{Broadcast-C-dZ7I7J.js → Broadcast-CwO5ut-E.js} +12 -12
- package/dist/{CampaignAnalytic-CeJrlblr.js → CampaignAnalytic-B1KXy3dl.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DNshyt4k.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DS8RAeUt.js} +7 -7
- package/dist/{Card-BRkDbHgP.js → Card-BK-p9FW9.js} +22 -22
- package/dist/{Collections-KGkn4jVg.js → Collections-CTF-r_mV.js} +8 -8
- package/dist/{Credit-CYtdA8LR.js → Credit-DR2AvPrI.js} +12 -12
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-B_GGXmKj.js → DateRangeChip.vue_vue_type_script_setup_true_lang-CixW7_65.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CC84YrQj.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D53ghi_e.js} +34 -35
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Y8euxc9u.js → EffectSheet.vue_vue_type_style_index_0_lang-BNCvFw9v.js} +6 -6
- package/dist/{Experience-DyCWhTIc.js → Experience-BzPvYJ0N.js} +13 -13
- package/dist/{FileSaver.min-sifwJvOC.js → FileSaver.min-BBi03O9S.js} +1 -1
- package/dist/{Game-D2dtBGMx.js → Game-DNdM6BpR.js} +13 -13
- package/dist/{GiftCardSetup-4_wPeuGx.js → GiftCardSetup-yVVt1hCK.js} +10 -10
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-DaXZiLCz.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-C_REykTp.js} +7 -7
- package/dist/{Goals-BZriqe6a.js → Goals-RyNCRCoT.js} +4 -4
- package/dist/{Grab-DE43gcBH.js → Grab-COgtKEHg.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BSmoRIp3.js → ImageInput.vue_vue_type_script_setup_true_lang-DueG1yQj.js} +1 -1
- package/dist/{Index-3-__a-F8.js → Index-CW5ib46F.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DMFmuJHS.js → LocationPicker.vue_vue_type_script_setup_true_lang-Dbk0uqyl.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-aCBsAVgf.js → LottieAnimation.vue_vue_type_script_setup_true_lang-s19mfQze.js} +1 -1
- package/dist/{LoyaltyDashboard-BxqVkHWZ.js → LoyaltyDashboard-CJW9sSpM.js} +23 -24
- package/dist/MainLayout-DJrtcFYj.js +4 -0
- package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-DKwbltBD.js → MainLayout.vue_vue_type_script_setup_true_lang-fXA-ixLQ.js} +5 -4
- package/dist/{Marketing-BkTXd2kV.js → Marketing-DJD3MCP0.js} +4 -4
- package/dist/{MarketingMaterialEdit-DCmGVhn1.js → MarketingMaterialEdit-NlZLrI0D.js} +6 -6
- package/dist/{Member-BZ-cZyCC.js → Member-B9_6dgmX.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-DeRvNRsk.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-B6PrfIdK.js} +23 -23
- package/dist/{MemberImportHistory-CunTfazI.js → MemberImportHistory-daeSSL3G.js} +7 -7
- package/dist/{MemberList-H8H9xzMg.js → MemberList-DpMvv6MH.js} +14 -14
- package/dist/{MemberTransactions-B1GTs17R.js → MemberTransactions-CekjmOnU.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-C2K_acoB.js → MessageInput.vue_vue_type_script_setup_true_lang-Cgb0WN3L.js} +10 -10
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BCRSJoq7.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DKJH_z31.js} +1 -1
- package/dist/{Mission-CNXUBVI4.js → Mission-B3YYFaqK.js} +14 -14
- package/dist/{Overview-CwoDIRXD.js → Overview-B3VtDXAN.js} +4 -4
- package/dist/{Overview-CiIMyx-_.js → Overview-DcLRK3qr.js} +20 -20
- package/dist/{Point-BpFvqe5M.js → Point-rE75hllY.js} +14 -14
- package/dist/{Promotion-DwcxXXS3.js → Promotion-CldXbf59.js} +14 -14
- package/dist/{Queue-CI9PtRqs.js → Queue-Im8WyRKY.js} +12 -12
- package/dist/{Record-Cl73WIoN.js → Record-DmP7Q885.js} +9 -9
- package/dist/{Review-BQL9TzxZ.js → Review-DDaoANvS.js} +2 -2
- package/dist/{ReviewFacebookCallback-BVcW6zNJ.js → ReviewFacebookCallback-6fQq9t2y.js} +5 -5
- package/dist/{ReviewGoogleCallback-peKv_-nP.js → ReviewGoogleCallback-DDmUWLd9.js} +5 -5
- package/dist/{Reward-6rLOoOkv.js → Reward-BzL-toJQ.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CZ2OWRik.js → RewardGroup.vue_vue_type_script_setup_true_lang-CrQvlB_E.js} +13 -13
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-B7GKzELx.js → RuleGroup.vue_vue_type_script_setup_true_lang-Dk8kqDSk.js} +14 -14
- package/dist/{Segment-DnrCf_-F.js → Segment-BweG5YWo.js} +25 -25
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DyYWf2RR.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BfFtD5TS.js} +14 -14
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-C-GxdVOH.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BsgQ1kqK.js} +4 -4
- package/dist/{Setting-BlU3XioB.js → Setting-MW6B10tv.js} +14 -14
- package/dist/{SettingAdvertisements-CW9KUQAk.js → SettingAdvertisements-DP-Wm3vC.js} +12 -12
- package/dist/{Settings-DfKCItWN.js → Settings-CczrlaKr.js} +5 -5
- package/dist/{Store-Dh90RjUg.js → Store-C9pYfjIe.js} +28 -29
- package/dist/{StoreRewards-BmEJZR1O.js → StoreRewards-DecpygTj.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-C-Efc4SV.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Cw63xJWj.js} +24 -24
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Bv0_e1wk.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-B_t4xibZ.js} +2 -2
- package/dist/{Tier-C7EiLGJW.js → Tier-D7dHj_zA.js} +26 -26
- package/dist/{Title-DPf-0vrF.js → Title-DqEvTcqS.js} +22 -22
- package/dist/{Transaction-DsAk9Gb9.js → Transaction-Z4qjSyBB.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Csojc1fI.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-D9X2-IIl.js} +6 -6
- package/dist/{Voucher-BKp9CMMe.js → Voucher-BY8YGlpM.js} +18 -18
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Cpn8legF.js → VoucherEditor.vue_vue_type_script_setup_true_lang-3j_0rbsk.js} +12 -12
- package/dist/{WhatsappAccount-DjAL89Re.js → WhatsappAccount-SPlDi9BN.js} +5 -5
- package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-D25DVRXA.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DYXAJ35J.js} +1 -1
- package/dist/{WhatsappBot-CSy_Z1bz.js → WhatsappBot-Oo1KHYLi.js} +5 -5
- package/dist/WhatsappBotSettings-DL1f_qXt.js +387 -0
- package/dist/{WhatsappBotTickets-DS7_jaE3.js → WhatsappBotTickets-CerGACm5.js} +3 -3
- package/dist/WhatsappLayout-B2DrnLNS.js +21 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-D6Z-3QOR.js → ZodTextField.vue_vue_type_script_setup_true_lang-0cvPcwm5.js} +2 -2
- package/dist/{app-BiUEivOU.js → app-bGZlAIpq.js} +227 -217
- package/dist/app.js +1 -1
- package/dist/{base.export-Bvf3GR9p.js → base.export-COcyNfbe.js} +2 -2
- package/dist/{business-DgmJwclv.js → business-DTPgRJRn.js} +5 -5
- package/dist/{campaign-DxjYod5y.js → campaign-Cg6Z_tME.js} +2 -2
- package/dist/{campaign-C9TU71PO.js → campaign-cm9TQ4dw.js} +8 -8
- package/dist/{campaign.fn-BGdwcW0r.js → campaign.fn-CS5nJBxQ.js} +133 -133
- package/dist/{collection.fn-B9t79SwE.js → collection.fn-BYzmqREp.js} +2 -2
- package/dist/{currency-K9kgZvJm.js → currency-Dtmbe1s9.js} +1 -1
- package/dist/{duplicateCampaign-CLeVibNm.js → duplicateCampaign-DFarTXOQ.js} +2 -2
- package/dist/{effect-Bj5p3FOF.js → effect-DAGCCFgZ.js} +1 -1
- package/dist/{email-addresses-CUpmh5j3.js → email-addresses-Dw4rkWem.js} +2 -2
- package/dist/feature-flag-3dM_IVQU.js +50 -0
- package/dist/{helper-iVOlqZr5.js → helper-C-LQhPI2.js} +1 -1
- package/dist/{index-Cq0kWJ_W.js → index-8c7H1u7j.js} +1 -1
- package/dist/{index-YV22ZWWA.js → index-9V_mKS4w.js} +2 -2
- package/dist/{index-CGctGLsw.js → index-B1kMvJbU.js} +1 -1
- package/dist/{index-dEfSQ43r.js → index-B3IhN22s.js} +1 -1
- package/dist/{index-MVfpQsRI.js → index-B3T_0jO2.js} +3 -3
- package/dist/{index-C57WFxg7.js → index-BagVZkdk.js} +2 -2
- package/dist/{index-Dhd9eEjz.js → index-BeW-BxcE.js} +1 -1
- package/dist/{index-C641kFzY.js → index-BoDbRee_.js} +1 -1
- package/dist/{index-DAcwqenP.js → index-C6iTrQ-p.js} +7 -7
- package/dist/{index-D6CbkBm6.js → index-CJMFN-JV.js} +3 -3
- package/dist/{index-CedoUPYn.js → index-CMSKFejw.js} +2 -2
- package/dist/{index-BIqP1bQh.js → index-CpqSrwMX.js} +2 -2
- package/dist/{index-DUr59xHS.js → index-DGp5iEyx.js} +2 -2
- package/dist/{index-DJQVYP1Z.js → index-DGpe4auo.js} +1 -1
- package/dist/{index-BRk5I8NE.js → index-DKm7rszt.js} +1 -1
- package/dist/{index-COB25nai.js → index-DTDGCVKV.js} +4 -4
- package/dist/{index-FcdiLtUc.js → index-DXR3e2yE.js} +8 -8
- package/dist/{index-HctLGyyi.js → index-DzelXsaZ.js} +4 -4
- package/dist/{index-onmieavP.js → index-lSJu-_m2.js} +7746 -5975
- package/dist/{index-DXNB9FHg.js → index-xtTYwD-W.js} +2 -2
- package/dist/{index.esm2017-BUZxOBD5.js → index.esm2017-Bm5C6Wxi.js} +1 -1
- package/dist/{loading-D3jN17Xy.js → loading-DoiqPnnv.js} +1 -1
- package/dist/{lodash-DvKbipfn.js → lodash-CrTM0DQe.js} +1 -1
- package/dist/{member-import-BuytQk0w.js → member-import-_VaTYOMn.js} +1 -1
- package/dist/{membership-Beh_I5Kj.js → membership-Dm8t6-K5.js} +2 -2
- package/dist/{money-C3v95tda.js → money-D0kv1vnT.js} +1 -1
- package/dist/{number-Cc7Yq2nP.js → number-BymDKXn2.js} +1 -1
- package/dist/{objectid-fKMrrct7.js → objectid-CC_whd1t.js} +9 -9
- package/dist/{onboarding-DJgY8HJr.js → onboarding-P6c1Ebh4.js} +3 -3
- package/dist/{onboardingSetup-DJJLdr11.js → onboardingSetup-Ca4782qf.js} +2 -2
- package/dist/{plugins-CcGeLF_l.js → plugins-BN9qJUUc.js} +3 -3
- package/dist/{reward-4aAVrRc8.js → reward-dfKI7Nq1.js} +1 -1
- package/dist/{rule-D6x2GyGw.js → rule-Cu-_boGe.js} +9 -9
- package/dist/{template-Dafdx5YI.js → template-D2qwGN2m.js} +6 -6
- package/dist/{timezone-BDIlVTOp.js → timezone-DjMsHrhm.js} +1 -1
- package/dist/{transaction.fn-CBVylmzu.js → transaction.fn-Bj5yz8tS.js} +2 -2
- package/dist/{trigger-ChNg0oG9.js → trigger-CFjJj6Ri.js} +5 -5
- package/dist/{useMarketingMaterialActions-LSsbTrFn.js → useMarketingMaterialActions-Dx8ZTmHW.js} +3 -3
- package/dist/{usePagination-CqPRf6q3.js → usePagination-CN2auZK8.js} +1 -1
- package/dist/{user-6kqmEFbR.js → user-CL05OSdb.js} +1 -1
- package/dist/{vue-i18n-BJ_ZHWvK.js → vue-i18n-CJMFzslC.js} +383 -383
- package/dist/{xlsx-CWXvmWqg.js → xlsx-BoSbkiXt.js} +1 -1
- package/dist/{zod-DBefBbjY.js → zod-6X3ups5P.js} +1 -1
- package/package.json +1 -1
- package/dist/MainLayout-VDwSL1-n.js +0 -4
- package/dist/WhatsappBotSettings-CxcuCZ-V.js +0 -394
- package/dist/WhatsappLayout-Db3329On.js +0 -21
- package/dist/feature-flag-Dfon0BoK.js +0 -18
- package/dist/index-Cfr0vxa5.js +0 -1775
|
@@ -1,334 +1,333 @@
|
|
|
1
|
-
import { defineComponent as xe, ref as te, h as U, Comment as
|
|
2
|
-
import { useRouter as yt, useRoute as wt, RouterView as
|
|
3
|
-
import { useCoreStore as ge, FeedMeAuth as
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { C as Xe } from "./timezone-
|
|
12
|
-
import { u as
|
|
13
|
-
import { R as
|
|
14
|
-
import { J as
|
|
15
|
-
import { r as Le, L as
|
|
1
|
+
import { defineComponent as xe, ref as te, h as U, Comment as ln, computed as Y, watch as ie, resolveComponent as ee, openBlock as W, createElementBlock as me, createVNode as R, unref as _, createElementVNode as I, toDisplayString as A, createBlock as Oe, withCtx as Z, Fragment as It, renderList as un, onBeforeUnmount as dn, onMounted as hn, createCommentVNode as Pe, nextTick as fn } from "vue";
|
|
2
|
+
import { useRouter as yt, useRoute as wt, RouterView as pn } from "vue-router";
|
|
3
|
+
import { useCoreStore as ge, FeedMeAuth as mn } from "@feedmepos/mf-common";
|
|
4
|
+
import { u as gn } from "./app-wDQR6dpb.js";
|
|
5
|
+
import { u as _n } from "./business-DTPgRJRn.js";
|
|
6
|
+
import { u as Tt } from "./feature-flag-3dM_IVQU.js";
|
|
7
|
+
import "./index-BoDbRee_.js";
|
|
8
|
+
import { components as j, useSnackbar as vn, useDialog as In } from "@feedmepos/ui-library";
|
|
9
|
+
import { u as kt } from "./vue-i18n-CJMFzslC.js";
|
|
10
|
+
import { m as yn } from "./index-DKm7rszt.js";
|
|
11
|
+
import { C as Xe } from "./timezone-DjMsHrhm.js";
|
|
12
|
+
import { u as wn } from "./onboarding-P6c1Ebh4.js";
|
|
13
|
+
import { R as p, A as Tn, a as Qe } from "./app-bGZlAIpq.js";
|
|
14
|
+
import { J as kn } from "./JsonViewer-v8_C7l5N.js";
|
|
15
|
+
import { r as Le, L as bn, g as bt, i as En, a as Sn, _ as Ze, C as et, b as Rn, S as se, c as P, d as X, E as Fe, e as An, f as Et, h as Pn, j as Cn, k as St, l as k, m as Nn, F as Ve, n as On, q as oe, o as Ln, p as Mn, s as Un, t as Dn, u as xn } from "./index.esm2017-Bm5C6Wxi.js";
|
|
16
16
|
import { _ as $e } from "./tslib.es6-BCqqvLQ_.js";
|
|
17
|
-
import { c as
|
|
18
|
-
|
|
19
|
-
const Fn = { class: "flex flex-col h-full justify-between py-16" }, Vn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary text-center" }, $n = /* @__PURE__ */ xe({
|
|
17
|
+
import { S as tt, c as Fn } from "./index-lSJu-_m2.js";
|
|
18
|
+
const Vn = { class: "flex flex-col h-full justify-between py-16" }, $n = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary text-center" }, Hn = /* @__PURE__ */ xe({
|
|
20
19
|
__name: "NavigationTab",
|
|
21
20
|
setup(n) {
|
|
22
|
-
const { t: e, locale: t } =
|
|
21
|
+
const { t: e, locale: t } = kt(), i = wn(), r = Tt(), s = te(), o = [
|
|
23
22
|
{
|
|
24
23
|
label: e("connect.navigation.analytic"),
|
|
25
|
-
value:
|
|
24
|
+
value: p["$connect-ANALYTIC"]
|
|
26
25
|
},
|
|
27
26
|
{
|
|
28
27
|
label: e("connect.navigation.campaign"),
|
|
29
|
-
value:
|
|
28
|
+
value: p["$connect-CAMPAIGN"],
|
|
30
29
|
children: [
|
|
31
30
|
{
|
|
32
31
|
label: e("connect.navigation.promotion"),
|
|
33
|
-
value:
|
|
32
|
+
value: p["$connect-CAMPAIGN_PROMOTION"]
|
|
34
33
|
},
|
|
35
34
|
{
|
|
36
35
|
label: e("connect.navigation.voucher"),
|
|
37
|
-
value:
|
|
36
|
+
value: p["$connect-CAMPAIGN_VOUCHER"]
|
|
38
37
|
},
|
|
39
38
|
{
|
|
40
39
|
label: e("connect.navigation.broadcast"),
|
|
41
|
-
value:
|
|
40
|
+
value: p["$connect-CAMPAIGN_BROADCAST"]
|
|
42
41
|
},
|
|
43
42
|
{
|
|
44
43
|
label: e("connect.navigation.grab"),
|
|
45
|
-
value:
|
|
44
|
+
value: p["$connect-CAMPAIGN_GRAB"]
|
|
46
45
|
}
|
|
47
46
|
]
|
|
48
47
|
},
|
|
49
48
|
{
|
|
50
49
|
label: e("connect.navigation.program"),
|
|
51
|
-
value:
|
|
50
|
+
value: p["$connect-PROGRAM"],
|
|
52
51
|
children: [
|
|
53
52
|
{
|
|
54
53
|
label: e("connect.navigation.tier"),
|
|
55
|
-
value:
|
|
54
|
+
value: p["$connect-PROGRAM_TIER"]
|
|
56
55
|
},
|
|
57
56
|
{
|
|
58
57
|
label: e("connect.navigation.title"),
|
|
59
|
-
value:
|
|
58
|
+
value: p["$connect-PROGRAM_TITLE"]
|
|
60
59
|
},
|
|
61
60
|
{
|
|
62
61
|
label: e("connect.navigation.experience"),
|
|
63
|
-
value:
|
|
62
|
+
value: p["$connect-PROGRAM_EXPERIENCE"]
|
|
64
63
|
},
|
|
65
64
|
{
|
|
66
65
|
label: e("connect.navigation.point"),
|
|
67
|
-
value:
|
|
68
|
-
badge: () => U(
|
|
66
|
+
value: p["$connect-PROGRAM_POINT"],
|
|
67
|
+
badge: () => U(j.FmPill, { variant: "premium" })
|
|
69
68
|
},
|
|
70
69
|
{
|
|
71
70
|
label: e("connect.navigation.credit"),
|
|
72
|
-
value:
|
|
71
|
+
value: p["$connect-PROGRAM_CREDIT"]
|
|
73
72
|
},
|
|
74
73
|
{
|
|
75
74
|
label: e("connect.navigation.game"),
|
|
76
|
-
value:
|
|
77
|
-
badge: () => U(
|
|
75
|
+
value: p["$connect-PROGRAM_GAME"],
|
|
76
|
+
badge: () => U(j.FmPill, { variant: "premium" })
|
|
78
77
|
},
|
|
79
78
|
{
|
|
80
79
|
label: "Mission",
|
|
81
|
-
value:
|
|
80
|
+
value: p["$connect-PROGRAM_MISSION"]
|
|
82
81
|
}
|
|
83
82
|
]
|
|
84
83
|
},
|
|
85
84
|
{
|
|
86
85
|
label: e("connect.navigation.loyalty"),
|
|
87
|
-
value:
|
|
86
|
+
value: p["$connect-LOYALTY"],
|
|
88
87
|
children: [
|
|
89
88
|
{
|
|
90
89
|
label: e("connect.navigation.member"),
|
|
91
|
-
value:
|
|
90
|
+
value: p["$connect-LOYALTY_MEMBER_LIST"]
|
|
92
91
|
},
|
|
93
92
|
{
|
|
94
93
|
label: e("connect.navigation.segments"),
|
|
95
|
-
value:
|
|
96
|
-
badge: () => U(
|
|
94
|
+
value: p["$connect-LOYALTY_SEGMENT"],
|
|
95
|
+
badge: () => U(j.FmPill, { variant: "premium" })
|
|
97
96
|
},
|
|
98
97
|
{
|
|
99
98
|
label: e("connect.navigation.card"),
|
|
100
|
-
value:
|
|
101
|
-
badge: () => U(
|
|
99
|
+
value: p["$connect-LOYALTY_CARD"],
|
|
100
|
+
badge: () => U(j.FmPill, { variant: "premium" })
|
|
102
101
|
}
|
|
103
102
|
]
|
|
104
103
|
},
|
|
105
104
|
{
|
|
106
105
|
label: e("connect.navigation.whatsappBot"),
|
|
107
|
-
value:
|
|
108
|
-
badge: () => U(
|
|
106
|
+
value: p["$connect-WHATSAPP"],
|
|
107
|
+
badge: () => U(j.FmPill, { variant: "beta" })
|
|
109
108
|
},
|
|
110
109
|
{
|
|
111
110
|
label: e("connect.navigation.referral"),
|
|
112
|
-
value:
|
|
113
|
-
badge: () => U(
|
|
111
|
+
value: p["$connect-REFERRAL"],
|
|
112
|
+
badge: () => U(j.FmPill, { variant: "premium" })
|
|
114
113
|
},
|
|
115
114
|
{
|
|
116
115
|
label: e("connect.navigation.store"),
|
|
117
|
-
value:
|
|
116
|
+
value: p["$connect-STORE"]
|
|
118
117
|
},
|
|
119
118
|
{
|
|
120
119
|
label: e("connect.navigation.transaction"),
|
|
121
|
-
value:
|
|
120
|
+
value: p["$connect-TRANSACTION"]
|
|
122
121
|
},
|
|
123
122
|
{
|
|
124
123
|
label: e("connect.navigation.marketingMaterials"),
|
|
125
|
-
value:
|
|
124
|
+
value: p["$connect-MARKETING"]
|
|
126
125
|
},
|
|
127
126
|
{
|
|
128
127
|
label: e("connect.navigation.auditLogs"),
|
|
129
|
-
value:
|
|
128
|
+
value: p["$connect-AUDIT_LOGS"]
|
|
130
129
|
},
|
|
131
130
|
{
|
|
132
131
|
label: e("connect.navigation.review"),
|
|
133
|
-
value:
|
|
132
|
+
value: p["$connect-REVIEW"]
|
|
134
133
|
},
|
|
135
134
|
{
|
|
136
135
|
label: e("connect.navigation.goals"),
|
|
137
|
-
value:
|
|
138
|
-
badge: () => i.goalsRemaining > 0 ? U(
|
|
136
|
+
value: p["$connect-GOALS"],
|
|
137
|
+
badge: () => i.goalsRemaining > 0 ? U(j.FmBadge, {
|
|
139
138
|
variant: "numeric",
|
|
140
139
|
inline: !0,
|
|
141
140
|
value: i.goalsRemaining
|
|
142
|
-
}) : U(
|
|
141
|
+
}) : U(ln)
|
|
143
142
|
},
|
|
144
143
|
{
|
|
145
144
|
label: e("connect.navigation.setting"),
|
|
146
|
-
value:
|
|
145
|
+
value: p["$connect-SETTING"]
|
|
147
146
|
},
|
|
148
147
|
{
|
|
149
148
|
label: e("connect.navigation.bin"),
|
|
150
|
-
value:
|
|
149
|
+
value: p["$connect-BIN"]
|
|
151
150
|
}
|
|
152
|
-
],
|
|
153
|
-
() =>
|
|
154
|
-
(f) => f.value !==
|
|
151
|
+
], c = Y(
|
|
152
|
+
() => o.filter(
|
|
153
|
+
(f) => f.value !== p["$connect-WHATSAPP"] || r.whatsappBotEnabled
|
|
155
154
|
)
|
|
156
|
-
),
|
|
157
|
-
const f =
|
|
155
|
+
), a = yt(), l = wt(), d = o.reduce((f, w) => [...(w.children ?? []).map((h) => h.value), ...f, w.value], []), m = ge(), v = Y(() => {
|
|
156
|
+
const f = m.currentCountry.value || "MY";
|
|
158
157
|
return console.log(`[MF] Timezone set to: ${Xe[f]}`), Xe[f];
|
|
159
158
|
});
|
|
160
|
-
|
|
159
|
+
ie(
|
|
161
160
|
// Watch `route.matched`, not `route`: `useRoute()` returns a reactive object
|
|
162
161
|
// whose identity never changes, so watching it directly fired once via
|
|
163
162
|
// `immediate` and the highlight then stayed on whatever page loaded first.
|
|
164
|
-
() =>
|
|
163
|
+
() => l.matched,
|
|
165
164
|
(f) => {
|
|
166
|
-
const
|
|
167
|
-
|
|
165
|
+
const h = f.map((g) => g.name).reverse().find((g) => d.includes(g));
|
|
166
|
+
h && (s.value = h);
|
|
168
167
|
},
|
|
169
168
|
{ immediate: !0 }
|
|
170
|
-
),
|
|
169
|
+
), ie(
|
|
171
170
|
[() => {
|
|
172
171
|
var f;
|
|
173
|
-
return (f =
|
|
174
|
-
}, () =>
|
|
172
|
+
return (f = m.currentBusiness.value) == null ? void 0 : f._id;
|
|
173
|
+
}, () => l.name, t],
|
|
175
174
|
([f]) => {
|
|
176
175
|
f && i.read(t.value, f);
|
|
177
176
|
},
|
|
178
177
|
{ immediate: !0 }
|
|
179
178
|
);
|
|
180
179
|
async function y(f) {
|
|
181
|
-
await
|
|
180
|
+
await a.push({ name: f });
|
|
182
181
|
}
|
|
183
|
-
return (f,
|
|
182
|
+
return (f, w) => {
|
|
184
183
|
var g;
|
|
185
|
-
const
|
|
186
|
-
return
|
|
187
|
-
|
|
184
|
+
const h = ee("FmCollapsibleTabs");
|
|
185
|
+
return W(), me("div", Vn, [
|
|
186
|
+
R(h, {
|
|
188
187
|
class: "border-fm-color-neutral-gray-100 border-r px-4",
|
|
189
|
-
"model-value": (g = _(
|
|
190
|
-
items: _(
|
|
188
|
+
"model-value": (g = _(s)) == null ? void 0 : g.toString(),
|
|
189
|
+
items: _(c),
|
|
191
190
|
"onUpdate:modelValue": y
|
|
192
191
|
}, null, 8, ["model-value", "items"]),
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
I("div", $n, [
|
|
193
|
+
I("div", null, "Timezone: " + A(_(v).split("/")[1].replace("_", " ")), 1),
|
|
194
|
+
I("div", null, "(UTC" + A(_(yn).tz(_(v)).format("Z")) + ")", 1)
|
|
196
195
|
])
|
|
197
196
|
]);
|
|
198
197
|
};
|
|
199
198
|
}
|
|
200
|
-
}),
|
|
201
|
-
function
|
|
199
|
+
}), Rt = "feedme_connect_marketing_promo_hidden";
|
|
200
|
+
function jn() {
|
|
202
201
|
try {
|
|
203
|
-
return localStorage.getItem(
|
|
202
|
+
return localStorage.getItem(Rt) !== null;
|
|
204
203
|
} catch {
|
|
205
204
|
return !1;
|
|
206
205
|
}
|
|
207
206
|
}
|
|
208
207
|
function Wn() {
|
|
209
208
|
try {
|
|
210
|
-
localStorage.setItem(
|
|
209
|
+
localStorage.setItem(Rt, (/* @__PURE__ */ new Date()).toISOString());
|
|
211
210
|
} catch {
|
|
212
211
|
}
|
|
213
212
|
}
|
|
214
|
-
const
|
|
213
|
+
const Bn = { class: "flex flex-col gap-12" }, Gn = { class: "fm-corner-radius-xxl bg-fm-color-primary-oats flex items-start gap-4 self-start px-12 py-4" }, zn = { class: "fm-typo-en-body-sm-600 text-fm-color-primary" }, qn = { class: "fm-typo-en-title-sm-800 max-w-[560px] leading-[42px]" }, Kn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary max-w-[600px]" }, Jn = { class: "flex flex-col gap-24 pb-8" }, Yn = { class: "grid grid-cols-1 gap-16 sm:grid-cols-3 md:grid-cols-3 lg:grid-cols-3" }, Xn = { class: "fm-corner-radius-sm bg-fm-color-primary-oats flex h-40 w-40 shrink-0 items-center justify-center" }, Qn = { class: "fm-typo-en-body-lg-600" }, Zn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, ei = { class: "shrink-0" }, ti = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ni = { class: "flex w-full flex-col gap-12 px-[16px]" }, ii = { class: "flex flex-wrap items-center gap-12" }, ri = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, si = /* @__PURE__ */ xe({
|
|
215
214
|
__name: "AiMarketingPromoDialog",
|
|
216
215
|
setup(n) {
|
|
217
216
|
let e = !1;
|
|
218
|
-
const { t } =
|
|
217
|
+
const { t } = kt(), i = yt(), { sessionUser: r, currentCountry: s } = ge(), o = te(!1), c = [
|
|
219
218
|
{ key: "completeContent", icon: "layers" },
|
|
220
219
|
{ key: "realContext", icon: "storefront" },
|
|
221
220
|
{ key: "socialFormat", icon: "aspect_ratio" }
|
|
222
221
|
], a = Y(() => {
|
|
223
|
-
var
|
|
224
|
-
const
|
|
225
|
-
return
|
|
222
|
+
var f;
|
|
223
|
+
const y = ((f = r.value) == null ? void 0 : f.permissions) ?? [];
|
|
224
|
+
return Tn(
|
|
226
225
|
[
|
|
227
226
|
{
|
|
228
227
|
action: Qe.Action.manage,
|
|
229
228
|
subject: Qe.Subject.Business.crm_marketingMaterial
|
|
230
229
|
}
|
|
231
230
|
],
|
|
232
|
-
|
|
231
|
+
y
|
|
233
232
|
).granted;
|
|
234
233
|
}), l = Y(
|
|
235
234
|
() => s.value === "MY" && a.value
|
|
236
235
|
);
|
|
237
236
|
let d = !1;
|
|
238
|
-
|
|
237
|
+
ie(
|
|
239
238
|
l,
|
|
240
|
-
(
|
|
241
|
-
d || !
|
|
239
|
+
(y) => {
|
|
240
|
+
d || !y || (d = !0, !(jn() || e) && (e = !0, o.value = !0));
|
|
242
241
|
},
|
|
243
242
|
{ immediate: !0 }
|
|
244
243
|
);
|
|
245
244
|
async function m() {
|
|
246
|
-
o.value = !1, await i.push({ name:
|
|
245
|
+
o.value = !1, await i.push({ name: p["$connect-MARKETING"] });
|
|
247
246
|
}
|
|
248
|
-
function
|
|
247
|
+
function v() {
|
|
249
248
|
Wn(), o.value = !1;
|
|
250
249
|
}
|
|
251
|
-
return (
|
|
252
|
-
const
|
|
253
|
-
return
|
|
250
|
+
return (y, f) => {
|
|
251
|
+
const w = ee("FmIcon"), h = ee("FmCard"), g = ee("FmButton"), b = ee("FmDialog");
|
|
252
|
+
return W(), Oe(b, {
|
|
254
253
|
modelValue: o.value,
|
|
255
|
-
"onUpdate:modelValue":
|
|
254
|
+
"onUpdate:modelValue": f[0] || (f[0] = (T) => o.value = T),
|
|
256
255
|
"min-width": "min(500px, calc(100% - 48px))",
|
|
257
256
|
"max-width": "min(860px, calc(100% - 48px))",
|
|
258
257
|
"max-height": "90vh",
|
|
259
258
|
"dismiss-away": ""
|
|
260
259
|
}, {
|
|
261
260
|
"dialog-header": Z(() => [
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
261
|
+
I("div", Bn, [
|
|
262
|
+
I("div", Gn, [
|
|
263
|
+
R(w, {
|
|
265
264
|
name: "auto_awesome",
|
|
266
265
|
size: "sm",
|
|
267
266
|
color: "primary"
|
|
268
267
|
}),
|
|
269
|
-
|
|
268
|
+
I("span", zn, A(_(t)("connect.marketing.whatsNew.badge")), 1)
|
|
270
269
|
]),
|
|
271
|
-
|
|
272
|
-
|
|
270
|
+
I("h1", qn, A(_(t)("connect.marketing.whatsNew.title")), 1),
|
|
271
|
+
I("p", Kn, A(_(t)("connect.marketing.whatsNew.subtitle")), 1)
|
|
273
272
|
])
|
|
274
273
|
]),
|
|
275
274
|
"dialog-footer": Z(() => [
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
275
|
+
I("div", ni, [
|
|
276
|
+
I("div", ii, [
|
|
277
|
+
R(g, {
|
|
279
278
|
variant: "primary",
|
|
280
279
|
size: "lg",
|
|
281
280
|
label: _(t)("connect.marketing.whatsNew.cta"),
|
|
282
281
|
"append-icon": "arrow_forward",
|
|
283
282
|
onClick: m
|
|
284
283
|
}, null, 8, ["label"]),
|
|
285
|
-
|
|
284
|
+
R(g, {
|
|
286
285
|
variant: "tertiary",
|
|
287
286
|
size: "lg",
|
|
288
287
|
label: _(t)("connect.marketing.whatsNew.dismiss"),
|
|
289
|
-
onClick:
|
|
288
|
+
onClick: v
|
|
290
289
|
}, null, 8, ["label"])
|
|
291
290
|
]),
|
|
292
|
-
|
|
291
|
+
I("div", ri, A(_(t)("connect.marketing.whatsNew.footnote")), 1)
|
|
293
292
|
])
|
|
294
293
|
]),
|
|
295
294
|
default: Z(() => [
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
(
|
|
299
|
-
key:
|
|
295
|
+
I("div", Jn, [
|
|
296
|
+
I("div", Yn, [
|
|
297
|
+
(W(), me(It, null, un(c, (T) => R(h, {
|
|
298
|
+
key: T.key,
|
|
300
299
|
variant: "outlined",
|
|
301
300
|
class: "!h-full flex flex-col gap-8 p-16"
|
|
302
301
|
}, {
|
|
303
302
|
default: Z(() => [
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
name:
|
|
303
|
+
I("div", Xn, [
|
|
304
|
+
R(w, {
|
|
305
|
+
name: T.icon,
|
|
307
306
|
size: "md",
|
|
308
307
|
color: "primary"
|
|
309
308
|
}, null, 8, ["name"])
|
|
310
309
|
]),
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
`connect.marketing.whatsNew.benefits.${
|
|
310
|
+
I("div", Qn, A(_(t)(`connect.marketing.whatsNew.benefits.${T.key}.title`)), 1),
|
|
311
|
+
I("div", Zn, A(_(t)(
|
|
312
|
+
`connect.marketing.whatsNew.benefits.${T.key}.description`
|
|
314
313
|
)), 1)
|
|
315
314
|
]),
|
|
316
315
|
_: 2
|
|
317
316
|
}, 1024)), 64))
|
|
318
317
|
]),
|
|
319
|
-
|
|
318
|
+
R(h, {
|
|
320
319
|
variant: "outlined",
|
|
321
320
|
class: "flex items-start gap-12 p-16"
|
|
322
321
|
}, {
|
|
323
322
|
default: Z(() => [
|
|
324
|
-
|
|
325
|
-
|
|
323
|
+
I("div", ei, [
|
|
324
|
+
R(w, {
|
|
326
325
|
name: "lightbulb",
|
|
327
326
|
size: "md",
|
|
328
327
|
color: "primary"
|
|
329
328
|
})
|
|
330
329
|
]),
|
|
331
|
-
|
|
330
|
+
I("p", ti, A(_(t)("connect.marketing.whatsNew.callout")), 1)
|
|
332
331
|
]),
|
|
333
332
|
_: 1
|
|
334
333
|
})
|
|
@@ -339,7 +338,7 @@ const jn = { class: "flex flex-col gap-12" }, Bn = { class: "fm-corner-radius-xx
|
|
|
339
338
|
};
|
|
340
339
|
}
|
|
341
340
|
});
|
|
342
|
-
var
|
|
341
|
+
var oi = "firebase", ai = "10.12.4";
|
|
343
342
|
/**
|
|
344
343
|
* @license
|
|
345
344
|
* Copyright 2020 Google LLC
|
|
@@ -356,13 +355,13 @@ var si = "firebase", oi = "10.12.4";
|
|
|
356
355
|
* See the License for the specific language governing permissions and
|
|
357
356
|
* limitations under the License.
|
|
358
357
|
*/
|
|
359
|
-
Le(
|
|
360
|
-
function
|
|
358
|
+
Le(oi, ai, "app");
|
|
359
|
+
function At() {
|
|
361
360
|
return {
|
|
362
361
|
"dependent-sdk-initialized-before-auth": "Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."
|
|
363
362
|
};
|
|
364
363
|
}
|
|
365
|
-
const
|
|
364
|
+
const ci = At, Pt = new Fe("auth", "Firebase", At());
|
|
366
365
|
/**
|
|
367
366
|
* @license
|
|
368
367
|
* Copyright 2020 Google LLC
|
|
@@ -379,12 +378,12 @@ const ai = Rt, At = new Fe("auth", "Firebase", Rt());
|
|
|
379
378
|
* See the License for the specific language governing permissions and
|
|
380
379
|
* limitations under the License.
|
|
381
380
|
*/
|
|
382
|
-
const _e = new
|
|
383
|
-
function
|
|
384
|
-
_e.logLevel <=
|
|
381
|
+
const _e = new bn("@firebase/auth");
|
|
382
|
+
function li(n, ...e) {
|
|
383
|
+
_e.logLevel <= St.WARN && _e.warn(`Auth (${se}): ${n}`, ...e);
|
|
385
384
|
}
|
|
386
|
-
function
|
|
387
|
-
_e.logLevel <=
|
|
385
|
+
function de(n, ...e) {
|
|
386
|
+
_e.logLevel <= St.ERROR && _e.error(`Auth (${se}): ${n}`, ...e);
|
|
388
387
|
}
|
|
389
388
|
/**
|
|
390
389
|
* @license
|
|
@@ -402,38 +401,38 @@ function ue(n, ...e) {
|
|
|
402
401
|
* See the License for the specific language governing permissions and
|
|
403
402
|
* limitations under the License.
|
|
404
403
|
*/
|
|
405
|
-
function
|
|
404
|
+
function L(n, ...e) {
|
|
406
405
|
throw He(n, ...e);
|
|
407
406
|
}
|
|
408
|
-
function
|
|
407
|
+
function E(n, ...e) {
|
|
409
408
|
return He(n, ...e);
|
|
410
409
|
}
|
|
411
|
-
function
|
|
412
|
-
const i = Object.assign(Object.assign({},
|
|
410
|
+
function Ct(n, e, t) {
|
|
411
|
+
const i = Object.assign(Object.assign({}, ci()), { [e]: t });
|
|
413
412
|
return new Fe("auth", "Firebase", i).create(e, {
|
|
414
413
|
appName: n.name
|
|
415
414
|
});
|
|
416
415
|
}
|
|
417
416
|
function H(n) {
|
|
418
|
-
return
|
|
417
|
+
return Ct(n, "operation-not-supported-in-this-environment", "Operations that alter the current user are not supported in conjunction with FirebaseServerApp");
|
|
419
418
|
}
|
|
420
419
|
function He(n, ...e) {
|
|
421
420
|
if (typeof n != "string") {
|
|
422
421
|
const t = e[0], i = [...e.slice(1)];
|
|
423
422
|
return i[0] && (i[0].appName = n.name), n._errorFactory.create(t, ...i);
|
|
424
423
|
}
|
|
425
|
-
return
|
|
424
|
+
return Pt.create(n, ...e);
|
|
426
425
|
}
|
|
427
426
|
function u(n, e, ...t) {
|
|
428
427
|
if (!n)
|
|
429
428
|
throw He(e, ...t);
|
|
430
429
|
}
|
|
431
|
-
function
|
|
430
|
+
function C(n) {
|
|
432
431
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
433
|
-
throw
|
|
432
|
+
throw de(e), new Error(e);
|
|
434
433
|
}
|
|
435
|
-
function
|
|
436
|
-
n ||
|
|
434
|
+
function M(n, e) {
|
|
435
|
+
n || C(e);
|
|
437
436
|
}
|
|
438
437
|
/**
|
|
439
438
|
* @license
|
|
@@ -455,7 +454,7 @@ function Me() {
|
|
|
455
454
|
var n;
|
|
456
455
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
457
456
|
}
|
|
458
|
-
function
|
|
457
|
+
function ui() {
|
|
459
458
|
return nt() === "http:" || nt() === "https:";
|
|
460
459
|
}
|
|
461
460
|
function nt() {
|
|
@@ -478,15 +477,15 @@ function nt() {
|
|
|
478
477
|
* See the License for the specific language governing permissions and
|
|
479
478
|
* limitations under the License.
|
|
480
479
|
*/
|
|
481
|
-
function
|
|
480
|
+
function di() {
|
|
482
481
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
483
482
|
// This is especially true for Cordova apps which have unreliable
|
|
484
483
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
485
484
|
// installed which overwrites the native navigator.onLine value and
|
|
486
485
|
// defines navigator.connection.
|
|
487
|
-
(
|
|
486
|
+
(ui() || Rn() || "connection" in navigator) ? navigator.onLine : !0;
|
|
488
487
|
}
|
|
489
|
-
function
|
|
488
|
+
function hi() {
|
|
490
489
|
if (typeof navigator > "u")
|
|
491
490
|
return null;
|
|
492
491
|
const n = navigator;
|
|
@@ -514,12 +513,12 @@ function di() {
|
|
|
514
513
|
* See the License for the specific language governing permissions and
|
|
515
514
|
* limitations under the License.
|
|
516
515
|
*/
|
|
517
|
-
class
|
|
516
|
+
class ae {
|
|
518
517
|
constructor(e, t) {
|
|
519
|
-
this.shortDelay = e, this.longDelay = t,
|
|
518
|
+
this.shortDelay = e, this.longDelay = t, M(t > e, "Short delay should be less than long delay!"), this.isMobile = En() || Sn();
|
|
520
519
|
}
|
|
521
520
|
get() {
|
|
522
|
-
return
|
|
521
|
+
return di() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
523
522
|
}
|
|
524
523
|
}
|
|
525
524
|
/**
|
|
@@ -538,8 +537,8 @@ class oe {
|
|
|
538
537
|
* See the License for the specific language governing permissions and
|
|
539
538
|
* limitations under the License.
|
|
540
539
|
*/
|
|
541
|
-
function
|
|
542
|
-
|
|
540
|
+
function je(n, e) {
|
|
541
|
+
M(n.emulator, "Emulator should always be set here");
|
|
543
542
|
const { url: t } = n.emulator;
|
|
544
543
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
545
544
|
}
|
|
@@ -559,7 +558,7 @@ function We(n, e) {
|
|
|
559
558
|
* See the License for the specific language governing permissions and
|
|
560
559
|
* limitations under the License.
|
|
561
560
|
*/
|
|
562
|
-
class
|
|
561
|
+
class Nt {
|
|
563
562
|
static initialize(e, t, i) {
|
|
564
563
|
this.fetchImpl = e, t && (this.headersImpl = t), i && (this.responseImpl = i);
|
|
565
564
|
}
|
|
@@ -572,7 +571,7 @@ class Ct {
|
|
|
572
571
|
return globalThis.fetch;
|
|
573
572
|
if (typeof fetch < "u")
|
|
574
573
|
return fetch;
|
|
575
|
-
|
|
574
|
+
C("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
576
575
|
}
|
|
577
576
|
static headers() {
|
|
578
577
|
if (this.headersImpl)
|
|
@@ -583,7 +582,7 @@ class Ct {
|
|
|
583
582
|
return globalThis.Headers;
|
|
584
583
|
if (typeof Headers < "u")
|
|
585
584
|
return Headers;
|
|
586
|
-
|
|
585
|
+
C("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
587
586
|
}
|
|
588
587
|
static response() {
|
|
589
588
|
if (this.responseImpl)
|
|
@@ -594,7 +593,7 @@ class Ct {
|
|
|
594
593
|
return globalThis.Response;
|
|
595
594
|
if (typeof Response < "u")
|
|
596
595
|
return Response;
|
|
597
|
-
|
|
596
|
+
C("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill");
|
|
598
597
|
}
|
|
599
598
|
}
|
|
600
599
|
/**
|
|
@@ -613,7 +612,7 @@ class Ct {
|
|
|
613
612
|
* See the License for the specific language governing permissions and
|
|
614
613
|
* limitations under the License.
|
|
615
614
|
*/
|
|
616
|
-
const
|
|
615
|
+
const fi = {
|
|
617
616
|
// Custom token errors.
|
|
618
617
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
619
618
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -704,93 +703,93 @@ const hi = {
|
|
|
704
703
|
* See the License for the specific language governing permissions and
|
|
705
704
|
* limitations under the License.
|
|
706
705
|
*/
|
|
707
|
-
const
|
|
706
|
+
const pi = new ae(3e4, 6e4);
|
|
708
707
|
function Te(n, e) {
|
|
709
708
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
710
709
|
}
|
|
711
710
|
async function Q(n, e, t, i, r = {}) {
|
|
712
|
-
return
|
|
711
|
+
return Ot(n, r, async () => {
|
|
713
712
|
let s = {}, o = {};
|
|
714
713
|
i && (e === "GET" ? o = i : s = {
|
|
715
714
|
body: JSON.stringify(i)
|
|
716
715
|
});
|
|
717
|
-
const c =
|
|
716
|
+
const c = oe(Object.assign({ key: n.config.apiKey }, o)).slice(1), a = await n._getAdditionalHeaders();
|
|
718
717
|
return a[
|
|
719
718
|
"Content-Type"
|
|
720
719
|
/* HttpHeader.CONTENT_TYPE */
|
|
721
720
|
] = "application/json", n.languageCode && (a[
|
|
722
721
|
"X-Firebase-Locale"
|
|
723
722
|
/* HttpHeader.X_FIREBASE_LOCALE */
|
|
724
|
-
] = n.languageCode),
|
|
723
|
+
] = n.languageCode), Nt.fetch()(Mt(n, n.config.apiHost, t, c), Object.assign({
|
|
725
724
|
method: e,
|
|
726
725
|
headers: a,
|
|
727
726
|
referrerPolicy: "no-referrer"
|
|
728
727
|
}, s));
|
|
729
728
|
});
|
|
730
729
|
}
|
|
731
|
-
async function
|
|
730
|
+
async function Ot(n, e, t) {
|
|
732
731
|
n._canInitEmulator = !1;
|
|
733
|
-
const i = Object.assign(Object.assign({},
|
|
732
|
+
const i = Object.assign(Object.assign({}, fi), e);
|
|
734
733
|
try {
|
|
735
|
-
const r = new
|
|
734
|
+
const r = new mi(n), s = await Promise.race([
|
|
736
735
|
t(),
|
|
737
736
|
r.promise
|
|
738
737
|
]);
|
|
739
738
|
r.clearNetworkTimeout();
|
|
740
739
|
const o = await s.json();
|
|
741
740
|
if ("needConfirmation" in o)
|
|
742
|
-
throw
|
|
741
|
+
throw ue(n, "account-exists-with-different-credential", o);
|
|
743
742
|
if (s.ok && !("errorMessage" in o))
|
|
744
743
|
return o;
|
|
745
744
|
{
|
|
746
745
|
const c = s.ok ? o.errorMessage : o.error.message, [a, l] = c.split(" : ");
|
|
747
746
|
if (a === "FEDERATED_USER_ID_ALREADY_LINKED")
|
|
748
|
-
throw
|
|
747
|
+
throw ue(n, "credential-already-in-use", o);
|
|
749
748
|
if (a === "EMAIL_EXISTS")
|
|
750
|
-
throw
|
|
749
|
+
throw ue(n, "email-already-in-use", o);
|
|
751
750
|
if (a === "USER_DISABLED")
|
|
752
|
-
throw
|
|
751
|
+
throw ue(n, "user-disabled", o);
|
|
753
752
|
const d = i[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
|
754
753
|
if (l)
|
|
755
|
-
throw
|
|
756
|
-
|
|
754
|
+
throw Ct(n, d, l);
|
|
755
|
+
L(n, d);
|
|
757
756
|
}
|
|
758
757
|
} catch (r) {
|
|
759
758
|
if (r instanceof Ve)
|
|
760
759
|
throw r;
|
|
761
|
-
|
|
760
|
+
L(n, "network-request-failed", { message: String(r) });
|
|
762
761
|
}
|
|
763
762
|
}
|
|
764
|
-
async function
|
|
763
|
+
async function Lt(n, e, t, i, r = {}) {
|
|
765
764
|
const s = await Q(n, e, t, i, r);
|
|
766
|
-
return "mfaPendingCredential" in s &&
|
|
765
|
+
return "mfaPendingCredential" in s && L(n, "multi-factor-auth-required", {
|
|
767
766
|
_serverResponse: s
|
|
768
767
|
}), s;
|
|
769
768
|
}
|
|
770
|
-
function
|
|
769
|
+
function Mt(n, e, t, i) {
|
|
771
770
|
const r = `${e}${t}?${i}`;
|
|
772
|
-
return n.config.emulator ?
|
|
771
|
+
return n.config.emulator ? je(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
773
772
|
}
|
|
774
|
-
class
|
|
773
|
+
class mi {
|
|
775
774
|
constructor(e) {
|
|
776
775
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
777
|
-
this.timer = setTimeout(() => i(
|
|
776
|
+
this.timer = setTimeout(() => i(E(
|
|
778
777
|
this.auth,
|
|
779
778
|
"network-request-failed"
|
|
780
779
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
781
|
-
)),
|
|
780
|
+
)), pi.get());
|
|
782
781
|
});
|
|
783
782
|
}
|
|
784
783
|
clearNetworkTimeout() {
|
|
785
784
|
clearTimeout(this.timer);
|
|
786
785
|
}
|
|
787
786
|
}
|
|
788
|
-
function
|
|
787
|
+
function ue(n, e, t) {
|
|
789
788
|
const i = {
|
|
790
789
|
appName: n.name
|
|
791
790
|
};
|
|
792
791
|
t.email && (i.email = t.email), t.phoneNumber && (i.phoneNumber = t.phoneNumber);
|
|
793
|
-
const r =
|
|
792
|
+
const r = E(n, e, i);
|
|
794
793
|
return r.customData._tokenResponse = t, r;
|
|
795
794
|
}
|
|
796
795
|
/**
|
|
@@ -809,10 +808,10 @@ function le(n, e, t) {
|
|
|
809
808
|
* See the License for the specific language governing permissions and
|
|
810
809
|
* limitations under the License.
|
|
811
810
|
*/
|
|
812
|
-
async function
|
|
811
|
+
async function gi(n, e) {
|
|
813
812
|
return Q(n, "POST", "/v1/accounts:delete", e);
|
|
814
813
|
}
|
|
815
|
-
async function
|
|
814
|
+
async function Ut(n, e) {
|
|
816
815
|
return Q(n, "POST", "/v1/accounts:lookup", e);
|
|
817
816
|
}
|
|
818
817
|
/**
|
|
@@ -840,8 +839,8 @@ function ne(n) {
|
|
|
840
839
|
} catch {
|
|
841
840
|
}
|
|
842
841
|
}
|
|
843
|
-
async function
|
|
844
|
-
const t = X(n), i = await t.getIdToken(e), r =
|
|
842
|
+
async function _i(n, e = !1) {
|
|
843
|
+
const t = X(n), i = await t.getIdToken(e), r = We(i);
|
|
845
844
|
u(
|
|
846
845
|
r && r.exp && r.auth_time && r.iat,
|
|
847
846
|
t.auth,
|
|
@@ -862,19 +861,19 @@ async function gi(n, e = !1) {
|
|
|
862
861
|
function Ce(n) {
|
|
863
862
|
return Number(n) * 1e3;
|
|
864
863
|
}
|
|
865
|
-
function
|
|
864
|
+
function We(n) {
|
|
866
865
|
const [e, t, i] = n.split(".");
|
|
867
866
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
868
|
-
return
|
|
867
|
+
return de("JWT malformed, contained fewer than 3 sections"), null;
|
|
869
868
|
try {
|
|
870
|
-
const r =
|
|
871
|
-
return r ? JSON.parse(r) : (
|
|
869
|
+
const r = On(t);
|
|
870
|
+
return r ? JSON.parse(r) : (de("Failed to decode base64 JWT payload"), null);
|
|
872
871
|
} catch (r) {
|
|
873
|
-
return
|
|
872
|
+
return de("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
874
873
|
}
|
|
875
874
|
}
|
|
876
875
|
function it(n) {
|
|
877
|
-
const e =
|
|
876
|
+
const e = We(n);
|
|
878
877
|
return u(
|
|
879
878
|
e,
|
|
880
879
|
"internal-error"
|
|
@@ -905,16 +904,16 @@ function it(n) {
|
|
|
905
904
|
* See the License for the specific language governing permissions and
|
|
906
905
|
* limitations under the License.
|
|
907
906
|
*/
|
|
908
|
-
async function
|
|
907
|
+
async function re(n, e, t = !1) {
|
|
909
908
|
if (t)
|
|
910
909
|
return e;
|
|
911
910
|
try {
|
|
912
911
|
return await e;
|
|
913
912
|
} catch (i) {
|
|
914
|
-
throw i instanceof Ve &&
|
|
913
|
+
throw i instanceof Ve && vi(i) && n.auth.currentUser === n && await n.auth.signOut(), i;
|
|
915
914
|
}
|
|
916
915
|
}
|
|
917
|
-
function
|
|
916
|
+
function vi({ code: n }) {
|
|
918
917
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
919
918
|
}
|
|
920
919
|
/**
|
|
@@ -933,7 +932,7 @@ function _i({ code: n }) {
|
|
|
933
932
|
* See the License for the specific language governing permissions and
|
|
934
933
|
* limitations under the License.
|
|
935
934
|
*/
|
|
936
|
-
class
|
|
935
|
+
class Ii {
|
|
937
936
|
constructor(e) {
|
|
938
937
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
939
938
|
}
|
|
@@ -1030,7 +1029,7 @@ class Ue {
|
|
|
1030
1029
|
*/
|
|
1031
1030
|
async function ve(n) {
|
|
1032
1031
|
var e;
|
|
1033
|
-
const t = n.auth, i = await n.getIdToken(), r = await
|
|
1032
|
+
const t = n.auth, i = await n.getIdToken(), r = await re(n, Ut(t, { idToken: i }));
|
|
1034
1033
|
u(
|
|
1035
1034
|
r == null ? void 0 : r.users.length,
|
|
1036
1035
|
t,
|
|
@@ -1039,7 +1038,7 @@ async function ve(n) {
|
|
|
1039
1038
|
);
|
|
1040
1039
|
const s = r.users[0];
|
|
1041
1040
|
n._notifyReloadListener(s);
|
|
1042
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ?
|
|
1041
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? Dt(s.providerUserInfo) : [], c = wi(n.providerData, o), a = n.isAnonymous, l = !(n.email && s.passwordHash) && !(c != null && c.length), d = a ? l : !1, m = {
|
|
1043
1042
|
uid: s.localId,
|
|
1044
1043
|
displayName: s.displayName || null,
|
|
1045
1044
|
photoURL: s.photoUrl || null,
|
|
@@ -1053,14 +1052,14 @@ async function ve(n) {
|
|
|
1053
1052
|
};
|
|
1054
1053
|
Object.assign(n, m);
|
|
1055
1054
|
}
|
|
1056
|
-
async function
|
|
1055
|
+
async function yi(n) {
|
|
1057
1056
|
const e = X(n);
|
|
1058
1057
|
await ve(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
1059
1058
|
}
|
|
1060
|
-
function
|
|
1059
|
+
function wi(n, e) {
|
|
1061
1060
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
1062
1061
|
}
|
|
1063
|
-
function
|
|
1062
|
+
function Dt(n) {
|
|
1064
1063
|
return n.map((e) => {
|
|
1065
1064
|
var { providerId: t } = e, i = $e(e, ["providerId"]);
|
|
1066
1065
|
return {
|
|
@@ -1089,16 +1088,16 @@ function Ut(n) {
|
|
|
1089
1088
|
* See the License for the specific language governing permissions and
|
|
1090
1089
|
* limitations under the License.
|
|
1091
1090
|
*/
|
|
1092
|
-
async function
|
|
1093
|
-
const t = await
|
|
1094
|
-
const i =
|
|
1091
|
+
async function Ti(n, e) {
|
|
1092
|
+
const t = await Ot(n, {}, async () => {
|
|
1093
|
+
const i = oe({
|
|
1095
1094
|
grant_type: "refresh_token",
|
|
1096
1095
|
refresh_token: e
|
|
1097
|
-
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o =
|
|
1096
|
+
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o = Mt(n, r, "/v1/token", `key=${s}`), c = await n._getAdditionalHeaders();
|
|
1098
1097
|
return c[
|
|
1099
1098
|
"Content-Type"
|
|
1100
1099
|
/* HttpHeader.CONTENT_TYPE */
|
|
1101
|
-
] = "application/x-www-form-urlencoded",
|
|
1100
|
+
] = "application/x-www-form-urlencoded", Nt.fetch()(o, {
|
|
1102
1101
|
method: "POST",
|
|
1103
1102
|
headers: c,
|
|
1104
1103
|
body: i
|
|
@@ -1110,7 +1109,7 @@ async function wi(n, e) {
|
|
|
1110
1109
|
refreshToken: t.refresh_token
|
|
1111
1110
|
};
|
|
1112
1111
|
}
|
|
1113
|
-
async function
|
|
1112
|
+
async function ki(n, e) {
|
|
1114
1113
|
return Q(n, "POST", "/v2/accounts:revokeToken", Te(n, e));
|
|
1115
1114
|
}
|
|
1116
1115
|
/**
|
|
@@ -1174,7 +1173,7 @@ class q {
|
|
|
1174
1173
|
this.refreshToken = null;
|
|
1175
1174
|
}
|
|
1176
1175
|
async refresh(e, t) {
|
|
1177
|
-
const { accessToken: i, refreshToken: r, expiresIn: s } = await
|
|
1176
|
+
const { accessToken: i, refreshToken: r, expiresIn: s } = await Ti(e, t);
|
|
1178
1177
|
this.updateTokensAndExpiration(i, r, Number(s));
|
|
1179
1178
|
}
|
|
1180
1179
|
updateTokensAndExpiration(e, t, i) {
|
|
@@ -1204,7 +1203,7 @@ class q {
|
|
|
1204
1203
|
return Object.assign(new q(), this.toJSON());
|
|
1205
1204
|
}
|
|
1206
1205
|
_performRefresh() {
|
|
1207
|
-
return
|
|
1206
|
+
return C("not implemented");
|
|
1208
1207
|
}
|
|
1209
1208
|
}
|
|
1210
1209
|
/**
|
|
@@ -1226,13 +1225,13 @@ class q {
|
|
|
1226
1225
|
function D(n, e) {
|
|
1227
1226
|
u(typeof n == "string" || typeof n > "u", "internal-error", { appName: e });
|
|
1228
1227
|
}
|
|
1229
|
-
class
|
|
1228
|
+
class N {
|
|
1230
1229
|
constructor(e) {
|
|
1231
1230
|
var { uid: t, auth: i, stsTokenManager: r } = e, s = $e(e, ["uid", "auth", "stsTokenManager"]);
|
|
1232
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
1231
|
+
this.providerId = "firebase", this.proactiveRefresh = new Ii(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 Ue(s.createdAt || void 0, s.lastLoginAt || void 0);
|
|
1233
1232
|
}
|
|
1234
1233
|
async getIdToken(e) {
|
|
1235
|
-
const t = await
|
|
1234
|
+
const t = await re(this, this.stsTokenManager.getToken(this.auth, e));
|
|
1236
1235
|
return u(
|
|
1237
1236
|
t,
|
|
1238
1237
|
this.auth,
|
|
@@ -1241,10 +1240,10 @@ class C {
|
|
|
1241
1240
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
1242
1241
|
}
|
|
1243
1242
|
getIdTokenResult(e) {
|
|
1244
|
-
return
|
|
1243
|
+
return _i(this, e);
|
|
1245
1244
|
}
|
|
1246
1245
|
reload() {
|
|
1247
|
-
return
|
|
1246
|
+
return yi(this);
|
|
1248
1247
|
}
|
|
1249
1248
|
_assign(e) {
|
|
1250
1249
|
this !== e && (u(
|
|
@@ -1255,7 +1254,7 @@ class C {
|
|
|
1255
1254
|
), 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));
|
|
1256
1255
|
}
|
|
1257
1256
|
_clone(e) {
|
|
1258
|
-
const t = new
|
|
1257
|
+
const t = new N(Object.assign(Object.assign({}, this), { auth: e, stsTokenManager: this.stsTokenManager._clone() }));
|
|
1259
1258
|
return t.metadata._copy(this.metadata), t;
|
|
1260
1259
|
}
|
|
1261
1260
|
_onReload(e) {
|
|
@@ -1280,10 +1279,10 @@ class C {
|
|
|
1280
1279
|
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await ve(this), await this.auth._persistUserIfCurrent(this), i && this.auth._notifyListenersIfCurrent(this);
|
|
1281
1280
|
}
|
|
1282
1281
|
async delete() {
|
|
1283
|
-
if (
|
|
1282
|
+
if (P(this.auth.app))
|
|
1284
1283
|
return Promise.reject(H(this.auth));
|
|
1285
1284
|
const e = await this.getIdToken();
|
|
1286
|
-
return await
|
|
1285
|
+
return await re(this, gi(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
1287
1286
|
}
|
|
1288
1287
|
toJSON() {
|
|
1289
1288
|
return Object.assign(Object.assign({
|
|
@@ -1311,20 +1310,20 @@ class C {
|
|
|
1311
1310
|
}
|
|
1312
1311
|
static _fromJSON(e, t) {
|
|
1313
1312
|
var i, r, s, o, c, a, l, d;
|
|
1314
|
-
const m = (i = t.displayName) !== null && i !== void 0 ? i : void 0,
|
|
1313
|
+
const m = (i = t.displayName) !== null && i !== void 0 ? i : void 0, v = (r = t.email) !== null && r !== void 0 ? r : void 0, y = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, f = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, w = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, h = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, g = (l = t.createdAt) !== null && l !== void 0 ? l : void 0, b = (d = t.lastLoginAt) !== null && d !== void 0 ? d : void 0, { uid: T, emailVerified: Ke, isAnonymous: Je, providerData: Re, stsTokenManager: Ye } = t;
|
|
1315
1314
|
u(
|
|
1316
|
-
|
|
1315
|
+
T && Ye,
|
|
1317
1316
|
e,
|
|
1318
1317
|
"internal-error"
|
|
1319
1318
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1320
1319
|
);
|
|
1321
|
-
const
|
|
1320
|
+
const an = q.fromJSON(this.name, Ye);
|
|
1322
1321
|
u(
|
|
1323
|
-
typeof
|
|
1322
|
+
typeof T == "string",
|
|
1324
1323
|
e,
|
|
1325
1324
|
"internal-error"
|
|
1326
1325
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1327
|
-
), D(m, e.name), D(
|
|
1326
|
+
), D(m, e.name), D(v, e.name), u(
|
|
1328
1327
|
typeof Ke == "boolean",
|
|
1329
1328
|
e,
|
|
1330
1329
|
"internal-error"
|
|
@@ -1334,22 +1333,22 @@ class C {
|
|
|
1334
1333
|
e,
|
|
1335
1334
|
"internal-error"
|
|
1336
1335
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1337
|
-
), D(
|
|
1338
|
-
const Ae = new
|
|
1339
|
-
uid:
|
|
1336
|
+
), D(y, e.name), D(f, e.name), D(w, e.name), D(h, e.name), D(g, e.name), D(b, e.name);
|
|
1337
|
+
const Ae = new N({
|
|
1338
|
+
uid: T,
|
|
1340
1339
|
auth: e,
|
|
1341
|
-
email:
|
|
1340
|
+
email: v,
|
|
1342
1341
|
emailVerified: Ke,
|
|
1343
1342
|
displayName: m,
|
|
1344
1343
|
isAnonymous: Je,
|
|
1345
|
-
photoURL:
|
|
1346
|
-
phoneNumber:
|
|
1347
|
-
tenantId:
|
|
1348
|
-
stsTokenManager:
|
|
1349
|
-
createdAt:
|
|
1350
|
-
lastLoginAt:
|
|
1344
|
+
photoURL: f,
|
|
1345
|
+
phoneNumber: y,
|
|
1346
|
+
tenantId: w,
|
|
1347
|
+
stsTokenManager: an,
|
|
1348
|
+
createdAt: g,
|
|
1349
|
+
lastLoginAt: b
|
|
1351
1350
|
});
|
|
1352
|
-
return Re && Array.isArray(Re) && (Ae.providerData = Re.map((
|
|
1351
|
+
return Re && Array.isArray(Re) && (Ae.providerData = Re.map((cn) => Object.assign({}, cn))), h && (Ae._redirectEventId = h), Ae;
|
|
1353
1352
|
}
|
|
1354
1353
|
/**
|
|
1355
1354
|
* Initialize a User from an idToken server response
|
|
@@ -1359,7 +1358,7 @@ class C {
|
|
|
1359
1358
|
static async _fromIdTokenResponse(e, t, i = !1) {
|
|
1360
1359
|
const r = new q();
|
|
1361
1360
|
r.updateFromServerResponse(t);
|
|
1362
|
-
const s = new
|
|
1361
|
+
const s = new N({
|
|
1363
1362
|
uid: t.localId,
|
|
1364
1363
|
auth: e,
|
|
1365
1364
|
stsTokenManager: r,
|
|
@@ -1379,9 +1378,9 @@ class C {
|
|
|
1379
1378
|
"internal-error"
|
|
1380
1379
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1381
1380
|
);
|
|
1382
|
-
const s = r.providerUserInfo !== void 0 ?
|
|
1381
|
+
const s = r.providerUserInfo !== void 0 ? Dt(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new q();
|
|
1383
1382
|
c.updateFromIdToken(i);
|
|
1384
|
-
const a = new
|
|
1383
|
+
const a = new N({
|
|
1385
1384
|
uid: r.localId,
|
|
1386
1385
|
auth: e,
|
|
1387
1386
|
stsTokenManager: c,
|
|
@@ -1418,10 +1417,10 @@ class C {
|
|
|
1418
1417
|
* limitations under the License.
|
|
1419
1418
|
*/
|
|
1420
1419
|
const rt = /* @__PURE__ */ new Map();
|
|
1421
|
-
function
|
|
1422
|
-
|
|
1420
|
+
function O(n) {
|
|
1421
|
+
M(n instanceof Function, "Expected a class definition");
|
|
1423
1422
|
let e = rt.get(n);
|
|
1424
|
-
return e ? (
|
|
1423
|
+
return e ? (M(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), rt.set(n, e), e);
|
|
1425
1424
|
}
|
|
1426
1425
|
/**
|
|
1427
1426
|
* @license
|
|
@@ -1439,7 +1438,7 @@ function N(n) {
|
|
|
1439
1438
|
* See the License for the specific language governing permissions and
|
|
1440
1439
|
* limitations under the License.
|
|
1441
1440
|
*/
|
|
1442
|
-
class
|
|
1441
|
+
class xt {
|
|
1443
1442
|
constructor() {
|
|
1444
1443
|
this.type = "NONE", this.storage = {};
|
|
1445
1444
|
}
|
|
@@ -1461,8 +1460,8 @@ class Dt {
|
|
|
1461
1460
|
_removeListener(e, t) {
|
|
1462
1461
|
}
|
|
1463
1462
|
}
|
|
1464
|
-
|
|
1465
|
-
const st =
|
|
1463
|
+
xt.type = "NONE";
|
|
1464
|
+
const st = xt;
|
|
1466
1465
|
/**
|
|
1467
1466
|
* @license
|
|
1468
1467
|
* Copyright 2019 Google LLC
|
|
@@ -1479,21 +1478,21 @@ const st = Dt;
|
|
|
1479
1478
|
* See the License for the specific language governing permissions and
|
|
1480
1479
|
* limitations under the License.
|
|
1481
1480
|
*/
|
|
1482
|
-
function
|
|
1481
|
+
function he(n, e, t) {
|
|
1483
1482
|
return `firebase:${n}:${e}:${t}`;
|
|
1484
1483
|
}
|
|
1485
1484
|
class K {
|
|
1486
1485
|
constructor(e, t, i) {
|
|
1487
1486
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1488
1487
|
const { config: r, name: s } = this.auth;
|
|
1489
|
-
this.fullUserKey =
|
|
1488
|
+
this.fullUserKey = he(this.userKey, r.apiKey, s), this.fullPersistenceKey = he("persistence", r.apiKey, s), this.boundEventHandler = t._onStorageEvent.bind(t), this.persistence._addListener(this.fullUserKey, this.boundEventHandler);
|
|
1490
1489
|
}
|
|
1491
1490
|
setCurrentUser(e) {
|
|
1492
1491
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
|
1493
1492
|
}
|
|
1494
1493
|
async getCurrentUser() {
|
|
1495
1494
|
const e = await this.persistence._get(this.fullUserKey);
|
|
1496
|
-
return e ?
|
|
1495
|
+
return e ? N._fromJSON(this.auth, e) : null;
|
|
1497
1496
|
}
|
|
1498
1497
|
removeCurrentUser() {
|
|
1499
1498
|
return this.persistence._remove(this.fullUserKey);
|
|
@@ -1513,19 +1512,19 @@ class K {
|
|
|
1513
1512
|
}
|
|
1514
1513
|
static async create(e, t, i = "authUser") {
|
|
1515
1514
|
if (!t.length)
|
|
1516
|
-
return new K(
|
|
1515
|
+
return new K(O(st), e, i);
|
|
1517
1516
|
const r = (await Promise.all(t.map(async (l) => {
|
|
1518
1517
|
if (await l._isAvailable())
|
|
1519
1518
|
return l;
|
|
1520
1519
|
}))).filter((l) => l);
|
|
1521
|
-
let s = r[0] ||
|
|
1522
|
-
const o =
|
|
1520
|
+
let s = r[0] || O(st);
|
|
1521
|
+
const o = he(i, e.config.apiKey, e.name);
|
|
1523
1522
|
let c = null;
|
|
1524
1523
|
for (const l of t)
|
|
1525
1524
|
try {
|
|
1526
1525
|
const d = await l._get(o);
|
|
1527
1526
|
if (d) {
|
|
1528
|
-
const m =
|
|
1527
|
+
const m = N._fromJSON(e, d);
|
|
1529
1528
|
l !== s && (c = m), s = l;
|
|
1530
1529
|
break;
|
|
1531
1530
|
}
|
|
@@ -1561,25 +1560,25 @@ function ot(n) {
|
|
|
1561
1560
|
const e = n.toLowerCase();
|
|
1562
1561
|
if (e.includes("opera/") || e.includes("opr/") || e.includes("opios/"))
|
|
1563
1562
|
return "Opera";
|
|
1564
|
-
if (
|
|
1563
|
+
if ($t(e))
|
|
1565
1564
|
return "IEMobile";
|
|
1566
1565
|
if (e.includes("msie") || e.includes("trident/"))
|
|
1567
1566
|
return "IE";
|
|
1568
1567
|
if (e.includes("edge/"))
|
|
1569
1568
|
return "Edge";
|
|
1570
|
-
if (
|
|
1569
|
+
if (Ft(e))
|
|
1571
1570
|
return "Firefox";
|
|
1572
1571
|
if (e.includes("silk/"))
|
|
1573
1572
|
return "Silk";
|
|
1574
|
-
if (
|
|
1573
|
+
if (jt(e))
|
|
1575
1574
|
return "Blackberry";
|
|
1576
1575
|
if (Wt(e))
|
|
1577
1576
|
return "Webos";
|
|
1578
1577
|
if (Be(e))
|
|
1579
1578
|
return "Safari";
|
|
1580
|
-
if ((e.includes("chrome/") ||
|
|
1579
|
+
if ((e.includes("chrome/") || Vt(e)) && !e.includes("edge/"))
|
|
1581
1580
|
return "Chrome";
|
|
1582
|
-
if (
|
|
1581
|
+
if (Ht(e))
|
|
1583
1582
|
return "Android";
|
|
1584
1583
|
{
|
|
1585
1584
|
const t = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/, i = n.match(t);
|
|
@@ -1588,42 +1587,42 @@ function ot(n) {
|
|
|
1588
1587
|
}
|
|
1589
1588
|
return "Other";
|
|
1590
1589
|
}
|
|
1591
|
-
function
|
|
1590
|
+
function Ft(n = k()) {
|
|
1592
1591
|
return /firefox\//i.test(n);
|
|
1593
1592
|
}
|
|
1594
|
-
function Be(n =
|
|
1593
|
+
function Be(n = k()) {
|
|
1595
1594
|
const e = n.toLowerCase();
|
|
1596
1595
|
return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
|
|
1597
1596
|
}
|
|
1598
|
-
function
|
|
1597
|
+
function Vt(n = k()) {
|
|
1599
1598
|
return /crios\//i.test(n);
|
|
1600
1599
|
}
|
|
1601
|
-
function
|
|
1600
|
+
function $t(n = k()) {
|
|
1602
1601
|
return /iemobile/i.test(n);
|
|
1603
1602
|
}
|
|
1604
|
-
function
|
|
1603
|
+
function Ht(n = k()) {
|
|
1605
1604
|
return /android/i.test(n);
|
|
1606
1605
|
}
|
|
1607
|
-
function
|
|
1606
|
+
function jt(n = k()) {
|
|
1608
1607
|
return /blackberry/i.test(n);
|
|
1609
1608
|
}
|
|
1610
|
-
function Wt(n =
|
|
1609
|
+
function Wt(n = k()) {
|
|
1611
1610
|
return /webos/i.test(n);
|
|
1612
1611
|
}
|
|
1613
|
-
function ke(n =
|
|
1612
|
+
function ke(n = k()) {
|
|
1614
1613
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1615
1614
|
}
|
|
1616
|
-
function
|
|
1615
|
+
function bi(n = k()) {
|
|
1617
1616
|
var e;
|
|
1618
1617
|
return ke(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1619
1618
|
}
|
|
1620
|
-
function
|
|
1621
|
-
return
|
|
1619
|
+
function Ei() {
|
|
1620
|
+
return Ln() && document.documentMode === 10;
|
|
1622
1621
|
}
|
|
1623
|
-
function
|
|
1624
|
-
return ke(n) ||
|
|
1622
|
+
function Bt(n = k()) {
|
|
1623
|
+
return ke(n) || Ht(n) || Wt(n) || jt(n) || /windows phone/i.test(n) || $t(n);
|
|
1625
1624
|
}
|
|
1626
|
-
function
|
|
1625
|
+
function Si() {
|
|
1627
1626
|
try {
|
|
1628
1627
|
return !!(window && window !== window.top);
|
|
1629
1628
|
} catch {
|
|
@@ -1646,20 +1645,20 @@ function Ei() {
|
|
|
1646
1645
|
* See the License for the specific language governing permissions and
|
|
1647
1646
|
* limitations under the License.
|
|
1648
1647
|
*/
|
|
1649
|
-
function
|
|
1648
|
+
function Gt(n, e = []) {
|
|
1650
1649
|
let t;
|
|
1651
1650
|
switch (n) {
|
|
1652
1651
|
case "Browser":
|
|
1653
|
-
t = ot(
|
|
1652
|
+
t = ot(k());
|
|
1654
1653
|
break;
|
|
1655
1654
|
case "Worker":
|
|
1656
|
-
t = `${ot(
|
|
1655
|
+
t = `${ot(k())}-${n}`;
|
|
1657
1656
|
break;
|
|
1658
1657
|
default:
|
|
1659
1658
|
t = n;
|
|
1660
1659
|
}
|
|
1661
1660
|
const i = e.length ? e.join(",") : "FirebaseCore-web";
|
|
1662
|
-
return `${t}/JsCore/${
|
|
1661
|
+
return `${t}/JsCore/${se}/${i}`;
|
|
1663
1662
|
}
|
|
1664
1663
|
/**
|
|
1665
1664
|
* @license
|
|
@@ -1677,7 +1676,7 @@ function Bt(n, e = []) {
|
|
|
1677
1676
|
* See the License for the specific language governing permissions and
|
|
1678
1677
|
* limitations under the License.
|
|
1679
1678
|
*/
|
|
1680
|
-
class
|
|
1679
|
+
class Ri {
|
|
1681
1680
|
constructor(e) {
|
|
1682
1681
|
this.auth = e, this.queue = [];
|
|
1683
1682
|
}
|
|
@@ -1732,7 +1731,7 @@ class Si {
|
|
|
1732
1731
|
* See the License for the specific language governing permissions and
|
|
1733
1732
|
* limitations under the License.
|
|
1734
1733
|
*/
|
|
1735
|
-
async function
|
|
1734
|
+
async function Ai(n, e = {}) {
|
|
1736
1735
|
return Q(n, "GET", "/v2/passwordPolicy", Te(n, e));
|
|
1737
1736
|
}
|
|
1738
1737
|
/**
|
|
@@ -1751,12 +1750,12 @@ async function Ri(n, e = {}) {
|
|
|
1751
1750
|
* See the License for the specific language governing permissions and
|
|
1752
1751
|
* limitations under the License.
|
|
1753
1752
|
*/
|
|
1754
|
-
const
|
|
1755
|
-
class
|
|
1753
|
+
const Pi = 6;
|
|
1754
|
+
class Ci {
|
|
1756
1755
|
constructor(e) {
|
|
1757
1756
|
var t, i, r, s;
|
|
1758
1757
|
const o = e.customStrengthOptions;
|
|
1759
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
|
1758
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : Pi, o.maxPasswordLength && (this.customStrengthOptions.maxPasswordLength = o.maxPasswordLength), o.containsLowercaseCharacter !== void 0 && (this.customStrengthOptions.containsLowercaseLetter = o.containsLowercaseCharacter), o.containsUppercaseCharacter !== void 0 && (this.customStrengthOptions.containsUppercaseLetter = o.containsUppercaseCharacter), o.containsNumericCharacter !== void 0 && (this.customStrengthOptions.containsNumericCharacter = o.containsNumericCharacter), o.containsNonAlphanumericCharacter !== void 0 && (this.customStrengthOptions.containsNonAlphanumericCharacter = o.containsNonAlphanumericCharacter), this.enforcementState = e.enforcementState, this.enforcementState === "ENFORCEMENT_STATE_UNSPECIFIED" && (this.enforcementState = "OFF"), this.allowedNonAlphanumericCharacters = (r = (i = e.allowedNonAlphanumericCharacters) === null || i === void 0 ? void 0 : i.join("")) !== null && r !== void 0 ? r : "", this.forceUpgradeOnSignin = (s = e.forceUpgradeOnSignin) !== null && s !== void 0 ? s : !1, this.schemaVersion = e.schemaVersion;
|
|
1760
1759
|
}
|
|
1761
1760
|
validatePassword(e) {
|
|
1762
1761
|
var t, i, r, s, o, c;
|
|
@@ -1839,12 +1838,12 @@ class Pi {
|
|
|
1839
1838
|
* See the License for the specific language governing permissions and
|
|
1840
1839
|
* limitations under the License.
|
|
1841
1840
|
*/
|
|
1842
|
-
class
|
|
1841
|
+
class Ni {
|
|
1843
1842
|
constructor(e, t, i, r) {
|
|
1844
|
-
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
|
|
1843
|
+
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 Ri(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 = Pt, 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;
|
|
1845
1844
|
}
|
|
1846
1845
|
_initializeWithPersistence(e, t) {
|
|
1847
|
-
return t && (this._popupRedirectResolver =
|
|
1846
|
+
return t && (this._popupRedirectResolver = O(t)), this._initializationPromise = this.queue(async () => {
|
|
1848
1847
|
var i, r;
|
|
1849
1848
|
if (!this._deleted && (this.persistenceManager = await K.create(this, e), !this._deleted)) {
|
|
1850
1849
|
if (!((i = this._popupRedirectResolver) === null || i === void 0) && i._shouldInitProactively)
|
|
@@ -1877,7 +1876,7 @@ class Ci {
|
|
|
1877
1876
|
}
|
|
1878
1877
|
async initializeCurrentUserFromIdToken(e) {
|
|
1879
1878
|
try {
|
|
1880
|
-
const t = await
|
|
1879
|
+
const t = await Ut(this, { idToken: e }), i = await N._fromGetAccountInfoResponse(this, t, e);
|
|
1881
1880
|
await this.directlySetCurrentUser(i);
|
|
1882
1881
|
} catch (t) {
|
|
1883
1882
|
console.warn("FirebaseServerApp could not login user with provided authIdToken: ", t), await this.directlySetCurrentUser(null);
|
|
@@ -1885,7 +1884,7 @@ class Ci {
|
|
|
1885
1884
|
}
|
|
1886
1885
|
async initializeCurrentUser(e) {
|
|
1887
1886
|
var t;
|
|
1888
|
-
if (
|
|
1887
|
+
if (P(this.app)) {
|
|
1889
1888
|
const o = this.app.settings.authIdToken;
|
|
1890
1889
|
return o ? new Promise((c) => {
|
|
1891
1890
|
setTimeout(() => this.initializeCurrentUserFromIdToken(o).then(c, c));
|
|
@@ -1935,13 +1934,13 @@ class Ci {
|
|
|
1935
1934
|
return this.directlySetCurrentUser(e);
|
|
1936
1935
|
}
|
|
1937
1936
|
useDeviceLanguage() {
|
|
1938
|
-
this.languageCode =
|
|
1937
|
+
this.languageCode = hi();
|
|
1939
1938
|
}
|
|
1940
1939
|
async _delete() {
|
|
1941
1940
|
this._deleted = !0;
|
|
1942
1941
|
}
|
|
1943
1942
|
async updateCurrentUser(e) {
|
|
1944
|
-
if (
|
|
1943
|
+
if (P(this.app))
|
|
1945
1944
|
return Promise.reject(H(this));
|
|
1946
1945
|
const t = e ? X(e) : null;
|
|
1947
1946
|
return t && u(
|
|
@@ -1963,15 +1962,15 @@ class Ci {
|
|
|
1963
1962
|
});
|
|
1964
1963
|
}
|
|
1965
1964
|
async signOut() {
|
|
1966
|
-
return
|
|
1965
|
+
return P(this.app) ? Promise.reject(H(this)) : (await this.beforeStateQueue.runMiddleware(null), (this.redirectPersistenceManager || this._popupRedirectResolver) && await this._setRedirectUser(null), this._updateCurrentUser(
|
|
1967
1966
|
null,
|
|
1968
1967
|
/* skipBeforeStateCallbacks */
|
|
1969
1968
|
!0
|
|
1970
1969
|
));
|
|
1971
1970
|
}
|
|
1972
1971
|
setPersistence(e) {
|
|
1973
|
-
return
|
|
1974
|
-
await this.assertedPersistence.setPersistence(
|
|
1972
|
+
return P(this.app) ? Promise.reject(H(this)) : this.queue(async () => {
|
|
1973
|
+
await this.assertedPersistence.setPersistence(O(e));
|
|
1975
1974
|
});
|
|
1976
1975
|
}
|
|
1977
1976
|
_getRecaptchaConfig() {
|
|
@@ -1986,7 +1985,7 @@ class Ci {
|
|
|
1986
1985
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
1987
1986
|
}
|
|
1988
1987
|
async _updatePasswordPolicy() {
|
|
1989
|
-
const e = await
|
|
1988
|
+
const e = await Ai(this), t = new Ci(e);
|
|
1990
1989
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
1991
1990
|
}
|
|
1992
1991
|
_getPersistence() {
|
|
@@ -2026,7 +2025,7 @@ class Ci {
|
|
|
2026
2025
|
token: e,
|
|
2027
2026
|
idToken: t
|
|
2028
2027
|
};
|
|
2029
|
-
this.tenantId != null && (i.tenantId = this.tenantId), await
|
|
2028
|
+
this.tenantId != null && (i.tenantId = this.tenantId), await ki(this, i);
|
|
2030
2029
|
}
|
|
2031
2030
|
}
|
|
2032
2031
|
toJSON() {
|
|
@@ -2044,7 +2043,7 @@ class Ci {
|
|
|
2044
2043
|
}
|
|
2045
2044
|
async getOrInitRedirectPersistenceManager(e) {
|
|
2046
2045
|
if (!this.redirectPersistenceManager) {
|
|
2047
|
-
const t = e &&
|
|
2046
|
+
const t = e && O(e) || this._popupRedirectResolver;
|
|
2048
2047
|
u(
|
|
2049
2048
|
t,
|
|
2050
2049
|
this,
|
|
@@ -2052,7 +2051,7 @@ class Ci {
|
|
|
2052
2051
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2053
2052
|
), this.redirectPersistenceManager = await K.create(
|
|
2054
2053
|
this,
|
|
2055
|
-
[
|
|
2054
|
+
[O(t._redirectPersistence)],
|
|
2056
2055
|
"redirectUser"
|
|
2057
2056
|
/* KeyName.REDIRECT_USER */
|
|
2058
2057
|
), this.redirectUser = await this.redirectPersistenceManager.getCurrentUser();
|
|
@@ -2139,7 +2138,7 @@ class Ci {
|
|
|
2139
2138
|
), this.persistenceManager;
|
|
2140
2139
|
}
|
|
2141
2140
|
_logFramework(e) {
|
|
2142
|
-
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion =
|
|
2141
|
+
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion = Gt(this.config.clientPlatform, this._getFrameworks()));
|
|
2143
2142
|
}
|
|
2144
2143
|
_getFrameworks() {
|
|
2145
2144
|
return this.frameworks;
|
|
@@ -2169,7 +2168,7 @@ class Ci {
|
|
|
2169
2168
|
async _getAppCheckToken() {
|
|
2170
2169
|
var e;
|
|
2171
2170
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
2172
|
-
return t != null && t.error &&
|
|
2171
|
+
return t != null && t.error && li(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
2173
2172
|
}
|
|
2174
2173
|
}
|
|
2175
2174
|
function be(n) {
|
|
@@ -2177,7 +2176,7 @@ function be(n) {
|
|
|
2177
2176
|
}
|
|
2178
2177
|
class at {
|
|
2179
2178
|
constructor(e) {
|
|
2180
|
-
this.auth = e, this.observer = null, this.addObserver =
|
|
2179
|
+
this.auth = e, this.observer = null, this.addObserver = An((t) => this.observer = t);
|
|
2181
2180
|
}
|
|
2182
2181
|
get next() {
|
|
2183
2182
|
return u(
|
|
@@ -2212,16 +2211,16 @@ let Ge = {
|
|
|
2212
2211
|
recaptchaEnterpriseScript: "",
|
|
2213
2212
|
gapiScript: ""
|
|
2214
2213
|
};
|
|
2215
|
-
function
|
|
2214
|
+
function Oi(n) {
|
|
2216
2215
|
Ge = n;
|
|
2217
2216
|
}
|
|
2218
|
-
function
|
|
2217
|
+
function Li(n) {
|
|
2219
2218
|
return Ge.loadJS(n);
|
|
2220
2219
|
}
|
|
2221
|
-
function
|
|
2220
|
+
function Mi() {
|
|
2222
2221
|
return Ge.gapiScript;
|
|
2223
2222
|
}
|
|
2224
|
-
function
|
|
2223
|
+
function Ui(n) {
|
|
2225
2224
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
2226
2225
|
}
|
|
2227
2226
|
/**
|
|
@@ -2240,13 +2239,13 @@ function Mi(n) {
|
|
|
2240
2239
|
* See the License for the specific language governing permissions and
|
|
2241
2240
|
* limitations under the License.
|
|
2242
2241
|
*/
|
|
2243
|
-
function
|
|
2244
|
-
const t =
|
|
2242
|
+
function Di(n, e) {
|
|
2243
|
+
const t = Et(n, "auth");
|
|
2245
2244
|
if (t.isInitialized()) {
|
|
2246
2245
|
const r = t.getImmediate(), s = t.getOptions();
|
|
2247
|
-
if (
|
|
2246
|
+
if (Nn(s, e ?? {}))
|
|
2248
2247
|
return r;
|
|
2249
|
-
|
|
2248
|
+
L(
|
|
2250
2249
|
r,
|
|
2251
2250
|
"already-initialized"
|
|
2252
2251
|
/* AuthErrorCode.ALREADY_INITIALIZED */
|
|
@@ -2254,11 +2253,11 @@ function Ui(n, e) {
|
|
|
2254
2253
|
}
|
|
2255
2254
|
return t.initialize({ options: e });
|
|
2256
2255
|
}
|
|
2257
|
-
function
|
|
2258
|
-
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(
|
|
2256
|
+
function xi(n, e) {
|
|
2257
|
+
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(O);
|
|
2259
2258
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2260
2259
|
}
|
|
2261
|
-
function
|
|
2260
|
+
function Fi(n, e, t) {
|
|
2262
2261
|
const i = be(n);
|
|
2263
2262
|
u(
|
|
2264
2263
|
i._canInitEmulator,
|
|
@@ -2271,20 +2270,20 @@ function xi(n, e, t) {
|
|
|
2271
2270
|
"invalid-emulator-scheme"
|
|
2272
2271
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
2273
2272
|
);
|
|
2274
|
-
const r = !1, s =
|
|
2273
|
+
const r = !1, s = zt(e), { host: o, port: c } = Vi(e), a = c === null ? "" : `:${c}`;
|
|
2275
2274
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
2276
2275
|
host: o,
|
|
2277
2276
|
port: c,
|
|
2278
2277
|
protocol: s.replace(":", ""),
|
|
2279
2278
|
options: Object.freeze({ disableWarnings: r })
|
|
2280
|
-
}),
|
|
2279
|
+
}), $i();
|
|
2281
2280
|
}
|
|
2282
|
-
function
|
|
2281
|
+
function zt(n) {
|
|
2283
2282
|
const e = n.indexOf(":");
|
|
2284
2283
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
2285
2284
|
}
|
|
2286
|
-
function
|
|
2287
|
-
const e =
|
|
2285
|
+
function Vi(n) {
|
|
2286
|
+
const e = zt(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
2288
2287
|
if (!t)
|
|
2289
2288
|
return { host: "", port: null };
|
|
2290
2289
|
const i = t[2].split("@").pop() || "", r = /^(\[[^\]]+\])(:|$)/.exec(i);
|
|
@@ -2302,7 +2301,7 @@ function ct(n) {
|
|
|
2302
2301
|
const e = Number(n);
|
|
2303
2302
|
return isNaN(e) ? null : e;
|
|
2304
2303
|
}
|
|
2305
|
-
function
|
|
2304
|
+
function $i() {
|
|
2306
2305
|
function n() {
|
|
2307
2306
|
const e = document.createElement("p"), t = e.style;
|
|
2308
2307
|
e.innerText = "Running in emulator mode. Do not use with production credentials.", t.position = "fixed", t.width = "100%", t.backgroundColor = "#ffffff", t.border = ".1em solid #000000", t.color = "#b50000", t.bottom = "0px", t.left = "0px", t.margin = "0px", t.zIndex = "10000", t.textAlign = "center", e.classList.add("firebase-emulator-warning"), document.body.appendChild(e);
|
|
@@ -2325,7 +2324,7 @@ function Vi() {
|
|
|
2325
2324
|
* See the License for the specific language governing permissions and
|
|
2326
2325
|
* limitations under the License.
|
|
2327
2326
|
*/
|
|
2328
|
-
class
|
|
2327
|
+
class qt {
|
|
2329
2328
|
/** @internal */
|
|
2330
2329
|
constructor(e, t) {
|
|
2331
2330
|
this.providerId = e, this.signInMethod = t;
|
|
@@ -2336,19 +2335,19 @@ class zt {
|
|
|
2336
2335
|
* @returns a JSON-serializable representation of this object.
|
|
2337
2336
|
*/
|
|
2338
2337
|
toJSON() {
|
|
2339
|
-
return
|
|
2338
|
+
return C("not implemented");
|
|
2340
2339
|
}
|
|
2341
2340
|
/** @internal */
|
|
2342
2341
|
_getIdTokenResponse(e) {
|
|
2343
|
-
return
|
|
2342
|
+
return C("not implemented");
|
|
2344
2343
|
}
|
|
2345
2344
|
/** @internal */
|
|
2346
2345
|
_linkToIdToken(e, t) {
|
|
2347
|
-
return
|
|
2346
|
+
return C("not implemented");
|
|
2348
2347
|
}
|
|
2349
2348
|
/** @internal */
|
|
2350
2349
|
_getReauthenticationResolver(e) {
|
|
2351
|
-
return
|
|
2350
|
+
return C("not implemented");
|
|
2352
2351
|
}
|
|
2353
2352
|
}
|
|
2354
2353
|
/**
|
|
@@ -2368,7 +2367,7 @@ class zt {
|
|
|
2368
2367
|
* limitations under the License.
|
|
2369
2368
|
*/
|
|
2370
2369
|
async function J(n, e) {
|
|
2371
|
-
return
|
|
2370
|
+
return Lt(n, "POST", "/v1/accounts:signInWithIdp", Te(n, e));
|
|
2372
2371
|
}
|
|
2373
2372
|
/**
|
|
2374
2373
|
* @license
|
|
@@ -2386,15 +2385,15 @@ async function J(n, e) {
|
|
|
2386
2385
|
* See the License for the specific language governing permissions and
|
|
2387
2386
|
* limitations under the License.
|
|
2388
2387
|
*/
|
|
2389
|
-
const
|
|
2390
|
-
class B extends
|
|
2388
|
+
const Hi = "http://localhost";
|
|
2389
|
+
class B extends qt {
|
|
2391
2390
|
constructor() {
|
|
2392
2391
|
super(...arguments), this.pendingToken = null;
|
|
2393
2392
|
}
|
|
2394
2393
|
/** @internal */
|
|
2395
2394
|
static _fromParams(e) {
|
|
2396
2395
|
const t = new B(e.providerId, e.signInMethod);
|
|
2397
|
-
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) :
|
|
2396
|
+
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) : L(
|
|
2398
2397
|
"argument-error"
|
|
2399
2398
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2400
2399
|
), t;
|
|
@@ -2444,14 +2443,14 @@ class B extends zt {
|
|
|
2444
2443
|
}
|
|
2445
2444
|
buildRequest() {
|
|
2446
2445
|
const e = {
|
|
2447
|
-
requestUri:
|
|
2446
|
+
requestUri: Hi,
|
|
2448
2447
|
returnSecureToken: !0
|
|
2449
2448
|
};
|
|
2450
2449
|
if (this.pendingToken)
|
|
2451
2450
|
e.pendingToken = this.pendingToken;
|
|
2452
2451
|
else {
|
|
2453
2452
|
const t = {};
|
|
2454
|
-
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 =
|
|
2453
|
+
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 = oe(t);
|
|
2455
2454
|
}
|
|
2456
2455
|
return e;
|
|
2457
2456
|
}
|
|
@@ -2472,7 +2471,7 @@ class B extends zt {
|
|
|
2472
2471
|
* See the License for the specific language governing permissions and
|
|
2473
2472
|
* limitations under the License.
|
|
2474
2473
|
*/
|
|
2475
|
-
class
|
|
2474
|
+
class Kt {
|
|
2476
2475
|
/**
|
|
2477
2476
|
* Constructor for generic OAuth providers.
|
|
2478
2477
|
*
|
|
@@ -2525,7 +2524,7 @@ class qt {
|
|
|
2525
2524
|
* See the License for the specific language governing permissions and
|
|
2526
2525
|
* limitations under the License.
|
|
2527
2526
|
*/
|
|
2528
|
-
class
|
|
2527
|
+
class ce extends Kt {
|
|
2529
2528
|
constructor() {
|
|
2530
2529
|
super(...arguments), this.scopes = [];
|
|
2531
2530
|
}
|
|
@@ -2560,7 +2559,7 @@ class ae extends qt {
|
|
|
2560
2559
|
* See the License for the specific language governing permissions and
|
|
2561
2560
|
* limitations under the License.
|
|
2562
2561
|
*/
|
|
2563
|
-
class x extends
|
|
2562
|
+
class x extends ce {
|
|
2564
2563
|
constructor() {
|
|
2565
2564
|
super(
|
|
2566
2565
|
"facebook.com"
|
|
@@ -2631,7 +2630,7 @@ x.PROVIDER_ID = "facebook.com";
|
|
|
2631
2630
|
* See the License for the specific language governing permissions and
|
|
2632
2631
|
* limitations under the License.
|
|
2633
2632
|
*/
|
|
2634
|
-
class F extends
|
|
2633
|
+
class F extends ce {
|
|
2635
2634
|
constructor() {
|
|
2636
2635
|
super(
|
|
2637
2636
|
"google.com"
|
|
@@ -2707,7 +2706,7 @@ F.PROVIDER_ID = "google.com";
|
|
|
2707
2706
|
* See the License for the specific language governing permissions and
|
|
2708
2707
|
* limitations under the License.
|
|
2709
2708
|
*/
|
|
2710
|
-
class V extends
|
|
2709
|
+
class V extends ce {
|
|
2711
2710
|
constructor() {
|
|
2712
2711
|
super(
|
|
2713
2712
|
"github.com"
|
|
@@ -2771,7 +2770,7 @@ V.PROVIDER_ID = "github.com";
|
|
|
2771
2770
|
* See the License for the specific language governing permissions and
|
|
2772
2771
|
* limitations under the License.
|
|
2773
2772
|
*/
|
|
2774
|
-
class $ extends
|
|
2773
|
+
class $ extends ce {
|
|
2775
2774
|
constructor() {
|
|
2776
2775
|
super(
|
|
2777
2776
|
"twitter.com"
|
|
@@ -2845,7 +2844,7 @@ class G {
|
|
|
2845
2844
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2846
2845
|
}
|
|
2847
2846
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2848
|
-
const s = await
|
|
2847
|
+
const s = await N._fromIdTokenResponse(e, i, r), o = lt(i);
|
|
2849
2848
|
return new G({
|
|
2850
2849
|
user: s,
|
|
2851
2850
|
providerId: o,
|
|
@@ -2901,13 +2900,13 @@ class Ie extends Ve {
|
|
|
2901
2900
|
return new Ie(e, t, i, r);
|
|
2902
2901
|
}
|
|
2903
2902
|
}
|
|
2904
|
-
function
|
|
2903
|
+
function Jt(n, e, t, i) {
|
|
2905
2904
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2906
2905
|
throw s.code === "auth/multi-factor-auth-required" ? Ie._fromErrorAndOperation(n, s, e, i) : s;
|
|
2907
2906
|
});
|
|
2908
2907
|
}
|
|
2909
|
-
async function
|
|
2910
|
-
const i = await
|
|
2908
|
+
async function ji(n, e, t = !1) {
|
|
2909
|
+
const i = await re(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2911
2910
|
return G._forOperation(n, "link", i);
|
|
2912
2911
|
}
|
|
2913
2912
|
/**
|
|
@@ -2928,18 +2927,18 @@ async function Hi(n, e, t = !1) {
|
|
|
2928
2927
|
*/
|
|
2929
2928
|
async function Wi(n, e, t = !1) {
|
|
2930
2929
|
const { auth: i } = n;
|
|
2931
|
-
if (
|
|
2930
|
+
if (P(i.app))
|
|
2932
2931
|
return Promise.reject(H(i));
|
|
2933
2932
|
const r = "reauthenticate";
|
|
2934
2933
|
try {
|
|
2935
|
-
const s = await
|
|
2934
|
+
const s = await re(n, Jt(i, r, e, n), t);
|
|
2936
2935
|
u(
|
|
2937
2936
|
s.idToken,
|
|
2938
2937
|
i,
|
|
2939
2938
|
"internal-error"
|
|
2940
2939
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
2941
2940
|
);
|
|
2942
|
-
const o =
|
|
2941
|
+
const o = We(s.idToken);
|
|
2943
2942
|
u(
|
|
2944
2943
|
o,
|
|
2945
2944
|
i,
|
|
@@ -2954,7 +2953,7 @@ async function Wi(n, e, t = !1) {
|
|
|
2954
2953
|
/* AuthErrorCode.USER_MISMATCH */
|
|
2955
2954
|
), G._forOperation(n, r, s);
|
|
2956
2955
|
} catch (s) {
|
|
2957
|
-
throw (s == null ? void 0 : s.code) === "auth/user-not-found" &&
|
|
2956
|
+
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && L(
|
|
2958
2957
|
i,
|
|
2959
2958
|
"user-mismatch"
|
|
2960
2959
|
/* AuthErrorCode.USER_MISMATCH */
|
|
@@ -2977,10 +2976,10 @@ async function Wi(n, e, t = !1) {
|
|
|
2977
2976
|
* See the License for the specific language governing permissions and
|
|
2978
2977
|
* limitations under the License.
|
|
2979
2978
|
*/
|
|
2980
|
-
async function
|
|
2981
|
-
if (
|
|
2979
|
+
async function Bi(n, e, t = !1) {
|
|
2980
|
+
if (P(n.app))
|
|
2982
2981
|
return Promise.reject(H(n));
|
|
2983
|
-
const i = "signIn", r = await
|
|
2982
|
+
const i = "signIn", r = await Jt(n, i, e), s = await G._fromIdTokenResponse(n, i, r);
|
|
2984
2983
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2985
2984
|
}
|
|
2986
2985
|
/**
|
|
@@ -2999,8 +2998,8 @@ async function ji(n, e, t = !1) {
|
|
|
2999
2998
|
* See the License for the specific language governing permissions and
|
|
3000
2999
|
* limitations under the License.
|
|
3001
3000
|
*/
|
|
3002
|
-
async function
|
|
3003
|
-
return
|
|
3001
|
+
async function Gi(n, e) {
|
|
3002
|
+
return Lt(n, "POST", "/v1/accounts:signInWithCustomToken", Te(n, e));
|
|
3004
3003
|
}
|
|
3005
3004
|
/**
|
|
3006
3005
|
* @license
|
|
@@ -3018,19 +3017,19 @@ async function Bi(n, e) {
|
|
|
3018
3017
|
* See the License for the specific language governing permissions and
|
|
3019
3018
|
* limitations under the License.
|
|
3020
3019
|
*/
|
|
3021
|
-
async function
|
|
3022
|
-
if (
|
|
3020
|
+
async function zi(n, e) {
|
|
3021
|
+
if (P(n.app))
|
|
3023
3022
|
return Promise.reject(H(n));
|
|
3024
|
-
const t = be(n), i = await
|
|
3023
|
+
const t = be(n), i = await Gi(t, {
|
|
3025
3024
|
token: e,
|
|
3026
3025
|
returnSecureToken: !0
|
|
3027
3026
|
}), r = await G._fromIdTokenResponse(t, "signIn", i);
|
|
3028
3027
|
return await t._updateCurrentUser(r.user), r;
|
|
3029
3028
|
}
|
|
3030
|
-
function
|
|
3029
|
+
function qi(n, e, t, i) {
|
|
3031
3030
|
return X(n).onIdTokenChanged(e, t, i);
|
|
3032
3031
|
}
|
|
3033
|
-
function
|
|
3032
|
+
function Ki(n, e, t) {
|
|
3034
3033
|
return X(n).beforeAuthStateChanged(e, t);
|
|
3035
3034
|
}
|
|
3036
3035
|
const ye = "__sak";
|
|
@@ -3050,7 +3049,7 @@ const ye = "__sak";
|
|
|
3050
3049
|
* See the License for the specific language governing permissions and
|
|
3051
3050
|
* limitations under the License.
|
|
3052
3051
|
*/
|
|
3053
|
-
class
|
|
3052
|
+
class Yt {
|
|
3054
3053
|
constructor(e, t) {
|
|
3055
3054
|
this.storageRetriever = e, this.type = t;
|
|
3056
3055
|
}
|
|
@@ -3091,18 +3090,18 @@ class Jt {
|
|
|
3091
3090
|
* See the License for the specific language governing permissions and
|
|
3092
3091
|
* limitations under the License.
|
|
3093
3092
|
*/
|
|
3094
|
-
function
|
|
3095
|
-
const n =
|
|
3093
|
+
function Ji() {
|
|
3094
|
+
const n = k();
|
|
3096
3095
|
return Be(n) || ke(n);
|
|
3097
3096
|
}
|
|
3098
|
-
const
|
|
3099
|
-
class
|
|
3097
|
+
const Yi = 1e3, Xi = 10;
|
|
3098
|
+
class Xt extends Yt {
|
|
3100
3099
|
constructor() {
|
|
3101
3100
|
super(
|
|
3102
3101
|
() => window.localStorage,
|
|
3103
3102
|
"LOCAL"
|
|
3104
3103
|
/* PersistenceType.LOCAL */
|
|
3105
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
|
3104
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = Ji() && Si(), this.fallbackToPolling = Bt(), this._shouldAllowMigration = !0;
|
|
3106
3105
|
}
|
|
3107
3106
|
forAllChangedKeys(e) {
|
|
3108
3107
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -3129,7 +3128,7 @@ class Yt extends Jt {
|
|
|
3129
3128
|
const o = this.storage.getItem(i);
|
|
3130
3129
|
!t && this.localCache[i] === o || this.notifyListeners(i, o);
|
|
3131
3130
|
}, s = this.storage.getItem(i);
|
|
3132
|
-
|
|
3131
|
+
Ei() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(r, Xi) : r();
|
|
3133
3132
|
}
|
|
3134
3133
|
notifyListeners(e, t) {
|
|
3135
3134
|
this.localCache[e] = t;
|
|
@@ -3151,7 +3150,7 @@ class Yt extends Jt {
|
|
|
3151
3150
|
!0
|
|
3152
3151
|
);
|
|
3153
3152
|
});
|
|
3154
|
-
},
|
|
3153
|
+
}, Yi);
|
|
3155
3154
|
}
|
|
3156
3155
|
stopPolling() {
|
|
3157
3156
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3180,8 +3179,8 @@ class Yt extends Jt {
|
|
|
3180
3179
|
await super._remove(e), delete this.localCache[e];
|
|
3181
3180
|
}
|
|
3182
3181
|
}
|
|
3183
|
-
|
|
3184
|
-
const
|
|
3182
|
+
Xt.type = "LOCAL";
|
|
3183
|
+
const Qi = Xt;
|
|
3185
3184
|
/**
|
|
3186
3185
|
* @license
|
|
3187
3186
|
* Copyright 2020 Google LLC
|
|
@@ -3198,7 +3197,7 @@ const Xi = Yt;
|
|
|
3198
3197
|
* See the License for the specific language governing permissions and
|
|
3199
3198
|
* limitations under the License.
|
|
3200
3199
|
*/
|
|
3201
|
-
class
|
|
3200
|
+
class Qt extends Yt {
|
|
3202
3201
|
constructor() {
|
|
3203
3202
|
super(
|
|
3204
3203
|
() => window.sessionStorage,
|
|
@@ -3211,8 +3210,8 @@ class Xt extends Jt {
|
|
|
3211
3210
|
_removeListener(e, t) {
|
|
3212
3211
|
}
|
|
3213
3212
|
}
|
|
3214
|
-
|
|
3215
|
-
const
|
|
3213
|
+
Qt.type = "SESSION";
|
|
3214
|
+
const Zt = Qt;
|
|
3216
3215
|
/**
|
|
3217
3216
|
* @license
|
|
3218
3217
|
* Copyright 2019 Google LLC
|
|
@@ -3229,7 +3228,7 @@ const Qt = Xt;
|
|
|
3229
3228
|
* See the License for the specific language governing permissions and
|
|
3230
3229
|
* limitations under the License.
|
|
3231
3230
|
*/
|
|
3232
|
-
function
|
|
3231
|
+
function Zi(n) {
|
|
3233
3232
|
return Promise.all(n.map(async (e) => {
|
|
3234
3233
|
try {
|
|
3235
3234
|
return {
|
|
@@ -3299,7 +3298,7 @@ class Ee {
|
|
|
3299
3298
|
eventId: i,
|
|
3300
3299
|
eventType: r
|
|
3301
3300
|
});
|
|
3302
|
-
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await
|
|
3301
|
+
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await Zi(c);
|
|
3303
3302
|
t.ports[0].postMessage({
|
|
3304
3303
|
status: "done",
|
|
3305
3304
|
eventId: i,
|
|
@@ -3367,7 +3366,7 @@ function ze(n = "", e = 10) {
|
|
|
3367
3366
|
* See the License for the specific language governing permissions and
|
|
3368
3367
|
* limitations under the License.
|
|
3369
3368
|
*/
|
|
3370
|
-
class
|
|
3369
|
+
class er {
|
|
3371
3370
|
constructor(e) {
|
|
3372
3371
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
3373
3372
|
}
|
|
@@ -3412,9 +3411,9 @@ class Zi {
|
|
|
3412
3411
|
o = {
|
|
3413
3412
|
messageChannel: r,
|
|
3414
3413
|
onMessage(m) {
|
|
3415
|
-
const
|
|
3416
|
-
if (
|
|
3417
|
-
switch (
|
|
3414
|
+
const v = m;
|
|
3415
|
+
if (v.data.eventId === l)
|
|
3416
|
+
switch (v.data.status) {
|
|
3418
3417
|
case "ack":
|
|
3419
3418
|
clearTimeout(d), s = setTimeout(
|
|
3420
3419
|
() => {
|
|
@@ -3428,7 +3427,7 @@ class Zi {
|
|
|
3428
3427
|
);
|
|
3429
3428
|
break;
|
|
3430
3429
|
case "done":
|
|
3431
|
-
clearTimeout(s), c(
|
|
3430
|
+
clearTimeout(s), c(v.data.response);
|
|
3432
3431
|
break;
|
|
3433
3432
|
default:
|
|
3434
3433
|
clearTimeout(d), clearTimeout(s), a(new Error(
|
|
@@ -3464,11 +3463,11 @@ class Zi {
|
|
|
3464
3463
|
* See the License for the specific language governing permissions and
|
|
3465
3464
|
* limitations under the License.
|
|
3466
3465
|
*/
|
|
3467
|
-
function
|
|
3466
|
+
function S() {
|
|
3468
3467
|
return window;
|
|
3469
3468
|
}
|
|
3470
|
-
function
|
|
3471
|
-
|
|
3469
|
+
function tr(n) {
|
|
3470
|
+
S().location.href = n;
|
|
3472
3471
|
}
|
|
3473
3472
|
/**
|
|
3474
3473
|
* @license
|
|
@@ -3486,10 +3485,10 @@ function er(n) {
|
|
|
3486
3485
|
* See the License for the specific language governing permissions and
|
|
3487
3486
|
* limitations under the License.
|
|
3488
3487
|
*/
|
|
3489
|
-
function
|
|
3490
|
-
return typeof
|
|
3488
|
+
function en() {
|
|
3489
|
+
return typeof S().WorkerGlobalScope < "u" && typeof S().importScripts == "function";
|
|
3491
3490
|
}
|
|
3492
|
-
async function
|
|
3491
|
+
async function nr() {
|
|
3493
3492
|
if (!(navigator != null && navigator.serviceWorker))
|
|
3494
3493
|
return null;
|
|
3495
3494
|
try {
|
|
@@ -3498,12 +3497,12 @@ async function tr() {
|
|
|
3498
3497
|
return null;
|
|
3499
3498
|
}
|
|
3500
3499
|
}
|
|
3501
|
-
function
|
|
3500
|
+
function ir() {
|
|
3502
3501
|
var n;
|
|
3503
3502
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3504
3503
|
}
|
|
3505
|
-
function
|
|
3506
|
-
return
|
|
3504
|
+
function rr() {
|
|
3505
|
+
return en() ? self : null;
|
|
3507
3506
|
}
|
|
3508
3507
|
/**
|
|
3509
3508
|
* @license
|
|
@@ -3521,8 +3520,8 @@ function ir() {
|
|
|
3521
3520
|
* See the License for the specific language governing permissions and
|
|
3522
3521
|
* limitations under the License.
|
|
3523
3522
|
*/
|
|
3524
|
-
const
|
|
3525
|
-
class
|
|
3523
|
+
const tn = "firebaseLocalStorageDb", sr = 1, we = "firebaseLocalStorage", nn = "fbase_key";
|
|
3524
|
+
class le {
|
|
3526
3525
|
constructor(e) {
|
|
3527
3526
|
this.request = e;
|
|
3528
3527
|
}
|
|
@@ -3539,45 +3538,45 @@ class ce {
|
|
|
3539
3538
|
function Se(n, e) {
|
|
3540
3539
|
return n.transaction([we], e ? "readwrite" : "readonly").objectStore(we);
|
|
3541
3540
|
}
|
|
3542
|
-
function
|
|
3543
|
-
const n = indexedDB.deleteDatabase(
|
|
3544
|
-
return new
|
|
3541
|
+
function or() {
|
|
3542
|
+
const n = indexedDB.deleteDatabase(tn);
|
|
3543
|
+
return new le(n).toPromise();
|
|
3545
3544
|
}
|
|
3546
3545
|
function De() {
|
|
3547
|
-
const n = indexedDB.open(
|
|
3546
|
+
const n = indexedDB.open(tn, sr);
|
|
3548
3547
|
return new Promise((e, t) => {
|
|
3549
3548
|
n.addEventListener("error", () => {
|
|
3550
3549
|
t(n.error);
|
|
3551
3550
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3552
3551
|
const i = n.result;
|
|
3553
3552
|
try {
|
|
3554
|
-
i.createObjectStore(we, { keyPath:
|
|
3553
|
+
i.createObjectStore(we, { keyPath: nn });
|
|
3555
3554
|
} catch (r) {
|
|
3556
3555
|
t(r);
|
|
3557
3556
|
}
|
|
3558
3557
|
}), n.addEventListener("success", async () => {
|
|
3559
3558
|
const i = n.result;
|
|
3560
|
-
i.objectStoreNames.contains(we) ? e(i) : (i.close(), await
|
|
3559
|
+
i.objectStoreNames.contains(we) ? e(i) : (i.close(), await or(), e(await De()));
|
|
3561
3560
|
});
|
|
3562
3561
|
});
|
|
3563
3562
|
}
|
|
3564
3563
|
async function ut(n, e, t) {
|
|
3565
3564
|
const i = Se(n, !0).put({
|
|
3566
|
-
[
|
|
3565
|
+
[nn]: e,
|
|
3567
3566
|
value: t
|
|
3568
3567
|
});
|
|
3569
|
-
return new
|
|
3568
|
+
return new le(i).toPromise();
|
|
3570
3569
|
}
|
|
3571
|
-
async function
|
|
3572
|
-
const t = Se(n, !1).get(e), i = await new
|
|
3570
|
+
async function ar(n, e) {
|
|
3571
|
+
const t = Se(n, !1).get(e), i = await new le(t).toPromise();
|
|
3573
3572
|
return i === void 0 ? null : i.value;
|
|
3574
3573
|
}
|
|
3575
3574
|
function dt(n, e) {
|
|
3576
3575
|
const t = Se(n, !0).delete(e);
|
|
3577
|
-
return new
|
|
3576
|
+
return new le(t).toPromise();
|
|
3578
3577
|
}
|
|
3579
|
-
const
|
|
3580
|
-
class
|
|
3578
|
+
const cr = 800, lr = 3;
|
|
3579
|
+
class rn {
|
|
3581
3580
|
constructor() {
|
|
3582
3581
|
this.type = "LOCAL", this._shouldAllowMigration = !0, this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.pendingWrites = 0, this.receiver = null, this.sender = null, this.serviceWorkerReceiverAvailable = !1, this.activeServiceWorker = null, this._workerInitializationPromise = this.initializeServiceWorkerMessaging().then(() => {
|
|
3583
3582
|
}, () => {
|
|
@@ -3593,7 +3592,7 @@ class nn {
|
|
|
3593
3592
|
const i = await this._openDb();
|
|
3594
3593
|
return await e(i);
|
|
3595
3594
|
} catch (i) {
|
|
3596
|
-
if (t++ >
|
|
3595
|
+
if (t++ > lr)
|
|
3597
3596
|
throw i;
|
|
3598
3597
|
this.db && (this.db.close(), this.db = void 0);
|
|
3599
3598
|
}
|
|
@@ -3603,13 +3602,13 @@ class nn {
|
|
|
3603
3602
|
* postMessage interface to send these events to the worker ourselves.
|
|
3604
3603
|
*/
|
|
3605
3604
|
async initializeServiceWorkerMessaging() {
|
|
3606
|
-
return
|
|
3605
|
+
return en() ? this.initializeReceiver() : this.initializeSender();
|
|
3607
3606
|
}
|
|
3608
3607
|
/**
|
|
3609
3608
|
* As the worker we should listen to events from the main window.
|
|
3610
3609
|
*/
|
|
3611
3610
|
async initializeReceiver() {
|
|
3612
|
-
this.receiver = Ee._getInstance(
|
|
3611
|
+
this.receiver = Ee._getInstance(rr()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3613
3612
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3614
3613
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3615
3614
|
"keyChanged"
|
|
@@ -3625,9 +3624,9 @@ class nn {
|
|
|
3625
3624
|
*/
|
|
3626
3625
|
async initializeSender() {
|
|
3627
3626
|
var e, t;
|
|
3628
|
-
if (this.activeServiceWorker = await
|
|
3627
|
+
if (this.activeServiceWorker = await nr(), !this.activeServiceWorker)
|
|
3629
3628
|
return;
|
|
3630
|
-
this.sender = new
|
|
3629
|
+
this.sender = new er(this.activeServiceWorker);
|
|
3631
3630
|
const i = await this.sender._send(
|
|
3632
3631
|
"ping",
|
|
3633
3632
|
{},
|
|
@@ -3649,7 +3648,7 @@ class nn {
|
|
|
3649
3648
|
* @param key - Storage key which changed.
|
|
3650
3649
|
*/
|
|
3651
3650
|
async notifyServiceWorker(e) {
|
|
3652
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
3651
|
+
if (!(!this.sender || !this.activeServiceWorker || ir() !== this.activeServiceWorker))
|
|
3653
3652
|
try {
|
|
3654
3653
|
await this.sender._send(
|
|
3655
3654
|
"keyChanged",
|
|
@@ -3683,7 +3682,7 @@ class nn {
|
|
|
3683
3682
|
return this._withPendingWrite(async () => (await this._withRetries((i) => ut(i, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
3684
3683
|
}
|
|
3685
3684
|
async _get(e) {
|
|
3686
|
-
const t = await this._withRetries((i) =>
|
|
3685
|
+
const t = await this._withRetries((i) => ar(i, e));
|
|
3687
3686
|
return this.localCache[e] = t, t;
|
|
3688
3687
|
}
|
|
3689
3688
|
async _remove(e) {
|
|
@@ -3692,7 +3691,7 @@ class nn {
|
|
|
3692
3691
|
async _poll() {
|
|
3693
3692
|
const e = await this._withRetries((r) => {
|
|
3694
3693
|
const s = Se(r, !1).getAll();
|
|
3695
|
-
return new
|
|
3694
|
+
return new le(s).toPromise();
|
|
3696
3695
|
});
|
|
3697
3696
|
if (!e)
|
|
3698
3697
|
return [];
|
|
@@ -3714,7 +3713,7 @@ class nn {
|
|
|
3714
3713
|
r(t);
|
|
3715
3714
|
}
|
|
3716
3715
|
startPolling() {
|
|
3717
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
3716
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), cr);
|
|
3718
3717
|
}
|
|
3719
3718
|
stopPolling() {
|
|
3720
3719
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3726,9 +3725,9 @@ class nn {
|
|
|
3726
3725
|
this.listeners[e] && (this.listeners[e].delete(t), this.listeners[e].size === 0 && delete this.listeners[e]), Object.keys(this.listeners).length === 0 && this.stopPolling();
|
|
3727
3726
|
}
|
|
3728
3727
|
}
|
|
3729
|
-
|
|
3730
|
-
const
|
|
3731
|
-
new
|
|
3728
|
+
rn.type = "LOCAL";
|
|
3729
|
+
const ur = rn;
|
|
3730
|
+
new ae(3e4, 6e4);
|
|
3732
3731
|
/**
|
|
3733
3732
|
* @license
|
|
3734
3733
|
* Copyright 2021 Google LLC
|
|
@@ -3745,8 +3744,8 @@ new oe(3e4, 6e4);
|
|
|
3745
3744
|
* See the License for the specific language governing permissions and
|
|
3746
3745
|
* limitations under the License.
|
|
3747
3746
|
*/
|
|
3748
|
-
function
|
|
3749
|
-
return e ?
|
|
3747
|
+
function dr(n, e) {
|
|
3748
|
+
return e ? O(e) : (u(
|
|
3750
3749
|
n._popupRedirectResolver,
|
|
3751
3750
|
n,
|
|
3752
3751
|
"argument-error"
|
|
@@ -3769,7 +3768,7 @@ function ur(n, e) {
|
|
|
3769
3768
|
* See the License for the specific language governing permissions and
|
|
3770
3769
|
* limitations under the License.
|
|
3771
3770
|
*/
|
|
3772
|
-
class qe extends
|
|
3771
|
+
class qe extends qt {
|
|
3773
3772
|
constructor(e) {
|
|
3774
3773
|
super(
|
|
3775
3774
|
"custom",
|
|
@@ -3799,10 +3798,10 @@ class qe extends zt {
|
|
|
3799
3798
|
return e && (t.idToken = e), t;
|
|
3800
3799
|
}
|
|
3801
3800
|
}
|
|
3802
|
-
function dr(n) {
|
|
3803
|
-
return ji(n.auth, new qe(n), n.bypassAuthState);
|
|
3804
|
-
}
|
|
3805
3801
|
function hr(n) {
|
|
3802
|
+
return Bi(n.auth, new qe(n), n.bypassAuthState);
|
|
3803
|
+
}
|
|
3804
|
+
function fr(n) {
|
|
3806
3805
|
const { auth: e, user: t } = n;
|
|
3807
3806
|
return u(
|
|
3808
3807
|
t,
|
|
@@ -3811,14 +3810,14 @@ function hr(n) {
|
|
|
3811
3810
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3812
3811
|
), Wi(t, new qe(n), n.bypassAuthState);
|
|
3813
3812
|
}
|
|
3814
|
-
async function
|
|
3813
|
+
async function pr(n) {
|
|
3815
3814
|
const { auth: e, user: t } = n;
|
|
3816
3815
|
return u(
|
|
3817
3816
|
t,
|
|
3818
3817
|
e,
|
|
3819
3818
|
"internal-error"
|
|
3820
3819
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3821
|
-
),
|
|
3820
|
+
), ji(t, new qe(n), n.bypassAuthState);
|
|
3822
3821
|
}
|
|
3823
3822
|
/**
|
|
3824
3823
|
* @license
|
|
@@ -3836,7 +3835,7 @@ async function fr(n) {
|
|
|
3836
3835
|
* See the License for the specific language governing permissions and
|
|
3837
3836
|
* limitations under the License.
|
|
3838
3837
|
*/
|
|
3839
|
-
class
|
|
3838
|
+
class sn {
|
|
3840
3839
|
constructor(e, t, i, r, s = !1) {
|
|
3841
3840
|
this.auth = e, this.resolver = i, this.user = r, this.bypassAuthState = s, this.pendingPromise = null, this.eventManager = null, this.filter = Array.isArray(t) ? t : [t];
|
|
3842
3841
|
}
|
|
@@ -3878,15 +3877,15 @@ class rn {
|
|
|
3878
3877
|
switch (e) {
|
|
3879
3878
|
case "signInViaPopup":
|
|
3880
3879
|
case "signInViaRedirect":
|
|
3881
|
-
return
|
|
3880
|
+
return hr;
|
|
3882
3881
|
case "linkViaPopup":
|
|
3883
3882
|
case "linkViaRedirect":
|
|
3884
|
-
return
|
|
3883
|
+
return pr;
|
|
3885
3884
|
case "reauthViaPopup":
|
|
3886
3885
|
case "reauthViaRedirect":
|
|
3887
|
-
return
|
|
3886
|
+
return fr;
|
|
3888
3887
|
default:
|
|
3889
|
-
|
|
3888
|
+
L(
|
|
3890
3889
|
this.auth,
|
|
3891
3890
|
"internal-error"
|
|
3892
3891
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -3894,10 +3893,10 @@ class rn {
|
|
|
3894
3893
|
}
|
|
3895
3894
|
}
|
|
3896
3895
|
resolve(e) {
|
|
3897
|
-
|
|
3896
|
+
M(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.resolve(e), this.unregisterAndCleanUp();
|
|
3898
3897
|
}
|
|
3899
3898
|
reject(e) {
|
|
3900
|
-
|
|
3899
|
+
M(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.reject(e), this.unregisterAndCleanUp();
|
|
3901
3900
|
}
|
|
3902
3901
|
unregisterAndCleanUp() {
|
|
3903
3902
|
this.eventManager && this.eventManager.unregisterConsumer(this), this.pendingPromise = null, this.cleanUp();
|
|
@@ -3919,8 +3918,8 @@ class rn {
|
|
|
3919
3918
|
* See the License for the specific language governing permissions and
|
|
3920
3919
|
* limitations under the License.
|
|
3921
3920
|
*/
|
|
3922
|
-
const
|
|
3923
|
-
class z extends
|
|
3921
|
+
const mr = new ae(2e3, 1e4);
|
|
3922
|
+
class z extends sn {
|
|
3924
3923
|
constructor(e, t, i, r, s) {
|
|
3925
3924
|
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, z.currentPopupAction && z.currentPopupAction.cancel(), z.currentPopupAction = this;
|
|
3926
3925
|
}
|
|
@@ -3934,7 +3933,7 @@ class z extends rn {
|
|
|
3934
3933
|
), e;
|
|
3935
3934
|
}
|
|
3936
3935
|
async onExecution() {
|
|
3937
|
-
|
|
3936
|
+
M(this.filter.length === 1, "Popup operations only handle one event");
|
|
3938
3937
|
const e = ze();
|
|
3939
3938
|
this.authWindow = await this.resolver._openPopup(
|
|
3940
3939
|
this.auth,
|
|
@@ -3945,7 +3944,7 @@ class z extends rn {
|
|
|
3945
3944
|
), this.authWindow.associatedEvent = e, this.resolver._originValidation(this.auth).catch((t) => {
|
|
3946
3945
|
this.reject(t);
|
|
3947
3946
|
}), this.resolver._isIframeWebStorageSupported(this.auth, (t) => {
|
|
3948
|
-
t || this.reject(
|
|
3947
|
+
t || this.reject(E(
|
|
3949
3948
|
this.auth,
|
|
3950
3949
|
"web-storage-unsupported"
|
|
3951
3950
|
/* AuthErrorCode.WEB_STORAGE_UNSUPPORTED */
|
|
@@ -3957,7 +3956,7 @@ class z extends rn {
|
|
|
3957
3956
|
return ((e = this.authWindow) === null || e === void 0 ? void 0 : e.associatedEvent) || null;
|
|
3958
3957
|
}
|
|
3959
3958
|
cancel() {
|
|
3960
|
-
this.reject(
|
|
3959
|
+
this.reject(E(
|
|
3961
3960
|
this.auth,
|
|
3962
3961
|
"cancelled-popup-request"
|
|
3963
3962
|
/* AuthErrorCode.EXPIRED_POPUP_REQUEST */
|
|
@@ -3972,7 +3971,7 @@ class z extends rn {
|
|
|
3972
3971
|
if (!((i = (t = this.authWindow) === null || t === void 0 ? void 0 : t.window) === null || i === void 0) && i.closed) {
|
|
3973
3972
|
this.pollId = window.setTimeout(
|
|
3974
3973
|
() => {
|
|
3975
|
-
this.pollId = null, this.reject(
|
|
3974
|
+
this.pollId = null, this.reject(E(
|
|
3976
3975
|
this.auth,
|
|
3977
3976
|
"popup-closed-by-user"
|
|
3978
3977
|
/* AuthErrorCode.POPUP_CLOSED_BY_USER */
|
|
@@ -3983,7 +3982,7 @@ class z extends rn {
|
|
|
3983
3982
|
);
|
|
3984
3983
|
return;
|
|
3985
3984
|
}
|
|
3986
|
-
this.pollId = window.setTimeout(e,
|
|
3985
|
+
this.pollId = window.setTimeout(e, mr.get());
|
|
3987
3986
|
};
|
|
3988
3987
|
e();
|
|
3989
3988
|
}
|
|
@@ -4005,8 +4004,8 @@ z.currentPopupAction = null;
|
|
|
4005
4004
|
* See the License for the specific language governing permissions and
|
|
4006
4005
|
* limitations under the License.
|
|
4007
4006
|
*/
|
|
4008
|
-
const
|
|
4009
|
-
class
|
|
4007
|
+
const gr = "pendingRedirect", fe = /* @__PURE__ */ new Map();
|
|
4008
|
+
class _r extends sn {
|
|
4010
4009
|
constructor(e, t, i = !1) {
|
|
4011
4010
|
super(e, [
|
|
4012
4011
|
"signInViaRedirect",
|
|
@@ -4021,17 +4020,17 @@ class gr extends rn {
|
|
|
4021
4020
|
* just return it.
|
|
4022
4021
|
*/
|
|
4023
4022
|
async execute() {
|
|
4024
|
-
let e =
|
|
4023
|
+
let e = fe.get(this.auth._key());
|
|
4025
4024
|
if (!e) {
|
|
4026
4025
|
try {
|
|
4027
|
-
const i = await
|
|
4026
|
+
const i = await vr(this.resolver, this.auth) ? await super.execute() : null;
|
|
4028
4027
|
e = () => Promise.resolve(i);
|
|
4029
4028
|
} catch (t) {
|
|
4030
4029
|
e = () => Promise.reject(t);
|
|
4031
4030
|
}
|
|
4032
|
-
|
|
4031
|
+
fe.set(this.auth._key(), e);
|
|
4033
4032
|
}
|
|
4034
|
-
return this.bypassAuthState ||
|
|
4033
|
+
return this.bypassAuthState || fe.set(this.auth._key(), () => Promise.resolve(null)), e();
|
|
4035
4034
|
}
|
|
4036
4035
|
async onAuthEvent(e) {
|
|
4037
4036
|
if (e.type === "signInViaRedirect")
|
|
@@ -4052,26 +4051,26 @@ class gr extends rn {
|
|
|
4052
4051
|
cleanUp() {
|
|
4053
4052
|
}
|
|
4054
4053
|
}
|
|
4055
|
-
async function
|
|
4056
|
-
const t =
|
|
4054
|
+
async function vr(n, e) {
|
|
4055
|
+
const t = wr(e), i = yr(n);
|
|
4057
4056
|
if (!await i._isAvailable())
|
|
4058
4057
|
return !1;
|
|
4059
4058
|
const r = await i._get(t) === "true";
|
|
4060
4059
|
return await i._remove(t), r;
|
|
4061
4060
|
}
|
|
4062
|
-
function
|
|
4063
|
-
|
|
4064
|
-
}
|
|
4065
|
-
function Ir(n) {
|
|
4066
|
-
return N(n._redirectPersistence);
|
|
4061
|
+
function Ir(n, e) {
|
|
4062
|
+
fe.set(n._key(), e);
|
|
4067
4063
|
}
|
|
4068
4064
|
function yr(n) {
|
|
4069
|
-
return
|
|
4065
|
+
return O(n._redirectPersistence);
|
|
4070
4066
|
}
|
|
4071
|
-
|
|
4072
|
-
|
|
4067
|
+
function wr(n) {
|
|
4068
|
+
return he(gr, n.config.apiKey, n.name);
|
|
4069
|
+
}
|
|
4070
|
+
async function Tr(n, e, t = !1) {
|
|
4071
|
+
if (P(n.app))
|
|
4073
4072
|
return Promise.reject(H(n));
|
|
4074
|
-
const i = be(n), r =
|
|
4073
|
+
const i = be(n), r = dr(i, e), o = await new _r(i, r, t).execute();
|
|
4075
4074
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
4076
4075
|
}
|
|
4077
4076
|
/**
|
|
@@ -4090,8 +4089,8 @@ async function wr(n, e, t = !1) {
|
|
|
4090
4089
|
* See the License for the specific language governing permissions and
|
|
4091
4090
|
* limitations under the License.
|
|
4092
4091
|
*/
|
|
4093
|
-
const
|
|
4094
|
-
class
|
|
4092
|
+
const kr = 10 * 60 * 1e3;
|
|
4093
|
+
class br {
|
|
4095
4094
|
constructor(e) {
|
|
4096
4095
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
4097
4096
|
}
|
|
@@ -4107,13 +4106,13 @@ class kr {
|
|
|
4107
4106
|
let t = !1;
|
|
4108
4107
|
return this.consumers.forEach((i) => {
|
|
4109
4108
|
this.isEventForConsumer(e, i) && (t = !0, this.sendToConsumer(e, i), this.saveEventToCache(e));
|
|
4110
|
-
}), this.hasHandledPotentialRedirect || !
|
|
4109
|
+
}), this.hasHandledPotentialRedirect || !Er(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
4111
4110
|
}
|
|
4112
4111
|
sendToConsumer(e, t) {
|
|
4113
4112
|
var i;
|
|
4114
|
-
if (e.error && !
|
|
4113
|
+
if (e.error && !on(e)) {
|
|
4115
4114
|
const r = ((i = e.error.code) === null || i === void 0 ? void 0 : i.split("auth/")[1]) || "internal-error";
|
|
4116
|
-
t.onError(
|
|
4115
|
+
t.onError(E(this.auth, r));
|
|
4117
4116
|
} else
|
|
4118
4117
|
t.onAuthEvent(e);
|
|
4119
4118
|
}
|
|
@@ -4122,7 +4121,7 @@ class kr {
|
|
|
4122
4121
|
return t.filter.includes(e.type) && i;
|
|
4123
4122
|
}
|
|
4124
4123
|
hasEventBeenHandled(e) {
|
|
4125
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
4124
|
+
return Date.now() - this.lastProcessedEventTime >= kr && this.cachedEventUids.clear(), this.cachedEventUids.has(ht(e));
|
|
4126
4125
|
}
|
|
4127
4126
|
saveEventToCache(e) {
|
|
4128
4127
|
this.cachedEventUids.add(ht(e)), this.lastProcessedEventTime = Date.now();
|
|
@@ -4131,17 +4130,17 @@ class kr {
|
|
|
4131
4130
|
function ht(n) {
|
|
4132
4131
|
return [n.type, n.eventId, n.sessionId, n.tenantId].filter((e) => e).join("-");
|
|
4133
4132
|
}
|
|
4134
|
-
function
|
|
4133
|
+
function on({ type: n, error: e }) {
|
|
4135
4134
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
4136
4135
|
}
|
|
4137
|
-
function
|
|
4136
|
+
function Er(n) {
|
|
4138
4137
|
switch (n.type) {
|
|
4139
4138
|
case "signInViaRedirect":
|
|
4140
4139
|
case "linkViaRedirect":
|
|
4141
4140
|
case "reauthViaRedirect":
|
|
4142
4141
|
return !0;
|
|
4143
4142
|
case "unknown":
|
|
4144
|
-
return
|
|
4143
|
+
return on(n);
|
|
4145
4144
|
default:
|
|
4146
4145
|
return !1;
|
|
4147
4146
|
}
|
|
@@ -4162,7 +4161,7 @@ function br(n) {
|
|
|
4162
4161
|
* See the License for the specific language governing permissions and
|
|
4163
4162
|
* limitations under the License.
|
|
4164
4163
|
*/
|
|
4165
|
-
async function
|
|
4164
|
+
async function Sr(n, e = {}) {
|
|
4166
4165
|
return Q(n, "GET", "/v1/projects", e);
|
|
4167
4166
|
}
|
|
4168
4167
|
/**
|
|
@@ -4181,32 +4180,32 @@ async function Er(n, e = {}) {
|
|
|
4181
4180
|
* See the License for the specific language governing permissions and
|
|
4182
4181
|
* limitations under the License.
|
|
4183
4182
|
*/
|
|
4184
|
-
const
|
|
4185
|
-
async function
|
|
4183
|
+
const Rr = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Ar = /^https?/;
|
|
4184
|
+
async function Pr(n) {
|
|
4186
4185
|
if (n.config.emulator)
|
|
4187
4186
|
return;
|
|
4188
|
-
const { authorizedDomains: e } = await
|
|
4187
|
+
const { authorizedDomains: e } = await Sr(n);
|
|
4189
4188
|
for (const t of e)
|
|
4190
4189
|
try {
|
|
4191
|
-
if (
|
|
4190
|
+
if (Cr(t))
|
|
4192
4191
|
return;
|
|
4193
4192
|
} catch {
|
|
4194
4193
|
}
|
|
4195
|
-
|
|
4194
|
+
L(
|
|
4196
4195
|
n,
|
|
4197
4196
|
"unauthorized-domain"
|
|
4198
4197
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
4199
4198
|
);
|
|
4200
4199
|
}
|
|
4201
|
-
function
|
|
4200
|
+
function Cr(n) {
|
|
4202
4201
|
const e = Me(), { protocol: t, hostname: i } = new URL(e);
|
|
4203
4202
|
if (n.startsWith("chrome-extension://")) {
|
|
4204
4203
|
const o = new URL(n);
|
|
4205
4204
|
return o.hostname === "" && i === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === i;
|
|
4206
4205
|
}
|
|
4207
|
-
if (!
|
|
4206
|
+
if (!Ar.test(t))
|
|
4208
4207
|
return !1;
|
|
4209
|
-
if (
|
|
4208
|
+
if (Rr.test(n))
|
|
4210
4209
|
return i === n;
|
|
4211
4210
|
const r = n.replace(/\./g, "\\.");
|
|
4212
4211
|
return new RegExp("^(.+\\." + r + "|" + r + ")$", "i").test(i);
|
|
@@ -4227,9 +4226,9 @@ function Pr(n) {
|
|
|
4227
4226
|
* See the License for the specific language governing permissions and
|
|
4228
4227
|
* limitations under the License.
|
|
4229
4228
|
*/
|
|
4230
|
-
const
|
|
4229
|
+
const Nr = new ae(3e4, 6e4);
|
|
4231
4230
|
function ft() {
|
|
4232
|
-
const n =
|
|
4231
|
+
const n = S().___jsl;
|
|
4233
4232
|
if (n != null && n.H) {
|
|
4234
4233
|
for (const e of Object.keys(n.H))
|
|
4235
4234
|
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)
|
|
@@ -4237,7 +4236,7 @@ function ft() {
|
|
|
4237
4236
|
n.CP[t] = null;
|
|
4238
4237
|
}
|
|
4239
4238
|
}
|
|
4240
|
-
function
|
|
4239
|
+
function Or(n) {
|
|
4241
4240
|
return new Promise((e, t) => {
|
|
4242
4241
|
var i, r, s;
|
|
4243
4242
|
function o() {
|
|
@@ -4246,36 +4245,36 @@ function Nr(n) {
|
|
|
4246
4245
|
e(gapi.iframes.getContext());
|
|
4247
4246
|
},
|
|
4248
4247
|
ontimeout: () => {
|
|
4249
|
-
ft(), t(
|
|
4248
|
+
ft(), t(E(
|
|
4250
4249
|
n,
|
|
4251
4250
|
"network-request-failed"
|
|
4252
4251
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4253
4252
|
));
|
|
4254
4253
|
},
|
|
4255
|
-
timeout:
|
|
4254
|
+
timeout: Nr.get()
|
|
4256
4255
|
});
|
|
4257
4256
|
}
|
|
4258
|
-
if (!((r = (i =
|
|
4257
|
+
if (!((r = (i = S().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
4259
4258
|
e(gapi.iframes.getContext());
|
|
4260
|
-
else if (!((s =
|
|
4259
|
+
else if (!((s = S().gapi) === null || s === void 0) && s.load)
|
|
4261
4260
|
o();
|
|
4262
4261
|
else {
|
|
4263
|
-
const c =
|
|
4264
|
-
return
|
|
4265
|
-
gapi.load ? o() : t(
|
|
4262
|
+
const c = Ui("iframefcb");
|
|
4263
|
+
return S()[c] = () => {
|
|
4264
|
+
gapi.load ? o() : t(E(
|
|
4266
4265
|
n,
|
|
4267
4266
|
"network-request-failed"
|
|
4268
4267
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4269
4268
|
));
|
|
4270
|
-
},
|
|
4269
|
+
}, Li(`${Mi()}?onload=${c}`).catch((a) => t(a));
|
|
4271
4270
|
}
|
|
4272
4271
|
}).catch((e) => {
|
|
4273
|
-
throw
|
|
4272
|
+
throw pe = null, e;
|
|
4274
4273
|
});
|
|
4275
4274
|
}
|
|
4276
|
-
let
|
|
4277
|
-
function
|
|
4278
|
-
return
|
|
4275
|
+
let pe = null;
|
|
4276
|
+
function Lr(n) {
|
|
4277
|
+
return pe = pe || Or(n), pe;
|
|
4279
4278
|
}
|
|
4280
4279
|
/**
|
|
4281
4280
|
* @license
|
|
@@ -4293,7 +4292,7 @@ function Or(n) {
|
|
|
4293
4292
|
* See the License for the specific language governing permissions and
|
|
4294
4293
|
* limitations under the License.
|
|
4295
4294
|
*/
|
|
4296
|
-
const
|
|
4295
|
+
const Mr = new ae(5e3, 15e3), Ur = "__/auth/iframe", Dr = "emulator/auth/iframe", xr = {
|
|
4297
4296
|
style: {
|
|
4298
4297
|
position: "absolute",
|
|
4299
4298
|
top: "-100px",
|
|
@@ -4302,13 +4301,13 @@ const Lr = new oe(5e3, 15e3), Mr = "__/auth/iframe", Ur = "emulator/auth/iframe"
|
|
|
4302
4301
|
},
|
|
4303
4302
|
"aria-hidden": "true",
|
|
4304
4303
|
tabindex: "-1"
|
|
4305
|
-
},
|
|
4304
|
+
}, Fr = /* @__PURE__ */ new Map([
|
|
4306
4305
|
["identitytoolkit.googleapis.com", "p"],
|
|
4307
4306
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
4308
4307
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
4309
4308
|
// test
|
|
4310
4309
|
]);
|
|
4311
|
-
function
|
|
4310
|
+
function Vr(n) {
|
|
4312
4311
|
const e = n.config;
|
|
4313
4312
|
u(
|
|
4314
4313
|
e.authDomain,
|
|
@@ -4316,17 +4315,17 @@ function Fr(n) {
|
|
|
4316
4315
|
"auth-domain-config-required"
|
|
4317
4316
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
4318
4317
|
);
|
|
4319
|
-
const t = e.emulator ?
|
|
4318
|
+
const t = e.emulator ? je(e, Dr) : `https://${n.config.authDomain}/${Ur}`, i = {
|
|
4320
4319
|
apiKey: e.apiKey,
|
|
4321
4320
|
appName: n.name,
|
|
4322
|
-
v:
|
|
4323
|
-
}, r =
|
|
4321
|
+
v: se
|
|
4322
|
+
}, r = Fr.get(n.config.apiHost);
|
|
4324
4323
|
r && (i.eid = r);
|
|
4325
4324
|
const s = n._getFrameworks();
|
|
4326
|
-
return s.length && (i.fw = s.join(",")), `${t}?${
|
|
4325
|
+
return s.length && (i.fw = s.join(",")), `${t}?${oe(i).slice(1)}`;
|
|
4327
4326
|
}
|
|
4328
|
-
async function
|
|
4329
|
-
const e = await
|
|
4327
|
+
async function $r(n) {
|
|
4328
|
+
const e = await Lr(n), t = S().gapi;
|
|
4330
4329
|
return u(
|
|
4331
4330
|
t,
|
|
4332
4331
|
n,
|
|
@@ -4334,24 +4333,24 @@ async function Vr(n) {
|
|
|
4334
4333
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4335
4334
|
), e.open({
|
|
4336
4335
|
where: document.body,
|
|
4337
|
-
url:
|
|
4336
|
+
url: Vr(n),
|
|
4338
4337
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
4339
|
-
attributes:
|
|
4338
|
+
attributes: xr,
|
|
4340
4339
|
dontclear: !0
|
|
4341
4340
|
}, (i) => new Promise(async (r, s) => {
|
|
4342
4341
|
await i.restyle({
|
|
4343
4342
|
// Prevent iframe from closing on mouse out.
|
|
4344
4343
|
setHideOnLeave: !1
|
|
4345
4344
|
});
|
|
4346
|
-
const o =
|
|
4345
|
+
const o = E(
|
|
4347
4346
|
n,
|
|
4348
4347
|
"network-request-failed"
|
|
4349
4348
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4350
|
-
), c =
|
|
4349
|
+
), c = S().setTimeout(() => {
|
|
4351
4350
|
s(o);
|
|
4352
|
-
},
|
|
4351
|
+
}, Mr.get());
|
|
4353
4352
|
function a() {
|
|
4354
|
-
|
|
4353
|
+
S().clearTimeout(c), r(i);
|
|
4355
4354
|
}
|
|
4356
4355
|
i.ping(a).then(a, () => {
|
|
4357
4356
|
s(o);
|
|
@@ -4374,12 +4373,12 @@ async function Vr(n) {
|
|
|
4374
4373
|
* See the License for the specific language governing permissions and
|
|
4375
4374
|
* limitations under the License.
|
|
4376
4375
|
*/
|
|
4377
|
-
const
|
|
4376
|
+
const Hr = {
|
|
4378
4377
|
location: "yes",
|
|
4379
4378
|
resizable: "yes",
|
|
4380
4379
|
statusbar: "yes",
|
|
4381
4380
|
toolbar: "no"
|
|
4382
|
-
},
|
|
4381
|
+
}, jr = 500, Wr = 600, Br = "_blank", Gr = "http://localhost";
|
|
4383
4382
|
class pt {
|
|
4384
4383
|
constructor(e) {
|
|
4385
4384
|
this.window = e, this.associatedEvent = null;
|
|
@@ -4392,19 +4391,19 @@ class pt {
|
|
|
4392
4391
|
}
|
|
4393
4392
|
}
|
|
4394
4393
|
}
|
|
4395
|
-
function
|
|
4394
|
+
function zr(n, e, t, i = jr, r = Wr) {
|
|
4396
4395
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4397
4396
|
let c = "";
|
|
4398
|
-
const a = Object.assign(Object.assign({},
|
|
4397
|
+
const a = Object.assign(Object.assign({}, Hr), {
|
|
4399
4398
|
width: i.toString(),
|
|
4400
4399
|
height: r.toString(),
|
|
4401
4400
|
top: s,
|
|
4402
4401
|
left: o
|
|
4403
|
-
}), l =
|
|
4404
|
-
t && (c =
|
|
4405
|
-
const d = Object.entries(a).reduce((
|
|
4406
|
-
if (
|
|
4407
|
-
return
|
|
4402
|
+
}), l = k().toLowerCase();
|
|
4403
|
+
t && (c = Vt(l) ? Br : t), Ft(l) && (e = e || Gr, a.scrollbars = "yes");
|
|
4404
|
+
const d = Object.entries(a).reduce((v, [y, f]) => `${v}${y}=${f},`, "");
|
|
4405
|
+
if (bi(l) && c !== "_self")
|
|
4406
|
+
return qr(e || "", c), new pt(null);
|
|
4408
4407
|
const m = window.open(e || "", c, d);
|
|
4409
4408
|
u(
|
|
4410
4409
|
m,
|
|
@@ -4418,7 +4417,7 @@ function Gr(n, e, t, i = Hr, r = Wr) {
|
|
|
4418
4417
|
}
|
|
4419
4418
|
return new pt(m);
|
|
4420
4419
|
}
|
|
4421
|
-
function
|
|
4420
|
+
function qr(n, e) {
|
|
4422
4421
|
const t = document.createElement("a");
|
|
4423
4422
|
t.href = n, t.target = e;
|
|
4424
4423
|
const i = document.createEvent("MouseEvent");
|
|
@@ -4440,7 +4439,7 @@ function zr(n, e) {
|
|
|
4440
4439
|
* See the License for the specific language governing permissions and
|
|
4441
4440
|
* limitations under the License.
|
|
4442
4441
|
*/
|
|
4443
|
-
const
|
|
4442
|
+
const Kr = "__/auth/handler", Jr = "emulator/auth/handler", Yr = encodeURIComponent("fac");
|
|
4444
4443
|
async function mt(n, e, t, i, r, s) {
|
|
4445
4444
|
u(
|
|
4446
4445
|
n.config.authDomain,
|
|
@@ -4458,15 +4457,15 @@ async function mt(n, e, t, i, r, s) {
|
|
|
4458
4457
|
appName: n.name,
|
|
4459
4458
|
authType: t,
|
|
4460
4459
|
redirectUrl: i,
|
|
4461
|
-
v:
|
|
4460
|
+
v: se,
|
|
4462
4461
|
eventId: r
|
|
4463
4462
|
};
|
|
4464
|
-
if (e instanceof
|
|
4465
|
-
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "",
|
|
4463
|
+
if (e instanceof Kt) {
|
|
4464
|
+
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", Mn(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
4466
4465
|
for (const [d, m] of Object.entries({}))
|
|
4467
4466
|
o[d] = m;
|
|
4468
4467
|
}
|
|
4469
|
-
if (e instanceof
|
|
4468
|
+
if (e instanceof ce) {
|
|
4470
4469
|
const d = e.getScopes().filter((m) => m !== "");
|
|
4471
4470
|
d.length > 0 && (o.scopes = d.join(","));
|
|
4472
4471
|
}
|
|
@@ -4474,11 +4473,11 @@ async function mt(n, e, t, i, r, s) {
|
|
|
4474
4473
|
const c = o;
|
|
4475
4474
|
for (const d of Object.keys(c))
|
|
4476
4475
|
c[d] === void 0 && delete c[d];
|
|
4477
|
-
const a = await n._getAppCheckToken(), l = a ? `#${
|
|
4478
|
-
return `${
|
|
4476
|
+
const a = await n._getAppCheckToken(), l = a ? `#${Yr}=${encodeURIComponent(a)}` : "";
|
|
4477
|
+
return `${Xr(n)}?${oe(c).slice(1)}${l}`;
|
|
4479
4478
|
}
|
|
4480
|
-
function
|
|
4481
|
-
return n.emulator ?
|
|
4479
|
+
function Xr({ config: n }) {
|
|
4480
|
+
return n.emulator ? je(n, Jr) : `https://${n.authDomain}/${Kr}`;
|
|
4482
4481
|
}
|
|
4483
4482
|
/**
|
|
4484
4483
|
* @license
|
|
@@ -4497,29 +4496,29 @@ function Yr({ config: n }) {
|
|
|
4497
4496
|
* limitations under the License.
|
|
4498
4497
|
*/
|
|
4499
4498
|
const Ne = "webStorageSupport";
|
|
4500
|
-
class
|
|
4499
|
+
class Qr {
|
|
4501
4500
|
constructor() {
|
|
4502
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence =
|
|
4501
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Zt, this._completeRedirectFn = Tr, this._overrideRedirectResult = Ir;
|
|
4503
4502
|
}
|
|
4504
4503
|
// Wrapping in async even though we don't await anywhere in order
|
|
4505
4504
|
// to make sure errors are raised as promise rejections
|
|
4506
4505
|
async _openPopup(e, t, i, r) {
|
|
4507
4506
|
var s;
|
|
4508
|
-
|
|
4507
|
+
M((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4509
4508
|
const o = await mt(e, t, i, Me(), r);
|
|
4510
|
-
return
|
|
4509
|
+
return zr(e, o, ze());
|
|
4511
4510
|
}
|
|
4512
4511
|
async _openRedirect(e, t, i, r) {
|
|
4513
4512
|
await this._originValidation(e);
|
|
4514
4513
|
const s = await mt(e, t, i, Me(), r);
|
|
4515
|
-
return
|
|
4514
|
+
return tr(s), new Promise(() => {
|
|
4516
4515
|
});
|
|
4517
4516
|
}
|
|
4518
4517
|
_initialize(e) {
|
|
4519
4518
|
const t = e._key();
|
|
4520
4519
|
if (this.eventManagers[t]) {
|
|
4521
4520
|
const { manager: r, promise: s } = this.eventManagers[t];
|
|
4522
|
-
return r ? Promise.resolve(r) : (
|
|
4521
|
+
return r ? Promise.resolve(r) : (M(s, "If manager is not set, promise should be"), s);
|
|
4523
4522
|
}
|
|
4524
4523
|
const i = this.initAndGetManager(e);
|
|
4525
4524
|
return this.eventManagers[t] = { promise: i }, i.catch(() => {
|
|
@@ -4527,7 +4526,7 @@ class Xr {
|
|
|
4527
4526
|
}), i;
|
|
4528
4527
|
}
|
|
4529
4528
|
async initAndGetManager(e) {
|
|
4530
|
-
const t = await
|
|
4529
|
+
const t = await $r(e), i = new br(e);
|
|
4531
4530
|
return t.register("authEvent", (r) => (u(
|
|
4532
4531
|
r == null ? void 0 : r.authEvent,
|
|
4533
4532
|
e,
|
|
@@ -4542,7 +4541,7 @@ class Xr {
|
|
|
4542
4541
|
this.iframes[e._key()].send(Ne, { type: Ne }, (r) => {
|
|
4543
4542
|
var s;
|
|
4544
4543
|
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[Ne];
|
|
4545
|
-
o !== void 0 && t(!!o),
|
|
4544
|
+
o !== void 0 && t(!!o), L(
|
|
4546
4545
|
e,
|
|
4547
4546
|
"internal-error"
|
|
4548
4547
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -4551,13 +4550,13 @@ class Xr {
|
|
|
4551
4550
|
}
|
|
4552
4551
|
_originValidation(e) {
|
|
4553
4552
|
const t = e._key();
|
|
4554
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
4553
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Pr(e)), this.originValidationPromises[t];
|
|
4555
4554
|
}
|
|
4556
4555
|
get _shouldInitProactively() {
|
|
4557
|
-
return
|
|
4556
|
+
return Bt() || Be() || ke();
|
|
4558
4557
|
}
|
|
4559
4558
|
}
|
|
4560
|
-
const
|
|
4559
|
+
const Zr = Qr;
|
|
4561
4560
|
var gt = "@firebase/auth", _t = "1.7.5";
|
|
4562
4561
|
/**
|
|
4563
4562
|
* @license
|
|
@@ -4575,7 +4574,7 @@ var gt = "@firebase/auth", _t = "1.7.5";
|
|
|
4575
4574
|
* See the License for the specific language governing permissions and
|
|
4576
4575
|
* limitations under the License.
|
|
4577
4576
|
*/
|
|
4578
|
-
class
|
|
4577
|
+
class es {
|
|
4579
4578
|
constructor(e) {
|
|
4580
4579
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
4581
4580
|
}
|
|
@@ -4626,7 +4625,7 @@ class Zr {
|
|
|
4626
4625
|
* See the License for the specific language governing permissions and
|
|
4627
4626
|
* limitations under the License.
|
|
4628
4627
|
*/
|
|
4629
|
-
function
|
|
4628
|
+
function ts(n) {
|
|
4630
4629
|
switch (n) {
|
|
4631
4630
|
case "Node":
|
|
4632
4631
|
return "node";
|
|
@@ -4642,7 +4641,7 @@ function es(n) {
|
|
|
4642
4641
|
return;
|
|
4643
4642
|
}
|
|
4644
4643
|
}
|
|
4645
|
-
function
|
|
4644
|
+
function ns(n) {
|
|
4646
4645
|
Ze(new et(
|
|
4647
4646
|
"auth",
|
|
4648
4647
|
(e, { options: t }) => {
|
|
@@ -4655,9 +4654,9 @@ function ts(n) {
|
|
|
4655
4654
|
apiHost: "identitytoolkit.googleapis.com",
|
|
4656
4655
|
tokenApiHost: "securetoken.googleapis.com",
|
|
4657
4656
|
apiScheme: "https",
|
|
4658
|
-
sdkClientVersion:
|
|
4659
|
-
}, l = new
|
|
4660
|
-
return
|
|
4657
|
+
sdkClientVersion: Gt(n)
|
|
4658
|
+
}, l = new Ni(i, r, s, a);
|
|
4659
|
+
return xi(l, t), l;
|
|
4661
4660
|
},
|
|
4662
4661
|
"PUBLIC"
|
|
4663
4662
|
/* ComponentType.PUBLIC */
|
|
@@ -4676,14 +4675,14 @@ function ts(n) {
|
|
|
4676
4675
|
"auth"
|
|
4677
4676
|
/* _ComponentName.AUTH */
|
|
4678
4677
|
).getImmediate());
|
|
4679
|
-
return ((i) => new
|
|
4678
|
+
return ((i) => new es(i))(t);
|
|
4680
4679
|
},
|
|
4681
4680
|
"PRIVATE"
|
|
4682
4681
|
/* ComponentType.PRIVATE */
|
|
4683
4682
|
).setInstantiationMode(
|
|
4684
4683
|
"EXPLICIT"
|
|
4685
4684
|
/* InstantiationMode.EXPLICIT */
|
|
4686
|
-
)), Le(gt, _t,
|
|
4685
|
+
)), Le(gt, _t, ts(n)), Le(gt, _t, "esm2017");
|
|
4687
4686
|
}
|
|
4688
4687
|
/**
|
|
4689
4688
|
* @license
|
|
@@ -4701,11 +4700,11 @@ function ts(n) {
|
|
|
4701
4700
|
* See the License for the specific language governing permissions and
|
|
4702
4701
|
* limitations under the License.
|
|
4703
4702
|
*/
|
|
4704
|
-
const
|
|
4703
|
+
const is = 5 * 60, rs = bt("authIdTokenMaxAge") || is;
|
|
4705
4704
|
let vt = null;
|
|
4706
|
-
const
|
|
4705
|
+
const ss = (n) => async (e) => {
|
|
4707
4706
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
4708
|
-
if (i && i >
|
|
4707
|
+
if (i && i > rs)
|
|
4709
4708
|
return;
|
|
4710
4709
|
const r = t == null ? void 0 : t.token;
|
|
4711
4710
|
vt !== r && (vt = r, await fetch(n, {
|
|
@@ -4715,100 +4714,118 @@ const rs = (n) => async (e) => {
|
|
|
4715
4714
|
} : {}
|
|
4716
4715
|
}));
|
|
4717
4716
|
};
|
|
4718
|
-
function
|
|
4719
|
-
const e =
|
|
4717
|
+
function os(n = Cn()) {
|
|
4718
|
+
const e = Et(n, "auth");
|
|
4720
4719
|
if (e.isInitialized())
|
|
4721
4720
|
return e.getImmediate();
|
|
4722
|
-
const t =
|
|
4723
|
-
popupRedirectResolver:
|
|
4721
|
+
const t = Di(n, {
|
|
4722
|
+
popupRedirectResolver: Zr,
|
|
4724
4723
|
persistence: [
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4724
|
+
ur,
|
|
4725
|
+
Qi,
|
|
4726
|
+
Zt
|
|
4728
4727
|
]
|
|
4729
|
-
}), i =
|
|
4728
|
+
}), i = bt("authTokenSyncURL");
|
|
4730
4729
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4731
4730
|
const s = new URL(i, location.origin);
|
|
4732
4731
|
if (location.origin === s.origin) {
|
|
4733
|
-
const o =
|
|
4734
|
-
|
|
4732
|
+
const o = ss(s.toString());
|
|
4733
|
+
Ki(t, o, () => o(t.currentUser)), qi(t, (c) => o(c));
|
|
4735
4734
|
}
|
|
4736
4735
|
}
|
|
4737
|
-
const r =
|
|
4738
|
-
return r &&
|
|
4736
|
+
const r = Pn("auth");
|
|
4737
|
+
return r && Fi(t, `http://${r}`), t;
|
|
4739
4738
|
}
|
|
4740
|
-
function
|
|
4739
|
+
function as() {
|
|
4741
4740
|
var n, e;
|
|
4742
4741
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
4743
4742
|
}
|
|
4744
|
-
|
|
4743
|
+
Oi({
|
|
4745
4744
|
loadJS(n) {
|
|
4746
4745
|
return new Promise((e, t) => {
|
|
4747
4746
|
const i = document.createElement("script");
|
|
4748
4747
|
i.setAttribute("src", n), i.onload = e, i.onerror = (r) => {
|
|
4749
|
-
const s =
|
|
4748
|
+
const s = E(
|
|
4750
4749
|
"internal-error"
|
|
4751
4750
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4752
4751
|
);
|
|
4753
4752
|
s.customData = r, t(s);
|
|
4754
|
-
}, i.type = "text/javascript", i.charset = "UTF-8",
|
|
4753
|
+
}, i.type = "text/javascript", i.charset = "UTF-8", as().appendChild(i);
|
|
4755
4754
|
});
|
|
4756
4755
|
},
|
|
4757
4756
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
4758
4757
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
4759
4758
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
4760
4759
|
});
|
|
4761
|
-
|
|
4760
|
+
ns(
|
|
4762
4761
|
"Browser"
|
|
4763
4762
|
/* ClientPlatform.BROWSER */
|
|
4764
4763
|
);
|
|
4765
|
-
var
|
|
4766
|
-
const
|
|
4764
|
+
var cs = { firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com", importFilesBucketUrl: "feedme-dev-4c3ef.appspot.com", clientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4" }, ls = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "feedmedev.vip", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc", voucherAppUrl: "https://voucher.feedmedev.cc/" };
|
|
4765
|
+
const us = {
|
|
4767
4766
|
key: 2,
|
|
4768
4767
|
class: "h-full w-full"
|
|
4769
|
-
},
|
|
4768
|
+
}, ds = ["src"], Ps = /* @__PURE__ */ xe({
|
|
4770
4769
|
__name: "App",
|
|
4771
4770
|
setup(n) {
|
|
4772
|
-
const e = ge(), t =
|
|
4773
|
-
|
|
4774
|
-
|
|
4771
|
+
const e = ge(), t = gn(), i = _n(), r = Tt(), s = vn(), o = In(), c = wt(), a = te(c.query.showHeader !== "false"), l = te(!1), { currentBusiness: d } = ge();
|
|
4772
|
+
ie(
|
|
4773
|
+
[
|
|
4774
|
+
() => {
|
|
4775
|
+
var h;
|
|
4776
|
+
return (h = d.value) == null ? void 0 : h._id;
|
|
4777
|
+
},
|
|
4778
|
+
() => e.currentCountry.value,
|
|
4779
|
+
() => {
|
|
4780
|
+
var h;
|
|
4781
|
+
return (h = e.sessionUser.value) == null ? void 0 : h.id;
|
|
4782
|
+
}
|
|
4783
|
+
],
|
|
4784
|
+
([h]) => {
|
|
4785
|
+
r.reset(), h && r.read(h);
|
|
4786
|
+
},
|
|
4787
|
+
{ immediate: !0, flush: "sync" }
|
|
4788
|
+
), dn(() => r.reset());
|
|
4789
|
+
const m = te(!1), v = Y(() => i.version), y = Y(() => {
|
|
4790
|
+
const h = e.currentCountry.value || "MY", g = tt.getIdToken(), b = d.value._id;
|
|
4791
|
+
return `${ls.marketingV1Portal}/b/${b}/marketing/overview?showHeader=false&country=${h}&token=${g}`;
|
|
4775
4792
|
});
|
|
4776
4793
|
async function f() {
|
|
4777
|
-
if (
|
|
4794
|
+
if (Un().length) {
|
|
4778
4795
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4779
4796
|
return;
|
|
4780
4797
|
}
|
|
4781
|
-
const
|
|
4782
|
-
await
|
|
4798
|
+
const h = Dn(cs.firebase), g = await mn.getCustomToken(), b = os();
|
|
4799
|
+
await zi(b, g), xn(h), console.log("initFirebase", h);
|
|
4783
4800
|
}
|
|
4784
|
-
const
|
|
4785
|
-
|
|
4801
|
+
const w = async () => {
|
|
4802
|
+
m.value = !1, await fn(), console.log("forceRerender"), tt.setBusinessId(d.value._id), await i.readPremium(), !l.value && v.value === "v2" ? e.registerSidebarComponent(Hn) : e.hideSidebarToggle(!0), await f(), l.value = !0, m.value = !0;
|
|
4786
4803
|
};
|
|
4787
|
-
return
|
|
4788
|
-
if (
|
|
4789
|
-
const
|
|
4790
|
-
|
|
4804
|
+
return hn(() => {
|
|
4805
|
+
if (Fn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(s, o), !a.value) {
|
|
4806
|
+
const h = document.getElementsByClassName("app-header")[0], g = document.getElementsByClassName("app-sidebar")[0], b = document.getElementsByClassName("app-container")[0], T = document.getElementsByTagName("main")[0];
|
|
4807
|
+
h == null || h.classList.add("!hidden"), g == null || g.classList.add("!pt-0"), b == null || b.classList.add("!pt-0"), T == null || T.classList.add("!pt-0"), e.hideSidebarToggle(!0);
|
|
4791
4808
|
}
|
|
4792
|
-
|
|
4793
|
-
}),
|
|
4809
|
+
d.value != null && (console.log("App mounted, forceRerender"), w());
|
|
4810
|
+
}), ie(
|
|
4794
4811
|
() => e.currentBusiness.value,
|
|
4795
|
-
async (
|
|
4796
|
-
console.log("Current business changed"),
|
|
4812
|
+
async (h, g) => {
|
|
4813
|
+
console.log("Current business changed"), h != null && h._id != g._id && (console.log("forceRerender when business changes", h, g), w());
|
|
4797
4814
|
}
|
|
4798
|
-
), (
|
|
4799
|
-
_(
|
|
4800
|
-
_(
|
|
4801
|
-
_(
|
|
4802
|
-
|
|
4815
|
+
), (h, g) => (W(), me(It, null, [
|
|
4816
|
+
_(m) && _(v) === "v2" ? (W(), Oe(_(pn), { key: 0 })) : Pe("", !0),
|
|
4817
|
+
_(m) && _(v) === "v2" && _(a) ? (W(), Oe(si, { key: 1 })) : Pe("", !0),
|
|
4818
|
+
_(m) && _(v) !== "v2" ? (W(), me("div", us, [
|
|
4819
|
+
R(kn, {
|
|
4803
4820
|
json: { url: _(y) }
|
|
4804
4821
|
}, null, 8, ["json"]),
|
|
4805
|
-
|
|
4822
|
+
I("iframe", {
|
|
4806
4823
|
allow: "clipboard-read; clipboard-write",
|
|
4807
4824
|
frameBorder: "0",
|
|
4808
4825
|
height: "100%",
|
|
4809
4826
|
width: "100%",
|
|
4810
4827
|
src: _(y)
|
|
4811
|
-
}, null, 8,
|
|
4828
|
+
}, null, 8, ds)
|
|
4812
4829
|
])) : Pe("", !0)
|
|
4813
4830
|
], 64));
|
|
4814
4831
|
}
|