@rhinestone/deposit-modal 0.1.52 → 0.1.53

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.
@@ -6,6 +6,7 @@ import {
6
6
  getExplorerTxUrl,
7
7
  getTokenAddress,
8
8
  getTokenDecimalsByAddress,
9
+ getTokenIcon,
9
10
  getTokenSymbol
10
11
  } from "./chunk-ZJQZEIHA.mjs";
11
12
 
@@ -1437,10 +1438,6 @@ function syncPhaseTimings(previous, event) {
1437
1438
  ...setCompleted && { completedAt: timestamp }
1438
1439
  };
1439
1440
  }
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
1441
  function formatElapsedTime(seconds) {
1445
1442
  if (seconds < 60) return `${seconds} second${seconds !== 1 ? "s" : ""}`;
1446
1443
  const mins = Math.floor(seconds / 60);
@@ -1755,332 +1752,236 @@ function ProcessingStep({
1755
1752
  });
1756
1753
  }
1757
1754
  })();
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
1755
  const currentPhaseId = getCurrentPhaseId(state, phaseTimings, isEarlyComplete);
1771
1756
  const activePhaseStartedAt = currentPhaseId ? getPhaseStartTime(currentPhaseId, phaseTimings) : void 0;
1772
1757
  const activePhaseElapsedMs = isProcessing && activePhaseStartedAt !== void 0 ? timelineNowMs - activePhaseStartedAt : 0;
1773
1758
  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
