@springmicro/auth 0.5.8 → 0.5.10

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.
@@ -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-hzrmIcT1.js";
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-ChSAJPxI.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-hzrmIcT1.js";
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-ChSAJPxI.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-DYTvS1uk.js";
1
+ import { s as pu, g as mp, a as yp } from "./index-ecBwof-h.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-BeiBc_gv.js"), { id: r, label: n, token: i, publicRpcUrl: o, blockExplorerUrl: a, rpcUrl: s } = e;
21311
+ const t = await import("./index-BTEwKHup.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-Da0T7bYG.js"), f = l({
21374
+ const { extractChain: l, defineChain: u } = await import("./index-Dsm6AJMg.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-Da0T7bYG.js"), s = await JE(t), l = o({
24453
+ const { createPublicClient: o, http: a } = await import("./index-Dsm6AJMg.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-Da0T7bYG.js"), i = r({
24496
+ const { createPublicClient: r, http: n } = await import("./index-Dsm6AJMg.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-BCXMyaWx.js").then((O) => O.default) : Promise.resolve(null), M = c.enabled ? import("./Index-64ac63ff-C7Av5-xP.js").then((O) => O.default) : Promise.resolve(null), j = u.enabled && b && b.accountCenter, A = (O, I, P, S) => {
29809
+ }), $ = u.enabled ? import("./Index-6c094240-CnaESKOY.js").then((O) => O.default) : Promise.resolve(null), M = c.enabled ? import("./Index-64ac63ff-BGS59mw0.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-C2eVtjVv.js"), t = document.createElement("style");
29955
+ const { InterVar: e } = await import("./index-B5_AG6rH.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-C2eVtjVv.js"), t = window.hasOwnProperty("ethereum");
31965
+ const { createEIP1193Provider: e } = await import("./index-B5_AG6rH.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-DUwhqFWy.js").then(($) => $.i), u = l.default ? l.default : l, { isHex: f, toHex: c, createEIP1193Provider: h, fromHex: d } = await import("./index-C2eVtjVv.js"), g = `data:image/svg+xml;base64,${window.btoa(s || "")}`, b = i.map(({ id: $ }) => d($, "number")), m = new u({
32226
+ const { name: a, icon: s } = o || {}, { default: l } = await import("./index-DJQLYJLq.js").then(($) => $.i), u = l.default ? l.default : l, { isHex: f, toHex: c, createEIP1193Provider: h, fromHex: d } = await import("./index-B5_AG6rH.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-LO_EWnJy.js"), { SafeAppProvider: i } = await import("./index-DXfwe7Zk.js").then((h) => h.i), { createEIP1193Provider: o } = await import("./index-C2eVtjVv.js"), a = (
32261
+ const { default: n } = await import("./index-DY_5IKzq.js"), { SafeAppProvider: i } = await import("./index-Ds7h1tdc.js").then((h) => h.i), { createEIP1193Provider: o } = await import("./index-B5_AG6rH.js"), a = (
32262
32262
  // @ts-ignore
32263
32263
  n.default || n
32264
32264
  ), s = {
@@ -1,4 +1,4 @@
1
- import { bK as L } from "./Web3Auth-hzrmIcT1.js";
1
+ import { bK as L } from "./Web3Auth-ChSAJPxI.js";
2
2
  var xt = {}, I = {}, T = {}, ne = L && L.__awaiter || function(e, t, n, i) {
3
3
  function r(s) {
4
4
  return s instanceof n ? s : new n(function(o) {
@@ -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-hzrmIcT1.js";
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-ChSAJPxI.js";
2
2
  const a = `
3
3
  @font-face {
4
4
  font-family: 'Inter';
@@ -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-CYbm8TMo.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-hzrmIcT1.js";
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-BYBmQ7ie.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-ChSAJPxI.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-hzrmIcT1.js";
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-ChSAJPxI.js";
2
2
  var ts = {}, gt = {}, Kt = {};
3
3
  Object.defineProperty(Kt, "__esModule", { value: !0 });
4
4
  Kt.walletLogo = void 0;
@@ -1,4 +1,4 @@
1
- import { e as y, h as T, a as k } from "./hashMessage-DysoAmGZ.js";
1
+ import { e as y, h as T, a as k } from "./hashMessage-rOprDzE5.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 { bK as V, bM as Jc, bH as Xc } from "./Web3Auth-hzrmIcT1.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-DysoAmGZ.js";
1
+ import { bK as V, bM as Jc, bH as Xc } from "./Web3Auth-ChSAJPxI.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-rOprDzE5.js";
3
3
  function Ru(e, t) {
4
4
  for (var n = 0; n < t.length; n++) {
5
5
  const r = t[n];
@@ -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-hzrmIcT1.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-hzrmIcT1.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-CYbm8TMo.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-CYbm8TMo.js";
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-ChSAJPxI.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-ChSAJPxI.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-BYBmQ7ie.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-BYBmQ7ie.js";
5
5
  function Ls(e, t) {
6
6
  const n = e.exec(t);
7
7
  return n == null ? void 0 : n.groups;
@@ -3004,10 +3004,10 @@ function Qe(t, e) {
3004
3004
  });
3005
3005
  }
3006
3006
  function Bt(t, e, o) {
3007
- e.type === "MetaMask" ? import("./Web3Auth-hzrmIcT1.js").then((r) => r.bO).then((r) => {
3007
+ e.type === "MetaMask" ? import("./Web3Auth-ChSAJPxI.js").then((r) => r.bO).then((r) => {
3008
3008
  const a = r.authViaMetaMask;
3009
3009
  a(t, e, o);
3010
- }) : e.type === "Web3Onboard" && import("./Web3Auth-hzrmIcT1.js").then((r) => r.bO).then((r) => {
3010
+ }) : e.type === "Web3Onboard" && import("./Web3Auth-ChSAJPxI.js").then((r) => r.bO).then((r) => {
3011
3011
  const a = r.authViaWeb3Onboard;
3012
3012
  a(t, e, o);
3013
3013
  });
@@ -3770,7 +3770,7 @@ function rr(t) {
3770
3770
  }
3771
3771
  function qt(t) {
3772
3772
  const e = ee(t);
3773
- return (e === "email" || e === "phone") && t.rule !== "None";
3773
+ return (e === "email" || e === "phone") && !["None", "No verification"].includes(t.rule);
3774
3774
  }
3775
3775
  function lr(t) {
3776
3776
  return t.visible === !0;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as s, c as a, b as e, u as n } from "./index-DYTvS1uk.js";
1
+ import { S as s, c as a, b as e, u as n } from "./index-ecBwof-h.js";
2
2
  export {
3
3
  s as SignUp,
4
4
  a as SignUpProvider,
@@ -55,7 +55,7 @@ React keys must be passed directly to JSX without using spread:
55
55
  c-0.564-3.887-1.183-28.422-0.619-31.098c2.54-7.765,43.816-39.902,48.059-41.112l3.997-0.901h12.472
56
56
  C210.405,118.002,212.353,114.98,212.353,114.98z M202.266,179.079l11.689,0.892l13.628-49.979
57
57
  c-2.276-0.082-22.95-1.93-25.636-2.431L202.266,179.079z M200.245,187.091l0.064,12.208l5.917,0.492l6.391,0.446l1.875-11.944
58
- l-6.737-0.31C207.756,187.983,200.245,187.091,200.245,187.091z`})))}var bv=fr(Tt),FH={activeStyle:{background:"#008FF3"},icon:UH,style:{background:"#0573ff"},text:"Log in with Zalo"},DH=Mr(FH);function UH({size:e,color:t}){return bv.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24"},bv.default.createElement("path",{fill:t,d:"M12.49 10.2722v-.4496h1.3467v6.3218h-.7704a.576.576 0 01-.5763-.5729l-.0006.0005a3.273 3.273 0 01-1.9372.6321c-1.8138 0-3.2844-1.4697-3.2844-3.2823 0-1.8125 1.4706-3.2822 3.2844-3.2822a3.273 3.273 0 011.9372.6321l.0006.0005zM6.9188 7.7896v.205c0 .3823-.051.6944-.2995 1.0605l-.03.0343c-.0542.0615-.1815.206-.2421.2843L2.024 14.8h4.8948v.7682a.5764.5764 0 01-.5767.5761H0v-.3622c0-.4436.1102-.6414.2495-.8476L4.8582 9.23H.1922V7.7896h6.7266zm8.5513 8.3548a.4805.4805 0 01-.4803-.4798v-7.875h1.4416v8.3548H15.47zM20.6934 9.6C22.52 9.6 24 11.0807 24 12.9044c0 1.8252-1.4801 3.306-3.3066 3.306-1.8264 0-3.3066-1.4808-3.3066-3.306 0-1.8237 1.4802-3.3044 3.3066-3.3044zm-10.1412 5.253c1.0675 0 1.9324-.8645 1.9324-1.9312 0-1.065-.865-1.9295-1.9324-1.9295s-1.9324.8644-1.9324 1.9295c0 1.0667.865 1.9312 1.9324 1.9312zm10.1412-.0033c1.0737 0 1.945-.8707 1.945-1.9453 0-1.073-.8713-1.9436-1.945-1.9436-1.0753 0-1.945.8706-1.945 1.9436 0 1.0746.8697 1.9453 1.945 1.9453z"}))}var yv=fr(Tt),HH={activeStyle:{background:"#333333"},icon:GH,style:{background:"#000000",color:"#FFFFFF"},text:"Log in with TikTok"},zH=Mr(HH);function GH({size:e,color:t}){return yv.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,fill:t,viewBox:"0 0 512 512"},yv.default.createElement("path",{d:"M412.19 118.66a109.27 109.27 0 01-9.45-5.5 132.87 132.87 0 01-24.27-20.62c-18.1-20.71-24.86-41.72-27.35-56.43h.1C349.14 23.9 350 16 350.13 16h-82.44v318.78c0 4.28 0 8.51-.18 12.69 0 .52-.05 1-.08 1.56 0 .23 0 .47-.05.71v.18a70 70 0 01-35.22 55.56 68.8 68.8 0 01-34.11 9c-38.41 0-69.54-31.32-69.54-70s31.13-70 69.54-70a68.9 68.9 0 0121.41 3.39l.1-83.94a153.14 153.14 0 00-118 34.52 161.79 161.79 0 00-35.3 43.53c-3.48 6-16.61 30.11-18.2 69.24-1 22.21 5.67 45.22 8.85 54.73v.2c2 5.6 9.75 24.71 22.38 40.82A167.53 167.53 0 00115 470.66v-.2l.2.2c39.91 27.12 84.16 25.34 84.16 25.34 7.66-.31 33.32 0 62.46-13.81 32.32-15.31 50.72-38.12 50.72-38.12a158.46 158.46 0 0027.64-45.93c7.46-19.61 9.95-43.13 9.95-52.53V176.49c1 .6 14.32 9.41 14.32 9.41s19.19 12.3 49.13 20.31c21.48 5.7 50.42 6.9 50.42 6.9v-81.84c-10.14 1.1-30.73-2.1-51.81-12.61z"}))}var ho=fr(Tt),VH={activeStyle:{background:"#eeeeee"},icon:qH,style:{background:"#ffffff",color:"#333333"},text:"Log in with Metamask"},WH=Mr(VH);function qH({size:e}){return ho.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",version:"1.1",width:e,height:e,viewBox:"0 0 318.6 318.6",xmlSpace:"preserve"},ho.default.createElement("path",{fill:"#e2761b",stroke:"#e2761b",strokeLinecap:"round",strokeLinejoin:"round",d:"M274.1 35.5l-99.5 73.9L193 65.8z"}),ho.default.createElement("path",Ii({d:"M44.4 35.5l98.7 74.6-17.5-44.3zm193.9 171.3l-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z"},wv)),ho.default.createElement("path",Ii({d:"M103.6 138.2l-15.8 23.9 56.3 2.5-2-60.5zm111.3 0l-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5l33.9 16.5-4.7-39.3z"},wv)),ho.default.createElement("path",{fill:"#d7c1b3",stroke:"#d7c1b3",strokeLinecap:"round",strokeLinejoin:"round",d:"M211.8 247.4l-33.9-16.5 2.7 22.1-.3 9.3zm-105 0l31.5 14.9-.2-9.3 2.5-22.1z"}),ho.default.createElement("path",{fill:"#233447",stroke:"#233447",strokeLinecap:"round",strokeLinejoin:"round",d:"M138.8 193.5l-28.2-8.3 19.9-9.1zm40.9 0l8.3-17.4 20 9.1z"}),ho.default.createElement("path",{fill:"#cd6116",stroke:"#cd6116",strokeLinecap:"round",strokeLinejoin:"round",d:"M106.8 247.4l4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7l-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1l20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),ho.default.createElement("path",{fill:"#e4751f",stroke:"#e4751f",strokeLinecap:"round",strokeLinejoin:"round",d:"M87.8 162.1l23.6 46-.8-22.9zm120.3 23.1l-1 22.9 23.7-46zm-64-20.6l-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0l-2.7 18 1.2 45 6.7-34.1z"}),ho.default.createElement("path",Ii({d:"M179.8 193.5l-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3l.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z"},vv)),ho.default.createElement("path",{fill:"#c0ad9e",stroke:"#c0ad9e",strokeLinecap:"round",strokeLinejoin:"round",d:"M180.3 262.3l.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),ho.default.createElement("path",{fill:"#161616",stroke:"#161616",strokeLinecap:"round",strokeLinejoin:"round",d:"M177.9 230.9l-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),ho.default.createElement("path",{fill:"#763d16",stroke:"#763d16",strokeLinecap:"round",strokeLinejoin:"round",d:"M278.3 114.2l8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),ho.default.createElement("path",Ii({d:"M267.2 153.5l-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3l-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4l3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z"},vv)))}var wv={fill:"#e4761b",stroke:"#e4761b",strokeLinecap:"round",strokeLinejoin:"round"},vv={fill:"#f6851b",stroke:"#f6851b",strokeLinecap:"round",strokeLinejoin:"round"},Ev=fr(Tt),ZH={icon:KH,style:{background:"#fc6d26"},activeStyle:{background:"#d55a1c"},text:"Log in with Gitlab"},QH=Mr(ZH);function KH({size:e,color:t}){return Ev.default.createElement("svg",{fill:t,role:"img",viewBox:"0 0 24 24",width:e,height:e,xmlns:"http://www.w3.org/2000/svg"},Ev.default.createElement("path",{d:"M21.94 13.11L20.89 9.89C20.89 9.86 20.88 9.83 20.87 9.8L18.76 3.32C18.65 3 18.33 2.75 17.96 2.75C17.6 2.75 17.28 3 17.17 3.33L15.17 9.5H8.84L6.83 3.33C6.72 3 6.4 2.75 6.04 2.75H6.04C5.67 2.75 5.35 3 5.24 3.33L3.13 9.82C3.13 9.82 3.13 9.83 3.13 9.83L2.06 13.11C1.9 13.61 2.07 14.15 2.5 14.45L11.72 21.16C11.89 21.28 12.11 21.28 12.28 21.15L21.5 14.45C21.93 14.15 22.1 13.61 21.94 13.11M8.15 10.45L10.72 18.36L4.55 10.45M13.28 18.37L15.75 10.78L15.85 10.45H19.46L13.87 17.61M17.97 3.94L19.78 9.5H16.16M14.86 10.45L13.07 15.96L12 19.24L9.14 10.45M6.03 3.94L7.84 9.5H4.23M3.05 13.69C2.96 13.62 2.92 13.5 2.96 13.4L3.75 10.97L9.57 18.42M20.95 13.69L14.44 18.42L14.46 18.39L20.25 10.97L21.04 13.4C21.08 13.5 21.04 13.62 20.95 13.69"}))}var xv=fr(Tt),YH={activeStyle:{background:"#282e36"},icon:XH,style:{background:"#0f1419"},text:"Log in with X"},JH=Mr(YH);function XH({size:e,color:t}){return xv.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24"},xv.default.createElement("path",{fill:t,d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"}))}function ez({width:e=24,height:t=24,color:n}){return _e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",height:"48",width:"32",viewBox:"-18.15 -35.9725 157.3 215.835",children:[_e.jsx("path",{fill:"#faab07",d:"M60.503 142.237c-12.533 0-24.038-4.195-31.445-10.46-3.762 1.124-8.574 2.932-11.61 5.175-2.6 1.918-2.275 3.874-1.807 4.663 2.056 3.47 35.273 2.216 44.862 1.136zm0 0c12.535 0 24.039-4.195 31.447-10.46 3.76 1.124 8.573 2.932 11.61 5.175 2.598 1.918 2.274 3.874 1.805 4.663-2.056 3.47-35.272 2.216-44.862 1.136zm0 0"}),_e.jsx("path",{d:"M60.576 67.119c20.698-.14 37.286-4.147 42.907-5.683 1.34-.367 2.056-1.024 2.056-1.024.005-.189.085-3.37.085-5.01C105.624 27.768 92.58.001 60.5 0 28.42.001 15.375 27.769 15.375 55.401c0 1.642.08 4.822.086 5.01 0 0 .583.615 1.65.913 5.19 1.444 22.09 5.65 43.312 5.795zm56.245 23.02c-1.283-4.129-3.034-8.944-4.808-13.568 0 0-1.02-.126-1.537.023-15.913 4.623-35.202 7.57-49.9 7.392h-.153c-14.616.175-33.774-2.737-49.634-7.315-.606-.175-1.802-.1-1.802-.1-1.774 4.624-3.525 9.44-4.808 13.568-6.119 19.69-4.136 27.838-2.627 28.02 3.239.392 12.606-14.821 12.606-14.821 0 15.459 13.957 39.195 45.918 39.413h.848c31.96-.218 45.917-23.954 45.917-39.413 0 0 9.368 15.213 12.607 14.822 1.508-.183 3.491-8.332-2.627-28.021"}),_e.jsx("path",{fill:"#fff",d:"M49.085 40.824c-4.352.197-8.07-4.76-8.304-11.063-.236-6.305 3.098-11.576 7.45-11.773 4.347-.195 8.064 4.76 8.3 11.065.238 6.306-3.097 11.577-7.446 11.771m31.133-11.063c-.233 6.302-3.951 11.26-8.303 11.063-4.35-.195-7.684-5.465-7.446-11.77.236-6.305 3.952-11.26 8.3-11.066 4.352.197 7.686 5.468 7.449 11.773"}),_e.jsx("path",{fill:"#faab07",d:"M87.952 49.725C86.79 47.15 75.077 44.28 60.578 44.28h-.156c-14.5 0-26.212 2.87-27.375 5.446a.863.863 0 00-.085.367.88.88 0 00.16.496c.98 1.427 13.985 8.487 27.3 8.487h.156c13.314 0 26.319-7.058 27.299-8.487a.873.873 0 00.16-.498.856.856 0 00-.085-.365"}),_e.jsx("path",{d:"M54.434 29.854c.199 2.49-1.167 4.702-3.046 4.943-1.883.242-3.568-1.58-3.768-4.07-.197-2.492 1.167-4.704 3.043-4.944 1.886-.244 3.574 1.58 3.771 4.07m11.956.833c.385-.689 3.004-4.312 8.427-2.993 1.425.347 2.084.857 2.223 1.057.205.296.262.718.053 1.286-.412 1.126-1.263 1.095-1.734.875-.305-.142-4.082-2.66-7.562 1.097-.24.257-.668.346-1.073.04-.407-.308-.574-.93-.334-1.362"}),_e.jsx("path",{fill:"#fff",d:"M60.576 83.08h-.153c-9.996.12-22.116-1.204-33.854-3.518-1.004 5.818-1.61 13.132-1.09 21.853 1.316 22.043 14.407 35.9 34.614 36.1h.82c20.208-.2 33.298-14.057 34.616-36.1.52-8.723-.087-16.035-1.092-21.854-11.739 2.315-23.862 3.64-33.86 3.518"}),_e.jsx("path",{fill:"#eb1923",d:"M32.102 81.235v21.693s9.937 2.004 19.893.616V83.535c-6.307-.357-13.109-1.152-19.893-2.3"}),_e.jsx("path",{fill:"#eb1923",d:"M105.539 60.412s-19.33 6.102-44.963 6.275h-.153c-25.591-.172-44.896-6.255-44.962-6.275L8.987 76.57c16.193 4.882 36.261 8.028 51.436 7.845h.153c15.175.183 35.242-2.963 51.437-7.845zm0 0"})]})}const tz={text:"Sign in with QQ",icon:ez,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(94,188,249)"},activeStyle:{background:"rgb(76,143,208)"}},nz=er.createButton(tz);function rz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/facebook.svg`,alt:"Sign in with Facebook"})}const iz={text:"Sign in with Facebook",icon:rz,iconFormat:e=>`fa fa-${e}`,style:{background:"#3b5998"},activeStyle:{background:"#2b3f65"}},oz=er.createButton(iz);function sz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/weibo.svg`,alt:"Sign in with Weibo"})}const az={text:"Sign in with Weibo",icon:sz,iconFormat:e=>`fa fa-${e}`,style:{background:"#e62329"},activeStyle:{background:"#e54329"}},cz=er.createButton(az);function lz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/gitee.svg`,alt:"Sign in with Gitee"})}const uz={text:"Sign in with Gitee",icon:lz,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(199,29,35)"},activeStyle:{background:"rgb(147,22,26)"}},fz=er.createButton(uz);function dz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/wechat.svg`,alt:"Sign in with Wechat"})}const hz={text:"Sign in with Wechat",icon:dz,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(0,194,80)"},activeStyle:{background:"rgb(0,158,64)"}},pz=er.createButton(hz);function mz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/dingtalk.svg`,alt:"Sign in with DingTalk"})}const gz={text:"Sign in with DingTalk",icon:mz,iconFormat:e=>`fa fa-${e}`,style:{background:"#0191e0"},activeStyle:{background:"rgb(76,143,208)"}},bz=er.createButton(gz);function yz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/linkedin.svg`,alt:"Sign in with LinkedIn"})}const wz={text:"Sign in with LinkedIn",icon:yz,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(255,255,255)",color:"#000000"},activeStyle:{background:"rgb(240,240,250)"}},vz=er.createButton(wz);function Ez({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/wecom.svg`,alt:"Sign in with WeCom"})}const xz={text:"Sign in with WeCom",icon:Ez,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(255,255,255)",color:"#000000"},activeStyle:{background:"rgb(100,150,250)"}},_z=er.createButton(xz);function Az({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/lark.svg`,alt:"Sign in with Lark",style:{width:24,height:24}})}const Cz={text:"Sign in with Lark",icon:Az,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},Sz=er.createButton(Cz);function kz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/gitlab.svg`,alt:"Sign in with GitLab",style:{width:24,height:24}})}const Iz={text:"Sign in with GitLab",icon:kz,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(255,255,255)",color:"#000000"},activeStyle:{background:"rgb(100,150,250)"}},Tz=er.createButton(Iz);function Bz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/adfs.svg`,alt:"Sign in with ADFS",style:{width:24,height:24}})}const Pz={text:"Sign in with ADFS",icon:Bz,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},Oz=er.createButton(Pz);function Mz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/casdoor.svg`,alt:"Sign in with Casdoor",style:{width:24,height:24}})}const Lz={text:"Sign in with Casdoor",icon:Mz,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},Rz=er.createButton(Lz);function jz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/baidu.svg`,alt:"Sign in with Baidu",style:{width:24,height:24}})}const Nz={text:"Sign in with Baidu",icon:jz,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},$z=er.createButton(Nz);function Fz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/alipay.svg`,alt:"Sign in with Alipay",style:{width:24,height:24}})}const Dz={text:"Sign in with Alipay",icon:Fz,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},Uz=er.createButton(Dz);function Hz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/infoflow.svg`,alt:"Sign in with Infoflow",style:{width:24,height:24}})}const zz={text:"Sign in with Infoflow",icon:Hz,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},Gz=er.createButton(zz);function Vz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/apple.svg`,alt:"Sign in with Apple",style:{width:24,height:24}})}const Wz={text:"Sign in with Apple",icon:Vz,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},qz=er.createButton(Wz);function Zz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/azuread.svg`,alt:"Sign in with Azure AD",style:{width:24,height:24}})}const Qz={text:"Sign in with Azure AD",icon:Zz,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},Kz=er.createButton(Qz);function Yz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/azuread.svg`,alt:"Sign in with Azure AD B2C",style:{width:24,height:24}})}const Jz={text:"Sign in with Azure AD B2C",icon:Yz,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},Xz=er.createButton(Jz);function eG({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/slack.svg`,alt:"Sign in with Slack",style:{width:24,height:24}})}const tG={text:"Sign in with Slack",icon:eG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},nG=er.createButton(tG);function rG({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/steam.svg`,alt:"Sign in with Steam",style:{width:24,height:24}})}const iG={text:"Sign in with Steam",icon:rG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},oG=er.createButton(iG);function sG({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/bilibili.svg`,alt:"Sign in with Bilibili"})}const aG={text:"Sign in with Bilibili",icon:sG,iconFormat:e=>`fa fa-${e}`,style:{background:"#0191e0"},activeStyle:{background:"rgb(76,143,208)"}},cG=er.createButton(aG);function lG({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/okta.svg`,alt:"Sign in with Okta",style:{width:24,height:24}})}const uG={text:"Sign in with Okta",icon:lG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},fG=er.createButton(uG);function dG({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/douyin.svg`,alt:"Sign in with Douyin",style:{width:24,height:24}})}const hG={text:"Sign in with Douyin",icon:dG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},pG=er.createButton(hG);function mG({type:e,logoUrl:t,align:n="center",style:r={background:"#ffffff",color:"#000000"},activeStyle:i={background:"#ededee"}}){function o({width:l=24,height:f=24,color:u}){return _e.jsx("img",{src:t,alt:`Sign in with ${e}`,style:{width:l,height:f}})}const s={text:`Sign in with ${e}`,icon:o,style:r,activeStyle:i},a=er.createButton(s),c=no.t("login:Sign in with {type}").replace("{type}",e);return _e.jsx(a,{text:c,align:n})}function y3(e){const t=no.t("login:Sign in with {type}").replace("{type}",e.displayName!==""?e.displayName:e.type);return e.type==="GitHub"?_e.jsx(er.GithubLoginButton,{text:t,align:"center"}):e.type==="Google"?_e.jsx(er.GoogleLoginButton,{text:t,align:"center"}):e.type==="QQ"?_e.jsx(nz,{text:t,align:"center"}):e.type==="Facebook"?_e.jsx(oz,{text:t,align:"center"}):e.type==="Weibo"?_e.jsx(cz,{text:t,align:"center"}):e.type==="Gitee"?_e.jsx(fz,{text:t,align:"center"}):e.type==="WeChat"?_e.jsx(pz,{text:t,align:"center"}):e.type==="DingTalk"?_e.jsx(bz,{text:t,align:"center"}):e.type==="LinkedIn"?_e.jsx(vz,{text:t,align:"center"}):e.type==="WeCom"?_e.jsx(_z,{text:t,align:"center"}):e.type==="Lark"?_e.jsx(Sz,{text:t,align:"center"}):e.type==="GitLab"?_e.jsx(Tz,{text:t,align:"center"}):e.type==="ADFS"?_e.jsx(Oz,{text:t,align:"center"}):e.type==="Casdoor"?_e.jsx(Rz,{text:t,align:"center"}):e.type==="Baidu"?_e.jsx($z,{text:t,align:"center"}):e.type==="Alipay"?_e.jsx(Uz,{text:t,align:"center"}):e.type==="Infoflow"?_e.jsx(Gz,{text:t,align:"center"}):e.type==="Apple"?_e.jsx(qz,{text:t,align:"center"}):e.type==="AzureAD"?_e.jsx(Kz,{text:t,align:"center"}):e.type==="AzureADB2C"?_e.jsx(Xz,{text:t,align:"center"}):e.type==="Slack"?_e.jsx(nG,{text:t,align:"center"}):e.type==="Steam"?_e.jsx(oG,{text:t,align:"center"}):e.type==="Bilibili"?_e.jsx(cG,{text:t,align:"center"}):e.type==="Okta"?_e.jsx(fG,{text:t,align:"center"}):e.type==="Douyin"?_e.jsx(pG,{text:t,align:"center"}):_e.jsx(mG,{type:e.type,logoUrl:nl(e)},e.type)}function w3(e,t){const n=new URLSearchParams(t.search),r=n.get("client_id")??"",i=n.get("state"),o=n.get("redirect_uri"),s=`${window.location.origin}/callback/saml`,a=e.name,c=`${r}&${i}&${a}&${o}&${s}`;xU(`${e.owner}/${a}`,btoa(c)).then(l=>{l.data2==="POST"?document.write(l.data):window.location.href=l.data})}function _v(e,t,n){t.type==="MetaMask"?Promise.resolve().then(()=>hP).then(r=>{const i=r.authViaMetaMask;i(e,t,n)}):t.type==="Web3Onboard"&&Promise.resolve().then(()=>hP).then(r=>{const i=r.authViaWeb3Onboard;i(e,t,n)})}function gG(e,t,n,r,i,o){if(i==="small"){if(e.category==="OAuth")return e.type==="WeChat"&&e.clientId2!==""&&e.clientSecret2!==""&&e.disableSsl===!0&&!navigator.userAgent.includes("MicroMessenger")?_e.jsx("a",{children:_e.jsx("img",{width:n,height:n,src:nl(e),alt:e.displayName,className:"provider-img",style:{margin:r},onClick:()=>{kU(t,e,"signup")}})},e.displayName):_e.jsx("a",{href:(void 0)(t,e,"signup"),children:_e.jsx("img",{width:n,height:n,src:nl(e),alt:e.displayName,className:"provider-img",style:{margin:r}})},e.displayName);if(e.category==="SAML")return _e.jsx("a",{onClick:()=>w3(e,o),children:_e.jsx("img",{width:n,height:n,src:nl(e),alt:e.displayName,className:"provider-img",style:{margin:r}})},e.displayName);if(e.category==="Web3")return _e.jsx("a",{onClick:()=>_v(t,e,"signup"),children:_e.jsx("img",{width:n,height:n,src:nl(e),alt:e.displayName,className:"provider-img",style:{margin:r}})},e.displayName)}else if(e.type==="Custom"){const s=no.t("login:Sign in with {type}").replace("{type}",e.displayName),a={display:"block",height:"55px",color:"#000"},c={display:"flex",alignItems:"center",width:"calc(100% - 10px)",height:"50px",margin:"5px",padding:"0 10px",backgroundColor:"transparent",boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",border:"0px",borderRadius:"3px",cursor:"pointer"},l={justfyContent:"space-between"},f={textAlign:"center",width:"100%",fontSize:"19px"};if(e.category==="OAuth")return _e.jsx("a",{href:(void 0)(t,e,"signup"),style:a,children:_e.jsxs("div",{style:c,children:[_e.jsx("img",{width:26,src:nl(e),alt:e.displayName,className:"provider-img",style:l}),_e.jsx("span",{style:f,children:s})]})},e.displayName);if(e.category==="SAML")return _e.jsx("a",{onClick:()=>w3(e,o),style:a,children:_e.jsxs("div",{style:c,children:[_e.jsx("img",{width:26,src:nl(e),alt:e.displayName,className:"provider-img",style:l}),_e.jsx("span",{style:f,children:s})]})},e.displayName)}else return e.category==="SAML"?_e.jsx("div",{className:"provider-big-img",children:_e.jsx("a",{onClick:()=>w3(e,o),children:y3(e)})},e.displayName):e.category==="Web3"?_e.jsx("div",{className:"provider-big-img",children:_e.jsx("a",{onClick:()=>_v(t,e,"signup"),children:y3(e)})},e.displayName):_e.jsx("div",{className:"provider-big-img",children:_e.jsx("a",{href:(void 0)(t,e,"signup"),children:y3(e)})},e.displayName)}function bG(e){return e.length<6?no.t("user:The password must have at least 6 characters"):""}function yG(e){return e.length<8?no.t("user:The password must have at least 8 characters"):""}function wG(e){return/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9]).+$/.test(e)?"":no.t("user:The password must contain at least one uppercase letter, one lowercase letter and one digit")}function vG(e){return/^(?=.*[!-/:-@[-`{-~]).+$/.test(e)?"":no.t("user:The password must contain at least one special character")}function EG(e){return/(.)\1+/.test(e)?no.t("user:The password must not contain any repeated characters"):""}function xG(e,t){if(e.length===0)return no.t("login:Please input your password!");(!t||t.length===0)&&(t=["AtLeast6"]);const n={AtLeast6:bG,AtLeast8:yG,Aa123:wG,SpecialChar:vG,NoRepeat:EG};for(const r of t){const i=n[r];if(i){const o=i(e);if(o!=="")return o}}return""}function _G({application:e,state:t,setState:n}){const[r,i]=Tt.useState(!1),o=Tt.useRef(null);Tt.useEffect(()=>{o.current||(o.current=document.getElementById("agreementDialog"))},[]),Tt.useEffect(()=>{o.current&&(r?o.current.showModal():o.current.close())},[r]);const s=()=>{n({...t,agreement:!1}),i(!1)},a=()=>{n({...t,agreement:!0}),i(!1)},c=()=>{i(!0)};return _e.jsxs(_e.Fragment,{children:[_e.jsx("dialog",{id:"agreementDialog",className:"modal",children:_e.jsxs("div",{className:"modal-box",children:[_e.jsx("div",{className:"mt-4 mb-8",children:_e.jsx("iframe",{src:e.termsOfUse,width:"100%",height:"300px",sandbox:"allow-scripts"})}),_e.jsxs("div",{className:"modal-action",children:[_e.jsx("form",{method:"dialog",className:"modal-backdrop",children:_e.jsx("button",{children:"Close"})}),_e.jsxs("form",{method:"dialog",className:"flex gap-3",children:[_e.jsx("button",{className:"btn",onClick:s,children:"Cancel"},"closebtn"),_e.jsx("button",{className:"btn btn-primary",onClick:a,children:"OK"},"okbtn")]})]})]})}),_e.jsx("input",{checked:!!t.agreement,type:"checkbox",readOnly:!0}),_e.jsx("button",{onClick:c,children:"Open Terms"})]})}async function AG(e,t,n){const{callbackUrl:r=window.location.href,redirect:i=!0}={},{prefix:o="/api/auth",...s}={},c=e==="email",f=`${`${o}/signin/${e}`}?${new URLSearchParams(n)}`,u=await fetch(`${o}/csrf`),{csrfToken:d}=await u.json(),h=await fetch(f,{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Auth-Return-Redirect":"1"},body:new URLSearchParams({...s,csrfToken:d,callbackUrl:r})}),p=await h.clone().json(),m=new URL(p.url).searchParams.get("error");if(i||!c||!m){window.location.href=p.url??r,p.url.includes("#")&&window.location.reload();return}return h}function es({label:e,name:t,rules:n,inputEl:r,setFieldValue:i,onChange:o,...s}){return _e.jsxs("label",{className:"form-control w-full max-w-xs",htmlFor:t,children:[_e.jsx("div",{className:"label",children:_e.jsx("span",{className:"label-text",children:e})}),r||_e.jsx("input",{type:"text",...s,name:t,className:"input input-bordered w-full max-w-xs",onChange:a=>{i(t,a.target.value),o==null||o(a)}}),_e.jsx("div",{className:"label flex-col",children:n==null?void 0:n.map((a,c)=>_e.jsx("span",{className:"label-text-alt",children:a.message},t+c))})]})}const CG=(e,t)=>(delete e.applicationName,delete e.emailOrPhoneMode,delete e.isTermsOfUseVisible,{application:t.name,organization:t.organization,plan:null,pricing:null,...e}),SG=(e,t,n)=>{e.preventDefault();const r=CG(t,n);console.log(r),wU(r).then(i=>{i.status==="ok"?(r.username=i.data.split("/")[1],n&&gU(n)?yU("").then(o=>{let s=null;o.status==="ok"?(s=o.data,s.organization=o.data2,console.log("account",s),alert("redirect")):ji("error",`Failed to sign in: ${o.msg}`)}):(alert("redirect"),AG())):ji("error",i.msg)})};function kG(e,t,n,r,i){if(!t.visible)return null;const o=(a,c)=>{n[a]=c,r(n)},s=t.required;if(t.name==="Username")return _e.jsx(es,{name:"username",className:"signup-username",label:t.label?t.label:i("signup.username"),rules:[{required:s,message:i("forget.username"),whitespace:!0}],placeholder:t.placeholder,disabled:n.invitation!==void 0&&n.invitation.username!=="",setFieldValue:o});if(t.name==="Display name")return t.rule==="First, last"&&oU()!=="zh"?_e.jsxs(Tt.Fragment,{children:[_e.jsx(es,{name:"firstName",className:"signup-first-name",label:t.label?t.label:i("general.firstName"),rules:[{required:s,message:i("forget.firstName"),whitespace:!0}],placeholder:t.placeholder,setFieldValue:o}),_e.jsx(es,{name:"lastName",className:"signup-last-name",label:t.label?t.label:i("general.lastName"),rules:[{required:s,message:i("forget.lastName"),whitespace:!0}],placeholder:t.placeholder,setFieldValue:o})]}):_e.jsx(es,{name:"name",className:"signup-name",label:t.label?t.label:t.rule==="Real name"||t.rule==="First, last"?i("general.realName"):i("general.displayName"),rules:[{required:s,message:t.rule==="Real name"||t.rule==="First, last"?i("forget.realName"):i("forget.displayName"),whitespace:!0}],placeholder:t.placeholder,setFieldValue:o});if(t.name==="Affiliation")return _e.jsx(es,{name:"affiliation",className:"signup-affiliation",label:t.label?t.label:i("user.affiliation"),rules:[{required:s,message:i("forget.affiliation"),whitespace:!0}],placeholder:t.placeholder,setFieldValue:o});if(t.name==="ID card")return _e.jsx(es,{name:"idCard",className:"signup-idcard",label:t.label?t.label:i("user.idCard"),rules:[{required:s,message:i("forget.idCard"),whitespace:!0},{required:s,pattern:new RegExp(/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9X]$/,"g"),message:i("format.idCard")}],placeholder:t.placeholder,setFieldValue:o});if(t.name==="Email"||t.name==="Phone"||t.name==="Email or Phone"||t.name==="Phone or Email"){const a=()=>_e.jsxs(Tt.Fragment,{children:[_e.jsx(es,{name:"email",label:t.label?t.label:i("general.email"),rules:[{required:s,message:i("forget.email")}],placeholder:t.placeholder,disabled:n.invitation!==void 0&&n.invitation.email!=="",onChange:l=>{const f=l.target.value;console.log("email",f,X9(f)),f!==""&&!X9(f)?r({...n,email:f,validEmail:!1}):r({...n,email:f,validEmail:!0})},setFieldValue:o}),t.rule!=="No verification"&&_e.jsx(es,{name:"emailCode",className:"signup-email-code",label:t.label?t.label:i("code.email"),rules:[{required:s,message:i("forget.code")}],inputEl:_e.jsx(BU,{disabled:!n.validEmail,method:"signup",onButtonClickArgs:[n.email,"email",e.name],application:e,countryCode:"US",onChange:l=>r({...n,emailCode:l})}),setFieldValue:o})]}),c=()=>_e.jsx(_e.Fragment,{});if(t.name==="Email")return a();if(t.name==="Phone")return c();if(t.name==="Email or Phone"||t.name==="Phone or Email"){let l=n.emailOrPhoneMode;return l===""&&(l=t.name==="Email or Phone"?"Email":"Phone"),_e.jsxs(Tt.Fragment,{children:[_e.jsx("div",{style:{marginTop:"30px",marginBottom:"20px"}}),l==="Email"?a():c()]})}else return null}else{if(t.name==="Password")return _e.jsx(es,{name:"password",className:"signup-password",label:t.label?t.label:i("general.password"),rules:[{required:s,validateTrigger:"onChange",validator:(a,c)=>{const l=xG(c,e.organizationObj.passwordOptions);return l===""?Promise.resolve():Promise.reject(l)}}],setFieldValue:o,type:"password",placeholder:t.placeholder});if(t.name==="Confirm password")return _e.jsx(es,{name:"confirm",className:"signup-confirm",label:t.label?t.label:i("signup.confirm"),rules:[{required:s,message:i("forget.confirm")}],type:"password",placeholder:t.placeholder,setFieldValue:o});if(t.name==="Invitation code")return _e.jsx(es,{name:"invitationCode",className:"signup-invitation-code",label:t.label?t.label:i("application.invitationCode"),rules:[{required:s,message:i("forget.invitationCode")}],placeholder:t.placeholder,disabled:n.invitation!==void 0&&n.invitation!=="",setFieldValue:o});if(t.name==="Agreement")return _e.jsx(_G,{state:n,setState:r,application:e});if(t.name.startsWith("Text "))return _e.jsx("div",{dangerouslySetInnerHTML:{__html:t.label}});if(t.name==="Signup button")return _e.jsxs("form",{onSubmit:a=>SG(a,n,e),children:[_e.jsx("button",{className:"btn btn-primary",type:"submit",children:i("signup.signUp")}),"  ",i("signup.haveAccount")," ",_e.jsx("a",{className:"signup-link",onClick:()=>{const a=sessionStorage.getItem("signinUrl");alert("redirect")},children:i("signup.signInNow")})]});if(t.name==="Providers"&&e.providers){const a=dU(e)||hU(e)||pU(e)||mU(e);return(t.rule==="None"||t.rule==="")&&(t.rule=a?"small":"big"),e.providers.filter(c=>J9(c)).map(c=>gG(c.provider,e,null,null,t.rule,{search:window.location.search}))}}return t.name}const IG={translation:{signup:{username:"Username",confirm:"Confirm password",signInNow:"Sign In Now",signUp:"Sign Up",haveAccount:"Have account?"},forget:{username:"Please input your username.",firstName:"Please input your first name.",lastName:"Please input your last name.",realName:"Please input your real name.",displayName:"Please input your display name.",affliation:"Please input your affliation.",idCard:"Please input your ID card number.",code:"Please input your verification code.",email:"Please input your email.",confirm:"Please confirm your password and ensure it matches.",invitationCode:"Please input your invitation code."},format:{idCard:"The ID card number format is incorrect."},general:{firstName:"First name",lastName:"Last name",displayName:"Display name",realName:"Real name",email:"Email",password:"Password",captcha:"Captcha"},user:{affliation:"Affliation",idCard:"ID card"},code:{email:"Email code",sending:"Sending",sendCode:"Send code"},application:{invitationCode:"Invitation code"}}};no.use(su.initReactI18next).init({lng:"en",fallbackLng:"en",resources:{en:IG}});function TG(e,t,n){const r=_e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-eye",children:[_e.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),_e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),i=_e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-eye-off",children:[_e.jsx("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),_e.jsx("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),_e.jsx("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),_e.jsx("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]}),o=mh(e),s=la(e);if(o==="password"){const a=t.password.state[s];return _e.jsxs(n,{variant:"ghost",size:"icon",className:"absolute top-1/2 right-2 -translate-y-1/2",onClick:c=>{c.preventDefault(),c.stopPropagation(),t.password.setState({...t.password.state,[s]:!a})},children:[a?i:r,_e.jsx("span",{className:"sr-only",children:"Toggle password visibility"})]})}else return null}function la(e){const t={ID:"id",Username:"username","Display name":"name",Affiliation:"affiliation","ID card":"idCard",Email:"email",Phone:"phone",Password:"password","Confirm password":"confirm","Invitation code":"invitationCode","Country/Region":"country_region",Agreement:"agreement"};return Object.keys(t).includes(e.name)?t[e.name]:e.name}function mh(e,t){const n=["password","confirm"],r=la(e);return n.includes(r)&&!(t!=null&&t.hidePassword[r])?"password":"text"}function BG(e){return Object.fromEntries(e.filter(t=>mh(t)==="password").map(t=>[la(t),!1]))}function PG(e){return{name:la(e),label:e.label||e.name,placeholder:e.placeholder,required:e.required,type:mh(e)}}function OG(e,t){const n=la(t);let r=e.string();return n==="email"&&(r=r.email()),t.required||(r=r.optional()),r}function MG(e){const t=e.map(r=>[la(r),""]),n=e.filter(r=>Av(r)).map(r=>[la(r)+"Code",""]);return Object.fromEntries([...t,...n])}function Av(e){const t=la(e);return(t==="email"||t==="phone")&&e.rule!=="None"}function LG(e){return e.visible===!0}function RG(e){var u;const{t,i18n:n}=su.useTranslation(),[r,i]=Tt.useState({applicationName:e.applicationName??null,email:"",phone:"",emailOrPhoneMode:"",countryCode:"",emailCode:"",phoneCode:"",validEmail:!1,validPhone:!1,region:"",isTermsOfUseVisible:!1,termsOfUseContent:""});Tt.useRef();const o=d=>{d!==void 0&&u3("admin",d).then(h=>{if(h.status==="error"){ji("error",h.msg);return}l(h.data)})},s=d=>{ev(d).then(h=>{if(h.status==="ok"){const p=h.data;l(p)}else l(null),i({...r,msg:h.msg})})},a=()=>e.application,c=(d,h)=>{nv(d,h).then(p=>{if(p.status==="error"){ji("error",p.msg);return}i({...r,invitation:p.data})})},l=d=>{e.onUpdateApplication(d)};Tt.useEffect(()=>{const d=tv();if(d!==null){const h=window.location.pathname.replace("/signup/oauth/authorize","/login/oauth/authorize");sessionStorage.setItem("signinUrl",h+window.location.search)}if(a()===void 0)if(r.applicationName!==null){o(r.applicationName);const h=new URLSearchParams(window.location.search);if(h.has("invitationCode")){const p=h.get("invitationCode")??"";i({...r,invitationCode:p}),p!==""&&c(p,"admin/"+r.applicationName)}}else d!==null?s(d):(ji("error",`Unknown application name: ${r.applicationName}`),l(null))},[]);const f=a();return f==null?null:(u=f.signupItems)==null?void 0:u.map((d,h)=>_e.jsx("div",{children:kG(f,d,r,i,t)},h))}function jG({applicationName:e,casdoorApiRoot:t,springmicroApiRoot:n}){ki.casdoor=t,n&&(ki.springmicro=n);const[r,i]=Tt.useState({application:null}),o=()=>{u3("admin",e).then(s=>{if(console.log(s),s.status==="error"){ji("error",s.msg);return}i({application:s.data})})};return Tt.useEffect(()=>{o()},[]),r.application===void 0?_e.jsx(_e.Fragment,{}):_e.jsx(su.I18nextProvider,{i18n:no,children:_e.jsx(RG,{application:r.application,onUpdateApplication:s=>{i({application:s})}})})}const Cv=Tt.createContext(void 0);function NG({applicationName:e,casdoorApiRoot:t,springmicroApiRoot:n,children:r}){su.useTranslation(),ki.casdoor=t,n&&(ki.springmicro=n);const[i,o]=Tt.useState({application:null}),[s,a]=Tt.useState({}),c=()=>{u3("admin",e).then(b=>{if(console.log(b),b.status==="error"){ji("error",b.msg);return}o({application:b.data})})},l=b=>{o({application:b})},f=(b,g)=>{nv(b,g).then(y=>{if(y.status==="error"){ji("error",y.msg);return}o({...i,invitation:y.data})})},u=b=>{ev(b).then(g=>{if(g.status==="ok"){const y=g.data;l(y)}else l(null),o({...i,msg:g.msg})})},d=(b,g)=>TG(b,{password:{state:s,setState:a}},g),h=b=>mh(b,{hidePassword:s}),p=rv,m=iv;return Tt.useEffect(()=>{c()},[]),Tt.useEffect(()=>{i.application&&a(BG(i.application.signupItems))},[i.application]),Tt.useEffect(()=>{const b=tv();if(b!==null){const g=window.location.pathname.replace("/signup/oauth/authorize","/login/oauth/authorize");sessionStorage.setItem("signinUrl",g+window.location.search)}if(i.application===void 0)if(i.applicationName!==null){c();const g=new URLSearchParams(window.location.search);if(g.has("invitationCode")){const y=g.get("invitationCode")??"";o({...i,invitationCode:y}),y!==""&&f(y,"admin/"+i.applicationName)}}else b!==null?u(b):(ji("error",`Unknown application name: ${i.applicationName}`),l(null))},[]),i.application===void 0||i.application===null?null:_e.jsx(Cv.Provider,{value:{application:i.application,getDefaultValues:MG,getFormProps:PG,icon:d,getZod:OG,getKey:la,type:h,sendCode:p,requiresCode:Av,getCaptcha:m,isVisible:LG},children:r})}const $G=()=>{const e=Tt.useContext(Cv);if(!e)throw new Error("useSignUp must be used within a SignUpProvider");return e};let gh;const FG=new Uint8Array(16);function DG(){if(!gh&&(gh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gh(FG)}const bi=[];for(let e=0;e<256;++e)bi.push((e+256).toString(16).slice(1));function UG(e,t=0){return bi[e[t+0]]+bi[e[t+1]]+bi[e[t+2]]+bi[e[t+3]]+"-"+bi[e[t+4]]+bi[e[t+5]]+"-"+bi[e[t+6]]+bi[e[t+7]]+"-"+bi[e[t+8]]+bi[e[t+9]]+"-"+bi[e[t+10]]+bi[e[t+11]]+bi[e[t+12]]+bi[e[t+13]]+bi[e[t+14]]+bi[e[t+15]]}const Sv={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function HG(e,t,n){if(Sv.randomUUID&&!t&&!e)return Sv.randomUUID();e=e||{};const r=e.random||(e.rng||DG)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,UG(r)}var v3={},ec={},bh={},yh={},il={},wh={};wh.byteLength=VG,wh.toByteArray=qG,wh.fromByteArray=KG;for(var xs=[],ko=[],zG=typeof Uint8Array<"u"?Uint8Array:Array,E3="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cu=0,GG=E3.length;cu<GG;++cu)xs[cu]=E3[cu],ko[E3.charCodeAt(cu)]=cu;ko[45]=62,ko[95]=63;function kv(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function VG(e){var t=kv(e),n=t[0],r=t[1];return(n+r)*3/4-r}function WG(e,t,n){return(t+n)*3/4-n}function qG(e){var t,n=kv(e),r=n[0],i=n[1],o=new zG(WG(e,r,i)),s=0,a=i>0?r-4:r,c;for(c=0;c<a;c+=4)t=ko[e.charCodeAt(c)]<<18|ko[e.charCodeAt(c+1)]<<12|ko[e.charCodeAt(c+2)]<<6|ko[e.charCodeAt(c+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=t&255;return i===2&&(t=ko[e.charCodeAt(c)]<<2|ko[e.charCodeAt(c+1)]>>4,o[s++]=t&255),i===1&&(t=ko[e.charCodeAt(c)]<<10|ko[e.charCodeAt(c+1)]<<4|ko[e.charCodeAt(c+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255),o}function ZG(e){return xs[e>>18&63]+xs[e>>12&63]+xs[e>>6&63]+xs[e&63]}function QG(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),i.push(ZG(r));return i.join("")}function KG(e){for(var t,n=e.length,r=n%3,i=[],o=16383,s=0,a=n-r;s<a;s+=o)i.push(QG(e,s,s+o>a?a:s+o));return r===1?(t=e[n-1],i.push(xs[t>>2]+xs[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(xs[t>>10]+xs[t>>4&63]+xs[t<<2&63]+"=")),i.join("")}var x3={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */x3.read=function(e,t,n,r,i){var o,s,a=i*8-r-1,c=(1<<a)-1,l=c>>1,f=-7,u=n?i-1:0,d=n?-1:1,h=e[t+u];for(u+=d,o=h&(1<<-f)-1,h>>=-f,f+=a;f>0;o=o*256+e[t+u],u+=d,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=s*256+e[t+u],u+=d,f-=8);if(o===0)o=1-l;else{if(o===c)return s?NaN:(h?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-l}return(h?-1:1)*s*Math.pow(2,o-r)},x3.write=function(e,t,n,r,i,o){var s,a,c,l=o*8-i-1,f=(1<<l)-1,u=f>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+u>=1?t+=d/c:t+=d*Math.pow(2,1-u),t*c>=2&&(s++,c/=2),s+u>=f?(a=0,s=f):s+u>=1?(a=(t*c-1)*Math.pow(2,i),s=s+u):(a=t*Math.pow(2,u-1)*Math.pow(2,i),s=0));i>=8;e[n+h]=a&255,h+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[n+h]=s&255,h+=p,s/=256,l-=8);e[n+h-p]|=m*128};/*!
58
+ l-6.737-0.31C207.756,187.983,200.245,187.091,200.245,187.091z`})))}var bv=fr(Tt),FH={activeStyle:{background:"#008FF3"},icon:UH,style:{background:"#0573ff"},text:"Log in with Zalo"},DH=Mr(FH);function UH({size:e,color:t}){return bv.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24"},bv.default.createElement("path",{fill:t,d:"M12.49 10.2722v-.4496h1.3467v6.3218h-.7704a.576.576 0 01-.5763-.5729l-.0006.0005a3.273 3.273 0 01-1.9372.6321c-1.8138 0-3.2844-1.4697-3.2844-3.2823 0-1.8125 1.4706-3.2822 3.2844-3.2822a3.273 3.273 0 011.9372.6321l.0006.0005zM6.9188 7.7896v.205c0 .3823-.051.6944-.2995 1.0605l-.03.0343c-.0542.0615-.1815.206-.2421.2843L2.024 14.8h4.8948v.7682a.5764.5764 0 01-.5767.5761H0v-.3622c0-.4436.1102-.6414.2495-.8476L4.8582 9.23H.1922V7.7896h6.7266zm8.5513 8.3548a.4805.4805 0 01-.4803-.4798v-7.875h1.4416v8.3548H15.47zM20.6934 9.6C22.52 9.6 24 11.0807 24 12.9044c0 1.8252-1.4801 3.306-3.3066 3.306-1.8264 0-3.3066-1.4808-3.3066-3.306 0-1.8237 1.4802-3.3044 3.3066-3.3044zm-10.1412 5.253c1.0675 0 1.9324-.8645 1.9324-1.9312 0-1.065-.865-1.9295-1.9324-1.9295s-1.9324.8644-1.9324 1.9295c0 1.0667.865 1.9312 1.9324 1.9312zm10.1412-.0033c1.0737 0 1.945-.8707 1.945-1.9453 0-1.073-.8713-1.9436-1.945-1.9436-1.0753 0-1.945.8706-1.945 1.9436 0 1.0746.8697 1.9453 1.945 1.9453z"}))}var yv=fr(Tt),HH={activeStyle:{background:"#333333"},icon:GH,style:{background:"#000000",color:"#FFFFFF"},text:"Log in with TikTok"},zH=Mr(HH);function GH({size:e,color:t}){return yv.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,fill:t,viewBox:"0 0 512 512"},yv.default.createElement("path",{d:"M412.19 118.66a109.27 109.27 0 01-9.45-5.5 132.87 132.87 0 01-24.27-20.62c-18.1-20.71-24.86-41.72-27.35-56.43h.1C349.14 23.9 350 16 350.13 16h-82.44v318.78c0 4.28 0 8.51-.18 12.69 0 .52-.05 1-.08 1.56 0 .23 0 .47-.05.71v.18a70 70 0 01-35.22 55.56 68.8 68.8 0 01-34.11 9c-38.41 0-69.54-31.32-69.54-70s31.13-70 69.54-70a68.9 68.9 0 0121.41 3.39l.1-83.94a153.14 153.14 0 00-118 34.52 161.79 161.79 0 00-35.3 43.53c-3.48 6-16.61 30.11-18.2 69.24-1 22.21 5.67 45.22 8.85 54.73v.2c2 5.6 9.75 24.71 22.38 40.82A167.53 167.53 0 00115 470.66v-.2l.2.2c39.91 27.12 84.16 25.34 84.16 25.34 7.66-.31 33.32 0 62.46-13.81 32.32-15.31 50.72-38.12 50.72-38.12a158.46 158.46 0 0027.64-45.93c7.46-19.61 9.95-43.13 9.95-52.53V176.49c1 .6 14.32 9.41 14.32 9.41s19.19 12.3 49.13 20.31c21.48 5.7 50.42 6.9 50.42 6.9v-81.84c-10.14 1.1-30.73-2.1-51.81-12.61z"}))}var ho=fr(Tt),VH={activeStyle:{background:"#eeeeee"},icon:qH,style:{background:"#ffffff",color:"#333333"},text:"Log in with Metamask"},WH=Mr(VH);function qH({size:e}){return ho.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",version:"1.1",width:e,height:e,viewBox:"0 0 318.6 318.6",xmlSpace:"preserve"},ho.default.createElement("path",{fill:"#e2761b",stroke:"#e2761b",strokeLinecap:"round",strokeLinejoin:"round",d:"M274.1 35.5l-99.5 73.9L193 65.8z"}),ho.default.createElement("path",Ii({d:"M44.4 35.5l98.7 74.6-17.5-44.3zm193.9 171.3l-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z"},wv)),ho.default.createElement("path",Ii({d:"M103.6 138.2l-15.8 23.9 56.3 2.5-2-60.5zm111.3 0l-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5l33.9 16.5-4.7-39.3z"},wv)),ho.default.createElement("path",{fill:"#d7c1b3",stroke:"#d7c1b3",strokeLinecap:"round",strokeLinejoin:"round",d:"M211.8 247.4l-33.9-16.5 2.7 22.1-.3 9.3zm-105 0l31.5 14.9-.2-9.3 2.5-22.1z"}),ho.default.createElement("path",{fill:"#233447",stroke:"#233447",strokeLinecap:"round",strokeLinejoin:"round",d:"M138.8 193.5l-28.2-8.3 19.9-9.1zm40.9 0l8.3-17.4 20 9.1z"}),ho.default.createElement("path",{fill:"#cd6116",stroke:"#cd6116",strokeLinecap:"round",strokeLinejoin:"round",d:"M106.8 247.4l4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7l-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1l20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),ho.default.createElement("path",{fill:"#e4751f",stroke:"#e4751f",strokeLinecap:"round",strokeLinejoin:"round",d:"M87.8 162.1l23.6 46-.8-22.9zm120.3 23.1l-1 22.9 23.7-46zm-64-20.6l-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0l-2.7 18 1.2 45 6.7-34.1z"}),ho.default.createElement("path",Ii({d:"M179.8 193.5l-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3l.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z"},vv)),ho.default.createElement("path",{fill:"#c0ad9e",stroke:"#c0ad9e",strokeLinecap:"round",strokeLinejoin:"round",d:"M180.3 262.3l.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),ho.default.createElement("path",{fill:"#161616",stroke:"#161616",strokeLinecap:"round",strokeLinejoin:"round",d:"M177.9 230.9l-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),ho.default.createElement("path",{fill:"#763d16",stroke:"#763d16",strokeLinecap:"round",strokeLinejoin:"round",d:"M278.3 114.2l8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),ho.default.createElement("path",Ii({d:"M267.2 153.5l-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3l-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4l3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z"},vv)))}var wv={fill:"#e4761b",stroke:"#e4761b",strokeLinecap:"round",strokeLinejoin:"round"},vv={fill:"#f6851b",stroke:"#f6851b",strokeLinecap:"round",strokeLinejoin:"round"},Ev=fr(Tt),ZH={icon:KH,style:{background:"#fc6d26"},activeStyle:{background:"#d55a1c"},text:"Log in with Gitlab"},QH=Mr(ZH);function KH({size:e,color:t}){return Ev.default.createElement("svg",{fill:t,role:"img",viewBox:"0 0 24 24",width:e,height:e,xmlns:"http://www.w3.org/2000/svg"},Ev.default.createElement("path",{d:"M21.94 13.11L20.89 9.89C20.89 9.86 20.88 9.83 20.87 9.8L18.76 3.32C18.65 3 18.33 2.75 17.96 2.75C17.6 2.75 17.28 3 17.17 3.33L15.17 9.5H8.84L6.83 3.33C6.72 3 6.4 2.75 6.04 2.75H6.04C5.67 2.75 5.35 3 5.24 3.33L3.13 9.82C3.13 9.82 3.13 9.83 3.13 9.83L2.06 13.11C1.9 13.61 2.07 14.15 2.5 14.45L11.72 21.16C11.89 21.28 12.11 21.28 12.28 21.15L21.5 14.45C21.93 14.15 22.1 13.61 21.94 13.11M8.15 10.45L10.72 18.36L4.55 10.45M13.28 18.37L15.75 10.78L15.85 10.45H19.46L13.87 17.61M17.97 3.94L19.78 9.5H16.16M14.86 10.45L13.07 15.96L12 19.24L9.14 10.45M6.03 3.94L7.84 9.5H4.23M3.05 13.69C2.96 13.62 2.92 13.5 2.96 13.4L3.75 10.97L9.57 18.42M20.95 13.69L14.44 18.42L14.46 18.39L20.25 10.97L21.04 13.4C21.08 13.5 21.04 13.62 20.95 13.69"}))}var xv=fr(Tt),YH={activeStyle:{background:"#282e36"},icon:XH,style:{background:"#0f1419"},text:"Log in with X"},JH=Mr(YH);function XH({size:e,color:t}){return xv.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24"},xv.default.createElement("path",{fill:t,d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"}))}function ez({width:e=24,height:t=24,color:n}){return _e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",height:"48",width:"32",viewBox:"-18.15 -35.9725 157.3 215.835",children:[_e.jsx("path",{fill:"#faab07",d:"M60.503 142.237c-12.533 0-24.038-4.195-31.445-10.46-3.762 1.124-8.574 2.932-11.61 5.175-2.6 1.918-2.275 3.874-1.807 4.663 2.056 3.47 35.273 2.216 44.862 1.136zm0 0c12.535 0 24.039-4.195 31.447-10.46 3.76 1.124 8.573 2.932 11.61 5.175 2.598 1.918 2.274 3.874 1.805 4.663-2.056 3.47-35.272 2.216-44.862 1.136zm0 0"}),_e.jsx("path",{d:"M60.576 67.119c20.698-.14 37.286-4.147 42.907-5.683 1.34-.367 2.056-1.024 2.056-1.024.005-.189.085-3.37.085-5.01C105.624 27.768 92.58.001 60.5 0 28.42.001 15.375 27.769 15.375 55.401c0 1.642.08 4.822.086 5.01 0 0 .583.615 1.65.913 5.19 1.444 22.09 5.65 43.312 5.795zm56.245 23.02c-1.283-4.129-3.034-8.944-4.808-13.568 0 0-1.02-.126-1.537.023-15.913 4.623-35.202 7.57-49.9 7.392h-.153c-14.616.175-33.774-2.737-49.634-7.315-.606-.175-1.802-.1-1.802-.1-1.774 4.624-3.525 9.44-4.808 13.568-6.119 19.69-4.136 27.838-2.627 28.02 3.239.392 12.606-14.821 12.606-14.821 0 15.459 13.957 39.195 45.918 39.413h.848c31.96-.218 45.917-23.954 45.917-39.413 0 0 9.368 15.213 12.607 14.822 1.508-.183 3.491-8.332-2.627-28.021"}),_e.jsx("path",{fill:"#fff",d:"M49.085 40.824c-4.352.197-8.07-4.76-8.304-11.063-.236-6.305 3.098-11.576 7.45-11.773 4.347-.195 8.064 4.76 8.3 11.065.238 6.306-3.097 11.577-7.446 11.771m31.133-11.063c-.233 6.302-3.951 11.26-8.303 11.063-4.35-.195-7.684-5.465-7.446-11.77.236-6.305 3.952-11.26 8.3-11.066 4.352.197 7.686 5.468 7.449 11.773"}),_e.jsx("path",{fill:"#faab07",d:"M87.952 49.725C86.79 47.15 75.077 44.28 60.578 44.28h-.156c-14.5 0-26.212 2.87-27.375 5.446a.863.863 0 00-.085.367.88.88 0 00.16.496c.98 1.427 13.985 8.487 27.3 8.487h.156c13.314 0 26.319-7.058 27.299-8.487a.873.873 0 00.16-.498.856.856 0 00-.085-.365"}),_e.jsx("path",{d:"M54.434 29.854c.199 2.49-1.167 4.702-3.046 4.943-1.883.242-3.568-1.58-3.768-4.07-.197-2.492 1.167-4.704 3.043-4.944 1.886-.244 3.574 1.58 3.771 4.07m11.956.833c.385-.689 3.004-4.312 8.427-2.993 1.425.347 2.084.857 2.223 1.057.205.296.262.718.053 1.286-.412 1.126-1.263 1.095-1.734.875-.305-.142-4.082-2.66-7.562 1.097-.24.257-.668.346-1.073.04-.407-.308-.574-.93-.334-1.362"}),_e.jsx("path",{fill:"#fff",d:"M60.576 83.08h-.153c-9.996.12-22.116-1.204-33.854-3.518-1.004 5.818-1.61 13.132-1.09 21.853 1.316 22.043 14.407 35.9 34.614 36.1h.82c20.208-.2 33.298-14.057 34.616-36.1.52-8.723-.087-16.035-1.092-21.854-11.739 2.315-23.862 3.64-33.86 3.518"}),_e.jsx("path",{fill:"#eb1923",d:"M32.102 81.235v21.693s9.937 2.004 19.893.616V83.535c-6.307-.357-13.109-1.152-19.893-2.3"}),_e.jsx("path",{fill:"#eb1923",d:"M105.539 60.412s-19.33 6.102-44.963 6.275h-.153c-25.591-.172-44.896-6.255-44.962-6.275L8.987 76.57c16.193 4.882 36.261 8.028 51.436 7.845h.153c15.175.183 35.242-2.963 51.437-7.845zm0 0"})]})}const tz={text:"Sign in with QQ",icon:ez,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(94,188,249)"},activeStyle:{background:"rgb(76,143,208)"}},nz=er.createButton(tz);function rz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/facebook.svg`,alt:"Sign in with Facebook"})}const iz={text:"Sign in with Facebook",icon:rz,iconFormat:e=>`fa fa-${e}`,style:{background:"#3b5998"},activeStyle:{background:"#2b3f65"}},oz=er.createButton(iz);function sz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/weibo.svg`,alt:"Sign in with Weibo"})}const az={text:"Sign in with Weibo",icon:sz,iconFormat:e=>`fa fa-${e}`,style:{background:"#e62329"},activeStyle:{background:"#e54329"}},cz=er.createButton(az);function lz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/gitee.svg`,alt:"Sign in with Gitee"})}const uz={text:"Sign in with Gitee",icon:lz,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(199,29,35)"},activeStyle:{background:"rgb(147,22,26)"}},fz=er.createButton(uz);function dz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/wechat.svg`,alt:"Sign in with Wechat"})}const hz={text:"Sign in with Wechat",icon:dz,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(0,194,80)"},activeStyle:{background:"rgb(0,158,64)"}},pz=er.createButton(hz);function mz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/dingtalk.svg`,alt:"Sign in with DingTalk"})}const gz={text:"Sign in with DingTalk",icon:mz,iconFormat:e=>`fa fa-${e}`,style:{background:"#0191e0"},activeStyle:{background:"rgb(76,143,208)"}},bz=er.createButton(gz);function yz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/linkedin.svg`,alt:"Sign in with LinkedIn"})}const wz={text:"Sign in with LinkedIn",icon:yz,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(255,255,255)",color:"#000000"},activeStyle:{background:"rgb(240,240,250)"}},vz=er.createButton(wz);function Ez({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/wecom.svg`,alt:"Sign in with WeCom"})}const xz={text:"Sign in with WeCom",icon:Ez,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(255,255,255)",color:"#000000"},activeStyle:{background:"rgb(100,150,250)"}},_z=er.createButton(xz);function Az({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/lark.svg`,alt:"Sign in with Lark",style:{width:24,height:24}})}const Cz={text:"Sign in with Lark",icon:Az,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},Sz=er.createButton(Cz);function kz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/gitlab.svg`,alt:"Sign in with GitLab",style:{width:24,height:24}})}const Iz={text:"Sign in with GitLab",icon:kz,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(255,255,255)",color:"#000000"},activeStyle:{background:"rgb(100,150,250)"}},Tz=er.createButton(Iz);function Bz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/adfs.svg`,alt:"Sign in with ADFS",style:{width:24,height:24}})}const Pz={text:"Sign in with ADFS",icon:Bz,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},Oz=er.createButton(Pz);function Mz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/casdoor.svg`,alt:"Sign in with Casdoor",style:{width:24,height:24}})}const Lz={text:"Sign in with Casdoor",icon:Mz,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},Rz=er.createButton(Lz);function jz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/baidu.svg`,alt:"Sign in with Baidu",style:{width:24,height:24}})}const Nz={text:"Sign in with Baidu",icon:jz,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},$z=er.createButton(Nz);function Fz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/alipay.svg`,alt:"Sign in with Alipay",style:{width:24,height:24}})}const Dz={text:"Sign in with Alipay",icon:Fz,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},Uz=er.createButton(Dz);function Hz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/infoflow.svg`,alt:"Sign in with Infoflow",style:{width:24,height:24}})}const zz={text:"Sign in with Infoflow",icon:Hz,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},Gz=er.createButton(zz);function Vz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/apple.svg`,alt:"Sign in with Apple",style:{width:24,height:24}})}const Wz={text:"Sign in with Apple",icon:Vz,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},qz=er.createButton(Wz);function Zz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/azuread.svg`,alt:"Sign in with Azure AD",style:{width:24,height:24}})}const Qz={text:"Sign in with Azure AD",icon:Zz,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},Kz=er.createButton(Qz);function Yz({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/azuread.svg`,alt:"Sign in with Azure AD B2C",style:{width:24,height:24}})}const Jz={text:"Sign in with Azure AD B2C",icon:Yz,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},Xz=er.createButton(Jz);function eG({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/slack.svg`,alt:"Sign in with Slack",style:{width:24,height:24}})}const tG={text:"Sign in with Slack",icon:eG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},nG=er.createButton(tG);function rG({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/steam.svg`,alt:"Sign in with Steam",style:{width:24,height:24}})}const iG={text:"Sign in with Steam",icon:rG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},oG=er.createButton(iG);function sG({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/bilibili.svg`,alt:"Sign in with Bilibili"})}const aG={text:"Sign in with Bilibili",icon:sG,iconFormat:e=>`fa fa-${e}`,style:{background:"#0191e0"},activeStyle:{background:"rgb(76,143,208)"}},cG=er.createButton(aG);function lG({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/okta.svg`,alt:"Sign in with Okta",style:{width:24,height:24}})}const uG={text:"Sign in with Okta",icon:lG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},fG=er.createButton(uG);function dG({width:e=24,height:t=24,color:n}){return _e.jsx("img",{src:`${Xe}/buttons/douyin.svg`,alt:"Sign in with Douyin",style:{width:24,height:24}})}const hG={text:"Sign in with Douyin",icon:dG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},pG=er.createButton(hG);function mG({type:e,logoUrl:t,align:n="center",style:r={background:"#ffffff",color:"#000000"},activeStyle:i={background:"#ededee"}}){function o({width:l=24,height:f=24,color:u}){return _e.jsx("img",{src:t,alt:`Sign in with ${e}`,style:{width:l,height:f}})}const s={text:`Sign in with ${e}`,icon:o,style:r,activeStyle:i},a=er.createButton(s),c=no.t("login:Sign in with {type}").replace("{type}",e);return _e.jsx(a,{text:c,align:n})}function y3(e){const t=no.t("login:Sign in with {type}").replace("{type}",e.displayName!==""?e.displayName:e.type);return e.type==="GitHub"?_e.jsx(er.GithubLoginButton,{text:t,align:"center"}):e.type==="Google"?_e.jsx(er.GoogleLoginButton,{text:t,align:"center"}):e.type==="QQ"?_e.jsx(nz,{text:t,align:"center"}):e.type==="Facebook"?_e.jsx(oz,{text:t,align:"center"}):e.type==="Weibo"?_e.jsx(cz,{text:t,align:"center"}):e.type==="Gitee"?_e.jsx(fz,{text:t,align:"center"}):e.type==="WeChat"?_e.jsx(pz,{text:t,align:"center"}):e.type==="DingTalk"?_e.jsx(bz,{text:t,align:"center"}):e.type==="LinkedIn"?_e.jsx(vz,{text:t,align:"center"}):e.type==="WeCom"?_e.jsx(_z,{text:t,align:"center"}):e.type==="Lark"?_e.jsx(Sz,{text:t,align:"center"}):e.type==="GitLab"?_e.jsx(Tz,{text:t,align:"center"}):e.type==="ADFS"?_e.jsx(Oz,{text:t,align:"center"}):e.type==="Casdoor"?_e.jsx(Rz,{text:t,align:"center"}):e.type==="Baidu"?_e.jsx($z,{text:t,align:"center"}):e.type==="Alipay"?_e.jsx(Uz,{text:t,align:"center"}):e.type==="Infoflow"?_e.jsx(Gz,{text:t,align:"center"}):e.type==="Apple"?_e.jsx(qz,{text:t,align:"center"}):e.type==="AzureAD"?_e.jsx(Kz,{text:t,align:"center"}):e.type==="AzureADB2C"?_e.jsx(Xz,{text:t,align:"center"}):e.type==="Slack"?_e.jsx(nG,{text:t,align:"center"}):e.type==="Steam"?_e.jsx(oG,{text:t,align:"center"}):e.type==="Bilibili"?_e.jsx(cG,{text:t,align:"center"}):e.type==="Okta"?_e.jsx(fG,{text:t,align:"center"}):e.type==="Douyin"?_e.jsx(pG,{text:t,align:"center"}):_e.jsx(mG,{type:e.type,logoUrl:nl(e)},e.type)}function w3(e,t){const n=new URLSearchParams(t.search),r=n.get("client_id")??"",i=n.get("state"),o=n.get("redirect_uri"),s=`${window.location.origin}/callback/saml`,a=e.name,c=`${r}&${i}&${a}&${o}&${s}`;xU(`${e.owner}/${a}`,btoa(c)).then(l=>{l.data2==="POST"?document.write(l.data):window.location.href=l.data})}function _v(e,t,n){t.type==="MetaMask"?Promise.resolve().then(()=>hP).then(r=>{const i=r.authViaMetaMask;i(e,t,n)}):t.type==="Web3Onboard"&&Promise.resolve().then(()=>hP).then(r=>{const i=r.authViaWeb3Onboard;i(e,t,n)})}function gG(e,t,n,r,i,o){if(i==="small"){if(e.category==="OAuth")return e.type==="WeChat"&&e.clientId2!==""&&e.clientSecret2!==""&&e.disableSsl===!0&&!navigator.userAgent.includes("MicroMessenger")?_e.jsx("a",{children:_e.jsx("img",{width:n,height:n,src:nl(e),alt:e.displayName,className:"provider-img",style:{margin:r},onClick:()=>{kU(t,e,"signup")}})},e.displayName):_e.jsx("a",{href:(void 0)(t,e,"signup"),children:_e.jsx("img",{width:n,height:n,src:nl(e),alt:e.displayName,className:"provider-img",style:{margin:r}})},e.displayName);if(e.category==="SAML")return _e.jsx("a",{onClick:()=>w3(e,o),children:_e.jsx("img",{width:n,height:n,src:nl(e),alt:e.displayName,className:"provider-img",style:{margin:r}})},e.displayName);if(e.category==="Web3")return _e.jsx("a",{onClick:()=>_v(t,e,"signup"),children:_e.jsx("img",{width:n,height:n,src:nl(e),alt:e.displayName,className:"provider-img",style:{margin:r}})},e.displayName)}else if(e.type==="Custom"){const s=no.t("login:Sign in with {type}").replace("{type}",e.displayName),a={display:"block",height:"55px",color:"#000"},c={display:"flex",alignItems:"center",width:"calc(100% - 10px)",height:"50px",margin:"5px",padding:"0 10px",backgroundColor:"transparent",boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",border:"0px",borderRadius:"3px",cursor:"pointer"},l={justfyContent:"space-between"},f={textAlign:"center",width:"100%",fontSize:"19px"};if(e.category==="OAuth")return _e.jsx("a",{href:(void 0)(t,e,"signup"),style:a,children:_e.jsxs("div",{style:c,children:[_e.jsx("img",{width:26,src:nl(e),alt:e.displayName,className:"provider-img",style:l}),_e.jsx("span",{style:f,children:s})]})},e.displayName);if(e.category==="SAML")return _e.jsx("a",{onClick:()=>w3(e,o),style:a,children:_e.jsxs("div",{style:c,children:[_e.jsx("img",{width:26,src:nl(e),alt:e.displayName,className:"provider-img",style:l}),_e.jsx("span",{style:f,children:s})]})},e.displayName)}else return e.category==="SAML"?_e.jsx("div",{className:"provider-big-img",children:_e.jsx("a",{onClick:()=>w3(e,o),children:y3(e)})},e.displayName):e.category==="Web3"?_e.jsx("div",{className:"provider-big-img",children:_e.jsx("a",{onClick:()=>_v(t,e,"signup"),children:y3(e)})},e.displayName):_e.jsx("div",{className:"provider-big-img",children:_e.jsx("a",{href:(void 0)(t,e,"signup"),children:y3(e)})},e.displayName)}function bG(e){return e.length<6?no.t("user:The password must have at least 6 characters"):""}function yG(e){return e.length<8?no.t("user:The password must have at least 8 characters"):""}function wG(e){return/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9]).+$/.test(e)?"":no.t("user:The password must contain at least one uppercase letter, one lowercase letter and one digit")}function vG(e){return/^(?=.*[!-/:-@[-`{-~]).+$/.test(e)?"":no.t("user:The password must contain at least one special character")}function EG(e){return/(.)\1+/.test(e)?no.t("user:The password must not contain any repeated characters"):""}function xG(e,t){if(e.length===0)return no.t("login:Please input your password!");(!t||t.length===0)&&(t=["AtLeast6"]);const n={AtLeast6:bG,AtLeast8:yG,Aa123:wG,SpecialChar:vG,NoRepeat:EG};for(const r of t){const i=n[r];if(i){const o=i(e);if(o!=="")return o}}return""}function _G({application:e,state:t,setState:n}){const[r,i]=Tt.useState(!1),o=Tt.useRef(null);Tt.useEffect(()=>{o.current||(o.current=document.getElementById("agreementDialog"))},[]),Tt.useEffect(()=>{o.current&&(r?o.current.showModal():o.current.close())},[r]);const s=()=>{n({...t,agreement:!1}),i(!1)},a=()=>{n({...t,agreement:!0}),i(!1)},c=()=>{i(!0)};return _e.jsxs(_e.Fragment,{children:[_e.jsx("dialog",{id:"agreementDialog",className:"modal",children:_e.jsxs("div",{className:"modal-box",children:[_e.jsx("div",{className:"mt-4 mb-8",children:_e.jsx("iframe",{src:e.termsOfUse,width:"100%",height:"300px",sandbox:"allow-scripts"})}),_e.jsxs("div",{className:"modal-action",children:[_e.jsx("form",{method:"dialog",className:"modal-backdrop",children:_e.jsx("button",{children:"Close"})}),_e.jsxs("form",{method:"dialog",className:"flex gap-3",children:[_e.jsx("button",{className:"btn",onClick:s,children:"Cancel"},"closebtn"),_e.jsx("button",{className:"btn btn-primary",onClick:a,children:"OK"},"okbtn")]})]})]})}),_e.jsx("input",{checked:!!t.agreement,type:"checkbox",readOnly:!0}),_e.jsx("button",{onClick:c,children:"Open Terms"})]})}async function AG(e,t,n){const{callbackUrl:r=window.location.href,redirect:i=!0}={},{prefix:o="/api/auth",...s}={},c=e==="email",f=`${`${o}/signin/${e}`}?${new URLSearchParams(n)}`,u=await fetch(`${o}/csrf`),{csrfToken:d}=await u.json(),h=await fetch(f,{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Auth-Return-Redirect":"1"},body:new URLSearchParams({...s,csrfToken:d,callbackUrl:r})}),p=await h.clone().json(),m=new URL(p.url).searchParams.get("error");if(i||!c||!m){window.location.href=p.url??r,p.url.includes("#")&&window.location.reload();return}return h}function es({label:e,name:t,rules:n,inputEl:r,setFieldValue:i,onChange:o,...s}){return _e.jsxs("label",{className:"form-control w-full max-w-xs",htmlFor:t,children:[_e.jsx("div",{className:"label",children:_e.jsx("span",{className:"label-text",children:e})}),r||_e.jsx("input",{type:"text",...s,name:t,className:"input input-bordered w-full max-w-xs",onChange:a=>{i(t,a.target.value),o==null||o(a)}}),_e.jsx("div",{className:"label flex-col",children:n==null?void 0:n.map((a,c)=>_e.jsx("span",{className:"label-text-alt",children:a.message},t+c))})]})}const CG=(e,t)=>(delete e.applicationName,delete e.emailOrPhoneMode,delete e.isTermsOfUseVisible,{application:t.name,organization:t.organization,plan:null,pricing:null,...e}),SG=(e,t,n)=>{e.preventDefault();const r=CG(t,n);console.log(r),wU(r).then(i=>{i.status==="ok"?(r.username=i.data.split("/")[1],n&&gU(n)?yU("").then(o=>{let s=null;o.status==="ok"?(s=o.data,s.organization=o.data2,console.log("account",s),alert("redirect")):ji("error",`Failed to sign in: ${o.msg}`)}):(alert("redirect"),AG())):ji("error",i.msg)})};function kG(e,t,n,r,i){if(!t.visible)return null;const o=(a,c)=>{n[a]=c,r(n)},s=t.required;if(t.name==="Username")return _e.jsx(es,{name:"username",className:"signup-username",label:t.label?t.label:i("signup.username"),rules:[{required:s,message:i("forget.username"),whitespace:!0}],placeholder:t.placeholder,disabled:n.invitation!==void 0&&n.invitation.username!=="",setFieldValue:o});if(t.name==="Display name")return t.rule==="First, last"&&oU()!=="zh"?_e.jsxs(Tt.Fragment,{children:[_e.jsx(es,{name:"firstName",className:"signup-first-name",label:t.label?t.label:i("general.firstName"),rules:[{required:s,message:i("forget.firstName"),whitespace:!0}],placeholder:t.placeholder,setFieldValue:o}),_e.jsx(es,{name:"lastName",className:"signup-last-name",label:t.label?t.label:i("general.lastName"),rules:[{required:s,message:i("forget.lastName"),whitespace:!0}],placeholder:t.placeholder,setFieldValue:o})]}):_e.jsx(es,{name:"name",className:"signup-name",label:t.label?t.label:t.rule==="Real name"||t.rule==="First, last"?i("general.realName"):i("general.displayName"),rules:[{required:s,message:t.rule==="Real name"||t.rule==="First, last"?i("forget.realName"):i("forget.displayName"),whitespace:!0}],placeholder:t.placeholder,setFieldValue:o});if(t.name==="Affiliation")return _e.jsx(es,{name:"affiliation",className:"signup-affiliation",label:t.label?t.label:i("user.affiliation"),rules:[{required:s,message:i("forget.affiliation"),whitespace:!0}],placeholder:t.placeholder,setFieldValue:o});if(t.name==="ID card")return _e.jsx(es,{name:"idCard",className:"signup-idcard",label:t.label?t.label:i("user.idCard"),rules:[{required:s,message:i("forget.idCard"),whitespace:!0},{required:s,pattern:new RegExp(/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9X]$/,"g"),message:i("format.idCard")}],placeholder:t.placeholder,setFieldValue:o});if(t.name==="Email"||t.name==="Phone"||t.name==="Email or Phone"||t.name==="Phone or Email"){const a=()=>_e.jsxs(Tt.Fragment,{children:[_e.jsx(es,{name:"email",label:t.label?t.label:i("general.email"),rules:[{required:s,message:i("forget.email")}],placeholder:t.placeholder,disabled:n.invitation!==void 0&&n.invitation.email!=="",onChange:l=>{const f=l.target.value;console.log("email",f,X9(f)),f!==""&&!X9(f)?r({...n,email:f,validEmail:!1}):r({...n,email:f,validEmail:!0})},setFieldValue:o}),t.rule!=="No verification"&&_e.jsx(es,{name:"emailCode",className:"signup-email-code",label:t.label?t.label:i("code.email"),rules:[{required:s,message:i("forget.code")}],inputEl:_e.jsx(BU,{disabled:!n.validEmail,method:"signup",onButtonClickArgs:[n.email,"email",e.name],application:e,countryCode:"US",onChange:l=>r({...n,emailCode:l})}),setFieldValue:o})]}),c=()=>_e.jsx(_e.Fragment,{});if(t.name==="Email")return a();if(t.name==="Phone")return c();if(t.name==="Email or Phone"||t.name==="Phone or Email"){let l=n.emailOrPhoneMode;return l===""&&(l=t.name==="Email or Phone"?"Email":"Phone"),_e.jsxs(Tt.Fragment,{children:[_e.jsx("div",{style:{marginTop:"30px",marginBottom:"20px"}}),l==="Email"?a():c()]})}else return null}else{if(t.name==="Password")return _e.jsx(es,{name:"password",className:"signup-password",label:t.label?t.label:i("general.password"),rules:[{required:s,validateTrigger:"onChange",validator:(a,c)=>{const l=xG(c,e.organizationObj.passwordOptions);return l===""?Promise.resolve():Promise.reject(l)}}],setFieldValue:o,type:"password",placeholder:t.placeholder});if(t.name==="Confirm password")return _e.jsx(es,{name:"confirm",className:"signup-confirm",label:t.label?t.label:i("signup.confirm"),rules:[{required:s,message:i("forget.confirm")}],type:"password",placeholder:t.placeholder,setFieldValue:o});if(t.name==="Invitation code")return _e.jsx(es,{name:"invitationCode",className:"signup-invitation-code",label:t.label?t.label:i("application.invitationCode"),rules:[{required:s,message:i("forget.invitationCode")}],placeholder:t.placeholder,disabled:n.invitation!==void 0&&n.invitation!=="",setFieldValue:o});if(t.name==="Agreement")return _e.jsx(_G,{state:n,setState:r,application:e});if(t.name.startsWith("Text "))return _e.jsx("div",{dangerouslySetInnerHTML:{__html:t.label}});if(t.name==="Signup button")return _e.jsxs("form",{onSubmit:a=>SG(a,n,e),children:[_e.jsx("button",{className:"btn btn-primary",type:"submit",children:i("signup.signUp")}),"  ",i("signup.haveAccount")," ",_e.jsx("a",{className:"signup-link",onClick:()=>{const a=sessionStorage.getItem("signinUrl");alert("redirect")},children:i("signup.signInNow")})]});if(t.name==="Providers"&&e.providers){const a=dU(e)||hU(e)||pU(e)||mU(e);return(t.rule==="None"||t.rule==="")&&(t.rule=a?"small":"big"),e.providers.filter(c=>J9(c)).map(c=>gG(c.provider,e,null,null,t.rule,{search:window.location.search}))}}return t.name}const IG={translation:{signup:{username:"Username",confirm:"Confirm password",signInNow:"Sign In Now",signUp:"Sign Up",haveAccount:"Have account?"},forget:{username:"Please input your username.",firstName:"Please input your first name.",lastName:"Please input your last name.",realName:"Please input your real name.",displayName:"Please input your display name.",affliation:"Please input your affliation.",idCard:"Please input your ID card number.",code:"Please input your verification code.",email:"Please input your email.",confirm:"Please confirm your password and ensure it matches.",invitationCode:"Please input your invitation code."},format:{idCard:"The ID card number format is incorrect."},general:{firstName:"First name",lastName:"Last name",displayName:"Display name",realName:"Real name",email:"Email",password:"Password",captcha:"Captcha"},user:{affliation:"Affliation",idCard:"ID card"},code:{email:"Email code",sending:"Sending",sendCode:"Send code"},application:{invitationCode:"Invitation code"}}};no.use(su.initReactI18next).init({lng:"en",fallbackLng:"en",resources:{en:IG}});function TG(e,t,n){const r=_e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-eye",children:[_e.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),_e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),i=_e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-eye-off",children:[_e.jsx("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),_e.jsx("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),_e.jsx("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),_e.jsx("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]}),o=mh(e),s=la(e);if(o==="password"){const a=t.password.state[s];return _e.jsxs(n,{variant:"ghost",size:"icon",className:"absolute top-1/2 right-2 -translate-y-1/2",onClick:c=>{c.preventDefault(),c.stopPropagation(),t.password.setState({...t.password.state,[s]:!a})},children:[a?i:r,_e.jsx("span",{className:"sr-only",children:"Toggle password visibility"})]})}else return null}function la(e){const t={ID:"id",Username:"username","Display name":"name",Affiliation:"affiliation","ID card":"idCard",Email:"email",Phone:"phone",Password:"password","Confirm password":"confirm","Invitation code":"invitationCode","Country/Region":"country_region",Agreement:"agreement"};return Object.keys(t).includes(e.name)?t[e.name]:e.name}function mh(e,t){const n=["password","confirm"],r=la(e);return n.includes(r)&&!(t!=null&&t.hidePassword[r])?"password":"text"}function BG(e){return Object.fromEntries(e.filter(t=>mh(t)==="password").map(t=>[la(t),!1]))}function PG(e){return{name:la(e),label:e.label||e.name,placeholder:e.placeholder,required:e.required,type:mh(e)}}function OG(e,t){const n=la(t);let r=e.string();return n==="email"&&(r=r.email()),t.required||(r=r.optional()),r}function MG(e){const t=e.map(r=>[la(r),""]),n=e.filter(r=>Av(r)).map(r=>[la(r)+"Code",""]);return Object.fromEntries([...t,...n])}function Av(e){const t=la(e);return(t==="email"||t==="phone")&&!["None","No verification"].includes(e.rule)}function LG(e){return e.visible===!0}function RG(e){var u;const{t,i18n:n}=su.useTranslation(),[r,i]=Tt.useState({applicationName:e.applicationName??null,email:"",phone:"",emailOrPhoneMode:"",countryCode:"",emailCode:"",phoneCode:"",validEmail:!1,validPhone:!1,region:"",isTermsOfUseVisible:!1,termsOfUseContent:""});Tt.useRef();const o=d=>{d!==void 0&&u3("admin",d).then(h=>{if(h.status==="error"){ji("error",h.msg);return}l(h.data)})},s=d=>{ev(d).then(h=>{if(h.status==="ok"){const p=h.data;l(p)}else l(null),i({...r,msg:h.msg})})},a=()=>e.application,c=(d,h)=>{nv(d,h).then(p=>{if(p.status==="error"){ji("error",p.msg);return}i({...r,invitation:p.data})})},l=d=>{e.onUpdateApplication(d)};Tt.useEffect(()=>{const d=tv();if(d!==null){const h=window.location.pathname.replace("/signup/oauth/authorize","/login/oauth/authorize");sessionStorage.setItem("signinUrl",h+window.location.search)}if(a()===void 0)if(r.applicationName!==null){o(r.applicationName);const h=new URLSearchParams(window.location.search);if(h.has("invitationCode")){const p=h.get("invitationCode")??"";i({...r,invitationCode:p}),p!==""&&c(p,"admin/"+r.applicationName)}}else d!==null?s(d):(ji("error",`Unknown application name: ${r.applicationName}`),l(null))},[]);const f=a();return f==null?null:(u=f.signupItems)==null?void 0:u.map((d,h)=>_e.jsx("div",{children:kG(f,d,r,i,t)},h))}function jG({applicationName:e,casdoorApiRoot:t,springmicroApiRoot:n}){ki.casdoor=t,n&&(ki.springmicro=n);const[r,i]=Tt.useState({application:null}),o=()=>{u3("admin",e).then(s=>{if(console.log(s),s.status==="error"){ji("error",s.msg);return}i({application:s.data})})};return Tt.useEffect(()=>{o()},[]),r.application===void 0?_e.jsx(_e.Fragment,{}):_e.jsx(su.I18nextProvider,{i18n:no,children:_e.jsx(RG,{application:r.application,onUpdateApplication:s=>{i({application:s})}})})}const Cv=Tt.createContext(void 0);function NG({applicationName:e,casdoorApiRoot:t,springmicroApiRoot:n,children:r}){su.useTranslation(),ki.casdoor=t,n&&(ki.springmicro=n);const[i,o]=Tt.useState({application:null}),[s,a]=Tt.useState({}),c=()=>{u3("admin",e).then(b=>{if(console.log(b),b.status==="error"){ji("error",b.msg);return}o({application:b.data})})},l=b=>{o({application:b})},f=(b,g)=>{nv(b,g).then(y=>{if(y.status==="error"){ji("error",y.msg);return}o({...i,invitation:y.data})})},u=b=>{ev(b).then(g=>{if(g.status==="ok"){const y=g.data;l(y)}else l(null),o({...i,msg:g.msg})})},d=(b,g)=>TG(b,{password:{state:s,setState:a}},g),h=b=>mh(b,{hidePassword:s}),p=rv,m=iv;return Tt.useEffect(()=>{c()},[]),Tt.useEffect(()=>{i.application&&a(BG(i.application.signupItems))},[i.application]),Tt.useEffect(()=>{const b=tv();if(b!==null){const g=window.location.pathname.replace("/signup/oauth/authorize","/login/oauth/authorize");sessionStorage.setItem("signinUrl",g+window.location.search)}if(i.application===void 0)if(i.applicationName!==null){c();const g=new URLSearchParams(window.location.search);if(g.has("invitationCode")){const y=g.get("invitationCode")??"";o({...i,invitationCode:y}),y!==""&&f(y,"admin/"+i.applicationName)}}else b!==null?u(b):(ji("error",`Unknown application name: ${i.applicationName}`),l(null))},[]),i.application===void 0||i.application===null?null:_e.jsx(Cv.Provider,{value:{application:i.application,getDefaultValues:MG,getFormProps:PG,icon:d,getZod:OG,getKey:la,type:h,sendCode:p,requiresCode:Av,getCaptcha:m,isVisible:LG},children:r})}const $G=()=>{const e=Tt.useContext(Cv);if(!e)throw new Error("useSignUp must be used within a SignUpProvider");return e};let gh;const FG=new Uint8Array(16);function DG(){if(!gh&&(gh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gh(FG)}const bi=[];for(let e=0;e<256;++e)bi.push((e+256).toString(16).slice(1));function UG(e,t=0){return bi[e[t+0]]+bi[e[t+1]]+bi[e[t+2]]+bi[e[t+3]]+"-"+bi[e[t+4]]+bi[e[t+5]]+"-"+bi[e[t+6]]+bi[e[t+7]]+"-"+bi[e[t+8]]+bi[e[t+9]]+"-"+bi[e[t+10]]+bi[e[t+11]]+bi[e[t+12]]+bi[e[t+13]]+bi[e[t+14]]+bi[e[t+15]]}const Sv={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function HG(e,t,n){if(Sv.randomUUID&&!t&&!e)return Sv.randomUUID();e=e||{};const r=e.random||(e.rng||DG)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,UG(r)}var v3={},ec={},bh={},yh={},il={},wh={};wh.byteLength=VG,wh.toByteArray=qG,wh.fromByteArray=KG;for(var xs=[],ko=[],zG=typeof Uint8Array<"u"?Uint8Array:Array,E3="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cu=0,GG=E3.length;cu<GG;++cu)xs[cu]=E3[cu],ko[E3.charCodeAt(cu)]=cu;ko[45]=62,ko[95]=63;function kv(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function VG(e){var t=kv(e),n=t[0],r=t[1];return(n+r)*3/4-r}function WG(e,t,n){return(t+n)*3/4-n}function qG(e){var t,n=kv(e),r=n[0],i=n[1],o=new zG(WG(e,r,i)),s=0,a=i>0?r-4:r,c;for(c=0;c<a;c+=4)t=ko[e.charCodeAt(c)]<<18|ko[e.charCodeAt(c+1)]<<12|ko[e.charCodeAt(c+2)]<<6|ko[e.charCodeAt(c+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=t&255;return i===2&&(t=ko[e.charCodeAt(c)]<<2|ko[e.charCodeAt(c+1)]>>4,o[s++]=t&255),i===1&&(t=ko[e.charCodeAt(c)]<<10|ko[e.charCodeAt(c+1)]<<4|ko[e.charCodeAt(c+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255),o}function ZG(e){return xs[e>>18&63]+xs[e>>12&63]+xs[e>>6&63]+xs[e&63]}function QG(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),i.push(ZG(r));return i.join("")}function KG(e){for(var t,n=e.length,r=n%3,i=[],o=16383,s=0,a=n-r;s<a;s+=o)i.push(QG(e,s,s+o>a?a:s+o));return r===1?(t=e[n-1],i.push(xs[t>>2]+xs[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(xs[t>>10]+xs[t>>4&63]+xs[t<<2&63]+"=")),i.join("")}var x3={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */x3.read=function(e,t,n,r,i){var o,s,a=i*8-r-1,c=(1<<a)-1,l=c>>1,f=-7,u=n?i-1:0,d=n?-1:1,h=e[t+u];for(u+=d,o=h&(1<<-f)-1,h>>=-f,f+=a;f>0;o=o*256+e[t+u],u+=d,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=s*256+e[t+u],u+=d,f-=8);if(o===0)o=1-l;else{if(o===c)return s?NaN:(h?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-l}return(h?-1:1)*s*Math.pow(2,o-r)},x3.write=function(e,t,n,r,i,o){var s,a,c,l=o*8-i-1,f=(1<<l)-1,u=f>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+u>=1?t+=d/c:t+=d*Math.pow(2,1-u),t*c>=2&&(s++,c/=2),s+u>=f?(a=0,s=f):s+u>=1?(a=(t*c-1)*Math.pow(2,i),s=s+u):(a=t*Math.pow(2,u-1)*Math.pow(2,i),s=0));i>=8;e[n+h]=a&255,h+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[n+h]=s&255,h+=p,s/=256,l-=8);e[n+h-p]|=m*128};/*!
59
59
  * The buffer module from node.js, for the browser.
60
60
  *
61
61
  * @author Feross Aboukhadijeh <https://feross.org>
@@ -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-hzrmIcT1.js";
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-ChSAJPxI.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.5.8",
3
+ "version": "0.5.10",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -16,7 +16,6 @@
16
16
  "preview": "vite preview"
17
17
  },
18
18
  "peerDependencies": {
19
- "auth-astro": "^4.1.0",
20
19
  "react": "^18.0.0",
21
20
  "react-dom": "^18.0.0"
22
21
  },
@@ -54,5 +53,5 @@
54
53
  "react-social-login-buttons": "^4.1.0",
55
54
  "uuid": "^9.0.1"
56
55
  },
57
- "gitHead": "893349375763235632effda60aa0c1e20b78ba12"
56
+ "gitHead": "5452992c33d3a01f1ae831eba4f288e4bc91ad14"
58
57
  }
@@ -166,7 +166,10 @@ export function getDefaultValues(signupItems: SignupItem[]) {
166
166
 
167
167
  export function requiresCode(signupItem: SignupItem) {
168
168
  const key = getKey(signupItem);
169
- return (key === "email" || key === "phone") && signupItem.rule !== "None";
169
+ return (
170
+ (key === "email" || key === "phone") &&
171
+ !["None", "No verification"].includes(signupItem.rule)
172
+ );
170
173
  }
171
174
 
172
175
  export function isVisible(signupItem: SignupItem) {