@springmicro/auth 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +18 -18
- package/README.md +60 -60
- package/dist/{Index-64ac63ff-vb_yo1iM.js → Index-64ac63ff-BZqOq8A-.js} +1 -1
- package/dist/{Index-6c094240-BoxR5zsn.js → Index-6c094240-MY1bN_-H.js} +1 -1
- package/dist/{Web3Auth-DtI3oRQ3.js → Web3Auth-BZvmXZfr.js} +10 -10
- package/dist/alphawallet-B7eovdf-.js +0 -0
- package/dist/apexwallet-ysP20G9D.js +0 -0
- package/dist/atoken-BBnNTzcz.js +0 -0
- package/dist/bifrostwallet-CNNBO92h.js +0 -0
- package/dist/binance-DvPgAzCw.js +0 -0
- package/dist/bitget-DZOUrwgy.js +0 -0
- package/dist/bitpie-C_uxmEzw.js +0 -0
- package/dist/bitski-DpzkHNkv.js +0 -0
- package/dist/blockwallet-BL69cqkA.js +0 -0
- package/dist/brave-DnRzMQYW.js +0 -0
- package/dist/ccip-c78d2f16-DLcRlwod.js +0 -0
- package/dist/coin98wallet-CkFdOvXt.js +0 -0
- package/dist/coinbase-CaGNx5if.js +0 -0
- package/dist/core-9rK8tWud.js +0 -0
- package/dist/defiwallet-0AsgJBSy.js +0 -0
- package/dist/detected-CX_JZaUk.js +0 -0
- package/dist/echooo-CmaetT_Z.js +0 -0
- package/dist/enkrypt-BibtwvK7.js +0 -0
- package/dist/exodus-BxzkDWWP.js +0 -0
- package/dist/fordefi-CvKyVwhI.js +0 -0
- package/dist/foxwallet-D7c_LDTf.js +0 -0
- package/dist/frame-CDfNmjUy.js +0 -0
- package/dist/frontier-DqKNSj2z.js +0 -0
- package/dist/{hashMessage-DCmgnd-x.js → hashMessage-DXQQ5wqb.js} +1 -1
- package/dist/huobiwallet-CxSwqa5L.js +0 -0
- package/dist/hyperpay-nmHE3WqM.js +0 -0
- package/dist/icon-2Zqy7pqQ.js +0 -0
- package/dist/icon-CGWI1Ies.js +0 -0
- package/dist/icon-C_O4nprO.js +0 -0
- package/dist/icon-DbgmZCnU.js +0 -0
- package/dist/icon-Dbjb6jc5.js +0 -0
- package/dist/icon-cAd7RhSC.js +0 -0
- package/dist/imtoken-yENtOTS3.js +0 -0
- package/dist/index-021f6a62-Zz543EDB.js +0 -0
- package/dist/index-40a497ea-Bn2mC0r7.js +0 -0
- package/dist/{index-DaoGTpZx.js → index-BMS1BfQU.js} +4 -4
- package/dist/{index-CRVK3Pq6.js → index-BcAl576H.js} +1 -1
- package/dist/{index-CxmovbaE.js → index-BwFS5ERT.js} +1 -1
- package/dist/{index-opG_F1g6.js → index-CHbx8A-C.js} +2 -2
- package/dist/{index-DEZkLpuR.js → index-CPg63-IP.js} +3 -3
- package/dist/{index-Cjw60RFG.js → index-D1pMMcC-.js} +1 -1
- package/dist/{index-C621Bj_G.js → index-wK6pELVV.js} +2 -2
- package/dist/index.d.ts +0 -0
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/infinitywallet-C8J4FUYw.js +0 -0
- package/dist/kayros-AIrUK1za.js +0 -0
- package/dist/keplr-CyLTca9B.js +0 -0
- package/dist/lif3wallet-C5D6r8pg.js +0 -0
- package/dist/liquality-nbCtErVq.js +0 -0
- package/dist/mathwallet-CWkivCXo.js +0 -0
- package/dist/meetone-kKmvI8md.js +0 -0
- package/dist/metamask-BN7yiDV1.js +0 -0
- package/dist/mykey-CQZ6UcLH.js +0 -0
- package/dist/native-FDN9oNjc.js +0 -0
- package/dist/{number-BE79AmF4.js → number-D6mr0b-k.js} +1 -1
- package/dist/okxwallet-CJLVogh2.js +0 -0
- package/dist/oneInch-CciyZ4Pz.js +0 -0
- package/dist/onekey-Dal8kYjU.js +0 -0
- package/dist/opera-DnKg-TJU.js +0 -0
- package/dist/ownbit-BshJUVuW.js +0 -0
- package/dist/phantom-CJ8dIcov.js +0 -0
- package/dist/rabby-D4thTcd6.js +0 -0
- package/dist/rainbow-mXld6yWV.js +0 -0
- package/dist/roninwallet-ZyYrd-D1.js +0 -0
- package/dist/safeheron-Eg1Jb29V.js +0 -0
- package/dist/safepal-DVIKy94N.js +0 -0
- package/dist/sequence-BS2IbtDg.js +0 -0
- package/dist/stablewallet-jyB079Wb.js +0 -0
- package/dist/status-FrAvQjfn.js +0 -0
- package/dist/subwallet-DMvFqKyY.js +0 -0
- package/dist/talisman-Bp8zUXqB.js +0 -0
- package/dist/tallywallet-B4OS9nIr.js +0 -0
- package/dist/tokenary-C7jjcbQa.js +0 -0
- package/dist/tokenpocket-9ZRPmAFA.js +0 -0
- package/dist/tp-V2em5bdl.js +0 -0
- package/dist/transactionRequest-be6a8ea9-CUKWo5mx.js +0 -0
- package/dist/trust-SgHubMq7.js +0 -0
- package/dist/xdefi-COVIyGz4.js +0 -0
- package/dist/zeal-DxHbDqm0.js +0 -0
- package/dist/zerion-BfW0UElc.js +0 -0
- package/dist/zodiacpilot-CrId6F4w.js +0 -0
- package/index.html +13 -13
- package/package.json +2 -2
- package/springmicro-auth-0.6.1.tgz +0 -0
- package/src/auth/config.ts +0 -0
- package/src/components/SignUp.tsx +0 -0
- package/src/components/forms/AgreementModal.tsx +88 -88
- package/src/components/forms/CaptchaController.tsx +94 -94
- package/src/components/forms/CaptchaModal.jsx +171 -171
- package/src/components/forms/CaptchaWidget.jsx +146 -146
- package/src/components/forms/PasswordChecker.ts +88 -88
- package/src/components/forms/SendCodeInput.tsx +0 -0
- package/src/components/forms/SignUpFormItem.tsx +0 -0
- package/src/components/forms/util/application-api.ts +0 -0
- package/src/components/forms/util/auth-api.ts +198 -198
- package/src/components/forms/util/auth-util.tsx +346 -346
- package/src/components/forms/util/core.ts +493 -493
- package/src/components/forms/util/invitation-api.ts +132 -132
- package/src/components/forms/util/provider.tsx +603 -603
- package/src/components/forms/util/user-api.ts +0 -0
- package/src/components/provider/AdfsLoginButton.jsx +38 -38
- package/src/components/provider/AlipayLoginButton.jsx +38 -38
- package/src/components/provider/AppleLoginButton.jsx +38 -38
- package/src/components/provider/AzureADB2CLoginButton.jsx +38 -38
- package/src/components/provider/AzureADLoginButton.jsx +38 -38
- package/src/components/provider/BaiduLoginButton.jsx +38 -38
- package/src/components/provider/BilibiliLoginButton.jsx +37 -37
- package/src/components/provider/CasdoorLoginButton.jsx +38 -38
- package/src/components/provider/DingTalkLoginButton.jsx +37 -37
- package/src/components/provider/DouyinLoginButton.jsx +38 -38
- package/src/components/provider/FacebookLoginButton.jsx +37 -37
- package/src/components/provider/GitHubLoginButton.jsx +37 -37
- package/src/components/provider/GitLabLoginButton.jsx +38 -38
- package/src/components/provider/GiteeLoginButton.jsx +34 -34
- package/src/components/provider/GoogleLoginButton.jsx +68 -68
- package/src/components/provider/InfoflowLoginButton.jsx +38 -38
- package/src/components/provider/LarkLoginButton.jsx +38 -38
- package/src/components/provider/LinkedInLoginButton.jsx +37 -37
- package/src/components/provider/LoginButton.jsx +33 -33
- package/src/components/provider/OktaLoginButton.jsx +38 -38
- package/src/components/provider/Provider.jsx +3 -3
- package/src/components/provider/ProviderButton.jsx +327 -327
- package/src/components/provider/QqLoginButton.jsx +31 -31
- package/src/components/provider/SelfLoginButton.jsx +47 -47
- package/src/components/provider/SlackLoginButton.jsx +38 -38
- package/src/components/provider/SteamLoginButton.jsx +38 -38
- package/src/components/provider/WeComLoginButton.jsx +34 -34
- package/src/components/provider/Web3Auth.jsx +365 -365
- package/src/components/provider/WechatLoginButton.jsx +37 -37
- package/src/components/provider/WeiboLoginButton.jsx +34 -34
- package/src/components/util.tsx +1 -1
- package/src/i18n/en/signup.json +48 -48
- package/src/i18n/index.ts +17 -17
- package/src/index.tsx +0 -0
- package/src/vite-env.d.ts +1 -1
- package/tsconfig.json +23 -23
- package/tsconfig.node.json +10 -10
- package/vite.config.ts +33 -33
package/dist/index.umd.cjs
CHANGED
|
@@ -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 Kv=fr(xt),Dz={activeStyle:{background:"#008FF3"},icon:Hz,style:{background:"#0573ff"},text:"Log in with Zalo"},Uz=Lr(Dz);function Hz({size:e,color:t}){return Kv.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24"},Kv.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(xt),zz={activeStyle:{background:"#333333"},icon:Vz,style:{background:"#000000",color:"#FFFFFF"},text:"Log in with TikTok"},Gz=Lr(zz);function Vz({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 ms=fr(xt),Wz={activeStyle:{background:"#eeeeee"},icon:Zz,style:{background:"#ffffff",color:"#333333"},text:"Log in with Metamask"},qz=Lr(Wz);function Zz({size:e}){return ms.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"},ms.default.createElement("path",{fill:"#e2761b",stroke:"#e2761b",strokeLinecap:"round",strokeLinejoin:"round",d:"M274.1 35.5l-99.5 73.9L193 65.8z"}),ms.default.createElement("path",Ti({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"},Jv)),ms.default.createElement("path",Ti({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"},Jv)),ms.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"}),ms.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"}),ms.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"}),ms.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"}),ms.default.createElement("path",Ti({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"},Xv)),ms.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"}),ms.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"}),ms.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"}),ms.default.createElement("path",Ti({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"},Xv)))}var Jv={fill:"#e4761b",stroke:"#e4761b",strokeLinecap:"round",strokeLinejoin:"round"},Xv={fill:"#f6851b",stroke:"#f6851b",strokeLinecap:"round",strokeLinejoin:"round"},eE=fr(xt),Qz={icon:Yz,style:{background:"#fc6d26"},activeStyle:{background:"#d55a1c"},text:"Log in with Gitlab"},Kz=Lr(Qz);function Yz({size:e,color:t}){return eE.default.createElement("svg",{fill:t,role:"img",viewBox:"0 0 24 24",width:e,height:e,xmlns:"http://www.w3.org/2000/svg"},eE.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 tE=fr(xt),Jz={activeStyle:{background:"#282e36"},icon:eG,style:{background:"#0f1419"},text:"Log in with X"},Xz=Lr(Jz);function eG({size:e,color:t}){return tE.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24"},tE.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 tG({width:e=24,height:t=24,color:n}){return Ae.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",height:"48",width:"32",viewBox:"-18.15 -35.9725 157.3 215.835",children:[Ae.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"}),Ae.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"}),Ae.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"}),Ae.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"}),Ae.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"}),Ae.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"}),Ae.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"}),Ae.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 nG={text:"Sign in with QQ",icon:tG,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(94,188,249)"},activeStyle:{background:"rgb(76,143,208)"}},rG=er.createButton(nG);function iG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/facebook.svg`,alt:"Sign in with Facebook"})}const sG={text:"Sign in with Facebook",icon:iG,iconFormat:e=>`fa fa-${e}`,style:{background:"#3b5998"},activeStyle:{background:"#2b3f65"}},oG=er.createButton(sG);function aG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/weibo.svg`,alt:"Sign in with Weibo"})}const cG={text:"Sign in with Weibo",icon:aG,iconFormat:e=>`fa fa-${e}`,style:{background:"#e62329"},activeStyle:{background:"#e54329"}},lG=er.createButton(cG);function uG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/gitee.svg`,alt:"Sign in with Gitee"})}const fG={text:"Sign in with Gitee",icon:uG,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(199,29,35)"},activeStyle:{background:"rgb(147,22,26)"}},dG=er.createButton(fG);function hG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/wechat.svg`,alt:"Sign in with Wechat"})}const pG={text:"Sign in with Wechat",icon:hG,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(0,194,80)"},activeStyle:{background:"rgb(0,158,64)"}},mG=er.createButton(pG);function gG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/dingtalk.svg`,alt:"Sign in with DingTalk"})}const bG={text:"Sign in with DingTalk",icon:gG,iconFormat:e=>`fa fa-${e}`,style:{background:"#0191e0"},activeStyle:{background:"rgb(76,143,208)"}},yG=er.createButton(bG);function wG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/linkedin.svg`,alt:"Sign in with LinkedIn"})}const vG={text:"Sign in with LinkedIn",icon:wG,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(255,255,255)",color:"#000000"},activeStyle:{background:"rgb(240,240,250)"}},EG=er.createButton(vG);function xG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/wecom.svg`,alt:"Sign in with WeCom"})}const AG={text:"Sign in with WeCom",icon:xG,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(255,255,255)",color:"#000000"},activeStyle:{background:"rgb(100,150,250)"}},_G=er.createButton(AG);function CG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/lark.svg`,alt:"Sign in with Lark",style:{width:24,height:24}})}const SG={text:"Sign in with Lark",icon:CG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},kG=er.createButton(SG);function IG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/gitlab.svg`,alt:"Sign in with GitLab",style:{width:24,height:24}})}const TG={text:"Sign in with GitLab",icon:IG,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(255,255,255)",color:"#000000"},activeStyle:{background:"rgb(100,150,250)"}},BG=er.createButton(TG);function PG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/adfs.svg`,alt:"Sign in with ADFS",style:{width:24,height:24}})}const OG={text:"Sign in with ADFS",icon:PG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},MG=er.createButton(OG);function LG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/casdoor.svg`,alt:"Sign in with Casdoor",style:{width:24,height:24}})}const RG={text:"Sign in with Casdoor",icon:LG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},jG=er.createButton(RG);function NG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/baidu.svg`,alt:"Sign in with Baidu",style:{width:24,height:24}})}const $G={text:"Sign in with Baidu",icon:NG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},FG=er.createButton($G);function DG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/alipay.svg`,alt:"Sign in with Alipay",style:{width:24,height:24}})}const UG={text:"Sign in with Alipay",icon:DG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},HG=er.createButton(UG);function zG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/infoflow.svg`,alt:"Sign in with Infoflow",style:{width:24,height:24}})}const GG={text:"Sign in with Infoflow",icon:zG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},VG=er.createButton(GG);function WG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/apple.svg`,alt:"Sign in with Apple",style:{width:24,height:24}})}const qG={text:"Sign in with Apple",icon:WG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},ZG=er.createButton(qG);function QG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/azuread.svg`,alt:"Sign in with Azure AD",style:{width:24,height:24}})}const KG={text:"Sign in with Azure AD",icon:QG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},YG=er.createButton(KG);function JG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/azuread.svg`,alt:"Sign in with Azure AD B2C",style:{width:24,height:24}})}const XG={text:"Sign in with Azure AD B2C",icon:JG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},eV=er.createButton(XG);function tV({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/slack.svg`,alt:"Sign in with Slack",style:{width:24,height:24}})}const nV={text:"Sign in with Slack",icon:tV,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},rV=er.createButton(nV);function iV({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/steam.svg`,alt:"Sign in with Steam",style:{width:24,height:24}})}const sV={text:"Sign in with Steam",icon:iV,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},oV=er.createButton(sV);function aV({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/bilibili.svg`,alt:"Sign in with Bilibili"})}const cV={text:"Sign in with Bilibili",icon:aV,iconFormat:e=>`fa fa-${e}`,style:{background:"#0191e0"},activeStyle:{background:"rgb(76,143,208)"}},lV=er.createButton(cV);function uV({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/okta.svg`,alt:"Sign in with Okta",style:{width:24,height:24}})}const fV={text:"Sign in with Okta",icon:uV,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},dV=er.createButton(fV);function hV({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/douyin.svg`,alt:"Sign in with Douyin",style:{width:24,height:24}})}const pV={text:"Sign in with Douyin",icon:hV,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},mV=er.createButton(pV);function gV({type:e,logoUrl:t,align:n="center",style:r={background:"#ffffff",color:"#000000"},activeStyle:i={background:"#ededee"}}){function s({width:l=24,height:f=24,color:u}){return Ae.jsx("img",{src:t,alt:`Sign in with ${e}`,style:{width:l,height:f}})}const o={text:`Sign in with ${e}`,icon:s,style:r,activeStyle:i},a=er.createButton(o),c=ss.t("login:Sign in with {type}").replace("{type}",e);return Ae.jsx(a,{text:c,align:n})}function M3(e){const t=ss.t("login:Sign in with {type}").replace("{type}",e.displayName!==""?e.displayName:e.type);return e.type==="GitHub"?Ae.jsx(er.GithubLoginButton,{text:t,align:"center"}):e.type==="Google"?Ae.jsx(er.GoogleLoginButton,{text:t,align:"center"}):e.type==="QQ"?Ae.jsx(rG,{text:t,align:"center"}):e.type==="Facebook"?Ae.jsx(oG,{text:t,align:"center"}):e.type==="Weibo"?Ae.jsx(lG,{text:t,align:"center"}):e.type==="Gitee"?Ae.jsx(dG,{text:t,align:"center"}):e.type==="WeChat"?Ae.jsx(mG,{text:t,align:"center"}):e.type==="DingTalk"?Ae.jsx(yG,{text:t,align:"center"}):e.type==="LinkedIn"?Ae.jsx(EG,{text:t,align:"center"}):e.type==="WeCom"?Ae.jsx(_G,{text:t,align:"center"}):e.type==="Lark"?Ae.jsx(kG,{text:t,align:"center"}):e.type==="GitLab"?Ae.jsx(BG,{text:t,align:"center"}):e.type==="ADFS"?Ae.jsx(MG,{text:t,align:"center"}):e.type==="Casdoor"?Ae.jsx(jG,{text:t,align:"center"}):e.type==="Baidu"?Ae.jsx(FG,{text:t,align:"center"}):e.type==="Alipay"?Ae.jsx(HG,{text:t,align:"center"}):e.type==="Infoflow"?Ae.jsx(VG,{text:t,align:"center"}):e.type==="Apple"?Ae.jsx(ZG,{text:t,align:"center"}):e.type==="AzureAD"?Ae.jsx(YG,{text:t,align:"center"}):e.type==="AzureADB2C"?Ae.jsx(eV,{text:t,align:"center"}):e.type==="Slack"?Ae.jsx(rV,{text:t,align:"center"}):e.type==="Steam"?Ae.jsx(oV,{text:t,align:"center"}):e.type==="Bilibili"?Ae.jsx(lV,{text:t,align:"center"}):e.type==="Okta"?Ae.jsx(dV,{text:t,align:"center"}):e.type==="Douyin"?Ae.jsx(mV,{text:t,align:"center"}):Ae.jsx(gV,{type:e.type,logoUrl:pl(e)},e.type)}function L3(e,t){const n=new URLSearchParams(t.search),r=n.get("client_id")??"",i=n.get("state"),s=n.get("redirect_uri"),o=`${window.location.origin}/callback/saml`,a=e.name,c=`${r}&${i}&${a}&${s}&${o}`;AH(`${e.owner}/${a}`,btoa(c)).then(l=>{l.data2==="POST"?document.write(l.data):window.location.href=l.data})}function nE(e,t,n){t.type==="MetaMask"?Promise.resolve().then(()=>WP).then(r=>{const i=r.authViaMetaMask;i(e,t,n)}):t.type==="Web3Onboard"&&Promise.resolve().then(()=>WP).then(r=>{const i=r.authViaWeb3Onboard;i(e,t,n)})}function bV(e,t,n,r,i,s){if(i==="small"){if(e.category==="OAuth")return e.type==="WeChat"&&e.clientId2!==""&&e.clientSecret2!==""&&e.disableSsl===!0&&!navigator.userAgent.includes("MicroMessenger")?Ae.jsx("a",{children:Ae.jsx("img",{width:n,height:n,src:pl(e),alt:e.displayName,className:"provider-img",style:{margin:r},onClick:()=>{IH(t,e,"signup")}})},e.displayName):Ae.jsx("a",{href:(void 0)(t,e,"signup"),children:Ae.jsx("img",{width:n,height:n,src:pl(e),alt:e.displayName,className:"provider-img",style:{margin:r}})},e.displayName);if(e.category==="SAML")return Ae.jsx("a",{onClick:()=>L3(e,s),children:Ae.jsx("img",{width:n,height:n,src:pl(e),alt:e.displayName,className:"provider-img",style:{margin:r}})},e.displayName);if(e.category==="Web3")return Ae.jsx("a",{onClick:()=>nE(t,e,"signup"),children:Ae.jsx("img",{width:n,height:n,src:pl(e),alt:e.displayName,className:"provider-img",style:{margin:r}})},e.displayName)}else if(e.type==="Custom"){const o=ss.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 Ae.jsx("a",{href:(void 0)(t,e,"signup"),style:a,children:Ae.jsxs("div",{style:c,children:[Ae.jsx("img",{width:26,src:pl(e),alt:e.displayName,className:"provider-img",style:l}),Ae.jsx("span",{style:f,children:o})]})},e.displayName);if(e.category==="SAML")return Ae.jsx("a",{onClick:()=>L3(e,s),style:a,children:Ae.jsxs("div",{style:c,children:[Ae.jsx("img",{width:26,src:pl(e),alt:e.displayName,className:"provider-img",style:l}),Ae.jsx("span",{style:f,children:o})]})},e.displayName)}else return e.category==="SAML"?Ae.jsx("div",{className:"provider-big-img",children:Ae.jsx("a",{onClick:()=>L3(e,s),children:M3(e)})},e.displayName):e.category==="Web3"?Ae.jsx("div",{className:"provider-big-img",children:Ae.jsx("a",{onClick:()=>nE(t,e,"signup"),children:M3(e)})},e.displayName):Ae.jsx("div",{className:"provider-big-img",children:Ae.jsx("a",{href:(void 0)(t,e,"signup"),children:M3(e)})},e.displayName)}function yV(e){return e.length<6?ss.t("user:The password must have at least 6 characters"):""}function wV(e){return e.length<8?ss.t("user:The password must have at least 8 characters"):""}function vV(e){return/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9]).+$/.test(e)?"":ss.t("user:The password must contain at least one uppercase letter, one lowercase letter and one digit")}function EV(e){return/^(?=.*[!-/:-@[-`{-~]).+$/.test(e)?"":ss.t("user:The password must contain at least one special character")}function xV(e){return/(.)\1+/.test(e)?ss.t("user:The password must not contain any repeated characters"):""}function AV(e,t){if(e.length===0)return ss.t("login:Please input your password!");(!t||t.length===0)&&(t=["AtLeast6"]);const n={AtLeast6:yV,AtLeast8:wV,Aa123:vV,SpecialChar:EV,NoRepeat:xV};for(const r of t){const i=n[r];if(i){const s=i(e);if(s!=="")return s}}return""}function _V({application:e,state:t,setState:n}){const[r,i]=xt.useState(!1),s=xt.useRef(null);xt.useEffect(()=>{s.current||(s.current=document.getElementById("agreementDialog"))},[]),xt.useEffect(()=>{s.current&&(r?s.current.showModal():s.current.close())},[r]);const o=()=>{n({...t,agreement:!1}),i(!1)},a=()=>{n({...t,agreement:!0}),i(!1)},c=()=>{i(!0)};return Ae.jsxs(Ae.Fragment,{children:[Ae.jsx("dialog",{id:"agreementDialog",className:"modal",children:Ae.jsxs("div",{className:"modal-box",children:[Ae.jsx("div",{className:"mt-4 mb-8",children:Ae.jsx("iframe",{src:e.termsOfUse,width:"100%",height:"300px",sandbox:"allow-scripts"})}),Ae.jsxs("div",{className:"modal-action",children:[Ae.jsx("form",{method:"dialog",className:"modal-backdrop",children:Ae.jsx("button",{children:"Close"})}),Ae.jsxs("form",{method:"dialog",className:"flex gap-3",children:[Ae.jsx("button",{className:"btn",onClick:o,children:"Cancel"},"closebtn"),Ae.jsx("button",{className:"btn btn-primary",onClick:a,children:"OK"},"okbtn")]})]})]})}),Ae.jsx("input",{checked:!!t.agreement,type:"checkbox",readOnly:!0}),Ae.jsx("button",{onClick:c,children:"Open Terms"})]})}function no({label:e,name:t,rules:n,inputEl:r,setFieldValue:i,onChange:s,...o}){return Ae.jsxs("label",{className:"form-control w-full max-w-xs",htmlFor:t,children:[Ae.jsx("div",{className:"label",children:Ae.jsx("span",{className:"label-text",children:e})}),r||Ae.jsx("input",{type:"text",...o,name:t,className:"input input-bordered w-full max-w-xs",onChange:a=>{i(t,a.target.value),s==null||s(a)}}),Ae.jsx("div",{className:"label flex-col",children:n==null?void 0:n.map((a,c)=>Ae.jsx("span",{className:"label-text-alt",children:a.message},t+c))})]})}const CV=(e,t)=>(delete e.applicationName,delete e.emailOrPhoneMode,delete e.isTermsOfUseVisible,{application:t.name,organization:t.organization,plan:null,pricing:null,...e}),SV=(e,t,n)=>{e.preventDefault();const r=CV(t,n);console.log(r),vH(r).then(i=>{i.status==="ok"?(r.username=i.data.split("/")[1],n&&bH(n)?wH("").then(s=>{let o=null;s.status==="ok"?(o=s.data,o.organization=s.data2,console.log("account",o),alert("redirect")):$i("error",`Failed to sign in: ${s.msg}`)}):alert("redirect")):$i("error",i.msg)})};function kV(e,t,n,r,i){if(!t.visible)return null;const s=(a,c)=>{n[a]=c,r(n)},o=t.required;if(t.name==="Username")return Ae.jsx(no,{name:"username",className:"signup-username",label:t.label?t.label:i("signup.username"),rules:[{required:o,message:i("forget.username"),whitespace:!0}],placeholder:t.placeholder,disabled:n.invitation!==void 0&&n.invitation.username!=="",setFieldValue:s});if(t.name==="Display name")return t.rule==="First, last"&&oH()!=="zh"?Ae.jsxs(xt.Fragment,{children:[Ae.jsx(no,{name:"firstName",className:"signup-first-name",label:t.label?t.label:i("general.firstName"),rules:[{required:o,message:i("forget.firstName"),whitespace:!0}],placeholder:t.placeholder,setFieldValue:s}),Ae.jsx(no,{name:"lastName",className:"signup-last-name",label:t.label?t.label:i("general.lastName"),rules:[{required:o,message:i("forget.lastName"),whitespace:!0}],placeholder:t.placeholder,setFieldValue:s})]}):Ae.jsx(no,{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:o,message:t.rule==="Real name"||t.rule==="First, last"?i("forget.realName"):i("forget.displayName"),whitespace:!0}],placeholder:t.placeholder,setFieldValue:s});if(t.name==="Affiliation")return Ae.jsx(no,{name:"affiliation",className:"signup-affiliation",label:t.label?t.label:i("user.affiliation"),rules:[{required:o,message:i("forget.affiliation"),whitespace:!0}],placeholder:t.placeholder,setFieldValue:s});if(t.name==="ID card")return Ae.jsx(no,{name:"idCard",className:"signup-idcard",label:t.label?t.label:i("user.idCard"),rules:[{required:o,message:i("forget.idCard"),whitespace:!0},{required:o,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:s});if(t.name==="Email"||t.name==="Phone"||t.name==="Email or Phone"||t.name==="Phone or Email"){const a=()=>Ae.jsxs(xt.Fragment,{children:[Ae.jsx(no,{name:"email",label:t.label?t.label:i("general.email"),rules:[{required:o,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,Ov(f)),f!==""&&!Ov(f)?r({...n,email:f,validEmail:!1}):r({...n,email:f,validEmail:!0})},setFieldValue:s}),t.rule!=="No verification"&&Ae.jsx(no,{name:"emailCode",className:"signup-email-code",label:t.label?t.label:i("code.email"),rules:[{required:o,message:i("forget.code")}],inputEl:Ae.jsx(PH,{disabled:!n.validEmail,method:"signup",onButtonClickArgs:[n.email,"email",e.name],application:e,countryCode:"US",onChange:l=>r({...n,emailCode:l})}),setFieldValue:s})]}),c=()=>Ae.jsx(Ae.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"),Ae.jsxs(xt.Fragment,{children:[Ae.jsx("div",{style:{marginTop:"30px",marginBottom:"20px"}}),l==="Email"?a():c()]})}else return null}else{if(t.name==="Password")return Ae.jsx(no,{name:"password",className:"signup-password",label:t.label?t.label:i("general.password"),rules:[{required:o,validateTrigger:"onChange",validator:(a,c)=>{const l=AV(c,e.organizationObj.passwordOptions);return l===""?Promise.resolve():Promise.reject(l)}}],setFieldValue:s,type:"password",placeholder:t.placeholder});if(t.name==="Confirm password")return Ae.jsx(no,{name:"confirm",className:"signup-confirm",label:t.label?t.label:i("signup.confirm"),rules:[{required:o,message:i("forget.confirm")}],type:"password",placeholder:t.placeholder,setFieldValue:s});if(t.name==="Invitation code")return Ae.jsx(no,{name:"invitationCode",className:"signup-invitation-code",label:t.label?t.label:i("application.invitationCode"),rules:[{required:o,message:i("forget.invitationCode")}],placeholder:t.placeholder,disabled:n.invitation!==void 0&&n.invitation!=="",setFieldValue:s});if(t.name==="Agreement")return Ae.jsx(_V,{state:n,setState:r,application:e});if(t.name.startsWith("Text "))return Ae.jsx("div",{dangerouslySetInnerHTML:{__html:t.label}});if(t.name==="Signup button")return Ae.jsxs("form",{onSubmit:a=>SV(a,n,e),children:[Ae.jsx("button",{className:"btn btn-primary",type:"submit",children:i("signup.signUp")})," ",i("signup.haveAccount")," ",Ae.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=hH(e)||pH(e)||mH(e)||gH(e);return(t.rule==="None"||t.rule==="")&&(t.rule=a?"small":"big"),e.providers.filter(c=>Pv(c)).map(c=>bV(c.provider,e,null,null,t.rule,{search:window.location.search}))}}return t.name}const IV={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"}}};ss.use(bu.initReactI18next).init({lng:"en",fallbackLng:"en",resources:{en:IV}});function TV(e,t,n){const r=Ae.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:[Ae.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),Ae.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),i=Ae.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:[Ae.jsx("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),Ae.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"}),Ae.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"}),Ae.jsx("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]}),s=kh(e),o=ma(e);if(s==="password"){const a=t.password.state[o];return Ae.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,[o]:!a})},children:[a?i:r,Ae.jsx("span",{className:"sr-only",children:"Toggle password visibility"})]})}else return null}function ma(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 kh(e,t){const n=["password","confirm"],r=ma(e);return n.includes(r)&&!(t!=null&&t.hidePassword[r])?"password":"text"}function BV(e){return Object.fromEntries(e.filter(t=>kh(t)==="password").map(t=>[ma(t),!1]))}function PV(e){return{name:ma(e),label:e.label||e.name,placeholder:e.placeholder,required:e.required,type:kh(e)}}function OV(e,t){const n=ma(t);let r=e.string();return n==="email"&&(r=r.email()),t.required||(r=r.optional()),r}function MV(e){const t=e.map(r=>[ma(r),""]),n=e.filter(r=>rE(r)).map(r=>[ma(r)+"Code",""]);return Object.fromEntries([...t,...n])}function rE(e){const t=ma(e);return(t==="email"||t==="phone")&&!["None","No verification"].includes(e.rule)}function LV(e){return e.visible===!0}function RV(e){var u;const{t,i18n:n}=bu.useTranslation(),[r,i]=xt.useState({applicationName:e.applicationName??null,email:"",phone:"",emailOrPhoneMode:"",countryCode:"",emailCode:"",phoneCode:"",validEmail:!1,validPhone:!1,region:"",isTermsOfUseVisible:!1,termsOfUseContent:""});xt.useRef();const s=d=>{d!==void 0&&C3("admin",d).then(h=>{if(h.status==="error"){$i("error",h.msg);return}l(h.data)})},o=d=>{Mv(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)=>{Rv(d,h).then(p=>{if(p.status==="error"){$i("error",p.msg);return}i({...r,invitation:p.data})})},l=d=>{e.onUpdateApplication(d)};xt.useEffect(()=>{const d=Lv();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){s(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?o(d):($i("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)=>Ae.jsx("div",{children:kV(f,d,r,i,t)},h))}function jV({applicationName:e,casdoorApiRoot:t,springmicroApiRoot:n}){Jr.casdoor=t,n&&(Jr.springmicro=n);const[r,i]=xt.useState({application:null}),s=()=>{C3("admin",e).then(o=>{if(console.log(o),o.status==="error"){$i("error",o.msg);return}i({application:o.data})})};return xt.useEffect(()=>{s()},[]),r.application===void 0?Ae.jsx(Ae.Fragment,{}):Ae.jsx(bu.I18nextProvider,{i18n:ss,children:Ae.jsx(RV,{application:r.application,onUpdateApplication:o=>{i({application:o})}})})}const iE=xt.createContext(void 0);function NV({applicationName:e,casdoorApiRoot:t,springmicroApiRoot:n,children:r}){bu.useTranslation(),Jr.casdoor=t,n&&(Jr.springmicro=n);const[i,s]=xt.useState({application:null}),[o,a]=xt.useState({}),c=()=>{C3("admin",e).then(b=>{if(console.log(b),b.status==="error"){$i("error",b.msg);return}s({application:b.data})})},l=b=>{s({application:b})},f=(b,g)=>{Rv(b,g).then(y=>{if(y.status==="error"){$i("error",y.msg);return}s({...i,invitation:y.data})})},u=b=>{Mv(b).then(g=>{if(g.status==="ok"){const y=g.data;l(y)}else l(null),s({...i,msg:g.msg})})},d=(b,g)=>TV(b,{password:{state:o,setState:a}},g),h=b=>kh(b,{hidePassword:o}),p=jv,m=Nv;return xt.useEffect(()=>{c()},[]),xt.useEffect(()=>{i.application&&a(BV(i.application.signupItems))},[i.application]),xt.useEffect(()=>{const b=Lv();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")??"";s({...i,invitationCode:y}),y!==""&&f(y,"admin/"+i.applicationName)}}else b!==null?u(b):($i("error",`Unknown application name: ${i.applicationName}`),l(null))},[]),i.application===void 0||i.application===null?null:Ae.jsx(iE.Provider,{value:{application:i.application,getDefaultValues:MV,getFormProps:PV,icon:d,getZod:OV,getKey:ma,type:h,sendCode:p,requiresCode:rE,getCaptcha:m,isVisible:LV},children:r})}const $V=()=>{const e=xt.useContext(iE);if(!e)throw new Error("useSignUp must be used within a SignUpProvider");return e};let Ih;const FV=new Uint8Array(16);function DV(){if(!Ih&&(Ih=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ih))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ih(FV)}const wi=[];for(let e=0;e<256;++e)wi.push((e+256).toString(16).slice(1));function UV(e,t=0){return wi[e[t+0]]+wi[e[t+1]]+wi[e[t+2]]+wi[e[t+3]]+"-"+wi[e[t+4]]+wi[e[t+5]]+"-"+wi[e[t+6]]+wi[e[t+7]]+"-"+wi[e[t+8]]+wi[e[t+9]]+"-"+wi[e[t+10]]+wi[e[t+11]]+wi[e[t+12]]+wi[e[t+13]]+wi[e[t+14]]+wi[e[t+15]]}const sE={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function HV(e,t,n){if(sE.randomUUID&&!t&&!e)return sE.randomUUID();e=e||{};const r=e.random||(e.rng||DV)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,UV(r)}var R3={},cc={},Th={},Bh={},gl={},Ph={};Ph.byteLength=VV,Ph.toByteArray=qV,Ph.fromByteArray=KV;for(var So=[],Is=[],zV=typeof Uint8Array<"u"?Uint8Array:Array,j3="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wu=0,GV=j3.length;wu<GV;++wu)So[wu]=j3[wu],Is[j3.charCodeAt(wu)]=wu;Is[45]=62,Is[95]=63;function oE(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 VV(e){var t=oE(e),n=t[0],r=t[1];return(n+r)*3/4-r}function WV(e,t,n){return(t+n)*3/4-n}function qV(e){var t,n=oE(e),r=n[0],i=n[1],s=new zV(WV(e,r,i)),o=0,a=i>0?r-4:r,c;for(c=0;c<a;c+=4)t=Is[e.charCodeAt(c)]<<18|Is[e.charCodeAt(c+1)]<<12|Is[e.charCodeAt(c+2)]<<6|Is[e.charCodeAt(c+3)],s[o++]=t>>16&255,s[o++]=t>>8&255,s[o++]=t&255;return i===2&&(t=Is[e.charCodeAt(c)]<<2|Is[e.charCodeAt(c+1)]>>4,s[o++]=t&255),i===1&&(t=Is[e.charCodeAt(c)]<<10|Is[e.charCodeAt(c+1)]<<4|Is[e.charCodeAt(c+2)]>>2,s[o++]=t>>8&255,s[o++]=t&255),s}function ZV(e){return So[e>>18&63]+So[e>>12&63]+So[e>>6&63]+So[e&63]}function QV(e,t,n){for(var r,i=[],s=t;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),i.push(ZV(r));return i.join("")}function KV(e){for(var t,n=e.length,r=n%3,i=[],s=16383,o=0,a=n-r;o<a;o+=s)i.push(QV(e,o,o+s>a?a:o+s));return r===1?(t=e[n-1],i.push(So[t>>2]+So[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(So[t>>10]+So[t>>4&63]+So[t<<2&63]+"=")),i.join("")}var N3={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */N3.read=function(e,t,n,r,i){var s,o,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,s=h&(1<<-f)-1,h>>=-f,f+=a;f>0;s=s*256+e[t+u],u+=d,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=r;f>0;o=o*256+e[t+u],u+=d,f-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-l}return(h?-1:1)*o*Math.pow(2,s-r)},N3.write=function(e,t,n,r,i,s){var o,a,c,l=s*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:s-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,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+u>=1?t+=d/c:t+=d*Math.pow(2,1-u),t*c>=2&&(o++,c/=2),o+u>=f?(a=0,o=f):o+u>=1?(a=(t*c-1)*Math.pow(2,i),o=o+u):(a=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=a&255,h+=p,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;e[n+h]=o&255,h+=p,o/=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 Kv=fr(xt),Dz={activeStyle:{background:"#008FF3"},icon:Hz,style:{background:"#0573ff"},text:"Log in with Zalo"},Uz=Lr(Dz);function Hz({size:e,color:t}){return Kv.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24"},Kv.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(xt),zz={activeStyle:{background:"#333333"},icon:Vz,style:{background:"#000000",color:"#FFFFFF"},text:"Log in with TikTok"},Gz=Lr(zz);function Vz({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 ms=fr(xt),Wz={activeStyle:{background:"#eeeeee"},icon:Zz,style:{background:"#ffffff",color:"#333333"},text:"Log in with Metamask"},qz=Lr(Wz);function Zz({size:e}){return ms.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"},ms.default.createElement("path",{fill:"#e2761b",stroke:"#e2761b",strokeLinecap:"round",strokeLinejoin:"round",d:"M274.1 35.5l-99.5 73.9L193 65.8z"}),ms.default.createElement("path",Ti({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"},Jv)),ms.default.createElement("path",Ti({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"},Jv)),ms.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"}),ms.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"}),ms.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"}),ms.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"}),ms.default.createElement("path",Ti({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"},Xv)),ms.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"}),ms.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"}),ms.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"}),ms.default.createElement("path",Ti({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"},Xv)))}var Jv={fill:"#e4761b",stroke:"#e4761b",strokeLinecap:"round",strokeLinejoin:"round"},Xv={fill:"#f6851b",stroke:"#f6851b",strokeLinecap:"round",strokeLinejoin:"round"},eE=fr(xt),Qz={icon:Yz,style:{background:"#fc6d26"},activeStyle:{background:"#d55a1c"},text:"Log in with Gitlab"},Kz=Lr(Qz);function Yz({size:e,color:t}){return eE.default.createElement("svg",{fill:t,role:"img",viewBox:"0 0 24 24",width:e,height:e,xmlns:"http://www.w3.org/2000/svg"},eE.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 tE=fr(xt),Jz={activeStyle:{background:"#282e36"},icon:eG,style:{background:"#0f1419"},text:"Log in with X"},Xz=Lr(Jz);function eG({size:e,color:t}){return tE.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24"},tE.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 tG({width:e=24,height:t=24,color:n}){return Ae.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",height:"48",width:"32",viewBox:"-18.15 -35.9725 157.3 215.835",children:[Ae.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"}),Ae.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"}),Ae.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"}),Ae.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"}),Ae.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"}),Ae.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"}),Ae.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"}),Ae.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 nG={text:"Sign in with QQ",icon:tG,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(94,188,249)"},activeStyle:{background:"rgb(76,143,208)"}},rG=er.createButton(nG);function iG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/facebook.svg`,alt:"Sign in with Facebook"})}const sG={text:"Sign in with Facebook",icon:iG,iconFormat:e=>`fa fa-${e}`,style:{background:"#3b5998"},activeStyle:{background:"#2b3f65"}},oG=er.createButton(sG);function aG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/weibo.svg`,alt:"Sign in with Weibo"})}const cG={text:"Sign in with Weibo",icon:aG,iconFormat:e=>`fa fa-${e}`,style:{background:"#e62329"},activeStyle:{background:"#e54329"}},lG=er.createButton(cG);function uG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/gitee.svg`,alt:"Sign in with Gitee"})}const fG={text:"Sign in with Gitee",icon:uG,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(199,29,35)"},activeStyle:{background:"rgb(147,22,26)"}},dG=er.createButton(fG);function hG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/wechat.svg`,alt:"Sign in with Wechat"})}const pG={text:"Sign in with Wechat",icon:hG,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(0,194,80)"},activeStyle:{background:"rgb(0,158,64)"}},mG=er.createButton(pG);function gG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/dingtalk.svg`,alt:"Sign in with DingTalk"})}const bG={text:"Sign in with DingTalk",icon:gG,iconFormat:e=>`fa fa-${e}`,style:{background:"#0191e0"},activeStyle:{background:"rgb(76,143,208)"}},yG=er.createButton(bG);function wG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/linkedin.svg`,alt:"Sign in with LinkedIn"})}const vG={text:"Sign in with LinkedIn",icon:wG,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(255,255,255)",color:"#000000"},activeStyle:{background:"rgb(240,240,250)"}},EG=er.createButton(vG);function xG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/wecom.svg`,alt:"Sign in with WeCom"})}const AG={text:"Sign in with WeCom",icon:xG,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(255,255,255)",color:"#000000"},activeStyle:{background:"rgb(100,150,250)"}},_G=er.createButton(AG);function CG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/lark.svg`,alt:"Sign in with Lark",style:{width:24,height:24}})}const SG={text:"Sign in with Lark",icon:CG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},kG=er.createButton(SG);function IG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/gitlab.svg`,alt:"Sign in with GitLab",style:{width:24,height:24}})}const TG={text:"Sign in with GitLab",icon:IG,iconFormat:e=>`fa fa-${e}`,style:{background:"rgb(255,255,255)",color:"#000000"},activeStyle:{background:"rgb(100,150,250)"}},BG=er.createButton(TG);function PG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/adfs.svg`,alt:"Sign in with ADFS",style:{width:24,height:24}})}const OG={text:"Sign in with ADFS",icon:PG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},MG=er.createButton(OG);function LG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/casdoor.svg`,alt:"Sign in with Casdoor",style:{width:24,height:24}})}const RG={text:"Sign in with Casdoor",icon:LG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},jG=er.createButton(RG);function NG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/baidu.svg`,alt:"Sign in with Baidu",style:{width:24,height:24}})}const $G={text:"Sign in with Baidu",icon:NG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},FG=er.createButton($G);function DG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/alipay.svg`,alt:"Sign in with Alipay",style:{width:24,height:24}})}const UG={text:"Sign in with Alipay",icon:DG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},HG=er.createButton(UG);function zG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/infoflow.svg`,alt:"Sign in with Infoflow",style:{width:24,height:24}})}const GG={text:"Sign in with Infoflow",icon:zG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},VG=er.createButton(GG);function WG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/apple.svg`,alt:"Sign in with Apple",style:{width:24,height:24}})}const qG={text:"Sign in with Apple",icon:WG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},ZG=er.createButton(qG);function QG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/azuread.svg`,alt:"Sign in with Azure AD",style:{width:24,height:24}})}const KG={text:"Sign in with Azure AD",icon:QG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},YG=er.createButton(KG);function JG({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/azuread.svg`,alt:"Sign in with Azure AD B2C",style:{width:24,height:24}})}const XG={text:"Sign in with Azure AD B2C",icon:JG,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},eV=er.createButton(XG);function tV({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/slack.svg`,alt:"Sign in with Slack",style:{width:24,height:24}})}const nV={text:"Sign in with Slack",icon:tV,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},rV=er.createButton(nV);function iV({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/steam.svg`,alt:"Sign in with Steam",style:{width:24,height:24}})}const sV={text:"Sign in with Steam",icon:iV,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},oV=er.createButton(sV);function aV({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/bilibili.svg`,alt:"Sign in with Bilibili"})}const cV={text:"Sign in with Bilibili",icon:aV,iconFormat:e=>`fa fa-${e}`,style:{background:"#0191e0"},activeStyle:{background:"rgb(76,143,208)"}},lV=er.createButton(cV);function uV({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/okta.svg`,alt:"Sign in with Okta",style:{width:24,height:24}})}const fV={text:"Sign in with Okta",icon:uV,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},dV=er.createButton(fV);function hV({width:e=24,height:t=24,color:n}){return Ae.jsx("img",{src:`${Xe}/buttons/douyin.svg`,alt:"Sign in with Douyin",style:{width:24,height:24}})}const pV={text:"Sign in with Douyin",icon:hV,iconFormat:e=>`fa fa-${e}`,style:{background:"#ffffff",color:"#000000"},activeStyle:{background:"#ededee"}},mV=er.createButton(pV);function gV({type:e,logoUrl:t,align:n="center",style:r={background:"#ffffff",color:"#000000"},activeStyle:i={background:"#ededee"}}){function s({width:l=24,height:f=24,color:u}){return Ae.jsx("img",{src:t,alt:`Sign in with ${e}`,style:{width:l,height:f}})}const o={text:`Sign in with ${e}`,icon:s,style:r,activeStyle:i},a=er.createButton(o),c=ss.t("login:Sign in with {type}").replace("{type}",e);return Ae.jsx(a,{text:c,align:n})}function M3(e){const t=ss.t("login:Sign in with {type}").replace("{type}",e.displayName!==""?e.displayName:e.type);return e.type==="GitHub"?Ae.jsx(er.GithubLoginButton,{text:t,align:"center"}):e.type==="Google"?Ae.jsx(er.GoogleLoginButton,{text:t,align:"center"}):e.type==="QQ"?Ae.jsx(rG,{text:t,align:"center"}):e.type==="Facebook"?Ae.jsx(oG,{text:t,align:"center"}):e.type==="Weibo"?Ae.jsx(lG,{text:t,align:"center"}):e.type==="Gitee"?Ae.jsx(dG,{text:t,align:"center"}):e.type==="WeChat"?Ae.jsx(mG,{text:t,align:"center"}):e.type==="DingTalk"?Ae.jsx(yG,{text:t,align:"center"}):e.type==="LinkedIn"?Ae.jsx(EG,{text:t,align:"center"}):e.type==="WeCom"?Ae.jsx(_G,{text:t,align:"center"}):e.type==="Lark"?Ae.jsx(kG,{text:t,align:"center"}):e.type==="GitLab"?Ae.jsx(BG,{text:t,align:"center"}):e.type==="ADFS"?Ae.jsx(MG,{text:t,align:"center"}):e.type==="Casdoor"?Ae.jsx(jG,{text:t,align:"center"}):e.type==="Baidu"?Ae.jsx(FG,{text:t,align:"center"}):e.type==="Alipay"?Ae.jsx(HG,{text:t,align:"center"}):e.type==="Infoflow"?Ae.jsx(VG,{text:t,align:"center"}):e.type==="Apple"?Ae.jsx(ZG,{text:t,align:"center"}):e.type==="AzureAD"?Ae.jsx(YG,{text:t,align:"center"}):e.type==="AzureADB2C"?Ae.jsx(eV,{text:t,align:"center"}):e.type==="Slack"?Ae.jsx(rV,{text:t,align:"center"}):e.type==="Steam"?Ae.jsx(oV,{text:t,align:"center"}):e.type==="Bilibili"?Ae.jsx(lV,{text:t,align:"center"}):e.type==="Okta"?Ae.jsx(dV,{text:t,align:"center"}):e.type==="Douyin"?Ae.jsx(mV,{text:t,align:"center"}):Ae.jsx(gV,{type:e.type,logoUrl:pl(e)},e.type)}function L3(e,t){const n=new URLSearchParams(t.search),r=n.get("client_id")??"",i=n.get("state"),s=n.get("redirect_uri"),o=`${window.location.origin}/callback/saml`,a=e.name,c=`${r}&${i}&${a}&${s}&${o}`;AH(`${e.owner}/${a}`,btoa(c)).then(l=>{l.data2==="POST"?document.write(l.data):window.location.href=l.data})}function nE(e,t,n){t.type==="MetaMask"?Promise.resolve().then(()=>WP).then(r=>{const i=r.authViaMetaMask;i(e,t,n)}):t.type==="Web3Onboard"&&Promise.resolve().then(()=>WP).then(r=>{const i=r.authViaWeb3Onboard;i(e,t,n)})}function bV(e,t,n,r,i,s){if(i==="small"){if(e.category==="OAuth")return e.type==="WeChat"&&e.clientId2!==""&&e.clientSecret2!==""&&e.disableSsl===!0&&!navigator.userAgent.includes("MicroMessenger")?Ae.jsx("a",{children:Ae.jsx("img",{width:n,height:n,src:pl(e),alt:e.displayName,className:"provider-img",style:{margin:r},onClick:()=>{IH(t,e,"signup")}})},e.displayName):Ae.jsx("a",{href:(void 0)(t,e,"signup"),children:Ae.jsx("img",{width:n,height:n,src:pl(e),alt:e.displayName,className:"provider-img",style:{margin:r}})},e.displayName);if(e.category==="SAML")return Ae.jsx("a",{onClick:()=>L3(e,s),children:Ae.jsx("img",{width:n,height:n,src:pl(e),alt:e.displayName,className:"provider-img",style:{margin:r}})},e.displayName);if(e.category==="Web3")return Ae.jsx("a",{onClick:()=>nE(t,e,"signup"),children:Ae.jsx("img",{width:n,height:n,src:pl(e),alt:e.displayName,className:"provider-img",style:{margin:r}})},e.displayName)}else if(e.type==="Custom"){const o=ss.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 Ae.jsx("a",{href:(void 0)(t,e,"signup"),style:a,children:Ae.jsxs("div",{style:c,children:[Ae.jsx("img",{width:26,src:pl(e),alt:e.displayName,className:"provider-img",style:l}),Ae.jsx("span",{style:f,children:o})]})},e.displayName);if(e.category==="SAML")return Ae.jsx("a",{onClick:()=>L3(e,s),style:a,children:Ae.jsxs("div",{style:c,children:[Ae.jsx("img",{width:26,src:pl(e),alt:e.displayName,className:"provider-img",style:l}),Ae.jsx("span",{style:f,children:o})]})},e.displayName)}else return e.category==="SAML"?Ae.jsx("div",{className:"provider-big-img",children:Ae.jsx("a",{onClick:()=>L3(e,s),children:M3(e)})},e.displayName):e.category==="Web3"?Ae.jsx("div",{className:"provider-big-img",children:Ae.jsx("a",{onClick:()=>nE(t,e,"signup"),children:M3(e)})},e.displayName):Ae.jsx("div",{className:"provider-big-img",children:Ae.jsx("a",{href:(void 0)(t,e,"signup"),children:M3(e)})},e.displayName)}function yV(e){return e.length<6?ss.t("user:The password must have at least 6 characters"):""}function wV(e){return e.length<8?ss.t("user:The password must have at least 8 characters"):""}function vV(e){return/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9]).+$/.test(e)?"":ss.t("user:The password must contain at least one uppercase letter, one lowercase letter and one digit")}function EV(e){return/^(?=.*[!-/:-@[-`{-~]).+$/.test(e)?"":ss.t("user:The password must contain at least one special character")}function xV(e){return/(.)\1+/.test(e)?ss.t("user:The password must not contain any repeated characters"):""}function AV(e,t){if(e.length===0)return ss.t("login:Please input your password!");(!t||t.length===0)&&(t=["AtLeast6"]);const n={AtLeast6:yV,AtLeast8:wV,Aa123:vV,SpecialChar:EV,NoRepeat:xV};for(const r of t){const i=n[r];if(i){const s=i(e);if(s!=="")return s}}return""}function _V({application:e,state:t,setState:n}){const[r,i]=xt.useState(!1),s=xt.useRef(null);xt.useEffect(()=>{s.current||(s.current=document.getElementById("agreementDialog"))},[]),xt.useEffect(()=>{s.current&&(r?s.current.showModal():s.current.close())},[r]);const o=()=>{n({...t,agreement:!1}),i(!1)},a=()=>{n({...t,agreement:!0}),i(!1)},c=()=>{i(!0)};return Ae.jsxs(Ae.Fragment,{children:[Ae.jsx("dialog",{id:"agreementDialog",className:"modal",children:Ae.jsxs("div",{className:"modal-box",children:[Ae.jsx("div",{className:"mt-4 mb-8",children:Ae.jsx("iframe",{src:e.termsOfUse,width:"100%",height:"300px",sandbox:"allow-scripts"})}),Ae.jsxs("div",{className:"modal-action",children:[Ae.jsx("form",{method:"dialog",className:"modal-backdrop",children:Ae.jsx("button",{children:"Close"})}),Ae.jsxs("form",{method:"dialog",className:"flex gap-3",children:[Ae.jsx("button",{className:"btn",onClick:o,children:"Cancel"},"closebtn"),Ae.jsx("button",{className:"btn btn-primary",onClick:a,children:"OK"},"okbtn")]})]})]})}),Ae.jsx("input",{checked:!!t.agreement,type:"checkbox",readOnly:!0}),Ae.jsx("button",{onClick:c,children:"Open Terms"})]})}function no({label:e,name:t,rules:n,inputEl:r,setFieldValue:i,onChange:s,...o}){return Ae.jsxs("label",{className:"form-control w-full max-w-xs",htmlFor:t,children:[Ae.jsx("div",{className:"label",children:Ae.jsx("span",{className:"label-text",children:e})}),r||Ae.jsx("input",{type:"text",...o,name:t,className:"input input-bordered w-full max-w-xs",onChange:a=>{i(t,a.target.value),s==null||s(a)}}),Ae.jsx("div",{className:"label flex-col",children:n==null?void 0:n.map((a,c)=>Ae.jsx("span",{className:"label-text-alt",children:a.message},t+c))})]})}const CV=(e,t)=>(delete e.applicationName,delete e.emailOrPhoneMode,delete e.isTermsOfUseVisible,{application:t.name,organization:t.organization,plan:null,pricing:null,...e}),SV=(e,t,n)=>{e.preventDefault();const r=CV(t,n);console.log(r),vH(r).then(i=>{i.status==="ok"?(r.username=i.data.split("/")[1],n&&bH(n)?wH("").then(s=>{let o=null;s.status==="ok"?(o=s.data,o.organization=s.data2,console.log("account",o),alert("redirect")):$i("error",`Failed to sign in: ${s.msg}`)}):alert("redirect")):$i("error",i.msg)})};function kV(e,t,n,r,i){if(!t.visible)return null;const s=(a,c)=>{n[a]=c,r(n)},o=t.required;if(t.name==="Username")return Ae.jsx(no,{name:"username",className:"signup-username",label:t.label?t.label:i("signup.username"),rules:[{required:o,message:i("forget.username"),whitespace:!0}],placeholder:t.placeholder,disabled:n.invitation!==void 0&&n.invitation.username!=="",setFieldValue:s});if(t.name==="Display name")return t.rule==="First, last"&&oH()!=="zh"?Ae.jsxs(xt.Fragment,{children:[Ae.jsx(no,{name:"firstName",className:"signup-first-name",label:t.label?t.label:i("general.firstName"),rules:[{required:o,message:i("forget.firstName"),whitespace:!0}],placeholder:t.placeholder,setFieldValue:s}),Ae.jsx(no,{name:"lastName",className:"signup-last-name",label:t.label?t.label:i("general.lastName"),rules:[{required:o,message:i("forget.lastName"),whitespace:!0}],placeholder:t.placeholder,setFieldValue:s})]}):Ae.jsx(no,{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:o,message:t.rule==="Real name"||t.rule==="First, last"?i("forget.realName"):i("forget.displayName"),whitespace:!0}],placeholder:t.placeholder,setFieldValue:s});if(t.name==="Affiliation")return Ae.jsx(no,{name:"affiliation",className:"signup-affiliation",label:t.label?t.label:i("user.affiliation"),rules:[{required:o,message:i("forget.affiliation"),whitespace:!0}],placeholder:t.placeholder,setFieldValue:s});if(t.name==="ID card")return Ae.jsx(no,{name:"idCard",className:"signup-idcard",label:t.label?t.label:i("user.idCard"),rules:[{required:o,message:i("forget.idCard"),whitespace:!0},{required:o,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:s});if(t.name==="Email"||t.name==="Phone"||t.name==="Email or Phone"||t.name==="Phone or Email"){const a=()=>Ae.jsxs(xt.Fragment,{children:[Ae.jsx(no,{name:"email",label:t.label?t.label:i("general.email"),rules:[{required:o,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,Ov(f)),f!==""&&!Ov(f)?r({...n,email:f,validEmail:!1}):r({...n,email:f,validEmail:!0})},setFieldValue:s}),t.rule!=="No verification"&&Ae.jsx(no,{name:"emailCode",className:"signup-email-code",label:t.label?t.label:i("code.email"),rules:[{required:o,message:i("forget.code")}],inputEl:Ae.jsx(PH,{disabled:!n.validEmail,method:"signup",onButtonClickArgs:[n.email,"email",e.name],application:e,countryCode:"US",onChange:l=>r({...n,emailCode:l})}),setFieldValue:s})]}),c=()=>Ae.jsx(Ae.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"),Ae.jsxs(xt.Fragment,{children:[Ae.jsx("div",{style:{marginTop:"30px",marginBottom:"20px"}}),l==="Email"?a():c()]})}else return null}else{if(t.name==="Password")return Ae.jsx(no,{name:"password",className:"signup-password",label:t.label?t.label:i("general.password"),rules:[{required:o,validateTrigger:"onChange",validator:(a,c)=>{const l=AV(c,e.organizationObj.passwordOptions);return l===""?Promise.resolve():Promise.reject(l)}}],setFieldValue:s,type:"password",placeholder:t.placeholder});if(t.name==="Confirm password")return Ae.jsx(no,{name:"confirm",className:"signup-confirm",label:t.label?t.label:i("signup.confirm"),rules:[{required:o,message:i("forget.confirm")}],type:"password",placeholder:t.placeholder,setFieldValue:s});if(t.name==="Invitation code")return Ae.jsx(no,{name:"invitationCode",className:"signup-invitation-code",label:t.label?t.label:i("application.invitationCode"),rules:[{required:o,message:i("forget.invitationCode")}],placeholder:t.placeholder,disabled:n.invitation!==void 0&&n.invitation!=="",setFieldValue:s});if(t.name==="Agreement")return Ae.jsx(_V,{state:n,setState:r,application:e});if(t.name.startsWith("Text "))return Ae.jsx("div",{dangerouslySetInnerHTML:{__html:t.label}});if(t.name==="Signup button")return Ae.jsxs("form",{onSubmit:a=>SV(a,n,e),children:[Ae.jsx("button",{className:"btn btn-primary",type:"submit",children:i("signup.signUp")})," ",i("signup.haveAccount")," ",Ae.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=hH(e)||pH(e)||mH(e)||gH(e);return(t.rule==="None"||t.rule==="")&&(t.rule=a?"small":"big"),e.providers.filter(c=>Pv(c)).map(c=>bV(c.provider,e,null,null,t.rule,{search:window.location.search}))}}return t.name}const IV={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"}}};ss.use(bu.initReactI18next).init({lng:"en",fallbackLng:"en",resources:{en:IV}});function TV(e,t,n){const r=Ae.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:[Ae.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),Ae.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),i=Ae.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:[Ae.jsx("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),Ae.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"}),Ae.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"}),Ae.jsx("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]}),s=kh(e),o=ma(e);if(s==="password"){const a=t.password.state[o];return Ae.jsxs(n,{variant:"ghost",size:"icon",className:"top-1/2 right-2 -translate-y-1/2",onClick:c=>{c.preventDefault(),c.stopPropagation(),t.password.setState({...t.password.state,[o]:!a})},children:[a?i:r,Ae.jsx("span",{className:"sr-only",children:"Toggle password visibility"})]})}else return null}function ma(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 kh(e,t){const n=["password","confirm"],r=ma(e);return n.includes(r)&&!(t!=null&&t.hidePassword[r])?"password":"text"}function BV(e){return Object.fromEntries(e.filter(t=>kh(t)==="password").map(t=>[ma(t),!1]))}function PV(e){return{name:ma(e),label:e.label||e.name,placeholder:e.placeholder,required:e.required,type:kh(e)}}function OV(e,t){const n=ma(t);let r=e.string();return n==="email"&&(r=r.email()),t.required||(r=r.optional()),r}function MV(e){const t=e.map(r=>[ma(r),""]),n=e.filter(r=>rE(r)).map(r=>[ma(r)+"Code",""]);return Object.fromEntries([...t,...n])}function rE(e){const t=ma(e);return(t==="email"||t==="phone")&&!["None","No verification"].includes(e.rule)}function LV(e){return e.visible===!0}function RV(e){var u;const{t,i18n:n}=bu.useTranslation(),[r,i]=xt.useState({applicationName:e.applicationName??null,email:"",phone:"",emailOrPhoneMode:"",countryCode:"",emailCode:"",phoneCode:"",validEmail:!1,validPhone:!1,region:"",isTermsOfUseVisible:!1,termsOfUseContent:""});xt.useRef();const s=d=>{d!==void 0&&C3("admin",d).then(h=>{if(h.status==="error"){$i("error",h.msg);return}l(h.data)})},o=d=>{Mv(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)=>{Rv(d,h).then(p=>{if(p.status==="error"){$i("error",p.msg);return}i({...r,invitation:p.data})})},l=d=>{e.onUpdateApplication(d)};xt.useEffect(()=>{const d=Lv();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){s(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?o(d):($i("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)=>Ae.jsx("div",{children:kV(f,d,r,i,t)},h))}function jV({applicationName:e,casdoorApiRoot:t,springmicroApiRoot:n}){Jr.casdoor=t,n&&(Jr.springmicro=n);const[r,i]=xt.useState({application:null}),s=()=>{C3("admin",e).then(o=>{if(console.log(o),o.status==="error"){$i("error",o.msg);return}i({application:o.data})})};return xt.useEffect(()=>{s()},[]),r.application===void 0?Ae.jsx(Ae.Fragment,{}):Ae.jsx(bu.I18nextProvider,{i18n:ss,children:Ae.jsx(RV,{application:r.application,onUpdateApplication:o=>{i({application:o})}})})}const iE=xt.createContext(void 0);function NV({applicationName:e,casdoorApiRoot:t,springmicroApiRoot:n,children:r}){bu.useTranslation(),Jr.casdoor=t,n&&(Jr.springmicro=n);const[i,s]=xt.useState({application:null}),[o,a]=xt.useState({}),c=()=>{C3("admin",e).then(b=>{if(console.log(b),b.status==="error"){$i("error",b.msg);return}s({application:b.data})})},l=b=>{s({application:b})},f=(b,g)=>{Rv(b,g).then(y=>{if(y.status==="error"){$i("error",y.msg);return}s({...i,invitation:y.data})})},u=b=>{Mv(b).then(g=>{if(g.status==="ok"){const y=g.data;l(y)}else l(null),s({...i,msg:g.msg})})},d=(b,g)=>TV(b,{password:{state:o,setState:a}},g),h=b=>kh(b,{hidePassword:o}),p=jv,m=Nv;return xt.useEffect(()=>{c()},[]),xt.useEffect(()=>{i.application&&a(BV(i.application.signupItems))},[i.application]),xt.useEffect(()=>{const b=Lv();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")??"";s({...i,invitationCode:y}),y!==""&&f(y,"admin/"+i.applicationName)}}else b!==null?u(b):($i("error",`Unknown application name: ${i.applicationName}`),l(null))},[]),i.application===void 0||i.application===null?null:Ae.jsx(iE.Provider,{value:{application:i.application,getDefaultValues:MV,getFormProps:PV,icon:d,getZod:OV,getKey:ma,type:h,sendCode:p,requiresCode:rE,getCaptcha:m,isVisible:LV},children:r})}const $V=()=>{const e=xt.useContext(iE);if(!e)throw new Error("useSignUp must be used within a SignUpProvider");return e};let Ih;const FV=new Uint8Array(16);function DV(){if(!Ih&&(Ih=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ih))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ih(FV)}const wi=[];for(let e=0;e<256;++e)wi.push((e+256).toString(16).slice(1));function UV(e,t=0){return wi[e[t+0]]+wi[e[t+1]]+wi[e[t+2]]+wi[e[t+3]]+"-"+wi[e[t+4]]+wi[e[t+5]]+"-"+wi[e[t+6]]+wi[e[t+7]]+"-"+wi[e[t+8]]+wi[e[t+9]]+"-"+wi[e[t+10]]+wi[e[t+11]]+wi[e[t+12]]+wi[e[t+13]]+wi[e[t+14]]+wi[e[t+15]]}const sE={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function HV(e,t,n){if(sE.randomUUID&&!t&&!e)return sE.randomUUID();e=e||{};const r=e.random||(e.rng||DV)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,UV(r)}var R3={},cc={},Th={},Bh={},gl={},Ph={};Ph.byteLength=VV,Ph.toByteArray=qV,Ph.fromByteArray=KV;for(var So=[],Is=[],zV=typeof Uint8Array<"u"?Uint8Array:Array,j3="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wu=0,GV=j3.length;wu<GV;++wu)So[wu]=j3[wu],Is[j3.charCodeAt(wu)]=wu;Is[45]=62,Is[95]=63;function oE(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 VV(e){var t=oE(e),n=t[0],r=t[1];return(n+r)*3/4-r}function WV(e,t,n){return(t+n)*3/4-n}function qV(e){var t,n=oE(e),r=n[0],i=n[1],s=new zV(WV(e,r,i)),o=0,a=i>0?r-4:r,c;for(c=0;c<a;c+=4)t=Is[e.charCodeAt(c)]<<18|Is[e.charCodeAt(c+1)]<<12|Is[e.charCodeAt(c+2)]<<6|Is[e.charCodeAt(c+3)],s[o++]=t>>16&255,s[o++]=t>>8&255,s[o++]=t&255;return i===2&&(t=Is[e.charCodeAt(c)]<<2|Is[e.charCodeAt(c+1)]>>4,s[o++]=t&255),i===1&&(t=Is[e.charCodeAt(c)]<<10|Is[e.charCodeAt(c+1)]<<4|Is[e.charCodeAt(c+2)]>>2,s[o++]=t>>8&255,s[o++]=t&255),s}function ZV(e){return So[e>>18&63]+So[e>>12&63]+So[e>>6&63]+So[e&63]}function QV(e,t,n){for(var r,i=[],s=t;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),i.push(ZV(r));return i.join("")}function KV(e){for(var t,n=e.length,r=n%3,i=[],s=16383,o=0,a=n-r;o<a;o+=s)i.push(QV(e,o,o+s>a?a:o+s));return r===1?(t=e[n-1],i.push(So[t>>2]+So[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(So[t>>10]+So[t>>4&63]+So[t<<2&63]+"=")),i.join("")}var N3={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */N3.read=function(e,t,n,r,i){var s,o,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,s=h&(1<<-f)-1,h>>=-f,f+=a;f>0;s=s*256+e[t+u],u+=d,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=r;f>0;o=o*256+e[t+u],u+=d,f-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-l}return(h?-1:1)*o*Math.pow(2,s-r)},N3.write=function(e,t,n,r,i,s){var o,a,c,l=s*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:s-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,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+u>=1?t+=d/c:t+=d*Math.pow(2,1-u),t*c>=2&&(o++,c/=2),o+u>=f?(a=0,o=f):o+u>=1?(a=(t*c-1)*Math.pow(2,i),o=o+u):(a=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;e[n+h]=a&255,h+=p,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;e[n+h]=o&255,h+=p,o/=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>
|
|
File without changes
|
package/dist/kayros-AIrUK1za.js
CHANGED
|
File without changes
|
package/dist/keplr-CyLTca9B.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/meetone-kKmvI8md.js
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/mykey-CQZ6UcLH.js
CHANGED
|
File without changes
|
package/dist/native-FDN9oNjc.js
CHANGED
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as D, t as ue, q as h, B as f, o as He, s as I, y as ce, C as ze, u as je, d as P, n as w, f as $, g as U, e as te } from "./Web3Auth-
|
|
1
|
+
import { i as D, t as ue, q as h, B as f, o as He, s as I, y as ce, C as ze, u as je, d as P, n as w, f as $, g as U, e as te } from "./Web3Auth-BZvmXZfr.js";
|
|
2
2
|
function A(e) {
|
|
3
3
|
if (!Number.isSafeInteger(e) || e < 0)
|
|
4
4
|
throw new Error(`Wrong positive integer: ${e}`);
|
|
File without changes
|
package/dist/oneInch-CciyZ4Pz.js
CHANGED
|
File without changes
|
package/dist/onekey-Dal8kYjU.js
CHANGED
|
File without changes
|
package/dist/opera-DnKg-TJU.js
CHANGED
|
File without changes
|
package/dist/ownbit-BshJUVuW.js
CHANGED
|
File without changes
|
package/dist/phantom-CJ8dIcov.js
CHANGED
|
File without changes
|
package/dist/rabby-D4thTcd6.js
CHANGED
|
File without changes
|
package/dist/rainbow-mXld6yWV.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/safepal-DVIKy94N.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/status-FrAvQjfn.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/tp-V2em5bdl.js
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/trust-SgHubMq7.js
CHANGED
|
File without changes
|
package/dist/xdefi-COVIyGz4.js
CHANGED
|
File without changes
|
package/dist/zeal-DxHbDqm0.js
CHANGED
|
File without changes
|
package/dist/zerion-BfW0UElc.js
CHANGED
|
File without changes
|
|
File without changes
|
package/index.html
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>Vite + React + TS</title>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="root"></div>
|
|
11
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Vite + React + TS</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@springmicro/auth",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"react-social-login-buttons": "^4.1.0",
|
|
54
54
|
"uuid": "^9.0.1"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "f0aee01ae9b45595f59d70a5fdf9cae8933edb24"
|
|
57
57
|
}
|
|
Binary file
|
package/src/auth/config.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { SignUpFormState } from "../SignUp";
|
|
3
|
-
import type { Application } from "./util/provider";
|
|
4
|
-
|
|
5
|
-
export type AgreementModalProps = {
|
|
6
|
-
application: Application;
|
|
7
|
-
state: SignUpFormState;
|
|
8
|
-
setState: React.Dispatch<React.SetStateAction<SignUpFormState>>;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export function AgreementModal({
|
|
12
|
-
application,
|
|
13
|
-
state,
|
|
14
|
-
setState,
|
|
15
|
-
}: AgreementModalProps) {
|
|
16
|
-
const [visible, setVisible] = React.useState(false);
|
|
17
|
-
const dialogRef = React.useRef<HTMLDialogElement | null>(null);
|
|
18
|
-
|
|
19
|
-
React.useEffect(() => {
|
|
20
|
-
if (!dialogRef.current) {
|
|
21
|
-
dialogRef.current = document.getElementById(
|
|
22
|
-
"agreementDialog"
|
|
23
|
-
) as HTMLDialogElement | null;
|
|
24
|
-
}
|
|
25
|
-
}, []);
|
|
26
|
-
|
|
27
|
-
React.useEffect(() => {
|
|
28
|
-
if (dialogRef.current) {
|
|
29
|
-
if (visible) {
|
|
30
|
-
dialogRef.current.showModal();
|
|
31
|
-
} else {
|
|
32
|
-
dialogRef.current.close();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}, [visible]);
|
|
36
|
-
|
|
37
|
-
const handleCancel = () => {
|
|
38
|
-
setState({ ...state, agreement: false });
|
|
39
|
-
setVisible(false);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const handleOk = () => {
|
|
43
|
-
setState({ ...state, agreement: true });
|
|
44
|
-
setVisible(false);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const handleOpen = () => {
|
|
48
|
-
setVisible(true);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<>
|
|
53
|
-
<dialog id="agreementDialog" className="modal">
|
|
54
|
-
<div className="modal-box">
|
|
55
|
-
<div className="mt-4 mb-8">
|
|
56
|
-
<iframe
|
|
57
|
-
src={application.termsOfUse}
|
|
58
|
-
width="100%"
|
|
59
|
-
height="300px"
|
|
60
|
-
sandbox="allow-scripts"
|
|
61
|
-
/>
|
|
62
|
-
</div>
|
|
63
|
-
<div className="modal-action">
|
|
64
|
-
<form method="dialog" className="modal-backdrop">
|
|
65
|
-
{/* if there is a button in form, it will close the modal */}
|
|
66
|
-
<button>Close</button>
|
|
67
|
-
</form>
|
|
68
|
-
<form method="dialog" className="flex gap-3">
|
|
69
|
-
<button className="btn" onClick={handleCancel} key="closebtn">
|
|
70
|
-
Cancel
|
|
71
|
-
</button>
|
|
72
|
-
<button
|
|
73
|
-
className="btn btn-primary"
|
|
74
|
-
// disabled={isOkDisabled}
|
|
75
|
-
onClick={handleOk}
|
|
76
|
-
key="okbtn"
|
|
77
|
-
>
|
|
78
|
-
OK
|
|
79
|
-
</button>
|
|
80
|
-
</form>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
</dialog>
|
|
84
|
-
<input checked={!!state.agreement} type="checkbox" readOnly />
|
|
85
|
-
<button onClick={handleOpen}>Open Terms</button>
|
|
86
|
-
</>
|
|
87
|
-
);
|
|
88
|
-
}
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SignUpFormState } from "../SignUp";
|
|
3
|
+
import type { Application } from "./util/provider";
|
|
4
|
+
|
|
5
|
+
export type AgreementModalProps = {
|
|
6
|
+
application: Application;
|
|
7
|
+
state: SignUpFormState;
|
|
8
|
+
setState: React.Dispatch<React.SetStateAction<SignUpFormState>>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export function AgreementModal({
|
|
12
|
+
application,
|
|
13
|
+
state,
|
|
14
|
+
setState,
|
|
15
|
+
}: AgreementModalProps) {
|
|
16
|
+
const [visible, setVisible] = React.useState(false);
|
|
17
|
+
const dialogRef = React.useRef<HTMLDialogElement | null>(null);
|
|
18
|
+
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
if (!dialogRef.current) {
|
|
21
|
+
dialogRef.current = document.getElementById(
|
|
22
|
+
"agreementDialog"
|
|
23
|
+
) as HTMLDialogElement | null;
|
|
24
|
+
}
|
|
25
|
+
}, []);
|
|
26
|
+
|
|
27
|
+
React.useEffect(() => {
|
|
28
|
+
if (dialogRef.current) {
|
|
29
|
+
if (visible) {
|
|
30
|
+
dialogRef.current.showModal();
|
|
31
|
+
} else {
|
|
32
|
+
dialogRef.current.close();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}, [visible]);
|
|
36
|
+
|
|
37
|
+
const handleCancel = () => {
|
|
38
|
+
setState({ ...state, agreement: false });
|
|
39
|
+
setVisible(false);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const handleOk = () => {
|
|
43
|
+
setState({ ...state, agreement: true });
|
|
44
|
+
setVisible(false);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const handleOpen = () => {
|
|
48
|
+
setVisible(true);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<>
|
|
53
|
+
<dialog id="agreementDialog" className="modal">
|
|
54
|
+
<div className="modal-box">
|
|
55
|
+
<div className="mt-4 mb-8">
|
|
56
|
+
<iframe
|
|
57
|
+
src={application.termsOfUse}
|
|
58
|
+
width="100%"
|
|
59
|
+
height="300px"
|
|
60
|
+
sandbox="allow-scripts"
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
<div className="modal-action">
|
|
64
|
+
<form method="dialog" className="modal-backdrop">
|
|
65
|
+
{/* if there is a button in form, it will close the modal */}
|
|
66
|
+
<button>Close</button>
|
|
67
|
+
</form>
|
|
68
|
+
<form method="dialog" className="flex gap-3">
|
|
69
|
+
<button className="btn" onClick={handleCancel} key="closebtn">
|
|
70
|
+
Cancel
|
|
71
|
+
</button>
|
|
72
|
+
<button
|
|
73
|
+
className="btn btn-primary"
|
|
74
|
+
// disabled={isOkDisabled}
|
|
75
|
+
onClick={handleOk}
|
|
76
|
+
key="okbtn"
|
|
77
|
+
>
|
|
78
|
+
OK
|
|
79
|
+
</button>
|
|
80
|
+
</form>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</dialog>
|
|
84
|
+
<input checked={!!state.agreement} type="checkbox" readOnly />
|
|
85
|
+
<button onClick={handleOpen}>Open Terms</button>
|
|
86
|
+
</>
|
|
87
|
+
);
|
|
88
|
+
}
|