@rhinestone/deposit-modal 0.1.51 → 0.1.52

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.
@@ -1223,7 +1223,7 @@ function accountFromPrivateKey(privateKey) {
1223
1223
  }
1224
1224
 
1225
1225
  // src/components/steps/ProcessingStep.tsx
1226
- import { useState, useEffect as useEffect2, useRef as useRef2 } from "react";
1226
+ import { useEffect as useEffect2, useRef as useRef2, useState } from "react";
1227
1227
  import { formatUnits } from "viem";
1228
1228
 
1229
1229
  // src/components/ui/PoweredBy.tsx
@@ -1345,11 +1345,42 @@ function txRefsMatch(a, b) {
1345
1345
  }
1346
1346
 
1347
1347
  // src/components/steps/ProcessingStep.tsx
1348
- import { Fragment, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
1348
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
1349
1349
  var INITIAL_POLL_INTERVAL = 3e3;
1350
1350
  var MAX_POLL_INTERVAL = 3e4;
1351
1351
  var BACKOFF_MULTIPLIER = 1.5;
1352
- var PROCESS_TIMEOUT_MS = 10 * 60 * 1e3;
1352
+ var ESCALATED_DELAY_MS = 10 * 60 * 1e3;
1353
+ var SOFT_DELAY_MS = {
1354
+ confirming: 90 * 1e3,
1355
+ received: 90 * 1e3,
1356
+ bridging: 4 * 60 * 1e3
1357
+ };
1358
+ var PHASE_TIMINGS_PREFIX = "rhinestone:phase-timings";
1359
+ function loadPhaseTimings(txHash) {
1360
+ if (typeof window === "undefined") return null;
1361
+ try {
1362
+ const raw = window.localStorage.getItem(`${PHASE_TIMINGS_PREFIX}:${txHash}`);
1363
+ if (!raw) return null;
1364
+ const parsed = JSON.parse(raw);
1365
+ if (typeof parsed.startedAt !== "number") return null;
1366
+ return parsed;
1367
+ } catch {
1368
+ return null;
1369
+ }
1370
+ }
1371
+ function savePhaseTimings(txHash, timings) {
1372
+ if (typeof window === "undefined") return;
1373
+ try {
1374
+ window.localStorage.setItem(
1375
+ `${PHASE_TIMINGS_PREFIX}:${txHash}`,
1376
+ JSON.stringify(timings)
1377
+ );
1378
+ } catch {
1379
+ }
1380
+ }
1381
+ function truncateHash(hash) {
1382
+ return `${hash.slice(0, 10)}...${hash.slice(-8)}`;
1383
+ }
1353
1384
  function isEventForTx(event, txHash) {
1354
1385
  const eventTxHash = getEventTxHash(event);
1355
1386
  if (!eventTxHash) return false;
@@ -1387,6 +1418,61 @@ function formatBridgeFailedMessage(event) {
1387
1418
  }
1388
1419
  return { message: "Bridge failed" };
1389
1420
  }
1421
+ function parseWebhookTimestamp(event) {
1422
+ if (typeof event?.time !== "string") return void 0;
1423
+ const timestamp = Date.parse(event.time);
1424
+ return Number.isFinite(timestamp) ? timestamp : void 0;
1425
+ }
1426
+ function syncPhaseTimings(previous, event) {
1427
+ if (!event?.type) return previous;
1428
+ const timestamp = parseWebhookTimestamp(event) ?? Date.now();
1429
+ const setReceived = (event.type === "deposit-received" || event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") && previous.receivedAt === void 0;
1430
+ const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete") && previous.bridgingAt === void 0;
1431
+ const setCompleted = event.type === "bridge-complete" && previous.completedAt === void 0;
1432
+ if (!setReceived && !setBridging && !setCompleted) return previous;
1433
+ return {
1434
+ ...previous,
1435
+ ...setReceived && { receivedAt: timestamp },
1436
+ ...setBridging && { bridgingAt: timestamp },
1437
+ ...setCompleted && { completedAt: timestamp }
1438
+ };
1439
+ }
1440
+ function getDurationSeconds(startMs, endMs) {
1441
+ if (startMs === void 0 || endMs === void 0) return void 0;
1442
+ return Math.max(0, Math.floor((endMs - startMs) / 1e3));
1443
+ }
1444
+ function formatElapsedTime(seconds) {
1445
+ if (seconds < 60) return `${seconds} second${seconds !== 1 ? "s" : ""}`;
1446
+ const mins = Math.floor(seconds / 60);
1447
+ const secs = seconds % 60;
1448
+ return `${mins}m ${secs}s`;
1449
+ }
1450
+ function getPhaseStartTime(phaseId, phaseTimings) {
1451
+ if (phaseId === "confirming") return phaseTimings.startedAt;
1452
+ if (phaseId === "received") {
1453
+ return phaseTimings.receivedAt ?? phaseTimings.startedAt;
1454
+ }
1455
+ return phaseTimings.bridgingAt ?? phaseTimings.receivedAt ?? phaseTimings.startedAt;
1456
+ }
1457
+ function getFailedPhaseId(phaseTimings) {
1458
+ if (phaseTimings.bridgingAt !== void 0) return "bridging";
1459
+ if (phaseTimings.receivedAt !== void 0) return "received";
1460
+ return "confirming";
1461
+ }
1462
+ function getCurrentPhaseId(state, phaseTimings, isEarlyComplete) {
1463
+ if (state.type === "failed") {
1464
+ return getFailedPhaseId(phaseTimings);
1465
+ }
1466
+ if (isEarlyComplete) {
1467
+ return "bridging";
1468
+ }
1469
+ if (state.type === "complete") {
1470
+ return void 0;
1471
+ }
1472
+ if (state.lastEvent?.type === "bridge-started") return "bridging";
1473
+ if (state.lastEvent?.type === "deposit-received") return "received";
1474
+ return "confirming";
1475
+ }
1390
1476
  function ProcessingStep({
1391
1477
  smartAccount,
1392
1478
  txHash,
@@ -1408,43 +1494,80 @@ function ProcessingStep({
1408
1494
  onDepositFailed,
1409
1495
  onError
1410
1496
  }) {
1497
+ const startTimeRef = useRef2(Date.now());
1498
+ const pollIntervalRef = useRef2(INITIAL_POLL_INTERVAL);
1499
+ const pollTimeoutRef = useRef2(null);
1500
+ const escalatedDelayRef = useRef2(false);
1411
1501
  const [state, setState] = useState(
1412
1502
  directTransfer ? { type: "complete" } : { type: "processing" }
1413
1503
  );
1414
1504
  const [elapsedSeconds, setElapsedSeconds] = useState(0);
1415
- const startTimeRef = useRef2(Date.now());
1416
- const intervalRef = useRef2(null);
1417
- useEffect2(() => {
1418
- if (directTransfer) {
1419
- debugLog(debug, "processing", "direct-transfer:complete", {
1420
- txHash,
1421
- flowLabel
1422
- });
1423
- onDepositComplete?.(txHash, void 0, { amount, sourceChain, sourceToken, targetChain, targetToken });
1424
- return;
1505
+ const [phaseTimings, setPhaseTimings] = useState(() => {
1506
+ const saved = loadPhaseTimings(txHash);
1507
+ if (saved) {
1508
+ startTimeRef.current = saved.startedAt;
1509
+ return saved;
1425
1510
  }
1426
- }, [debug, directTransfer, flowLabel, txHash, onDepositComplete, amount, sourceChain, sourceToken, targetChain, targetToken]);
1511
+ return { startedAt: startTimeRef.current };
1512
+ });
1513
+ const [hasEscalatedDelay, setHasEscalatedDelay] = useState(false);
1427
1514
  useEffect2(() => {
1428
- if (directTransfer) return;
1429
- startTimeRef.current = Date.now();
1430
- intervalRef.current = setInterval(() => {
1431
- setElapsedSeconds(Math.floor((Date.now() - startTimeRef.current) / 1e3));
1432
- }, 1e3);
1433
- return () => {
1434
- if (intervalRef.current) clearInterval(intervalRef.current);
1515
+ if (!directTransfer) return;
1516
+ const completedAt = Date.now();
1517
+ setPhaseTimings({
1518
+ startedAt: startTimeRef.current,
1519
+ completedAt,
1520
+ endedAt: completedAt
1521
+ });
1522
+ debugLog(debug, "processing", "direct-transfer:complete", {
1523
+ txHash,
1524
+ flowLabel
1525
+ });
1526
+ onDepositComplete?.(txHash, void 0, {
1527
+ amount,
1528
+ sourceChain,
1529
+ sourceToken,
1530
+ targetChain,
1531
+ targetToken
1532
+ });
1533
+ }, [
1534
+ amount,
1535
+ debug,
1536
+ directTransfer,
1537
+ flowLabel,
1538
+ onDepositComplete,
1539
+ sourceChain,
1540
+ sourceToken,
1541
+ targetChain,
1542
+ targetToken,
1543
+ txHash
1544
+ ]);
1545
+ useEffect2(() => {
1546
+ if (directTransfer || state.type !== "processing") return;
1547
+ const updateElapsed = () => {
1548
+ setElapsedSeconds(
1549
+ Math.floor((Date.now() - startTimeRef.current) / 1e3)
1550
+ );
1435
1551
  };
1436
- }, [directTransfer]);
1552
+ updateElapsed();
1553
+ const intervalId = setInterval(updateElapsed, 1e3);
1554
+ return () => clearInterval(intervalId);
1555
+ }, [directTransfer, state.type]);
1437
1556
  useEffect2(() => {
1438
- if (state.type === "complete" || state.type === "failed" || state.type === "error") {
1439
- if (intervalRef.current) {
1440
- clearInterval(intervalRef.current);
1441
- intervalRef.current = null;
1442
- }
1443
- }
1444
- }, [state.type]);
1445
- const pollIntervalRef = useRef2(INITIAL_POLL_INTERVAL);
1446
- const pollTimeoutRef = useRef2(null);
1447
- const processTimeoutRef = useRef2(null);
1557
+ if (state.type === "processing") return;
1558
+ const endedAt = state.type === "complete" ? phaseTimings.completedAt ?? Date.now() : Date.now();
1559
+ setElapsedSeconds(Math.floor((endedAt - startTimeRef.current) / 1e3));
1560
+ setPhaseTimings(
1561
+ (previous) => previous.endedAt !== void 0 ? previous : { ...previous, endedAt }
1562
+ );
1563
+ }, [phaseTimings.completedAt, state.type]);
1564
+ useEffect2(() => {
1565
+ if (!state.lastEvent) return;
1566
+ setPhaseTimings((previous) => syncPhaseTimings(previous, state.lastEvent));
1567
+ }, [state.lastEvent?.time, state.lastEvent?.type]);
1568
+ useEffect2(() => {
1569
+ savePhaseTimings(txHash, phaseTimings);
1570
+ }, [txHash, phaseTimings]);
1448
1571
  useEffect2(() => {
1449
1572
  if (directTransfer) return;
1450
1573
  if (state.type !== "processing") {
@@ -1480,7 +1603,13 @@ function ProcessingStep({
1480
1603
  destinationTxHash: destinationTxHash2,
1481
1604
  event: eventForCurrentTx.type
1482
1605
  });
1483
- onDepositComplete?.(txHash, destinationTxHash2, { amount, sourceChain, sourceToken, targetChain, targetToken });
1606
+ onDepositComplete?.(txHash, destinationTxHash2, {
1607
+ amount,
1608
+ sourceChain,
1609
+ sourceToken,
1610
+ targetChain,
1611
+ targetToken
1612
+ });
1484
1613
  return;
1485
1614
  }
1486
1615
  if (!waitForFinalTx && eventForCurrentTx?.type === "bridge-started") {
@@ -1489,7 +1618,13 @@ function ProcessingStep({
1489
1618
  txHash,
1490
1619
  event: eventForCurrentTx.type
1491
1620
  });
1492
- onDepositComplete?.(txHash, void 0, { amount, sourceChain, sourceToken, targetChain, targetToken });
1621
+ onDepositComplete?.(txHash, void 0, {
1622
+ amount,
1623
+ sourceChain,
1624
+ sourceToken,
1625
+ targetChain,
1626
+ targetToken
1627
+ });
1493
1628
  return;
1494
1629
  }
1495
1630
  if (eventForCurrentTx?.type === "bridge-failed") {
@@ -1521,7 +1656,10 @@ function ProcessingStep({
1521
1656
  onDepositFailed?.(txHash, errorMessage);
1522
1657
  return;
1523
1658
  }
1524
- setState({ type: "processing", lastEvent: eventForCurrentTx });
1659
+ setState((previous) => ({
1660
+ type: "processing",
1661
+ lastEvent: eventForCurrentTx ?? previous.lastEvent
1662
+ }));
1525
1663
  scheduleNextPoll();
1526
1664
  } catch (error) {
1527
1665
  debugError(debug, "processing", "poll:failure", error, {
@@ -1553,46 +1691,43 @@ function ProcessingStep({
1553
1691
  }
1554
1692
  };
1555
1693
  }, [
1694
+ amount,
1556
1695
  debug,
1557
1696
  directTransfer,
1558
- state.type,
1697
+ onDepositComplete,
1698
+ onDepositFailed,
1699
+ service,
1559
1700
  smartAccount,
1701
+ sourceChain,
1702
+ sourceToken,
1703
+ state.type,
1704
+ targetChain,
1705
+ targetToken,
1560
1706
  txHash,
1561
- service,
1562
- waitForFinalTx,
1563
- onDepositComplete,
1564
- onDepositFailed
1707
+ waitForFinalTx
1565
1708
  ]);
1566
1709
  useEffect2(() => {
1567
- if (directTransfer) return;
1568
- if (state.type !== "processing") {
1569
- if (processTimeoutRef.current) {
1570
- clearTimeout(processTimeoutRef.current);
1571
- processTimeoutRef.current = null;
1572
- }
1573
- return;
1574
- }
1575
- processTimeoutRef.current = setTimeout(() => {
1576
- const message = "Transfer is taking longer than expected. Your funds are safe and our team has been notified.";
1577
- debugLog(debug, "processing", "state:timeout", {
1710
+ if (directTransfer || state.type !== "processing") return;
1711
+ const timeoutId = setTimeout(() => {
1712
+ if (escalatedDelayRef.current) return;
1713
+ escalatedDelayRef.current = true;
1714
+ setHasEscalatedDelay(true);
1715
+ const message = "Transfer is taking longer than expected. Your funds are safe and processing will continue automatically.";
1716
+ debugLog(debug, "processing", "state:delay-escalated", {
1578
1717
  txHash,
1579
- timeoutMs: PROCESS_TIMEOUT_MS
1718
+ timeoutMs: ESCALATED_DELAY_MS
1580
1719
  });
1581
- setState({ type: "error", message });
1582
1720
  onError?.(message, "PROCESS_TIMEOUT");
1583
- }, PROCESS_TIMEOUT_MS);
1584
- return () => {
1585
- if (processTimeoutRef.current) {
1586
- clearTimeout(processTimeoutRef.current);
1587
- processTimeoutRef.current = null;
1588
- }
1589
- };
1590
- }, [debug, directTransfer, state.type, txHash, onError]);
1591
- const isDelayed = state.type === "error" || state.type === "failed";
1721
+ }, ESCALATED_DELAY_MS);
1722
+ return () => clearTimeout(timeoutId);
1723
+ }, [debug, directTransfer, onError, state.type, txHash]);
1592
1724
  const isComplete = state.type === "complete";
1725
+ const isFailed = state.type === "failed";
1593
1726
  const isProcessing = state.type === "processing";
1594
- const lastEvent = state.type === "processing" || state.type === "complete" || state.type === "failed" ? state.lastEvent : void 0;
1727
+ const lastEvent = state.lastEvent;
1728
+ const failureMessage = state.type === "failed" ? state.message : void 0;
1595
1729
  const isEarlyComplete = !waitForFinalTx && lastEvent?.type === "bridge-started";
1730
+ const timelineNowMs = phaseTimings.endedAt ?? Date.now();
1596
1731
  const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
1597
1732
  const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
1598
1733
  const destinationTxHash = lastEvent?.data?.destination?.transactionHash || null;
@@ -1602,16 +1737,12 @@ function ProcessingStep({
1602
1737
  const displayAmount = sourceDetails.amount ?? amount;
1603
1738
  const sourceExplorerUrl = getExplorerTxUrl(displaySourceChain, txHash);
1604
1739
  const destExplorerUrl = destinationTxHash ? getExplorerTxUrl(targetChain, destinationTxHash) : null;
1605
- const truncateHash = (hash) => `${hash.slice(0, 10)}...${hash.slice(-8)}`;
1606
- const formatElapsedTime = (seconds) => {
1607
- if (seconds < 60) return `${seconds} second${seconds !== 1 ? "s" : ""}`;
1608
- const mins = Math.floor(seconds / 60);
1609
- const secs = seconds % 60;
1610
- return `${mins}m ${secs}s`;
1611
- };
1612
1740
  const isEvmSourceToken = /^0x[a-fA-F0-9]{40}$/.test(displaySourceToken);
1613
1741
  const sourceSymbol = displaySourceChain === "solana" ? providedSourceSymbol ?? "SOL" : isEvmSourceToken ? getTokenSymbol(displaySourceToken, displaySourceChain) : providedSourceSymbol ?? "Token";
1614
- const sourceDecimals = displaySourceChain === "solana" ? providedSourceDecimals ?? 9 : isEvmSourceToken ? getTokenDecimalsByAddress(displaySourceToken, displaySourceChain) : providedSourceDecimals ?? 18;
1742
+ const sourceDecimals = displaySourceChain === "solana" ? providedSourceDecimals ?? 9 : isEvmSourceToken ? getTokenDecimalsByAddress(
1743
+ displaySourceToken,
1744
+ displaySourceChain
1745
+ ) : providedSourceDecimals ?? 18;
1615
1746
  const formattedReceivedAmount = (() => {
1616
1747
  try {
1617
1748
  const raw = formatUnits(BigInt(displayAmount), sourceDecimals);
@@ -1624,184 +1755,307 @@ function ProcessingStep({
1624
1755
  });
1625
1756
  }
1626
1757
  })();
1627
- if (isComplete) {
1628
- return /* @__PURE__ */ jsxs6("div", { className: "rs-step", children: [
1629
- /* @__PURE__ */ jsxs6("div", { className: "rs-step-body rs-space-y-3", children: [
1630
- /* @__PURE__ */ jsxs6("div", { className: "rs-success-state", children: [
1631
- /* @__PURE__ */ jsx7("div", { className: "rs-success-checkmark", children: /* @__PURE__ */ jsx7(
1632
- "svg",
1633
- {
1634
- viewBox: "0 0 24 24",
1635
- fill: "none",
1636
- stroke: "currentColor",
1637
- strokeWidth: "2.5",
1638
- children: /* @__PURE__ */ jsx7(
1639
- "path",
1640
- {
1641
- strokeLinecap: "round",
1642
- strokeLinejoin: "round",
1643
- d: "M5 12l5 5L20 7"
1644
- }
1645
- )
1646
- }
1647
- ) }),
1648
- /* @__PURE__ */ jsx7("div", { className: "rs-success-title", children: isEarlyComplete ? `${flowCapitalized} confirmed` : `${flowCapitalized} successful` }),
1649
- /* @__PURE__ */ jsx7("div", { className: "rs-success-subtitle", children: directTransfer ? "Your transfer is complete." : isEarlyComplete ? "Your transfer has been confirmed and funds will arrive shortly." : "Your funds have been successfully bridged." })
1650
- ] }),
1651
- /* @__PURE__ */ jsxs6("div", { className: "rs-card", children: [
1652
- /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1653
- /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Status" }),
1758
+ const detectionDurationSeconds = getDurationSeconds(
1759
+ phaseTimings.startedAt,
1760
+ phaseTimings.receivedAt
1761
+ );
1762
+ const queueDurationSeconds = getDurationSeconds(
1763
+ phaseTimings.receivedAt,
1764
+ phaseTimings.bridgingAt
1765
+ );
1766
+ const bridgeDurationSeconds = getDurationSeconds(
1767
+ phaseTimings.bridgingAt,
1768
+ phaseTimings.completedAt
1769
+ );
1770
+ const currentPhaseId = getCurrentPhaseId(state, phaseTimings, isEarlyComplete);
1771
+ const activePhaseStartedAt = currentPhaseId ? getPhaseStartTime(currentPhaseId, phaseTimings) : void 0;
1772
+ const activePhaseElapsedMs = isProcessing && activePhaseStartedAt !== void 0 ? timelineNowMs - activePhaseStartedAt : 0;
1773
+ const delayPhaseId = isProcessing && currentPhaseId && activePhaseElapsedMs >= SOFT_DELAY_MS[currentPhaseId] ? currentPhaseId : void 0;
1774
+ const statusLabel = isComplete ? isEarlyComplete ? "Confirmed" : "Successful" : isFailed ? "Failed" : delayPhaseId || hasEscalatedDelay ? "Taking longer" : "In progress";
1775
+ const phaseRows = directTransfer ? [] : [
1776
+ {
1777
+ id: "confirming",
1778
+ title: `Confirming ${flowNoun}`,
1779
+ description: phaseTimings.receivedAt !== void 0 ? `${flowCapitalized} detected on ${getChainName(displaySourceChain)}.` : "Waiting for your source-chain transaction to be detected.",
1780
+ tone: phaseTimings.receivedAt !== void 0 ? "complete" : isFailed && currentPhaseId === "confirming" ? "failed" : delayPhaseId === "confirming" ? "warning" : currentPhaseId === "confirming" ? "active" : "pending",
1781
+ statusLabel: phaseTimings.receivedAt !== void 0 ? "Done" : delayPhaseId === "confirming" ? "Delayed" : currentPhaseId === "confirming" ? "Active" : "Pending",
1782
+ timerLabel: phaseTimings.receivedAt !== void 0 ? formatElapsedTime(detectionDurationSeconds ?? 0) : currentPhaseId === "confirming" ? formatElapsedTime(
1783
+ getDurationSeconds(
1784
+ getPhaseStartTime("confirming", phaseTimings),
1785
+ timelineNowMs
1786
+ ) ?? 0
1787
+ ) : "\u2013"
1788
+ },
1789
+ {
1790
+ id: "received",
1791
+ title: `${flowCapitalized} received`,
1792
+ description: phaseTimings.bridgingAt !== void 0 ? "Funds were handed off for bridge execution." : currentPhaseId === "received" || delayPhaseId === "received" ? "Funds are in. Preparing the bridge transaction." : "Starts once the source transaction has been detected.",
1793
+ tone: phaseTimings.bridgingAt !== void 0 ? "complete" : isFailed && currentPhaseId === "received" ? "failed" : delayPhaseId === "received" ? "warning" : currentPhaseId === "received" ? "active" : "pending",
1794
+ statusLabel: phaseTimings.bridgingAt !== void 0 ? "Done" : delayPhaseId === "received" ? "Delayed" : currentPhaseId === "received" ? "Active" : "Pending",
1795
+ timerLabel: phaseTimings.bridgingAt !== void 0 ? formatElapsedTime(queueDurationSeconds ?? 0) : currentPhaseId === "received" ? formatElapsedTime(
1796
+ getDurationSeconds(
1797
+ getPhaseStartTime("received", phaseTimings),
1798
+ timelineNowMs
1799
+ ) ?? 0
1800
+ ) : phaseTimings.receivedAt !== void 0 ? "Queued" : "\u2013"
1801
+ },
1802
+ {
1803
+ id: "bridging",
1804
+ title: "Bridging",
1805
+ description: isComplete && !isEarlyComplete ? `Funds landed on ${getChainName(targetChain)}.` : isEarlyComplete ? "Bridge started successfully and will finish in the background." : currentPhaseId === "bridging" || delayPhaseId === "bridging" ? `Sending funds to ${getChainName(targetChain)}.` : "Begins after the bridge transaction is submitted.",
1806
+ tone: isComplete && !isEarlyComplete ? "complete" : isFailed && currentPhaseId === "bridging" ? "failed" : delayPhaseId === "bridging" ? "warning" : currentPhaseId === "bridging" ? "active" : "pending",
1807
+ statusLabel: isComplete && !isEarlyComplete ? "Done" : isEarlyComplete ? "In flight" : delayPhaseId === "bridging" ? "Delayed" : currentPhaseId === "bridging" ? "Active" : "Pending",
1808
+ timerLabel: isComplete && !isEarlyComplete ? formatElapsedTime(bridgeDurationSeconds ?? 0) : currentPhaseId === "bridging" ? formatElapsedTime(
1809
+ getDurationSeconds(
1810
+ getPhaseStartTime("bridging", phaseTimings),
1811
+ phaseTimings.completedAt ?? phaseTimings.endedAt ?? timelineNowMs
1812
+ ) ?? 0
1813
+ ) : phaseTimings.bridgingAt !== void 0 ? "In flight" : "\u2013"
1814
+ }
1815
+ ];
1816
+ const phaseBoardTitle = `${getChainName(displaySourceChain)} to ${getChainName(
1817
+ targetChain
1818
+ )}`;
1819
+ const highlightedMetricLabel = isEarlyComplete ? "Bridge handoff" : bridgeDurationSeconds !== void 0 ? "Bridge time" : "Total time";
1820
+ const highlightedMetricValue = isEarlyComplete ? "In flight" : bridgeDurationSeconds !== void 0 ? formatElapsedTime(bridgeDurationSeconds) : formatElapsedTime(elapsedSeconds);
1821
+ const headerTitle = isFailed ? `${flowCapitalized} could not be completed` : isComplete ? isEarlyComplete ? `${flowCapitalized} confirmed` : `${flowCapitalized} successful` : delayPhaseId === "received" ? "Bridge pending" : delayPhaseId === "bridging" ? "Bridge delayed" : delayPhaseId === "confirming" ? `Confirming ${flowNoun}` : `Processing ${flowNoun}`;
1822
+ const headerDescription = isFailed ? failureMessage ?? "The transfer could not be completed." : isComplete ? directTransfer ? "Your transfer is complete." : isEarlyComplete ? "The bridge has started. Funds will arrive shortly." : "Your funds have been successfully bridged." : delayPhaseId === "received" ? "Funds are in. We are still waiting for the bridge transaction to begin." : delayPhaseId === "bridging" ? "The bridge has started but settlement is taking longer than expected." : delayPhaseId === "confirming" ? "The source transaction has not been picked up yet, but we are still polling automatically." : state.lastEvent?.type === "deposit-received" ? "Transfer received. Preparing bridge execution." : state.lastEvent?.type === "bridge-started" ? `Bridge started. Sending funds to ${getChainName(targetChain)}.` : `Waiting for your ${flowNoun} to be detected and routed.`;
1823
+ const infoAlertTone = isFailed ? "error" : isComplete ? isEarlyComplete ? "info" : "success" : delayPhaseId || hasEscalatedDelay ? "warning" : "info";
1824
+ const infoAlertMessage = isFailed ? failureMessage ?? `Your ${flowNoun} could not be completed.` : isComplete ? directTransfer ? "This route did not require bridging." : isEarlyComplete ? "The bridge has started successfully and will finish in the background." : "Funds arrived successfully on the destination chain." : hasEscalatedDelay ? "This transfer is taking longer than expected. You can close the window and it will keep processing in the background." : delayPhaseId ? "This phase is moving slower than usual, but it is still being processed automatically." : `You can safely close this window. Your ${flowNoun} will continue in the background.`;
1825
+ const renderPhaseBoard = () => directTransfer ? null : /* @__PURE__ */ jsxs6("div", { className: "rs-phase-board", children: [
1826
+ /* @__PURE__ */ jsxs6("div", { className: "rs-phase-board-header", children: [
1827
+ /* @__PURE__ */ jsxs6("div", { children: [
1828
+ /* @__PURE__ */ jsx7("div", { className: "rs-phase-board-kicker", children: "Transfer phases" }),
1829
+ /* @__PURE__ */ jsx7("div", { className: "rs-phase-board-route", children: phaseBoardTitle })
1830
+ ] }),
1831
+ /* @__PURE__ */ jsxs6("div", { className: "rs-phase-board-total", children: [
1832
+ /* @__PURE__ */ jsx7("span", { children: "Total elapsed" }),
1833
+ /* @__PURE__ */ jsx7("strong", { children: formatElapsedTime(elapsedSeconds) })
1834
+ ] })
1835
+ ] }),
1836
+ /* @__PURE__ */ jsx7("div", { className: "rs-phase-list", children: phaseRows.map((phase) => /* @__PURE__ */ jsxs6(
1837
+ "div",
1838
+ {
1839
+ className: `rs-phase-row rs-phase-row--${phase.tone}`,
1840
+ children: [
1841
+ /* @__PURE__ */ jsx7("div", { className: "rs-phase-rail", children: /* @__PURE__ */ jsx7("span", { className: "rs-phase-dot" }) }),
1842
+ /* @__PURE__ */ jsx7("div", { className: "rs-phase-copy", children: /* @__PURE__ */ jsxs6("div", { className: "rs-phase-row-header", children: [
1843
+ /* @__PURE__ */ jsxs6("div", { className: "rs-phase-title-block", children: [
1844
+ /* @__PURE__ */ jsx7("div", { className: "rs-phase-title", children: phase.title }),
1845
+ /* @__PURE__ */ jsx7("div", { className: "rs-phase-description", children: phase.description })
1846
+ ] }),
1847
+ /* @__PURE__ */ jsxs6("div", { className: "rs-phase-meta", children: [
1848
+ /* @__PURE__ */ jsx7("span", { className: "rs-phase-status", children: phase.statusLabel }),
1849
+ /* @__PURE__ */ jsx7("span", { className: "rs-phase-timer", children: phase.timerLabel })
1850
+ ] })
1851
+ ] }) })
1852
+ ]
1853
+ },
1854
+ phase.id
1855
+ )) })
1856
+ ] });
1857
+ const renderPrimarySummaryCard = () => /* @__PURE__ */ jsxs6("div", { className: "rs-card", children: [
1858
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1859
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Status" }),
1860
+ /* @__PURE__ */ jsx7(
1861
+ "span",
1862
+ {
1863
+ className: "rs-card-value",
1864
+ style: {
1865
+ color: isFailed ? "var(--rs-error)" : isComplete ? "var(--rs-success)" : delayPhaseId || hasEscalatedDelay ? "var(--color-amber8, #e2a336)" : void 0
1866
+ },
1867
+ children: statusLabel
1868
+ }
1869
+ )
1870
+ ] }),
1871
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1872
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: highlightedMetricLabel }),
1873
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-value", children: highlightedMetricValue })
1874
+ ] }),
1875
+ !isProcessing && bridgeDurationSeconds !== void 0 && /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1876
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Total time" }),
1877
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-value", children: formatElapsedTime(elapsedSeconds) })
1878
+ ] }),
1879
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1880
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "You sent" }),
1881
+ /* @__PURE__ */ jsxs6("span", { className: "rs-card-value", children: [
1882
+ formattedReceivedAmount,
1883
+ " ",
1884
+ sourceSymbol
1885
+ ] })
1886
+ ] })
1887
+ ] });
1888
+ const renderRouteCard = () => /* @__PURE__ */ jsxs6("div", { className: "rs-card", children: [
1889
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1890
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Source" }),
1891
+ /* @__PURE__ */ jsxs6(
1892
+ "span",
1893
+ {
1894
+ className: "rs-card-value",
1895
+ style: { display: "flex", alignItems: "center", gap: 6 },
1896
+ children: [
1897
+ getChainIcon(displaySourceChain) && /* @__PURE__ */ jsx7(
1898
+ "img",
1899
+ {
1900
+ src: getChainIcon(displaySourceChain),
1901
+ alt: "",
1902
+ style: { width: 14, height: 14, borderRadius: "50%" }
1903
+ }
1904
+ ),
1905
+ getChainName(displaySourceChain)
1906
+ ]
1907
+ }
1908
+ )
1909
+ ] }),
1910
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1911
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Destination" }),
1912
+ /* @__PURE__ */ jsxs6(
1913
+ "span",
1914
+ {
1915
+ className: "rs-card-value",
1916
+ style: { display: "flex", alignItems: "center", gap: 6 },
1917
+ children: [
1918
+ getChainIcon(targetChain) && /* @__PURE__ */ jsx7(
1919
+ "img",
1920
+ {
1921
+ src: getChainIcon(targetChain),
1922
+ alt: "",
1923
+ style: { width: 14, height: 14, borderRadius: "50%" }
1924
+ }
1925
+ ),
1926
+ getChainName(targetChain)
1927
+ ]
1928
+ }
1929
+ )
1930
+ ] }),
1931
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1932
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Transaction" }),
1933
+ sourceExplorerUrl ? /* @__PURE__ */ jsxs6(
1934
+ "a",
1935
+ {
1936
+ href: sourceExplorerUrl,
1937
+ target: "_blank",
1938
+ rel: "noopener noreferrer",
1939
+ className: "rs-link rs-link-external rs-font-mono rs-text-xs",
1940
+ children: [
1941
+ truncateHash(txHash),
1654
1942
  /* @__PURE__ */ jsx7(
1655
- "span",
1943
+ "svg",
1656
1944
  {
1657
- className: "rs-card-value",
1658
- style: { color: "var(--rs-success)" },
1659
- children: isEarlyComplete ? "Confirmed" : "Successful"
1945
+ viewBox: "0 0 24 24",
1946
+ fill: "none",
1947
+ stroke: "currentColor",
1948
+ strokeWidth: "2.5",
1949
+ children: /* @__PURE__ */ jsx7(
1950
+ "path",
1951
+ {
1952
+ strokeLinecap: "round",
1953
+ strokeLinejoin: "round",
1954
+ d: "M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"
1955
+ }
1956
+ )
1660
1957
  }
1661
1958
  )
1662
- ] }),
1663
- /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1664
- /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Total time" }),
1665
- /* @__PURE__ */ jsx7("span", { className: "rs-card-value", children: formatElapsedTime(elapsedSeconds) })
1666
- ] }),
1667
- /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1668
- /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "You sent" }),
1669
- /* @__PURE__ */ jsxs6("span", { className: "rs-card-value", children: [
1670
- formattedReceivedAmount,
1671
- " ",
1672
- sourceSymbol
1673
- ] })
1674
- ] })
1675
- ] }),
1676
- /* @__PURE__ */ jsxs6("div", { className: "rs-card", children: [
1677
- /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1678
- /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Source" }),
1679
- /* @__PURE__ */ jsxs6(
1680
- "span",
1959
+ ]
1960
+ }
1961
+ ) : /* @__PURE__ */ jsx7("span", { className: "rs-card-value rs-card-value--mono", children: truncateHash(txHash) })
1962
+ ] }),
1963
+ destinationTxHash && destExplorerUrl && /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1964
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Destination tx" }),
1965
+ /* @__PURE__ */ jsxs6(
1966
+ "a",
1967
+ {
1968
+ href: destExplorerUrl,
1969
+ target: "_blank",
1970
+ rel: "noopener noreferrer",
1971
+ className: "rs-link rs-link-external rs-font-mono rs-text-xs",
1972
+ children: [
1973
+ truncateHash(destinationTxHash),
1974
+ /* @__PURE__ */ jsx7(
1975
+ "svg",
1681
1976
  {
1682
- className: "rs-card-value",
1683
- style: { display: "flex", alignItems: "center", gap: 6 },
1684
- children: [
1685
- getChainIcon(displaySourceChain) && /* @__PURE__ */ jsx7(
1686
- "img",
1687
- {
1688
- src: getChainIcon(displaySourceChain),
1689
- alt: "",
1690
- style: { width: 14, height: 14, borderRadius: "50%" }
1691
- }
1692
- ),
1693
- getChainName(displaySourceChain)
1694
- ]
1977
+ viewBox: "0 0 24 24",
1978
+ fill: "none",
1979
+ stroke: "currentColor",
1980
+ strokeWidth: "2.5",
1981
+ style: { width: 12, height: 12 },
1982
+ children: /* @__PURE__ */ jsx7(
1983
+ "path",
1984
+ {
1985
+ strokeLinecap: "round",
1986
+ strokeLinejoin: "round",
1987
+ d: "M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"
1988
+ }
1989
+ )
1695
1990
  }
1696
1991
  )
1697
- ] }),
1698
- /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1699
- /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Destination" }),
1700
- /* @__PURE__ */ jsxs6(
1701
- "span",
1992
+ ]
1993
+ }
1994
+ )
1995
+ ] })
1996
+ ] });
1997
+ const renderFooter = () => {
1998
+ if (!isComplete && !isFailed) {
1999
+ return null;
2000
+ }
2001
+ return /* @__PURE__ */ jsxs6("div", { className: "rs-step-footer", style: { gap: 8, display: "flex" }, children: [
2002
+ /* @__PURE__ */ jsx7(Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Close" }),
2003
+ onNewDeposit && /* @__PURE__ */ jsxs6(Button, { onClick: onNewDeposit, fullWidth: true, children: [
2004
+ "New ",
2005
+ flowNoun
2006
+ ] })
2007
+ ] });
2008
+ };
2009
+ return /* @__PURE__ */ jsxs6("div", { className: "rs-step", children: [
2010
+ /* @__PURE__ */ jsxs6("div", { className: "rs-step-header", children: [
2011
+ /* @__PURE__ */ jsxs6("div", { className: "rs-step-header-row", children: [
2012
+ /* @__PURE__ */ jsx7(
2013
+ "div",
2014
+ {
2015
+ className: `rs-step-icon ${isFailed ? "rs-step-icon--error" : delayPhaseId || hasEscalatedDelay ? "rs-step-icon--warning" : isComplete ? "rs-step-icon--success" : "rs-step-icon--accent"}`,
2016
+ children: isFailed ? /* @__PURE__ */ jsxs6(
2017
+ "svg",
1702
2018
  {
1703
- className: "rs-card-value",
1704
- style: { display: "flex", alignItems: "center", gap: 6 },
2019
+ viewBox: "0 0 24 24",
2020
+ fill: "none",
2021
+ stroke: "currentColor",
2022
+ strokeWidth: "2",
1705
2023
  children: [
1706
- getChainIcon(targetChain) && /* @__PURE__ */ jsx7(
1707
- "img",
2024
+ /* @__PURE__ */ jsx7(
2025
+ "path",
1708
2026
  {
1709
- src: getChainIcon(targetChain),
1710
- alt: "",
1711
- style: { width: 14, height: 14, borderRadius: "50%" }
2027
+ strokeLinecap: "round",
2028
+ strokeLinejoin: "round",
2029
+ d: "M12 9v3.75m0 3.75h.008v.008H12v-.008z"
1712
2030
  }
1713
2031
  ),
1714
- getChainName(targetChain)
1715
- ]
1716
- }
1717
- )
1718
- ] }),
1719
- sourceExplorerUrl && /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1720
- /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Transaction" }),
1721
- /* @__PURE__ */ jsxs6(
1722
- "a",
1723
- {
1724
- href: sourceExplorerUrl,
1725
- target: "_blank",
1726
- rel: "noopener noreferrer",
1727
- className: "rs-link rs-link-external rs-font-mono rs-text-xs",
1728
- children: [
1729
- truncateHash(txHash),
1730
2032
  /* @__PURE__ */ jsx7(
1731
- "svg",
2033
+ "path",
1732
2034
  {
1733
- viewBox: "0 0 24 24",
1734
- fill: "none",
1735
- stroke: "currentColor",
1736
- strokeWidth: "2.5",
1737
- style: { width: 12, height: 12 },
1738
- children: /* @__PURE__ */ jsx7(
1739
- "path",
1740
- {
1741
- strokeLinecap: "round",
1742
- strokeLinejoin: "round",
1743
- d: "M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"
1744
- }
1745
- )
2035
+ strokeLinecap: "round",
2036
+ strokeLinejoin: "round",
2037
+ d: "M10.29 3.86L1.82 18a2.25 2.25 0 001.93 3.37h16.5A2.25 2.25 0 0022.18 18L13.71 3.86a2.25 2.25 0 00-3.42 0z"
1746
2038
  }
1747
2039
  )
1748
2040
  ]
1749
2041
  }
1750
- )
1751
- ] }),
1752
- destinationTxHash && destExplorerUrl && /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1753
- /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Destination tx" }),
1754
- /* @__PURE__ */ jsxs6(
1755
- "a",
2042
+ ) : isComplete ? /* @__PURE__ */ jsx7(
2043
+ "svg",
1756
2044
  {
1757
- href: destExplorerUrl,
1758
- target: "_blank",
1759
- rel: "noopener noreferrer",
1760
- className: "rs-link rs-link-external rs-font-mono rs-text-xs",
1761
- children: [
1762
- truncateHash(destinationTxHash),
1763
- /* @__PURE__ */ jsx7(
1764
- "svg",
1765
- {
1766
- viewBox: "0 0 24 24",
1767
- fill: "none",
1768
- stroke: "currentColor",
1769
- strokeWidth: "2.5",
1770
- style: { width: 12, height: 12 },
1771
- children: /* @__PURE__ */ jsx7(
1772
- "path",
1773
- {
1774
- strokeLinecap: "round",
1775
- strokeLinejoin: "round",
1776
- d: "M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"
1777
- }
1778
- )
1779
- }
1780
- )
1781
- ]
2045
+ viewBox: "0 0 24 24",
2046
+ fill: "none",
2047
+ stroke: "currentColor",
2048
+ strokeWidth: "2.5",
2049
+ children: /* @__PURE__ */ jsx7(
2050
+ "path",
2051
+ {
2052
+ strokeLinecap: "round",
2053
+ strokeLinejoin: "round",
2054
+ d: "M5 12l5 5L20 7"
2055
+ }
2056
+ )
1782
2057
  }
1783
- )
1784
- ] })
1785
- ] })
1786
- ] }),
1787
- /* @__PURE__ */ jsxs6("div", { className: "rs-step-footer", style: { gap: 8, display: "flex" }, children: [
1788
- /* @__PURE__ */ jsx7(Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Close" }),
1789
- /* @__PURE__ */ jsxs6(Button, { onClick: onNewDeposit, fullWidth: true, children: [
1790
- "New ",
1791
- flowNoun
1792
- ] })
1793
- ] }),
1794
- /* @__PURE__ */ jsx7(PoweredBy, {})
1795
- ] });
1796
- }
1797
- return /* @__PURE__ */ jsxs6("div", { className: "rs-step", children: [
1798
- /* @__PURE__ */ jsxs6("div", { className: "rs-step-header", children: [
1799
- /* @__PURE__ */ jsxs6("div", { className: "rs-step-header-row", children: [
1800
- /* @__PURE__ */ jsx7(
1801
- "div",
1802
- {
1803
- className: `rs-step-icon ${isDelayed ? "rs-step-icon--warning" : "rs-step-icon--accent"}`,
1804
- children: isDelayed ? /* @__PURE__ */ jsx7(
2058
+ ) : delayPhaseId || hasEscalatedDelay ? /* @__PURE__ */ jsx7(
1805
2059
  "svg",
1806
2060
  {
1807
2061
  viewBox: "0 0 24 24",
@@ -1820,54 +2074,13 @@ function ProcessingStep({
1820
2074
  ) : /* @__PURE__ */ jsx7(Spinner, {})
1821
2075
  }
1822
2076
  ),
1823
- /* @__PURE__ */ jsx7("div", { className: "rs-step-title", children: isDelayed ? `${flowCapitalized} taking longer than expected` : `Bridging ${flowCapitalized}` })
2077
+ /* @__PURE__ */ jsx7("div", { className: "rs-step-title", children: headerTitle })
1824
2078
  ] }),
1825
- /* @__PURE__ */ jsxs6("div", { className: "rs-step-description rs-text-secondary", children: [
1826
- state.type === "processing" && (lastEvent?.type === "deposit-received" ? "Transfer received. Preparing bridge..." : lastEvent?.type === "bridge-started" ? "Transfer confirmed. Funds arriving shortly..." : `Bridging your ${flowNoun} to ${getChainName(targetChain)}.`),
1827
- (state.type === "failed" || state.type === "error") && "Your funds are safe. Our team has been notified and is working to complete your transfer."
1828
- ] })
2079
+ /* @__PURE__ */ jsx7("div", { className: "rs-step-description rs-text-secondary", children: headerDescription })
1829
2080
  ] }),
1830
2081
  /* @__PURE__ */ jsxs6("div", { className: "rs-step-body rs-space-y-3", children: [
1831
- isProcessing && /* @__PURE__ */ jsxs6(Fragment, { children: [
1832
- /* @__PURE__ */ jsx7("div", { className: "rs-progress-bar", children: /* @__PURE__ */ jsx7("div", { className: "rs-progress-bar-fill rs-progress-bar-fill--indeterminate" }) }),
1833
- /* @__PURE__ */ jsxs6("div", { className: "rs-alert rs-alert--info", children: [
1834
- /* @__PURE__ */ jsx7(
1835
- "svg",
1836
- {
1837
- className: "rs-alert-icon",
1838
- viewBox: "0 0 24 24",
1839
- fill: "none",
1840
- stroke: "currentColor",
1841
- strokeWidth: "2",
1842
- children: /* @__PURE__ */ jsx7(
1843
- "path",
1844
- {
1845
- strokeLinecap: "round",
1846
- strokeLinejoin: "round",
1847
- d: "M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"
1848
- }
1849
- )
1850
- }
1851
- ),
1852
- /* @__PURE__ */ jsxs6("p", { className: "rs-alert-text", children: [
1853
- "You can safely close this window. Your ",
1854
- flowNoun,
1855
- " will complete in the background."
1856
- ] })
1857
- ] }),
1858
- /* @__PURE__ */ jsxs6(
1859
- "div",
1860
- {
1861
- className: "rs-text-sm rs-text-tertiary",
1862
- style: { textAlign: "center" },
1863
- children: [
1864
- "Elapsed: ",
1865
- formatElapsedTime(elapsedSeconds)
1866
- ]
1867
- }
1868
- )
1869
- ] }),
1870
- isDelayed && /* @__PURE__ */ jsxs6("div", { className: "rs-alert rs-alert--info", children: [
2082
+ renderPhaseBoard(),
2083
+ /* @__PURE__ */ jsxs6("div", { className: `rs-alert rs-alert--${infoAlertTone}`, children: [
1871
2084
  /* @__PURE__ */ jsx7(
1872
2085
  "svg",
1873
2086
  {
@@ -1886,97 +2099,12 @@ function ProcessingStep({
1886
2099
  )
1887
2100
  }
1888
2101
  ),
1889
- /* @__PURE__ */ jsx7("p", { className: "rs-alert-text", children: "You can safely close this window. Your funds are secure and the transfer will be completed automatically." })
2102
+ /* @__PURE__ */ jsx7("p", { className: "rs-alert-text", children: infoAlertMessage })
1890
2103
  ] }),
1891
- /* @__PURE__ */ jsxs6("div", { className: "rs-card", children: [
1892
- /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1893
- /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Status" }),
1894
- /* @__PURE__ */ jsx7(
1895
- "span",
1896
- {
1897
- className: "rs-card-value",
1898
- style: { color: isDelayed ? "var(--color-amber8, #e2a336)" : void 0 },
1899
- children: isDelayed ? "Processing" : "In progress"
1900
- }
1901
- )
1902
- ] }),
1903
- /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1904
- /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Source" }),
1905
- /* @__PURE__ */ jsxs6(
1906
- "span",
1907
- {
1908
- className: "rs-card-value",
1909
- style: { display: "flex", alignItems: "center", gap: 8 },
1910
- children: [
1911
- getChainIcon(displaySourceChain) && /* @__PURE__ */ jsx7(
1912
- "img",
1913
- {
1914
- src: getChainIcon(displaySourceChain),
1915
- alt: "",
1916
- style: { width: 16, height: 16, borderRadius: "50%" }
1917
- }
1918
- ),
1919
- getChainName(displaySourceChain)
1920
- ]
1921
- }
1922
- )
1923
- ] }),
1924
- /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1925
- /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Destination" }),
1926
- /* @__PURE__ */ jsxs6(
1927
- "span",
1928
- {
1929
- className: "rs-card-value",
1930
- style: { display: "flex", alignItems: "center", gap: 8 },
1931
- children: [
1932
- getChainIcon(targetChain) && /* @__PURE__ */ jsx7(
1933
- "img",
1934
- {
1935
- src: getChainIcon(targetChain),
1936
- alt: "",
1937
- style: { width: 16, height: 16, borderRadius: "50%" }
1938
- }
1939
- ),
1940
- getChainName(targetChain)
1941
- ]
1942
- }
1943
- )
1944
- ] }),
1945
- /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1946
- /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Transaction" }),
1947
- sourceExplorerUrl ? /* @__PURE__ */ jsxs6(
1948
- "a",
1949
- {
1950
- href: sourceExplorerUrl,
1951
- target: "_blank",
1952
- rel: "noopener noreferrer",
1953
- className: "rs-link rs-link-external rs-font-mono rs-text-xs",
1954
- children: [
1955
- truncateHash(txHash),
1956
- /* @__PURE__ */ jsx7(
1957
- "svg",
1958
- {
1959
- viewBox: "0 0 24 24",
1960
- fill: "none",
1961
- stroke: "currentColor",
1962
- strokeWidth: "2.5",
1963
- children: /* @__PURE__ */ jsx7(
1964
- "path",
1965
- {
1966
- strokeLinecap: "round",
1967
- strokeLinejoin: "round",
1968
- d: "M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"
1969
- }
1970
- )
1971
- }
1972
- )
1973
- ]
1974
- }
1975
- ) : /* @__PURE__ */ jsx7("span", { className: "rs-card-value rs-card-value--mono", children: truncateHash(txHash) })
1976
- ] })
1977
- ] })
2104
+ renderPrimarySummaryCard(),
2105
+ renderRouteCard()
1978
2106
  ] }),
1979
- isDelayed && /* @__PURE__ */ jsx7("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx7(Button, { onClick: onClose, fullWidth: true, children: "Close" }) }),
2107
+ renderFooter(),
1980
2108
  /* @__PURE__ */ jsx7(PoweredBy, {})
1981
2109
  ] });
1982
2110
  }