@unifold/connect-react 0.1.9 → 0.1.11
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1190 -1094
- package/dist/index.mjs +1147 -1051
- package/dist/styles.css +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1159,7 +1159,7 @@ __export(index_exports, {
|
|
|
1159
1159
|
module.exports = __toCommonJS(index_exports);
|
|
1160
1160
|
|
|
1161
1161
|
// src/provider.tsx
|
|
1162
|
-
var
|
|
1162
|
+
var import_react15 = __toESM(require("react"));
|
|
1163
1163
|
|
|
1164
1164
|
// ../react-provider/dist/index.mjs
|
|
1165
1165
|
var import_react = require("react");
|
|
@@ -1269,25 +1269,12 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
|
1269
1269
|
return Component;
|
|
1270
1270
|
};
|
|
1271
1271
|
|
|
1272
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/arrow-down-circle.js
|
|
1273
|
-
var ArrowDownCircle = createLucideIcon("ArrowDownCircle", [
|
|
1274
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
1275
|
-
["path", { d: "M12 8v8", key: "napkw2" }],
|
|
1276
|
-
["path", { d: "m8 12 4 4 4-4", key: "k98ssh" }]
|
|
1277
|
-
]);
|
|
1278
|
-
|
|
1279
1272
|
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/arrow-left.js
|
|
1280
1273
|
var ArrowLeft = createLucideIcon("ArrowLeft", [
|
|
1281
1274
|
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
1282
1275
|
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
1283
1276
|
]);
|
|
1284
1277
|
|
|
1285
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/check-circle.js
|
|
1286
|
-
var CheckCircle = createLucideIcon("CheckCircle", [
|
|
1287
|
-
["path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14", key: "g774vq" }],
|
|
1288
|
-
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
1289
|
-
]);
|
|
1290
|
-
|
|
1291
1278
|
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/check.js
|
|
1292
1279
|
var Check = createLucideIcon("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
|
|
1293
1280
|
|
|
@@ -1310,12 +1297,6 @@ var Clock = createLucideIcon("Clock", [
|
|
|
1310
1297
|
["polyline", { points: "12 6 12 12 16 14", key: "68esgv" }]
|
|
1311
1298
|
]);
|
|
1312
1299
|
|
|
1313
|
-
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/copy.js
|
|
1314
|
-
var Copy = createLucideIcon("Copy", [
|
|
1315
|
-
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
1316
|
-
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
1317
|
-
]);
|
|
1318
|
-
|
|
1319
1300
|
// ../../node_modules/.pnpm/lucide-react@0.294.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/credit-card.js
|
|
1320
1301
|
var CreditCard = createLucideIcon("CreditCard", [
|
|
1321
1302
|
["rect", { width: "20", height: "14", x: "2", y: "5", rx: "2", key: "ynyp8z" }],
|
|
@@ -5967,9 +5948,227 @@ var import_qr_code_styling = __toESM(require_qr_code_styling(), 1);
|
|
|
5967
5948
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
5968
5949
|
var import_react10 = require("react");
|
|
5969
5950
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
5951
|
+
|
|
5952
|
+
// ../core/dist/index.mjs
|
|
5953
|
+
var import_react_query2 = require("@tanstack/react-query");
|
|
5954
|
+
var API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.unifold.io";
|
|
5955
|
+
var DEFAULT_PUBLISHABLE_KEY = "pk_test_123";
|
|
5956
|
+
var DEFAULT_CONFIG = {};
|
|
5957
|
+
function validatePublishableKey(key) {
|
|
5958
|
+
if (!key || key.trim() === "") {
|
|
5959
|
+
throw new Error(
|
|
5960
|
+
"Unifold SDK: No publishable key configured. Please provide a valid publishable key via setApiConfig() or pass it directly to the API function."
|
|
5961
|
+
);
|
|
5962
|
+
}
|
|
5963
|
+
if (key === "pk_test_123") {
|
|
5964
|
+
console.warn(
|
|
5965
|
+
'Unifold SDK: Using default test key "pk_test_123". This should only be used for local development. Please use a real publishable key in production.'
|
|
5966
|
+
);
|
|
5967
|
+
}
|
|
5968
|
+
}
|
|
5969
|
+
function getIconUrl(iconPath) {
|
|
5970
|
+
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
5971
|
+
return `${API_BASE_URL}/api/public${normalizedPath}`;
|
|
5972
|
+
}
|
|
5973
|
+
function getIconUrlWithCdn(iconPath, assetCdnUrl) {
|
|
5974
|
+
if (!assetCdnUrl) {
|
|
5975
|
+
return getIconUrl(iconPath);
|
|
5976
|
+
}
|
|
5977
|
+
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
5978
|
+
const baseUrl = assetCdnUrl.endsWith("/") ? assetCdnUrl.slice(0, -1) : assetCdnUrl;
|
|
5979
|
+
return `${baseUrl}/api/public${normalizedPath}`;
|
|
5980
|
+
}
|
|
5981
|
+
async function createDepositAddress(overrides, publishableKey) {
|
|
5982
|
+
if (!overrides?.external_user_id) {
|
|
5983
|
+
throw new Error("external_user_id is required");
|
|
5984
|
+
}
|
|
5985
|
+
const payload = {
|
|
5986
|
+
external_user_id: overrides.external_user_id,
|
|
5987
|
+
destination_chain_type: overrides?.destination_chain_type || "ethereum",
|
|
5988
|
+
destination_chain_id: overrides?.destination_chain_id || DEFAULT_CONFIG.destinationChainId || "8453",
|
|
5989
|
+
destination_token_address: overrides?.destination_token_address || DEFAULT_CONFIG.destinationTokenAddress || "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
|
|
5990
|
+
recipient_address: overrides?.recipient_address || DEFAULT_CONFIG.recipientAddress || "0x309a4154a2CD4153Da886E780890C9cb5161553C",
|
|
5991
|
+
client_metadata: overrides?.client_metadata || {}
|
|
5992
|
+
};
|
|
5993
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
5994
|
+
validatePublishableKey(pk);
|
|
5995
|
+
const response = await fetch(`${API_BASE_URL}/v1/public/deposit_addresses`, {
|
|
5996
|
+
method: "POST",
|
|
5997
|
+
headers: {
|
|
5998
|
+
accept: "application/json",
|
|
5999
|
+
"x-publishable-key": pk,
|
|
6000
|
+
"Content-Type": "application/json"
|
|
6001
|
+
},
|
|
6002
|
+
body: JSON.stringify(payload)
|
|
6003
|
+
});
|
|
6004
|
+
if (!response.ok) {
|
|
6005
|
+
throw new Error(`Failed to create EOA: ${response.statusText}`);
|
|
6006
|
+
}
|
|
6007
|
+
return response.json();
|
|
6008
|
+
}
|
|
6009
|
+
function getWalletByChainType(wallets, chainType) {
|
|
6010
|
+
return wallets.find((wallet) => wallet.chain_type === chainType);
|
|
6011
|
+
}
|
|
6012
|
+
var ExecutionStatus = /* @__PURE__ */ ((ExecutionStatus2) => {
|
|
6013
|
+
ExecutionStatus2["DELAYED"] = "delayed";
|
|
6014
|
+
ExecutionStatus2["FAILED"] = "failed";
|
|
6015
|
+
ExecutionStatus2["PENDING"] = "pending";
|
|
6016
|
+
ExecutionStatus2["REFUNDED"] = "refunded";
|
|
6017
|
+
ExecutionStatus2["SUCCEEDED"] = "succeeded";
|
|
6018
|
+
ExecutionStatus2["WAITING"] = "waiting";
|
|
6019
|
+
return ExecutionStatus2;
|
|
6020
|
+
})(ExecutionStatus || {});
|
|
6021
|
+
async function queryExecutions(externalUserId, publishableKey) {
|
|
6022
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6023
|
+
validatePublishableKey(pk);
|
|
6024
|
+
const response = await fetch(
|
|
6025
|
+
`${API_BASE_URL}/v1/public/direct_executions/query`,
|
|
6026
|
+
{
|
|
6027
|
+
method: "POST",
|
|
6028
|
+
headers: {
|
|
6029
|
+
accept: "application/json",
|
|
6030
|
+
"x-publishable-key": pk,
|
|
6031
|
+
"Content-Type": "application/json"
|
|
6032
|
+
},
|
|
6033
|
+
body: JSON.stringify({
|
|
6034
|
+
external_user_id: externalUserId
|
|
6035
|
+
})
|
|
6036
|
+
}
|
|
6037
|
+
);
|
|
6038
|
+
if (!response.ok) {
|
|
6039
|
+
throw new Error(`Failed to query executions: ${response.statusText}`);
|
|
6040
|
+
}
|
|
6041
|
+
return response.json();
|
|
6042
|
+
}
|
|
6043
|
+
async function getSupportedDepositTokens(publishableKey) {
|
|
6044
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6045
|
+
validatePublishableKey(pk);
|
|
6046
|
+
const response = await fetch(
|
|
6047
|
+
`${API_BASE_URL}/v1/public/tokens/supported_deposit_tokens`,
|
|
6048
|
+
{
|
|
6049
|
+
method: "GET",
|
|
6050
|
+
headers: {
|
|
6051
|
+
accept: "application/json",
|
|
6052
|
+
"x-publishable-key": pk
|
|
6053
|
+
}
|
|
6054
|
+
}
|
|
6055
|
+
);
|
|
6056
|
+
if (!response.ok) {
|
|
6057
|
+
throw new Error(
|
|
6058
|
+
`Failed to fetch supported deposit tokens: ${response.statusText}`
|
|
6059
|
+
);
|
|
6060
|
+
}
|
|
6061
|
+
return response.json();
|
|
6062
|
+
}
|
|
6063
|
+
async function getMeldQuotes(request, publishableKey) {
|
|
6064
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6065
|
+
validatePublishableKey(pk);
|
|
6066
|
+
const response = await fetch(
|
|
6067
|
+
`${API_BASE_URL}/v1/public/onramps/meld/quotes`,
|
|
6068
|
+
{
|
|
6069
|
+
method: "POST",
|
|
6070
|
+
headers: {
|
|
6071
|
+
accept: "application/json",
|
|
6072
|
+
"x-publishable-key": pk,
|
|
6073
|
+
"Content-Type": "application/json"
|
|
6074
|
+
},
|
|
6075
|
+
body: JSON.stringify(request)
|
|
6076
|
+
}
|
|
6077
|
+
);
|
|
6078
|
+
if (!response.ok) {
|
|
6079
|
+
throw new Error(`Failed to fetch Meld quotes: ${response.statusText}`);
|
|
6080
|
+
}
|
|
6081
|
+
return response.json();
|
|
6082
|
+
}
|
|
6083
|
+
async function createMeldSession(request, publishableKey) {
|
|
6084
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6085
|
+
validatePublishableKey(pk);
|
|
6086
|
+
const response = await fetch(
|
|
6087
|
+
`${API_BASE_URL}/v1/public/onramps/meld/sessions`,
|
|
6088
|
+
{
|
|
6089
|
+
method: "POST",
|
|
6090
|
+
headers: {
|
|
6091
|
+
accept: "application/json",
|
|
6092
|
+
"x-publishable-key": pk,
|
|
6093
|
+
"Content-Type": "application/json"
|
|
6094
|
+
},
|
|
6095
|
+
body: JSON.stringify(request)
|
|
6096
|
+
}
|
|
6097
|
+
);
|
|
6098
|
+
if (!response.ok) {
|
|
6099
|
+
throw new Error(`Failed to create Meld session: ${response.statusText}`);
|
|
6100
|
+
}
|
|
6101
|
+
return response.json();
|
|
6102
|
+
}
|
|
6103
|
+
function getPreferredIconUrl(iconUrls, preferredFormat = "svg") {
|
|
6104
|
+
if (!iconUrls || iconUrls.length === 0) {
|
|
6105
|
+
return void 0;
|
|
6106
|
+
}
|
|
6107
|
+
const preferred = iconUrls.find((icon) => icon.format === preferredFormat);
|
|
6108
|
+
if (preferred) {
|
|
6109
|
+
return preferred.url;
|
|
6110
|
+
}
|
|
6111
|
+
return iconUrls[0]?.url;
|
|
6112
|
+
}
|
|
6113
|
+
async function getFiatCurrencies(publishableKey) {
|
|
6114
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6115
|
+
validatePublishableKey(pk);
|
|
6116
|
+
const response = await fetch(
|
|
6117
|
+
`${API_BASE_URL}/v1/public/onramps/fiat_currencies`,
|
|
6118
|
+
{
|
|
6119
|
+
method: "GET",
|
|
6120
|
+
headers: {
|
|
6121
|
+
accept: "application/json",
|
|
6122
|
+
"x-publishable-key": pk
|
|
6123
|
+
}
|
|
6124
|
+
}
|
|
6125
|
+
);
|
|
6126
|
+
if (!response.ok) {
|
|
6127
|
+
throw new Error(`Failed to fetch fiat currencies: ${response.statusText}`);
|
|
6128
|
+
}
|
|
6129
|
+
return response.json();
|
|
6130
|
+
}
|
|
6131
|
+
async function getTokenChains() {
|
|
6132
|
+
const response = await fetch(`${API_BASE_URL}/v1/public/tokens/chains`, {
|
|
6133
|
+
method: "GET",
|
|
6134
|
+
headers: {
|
|
6135
|
+
accept: "application/json"
|
|
6136
|
+
}
|
|
6137
|
+
});
|
|
6138
|
+
if (!response.ok) {
|
|
6139
|
+
throw new Error(`Failed to fetch token chains: ${response.statusText}`);
|
|
6140
|
+
}
|
|
6141
|
+
return response.json();
|
|
6142
|
+
}
|
|
6143
|
+
function getChainName(chains, chainType, chainId) {
|
|
6144
|
+
const byId = chains.find((c) => c.chain_id === chainId);
|
|
6145
|
+
if (byId) return byId.chain_name;
|
|
6146
|
+
const byType = chains.find((c) => c.chain_type === chainType);
|
|
6147
|
+
if (byType) return byType.chain_name;
|
|
6148
|
+
return chainType.charAt(0).toUpperCase() + chainType.slice(1);
|
|
6149
|
+
}
|
|
6150
|
+
async function getProjectConfig(publishableKey) {
|
|
6151
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
6152
|
+
validatePublishableKey(pk);
|
|
6153
|
+
const response = await fetch(`${API_BASE_URL}/v1/public/projects/config`, {
|
|
6154
|
+
method: "GET",
|
|
6155
|
+
headers: {
|
|
6156
|
+
accept: "application/json",
|
|
6157
|
+
"x-publishable-key": pk
|
|
6158
|
+
}
|
|
6159
|
+
});
|
|
6160
|
+
if (!response.ok) {
|
|
6161
|
+
throw new Error(`Failed to fetch project config: ${response.statusText}`);
|
|
6162
|
+
}
|
|
6163
|
+
return response.json();
|
|
6164
|
+
}
|
|
6165
|
+
|
|
6166
|
+
// ../ui-react/dist/index.mjs
|
|
5970
6167
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
6168
|
+
var import_react11 = require("react");
|
|
5971
6169
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
5972
6170
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
6171
|
+
var import_react12 = require("react");
|
|
5973
6172
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
5974
6173
|
var React38 = __toESM(require("react"), 1);
|
|
5975
6174
|
|
|
@@ -9465,202 +9664,55 @@ var Separator = SelectSeparator;
|
|
|
9465
9664
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
9466
9665
|
var React42 = __toESM(require("react"), 1);
|
|
9467
9666
|
|
|
9468
|
-
// ../../node_modules/.pnpm/@radix-ui+react-
|
|
9667
|
+
// ../../node_modules/.pnpm/@radix-ui+react-tooltip@1.2.8_@types+react-dom@18.3.7_@types+react@18.3.27__@types+react@18.3_hd4qp76o7ebwsrfrhqb6isuuvy/node_modules/@radix-ui/react-tooltip/dist/index.mjs
|
|
9469
9668
|
var React35 = __toESM(require("react"), 1);
|
|
9470
9669
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
9471
|
-
var
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
if (children.type !== React35.Fragment) {
|
|
9518
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
9519
|
-
}
|
|
9520
|
-
return React35.cloneElement(children, props2);
|
|
9521
|
-
}
|
|
9522
|
-
return React35.Children.count(children) > 1 ? React35.Children.only(null) : null;
|
|
9523
|
-
});
|
|
9524
|
-
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
9525
|
-
return SlotClone;
|
|
9526
|
-
}
|
|
9527
|
-
var SLOTTABLE_IDENTIFIER2 = /* @__PURE__ */ Symbol("radix.slottable");
|
|
9528
|
-
function isSlottable2(child) {
|
|
9529
|
-
return React35.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER2;
|
|
9530
|
-
}
|
|
9531
|
-
function mergeProps2(slotProps, childProps) {
|
|
9532
|
-
const overrideProps = { ...childProps };
|
|
9533
|
-
for (const propName in childProps) {
|
|
9534
|
-
const slotPropValue = slotProps[propName];
|
|
9535
|
-
const childPropValue = childProps[propName];
|
|
9536
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
9537
|
-
if (isHandler) {
|
|
9538
|
-
if (slotPropValue && childPropValue) {
|
|
9539
|
-
overrideProps[propName] = (...args) => {
|
|
9540
|
-
const result = childPropValue(...args);
|
|
9541
|
-
slotPropValue(...args);
|
|
9542
|
-
return result;
|
|
9543
|
-
};
|
|
9544
|
-
} else if (slotPropValue) {
|
|
9545
|
-
overrideProps[propName] = slotPropValue;
|
|
9546
|
-
}
|
|
9547
|
-
} else if (propName === "style") {
|
|
9548
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
9549
|
-
} else if (propName === "className") {
|
|
9550
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
9551
|
-
}
|
|
9552
|
-
}
|
|
9553
|
-
return { ...slotProps, ...overrideProps };
|
|
9554
|
-
}
|
|
9555
|
-
function getElementRef3(element) {
|
|
9556
|
-
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
9557
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
9558
|
-
if (mayWarn) {
|
|
9559
|
-
return element.ref;
|
|
9560
|
-
}
|
|
9561
|
-
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
9562
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
9563
|
-
if (mayWarn) {
|
|
9564
|
-
return element.props.ref;
|
|
9565
|
-
}
|
|
9566
|
-
return element.props.ref || element.ref;
|
|
9567
|
-
}
|
|
9568
|
-
|
|
9569
|
-
// ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
9570
|
-
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
9571
|
-
var cx = clsx;
|
|
9572
|
-
var cva = (base, config) => (props) => {
|
|
9573
|
-
var _config_compoundVariants;
|
|
9574
|
-
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
9575
|
-
const { variants, defaultVariants } = config;
|
|
9576
|
-
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
9577
|
-
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
9578
|
-
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
9579
|
-
if (variantProp === null) return null;
|
|
9580
|
-
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
9581
|
-
return variants[variant][variantKey];
|
|
9582
|
-
});
|
|
9583
|
-
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
9584
|
-
let [key, value] = param;
|
|
9585
|
-
if (value === void 0) {
|
|
9586
|
-
return acc;
|
|
9587
|
-
}
|
|
9588
|
-
acc[key] = value;
|
|
9589
|
-
return acc;
|
|
9590
|
-
}, {});
|
|
9591
|
-
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
|
|
9592
|
-
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
9593
|
-
return Object.entries(compoundVariantOptions).every((param2) => {
|
|
9594
|
-
let [key, value] = param2;
|
|
9595
|
-
return Array.isArray(value) ? value.includes({
|
|
9596
|
-
...defaultVariants,
|
|
9597
|
-
...propsWithoutUndefined
|
|
9598
|
-
}[key]) : {
|
|
9599
|
-
...defaultVariants,
|
|
9600
|
-
...propsWithoutUndefined
|
|
9601
|
-
}[key] === value;
|
|
9602
|
-
}) ? [
|
|
9603
|
-
...acc,
|
|
9604
|
-
cvClass,
|
|
9605
|
-
cvClassName
|
|
9606
|
-
] : acc;
|
|
9607
|
-
}, []);
|
|
9608
|
-
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
9609
|
-
};
|
|
9610
|
-
|
|
9611
|
-
// ../ui-react/dist/index.mjs
|
|
9612
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
9613
|
-
var React52 = __toESM(require("react"), 1);
|
|
9614
|
-
|
|
9615
|
-
// ../../node_modules/.pnpm/@radix-ui+react-tooltip@1.2.8_@types+react-dom@18.3.7_@types+react@18.3.27__@types+react@18.3_hd4qp76o7ebwsrfrhqb6isuuvy/node_modules/@radix-ui/react-tooltip/dist/index.mjs
|
|
9616
|
-
var React36 = __toESM(require("react"), 1);
|
|
9617
|
-
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
9618
|
-
var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
|
|
9619
|
-
createPopperScope
|
|
9620
|
-
]);
|
|
9621
|
-
var usePopperScope2 = createPopperScope();
|
|
9622
|
-
var PROVIDER_NAME = "TooltipProvider";
|
|
9623
|
-
var DEFAULT_DELAY_DURATION = 700;
|
|
9624
|
-
var TOOLTIP_OPEN = "tooltip.open";
|
|
9625
|
-
var [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME);
|
|
9626
|
-
var TooltipProvider = (props) => {
|
|
9627
|
-
const {
|
|
9628
|
-
__scopeTooltip,
|
|
9629
|
-
delayDuration = DEFAULT_DELAY_DURATION,
|
|
9630
|
-
skipDelayDuration = 300,
|
|
9631
|
-
disableHoverableContent = false,
|
|
9632
|
-
children
|
|
9633
|
-
} = props;
|
|
9634
|
-
const isOpenDelayedRef = React36.useRef(true);
|
|
9635
|
-
const isPointerInTransitRef = React36.useRef(false);
|
|
9636
|
-
const skipDelayTimerRef = React36.useRef(0);
|
|
9637
|
-
React36.useEffect(() => {
|
|
9638
|
-
const skipDelayTimer = skipDelayTimerRef.current;
|
|
9639
|
-
return () => window.clearTimeout(skipDelayTimer);
|
|
9640
|
-
}, []);
|
|
9641
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
9642
|
-
TooltipProviderContextProvider,
|
|
9643
|
-
{
|
|
9644
|
-
scope: __scopeTooltip,
|
|
9645
|
-
isOpenDelayedRef,
|
|
9646
|
-
delayDuration,
|
|
9647
|
-
onOpen: React36.useCallback(() => {
|
|
9648
|
-
window.clearTimeout(skipDelayTimerRef.current);
|
|
9649
|
-
isOpenDelayedRef.current = false;
|
|
9650
|
-
}, []),
|
|
9651
|
-
onClose: React36.useCallback(() => {
|
|
9652
|
-
window.clearTimeout(skipDelayTimerRef.current);
|
|
9653
|
-
skipDelayTimerRef.current = window.setTimeout(
|
|
9654
|
-
() => isOpenDelayedRef.current = true,
|
|
9655
|
-
skipDelayDuration
|
|
9656
|
-
);
|
|
9657
|
-
}, [skipDelayDuration]),
|
|
9658
|
-
isPointerInTransitRef,
|
|
9659
|
-
onPointerInTransitChange: React36.useCallback((inTransit) => {
|
|
9660
|
-
isPointerInTransitRef.current = inTransit;
|
|
9661
|
-
}, []),
|
|
9662
|
-
disableHoverableContent,
|
|
9663
|
-
children
|
|
9670
|
+
var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
|
|
9671
|
+
createPopperScope
|
|
9672
|
+
]);
|
|
9673
|
+
var usePopperScope2 = createPopperScope();
|
|
9674
|
+
var PROVIDER_NAME = "TooltipProvider";
|
|
9675
|
+
var DEFAULT_DELAY_DURATION = 700;
|
|
9676
|
+
var TOOLTIP_OPEN = "tooltip.open";
|
|
9677
|
+
var [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME);
|
|
9678
|
+
var TooltipProvider = (props) => {
|
|
9679
|
+
const {
|
|
9680
|
+
__scopeTooltip,
|
|
9681
|
+
delayDuration = DEFAULT_DELAY_DURATION,
|
|
9682
|
+
skipDelayDuration = 300,
|
|
9683
|
+
disableHoverableContent = false,
|
|
9684
|
+
children
|
|
9685
|
+
} = props;
|
|
9686
|
+
const isOpenDelayedRef = React35.useRef(true);
|
|
9687
|
+
const isPointerInTransitRef = React35.useRef(false);
|
|
9688
|
+
const skipDelayTimerRef = React35.useRef(0);
|
|
9689
|
+
React35.useEffect(() => {
|
|
9690
|
+
const skipDelayTimer = skipDelayTimerRef.current;
|
|
9691
|
+
return () => window.clearTimeout(skipDelayTimer);
|
|
9692
|
+
}, []);
|
|
9693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9694
|
+
TooltipProviderContextProvider,
|
|
9695
|
+
{
|
|
9696
|
+
scope: __scopeTooltip,
|
|
9697
|
+
isOpenDelayedRef,
|
|
9698
|
+
delayDuration,
|
|
9699
|
+
onOpen: React35.useCallback(() => {
|
|
9700
|
+
window.clearTimeout(skipDelayTimerRef.current);
|
|
9701
|
+
isOpenDelayedRef.current = false;
|
|
9702
|
+
}, []),
|
|
9703
|
+
onClose: React35.useCallback(() => {
|
|
9704
|
+
window.clearTimeout(skipDelayTimerRef.current);
|
|
9705
|
+
skipDelayTimerRef.current = window.setTimeout(
|
|
9706
|
+
() => isOpenDelayedRef.current = true,
|
|
9707
|
+
skipDelayDuration
|
|
9708
|
+
);
|
|
9709
|
+
}, [skipDelayDuration]),
|
|
9710
|
+
isPointerInTransitRef,
|
|
9711
|
+
onPointerInTransitChange: React35.useCallback((inTransit) => {
|
|
9712
|
+
isPointerInTransitRef.current = inTransit;
|
|
9713
|
+
}, []),
|
|
9714
|
+
disableHoverableContent,
|
|
9715
|
+
children
|
|
9664
9716
|
}
|
|
9665
9717
|
);
|
|
9666
9718
|
};
|
|
@@ -9679,12 +9731,12 @@ var Tooltip = (props) => {
|
|
|
9679
9731
|
} = props;
|
|
9680
9732
|
const providerContext = useTooltipProviderContext(TOOLTIP_NAME, props.__scopeTooltip);
|
|
9681
9733
|
const popperScope = usePopperScope2(__scopeTooltip);
|
|
9682
|
-
const [trigger, setTrigger] =
|
|
9734
|
+
const [trigger, setTrigger] = React35.useState(null);
|
|
9683
9735
|
const contentId = useId();
|
|
9684
|
-
const openTimerRef =
|
|
9736
|
+
const openTimerRef = React35.useRef(0);
|
|
9685
9737
|
const disableHoverableContent = disableHoverableContentProp ?? providerContext.disableHoverableContent;
|
|
9686
9738
|
const delayDuration = delayDurationProp ?? providerContext.delayDuration;
|
|
9687
|
-
const wasOpenDelayedRef =
|
|
9739
|
+
const wasOpenDelayedRef = React35.useRef(false);
|
|
9688
9740
|
const [open, setOpen] = useControllableState({
|
|
9689
9741
|
prop: openProp,
|
|
9690
9742
|
defaultProp: defaultOpen ?? false,
|
|
@@ -9699,21 +9751,21 @@ var Tooltip = (props) => {
|
|
|
9699
9751
|
},
|
|
9700
9752
|
caller: TOOLTIP_NAME
|
|
9701
9753
|
});
|
|
9702
|
-
const stateAttribute =
|
|
9754
|
+
const stateAttribute = React35.useMemo(() => {
|
|
9703
9755
|
return open ? wasOpenDelayedRef.current ? "delayed-open" : "instant-open" : "closed";
|
|
9704
9756
|
}, [open]);
|
|
9705
|
-
const handleOpen =
|
|
9757
|
+
const handleOpen = React35.useCallback(() => {
|
|
9706
9758
|
window.clearTimeout(openTimerRef.current);
|
|
9707
9759
|
openTimerRef.current = 0;
|
|
9708
9760
|
wasOpenDelayedRef.current = false;
|
|
9709
9761
|
setOpen(true);
|
|
9710
9762
|
}, [setOpen]);
|
|
9711
|
-
const handleClose =
|
|
9763
|
+
const handleClose = React35.useCallback(() => {
|
|
9712
9764
|
window.clearTimeout(openTimerRef.current);
|
|
9713
9765
|
openTimerRef.current = 0;
|
|
9714
9766
|
setOpen(false);
|
|
9715
9767
|
}, [setOpen]);
|
|
9716
|
-
const handleDelayedOpen =
|
|
9768
|
+
const handleDelayedOpen = React35.useCallback(() => {
|
|
9717
9769
|
window.clearTimeout(openTimerRef.current);
|
|
9718
9770
|
openTimerRef.current = window.setTimeout(() => {
|
|
9719
9771
|
wasOpenDelayedRef.current = true;
|
|
@@ -9721,7 +9773,7 @@ var Tooltip = (props) => {
|
|
|
9721
9773
|
openTimerRef.current = 0;
|
|
9722
9774
|
}, delayDuration);
|
|
9723
9775
|
}, [delayDuration, setOpen]);
|
|
9724
|
-
|
|
9776
|
+
React35.useEffect(() => {
|
|
9725
9777
|
return () => {
|
|
9726
9778
|
if (openTimerRef.current) {
|
|
9727
9779
|
window.clearTimeout(openTimerRef.current);
|
|
@@ -9729,7 +9781,7 @@ var Tooltip = (props) => {
|
|
|
9729
9781
|
}
|
|
9730
9782
|
};
|
|
9731
9783
|
}, []);
|
|
9732
|
-
return /* @__PURE__ */ (0,
|
|
9784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Root22, { ...popperScope, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9733
9785
|
TooltipContextProvider,
|
|
9734
9786
|
{
|
|
9735
9787
|
scope: __scopeTooltip,
|
|
@@ -9738,11 +9790,11 @@ var Tooltip = (props) => {
|
|
|
9738
9790
|
stateAttribute,
|
|
9739
9791
|
trigger,
|
|
9740
9792
|
onTriggerChange: setTrigger,
|
|
9741
|
-
onTriggerEnter:
|
|
9793
|
+
onTriggerEnter: React35.useCallback(() => {
|
|
9742
9794
|
if (providerContext.isOpenDelayedRef.current) handleDelayedOpen();
|
|
9743
9795
|
else handleOpen();
|
|
9744
9796
|
}, [providerContext.isOpenDelayedRef, handleDelayedOpen, handleOpen]),
|
|
9745
|
-
onTriggerLeave:
|
|
9797
|
+
onTriggerLeave: React35.useCallback(() => {
|
|
9746
9798
|
if (disableHoverableContent) {
|
|
9747
9799
|
handleClose();
|
|
9748
9800
|
} else {
|
|
@@ -9759,21 +9811,21 @@ var Tooltip = (props) => {
|
|
|
9759
9811
|
};
|
|
9760
9812
|
Tooltip.displayName = TOOLTIP_NAME;
|
|
9761
9813
|
var TRIGGER_NAME3 = "TooltipTrigger";
|
|
9762
|
-
var TooltipTrigger =
|
|
9814
|
+
var TooltipTrigger = React35.forwardRef(
|
|
9763
9815
|
(props, forwardedRef) => {
|
|
9764
9816
|
const { __scopeTooltip, ...triggerProps } = props;
|
|
9765
9817
|
const context = useTooltipContext(TRIGGER_NAME3, __scopeTooltip);
|
|
9766
9818
|
const providerContext = useTooltipProviderContext(TRIGGER_NAME3, __scopeTooltip);
|
|
9767
9819
|
const popperScope = usePopperScope2(__scopeTooltip);
|
|
9768
|
-
const ref =
|
|
9820
|
+
const ref = React35.useRef(null);
|
|
9769
9821
|
const composedRefs = useComposedRefs(forwardedRef, ref, context.onTriggerChange);
|
|
9770
|
-
const isPointerDownRef =
|
|
9771
|
-
const hasPointerMoveOpenedRef =
|
|
9772
|
-
const handlePointerUp =
|
|
9773
|
-
|
|
9822
|
+
const isPointerDownRef = React35.useRef(false);
|
|
9823
|
+
const hasPointerMoveOpenedRef = React35.useRef(false);
|
|
9824
|
+
const handlePointerUp = React35.useCallback(() => isPointerDownRef.current = false, []);
|
|
9825
|
+
React35.useEffect(() => {
|
|
9774
9826
|
return () => document.removeEventListener("pointerup", handlePointerUp);
|
|
9775
9827
|
}, [handlePointerUp]);
|
|
9776
|
-
return /* @__PURE__ */ (0,
|
|
9828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9777
9829
|
Primitive.button,
|
|
9778
9830
|
{
|
|
9779
9831
|
"aria-describedby": context.open ? context.contentId : void 0,
|
|
@@ -9815,32 +9867,32 @@ var [PortalProvider2, usePortalContext2] = createTooltipContext(PORTAL_NAME4, {
|
|
|
9815
9867
|
var TooltipPortal = (props) => {
|
|
9816
9868
|
const { __scopeTooltip, forceMount, children, container } = props;
|
|
9817
9869
|
const context = useTooltipContext(PORTAL_NAME4, __scopeTooltip);
|
|
9818
|
-
return /* @__PURE__ */ (0,
|
|
9870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PortalProvider2, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Portal, { asChild: true, container, children }) }) });
|
|
9819
9871
|
};
|
|
9820
9872
|
TooltipPortal.displayName = PORTAL_NAME4;
|
|
9821
9873
|
var CONTENT_NAME4 = "TooltipContent";
|
|
9822
|
-
var TooltipContent =
|
|
9874
|
+
var TooltipContent = React35.forwardRef(
|
|
9823
9875
|
(props, forwardedRef) => {
|
|
9824
9876
|
const portalContext = usePortalContext2(CONTENT_NAME4, props.__scopeTooltip);
|
|
9825
9877
|
const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
|
|
9826
9878
|
const context = useTooltipContext(CONTENT_NAME4, props.__scopeTooltip);
|
|
9827
|
-
return /* @__PURE__ */ (0,
|
|
9879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });
|
|
9828
9880
|
}
|
|
9829
9881
|
);
|
|
9830
|
-
var TooltipContentHoverable =
|
|
9882
|
+
var TooltipContentHoverable = React35.forwardRef((props, forwardedRef) => {
|
|
9831
9883
|
const context = useTooltipContext(CONTENT_NAME4, props.__scopeTooltip);
|
|
9832
9884
|
const providerContext = useTooltipProviderContext(CONTENT_NAME4, props.__scopeTooltip);
|
|
9833
|
-
const ref =
|
|
9885
|
+
const ref = React35.useRef(null);
|
|
9834
9886
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
9835
|
-
const [pointerGraceArea, setPointerGraceArea] =
|
|
9887
|
+
const [pointerGraceArea, setPointerGraceArea] = React35.useState(null);
|
|
9836
9888
|
const { trigger, onClose } = context;
|
|
9837
9889
|
const content = ref.current;
|
|
9838
9890
|
const { onPointerInTransitChange } = providerContext;
|
|
9839
|
-
const handleRemoveGraceArea =
|
|
9891
|
+
const handleRemoveGraceArea = React35.useCallback(() => {
|
|
9840
9892
|
setPointerGraceArea(null);
|
|
9841
9893
|
onPointerInTransitChange(false);
|
|
9842
9894
|
}, [onPointerInTransitChange]);
|
|
9843
|
-
const handleCreateGraceArea =
|
|
9895
|
+
const handleCreateGraceArea = React35.useCallback(
|
|
9844
9896
|
(event, hoverTarget) => {
|
|
9845
9897
|
const currentTarget = event.currentTarget;
|
|
9846
9898
|
const exitPoint = { x: event.clientX, y: event.clientY };
|
|
@@ -9853,10 +9905,10 @@ var TooltipContentHoverable = React36.forwardRef((props, forwardedRef) => {
|
|
|
9853
9905
|
},
|
|
9854
9906
|
[onPointerInTransitChange]
|
|
9855
9907
|
);
|
|
9856
|
-
|
|
9908
|
+
React35.useEffect(() => {
|
|
9857
9909
|
return () => handleRemoveGraceArea();
|
|
9858
9910
|
}, [handleRemoveGraceArea]);
|
|
9859
|
-
|
|
9911
|
+
React35.useEffect(() => {
|
|
9860
9912
|
if (trigger && content) {
|
|
9861
9913
|
const handleTriggerLeave = (event) => handleCreateGraceArea(event, content);
|
|
9862
9914
|
const handleContentLeave = (event) => handleCreateGraceArea(event, trigger);
|
|
@@ -9868,7 +9920,7 @@ var TooltipContentHoverable = React36.forwardRef((props, forwardedRef) => {
|
|
|
9868
9920
|
};
|
|
9869
9921
|
}
|
|
9870
9922
|
}, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]);
|
|
9871
|
-
|
|
9923
|
+
React35.useEffect(() => {
|
|
9872
9924
|
if (pointerGraceArea) {
|
|
9873
9925
|
const handleTrackPointerGrace = (event) => {
|
|
9874
9926
|
const target = event.target;
|
|
@@ -9886,11 +9938,11 @@ var TooltipContentHoverable = React36.forwardRef((props, forwardedRef) => {
|
|
|
9886
9938
|
return () => document.removeEventListener("pointermove", handleTrackPointerGrace);
|
|
9887
9939
|
}
|
|
9888
9940
|
}, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);
|
|
9889
|
-
return /* @__PURE__ */ (0,
|
|
9941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipContentImpl, { ...props, ref: composedRefs });
|
|
9890
9942
|
});
|
|
9891
9943
|
var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });
|
|
9892
9944
|
var Slottable = createSlottable("TooltipContent");
|
|
9893
|
-
var TooltipContentImpl =
|
|
9945
|
+
var TooltipContentImpl = React35.forwardRef(
|
|
9894
9946
|
(props, forwardedRef) => {
|
|
9895
9947
|
const {
|
|
9896
9948
|
__scopeTooltip,
|
|
@@ -9903,11 +9955,11 @@ var TooltipContentImpl = React36.forwardRef(
|
|
|
9903
9955
|
const context = useTooltipContext(CONTENT_NAME4, __scopeTooltip);
|
|
9904
9956
|
const popperScope = usePopperScope2(__scopeTooltip);
|
|
9905
9957
|
const { onClose } = context;
|
|
9906
|
-
|
|
9958
|
+
React35.useEffect(() => {
|
|
9907
9959
|
document.addEventListener(TOOLTIP_OPEN, onClose);
|
|
9908
9960
|
return () => document.removeEventListener(TOOLTIP_OPEN, onClose);
|
|
9909
9961
|
}, [onClose]);
|
|
9910
|
-
|
|
9962
|
+
React35.useEffect(() => {
|
|
9911
9963
|
if (context.trigger) {
|
|
9912
9964
|
const handleScroll2 = (event) => {
|
|
9913
9965
|
const target = event.target;
|
|
@@ -9917,7 +9969,7 @@ var TooltipContentImpl = React36.forwardRef(
|
|
|
9917
9969
|
return () => window.removeEventListener("scroll", handleScroll2, { capture: true });
|
|
9918
9970
|
}
|
|
9919
9971
|
}, [context.trigger, onClose]);
|
|
9920
|
-
return /* @__PURE__ */ (0,
|
|
9972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9921
9973
|
DismissableLayer,
|
|
9922
9974
|
{
|
|
9923
9975
|
asChild: true,
|
|
@@ -9926,7 +9978,7 @@ var TooltipContentImpl = React36.forwardRef(
|
|
|
9926
9978
|
onPointerDownOutside,
|
|
9927
9979
|
onFocusOutside: (event) => event.preventDefault(),
|
|
9928
9980
|
onDismiss: onClose,
|
|
9929
|
-
children: /* @__PURE__ */ (0,
|
|
9981
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
9930
9982
|
Content2,
|
|
9931
9983
|
{
|
|
9932
9984
|
"data-state": context.stateAttribute,
|
|
@@ -9945,8 +9997,8 @@ var TooltipContentImpl = React36.forwardRef(
|
|
|
9945
9997
|
}
|
|
9946
9998
|
},
|
|
9947
9999
|
children: [
|
|
9948
|
-
/* @__PURE__ */ (0,
|
|
9949
|
-
/* @__PURE__ */ (0,
|
|
10000
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Slottable, { children }),
|
|
10001
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Root3, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
|
|
9950
10002
|
]
|
|
9951
10003
|
}
|
|
9952
10004
|
)
|
|
@@ -9956,7 +10008,7 @@ var TooltipContentImpl = React36.forwardRef(
|
|
|
9956
10008
|
);
|
|
9957
10009
|
TooltipContent.displayName = CONTENT_NAME4;
|
|
9958
10010
|
var ARROW_NAME3 = "TooltipArrow";
|
|
9959
|
-
var TooltipArrow =
|
|
10011
|
+
var TooltipArrow = React35.forwardRef(
|
|
9960
10012
|
(props, forwardedRef) => {
|
|
9961
10013
|
const { __scopeTooltip, ...arrowProps } = props;
|
|
9962
10014
|
const popperScope = usePopperScope2(__scopeTooltip);
|
|
@@ -9964,7 +10016,7 @@ var TooltipArrow = React36.forwardRef(
|
|
|
9964
10016
|
ARROW_NAME3,
|
|
9965
10017
|
__scopeTooltip
|
|
9966
10018
|
);
|
|
9967
|
-
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ (0,
|
|
10019
|
+
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Arrow2, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
9968
10020
|
}
|
|
9969
10021
|
);
|
|
9970
10022
|
TooltipArrow.displayName = ARROW_NAME3;
|
|
@@ -10090,93 +10142,240 @@ var Portal4 = TooltipPortal;
|
|
|
10090
10142
|
var Content23 = TooltipContent;
|
|
10091
10143
|
|
|
10092
10144
|
// ../ui-react/dist/index.mjs
|
|
10145
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
10093
10146
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
10094
10147
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
10148
|
+
var import_react13 = require("react");
|
|
10149
|
+
var import_react14 = require("react");
|
|
10095
10150
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
10096
|
-
var import_react11 = require("react");
|
|
10097
|
-
var import_react12 = require("react");
|
|
10098
10151
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
10099
10152
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
10153
|
+
var import_react_query3 = require("@tanstack/react-query");
|
|
10100
10154
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
10101
|
-
var import_react_query2 = require("@tanstack/react-query");
|
|
10102
10155
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
10103
10156
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
10104
10157
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
10105
10158
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
10106
10159
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
10107
|
-
var
|
|
10108
|
-
|
|
10109
|
-
|
|
10160
|
+
var React52 = __toESM(require("react"), 1);
|
|
10161
|
+
|
|
10162
|
+
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.4_@types+react@18.3.27_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
10163
|
+
var React36 = __toESM(require("react"), 1);
|
|
10164
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
10165
|
+
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
10166
|
+
var use = React36[" use ".trim().toString()];
|
|
10167
|
+
function isPromiseLike(value) {
|
|
10168
|
+
return typeof value === "object" && value !== null && "then" in value;
|
|
10110
10169
|
}
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
children,
|
|
10114
|
-
themeClass
|
|
10115
|
-
}) {
|
|
10116
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ThemeContext.Provider, { value: { themeClass }, children });
|
|
10170
|
+
function isLazyComponent(element) {
|
|
10171
|
+
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
10117
10172
|
}
|
|
10118
|
-
|
|
10119
|
-
|
|
10173
|
+
// @__NO_SIDE_EFFECTS__
|
|
10174
|
+
function createSlot2(ownerName) {
|
|
10175
|
+
const SlotClone = /* @__PURE__ */ createSlotClone2(ownerName);
|
|
10176
|
+
const Slot22 = React36.forwardRef((props, forwardedRef) => {
|
|
10177
|
+
let { children, ...slotProps } = props;
|
|
10178
|
+
if (isLazyComponent(children) && typeof use === "function") {
|
|
10179
|
+
children = use(children._payload);
|
|
10180
|
+
}
|
|
10181
|
+
const childrenArray = React36.Children.toArray(children);
|
|
10182
|
+
const slottable = childrenArray.find(isSlottable2);
|
|
10183
|
+
if (slottable) {
|
|
10184
|
+
const newElement = slottable.props.children;
|
|
10185
|
+
const newChildren = childrenArray.map((child) => {
|
|
10186
|
+
if (child === slottable) {
|
|
10187
|
+
if (React36.Children.count(newElement) > 1) return React36.Children.only(null);
|
|
10188
|
+
return React36.isValidElement(newElement) ? newElement.props.children : null;
|
|
10189
|
+
} else {
|
|
10190
|
+
return child;
|
|
10191
|
+
}
|
|
10192
|
+
});
|
|
10193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React36.isValidElement(newElement) ? React36.cloneElement(newElement, void 0, newChildren) : null });
|
|
10194
|
+
}
|
|
10195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
10196
|
+
});
|
|
10197
|
+
Slot22.displayName = `${ownerName}.Slot`;
|
|
10198
|
+
return Slot22;
|
|
10120
10199
|
}
|
|
10121
|
-
var
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
const
|
|
10125
|
-
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
ref,
|
|
10129
|
-
className: cn(
|
|
10130
|
-
themeClass,
|
|
10131
|
-
"uf-fixed uf-inset-0 uf-z-50 uf-bg-black/40 data-[state=open]:uf-animate-in data-[state=closed]:uf-animate-out data-[state=closed]:uf-fade-out-0 data-[state=open]:uf-fade-in-0",
|
|
10132
|
-
className
|
|
10133
|
-
),
|
|
10134
|
-
...props
|
|
10200
|
+
var Slot3 = /* @__PURE__ */ createSlot2("Slot");
|
|
10201
|
+
// @__NO_SIDE_EFFECTS__
|
|
10202
|
+
function createSlotClone2(ownerName) {
|
|
10203
|
+
const SlotClone = React36.forwardRef((props, forwardedRef) => {
|
|
10204
|
+
let { children, ...slotProps } = props;
|
|
10205
|
+
if (isLazyComponent(children) && typeof use === "function") {
|
|
10206
|
+
children = use(children._payload);
|
|
10135
10207
|
}
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
|
|
10140
|
-
|
|
10141
|
-
|
|
10142
|
-
|
|
10143
|
-
{
|
|
10144
|
-
ref,
|
|
10145
|
-
className: cn(
|
|
10146
|
-
// Mobile: bottom-aligned, full-width
|
|
10147
|
-
"uf-fixed uf-bottom-0 uf-left-0 uf-right-0 uf-z-50 uf-grid uf-w-full uf-max-w-full",
|
|
10148
|
-
// Mobile: rounded top corners only
|
|
10149
|
-
"uf-rounded-t-3xl",
|
|
10150
|
-
// Desktop: centered modal (no default max-width, let parent specify)
|
|
10151
|
-
"sm:uf-left-[50%] sm:uf-top-[50%] sm:uf-bottom-auto sm:uf-right-auto sm:uf-translate-x-[-50%] sm:uf-translate-y-[-50%]",
|
|
10152
|
-
// Desktop: rounded all corners
|
|
10153
|
-
"sm:uf-rounded-3xl",
|
|
10154
|
-
// Common styles
|
|
10155
|
-
"uf-gap-4 uf-border uf-bg-background uf-p-6 uf-shadow-lg uf-duration-200",
|
|
10156
|
-
// Animations - mobile slides from bottom
|
|
10157
|
-
"data-[state=open]:uf-animate-in data-[state=closed]:uf-animate-out",
|
|
10158
|
-
"data-[state=closed]:uf-fade-out-0 data-[state=open]:uf-fade-in-0",
|
|
10159
|
-
"data-[state=closed]:uf-slide-out-to-bottom data-[state=open]:uf-slide-in-from-bottom",
|
|
10160
|
-
// Desktop animations - center zoom
|
|
10161
|
-
"sm:data-[state=closed]:uf-zoom-out-95 sm:data-[state=open]:uf-zoom-in-95",
|
|
10162
|
-
"sm:data-[state=closed]:uf-slide-out-to-left-1/2 sm:data-[state=closed]:uf-slide-out-to-top-[48%]",
|
|
10163
|
-
"sm:data-[state=open]:uf-slide-in-from-left-1/2 sm:data-[state=open]:uf-slide-in-from-top-[48%]",
|
|
10164
|
-
className
|
|
10165
|
-
),
|
|
10166
|
-
...props,
|
|
10167
|
-
children: [
|
|
10168
|
-
children,
|
|
10169
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Close, { className: "uf-absolute uf-right-6 uf-top-6 uf-rounded-sm uf-opacity-70 uf-ring-offset-background uf-transition-opacity hover:uf-opacity-100 focus:uf-outline-none focus:uf-ring-2 focus:uf-ring-ring focus:uf-ring-offset-2 disabled:uf-pointer-events-none data-[state=open]:uf-bg-accent data-[state=open]:uf-text-muted-foreground", children: [
|
|
10170
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(X, { className: "uf-h-6 uf-w-6" }),
|
|
10171
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "uf-sr-only", children: "Close" })
|
|
10172
|
-
] })
|
|
10173
|
-
]
|
|
10208
|
+
if (React36.isValidElement(children)) {
|
|
10209
|
+
const childrenRef = getElementRef3(children);
|
|
10210
|
+
const props2 = mergeProps2(slotProps, children.props);
|
|
10211
|
+
if (children.type !== React36.Fragment) {
|
|
10212
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
10213
|
+
}
|
|
10214
|
+
return React36.cloneElement(children, props2);
|
|
10174
10215
|
}
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10216
|
+
return React36.Children.count(children) > 1 ? React36.Children.only(null) : null;
|
|
10217
|
+
});
|
|
10218
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
10219
|
+
return SlotClone;
|
|
10220
|
+
}
|
|
10221
|
+
var SLOTTABLE_IDENTIFIER2 = /* @__PURE__ */ Symbol("radix.slottable");
|
|
10222
|
+
function isSlottable2(child) {
|
|
10223
|
+
return React36.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER2;
|
|
10224
|
+
}
|
|
10225
|
+
function mergeProps2(slotProps, childProps) {
|
|
10226
|
+
const overrideProps = { ...childProps };
|
|
10227
|
+
for (const propName in childProps) {
|
|
10228
|
+
const slotPropValue = slotProps[propName];
|
|
10229
|
+
const childPropValue = childProps[propName];
|
|
10230
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
10231
|
+
if (isHandler) {
|
|
10232
|
+
if (slotPropValue && childPropValue) {
|
|
10233
|
+
overrideProps[propName] = (...args) => {
|
|
10234
|
+
const result = childPropValue(...args);
|
|
10235
|
+
slotPropValue(...args);
|
|
10236
|
+
return result;
|
|
10237
|
+
};
|
|
10238
|
+
} else if (slotPropValue) {
|
|
10239
|
+
overrideProps[propName] = slotPropValue;
|
|
10240
|
+
}
|
|
10241
|
+
} else if (propName === "style") {
|
|
10242
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
10243
|
+
} else if (propName === "className") {
|
|
10244
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
10245
|
+
}
|
|
10246
|
+
}
|
|
10247
|
+
return { ...slotProps, ...overrideProps };
|
|
10248
|
+
}
|
|
10249
|
+
function getElementRef3(element) {
|
|
10250
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
10251
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
10252
|
+
if (mayWarn) {
|
|
10253
|
+
return element.ref;
|
|
10254
|
+
}
|
|
10255
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
10256
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
10257
|
+
if (mayWarn) {
|
|
10258
|
+
return element.props.ref;
|
|
10259
|
+
}
|
|
10260
|
+
return element.props.ref || element.ref;
|
|
10261
|
+
}
|
|
10262
|
+
|
|
10263
|
+
// ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
10264
|
+
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
10265
|
+
var cx = clsx;
|
|
10266
|
+
var cva = (base, config) => (props) => {
|
|
10267
|
+
var _config_compoundVariants;
|
|
10268
|
+
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
10269
|
+
const { variants, defaultVariants } = config;
|
|
10270
|
+
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
10271
|
+
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
10272
|
+
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
10273
|
+
if (variantProp === null) return null;
|
|
10274
|
+
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
10275
|
+
return variants[variant][variantKey];
|
|
10276
|
+
});
|
|
10277
|
+
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
10278
|
+
let [key, value] = param;
|
|
10279
|
+
if (value === void 0) {
|
|
10280
|
+
return acc;
|
|
10281
|
+
}
|
|
10282
|
+
acc[key] = value;
|
|
10283
|
+
return acc;
|
|
10284
|
+
}, {});
|
|
10285
|
+
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
|
|
10286
|
+
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
10287
|
+
return Object.entries(compoundVariantOptions).every((param2) => {
|
|
10288
|
+
let [key, value] = param2;
|
|
10289
|
+
return Array.isArray(value) ? value.includes({
|
|
10290
|
+
...defaultVariants,
|
|
10291
|
+
...propsWithoutUndefined
|
|
10292
|
+
}[key]) : {
|
|
10293
|
+
...defaultVariants,
|
|
10294
|
+
...propsWithoutUndefined
|
|
10295
|
+
}[key] === value;
|
|
10296
|
+
}) ? [
|
|
10297
|
+
...acc,
|
|
10298
|
+
cvClass,
|
|
10299
|
+
cvClassName
|
|
10300
|
+
] : acc;
|
|
10301
|
+
}, []);
|
|
10302
|
+
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
10303
|
+
};
|
|
10304
|
+
|
|
10305
|
+
// ../ui-react/dist/index.mjs
|
|
10306
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
10307
|
+
function cn(...inputs) {
|
|
10308
|
+
return twMerge(clsx(inputs));
|
|
10309
|
+
}
|
|
10310
|
+
var ThemeContext = React37.createContext({ themeClass: "" });
|
|
10311
|
+
function ThemeProvider({
|
|
10312
|
+
children,
|
|
10313
|
+
themeClass
|
|
10314
|
+
}) {
|
|
10315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ThemeContext.Provider, { value: { themeClass }, children });
|
|
10316
|
+
}
|
|
10317
|
+
function useTheme() {
|
|
10318
|
+
return React37.useContext(ThemeContext);
|
|
10319
|
+
}
|
|
10320
|
+
var Dialog2 = Root;
|
|
10321
|
+
var DialogPortal2 = Portal2;
|
|
10322
|
+
var DialogOverlay2 = React210.forwardRef(({ className, ...props }, ref) => {
|
|
10323
|
+
const { themeClass } = useTheme();
|
|
10324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
10325
|
+
Overlay,
|
|
10326
|
+
{
|
|
10327
|
+
ref,
|
|
10328
|
+
className: cn(
|
|
10329
|
+
themeClass,
|
|
10330
|
+
"uf-fixed uf-inset-0 uf-z-50 uf-bg-black/40 data-[state=open]:uf-animate-in data-[state=closed]:uf-animate-out data-[state=closed]:uf-fade-out-0 data-[state=open]:uf-fade-in-0",
|
|
10331
|
+
className
|
|
10332
|
+
),
|
|
10333
|
+
...props
|
|
10334
|
+
}
|
|
10335
|
+
);
|
|
10336
|
+
});
|
|
10337
|
+
DialogOverlay2.displayName = Overlay.displayName;
|
|
10338
|
+
var DialogContent2 = React210.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DialogPortal2, { children: [
|
|
10339
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DialogOverlay2, {}),
|
|
10340
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
10341
|
+
Content,
|
|
10342
|
+
{
|
|
10343
|
+
ref,
|
|
10344
|
+
className: cn(
|
|
10345
|
+
// Mobile: bottom-aligned, full-width
|
|
10346
|
+
"uf-fixed uf-bottom-0 uf-left-0 uf-right-0 uf-z-50 uf-grid uf-w-full uf-max-w-full",
|
|
10347
|
+
// Mobile: rounded top corners only
|
|
10348
|
+
"uf-rounded-t-3xl",
|
|
10349
|
+
// Desktop: centered modal (no default max-width, let parent specify)
|
|
10350
|
+
"sm:uf-left-[50%] sm:uf-top-[50%] sm:uf-bottom-auto sm:uf-right-auto sm:uf-translate-x-[-50%] sm:uf-translate-y-[-50%]",
|
|
10351
|
+
// Desktop: rounded all corners
|
|
10352
|
+
"sm:uf-rounded-3xl",
|
|
10353
|
+
// Common styles
|
|
10354
|
+
"uf-gap-4 uf-border uf-bg-background uf-p-6 uf-shadow-lg uf-duration-200",
|
|
10355
|
+
// Animations - mobile slides from bottom
|
|
10356
|
+
"data-[state=open]:uf-animate-in data-[state=closed]:uf-animate-out",
|
|
10357
|
+
"data-[state=closed]:uf-fade-out-0 data-[state=open]:uf-fade-in-0",
|
|
10358
|
+
"data-[state=closed]:uf-slide-out-to-bottom data-[state=open]:uf-slide-in-from-bottom",
|
|
10359
|
+
// Desktop animations - center zoom
|
|
10360
|
+
"sm:data-[state=closed]:uf-zoom-out-95 sm:data-[state=open]:uf-zoom-in-95",
|
|
10361
|
+
"sm:data-[state=closed]:uf-slide-out-to-left-1/2 sm:data-[state=closed]:uf-slide-out-to-top-[48%]",
|
|
10362
|
+
"sm:data-[state=open]:uf-slide-in-from-left-1/2 sm:data-[state=open]:uf-slide-in-from-top-[48%]",
|
|
10363
|
+
className
|
|
10364
|
+
),
|
|
10365
|
+
...props,
|
|
10366
|
+
children: [
|
|
10367
|
+
children,
|
|
10368
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Close, { className: "uf-absolute uf-right-6 uf-top-6 uf-rounded-sm uf-opacity-70 uf-ring-offset-background uf-transition-opacity hover:uf-opacity-100 focus:uf-outline-none focus:uf-ring-2 focus:uf-ring-ring focus:uf-ring-offset-2 disabled:uf-pointer-events-none data-[state=open]:uf-bg-accent data-[state=open]:uf-text-muted-foreground", children: [
|
|
10369
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(X, { className: "uf-h-6 uf-w-6" }),
|
|
10370
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "uf-sr-only", children: "Close" })
|
|
10371
|
+
] })
|
|
10372
|
+
]
|
|
10373
|
+
}
|
|
10374
|
+
)
|
|
10375
|
+
] }));
|
|
10376
|
+
DialogContent2.displayName = Content.displayName;
|
|
10377
|
+
var DialogHeader = ({
|
|
10378
|
+
className,
|
|
10180
10379
|
...props
|
|
10181
10380
|
}) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
10182
10381
|
"div",
|
|
@@ -10343,175 +10542,11 @@ function DepositHeader({
|
|
|
10343
10542
|
) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "uf-w-5 uf-h-5 uf-invisible" })
|
|
10344
10543
|
] });
|
|
10345
10544
|
}
|
|
10346
|
-
var API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.unifold.io";
|
|
10347
|
-
var DEFAULT_PUBLISHABLE_KEY = "pk_test_123";
|
|
10348
|
-
var DEFAULT_CONFIG = {};
|
|
10349
|
-
function getIconUrl(iconPath) {
|
|
10350
|
-
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
10351
|
-
return `${API_BASE_URL}/api/public${normalizedPath}`;
|
|
10352
|
-
}
|
|
10353
|
-
function getIconUrlWithCdn(iconPath, assetCdnUrl) {
|
|
10354
|
-
if (!assetCdnUrl) {
|
|
10355
|
-
return getIconUrl(iconPath);
|
|
10356
|
-
}
|
|
10357
|
-
const normalizedPath = iconPath.startsWith("/") ? iconPath : `/${iconPath}`;
|
|
10358
|
-
const baseUrl = assetCdnUrl.endsWith("/") ? assetCdnUrl.slice(0, -1) : assetCdnUrl;
|
|
10359
|
-
return `${baseUrl}/api/public${normalizedPath}`;
|
|
10360
|
-
}
|
|
10361
|
-
async function createEOA(overrides, publishableKey) {
|
|
10362
|
-
if (!overrides?.user_id) {
|
|
10363
|
-
throw new Error("user_id is required");
|
|
10364
|
-
}
|
|
10365
|
-
const payload = {
|
|
10366
|
-
user_id: overrides.user_id,
|
|
10367
|
-
destination_chain_type: overrides?.destination_chain_type || "ethereum",
|
|
10368
|
-
destination_chain_id: overrides?.destination_chain_id || DEFAULT_CONFIG.destinationChainId || "8453",
|
|
10369
|
-
destination_token_address: overrides?.destination_token_address || DEFAULT_CONFIG.destinationTokenAddress || "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
|
|
10370
|
-
recipient_address: overrides?.recipient_address || DEFAULT_CONFIG.recipientAddress || "0x309a4154a2CD4153Da886E780890C9cb5161553C",
|
|
10371
|
-
client_metadata: overrides?.client_metadata || {}
|
|
10372
|
-
};
|
|
10373
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10374
|
-
const response = await fetch(`${API_BASE_URL}/v1/public/deposit_addresses`, {
|
|
10375
|
-
method: "POST",
|
|
10376
|
-
headers: {
|
|
10377
|
-
accept: "application/json",
|
|
10378
|
-
"x-publishable-key": pk,
|
|
10379
|
-
"Content-Type": "application/json"
|
|
10380
|
-
},
|
|
10381
|
-
body: JSON.stringify(payload)
|
|
10382
|
-
});
|
|
10383
|
-
if (!response.ok) {
|
|
10384
|
-
throw new Error(`Failed to create EOA: ${response.statusText}`);
|
|
10385
|
-
}
|
|
10386
|
-
return response.json();
|
|
10387
|
-
}
|
|
10388
|
-
function getWalletByChainType(wallets, chainType) {
|
|
10389
|
-
return wallets.find((wallet) => wallet.chain_type === chainType);
|
|
10390
|
-
}
|
|
10391
|
-
async function queryExecutions(externalUserId, publishableKey) {
|
|
10392
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10393
|
-
const response = await fetch(
|
|
10394
|
-
`${API_BASE_URL}/v1/public/direct_executions/query`,
|
|
10395
|
-
{
|
|
10396
|
-
method: "POST",
|
|
10397
|
-
headers: {
|
|
10398
|
-
accept: "application/json",
|
|
10399
|
-
"x-publishable-key": pk,
|
|
10400
|
-
"Content-Type": "application/json"
|
|
10401
|
-
},
|
|
10402
|
-
body: JSON.stringify({
|
|
10403
|
-
external_user_id: externalUserId
|
|
10404
|
-
})
|
|
10405
|
-
}
|
|
10406
|
-
);
|
|
10407
|
-
if (!response.ok) {
|
|
10408
|
-
throw new Error(`Failed to query executions: ${response.statusText}`);
|
|
10409
|
-
}
|
|
10410
|
-
return response.json();
|
|
10411
|
-
}
|
|
10412
|
-
async function getSupportedDepositTokens(publishableKey) {
|
|
10413
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10414
|
-
const response = await fetch(
|
|
10415
|
-
`${API_BASE_URL}/v1/public/tokens/supported_deposit_tokens`,
|
|
10416
|
-
{
|
|
10417
|
-
method: "GET",
|
|
10418
|
-
headers: {
|
|
10419
|
-
accept: "application/json",
|
|
10420
|
-
"x-publishable-key": pk
|
|
10421
|
-
}
|
|
10422
|
-
}
|
|
10423
|
-
);
|
|
10424
|
-
if (!response.ok) {
|
|
10425
|
-
throw new Error(
|
|
10426
|
-
`Failed to fetch supported deposit tokens: ${response.statusText}`
|
|
10427
|
-
);
|
|
10428
|
-
}
|
|
10429
|
-
return response.json();
|
|
10430
|
-
}
|
|
10431
|
-
async function getMeldQuotes(request, publishableKey) {
|
|
10432
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10433
|
-
const response = await fetch(
|
|
10434
|
-
`${API_BASE_URL}/v1/public/onramps/meld/quotes`,
|
|
10435
|
-
{
|
|
10436
|
-
method: "POST",
|
|
10437
|
-
headers: {
|
|
10438
|
-
accept: "application/json",
|
|
10439
|
-
"x-publishable-key": pk,
|
|
10440
|
-
"Content-Type": "application/json"
|
|
10441
|
-
},
|
|
10442
|
-
body: JSON.stringify(request)
|
|
10443
|
-
}
|
|
10444
|
-
);
|
|
10445
|
-
if (!response.ok) {
|
|
10446
|
-
throw new Error(`Failed to fetch Meld quotes: ${response.statusText}`);
|
|
10447
|
-
}
|
|
10448
|
-
return response.json();
|
|
10449
|
-
}
|
|
10450
|
-
async function createMeldSession(request, publishableKey) {
|
|
10451
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10452
|
-
const response = await fetch(
|
|
10453
|
-
`${API_BASE_URL}/v1/public/onramps/meld/sessions`,
|
|
10454
|
-
{
|
|
10455
|
-
method: "POST",
|
|
10456
|
-
headers: {
|
|
10457
|
-
accept: "application/json",
|
|
10458
|
-
"x-publishable-key": pk,
|
|
10459
|
-
"Content-Type": "application/json"
|
|
10460
|
-
},
|
|
10461
|
-
body: JSON.stringify(request)
|
|
10462
|
-
}
|
|
10463
|
-
);
|
|
10464
|
-
if (!response.ok) {
|
|
10465
|
-
throw new Error(`Failed to create Meld session: ${response.statusText}`);
|
|
10466
|
-
}
|
|
10467
|
-
return response.json();
|
|
10468
|
-
}
|
|
10469
|
-
function getPreferredIconUrl(iconUrls, preferredFormat = "svg") {
|
|
10470
|
-
if (!iconUrls || iconUrls.length === 0) {
|
|
10471
|
-
return void 0;
|
|
10472
|
-
}
|
|
10473
|
-
const preferred = iconUrls.find((icon) => icon.format === preferredFormat);
|
|
10474
|
-
if (preferred) {
|
|
10475
|
-
return preferred.url;
|
|
10476
|
-
}
|
|
10477
|
-
return iconUrls[0]?.url;
|
|
10478
|
-
}
|
|
10479
|
-
async function getFiatCurrencies(publishableKey) {
|
|
10480
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10481
|
-
const response = await fetch(
|
|
10482
|
-
`${API_BASE_URL}/v1/public/onramps/fiat_currencies`,
|
|
10483
|
-
{
|
|
10484
|
-
method: "GET",
|
|
10485
|
-
headers: {
|
|
10486
|
-
accept: "application/json",
|
|
10487
|
-
"x-publishable-key": pk
|
|
10488
|
-
}
|
|
10489
|
-
}
|
|
10490
|
-
);
|
|
10491
|
-
if (!response.ok) {
|
|
10492
|
-
throw new Error(`Failed to fetch fiat currencies: ${response.statusText}`);
|
|
10493
|
-
}
|
|
10494
|
-
return response.json();
|
|
10495
|
-
}
|
|
10496
|
-
async function getProjectConfig(publishableKey) {
|
|
10497
|
-
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
10498
|
-
const response = await fetch(`${API_BASE_URL}/v1/public/projects/config`, {
|
|
10499
|
-
method: "GET",
|
|
10500
|
-
headers: {
|
|
10501
|
-
accept: "application/json",
|
|
10502
|
-
"x-publishable-key": pk
|
|
10503
|
-
}
|
|
10504
|
-
});
|
|
10505
|
-
if (!response.ok) {
|
|
10506
|
-
throw new Error(`Failed to fetch project config: ${response.statusText}`);
|
|
10507
|
-
}
|
|
10508
|
-
return response.json();
|
|
10509
|
-
}
|
|
10510
10545
|
function DepositExecutionItem({
|
|
10511
10546
|
execution,
|
|
10512
10547
|
onClick
|
|
10513
10548
|
}) {
|
|
10514
|
-
const isPending = execution.status ===
|
|
10549
|
+
const isPending = execution.status === ExecutionStatus.PENDING || execution.status === ExecutionStatus.WAITING || execution.status === ExecutionStatus.DELAYED;
|
|
10515
10550
|
const formatDateTime = (timestamp) => {
|
|
10516
10551
|
try {
|
|
10517
10552
|
const date = new Date(timestamp);
|
|
@@ -10578,7 +10613,7 @@ function DepositExecutionItem({
|
|
|
10578
10613
|
}
|
|
10579
10614
|
)
|
|
10580
10615
|
}
|
|
10581
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-bg-
|
|
10616
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "uf-absolute -uf-bottom-0.5 -uf-right-0.5 uf-bg-green-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", className: "uf-block", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
10582
10617
|
"path",
|
|
10583
10618
|
{
|
|
10584
10619
|
d: "M10 3L4.5 8.5L2 6",
|
|
@@ -10590,7 +10625,7 @@ function DepositExecutionItem({
|
|
|
10590
10625
|
) }) })
|
|
10591
10626
|
] }),
|
|
10592
10627
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
10593
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-leading-tight", children: isPending ? "Deposit
|
|
10628
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-leading-tight", children: isPending ? "Deposit processing" : "Deposit completed" }),
|
|
10594
10629
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "uf-text-muted-foreground uf-text-xs uf-leading-tight", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
10595
10630
|
] }),
|
|
10596
10631
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "uf-text-foreground uf-font-medium uf-text-sm uf-flex-shrink-0", children: formatUsdAmount(execution.source_amount_base_unit) }),
|
|
@@ -10599,27 +10634,24 @@ function DepositExecutionItem({
|
|
|
10599
10634
|
}
|
|
10600
10635
|
);
|
|
10601
10636
|
}
|
|
10602
|
-
|
|
10603
|
-
|
|
10604
|
-
|
|
10605
|
-
|
|
10606
|
-
|
|
10607
|
-
|
|
10608
|
-
|
|
10609
|
-
|
|
10610
|
-
|
|
10611
|
-
|
|
10612
|
-
|
|
10613
|
-
|
|
10614
|
-
|
|
10615
|
-
|
|
10616
|
-
|
|
10617
|
-
|
|
10618
|
-
execution
|
|
10619
|
-
|
|
10620
|
-
}) {
|
|
10621
|
-
if (!execution) return null;
|
|
10622
|
-
const isPending = execution.status === "pending" || execution.status === "waiting" || execution.status === "delayed";
|
|
10637
|
+
function formatCurrency(currency) {
|
|
10638
|
+
if (!currency) return "";
|
|
10639
|
+
const dotIndex = currency.indexOf(".");
|
|
10640
|
+
if (dotIndex === -1) {
|
|
10641
|
+
return currency.toUpperCase();
|
|
10642
|
+
}
|
|
10643
|
+
return currency.slice(0, dotIndex).toUpperCase() + currency.slice(dotIndex);
|
|
10644
|
+
}
|
|
10645
|
+
function DepositDetailContent({ execution }) {
|
|
10646
|
+
const [chains, setChains] = (0, import_react11.useState)([]);
|
|
10647
|
+
const [showNetworkDetails, setShowNetworkDetails] = (0, import_react11.useState)(false);
|
|
10648
|
+
(0, import_react11.useEffect)(() => {
|
|
10649
|
+
getTokenChains().then((response) => setChains(response.data)).catch((err) => console.error("Failed to fetch chains:", err));
|
|
10650
|
+
}, []);
|
|
10651
|
+
(0, import_react11.useEffect)(() => {
|
|
10652
|
+
setShowNetworkDetails(false);
|
|
10653
|
+
}, [execution?.id]);
|
|
10654
|
+
const isPending = execution.status === ExecutionStatus.PENDING || execution.status === ExecutionStatus.WAITING || execution.status === ExecutionStatus.DELAYED;
|
|
10623
10655
|
const formatDateTime = (timestamp) => {
|
|
10624
10656
|
try {
|
|
10625
10657
|
const date = new Date(timestamp);
|
|
@@ -10674,161 +10706,153 @@ function DepositDetailModal({
|
|
|
10674
10706
|
return "$0.00";
|
|
10675
10707
|
};
|
|
10676
10708
|
const getNetworkName = (chainType, chainId) => {
|
|
10677
|
-
return
|
|
10709
|
+
return getChainName(chains, chainType, chainId);
|
|
10678
10710
|
};
|
|
10679
|
-
const
|
|
10680
|
-
return
|
|
10711
|
+
const formatTransactionHash = (hash) => {
|
|
10712
|
+
if (!hash || hash.length < 12) return hash;
|
|
10713
|
+
return `${hash.slice(0, 12)}...${hash.slice(-4)}`;
|
|
10681
10714
|
};
|
|
10682
|
-
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
|
|
10686
|
-
|
|
10687
|
-
|
|
10688
|
-
|
|
10689
|
-
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
|
|
10700
|
-
|
|
10701
|
-
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
|
-
|
|
10705
|
-
}
|
|
10706
|
-
),
|
|
10707
|
-
isPending ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-yellow-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10708
|
-
"svg",
|
|
10709
|
-
{
|
|
10710
|
-
width: "16",
|
|
10711
|
-
height: "16",
|
|
10712
|
-
viewBox: "0 0 12 12",
|
|
10713
|
-
fill: "none",
|
|
10714
|
-
className: "uf-animate-spin uf-block",
|
|
10715
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10716
|
-
"path",
|
|
10717
|
-
{
|
|
10718
|
-
d: "M6 1V3M6 9V11M1 6H3M9 6H11M2.5 2.5L4 4M8 8L9.5 9.5M2.5 9.5L4 8M8 4L9.5 2.5",
|
|
10719
|
-
stroke: "white",
|
|
10720
|
-
strokeWidth: "2",
|
|
10721
|
-
strokeLinecap: "round"
|
|
10722
|
-
}
|
|
10723
|
-
)
|
|
10724
|
-
}
|
|
10725
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-blue-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10726
|
-
"svg",
|
|
10727
|
-
{
|
|
10728
|
-
width: "16",
|
|
10729
|
-
height: "16",
|
|
10730
|
-
viewBox: "0 0 12 12",
|
|
10731
|
-
fill: "none",
|
|
10732
|
-
className: "uf-block",
|
|
10733
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10734
|
-
"path",
|
|
10735
|
-
{
|
|
10736
|
-
d: "M10 3L4.5 8.5L2 6",
|
|
10737
|
-
stroke: "white",
|
|
10738
|
-
strokeWidth: "2",
|
|
10739
|
-
strokeLinecap: "round",
|
|
10740
|
-
strokeLinejoin: "round"
|
|
10741
|
-
}
|
|
10742
|
-
)
|
|
10743
|
-
}
|
|
10744
|
-
) })
|
|
10745
|
-
] }),
|
|
10746
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mb-1", children: [
|
|
10747
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10748
|
-
"div",
|
|
10749
|
-
{
|
|
10750
|
-
className: `uf-w-2 uf-h-2 uf-rounded-full ${isPending ? "uf-bg-yellow-500" : "uf-bg-green-500"}`
|
|
10751
|
-
}
|
|
10752
|
-
),
|
|
10753
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: isPending ? "Pending" : "Completed" })
|
|
10754
|
-
] }),
|
|
10755
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
10756
|
-
] }),
|
|
10757
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-3", children: [
|
|
10758
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10759
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Sent" }),
|
|
10760
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
10761
|
-
formatAmount(execution.source_amount_base_unit),
|
|
10762
|
-
" ",
|
|
10763
|
-
getSourceTokenSymbol()
|
|
10764
|
-
] })
|
|
10765
|
-
] }),
|
|
10766
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10767
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Received" }),
|
|
10768
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
10769
|
-
formatAmount(execution.destination_amount_base_unit),
|
|
10770
|
-
" ",
|
|
10771
|
-
getDestinationTokenSymbol()
|
|
10772
|
-
] })
|
|
10773
|
-
] }),
|
|
10774
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
10775
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "USD Value" }),
|
|
10776
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: formatUsdAmount(execution.source_amount_usd, execution.source_amount_base_unit) })
|
|
10777
|
-
] })
|
|
10778
|
-
] }),
|
|
10779
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-4", children: [
|
|
10780
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10781
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Source Network" }),
|
|
10782
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.source_chain_type, execution.source_chain_id) })
|
|
10783
|
-
] }),
|
|
10784
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
10785
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Destination Network" }),
|
|
10786
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.destination_chain_type, execution.destination_chain_id) })
|
|
10787
|
-
] })
|
|
10788
|
-
] }),
|
|
10789
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-space-y-2", children: [
|
|
10790
|
-
execution.explorer_url && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
10791
|
-
"a",
|
|
10715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-px-2", children: [
|
|
10716
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-py-6", children: [
|
|
10717
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-relative uf-mb-3", children: [
|
|
10718
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10719
|
+
"img",
|
|
10720
|
+
{
|
|
10721
|
+
src: execution.destination_token_metadata?.icon_url || getIconUrl("/icons/tokens/svg/usdc.svg"),
|
|
10722
|
+
alt: "Token",
|
|
10723
|
+
width: 64,
|
|
10724
|
+
height: 64,
|
|
10725
|
+
className: "uf-rounded-full"
|
|
10726
|
+
}
|
|
10727
|
+
),
|
|
10728
|
+
isPending ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-yellow-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10729
|
+
"svg",
|
|
10730
|
+
{
|
|
10731
|
+
width: "16",
|
|
10732
|
+
height: "16",
|
|
10733
|
+
viewBox: "0 0 24 24",
|
|
10734
|
+
fill: "none",
|
|
10735
|
+
className: "uf-animate-spin uf-block",
|
|
10736
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10737
|
+
"path",
|
|
10792
10738
|
{
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
children: [
|
|
10798
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
10799
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ArrowDownCircle, { className: "uf-w-5 uf-h-5" }),
|
|
10800
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-font-medium", children: "View Deposit Transaction" })
|
|
10801
|
-
] }),
|
|
10802
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ExternalLink, { className: "uf-w-4 uf-h-4" })
|
|
10803
|
-
]
|
|
10739
|
+
d: "M21 12a9 9 0 1 1-6.22-8.56",
|
|
10740
|
+
stroke: "white",
|
|
10741
|
+
strokeWidth: "3",
|
|
10742
|
+
strokeLinecap: "round"
|
|
10804
10743
|
}
|
|
10805
|
-
)
|
|
10806
|
-
|
|
10807
|
-
|
|
10744
|
+
)
|
|
10745
|
+
}
|
|
10746
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-absolute -uf-bottom-1 -uf-right-1 uf-bg-green-500 uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10747
|
+
"svg",
|
|
10748
|
+
{
|
|
10749
|
+
width: "16",
|
|
10750
|
+
height: "16",
|
|
10751
|
+
viewBox: "0 0 12 12",
|
|
10752
|
+
fill: "none",
|
|
10753
|
+
className: "uf-block",
|
|
10754
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10755
|
+
"path",
|
|
10808
10756
|
{
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
10815
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CheckCircle, { className: "uf-w-5 uf-h-5" }),
|
|
10816
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-font-medium", children: "View Completion Transaction" })
|
|
10817
|
-
] }),
|
|
10818
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ExternalLink, { className: "uf-w-4 uf-h-4" })
|
|
10819
|
-
]
|
|
10757
|
+
d: "M10 3L4.5 8.5L2 6",
|
|
10758
|
+
stroke: "white",
|
|
10759
|
+
strokeWidth: "2",
|
|
10760
|
+
strokeLinecap: "round",
|
|
10761
|
+
strokeLinejoin: "round"
|
|
10820
10762
|
}
|
|
10821
10763
|
)
|
|
10822
|
-
|
|
10823
|
-
|
|
10764
|
+
}
|
|
10765
|
+
) })
|
|
10766
|
+
] }),
|
|
10767
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mb-1", children: [
|
|
10768
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10769
|
+
"div",
|
|
10770
|
+
{
|
|
10771
|
+
className: `uf-w-2 uf-h-2 uf-rounded-full ${isPending ? "uf-bg-yellow-500" : "uf-bg-green-500"}`
|
|
10772
|
+
}
|
|
10773
|
+
),
|
|
10774
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: isPending ? "Processing" : "Completed" })
|
|
10775
|
+
] }),
|
|
10776
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: formatDateTime(execution.created_at || (/* @__PURE__ */ new Date()).toISOString()) })
|
|
10777
|
+
] }),
|
|
10778
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-3", children: [
|
|
10779
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10780
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Sent" }),
|
|
10781
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
10782
|
+
formatAmount(execution.source_amount_base_unit),
|
|
10783
|
+
" ",
|
|
10784
|
+
formatCurrency(execution.source_currency)
|
|
10824
10785
|
] })
|
|
10825
|
-
]
|
|
10826
|
-
|
|
10827
|
-
|
|
10786
|
+
] }),
|
|
10787
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10788
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Amount Received" }),
|
|
10789
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "uf-text-foreground uf-font-medium", children: [
|
|
10790
|
+
formatAmount(execution.destination_amount_base_unit),
|
|
10791
|
+
" ",
|
|
10792
|
+
formatCurrency(execution.destination_currency)
|
|
10793
|
+
] })
|
|
10794
|
+
] }),
|
|
10795
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10796
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "USD Value" }),
|
|
10797
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: formatUsdAmount(execution.source_amount_usd, execution.source_amount_base_unit) })
|
|
10798
|
+
] }),
|
|
10799
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3 uf-border-b uf-border-border/50", children: [
|
|
10800
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Source Network" }),
|
|
10801
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.source_chain_type, execution.source_chain_id) })
|
|
10802
|
+
] }),
|
|
10803
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-flex uf-justify-between uf-items-center uf-px-4 uf-py-3", children: [
|
|
10804
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-muted-foreground uf-text-sm", children: "Destination Network" }),
|
|
10805
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "uf-text-foreground uf-font-medium", children: getNetworkName(execution.destination_chain_type, execution.destination_chain_id) })
|
|
10806
|
+
] })
|
|
10807
|
+
] }),
|
|
10808
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
10809
|
+
"button",
|
|
10810
|
+
{
|
|
10811
|
+
type: "button",
|
|
10812
|
+
onClick: () => setShowNetworkDetails(!showNetworkDetails),
|
|
10813
|
+
className: "uf-flex uf-justify-between uf-items-center uf-w-full uf-px-3 uf-pb-3 uf-text-muted-foreground uf-text-sm hover:uf-text-foreground uf-transition-colors",
|
|
10814
|
+
children: [
|
|
10815
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: showNetworkDetails ? "See less" : "See more details" }),
|
|
10816
|
+
showNetworkDetails ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChevronUp, { className: "uf-w-4 uf-h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChevronDown, { className: "uf-w-4 uf-h-4" })
|
|
10817
|
+
]
|
|
10818
|
+
}
|
|
10819
|
+
),
|
|
10820
|
+
showNetworkDetails && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-overflow-hidden uf-mb-4", children: [
|
|
10821
|
+
execution.transaction_hash && execution.explorer_url && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
10822
|
+
"a",
|
|
10823
|
+
{
|
|
10824
|
+
href: execution.explorer_url,
|
|
10825
|
+
target: "_blank",
|
|
10826
|
+
rel: "noopener noreferrer",
|
|
10827
|
+
className: "uf-grid uf-grid-cols-[auto_1fr_auto] uf-items-center uf-gap-2 uf-px-4 uf-py-3 uf-border-b uf-border-border/50 hover:uf-bg-card/50 uf-transition-colors",
|
|
10828
|
+
children: [
|
|
10829
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-muted-foreground uf-text-sm", children: "Deposit Tx" }),
|
|
10830
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-sm uf-text-foreground uf-text-right", children: formatTransactionHash(execution.transaction_hash) }),
|
|
10831
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ExternalLink, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground uf-block" })
|
|
10832
|
+
]
|
|
10833
|
+
}
|
|
10834
|
+
),
|
|
10835
|
+
!isPending && execution.destination_transaction_hashes?.length > 0 && execution.destination_explorer_url && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
10836
|
+
"a",
|
|
10837
|
+
{
|
|
10838
|
+
href: execution.destination_explorer_url,
|
|
10839
|
+
target: "_blank",
|
|
10840
|
+
rel: "noopener noreferrer",
|
|
10841
|
+
className: "uf-grid uf-grid-cols-[auto_1fr_auto] uf-items-center uf-gap-2 uf-px-4 uf-py-3 hover:uf-bg-card/50 uf-transition-colors",
|
|
10842
|
+
children: [
|
|
10843
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-muted-foreground uf-text-sm", children: "Completion Tx" }),
|
|
10844
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "uf-text-sm uf-text-foreground uf-text-right", children: formatTransactionHash(execution.destination_transaction_hashes[0]) }),
|
|
10845
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ExternalLink, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground uf-block" })
|
|
10846
|
+
]
|
|
10847
|
+
}
|
|
10848
|
+
)
|
|
10849
|
+
] })
|
|
10850
|
+
] });
|
|
10828
10851
|
}
|
|
10829
10852
|
function DepositsModal({
|
|
10830
10853
|
open,
|
|
10831
10854
|
onOpenChange,
|
|
10855
|
+
onCloseAll,
|
|
10832
10856
|
executions: sessionExecutions,
|
|
10833
10857
|
userId,
|
|
10834
10858
|
publishableKey,
|
|
@@ -10836,7 +10860,6 @@ function DepositsModal({
|
|
|
10836
10860
|
}) {
|
|
10837
10861
|
const [allExecutions, setAllExecutions] = (0, import_react10.useState)(sessionExecutions);
|
|
10838
10862
|
const [selectedExecution, setSelectedExecution] = (0, import_react10.useState)(null);
|
|
10839
|
-
const [detailModalOpen, setDetailModalOpen] = (0, import_react10.useState)(false);
|
|
10840
10863
|
(0, import_react10.useEffect)(() => {
|
|
10841
10864
|
if (!open || !userId) return;
|
|
10842
10865
|
const fetchExecutions = async () => {
|
|
@@ -10859,35 +10882,55 @@ function DepositsModal({
|
|
|
10859
10882
|
clearInterval(pollInterval);
|
|
10860
10883
|
};
|
|
10861
10884
|
}, [open, userId, publishableKey, sessionExecutions]);
|
|
10885
|
+
(0, import_react10.useEffect)(() => {
|
|
10886
|
+
if (!open) {
|
|
10887
|
+
setSelectedExecution(null);
|
|
10888
|
+
}
|
|
10889
|
+
}, [open]);
|
|
10890
|
+
const handleBack = () => {
|
|
10891
|
+
if (selectedExecution) {
|
|
10892
|
+
setSelectedExecution(null);
|
|
10893
|
+
} else {
|
|
10894
|
+
onOpenChange(false);
|
|
10895
|
+
}
|
|
10896
|
+
};
|
|
10862
10897
|
const handleClose = () => {
|
|
10863
10898
|
onOpenChange(false);
|
|
10899
|
+
onCloseAll?.();
|
|
10864
10900
|
};
|
|
10865
10901
|
const handleExecutionClick = (execution) => {
|
|
10866
10902
|
setSelectedExecution(execution);
|
|
10867
|
-
setDetailModalOpen(true);
|
|
10868
10903
|
};
|
|
10869
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
10870
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogContent2, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: [
|
|
10871
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DepositHeader, { title: "Deposit Tracker", onClose: handleClose }),
|
|
10872
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uf-max-h-[500px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden uf-pb-4", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uf-space-y-2", children: allExecutions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uf-py-8 uf-px-4 uf-text-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uf-text-muted-foreground uf-text-sm", children: "No deposits yet" }) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children: allExecutions.map((execution) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
10873
|
-
DepositExecutionItem,
|
|
10874
|
-
{
|
|
10875
|
-
execution,
|
|
10876
|
-
onClick: () => handleExecutionClick(execution)
|
|
10877
|
-
},
|
|
10878
|
-
execution.id
|
|
10879
|
-
)) }) }) })
|
|
10880
|
-
] }) }),
|
|
10904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogContent2, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: selectedExecution ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
10881
10905
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
10882
|
-
|
|
10906
|
+
DepositHeader,
|
|
10883
10907
|
{
|
|
10884
|
-
|
|
10885
|
-
|
|
10886
|
-
|
|
10887
|
-
|
|
10908
|
+
title: "Deposit Details",
|
|
10909
|
+
showBack: true,
|
|
10910
|
+
onBack: () => setSelectedExecution(null),
|
|
10911
|
+
onClose: handleClose
|
|
10888
10912
|
}
|
|
10889
|
-
)
|
|
10890
|
-
|
|
10913
|
+
),
|
|
10914
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DepositDetailContent, { execution: selectedExecution })
|
|
10915
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
10916
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
10917
|
+
DepositHeader,
|
|
10918
|
+
{
|
|
10919
|
+
title: "Deposit Tracker",
|
|
10920
|
+
showBack: true,
|
|
10921
|
+
onBack: handleBack,
|
|
10922
|
+
onClose: handleClose
|
|
10923
|
+
}
|
|
10924
|
+
),
|
|
10925
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uf-max-h-[400px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uf-space-y-2", children: allExecutions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uf-py-8 uf-px-4 uf-text-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "uf-text-muted-foreground uf-text-sm", children: "No deposits yet" }) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children: allExecutions.map((execution) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
10926
|
+
DepositExecutionItem,
|
|
10927
|
+
{
|
|
10928
|
+
execution,
|
|
10929
|
+
onClick: () => handleExecutionClick(execution)
|
|
10930
|
+
},
|
|
10931
|
+
execution.id
|
|
10932
|
+
)) }) }) })
|
|
10933
|
+
] }) }) });
|
|
10891
10934
|
}
|
|
10892
10935
|
function DepositSuccessToast({
|
|
10893
10936
|
depositTx,
|
|
@@ -10895,9 +10938,12 @@ function DepositSuccessToast({
|
|
|
10895
10938
|
status,
|
|
10896
10939
|
tokenIconUrl,
|
|
10897
10940
|
sourceAmountBaseUnit = "0",
|
|
10898
|
-
onClose
|
|
10941
|
+
onClose,
|
|
10942
|
+
execution
|
|
10899
10943
|
}) {
|
|
10900
|
-
const
|
|
10944
|
+
const [detailModalOpen, setDetailModalOpen] = (0, import_react12.useState)(false);
|
|
10945
|
+
const { themeClass } = useTheme();
|
|
10946
|
+
const isPending = status === ExecutionStatus.PENDING || status === ExecutionStatus.WAITING || status === ExecutionStatus.DELAYED;
|
|
10901
10947
|
const formatDateTime = (timestamp) => {
|
|
10902
10948
|
try {
|
|
10903
10949
|
const date = new Date(timestamp);
|
|
@@ -10929,61 +10975,124 @@ function DepositSuccessToast({
|
|
|
10929
10975
|
return "$0.00";
|
|
10930
10976
|
}
|
|
10931
10977
|
};
|
|
10932
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.
|
|
10933
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.
|
|
10934
|
-
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
|
|
10939
|
-
|
|
10940
|
-
|
|
10941
|
-
className: "uf-rounded-full"
|
|
10942
|
-
}
|
|
10943
|
-
),
|
|
10944
|
-
isPending ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-bg-yellow-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
10978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
10979
|
+
isPending && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("style", { children: `
|
|
10980
|
+
@keyframes border-travel {
|
|
10981
|
+
from { stroke-dashoffset: 0; }
|
|
10982
|
+
to { stroke-dashoffset: -1000; }
|
|
10983
|
+
}
|
|
10984
|
+
` }),
|
|
10985
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-w-full uf-animate-in uf-slide-in-from-bottom-2 uf-duration-300", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-relative uf-rounded-xl", children: [
|
|
10986
|
+
isPending && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
10945
10987
|
"svg",
|
|
10946
10988
|
{
|
|
10947
|
-
|
|
10948
|
-
|
|
10949
|
-
viewBox: "0 0 12 12",
|
|
10950
|
-
fill: "none",
|
|
10951
|
-
className: "uf-animate-spin",
|
|
10989
|
+
className: "uf-absolute uf-inset-0 uf-w-full uf-h-full uf-pointer-events-none uf-z-[1]",
|
|
10990
|
+
style: { overflow: "visible" },
|
|
10952
10991
|
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
10953
|
-
"
|
|
10992
|
+
"rect",
|
|
10954
10993
|
{
|
|
10955
|
-
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
10994
|
+
x: "5",
|
|
10995
|
+
y: "2",
|
|
10996
|
+
rx: "10",
|
|
10997
|
+
ry: "10",
|
|
10998
|
+
fill: "none",
|
|
10999
|
+
stroke: "#ecc94b",
|
|
11000
|
+
strokeWidth: "3",
|
|
11001
|
+
strokeDasharray: "120 880",
|
|
11002
|
+
strokeLinecap: "round",
|
|
11003
|
+
pathLength: "1000",
|
|
11004
|
+
style: {
|
|
11005
|
+
width: "calc(100% - 10px)",
|
|
11006
|
+
height: "calc(100% - 4px)",
|
|
11007
|
+
animation: "border-travel 2.5s linear infinite"
|
|
11008
|
+
}
|
|
10959
11009
|
}
|
|
10960
11010
|
)
|
|
10961
11011
|
}
|
|
10962
|
-
)
|
|
10963
|
-
|
|
11012
|
+
),
|
|
11013
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
11014
|
+
"div",
|
|
10964
11015
|
{
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
|
|
11016
|
+
onClick: () => execution && setDetailModalOpen(true),
|
|
11017
|
+
className: `uf-relative uf-bg-white dark:uf-bg-black hover:uf-opacity-90 uf-rounded-xl uf-p-3 uf-mx-1 uf-flex uf-items-center uf-gap-3 uf-transition-all uf-cursor-pointer ${isPending ? "" : "uf-border uf-border-zinc-300 dark:uf-border-zinc-700"}`,
|
|
11018
|
+
children: [
|
|
11019
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-relative uf-flex-shrink-0", children: [
|
|
11020
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
11021
|
+
"img",
|
|
11022
|
+
{
|
|
11023
|
+
src: tokenIconUrl || getIconUrl("/icons/tokens/svg/usdc.svg"),
|
|
11024
|
+
alt: "Token",
|
|
11025
|
+
width: 36,
|
|
11026
|
+
height: 36,
|
|
11027
|
+
className: "uf-rounded-full"
|
|
11028
|
+
}
|
|
11029
|
+
),
|
|
11030
|
+
isPending ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-bg-yellow-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
11031
|
+
"svg",
|
|
11032
|
+
{
|
|
11033
|
+
width: "10",
|
|
11034
|
+
height: "10",
|
|
11035
|
+
viewBox: "0 0 24 24",
|
|
11036
|
+
fill: "none",
|
|
11037
|
+
className: "uf-animate-spin",
|
|
11038
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
11039
|
+
"path",
|
|
11040
|
+
{
|
|
11041
|
+
d: "M21 12a9 9 0 1 1-6.22-8.56",
|
|
11042
|
+
stroke: "white",
|
|
11043
|
+
strokeWidth: "3",
|
|
11044
|
+
strokeLinecap: "round"
|
|
11045
|
+
}
|
|
11046
|
+
)
|
|
11047
|
+
}
|
|
11048
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-absolute uf--bottom-0.5 uf--right-0.5 uf-bg-green-500 uf-rounded-full uf-p-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
11049
|
+
"path",
|
|
11050
|
+
{
|
|
11051
|
+
d: "M10 3L4.5 8.5L2 6",
|
|
11052
|
+
stroke: "white",
|
|
11053
|
+
strokeWidth: "2",
|
|
11054
|
+
strokeLinecap: "round",
|
|
11055
|
+
strokeLinejoin: "round"
|
|
11056
|
+
}
|
|
11057
|
+
) }) })
|
|
11058
|
+
] }),
|
|
11059
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
11060
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h3", { className: "uf-text-black dark:uf-text-white uf-font-medium uf-text-sm", children: isPending ? "Deposit processing" : "Deposit completed" }),
|
|
11061
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "uf-text-zinc-600 dark:uf-text-zinc-400 uf-text-xs", children: formatDateTime(orderSubmittedAt) })
|
|
11062
|
+
] }),
|
|
11063
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-text-black dark:uf-text-white uf-font-medium uf-text-sm uf-flex-shrink-0", children: formatUsdAmount(sourceAmountBaseUnit) }),
|
|
11064
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
11065
|
+
"button",
|
|
11066
|
+
{
|
|
11067
|
+
onClick: (e) => {
|
|
11068
|
+
e.stopPropagation();
|
|
11069
|
+
onClose();
|
|
11070
|
+
},
|
|
11071
|
+
className: "uf-text-zinc-600 dark:uf-text-zinc-400 hover:uf-text-black dark:hover:uf-text-white uf-transition-colors uf-p-0.5 uf-flex-shrink-0",
|
|
11072
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(X, { className: "uf-w-4 uf-h-4" })
|
|
11073
|
+
}
|
|
11074
|
+
)
|
|
11075
|
+
]
|
|
10970
11076
|
}
|
|
10971
|
-
)
|
|
10972
|
-
] }),
|
|
10973
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
10974
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.
|
|
10975
|
-
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
11077
|
+
)
|
|
11078
|
+
] }) }),
|
|
11079
|
+
execution && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Dialog2, { open: detailModalOpen, onOpenChange: setDetailModalOpen, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DialogContent2, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-mt-8 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: [
|
|
11080
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-px-4", children: [
|
|
11081
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "uf-w-8" }),
|
|
11082
|
+
" ",
|
|
11083
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "uf-text-lg uf-font-semibold uf-text-foreground", children: "Deposit Details" }),
|
|
11084
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
11085
|
+
"button",
|
|
11086
|
+
{
|
|
11087
|
+
onClick: () => setDetailModalOpen(false),
|
|
11088
|
+
className: "uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-w-8 uf-flex uf-justify-end",
|
|
11089
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(X, { className: "uf-w-5 uf-h-5" })
|
|
11090
|
+
}
|
|
11091
|
+
)
|
|
11092
|
+
] }),
|
|
11093
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DepositDetailContent, { execution })
|
|
11094
|
+
] }) })
|
|
11095
|
+
] });
|
|
10987
11096
|
}
|
|
10988
11097
|
var Select2 = Root23;
|
|
10989
11098
|
var SelectValue2 = Value;
|
|
@@ -11095,51 +11204,12 @@ var SelectSeparator2 = React38.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
11095
11204
|
}
|
|
11096
11205
|
));
|
|
11097
11206
|
SelectSeparator2.displayName = Separator.displayName;
|
|
11098
|
-
var buttonVariants = cva(
|
|
11099
|
-
"uf-inline-flex uf-items-center uf-justify-center uf-whitespace-nowrap uf-rounded-md uf-text-sm uf-font-medium uf-ring-offset-background uf-transition-colors focus-visible:uf-outline-none focus-visible:uf-ring-2 focus-visible:uf-ring-ring focus-visible:uf-ring-offset-2 disabled:uf-pointer-events-none disabled:uf-opacity-50",
|
|
11100
|
-
{
|
|
11101
|
-
variants: {
|
|
11102
|
-
variant: {
|
|
11103
|
-
default: "uf-bg-primary uf-text-primary-foreground hover:uf-bg-primary/90",
|
|
11104
|
-
destructive: "uf-bg-destructive uf-text-destructive-foreground hover:uf-bg-destructive/90",
|
|
11105
|
-
outline: "uf-border uf-border-input uf-bg-background hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
11106
|
-
secondary: "uf-bg-secondary uf-text-secondary-foreground hover:uf-bg-secondary/80",
|
|
11107
|
-
ghost: "hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
11108
|
-
link: "uf-text-primary uf-underline-offset-4 hover:uf-underline"
|
|
11109
|
-
},
|
|
11110
|
-
size: {
|
|
11111
|
-
default: "uf-h-10 uf-px-4 uf-py-2",
|
|
11112
|
-
sm: "uf-h-9 uf-rounded-md uf-px-3",
|
|
11113
|
-
lg: "uf-h-11 uf-rounded-md uf-px-8",
|
|
11114
|
-
icon: "uf-h-10 uf-w-10"
|
|
11115
|
-
}
|
|
11116
|
-
},
|
|
11117
|
-
defaultVariants: {
|
|
11118
|
-
variant: "default",
|
|
11119
|
-
size: "default"
|
|
11120
|
-
}
|
|
11121
|
-
}
|
|
11122
|
-
);
|
|
11123
|
-
var Button = React42.forwardRef(
|
|
11124
|
-
({ className, variant, size: size4, asChild = false, ...props }, ref) => {
|
|
11125
|
-
const Comp = asChild ? Slot3 : "button";
|
|
11126
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
11127
|
-
Comp,
|
|
11128
|
-
{
|
|
11129
|
-
className: cn(buttonVariants({ variant, size: size4, className })),
|
|
11130
|
-
ref,
|
|
11131
|
-
...props
|
|
11132
|
-
}
|
|
11133
|
-
);
|
|
11134
|
-
}
|
|
11135
|
-
);
|
|
11136
|
-
Button.displayName = "Button";
|
|
11137
11207
|
var TooltipProvider2 = Provider;
|
|
11138
11208
|
var Tooltip2 = Root32;
|
|
11139
11209
|
var TooltipTrigger2 = Trigger2;
|
|
11140
|
-
var TooltipContent2 =
|
|
11210
|
+
var TooltipContent2 = React42.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
|
|
11141
11211
|
const { themeClass } = useTheme();
|
|
11142
|
-
return /* @__PURE__ */ (0,
|
|
11212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Portal4, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
11143
11213
|
Content23,
|
|
11144
11214
|
{
|
|
11145
11215
|
ref,
|
|
@@ -11218,8 +11288,8 @@ var en_default = {
|
|
|
11218
11288
|
}
|
|
11219
11289
|
}
|
|
11220
11290
|
};
|
|
11221
|
-
var
|
|
11222
|
-
var t =
|
|
11291
|
+
var i18n2 = en_default;
|
|
11292
|
+
var t = i18n2.transferCrypto;
|
|
11223
11293
|
var getChainKey = (chainId, chainType) => {
|
|
11224
11294
|
return `${chainType}:${chainId}`;
|
|
11225
11295
|
};
|
|
@@ -11234,7 +11304,6 @@ function TransferCryptoBase({
|
|
|
11234
11304
|
destinationChainType,
|
|
11235
11305
|
destinationChainId,
|
|
11236
11306
|
destinationTokenAddress,
|
|
11237
|
-
copyButtonMode = "compact",
|
|
11238
11307
|
layoutVariant = "horizontal",
|
|
11239
11308
|
showDetailedDropdowns = false,
|
|
11240
11309
|
onExecutionsChange,
|
|
@@ -11317,15 +11386,19 @@ function TransferCryptoBase({
|
|
|
11317
11386
|
setLoading(false);
|
|
11318
11387
|
return;
|
|
11319
11388
|
}
|
|
11389
|
+
if (internalWallets.length > 0) {
|
|
11390
|
+
setLoading(false);
|
|
11391
|
+
return;
|
|
11392
|
+
}
|
|
11320
11393
|
let retryTimeout = null;
|
|
11321
11394
|
let isCancelled = false;
|
|
11322
11395
|
const fetchWallets = async () => {
|
|
11323
11396
|
if (isCancelled) return;
|
|
11324
11397
|
setLoading(true);
|
|
11325
11398
|
try {
|
|
11326
|
-
const response = await
|
|
11399
|
+
const response = await createDepositAddress(
|
|
11327
11400
|
{
|
|
11328
|
-
|
|
11401
|
+
external_user_id: userId,
|
|
11329
11402
|
recipient_address: recipientAddress,
|
|
11330
11403
|
destination_chain_type: destinationChainType,
|
|
11331
11404
|
destination_chain_id: destinationChainId,
|
|
@@ -11394,12 +11467,11 @@ function TransferCryptoBase({
|
|
|
11394
11467
|
break;
|
|
11395
11468
|
}
|
|
11396
11469
|
const inProgressStatuses = [
|
|
11397
|
-
|
|
11398
|
-
|
|
11399
|
-
|
|
11400
|
-
/* DELAYED */
|
|
11470
|
+
ExecutionStatus.PENDING,
|
|
11471
|
+
ExecutionStatus.WAITING,
|
|
11472
|
+
ExecutionStatus.DELAYED
|
|
11401
11473
|
];
|
|
11402
|
-
if (inProgressStatuses.includes(trackedStatus) && execution.status ===
|
|
11474
|
+
if (inProgressStatuses.includes(trackedStatus) && execution.status === ExecutionStatus.SUCCEEDED) {
|
|
11403
11475
|
executionToShow = execution;
|
|
11404
11476
|
break;
|
|
11405
11477
|
}
|
|
@@ -11422,7 +11494,7 @@ function TransferCryptoBase({
|
|
|
11422
11494
|
return updated;
|
|
11423
11495
|
});
|
|
11424
11496
|
if (onDepositSuccess) {
|
|
11425
|
-
const isCompleted = execution.status ===
|
|
11497
|
+
const isCompleted = execution.status === ExecutionStatus.SUCCEEDED;
|
|
11426
11498
|
if (isCompleted) {
|
|
11427
11499
|
onDepositSuccess({
|
|
11428
11500
|
message: "Deposit completed successfully",
|
|
@@ -11485,8 +11557,8 @@ function TransferCryptoBase({
|
|
|
11485
11557
|
const processingTime = currentChainFromBackend?.estimated_processing_time ?? null;
|
|
11486
11558
|
const minDepositUsd = currentChainFromBackend?.minimum_deposit_amount_usd ?? 3;
|
|
11487
11559
|
const renderTokenItem = (tokenData) => {
|
|
11488
|
-
return /* @__PURE__ */ (0,
|
|
11489
|
-
/* @__PURE__ */ (0,
|
|
11560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11561
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11490
11562
|
"img",
|
|
11491
11563
|
{
|
|
11492
11564
|
src: tokenData.icon_url,
|
|
@@ -11496,13 +11568,13 @@ function TransferCryptoBase({
|
|
|
11496
11568
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
11497
11569
|
}
|
|
11498
11570
|
),
|
|
11499
|
-
/* @__PURE__ */ (0,
|
|
11500
|
-
showDetailedDropdowns && /* @__PURE__ */ (0,
|
|
11571
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-font-normal", children: tokenData.symbol }),
|
|
11572
|
+
showDetailedDropdowns && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-text-muted-foreground", children: tokenData.name })
|
|
11501
11573
|
] });
|
|
11502
11574
|
};
|
|
11503
11575
|
const renderChainItem = (chainData) => {
|
|
11504
|
-
return /* @__PURE__ */ (0,
|
|
11505
|
-
/* @__PURE__ */ (0,
|
|
11576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11577
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11506
11578
|
"img",
|
|
11507
11579
|
{
|
|
11508
11580
|
src: chainData.icon_url,
|
|
@@ -11512,24 +11584,24 @@ function TransferCryptoBase({
|
|
|
11512
11584
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
11513
11585
|
}
|
|
11514
11586
|
),
|
|
11515
|
-
/* @__PURE__ */ (0,
|
|
11516
|
-
showDetailedDropdowns && /* @__PURE__ */ (0,
|
|
11587
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-font-normal", children: chainData.chain_name }),
|
|
11588
|
+
showDetailedDropdowns && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-text-muted-foreground uf-capitalize", children: chainData.chain_type })
|
|
11517
11589
|
] });
|
|
11518
11590
|
};
|
|
11519
11591
|
const selectContainerClass = layoutVariant === "horizontal" ? "uf-grid uf-grid-cols-2 uf-gap-2.5" : "uf-space-y-3";
|
|
11520
|
-
return /* @__PURE__ */ (0,
|
|
11521
|
-
/* @__PURE__ */ (0,
|
|
11522
|
-
/* @__PURE__ */ (0,
|
|
11523
|
-
/* @__PURE__ */ (0,
|
|
11524
|
-
/* @__PURE__ */ (0,
|
|
11592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipProvider2, { delayDuration: 0, skipDelayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-space-y-3", children: [
|
|
11593
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: selectContainerClass, children: [
|
|
11594
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { children: [
|
|
11595
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: t.supportedToken }),
|
|
11596
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
11525
11597
|
Select2,
|
|
11526
11598
|
{
|
|
11527
11599
|
value: token,
|
|
11528
11600
|
onValueChange: setToken,
|
|
11529
11601
|
disabled: tokensLoading || supportedTokens.length === 0,
|
|
11530
11602
|
children: [
|
|
11531
|
-
/* @__PURE__ */ (0,
|
|
11532
|
-
/* @__PURE__ */ (0,
|
|
11603
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectTrigger2, { className: "uf-bg-secondary uf-border-none uf-rounded-lg uf-h-10 hover:uf-bg-accent uf-text-foreground focus:uf-ring-1 focus:uf-ring-ring disabled:uf-opacity-50", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectValue2, { children: tokensLoading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t.loading }) }) : selectedToken ? renderTokenItem(selectedToken) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-font-normal", children: token }) }) }) }),
|
|
11604
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectContent2, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: supportedTokens.map((tokenData) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11533
11605
|
SelectItem2,
|
|
11534
11606
|
{
|
|
11535
11607
|
value: tokenData.symbol,
|
|
@@ -11542,51 +11614,51 @@ function TransferCryptoBase({
|
|
|
11542
11614
|
}
|
|
11543
11615
|
)
|
|
11544
11616
|
] }),
|
|
11545
|
-
/* @__PURE__ */ (0,
|
|
11546
|
-
/* @__PURE__ */ (0,
|
|
11617
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { children: [
|
|
11618
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-gap-1", children: [
|
|
11547
11619
|
t.supportedChain,
|
|
11548
|
-
/* @__PURE__ */ (0,
|
|
11620
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "uf-text-[10px]", children: [
|
|
11549
11621
|
"$",
|
|
11550
11622
|
minDepositUsd,
|
|
11551
11623
|
" ",
|
|
11552
11624
|
t.minDeposit.label
|
|
11553
11625
|
] }),
|
|
11554
|
-
/* @__PURE__ */ (0,
|
|
11555
|
-
/* @__PURE__ */ (0,
|
|
11626
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tooltip2, { children: [
|
|
11627
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11556
11628
|
"span",
|
|
11557
11629
|
{
|
|
11558
11630
|
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
11559
11631
|
tabIndex: 0,
|
|
11560
11632
|
role: "button",
|
|
11561
11633
|
"aria-label": "Minimum deposit information",
|
|
11562
|
-
children: /* @__PURE__ */ (0,
|
|
11634
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Info, { className: "uf-w-3 uf-h-3" })
|
|
11563
11635
|
}
|
|
11564
11636
|
) }),
|
|
11565
|
-
/* @__PURE__ */ (0,
|
|
11637
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11566
11638
|
TooltipContent2,
|
|
11567
11639
|
{
|
|
11568
11640
|
side: "left",
|
|
11569
11641
|
align: "center",
|
|
11570
11642
|
className: "uf-max-w-[200px]",
|
|
11571
|
-
children: /* @__PURE__ */ (0,
|
|
11643
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: t.minDeposit.tooltip })
|
|
11572
11644
|
}
|
|
11573
11645
|
)
|
|
11574
11646
|
] })
|
|
11575
11647
|
] }),
|
|
11576
|
-
/* @__PURE__ */ (0,
|
|
11648
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
11577
11649
|
Select2,
|
|
11578
11650
|
{
|
|
11579
11651
|
value: chain,
|
|
11580
11652
|
onValueChange: setChain,
|
|
11581
11653
|
disabled: tokensLoading || availableChainsForToken.length === 0,
|
|
11582
11654
|
children: [
|
|
11583
|
-
/* @__PURE__ */ (0,
|
|
11584
|
-
/* @__PURE__ */ (0,
|
|
11655
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectTrigger2, { className: "uf-bg-secondary uf-border-none uf-rounded-lg uf-h-10 hover:uf-bg-accent uf-text-foreground focus:uf-ring-1 focus:uf-ring-ring disabled:uf-opacity-50", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectValue2, { children: tokensLoading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: t.loading }) }) : currentChainFromBackend ? renderChainItem(currentChainFromBackend) : currentChainData ? renderChainItem(currentChainData) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-flex uf-items-center uf-gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-xs uf-font-normal", children: chain }) }) }) }),
|
|
11656
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectContent2, { className: "uf-bg-secondary uf-border uf-text-foreground uf-max-h-[300px]", children: availableChainsForToken.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-px-2 uf-py-3 uf-text-xs uf-text-muted-foreground uf-text-center", children: t.noChainsAvailable }) : availableChainsForToken.map((chainData) => {
|
|
11585
11657
|
const chainKey = getChainKey(
|
|
11586
11658
|
chainData.chain_id,
|
|
11587
11659
|
chainData.chain_type
|
|
11588
11660
|
);
|
|
11589
|
-
return /* @__PURE__ */ (0,
|
|
11661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11590
11662
|
SelectItem2,
|
|
11591
11663
|
{
|
|
11592
11664
|
value: chainKey,
|
|
@@ -11601,14 +11673,14 @@ function TransferCryptoBase({
|
|
|
11601
11673
|
)
|
|
11602
11674
|
] })
|
|
11603
11675
|
] }),
|
|
11604
|
-
/* @__PURE__ */ (0,
|
|
11676
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-flex uf-justify-center uf-py-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-bg-card uf-p-4 uf-rounded-2xl uf-shadow-lg uf-border uf-border-border", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11605
11677
|
"div",
|
|
11606
11678
|
{
|
|
11607
11679
|
className: "uf-flex uf-items-center uf-justify-center",
|
|
11608
11680
|
style: { width: 180, height: 180 },
|
|
11609
|
-
children: /* @__PURE__ */ (0,
|
|
11681
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-text-foreground uf-text-sm", children: t.loadingQRCode })
|
|
11610
11682
|
}
|
|
11611
|
-
) : depositAddress ? /* @__PURE__ */ (0,
|
|
11683
|
+
) : depositAddress ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11612
11684
|
StyledQRCode,
|
|
11613
11685
|
{
|
|
11614
11686
|
value: depositAddress,
|
|
@@ -11618,93 +11690,75 @@ function TransferCryptoBase({
|
|
|
11618
11690
|
darkMode: isDarkMode
|
|
11619
11691
|
},
|
|
11620
11692
|
`qr-${depositAddress}-${chain}`
|
|
11621
|
-
) : /* @__PURE__ */ (0,
|
|
11693
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11622
11694
|
"div",
|
|
11623
11695
|
{
|
|
11624
11696
|
className: "uf-flex uf-items-center uf-justify-center",
|
|
11625
11697
|
style: { width: 180, height: 180 },
|
|
11626
|
-
children: /* @__PURE__ */ (0,
|
|
11698
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-text-red-400 uf-text-sm", children: t.noAddressAvailable })
|
|
11627
11699
|
}
|
|
11628
11700
|
) }) }),
|
|
11629
|
-
/* @__PURE__ */ (0,
|
|
11630
|
-
/* @__PURE__ */ (0,
|
|
11631
|
-
/* @__PURE__ */ (0,
|
|
11701
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { children: [
|
|
11702
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-text-xs uf-text-muted-foreground uf-mb-2 uf-flex uf-items-center uf-justify-between", children: [
|
|
11703
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1", children: [
|
|
11632
11704
|
t.depositAddress.label,
|
|
11633
|
-
/* @__PURE__ */ (0,
|
|
11634
|
-
/* @__PURE__ */ (0,
|
|
11705
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tooltip2, { children: [
|
|
11706
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11635
11707
|
"span",
|
|
11636
11708
|
{
|
|
11637
11709
|
className: "uf-inline-flex uf-cursor-pointer uf-transition-colors hover:uf-text-foreground",
|
|
11638
11710
|
tabIndex: 0,
|
|
11639
11711
|
role: "button",
|
|
11640
11712
|
"aria-label": "Deposit address information",
|
|
11641
|
-
children: /* @__PURE__ */ (0,
|
|
11713
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Info, { className: "uf-w-3 uf-h-3" })
|
|
11642
11714
|
}
|
|
11643
11715
|
) }),
|
|
11644
|
-
/* @__PURE__ */ (0,
|
|
11716
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11645
11717
|
TooltipContent2,
|
|
11646
11718
|
{
|
|
11647
11719
|
side: "top",
|
|
11648
11720
|
align: "center",
|
|
11649
11721
|
className: "uf-max-w-[240px]",
|
|
11650
|
-
children: /* @__PURE__ */ (0,
|
|
11722
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: t.depositAddress.tooltip.replace("{{token}}", token) })
|
|
11651
11723
|
}
|
|
11652
11724
|
)
|
|
11653
11725
|
] })
|
|
11654
11726
|
] }),
|
|
11655
|
-
|
|
11656
|
-
"
|
|
11657
|
-
{
|
|
11658
|
-
onClick: handleCopyAddress,
|
|
11659
|
-
disabled: loading || !depositAddress,
|
|
11660
|
-
className: "uf-flex uf-items-center uf-gap-1 uf-text-xs uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
11661
|
-
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
11662
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Check, { className: "uf-w-3 uf-h-3" }),
|
|
11663
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: t.copied })
|
|
11664
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
11665
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Copy, { className: "uf-w-3 uf-h-3" }),
|
|
11666
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: t.copyAddress })
|
|
11667
|
-
] })
|
|
11668
|
-
}
|
|
11669
|
-
)
|
|
11670
|
-
] }),
|
|
11671
|
-
loading ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-muted-foreground uf-animate-pulse", children: t.loading }) : error ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-red-400", children: error }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-font-mono uf-break-all", children: depositAddress || t.noAddressAvailable })
|
|
11672
|
-
] }),
|
|
11673
|
-
copyButtonMode === "fullWidth" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11674
|
-
Button,
|
|
11675
|
-
{
|
|
11676
|
-
onClick: handleCopyAddress,
|
|
11677
|
-
disabled: loading || !depositAddress,
|
|
11678
|
-
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-text-foreground uf-rounded-lg uf-h-9 uf-text-sm uf-font-medium disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
11679
|
-
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
11680
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Check, { className: "uf-w-4 uf-h-4 uf-mr-2" }),
|
|
11727
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: `uf-flex uf-items-center uf-gap-1 uf-text-green-500 uf-transition-opacity uf-duration-200 ${copied ? "uf-opacity-100" : "uf-opacity-0"}`, children: [
|
|
11728
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Check, { className: "uf-w-3 uf-h-3" }),
|
|
11681
11729
|
t.copied
|
|
11682
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
11683
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Copy, { className: "uf-w-4 uf-h-4 uf-mr-2" }),
|
|
11684
|
-
t.copyAddress
|
|
11685
11730
|
] })
|
|
11686
|
-
}
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11731
|
+
] }),
|
|
11732
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-muted-foreground uf-animate-pulse", children: t.loading }) : error ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-bg-secondary uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-text-red-400", children: error }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11733
|
+
"button",
|
|
11734
|
+
{
|
|
11735
|
+
onClick: handleCopyAddress,
|
|
11736
|
+
disabled: !depositAddress,
|
|
11737
|
+
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-rounded-lg uf-px-3 uf-py-2.5 uf-text-xs uf-font-mono uf-break-all uf-text-left uf-transition-colors uf-cursor-pointer disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
11738
|
+
children: depositAddress || t.noAddressAvailable
|
|
11739
|
+
}
|
|
11740
|
+
)
|
|
11741
|
+
] }),
|
|
11742
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-bg-secondary uf-rounded-xl uf-px-3", children: [
|
|
11743
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
11690
11744
|
"button",
|
|
11691
11745
|
{
|
|
11692
11746
|
onClick: () => setDetailsExpanded(!detailsExpanded),
|
|
11693
11747
|
className: "uf-w-full uf-flex uf-items-center uf-justify-between uf-py-2.5",
|
|
11694
11748
|
children: [
|
|
11695
|
-
/* @__PURE__ */ (0,
|
|
11696
|
-
/* @__PURE__ */ (0,
|
|
11697
|
-
/* @__PURE__ */ (0,
|
|
11749
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11750
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DollarSign, { className: "uf-w-3 uf-h-3" }) }),
|
|
11751
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "uf-text-xs", children: [
|
|
11698
11752
|
t.priceImpact.label,
|
|
11699
11753
|
":",
|
|
11700
11754
|
" ",
|
|
11701
|
-
/* @__PURE__ */ (0,
|
|
11755
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "uf-text-foreground", children: [
|
|
11702
11756
|
priceImpact.toFixed(2),
|
|
11703
11757
|
"%"
|
|
11704
11758
|
] })
|
|
11705
11759
|
] }),
|
|
11706
|
-
/* @__PURE__ */ (0,
|
|
11707
|
-
/* @__PURE__ */ (0,
|
|
11760
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tooltip2, { children: [
|
|
11761
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11708
11762
|
"span",
|
|
11709
11763
|
{
|
|
11710
11764
|
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
@@ -11717,75 +11771,75 @@ function TransferCryptoBase({
|
|
|
11717
11771
|
tabIndex: 0,
|
|
11718
11772
|
role: "button",
|
|
11719
11773
|
"aria-label": "Price impact information",
|
|
11720
|
-
children: /* @__PURE__ */ (0,
|
|
11774
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Info, { className: "uf-w-3 uf-h-3" })
|
|
11721
11775
|
}
|
|
11722
11776
|
) }),
|
|
11723
|
-
/* @__PURE__ */ (0,
|
|
11777
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11724
11778
|
TooltipContent2,
|
|
11725
11779
|
{
|
|
11726
11780
|
side: "top",
|
|
11727
11781
|
align: "center",
|
|
11728
11782
|
className: "uf-max-w-[240px]",
|
|
11729
|
-
children: /* @__PURE__ */ (0,
|
|
11783
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: t.priceImpact.tooltip })
|
|
11730
11784
|
}
|
|
11731
11785
|
)
|
|
11732
11786
|
] })
|
|
11733
11787
|
] }),
|
|
11734
|
-
detailsExpanded ? /* @__PURE__ */ (0,
|
|
11788
|
+
detailsExpanded ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ChevronUp, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ChevronDown, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground" })
|
|
11735
11789
|
]
|
|
11736
11790
|
}
|
|
11737
11791
|
),
|
|
11738
|
-
detailsExpanded && /* @__PURE__ */ (0,
|
|
11739
|
-
/* @__PURE__ */ (0,
|
|
11740
|
-
/* @__PURE__ */ (0,
|
|
11741
|
-
/* @__PURE__ */ (0,
|
|
11792
|
+
detailsExpanded && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-pb-3 uf-space-y-2.5", children: [
|
|
11793
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11794
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ShieldCheck, { className: "uf-w-3 uf-h-3" }) }),
|
|
11795
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "uf-text-xs", children: [
|
|
11742
11796
|
t.slippage.label,
|
|
11743
11797
|
":",
|
|
11744
11798
|
" ",
|
|
11745
|
-
/* @__PURE__ */ (0,
|
|
11799
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "uf-text-foreground", children: [
|
|
11746
11800
|
t.slippage.auto,
|
|
11747
11801
|
" \u2022 ",
|
|
11748
11802
|
maxSlippage.toFixed(2),
|
|
11749
11803
|
"%"
|
|
11750
11804
|
] })
|
|
11751
11805
|
] }),
|
|
11752
|
-
/* @__PURE__ */ (0,
|
|
11753
|
-
/* @__PURE__ */ (0,
|
|
11806
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tooltip2, { children: [
|
|
11807
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11754
11808
|
"span",
|
|
11755
11809
|
{
|
|
11756
11810
|
className: "uf-inline-flex uf-cursor-pointer uf-text-muted-foreground uf-transition-colors hover:uf-text-foreground",
|
|
11757
11811
|
tabIndex: 0,
|
|
11758
11812
|
role: "button",
|
|
11759
11813
|
"aria-label": "Slippage information",
|
|
11760
|
-
children: /* @__PURE__ */ (0,
|
|
11814
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Info, { className: "uf-w-3 uf-h-3" })
|
|
11761
11815
|
}
|
|
11762
11816
|
) }),
|
|
11763
|
-
/* @__PURE__ */ (0,
|
|
11817
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11764
11818
|
TooltipContent2,
|
|
11765
11819
|
{
|
|
11766
11820
|
side: "top",
|
|
11767
11821
|
align: "center",
|
|
11768
11822
|
className: "uf-max-w-[240px]",
|
|
11769
|
-
children: /* @__PURE__ */ (0,
|
|
11823
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: t.slippage.tooltip })
|
|
11770
11824
|
}
|
|
11771
11825
|
)
|
|
11772
11826
|
] })
|
|
11773
11827
|
] }),
|
|
11774
|
-
/* @__PURE__ */ (0,
|
|
11775
|
-
/* @__PURE__ */ (0,
|
|
11776
|
-
/* @__PURE__ */ (0,
|
|
11828
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11829
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Clock, { className: "uf-w-3 uf-h-3" }) }),
|
|
11830
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "uf-text-xs", children: [
|
|
11777
11831
|
t.processingTime.label,
|
|
11778
11832
|
":",
|
|
11779
11833
|
" ",
|
|
11780
|
-
/* @__PURE__ */ (0,
|
|
11834
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "uf-text-foreground", children: formatProcessingTime(processingTime) })
|
|
11781
11835
|
] })
|
|
11782
11836
|
] }),
|
|
11783
|
-
/* @__PURE__ */ (0,
|
|
11784
|
-
/* @__PURE__ */ (0,
|
|
11785
|
-
/* @__PURE__ */ (0,
|
|
11837
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
11838
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-bg-card uf-rounded-full uf-p-1", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FileText, { className: "uf-w-3 uf-h-3" }) }),
|
|
11839
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "uf-text-xs", children: [
|
|
11786
11840
|
t.help.needHelp,
|
|
11787
11841
|
" ",
|
|
11788
|
-
/* @__PURE__ */ (0,
|
|
11842
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11789
11843
|
"a",
|
|
11790
11844
|
{
|
|
11791
11845
|
href: "#",
|
|
@@ -11797,8 +11851,8 @@ function TransferCryptoBase({
|
|
|
11797
11851
|
] })
|
|
11798
11852
|
] })
|
|
11799
11853
|
] }),
|
|
11800
|
-
/* @__PURE__ */ (0,
|
|
11801
|
-
/* @__PURE__ */ (0,
|
|
11854
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-pt-2", children: [
|
|
11855
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11802
11856
|
"a",
|
|
11803
11857
|
{
|
|
11804
11858
|
href: "https://unifold.io/terms",
|
|
@@ -11807,22 +11861,22 @@ function TransferCryptoBase({
|
|
|
11807
11861
|
children: t.terms.termsApply
|
|
11808
11862
|
}
|
|
11809
11863
|
),
|
|
11810
|
-
depositExecutions.length > 1 && /* @__PURE__ */ (0,
|
|
11864
|
+
depositExecutions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
11811
11865
|
"button",
|
|
11812
11866
|
{
|
|
11813
11867
|
onClick: () => setDepositsModalOpen(true),
|
|
11814
11868
|
className: "uf-flex uf-items-center uf-gap-1 uf-text-muted-foreground hover:uf-text-foreground uf-transition-colors uf-animate-in uf-fade-in uf-slide-in-from-right-8 uf-duration-1000",
|
|
11815
11869
|
children: [
|
|
11816
|
-
/* @__PURE__ */ (0,
|
|
11870
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Clock, { className: "uf-w-3.5 uf-h-3.5" }),
|
|
11817
11871
|
"Track deposits (",
|
|
11818
11872
|
depositExecutions.length,
|
|
11819
11873
|
")",
|
|
11820
|
-
/* @__PURE__ */ (0,
|
|
11874
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ChevronRight, { className: "uf-w-3 uf-h-3" })
|
|
11821
11875
|
]
|
|
11822
11876
|
}
|
|
11823
11877
|
)
|
|
11824
11878
|
] }),
|
|
11825
|
-
depositExecutions.length === 1 && /* @__PURE__ */ (0,
|
|
11879
|
+
depositExecutions.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "uf-fixed uf-bottom-4 uf-left-1/2 uf--translate-x-1/2 uf-w-[360px] uf-max-w-[calc(100vw-2rem)] uf-z-[100]", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11826
11880
|
DepositSuccessToast,
|
|
11827
11881
|
{
|
|
11828
11882
|
depositTx: depositExecutions[0].transaction_hash,
|
|
@@ -11832,11 +11886,12 @@ function TransferCryptoBase({
|
|
|
11832
11886
|
status: depositExecutions[0].status,
|
|
11833
11887
|
tokenIconUrl: depositExecutions[0].destination_token_metadata?.icon_url,
|
|
11834
11888
|
sourceAmountBaseUnit: depositExecutions[0].source_amount_base_unit,
|
|
11835
|
-
onClose: () => setDepositExecutions([])
|
|
11889
|
+
onClose: () => setDepositExecutions([]),
|
|
11890
|
+
execution: depositExecutions[0]
|
|
11836
11891
|
},
|
|
11837
11892
|
depositExecutions[0].id
|
|
11838
11893
|
) }),
|
|
11839
|
-
/* @__PURE__ */ (0,
|
|
11894
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11840
11895
|
DepositsModal,
|
|
11841
11896
|
{
|
|
11842
11897
|
open: depositsModalOpen,
|
|
@@ -11850,7 +11905,7 @@ function TransferCryptoBase({
|
|
|
11850
11905
|
] }) });
|
|
11851
11906
|
}
|
|
11852
11907
|
function TransferCrypto(props) {
|
|
11853
|
-
return /* @__PURE__ */ (0,
|
|
11908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
11854
11909
|
TransferCryptoBase,
|
|
11855
11910
|
{
|
|
11856
11911
|
...props,
|
|
@@ -11865,14 +11920,14 @@ function CurrencyListItem({
|
|
|
11865
11920
|
onSelect
|
|
11866
11921
|
}) {
|
|
11867
11922
|
const iconUrl = getPreferredIconUrl(currency.icon_urls, "png") || currency.icon_url;
|
|
11868
|
-
return /* @__PURE__ */ (0,
|
|
11923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
11869
11924
|
"button",
|
|
11870
11925
|
{
|
|
11871
11926
|
onClick: () => onSelect(currency.currency_code),
|
|
11872
11927
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
|
|
11873
11928
|
children: [
|
|
11874
|
-
/* @__PURE__ */ (0,
|
|
11875
|
-
/* @__PURE__ */ (0,
|
|
11929
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
11930
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
11876
11931
|
"img",
|
|
11877
11932
|
{
|
|
11878
11933
|
src: iconUrl,
|
|
@@ -11880,12 +11935,12 @@ function CurrencyListItem({
|
|
|
11880
11935
|
className: "uf-w-10 uf-h-10 uf-flex-shrink-0"
|
|
11881
11936
|
}
|
|
11882
11937
|
),
|
|
11883
|
-
/* @__PURE__ */ (0,
|
|
11884
|
-
/* @__PURE__ */ (0,
|
|
11885
|
-
/* @__PURE__ */ (0,
|
|
11938
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "uf-text-left", children: [
|
|
11939
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "uf-text-sm uf-font-normal uf-text-foreground", children: currency.name }),
|
|
11940
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-light", children: currency.currency_code.toUpperCase() })
|
|
11886
11941
|
] })
|
|
11887
11942
|
] }),
|
|
11888
|
-
isSelected && /* @__PURE__ */ (0,
|
|
11943
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Check, { className: "uf-w-4 uf-h-4 uf-text-foreground" })
|
|
11889
11944
|
]
|
|
11890
11945
|
}
|
|
11891
11946
|
);
|
|
@@ -11897,9 +11952,9 @@ function CurrencyListSection({
|
|
|
11897
11952
|
onSelect
|
|
11898
11953
|
}) {
|
|
11899
11954
|
if (currencies.length === 0) return null;
|
|
11900
|
-
return /* @__PURE__ */ (0,
|
|
11901
|
-
/* @__PURE__ */ (0,
|
|
11902
|
-
currencies.map((currency) => /* @__PURE__ */ (0,
|
|
11955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
11956
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "uf-px-1 uf-pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h3", { className: "uf-text-xs uf-font-light uf-text-muted-foreground", children: title }) }),
|
|
11957
|
+
currencies.map((currency) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
11903
11958
|
CurrencyListItem,
|
|
11904
11959
|
{
|
|
11905
11960
|
currency,
|
|
@@ -11919,7 +11974,7 @@ function CurrencyModal({
|
|
|
11919
11974
|
onSelectCurrency,
|
|
11920
11975
|
themeClass = ""
|
|
11921
11976
|
}) {
|
|
11922
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
11977
|
+
const [searchQuery, setSearchQuery] = (0, import_react14.useState)("");
|
|
11923
11978
|
const preferredCurrencies = preferredCurrencyCodes.map(
|
|
11924
11979
|
(code) => currencies.find(
|
|
11925
11980
|
(currency) => currency.currency_code.toLowerCase() === code.toLowerCase()
|
|
@@ -11946,8 +12001,8 @@ function CurrencyModal({
|
|
|
11946
12001
|
onOpenChange(false);
|
|
11947
12002
|
setSearchQuery("");
|
|
11948
12003
|
};
|
|
11949
|
-
return /* @__PURE__ */ (0,
|
|
11950
|
-
/* @__PURE__ */ (0,
|
|
12004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Dialog2, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(DialogContent2, { className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 [&>button]:uf-hidden ${themeClass}`, children: [
|
|
12005
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
11951
12006
|
DepositHeader,
|
|
11952
12007
|
{
|
|
11953
12008
|
title: "Currency",
|
|
@@ -11956,9 +12011,9 @@ function CurrencyModal({
|
|
|
11956
12011
|
onClose: handleClose
|
|
11957
12012
|
}
|
|
11958
12013
|
),
|
|
11959
|
-
/* @__PURE__ */ (0,
|
|
11960
|
-
/* @__PURE__ */ (0,
|
|
11961
|
-
/* @__PURE__ */ (0,
|
|
12014
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "uf-relative", children: [
|
|
12015
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Search, { className: "uf-absolute uf-left-4 uf-top-1/2 uf--translate-y-1/2 uf-w-4 uf-h-4 uf-text-muted-foreground" }),
|
|
12016
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
11962
12017
|
"input",
|
|
11963
12018
|
{
|
|
11964
12019
|
type: "text",
|
|
@@ -11969,8 +12024,8 @@ function CurrencyModal({
|
|
|
11969
12024
|
}
|
|
11970
12025
|
)
|
|
11971
12026
|
] }) }),
|
|
11972
|
-
/* @__PURE__ */ (0,
|
|
11973
|
-
/* @__PURE__ */ (0,
|
|
12027
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "uf-max-h-[500px] uf-overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:uf-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "uf-space-y-2", children: [
|
|
12028
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
11974
12029
|
CurrencyListSection,
|
|
11975
12030
|
{
|
|
11976
12031
|
title: "Popular currencies",
|
|
@@ -11979,8 +12034,8 @@ function CurrencyModal({
|
|
|
11979
12034
|
onSelect: handleSelect
|
|
11980
12035
|
}
|
|
11981
12036
|
),
|
|
11982
|
-
filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */ (0,
|
|
11983
|
-
/* @__PURE__ */ (0,
|
|
12037
|
+
filteredPreferred.length > 0 && filteredOther.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "uf-h-2" }),
|
|
12038
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
11984
12039
|
CurrencyListSection,
|
|
11985
12040
|
{
|
|
11986
12041
|
title: "All currencies",
|
|
@@ -11989,7 +12044,7 @@ function CurrencyModal({
|
|
|
11989
12044
|
onSelect: handleSelect
|
|
11990
12045
|
}
|
|
11991
12046
|
),
|
|
11992
|
-
filteredPreferred.length === 0 && filteredOther.length === 0 && /* @__PURE__ */ (0,
|
|
12047
|
+
filteredPreferred.length === 0 && filteredOther.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "uf-text-center uf-py-8 uf-text-muted-foreground uf-text-sm", children: "No currencies found" })
|
|
11993
12048
|
] }) })
|
|
11994
12049
|
] }) });
|
|
11995
12050
|
}
|
|
@@ -12005,12 +12060,12 @@ async function getIpViaIpApi() {
|
|
|
12005
12060
|
state: data.region_code?.toLowerCase()
|
|
12006
12061
|
};
|
|
12007
12062
|
}
|
|
12008
|
-
function
|
|
12063
|
+
function useUserIp2() {
|
|
12009
12064
|
const {
|
|
12010
12065
|
data: userIpInfo,
|
|
12011
12066
|
isLoading,
|
|
12012
12067
|
error
|
|
12013
|
-
} = (0,
|
|
12068
|
+
} = (0, import_react_query3.useQuery)({
|
|
12014
12069
|
queryKey: ["getUserIpInfo"],
|
|
12015
12070
|
queryFn: async () => {
|
|
12016
12071
|
try {
|
|
@@ -12038,7 +12093,7 @@ function useUserIp() {
|
|
|
12038
12093
|
error
|
|
12039
12094
|
};
|
|
12040
12095
|
}
|
|
12041
|
-
var t2 =
|
|
12096
|
+
var t2 = i18n2.buyWithCard;
|
|
12042
12097
|
var QUICK_AMOUNTS = [100, 500, 1e3];
|
|
12043
12098
|
function getCurrencySymbol(currencyCode) {
|
|
12044
12099
|
try {
|
|
@@ -12068,21 +12123,21 @@ function BuyWithCard({
|
|
|
12068
12123
|
wallets: externalWallets,
|
|
12069
12124
|
assetCdnUrl
|
|
12070
12125
|
}) {
|
|
12071
|
-
const [amount, setAmount] = (0,
|
|
12072
|
-
const [currency, setCurrency] = (0,
|
|
12073
|
-
const [showCurrencyModal, setShowCurrencyModal] = (0,
|
|
12074
|
-
const [quotes, setQuotes] = (0,
|
|
12075
|
-
const [quotesLoading, setQuotesLoading] = (0,
|
|
12076
|
-
const [quotesError, setQuotesError] = (0,
|
|
12077
|
-
const [internalView, setInternalView] = (0,
|
|
12078
|
-
const { userIpInfo, isLoading: isLoadingIp } =
|
|
12079
|
-
const [onrampSession, setOnrampSession] = (0,
|
|
12126
|
+
const [amount, setAmount] = (0, import_react13.useState)("500.00");
|
|
12127
|
+
const [currency, setCurrency] = (0, import_react13.useState)("usd");
|
|
12128
|
+
const [showCurrencyModal, setShowCurrencyModal] = (0, import_react13.useState)(false);
|
|
12129
|
+
const [quotes, setQuotes] = (0, import_react13.useState)([]);
|
|
12130
|
+
const [quotesLoading, setQuotesLoading] = (0, import_react13.useState)(false);
|
|
12131
|
+
const [quotesError, setQuotesError] = (0, import_react13.useState)(null);
|
|
12132
|
+
const [internalView, setInternalView] = (0, import_react13.useState)("amount");
|
|
12133
|
+
const { userIpInfo, isLoading: isLoadingIp } = useUserIp2();
|
|
12134
|
+
const [onrampSession, setOnrampSession] = (0, import_react13.useState)(
|
|
12080
12135
|
null
|
|
12081
12136
|
);
|
|
12082
12137
|
const currentView = externalView ?? internalView;
|
|
12083
12138
|
const showQuotesView = currentView === "quotes";
|
|
12084
12139
|
const showOnrampView = currentView === "onramp";
|
|
12085
|
-
(0,
|
|
12140
|
+
(0, import_react13.useEffect)(() => {
|
|
12086
12141
|
if (externalView) {
|
|
12087
12142
|
setInternalView(externalView);
|
|
12088
12143
|
}
|
|
@@ -12095,20 +12150,20 @@ function BuyWithCard({
|
|
|
12095
12150
|
onViewChange?.(newView);
|
|
12096
12151
|
}
|
|
12097
12152
|
};
|
|
12098
|
-
const [selectedProvider, setSelectedProvider] = (0,
|
|
12153
|
+
const [selectedProvider, setSelectedProvider] = (0, import_react13.useState)(
|
|
12099
12154
|
null
|
|
12100
12155
|
);
|
|
12101
|
-
const [isAutoSelected, setIsAutoSelected] = (0,
|
|
12102
|
-
const [autoSelectedProvider, setAutoSelectedProvider] = (0,
|
|
12103
|
-
const [hasManualSelection, setHasManualSelection] = (0,
|
|
12104
|
-
const [internalWallets, setInternalWallets] = (0,
|
|
12105
|
-
const [walletsLoading, setWalletsLoading] = (0,
|
|
12156
|
+
const [isAutoSelected, setIsAutoSelected] = (0, import_react13.useState)(true);
|
|
12157
|
+
const [autoSelectedProvider, setAutoSelectedProvider] = (0, import_react13.useState)(null);
|
|
12158
|
+
const [hasManualSelection, setHasManualSelection] = (0, import_react13.useState)(false);
|
|
12159
|
+
const [internalWallets, setInternalWallets] = (0, import_react13.useState)([]);
|
|
12160
|
+
const [walletsLoading, setWalletsLoading] = (0, import_react13.useState)(!externalWallets?.length);
|
|
12106
12161
|
const wallets = externalWallets?.length ? externalWallets : internalWallets;
|
|
12107
|
-
const [countdown, setCountdown] = (0,
|
|
12108
|
-
const [fiatCurrencies, setFiatCurrencies] = (0,
|
|
12109
|
-
const [preferredCurrencyCodes, setPreferredCurrencyCodes] = (0,
|
|
12110
|
-
const [currenciesLoading, setCurrenciesLoading] = (0,
|
|
12111
|
-
const [supportedTokens, setSupportedTokens] = (0,
|
|
12162
|
+
const [countdown, setCountdown] = (0, import_react13.useState)(60);
|
|
12163
|
+
const [fiatCurrencies, setFiatCurrencies] = (0, import_react13.useState)([]);
|
|
12164
|
+
const [preferredCurrencyCodes, setPreferredCurrencyCodes] = (0, import_react13.useState)([]);
|
|
12165
|
+
const [currenciesLoading, setCurrenciesLoading] = (0, import_react13.useState)(true);
|
|
12166
|
+
const [supportedTokens, setSupportedTokens] = (0, import_react13.useState)([]);
|
|
12112
12167
|
const destinationWallet = getWalletByChainType(wallets, "ethereum");
|
|
12113
12168
|
const walletDestinationChainId = destinationWallet?.destination_chain_id;
|
|
12114
12169
|
const resolvedDestinationChainId = destinationChainId || walletDestinationChainId;
|
|
@@ -12117,7 +12172,7 @@ function BuyWithCard({
|
|
|
12117
12172
|
const destinationChain = destinationToken?.chains.find(
|
|
12118
12173
|
(c) => c.chain_id === resolvedDestinationChainId
|
|
12119
12174
|
);
|
|
12120
|
-
(0,
|
|
12175
|
+
(0, import_react13.useEffect)(() => {
|
|
12121
12176
|
async function fetchFiatCurrencies() {
|
|
12122
12177
|
try {
|
|
12123
12178
|
const response = await getFiatCurrencies(publishableKey);
|
|
@@ -12131,20 +12186,24 @@ function BuyWithCard({
|
|
|
12131
12186
|
}
|
|
12132
12187
|
fetchFiatCurrencies();
|
|
12133
12188
|
}, [publishableKey]);
|
|
12134
|
-
(0,
|
|
12189
|
+
(0, import_react13.useEffect)(() => {
|
|
12135
12190
|
if (externalWallets?.length) {
|
|
12136
12191
|
setWalletsLoading(false);
|
|
12137
12192
|
return;
|
|
12138
12193
|
}
|
|
12194
|
+
if (internalWallets.length > 0) {
|
|
12195
|
+
setWalletsLoading(false);
|
|
12196
|
+
return;
|
|
12197
|
+
}
|
|
12139
12198
|
let retryTimeout = null;
|
|
12140
12199
|
let isCancelled = false;
|
|
12141
12200
|
const fetchWallets = async () => {
|
|
12142
12201
|
if (isCancelled) return;
|
|
12143
12202
|
setWalletsLoading(true);
|
|
12144
12203
|
try {
|
|
12145
|
-
const response = await
|
|
12204
|
+
const response = await createDepositAddress(
|
|
12146
12205
|
{
|
|
12147
|
-
|
|
12206
|
+
external_user_id: userId,
|
|
12148
12207
|
recipient_address: recipientAddress,
|
|
12149
12208
|
destination_chain_type: destinationChainType,
|
|
12150
12209
|
destination_chain_id: destinationChainId,
|
|
@@ -12172,7 +12231,7 @@ function BuyWithCard({
|
|
|
12172
12231
|
}
|
|
12173
12232
|
};
|
|
12174
12233
|
}, [userId, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, publishableKey, externalWallets]);
|
|
12175
|
-
(0,
|
|
12234
|
+
(0, import_react13.useEffect)(() => {
|
|
12176
12235
|
async function fetchSupportedTokens() {
|
|
12177
12236
|
try {
|
|
12178
12237
|
const response = await getSupportedDepositTokens(publishableKey);
|
|
@@ -12183,7 +12242,7 @@ function BuyWithCard({
|
|
|
12183
12242
|
}
|
|
12184
12243
|
fetchSupportedTokens();
|
|
12185
12244
|
}, [publishableKey]);
|
|
12186
|
-
(0,
|
|
12245
|
+
(0, import_react13.useEffect)(() => {
|
|
12187
12246
|
const amountNum = parseFloat(amount);
|
|
12188
12247
|
if (isNaN(amountNum) || amountNum <= 0) {
|
|
12189
12248
|
setQuotes([]);
|
|
@@ -12263,7 +12322,7 @@ function BuyWithCard({
|
|
|
12263
12322
|
setQuotesLoading(false);
|
|
12264
12323
|
}
|
|
12265
12324
|
};
|
|
12266
|
-
(0,
|
|
12325
|
+
(0, import_react13.useEffect)(() => {
|
|
12267
12326
|
if (quotes.length === 0) return;
|
|
12268
12327
|
const timer = setInterval(() => {
|
|
12269
12328
|
setCountdown((prev) => {
|
|
@@ -12338,21 +12397,21 @@ function BuyWithCard({
|
|
|
12338
12397
|
(a, b) => b.destination_amount - a.destination_amount
|
|
12339
12398
|
);
|
|
12340
12399
|
const currencySymbol = getCurrencySymbol(currency);
|
|
12341
|
-
return /* @__PURE__ */ (0,
|
|
12342
|
-
/* @__PURE__ */ (0,
|
|
12400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-pb-1 uf-relative uf-overflow-hidden", children: [
|
|
12401
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
12343
12402
|
"div",
|
|
12344
12403
|
{
|
|
12345
|
-
className: `uf-transition-all uf-duration-300 ${showQuotesView || showOnrampView ? "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0" : "uf-opacity-100"}`,
|
|
12404
|
+
className: `uf-transition-all uf-duration-300 uf-min-h-[420px] ${showQuotesView || showOnrampView ? "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0" : "uf-opacity-100"}`,
|
|
12346
12405
|
children: [
|
|
12347
|
-
/* @__PURE__ */ (0,
|
|
12348
|
-
/* @__PURE__ */ (0,
|
|
12406
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-mb-6 uf-pt-4", children: [
|
|
12407
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-flex uf-justify-center uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
12349
12408
|
"button",
|
|
12350
12409
|
{
|
|
12351
12410
|
onClick: () => setShowCurrencyModal(true),
|
|
12352
12411
|
disabled: currenciesLoading,
|
|
12353
12412
|
className: "uf-flex uf-items-center uf-gap-1.5 uf-px-3 uf-py-1.5 uf-rounded-lg uf-bg-secondary hover:uf-bg-accent uf-transition-colors disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
12354
12413
|
children: [
|
|
12355
|
-
selectedCurrencyData && /* @__PURE__ */ (0,
|
|
12414
|
+
selectedCurrencyData && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12356
12415
|
"img",
|
|
12357
12416
|
{
|
|
12358
12417
|
src: getPreferredIconUrl(selectedCurrencyData.icon_urls, "png") || selectedCurrencyData.icon_url,
|
|
@@ -12360,14 +12419,14 @@ function BuyWithCard({
|
|
|
12360
12419
|
className: "uf-w-4 uf-h-4"
|
|
12361
12420
|
}
|
|
12362
12421
|
),
|
|
12363
|
-
/* @__PURE__ */ (0,
|
|
12364
|
-
/* @__PURE__ */ (0,
|
|
12422
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: currency.toUpperCase() }),
|
|
12423
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ChevronDown, { className: "uf-w-3.5 uf-h-3.5 uf-text-muted-foreground" })
|
|
12365
12424
|
]
|
|
12366
12425
|
}
|
|
12367
12426
|
) }),
|
|
12368
|
-
/* @__PURE__ */ (0,
|
|
12369
|
-
/* @__PURE__ */ (0,
|
|
12370
|
-
/* @__PURE__ */ (0,
|
|
12427
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-text-center uf-mb-4", children: [
|
|
12428
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-flex uf-items-center uf-justify-center uf-mb-2 uf-px-8", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-items-center uf-max-w-full", children: [
|
|
12429
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12371
12430
|
"span",
|
|
12372
12431
|
{
|
|
12373
12432
|
className: "uf-font-normal uf-text-foreground uf-flex-shrink-0 uf-mr-1",
|
|
@@ -12377,7 +12436,7 @@ function BuyWithCard({
|
|
|
12377
12436
|
children: currencySymbol
|
|
12378
12437
|
}
|
|
12379
12438
|
),
|
|
12380
|
-
/* @__PURE__ */ (0,
|
|
12439
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12381
12440
|
"input",
|
|
12382
12441
|
{
|
|
12383
12442
|
type: "text",
|
|
@@ -12393,12 +12452,12 @@ function BuyWithCard({
|
|
|
12393
12452
|
}
|
|
12394
12453
|
)
|
|
12395
12454
|
] }) }),
|
|
12396
|
-
quotesLoading ? /* @__PURE__ */ (0,
|
|
12455
|
+
quotesLoading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-flex uf-justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-40 uf-animate-pulse" }) }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-text-sm uf-text-muted-foreground uf-font-normal", children: [
|
|
12397
12456
|
calculateUSDC(),
|
|
12398
12457
|
" USDC (Perps)"
|
|
12399
12458
|
] })
|
|
12400
12459
|
] }),
|
|
12401
|
-
/* @__PURE__ */ (0,
|
|
12460
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-flex uf-gap-3 uf-justify-center", children: QUICK_AMOUNTS.map((quickAmount) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
12402
12461
|
"button",
|
|
12403
12462
|
{
|
|
12404
12463
|
onClick: () => handleQuickAmount(quickAmount),
|
|
@@ -12411,31 +12470,31 @@ function BuyWithCard({
|
|
|
12411
12470
|
quickAmount
|
|
12412
12471
|
)) })
|
|
12413
12472
|
] }),
|
|
12414
|
-
/* @__PURE__ */ (0,
|
|
12415
|
-
/* @__PURE__ */ (0,
|
|
12416
|
-
/* @__PURE__ */ (0,
|
|
12417
|
-
quotes.length > 0 && !quotesLoading && /* @__PURE__ */ (0,
|
|
12473
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-mb-6", children: [
|
|
12474
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-between uf-text-xs uf-font-medium uf-mb-2 uf-px-1", children: [
|
|
12475
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-foreground", children: "Provider" }),
|
|
12476
|
+
quotes.length > 0 && !quotesLoading && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "uf-text-[10px] uf-text-foreground uf-font-normal", children: [
|
|
12418
12477
|
"Refreshing in ",
|
|
12419
12478
|
countdown,
|
|
12420
12479
|
"s"
|
|
12421
12480
|
] })
|
|
12422
12481
|
] }),
|
|
12423
|
-
/* @__PURE__ */ (0,
|
|
12482
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12424
12483
|
"button",
|
|
12425
12484
|
{
|
|
12426
12485
|
onClick: () => handleViewChange("quotes"),
|
|
12427
12486
|
disabled: quotesLoading || quotes.length === 0,
|
|
12428
12487
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-4 uf-group disabled:uf-opacity-50 disabled:uf-cursor-not-allowed",
|
|
12429
|
-
children: quotesLoading ? /* @__PURE__ */ (0,
|
|
12430
|
-
/* @__PURE__ */ (0,
|
|
12431
|
-
/* @__PURE__ */ (0,
|
|
12432
|
-
/* @__PURE__ */ (0,
|
|
12433
|
-
/* @__PURE__ */ (0,
|
|
12488
|
+
children: quotesLoading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-text-left uf-w-full uf-animate-pulse", children: [
|
|
12489
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-h-3 uf-bg-muted uf-rounded uf-w-28 uf-mb-3" }),
|
|
12490
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
12491
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-w-8 uf-h-8 uf-bg-muted uf-rounded-full" }),
|
|
12492
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-h-4 uf-bg-muted uf-rounded uf-w-32" })
|
|
12434
12493
|
] })
|
|
12435
|
-
] }) : /* @__PURE__ */ (0,
|
|
12436
|
-
isAutoSelected && /* @__PURE__ */ (0,
|
|
12437
|
-
selectedProvider && /* @__PURE__ */ (0,
|
|
12438
|
-
/* @__PURE__ */ (0,
|
|
12494
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-w-full uf-text-left", children: [
|
|
12495
|
+
isAutoSelected && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-normal uf-mb-2", children: "Auto-picked for you" }),
|
|
12496
|
+
selectedProvider && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12497
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12439
12498
|
"img",
|
|
12440
12499
|
{
|
|
12441
12500
|
src: selectedProvider.icon_url,
|
|
@@ -12445,22 +12504,22 @@ function BuyWithCard({
|
|
|
12445
12504
|
className: "uf-rounded-full uf-flex-shrink-0"
|
|
12446
12505
|
}
|
|
12447
12506
|
),
|
|
12448
|
-
/* @__PURE__ */ (0,
|
|
12449
|
-
/* @__PURE__ */ (0,
|
|
12450
|
-
/* @__PURE__ */ (0,
|
|
12451
|
-
isAutoSelected && /* @__PURE__ */ (0,
|
|
12452
|
-
isAutoSelected && selectedProvider.low_kyc === false && /* @__PURE__ */ (0,
|
|
12453
|
-
selectedProvider.low_kyc === false && /* @__PURE__ */ (0,
|
|
12507
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex-1 uf-min-w-0", children: [
|
|
12508
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-text-sm uf-text-foreground uf-font-medium", children: selectedProvider.service_provider_display_name }),
|
|
12509
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
|
|
12510
|
+
isAutoSelected && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-[10px] uf-text-green-400 uf-font-normal", children: "Best price" }),
|
|
12511
|
+
isAutoSelected && selectedProvider.low_kyc === false && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
|
|
12512
|
+
selectedProvider.low_kyc === false && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-font-normal", children: "No document upload" })
|
|
12454
12513
|
] })
|
|
12455
12514
|
] }),
|
|
12456
|
-
quotes.length > 0 && /* @__PURE__ */ (0,
|
|
12515
|
+
quotes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors uf-flex-shrink-0" })
|
|
12457
12516
|
] })
|
|
12458
12517
|
] })
|
|
12459
12518
|
}
|
|
12460
12519
|
),
|
|
12461
|
-
quotesError && /* @__PURE__ */ (0,
|
|
12520
|
+
quotesError && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-text-xs uf-text-red-400 uf-mt-2 uf-px-1", children: quotesError })
|
|
12462
12521
|
] }),
|
|
12463
|
-
/* @__PURE__ */ (0,
|
|
12522
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12464
12523
|
"button",
|
|
12465
12524
|
{
|
|
12466
12525
|
onClick: handleContinue,
|
|
@@ -12475,15 +12534,15 @@ function BuyWithCard({
|
|
|
12475
12534
|
]
|
|
12476
12535
|
}
|
|
12477
12536
|
),
|
|
12478
|
-
/* @__PURE__ */ (0,
|
|
12537
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12479
12538
|
"div",
|
|
12480
12539
|
{
|
|
12481
|
-
className: `uf-transition-all uf-duration-300 ${showQuotesView && !showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
|
|
12482
|
-
children: /* @__PURE__ */ (0,
|
|
12540
|
+
className: `uf-transition-all uf-duration-300 uf-min-h-[420px] ${showQuotesView && !showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
|
|
12541
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-space-y-2 uf-pt-2", children: sortedQuotes.map((quote, index2) => {
|
|
12483
12542
|
const badges = getProviderBadges(quote, sortedQuotes);
|
|
12484
12543
|
const displayName = quote.service_provider_display_name;
|
|
12485
12544
|
const isSelected = selectedProvider?.service_provider === quote.service_provider;
|
|
12486
|
-
return /* @__PURE__ */ (0,
|
|
12545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
12487
12546
|
"button",
|
|
12488
12547
|
{
|
|
12489
12548
|
onClick: () => {
|
|
@@ -12496,8 +12555,8 @@ function BuyWithCard({
|
|
|
12496
12555
|
},
|
|
12497
12556
|
className: `uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group ${isSelected ? "uf-ring-2 uf-ring-inset uf-ring-primary" : ""}`,
|
|
12498
12557
|
children: [
|
|
12499
|
-
/* @__PURE__ */ (0,
|
|
12500
|
-
/* @__PURE__ */ (0,
|
|
12558
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12559
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-w-10 uf-h-10 uf-flex uf-items-center uf-justify-center uf-flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12501
12560
|
"img",
|
|
12502
12561
|
{
|
|
12503
12562
|
src: quote.icon_url,
|
|
@@ -12507,10 +12566,10 @@ function BuyWithCard({
|
|
|
12507
12566
|
className: "uf-rounded-full"
|
|
12508
12567
|
}
|
|
12509
12568
|
) }),
|
|
12510
|
-
/* @__PURE__ */ (0,
|
|
12511
|
-
/* @__PURE__ */ (0,
|
|
12512
|
-
/* @__PURE__ */ (0,
|
|
12513
|
-
badges.map((badge, i) => /* @__PURE__ */ (0,
|
|
12569
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-text-left", children: [
|
|
12570
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: displayName }),
|
|
12571
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-1.5 uf-mt-0.5", children: [
|
|
12572
|
+
badges.map((badge, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
12514
12573
|
"span",
|
|
12515
12574
|
{
|
|
12516
12575
|
className: "uf-text-[10px] uf-text-green-400 uf-font-normal",
|
|
@@ -12521,17 +12580,17 @@ function BuyWithCard({
|
|
|
12521
12580
|
},
|
|
12522
12581
|
i
|
|
12523
12582
|
)),
|
|
12524
|
-
quote.low_kyc === false && badges.length > 0 && /* @__PURE__ */ (0,
|
|
12525
|
-
quote.low_kyc === false && /* @__PURE__ */ (0,
|
|
12583
|
+
quote.low_kyc === false && badges.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground", children: "\u2022" }),
|
|
12584
|
+
quote.low_kyc === false && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-font-normal", children: "No document upload" })
|
|
12526
12585
|
] })
|
|
12527
12586
|
] })
|
|
12528
12587
|
] }),
|
|
12529
|
-
/* @__PURE__ */ (0,
|
|
12530
|
-
/* @__PURE__ */ (0,
|
|
12588
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-text-right", children: [
|
|
12589
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-text-sm uf-font-medium uf-text-foreground", children: [
|
|
12531
12590
|
quote.destination_amount.toFixed(2),
|
|
12532
12591
|
" USDC"
|
|
12533
12592
|
] }),
|
|
12534
|
-
/* @__PURE__ */ (0,
|
|
12593
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-text-xs uf-text-muted-foreground uf-font-normal", children: [
|
|
12535
12594
|
currencySymbol,
|
|
12536
12595
|
" ",
|
|
12537
12596
|
amount
|
|
@@ -12544,12 +12603,12 @@ function BuyWithCard({
|
|
|
12544
12603
|
}) })
|
|
12545
12604
|
}
|
|
12546
12605
|
),
|
|
12547
|
-
/* @__PURE__ */ (0,
|
|
12606
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12548
12607
|
"div",
|
|
12549
12608
|
{
|
|
12550
12609
|
className: `uf-transition-all uf-duration-300 ${showOnrampView ? "uf-opacity-100" : "uf-opacity-0 uf-pointer-events-none uf-absolute uf-inset-0"}`,
|
|
12551
|
-
children: onrampSession && /* @__PURE__ */ (0,
|
|
12552
|
-
/* @__PURE__ */ (0,
|
|
12610
|
+
children: onrampSession && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-pt-6 uf-pb-4 uf-px-2", children: [
|
|
12611
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12553
12612
|
"img",
|
|
12554
12613
|
{
|
|
12555
12614
|
src: onrampSession.provider.icon_url,
|
|
@@ -12559,14 +12618,14 @@ function BuyWithCard({
|
|
|
12559
12618
|
className: "uf-rounded-2xl"
|
|
12560
12619
|
}
|
|
12561
12620
|
) }),
|
|
12562
|
-
/* @__PURE__ */ (0,
|
|
12621
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h2", { className: "uf-text-xl uf-font-medium uf-text-foreground uf-mb-2", children: t2.onramp.completeTransaction.replace(
|
|
12563
12622
|
"{{provider}}",
|
|
12564
12623
|
onrampSession.provider.service_provider_display_name
|
|
12565
12624
|
) }),
|
|
12566
|
-
/* @__PURE__ */ (0,
|
|
12567
|
-
/* @__PURE__ */ (0,
|
|
12568
|
-
/* @__PURE__ */ (0,
|
|
12569
|
-
/* @__PURE__ */ (0,
|
|
12625
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "uf-text-sm uf-text-muted-foreground uf-mb-8", children: t2.onramp.canCloseModal }),
|
|
12626
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-4 uf-mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-items-center uf-justify-center", children: [
|
|
12627
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
12628
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12570
12629
|
"img",
|
|
12571
12630
|
{
|
|
12572
12631
|
src: getIconUrlWithCdn(
|
|
@@ -12577,13 +12636,13 @@ function BuyWithCard({
|
|
|
12577
12636
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
12578
12637
|
}
|
|
12579
12638
|
) }),
|
|
12580
|
-
/* @__PURE__ */ (0,
|
|
12581
|
-
/* @__PURE__ */ (0,
|
|
12639
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youUse }),
|
|
12640
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: onrampSession.sourceCurrency.toUpperCase() })
|
|
12582
12641
|
] }),
|
|
12583
|
-
/* @__PURE__ */ (0,
|
|
12584
|
-
/* @__PURE__ */ (0,
|
|
12585
|
-
/* @__PURE__ */ (0,
|
|
12586
|
-
/* @__PURE__ */ (0,
|
|
12642
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-text-muted-foreground uf-px-1 uf-self-start uf-pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4" }) }),
|
|
12643
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
12644
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-relative", children: [
|
|
12645
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12587
12646
|
"img",
|
|
12588
12647
|
{
|
|
12589
12648
|
src: getIconUrlWithCdn("/icons/tokens/png/usdc.png", assetCdnUrl),
|
|
@@ -12591,7 +12650,7 @@ function BuyWithCard({
|
|
|
12591
12650
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
12592
12651
|
}
|
|
12593
12652
|
),
|
|
12594
|
-
/* @__PURE__ */ (0,
|
|
12653
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12595
12654
|
"img",
|
|
12596
12655
|
{
|
|
12597
12656
|
src: getIconUrlWithCdn("/icons/networks/png/polygon.png", assetCdnUrl),
|
|
@@ -12600,13 +12659,13 @@ function BuyWithCard({
|
|
|
12600
12659
|
}
|
|
12601
12660
|
)
|
|
12602
12661
|
] }) }),
|
|
12603
|
-
/* @__PURE__ */ (0,
|
|
12604
|
-
/* @__PURE__ */ (0,
|
|
12662
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youBuy }),
|
|
12663
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: "USDC" })
|
|
12605
12664
|
] }),
|
|
12606
|
-
/* @__PURE__ */ (0,
|
|
12607
|
-
/* @__PURE__ */ (0,
|
|
12608
|
-
/* @__PURE__ */ (0,
|
|
12609
|
-
/* @__PURE__ */ (0,
|
|
12665
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-text-muted-foreground uf-px-1 uf-self-start uf-pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4" }) }),
|
|
12666
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-flex uf-flex-col uf-items-center uf-min-w-[72px]", children: [
|
|
12667
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-h-8 uf-flex uf-items-center uf-justify-center uf-mb-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "uf-relative", children: [
|
|
12668
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12610
12669
|
"img",
|
|
12611
12670
|
{
|
|
12612
12671
|
src: destinationToken?.icon_url || getIconUrlWithCdn("/icons/tokens/png/usdc.png", assetCdnUrl),
|
|
@@ -12614,7 +12673,7 @@ function BuyWithCard({
|
|
|
12614
12673
|
className: "uf-w-7 uf-h-7 uf-rounded-full"
|
|
12615
12674
|
}
|
|
12616
12675
|
),
|
|
12617
|
-
destinationChain?.icon_url && /* @__PURE__ */ (0,
|
|
12676
|
+
destinationChain?.icon_url && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12618
12677
|
"img",
|
|
12619
12678
|
{
|
|
12620
12679
|
src: destinationChain.icon_url,
|
|
@@ -12623,15 +12682,15 @@ function BuyWithCard({
|
|
|
12623
12682
|
}
|
|
12624
12683
|
)
|
|
12625
12684
|
] }) }),
|
|
12626
|
-
/* @__PURE__ */ (0,
|
|
12627
|
-
/* @__PURE__ */ (0,
|
|
12685
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-[10px] uf-text-muted-foreground uf-text-center", children: t2.onramp.youReceive }),
|
|
12686
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "uf-text-sm uf-font-medium uf-text-foreground uf-text-center", children: displayTokenSymbol })
|
|
12628
12687
|
] })
|
|
12629
12688
|
] }) }),
|
|
12630
|
-
/* @__PURE__ */ (0,
|
|
12689
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-4", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "uf-text-xs uf-text-muted-foreground uf-leading-relaxed", children: t2.onramp.intentAddressNote }) })
|
|
12631
12690
|
] })
|
|
12632
12691
|
}
|
|
12633
12692
|
),
|
|
12634
|
-
/* @__PURE__ */ (0,
|
|
12693
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12635
12694
|
CurrencyModal,
|
|
12636
12695
|
{
|
|
12637
12696
|
open: showCurrencyModal,
|
|
@@ -12654,23 +12713,23 @@ function TransferCryptoButton({
|
|
|
12654
12713
|
featuredTokens
|
|
12655
12714
|
}) {
|
|
12656
12715
|
const sortedTokens = featuredTokens ? [...featuredTokens].sort((a, b) => a.position - b.position) : [];
|
|
12657
|
-
return /* @__PURE__ */ (0,
|
|
12716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
12658
12717
|
"button",
|
|
12659
12718
|
{
|
|
12660
12719
|
onClick,
|
|
12661
12720
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
|
|
12662
12721
|
children: [
|
|
12663
|
-
/* @__PURE__ */ (0,
|
|
12664
|
-
/* @__PURE__ */ (0,
|
|
12665
|
-
/* @__PURE__ */ (0,
|
|
12666
|
-
/* @__PURE__ */ (0,
|
|
12667
|
-
/* @__PURE__ */ (0,
|
|
12722
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12723
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Zap, { className: "uf-w-5 uf-h-5" }) }),
|
|
12724
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-text-left", children: [
|
|
12725
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
12726
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
12668
12727
|
] })
|
|
12669
12728
|
] }),
|
|
12670
|
-
/* @__PURE__ */ (0,
|
|
12671
|
-
/* @__PURE__ */ (0,
|
|
12729
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
12730
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "uf-flex uf--space-x-2", children: sortedTokens.map((token) => {
|
|
12672
12731
|
const iconUrl = token.icon_urls.find((u) => u.format === "svg")?.url || token.icon_urls.find((u) => u.format === "png")?.url;
|
|
12673
|
-
return /* @__PURE__ */ (0,
|
|
12732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
12674
12733
|
"img",
|
|
12675
12734
|
{
|
|
12676
12735
|
src: iconUrl,
|
|
@@ -12682,7 +12741,7 @@ function TransferCryptoButton({
|
|
|
12682
12741
|
token.name
|
|
12683
12742
|
);
|
|
12684
12743
|
}) }),
|
|
12685
|
-
/* @__PURE__ */ (0,
|
|
12744
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
12686
12745
|
] })
|
|
12687
12746
|
]
|
|
12688
12747
|
}
|
|
@@ -12694,23 +12753,23 @@ function DepositWithCardButton({
|
|
|
12694
12753
|
subtitle,
|
|
12695
12754
|
paymentNetworks
|
|
12696
12755
|
}) {
|
|
12697
|
-
return /* @__PURE__ */ (0,
|
|
12756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
12698
12757
|
"button",
|
|
12699
12758
|
{
|
|
12700
12759
|
onClick,
|
|
12701
12760
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
|
|
12702
12761
|
children: [
|
|
12703
|
-
/* @__PURE__ */ (0,
|
|
12704
|
-
/* @__PURE__ */ (0,
|
|
12705
|
-
/* @__PURE__ */ (0,
|
|
12706
|
-
/* @__PURE__ */ (0,
|
|
12707
|
-
/* @__PURE__ */ (0,
|
|
12762
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12763
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CreditCard, { className: "uf-w-5 uf-h-5" }) }),
|
|
12764
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "uf-text-left", children: [
|
|
12765
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
12766
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
12708
12767
|
] })
|
|
12709
12768
|
] }),
|
|
12710
|
-
/* @__PURE__ */ (0,
|
|
12711
|
-
/* @__PURE__ */ (0,
|
|
12769
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
12770
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "uf-flex uf-items-center uf-gap-1.5", children: paymentNetworks?.map((network) => {
|
|
12712
12771
|
const iconUrl = network.icon_urls.find((u) => u.format === "svg")?.url || network.icon_urls.find((u) => u.format === "png")?.url;
|
|
12713
|
-
return /* @__PURE__ */ (0,
|
|
12772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
12714
12773
|
"img",
|
|
12715
12774
|
{
|
|
12716
12775
|
src: iconUrl,
|
|
@@ -12722,7 +12781,7 @@ function DepositWithCardButton({
|
|
|
12722
12781
|
network.name
|
|
12723
12782
|
);
|
|
12724
12783
|
}) }),
|
|
12725
|
-
/* @__PURE__ */ (0,
|
|
12784
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
12726
12785
|
] })
|
|
12727
12786
|
]
|
|
12728
12787
|
}
|
|
@@ -12734,43 +12793,43 @@ function DepositTrackerButton({
|
|
|
12734
12793
|
subtitle,
|
|
12735
12794
|
badge
|
|
12736
12795
|
}) {
|
|
12737
|
-
return /* @__PURE__ */ (0,
|
|
12796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
12738
12797
|
"button",
|
|
12739
12798
|
{
|
|
12740
12799
|
onClick,
|
|
12741
12800
|
className: "uf-w-full uf-bg-secondary hover:uf-bg-accent uf-transition-colors uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-group",
|
|
12742
12801
|
children: [
|
|
12743
|
-
/* @__PURE__ */ (0,
|
|
12744
|
-
/* @__PURE__ */ (0,
|
|
12745
|
-
/* @__PURE__ */ (0,
|
|
12746
|
-
badge !== void 0 && badge > 0 && /* @__PURE__ */ (0,
|
|
12802
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12803
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "uf-bg-muted uf-rounded-lg uf-p-2 uf-relative", children: [
|
|
12804
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Clock, { className: "uf-w-5 uf-h-5" }),
|
|
12805
|
+
badge !== void 0 && badge > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "uf-absolute -uf-top-1 -uf-right-1 uf-bg-blue-500 uf-text-primary-foreground uf-text-[10px] uf-font-semibold uf-rounded-full uf-min-w-[18px] uf-h-[18px] uf-flex uf-items-center uf-justify-center uf-px-1", children: badge > 99 ? "99+" : badge })
|
|
12747
12806
|
] }),
|
|
12748
|
-
/* @__PURE__ */ (0,
|
|
12749
|
-
/* @__PURE__ */ (0,
|
|
12750
|
-
/* @__PURE__ */ (0,
|
|
12807
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "uf-text-left", children: [
|
|
12808
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "uf-text-sm uf-font-light uf-mb-0.5 uf-text-foreground", children: title }),
|
|
12809
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "uf-text-muted-foreground uf-text-xs uf-font-light", children: subtitle })
|
|
12751
12810
|
] })
|
|
12752
12811
|
] }),
|
|
12753
|
-
/* @__PURE__ */ (0,
|
|
12812
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted-foreground group-hover:uf-text-foreground uf-transition-colors" })
|
|
12754
12813
|
]
|
|
12755
12814
|
}
|
|
12756
12815
|
);
|
|
12757
12816
|
}
|
|
12758
12817
|
function SkeletonButton({ variant = "default" }) {
|
|
12759
|
-
return /* @__PURE__ */ (0,
|
|
12760
|
-
/* @__PURE__ */ (0,
|
|
12761
|
-
/* @__PURE__ */ (0,
|
|
12762
|
-
/* @__PURE__ */ (0,
|
|
12763
|
-
/* @__PURE__ */ (0,
|
|
12764
|
-
/* @__PURE__ */ (0,
|
|
12818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-w-full uf-bg-secondary uf-rounded-xl uf-p-3 uf-flex uf-items-center uf-justify-between uf-animate-pulse", children: [
|
|
12819
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-3", children: [
|
|
12820
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-bg-muted uf-rounded-lg uf-w-9 uf-h-9" }),
|
|
12821
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-space-y-1.5", children: [
|
|
12822
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-h-3.5 uf-w-24 uf-bg-muted uf-rounded" }),
|
|
12823
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-h-3 uf-w-32 uf-bg-muted uf-rounded" })
|
|
12765
12824
|
] })
|
|
12766
12825
|
] }),
|
|
12767
|
-
/* @__PURE__ */ (0,
|
|
12768
|
-
variant === "with-icons" && /* @__PURE__ */ (0,
|
|
12769
|
-
/* @__PURE__ */ (0,
|
|
12826
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "uf-flex uf-items-center uf-gap-2", children: [
|
|
12827
|
+
variant === "with-icons" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-flex uf--space-x-1", children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-w-5 uf-h-5 uf-rounded-full uf-bg-muted uf-border-2 uf-border-secondary" }, i)) }),
|
|
12828
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ChevronRight, { className: "uf-w-4 uf-h-4 uf-text-muted" })
|
|
12770
12829
|
] })
|
|
12771
12830
|
] });
|
|
12772
12831
|
}
|
|
12773
|
-
var t3 =
|
|
12832
|
+
var t3 = i18n2.depositModal;
|
|
12774
12833
|
function DepositModal({
|
|
12775
12834
|
open,
|
|
12776
12835
|
onOpenChange,
|
|
@@ -12830,9 +12889,9 @@ function DepositModal({
|
|
|
12830
12889
|
if (isCancelled) return;
|
|
12831
12890
|
setWalletsLoading(true);
|
|
12832
12891
|
try {
|
|
12833
|
-
const response = await
|
|
12892
|
+
const response = await createDepositAddress(
|
|
12834
12893
|
{
|
|
12835
|
-
|
|
12894
|
+
external_user_id: userId,
|
|
12836
12895
|
recipient_address: recipientAddress,
|
|
12837
12896
|
destination_chain_type: destinationChainType,
|
|
12838
12897
|
destination_chain_id: destinationChainId,
|
|
@@ -12884,27 +12943,27 @@ function DepositModal({
|
|
|
12884
12943
|
setQuotesCount(count3);
|
|
12885
12944
|
}
|
|
12886
12945
|
};
|
|
12887
|
-
return /* @__PURE__ */ (0,
|
|
12888
|
-
/* @__PURE__ */ (0,
|
|
12946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ThemeProvider, { themeClass, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Dialog2, { open, onOpenChange: handleClose, children: [
|
|
12947
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12889
12948
|
DialogContent2,
|
|
12890
12949
|
{
|
|
12891
12950
|
className: `sm:uf-max-w-[400px] !uf-bg-card uf-border-secondary uf-text-foreground uf-p-0 uf-gap-0 uf-overflow-visible [&>button]:uf-hidden ${themeClass}`,
|
|
12892
12951
|
onPointerDownOutside: (e) => e.preventDefault(),
|
|
12893
12952
|
onInteractOutside: (e) => e.preventDefault(),
|
|
12894
|
-
children: view === "main" ? /* @__PURE__ */ (0,
|
|
12895
|
-
/* @__PURE__ */ (0,
|
|
12953
|
+
children: view === "main" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
12954
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12896
12955
|
DepositHeader,
|
|
12897
12956
|
{
|
|
12898
12957
|
title: modalTitle || "Deposit",
|
|
12899
12958
|
onClose: handleClose
|
|
12900
12959
|
}
|
|
12901
12960
|
),
|
|
12902
|
-
/* @__PURE__ */ (0,
|
|
12903
|
-
/* @__PURE__ */ (0,
|
|
12904
|
-
/* @__PURE__ */ (0,
|
|
12905
|
-
!hideDepositTracker && /* @__PURE__ */ (0,
|
|
12906
|
-
] }) : /* @__PURE__ */ (0,
|
|
12907
|
-
/* @__PURE__ */ (0,
|
|
12961
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "uf-pb-4 uf-space-y-3", children: !projectConfig ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
12962
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SkeletonButton, { variant: "with-icons" }),
|
|
12963
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SkeletonButton, { variant: "with-icons" }),
|
|
12964
|
+
!hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SkeletonButton, {})
|
|
12965
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
12966
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12908
12967
|
TransferCryptoButton,
|
|
12909
12968
|
{
|
|
12910
12969
|
onClick: () => setView("transfer"),
|
|
@@ -12913,7 +12972,7 @@ function DepositModal({
|
|
|
12913
12972
|
featuredTokens: projectConfig.transfer_crypto.networks
|
|
12914
12973
|
}
|
|
12915
12974
|
),
|
|
12916
|
-
/* @__PURE__ */ (0,
|
|
12975
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12917
12976
|
DepositWithCardButton,
|
|
12918
12977
|
{
|
|
12919
12978
|
onClick: () => setView("card"),
|
|
@@ -12922,7 +12981,7 @@ function DepositModal({
|
|
|
12922
12981
|
paymentNetworks: projectConfig.payment_networks.networks
|
|
12923
12982
|
}
|
|
12924
12983
|
),
|
|
12925
|
-
!hideDepositTracker && /* @__PURE__ */ (0,
|
|
12984
|
+
!hideDepositTracker && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12926
12985
|
DepositTrackerButton,
|
|
12927
12986
|
{
|
|
12928
12987
|
onClick: () => setDepositsModalOpen(true),
|
|
@@ -12932,8 +12991,8 @@ function DepositModal({
|
|
|
12932
12991
|
}
|
|
12933
12992
|
)
|
|
12934
12993
|
] }) })
|
|
12935
|
-
] }) : view === "transfer" ? /* @__PURE__ */ (0,
|
|
12936
|
-
/* @__PURE__ */ (0,
|
|
12994
|
+
] }) : view === "transfer" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
12995
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12937
12996
|
DepositHeader,
|
|
12938
12997
|
{
|
|
12939
12998
|
title: t3.transferCrypto.title,
|
|
@@ -12942,7 +13001,7 @@ function DepositModal({
|
|
|
12942
13001
|
onClose: handleClose
|
|
12943
13002
|
}
|
|
12944
13003
|
),
|
|
12945
|
-
/* @__PURE__ */ (0,
|
|
13004
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12946
13005
|
TransferCrypto,
|
|
12947
13006
|
{
|
|
12948
13007
|
userId,
|
|
@@ -12957,18 +13016,18 @@ function DepositModal({
|
|
|
12957
13016
|
wallets
|
|
12958
13017
|
}
|
|
12959
13018
|
)
|
|
12960
|
-
] }) : /* @__PURE__ */ (0,
|
|
12961
|
-
/* @__PURE__ */ (0,
|
|
13019
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
13020
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12962
13021
|
DepositHeader,
|
|
12963
13022
|
{
|
|
12964
|
-
title: cardView === "quotes" ? t3.quotes :
|
|
13023
|
+
title: cardView === "quotes" ? t3.quotes : t3.depositWithCard.title,
|
|
12965
13024
|
showBack: true,
|
|
12966
13025
|
onBack: handleBack,
|
|
12967
13026
|
onClose: handleClose,
|
|
12968
13027
|
badge: cardView === "quotes" ? { count: quotesCount } : void 0
|
|
12969
13028
|
}
|
|
12970
13029
|
),
|
|
12971
|
-
/* @__PURE__ */ (0,
|
|
13030
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12972
13031
|
BuyWithCard,
|
|
12973
13032
|
{
|
|
12974
13033
|
userId,
|
|
@@ -12990,11 +13049,12 @@ function DepositModal({
|
|
|
12990
13049
|
] })
|
|
12991
13050
|
}
|
|
12992
13051
|
),
|
|
12993
|
-
/* @__PURE__ */ (0,
|
|
13052
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
12994
13053
|
DepositsModal,
|
|
12995
13054
|
{
|
|
12996
13055
|
open: depositsModalOpen,
|
|
12997
13056
|
onOpenChange: setDepositsModalOpen,
|
|
13057
|
+
onCloseAll: handleClose,
|
|
12998
13058
|
executions: depositExecutions,
|
|
12999
13059
|
userId,
|
|
13000
13060
|
publishableKey,
|
|
@@ -13003,6 +13063,45 @@ function DepositModal({
|
|
|
13003
13063
|
)
|
|
13004
13064
|
] }) });
|
|
13005
13065
|
}
|
|
13066
|
+
var buttonVariants = cva(
|
|
13067
|
+
"uf-inline-flex uf-items-center uf-justify-center uf-whitespace-nowrap uf-rounded-md uf-text-sm uf-font-medium uf-ring-offset-background uf-transition-colors focus-visible:uf-outline-none focus-visible:uf-ring-2 focus-visible:uf-ring-ring focus-visible:uf-ring-offset-2 disabled:uf-pointer-events-none disabled:uf-opacity-50",
|
|
13068
|
+
{
|
|
13069
|
+
variants: {
|
|
13070
|
+
variant: {
|
|
13071
|
+
default: "uf-bg-primary uf-text-primary-foreground hover:uf-bg-primary/90",
|
|
13072
|
+
destructive: "uf-bg-destructive uf-text-destructive-foreground hover:uf-bg-destructive/90",
|
|
13073
|
+
outline: "uf-border uf-border-input uf-bg-background hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
13074
|
+
secondary: "uf-bg-secondary uf-text-secondary-foreground hover:uf-bg-secondary/80",
|
|
13075
|
+
ghost: "hover:uf-bg-accent hover:uf-text-accent-foreground",
|
|
13076
|
+
link: "uf-text-primary uf-underline-offset-4 hover:uf-underline"
|
|
13077
|
+
},
|
|
13078
|
+
size: {
|
|
13079
|
+
default: "uf-h-10 uf-px-4 uf-py-2",
|
|
13080
|
+
sm: "uf-h-9 uf-rounded-md uf-px-3",
|
|
13081
|
+
lg: "uf-h-11 uf-rounded-md uf-px-8",
|
|
13082
|
+
icon: "uf-h-10 uf-w-10"
|
|
13083
|
+
}
|
|
13084
|
+
},
|
|
13085
|
+
defaultVariants: {
|
|
13086
|
+
variant: "default",
|
|
13087
|
+
size: "default"
|
|
13088
|
+
}
|
|
13089
|
+
}
|
|
13090
|
+
);
|
|
13091
|
+
var Button = React52.forwardRef(
|
|
13092
|
+
({ className, variant, size: size4, asChild = false, ...props }, ref) => {
|
|
13093
|
+
const Comp = asChild ? Slot3 : "button";
|
|
13094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
13095
|
+
Comp,
|
|
13096
|
+
{
|
|
13097
|
+
className: cn(buttonVariants({ variant, size: size4, className })),
|
|
13098
|
+
ref,
|
|
13099
|
+
...props
|
|
13100
|
+
}
|
|
13101
|
+
);
|
|
13102
|
+
}
|
|
13103
|
+
);
|
|
13104
|
+
Button.displayName = "Button";
|
|
13006
13105
|
|
|
13007
13106
|
// src/provider.tsx
|
|
13008
13107
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
@@ -13011,12 +13110,12 @@ function UnifoldProvider2({
|
|
|
13011
13110
|
publishableKey,
|
|
13012
13111
|
config
|
|
13013
13112
|
}) {
|
|
13014
|
-
const [isOpen, setIsOpen] = (0,
|
|
13015
|
-
const [depositConfig, setDepositConfig] = (0,
|
|
13113
|
+
const [isOpen, setIsOpen] = (0, import_react15.useState)(false);
|
|
13114
|
+
const [depositConfig, setDepositConfig] = (0, import_react15.useState)(
|
|
13016
13115
|
null
|
|
13017
13116
|
);
|
|
13018
|
-
const [resolvedTheme, setResolvedTheme] =
|
|
13019
|
-
|
|
13117
|
+
const [resolvedTheme, setResolvedTheme] = import_react15.default.useState("dark");
|
|
13118
|
+
import_react15.default.useEffect(() => {
|
|
13020
13119
|
const appearance = config?.appearance || "dark";
|
|
13021
13120
|
if (appearance === "auto") {
|
|
13022
13121
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
@@ -13031,9 +13130,9 @@ function UnifoldProvider2({
|
|
|
13031
13130
|
setResolvedTheme(appearance);
|
|
13032
13131
|
}
|
|
13033
13132
|
}, [config?.appearance]);
|
|
13034
|
-
const depositPromiseRef =
|
|
13035
|
-
const closeTimeoutRef =
|
|
13036
|
-
const beginDeposit = (0,
|
|
13133
|
+
const depositPromiseRef = import_react15.default.useRef(null);
|
|
13134
|
+
const closeTimeoutRef = import_react15.default.useRef(null);
|
|
13135
|
+
const beginDeposit = (0, import_react15.useCallback)((config2) => {
|
|
13037
13136
|
console.log("[UnifoldProvider] beginDeposit called with:", config2);
|
|
13038
13137
|
if (closeTimeoutRef.current) {
|
|
13039
13138
|
clearTimeout(closeTimeoutRef.current);
|
|
@@ -13054,7 +13153,7 @@ function UnifoldProvider2({
|
|
|
13054
13153
|
setIsOpen(true);
|
|
13055
13154
|
return promise;
|
|
13056
13155
|
}, []);
|
|
13057
|
-
const closeDeposit = (0,
|
|
13156
|
+
const closeDeposit = (0, import_react15.useCallback)(() => {
|
|
13058
13157
|
if (depositPromiseRef.current) {
|
|
13059
13158
|
depositPromiseRef.current.reject({
|
|
13060
13159
|
message: "Deposit cancelled by user",
|
|
@@ -13068,7 +13167,7 @@ function UnifoldProvider2({
|
|
|
13068
13167
|
closeTimeoutRef.current = null;
|
|
13069
13168
|
}, 200);
|
|
13070
13169
|
}, []);
|
|
13071
|
-
const handleDepositSuccess = (0,
|
|
13170
|
+
const handleDepositSuccess = (0, import_react15.useCallback)((data) => {
|
|
13072
13171
|
console.log("[UnifoldProvider] Deposit success:", data);
|
|
13073
13172
|
if (depositConfig?.onSuccess) {
|
|
13074
13173
|
depositConfig.onSuccess(data);
|
|
@@ -13078,7 +13177,7 @@ function UnifoldProvider2({
|
|
|
13078
13177
|
depositPromiseRef.current = null;
|
|
13079
13178
|
}
|
|
13080
13179
|
}, [depositConfig]);
|
|
13081
|
-
const handleDepositError = (0,
|
|
13180
|
+
const handleDepositError = (0, import_react15.useCallback)((error) => {
|
|
13082
13181
|
console.error("[UnifoldProvider] Deposit error:", error);
|
|
13083
13182
|
if (depositConfig?.onError) {
|
|
13084
13183
|
depositConfig.onError(error);
|
|
@@ -13088,7 +13187,7 @@ function UnifoldProvider2({
|
|
|
13088
13187
|
depositPromiseRef.current = null;
|
|
13089
13188
|
}
|
|
13090
13189
|
}, [depositConfig]);
|
|
13091
|
-
const contextValue = (0,
|
|
13190
|
+
const contextValue = (0, import_react15.useMemo)(
|
|
13092
13191
|
() => ({
|
|
13093
13192
|
beginDeposit,
|
|
13094
13193
|
closeDeposit,
|
|
@@ -13104,7 +13203,7 @@ function UnifoldProvider2({
|
|
|
13104
13203
|
{
|
|
13105
13204
|
open: isOpen,
|
|
13106
13205
|
onOpenChange: closeDeposit,
|
|
13107
|
-
userId: depositConfig.
|
|
13206
|
+
userId: depositConfig.externalUserId,
|
|
13108
13207
|
publishableKey,
|
|
13109
13208
|
modalTitle: config?.modalTitle,
|
|
13110
13209
|
destinationTokenSymbol: depositConfig.destinationTokenSymbol,
|
|
@@ -13120,10 +13219,10 @@ function UnifoldProvider2({
|
|
|
13120
13219
|
)
|
|
13121
13220
|
] }) });
|
|
13122
13221
|
}
|
|
13123
|
-
var ConnectContext =
|
|
13222
|
+
var ConnectContext = import_react15.default.createContext(null);
|
|
13124
13223
|
function useUnifold2() {
|
|
13125
13224
|
const baseContext = useUnifold();
|
|
13126
|
-
const connectContext =
|
|
13225
|
+
const connectContext = import_react15.default.useContext(ConnectContext);
|
|
13127
13226
|
if (typeof window === "undefined") {
|
|
13128
13227
|
return {
|
|
13129
13228
|
publishableKey: "",
|
|
@@ -13151,15 +13250,12 @@ function useUnifold2() {
|
|
|
13151
13250
|
|
|
13152
13251
|
lucide-react/dist/esm/defaultAttributes.js:
|
|
13153
13252
|
lucide-react/dist/esm/createLucideIcon.js:
|
|
13154
|
-
lucide-react/dist/esm/icons/arrow-down-circle.js:
|
|
13155
13253
|
lucide-react/dist/esm/icons/arrow-left.js:
|
|
13156
|
-
lucide-react/dist/esm/icons/check-circle.js:
|
|
13157
13254
|
lucide-react/dist/esm/icons/check.js:
|
|
13158
13255
|
lucide-react/dist/esm/icons/chevron-down.js:
|
|
13159
13256
|
lucide-react/dist/esm/icons/chevron-right.js:
|
|
13160
13257
|
lucide-react/dist/esm/icons/chevron-up.js:
|
|
13161
13258
|
lucide-react/dist/esm/icons/clock.js:
|
|
13162
|
-
lucide-react/dist/esm/icons/copy.js:
|
|
13163
13259
|
lucide-react/dist/esm/icons/credit-card.js:
|
|
13164
13260
|
lucide-react/dist/esm/icons/dollar-sign.js:
|
|
13165
13261
|
lucide-react/dist/esm/icons/external-link.js:
|