@feedmepos/mf-connect 0.1.0-beta.7 → 0.1.0-beta.70
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-DEQUEGlq.js +427 -0
- package/dist/{App-DalxIjTu.js → App-CcoU2SAx.js} +445 -420
- package/dist/AuditLogs-CiB6u06w.js +1886 -0
- package/dist/Bin-C2_1m5RT.js +166 -0
- package/dist/{Broadcast-uMAvsC--.js → Broadcast-TotIXDuJ.js} +56 -54
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-JxbENan8.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CixQu3Pr.js} +6 -8
- package/dist/Card-Ce-_xMgS.js +896 -0
- package/dist/Collections-DKva6Doi.js +459 -0
- package/dist/{Credit-QlnatflM.js → Credit-BVUxIJ6C.js} +36 -34
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BKEumoan.js +2181 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BE07lc4M.js → EffectSheet.vue_vue_type_style_index_0_lang-ah4bz-qR.js} +49 -49
- package/dist/{Experience-Czy41ifp.js → Experience-DV3384o0.js} +32 -30
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
- package/dist/Game-DY83ti52.js +278 -0
- package/dist/Index-DEIaZ-2H.js +259 -0
- package/dist/Marketing-C2RwIlrg.js +20071 -0
- package/dist/Member-D4fc-wzd.js +333 -0
- package/dist/MemberList-DSMI6t_D.js +1598 -0
- package/dist/MemberTransactions-wXUlbbRq.js +45 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CtM73bcN.js → MessageInput.vue_vue_type_script_setup_true_lang-DYS0klKm.js} +135 -120
- package/dist/Mission-P_KLDEpg.js +296 -0
- package/dist/Overview-8vc0f1D7.js +1078 -0
- package/dist/{Point-By6ogYy_.js → Point-B4Y0Pq60.js} +55 -53
- package/dist/{Promotion-DKcBr-RI.js → Promotion-C1CbesgZ.js} +65 -57
- package/dist/Queue-BlPA7PNH.js +244 -0
- package/dist/Record-Cl1qXSSk.js +340 -0
- package/dist/Reward-jy6-W1Eh.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-d5JNNNHf.js +150 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DYul_Nu8.js +1640 -0
- package/dist/Segment-B36Nrvxs.js +568 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-jN0xUFNR.js +181 -0
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BLFTNooB.js +186 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-H_Sehhgf.js +147 -0
- package/dist/Setting-AgQf2X4W.js +1931 -0
- package/dist/Store-D3Mm0pan.js +1841 -0
- package/dist/StoreRewards-L0VLWz8l.js +423 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Zl_cXXSD.js +1028 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-nEdCD6la.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-b4mfueTj.js} +1 -1
- package/dist/{Tier-DvAs0-yx.js → Tier-DQq-375x.js} +327 -318
- package/dist/{Title-B_Trr39o.js → Title-OJxuBvaa.js} +224 -209
- package/dist/{Transaction-DCJw-b3H.js → Transaction-vgsYRfD7.js} +2 -2
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Cwi0mvC3.js +130 -0
- package/dist/Voucher-BFwLaoxe.js +354 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DNUBaNtJ.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXkhu8e9.js → ZodTextField.vue_vue_type_script_setup_true_lang-ms40eptZ.js} +1 -1
- package/dist/app-BQFTJ_hE.js +33357 -0
- package/dist/app-D7C3Fxfi.js +7077 -0
- package/dist/app.js +1 -1
- package/dist/{business-BC4-i1cU.js → business-vzpvmTdG.js} +1 -1
- package/dist/{campaign--0_yMbMV.js → campaign-BkxTDfsK.js} +2 -2
- package/dist/campaign-UQ8kMVeC.js +1810 -0
- package/dist/campaign.enum-BdT-e9h9.js +20 -0
- package/dist/campaign.fn-lc4ZhFCU.js +758 -0
- package/dist/collectible.enum-C8kd17Tz.js +19 -0
- package/dist/{collection.fn-3TwPe7aF.js → collection.fn-BIw1Y_tv.js} +2 -2
- package/dist/dto-CwzAhB8x.js +214 -0
- package/dist/{effect-BeR0LK61.js → effect-CJcvLlKG.js} +33 -16
- package/dist/email-addresses-BCJTQPT0.js +705 -0
- package/dist/{export-xeLLhqvh.js → export-URRwle1z.js} +5 -5
- package/dist/{helper-B5iqfKh8.js → helper-DccnE6zn.js} +1 -1
- package/dist/index-BiIZ7X6d.js +29556 -0
- package/dist/{index-CyKZ-SsN.js → index-BsRJ4kVb.js} +1 -1
- package/dist/{index-CU_d8jjU.js → index-C3lpXz_P.js} +1 -1
- package/dist/{index-Ct_wR519.js → index-CFA3EqId.js} +24 -21
- package/dist/{index-DP-dGMJC.js → index-CPRN3irj.js} +2230 -871
- package/dist/index-CaxFS90M.js +56 -0
- package/dist/index-CsaQJMAR.js +66 -0
- package/dist/index-D4MX9e5q.js +115 -0
- package/dist/index-DrE9VkxR.js +32 -0
- package/dist/index-EOPRlB9V.js +54 -0
- package/dist/{index-CAn5heDe.js → index-FcxOGFKj.js} +48 -4
- package/dist/{index-Bh-uaaBG.js → index-OScGm4mF.js} +1506 -1480
- package/dist/{index-BOdtpNkP.js → index-ghSGvG-m.js} +266 -173
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/{index.esm2017-5jeDA5Zo.js → index.esm2017-CE1CQHrP.js} +121 -121
- package/dist/loading-B8zghYbj.js +71 -0
- package/dist/{membership-D0nqqWNZ.js → membership-DoJMF2T6.js} +54 -46
- package/dist/money-CTR0rXZw.js +15 -0
- package/dist/number-Bhgz9eFP.js +12 -0
- package/dist/objectid-DdVJrRBw.js +145 -0
- package/dist/{loading-C-JDVajU.js → plugins-B5mQ7CHT.js} +3871 -3943
- package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
- package/dist/reward-DicsEEHe.js +36 -0
- package/dist/{rule-builder-BXt29Es4.js → rule-builder-BWb4JTrd.js} +1 -1
- package/dist/{rule-Dn_GgBCe.js → rule-s8siRar1.js} +185 -178
- package/dist/style.css +1 -1
- package/dist/{template-D2Oi3dxP.js → template-Qb5ozfLa.js} +5 -5
- package/dist/trigger-Bsb3Kj35.js +144 -0
- package/dist/user-DJ8aHRaM.js +54 -0
- package/dist/{vue-i18n-Dud8fvmw.js → vue-i18n-BG2U7GtN.js} +282 -282
- package/dist/{xlsx-CCRCidY2.js → xlsx-2QxyDFwt.js} +1 -1
- package/package.json +11 -7
- package/dist/Analytic-BMpS6jWb.js +0 -622
- package/dist/Card-DV8-g69L.js +0 -825
- package/dist/Collections-DRafEHT1.js +0 -453
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-TDoMehSB.js +0 -2813
- package/dist/Game-CD3zSitz.js +0 -255
- package/dist/Marketing-NNes8z6Q.js +0 -316
- package/dist/Member-CTqBgYuV.js +0 -69
- package/dist/MemberList-B99tS5ce.js +0 -1733
- package/dist/MemberTransactions-D1YCXPOg.js +0 -38
- package/dist/Mission-XbBVKBiE.js +0 -261
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D1ESqEFO.js +0 -1753
- package/dist/Segment-B8cszL-F.js +0 -437
- package/dist/Setting-aZYABlMW.js +0 -1901
- package/dist/Store-Bx2tyJwe.js +0 -1511
- package/dist/StoreRewards-DTp9G6gw.js +0 -401
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B2W7ly5Z.js +0 -890
- package/dist/Voucher-jqv3ji90.js +0 -490
- package/dist/app-WlcUVbFb.js +0 -5764
- package/dist/app-_w0hjM7u.js +0 -53428
- package/dist/dto-Ns2dLn1B.js +0 -2770
- package/dist/index-BWb9vRCi.js +0 -29193
- package/dist/index-CpU9aqyW.js +0 -206
- package/dist/index-CqO_ZvtD.js +0 -99
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-DsNsA2uX.js +0 -298
- package/dist/index-WAMr3npT.js +0 -762
- package/dist/money-hdbrblud.js +0 -15
- package/dist/number-CRWGOZaW.js +0 -12
- package/dist/user-Bm4KttFq.js +0 -37
|
@@ -1,113 +1,131 @@
|
|
|
1
|
-
import { defineComponent as lt, ref as
|
|
1
|
+
import { defineComponent as lt, ref as ne, h as B, watch as ut, resolveComponent as Yt, openBlock as ie, createBlock as dt, unref as P, computed as Ve, onMounted as Xt, createElementBlock as $e, Fragment as Qt, createCommentVNode as He, createVNode as Zt, createElementVNode as en, nextTick as tn } from "vue";
|
|
2
2
|
import { useRouter as nn, useRoute as ht, RouterView as rn } from "vue-router";
|
|
3
3
|
import { useCoreStore as We, FeedMeAuth as sn } from "@feedmepos/mf-common";
|
|
4
4
|
import { u as on } from "./app-wDQR6dpb.js";
|
|
5
|
-
import { u as an } from "./business-
|
|
6
|
-
import "./index-
|
|
7
|
-
import { components as
|
|
8
|
-
import { u as un } from "./vue-i18n-
|
|
9
|
-
import { R as
|
|
5
|
+
import { u as an } from "./business-vzpvmTdG.js";
|
|
6
|
+
import "./index-BsRJ4kVb.js";
|
|
7
|
+
import { components as q, useSnackbar as cn, useDialog as ln } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as un } from "./vue-i18n-BG2U7GtN.js";
|
|
9
|
+
import { R as h } from "./app-D7C3Fxfi.js";
|
|
10
10
|
import { J as dn } from "./JsonViewer-v8_C7l5N.js";
|
|
11
|
-
import { r as ye, L as hn, g as ft, i as fn, a as pn, _ as je, C as Ge, b as mn, S as
|
|
11
|
+
import { r as ye, L as hn, g as ft, i as fn, a as pn, _ as je, C as Ge, b as mn, S as J, c as w, d as j, E as Se, e as gn, f as pt, h as _n, j as vn, k as mt, l as g, m as In, F as Re, n as Tn, q as Y, o as wn, p as yn, s as En, t as kn, u as bn } from "./index.esm2017-CE1CQHrP.js";
|
|
12
12
|
import { _ as Pe } from "./tslib.es6-BCqqvLQ_.js";
|
|
13
|
-
import { S as Be } from "./index-
|
|
14
|
-
|
|
13
|
+
import { S as Be, c as Sn } from "./index-BiIZ7X6d.js";
|
|
14
|
+
import { Y as Rn } from "./remy-vue-client-Cpppk9h-.js";
|
|
15
|
+
const Pn = /* @__PURE__ */ lt({
|
|
15
16
|
__name: "NavigationTab",
|
|
16
17
|
setup(n) {
|
|
17
|
-
const { t: e } = un(), t =
|
|
18
|
+
const { t: e } = un(), t = ne(), i = [
|
|
18
19
|
{
|
|
19
20
|
label: e("connect.navigation.analytic"),
|
|
20
|
-
value:
|
|
21
|
+
value: h["$connect-ANALYTIC"]
|
|
21
22
|
},
|
|
22
23
|
{
|
|
23
24
|
label: e("connect.navigation.campaign"),
|
|
24
|
-
value:
|
|
25
|
+
value: h["$connect-CAMPAIGN"],
|
|
25
26
|
children: [
|
|
26
27
|
{
|
|
27
28
|
label: e("connect.navigation.promotion"),
|
|
28
|
-
value:
|
|
29
|
+
value: h["$connect-CAMPAIGN_PROMOTION"]
|
|
29
30
|
},
|
|
30
31
|
{
|
|
31
32
|
label: e("connect.navigation.voucher"),
|
|
32
|
-
value:
|
|
33
|
+
value: h["$connect-CAMPAIGN_VOUCHER"]
|
|
33
34
|
},
|
|
34
35
|
{
|
|
35
36
|
label: e("connect.navigation.broadcast"),
|
|
36
|
-
value:
|
|
37
|
+
value: h["$connect-CAMPAIGN_BROADCAST"]
|
|
37
38
|
}
|
|
38
39
|
]
|
|
39
40
|
},
|
|
40
41
|
{
|
|
41
42
|
label: e("connect.navigation.program"),
|
|
42
|
-
value:
|
|
43
|
+
value: h["$connect-PROGRAM"],
|
|
43
44
|
children: [
|
|
44
45
|
{
|
|
45
46
|
label: e("connect.navigation.tier"),
|
|
46
|
-
value:
|
|
47
|
+
value: h["$connect-PROGRAM_TIER"]
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
50
|
label: e("connect.navigation.title"),
|
|
50
|
-
value:
|
|
51
|
+
value: h["$connect-PROGRAM_TITLE"]
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
54
|
label: e("connect.navigation.experience"),
|
|
54
|
-
value:
|
|
55
|
+
value: h["$connect-PROGRAM_EXPERIENCE"]
|
|
55
56
|
},
|
|
56
57
|
{
|
|
57
58
|
label: e("connect.navigation.point"),
|
|
58
|
-
value:
|
|
59
|
-
badge: () =>
|
|
59
|
+
value: h["$connect-PROGRAM_POINT"],
|
|
60
|
+
badge: () => B(q.FmPill, { variant: "premium" })
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
63
|
label: e("connect.navigation.credit"),
|
|
63
|
-
value:
|
|
64
|
+
value: h["$connect-PROGRAM_CREDIT"]
|
|
64
65
|
},
|
|
65
66
|
{
|
|
66
67
|
label: e("connect.navigation.game"),
|
|
67
|
-
value:
|
|
68
|
-
badge: () =>
|
|
68
|
+
value: h["$connect-PROGRAM_GAME"],
|
|
69
|
+
badge: () => B(q.FmPill, { variant: "premium" })
|
|
69
70
|
},
|
|
70
71
|
{
|
|
71
72
|
label: "Mission",
|
|
72
|
-
value:
|
|
73
|
+
value: h["$connect-PROGRAM_MISSION"]
|
|
73
74
|
}
|
|
74
75
|
]
|
|
75
76
|
},
|
|
76
77
|
{
|
|
77
78
|
label: e("connect.navigation.loyalty"),
|
|
78
|
-
value:
|
|
79
|
+
value: h["$connect-LOYALTY"],
|
|
79
80
|
children: [
|
|
80
81
|
{
|
|
81
82
|
label: e("connect.navigation.member"),
|
|
82
|
-
value:
|
|
83
|
+
value: h["$connect-LOYALTY_MEMBER_LIST"]
|
|
83
84
|
},
|
|
84
85
|
{
|
|
85
86
|
label: e("connect.navigation.segments"),
|
|
86
|
-
value:
|
|
87
|
-
badge: () =>
|
|
87
|
+
value: h["$connect-LOYALTY_SEGMENT"],
|
|
88
|
+
badge: () => B(q.FmPill, { variant: "premium" })
|
|
88
89
|
},
|
|
89
90
|
{
|
|
90
91
|
label: e("connect.navigation.card"),
|
|
91
|
-
value:
|
|
92
|
-
badge: () =>
|
|
92
|
+
value: h["$connect-LOYALTY_CARD"],
|
|
93
|
+
badge: () => B(q.FmPill, { variant: "premium" })
|
|
93
94
|
}
|
|
94
95
|
]
|
|
95
96
|
},
|
|
97
|
+
{
|
|
98
|
+
label: e("connect.navigation.referral"),
|
|
99
|
+
value: h["$connect-REFERRAL"],
|
|
100
|
+
badge: () => B(q.FmPill, { variant: "premium" })
|
|
101
|
+
},
|
|
96
102
|
{
|
|
97
103
|
label: e("connect.navigation.store"),
|
|
98
|
-
value:
|
|
104
|
+
value: h["$connect-STORE"]
|
|
99
105
|
},
|
|
100
106
|
{
|
|
101
107
|
label: e("connect.navigation.transaction"),
|
|
102
|
-
value:
|
|
108
|
+
value: h["$connect-TRANSACTION"]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
label: "Marketing material",
|
|
112
|
+
value: h["$connect-MARKETING"]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
label: e("connect.navigation.auditLogs"),
|
|
116
|
+
value: h["$connect-AUDIT_LOGS"]
|
|
103
117
|
},
|
|
104
|
-
// {
|
|
105
|
-
// label: 'Marketing material',
|
|
106
|
-
// value: ROUTE_NAME['$connect-MARKETING'],
|
|
107
|
-
// },
|
|
108
118
|
{
|
|
109
119
|
label: e("connect.navigation.setting"),
|
|
110
|
-
value:
|
|
120
|
+
value: h["$connect-SETTING"]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
label: e("connect.navigation.bin"),
|
|
124
|
+
value: h["$connect-BIN"]
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
label: e("connect.navigation.queue"),
|
|
128
|
+
value: h["$connect-QUEUE"]
|
|
111
129
|
}
|
|
112
130
|
], r = nn(), s = ht(), o = i.reduce((a, l) => [...(l.children ?? []).map((d) => d.value), ...a, l.value], []);
|
|
113
131
|
ut(
|
|
@@ -122,18 +140,18 @@ const bn = /* @__PURE__ */ lt({
|
|
|
122
140
|
await r.push({ name: a });
|
|
123
141
|
}
|
|
124
142
|
return (a, l) => {
|
|
125
|
-
var
|
|
143
|
+
var f;
|
|
126
144
|
const d = Yt("FmCollapsibleTabs");
|
|
127
|
-
return
|
|
145
|
+
return ie(), dt(d, {
|
|
128
146
|
class: "border-fm-color-neutral-gray-100 border-r py-16 px-4",
|
|
129
|
-
"model-value": (
|
|
147
|
+
"model-value": (f = P(t)) == null ? void 0 : f.toString(),
|
|
130
148
|
items: i,
|
|
131
149
|
"onUpdate:modelValue": c
|
|
132
150
|
}, null, 8, ["model-value"]);
|
|
133
151
|
};
|
|
134
152
|
}
|
|
135
153
|
});
|
|
136
|
-
var
|
|
154
|
+
var An = "firebase", Cn = "10.12.4";
|
|
137
155
|
/**
|
|
138
156
|
* @license
|
|
139
157
|
* Copyright 2020 Google LLC
|
|
@@ -150,13 +168,13 @@ var Rn = "firebase", Pn = "10.12.4";
|
|
|
150
168
|
* See the License for the specific language governing permissions and
|
|
151
169
|
* limitations under the License.
|
|
152
170
|
*/
|
|
153
|
-
ye(
|
|
171
|
+
ye(An, Cn, "app");
|
|
154
172
|
function gt() {
|
|
155
173
|
return {
|
|
156
174
|
"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."
|
|
157
175
|
};
|
|
158
176
|
}
|
|
159
|
-
const
|
|
177
|
+
const On = gt, _t = new Se("auth", "Firebase", gt());
|
|
160
178
|
/**
|
|
161
179
|
* @license
|
|
162
180
|
* Copyright 2020 Google LLC
|
|
@@ -173,12 +191,12 @@ const An = gt, _t = new be("auth", "Firebase", gt());
|
|
|
173
191
|
* See the License for the specific language governing permissions and
|
|
174
192
|
* limitations under the License.
|
|
175
193
|
*/
|
|
176
|
-
const
|
|
177
|
-
function
|
|
178
|
-
|
|
194
|
+
const ce = new hn("@firebase/auth");
|
|
195
|
+
function Nn(n, ...e) {
|
|
196
|
+
ce.logLevel <= mt.WARN && ce.warn(`Auth (${J}): ${n}`, ...e);
|
|
179
197
|
}
|
|
180
|
-
function
|
|
181
|
-
|
|
198
|
+
function re(n, ...e) {
|
|
199
|
+
ce.logLevel <= mt.ERROR && ce.error(`Auth (${J}): ${n}`, ...e);
|
|
182
200
|
}
|
|
183
201
|
/**
|
|
184
202
|
* @license
|
|
@@ -196,15 +214,15 @@ function ie(n, ...e) {
|
|
|
196
214
|
* See the License for the specific language governing permissions and
|
|
197
215
|
* limitations under the License.
|
|
198
216
|
*/
|
|
199
|
-
function
|
|
217
|
+
function b(n, ...e) {
|
|
200
218
|
throw Ae(n, ...e);
|
|
201
219
|
}
|
|
202
220
|
function I(n, ...e) {
|
|
203
221
|
return Ae(n, ...e);
|
|
204
222
|
}
|
|
205
223
|
function vt(n, e, t) {
|
|
206
|
-
const i = Object.assign(Object.assign({},
|
|
207
|
-
return new
|
|
224
|
+
const i = Object.assign(Object.assign({}, On()), { [e]: t });
|
|
225
|
+
return new Se("auth", "Firebase", i).create(e, {
|
|
208
226
|
appName: n.name
|
|
209
227
|
});
|
|
210
228
|
}
|
|
@@ -224,9 +242,9 @@ function u(n, e, ...t) {
|
|
|
224
242
|
}
|
|
225
243
|
function y(n) {
|
|
226
244
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
227
|
-
throw
|
|
245
|
+
throw re(e), new Error(e);
|
|
228
246
|
}
|
|
229
|
-
function
|
|
247
|
+
function S(n, e) {
|
|
230
248
|
n || y(e);
|
|
231
249
|
}
|
|
232
250
|
/**
|
|
@@ -249,7 +267,7 @@ function Ee() {
|
|
|
249
267
|
var n;
|
|
250
268
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
251
269
|
}
|
|
252
|
-
function
|
|
270
|
+
function Ln() {
|
|
253
271
|
return qe() === "http:" || qe() === "https:";
|
|
254
272
|
}
|
|
255
273
|
function qe() {
|
|
@@ -272,15 +290,15 @@ function qe() {
|
|
|
272
290
|
* See the License for the specific language governing permissions and
|
|
273
291
|
* limitations under the License.
|
|
274
292
|
*/
|
|
275
|
-
function
|
|
293
|
+
function Mn() {
|
|
276
294
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
277
295
|
// This is especially true for Cordova apps which have unreliable
|
|
278
296
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
279
297
|
// installed which overwrites the native navigator.onLine value and
|
|
280
298
|
// defines navigator.connection.
|
|
281
|
-
(
|
|
299
|
+
(Ln() || mn() || "connection" in navigator) ? navigator.onLine : !0;
|
|
282
300
|
}
|
|
283
|
-
function
|
|
301
|
+
function Un() {
|
|
284
302
|
if (typeof navigator > "u")
|
|
285
303
|
return null;
|
|
286
304
|
const n = navigator;
|
|
@@ -308,12 +326,12 @@ function Ln() {
|
|
|
308
326
|
* See the License for the specific language governing permissions and
|
|
309
327
|
* limitations under the License.
|
|
310
328
|
*/
|
|
311
|
-
class
|
|
329
|
+
class X {
|
|
312
330
|
constructor(e, t) {
|
|
313
|
-
this.shortDelay = e, this.longDelay = t,
|
|
331
|
+
this.shortDelay = e, this.longDelay = t, S(t > e, "Short delay should be less than long delay!"), this.isMobile = fn() || pn();
|
|
314
332
|
}
|
|
315
333
|
get() {
|
|
316
|
-
return
|
|
334
|
+
return Mn() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
317
335
|
}
|
|
318
336
|
}
|
|
319
337
|
/**
|
|
@@ -333,7 +351,7 @@ class J {
|
|
|
333
351
|
* limitations under the License.
|
|
334
352
|
*/
|
|
335
353
|
function Ce(n, e) {
|
|
336
|
-
|
|
354
|
+
S(n.emulator, "Emulator should always be set here");
|
|
337
355
|
const { url: t } = n.emulator;
|
|
338
356
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
339
357
|
}
|
|
@@ -407,7 +425,7 @@ class It {
|
|
|
407
425
|
* See the License for the specific language governing permissions and
|
|
408
426
|
* limitations under the License.
|
|
409
427
|
*/
|
|
410
|
-
const
|
|
428
|
+
const Dn = {
|
|
411
429
|
// Custom token errors.
|
|
412
430
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
413
431
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -498,8 +516,8 @@ const Mn = {
|
|
|
498
516
|
* See the License for the specific language governing permissions and
|
|
499
517
|
* limitations under the License.
|
|
500
518
|
*/
|
|
501
|
-
const
|
|
502
|
-
function
|
|
519
|
+
const Fn = new X(3e4, 6e4);
|
|
520
|
+
function fe(n, e) {
|
|
503
521
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
504
522
|
}
|
|
505
523
|
async function G(n, e, t, i, r = {}) {
|
|
@@ -508,7 +526,7 @@ async function G(n, e, t, i, r = {}) {
|
|
|
508
526
|
i && (e === "GET" ? o = i : s = {
|
|
509
527
|
body: JSON.stringify(i)
|
|
510
528
|
});
|
|
511
|
-
const c =
|
|
529
|
+
const c = Y(Object.assign({ key: n.config.apiKey }, o)).slice(1), a = await n._getAdditionalHeaders();
|
|
512
530
|
return a[
|
|
513
531
|
"Content-Type"
|
|
514
532
|
/* HttpHeader.CONTENT_TYPE */
|
|
@@ -524,40 +542,40 @@ async function G(n, e, t, i, r = {}) {
|
|
|
524
542
|
}
|
|
525
543
|
async function Tt(n, e, t) {
|
|
526
544
|
n._canInitEmulator = !1;
|
|
527
|
-
const i = Object.assign(Object.assign({},
|
|
545
|
+
const i = Object.assign(Object.assign({}, Dn), e);
|
|
528
546
|
try {
|
|
529
|
-
const r = new
|
|
547
|
+
const r = new xn(n), s = await Promise.race([
|
|
530
548
|
t(),
|
|
531
549
|
r.promise
|
|
532
550
|
]);
|
|
533
551
|
r.clearNetworkTimeout();
|
|
534
552
|
const o = await s.json();
|
|
535
553
|
if ("needConfirmation" in o)
|
|
536
|
-
throw
|
|
554
|
+
throw te(n, "account-exists-with-different-credential", o);
|
|
537
555
|
if (s.ok && !("errorMessage" in o))
|
|
538
556
|
return o;
|
|
539
557
|
{
|
|
540
558
|
const c = s.ok ? o.errorMessage : o.error.message, [a, l] = c.split(" : ");
|
|
541
559
|
if (a === "FEDERATED_USER_ID_ALREADY_LINKED")
|
|
542
|
-
throw
|
|
560
|
+
throw te(n, "credential-already-in-use", o);
|
|
543
561
|
if (a === "EMAIL_EXISTS")
|
|
544
|
-
throw
|
|
562
|
+
throw te(n, "email-already-in-use", o);
|
|
545
563
|
if (a === "USER_DISABLED")
|
|
546
|
-
throw
|
|
564
|
+
throw te(n, "user-disabled", o);
|
|
547
565
|
const d = i[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
|
548
566
|
if (l)
|
|
549
567
|
throw vt(n, d, l);
|
|
550
|
-
|
|
568
|
+
b(n, d);
|
|
551
569
|
}
|
|
552
570
|
} catch (r) {
|
|
553
571
|
if (r instanceof Re)
|
|
554
572
|
throw r;
|
|
555
|
-
|
|
573
|
+
b(n, "network-request-failed", { message: String(r) });
|
|
556
574
|
}
|
|
557
575
|
}
|
|
558
576
|
async function wt(n, e, t, i, r = {}) {
|
|
559
577
|
const s = await G(n, e, t, i, r);
|
|
560
|
-
return "mfaPendingCredential" in s &&
|
|
578
|
+
return "mfaPendingCredential" in s && b(n, "multi-factor-auth-required", {
|
|
561
579
|
_serverResponse: s
|
|
562
580
|
}), s;
|
|
563
581
|
}
|
|
@@ -565,21 +583,21 @@ function yt(n, e, t, i) {
|
|
|
565
583
|
const r = `${e}${t}?${i}`;
|
|
566
584
|
return n.config.emulator ? Ce(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
567
585
|
}
|
|
568
|
-
class
|
|
586
|
+
class xn {
|
|
569
587
|
constructor(e) {
|
|
570
588
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
571
589
|
this.timer = setTimeout(() => i(I(
|
|
572
590
|
this.auth,
|
|
573
591
|
"network-request-failed"
|
|
574
592
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
575
|
-
)),
|
|
593
|
+
)), Fn.get());
|
|
576
594
|
});
|
|
577
595
|
}
|
|
578
596
|
clearNetworkTimeout() {
|
|
579
597
|
clearTimeout(this.timer);
|
|
580
598
|
}
|
|
581
599
|
}
|
|
582
|
-
function
|
|
600
|
+
function te(n, e, t) {
|
|
583
601
|
const i = {
|
|
584
602
|
appName: n.name
|
|
585
603
|
};
|
|
@@ -603,7 +621,7 @@ function ee(n, e, t) {
|
|
|
603
621
|
* See the License for the specific language governing permissions and
|
|
604
622
|
* limitations under the License.
|
|
605
623
|
*/
|
|
606
|
-
async function
|
|
624
|
+
async function Vn(n, e) {
|
|
607
625
|
return G(n, "POST", "/v1/accounts:delete", e);
|
|
608
626
|
}
|
|
609
627
|
async function Et(n, e) {
|
|
@@ -625,7 +643,7 @@ async function Et(n, e) {
|
|
|
625
643
|
* See the License for the specific language governing permissions and
|
|
626
644
|
* limitations under the License.
|
|
627
645
|
*/
|
|
628
|
-
function
|
|
646
|
+
function z(n) {
|
|
629
647
|
if (n)
|
|
630
648
|
try {
|
|
631
649
|
const e = new Date(Number(n));
|
|
@@ -634,7 +652,7 @@ function B(n) {
|
|
|
634
652
|
} catch {
|
|
635
653
|
}
|
|
636
654
|
}
|
|
637
|
-
async function
|
|
655
|
+
async function $n(n, e = !1) {
|
|
638
656
|
const t = j(n), i = await t.getIdToken(e), r = Oe(i);
|
|
639
657
|
u(
|
|
640
658
|
r && r.exp && r.auth_time && r.iat,
|
|
@@ -646,9 +664,9 @@ async function xn(n, e = !1) {
|
|
|
646
664
|
return {
|
|
647
665
|
claims: r,
|
|
648
666
|
token: i,
|
|
649
|
-
authTime:
|
|
650
|
-
issuedAtTime:
|
|
651
|
-
expirationTime:
|
|
667
|
+
authTime: z(Te(r.auth_time)),
|
|
668
|
+
issuedAtTime: z(Te(r.iat)),
|
|
669
|
+
expirationTime: z(Te(r.exp)),
|
|
652
670
|
signInProvider: o || null,
|
|
653
671
|
signInSecondFactor: (s == null ? void 0 : s.sign_in_second_factor) || null
|
|
654
672
|
};
|
|
@@ -659,12 +677,12 @@ function Te(n) {
|
|
|
659
677
|
function Oe(n) {
|
|
660
678
|
const [e, t, i] = n.split(".");
|
|
661
679
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
662
|
-
return
|
|
680
|
+
return re("JWT malformed, contained fewer than 3 sections"), null;
|
|
663
681
|
try {
|
|
664
682
|
const r = Tn(t);
|
|
665
|
-
return r ? JSON.parse(r) : (
|
|
683
|
+
return r ? JSON.parse(r) : (re("Failed to decode base64 JWT payload"), null);
|
|
666
684
|
} catch (r) {
|
|
667
|
-
return
|
|
685
|
+
return re("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
668
686
|
}
|
|
669
687
|
}
|
|
670
688
|
function ze(n) {
|
|
@@ -699,16 +717,16 @@ function ze(n) {
|
|
|
699
717
|
* See the License for the specific language governing permissions and
|
|
700
718
|
* limitations under the License.
|
|
701
719
|
*/
|
|
702
|
-
async function
|
|
720
|
+
async function K(n, e, t = !1) {
|
|
703
721
|
if (t)
|
|
704
722
|
return e;
|
|
705
723
|
try {
|
|
706
724
|
return await e;
|
|
707
725
|
} catch (i) {
|
|
708
|
-
throw i instanceof Re &&
|
|
726
|
+
throw i instanceof Re && Hn(i) && n.auth.currentUser === n && await n.auth.signOut(), i;
|
|
709
727
|
}
|
|
710
728
|
}
|
|
711
|
-
function
|
|
729
|
+
function Hn({ code: n }) {
|
|
712
730
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
713
731
|
}
|
|
714
732
|
/**
|
|
@@ -727,7 +745,7 @@ function Vn({ code: n }) {
|
|
|
727
745
|
* See the License for the specific language governing permissions and
|
|
728
746
|
* limitations under the License.
|
|
729
747
|
*/
|
|
730
|
-
class
|
|
748
|
+
class Wn {
|
|
731
749
|
constructor(e) {
|
|
732
750
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
733
751
|
}
|
|
@@ -794,7 +812,7 @@ class ke {
|
|
|
794
812
|
this.createdAt = e, this.lastLoginAt = t, this._initializeTime();
|
|
795
813
|
}
|
|
796
814
|
_initializeTime() {
|
|
797
|
-
this.lastSignInTime =
|
|
815
|
+
this.lastSignInTime = z(this.lastLoginAt), this.creationTime = z(this.createdAt);
|
|
798
816
|
}
|
|
799
817
|
_copy(e) {
|
|
800
818
|
this.createdAt = e.createdAt, this.lastLoginAt = e.lastLoginAt, this._initializeTime();
|
|
@@ -822,9 +840,9 @@ class ke {
|
|
|
822
840
|
* See the License for the specific language governing permissions and
|
|
823
841
|
* limitations under the License.
|
|
824
842
|
*/
|
|
825
|
-
async function
|
|
843
|
+
async function le(n) {
|
|
826
844
|
var e;
|
|
827
|
-
const t = n.auth, i = await n.getIdToken(), r = await
|
|
845
|
+
const t = n.auth, i = await n.getIdToken(), r = await K(n, Et(t, { idToken: i }));
|
|
828
846
|
u(
|
|
829
847
|
r == null ? void 0 : r.users.length,
|
|
830
848
|
t,
|
|
@@ -833,7 +851,7 @@ async function ce(n) {
|
|
|
833
851
|
);
|
|
834
852
|
const s = r.users[0];
|
|
835
853
|
n._notifyReloadListener(s);
|
|
836
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? kt(s.providerUserInfo) : [], c =
|
|
854
|
+
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? kt(s.providerUserInfo) : [], c = Gn(n.providerData, o), a = n.isAnonymous, l = !(n.email && s.passwordHash) && !(c != null && c.length), d = a ? l : !1, f = {
|
|
837
855
|
uid: s.localId,
|
|
838
856
|
displayName: s.displayName || null,
|
|
839
857
|
photoURL: s.photoUrl || null,
|
|
@@ -845,13 +863,13 @@ async function ce(n) {
|
|
|
845
863
|
metadata: new ke(s.createdAt, s.lastLoginAt),
|
|
846
864
|
isAnonymous: d
|
|
847
865
|
};
|
|
848
|
-
Object.assign(n,
|
|
866
|
+
Object.assign(n, f);
|
|
849
867
|
}
|
|
850
|
-
async function
|
|
868
|
+
async function jn(n) {
|
|
851
869
|
const e = j(n);
|
|
852
|
-
await
|
|
870
|
+
await le(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
853
871
|
}
|
|
854
|
-
function
|
|
872
|
+
function Gn(n, e) {
|
|
855
873
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
856
874
|
}
|
|
857
875
|
function kt(n) {
|
|
@@ -883,9 +901,9 @@ function kt(n) {
|
|
|
883
901
|
* See the License for the specific language governing permissions and
|
|
884
902
|
* limitations under the License.
|
|
885
903
|
*/
|
|
886
|
-
async function
|
|
904
|
+
async function Bn(n, e) {
|
|
887
905
|
const t = await Tt(n, {}, async () => {
|
|
888
|
-
const i =
|
|
906
|
+
const i = Y({
|
|
889
907
|
grant_type: "refresh_token",
|
|
890
908
|
refresh_token: e
|
|
891
909
|
}).slice(1), { tokenApiHost: r, apiKey: s } = n.config, o = yt(n, r, "/v1/token", `key=${s}`), c = await n._getAdditionalHeaders();
|
|
@@ -904,8 +922,8 @@ async function jn(n, e) {
|
|
|
904
922
|
refreshToken: t.refresh_token
|
|
905
923
|
};
|
|
906
924
|
}
|
|
907
|
-
async function
|
|
908
|
-
return G(n, "POST", "/v2/accounts:revokeToken",
|
|
925
|
+
async function qn(n, e) {
|
|
926
|
+
return G(n, "POST", "/v2/accounts:revokeToken", fe(n, e));
|
|
909
927
|
}
|
|
910
928
|
/**
|
|
911
929
|
* @license
|
|
@@ -923,7 +941,7 @@ async function Gn(n, e) {
|
|
|
923
941
|
* See the License for the specific language governing permissions and
|
|
924
942
|
* limitations under the License.
|
|
925
943
|
*/
|
|
926
|
-
class
|
|
944
|
+
class $ {
|
|
927
945
|
constructor() {
|
|
928
946
|
this.refreshToken = null, this.accessToken = null, this.expirationTime = null;
|
|
929
947
|
}
|
|
@@ -968,14 +986,14 @@ class H {
|
|
|
968
986
|
this.refreshToken = null;
|
|
969
987
|
}
|
|
970
988
|
async refresh(e, t) {
|
|
971
|
-
const { accessToken: i, refreshToken: r, expiresIn: s } = await
|
|
989
|
+
const { accessToken: i, refreshToken: r, expiresIn: s } = await Bn(e, t);
|
|
972
990
|
this.updateTokensAndExpiration(i, r, Number(s));
|
|
973
991
|
}
|
|
974
992
|
updateTokensAndExpiration(e, t, i) {
|
|
975
993
|
this.refreshToken = t || null, this.accessToken = e || null, this.expirationTime = Date.now() + i * 1e3;
|
|
976
994
|
}
|
|
977
995
|
static fromJSON(e, t) {
|
|
978
|
-
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new
|
|
996
|
+
const { refreshToken: i, accessToken: r, expirationTime: s } = t, o = new $();
|
|
979
997
|
return i && (u(typeof i == "string", "internal-error", {
|
|
980
998
|
appName: e
|
|
981
999
|
}), o.refreshToken = i), r && (u(typeof r == "string", "internal-error", {
|
|
@@ -995,7 +1013,7 @@ class H {
|
|
|
995
1013
|
this.accessToken = e.accessToken, this.refreshToken = e.refreshToken, this.expirationTime = e.expirationTime;
|
|
996
1014
|
}
|
|
997
1015
|
_clone() {
|
|
998
|
-
return Object.assign(new
|
|
1016
|
+
return Object.assign(new $(), this.toJSON());
|
|
999
1017
|
}
|
|
1000
1018
|
_performRefresh() {
|
|
1001
1019
|
return y("not implemented");
|
|
@@ -1023,10 +1041,10 @@ function R(n, e) {
|
|
|
1023
1041
|
class E {
|
|
1024
1042
|
constructor(e) {
|
|
1025
1043
|
var { uid: t, auth: i, stsTokenManager: r } = e, s = Pe(e, ["uid", "auth", "stsTokenManager"]);
|
|
1026
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
1044
|
+
this.providerId = "firebase", this.proactiveRefresh = new Wn(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 ke(s.createdAt || void 0, s.lastLoginAt || void 0);
|
|
1027
1045
|
}
|
|
1028
1046
|
async getIdToken(e) {
|
|
1029
|
-
const t = await
|
|
1047
|
+
const t = await K(this, this.stsTokenManager.getToken(this.auth, e));
|
|
1030
1048
|
return u(
|
|
1031
1049
|
t,
|
|
1032
1050
|
this.auth,
|
|
@@ -1035,10 +1053,10 @@ class E {
|
|
|
1035
1053
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
1036
1054
|
}
|
|
1037
1055
|
getIdTokenResult(e) {
|
|
1038
|
-
return
|
|
1056
|
+
return $n(this, e);
|
|
1039
1057
|
}
|
|
1040
1058
|
reload() {
|
|
1041
|
-
return
|
|
1059
|
+
return jn(this);
|
|
1042
1060
|
}
|
|
1043
1061
|
_assign(e) {
|
|
1044
1062
|
this !== e && (u(
|
|
@@ -1071,13 +1089,13 @@ class E {
|
|
|
1071
1089
|
}
|
|
1072
1090
|
async _updateTokensIfNecessary(e, t = !1) {
|
|
1073
1091
|
let i = !1;
|
|
1074
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await
|
|
1092
|
+
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);
|
|
1075
1093
|
}
|
|
1076
1094
|
async delete() {
|
|
1077
1095
|
if (w(this.auth.app))
|
|
1078
1096
|
return Promise.reject(L(this.auth));
|
|
1079
1097
|
const e = await this.getIdToken();
|
|
1080
|
-
return await
|
|
1098
|
+
return await K(this, Vn(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
1081
1099
|
}
|
|
1082
1100
|
toJSON() {
|
|
1083
1101
|
return Object.assign(Object.assign({
|
|
@@ -1105,20 +1123,20 @@ class E {
|
|
|
1105
1123
|
}
|
|
1106
1124
|
static _fromJSON(e, t) {
|
|
1107
1125
|
var i, r, s, o, c, a, l, d;
|
|
1108
|
-
const
|
|
1126
|
+
const f = (i = t.displayName) !== null && i !== void 0 ? i : void 0, _ = (r = t.email) !== null && r !== void 0 ? r : void 0, x = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, M = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, ee = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, p = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, m = (l = t.createdAt) !== null && l !== void 0 ? l : void 0, v = (d = t.lastLoginAt) !== null && d !== void 0 ? d : void 0, { uid: U, emailVerified: De, isAnonymous: Fe, providerData: ve, stsTokenManager: xe } = t;
|
|
1109
1127
|
u(
|
|
1110
|
-
|
|
1128
|
+
U && xe,
|
|
1111
1129
|
e,
|
|
1112
1130
|
"internal-error"
|
|
1113
1131
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1114
1132
|
);
|
|
1115
|
-
const Kt =
|
|
1133
|
+
const Kt = $.fromJSON(this.name, xe);
|
|
1116
1134
|
u(
|
|
1117
|
-
typeof
|
|
1135
|
+
typeof U == "string",
|
|
1118
1136
|
e,
|
|
1119
1137
|
"internal-error"
|
|
1120
1138
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1121
|
-
), R(
|
|
1139
|
+
), R(f, e.name), R(_, e.name), u(
|
|
1122
1140
|
typeof De == "boolean",
|
|
1123
1141
|
e,
|
|
1124
1142
|
"internal-error"
|
|
@@ -1128,22 +1146,22 @@ class E {
|
|
|
1128
1146
|
e,
|
|
1129
1147
|
"internal-error"
|
|
1130
1148
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1131
|
-
), R(
|
|
1149
|
+
), R(x, e.name), R(M, e.name), R(ee, e.name), R(p, e.name), R(m, e.name), R(v, e.name);
|
|
1132
1150
|
const Ie = new E({
|
|
1133
|
-
uid:
|
|
1151
|
+
uid: U,
|
|
1134
1152
|
auth: e,
|
|
1135
1153
|
email: _,
|
|
1136
1154
|
emailVerified: De,
|
|
1137
|
-
displayName:
|
|
1155
|
+
displayName: f,
|
|
1138
1156
|
isAnonymous: Fe,
|
|
1139
1157
|
photoURL: M,
|
|
1140
|
-
phoneNumber:
|
|
1141
|
-
tenantId:
|
|
1158
|
+
phoneNumber: x,
|
|
1159
|
+
tenantId: ee,
|
|
1142
1160
|
stsTokenManager: Kt,
|
|
1143
|
-
createdAt:
|
|
1144
|
-
lastLoginAt:
|
|
1161
|
+
createdAt: m,
|
|
1162
|
+
lastLoginAt: v
|
|
1145
1163
|
});
|
|
1146
|
-
return ve && Array.isArray(ve) && (Ie.providerData = ve.map((Jt) => Object.assign({}, Jt))),
|
|
1164
|
+
return ve && Array.isArray(ve) && (Ie.providerData = ve.map((Jt) => Object.assign({}, Jt))), p && (Ie._redirectEventId = p), Ie;
|
|
1147
1165
|
}
|
|
1148
1166
|
/**
|
|
1149
1167
|
* Initialize a User from an idToken server response
|
|
@@ -1151,7 +1169,7 @@ class E {
|
|
|
1151
1169
|
* @param idTokenResponse
|
|
1152
1170
|
*/
|
|
1153
1171
|
static async _fromIdTokenResponse(e, t, i = !1) {
|
|
1154
|
-
const r = new
|
|
1172
|
+
const r = new $();
|
|
1155
1173
|
r.updateFromServerResponse(t);
|
|
1156
1174
|
const s = new E({
|
|
1157
1175
|
uid: t.localId,
|
|
@@ -1159,7 +1177,7 @@ class E {
|
|
|
1159
1177
|
stsTokenManager: r,
|
|
1160
1178
|
isAnonymous: i
|
|
1161
1179
|
});
|
|
1162
|
-
return await
|
|
1180
|
+
return await le(s), s;
|
|
1163
1181
|
}
|
|
1164
1182
|
/**
|
|
1165
1183
|
* Initialize a User from an idToken server response
|
|
@@ -1173,7 +1191,7 @@ class E {
|
|
|
1173
1191
|
"internal-error"
|
|
1174
1192
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1175
1193
|
);
|
|
1176
|
-
const s = r.providerUserInfo !== void 0 ? kt(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new
|
|
1194
|
+
const s = r.providerUserInfo !== void 0 ? kt(r.providerUserInfo) : [], o = !(r.email && r.passwordHash) && !(s != null && s.length), c = new $();
|
|
1177
1195
|
c.updateFromIdToken(i);
|
|
1178
1196
|
const a = new E({
|
|
1179
1197
|
uid: r.localId,
|
|
@@ -1213,9 +1231,9 @@ class E {
|
|
|
1213
1231
|
*/
|
|
1214
1232
|
const Ke = /* @__PURE__ */ new Map();
|
|
1215
1233
|
function k(n) {
|
|
1216
|
-
|
|
1234
|
+
S(n instanceof Function, "Expected a class definition");
|
|
1217
1235
|
let e = Ke.get(n);
|
|
1218
|
-
return e ? (
|
|
1236
|
+
return e ? (S(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), Ke.set(n, e), e);
|
|
1219
1237
|
}
|
|
1220
1238
|
/**
|
|
1221
1239
|
* @license
|
|
@@ -1233,7 +1251,7 @@ function k(n) {
|
|
|
1233
1251
|
* See the License for the specific language governing permissions and
|
|
1234
1252
|
* limitations under the License.
|
|
1235
1253
|
*/
|
|
1236
|
-
class
|
|
1254
|
+
class bt {
|
|
1237
1255
|
constructor() {
|
|
1238
1256
|
this.type = "NONE", this.storage = {};
|
|
1239
1257
|
}
|
|
@@ -1255,8 +1273,8 @@ class St {
|
|
|
1255
1273
|
_removeListener(e, t) {
|
|
1256
1274
|
}
|
|
1257
1275
|
}
|
|
1258
|
-
|
|
1259
|
-
const Je =
|
|
1276
|
+
bt.type = "NONE";
|
|
1277
|
+
const Je = bt;
|
|
1260
1278
|
/**
|
|
1261
1279
|
* @license
|
|
1262
1280
|
* Copyright 2019 Google LLC
|
|
@@ -1273,14 +1291,14 @@ const Je = St;
|
|
|
1273
1291
|
* See the License for the specific language governing permissions and
|
|
1274
1292
|
* limitations under the License.
|
|
1275
1293
|
*/
|
|
1276
|
-
function
|
|
1294
|
+
function se(n, e, t) {
|
|
1277
1295
|
return `firebase:${n}:${e}:${t}`;
|
|
1278
1296
|
}
|
|
1279
|
-
class
|
|
1297
|
+
class H {
|
|
1280
1298
|
constructor(e, t, i) {
|
|
1281
1299
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1282
1300
|
const { config: r, name: s } = this.auth;
|
|
1283
|
-
this.fullUserKey =
|
|
1301
|
+
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);
|
|
1284
1302
|
}
|
|
1285
1303
|
setCurrentUser(e) {
|
|
1286
1304
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
|
@@ -1307,32 +1325,32 @@ class $ {
|
|
|
1307
1325
|
}
|
|
1308
1326
|
static async create(e, t, i = "authUser") {
|
|
1309
1327
|
if (!t.length)
|
|
1310
|
-
return new
|
|
1328
|
+
return new H(k(Je), e, i);
|
|
1311
1329
|
const r = (await Promise.all(t.map(async (l) => {
|
|
1312
1330
|
if (await l._isAvailable())
|
|
1313
1331
|
return l;
|
|
1314
1332
|
}))).filter((l) => l);
|
|
1315
1333
|
let s = r[0] || k(Je);
|
|
1316
|
-
const o =
|
|
1334
|
+
const o = se(i, e.config.apiKey, e.name);
|
|
1317
1335
|
let c = null;
|
|
1318
1336
|
for (const l of t)
|
|
1319
1337
|
try {
|
|
1320
1338
|
const d = await l._get(o);
|
|
1321
1339
|
if (d) {
|
|
1322
|
-
const
|
|
1323
|
-
l !== s && (c =
|
|
1340
|
+
const f = E._fromJSON(e, d);
|
|
1341
|
+
l !== s && (c = f), s = l;
|
|
1324
1342
|
break;
|
|
1325
1343
|
}
|
|
1326
1344
|
} catch {
|
|
1327
1345
|
}
|
|
1328
1346
|
const a = r.filter((l) => l._shouldAllowMigration);
|
|
1329
|
-
return !s._shouldAllowMigration || !a.length ? new
|
|
1347
|
+
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) => {
|
|
1330
1348
|
if (l !== s)
|
|
1331
1349
|
try {
|
|
1332
1350
|
await l._remove(o);
|
|
1333
1351
|
} catch {
|
|
1334
1352
|
}
|
|
1335
|
-
})), new
|
|
1353
|
+
})), new H(s, e, i));
|
|
1336
1354
|
}
|
|
1337
1355
|
}
|
|
1338
1356
|
/**
|
|
@@ -1361,7 +1379,7 @@ function Ye(n) {
|
|
|
1361
1379
|
return "IE";
|
|
1362
1380
|
if (e.includes("edge/"))
|
|
1363
1381
|
return "Edge";
|
|
1364
|
-
if (
|
|
1382
|
+
if (St(e))
|
|
1365
1383
|
return "Firefox";
|
|
1366
1384
|
if (e.includes("silk/"))
|
|
1367
1385
|
return "Silk";
|
|
@@ -1382,7 +1400,7 @@ function Ye(n) {
|
|
|
1382
1400
|
}
|
|
1383
1401
|
return "Other";
|
|
1384
1402
|
}
|
|
1385
|
-
function
|
|
1403
|
+
function St(n = g()) {
|
|
1386
1404
|
return /firefox\//i.test(n);
|
|
1387
1405
|
}
|
|
1388
1406
|
function Ne(n = g()) {
|
|
@@ -1404,20 +1422,20 @@ function Ct(n = g()) {
|
|
|
1404
1422
|
function Ot(n = g()) {
|
|
1405
1423
|
return /webos/i.test(n);
|
|
1406
1424
|
}
|
|
1407
|
-
function
|
|
1425
|
+
function pe(n = g()) {
|
|
1408
1426
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1409
1427
|
}
|
|
1410
|
-
function
|
|
1428
|
+
function zn(n = g()) {
|
|
1411
1429
|
var e;
|
|
1412
|
-
return
|
|
1430
|
+
return pe(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1413
1431
|
}
|
|
1414
|
-
function
|
|
1432
|
+
function Kn() {
|
|
1415
1433
|
return wn() && document.documentMode === 10;
|
|
1416
1434
|
}
|
|
1417
1435
|
function Nt(n = g()) {
|
|
1418
|
-
return
|
|
1436
|
+
return pe(n) || At(n) || Ot(n) || Ct(n) || /windows phone/i.test(n) || Pt(n);
|
|
1419
1437
|
}
|
|
1420
|
-
function
|
|
1438
|
+
function Jn() {
|
|
1421
1439
|
try {
|
|
1422
1440
|
return !!(window && window !== window.top);
|
|
1423
1441
|
} catch {
|
|
@@ -1453,7 +1471,7 @@ function Lt(n, e = []) {
|
|
|
1453
1471
|
t = n;
|
|
1454
1472
|
}
|
|
1455
1473
|
const i = e.length ? e.join(",") : "FirebaseCore-web";
|
|
1456
|
-
return `${t}/JsCore/${
|
|
1474
|
+
return `${t}/JsCore/${J}/${i}`;
|
|
1457
1475
|
}
|
|
1458
1476
|
/**
|
|
1459
1477
|
* @license
|
|
@@ -1471,7 +1489,7 @@ function Lt(n, e = []) {
|
|
|
1471
1489
|
* See the License for the specific language governing permissions and
|
|
1472
1490
|
* limitations under the License.
|
|
1473
1491
|
*/
|
|
1474
|
-
class
|
|
1492
|
+
class Yn {
|
|
1475
1493
|
constructor(e) {
|
|
1476
1494
|
this.auth = e, this.queue = [];
|
|
1477
1495
|
}
|
|
@@ -1526,8 +1544,8 @@ class Kn {
|
|
|
1526
1544
|
* See the License for the specific language governing permissions and
|
|
1527
1545
|
* limitations under the License.
|
|
1528
1546
|
*/
|
|
1529
|
-
async function
|
|
1530
|
-
return G(n, "GET", "/v2/passwordPolicy",
|
|
1547
|
+
async function Xn(n, e = {}) {
|
|
1548
|
+
return G(n, "GET", "/v2/passwordPolicy", fe(n, e));
|
|
1531
1549
|
}
|
|
1532
1550
|
/**
|
|
1533
1551
|
* @license
|
|
@@ -1545,12 +1563,12 @@ async function Jn(n, e = {}) {
|
|
|
1545
1563
|
* See the License for the specific language governing permissions and
|
|
1546
1564
|
* limitations under the License.
|
|
1547
1565
|
*/
|
|
1548
|
-
const
|
|
1549
|
-
class
|
|
1566
|
+
const Qn = 6;
|
|
1567
|
+
class Zn {
|
|
1550
1568
|
constructor(e) {
|
|
1551
1569
|
var t, i, r, s;
|
|
1552
1570
|
const o = e.customStrengthOptions;
|
|
1553
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
|
1571
|
+
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t : Qn, 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;
|
|
1554
1572
|
}
|
|
1555
1573
|
validatePassword(e) {
|
|
1556
1574
|
var t, i, r, s, o, c;
|
|
@@ -1633,14 +1651,14 @@ class Xn {
|
|
|
1633
1651
|
* See the License for the specific language governing permissions and
|
|
1634
1652
|
* limitations under the License.
|
|
1635
1653
|
*/
|
|
1636
|
-
class
|
|
1654
|
+
class ei {
|
|
1637
1655
|
constructor(e, t, i, r) {
|
|
1638
|
-
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 Xe(this), this.idTokenSubscription = new Xe(this), this.beforeStateQueue = new
|
|
1656
|
+
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 Xe(this), this.idTokenSubscription = new Xe(this), this.beforeStateQueue = new Yn(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 = _t, 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;
|
|
1639
1657
|
}
|
|
1640
1658
|
_initializeWithPersistence(e, t) {
|
|
1641
1659
|
return t && (this._popupRedirectResolver = k(t)), this._initializationPromise = this.queue(async () => {
|
|
1642
1660
|
var i, r;
|
|
1643
|
-
if (!this._deleted && (this.persistenceManager = await
|
|
1661
|
+
if (!this._deleted && (this.persistenceManager = await H.create(this, e), !this._deleted)) {
|
|
1644
1662
|
if (!((i = this._popupRedirectResolver) === null || i === void 0) && i._shouldInitProactively)
|
|
1645
1663
|
try {
|
|
1646
1664
|
await this._popupRedirectResolver._initialize(this);
|
|
@@ -1721,7 +1739,7 @@ class Qn {
|
|
|
1721
1739
|
}
|
|
1722
1740
|
async reloadAndSetCurrentUserOrClear(e) {
|
|
1723
1741
|
try {
|
|
1724
|
-
await
|
|
1742
|
+
await le(e);
|
|
1725
1743
|
} catch (t) {
|
|
1726
1744
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
|
1727
1745
|
return this.directlySetCurrentUser(null);
|
|
@@ -1729,7 +1747,7 @@ class Qn {
|
|
|
1729
1747
|
return this.directlySetCurrentUser(e);
|
|
1730
1748
|
}
|
|
1731
1749
|
useDeviceLanguage() {
|
|
1732
|
-
this.languageCode =
|
|
1750
|
+
this.languageCode = Un();
|
|
1733
1751
|
}
|
|
1734
1752
|
async _delete() {
|
|
1735
1753
|
this._deleted = !0;
|
|
@@ -1780,14 +1798,14 @@ class Qn {
|
|
|
1780
1798
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
1781
1799
|
}
|
|
1782
1800
|
async _updatePasswordPolicy() {
|
|
1783
|
-
const e = await
|
|
1801
|
+
const e = await Xn(this), t = new Zn(e);
|
|
1784
1802
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
1785
1803
|
}
|
|
1786
1804
|
_getPersistence() {
|
|
1787
1805
|
return this.assertedPersistence.persistence.type;
|
|
1788
1806
|
}
|
|
1789
1807
|
_updateErrorMap(e) {
|
|
1790
|
-
this._errorFactory = new
|
|
1808
|
+
this._errorFactory = new Se("auth", "Firebase", e());
|
|
1791
1809
|
}
|
|
1792
1810
|
onAuthStateChanged(e, t, i) {
|
|
1793
1811
|
return this.registerStateListener(this.authStateSubscription, e, t, i);
|
|
@@ -1820,7 +1838,7 @@ class Qn {
|
|
|
1820
1838
|
token: e,
|
|
1821
1839
|
idToken: t
|
|
1822
1840
|
};
|
|
1823
|
-
this.tenantId != null && (i.tenantId = this.tenantId), await
|
|
1841
|
+
this.tenantId != null && (i.tenantId = this.tenantId), await qn(this, i);
|
|
1824
1842
|
}
|
|
1825
1843
|
}
|
|
1826
1844
|
toJSON() {
|
|
@@ -1844,7 +1862,7 @@ class Qn {
|
|
|
1844
1862
|
this,
|
|
1845
1863
|
"argument-error"
|
|
1846
1864
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
1847
|
-
), this.redirectPersistenceManager = await
|
|
1865
|
+
), this.redirectPersistenceManager = await H.create(
|
|
1848
1866
|
this,
|
|
1849
1867
|
[k(t._redirectPersistence)],
|
|
1850
1868
|
"redirectUser"
|
|
@@ -1963,10 +1981,10 @@ class Qn {
|
|
|
1963
1981
|
async _getAppCheckToken() {
|
|
1964
1982
|
var e;
|
|
1965
1983
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
1966
|
-
return t != null && t.error &&
|
|
1984
|
+
return t != null && t.error && Nn(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
1967
1985
|
}
|
|
1968
1986
|
}
|
|
1969
|
-
function
|
|
1987
|
+
function me(n) {
|
|
1970
1988
|
return j(n);
|
|
1971
1989
|
}
|
|
1972
1990
|
class Xe {
|
|
@@ -2006,16 +2024,16 @@ let Le = {
|
|
|
2006
2024
|
recaptchaEnterpriseScript: "",
|
|
2007
2025
|
gapiScript: ""
|
|
2008
2026
|
};
|
|
2009
|
-
function
|
|
2027
|
+
function ti(n) {
|
|
2010
2028
|
Le = n;
|
|
2011
2029
|
}
|
|
2012
|
-
function
|
|
2030
|
+
function ni(n) {
|
|
2013
2031
|
return Le.loadJS(n);
|
|
2014
2032
|
}
|
|
2015
|
-
function
|
|
2033
|
+
function ii() {
|
|
2016
2034
|
return Le.gapiScript;
|
|
2017
2035
|
}
|
|
2018
|
-
function
|
|
2036
|
+
function ri(n) {
|
|
2019
2037
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
2020
2038
|
}
|
|
2021
2039
|
/**
|
|
@@ -2034,13 +2052,13 @@ function ni(n) {
|
|
|
2034
2052
|
* See the License for the specific language governing permissions and
|
|
2035
2053
|
* limitations under the License.
|
|
2036
2054
|
*/
|
|
2037
|
-
function
|
|
2055
|
+
function si(n, e) {
|
|
2038
2056
|
const t = pt(n, "auth");
|
|
2039
2057
|
if (t.isInitialized()) {
|
|
2040
2058
|
const r = t.getImmediate(), s = t.getOptions();
|
|
2041
2059
|
if (In(s, e ?? {}))
|
|
2042
2060
|
return r;
|
|
2043
|
-
|
|
2061
|
+
b(
|
|
2044
2062
|
r,
|
|
2045
2063
|
"already-initialized"
|
|
2046
2064
|
/* AuthErrorCode.ALREADY_INITIALIZED */
|
|
@@ -2048,12 +2066,12 @@ function ii(n, e) {
|
|
|
2048
2066
|
}
|
|
2049
2067
|
return t.initialize({ options: e });
|
|
2050
2068
|
}
|
|
2051
|
-
function
|
|
2069
|
+
function oi(n, e) {
|
|
2052
2070
|
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(k);
|
|
2053
2071
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2054
2072
|
}
|
|
2055
|
-
function
|
|
2056
|
-
const i =
|
|
2073
|
+
function ai(n, e, t) {
|
|
2074
|
+
const i = me(n);
|
|
2057
2075
|
u(
|
|
2058
2076
|
i._canInitEmulator,
|
|
2059
2077
|
i,
|
|
@@ -2065,19 +2083,19 @@ function si(n, e, t) {
|
|
|
2065
2083
|
"invalid-emulator-scheme"
|
|
2066
2084
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
2067
2085
|
);
|
|
2068
|
-
const r = !1, s = Mt(e), { host: o, port: c } =
|
|
2086
|
+
const r = !1, s = Mt(e), { host: o, port: c } = ci(e), a = c === null ? "" : `:${c}`;
|
|
2069
2087
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
2070
2088
|
host: o,
|
|
2071
2089
|
port: c,
|
|
2072
2090
|
protocol: s.replace(":", ""),
|
|
2073
2091
|
options: Object.freeze({ disableWarnings: r })
|
|
2074
|
-
}),
|
|
2092
|
+
}), li();
|
|
2075
2093
|
}
|
|
2076
2094
|
function Mt(n) {
|
|
2077
2095
|
const e = n.indexOf(":");
|
|
2078
2096
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
2079
2097
|
}
|
|
2080
|
-
function
|
|
2098
|
+
function ci(n) {
|
|
2081
2099
|
const e = Mt(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
2082
2100
|
if (!t)
|
|
2083
2101
|
return { host: "", port: null };
|
|
@@ -2096,7 +2114,7 @@ function Qe(n) {
|
|
|
2096
2114
|
const e = Number(n);
|
|
2097
2115
|
return isNaN(e) ? null : e;
|
|
2098
2116
|
}
|
|
2099
|
-
function
|
|
2117
|
+
function li() {
|
|
2100
2118
|
function n() {
|
|
2101
2119
|
const e = document.createElement("p"), t = e.style;
|
|
2102
2120
|
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);
|
|
@@ -2162,7 +2180,7 @@ class Ut {
|
|
|
2162
2180
|
* limitations under the License.
|
|
2163
2181
|
*/
|
|
2164
2182
|
async function W(n, e) {
|
|
2165
|
-
return wt(n, "POST", "/v1/accounts:signInWithIdp",
|
|
2183
|
+
return wt(n, "POST", "/v1/accounts:signInWithIdp", fe(n, e));
|
|
2166
2184
|
}
|
|
2167
2185
|
/**
|
|
2168
2186
|
* @license
|
|
@@ -2180,15 +2198,15 @@ async function W(n, e) {
|
|
|
2180
2198
|
* See the License for the specific language governing permissions and
|
|
2181
2199
|
* limitations under the License.
|
|
2182
2200
|
*/
|
|
2183
|
-
const
|
|
2184
|
-
class
|
|
2201
|
+
const ui = "http://localhost";
|
|
2202
|
+
class D extends Ut {
|
|
2185
2203
|
constructor() {
|
|
2186
2204
|
super(...arguments), this.pendingToken = null;
|
|
2187
2205
|
}
|
|
2188
2206
|
/** @internal */
|
|
2189
2207
|
static _fromParams(e) {
|
|
2190
|
-
const t = new
|
|
2191
|
-
return e.idToken || e.accessToken ? (e.idToken && (t.idToken = e.idToken), e.accessToken && (t.accessToken = e.accessToken), e.nonce && !e.pendingToken && (t.nonce = e.nonce), e.pendingToken && (t.pendingToken = e.pendingToken)) : e.oauthToken && e.oauthTokenSecret ? (t.accessToken = e.oauthToken, t.secret = e.oauthTokenSecret) :
|
|
2208
|
+
const t = new D(e.providerId, e.signInMethod);
|
|
2209
|
+
return e.idToken || e.accessToken ? (e.idToken && (t.idToken = e.idToken), e.accessToken && (t.accessToken = e.accessToken), e.nonce && !e.pendingToken && (t.nonce = e.nonce), e.pendingToken && (t.pendingToken = e.pendingToken)) : e.oauthToken && e.oauthTokenSecret ? (t.accessToken = e.oauthToken, t.secret = e.oauthTokenSecret) : b(
|
|
2192
2210
|
"argument-error"
|
|
2193
2211
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2194
2212
|
), t;
|
|
@@ -2218,7 +2236,7 @@ class U extends Ut {
|
|
|
2218
2236
|
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = Pe(t, ["providerId", "signInMethod"]);
|
|
2219
2237
|
if (!i || !r)
|
|
2220
2238
|
return null;
|
|
2221
|
-
const o = new
|
|
2239
|
+
const o = new D(i, r);
|
|
2222
2240
|
return o.idToken = s.idToken || void 0, o.accessToken = s.accessToken || void 0, o.secret = s.secret, o.nonce = s.nonce, o.pendingToken = s.pendingToken || null, o;
|
|
2223
2241
|
}
|
|
2224
2242
|
/** @internal */
|
|
@@ -2238,14 +2256,14 @@ class U extends Ut {
|
|
|
2238
2256
|
}
|
|
2239
2257
|
buildRequest() {
|
|
2240
2258
|
const e = {
|
|
2241
|
-
requestUri:
|
|
2259
|
+
requestUri: ui,
|
|
2242
2260
|
returnSecureToken: !0
|
|
2243
2261
|
};
|
|
2244
2262
|
if (this.pendingToken)
|
|
2245
2263
|
e.pendingToken = this.pendingToken;
|
|
2246
2264
|
else {
|
|
2247
2265
|
const t = {};
|
|
2248
|
-
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 =
|
|
2266
|
+
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);
|
|
2249
2267
|
}
|
|
2250
2268
|
return e;
|
|
2251
2269
|
}
|
|
@@ -2319,7 +2337,7 @@ class Dt {
|
|
|
2319
2337
|
* See the License for the specific language governing permissions and
|
|
2320
2338
|
* limitations under the License.
|
|
2321
2339
|
*/
|
|
2322
|
-
class
|
|
2340
|
+
class Q extends Dt {
|
|
2323
2341
|
constructor() {
|
|
2324
2342
|
super(...arguments), this.scopes = [];
|
|
2325
2343
|
}
|
|
@@ -2354,7 +2372,7 @@ class Y extends Dt {
|
|
|
2354
2372
|
* See the License for the specific language governing permissions and
|
|
2355
2373
|
* limitations under the License.
|
|
2356
2374
|
*/
|
|
2357
|
-
class A extends
|
|
2375
|
+
class A extends Q {
|
|
2358
2376
|
constructor() {
|
|
2359
2377
|
super(
|
|
2360
2378
|
"facebook.com"
|
|
@@ -2374,7 +2392,7 @@ class A extends Y {
|
|
|
2374
2392
|
* @param accessToken - Facebook access token.
|
|
2375
2393
|
*/
|
|
2376
2394
|
static credential(e) {
|
|
2377
|
-
return
|
|
2395
|
+
return D._fromParams({
|
|
2378
2396
|
providerId: A.PROVIDER_ID,
|
|
2379
2397
|
signInMethod: A.FACEBOOK_SIGN_IN_METHOD,
|
|
2380
2398
|
accessToken: e
|
|
@@ -2425,7 +2443,7 @@ A.PROVIDER_ID = "facebook.com";
|
|
|
2425
2443
|
* See the License for the specific language governing permissions and
|
|
2426
2444
|
* limitations under the License.
|
|
2427
2445
|
*/
|
|
2428
|
-
class C extends
|
|
2446
|
+
class C extends Q {
|
|
2429
2447
|
constructor() {
|
|
2430
2448
|
super(
|
|
2431
2449
|
"google.com"
|
|
@@ -2446,7 +2464,7 @@ class C extends Y {
|
|
|
2446
2464
|
* @param accessToken - Google access token.
|
|
2447
2465
|
*/
|
|
2448
2466
|
static credential(e, t) {
|
|
2449
|
-
return
|
|
2467
|
+
return D._fromParams({
|
|
2450
2468
|
providerId: C.PROVIDER_ID,
|
|
2451
2469
|
signInMethod: C.GOOGLE_SIGN_IN_METHOD,
|
|
2452
2470
|
idToken: e,
|
|
@@ -2501,7 +2519,7 @@ C.PROVIDER_ID = "google.com";
|
|
|
2501
2519
|
* See the License for the specific language governing permissions and
|
|
2502
2520
|
* limitations under the License.
|
|
2503
2521
|
*/
|
|
2504
|
-
class O extends
|
|
2522
|
+
class O extends Q {
|
|
2505
2523
|
constructor() {
|
|
2506
2524
|
super(
|
|
2507
2525
|
"github.com"
|
|
@@ -2514,7 +2532,7 @@ class O extends Y {
|
|
|
2514
2532
|
* @param accessToken - Github access token.
|
|
2515
2533
|
*/
|
|
2516
2534
|
static credential(e) {
|
|
2517
|
-
return
|
|
2535
|
+
return D._fromParams({
|
|
2518
2536
|
providerId: O.PROVIDER_ID,
|
|
2519
2537
|
signInMethod: O.GITHUB_SIGN_IN_METHOD,
|
|
2520
2538
|
accessToken: e
|
|
@@ -2565,7 +2583,7 @@ O.PROVIDER_ID = "github.com";
|
|
|
2565
2583
|
* See the License for the specific language governing permissions and
|
|
2566
2584
|
* limitations under the License.
|
|
2567
2585
|
*/
|
|
2568
|
-
class N extends
|
|
2586
|
+
class N extends Q {
|
|
2569
2587
|
constructor() {
|
|
2570
2588
|
super(
|
|
2571
2589
|
"twitter.com"
|
|
@@ -2579,7 +2597,7 @@ class N extends Y {
|
|
|
2579
2597
|
* @param secret - Twitter secret.
|
|
2580
2598
|
*/
|
|
2581
2599
|
static credential(e, t) {
|
|
2582
|
-
return
|
|
2600
|
+
return D._fromParams({
|
|
2583
2601
|
providerId: N.PROVIDER_ID,
|
|
2584
2602
|
signInMethod: N.TWITTER_SIGN_IN_METHOD,
|
|
2585
2603
|
oauthToken: e,
|
|
@@ -2634,13 +2652,13 @@ N.PROVIDER_ID = "twitter.com";
|
|
|
2634
2652
|
* See the License for the specific language governing permissions and
|
|
2635
2653
|
* limitations under the License.
|
|
2636
2654
|
*/
|
|
2637
|
-
class
|
|
2655
|
+
class F {
|
|
2638
2656
|
constructor(e) {
|
|
2639
2657
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2640
2658
|
}
|
|
2641
2659
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2642
2660
|
const s = await E._fromIdTokenResponse(e, i, r), o = Ze(i);
|
|
2643
|
-
return new
|
|
2661
|
+
return new F({
|
|
2644
2662
|
user: s,
|
|
2645
2663
|
providerId: o,
|
|
2646
2664
|
_tokenResponse: i,
|
|
@@ -2654,7 +2672,7 @@ class D {
|
|
|
2654
2672
|
!0
|
|
2655
2673
|
);
|
|
2656
2674
|
const r = Ze(i);
|
|
2657
|
-
return new
|
|
2675
|
+
return new F({
|
|
2658
2676
|
user: e,
|
|
2659
2677
|
providerId: r,
|
|
2660
2678
|
_tokenResponse: i,
|
|
@@ -2681,10 +2699,10 @@ function Ze(n) {
|
|
|
2681
2699
|
* See the License for the specific language governing permissions and
|
|
2682
2700
|
* limitations under the License.
|
|
2683
2701
|
*/
|
|
2684
|
-
class
|
|
2702
|
+
class ue extends Re {
|
|
2685
2703
|
constructor(e, t, i, r) {
|
|
2686
2704
|
var s;
|
|
2687
|
-
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this,
|
|
2705
|
+
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this, ue.prototype), this.customData = {
|
|
2688
2706
|
appName: e.name,
|
|
2689
2707
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
|
2690
2708
|
_serverResponse: t.customData._serverResponse,
|
|
@@ -2692,17 +2710,17 @@ class le extends Re {
|
|
|
2692
2710
|
};
|
|
2693
2711
|
}
|
|
2694
2712
|
static _fromErrorAndOperation(e, t, i, r) {
|
|
2695
|
-
return new
|
|
2713
|
+
return new ue(e, t, i, r);
|
|
2696
2714
|
}
|
|
2697
2715
|
}
|
|
2698
2716
|
function Ft(n, e, t, i) {
|
|
2699
2717
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2700
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
|
2718
|
+
throw s.code === "auth/multi-factor-auth-required" ? ue._fromErrorAndOperation(n, s, e, i) : s;
|
|
2701
2719
|
});
|
|
2702
2720
|
}
|
|
2703
|
-
async function
|
|
2704
|
-
const i = await
|
|
2705
|
-
return
|
|
2721
|
+
async function di(n, e, t = !1) {
|
|
2722
|
+
const i = await K(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2723
|
+
return F._forOperation(n, "link", i);
|
|
2706
2724
|
}
|
|
2707
2725
|
/**
|
|
2708
2726
|
* @license
|
|
@@ -2720,13 +2738,13 @@ async function li(n, e, t = !1) {
|
|
|
2720
2738
|
* See the License for the specific language governing permissions and
|
|
2721
2739
|
* limitations under the License.
|
|
2722
2740
|
*/
|
|
2723
|
-
async function
|
|
2741
|
+
async function hi(n, e, t = !1) {
|
|
2724
2742
|
const { auth: i } = n;
|
|
2725
2743
|
if (w(i.app))
|
|
2726
2744
|
return Promise.reject(L(i));
|
|
2727
2745
|
const r = "reauthenticate";
|
|
2728
2746
|
try {
|
|
2729
|
-
const s = await
|
|
2747
|
+
const s = await K(n, Ft(i, r, e, n), t);
|
|
2730
2748
|
u(
|
|
2731
2749
|
s.idToken,
|
|
2732
2750
|
i,
|
|
@@ -2746,9 +2764,9 @@ async function ui(n, e, t = !1) {
|
|
|
2746
2764
|
i,
|
|
2747
2765
|
"user-mismatch"
|
|
2748
2766
|
/* AuthErrorCode.USER_MISMATCH */
|
|
2749
|
-
),
|
|
2767
|
+
), F._forOperation(n, r, s);
|
|
2750
2768
|
} catch (s) {
|
|
2751
|
-
throw (s == null ? void 0 : s.code) === "auth/user-not-found" &&
|
|
2769
|
+
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && b(
|
|
2752
2770
|
i,
|
|
2753
2771
|
"user-mismatch"
|
|
2754
2772
|
/* AuthErrorCode.USER_MISMATCH */
|
|
@@ -2771,10 +2789,10 @@ async function ui(n, e, t = !1) {
|
|
|
2771
2789
|
* See the License for the specific language governing permissions and
|
|
2772
2790
|
* limitations under the License.
|
|
2773
2791
|
*/
|
|
2774
|
-
async function
|
|
2792
|
+
async function fi(n, e, t = !1) {
|
|
2775
2793
|
if (w(n.app))
|
|
2776
2794
|
return Promise.reject(L(n));
|
|
2777
|
-
const i = "signIn", r = await Ft(n, i, e), s = await
|
|
2795
|
+
const i = "signIn", r = await Ft(n, i, e), s = await F._fromIdTokenResponse(n, i, r);
|
|
2778
2796
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2779
2797
|
}
|
|
2780
2798
|
/**
|
|
@@ -2793,8 +2811,8 @@ async function di(n, e, t = !1) {
|
|
|
2793
2811
|
* See the License for the specific language governing permissions and
|
|
2794
2812
|
* limitations under the License.
|
|
2795
2813
|
*/
|
|
2796
|
-
async function
|
|
2797
|
-
return wt(n, "POST", "/v1/accounts:signInWithCustomToken",
|
|
2814
|
+
async function pi(n, e) {
|
|
2815
|
+
return wt(n, "POST", "/v1/accounts:signInWithCustomToken", fe(n, e));
|
|
2798
2816
|
}
|
|
2799
2817
|
/**
|
|
2800
2818
|
* @license
|
|
@@ -2812,22 +2830,22 @@ async function hi(n, e) {
|
|
|
2812
2830
|
* See the License for the specific language governing permissions and
|
|
2813
2831
|
* limitations under the License.
|
|
2814
2832
|
*/
|
|
2815
|
-
async function
|
|
2833
|
+
async function mi(n, e) {
|
|
2816
2834
|
if (w(n.app))
|
|
2817
2835
|
return Promise.reject(L(n));
|
|
2818
|
-
const t =
|
|
2836
|
+
const t = me(n), i = await pi(t, {
|
|
2819
2837
|
token: e,
|
|
2820
2838
|
returnSecureToken: !0
|
|
2821
|
-
}), r = await
|
|
2839
|
+
}), r = await F._fromIdTokenResponse(t, "signIn", i);
|
|
2822
2840
|
return await t._updateCurrentUser(r.user), r;
|
|
2823
2841
|
}
|
|
2824
|
-
function
|
|
2842
|
+
function gi(n, e, t, i) {
|
|
2825
2843
|
return j(n).onIdTokenChanged(e, t, i);
|
|
2826
2844
|
}
|
|
2827
|
-
function
|
|
2845
|
+
function _i(n, e, t) {
|
|
2828
2846
|
return j(n).beforeAuthStateChanged(e, t);
|
|
2829
2847
|
}
|
|
2830
|
-
const
|
|
2848
|
+
const de = "__sak";
|
|
2831
2849
|
/**
|
|
2832
2850
|
* @license
|
|
2833
2851
|
* Copyright 2019 Google LLC
|
|
@@ -2850,7 +2868,7 @@ class xt {
|
|
|
2850
2868
|
}
|
|
2851
2869
|
_isAvailable() {
|
|
2852
2870
|
try {
|
|
2853
|
-
return this.storage ? (this.storage.setItem(
|
|
2871
|
+
return this.storage ? (this.storage.setItem(de, "1"), this.storage.removeItem(de), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
2854
2872
|
} catch {
|
|
2855
2873
|
return Promise.resolve(!1);
|
|
2856
2874
|
}
|
|
@@ -2885,18 +2903,18 @@ class xt {
|
|
|
2885
2903
|
* See the License for the specific language governing permissions and
|
|
2886
2904
|
* limitations under the License.
|
|
2887
2905
|
*/
|
|
2888
|
-
function
|
|
2906
|
+
function vi() {
|
|
2889
2907
|
const n = g();
|
|
2890
|
-
return Ne(n) ||
|
|
2908
|
+
return Ne(n) || pe(n);
|
|
2891
2909
|
}
|
|
2892
|
-
const
|
|
2910
|
+
const Ii = 1e3, Ti = 10;
|
|
2893
2911
|
class Vt extends xt {
|
|
2894
2912
|
constructor() {
|
|
2895
2913
|
super(
|
|
2896
2914
|
() => window.localStorage,
|
|
2897
2915
|
"LOCAL"
|
|
2898
2916
|
/* PersistenceType.LOCAL */
|
|
2899
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
|
2917
|
+
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced = vi() && Jn(), this.fallbackToPolling = Nt(), this._shouldAllowMigration = !0;
|
|
2900
2918
|
}
|
|
2901
2919
|
forAllChangedKeys(e) {
|
|
2902
2920
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -2923,7 +2941,7 @@ class Vt extends xt {
|
|
|
2923
2941
|
const o = this.storage.getItem(i);
|
|
2924
2942
|
!t && this.localCache[i] === o || this.notifyListeners(i, o);
|
|
2925
2943
|
}, s = this.storage.getItem(i);
|
|
2926
|
-
|
|
2944
|
+
Kn() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(r, Ti) : r();
|
|
2927
2945
|
}
|
|
2928
2946
|
notifyListeners(e, t) {
|
|
2929
2947
|
this.localCache[e] = t;
|
|
@@ -2945,7 +2963,7 @@ class Vt extends xt {
|
|
|
2945
2963
|
!0
|
|
2946
2964
|
);
|
|
2947
2965
|
});
|
|
2948
|
-
},
|
|
2966
|
+
}, Ii);
|
|
2949
2967
|
}
|
|
2950
2968
|
stopPolling() {
|
|
2951
2969
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -2975,7 +2993,7 @@ class Vt extends xt {
|
|
|
2975
2993
|
}
|
|
2976
2994
|
}
|
|
2977
2995
|
Vt.type = "LOCAL";
|
|
2978
|
-
const
|
|
2996
|
+
const wi = Vt;
|
|
2979
2997
|
/**
|
|
2980
2998
|
* @license
|
|
2981
2999
|
* Copyright 2020 Google LLC
|
|
@@ -2992,7 +3010,7 @@ const Ii = Vt;
|
|
|
2992
3010
|
* See the License for the specific language governing permissions and
|
|
2993
3011
|
* limitations under the License.
|
|
2994
3012
|
*/
|
|
2995
|
-
class
|
|
3013
|
+
class $t extends xt {
|
|
2996
3014
|
constructor() {
|
|
2997
3015
|
super(
|
|
2998
3016
|
() => window.sessionStorage,
|
|
@@ -3005,8 +3023,8 @@ class Ht extends xt {
|
|
|
3005
3023
|
_removeListener(e, t) {
|
|
3006
3024
|
}
|
|
3007
3025
|
}
|
|
3008
|
-
|
|
3009
|
-
const
|
|
3026
|
+
$t.type = "SESSION";
|
|
3027
|
+
const Ht = $t;
|
|
3010
3028
|
/**
|
|
3011
3029
|
* @license
|
|
3012
3030
|
* Copyright 2019 Google LLC
|
|
@@ -3023,7 +3041,7 @@ const $t = Ht;
|
|
|
3023
3041
|
* See the License for the specific language governing permissions and
|
|
3024
3042
|
* limitations under the License.
|
|
3025
3043
|
*/
|
|
3026
|
-
function
|
|
3044
|
+
function yi(n) {
|
|
3027
3045
|
return Promise.all(n.map(async (e) => {
|
|
3028
3046
|
try {
|
|
3029
3047
|
return {
|
|
@@ -3054,7 +3072,7 @@ function Ti(n) {
|
|
|
3054
3072
|
* See the License for the specific language governing permissions and
|
|
3055
3073
|
* limitations under the License.
|
|
3056
3074
|
*/
|
|
3057
|
-
class
|
|
3075
|
+
class ge {
|
|
3058
3076
|
constructor(e) {
|
|
3059
3077
|
this.eventTarget = e, this.handlersMap = {}, this.boundEventHandler = this.handleEvent.bind(this);
|
|
3060
3078
|
}
|
|
@@ -3068,7 +3086,7 @@ class me {
|
|
|
3068
3086
|
const t = this.receivers.find((r) => r.isListeningto(e));
|
|
3069
3087
|
if (t)
|
|
3070
3088
|
return t;
|
|
3071
|
-
const i = new
|
|
3089
|
+
const i = new ge(e);
|
|
3072
3090
|
return this.receivers.push(i), i;
|
|
3073
3091
|
}
|
|
3074
3092
|
isListeningto(e) {
|
|
@@ -3093,7 +3111,7 @@ class me {
|
|
|
3093
3111
|
eventId: i,
|
|
3094
3112
|
eventType: r
|
|
3095
3113
|
});
|
|
3096
|
-
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await
|
|
3114
|
+
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await yi(c);
|
|
3097
3115
|
t.ports[0].postMessage({
|
|
3098
3116
|
status: "done",
|
|
3099
3117
|
eventId: i,
|
|
@@ -3122,7 +3140,7 @@ class me {
|
|
|
3122
3140
|
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);
|
|
3123
3141
|
}
|
|
3124
3142
|
}
|
|
3125
|
-
|
|
3143
|
+
ge.receivers = [];
|
|
3126
3144
|
/**
|
|
3127
3145
|
* @license
|
|
3128
3146
|
* Copyright 2020 Google LLC
|
|
@@ -3161,7 +3179,7 @@ function Me(n = "", e = 10) {
|
|
|
3161
3179
|
* See the License for the specific language governing permissions and
|
|
3162
3180
|
* limitations under the License.
|
|
3163
3181
|
*/
|
|
3164
|
-
class
|
|
3182
|
+
class Ei {
|
|
3165
3183
|
constructor(e) {
|
|
3166
3184
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
3167
3185
|
}
|
|
@@ -3205,8 +3223,8 @@ class wi {
|
|
|
3205
3223
|
}, i);
|
|
3206
3224
|
o = {
|
|
3207
3225
|
messageChannel: r,
|
|
3208
|
-
onMessage(
|
|
3209
|
-
const _ =
|
|
3226
|
+
onMessage(f) {
|
|
3227
|
+
const _ = f;
|
|
3210
3228
|
if (_.data.eventId === l)
|
|
3211
3229
|
switch (_.data.status) {
|
|
3212
3230
|
case "ack":
|
|
@@ -3261,7 +3279,7 @@ class wi {
|
|
|
3261
3279
|
function T() {
|
|
3262
3280
|
return window;
|
|
3263
3281
|
}
|
|
3264
|
-
function
|
|
3282
|
+
function ki(n) {
|
|
3265
3283
|
T().location.href = n;
|
|
3266
3284
|
}
|
|
3267
3285
|
/**
|
|
@@ -3283,7 +3301,7 @@ function yi(n) {
|
|
|
3283
3301
|
function Wt() {
|
|
3284
3302
|
return typeof T().WorkerGlobalScope < "u" && typeof T().importScripts == "function";
|
|
3285
3303
|
}
|
|
3286
|
-
async function
|
|
3304
|
+
async function bi() {
|
|
3287
3305
|
if (!(navigator != null && navigator.serviceWorker))
|
|
3288
3306
|
return null;
|
|
3289
3307
|
try {
|
|
@@ -3292,11 +3310,11 @@ async function Ei() {
|
|
|
3292
3310
|
return null;
|
|
3293
3311
|
}
|
|
3294
3312
|
}
|
|
3295
|
-
function
|
|
3313
|
+
function Si() {
|
|
3296
3314
|
var n;
|
|
3297
3315
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3298
3316
|
}
|
|
3299
|
-
function
|
|
3317
|
+
function Ri() {
|
|
3300
3318
|
return Wt() ? self : null;
|
|
3301
3319
|
}
|
|
3302
3320
|
/**
|
|
@@ -3315,8 +3333,8 @@ function Si() {
|
|
|
3315
3333
|
* See the License for the specific language governing permissions and
|
|
3316
3334
|
* limitations under the License.
|
|
3317
3335
|
*/
|
|
3318
|
-
const jt = "firebaseLocalStorageDb",
|
|
3319
|
-
class
|
|
3336
|
+
const jt = "firebaseLocalStorageDb", Pi = 1, he = "firebaseLocalStorage", Gt = "fbase_key";
|
|
3337
|
+
class Z {
|
|
3320
3338
|
constructor(e) {
|
|
3321
3339
|
this.request = e;
|
|
3322
3340
|
}
|
|
@@ -3330,47 +3348,47 @@ class X {
|
|
|
3330
3348
|
});
|
|
3331
3349
|
}
|
|
3332
3350
|
}
|
|
3333
|
-
function
|
|
3334
|
-
return n.transaction([
|
|
3351
|
+
function _e(n, e) {
|
|
3352
|
+
return n.transaction([he], e ? "readwrite" : "readonly").objectStore(he);
|
|
3335
3353
|
}
|
|
3336
|
-
function
|
|
3354
|
+
function Ai() {
|
|
3337
3355
|
const n = indexedDB.deleteDatabase(jt);
|
|
3338
|
-
return new
|
|
3356
|
+
return new Z(n).toPromise();
|
|
3339
3357
|
}
|
|
3340
|
-
function
|
|
3341
|
-
const n = indexedDB.open(jt,
|
|
3358
|
+
function be() {
|
|
3359
|
+
const n = indexedDB.open(jt, Pi);
|
|
3342
3360
|
return new Promise((e, t) => {
|
|
3343
3361
|
n.addEventListener("error", () => {
|
|
3344
3362
|
t(n.error);
|
|
3345
3363
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3346
3364
|
const i = n.result;
|
|
3347
3365
|
try {
|
|
3348
|
-
i.createObjectStore(
|
|
3366
|
+
i.createObjectStore(he, { keyPath: Gt });
|
|
3349
3367
|
} catch (r) {
|
|
3350
3368
|
t(r);
|
|
3351
3369
|
}
|
|
3352
3370
|
}), n.addEventListener("success", async () => {
|
|
3353
3371
|
const i = n.result;
|
|
3354
|
-
i.objectStoreNames.contains(
|
|
3372
|
+
i.objectStoreNames.contains(he) ? e(i) : (i.close(), await Ai(), e(await be()));
|
|
3355
3373
|
});
|
|
3356
3374
|
});
|
|
3357
3375
|
}
|
|
3358
3376
|
async function et(n, e, t) {
|
|
3359
|
-
const i =
|
|
3377
|
+
const i = _e(n, !0).put({
|
|
3360
3378
|
[Gt]: e,
|
|
3361
3379
|
value: t
|
|
3362
3380
|
});
|
|
3363
|
-
return new
|
|
3381
|
+
return new Z(i).toPromise();
|
|
3364
3382
|
}
|
|
3365
|
-
async function
|
|
3366
|
-
const t =
|
|
3383
|
+
async function Ci(n, e) {
|
|
3384
|
+
const t = _e(n, !1).get(e), i = await new Z(t).toPromise();
|
|
3367
3385
|
return i === void 0 ? null : i.value;
|
|
3368
3386
|
}
|
|
3369
3387
|
function tt(n, e) {
|
|
3370
|
-
const t =
|
|
3371
|
-
return new
|
|
3388
|
+
const t = _e(n, !0).delete(e);
|
|
3389
|
+
return new Z(t).toPromise();
|
|
3372
3390
|
}
|
|
3373
|
-
const
|
|
3391
|
+
const Oi = 800, Ni = 3;
|
|
3374
3392
|
class Bt {
|
|
3375
3393
|
constructor() {
|
|
3376
3394
|
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(() => {
|
|
@@ -3378,7 +3396,7 @@ class Bt {
|
|
|
3378
3396
|
});
|
|
3379
3397
|
}
|
|
3380
3398
|
async _openDb() {
|
|
3381
|
-
return this.db ? this.db : (this.db = await
|
|
3399
|
+
return this.db ? this.db : (this.db = await be(), this.db);
|
|
3382
3400
|
}
|
|
3383
3401
|
async _withRetries(e) {
|
|
3384
3402
|
let t = 0;
|
|
@@ -3387,7 +3405,7 @@ class Bt {
|
|
|
3387
3405
|
const i = await this._openDb();
|
|
3388
3406
|
return await e(i);
|
|
3389
3407
|
} catch (i) {
|
|
3390
|
-
if (t++ >
|
|
3408
|
+
if (t++ > Ni)
|
|
3391
3409
|
throw i;
|
|
3392
3410
|
this.db && (this.db.close(), this.db = void 0);
|
|
3393
3411
|
}
|
|
@@ -3403,7 +3421,7 @@ class Bt {
|
|
|
3403
3421
|
* As the worker we should listen to events from the main window.
|
|
3404
3422
|
*/
|
|
3405
3423
|
async initializeReceiver() {
|
|
3406
|
-
this.receiver =
|
|
3424
|
+
this.receiver = ge._getInstance(Ri()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3407
3425
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3408
3426
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3409
3427
|
"keyChanged"
|
|
@@ -3419,9 +3437,9 @@ class Bt {
|
|
|
3419
3437
|
*/
|
|
3420
3438
|
async initializeSender() {
|
|
3421
3439
|
var e, t;
|
|
3422
|
-
if (this.activeServiceWorker = await
|
|
3440
|
+
if (this.activeServiceWorker = await bi(), !this.activeServiceWorker)
|
|
3423
3441
|
return;
|
|
3424
|
-
this.sender = new
|
|
3442
|
+
this.sender = new Ei(this.activeServiceWorker);
|
|
3425
3443
|
const i = await this.sender._send(
|
|
3426
3444
|
"ping",
|
|
3427
3445
|
{},
|
|
@@ -3443,7 +3461,7 @@ class Bt {
|
|
|
3443
3461
|
* @param key - Storage key which changed.
|
|
3444
3462
|
*/
|
|
3445
3463
|
async notifyServiceWorker(e) {
|
|
3446
|
-
if (!(!this.sender || !this.activeServiceWorker ||
|
|
3464
|
+
if (!(!this.sender || !this.activeServiceWorker || Si() !== this.activeServiceWorker))
|
|
3447
3465
|
try {
|
|
3448
3466
|
await this.sender._send(
|
|
3449
3467
|
"keyChanged",
|
|
@@ -3459,8 +3477,8 @@ class Bt {
|
|
|
3459
3477
|
try {
|
|
3460
3478
|
if (!indexedDB)
|
|
3461
3479
|
return !1;
|
|
3462
|
-
const e = await
|
|
3463
|
-
return await et(e,
|
|
3480
|
+
const e = await be();
|
|
3481
|
+
return await et(e, de, "1"), await tt(e, de), !0;
|
|
3464
3482
|
} catch {
|
|
3465
3483
|
}
|
|
3466
3484
|
return !1;
|
|
@@ -3477,7 +3495,7 @@ class Bt {
|
|
|
3477
3495
|
return this._withPendingWrite(async () => (await this._withRetries((i) => et(i, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
3478
3496
|
}
|
|
3479
3497
|
async _get(e) {
|
|
3480
|
-
const t = await this._withRetries((i) =>
|
|
3498
|
+
const t = await this._withRetries((i) => Ci(i, e));
|
|
3481
3499
|
return this.localCache[e] = t, t;
|
|
3482
3500
|
}
|
|
3483
3501
|
async _remove(e) {
|
|
@@ -3485,8 +3503,8 @@ class Bt {
|
|
|
3485
3503
|
}
|
|
3486
3504
|
async _poll() {
|
|
3487
3505
|
const e = await this._withRetries((r) => {
|
|
3488
|
-
const s =
|
|
3489
|
-
return new
|
|
3506
|
+
const s = _e(r, !1).getAll();
|
|
3507
|
+
return new Z(s).toPromise();
|
|
3490
3508
|
});
|
|
3491
3509
|
if (!e)
|
|
3492
3510
|
return [];
|
|
@@ -3508,7 +3526,7 @@ class Bt {
|
|
|
3508
3526
|
r(t);
|
|
3509
3527
|
}
|
|
3510
3528
|
startPolling() {
|
|
3511
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
3529
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), Oi);
|
|
3512
3530
|
}
|
|
3513
3531
|
stopPolling() {
|
|
3514
3532
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3521,8 +3539,8 @@ class Bt {
|
|
|
3521
3539
|
}
|
|
3522
3540
|
}
|
|
3523
3541
|
Bt.type = "LOCAL";
|
|
3524
|
-
const
|
|
3525
|
-
new
|
|
3542
|
+
const Li = Bt;
|
|
3543
|
+
new X(3e4, 6e4);
|
|
3526
3544
|
/**
|
|
3527
3545
|
* @license
|
|
3528
3546
|
* Copyright 2021 Google LLC
|
|
@@ -3539,7 +3557,7 @@ new J(3e4, 6e4);
|
|
|
3539
3557
|
* See the License for the specific language governing permissions and
|
|
3540
3558
|
* limitations under the License.
|
|
3541
3559
|
*/
|
|
3542
|
-
function
|
|
3560
|
+
function Mi(n, e) {
|
|
3543
3561
|
return e ? k(e) : (u(
|
|
3544
3562
|
n._popupRedirectResolver,
|
|
3545
3563
|
n,
|
|
@@ -3593,26 +3611,26 @@ class Ue extends Ut {
|
|
|
3593
3611
|
return e && (t.idToken = e), t;
|
|
3594
3612
|
}
|
|
3595
3613
|
}
|
|
3596
|
-
function
|
|
3597
|
-
return
|
|
3614
|
+
function Ui(n) {
|
|
3615
|
+
return fi(n.auth, new Ue(n), n.bypassAuthState);
|
|
3598
3616
|
}
|
|
3599
|
-
function
|
|
3617
|
+
function Di(n) {
|
|
3600
3618
|
const { auth: e, user: t } = n;
|
|
3601
3619
|
return u(
|
|
3602
3620
|
t,
|
|
3603
3621
|
e,
|
|
3604
3622
|
"internal-error"
|
|
3605
3623
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3606
|
-
),
|
|
3624
|
+
), hi(t, new Ue(n), n.bypassAuthState);
|
|
3607
3625
|
}
|
|
3608
|
-
async function
|
|
3626
|
+
async function Fi(n) {
|
|
3609
3627
|
const { auth: e, user: t } = n;
|
|
3610
3628
|
return u(
|
|
3611
3629
|
t,
|
|
3612
3630
|
e,
|
|
3613
3631
|
"internal-error"
|
|
3614
3632
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3615
|
-
),
|
|
3633
|
+
), di(t, new Ue(n), n.bypassAuthState);
|
|
3616
3634
|
}
|
|
3617
3635
|
/**
|
|
3618
3636
|
* @license
|
|
@@ -3672,15 +3690,15 @@ class qt {
|
|
|
3672
3690
|
switch (e) {
|
|
3673
3691
|
case "signInViaPopup":
|
|
3674
3692
|
case "signInViaRedirect":
|
|
3675
|
-
return
|
|
3693
|
+
return Ui;
|
|
3676
3694
|
case "linkViaPopup":
|
|
3677
3695
|
case "linkViaRedirect":
|
|
3678
|
-
return
|
|
3696
|
+
return Fi;
|
|
3679
3697
|
case "reauthViaPopup":
|
|
3680
3698
|
case "reauthViaRedirect":
|
|
3681
|
-
return
|
|
3699
|
+
return Di;
|
|
3682
3700
|
default:
|
|
3683
|
-
|
|
3701
|
+
b(
|
|
3684
3702
|
this.auth,
|
|
3685
3703
|
"internal-error"
|
|
3686
3704
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -3688,10 +3706,10 @@ class qt {
|
|
|
3688
3706
|
}
|
|
3689
3707
|
}
|
|
3690
3708
|
resolve(e) {
|
|
3691
|
-
|
|
3709
|
+
S(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.resolve(e), this.unregisterAndCleanUp();
|
|
3692
3710
|
}
|
|
3693
3711
|
reject(e) {
|
|
3694
|
-
|
|
3712
|
+
S(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.reject(e), this.unregisterAndCleanUp();
|
|
3695
3713
|
}
|
|
3696
3714
|
unregisterAndCleanUp() {
|
|
3697
3715
|
this.eventManager && this.eventManager.unregisterConsumer(this), this.pendingPromise = null, this.cleanUp();
|
|
@@ -3713,7 +3731,7 @@ class qt {
|
|
|
3713
3731
|
* See the License for the specific language governing permissions and
|
|
3714
3732
|
* limitations under the License.
|
|
3715
3733
|
*/
|
|
3716
|
-
const
|
|
3734
|
+
const xi = new X(2e3, 1e4);
|
|
3717
3735
|
class V extends qt {
|
|
3718
3736
|
constructor(e, t, i, r, s) {
|
|
3719
3737
|
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, V.currentPopupAction && V.currentPopupAction.cancel(), V.currentPopupAction = this;
|
|
@@ -3728,7 +3746,7 @@ class V extends qt {
|
|
|
3728
3746
|
), e;
|
|
3729
3747
|
}
|
|
3730
3748
|
async onExecution() {
|
|
3731
|
-
|
|
3749
|
+
S(this.filter.length === 1, "Popup operations only handle one event");
|
|
3732
3750
|
const e = Me();
|
|
3733
3751
|
this.authWindow = await this.resolver._openPopup(
|
|
3734
3752
|
this.auth,
|
|
@@ -3777,7 +3795,7 @@ class V extends qt {
|
|
|
3777
3795
|
);
|
|
3778
3796
|
return;
|
|
3779
3797
|
}
|
|
3780
|
-
this.pollId = window.setTimeout(e,
|
|
3798
|
+
this.pollId = window.setTimeout(e, xi.get());
|
|
3781
3799
|
};
|
|
3782
3800
|
e();
|
|
3783
3801
|
}
|
|
@@ -3799,8 +3817,8 @@ V.currentPopupAction = null;
|
|
|
3799
3817
|
* See the License for the specific language governing permissions and
|
|
3800
3818
|
* limitations under the License.
|
|
3801
3819
|
*/
|
|
3802
|
-
const
|
|
3803
|
-
class
|
|
3820
|
+
const Vi = "pendingRedirect", oe = /* @__PURE__ */ new Map();
|
|
3821
|
+
class $i extends qt {
|
|
3804
3822
|
constructor(e, t, i = !1) {
|
|
3805
3823
|
super(e, [
|
|
3806
3824
|
"signInViaRedirect",
|
|
@@ -3815,17 +3833,17 @@ class xi extends qt {
|
|
|
3815
3833
|
* just return it.
|
|
3816
3834
|
*/
|
|
3817
3835
|
async execute() {
|
|
3818
|
-
let e =
|
|
3836
|
+
let e = oe.get(this.auth._key());
|
|
3819
3837
|
if (!e) {
|
|
3820
3838
|
try {
|
|
3821
|
-
const i = await
|
|
3839
|
+
const i = await Hi(this.resolver, this.auth) ? await super.execute() : null;
|
|
3822
3840
|
e = () => Promise.resolve(i);
|
|
3823
3841
|
} catch (t) {
|
|
3824
3842
|
e = () => Promise.reject(t);
|
|
3825
3843
|
}
|
|
3826
|
-
|
|
3844
|
+
oe.set(this.auth._key(), e);
|
|
3827
3845
|
}
|
|
3828
|
-
return this.bypassAuthState ||
|
|
3846
|
+
return this.bypassAuthState || oe.set(this.auth._key(), () => Promise.resolve(null)), e();
|
|
3829
3847
|
}
|
|
3830
3848
|
async onAuthEvent(e) {
|
|
3831
3849
|
if (e.type === "signInViaRedirect")
|
|
@@ -3846,26 +3864,26 @@ class xi extends qt {
|
|
|
3846
3864
|
cleanUp() {
|
|
3847
3865
|
}
|
|
3848
3866
|
}
|
|
3849
|
-
async function
|
|
3850
|
-
const t =
|
|
3867
|
+
async function Hi(n, e) {
|
|
3868
|
+
const t = Gi(e), i = ji(n);
|
|
3851
3869
|
if (!await i._isAvailable())
|
|
3852
3870
|
return !1;
|
|
3853
3871
|
const r = await i._get(t) === "true";
|
|
3854
3872
|
return await i._remove(t), r;
|
|
3855
3873
|
}
|
|
3856
|
-
function
|
|
3857
|
-
|
|
3874
|
+
function Wi(n, e) {
|
|
3875
|
+
oe.set(n._key(), e);
|
|
3858
3876
|
}
|
|
3859
|
-
function
|
|
3877
|
+
function ji(n) {
|
|
3860
3878
|
return k(n._redirectPersistence);
|
|
3861
3879
|
}
|
|
3862
|
-
function
|
|
3863
|
-
return
|
|
3880
|
+
function Gi(n) {
|
|
3881
|
+
return se(Vi, n.config.apiKey, n.name);
|
|
3864
3882
|
}
|
|
3865
|
-
async function
|
|
3883
|
+
async function Bi(n, e, t = !1) {
|
|
3866
3884
|
if (w(n.app))
|
|
3867
3885
|
return Promise.reject(L(n));
|
|
3868
|
-
const i =
|
|
3886
|
+
const i = me(n), r = Mi(i, e), o = await new $i(i, r, t).execute();
|
|
3869
3887
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
3870
3888
|
}
|
|
3871
3889
|
/**
|
|
@@ -3884,8 +3902,8 @@ async function ji(n, e, t = !1) {
|
|
|
3884
3902
|
* See the License for the specific language governing permissions and
|
|
3885
3903
|
* limitations under the License.
|
|
3886
3904
|
*/
|
|
3887
|
-
const
|
|
3888
|
-
class
|
|
3905
|
+
const qi = 10 * 60 * 1e3;
|
|
3906
|
+
class zi {
|
|
3889
3907
|
constructor(e) {
|
|
3890
3908
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
3891
3909
|
}
|
|
@@ -3901,7 +3919,7 @@ class Bi {
|
|
|
3901
3919
|
let t = !1;
|
|
3902
3920
|
return this.consumers.forEach((i) => {
|
|
3903
3921
|
this.isEventForConsumer(e, i) && (t = !0, this.sendToConsumer(e, i), this.saveEventToCache(e));
|
|
3904
|
-
}), this.hasHandledPotentialRedirect || !
|
|
3922
|
+
}), this.hasHandledPotentialRedirect || !Ki(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
3905
3923
|
}
|
|
3906
3924
|
sendToConsumer(e, t) {
|
|
3907
3925
|
var i;
|
|
@@ -3916,7 +3934,7 @@ class Bi {
|
|
|
3916
3934
|
return t.filter.includes(e.type) && i;
|
|
3917
3935
|
}
|
|
3918
3936
|
hasEventBeenHandled(e) {
|
|
3919
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
3937
|
+
return Date.now() - this.lastProcessedEventTime >= qi && this.cachedEventUids.clear(), this.cachedEventUids.has(nt(e));
|
|
3920
3938
|
}
|
|
3921
3939
|
saveEventToCache(e) {
|
|
3922
3940
|
this.cachedEventUids.add(nt(e)), this.lastProcessedEventTime = Date.now();
|
|
@@ -3928,7 +3946,7 @@ function nt(n) {
|
|
|
3928
3946
|
function zt({ type: n, error: e }) {
|
|
3929
3947
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
3930
3948
|
}
|
|
3931
|
-
function
|
|
3949
|
+
function Ki(n) {
|
|
3932
3950
|
switch (n.type) {
|
|
3933
3951
|
case "signInViaRedirect":
|
|
3934
3952
|
case "linkViaRedirect":
|
|
@@ -3956,7 +3974,7 @@ function qi(n) {
|
|
|
3956
3974
|
* See the License for the specific language governing permissions and
|
|
3957
3975
|
* limitations under the License.
|
|
3958
3976
|
*/
|
|
3959
|
-
async function
|
|
3977
|
+
async function Ji(n, e = {}) {
|
|
3960
3978
|
return G(n, "GET", "/v1/projects", e);
|
|
3961
3979
|
}
|
|
3962
3980
|
/**
|
|
@@ -3975,32 +3993,32 @@ async function zi(n, e = {}) {
|
|
|
3975
3993
|
* See the License for the specific language governing permissions and
|
|
3976
3994
|
* limitations under the License.
|
|
3977
3995
|
*/
|
|
3978
|
-
const
|
|
3979
|
-
async function
|
|
3996
|
+
const Yi = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Xi = /^https?/;
|
|
3997
|
+
async function Qi(n) {
|
|
3980
3998
|
if (n.config.emulator)
|
|
3981
3999
|
return;
|
|
3982
|
-
const { authorizedDomains: e } = await
|
|
4000
|
+
const { authorizedDomains: e } = await Ji(n);
|
|
3983
4001
|
for (const t of e)
|
|
3984
4002
|
try {
|
|
3985
|
-
if (
|
|
4003
|
+
if (Zi(t))
|
|
3986
4004
|
return;
|
|
3987
4005
|
} catch {
|
|
3988
4006
|
}
|
|
3989
|
-
|
|
4007
|
+
b(
|
|
3990
4008
|
n,
|
|
3991
4009
|
"unauthorized-domain"
|
|
3992
4010
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
3993
4011
|
);
|
|
3994
4012
|
}
|
|
3995
|
-
function
|
|
4013
|
+
function Zi(n) {
|
|
3996
4014
|
const e = Ee(), { protocol: t, hostname: i } = new URL(e);
|
|
3997
4015
|
if (n.startsWith("chrome-extension://")) {
|
|
3998
4016
|
const o = new URL(n);
|
|
3999
4017
|
return o.hostname === "" && i === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === i;
|
|
4000
4018
|
}
|
|
4001
|
-
if (!
|
|
4019
|
+
if (!Xi.test(t))
|
|
4002
4020
|
return !1;
|
|
4003
|
-
if (
|
|
4021
|
+
if (Yi.test(n))
|
|
4004
4022
|
return i === n;
|
|
4005
4023
|
const r = n.replace(/\./g, "\\.");
|
|
4006
4024
|
return new RegExp("^(.+\\." + r + "|" + r + ")$", "i").test(i);
|
|
@@ -4021,7 +4039,7 @@ function Xi(n) {
|
|
|
4021
4039
|
* See the License for the specific language governing permissions and
|
|
4022
4040
|
* limitations under the License.
|
|
4023
4041
|
*/
|
|
4024
|
-
const
|
|
4042
|
+
const er = new X(3e4, 6e4);
|
|
4025
4043
|
function it() {
|
|
4026
4044
|
const n = T().___jsl;
|
|
4027
4045
|
if (n != null && n.H) {
|
|
@@ -4031,7 +4049,7 @@ function it() {
|
|
|
4031
4049
|
n.CP[t] = null;
|
|
4032
4050
|
}
|
|
4033
4051
|
}
|
|
4034
|
-
function
|
|
4052
|
+
function tr(n) {
|
|
4035
4053
|
return new Promise((e, t) => {
|
|
4036
4054
|
var i, r, s;
|
|
4037
4055
|
function o() {
|
|
@@ -4046,7 +4064,7 @@ function Zi(n) {
|
|
|
4046
4064
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4047
4065
|
));
|
|
4048
4066
|
},
|
|
4049
|
-
timeout:
|
|
4067
|
+
timeout: er.get()
|
|
4050
4068
|
});
|
|
4051
4069
|
}
|
|
4052
4070
|
if (!((r = (i = T().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
@@ -4054,22 +4072,22 @@ function Zi(n) {
|
|
|
4054
4072
|
else if (!((s = T().gapi) === null || s === void 0) && s.load)
|
|
4055
4073
|
o();
|
|
4056
4074
|
else {
|
|
4057
|
-
const c =
|
|
4075
|
+
const c = ri("iframefcb");
|
|
4058
4076
|
return T()[c] = () => {
|
|
4059
4077
|
gapi.load ? o() : t(I(
|
|
4060
4078
|
n,
|
|
4061
4079
|
"network-request-failed"
|
|
4062
4080
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4063
4081
|
));
|
|
4064
|
-
},
|
|
4082
|
+
}, ni(`${ii()}?onload=${c}`).catch((a) => t(a));
|
|
4065
4083
|
}
|
|
4066
4084
|
}).catch((e) => {
|
|
4067
|
-
throw
|
|
4085
|
+
throw ae = null, e;
|
|
4068
4086
|
});
|
|
4069
4087
|
}
|
|
4070
|
-
let
|
|
4071
|
-
function
|
|
4072
|
-
return
|
|
4088
|
+
let ae = null;
|
|
4089
|
+
function nr(n) {
|
|
4090
|
+
return ae = ae || tr(n), ae;
|
|
4073
4091
|
}
|
|
4074
4092
|
/**
|
|
4075
4093
|
* @license
|
|
@@ -4087,7 +4105,7 @@ function er(n) {
|
|
|
4087
4105
|
* See the License for the specific language governing permissions and
|
|
4088
4106
|
* limitations under the License.
|
|
4089
4107
|
*/
|
|
4090
|
-
const
|
|
4108
|
+
const ir = new X(5e3, 15e3), rr = "__/auth/iframe", sr = "emulator/auth/iframe", or = {
|
|
4091
4109
|
style: {
|
|
4092
4110
|
position: "absolute",
|
|
4093
4111
|
top: "-100px",
|
|
@@ -4096,13 +4114,13 @@ const tr = new J(5e3, 15e3), nr = "__/auth/iframe", ir = "emulator/auth/iframe",
|
|
|
4096
4114
|
},
|
|
4097
4115
|
"aria-hidden": "true",
|
|
4098
4116
|
tabindex: "-1"
|
|
4099
|
-
},
|
|
4117
|
+
}, ar = /* @__PURE__ */ new Map([
|
|
4100
4118
|
["identitytoolkit.googleapis.com", "p"],
|
|
4101
4119
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
4102
4120
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
4103
4121
|
// test
|
|
4104
4122
|
]);
|
|
4105
|
-
function
|
|
4123
|
+
function cr(n) {
|
|
4106
4124
|
const e = n.config;
|
|
4107
4125
|
u(
|
|
4108
4126
|
e.authDomain,
|
|
@@ -4110,17 +4128,17 @@ function or(n) {
|
|
|
4110
4128
|
"auth-domain-config-required"
|
|
4111
4129
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
4112
4130
|
);
|
|
4113
|
-
const t = e.emulator ? Ce(e,
|
|
4131
|
+
const t = e.emulator ? Ce(e, sr) : `https://${n.config.authDomain}/${rr}`, i = {
|
|
4114
4132
|
apiKey: e.apiKey,
|
|
4115
4133
|
appName: n.name,
|
|
4116
|
-
v:
|
|
4117
|
-
}, r =
|
|
4134
|
+
v: J
|
|
4135
|
+
}, r = ar.get(n.config.apiHost);
|
|
4118
4136
|
r && (i.eid = r);
|
|
4119
4137
|
const s = n._getFrameworks();
|
|
4120
|
-
return s.length && (i.fw = s.join(",")), `${t}?${
|
|
4138
|
+
return s.length && (i.fw = s.join(",")), `${t}?${Y(i).slice(1)}`;
|
|
4121
4139
|
}
|
|
4122
|
-
async function
|
|
4123
|
-
const e = await
|
|
4140
|
+
async function lr(n) {
|
|
4141
|
+
const e = await nr(n), t = T().gapi;
|
|
4124
4142
|
return u(
|
|
4125
4143
|
t,
|
|
4126
4144
|
n,
|
|
@@ -4128,9 +4146,9 @@ async function ar(n) {
|
|
|
4128
4146
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4129
4147
|
), e.open({
|
|
4130
4148
|
where: document.body,
|
|
4131
|
-
url:
|
|
4149
|
+
url: cr(n),
|
|
4132
4150
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
4133
|
-
attributes:
|
|
4151
|
+
attributes: or,
|
|
4134
4152
|
dontclear: !0
|
|
4135
4153
|
}, (i) => new Promise(async (r, s) => {
|
|
4136
4154
|
await i.restyle({
|
|
@@ -4143,7 +4161,7 @@ async function ar(n) {
|
|
|
4143
4161
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4144
4162
|
), c = T().setTimeout(() => {
|
|
4145
4163
|
s(o);
|
|
4146
|
-
},
|
|
4164
|
+
}, ir.get());
|
|
4147
4165
|
function a() {
|
|
4148
4166
|
T().clearTimeout(c), r(i);
|
|
4149
4167
|
}
|
|
@@ -4168,12 +4186,12 @@ async function ar(n) {
|
|
|
4168
4186
|
* See the License for the specific language governing permissions and
|
|
4169
4187
|
* limitations under the License.
|
|
4170
4188
|
*/
|
|
4171
|
-
const
|
|
4189
|
+
const ur = {
|
|
4172
4190
|
location: "yes",
|
|
4173
4191
|
resizable: "yes",
|
|
4174
4192
|
statusbar: "yes",
|
|
4175
4193
|
toolbar: "no"
|
|
4176
|
-
},
|
|
4194
|
+
}, dr = 500, hr = 600, fr = "_blank", pr = "http://localhost";
|
|
4177
4195
|
class rt {
|
|
4178
4196
|
constructor(e) {
|
|
4179
4197
|
this.window = e, this.associatedEvent = null;
|
|
@@ -4186,33 +4204,33 @@ class rt {
|
|
|
4186
4204
|
}
|
|
4187
4205
|
}
|
|
4188
4206
|
}
|
|
4189
|
-
function
|
|
4207
|
+
function mr(n, e, t, i = dr, r = hr) {
|
|
4190
4208
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4191
4209
|
let c = "";
|
|
4192
|
-
const a = Object.assign(Object.assign({},
|
|
4210
|
+
const a = Object.assign(Object.assign({}, ur), {
|
|
4193
4211
|
width: i.toString(),
|
|
4194
4212
|
height: r.toString(),
|
|
4195
4213
|
top: s,
|
|
4196
4214
|
left: o
|
|
4197
4215
|
}), l = g().toLowerCase();
|
|
4198
|
-
t && (c = Rt(l) ?
|
|
4199
|
-
const d = Object.entries(a).reduce((_, [
|
|
4200
|
-
if (
|
|
4201
|
-
return
|
|
4202
|
-
const
|
|
4216
|
+
t && (c = Rt(l) ? fr : t), St(l) && (e = e || pr, a.scrollbars = "yes");
|
|
4217
|
+
const d = Object.entries(a).reduce((_, [x, M]) => `${_}${x}=${M},`, "");
|
|
4218
|
+
if (zn(l) && c !== "_self")
|
|
4219
|
+
return gr(e || "", c), new rt(null);
|
|
4220
|
+
const f = window.open(e || "", c, d);
|
|
4203
4221
|
u(
|
|
4204
|
-
|
|
4222
|
+
f,
|
|
4205
4223
|
n,
|
|
4206
4224
|
"popup-blocked"
|
|
4207
4225
|
/* AuthErrorCode.POPUP_BLOCKED */
|
|
4208
4226
|
);
|
|
4209
4227
|
try {
|
|
4210
|
-
|
|
4228
|
+
f.focus();
|
|
4211
4229
|
} catch {
|
|
4212
4230
|
}
|
|
4213
|
-
return new rt(
|
|
4231
|
+
return new rt(f);
|
|
4214
4232
|
}
|
|
4215
|
-
function
|
|
4233
|
+
function gr(n, e) {
|
|
4216
4234
|
const t = document.createElement("a");
|
|
4217
4235
|
t.href = n, t.target = e;
|
|
4218
4236
|
const i = document.createEvent("MouseEvent");
|
|
@@ -4234,7 +4252,7 @@ function pr(n, e) {
|
|
|
4234
4252
|
* See the License for the specific language governing permissions and
|
|
4235
4253
|
* limitations under the License.
|
|
4236
4254
|
*/
|
|
4237
|
-
const
|
|
4255
|
+
const _r = "__/auth/handler", vr = "emulator/auth/handler", Ir = encodeURIComponent("fac");
|
|
4238
4256
|
async function st(n, e, t, i, r, s) {
|
|
4239
4257
|
u(
|
|
4240
4258
|
n.config.authDomain,
|
|
@@ -4252,27 +4270,27 @@ async function st(n, e, t, i, r, s) {
|
|
|
4252
4270
|
appName: n.name,
|
|
4253
4271
|
authType: t,
|
|
4254
4272
|
redirectUrl: i,
|
|
4255
|
-
v:
|
|
4273
|
+
v: J,
|
|
4256
4274
|
eventId: r
|
|
4257
4275
|
};
|
|
4258
4276
|
if (e instanceof Dt) {
|
|
4259
4277
|
e.setDefaultLanguage(n.languageCode), o.providerId = e.providerId || "", yn(e.getCustomParameters()) || (o.customParameters = JSON.stringify(e.getCustomParameters()));
|
|
4260
|
-
for (const [d,
|
|
4261
|
-
o[d] =
|
|
4278
|
+
for (const [d, f] of Object.entries({}))
|
|
4279
|
+
o[d] = f;
|
|
4262
4280
|
}
|
|
4263
|
-
if (e instanceof
|
|
4264
|
-
const d = e.getScopes().filter((
|
|
4281
|
+
if (e instanceof Q) {
|
|
4282
|
+
const d = e.getScopes().filter((f) => f !== "");
|
|
4265
4283
|
d.length > 0 && (o.scopes = d.join(","));
|
|
4266
4284
|
}
|
|
4267
4285
|
n.tenantId && (o.tid = n.tenantId);
|
|
4268
4286
|
const c = o;
|
|
4269
4287
|
for (const d of Object.keys(c))
|
|
4270
4288
|
c[d] === void 0 && delete c[d];
|
|
4271
|
-
const a = await n._getAppCheckToken(), l = a ? `#${
|
|
4272
|
-
return `${
|
|
4289
|
+
const a = await n._getAppCheckToken(), l = a ? `#${Ir}=${encodeURIComponent(a)}` : "";
|
|
4290
|
+
return `${Tr(n)}?${Y(c).slice(1)}${l}`;
|
|
4273
4291
|
}
|
|
4274
|
-
function
|
|
4275
|
-
return n.emulator ? Ce(n,
|
|
4292
|
+
function Tr({ config: n }) {
|
|
4293
|
+
return n.emulator ? Ce(n, vr) : `https://${n.authDomain}/${_r}`;
|
|
4276
4294
|
}
|
|
4277
4295
|
/**
|
|
4278
4296
|
* @license
|
|
@@ -4291,29 +4309,29 @@ function vr({ config: n }) {
|
|
|
4291
4309
|
* limitations under the License.
|
|
4292
4310
|
*/
|
|
4293
4311
|
const we = "webStorageSupport";
|
|
4294
|
-
class
|
|
4312
|
+
class wr {
|
|
4295
4313
|
constructor() {
|
|
4296
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence =
|
|
4314
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = Ht, this._completeRedirectFn = Bi, this._overrideRedirectResult = Wi;
|
|
4297
4315
|
}
|
|
4298
4316
|
// Wrapping in async even though we don't await anywhere in order
|
|
4299
4317
|
// to make sure errors are raised as promise rejections
|
|
4300
4318
|
async _openPopup(e, t, i, r) {
|
|
4301
4319
|
var s;
|
|
4302
|
-
|
|
4320
|
+
S((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4303
4321
|
const o = await st(e, t, i, Ee(), r);
|
|
4304
|
-
return
|
|
4322
|
+
return mr(e, o, Me());
|
|
4305
4323
|
}
|
|
4306
4324
|
async _openRedirect(e, t, i, r) {
|
|
4307
4325
|
await this._originValidation(e);
|
|
4308
4326
|
const s = await st(e, t, i, Ee(), r);
|
|
4309
|
-
return
|
|
4327
|
+
return ki(s), new Promise(() => {
|
|
4310
4328
|
});
|
|
4311
4329
|
}
|
|
4312
4330
|
_initialize(e) {
|
|
4313
4331
|
const t = e._key();
|
|
4314
4332
|
if (this.eventManagers[t]) {
|
|
4315
4333
|
const { manager: r, promise: s } = this.eventManagers[t];
|
|
4316
|
-
return r ? Promise.resolve(r) : (
|
|
4334
|
+
return r ? Promise.resolve(r) : (S(s, "If manager is not set, promise should be"), s);
|
|
4317
4335
|
}
|
|
4318
4336
|
const i = this.initAndGetManager(e);
|
|
4319
4337
|
return this.eventManagers[t] = { promise: i }, i.catch(() => {
|
|
@@ -4321,7 +4339,7 @@ class Ir {
|
|
|
4321
4339
|
}), i;
|
|
4322
4340
|
}
|
|
4323
4341
|
async initAndGetManager(e) {
|
|
4324
|
-
const t = await
|
|
4342
|
+
const t = await lr(e), i = new zi(e);
|
|
4325
4343
|
return t.register("authEvent", (r) => (u(
|
|
4326
4344
|
r == null ? void 0 : r.authEvent,
|
|
4327
4345
|
e,
|
|
@@ -4336,7 +4354,7 @@ class Ir {
|
|
|
4336
4354
|
this.iframes[e._key()].send(we, { type: we }, (r) => {
|
|
4337
4355
|
var s;
|
|
4338
4356
|
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[we];
|
|
4339
|
-
o !== void 0 && t(!!o),
|
|
4357
|
+
o !== void 0 && t(!!o), b(
|
|
4340
4358
|
e,
|
|
4341
4359
|
"internal-error"
|
|
4342
4360
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -4345,13 +4363,13 @@ class Ir {
|
|
|
4345
4363
|
}
|
|
4346
4364
|
_originValidation(e) {
|
|
4347
4365
|
const t = e._key();
|
|
4348
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
4366
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Qi(e)), this.originValidationPromises[t];
|
|
4349
4367
|
}
|
|
4350
4368
|
get _shouldInitProactively() {
|
|
4351
|
-
return Nt() || Ne() ||
|
|
4369
|
+
return Nt() || Ne() || pe();
|
|
4352
4370
|
}
|
|
4353
4371
|
}
|
|
4354
|
-
const
|
|
4372
|
+
const yr = wr;
|
|
4355
4373
|
var ot = "@firebase/auth", at = "1.7.5";
|
|
4356
4374
|
/**
|
|
4357
4375
|
* @license
|
|
@@ -4369,7 +4387,7 @@ var ot = "@firebase/auth", at = "1.7.5";
|
|
|
4369
4387
|
* See the License for the specific language governing permissions and
|
|
4370
4388
|
* limitations under the License.
|
|
4371
4389
|
*/
|
|
4372
|
-
class
|
|
4390
|
+
class Er {
|
|
4373
4391
|
constructor(e) {
|
|
4374
4392
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
4375
4393
|
}
|
|
@@ -4420,7 +4438,7 @@ class wr {
|
|
|
4420
4438
|
* See the License for the specific language governing permissions and
|
|
4421
4439
|
* limitations under the License.
|
|
4422
4440
|
*/
|
|
4423
|
-
function
|
|
4441
|
+
function kr(n) {
|
|
4424
4442
|
switch (n) {
|
|
4425
4443
|
case "Node":
|
|
4426
4444
|
return "node";
|
|
@@ -4436,7 +4454,7 @@ function yr(n) {
|
|
|
4436
4454
|
return;
|
|
4437
4455
|
}
|
|
4438
4456
|
}
|
|
4439
|
-
function
|
|
4457
|
+
function br(n) {
|
|
4440
4458
|
je(new Ge(
|
|
4441
4459
|
"auth",
|
|
4442
4460
|
(e, { options: t }) => {
|
|
@@ -4450,8 +4468,8 @@ function Er(n) {
|
|
|
4450
4468
|
tokenApiHost: "securetoken.googleapis.com",
|
|
4451
4469
|
apiScheme: "https",
|
|
4452
4470
|
sdkClientVersion: Lt(n)
|
|
4453
|
-
}, l = new
|
|
4454
|
-
return
|
|
4471
|
+
}, l = new ei(i, r, s, a);
|
|
4472
|
+
return oi(l, t), l;
|
|
4455
4473
|
},
|
|
4456
4474
|
"PUBLIC"
|
|
4457
4475
|
/* ComponentType.PUBLIC */
|
|
@@ -4466,18 +4484,18 @@ function Er(n) {
|
|
|
4466
4484
|
})), je(new Ge(
|
|
4467
4485
|
"auth-internal",
|
|
4468
4486
|
(e) => {
|
|
4469
|
-
const t =
|
|
4487
|
+
const t = me(e.getProvider(
|
|
4470
4488
|
"auth"
|
|
4471
4489
|
/* _ComponentName.AUTH */
|
|
4472
4490
|
).getImmediate());
|
|
4473
|
-
return ((i) => new
|
|
4491
|
+
return ((i) => new Er(i))(t);
|
|
4474
4492
|
},
|
|
4475
4493
|
"PRIVATE"
|
|
4476
4494
|
/* ComponentType.PRIVATE */
|
|
4477
4495
|
).setInstantiationMode(
|
|
4478
4496
|
"EXPLICIT"
|
|
4479
4497
|
/* InstantiationMode.EXPLICIT */
|
|
4480
|
-
)), ye(ot, at,
|
|
4498
|
+
)), ye(ot, at, kr(n)), ye(ot, at, "esm2017");
|
|
4481
4499
|
}
|
|
4482
4500
|
/**
|
|
4483
4501
|
* @license
|
|
@@ -4495,11 +4513,11 @@ function Er(n) {
|
|
|
4495
4513
|
* See the License for the specific language governing permissions and
|
|
4496
4514
|
* limitations under the License.
|
|
4497
4515
|
*/
|
|
4498
|
-
const
|
|
4516
|
+
const Sr = 5 * 60, Rr = ft("authIdTokenMaxAge") || Sr;
|
|
4499
4517
|
let ct = null;
|
|
4500
|
-
const
|
|
4518
|
+
const Pr = (n) => async (e) => {
|
|
4501
4519
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
4502
|
-
if (i && i >
|
|
4520
|
+
if (i && i > Rr)
|
|
4503
4521
|
return;
|
|
4504
4522
|
const r = t == null ? void 0 : t.token;
|
|
4505
4523
|
ct !== r && (ct = r, await fetch(n, {
|
|
@@ -4509,33 +4527,33 @@ const br = (n) => async (e) => {
|
|
|
4509
4527
|
} : {}
|
|
4510
4528
|
}));
|
|
4511
4529
|
};
|
|
4512
|
-
function
|
|
4530
|
+
function Ar(n = vn()) {
|
|
4513
4531
|
const e = pt(n, "auth");
|
|
4514
4532
|
if (e.isInitialized())
|
|
4515
4533
|
return e.getImmediate();
|
|
4516
|
-
const t =
|
|
4517
|
-
popupRedirectResolver:
|
|
4534
|
+
const t = si(n, {
|
|
4535
|
+
popupRedirectResolver: yr,
|
|
4518
4536
|
persistence: [
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4537
|
+
Li,
|
|
4538
|
+
wi,
|
|
4539
|
+
Ht
|
|
4522
4540
|
]
|
|
4523
4541
|
}), i = ft("authTokenSyncURL");
|
|
4524
4542
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4525
4543
|
const s = new URL(i, location.origin);
|
|
4526
4544
|
if (location.origin === s.origin) {
|
|
4527
|
-
const o =
|
|
4528
|
-
|
|
4545
|
+
const o = Pr(s.toString());
|
|
4546
|
+
_i(t, o, () => o(t.currentUser)), gi(t, (c) => o(c));
|
|
4529
4547
|
}
|
|
4530
4548
|
}
|
|
4531
4549
|
const r = _n("auth");
|
|
4532
|
-
return r &&
|
|
4550
|
+
return r && ai(t, `http://${r}`), t;
|
|
4533
4551
|
}
|
|
4534
|
-
function
|
|
4552
|
+
function Cr() {
|
|
4535
4553
|
var n, e;
|
|
4536
4554
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
4537
4555
|
}
|
|
4538
|
-
|
|
4556
|
+
ti({
|
|
4539
4557
|
loadJS(n) {
|
|
4540
4558
|
return new Promise((e, t) => {
|
|
4541
4559
|
const i = document.createElement("script");
|
|
@@ -4545,53 +4563,60 @@ Zn({
|
|
|
4545
4563
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4546
4564
|
);
|
|
4547
4565
|
s.customData = r, t(s);
|
|
4548
|
-
}, i.type = "text/javascript", i.charset = "UTF-8",
|
|
4566
|
+
}, i.type = "text/javascript", i.charset = "UTF-8", Cr().appendChild(i);
|
|
4549
4567
|
});
|
|
4550
4568
|
},
|
|
4551
4569
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
4552
4570
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
4553
4571
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
4554
4572
|
});
|
|
4555
|
-
|
|
4573
|
+
br(
|
|
4556
4574
|
"Browser"
|
|
4557
4575
|
/* ClientPlatform.BROWSER */
|
|
4558
4576
|
);
|
|
4559
|
-
var
|
|
4560
|
-
const
|
|
4577
|
+
var Or = { 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", clientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4" }, Nr = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedmedev.cc", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc" }, Lr = { mode: "development", appMode: "mf" };
|
|
4578
|
+
const Mr = {
|
|
4561
4579
|
key: 1,
|
|
4562
4580
|
class: "h-full w-full"
|
|
4563
|
-
},
|
|
4581
|
+
}, Ur = ["src"], Yr = /* @__PURE__ */ lt({
|
|
4564
4582
|
__name: "App",
|
|
4565
4583
|
setup(n) {
|
|
4566
|
-
const e = We(), t = on(), i = an(), r = cn(), s = ln(), o = ht(), c =
|
|
4584
|
+
const e = We(), t = on(), i = an(), r = cn(), s = ln(), o = ht(), c = ne(o.query.showHeader !== "false"), a = ne(!1), { currentBusiness: l } = We(), d = ne(!1), f = Ve(() => i.version), _ = Ve(() => {
|
|
4567
4585
|
const p = e.currentCountry.value || "MY", m = Be.getIdToken(), v = l.value._id;
|
|
4568
|
-
return `${
|
|
4586
|
+
return `${Nr.marketingV1Portal}/b/${v}/marketing/overview?showHeader=false&country=${p}&token=${m}`;
|
|
4569
4587
|
});
|
|
4570
|
-
async function
|
|
4588
|
+
async function x() {
|
|
4571
4589
|
if (En().length) {
|
|
4572
4590
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4573
4591
|
return;
|
|
4574
4592
|
}
|
|
4575
|
-
const p = kn(
|
|
4576
|
-
await
|
|
4593
|
+
const p = kn(Or.firebase), m = await sn.getCustomToken(), v = Ar();
|
|
4594
|
+
await mi(v, m), bn(p), console.log("initFirebase", p);
|
|
4577
4595
|
}
|
|
4578
4596
|
const M = async () => {
|
|
4579
|
-
d.value = !1, await tn(), console.log("forceRerender"), Be.setBusinessId(l.value._id), await i.readPremium(), !a.value &&
|
|
4597
|
+
d.value = !1, await tn(), console.log("forceRerender"), Be.setBusinessId(l.value._id), await i.readPremium(), !a.value && f.value === "v2" ? e.registerSidebarComponent(Pn) : e.hideSidebarToggle(!0), await x(), a.value = !0, d.value = !0;
|
|
4580
4598
|
};
|
|
4599
|
+
async function ee() {
|
|
4600
|
+
var p;
|
|
4601
|
+
console.log("initRemyClient.."), await Rn.init({
|
|
4602
|
+
token: ((p = e.sessionUser.value) == null ? void 0 : p.token) || "",
|
|
4603
|
+
dev: Lr.mode === "development"
|
|
4604
|
+
});
|
|
4605
|
+
}
|
|
4581
4606
|
return Xt(() => {
|
|
4582
|
-
if (t.initProvider(r, s), !c.value) {
|
|
4583
|
-
const p = document.getElementsByClassName("app-header")[0], m = document.getElementsByClassName("app-sidebar")[0], v = document.getElementsByClassName("app-container")[0],
|
|
4584
|
-
p == null || p.classList.add("!hidden"), m == null || m.classList.add("!pt-0"), v == null || v.classList.add("!pt-0"),
|
|
4607
|
+
if (Sn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(r, s), !c.value) {
|
|
4608
|
+
const p = document.getElementsByClassName("app-header")[0], m = document.getElementsByClassName("app-sidebar")[0], v = document.getElementsByClassName("app-container")[0], U = document.getElementsByTagName("main")[0];
|
|
4609
|
+
p == null || p.classList.add("!hidden"), m == null || m.classList.add("!pt-0"), v == null || v.classList.add("!pt-0"), U == null || U.classList.add("!pt-0"), e.hideSidebarToggle(!0);
|
|
4585
4610
|
}
|
|
4586
|
-
l.value != null && (console.log("App mounted, forceRerender"), M());
|
|
4611
|
+
l.value != null && (console.log("App mounted, forceRerender"), M()), ee();
|
|
4587
4612
|
}), ut(
|
|
4588
4613
|
() => e.currentBusiness.value,
|
|
4589
4614
|
async (p, m) => {
|
|
4590
4615
|
console.log("Current business changed"), p != null && p._id != m._id && (console.log("forceRerender when business changes", p, m), M());
|
|
4591
4616
|
}
|
|
4592
|
-
), (p, m) => (
|
|
4593
|
-
P(d) && P(
|
|
4594
|
-
P(d) && P(
|
|
4617
|
+
), (p, m) => (ie(), $e(Qt, null, [
|
|
4618
|
+
P(d) && P(f) === "v2" ? (ie(), dt(P(rn), { key: 0 })) : He("", !0),
|
|
4619
|
+
P(d) && P(f) !== "v2" ? (ie(), $e("div", Mr, [
|
|
4595
4620
|
Zt(dn, {
|
|
4596
4621
|
json: { url: P(_) }
|
|
4597
4622
|
}, null, 8, ["json"]),
|
|
@@ -4601,11 +4626,11 @@ const Or = {
|
|
|
4601
4626
|
height: "100%",
|
|
4602
4627
|
width: "100%",
|
|
4603
4628
|
src: P(_)
|
|
4604
|
-
}, null, 8,
|
|
4605
|
-
])) :
|
|
4629
|
+
}, null, 8, Ur)
|
|
4630
|
+
])) : He("", !0)
|
|
4606
4631
|
], 64));
|
|
4607
4632
|
}
|
|
4608
4633
|
});
|
|
4609
4634
|
export {
|
|
4610
|
-
|
|
4635
|
+
Yr as default
|
|
4611
4636
|
};
|