@cal.macconnachie/web-components 0.0.11 → 0.0.12
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/components/auth.js +49 -49
- package/dist/index.js +103 -103
- package/package.json +1 -1
package/dist/components/auth.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const z = globalThis, Z = z.ShadowRoot && (z.ShadyCSS === void 0 || z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Q = Symbol(), ot = /* @__PURE__ */ new WeakMap();
|
|
2
|
-
let
|
|
2
|
+
let $t = class {
|
|
3
3
|
constructor(t, s, i) {
|
|
4
4
|
if (this._$cssResult$ = !0, i !== Q) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = t, this.t = s;
|
|
@@ -17,13 +17,13 @@ let wt = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const xt = (e) => new
|
|
20
|
+
const xt = (e) => new $t(typeof e == "string" ? e : e + "", void 0, Q), Et = (e, ...t) => {
|
|
21
21
|
const s = e.length === 1 ? e[0] : t.reduce(((i, r, o) => i + ((a) => {
|
|
22
22
|
if (a._$cssResult$ === !0) return a.cssText;
|
|
23
23
|
if (typeof a == "number") return a;
|
|
24
24
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
25
|
})(r) + e[o + 1]), e[0]);
|
|
26
|
-
return new
|
|
26
|
+
return new $t(s, e, Q);
|
|
27
27
|
}, Tt = (e, t) => {
|
|
28
28
|
if (Z) e.adoptedStyleSheets = t.map(((s) => s instanceof CSSStyleSheet ? s : s.styleSheet));
|
|
29
29
|
else for (const s of t) {
|
|
@@ -279,8 +279,8 @@ class B {
|
|
|
279
279
|
for (; (r = O.nextNode()) !== null && n.length < c; ) {
|
|
280
280
|
if (r.nodeType === 1) {
|
|
281
281
|
if (r.hasAttributes()) for (const l of r.getAttributeNames()) if (l.endsWith(bt)) {
|
|
282
|
-
const p = d[a++], u = r.getAttribute(l).split(C),
|
|
283
|
-
n.push({ type: 1, index: o, name:
|
|
282
|
+
const p = d[a++], u = r.getAttribute(l).split(C), w = /([.?@])?(.*)/.exec(p);
|
|
283
|
+
n.push({ type: 1, index: o, name: w[2], strings: u, ctor: w[1] === "." ? zt : w[1] === "?" ? Yt : w[1] === "@" ? Kt : V }), r.removeAttribute(l);
|
|
284
284
|
} else l.startsWith(C) && (n.push({ type: 6, index: o }), r.removeAttribute(l));
|
|
285
285
|
if (At.test(r.tagName)) {
|
|
286
286
|
const l = r.textContent.split(C), p = l.length - 1;
|
|
@@ -609,7 +609,7 @@ const yt = (e, t, s) => {
|
|
|
609
609
|
const i = /* @__PURE__ */ new Map();
|
|
610
610
|
for (let r = t; r <= s; r++) i.set(e[r], r);
|
|
611
611
|
return i;
|
|
612
|
-
},
|
|
612
|
+
}, wt = kt(class extends Ct {
|
|
613
613
|
constructor(e) {
|
|
614
614
|
if (super(e), e.type !== St.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
615
615
|
}
|
|
@@ -628,24 +628,24 @@ const yt = (e, t, s) => {
|
|
|
628
628
|
const r = re(e), { values: o, keys: a } = this.dt(t, s, i);
|
|
629
629
|
if (!Array.isArray(r)) return this.ut = a, o;
|
|
630
630
|
const c = this.ut ??= [], n = [];
|
|
631
|
-
let h, d, l = 0, p = r.length - 1, u = 0,
|
|
632
|
-
for (; l <= p && u <=
|
|
631
|
+
let h, d, l = 0, p = r.length - 1, u = 0, w = o.length - 1;
|
|
632
|
+
for (; l <= p && u <= w; ) if (r[l] === null) l++;
|
|
633
633
|
else if (r[p] === null) p--;
|
|
634
634
|
else if (c[l] === a[u]) n[u] = P(r[l], o[u]), l++, u++;
|
|
635
|
-
else if (c[p] === a[
|
|
636
|
-
else if (c[l] === a[
|
|
635
|
+
else if (c[p] === a[w]) n[w] = P(r[p], o[w]), p--, w--;
|
|
636
|
+
else if (c[l] === a[w]) n[w] = P(r[l], o[w]), L(e, n[w + 1], r[l]), l++, w--;
|
|
637
637
|
else if (c[p] === a[u]) n[u] = P(r[p], o[u]), L(e, r[l], r[p]), p--, u++;
|
|
638
|
-
else if (h === void 0 && (h = yt(a, u,
|
|
638
|
+
else if (h === void 0 && (h = yt(a, u, w), d = yt(c, l, p)), h.has(c[l])) if (h.has(c[p])) {
|
|
639
639
|
const v = d.get(a[u]), A = v !== void 0 ? r[v] : null;
|
|
640
640
|
if (A === null) {
|
|
641
|
-
const
|
|
642
|
-
P(
|
|
641
|
+
const $ = L(e, r[l]);
|
|
642
|
+
P($, o[u]), n[u] = $;
|
|
643
643
|
} else n[u] = P(A, o[u]), L(e, r[l], A), r[v] = null;
|
|
644
644
|
u++;
|
|
645
645
|
} else G(r[p]), p--;
|
|
646
646
|
else G(r[l]), l++;
|
|
647
|
-
for (; u <=
|
|
648
|
-
const v = L(e, n[
|
|
647
|
+
for (; u <= w; ) {
|
|
648
|
+
const v = L(e, n[w + 1]);
|
|
649
649
|
P(v, o[u]), n[u++] = v;
|
|
650
650
|
}
|
|
651
651
|
for (; l <= p; ) {
|
|
@@ -674,7 +674,7 @@ const yt = (e, t, s) => {
|
|
|
674
674
|
refreshToken: p,
|
|
675
675
|
idToken: u
|
|
676
676
|
}) => {
|
|
677
|
-
const
|
|
677
|
+
const w = await fetch(`${e}${t.login}`, {
|
|
678
678
|
method: "POST",
|
|
679
679
|
headers: {
|
|
680
680
|
"Content-Type": "application/json"
|
|
@@ -687,11 +687,11 @@ const yt = (e, t, s) => {
|
|
|
687
687
|
idToken: u
|
|
688
688
|
})
|
|
689
689
|
});
|
|
690
|
-
if (
|
|
691
|
-
const v = await
|
|
690
|
+
if (!w.ok) {
|
|
691
|
+
const v = await w.json();
|
|
692
692
|
throw new Error(v.message || v.error || "Login failed");
|
|
693
693
|
}
|
|
694
|
-
return
|
|
694
|
+
return w.json();
|
|
695
695
|
},
|
|
696
696
|
logout: async ({
|
|
697
697
|
accessToken: h,
|
|
@@ -753,7 +753,7 @@ const yt = (e, t, s) => {
|
|
|
753
753
|
phone_number: l,
|
|
754
754
|
family_name: p,
|
|
755
755
|
given_name: u,
|
|
756
|
-
code:
|
|
756
|
+
code: w
|
|
757
757
|
}) => {
|
|
758
758
|
const v = await fetch(`${e}${t.register}`, {
|
|
759
759
|
method: "POST",
|
|
@@ -766,7 +766,7 @@ const yt = (e, t, s) => {
|
|
|
766
766
|
phone_number: l,
|
|
767
767
|
family_name: p,
|
|
768
768
|
given_name: u,
|
|
769
|
-
code:
|
|
769
|
+
code: w
|
|
770
770
|
})
|
|
771
771
|
});
|
|
772
772
|
if (!v.ok) {
|
|
@@ -830,11 +830,11 @@ const yt = (e, t, s) => {
|
|
|
830
830
|
maxAge: l,
|
|
831
831
|
path: p = "/",
|
|
832
832
|
secure: u = window.location.protocol === "https:",
|
|
833
|
-
sameSite:
|
|
833
|
+
sameSite: w = "lax",
|
|
834
834
|
domain: v
|
|
835
835
|
} = d;
|
|
836
836
|
let A = `${encodeURIComponent(n)}=${encodeURIComponent(h)}`;
|
|
837
|
-
l !== void 0 && (A += `; Max-Age=${l}`), A += `; Path=${p}`, u && (A += "; Secure"), A += `; SameSite=${
|
|
837
|
+
l !== void 0 && (A += `; Max-Age=${l}`), A += `; Path=${p}`, u && (A += "; Secure"), A += `; SameSite=${w}`, v && (A += `; Domain=${v}`), document.cookie = A;
|
|
838
838
|
}, t = (n) => {
|
|
839
839
|
const h = encodeURIComponent(n) + "=", d = document.cookie.split(";");
|
|
840
840
|
for (let l = 0; l < d.length; l++) {
|
|
@@ -882,20 +882,20 @@ const yt = (e, t, s) => {
|
|
|
882
882
|
domain: e,
|
|
883
883
|
clientId: i,
|
|
884
884
|
redirectUri: he(r)
|
|
885
|
-
}, a = (
|
|
886
|
-
const _ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~", k = new Uint8Array(
|
|
885
|
+
}, a = ($) => {
|
|
886
|
+
const _ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~", k = new Uint8Array($);
|
|
887
887
|
return crypto.getRandomValues(k), Array.from(k).map((E) => _[E % _.length]).join("");
|
|
888
|
-
}, c = async (
|
|
889
|
-
const k = new TextEncoder().encode(
|
|
888
|
+
}, c = async ($) => {
|
|
889
|
+
const k = new TextEncoder().encode($), E = await crypto.subtle.digest("SHA-256", k);
|
|
890
890
|
return btoa(String.fromCharCode(...new Uint8Array(E))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
891
891
|
}, n = async () => {
|
|
892
|
-
const
|
|
893
|
-
return sessionStorage.setItem("pkce_code_verifier",
|
|
892
|
+
const $ = a(128), _ = await c($);
|
|
893
|
+
return sessionStorage.setItem("pkce_code_verifier", $), { codeVerifier: $, codeChallenge: _ };
|
|
894
894
|
}, h = () => {
|
|
895
|
-
const
|
|
896
|
-
return sessionStorage.setItem("oauth_state",
|
|
895
|
+
const $ = a(32);
|
|
896
|
+
return sessionStorage.setItem("oauth_state", $), $;
|
|
897
897
|
}, d = async () => {
|
|
898
|
-
const { codeChallenge:
|
|
898
|
+
const { codeChallenge: $ } = await n(), _ = h(), k = new URLSearchParams({
|
|
899
899
|
response_type: "code",
|
|
900
900
|
client_id: o.clientId,
|
|
901
901
|
redirect_uri: o.redirectUri,
|
|
@@ -903,15 +903,15 @@ const yt = (e, t, s) => {
|
|
|
903
903
|
scope: "openid email profile",
|
|
904
904
|
state: _,
|
|
905
905
|
code_challenge_method: "S256",
|
|
906
|
-
code_challenge:
|
|
906
|
+
code_challenge: $,
|
|
907
907
|
prompt: "select_account"
|
|
908
908
|
});
|
|
909
909
|
return `${o.domain}/oauth2/authorize?${k.toString()}`;
|
|
910
910
|
}, l = async () => {
|
|
911
|
-
const
|
|
912
|
-
window.location.href =
|
|
911
|
+
const $ = await d();
|
|
912
|
+
window.location.href = $;
|
|
913
913
|
}, p = async () => {
|
|
914
|
-
const { codeChallenge:
|
|
914
|
+
const { codeChallenge: $ } = await n(), _ = h(), k = new URLSearchParams({
|
|
915
915
|
response_type: "code",
|
|
916
916
|
client_id: o.clientId,
|
|
917
917
|
redirect_uri: o.redirectUri,
|
|
@@ -919,32 +919,32 @@ const yt = (e, t, s) => {
|
|
|
919
919
|
scope: "openid email profile",
|
|
920
920
|
state: _,
|
|
921
921
|
code_challenge_method: "S256",
|
|
922
|
-
code_challenge:
|
|
922
|
+
code_challenge: $
|
|
923
923
|
});
|
|
924
924
|
return `${o.domain}/oauth2/authorize?${k.toString()}`;
|
|
925
925
|
}, u = async () => {
|
|
926
|
-
const
|
|
927
|
-
window.location.href =
|
|
928
|
-
},
|
|
926
|
+
const $ = await p();
|
|
927
|
+
window.location.href = $;
|
|
928
|
+
}, w = ($) => {
|
|
929
929
|
const _ = sessionStorage.getItem("oauth_state");
|
|
930
|
-
return sessionStorage.removeItem("oauth_state"), _ ===
|
|
930
|
+
return sessionStorage.removeItem("oauth_state"), _ === $;
|
|
931
931
|
}, v = () => {
|
|
932
|
-
const
|
|
933
|
-
return sessionStorage.removeItem("pkce_code_verifier"),
|
|
932
|
+
const $ = sessionStorage.getItem("pkce_code_verifier");
|
|
933
|
+
return sessionStorage.removeItem("pkce_code_verifier"), $;
|
|
934
934
|
};
|
|
935
935
|
return {
|
|
936
936
|
redirectToGoogleAuth: l,
|
|
937
937
|
redirectToAppleAuth: u,
|
|
938
|
-
validateState:
|
|
938
|
+
validateState: w,
|
|
939
939
|
getCodeVerifier: v,
|
|
940
|
-
exchangeCodeForTokens: async (
|
|
940
|
+
exchangeCodeForTokens: async ($) => {
|
|
941
941
|
const _ = v();
|
|
942
942
|
if (!_)
|
|
943
943
|
throw new Error("PKCE code verifier not found. Please restart the authentication flow.");
|
|
944
944
|
const k = new URLSearchParams({
|
|
945
945
|
grant_type: "authorization_code",
|
|
946
946
|
client_id: o.clientId,
|
|
947
|
-
code:
|
|
947
|
+
code: $,
|
|
948
948
|
redirect_uri: o.redirectUri,
|
|
949
949
|
code_verifier: _
|
|
950
950
|
}), E = await fetch(`${o.domain}/oauth2/token`, {
|
|
@@ -2115,7 +2115,7 @@ let m = class extends H {
|
|
|
2115
2115
|
<div class="otp-section">
|
|
2116
2116
|
<label class="otp-label">Enter 6-digit code</label>
|
|
2117
2117
|
<div class="otp-inputs" role="group" aria-label="One time code">
|
|
2118
|
-
${
|
|
2118
|
+
${wt(
|
|
2119
2119
|
Array.from({ length: 6 }, (e, t) => t),
|
|
2120
2120
|
(e) => e,
|
|
2121
2121
|
(e) => y`
|
|
@@ -2185,7 +2185,7 @@ let m = class extends H {
|
|
|
2185
2185
|
<div class="otp-section">
|
|
2186
2186
|
<label class="otp-label">Enter 6-digit code</label>
|
|
2187
2187
|
<div class="otp-inputs" role="group" aria-label="One time code">
|
|
2188
|
-
${
|
|
2188
|
+
${wt(
|
|
2189
2189
|
Array.from({ length: 6 }, (t, s) => s),
|
|
2190
2190
|
(t) => t,
|
|
2191
2191
|
(t) => y`
|
|
@@ -2506,7 +2506,7 @@ f([
|
|
|
2506
2506
|
it(".modal-body")
|
|
2507
2507
|
], m.prototype, "modalBody", 2);
|
|
2508
2508
|
m = f([
|
|
2509
|
-
Zt("auth")
|
|
2509
|
+
Zt("auth-drawer")
|
|
2510
2510
|
], m);
|
|
2511
2511
|
export {
|
|
2512
2512
|
m as Auth
|
package/dist/index.js
CHANGED
|
@@ -248,8 +248,8 @@ let Q = class extends HTMLElement {
|
|
|
248
248
|
};
|
|
249
249
|
Q.elementStyles = [], Q.shadowRootOptions = { mode: "open" }, Q[de("elementProperties")] = /* @__PURE__ */ new Map(), Q[de("finalized")] = /* @__PURE__ */ new Map(), Ns?.({ ReactiveElement: Q }), (xe.reactiveElementVersions ??= []).push("2.1.1");
|
|
250
250
|
const Xe = globalThis, Ce = Xe.trustedTypes, yt = Ce ? Ce.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, Vt = "$lit$", H = `lit$${Math.random().toFixed(9).slice(2)}$`, Wt = "?" + H, Ls = `<${Wt}>`, G = document, ue = () => G.createComment(""), pe = (t) => t === null || typeof t != "object" && typeof t != "function", Qe = Array.isArray, Is = (t) => Qe(t) || typeof t?.[Symbol.iterator] == "function", je = `[
|
|
251
|
-
\f\r]`, le = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), St = /'/g, $t = /"/g, Yt = /^(?:script|style|textarea|title)$/i, Bs = (t) => (e, ...s) => ({ _$litType$: t, strings: e, values: s }), S = Bs(1), M = Symbol.for("lit-noChange"),
|
|
251
|
+
\f\r]`, le = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, wt = /-->/g, bt = />/g, K = RegExp(`>|${je}(?:([^\\s"'>=/]+)(${je}*=${je}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), St = /'/g, $t = /"/g, Yt = /^(?:script|style|textarea|title)$/i, Bs = (t) => (e, ...s) => ({ _$litType$: t, strings: e, values: s }), S = Bs(1), M = Symbol.for("lit-noChange"), b = Symbol.for("lit-nothing"), At = /* @__PURE__ */ new WeakMap(), W = G.createTreeWalker(G, 129);
|
|
253
253
|
function Jt(t, e) {
|
|
254
254
|
if (!Qe(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
255
|
return yt !== void 0 ? yt.createHTML(e) : e;
|
|
@@ -260,7 +260,7 @@ const js = (t, e) => {
|
|
|
260
260
|
for (let a = 0; a < s; a++) {
|
|
261
261
|
const l = t[a];
|
|
262
262
|
let h, c, u = -1, f = 0;
|
|
263
|
-
for (; f < l.length && (n.lastIndex = f, c = n.exec(l), c !== null); ) f = n.lastIndex, n === le ? c[1] === "!--" ? n =
|
|
263
|
+
for (; f < l.length && (n.lastIndex = f, c = n.exec(l), c !== null); ) f = n.lastIndex, n === le ? c[1] === "!--" ? n = wt : c[1] !== void 0 ? n = bt : c[2] !== void 0 ? (Yt.test(c[2]) && (i = RegExp("</" + c[2], "g")), n = K) : c[3] !== void 0 && (n = K) : n === K ? c[0] === ">" ? (n = i ?? le, u = -1) : c[1] === void 0 ? u = -2 : (u = n.lastIndex - c[2].length, h = c[1], n = c[3] === void 0 ? K : c[3] === '"' ? $t : St) : n === $t || n === St ? n = K : n === wt || n === bt ? n = le : (n = K, i = void 0);
|
|
264
264
|
const y = n === K && t[a + 1].startsWith("/>") ? " " : "";
|
|
265
265
|
o += n === le ? l + Ls : u >= 0 ? (r.push(h), l.slice(0, u) + Vt + l.slice(u) + H + y) : l + H + (u === -2 ? a : y);
|
|
266
266
|
}
|
|
@@ -342,7 +342,7 @@ class re {
|
|
|
342
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
343
343
|
}
|
|
344
344
|
constructor(e, s, r, i) {
|
|
345
|
-
this.type = 2, this._$AH =
|
|
345
|
+
this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = e, this._$AB = s, this._$AM = r, this.options = i, this._$Cv = i?.isConnected ?? !0;
|
|
346
346
|
}
|
|
347
347
|
get parentNode() {
|
|
348
348
|
let e = this._$AA.parentNode;
|
|
@@ -356,7 +356,7 @@ class re {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(e, s = this) {
|
|
359
|
-
e = te(this, e, s), pe(e) ? e ===
|
|
359
|
+
e = te(this, e, s), pe(e) ? e === b || e == null || e === "" ? (this._$AH !== b && this._$AR(), this._$AH = b) : e !== this._$AH && e !== M && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Is(e) ? this.k(e) : this._(e);
|
|
360
360
|
}
|
|
361
361
|
O(e) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -365,7 +365,7 @@ class re {
|
|
|
365
365
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
366
366
|
}
|
|
367
367
|
_(e) {
|
|
368
|
-
this._$AH !==
|
|
368
|
+
this._$AH !== b && pe(this._$AH) ? this._$AA.nextSibling.data = e : this.T(G.createTextNode(e)), this._$AH = e;
|
|
369
369
|
}
|
|
370
370
|
$(e) {
|
|
371
371
|
const { values: s, _$litType$: r } = e, i = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = fe.createElement(Jt(r.h, r.h[0]), this.options)), r);
|
|
@@ -404,7 +404,7 @@ class Re {
|
|
|
404
404
|
return this._$AM._$AU;
|
|
405
405
|
}
|
|
406
406
|
constructor(e, s, r, i, o) {
|
|
407
|
-
this.type = 1, this._$AH =
|
|
407
|
+
this.type = 1, this._$AH = b, this._$AN = void 0, this.element = e, this.name = s, this._$AM = i, this.options = o, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = b;
|
|
408
408
|
}
|
|
409
409
|
_$AI(e, s = this, r, i) {
|
|
410
410
|
const o = this.strings;
|
|
@@ -413,12 +413,12 @@ class Re {
|
|
|
413
413
|
else {
|
|
414
414
|
const a = e;
|
|
415
415
|
let l, h;
|
|
416
|
-
for (e = o[0], l = 0; l < o.length - 1; l++) h = te(this, a[r + l], s, l), h === M && (h = this._$AH[l]), n ||= !pe(h) || h !== this._$AH[l], h ===
|
|
416
|
+
for (e = o[0], l = 0; l < o.length - 1; l++) h = te(this, a[r + l], s, l), h === M && (h = this._$AH[l]), n ||= !pe(h) || h !== this._$AH[l], h === b ? e = b : e !== b && (e += (h ?? "") + o[l + 1]), this._$AH[l] = h;
|
|
417
417
|
}
|
|
418
418
|
n && !i && this.j(e);
|
|
419
419
|
}
|
|
420
420
|
j(e) {
|
|
421
|
-
e ===
|
|
421
|
+
e === b ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
class Ms extends Re {
|
|
@@ -426,7 +426,7 @@ class Ms extends Re {
|
|
|
426
426
|
super(...arguments), this.type = 3;
|
|
427
427
|
}
|
|
428
428
|
j(e) {
|
|
429
|
-
this.element[this.name] = e ===
|
|
429
|
+
this.element[this.name] = e === b ? void 0 : e;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
432
|
class Fs extends Re {
|
|
@@ -434,7 +434,7 @@ class Fs extends Re {
|
|
|
434
434
|
super(...arguments), this.type = 4;
|
|
435
435
|
}
|
|
436
436
|
j(e) {
|
|
437
|
-
this.element.toggleAttribute(this.name, !!e && e !==
|
|
437
|
+
this.element.toggleAttribute(this.name, !!e && e !== b);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
440
|
class qs extends Re {
|
|
@@ -442,8 +442,8 @@ class qs extends Re {
|
|
|
442
442
|
super(e, s, r, i, o), this.type = 5;
|
|
443
443
|
}
|
|
444
444
|
_$AI(e, s = this) {
|
|
445
|
-
if ((e = te(this, e, s, 0) ??
|
|
446
|
-
const r = this._$AH, i = e ===
|
|
445
|
+
if ((e = te(this, e, s, 0) ?? b) === M) return;
|
|
446
|
+
const r = this._$AH, i = e === b && r !== b || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, o = e !== b && (r === b || i);
|
|
447
447
|
i && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
448
448
|
}
|
|
449
449
|
handleEvent(e) {
|
|
@@ -638,8 +638,8 @@ const _t = (t, e, s) => {
|
|
|
638
638
|
else if (h === void 0 && (h = _t(n, y, p), c = _t(a, u, f)), h.has(a[u])) if (h.has(a[f])) {
|
|
639
639
|
const g = c.get(n[y]), m = g !== void 0 ? i[g] : null;
|
|
640
640
|
if (m === null) {
|
|
641
|
-
const
|
|
642
|
-
V(
|
|
641
|
+
const w = ce(t, i[u]);
|
|
642
|
+
V(w, o[y]), l[y] = w;
|
|
643
643
|
} else l[y] = V(m, o[y]), ce(t, i[u], m), i[g] = null;
|
|
644
644
|
y++;
|
|
645
645
|
} else He(i[f]), f--;
|
|
@@ -882,20 +882,20 @@ const _t = (t, e, s) => {
|
|
|
882
882
|
domain: t,
|
|
883
883
|
clientId: r,
|
|
884
884
|
redirectUri: ir(i)
|
|
885
|
-
}, n = (
|
|
886
|
-
const _ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~", E = new Uint8Array(
|
|
885
|
+
}, n = (w) => {
|
|
886
|
+
const _ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~", E = new Uint8Array(w);
|
|
887
887
|
return crypto.getRandomValues(E), Array.from(E).map((k) => _[k % _.length]).join("");
|
|
888
|
-
}, a = async (
|
|
889
|
-
const E = new TextEncoder().encode(
|
|
888
|
+
}, a = async (w) => {
|
|
889
|
+
const E = new TextEncoder().encode(w), k = await crypto.subtle.digest("SHA-256", E);
|
|
890
890
|
return btoa(String.fromCharCode(...new Uint8Array(k))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
891
891
|
}, l = async () => {
|
|
892
|
-
const
|
|
893
|
-
return sessionStorage.setItem("pkce_code_verifier",
|
|
892
|
+
const w = n(128), _ = await a(w);
|
|
893
|
+
return sessionStorage.setItem("pkce_code_verifier", w), { codeVerifier: w, codeChallenge: _ };
|
|
894
894
|
}, h = () => {
|
|
895
|
-
const
|
|
896
|
-
return sessionStorage.setItem("oauth_state",
|
|
895
|
+
const w = n(32);
|
|
896
|
+
return sessionStorage.setItem("oauth_state", w), w;
|
|
897
897
|
}, c = async () => {
|
|
898
|
-
const { codeChallenge:
|
|
898
|
+
const { codeChallenge: w } = await l(), _ = h(), E = new URLSearchParams({
|
|
899
899
|
response_type: "code",
|
|
900
900
|
client_id: o.clientId,
|
|
901
901
|
redirect_uri: o.redirectUri,
|
|
@@ -903,15 +903,15 @@ const _t = (t, e, s) => {
|
|
|
903
903
|
scope: "openid email profile",
|
|
904
904
|
state: _,
|
|
905
905
|
code_challenge_method: "S256",
|
|
906
|
-
code_challenge:
|
|
906
|
+
code_challenge: w,
|
|
907
907
|
prompt: "select_account"
|
|
908
908
|
});
|
|
909
909
|
return `${o.domain}/oauth2/authorize?${E.toString()}`;
|
|
910
910
|
}, u = async () => {
|
|
911
|
-
const
|
|
912
|
-
window.location.href =
|
|
911
|
+
const w = await c();
|
|
912
|
+
window.location.href = w;
|
|
913
913
|
}, f = async () => {
|
|
914
|
-
const { codeChallenge:
|
|
914
|
+
const { codeChallenge: w } = await l(), _ = h(), E = new URLSearchParams({
|
|
915
915
|
response_type: "code",
|
|
916
916
|
client_id: o.clientId,
|
|
917
917
|
redirect_uri: o.redirectUri,
|
|
@@ -919,32 +919,32 @@ const _t = (t, e, s) => {
|
|
|
919
919
|
scope: "openid email profile",
|
|
920
920
|
state: _,
|
|
921
921
|
code_challenge_method: "S256",
|
|
922
|
-
code_challenge:
|
|
922
|
+
code_challenge: w
|
|
923
923
|
});
|
|
924
924
|
return `${o.domain}/oauth2/authorize?${E.toString()}`;
|
|
925
925
|
}, y = async () => {
|
|
926
|
-
const
|
|
927
|
-
window.location.href =
|
|
928
|
-
}, p = (
|
|
926
|
+
const w = await f();
|
|
927
|
+
window.location.href = w;
|
|
928
|
+
}, p = (w) => {
|
|
929
929
|
const _ = sessionStorage.getItem("oauth_state");
|
|
930
|
-
return sessionStorage.removeItem("oauth_state"), _ ===
|
|
930
|
+
return sessionStorage.removeItem("oauth_state"), _ === w;
|
|
931
931
|
}, g = () => {
|
|
932
|
-
const
|
|
933
|
-
return sessionStorage.removeItem("pkce_code_verifier"),
|
|
932
|
+
const w = sessionStorage.getItem("pkce_code_verifier");
|
|
933
|
+
return sessionStorage.removeItem("pkce_code_verifier"), w;
|
|
934
934
|
};
|
|
935
935
|
return {
|
|
936
936
|
redirectToGoogleAuth: u,
|
|
937
937
|
redirectToAppleAuth: y,
|
|
938
938
|
validateState: p,
|
|
939
939
|
getCodeVerifier: g,
|
|
940
|
-
exchangeCodeForTokens: async (
|
|
940
|
+
exchangeCodeForTokens: async (w) => {
|
|
941
941
|
const _ = g();
|
|
942
942
|
if (!_)
|
|
943
943
|
throw new Error("PKCE code verifier not found. Please restart the authentication flow.");
|
|
944
944
|
const E = new URLSearchParams({
|
|
945
945
|
grant_type: "authorization_code",
|
|
946
946
|
client_id: o.clientId,
|
|
947
|
-
code:
|
|
947
|
+
code: w,
|
|
948
948
|
redirect_uri: o.redirectUri,
|
|
949
949
|
code_verifier: _
|
|
950
950
|
}), k = await fetch(`${o.domain}/oauth2/token`, {
|
|
@@ -1887,7 +1887,7 @@ let A = class extends ee {
|
|
|
1887
1887
|
}
|
|
1888
1888
|
render() {
|
|
1889
1889
|
if (!this.isVisible)
|
|
1890
|
-
return
|
|
1890
|
+
return b;
|
|
1891
1891
|
const t = {
|
|
1892
1892
|
"modal-overlay": !0,
|
|
1893
1893
|
"modal-overlay--closing": this.isClosing
|
|
@@ -1951,7 +1951,7 @@ let A = class extends ee {
|
|
|
1951
1951
|
/>
|
|
1952
1952
|
</div>
|
|
1953
1953
|
</header>
|
|
1954
|
-
` :
|
|
1954
|
+
` : b}
|
|
1955
1955
|
|
|
1956
1956
|
<div class="modal-body">
|
|
1957
1957
|
<div class="auth-form">
|
|
@@ -1976,7 +1976,7 @@ let A = class extends ee {
|
|
|
1976
1976
|
/>
|
|
1977
1977
|
</div>
|
|
1978
1978
|
</header>
|
|
1979
|
-
` :
|
|
1979
|
+
` : b}
|
|
1980
1980
|
|
|
1981
1981
|
<!-- Body -->
|
|
1982
1982
|
<div class="modal-body">
|
|
@@ -2002,7 +2002,7 @@ let A = class extends ee {
|
|
|
2002
2002
|
/>
|
|
2003
2003
|
</div>
|
|
2004
2004
|
</header>
|
|
2005
|
-
` :
|
|
2005
|
+
` : b}
|
|
2006
2006
|
|
|
2007
2007
|
<!-- Body -->
|
|
2008
2008
|
<div class="modal-body">
|
|
@@ -2037,7 +2037,7 @@ let A = class extends ee {
|
|
|
2037
2037
|
required
|
|
2038
2038
|
autocomplete="email"
|
|
2039
2039
|
/>
|
|
2040
|
-
${this.errors.email ? S`<span class="field-error">${this.errors.email}</span>` :
|
|
2040
|
+
${this.errors.email ? S`<span class="field-error">${this.errors.email}</span>` : b}
|
|
2041
2041
|
</label>
|
|
2042
2042
|
|
|
2043
2043
|
<!-- Password -->
|
|
@@ -2052,7 +2052,7 @@ let A = class extends ee {
|
|
|
2052
2052
|
required
|
|
2053
2053
|
autocomplete=${this.mode === "signup" ? "new-password" : "current-password"}
|
|
2054
2054
|
/>
|
|
2055
|
-
${this.errors.password ? S`<span class="field-error">${this.errors.password}</span>` :
|
|
2055
|
+
${this.errors.password ? S`<span class="field-error">${this.errors.password}</span>` : b}
|
|
2056
2056
|
</label>
|
|
2057
2057
|
|
|
2058
2058
|
${this.mode === "signin" && this.error ? S`
|
|
@@ -2061,7 +2061,7 @@ let A = class extends ee {
|
|
|
2061
2061
|
Forgot your password?
|
|
2062
2062
|
</button>
|
|
2063
2063
|
</div>
|
|
2064
|
-
` :
|
|
2064
|
+
` : b}
|
|
2065
2065
|
|
|
2066
2066
|
${this.mode === "signup" ? S`
|
|
2067
2067
|
<!-- Confirm Password -->
|
|
@@ -2076,7 +2076,7 @@ let A = class extends ee {
|
|
|
2076
2076
|
required
|
|
2077
2077
|
autocomplete="new-password"
|
|
2078
2078
|
/>
|
|
2079
|
-
${this.errors.confirm_password ? S`<span class="field-error">${this.errors.confirm_password}</span>` :
|
|
2079
|
+
${this.errors.confirm_password ? S`<span class="field-error">${this.errors.confirm_password}</span>` : b}
|
|
2080
2080
|
</label>
|
|
2081
2081
|
|
|
2082
2082
|
<!-- First Name -->
|
|
@@ -2091,7 +2091,7 @@ let A = class extends ee {
|
|
|
2091
2091
|
required
|
|
2092
2092
|
autocomplete="given-name"
|
|
2093
2093
|
/>
|
|
2094
|
-
${this.errors.givenName ? S`<span class="field-error">${this.errors.givenName}</span>` :
|
|
2094
|
+
${this.errors.givenName ? S`<span class="field-error">${this.errors.givenName}</span>` : b}
|
|
2095
2095
|
</label>
|
|
2096
2096
|
|
|
2097
2097
|
<!-- Last Name -->
|
|
@@ -2106,9 +2106,9 @@ let A = class extends ee {
|
|
|
2106
2106
|
required
|
|
2107
2107
|
autocomplete="family-name"
|
|
2108
2108
|
/>
|
|
2109
|
-
${this.errors.familyName ? S`<span class="field-error">${this.errors.familyName}</span>` :
|
|
2109
|
+
${this.errors.familyName ? S`<span class="field-error">${this.errors.familyName}</span>` : b}
|
|
2110
2110
|
</label>
|
|
2111
|
-
` :
|
|
2111
|
+
` : b}
|
|
2112
2112
|
`;
|
|
2113
2113
|
if (this.mode === "signup" && this.signupStep === "otp")
|
|
2114
2114
|
return S`
|
|
@@ -2135,7 +2135,7 @@ let A = class extends ee {
|
|
|
2135
2135
|
`
|
|
2136
2136
|
)}
|
|
2137
2137
|
</div>
|
|
2138
|
-
${this.errors.signup_otp ? S`<p class="otp-error">${this.errors.signup_otp}</p>` :
|
|
2138
|
+
${this.errors.signup_otp ? S`<p class="otp-error">${this.errors.signup_otp}</p>` : b}
|
|
2139
2139
|
</div>
|
|
2140
2140
|
<div class="forgot-row">
|
|
2141
2141
|
<button type="button" class="text-btn" @click=${this.backToSignupForm}>
|
|
@@ -2157,7 +2157,7 @@ let A = class extends ee {
|
|
|
2157
2157
|
required
|
|
2158
2158
|
autocomplete="email"
|
|
2159
2159
|
/>
|
|
2160
|
-
${this.errors.email ? S`<span class="field-error">${this.errors.email}</span>` :
|
|
2160
|
+
${this.errors.email ? S`<span class="field-error">${this.errors.email}</span>` : b}
|
|
2161
2161
|
</label>
|
|
2162
2162
|
<div class="forgot-row">
|
|
2163
2163
|
<button type="button" class="text-btn" @click=${this.cancelReset}>
|
|
@@ -2179,7 +2179,7 @@ let A = class extends ee {
|
|
|
2179
2179
|
required
|
|
2180
2180
|
autocomplete="email"
|
|
2181
2181
|
/>
|
|
2182
|
-
${this.errors.email ? S`<span class="field-error">${this.errors.email}</span>` :
|
|
2182
|
+
${this.errors.email ? S`<span class="field-error">${this.errors.email}</span>` : b}
|
|
2183
2183
|
</label>
|
|
2184
2184
|
|
|
2185
2185
|
<div class="otp-section">
|
|
@@ -2205,7 +2205,7 @@ let A = class extends ee {
|
|
|
2205
2205
|
`
|
|
2206
2206
|
)}
|
|
2207
2207
|
</div>
|
|
2208
|
-
${this.errors.otp ? S`<p class="otp-error">${this.errors.otp}</p>` :
|
|
2208
|
+
${this.errors.otp ? S`<p class="otp-error">${this.errors.otp}</p>` : b}
|
|
2209
2209
|
</div>
|
|
2210
2210
|
|
|
2211
2211
|
${t ? S`
|
|
@@ -2221,7 +2221,7 @@ let A = class extends ee {
|
|
|
2221
2221
|
required
|
|
2222
2222
|
autocomplete="new-password"
|
|
2223
2223
|
/>
|
|
2224
|
-
${this.errors.new_password ? S`<span class="field-error">${this.errors.new_password}</span>` :
|
|
2224
|
+
${this.errors.new_password ? S`<span class="field-error">${this.errors.new_password}</span>` : b}
|
|
2225
2225
|
</label>
|
|
2226
2226
|
|
|
2227
2227
|
<label class="field">
|
|
@@ -2235,10 +2235,10 @@ let A = class extends ee {
|
|
|
2235
2235
|
required
|
|
2236
2236
|
autocomplete="new-password"
|
|
2237
2237
|
/>
|
|
2238
|
-
${this.errors.confirm_password ? S`<span class="field-error">${this.errors.confirm_password}</span>` :
|
|
2238
|
+
${this.errors.confirm_password ? S`<span class="field-error">${this.errors.confirm_password}</span>` : b}
|
|
2239
2239
|
</label>
|
|
2240
2240
|
</div>
|
|
2241
|
-
` :
|
|
2241
|
+
` : b}
|
|
2242
2242
|
|
|
2243
2243
|
<div class="forgot-row">
|
|
2244
2244
|
<button type="button" class="text-btn" @click=${this.backToRequest}>
|
|
@@ -2247,7 +2247,7 @@ let A = class extends ee {
|
|
|
2247
2247
|
</div>
|
|
2248
2248
|
`;
|
|
2249
2249
|
}
|
|
2250
|
-
return
|
|
2250
|
+
return b;
|
|
2251
2251
|
}
|
|
2252
2252
|
renderActions() {
|
|
2253
2253
|
if (this.resetStep === "request")
|
|
@@ -2261,7 +2261,7 @@ let A = class extends ee {
|
|
|
2261
2261
|
<button type="submit" class="cta" ?disabled=${this.isLoading}>
|
|
2262
2262
|
${this.isLoading ? "Resetting..." : "Reset Password"}
|
|
2263
2263
|
</button>
|
|
2264
|
-
` :
|
|
2264
|
+
` : b;
|
|
2265
2265
|
if (this.mode === "signup" && this.signupStep === "otp") {
|
|
2266
2266
|
const t = this.signupOtpDigits.every((e) => /^\d$/.test(e));
|
|
2267
2267
|
return S`
|
|
@@ -2295,7 +2295,7 @@ let A = class extends ee {
|
|
|
2295
2295
|
${this.renderAppleIcon()}
|
|
2296
2296
|
</button>
|
|
2297
2297
|
</div>
|
|
2298
|
-
` :
|
|
2298
|
+
` : b}
|
|
2299
2299
|
`;
|
|
2300
2300
|
}
|
|
2301
2301
|
renderAlerts() {
|
|
@@ -2307,7 +2307,7 @@ let A = class extends ee {
|
|
|
2307
2307
|
×
|
|
2308
2308
|
</button>
|
|
2309
2309
|
</div>
|
|
2310
|
-
` :
|
|
2310
|
+
` : b}
|
|
2311
2311
|
${this.error ? S`
|
|
2312
2312
|
<div class="alert alert--error">
|
|
2313
2313
|
${this.error}
|
|
@@ -2315,11 +2315,11 @@ let A = class extends ee {
|
|
|
2315
2315
|
×
|
|
2316
2316
|
</button>
|
|
2317
2317
|
</div>
|
|
2318
|
-
` :
|
|
2318
|
+
` : b}
|
|
2319
2319
|
`;
|
|
2320
2320
|
}
|
|
2321
2321
|
renderFooter() {
|
|
2322
|
-
return this.isLoggedIn ?
|
|
2322
|
+
return this.isLoggedIn ? b : this.resetStep === "none" && (!this.mode || this.mode === "signin" || this.signupStep === "form") ? this.disableSignup ? b : S`
|
|
2323
2323
|
<div class="auth-footer">
|
|
2324
2324
|
<p class="toggle-text">
|
|
2325
2325
|
${this.mode === "signup" ? "Already have an account?" : "Don't have an account?"}
|
|
@@ -2506,7 +2506,7 @@ v([
|
|
|
2506
2506
|
tt(".modal-body")
|
|
2507
2507
|
], A.prototype, "modalBody", 2);
|
|
2508
2508
|
A = v([
|
|
2509
|
-
Gt("auth")
|
|
2509
|
+
Gt("auth-drawer")
|
|
2510
2510
|
], A);
|
|
2511
2511
|
var hr = Object.defineProperty, dr = Object.getOwnPropertyDescriptor, ie = (t, e, s, r) => {
|
|
2512
2512
|
for (var i = r > 1 ? void 0 : r ? dr(e, s) : e, o = t.length - 1, n; o >= 0; o--)
|
|
@@ -2755,7 +2755,7 @@ const fr = Ue("string"), P = Ue("function"), os = Ue("number"), ge = (t) => t !=
|
|
|
2755
2755
|
} catch {
|
|
2756
2756
|
return !1;
|
|
2757
2757
|
}
|
|
2758
|
-
}, yr = N("Date"),
|
|
2758
|
+
}, yr = N("Date"), wr = N("File"), br = N("Blob"), Sr = N("FileList"), $r = (t) => ge(t) && P(t.pipe), Ar = (t) => {
|
|
2759
2759
|
let e;
|
|
2760
2760
|
return t && (typeof FormData == "function" && t instanceof FormData || P(t.append) && ((e = De(t)) === "formdata" || // detect form-data instance
|
|
2761
2761
|
e === "object" && P(t.toString) && t.toString() === "[object FormData]"));
|
|
@@ -2921,8 +2921,8 @@ const Vr = (t) => {
|
|
|
2921
2921
|
isHeaders: kr,
|
|
2922
2922
|
isUndefined: se,
|
|
2923
2923
|
isDate: yr,
|
|
2924
|
-
isFile:
|
|
2925
|
-
isBlob:
|
|
2924
|
+
isFile: wr,
|
|
2925
|
+
isBlob: br,
|
|
2926
2926
|
isRegExp: Hr,
|
|
2927
2927
|
isFunction: P,
|
|
2928
2928
|
isStream: $r,
|
|
@@ -3057,12 +3057,12 @@ function Ne(t, e, s) {
|
|
|
3057
3057
|
return d.isArrayBuffer(p) || d.isTypedArray(p) ? l && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
|
|
3058
3058
|
}
|
|
3059
3059
|
function c(p, g, m) {
|
|
3060
|
-
let
|
|
3060
|
+
let w = p;
|
|
3061
3061
|
if (p && !m && typeof p == "object") {
|
|
3062
3062
|
if (d.endsWith(g, "{}"))
|
|
3063
3063
|
g = r ? g : g.slice(0, -2), p = JSON.stringify(p);
|
|
3064
|
-
else if (d.isArray(p) && Xr(p) || (d.isFileList(p) || d.endsWith(g, "[]")) && (
|
|
3065
|
-
return g = us(g),
|
|
3064
|
+
else if (d.isArray(p) && Xr(p) || (d.isFileList(p) || d.endsWith(g, "[]")) && (w = d.toArray(p)))
|
|
3065
|
+
return g = us(g), w.forEach(function(E, k) {
|
|
3066
3066
|
!(d.isUndefined(E) || E === null) && e.append(
|
|
3067
3067
|
// eslint-disable-next-line no-nested-ternary
|
|
3068
3068
|
n === !0 ? Ct([g], k, o) : n === null ? g : g + "[]",
|
|
@@ -3081,14 +3081,14 @@ function Ne(t, e, s) {
|
|
|
3081
3081
|
if (!d.isUndefined(p)) {
|
|
3082
3082
|
if (u.indexOf(p) !== -1)
|
|
3083
3083
|
throw Error("Circular reference detected in " + g.join("."));
|
|
3084
|
-
u.push(p), d.forEach(p, function(
|
|
3085
|
-
(!(d.isUndefined(
|
|
3084
|
+
u.push(p), d.forEach(p, function(w, _) {
|
|
3085
|
+
(!(d.isUndefined(w) || w === null) && i.call(
|
|
3086
3086
|
e,
|
|
3087
|
-
|
|
3087
|
+
w,
|
|
3088
3088
|
d.isString(_) ? _.trim() : _,
|
|
3089
3089
|
g,
|
|
3090
3090
|
f
|
|
3091
|
-
)) === !0 && y(
|
|
3091
|
+
)) === !0 && y(w, g ? g.concat(_) : [_]);
|
|
3092
3092
|
}), u.pop();
|
|
3093
3093
|
}
|
|
3094
3094
|
}
|
|
@@ -3266,7 +3266,7 @@ function ui(t, e, s) {
|
|
|
3266
3266
|
}
|
|
3267
3267
|
return (s || JSON.stringify)(t);
|
|
3268
3268
|
}
|
|
3269
|
-
const
|
|
3269
|
+
const we = {
|
|
3270
3270
|
transitional: ms,
|
|
3271
3271
|
adapter: ["xhr", "http", "fetch"],
|
|
3272
3272
|
transformRequest: [function(e, s) {
|
|
@@ -3295,7 +3295,7 @@ const be = {
|
|
|
3295
3295
|
return o || i ? (s.setContentType("application/json", !1), ui(e)) : e;
|
|
3296
3296
|
}],
|
|
3297
3297
|
transformResponse: [function(e) {
|
|
3298
|
-
const s = this.transitional ||
|
|
3298
|
+
const s = this.transitional || we.transitional, r = s && s.forcedJSONParsing, i = this.responseType === "json";
|
|
3299
3299
|
if (d.isResponse(e) || d.isReadableStream(e))
|
|
3300
3300
|
return e;
|
|
3301
3301
|
if (e && d.isString(e) && (r && !this.responseType || i)) {
|
|
@@ -3333,7 +3333,7 @@ const be = {
|
|
|
3333
3333
|
}
|
|
3334
3334
|
};
|
|
3335
3335
|
d.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
|
|
3336
|
-
|
|
3336
|
+
we.headers[t] = {};
|
|
3337
3337
|
});
|
|
3338
3338
|
const pi = d.toObjectSet([
|
|
3339
3339
|
"age",
|
|
@@ -3388,7 +3388,7 @@ function Fe(t, e, s, r, i) {
|
|
|
3388
3388
|
function yi(t) {
|
|
3389
3389
|
return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, s, r) => s.toUpperCase() + r);
|
|
3390
3390
|
}
|
|
3391
|
-
function
|
|
3391
|
+
function wi(t, e) {
|
|
3392
3392
|
const s = d.toCamelCase(" " + e);
|
|
3393
3393
|
["get", "set", "has"].forEach((r) => {
|
|
3394
3394
|
Object.defineProperty(t, r + s, {
|
|
@@ -3520,7 +3520,7 @@ class D {
|
|
|
3520
3520
|
}).accessors, i = this.prototype;
|
|
3521
3521
|
function o(n) {
|
|
3522
3522
|
const a = he(n);
|
|
3523
|
-
r[a] || (
|
|
3523
|
+
r[a] || (wi(i, n), r[a] = !0);
|
|
3524
3524
|
}
|
|
3525
3525
|
return d.isArray(e) ? e.forEach(o) : o(e), this;
|
|
3526
3526
|
}
|
|
@@ -3537,7 +3537,7 @@ d.reduceDescriptors(D.prototype, ({ value: t }, e) => {
|
|
|
3537
3537
|
});
|
|
3538
3538
|
d.freezeMethods(D);
|
|
3539
3539
|
function qe(t, e) {
|
|
3540
|
-
const s = this ||
|
|
3540
|
+
const s = this || we, r = e || s, i = D.from(r.headers);
|
|
3541
3541
|
let o = r.data;
|
|
3542
3542
|
return d.forEach(t, function(a) {
|
|
3543
3543
|
o = a.call(s, o, i.normalize(), e ? e.status : void 0);
|
|
@@ -3552,7 +3552,7 @@ function ne(t, e, s) {
|
|
|
3552
3552
|
d.inherits(ne, $, {
|
|
3553
3553
|
__CANCEL__: !0
|
|
3554
3554
|
});
|
|
3555
|
-
function
|
|
3555
|
+
function ws(t, e, s) {
|
|
3556
3556
|
const r = s.config.validateStatus;
|
|
3557
3557
|
!s.status || !r || r(s.status) ? t(s) : e(new $(
|
|
3558
3558
|
"Request failed with status code " + s.status,
|
|
@@ -3562,7 +3562,7 @@ function bs(t, e, s) {
|
|
|
3562
3562
|
s
|
|
3563
3563
|
));
|
|
3564
3564
|
}
|
|
3565
|
-
function
|
|
3565
|
+
function bi(t) {
|
|
3566
3566
|
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
|
|
3567
3567
|
return e && e[1] || "";
|
|
3568
3568
|
}
|
|
@@ -3658,7 +3658,7 @@ function Ei(t) {
|
|
|
3658
3658
|
function _i(t, e) {
|
|
3659
3659
|
return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
|
|
3660
3660
|
}
|
|
3661
|
-
function
|
|
3661
|
+
function bs(t, e, s) {
|
|
3662
3662
|
let r = !Ei(e);
|
|
3663
3663
|
return t && (r || s == !1) ? _i(t, e) : e;
|
|
3664
3664
|
}
|
|
@@ -3730,7 +3730,7 @@ function Z(t, e) {
|
|
|
3730
3730
|
const Ss = (t) => {
|
|
3731
3731
|
const e = Z({}, t);
|
|
3732
3732
|
let { data: s, withXSRFToken: r, xsrfHeaderName: i, xsrfCookieName: o, headers: n, auth: a } = e;
|
|
3733
|
-
if (e.headers = n = D.from(n), e.url = fs(
|
|
3733
|
+
if (e.headers = n = D.from(n), e.url = fs(bs(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer), a && n.set(
|
|
3734
3734
|
"Authorization",
|
|
3735
3735
|
"Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
|
|
3736
3736
|
), d.isFormData(s)) {
|
|
@@ -3759,7 +3759,7 @@ const Ss = (t) => {
|
|
|
3759
3759
|
}
|
|
3760
3760
|
let m = new XMLHttpRequest();
|
|
3761
3761
|
m.open(i.method.toUpperCase(), i.url, !0), m.timeout = i.timeout;
|
|
3762
|
-
function
|
|
3762
|
+
function w() {
|
|
3763
3763
|
if (!m)
|
|
3764
3764
|
return;
|
|
3765
3765
|
const E = D.from(
|
|
@@ -3772,14 +3772,14 @@ const Ss = (t) => {
|
|
|
3772
3772
|
config: t,
|
|
3773
3773
|
request: m
|
|
3774
3774
|
};
|
|
3775
|
-
|
|
3775
|
+
ws(function(U) {
|
|
3776
3776
|
s(U), g();
|
|
3777
3777
|
}, function(U) {
|
|
3778
3778
|
r(U), g();
|
|
3779
3779
|
}, R), m = null;
|
|
3780
3780
|
}
|
|
3781
|
-
"onloadend" in m ? m.onloadend =
|
|
3782
|
-
!m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(
|
|
3781
|
+
"onloadend" in m ? m.onloadend = w : m.onreadystatechange = function() {
|
|
3782
|
+
!m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(w);
|
|
3783
3783
|
}, m.onabort = function() {
|
|
3784
3784
|
m && (r(new $("Request aborted", $.ECONNABORTED, t, m)), m = null);
|
|
3785
3785
|
}, m.onerror = function(k) {
|
|
@@ -3799,7 +3799,7 @@ const Ss = (t) => {
|
|
|
3799
3799
|
}), d.isUndefined(i.withCredentials) || (m.withCredentials = !!i.withCredentials), a && a !== "json" && (m.responseType = i.responseType), h && ([f, p] = Oe(h, !0), m.addEventListener("progress", f)), l && m.upload && ([u, y] = Oe(l), m.upload.addEventListener("progress", u), m.upload.addEventListener("loadend", y)), (i.cancelToken || i.signal) && (c = (E) => {
|
|
3800
3800
|
m && (r(!E || E.type ? new ne(null, t, m) : E), m.abort(), m = null);
|
|
3801
3801
|
}, i.cancelToken && i.cancelToken.subscribe(c), i.signal && (i.signal.aborted ? c() : i.signal.addEventListener("abort", c)));
|
|
3802
|
-
const _ =
|
|
3802
|
+
const _ = bi(i.url);
|
|
3803
3803
|
if (_ && x.protocols.indexOf(_) === -1) {
|
|
3804
3804
|
r(new $("Unsupported protocol " + _ + ":", $.ERR_BAD_REQUEST, t));
|
|
3805
3805
|
return;
|
|
@@ -3920,9 +3920,9 @@ const Ss = (t) => {
|
|
|
3920
3920
|
};
|
|
3921
3921
|
i && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((p) => {
|
|
3922
3922
|
!u[p] && (u[p] = (g, m) => {
|
|
3923
|
-
let
|
|
3924
|
-
if (
|
|
3925
|
-
return
|
|
3923
|
+
let w = g && g[p];
|
|
3924
|
+
if (w)
|
|
3925
|
+
return w.call(g);
|
|
3926
3926
|
throw new $(`Response type '${p}' is not supported`, $.ERR_NOT_SUPPORT, m);
|
|
3927
3927
|
});
|
|
3928
3928
|
});
|
|
@@ -3948,7 +3948,7 @@ const Ss = (t) => {
|
|
|
3948
3948
|
let {
|
|
3949
3949
|
url: g,
|
|
3950
3950
|
method: m,
|
|
3951
|
-
data:
|
|
3951
|
+
data: w,
|
|
3952
3952
|
signal: _,
|
|
3953
3953
|
cancelToken: E,
|
|
3954
3954
|
timeout: k,
|
|
@@ -3956,7 +3956,7 @@ const Ss = (t) => {
|
|
|
3956
3956
|
onUploadProgress: q,
|
|
3957
3957
|
responseType: U,
|
|
3958
3958
|
headers: Ie,
|
|
3959
|
-
withCredentials:
|
|
3959
|
+
withCredentials: be = "same-origin",
|
|
3960
3960
|
fetchOptions: at
|
|
3961
3961
|
} = Ss(p), lt = e || fetch;
|
|
3962
3962
|
U = U ? (U + "").toLowerCase() : "text";
|
|
@@ -3966,29 +3966,29 @@ const Ss = (t) => {
|
|
|
3966
3966
|
});
|
|
3967
3967
|
let ct;
|
|
3968
3968
|
try {
|
|
3969
|
-
if (q && h && m !== "get" && m !== "head" && (ct = await y(Ie,
|
|
3969
|
+
if (q && h && m !== "get" && m !== "head" && (ct = await y(Ie, w)) !== 0) {
|
|
3970
3970
|
let j = new s(g, {
|
|
3971
3971
|
method: "POST",
|
|
3972
|
-
body:
|
|
3972
|
+
body: w,
|
|
3973
3973
|
duplex: "half"
|
|
3974
3974
|
}), X;
|
|
3975
|
-
if (d.isFormData(
|
|
3975
|
+
if (d.isFormData(w) && (X = j.headers.get("content-type")) && Ie.setContentType(X), j.body) {
|
|
3976
3976
|
const [Be, $e] = Pt(
|
|
3977
3977
|
ct,
|
|
3978
3978
|
Oe(Dt(q))
|
|
3979
3979
|
);
|
|
3980
|
-
|
|
3980
|
+
w = Nt(j.body, Lt, Be, $e);
|
|
3981
3981
|
}
|
|
3982
3982
|
}
|
|
3983
|
-
d.isString(
|
|
3983
|
+
d.isString(be) || (be = be ? "include" : "omit");
|
|
3984
3984
|
const L = o && "credentials" in s.prototype, ht = {
|
|
3985
3985
|
...at,
|
|
3986
3986
|
signal: Se,
|
|
3987
3987
|
method: m.toUpperCase(),
|
|
3988
3988
|
headers: Ie.normalize().toJSON(),
|
|
3989
|
-
body:
|
|
3989
|
+
body: w,
|
|
3990
3990
|
duplex: "half",
|
|
3991
|
-
credentials: L ?
|
|
3991
|
+
credentials: L ? be : void 0
|
|
3992
3992
|
};
|
|
3993
3993
|
ae = o && new s(g, ht);
|
|
3994
3994
|
let B = await (o ? lt(ae, at) : lt(g, ht));
|
|
@@ -4012,7 +4012,7 @@ const Ss = (t) => {
|
|
|
4012
4012
|
U = U || "text";
|
|
4013
4013
|
let _s = await u[d.findKey(u, U) || "text"](B, p);
|
|
4014
4014
|
return !dt && z && z(), await new Promise((j, X) => {
|
|
4015
|
-
|
|
4015
|
+
ws(j, X, {
|
|
4016
4016
|
data: _s,
|
|
4017
4017
|
headers: D.from(B.headers),
|
|
4018
4018
|
status: B.status,
|
|
@@ -4108,7 +4108,7 @@ function Mt(t) {
|
|
|
4108
4108
|
return ze(t), t.headers = D.from(t.headers), t.data = qe.call(
|
|
4109
4109
|
t,
|
|
4110
4110
|
t.transformRequest
|
|
4111
|
-
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), As.getAdapter(t.adapter ||
|
|
4111
|
+
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), As.getAdapter(t.adapter || we.adapter, t)(t).then(function(r) {
|
|
4112
4112
|
return ze(t), r.data = qe.call(
|
|
4113
4113
|
t,
|
|
4114
4114
|
t.transformResponse,
|
|
@@ -4262,7 +4262,7 @@ class J {
|
|
|
4262
4262
|
}
|
|
4263
4263
|
getUri(e) {
|
|
4264
4264
|
e = Z(this.defaults, e);
|
|
4265
|
-
const s =
|
|
4265
|
+
const s = bs(e.baseURL, e.url, e.allowAbsoluteUrls);
|
|
4266
4266
|
return fs(s, e.params, e.paramsSerializer);
|
|
4267
4267
|
}
|
|
4268
4268
|
}
|
|
@@ -4451,7 +4451,7 @@ function Es(t) {
|
|
|
4451
4451
|
return Es(Z(t, i));
|
|
4452
4452
|
}, s;
|
|
4453
4453
|
}
|
|
4454
|
-
const C = Es(
|
|
4454
|
+
const C = Es(we);
|
|
4455
4455
|
C.Axios = J;
|
|
4456
4456
|
C.CanceledError = ne;
|
|
4457
4457
|
C.CancelToken = nt;
|