@mintmoney/react 0.1.0-alpha.31 → 0.1.0-alpha.33

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 (162) hide show
  1. package/dist/css/styles.css +8 -6
  2. package/dist/esm/api/generated.js +31 -0
  3. package/dist/esm/api/generated.js.map +1 -1
  4. package/dist/esm/api/index.js +1 -0
  5. package/dist/esm/api/index.js.map +1 -1
  6. package/dist/esm/api/payments.js +39 -0
  7. package/dist/esm/api/payments.js.map +1 -1
  8. package/dist/esm/checkout/index.js +41 -19
  9. package/dist/esm/checkout/index.js.map +1 -1
  10. package/dist/esm/checkout/modal.js +4 -3
  11. package/dist/esm/checkout/modal.js.map +1 -1
  12. package/dist/esm/checkout/providers/wagmi-config.js +82 -0
  13. package/dist/esm/checkout/providers/wagmi-config.js.map +1 -0
  14. package/dist/esm/checkout/surplus-refund.js +38 -0
  15. package/dist/esm/checkout/surplus-refund.js.map +1 -0
  16. package/dist/esm/checkout/views/back.js +2 -2
  17. package/dist/esm/checkout/views/back.js.map +1 -1
  18. package/dist/esm/checkout/views/crypto-intent/direct-details.js +945 -96
  19. package/dist/esm/checkout/views/crypto-intent/direct-details.js.map +1 -1
  20. package/dist/esm/checkout/views/crypto-intent/methods.js +84 -31
  21. package/dist/esm/checkout/views/crypto-intent/methods.js.map +1 -1
  22. package/dist/esm/checkout/views/crypto-intent/processing.js +51 -3
  23. package/dist/esm/checkout/views/crypto-intent/processing.js.map +1 -1
  24. package/dist/esm/checkout/views/crypto-intent/success.js +58 -9
  25. package/dist/esm/checkout/views/crypto-intent/success.js.map +1 -1
  26. package/dist/esm/checkout/views/crypto-intent/wallet-payment-options.js +641 -282
  27. package/dist/esm/checkout/views/crypto-intent/wallet-payment-options.js.map +1 -1
  28. package/dist/esm/checkout/views/crypto-intent/wallet-select.js +104 -20
  29. package/dist/esm/checkout/views/crypto-intent/wallet-select.js.map +1 -1
  30. package/dist/esm/checkout/views/failed.js +83 -1
  31. package/dist/esm/checkout/views/failed.js.map +1 -1
  32. package/dist/esm/checkout/views/initial.js +46 -6
  33. package/dist/esm/checkout/views/initial.js.map +1 -1
  34. package/dist/esm/checkout/views/method-select.js +16 -4
  35. package/dist/esm/checkout/views/method-select.js.map +1 -1
  36. package/dist/esm/checkout/views/restart.js +3 -1
  37. package/dist/esm/checkout/views/restart.js.map +1 -1
  38. package/dist/esm/components/buttons/index.js +4 -1
  39. package/dist/esm/components/buttons/index.js.map +1 -1
  40. package/dist/esm/components/icons/clock.js +4 -0
  41. package/dist/esm/components/icons/clock.js.map +1 -0
  42. package/dist/esm/components/icons/edit.js +6 -0
  43. package/dist/esm/components/icons/edit.js.map +1 -0
  44. package/dist/esm/components/icons/index.js +3 -0
  45. package/dist/esm/components/icons/index.js.map +1 -1
  46. package/dist/esm/components/icons/send.js +6 -0
  47. package/dist/esm/components/icons/send.js.map +1 -0
  48. package/dist/esm/components/index.js +1 -0
  49. package/dist/esm/components/index.js.map +1 -1
  50. package/dist/esm/components/quote-expiry/index.js +2 -0
  51. package/dist/esm/components/quote-expiry/index.js.map +1 -0
  52. package/dist/esm/components/quote-expiry/quote-expiry-countdown.js +35 -0
  53. package/dist/esm/components/quote-expiry/quote-expiry-countdown.js.map +1 -0
  54. package/dist/esm/components/quote-expiry/styles.js +109 -0
  55. package/dist/esm/components/quote-expiry/styles.js.map +1 -0
  56. package/dist/esm/components/quote-expiry/tiers.js +31 -0
  57. package/dist/esm/components/quote-expiry/tiers.js.map +1 -0
  58. package/dist/esm/components/text/index.js +1 -0
  59. package/dist/esm/components/text/index.js.map +1 -1
  60. package/dist/esm/components/wallet-selector/component.js +3 -5
  61. package/dist/esm/components/wallet-selector/component.js.map +1 -1
  62. package/dist/esm/components/wallet-selector/wallets/wagmi/index.js.map +1 -1
  63. package/dist/esm/config.js.map +1 -1
  64. package/dist/esm/index.js +2 -1
  65. package/dist/esm/index.js.map +1 -1
  66. package/dist/esm/integrations/lifi.js +52 -34
  67. package/dist/esm/integrations/lifi.js.map +1 -1
  68. package/dist/esm/refund/index.js +791 -0
  69. package/dist/esm/refund/index.js.map +1 -0
  70. package/dist/esm/state/checkout/payment-attempt.js +3 -0
  71. package/dist/esm/state/checkout/payment-attempt.js.map +1 -1
  72. package/dist/esm/state/checkout/payment-lifecycle.js +66 -0
  73. package/dist/esm/state/checkout/payment-lifecycle.js.map +1 -0
  74. package/dist/esm/state/checkout/store.js +508 -55
  75. package/dist/esm/state/checkout/store.js.map +1 -1
  76. package/dist/esm/state/checkout/wallet-payment-options.js +30 -0
  77. package/dist/esm/state/checkout/wallet-payment-options.js.map +1 -0
  78. package/dist/esm/themes/default.js +6 -0
  79. package/dist/esm/themes/default.js.map +1 -1
  80. package/dist/esm/utils/string.js +1 -0
  81. package/dist/esm/utils/string.js.map +1 -1
  82. package/dist/esm/utils/wallet-errors.js +15 -0
  83. package/dist/esm/utils/wallet-errors.js.map +1 -0
  84. package/dist/types/api/generated.d.ts +207 -4
  85. package/dist/types/api/generated.d.ts.map +1 -1
  86. package/dist/types/api/index.d.ts +2 -1
  87. package/dist/types/api/index.d.ts.map +1 -1
  88. package/dist/types/api/payments.d.ts +36 -1
  89. package/dist/types/api/payments.d.ts.map +1 -1
  90. package/dist/types/api/types.d.ts +4 -0
  91. package/dist/types/api/types.d.ts.map +1 -1
  92. package/dist/types/checkout/index.d.ts +4 -1
  93. package/dist/types/checkout/index.d.ts.map +1 -1
  94. package/dist/types/checkout/modal.d.ts.map +1 -1
  95. package/dist/types/checkout/providers/wagmi-config.d.ts +12 -0
  96. package/dist/types/checkout/providers/wagmi-config.d.ts.map +1 -0
  97. package/dist/types/checkout/surplus-refund.d.ts +10 -0
  98. package/dist/types/checkout/surplus-refund.d.ts.map +1 -0
  99. package/dist/types/checkout/views/back.d.ts +2 -1
  100. package/dist/types/checkout/views/back.d.ts.map +1 -1
  101. package/dist/types/checkout/views/crypto-intent/direct-details.d.ts +10 -1
  102. package/dist/types/checkout/views/crypto-intent/direct-details.d.ts.map +1 -1
  103. package/dist/types/checkout/views/crypto-intent/methods.d.ts.map +1 -1
  104. package/dist/types/checkout/views/crypto-intent/processing.d.ts.map +1 -1
  105. package/dist/types/checkout/views/crypto-intent/success.d.ts.map +1 -1
  106. package/dist/types/checkout/views/crypto-intent/wallet-payment-options.d.ts.map +1 -1
  107. package/dist/types/checkout/views/crypto-intent/wallet-select.d.ts.map +1 -1
  108. package/dist/types/checkout/views/failed.d.ts.map +1 -1
  109. package/dist/types/checkout/views/initial.d.ts +2 -0
  110. package/dist/types/checkout/views/initial.d.ts.map +1 -1
  111. package/dist/types/checkout/views/method-select.d.ts +2 -0
  112. package/dist/types/checkout/views/method-select.d.ts.map +1 -1
  113. package/dist/types/checkout/views/restart.d.ts.map +1 -1
  114. package/dist/types/components/buttons/index.d.ts.map +1 -1
  115. package/dist/types/components/icons/clock.d.ts +6 -0
  116. package/dist/types/components/icons/clock.d.ts.map +1 -0
  117. package/dist/types/components/icons/edit.d.ts +6 -0
  118. package/dist/types/components/icons/edit.d.ts.map +1 -0
  119. package/dist/types/components/icons/index.d.ts +3 -0
  120. package/dist/types/components/icons/index.d.ts.map +1 -1
  121. package/dist/types/components/icons/send.d.ts +6 -0
  122. package/dist/types/components/icons/send.d.ts.map +1 -0
  123. package/dist/types/components/index.d.ts +1 -0
  124. package/dist/types/components/index.d.ts.map +1 -1
  125. package/dist/types/components/quote-expiry/index.d.ts +2 -0
  126. package/dist/types/components/quote-expiry/index.d.ts.map +1 -0
  127. package/dist/types/components/quote-expiry/quote-expiry-countdown.d.ts +15 -0
  128. package/dist/types/components/quote-expiry/quote-expiry-countdown.d.ts.map +1 -0
  129. package/dist/types/components/quote-expiry/styles.d.ts +22 -0
  130. package/dist/types/components/quote-expiry/styles.d.ts.map +1 -0
  131. package/dist/types/components/quote-expiry/tiers.d.ts +10 -0
  132. package/dist/types/components/quote-expiry/tiers.d.ts.map +1 -0
  133. package/dist/types/components/text/index.d.ts.map +1 -1
  134. package/dist/types/components/wallet-selector/component.d.ts +1 -2
  135. package/dist/types/components/wallet-selector/component.d.ts.map +1 -1
  136. package/dist/types/components/wallet-selector/domain.d.ts +3 -2
  137. package/dist/types/components/wallet-selector/domain.d.ts.map +1 -1
  138. package/dist/types/components/wallet-selector/wallets/wagmi/index.d.ts +41 -5
  139. package/dist/types/components/wallet-selector/wallets/wagmi/index.d.ts.map +1 -1
  140. package/dist/types/config.d.ts +4 -0
  141. package/dist/types/config.d.ts.map +1 -1
  142. package/dist/types/index.d.ts +2 -1
  143. package/dist/types/index.d.ts.map +1 -1
  144. package/dist/types/integrations/lifi.d.ts.map +1 -1
  145. package/dist/types/refund/index.d.ts +82 -0
  146. package/dist/types/refund/index.d.ts.map +1 -0
  147. package/dist/types/state/checkout/payment-attempt.d.ts.map +1 -1
  148. package/dist/types/state/checkout/payment-lifecycle.d.ts +37 -0
  149. package/dist/types/state/checkout/payment-lifecycle.d.ts.map +1 -0
  150. package/dist/types/state/checkout/store.d.ts +40 -2
  151. package/dist/types/state/checkout/store.d.ts.map +1 -1
  152. package/dist/types/state/checkout/wallet-payment-options.d.ts +18 -0
  153. package/dist/types/state/checkout/wallet-payment-options.d.ts.map +1 -0
  154. package/dist/types/themes/default.d.ts.map +1 -1
  155. package/dist/types/themes/types.d.ts +11 -0
  156. package/dist/types/themes/types.d.ts.map +1 -1
  157. package/dist/types/utils/string.d.ts +1 -0
  158. package/dist/types/utils/string.d.ts.map +1 -1
  159. package/dist/types/utils/wallet-errors.d.ts +2 -0
  160. package/dist/types/utils/wallet-errors.d.ts.map +1 -0
  161. package/package.json +25 -18
  162. package/LICENSE +0 -21
