@volr/react-ui 0.1.135 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1057 -518
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -3
- package/dist/index.d.ts +30 -3
- package/dist/index.js +855 -316
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React14 = require('react');
|
|
4
4
|
var reactDom = require('react-dom');
|
|
5
5
|
var react = require('@volr/react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -10,7 +10,7 @@ var qrcode_react = require('qrcode.react');
|
|
|
10
10
|
|
|
11
11
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var React14__default = /*#__PURE__*/_interopDefault(React14);
|
|
14
14
|
|
|
15
15
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
16
16
|
var __esm = (fn, res) => function __init() {
|
|
@@ -535,7 +535,7 @@ var en = {
|
|
|
535
535
|
titleFingerprint: "Set up fingerprint login",
|
|
536
536
|
titleQrCode: "Set up mobile login",
|
|
537
537
|
// Short description
|
|
538
|
-
description: "
|
|
538
|
+
description: "Register once and sign in easily from now on.",
|
|
539
539
|
// Legacy keys for backward compatibility
|
|
540
540
|
touchId: "Use Touch ID to create your passkey",
|
|
541
541
|
faceId: "Use Face ID to create your passkey",
|
|
@@ -604,6 +604,12 @@ var en = {
|
|
|
604
604
|
walletAddress: "Wallet Address",
|
|
605
605
|
email: "Email",
|
|
606
606
|
logout: "Log out",
|
|
607
|
+
setup: {
|
|
608
|
+
title: "Create your wallet",
|
|
609
|
+
description: "To see balances and use wallet features, you need a wallet. It takes about 1 second.",
|
|
610
|
+
cta: "Create wallet in 1 second",
|
|
611
|
+
logout: "Log out"
|
|
612
|
+
},
|
|
607
613
|
totalBalance: "Total Balance",
|
|
608
614
|
noAssets: "No assets configured",
|
|
609
615
|
menu: {
|
|
@@ -696,7 +702,29 @@ var en = {
|
|
|
696
702
|
messageLabel: "Message",
|
|
697
703
|
domainLabel: "Domain"
|
|
698
704
|
},
|
|
705
|
+
walletRequired: {
|
|
706
|
+
ariaLabel: "Create wallet",
|
|
707
|
+
titleTx: "Create your wallet to continue",
|
|
708
|
+
titleMessage: "Create your wallet to continue",
|
|
709
|
+
titleTypedData: "Create your wallet to continue",
|
|
710
|
+
description: "Create a wallet in about 1 second to continue.",
|
|
711
|
+
cta: "Create wallet in 1 second",
|
|
712
|
+
notNow: "Not now"
|
|
713
|
+
},
|
|
699
714
|
payment: {
|
|
715
|
+
walletChoice: {
|
|
716
|
+
title: "Choose how to pay",
|
|
717
|
+
description: "Use your existing wallet, or create a wallet in about 1 second.",
|
|
718
|
+
externalCta: "Use my wallet",
|
|
719
|
+
createAccountCta: "Create wallet in 1 second",
|
|
720
|
+
externalDisabledNative: "External wallet payments are available for ERC-20 permit tokens only.",
|
|
721
|
+
externalTitle: "Select a wallet",
|
|
722
|
+
externalDescription: "Connect your wallet to sign a one-time permission for this payment.",
|
|
723
|
+
noWalletsDetected: "No wallets detected. Please install a wallet like MetaMask.",
|
|
724
|
+
connect: "Connect",
|
|
725
|
+
connecting: "Connecting...",
|
|
726
|
+
externalConnectFailed: "Failed to connect wallet. Please try again."
|
|
727
|
+
},
|
|
700
728
|
processing: {
|
|
701
729
|
signing: "Confirming payment...",
|
|
702
730
|
broadcasting: "Sending payment...",
|
|
@@ -792,7 +820,7 @@ var ko = {
|
|
|
792
820
|
titleFingerprint: "\uC9C0\uBB38 \uB85C\uADF8\uC778 \uC124\uC815",
|
|
793
821
|
titleQrCode: "\uD734\uB300\uD3F0\uC73C\uB85C \uB85C\uADF8\uC778 \uC124\uC815",
|
|
794
822
|
// Short description
|
|
795
|
-
description: "\uD55C \uBC88 \uB4F1\uB85D\uD558\
|
|
823
|
+
description: "\uD55C \uBC88 \uB4F1\uB85D\uD558\uACE0 \uB2E4\uC74C\uBD80\uD130 \uAC04\uD3B8\uD558\uAC8C \uB85C\uADF8\uC778\uD558\uC138\uC694",
|
|
796
824
|
// Legacy keys for backward compatibility
|
|
797
825
|
touchId: "Touch ID\uB97C \uC0AC\uC6A9\uD558\uC5EC \uD328\uC2A4\uD0A4\uB97C \uC0DD\uC131\uD558\uC138\uC694",
|
|
798
826
|
faceId: "Face ID\uB97C \uC0AC\uC6A9\uD558\uC5EC \uD328\uC2A4\uD0A4\uB97C \uC0DD\uC131\uD558\uC138\uC694",
|
|
@@ -886,6 +914,12 @@ var ko = {
|
|
|
886
914
|
walletAddress: "\uC9C0\uAC11 \uC8FC\uC18C",
|
|
887
915
|
email: "\uC774\uBA54\uC77C",
|
|
888
916
|
logout: "\uB85C\uADF8\uC544\uC6C3",
|
|
917
|
+
setup: {
|
|
918
|
+
title: "\uC9C0\uAC11 \uB9CC\uB4E4\uAE30",
|
|
919
|
+
description: "\uC794\uACE0 \uD655\uC778\uACFC \uC9C0\uAC11 \uAE30\uB2A5\uC744 \uC0AC\uC6A9\uD558\uB824\uBA74 \uC9C0\uAC11\uC774 \uD544\uC694\uD574\uC694. 1\uCD08\uBA74 \uB05D\uB098\uC694.",
|
|
920
|
+
cta: "1\uCD08\uB9CC\uC5D0 \uC9C0\uAC11 \uB9CC\uB4E4\uAE30",
|
|
921
|
+
logout: "\uB85C\uADF8\uC544\uC6C3"
|
|
922
|
+
},
|
|
889
923
|
totalBalance: "\uCD1D \uC794\uACE0",
|
|
890
924
|
noAssets: "\uC124\uC815\uB41C \uC790\uC0B0\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",
|
|
891
925
|
menu: {
|
|
@@ -978,7 +1012,29 @@ var ko = {
|
|
|
978
1012
|
messageLabel: "\uBA54\uC2DC\uC9C0",
|
|
979
1013
|
domainLabel: "\uB3C4\uBA54\uC778"
|
|
980
1014
|
},
|
|
1015
|
+
walletRequired: {
|
|
1016
|
+
ariaLabel: "\uC9C0\uAC11 \uC0DD\uC131",
|
|
1017
|
+
titleTx: "\uACC4\uC18D\uD558\uB824\uBA74 \uC9C0\uAC11\uC774 \uD544\uC694\uD574\uC694",
|
|
1018
|
+
titleMessage: "\uACC4\uC18D\uD558\uB824\uBA74 \uC9C0\uAC11\uC774 \uD544\uC694\uD574\uC694",
|
|
1019
|
+
titleTypedData: "\uACC4\uC18D\uD558\uB824\uBA74 \uC9C0\uAC11\uC774 \uD544\uC694\uD574\uC694",
|
|
1020
|
+
description: "1\uCD08\uB9CC\uC5D0 \uC9C0\uAC11\uC744 \uB9CC\uB4E4\uACE0 \uACC4\uC18D \uC9C4\uD589\uD558\uC138\uC694.",
|
|
1021
|
+
cta: "1\uCD08\uB9CC\uC5D0 \uC9C0\uAC11 \uB9CC\uB4E4\uAE30",
|
|
1022
|
+
notNow: "\uC9C0\uAE08\uC740 \uC548 \uD560\uB798\uC694"
|
|
1023
|
+
},
|
|
981
1024
|
payment: {
|
|
1025
|
+
walletChoice: {
|
|
1026
|
+
title: "\uACB0\uC81C \uBC29\uBC95\uC744 \uC120\uD0DD\uD558\uC138\uC694",
|
|
1027
|
+
description: "\uAE30\uC874 \uC9C0\uAC11\uC73C\uB85C \uACB0\uC81C\uD558\uAC70\uB098, 1\uCD08\uB9CC\uC5D0 \uC9C0\uAC11\uC744 \uB9CC\uB4E4 \uC218 \uC788\uC5B4\uC694.",
|
|
1028
|
+
externalCta: "\uB0B4 \uC9C0\uAC11\uC73C\uB85C \uACB0\uC81C",
|
|
1029
|
+
createAccountCta: "1\uCD08\uB9CC\uC5D0 \uC9C0\uAC11 \uB9CC\uB4E4\uAE30",
|
|
1030
|
+
externalDisabledNative: "\uC678\uBD80 \uC9C0\uAC11 \uACB0\uC81C\uB294 ERC-20 permit \uD1A0\uD070\uC5D0\uC11C\uB9CC \uC9C0\uC6D0\uB3FC\uC694.",
|
|
1031
|
+
externalTitle: "\uC9C0\uAC11 \uC120\uD0DD",
|
|
1032
|
+
externalDescription: "\uC774\uBC88 \uACB0\uC81C\uB97C \uC704\uD55C 1\uD68C\uC131 \uAD8C\uD55C \uC11C\uBA85\uC744 \uC9C4\uD589\uD569\uB2C8\uB2E4.",
|
|
1033
|
+
noWalletsDetected: "\uAC10\uC9C0\uB41C \uC9C0\uAC11\uC774 \uC5C6\uC5B4\uC694. MetaMask \uAC19\uC740 \uC9C0\uAC11\uC744 \uC124\uCE58\uD574\uC8FC\uC138\uC694.",
|
|
1034
|
+
connect: "\uC5F0\uACB0",
|
|
1035
|
+
connecting: "\uC5F0\uACB0 \uC911...",
|
|
1036
|
+
externalConnectFailed: "\uC9C0\uAC11 \uC5F0\uACB0\uC5D0 \uC2E4\uD328\uD588\uC5B4\uC694. \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694."
|
|
1037
|
+
},
|
|
982
1038
|
processing: {
|
|
983
1039
|
signing: "\uACB0\uC81C \uD655\uC778 \uC911...",
|
|
984
1040
|
broadcasting: "\uACB0\uC81C \uC804\uC1A1 \uC911...",
|
|
@@ -1016,13 +1072,13 @@ var translations = {
|
|
|
1016
1072
|
function getTranslations(locale = "en") {
|
|
1017
1073
|
return translations[locale] || translations.en;
|
|
1018
1074
|
}
|
|
1019
|
-
var I18nContext =
|
|
1075
|
+
var I18nContext = React14.createContext(null);
|
|
1020
1076
|
function interpolate(text, params) {
|
|
1021
1077
|
if (!params) return text;
|
|
1022
1078
|
return text.replace(/\{\{(\w+)\}\}/g, (_, key) => params[key] ?? `{{${key}}}`);
|
|
1023
1079
|
}
|
|
1024
1080
|
function useI18n() {
|
|
1025
|
-
const context =
|
|
1081
|
+
const context = React14.useContext(I18nContext);
|
|
1026
1082
|
if (!context) {
|
|
1027
1083
|
return {
|
|
1028
1084
|
locale: "en",
|
|
@@ -1057,9 +1113,9 @@ function detectLocale() {
|
|
|
1057
1113
|
return lang.startsWith("ko") ? "ko" : "en";
|
|
1058
1114
|
}
|
|
1059
1115
|
function I18nProvider({ children }) {
|
|
1060
|
-
const [locale, setLocale] =
|
|
1061
|
-
const translations2 =
|
|
1062
|
-
const t =
|
|
1116
|
+
const [locale, setLocale] = React14.useState(detectLocale());
|
|
1117
|
+
const translations2 = React14.useMemo(() => getTranslations(locale), [locale]);
|
|
1118
|
+
const t = React14.useMemo(() => {
|
|
1063
1119
|
return (key, params) => {
|
|
1064
1120
|
const keys = key.split(".");
|
|
1065
1121
|
let value2 = translations2;
|
|
@@ -1076,7 +1132,7 @@ function I18nProvider({ children }) {
|
|
|
1076
1132
|
return typeof value2 === "string" ? interpolate(value2, params) : key;
|
|
1077
1133
|
};
|
|
1078
1134
|
}, [translations2]);
|
|
1079
|
-
const value =
|
|
1135
|
+
const value = React14.useMemo(
|
|
1080
1136
|
() => ({
|
|
1081
1137
|
locale,
|
|
1082
1138
|
translations: translations2,
|
|
@@ -1088,9 +1144,9 @@ function I18nProvider({ children }) {
|
|
|
1088
1144
|
return /* @__PURE__ */ jsxRuntime.jsx(I18nContext.Provider, { value, children });
|
|
1089
1145
|
}
|
|
1090
1146
|
var useTranslation = useI18n;
|
|
1091
|
-
var VolrModalContext =
|
|
1147
|
+
var VolrModalContext = React14.createContext(null);
|
|
1092
1148
|
var useVolrModal = () => {
|
|
1093
|
-
const context =
|
|
1149
|
+
const context = React14.useContext(VolrModalContext);
|
|
1094
1150
|
if (!context) {
|
|
1095
1151
|
throw new Error("useVolrModal must be used within VolrUIProvider");
|
|
1096
1152
|
}
|
|
@@ -1099,17 +1155,17 @@ var useVolrModal = () => {
|
|
|
1099
1155
|
var VolrModalProvider = ({
|
|
1100
1156
|
children
|
|
1101
1157
|
}) => {
|
|
1102
|
-
const [isOpen, setIsOpen] =
|
|
1103
|
-
const [mode, setMode] =
|
|
1104
|
-
const [asset, setAsset] =
|
|
1105
|
-
const [paymentOptions, setPaymentOptions] =
|
|
1106
|
-
const open =
|
|
1158
|
+
const [isOpen, setIsOpen] = React14.useState(false);
|
|
1159
|
+
const [mode, setMode] = React14.useState("account");
|
|
1160
|
+
const [asset, setAsset] = React14.useState(null);
|
|
1161
|
+
const [paymentOptions, setPaymentOptions] = React14.useState(null);
|
|
1162
|
+
const open = React14.useCallback((options) => {
|
|
1107
1163
|
setMode(options?.mode ?? "account");
|
|
1108
1164
|
setAsset(options?.asset ?? null);
|
|
1109
1165
|
setPaymentOptions(options?.payment ?? null);
|
|
1110
1166
|
setIsOpen(true);
|
|
1111
1167
|
}, []);
|
|
1112
|
-
const close =
|
|
1168
|
+
const close = React14.useCallback(() => {
|
|
1113
1169
|
setIsOpen(false);
|
|
1114
1170
|
setAsset(null);
|
|
1115
1171
|
setPaymentOptions(null);
|
|
@@ -1123,11 +1179,11 @@ function cn(...inputs) {
|
|
|
1123
1179
|
return twMerge(clsx.clsx(inputs));
|
|
1124
1180
|
}
|
|
1125
1181
|
function useMediaQuery(query) {
|
|
1126
|
-
const [matches, setMatches] =
|
|
1182
|
+
const [matches, setMatches] = React14.useState(() => {
|
|
1127
1183
|
if (typeof window === "undefined") return false;
|
|
1128
1184
|
return window.matchMedia(query).matches;
|
|
1129
1185
|
});
|
|
1130
|
-
|
|
1186
|
+
React14.useEffect(() => {
|
|
1131
1187
|
if (typeof window === "undefined") return;
|
|
1132
1188
|
const mql = window.matchMedia(query);
|
|
1133
1189
|
const handler = (event) => setMatches(event.matches);
|
|
@@ -1139,14 +1195,14 @@ function useMediaQuery(query) {
|
|
|
1139
1195
|
}
|
|
1140
1196
|
|
|
1141
1197
|
// src/generated/volr-sdk-css.ts
|
|
1142
|
-
var VOLR_SDK_CSS = '/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--volr-tw-translate-x:0;--volr-tw-translate-y:0;--volr-tw-translate-z:0;--volr-tw-space-y-reverse:0;--volr-tw-border-style:solid;--volr-tw-gradient-position:initial;--volr-tw-gradient-from:#0000;--volr-tw-gradient-via:#0000;--volr-tw-gradient-to:#0000;--volr-tw-gradient-stops:initial;--volr-tw-gradient-via-stops:initial;--volr-tw-gradient-from-position:0%;--volr-tw-gradient-via-position:50%;--volr-tw-gradient-to-position:100%;--volr-tw-leading:initial;--volr-tw-font-weight:initial;--volr-tw-tracking:initial;--volr-tw-shadow:0 0 #0000;--volr-tw-shadow-color:initial;--volr-tw-shadow-alpha:100%;--volr-tw-inset-shadow:0 0 #0000;--volr-tw-inset-shadow-color:initial;--volr-tw-inset-shadow-alpha:100%;--volr-tw-ring-color:initial;--volr-tw-ring-shadow:0 0 #0000;--volr-tw-inset-ring-color:initial;--volr-tw-inset-ring-shadow:0 0 #0000;--volr-tw-ring-inset:initial;--volr-tw-ring-offset-width:0px;--volr-tw-ring-offset-color:#fff;--volr-tw-ring-offset-shadow:0 0 #0000;--volr-tw-blur:initial;--volr-tw-brightness:initial;--volr-tw-contrast:initial;--volr-tw-grayscale:initial;--volr-tw-hue-rotate:initial;--volr-tw-invert:initial;--volr-tw-opacity:initial;--volr-tw-saturate:initial;--volr-tw-sepia:initial;--volr-tw-drop-shadow:initial;--volr-tw-drop-shadow-color:initial;--volr-tw-drop-shadow-alpha:100%;--volr-tw-drop-shadow-size:initial;--volr-tw-duration:initial;--volr-tw-ease:initial}}}@layer theme{:root,:host{--volr-font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--volr-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--volr-color-red-50:oklch(97.1% .013 17.38);--volr-color-red-100:oklch(93.6% .032 17.717);--volr-color-red-200:oklch(88.5% .062 18.334);--volr-color-red-500:oklch(63.7% .237 25.331);--volr-color-red-600:oklch(57.7% .245 27.325);--volr-color-red-700:oklch(50.5% .213 27.518);--volr-color-amber-50:oklch(98.7% .022 95.277);--volr-color-amber-200:oklch(92.4% .12 95.746);--volr-color-amber-700:oklch(55.5% .163 48.998);--volr-color-yellow-100:oklch(97.3% .071 103.193);--volr-color-yellow-700:oklch(55.4% .135 66.442);--volr-color-green-50:oklch(98.2% .018 155.826);--volr-color-green-100:oklch(96.2% .044 156.743);--volr-color-green-600:oklch(62.7% .194 149.214);--volr-color-green-700:oklch(52.7% .154 150.069);--volr-color-emerald-300:oklch(84.5% .143 164.978);--volr-color-emerald-400:oklch(76.5% .177 163.223);--volr-color-emerald-500:oklch(69.6% .17 162.48);--volr-color-emerald-600:oklch(59.6% .145 163.225);--volr-color-teal-400:oklch(77.7% .152 181.912);--volr-color-teal-500:oklch(70.4% .14 182.503);--volr-color-cyan-400:oklch(78.9% .154 211.53);--volr-color-blue-100:oklch(93.2% .032 255.585);--volr-color-blue-700:oklch(48.8% .243 264.376);--volr-color-slate-50:oklch(98.4% .003 247.858);--volr-color-slate-100:oklch(96.8% .007 247.896);--volr-color-slate-200:oklch(92.9% .013 255.508);--volr-color-slate-300:oklch(86.9% .022 252.894);--volr-color-slate-400:oklch(70.4% .04 256.788);--volr-color-slate-500:oklch(55.4% .046 257.417);--volr-color-slate-600:oklch(44.6% .043 257.281);--volr-color-slate-700:oklch(37.2% .044 257.287);--volr-color-slate-900:oklch(20.8% .042 265.755);--volr-color-gray-500:oklch(55.1% .027 264.364);--volr-color-black:#000;--volr-color-white:#fff;--volr-spacing:.25rem;--volr-container-md:28rem;--volr-container-4xl:56rem;--volr-text-xs:.75rem;--volr-text-xs--line-height:calc(1/.75);--volr-text-sm:.875rem;--volr-text-sm--line-height:calc(1.25/.875);--volr-text-base:1rem;--volr-text-base--line-height:calc(1.5/1);--volr-text-lg:1.125rem;--volr-text-lg--line-height:calc(1.75/1.125);--volr-text-xl:1.25rem;--volr-text-xl--line-height:calc(1.75/1.25);--volr-text-2xl:1.5rem;--volr-text-2xl--line-height:calc(2/1.5);--volr-text-8xl:6rem;--volr-text-8xl--line-height:1;--volr-font-weight-medium:500;--volr-font-weight-semibold:600;--volr-font-weight-bold:700;--volr-tracking-wide:.025em;--volr-leading-relaxed:1.625;--volr-radius-md:.375rem;--volr-radius-lg:.5rem;--volr-radius-xl:.75rem;--volr-radius-2xl:1rem;--volr-radius-3xl:1.5rem;--volr-ease-out:cubic-bezier(0,0,.2,1);--volr-animate-spin:spin 1s linear infinite;--volr-animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--volr-animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--volr-blur-2xl:40px;--volr-default-transition-duration:.15s;--volr-default-transition-timing-function:cubic-bezier(.4,0,.2,1);--volr-default-font-family:var(--volr-font-sans);--volr-default-mono-font-family:var(--volr-font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--volr-default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--volr-default-font-feature-settings,normal);font-variation-settings:var(--volr-default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--volr-default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--volr-default-mono-font-feature-settings,normal);font-variation-settings:var(--volr-default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{--volr-primary-color:var(--volr-accent-color,#303030);--volr-font-family:var(--volr-custom-font,inherit);--volr-bg:#fff;--volr-bg-secondary:#f8fafc;--volr-bg-tertiary:#f1f5f9;--volr-text:#0f172a;--volr-text-secondary:#475569;--volr-text-muted:#94a3b8;--volr-border:#e2e8f0;--volr-border-strong:#cbd5e1;--volr-hover-bg:#f8fafc;--volr-error-bg:#fef2f2;--volr-error-border:#fecaca;--volr-error-text:#991b1b;--volr-hint-bg:#f8fafc;--volr-hint-border:#e2e8f0;--volr-hint-text:#334155}:host([data-theme=dark]){--volr-bg:#1c1c1e;--volr-bg-secondary:#2c2c2e;--volr-bg-tertiary:#3a3a3c;--volr-text:#f5f5f7;--volr-text-secondary:#c7c7cc;--volr-text-muted:#8e8e93;--volr-border:#3a3a3c;--volr-border-strong:#48484a;--volr-hover-bg:#2c2c2e;--volr-error-bg:#3c1f1f;--volr-error-border:#7f1d1d;--volr-error-text:#fca5a5;--volr-hint-bg:#2c2c2e;--volr-hint-border:#3a3a3c;--volr-hint-text:#c7c7cc}*,:before,:after{box-sizing:border-box}*{font-family:var(--volr-font-family);color:var(--volr-text)}button,input,select,textarea{color:var(--volr-text);background-color:#0000}button{cursor:pointer;background-color:#0000}input::placeholder{color:var(--volr-text-muted)}h1,h2,h3{color:var(--volr-text);margin:0;font-weight:700}h1{font-size:1.875rem;line-height:2.25rem}h2{font-size:1.5rem;line-height:2rem}h3{font-size:1.25rem;line-height:1.75rem}p{margin:0}}@layer components{.volr-dialog-overlay{inset:calc(var(--volr-spacing)*0);z-index:40;background-color:var(--volr-color-black);position:fixed}@supports (color:color-mix(in lab, red, red)){.volr-dialog-overlay{background-color:color-mix(in oklab,var(--volr-color-black)45%,transparent)}}.volr-dialog-content{z-index:50;border-radius:var(--volr-radius-2xl);border-style:var(--volr-tw-border-style);padding:calc(var(--volr-spacing)*7);--volr-tw-shadow:0 20px 25px -5px var(--volr-tw-shadow-color,#0000001a),0 8px 10px -6px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow);background-color:var(--volr-bg);border-width:1px;border-color:var(--volr-border-strong);width:calc(100% - 2rem);max-width:28rem;max-height:85vh;position:fixed;top:50%;left:50%;overflow-y:auto;transform:translate(-50%,-50%)}@media (max-width:640px){.volr-dialog-content{top:auto;right:calc(var(--volr-spacing)*0);bottom:calc(var(--volr-spacing)*0);left:calc(var(--volr-spacing)*0);border-radius:1.25rem 1.25rem 0 0;width:100%;max-width:100%;margin:0 auto;transform:translateY(0)}}.volr-dialog-close{top:calc(var(--volr-spacing)*4);right:calc(var(--volr-spacing)*4);height:calc(var(--volr-spacing)*8);width:calc(var(--volr-spacing)*8);color:var(--volr-text-muted);cursor:pointer;background-color:#0000;border:none;border-radius:3.40282e38px;justify-content:center;align-items:center;display:inline-flex;position:absolute}.volr-dialog-close:hover{background-color:var(--volr-hover-bg);color:var(--volr-text-secondary)}.volr-dialog-close:focus-visible{box-shadow:0 0 0 2px var(--volr-border-strong);outline:none}.volr-dialog-close-icon{height:calc(var(--volr-spacing)*4);width:calc(var(--volr-spacing)*4)}.volr-email-input{border:1px solid var(--volr-border-strong);background-color:var(--volr-bg);width:100%;color:var(--volr-text);border-radius:.5rem;outline:none;padding:.75rem .75rem .75rem 2.75rem;font-size:1rem;line-height:1.5}.volr-email-input::placeholder{color:var(--volr-text-muted)}.volr-email-input:focus{border-color:var(--volr-border-strong);box-shadow:0 0 0 2px var(--volr-border-strong)}.volr-option-button{border:1px solid var(--volr-border);background-color:var(--volr-bg);width:100%;color:var(--volr-text);cursor:pointer;border-radius:.5rem;align-items:center;gap:.75rem;padding:.75rem;transition:background-color .15s ease-out,border-color .15s ease-out,box-shadow .15s ease-out;display:flex}.volr-option-button:hover{background-color:var(--volr-hover-bg);border-color:var(--volr-border)}.volr-option-button:focus-visible{box-shadow:0 0 0 2px var(--volr-border-strong);outline:none}}@layer utilities{.volr\\:pointer-events-auto{pointer-events:auto}.volr\\:pointer-events-none{pointer-events:none}.volr\\:sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.volr\\:absolute{position:absolute}.volr\\:fixed{position:fixed}.volr\\:relative{position:relative}.volr\\:inset-0{inset:calc(var(--volr-spacing)*0)}.volr\\:-top-3{top:calc(var(--volr-spacing)*-3)}.volr\\:top-1\\/2{top:50%}.volr\\:-right-3{right:calc(var(--volr-spacing)*-3)}.volr\\:right-0{right:calc(var(--volr-spacing)*0)}.volr\\:right-2{right:calc(var(--volr-spacing)*2)}.volr\\:right-3{right:calc(var(--volr-spacing)*3)}.volr\\:bottom-0{bottom:calc(var(--volr-spacing)*0)}.volr\\:left-0{left:calc(var(--volr-spacing)*0)}.volr\\:left-3{left:calc(var(--volr-spacing)*3)}.volr\\:-z-10{z-index:calc(10*-1)}.volr\\:z-10{z-index:10}.volr\\:z-20{z-index:20}.volr\\:z-40{z-index:40}.volr\\:z-50{z-index:50}.volr\\:mx-auto{margin-inline:auto}.volr\\:my-6{margin-block:calc(var(--volr-spacing)*6)}.volr\\:mt-0\\.5{margin-top:calc(var(--volr-spacing)*.5)}.volr\\:mt-1{margin-top:calc(var(--volr-spacing)*1)}.volr\\:mt-2{margin-top:calc(var(--volr-spacing)*2)}.volr\\:mt-3{margin-top:calc(var(--volr-spacing)*3)}.volr\\:mt-4{margin-top:calc(var(--volr-spacing)*4)}.volr\\:mt-6{margin-top:calc(var(--volr-spacing)*6)}.volr\\:mt-8{margin-top:calc(var(--volr-spacing)*8)}.volr\\:mb-0\\.5{margin-bottom:calc(var(--volr-spacing)*.5)}.volr\\:mb-1{margin-bottom:calc(var(--volr-spacing)*1)}.volr\\:mb-2{margin-bottom:calc(var(--volr-spacing)*2)}.volr\\:mb-3{margin-bottom:calc(var(--volr-spacing)*3)}.volr\\:mb-4{margin-bottom:calc(var(--volr-spacing)*4)}.volr\\:mb-5{margin-bottom:calc(var(--volr-spacing)*5)}.volr\\:mb-6{margin-bottom:calc(var(--volr-spacing)*6)}.volr\\:mb-8{margin-bottom:calc(var(--volr-spacing)*8)}.volr\\:-ml-2{margin-left:calc(var(--volr-spacing)*-2)}.volr\\:ml-6{margin-left:calc(var(--volr-spacing)*6)}.volr\\:line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.volr\\:block{display:block}.volr\\:flex{display:flex}.volr\\:grid{display:grid}.volr\\:inline-block{display:inline-block}.volr\\:inline-flex{display:inline-flex}.volr\\:h-1{height:calc(var(--volr-spacing)*1)}.volr\\:h-1\\.5{height:calc(var(--volr-spacing)*1.5)}.volr\\:h-2{height:calc(var(--volr-spacing)*2)}.volr\\:h-3{height:calc(var(--volr-spacing)*3)}.volr\\:h-4{height:calc(var(--volr-spacing)*4)}.volr\\:h-5{height:calc(var(--volr-spacing)*5)}.volr\\:h-6{height:calc(var(--volr-spacing)*6)}.volr\\:h-7{height:calc(var(--volr-spacing)*7)}.volr\\:h-8{height:calc(var(--volr-spacing)*8)}.volr\\:h-10{height:calc(var(--volr-spacing)*10)}.volr\\:h-12{height:calc(var(--volr-spacing)*12)}.volr\\:h-14{height:calc(var(--volr-spacing)*14)}.volr\\:h-16{height:calc(var(--volr-spacing)*16)}.volr\\:h-20{height:calc(var(--volr-spacing)*20)}.volr\\:h-24{height:calc(var(--volr-spacing)*24)}.volr\\:h-40{height:calc(var(--volr-spacing)*40)}.volr\\:h-44{height:calc(var(--volr-spacing)*44)}.volr\\:h-48{height:calc(var(--volr-spacing)*48)}.volr\\:h-\\[0\\.8em\\]{height:.8em}.volr\\:h-\\[200px\\]{height:200px}.volr\\:h-full{height:100%}.volr\\:h-px{height:1px}.volr\\:max-h-48{max-height:calc(var(--volr-spacing)*48)}.volr\\:max-h-60{max-height:calc(var(--volr-spacing)*60)}.volr\\:max-h-64{max-height:calc(var(--volr-spacing)*64)}.volr\\:max-h-\\[85vh\\]{max-height:85vh}.volr\\:max-h-\\[90vh\\]{max-height:90vh}.volr\\:min-h-\\[100px\\]{min-height:100px}.volr\\:min-h-\\[120px\\]{min-height:120px}.volr\\:min-h-\\[500px\\]{min-height:500px}.volr\\:w-1\\.5{width:calc(var(--volr-spacing)*1.5)}.volr\\:w-2{width:calc(var(--volr-spacing)*2)}.volr\\:w-3{width:calc(var(--volr-spacing)*3)}.volr\\:w-4{width:calc(var(--volr-spacing)*4)}.volr\\:w-5{width:calc(var(--volr-spacing)*5)}.volr\\:w-6{width:calc(var(--volr-spacing)*6)}.volr\\:w-7{width:calc(var(--volr-spacing)*7)}.volr\\:w-8{width:calc(var(--volr-spacing)*8)}.volr\\:w-10{width:calc(var(--volr-spacing)*10)}.volr\\:w-12{width:calc(var(--volr-spacing)*12)}.volr\\:w-14{width:calc(var(--volr-spacing)*14)}.volr\\:w-16{width:calc(var(--volr-spacing)*16)}.volr\\:w-20{width:calc(var(--volr-spacing)*20)}.volr\\:w-24{width:calc(var(--volr-spacing)*24)}.volr\\:w-32{width:calc(var(--volr-spacing)*32)}.volr\\:w-36{width:calc(var(--volr-spacing)*36)}.volr\\:w-40{width:calc(var(--volr-spacing)*40)}.volr\\:w-44{width:calc(var(--volr-spacing)*44)}.volr\\:w-48{width:calc(var(--volr-spacing)*48)}.volr\\:w-\\[200px\\]{width:200px}.volr\\:w-auto{width:auto}.volr\\:w-full{width:100%}.volr\\:max-w-4xl{max-width:var(--volr-container-4xl)}.volr\\:max-w-full{max-width:100%}.volr\\:max-w-md{max-width:var(--volr-container-md)}.volr\\:max-w-none{max-width:none}.volr\\:min-w-0{min-width:calc(var(--volr-spacing)*0)}.volr\\:flex-1{flex:1}.volr\\:flex-shrink-0,.volr\\:shrink-0{flex-shrink:0}.volr\\:-translate-y-1\\/2{--volr-tw-translate-y:calc(calc(1/2*100%)*-1);translate:var(--volr-tw-translate-x)var(--volr-tw-translate-y)}.volr\\:rotate-90{rotate:90deg}.volr\\:rotate-180{rotate:180deg}.volr\\:animate-ping{animation:var(--volr-animate-ping)}.volr\\:animate-pulse{animation:var(--volr-animate-pulse)}.volr\\:animate-spin{animation:var(--volr-animate-spin)}.volr\\:cursor-not-allowed{cursor:not-allowed}.volr\\:cursor-pointer{cursor:pointer}.volr\\:list-inside{list-style-position:inside}.volr\\:list-decimal{list-style-type:decimal}.volr\\:grid-cols-\\[minmax\\(0\\,1\\.1fr\\)_minmax\\(0\\,1fr\\)\\]{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)}.volr\\:flex-col{flex-direction:column}.volr\\:items-baseline{align-items:baseline}.volr\\:items-center{align-items:center}.volr\\:items-end{align-items:flex-end}.volr\\:items-start{align-items:flex-start}.volr\\:justify-between{justify-content:space-between}.volr\\:justify-center{justify-content:center}.volr\\:gap-1{gap:calc(var(--volr-spacing)*1)}.volr\\:gap-2{gap:calc(var(--volr-spacing)*2)}.volr\\:gap-3{gap:calc(var(--volr-spacing)*3)}.volr\\:gap-4{gap:calc(var(--volr-spacing)*4)}:where(.volr\\:space-y-1>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*1)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*1)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-2>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*2)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*2)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-3>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*3)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*3)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-4>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*4)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*4)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-6>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*6)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*6)*calc(1 - var(--volr-tw-space-y-reverse)))}.volr\\:truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.volr\\:overflow-auto{overflow:auto}.volr\\:overflow-hidden{overflow:hidden}.volr\\:overflow-visible{overflow:visible}.volr\\:overflow-x-auto{overflow-x:auto}.volr\\:overflow-y-auto{overflow-y:auto}.volr\\:rounded{border-radius:.25rem}.volr\\:rounded-2xl{border-radius:var(--volr-radius-2xl)}.volr\\:rounded-full{border-radius:3.40282e38px}.volr\\:rounded-lg{border-radius:var(--volr-radius-lg)}.volr\\:rounded-md{border-radius:var(--volr-radius-md)}.volr\\:rounded-xl{border-radius:var(--volr-radius-xl)}.volr\\:rounded-t-2xl{border-top-left-radius:var(--volr-radius-2xl);border-top-right-radius:var(--volr-radius-2xl)}.volr\\:rounded-t-3xl{border-top-left-radius:var(--volr-radius-3xl);border-top-right-radius:var(--volr-radius-3xl)}.volr\\:rounded-t-xl{border-top-left-radius:var(--volr-radius-xl);border-top-right-radius:var(--volr-radius-xl)}.volr\\:rounded-b-xl{border-bottom-right-radius:var(--volr-radius-xl);border-bottom-left-radius:var(--volr-radius-xl)}.volr\\:border{border-style:var(--volr-tw-border-style);border-width:1px}.volr\\:border-2{border-style:var(--volr-tw-border-style);border-width:2px}.volr\\:border-4{border-style:var(--volr-tw-border-style);border-width:4px}.volr\\:border-x{border-inline-style:var(--volr-tw-border-style);border-inline-width:1px}.volr\\:border-y{border-block-style:var(--volr-tw-border-style);border-block-width:1px}.volr\\:border-t{border-top-style:var(--volr-tw-border-style);border-top-width:1px}.volr\\:border-b{border-bottom-style:var(--volr-tw-border-style);border-bottom-width:1px}.volr\\:border-amber-200{border-color:var(--volr-color-amber-200)}.volr\\:border-red-200{border-color:var(--volr-color-red-200)}.volr\\:border-red-500{border-color:var(--volr-color-red-500)}.volr\\:border-slate-100{border-color:var(--volr-color-slate-100)}.volr\\:border-slate-200{border-color:var(--volr-color-slate-200)}.volr\\:border-slate-300{border-color:var(--volr-color-slate-300)}.volr\\:border-transparent{border-color:#0000}.volr\\:border-white{border-color:var(--volr-color-white)}.volr\\:border-t-slate-600{border-top-color:var(--volr-color-slate-600)}.volr\\:border-t-slate-900{border-top-color:var(--volr-color-slate-900)}.volr\\:bg-amber-50{background-color:var(--volr-color-amber-50)}.volr\\:bg-black\\/45{background-color:var(--volr-color-black)}@supports (color:color-mix(in lab, red, red)){.volr\\:bg-black\\/45{background-color:color-mix(in oklab,var(--volr-color-black)45%,transparent)}}.volr\\:bg-blue-100{background-color:var(--volr-color-blue-100)}.volr\\:bg-cyan-400{background-color:var(--volr-color-cyan-400)}.volr\\:bg-emerald-300{background-color:var(--volr-color-emerald-300)}.volr\\:bg-emerald-400{background-color:var(--volr-color-emerald-400)}.volr\\:bg-emerald-500{background-color:var(--volr-color-emerald-500)}.volr\\:bg-green-50{background-color:var(--volr-color-green-50)}.volr\\:bg-green-100{background-color:var(--volr-color-green-100)}.volr\\:bg-red-50{background-color:var(--volr-color-red-50)}.volr\\:bg-red-100{background-color:var(--volr-color-red-100)}.volr\\:bg-slate-50{background-color:var(--volr-color-slate-50)}.volr\\:bg-slate-100{background-color:var(--volr-color-slate-100)}.volr\\:bg-slate-200{background-color:var(--volr-color-slate-200)}.volr\\:bg-slate-900{background-color:var(--volr-color-slate-900)}.volr\\:bg-teal-400{background-color:var(--volr-color-teal-400)}.volr\\:bg-white{background-color:var(--volr-color-white)}.volr\\:bg-yellow-100{background-color:var(--volr-color-yellow-100)}.volr\\:bg-linear-to-br{--volr-tw-gradient-position:to bottom right}@supports (background-image:linear-gradient(in lab, red, red)){.volr\\:bg-linear-to-br{--volr-tw-gradient-position:to bottom right in oklab}}.volr\\:bg-linear-to-br{background-image:linear-gradient(var(--volr-tw-gradient-stops))}.volr\\:bg-linear-to-r{--volr-tw-gradient-position:to right}@supports (background-image:linear-gradient(in lab, red, red)){.volr\\:bg-linear-to-r{--volr-tw-gradient-position:to right in oklab}}.volr\\:bg-linear-to-r{background-image:linear-gradient(var(--volr-tw-gradient-stops))}.volr\\:bg-gradient-to-br{--volr-tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--volr-tw-gradient-stops))}.volr\\:from-emerald-400{--volr-tw-gradient-from:var(--volr-color-emerald-400);--volr-tw-gradient-stops:var(--volr-tw-gradient-via-stops,var(--volr-tw-gradient-position),var(--volr-tw-gradient-from)var(--volr-tw-gradient-from-position),var(--volr-tw-gradient-to)var(--volr-tw-gradient-to-position))}.volr\\:from-slate-50{--volr-tw-gradient-from:var(--volr-color-slate-50);--volr-tw-gradient-stops:var(--volr-tw-gradient-via-stops,var(--volr-tw-gradient-position),var(--volr-tw-gradient-from)var(--volr-tw-gradient-from-position),var(--volr-tw-gradient-to)var(--volr-tw-gradient-to-position))}.volr\\:to-slate-100{--volr-tw-gradient-to:var(--volr-color-slate-100);--volr-tw-gradient-stops:var(--volr-tw-gradient-via-stops,var(--volr-tw-gradient-position),var(--volr-tw-gradient-from)var(--volr-tw-gradient-from-position),var(--volr-tw-gradient-to)var(--volr-tw-gradient-to-position))}.volr\\:to-teal-500{--volr-tw-gradient-to:var(--volr-color-teal-500);--volr-tw-gradient-stops:var(--volr-tw-gradient-via-stops,var(--volr-tw-gradient-position),var(--volr-tw-gradient-from)var(--volr-tw-gradient-from-position),var(--volr-tw-gradient-to)var(--volr-tw-gradient-to-position))}.volr\\:object-cover{object-fit:cover}.volr\\:p-1{padding:calc(var(--volr-spacing)*1)}.volr\\:p-2{padding:calc(var(--volr-spacing)*2)}.volr\\:p-3{padding:calc(var(--volr-spacing)*3)}.volr\\:p-4{padding:calc(var(--volr-spacing)*4)}.volr\\:p-5{padding:calc(var(--volr-spacing)*5)}.volr\\:p-8{padding:calc(var(--volr-spacing)*8)}.volr\\:px-1\\.5{padding-inline:calc(var(--volr-spacing)*1.5)}.volr\\:px-2{padding-inline:calc(var(--volr-spacing)*2)}.volr\\:px-3{padding-inline:calc(var(--volr-spacing)*3)}.volr\\:px-4{padding-inline:calc(var(--volr-spacing)*4)}.volr\\:px-6{padding-inline:calc(var(--volr-spacing)*6)}.volr\\:py-0\\.5{padding-block:calc(var(--volr-spacing)*.5)}.volr\\:py-1{padding-block:calc(var(--volr-spacing)*1)}.volr\\:py-1\\.5{padding-block:calc(var(--volr-spacing)*1.5)}.volr\\:py-2{padding-block:calc(var(--volr-spacing)*2)}.volr\\:py-2\\.5{padding-block:calc(var(--volr-spacing)*2.5)}.volr\\:py-3{padding-block:calc(var(--volr-spacing)*3)}.volr\\:py-4{padding-block:calc(var(--volr-spacing)*4)}.volr\\:py-6{padding-block:calc(var(--volr-spacing)*6)}.volr\\:py-8{padding-block:calc(var(--volr-spacing)*8)}.volr\\:py-12{padding-block:calc(var(--volr-spacing)*12)}.volr\\:pt-2{padding-top:calc(var(--volr-spacing)*2)}.volr\\:pt-3{padding-top:calc(var(--volr-spacing)*3)}.volr\\:pt-4{padding-top:calc(var(--volr-spacing)*4)}.volr\\:pr-3{padding-right:calc(var(--volr-spacing)*3)}.volr\\:pr-16{padding-right:calc(var(--volr-spacing)*16)}.volr\\:pl-11{padding-left:calc(var(--volr-spacing)*11)}.volr\\:text-center{text-align:center}.volr\\:text-left{text-align:left}.volr\\:text-right{text-align:right}.volr\\:align-baseline{vertical-align:baseline}.volr\\:font-mono{font-family:var(--volr-font-mono)}.volr\\:text-2xl{font-size:var(--volr-text-2xl);line-height:var(--volr-tw-leading,var(--volr-text-2xl--line-height))}.volr\\:text-8xl{font-size:var(--volr-text-8xl);line-height:var(--volr-tw-leading,var(--volr-text-8xl--line-height))}.volr\\:text-base{font-size:var(--volr-text-base);line-height:var(--volr-tw-leading,var(--volr-text-base--line-height))}.volr\\:text-lg{font-size:var(--volr-text-lg);line-height:var(--volr-tw-leading,var(--volr-text-lg--line-height))}.volr\\:text-sm{font-size:var(--volr-text-sm);line-height:var(--volr-tw-leading,var(--volr-text-sm--line-height))}.volr\\:text-xl{font-size:var(--volr-text-xl);line-height:var(--volr-tw-leading,var(--volr-text-xl--line-height))}.volr\\:text-xs{font-size:var(--volr-text-xs);line-height:var(--volr-tw-leading,var(--volr-text-xs--line-height))}.volr\\:leading-relaxed{--volr-tw-leading:var(--volr-leading-relaxed);line-height:var(--volr-leading-relaxed)}.volr\\:font-bold{--volr-tw-font-weight:var(--volr-font-weight-bold);font-weight:var(--volr-font-weight-bold)}.volr\\:font-medium{--volr-tw-font-weight:var(--volr-font-weight-medium);font-weight:var(--volr-font-weight-medium)}.volr\\:font-semibold{--volr-tw-font-weight:var(--volr-font-weight-semibold);font-weight:var(--volr-font-weight-semibold)}.volr\\:tracking-wide{--volr-tw-tracking:var(--volr-tracking-wide);letter-spacing:var(--volr-tracking-wide)}.volr\\:break-all{word-break:break-all}.volr\\:text-amber-700{color:var(--volr-color-amber-700)}.volr\\:text-blue-700{color:var(--volr-color-blue-700)}.volr\\:text-emerald-600{color:var(--volr-color-emerald-600)}.volr\\:text-gray-500{color:var(--volr-color-gray-500)}.volr\\:text-green-600{color:var(--volr-color-green-600)}.volr\\:text-green-700{color:var(--volr-color-green-700)}.volr\\:text-red-500{color:var(--volr-color-red-500)}.volr\\:text-red-600{color:var(--volr-color-red-600)}.volr\\:text-red-700{color:var(--volr-color-red-700)}.volr\\:text-slate-300{color:var(--volr-color-slate-300)}.volr\\:text-slate-400{color:var(--volr-color-slate-400)}.volr\\:text-slate-500{color:var(--volr-color-slate-500)}.volr\\:text-slate-600{color:var(--volr-color-slate-600)}.volr\\:text-slate-700{color:var(--volr-color-slate-700)}.volr\\:text-slate-900{color:var(--volr-color-slate-900)}.volr\\:text-white{color:var(--volr-color-white)}.volr\\:text-yellow-700{color:var(--volr-color-yellow-700)}.volr\\:capitalize{text-transform:capitalize}.volr\\:uppercase{text-transform:uppercase}.volr\\:underline{text-decoration-line:underline}.volr\\:opacity-0{opacity:0}.volr\\:opacity-25{opacity:.25}.volr\\:opacity-30{opacity:.3}.volr\\:opacity-50{opacity:.5}.volr\\:opacity-70{opacity:.7}.volr\\:opacity-75{opacity:.75}.volr\\:opacity-80{opacity:.8}.volr\\:shadow-2xl{--volr-tw-shadow:0 25px 50px -12px var(--volr-tw-shadow-color,#00000040);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-lg{--volr-tw-shadow:0 10px 15px -3px var(--volr-tw-shadow-color,#0000001a),0 4px 6px -4px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-sm{--volr-tw-shadow:0 1px 3px 0 var(--volr-tw-shadow-color,#0000001a),0 1px 2px -1px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-xl{--volr-tw-shadow:0 20px 25px -5px var(--volr-tw-shadow-color,#0000001a),0 8px 10px -6px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-emerald-500\\/50{--volr-tw-shadow-color:var(--volr-color-emerald-500)}@supports (color:color-mix(in lab, red, red)){.volr\\:shadow-emerald-500\\/50{--volr-tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--volr-color-emerald-500)50%,transparent)var(--volr-tw-shadow-alpha),transparent)}}.volr\\:blur-2xl{--volr-tw-blur:blur(var(--volr-blur-2xl));filter:var(--volr-tw-blur,)var(--volr-tw-brightness,)var(--volr-tw-contrast,)var(--volr-tw-grayscale,)var(--volr-tw-hue-rotate,)var(--volr-tw-invert,)var(--volr-tw-saturate,)var(--volr-tw-sepia,)var(--volr-tw-drop-shadow,)}.volr\\:transition-all{transition-property:all;transition-timing-function:var(--volr-tw-ease,var(--volr-default-transition-timing-function));transition-duration:var(--volr-tw-duration,var(--volr-default-transition-duration))}.volr\\:transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--volr-tw-gradient-from,--volr-tw-gradient-via,--volr-tw-gradient-to;transition-timing-function:var(--volr-tw-ease,var(--volr-default-transition-timing-function));transition-duration:var(--volr-tw-duration,var(--volr-default-transition-duration))}.volr\\:transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--volr-tw-ease,var(--volr-default-transition-timing-function));transition-duration:var(--volr-tw-duration,var(--volr-default-transition-duration))}.volr\\:duration-300{--volr-tw-duration:.3s;transition-duration:.3s}.volr\\:duration-500{--volr-tw-duration:.5s;transition-duration:.5s}.volr\\:ease-out{--volr-tw-ease:var(--volr-ease-out);transition-timing-function:var(--volr-ease-out)}.volr\\:outline-none{--volr-tw-outline-style:none;outline-style:none}@media (hover:hover){.volr\\:hover\\:border-slate-300:hover{border-color:var(--volr-color-slate-300)}.volr\\:hover\\:bg-slate-50:hover{background-color:var(--volr-color-slate-50)}.volr\\:hover\\:bg-slate-200:hover{background-color:var(--volr-color-slate-200)}.volr\\:hover\\:text-slate-700:hover{color:var(--volr-color-slate-700)}}.volr\\:focus\\:ring-2:focus{--volr-tw-ring-shadow:var(--volr-tw-ring-inset,)0 0 0 calc(2px + var(--volr-tw-ring-offset-width))var(--volr-tw-ring-color,currentcolor);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:focus\\:ring-slate-300:focus{--volr-tw-ring-color:var(--volr-color-slate-300)}.volr\\:focus\\:outline-none:focus{--volr-tw-outline-style:none;outline-style:none}.volr\\:disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.volr\\:disabled\\:bg-slate-100:disabled{background-color:var(--volr-color-slate-100)}.volr\\:disabled\\:text-slate-400:disabled{color:var(--volr-color-slate-400)}.volr\\:disabled\\:opacity-50:disabled{opacity:.5}.volr-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.volr-text-secondary{color:var(--volr-text-secondary)}.volr-text-muted{color:var(--volr-text-muted)}.volr-bg-secondary{background-color:var(--volr-bg-secondary)}.volr-bg-tertiary{background-color:var(--volr-bg-tertiary)}.volr-border{border-color:var(--volr-border)}.volr-border-strong{border-color:var(--volr-border-strong)}.volr-divider-line{background-color:var(--volr-border)}.volr-error{background-color:var(--volr-error-bg);border-color:var(--volr-error-border);color:var(--volr-error-text)}.volr-hint{background-color:var(--volr-hint-bg);border:1px solid var(--volr-hint-border);color:var(--volr-hint-text)}.volr-hover:hover{background-color:var(--volr-hover-bg)}.volr-surface{background-color:var(--volr-bg)}}@property --volr-tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --volr-tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --volr-tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --volr-tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --volr-tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --volr-tw-gradient-position{syntax:"*";inherits:false}@property --volr-tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --volr-tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --volr-tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --volr-tw-gradient-stops{syntax:"*";inherits:false}@property --volr-tw-gradient-via-stops{syntax:"*";inherits:false}@property --volr-tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --volr-tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --volr-tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --volr-tw-leading{syntax:"*";inherits:false}@property --volr-tw-font-weight{syntax:"*";inherits:false}@property --volr-tw-tracking{syntax:"*";inherits:false}@property --volr-tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-shadow-color{syntax:"*";inherits:false}@property --volr-tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --volr-tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-inset-shadow-color{syntax:"*";inherits:false}@property --volr-tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --volr-tw-ring-color{syntax:"*";inherits:false}@property --volr-tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-inset-ring-color{syntax:"*";inherits:false}@property --volr-tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-ring-inset{syntax:"*";inherits:false}@property --volr-tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --volr-tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --volr-tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-blur{syntax:"*";inherits:false}@property --volr-tw-brightness{syntax:"*";inherits:false}@property --volr-tw-contrast{syntax:"*";inherits:false}@property --volr-tw-grayscale{syntax:"*";inherits:false}@property --volr-tw-hue-rotate{syntax:"*";inherits:false}@property --volr-tw-invert{syntax:"*";inherits:false}@property --volr-tw-opacity{syntax:"*";inherits:false}@property --volr-tw-saturate{syntax:"*";inherits:false}@property --volr-tw-sepia{syntax:"*";inherits:false}@property --volr-tw-drop-shadow{syntax:"*";inherits:false}@property --volr-tw-drop-shadow-color{syntax:"*";inherits:false}@property --volr-tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --volr-tw-drop-shadow-size{syntax:"*";inherits:false}@property --volr-tw-duration{syntax:"*";inherits:false}@property --volr-tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}';
|
|
1198
|
+
var VOLR_SDK_CSS = '/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--volr-tw-translate-x:0;--volr-tw-translate-y:0;--volr-tw-translate-z:0;--volr-tw-space-y-reverse:0;--volr-tw-border-style:solid;--volr-tw-gradient-position:initial;--volr-tw-gradient-from:#0000;--volr-tw-gradient-via:#0000;--volr-tw-gradient-to:#0000;--volr-tw-gradient-stops:initial;--volr-tw-gradient-via-stops:initial;--volr-tw-gradient-from-position:0%;--volr-tw-gradient-via-position:50%;--volr-tw-gradient-to-position:100%;--volr-tw-leading:initial;--volr-tw-font-weight:initial;--volr-tw-tracking:initial;--volr-tw-shadow:0 0 #0000;--volr-tw-shadow-color:initial;--volr-tw-shadow-alpha:100%;--volr-tw-inset-shadow:0 0 #0000;--volr-tw-inset-shadow-color:initial;--volr-tw-inset-shadow-alpha:100%;--volr-tw-ring-color:initial;--volr-tw-ring-shadow:0 0 #0000;--volr-tw-inset-ring-color:initial;--volr-tw-inset-ring-shadow:0 0 #0000;--volr-tw-ring-inset:initial;--volr-tw-ring-offset-width:0px;--volr-tw-ring-offset-color:#fff;--volr-tw-ring-offset-shadow:0 0 #0000;--volr-tw-blur:initial;--volr-tw-brightness:initial;--volr-tw-contrast:initial;--volr-tw-grayscale:initial;--volr-tw-hue-rotate:initial;--volr-tw-invert:initial;--volr-tw-opacity:initial;--volr-tw-saturate:initial;--volr-tw-sepia:initial;--volr-tw-drop-shadow:initial;--volr-tw-drop-shadow-color:initial;--volr-tw-drop-shadow-alpha:100%;--volr-tw-drop-shadow-size:initial;--volr-tw-duration:initial;--volr-tw-ease:initial}}}@layer theme{:root,:host{--volr-font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--volr-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--volr-color-red-50:oklch(97.1% .013 17.38);--volr-color-red-100:oklch(93.6% .032 17.717);--volr-color-red-200:oklch(88.5% .062 18.334);--volr-color-red-500:oklch(63.7% .237 25.331);--volr-color-red-600:oklch(57.7% .245 27.325);--volr-color-red-700:oklch(50.5% .213 27.518);--volr-color-amber-50:oklch(98.7% .022 95.277);--volr-color-amber-200:oklch(92.4% .12 95.746);--volr-color-amber-700:oklch(55.5% .163 48.998);--volr-color-yellow-100:oklch(97.3% .071 103.193);--volr-color-yellow-700:oklch(55.4% .135 66.442);--volr-color-green-50:oklch(98.2% .018 155.826);--volr-color-green-100:oklch(96.2% .044 156.743);--volr-color-green-600:oklch(62.7% .194 149.214);--volr-color-green-700:oklch(52.7% .154 150.069);--volr-color-emerald-300:oklch(84.5% .143 164.978);--volr-color-emerald-400:oklch(76.5% .177 163.223);--volr-color-emerald-500:oklch(69.6% .17 162.48);--volr-color-emerald-600:oklch(59.6% .145 163.225);--volr-color-teal-400:oklch(77.7% .152 181.912);--volr-color-teal-500:oklch(70.4% .14 182.503);--volr-color-cyan-400:oklch(78.9% .154 211.53);--volr-color-blue-100:oklch(93.2% .032 255.585);--volr-color-blue-700:oklch(48.8% .243 264.376);--volr-color-slate-50:oklch(98.4% .003 247.858);--volr-color-slate-100:oklch(96.8% .007 247.896);--volr-color-slate-200:oklch(92.9% .013 255.508);--volr-color-slate-300:oklch(86.9% .022 252.894);--volr-color-slate-400:oklch(70.4% .04 256.788);--volr-color-slate-500:oklch(55.4% .046 257.417);--volr-color-slate-600:oklch(44.6% .043 257.281);--volr-color-slate-700:oklch(37.2% .044 257.287);--volr-color-slate-800:oklch(27.9% .041 260.031);--volr-color-slate-900:oklch(20.8% .042 265.755);--volr-color-gray-500:oklch(55.1% .027 264.364);--volr-color-black:#000;--volr-color-white:#fff;--volr-spacing:.25rem;--volr-container-md:28rem;--volr-container-4xl:56rem;--volr-text-xs:.75rem;--volr-text-xs--line-height:calc(1/.75);--volr-text-sm:.875rem;--volr-text-sm--line-height:calc(1.25/.875);--volr-text-base:1rem;--volr-text-base--line-height:calc(1.5/1);--volr-text-lg:1.125rem;--volr-text-lg--line-height:calc(1.75/1.125);--volr-text-xl:1.25rem;--volr-text-xl--line-height:calc(1.75/1.25);--volr-text-2xl:1.5rem;--volr-text-2xl--line-height:calc(2/1.5);--volr-text-8xl:6rem;--volr-text-8xl--line-height:1;--volr-font-weight-medium:500;--volr-font-weight-semibold:600;--volr-font-weight-bold:700;--volr-tracking-tight:-.025em;--volr-tracking-wide:.025em;--volr-tracking-wider:.05em;--volr-leading-relaxed:1.625;--volr-radius-md:.375rem;--volr-radius-lg:.5rem;--volr-radius-xl:.75rem;--volr-radius-2xl:1rem;--volr-radius-3xl:1.5rem;--volr-ease-out:cubic-bezier(0,0,.2,1);--volr-animate-spin:spin 1s linear infinite;--volr-animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--volr-animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--volr-blur-2xl:40px;--volr-default-transition-duration:.15s;--volr-default-transition-timing-function:cubic-bezier(.4,0,.2,1);--volr-default-font-family:var(--volr-font-sans);--volr-default-mono-font-family:var(--volr-font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--volr-default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--volr-default-font-feature-settings,normal);font-variation-settings:var(--volr-default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--volr-default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--volr-default-mono-font-feature-settings,normal);font-variation-settings:var(--volr-default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{--volr-primary-color:var(--volr-accent-color,#303030);--volr-font-family:var(--volr-custom-font,inherit);--volr-bg:#fff;--volr-bg-secondary:#f8fafc;--volr-bg-tertiary:#f1f5f9;--volr-text:#0f172a;--volr-text-secondary:#475569;--volr-text-muted:#94a3b8;--volr-border:#e2e8f0;--volr-border-strong:#cbd5e1;--volr-hover-bg:#f8fafc;--volr-error-bg:#fef2f2;--volr-error-border:#fecaca;--volr-error-text:#991b1b;--volr-hint-bg:#f8fafc;--volr-hint-border:#e2e8f0;--volr-hint-text:#334155}:host([data-theme=dark]){--volr-bg:#1c1c1e;--volr-bg-secondary:#2c2c2e;--volr-bg-tertiary:#3a3a3c;--volr-text:#f5f5f7;--volr-text-secondary:#c7c7cc;--volr-text-muted:#8e8e93;--volr-border:#3a3a3c;--volr-border-strong:#48484a;--volr-hover-bg:#2c2c2e;--volr-error-bg:#3c1f1f;--volr-error-border:#7f1d1d;--volr-error-text:#fca5a5;--volr-hint-bg:#2c2c2e;--volr-hint-border:#3a3a3c;--volr-hint-text:#c7c7cc}*,:before,:after{box-sizing:border-box}*{font-family:var(--volr-font-family);color:var(--volr-text)}button,input,select,textarea{color:var(--volr-text);background-color:#0000}button{cursor:pointer;background-color:#0000}input::placeholder{color:var(--volr-text-muted)}h1,h2,h3{color:var(--volr-text);margin:0;font-weight:700}h1{font-size:1.875rem;line-height:2.25rem}h2{font-size:1.5rem;line-height:2rem}h3{font-size:1.25rem;line-height:1.75rem}p{margin:0}}@layer components{.volr-dialog-overlay{inset:calc(var(--volr-spacing)*0);z-index:40;background-color:var(--volr-color-black);position:fixed}@supports (color:color-mix(in lab, red, red)){.volr-dialog-overlay{background-color:color-mix(in oklab,var(--volr-color-black)45%,transparent)}}.volr-dialog-content{z-index:50;border-radius:var(--volr-radius-2xl);border-style:var(--volr-tw-border-style);padding:calc(var(--volr-spacing)*7);--volr-tw-shadow:0 20px 25px -5px var(--volr-tw-shadow-color,#0000001a),0 8px 10px -6px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow);background-color:var(--volr-bg);border-width:1px;border-color:var(--volr-border-strong);width:calc(100% - 2rem);max-width:28rem;max-height:85vh;position:fixed;top:50%;left:50%;overflow-y:auto;transform:translate(-50%,-50%)}@media (max-width:640px){.volr-dialog-content{top:auto;right:calc(var(--volr-spacing)*0);bottom:calc(var(--volr-spacing)*0);left:calc(var(--volr-spacing)*0);border-radius:1.25rem 1.25rem 0 0;width:100%;max-width:100%;margin:0 auto;transform:translateY(0)}}.volr-dialog-close{top:calc(var(--volr-spacing)*4);right:calc(var(--volr-spacing)*4);height:calc(var(--volr-spacing)*8);width:calc(var(--volr-spacing)*8);color:var(--volr-text-muted);cursor:pointer;background-color:#0000;border:none;border-radius:3.40282e38px;justify-content:center;align-items:center;display:inline-flex;position:absolute}.volr-dialog-close:hover{background-color:var(--volr-hover-bg);color:var(--volr-text-secondary)}.volr-dialog-close:focus-visible{box-shadow:0 0 0 2px var(--volr-border-strong);outline:none}.volr-dialog-close-icon{height:calc(var(--volr-spacing)*4);width:calc(var(--volr-spacing)*4)}.volr-email-input{border:1px solid var(--volr-border-strong);background-color:var(--volr-bg);width:100%;color:var(--volr-text);border-radius:.5rem;outline:none;padding:.75rem .75rem .75rem 2.75rem;font-size:1rem;line-height:1.5}.volr-email-input::placeholder{color:var(--volr-text-muted)}.volr-email-input:focus{border-color:var(--volr-border-strong);box-shadow:0 0 0 2px var(--volr-border-strong)}.volr-option-button{border:1px solid var(--volr-border);background-color:var(--volr-bg);width:100%;color:var(--volr-text);cursor:pointer;border-radius:.5rem;align-items:center;gap:.75rem;padding:.75rem;transition:background-color .15s ease-out,border-color .15s ease-out,box-shadow .15s ease-out;display:flex}.volr-option-button:hover{background-color:var(--volr-hover-bg);border-color:var(--volr-border)}.volr-option-button:focus-visible{box-shadow:0 0 0 2px var(--volr-border-strong);outline:none}}@layer utilities{.volr\\:pointer-events-auto{pointer-events:auto}.volr\\:pointer-events-none{pointer-events:none}.volr\\:sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.volr\\:absolute{position:absolute}.volr\\:fixed{position:fixed}.volr\\:relative{position:relative}.volr\\:inset-0{inset:calc(var(--volr-spacing)*0)}.volr\\:-top-3{top:calc(var(--volr-spacing)*-3)}.volr\\:top-1\\/2{top:50%}.volr\\:-right-3{right:calc(var(--volr-spacing)*-3)}.volr\\:right-0{right:calc(var(--volr-spacing)*0)}.volr\\:right-2{right:calc(var(--volr-spacing)*2)}.volr\\:right-3{right:calc(var(--volr-spacing)*3)}.volr\\:bottom-0{bottom:calc(var(--volr-spacing)*0)}.volr\\:left-0{left:calc(var(--volr-spacing)*0)}.volr\\:left-3{left:calc(var(--volr-spacing)*3)}.volr\\:-z-10{z-index:calc(10*-1)}.volr\\:z-10{z-index:10}.volr\\:z-20{z-index:20}.volr\\:z-40{z-index:40}.volr\\:z-50{z-index:50}.volr\\:mx-auto{margin-inline:auto}.volr\\:my-6{margin-block:calc(var(--volr-spacing)*6)}.volr\\:mt-0\\.5{margin-top:calc(var(--volr-spacing)*.5)}.volr\\:mt-1{margin-top:calc(var(--volr-spacing)*1)}.volr\\:mt-2{margin-top:calc(var(--volr-spacing)*2)}.volr\\:mt-3{margin-top:calc(var(--volr-spacing)*3)}.volr\\:mt-4{margin-top:calc(var(--volr-spacing)*4)}.volr\\:mt-6{margin-top:calc(var(--volr-spacing)*6)}.volr\\:mt-8{margin-top:calc(var(--volr-spacing)*8)}.volr\\:mb-1{margin-bottom:calc(var(--volr-spacing)*1)}.volr\\:mb-2{margin-bottom:calc(var(--volr-spacing)*2)}.volr\\:mb-3{margin-bottom:calc(var(--volr-spacing)*3)}.volr\\:mb-4{margin-bottom:calc(var(--volr-spacing)*4)}.volr\\:mb-5{margin-bottom:calc(var(--volr-spacing)*5)}.volr\\:mb-6{margin-bottom:calc(var(--volr-spacing)*6)}.volr\\:mb-8{margin-bottom:calc(var(--volr-spacing)*8)}.volr\\:-ml-2{margin-left:calc(var(--volr-spacing)*-2)}.volr\\:ml-6{margin-left:calc(var(--volr-spacing)*6)}.volr\\:line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.volr\\:block{display:block}.volr\\:flex{display:flex}.volr\\:grid{display:grid}.volr\\:inline-block{display:inline-block}.volr\\:inline-flex{display:inline-flex}.volr\\:h-1{height:calc(var(--volr-spacing)*1)}.volr\\:h-1\\.5{height:calc(var(--volr-spacing)*1.5)}.volr\\:h-2{height:calc(var(--volr-spacing)*2)}.volr\\:h-3{height:calc(var(--volr-spacing)*3)}.volr\\:h-4{height:calc(var(--volr-spacing)*4)}.volr\\:h-5{height:calc(var(--volr-spacing)*5)}.volr\\:h-6{height:calc(var(--volr-spacing)*6)}.volr\\:h-7{height:calc(var(--volr-spacing)*7)}.volr\\:h-8{height:calc(var(--volr-spacing)*8)}.volr\\:h-10{height:calc(var(--volr-spacing)*10)}.volr\\:h-12{height:calc(var(--volr-spacing)*12)}.volr\\:h-14{height:calc(var(--volr-spacing)*14)}.volr\\:h-16{height:calc(var(--volr-spacing)*16)}.volr\\:h-20{height:calc(var(--volr-spacing)*20)}.volr\\:h-24{height:calc(var(--volr-spacing)*24)}.volr\\:h-40{height:calc(var(--volr-spacing)*40)}.volr\\:h-44{height:calc(var(--volr-spacing)*44)}.volr\\:h-48{height:calc(var(--volr-spacing)*48)}.volr\\:h-\\[0\\.8em\\]{height:.8em}.volr\\:h-\\[200px\\]{height:200px}.volr\\:h-full{height:100%}.volr\\:h-px{height:1px}.volr\\:max-h-48{max-height:calc(var(--volr-spacing)*48)}.volr\\:max-h-60{max-height:calc(var(--volr-spacing)*60)}.volr\\:max-h-64{max-height:calc(var(--volr-spacing)*64)}.volr\\:max-h-\\[85vh\\]{max-height:85vh}.volr\\:max-h-\\[90vh\\]{max-height:90vh}.volr\\:min-h-\\[100px\\]{min-height:100px}.volr\\:min-h-\\[120px\\]{min-height:120px}.volr\\:min-h-\\[500px\\]{min-height:500px}.volr\\:w-1\\.5{width:calc(var(--volr-spacing)*1.5)}.volr\\:w-2{width:calc(var(--volr-spacing)*2)}.volr\\:w-3{width:calc(var(--volr-spacing)*3)}.volr\\:w-4{width:calc(var(--volr-spacing)*4)}.volr\\:w-5{width:calc(var(--volr-spacing)*5)}.volr\\:w-6{width:calc(var(--volr-spacing)*6)}.volr\\:w-7{width:calc(var(--volr-spacing)*7)}.volr\\:w-8{width:calc(var(--volr-spacing)*8)}.volr\\:w-10{width:calc(var(--volr-spacing)*10)}.volr\\:w-12{width:calc(var(--volr-spacing)*12)}.volr\\:w-14{width:calc(var(--volr-spacing)*14)}.volr\\:w-16{width:calc(var(--volr-spacing)*16)}.volr\\:w-20{width:calc(var(--volr-spacing)*20)}.volr\\:w-24{width:calc(var(--volr-spacing)*24)}.volr\\:w-32{width:calc(var(--volr-spacing)*32)}.volr\\:w-36{width:calc(var(--volr-spacing)*36)}.volr\\:w-40{width:calc(var(--volr-spacing)*40)}.volr\\:w-44{width:calc(var(--volr-spacing)*44)}.volr\\:w-48{width:calc(var(--volr-spacing)*48)}.volr\\:w-\\[200px\\]{width:200px}.volr\\:w-auto{width:auto}.volr\\:w-full{width:100%}.volr\\:max-w-4xl{max-width:var(--volr-container-4xl)}.volr\\:max-w-full{max-width:100%}.volr\\:max-w-md{max-width:var(--volr-container-md)}.volr\\:max-w-none{max-width:none}.volr\\:min-w-0{min-width:calc(var(--volr-spacing)*0)}.volr\\:flex-1{flex:1}.volr\\:flex-shrink-0,.volr\\:shrink-0{flex-shrink:0}.volr\\:-translate-y-1\\/2{--volr-tw-translate-y:calc(calc(1/2*100%)*-1);translate:var(--volr-tw-translate-x)var(--volr-tw-translate-y)}.volr\\:rotate-90{rotate:90deg}.volr\\:rotate-180{rotate:180deg}.volr\\:animate-ping{animation:var(--volr-animate-ping)}.volr\\:animate-pulse{animation:var(--volr-animate-pulse)}.volr\\:animate-spin{animation:var(--volr-animate-spin)}.volr\\:cursor-not-allowed{cursor:not-allowed}.volr\\:cursor-pointer{cursor:pointer}.volr\\:list-inside{list-style-position:inside}.volr\\:list-decimal{list-style-type:decimal}.volr\\:grid-cols-\\[minmax\\(0\\,1\\.1fr\\)_minmax\\(0\\,1fr\\)\\]{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)}.volr\\:flex-col{flex-direction:column}.volr\\:items-baseline{align-items:baseline}.volr\\:items-center{align-items:center}.volr\\:items-end{align-items:flex-end}.volr\\:items-start{align-items:flex-start}.volr\\:justify-between{justify-content:space-between}.volr\\:justify-center{justify-content:center}.volr\\:gap-1{gap:calc(var(--volr-spacing)*1)}.volr\\:gap-2{gap:calc(var(--volr-spacing)*2)}.volr\\:gap-3{gap:calc(var(--volr-spacing)*3)}.volr\\:gap-4{gap:calc(var(--volr-spacing)*4)}:where(.volr\\:space-y-1>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*1)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*1)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-2>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*2)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*2)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-3>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*3)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*3)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-4>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*4)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*4)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-5>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*5)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*5)*calc(1 - var(--volr-tw-space-y-reverse)))}:where(.volr\\:space-y-6>:not(:last-child)){--volr-tw-space-y-reverse:0;margin-block-start:calc(calc(var(--volr-spacing)*6)*var(--volr-tw-space-y-reverse));margin-block-end:calc(calc(var(--volr-spacing)*6)*calc(1 - var(--volr-tw-space-y-reverse)))}.volr\\:truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.volr\\:overflow-auto{overflow:auto}.volr\\:overflow-hidden{overflow:hidden}.volr\\:overflow-visible{overflow:visible}.volr\\:overflow-x-auto{overflow-x:auto}.volr\\:overflow-y-auto{overflow-y:auto}.volr\\:rounded{border-radius:.25rem}.volr\\:rounded-2xl{border-radius:var(--volr-radius-2xl)}.volr\\:rounded-full{border-radius:3.40282e38px}.volr\\:rounded-lg{border-radius:var(--volr-radius-lg)}.volr\\:rounded-md{border-radius:var(--volr-radius-md)}.volr\\:rounded-xl{border-radius:var(--volr-radius-xl)}.volr\\:rounded-t-2xl{border-top-left-radius:var(--volr-radius-2xl);border-top-right-radius:var(--volr-radius-2xl)}.volr\\:rounded-t-3xl{border-top-left-radius:var(--volr-radius-3xl);border-top-right-radius:var(--volr-radius-3xl)}.volr\\:border{border-style:var(--volr-tw-border-style);border-width:1px}.volr\\:border-2{border-style:var(--volr-tw-border-style);border-width:2px}.volr\\:border-4{border-style:var(--volr-tw-border-style);border-width:4px}.volr\\:border-y{border-block-style:var(--volr-tw-border-style);border-block-width:1px}.volr\\:border-t{border-top-style:var(--volr-tw-border-style);border-top-width:1px}.volr\\:border-b{border-bottom-style:var(--volr-tw-border-style);border-bottom-width:1px}.volr\\:border-amber-200{border-color:var(--volr-color-amber-200)}.volr\\:border-red-200{border-color:var(--volr-color-red-200)}.volr\\:border-red-500{border-color:var(--volr-color-red-500)}.volr\\:border-slate-100{border-color:var(--volr-color-slate-100)}.volr\\:border-slate-200{border-color:var(--volr-color-slate-200)}.volr\\:border-slate-300{border-color:var(--volr-color-slate-300)}.volr\\:border-transparent{border-color:#0000}.volr\\:border-white{border-color:var(--volr-color-white)}.volr\\:border-t-slate-600{border-top-color:var(--volr-color-slate-600)}.volr\\:border-t-slate-900{border-top-color:var(--volr-color-slate-900)}.volr\\:bg-amber-50{background-color:var(--volr-color-amber-50)}.volr\\:bg-black\\/45{background-color:var(--volr-color-black)}@supports (color:color-mix(in lab, red, red)){.volr\\:bg-black\\/45{background-color:color-mix(in oklab,var(--volr-color-black)45%,transparent)}}.volr\\:bg-blue-100{background-color:var(--volr-color-blue-100)}.volr\\:bg-cyan-400{background-color:var(--volr-color-cyan-400)}.volr\\:bg-emerald-300{background-color:var(--volr-color-emerald-300)}.volr\\:bg-emerald-400{background-color:var(--volr-color-emerald-400)}.volr\\:bg-emerald-500{background-color:var(--volr-color-emerald-500)}.volr\\:bg-green-50{background-color:var(--volr-color-green-50)}.volr\\:bg-green-100{background-color:var(--volr-color-green-100)}.volr\\:bg-red-50{background-color:var(--volr-color-red-50)}.volr\\:bg-red-100{background-color:var(--volr-color-red-100)}.volr\\:bg-slate-50{background-color:var(--volr-color-slate-50)}.volr\\:bg-slate-100{background-color:var(--volr-color-slate-100)}.volr\\:bg-slate-200{background-color:var(--volr-color-slate-200)}.volr\\:bg-slate-900{background-color:var(--volr-color-slate-900)}.volr\\:bg-teal-400{background-color:var(--volr-color-teal-400)}.volr\\:bg-white{background-color:var(--volr-color-white)}.volr\\:bg-yellow-100{background-color:var(--volr-color-yellow-100)}.volr\\:bg-linear-to-br{--volr-tw-gradient-position:to bottom right}@supports (background-image:linear-gradient(in lab, red, red)){.volr\\:bg-linear-to-br{--volr-tw-gradient-position:to bottom right in oklab}}.volr\\:bg-linear-to-br{background-image:linear-gradient(var(--volr-tw-gradient-stops))}.volr\\:bg-linear-to-r{--volr-tw-gradient-position:to right}@supports (background-image:linear-gradient(in lab, red, red)){.volr\\:bg-linear-to-r{--volr-tw-gradient-position:to right in oklab}}.volr\\:bg-linear-to-r{background-image:linear-gradient(var(--volr-tw-gradient-stops))}.volr\\:from-emerald-400{--volr-tw-gradient-from:var(--volr-color-emerald-400);--volr-tw-gradient-stops:var(--volr-tw-gradient-via-stops,var(--volr-tw-gradient-position),var(--volr-tw-gradient-from)var(--volr-tw-gradient-from-position),var(--volr-tw-gradient-to)var(--volr-tw-gradient-to-position))}.volr\\:to-teal-500{--volr-tw-gradient-to:var(--volr-color-teal-500);--volr-tw-gradient-stops:var(--volr-tw-gradient-via-stops,var(--volr-tw-gradient-position),var(--volr-tw-gradient-from)var(--volr-tw-gradient-from-position),var(--volr-tw-gradient-to)var(--volr-tw-gradient-to-position))}.volr\\:object-cover{object-fit:cover}.volr\\:p-1{padding:calc(var(--volr-spacing)*1)}.volr\\:p-2{padding:calc(var(--volr-spacing)*2)}.volr\\:p-3{padding:calc(var(--volr-spacing)*3)}.volr\\:p-4{padding:calc(var(--volr-spacing)*4)}.volr\\:p-5{padding:calc(var(--volr-spacing)*5)}.volr\\:p-8{padding:calc(var(--volr-spacing)*8)}.volr\\:px-1\\.5{padding-inline:calc(var(--volr-spacing)*1.5)}.volr\\:px-2{padding-inline:calc(var(--volr-spacing)*2)}.volr\\:px-3{padding-inline:calc(var(--volr-spacing)*3)}.volr\\:px-4{padding-inline:calc(var(--volr-spacing)*4)}.volr\\:px-5{padding-inline:calc(var(--volr-spacing)*5)}.volr\\:px-6{padding-inline:calc(var(--volr-spacing)*6)}.volr\\:py-0\\.5{padding-block:calc(var(--volr-spacing)*.5)}.volr\\:py-1{padding-block:calc(var(--volr-spacing)*1)}.volr\\:py-1\\.5{padding-block:calc(var(--volr-spacing)*1.5)}.volr\\:py-2{padding-block:calc(var(--volr-spacing)*2)}.volr\\:py-2\\.5{padding-block:calc(var(--volr-spacing)*2.5)}.volr\\:py-3{padding-block:calc(var(--volr-spacing)*3)}.volr\\:py-4{padding-block:calc(var(--volr-spacing)*4)}.volr\\:py-6{padding-block:calc(var(--volr-spacing)*6)}.volr\\:py-7{padding-block:calc(var(--volr-spacing)*7)}.volr\\:py-8{padding-block:calc(var(--volr-spacing)*8)}.volr\\:py-12{padding-block:calc(var(--volr-spacing)*12)}.volr\\:pt-1{padding-top:calc(var(--volr-spacing)*1)}.volr\\:pt-2{padding-top:calc(var(--volr-spacing)*2)}.volr\\:pt-3{padding-top:calc(var(--volr-spacing)*3)}.volr\\:pt-4{padding-top:calc(var(--volr-spacing)*4)}.volr\\:pt-5{padding-top:calc(var(--volr-spacing)*5)}.volr\\:pr-3{padding-right:calc(var(--volr-spacing)*3)}.volr\\:pr-16{padding-right:calc(var(--volr-spacing)*16)}.volr\\:pb-6{padding-bottom:calc(var(--volr-spacing)*6)}.volr\\:pl-11{padding-left:calc(var(--volr-spacing)*11)}.volr\\:text-center{text-align:center}.volr\\:text-left{text-align:left}.volr\\:text-right{text-align:right}.volr\\:align-baseline{vertical-align:baseline}.volr\\:font-mono{font-family:var(--volr-font-mono)}.volr\\:text-2xl{font-size:var(--volr-text-2xl);line-height:var(--volr-tw-leading,var(--volr-text-2xl--line-height))}.volr\\:text-8xl{font-size:var(--volr-text-8xl);line-height:var(--volr-tw-leading,var(--volr-text-8xl--line-height))}.volr\\:text-base{font-size:var(--volr-text-base);line-height:var(--volr-tw-leading,var(--volr-text-base--line-height))}.volr\\:text-lg{font-size:var(--volr-text-lg);line-height:var(--volr-tw-leading,var(--volr-text-lg--line-height))}.volr\\:text-sm{font-size:var(--volr-text-sm);line-height:var(--volr-tw-leading,var(--volr-text-sm--line-height))}.volr\\:text-xl{font-size:var(--volr-text-xl);line-height:var(--volr-tw-leading,var(--volr-text-xl--line-height))}.volr\\:text-xs{font-size:var(--volr-text-xs);line-height:var(--volr-tw-leading,var(--volr-text-xs--line-height))}.volr\\:leading-none{--volr-tw-leading:1;line-height:1}.volr\\:leading-relaxed{--volr-tw-leading:var(--volr-leading-relaxed);line-height:var(--volr-leading-relaxed)}.volr\\:font-bold{--volr-tw-font-weight:var(--volr-font-weight-bold);font-weight:var(--volr-font-weight-bold)}.volr\\:font-medium{--volr-tw-font-weight:var(--volr-font-weight-medium);font-weight:var(--volr-font-weight-medium)}.volr\\:font-semibold{--volr-tw-font-weight:var(--volr-font-weight-semibold);font-weight:var(--volr-font-weight-semibold)}.volr\\:tracking-tight{--volr-tw-tracking:var(--volr-tracking-tight);letter-spacing:var(--volr-tracking-tight)}.volr\\:tracking-wide{--volr-tw-tracking:var(--volr-tracking-wide);letter-spacing:var(--volr-tracking-wide)}.volr\\:tracking-wider{--volr-tw-tracking:var(--volr-tracking-wider);letter-spacing:var(--volr-tracking-wider)}.volr\\:break-all{word-break:break-all}.volr\\:text-amber-700{color:var(--volr-color-amber-700)}.volr\\:text-blue-700{color:var(--volr-color-blue-700)}.volr\\:text-emerald-600{color:var(--volr-color-emerald-600)}.volr\\:text-gray-500{color:var(--volr-color-gray-500)}.volr\\:text-green-600{color:var(--volr-color-green-600)}.volr\\:text-green-700{color:var(--volr-color-green-700)}.volr\\:text-red-500{color:var(--volr-color-red-500)}.volr\\:text-red-600{color:var(--volr-color-red-600)}.volr\\:text-red-700{color:var(--volr-color-red-700)}.volr\\:text-slate-300{color:var(--volr-color-slate-300)}.volr\\:text-slate-400{color:var(--volr-color-slate-400)}.volr\\:text-slate-500{color:var(--volr-color-slate-500)}.volr\\:text-slate-600{color:var(--volr-color-slate-600)}.volr\\:text-slate-700{color:var(--volr-color-slate-700)}.volr\\:text-slate-800{color:var(--volr-color-slate-800)}.volr\\:text-slate-900{color:var(--volr-color-slate-900)}.volr\\:text-white{color:var(--volr-color-white)}.volr\\:text-yellow-700{color:var(--volr-color-yellow-700)}.volr\\:capitalize{text-transform:capitalize}.volr\\:uppercase{text-transform:uppercase}.volr\\:underline{text-decoration-line:underline}.volr\\:opacity-0{opacity:0}.volr\\:opacity-25{opacity:.25}.volr\\:opacity-30{opacity:.3}.volr\\:opacity-50{opacity:.5}.volr\\:opacity-70{opacity:.7}.volr\\:opacity-75{opacity:.75}.volr\\:opacity-80{opacity:.8}.volr\\:shadow-2xl{--volr-tw-shadow:0 25px 50px -12px var(--volr-tw-shadow-color,#00000040);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-lg{--volr-tw-shadow:0 10px 15px -3px var(--volr-tw-shadow-color,#0000001a),0 4px 6px -4px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-sm{--volr-tw-shadow:0 1px 3px 0 var(--volr-tw-shadow-color,#0000001a),0 1px 2px -1px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-xl{--volr-tw-shadow:0 20px 25px -5px var(--volr-tw-shadow-color,#0000001a),0 8px 10px -6px var(--volr-tw-shadow-color,#0000001a);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:shadow-emerald-500\\/50{--volr-tw-shadow-color:var(--volr-color-emerald-500)}@supports (color:color-mix(in lab, red, red)){.volr\\:shadow-emerald-500\\/50{--volr-tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--volr-color-emerald-500)50%,transparent)var(--volr-tw-shadow-alpha),transparent)}}.volr\\:blur-2xl{--volr-tw-blur:blur(var(--volr-blur-2xl));filter:var(--volr-tw-blur,)var(--volr-tw-brightness,)var(--volr-tw-contrast,)var(--volr-tw-grayscale,)var(--volr-tw-hue-rotate,)var(--volr-tw-invert,)var(--volr-tw-saturate,)var(--volr-tw-sepia,)var(--volr-tw-drop-shadow,)}.volr\\:transition-all{transition-property:all;transition-timing-function:var(--volr-tw-ease,var(--volr-default-transition-timing-function));transition-duration:var(--volr-tw-duration,var(--volr-default-transition-duration))}.volr\\:transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--volr-tw-gradient-from,--volr-tw-gradient-via,--volr-tw-gradient-to;transition-timing-function:var(--volr-tw-ease,var(--volr-default-transition-timing-function));transition-duration:var(--volr-tw-duration,var(--volr-default-transition-duration))}.volr\\:transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--volr-tw-ease,var(--volr-default-transition-timing-function));transition-duration:var(--volr-tw-duration,var(--volr-default-transition-duration))}.volr\\:duration-200{--volr-tw-duration:.2s;transition-duration:.2s}.volr\\:duration-300{--volr-tw-duration:.3s;transition-duration:.3s}.volr\\:duration-500{--volr-tw-duration:.5s;transition-duration:.5s}.volr\\:ease-out{--volr-tw-ease:var(--volr-ease-out);transition-timing-function:var(--volr-ease-out)}.volr\\:outline-none{--volr-tw-outline-style:none;outline-style:none}@media (hover:hover){.volr\\:hover\\:border-slate-300:hover{border-color:var(--volr-color-slate-300)}.volr\\:hover\\:bg-slate-50:hover{background-color:var(--volr-color-slate-50)}.volr\\:hover\\:bg-slate-200:hover{background-color:var(--volr-color-slate-200)}.volr\\:hover\\:text-slate-700:hover{color:var(--volr-color-slate-700)}}.volr\\:focus\\:ring-2:focus{--volr-tw-ring-shadow:var(--volr-tw-ring-inset,)0 0 0 calc(2px + var(--volr-tw-ring-offset-width))var(--volr-tw-ring-color,currentcolor);box-shadow:var(--volr-tw-inset-shadow),var(--volr-tw-inset-ring-shadow),var(--volr-tw-ring-offset-shadow),var(--volr-tw-ring-shadow),var(--volr-tw-shadow)}.volr\\:focus\\:ring-slate-300:focus{--volr-tw-ring-color:var(--volr-color-slate-300)}.volr\\:focus\\:outline-none:focus{--volr-tw-outline-style:none;outline-style:none}.volr\\:disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.volr\\:disabled\\:bg-slate-100:disabled{background-color:var(--volr-color-slate-100)}.volr\\:disabled\\:text-slate-400:disabled{color:var(--volr-color-slate-400)}.volr\\:disabled\\:opacity-50:disabled{opacity:.5}.volr-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.volr-text-secondary{color:var(--volr-text-secondary)}.volr-text-muted{color:var(--volr-text-muted)}.volr-bg-secondary{background-color:var(--volr-bg-secondary)}.volr-bg-tertiary{background-color:var(--volr-bg-tertiary)}.volr-border{border-color:var(--volr-border)}.volr-border-strong{border-color:var(--volr-border-strong)}.volr-divider-line{background-color:var(--volr-border)}.volr-error{background-color:var(--volr-error-bg);border-color:var(--volr-error-border);color:var(--volr-error-text)}.volr-hint{background-color:var(--volr-hint-bg);border:1px solid var(--volr-hint-border);color:var(--volr-hint-text)}.volr-hover:hover{background-color:var(--volr-hover-bg)}.volr-surface{background-color:var(--volr-bg)}}@property --volr-tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --volr-tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --volr-tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --volr-tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --volr-tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --volr-tw-gradient-position{syntax:"*";inherits:false}@property --volr-tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --volr-tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --volr-tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --volr-tw-gradient-stops{syntax:"*";inherits:false}@property --volr-tw-gradient-via-stops{syntax:"*";inherits:false}@property --volr-tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --volr-tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --volr-tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --volr-tw-leading{syntax:"*";inherits:false}@property --volr-tw-font-weight{syntax:"*";inherits:false}@property --volr-tw-tracking{syntax:"*";inherits:false}@property --volr-tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-shadow-color{syntax:"*";inherits:false}@property --volr-tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --volr-tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-inset-shadow-color{syntax:"*";inherits:false}@property --volr-tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --volr-tw-ring-color{syntax:"*";inherits:false}@property --volr-tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-inset-ring-color{syntax:"*";inherits:false}@property --volr-tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-ring-inset{syntax:"*";inherits:false}@property --volr-tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --volr-tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --volr-tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --volr-tw-blur{syntax:"*";inherits:false}@property --volr-tw-brightness{syntax:"*";inherits:false}@property --volr-tw-contrast{syntax:"*";inherits:false}@property --volr-tw-grayscale{syntax:"*";inherits:false}@property --volr-tw-hue-rotate{syntax:"*";inherits:false}@property --volr-tw-invert{syntax:"*";inherits:false}@property --volr-tw-opacity{syntax:"*";inherits:false}@property --volr-tw-saturate{syntax:"*";inherits:false}@property --volr-tw-sepia{syntax:"*";inherits:false}@property --volr-tw-drop-shadow{syntax:"*";inherits:false}@property --volr-tw-drop-shadow-color{syntax:"*";inherits:false}@property --volr-tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --volr-tw-drop-shadow-size{syntax:"*";inherits:false}@property --volr-tw-duration{syntax:"*";inherits:false}@property --volr-tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}';
|
|
1143
1199
|
function useResolvedTheme(theme = "light") {
|
|
1144
|
-
const [resolvedTheme, setResolvedTheme] =
|
|
1200
|
+
const [resolvedTheme, setResolvedTheme] = React14.useState(() => {
|
|
1145
1201
|
if (theme !== "system") return theme;
|
|
1146
1202
|
if (typeof window === "undefined") return "light";
|
|
1147
1203
|
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
1148
1204
|
});
|
|
1149
|
-
|
|
1205
|
+
React14.useEffect(() => {
|
|
1150
1206
|
if (theme !== "system") {
|
|
1151
1207
|
setResolvedTheme(theme);
|
|
1152
1208
|
return;
|
|
@@ -1162,10 +1218,10 @@ function useResolvedTheme(theme = "light") {
|
|
|
1162
1218
|
return resolvedTheme;
|
|
1163
1219
|
}
|
|
1164
1220
|
function ShadowPortal({ children, theme = "light" }) {
|
|
1165
|
-
const [mountNode, setMountNode] =
|
|
1166
|
-
const hostRef =
|
|
1221
|
+
const [mountNode, setMountNode] = React14.useState(null);
|
|
1222
|
+
const hostRef = React14.useRef(null);
|
|
1167
1223
|
const resolvedTheme = useResolvedTheme(theme);
|
|
1168
|
-
|
|
1224
|
+
React14.useEffect(() => {
|
|
1169
1225
|
const host = document.createElement("div");
|
|
1170
1226
|
host.id = "volr-shadow-portal";
|
|
1171
1227
|
host.style.position = "fixed";
|
|
@@ -1189,7 +1245,7 @@ function ShadowPortal({ children, theme = "light" }) {
|
|
|
1189
1245
|
hostRef.current = null;
|
|
1190
1246
|
};
|
|
1191
1247
|
}, []);
|
|
1192
|
-
|
|
1248
|
+
React14.useEffect(() => {
|
|
1193
1249
|
if (hostRef.current) {
|
|
1194
1250
|
hostRef.current.setAttribute("data-theme", resolvedTheme);
|
|
1195
1251
|
}
|
|
@@ -1198,7 +1254,7 @@ function ShadowPortal({ children, theme = "light" }) {
|
|
|
1198
1254
|
return reactDom.createPortal(children, mountNode);
|
|
1199
1255
|
}
|
|
1200
1256
|
function useFocusTrap(isActive, containerRef) {
|
|
1201
|
-
const previousActiveElement =
|
|
1257
|
+
const previousActiveElement = React14.useRef(null);
|
|
1202
1258
|
const focusableSelector = [
|
|
1203
1259
|
"button:not([disabled])",
|
|
1204
1260
|
"input:not([disabled])",
|
|
@@ -1207,7 +1263,7 @@ function useFocusTrap(isActive, containerRef) {
|
|
|
1207
1263
|
"a[href]",
|
|
1208
1264
|
'[tabindex]:not([tabindex="-1"])'
|
|
1209
1265
|
].join(", ");
|
|
1210
|
-
const getFocusableElements =
|
|
1266
|
+
const getFocusableElements = React14.useCallback(() => {
|
|
1211
1267
|
if (!containerRef.current) return [];
|
|
1212
1268
|
return Array.from(
|
|
1213
1269
|
containerRef.current.querySelectorAll(focusableSelector)
|
|
@@ -1215,7 +1271,7 @@ function useFocusTrap(isActive, containerRef) {
|
|
|
1215
1271
|
return el.offsetParent !== null;
|
|
1216
1272
|
});
|
|
1217
1273
|
}, [containerRef, focusableSelector]);
|
|
1218
|
-
const handleKeyDown =
|
|
1274
|
+
const handleKeyDown = React14.useCallback(
|
|
1219
1275
|
(event) => {
|
|
1220
1276
|
if (event.key !== "Tab") return;
|
|
1221
1277
|
const focusableElements = getFocusableElements();
|
|
@@ -1236,7 +1292,7 @@ function useFocusTrap(isActive, containerRef) {
|
|
|
1236
1292
|
},
|
|
1237
1293
|
[getFocusableElements]
|
|
1238
1294
|
);
|
|
1239
|
-
|
|
1295
|
+
React14.useEffect(() => {
|
|
1240
1296
|
if (!isActive) return;
|
|
1241
1297
|
previousActiveElement.current = document.activeElement;
|
|
1242
1298
|
const focusableElements = getFocusableElements();
|
|
@@ -1267,12 +1323,12 @@ var Modal = ({
|
|
|
1267
1323
|
}) => {
|
|
1268
1324
|
const isMobile2 = useMediaQuery("(max-width: 500px)");
|
|
1269
1325
|
const variant = explicitVariant ?? (isMobile2 ? "bottom-sheet" : "centered");
|
|
1270
|
-
const dialogRef =
|
|
1271
|
-
const dialogId =
|
|
1326
|
+
const dialogRef = React14.useRef(null);
|
|
1327
|
+
const dialogId = React14.useId();
|
|
1272
1328
|
const uiContext = useVolrUIOptional();
|
|
1273
1329
|
const theme = uiContext?.theme ?? "light";
|
|
1274
1330
|
useFocusTrap(open, dialogRef);
|
|
1275
|
-
|
|
1331
|
+
React14.useEffect(() => {
|
|
1276
1332
|
const handleEscape = (e) => {
|
|
1277
1333
|
if (e.key === "Escape" && open) {
|
|
1278
1334
|
if (onEscapeKeyDown) {
|
|
@@ -1855,7 +1911,7 @@ var variantMap = {
|
|
|
1855
1911
|
ghost: { backgroundColor: "transparent", color: "var(--volr-text-secondary)", border: "none" },
|
|
1856
1912
|
outline: { backgroundColor: "transparent", color: "var(--volr-text-secondary)", border: "1px solid var(--volr-border)" }
|
|
1857
1913
|
};
|
|
1858
|
-
var Button =
|
|
1914
|
+
var Button = React14__default.default.forwardRef(
|
|
1859
1915
|
({ variant = "primary", size = "md", fullWidth, className, style, disabled, children, ...props }, ref) => {
|
|
1860
1916
|
const { accentColor } = useVolrUI();
|
|
1861
1917
|
const sizeStyle = sizeMap[size];
|
|
@@ -1898,9 +1954,7 @@ function PasskeyEnrollForm({
|
|
|
1898
1954
|
biometricMessage,
|
|
1899
1955
|
errorMessage,
|
|
1900
1956
|
onEnroll,
|
|
1901
|
-
onLogout,
|
|
1902
1957
|
buttonText,
|
|
1903
|
-
logoutText,
|
|
1904
1958
|
hintMessage,
|
|
1905
1959
|
hintNote
|
|
1906
1960
|
}) {
|
|
@@ -1918,10 +1972,45 @@ function PasskeyEnrollForm({
|
|
|
1918
1972
|
/* @__PURE__ */ jsxRuntime.jsx(ErrorIcon, { className: "volr:shrink-0 volr:mt-0.5" }),
|
|
1919
1973
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: errorMessage })
|
|
1920
1974
|
] }),
|
|
1921
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1975
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:flex volr:flex-col volr:gap-3", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", fullWidth: true, onClick: onEnroll, children: buttonText }) })
|
|
1976
|
+
] });
|
|
1977
|
+
}
|
|
1978
|
+
function ProgressSteps({
|
|
1979
|
+
totalSteps,
|
|
1980
|
+
currentStep,
|
|
1981
|
+
activeColor = "#1e293b",
|
|
1982
|
+
// slate-900
|
|
1983
|
+
inactiveColor = "#e2e8f0",
|
|
1984
|
+
// slate-200
|
|
1985
|
+
activeWidth = 8,
|
|
1986
|
+
inactiveWidth = 6,
|
|
1987
|
+
gap = 8,
|
|
1988
|
+
// 0.5rem = 8px
|
|
1989
|
+
animate = true
|
|
1990
|
+
}) {
|
|
1991
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1992
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:flex volr:items-center volr:justify-center", style: { gap: `${gap}px` }, children: Array.from({ length: totalSteps }).map((_, stepIdx) => {
|
|
1993
|
+
const isActive = stepIdx <= currentStep;
|
|
1994
|
+
const isCurrent = stepIdx === currentStep;
|
|
1995
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1996
|
+
"div",
|
|
1997
|
+
{
|
|
1998
|
+
className: "volr:h-1.5 volr:rounded-full volr:transition-all volr:duration-300",
|
|
1999
|
+
style: {
|
|
2000
|
+
width: `${isActive ? activeWidth : inactiveWidth}px`,
|
|
2001
|
+
backgroundColor: isActive ? activeColor : inactiveColor,
|
|
2002
|
+
...isCurrent && animate ? { animation: "volrProgressPulse 1.5s ease-in-out infinite" } : void 0
|
|
2003
|
+
}
|
|
2004
|
+
},
|
|
2005
|
+
stepIdx
|
|
2006
|
+
);
|
|
2007
|
+
}) }),
|
|
2008
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
2009
|
+
@keyframes volrProgressPulse {
|
|
2010
|
+
0%, 100% { opacity: 1; }
|
|
2011
|
+
50% { opacity: 0.6; }
|
|
2012
|
+
}
|
|
2013
|
+
` })
|
|
1925
2014
|
] });
|
|
1926
2015
|
}
|
|
1927
2016
|
function PasskeyEnrollLoading({
|
|
@@ -1930,28 +2019,14 @@ function PasskeyEnrollLoading({
|
|
|
1930
2019
|
isEnrolling,
|
|
1931
2020
|
accentColor,
|
|
1932
2021
|
onRetry,
|
|
1933
|
-
onLogout,
|
|
1934
2022
|
buttonText,
|
|
1935
|
-
|
|
1936
|
-
progress = 0
|
|
2023
|
+
currentStepIndex = 0
|
|
1937
2024
|
}) {
|
|
1938
2025
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1939
2026
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:mb-8 volr:flex volr:justify-center volr:items-center volr:min-h-[120px]", children: /* @__PURE__ */ jsxRuntime.jsx(BiometricIcon, { type: biometricType, size: 60, animate: isEnrolling }) }),
|
|
1940
2027
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-base volr:mb-4 volr-text-secondary", children: stepMessage }),
|
|
1941
|
-
isEnrolling && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:
|
|
1942
|
-
|
|
1943
|
-
{
|
|
1944
|
-
className: "volr:h-full volr:rounded-full volr:transition-all volr:duration-500 volr:ease-out",
|
|
1945
|
-
style: {
|
|
1946
|
-
backgroundColor: accentColor,
|
|
1947
|
-
width: `${progress}%`
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
) }) }),
|
|
1951
|
-
!isEnrolling && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:flex volr:flex-col volr:gap-3 volr:mt-6", children: [
|
|
1952
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", fullWidth: true, onClick: onRetry, children: buttonText }),
|
|
1953
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", fullWidth: true, onClick: onLogout, children: logoutText })
|
|
1954
|
-
] })
|
|
2028
|
+
isEnrolling && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:mb-6", children: /* @__PURE__ */ jsxRuntime.jsx(ProgressSteps, { totalSteps: 2, currentStep: currentStepIndex }) }),
|
|
2029
|
+
!isEnrolling && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:flex volr:flex-col volr:gap-3 volr:mt-6", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", fullWidth: true, onClick: onRetry, children: buttonText }) })
|
|
1955
2030
|
] });
|
|
1956
2031
|
}
|
|
1957
2032
|
function WarningIcon({ className }) {
|
|
@@ -1990,8 +2065,7 @@ function getActionButtonKey(action) {
|
|
|
1990
2065
|
}
|
|
1991
2066
|
}
|
|
1992
2067
|
function PasskeyCompatibilityScreen({
|
|
1993
|
-
compatibility
|
|
1994
|
-
onLogout
|
|
2068
|
+
compatibility
|
|
1995
2069
|
}) {
|
|
1996
2070
|
const { t } = useI18n();
|
|
1997
2071
|
const messageKey = compatibility.messageKey || "passkey.compatibility.unknownBrowser";
|
|
@@ -2024,10 +2098,7 @@ function PasskeyCompatibilityScreen({
|
|
|
2024
2098
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "volr:font-medium", children: compatibility.platform })
|
|
2025
2099
|
] })
|
|
2026
2100
|
] }),
|
|
2027
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2028
|
-
compatibility.action && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", fullWidth: true, onClick: handleAction, children: t(actionButtonKey) }),
|
|
2029
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", fullWidth: true, onClick: onLogout, children: t("passkey.logout") })
|
|
2030
|
-
] })
|
|
2101
|
+
compatibility.action && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:flex volr:flex-col volr:gap-3", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", fullWidth: true, onClick: handleAction, children: t(actionButtonKey) }) })
|
|
2031
2102
|
] });
|
|
2032
2103
|
}
|
|
2033
2104
|
var AUTO_CLOSE_DELAY = 2e3;
|
|
@@ -2035,18 +2106,17 @@ function PasskeyMigrationView({
|
|
|
2035
2106
|
sourcePasskey,
|
|
2036
2107
|
currentDomain,
|
|
2037
2108
|
onMigrate,
|
|
2038
|
-
onSkip,
|
|
2039
2109
|
onError,
|
|
2040
2110
|
onComplete,
|
|
2041
2111
|
isOpen = true,
|
|
2042
2112
|
wrapInModal = true
|
|
2043
2113
|
}) {
|
|
2044
2114
|
const { t } = useI18n();
|
|
2045
|
-
const [isMigrating, setIsMigrating] =
|
|
2046
|
-
const [isComplete, setIsComplete] =
|
|
2047
|
-
const [error, setError] =
|
|
2115
|
+
const [isMigrating, setIsMigrating] = React14.useState(false);
|
|
2116
|
+
const [isComplete, setIsComplete] = React14.useState(false);
|
|
2117
|
+
const [error, setError] = React14.useState(null);
|
|
2048
2118
|
const biometricType = getBiometricType();
|
|
2049
|
-
|
|
2119
|
+
React14.useEffect(() => {
|
|
2050
2120
|
if (typeof window === "undefined") return;
|
|
2051
2121
|
const handler = (event) => {
|
|
2052
2122
|
if (event.data?.type === "VOLR_MIGRATION_DONE") {
|
|
@@ -2057,18 +2127,16 @@ function PasskeyMigrationView({
|
|
|
2057
2127
|
window.addEventListener("message", handler);
|
|
2058
2128
|
return () => window.removeEventListener("message", handler);
|
|
2059
2129
|
}, []);
|
|
2060
|
-
|
|
2130
|
+
React14.useEffect(() => {
|
|
2061
2131
|
if (isComplete) {
|
|
2062
2132
|
const timer = setTimeout(() => {
|
|
2063
2133
|
if (onComplete) {
|
|
2064
2134
|
onComplete();
|
|
2065
|
-
} else if (onSkip) {
|
|
2066
|
-
onSkip();
|
|
2067
2135
|
}
|
|
2068
2136
|
}, AUTO_CLOSE_DELAY);
|
|
2069
2137
|
return () => clearTimeout(timer);
|
|
2070
2138
|
}
|
|
2071
|
-
}, [isComplete, onComplete
|
|
2139
|
+
}, [isComplete, onComplete]);
|
|
2072
2140
|
const handleMigrate = async () => {
|
|
2073
2141
|
try {
|
|
2074
2142
|
setIsMigrating(true);
|
|
@@ -2083,13 +2151,11 @@ function PasskeyMigrationView({
|
|
|
2083
2151
|
}
|
|
2084
2152
|
}
|
|
2085
2153
|
};
|
|
2086
|
-
const handleDone =
|
|
2154
|
+
const handleDone = React14.useCallback(() => {
|
|
2087
2155
|
if (onComplete) {
|
|
2088
2156
|
onComplete();
|
|
2089
|
-
} else if (onSkip) {
|
|
2090
|
-
onSkip();
|
|
2091
2157
|
}
|
|
2092
|
-
}, [onComplete
|
|
2158
|
+
}, [onComplete]);
|
|
2093
2159
|
const successContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:py-4", children: [
|
|
2094
2160
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-xl volr:font-semibold volr:mb-6 volr:text-center", children: t("passkey.migration.successTitle") }),
|
|
2095
2161
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:mb-8 volr:flex volr:justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:w-16 volr:h-16 volr:rounded-full volr:bg-slate-900 volr:flex volr:items-center volr:justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2148,44 +2214,31 @@ function PasskeyMigrationView({
|
|
|
2148
2214
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: t("passkey.migration.benefits") })
|
|
2149
2215
|
] }) }),
|
|
2150
2216
|
error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:mb-4 volr:p-3 volr:rounded-lg volr:border volr:text-sm volr:text-left volr-error", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: error }) }),
|
|
2151
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
),
|
|
2162
|
-
onSkip && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2163
|
-
Button,
|
|
2164
|
-
{
|
|
2165
|
-
variant: "ghost",
|
|
2166
|
-
fullWidth: true,
|
|
2167
|
-
onClick: onSkip,
|
|
2168
|
-
disabled: isMigrating,
|
|
2169
|
-
children: t("passkey.migration.later")
|
|
2170
|
-
}
|
|
2171
|
-
)
|
|
2172
|
-
] })
|
|
2217
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:flex volr:flex-col volr:gap-3", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2218
|
+
Button,
|
|
2219
|
+
{
|
|
2220
|
+
variant: "primary",
|
|
2221
|
+
fullWidth: true,
|
|
2222
|
+
onClick: handleMigrate,
|
|
2223
|
+
disabled: isMigrating,
|
|
2224
|
+
children: t("passkey.migration.cta")
|
|
2225
|
+
}
|
|
2226
|
+
) })
|
|
2173
2227
|
] });
|
|
2174
2228
|
const content = isComplete ? successContent : isMigrating ? migratingContent : defaultContent;
|
|
2175
2229
|
if (!wrapInModal) {
|
|
2176
2230
|
return content;
|
|
2177
2231
|
}
|
|
2178
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Modal, { open: isOpen, onOpenChange: (open) => !open && !isMigrating &&
|
|
2232
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Modal, { open: isOpen, onOpenChange: (open) => !open && !isMigrating && onComplete?.(), children: content });
|
|
2179
2233
|
}
|
|
2180
2234
|
function PasskeyEnrollView({
|
|
2181
2235
|
onComplete,
|
|
2182
2236
|
onError,
|
|
2183
|
-
onLogout,
|
|
2184
2237
|
onClose,
|
|
2185
2238
|
isOpen = true,
|
|
2186
2239
|
wrapInModal = true
|
|
2187
2240
|
}) {
|
|
2188
|
-
const { user,
|
|
2241
|
+
const { user, setUser } = react.useVolrContext();
|
|
2189
2242
|
const { client } = react.useInternalAuth();
|
|
2190
2243
|
const { t } = useI18n();
|
|
2191
2244
|
const { accentColor } = useVolrUI();
|
|
@@ -2195,21 +2248,22 @@ function PasskeyEnrollView({
|
|
|
2195
2248
|
isEnrolling,
|
|
2196
2249
|
error: enrollmentError
|
|
2197
2250
|
} = react.usePasskeyEnrollment();
|
|
2198
|
-
const [hasStarted, setHasStarted] =
|
|
2199
|
-
const [errorMessage, setErrorMessage] =
|
|
2200
|
-
const [isRefreshing, setIsRefreshing] =
|
|
2251
|
+
const [hasStarted, setHasStarted] = React14.useState(false);
|
|
2252
|
+
const [errorMessage, setErrorMessage] = React14.useState(null);
|
|
2253
|
+
const [isRefreshing, setIsRefreshing] = React14.useState(false);
|
|
2201
2254
|
const biometricType = getBiometricType();
|
|
2202
|
-
const compatibility =
|
|
2203
|
-
const
|
|
2204
|
-
|
|
2205
|
-
|
|
2255
|
+
const compatibility = React14.useMemo(() => react.checkPrfCompatibility(), []);
|
|
2256
|
+
const [hasPrfError, setHasPrfError] = React14.useState(false);
|
|
2257
|
+
const platformHint = React14.useMemo(
|
|
2258
|
+
() => hasPrfError ? react.getPlatformHint(compatibility.platform) : { hintKey: "", noteKey: "" },
|
|
2259
|
+
[compatibility.platform, hasPrfError]
|
|
2206
2260
|
);
|
|
2207
2261
|
const hasPasskey = user?.keyStorageType === "passkey";
|
|
2208
|
-
const currentDomain =
|
|
2262
|
+
const currentDomain = React14.useMemo(() => {
|
|
2209
2263
|
if (typeof window === "undefined") return "localhost";
|
|
2210
2264
|
return window.location.hostname;
|
|
2211
2265
|
}, []);
|
|
2212
|
-
const migrationInfo =
|
|
2266
|
+
const migrationInfo = React14.useMemo(() => {
|
|
2213
2267
|
if (!user?.registeredPasskeys || user.registeredPasskeys.length === 0) {
|
|
2214
2268
|
return { needsMigration: false, sourcePasskey: null };
|
|
2215
2269
|
}
|
|
@@ -2222,7 +2276,7 @@ function PasskeyEnrollView({
|
|
|
2222
2276
|
const sourcePasskey = user.registeredPasskeys[0];
|
|
2223
2277
|
return { needsMigration: true, sourcePasskey };
|
|
2224
2278
|
}, [user?.registeredPasskeys, currentDomain]);
|
|
2225
|
-
|
|
2279
|
+
React14.useEffect(() => {
|
|
2226
2280
|
console.log("[PasskeyEnrollView] User state:", {
|
|
2227
2281
|
user,
|
|
2228
2282
|
keyStorageType: user?.keyStorageType,
|
|
@@ -2233,7 +2287,7 @@ function PasskeyEnrollView({
|
|
|
2233
2287
|
migrationInfo
|
|
2234
2288
|
});
|
|
2235
2289
|
}, [user, hasPasskey, currentDomain, migrationInfo]);
|
|
2236
|
-
|
|
2290
|
+
React14.useEffect(() => {
|
|
2237
2291
|
if (hasPasskey && !user?.evmAddress && !isRefreshing) {
|
|
2238
2292
|
const refreshUserData = async () => {
|
|
2239
2293
|
try {
|
|
@@ -2264,7 +2318,7 @@ function PasskeyEnrollView({
|
|
|
2264
2318
|
refreshUserData();
|
|
2265
2319
|
}
|
|
2266
2320
|
}, [hasPasskey, user?.evmAddress, isRefreshing, client, setUser, user]);
|
|
2267
|
-
|
|
2321
|
+
React14.useEffect(() => {
|
|
2268
2322
|
if (!user?.id) {
|
|
2269
2323
|
const error = new Error("User ID is required for passkey enrollment");
|
|
2270
2324
|
setErrorMessage(getUserFriendlyError(error, t));
|
|
@@ -2273,13 +2327,18 @@ function PasskeyEnrollView({
|
|
|
2273
2327
|
}
|
|
2274
2328
|
}
|
|
2275
2329
|
}, [user, onError, t]);
|
|
2276
|
-
|
|
2330
|
+
React14.useEffect(() => {
|
|
2277
2331
|
if (enrollmentError) {
|
|
2278
2332
|
const friendlyMessage = getUserFriendlyError(enrollmentError, t);
|
|
2279
2333
|
setErrorMessage(friendlyMessage);
|
|
2334
|
+
const errorMsg = enrollmentError.message.toLowerCase();
|
|
2335
|
+
const isPrfError = errorMsg.includes("prf extension not supported") || errorMsg.includes("prf output missing") || errorMsg.includes("prf not supported");
|
|
2336
|
+
setHasPrfError(isPrfError);
|
|
2280
2337
|
if (onError) {
|
|
2281
2338
|
onError(enrollmentError);
|
|
2282
2339
|
}
|
|
2340
|
+
} else {
|
|
2341
|
+
setHasPrfError(false);
|
|
2283
2342
|
}
|
|
2284
2343
|
}, [enrollmentError, onError, t]);
|
|
2285
2344
|
const handleEnroll = async () => {
|
|
@@ -2288,6 +2347,7 @@ function PasskeyEnrollView({
|
|
|
2288
2347
|
"User ID is required for passkey enrollment"
|
|
2289
2348
|
);
|
|
2290
2349
|
setErrorMessage(getUserFriendlyError(error, t));
|
|
2350
|
+
setHasPrfError(false);
|
|
2291
2351
|
if (onError) {
|
|
2292
2352
|
onError(error);
|
|
2293
2353
|
}
|
|
@@ -2295,25 +2355,15 @@ function PasskeyEnrollView({
|
|
|
2295
2355
|
}
|
|
2296
2356
|
try {
|
|
2297
2357
|
setErrorMessage(null);
|
|
2358
|
+
setHasPrfError(false);
|
|
2298
2359
|
await enroll();
|
|
2299
2360
|
setHasStarted(false);
|
|
2361
|
+
setHasPrfError(false);
|
|
2300
2362
|
onComplete();
|
|
2301
2363
|
} catch (error) {
|
|
2302
2364
|
setHasStarted(false);
|
|
2303
2365
|
}
|
|
2304
2366
|
};
|
|
2305
|
-
const handleLogout = async () => {
|
|
2306
|
-
try {
|
|
2307
|
-
await logout();
|
|
2308
|
-
if (onLogout) {
|
|
2309
|
-
onLogout();
|
|
2310
|
-
}
|
|
2311
|
-
} catch (error) {
|
|
2312
|
-
if (onError) {
|
|
2313
|
-
onError(error instanceof Error ? error : new Error("Logout failed"));
|
|
2314
|
-
}
|
|
2315
|
-
}
|
|
2316
|
-
};
|
|
2317
2367
|
const getStepMessage = () => {
|
|
2318
2368
|
switch (step) {
|
|
2319
2369
|
case "creating":
|
|
@@ -2328,16 +2378,16 @@ function PasskeyEnrollView({
|
|
|
2328
2378
|
return "";
|
|
2329
2379
|
}
|
|
2330
2380
|
};
|
|
2331
|
-
const
|
|
2381
|
+
const getCurrentStepIndex = () => {
|
|
2332
2382
|
switch (step) {
|
|
2333
2383
|
case "creating":
|
|
2334
|
-
return
|
|
2384
|
+
return 0;
|
|
2385
|
+
// Step 1: Creating passkey
|
|
2335
2386
|
case "encrypting":
|
|
2336
|
-
return 50;
|
|
2337
2387
|
case "uploading":
|
|
2338
|
-
return 75;
|
|
2339
2388
|
case "registering":
|
|
2340
|
-
return
|
|
2389
|
+
return 1;
|
|
2390
|
+
// Step 2: Encrypting/Uploading/Registering
|
|
2341
2391
|
default:
|
|
2342
2392
|
return 0;
|
|
2343
2393
|
}
|
|
@@ -2361,14 +2411,13 @@ function PasskeyEnrollView({
|
|
|
2361
2411
|
const compatibilityContent = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2362
2412
|
PasskeyCompatibilityScreen,
|
|
2363
2413
|
{
|
|
2364
|
-
compatibility
|
|
2365
|
-
onLogout: handleLogout
|
|
2414
|
+
compatibility
|
|
2366
2415
|
}
|
|
2367
2416
|
);
|
|
2368
2417
|
if (!wrapInModal) {
|
|
2369
2418
|
return compatibilityContent;
|
|
2370
2419
|
}
|
|
2371
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Modal, { open: isOpen, onOpenChange: (open) => !open &&
|
|
2420
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Modal, { open: isOpen, onOpenChange: (open) => !open && onClose?.(), children: compatibilityContent });
|
|
2372
2421
|
}
|
|
2373
2422
|
if (migrationInfo.needsMigration && migrationInfo.sourcePasskey) {
|
|
2374
2423
|
const handleMigration = async () => {
|
|
@@ -2385,8 +2434,8 @@ function PasskeyEnrollView({
|
|
|
2385
2434
|
sourcePasskey: migrationInfo.sourcePasskey,
|
|
2386
2435
|
currentDomain,
|
|
2387
2436
|
onMigrate: handleMigration,
|
|
2388
|
-
onSkip: handleLogout,
|
|
2389
2437
|
onError,
|
|
2438
|
+
onComplete,
|
|
2390
2439
|
isOpen,
|
|
2391
2440
|
wrapInModal
|
|
2392
2441
|
}
|
|
@@ -2432,11 +2481,9 @@ function PasskeyEnrollView({
|
|
|
2432
2481
|
setHasStarted(true);
|
|
2433
2482
|
handleEnroll();
|
|
2434
2483
|
},
|
|
2435
|
-
onLogout: handleLogout,
|
|
2436
2484
|
buttonText: t("passkey.start"),
|
|
2437
|
-
hintMessage: t(platformHint.hintKey),
|
|
2438
|
-
hintNote: t(platformHint.noteKey)
|
|
2439
|
-
logoutText: t("passkey.logout")
|
|
2485
|
+
hintMessage: hasPrfError && platformHint.hintKey ? t(platformHint.hintKey) : void 0,
|
|
2486
|
+
hintNote: hasPrfError && platformHint.noteKey ? t(platformHint.noteKey) : void 0
|
|
2440
2487
|
}
|
|
2441
2488
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2442
2489
|
PasskeyEnrollLoading,
|
|
@@ -2445,18 +2492,16 @@ function PasskeyEnrollView({
|
|
|
2445
2492
|
stepMessage: getStepMessage(),
|
|
2446
2493
|
isEnrolling,
|
|
2447
2494
|
accentColor,
|
|
2448
|
-
|
|
2495
|
+
currentStepIndex: getCurrentStepIndex(),
|
|
2449
2496
|
onRetry: handleEnroll,
|
|
2450
|
-
|
|
2451
|
-
buttonText: t("passkey.start"),
|
|
2452
|
-
logoutText: t("passkey.logout")
|
|
2497
|
+
buttonText: t("passkey.start")
|
|
2453
2498
|
}
|
|
2454
2499
|
)
|
|
2455
2500
|
] });
|
|
2456
2501
|
if (!wrapInModal) {
|
|
2457
2502
|
return content;
|
|
2458
2503
|
}
|
|
2459
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Modal, { open: isOpen, onOpenChange: (open) => !open &&
|
|
2504
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Modal, { open: isOpen, onOpenChange: (open) => !open && onClose?.(), children: content });
|
|
2460
2505
|
}
|
|
2461
2506
|
var STEP_PROGRESS = {
|
|
2462
2507
|
ready: 0,
|
|
@@ -2561,7 +2606,7 @@ function MigrationTargetView({
|
|
|
2561
2606
|
const biometricType = getBiometricType();
|
|
2562
2607
|
const isProcessing = step !== "ready" && step !== "error" && step !== "success";
|
|
2563
2608
|
const progress = STEP_PROGRESS2[step];
|
|
2564
|
-
|
|
2609
|
+
React14.useEffect(() => {
|
|
2565
2610
|
if (step === "success" && onAutoClose) {
|
|
2566
2611
|
const timer = setTimeout(() => {
|
|
2567
2612
|
onAutoClose();
|
|
@@ -2641,8 +2686,8 @@ function MpcConnectView({
|
|
|
2641
2686
|
isConnecting,
|
|
2642
2687
|
error: connectionError
|
|
2643
2688
|
} = react.useMpcConnection();
|
|
2644
|
-
const [errorMessage, setErrorMessage] =
|
|
2645
|
-
|
|
2689
|
+
const [errorMessage, setErrorMessage] = React14.useState(null);
|
|
2690
|
+
React14.useEffect(() => {
|
|
2646
2691
|
if (connectionError) {
|
|
2647
2692
|
setErrorMessage(connectionError.message);
|
|
2648
2693
|
if (onError) {
|
|
@@ -2650,7 +2695,7 @@ function MpcConnectView({
|
|
|
2650
2695
|
}
|
|
2651
2696
|
}
|
|
2652
2697
|
}, [connectionError, onError]);
|
|
2653
|
-
|
|
2698
|
+
React14.useEffect(() => {
|
|
2654
2699
|
handleConnect();
|
|
2655
2700
|
}, []);
|
|
2656
2701
|
const handleConnect = async () => {
|
|
@@ -2881,9 +2926,9 @@ function PoweredBy() {
|
|
|
2881
2926
|
}
|
|
2882
2927
|
function EmailInlineInput({ onSubmit, accentColor }) {
|
|
2883
2928
|
const { t } = useI18n();
|
|
2884
|
-
const [email, setEmail] =
|
|
2885
|
-
const [error, setError] =
|
|
2886
|
-
const [isLoading, setIsLoading] =
|
|
2929
|
+
const [email, setEmail] = React14.useState("");
|
|
2930
|
+
const [error, setError] = React14.useState(null);
|
|
2931
|
+
const [isLoading, setIsLoading] = React14.useState(false);
|
|
2887
2932
|
const handleSubmit = async (e) => {
|
|
2888
2933
|
e.preventDefault();
|
|
2889
2934
|
setError(null);
|
|
@@ -3007,14 +3052,14 @@ function SigninSelectScreen({
|
|
|
3007
3052
|
function CodeInputScreen({ email, onSubmit, onResend }) {
|
|
3008
3053
|
const { t } = useI18n();
|
|
3009
3054
|
const { accentColor } = useVolrUI();
|
|
3010
|
-
const [digits, setDigits] =
|
|
3011
|
-
const [error, setError] =
|
|
3012
|
-
const [isLoading, setIsLoading] =
|
|
3013
|
-
const inputRefs =
|
|
3014
|
-
|
|
3055
|
+
const [digits, setDigits] = React14.useState(Array(6).fill(""));
|
|
3056
|
+
const [error, setError] = React14.useState(null);
|
|
3057
|
+
const [isLoading, setIsLoading] = React14.useState(false);
|
|
3058
|
+
const inputRefs = React14.useRef([]);
|
|
3059
|
+
React14.useEffect(() => {
|
|
3015
3060
|
inputRefs.current[0]?.focus();
|
|
3016
3061
|
}, []);
|
|
3017
|
-
|
|
3062
|
+
React14.useEffect(() => {
|
|
3018
3063
|
const code = digits.join("");
|
|
3019
3064
|
if (code.length === 6 && !isLoading) {
|
|
3020
3065
|
handleSubmit(code);
|
|
@@ -3126,7 +3171,7 @@ function CodeInputScreen({ email, onSubmit, onResend }) {
|
|
|
3126
3171
|
] });
|
|
3127
3172
|
}
|
|
3128
3173
|
var CopyButton = ({ text, className, onCopy }) => {
|
|
3129
|
-
const [copied, setCopied] =
|
|
3174
|
+
const [copied, setCopied] = React14.useState(false);
|
|
3130
3175
|
const handleCopy = async () => {
|
|
3131
3176
|
try {
|
|
3132
3177
|
await navigator.clipboard.writeText(text);
|
|
@@ -3205,23 +3250,23 @@ function SiweLoginScreen({
|
|
|
3205
3250
|
checkSiweSession,
|
|
3206
3251
|
getSiweSignUrl
|
|
3207
3252
|
} = react.useVolrLogin();
|
|
3208
|
-
const [isLoading, setIsLoading] =
|
|
3209
|
-
const [loadingWallet, setLoadingWallet] =
|
|
3210
|
-
const [error, setError] =
|
|
3211
|
-
const [providers, setProviders] =
|
|
3212
|
-
const [isDetecting, setIsDetecting] =
|
|
3213
|
-
const [hasLegacyWallet, setHasLegacyWallet] =
|
|
3214
|
-
const [showOtherWallet, setShowOtherWallet] =
|
|
3215
|
-
const [sessionUrl, setSessionUrl] =
|
|
3216
|
-
const [isPolling, setIsPolling] =
|
|
3217
|
-
const pollingRef =
|
|
3218
|
-
const sessionCreatedRef =
|
|
3219
|
-
|
|
3253
|
+
const [isLoading, setIsLoading] = React14.useState(false);
|
|
3254
|
+
const [loadingWallet, setLoadingWallet] = React14.useState(null);
|
|
3255
|
+
const [error, setError] = React14.useState(null);
|
|
3256
|
+
const [providers, setProviders] = React14.useState([]);
|
|
3257
|
+
const [isDetecting, setIsDetecting] = React14.useState(true);
|
|
3258
|
+
const [hasLegacyWallet, setHasLegacyWallet] = React14.useState(false);
|
|
3259
|
+
const [showOtherWallet, setShowOtherWallet] = React14.useState(false);
|
|
3260
|
+
const [sessionUrl, setSessionUrl] = React14.useState(null);
|
|
3261
|
+
const [isPolling, setIsPolling] = React14.useState(false);
|
|
3262
|
+
const pollingRef = React14.useRef(null);
|
|
3263
|
+
const sessionCreatedRef = React14.useRef(false);
|
|
3264
|
+
React14.useEffect(() => {
|
|
3220
3265
|
return () => {
|
|
3221
3266
|
if (pollingRef.current) clearInterval(pollingRef.current);
|
|
3222
3267
|
};
|
|
3223
3268
|
}, []);
|
|
3224
|
-
|
|
3269
|
+
React14.useEffect(() => {
|
|
3225
3270
|
if (typeof window === "undefined") {
|
|
3226
3271
|
setIsDetecting(false);
|
|
3227
3272
|
return;
|
|
@@ -3247,7 +3292,7 @@ function SiweLoginScreen({
|
|
|
3247
3292
|
};
|
|
3248
3293
|
}, []);
|
|
3249
3294
|
const hasAnyWallet = providers.length > 0 || hasLegacyWallet;
|
|
3250
|
-
const createSession =
|
|
3295
|
+
const createSession = React14.useCallback(async () => {
|
|
3251
3296
|
if (sessionCreatedRef.current || sessionUrl) return;
|
|
3252
3297
|
sessionCreatedRef.current = true;
|
|
3253
3298
|
try {
|
|
@@ -3289,17 +3334,17 @@ function SiweLoginScreen({
|
|
|
3289
3334
|
onError(err instanceof Error ? err : new Error("Failed to create session"));
|
|
3290
3335
|
}
|
|
3291
3336
|
}, [createSiweSession, getSiweSignUrl, checkSiweSession, onSuccess, onError, t, sessionUrl]);
|
|
3292
|
-
|
|
3337
|
+
React14.useEffect(() => {
|
|
3293
3338
|
if (!isDetecting && !hasAnyWallet && !sessionUrl) {
|
|
3294
3339
|
createSession();
|
|
3295
3340
|
}
|
|
3296
3341
|
}, [isDetecting, hasAnyWallet, sessionUrl, createSession]);
|
|
3297
|
-
|
|
3342
|
+
React14.useEffect(() => {
|
|
3298
3343
|
if (showOtherWallet && !sessionUrl) {
|
|
3299
3344
|
createSession();
|
|
3300
3345
|
}
|
|
3301
3346
|
}, [showOtherWallet, sessionUrl, createSession]);
|
|
3302
|
-
const handleWalletClick =
|
|
3347
|
+
const handleWalletClick = React14.useCallback(async (provider, walletName, walletConnector) => {
|
|
3303
3348
|
setError(null);
|
|
3304
3349
|
setIsLoading(true);
|
|
3305
3350
|
setLoadingWallet(walletName);
|
|
@@ -3323,7 +3368,7 @@ function SiweLoginScreen({
|
|
|
3323
3368
|
setLoadingWallet(null);
|
|
3324
3369
|
}
|
|
3325
3370
|
}, [signWithWallet, onSuccess, onError]);
|
|
3326
|
-
const handleLegacyWalletClick =
|
|
3371
|
+
const handleLegacyWalletClick = React14.useCallback(async () => {
|
|
3327
3372
|
if (typeof window === "undefined" || !window.ethereum) return;
|
|
3328
3373
|
const ethereum = window.ethereum;
|
|
3329
3374
|
let walletName = "Wallet";
|
|
@@ -3332,7 +3377,7 @@ function SiweLoginScreen({
|
|
|
3332
3377
|
else if (ethereum.isRabby) walletName = "Rabby";
|
|
3333
3378
|
await handleWalletClick(ethereum, walletName);
|
|
3334
3379
|
}, [handleWalletClick]);
|
|
3335
|
-
const cancelOtherWallet =
|
|
3380
|
+
const cancelOtherWallet = React14.useCallback(() => {
|
|
3336
3381
|
if (pollingRef.current) {
|
|
3337
3382
|
clearInterval(pollingRef.current);
|
|
3338
3383
|
pollingRef.current = null;
|
|
@@ -3479,13 +3524,13 @@ function SigninModal({ isOpen, onClose, onError }) {
|
|
|
3479
3524
|
const { client } = react.useInternalAuth();
|
|
3480
3525
|
const { appName, branding } = useVolrUI();
|
|
3481
3526
|
const { requestEmailCode, verifyEmailCode, handleSocialLogin } = react.useVolrLogin();
|
|
3482
|
-
const [currentScreen, setCurrentScreen] =
|
|
3483
|
-
const [email, setEmail] =
|
|
3527
|
+
const [currentScreen, setCurrentScreen] = React14.useState("method-select");
|
|
3528
|
+
const [email, setEmail] = React14.useState("");
|
|
3484
3529
|
const hasPasskey = user?.keyStorageType === "passkey";
|
|
3485
3530
|
const isMobile2 = useMediaQuery("(max-width: 500px)");
|
|
3486
3531
|
const isWideViewport = useMediaQuery("(min-width: 864px)");
|
|
3487
3532
|
const shouldUseWideLayout = !isMobile2 && isWideViewport && Boolean(branding) && currentScreen === "method-select";
|
|
3488
|
-
|
|
3533
|
+
React14.useEffect(() => {
|
|
3489
3534
|
if (!isOpen) {
|
|
3490
3535
|
setCurrentScreen("method-select");
|
|
3491
3536
|
setEmail("");
|
|
@@ -3527,7 +3572,7 @@ function SigninModal({ isOpen, onClose, onError }) {
|
|
|
3527
3572
|
onClose();
|
|
3528
3573
|
return;
|
|
3529
3574
|
}
|
|
3530
|
-
|
|
3575
|
+
onClose();
|
|
3531
3576
|
};
|
|
3532
3577
|
const handleSiweSuccess = async (data) => {
|
|
3533
3578
|
if (data.keyStorageType) {
|
|
@@ -3549,7 +3594,7 @@ function SigninModal({ isOpen, onClose, onError }) {
|
|
|
3549
3594
|
onClose();
|
|
3550
3595
|
return;
|
|
3551
3596
|
}
|
|
3552
|
-
|
|
3597
|
+
onClose();
|
|
3553
3598
|
};
|
|
3554
3599
|
const handlePasskeyComplete = () => {
|
|
3555
3600
|
onClose();
|
|
@@ -3559,18 +3604,6 @@ function SigninModal({ isOpen, onClose, onError }) {
|
|
|
3559
3604
|
onError(error);
|
|
3560
3605
|
}
|
|
3561
3606
|
};
|
|
3562
|
-
const handleLogout = async () => {
|
|
3563
|
-
try {
|
|
3564
|
-
await logout();
|
|
3565
|
-
setCurrentScreen("method-select");
|
|
3566
|
-
setEmail("");
|
|
3567
|
-
onClose();
|
|
3568
|
-
} catch (error) {
|
|
3569
|
-
if (onError) {
|
|
3570
|
-
onError(error instanceof Error ? error : new Error("Logout failed"));
|
|
3571
|
-
}
|
|
3572
|
-
}
|
|
3573
|
-
};
|
|
3574
3607
|
const handleBackdropClick = (_e) => {
|
|
3575
3608
|
if (currentScreen !== "passkey-setup" || hasPasskey) {
|
|
3576
3609
|
setCurrentScreen("method-select");
|
|
@@ -3634,7 +3667,6 @@ function SigninModal({ isOpen, onClose, onError }) {
|
|
|
3634
3667
|
wrapInModal: false,
|
|
3635
3668
|
onComplete: handlePasskeyComplete,
|
|
3636
3669
|
onError: handlePasskeyError,
|
|
3637
|
-
onLogout: handleLogout,
|
|
3638
3670
|
onClose
|
|
3639
3671
|
},
|
|
3640
3672
|
"passkey-setup"
|
|
@@ -3723,7 +3755,7 @@ function AssetSelectView({
|
|
|
3723
3755
|
}) })
|
|
3724
3756
|
] });
|
|
3725
3757
|
}
|
|
3726
|
-
var TextLinkButton =
|
|
3758
|
+
var TextLinkButton = React14__default.default.forwardRef(({ showArrow = false, className, children, ...props }, ref) => {
|
|
3727
3759
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3728
3760
|
"button",
|
|
3729
3761
|
{
|
|
@@ -3852,23 +3884,23 @@ function WalletTransferView({
|
|
|
3852
3884
|
const { config } = react.useVolrContext();
|
|
3853
3885
|
const { client } = react.useInternalAuth();
|
|
3854
3886
|
const { isDetecting, getWalletsForDisplay, hasWallet } = react.useEIP6963();
|
|
3855
|
-
const [viewState, setViewState] =
|
|
3856
|
-
const [selectedWallet, setSelectedWallet] =
|
|
3857
|
-
const [connectedAddress, setConnectedAddress] =
|
|
3858
|
-
const [balance, setBalance] =
|
|
3859
|
-
const [amount, setAmount] =
|
|
3860
|
-
const [isConnecting, setIsConnecting] =
|
|
3861
|
-
const [isTransferring, setIsTransferring] =
|
|
3862
|
-
const [error, setError] =
|
|
3863
|
-
const [chainName, setChainName] =
|
|
3864
|
-
const [currentChainId, setCurrentChainId] =
|
|
3887
|
+
const [viewState, setViewState] = React14.useState("select-wallet");
|
|
3888
|
+
const [selectedWallet, setSelectedWallet] = React14.useState(null);
|
|
3889
|
+
const [connectedAddress, setConnectedAddress] = React14.useState(null);
|
|
3890
|
+
const [balance, setBalance] = React14.useState(null);
|
|
3891
|
+
const [amount, setAmount] = React14.useState("");
|
|
3892
|
+
const [isConnecting, setIsConnecting] = React14.useState(false);
|
|
3893
|
+
const [isTransferring, setIsTransferring] = React14.useState(false);
|
|
3894
|
+
const [error, setError] = React14.useState(null);
|
|
3895
|
+
const [chainName, setChainName] = React14.useState(null);
|
|
3896
|
+
const [currentChainId, setCurrentChainId] = React14.useState(null);
|
|
3865
3897
|
const tokenSymbol = asset === "native" ? "ETH" : asset.symbol;
|
|
3866
3898
|
const decimals = asset === "native" ? 18 : asset.decimals;
|
|
3867
|
-
const getNetworkInfo =
|
|
3899
|
+
const getNetworkInfo = React14.useCallback(
|
|
3868
3900
|
react.createGetNetworkInfo({ client, rpcOverrides: config.rpcOverrides }),
|
|
3869
3901
|
[client, config.rpcOverrides]
|
|
3870
3902
|
);
|
|
3871
|
-
|
|
3903
|
+
React14.useEffect(() => {
|
|
3872
3904
|
let cancelled = false;
|
|
3873
3905
|
const loadChainName = async () => {
|
|
3874
3906
|
try {
|
|
@@ -3883,7 +3915,7 @@ function WalletTransferView({
|
|
|
3883
3915
|
cancelled = true;
|
|
3884
3916
|
};
|
|
3885
3917
|
}, [getNetworkInfo, chainId]);
|
|
3886
|
-
const connectWallet =
|
|
3918
|
+
const connectWallet = React14.useCallback(async (wallet) => {
|
|
3887
3919
|
setIsConnecting(true);
|
|
3888
3920
|
setError(null);
|
|
3889
3921
|
try {
|
|
@@ -3907,7 +3939,7 @@ function WalletTransferView({
|
|
|
3907
3939
|
setIsConnecting(false);
|
|
3908
3940
|
}
|
|
3909
3941
|
}, [chainId, asset]);
|
|
3910
|
-
const fetchBalance =
|
|
3942
|
+
const fetchBalance = React14.useCallback(async (provider, address, currentChain) => {
|
|
3911
3943
|
try {
|
|
3912
3944
|
if (currentChain !== chainId) {
|
|
3913
3945
|
setBalance(null);
|
|
@@ -3932,7 +3964,7 @@ function WalletTransferView({
|
|
|
3932
3964
|
setBalance(BigInt(0));
|
|
3933
3965
|
}
|
|
3934
3966
|
}, [chainId, asset]);
|
|
3935
|
-
const switchNetwork =
|
|
3967
|
+
const switchNetwork = React14.useCallback(async () => {
|
|
3936
3968
|
if (!selectedWallet?.provider) return;
|
|
3937
3969
|
try {
|
|
3938
3970
|
await selectedWallet.provider.request({
|
|
@@ -3950,7 +3982,7 @@ function WalletTransferView({
|
|
|
3950
3982
|
setError(err instanceof Error ? err.message : "Failed to switch network");
|
|
3951
3983
|
}
|
|
3952
3984
|
}, [selectedWallet, chainId, connectedAddress, fetchBalance]);
|
|
3953
|
-
const executeTransfer =
|
|
3985
|
+
const executeTransfer = React14.useCallback(async () => {
|
|
3954
3986
|
if (!selectedWallet?.provider || !connectedAddress || !amount) return;
|
|
3955
3987
|
setIsTransferring(true);
|
|
3956
3988
|
setError(null);
|
|
@@ -3993,7 +4025,7 @@ function WalletTransferView({
|
|
|
3993
4025
|
setIsTransferring(false);
|
|
3994
4026
|
}
|
|
3995
4027
|
}, [selectedWallet, connectedAddress, amount, decimals, balance, asset, destinationAddress, onSuccess, t]);
|
|
3996
|
-
const setMaxAmount =
|
|
4028
|
+
const setMaxAmount = React14.useCallback(() => {
|
|
3997
4029
|
if (balance !== null) {
|
|
3998
4030
|
const formatted = formatUnits(balance, decimals);
|
|
3999
4031
|
setAmount(formatted);
|
|
@@ -4359,7 +4391,7 @@ var DepositCompletedToast = ({
|
|
|
4359
4391
|
symbol
|
|
4360
4392
|
}) => {
|
|
4361
4393
|
const { t } = useI18n();
|
|
4362
|
-
const [expanded, setExpanded] =
|
|
4394
|
+
const [expanded, setExpanded] = React14.useState(false);
|
|
4363
4395
|
const formatAmount = (amount) => {
|
|
4364
4396
|
const divisor = BigInt(10 ** decimals);
|
|
4365
4397
|
const whole = amount / divisor;
|
|
@@ -4519,11 +4551,11 @@ function DepositQRView(props) {
|
|
|
4519
4551
|
const { t } = useI18n();
|
|
4520
4552
|
const { config } = react.useVolrContext();
|
|
4521
4553
|
const { client } = react.useInternalAuth();
|
|
4522
|
-
const [chainName, setChainName] =
|
|
4523
|
-
const [showOtherTokenModal, setShowOtherTokenModal] =
|
|
4524
|
-
const [showToast, setShowToast] =
|
|
4525
|
-
const [toastData, setToastData] =
|
|
4526
|
-
const [viewMode, setViewMode] =
|
|
4554
|
+
const [chainName, setChainName] = React14.useState(null);
|
|
4555
|
+
const [showOtherTokenModal, setShowOtherTokenModal] = React14.useState(false);
|
|
4556
|
+
const [showToast, setShowToast] = React14.useState(false);
|
|
4557
|
+
const [toastData, setToastData] = React14.useState(null);
|
|
4558
|
+
const [viewMode, setViewMode] = React14.useState("qr");
|
|
4527
4559
|
const eip681 = `ethereum:${props.address}`;
|
|
4528
4560
|
const status = react.useDepositListener({
|
|
4529
4561
|
chainId: props.chainId,
|
|
@@ -4536,7 +4568,7 @@ function DepositQRView(props) {
|
|
|
4536
4568
|
},
|
|
4537
4569
|
address: props.address
|
|
4538
4570
|
});
|
|
4539
|
-
|
|
4571
|
+
React14.useEffect(() => {
|
|
4540
4572
|
if (status.state === "detected") {
|
|
4541
4573
|
setToastData({
|
|
4542
4574
|
previousBalance: status.previousBalance,
|
|
@@ -4546,11 +4578,11 @@ function DepositQRView(props) {
|
|
|
4546
4578
|
setShowToast(true);
|
|
4547
4579
|
}
|
|
4548
4580
|
}, [status]);
|
|
4549
|
-
const getNetworkInfo =
|
|
4581
|
+
const getNetworkInfo = React14.useCallback(
|
|
4550
4582
|
react.createGetNetworkInfo({ client, rpcOverrides: config.rpcOverrides }),
|
|
4551
4583
|
[client, config.rpcOverrides]
|
|
4552
4584
|
);
|
|
4553
|
-
|
|
4585
|
+
React14.useEffect(() => {
|
|
4554
4586
|
let cancelled = false;
|
|
4555
4587
|
const loadChainName = async () => {
|
|
4556
4588
|
try {
|
|
@@ -4787,63 +4819,53 @@ function DepositModalBody({
|
|
|
4787
4819
|
}
|
|
4788
4820
|
);
|
|
4789
4821
|
}
|
|
4790
|
-
function
|
|
4791
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4792
|
-
"
|
|
4822
|
+
function DepositIcon() {
|
|
4823
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "volr:w-5 volr:h-5 volr:text-slate-800", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4824
|
+
"path",
|
|
4793
4825
|
{
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
"path",
|
|
4800
|
-
{
|
|
4801
|
-
fillRule: "evenodd",
|
|
4802
|
-
d: "M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",
|
|
4803
|
-
clipRule: "evenodd"
|
|
4804
|
-
}
|
|
4805
|
-
)
|
|
4826
|
+
d: "M12 4V20M12 20L6 14M12 20L18 14",
|
|
4827
|
+
stroke: "currentColor",
|
|
4828
|
+
strokeWidth: "2.5",
|
|
4829
|
+
strokeLinecap: "round",
|
|
4830
|
+
strokeLinejoin: "round"
|
|
4806
4831
|
}
|
|
4807
|
-
);
|
|
4808
|
-
}
|
|
4809
|
-
function WalletIcon2({ className }) {
|
|
4810
|
-
return /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12a2.25 2.25 0 00-2.25-2.25H15a3 3 0 11-6 0H5.25A2.25 2.25 0 003 12m18 0v6a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 18v-6m18 0V9M3 12V9m18 0a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 9m18 0V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v3" }) });
|
|
4811
|
-
}
|
|
4812
|
-
function ArrowDownIcon({ className }) {
|
|
4813
|
-
return /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 13.5L12 21m0 0l-7.5-7.5M12 21V3" }) });
|
|
4832
|
+
) });
|
|
4814
4833
|
}
|
|
4815
|
-
function
|
|
4816
|
-
return /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 24 24", fill: "none",
|
|
4834
|
+
function WithdrawIcon() {
|
|
4835
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "volr:w-5 volr:h-5 volr:text-slate-800", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4836
|
+
"path",
|
|
4837
|
+
{
|
|
4838
|
+
d: "M12 20V4M12 4L6 10M12 4L18 10",
|
|
4839
|
+
stroke: "currentColor",
|
|
4840
|
+
strokeWidth: "2.5",
|
|
4841
|
+
strokeLinecap: "round",
|
|
4842
|
+
strokeLinejoin: "round"
|
|
4843
|
+
}
|
|
4844
|
+
) });
|
|
4817
4845
|
}
|
|
4818
|
-
function
|
|
4819
|
-
return /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "
|
|
4846
|
+
function WalletIcon2({ className }) {
|
|
4847
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12a2.25 2.25 0 00-2.25-2.25H15a3 3 0 11-6 0H5.25A2.25 2.25 0 003 12m18 0v6a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 18v-6m18 0V9M3 12V9m18 0a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 9m18 0V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v3" }) });
|
|
4820
4848
|
}
|
|
4821
4849
|
function UserIcon({ className }) {
|
|
4822
|
-
return /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "
|
|
4850
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" }) });
|
|
4823
4851
|
}
|
|
4824
|
-
function
|
|
4852
|
+
function QuickAction({ icon, label, onClick }) {
|
|
4825
4853
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4826
4854
|
"button",
|
|
4827
4855
|
{
|
|
4828
4856
|
type: "button",
|
|
4829
4857
|
onClick,
|
|
4830
|
-
className:
|
|
4858
|
+
className: "volr:flex volr:flex-col volr:items-center volr:gap-3 volr:flex-1 volr:rounded-xl volr:border volr:border-slate-200 volr:bg-white volr:px-3 volr:py-4 volr:text-center hover:volr:border-slate-300 hover:volr:bg-slate-50 hover:volr:shadow-sm active:volr:bg-slate-100 active:volr:scale-[0.98] volr:transition-all volr:duration-200",
|
|
4831
4859
|
children: [
|
|
4832
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:w-
|
|
4833
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4834
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "volr:text-sm volr:font-medium volr:text-slate-900", children: label }),
|
|
4835
|
-
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-xs volr:text-slate-400", children: description })
|
|
4836
|
-
] }),
|
|
4837
|
-
/* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon, { className: "volr:w-4 volr:h-4 volr:text-slate-300" })
|
|
4860
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:w-12 volr:h-12 volr:rounded-full volr:bg-slate-100 volr:border volr:border-slate-200 volr:flex volr:items-center volr:justify-center volr:shadow-sm", children: icon }),
|
|
4861
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "volr:text-xs volr:font-medium volr:text-slate-900", children: label })
|
|
4838
4862
|
]
|
|
4839
4863
|
}
|
|
4840
4864
|
);
|
|
4841
4865
|
}
|
|
4842
4866
|
function AccountMainView({
|
|
4843
4867
|
totalUsd,
|
|
4844
|
-
balances,
|
|
4845
4868
|
isLoading,
|
|
4846
|
-
paymentEnabled,
|
|
4847
4869
|
onNavigate,
|
|
4848
4870
|
onLogout,
|
|
4849
4871
|
isLoggingOut
|
|
@@ -4855,67 +4877,63 @@ function AccountMainView({
|
|
|
4855
4877
|
minimumFractionDigits: 2,
|
|
4856
4878
|
maximumFractionDigits: 2
|
|
4857
4879
|
});
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
},
|
|
4874
|
-
{
|
|
4875
|
-
key: "withdraw",
|
|
4876
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(ArrowUpIcon, { className: "volr:w-4 volr:h-4 volr:text-slate-600" }),
|
|
4877
|
-
label: t("account.menu.withdraw"),
|
|
4878
|
-
view: "withdraw"
|
|
4879
|
-
},
|
|
4880
|
-
...paymentEnabled ? [
|
|
4881
|
-
{
|
|
4882
|
-
key: "payments",
|
|
4883
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(ClockIcon, { className: "volr:w-4 volr:h-4 volr:text-slate-600" }),
|
|
4884
|
-
label: t("account.menu.payments"),
|
|
4885
|
-
view: "payments"
|
|
4886
|
-
}
|
|
4887
|
-
] : [],
|
|
4888
|
-
{
|
|
4889
|
-
key: "account",
|
|
4890
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(UserIcon, { className: "volr:w-4 volr:h-4 volr:text-slate-600" }),
|
|
4891
|
-
label: t("account.menu.account"),
|
|
4892
|
-
view: "account"
|
|
4893
|
-
}
|
|
4894
|
-
];
|
|
4895
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4896
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:rounded-xl volr:bg-gradient-to-br volr:from-slate-50 volr:to-slate-100 volr:p-4 volr:mb-4", children: [
|
|
4897
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-xs volr:text-slate-500 volr:mb-0.5", children: t("account.totalBalance") }),
|
|
4898
|
-
isLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:animate-pulse", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:h-8 volr:w-32 volr:bg-slate-200 volr:rounded" }) }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-2xl volr:font-semibold volr:text-slate-900", children: formattedUsd })
|
|
4880
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:px-5 volr:pt-5 volr:pb-6 volr:flex volr:flex-col", style: { gap: "1.5rem" }, children: [
|
|
4881
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:rounded-2xl volr:border volr:border-slate-200 volr:bg-white volr:py-7 volr:shadow-sm", children: [
|
|
4882
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-xs volr:font-medium volr:uppercase volr:tracking-wider volr:text-slate-500 volr:mb-3 volr:text-center", children: t("account.totalBalance") }),
|
|
4883
|
+
isLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:animate-pulse volr:text-center volr:w-full", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:h-16 volr:w-48 volr:bg-slate-200 volr:rounded-lg" }) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4884
|
+
"p",
|
|
4885
|
+
{
|
|
4886
|
+
className: "volr:leading-none volr:font-semibold volr:text-slate-900 volr:tracking-tight volr:text-center",
|
|
4887
|
+
style: {
|
|
4888
|
+
fontSize: "3rem",
|
|
4889
|
+
lineHeight: "1",
|
|
4890
|
+
fontWeight: 600
|
|
4891
|
+
},
|
|
4892
|
+
children: formattedUsd
|
|
4893
|
+
}
|
|
4894
|
+
)
|
|
4899
4895
|
] }),
|
|
4900
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4896
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:flex volr:gap-2", children: [
|
|
4897
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4898
|
+
QuickAction,
|
|
4899
|
+
{
|
|
4900
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(DepositIcon, {}),
|
|
4901
|
+
label: t("account.menu.deposit"),
|
|
4902
|
+
onClick: () => onNavigate("deposit")
|
|
4903
|
+
}
|
|
4904
|
+
),
|
|
4905
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4906
|
+
QuickAction,
|
|
4907
|
+
{
|
|
4908
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(WithdrawIcon, {}),
|
|
4909
|
+
label: t("account.menu.withdraw"),
|
|
4910
|
+
onClick: () => onNavigate("withdraw")
|
|
4911
|
+
}
|
|
4912
|
+
),
|
|
4913
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4914
|
+
QuickAction,
|
|
4915
|
+
{
|
|
4916
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(WalletIcon2, { className: "volr:w-5 volr:h-5 volr:text-slate-800" }),
|
|
4917
|
+
label: t("account.menu.assets"),
|
|
4918
|
+
onClick: () => onNavigate("assets")
|
|
4919
|
+
}
|
|
4920
|
+
),
|
|
4921
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4922
|
+
QuickAction,
|
|
4923
|
+
{
|
|
4924
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(UserIcon, { className: "volr:w-5 volr:h-5 volr:text-slate-800" }),
|
|
4925
|
+
label: t("account.menu.account"),
|
|
4926
|
+
onClick: () => onNavigate("account")
|
|
4927
|
+
}
|
|
4928
|
+
)
|
|
4929
|
+
] }),
|
|
4930
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:pt-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4913
4931
|
"button",
|
|
4914
4932
|
{
|
|
4915
4933
|
type: "button",
|
|
4916
4934
|
onClick: onLogout,
|
|
4917
4935
|
disabled: isLoggingOut,
|
|
4918
|
-
className: "volr:w-full volr:py-
|
|
4936
|
+
className: "volr:w-full volr:rounded-lg volr:py-3 volr:text-sm volr:font-medium volr:text-slate-500 volr:text-center hover:volr:bg-slate-50 hover:volr:text-slate-700 volr:transition-colors volr:duration-200 disabled:volr:opacity-50",
|
|
4919
4937
|
children: isLoggingOut ? t("common.loading") : t("account.logout")
|
|
4920
4938
|
}
|
|
4921
4939
|
) })
|
|
@@ -4972,7 +4990,7 @@ function BalanceDetailView({
|
|
|
4972
4990
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: balances.map((token) => /* @__PURE__ */ jsxRuntime.jsx(TokenRow, { token }, token.id)) })
|
|
4973
4991
|
] });
|
|
4974
4992
|
}
|
|
4975
|
-
var Input =
|
|
4993
|
+
var Input = React14__default.default.forwardRef(
|
|
4976
4994
|
({ leftIcon, error, className, style, disabled, ...props }, ref) => {
|
|
4977
4995
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:relative", children: [
|
|
4978
4996
|
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:absolute volr:left-3 volr:top-1/2 volr:-translate-y-1/2 volr:pointer-events-none volr-text-muted", children: leftIcon }),
|
|
@@ -5003,16 +5021,16 @@ function WithdrawView({
|
|
|
5003
5021
|
}) {
|
|
5004
5022
|
const { t } = useI18n();
|
|
5005
5023
|
const { withdraw, isWithdrawing, result, error, reset } = react.useWithdraw();
|
|
5006
|
-
const [step, setStep] =
|
|
5007
|
-
const [selectedTokenId, setSelectedTokenId] =
|
|
5008
|
-
const [toAddress, setToAddress] =
|
|
5009
|
-
const [amount, setAmount] =
|
|
5010
|
-
const [useConnectedWallet, setUseConnectedWallet] =
|
|
5011
|
-
const selectedToken =
|
|
5024
|
+
const [step, setStep] = React14.useState("select");
|
|
5025
|
+
const [selectedTokenId, setSelectedTokenId] = React14.useState(null);
|
|
5026
|
+
const [toAddress, setToAddress] = React14.useState("");
|
|
5027
|
+
const [amount, setAmount] = React14.useState("");
|
|
5028
|
+
const [useConnectedWallet, setUseConnectedWallet] = React14.useState(false);
|
|
5029
|
+
const selectedToken = React14.useMemo(
|
|
5012
5030
|
() => balances.find((b) => b.id === selectedTokenId),
|
|
5013
5031
|
[balances, selectedTokenId]
|
|
5014
5032
|
);
|
|
5015
|
-
const connectedAddress =
|
|
5033
|
+
const connectedAddress = React14.useMemo(() => {
|
|
5016
5034
|
if (!connectedWallet) return null;
|
|
5017
5035
|
const parts = connectedWallet.split(":");
|
|
5018
5036
|
return parts.length >= 2 ? parts[1] : null;
|
|
@@ -5051,7 +5069,7 @@ function WithdrawView({
|
|
|
5051
5069
|
setAmount("");
|
|
5052
5070
|
setUseConnectedWallet(false);
|
|
5053
5071
|
};
|
|
5054
|
-
const isAmountValid =
|
|
5072
|
+
const isAmountValid = React14.useMemo(() => {
|
|
5055
5073
|
if (!amount || !selectedToken) return false;
|
|
5056
5074
|
const num = parseFloat(amount);
|
|
5057
5075
|
if (isNaN(num) || num <= 0) return false;
|
|
@@ -5231,6 +5249,25 @@ function WithdrawView({
|
|
|
5231
5249
|
}
|
|
5232
5250
|
return null;
|
|
5233
5251
|
}
|
|
5252
|
+
function ChevronRightIcon({ className }) {
|
|
5253
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5254
|
+
"svg",
|
|
5255
|
+
{
|
|
5256
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5257
|
+
viewBox: "0 0 20 20",
|
|
5258
|
+
fill: "currentColor",
|
|
5259
|
+
className,
|
|
5260
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5261
|
+
"path",
|
|
5262
|
+
{
|
|
5263
|
+
fillRule: "evenodd",
|
|
5264
|
+
d: "M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",
|
|
5265
|
+
clipRule: "evenodd"
|
|
5266
|
+
}
|
|
5267
|
+
)
|
|
5268
|
+
}
|
|
5269
|
+
);
|
|
5270
|
+
}
|
|
5234
5271
|
function PaymentRow({ payment, onClick }) {
|
|
5235
5272
|
const { t } = useI18n();
|
|
5236
5273
|
const date = new Date(payment.createdAt);
|
|
@@ -5288,10 +5325,10 @@ function PaymentRow({ payment, onClick }) {
|
|
|
5288
5325
|
function PaymentHistoryView({ onSelectPayment }) {
|
|
5289
5326
|
const { t } = useI18n();
|
|
5290
5327
|
const { getPaymentHistory, isLoading: isApiLoading } = react.useVolrPaymentApi();
|
|
5291
|
-
const [payments, setPayments] =
|
|
5292
|
-
const [isLoading, setIsLoading] =
|
|
5293
|
-
const [error, setError] =
|
|
5294
|
-
|
|
5328
|
+
const [payments, setPayments] = React14.useState([]);
|
|
5329
|
+
const [isLoading, setIsLoading] = React14.useState(true);
|
|
5330
|
+
const [error, setError] = React14.useState(null);
|
|
5331
|
+
React14.useEffect(() => {
|
|
5295
5332
|
setIsLoading(true);
|
|
5296
5333
|
setError(null);
|
|
5297
5334
|
getPaymentHistory({ take: 20 }).then((result) => {
|
|
@@ -5440,13 +5477,13 @@ function PaymentDetailView({ payment }) {
|
|
|
5440
5477
|
] });
|
|
5441
5478
|
}
|
|
5442
5479
|
function InfoRow({ label, value, copyable, mono }) {
|
|
5443
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:py-
|
|
5444
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-xs volr:text-slate-
|
|
5445
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:flex volr:items-center volr:justify-between
|
|
5480
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:px-5 volr:py-4 volr:border-b volr:border-slate-200 last:volr:border-b-0", children: [
|
|
5481
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-xs volr:font-medium volr:text-slate-500 volr:mb-2", children: label }),
|
|
5482
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:flex volr:items-center volr:justify-between", style: { gap: "0.5rem" }, children: [
|
|
5446
5483
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5447
5484
|
"p",
|
|
5448
5485
|
{
|
|
5449
|
-
className: `volr:text-sm volr:text-slate-900 volr:break-all ${mono ? "volr:font-mono" : ""}`,
|
|
5486
|
+
className: `volr:text-sm volr:font-medium volr:text-slate-900 volr:break-all volr:flex-1 ${mono ? "volr:font-mono" : ""}`,
|
|
5450
5487
|
children: value
|
|
5451
5488
|
}
|
|
5452
5489
|
),
|
|
@@ -5476,36 +5513,49 @@ function AccountInfoView({ user }) {
|
|
|
5476
5513
|
return `${address.slice(0, 6)}...${address.slice(-4)}`;
|
|
5477
5514
|
};
|
|
5478
5515
|
const externalWallet = user.authWallet ? user.authWallet.split(":")[1] || user.authWallet : null;
|
|
5479
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
5480
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5481
|
-
/* @__PURE__ */ jsxRuntime.
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5516
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:px-5 volr:pt-5 volr:pb-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:rounded-xl volr:border volr:border-slate-200 volr:bg-white volr:overflow-hidden volr:shadow-sm", children: [
|
|
5517
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoRow, { label: t("account.info.loginMethod.label"), value: getLoginMethod() }),
|
|
5518
|
+
user.email && !user.email.includes("@wallet.") && /* @__PURE__ */ jsxRuntime.jsx(InfoRow, { label: t("account.email"), value: user.email }),
|
|
5519
|
+
user.evmAddress && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5520
|
+
InfoRow,
|
|
5521
|
+
{
|
|
5522
|
+
label: t("account.walletAddress"),
|
|
5523
|
+
value: formatAddress(user.evmAddress),
|
|
5524
|
+
copyable: true,
|
|
5525
|
+
mono: true
|
|
5526
|
+
}
|
|
5527
|
+
),
|
|
5528
|
+
externalWallet && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5529
|
+
InfoRow,
|
|
5530
|
+
{
|
|
5531
|
+
label: t("account.info.connectedWallet"),
|
|
5532
|
+
value: formatAddress(externalWallet),
|
|
5533
|
+
copyable: true,
|
|
5534
|
+
mono: true
|
|
5535
|
+
}
|
|
5536
|
+
),
|
|
5537
|
+
user.signerType && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5538
|
+
InfoRow,
|
|
5539
|
+
{
|
|
5540
|
+
label: t("account.info.signerType"),
|
|
5541
|
+
value: user.signerType === "passkey" ? "Passkey" : user.signerType
|
|
5542
|
+
}
|
|
5543
|
+
)
|
|
5544
|
+
] }) });
|
|
5545
|
+
}
|
|
5546
|
+
function AccountSetupView({
|
|
5547
|
+
onCreateAccount,
|
|
5548
|
+
onLogout
|
|
5549
|
+
}) {
|
|
5550
|
+
const { t } = useI18n();
|
|
5551
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:space-y-5", children: [
|
|
5552
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:space-y-2", children: [
|
|
5553
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-xl volr:font-semibold volr:text-slate-900", children: t("account.setup.title") }),
|
|
5554
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-sm volr:text-slate-600 volr:leading-relaxed", children: t("account.setup.description") })
|
|
5555
|
+
] }),
|
|
5556
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:flex volr:flex-col volr:gap-2", children: [
|
|
5557
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { className: "volr:w-full", onClick: onCreateAccount, children: t("account.setup.cta") }),
|
|
5558
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { className: "volr:w-full", variant: "secondary", onClick: onLogout, children: t("account.setup.logout") })
|
|
5509
5559
|
] })
|
|
5510
5560
|
] });
|
|
5511
5561
|
}
|
|
@@ -5513,16 +5563,17 @@ function AccountModal({ isOpen, onClose, onError }) {
|
|
|
5513
5563
|
const { user, logout } = react.useVolrContext();
|
|
5514
5564
|
const { balances, totalUsd, isLoading, paymentEnabled, refresh } = react.useUserBalances();
|
|
5515
5565
|
const { client } = react.useInternalAuth();
|
|
5516
|
-
const [currentView, setCurrentView] =
|
|
5517
|
-
const [selectedPayment, setSelectedPayment] =
|
|
5518
|
-
const [isLoggingOut, setIsLoggingOut] =
|
|
5519
|
-
const prevUserRef =
|
|
5520
|
-
const [closingAfterLogin, setClosingAfterLogin] =
|
|
5521
|
-
const [
|
|
5522
|
-
const [
|
|
5523
|
-
const [
|
|
5524
|
-
const [
|
|
5525
|
-
|
|
5566
|
+
const [currentView, setCurrentView] = React14.useState("main");
|
|
5567
|
+
const [selectedPayment, setSelectedPayment] = React14.useState(null);
|
|
5568
|
+
const [isLoggingOut, setIsLoggingOut] = React14.useState(false);
|
|
5569
|
+
const prevUserRef = React14.useRef(user ?? null);
|
|
5570
|
+
const [closingAfterLogin, setClosingAfterLogin] = React14.useState(false);
|
|
5571
|
+
const [setupStep, setSetupStep] = React14.useState("prompt");
|
|
5572
|
+
const [depositAssets, setDepositAssets] = React14.useState([]);
|
|
5573
|
+
const [depositLoading, setDepositLoading] = React14.useState(false);
|
|
5574
|
+
const [depositError, setDepositError] = React14.useState(null);
|
|
5575
|
+
const [depositSelectedIdx, setDepositSelectedIdx] = React14.useState(-1);
|
|
5576
|
+
React14.useEffect(() => {
|
|
5526
5577
|
if (currentView !== "deposit" || !isOpen) return;
|
|
5527
5578
|
setDepositLoading(true);
|
|
5528
5579
|
setDepositError(null);
|
|
@@ -5539,16 +5590,17 @@ function AccountModal({ isOpen, onClose, onError }) {
|
|
|
5539
5590
|
setDepositLoading(false);
|
|
5540
5591
|
});
|
|
5541
5592
|
}, [currentView, isOpen, client]);
|
|
5542
|
-
const handleOpenChange =
|
|
5593
|
+
const handleOpenChange = React14.useCallback((open) => {
|
|
5543
5594
|
if (!open) {
|
|
5544
5595
|
onClose();
|
|
5545
5596
|
setTimeout(() => {
|
|
5546
5597
|
setCurrentView("main");
|
|
5547
5598
|
setSelectedPayment(null);
|
|
5599
|
+
setSetupStep("prompt");
|
|
5548
5600
|
}, 200);
|
|
5549
5601
|
}
|
|
5550
5602
|
}, [onClose]);
|
|
5551
|
-
|
|
5603
|
+
React14.useEffect(() => {
|
|
5552
5604
|
if (!isOpen) {
|
|
5553
5605
|
setClosingAfterLogin(false);
|
|
5554
5606
|
prevUserRef.current = user ?? null;
|
|
@@ -5575,32 +5627,44 @@ function AccountModal({ isOpen, onClose, onError }) {
|
|
|
5575
5627
|
return /* @__PURE__ */ jsxRuntime.jsx(SigninModal, { isOpen, onClose, onError });
|
|
5576
5628
|
}
|
|
5577
5629
|
if (!user.keyStorageType) {
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
try {
|
|
5586
|
-
await logout();
|
|
5587
|
-
onClose();
|
|
5588
|
-
} catch (error) {
|
|
5589
|
-
if (onError) {
|
|
5590
|
-
onError(error instanceof Error ? error : new Error("Logout failed"));
|
|
5630
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Modal, { open: isOpen, onOpenChange: handleOpenChange, children: [
|
|
5631
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5632
|
+
ModalHeader,
|
|
5633
|
+
{
|
|
5634
|
+
back: setupStep === "enroll",
|
|
5635
|
+
onBack: setupStep === "enroll" ? () => setSetupStep("prompt") : void 0,
|
|
5636
|
+
onClose
|
|
5591
5637
|
}
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5638
|
+
),
|
|
5639
|
+
setupStep === "prompt" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5640
|
+
AccountSetupView,
|
|
5641
|
+
{
|
|
5642
|
+
onCreateAccount: () => setSetupStep("enroll"),
|
|
5643
|
+
onLogout: async () => {
|
|
5644
|
+
try {
|
|
5645
|
+
await logout();
|
|
5646
|
+
onClose();
|
|
5647
|
+
} catch (error) {
|
|
5648
|
+
if (onError) {
|
|
5649
|
+
onError(error instanceof Error ? error : new Error("Logout failed"));
|
|
5650
|
+
}
|
|
5651
|
+
}
|
|
5652
|
+
}
|
|
5653
|
+
}
|
|
5654
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5655
|
+
PasskeyEnrollView,
|
|
5656
|
+
{
|
|
5657
|
+
wrapInModal: false,
|
|
5658
|
+
onComplete: () => {
|
|
5659
|
+
setSetupStep("prompt");
|
|
5660
|
+
},
|
|
5661
|
+
onError: (error) => {
|
|
5662
|
+
if (onError) onError(error);
|
|
5663
|
+
},
|
|
5664
|
+
onClose: () => setSetupStep("prompt")
|
|
5665
|
+
}
|
|
5666
|
+
)
|
|
5667
|
+
] });
|
|
5604
5668
|
}
|
|
5605
5669
|
const handleLogout = async () => {
|
|
5606
5670
|
setIsLoggingOut(true);
|
|
@@ -5647,9 +5711,7 @@ function AccountModal({ isOpen, onClose, onError }) {
|
|
|
5647
5711
|
AccountMainView,
|
|
5648
5712
|
{
|
|
5649
5713
|
totalUsd,
|
|
5650
|
-
balances,
|
|
5651
5714
|
isLoading,
|
|
5652
|
-
paymentEnabled,
|
|
5653
5715
|
onNavigate: handleNavigate,
|
|
5654
5716
|
onLogout: handleLogout,
|
|
5655
5717
|
isLoggingOut
|
|
@@ -5705,11 +5767,11 @@ var DepositModal = ({
|
|
|
5705
5767
|
}) => {
|
|
5706
5768
|
const { user } = react.useVolrContext();
|
|
5707
5769
|
const { client } = react.useInternalAuth();
|
|
5708
|
-
const [depositAssets, setDepositAssets] =
|
|
5709
|
-
const [isLoading, setIsLoading] =
|
|
5710
|
-
const [error, setError] =
|
|
5711
|
-
const [selectedIdx, setSelectedIdx] =
|
|
5712
|
-
|
|
5770
|
+
const [depositAssets, setDepositAssets] = React14.useState([]);
|
|
5771
|
+
const [isLoading, setIsLoading] = React14.useState(true);
|
|
5772
|
+
const [error, setError] = React14.useState(null);
|
|
5773
|
+
const [selectedIdx, setSelectedIdx] = React14.useState(-1);
|
|
5774
|
+
React14.useEffect(() => {
|
|
5713
5775
|
if (!open) return;
|
|
5714
5776
|
setIsLoading(true);
|
|
5715
5777
|
setError(null);
|
|
@@ -5736,12 +5798,12 @@ var DepositModal = ({
|
|
|
5736
5798
|
if (depositAssets.length === 1) return 0;
|
|
5737
5799
|
return -1;
|
|
5738
5800
|
};
|
|
5739
|
-
|
|
5801
|
+
React14.useEffect(() => {
|
|
5740
5802
|
if (open && !isLoading && depositAssets.length > 0) {
|
|
5741
5803
|
setSelectedIdx(getInitialIndex());
|
|
5742
5804
|
}
|
|
5743
5805
|
}, [open, isLoading, depositAssets.length, asset]);
|
|
5744
|
-
|
|
5806
|
+
React14.useEffect(() => {
|
|
5745
5807
|
if (!open) {
|
|
5746
5808
|
setSelectedIdx(-1);
|
|
5747
5809
|
}
|
|
@@ -5773,6 +5835,7 @@ var DepositModal = ({
|
|
|
5773
5835
|
var initialState = {
|
|
5774
5836
|
step: "info",
|
|
5775
5837
|
processingStep: "signing",
|
|
5838
|
+
walletStep: "choice",
|
|
5776
5839
|
isConfigLoading: true,
|
|
5777
5840
|
isPaying: false,
|
|
5778
5841
|
payOptions: null,
|
|
@@ -5797,6 +5860,20 @@ function paymentModalReducer(state, action) {
|
|
|
5797
5860
|
payOptions: action.options,
|
|
5798
5861
|
isConfigLoading: true
|
|
5799
5862
|
};
|
|
5863
|
+
case "SHOW_WALLET":
|
|
5864
|
+
return {
|
|
5865
|
+
...state,
|
|
5866
|
+
step: "wallet",
|
|
5867
|
+
walletStep: action.walletStep,
|
|
5868
|
+
error: void 0
|
|
5869
|
+
};
|
|
5870
|
+
case "BACK_TO_PAYMENT":
|
|
5871
|
+
return {
|
|
5872
|
+
...state,
|
|
5873
|
+
step: "info",
|
|
5874
|
+
walletStep: "choice",
|
|
5875
|
+
error: void 0
|
|
5876
|
+
};
|
|
5800
5877
|
case "SET_TOKENS": {
|
|
5801
5878
|
const balances = /* @__PURE__ */ new Map();
|
|
5802
5879
|
for (const token of action.tokens) {
|
|
@@ -5884,7 +5961,7 @@ function usePaymentModalState(open, onOpenChange) {
|
|
|
5884
5961
|
const { evm } = react.useVolr();
|
|
5885
5962
|
const { paymentOptions } = useVolrModal();
|
|
5886
5963
|
const { createPayment, updatePaymentToProcessing, pollPaymentStatus, failPendingPayment } = react.useVolrPaymentApi();
|
|
5887
|
-
const [state, dispatch] =
|
|
5964
|
+
const [state, dispatch] = React14.useReducer(paymentModalReducer, initialState);
|
|
5888
5965
|
const tokensWithBalances = state.tokens.map((token) => {
|
|
5889
5966
|
const balanceData = state.tokenBalances.get(token.id);
|
|
5890
5967
|
return {
|
|
@@ -5896,7 +5973,7 @@ function usePaymentModalState(open, onOpenChange) {
|
|
|
5896
5973
|
});
|
|
5897
5974
|
const selectedToken = state.selectedTokenId ? tokensWithBalances.find((t) => t.id === state.selectedTokenId) ?? null : null;
|
|
5898
5975
|
const isBalanceLoading = tokensWithBalances.some((t) => t.isBalanceLoading);
|
|
5899
|
-
const fetchTokenBalance =
|
|
5976
|
+
const fetchTokenBalance = React14.useCallback(
|
|
5900
5977
|
async (token) => {
|
|
5901
5978
|
if (!user?.evmAddress) {
|
|
5902
5979
|
dispatch({
|
|
@@ -5944,20 +6021,20 @@ function usePaymentModalState(open, onOpenChange) {
|
|
|
5944
6021
|
},
|
|
5945
6022
|
[user, evm]
|
|
5946
6023
|
);
|
|
5947
|
-
const fetchAllBalances =
|
|
6024
|
+
const fetchAllBalances = React14.useCallback(
|
|
5948
6025
|
async (tokens) => {
|
|
5949
6026
|
await Promise.all(tokens.map((token) => fetchTokenBalance(token)));
|
|
5950
6027
|
},
|
|
5951
6028
|
[fetchTokenBalance]
|
|
5952
6029
|
);
|
|
5953
|
-
const fetchBranding =
|
|
6030
|
+
const fetchBranding = React14.useCallback(async () => {
|
|
5954
6031
|
try {
|
|
5955
6032
|
const response = await client.get("/auth/branding");
|
|
5956
6033
|
dispatch({ type: "SET_LOGO_URL", logoUrl: response.logoUrl });
|
|
5957
6034
|
} catch {
|
|
5958
6035
|
}
|
|
5959
6036
|
}, [client]);
|
|
5960
|
-
const fetchPaymentConfig =
|
|
6037
|
+
const fetchPaymentConfig = React14.useCallback(async () => {
|
|
5961
6038
|
dispatch({ type: "SET_CONFIG_LOADING", loading: true });
|
|
5962
6039
|
try {
|
|
5963
6040
|
const response = await client.get("/payments/config");
|
|
@@ -5974,7 +6051,7 @@ function usePaymentModalState(open, onOpenChange) {
|
|
|
5974
6051
|
dispatch({ type: "SET_CONFIG_LOADING", loading: false });
|
|
5975
6052
|
}
|
|
5976
6053
|
}, [client, fetchAllBalances]);
|
|
5977
|
-
const selectBestToken =
|
|
6054
|
+
const selectBestToken = React14.useCallback(() => {
|
|
5978
6055
|
if (state.tokens.length === 0) return;
|
|
5979
6056
|
if (state.selectedTokenId) return;
|
|
5980
6057
|
let bestTokenId = state.tokens[0].id;
|
|
@@ -5988,7 +6065,7 @@ function usePaymentModalState(open, onOpenChange) {
|
|
|
5988
6065
|
}
|
|
5989
6066
|
dispatch({ type: "SELECT_TOKEN", tokenId: bestTokenId });
|
|
5990
6067
|
}, [state.tokens, state.tokenBalances, state.selectedTokenId]);
|
|
5991
|
-
|
|
6068
|
+
React14.useEffect(() => {
|
|
5992
6069
|
if (open && paymentOptions?.options) {
|
|
5993
6070
|
if (state.step === "processing" || state.step === "result") {
|
|
5994
6071
|
return;
|
|
@@ -6000,17 +6077,44 @@ function usePaymentModalState(open, onOpenChange) {
|
|
|
6000
6077
|
dispatch({ type: "RESET" });
|
|
6001
6078
|
}
|
|
6002
6079
|
}, [open, paymentOptions?.options?.amount]);
|
|
6003
|
-
|
|
6080
|
+
React14.useEffect(() => {
|
|
6004
6081
|
if (!isBalanceLoading && state.tokens.length > 0 && !state.selectedTokenId) {
|
|
6005
6082
|
selectBestToken();
|
|
6006
6083
|
}
|
|
6007
6084
|
}, [isBalanceLoading, state.tokens.length, state.selectedTokenId, selectBestToken]);
|
|
6008
|
-
const handleSelectToken =
|
|
6085
|
+
const handleSelectToken = React14.useCallback((tokenId) => {
|
|
6009
6086
|
dispatch({ type: "SELECT_TOKEN", tokenId });
|
|
6010
6087
|
}, []);
|
|
6011
|
-
const
|
|
6088
|
+
const handleWalletBack = React14.useCallback(() => {
|
|
6089
|
+
if (state.step !== "wallet") {
|
|
6090
|
+
return;
|
|
6091
|
+
}
|
|
6092
|
+
if (state.walletStep === "choice") {
|
|
6093
|
+
dispatch({ type: "BACK_TO_PAYMENT" });
|
|
6094
|
+
return;
|
|
6095
|
+
}
|
|
6096
|
+
dispatch({ type: "SHOW_WALLET", walletStep: "choice" });
|
|
6097
|
+
}, [state.step, state.walletStep]);
|
|
6098
|
+
const handleChooseCreateAccount = React14.useCallback(() => {
|
|
6099
|
+
dispatch({ type: "SHOW_WALLET", walletStep: "create-account" });
|
|
6100
|
+
}, []);
|
|
6101
|
+
const handleChooseExternalWallet = React14.useCallback(() => {
|
|
6102
|
+
dispatch({ type: "SHOW_WALLET", walletStep: "external-wallet" });
|
|
6103
|
+
}, []);
|
|
6104
|
+
const handlePay = React14.useCallback(async () => {
|
|
6012
6105
|
const { payOptions, receiverAddress, selectedTokenId } = state;
|
|
6013
|
-
if (!payOptions || !
|
|
6106
|
+
if (!payOptions || !paymentOptions || !receiverAddress || !selectedTokenId) {
|
|
6107
|
+
return;
|
|
6108
|
+
}
|
|
6109
|
+
if (!user) {
|
|
6110
|
+
dispatch({
|
|
6111
|
+
type: "PAYMENT_ERROR",
|
|
6112
|
+
error: { code: "AUTH_REQUIRED", message: "Please sign in to continue." }
|
|
6113
|
+
});
|
|
6114
|
+
return;
|
|
6115
|
+
}
|
|
6116
|
+
if (!user.evmAddress) {
|
|
6117
|
+
dispatch({ type: "SHOW_WALLET", walletStep: "choice" });
|
|
6014
6118
|
return;
|
|
6015
6119
|
}
|
|
6016
6120
|
const tokenInfo = state.tokens.find((t) => t.id === selectedTokenId);
|
|
@@ -6119,10 +6223,144 @@ function usePaymentModalState(open, onOpenChange) {
|
|
|
6119
6223
|
pollPaymentStatus,
|
|
6120
6224
|
failPendingPayment
|
|
6121
6225
|
]);
|
|
6122
|
-
const
|
|
6226
|
+
const handleExternalWalletConnected = React14.useCallback(
|
|
6227
|
+
async ({ provider, address }) => {
|
|
6228
|
+
const { payOptions, receiverAddress, selectedTokenId } = state;
|
|
6229
|
+
if (!payOptions || !paymentOptions || !receiverAddress || !selectedTokenId) {
|
|
6230
|
+
return;
|
|
6231
|
+
}
|
|
6232
|
+
const tokenInfo = state.tokens.find((t) => t.id === selectedTokenId);
|
|
6233
|
+
if (!tokenInfo) {
|
|
6234
|
+
return;
|
|
6235
|
+
}
|
|
6236
|
+
if (tokenInfo.address === "native") {
|
|
6237
|
+
dispatch({
|
|
6238
|
+
type: "PAYMENT_ERROR",
|
|
6239
|
+
error: {
|
|
6240
|
+
code: "TOKEN_NOT_SUPPORTED",
|
|
6241
|
+
message: "External wallet payment is not supported for native tokens."
|
|
6242
|
+
}
|
|
6243
|
+
});
|
|
6244
|
+
return;
|
|
6245
|
+
}
|
|
6246
|
+
dispatch({ type: "START_PAYMENT" });
|
|
6247
|
+
let createdPaymentId = null;
|
|
6248
|
+
const toPaymentError = (err) => {
|
|
6249
|
+
const backend = err?.response?.data?.error;
|
|
6250
|
+
if (backend?.code && backend?.message) {
|
|
6251
|
+
return { code: backend.code, message: backend.message };
|
|
6252
|
+
}
|
|
6253
|
+
if (typeof err?.code === "string" && typeof err?.message === "string") {
|
|
6254
|
+
return { code: err.code, message: err.message };
|
|
6255
|
+
}
|
|
6256
|
+
return { code: "PAYMENT_FAILED", message: "Payment failed. Please try again." };
|
|
6257
|
+
};
|
|
6258
|
+
try {
|
|
6259
|
+
const payment = await createPayment({
|
|
6260
|
+
...payOptions,
|
|
6261
|
+
tokenId: selectedTokenId
|
|
6262
|
+
});
|
|
6263
|
+
createdPaymentId = payment.id;
|
|
6264
|
+
dispatch({ type: "SET_CREATED_PAYMENT", payment });
|
|
6265
|
+
if (payment.status !== "PENDING") {
|
|
6266
|
+
const alreadyProcessedError = new Error(
|
|
6267
|
+
payment.status === "CONFIRMED" ? "This payment has already been completed." : `Payment already processed with status: ${payment.status}.`
|
|
6268
|
+
);
|
|
6269
|
+
alreadyProcessedError.code = "PAYMENT_ALREADY_PROCESSED";
|
|
6270
|
+
alreadyProcessedError.payment = payment;
|
|
6271
|
+
throw alreadyProcessedError;
|
|
6272
|
+
}
|
|
6273
|
+
paymentOptions.options.handlers?.onCreated?.({ id: payment.id });
|
|
6274
|
+
const prepare = await client.post(`/payments/${payment.id}/external/permit/prepare`, {
|
|
6275
|
+
payer: address
|
|
6276
|
+
});
|
|
6277
|
+
const typedData = prepare.quote?.typedData;
|
|
6278
|
+
if (!typedData) {
|
|
6279
|
+
throw new Error("INVALID_TYPED_DATA");
|
|
6280
|
+
}
|
|
6281
|
+
try {
|
|
6282
|
+
const hexChainId = `0x${tokenInfo.chainId.toString(16)}`;
|
|
6283
|
+
await provider.request({
|
|
6284
|
+
method: "wallet_switchEthereumChain",
|
|
6285
|
+
params: [{ chainId: hexChainId }]
|
|
6286
|
+
});
|
|
6287
|
+
} catch {
|
|
6288
|
+
}
|
|
6289
|
+
let signature;
|
|
6290
|
+
try {
|
|
6291
|
+
signature = await provider.request({
|
|
6292
|
+
method: "eth_signTypedData_v4",
|
|
6293
|
+
params: [address, JSON.stringify(typedData)]
|
|
6294
|
+
});
|
|
6295
|
+
} catch {
|
|
6296
|
+
signature = await provider.request({
|
|
6297
|
+
method: "eth_signTypedData",
|
|
6298
|
+
params: [address, typedData]
|
|
6299
|
+
});
|
|
6300
|
+
}
|
|
6301
|
+
dispatch({ type: "SET_PROCESSING_STEP", step: "broadcasting" });
|
|
6302
|
+
const submit = await client.post(`/payments/${payment.id}/external/permit/submit`, {
|
|
6303
|
+
payer: address,
|
|
6304
|
+
signature,
|
|
6305
|
+
quote: prepare.quote,
|
|
6306
|
+
quoteSignature: prepare.quoteSignature
|
|
6307
|
+
});
|
|
6308
|
+
dispatch({ type: "SET_TX_HASH", txHash: submit.txHash ?? "" });
|
|
6309
|
+
dispatch({ type: "SET_PROCESSING_STEP", step: "confirming" });
|
|
6310
|
+
paymentOptions.onProcessing?.({
|
|
6311
|
+
...submit.payment,
|
|
6312
|
+
txHash: submit.txHash ?? submit.payment.txHash ?? "",
|
|
6313
|
+
status: "PROCESSING"
|
|
6314
|
+
});
|
|
6315
|
+
const confirmedPayment = await pollPaymentStatus(payment.id);
|
|
6316
|
+
dispatch({ type: "PAYMENT_SUCCESS", payment: confirmedPayment });
|
|
6317
|
+
if (confirmedPayment.status === "CONFIRMED") {
|
|
6318
|
+
paymentOptions.onComplete?.(confirmedPayment);
|
|
6319
|
+
} else if (confirmedPayment.status === "FAILED") {
|
|
6320
|
+
const failError = {
|
|
6321
|
+
code: "PAYMENT_FAILED",
|
|
6322
|
+
message: "Transaction failed on-chain"
|
|
6323
|
+
};
|
|
6324
|
+
dispatch({ type: "PAYMENT_ERROR", error: failError });
|
|
6325
|
+
paymentOptions.onError?.(failError);
|
|
6326
|
+
}
|
|
6327
|
+
} catch (err) {
|
|
6328
|
+
const isAlreadyProcessed = err?.code === "PAYMENT_ALREADY_PROCESSED";
|
|
6329
|
+
if (createdPaymentId && !isAlreadyProcessed) {
|
|
6330
|
+
try {
|
|
6331
|
+
await failPendingPayment(createdPaymentId);
|
|
6332
|
+
} catch {
|
|
6333
|
+
}
|
|
6334
|
+
}
|
|
6335
|
+
if (isAlreadyProcessed && err.payment) {
|
|
6336
|
+
dispatch({ type: "PAYMENT_SUCCESS", payment: err.payment });
|
|
6337
|
+
if (err.payment.status === "CONFIRMED") {
|
|
6338
|
+
paymentOptions?.onComplete?.(err.payment);
|
|
6339
|
+
} else {
|
|
6340
|
+
const paymentError2 = toPaymentError(err);
|
|
6341
|
+
dispatch({ type: "PAYMENT_ERROR", error: paymentError2 });
|
|
6342
|
+
paymentOptions?.onError?.(paymentError2);
|
|
6343
|
+
}
|
|
6344
|
+
return;
|
|
6345
|
+
}
|
|
6346
|
+
const paymentError = toPaymentError(err);
|
|
6347
|
+
dispatch({ type: "PAYMENT_ERROR", error: paymentError });
|
|
6348
|
+
paymentOptions?.onError?.(paymentError);
|
|
6349
|
+
}
|
|
6350
|
+
},
|
|
6351
|
+
[
|
|
6352
|
+
state,
|
|
6353
|
+
paymentOptions,
|
|
6354
|
+
client,
|
|
6355
|
+
createPayment,
|
|
6356
|
+
pollPaymentStatus,
|
|
6357
|
+
failPendingPayment
|
|
6358
|
+
]
|
|
6359
|
+
);
|
|
6360
|
+
const handleDeposit = React14.useCallback(() => {
|
|
6123
6361
|
dispatch({ type: "SHOW_DEPOSIT" });
|
|
6124
6362
|
}, []);
|
|
6125
|
-
const handleDepositClose =
|
|
6363
|
+
const handleDepositClose = React14.useCallback(
|
|
6126
6364
|
(depositOpen) => {
|
|
6127
6365
|
if (!depositOpen) {
|
|
6128
6366
|
dispatch({ type: "HIDE_DEPOSIT" });
|
|
@@ -6133,28 +6371,28 @@ function usePaymentModalState(open, onOpenChange) {
|
|
|
6133
6371
|
},
|
|
6134
6372
|
[state.tokens, fetchAllBalances]
|
|
6135
6373
|
);
|
|
6136
|
-
const handleDone =
|
|
6374
|
+
const handleDone = React14.useCallback(() => {
|
|
6137
6375
|
if (state.createdPayment?.status === "CONFIRMED") {
|
|
6138
6376
|
paymentOptions?.onComplete?.(state.createdPayment);
|
|
6139
6377
|
}
|
|
6140
6378
|
onOpenChange(false);
|
|
6141
6379
|
}, [state.createdPayment, paymentOptions, onOpenChange]);
|
|
6142
|
-
const handleRetry =
|
|
6380
|
+
const handleRetry = React14.useCallback(() => {
|
|
6143
6381
|
dispatch({ type: "RETRY" });
|
|
6144
6382
|
if (state.tokens.length > 0) {
|
|
6145
6383
|
fetchAllBalances(state.tokens);
|
|
6146
6384
|
}
|
|
6147
6385
|
}, [state.tokens, fetchAllBalances]);
|
|
6148
|
-
const handleClose =
|
|
6386
|
+
const handleClose = React14.useCallback(() => {
|
|
6149
6387
|
if (state.step === "processing") {
|
|
6150
6388
|
return;
|
|
6151
6389
|
}
|
|
6152
|
-
if (state.step === "info") {
|
|
6390
|
+
if (state.step === "info" || state.step === "wallet") {
|
|
6153
6391
|
paymentOptions?.onCancel?.();
|
|
6154
6392
|
}
|
|
6155
6393
|
onOpenChange(false);
|
|
6156
6394
|
}, [state.step, paymentOptions, onOpenChange]);
|
|
6157
|
-
const handleReport =
|
|
6395
|
+
const handleReport = React14.useCallback(async () => {
|
|
6158
6396
|
const { createdPayment, error, step, txHash, selectedTokenId } = state;
|
|
6159
6397
|
const tokenInfo = state.tokens.find((t) => t.id === selectedTokenId);
|
|
6160
6398
|
if (!createdPayment || !error) return;
|
|
@@ -6193,6 +6431,10 @@ Please contact support with this information.`
|
|
|
6193
6431
|
isBalanceLoading,
|
|
6194
6432
|
handleSelectToken,
|
|
6195
6433
|
handlePay,
|
|
6434
|
+
handleWalletBack,
|
|
6435
|
+
handleChooseCreateAccount,
|
|
6436
|
+
handleChooseExternalWallet,
|
|
6437
|
+
handleExternalWalletConnected,
|
|
6196
6438
|
handleDeposit,
|
|
6197
6439
|
handleDepositClose,
|
|
6198
6440
|
handleDone,
|
|
@@ -6309,10 +6551,10 @@ var TokenSelector = ({
|
|
|
6309
6551
|
onSelect,
|
|
6310
6552
|
disabled = false
|
|
6311
6553
|
}) => {
|
|
6312
|
-
const [isOpen, setIsOpen] =
|
|
6313
|
-
const dropdownRef =
|
|
6554
|
+
const [isOpen, setIsOpen] = React14.useState(false);
|
|
6555
|
+
const dropdownRef = React14.useRef(null);
|
|
6314
6556
|
const selectedToken = tokens.find((t) => t.id === selectedTokenId);
|
|
6315
|
-
|
|
6557
|
+
React14.useEffect(() => {
|
|
6316
6558
|
const handleClickOutside = (event) => {
|
|
6317
6559
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
6318
6560
|
setIsOpen(false);
|
|
@@ -6465,7 +6707,8 @@ var PaymentInfoView = ({
|
|
|
6465
6707
|
onPay,
|
|
6466
6708
|
onDeposit,
|
|
6467
6709
|
isPaying,
|
|
6468
|
-
isBalanceLoading
|
|
6710
|
+
isBalanceLoading,
|
|
6711
|
+
disableBalanceCheck = false
|
|
6469
6712
|
}) => {
|
|
6470
6713
|
const selectedToken = tokens.find((t) => t.id === selectedTokenId);
|
|
6471
6714
|
const tokenSymbol = selectedToken?.symbol ?? "";
|
|
@@ -6476,7 +6719,7 @@ var PaymentInfoView = ({
|
|
|
6476
6719
|
maximumFractionDigits: tokenDecimals > 6 ? 6 : tokenDecimals
|
|
6477
6720
|
});
|
|
6478
6721
|
const balanceNum = parseFloat(balance.replace(/,/g, "") || "0");
|
|
6479
|
-
const isInsufficient = !isBalanceLoading && selectedToken && balanceNum < amount;
|
|
6722
|
+
const isInsufficient = !disableBalanceCheck && !isBalanceLoading && selectedToken && balanceNum < amount;
|
|
6480
6723
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:space-y-6", children: [
|
|
6481
6724
|
itemName && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6482
6725
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6509,7 +6752,7 @@ var PaymentInfoView = ({
|
|
|
6509
6752
|
}
|
|
6510
6753
|
)
|
|
6511
6754
|
] }),
|
|
6512
|
-
selectedToken && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: isBalanceLoading || selectedToken.isBalanceLoading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:flex volr:justify-between volr:items-center volr:p-3 volr:bg-slate-50 volr:rounded-lg volr:animate-pulse", children: [
|
|
6755
|
+
selectedToken && !disableBalanceCheck && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: isBalanceLoading || selectedToken.isBalanceLoading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:flex volr:justify-between volr:items-center volr:p-3 volr:bg-slate-50 volr:rounded-lg volr:animate-pulse", children: [
|
|
6513
6756
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "volr:text-sm volr:text-slate-400", children: "Loading balance..." }),
|
|
6514
6757
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:h-4 volr:bg-slate-200 volr:rounded volr:w-20" })
|
|
6515
6758
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6526,7 +6769,7 @@ var PaymentInfoView = ({
|
|
|
6526
6769
|
Button,
|
|
6527
6770
|
{
|
|
6528
6771
|
onClick: onPay,
|
|
6529
|
-
disabled: isPaying || isBalanceLoading || !!isInsufficient || !selectedToken,
|
|
6772
|
+
disabled: isPaying || !disableBalanceCheck && (isBalanceLoading || !!isInsufficient) || !selectedToken,
|
|
6530
6773
|
className: "volr:w-full",
|
|
6531
6774
|
children: isPaying ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "volr:flex volr:items-center volr:justify-center volr:gap-2", children: [
|
|
6532
6775
|
/* @__PURE__ */ jsxRuntime.jsxs("svg", { className: "volr:animate-spin volr:h-4 volr:w-4", viewBox: "0 0 24 24", children: [
|
|
@@ -6555,7 +6798,7 @@ var PaymentInfoView = ({
|
|
|
6555
6798
|
] }) : isInsufficient ? "Insufficient Balance" : !selectedToken ? "Select a token" : `Pay ${formattedAmount} ${tokenSymbol}`
|
|
6556
6799
|
}
|
|
6557
6800
|
),
|
|
6558
|
-
isInsufficient && selectedToken && /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "secondary", onClick: onDeposit, className: "volr:w-full", children: [
|
|
6801
|
+
isInsufficient && selectedToken && !disableBalanceCheck && /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "secondary", onClick: onDeposit, className: "volr:w-full", children: [
|
|
6559
6802
|
"Deposit ",
|
|
6560
6803
|
tokenSymbol
|
|
6561
6804
|
] })
|
|
@@ -6630,14 +6873,7 @@ var PaymentProcessingView = ({
|
|
|
6630
6873
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-lg volr:font-semibold volr:text-slate-900 volr:mb-1", children: getStatusMessage() }),
|
|
6631
6874
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-sm volr:text-slate-500", children: t("payment.processing.doNotClose") })
|
|
6632
6875
|
] }),
|
|
6633
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6634
|
-
"div",
|
|
6635
|
-
{
|
|
6636
|
-
className: `volr:h-1.5 volr:rounded-full volr:transition-all volr:duration-300 ${stepIdx <= currentStep ? "volr:bg-slate-900 volr:w-8" : "volr:bg-slate-200 volr:w-6"}`,
|
|
6637
|
-
style: stepIdx === currentStep ? { animation: "volrProgressPulse 1.5s ease-in-out infinite" } : void 0
|
|
6638
|
-
},
|
|
6639
|
-
stepIdx
|
|
6640
|
-
)) }),
|
|
6876
|
+
/* @__PURE__ */ jsxRuntime.jsx(ProgressSteps, { totalSteps: 3, currentStep }),
|
|
6641
6877
|
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
6642
6878
|
@keyframes volrSpin {
|
|
6643
6879
|
from { transform: rotate(0deg); }
|
|
@@ -6647,10 +6883,6 @@ var PaymentProcessingView = ({
|
|
|
6647
6883
|
0%, 100% { transform: scale(1); opacity: 1; }
|
|
6648
6884
|
50% { transform: scale(0.95); opacity: 0.85; }
|
|
6649
6885
|
}
|
|
6650
|
-
@keyframes volrProgressPulse {
|
|
6651
|
-
0%, 100% { opacity: 1; }
|
|
6652
|
-
50% { opacity: 0.6; }
|
|
6653
|
-
}
|
|
6654
6886
|
` })
|
|
6655
6887
|
] });
|
|
6656
6888
|
};
|
|
@@ -6757,10 +6989,144 @@ var PaymentResultView = ({
|
|
|
6757
6989
|
isSuccess && /* @__PURE__ */ jsxRuntime.jsx(PoweredBy, {})
|
|
6758
6990
|
] });
|
|
6759
6991
|
};
|
|
6992
|
+
function PaymentWalletChoiceView({
|
|
6993
|
+
isExternalWalletEnabled,
|
|
6994
|
+
externalWalletDisabledReason,
|
|
6995
|
+
onChooseExternalWallet,
|
|
6996
|
+
onChooseCreateAccount
|
|
6997
|
+
}) {
|
|
6998
|
+
const { t } = useI18n();
|
|
6999
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:space-y-5", children: [
|
|
7000
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:space-y-2", children: [
|
|
7001
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-xl volr:font-semibold volr:text-slate-900", children: t("payment.walletChoice.title") }),
|
|
7002
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-sm volr:text-slate-600 volr:leading-relaxed", children: t("payment.walletChoice.description") })
|
|
7003
|
+
] }),
|
|
7004
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:flex volr:flex-col volr:gap-2", children: [
|
|
7005
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7006
|
+
Button,
|
|
7007
|
+
{
|
|
7008
|
+
className: "volr:w-full",
|
|
7009
|
+
variant: "secondary",
|
|
7010
|
+
onClick: onChooseExternalWallet,
|
|
7011
|
+
disabled: !isExternalWalletEnabled,
|
|
7012
|
+
children: t("payment.walletChoice.externalCta")
|
|
7013
|
+
}
|
|
7014
|
+
),
|
|
7015
|
+
!isExternalWalletEnabled && externalWalletDisabledReason && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-xs volr:text-slate-500 volr:leading-relaxed", children: externalWalletDisabledReason }),
|
|
7016
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { className: "volr:w-full", onClick: onChooseCreateAccount, children: t("payment.walletChoice.createAccountCta") })
|
|
7017
|
+
] })
|
|
7018
|
+
] });
|
|
7019
|
+
}
|
|
7020
|
+
var DefaultWalletIcon3 = () => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7021
|
+
"svg",
|
|
7022
|
+
{
|
|
7023
|
+
className: "volr:w-6 volr:h-6 volr:text-slate-600",
|
|
7024
|
+
viewBox: "0 0 24 24",
|
|
7025
|
+
fill: "none",
|
|
7026
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7027
|
+
children: [
|
|
7028
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7029
|
+
"rect",
|
|
7030
|
+
{
|
|
7031
|
+
x: "2",
|
|
7032
|
+
y: "6",
|
|
7033
|
+
width: "20",
|
|
7034
|
+
height: "14",
|
|
7035
|
+
rx: "2",
|
|
7036
|
+
stroke: "currentColor",
|
|
7037
|
+
strokeWidth: "1.5"
|
|
7038
|
+
}
|
|
7039
|
+
),
|
|
7040
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7041
|
+
"path",
|
|
7042
|
+
{
|
|
7043
|
+
d: "M17 12.5C17 13.3284 16.3284 14 15.5 14C14.6716 14 14 13.3284 14 12.5C14 11.6716 14.6716 11 15.5 11C16.3284 11 17 11.6716 17 12.5Z",
|
|
7044
|
+
fill: "currentColor"
|
|
7045
|
+
}
|
|
7046
|
+
),
|
|
7047
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7048
|
+
"path",
|
|
7049
|
+
{
|
|
7050
|
+
d: "M6 6V5C6 3.89543 6.89543 3 8 3H16C17.1046 3 18 3.89543 18 5V6",
|
|
7051
|
+
stroke: "currentColor",
|
|
7052
|
+
strokeWidth: "1.5"
|
|
7053
|
+
}
|
|
7054
|
+
)
|
|
7055
|
+
]
|
|
7056
|
+
}
|
|
7057
|
+
);
|
|
7058
|
+
function PaymentExternalWalletView({
|
|
7059
|
+
onConnected,
|
|
7060
|
+
onCancel
|
|
7061
|
+
}) {
|
|
7062
|
+
const { t } = useI18n();
|
|
7063
|
+
const { isDetecting, getWalletsForDisplay, hasWallet } = react.useEIP6963();
|
|
7064
|
+
const wallets = React14.useMemo(() => getWalletsForDisplay(), [getWalletsForDisplay]);
|
|
7065
|
+
const [isConnecting, setIsConnecting] = React14.useState(false);
|
|
7066
|
+
const [error, setError] = React14.useState(null);
|
|
7067
|
+
const connect = async (wallet) => {
|
|
7068
|
+
setIsConnecting(true);
|
|
7069
|
+
setError(null);
|
|
7070
|
+
try {
|
|
7071
|
+
const provider = wallet.provider;
|
|
7072
|
+
const accounts = await provider.request({ method: "eth_requestAccounts" });
|
|
7073
|
+
const address = accounts?.[0] || null;
|
|
7074
|
+
if (!address) {
|
|
7075
|
+
throw new Error("NO_ACCOUNTS");
|
|
7076
|
+
}
|
|
7077
|
+
await onConnected({ provider, address });
|
|
7078
|
+
} catch (err) {
|
|
7079
|
+
setError(
|
|
7080
|
+
err instanceof Error ? t("payment.walletChoice.externalConnectFailed") : t("payment.walletChoice.externalConnectFailed")
|
|
7081
|
+
);
|
|
7082
|
+
} finally {
|
|
7083
|
+
setIsConnecting(false);
|
|
7084
|
+
}
|
|
7085
|
+
};
|
|
7086
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:space-y-4", children: [
|
|
7087
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:space-y-1", children: [
|
|
7088
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-xl volr:font-semibold volr:text-slate-900", children: t("payment.walletChoice.externalTitle") }),
|
|
7089
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-sm volr:text-slate-600", children: t("payment.walletChoice.externalDescription") })
|
|
7090
|
+
] }),
|
|
7091
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:text-sm volr:text-red-600 volr:bg-red-50 volr:border volr:border-red-200 volr:rounded-lg volr:p-3", children: error }),
|
|
7092
|
+
isDetecting ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-sm volr:text-slate-500", children: t("common.loading") }) : !hasWallet || wallets.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:space-y-3", children: [
|
|
7093
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-sm volr:text-slate-600", children: t("payment.walletChoice.noWalletsDetected") }),
|
|
7094
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { className: "volr:w-full", variant: "secondary", onClick: onCancel, children: t("common.back") })
|
|
7095
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:space-y-2", children: [
|
|
7096
|
+
wallets.map((w) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7097
|
+
"button",
|
|
7098
|
+
{
|
|
7099
|
+
type: "button",
|
|
7100
|
+
className: "volr:w-full volr:flex volr:items-center volr:justify-between volr:gap-3 volr:px-4 volr:py-3 volr:rounded-xl volr:border volr:border-slate-200 volr:hover:bg-slate-50",
|
|
7101
|
+
disabled: isConnecting,
|
|
7102
|
+
onClick: () => connect(w),
|
|
7103
|
+
children: [
|
|
7104
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:flex volr:items-center volr:gap-3", children: [
|
|
7105
|
+
w.icon ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7106
|
+
"img",
|
|
7107
|
+
{
|
|
7108
|
+
src: w.icon,
|
|
7109
|
+
alt: w.name,
|
|
7110
|
+
className: "volr:w-6 volr:h-6 volr:rounded"
|
|
7111
|
+
}
|
|
7112
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(DefaultWalletIcon3, {}),
|
|
7113
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "volr:text-sm volr:font-medium volr:text-slate-900", children: w.name })
|
|
7114
|
+
] }),
|
|
7115
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "volr:text-xs volr:text-slate-500", children: isConnecting ? t("payment.walletChoice.connecting") : t("payment.walletChoice.connect") })
|
|
7116
|
+
]
|
|
7117
|
+
},
|
|
7118
|
+
w.id
|
|
7119
|
+
)),
|
|
7120
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { className: "volr:w-full", variant: "secondary", onClick: onCancel, children: t("common.back") })
|
|
7121
|
+
] })
|
|
7122
|
+
] });
|
|
7123
|
+
}
|
|
6760
7124
|
var PaymentModal = ({
|
|
6761
7125
|
open,
|
|
6762
7126
|
onOpenChange
|
|
6763
7127
|
}) => {
|
|
7128
|
+
const { t } = useI18n();
|
|
7129
|
+
const { user } = react.useVolrContext();
|
|
6764
7130
|
const { paymentOptions } = useVolrModal();
|
|
6765
7131
|
const {
|
|
6766
7132
|
state,
|
|
@@ -6769,6 +7135,10 @@ var PaymentModal = ({
|
|
|
6769
7135
|
isBalanceLoading,
|
|
6770
7136
|
handleSelectToken,
|
|
6771
7137
|
handlePay,
|
|
7138
|
+
handleWalletBack,
|
|
7139
|
+
handleChooseCreateAccount,
|
|
7140
|
+
handleChooseExternalWallet,
|
|
7141
|
+
handleExternalWalletConnected,
|
|
6772
7142
|
handleDeposit,
|
|
6773
7143
|
handleDepositClose,
|
|
6774
7144
|
handleDone,
|
|
@@ -6789,7 +7159,8 @@ var PaymentModal = ({
|
|
|
6789
7159
|
txHash,
|
|
6790
7160
|
error,
|
|
6791
7161
|
logoUrl,
|
|
6792
|
-
showDeposit
|
|
7162
|
+
showDeposit,
|
|
7163
|
+
walletStep
|
|
6793
7164
|
} = state;
|
|
6794
7165
|
if (showDeposit && selectedToken) {
|
|
6795
7166
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6820,6 +7191,8 @@ var PaymentModal = ({
|
|
|
6820
7191
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6821
7192
|
ModalHeader,
|
|
6822
7193
|
{
|
|
7194
|
+
back: step === "wallet" && walletStep !== "choice",
|
|
7195
|
+
onBack: step === "wallet" && walletStep !== "choice" ? handleWalletBack : void 0,
|
|
6823
7196
|
onClose: canClose ? handleClose : void 0,
|
|
6824
7197
|
title: step === "info" ? "Confirm Payment" : void 0
|
|
6825
7198
|
}
|
|
@@ -6838,9 +7211,39 @@ var PaymentModal = ({
|
|
|
6838
7211
|
onPay: handlePay,
|
|
6839
7212
|
onDeposit: handleDeposit,
|
|
6840
7213
|
isPaying,
|
|
6841
|
-
isBalanceLoading
|
|
7214
|
+
isBalanceLoading,
|
|
7215
|
+
disableBalanceCheck: !user?.evmAddress
|
|
6842
7216
|
}
|
|
6843
7217
|
),
|
|
7218
|
+
step === "wallet" && walletStep === "choice" && selectedToken && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7219
|
+
PaymentWalletChoiceView,
|
|
7220
|
+
{
|
|
7221
|
+
isExternalWalletEnabled: selectedToken.address !== "native",
|
|
7222
|
+
externalWalletDisabledReason: selectedToken.address === "native" ? t("payment.walletChoice.externalDisabledNative") : void 0,
|
|
7223
|
+
onChooseExternalWallet: handleChooseExternalWallet,
|
|
7224
|
+
onChooseCreateAccount: handleChooseCreateAccount
|
|
7225
|
+
}
|
|
7226
|
+
),
|
|
7227
|
+
step === "wallet" && walletStep === "external-wallet" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7228
|
+
PaymentExternalWalletView,
|
|
7229
|
+
{
|
|
7230
|
+
onConnected: handleExternalWalletConnected,
|
|
7231
|
+
onCancel: handleWalletBack
|
|
7232
|
+
}
|
|
7233
|
+
),
|
|
7234
|
+
step === "wallet" && walletStep === "create-account" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:pt-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7235
|
+
PasskeyEnrollView,
|
|
7236
|
+
{
|
|
7237
|
+
wrapInModal: false,
|
|
7238
|
+
onComplete: () => {
|
|
7239
|
+
Promise.resolve(handlePay()).catch(() => {
|
|
7240
|
+
});
|
|
7241
|
+
},
|
|
7242
|
+
onError: () => {
|
|
7243
|
+
},
|
|
7244
|
+
onClose: handleWalletBack
|
|
7245
|
+
}
|
|
7246
|
+
) }),
|
|
6844
7247
|
step === "processing" && /* @__PURE__ */ jsxRuntime.jsx(PaymentProcessingView, { step: processingStep, txHash }),
|
|
6845
7248
|
step === "result" && createdPayment && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6846
7249
|
PaymentResultView,
|
|
@@ -6854,19 +7257,19 @@ var PaymentModal = ({
|
|
|
6854
7257
|
)
|
|
6855
7258
|
] });
|
|
6856
7259
|
};
|
|
6857
|
-
var SignRequestContext =
|
|
7260
|
+
var SignRequestContext = React14.createContext(null);
|
|
6858
7261
|
function SignRequestProvider({ children }) {
|
|
6859
|
-
const [pendingRequest, setPendingRequest] =
|
|
6860
|
-
const resolveRef =
|
|
6861
|
-
const rejectRef =
|
|
6862
|
-
const requestSign =
|
|
7262
|
+
const [pendingRequest, setPendingRequest] = React14.useState(null);
|
|
7263
|
+
const resolveRef = React14.useRef(null);
|
|
7264
|
+
const rejectRef = React14.useRef(null);
|
|
7265
|
+
const requestSign = React14.useCallback((request) => {
|
|
6863
7266
|
return new Promise((resolve, reject2) => {
|
|
6864
7267
|
setPendingRequest(request);
|
|
6865
7268
|
resolveRef.current = resolve;
|
|
6866
7269
|
rejectRef.current = reject2;
|
|
6867
7270
|
});
|
|
6868
7271
|
}, []);
|
|
6869
|
-
const approve =
|
|
7272
|
+
const approve = React14.useCallback(() => {
|
|
6870
7273
|
if (resolveRef.current) {
|
|
6871
7274
|
resolveRef.current();
|
|
6872
7275
|
resolveRef.current = null;
|
|
@@ -6874,7 +7277,7 @@ function SignRequestProvider({ children }) {
|
|
|
6874
7277
|
}
|
|
6875
7278
|
setPendingRequest(null);
|
|
6876
7279
|
}, []);
|
|
6877
|
-
const reject =
|
|
7280
|
+
const reject = React14.useCallback(() => {
|
|
6878
7281
|
if (rejectRef.current) {
|
|
6879
7282
|
rejectRef.current(new Error("Sign request cancelled by user"));
|
|
6880
7283
|
resolveRef.current = null;
|
|
@@ -6896,7 +7299,7 @@ function SignRequestProvider({ children }) {
|
|
|
6896
7299
|
);
|
|
6897
7300
|
}
|
|
6898
7301
|
function useSignRequest() {
|
|
6899
|
-
const context =
|
|
7302
|
+
const context = React14.useContext(SignRequestContext);
|
|
6900
7303
|
if (!context) {
|
|
6901
7304
|
throw new Error("useSignRequest must be used within SignRequestProvider");
|
|
6902
7305
|
}
|
|
@@ -6905,7 +7308,7 @@ function useSignRequest() {
|
|
|
6905
7308
|
};
|
|
6906
7309
|
}
|
|
6907
7310
|
function useSignRequestInternal() {
|
|
6908
|
-
const context =
|
|
7311
|
+
const context = React14.useContext(SignRequestContext);
|
|
6909
7312
|
if (!context) {
|
|
6910
7313
|
throw new Error("useSignRequestInternal must be used within SignRequestProvider");
|
|
6911
7314
|
}
|
|
@@ -6940,7 +7343,7 @@ function MessageSignView({ message }) {
|
|
|
6940
7343
|
] });
|
|
6941
7344
|
}
|
|
6942
7345
|
function TypedDataSignView({ typedData }) {
|
|
6943
|
-
const [showRawData, setShowRawData] =
|
|
7346
|
+
const [showRawData, setShowRawData] = React14.useState(false);
|
|
6944
7347
|
const { domain, message } = typedData;
|
|
6945
7348
|
const appName = domain.name;
|
|
6946
7349
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:space-y-4", children: [
|
|
@@ -7086,7 +7489,143 @@ function SignRequestModal({ open, onOpenChange }) {
|
|
|
7086
7489
|
}
|
|
7087
7490
|
);
|
|
7088
7491
|
}
|
|
7089
|
-
var
|
|
7492
|
+
var WalletRequiredContext = React14.createContext(null);
|
|
7493
|
+
function WalletRequiredProvider({ children }) {
|
|
7494
|
+
const [pendingRequest, setPendingRequest] = React14.useState(null);
|
|
7495
|
+
const resolveRef = React14.useRef(null);
|
|
7496
|
+
const rejectRef = React14.useRef(null);
|
|
7497
|
+
const requestWallet = React14.useCallback(
|
|
7498
|
+
(request) => {
|
|
7499
|
+
return new Promise((resolve2, reject2) => {
|
|
7500
|
+
setPendingRequest(request);
|
|
7501
|
+
resolveRef.current = resolve2;
|
|
7502
|
+
rejectRef.current = reject2;
|
|
7503
|
+
});
|
|
7504
|
+
},
|
|
7505
|
+
[]
|
|
7506
|
+
);
|
|
7507
|
+
const resolve = React14.useCallback((provider) => {
|
|
7508
|
+
if (resolveRef.current) {
|
|
7509
|
+
resolveRef.current(provider);
|
|
7510
|
+
resolveRef.current = null;
|
|
7511
|
+
rejectRef.current = null;
|
|
7512
|
+
}
|
|
7513
|
+
setPendingRequest(null);
|
|
7514
|
+
}, []);
|
|
7515
|
+
const reject = React14.useCallback((error) => {
|
|
7516
|
+
if (rejectRef.current) {
|
|
7517
|
+
rejectRef.current(error);
|
|
7518
|
+
resolveRef.current = null;
|
|
7519
|
+
rejectRef.current = null;
|
|
7520
|
+
}
|
|
7521
|
+
setPendingRequest(null);
|
|
7522
|
+
}, []);
|
|
7523
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7524
|
+
WalletRequiredContext.Provider,
|
|
7525
|
+
{
|
|
7526
|
+
value: { requestWallet, pendingRequest, resolve, reject },
|
|
7527
|
+
children
|
|
7528
|
+
}
|
|
7529
|
+
);
|
|
7530
|
+
}
|
|
7531
|
+
function useWalletRequired() {
|
|
7532
|
+
const ctx = React14.useContext(WalletRequiredContext);
|
|
7533
|
+
if (!ctx) {
|
|
7534
|
+
throw new Error("useWalletRequired must be used within WalletRequiredProvider");
|
|
7535
|
+
}
|
|
7536
|
+
return { requestWallet: ctx.requestWallet };
|
|
7537
|
+
}
|
|
7538
|
+
function useWalletRequiredInternal() {
|
|
7539
|
+
const ctx = React14.useContext(WalletRequiredContext);
|
|
7540
|
+
if (!ctx) {
|
|
7541
|
+
throw new Error(
|
|
7542
|
+
"useWalletRequiredInternal must be used within WalletRequiredProvider"
|
|
7543
|
+
);
|
|
7544
|
+
}
|
|
7545
|
+
return ctx;
|
|
7546
|
+
}
|
|
7547
|
+
function WalletRequiredModal() {
|
|
7548
|
+
const { t } = useI18n();
|
|
7549
|
+
const { pendingRequest, resolve, reject } = useWalletRequiredInternal();
|
|
7550
|
+
const { user, provider } = react.useVolrContext();
|
|
7551
|
+
const { keyStorageType } = useVolrUI();
|
|
7552
|
+
const [step, setStep] = React14.useState("notice");
|
|
7553
|
+
const providerRef = React14.useRef(provider);
|
|
7554
|
+
React14.useEffect(() => {
|
|
7555
|
+
providerRef.current = provider;
|
|
7556
|
+
}, [provider]);
|
|
7557
|
+
React14.useEffect(() => {
|
|
7558
|
+
if (pendingRequest) {
|
|
7559
|
+
setStep("notice");
|
|
7560
|
+
}
|
|
7561
|
+
}, [pendingRequest]);
|
|
7562
|
+
const title = React14.useMemo(() => {
|
|
7563
|
+
if (!pendingRequest) return "";
|
|
7564
|
+
if (pendingRequest.type === "transaction") return t("walletRequired.titleTx");
|
|
7565
|
+
if (pendingRequest.type === "typedData") return t("walletRequired.titleTypedData");
|
|
7566
|
+
return t("walletRequired.titleMessage");
|
|
7567
|
+
}, [pendingRequest, t]);
|
|
7568
|
+
const handleCancel = () => {
|
|
7569
|
+
resolve(null);
|
|
7570
|
+
};
|
|
7571
|
+
const handleContinue = () => {
|
|
7572
|
+
if (!user?.id) {
|
|
7573
|
+
reject(new Error("AUTH_REQUIRED"));
|
|
7574
|
+
return;
|
|
7575
|
+
}
|
|
7576
|
+
setStep("enroll");
|
|
7577
|
+
};
|
|
7578
|
+
const handleEnrollComplete = async () => {
|
|
7579
|
+
const p = providerRef.current;
|
|
7580
|
+
if (!p) {
|
|
7581
|
+
reject(new Error("PROVIDER_NOT_AVAILABLE"));
|
|
7582
|
+
return;
|
|
7583
|
+
}
|
|
7584
|
+
resolve(p);
|
|
7585
|
+
};
|
|
7586
|
+
const handleEnrollError = (error) => {
|
|
7587
|
+
console.error("[WalletRequiredModal] Enrollment error:", error);
|
|
7588
|
+
};
|
|
7589
|
+
const open = Boolean(pendingRequest);
|
|
7590
|
+
if (!open) return null;
|
|
7591
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7592
|
+
Modal,
|
|
7593
|
+
{
|
|
7594
|
+
open,
|
|
7595
|
+
onOpenChange: (next) => !next && handleCancel(),
|
|
7596
|
+
onPointerDownOutside: (e) => e.preventDefault(),
|
|
7597
|
+
ariaLabel: t("walletRequired.ariaLabel"),
|
|
7598
|
+
children: [
|
|
7599
|
+
/* @__PURE__ */ jsxRuntime.jsx(ModalHeader, { onClose: handleCancel, children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-base volr:font-semibold volr:text-slate-900", children: title }) }),
|
|
7600
|
+
step === "notice" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:space-y-4", children: [
|
|
7601
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "volr:text-sm volr:text-slate-600 volr:leading-relaxed", children: t("walletRequired.description") }),
|
|
7602
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "volr:flex volr:flex-col volr:gap-2", children: [
|
|
7603
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { className: "volr:w-full", onClick: handleContinue, children: t("walletRequired.cta") }),
|
|
7604
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7605
|
+
Button,
|
|
7606
|
+
{
|
|
7607
|
+
className: "volr:w-full",
|
|
7608
|
+
variant: "secondary",
|
|
7609
|
+
onClick: handleCancel,
|
|
7610
|
+
children: t("walletRequired.notNow")
|
|
7611
|
+
}
|
|
7612
|
+
)
|
|
7613
|
+
] })
|
|
7614
|
+
] }),
|
|
7615
|
+
step === "enroll" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:pt-1", children: keyStorageType === "mpc" ? /* @__PURE__ */ jsxRuntime.jsx(MpcConnectView, { onComplete: handleEnrollComplete, onError: handleEnrollError }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
7616
|
+
PasskeyEnrollView,
|
|
7617
|
+
{
|
|
7618
|
+
wrapInModal: false,
|
|
7619
|
+
onComplete: handleEnrollComplete,
|
|
7620
|
+
onError: handleEnrollError,
|
|
7621
|
+
onClose: () => resolve(null)
|
|
7622
|
+
}
|
|
7623
|
+
) })
|
|
7624
|
+
]
|
|
7625
|
+
}
|
|
7626
|
+
);
|
|
7627
|
+
}
|
|
7628
|
+
var VolrUIContext = React14__default.default.createContext(null);
|
|
7090
7629
|
function getCurrentRpId() {
|
|
7091
7630
|
if (typeof window === "undefined") return "localhost";
|
|
7092
7631
|
return window.location.hostname;
|
|
@@ -7099,39 +7638,30 @@ function isPasskeyDomainMismatch(user) {
|
|
|
7099
7638
|
return !registered.some((p) => p?.rpId === currentRpId);
|
|
7100
7639
|
}
|
|
7101
7640
|
var useVolrUI = () => {
|
|
7102
|
-
const context =
|
|
7641
|
+
const context = React14.useContext(VolrUIContext);
|
|
7103
7642
|
if (!context) {
|
|
7104
7643
|
throw new Error("useVolrUI must be used within VolrUIProvider");
|
|
7105
7644
|
}
|
|
7106
7645
|
return context;
|
|
7107
7646
|
};
|
|
7108
7647
|
var useVolrUIOptional = () => {
|
|
7109
|
-
return
|
|
7648
|
+
return React14.useContext(VolrUIContext);
|
|
7110
7649
|
};
|
|
7111
7650
|
function OnboardingFlow({
|
|
7112
7651
|
keyStorageType,
|
|
7113
7652
|
onComplete
|
|
7114
7653
|
}) {
|
|
7115
|
-
const { logout } = react.useVolrContext();
|
|
7116
7654
|
const handleEnrollComplete = () => {
|
|
7117
7655
|
onComplete();
|
|
7118
7656
|
};
|
|
7119
7657
|
const handleEnrollError = (_err) => {
|
|
7120
7658
|
};
|
|
7121
|
-
const handleLogout = async () => {
|
|
7122
|
-
try {
|
|
7123
|
-
await logout();
|
|
7124
|
-
onComplete();
|
|
7125
|
-
} catch (error) {
|
|
7126
|
-
}
|
|
7127
|
-
};
|
|
7128
7659
|
if (keyStorageType === "passkey") {
|
|
7129
7660
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7130
7661
|
PasskeyEnrollView,
|
|
7131
7662
|
{
|
|
7132
7663
|
onComplete: handleEnrollComplete,
|
|
7133
|
-
onError: handleEnrollError
|
|
7134
|
-
onLogout: handleLogout
|
|
7664
|
+
onError: handleEnrollError
|
|
7135
7665
|
}
|
|
7136
7666
|
);
|
|
7137
7667
|
}
|
|
@@ -7162,10 +7692,10 @@ var VolrUIProvider = ({
|
|
|
7162
7692
|
const providerPolicy = config.providerPolicy ?? {
|
|
7163
7693
|
enforceOnFirstLogin: true
|
|
7164
7694
|
};
|
|
7165
|
-
const [keyStorageTypeError, setKeyStorageTypeError] =
|
|
7695
|
+
const [keyStorageTypeError, setKeyStorageTypeError] = React14.useState(
|
|
7166
7696
|
null
|
|
7167
7697
|
);
|
|
7168
|
-
|
|
7698
|
+
React14.useEffect(() => {
|
|
7169
7699
|
if (providerPolicy.enforceOnFirstLogin !== false && !keyStorageType) {
|
|
7170
7700
|
const errorMessage = "keyStorageType must be specified in VolrUIProvider props. Please set keyStorageType prop in VolrUIProvider.";
|
|
7171
7701
|
console.error(errorMessage);
|
|
@@ -7181,7 +7711,7 @@ var VolrUIProvider = ({
|
|
|
7181
7711
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:text-sm volr:mb-6 volr:leading-relaxed volr-text-secondary", children: keyStorageTypeError })
|
|
7182
7712
|
] }) });
|
|
7183
7713
|
}
|
|
7184
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SignRequestProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7714
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SignRequestProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(WalletRequiredProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7185
7715
|
VolrUIProviderInner,
|
|
7186
7716
|
{
|
|
7187
7717
|
config,
|
|
@@ -7195,7 +7725,7 @@ var VolrUIProvider = ({
|
|
|
7195
7725
|
providerPolicy,
|
|
7196
7726
|
children
|
|
7197
7727
|
}
|
|
7198
|
-
) });
|
|
7728
|
+
) }) });
|
|
7199
7729
|
};
|
|
7200
7730
|
function VolrUIProviderInner({
|
|
7201
7731
|
config,
|
|
@@ -7209,11 +7739,20 @@ function VolrUIProviderInner({
|
|
|
7209
7739
|
providerPolicy,
|
|
7210
7740
|
children
|
|
7211
7741
|
}) {
|
|
7212
|
-
const [showOnboarding, setShowOnboarding] =
|
|
7742
|
+
const [showOnboarding, setShowOnboarding] = React14.useState(false);
|
|
7213
7743
|
const { requestSign } = useSignRequest();
|
|
7744
|
+
const { requestWallet } = useWalletRequired();
|
|
7214
7745
|
const configWithSignRequest = {
|
|
7215
7746
|
...config,
|
|
7216
|
-
onSignRequest: requestSign
|
|
7747
|
+
onSignRequest: requestSign,
|
|
7748
|
+
onWalletRequired: async (request) => {
|
|
7749
|
+
try {
|
|
7750
|
+
const p = await requestWallet(request);
|
|
7751
|
+
return p ?? null;
|
|
7752
|
+
} catch {
|
|
7753
|
+
return null;
|
|
7754
|
+
}
|
|
7755
|
+
}
|
|
7217
7756
|
};
|
|
7218
7757
|
return /* @__PURE__ */ jsxRuntime.jsx(react.VolrProvider, { config: configWithSignRequest, children: /* @__PURE__ */ jsxRuntime.jsx(I18nProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7219
7758
|
VolrUIContext.Provider,
|
|
@@ -7228,6 +7767,7 @@ function VolrUIProviderInner({
|
|
|
7228
7767
|
keyStorageType
|
|
7229
7768
|
},
|
|
7230
7769
|
children: /* @__PURE__ */ jsxRuntime.jsxs(VolrModalProvider, { children: [
|
|
7770
|
+
/* @__PURE__ */ jsxRuntime.jsx(WalletRequiredModal, {}),
|
|
7231
7771
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7232
7772
|
MigrationCoordinator,
|
|
7233
7773
|
{
|
|
@@ -7238,6 +7778,7 @@ function VolrUIProviderInner({
|
|
|
7238
7778
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7239
7779
|
OAuthCallbackHandler,
|
|
7240
7780
|
{
|
|
7781
|
+
enforceSelection: providerPolicy.enforceOnFirstLogin ?? true,
|
|
7241
7782
|
onShowOnboarding: () => setShowOnboarding(true)
|
|
7242
7783
|
}
|
|
7243
7784
|
),
|
|
@@ -7291,15 +7832,15 @@ function MigrationCoordinator({
|
|
|
7291
7832
|
}) {
|
|
7292
7833
|
const { user, setUser } = react.useVolrContext();
|
|
7293
7834
|
const { client } = react.useInternalAuth();
|
|
7294
|
-
const [running, setRunning] =
|
|
7295
|
-
const [isSourcePopup, setIsSourcePopup] =
|
|
7296
|
-
const [isTargetPopup, setIsTargetPopup] =
|
|
7297
|
-
const [sourceStep, setSourceStep] =
|
|
7298
|
-
const [targetStep, setTargetStep] =
|
|
7299
|
-
const [targetDomain, setTargetDomain] =
|
|
7300
|
-
const [sourceDomain, setSourceDomain] =
|
|
7301
|
-
const [errorMessage, setErrorMessage] =
|
|
7302
|
-
|
|
7835
|
+
const [running, setRunning] = React14.useState(false);
|
|
7836
|
+
const [isSourcePopup, setIsSourcePopup] = React14.useState(false);
|
|
7837
|
+
const [isTargetPopup, setIsTargetPopup] = React14.useState(false);
|
|
7838
|
+
const [sourceStep, setSourceStep] = React14.useState("ready");
|
|
7839
|
+
const [targetStep, setTargetStep] = React14.useState("ready");
|
|
7840
|
+
const [targetDomain, setTargetDomain] = React14.useState("");
|
|
7841
|
+
const [sourceDomain, setSourceDomain] = React14.useState("");
|
|
7842
|
+
const [errorMessage, setErrorMessage] = React14.useState();
|
|
7843
|
+
React14.useEffect(() => {
|
|
7303
7844
|
if (typeof window === "undefined") return;
|
|
7304
7845
|
const params = new URLSearchParams(window.location.search);
|
|
7305
7846
|
const migrationToken = params.get("migration_token");
|
|
@@ -7323,7 +7864,7 @@ function MigrationCoordinator({
|
|
|
7323
7864
|
}
|
|
7324
7865
|
}
|
|
7325
7866
|
}, []);
|
|
7326
|
-
|
|
7867
|
+
React14.useEffect(() => {
|
|
7327
7868
|
if (typeof window === "undefined") return;
|
|
7328
7869
|
const handler = (event) => {
|
|
7329
7870
|
const data = event.data;
|
|
@@ -7335,7 +7876,7 @@ function MigrationCoordinator({
|
|
|
7335
7876
|
window.addEventListener("message", handler);
|
|
7336
7877
|
return () => window.removeEventListener("message", handler);
|
|
7337
7878
|
}, [client, setUser, onHideOnboarding]);
|
|
7338
|
-
|
|
7879
|
+
React14.useEffect(() => {
|
|
7339
7880
|
if (typeof window === "undefined") return;
|
|
7340
7881
|
if (running) return;
|
|
7341
7882
|
const params = new URLSearchParams(window.location.search);
|
|
@@ -7480,9 +8021,9 @@ function MigrationCoordinator({
|
|
|
7480
8021
|
}
|
|
7481
8022
|
function AccountModalPortal() {
|
|
7482
8023
|
const { isOpen, mode, close } = useVolrModal();
|
|
7483
|
-
const [portalRoot, setPortalRoot] =
|
|
7484
|
-
const [error, setError] =
|
|
7485
|
-
|
|
8024
|
+
const [portalRoot, setPortalRoot] = React14.useState(null);
|
|
8025
|
+
const [error, setError] = React14.useState(null);
|
|
8026
|
+
React14.useEffect(() => {
|
|
7486
8027
|
if (typeof window === "undefined") return;
|
|
7487
8028
|
let root = document.getElementById("volr-modal-root");
|
|
7488
8029
|
if (!root) {
|
|
@@ -7541,9 +8082,9 @@ function AccountModalPortal() {
|
|
|
7541
8082
|
function DepositModalPortal() {
|
|
7542
8083
|
const { isOpen, mode, asset, close } = useVolrModal();
|
|
7543
8084
|
const { user } = react.useVolrContext();
|
|
7544
|
-
const [portalRoot, setPortalRoot] =
|
|
7545
|
-
const [showLogin, setShowLogin] =
|
|
7546
|
-
|
|
8085
|
+
const [portalRoot, setPortalRoot] = React14.useState(null);
|
|
8086
|
+
const [showLogin, setShowLogin] = React14.useState(false);
|
|
8087
|
+
React14.useEffect(() => {
|
|
7547
8088
|
if (typeof window === "undefined") return;
|
|
7548
8089
|
let root = document.getElementById("volr-modal-root");
|
|
7549
8090
|
if (!root) {
|
|
@@ -7558,7 +8099,7 @@ function DepositModalPortal() {
|
|
|
7558
8099
|
}
|
|
7559
8100
|
};
|
|
7560
8101
|
}, []);
|
|
7561
|
-
|
|
8102
|
+
React14.useEffect(() => {
|
|
7562
8103
|
if (isOpen && mode === "deposit" && !user) {
|
|
7563
8104
|
setShowLogin(true);
|
|
7564
8105
|
} else {
|
|
@@ -7592,8 +8133,8 @@ function DepositModalPortal() {
|
|
|
7592
8133
|
}
|
|
7593
8134
|
function PaymentModalPortal() {
|
|
7594
8135
|
const { isOpen, mode, close } = useVolrModal();
|
|
7595
|
-
const [portalRoot, setPortalRoot] =
|
|
7596
|
-
|
|
8136
|
+
const [portalRoot, setPortalRoot] = React14.useState(null);
|
|
8137
|
+
React14.useEffect(() => {
|
|
7597
8138
|
if (typeof window === "undefined") return;
|
|
7598
8139
|
let root = document.getElementById("volr-modal-root");
|
|
7599
8140
|
if (!root) {
|
|
@@ -7622,8 +8163,8 @@ function PaymentModalPortal() {
|
|
|
7622
8163
|
}
|
|
7623
8164
|
function SignRequestModalPortal() {
|
|
7624
8165
|
const { pendingRequest } = useSignRequestInternal();
|
|
7625
|
-
const [portalRoot, setPortalRoot] =
|
|
7626
|
-
|
|
8166
|
+
const [portalRoot, setPortalRoot] = React14.useState(null);
|
|
8167
|
+
React14.useEffect(() => {
|
|
7627
8168
|
if (typeof window === "undefined") return;
|
|
7628
8169
|
let root = document.getElementById("volr-modal-root");
|
|
7629
8170
|
if (!root) {
|
|
@@ -7652,10 +8193,11 @@ function SignRequestModalPortal() {
|
|
|
7652
8193
|
);
|
|
7653
8194
|
}
|
|
7654
8195
|
function OAuthCallbackHandler({
|
|
8196
|
+
enforceSelection,
|
|
7655
8197
|
onShowOnboarding
|
|
7656
8198
|
}) {
|
|
7657
|
-
const [hasCode, setHasCode] =
|
|
7658
|
-
|
|
8199
|
+
const [hasCode, setHasCode] = React14.useState(false);
|
|
8200
|
+
React14.useEffect(() => {
|
|
7659
8201
|
if (typeof window === "undefined") return;
|
|
7660
8202
|
const params = new URLSearchParams(window.location.search);
|
|
7661
8203
|
const code = params.get("code");
|
|
@@ -7670,12 +8212,13 @@ function OAuthCallbackHandler({
|
|
|
7670
8212
|
const passkeys = resultUser.registeredPasskeys ?? [];
|
|
7671
8213
|
const hasCurrent = passkeys.some((p) => p.rpId === currentRpId);
|
|
7672
8214
|
const needsMigration = passkeys.length > 0 && !hasCurrent;
|
|
7673
|
-
if (
|
|
8215
|
+
if (resultUser.keyStorageType === "passkey" && needsMigration) {
|
|
7674
8216
|
onShowOnboarding();
|
|
7675
8217
|
return;
|
|
7676
8218
|
}
|
|
7677
|
-
if (resultUser.keyStorageType
|
|
8219
|
+
if (!resultUser.keyStorageType && enforceSelection) {
|
|
7678
8220
|
onShowOnboarding();
|
|
8221
|
+
return;
|
|
7679
8222
|
}
|
|
7680
8223
|
},
|
|
7681
8224
|
onError: (err) => {
|
|
@@ -7703,14 +8246,14 @@ function OnboardingChecker({
|
|
|
7703
8246
|
}) {
|
|
7704
8247
|
const { user, provider, isLoading } = react.useVolrContext();
|
|
7705
8248
|
const { isOpen: isModalOpen } = useVolrModal();
|
|
7706
|
-
const modalWasOpened =
|
|
7707
|
-
const pendingMismatchOnboarding =
|
|
7708
|
-
|
|
8249
|
+
const modalWasOpened = React14__default.default.useRef(false);
|
|
8250
|
+
const pendingMismatchOnboarding = React14__default.default.useRef(false);
|
|
8251
|
+
React14.useEffect(() => {
|
|
7709
8252
|
if (isModalOpen) {
|
|
7710
8253
|
modalWasOpened.current = true;
|
|
7711
8254
|
}
|
|
7712
8255
|
}, [isModalOpen]);
|
|
7713
|
-
|
|
8256
|
+
React14.useEffect(() => {
|
|
7714
8257
|
if (isLoading) {
|
|
7715
8258
|
return;
|
|
7716
8259
|
}
|
|
@@ -7745,15 +8288,11 @@ function OnboardingChecker({
|
|
|
7745
8288
|
onShowOnboarding();
|
|
7746
8289
|
return;
|
|
7747
8290
|
}
|
|
7748
|
-
if (
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
"keyStorageType must be specified in VolrUIProvider props."
|
|
7752
|
-
);
|
|
7753
|
-
return;
|
|
7754
|
-
}
|
|
7755
|
-
onShowOnboarding();
|
|
8291
|
+
if (!enforceSelection) {
|
|
8292
|
+
onHideOnboarding();
|
|
8293
|
+
return;
|
|
7756
8294
|
}
|
|
8295
|
+
onHideOnboarding();
|
|
7757
8296
|
}, [
|
|
7758
8297
|
user,
|
|
7759
8298
|
provider,
|
|
@@ -7768,7 +8307,7 @@ function OnboardingChecker({
|
|
|
7768
8307
|
}
|
|
7769
8308
|
function useSwitchNetwork() {
|
|
7770
8309
|
const { client } = react.useInternalAuth();
|
|
7771
|
-
return
|
|
8310
|
+
return React14.useCallback(
|
|
7772
8311
|
async (chainId) => {
|
|
7773
8312
|
if (typeof window === "undefined" || !window.ethereum) {
|
|
7774
8313
|
throw new Error("No wallet found");
|
|
@@ -7832,8 +8371,8 @@ var paymentPromiseResolver = null;
|
|
|
7832
8371
|
function useVolrPay() {
|
|
7833
8372
|
const { open: openModal, close: closeModal } = useVolrModal();
|
|
7834
8373
|
const { checkPayment, getPaymentHistory } = react.useVolrPaymentApi();
|
|
7835
|
-
const isInProgressRef =
|
|
7836
|
-
const pay =
|
|
8374
|
+
const isInProgressRef = React14.useRef(false);
|
|
8375
|
+
const pay = React14.useCallback(
|
|
7837
8376
|
(options) => {
|
|
7838
8377
|
isInProgressRef.current = true;
|
|
7839
8378
|
const waitPromise = new Promise((resolve, reject) => {
|