@rhinestone/deposit-modal 0.1.52 → 0.1.54

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.
Files changed (36) hide show
  1. package/dist/{DepositModalReown-63LD7KSU.mjs → DepositModalReown-5QKEE7R3.mjs} +4 -4
  2. package/dist/{DepositModalReown-SXQJYLTX.cjs → DepositModalReown-XKP2Z55X.cjs} +7 -7
  3. package/dist/{WithdrawModalReown-PUIM36NO.mjs → WithdrawModalReown-DN6OKFGR.mjs} +4 -4
  4. package/dist/{WithdrawModalReown-JD665MKM.cjs → WithdrawModalReown-ZQCNJLSP.cjs} +7 -7
  5. package/dist/{chunk-VYYJWMEI.mjs → chunk-AJUR6FAP.mjs} +121 -27
  6. package/dist/{chunk-ZJQZEIHA.mjs → chunk-CIXHTOO3.mjs} +1 -1
  7. package/dist/{chunk-RVKMKH2C.cjs → chunk-EAEDK474.cjs} +250 -319
  8. package/dist/{chunk-JL3R3JT6.cjs → chunk-GOMHX544.cjs} +80 -74
  9. package/dist/{chunk-MKSZIA74.mjs → chunk-JQTV5JTB.mjs} +238 -307
  10. package/dist/{chunk-UPA7N6GY.mjs → chunk-MBURQ26S.mjs} +10 -1
  11. package/dist/{chunk-XAGXQV4K.cjs → chunk-N2Y34LQO.cjs} +9 -0
  12. package/dist/{chunk-ZW4SRCW5.cjs → chunk-QJVXCBUI.cjs} +332 -238
  13. package/dist/{chunk-NELAYNA3.cjs → chunk-R6U6BHCV.cjs} +1 -1
  14. package/dist/{chunk-R64A3IEI.mjs → chunk-XXB2LVUB.mjs} +23 -17
  15. package/dist/constants.cjs +2 -2
  16. package/dist/constants.mjs +1 -1
  17. package/dist/deposit.cjs +4 -4
  18. package/dist/deposit.d.cts +2 -2
  19. package/dist/deposit.d.ts +2 -2
  20. package/dist/deposit.mjs +3 -3
  21. package/dist/index.cjs +5 -5
  22. package/dist/index.d.cts +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.mjs +4 -4
  25. package/dist/reown.cjs +5 -5
  26. package/dist/reown.d.cts +1 -1
  27. package/dist/reown.d.ts +1 -1
  28. package/dist/reown.mjs +4 -4
  29. package/dist/styles.css +357 -243
  30. package/dist/{types-D1nvo2dK.d.ts → types-BPE95RUG.d.ts} +2 -0
  31. package/dist/{types-DgiqazTb.d.cts → types-Cm5vGVK2.d.cts} +2 -0
  32. package/dist/withdraw.cjs +4 -4
  33. package/dist/withdraw.d.cts +2 -2
  34. package/dist/withdraw.d.ts +2 -2
  35. package/dist/withdraw.mjs +3 -3
  36. package/package.json +1 -1
@@ -6,8 +6,9 @@ import {
6
6
  getExplorerTxUrl,
7
7
  getTokenAddress,
8
8
  getTokenDecimalsByAddress,
9
+ getTokenIcon,
9
10
  getTokenSymbol
10
- } from "./chunk-ZJQZEIHA.mjs";
11
+ } from "./chunk-CIXHTOO3.mjs";
11
12
 
12
13
  // src/components/ui/Modal.tsx
