@feedmepos/mf-connect 0.1.38-beta.93 → 0.1.38-beta.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Analytic-Bp5lZ6_k.js → Analytic-ClNBzH0-.js} +13 -13
- package/dist/{App-BcsVDglV.js → App-BYYCR70G.js} +592 -595
- package/dist/{AuditLogs-DfYOow1-.js → AuditLogs-Do1BqAh6.js} +9 -9
- package/dist/{Bin-DGnx5do-.js → Bin-RjB5lqOt.js} +8 -8
- package/dist/{Broadcast-ONqH0ihp.js → Broadcast-BH87IX67.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-4IWIDyDa.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B1SgkRkw.js} +6 -6
- package/dist/{Card-Bof-81z3.js → Card-CNe9XUHH.js} +18 -18
- package/dist/{Collections-C8j0wdWi.js → Collections-lSN93UK2.js} +7 -7
- package/dist/{Credit-B5Q7i1bF.js → Credit-BSUutjTN.js} +9 -9
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C6iL3X0L.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CPefl7VV.js} +33 -33
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Dqwhm19i.js → EffectSheet.vue_vue_type_style_index_0_lang-CzLMbYGB.js} +6 -6
- package/dist/{Experience-QdJZiW26.js → Experience-BSuperA9.js} +9 -9
- package/dist/{FileSaver.min-Cm3-a_Xp.js → FileSaver.min-CKVujfXA.js} +1 -1
- package/dist/{Game-D4kNxIJ3.js → Game-BoQT3LSd.js} +10 -10
- package/dist/{Grab-CT4CjIy7.js → Grab-n13T0fDp.js} +8 -8
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CBw_LLoE.js → ImageInput.vue_vue_type_script_setup_true_lang-BT3JooLp.js} +1 -1
- package/dist/{Index-BIoXrt4Z.js → Index-BPGZLNlz.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-D1LRQ8Si.js → LocationPicker.vue_vue_type_script_setup_true_lang-D2dEkZzA.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BrF5s682.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BiVIkK5g.js} +1 -1
- package/dist/{MainLayout-DcS1v4ak.js → MainLayout-BKiINcfj.js} +1 -1
- package/dist/{Marketing-DS3qPIwv.js → Marketing-oOyAG5nz.js} +6 -7
- package/dist/{MarketingMaterialEdit-C-0EWGx6.js → MarketingMaterialEdit-C3r4xZgn.js} +14 -15
- package/dist/{Member-BOJAFGPR.js → Member-CLZfAfxb.js} +11 -11
- package/dist/{MemberList-dUxFPHio.js → MemberList-CENSraOX.js} +26 -26
- package/dist/{MemberTransactions-ee61cNzV.js → MemberTransactions-C4m1Bcu1.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Du_KNDh5.js → MessageInput.vue_vue_type_script_setup_true_lang-Ee_1wJHS.js} +9 -9
- package/dist/{Mission-DMHYlnLY.js → Mission-mmhMMp1t.js} +10 -10
- package/dist/{Overview-BuVG9BS5.js → Overview-CrKRNsaV.js} +18 -18
- package/dist/{Point-BoJLHZxT.js → Point-QA8jBWSa.js} +9 -9
- package/dist/{Promotion-kSp4RRhf.js → Promotion-Co6zYVHq.js} +10 -10
- package/dist/{Queue-HhrSlM6I.js → Queue-D7Pkm_4s.js} +10 -10
- package/dist/{Record-BBcRpZjQ.js → Record-L5LLMZHt.js} +9 -9
- package/dist/{Review-DGaSCZt5.js → Review-ClpuFAlW.js} +4 -4
- package/dist/{ReviewFacebookCallback-DOs4zOmv.js → ReviewFacebookCallback-DnCmYy9S.js} +4 -4
- package/dist/{ReviewGoogleCallback-B3_gwwaW.js → ReviewGoogleCallback-D6lS5jn7.js} +4 -4
- package/dist/{Reward-DyF0j31a.js → Reward-BpgKE6dk.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CgIomdp9.js → RewardGroup.vue_vue_type_script_setup_true_lang-DUFAlWir.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DyrVgGng.js → RuleGroup.vue_vue_type_script_setup_true_lang-BkytXNO2.js} +14 -14
- package/dist/{Segment-BfndrU2a.js → Segment-COk0MJzr.js} +24 -24
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DQpvuEWU.js → SelectItems.vue_vue_type_script_setup_true_lang-CSXMhjst.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BhMoi_Zx.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CNOzJqXR.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Devv-WxE.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BXaH_Tt0.js} +4 -4
- package/dist/{Setting-BgonK8gD.js → Setting-DZXUWu6L.js} +14 -14
- package/dist/{SettingAdvertisements-CpqEJk2I.js → SettingAdvertisements-CzfTJ17s.js} +12 -12
- package/dist/{Store-7rJKpC2g.js → Store-B8L1EdOT.js} +21 -21
- package/dist/{StoreRewards-CJGNk7o_.js → StoreRewards-BpJbbbW5.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Cak7CK2J.js → StoreTransactions.vue_vue_type_script_setup_true_lang-OMYC8ljy.js} +21 -21
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BFQFyH4v.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BDNhBCJb.js} +2 -2
- package/dist/{Tier-CgYwJI81.js → Tier-D98VwNdC.js} +23 -23
- package/dist/{Title-CxF-Q_IK.js → Title-DEfQ7NMe.js} +20 -20
- package/dist/{Transaction-XQjlqfTl.js → Transaction-Bd4nS9Ai.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-gCOY_kWR.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BRTYTzNF.js} +6 -6
- package/dist/{Voucher-B0uyE_ib.js → Voucher-CxYWeWGh.js} +13 -13
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-B1RGI2yt.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BEUr2Qzn.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CkWV0YRp.js → ZodTextField.vue_vue_type_script_setup_true_lang-CoVkJ7jY.js} +2 -2
- package/dist/{app-DqD8T7pT.js → app-BNDMm2kI.js} +51 -51
- package/dist/app.js +1 -1
- package/dist/{business-D2i63v1o.js → business-DCYM-74Q.js} +1 -1
- package/dist/{campaign-477BLVNO.js → campaign-BiaIKz1Q.js} +8 -8
- package/dist/{campaign-Cd658ZBk.js → campaign-YBHBVUng.js} +1 -1
- package/dist/{campaign.enum-DhbnOswX.js → campaign.enum-CBPzeYMr.js} +1 -1
- package/dist/{campaign.fn-oZDvYDoz.js → campaign.fn-Cy_rArfJ.js} +31 -31
- package/dist/{collectible.enum-DqRJwhgd.js → collectible.enum-CeA4YQYM.js} +1 -1
- package/dist/{collection.fn-CkWOO6Ko.js → collection.fn-D45buMNb.js} +2 -2
- package/dist/{dto-sQEIYqth.js → dto-B62ATFpB.js} +4 -4
- package/dist/{duplicateCampaign-_mVQdGwr.js → duplicateCampaign-WImp_6Xs.js} +2 -2
- package/dist/{effect-CDMeVlJJ.js → effect-zMFtElAL.js} +1 -1
- package/dist/{email-addresses-63pX957h.js → email-addresses-D6P9xKPB.js} +2 -2
- package/dist/{export-g5eW1nVW.js → export-CRs_yVhl.js} +3 -3
- package/dist/{helper-VI1zfWX5.js → helper-RhWjQqTm.js} +1 -1
- package/dist/{index-C8fmWpi8.js → index-B7cTB-PJ.js} +3 -3
- package/dist/{index-hWJ0sSFq.js → index-C272QcbD.js} +3 -3
- package/dist/{index-DTG6Cagd.js → index-CgYajQbi.js} +1 -1
- package/dist/{index-CUAX3fnu.js → index-CvlwpTKX.js} +1 -1
- package/dist/{index-BX2JwxFq.js → index-Cy5MFD-0.js} +1 -1
- package/dist/{index-CDk6RSbU.js → index-D6uAAAq3.js} +1 -1
- package/dist/{index-BdMUYZ1O.js → index-DDMoQaSc.js} +1 -1
- package/dist/{index-CaOGrONe.js → index-DeBBhbzk.js} +1 -1
- package/dist/{index-B9s_JmUc.js → index-Dii-DHJ2.js} +4 -4
- package/dist/{index-nHmvttYn.js → index-h1TWWcPC.js} +3 -3
- package/dist/{index-h0AgtipV.js → index-iKdjWDgI.js} +6 -6
- package/dist/{index-DfZ8K-EG.js → index-n5n83HPj.js} +1 -1
- package/dist/{index-aA7p9Bmc.js → index-nPixknUi.js} +2 -2
- package/dist/{index.esm2017-eO62NEBZ.js → index.esm2017-BmcwXC9r.js} +1 -1
- package/dist/{loading-_DRkrv7E.js → loading-DerlV3vs.js} +1 -1
- package/dist/{lodash-LG6xh9-r.js → lodash-BISvQ6OQ.js} +1 -1
- package/dist/{membership-BCXBXaxY.js → membership-B8kRPYWq.js} +3 -3
- package/dist/{money-ByAGKe2o.js → money-DNQGbbvj.js} +1 -1
- package/dist/{number-B_EWaI4q.js → number-I5LWbf8Y.js} +1 -1
- package/dist/{objectid-Dp1jTW2U.js → objectid-p2vFUDoW.js} +5 -5
- package/dist/{plugins-D9hRNFW8.js → plugins-Bv7VdsSc.js} +3 -3
- package/dist/{reward-e1PDRY7T.js → reward-CB7aZjtn.js} +1 -1
- package/dist/{rule-i5gZCWWW.js → rule-DRcXbvy1.js} +3 -3
- package/dist/{rule-builder-CmMVweh6.js → rule-builder-BetO8JaI.js} +1 -1
- package/dist/style.css +1 -10
- package/dist/{template-B_QlVAfx.js → template-ltzns_fo.js} +6 -6
- package/dist/{timezone-9h5hj1Jv.js → timezone-BnsVYcxC.js} +2 -2
- package/dist/{trigger-CUQ4K6Sb.js → trigger-DR8YN2wo.js} +5 -5
- package/dist/useMarketingMaterialActions-3BXMnWw5.js +107 -0
- package/dist/{usePagination-C5orU_gW.js → usePagination-DHUS-0Vw.js} +1 -1
- package/dist/{user-D5Z7BEPt.js → user-BBZDjft2.js} +1 -1
- package/dist/{vue-i18n-CV6ud2LZ.js → vue-i18n-CCYEvHJA.js} +252 -252
- package/dist/{xlsx-BQkNr5NI.js → xlsx-qWbyVF7x.js} +1 -1
- package/dist/{zod-JMRyhOdG.js → zod-C5h1V9iY.js} +1 -1
- package/package.json +2 -2
- package/dist/remy-Qz_pNsUS.js +0 -13
- package/dist/useMarketingMaterialActions-g0y9u1Ez.js +0 -96
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRouter as sn, useRoute as
|
|
3
|
-
import { useCoreStore as
|
|
1
|
+
import { defineComponent as ht, ref as te, h as B, computed as Ee, watch as ft, resolveComponent as Zt, openBlock as ne, createElementBlock as ke, createVNode as pt, unref as v, createElementVNode as ie, toDisplayString as je, onMounted as en, Fragment as tn, createBlock as nn, createCommentVNode as Ge, nextTick as rn } from "vue";
|
|
2
|
+
import { useRouter as sn, useRoute as mt, RouterView as on } from "vue-router";
|
|
3
|
+
import { useCoreStore as be, FeedMeAuth as an } from "@feedmepos/mf-common";
|
|
4
4
|
import { u as cn } from "./app-wDQR6dpb.js";
|
|
5
|
-
import { u as ln } from "./business-
|
|
6
|
-
import "./index-
|
|
7
|
-
import { components as
|
|
8
|
-
import { u as hn } from "./vue-i18n-
|
|
9
|
-
import { C as
|
|
10
|
-
import { R as f } from "./app-
|
|
5
|
+
import { u as ln } from "./business-DCYM-74Q.js";
|
|
6
|
+
import "./index-DDMoQaSc.js";
|
|
7
|
+
import { components as z, useSnackbar as un, useDialog as dn } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as hn } from "./vue-i18n-CCYEvHJA.js";
|
|
9
|
+
import { C as Be, m as fn } from "./timezone-BnsVYcxC.js";
|
|
10
|
+
import { R as f } from "./app-BNDMm2kI.js";
|
|
11
11
|
import { J as pn } from "./JsonViewer-v8_C7l5N.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
import { S as Je, c as On } from "./index-aA7p9Bmc.js";
|
|
17
|
-
const Nn = { class: "flex flex-col h-full justify-between py-16" }, Ln = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary text-center" }, Mn = /* @__PURE__ */ ft({
|
|
12
|
+
import { r as Se, L as mn, g as gt, i as gn, a as _n, _ as ze, C as qe, b as vn, S as J, c as E, d as j, E as Ce, e as In, f as _t, h as Tn, j as yn, k as vt, l as _, m as wn, F as Oe, n as En, q as Y, o as kn, p as bn, s as Sn, t as Rn, u as An } from "./index.esm2017-BmcwXC9r.js";
|
|
13
|
+
import { _ as Ne } from "./tslib.es6-BCqqvLQ_.js";
|
|
14
|
+
import { S as Ke, c as Pn } from "./index-nPixknUi.js";
|
|
15
|
+
const Cn = { class: "flex flex-col h-full justify-between py-16" }, On = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary text-center" }, Nn = /* @__PURE__ */ ht({
|
|
18
16
|
__name: "NavigationTab",
|
|
19
17
|
setup(n) {
|
|
20
|
-
const { t: e } = hn(), t =
|
|
18
|
+
const { t: e } = hn(), t = te(), i = [
|
|
21
19
|
{
|
|
22
20
|
label: e("connect.navigation.analytic"),
|
|
23
21
|
value: f["$connect-ANALYTIC"]
|
|
@@ -63,7 +61,7 @@ const Nn = { class: "flex flex-col h-full justify-between py-16" }, Ln = { class
|
|
|
63
61
|
{
|
|
64
62
|
label: e("connect.navigation.point"),
|
|
65
63
|
value: f["$connect-PROGRAM_POINT"],
|
|
66
|
-
badge: () => z
|
|
64
|
+
badge: () => B(z.FmPill, { variant: "premium" })
|
|
67
65
|
},
|
|
68
66
|
{
|
|
69
67
|
label: e("connect.navigation.credit"),
|
|
@@ -72,7 +70,7 @@ const Nn = { class: "flex flex-col h-full justify-between py-16" }, Ln = { class
|
|
|
72
70
|
{
|
|
73
71
|
label: e("connect.navigation.game"),
|
|
74
72
|
value: f["$connect-PROGRAM_GAME"],
|
|
75
|
-
badge: () => z
|
|
73
|
+
badge: () => B(z.FmPill, { variant: "premium" })
|
|
76
74
|
},
|
|
77
75
|
{
|
|
78
76
|
label: "Mission",
|
|
@@ -91,19 +89,19 @@ const Nn = { class: "flex flex-col h-full justify-between py-16" }, Ln = { class
|
|
|
91
89
|
{
|
|
92
90
|
label: e("connect.navigation.segments"),
|
|
93
91
|
value: f["$connect-LOYALTY_SEGMENT"],
|
|
94
|
-
badge: () => z
|
|
92
|
+
badge: () => B(z.FmPill, { variant: "premium" })
|
|
95
93
|
},
|
|
96
94
|
{
|
|
97
95
|
label: e("connect.navigation.card"),
|
|
98
96
|
value: f["$connect-LOYALTY_CARD"],
|
|
99
|
-
badge: () => z
|
|
97
|
+
badge: () => B(z.FmPill, { variant: "premium" })
|
|
100
98
|
}
|
|
101
99
|
]
|
|
102
100
|
},
|
|
103
101
|
{
|
|
104
102
|
label: e("connect.navigation.referral"),
|
|
105
103
|
value: f["$connect-REFERRAL"],
|
|
106
|
-
badge: () => z
|
|
104
|
+
badge: () => B(z.FmPill, { variant: "premium" })
|
|
107
105
|
},
|
|
108
106
|
{
|
|
109
107
|
label: e("connect.navigation.store"),
|
|
@@ -133,11 +131,11 @@ const Nn = { class: "flex flex-col h-full justify-between py-16" }, Ln = { class
|
|
|
133
131
|
label: e("connect.navigation.bin"),
|
|
134
132
|
value: f["$connect-BIN"]
|
|
135
133
|
}
|
|
136
|
-
], r = sn(), s =
|
|
134
|
+
], r = sn(), s = mt(), o = i.reduce((d, h) => [...(h.children ?? []).map((p) => p.value), ...d, h.value], []), c = be(), a = Ee(() => {
|
|
137
135
|
const d = c.currentCountry.value || "MY";
|
|
138
|
-
return console.log(`[MF] Timezone set to: ${
|
|
136
|
+
return console.log(`[MF] Timezone set to: ${Be[d]}`), Be[d];
|
|
139
137
|
});
|
|
140
|
-
|
|
138
|
+
ft(
|
|
141
139
|
() => s,
|
|
142
140
|
(d) => {
|
|
143
141
|
const h = d.matched.map((p) => p.name).reverse();
|
|
@@ -145,28 +143,28 @@ const Nn = { class: "flex flex-col h-full justify-between py-16" }, Ln = { class
|
|
|
145
143
|
},
|
|
146
144
|
{ immediate: !0 }
|
|
147
145
|
);
|
|
148
|
-
async function
|
|
146
|
+
async function l(d) {
|
|
149
147
|
await r.push({ name: d });
|
|
150
148
|
}
|
|
151
149
|
return (d, h) => {
|
|
152
|
-
var
|
|
153
|
-
const p =
|
|
154
|
-
return
|
|
155
|
-
|
|
150
|
+
var w;
|
|
151
|
+
const p = Zt("FmCollapsibleTabs");
|
|
152
|
+
return ne(), ke("div", Cn, [
|
|
153
|
+
pt(p, {
|
|
156
154
|
class: "border-fm-color-neutral-gray-100 border-r px-4",
|
|
157
|
-
"model-value": (
|
|
155
|
+
"model-value": (w = v(t)) == null ? void 0 : w.toString(),
|
|
158
156
|
items: i,
|
|
159
|
-
"onUpdate:modelValue":
|
|
157
|
+
"onUpdate:modelValue": l
|
|
160
158
|
}, null, 8, ["model-value"]),
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
159
|
+
ie("div", On, [
|
|
160
|
+
ie("div", null, "Timezone: " + je(v(a).split("/")[1].replace("_", " ")), 1),
|
|
161
|
+
ie("div", null, "(UTC" + je(v(fn).tz(v(a)).format("Z")) + ")", 1)
|
|
164
162
|
])
|
|
165
163
|
]);
|
|
166
164
|
};
|
|
167
165
|
}
|
|
168
166
|
});
|
|
169
|
-
var
|
|
167
|
+
var Ln = "firebase", Mn = "10.12.4";
|
|
170
168
|
/**
|
|
171
169
|
* @license
|
|
172
170
|
* Copyright 2020 Google LLC
|
|
@@ -183,13 +181,13 @@ var Un = "firebase", Dn = "10.12.4";
|
|
|
183
181
|
* See the License for the specific language governing permissions and
|
|
184
182
|
* limitations under the License.
|
|
185
183
|
*/
|
|
186
|
-
|
|
187
|
-
function
|
|
184
|
+
Se(Ln, Mn, "app");
|
|
185
|
+
function It() {
|
|
188
186
|
return {
|
|
189
187
|
"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."
|
|
190
188
|
};
|
|
191
189
|
}
|
|
192
|
-
const
|
|
190
|
+
const Un = It, Tt = new Ce("auth", "Firebase", It());
|
|
193
191
|
/**
|
|
194
192
|
* @license
|
|
195
193
|
* Copyright 2020 Google LLC
|
|
@@ -206,12 +204,12 @@ const Fn = Tt, yt = new Oe("auth", "Firebase", Tt());
|
|
|
206
204
|
* See the License for the specific language governing permissions and
|
|
207
205
|
* limitations under the License.
|
|
208
206
|
*/
|
|
209
|
-
const
|
|
210
|
-
function
|
|
211
|
-
|
|
207
|
+
const ce = new mn("@firebase/auth");
|
|
208
|
+
function Dn(n, ...e) {
|
|
209
|
+
ce.logLevel <= vt.WARN && ce.warn(`Auth (${J}): ${n}`, ...e);
|
|
212
210
|
}
|
|
213
|
-
function
|
|
214
|
-
|
|
211
|
+
function re(n, ...e) {
|
|
212
|
+
ce.logLevel <= vt.ERROR && ce.error(`Auth (${J}): ${n}`, ...e);
|
|
215
213
|
}
|
|
216
214
|
/**
|
|
217
215
|
* @license
|
|
@@ -230,34 +228,34 @@ function se(n, ...e) {
|
|
|
230
228
|
* limitations under the License.
|
|
231
229
|
*/
|
|
232
230
|
function R(n, ...e) {
|
|
233
|
-
throw
|
|
231
|
+
throw Le(n, ...e);
|
|
234
232
|
}
|
|
235
|
-
function
|
|
236
|
-
return
|
|
233
|
+
function T(n, ...e) {
|
|
234
|
+
return Le(n, ...e);
|
|
237
235
|
}
|
|
238
|
-
function
|
|
239
|
-
const i = Object.assign(Object.assign({},
|
|
240
|
-
return new
|
|
236
|
+
function yt(n, e, t) {
|
|
237
|
+
const i = Object.assign(Object.assign({}, Un()), { [e]: t });
|
|
238
|
+
return new Ce("auth", "Firebase", i).create(e, {
|
|
241
239
|
appName: n.name
|
|
242
240
|
});
|
|
243
241
|
}
|
|
244
242
|
function M(n) {
|
|
245
|
-
return
|
|
243
|
+
return yt(n, "operation-not-supported-in-this-environment", "Operations that alter the current user are not supported in conjunction with FirebaseServerApp");
|
|
246
244
|
}
|
|
247
|
-
function
|
|
245
|
+
function Le(n, ...e) {
|
|
248
246
|
if (typeof n != "string") {
|
|
249
247
|
const t = e[0], i = [...e.slice(1)];
|
|
250
248
|
return i[0] && (i[0].appName = n.name), n._errorFactory.create(t, ...i);
|
|
251
249
|
}
|
|
252
|
-
return
|
|
250
|
+
return Tt.create(n, ...e);
|
|
253
251
|
}
|
|
254
|
-
function
|
|
252
|
+
function u(n, e, ...t) {
|
|
255
253
|
if (!n)
|
|
256
|
-
throw
|
|
254
|
+
throw Le(e, ...t);
|
|
257
255
|
}
|
|
258
256
|
function k(n) {
|
|
259
257
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
260
|
-
throw
|
|
258
|
+
throw re(e), new Error(e);
|
|
261
259
|
}
|
|
262
260
|
function A(n, e) {
|
|
263
261
|
n || k(e);
|
|
@@ -278,14 +276,14 @@ function A(n, e) {
|
|
|
278
276
|
* See the License for the specific language governing permissions and
|
|
279
277
|
* limitations under the License.
|
|
280
278
|
*/
|
|
281
|
-
function
|
|
279
|
+
function Re() {
|
|
282
280
|
var n;
|
|
283
281
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
284
282
|
}
|
|
285
|
-
function
|
|
286
|
-
return
|
|
283
|
+
function Fn() {
|
|
284
|
+
return Je() === "http:" || Je() === "https:";
|
|
287
285
|
}
|
|
288
|
-
function
|
|
286
|
+
function Je() {
|
|
289
287
|
var n;
|
|
290
288
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.protocol) || null;
|
|
291
289
|
}
|
|
@@ -305,15 +303,15 @@ function Ye() {
|
|
|
305
303
|
* See the License for the specific language governing permissions and
|
|
306
304
|
* limitations under the License.
|
|
307
305
|
*/
|
|
308
|
-
function
|
|
306
|
+
function xn() {
|
|
309
307
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
310
308
|
// This is especially true for Cordova apps which have unreliable
|
|
311
309
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
312
310
|
// installed which overwrites the native navigator.onLine value and
|
|
313
311
|
// defines navigator.connection.
|
|
314
|
-
(
|
|
312
|
+
(Fn() || vn() || "connection" in navigator) ? navigator.onLine : !0;
|
|
315
313
|
}
|
|
316
|
-
function
|
|
314
|
+
function Vn() {
|
|
317
315
|
if (typeof navigator > "u")
|
|
318
316
|
return null;
|
|
319
317
|
const n = navigator;
|
|
@@ -341,12 +339,12 @@ function Hn() {
|
|
|
341
339
|
* See the License for the specific language governing permissions and
|
|
342
340
|
* limitations under the License.
|
|
343
341
|
*/
|
|
344
|
-
class
|
|
342
|
+
class X {
|
|
345
343
|
constructor(e, t) {
|
|
346
|
-
this.shortDelay = e, this.longDelay = t, A(t > e, "Short delay should be less than long delay!"), this.isMobile =
|
|
344
|
+
this.shortDelay = e, this.longDelay = t, A(t > e, "Short delay should be less than long delay!"), this.isMobile = gn() || _n();
|
|
347
345
|
}
|
|
348
346
|
get() {
|
|
349
|
-
return
|
|
347
|
+
return xn() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
350
348
|
}
|
|
351
349
|
}
|
|
352
350
|
/**
|
|
@@ -365,7 +363,7 @@ class Z {
|
|
|
365
363
|
* See the License for the specific language governing permissions and
|
|
366
364
|
* limitations under the License.
|
|
367
365
|
*/
|
|
368
|
-
function
|
|
366
|
+
function Me(n, e) {
|
|
369
367
|
A(n.emulator, "Emulator should always be set here");
|
|
370
368
|
const { url: t } = n.emulator;
|
|
371
369
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
@@ -386,7 +384,7 @@ function Ue(n, e) {
|
|
|
386
384
|
* See the License for the specific language governing permissions and
|
|
387
385
|
* limitations under the License.
|
|
388
386
|
*/
|
|
389
|
-
class
|
|
387
|
+
class wt {
|
|
390
388
|
static initialize(e, t, i) {
|
|
391
389
|
this.fetchImpl = e, t && (this.headersImpl = t), i && (this.responseImpl = i);
|
|
392
390
|
}
|
|
@@ -440,7 +438,7 @@ class Et {
|
|
|
440
438
|
* See the License for the specific language governing permissions and
|
|
441
439
|
* limitations under the License.
|
|
442
440
|
*/
|
|
443
|
-
const
|
|
441
|
+
const $n = {
|
|
444
442
|
// Custom token errors.
|
|
445
443
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
446
444
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -531,93 +529,93 @@ const Wn = {
|
|
|
531
529
|
* See the License for the specific language governing permissions and
|
|
532
530
|
* limitations under the License.
|
|
533
531
|
*/
|
|
534
|
-
const
|
|
535
|
-
function
|
|
532
|
+
const Hn = new X(3e4, 6e4);
|
|
533
|
+
function fe(n, e) {
|
|
536
534
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
537
535
|
}
|
|
538
536
|
async function G(n, e, t, i, r = {}) {
|
|
539
|
-
return
|
|
537
|
+
return Et(n, r, async () => {
|
|
540
538
|
let s = {}, o = {};
|
|
541
539
|
i && (e === "GET" ? o = i : s = {
|
|
542
540
|
body: JSON.stringify(i)
|
|
543
541
|
});
|
|
544
|
-
const c =
|
|
542
|
+
const c = Y(Object.assign({ key: n.config.apiKey }, o)).slice(1), a = await n._getAdditionalHeaders();
|
|
545
543
|
return a[
|
|
546
544
|
"Content-Type"
|
|
547
545
|
/* HttpHeader.CONTENT_TYPE */
|
|
548
546
|
] = "application/json", n.languageCode && (a[
|
|
549
547
|
"X-Firebase-Locale"
|
|
550
548
|
/* HttpHeader.X_FIREBASE_LOCALE */
|
|
551
|
-
] = n.languageCode),
|
|
549
|
+
] = n.languageCode), wt.fetch()(bt(n, n.config.apiHost, t, c), Object.assign({
|
|
552
550
|
method: e,
|
|
553
551
|
headers: a,
|
|
554
552
|
referrerPolicy: "no-referrer"
|
|
555
553
|
}, s));
|
|
556
554
|
});
|
|
557
555
|
}
|
|
558
|
-
async function
|
|
556
|
+
async function Et(n, e, t) {
|
|
559
557
|
n._canInitEmulator = !1;
|
|
560
|
-
const i = Object.assign(Object.assign({},
|
|
558
|
+
const i = Object.assign(Object.assign({}, $n), e);
|
|
561
559
|
try {
|
|
562
|
-
const r = new
|
|
560
|
+
const r = new Wn(n), s = await Promise.race([
|
|
563
561
|
t(),
|
|
564
562
|
r.promise
|
|
565
563
|
]);
|
|
566
564
|
r.clearNetworkTimeout();
|
|
567
565
|
const o = await s.json();
|
|
568
566
|
if ("needConfirmation" in o)
|
|
569
|
-
throw
|
|
567
|
+
throw ee(n, "account-exists-with-different-credential", o);
|
|
570
568
|
if (s.ok && !("errorMessage" in o))
|
|
571
569
|
return o;
|
|
572
570
|
{
|
|
573
|
-
const c = s.ok ? o.errorMessage : o.error.message, [a,
|
|
571
|
+
const c = s.ok ? o.errorMessage : o.error.message, [a, l] = c.split(" : ");
|
|
574
572
|
if (a === "FEDERATED_USER_ID_ALREADY_LINKED")
|
|
575
|
-
throw
|
|
573
|
+
throw ee(n, "credential-already-in-use", o);
|
|
576
574
|
if (a === "EMAIL_EXISTS")
|
|
577
|
-
throw
|
|
575
|
+
throw ee(n, "email-already-in-use", o);
|
|
578
576
|
if (a === "USER_DISABLED")
|
|
579
|
-
throw
|
|
577
|
+
throw ee(n, "user-disabled", o);
|
|
580
578
|
const d = i[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
|
581
|
-
if (
|
|
582
|
-
throw
|
|
579
|
+
if (l)
|
|
580
|
+
throw yt(n, d, l);
|
|
583
581
|
R(n, d);
|
|
584
582
|
}
|
|
585
583
|
} catch (r) {
|
|
586
|
-
if (r instanceof
|
|
584
|
+
if (r instanceof Oe)
|
|
587
585
|
throw r;
|
|
588
586
|
R(n, "network-request-failed", { message: String(r) });
|
|
589
587
|
}
|
|
590
588
|
}
|
|
591
|
-
async function
|
|
589
|
+
async function kt(n, e, t, i, r = {}) {
|
|
592
590
|
const s = await G(n, e, t, i, r);
|
|
593
591
|
return "mfaPendingCredential" in s && R(n, "multi-factor-auth-required", {
|
|
594
592
|
_serverResponse: s
|
|
595
593
|
}), s;
|
|
596
594
|
}
|
|
597
|
-
function
|
|
595
|
+
function bt(n, e, t, i) {
|
|
598
596
|
const r = `${e}${t}?${i}`;
|
|
599
|
-
return n.config.emulator ?
|
|
597
|
+
return n.config.emulator ? Me(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
600
598
|
}
|
|
601
|
-
class
|
|
599
|
+
class Wn {
|
|
602
600
|
constructor(e) {
|
|
603
601
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
604
|
-
this.timer = setTimeout(() => i(
|
|
602
|
+
this.timer = setTimeout(() => i(T(
|
|
605
603
|
this.auth,
|
|
606
604
|
"network-request-failed"
|
|
607
605
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
608
|
-
)),
|
|
606
|
+
)), Hn.get());
|
|
609
607
|
});
|
|
610
608
|
}
|
|
611
609
|
clearNetworkTimeout() {
|
|
612
610
|
clearTimeout(this.timer);
|
|
613
611
|
}
|
|
614
612
|
}
|
|
615
|
-
function
|
|
613
|
+
function ee(n, e, t) {
|
|
616
614
|
const i = {
|
|
617
615
|
appName: n.name
|
|
618
616
|
};
|
|
619
617
|
t.email && (i.email = t.email), t.phoneNumber && (i.phoneNumber = t.phoneNumber);
|
|
620
|
-
const r =
|
|
618
|
+
const r = T(n, e, i);
|
|
621
619
|
return r.customData._tokenResponse = t, r;
|
|
622
620
|
}
|
|
623
621
|
/**
|
|
@@ -636,10 +634,10 @@ function ne(n, e, t) {
|
|
|
636
634
|
* See the License for the specific language governing permissions and
|
|
637
635
|
* limitations under the License.
|
|
638
636
|
*/
|
|
639
|
-
async function
|
|
637
|
+
async function jn(n, e) {
|
|
640
638
|
return G(n, "POST", "/v1/accounts:delete", e);
|
|
641
639
|
}
|
|
642
|
-
async function
|
|
640
|
+
async function St(n, e) {
|
|
643
641
|
return G(n, "POST", "/v1/accounts:lookup", e);
|
|
644
642
|
}
|
|
645
643
|
/**
|
|
@@ -658,7 +656,7 @@ async function Rt(n, e) {
|
|
|
658
656
|
* See the License for the specific language governing permissions and
|
|
659
657
|
* limitations under the License.
|
|
660
658
|
*/
|
|
661
|
-
function
|
|
659
|
+
function q(n) {
|
|
662
660
|
if (n)
|
|
663
661
|
try {
|
|
664
662
|
const e = new Date(Number(n));
|
|
@@ -667,9 +665,9 @@ function J(n) {
|
|
|
667
665
|
} catch {
|
|
668
666
|
}
|
|
669
667
|
}
|
|
670
|
-
async function
|
|
671
|
-
const t = j(n), i = await t.getIdToken(e), r =
|
|
672
|
-
|
|
668
|
+
async function Gn(n, e = !1) {
|
|
669
|
+
const t = j(n), i = await t.getIdToken(e), r = Ue(i);
|
|
670
|
+
u(
|
|
673
671
|
r && r.exp && r.auth_time && r.iat,
|
|
674
672
|
t.auth,
|
|
675
673
|
"internal-error"
|
|
@@ -679,38 +677,38 @@ async function zn(n, e = !1) {
|
|
|
679
677
|
return {
|
|
680
678
|
claims: r,
|
|
681
679
|
token: i,
|
|
682
|
-
authTime:
|
|
683
|
-
issuedAtTime:
|
|
684
|
-
expirationTime:
|
|
680
|
+
authTime: q(ye(r.auth_time)),
|
|
681
|
+
issuedAtTime: q(ye(r.iat)),
|
|
682
|
+
expirationTime: q(ye(r.exp)),
|
|
685
683
|
signInProvider: o || null,
|
|
686
684
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
|
687
685
|
};
|
|
688
686
|
}
|
|
689
|
-
function
|
|
687
|
+
function ye(n) {
|
|
690
688
|
return Number(n) * 1e3;
|
|
691
689
|
}
|
|
692
|
-
function
|
|
690
|
+
function Ue(n) {
|
|
693
691
|
const [e, t, i] = n.split(".");
|
|
694
692
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
695
|
-
return
|
|
693
|
+
return re("JWT malformed, contained fewer than 3 sections"), null;
|
|
696
694
|
try {
|
|
697
|
-
const r =
|
|
698
|
-
return r ? JSON.parse(r) : (
|
|
695
|
+
const r = En(t);
|
|
696
|
+
return r ? JSON.parse(r) : (re("Failed to decode base64 JWT payload"), null);
|
|
699
697
|
} catch (r) {
|
|
700
|
-
return
|
|
698
|
+
return re("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
701
699
|
}
|
|
702
700
|
}
|
|
703
|
-
function
|
|
704
|
-
const e =
|
|
705
|
-
return
|
|
701
|
+
function Ye(n) {
|
|
702
|
+
const e = Ue(n);
|
|
703
|
+
return u(
|
|
706
704
|
e,
|
|
707
705
|
"internal-error"
|
|
708
706
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
709
|
-
),
|
|
707
|
+
), u(
|
|
710
708
|
typeof e.exp < "u",
|
|
711
709
|
"internal-error"
|
|
712
710
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
713
|
-
),
|
|
711
|
+
), u(
|
|
714
712
|
typeof e.iat < "u",
|
|
715
713
|
"internal-error"
|
|
716
714
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -732,16 +730,16 @@ function Xe(n) {
|
|
|
732
730
|
* See the License for the specific language governing permissions and
|
|
733
731
|
* limitations under the License.
|
|
734
732
|
*/
|
|
735
|
-
async function
|
|
733
|
+
async function K(n, e, t = !1) {
|
|
736
734
|
if (t)
|
|
737
735
|
return e;
|
|
738
736
|
try {
|
|
739
737
|
return await e;
|
|
740
738
|
} catch (i) {
|
|
741
|
-
throw i instanceof
|
|
739
|
+
throw i instanceof Oe && Bn(i) && n.auth.currentUser === n && await n.auth.signOut(), i;
|
|
742
740
|
}
|
|
743
741
|
}
|
|
744
|
-
function
|
|
742
|
+
function Bn({ code: n }) {
|
|
745
743
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
746
744
|
}
|
|
747
745
|
/**
|
|
@@ -760,7 +758,7 @@ function qn({ code: n }) {
|
|
|
760
758
|
* See the License for the specific language governing permissions and
|
|
761
759
|
* limitations under the License.
|
|
762
760
|
*/
|
|
763
|
-
class
|
|
761
|
+
class zn {
|
|
764
762
|
constructor(e) {
|
|
765
763
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
766
764
|
}
|
|
@@ -822,12 +820,12 @@ class Kn {
|
|
|
822
820
|
* See the License for the specific language governing permissions and
|
|
823
821
|
* limitations under the License.
|
|
824
822
|
*/
|
|
825
|
-
class
|
|
823
|
+
class Ae {
|
|
826
824
|
constructor(e, t) {
|
|
827
825
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
828
826
|
}
|
|
829
827
|
_initializeTime() {
|
|
830
|
-
this.lastSignInTime =
|
|
828
|
+
this.lastSignInTime = q(this.lastLoginAt), this.creationTime = q(this.createdAt);
|
|
831
829
|
}
|
|
832
830
|
_copy(e) {
|
|
833
831
|
this.createdAt = e.createdAt, this.lastLoginAt = e.lastLoginAt, this._initializeTime();
|
|
@@ -855,10 +853,10 @@ class Pe {
|
|
|
855
853
|
* See the License for the specific language governing permissions and
|
|
856
854
|
* limitations under the License.
|
|
857
855
|
*/
|
|
858
|
-
async function
|
|
856
|
+
async function le(n) {
|
|
859
857
|
var e;
|
|
860
|
-
const t = n.auth, i = await n.getIdToken(), r = await
|
|
861
|
-
|
|
858
|
+
const t = n.auth, i = await n.getIdToken(), r = await K(n, St(t, { idToken: i }));
|
|
859
|
+
u(
|
|
862
860
|
r == null ? void 0 : r.users.length,
|
|
863
861
|
t,
|
|
864
862
|
"internal-error"
|
|
@@ -866,7 +864,7 @@ async function ue(n) {
|
|
|
866
864
|
);
|
|
867
865
|
const s = r.users[0];
|
|
868
866
|
n._notifyReloadListener(s);
|
|
869
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ?
|
|
867
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? Rt(s.providerUserInfo) : [], c = Kn(n.providerData, o), a = n.isAnonymous, l = !(n.email && s.passwordHash) && !(c != null && c.length), d = a ? l : !1, h = {
|
|
870
868
|
uid: s.localId,
|
|
871
869
|
displayName: s.displayName || null,
|
|
872
870
|
photoURL: s.photoUrl || null,
|
|
@@ -875,21 +873,21 @@ async function ue(n) {
|
|
|
875
873
|
phoneNumber: s.phoneNumber || null,
|
|
876
874
|
tenantId: s.tenantId || null,
|
|
877
875
|
providerData: c,
|
|
878
|
-
metadata: new
|
|
876
|
+
metadata: new Ae(s.createdAt, s.lastLoginAt),
|
|
879
877
|
isAnonymous: d
|
|
880
878
|
};
|
|
881
879
|
Object.assign(n, h);
|
|
882
880
|
}
|
|
883
|
-
async function
|
|
881
|
+
async function qn(n) {
|
|
884
882
|
const e = j(n);
|
|
885
|
-
await
|
|
883
|
+
await le(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
886
884
|
}
|
|
887
|
-
function
|
|
885
|
+
function Kn(n, e) {
|
|
888
886
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
889
887
|
}
|
|
890
|
-
function
|
|
888
|
+
function Rt(n) {
|
|
891
889
|
return n.map((e) => {
|
|
892
|
-
var { providerId: t } = e, i =
|
|
890
|
+
var { providerId: t } = e, i = Ne(e, ["providerId"]);
|
|
893
891
|
return {
|
|
894
892
|
providerId: t,
|
|
895
893
|
uid: i.rawId || "",
|
|
@@ -916,16 +914,16 @@ function At(n) {
|
|
|
916
914
|
* See the License for the specific language governing permissions and
|
|
917
915
|
* limitations under the License.
|
|
918
916
|
*/
|
|
919
|
-
async function
|
|
920
|
-
const t = await
|
|
921
|
-
const i =
|
|
917
|
+
async function Jn(n, e) {
|
|
918
|
+
const t = await Et(n, {}, async () => {
|
|
919
|
+
const i = Y({
|
|
922
920
|
grant_type: "refresh_token",
|
|
923
921
|
refresh_token: e
|
|
924
|
-
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o =
|
|
922
|
+
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o = bt(n, r, "/v1/token", `key=${s}`), c = await n._getAdditionalHeaders();
|
|
925
923
|
return c[
|
|
926
924
|
"Content-Type"
|
|
927
925
|
/* HttpHeader.CONTENT_TYPE */
|
|
928
|
-
] = "application/x-www-form-urlencoded",
|
|
926
|
+
] = "application/x-www-form-urlencoded", wt.fetch()(o, {
|
|
929
927
|
method: "POST",
|
|
930
928
|
headers: c,
|
|
931
929
|
body: i
|
|
@@ -937,8 +935,8 @@ async function Xn(n, e) {
|
|
|
937
935
|
refreshToken: t.refresh_token
|
|
938
936
|
};
|
|
939
937
|
}
|
|
940
|
-
async function
|
|
941
|
-
return G(n, "POST", "/v2/accounts:revokeToken",
|
|
938
|
+
async function Yn(n, e) {
|
|
939
|
+
return G(n, "POST", "/v2/accounts:revokeToken", fe(n, e));
|
|
942
940
|
}
|
|
943
941
|
/**
|
|
944
942
|
* @license
|
|
@@ -964,33 +962,33 @@ class $ {
|
|
|
964
962
|
return !this.expirationTime || Date.now() > this.expirationTime - 3e4;
|
|
965
963
|
}
|
|
966
964
|
updateFromServerResponse(e) {
|
|
967
|
-
|
|
965
|
+
u(
|
|
968
966
|
e.idToken,
|
|
969
967
|
"internal-error"
|
|
970
968
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
971
|
-
),
|
|
969
|
+
), u(
|
|
972
970
|
typeof e.idToken < "u",
|
|
973
971
|
"internal-error"
|
|
974
972
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
975
|
-
),
|
|
973
|
+
), u(
|
|
976
974
|
typeof e.refreshToken < "u",
|
|
977
975
|
"internal-error"
|
|
978
976
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
979
977
|
);
|
|
980
|
-
const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) :
|
|
978
|
+
const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) : Ye(e.idToken);
|
|
981
979
|
this.updateTokensAndExpiration(e.idToken, e.refreshToken, t);
|
|
982
980
|
}
|
|
983
981
|
updateFromIdToken(e) {
|
|
984
|
-
|
|
982
|
+
u(
|
|
985
983
|
e.length !== 0,
|
|
986
984
|
"internal-error"
|
|
987
985
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
988
986
|
);
|
|
989
|
-
const t =
|
|
987
|
+
const t = Ye(e);
|
|
990
988
|
this.updateTokensAndExpiration(e, null, t);
|
|
991
989
|
}
|
|
992
990
|
async getToken(e, t = !1) {
|
|
993
|
-
return !t && this.accessToken && !this.isExpired ? this.accessToken : (
|
|
991
|
+
return !t && this.accessToken && !this.isExpired ? this.accessToken : (u(
|
|
994
992
|
this.refreshToken,
|
|
995
993
|
e,
|
|
996
994
|
"user-token-expired"
|
|
@@ -1001,7 +999,7 @@ class $ {
|
|
|
1001
999
|
this.refreshToken = null;
|
|
1002
1000
|
}
|
|
1003
1001
|
async refresh(e, t) {
|
|
1004
|
-
const { accessToken: i, refreshToken: r, expiresIn: s } = await
|
|
1002
|
+
const { accessToken: i, refreshToken: r, expiresIn: s } = await Jn(e, t);
|
|
1005
1003
|
this.updateTokensAndExpiration(i, r, Number(s));
|
|
1006
1004
|
}
|
|
1007
1005
|
updateTokensAndExpiration(e, t, i) {
|
|
@@ -1009,11 +1007,11 @@ class $ {
|
|
|
1009
1007
|
}
|
|
1010
1008
|
static fromJSON(e, t) {
|
|
1011
1009
|
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new $();
|
|
1012
|
-
return i && (
|
|
1010
|
+
return i && (u(typeof i == "string", "internal-error", {
|
|
1013
1011
|
appName: e
|
|
1014
|
-
}), o.refreshToken = i), r && (
|
|
1012
|
+
}), o.refreshToken = i), r && (u(typeof r == "string", "internal-error", {
|
|
1015
1013
|
appName: e
|
|
1016
|
-
}), o.accessToken = r), s && (
|
|
1014
|
+
}), o.accessToken = r), s && (u(typeof s == "number", "internal-error", {
|
|
1017
1015
|
appName: e
|
|
1018
1016
|
}), o.expirationTime = s), o;
|
|
1019
1017
|
}
|
|
@@ -1051,16 +1049,16 @@ class $ {
|
|
|
1051
1049
|
* limitations under the License.
|
|
1052
1050
|
*/
|
|
1053
1051
|
function P(n, e) {
|
|
1054
|
-
|
|
1052
|
+
u(typeof n == "string" || typeof n > "u", "internal-error", { appName: e });
|
|
1055
1053
|
}
|
|
1056
1054
|
class b {
|
|
1057
1055
|
constructor(e) {
|
|
1058
|
-
var { uid: t, auth: i, stsTokenManager: r } = e, s =
|
|
1059
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
1056
|
+
var { uid: t, auth: i, stsTokenManager: r } = e, s = Ne(e, ["uid", "auth", "stsTokenManager"]);
|
|
1057
|
+
this.providerId = "firebase", this.proactiveRefresh = new zn(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 Ae(s.createdAt || void 0, s.lastLoginAt || void 0);
|
|
1060
1058
|
}
|
|
1061
1059
|
async getIdToken(e) {
|
|
1062
|
-
const t = await
|
|
1063
|
-
return
|
|
1060
|
+
const t = await K(this, this.stsTokenManager.getToken(this.auth, e));
|
|
1061
|
+
return u(
|
|
1064
1062
|
t,
|
|
1065
1063
|
this.auth,
|
|
1066
1064
|
"internal-error"
|
|
@@ -1068,13 +1066,13 @@ class b {
|
|
|
1068
1066
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
1069
1067
|
}
|
|
1070
1068
|
getIdTokenResult(e) {
|
|
1071
|
-
return
|
|
1069
|
+
return Gn(this, e);
|
|
1072
1070
|
}
|
|
1073
1071
|
reload() {
|
|
1074
|
-
return
|
|
1072
|
+
return qn(this);
|
|
1075
1073
|
}
|
|
1076
1074
|
_assign(e) {
|
|
1077
|
-
this !== e && (
|
|
1075
|
+
this !== e && (u(
|
|
1078
1076
|
this.uid === e.uid,
|
|
1079
1077
|
this.auth,
|
|
1080
1078
|
"internal-error"
|
|
@@ -1086,7 +1084,7 @@ class b {
|
|
|
1086
1084
|
return t.metadata._copy(this.metadata), t;
|
|
1087
1085
|
}
|
|
1088
1086
|
_onReload(e) {
|
|
1089
|
-
|
|
1087
|
+
u(
|
|
1090
1088
|
!this.reloadListener,
|
|
1091
1089
|
this.auth,
|
|
1092
1090
|
"internal-error"
|
|
@@ -1104,13 +1102,13 @@ class b {
|
|
|
1104
1102
|
}
|
|
1105
1103
|
async _updateTokensIfNecessary(e, t = !1) {
|
|
1106
1104
|
let i = !1;
|
|
1107
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await
|
|
1105
|
+
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await le(this), await this.auth._persistUserIfCurrent(this), i && this.auth._notifyListenersIfCurrent(this);
|
|
1108
1106
|
}
|
|
1109
1107
|
async delete() {
|
|
1110
1108
|
if (E(this.auth.app))
|
|
1111
1109
|
return Promise.reject(M(this.auth));
|
|
1112
1110
|
const e = await this.getIdToken();
|
|
1113
|
-
return await
|
|
1111
|
+
return await K(this, jn(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
1114
1112
|
}
|
|
1115
1113
|
toJSON() {
|
|
1116
1114
|
return Object.assign(Object.assign({
|
|
@@ -1137,46 +1135,46 @@ class b {
|
|
|
1137
1135
|
return this.stsTokenManager.refreshToken || "";
|
|
1138
1136
|
}
|
|
1139
1137
|
static _fromJSON(e, t) {
|
|
1140
|
-
var i, r, s, o, c, a,
|
|
1141
|
-
const h = (i = t.displayName) !== null && i !== void 0 ? i : void 0, p = (r = t.email) !== null && r !== void 0 ? r : void 0,
|
|
1142
|
-
|
|
1143
|
-
|
|
1138
|
+
var i, r, s, o, c, a, l, d;
|
|
1139
|
+
const h = (i = t.displayName) !== null && i !== void 0 ? i : void 0, p = (r = t.email) !== null && r !== void 0 ? r : void 0, w = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, U = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, m = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, g = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, I = (l = t.createdAt) !== null && l !== void 0 ? l : void 0, x = (d = t.lastLoginAt) !== null && d !== void 0 ? d : void 0, { uid: ve, emailVerified: $e, isAnonymous: He, providerData: Ie, stsTokenManager: We } = t;
|
|
1140
|
+
u(
|
|
1141
|
+
ve && We,
|
|
1144
1142
|
e,
|
|
1145
1143
|
"internal-error"
|
|
1146
1144
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1147
1145
|
);
|
|
1148
|
-
const
|
|
1149
|
-
|
|
1150
|
-
typeof
|
|
1146
|
+
const Xt = $.fromJSON(this.name, We);
|
|
1147
|
+
u(
|
|
1148
|
+
typeof ve == "string",
|
|
1151
1149
|
e,
|
|
1152
1150
|
"internal-error"
|
|
1153
1151
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1154
|
-
), P(h, e.name), P(p, e.name),
|
|
1155
|
-
typeof
|
|
1152
|
+
), P(h, e.name), P(p, e.name), u(
|
|
1153
|
+
typeof $e == "boolean",
|
|
1156
1154
|
e,
|
|
1157
1155
|
"internal-error"
|
|
1158
1156
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1159
|
-
),
|
|
1160
|
-
typeof
|
|
1157
|
+
), u(
|
|
1158
|
+
typeof He == "boolean",
|
|
1161
1159
|
e,
|
|
1162
1160
|
"internal-error"
|
|
1163
1161
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1164
|
-
), P(
|
|
1162
|
+
), P(w, e.name), P(U, e.name), P(m, e.name), P(g, e.name), P(I, e.name), P(x, e.name);
|
|
1165
1163
|
const Te = new b({
|
|
1166
|
-
uid:
|
|
1164
|
+
uid: ve,
|
|
1167
1165
|
auth: e,
|
|
1168
1166
|
email: p,
|
|
1169
|
-
emailVerified:
|
|
1167
|
+
emailVerified: $e,
|
|
1170
1168
|
displayName: h,
|
|
1171
|
-
isAnonymous:
|
|
1172
|
-
photoURL:
|
|
1173
|
-
phoneNumber:
|
|
1174
|
-
tenantId:
|
|
1175
|
-
stsTokenManager:
|
|
1176
|
-
createdAt:
|
|
1177
|
-
lastLoginAt:
|
|
1169
|
+
isAnonymous: He,
|
|
1170
|
+
photoURL: U,
|
|
1171
|
+
phoneNumber: w,
|
|
1172
|
+
tenantId: m,
|
|
1173
|
+
stsTokenManager: Xt,
|
|
1174
|
+
createdAt: I,
|
|
1175
|
+
lastLoginAt: x
|
|
1178
1176
|
});
|
|
1179
|
-
return Ie && Array.isArray(Ie) && (Te.providerData = Ie.map((
|
|
1177
|
+
return Ie && Array.isArray(Ie) && (Te.providerData = Ie.map((Qt) => Object.assign({}, Qt))), g && (Te._redirectEventId = g), Te;
|
|
1180
1178
|
}
|
|
1181
1179
|
/**
|
|
1182
1180
|
* Initialize a User from an idToken server response
|
|
@@ -1192,7 +1190,7 @@ class b {
|
|
|
1192
1190
|
stsTokenManager: r,
|
|
1193
1191
|
isAnonymous: i
|
|
1194
1192
|
});
|
|
1195
|
-
return await
|
|
1193
|
+
return await le(s), s;
|
|
1196
1194
|
}
|
|
1197
1195
|
/**
|
|
1198
1196
|
* Initialize a User from an idToken server response
|
|
@@ -1201,19 +1199,19 @@ class b {
|
|
|
1201
1199
|
*/
|
|
1202
1200
|
static async _fromGetAccountInfoResponse(e, t, i) {
|
|
1203
1201
|
const r = t.users[0];
|
|
1204
|
-
|
|
1202
|
+
u(
|
|
1205
1203
|
r.localId !== void 0,
|
|
1206
1204
|
"internal-error"
|
|
1207
1205
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1208
1206
|
);
|
|
1209
|
-
const s = r.providerUserInfo !== void 0 ?
|
|
1207
|
+
const s = r.providerUserInfo !== void 0 ? Rt(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new $();
|
|
1210
1208
|
c.updateFromIdToken(i);
|
|
1211
1209
|
const a = new b({
|
|
1212
1210
|
uid: r.localId,
|
|
1213
1211
|
auth: e,
|
|
1214
1212
|
stsTokenManager: c,
|
|
1215
1213
|
isAnonymous: o
|
|
1216
|
-
}),
|
|
1214
|
+
}), l = {
|
|
1217
1215
|
uid: r.localId,
|
|
1218
1216
|
displayName: r.displayName || null,
|
|
1219
1217
|
photoURL: r.photoUrl || null,
|
|
@@ -1222,10 +1220,10 @@ class b {
|
|
|
1222
1220
|
phoneNumber: r.phoneNumber || null,
|
|
1223
1221
|
tenantId: r.tenantId || null,
|
|
1224
1222
|
providerData: s,
|
|
1225
|
-
metadata: new
|
|
1223
|
+
metadata: new Ae(r.createdAt, r.lastLoginAt),
|
|
1226
1224
|
isAnonymous: !(r.email && r.passwordHash) && !(s != null && s.length)
|
|
1227
1225
|
};
|
|
1228
|
-
return Object.assign(a,
|
|
1226
|
+
return Object.assign(a, l), a;
|
|
1229
1227
|
}
|
|
1230
1228
|
}
|
|
1231
1229
|
/**
|
|
@@ -1244,11 +1242,11 @@ class b {
|
|
|
1244
1242
|
* See the License for the specific language governing permissions and
|
|
1245
1243
|
* limitations under the License.
|
|
1246
1244
|
*/
|
|
1247
|
-
const
|
|
1245
|
+
const Xe = /* @__PURE__ */ new Map();
|
|
1248
1246
|
function S(n) {
|
|
1249
1247
|
A(n instanceof Function, "Expected a class definition");
|
|
1250
|
-
let e =
|
|
1251
|
-
return e ? (A(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(),
|
|
1248
|
+
let e = Xe.get(n);
|
|
1249
|
+
return e ? (A(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), Xe.set(n, e), e);
|
|
1252
1250
|
}
|
|
1253
1251
|
/**
|
|
1254
1252
|
* @license
|
|
@@ -1266,7 +1264,7 @@ function S(n) {
|
|
|
1266
1264
|
* See the License for the specific language governing permissions and
|
|
1267
1265
|
* limitations under the License.
|
|
1268
1266
|
*/
|
|
1269
|
-
class
|
|
1267
|
+
class At {
|
|
1270
1268
|
constructor() {
|
|
1271
1269
|
this.type = "NONE", this.storage = {};
|
|
1272
1270
|
}
|
|
@@ -1288,8 +1286,8 @@ class Pt {
|
|
|
1288
1286
|
_removeListener(e, t) {
|
|
1289
1287
|
}
|
|
1290
1288
|
}
|
|
1291
|
-
|
|
1292
|
-
const
|
|
1289
|
+
At.type = "NONE";
|
|
1290
|
+
const Qe = At;
|
|
1293
1291
|
/**
|
|
1294
1292
|
* @license
|
|
1295
1293
|
* Copyright 2019 Google LLC
|
|
@@ -1306,14 +1304,14 @@ const Ze = Pt;
|
|
|
1306
1304
|
* See the License for the specific language governing permissions and
|
|
1307
1305
|
* limitations under the License.
|
|
1308
1306
|
*/
|
|
1309
|
-
function
|
|
1307
|
+
function se(n, e, t) {
|
|
1310
1308
|
return `firebase:${n}:${e}:${t}`;
|
|
1311
1309
|
}
|
|
1312
1310
|
class H {
|
|
1313
1311
|
constructor(e, t, i) {
|
|
1314
1312
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1315
1313
|
const { config: r, name: s } = this.auth;
|
|
1316
|
-
this.fullUserKey =
|
|
1314
|
+
this.fullUserKey = se(this.userKey, r.apiKey, s), this.fullPersistenceKey = se("persistence", r.apiKey, s), this.boundEventHandler = t._onStorageEvent.bind(t), this.persistence._addListener(this.fullUserKey, this.boundEventHandler);
|
|
1317
1315
|
}
|
|
1318
1316
|
setCurrentUser(e) {
|
|
1319
1317
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
|
@@ -1340,29 +1338,29 @@ class H {
|
|
|
1340
1338
|
}
|
|
1341
1339
|
static async create(e, t, i = "authUser") {
|
|
1342
1340
|
if (!t.length)
|
|
1343
|
-
return new H(S(
|
|
1344
|
-
const r = (await Promise.all(t.map(async (
|
|
1345
|
-
if (await
|
|
1346
|
-
return
|
|
1347
|
-
}))).filter((
|
|
1348
|
-
let s = r[0] || S(
|
|
1349
|
-
const o =
|
|
1341
|
+
return new H(S(Qe), e, i);
|
|
1342
|
+
const r = (await Promise.all(t.map(async (l) => {
|
|
1343
|
+
if (await l._isAvailable())
|
|
1344
|
+
return l;
|
|
1345
|
+
}))).filter((l) => l);
|
|
1346
|
+
let s = r[0] || S(Qe);
|
|
1347
|
+
const o = se(i, e.config.apiKey, e.name);
|
|
1350
1348
|
let c = null;
|
|
1351
|
-
for (const
|
|
1349
|
+
for (const l of t)
|
|
1352
1350
|
try {
|
|
1353
|
-
const d = await
|
|
1351
|
+
const d = await l._get(o);
|
|
1354
1352
|
if (d) {
|
|
1355
1353
|
const h = b._fromJSON(e, d);
|
|
1356
|
-
|
|
1354
|
+
l !== s && (c = h), s = l;
|
|
1357
1355
|
break;
|
|
1358
1356
|
}
|
|
1359
1357
|
} catch {
|
|
1360
1358
|
}
|
|
1361
|
-
const a = r.filter((
|
|
1362
|
-
return !s._shouldAllowMigration || !a.length ? new H(s, e, i) : (s = a[0], c && await s._set(o, c.toJSON()), await Promise.all(t.map(async (
|
|
1363
|
-
if (
|
|
1359
|
+
const a = r.filter((l) => l._shouldAllowMigration);
|
|
1360
|
+
return !s._shouldAllowMigration || !a.length ? new H(s, e, i) : (s = a[0], c && await s._set(o, c.toJSON()), await Promise.all(t.map(async (l) => {
|
|
1361
|
+
if (l !== s)
|
|
1364
1362
|
try {
|
|
1365
|
-
await
|
|
1363
|
+
await l._remove(o);
|
|
1366
1364
|
} catch {
|
|
1367
1365
|
}
|
|
1368
1366
|
})), new H(s, e, i));
|
|
@@ -1384,29 +1382,29 @@ class H {
|
|
|
1384
1382
|
* See the License for the specific language governing permissions and
|
|
1385
1383
|
* limitations under the License.
|
|
1386
1384
|
*/
|
|
1387
|
-
function
|
|
1385
|
+
function Ze(n) {
|
|
1388
1386
|
const e = n.toLowerCase();
|
|
1389
1387
|
if (e.includes("opera/") || e.includes("opr/") || e.includes("opios/"))
|
|
1390
1388
|
return "Opera";
|
|
1391
|
-
if (
|
|
1389
|
+
if (Ot(e))
|
|
1392
1390
|
return "IEMobile";
|
|
1393
1391
|
if (e.includes("msie") || e.includes("trident/"))
|
|
1394
1392
|
return "IE";
|
|
1395
1393
|
if (e.includes("edge/"))
|
|
1396
1394
|
return "Edge";
|
|
1397
|
-
if (
|
|
1395
|
+
if (Pt(e))
|
|
1398
1396
|
return "Firefox";
|
|
1399
1397
|
if (e.includes("silk/"))
|
|
1400
1398
|
return "Silk";
|
|
1401
|
-
if (
|
|
1399
|
+
if (Lt(e))
|
|
1402
1400
|
return "Blackberry";
|
|
1403
|
-
if (
|
|
1401
|
+
if (Mt(e))
|
|
1404
1402
|
return "Webos";
|
|
1405
|
-
if (
|
|
1403
|
+
if (De(e))
|
|
1406
1404
|
return "Safari";
|
|
1407
|
-
if ((e.includes("chrome/") ||
|
|
1405
|
+
if ((e.includes("chrome/") || Ct(e)) && !e.includes("edge/"))
|
|
1408
1406
|
return "Chrome";
|
|
1409
|
-
if (
|
|
1407
|
+
if (Nt(e))
|
|
1410
1408
|
return "Android";
|
|
1411
1409
|
{
|
|
1412
1410
|
const t = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/, i = n.match(t);
|
|
@@ -1415,42 +1413,42 @@ function et(n) {
|
|
|
1415
1413
|
}
|
|
1416
1414
|
return "Other";
|
|
1417
1415
|
}
|
|
1418
|
-
function
|
|
1416
|
+
function Pt(n = _()) {
|
|
1419
1417
|
return /firefox\//i.test(n);
|
|
1420
1418
|
}
|
|
1421
|
-
function
|
|
1419
|
+
function De(n = _()) {
|
|
1422
1420
|
const e = n.toLowerCase();
|
|
1423
1421
|
return e.includes("safari/") && !e.includes("chrome/") && !e.includes("crios/") && !e.includes("android");
|
|
1424
1422
|
}
|
|
1425
|
-
function
|
|
1423
|
+
function Ct(n = _()) {
|
|
1426
1424
|
return /crios\//i.test(n);
|
|
1427
1425
|
}
|
|
1428
|
-
function
|
|
1426
|
+
function Ot(n = _()) {
|
|
1429
1427
|
return /iemobile/i.test(n);
|
|
1430
1428
|
}
|
|
1431
|
-
function
|
|
1429
|
+
function Nt(n = _()) {
|
|
1432
1430
|
return /android/i.test(n);
|
|
1433
1431
|
}
|
|
1434
|
-
function
|
|
1432
|
+
function Lt(n = _()) {
|
|
1435
1433
|
return /blackberry/i.test(n);
|
|
1436
1434
|
}
|
|
1437
|
-
function
|
|
1435
|
+
function Mt(n = _()) {
|
|
1438
1436
|
return /webos/i.test(n);
|
|
1439
1437
|
}
|
|
1440
|
-
function
|
|
1438
|
+
function pe(n = _()) {
|
|
1441
1439
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1442
1440
|
}
|
|
1443
|
-
function
|
|
1441
|
+
function Xn(n = _()) {
|
|
1444
1442
|
var e;
|
|
1445
|
-
return
|
|
1443
|
+
return pe(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1446
1444
|
}
|
|
1447
|
-
function
|
|
1448
|
-
return
|
|
1445
|
+
function Qn() {
|
|
1446
|
+
return kn() && document.documentMode === 10;
|
|
1449
1447
|
}
|
|
1450
|
-
function
|
|
1451
|
-
return
|
|
1448
|
+
function Ut(n = _()) {
|
|
1449
|
+
return pe(n) || Nt(n) || Mt(n) || Lt(n) || /windows phone/i.test(n) || Ot(n);
|
|
1452
1450
|
}
|
|
1453
|
-
function
|
|
1451
|
+
function Zn() {
|
|
1454
1452
|
try {
|
|
1455
1453
|
return !!(window && window !== window.top);
|
|
1456
1454
|
} catch {
|
|
@@ -1473,20 +1471,20 @@ function ti() {
|
|
|
1473
1471
|
* See the License for the specific language governing permissions and
|
|
1474
1472
|
* limitations under the License.
|
|
1475
1473
|
*/
|
|
1476
|
-
function
|
|
1474
|
+
function Dt(n, e = []) {
|
|
1477
1475
|
let t;
|
|
1478
1476
|
switch (n) {
|
|
1479
1477
|
case "Browser":
|
|
1480
|
-
t =
|
|
1478
|
+
t = Ze(_());
|
|
1481
1479
|
break;
|
|
1482
1480
|
case "Worker":
|
|
1483
|
-
t = `${
|
|
1481
|
+
t = `${Ze(_())}-${n}`;
|
|
1484
1482
|
break;
|
|
1485
1483
|
default:
|
|
1486
1484
|
t = n;
|
|
1487
1485
|
}
|
|
1488
1486
|
const i = e.length ? e.join(",") : "FirebaseCore-web";
|
|
1489
|
-
return `${t}/JsCore/${
|
|
1487
|
+
return `${t}/JsCore/${J}/${i}`;
|
|
1490
1488
|
}
|
|
1491
1489
|
/**
|
|
1492
1490
|
* @license
|
|
@@ -1504,7 +1502,7 @@ function Ft(n, e = []) {
|
|
|
1504
1502
|
* See the License for the specific language governing permissions and
|
|
1505
1503
|
* limitations under the License.
|
|
1506
1504
|
*/
|
|
1507
|
-
class
|
|
1505
|
+
class ei {
|
|
1508
1506
|
constructor(e) {
|
|
1509
1507
|
this.auth = e, this.queue = [];
|
|
1510
1508
|
}
|
|
@@ -1559,8 +1557,8 @@ class ni {
|
|
|
1559
1557
|
* See the License for the specific language governing permissions and
|
|
1560
1558
|
* limitations under the License.
|
|
1561
1559
|
*/
|
|
1562
|
-
async function
|
|
1563
|
-
return G(n, "GET", "/v2/passwordPolicy",
|
|
1560
|
+
async function ti(n, e = {}) {
|
|
1561
|
+
return G(n, "GET", "/v2/passwordPolicy", fe(n, e));
|
|
1564
1562
|
}
|
|
1565
1563
|
/**
|
|
1566
1564
|
* @license
|
|
@@ -1578,12 +1576,12 @@ async function ii(n, e = {}) {
|
|
|
1578
1576
|
* See the License for the specific language governing permissions and
|
|
1579
1577
|
* limitations under the License.
|
|
1580
1578
|
*/
|
|
1581
|
-
const
|
|
1582
|
-
class
|
|
1579
|
+
const ni = 6;
|
|
1580
|
+
class ii {
|
|
1583
1581
|
constructor(e) {
|
|
1584
1582
|
var t, i, r, s;
|
|
1585
1583
|
const o = e.customStrengthOptions;
|
|
1586
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
|
1584
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : ni, 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;
|
|
1587
1585
|
}
|
|
1588
1586
|
validatePassword(e) {
|
|
1589
1587
|
var t, i, r, s, o, c;
|
|
@@ -1666,9 +1664,9 @@ class si {
|
|
|
1666
1664
|
* See the License for the specific language governing permissions and
|
|
1667
1665
|
* limitations under the License.
|
|
1668
1666
|
*/
|
|
1669
|
-
class
|
|
1667
|
+
class ri {
|
|
1670
1668
|
constructor(e, t, i, r) {
|
|
1671
|
-
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
|
|
1669
|
+
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 et(this), this.idTokenSubscription = new et(this), this.beforeStateQueue = new ei(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 = Tt, 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;
|
|
1672
1670
|
}
|
|
1673
1671
|
_initializeWithPersistence(e, t) {
|
|
1674
1672
|
return t && (this._popupRedirectResolver = S(t)), this._initializationPromise = this.queue(async () => {
|
|
@@ -1704,7 +1702,7 @@ class oi {
|
|
|
1704
1702
|
}
|
|
1705
1703
|
async initializeCurrentUserFromIdToken(e) {
|
|
1706
1704
|
try {
|
|
1707
|
-
const t = await
|
|
1705
|
+
const t = await St(this, { idToken: e }), i = await b._fromGetAccountInfoResponse(this, t, e);
|
|
1708
1706
|
await this.directlySetCurrentUser(i);
|
|
1709
1707
|
} catch (t) {
|
|
1710
1708
|
console.warn("FirebaseServerApp could not login user with provided authIdToken: ", t), await this.directlySetCurrentUser(null);
|
|
@@ -1736,7 +1734,7 @@ class oi {
|
|
|
1736
1734
|
}
|
|
1737
1735
|
return r ? this.reloadAndSetCurrentUserOrClear(r) : this.directlySetCurrentUser(null);
|
|
1738
1736
|
}
|
|
1739
|
-
return
|
|
1737
|
+
return u(
|
|
1740
1738
|
this._popupRedirectResolver,
|
|
1741
1739
|
this,
|
|
1742
1740
|
"argument-error"
|
|
@@ -1754,7 +1752,7 @@ class oi {
|
|
|
1754
1752
|
}
|
|
1755
1753
|
async reloadAndSetCurrentUserOrClear(e) {
|
|
1756
1754
|
try {
|
|
1757
|
-
await
|
|
1755
|
+
await le(e);
|
|
1758
1756
|
} catch (t) {
|
|
1759
1757
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
|
1760
1758
|
return this.directlySetCurrentUser(null);
|
|
@@ -1762,7 +1760,7 @@ class oi {
|
|
|
1762
1760
|
return this.directlySetCurrentUser(e);
|
|
1763
1761
|
}
|
|
1764
1762
|
useDeviceLanguage() {
|
|
1765
|
-
this.languageCode =
|
|
1763
|
+
this.languageCode = Vn();
|
|
1766
1764
|
}
|
|
1767
1765
|
async _delete() {
|
|
1768
1766
|
this._deleted = !0;
|
|
@@ -1771,7 +1769,7 @@ class oi {
|
|
|
1771
1769
|
if (E(this.app))
|
|
1772
1770
|
return Promise.reject(M(this));
|
|
1773
1771
|
const t = e ? j(e) : null;
|
|
1774
|
-
return t &&
|
|
1772
|
+
return t && u(
|
|
1775
1773
|
t.auth.config.apiKey === this.config.apiKey,
|
|
1776
1774
|
this,
|
|
1777
1775
|
"invalid-user-token"
|
|
@@ -1780,7 +1778,7 @@ class oi {
|
|
|
1780
1778
|
}
|
|
1781
1779
|
async _updateCurrentUser(e, t = !1) {
|
|
1782
1780
|
if (!this._deleted)
|
|
1783
|
-
return e &&
|
|
1781
|
+
return e && u(
|
|
1784
1782
|
this.tenantId === e.tenantId,
|
|
1785
1783
|
this,
|
|
1786
1784
|
"tenant-id-mismatch"
|
|
@@ -1813,14 +1811,14 @@ class oi {
|
|
|
1813
1811
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
1814
1812
|
}
|
|
1815
1813
|
async _updatePasswordPolicy() {
|
|
1816
|
-
const e = await
|
|
1814
|
+
const e = await ti(this), t = new ii(e);
|
|
1817
1815
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
1818
1816
|
}
|
|
1819
1817
|
_getPersistence() {
|
|
1820
1818
|
return this.assertedPersistence.persistence.type;
|
|
1821
1819
|
}
|
|
1822
1820
|
_updateErrorMap(e) {
|
|
1823
|
-
this._errorFactory = new
|
|
1821
|
+
this._errorFactory = new Ce("auth", "Firebase", e());
|
|
1824
1822
|
}
|
|
1825
1823
|
onAuthStateChanged(e, t, i) {
|
|
1826
1824
|
return this.registerStateListener(this.authStateSubscription, e, t, i);
|
|
@@ -1853,7 +1851,7 @@ class oi {
|
|
|
1853
1851
|
token: e,
|
|
1854
1852
|
idToken: t
|
|
1855
1853
|
};
|
|
1856
|
-
this.tenantId != null && (i.tenantId = this.tenantId), await
|
|
1854
|
+
this.tenantId != null && (i.tenantId = this.tenantId), await Yn(this, i);
|
|
1857
1855
|
}
|
|
1858
1856
|
}
|
|
1859
1857
|
toJSON() {
|
|
@@ -1872,7 +1870,7 @@ class oi {
|
|
|
1872
1870
|
async getOrInitRedirectPersistenceManager(e) {
|
|
1873
1871
|
if (!this.redirectPersistenceManager) {
|
|
1874
1872
|
const t = e && S(e) || this._popupRedirectResolver;
|
|
1875
|
-
|
|
1873
|
+
u(
|
|
1876
1874
|
t,
|
|
1877
1875
|
this,
|
|
1878
1876
|
"argument-error"
|
|
@@ -1927,7 +1925,7 @@ class oi {
|
|
|
1927
1925
|
const s = typeof t == "function" ? t : t.next.bind(t);
|
|
1928
1926
|
let o = !1;
|
|
1929
1927
|
const c = this._isInitialized ? Promise.resolve() : this._initializationPromise;
|
|
1930
|
-
if (
|
|
1928
|
+
if (u(
|
|
1931
1929
|
c,
|
|
1932
1930
|
this,
|
|
1933
1931
|
"internal-error"
|
|
@@ -1958,7 +1956,7 @@ class oi {
|
|
|
1958
1956
|
return this.operations = this.operations.then(e, e), this.operations;
|
|
1959
1957
|
}
|
|
1960
1958
|
get assertedPersistence() {
|
|
1961
|
-
return
|
|
1959
|
+
return u(
|
|
1962
1960
|
this.persistenceManager,
|
|
1963
1961
|
this,
|
|
1964
1962
|
"internal-error"
|
|
@@ -1966,7 +1964,7 @@ class oi {
|
|
|
1966
1964
|
), this.persistenceManager;
|
|
1967
1965
|
}
|
|
1968
1966
|
_logFramework(e) {
|
|
1969
|
-
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion =
|
|
1967
|
+
!e || this.frameworks.includes(e) || (this.frameworks.push(e), this.frameworks.sort(), this.clientVersion = Dt(this.config.clientPlatform, this._getFrameworks()));
|
|
1970
1968
|
}
|
|
1971
1969
|
_getFrameworks() {
|
|
1972
1970
|
return this.frameworks;
|
|
@@ -1996,18 +1994,18 @@ class oi {
|
|
|
1996
1994
|
async _getAppCheckToken() {
|
|
1997
1995
|
var e;
|
|
1998
1996
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
1999
|
-
return t != null && t.error &&
|
|
1997
|
+
return t != null && t.error && Dn(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
2000
1998
|
}
|
|
2001
1999
|
}
|
|
2002
|
-
function
|
|
2000
|
+
function me(n) {
|
|
2003
2001
|
return j(n);
|
|
2004
2002
|
}
|
|
2005
|
-
class
|
|
2003
|
+
class et {
|
|
2006
2004
|
constructor(e) {
|
|
2007
|
-
this.auth = e, this.observer = null, this.addObserver =
|
|
2005
|
+
this.auth = e, this.observer = null, this.addObserver = In((t) => this.observer = t);
|
|
2008
2006
|
}
|
|
2009
2007
|
get next() {
|
|
2010
|
-
return
|
|
2008
|
+
return u(
|
|
2011
2009
|
this.observer,
|
|
2012
2010
|
this.auth,
|
|
2013
2011
|
"internal-error"
|
|
@@ -2031,7 +2029,7 @@ class tt {
|
|
|
2031
2029
|
* See the License for the specific language governing permissions and
|
|
2032
2030
|
* limitations under the License.
|
|
2033
2031
|
*/
|
|
2034
|
-
let
|
|
2032
|
+
let Fe = {
|
|
2035
2033
|
async loadJS() {
|
|
2036
2034
|
throw new Error("Unable to load external scripts");
|
|
2037
2035
|
},
|
|
@@ -2039,16 +2037,16 @@ let xe = {
|
|
|
2039
2037
|
recaptchaEnterpriseScript: "",
|
|
2040
2038
|
gapiScript: ""
|
|
2041
2039
|
};
|
|
2042
|
-
function
|
|
2043
|
-
|
|
2040
|
+
function si(n) {
|
|
2041
|
+
Fe = n;
|
|
2044
2042
|
}
|
|
2045
|
-
function
|
|
2046
|
-
return
|
|
2043
|
+
function oi(n) {
|
|
2044
|
+
return Fe.loadJS(n);
|
|
2047
2045
|
}
|
|
2048
|
-
function
|
|
2049
|
-
return
|
|
2046
|
+
function ai() {
|
|
2047
|
+
return Fe.gapiScript;
|
|
2050
2048
|
}
|
|
2051
|
-
function
|
|
2049
|
+
function ci(n) {
|
|
2052
2050
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
2053
2051
|
}
|
|
2054
2052
|
/**
|
|
@@ -2067,11 +2065,11 @@ function ui(n) {
|
|
|
2067
2065
|
* See the License for the specific language governing permissions and
|
|
2068
2066
|
* limitations under the License.
|
|
2069
2067
|
*/
|
|
2070
|
-
function
|
|
2071
|
-
const t =
|
|
2068
|
+
function li(n, e) {
|
|
2069
|
+
const t = _t(n, "auth");
|
|
2072
2070
|
if (t.isInitialized()) {
|
|
2073
2071
|
const r = t.getImmediate(), s = t.getOptions();
|
|
2074
|
-
if (
|
|
2072
|
+
if (wn(s, e ?? {}))
|
|
2075
2073
|
return r;
|
|
2076
2074
|
R(
|
|
2077
2075
|
r,
|
|
@@ -2081,55 +2079,55 @@ function di(n, e) {
|
|
|
2081
2079
|
}
|
|
2082
2080
|
return t.initialize({ options: e });
|
|
2083
2081
|
}
|
|
2084
|
-
function
|
|
2082
|
+
function ui(n, e) {
|
|
2085
2083
|
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(S);
|
|
2086
2084
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2087
2085
|
}
|
|
2088
|
-
function
|
|
2089
|
-
const i =
|
|
2090
|
-
|
|
2086
|
+
function di(n, e, t) {
|
|
2087
|
+
const i = me(n);
|
|
2088
|
+
u(
|
|
2091
2089
|
i._canInitEmulator,
|
|
2092
2090
|
i,
|
|
2093
2091
|
"emulator-config-failed"
|
|
2094
2092
|
/* AuthErrorCode.EMULATOR_CONFIG_FAILED */
|
|
2095
|
-
),
|
|
2093
|
+
), u(
|
|
2096
2094
|
/^https?:\/\//.test(e),
|
|
2097
2095
|
i,
|
|
2098
2096
|
"invalid-emulator-scheme"
|
|
2099
2097
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
2100
2098
|
);
|
|
2101
|
-
const r = !1, s =
|
|
2099
|
+
const r = !1, s = Ft(e), { host: o, port: c } = hi(e), a = c === null ? "" : `:${c}`;
|
|
2102
2100
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
2103
2101
|
host: o,
|
|
2104
2102
|
port: c,
|
|
2105
2103
|
protocol: s.replace(":", ""),
|
|
2106
2104
|
options: Object.freeze({ disableWarnings: r })
|
|
2107
|
-
}),
|
|
2105
|
+
}), fi();
|
|
2108
2106
|
}
|
|
2109
|
-
function
|
|
2107
|
+
function Ft(n) {
|
|
2110
2108
|
const e = n.indexOf(":");
|
|
2111
2109
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
2112
2110
|
}
|
|
2113
|
-
function
|
|
2114
|
-
const e =
|
|
2111
|
+
function hi(n) {
|
|
2112
|
+
const e = Ft(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
2115
2113
|
if (!t)
|
|
2116
2114
|
return { host: "", port: null };
|
|
2117
2115
|
const i = t[2].split("@").pop() || "", r = /^(\[[^\]]+\])(:|$)/.exec(i);
|
|
2118
2116
|
if (r) {
|
|
2119
2117
|
const s = r[1];
|
|
2120
|
-
return { host: s, port:
|
|
2118
|
+
return { host: s, port: tt(i.substr(s.length + 1)) };
|
|
2121
2119
|
} else {
|
|
2122
2120
|
const [s, o] = i.split(":");
|
|
2123
|
-
return { host: s, port:
|
|
2121
|
+
return { host: s, port: tt(o) };
|
|
2124
2122
|
}
|
|
2125
2123
|
}
|
|
2126
|
-
function
|
|
2124
|
+
function tt(n) {
|
|
2127
2125
|
if (!n)
|
|
2128
2126
|
return null;
|
|
2129
2127
|
const e = Number(n);
|
|
2130
2128
|
return isNaN(e) ? null : e;
|
|
2131
2129
|
}
|
|
2132
|
-
function
|
|
2130
|
+
function fi() {
|
|
2133
2131
|
function n() {
|
|
2134
2132
|
const e = document.createElement("p"), t = e.style;
|
|
2135
2133
|
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);
|
|
@@ -2152,7 +2150,7 @@ function mi() {
|
|
|
2152
2150
|
* See the License for the specific language governing permissions and
|
|
2153
2151
|
* limitations under the License.
|
|
2154
2152
|
*/
|
|
2155
|
-
class
|
|
2153
|
+
class xt {
|
|
2156
2154
|
/** @internal */
|
|
2157
2155
|
constructor(e, t) {
|
|
2158
2156
|
this.providerId = e, this.signInMethod = t;
|
|
@@ -2195,7 +2193,7 @@ class Vt {
|
|
|
2195
2193
|
* limitations under the License.
|
|
2196
2194
|
*/
|
|
2197
2195
|
async function W(n, e) {
|
|
2198
|
-
return
|
|
2196
|
+
return kt(n, "POST", "/v1/accounts:signInWithIdp", fe(n, e));
|
|
2199
2197
|
}
|
|
2200
2198
|
/**
|
|
2201
2199
|
* @license
|
|
@@ -2213,8 +2211,8 @@ async function W(n, e) {
|
|
|
2213
2211
|
* See the License for the specific language governing permissions and
|
|
2214
2212
|
* limitations under the License.
|
|
2215
2213
|
*/
|
|
2216
|
-
const
|
|
2217
|
-
class D extends
|
|
2214
|
+
const pi = "http://localhost";
|
|
2215
|
+
class D extends xt {
|
|
2218
2216
|
constructor() {
|
|
2219
2217
|
super(...arguments), this.pendingToken = null;
|
|
2220
2218
|
}
|
|
@@ -2248,7 +2246,7 @@ class D extends Vt {
|
|
|
2248
2246
|
* @returns If the JSON input does not represent an {@link AuthCredential}, null is returned.
|
|
2249
2247
|
*/
|
|
2250
2248
|
static fromJSON(e) {
|
|
2251
|
-
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s =
|
|
2249
|
+
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = Ne(t, ["providerId", "signInMethod"]);
|
|
2252
2250
|
if (!i || !r)
|
|
2253
2251
|
return null;
|
|
2254
2252
|
const o = new D(i, r);
|
|
@@ -2271,14 +2269,14 @@ class D extends Vt {
|
|
|
2271
2269
|
}
|
|
2272
2270
|
buildRequest() {
|
|
2273
2271
|
const e = {
|
|
2274
|
-
requestUri:
|
|
2272
|
+
requestUri: pi,
|
|
2275
2273
|
returnSecureToken: !0
|
|
2276
2274
|
};
|
|
2277
2275
|
if (this.pendingToken)
|
|
2278
2276
|
e.pendingToken = this.pendingToken;
|
|
2279
2277
|
else {
|
|
2280
2278
|
const t = {};
|
|
2281
|
-
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 =
|
|
2279
|
+
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 = Y(t);
|
|
2282
2280
|
}
|
|
2283
2281
|
return e;
|
|
2284
2282
|
}
|
|
@@ -2299,7 +2297,7 @@ class D extends Vt {
|
|
|
2299
2297
|
* See the License for the specific language governing permissions and
|
|
2300
2298
|
* limitations under the License.
|
|
2301
2299
|
*/
|
|
2302
|
-
class
|
|
2300
|
+
class Vt {
|
|
2303
2301
|
/**
|
|
2304
2302
|
* Constructor for generic OAuth providers.
|
|
2305
2303
|
*
|
|
@@ -2352,7 +2350,7 @@ class $t {
|
|
|
2352
2350
|
* See the License for the specific language governing permissions and
|
|
2353
2351
|
* limitations under the License.
|
|
2354
2352
|
*/
|
|
2355
|
-
class
|
|
2353
|
+
class Q extends Vt {
|
|
2356
2354
|
constructor() {
|
|
2357
2355
|
super(...arguments), this.scopes = [];
|
|
2358
2356
|
}
|
|
@@ -2387,7 +2385,7 @@ class ee extends $t {
|
|
|
2387
2385
|
* See the License for the specific language governing permissions and
|
|
2388
2386
|
* limitations under the License.
|
|
2389
2387
|
*/
|
|
2390
|
-
class C extends
|
|
2388
|
+
class C extends Q {
|
|
2391
2389
|
constructor() {
|
|
2392
2390
|
super(
|
|
2393
2391
|
"facebook.com"
|
|
@@ -2458,7 +2456,7 @@ C.PROVIDER_ID = "facebook.com";
|
|
|
2458
2456
|
* See the License for the specific language governing permissions and
|
|
2459
2457
|
* limitations under the License.
|
|
2460
2458
|
*/
|
|
2461
|
-
class O extends
|
|
2459
|
+
class O extends Q {
|
|
2462
2460
|
constructor() {
|
|
2463
2461
|
super(
|
|
2464
2462
|
"google.com"
|
|
@@ -2534,7 +2532,7 @@ O.PROVIDER_ID = "google.com";
|
|
|
2534
2532
|
* See the License for the specific language governing permissions and
|
|
2535
2533
|
* limitations under the License.
|
|
2536
2534
|
*/
|
|
2537
|
-
class N extends
|
|
2535
|
+
class N extends Q {
|
|
2538
2536
|
constructor() {
|
|
2539
2537
|
super(
|
|
2540
2538
|
"github.com"
|
|
@@ -2598,7 +2596,7 @@ N.PROVIDER_ID = "github.com";
|
|
|
2598
2596
|
* See the License for the specific language governing permissions and
|
|
2599
2597
|
* limitations under the License.
|
|
2600
2598
|
*/
|
|
2601
|
-
class L extends
|
|
2599
|
+
class L extends Q {
|
|
2602
2600
|
constructor() {
|
|
2603
2601
|
super(
|
|
2604
2602
|
"twitter.com"
|
|
@@ -2672,7 +2670,7 @@ class F {
|
|
|
2672
2670
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2673
2671
|
}
|
|
2674
2672
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2675
|
-
const s = await b._fromIdTokenResponse(e, i, r), o =
|
|
2673
|
+
const s = await b._fromIdTokenResponse(e, i, r), o = nt(i);
|
|
2676
2674
|
return new F({
|
|
2677
2675
|
user: s,
|
|
2678
2676
|
providerId: o,
|
|
@@ -2686,7 +2684,7 @@ class F {
|
|
|
2686
2684
|
/* reload */
|
|
2687
2685
|
!0
|
|
2688
2686
|
);
|
|
2689
|
-
const r =
|
|
2687
|
+
const r = nt(i);
|
|
2690
2688
|
return new F({
|
|
2691
2689
|
user: e,
|
|
2692
2690
|
providerId: r,
|
|
@@ -2695,7 +2693,7 @@ class F {
|
|
|
2695
2693
|
});
|
|
2696
2694
|
}
|
|
2697
2695
|
}
|
|
2698
|
-
function
|
|
2696
|
+
function nt(n) {
|
|
2699
2697
|
return n.providerId ? n.providerId : "phoneNumber" in n ? "phone" : null;
|
|
2700
2698
|
}
|
|
2701
2699
|
/**
|
|
@@ -2714,10 +2712,10 @@ function it(n) {
|
|
|
2714
2712
|
* See the License for the specific language governing permissions and
|
|
2715
2713
|
* limitations under the License.
|
|
2716
2714
|
*/
|
|
2717
|
-
class
|
|
2715
|
+
class ue extends Oe {
|
|
2718
2716
|
constructor(e, t, i, r) {
|
|
2719
2717
|
var s;
|
|
2720
|
-
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this,
|
|
2718
|
+
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this, ue.prototype), this.customData = {
|
|
2721
2719
|
appName: e.name,
|
|
2722
2720
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
|
2723
2721
|
_serverResponse: t.customData._serverResponse,
|
|
@@ -2725,16 +2723,16 @@ class de extends Ne {
|
|
|
2725
2723
|
};
|
|
2726
2724
|
}
|
|
2727
2725
|
static _fromErrorAndOperation(e, t, i, r) {
|
|
2728
|
-
return new
|
|
2726
|
+
return new ue(e, t, i, r);
|
|
2729
2727
|
}
|
|
2730
2728
|
}
|
|
2731
|
-
function
|
|
2729
|
+
function $t(n, e, t, i) {
|
|
2732
2730
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2733
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
|
2731
|
+
throw s.code === "auth/multi-factor-auth-required" ? ue._fromErrorAndOperation(n, s, e, i) : s;
|
|
2734
2732
|
});
|
|
2735
2733
|
}
|
|
2736
|
-
async function
|
|
2737
|
-
const i = await
|
|
2734
|
+
async function mi(n, e, t = !1) {
|
|
2735
|
+
const i = await K(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2738
2736
|
return F._forOperation(n, "link", i);
|
|
2739
2737
|
}
|
|
2740
2738
|
/**
|
|
@@ -2753,28 +2751,28 @@ async function _i(n, e, t = !1) {
|
|
|
2753
2751
|
* See the License for the specific language governing permissions and
|
|
2754
2752
|
* limitations under the License.
|
|
2755
2753
|
*/
|
|
2756
|
-
async function
|
|
2754
|
+
async function gi(n, e, t = !1) {
|
|
2757
2755
|
const { auth: i } = n;
|
|
2758
2756
|
if (E(i.app))
|
|
2759
2757
|
return Promise.reject(M(i));
|
|
2760
2758
|
const r = "reauthenticate";
|
|
2761
2759
|
try {
|
|
2762
|
-
const s = await
|
|
2763
|
-
|
|
2760
|
+
const s = await K(n, $t(i, r, e, n), t);
|
|
2761
|
+
u(
|
|
2764
2762
|
s.idToken,
|
|
2765
2763
|
i,
|
|
2766
2764
|
"internal-error"
|
|
2767
2765
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
2768
2766
|
);
|
|
2769
|
-
const o =
|
|
2770
|
-
|
|
2767
|
+
const o = Ue(s.idToken);
|
|
2768
|
+
u(
|
|
2771
2769
|
o,
|
|
2772
2770
|
i,
|
|
2773
2771
|
"internal-error"
|
|
2774
2772
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
2775
2773
|
);
|
|
2776
2774
|
const { sub: c } = o;
|
|
2777
|
-
return
|
|
2775
|
+
return u(
|
|
2778
2776
|
n.uid === c,
|
|
2779
2777
|
i,
|
|
2780
2778
|
"user-mismatch"
|
|
@@ -2804,10 +2802,10 @@ async function vi(n, e, t = !1) {
|
|
|
2804
2802
|
* See the License for the specific language governing permissions and
|
|
2805
2803
|
* limitations under the License.
|
|
2806
2804
|
*/
|
|
2807
|
-
async function
|
|
2805
|
+
async function _i(n, e, t = !1) {
|
|
2808
2806
|
if (E(n.app))
|
|
2809
2807
|
return Promise.reject(M(n));
|
|
2810
|
-
const i = "signIn", r = await
|
|
2808
|
+
const i = "signIn", r = await $t(n, i, e), s = await F._fromIdTokenResponse(n, i, r);
|
|
2811
2809
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2812
2810
|
}
|
|
2813
2811
|
/**
|
|
@@ -2826,8 +2824,8 @@ async function Ii(n, e, t = !1) {
|
|
|
2826
2824
|
* See the License for the specific language governing permissions and
|
|
2827
2825
|
* limitations under the License.
|
|
2828
2826
|
*/
|
|
2829
|
-
async function
|
|
2830
|
-
return
|
|
2827
|
+
async function vi(n, e) {
|
|
2828
|
+
return kt(n, "POST", "/v1/accounts:signInWithCustomToken", fe(n, e));
|
|
2831
2829
|
}
|
|
2832
2830
|
/**
|
|
2833
2831
|
* @license
|
|
@@ -2845,22 +2843,22 @@ async function Ti(n, e) {
|
|
|
2845
2843
|
* See the License for the specific language governing permissions and
|
|
2846
2844
|
* limitations under the License.
|
|
2847
2845
|
*/
|
|
2848
|
-
async function
|
|
2846
|
+
async function Ii(n, e) {
|
|
2849
2847
|
if (E(n.app))
|
|
2850
2848
|
return Promise.reject(M(n));
|
|
2851
|
-
const t =
|
|
2849
|
+
const t = me(n), i = await vi(t, {
|
|
2852
2850
|
token: e,
|
|
2853
2851
|
returnSecureToken: !0
|
|
2854
2852
|
}), r = await F._fromIdTokenResponse(t, "signIn", i);
|
|
2855
2853
|
return await t._updateCurrentUser(r.user), r;
|
|
2856
2854
|
}
|
|
2857
|
-
function
|
|
2855
|
+
function Ti(n, e, t, i) {
|
|
2858
2856
|
return j(n).onIdTokenChanged(e, t, i);
|
|
2859
2857
|
}
|
|
2860
|
-
function
|
|
2858
|
+
function yi(n, e, t) {
|
|
2861
2859
|
return j(n).beforeAuthStateChanged(e, t);
|
|
2862
2860
|
}
|
|
2863
|
-
const
|
|
2861
|
+
const de = "__sak";
|
|
2864
2862
|
/**
|
|
2865
2863
|
* @license
|
|
2866
2864
|
* Copyright 2019 Google LLC
|
|
@@ -2877,13 +2875,13 @@ const he = "__sak";
|
|
|
2877
2875
|
* See the License for the specific language governing permissions and
|
|
2878
2876
|
* limitations under the License.
|
|
2879
2877
|
*/
|
|
2880
|
-
class
|
|
2878
|
+
class Ht {
|
|
2881
2879
|
constructor(e, t) {
|
|
2882
2880
|
this.storageRetriever = e, this.type = t;
|
|
2883
2881
|
}
|
|
2884
2882
|
_isAvailable() {
|
|
2885
2883
|
try {
|
|
2886
|
-
return this.storage ? (this.storage.setItem(
|
|
2884
|
+
return this.storage ? (this.storage.setItem(de, "1"), this.storage.removeItem(de), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
2887
2885
|
} catch {
|
|
2888
2886
|
return Promise.resolve(!1);
|
|
2889
2887
|
}
|
|
@@ -2918,18 +2916,18 @@ class Wt {
|
|
|
2918
2916
|
* See the License for the specific language governing permissions and
|
|
2919
2917
|
* limitations under the License.
|
|
2920
2918
|
*/
|
|
2921
|
-
function
|
|
2919
|
+
function wi() {
|
|
2922
2920
|
const n = _();
|
|
2923
|
-
return
|
|
2921
|
+
return De(n) || pe(n);
|
|
2924
2922
|
}
|
|
2925
|
-
const
|
|
2926
|
-
class
|
|
2923
|
+
const Ei = 1e3, ki = 10;
|
|
2924
|
+
class Wt extends Ht {
|
|
2927
2925
|
constructor() {
|
|
2928
2926
|
super(
|
|
2929
2927
|
() => window.localStorage,
|
|
2930
2928
|
"LOCAL"
|
|
2931
2929
|
/* PersistenceType.LOCAL */
|
|
2932
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
|
2930
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = wi() && Zn(), this.fallbackToPolling = Ut(), this._shouldAllowMigration = !0;
|
|
2933
2931
|
}
|
|
2934
2932
|
forAllChangedKeys(e) {
|
|
2935
2933
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -2956,7 +2954,7 @@ class jt extends Wt {
|
|
|
2956
2954
|
const o = this.storage.getItem(i);
|
|
2957
2955
|
!t && this.localCache[i] === o || this.notifyListeners(i, o);
|
|
2958
2956
|
}, s = this.storage.getItem(i);
|
|
2959
|
-
|
|
2957
|
+
Qn() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(r, ki) : r();
|
|
2960
2958
|
}
|
|
2961
2959
|
notifyListeners(e, t) {
|
|
2962
2960
|
this.localCache[e] = t;
|
|
@@ -2978,7 +2976,7 @@ class jt extends Wt {
|
|
|
2978
2976
|
!0
|
|
2979
2977
|
);
|
|
2980
2978
|
});
|
|
2981
|
-
},
|
|
2979
|
+
}, Ei);
|
|
2982
2980
|
}
|
|
2983
2981
|
stopPolling() {
|
|
2984
2982
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3007,8 +3005,8 @@ class jt extends Wt {
|
|
|
3007
3005
|
await super._remove(e), delete this.localCache[e];
|
|
3008
3006
|
}
|
|
3009
3007
|
}
|
|
3010
|
-
|
|
3011
|
-
const
|
|
3008
|
+
Wt.type = "LOCAL";
|
|
3009
|
+
const bi = Wt;
|
|
3012
3010
|
/**
|
|
3013
3011
|
* @license
|
|
3014
3012
|
* Copyright 2020 Google LLC
|
|
@@ -3025,7 +3023,7 @@ const Ri = jt;
|
|
|
3025
3023
|
* See the License for the specific language governing permissions and
|
|
3026
3024
|
* limitations under the License.
|
|
3027
3025
|
*/
|
|
3028
|
-
class
|
|
3026
|
+
class jt extends Ht {
|
|
3029
3027
|
constructor() {
|
|
3030
3028
|
super(
|
|
3031
3029
|
() => window.sessionStorage,
|
|
@@ -3038,8 +3036,8 @@ class Gt extends Wt {
|
|
|
3038
3036
|
_removeListener(e, t) {
|
|
3039
3037
|
}
|
|
3040
3038
|
}
|
|
3041
|
-
|
|
3042
|
-
const
|
|
3039
|
+
jt.type = "SESSION";
|
|
3040
|
+
const Gt = jt;
|
|
3043
3041
|
/**
|
|
3044
3042
|
* @license
|
|
3045
3043
|
* Copyright 2019 Google LLC
|
|
@@ -3056,7 +3054,7 @@ const Bt = Gt;
|
|
|
3056
3054
|
* See the License for the specific language governing permissions and
|
|
3057
3055
|
* limitations under the License.
|
|
3058
3056
|
*/
|
|
3059
|
-
function
|
|
3057
|
+
function Si(n) {
|
|
3060
3058
|
return Promise.all(n.map(async (e) => {
|
|
3061
3059
|
try {
|
|
3062
3060
|
return {
|
|
@@ -3087,7 +3085,7 @@ function Ai(n) {
|
|
|
3087
3085
|
* See the License for the specific language governing permissions and
|
|
3088
3086
|
* limitations under the License.
|
|
3089
3087
|
*/
|
|
3090
|
-
class
|
|
3088
|
+
class ge {
|
|
3091
3089
|
constructor(e) {
|
|
3092
3090
|
this.eventTarget = e, this.handlersMap = {}, this.boundEventHandler = this.handleEvent.bind(this);
|
|
3093
3091
|
}
|
|
@@ -3101,7 +3099,7 @@ class _e {
|
|
|
3101
3099
|
const t = this.receivers.find((r) => r.isListeningto(e));
|
|
3102
3100
|
if (t)
|
|
3103
3101
|
return t;
|
|
3104
|
-
const i = new
|
|
3102
|
+
const i = new ge(e);
|
|
3105
3103
|
return this.receivers.push(i), i;
|
|
3106
3104
|
}
|
|
3107
3105
|
isListeningto(e) {
|
|
@@ -3126,7 +3124,7 @@ class _e {
|
|
|
3126
3124
|
eventId: i,
|
|
3127
3125
|
eventType: r
|
|
3128
3126
|
});
|
|
3129
|
-
const c = Array.from(o).map(async (
|
|
3127
|
+
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await Si(c);
|
|
3130
3128
|
t.ports[0].postMessage({
|
|
3131
3129
|
status: "done",
|
|
3132
3130
|
eventId: i,
|
|
@@ -3155,7 +3153,7 @@ class _e {
|
|
|
3155
3153
|
this.handlersMap[e] && t && this.handlersMap[e].delete(t), (!t || this.handlersMap[e].size === 0) && delete this.handlersMap[e], Object.keys(this.handlersMap).length === 0 && this.eventTarget.removeEventListener("message", this.boundEventHandler);
|
|
3156
3154
|
}
|
|
3157
3155
|
}
|
|
3158
|
-
|
|
3156
|
+
ge.receivers = [];
|
|
3159
3157
|
/**
|
|
3160
3158
|
* @license
|
|
3161
3159
|
* Copyright 2020 Google LLC
|
|
@@ -3172,7 +3170,7 @@ _e.receivers = [];
|
|
|
3172
3170
|
* See the License for the specific language governing permissions and
|
|
3173
3171
|
* limitations under the License.
|
|
3174
3172
|
*/
|
|
3175
|
-
function
|
|
3173
|
+
function xe(n = "", e = 10) {
|
|
3176
3174
|
let t = "";
|
|
3177
3175
|
for (let i = 0; i < e; i++)
|
|
3178
3176
|
t += Math.floor(Math.random() * 10);
|
|
@@ -3194,7 +3192,7 @@ function Ve(n = "", e = 10) {
|
|
|
3194
3192
|
* See the License for the specific language governing permissions and
|
|
3195
3193
|
* limitations under the License.
|
|
3196
3194
|
*/
|
|
3197
|
-
class
|
|
3195
|
+
class Ri {
|
|
3198
3196
|
constructor(e) {
|
|
3199
3197
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
3200
3198
|
}
|
|
@@ -3228,7 +3226,7 @@ class Pi {
|
|
|
3228
3226
|
);
|
|
3229
3227
|
let s, o;
|
|
3230
3228
|
return new Promise((c, a) => {
|
|
3231
|
-
const
|
|
3229
|
+
const l = xe("", 20);
|
|
3232
3230
|
r.port1.start();
|
|
3233
3231
|
const d = setTimeout(() => {
|
|
3234
3232
|
a(new Error(
|
|
@@ -3240,7 +3238,7 @@ class Pi {
|
|
|
3240
3238
|
messageChannel: r,
|
|
3241
3239
|
onMessage(h) {
|
|
3242
3240
|
const p = h;
|
|
3243
|
-
if (p.data.eventId ===
|
|
3241
|
+
if (p.data.eventId === l)
|
|
3244
3242
|
switch (p.data.status) {
|
|
3245
3243
|
case "ack":
|
|
3246
3244
|
clearTimeout(d), s = setTimeout(
|
|
@@ -3267,7 +3265,7 @@ class Pi {
|
|
|
3267
3265
|
}
|
|
3268
3266
|
}, this.handlers.add(o), r.port1.addEventListener("message", o.onMessage), this.target.postMessage({
|
|
3269
3267
|
eventType: e,
|
|
3270
|
-
eventId:
|
|
3268
|
+
eventId: l,
|
|
3271
3269
|
data: t
|
|
3272
3270
|
}, [r.port2]);
|
|
3273
3271
|
}).finally(() => {
|
|
@@ -3291,11 +3289,11 @@ class Pi {
|
|
|
3291
3289
|
* See the License for the specific language governing permissions and
|
|
3292
3290
|
* limitations under the License.
|
|
3293
3291
|
*/
|
|
3294
|
-
function
|
|
3292
|
+
function y() {
|
|
3295
3293
|
return window;
|
|
3296
3294
|
}
|
|
3297
|
-
function
|
|
3298
|
-
|
|
3295
|
+
function Ai(n) {
|
|
3296
|
+
y().location.href = n;
|
|
3299
3297
|
}
|
|
3300
3298
|
/**
|
|
3301
3299
|
* @license
|
|
@@ -3313,10 +3311,10 @@ function Ci(n) {
|
|
|
3313
3311
|
* See the License for the specific language governing permissions and
|
|
3314
3312
|
* limitations under the License.
|
|
3315
3313
|
*/
|
|
3316
|
-
function
|
|
3317
|
-
return typeof
|
|
3314
|
+
function Bt() {
|
|
3315
|
+
return typeof y().WorkerGlobalScope < "u" && typeof y().importScripts == "function";
|
|
3318
3316
|
}
|
|
3319
|
-
async function
|
|
3317
|
+
async function Pi() {
|
|
3320
3318
|
if (!(navigator != null && navigator.serviceWorker))
|
|
3321
3319
|
return null;
|
|
3322
3320
|
try {
|
|
@@ -3325,12 +3323,12 @@ async function Oi() {
|
|
|
3325
3323
|
return null;
|
|
3326
3324
|
}
|
|
3327
3325
|
}
|
|
3328
|
-
function
|
|
3326
|
+
function Ci() {
|
|
3329
3327
|
var n;
|
|
3330
3328
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3331
3329
|
}
|
|
3332
|
-
function
|
|
3333
|
-
return
|
|
3330
|
+
function Oi() {
|
|
3331
|
+
return Bt() ? self : null;
|
|
3334
3332
|
}
|
|
3335
3333
|
/**
|
|
3336
3334
|
* @license
|
|
@@ -3348,8 +3346,8 @@ function Li() {
|
|
|
3348
3346
|
* See the License for the specific language governing permissions and
|
|
3349
3347
|
* limitations under the License.
|
|
3350
3348
|
*/
|
|
3351
|
-
const
|
|
3352
|
-
class
|
|
3349
|
+
const zt = "firebaseLocalStorageDb", Ni = 1, he = "firebaseLocalStorage", qt = "fbase_key";
|
|
3350
|
+
class Z {
|
|
3353
3351
|
constructor(e) {
|
|
3354
3352
|
this.request = e;
|
|
3355
3353
|
}
|
|
@@ -3363,55 +3361,55 @@ class te {
|
|
|
3363
3361
|
});
|
|
3364
3362
|
}
|
|
3365
3363
|
}
|
|
3366
|
-
function
|
|
3367
|
-
return n.transaction([
|
|
3364
|
+
function _e(n, e) {
|
|
3365
|
+
return n.transaction([he], e ? "readwrite" : "readonly").objectStore(he);
|
|
3368
3366
|
}
|
|
3369
|
-
function
|
|
3370
|
-
const n = indexedDB.deleteDatabase(
|
|
3371
|
-
return new
|
|
3367
|
+
function Li() {
|
|
3368
|
+
const n = indexedDB.deleteDatabase(zt);
|
|
3369
|
+
return new Z(n).toPromise();
|
|
3372
3370
|
}
|
|
3373
|
-
function
|
|
3374
|
-
const n = indexedDB.open(
|
|
3371
|
+
function Pe() {
|
|
3372
|
+
const n = indexedDB.open(zt, Ni);
|
|
3375
3373
|
return new Promise((e, t) => {
|
|
3376
3374
|
n.addEventListener("error", () => {
|
|
3377
3375
|
t(n.error);
|
|
3378
3376
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3379
3377
|
const i = n.result;
|
|
3380
3378
|
try {
|
|
3381
|
-
i.createObjectStore(
|
|
3379
|
+
i.createObjectStore(he, { keyPath: qt });
|
|
3382
3380
|
} catch (r) {
|
|
3383
3381
|
t(r);
|
|
3384
3382
|
}
|
|
3385
3383
|
}), n.addEventListener("success", async () => {
|
|
3386
3384
|
const i = n.result;
|
|
3387
|
-
i.objectStoreNames.contains(
|
|
3385
|
+
i.objectStoreNames.contains(he) ? e(i) : (i.close(), await Li(), e(await Pe()));
|
|
3388
3386
|
});
|
|
3389
3387
|
});
|
|
3390
3388
|
}
|
|
3391
|
-
async function
|
|
3392
|
-
const i =
|
|
3393
|
-
[
|
|
3389
|
+
async function it(n, e, t) {
|
|
3390
|
+
const i = _e(n, !0).put({
|
|
3391
|
+
[qt]: e,
|
|
3394
3392
|
value: t
|
|
3395
3393
|
});
|
|
3396
|
-
return new
|
|
3394
|
+
return new Z(i).toPromise();
|
|
3397
3395
|
}
|
|
3398
|
-
async function
|
|
3399
|
-
const t =
|
|
3396
|
+
async function Mi(n, e) {
|
|
3397
|
+
const t = _e(n, !1).get(e), i = await new Z(t).toPromise();
|
|
3400
3398
|
return i === void 0 ? null : i.value;
|
|
3401
3399
|
}
|
|
3402
|
-
function
|
|
3403
|
-
const t =
|
|
3404
|
-
return new
|
|
3400
|
+
function rt(n, e) {
|
|
3401
|
+
const t = _e(n, !0).delete(e);
|
|
3402
|
+
return new Z(t).toPromise();
|
|
3405
3403
|
}
|
|
3406
|
-
const
|
|
3407
|
-
class
|
|
3404
|
+
const Ui = 800, Di = 3;
|
|
3405
|
+
class Kt {
|
|
3408
3406
|
constructor() {
|
|
3409
3407
|
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(() => {
|
|
3410
3408
|
}, () => {
|
|
3411
3409
|
});
|
|
3412
3410
|
}
|
|
3413
3411
|
async _openDb() {
|
|
3414
|
-
return this.db ? this.db : (this.db = await
|
|
3412
|
+
return this.db ? this.db : (this.db = await Pe(), this.db);
|
|
3415
3413
|
}
|
|
3416
3414
|
async _withRetries(e) {
|
|
3417
3415
|
let t = 0;
|
|
@@ -3420,7 +3418,7 @@ class Jt {
|
|
|
3420
3418
|
const i = await this._openDb();
|
|
3421
3419
|
return await e(i);
|
|
3422
3420
|
} catch (i) {
|
|
3423
|
-
if (t++ >
|
|
3421
|
+
if (t++ > Di)
|
|
3424
3422
|
throw i;
|
|
3425
3423
|
this.db && (this.db.close(), this.db = void 0);
|
|
3426
3424
|
}
|
|
@@ -3430,13 +3428,13 @@ class Jt {
|
|
|
3430
3428
|
* postMessage interface to send these events to the worker ourselves.
|
|
3431
3429
|
*/
|
|
3432
3430
|
async initializeServiceWorkerMessaging() {
|
|
3433
|
-
return
|
|
3431
|
+
return Bt() ? this.initializeReceiver() : this.initializeSender();
|
|
3434
3432
|
}
|
|
3435
3433
|
/**
|
|
3436
3434
|
* As the worker we should listen to events from the main window.
|
|
3437
3435
|
*/
|
|
3438
3436
|
async initializeReceiver() {
|
|
3439
|
-
this.receiver =
|
|
3437
|
+
this.receiver = ge._getInstance(Oi()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3440
3438
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3441
3439
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3442
3440
|
"keyChanged"
|
|
@@ -3452,9 +3450,9 @@ class Jt {
|
|
|
3452
3450
|
*/
|
|
3453
3451
|
async initializeSender() {
|
|
3454
3452
|
var e, t;
|
|
3455
|
-
if (this.activeServiceWorker = await
|
|
3453
|
+
if (this.activeServiceWorker = await Pi(), !this.activeServiceWorker)
|
|
3456
3454
|
return;
|
|
3457
|
-
this.sender = new
|
|
3455
|
+
this.sender = new Ri(this.activeServiceWorker);
|
|
3458
3456
|
const i = await this.sender._send(
|
|
3459
3457
|
"ping",
|
|
3460
3458
|
{},
|
|
@@ -3476,7 +3474,7 @@ class Jt {
|
|
|
3476
3474
|
* @param key - Storage key which changed.
|
|
3477
3475
|
*/
|
|
3478
3476
|
async notifyServiceWorker(e) {
|
|
3479
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
3477
|
+
if (!(!this.sender || !this.activeServiceWorker || Ci() !== this.activeServiceWorker))
|
|
3480
3478
|
try {
|
|
3481
3479
|
await this.sender._send(
|
|
3482
3480
|
"keyChanged",
|
|
@@ -3492,8 +3490,8 @@ class Jt {
|
|
|
3492
3490
|
try {
|
|
3493
3491
|
if (!indexedDB)
|
|
3494
3492
|
return !1;
|
|
3495
|
-
const e = await
|
|
3496
|
-
return await
|
|
3493
|
+
const e = await Pe();
|
|
3494
|
+
return await it(e, de, "1"), await rt(e, de), !0;
|
|
3497
3495
|
} catch {
|
|
3498
3496
|
}
|
|
3499
3497
|
return !1;
|
|
@@ -3507,19 +3505,19 @@ class Jt {
|
|
|
3507
3505
|
}
|
|
3508
3506
|
}
|
|
3509
3507
|
async _set(e, t) {
|
|
3510
|
-
return this._withPendingWrite(async () => (await this._withRetries((i) =>
|
|
3508
|
+
return this._withPendingWrite(async () => (await this._withRetries((i) => it(i, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
3511
3509
|
}
|
|
3512
3510
|
async _get(e) {
|
|
3513
|
-
const t = await this._withRetries((i) =>
|
|
3511
|
+
const t = await this._withRetries((i) => Mi(i, e));
|
|
3514
3512
|
return this.localCache[e] = t, t;
|
|
3515
3513
|
}
|
|
3516
3514
|
async _remove(e) {
|
|
3517
|
-
return this._withPendingWrite(async () => (await this._withRetries((t) =>
|
|
3515
|
+
return this._withPendingWrite(async () => (await this._withRetries((t) => rt(t, e)), delete this.localCache[e], this.notifyServiceWorker(e)));
|
|
3518
3516
|
}
|
|
3519
3517
|
async _poll() {
|
|
3520
3518
|
const e = await this._withRetries((r) => {
|
|
3521
|
-
const s =
|
|
3522
|
-
return new
|
|
3519
|
+
const s = _e(r, !1).getAll();
|
|
3520
|
+
return new Z(s).toPromise();
|
|
3523
3521
|
});
|
|
3524
3522
|
if (!e)
|
|
3525
3523
|
return [];
|
|
@@ -3541,7 +3539,7 @@ class Jt {
|
|
|
3541
3539
|
r(t);
|
|
3542
3540
|
}
|
|
3543
3541
|
startPolling() {
|
|
3544
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
3542
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), Ui);
|
|
3545
3543
|
}
|
|
3546
3544
|
stopPolling() {
|
|
3547
3545
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3553,9 +3551,9 @@ class Jt {
|
|
|
3553
3551
|
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();
|
|
3554
3552
|
}
|
|
3555
3553
|
}
|
|
3556
|
-
|
|
3557
|
-
const
|
|
3558
|
-
new
|
|
3554
|
+
Kt.type = "LOCAL";
|
|
3555
|
+
const Fi = Kt;
|
|
3556
|
+
new X(3e4, 6e4);
|
|
3559
3557
|
/**
|
|
3560
3558
|
* @license
|
|
3561
3559
|
* Copyright 2021 Google LLC
|
|
@@ -3572,8 +3570,8 @@ new Z(3e4, 6e4);
|
|
|
3572
3570
|
* See the License for the specific language governing permissions and
|
|
3573
3571
|
* limitations under the License.
|
|
3574
3572
|
*/
|
|
3575
|
-
function
|
|
3576
|
-
return e ? S(e) : (
|
|
3573
|
+
function xi(n, e) {
|
|
3574
|
+
return e ? S(e) : (u(
|
|
3577
3575
|
n._popupRedirectResolver,
|
|
3578
3576
|
n,
|
|
3579
3577
|
"argument-error"
|
|
@@ -3596,7 +3594,7 @@ function $i(n, e) {
|
|
|
3596
3594
|
* See the License for the specific language governing permissions and
|
|
3597
3595
|
* limitations under the License.
|
|
3598
3596
|
*/
|
|
3599
|
-
class
|
|
3597
|
+
class Ve extends xt {
|
|
3600
3598
|
constructor(e) {
|
|
3601
3599
|
super(
|
|
3602
3600
|
"custom",
|
|
@@ -3626,26 +3624,26 @@ class $e extends Vt {
|
|
|
3626
3624
|
return e && (t.idToken = e), t;
|
|
3627
3625
|
}
|
|
3628
3626
|
}
|
|
3629
|
-
function
|
|
3630
|
-
return
|
|
3627
|
+
function Vi(n) {
|
|
3628
|
+
return _i(n.auth, new Ve(n), n.bypassAuthState);
|
|
3631
3629
|
}
|
|
3632
|
-
function
|
|
3630
|
+
function $i(n) {
|
|
3633
3631
|
const { auth: e, user: t } = n;
|
|
3634
|
-
return
|
|
3632
|
+
return u(
|
|
3635
3633
|
t,
|
|
3636
3634
|
e,
|
|
3637
3635
|
"internal-error"
|
|
3638
3636
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3639
|
-
),
|
|
3637
|
+
), gi(t, new Ve(n), n.bypassAuthState);
|
|
3640
3638
|
}
|
|
3641
|
-
async function
|
|
3639
|
+
async function Hi(n) {
|
|
3642
3640
|
const { auth: e, user: t } = n;
|
|
3643
|
-
return
|
|
3641
|
+
return u(
|
|
3644
3642
|
t,
|
|
3645
3643
|
e,
|
|
3646
3644
|
"internal-error"
|
|
3647
3645
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3648
|
-
),
|
|
3646
|
+
), mi(t, new Ve(n), n.bypassAuthState);
|
|
3649
3647
|
}
|
|
3650
3648
|
/**
|
|
3651
3649
|
* @license
|
|
@@ -3663,7 +3661,7 @@ async function ji(n) {
|
|
|
3663
3661
|
* See the License for the specific language governing permissions and
|
|
3664
3662
|
* limitations under the License.
|
|
3665
3663
|
*/
|
|
3666
|
-
class
|
|
3664
|
+
class Jt {
|
|
3667
3665
|
constructor(e, t, i, r, s = !1) {
|
|
3668
3666
|
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];
|
|
3669
3667
|
}
|
|
@@ -3694,8 +3692,8 @@ class Yt {
|
|
|
3694
3692
|
};
|
|
3695
3693
|
try {
|
|
3696
3694
|
this.resolve(await this.getIdpTask(c)(a));
|
|
3697
|
-
} catch (
|
|
3698
|
-
this.reject(
|
|
3695
|
+
} catch (l) {
|
|
3696
|
+
this.reject(l);
|
|
3699
3697
|
}
|
|
3700
3698
|
}
|
|
3701
3699
|
onError(e) {
|
|
@@ -3705,13 +3703,13 @@ class Yt {
|
|
|
3705
3703
|
switch (e) {
|
|
3706
3704
|
case "signInViaPopup":
|
|
3707
3705
|
case "signInViaRedirect":
|
|
3708
|
-
return
|
|
3706
|
+
return Vi;
|
|
3709
3707
|
case "linkViaPopup":
|
|
3710
3708
|
case "linkViaRedirect":
|
|
3711
|
-
return
|
|
3709
|
+
return Hi;
|
|
3712
3710
|
case "reauthViaPopup":
|
|
3713
3711
|
case "reauthViaRedirect":
|
|
3714
|
-
return
|
|
3712
|
+
return $i;
|
|
3715
3713
|
default:
|
|
3716
3714
|
R(
|
|
3717
3715
|
this.auth,
|
|
@@ -3746,14 +3744,14 @@ class Yt {
|
|
|
3746
3744
|
* See the License for the specific language governing permissions and
|
|
3747
3745
|
* limitations under the License.
|
|
3748
3746
|
*/
|
|
3749
|
-
const
|
|
3750
|
-
class V extends
|
|
3747
|
+
const Wi = new X(2e3, 1e4);
|
|
3748
|
+
class V extends Jt {
|
|
3751
3749
|
constructor(e, t, i, r, s) {
|
|
3752
3750
|
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, V.currentPopupAction && V.currentPopupAction.cancel(), V.currentPopupAction = this;
|
|
3753
3751
|
}
|
|
3754
3752
|
async executeNotNull() {
|
|
3755
3753
|
const e = await this.execute();
|
|
3756
|
-
return
|
|
3754
|
+
return u(
|
|
3757
3755
|
e,
|
|
3758
3756
|
this.auth,
|
|
3759
3757
|
"internal-error"
|
|
@@ -3762,7 +3760,7 @@ class V extends Yt {
|
|
|
3762
3760
|
}
|
|
3763
3761
|
async onExecution() {
|
|
3764
3762
|
A(this.filter.length === 1, "Popup operations only handle one event");
|
|
3765
|
-
const e =
|
|
3763
|
+
const e = xe();
|
|
3766
3764
|
this.authWindow = await this.resolver._openPopup(
|
|
3767
3765
|
this.auth,
|
|
3768
3766
|
this.provider,
|
|
@@ -3772,7 +3770,7 @@ class V extends Yt {
|
|
|
3772
3770
|
), this.authWindow.associatedEvent = e, this.resolver._originValidation(this.auth).catch((t) => {
|
|
3773
3771
|
this.reject(t);
|
|
3774
3772
|
}), this.resolver._isIframeWebStorageSupported(this.auth, (t) => {
|
|
3775
|
-
t || this.reject(
|
|
3773
|
+
t || this.reject(T(
|
|
3776
3774
|
this.auth,
|
|
3777
3775
|
"web-storage-unsupported"
|
|
3778
3776
|
/* AuthErrorCode.WEB_STORAGE_UNSUPPORTED */
|
|
@@ -3784,7 +3782,7 @@ class V extends Yt {
|
|
|
3784
3782
|
return ((e = this.authWindow) === null || e === void 0 ? void 0 : e.associatedEvent) || null;
|
|
3785
3783
|
}
|
|
3786
3784
|
cancel() {
|
|
3787
|
-
this.reject(
|
|
3785
|
+
this.reject(T(
|
|
3788
3786
|
this.auth,
|
|
3789
3787
|
"cancelled-popup-request"
|
|
3790
3788
|
/* AuthErrorCode.EXPIRED_POPUP_REQUEST */
|
|
@@ -3799,7 +3797,7 @@ class V extends Yt {
|
|
|
3799
3797
|
if (!((i = (t = this.authWindow) === null || t === void 0 ? void 0 : t.window) === null || i === void 0) && i.closed) {
|
|
3800
3798
|
this.pollId = window.setTimeout(
|
|
3801
3799
|
() => {
|
|
3802
|
-
this.pollId = null, this.reject(
|
|
3800
|
+
this.pollId = null, this.reject(T(
|
|
3803
3801
|
this.auth,
|
|
3804
3802
|
"popup-closed-by-user"
|
|
3805
3803
|
/* AuthErrorCode.POPUP_CLOSED_BY_USER */
|
|
@@ -3810,7 +3808,7 @@ class V extends Yt {
|
|
|
3810
3808
|
);
|
|
3811
3809
|
return;
|
|
3812
3810
|
}
|
|
3813
|
-
this.pollId = window.setTimeout(e,
|
|
3811
|
+
this.pollId = window.setTimeout(e, Wi.get());
|
|
3814
3812
|
};
|
|
3815
3813
|
e();
|
|
3816
3814
|
}
|
|
@@ -3832,8 +3830,8 @@ V.currentPopupAction = null;
|
|
|
3832
3830
|
* See the License for the specific language governing permissions and
|
|
3833
3831
|
* limitations under the License.
|
|
3834
3832
|
*/
|
|
3835
|
-
const
|
|
3836
|
-
class
|
|
3833
|
+
const ji = "pendingRedirect", oe = /* @__PURE__ */ new Map();
|
|
3834
|
+
class Gi extends Jt {
|
|
3837
3835
|
constructor(e, t, i = !1) {
|
|
3838
3836
|
super(e, [
|
|
3839
3837
|
"signInViaRedirect",
|
|
@@ -3848,17 +3846,17 @@ class zi extends Yt {
|
|
|
3848
3846
|
* just return it.
|
|
3849
3847
|
*/
|
|
3850
3848
|
async execute() {
|
|
3851
|
-
let e =
|
|
3849
|
+
let e = oe.get(this.auth._key());
|
|
3852
3850
|
if (!e) {
|
|
3853
3851
|
try {
|
|
3854
|
-
const i = await
|
|
3852
|
+
const i = await Bi(this.resolver, this.auth) ? await super.execute() : null;
|
|
3855
3853
|
e = () => Promise.resolve(i);
|
|
3856
3854
|
} catch (t) {
|
|
3857
3855
|
e = () => Promise.reject(t);
|
|
3858
3856
|
}
|
|
3859
|
-
|
|
3857
|
+
oe.set(this.auth._key(), e);
|
|
3860
3858
|
}
|
|
3861
|
-
return this.bypassAuthState ||
|
|
3859
|
+
return this.bypassAuthState || oe.set(this.auth._key(), () => Promise.resolve(null)), e();
|
|
3862
3860
|
}
|
|
3863
3861
|
async onAuthEvent(e) {
|
|
3864
3862
|
if (e.type === "signInViaRedirect")
|
|
@@ -3879,26 +3877,26 @@ class zi extends Yt {
|
|
|
3879
3877
|
cleanUp() {
|
|
3880
3878
|
}
|
|
3881
3879
|
}
|
|
3882
|
-
async function
|
|
3883
|
-
const t =
|
|
3880
|
+
async function Bi(n, e) {
|
|
3881
|
+
const t = Ki(e), i = qi(n);
|
|
3884
3882
|
if (!await i._isAvailable())
|
|
3885
3883
|
return !1;
|
|
3886
3884
|
const r = await i._get(t) === "true";
|
|
3887
3885
|
return await i._remove(t), r;
|
|
3888
3886
|
}
|
|
3889
|
-
function
|
|
3890
|
-
|
|
3887
|
+
function zi(n, e) {
|
|
3888
|
+
oe.set(n._key(), e);
|
|
3891
3889
|
}
|
|
3892
|
-
function
|
|
3890
|
+
function qi(n) {
|
|
3893
3891
|
return S(n._redirectPersistence);
|
|
3894
3892
|
}
|
|
3895
|
-
function
|
|
3896
|
-
return
|
|
3893
|
+
function Ki(n) {
|
|
3894
|
+
return se(ji, n.config.apiKey, n.name);
|
|
3897
3895
|
}
|
|
3898
|
-
async function
|
|
3896
|
+
async function Ji(n, e, t = !1) {
|
|
3899
3897
|
if (E(n.app))
|
|
3900
3898
|
return Promise.reject(M(n));
|
|
3901
|
-
const i =
|
|
3899
|
+
const i = me(n), r = xi(i, e), o = await new Gi(i, r, t).execute();
|
|
3902
3900
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
3903
3901
|
}
|
|
3904
3902
|
/**
|
|
@@ -3917,8 +3915,8 @@ async function Xi(n, e, t = !1) {
|
|
|
3917
3915
|
* See the License for the specific language governing permissions and
|
|
3918
3916
|
* limitations under the License.
|
|
3919
3917
|
*/
|
|
3920
|
-
const
|
|
3921
|
-
class
|
|
3918
|
+
const Yi = 10 * 60 * 1e3;
|
|
3919
|
+
class Xi {
|
|
3922
3920
|
constructor(e) {
|
|
3923
3921
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
3924
3922
|
}
|
|
@@ -3934,13 +3932,13 @@ class Zi {
|
|
|
3934
3932
|
let t = !1;
|
|
3935
3933
|
return this.consumers.forEach((i) => {
|
|
3936
3934
|
this.isEventForConsumer(e, i) && (t = !0, this.sendToConsumer(e, i), this.saveEventToCache(e));
|
|
3937
|
-
}), this.hasHandledPotentialRedirect || !
|
|
3935
|
+
}), this.hasHandledPotentialRedirect || !Qi(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
3938
3936
|
}
|
|
3939
3937
|
sendToConsumer(e, t) {
|
|
3940
3938
|
var i;
|
|
3941
|
-
if (e.error && !
|
|
3939
|
+
if (e.error && !Yt(e)) {
|
|
3942
3940
|
const r = ((i = e.error.code) === null || i === void 0 ? void 0 : i.split("auth/")[1]) || "internal-error";
|
|
3943
|
-
t.onError(
|
|
3941
|
+
t.onError(T(this.auth, r));
|
|
3944
3942
|
} else
|
|
3945
3943
|
t.onAuthEvent(e);
|
|
3946
3944
|
}
|
|
@@ -3949,26 +3947,26 @@ class Zi {
|
|
|
3949
3947
|
return t.filter.includes(e.type) && i;
|
|
3950
3948
|
}
|
|
3951
3949
|
hasEventBeenHandled(e) {
|
|
3952
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
3950
|
+
return Date.now() - this.lastProcessedEventTime >= Yi && this.cachedEventUids.clear(), this.cachedEventUids.has(st(e));
|
|
3953
3951
|
}
|
|
3954
3952
|
saveEventToCache(e) {
|
|
3955
|
-
this.cachedEventUids.add(
|
|
3953
|
+
this.cachedEventUids.add(st(e)), this.lastProcessedEventTime = Date.now();
|
|
3956
3954
|
}
|
|
3957
3955
|
}
|
|
3958
|
-
function
|
|
3956
|
+
function st(n) {
|
|
3959
3957
|
return [n.type, n.eventId, n.sessionId, n.tenantId].filter((e) => e).join("-");
|
|
3960
3958
|
}
|
|
3961
|
-
function
|
|
3959
|
+
function Yt({ type: n, error: e }) {
|
|
3962
3960
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
3963
3961
|
}
|
|
3964
|
-
function
|
|
3962
|
+
function Qi(n) {
|
|
3965
3963
|
switch (n.type) {
|
|
3966
3964
|
case "signInViaRedirect":
|
|
3967
3965
|
case "linkViaRedirect":
|
|
3968
3966
|
case "reauthViaRedirect":
|
|
3969
3967
|
return !0;
|
|
3970
3968
|
case "unknown":
|
|
3971
|
-
return
|
|
3969
|
+
return Yt(n);
|
|
3972
3970
|
default:
|
|
3973
3971
|
return !1;
|
|
3974
3972
|
}
|
|
@@ -3989,7 +3987,7 @@ function er(n) {
|
|
|
3989
3987
|
* See the License for the specific language governing permissions and
|
|
3990
3988
|
* limitations under the License.
|
|
3991
3989
|
*/
|
|
3992
|
-
async function
|
|
3990
|
+
async function Zi(n, e = {}) {
|
|
3993
3991
|
return G(n, "GET", "/v1/projects", e);
|
|
3994
3992
|
}
|
|
3995
3993
|
/**
|
|
@@ -4008,14 +4006,14 @@ async function tr(n, e = {}) {
|
|
|
4008
4006
|
* See the License for the specific language governing permissions and
|
|
4009
4007
|
* limitations under the License.
|
|
4010
4008
|
*/
|
|
4011
|
-
const
|
|
4012
|
-
async function
|
|
4009
|
+
const er = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, tr = /^https?/;
|
|
4010
|
+
async function nr(n) {
|
|
4013
4011
|
if (n.config.emulator)
|
|
4014
4012
|
return;
|
|
4015
|
-
const { authorizedDomains: e } = await
|
|
4013
|
+
const { authorizedDomains: e } = await Zi(n);
|
|
4016
4014
|
for (const t of e)
|
|
4017
4015
|
try {
|
|
4018
|
-
if (
|
|
4016
|
+
if (ir(t))
|
|
4019
4017
|
return;
|
|
4020
4018
|
} catch {
|
|
4021
4019
|
}
|
|
@@ -4025,15 +4023,15 @@ async function rr(n) {
|
|
|
4025
4023
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
4026
4024
|
);
|
|
4027
4025
|
}
|
|
4028
|
-
function
|
|
4029
|
-
const e =
|
|
4026
|
+
function ir(n) {
|
|
4027
|
+
const e = Re(), { protocol: t, hostname: i } = new URL(e);
|
|
4030
4028
|
if (n.startsWith("chrome-extension://")) {
|
|
4031
4029
|
const o = new URL(n);
|
|
4032
4030
|
return o.hostname === "" && i === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === i;
|
|
4033
4031
|
}
|
|
4034
|
-
if (!
|
|
4032
|
+
if (!tr.test(t))
|
|
4035
4033
|
return !1;
|
|
4036
|
-
if (
|
|
4034
|
+
if (er.test(n))
|
|
4037
4035
|
return i === n;
|
|
4038
4036
|
const r = n.replace(/\./g, "\\.");
|
|
4039
4037
|
return new RegExp("^(.+\\." + r + "|" + r + ")$", "i").test(i);
|
|
@@ -4054,9 +4052,9 @@ function sr(n) {
|
|
|
4054
4052
|
* See the License for the specific language governing permissions and
|
|
4055
4053
|
* limitations under the License.
|
|
4056
4054
|
*/
|
|
4057
|
-
const
|
|
4058
|
-
function
|
|
4059
|
-
const n =
|
|
4055
|
+
const rr = new X(3e4, 6e4);
|
|
4056
|
+
function ot() {
|
|
4057
|
+
const n = y().___jsl;
|
|
4060
4058
|
if (n != null && n.H) {
|
|
4061
4059
|
for (const e of Object.keys(n.H))
|
|
4062
4060
|
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)
|
|
@@ -4064,45 +4062,45 @@ function at() {
|
|
|
4064
4062
|
n.CP[t] = null;
|
|
4065
4063
|
}
|
|
4066
4064
|
}
|
|
4067
|
-
function
|
|
4065
|
+
function sr(n) {
|
|
4068
4066
|
return new Promise((e, t) => {
|
|
4069
4067
|
var i, r, s;
|
|
4070
4068
|
function o() {
|
|
4071
|
-
|
|
4069
|
+
ot(), gapi.load("gapi.iframes", {
|
|
4072
4070
|
callback: () => {
|
|
4073
4071
|
e(gapi.iframes.getContext());
|
|
4074
4072
|
},
|
|
4075
4073
|
ontimeout: () => {
|
|
4076
|
-
|
|
4074
|
+
ot(), t(T(
|
|
4077
4075
|
n,
|
|
4078
4076
|
"network-request-failed"
|
|
4079
4077
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4080
4078
|
));
|
|
4081
4079
|
},
|
|
4082
|
-
timeout:
|
|
4080
|
+
timeout: rr.get()
|
|
4083
4081
|
});
|
|
4084
4082
|
}
|
|
4085
|
-
if (!((r = (i =
|
|
4083
|
+
if (!((r = (i = y().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
4086
4084
|
e(gapi.iframes.getContext());
|
|
4087
|
-
else if (!((s =
|
|
4085
|
+
else if (!((s = y().gapi) === null || s === void 0) && s.load)
|
|
4088
4086
|
o();
|
|
4089
4087
|
else {
|
|
4090
|
-
const c =
|
|
4091
|
-
return
|
|
4092
|
-
gapi.load ? o() : t(
|
|
4088
|
+
const c = ci("iframefcb");
|
|
4089
|
+
return y()[c] = () => {
|
|
4090
|
+
gapi.load ? o() : t(T(
|
|
4093
4091
|
n,
|
|
4094
4092
|
"network-request-failed"
|
|
4095
4093
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4096
4094
|
));
|
|
4097
|
-
},
|
|
4095
|
+
}, oi(`${ai()}?onload=${c}`).catch((a) => t(a));
|
|
4098
4096
|
}
|
|
4099
4097
|
}).catch((e) => {
|
|
4100
|
-
throw
|
|
4098
|
+
throw ae = null, e;
|
|
4101
4099
|
});
|
|
4102
4100
|
}
|
|
4103
|
-
let
|
|
4104
|
-
function
|
|
4105
|
-
return
|
|
4101
|
+
let ae = null;
|
|
4102
|
+
function or(n) {
|
|
4103
|
+
return ae = ae || sr(n), ae;
|
|
4106
4104
|
}
|
|
4107
4105
|
/**
|
|
4108
4106
|
* @license
|
|
@@ -4120,7 +4118,7 @@ function cr(n) {
|
|
|
4120
4118
|
* See the License for the specific language governing permissions and
|
|
4121
4119
|
* limitations under the License.
|
|
4122
4120
|
*/
|
|
4123
|
-
const
|
|
4121
|
+
const ar = new X(5e3, 15e3), cr = "__/auth/iframe", lr = "emulator/auth/iframe", ur = {
|
|
4124
4122
|
style: {
|
|
4125
4123
|
position: "absolute",
|
|
4126
4124
|
top: "-100px",
|
|
@@ -4129,56 +4127,56 @@ const lr = new Z(5e3, 15e3), ur = "__/auth/iframe", dr = "emulator/auth/iframe",
|
|
|
4129
4127
|
},
|
|
4130
4128
|
"aria-hidden": "true",
|
|
4131
4129
|
tabindex: "-1"
|
|
4132
|
-
},
|
|
4130
|
+
}, dr = /* @__PURE__ */ new Map([
|
|
4133
4131
|
["identitytoolkit.googleapis.com", "p"],
|
|
4134
4132
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
4135
4133
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
4136
4134
|
// test
|
|
4137
4135
|
]);
|
|
4138
|
-
function
|
|
4136
|
+
function hr(n) {
|
|
4139
4137
|
const e = n.config;
|
|
4140
|
-
|
|
4138
|
+
u(
|
|
4141
4139
|
e.authDomain,
|
|
4142
4140
|
n,
|
|
4143
4141
|
"auth-domain-config-required"
|
|
4144
4142
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
4145
4143
|
);
|
|
4146
|
-
const t = e.emulator ?
|
|
4144
|
+
const t = e.emulator ? Me(e, lr) : `https://${n.config.authDomain}/${cr}`, i = {
|
|
4147
4145
|
apiKey: e.apiKey,
|
|
4148
4146
|
appName: n.name,
|
|
4149
|
-
v:
|
|
4150
|
-
}, r =
|
|
4147
|
+
v: J
|
|
4148
|
+
}, r = dr.get(n.config.apiHost);
|
|
4151
4149
|
r && (i.eid = r);
|
|
4152
4150
|
const s = n._getFrameworks();
|
|
4153
|
-
return s.length && (i.fw = s.join(",")), `${t}?${
|
|
4151
|
+
return s.length && (i.fw = s.join(",")), `${t}?${Y(i).slice(1)}`;
|
|
4154
4152
|
}
|
|
4155
|
-
async function
|
|
4156
|
-
const e = await
|
|
4157
|
-
return
|
|
4153
|
+
async function fr(n) {
|
|
4154
|
+
const e = await or(n), t = y().gapi;
|
|
4155
|
+
return u(
|
|
4158
4156
|
t,
|
|
4159
4157
|
n,
|
|
4160
4158
|
"internal-error"
|
|
4161
4159
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4162
4160
|
), e.open({
|
|
4163
4161
|
where: document.body,
|
|
4164
|
-
url:
|
|
4162
|
+
url: hr(n),
|
|
4165
4163
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
4166
|
-
attributes:
|
|
4164
|
+
attributes: ur,
|
|
4167
4165
|
dontclear: !0
|
|
4168
4166
|
}, (i) => new Promise(async (r, s) => {
|
|
4169
4167
|
await i.restyle({
|
|
4170
4168
|
// Prevent iframe from closing on mouse out.
|
|
4171
4169
|
setHideOnLeave: !1
|
|
4172
4170
|
});
|
|
4173
|
-
const o =
|
|
4171
|
+
const o = T(
|
|
4174
4172
|
n,
|
|
4175
4173
|
"network-request-failed"
|
|
4176
4174
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4177
|
-
), c =
|
|
4175
|
+
), c = y().setTimeout(() => {
|
|
4178
4176
|
s(o);
|
|
4179
|
-
},
|
|
4177
|
+
}, ar.get());
|
|
4180
4178
|
function a() {
|
|
4181
|
-
|
|
4179
|
+
y().clearTimeout(c), r(i);
|
|
4182
4180
|
}
|
|
4183
4181
|
i.ping(a).then(a, () => {
|
|
4184
4182
|
s(o);
|
|
@@ -4201,13 +4199,13 @@ async function mr(n) {
|
|
|
4201
4199
|
* See the License for the specific language governing permissions and
|
|
4202
4200
|
* limitations under the License.
|
|
4203
4201
|
*/
|
|
4204
|
-
const
|
|
4202
|
+
const pr = {
|
|
4205
4203
|
location: "yes",
|
|
4206
4204
|
resizable: "yes",
|
|
4207
4205
|
statusbar: "yes",
|
|
4208
4206
|
toolbar: "no"
|
|
4209
|
-
},
|
|
4210
|
-
class
|
|
4207
|
+
}, mr = 500, gr = 600, _r = "_blank", vr = "http://localhost";
|
|
4208
|
+
class at {
|
|
4211
4209
|
constructor(e) {
|
|
4212
4210
|
this.window = e, this.associatedEvent = null;
|
|
4213
4211
|
}
|
|
@@ -4219,21 +4217,21 @@ class ct {
|
|
|
4219
4217
|
}
|
|
4220
4218
|
}
|
|
4221
4219
|
}
|
|
4222
|
-
function
|
|
4220
|
+
function Ir(n, e, t, i = mr, r = gr) {
|
|
4223
4221
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4224
4222
|
let c = "";
|
|
4225
|
-
const a = Object.assign(Object.assign({},
|
|
4223
|
+
const a = Object.assign(Object.assign({}, pr), {
|
|
4226
4224
|
width: i.toString(),
|
|
4227
4225
|
height: r.toString(),
|
|
4228
4226
|
top: s,
|
|
4229
4227
|
left: o
|
|
4230
|
-
}),
|
|
4231
|
-
t && (c =
|
|
4232
|
-
const d = Object.entries(a).reduce((p, [
|
|
4233
|
-
if (
|
|
4234
|
-
return
|
|
4228
|
+
}), l = _().toLowerCase();
|
|
4229
|
+
t && (c = Ct(l) ? _r : t), Pt(l) && (e = e || vr, a.scrollbars = "yes");
|
|
4230
|
+
const d = Object.entries(a).reduce((p, [w, U]) => `${p}${w}=${U},`, "");
|
|
4231
|
+
if (Xn(l) && c !== "_self")
|
|
4232
|
+
return Tr(e || "", c), new at(null);
|
|
4235
4233
|
const h = window.open(e || "", c, d);
|
|
4236
|
-
|
|
4234
|
+
u(
|
|
4237
4235
|
h,
|
|
4238
4236
|
n,
|
|
4239
4237
|
"popup-blocked"
|
|
@@ -4243,9 +4241,9 @@ function yr(n, e, t, i = _r, r = vr) {
|
|
|
4243
4241
|
h.focus();
|
|
4244
4242
|
} catch {
|
|
4245
4243
|
}
|
|
4246
|
-
return new
|
|
4244
|
+
return new at(h);
|
|
4247
4245
|
}
|
|
4248
|
-
function
|
|
4246
|
+
function Tr(n, e) {
|
|
4249
4247
|
const t = document.createElement("a");
|
|
4250
4248
|
t.href = n, t.target = e;
|
|
4251
4249
|
const i = document.createEvent("MouseEvent");
|
|
@@ -4267,14 +4265,14 @@ function wr(n, e) {
|
|
|
4267
4265
|
* See the License for the specific language governing permissions and
|
|
4268
4266
|
* limitations under the License.
|
|
4269
4267
|
*/
|
|
4270
|
-
const
|
|
4271
|
-
async function
|
|
4272
|
-
|
|
4268
|
+
const yr = "__/auth/handler", wr = "emulator/auth/handler", Er = encodeURIComponent("fac");
|
|
4269
|
+
async function ct(n, e, t, i, r, s) {
|
|
4270
|
+
u(
|
|
4273
4271
|
n.config.authDomain,
|
|
4274
4272
|
n,
|
|
4275
4273
|
"auth-domain-config-required"
|
|
4276
4274
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
4277
|
-
),
|
|
4275
|
+
), u(
|
|
4278
4276
|
n.config.apiKey,
|
|
4279
4277
|
n,
|
|
4280
4278
|
"invalid-api-key"
|
|
@@ -4285,15 +4283,15 @@ async function lt(n, e, t, i, r, s) {
|
|
|
4285
4283
|
appName: n.name,
|
|
4286
4284
|
authType: t,
|
|
4287
4285
|
redirectUrl: i,
|
|
4288
|
-
v:
|
|
4286
|
+
v: J,
|
|
4289
4287
|
eventId: r
|
|
4290
4288
|
};
|
|
4291
|
-
if (e instanceof
|
|
4292
|
-
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "",
|
|
4289
|
+
if (e instanceof Vt) {
|
|
4290
|
+
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", bn(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
4293
4291
|
for (const [d, h] of Object.entries({}))
|
|
4294
4292
|
o[d] = h;
|
|
4295
4293
|
}
|
|
4296
|
-
if (e instanceof
|
|
4294
|
+
if (e instanceof Q) {
|
|
4297
4295
|
const d = e.getScopes().filter((h) => h !== "");
|
|
4298
4296
|
d.length > 0 && (o.scopes = d.join(","));
|
|
4299
4297
|
}
|
|
@@ -4301,11 +4299,11 @@ async function lt(n, e, t, i, r, s) {
|
|
|
4301
4299
|
const c = o;
|
|
4302
4300
|
for (const d of Object.keys(c))
|
|
4303
4301
|
c[d] === void 0 && delete c[d];
|
|
4304
|
-
const a = await n._getAppCheckToken(),
|
|
4305
|
-
return `${
|
|
4302
|
+
const a = await n._getAppCheckToken(), l = a ? `#${Er}=${encodeURIComponent(a)}` : "";
|
|
4303
|
+
return `${kr(n)}?${Y(c).slice(1)}${l}`;
|
|
4306
4304
|
}
|
|
4307
|
-
function
|
|
4308
|
-
return n.emulator ?
|
|
4305
|
+
function kr({ config: n }) {
|
|
4306
|
+
return n.emulator ? Me(n, wr) : `https://${n.authDomain}/${yr}`;
|
|
4309
4307
|
}
|
|
4310
4308
|
/**
|
|
4311
4309
|
* @license
|
|
@@ -4323,23 +4321,23 @@ function Sr({ config: n }) {
|
|
|
4323
4321
|
* See the License for the specific language governing permissions and
|
|
4324
4322
|
* limitations under the License.
|
|
4325
4323
|
*/
|
|
4326
|
-
const
|
|
4327
|
-
class
|
|
4324
|
+
const we = "webStorageSupport";
|
|
4325
|
+
class br {
|
|
4328
4326
|
constructor() {
|
|
4329
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence =
|
|
4327
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Gt, this._completeRedirectFn = Ji, this._overrideRedirectResult = zi;
|
|
4330
4328
|
}
|
|
4331
4329
|
// Wrapping in async even though we don't await anywhere in order
|
|
4332
4330
|
// to make sure errors are raised as promise rejections
|
|
4333
4331
|
async _openPopup(e, t, i, r) {
|
|
4334
4332
|
var s;
|
|
4335
4333
|
A((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4336
|
-
const o = await
|
|
4337
|
-
return
|
|
4334
|
+
const o = await ct(e, t, i, Re(), r);
|
|
4335
|
+
return Ir(e, o, xe());
|
|
4338
4336
|
}
|
|
4339
4337
|
async _openRedirect(e, t, i, r) {
|
|
4340
4338
|
await this._originValidation(e);
|
|
4341
|
-
const s = await
|
|
4342
|
-
return
|
|
4339
|
+
const s = await ct(e, t, i, Re(), r);
|
|
4340
|
+
return Ai(s), new Promise(() => {
|
|
4343
4341
|
});
|
|
4344
4342
|
}
|
|
4345
4343
|
_initialize(e) {
|
|
@@ -4354,8 +4352,8 @@ class Rr {
|
|
|
4354
4352
|
}), i;
|
|
4355
4353
|
}
|
|
4356
4354
|
async initAndGetManager(e) {
|
|
4357
|
-
const t = await
|
|
4358
|
-
return t.register("authEvent", (r) => (
|
|
4355
|
+
const t = await fr(e), i = new Xi(e);
|
|
4356
|
+
return t.register("authEvent", (r) => (u(
|
|
4359
4357
|
r == null ? void 0 : r.authEvent,
|
|
4360
4358
|
e,
|
|
4361
4359
|
"invalid-auth-event"
|
|
@@ -4366,9 +4364,9 @@ class Rr {
|
|
|
4366
4364
|
}), gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER), this.eventManagers[e._key()] = { manager: i }, this.iframes[e._key()] = t, i;
|
|
4367
4365
|
}
|
|
4368
4366
|
_isIframeWebStorageSupported(e, t) {
|
|
4369
|
-
this.iframes[e._key()].send(
|
|
4367
|
+
this.iframes[e._key()].send(we, { type: we }, (r) => {
|
|
4370
4368
|
var s;
|
|
4371
|
-
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[
|
|
4369
|
+
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[we];
|
|
4372
4370
|
o !== void 0 && t(!!o), R(
|
|
4373
4371
|
e,
|
|
4374
4372
|
"internal-error"
|
|
@@ -4378,14 +4376,14 @@ class Rr {
|
|
|
4378
4376
|
}
|
|
4379
4377
|
_originValidation(e) {
|
|
4380
4378
|
const t = e._key();
|
|
4381
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
4379
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = nr(e)), this.originValidationPromises[t];
|
|
4382
4380
|
}
|
|
4383
4381
|
get _shouldInitProactively() {
|
|
4384
|
-
return
|
|
4382
|
+
return Ut() || De() || pe();
|
|
4385
4383
|
}
|
|
4386
4384
|
}
|
|
4387
|
-
const
|
|
4388
|
-
var
|
|
4385
|
+
const Sr = br;
|
|
4386
|
+
var lt = "@firebase/auth", ut = "1.7.5";
|
|
4389
4387
|
/**
|
|
4390
4388
|
* @license
|
|
4391
4389
|
* Copyright 2020 Google LLC
|
|
@@ -4402,7 +4400,7 @@ var ut = "@firebase/auth", dt = "1.7.5";
|
|
|
4402
4400
|
* See the License for the specific language governing permissions and
|
|
4403
4401
|
* limitations under the License.
|
|
4404
4402
|
*/
|
|
4405
|
-
class
|
|
4403
|
+
class Rr {
|
|
4406
4404
|
constructor(e) {
|
|
4407
4405
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
4408
4406
|
}
|
|
@@ -4427,7 +4425,7 @@ class Pr {
|
|
|
4427
4425
|
t && (this.internalListeners.delete(e), t(), this.updateProactiveRefresh());
|
|
4428
4426
|
}
|
|
4429
4427
|
assertAuthConfigured() {
|
|
4430
|
-
|
|
4428
|
+
u(
|
|
4431
4429
|
this.auth._initializationPromise,
|
|
4432
4430
|
"dependent-sdk-initialized-before-auth"
|
|
4433
4431
|
/* AuthErrorCode.DEPENDENT_SDK_INIT_BEFORE_AUTH */
|
|
@@ -4453,7 +4451,7 @@ class Pr {
|
|
|
4453
4451
|
* See the License for the specific language governing permissions and
|
|
4454
4452
|
* limitations under the License.
|
|
4455
4453
|
*/
|
|
4456
|
-
function
|
|
4454
|
+
function Ar(n) {
|
|
4457
4455
|
switch (n) {
|
|
4458
4456
|
case "Node":
|
|
4459
4457
|
return "node";
|
|
@@ -4469,12 +4467,12 @@ function Cr(n) {
|
|
|
4469
4467
|
return;
|
|
4470
4468
|
}
|
|
4471
4469
|
}
|
|
4472
|
-
function
|
|
4473
|
-
|
|
4470
|
+
function Pr(n) {
|
|
4471
|
+
ze(new qe(
|
|
4474
4472
|
"auth",
|
|
4475
4473
|
(e, { options: t }) => {
|
|
4476
4474
|
const i = e.getProvider("app").getImmediate(), r = e.getProvider("heartbeat"), s = e.getProvider("app-check-internal"), { apiKey: o, authDomain: c } = i.options;
|
|
4477
|
-
|
|
4475
|
+
u(o && !o.includes(":"), "invalid-api-key", { appName: i.name });
|
|
4478
4476
|
const a = {
|
|
4479
4477
|
apiKey: o,
|
|
4480
4478
|
authDomain: c,
|
|
@@ -4482,9 +4480,9 @@ function Or(n) {
|
|
|
4482
4480
|
apiHost: "identitytoolkit.googleapis.com",
|
|
4483
4481
|
tokenApiHost: "securetoken.googleapis.com",
|
|
4484
4482
|
apiScheme: "https",
|
|
4485
|
-
sdkClientVersion:
|
|
4486
|
-
},
|
|
4487
|
-
return
|
|
4483
|
+
sdkClientVersion: Dt(n)
|
|
4484
|
+
}, l = new ri(i, r, s, a);
|
|
4485
|
+
return ui(l, t), l;
|
|
4488
4486
|
},
|
|
4489
4487
|
"PUBLIC"
|
|
4490
4488
|
/* ComponentType.PUBLIC */
|
|
@@ -4496,21 +4494,21 @@ function Or(n) {
|
|
|
4496
4494
|
"auth-internal"
|
|
4497
4495
|
/* _ComponentName.AUTH_INTERNAL */
|
|
4498
4496
|
).initialize();
|
|
4499
|
-
})),
|
|
4497
|
+
})), ze(new qe(
|
|
4500
4498
|
"auth-internal",
|
|
4501
4499
|
(e) => {
|
|
4502
|
-
const t =
|
|
4500
|
+
const t = me(e.getProvider(
|
|
4503
4501
|
"auth"
|
|
4504
4502
|
/* _ComponentName.AUTH */
|
|
4505
4503
|
).getImmediate());
|
|
4506
|
-
return ((i) => new
|
|
4504
|
+
return ((i) => new Rr(i))(t);
|
|
4507
4505
|
},
|
|
4508
4506
|
"PRIVATE"
|
|
4509
4507
|
/* ComponentType.PRIVATE */
|
|
4510
4508
|
).setInstantiationMode(
|
|
4511
4509
|
"EXPLICIT"
|
|
4512
4510
|
/* InstantiationMode.EXPLICIT */
|
|
4513
|
-
)),
|
|
4511
|
+
)), Se(lt, ut, Ar(n)), Se(lt, ut, "esm2017");
|
|
4514
4512
|
}
|
|
4515
4513
|
/**
|
|
4516
4514
|
* @license
|
|
@@ -4528,118 +4526,117 @@ function Or(n) {
|
|
|
4528
4526
|
* See the License for the specific language governing permissions and
|
|
4529
4527
|
* limitations under the License.
|
|
4530
4528
|
*/
|
|
4531
|
-
const
|
|
4532
|
-
let
|
|
4533
|
-
const
|
|
4529
|
+
const Cr = 5 * 60, Or = gt("authIdTokenMaxAge") || Cr;
|
|
4530
|
+
let dt = null;
|
|
4531
|
+
const Nr = (n) => async (e) => {
|
|
4534
4532
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
4535
|
-
if (i && i >
|
|
4533
|
+
if (i && i > Or)
|
|
4536
4534
|
return;
|
|
4537
4535
|
const r = t == null ? void 0 : t.token;
|
|
4538
|
-
|
|
4536
|
+
dt !== r && (dt = r, await fetch(n, {
|
|
4539
4537
|
method: r ? "POST" : "DELETE",
|
|
4540
4538
|
headers: r ? {
|
|
4541
4539
|
Authorization: `Bearer ${r}`
|
|
4542
4540
|
} : {}
|
|
4543
4541
|
}));
|
|
4544
4542
|
};
|
|
4545
|
-
function
|
|
4546
|
-
const e =
|
|
4543
|
+
function Lr(n = yn()) {
|
|
4544
|
+
const e = _t(n, "auth");
|
|
4547
4545
|
if (e.isInitialized())
|
|
4548
4546
|
return e.getImmediate();
|
|
4549
|
-
const t =
|
|
4550
|
-
popupRedirectResolver:
|
|
4547
|
+
const t = li(n, {
|
|
4548
|
+
popupRedirectResolver: Sr,
|
|
4551
4549
|
persistence: [
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4550
|
+
Fi,
|
|
4551
|
+
bi,
|
|
4552
|
+
Gt
|
|
4555
4553
|
]
|
|
4556
|
-
}), i =
|
|
4554
|
+
}), i = gt("authTokenSyncURL");
|
|
4557
4555
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4558
4556
|
const s = new URL(i, location.origin);
|
|
4559
4557
|
if (location.origin === s.origin) {
|
|
4560
|
-
const o =
|
|
4561
|
-
|
|
4558
|
+
const o = Nr(s.toString());
|
|
4559
|
+
yi(t, o, () => o(t.currentUser)), Ti(t, (c) => o(c));
|
|
4562
4560
|
}
|
|
4563
4561
|
}
|
|
4564
|
-
const r =
|
|
4565
|
-
return r &&
|
|
4562
|
+
const r = Tn("auth");
|
|
4563
|
+
return r && di(t, `http://${r}`), t;
|
|
4566
4564
|
}
|
|
4567
|
-
function
|
|
4565
|
+
function Mr() {
|
|
4568
4566
|
var n, e;
|
|
4569
4567
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
4570
4568
|
}
|
|
4571
|
-
|
|
4569
|
+
si({
|
|
4572
4570
|
loadJS(n) {
|
|
4573
4571
|
return new Promise((e, t) => {
|
|
4574
4572
|
const i = document.createElement("script");
|
|
4575
4573
|
i.setAttribute("src", n), i.onload = e, i.onerror = (r) => {
|
|
4576
|
-
const s =
|
|
4574
|
+
const s = T(
|
|
4577
4575
|
"internal-error"
|
|
4578
4576
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4579
4577
|
);
|
|
4580
4578
|
s.customData = r, t(s);
|
|
4581
|
-
}, i.type = "text/javascript", i.charset = "UTF-8",
|
|
4579
|
+
}, i.type = "text/javascript", i.charset = "UTF-8", Mr().appendChild(i);
|
|
4582
4580
|
});
|
|
4583
4581
|
},
|
|
4584
4582
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
4585
4583
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
4586
4584
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
4587
4585
|
});
|
|
4588
|
-
|
|
4586
|
+
Pr(
|
|
4589
4587
|
"Browser"
|
|
4590
4588
|
/* ClientPlatform.BROWSER */
|
|
4591
4589
|
);
|
|
4592
|
-
var
|
|
4593
|
-
const
|
|
4590
|
+
var Ur = { 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" }, Dr = { 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/" };
|
|
4591
|
+
const Fr = {
|
|
4594
4592
|
key: 1,
|
|
4595
4593
|
class: "h-full w-full"
|
|
4596
|
-
},
|
|
4594
|
+
}, xr = ["src"], Zr = /* @__PURE__ */ ht({
|
|
4597
4595
|
__name: "App",
|
|
4598
4596
|
setup(n) {
|
|
4599
|
-
const e =
|
|
4600
|
-
const m = e.currentCountry.value || "MY", g =
|
|
4601
|
-
return `${
|
|
4597
|
+
const e = be(), t = cn(), i = ln(), r = un(), s = dn(), o = mt(), c = te(o.query.showHeader !== "false"), a = te(!1), { currentBusiness: l } = be(), d = te(!1), h = Ee(() => i.version), p = Ee(() => {
|
|
4598
|
+
const m = e.currentCountry.value || "MY", g = Ke.getIdToken(), I = l.value._id;
|
|
4599
|
+
return `${Dr.marketingV1Portal}/b/${I}/marketing/overview?showHeader=false&country=${m}&token=${g}`;
|
|
4602
4600
|
});
|
|
4603
|
-
async function
|
|
4604
|
-
if (
|
|
4601
|
+
async function w() {
|
|
4602
|
+
if (Sn().length) {
|
|
4605
4603
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4606
4604
|
return;
|
|
4607
4605
|
}
|
|
4608
|
-
const m =
|
|
4609
|
-
await
|
|
4606
|
+
const m = Rn(Ur.firebase), g = await an.getCustomToken(), I = Lr();
|
|
4607
|
+
await Ii(I, g), An(m), console.log("initFirebase", m);
|
|
4610
4608
|
}
|
|
4611
|
-
const
|
|
4612
|
-
|
|
4609
|
+
const U = async () => {
|
|
4610
|
+
d.value = !1, await rn(), console.log("forceRerender"), Ke.setBusinessId(l.value._id), await i.readPremium(), !a.value && h.value === "v2" ? e.registerSidebarComponent(Nn) : e.hideSidebarToggle(!0), await w(), a.value = !0, d.value = !0;
|
|
4613
4611
|
};
|
|
4614
|
-
return
|
|
4615
|
-
if (
|
|
4616
|
-
const m = document.getElementsByClassName("app-header")[0], g = document.getElementsByClassName("app-sidebar")[0],
|
|
4617
|
-
m == null || m.classList.add("!hidden"), g == null || g.classList.add("!pt-0"),
|
|
4612
|
+
return en(() => {
|
|
4613
|
+
if (Pn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(r, s), !c.value) {
|
|
4614
|
+
const m = document.getElementsByClassName("app-header")[0], g = document.getElementsByClassName("app-sidebar")[0], I = document.getElementsByClassName("app-container")[0], x = document.getElementsByTagName("main")[0];
|
|
4615
|
+
m == null || m.classList.add("!hidden"), g == null || g.classList.add("!pt-0"), I == null || I.classList.add("!pt-0"), x == null || x.classList.add("!pt-0"), e.hideSidebarToggle(!0);
|
|
4618
4616
|
}
|
|
4619
|
-
|
|
4620
|
-
}),
|
|
4617
|
+
l.value != null && (console.log("App mounted, forceRerender"), U());
|
|
4618
|
+
}), ft(
|
|
4621
4619
|
() => e.currentBusiness.value,
|
|
4622
4620
|
async (m, g) => {
|
|
4623
|
-
console.log("Current business changed"), m != null && m._id != g._id && (console.log("forceRerender when business changes", m, g),
|
|
4621
|
+
console.log("Current business changed"), m != null && m._id != g._id && (console.log("forceRerender when business changes", m, g), U());
|
|
4624
4622
|
}
|
|
4625
|
-
), (m, g) => (
|
|
4626
|
-
v(
|
|
4627
|
-
v(
|
|
4628
|
-
|
|
4629
|
-
json: { url: v(
|
|
4623
|
+
), (m, g) => (ne(), ke(tn, null, [
|
|
4624
|
+
v(d) && v(h) === "v2" ? (ne(), nn(v(on), { key: 0 })) : Ge("", !0),
|
|
4625
|
+
v(d) && v(h) !== "v2" ? (ne(), ke("div", Fr, [
|
|
4626
|
+
pt(pn, {
|
|
4627
|
+
json: { url: v(p) }
|
|
4630
4628
|
}, null, 8, ["json"]),
|
|
4631
|
-
|
|
4629
|
+
ie("iframe", {
|
|
4632
4630
|
allow: "clipboard-read; clipboard-write",
|
|
4633
4631
|
frameBorder: "0",
|
|
4634
4632
|
height: "100%",
|
|
4635
4633
|
width: "100%",
|
|
4636
|
-
src: v(
|
|
4637
|
-
}, null, 8,
|
|
4638
|
-
])) :
|
|
4639
|
-
v(u).dialogShowing ? (K(), Be(v(mn), { key: 2 })) : ye("", !0)
|
|
4634
|
+
src: v(p)
|
|
4635
|
+
}, null, 8, xr)
|
|
4636
|
+
])) : Ge("", !0)
|
|
4640
4637
|
], 64));
|
|
4641
4638
|
}
|
|
4642
4639
|
});
|
|
4643
4640
|
export {
|
|
4644
|
-
|
|
4641
|
+
Zr as default
|
|
4645
4642
|
};
|