- },
1759
+ 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}` : `Submitting transaction...`;
1760
+ 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 were successfully deposited." : 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)}.` : "Filling your transaction on the blockchain.";
1761
+ const showAlert = !isFailed && (delayPhaseId !== void 0 || hasEscalatedDelay);
1762
+ const alertMessage = hasEscalatedDelay ? "Taking longer than expected. You can close this window \u2014 processing continues in the background." : "This step is slower than usual but still processing.";
1763
+ const fillStatus = isComplete ? "Successful" : isFailed ? "Failed" : "Processing";
1764
+ const fillStatusClass = isComplete ? "rs-card-value--success" : isFailed ? "rs-card-value--error" : "";
1765
+ const [detailsExpanded, setDetailsExpanded] = useState(false);
1766
+ const txLinkIcon = /* @__PURE__ */ jsx7("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsx7(
1767
+ "path",
1802
1768
  {
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"
1769
+ strokeLinecap: "round",
1770
+ strokeLinejoin: "round",
1771
+ 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"
1814
1772
  }
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",
1773
+ ) });
1774
+ return /* @__PURE__ */ jsxs6("div", { className: "rs-step", children: [
1775
+ /* @__PURE__ */ jsxs6("div", { className: "rs-step-header--centered", children: [
1776
+ isFailed ? /* @__PURE__ */ jsx7("div", { className: "rs-failed-badge", children: /* @__PURE__ */ jsxs6(
1777
+ "svg",
1893
1778
  {
1894
- className: "rs-card-value",
1895
- style: { display: "flex", alignItems: "center", gap: 6 },
1779
+ viewBox: "0 0 24 24",
1780
+ fill: "none",
1781
+ stroke: "currentColor",
1782
+ strokeWidth: "2",
1896
1783
  children: [
1897
- getChainIcon(displaySourceChain) && /* @__PURE__ */ jsx7(
1898
- "img",
1784
+ /* @__PURE__ */ jsx7(
1785
+ "path",
1899
1786
  {
1900
- src: getChainIcon(displaySourceChain),
1901
- alt: "",
1902
- style: { width: 14, height: 14, borderRadius: "50%" }
1787
+ strokeLinecap: "round",
1788
+ strokeLinejoin: "round",
1789
+ d: "M12 9v3.75m0 3.75h.008v.008H12v-.008z"
1903
1790
  }
1904
1791
  ),
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",
1792
+ /* @__PURE__ */ jsx7(
1793
+ "path",
1920
1794
  {
1921
- src: getChainIcon(targetChain),
1922
- alt: "",
1923
- style: { width: 14, height: 14, borderRadius: "50%" }
1795
+ strokeLinecap: "round",
1796
+ strokeLinejoin: "round",
1797
+ 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"
1924
1798
  }
1925
- ),
1926
- getChainName(targetChain)
1799
+ )
1927
1800
  ]
1928
1801
  }
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",
1802
+ ) }) : isComplete ? /* @__PURE__ */ jsx7("div", { className: "rs-success-badge", children: /* @__PURE__ */ jsx7(
1803
+ "svg",
1935
1804
  {
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),
1942
- /* @__PURE__ */ jsx7(
1943
- "svg",
1944
- {
1945
- viewBox: "0 0 24 24",
1946
- fill: "none",
1947
- stroke: "currentColor",
1948
- strokeWidth: "2.5",
1949
- children: /* @__PURE__ */ jsx7(
1950
- "path",
1805
+ viewBox: "0 0 24 24",
1806
+ fill: "none",
1807
+ stroke: "currentColor",
1808
+ strokeWidth: "2.5",
1809
+ children: /* @__PURE__ */ jsx7(
1810
+ "path",
1811
+ {
1812
+ strokeLinecap: "round",
1813
+ strokeLinejoin: "round",
1814
+ d: "M5 12l5 5L20 7"
1815
+ }
1816
+ )
1817
+ }
1818
+ ) }) : /* @__PURE__ */ jsx7("div", { className: "rs-processing-badge", children: /* @__PURE__ */ jsx7(Spinner, {}) }),
1819
+ /* @__PURE__ */ jsx7("div", { className: "rs-step-title", children: headerTitle }),
1820
+ /* @__PURE__ */ jsx7("div", { className: "rs-step-description rs-text-secondary", children: headerDescription })
1821
+ ] }),
1822
+ /* @__PURE__ */ jsxs6("div", { className: "rs-step-body rs-space-y-3", children: [
1823
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card", children: [
1824
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1825
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Fill status" }),
1826
+ /* @__PURE__ */ jsx7("span", { className: `rs-card-value ${fillStatusClass}`, children: fillStatus })
1827
+ ] }),
1828
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1829
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Total time" }),
1830
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-value", children: formatElapsedTime(elapsedSeconds) })
1831
+ ] })
1832
+ ] }),
1833
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card", children: [
1834
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1835
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Source" }),
1836
+ /* @__PURE__ */ jsxs6(
1837
+ "span",
1838
+ {
1839
+ className: "rs-card-value",
1840
+ style: { display: "flex", alignItems: "center", gap: 6 },
1841
+ children: [
1842
+ getChainIcon(displaySourceChain) && /* @__PURE__ */ jsx7(
1843
+ "img",
1951
1844
  {
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"
1845
+ src: getChainIcon(displaySourceChain),
1846
+ alt: "",
1847
+ style: { width: 16, height: 16, borderRadius: 3 }
1848
+ }
1849
+ ),
1850
+ getChainName(displaySourceChain),
1851
+ sourceExplorerUrl && /* @__PURE__ */ jsx7(
1852
+ "a",
1853
+ {
1854
+ href: sourceExplorerUrl,
1855
+ target: "_blank",
1856
+ rel: "noopener noreferrer",
1857
+ className: "rs-card-external-link",
1858
+ children: txLinkIcon
1955
1859
  }
1956
1860
  )
1957
- }
1958
- )
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" }),
1861
+ ]
1862
+ }
1863
+ )
1864
+ ] }),
1865
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1866
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Destination" }),
1867
+ /* @__PURE__ */ jsxs6(
1868
+ "span",
1869
+ {
1870
+ className: "rs-card-value",
1871
+ style: { display: "flex", alignItems: "center", gap: 6 },
1872
+ children: [
1873
+ getChainIcon(targetChain) && /* @__PURE__ */ jsx7(
1874
+ "img",
1875
+ {
1876
+ src: getChainIcon(targetChain),
1877
+ alt: "",
1878
+ style: { width: 16, height: 16, borderRadius: 3 }
1879
+ }
1880
+ ),
1881
+ getChainName(targetChain),
1882
+ destExplorerUrl && /* @__PURE__ */ jsx7(
1883
+ "a",
1884
+ {
1885
+ href: destExplorerUrl,
1886
+ target: "_blank",
1887
+ rel: "noopener noreferrer",
1888
+ className: "rs-card-external-link",
1889
+ children: txLinkIcon
1890
+ }
1891
+ )
1892
+ ]
1893
+ }
1894
+ )
1895
+ ] })
1896
+ ] }),
1897
+ /* @__PURE__ */ jsx7("div", { className: "rs-card", children: /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1898
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "You receive" }),
1899
+ /* @__PURE__ */ jsxs6(
1900
+ "span",
1901
+ {
1902
+ className: "rs-card-value",
1903
+ style: { display: "flex", alignItems: "center", gap: 6 },
1904
+ children: [
1905
+ getTokenIcon(sourceSymbol) && /* @__PURE__ */ jsx7(
1906
+ "img",
1907
+ {
1908
+ src: getTokenIcon(sourceSymbol),
1909
+ alt: "",
1910
+ style: { width: 16, height: 16, borderRadius: "50%" }
1911
+ }
1912
+ ),
1913
+ formattedReceivedAmount,
1914
+ " ",
1915
+ sourceSymbol
1916
+ ]
1917
+ }
1918
+ )
1919
+ ] }) }),
1965
1920
  /* @__PURE__ */ jsxs6(
1966
- "a",
1921
+ "button",
1967
1922
  {
1968
- href: destExplorerUrl,
1969
- target: "_blank",
1970
- rel: "noopener noreferrer",
1971
- className: "rs-link rs-link-external rs-font-mono rs-text-xs",
1923
+ type: "button",
1924
+ className: `rs-details-toggle ${detailsExpanded ? "rs-details-toggle--open" : ""}`,
1925
+ onClick: () => setDetailsExpanded(!detailsExpanded),
1972
1926
  children: [
1973
- truncateHash(destinationTxHash),
1927
+ detailsExpanded ? "Less details" : "More details",
1974
1928
  /* @__PURE__ */ jsx7(
1975
1929
  "svg",
1976
1930
  {
1977
1931
  viewBox: "0 0 24 24",
1978
1932
  fill: "none",
1979
1933
  stroke: "currentColor",
1980
- strokeWidth: "2.5",
1981
- style: { width: 12, height: 12 },
1934
+ strokeWidth: "2",
1982
1935
  children: /* @__PURE__ */ jsx7(
1983
1936
  "path",
1984
1937
  {
1985
1938
  strokeLinecap: "round",
1986
1939
  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"
1940
+ d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
1988
1941
  }
1989
1942
  )
1990
1943
  }
1991
1944
  )
1992
1945
  ]
1993
1946
  }
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",
2018
- {
2019
- viewBox: "0 0 24 24",
2020
- fill: "none",
2021
- stroke: "currentColor",
2022
- strokeWidth: "2",
2023
- children: [
2024
- /* @__PURE__ */ jsx7(
2025
- "path",
2026
- {
2027
- strokeLinecap: "round",
2028
- strokeLinejoin: "round",
2029
- d: "M12 9v3.75m0 3.75h.008v.008H12v-.008z"
2030
- }
2031
- ),
2032
- /* @__PURE__ */ jsx7(
2033
- "path",
2034
- {
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"
2038
- }
2039
- )
2040
- ]
2041
- }
2042
- ) : isComplete ? /* @__PURE__ */ jsx7(
2043
- "svg",
2044
- {
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
- )
2057
- }
2058
- ) : delayPhaseId || hasEscalatedDelay ? /* @__PURE__ */ jsx7(
2059
- "svg",
2060
- {
2061
- viewBox: "0 0 24 24",
2062
- fill: "none",
2063
- stroke: "currentColor",
2064
- strokeWidth: "2",
2065
- children: /* @__PURE__ */ jsx7(
2066
- "path",
2067
- {
2068
- strokeLinecap: "round",
2069
- strokeLinejoin: "round",
2070
- d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"
2071
- }
2072
- )
2073
- }
2074
- ) : /* @__PURE__ */ jsx7(Spinner, {})
2075
- }
2076
- ),
2077
- /* @__PURE__ */ jsx7("div", { className: "rs-step-title", children: headerTitle })
1947
+ ),
1948
+ detailsExpanded && /* @__PURE__ */ jsxs6("div", { className: "rs-card", children: [
1949
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1950
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Source tx" }),
1951
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-value", children: sourceExplorerUrl ? /* @__PURE__ */ jsxs6(
1952
+ "a",
1953
+ {
1954
+ href: sourceExplorerUrl,
1955
+ target: "_blank",
1956
+ rel: "noopener noreferrer",
1957
+ className: "rs-card-external-link",
1958
+ style: { gap: 4, fontFamily: "ui-monospace, SFMono-Regular, monospace", fontSize: 12 },
1959
+ children: [
1960
+ truncateHash(txHash),
1961
+ txLinkIcon
1962
+ ]
1963
+ }
1964
+ ) : /* @__PURE__ */ jsx7("span", { style: { fontFamily: "ui-monospace, SFMono-Regular, monospace", fontSize: 12 }, children: truncateHash(txHash) }) })
1965
+ ] }),
1966
+ destinationTxHash && /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1967
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Destination tx" }),
1968
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-value", children: destExplorerUrl ? /* @__PURE__ */ jsxs6(
1969
+ "a",
1970
+ {
1971
+ href: destExplorerUrl,
1972
+ target: "_blank",
1973
+ rel: "noopener noreferrer",
1974
+ className: "rs-card-external-link",
1975
+ style: { gap: 4, fontFamily: "ui-monospace, SFMono-Regular, monospace", fontSize: 12 },
1976
+ children: [
1977
+ truncateHash(destinationTxHash),
1978
+ txLinkIcon
1979
+ ]
1980
+ }
1981
+ ) : /* @__PURE__ */ jsx7("span", { style: { fontFamily: "ui-monospace, SFMono-Regular, monospace", fontSize: 12 }, children: truncateHash(destinationTxHash) }) })
1982
+ ] })
2078
1983
  ] }),