13
14
  import {
@@ -30,7 +31,8 @@ function Modal({
30
31
  onClose,
31
32
  children,
32
33
  className = "",
33
- inline = false
34
+ inline = false,
35
+ closeOnOverlayClick = false
34
36
  }) {
35
37
  const overlayRef = useRef(null);
36
38
  const contentRef = useRef(null);
@@ -94,11 +96,11 @@ function Modal({
94
96
  );
95
97
  const handleOverlayClick = useCallback(
96
98
  (event) => {
97
- if (event.target === overlayRef.current) {
99
+ if (closeOnOverlayClick && event.target === overlayRef.current) {
98
100
  onClose();
99
101
  }
100
102
  },
101
- [onClose]
103
+ [closeOnOverlayClick, onClose]
102
104
  );
103
105
  if (!isOpen) return null;
104
106
  if (inline) {
@@ -765,21 +767,46 @@ function formatUserError(raw) {
765
767
  if (lower.includes("execution reverted")) {
766
768
  return "Transaction would fail on-chain";
767
769
  }
770
+ if (lower.includes("timed out") || lower.includes("took too long")) {
771
+ return "Request timed out \u2014 please try again";
772
+ }
773
+ if (lower.includes("econnrefused") || lower.includes("econnreset") || lower.includes("enotfound") || lower.includes("fetch failed")) {
774
+ return "Service unavailable \u2014 please try again";
775
+ }
768
776
  if (lower.includes("recent blockhash") || lower.includes("latest blockhash")) {
769
777
  return "Solana RPC unavailable \u2014 please retry";
770
778
  }
771
779
  if (lower.includes("network") || lower.includes("disconnected")) {
772
780
  return "Network error \u2014 check your connection";
773
781
  }
774
- const detailsCut = raw.indexOf("\n\nRequest Arguments:");
775
- if (detailsCut !== -1) {
776
- const short = raw.slice(0, detailsCut).trim();
777
- return short.length > 80 ? short.slice(0, 80) + "..." : short;
782
+ if (lower.includes("rate limit") || lower.includes("429")) {
783
+ return "Rate limited \u2014 please try again shortly";
784
+ }
785
+ let cleaned = raw;
786
+ const stripMarkers = [
787
+ "\n\nRequest Arguments:",
788
+ "\nRaw Call Arguments:",
789
+ "\nRequest body:",
790
+ "\nContract Call:",
791
+ "\nDocs:",
792
+ "\nDetails:",
793
+ "\nVersion:",
794
+ "\nURL:"
795
+ ];
796
+ for (const marker of stripMarkers) {
797
+ const idx = cleaned.indexOf(marker);
798
+ if (idx !== -1) {
799
+ cleaned = cleaned.slice(0, idx).trim();
800
+ }
801
+ }
802
+ cleaned = cleaned.replace(/https?:\/\/\S+/g, "").trim();
803
+ if (cleaned.length === 0) {
804
+ return "An unexpected error occurred";
778
805
  }
779
- if (raw.length > 80) {
780
- return raw.slice(0, 80) + "...";
806
+ if (cleaned.length > 120) {
807
+ return cleaned.slice(0, 120) + "...";
781
808
  }
782
- return raw;
809
+ return cleaned;
783
810
  }
784
811
 
785
812
  // src/core/theme.ts
@@ -1437,10 +1464,6 @@ function syncPhaseTimings(previous, event) {
1437
1464
  ...setCompleted && { completedAt: timestamp }
1438
1465
  };
1439
1466
  }
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
1467
  function formatElapsedTime(seconds) {
1445
1468
  if (seconds < 60) return `${seconds} second${seconds !== 1 ? "s" : ""}`;
1446
1469
  const mins = Math.floor(seconds / 60);
@@ -1755,332 +1778,236 @@ function ProcessingStep({
1755
1778
  });
1756
1779
  }
1757
1780
  })();
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
1781
  const currentPhaseId = getCurrentPhaseId(state, phaseTimings, isEarlyComplete);
1771
1782
  const activePhaseStartedAt = currentPhaseId ? getPhaseStartTime(currentPhaseId, phaseTimings) : void 0;
1772
1783
  const activePhaseElapsedMs = isProcessing && activePhaseStartedAt !== void 0 ? timelineNowMs - activePhaseStartedAt : 0;
1773
1784
  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
- },
1785
+ 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...`;
1786
+ 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.";
1787
+ const showAlert = !isFailed && (delayPhaseId !== void 0 || hasEscalatedDelay);
1788
+ 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.";
1789
+ const fillStatus = isComplete ? "Successful" : isFailed ? "Failed" : "Processing";
1790
+ const fillStatusClass = isComplete ? "rs-card-value--success" : isFailed ? "rs-card-value--error" : "";
1791
+ const [detailsExpanded, setDetailsExpanded] = useState(false);
1792
+ const txLinkIcon = /* @__PURE__ */ jsx7("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsx7(
1793
+ "path",
1802
1794
  {
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"
1795
+ strokeLinecap: "round",
1796
+ strokeLinejoin: "round",
1797
+ 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
1798
  }
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",
1799
+ ) });
1800
+ return /* @__PURE__ */ jsxs6("div", { className: "rs-step", children: [
1801
+ /* @__PURE__ */ jsxs6("div", { className: "rs-step-header--centered", children: [
1802
+ isFailed ? /* @__PURE__ */ jsx7("div", { className: "rs-failed-badge", children: /* @__PURE__ */ jsxs6(
1803
+ "svg",
1893
1804
  {
1894
- className: "rs-card-value",
1895
- style: { display: "flex", alignItems: "center", gap: 6 },
1805
+ viewBox: "0 0 24 24",
1806
+ fill: "none",
1807
+ stroke: "currentColor",
1808
+ strokeWidth: "2",
1896
1809
  children: [
1897
- getChainIcon(displaySourceChain) && /* @__PURE__ */ jsx7(
1898
- "img",
1810
+ /* @__PURE__ */ jsx7(
1811
+ "path",
1899
1812
  {
1900
- src: getChainIcon(displaySourceChain),
1901
- alt: "",
1902
- style: { width: 14, height: 14, borderRadius: "50%" }
1813
+ strokeLinecap: "round",
1814
+ strokeLinejoin: "round",
1815
+ d: "M12 9v3.75m0 3.75h.008v.008H12v-.008z"
1903
1816
  }
1904
1817
  ),
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",
1818
+ /* @__PURE__ */ jsx7(
1819
+ "path",
1920
1820
  {
1921
- src: getChainIcon(targetChain),
1922
- alt: "",
1923
- style: { width: 14, height: 14, borderRadius: "50%" }
1821
+ strokeLinecap: "round",
1822
+ strokeLinejoin: "round",
1823
+ 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
1824
  }
1925
- ),
1926
- getChainName(targetChain)
1825
+ )
1927
1826
  ]
1928
1827
  }
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",
1828
+ ) }) : isComplete ? /* @__PURE__ */ jsx7("div", { className: "rs-success-badge", children: /* @__PURE__ */ jsx7(
1829
+ "svg",
1935
1830
  {
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",
1831
+ viewBox: "0 0 24 24",
1832
+ fill: "none",
1833
+ stroke: "currentColor",
1834
+ strokeWidth: "2.5",
1835
+ children: /* @__PURE__ */ jsx7(
1836
+ "path",
1837
+ {
1838
+ strokeLinecap: "round",
1839
+ strokeLinejoin: "round",
1840
+ d: "M5 12l5 5L20 7"
1841
+ }
1842
+ )
1843
+ }
1844
+ ) }) : /* @__PURE__ */ jsx7("div", { className: "rs-processing-badge", children: /* @__PURE__ */ jsx7(Spinner, {}) }),
1845
+ /* @__PURE__ */ jsx7("div", { className: "rs-step-title", children: headerTitle }),
1846
+ /* @__PURE__ */ jsx7("div", { className: "rs-step-description rs-text-secondary", children: headerDescription })
1847
+ ] }),
1848
+ /* @__PURE__ */ jsxs6("div", { className: "rs-step-body rs-space-y-3", children: [
1849
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card", children: [
1850
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1851
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Fill status" }),
1852
+ /* @__PURE__ */ jsx7("span", { className: `rs-card-value ${fillStatusClass}`, children: fillStatus })
1853
+ ] }),
1854
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1855
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Total time" }),
1856
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-value", children: formatElapsedTime(elapsedSeconds) })
1857
+ ] })
1858
+ ] }),
1859
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card", children: [
1860
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1861
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Source" }),
1862
+ /* @__PURE__ */ jsxs6(
1863
+ "span",
1864
+ {
1865
+ className: "rs-card-value",
1866
+ style: { display: "flex", alignItems: "center", gap: 6 },
1867
+ children: [
1868
+ getChainIcon(displaySourceChain) && /* @__PURE__ */ jsx7(
1869
+ "img",
1951
1870
  {
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"
1871
+ src: getChainIcon(displaySourceChain),
1872
+ alt: "",
1873
+ style: { width: 16, height: 16, borderRadius: 3 }
1874
+ }
1875
+ ),
1876
+ getChainName(displaySourceChain),
1877
+ sourceExplorerUrl && /* @__PURE__ */ jsx7(
1878
+ "a",
1879
+ {
1880
+ href: sourceExplorerUrl,
1881
+ target: "_blank",
1882
+ rel: "noopener noreferrer",
1883
+ className: "rs-card-external-link",
1884
+ children: txLinkIcon
1955
1885
  }
1956
1886
  )
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" }),
1887
+ ]
1888
+ }
1889
+ )
1890
+ ] }),
1891
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1892
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Destination" }),
1893
+ /* @__PURE__ */ jsxs6(
1894
+ "span",
1895
+ {
1896
+ className: "rs-card-value",
1897
+ style: { display: "flex", alignItems: "center", gap: 6 },
1898
+ children: [
1899
+ getChainIcon(targetChain) && /* @__PURE__ */ jsx7(
1900
+ "img",
1901
+ {
1902
+ src: getChainIcon(targetChain),
1903
+ alt: "",
1904
+ style: { width: 16, height: 16, borderRadius: 3 }
1905
+ }
1906
+ ),
1907
+ getChainName(targetChain),
1908
+ destExplorerUrl && /* @__PURE__ */ jsx7(
1909
+ "a",
1910
+ {
1911
+ href: destExplorerUrl,
1912
+ target: "_blank",
1913
+ rel: "noopener noreferrer",
1914
+ className: "rs-card-external-link",
1915
+ children: txLinkIcon
1916
+ }
1917
+ )
1918
+ ]
1919
+ }
1920
+ )
1921
+ ] })
1922
+ ] }),
1923
+ /* @__PURE__ */ jsx7("div", { className: "rs-card", children: /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1924
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "You receive" }),
1925
+ /* @__PURE__ */ jsxs6(
1926
+ "span",
1927
+ {
1928
+ className: "rs-card-value",
1929
+ style: { display: "flex", alignItems: "center", gap: 6 },
1930
+ children: [
1931
+ getTokenIcon(sourceSymbol) && /* @__PURE__ */ jsx7(
1932
+ "img",
1933
+ {
1934
+ src: getTokenIcon(sourceSymbol),
1935
+ alt: "",
1936
+ style: { width: 16, height: 16, borderRadius: "50%" }
1937
+ }
1938
+ ),
1939
+ formattedReceivedAmount,
1940
+ " ",
1941
+ sourceSymbol
1942
+ ]
1943
+ }
1944
+ )
1945
+ ] }) }),
1965
1946
  /* @__PURE__ */ jsxs6(
1966
- "a",
1947
+ "button",
1967
1948
  {
1968
- href: destExplorerUrl,
1969
- target: "_blank",
1970
- rel: "noopener noreferrer",
1971
- className: "rs-link rs-link-external rs-font-mono rs-text-xs",
1949
+ type: "button",
1950
+ className: `rs-details-toggle ${detailsExpanded ? "rs-details-toggle--open" : ""}`,
1951
+ onClick: () => setDetailsExpanded(!detailsExpanded),
1972
1952
  children: [
1973
- truncateHash(destinationTxHash),
1953
+ detailsExpanded ? "Less details" : "More details",
1974
1954
  /* @__PURE__ */ jsx7(
1975
1955
  "svg",
1976
1956
  {
1977
1957
  viewBox: "0 0 24 24",
1978
1958
  fill: "none",
1979
1959
  stroke: "currentColor",
1980
- strokeWidth: "2.5",
1981
- style: { width: 12, height: 12 },
1960
+ strokeWidth: "2",
1982
1961
  children: /* @__PURE__ */ jsx7(
1983
1962
  "path",
1984
1963
  {
1985
1964
  strokeLinecap: "round",
1986
1965
  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"
1966
+ d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
1988
1967
  }
1989
1968
  )
1990
1969
  }
1991
1970
  )
1992
1971
  ]
1993
1972
  }
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 })
1973
+ ),
1974
+ detailsExpanded && /* @__PURE__ */ jsxs6("div", { className: "rs-card", children: [
1975
+ /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1976
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Source tx" }),
1977
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-value", children: sourceExplorerUrl ? /* @__PURE__ */ jsxs6(
1978
+ "a",
1979
+ {
1980
+ href: sourceExplorerUrl,
1981
+ target: "_blank",
1982
+ rel: "noopener noreferrer",
1983
+ className: "rs-card-external-link",
1984
+ style: { gap: 4, fontFamily: "ui-monospace, SFMono-Regular, monospace", fontSize: 12 },
1985
+ children: [
1986
+ truncateHash(txHash),
1987
+ txLinkIcon
1988
+ ]
1989
+ }
1990
+ ) : /* @__PURE__ */ jsx7("span", { style: { fontFamily: "ui-monospace, SFMono-Regular, monospace", fontSize: 12 }, children: truncateHash(txHash) }) })
1991
+ ] }),
1992
+ destinationTxHash && /* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
1993
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "Destination tx" }),
1994
+ /* @__PURE__ */ jsx7("span", { className: "rs-card-value", children: destExplorerUrl ? /* @__PURE__ */ jsxs6(
1995
+ "a",
1996
+ {
1997
+ href: destExplorerUrl,
1998
+ target: "_blank",
1999
+ rel: "noopener noreferrer",
2000
+ className: "rs-card-external-link",
2001
+ style: { gap: 4, fontFamily: "ui-monospace, SFMono-Regular, monospace", fontSize: 12 },
2002
+ children: [
2003
+ truncateHash(destinationTxHash),
2004
+ txLinkIcon
2005
+ ]
2006
+ }
2007
+ ) : /* @__PURE__ */ jsx7("span", { style: { fontFamily: "ui-monospace, SFMono-Regular, monospace", fontSize: 12 }, children: truncateHash(destinationTxHash) }) })
2008
+ ] })
2078
2009
  ] }),
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: [
2010
+ showAlert && /* @__PURE__ */ jsxs6("div", { className: "rs-alert rs-alert--warning", children: [
2084
2011
  /* @__PURE__ */ jsx7(
2085
2012
  "svg",
2086
2013
  {
@@ -2094,17 +2021,21 @@ function ProcessingStep({
2094
2021
  {
2095
2022
  strokeLinecap: "round",
2096
2023
  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"
2024
+ d: "M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"
2098
2025
  }
2099
2026
  )
2100
2027
  }
2101
2028
  ),
2102
- /* @__PURE__ */ jsx7("p", { className: "rs-alert-text", children: infoAlertMessage })
2103
- ] }),
2104
- renderPrimarySummaryCard(),
2105
- renderRouteCard()
2029
+ /* @__PURE__ */ jsx7("p", { className: "rs-alert-text", children: alertMessage })
2030
+ ] })
2031
+ ] }),
2032
+ (isComplete || isFailed) && /* @__PURE__ */ jsxs6("div", { className: "rs-step-footer", style: { gap: 8, display: "flex" }, children: [
2033
+ /* @__PURE__ */ jsx7(Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Close" }),
2034
+ onNewDeposit && /* @__PURE__ */ jsxs6(Button, { onClick: onNewDeposit, fullWidth: true, children: [
2035
+ "New ",
2036
+ flowNoun
2037
+ ] })
2106
2038
  ] }),
2107
- renderFooter(),
2108
2039
  /* @__PURE__ */ jsx7(PoweredBy, {})
2109
2040
  ] });
2110
2041
  }