@feedmepos/mf-connect 0.1.0-beta.12 → 0.1.0-beta.14
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-CkcawjWK.js → Analytic-DxTc7gte.js} +9 -9
- package/dist/{App-D75gIHWI.js → App-MM8u0qvP.js} +343 -335
- package/dist/{Broadcast-xVE5hCw_.js → Broadcast-DLjZUfcr.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Aq2Cb3fP.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-ByKi5J-l.js} +8 -8
- package/dist/{Card-DssmCHMD.js → Card-Cc8TtCxD.js} +126 -126
- package/dist/{Collections-_N8BDx7q.js → Collections-CB43gu1C.js} +4 -4
- package/dist/{Credit-ojE-jm0m.js → Credit-Bp0tXt3W.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DgEJar3j.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-z5G1F4rO.js} +67 -64
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DI-T8Axq.js → EffectSheet.vue_vue_type_style_index_0_lang-Bi3mzBfa.js} +6 -6
- package/dist/{Experience-D8mF2t8j.js → Experience-aylihZhv.js} +8 -8
- package/dist/{Game-CVv729v4.js → Game-E1hBMx9B.js} +8 -8
- package/dist/Marketing-C75GsPO0.js +20079 -0
- package/dist/{Member-CtddRogh.js → Member-DIM0L2ir.js} +4 -4
- package/dist/{MemberList-Dy14iRIh.js → MemberList-BQ9l2rT-.js} +82 -82
- package/dist/{MemberTransactions-BbyYs7s5.js → MemberTransactions-BIeKePR1.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CJl9ykLm.js → MessageInput.vue_vue_type_script_setup_true_lang-CthdVonu.js} +2 -2
- package/dist/{Mission-D23417gf.js → Mission-DLjAZCB4.js} +9 -9
- package/dist/{Point-rFotgy4u.js → Point-DHV_rUEE.js} +8 -8
- package/dist/{Promotion-DkYE1TNO.js → Promotion-BVmx40iz.js} +9 -9
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-2hPafP6H.js → RuleGroup.vue_vue_type_script_setup_true_lang-DIrOBrhU.js} +14 -14
- package/dist/Segment-DWroRkTd.js +566 -0
- package/dist/{Setting-C-NxDsVM.js → Setting-M40REBId.js} +8 -8
- package/dist/{Store-fH21d8aK.js → Store-BGOMWZbC.js} +16 -15
- package/dist/{StoreRewards-DEFi4kOl.js → StoreRewards-ChquI2r8.js} +12 -12
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-ClcB1q9v.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CaRCrBJq.js} +11 -11
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B95z7YUi.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DX5xyafo.js} +1 -1
- package/dist/{Tier-DJFOrtfI.js → Tier-CXO0TUgB.js} +15 -15
- package/dist/{Title-DmFbAPR7.js → Title-CMcEfHJa.js} +15 -15
- package/dist/{Transaction-C9m1dpGz.js → Transaction-DkrsndMM.js} +2 -2
- package/dist/{Voucher-Dd7mzT1K.js → Voucher-CqNxcmJo.js} +11 -11
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Bfa4Zyug.js → ZodTextField.vue_vue_type_script_setup_true_lang-2Z2TG2vR.js} +1 -1
- package/dist/{app-BmmvN8Ma.js → app-BzXchd46.js} +1 -1
- package/dist/{app-Cxjp8TQf.js → app-ogyiuzNx.js} +24 -24
- package/dist/app.js +1 -1
- package/dist/{business-BTKr2sRX.js → business-B6IYUBfz.js} +1 -1
- package/dist/{campaign-CAxypog1.js → campaign-DJhUnUbx.js} +2 -2
- package/dist/{collection.fn-N_O-bdfW.js → collection.fn-bmKn9D9l.js} +2 -2
- package/dist/{dto-BFUnKAcz.js → dto-DaUD9ea4.js} +9 -9
- package/dist/{effect-DJUl5gih.js → effect-BvPRfurd.js} +1 -1
- package/dist/{email-addresses-C7JTF21K.js → email-addresses-jLZnlSfX.js} +1 -1
- package/dist/{export-Bj5seGe2.js → export-CsvSurEw.js} +3 -3
- package/dist/{helper-C7svCYuA.js → helper-C_efRMNS.js} +1 -1
- package/dist/{index-DKnQ0PNa.js → index-9A8cUiXS.js} +1 -1
- package/dist/{index-DNvVa7hp.js → index-BEE6Fe4T.js} +1 -1
- package/dist/{index-Dpp_zk4I.js → index-BmDAVnzz.js} +5 -5
- package/dist/{index-DYuaSkbb.js → index-Bu-lsaBh.js} +34 -33
- package/dist/{index-BZFm1_Hu.js → index-CPiO27Uo.js} +2 -2
- package/dist/{index-DTdR02Is.js → index-CjUyqTlF.js} +3 -3
- package/dist/{index-CNZoOa-T.js → index-CsBwKvG4.js} +3 -3
- package/dist/index-CsaQJMAR.js +66 -0
- package/dist/{index-CUmB18pA.js → index-DT6Xb5Xc.js} +1 -1
- package/dist/{index-vCwQaqZ6.js → index-DoePEBOk.js} +2 -2
- package/dist/{index-AjJl4iA1.js → index-gZr8cOWc.js} +1 -1
- package/dist/{index-BN0hRe9Z.js → index-qNnyh15c.js} +1 -1
- package/dist/{index--_NXzrci.js → index-xaFFKjJi.js} +1 -1
- package/dist/{index.esm2017-EENxvUQ9.js → index.esm2017-Bv33d2Yv.js} +33 -33
- package/dist/{loading-CsgL8F3g.js → loading-BiEkXHTA.js} +4 -4
- package/dist/{membership-DNApJdJm.js → membership-giTCy-g8.js} +3 -3
- package/dist/{money-BhrnRE53.js → money-CobGBrLU.js} +1 -1
- package/dist/{number-NCDh9FJ_.js → number-BBRHZBYI.js} +1 -1
- package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
- package/dist/{rule-47bDdocS.js → rule-CqOf5s0o.js} +3 -3
- package/dist/{rule-builder-0DCTMpBm.js → rule-builder-BVtZOrOZ.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-CsVeh5_K.js → template-C4KzHdbK.js} +5 -5
- package/dist/{usePagination-Kd1dOEuD.js → usePagination-CxXG5hyx.js} +1 -1
- package/dist/{vue-i18n-DFkxbLGR.js → vue-i18n-DA4uJ1Yi.js} +2 -2
- package/package.json +6 -5
- package/dist/Marketing-BvPYaaef.js +0 -316
- package/dist/Segment-ClACuFLG.js +0 -562
- package/dist/index-CuvNtC_M.js +0 -61
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { defineComponent as lt, ref as
|
|
1
|
+
import { defineComponent as lt, ref as ne, h as Z, watch as ut, resolveComponent as Yt, openBlock as ie, createBlock as dt, unref as P, computed as Ve, onMounted as Xt, createElementBlock as He, Fragment as Qt, createCommentVNode as $e, 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 f } from "./app-
|
|
5
|
+
import { u as an } from "./business-B6IYUBfz.js";
|
|
6
|
+
import "./index-DT6Xb5Xc.js";
|
|
7
|
+
import { components as ee, useSnackbar as cn, useDialog as ln } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as un } from "./vue-i18n-DA4uJ1Yi.js";
|
|
9
|
+
import { R as f } from "./app-ogyiuzNx.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 z, c as w, d as j, E 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 z, 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 K, o as wn, p as yn, s as En, t as kn, u as bn } from "./index.esm2017-Bv33d2Yv.js";
|
|
12
12
|
import { _ as Pe } from "./tslib.es6-BCqqvLQ_.js";
|
|
13
|
-
import { S as Be, c as
|
|
14
|
-
|
|
13
|
+
import { S as Be, c as Sn } from "./index-CjUyqTlF.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
21
|
value: f["$connect-ANALYTIC"]
|
|
@@ -56,7 +57,7 @@ const Rn = /* @__PURE__ */ lt({
|
|
|
56
57
|
{
|
|
57
58
|
label: e("connect.navigation.point"),
|
|
58
59
|
value: f["$connect-PROGRAM_POINT"],
|
|
59
|
-
badge: () =>
|
|
60
|
+
badge: () => Z(ee.FmPill, { variant: "premium" })
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
63
|
label: e("connect.navigation.credit"),
|
|
@@ -65,7 +66,7 @@ const Rn = /* @__PURE__ */ lt({
|
|
|
65
66
|
{
|
|
66
67
|
label: e("connect.navigation.game"),
|
|
67
68
|
value: f["$connect-PROGRAM_GAME"],
|
|
68
|
-
badge: () =>
|
|
69
|
+
badge: () => Z(ee.FmPill, { variant: "premium" })
|
|
69
70
|
},
|
|
70
71
|
{
|
|
71
72
|
label: "Mission",
|
|
@@ -84,12 +85,12 @@ const Rn = /* @__PURE__ */ lt({
|
|
|
84
85
|
{
|
|
85
86
|
label: e("connect.navigation.segments"),
|
|
86
87
|
value: f["$connect-LOYALTY_SEGMENT"],
|
|
87
|
-
badge: () =>
|
|
88
|
+
badge: () => Z(ee.FmPill, { variant: "premium" })
|
|
88
89
|
},
|
|
89
90
|
{
|
|
90
91
|
label: e("connect.navigation.card"),
|
|
91
92
|
value: f["$connect-LOYALTY_CARD"],
|
|
92
|
-
badge: () =>
|
|
93
|
+
badge: () => Z(ee.FmPill, { variant: "premium" })
|
|
93
94
|
}
|
|
94
95
|
]
|
|
95
96
|
},
|
|
@@ -101,10 +102,10 @@ const Rn = /* @__PURE__ */ lt({
|
|
|
101
102
|
label: e("connect.navigation.transaction"),
|
|
102
103
|
value: f["$connect-TRANSACTION"]
|
|
103
104
|
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
{
|
|
106
|
+
label: "Marketing material",
|
|
107
|
+
value: f["$connect-MARKETING"]
|
|
108
|
+
},
|
|
108
109
|
{
|
|
109
110
|
label: e("connect.navigation.setting"),
|
|
110
111
|
value: f["$connect-SETTING"]
|
|
@@ -124,7 +125,7 @@ const Rn = /* @__PURE__ */ lt({
|
|
|
124
125
|
return (a, l) => {
|
|
125
126
|
var h;
|
|
126
127
|
const d = Yt("FmCollapsibleTabs");
|
|
127
|
-
return
|
|
128
|
+
return ie(), dt(d, {
|
|
128
129
|
class: "border-fm-color-neutral-gray-100 border-r py-16 px-4",
|
|
129
130
|
"model-value": (h = P(t)) == null ? void 0 : h.toString(),
|
|
130
131
|
items: i,
|
|
@@ -133,7 +134,7 @@ const Rn = /* @__PURE__ */ lt({
|
|
|
133
134
|
};
|
|
134
135
|
}
|
|
135
136
|
});
|
|
136
|
-
var
|
|
137
|
+
var An = "firebase", Cn = "10.12.4";
|
|
137
138
|
/**
|
|
138
139
|
* @license
|
|
139
140
|
* Copyright 2020 Google LLC
|
|
@@ -150,13 +151,13 @@ var Pn = "firebase", An = "10.12.4";
|
|
|
150
151
|
* See the License for the specific language governing permissions and
|
|
151
152
|
* limitations under the License.
|
|
152
153
|
*/
|
|
153
|
-
ye(
|
|
154
|
+
ye(An, Cn, "app");
|
|
154
155
|
function gt() {
|
|
155
156
|
return {
|
|
156
157
|
"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
158
|
};
|
|
158
159
|
}
|
|
159
|
-
const
|
|
160
|
+
const On = gt, _t = new Se("auth", "Firebase", gt());
|
|
160
161
|
/**
|
|
161
162
|
* @license
|
|
162
163
|
* Copyright 2020 Google LLC
|
|
@@ -173,12 +174,12 @@ const Cn = gt, _t = new be("auth", "Firebase", gt());
|
|
|
173
174
|
* See the License for the specific language governing permissions and
|
|
174
175
|
* limitations under the License.
|
|
175
176
|
*/
|
|
176
|
-
const
|
|
177
|
-
function
|
|
178
|
-
|
|
177
|
+
const ce = new hn("@firebase/auth");
|
|
178
|
+
function Nn(n, ...e) {
|
|
179
|
+
ce.logLevel <= mt.WARN && ce.warn(`Auth (${z}): ${n}`, ...e);
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
-
|
|
181
|
+
function re(n, ...e) {
|
|
182
|
+
ce.logLevel <= mt.ERROR && ce.error(`Auth (${z}): ${n}`, ...e);
|
|
182
183
|
}
|
|
183
184
|
/**
|
|
184
185
|
* @license
|
|
@@ -196,15 +197,15 @@ function ie(n, ...e) {
|
|
|
196
197
|
* See the License for the specific language governing permissions and
|
|
197
198
|
* limitations under the License.
|
|
198
199
|
*/
|
|
199
|
-
function
|
|
200
|
+
function b(n, ...e) {
|
|
200
201
|
throw Ae(n, ...e);
|
|
201
202
|
}
|
|
202
203
|
function I(n, ...e) {
|
|
203
204
|
return Ae(n, ...e);
|
|
204
205
|
}
|
|
205
206
|
function vt(n, e, t) {
|
|
206
|
-
const i = Object.assign(Object.assign({},
|
|
207
|
-
return new
|
|
207
|
+
const i = Object.assign(Object.assign({}, On()), { [e]: t });
|
|
208
|
+
return new Se("auth", "Firebase", i).create(e, {
|
|
208
209
|
appName: n.name
|
|
209
210
|
});
|
|
210
211
|
}
|
|
@@ -224,9 +225,9 @@ function u(n, e, ...t) {
|
|
|
224
225
|
}
|
|
225
226
|
function y(n) {
|
|
226
227
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
|
227
|
-
throw
|
|
228
|
+
throw re(e), new Error(e);
|
|
228
229
|
}
|
|
229
|
-
function
|
|
230
|
+
function S(n, e) {
|
|
230
231
|
n || y(e);
|
|
231
232
|
}
|
|
232
233
|
/**
|
|
@@ -249,7 +250,7 @@ function Ee() {
|
|
|
249
250
|
var n;
|
|
250
251
|
return typeof self < "u" && ((n = self.location) === null || n === void 0 ? void 0 : n.href) || "";
|
|
251
252
|
}
|
|
252
|
-
function
|
|
253
|
+
function Ln() {
|
|
253
254
|
return qe() === "http:" || qe() === "https:";
|
|
254
255
|
}
|
|
255
256
|
function qe() {
|
|
@@ -272,15 +273,15 @@ function qe() {
|
|
|
272
273
|
* See the License for the specific language governing permissions and
|
|
273
274
|
* limitations under the License.
|
|
274
275
|
*/
|
|
275
|
-
function
|
|
276
|
+
function Mn() {
|
|
276
277
|
return typeof navigator < "u" && navigator && "onLine" in navigator && typeof navigator.onLine == "boolean" && // Apply only for traditional web apps and Chrome extensions.
|
|
277
278
|
// This is especially true for Cordova apps which have unreliable
|
|
278
279
|
// navigator.onLine behavior unless cordova-plugin-network-information is
|
|
279
280
|
// installed which overwrites the native navigator.onLine value and
|
|
280
281
|
// defines navigator.connection.
|
|
281
|
-
(
|
|
282
|
+
(Ln() || mn() || "connection" in navigator) ? navigator.onLine : !0;
|
|
282
283
|
}
|
|
283
|
-
function
|
|
284
|
+
function Un() {
|
|
284
285
|
if (typeof navigator > "u")
|
|
285
286
|
return null;
|
|
286
287
|
const n = navigator;
|
|
@@ -310,10 +311,10 @@ function Mn() {
|
|
|
310
311
|
*/
|
|
311
312
|
class J {
|
|
312
313
|
constructor(e, t) {
|
|
313
|
-
this.shortDelay = e, this.longDelay = t,
|
|
314
|
+
this.shortDelay = e, this.longDelay = t, S(t > e, "Short delay should be less than long delay!"), this.isMobile = fn() || pn();
|
|
314
315
|
}
|
|
315
316
|
get() {
|
|
316
|
-
return
|
|
317
|
+
return Mn() ? this.isMobile ? this.longDelay : this.shortDelay : Math.min(5e3, this.shortDelay);
|
|
317
318
|
}
|
|
318
319
|
}
|
|
319
320
|
/**
|
|
@@ -333,7 +334,7 @@ class J {
|
|
|
333
334
|
* limitations under the License.
|
|
334
335
|
*/
|
|
335
336
|
function Ce(n, e) {
|
|
336
|
-
|
|
337
|
+
S(n.emulator, "Emulator should always be set here");
|
|
337
338
|
const { url: t } = n.emulator;
|
|
338
339
|
return e ? `${t}${e.startsWith("/") ? e.slice(1) : e}` : t;
|
|
339
340
|
}
|
|
@@ -407,7 +408,7 @@ class It {
|
|
|
407
408
|
* See the License for the specific language governing permissions and
|
|
408
409
|
* limitations under the License.
|
|
409
410
|
*/
|
|
410
|
-
const
|
|
411
|
+
const Dn = {
|
|
411
412
|
// Custom token errors.
|
|
412
413
|
CREDENTIAL_MISMATCH: "custom-token-mismatch",
|
|
413
414
|
// This can only happen if the SDK sends a bad request.
|
|
@@ -498,8 +499,8 @@ const Un = {
|
|
|
498
499
|
* See the License for the specific language governing permissions and
|
|
499
500
|
* limitations under the License.
|
|
500
501
|
*/
|
|
501
|
-
const
|
|
502
|
-
function
|
|
502
|
+
const Fn = new J(3e4, 6e4);
|
|
503
|
+
function fe(n, e) {
|
|
503
504
|
return n.tenantId && !e.tenantId ? Object.assign(Object.assign({}, e), { tenantId: n.tenantId }) : e;
|
|
504
505
|
}
|
|
505
506
|
async function G(n, e, t, i, r = {}) {
|
|
@@ -524,40 +525,40 @@ async function G(n, e, t, i, r = {}) {
|
|
|
524
525
|
}
|
|
525
526
|
async function Tt(n, e, t) {
|
|
526
527
|
n._canInitEmulator = !1;
|
|
527
|
-
const i = Object.assign(Object.assign({},
|
|
528
|
+
const i = Object.assign(Object.assign({}, Dn), e);
|
|
528
529
|
try {
|
|
529
|
-
const r = new
|
|
530
|
+
const r = new xn(n), s = await Promise.race([
|
|
530
531
|
t(),
|
|
531
532
|
r.promise
|
|
532
533
|
]);
|
|
533
534
|
r.clearNetworkTimeout();
|
|
534
535
|
const o = await s.json();
|
|
535
536
|
if ("needConfirmation" in o)
|
|
536
|
-
throw
|
|
537
|
+
throw te(n, "account-exists-with-different-credential", o);
|
|
537
538
|
if (s.ok && !("errorMessage" in o))
|
|
538
539
|
return o;
|
|
539
540
|
{
|
|
540
541
|
const c = s.ok ? o.errorMessage : o.error.message, [a, l] = c.split(" : ");
|
|
541
542
|
if (a === "FEDERATED_USER_ID_ALREADY_LINKED")
|
|
542
|
-
throw
|
|
543
|
+
throw te(n, "credential-already-in-use", o);
|
|
543
544
|
if (a === "EMAIL_EXISTS")
|
|
544
|
-
throw
|
|
545
|
+
throw te(n, "email-already-in-use", o);
|
|
545
546
|
if (a === "USER_DISABLED")
|
|
546
|
-
throw
|
|
547
|
+
throw te(n, "user-disabled", o);
|
|
547
548
|
const d = i[a] || a.toLowerCase().replace(/[_\s]+/g, "-");
|
|
548
549
|
if (l)
|
|
549
550
|
throw vt(n, d, l);
|
|
550
|
-
|
|
551
|
+
b(n, d);
|
|
551
552
|
}
|
|
552
553
|
} catch (r) {
|
|
553
554
|
if (r instanceof Re)
|
|
554
555
|
throw r;
|
|
555
|
-
|
|
556
|
+
b(n, "network-request-failed", { message: String(r) });
|
|
556
557
|
}
|
|
557
558
|
}
|
|
558
559
|
async function wt(n, e, t, i, r = {}) {
|
|
559
560
|
const s = await G(n, e, t, i, r);
|
|
560
|
-
return "mfaPendingCredential" in s &&
|
|
561
|
+
return "mfaPendingCredential" in s && b(n, "multi-factor-auth-required", {
|
|
561
562
|
_serverResponse: s
|
|
562
563
|
}), s;
|
|
563
564
|
}
|
|
@@ -565,21 +566,21 @@ function yt(n, e, t, i) {
|
|
|
565
566
|
const r = `${e}${t}?${i}`;
|
|
566
567
|
return n.config.emulator ? Ce(n.config, r) : `${n.config.apiScheme}://${r}`;
|
|
567
568
|
}
|
|
568
|
-
class
|
|
569
|
+
class xn {
|
|
569
570
|
constructor(e) {
|
|
570
571
|
this.auth = e, this.timer = null, this.promise = new Promise((t, i) => {
|
|
571
572
|
this.timer = setTimeout(() => i(I(
|
|
572
573
|
this.auth,
|
|
573
574
|
"network-request-failed"
|
|
574
575
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
575
|
-
)),
|
|
576
|
+
)), Fn.get());
|
|
576
577
|
});
|
|
577
578
|
}
|
|
578
579
|
clearNetworkTimeout() {
|
|
579
580
|
clearTimeout(this.timer);
|
|
580
581
|
}
|
|
581
582
|
}
|
|
582
|
-
function
|
|
583
|
+
function te(n, e, t) {
|
|
583
584
|
const i = {
|
|
584
585
|
appName: n.name
|
|
585
586
|
};
|
|
@@ -603,7 +604,7 @@ function ee(n, e, t) {
|
|
|
603
604
|
* See the License for the specific language governing permissions and
|
|
604
605
|
* limitations under the License.
|
|
605
606
|
*/
|
|
606
|
-
async function
|
|
607
|
+
async function Vn(n, e) {
|
|
607
608
|
return G(n, "POST", "/v1/accounts:delete", e);
|
|
608
609
|
}
|
|
609
610
|
async function Et(n, e) {
|
|
@@ -634,7 +635,7 @@ function B(n) {
|
|
|
634
635
|
} catch {
|
|
635
636
|
}
|
|
636
637
|
}
|
|
637
|
-
async function
|
|
638
|
+
async function Hn(n, e = !1) {
|
|
638
639
|
const t = j(n), i = await t.getIdToken(e), r = Oe(i);
|
|
639
640
|
u(
|
|
640
641
|
r && r.exp && r.auth_time && r.iat,
|
|
@@ -659,12 +660,12 @@ function Te(n) {
|
|
|
659
660
|
function Oe(n) {
|
|
660
661
|
const [e, t, i] = n.split(".");
|
|
661
662
|
if (e === void 0 || t === void 0 || i === void 0)
|
|
662
|
-
return
|
|
663
|
+
return re("JWT malformed, contained fewer than 3 sections"), null;
|
|
663
664
|
try {
|
|
664
665
|
const r = Tn(t);
|
|
665
|
-
return r ? JSON.parse(r) : (
|
|
666
|
+
return r ? JSON.parse(r) : (re("Failed to decode base64 JWT payload"), null);
|
|
666
667
|
} catch (r) {
|
|
667
|
-
return
|
|
668
|
+
return re("Caught error parsing JWT payload as JSON", r == null ? void 0 : r.toString()), null;
|
|
668
669
|
}
|
|
669
670
|
}
|
|
670
671
|
function ze(n) {
|
|
@@ -705,10 +706,10 @@ async function q(n, e, t = !1) {
|
|
|
705
706
|
try {
|
|
706
707
|
return await e;
|
|
707
708
|
} catch (i) {
|
|
708
|
-
throw i instanceof Re &&
|
|
709
|
+
throw i instanceof Re && $n(i) && n.auth.currentUser === n && await n.auth.signOut(), i;
|
|
709
710
|
}
|
|
710
711
|
}
|
|
711
|
-
function
|
|
712
|
+
function $n({ code: n }) {
|
|
712
713
|
return n === "auth/user-disabled" || n === "auth/user-token-expired";
|
|
713
714
|
}
|
|
714
715
|
/**
|
|
@@ -727,7 +728,7 @@ function Hn({ code: n }) {
|
|
|
727
728
|
* See the License for the specific language governing permissions and
|
|
728
729
|
* limitations under the License.
|
|
729
730
|
*/
|
|
730
|
-
class
|
|
731
|
+
class Wn {
|
|
731
732
|
constructor(e) {
|
|
732
733
|
this.user = e, this.isRunning = !1, this.timerId = null, this.errorBackoff = 3e4;
|
|
733
734
|
}
|
|
@@ -822,7 +823,7 @@ class ke {
|
|
|
822
823
|
* See the License for the specific language governing permissions and
|
|
823
824
|
* limitations under the License.
|
|
824
825
|
*/
|
|
825
|
-
async function
|
|
826
|
+
async function le(n) {
|
|
826
827
|
var e;
|
|
827
828
|
const t = n.auth, i = await n.getIdToken(), r = await q(n, Et(t, { idToken: i }));
|
|
828
829
|
u(
|
|
@@ -833,7 +834,7 @@ async function ce(n) {
|
|
|
833
834
|
);
|
|
834
835
|
const s = r.users[0];
|
|
835
836
|
n._notifyReloadListener(s);
|
|
836
|
-
const o = !((e = s.providerUserInfo) === null || e === void 0) && e.length ? kt(s.providerUserInfo) : [], c =
|
|
837
|
+
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, h = {
|
|
837
838
|
uid: s.localId,
|
|
838
839
|
displayName: s.displayName || null,
|
|
839
840
|
photoURL: s.photoUrl || null,
|
|
@@ -847,11 +848,11 @@ async function ce(n) {
|
|
|
847
848
|
};
|
|
848
849
|
Object.assign(n, h);
|
|
849
850
|
}
|
|
850
|
-
async function
|
|
851
|
+
async function jn(n) {
|
|
851
852
|
const e = j(n);
|
|
852
|
-
await
|
|
853
|
+
await le(e), await e.auth._persistUserIfCurrent(e), e.auth._notifyListenersIfCurrent(e);
|
|
853
854
|
}
|
|
854
|
-
function
|
|
855
|
+
function Gn(n, e) {
|
|
855
856
|
return [...n.filter((i) => !e.some((r) => r.providerId === i.providerId)), ...e];
|
|
856
857
|
}
|
|
857
858
|
function kt(n) {
|
|
@@ -883,7 +884,7 @@ function kt(n) {
|
|
|
883
884
|
* See the License for the specific language governing permissions and
|
|
884
885
|
* limitations under the License.
|
|
885
886
|
*/
|
|
886
|
-
async function
|
|
887
|
+
async function Bn(n, e) {
|
|
887
888
|
const t = await Tt(n, {}, async () => {
|
|
888
889
|
const i = K({
|
|
889
890
|
grant_type: "refresh_token",
|
|
@@ -904,8 +905,8 @@ async function Gn(n, e) {
|
|
|
904
905
|
refreshToken: t.refresh_token
|
|
905
906
|
};
|
|
906
907
|
}
|
|
907
|
-
async function
|
|
908
|
-
return G(n, "POST", "/v2/accounts:revokeToken",
|
|
908
|
+
async function qn(n, e) {
|
|
909
|
+
return G(n, "POST", "/v2/accounts:revokeToken", fe(n, e));
|
|
909
910
|
}
|
|
910
911
|
/**
|
|
911
912
|
* @license
|
|
@@ -968,7 +969,7 @@ class H {
|
|
|
968
969
|
this.refreshToken = null;
|
|
969
970
|
}
|
|
970
971
|
async refresh(e, t) {
|
|
971
|
-
const { accessToken: i, refreshToken: r, expiresIn: s } = await
|
|
972
|
+
const { accessToken: i, refreshToken: r, expiresIn: s } = await Bn(e, t);
|
|
972
973
|
this.updateTokensAndExpiration(i, r, Number(s));
|
|
973
974
|
}
|
|
974
975
|
updateTokensAndExpiration(e, t, i) {
|
|
@@ -1023,7 +1024,7 @@ function R(n, e) {
|
|
|
1023
1024
|
class E {
|
|
1024
1025
|
constructor(e) {
|
|
1025
1026
|
var { uid: t, auth: i, stsTokenManager: r } = e, s = Pe(e, ["uid", "auth", "stsTokenManager"]);
|
|
1026
|
-
this.providerId = "firebase", this.proactiveRefresh = new
|
|
1027
|
+
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
1028
|
}
|
|
1028
1029
|
async getIdToken(e) {
|
|
1029
1030
|
const t = await q(this, this.stsTokenManager.getToken(this.auth, e));
|
|
@@ -1035,10 +1036,10 @@ class E {
|
|
|
1035
1036
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
|
1036
1037
|
}
|
|
1037
1038
|
getIdTokenResult(e) {
|
|
1038
|
-
return
|
|
1039
|
+
return Hn(this, e);
|
|
1039
1040
|
}
|
|
1040
1041
|
reload() {
|
|
1041
|
-
return
|
|
1042
|
+
return jn(this);
|
|
1042
1043
|
}
|
|
1043
1044
|
_assign(e) {
|
|
1044
1045
|
this !== e && (u(
|
|
@@ -1071,13 +1072,13 @@ class E {
|
|
|
1071
1072
|
}
|
|
1072
1073
|
async _updateTokensIfNecessary(e, t = !1) {
|
|
1073
1074
|
let i = !1;
|
|
1074
|
-
e.idToken && e.idToken !== this.stsTokenManager.accessToken && (this.stsTokenManager.updateFromServerResponse(e), i = !0), t && await
|
|
1075
|
+
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
1076
|
}
|
|
1076
1077
|
async delete() {
|
|
1077
1078
|
if (w(this.auth.app))
|
|
1078
1079
|
return Promise.reject(L(this.auth));
|
|
1079
1080
|
const e = await this.getIdToken();
|
|
1080
|
-
return await q(this,
|
|
1081
|
+
return await q(this, Vn(this.auth, { idToken: e })), this.stsTokenManager.clearRefreshToken(), this.auth.signOut();
|
|
1081
1082
|
}
|
|
1082
1083
|
toJSON() {
|
|
1083
1084
|
return Object.assign(Object.assign({
|
|
@@ -1105,16 +1106,16 @@ class E {
|
|
|
1105
1106
|
}
|
|
1106
1107
|
static _fromJSON(e, t) {
|
|
1107
1108
|
var i, r, s, o, c, a, l, d;
|
|
1108
|
-
const h = (i = t.displayName) !== null && i !== void 0 ? i : void 0, _ = (r = t.email) !== null && r !== void 0 ? r : void 0,
|
|
1109
|
+
const h = (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, Q = (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
1110
|
u(
|
|
1110
|
-
|
|
1111
|
+
U && xe,
|
|
1111
1112
|
e,
|
|
1112
1113
|
"internal-error"
|
|
1113
1114
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1114
1115
|
);
|
|
1115
1116
|
const Kt = H.fromJSON(this.name, xe);
|
|
1116
1117
|
u(
|
|
1117
|
-
typeof
|
|
1118
|
+
typeof U == "string",
|
|
1118
1119
|
e,
|
|
1119
1120
|
"internal-error"
|
|
1120
1121
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -1128,22 +1129,22 @@ class E {
|
|
|
1128
1129
|
e,
|
|
1129
1130
|
"internal-error"
|
|
1130
1131
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
1131
|
-
), R(
|
|
1132
|
+
), R(x, e.name), R(M, e.name), R(Q, e.name), R(p, e.name), R(m, e.name), R(v, e.name);
|
|
1132
1133
|
const Ie = new E({
|
|
1133
|
-
uid:
|
|
1134
|
+
uid: U,
|
|
1134
1135
|
auth: e,
|
|
1135
1136
|
email: _,
|
|
1136
1137
|
emailVerified: De,
|
|
1137
1138
|
displayName: h,
|
|
1138
1139
|
isAnonymous: Fe,
|
|
1139
1140
|
photoURL: M,
|
|
1140
|
-
phoneNumber:
|
|
1141
|
-
tenantId:
|
|
1141
|
+
phoneNumber: x,
|
|
1142
|
+
tenantId: Q,
|
|
1142
1143
|
stsTokenManager: Kt,
|
|
1143
|
-
createdAt:
|
|
1144
|
-
lastLoginAt:
|
|
1144
|
+
createdAt: m,
|
|
1145
|
+
lastLoginAt: v
|
|
1145
1146
|
});
|
|
1146
|
-
return ve && Array.isArray(ve) && (Ie.providerData = ve.map((Jt) => Object.assign({}, Jt))),
|
|
1147
|
+
return ve && Array.isArray(ve) && (Ie.providerData = ve.map((Jt) => Object.assign({}, Jt))), p && (Ie._redirectEventId = p), Ie;
|
|
1147
1148
|
}
|
|
1148
1149
|
/**
|
|
1149
1150
|
* Initialize a User from an idToken server response
|
|
@@ -1159,7 +1160,7 @@ class E {
|
|
|
1159
1160
|
stsTokenManager: r,
|
|
1160
1161
|
isAnonymous: i
|
|
1161
1162
|
});
|
|
1162
|
-
return await
|
|
1163
|
+
return await le(s), s;
|
|
1163
1164
|
}
|
|
1164
1165
|
/**
|
|
1165
1166
|
* Initialize a User from an idToken server response
|
|
@@ -1213,9 +1214,9 @@ class E {
|
|
|
1213
1214
|
*/
|
|
1214
1215
|
const Ke = /* @__PURE__ */ new Map();
|
|
1215
1216
|
function k(n) {
|
|
1216
|
-
|
|
1217
|
+
S(n instanceof Function, "Expected a class definition");
|
|
1217
1218
|
let e = Ke.get(n);
|
|
1218
|
-
return e ? (
|
|
1219
|
+
return e ? (S(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), Ke.set(n, e), e);
|
|
1219
1220
|
}
|
|
1220
1221
|
/**
|
|
1221
1222
|
* @license
|
|
@@ -1233,7 +1234,7 @@ function k(n) {
|
|
|
1233
1234
|
* See the License for the specific language governing permissions and
|
|
1234
1235
|
* limitations under the License.
|
|
1235
1236
|
*/
|
|
1236
|
-
class
|
|
1237
|
+
class bt {
|
|
1237
1238
|
constructor() {
|
|
1238
1239
|
this.type = "NONE", this.storage = {};
|
|
1239
1240
|
}
|
|
@@ -1255,8 +1256,8 @@ class St {
|
|
|
1255
1256
|
_removeListener(e, t) {
|
|
1256
1257
|
}
|
|
1257
1258
|
}
|
|
1258
|
-
|
|
1259
|
-
const Je =
|
|
1259
|
+
bt.type = "NONE";
|
|
1260
|
+
const Je = bt;
|
|
1260
1261
|
/**
|
|
1261
1262
|
* @license
|
|
1262
1263
|
* Copyright 2019 Google LLC
|
|
@@ -1273,14 +1274,14 @@ const Je = St;
|
|
|
1273
1274
|
* See the License for the specific language governing permissions and
|
|
1274
1275
|
* limitations under the License.
|
|
1275
1276
|
*/
|
|
1276
|
-
function
|
|
1277
|
+
function se(n, e, t) {
|
|
1277
1278
|
return `firebase:${n}:${e}:${t}`;
|
|
1278
1279
|
}
|
|
1279
1280
|
class $ {
|
|
1280
1281
|
constructor(e, t, i) {
|
|
1281
1282
|
this.persistence = e, this.auth = t, this.userKey = i;
|
|
1282
1283
|
const { config: r, name: s } = this.auth;
|
|
1283
|
-
this.fullUserKey =
|
|
1284
|
+
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
1285
|
}
|
|
1285
1286
|
setCurrentUser(e) {
|
|
1286
1287
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
|
@@ -1313,7 +1314,7 @@ class $ {
|
|
|
1313
1314
|
return l;
|
|
1314
1315
|
}))).filter((l) => l);
|
|
1315
1316
|
let s = r[0] || k(Je);
|
|
1316
|
-
const o =
|
|
1317
|
+
const o = se(i, e.config.apiKey, e.name);
|
|
1317
1318
|
let c = null;
|
|
1318
1319
|
for (const l of t)
|
|
1319
1320
|
try {
|
|
@@ -1361,7 +1362,7 @@ function Ye(n) {
|
|
|
1361
1362
|
return "IE";
|
|
1362
1363
|
if (e.includes("edge/"))
|
|
1363
1364
|
return "Edge";
|
|
1364
|
-
if (
|
|
1365
|
+
if (St(e))
|
|
1365
1366
|
return "Firefox";
|
|
1366
1367
|
if (e.includes("silk/"))
|
|
1367
1368
|
return "Silk";
|
|
@@ -1382,7 +1383,7 @@ function Ye(n) {
|
|
|
1382
1383
|
}
|
|
1383
1384
|
return "Other";
|
|
1384
1385
|
}
|
|
1385
|
-
function
|
|
1386
|
+
function St(n = g()) {
|
|
1386
1387
|
return /firefox\//i.test(n);
|
|
1387
1388
|
}
|
|
1388
1389
|
function Ne(n = g()) {
|
|
@@ -1404,20 +1405,20 @@ function Ct(n = g()) {
|
|
|
1404
1405
|
function Ot(n = g()) {
|
|
1405
1406
|
return /webos/i.test(n);
|
|
1406
1407
|
}
|
|
1407
|
-
function
|
|
1408
|
+
function pe(n = g()) {
|
|
1408
1409
|
return /iphone|ipad|ipod/i.test(n) || /macintosh/i.test(n) && /mobile/i.test(n);
|
|
1409
1410
|
}
|
|
1410
|
-
function
|
|
1411
|
+
function zn(n = g()) {
|
|
1411
1412
|
var e;
|
|
1412
|
-
return
|
|
1413
|
+
return pe(n) && !!(!((e = window.navigator) === null || e === void 0) && e.standalone);
|
|
1413
1414
|
}
|
|
1414
|
-
function
|
|
1415
|
+
function Kn() {
|
|
1415
1416
|
return wn() && document.documentMode === 10;
|
|
1416
1417
|
}
|
|
1417
1418
|
function Nt(n = g()) {
|
|
1418
|
-
return
|
|
1419
|
+
return pe(n) || At(n) || Ot(n) || Ct(n) || /windows phone/i.test(n) || Pt(n);
|
|
1419
1420
|
}
|
|
1420
|
-
function
|
|
1421
|
+
function Jn() {
|
|
1421
1422
|
try {
|
|
1422
1423
|
return !!(window && window !== window.top);
|
|
1423
1424
|
} catch {
|
|
@@ -1471,7 +1472,7 @@ function Lt(n, e = []) {
|
|
|
1471
1472
|
* See the License for the specific language governing permissions and
|
|
1472
1473
|
* limitations under the License.
|
|
1473
1474
|
*/
|
|
1474
|
-
class
|
|
1475
|
+
class Yn {
|
|
1475
1476
|
constructor(e) {
|
|
1476
1477
|
this.auth = e, this.queue = [];
|
|
1477
1478
|
}
|
|
@@ -1526,8 +1527,8 @@ class Jn {
|
|
|
1526
1527
|
* See the License for the specific language governing permissions and
|
|
1527
1528
|
* limitations under the License.
|
|
1528
1529
|
*/
|
|
1529
|
-
async function
|
|
1530
|
-
return G(n, "GET", "/v2/passwordPolicy",
|
|
1530
|
+
async function Xn(n, e = {}) {
|
|
1531
|
+
return G(n, "GET", "/v2/passwordPolicy", fe(n, e));
|
|
1531
1532
|
}
|
|
1532
1533
|
/**
|
|
1533
1534
|
* @license
|
|
@@ -1545,12 +1546,12 @@ async function Yn(n, e = {}) {
|
|
|
1545
1546
|
* See the License for the specific language governing permissions and
|
|
1546
1547
|
* limitations under the License.
|
|
1547
1548
|
*/
|
|
1548
|
-
const
|
|
1549
|
-
class
|
|
1549
|
+
const Qn = 6;
|
|
1550
|
+
class Zn {
|
|
1550
1551
|
constructor(e) {
|
|
1551
1552
|
var t, i, r, s;
|
|
1552
1553
|
const o = e.customStrengthOptions;
|
|
1553
|
-
this.customStrengthOptions = {}, this.customStrengthOptions.minPasswordLength = (t = o.minPasswordLength) !== null && t !== void 0 ? t :
|
|
1554
|
+
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
1555
|
}
|
|
1555
1556
|
validatePassword(e) {
|
|
1556
1557
|
var t, i, r, s, o, c;
|
|
@@ -1633,9 +1634,9 @@ class Qn {
|
|
|
1633
1634
|
* See the License for the specific language governing permissions and
|
|
1634
1635
|
* limitations under the License.
|
|
1635
1636
|
*/
|
|
1636
|
-
class
|
|
1637
|
+
class ei {
|
|
1637
1638
|
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
|
|
1639
|
+
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
1640
|
}
|
|
1640
1641
|
_initializeWithPersistence(e, t) {
|
|
1641
1642
|
return t && (this._popupRedirectResolver = k(t)), this._initializationPromise = this.queue(async () => {
|
|
@@ -1721,7 +1722,7 @@ class Zn {
|
|
|
1721
1722
|
}
|
|
1722
1723
|
async reloadAndSetCurrentUserOrClear(e) {
|
|
1723
1724
|
try {
|
|
1724
|
-
await
|
|
1725
|
+
await le(e);
|
|
1725
1726
|
} catch (t) {
|
|
1726
1727
|
if ((t == null ? void 0 : t.code) !== "auth/network-request-failed")
|
|
1727
1728
|
return this.directlySetCurrentUser(null);
|
|
@@ -1729,7 +1730,7 @@ class Zn {
|
|
|
1729
1730
|
return this.directlySetCurrentUser(e);
|
|
1730
1731
|
}
|
|
1731
1732
|
useDeviceLanguage() {
|
|
1732
|
-
this.languageCode =
|
|
1733
|
+
this.languageCode = Un();
|
|
1733
1734
|
}
|
|
1734
1735
|
async _delete() {
|
|
1735
1736
|
this._deleted = !0;
|
|
@@ -1780,14 +1781,14 @@ class Zn {
|
|
|
1780
1781
|
return this.tenantId === null ? this._projectPasswordPolicy : this._tenantPasswordPolicies[this.tenantId];
|
|
1781
1782
|
}
|
|
1782
1783
|
async _updatePasswordPolicy() {
|
|
1783
|
-
const e = await
|
|
1784
|
+
const e = await Xn(this), t = new Zn(e);
|
|
1784
1785
|
this.tenantId === null ? this._projectPasswordPolicy = t : this._tenantPasswordPolicies[this.tenantId] = t;
|
|
1785
1786
|
}
|
|
1786
1787
|
_getPersistence() {
|
|
1787
1788
|
return this.assertedPersistence.persistence.type;
|
|
1788
1789
|
}
|
|
1789
1790
|
_updateErrorMap(e) {
|
|
1790
|
-
this._errorFactory = new
|
|
1791
|
+
this._errorFactory = new Se("auth", "Firebase", e());
|
|
1791
1792
|
}
|
|
1792
1793
|
onAuthStateChanged(e, t, i) {
|
|
1793
1794
|
return this.registerStateListener(this.authStateSubscription, e, t, i);
|
|
@@ -1820,7 +1821,7 @@ class Zn {
|
|
|
1820
1821
|
token: e,
|
|
1821
1822
|
idToken: t
|
|
1822
1823
|
};
|
|
1823
|
-
this.tenantId != null && (i.tenantId = this.tenantId), await
|
|
1824
|
+
this.tenantId != null && (i.tenantId = this.tenantId), await qn(this, i);
|
|
1824
1825
|
}
|
|
1825
1826
|
}
|
|
1826
1827
|
toJSON() {
|
|
@@ -1963,10 +1964,10 @@ class Zn {
|
|
|
1963
1964
|
async _getAppCheckToken() {
|
|
1964
1965
|
var e;
|
|
1965
1966
|
const t = await ((e = this.appCheckServiceProvider.getImmediate({ optional: !0 })) === null || e === void 0 ? void 0 : e.getToken());
|
|
1966
|
-
return t != null && t.error &&
|
|
1967
|
+
return t != null && t.error && Nn(`Error while retrieving App Check token: ${t.error}`), t == null ? void 0 : t.token;
|
|
1967
1968
|
}
|
|
1968
1969
|
}
|
|
1969
|
-
function
|
|
1970
|
+
function me(n) {
|
|
1970
1971
|
return j(n);
|
|
1971
1972
|
}
|
|
1972
1973
|
class Xe {
|
|
@@ -2006,16 +2007,16 @@ let Le = {
|
|
|
2006
2007
|
recaptchaEnterpriseScript: "",
|
|
2007
2008
|
gapiScript: ""
|
|
2008
2009
|
};
|
|
2009
|
-
function
|
|
2010
|
+
function ti(n) {
|
|
2010
2011
|
Le = n;
|
|
2011
2012
|
}
|
|
2012
|
-
function
|
|
2013
|
+
function ni(n) {
|
|
2013
2014
|
return Le.loadJS(n);
|
|
2014
2015
|
}
|
|
2015
|
-
function
|
|
2016
|
+
function ii() {
|
|
2016
2017
|
return Le.gapiScript;
|
|
2017
2018
|
}
|
|
2018
|
-
function
|
|
2019
|
+
function ri(n) {
|
|
2019
2020
|
return `__${n}${Math.floor(Math.random() * 1e6)}`;
|
|
2020
2021
|
}
|
|
2021
2022
|
/**
|
|
@@ -2034,13 +2035,13 @@ function ii(n) {
|
|
|
2034
2035
|
* See the License for the specific language governing permissions and
|
|
2035
2036
|
* limitations under the License.
|
|
2036
2037
|
*/
|
|
2037
|
-
function
|
|
2038
|
+
function si(n, e) {
|
|
2038
2039
|
const t = pt(n, "auth");
|
|
2039
2040
|
if (t.isInitialized()) {
|
|
2040
2041
|
const r = t.getImmediate(), s = t.getOptions();
|
|
2041
2042
|
if (In(s, e ?? {}))
|
|
2042
2043
|
return r;
|
|
2043
|
-
|
|
2044
|
+
b(
|
|
2044
2045
|
r,
|
|
2045
2046
|
"already-initialized"
|
|
2046
2047
|
/* AuthErrorCode.ALREADY_INITIALIZED */
|
|
@@ -2048,12 +2049,12 @@ function ri(n, e) {
|
|
|
2048
2049
|
}
|
|
2049
2050
|
return t.initialize({ options: e });
|
|
2050
2051
|
}
|
|
2051
|
-
function
|
|
2052
|
+
function oi(n, e) {
|
|
2052
2053
|
const t = (e == null ? void 0 : e.persistence) || [], i = (Array.isArray(t) ? t : [t]).map(k);
|
|
2053
2054
|
e != null && e.errorMap && n._updateErrorMap(e.errorMap), n._initializeWithPersistence(i, e == null ? void 0 : e.popupRedirectResolver);
|
|
2054
2055
|
}
|
|
2055
|
-
function
|
|
2056
|
-
const i =
|
|
2056
|
+
function ai(n, e, t) {
|
|
2057
|
+
const i = me(n);
|
|
2057
2058
|
u(
|
|
2058
2059
|
i._canInitEmulator,
|
|
2059
2060
|
i,
|
|
@@ -2065,19 +2066,19 @@ function oi(n, e, t) {
|
|
|
2065
2066
|
"invalid-emulator-scheme"
|
|
2066
2067
|
/* AuthErrorCode.INVALID_EMULATOR_SCHEME */
|
|
2067
2068
|
);
|
|
2068
|
-
const r = !1, s = Mt(e), { host: o, port: c } =
|
|
2069
|
+
const r = !1, s = Mt(e), { host: o, port: c } = ci(e), a = c === null ? "" : `:${c}`;
|
|
2069
2070
|
i.config.emulator = { url: `${s}//${o}${a}/` }, i.settings.appVerificationDisabledForTesting = !0, i.emulatorConfig = Object.freeze({
|
|
2070
2071
|
host: o,
|
|
2071
2072
|
port: c,
|
|
2072
2073
|
protocol: s.replace(":", ""),
|
|
2073
2074
|
options: Object.freeze({ disableWarnings: r })
|
|
2074
|
-
}),
|
|
2075
|
+
}), li();
|
|
2075
2076
|
}
|
|
2076
2077
|
function Mt(n) {
|
|
2077
2078
|
const e = n.indexOf(":");
|
|
2078
2079
|
return e < 0 ? "" : n.substr(0, e + 1);
|
|
2079
2080
|
}
|
|
2080
|
-
function
|
|
2081
|
+
function ci(n) {
|
|
2081
2082
|
const e = Mt(n), t = /(\/\/)?([^?#/]+)/.exec(n.substr(e.length));
|
|
2082
2083
|
if (!t)
|
|
2083
2084
|
return { host: "", port: null };
|
|
@@ -2096,7 +2097,7 @@ function Qe(n) {
|
|
|
2096
2097
|
const e = Number(n);
|
|
2097
2098
|
return isNaN(e) ? null : e;
|
|
2098
2099
|
}
|
|
2099
|
-
function
|
|
2100
|
+
function li() {
|
|
2100
2101
|
function n() {
|
|
2101
2102
|
const e = document.createElement("p"), t = e.style;
|
|
2102
2103
|
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 +2163,7 @@ class Ut {
|
|
|
2162
2163
|
* limitations under the License.
|
|
2163
2164
|
*/
|
|
2164
2165
|
async function W(n, e) {
|
|
2165
|
-
return wt(n, "POST", "/v1/accounts:signInWithIdp",
|
|
2166
|
+
return wt(n, "POST", "/v1/accounts:signInWithIdp", fe(n, e));
|
|
2166
2167
|
}
|
|
2167
2168
|
/**
|
|
2168
2169
|
* @license
|
|
@@ -2180,15 +2181,15 @@ async function W(n, e) {
|
|
|
2180
2181
|
* See the License for the specific language governing permissions and
|
|
2181
2182
|
* limitations under the License.
|
|
2182
2183
|
*/
|
|
2183
|
-
const
|
|
2184
|
-
class
|
|
2184
|
+
const ui = "http://localhost";
|
|
2185
|
+
class D extends Ut {
|
|
2185
2186
|
constructor() {
|
|
2186
2187
|
super(...arguments), this.pendingToken = null;
|
|
2187
2188
|
}
|
|
2188
2189
|
/** @internal */
|
|
2189
2190
|
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) :
|
|
2191
|
+
const t = new D(e.providerId, e.signInMethod);
|
|
2192
|
+
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
2193
|
"argument-error"
|
|
2193
2194
|
/* AuthErrorCode.ARGUMENT_ERROR */
|
|
2194
2195
|
), t;
|
|
@@ -2218,7 +2219,7 @@ class U extends Ut {
|
|
|
2218
2219
|
const t = typeof e == "string" ? JSON.parse(e) : e, { providerId: i, signInMethod: r } = t, s = Pe(t, ["providerId", "signInMethod"]);
|
|
2219
2220
|
if (!i || !r)
|
|
2220
2221
|
return null;
|
|
2221
|
-
const o = new
|
|
2222
|
+
const o = new D(i, r);
|
|
2222
2223
|
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
2224
|
}
|
|
2224
2225
|
/** @internal */
|
|
@@ -2238,7 +2239,7 @@ class U extends Ut {
|
|
|
2238
2239
|
}
|
|
2239
2240
|
buildRequest() {
|
|
2240
2241
|
const e = {
|
|
2241
|
-
requestUri:
|
|
2242
|
+
requestUri: ui,
|
|
2242
2243
|
returnSecureToken: !0
|
|
2243
2244
|
};
|
|
2244
2245
|
if (this.pendingToken)
|
|
@@ -2374,7 +2375,7 @@ class A extends Y {
|
|
|
2374
2375
|
* @param accessToken - Facebook access token.
|
|
2375
2376
|
*/
|
|
2376
2377
|
static credential(e) {
|
|
2377
|
-
return
|
|
2378
|
+
return D._fromParams({
|
|
2378
2379
|
providerId: A.PROVIDER_ID,
|
|
2379
2380
|
signInMethod: A.FACEBOOK_SIGN_IN_METHOD,
|
|
2380
2381
|
accessToken: e
|
|
@@ -2446,7 +2447,7 @@ class C extends Y {
|
|
|
2446
2447
|
* @param accessToken - Google access token.
|
|
2447
2448
|
*/
|
|
2448
2449
|
static credential(e, t) {
|
|
2449
|
-
return
|
|
2450
|
+
return D._fromParams({
|
|
2450
2451
|
providerId: C.PROVIDER_ID,
|
|
2451
2452
|
signInMethod: C.GOOGLE_SIGN_IN_METHOD,
|
|
2452
2453
|
idToken: e,
|
|
@@ -2514,7 +2515,7 @@ class O extends Y {
|
|
|
2514
2515
|
* @param accessToken - Github access token.
|
|
2515
2516
|
*/
|
|
2516
2517
|
static credential(e) {
|
|
2517
|
-
return
|
|
2518
|
+
return D._fromParams({
|
|
2518
2519
|
providerId: O.PROVIDER_ID,
|
|
2519
2520
|
signInMethod: O.GITHUB_SIGN_IN_METHOD,
|
|
2520
2521
|
accessToken: e
|
|
@@ -2579,7 +2580,7 @@ class N extends Y {
|
|
|
2579
2580
|
* @param secret - Twitter secret.
|
|
2580
2581
|
*/
|
|
2581
2582
|
static credential(e, t) {
|
|
2582
|
-
return
|
|
2583
|
+
return D._fromParams({
|
|
2583
2584
|
providerId: N.PROVIDER_ID,
|
|
2584
2585
|
signInMethod: N.TWITTER_SIGN_IN_METHOD,
|
|
2585
2586
|
oauthToken: e,
|
|
@@ -2634,13 +2635,13 @@ N.PROVIDER_ID = "twitter.com";
|
|
|
2634
2635
|
* See the License for the specific language governing permissions and
|
|
2635
2636
|
* limitations under the License.
|
|
2636
2637
|
*/
|
|
2637
|
-
class
|
|
2638
|
+
class F {
|
|
2638
2639
|
constructor(e) {
|
|
2639
2640
|
this.user = e.user, this.providerId = e.providerId, this._tokenResponse = e._tokenResponse, this.operationType = e.operationType;
|
|
2640
2641
|
}
|
|
2641
2642
|
static async _fromIdTokenResponse(e, t, i, r = !1) {
|
|
2642
2643
|
const s = await E._fromIdTokenResponse(e, i, r), o = Ze(i);
|
|
2643
|
-
return new
|
|
2644
|
+
return new F({
|
|
2644
2645
|
user: s,
|
|
2645
2646
|
providerId: o,
|
|
2646
2647
|
_tokenResponse: i,
|
|
@@ -2654,7 +2655,7 @@ class D {
|
|
|
2654
2655
|
!0
|
|
2655
2656
|
);
|
|
2656
2657
|
const r = Ze(i);
|
|
2657
|
-
return new
|
|
2658
|
+
return new F({
|
|
2658
2659
|
user: e,
|
|
2659
2660
|
providerId: r,
|
|
2660
2661
|
_tokenResponse: i,
|
|
@@ -2681,10 +2682,10 @@ function Ze(n) {
|
|
|
2681
2682
|
* See the License for the specific language governing permissions and
|
|
2682
2683
|
* limitations under the License.
|
|
2683
2684
|
*/
|
|
2684
|
-
class
|
|
2685
|
+
class ue extends Re {
|
|
2685
2686
|
constructor(e, t, i, r) {
|
|
2686
2687
|
var s;
|
|
2687
|
-
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this,
|
|
2688
|
+
super(t.code, t.message), this.operationType = i, this.user = r, Object.setPrototypeOf(this, ue.prototype), this.customData = {
|
|
2688
2689
|
appName: e.name,
|
|
2689
2690
|
tenantId: (s = e.tenantId) !== null && s !== void 0 ? s : void 0,
|
|
2690
2691
|
_serverResponse: t.customData._serverResponse,
|
|
@@ -2692,17 +2693,17 @@ class le extends Re {
|
|
|
2692
2693
|
};
|
|
2693
2694
|
}
|
|
2694
2695
|
static _fromErrorAndOperation(e, t, i, r) {
|
|
2695
|
-
return new
|
|
2696
|
+
return new ue(e, t, i, r);
|
|
2696
2697
|
}
|
|
2697
2698
|
}
|
|
2698
2699
|
function Ft(n, e, t, i) {
|
|
2699
2700
|
return (e === "reauthenticate" ? t._getReauthenticationResolver(n) : t._getIdTokenResponse(n)).catch((s) => {
|
|
2700
|
-
throw s.code === "auth/multi-factor-auth-required" ?
|
|
2701
|
+
throw s.code === "auth/multi-factor-auth-required" ? ue._fromErrorAndOperation(n, s, e, i) : s;
|
|
2701
2702
|
});
|
|
2702
2703
|
}
|
|
2703
|
-
async function
|
|
2704
|
+
async function di(n, e, t = !1) {
|
|
2704
2705
|
const i = await q(n, e._linkToIdToken(n.auth, await n.getIdToken()), t);
|
|
2705
|
-
return
|
|
2706
|
+
return F._forOperation(n, "link", i);
|
|
2706
2707
|
}
|
|
2707
2708
|
/**
|
|
2708
2709
|
* @license
|
|
@@ -2720,7 +2721,7 @@ async function ui(n, e, t = !1) {
|
|
|
2720
2721
|
* See the License for the specific language governing permissions and
|
|
2721
2722
|
* limitations under the License.
|
|
2722
2723
|
*/
|
|
2723
|
-
async function
|
|
2724
|
+
async function hi(n, e, t = !1) {
|
|
2724
2725
|
const { auth: i } = n;
|
|
2725
2726
|
if (w(i.app))
|
|
2726
2727
|
return Promise.reject(L(i));
|
|
@@ -2746,9 +2747,9 @@ async function di(n, e, t = !1) {
|
|
|
2746
2747
|
i,
|
|
2747
2748
|
"user-mismatch"
|
|
2748
2749
|
/* AuthErrorCode.USER_MISMATCH */
|
|
2749
|
-
),
|
|
2750
|
+
), F._forOperation(n, r, s);
|
|
2750
2751
|
} catch (s) {
|
|
2751
|
-
throw (s == null ? void 0 : s.code) === "auth/user-not-found" &&
|
|
2752
|
+
throw (s == null ? void 0 : s.code) === "auth/user-not-found" && b(
|
|
2752
2753
|
i,
|
|
2753
2754
|
"user-mismatch"
|
|
2754
2755
|
/* AuthErrorCode.USER_MISMATCH */
|
|
@@ -2771,10 +2772,10 @@ async function di(n, e, t = !1) {
|
|
|
2771
2772
|
* See the License for the specific language governing permissions and
|
|
2772
2773
|
* limitations under the License.
|
|
2773
2774
|
*/
|
|
2774
|
-
async function
|
|
2775
|
+
async function fi(n, e, t = !1) {
|
|
2775
2776
|
if (w(n.app))
|
|
2776
2777
|
return Promise.reject(L(n));
|
|
2777
|
-
const i = "signIn", r = await Ft(n, i, e), s = await
|
|
2778
|
+
const i = "signIn", r = await Ft(n, i, e), s = await F._fromIdTokenResponse(n, i, r);
|
|
2778
2779
|
return t || await n._updateCurrentUser(s.user), s;
|
|
2779
2780
|
}
|
|
2780
2781
|
/**
|
|
@@ -2793,8 +2794,8 @@ async function hi(n, e, t = !1) {
|
|
|
2793
2794
|
* See the License for the specific language governing permissions and
|
|
2794
2795
|
* limitations under the License.
|
|
2795
2796
|
*/
|
|
2796
|
-
async function
|
|
2797
|
-
return wt(n, "POST", "/v1/accounts:signInWithCustomToken",
|
|
2797
|
+
async function pi(n, e) {
|
|
2798
|
+
return wt(n, "POST", "/v1/accounts:signInWithCustomToken", fe(n, e));
|
|
2798
2799
|
}
|
|
2799
2800
|
/**
|
|
2800
2801
|
* @license
|
|
@@ -2812,22 +2813,22 @@ async function fi(n, e) {
|
|
|
2812
2813
|
* See the License for the specific language governing permissions and
|
|
2813
2814
|
* limitations under the License.
|
|
2814
2815
|
*/
|
|
2815
|
-
async function
|
|
2816
|
+
async function mi(n, e) {
|
|
2816
2817
|
if (w(n.app))
|
|
2817
2818
|
return Promise.reject(L(n));
|
|
2818
|
-
const t =
|
|
2819
|
+
const t = me(n), i = await pi(t, {
|
|
2819
2820
|
token: e,
|
|
2820
2821
|
returnSecureToken: !0
|
|
2821
|
-
}), r = await
|
|
2822
|
+
}), r = await F._fromIdTokenResponse(t, "signIn", i);
|
|
2822
2823
|
return await t._updateCurrentUser(r.user), r;
|
|
2823
2824
|
}
|
|
2824
|
-
function
|
|
2825
|
+
function gi(n, e, t, i) {
|
|
2825
2826
|
return j(n).onIdTokenChanged(e, t, i);
|
|
2826
2827
|
}
|
|
2827
|
-
function
|
|
2828
|
+
function _i(n, e, t) {
|
|
2828
2829
|
return j(n).beforeAuthStateChanged(e, t);
|
|
2829
2830
|
}
|
|
2830
|
-
const
|
|
2831
|
+
const de = "__sak";
|
|
2831
2832
|
/**
|
|
2832
2833
|
* @license
|
|
2833
2834
|
* Copyright 2019 Google LLC
|
|
@@ -2850,7 +2851,7 @@ class xt {
|
|
|
2850
2851
|
}
|
|
2851
2852
|
_isAvailable() {
|
|
2852
2853
|
try {
|
|
2853
|
-
return this.storage ? (this.storage.setItem(
|
|
2854
|
+
return this.storage ? (this.storage.setItem(de, "1"), this.storage.removeItem(de), Promise.resolve(!0)) : Promise.resolve(!1);
|
|
2854
2855
|
} catch {
|
|
2855
2856
|
return Promise.resolve(!1);
|
|
2856
2857
|
}
|
|
@@ -2885,18 +2886,18 @@ class xt {
|
|
|
2885
2886
|
* See the License for the specific language governing permissions and
|
|
2886
2887
|
* limitations under the License.
|
|
2887
2888
|
*/
|
|
2888
|
-
function
|
|
2889
|
+
function vi() {
|
|
2889
2890
|
const n = g();
|
|
2890
|
-
return Ne(n) ||
|
|
2891
|
+
return Ne(n) || pe(n);
|
|
2891
2892
|
}
|
|
2892
|
-
const
|
|
2893
|
+
const Ii = 1e3, Ti = 10;
|
|
2893
2894
|
class Vt extends xt {
|
|
2894
2895
|
constructor() {
|
|
2895
2896
|
super(
|
|
2896
2897
|
() => window.localStorage,
|
|
2897
2898
|
"LOCAL"
|
|
2898
2899
|
/* PersistenceType.LOCAL */
|
|
2899
|
-
), this.boundEventHandler = (e, t) => this.onStorageEvent(e, t), this.listeners = {}, this.localCache = {}, this.pollTimer = null, this.safariLocalStorageNotSynced =
|
|
2900
|
+
), 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
2901
|
}
|
|
2901
2902
|
forAllChangedKeys(e) {
|
|
2902
2903
|
for (const t of Object.keys(this.listeners)) {
|
|
@@ -2923,7 +2924,7 @@ class Vt extends xt {
|
|
|
2923
2924
|
const o = this.storage.getItem(i);
|
|
2924
2925
|
!t && this.localCache[i] === o || this.notifyListeners(i, o);
|
|
2925
2926
|
}, s = this.storage.getItem(i);
|
|
2926
|
-
|
|
2927
|
+
Kn() && s !== e.newValue && e.newValue !== e.oldValue ? setTimeout(r, Ti) : r();
|
|
2927
2928
|
}
|
|
2928
2929
|
notifyListeners(e, t) {
|
|
2929
2930
|
this.localCache[e] = t;
|
|
@@ -2945,7 +2946,7 @@ class Vt extends xt {
|
|
|
2945
2946
|
!0
|
|
2946
2947
|
);
|
|
2947
2948
|
});
|
|
2948
|
-
},
|
|
2949
|
+
}, Ii);
|
|
2949
2950
|
}
|
|
2950
2951
|
stopPolling() {
|
|
2951
2952
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -2975,7 +2976,7 @@ class Vt extends xt {
|
|
|
2975
2976
|
}
|
|
2976
2977
|
}
|
|
2977
2978
|
Vt.type = "LOCAL";
|
|
2978
|
-
const
|
|
2979
|
+
const wi = Vt;
|
|
2979
2980
|
/**
|
|
2980
2981
|
* @license
|
|
2981
2982
|
* Copyright 2020 Google LLC
|
|
@@ -3023,7 +3024,7 @@ const $t = Ht;
|
|
|
3023
3024
|
* See the License for the specific language governing permissions and
|
|
3024
3025
|
* limitations under the License.
|
|
3025
3026
|
*/
|
|
3026
|
-
function
|
|
3027
|
+
function yi(n) {
|
|
3027
3028
|
return Promise.all(n.map(async (e) => {
|
|
3028
3029
|
try {
|
|
3029
3030
|
return {
|
|
@@ -3054,7 +3055,7 @@ function wi(n) {
|
|
|
3054
3055
|
* See the License for the specific language governing permissions and
|
|
3055
3056
|
* limitations under the License.
|
|
3056
3057
|
*/
|
|
3057
|
-
class
|
|
3058
|
+
class ge {
|
|
3058
3059
|
constructor(e) {
|
|
3059
3060
|
this.eventTarget = e, this.handlersMap = {}, this.boundEventHandler = this.handleEvent.bind(this);
|
|
3060
3061
|
}
|
|
@@ -3068,7 +3069,7 @@ class me {
|
|
|
3068
3069
|
const t = this.receivers.find((r) => r.isListeningto(e));
|
|
3069
3070
|
if (t)
|
|
3070
3071
|
return t;
|
|
3071
|
-
const i = new
|
|
3072
|
+
const i = new ge(e);
|
|
3072
3073
|
return this.receivers.push(i), i;
|
|
3073
3074
|
}
|
|
3074
3075
|
isListeningto(e) {
|
|
@@ -3093,7 +3094,7 @@ class me {
|
|
|
3093
3094
|
eventId: i,
|
|
3094
3095
|
eventType: r
|
|
3095
3096
|
});
|
|
3096
|
-
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await
|
|
3097
|
+
const c = Array.from(o).map(async (l) => l(t.origin, s)), a = await yi(c);
|
|
3097
3098
|
t.ports[0].postMessage({
|
|
3098
3099
|
status: "done",
|
|
3099
3100
|
eventId: i,
|
|
@@ -3122,7 +3123,7 @@ class me {
|
|
|
3122
3123
|
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
3124
|
}
|
|
3124
3125
|
}
|
|
3125
|
-
|
|
3126
|
+
ge.receivers = [];
|
|
3126
3127
|
/**
|
|
3127
3128
|
* @license
|
|
3128
3129
|
* Copyright 2020 Google LLC
|
|
@@ -3161,7 +3162,7 @@ function Me(n = "", e = 10) {
|
|
|
3161
3162
|
* See the License for the specific language governing permissions and
|
|
3162
3163
|
* limitations under the License.
|
|
3163
3164
|
*/
|
|
3164
|
-
class
|
|
3165
|
+
class Ei {
|
|
3165
3166
|
constructor(e) {
|
|
3166
3167
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
|
3167
3168
|
}
|
|
@@ -3261,7 +3262,7 @@ class yi {
|
|
|
3261
3262
|
function T() {
|
|
3262
3263
|
return window;
|
|
3263
3264
|
}
|
|
3264
|
-
function
|
|
3265
|
+
function ki(n) {
|
|
3265
3266
|
T().location.href = n;
|
|
3266
3267
|
}
|
|
3267
3268
|
/**
|
|
@@ -3283,7 +3284,7 @@ function Ei(n) {
|
|
|
3283
3284
|
function Wt() {
|
|
3284
3285
|
return typeof T().WorkerGlobalScope < "u" && typeof T().importScripts == "function";
|
|
3285
3286
|
}
|
|
3286
|
-
async function
|
|
3287
|
+
async function bi() {
|
|
3287
3288
|
if (!(navigator != null && navigator.serviceWorker))
|
|
3288
3289
|
return null;
|
|
3289
3290
|
try {
|
|
@@ -3296,7 +3297,7 @@ function Si() {
|
|
|
3296
3297
|
var n;
|
|
3297
3298
|
return ((n = navigator == null ? void 0 : navigator.serviceWorker) === null || n === void 0 ? void 0 : n.controller) || null;
|
|
3298
3299
|
}
|
|
3299
|
-
function
|
|
3300
|
+
function Ri() {
|
|
3300
3301
|
return Wt() ? self : null;
|
|
3301
3302
|
}
|
|
3302
3303
|
/**
|
|
@@ -3315,7 +3316,7 @@ function bi() {
|
|
|
3315
3316
|
* See the License for the specific language governing permissions and
|
|
3316
3317
|
* limitations under the License.
|
|
3317
3318
|
*/
|
|
3318
|
-
const jt = "firebaseLocalStorageDb",
|
|
3319
|
+
const jt = "firebaseLocalStorageDb", Pi = 1, he = "firebaseLocalStorage", Gt = "fbase_key";
|
|
3319
3320
|
class X {
|
|
3320
3321
|
constructor(e) {
|
|
3321
3322
|
this.request = e;
|
|
@@ -3330,47 +3331,47 @@ class X {
|
|
|
3330
3331
|
});
|
|
3331
3332
|
}
|
|
3332
3333
|
}
|
|
3333
|
-
function
|
|
3334
|
-
return n.transaction([
|
|
3334
|
+
function _e(n, e) {
|
|
3335
|
+
return n.transaction([he], e ? "readwrite" : "readonly").objectStore(he);
|
|
3335
3336
|
}
|
|
3336
|
-
function
|
|
3337
|
+
function Ai() {
|
|
3337
3338
|
const n = indexedDB.deleteDatabase(jt);
|
|
3338
3339
|
return new X(n).toPromise();
|
|
3339
3340
|
}
|
|
3340
|
-
function
|
|
3341
|
-
const n = indexedDB.open(jt,
|
|
3341
|
+
function be() {
|
|
3342
|
+
const n = indexedDB.open(jt, Pi);
|
|
3342
3343
|
return new Promise((e, t) => {
|
|
3343
3344
|
n.addEventListener("error", () => {
|
|
3344
3345
|
t(n.error);
|
|
3345
3346
|
}), n.addEventListener("upgradeneeded", () => {
|
|
3346
3347
|
const i = n.result;
|
|
3347
3348
|
try {
|
|
3348
|
-
i.createObjectStore(
|
|
3349
|
+
i.createObjectStore(he, { keyPath: Gt });
|
|
3349
3350
|
} catch (r) {
|
|
3350
3351
|
t(r);
|
|
3351
3352
|
}
|
|
3352
3353
|
}), n.addEventListener("success", async () => {
|
|
3353
3354
|
const i = n.result;
|
|
3354
|
-
i.objectStoreNames.contains(
|
|
3355
|
+
i.objectStoreNames.contains(he) ? e(i) : (i.close(), await Ai(), e(await be()));
|
|
3355
3356
|
});
|
|
3356
3357
|
});
|
|
3357
3358
|
}
|
|
3358
3359
|
async function et(n, e, t) {
|
|
3359
|
-
const i =
|
|
3360
|
+
const i = _e(n, !0).put({
|
|
3360
3361
|
[Gt]: e,
|
|
3361
3362
|
value: t
|
|
3362
3363
|
});
|
|
3363
3364
|
return new X(i).toPromise();
|
|
3364
3365
|
}
|
|
3365
|
-
async function
|
|
3366
|
-
const t =
|
|
3366
|
+
async function Ci(n, e) {
|
|
3367
|
+
const t = _e(n, !1).get(e), i = await new X(t).toPromise();
|
|
3367
3368
|
return i === void 0 ? null : i.value;
|
|
3368
3369
|
}
|
|
3369
3370
|
function tt(n, e) {
|
|
3370
|
-
const t =
|
|
3371
|
+
const t = _e(n, !0).delete(e);
|
|
3371
3372
|
return new X(t).toPromise();
|
|
3372
3373
|
}
|
|
3373
|
-
const
|
|
3374
|
+
const Oi = 800, Ni = 3;
|
|
3374
3375
|
class Bt {
|
|
3375
3376
|
constructor() {
|
|
3376
3377
|
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 +3379,7 @@ class Bt {
|
|
|
3378
3379
|
});
|
|
3379
3380
|
}
|
|
3380
3381
|
async _openDb() {
|
|
3381
|
-
return this.db ? this.db : (this.db = await
|
|
3382
|
+
return this.db ? this.db : (this.db = await be(), this.db);
|
|
3382
3383
|
}
|
|
3383
3384
|
async _withRetries(e) {
|
|
3384
3385
|
let t = 0;
|
|
@@ -3387,7 +3388,7 @@ class Bt {
|
|
|
3387
3388
|
const i = await this._openDb();
|
|
3388
3389
|
return await e(i);
|
|
3389
3390
|
} catch (i) {
|
|
3390
|
-
if (t++ >
|
|
3391
|
+
if (t++ > Ni)
|
|
3391
3392
|
throw i;
|
|
3392
3393
|
this.db && (this.db.close(), this.db = void 0);
|
|
3393
3394
|
}
|
|
@@ -3403,7 +3404,7 @@ class Bt {
|
|
|
3403
3404
|
* As the worker we should listen to events from the main window.
|
|
3404
3405
|
*/
|
|
3405
3406
|
async initializeReceiver() {
|
|
3406
|
-
this.receiver =
|
|
3407
|
+
this.receiver = ge._getInstance(Ri()), this.receiver._subscribe("keyChanged", async (e, t) => ({
|
|
3407
3408
|
keyProcessed: (await this._poll()).includes(t.key)
|
|
3408
3409
|
})), this.receiver._subscribe("ping", async (e, t) => [
|
|
3409
3410
|
"keyChanged"
|
|
@@ -3419,9 +3420,9 @@ class Bt {
|
|
|
3419
3420
|
*/
|
|
3420
3421
|
async initializeSender() {
|
|
3421
3422
|
var e, t;
|
|
3422
|
-
if (this.activeServiceWorker = await
|
|
3423
|
+
if (this.activeServiceWorker = await bi(), !this.activeServiceWorker)
|
|
3423
3424
|
return;
|
|
3424
|
-
this.sender = new
|
|
3425
|
+
this.sender = new Ei(this.activeServiceWorker);
|
|
3425
3426
|
const i = await this.sender._send(
|
|
3426
3427
|
"ping",
|
|
3427
3428
|
{},
|
|
@@ -3459,8 +3460,8 @@ class Bt {
|
|
|
3459
3460
|
try {
|
|
3460
3461
|
if (!indexedDB)
|
|
3461
3462
|
return !1;
|
|
3462
|
-
const e = await
|
|
3463
|
-
return await et(e,
|
|
3463
|
+
const e = await be();
|
|
3464
|
+
return await et(e, de, "1"), await tt(e, de), !0;
|
|
3464
3465
|
} catch {
|
|
3465
3466
|
}
|
|
3466
3467
|
return !1;
|
|
@@ -3477,7 +3478,7 @@ class Bt {
|
|
|
3477
3478
|
return this._withPendingWrite(async () => (await this._withRetries((i) => et(i, e, t)), this.localCache[e] = t, this.notifyServiceWorker(e)));
|
|
3478
3479
|
}
|
|
3479
3480
|
async _get(e) {
|
|
3480
|
-
const t = await this._withRetries((i) =>
|
|
3481
|
+
const t = await this._withRetries((i) => Ci(i, e));
|
|
3481
3482
|
return this.localCache[e] = t, t;
|
|
3482
3483
|
}
|
|
3483
3484
|
async _remove(e) {
|
|
@@ -3485,7 +3486,7 @@ class Bt {
|
|
|
3485
3486
|
}
|
|
3486
3487
|
async _poll() {
|
|
3487
3488
|
const e = await this._withRetries((r) => {
|
|
3488
|
-
const s =
|
|
3489
|
+
const s = _e(r, !1).getAll();
|
|
3489
3490
|
return new X(s).toPromise();
|
|
3490
3491
|
});
|
|
3491
3492
|
if (!e)
|
|
@@ -3508,7 +3509,7 @@ class Bt {
|
|
|
3508
3509
|
r(t);
|
|
3509
3510
|
}
|
|
3510
3511
|
startPolling() {
|
|
3511
|
-
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(),
|
|
3512
|
+
this.stopPolling(), this.pollTimer = setInterval(async () => this._poll(), Oi);
|
|
3512
3513
|
}
|
|
3513
3514
|
stopPolling() {
|
|
3514
3515
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null);
|
|
@@ -3521,7 +3522,7 @@ class Bt {
|
|
|
3521
3522
|
}
|
|
3522
3523
|
}
|
|
3523
3524
|
Bt.type = "LOCAL";
|
|
3524
|
-
const
|
|
3525
|
+
const Li = Bt;
|
|
3525
3526
|
new J(3e4, 6e4);
|
|
3526
3527
|
/**
|
|
3527
3528
|
* @license
|
|
@@ -3539,7 +3540,7 @@ new J(3e4, 6e4);
|
|
|
3539
3540
|
* See the License for the specific language governing permissions and
|
|
3540
3541
|
* limitations under the License.
|
|
3541
3542
|
*/
|
|
3542
|
-
function
|
|
3543
|
+
function Mi(n, e) {
|
|
3543
3544
|
return e ? k(e) : (u(
|
|
3544
3545
|
n._popupRedirectResolver,
|
|
3545
3546
|
n,
|
|
@@ -3593,26 +3594,26 @@ class Ue extends Ut {
|
|
|
3593
3594
|
return e && (t.idToken = e), t;
|
|
3594
3595
|
}
|
|
3595
3596
|
}
|
|
3596
|
-
function Mi(n) {
|
|
3597
|
-
return hi(n.auth, new Ue(n), n.bypassAuthState);
|
|
3598
|
-
}
|
|
3599
3597
|
function Ui(n) {
|
|
3598
|
+
return fi(n.auth, new Ue(n), n.bypassAuthState);
|
|
3599
|
+
}
|
|
3600
|
+
function Di(n) {
|
|
3600
3601
|
const { auth: e, user: t } = n;
|
|
3601
3602
|
return u(
|
|
3602
3603
|
t,
|
|
3603
3604
|
e,
|
|
3604
3605
|
"internal-error"
|
|
3605
3606
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3606
|
-
),
|
|
3607
|
+
), hi(t, new Ue(n), n.bypassAuthState);
|
|
3607
3608
|
}
|
|
3608
|
-
async function
|
|
3609
|
+
async function Fi(n) {
|
|
3609
3610
|
const { auth: e, user: t } = n;
|
|
3610
3611
|
return u(
|
|
3611
3612
|
t,
|
|
3612
3613
|
e,
|
|
3613
3614
|
"internal-error"
|
|
3614
3615
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
3615
|
-
),
|
|
3616
|
+
), di(t, new Ue(n), n.bypassAuthState);
|
|
3616
3617
|
}
|
|
3617
3618
|
/**
|
|
3618
3619
|
* @license
|
|
@@ -3672,15 +3673,15 @@ class qt {
|
|
|
3672
3673
|
switch (e) {
|
|
3673
3674
|
case "signInViaPopup":
|
|
3674
3675
|
case "signInViaRedirect":
|
|
3675
|
-
return
|
|
3676
|
+
return Ui;
|
|
3676
3677
|
case "linkViaPopup":
|
|
3677
3678
|
case "linkViaRedirect":
|
|
3678
|
-
return
|
|
3679
|
+
return Fi;
|
|
3679
3680
|
case "reauthViaPopup":
|
|
3680
3681
|
case "reauthViaRedirect":
|
|
3681
|
-
return
|
|
3682
|
+
return Di;
|
|
3682
3683
|
default:
|
|
3683
|
-
|
|
3684
|
+
b(
|
|
3684
3685
|
this.auth,
|
|
3685
3686
|
"internal-error"
|
|
3686
3687
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -3688,10 +3689,10 @@ class qt {
|
|
|
3688
3689
|
}
|
|
3689
3690
|
}
|
|
3690
3691
|
resolve(e) {
|
|
3691
|
-
|
|
3692
|
+
S(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.resolve(e), this.unregisterAndCleanUp();
|
|
3692
3693
|
}
|
|
3693
3694
|
reject(e) {
|
|
3694
|
-
|
|
3695
|
+
S(this.pendingPromise, "Pending promise was never set"), this.pendingPromise.reject(e), this.unregisterAndCleanUp();
|
|
3695
3696
|
}
|
|
3696
3697
|
unregisterAndCleanUp() {
|
|
3697
3698
|
this.eventManager && this.eventManager.unregisterConsumer(this), this.pendingPromise = null, this.cleanUp();
|
|
@@ -3713,7 +3714,7 @@ class qt {
|
|
|
3713
3714
|
* See the License for the specific language governing permissions and
|
|
3714
3715
|
* limitations under the License.
|
|
3715
3716
|
*/
|
|
3716
|
-
const
|
|
3717
|
+
const xi = new J(2e3, 1e4);
|
|
3717
3718
|
class V extends qt {
|
|
3718
3719
|
constructor(e, t, i, r, s) {
|
|
3719
3720
|
super(e, t, r, s), this.provider = i, this.authWindow = null, this.pollId = null, V.currentPopupAction && V.currentPopupAction.cancel(), V.currentPopupAction = this;
|
|
@@ -3728,7 +3729,7 @@ class V extends qt {
|
|
|
3728
3729
|
), e;
|
|
3729
3730
|
}
|
|
3730
3731
|
async onExecution() {
|
|
3731
|
-
|
|
3732
|
+
S(this.filter.length === 1, "Popup operations only handle one event");
|
|
3732
3733
|
const e = Me();
|
|
3733
3734
|
this.authWindow = await this.resolver._openPopup(
|
|
3734
3735
|
this.auth,
|
|
@@ -3777,7 +3778,7 @@ class V extends qt {
|
|
|
3777
3778
|
);
|
|
3778
3779
|
return;
|
|
3779
3780
|
}
|
|
3780
|
-
this.pollId = window.setTimeout(e,
|
|
3781
|
+
this.pollId = window.setTimeout(e, xi.get());
|
|
3781
3782
|
};
|
|
3782
3783
|
e();
|
|
3783
3784
|
}
|
|
@@ -3799,8 +3800,8 @@ V.currentPopupAction = null;
|
|
|
3799
3800
|
* See the License for the specific language governing permissions and
|
|
3800
3801
|
* limitations under the License.
|
|
3801
3802
|
*/
|
|
3802
|
-
const
|
|
3803
|
-
class
|
|
3803
|
+
const Vi = "pendingRedirect", oe = /* @__PURE__ */ new Map();
|
|
3804
|
+
class Hi extends qt {
|
|
3804
3805
|
constructor(e, t, i = !1) {
|
|
3805
3806
|
super(e, [
|
|
3806
3807
|
"signInViaRedirect",
|
|
@@ -3815,17 +3816,17 @@ class Vi extends qt {
|
|
|
3815
3816
|
* just return it.
|
|
3816
3817
|
*/
|
|
3817
3818
|
async execute() {
|
|
3818
|
-
let e =
|
|
3819
|
+
let e = oe.get(this.auth._key());
|
|
3819
3820
|
if (!e) {
|
|
3820
3821
|
try {
|
|
3821
|
-
const i = await
|
|
3822
|
+
const i = await $i(this.resolver, this.auth) ? await super.execute() : null;
|
|
3822
3823
|
e = () => Promise.resolve(i);
|
|
3823
3824
|
} catch (t) {
|
|
3824
3825
|
e = () => Promise.reject(t);
|
|
3825
3826
|
}
|
|
3826
|
-
|
|
3827
|
+
oe.set(this.auth._key(), e);
|
|
3827
3828
|
}
|
|
3828
|
-
return this.bypassAuthState ||
|
|
3829
|
+
return this.bypassAuthState || oe.set(this.auth._key(), () => Promise.resolve(null)), e();
|
|
3829
3830
|
}
|
|
3830
3831
|
async onAuthEvent(e) {
|
|
3831
3832
|
if (e.type === "signInViaRedirect")
|
|
@@ -3846,26 +3847,26 @@ class Vi extends qt {
|
|
|
3846
3847
|
cleanUp() {
|
|
3847
3848
|
}
|
|
3848
3849
|
}
|
|
3849
|
-
async function
|
|
3850
|
-
const t =
|
|
3850
|
+
async function $i(n, e) {
|
|
3851
|
+
const t = Gi(e), i = ji(n);
|
|
3851
3852
|
if (!await i._isAvailable())
|
|
3852
3853
|
return !1;
|
|
3853
3854
|
const r = await i._get(t) === "true";
|
|
3854
3855
|
return await i._remove(t), r;
|
|
3855
3856
|
}
|
|
3856
|
-
function
|
|
3857
|
-
|
|
3857
|
+
function Wi(n, e) {
|
|
3858
|
+
oe.set(n._key(), e);
|
|
3858
3859
|
}
|
|
3859
|
-
function
|
|
3860
|
+
function ji(n) {
|
|
3860
3861
|
return k(n._redirectPersistence);
|
|
3861
3862
|
}
|
|
3862
|
-
function
|
|
3863
|
-
return
|
|
3863
|
+
function Gi(n) {
|
|
3864
|
+
return se(Vi, n.config.apiKey, n.name);
|
|
3864
3865
|
}
|
|
3865
|
-
async function
|
|
3866
|
+
async function Bi(n, e, t = !1) {
|
|
3866
3867
|
if (w(n.app))
|
|
3867
3868
|
return Promise.reject(L(n));
|
|
3868
|
-
const i =
|
|
3869
|
+
const i = me(n), r = Mi(i, e), o = await new Hi(i, r, t).execute();
|
|
3869
3870
|
return o && !t && (delete o.user._redirectEventId, await i._persistUserIfCurrent(o.user), await i._setRedirectUser(null, e)), o;
|
|
3870
3871
|
}
|
|
3871
3872
|
/**
|
|
@@ -3884,8 +3885,8 @@ async function Gi(n, e, t = !1) {
|
|
|
3884
3885
|
* See the License for the specific language governing permissions and
|
|
3885
3886
|
* limitations under the License.
|
|
3886
3887
|
*/
|
|
3887
|
-
const
|
|
3888
|
-
class
|
|
3888
|
+
const qi = 10 * 60 * 1e3;
|
|
3889
|
+
class zi {
|
|
3889
3890
|
constructor(e) {
|
|
3890
3891
|
this.auth = e, this.cachedEventUids = /* @__PURE__ */ new Set(), this.consumers = /* @__PURE__ */ new Set(), this.queuedRedirectEvent = null, this.hasHandledPotentialRedirect = !1, this.lastProcessedEventTime = Date.now();
|
|
3891
3892
|
}
|
|
@@ -3901,7 +3902,7 @@ class qi {
|
|
|
3901
3902
|
let t = !1;
|
|
3902
3903
|
return this.consumers.forEach((i) => {
|
|
3903
3904
|
this.isEventForConsumer(e, i) && (t = !0, this.sendToConsumer(e, i), this.saveEventToCache(e));
|
|
3904
|
-
}), this.hasHandledPotentialRedirect || !
|
|
3905
|
+
}), this.hasHandledPotentialRedirect || !Ki(e) || (this.hasHandledPotentialRedirect = !0, t || (this.queuedRedirectEvent = e, t = !0)), t;
|
|
3905
3906
|
}
|
|
3906
3907
|
sendToConsumer(e, t) {
|
|
3907
3908
|
var i;
|
|
@@ -3916,7 +3917,7 @@ class qi {
|
|
|
3916
3917
|
return t.filter.includes(e.type) && i;
|
|
3917
3918
|
}
|
|
3918
3919
|
hasEventBeenHandled(e) {
|
|
3919
|
-
return Date.now() - this.lastProcessedEventTime >=
|
|
3920
|
+
return Date.now() - this.lastProcessedEventTime >= qi && this.cachedEventUids.clear(), this.cachedEventUids.has(nt(e));
|
|
3920
3921
|
}
|
|
3921
3922
|
saveEventToCache(e) {
|
|
3922
3923
|
this.cachedEventUids.add(nt(e)), this.lastProcessedEventTime = Date.now();
|
|
@@ -3928,7 +3929,7 @@ function nt(n) {
|
|
|
3928
3929
|
function zt({ type: n, error: e }) {
|
|
3929
3930
|
return n === "unknown" && (e == null ? void 0 : e.code) === "auth/no-auth-event";
|
|
3930
3931
|
}
|
|
3931
|
-
function
|
|
3932
|
+
function Ki(n) {
|
|
3932
3933
|
switch (n.type) {
|
|
3933
3934
|
case "signInViaRedirect":
|
|
3934
3935
|
case "linkViaRedirect":
|
|
@@ -3956,7 +3957,7 @@ function zi(n) {
|
|
|
3956
3957
|
* See the License for the specific language governing permissions and
|
|
3957
3958
|
* limitations under the License.
|
|
3958
3959
|
*/
|
|
3959
|
-
async function
|
|
3960
|
+
async function Ji(n, e = {}) {
|
|
3960
3961
|
return G(n, "GET", "/v1/projects", e);
|
|
3961
3962
|
}
|
|
3962
3963
|
/**
|
|
@@ -3975,32 +3976,32 @@ async function Ki(n, e = {}) {
|
|
|
3975
3976
|
* See the License for the specific language governing permissions and
|
|
3976
3977
|
* limitations under the License.
|
|
3977
3978
|
*/
|
|
3978
|
-
const
|
|
3979
|
-
async function
|
|
3979
|
+
const Yi = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, Xi = /^https?/;
|
|
3980
|
+
async function Qi(n) {
|
|
3980
3981
|
if (n.config.emulator)
|
|
3981
3982
|
return;
|
|
3982
|
-
const { authorizedDomains: e } = await
|
|
3983
|
+
const { authorizedDomains: e } = await Ji(n);
|
|
3983
3984
|
for (const t of e)
|
|
3984
3985
|
try {
|
|
3985
|
-
if (
|
|
3986
|
+
if (Zi(t))
|
|
3986
3987
|
return;
|
|
3987
3988
|
} catch {
|
|
3988
3989
|
}
|
|
3989
|
-
|
|
3990
|
+
b(
|
|
3990
3991
|
n,
|
|
3991
3992
|
"unauthorized-domain"
|
|
3992
3993
|
/* AuthErrorCode.INVALID_ORIGIN */
|
|
3993
3994
|
);
|
|
3994
3995
|
}
|
|
3995
|
-
function
|
|
3996
|
+
function Zi(n) {
|
|
3996
3997
|
const e = Ee(), { protocol: t, hostname: i } = new URL(e);
|
|
3997
3998
|
if (n.startsWith("chrome-extension://")) {
|
|
3998
3999
|
const o = new URL(n);
|
|
3999
4000
|
return o.hostname === "" && i === "" ? t === "chrome-extension:" && n.replace("chrome-extension://", "") === e.replace("chrome-extension://", "") : t === "chrome-extension:" && o.hostname === i;
|
|
4000
4001
|
}
|
|
4001
|
-
if (!
|
|
4002
|
+
if (!Xi.test(t))
|
|
4002
4003
|
return !1;
|
|
4003
|
-
if (
|
|
4004
|
+
if (Yi.test(n))
|
|
4004
4005
|
return i === n;
|
|
4005
4006
|
const r = n.replace(/\./g, "\\.");
|
|
4006
4007
|
return new RegExp("^(.+\\." + r + "|" + r + ")$", "i").test(i);
|
|
@@ -4021,7 +4022,7 @@ function Qi(n) {
|
|
|
4021
4022
|
* See the License for the specific language governing permissions and
|
|
4022
4023
|
* limitations under the License.
|
|
4023
4024
|
*/
|
|
4024
|
-
const
|
|
4025
|
+
const er = new J(3e4, 6e4);
|
|
4025
4026
|
function it() {
|
|
4026
4027
|
const n = T().___jsl;
|
|
4027
4028
|
if (n != null && n.H) {
|
|
@@ -4031,7 +4032,7 @@ function it() {
|
|
|
4031
4032
|
n.CP[t] = null;
|
|
4032
4033
|
}
|
|
4033
4034
|
}
|
|
4034
|
-
function
|
|
4035
|
+
function tr(n) {
|
|
4035
4036
|
return new Promise((e, t) => {
|
|
4036
4037
|
var i, r, s;
|
|
4037
4038
|
function o() {
|
|
@@ -4046,7 +4047,7 @@ function er(n) {
|
|
|
4046
4047
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4047
4048
|
));
|
|
4048
4049
|
},
|
|
4049
|
-
timeout:
|
|
4050
|
+
timeout: er.get()
|
|
4050
4051
|
});
|
|
4051
4052
|
}
|
|
4052
4053
|
if (!((r = (i = T().gapi) === null || i === void 0 ? void 0 : i.iframes) === null || r === void 0) && r.Iframe)
|
|
@@ -4054,22 +4055,22 @@ function er(n) {
|
|
|
4054
4055
|
else if (!((s = T().gapi) === null || s === void 0) && s.load)
|
|
4055
4056
|
o();
|
|
4056
4057
|
else {
|
|
4057
|
-
const c =
|
|
4058
|
+
const c = ri("iframefcb");
|
|
4058
4059
|
return T()[c] = () => {
|
|
4059
4060
|
gapi.load ? o() : t(I(
|
|
4060
4061
|
n,
|
|
4061
4062
|
"network-request-failed"
|
|
4062
4063
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4063
4064
|
));
|
|
4064
|
-
},
|
|
4065
|
+
}, ni(`${ii()}?onload=${c}`).catch((a) => t(a));
|
|
4065
4066
|
}
|
|
4066
4067
|
}).catch((e) => {
|
|
4067
|
-
throw
|
|
4068
|
+
throw ae = null, e;
|
|
4068
4069
|
});
|
|
4069
4070
|
}
|
|
4070
|
-
let
|
|
4071
|
-
function
|
|
4072
|
-
return
|
|
4071
|
+
let ae = null;
|
|
4072
|
+
function nr(n) {
|
|
4073
|
+
return ae = ae || tr(n), ae;
|
|
4073
4074
|
}
|
|
4074
4075
|
/**
|
|
4075
4076
|
* @license
|
|
@@ -4087,7 +4088,7 @@ function tr(n) {
|
|
|
4087
4088
|
* See the License for the specific language governing permissions and
|
|
4088
4089
|
* limitations under the License.
|
|
4089
4090
|
*/
|
|
4090
|
-
const
|
|
4091
|
+
const ir = new J(5e3, 15e3), rr = "__/auth/iframe", sr = "emulator/auth/iframe", or = {
|
|
4091
4092
|
style: {
|
|
4092
4093
|
position: "absolute",
|
|
4093
4094
|
top: "-100px",
|
|
@@ -4096,13 +4097,13 @@ const nr = new J(5e3, 15e3), ir = "__/auth/iframe", rr = "emulator/auth/iframe",
|
|
|
4096
4097
|
},
|
|
4097
4098
|
"aria-hidden": "true",
|
|
4098
4099
|
tabindex: "-1"
|
|
4099
|
-
},
|
|
4100
|
+
}, ar = /* @__PURE__ */ new Map([
|
|
4100
4101
|
["identitytoolkit.googleapis.com", "p"],
|
|
4101
4102
|
["staging-identitytoolkit.sandbox.googleapis.com", "s"],
|
|
4102
4103
|
["test-identitytoolkit.sandbox.googleapis.com", "t"]
|
|
4103
4104
|
// test
|
|
4104
4105
|
]);
|
|
4105
|
-
function
|
|
4106
|
+
function cr(n) {
|
|
4106
4107
|
const e = n.config;
|
|
4107
4108
|
u(
|
|
4108
4109
|
e.authDomain,
|
|
@@ -4110,17 +4111,17 @@ function ar(n) {
|
|
|
4110
4111
|
"auth-domain-config-required"
|
|
4111
4112
|
/* AuthErrorCode.MISSING_AUTH_DOMAIN */
|
|
4112
4113
|
);
|
|
4113
|
-
const t = e.emulator ? Ce(e,
|
|
4114
|
+
const t = e.emulator ? Ce(e, sr) : `https://${n.config.authDomain}/${rr}`, i = {
|
|
4114
4115
|
apiKey: e.apiKey,
|
|
4115
4116
|
appName: n.name,
|
|
4116
4117
|
v: z
|
|
4117
|
-
}, r =
|
|
4118
|
+
}, r = ar.get(n.config.apiHost);
|
|
4118
4119
|
r && (i.eid = r);
|
|
4119
4120
|
const s = n._getFrameworks();
|
|
4120
4121
|
return s.length && (i.fw = s.join(",")), `${t}?${K(i).slice(1)}`;
|
|
4121
4122
|
}
|
|
4122
|
-
async function
|
|
4123
|
-
const e = await
|
|
4123
|
+
async function lr(n) {
|
|
4124
|
+
const e = await nr(n), t = T().gapi;
|
|
4124
4125
|
return u(
|
|
4125
4126
|
t,
|
|
4126
4127
|
n,
|
|
@@ -4128,9 +4129,9 @@ async function cr(n) {
|
|
|
4128
4129
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4129
4130
|
), e.open({
|
|
4130
4131
|
where: document.body,
|
|
4131
|
-
url:
|
|
4132
|
+
url: cr(n),
|
|
4132
4133
|
messageHandlersFilter: t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,
|
|
4133
|
-
attributes:
|
|
4134
|
+
attributes: or,
|
|
4134
4135
|
dontclear: !0
|
|
4135
4136
|
}, (i) => new Promise(async (r, s) => {
|
|
4136
4137
|
await i.restyle({
|
|
@@ -4143,7 +4144,7 @@ async function cr(n) {
|
|
|
4143
4144
|
/* AuthErrorCode.NETWORK_REQUEST_FAILED */
|
|
4144
4145
|
), c = T().setTimeout(() => {
|
|
4145
4146
|
s(o);
|
|
4146
|
-
},
|
|
4147
|
+
}, ir.get());
|
|
4147
4148
|
function a() {
|
|
4148
4149
|
T().clearTimeout(c), r(i);
|
|
4149
4150
|
}
|
|
@@ -4168,12 +4169,12 @@ async function cr(n) {
|
|
|
4168
4169
|
* See the License for the specific language governing permissions and
|
|
4169
4170
|
* limitations under the License.
|
|
4170
4171
|
*/
|
|
4171
|
-
const
|
|
4172
|
+
const ur = {
|
|
4172
4173
|
location: "yes",
|
|
4173
4174
|
resizable: "yes",
|
|
4174
4175
|
statusbar: "yes",
|
|
4175
4176
|
toolbar: "no"
|
|
4176
|
-
},
|
|
4177
|
+
}, dr = 500, hr = 600, fr = "_blank", pr = "http://localhost";
|
|
4177
4178
|
class rt {
|
|
4178
4179
|
constructor(e) {
|
|
4179
4180
|
this.window = e, this.associatedEvent = null;
|
|
@@ -4186,19 +4187,19 @@ class rt {
|
|
|
4186
4187
|
}
|
|
4187
4188
|
}
|
|
4188
4189
|
}
|
|
4189
|
-
function
|
|
4190
|
+
function mr(n, e, t, i = dr, r = hr) {
|
|
4190
4191
|
const s = Math.max((window.screen.availHeight - r) / 2, 0).toString(), o = Math.max((window.screen.availWidth - i) / 2, 0).toString();
|
|
4191
4192
|
let c = "";
|
|
4192
|
-
const a = Object.assign(Object.assign({},
|
|
4193
|
+
const a = Object.assign(Object.assign({}, ur), {
|
|
4193
4194
|
width: i.toString(),
|
|
4194
4195
|
height: r.toString(),
|
|
4195
4196
|
top: s,
|
|
4196
4197
|
left: o
|
|
4197
4198
|
}), l = g().toLowerCase();
|
|
4198
|
-
t && (c = Rt(l) ?
|
|
4199
|
-
const d = Object.entries(a).reduce((_, [
|
|
4200
|
-
if (
|
|
4201
|
-
return
|
|
4199
|
+
t && (c = Rt(l) ? fr : t), St(l) && (e = e || pr, a.scrollbars = "yes");
|
|
4200
|
+
const d = Object.entries(a).reduce((_, [x, M]) => `${_}${x}=${M},`, "");
|
|
4201
|
+
if (zn(l) && c !== "_self")
|
|
4202
|
+
return gr(e || "", c), new rt(null);
|
|
4202
4203
|
const h = window.open(e || "", c, d);
|
|
4203
4204
|
u(
|
|
4204
4205
|
h,
|
|
@@ -4212,7 +4213,7 @@ function pr(n, e, t, i = ur, r = dr) {
|
|
|
4212
4213
|
}
|
|
4213
4214
|
return new rt(h);
|
|
4214
4215
|
}
|
|
4215
|
-
function
|
|
4216
|
+
function gr(n, e) {
|
|
4216
4217
|
const t = document.createElement("a");
|
|
4217
4218
|
t.href = n, t.target = e;
|
|
4218
4219
|
const i = document.createEvent("MouseEvent");
|
|
@@ -4234,7 +4235,7 @@ function mr(n, e) {
|
|
|
4234
4235
|
* See the License for the specific language governing permissions and
|
|
4235
4236
|
* limitations under the License.
|
|
4236
4237
|
*/
|
|
4237
|
-
const
|
|
4238
|
+
const _r = "__/auth/handler", vr = "emulator/auth/handler", Ir = encodeURIComponent("fac");
|
|
4238
4239
|
async function st(n, e, t, i, r, s) {
|
|
4239
4240
|
u(
|
|
4240
4241
|
n.config.authDomain,
|
|
@@ -4268,11 +4269,11 @@ async function st(n, e, t, i, r, s) {
|
|
|
4268
4269
|
const c = o;
|
|
4269
4270
|
for (const d of Object.keys(c))
|
|
4270
4271
|
c[d] === void 0 && delete c[d];
|
|
4271
|
-
const a = await n._getAppCheckToken(), l = a ? `#${
|
|
4272
|
-
return `${
|
|
4272
|
+
const a = await n._getAppCheckToken(), l = a ? `#${Ir}=${encodeURIComponent(a)}` : "";
|
|
4273
|
+
return `${Tr(n)}?${K(c).slice(1)}${l}`;
|
|
4273
4274
|
}
|
|
4274
|
-
function
|
|
4275
|
-
return n.emulator ? Ce(n,
|
|
4275
|
+
function Tr({ config: n }) {
|
|
4276
|
+
return n.emulator ? Ce(n, vr) : `https://${n.authDomain}/${_r}`;
|
|
4276
4277
|
}
|
|
4277
4278
|
/**
|
|
4278
4279
|
* @license
|
|
@@ -4291,29 +4292,29 @@ function Ir({ config: n }) {
|
|
|
4291
4292
|
* limitations under the License.
|
|
4292
4293
|
*/
|
|
4293
4294
|
const we = "webStorageSupport";
|
|
4294
|
-
class
|
|
4295
|
+
class wr {
|
|
4295
4296
|
constructor() {
|
|
4296
|
-
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = $t, this._completeRedirectFn =
|
|
4297
|
+
this.eventManagers = {}, this.iframes = {}, this.originValidationPromises = {}, this._redirectPersistence = $t, this._completeRedirectFn = Bi, this._overrideRedirectResult = Wi;
|
|
4297
4298
|
}
|
|
4298
4299
|
// Wrapping in async even though we don't await anywhere in order
|
|
4299
4300
|
// to make sure errors are raised as promise rejections
|
|
4300
4301
|
async _openPopup(e, t, i, r) {
|
|
4301
4302
|
var s;
|
|
4302
|
-
|
|
4303
|
+
S((s = this.eventManagers[e._key()]) === null || s === void 0 ? void 0 : s.manager, "_initialize() not called before _openPopup()");
|
|
4303
4304
|
const o = await st(e, t, i, Ee(), r);
|
|
4304
|
-
return
|
|
4305
|
+
return mr(e, o, Me());
|
|
4305
4306
|
}
|
|
4306
4307
|
async _openRedirect(e, t, i, r) {
|
|
4307
4308
|
await this._originValidation(e);
|
|
4308
4309
|
const s = await st(e, t, i, Ee(), r);
|
|
4309
|
-
return
|
|
4310
|
+
return ki(s), new Promise(() => {
|
|
4310
4311
|
});
|
|
4311
4312
|
}
|
|
4312
4313
|
_initialize(e) {
|
|
4313
4314
|
const t = e._key();
|
|
4314
4315
|
if (this.eventManagers[t]) {
|
|
4315
4316
|
const { manager: r, promise: s } = this.eventManagers[t];
|
|
4316
|
-
return r ? Promise.resolve(r) : (
|
|
4317
|
+
return r ? Promise.resolve(r) : (S(s, "If manager is not set, promise should be"), s);
|
|
4317
4318
|
}
|
|
4318
4319
|
const i = this.initAndGetManager(e);
|
|
4319
4320
|
return this.eventManagers[t] = { promise: i }, i.catch(() => {
|
|
@@ -4321,7 +4322,7 @@ class Tr {
|
|
|
4321
4322
|
}), i;
|
|
4322
4323
|
}
|
|
4323
4324
|
async initAndGetManager(e) {
|
|
4324
|
-
const t = await
|
|
4325
|
+
const t = await lr(e), i = new zi(e);
|
|
4325
4326
|
return t.register("authEvent", (r) => (u(
|
|
4326
4327
|
r == null ? void 0 : r.authEvent,
|
|
4327
4328
|
e,
|
|
@@ -4336,7 +4337,7 @@ class Tr {
|
|
|
4336
4337
|
this.iframes[e._key()].send(we, { type: we }, (r) => {
|
|
4337
4338
|
var s;
|
|
4338
4339
|
const o = (s = r == null ? void 0 : r[0]) === null || s === void 0 ? void 0 : s[we];
|
|
4339
|
-
o !== void 0 && t(!!o),
|
|
4340
|
+
o !== void 0 && t(!!o), b(
|
|
4340
4341
|
e,
|
|
4341
4342
|
"internal-error"
|
|
4342
4343
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
@@ -4345,13 +4346,13 @@ class Tr {
|
|
|
4345
4346
|
}
|
|
4346
4347
|
_originValidation(e) {
|
|
4347
4348
|
const t = e._key();
|
|
4348
|
-
return this.originValidationPromises[t] || (this.originValidationPromises[t] =
|
|
4349
|
+
return this.originValidationPromises[t] || (this.originValidationPromises[t] = Qi(e)), this.originValidationPromises[t];
|
|
4349
4350
|
}
|
|
4350
4351
|
get _shouldInitProactively() {
|
|
4351
|
-
return Nt() || Ne() ||
|
|
4352
|
+
return Nt() || Ne() || pe();
|
|
4352
4353
|
}
|
|
4353
4354
|
}
|
|
4354
|
-
const
|
|
4355
|
+
const yr = wr;
|
|
4355
4356
|
var ot = "@firebase/auth", at = "1.7.5";
|
|
4356
4357
|
/**
|
|
4357
4358
|
* @license
|
|
@@ -4369,7 +4370,7 @@ var ot = "@firebase/auth", at = "1.7.5";
|
|
|
4369
4370
|
* See the License for the specific language governing permissions and
|
|
4370
4371
|
* limitations under the License.
|
|
4371
4372
|
*/
|
|
4372
|
-
class
|
|
4373
|
+
class Er {
|
|
4373
4374
|
constructor(e) {
|
|
4374
4375
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
|
4375
4376
|
}
|
|
@@ -4420,7 +4421,7 @@ class yr {
|
|
|
4420
4421
|
* See the License for the specific language governing permissions and
|
|
4421
4422
|
* limitations under the License.
|
|
4422
4423
|
*/
|
|
4423
|
-
function
|
|
4424
|
+
function kr(n) {
|
|
4424
4425
|
switch (n) {
|
|
4425
4426
|
case "Node":
|
|
4426
4427
|
return "node";
|
|
@@ -4436,7 +4437,7 @@ function Er(n) {
|
|
|
4436
4437
|
return;
|
|
4437
4438
|
}
|
|
4438
4439
|
}
|
|
4439
|
-
function
|
|
4440
|
+
function br(n) {
|
|
4440
4441
|
je(new Ge(
|
|
4441
4442
|
"auth",
|
|
4442
4443
|
(e, { options: t }) => {
|
|
@@ -4450,8 +4451,8 @@ function kr(n) {
|
|
|
4450
4451
|
tokenApiHost: "securetoken.googleapis.com",
|
|
4451
4452
|
apiScheme: "https",
|
|
4452
4453
|
sdkClientVersion: Lt(n)
|
|
4453
|
-
}, l = new
|
|
4454
|
-
return
|
|
4454
|
+
}, l = new ei(i, r, s, a);
|
|
4455
|
+
return oi(l, t), l;
|
|
4455
4456
|
},
|
|
4456
4457
|
"PUBLIC"
|
|
4457
4458
|
/* ComponentType.PUBLIC */
|
|
@@ -4466,18 +4467,18 @@ function kr(n) {
|
|
|
4466
4467
|
})), je(new Ge(
|
|
4467
4468
|
"auth-internal",
|
|
4468
4469
|
(e) => {
|
|
4469
|
-
const t =
|
|
4470
|
+
const t = me(e.getProvider(
|
|
4470
4471
|
"auth"
|
|
4471
4472
|
/* _ComponentName.AUTH */
|
|
4472
4473
|
).getImmediate());
|
|
4473
|
-
return ((i) => new
|
|
4474
|
+
return ((i) => new Er(i))(t);
|
|
4474
4475
|
},
|
|
4475
4476
|
"PRIVATE"
|
|
4476
4477
|
/* ComponentType.PRIVATE */
|
|
4477
4478
|
).setInstantiationMode(
|
|
4478
4479
|
"EXPLICIT"
|
|
4479
4480
|
/* InstantiationMode.EXPLICIT */
|
|
4480
|
-
)), ye(ot, at,
|
|
4481
|
+
)), ye(ot, at, kr(n)), ye(ot, at, "esm2017");
|
|
4481
4482
|
}
|
|
4482
4483
|
/**
|
|
4483
4484
|
* @license
|
|
@@ -4495,11 +4496,11 @@ function kr(n) {
|
|
|
4495
4496
|
* See the License for the specific language governing permissions and
|
|
4496
4497
|
* limitations under the License.
|
|
4497
4498
|
*/
|
|
4498
|
-
const Sr = 5 * 60,
|
|
4499
|
+
const Sr = 5 * 60, Rr = ft("authIdTokenMaxAge") || Sr;
|
|
4499
4500
|
let ct = null;
|
|
4500
|
-
const
|
|
4501
|
+
const Pr = (n) => async (e) => {
|
|
4501
4502
|
const t = e && await e.getIdTokenResult(), i = t && ((/* @__PURE__ */ new Date()).getTime() - Date.parse(t.issuedAtTime)) / 1e3;
|
|
4502
|
-
if (i && i >
|
|
4503
|
+
if (i && i > Rr)
|
|
4503
4504
|
return;
|
|
4504
4505
|
const r = t == null ? void 0 : t.token;
|
|
4505
4506
|
ct !== r && (ct = r, await fetch(n, {
|
|
@@ -4509,33 +4510,33 @@ const Rr = (n) => async (e) => {
|
|
|
4509
4510
|
} : {}
|
|
4510
4511
|
}));
|
|
4511
4512
|
};
|
|
4512
|
-
function
|
|
4513
|
+
function Ar(n = vn()) {
|
|
4513
4514
|
const e = pt(n, "auth");
|
|
4514
4515
|
if (e.isInitialized())
|
|
4515
4516
|
return e.getImmediate();
|
|
4516
|
-
const t =
|
|
4517
|
-
popupRedirectResolver:
|
|
4517
|
+
const t = si(n, {
|
|
4518
|
+
popupRedirectResolver: yr,
|
|
4518
4519
|
persistence: [
|
|
4519
|
-
|
|
4520
|
-
|
|
4520
|
+
Li,
|
|
4521
|
+
wi,
|
|
4521
4522
|
$t
|
|
4522
4523
|
]
|
|
4523
4524
|
}), i = ft("authTokenSyncURL");
|
|
4524
4525
|
if (i && typeof isSecureContext == "boolean" && isSecureContext) {
|
|
4525
4526
|
const s = new URL(i, location.origin);
|
|
4526
4527
|
if (location.origin === s.origin) {
|
|
4527
|
-
const o =
|
|
4528
|
-
|
|
4528
|
+
const o = Pr(s.toString());
|
|
4529
|
+
_i(t, o, () => o(t.currentUser)), gi(t, (c) => o(c));
|
|
4529
4530
|
}
|
|
4530
4531
|
}
|
|
4531
4532
|
const r = _n("auth");
|
|
4532
|
-
return r &&
|
|
4533
|
+
return r && ai(t, `http://${r}`), t;
|
|
4533
4534
|
}
|
|
4534
|
-
function
|
|
4535
|
+
function Cr() {
|
|
4535
4536
|
var n, e;
|
|
4536
4537
|
return (e = (n = document.getElementsByTagName("head")) === null || n === void 0 ? void 0 : n[0]) !== null && e !== void 0 ? e : document;
|
|
4537
4538
|
}
|
|
4538
|
-
|
|
4539
|
+
ti({
|
|
4539
4540
|
loadJS(n) {
|
|
4540
4541
|
return new Promise((e, t) => {
|
|
4541
4542
|
const i = document.createElement("script");
|
|
@@ -4545,53 +4546,60 @@ ei({
|
|
|
4545
4546
|
/* AuthErrorCode.INTERNAL_ERROR */
|
|
4546
4547
|
);
|
|
4547
4548
|
s.customData = r, t(s);
|
|
4548
|
-
}, i.type = "text/javascript", i.charset = "UTF-8",
|
|
4549
|
+
}, i.type = "text/javascript", i.charset = "UTF-8", Cr().appendChild(i);
|
|
4549
4550
|
});
|
|
4550
4551
|
},
|
|
4551
4552
|
gapiScript: "https://apis.google.com/js/api.js",
|
|
4552
4553
|
recaptchaV2Script: "https://www.google.com/recaptcha/api.js",
|
|
4553
4554
|
recaptchaEnterpriseScript: "https://www.google.com/recaptcha/enterprise.js?render="
|
|
4554
4555
|
});
|
|
4555
|
-
|
|
4556
|
+
br(
|
|
4556
4557
|
"Browser"
|
|
4557
4558
|
/* ClientPlatform.BROWSER */
|
|
4558
4559
|
);
|
|
4559
|
-
var
|
|
4560
|
-
const
|
|
4560
|
+
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", marketingV1Portal: "https://marketing-v1.feedmedev.cc" }, Lr = { mode: "development", appMode: "mf" };
|
|
4561
|
+
const Mr = {
|
|
4561
4562
|
key: 1,
|
|
4562
4563
|
class: "h-full w-full"
|
|
4563
|
-
},
|
|
4564
|
+
}, Ur = ["src"], Yr = /* @__PURE__ */ lt({
|
|
4564
4565
|
__name: "App",
|
|
4565
4566
|
setup(n) {
|
|
4566
|
-
const e = We(), t = on(), i = an(), r = cn(), s = ln(), o = ht(), c =
|
|
4567
|
+
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), h = Ve(() => i.version), _ = Ve(() => {
|
|
4567
4568
|
const p = e.currentCountry.value || "MY", m = Be.getIdToken(), v = l.value._id;
|
|
4568
|
-
return `${
|
|
4569
|
+
return `${Nr.marketingV1Portal}/b/${v}/marketing/overview?showHeader=false&country=${p}&token=${m}`;
|
|
4569
4570
|
});
|
|
4570
|
-
async function
|
|
4571
|
+
async function x() {
|
|
4571
4572
|
if (En().length) {
|
|
4572
4573
|
console.warn("CONNECT: initFirebase: Firebase already initialized");
|
|
4573
4574
|
return;
|
|
4574
4575
|
}
|
|
4575
|
-
const p = kn(
|
|
4576
|
-
await
|
|
4576
|
+
const p = kn(Or.firebase), m = await sn.getCustomToken(), v = Ar();
|
|
4577
|
+
await mi(v, m), bn(p), console.log("initFirebase", p);
|
|
4577
4578
|
}
|
|
4578
4579
|
const M = async () => {
|
|
4579
|
-
d.value = !1, await tn(), console.log("forceRerender"), Be.setBusinessId(l.value._id), await i.readPremium(), !a.value && h.value === "v2" ? e.registerSidebarComponent(
|
|
4580
|
+
d.value = !1, await tn(), console.log("forceRerender"), Be.setBusinessId(l.value._id), await i.readPremium(), !a.value && h.value === "v2" ? e.registerSidebarComponent(Pn) : e.hideSidebarToggle(!0), await x(), a.value = !0, d.value = !0;
|
|
4580
4581
|
};
|
|
4582
|
+
async function Q() {
|
|
4583
|
+
var p;
|
|
4584
|
+
console.log("initRemyClient.."), await Rn.init({
|
|
4585
|
+
token: ((p = e.sessionUser.value) == null ? void 0 : p.token) || "",
|
|
4586
|
+
dev: Lr.mode === "development"
|
|
4587
|
+
});
|
|
4588
|
+
}
|
|
4581
4589
|
return Xt(() => {
|
|
4582
|
-
if (
|
|
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"),
|
|
4590
|
+
if (Sn.Config.setCountry(e.currentCountry.value || "MY"), t.initProvider(r, s), !c.value) {
|
|
4591
|
+
const p = document.getElementsByClassName("app-header")[0], m = document.getElementsByClassName("app-sidebar")[0], v = document.getElementsByClassName("app-container")[0], U = document.getElementsByTagName("main")[0];
|
|
4592
|
+
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
4593
|
}
|
|
4586
|
-
l.value != null && (console.log("App mounted, forceRerender"), M());
|
|
4594
|
+
l.value != null && (console.log("App mounted, forceRerender"), M()), Q();
|
|
4587
4595
|
}), ut(
|
|
4588
4596
|
() => e.currentBusiness.value,
|
|
4589
4597
|
async (p, m) => {
|
|
4590
4598
|
console.log("Current business changed"), p != null && p._id != m._id && (console.log("forceRerender when business changes", p, m), M());
|
|
4591
4599
|
}
|
|
4592
|
-
), (p, m) => (
|
|
4593
|
-
P(d) && P(h) === "v2" ? (
|
|
4594
|
-
P(d) && P(h) !== "v2" ? (
|
|
4600
|
+
), (p, m) => (ie(), He(Qt, null, [
|
|
4601
|
+
P(d) && P(h) === "v2" ? (ie(), dt(P(rn), { key: 0 })) : $e("", !0),
|
|
4602
|
+
P(d) && P(h) !== "v2" ? (ie(), He("div", Mr, [
|
|
4595
4603
|
Zt(dn, {
|
|
4596
4604
|
json: { url: P(_) }
|
|
4597
4605
|
}, null, 8, ["json"]),
|
|
@@ -4601,11 +4609,11 @@ const Nr = {
|
|
|
4601
4609
|
height: "100%",
|
|
4602
4610
|
width: "100%",
|
|
4603
4611
|
src: P(_)
|
|
4604
|
-
}, null, 8,
|
|
4612
|
+
}, null, 8, Ur)
|
|
4605
4613
|
])) : $e("", !0)
|
|
4606
4614
|
], 64));
|
|
4607
4615
|
}
|
|
4608
4616
|
});
|
|
4609
4617
|
export {
|
|
4610
|
-
|
|
4618
|
+
Yr as default
|
|
4611
4619
|
};
|