@springmicro/auth 0.4.1 → 0.5.0
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/{Index-64ac63ff-mcEPPGzJ.js → Index-64ac63ff-BrMgwosO.js} +1 -1
- package/dist/{Index-6c094240-D4xpr8fA.js → Index-6c094240-DXC18ikE.js} +1 -1
- package/dist/{Web3Auth-DB9s-qbl.js → Web3Auth-DhI1eSsQ.js} +10 -10
- package/dist/{hashMessage-Dw0KdqMZ.js → hashMessage-BQXVpTYE.js} +1 -1
- package/dist/{index-CroNOC7e.js → index-BRZ2plvc.js} +4 -4
- package/dist/{index-Df5ie3cE.js → index-BXdspCS1.js} +5 -7
- package/dist/{index-CiwBcaZ0.js → index-Be91u-op.js} +1 -1
- package/dist/{index-CDaoza_m.js → index-Bpbr6WnZ.js} +2 -2
- package/dist/{index-C0yeApwY.js → index-Cqd2rvl1.js} +1 -1
- package/dist/{index-wNV8PBAh.js → index-DwdV0Emj.js} +2 -2
- package/dist/{index-F-gl3DJX.js → index-mpserFHa.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +2 -2
- package/dist/{number-ByqdQYDu.js → number-DAtvFp1_.js} +1 -1
- package/package.json +6 -6
- package/src/components/forms/SendCodeInput.tsx +3 -3
- package/src/components/forms/SignUpFormItem.tsx +3 -3
- package/src/components/forms/util/application-api.ts +4 -4
- package/src/components/forms/util/user-api.ts +7 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Y as I, Z as N, $ as M, a0 as O, am as me, a4 as _, a7 as w, a8 as G, a9 as T, aa as V, ab as C, ac as Y, ad as _e, ae as we, af as D, a1 as h, a3 as m, aA as Ce, ah as H, a2 as L, b7 as W, ai as $, a5 as g, a6 as S, ay as be, bg as ze, bh as Te, bi as je, aD as Le, aU as xe, aG as Pe, aW as Se, aj as F, aO as Z, aR as Re, bj as Ee, bk as ye, aV as Ie, az as Ne, bl as U, bm as B, aw as A, aH as he, an as Me, ao as ge, bn as Oe, ag as ke, bo as X, bp as J, al as E, bq as Q, au as R, aC as K, br as ee, bs as De, bt as te, bu as x, at as He, aX as q, bv as $e } from "./Web3Auth-
|
|
1
|
+
import { Y as I, Z as N, $ as M, a0 as O, am as me, a4 as _, a7 as w, a8 as G, a9 as T, aa as V, ab as C, ac as Y, ad as _e, ae as we, af as D, a1 as h, a3 as m, aA as Ce, ah as H, a2 as L, b7 as W, ai as $, a5 as g, a6 as S, ay as be, bg as ze, bh as Te, bi as je, aD as Le, aU as xe, aG as Pe, aW as Se, aj as F, aO as Z, aR as Re, bj as Ee, bk as ye, aV as Ie, az as Ne, bl as U, bm as B, aw as A, aH as he, an as Me, ao as ge, bn as Oe, ag as ke, bo as X, bp as J, al as E, bq as Q, au as R, aC as K, br as ee, bs as De, bt as te, bu as x, at as He, aX as q, bv as $e } from "./Web3Auth-DhI1eSsQ.js";
|
|
2
2
|
function Fe(i, { from: e, to: t }, n = {}) {
|
|
3
3
|
const o = getComputedStyle(i), a = o.transform === "none" ? "" : o.transform, [f, l] = o.transformOrigin.split(" ").map(parseFloat), s = e.left + e.width * f / t.width - (t.left + f), r = e.top + e.height * l / t.height - (t.top + l), { delay: c = 0, duration: d = (u) => Math.sqrt(u) * 120, easing: v = ye } = n;
|
|
4
4
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as He, J as Ht, K as Bt, L as Dt, M as Wt, N as Nt, O as Et, P as Ft, Q as Ot, R as Zt, T as Rt, U as Gt, V as Ut, W as Xt, X as Yt, Y as pe, Z as ve, $ as me, a0 as he, a1 as h, a2 as z, a3 as p, a4 as M, a5 as c, a6 as Y, a7 as y, a8 as ae, a9 as A, aa as ie, ab as S, ac as te, ad as ye, ae as Ce, af as ee, ag as Jt, ah as F, ai as O, aj as Z, ak as Be, al as R, am as ue, an as Me, ao as qe, ap as $t, aq as De, ar as P, as as be, at as ge, au as L, av as _e, aw as ce, ax as Kt, ay as fe, az as we, aA as At, aB as Qt, aC as j, aD as Ae, aE as We, aF as Ne, aG as Ee, aH as ke, aI as Tt, aJ as xt, aK as en, aL as Ve, aM as ze, aN as Mt, aO as tn, aP as nn, aQ as rn, aR as St, aS as on, aT as de, aU as Ie, aV as $e, aW as ln, aX as je, aY as an, aZ as sn, a_ as It, a$ as Pt, b0 as cn, b1 as dn, b2 as Fe, b3 as un, b4 as Oe, b5 as fn, b6 as Ze, b7 as Pe, b8 as Re, b9 as pn, ba as Le, bb as Ge, bc as vn, bd as mn, be as Ue, bf as hn } from "./Web3Auth-
|
|
1
|
+
import { _ as He, J as Ht, K as Bt, L as Dt, M as Wt, N as Nt, O as Et, P as Ft, Q as Ot, R as Zt, T as Rt, U as Gt, V as Ut, W as Xt, X as Yt, Y as pe, Z as ve, $ as me, a0 as he, a1 as h, a2 as z, a3 as p, a4 as M, a5 as c, a6 as Y, a7 as y, a8 as ae, a9 as A, aa as ie, ab as S, ac as te, ad as ye, ae as Ce, af as ee, ag as Jt, ah as F, ai as O, aj as Z, ak as Be, al as R, am as ue, an as Me, ao as qe, ap as $t, aq as De, ar as P, as as be, at as ge, au as L, av as _e, aw as ce, ax as Kt, ay as fe, az as we, aA as At, aB as Qt, aC as j, aD as Ae, aE as We, aF as Ne, aG as Ee, aH as ke, aI as Tt, aJ as xt, aK as en, aL as Ve, aM as ze, aN as Mt, aO as tn, aP as nn, aQ as rn, aR as St, aS as on, aT as de, aU as Ie, aV as $e, aW as ln, aX as je, aY as an, aZ as sn, a_ as It, a$ as Pt, b0 as cn, b1 as dn, b2 as Fe, b3 as un, b4 as Oe, b5 as fn, b6 as Ze, b7 as Pe, b8 as Re, b9 as pn, ba as Le, bb as Ge, bc as vn, bd as mn, be as Ue, bf as hn } from "./Web3Auth-DhI1eSsQ.js";
|
|
2
2
|
var gn = function(e) {
|
|
3
3
|
He(t, e);
|
|
4
4
|
function t(n, r) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as pu, g as mp, a as yp } from "./index-
|
|
1
|
+
import { s as pu, g as mp, a as yp } from "./index-BXdspCS1.js";
|
|
2
2
|
import gu from "i18next";
|
|
3
3
|
var Ze = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
4
4
|
function _o(e) {
|
|
@@ -21308,7 +21308,7 @@ const py = (e) => py(), KE = (e) => {
|
|
|
21308
21308
|
const t = Uu(e, "bigint");
|
|
21309
21309
|
return hy(t);
|
|
21310
21310
|
}, VI = (e) => Zf(e), zc = (e, t) => t ? typeof t == "function" ? `Please <a href="#" onclick="${() => t()}">install</a> or enable to ${e} to continue` : `Please <a href="${t}" target="_blank">install</a> or enable to ${e} to continue` : `Please switch to ${e} to continue`, JE = async (e) => {
|
|
21311
|
-
const t = await import("./index-
|
|
21311
|
+
const t = await import("./index-Bpbr6WnZ.js"), { id: r, label: n, token: i, publicRpcUrl: o, blockExplorerUrl: a, rpcUrl: s } = e;
|
|
21312
21312
|
switch (r) {
|
|
21313
21313
|
case "0x89": {
|
|
21314
21314
|
const { polygon: l } = t;
|
|
@@ -21371,7 +21371,7 @@ const py = (e) => py(), KE = (e) => {
|
|
|
21371
21371
|
return l;
|
|
21372
21372
|
}
|
|
21373
21373
|
default: {
|
|
21374
|
-
const { extractChain: l, defineChain: u } = await import("./index-
|
|
21374
|
+
const { extractChain: l, defineChain: u } = await import("./index-BRZ2plvc.js"), f = l({
|
|
21375
21375
|
chains: Object.values(t),
|
|
21376
21376
|
id: Uu(r, "number")
|
|
21377
21377
|
});
|
|
@@ -24450,7 +24450,7 @@ const Ya = async (e, t) => {
|
|
|
24450
24450
|
const r = t.rpcUrl;
|
|
24451
24451
|
return !t.secondaryTokens || !t.secondaryTokens.length || !r ? [] : await Promise.all(t.secondaryTokens.map(async (i) => {
|
|
24452
24452
|
try {
|
|
24453
|
-
const { createPublicClient: o, http: a } = await import("./index-
|
|
24453
|
+
const { createPublicClient: o, http: a } = await import("./index-BRZ2plvc.js"), s = await JE(t), l = o({
|
|
24454
24454
|
chain: s,
|
|
24455
24455
|
transport: a(t.providerConnectionInfo && t.providerConnectionInfo.url ? t.providerConnectionInfo.url : r)
|
|
24456
24456
|
}), u = {
|
|
@@ -24493,7 +24493,7 @@ async function K9(e) {
|
|
|
24493
24493
|
const t = await E7(e.id);
|
|
24494
24494
|
if (!t)
|
|
24495
24495
|
return null;
|
|
24496
|
-
const { createPublicClient: r, http: n } = await import("./index-
|
|
24496
|
+
const { createPublicClient: r, http: n } = await import("./index-BRZ2plvc.js"), i = r({
|
|
24497
24497
|
chain: t,
|
|
24498
24498
|
transport: n()
|
|
24499
24499
|
});
|
|
@@ -29806,7 +29806,7 @@ function OA(e, t, r) {
|
|
|
29806
29806
|
bottomLeft: `
|
|
29807
29807
|
bottom: var(--${O}-position-bottom, 0);
|
|
29808
29808
|
left: var(--${O}-position-left, 0);`
|
|
29809
|
-
}), $ = u.enabled ? import("./Index-6c094240-
|
|
29809
|
+
}), $ = u.enabled ? import("./Index-6c094240-DXC18ikE.js").then((O) => O.default) : Promise.resolve(null), M = c.enabled ? import("./Index-64ac63ff-BrMgwosO.js").then((O) => O.default) : Promise.resolve(null), j = u.enabled && b && b.accountCenter, A = (O, I, P, S) => {
|
|
29810
29810
|
const T = O.attachShadow({ mode: "open" });
|
|
29811
29811
|
let R = document.querySelector("onboard-v2").shadowRoot.styleSheets;
|
|
29812
29812
|
const U = new CSSStyleSheet();
|
|
@@ -29952,7 +29952,7 @@ function $A(e) {
|
|
|
29952
29952
|
return Ms;
|
|
29953
29953
|
}
|
|
29954
29954
|
const kA = (e, t) => t || document.body && (getComputedStyle(document.body).getPropertyValue("--onboard-font-family-normal") || getComputedStyle(document.body).getPropertyValue("--w3o-font-family")) ? !0 : e ? !!(typeof e == "object" && e["--w3o-font-family"]) : !1, RA = async () => {
|
|
29955
|
-
const { InterVar: e } = await import("./index-
|
|
29955
|
+
const { InterVar: e } = await import("./index-mpserFHa.js"), t = document.createElement("style");
|
|
29956
29956
|
t.innerHTML = `
|
|
29957
29957
|
${e}
|
|
29958
29958
|
`, document.body.appendChild(t);
|
|
@@ -31962,7 +31962,7 @@ function yI() {
|
|
|
31962
31962
|
label: "Frontier",
|
|
31963
31963
|
getIcon: async () => (await import("./icon-C_O4nprO.js")).default,
|
|
31964
31964
|
getInterface: async () => {
|
|
31965
|
-
const { createEIP1193Provider: e } = await import("./index-
|
|
31965
|
+
const { createEIP1193Provider: e } = await import("./index-mpserFHa.js"), t = window.hasOwnProperty("ethereum");
|
|
31966
31966
|
let r;
|
|
31967
31967
|
if (t && window.ethereum.isFrontier)
|
|
31968
31968
|
r = e(window.ethereum);
|
|
@@ -32223,7 +32223,7 @@ function AI({ supportedWalletType: e = "all", darkMode: t = !1, enableMobileWall
|
|
|
32223
32223
|
getIcon: async () => (await import("./icon-DbgmZCnU.js")).default,
|
|
32224
32224
|
getInterface: async ({ chains: i, appMetadata: o }) => {
|
|
32225
32225
|
(r || n || t) && console.warn("darkMode, enableMobileWalletLink and reloadOnDisconnect init props are deprecated after version 2.2.7 of @web3-onboard/coinbase");
|
|
32226
|
-
const { name: a, icon: s } = o || {}, { default: l } = await import("./index-
|
|
32226
|
+
const { name: a, icon: s } = o || {}, { default: l } = await import("./index-Cqd2rvl1.js").then(($) => $.i), u = l.default ? l.default : l, { isHex: f, toHex: c, createEIP1193Provider: h, fromHex: d } = await import("./index-mpserFHa.js"), g = `data:image/svg+xml;base64,${window.btoa(s || "")}`, b = i.map(({ id: $ }) => d($, "number")), m = new u({
|
|
32227
32227
|
appName: a || "",
|
|
32228
32228
|
appLogoUrl: g,
|
|
32229
32229
|
appChainIds: b
|
|
@@ -32258,7 +32258,7 @@ function CI(e) {
|
|
|
32258
32258
|
label: "Safe",
|
|
32259
32259
|
getIcon: async () => (await import("./icon-2Zqy7pqQ.js")).default,
|
|
32260
32260
|
getInterface: async () => {
|
|
32261
|
-
const { default: n } = await import("./index-
|
|
32261
|
+
const { default: n } = await import("./index-Be91u-op.js"), { SafeAppProvider: i } = await import("./index-DwdV0Emj.js").then((h) => h.i), { createEIP1193Provider: o } = await import("./index-mpserFHa.js"), a = (
|
|
32262
32262
|
// @ts-ignore
|
|
32263
32263
|
n.default || n
|
|
32264
32264
|
), s = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as O, s as Z, t as Ne, n as j, p as he, b as ys, a as gs, i as Re, c as Bt, d as Q, h as Ue, e as At, I as ms, f as ft, g as ws, j as pr, k as vs, l as lt, m as Cn, o as ye, q as qe } from "./Web3Auth-
|
|
2
|
-
import { v as lc, w as dc, x as pc, S as bc, y as hc, z as yc, r as gc, C as mc, D as wc, u as vc, E as Ec, F as xc, A as Pc, G as Bc, H as Ac } from "./Web3Auth-
|
|
3
|
-
import { k as W, c as ee, i as te, I as ve, s as xt, a as br, b as Es, d as xs, e as Ps, p as an, f as ge, E as mt, F as Ht, g as jn, N as Fn, h as qn, j as Mn, l as zn, m as Ln, n as _n, T as Dn, o as Gt, U as cn, q as Bs, r as hr, t as As, u as Ts, v as Is, w as Os, x as Ss, y as yr, P as ks, z as Ee, C as Ut, A as gr, B as mr, D as Ns, G as wr, H as Rs, J as $s, K as Cs, L as js, M as Hn, O as Fs, Q as qs, R as Ms, S as zs, W as Gn } from "./number-
|
|
4
|
-
import { X as Ic, Y as Oc, Z as Sc, _ as kc, a6 as Nc, a7 as Rc, a8 as $c, a9 as Cc, ab as jc, $ as Fc, ac as qc, a0 as Mc, a2 as zc, a3 as Lc, V as _c, a4 as Dc, ae as Hc, af as Gc, ad as Uc, ag as Vc, aa as Zc, a5 as Wc, a1 as Yc } from "./number-
|
|
1
|
+
import { B as O, s as Z, t as Ne, n as j, p as he, b as ys, a as gs, i as Re, c as Bt, d as Q, h as Ue, e as At, I as ms, f as ft, g as ws, j as pr, k as vs, l as lt, m as Cn, o as ye, q as qe } from "./Web3Auth-DhI1eSsQ.js";
|
|
2
|
+
import { v as lc, w as dc, x as pc, S as bc, y as hc, z as yc, r as gc, C as mc, D as wc, u as vc, E as Ec, F as xc, A as Pc, G as Bc, H as Ac } from "./Web3Auth-DhI1eSsQ.js";
|
|
3
|
+
import { k as W, c as ee, i as te, I as ve, s as xt, a as br, b as Es, d as xs, e as Ps, p as an, f as ge, E as mt, F as Ht, g as jn, N as Fn, h as qn, j as Mn, l as zn, m as Ln, n as _n, T as Dn, o as Gt, U as cn, q as Bs, r as hr, t as As, u as Ts, v as Is, w as Os, x as Ss, y as yr, P as ks, z as Ee, C as Ut, A as gr, B as mr, D as Ns, G as wr, H as Rs, J as $s, K as Cs, L as js, M as Hn, O as Fs, Q as qs, R as Ms, S as zs, W as Gn } from "./number-DAtvFp1_.js";
|
|
4
|
+
import { X as Ic, Y as Oc, Z as Sc, _ as kc, a6 as Nc, a7 as Rc, a8 as $c, a9 as Cc, ab as jc, $ as Fc, ac as qc, a0 as Mc, a2 as zc, a3 as Lc, V as _c, a4 as Dc, ae as Hc, af as Gc, ad as Uc, ag as Vc, aa as Zc, a5 as Wc, a1 as Yc } from "./number-DAtvFp1_.js";
|
|
5
5
|
function Ls(e, t) {
|
|
6
6
|
const n = e.exec(t);
|
|
7
7
|
return n == null ? void 0 : n.groups;
|
|
@@ -1112,12 +1112,10 @@ function Yn(t) {
|
|
|
1112
1112
|
}
|
|
1113
1113
|
function Xe(t, e) {
|
|
1114
1114
|
return fetch(
|
|
1115
|
-
`${I.casdoor}/api/get-application?id=${t}/${encodeURIComponent(
|
|
1116
|
-
e
|
|
1117
|
-
)}`,
|
|
1115
|
+
`${I.casdoor}/api/get-application?id=${t}/${encodeURIComponent(e)}`,
|
|
1118
1116
|
{
|
|
1119
1117
|
method: "GET",
|
|
1120
|
-
credentials: "include",
|
|
1118
|
+
// credentials: "include",
|
|
1121
1119
|
headers: {
|
|
1122
1120
|
"Accept-Language": Z()
|
|
1123
1121
|
}
|
|
@@ -1610,7 +1608,7 @@ function Dt(t, e, o, r, a = "", l, u, g, c = "") {
|
|
|
1610
1608
|
const f = new FormData();
|
|
1611
1609
|
return f.append("captchaType", t), f.append("captchaToken", e), f.append("clientSecret", o), f.append("method", r), f.append("countryCode", a), f.append("dest", l), f.append("type", u), f.append("applicationId", "admin/" + g), f.append("checkUser", c), console.log(Object.fromEntries(f.entries())), fetch(`${I.casdoor}/api/send-verification-code`, {
|
|
1612
1610
|
method: "POST",
|
|
1613
|
-
credentials: "include",
|
|
1611
|
+
// credentials: "include",
|
|
1614
1612
|
body: f,
|
|
1615
1613
|
headers: {
|
|
1616
1614
|
"Accept-Language": Z()
|
|
@@ -3005,10 +3003,10 @@ function Qe(t, e) {
|
|
|
3005
3003
|
});
|
|
3006
3004
|
}
|
|
3007
3005
|
function Bt(t, e, o) {
|
|
3008
|
-
e.type === "MetaMask" ? import("./Web3Auth-
|
|
3006
|
+
e.type === "MetaMask" ? import("./Web3Auth-DhI1eSsQ.js").then((r) => r.bO).then((r) => {
|
|
3009
3007
|
const a = r.authViaMetaMask;
|
|
3010
3008
|
a(t, e, o);
|
|
3011
|
-
}) : e.type === "Web3Onboard" && import("./Web3Auth-
|
|
3009
|
+
}) : e.type === "Web3Onboard" && import("./Web3Auth-DhI1eSsQ.js").then((r) => r.bO).then((r) => {
|
|
3012
3010
|
const a = r.authViaWeb3Onboard;
|
|
3013
3011
|
a(t, e, o);
|
|
3014
3012
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as y, h as T, a as k } from "./hashMessage-
|
|
1
|
+
import { e as y, h as T, a as k } from "./hashMessage-BQXVpTYE.js";
|
|
2
2
|
const I = () => "9.1.0", q = (t) => t.toString(16).padStart(2, "0"), v = (t) => {
|
|
3
3
|
const e = new Uint8Array(t / 2);
|
|
4
4
|
return window.crypto.getRandomValues(e), Array.from(e, q).join("");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ac as e, $ as G, D as J, a0 as V, a2 as ee, af as X, a as q, a5 as Z, i as k, I as E, a3 as te, ae as de, ah as me, X as ae, F as ue, o as be, V as he, z as ke, ad as xe } from "./number-
|
|
2
|
-
import { h as i, q as o, e as W, B as u, f as fe, g as R, t as K, G as ye } from "./Web3Auth-
|
|
1
|
+
import { ac as e, $ as G, D as J, a0 as V, a2 as ee, af as X, a as q, a5 as Z, i as k, I as E, a3 as te, ae as de, ah as me, X as ae, F as ue, o as be, V as he, z as ke, ad as xe } from "./number-DAtvFp1_.js";
|
|
2
|
+
import { h as i, q as o, e as W, B as u, f as fe, g as R, t as K, G as ye } from "./Web3Auth-DhI1eSsQ.js";
|
|
3
3
|
const et = /* @__PURE__ */ e({
|
|
4
4
|
id: 787,
|
|
5
5
|
name: "Acala",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bH as Xi, bI as qt, bJ as es, bK as Z, bL as de, bM as Wn, bN as Sa } from "./Web3Auth-
|
|
1
|
+
import { bH as Xi, bI as qt, bJ as es, bK as Z, bL as de, bM as Wn, bN as Sa } from "./Web3Auth-DhI1eSsQ.js";
|
|
2
2
|
var ts = {}, gt = {}, Kt = {};
|
|
3
3
|
Object.defineProperty(Kt, "__esModule", { value: !0 });
|
|
4
4
|
Kt.walletLogo = void 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bK as V, bM as Jc, bH as Xc } from "./Web3Auth-
|
|
2
|
-
import { b as nt, c as go, i as wo, d as vo, B as _, g as rt, A as as, f as st, t as Jt, k as se, j as le, l as at, n as C, m as H, o as rr, p as q, q as Pe, I as xo, r as G, s as te, u as Ce, v as sn, w as Is, x as Po, y as Eo, z as sr, C as Io, D as Ye, E as Xt, F as Ts, G as Z, H as O, J as N, K as we, L as ae, M as oe, N as Ra, O as To, P as Ur, Q as jn, R as _o, S as Qc, T as So, U as ve, e as Te, V as Ao, W as _s, X as an, Y as xt, Z as Qt, _ as Ss, $ as As, a0 as en, a1 as Bs, a2 as ar, a3 as wt, a4 as or, a5 as Bo, a6 as os, a7 as Co, a8 as ko, a9 as Kt, aa as Mo, ab as eu, ac as tu, ad as $o, ae as nu, af as Ro, ag as Ee, ah as No, ai as An, h as ir, a as Cs, aj as ks, ak as is, al as ru, am as su, an as au, ao as ou, ap as Oo, aq as Fo, ar as Lo, as as jo, at as iu, au as cu, av as uu, aw as du, ax as lu, ay as fu, az as pu, aA as hu, aB as mu, aC as yu, aD as bu, aE as gu, aF as wu, aG as vu, aH as xu, aI as Pu, aJ as Eu, aK as Iu, aL as Bn, aM as Tu, aN as _u, aO as Su, aP as Au, aQ as Bu, aR as Cu, aS as ku, aT as Na, aU as Mu, aV as $u } from "./hashMessage-
|
|
1
|
+
import { bK as V, bM as Jc, bH as Xc } from "./Web3Auth-DhI1eSsQ.js";
|
|
2
|
+
import { b as nt, c as go, i as wo, d as vo, B as _, g as rt, A as as, f as st, t as Jt, k as se, j as le, l as at, n as C, m as H, o as rr, p as q, q as Pe, I as xo, r as G, s as te, u as Ce, v as sn, w as Is, x as Po, y as Eo, z as sr, C as Io, D as Ye, E as Xt, F as Ts, G as Z, H as O, J as N, K as we, L as ae, M as oe, N as Ra, O as To, P as Ur, Q as jn, R as _o, S as Qc, T as So, U as ve, e as Te, V as Ao, W as _s, X as an, Y as xt, Z as Qt, _ as Ss, $ as As, a0 as en, a1 as Bs, a2 as ar, a3 as wt, a4 as or, a5 as Bo, a6 as os, a7 as Co, a8 as ko, a9 as Kt, aa as Mo, ab as eu, ac as tu, ad as $o, ae as nu, af as Ro, ag as Ee, ah as No, ai as An, h as ir, a as Cs, aj as ks, ak as is, al as ru, am as su, an as au, ao as ou, ap as Oo, aq as Fo, ar as Lo, as as jo, at as iu, au as cu, av as uu, aw as du, ax as lu, ay as fu, az as pu, aA as hu, aB as mu, aC as yu, aD as bu, aE as gu, aF as wu, aG as vu, aH as xu, aI as Pu, aJ as Eu, aK as Iu, aL as Bn, aM as Tu, aN as _u, aO as Su, aP as Au, aQ as Bu, aR as Cu, aS as ku, aT as Na, aU as Mu, aV as $u } from "./hashMessage-BQXVpTYE.js";
|
|
3
3
|
function Ru(e, t) {
|
|
4
4
|
for (var n = 0; n < t.length; n++) {
|
|
5
5
|
const r = t[n];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bw as o, b2 as r, bs as t, bC as i, bE as n, bF as f, bG as b, bB as d, bx as c, D as l, bA as m, i as p, q as h, bD as w, by as x, bz as I } from "./Web3Auth-
|
|
1
|
+
import { bw as o, b2 as r, bs as t, bC as i, bE as n, bF as f, bG as b, bB as d, bx as c, D as l, bA as m, i as p, q as h, bD as w, by as x, bz as I } from "./Web3Auth-DhI1eSsQ.js";
|
|
2
2
|
const a = `
|
|
3
3
|
@font-face {
|
|
4
4
|
font-family: 'Inter';
|
package/dist/index.js
CHANGED
package/dist/index.umd.cjs
CHANGED
|
@@ -27,12 +27,12 @@ Check the top-level render call using <`+be+">.")}return ce}}function hi(U,ce){{
|
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,nt,It,bt,It),Xi[It+nt]=!0}}return U===r?Dn(tt):Ji(tt),tt}}function Z(U,ce,be){return N(U,ce,be,!0)}function V(U,ce,be){return N(U,ce,be,!1)}var P=V,X=Z;kd.Fragment=r,kd.jsx=P,kd.jsxs=X}()),kd}process.env.NODE_ENV==="production"?c3.exports=rU():c3.exports=iU();var _e=c3.exports;const Xe="https://cdn.casbin.org",ki={casdoor:"https://casdoor",springmicro:void 0};function oU(){return"en"}function xs(){return"en;q=0.9,en;q=0.8"}function ji(e,t){alert(t)}function l3(e){e!==void 0&&(window.location.href=e)}function J9(e){return!(e.provider===void 0||e.provider===null||!["OAuth","SAML","Web3"].includes(e.provider.category)||e.provider.type==="WeChatMiniProgram")}function sU(e){return J9(e)&&e.prompted}function aU(e){return e.visible&&e.prompted}function cU(e){var t;return(t=e.providers)==null?void 0:t.filter(n=>sU(n))}function lU(e){var t;return(t=e.signupItems)==null?void 0:t.filter(n=>aU(n))}function uU(e,t){var r;const n=(r=e.signupItems)==null?void 0:r.filter(i=>i.name===t);return(n==null?void 0:n.length)??!1?n[0]:null}function fU(e){const t=uU(e,"Affiliation");return t===null?!1:t.prompted}function X9(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function hh(e,t){return e&&e.signinMethods?e.signinMethods.filter(n=>n.name===t).length>0:!1}function dU(e){return hh(e,"Password")}function hU(e){return hh(e,"Verification code")}function pU(e){return hh(e,"WebAuthn")}function mU(e){return hh(e,"LDAP")}function gU(e){const t=cU(e);if((t==null?void 0:t.length)??!1)return!0;const n=lU(e);return(n==null?void 0:n.length)??!1?!0:fU(e)}function nl(e){if(e.type==="Custom"&&e.customLogo)return e.customLogo;if(e.category==="OAuth")return`${Xe}/img/social_${e.type.toLowerCase()}.png`;{const t=bU[e.category][e.type];return t?t.logo:""}}const bU={SMS:{"Aliyun SMS":{logo:`${Xe}/img/social_aliyun.png`,url:"https://aliyun.com/product/sms"},"Amazon SNS":{logo:`${Xe}/img/social_aws.png`,url:"https://aws.amazon.com/cn/sns/"},"Azure ACS":{logo:`${Xe}/img/social_azure.png`,url:"https://azure.microsoft.com/en-us/products/communication-services"},"Infobip SMS":{logo:`${Xe}/img/social_infobip.png`,url:"https://portal.infobip.com/homepage/"},"Tencent Cloud SMS":{logo:`${Xe}/img/social_tencent_cloud.jpg`,url:"https://cloud.tencent.com/product/sms"},"Baidu Cloud SMS":{logo:`${Xe}/img/social_baidu_cloud.png`,url:"https://cloud.baidu.com/product/sms.html"},"Volc Engine SMS":{logo:`${Xe}/img/social_volc_engine.jpg`,url:"https://www.volcengine.com/products/cloud-sms"},"Huawei Cloud SMS":{logo:`${Xe}/img/social_huawei.png`,url:"https://www.huaweicloud.com/product/msgsms.html"},"UCloud SMS":{logo:`${Xe}/img/social_ucloud.png`,url:"https://www.ucloud.cn/site/product/usms.html"},"Twilio SMS":{logo:`${Xe}/img/social_twilio.svg`,url:"https://www.twilio.com/messaging"},"SmsBao SMS":{logo:`${Xe}/img/social_smsbao.png`,url:"https://www.smsbao.com/"},"SUBMAIL SMS":{logo:`${Xe}/img/social_submail.svg`,url:"https://www.mysubmail.com"},"Msg91 SMS":{logo:`${Xe}/img/social_msg91.ico`,url:"https://control.msg91.com/app/"},"OSON SMS":{logo:"https://osonsms.com/images/osonsms-logo.svg",url:"https://osonsms.com/"},"Custom HTTP SMS":{logo:`${Xe}/img/social_default.png`,url:"https://casdoor.org/docs/provider/sms/overview"},"Mock SMS":{logo:`${Xe}/img/social_default.png`,url:""}},Email:{Default:{logo:`${Xe}/img/email_default.png`,url:""},SUBMAIL:{logo:`${Xe}/img/social_submail.svg`,url:"https://www.mysubmail.com"},Mailtrap:{logo:`${Xe}/img/email_mailtrap.png`,url:"https://mailtrap.io"},"Azure ACS":{logo:`${Xe}/img/social_azure.png`,url:"https://learn.microsoft.com/zh-cn/azure/communication-services"},SendGrid:{logo:`${Xe}/img/email_sendgrid.png`,url:"https://sendgrid.com/"},"Custom HTTP Email":{logo:`${Xe}/img/social_default.png`,url:"https://casdoor.org/docs/provider/email/overview"}},Storage:{"Local File System":{logo:`${Xe}/img/social_file.png`,url:""},"AWS S3":{logo:`${Xe}/img/social_aws.png`,url:"https://aws.amazon.com/s3"},MinIO:{logo:"https://min.io/resources/img/logo.svg",url:"https://min.io/"},"Aliyun OSS":{logo:`${Xe}/img/social_aliyun.png`,url:"https://aliyun.com/product/oss"},"Tencent Cloud COS":{logo:`${Xe}/img/social_tencent_cloud.jpg`,url:"https://cloud.tencent.com/product/cos"},"Azure Blob":{logo:`${Xe}/img/social_azure.png`,url:"https://azure.microsoft.com/en-us/services/storage/blobs/"},"Qiniu Cloud Kodo":{logo:`${Xe}/img/social_qiniu_cloud.png`,url:"https://www.qiniu.com/solutions/storage"},"Google Cloud Storage":{logo:`${Xe}/img/social_google_cloud.png`,url:"https://cloud.google.com/storage"},Synology:{logo:`${Xe}/img/social_synology.png`,url:"https://www.synology.com/en-global/dsm/feature/file_sharing"}},SAML:{"Aliyun IDaaS":{logo:`${Xe}/img/social_aliyun.png`,url:"https://aliyun.com/product/idaas"},Keycloak:{logo:`${Xe}/img/social_keycloak.png`,url:"https://www.keycloak.org/"},Custom:{logo:`${Xe}/img/social_custom.png`,url:"https://door.casdoor.com/"}},Payment:{Dummy:{logo:`${Xe}/img/payment_paypal.png`,url:""},Alipay:{logo:`${Xe}/img/payment_alipay.png`,url:"https://www.alipay.com/"},"WeChat Pay":{logo:`${Xe}/img/payment_wechat_pay.png`,url:"https://pay.weixin.qq.com/"},PayPal:{logo:`${Xe}/img/payment_paypal.png`,url:"https://www.paypal.com/"},Stripe:{logo:`${Xe}/img/social_stripe.png`,url:"https://stripe.com/"},GC:{logo:`${Xe}/img/payment_gc.png`,url:"https://gc.org"}},Captcha:{Default:{logo:`${Xe}/img/captcha_default.png`,url:"https://pkg.go.dev/github.com/dchest/captcha"},reCAPTCHA:{logo:`${Xe}/img/social_recaptcha.png`,url:"https://www.google.com/recaptcha"},hCaptcha:{logo:`${Xe}/img/social_hcaptcha.png`,url:"https://www.hcaptcha.com"},"Aliyun Captcha":{logo:`${Xe}/img/social_aliyun.png`,url:"https://help.aliyun.com/product/28308.html"},GEETEST:{logo:`${Xe}/img/social_geetest.png`,url:"https://www.geetest.com"},"Cloudflare Turnstile":{logo:`${Xe}/img/social_cloudflare.png`,url:"https://www.cloudflare.com/products/turnstile/"}},AI:{"OpenAI API - GPT":{logo:`${Xe}/img/social_openai.svg`,url:"https://platform.openai.com"}},Web3:{MetaMask:{logo:`${Xe}/img/social_metamask.svg`,url:"https://metamask.io/"},Web3Onboard:{logo:`${Xe}/img/social_web3onboard.svg`,url:"https://onboard.blocknative.com/"}},Notification:{Telegram:{logo:`${Xe}/img/social_telegram.png`,url:"https://telegram.org/"},"Custom HTTP":{logo:`${Xe}/img/email_default.png`,url:"https://casdoor.org/docs/provider/notification/overview"},DingTalk:{logo:`${Xe}/img/social_dingtalk.png`,url:"https://www.dingtalk.com/"},Lark:{logo:`${Xe}/img/social_lark.png`,url:"https://www.larksuite.com/"},"Microsoft Teams":{logo:`${Xe}/img/social_teams.png`,url:"https://www.microsoft.com/microsoft-teams"},Bark:{logo:`${Xe}/img/social_bark.png`,url:"https://apps.apple.com/us/app/bark-customed-notifications/id1403753865"},Pushover:{logo:`${Xe}/img/social_pushover.png`,url:"https://pushover.net/"},Pushbullet:{logo:`${Xe}/img/social_pushbullet.png`,url:"https://www.pushbullet.com/"},Slack:{logo:`${Xe}/img/social_slack.png`,url:"https://slack.com/"},Webpush:{logo:`${Xe}/img/email_default.png`,url:"https://developer.mozilla.org/en-US/docs/Web/API/Push_API"},Discord:{logo:`${Xe}/img/social_discord.png`,url:"https://discord.com/"},"Google Chat":{logo:`${Xe}/img/social_google_chat.png`,url:"https://workspace.google.com/intl/en/products/chat/"},Line:{logo:`${Xe}/img/social_line.png`,url:"https://line.me/"},Matrix:{logo:`${Xe}/img/social_matrix.png`,url:"https://www.matrix.org/"},Twitter:{logo:`${Xe}/img/social_twitter.png`,url:"https://twitter.com/"},Reddit:{logo:`${Xe}/img/social_reddit.png`,url:"https://www.reddit.com/"},"Rocket Chat":{logo:`${Xe}/img/social_rocket_chat.png`,url:"https://rocket.chat/"},Viber:{logo:`${Xe}/img/social_viber.png`,url:"https://www.viber.com/"}}};function yU(e=""){return fetch(`${ki.casdoor}/api/get-account${e}`,{method:"GET",credentials:"include",headers:{"Accept-Language":xs()}}).then(t=>t.json())}function wU(e){let t=`${ki.casdoor}/api/signup`;return ki.springmicro&&(t=`${ki.springmicro}/api/accounts/users/register`),fetch(t,{method:"POST",credentials:"include",body:JSON.stringify(e),headers:{"Accept-Language":xs(),"Content-Type":"application/json"}}).then(n=>n.json())}function vU(e){return`?type=${e==null?void 0:e.type}&id=${e==null?void 0:e.id}&redirectUri=${e==null?void 0:e.service}`}function EU(e){return e==null?"":`?clientId=${e.clientId}&responseType=${e.responseType}&redirectUri=${encodeURIComponent(e.redirectUri)}&type=${e.type}&scope=${e.scope}&state=${e.state}&nonce=${e.nonce}&code_challenge_method=${e.challengeMethod}&code_challenge=${e.codeChallenge}`}function ev(e){const t=(e==null?void 0:e.type)==="cas"?vU(e):EU(e);return fetch(`${ki.casdoor}/api/get-app-login${t}`,{method:"GET",credentials:"include",headers:{"Accept-Language":xs()}}).then(n=>n.json())}function xU(e,t){return fetch(`${ki.casdoor}/api/get-saml-login?id=${e}&relayState=${t}`,{method:"GET",credentials:"include",headers:{"Accept-Language":xs()}}).then(n=>n.json())}function _U(e){return fetch(`${ki.casdoor}/api/get-webhook-event?ticket=${e}`,{method:"GET",credentials:"include",headers:{"Accept-Language":xs()}}).then(t=>t.json())}function AU(e){return fetch(`${ki.casdoor}/api/get-qrcode?id=${e}`,{method:"GET",credentials:"include",headers:{"Accept-Language":xs()}}).then(t=>t.json())}function u3(e,t){return fetch(`${ki.casdoor}/api/get-application?id=${e}/${encodeURIComponent(t)}`,{method:"GET",credentials:"include",headers:{"Accept-Language":xs()}}).then(n=>n.json())}const rl={Google:{scope:"profile+email",endpoint:"https://accounts.google.com/signin/oauth"},GitHub:{scope:"user:email+read:user",endpoint:"https://github.com/login/oauth/authorize"},QQ:{scope:"get_user_info",endpoint:"https://graph.qq.com/oauth2.0/authorize"},WeChat:{scope:"snsapi_login",endpoint:"https://open.weixin.qq.com/connect/qrconnect",mpScope:"snsapi_userinfo",mpEndpoint:"https://open.weixin.qq.com/connect/oauth2/authorize"},WeChatMiniProgram:{endpoint:"https://mp.weixin.qq.com/"},Facebook:{scope:"email,public_profile",endpoint:"https://www.facebook.com/dialog/oauth"},DingTalk:{scope:"openid",endpoint:"https://login.dingtalk.com/oauth2/auth"},Weibo:{scope:"email",endpoint:"https://api.weibo.com/oauth2/authorize"},Gitee:{scope:"user_info%20emails",endpoint:"https://gitee.com/oauth/authorize"},LinkedIn:{scope:"r_liteprofile%20r_emailaddress",endpoint:"https://www.linkedin.com/oauth/v2/authorization"},WeCom:{scope:"snsapi_userinfo",endpoint:"https://open.work.weixin.qq.com/wwopen/sso/3rd_qrConnect",silentEndpoint:"https://open.weixin.qq.com/connect/oauth2/authorize",internalEndpoint:"https://open.work.weixin.qq.com/wwopen/sso/qrConnect"},Lark:{endpoint:"https://open.feishu.cn/open-apis/authen/v1/index"},GitLab:{scope:"read_user+profile",endpoint:"https://gitlab.com/oauth/authorize"},ADFS:{scope:"openid",endpoint:"http://example.com"},Baidu:{scope:"basic",endpoint:"http://openapi.baidu.com/oauth/2.0/authorize"},Alipay:{scope:"basic",endpoint:"https://openauth.alipay.com/oauth2/publicAppAuthorize.htm"},Casdoor:{scope:"openid%20profile%20email",endpoint:"http://example.com"},Infoflow:{endpoint:"https://xpc.im.baidu.com/oauth2/authorize"},Apple:{scope:"name%20email",endpoint:"https://appleid.apple.com/auth/authorize"},AzureAD:{scope:"user.read",endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize"},AzureADB2C:{scope:"openid",endpoint:"https://tenant.b2clogin.com/tenant.onmicrosoft.com/userflow/oauth2/v2.0/authorize"},Slack:{scope:"users:read",endpoint:"https://slack.com/oauth/authorize"},Steam:{endpoint:"https://steamcommunity.com/openid/login"},Okta:{scope:"openid%20profile%20email",endpoint:"http://example.com"},Douyin:{scope:"user_info",endpoint:"https://open.douyin.com/platform/oauth/connect"},Custom:{endpoint:"https://example.com/"},Bilibili:{endpoint:"https://passport.bilibili.com/register/pc_oauth2.html"},Line:{scope:"profile%20openid%20email",endpoint:"https://access.line.me/oauth2/v2.1/authorize"},Amazon:{scope:"profile",endpoint:"https://www.amazon.com/ap/oa"},Auth0:{scope:"openid%20profile%20email",endpoint:"http://auth0.com/authorize"},BattleNet:{scope:"openid",endpoint:"https://oauth.battlenet.com.cn/authorize"},Bitbucket:{scope:"account",endpoint:"https://bitbucket.org/site/oauth2/authorize"},Box:{scope:"root_readwrite",endpoint:"https://account.box.com/api/oauth2/authorize"},CloudFoundry:{scope:"cloud_controller.read",endpoint:"https://login.cloudfoundry.org/oauth/authorize"},Dailymotion:{scope:"userinfo",endpoint:"https://api.dailymotion.com/oauth/authorize"},Deezer:{scope:"basic_access",endpoint:"https://connect.deezer.com/oauth/auth.php"},DigitalOcean:{scope:"read",endpoint:"https://cloud.digitalocean.com/v1/oauth/authorize"},Discord:{scope:"identify%20email",endpoint:"https://discord.com/api/oauth2/authorize"},Dropbox:{scope:"account_info.read",endpoint:"https://www.dropbox.com/oauth2/authorize"},EveOnline:{scope:"publicData",endpoint:"https://login.eveonline.com/oauth/authorize"},Fitbit:{scope:"activity%20heartrate%20location%20nutrition%20profile%20settings%20sleep%20social%20weight",endpoint:"https://www.fitbit.com/oauth2/authorize"},Gitea:{scope:"user:email",endpoint:"https://gitea.com/login/oauth/authorize"},Heroku:{scope:"global",endpoint:"https://id.heroku.com/oauth/authorize"},InfluxCloud:{scope:"read:org",endpoint:"https://cloud2.influxdata.com/oauth/authorize"},Instagram:{scope:"user_profile",endpoint:"https://api.instagram.com/oauth/authorize"},Intercom:{scope:"user.read",endpoint:"https://app.intercom.com/oauth"},Kakao:{scope:"account_email",endpoint:"https://kauth.kakao.com/oauth/authorize"},Lastfm:{scope:"user_read",endpoint:"https://www.last.fm/api/auth"},Mailru:{scope:"userinfo",endpoint:"https://oauth.mail.ru/login"},Meetup:{scope:"basic",endpoint:"https://secure.meetup.com/oauth2/authorize"},MicrosoftOnline:{scope:"openid%20profile%20email",endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize"},Naver:{scope:"profile",endpoint:"https://nid.naver.com/oauth2.0/authorize"},Nextcloud:{scope:"openid%20profile%20email",endpoint:"https://cloud.example.org/apps/oauth2/authorize"},OneDrive:{scope:"offline_access%20onedrive.readonly",endpoint:"https://login.live.com/oauth20_authorize.srf"},Oura:{scope:"personal",endpoint:"https://cloud.ouraring.com/oauth/authorize"},Patreon:{scope:"identity",endpoint:"https://www.patreon.com/oauth2/authorize"},PayPal:{scope:"openid%20profile%20email",endpoint:"https://www.sandbox.paypal.com/connect"},SalesForce:{scope:"openid%20profile%20email",endpoint:"https://login.salesforce.com/services/oauth2/authorize"},Shopify:{scope:"read_products",endpoint:"https://myshopify.com/admin/oauth/authorize"},Soundcloud:{scope:"non-expiring",endpoint:"https://api.soundcloud.com/connect"},Spotify:{scope:"user-read-email",endpoint:"https://accounts.spotify.com/authorize"},Strava:{scope:"read",endpoint:"https://www.strava.com/oauth/authorize"},Stripe:{scope:"read_only",endpoint:"https://connect.stripe.com/oauth/authorize"},TikTok:{scope:"user.info.basic",endpoint:"https://www.tiktok.com/auth/authorize/"},Tumblr:{scope:"email",endpoint:"https://www.tumblr.com/oauth2/authorize"},Twitch:{scope:"user_read",endpoint:"https://id.twitch.tv/oauth2/authorize"},Twitter:{scope:"users.read%20tweet.read",endpoint:"https://twitter.com/i/oauth2/authorize"},Typetalk:{scope:"my",endpoint:"https://typetalk.com/oauth2/authorize"},Uber:{scope:"profile",endpoint:"https://login.uber.com/oauth/v2/authorize"},VK:{scope:"email",endpoint:"https://oauth.vk.com/authorize"},Wepay:{scope:"manage_accounts%20view_user",endpoint:"https://www.wepay.com/v2/oauth2/authorize"},Xero:{scope:"openid%20profile%20email",endpoint:"https://login.xero.com/identity/connect/authorize"},Yahoo:{scope:"openid%20profile%20email",endpoint:"https://api.login.yahoo.com/oauth2/request_auth"},Yammer:{scope:"user",endpoint:"https://www.yammer.com/oauth2/authorize"},Yandex:{scope:"login:email",endpoint:"https://oauth.yandex.com/authorize"},Zoom:{scope:"user:read",endpoint:"https://zoom.us/oauth/authorize"},MetaMask:{scope:"",endpoint:""},Web3Onboard:{scope:"",endpoint:""}};function f3(e,t,n,r){if(e===null||t===null)return"";let i=rl[t.type].endpoint,o=`${window.location.origin}/callback`;const s=rl[t.type].scope,a=t.type==="WeChat"&&navigator.userAgent.includes("MicroMessenger")||t.type==="Twitter",c=CU(e.name,t.name,n,a),l="P3S-a7dr8bgM4bF6vOyiKkKETDl16rcAzao9F8UIL1Y";if(t.type==="AzureAD"?t.domain!==""&&(i=i.replace("common",t.domain)):t.type==="Apple"&&(o=`${window.location.origin}/api/callback`),t.type==="Google"||t.type==="GitHub"||t.type==="QQ"||t.type==="Facebook"||t.type==="Weibo"||t.type==="Gitee"||t.type==="LinkedIn"||t.type==="GitLab"||t.type==="AzureAD"||t.type==="Slack"||t.type==="Line"||t.type==="Amazon"||t.type==="Auth0"||t.type==="BattleNet"||t.type==="Bitbucket"||t.type==="Box"||t.type==="CloudFoundry"||t.type==="Dailymotion"||t.type==="DigitalOcean"||t.type==="Discord"||t.type==="Dropbox"||t.type==="EveOnline"||t.type==="Gitea"||t.type==="Heroku"||t.type==="InfluxCloud"||t.type==="Instagram"||t.type==="Intercom"||t.type==="Kakao"||t.type==="MailRu"||t.type==="Meetup"||t.type==="MicrosoftOnline"||t.type==="Naver"||t.type==="Nextcloud"||t.type==="OneDrive"||t.type==="Oura"||t.type==="Patreon"||t.type==="PayPal"||t.type==="SalesForce"||t.type==="SoundCloud"||t.type==="Spotify"||t.type==="Strava"||t.type==="Stripe"||t.type==="Tumblr"||t.type==="Twitch"||t.type==="Typetalk"||t.type==="Uber"||t.type==="VK"||t.type==="Wepay"||t.type==="Xero"||t.type==="Yahoo"||t.type==="Yammer"||t.type==="Yandex"||t.type==="Zoom")return`${i}?client_id=${t.clientId}&redirect_uri=${o}&scope=${s}&response_type=code&state=${c}`;if(t.type==="AzureADB2C")return`https://${t.domain}.b2clogin.com/${t.domain}.onmicrosoft.com/${t.appId}/oauth2/v2.0/authorize?client_id=${t.clientId}&nonce=defaultNonce&redirect_uri=${encodeURIComponent(o)}&scope=${s}&response_type=code&state=${c}&prompt=login`;if(t.type==="DingTalk")return`${i}?client_id=${t.clientId}&redirect_uri=${o}&scope=${s}&response_type=code&prompt=consent&state=${c}`;if(t.type==="WeChat")return navigator.userAgent.includes("MicroMessenger")?`${rl[t.type].mpEndpoint}?appid=${t.clientId2}&redirect_uri=${o}&state=${c}&scope=${rl[t.type].mpScope}&response_type=code#wechat_redirect`:t.clientId2&&(t!=null&&t.disableSsl)&&(t==null?void 0:t.signName)==="media"?`${window.location.origin}/callback?state=${c}&code=${"wechat_oa:"+r}`:`${i}?appid=${t.clientId}&redirect_uri=${o}&scope=${s}&response_type=code&state=${c}#wechat_redirect`;if(t.type==="WeCom")return t.subType==="Internal"?t.method==="Silent"?(i=rl[t.type].silentEndpoint,`${i}?appid=${t.clientId}&redirect_uri=${o}&state=${c}&scope=${s}&response_type=code#wechat_redirect`):t.method==="Normal"?(i=rl[t.type].internalEndpoint,`${i}?appid=${t.clientId}&agentid=${t.appId}&redirect_uri=${o}&state=${c}&usertype=member`):`https://error:not-supported-provider-method:${t.method}`:t.subType==="Third-party"?t.method==="Silent"?(i=rl[t.type].silentEndpoint,`${i}?appid=${t.clientId}&redirect_uri=${o}&state=${c}&scope=${s}&response_type=code#wechat_redirect`):t.method==="Normal"?`${i}?appid=${t.clientId}&redirect_uri=${o}&state=${c}&usertype=member`:`https://error:not-supported-provider-method:${t.method}`:`https://error:not-supported-provider-sub-type:${t.subType}`;if(t.type==="Lark")return`${i}?app_id=${t.clientId}&redirect_uri=${o}&state=${c}`;if(t.type==="ADFS")return`${t.domain}/adfs/oauth2/authorize?client_id=${t.clientId}&redirect_uri=${o}&state=${c}&response_type=code&nonce=casdoor&scope=openid`;if(t.type==="Baidu")return`${i}?client_id=${t.clientId}&redirect_uri=${o}&state=${c}&response_type=code&scope=${s}&display=popup`;if(t.type==="Alipay")return`${i}?app_id=${t.clientId}&scope=auth_user&redirect_uri=${o}&state=${c}&response_type=code&scope=${s}&display=popup`;if(t.type==="Casdoor")return`${t.domain}/login/oauth/authorize?client_id=${t.clientId}&redirect_uri=${o}&state=${c}&response_type=code&scope=${s}`;if(t.type==="Infoflow")return`${i}?appid=${t.clientId}&redirect_uri=${o}?state=${c}`;if(t.type==="Apple")return`${i}?client_id=${t.clientId}&redirect_uri=${o}&state=${c}&response_type=code%20id_token&scope=${s}&response_mode=form_post`;if(t.type==="Steam")return`${i}?openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&openid.mode=checkid_setup&openid.ns=http://specs.openid.net/auth/2.0&openid.realm=${window.location.origin}&openid.return_to=${o}?state=${c}`;if(t.type==="Okta")return`${t.domain}/v1/authorize?client_id=${t.clientId}&redirect_uri=${o}&state=${c}&response_type=code&scope=${s}`;if(t.type==="Douyin"||t.type==="TikTok")return`${i}?client_key=${t.clientId}&redirect_uri=${o}&state=${c}&response_type=code&scope=${s}`;if(t.type==="Custom")return`${t.customAuthUrl}?client_id=${t.clientId}&redirect_uri=${o}&scope=${t.scopes}&response_type=code&state=${c}`;if(t.type==="Bilibili")return`${i}#/?client_id=${t.clientId}&return_url=${o}&state=${c}&response_type=code`;if(t.type==="Deezer")return`${i}?app_id=${t.clientId}&redirect_uri=${o}&perms=${s}`;if(t.type==="Lastfm")return`${i}?api_key=${t.clientId}&cb=${o}`;if(t.type==="Shopify")return`${i}?client_id=${t.clientId}&redirect_uri=${o}&scope=${s}&state=${c}&grant_options[]=per-user`;if(t.type==="Twitter"||t.type==="Fitbit")return`${i}?client_id=${t.clientId}&redirect_uri=${o}&state=${c}&response_type=code&scope=${s}&code_challenge=${l}&code_challenge_method=S256`;if(t.type==="MetaMask")return`${o}?state=${c}`;if(t.type==="Web3Onboard")return`${o}?state=${c}`}function Xo(e){return e??""}function d3(e){const n=window.location.href.split(`${e}=`)[1];if(!n)return"";let r=n.split("&")[0];return r?(r=decodeURIComponent(r),r):""}function tv(e){const t=new URLSearchParams(window.location.search),n=Xo(t.get("client_id")),r=Xo(t.get("response_type"));let i=d3("redirect_uri");i===""&&(i=Xo(t.get("redirect_uri")));let o=Xo(t.get("scope"));i.includes("#")&&o===""&&(o=d3("scope"));let s=Xo(t.get("state"));s.startsWith("/auth/oauth2/login.php?wantsurl=")&&(s=encodeURIComponent(s)),i.includes("#")&&s===""&&(s=d3("state"));const a=Xo(t.get("nonce")),c=Xo(t.get("code_challenge_method")),l=Xo(t.get("code_challenge")),f=Xo(t.get("SAMLRequest")),u=Xo(t.get("RelayState")),d=Xo(t.get("noRedirect"));return n===""&&f===""?null:{clientId:n,responseType:r,redirectUri:i,scope:o,state:s,nonce:a,challengeMethod:c,codeChallenge:l,samlRequest:f,relayState:u,noRedirect:d,type:"code"}}function CU(e,t,n,r){let i=window.location.search;if(i=`${i}&application=${encodeURIComponent(e)}&provider=${encodeURIComponent(t)}&method=${n}`,n==="link"&&(i=`${i}&from=${window.location.pathname}`),r){const o=t;return sessionStorage.setItem(o,i),o}else return btoa(i)}function SU(e,t,n,r){_U(n).then(i=>{if(i.data==="SCAN"||i.data==="subscribe"){const o=i==null?void 0:i.data2;l3(f3(e,t,r??"signup",o))}})}async function kU(e,t,n){document.addEventListener("click",function(i){const o=document.getElementById("WechatOfficialAccountModal");o&&i.target===o&&o.close()});function r(i,o){function s(){const f=document.getElementById("WechatOfficialAccountModal");f&&f.showModal()}function a(){window.clearInterval(o);const f=document.getElementById("WechatOfficialAccountModal");f&&f.close()}window.closeDialog=a;const c=`
|
|
30
|
+
<%s key={someKey} {...props} />`,nt,It,bt,It),Xi[It+nt]=!0}}return U===r?Dn(tt):Ji(tt),tt}}function Z(U,ce,be){return N(U,ce,be,!0)}function V(U,ce,be){return N(U,ce,be,!1)}var P=V,X=Z;kd.Fragment=r,kd.jsx=P,kd.jsxs=X}()),kd}process.env.NODE_ENV==="production"?c3.exports=rU():c3.exports=iU();var _e=c3.exports;const Xe="https://cdn.casbin.org",ki={casdoor:"https://casdoor",springmicro:void 0};function oU(){return"en"}function xs(){return"en;q=0.9,en;q=0.8"}function ji(e,t){alert(t)}function l3(e){e!==void 0&&(window.location.href=e)}function J9(e){return!(e.provider===void 0||e.provider===null||!["OAuth","SAML","Web3"].includes(e.provider.category)||e.provider.type==="WeChatMiniProgram")}function sU(e){return J9(e)&&e.prompted}function aU(e){return e.visible&&e.prompted}function cU(e){var t;return(t=e.providers)==null?void 0:t.filter(n=>sU(n))}function lU(e){var t;return(t=e.signupItems)==null?void 0:t.filter(n=>aU(n))}function uU(e,t){var r;const n=(r=e.signupItems)==null?void 0:r.filter(i=>i.name===t);return(n==null?void 0:n.length)??!1?n[0]:null}function fU(e){const t=uU(e,"Affiliation");return t===null?!1:t.prompted}function X9(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function hh(e,t){return e&&e.signinMethods?e.signinMethods.filter(n=>n.name===t).length>0:!1}function dU(e){return hh(e,"Password")}function hU(e){return hh(e,"Verification code")}function pU(e){return hh(e,"WebAuthn")}function mU(e){return hh(e,"LDAP")}function gU(e){const t=cU(e);if((t==null?void 0:t.length)??!1)return!0;const n=lU(e);return(n==null?void 0:n.length)??!1?!0:fU(e)}function nl(e){if(e.type==="Custom"&&e.customLogo)return e.customLogo;if(e.category==="OAuth")return`${Xe}/img/social_${e.type.toLowerCase()}.png`;{const t=bU[e.category][e.type];return t?t.logo:""}}const bU={SMS:{"Aliyun SMS":{logo:`${Xe}/img/social_aliyun.png`,url:"https://aliyun.com/product/sms"},"Amazon SNS":{logo:`${Xe}/img/social_aws.png`,url:"https://aws.amazon.com/cn/sns/"},"Azure ACS":{logo:`${Xe}/img/social_azure.png`,url:"https://azure.microsoft.com/en-us/products/communication-services"},"Infobip SMS":{logo:`${Xe}/img/social_infobip.png`,url:"https://portal.infobip.com/homepage/"},"Tencent Cloud SMS":{logo:`${Xe}/img/social_tencent_cloud.jpg`,url:"https://cloud.tencent.com/product/sms"},"Baidu Cloud SMS":{logo:`${Xe}/img/social_baidu_cloud.png`,url:"https://cloud.baidu.com/product/sms.html"},"Volc Engine SMS":{logo:`${Xe}/img/social_volc_engine.jpg`,url:"https://www.volcengine.com/products/cloud-sms"},"Huawei Cloud SMS":{logo:`${Xe}/img/social_huawei.png`,url:"https://www.huaweicloud.com/product/msgsms.html"},"UCloud SMS":{logo:`${Xe}/img/social_ucloud.png`,url:"https://www.ucloud.cn/site/product/usms.html"},"Twilio SMS":{logo:`${Xe}/img/social_twilio.svg`,url:"https://www.twilio.com/messaging"},"SmsBao SMS":{logo:`${Xe}/img/social_smsbao.png`,url:"https://www.smsbao.com/"},"SUBMAIL SMS":{logo:`${Xe}/img/social_submail.svg`,url:"https://www.mysubmail.com"},"Msg91 SMS":{logo:`${Xe}/img/social_msg91.ico`,url:"https://control.msg91.com/app/"},"OSON SMS":{logo:"https://osonsms.com/images/osonsms-logo.svg",url:"https://osonsms.com/"},"Custom HTTP SMS":{logo:`${Xe}/img/social_default.png`,url:"https://casdoor.org/docs/provider/sms/overview"},"Mock SMS":{logo:`${Xe}/img/social_default.png`,url:""}},Email:{Default:{logo:`${Xe}/img/email_default.png`,url:""},SUBMAIL:{logo:`${Xe}/img/social_submail.svg`,url:"https://www.mysubmail.com"},Mailtrap:{logo:`${Xe}/img/email_mailtrap.png`,url:"https://mailtrap.io"},"Azure ACS":{logo:`${Xe}/img/social_azure.png`,url:"https://learn.microsoft.com/zh-cn/azure/communication-services"},SendGrid:{logo:`${Xe}/img/email_sendgrid.png`,url:"https://sendgrid.com/"},"Custom HTTP Email":{logo:`${Xe}/img/social_default.png`,url:"https://casdoor.org/docs/provider/email/overview"}},Storage:{"Local File System":{logo:`${Xe}/img/social_file.png`,url:""},"AWS S3":{logo:`${Xe}/img/social_aws.png`,url:"https://aws.amazon.com/s3"},MinIO:{logo:"https://min.io/resources/img/logo.svg",url:"https://min.io/"},"Aliyun OSS":{logo:`${Xe}/img/social_aliyun.png`,url:"https://aliyun.com/product/oss"},"Tencent Cloud COS":{logo:`${Xe}/img/social_tencent_cloud.jpg`,url:"https://cloud.tencent.com/product/cos"},"Azure Blob":{logo:`${Xe}/img/social_azure.png`,url:"https://azure.microsoft.com/en-us/services/storage/blobs/"},"Qiniu Cloud Kodo":{logo:`${Xe}/img/social_qiniu_cloud.png`,url:"https://www.qiniu.com/solutions/storage"},"Google Cloud Storage":{logo:`${Xe}/img/social_google_cloud.png`,url:"https://cloud.google.com/storage"},Synology:{logo:`${Xe}/img/social_synology.png`,url:"https://www.synology.com/en-global/dsm/feature/file_sharing"}},SAML:{"Aliyun IDaaS":{logo:`${Xe}/img/social_aliyun.png`,url:"https://aliyun.com/product/idaas"},Keycloak:{logo:`${Xe}/img/social_keycloak.png`,url:"https://www.keycloak.org/"},Custom:{logo:`${Xe}/img/social_custom.png`,url:"https://door.casdoor.com/"}},Payment:{Dummy:{logo:`${Xe}/img/payment_paypal.png`,url:""},Alipay:{logo:`${Xe}/img/payment_alipay.png`,url:"https://www.alipay.com/"},"WeChat Pay":{logo:`${Xe}/img/payment_wechat_pay.png`,url:"https://pay.weixin.qq.com/"},PayPal:{logo:`${Xe}/img/payment_paypal.png`,url:"https://www.paypal.com/"},Stripe:{logo:`${Xe}/img/social_stripe.png`,url:"https://stripe.com/"},GC:{logo:`${Xe}/img/payment_gc.png`,url:"https://gc.org"}},Captcha:{Default:{logo:`${Xe}/img/captcha_default.png`,url:"https://pkg.go.dev/github.com/dchest/captcha"},reCAPTCHA:{logo:`${Xe}/img/social_recaptcha.png`,url:"https://www.google.com/recaptcha"},hCaptcha:{logo:`${Xe}/img/social_hcaptcha.png`,url:"https://www.hcaptcha.com"},"Aliyun Captcha":{logo:`${Xe}/img/social_aliyun.png`,url:"https://help.aliyun.com/product/28308.html"},GEETEST:{logo:`${Xe}/img/social_geetest.png`,url:"https://www.geetest.com"},"Cloudflare Turnstile":{logo:`${Xe}/img/social_cloudflare.png`,url:"https://www.cloudflare.com/products/turnstile/"}},AI:{"OpenAI API - GPT":{logo:`${Xe}/img/social_openai.svg`,url:"https://platform.openai.com"}},Web3:{MetaMask:{logo:`${Xe}/img/social_metamask.svg`,url:"https://metamask.io/"},Web3Onboard:{logo:`${Xe}/img/social_web3onboard.svg`,url:"https://onboard.blocknative.com/"}},Notification:{Telegram:{logo:`${Xe}/img/social_telegram.png`,url:"https://telegram.org/"},"Custom HTTP":{logo:`${Xe}/img/email_default.png`,url:"https://casdoor.org/docs/provider/notification/overview"},DingTalk:{logo:`${Xe}/img/social_dingtalk.png`,url:"https://www.dingtalk.com/"},Lark:{logo:`${Xe}/img/social_lark.png`,url:"https://www.larksuite.com/"},"Microsoft Teams":{logo:`${Xe}/img/social_teams.png`,url:"https://www.microsoft.com/microsoft-teams"},Bark:{logo:`${Xe}/img/social_bark.png`,url:"https://apps.apple.com/us/app/bark-customed-notifications/id1403753865"},Pushover:{logo:`${Xe}/img/social_pushover.png`,url:"https://pushover.net/"},Pushbullet:{logo:`${Xe}/img/social_pushbullet.png`,url:"https://www.pushbullet.com/"},Slack:{logo:`${Xe}/img/social_slack.png`,url:"https://slack.com/"},Webpush:{logo:`${Xe}/img/email_default.png`,url:"https://developer.mozilla.org/en-US/docs/Web/API/Push_API"},Discord:{logo:`${Xe}/img/social_discord.png`,url:"https://discord.com/"},"Google Chat":{logo:`${Xe}/img/social_google_chat.png`,url:"https://workspace.google.com/intl/en/products/chat/"},Line:{logo:`${Xe}/img/social_line.png`,url:"https://line.me/"},Matrix:{logo:`${Xe}/img/social_matrix.png`,url:"https://www.matrix.org/"},Twitter:{logo:`${Xe}/img/social_twitter.png`,url:"https://twitter.com/"},Reddit:{logo:`${Xe}/img/social_reddit.png`,url:"https://www.reddit.com/"},"Rocket Chat":{logo:`${Xe}/img/social_rocket_chat.png`,url:"https://rocket.chat/"},Viber:{logo:`${Xe}/img/social_viber.png`,url:"https://www.viber.com/"}}};function yU(e=""){return fetch(`${ki.casdoor}/api/get-account${e}`,{method:"GET",credentials:"include",headers:{"Accept-Language":xs()}}).then(t=>t.json())}function wU(e){let t=`${ki.casdoor}/api/signup`;return ki.springmicro&&(t=`${ki.springmicro}/api/accounts/users/register`),fetch(t,{method:"POST",credentials:"include",body:JSON.stringify(e),headers:{"Accept-Language":xs(),"Content-Type":"application/json"}}).then(n=>n.json())}function vU(e){return`?type=${e==null?void 0:e.type}&id=${e==null?void 0:e.id}&redirectUri=${e==null?void 0:e.service}`}function EU(e){return e==null?"":`?clientId=${e.clientId}&responseType=${e.responseType}&redirectUri=${encodeURIComponent(e.redirectUri)}&type=${e.type}&scope=${e.scope}&state=${e.state}&nonce=${e.nonce}&code_challenge_method=${e.challengeMethod}&code_challenge=${e.codeChallenge}`}function ev(e){const t=(e==null?void 0:e.type)==="cas"?vU(e):EU(e);return fetch(`${ki.casdoor}/api/get-app-login${t}`,{method:"GET",credentials:"include",headers:{"Accept-Language":xs()}}).then(n=>n.json())}function xU(e,t){return fetch(`${ki.casdoor}/api/get-saml-login?id=${e}&relayState=${t}`,{method:"GET",credentials:"include",headers:{"Accept-Language":xs()}}).then(n=>n.json())}function _U(e){return fetch(`${ki.casdoor}/api/get-webhook-event?ticket=${e}`,{method:"GET",credentials:"include",headers:{"Accept-Language":xs()}}).then(t=>t.json())}function AU(e){return fetch(`${ki.casdoor}/api/get-qrcode?id=${e}`,{method:"GET",credentials:"include",headers:{"Accept-Language":xs()}}).then(t=>t.json())}function u3(e,t){return fetch(`${ki.casdoor}/api/get-application?id=${e}/${encodeURIComponent(t)}`,{method:"GET",headers:{"Accept-Language":xs()}}).then(n=>n.json())}const rl={Google:{scope:"profile+email",endpoint:"https://accounts.google.com/signin/oauth"},GitHub:{scope:"user:email+read:user",endpoint:"https://github.com/login/oauth/authorize"},QQ:{scope:"get_user_info",endpoint:"https://graph.qq.com/oauth2.0/authorize"},WeChat:{scope:"snsapi_login",endpoint:"https://open.weixin.qq.com/connect/qrconnect",mpScope:"snsapi_userinfo",mpEndpoint:"https://open.weixin.qq.com/connect/oauth2/authorize"},WeChatMiniProgram:{endpoint:"https://mp.weixin.qq.com/"},Facebook:{scope:"email,public_profile",endpoint:"https://www.facebook.com/dialog/oauth"},DingTalk:{scope:"openid",endpoint:"https://login.dingtalk.com/oauth2/auth"},Weibo:{scope:"email",endpoint:"https://api.weibo.com/oauth2/authorize"},Gitee:{scope:"user_info%20emails",endpoint:"https://gitee.com/oauth/authorize"},LinkedIn:{scope:"r_liteprofile%20r_emailaddress",endpoint:"https://www.linkedin.com/oauth/v2/authorization"},WeCom:{scope:"snsapi_userinfo",endpoint:"https://open.work.weixin.qq.com/wwopen/sso/3rd_qrConnect",silentEndpoint:"https://open.weixin.qq.com/connect/oauth2/authorize",internalEndpoint:"https://open.work.weixin.qq.com/wwopen/sso/qrConnect"},Lark:{endpoint:"https://open.feishu.cn/open-apis/authen/v1/index"},GitLab:{scope:"read_user+profile",endpoint:"https://gitlab.com/oauth/authorize"},ADFS:{scope:"openid",endpoint:"http://example.com"},Baidu:{scope:"basic",endpoint:"http://openapi.baidu.com/oauth/2.0/authorize"},Alipay:{scope:"basic",endpoint:"https://openauth.alipay.com/oauth2/publicAppAuthorize.htm"},Casdoor:{scope:"openid%20profile%20email",endpoint:"http://example.com"},Infoflow:{endpoint:"https://xpc.im.baidu.com/oauth2/authorize"},Apple:{scope:"name%20email",endpoint:"https://appleid.apple.com/auth/authorize"},AzureAD:{scope:"user.read",endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize"},AzureADB2C:{scope:"openid",endpoint:"https://tenant.b2clogin.com/tenant.onmicrosoft.com/userflow/oauth2/v2.0/authorize"},Slack:{scope:"users:read",endpoint:"https://slack.com/oauth/authorize"},Steam:{endpoint:"https://steamcommunity.com/openid/login"},Okta:{scope:"openid%20profile%20email",endpoint:"http://example.com"},Douyin:{scope:"user_info",endpoint:"https://open.douyin.com/platform/oauth/connect"},Custom:{endpoint:"https://example.com/"},Bilibili:{endpoint:"https://passport.bilibili.com/register/pc_oauth2.html"},Line:{scope:"profile%20openid%20email",endpoint:"https://access.line.me/oauth2/v2.1/authorize"},Amazon:{scope:"profile",endpoint:"https://www.amazon.com/ap/oa"},Auth0:{scope:"openid%20profile%20email",endpoint:"http://auth0.com/authorize"},BattleNet:{scope:"openid",endpoint:"https://oauth.battlenet.com.cn/authorize"},Bitbucket:{scope:"account",endpoint:"https://bitbucket.org/site/oauth2/authorize"},Box:{scope:"root_readwrite",endpoint:"https://account.box.com/api/oauth2/authorize"},CloudFoundry:{scope:"cloud_controller.read",endpoint:"https://login.cloudfoundry.org/oauth/authorize"},Dailymotion:{scope:"userinfo",endpoint:"https://api.dailymotion.com/oauth/authorize"},Deezer:{scope:"basic_access",endpoint:"https://connect.deezer.com/oauth/auth.php"},DigitalOcean:{scope:"read",endpoint:"https://cloud.digitalocean.com/v1/oauth/authorize"},Discord:{scope:"identify%20email",endpoint:"https://discord.com/api/oauth2/authorize"},Dropbox:{scope:"account_info.read",endpoint:"https://www.dropbox.com/oauth2/authorize"},EveOnline:{scope:"publicData",endpoint:"https://login.eveonline.com/oauth/authorize"},Fitbit:{scope:"activity%20heartrate%20location%20nutrition%20profile%20settings%20sleep%20social%20weight",endpoint:"https://www.fitbit.com/oauth2/authorize"},Gitea:{scope:"user:email",endpoint:"https://gitea.com/login/oauth/authorize"},Heroku:{scope:"global",endpoint:"https://id.heroku.com/oauth/authorize"},InfluxCloud:{scope:"read:org",endpoint:"https://cloud2.influxdata.com/oauth/authorize"},Instagram:{scope:"user_profile",endpoint:"https://api.instagram.com/oauth/authorize"},Intercom:{scope:"user.read",endpoint:"https://app.intercom.com/oauth"},Kakao:{scope:"account_email",endpoint:"https://kauth.kakao.com/oauth/authorize"},Lastfm:{scope:"user_read",endpoint:"https://www.last.fm/api/auth"},Mailru:{scope:"userinfo",endpoint:"https://oauth.mail.ru/login"},Meetup:{scope:"basic",endpoint:"https://secure.meetup.com/oauth2/authorize"},MicrosoftOnline:{scope:"openid%20profile%20email",endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize"},Naver:{scope:"profile",endpoint:"https://nid.naver.com/oauth2.0/authorize"},Nextcloud:{scope:"openid%20profile%20email",endpoint:"https://cloud.example.org/apps/oauth2/authorize"},OneDrive:{scope:"offline_access%20onedrive.readonly",endpoint:"https://login.live.com/oauth20_authorize.srf"},Oura:{scope:"personal",endpoint:"https://cloud.ouraring.com/oauth/authorize"},Patreon:{scope:"identity",endpoint:"https://www.patreon.com/oauth2/authorize"},PayPal:{scope:"openid%20profile%20email",endpoint:"https://www.sandbox.paypal.com/connect"},SalesForce:{scope:"openid%20profile%20email",endpoint:"https://login.salesforce.com/services/oauth2/authorize"},Shopify:{scope:"read_products",endpoint:"https://myshopify.com/admin/oauth/authorize"},Soundcloud:{scope:"non-expiring",endpoint:"https://api.soundcloud.com/connect"},Spotify:{scope:"user-read-email",endpoint:"https://accounts.spotify.com/authorize"},Strava:{scope:"read",endpoint:"https://www.strava.com/oauth/authorize"},Stripe:{scope:"read_only",endpoint:"https://connect.stripe.com/oauth/authorize"},TikTok:{scope:"user.info.basic",endpoint:"https://www.tiktok.com/auth/authorize/"},Tumblr:{scope:"email",endpoint:"https://www.tumblr.com/oauth2/authorize"},Twitch:{scope:"user_read",endpoint:"https://id.twitch.tv/oauth2/authorize"},Twitter:{scope:"users.read%20tweet.read",endpoint:"https://twitter.com/i/oauth2/authorize"},Typetalk:{scope:"my",endpoint:"https://typetalk.com/oauth2/authorize"},Uber:{scope:"profile",endpoint:"https://login.uber.com/oauth/v2/authorize"},VK:{scope:"email",endpoint:"https://oauth.vk.com/authorize"},Wepay:{scope:"manage_accounts%20view_user",endpoint:"https://www.wepay.com/v2/oauth2/authorize"},Xero:{scope:"openid%20profile%20email",endpoint:"https://login.xero.com/identity/connect/authorize"},Yahoo:{scope:"openid%20profile%20email",endpoint:"https://api.login.yahoo.com/oauth2/request_auth"},Yammer:{scope:"user",endpoint:"https://www.yammer.com/oauth2/authorize"},Yandex:{scope:"login:email",endpoint:"https://oauth.yandex.com/authorize"},Zoom:{scope:"user:read",endpoint:"https://zoom.us/oauth/authorize"},MetaMask:{scope:"",endpoint:""},Web3Onboard:{scope:"",endpoint:""}};function f3(e,t,n,r){if(e===null||t===null)return"";let i=rl[t.type].endpoint,o=`${window.location.origin}/callback`;const s=rl[t.type].scope,a=t.type==="WeChat"&&navigator.userAgent.includes("MicroMessenger")||t.type==="Twitter",c=CU(e.name,t.name,n,a),l="P3S-a7dr8bgM4bF6vOyiKkKETDl16rcAzao9F8UIL1Y";if(t.type==="AzureAD"?t.domain!==""&&(i=i.replace("common",t.domain)):t.type==="Apple"&&(o=`${window.location.origin}/api/callback`),t.type==="Google"||t.type==="GitHub"||t.type==="QQ"||t.type==="Facebook"||t.type==="Weibo"||t.type==="Gitee"||t.type==="LinkedIn"||t.type==="GitLab"||t.type==="AzureAD"||t.type==="Slack"||t.type==="Line"||t.type==="Amazon"||t.type==="Auth0"||t.type==="BattleNet"||t.type==="Bitbucket"||t.type==="Box"||t.type==="CloudFoundry"||t.type==="Dailymotion"||t.type==="DigitalOcean"||t.type==="Discord"||t.type==="Dropbox"||t.type==="EveOnline"||t.type==="Gitea"||t.type==="Heroku"||t.type==="InfluxCloud"||t.type==="Instagram"||t.type==="Intercom"||t.type==="Kakao"||t.type==="MailRu"||t.type==="Meetup"||t.type==="MicrosoftOnline"||t.type==="Naver"||t.type==="Nextcloud"||t.type==="OneDrive"||t.type==="Oura"||t.type==="Patreon"||t.type==="PayPal"||t.type==="SalesForce"||t.type==="SoundCloud"||t.type==="Spotify"||t.type==="Strava"||t.type==="Stripe"||t.type==="Tumblr"||t.type==="Twitch"||t.type==="Typetalk"||t.type==="Uber"||t.type==="VK"||t.type==="Wepay"||t.type==="Xero"||t.type==="Yahoo"||t.type==="Yammer"||t.type==="Yandex"||t.type==="Zoom")return`${i}?client_id=${t.clientId}&redirect_uri=${o}&scope=${s}&response_type=code&state=${c}`;if(t.type==="AzureADB2C")return`https://${t.domain}.b2clogin.com/${t.domain}.onmicrosoft.com/${t.appId}/oauth2/v2.0/authorize?client_id=${t.clientId}&nonce=defaultNonce&redirect_uri=${encodeURIComponent(o)}&scope=${s}&response_type=code&state=${c}&prompt=login`;if(t.type==="DingTalk")return`${i}?client_id=${t.clientId}&redirect_uri=${o}&scope=${s}&response_type=code&prompt=consent&state=${c}`;if(t.type==="WeChat")return navigator.userAgent.includes("MicroMessenger")?`${rl[t.type].mpEndpoint}?appid=${t.clientId2}&redirect_uri=${o}&state=${c}&scope=${rl[t.type].mpScope}&response_type=code#wechat_redirect`:t.clientId2&&(t!=null&&t.disableSsl)&&(t==null?void 0:t.signName)==="media"?`${window.location.origin}/callback?state=${c}&code=${"wechat_oa:"+r}`:`${i}?appid=${t.clientId}&redirect_uri=${o}&scope=${s}&response_type=code&state=${c}#wechat_redirect`;if(t.type==="WeCom")return t.subType==="Internal"?t.method==="Silent"?(i=rl[t.type].silentEndpoint,`${i}?appid=${t.clientId}&redirect_uri=${o}&state=${c}&scope=${s}&response_type=code#wechat_redirect`):t.method==="Normal"?(i=rl[t.type].internalEndpoint,`${i}?appid=${t.clientId}&agentid=${t.appId}&redirect_uri=${o}&state=${c}&usertype=member`):`https://error:not-supported-provider-method:${t.method}`:t.subType==="Third-party"?t.method==="Silent"?(i=rl[t.type].silentEndpoint,`${i}?appid=${t.clientId}&redirect_uri=${o}&state=${c}&scope=${s}&response_type=code#wechat_redirect`):t.method==="Normal"?`${i}?appid=${t.clientId}&redirect_uri=${o}&state=${c}&usertype=member`:`https://error:not-supported-provider-method:${t.method}`:`https://error:not-supported-provider-sub-type:${t.subType}`;if(t.type==="Lark")return`${i}?app_id=${t.clientId}&redirect_uri=${o}&state=${c}`;if(t.type==="ADFS")return`${t.domain}/adfs/oauth2/authorize?client_id=${t.clientId}&redirect_uri=${o}&state=${c}&response_type=code&nonce=casdoor&scope=openid`;if(t.type==="Baidu")return`${i}?client_id=${t.clientId}&redirect_uri=${o}&state=${c}&response_type=code&scope=${s}&display=popup`;if(t.type==="Alipay")return`${i}?app_id=${t.clientId}&scope=auth_user&redirect_uri=${o}&state=${c}&response_type=code&scope=${s}&display=popup`;if(t.type==="Casdoor")return`${t.domain}/login/oauth/authorize?client_id=${t.clientId}&redirect_uri=${o}&state=${c}&response_type=code&scope=${s}`;if(t.type==="Infoflow")return`${i}?appid=${t.clientId}&redirect_uri=${o}?state=${c}`;if(t.type==="Apple")return`${i}?client_id=${t.clientId}&redirect_uri=${o}&state=${c}&response_type=code%20id_token&scope=${s}&response_mode=form_post`;if(t.type==="Steam")return`${i}?openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&openid.mode=checkid_setup&openid.ns=http://specs.openid.net/auth/2.0&openid.realm=${window.location.origin}&openid.return_to=${o}?state=${c}`;if(t.type==="Okta")return`${t.domain}/v1/authorize?client_id=${t.clientId}&redirect_uri=${o}&state=${c}&response_type=code&scope=${s}`;if(t.type==="Douyin"||t.type==="TikTok")return`${i}?client_key=${t.clientId}&redirect_uri=${o}&state=${c}&response_type=code&scope=${s}`;if(t.type==="Custom")return`${t.customAuthUrl}?client_id=${t.clientId}&redirect_uri=${o}&scope=${t.scopes}&response_type=code&state=${c}`;if(t.type==="Bilibili")return`${i}#/?client_id=${t.clientId}&return_url=${o}&state=${c}&response_type=code`;if(t.type==="Deezer")return`${i}?app_id=${t.clientId}&redirect_uri=${o}&perms=${s}`;if(t.type==="Lastfm")return`${i}?api_key=${t.clientId}&cb=${o}`;if(t.type==="Shopify")return`${i}?client_id=${t.clientId}&redirect_uri=${o}&scope=${s}&state=${c}&grant_options[]=per-user`;if(t.type==="Twitter"||t.type==="Fitbit")return`${i}?client_id=${t.clientId}&redirect_uri=${o}&state=${c}&response_type=code&scope=${s}&code_challenge=${l}&code_challenge_method=S256`;if(t.type==="MetaMask")return`${o}?state=${c}`;if(t.type==="Web3Onboard")return`${o}?state=${c}`}function Xo(e){return e??""}function d3(e){const n=window.location.href.split(`${e}=`)[1];if(!n)return"";let r=n.split("&")[0];return r?(r=decodeURIComponent(r),r):""}function tv(e){const t=new URLSearchParams(window.location.search),n=Xo(t.get("client_id")),r=Xo(t.get("response_type"));let i=d3("redirect_uri");i===""&&(i=Xo(t.get("redirect_uri")));let o=Xo(t.get("scope"));i.includes("#")&&o===""&&(o=d3("scope"));let s=Xo(t.get("state"));s.startsWith("/auth/oauth2/login.php?wantsurl=")&&(s=encodeURIComponent(s)),i.includes("#")&&s===""&&(s=d3("state"));const a=Xo(t.get("nonce")),c=Xo(t.get("code_challenge_method")),l=Xo(t.get("code_challenge")),f=Xo(t.get("SAMLRequest")),u=Xo(t.get("RelayState")),d=Xo(t.get("noRedirect"));return n===""&&f===""?null:{clientId:n,responseType:r,redirectUri:i,scope:o,state:s,nonce:a,challengeMethod:c,codeChallenge:l,samlRequest:f,relayState:u,noRedirect:d,type:"code"}}function CU(e,t,n,r){let i=window.location.search;if(i=`${i}&application=${encodeURIComponent(e)}&provider=${encodeURIComponent(t)}&method=${n}`,n==="link"&&(i=`${i}&from=${window.location.pathname}`),r){const o=t;return sessionStorage.setItem(o,i),o}else return btoa(i)}function SU(e,t,n,r){_U(n).then(i=>{if(i.data==="SCAN"||i.data==="subscribe"){const o=i==null?void 0:i.data2;l3(f3(e,t,r??"signup",o))}})}async function kU(e,t,n){document.addEventListener("click",function(i){const o=document.getElementById("WechatOfficialAccountModal");o&&i.target===o&&o.close()});function r(i,o){function s(){const f=document.getElementById("WechatOfficialAccountModal");f&&f.showModal()}function a(){window.clearInterval(o);const f=document.getElementById("WechatOfficialAccountModal");f&&f.close()}window.closeDialog=a;const c=`
|
|
31
31
|
<div style="margin-right: 34px;">
|
|
32
32
|
<img src="data:image/png;base64,${i.data}" alt="Wechat QR code" style="width: 100%;" />
|
|
33
33
|
</div>
|
|
34
34
|
<button onclick="window.closeDialog()">Close</button>
|
|
35
|
-
`,l=document.createElement("dialog");l.innerHTML=c,l.id="WechatOfficialAccountModal",document.body.appendChild(l),s()}AU(`${t.owner}/${t.name}`).then(async i=>{if(i.status!=="ok"){ji("error",i==null?void 0:i.msg);return}const o=setInterval(await SU,1e3,e,t,i.data2,n);r(i,o)})}function nv(e,t){return fetch(`${ki.casdoor}/api/get-invitation-info?code=${e}&applicationId=${encodeURIComponent(t)}`,{method:"GET",credentials:"include",headers:{"Accept-Language":xs()}}).then(n=>n.json())}function rv(e,t,n,r,i="",o,s,a,c=""){const l=new FormData;return l.append("captchaType",e),l.append("captchaToken",t),l.append("clientSecret",n),l.append("method",r),l.append("countryCode",i),l.append("dest",o),l.append("type",s),l.append("applicationId","admin/"+a),l.append("checkUser",c),console.log(Object.fromEntries(l.entries())),fetch(`${ki.casdoor}/api/send-verification-code`,{method:"POST",credentials:"include",body:l,headers:{"Accept-Language":xs()}}).then(f=>f.json()).then(f=>f.status==="ok"?(ji("success","Verification code sent"),!0):(ji("error",f.msg),!1))}function iv(e,t,n){return fetch(`${ki.casdoor}/api/get-captcha?applicationId=${e}/${encodeURIComponent(t)}&isCurrentProvider=${n}`,{method:"GET",headers:{"Accept-Language":xs()}}).then(r=>r.json()).then(r=>r.data)}const IU=e=>{const{captchaType:t,subType:n,siteKey:r,clientSecret:i,clientId2:o,clientSecret2:s,onChange:a}=e,c=l=>{const f=document.createElement("script");f.async=!1,f.src=l,document.getElementsByTagName("body")[0].appendChild(f)};return Tt.useEffect(()=>{switch(t){case"reCAPTCHA":{const l=setInterval(()=>{window.grecaptcha||c("https://recaptcha.net/recaptcha/api.js"),window.grecaptcha&&window.grecaptcha.render&&(window.grecaptcha.render("captcha",{sitekey:r,callback:a}),clearInterval(l))},300);break}case"hCaptcha":{const l=setInterval(()=>{window.hcaptcha||c("https://js.hcaptcha.com/1/api.js"),window.hcaptcha&&window.hcaptcha.render&&(window.hcaptcha.render("captcha",{sitekey:r,callback:a}),clearInterval(l))},300);break}case"Aliyun Captcha":{const l=setInterval(()=>{window.AWSC||c("https://g.alicdn.com/AWSC/AWSC/awsc.js"),window.AWSC&&(s&&s!=="***"&&window.AWSC.use(n,function(f,u){u.init({appkey:s,scene:o,renderTo:"captcha",success:function(d){a(`SessionId=${d.sessionId}&AccessKeyId=${r}&Scene=${o}&AppKey=${s}&Token=${d.token}&Sig=${d.sig}&RemoteIp=192.168.0.1`)}})}),clearInterval(l))},300);break}case"GEETEST":{let l=!1;const f=setInterval(()=>{if(window.initGeetest4||c("https://static.geetest.com/v4/gt4.js"),window.initGeetest4&&r&&!l){const u=String(r);window.initGeetest4({captchaId:u,product:"float"},function(d){l||(d.appendTo("#captcha"),l=!0),d.onSuccess(function(){const h=d.getValidate();a(`lot_number=${h.lot_number}&captcha_output=${h.captcha_output}&pass_token=${h.pass_token}&gen_time=${h.gen_time}&captcha_id=${r}`)})}),clearInterval(f)}},500);break}case"Cloudflare Turnstile":{const l=setInterval(()=>{window.turnstile||c("https://challenges.cloudflare.com/turnstile/v0/api.js"),window.turnstile&&window.turnstile.render&&(window.turnstile.render("#captcha",{sitekey:r,callback:a}),clearInterval(l))},300);break}}},[t,n,r,i,o,s]),_e.jsx("div",{id:"captcha"})},TU=e=>{const{t}=su.useTranslation(),{owner:n,name:r,visible:i,onOk:o,onCancel:s,isCurrentProvider:a}=e,[c,l]=Tt.useState("none"),[f,u]=Tt.useState(""),[d,h]=Tt.useState(""),[p,m]=Tt.useState(""),[b,g]=Tt.useState(""),[y,w]=Tt.useState(""),[v,x]=Tt.useState(!1),[S,T]=Tt.useState(""),[E,_]=Tt.useState(""),I=Tt.useRef(null);Tt.useEffect(()=>{i?B():(A(),x(!1))},[i]);const L=()=>{o==null||o(c,E,d)},A=()=>{_(""),s==null||s()},B=()=>{iv(n,r,a).then(H=>{H.type==="none"?L():H.type==="Default"?(x(!0),h(H.captchaId),T(H.captchaImage),l("Default")):(x(!0),l(H.type),u(H.clientId),h(H.clientSecret),m(H.subType),g(H.clientId2),w(H.clientSecret2))})},C=()=>_e.jsxs("div",{className:"flex flex-col items-center",children:[_e.jsx("div",{className:"bg-no-repeat mb-4 border border-current rounded w-[200px] h-[80px]",style:{backgroundImage:`url('data:image/png;base64,${S}')`}}),_e.jsx("input",{className:"input input-bordered w-[200px]",type:"text",ref:I,value:E,placeholder:t("general.captcha"),onKeyDown:H=>H.key==="Enter"?L():null,onChange:H=>_(H.target.value)})]}),O=H=>{_(H)},j=()=>c==="Default"?C():_e.jsx("div",{className:"flex justify-center",children:_e.jsx(IU,{captchaType:c,subType:p,siteKey:f,clientSecret:d,onChange:O,clientId2:b,clientSecret2:y})}),F=()=>{let H=!1;return c==="Default"?/^\d{5}$/.test(E)||(H=!0):E===""&&(H=!0),[_e.jsx("button",{className:"btn",onClick:A,children:"Cancel"},"closebtn"),_e.jsx("button",{className:"btn btn-primary",disabled:H,onClick:L,children:"OK"},"okbtn")]};return _e.jsx("dialog",{id:"captcha-modal",className:"modal",children:_e.jsxs("div",{className:"modal-box",children:[_e.jsx("div",{className:"mt-4 mb-8",children:j()}),_e.jsxs("div",{className:"modal-action",children:[_e.jsx("form",{method:"dialog",className:"modal-backdrop",children:_e.jsx("button",{children:"Close"})}),_e.jsx("form",{method:"dialog",className:"flex gap-3",children:F()})]})]})})},BU=({value:e,disabled:t,textBefore:n,onChange:r,onButtonClickArgs:i,application:o,method:s,countryCode:a})=>{const{t:c}=su.useTranslation(),[l,f]=Tt.useState(!1),[u,d]=Tt.useState(0),[h,p]=Tt.useState(!1),m=Tt.useRef(null),b=(w=60)=>{let v=w;d(v);const x=()=>{v--,d(v),v!==0&&setTimeout(x,1e3)};setTimeout(x,1e3)},g=(w,v,x)=>{f(!1),p(!0),rv(w,v,x,s,a,...i).then(S=>{p(!1),S&&b(60)})},y=()=>{f(!1)};return Tt.useEffect(()=>{m.current=document.getElementById("captcha-modal")},[]),Tt.useEffect(()=>{m.current&&(l?m.current.showModal():m.current.close())},[l]),_e.jsxs(Tt.Fragment,{children:[_e.jsxs("div",{className:"flex",children:[_e.jsx("input",{className:"input",disabled:t,value:e,placeholder:"Enter your code",onChange:w=>r(w.target.value),autoComplete:"one-time-code"}),_e.jsx("button",{className:"btn",disabled:t||u>0,onClick:()=>f(!0),children:u>0?`${u} s`:c(h?"code.sending":"code.sendCode")})]}),_e.jsx(TU,{owner:o.owner,name:o.name,visible:l,onOk:g,onCancel:y,isCurrentProvider:!1})]})};var PU=Object.create,Id=Object.defineProperty,OU=Object.defineProperties,MU=Object.getOwnPropertyDescriptor,LU=Object.getOwnPropertyDescriptors,RU=Object.getOwnPropertyNames,ov=Object.getOwnPropertySymbols,jU=Object.getPrototypeOf,sv=Object.prototype.hasOwnProperty,NU=Object.prototype.propertyIsEnumerable,av=(e,t,n)=>t in e?Id(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ii=(e,t)=>{for(var n in t||(t={}))sv.call(t,n)&&av(e,n,t[n]);if(ov)for(var n of ov(t))NU.call(t,n)&&av(e,n,t[n]);return e},cv=(e,t)=>OU(e,LU(t)),$U=(e,t)=>{for(var n in t)Id(e,n,{get:t[n],enumerable:!0})},lv=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of RU(t))!sv.call(e,i)&&i!==n&&Id(e,i,{get:()=>t[i],enumerable:!(r=MU(t,i))||r.enumerable});return e},fr=(e,t,n)=>(n=e!=null?PU(jU(e)):{},lv(!e||!e.__esModule?Id(n,"default",{value:e,enumerable:!0}):n,e)),FU=e=>lv(Id({},"__esModule",{value:!0}),e),uv={};$U(uv,{AmazonLoginButton:()=>aH,AppleLoginButton:()=>CH,BufferLoginButton:()=>wH,DiscordLoginButton:()=>IH,FacebookLoginButton:()=>QU,GithubLoginButton:()=>tH,GitlabLoginButton:()=>QH,GoogleLoginButton:()=>JU,InstagramLoginButton:()=>uH,LinkedInLoginButton:()=>hH,MetamaskLoginButton:()=>WH,MicrosoftLoginButton:()=>gH,OktaLoginButton:()=>PH,SlackLoginButton:()=>LH,TelegramLoginButton:()=>xH,TikTokLoginButton:()=>zH,TwitterLoginButton:()=>iH,XLoginButton:()=>JH,YahooLoginButton:()=>NH,ZaloLoginButton:()=>DH,createButton:()=>Mr});var er=FU(uv),h3=fr(Tt),Ja=fr(Tt),DU=fr(Tt),UU=({name:e,size:t,format:n})=>DU.default.createElement("i",{className:n(e),style:{fontSize:t}}),HU=UU,fv=fr(Tt),zU=({type:e,size:t,format:n,color:r="#FFFFFF"})=>typeof e=="string"?fv.default.createElement(HU,Ii({},{format:n,name:e,size:t})):fv.default.createElement(e,{size:t,color:r}),GU="#FFFFFF",VU=e=>{const[t,n]=(0,Ja.useState)(!1),[r,i]=(0,Ja.useState)(!1),o=()=>{var _;i(!0),(_=e.onMouseEnter)==null||_.call(e)},s=()=>{var _;i(!1),(_=e.onMouseLeave)==null||_.call(e)},a=()=>n(!0),c=()=>n(!1),l=()=>{var _;return(_=e.onClick)==null?void 0:_.call(e)},{activeStyle:f,align:u="left",text:d,children:h=d,className:p,icon:m,iconFormat:b=_=>_,iconSize:g="26px",iconColor:y=GU,preventActiveStyles:w=!1,size:v="50px",style:x,disabled:S,type:T="button"}=e,E=WU(p3.button,{activeStyle:w?x:f,customStyle:x,active:r||t,size:v});return Ja.default.createElement("button",Ii({style:E,onClick:l,onMouseEnter:o,onMouseLeave:s,onFocus:a,onBlur:c},{className:p,disabled:S,type:T}),Ja.default.createElement("div",{style:p3.flex},!dv(g)&&!!m&&Ja.default.createElement("div",{style:{display:"flex",justifyContent:"center",minWidth:g}},Ja.default.createElement(zU,{type:m,size:g,format:b,color:y})),!dv(g)&&Ja.default.createElement("div",{style:p3.divider}),Ja.default.createElement("div",{style:{textAlign:u,width:"100%"}},h)))},dv=e=>e==="0"||e==="0px"||e===0,WU=(e,{size:t,customStyle:n,active:r,activeStyle:i})=>Ii(Ii(cv(Ii({},e),{height:t}),n),r&&i),p3={button:{display:"block",border:0,borderRadius:3,boxShadow:"rgba(0, 0, 0, 0.5) 0 1px 2px",color:"#ffffff",cursor:"pointer",fontSize:"19px",margin:"5px",width:"calc(100% - 10px)",overflow:"hidden",padding:"0 10px",userSelect:"none"},divider:{width:"10px"},flex:{alignItems:"center",display:"flex",height:"100%"}},qU=fr(Tt),Mr=e=>t=>{const n=cv(Ii(Ii({activeStyle:Ii(Ii({},e==null?void 0:e.activeStyle),t.activeStyle)},e),t),{style:Ii(Ii({},e==null?void 0:e.style),t.style)});return qU.default.createElement(VU,Ii({},n))},ZU={activeStyle:{background:"#293e69"},icon:KU,style:{background:"#3b5998"},text:"Log in with Facebook"},QU=Mr(ZU);function KU({size:e,color:t}){return h3.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 90 90"},h3.default.createElement("g",null,h3.default.createElement("path",{d:"M90,15.001C90,7.119,82.884,0,75,0H15C7.116,0,0,7.119,0,15.001v59.998 C0,82.881,7.116,90,15.001,90H45V56H34V41h11v-5.844C45,25.077,52.568,16,61.875,16H74v15H61.875C60.548,31,59,32.611,59,35.024V41 h15v15H59v34h16c7.884,0,15-7.119,15-15.001V15.001z",fill:t})))}var dr=fr(Tt),YU={activeStyle:{background:"#EFF0EE"},icon:XU,style:{background:"white",color:"black"},text:"Log in with Google"},JU=Mr(YU);function XU({size:e}){return dr.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",width:e,height:e},dr.default.createElement("linearGradient",{id:"95yY7w43Oj6n2vH63j6HJb",x1:"29.401",x2:"29.401",y1:"4.064",y2:"106.734",gradientTransform:"matrix(1 0 0 -1 0 66)",gradientUnits:"userSpaceOnUse"},dr.default.createElement("stop",{offset:"0",stopColor:"#ff5840"}),dr.default.createElement("stop",{offset:".007",stopColor:"#ff5840"}),dr.default.createElement("stop",{offset:".989",stopColor:"#fa528c"}),dr.default.createElement("stop",{offset:"1",stopColor:"#fa528c"})),dr.default.createElement("path",{fill:"url(#95yY7w43Oj6n2vH63j6HJb)",d:`M47.46,15.5l-1.37,1.48c-1.34,1.44-3.5,1.67-5.15,0.6c-2.71-1.75-6.43-3.13-11-2.37 c-4.94,0.83-9.17,3.85-11.64,
|
|
35
|
+
`,l=document.createElement("dialog");l.innerHTML=c,l.id="WechatOfficialAccountModal",document.body.appendChild(l),s()}AU(`${t.owner}/${t.name}`).then(async i=>{if(i.status!=="ok"){ji("error",i==null?void 0:i.msg);return}const o=setInterval(await SU,1e3,e,t,i.data2,n);r(i,o)})}function nv(e,t){return fetch(`${ki.casdoor}/api/get-invitation-info?code=${e}&applicationId=${encodeURIComponent(t)}`,{method:"GET",credentials:"include",headers:{"Accept-Language":xs()}}).then(n=>n.json())}function rv(e,t,n,r,i="",o,s,a,c=""){const l=new FormData;return l.append("captchaType",e),l.append("captchaToken",t),l.append("clientSecret",n),l.append("method",r),l.append("countryCode",i),l.append("dest",o),l.append("type",s),l.append("applicationId","admin/"+a),l.append("checkUser",c),console.log(Object.fromEntries(l.entries())),fetch(`${ki.casdoor}/api/send-verification-code`,{method:"POST",body:l,headers:{"Accept-Language":xs()}}).then(f=>f.json()).then(f=>f.status==="ok"?(ji("success","Verification code sent"),!0):(ji("error",f.msg),!1))}function iv(e,t,n){return fetch(`${ki.casdoor}/api/get-captcha?applicationId=${e}/${encodeURIComponent(t)}&isCurrentProvider=${n}`,{method:"GET",headers:{"Accept-Language":xs()}}).then(r=>r.json()).then(r=>r.data)}const IU=e=>{const{captchaType:t,subType:n,siteKey:r,clientSecret:i,clientId2:o,clientSecret2:s,onChange:a}=e,c=l=>{const f=document.createElement("script");f.async=!1,f.src=l,document.getElementsByTagName("body")[0].appendChild(f)};return Tt.useEffect(()=>{switch(t){case"reCAPTCHA":{const l=setInterval(()=>{window.grecaptcha||c("https://recaptcha.net/recaptcha/api.js"),window.grecaptcha&&window.grecaptcha.render&&(window.grecaptcha.render("captcha",{sitekey:r,callback:a}),clearInterval(l))},300);break}case"hCaptcha":{const l=setInterval(()=>{window.hcaptcha||c("https://js.hcaptcha.com/1/api.js"),window.hcaptcha&&window.hcaptcha.render&&(window.hcaptcha.render("captcha",{sitekey:r,callback:a}),clearInterval(l))},300);break}case"Aliyun Captcha":{const l=setInterval(()=>{window.AWSC||c("https://g.alicdn.com/AWSC/AWSC/awsc.js"),window.AWSC&&(s&&s!=="***"&&window.AWSC.use(n,function(f,u){u.init({appkey:s,scene:o,renderTo:"captcha",success:function(d){a(`SessionId=${d.sessionId}&AccessKeyId=${r}&Scene=${o}&AppKey=${s}&Token=${d.token}&Sig=${d.sig}&RemoteIp=192.168.0.1`)}})}),clearInterval(l))},300);break}case"GEETEST":{let l=!1;const f=setInterval(()=>{if(window.initGeetest4||c("https://static.geetest.com/v4/gt4.js"),window.initGeetest4&&r&&!l){const u=String(r);window.initGeetest4({captchaId:u,product:"float"},function(d){l||(d.appendTo("#captcha"),l=!0),d.onSuccess(function(){const h=d.getValidate();a(`lot_number=${h.lot_number}&captcha_output=${h.captcha_output}&pass_token=${h.pass_token}&gen_time=${h.gen_time}&captcha_id=${r}`)})}),clearInterval(f)}},500);break}case"Cloudflare Turnstile":{const l=setInterval(()=>{window.turnstile||c("https://challenges.cloudflare.com/turnstile/v0/api.js"),window.turnstile&&window.turnstile.render&&(window.turnstile.render("#captcha",{sitekey:r,callback:a}),clearInterval(l))},300);break}}},[t,n,r,i,o,s]),_e.jsx("div",{id:"captcha"})},TU=e=>{const{t}=su.useTranslation(),{owner:n,name:r,visible:i,onOk:o,onCancel:s,isCurrentProvider:a}=e,[c,l]=Tt.useState("none"),[f,u]=Tt.useState(""),[d,h]=Tt.useState(""),[p,m]=Tt.useState(""),[b,g]=Tt.useState(""),[y,w]=Tt.useState(""),[v,x]=Tt.useState(!1),[S,T]=Tt.useState(""),[E,_]=Tt.useState(""),I=Tt.useRef(null);Tt.useEffect(()=>{i?B():(A(),x(!1))},[i]);const L=()=>{o==null||o(c,E,d)},A=()=>{_(""),s==null||s()},B=()=>{iv(n,r,a).then(H=>{H.type==="none"?L():H.type==="Default"?(x(!0),h(H.captchaId),T(H.captchaImage),l("Default")):(x(!0),l(H.type),u(H.clientId),h(H.clientSecret),m(H.subType),g(H.clientId2),w(H.clientSecret2))})},C=()=>_e.jsxs("div",{className:"flex flex-col items-center",children:[_e.jsx("div",{className:"bg-no-repeat mb-4 border border-current rounded w-[200px] h-[80px]",style:{backgroundImage:`url('data:image/png;base64,${S}')`}}),_e.jsx("input",{className:"input input-bordered w-[200px]",type:"text",ref:I,value:E,placeholder:t("general.captcha"),onKeyDown:H=>H.key==="Enter"?L():null,onChange:H=>_(H.target.value)})]}),O=H=>{_(H)},j=()=>c==="Default"?C():_e.jsx("div",{className:"flex justify-center",children:_e.jsx(IU,{captchaType:c,subType:p,siteKey:f,clientSecret:d,onChange:O,clientId2:b,clientSecret2:y})}),F=()=>{let H=!1;return c==="Default"?/^\d{5}$/.test(E)||(H=!0):E===""&&(H=!0),[_e.jsx("button",{className:"btn",onClick:A,children:"Cancel"},"closebtn"),_e.jsx("button",{className:"btn btn-primary",disabled:H,onClick:L,children:"OK"},"okbtn")]};return _e.jsx("dialog",{id:"captcha-modal",className:"modal",children:_e.jsxs("div",{className:"modal-box",children:[_e.jsx("div",{className:"mt-4 mb-8",children:j()}),_e.jsxs("div",{className:"modal-action",children:[_e.jsx("form",{method:"dialog",className:"modal-backdrop",children:_e.jsx("button",{children:"Close"})}),_e.jsx("form",{method:"dialog",className:"flex gap-3",children:F()})]})]})})},BU=({value:e,disabled:t,textBefore:n,onChange:r,onButtonClickArgs:i,application:o,method:s,countryCode:a})=>{const{t:c}=su.useTranslation(),[l,f]=Tt.useState(!1),[u,d]=Tt.useState(0),[h,p]=Tt.useState(!1),m=Tt.useRef(null),b=(w=60)=>{let v=w;d(v);const x=()=>{v--,d(v),v!==0&&setTimeout(x,1e3)};setTimeout(x,1e3)},g=(w,v,x)=>{f(!1),p(!0),rv(w,v,x,s,a,...i).then(S=>{p(!1),S&&b(60)})},y=()=>{f(!1)};return Tt.useEffect(()=>{m.current=document.getElementById("captcha-modal")},[]),Tt.useEffect(()=>{m.current&&(l?m.current.showModal():m.current.close())},[l]),_e.jsxs(Tt.Fragment,{children:[_e.jsxs("div",{className:"flex",children:[_e.jsx("input",{className:"input",disabled:t,value:e,placeholder:"Enter your code",onChange:w=>r(w.target.value),autoComplete:"one-time-code"}),_e.jsx("button",{className:"btn",disabled:t||u>0,onClick:()=>f(!0),children:u>0?`${u} s`:c(h?"code.sending":"code.sendCode")})]}),_e.jsx(TU,{owner:o.owner,name:o.name,visible:l,onOk:g,onCancel:y,isCurrentProvider:!1})]})};var PU=Object.create,Id=Object.defineProperty,OU=Object.defineProperties,MU=Object.getOwnPropertyDescriptor,LU=Object.getOwnPropertyDescriptors,RU=Object.getOwnPropertyNames,ov=Object.getOwnPropertySymbols,jU=Object.getPrototypeOf,sv=Object.prototype.hasOwnProperty,NU=Object.prototype.propertyIsEnumerable,av=(e,t,n)=>t in e?Id(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ii=(e,t)=>{for(var n in t||(t={}))sv.call(t,n)&&av(e,n,t[n]);if(ov)for(var n of ov(t))NU.call(t,n)&&av(e,n,t[n]);return e},cv=(e,t)=>OU(e,LU(t)),$U=(e,t)=>{for(var n in t)Id(e,n,{get:t[n],enumerable:!0})},lv=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of RU(t))!sv.call(e,i)&&i!==n&&Id(e,i,{get:()=>t[i],enumerable:!(r=MU(t,i))||r.enumerable});return e},fr=(e,t,n)=>(n=e!=null?PU(jU(e)):{},lv(!e||!e.__esModule?Id(n,"default",{value:e,enumerable:!0}):n,e)),FU=e=>lv(Id({},"__esModule",{value:!0}),e),uv={};$U(uv,{AmazonLoginButton:()=>aH,AppleLoginButton:()=>CH,BufferLoginButton:()=>wH,DiscordLoginButton:()=>IH,FacebookLoginButton:()=>QU,GithubLoginButton:()=>tH,GitlabLoginButton:()=>QH,GoogleLoginButton:()=>JU,InstagramLoginButton:()=>uH,LinkedInLoginButton:()=>hH,MetamaskLoginButton:()=>WH,MicrosoftLoginButton:()=>gH,OktaLoginButton:()=>PH,SlackLoginButton:()=>LH,TelegramLoginButton:()=>xH,TikTokLoginButton:()=>zH,TwitterLoginButton:()=>iH,XLoginButton:()=>JH,YahooLoginButton:()=>NH,ZaloLoginButton:()=>DH,createButton:()=>Mr});var er=FU(uv),h3=fr(Tt),Ja=fr(Tt),DU=fr(Tt),UU=({name:e,size:t,format:n})=>DU.default.createElement("i",{className:n(e),style:{fontSize:t}}),HU=UU,fv=fr(Tt),zU=({type:e,size:t,format:n,color:r="#FFFFFF"})=>typeof e=="string"?fv.default.createElement(HU,Ii({},{format:n,name:e,size:t})):fv.default.createElement(e,{size:t,color:r}),GU="#FFFFFF",VU=e=>{const[t,n]=(0,Ja.useState)(!1),[r,i]=(0,Ja.useState)(!1),o=()=>{var _;i(!0),(_=e.onMouseEnter)==null||_.call(e)},s=()=>{var _;i(!1),(_=e.onMouseLeave)==null||_.call(e)},a=()=>n(!0),c=()=>n(!1),l=()=>{var _;return(_=e.onClick)==null?void 0:_.call(e)},{activeStyle:f,align:u="left",text:d,children:h=d,className:p,icon:m,iconFormat:b=_=>_,iconSize:g="26px",iconColor:y=GU,preventActiveStyles:w=!1,size:v="50px",style:x,disabled:S,type:T="button"}=e,E=WU(p3.button,{activeStyle:w?x:f,customStyle:x,active:r||t,size:v});return Ja.default.createElement("button",Ii({style:E,onClick:l,onMouseEnter:o,onMouseLeave:s,onFocus:a,onBlur:c},{className:p,disabled:S,type:T}),Ja.default.createElement("div",{style:p3.flex},!dv(g)&&!!m&&Ja.default.createElement("div",{style:{display:"flex",justifyContent:"center",minWidth:g}},Ja.default.createElement(zU,{type:m,size:g,format:b,color:y})),!dv(g)&&Ja.default.createElement("div",{style:p3.divider}),Ja.default.createElement("div",{style:{textAlign:u,width:"100%"}},h)))},dv=e=>e==="0"||e==="0px"||e===0,WU=(e,{size:t,customStyle:n,active:r,activeStyle:i})=>Ii(Ii(cv(Ii({},e),{height:t}),n),r&&i),p3={button:{display:"block",border:0,borderRadius:3,boxShadow:"rgba(0, 0, 0, 0.5) 0 1px 2px",color:"#ffffff",cursor:"pointer",fontSize:"19px",margin:"5px",width:"calc(100% - 10px)",overflow:"hidden",padding:"0 10px",userSelect:"none"},divider:{width:"10px"},flex:{alignItems:"center",display:"flex",height:"100%"}},qU=fr(Tt),Mr=e=>t=>{const n=cv(Ii(Ii({activeStyle:Ii(Ii({},e==null?void 0:e.activeStyle),t.activeStyle)},e),t),{style:Ii(Ii({},e==null?void 0:e.style),t.style)});return qU.default.createElement(VU,Ii({},n))},ZU={activeStyle:{background:"#293e69"},icon:KU,style:{background:"#3b5998"},text:"Log in with Facebook"},QU=Mr(ZU);function KU({size:e,color:t}){return h3.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 90 90"},h3.default.createElement("g",null,h3.default.createElement("path",{d:"M90,15.001C90,7.119,82.884,0,75,0H15C7.116,0,0,7.119,0,15.001v59.998 C0,82.881,7.116,90,15.001,90H45V56H34V41h11v-5.844C45,25.077,52.568,16,61.875,16H74v15H61.875C60.548,31,59,32.611,59,35.024V41 h15v15H59v34h16c7.884,0,15-7.119,15-15.001V15.001z",fill:t})))}var dr=fr(Tt),YU={activeStyle:{background:"#EFF0EE"},icon:XU,style:{background:"white",color:"black"},text:"Log in with Google"},JU=Mr(YU);function XU({size:e}){return dr.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",width:e,height:e},dr.default.createElement("linearGradient",{id:"95yY7w43Oj6n2vH63j6HJb",x1:"29.401",x2:"29.401",y1:"4.064",y2:"106.734",gradientTransform:"matrix(1 0 0 -1 0 66)",gradientUnits:"userSpaceOnUse"},dr.default.createElement("stop",{offset:"0",stopColor:"#ff5840"}),dr.default.createElement("stop",{offset:".007",stopColor:"#ff5840"}),dr.default.createElement("stop",{offset:".989",stopColor:"#fa528c"}),dr.default.createElement("stop",{offset:"1",stopColor:"#fa528c"})),dr.default.createElement("path",{fill:"url(#95yY7w43Oj6n2vH63j6HJb)",d:`M47.46,15.5l-1.37,1.48c-1.34,1.44-3.5,1.67-5.15,0.6c-2.71-1.75-6.43-3.13-11-2.37 c-4.94,0.83-9.17,3.85-11.64,
|
|
36
36
|
7.97l-8.03-6.08C14.99,9.82,23.2,5,32.5,5c5,0,9.94,1.56,14.27,4.46 C48.81,10.83,49.13,13.71,47.46,15.5z`}),dr.default.createElement("linearGradient",{id:"95yY7w43Oj6n2vH63j6HJc",x1:"12.148",x2:"12.148",y1:".872",y2:"47.812",gradientTransform:"matrix(1 0 0 -1 0 66)",gradientUnits:"userSpaceOnUse"},dr.default.createElement("stop",{offset:"0",stopColor:"#feaa53"}),dr.default.createElement("stop",{offset:".612",stopColor:"#ffcd49"}),dr.default.createElement("stop",{offset:"1",stopColor:"#ffde44"})),dr.default.createElement("path",{fill:"url(#95yY7w43Oj6n2vH63j6HJc)",d:`M16.01,30.91c-0.09,2.47,0.37,4.83,1.27,6.96l-8.21,6.05c-1.35-2.51-2.3-5.28-2.75-8.22 c-1.06-6.88,0.54-13.38,
|
|
37
37
|
3.95-18.6l8.03,6.08C16.93,25.47,16.1,28.11,16.01,30.91z`}),dr.default.createElement("linearGradient",{id:"95yY7w43Oj6n2vH63j6HJd",x1:"29.76",x2:"29.76",y1:"32.149",y2:"-6.939",gradientTransform:"matrix(1 0 0 -1 0 66)",gradientUnits:"userSpaceOnUse"},dr.default.createElement("stop",{offset:"0",stopColor:"#42d778"}),dr.default.createElement("stop",{offset:".428",stopColor:"#3dca76"}),dr.default.createElement("stop",{offset:"1",stopColor:"#34b171"})),dr.default.createElement("path",{fill:"url(#95yY7w43Oj6n2vH63j6HJd)",d:`M50.45,51.28c-4.55,4.07-10.61,6.57-17.36,6.71C22.91,58.2,13.66,52.53,9.07,43.92l8.21-6.05 C19.78,43.81,
|
|
38
38
|
25.67,48,32.5,48c3.94,0,7.52-1.28,10.33-3.44L50.45,51.28z`}),dr.default.createElement("linearGradient",{id:"95yY7w43Oj6n2vH63j6HJe",x1:"46",x2:"46",y1:"3.638",y2:"35.593",gradientTransform:"matrix(1 0 0 -1 0 66)",gradientUnits:"userSpaceOnUse"},dr.default.createElement("stop",{offset:"0",stopColor:"#155cde"}),dr.default.createElement("stop",{offset:".278",stopColor:"#1f7fe5"}),dr.default.createElement("stop",{offset:".569",stopColor:"#279ceb"}),dr.default.createElement("stop",{offset:".82",stopColor:"#2cafef"}),dr.default.createElement("stop",{offset:"1",stopColor:"#2eb5f0"})),dr.default.createElement("path",{fill:"url(#95yY7w43Oj6n2vH63j6HJe)",d:`M59,31.97c0.01,7.73-3.26,14.58-8.55,19.31l-7.62-6.72c2.1-1.61,3.77-3.71,4.84-6.15
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as D, t as ue, q as h, B as f, o as He, s as I, y as ce, C as ze, u as je, d as P, n as w, f as $, g as U, e as te } from "./Web3Auth-
|
|
1
|
+
import { i as D, t as ue, q as h, B as f, o as He, s as I, y as ce, C as ze, u as je, d as P, n as w, f as $, g as U, e as te } from "./Web3Auth-DhI1eSsQ.js";
|
|
2
2
|
function A(e) {
|
|
3
3
|
if (!Number.isSafeInteger(e) || e < 0)
|
|
4
4
|
throw new Error(`Wrong positive integer: ${e}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@springmicro/auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -27,13 +27,9 @@
|
|
|
27
27
|
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
|
28
28
|
"@typescript-eslint/parser": "^7.14.1",
|
|
29
29
|
"@vitejs/plugin-react": "^4.2.1",
|
|
30
|
-
"auth-astro": "^4.1.1",
|
|
31
30
|
"eslint": "^9.5.0",
|
|
32
31
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
33
32
|
"eslint-plugin-react-refresh": "^0.4.6",
|
|
34
|
-
"i18next": "^23.11.2",
|
|
35
|
-
"i18next-browser-languagedetector": "^7.2.1",
|
|
36
|
-
"react-i18next": "^14.1.2",
|
|
37
33
|
"typescript": "^5.5.2",
|
|
38
34
|
"vite": "^5.3.1",
|
|
39
35
|
"vite-plugin-dts": "^3.9.0"
|
|
@@ -48,11 +44,15 @@
|
|
|
48
44
|
"@web3-onboard/injected-wallets": "^2.10.16",
|
|
49
45
|
"@web3-onboard/taho": "^2.0.5",
|
|
50
46
|
"@web3-onboard/trust": "^2.0.4",
|
|
47
|
+
"auth-astro": "^4.1.1",
|
|
51
48
|
"buffer": "^6.0.3",
|
|
49
|
+
"i18next": "^23.11.2",
|
|
50
|
+
"i18next-browser-languagedetector": "^7.2.1",
|
|
52
51
|
"libphonenumber-js": "^1.10.61",
|
|
53
52
|
"react-google-one-tap-login": "^0.1.1",
|
|
53
|
+
"react-i18next": "^14.1.2",
|
|
54
54
|
"react-social-login-buttons": "^4.1.0",
|
|
55
55
|
"uuid": "^9.0.1"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "2e8437c70ee3c659e08cde72c14de20988214a0a"
|
|
58
58
|
}
|
|
@@ -23,7 +23,7 @@ type ButtonClickArgsTuple = [
|
|
|
23
23
|
dest: any,
|
|
24
24
|
type: any,
|
|
25
25
|
applicationId: any,
|
|
26
|
-
checkUser?: string
|
|
26
|
+
checkUser?: string
|
|
27
27
|
];
|
|
28
28
|
|
|
29
29
|
export type SendCodeInputProps = {
|
|
@@ -132,8 +132,8 @@ export const SendCodeInput = ({
|
|
|
132
132
|
{buttonLeftTime > 0
|
|
133
133
|
? `${buttonLeftTime} s`
|
|
134
134
|
: buttonLoading
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
? t("code.sending")
|
|
136
|
+
: t("code.sendCode")}
|
|
137
137
|
</button>
|
|
138
138
|
</div>
|
|
139
139
|
<CaptchaModal
|
|
@@ -234,9 +234,9 @@ export function renderFormItem(
|
|
|
234
234
|
signupItem.label
|
|
235
235
|
? signupItem.label
|
|
236
236
|
: signupItem.rule === "Real name" ||
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
237
|
+
signupItem.rule === "First, last"
|
|
238
|
+
? t("general.realName")
|
|
239
|
+
: t("general.displayName")
|
|
240
240
|
}
|
|
241
241
|
rules={[
|
|
242
242
|
{
|
|
@@ -61,12 +61,12 @@ export function getApplicationsByOrganization(
|
|
|
61
61
|
|
|
62
62
|
export function getApplication(owner: string, name: string) {
|
|
63
63
|
return fetch(
|
|
64
|
-
`${
|
|
65
|
-
|
|
66
|
-
)}`,
|
|
64
|
+
`${
|
|
65
|
+
Setting.ROOT_URLS.casdoor
|
|
66
|
+
}/api/get-application?id=${owner}/${encodeURIComponent(name)}`,
|
|
67
67
|
{
|
|
68
68
|
method: "GET",
|
|
69
|
-
credentials: "include",
|
|
69
|
+
// credentials: "include",
|
|
70
70
|
headers: {
|
|
71
71
|
"Accept-Language": Setting.getAcceptLanguage(),
|
|
72
72
|
},
|
|
@@ -85,7 +85,9 @@ export function addUserKeys(user) {
|
|
|
85
85
|
export function updateUser(owner, name, user) {
|
|
86
86
|
const newUser = deepCopy(user);
|
|
87
87
|
return fetch(
|
|
88
|
-
`${ROOT_URLS.casdoor}/api/update-user?id=${owner}/${encodeURIComponent(
|
|
88
|
+
`${ROOT_URLS.casdoor}/api/update-user?id=${owner}/${encodeURIComponent(
|
|
89
|
+
name
|
|
90
|
+
)}`,
|
|
89
91
|
{
|
|
90
92
|
method: "POST",
|
|
91
93
|
credentials: "include",
|
|
@@ -183,7 +185,7 @@ export function sendCode(
|
|
|
183
185
|
console.log(Object.fromEntries(formData.entries()));
|
|
184
186
|
return fetch(`${ROOT_URLS.casdoor}/api/send-verification-code`, {
|
|
185
187
|
method: "POST",
|
|
186
|
-
credentials: "include",
|
|
188
|
+
// credentials: "include",
|
|
187
189
|
body: formData,
|
|
188
190
|
headers: {
|
|
189
191
|
"Accept-Language": getAcceptLanguage(),
|
|
@@ -254,7 +256,9 @@ export function resetEmailOrPhone(dest, type, code) {
|
|
|
254
256
|
|
|
255
257
|
export function getCaptcha(owner, name, isCurrentProvider) {
|
|
256
258
|
return fetch(
|
|
257
|
-
`${
|
|
259
|
+
`${
|
|
260
|
+
ROOT_URLS.casdoor
|
|
261
|
+
}/api/get-captcha?applicationId=${owner}/${encodeURIComponent(
|
|
258
262
|
name
|
|
259
263
|
)}&isCurrentProvider=${isCurrentProvider}`,
|
|
260
264
|
{
|