2079
- /* @__PURE__ */ jsx7("div", { className: "rs-step-description rs-text-secondary", children: headerDescription })
2080
- ] }),
2081
- /* @__PURE__ */ jsxs6("div", { className: "rs-step-body rs-space-y-3", children: [
2082
- renderPhaseBoard(),
2083
- /* @__PURE__ */ jsxs6("div", { className: `rs-alert rs-alert--${infoAlertTone}`, children: [
1984
+ showAlert && /* @__PURE__ */ jsxs6("div", { className: "rs-alert rs-alert--warning", children: [
2084
1985
  /* @__PURE__ */ jsx7(
2085
1986
  "svg",
2086
1987
  {
@@ -2094,17 +1995,21 @@ function ProcessingStep({
2094
1995
  {
2095
1996
  strokeLinecap: "round",
2096
1997
  strokeLinejoin: "round",
2097
- 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"
1998
+ d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"
2098
1999
  }
2099
2000
  )
2100
2001
  }
2101
2002
  ),
2102
- /* @__PURE__ */ jsx7("p", { className: "rs-alert-text", children: infoAlertMessage })
2103
- ] }),
2104
- renderPrimarySummaryCard(),
2105
- renderRouteCard()
2003
+ /* @__PURE__ */ jsx7("p", { className: "rs-alert-text", children: alertMessage })
2004
+ ] })
2005
+ ] }),
2006
+ (isComplete || isFailed) && /* @__PURE__ */ jsxs6("div", { className: "rs-step-footer", style: { gap: 8, display: "flex" }, children: [
2007
+ /* @__PURE__ */ jsx7(Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Close" }),
2008
+ onNewDeposit && /* @__PURE__ */ jsxs6(Button, { onClick: onNewDeposit, fullWidth: true, children: [
2009
+ "New ",
2010
+ flowNoun
2011
+ ] })
2106
2012
  ] }),
2107
- renderFooter(),
2108
2013
  /* @__PURE__ */ jsx7(PoweredBy, {})
2109
2014
  ] });
2110
2015
  }