@@ -0,0 +1,791 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useAppKit } from "@reown/appkit/react";
4
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
5
+ import { disconnect, sendTransaction, switchChain, waitForTransactionReceipt, } from "@wagmi/core";
6
+ import { useEffect, useRef, useState } from "react";
7
+ import { styled, ThemeProvider } from "styled-components";
8
+ import { useAccount, useConfig, WagmiProvider } from "wagmi";
9
+ import { confirmPaymentRefund, getPaymentRefundStatus, preparePaymentRefund, } from "../api/payments.js";
10
+ import { getAppKitWagmiConfig, } from "../checkout/providers/wagmi-config.js";
11
+ import { StyledButton } from "../components/index.js";
12
+ import { WalletProvider } from "../components/wallet-selector/provider.js";
13
+ import { defaultTheme } from "../themes/default.js";
14
+ const REFUND_SELECTOR = "0x590e1ae3";
15
+ const TRON_REFUND_FEE_LIMIT_SUN = 150_000_000;
16
+ const Shell = styled.div `
17
+ width: 100%;
18
+ display: flex;
19
+ flex-direction: column;
20
+ gap: 18px;
21
+ text-align: center;
22
+ `;
23
+ const StatusPill = styled.span `
24
+ display: inline-flex;
25
+ align-items: center;
26
+ align-self: center;
27
+ padding: 7px 14px;
28
+ border-radius: 999px;
29
+ background: rgba(24, 178, 138, 0.16);
30
+ color: #68e1c0;
31
+ font-size: 11px;
32
+ font-weight: 700;
33
+ letter-spacing: 0.08em;
34
+ text-transform: uppercase;
35
+ `;
36
+ const BalancePanel = styled.div `
37
+ padding: 18px;
38
+ border-radius: 16px;
39
+ background: rgba(24, 178, 138, 0.08);
40
+ border: 1px solid rgba(104, 225, 192, 0.24);
41
+ display: flex;
42
+ flex-direction: column;
43
+ gap: 6px;
44
+ `;
45
+ const BalanceLabel = styled.div `
46
+ color: #a8b0c0;
47
+ font-size: 13px;
48
+ font-weight: 600;
49
+ `;
50
+ const BalanceValue = styled.div `
51
+ color: #edf1f7;
52
+ font-size: 32px;
53
+ line-height: 1.1;
54
+ font-weight: 800;
55
+ overflow-wrap: anywhere;
56
+ `;
57
+ const Details = styled.div `
58
+ display: flex;
59
+ flex-direction: column;
60
+ border: 1px solid rgba(148, 163, 184, 0.18);
61
+ border-radius: 14px;
62
+ overflow: hidden;
63
+ `;
64
+ const DetailRow = styled.div `
65
+ display: flex;
66
+ justify-content: space-between;
67
+ gap: 16px;
68
+ padding: 14px 16px;
69
+ border-bottom: 1px solid rgba(148, 163, 184, 0.18);
70
+ color: #9aa3b5;
71
+ font-size: 14px;
72
+ text-align: left;
73
+ background: rgba(17, 24, 39, 0.62);
74
+
75
+ strong {
76
+ color: #edf1f7;
77
+ font-weight: 600;
78
+ text-align: right;
79
+ word-break: break-word;
80
+ }
81
+
82
+ &:last-child {
83
+ border-bottom: none;
84
+ }
85
+ `;
86
+ const ErrorText = styled.p `
87
+ margin: 0;
88
+ color: #d94b4b;
89
+ font-size: 14px;
90
+ line-height: 1.5;
91
+ `;
92
+ const TitleText = styled.h1 `
93
+ margin: 0;
94
+ color: #edf1f7;
95
+ font-size: 30px;
96
+ line-height: 1;
97
+ font-weight: 700;
98
+ text-align: center;
99
+ `;
100
+ const SubtleText = styled.p `
101
+ margin: 0;
102
+ color: #a8b0c0;
103
+ font-size: 14px;
104
+ line-height: 1.5;
105
+ text-align: center;
106
+ `;
107
+ const SuccessText = styled.p `
108
+ margin: 0;
109
+ color: #68e1c0;
110
+ font-size: 14px;
111
+ line-height: 1.5;
112
+ overflow-wrap: anywhere;
113
+ `;
114
+ const TransactionLink = styled.a `
115
+ color: #8ff0d2;
116
+ text-decoration: none;
117
+ overflow-wrap: anywhere;
118
+
119
+ &:hover {
120
+ text-decoration: underline;
121
+ }
122
+ `;
123
+ const HelperText = styled.p `
124
+ margin: 0;
125
+ color: #a8b0c0;
126
+ font-size: 14px;
127
+ line-height: 1.5;
128
+ text-align: center;
129
+ max-width: 100%;
130
+ overflow-wrap: anywhere;
131
+ `;
132
+ const Actions = styled.div `
133
+ display: flex;
134
+ flex-direction: column;
135
+ gap: 10px;
136
+ `;
137
+ const Page = styled.div `
138
+ min-height: 100vh;
139
+ padding: 32px 20px;
140
+ display: flex;
141
+ flex-direction: column;
142
+ align-items: center;
143
+ justify-content: center;
144
+ gap: 24px;
145
+ position: relative;
146
+ background: #0b0e16;
147
+ color: #edf1f7;
148
+ box-sizing: border-box;
149
+ font-family: var(--mm-font-family);
150
+ `;
151
+ const PageHeader = styled.header `
152
+ position: absolute;
153
+ top: 24px;
154
+ left: 24px;
155
+ display: flex;
156
+ align-items: center;
157
+ `;
158
+ const BrandMark = styled.img `
159
+ width: 132px;
160
+ height: auto;
161
+ `;
162
+ const PageMain = styled.main `
163
+ display: flex;
164
+ align-items: center;
165
+ justify-content: center;
166
+ min-height: 100vh;
167
+ width: 100%;
168
+ `;
169
+ const PageCard = styled.div `
170
+ width: min(520px, 92vw);
171
+ border: 1px solid rgba(148, 163, 184, 0.16);
172
+ border-radius: 24px;
173
+ background: rgba(12, 17, 27, 0.72);
174
+ box-shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
175
+ padding: 30px;
176
+ display: flex;
177
+ flex-direction: column;
178
+ gap: 18px;
179
+ text-align: center;
180
+ box-sizing: border-box;
181
+
182
+ @media (max-width: 560px) {
183
+ padding: 22px;
184
+ border-radius: 20px;
185
+ }
186
+ `;
187
+ function caip2ToChainId(caip2) {
188
+ const match = /^eip155:(\d+)$/.exec(caip2);
189
+ if (!match)
190
+ return null;
191
+ return Number(match[1]);
192
+ }
193
+ function isTronChain(caip2) {
194
+ return caip2.toLowerCase().startsWith("tron:");
195
+ }
196
+ function isSubmittedRefundTxHash(value) {
197
+ return /^(?:0x)?[0-9a-fA-F]{64}$/.test(value);
198
+ }
199
+ function normalizeComparableAddress(chain, address) {
200
+ if (!address)
201
+ return null;
202
+ return isTronChain(chain) ? address.trim() : address.toLowerCase();
203
+ }
204
+ function getTronProvider() {
205
+ if (typeof window === "undefined")
206
+ return null;
207
+ return window.tron ?? window.tronLink ?? null;
208
+ }
209
+ async function requestTronWeb() {
210
+ const provider = getTronProvider();
211
+ if (!provider) {
212
+ throw new Error("TronLink is required to claim this TRON refund.");
213
+ }
214
+ if (!provider.tronWeb || !provider.tronWeb.ready) {
215
+ try {
216
+ await provider.request?.({ method: "eth_requestAccounts" });
217
+ }
218
+ catch (error) {
219
+ const message = error instanceof Error ? error.message : String(error);
220
+ throw new Error(`Unable to connect TronLink: ${message}`);
221
+ }
222
+ }
223
+ const tronWeb = provider.tronWeb || window.tronWeb;
224
+ const address = tronWeb && "defaultAddress" in tronWeb
225
+ ? tronWeb.defaultAddress?.base58
226
+ : undefined;
227
+ if (!tronWeb || !address) {
228
+ throw new Error("TronLink is not connected to a TRON account.");
229
+ }
230
+ return { tronWeb, address };
231
+ }
232
+ function decodeTronHexMessage(message) {
233
+ if (!message || !/^[0-9a-fA-F]+$/.test(message) || message.length % 2 !== 0) {
234
+ return null;
235
+ }
236
+ try {
237
+ const bytes = new Uint8Array(message.match(/.{2}/g)?.map((byte) => Number.parseInt(byte, 16)) ?? []);
238
+ return new TextDecoder().decode(bytes).trim() || null;
239
+ }
240
+ catch {
241
+ return null;
242
+ }
243
+ }
244
+ async function disconnectTronProvider() {
245
+ const provider = getTronProvider();
246
+ if (!provider)
247
+ return;
248
+ if (provider.disconnect) {
249
+ await provider.disconnect();
250
+ return;
251
+ }
252
+ for (const method of ["wallet_disconnect", "disconnect"]) {
253
+ try {
254
+ await provider.request?.({ method });
255
+ return;
256
+ }
257
+ catch {
258
+ // Some TronLink versions do not expose a disconnect RPC. Clearing SDK state
259
+ // still lets the page stop treating the previous account as connected.
260
+ }
261
+ }
262
+ }
263
+ function shortAddress(address) {
264
+ return address.length > 12
265
+ ? `${address.slice(0, 6)}...${address.slice(-4)}`
266
+ : address;
267
+ }
268
+ function formatStatusLabel(status) {
269
+ if (!status)
270
+ return "Refund";
271
+ return status.replace(/_/g, " ");
272
+ }
273
+ function formatChainLabel(chain) {
274
+ if (chain === "eip155:8453")
275
+ return "Base";
276
+ if (chain === "eip155:84532")
277
+ return "Base Sepolia";
278
+ if (chain === "tron:mainnet")
279
+ return "TRON";
280
+ if (chain === "tron:nile")
281
+ return "TRON Nile";
282
+ if (chain === "tron:shasta")
283
+ return "TRON Shasta";
284
+ if (chain.startsWith("tron:"))
285
+ return chain.replace("tron:", "TRON ");
286
+ return chain;
287
+ }
288
+ function formatTokenLabel(token) {
289
+ if (/\/(native|slip44:60)$/.test(token))
290
+ return "ETH";
291
+ const trc20Match = /\/trc20:([^/]+)$/.exec(token);
292
+ if (trc20Match)
293
+ return `TRC-20 ${shortAddress(trc20Match[1])}`;
294
+ const erc20Match = /\/erc20:(0x[a-fA-F0-9]{40})$/.exec(token);
295
+ if (!erc20Match)
296
+ return token;
297
+ const address = erc20Match[1];
298
+ if (address.toLowerCase() === "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913") {
299
+ return "USDC";
300
+ }
301
+ return `ERC-20 ${shortAddress(address)}`;
302
+ }
303
+ function transactionUrl(chain, transactionHash) {
304
+ if (chain === "eip155:8453")
305
+ return `https://basescan.org/tx/${transactionHash}`;
306
+ if (chain === "eip155:84532")
307
+ return `https://sepolia.basescan.org/tx/${transactionHash}`;
308
+ if (chain === "eip155:1")
309
+ return `https://etherscan.io/tx/${transactionHash}`;
310
+ if (chain === "eip155:11155111")
311
+ return `https://sepolia.etherscan.io/tx/${transactionHash}`;
312
+ if (chain === "tron:mainnet")
313
+ return `https://tronscan.org/#/transaction/${transactionHash}`;
314
+ if (chain.startsWith("tron:"))
315
+ return `https://${chain.replace("tron:", "")}.tronscan.org/#/transaction/${transactionHash}`;
316
+ return null;
317
+ }
318
+ function tokenDecimals(refundStatus) {
319
+ if (refundStatus.token_decimals !== null)
320
+ return refundStatus.token_decimals;
321
+ const token = refundStatus.token;
322
+ if (/\/(native|slip44:60)$/.test(token))
323
+ return 18;
324
+ if (/\/trc20:/.test(token))
325
+ return 6;
326
+ const erc20Match = /\/erc20:(0x[a-fA-F0-9]{40})$/.exec(token);
327
+ if (!erc20Match)
328
+ return 18;
329
+ const address = erc20Match[1];
330
+ if (address.toLowerCase() === "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913") {
331
+ return 6;
332
+ }
333
+ return 18;
334
+ }
335
+ function formatTokenAmount(rawAmount, decimals) {
336
+ let amount;
337
+ try {
338
+ amount = BigInt(rawAmount);
339
+ }
340
+ catch {
341
+ return rawAmount;
342
+ }
343
+ const negative = amount < 0n;
344
+ const value = negative ? -amount : amount;
345
+ const divisor = 10n ** BigInt(decimals);
346
+ const whole = value / divisor;
347
+ const fraction = value % divisor;
348
+ if (decimals === 0)
349
+ return `${negative ? "-" : ""}${whole.toString()}`;
350
+ const fractionText = fraction
351
+ .toString()
352
+ .padStart(decimals, "0")
353
+ .slice(0, 6)
354
+ .replace(/0+$/, "");
355
+ const displayFraction = fractionText.padEnd(2, "0");
356
+ return `${negative ? "-" : ""}${whole.toString()}.${displayFraction}`;
357
+ }
358
+ function formatRefundAmount(refundStatus) {
359
+ return `${formatTokenAmount(refundStatus.current_refundable_balance, tokenDecimals(refundStatus))} ${formatTokenLabel(refundStatus.token)}`;
360
+ }
361
+ function refundUnlockDate(refundStatus) {
362
+ if (!refundStatus || refundStatus.payment_status === "paid")
363
+ return null;
364
+ const time = Date.parse(refundStatus.expires_at);
365
+ if (!Number.isFinite(time) || time <= Date.now())
366
+ return null;
367
+ return new Date(time);
368
+ }
369
+ function refundClaimedAmountStorageKey(paymentId, attemptId) {
370
+ return `mintmoney:refund-claimed-amount:${paymentId}:${attemptId}`;
371
+ }
372
+ function refundSubmittedTxStorageKey(paymentId, attemptId) {
373
+ return `mintmoney:refund-submitted-tx:${paymentId}:${attemptId}`;
374
+ }
375
+ function readSubmittedRefundTx(paymentId, attemptId) {
376
+ if (typeof window === "undefined")
377
+ return null;
378
+ const raw = window.sessionStorage.getItem(refundSubmittedTxStorageKey(paymentId, attemptId));
379
+ if (!raw)
380
+ return null;
381
+ try {
382
+ const parsed = JSON.parse(raw);
383
+ if (typeof parsed.hash === "string" &&
384
+ isSubmittedRefundTxHash(parsed.hash) &&
385
+ typeof parsed.submittedAt === "number") {
386
+ return { hash: parsed.hash, submittedAt: parsed.submittedAt };
387
+ }
388
+ }
389
+ catch {
390
+ // Ignore malformed session state.
391
+ }
392
+ return null;
393
+ }
394
+ function writeSubmittedRefundTx(paymentId, attemptId, transactionHash) {
395
+ if (typeof window === "undefined")
396
+ return;
397
+ window.sessionStorage.setItem(refundSubmittedTxStorageKey(paymentId, attemptId), JSON.stringify({ hash: transactionHash, submittedAt: Date.now() }));
398
+ }
399
+ function clearSubmittedRefundTx(paymentId, attemptId) {
400
+ if (typeof window === "undefined")
401
+ return;
402
+ window.sessionStorage.removeItem(refundSubmittedTxStorageKey(paymentId, attemptId));
403
+ }
404
+ export async function claimPaymentRefund(refundStatus, { address, wagmiConfig, }) {
405
+ if (!address) {
406
+ throw new Error("No wallet account connected.");
407
+ }
408
+ // refund() is restricted to refundTo on-chain, so a mismatched account (e.g. switched in the
409
+ // wallet after eligibility was checked) would only produce a guaranteed-revert transaction.
410
+ if (refundStatus.refund_to &&
411
+ normalizeComparableAddress(refundStatus.settlement_chain, address) !==
412
+ normalizeComparableAddress(refundStatus.settlement_chain, refundStatus.refund_to)) {
413
+ throw new Error(`Connected wallet ${shortAddress(address)} is not the refund recipient. Connect ${shortAddress(refundStatus.refund_to)} and try again.`);
414
+ }
415
+ if (isTronChain(refundStatus.settlement_chain)) {
416
+ return claimTronPaymentRefund(refundStatus, address);
417
+ }
418
+ const chainId = caip2ToChainId(refundStatus.settlement_chain);
419
+ if (!chainId) {
420
+ throw new Error(`Refund claiming is not supported for ${formatChainLabel(refundStatus.settlement_chain)} in this wallet flow yet.`);
421
+ }
422
+ try {
423
+ await switchChain(wagmiConfig, { chainId });
424
+ }
425
+ catch {
426
+ throw new Error(`Refunds are claimed on the merchant settlement chain (${refundStatus.settlement_chain}). Switch your wallet to that network and try again.`);
427
+ }
428
+ const transactionHash = await sendTransaction(wagmiConfig, {
429
+ account: address,
430
+ to: refundStatus.splitter_address,
431
+ data: REFUND_SELECTOR,
432
+ });
433
+ return { transactionHash };
434
+ }
435
+ async function claimTronPaymentRefund(refundStatus, expectedAddress) {
436
+ const { tronWeb, address } = await requestTronWeb();
437
+ if (address !== expectedAddress) {
438
+ throw new Error(`Connected TronLink wallet ${shortAddress(address)} is not the refund recipient. Connect ${shortAddress(expectedAddress)} and try again.`);
439
+ }
440
+ const transaction = await tronWeb.transactionBuilder.triggerSmartContract(refundStatus.splitter_address, "refund()", { feeLimit: TRON_REFUND_FEE_LIMIT_SUN }, [], address);
441
+ if (transaction.result && transaction.result.result === false) {
442
+ const message = decodeTronHexMessage(transaction.result.message);
443
+ throw new Error(message
444
+ ? `TronLink could not create the refund transaction: ${message}`
445
+ : "TronLink could not create the refund transaction.");
446
+ }
447
+ const unsignedTransaction = transaction.transaction ?? transaction;
448
+ const signedTransaction = await tronWeb.trx.sign(unsignedTransaction);
449
+ const broadcast = await tronWeb.trx.sendRawTransaction(signedTransaction);
450
+ if (broadcast.result === false || broadcast.code) {
451
+ throw new Error(`TRON refund broadcast failed: ${broadcast.code ?? "UNKNOWN"}`);
452
+ }
453
+ const transactionHash = broadcast.txid ?? broadcast.txID ?? transaction.txID ?? transaction.txid;
454
+ if (!transactionHash) {
455
+ throw new Error("TRON refund transaction did not return a transaction hash.");
456
+ }
457
+ return { transactionHash };
458
+ }
459
+ async function waitForRefundReceipt(wagmiConfig, transactionHash, { timeoutMs = 120_000, pollingInterval = 3_000, } = {}) {
460
+ try {
461
+ return await waitForTransactionReceipt(wagmiConfig, {
462
+ hash: transactionHash,
463
+ timeout: timeoutMs,
464
+ pollingInterval,
465
+ });
466
+ }
467
+ catch (error) {
468
+ if (error instanceof Error &&
469
+ error.name === "WaitForTransactionReceiptTimeoutError") {
470
+ return null;
471
+ }
472
+ throw error;
473
+ }
474
+ }
475
+ async function waitForTronRefundReceipt(transactionHash, { timeoutMs = 120_000, pollingInterval = 3_000, } = {}) {
476
+ const { tronWeb } = await requestTronWeb();
477
+ const startedAt = Date.now();
478
+ while (Date.now() - startedAt < timeoutMs) {
479
+ const receipt = await tronWeb.trx.getTransactionInfo?.(transactionHash);
480
+ if (receipt?.blockNumber !== undefined) {
481
+ if (receipt.result === "FAILED" ||
482
+ receipt.receipt?.result === "FAILED" ||
483
+ receipt.contractResult?.some((result) => result.length > 0) ||
484
+ Boolean(receipt.resMessage)) {
485
+ return "reverted";
486
+ }
487
+ return "success";
488
+ }
489
+ await new Promise((resolve) => setTimeout(resolve, pollingInterval));
490
+ }
491
+ return null;
492
+ }
493
+ export function RefundClaim({ paymentId, attemptId, apiUrl, className, }) {
494
+ const { open } = useAppKit();
495
+ const account = useAccount();
496
+ const wagmiConfig = useConfig();
497
+ const [tronAddress, setTronAddress] = useState(null);
498
+ const [tronAutoDetectDisabled, setTronAutoDetectDisabled] = useState(false);
499
+ const [refundStatus, setRefundStatus] = useState(null);
500
+ const [loading, setLoading] = useState(true);
501
+ const [busy, setBusy] = useState(false);
502
+ const [preparing, setPreparing] = useState(false);
503
+ const [error, setError] = useState(null);
504
+ const [txHash, setTxHash] = useState(null);
505
+ const [claimedAmountLabel, setClaimedAmountLabel] = useState(null);
506
+ const isTronRefund = refundStatus
507
+ ? isTronChain(refundStatus.settlement_chain)
508
+ : false;
509
+ const connectedAddress = isTronRefund
510
+ ? tronAddress
511
+ : (account.address ?? null);
512
+ const attemptedPrepareKeys = useRef(new Set());
513
+ const loadStatus = async (address) => {
514
+ setLoading(true);
515
+ setError(null);
516
+ try {
517
+ const status = await getPaymentRefundStatus(paymentId, {
518
+ attemptId,
519
+ apiUrl,
520
+ connectedAddress: address ?? undefined,
521
+ });
522
+ setRefundStatus(status);
523
+ const submittedTx = readSubmittedRefundTx(paymentId, status.attempt_id);
524
+ if (status.attempt_status === "refund_claimed" &&
525
+ typeof window !== "undefined") {
526
+ clearSubmittedRefundTx(paymentId, status.attempt_id);
527
+ const storedAmount = window.sessionStorage.getItem(refundClaimedAmountStorageKey(paymentId, status.attempt_id));
528
+ if (storedAmount)
529
+ setClaimedAmountLabel(storedAmount);
530
+ if (status.refund_transaction_hash) {
531
+ setTxHash(status.refund_transaction_hash);
532
+ }
533
+ }
534
+ else if (submittedTx) {
535
+ setTxHash(submittedTx.hash);
536
+ if (Date.now() - submittedTx.submittedAt > 120_000) {
537
+ try {
538
+ const recorded = await confirmPaymentRefund(paymentId, {
539
+ transactionHash: submittedTx.hash,
540
+ attemptId: status.attempt_id,
541
+ connectedAddress: address ?? undefined,
542
+ apiUrl,
543
+ });
544
+ setRefundStatus(recorded);
545
+ if (recorded.attempt_status === "refund_claimed") {
546
+ clearSubmittedRefundTx(paymentId, status.attempt_id);
547
+ }
548
+ }
549
+ catch {
550
+ clearSubmittedRefundTx(paymentId, status.attempt_id);
551
+ setTxHash(null);
552
+ setError("That transaction did not claim this refund. The refund contract may still need setup.");
553
+ }
554
+ }
555
+ }
556
+ }
557
+ catch (err) {
558
+ setError(err instanceof Error ? err.message : "Unable to load refund status.");
559
+ }
560
+ finally {
561
+ setLoading(false);
562
+ }
563
+ };
564
+ useEffect(() => {
565
+ void loadStatus(connectedAddress);
566
+ }, [apiUrl, paymentId, attemptId, connectedAddress]);
567
+ useEffect(() => {
568
+ if (!refundStatus || !isTronChain(refundStatus.settlement_chain))
569
+ return;
570
+ if (tronAutoDetectDisabled)
571
+ return;
572
+ const provider = getTronProvider();
573
+ const address = provider?.tronWeb && provider.tronWeb.defaultAddress?.base58;
574
+ if (address && address !== tronAddress) {
575
+ setTronAddress(address);
576
+ }
577
+ }, [refundStatus, tronAddress, tronAutoDetectDisabled]);
578
+ useEffect(() => {
579
+ if (!refundStatus || !connectedAddress)
580
+ return;
581
+ if (refundStatus.claim_eligible)
582
+ return;
583
+ if (refundUnlockDate(refundStatus))
584
+ return;
585
+ if (!refundStatus.current_refundable_balance ||
586
+ refundStatus.current_refundable_balance === "0") {
587
+ return;
588
+ }
589
+ if (!refundStatus.refund_to ||
590
+ normalizeComparableAddress(refundStatus.settlement_chain, refundStatus.refund_to) !==
591
+ normalizeComparableAddress(refundStatus.settlement_chain, connectedAddress)) {
592
+ return;
593
+ }
594
+ if (!["refund_available", "surplus_available"].includes(refundStatus.attempt_status)) {
595
+ return;
596
+ }
597
+ const key = `${paymentId}:${refundStatus.attempt_id}:${normalizeComparableAddress(refundStatus.settlement_chain, connectedAddress)}`;
598
+ if (attemptedPrepareKeys.current.has(key))
599
+ return;
600
+ attemptedPrepareKeys.current.add(key);
601
+ setPreparing(true);
602
+ setError(null);
603
+ void preparePaymentRefund(paymentId, {
604
+ attemptId: refundStatus.attempt_id,
605
+ connectedAddress,
606
+ apiUrl,
607
+ })
608
+ .then((prepared) => {
609
+ setRefundStatus(prepared);
610
+ })
611
+ .catch((err) => {
612
+ setError(err instanceof Error
613
+ ? err.message
614
+ : "Unable to prepare this refund. Please try again.");
615
+ })
616
+ .finally(() => {
617
+ setPreparing(false);
618
+ });
619
+ }, [apiUrl, connectedAddress, paymentId, refundStatus]);
620
+ const connectWallet = async () => {
621
+ setError(null);
622
+ if (refundStatus && isTronChain(refundStatus.settlement_chain)) {
623
+ setTronAutoDetectDisabled(false);
624
+ const { address } = await requestTronWeb();
625
+ setTronAddress(address);
626
+ await loadStatus(address);
627
+ return;
628
+ }
629
+ await open({ view: "Connect" });
630
+ };
631
+ const useAnotherWallet = async () => {
632
+ setBusy(true);
633
+ setError(null);
634
+ setTxHash(null);
635
+ try {
636
+ if (refundStatus && isTronChain(refundStatus.settlement_chain)) {
637
+ await disconnectTronProvider();
638
+ setTronAutoDetectDisabled(true);
639
+ setTronAddress(null);
640
+ return;
641
+ }
642
+ await disconnect(wagmiConfig);
643
+ }
644
+ catch (err) {
645
+ setError(err instanceof Error ? err.message : "Unable to disconnect wallet.");
646
+ }
647
+ finally {
648
+ setBusy(false);
649
+ }
650
+ };
651
+ const retryRefundSetup = () => {
652
+ if (!refundStatus || !connectedAddress)
653
+ return;
654
+ // Clear the one-shot prepare guard so the prepare effect runs again, then re-fetch status.
655
+ attemptedPrepareKeys.current.delete(`${paymentId}:${refundStatus.attempt_id}:${normalizeComparableAddress(refundStatus.settlement_chain, connectedAddress)}`);
656
+ setError(null);
657
+ void loadStatus(connectedAddress);
658
+ };
659
+ const claimRefund = async () => {
660
+ if (!refundStatus)
661
+ return;
662
+ setBusy(true);
663
+ setError(null);
664
+ try {
665
+ const claimAmountLabel = formatRefundAmount(refundStatus);
666
+ setClaimedAmountLabel(claimAmountLabel);
667
+ if (typeof window !== "undefined") {
668
+ window.sessionStorage.setItem(refundClaimedAmountStorageKey(paymentId, refundStatus.attempt_id), claimAmountLabel);
669
+ }
670
+ if (!connectedAddress) {
671
+ await connectWallet();
672
+ return;
673
+ }
674
+ const result = await claimPaymentRefund(refundStatus, {
675
+ address: connectedAddress,
676
+ wagmiConfig,
677
+ });
678
+ setTxHash(result.transactionHash);
679
+ writeSubmittedRefundTx(paymentId, refundStatus.attempt_id, result.transactionHash);
680
+ const receiptStatus = isTronChain(refundStatus.settlement_chain)
681
+ ? await waitForTronRefundReceipt(result.transactionHash)
682
+ : await waitForRefundReceipt(wagmiConfig, result.transactionHash).then((receipt) => {
683
+ if (!receipt)
684
+ return null;
685
+ return receipt.status === "reverted" ? "reverted" : "success";
686
+ });
687
+ if (receiptStatus === "reverted") {
688
+ setTxHash(null);
689
+ clearSubmittedRefundTx(paymentId, refundStatus.attempt_id);
690
+ throw new Error("Refund transaction reverted on-chain.");
691
+ }
692
+ if (receiptStatus === "success") {
693
+ const recorded = await confirmPaymentRefund(paymentId, {
694
+ transactionHash: result.transactionHash,
695
+ attemptId: refundStatus.attempt_id,
696
+ connectedAddress,
697
+ apiUrl,
698
+ });
699
+ setRefundStatus(recorded);
700
+ clearSubmittedRefundTx(paymentId, refundStatus.attempt_id);
701
+ return;
702
+ }
703
+ await loadStatus(connectedAddress);
704
+ }
705
+ catch (err) {
706
+ setError(err instanceof Error ? err.message : "Refund transaction failed.");
707
+ }
708
+ finally {
709
+ setBusy(false);
710
+ }
711
+ };
712
+ const hasRefundableBalance = Boolean(refundStatus?.current_refundable_balance &&
713
+ refundStatus.current_refundable_balance !== "0");
714
+ const isClaimed = refundStatus?.attempt_status === "refund_claimed";
715
+ const refundRecipient = refundStatus?.refund_to ?? null;
716
+ const connectedMatchesRefundRecipient = Boolean(refundStatus &&
717
+ refundRecipient &&
718
+ connectedAddress &&
719
+ normalizeComparableAddress(refundStatus.settlement_chain, connectedAddress) ===
720
+ normalizeComparableAddress(refundStatus.settlement_chain, refundRecipient));
721
+ const canClaim = hasRefundableBalance &&
722
+ connectedMatchesRefundRecipient &&
723
+ refundStatus?.claim_eligible === true;
724
+ const refundAvailableAt = refundUnlockDate(refundStatus);
725
+ const waitingForRefundWindow = hasRefundableBalance &&
726
+ connectedMatchesRefundRecipient &&
727
+ Boolean(refundAvailableAt);
728
+ const needsRefundSetup = hasRefundableBalance &&
729
+ connectedMatchesRefundRecipient &&
730
+ refundStatus?.claim_eligible === false &&
731
+ !waitingForRefundWindow &&
732
+ Boolean(refundStatus &&
733
+ ["refund_available", "surplus_available"].includes(refundStatus.attempt_status));
734
+ const isRefundUnavailable = Boolean(refundStatus) && !isClaimed && !hasRefundableBalance;
735
+ const balanceLabel = isClaimed
736
+ ? "Refund claimed"
737
+ : isRefundUnavailable
738
+ ? "Refund balance"
739
+ : "Refundable balance";
740
+ const balanceValue = refundStatus
741
+ ? isClaimed
742
+ ? (claimedAmountLabel ?? "Claimed")
743
+ : formatRefundAmount(refundStatus)
744
+ : null;
745
+ const recordedTxHash = refundStatus?.refund_transaction_hash ?? txHash;
746
+ const recordedTxUrl = refundStatus && recordedTxHash
747
+ ? transactionUrl(refundStatus.settlement_chain, recordedTxHash)
748
+ : null;
749
+ const isSubmitted = Boolean(txHash) && !isClaimed;
750
+ const claimedAtLabel = refundStatus?.refund_claimed_at
751
+ ? new Date(refundStatus.refund_claimed_at).toLocaleString()
752
+ : null;
753
+ return (_jsxs(Shell, { className: className, children: [_jsx(StatusPill, { children: formatStatusLabel(refundStatus?.attempt_status) }), _jsx(TitleText, { children: isClaimed
754
+ ? "Refund claimed"
755
+ : isSubmitted
756
+ ? "Refund submitted"
757
+ : isRefundUnavailable
758
+ ? "Refund unavailable"
759
+ : "Claim refund" }), loading ? _jsx(SubtleText, { children: "Loading refund status..." }) : null, preparing ? _jsx(SubtleText, { children: "Preparing refund contract..." }) : null, refundStatus ? (_jsxs(_Fragment, { children: [_jsxs(BalancePanel, { children: [_jsx(BalanceLabel, { children: balanceLabel }), _jsx(BalanceValue, { children: balanceValue })] }), _jsxs(Details, { children: [_jsxs(DetailRow, { children: [_jsx("span", { children: "Settlement token" }), _jsx("strong", { children: formatTokenLabel(refundStatus.token) })] }), _jsxs(DetailRow, { children: [_jsx("span", { children: "Settlement chain" }), _jsx("strong", { children: formatChainLabel(refundStatus.settlement_chain) })] }), _jsxs(DetailRow, { children: [_jsx("span", { children: "Refund contract" }), _jsx("strong", { title: refundStatus.splitter_address, children: shortAddress(refundStatus.splitter_address) })] })] }), isClaimed ? (_jsxs(HelperText, { children: ["The refundable balance was returned to", " ", refundStatus.refund_to
760
+ ? shortAddress(refundStatus.refund_to)
761
+ : "the refund wallet", claimedAtLabel ? ` on ${claimedAtLabel}` : "", "."] })) : isSubmitted ? (_jsxs(HelperText, { children: ["Refund transaction submitted from", " ", connectedAddress
762
+ ? shortAddress(connectedAddress)
763
+ : "your connected wallet", ". This page will update after the claim is confirmed."] })) : !hasRefundableBalance ? (_jsx(HelperText, { children: "This payment attempt expired with no recoverable funds." })) : !refundRecipient ? (_jsx(HelperText, { children: "This attempt needs merchant recovery before a refund can be claimed." })) : connectedAddress && !connectedMatchesRefundRecipient ? (_jsxs(HelperText, { children: ["Connected wallet ", shortAddress(connectedAddress), " is not the refund recipient. Connect ", shortAddress(refundRecipient), " to claim."] })) : connectedMatchesRefundRecipient ? (_jsx(HelperText, { children: waitingForRefundWindow
764
+ ? `Refunds can be claimed after ${refundAvailableAt?.toLocaleString()} if this payment does not settle.`
765
+ : needsRefundSetup
766
+ ? preparing
767
+ ? "Preparing the refund contract for this wallet."
768
+ : "Refund setup didn't finish. Tap Try again to retry."
769
+ : `Connected refund wallet ${shortAddress(refundRecipient)} can claim this refund.` })) : (_jsxs(HelperText, { children: ["Connect refund wallet ", shortAddress(refundRecipient), " to claim."] }))] })) : null, error ? _jsx(ErrorText, { children: error }) : null, isClaimed && recordedTxHash ? (_jsxs(SuccessText, { children: ["Refund transaction:", " ", recordedTxUrl ? (_jsx(TransactionLink, { href: recordedTxUrl, target: "_blank", rel: "noreferrer", children: recordedTxHash })) : (recordedTxHash)] })) : txHash ? (_jsxs(SuccessText, { children: ["Refund transaction submitted:", " ", refundStatus &&
770
+ transactionUrl(refundStatus.settlement_chain, txHash) ? (_jsx(TransactionLink, { href: transactionUrl(refundStatus.settlement_chain, txHash) ??
771
+ undefined, target: "_blank", rel: "noreferrer", children: txHash })) : (txHash)] })) : null, isClaimed ||
772
+ isRefundUnavailable ||
773
+ isSubmitted ? null : !connectedAddress ? (_jsx(Actions, { children: _jsx(StyledButton, { onClick: () => void connectWallet(), disabled: busy, children: "Connect wallet" }) })) : (_jsxs(Actions, { children: [_jsx(StyledButton, { onClick: () => void claimRefund(), disabled: !canClaim || busy || preparing || waitingForRefundWindow, children: waitingForRefundWindow
774
+ ? "Refund not ready"
775
+ : preparing
776
+ ? "Preparing refund..."
777
+ : needsRefundSetup
778
+ ? "Refund setup needed"
779
+ : busy
780
+ ? "Submitting..."
781
+ : "Claim refund" }), needsRefundSetup && !preparing ? (_jsx(StyledButton, { variant: "secondary", onClick: () => retryRefundSetup(), disabled: busy, children: "Try again" })) : null, !canClaim && !needsRefundSetup && !waitingForRefundWindow ? (_jsx(StyledButton, { variant: "secondary", onClick: () => void useAnotherWallet(), disabled: busy, children: "Use another wallet" })) : null] }))] }));
782
+ }
783
+ export function RefundClaimPage({ logoSrc = "/logo.svg", wagmiConfig, walletConnectProjectId, ...props }) {
784
+ const wagmi = useRef();
785
+ const queryClient = useRef(new QueryClient());
786
+ if (!wagmi.current) {
787
+ wagmi.current = getAppKitWagmiConfig(walletConnectProjectId ?? "", defaultTheme, wagmiConfig);
788
+ }
789
+ return (_jsx(ThemeProvider, { theme: defaultTheme, children: _jsx(WalletProvider, { children: _jsx(QueryClientProvider, { client: queryClient.current, children: _jsx(WagmiProvider, { config: wagmi.current, reconnectOnMount: true, children: _jsxs(Page, { children: [_jsx(PageHeader, { children: _jsx(BrandMark, { src: logoSrc, alt: "Mint" }) }), _jsx(PageMain, { children: _jsx(PageCard, { children: _jsx(RefundClaim, { ...props }) }) })] }) }) }) }) }));
790
+ }
791
+ //# sourceMappingURL=index.js.map