@prohetamine/redstone 0.0.1

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 (160) hide show
  1. package/dist/PhArrowCircleDown-BR-zH4LC.js +14 -0
  2. package/dist/PhArrowCircleDown-Sb38khBy.mjs +73 -0
  3. package/dist/PhArrowClockwise-BE5j9P0Z.mjs +73 -0
  4. package/dist/PhArrowClockwise-BRaehQGe.js +14 -0
  5. package/dist/PhArrowDown-B_WmmmY9.js +14 -0
  6. package/dist/PhArrowDown-CFEyR2dR.mjs +73 -0
  7. package/dist/PhArrowLeft-CYfU7NZj.mjs +73 -0
  8. package/dist/PhArrowLeft-CkEd70hm.js +14 -0
  9. package/dist/PhArrowRight-C07Qkx86.js +14 -0
  10. package/dist/PhArrowRight-EermNu0V.mjs +73 -0
  11. package/dist/PhArrowSquareOut-BjTBfzOP.js +14 -0
  12. package/dist/PhArrowSquareOut-DZwTtw54.mjs +73 -0
  13. package/dist/PhArrowUp-DB4CCSss.js +14 -0
  14. package/dist/PhArrowUp-xTpLFQkg.mjs +73 -0
  15. package/dist/PhArrowUpRight-CQbvn6NO.mjs +73 -0
  16. package/dist/PhArrowUpRight-GpCIMsAh.js +14 -0
  17. package/dist/PhArrowsClockwise-BgcIUg-Z.js +14 -0
  18. package/dist/PhArrowsClockwise-DnUYZTVx.mjs +73 -0
  19. package/dist/PhArrowsDownUp-C8KXUqtu.js +14 -0
  20. package/dist/PhArrowsDownUp-DgoprEe2.mjs +73 -0
  21. package/dist/PhArrowsLeftRight-CahChzCj.js +14 -0
  22. package/dist/PhArrowsLeftRight-FD4AZiLh.mjs +73 -0
  23. package/dist/PhBank-DIqIL4x_.js +14 -0
  24. package/dist/PhBank-DbQOQ9zJ.mjs +73 -0
  25. package/dist/PhBrowser-BCBXK2IM.mjs +73 -0
  26. package/dist/PhBrowser-laCKtn7T.js +14 -0
  27. package/dist/PhCaretDown-CnjP-QjZ.mjs +73 -0
  28. package/dist/PhCaretDown-DDe42xDU.js +14 -0
  29. package/dist/PhCaretLeft-Cskc5OY9.js +14 -0
  30. package/dist/PhCaretLeft-DkuXxjf_.mjs +73 -0
  31. package/dist/PhCaretRight-CBWpghxt.mjs +73 -0
  32. package/dist/PhCaretRight-DNgI5w_B.js +14 -0
  33. package/dist/PhCaretUp-CQ-OztBV.mjs +73 -0
  34. package/dist/PhCaretUp-CUZ4g_Me.js +14 -0
  35. package/dist/PhCheck-BVV_Dwfo.js +14 -0
  36. package/dist/PhCheck-t515emYS.mjs +73 -0
  37. package/dist/PhCircleHalf-BuQTmrKW.mjs +73 -0
  38. package/dist/PhCircleHalf-DDC7rige.js +14 -0
  39. package/dist/PhClock-BqynEKWl.js +14 -0
  40. package/dist/PhClock-D6XkTmM_.mjs +73 -0
  41. package/dist/PhCompass-2QeeX5Ad.mjs +73 -0
  42. package/dist/PhCompass-BsuJwXAE.js +14 -0
  43. package/dist/PhCopy-CO34-_xD.mjs +73 -0
  44. package/dist/PhCopy-MVqtRS6X.js +14 -0
  45. package/dist/PhCreditCard-Dq4kdjCw.js +14 -0
  46. package/dist/PhCreditCard-bfnqYflD.mjs +73 -0
  47. package/dist/PhCurrencyDollar-6k8UWxal.js +14 -0
  48. package/dist/PhCurrencyDollar-BekVYPtC.mjs +73 -0
  49. package/dist/PhDesktop-BkNzf3rT.mjs +73 -0
  50. package/dist/PhDesktop-CfsXQ0vC.js +14 -0
  51. package/dist/PhDeviceMobile-BT3Mg_b0.mjs +73 -0
  52. package/dist/PhDeviceMobile-BnrrDrwf.js +14 -0
  53. package/dist/PhDotsThree-6LRvhAcL.js +14 -0
  54. package/dist/PhDotsThree-kpf2OKxJ.mjs +73 -0
  55. package/dist/PhEnvelope-CHsfC2e0.js +14 -0
  56. package/dist/PhEnvelope-UFKpKtwf.mjs +73 -0
  57. package/dist/PhFunnelSimple-CdAqSIhK.mjs +73 -0
  58. package/dist/PhFunnelSimple-JAk7X9Wo.js +14 -0
  59. package/dist/PhGlobe-B3RYXl8h.mjs +73 -0
  60. package/dist/PhGlobe-Tfs4MfpG.js +14 -0
  61. package/dist/PhIdentificationCard-Dqmd6eY1.js +14 -0
  62. package/dist/PhIdentificationCard-rSq59Czm.mjs +73 -0
  63. package/dist/PhImage-aEryzfCi.js +14 -0
  64. package/dist/PhImage-ynsEnFd_.mjs +73 -0
  65. package/dist/PhInfo-B7lsWl6m.mjs +73 -0
  66. package/dist/PhInfo-D6oUrWpA.js +14 -0
  67. package/dist/PhLightbulb-FQDaMMqu.mjs +73 -0
  68. package/dist/PhLightbulb-qbEduhPa.js +14 -0
  69. package/dist/PhMagnifyingGlass-COdRH2k5.js +14 -0
  70. package/dist/PhMagnifyingGlass-_NXk13-0.mjs +73 -0
  71. package/dist/PhPaperPlaneRight-BYi7SorW.mjs +73 -0
  72. package/dist/PhPaperPlaneRight-DrpVAQOZ.js +14 -0
  73. package/dist/PhPlus-25KQTPHG.mjs +73 -0
  74. package/dist/PhPlus-BhUXef08.js +14 -0
  75. package/dist/PhPower-BKl7gzsB.mjs +73 -0
  76. package/dist/PhPower-BNJf1AGQ.js +14 -0
  77. package/dist/PhPuzzlePiece-BkZeF8CX.js +14 -0
  78. package/dist/PhPuzzlePiece-BqUI4GRs.mjs +73 -0
  79. package/dist/PhQrCode-C-tqZKPP.mjs +73 -0
  80. package/dist/PhQrCode-C0v0iXQN.js +14 -0
  81. package/dist/PhQuestion-BBAiRWgt.js +14 -0
  82. package/dist/PhQuestion-CtYvffyD.mjs +73 -0
  83. package/dist/PhQuestionMark-BNbtL2yx.mjs +73 -0
  84. package/dist/PhQuestionMark-BvGUBZ1h.js +14 -0
  85. package/dist/PhSealCheck-B0TEqWpq.mjs +73 -0
  86. package/dist/PhSealCheck-BwNkuF7G.js +14 -0
  87. package/dist/PhSignOut-C1rMSNaS.js +14 -0
  88. package/dist/PhSignOut-HX2_BVsD.mjs +73 -0
  89. package/dist/PhSpinner-CoDYLYOX.mjs +73 -0
  90. package/dist/PhSpinner-nmsGWDQl.js +14 -0
  91. package/dist/PhTrash-CALlKx3e.js +14 -0
  92. package/dist/PhTrash-DeQHS8ZP.mjs +73 -0
  93. package/dist/PhUser-CA0e5OPI.js +14 -0
  94. package/dist/PhUser-Cy5EY3vX.mjs +73 -0
  95. package/dist/PhVault-DdXjVOO9.mjs +73 -0
  96. package/dist/PhVault-DqxV75cz.js +14 -0
  97. package/dist/PhWallet-CeQrfGYc.mjs +73 -0
  98. package/dist/PhWallet-CyCuEs2U.js +14 -0
  99. package/dist/PhWarning-BKaHv_wT.mjs +73 -0
  100. package/dist/PhWarning-C7oj86bY.js +14 -0
  101. package/dist/PhWarningCircle-8MWw-QgE.mjs +73 -0
  102. package/dist/PhWarningCircle-CrNPXGj4.js +14 -0
  103. package/dist/PhX-9lsrXjyl.js +14 -0
  104. package/dist/PhX-DgXr_Fb0.mjs +73 -0
  105. package/dist/ReownAuthentication-Bfv31LzI.mjs +274 -0
  106. package/dist/ReownAuthentication-d8aYgGOq.js +5 -0
  107. package/dist/SwapController-4lzoYsYr.js +1 -0
  108. package/dist/SwapController-DjzUWRyQ.mjs +462 -0
  109. package/dist/ccip-CvwbEhki.js +1 -0
  110. package/dist/ccip-TuO68NeE.mjs +150 -0
  111. package/dist/data-capture-BwdjH2vc.mjs +489 -0
  112. package/dist/data-capture-xVUNZJ2T.js +242 -0
  113. package/dist/email-BCZObJCY.js +90 -0
  114. package/dist/email-m-wo60fN.mjs +338 -0
  115. package/dist/embedded-wallet-CGSri-4g.js +410 -0
  116. package/dist/embedded-wallet-DdZmv5qP.mjs +808 -0
  117. package/dist/features-BJ8kNaE8.js +1 -0
  118. package/dist/features-CJ34oImB.mjs +6 -0
  119. package/dist/index-4lfXeo30.js +132 -0
  120. package/dist/index-B6Mg114Z.mjs +69182 -0
  121. package/dist/index-BX7gAgT3.mjs +35 -0
  122. package/dist/index-BYQqNbCe.js +1 -0
  123. package/dist/index-BmdHwtJo.js +1 -0
  124. package/dist/index-BvUx3ULC.js +78 -0
  125. package/dist/index-CD-QGO70.mjs +196 -0
  126. package/dist/index-CJtXfdoM.mjs +29621 -0
  127. package/dist/index-CMzdgE-y.mjs +215 -0
  128. package/dist/index-CjZQCcwG.js +7203 -0
  129. package/dist/index-D7VuOaCI.js +19 -0
  130. package/dist/index-DV7SQwgn.mjs +2688 -0
  131. package/dist/index-DVf4BnNh.mjs +352 -0
  132. package/dist/index-DhN9vL4k.js +138 -0
  133. package/dist/index-DvllakY0.mjs +274 -0
  134. package/dist/index-Ho06VKh2.mjs +151 -0
  135. package/dist/index-a8mS2Eh1.js +1062 -0
  136. package/dist/index-aamBi9Tu.js +1 -0
  137. package/dist/index.cjs.js +1 -0
  138. package/dist/index.es.js +14 -0
  139. package/dist/onramp-DLlhSPQg.js +422 -0
  140. package/dist/onramp-k-EAEepC.mjs +842 -0
  141. package/dist/parseSignature-D1tZHglo.js +16 -0
  142. package/dist/parseSignature-DM0lwcDr.mjs +8883 -0
  143. package/dist/pay-with-exchange---G2M1Ag.js +280 -0
  144. package/dist/pay-with-exchange-CFIcUXUe.mjs +512 -0
  145. package/dist/property-Bd8U3_QP.mjs +618 -0
  146. package/dist/property-DissjCbZ.js +27 -0
  147. package/dist/receive-B9LCljO6.mjs +228 -0
  148. package/dist/receive-E8H6GDOX.js +131 -0
  149. package/dist/send-B-AooLph.js +554 -0
  150. package/dist/send-DZd_xhsd.mjs +1155 -0
  151. package/dist/socials-ChWFLEFe.mjs +611 -0
  152. package/dist/socials-YSUYSh8o.js +250 -0
  153. package/dist/swaps-DpR9W9Ld.js +1050 -0
  154. package/dist/swaps-Du7-Ui_V.mjs +1752 -0
  155. package/dist/transactions-DhsK5-QJ.mjs +35 -0
  156. package/dist/transactions-VPsz2OLe.js +16 -0
  157. package/dist/w3m-modal-DhomfjKU.js +891 -0
  158. package/dist/w3m-modal-KuYD-zqQ.mjs +1759 -0
  159. package/package.json +51 -0
  160. package/readme.md +1 -0
@@ -0,0 +1,1155 @@
1
+ import { bR as b, bU as d, cv as u, bV as x, bW as v, bY as z, cc as D, ca as g, c5 as j, cJ as l, bX as c, b_ as F, c3 as h, c1 as H, b$ as N, cz as q, c4 as y, cg as G, cf as X, cs as K, bS as Y, bT as J, cu as Z, cQ as L, cR as M, c7 as ee } from "./index-B6Mg114Z.mjs";
2
+ import "./index-Ho06VKh2.mjs";
3
+ import "./index-CD-QGO70.mjs";
4
+ import { S as Q } from "./SwapController-DjzUWRyQ.mjs";
5
+ const te = b`
6
+ :host {
7
+ width: 100%;
8
+ height: 100px;
9
+ border-radius: ${({ borderRadius: e }) => e[5]};
10
+ border: 1px solid ${({ tokens: e }) => e.theme.foregroundPrimary};
11
+ background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
12
+ transition: background-color ${({ durations: e }) => e.lg}
13
+ ${({ easings: e }) => e["ease-out-power-1"]};
14
+ will-change: background-color;
15
+ position: relative;
16
+ }
17
+
18
+ :host(:hover) {
19
+ background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
20
+ }
21
+
22
+ wui-flex {
23
+ width: 100%;
24
+ height: fit-content;
25
+ }
26
+
27
+ wui-button {
28
+ display: ruby;
29
+ color: ${({ tokens: e }) => e.theme.textPrimary};
30
+ margin: 0 ${({ spacing: e }) => e[2]};
31
+ }
32
+
33
+ .instruction {
34
+ position: absolute;
35
+ top: 50%;
36
+ transform: translateY(-50%);
37
+ z-index: 2;
38
+ }
39
+
40
+ .paste {
41
+ display: inline-flex;
42
+ }
43
+
44
+ textarea {
45
+ background: transparent;
46
+ width: 100%;
47
+ font-family: ${({ fontFamily: e }) => e.regular};
48
+ font-style: normal;
49
+ font-size: ${({ textSize: e }) => e.large};
50
+ font-weight: ${({ fontWeight: e }) => e.regular};
51
+ line-height: ${({ typography: e }) => e["lg-regular"].lineHeight};
52
+ letter-spacing: ${({ typography: e }) => e["lg-regular"].letterSpacing};
53
+ color: ${({ tokens: e }) => e.theme.textPrimary};
54
+ caret-color: ${({ tokens: e }) => e.core.backgroundAccentPrimary};
55
+ box-sizing: border-box;
56
+ -webkit-appearance: none;
57
+ -moz-appearance: textfield;
58
+ padding: 0px;
59
+ border: none;
60
+ outline: none;
61
+ appearance: none;
62
+ resize: none;
63
+ overflow: hidden;
64
+ }
65
+ `;
66
+ var E = function(e, t, i, r) {
67
+ var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
68
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
69
+ else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
70
+ return o > 3 && n && Object.defineProperty(t, i, n), n;
71
+ };
72
+ let $ = class extends v {
73
+ constructor() {
74
+ super(...arguments), this.inputElementRef = z(), this.instructionElementRef = z(), this.readOnly = !1, this.instructionHidden = !!this.value, this.pasting = !1, this.onDebouncedSearch = D.debounce(async (t) => {
75
+ if (!t.length) {
76
+ this.setReceiverAddress("");
77
+ return;
78
+ }
79
+ const i = g.state.activeChain;
80
+ if (D.isAddress(t, i)) {
81
+ this.setReceiverAddress(t);
82
+ return;
83
+ }
84
+ try {
85
+ const o = await j.getEnsAddress(t);
86
+ if (o) {
87
+ l.setReceiverProfileName(t), l.setReceiverAddress(o);
88
+ const n = await j.getEnsAvatar(t);
89
+ l.setReceiverProfileImageUrl(n || void 0);
90
+ }
91
+ } catch {
92
+ this.setReceiverAddress(t);
93
+ } finally {
94
+ l.setLoading(!1);
95
+ }
96
+ });
97
+ }
98
+ firstUpdated() {
99
+ this.value && (this.instructionHidden = !0), this.checkHidden();
100
+ }
101
+ render() {
102
+ return this.readOnly ? c` <wui-flex
103
+ flexDirection="column"
104
+ justifyContent="center"
105
+ gap="01"
106
+ .padding=${["8", "4", "5", "4"]}
107
+ >
108
+ <textarea
109
+ spellcheck="false"
110
+ ?disabled=${!0}
111
+ autocomplete="off"
112
+ .value=${this.value ?? ""}
113
+ >
114
+ ${this.value ?? ""}</textarea
115
+ >
116
+ </wui-flex>` : c` <wui-flex
117
+ @click=${this.onBoxClick.bind(this)}
118
+ flexDirection="column"
119
+ justifyContent="center"
120
+ gap="01"
121
+ .padding=${["8", "4", "5", "4"]}
122
+ >
123
+ <wui-text
124
+ ${F(this.instructionElementRef)}
125
+ class="instruction"
126
+ color="secondary"
127
+ variant="md-medium"
128
+ >
129
+ Type or
130
+ <wui-button
131
+ class="paste"
132
+ size="md"
133
+ variant="neutral-secondary"
134
+ iconLeft="copy"
135
+ @click=${this.onPasteClick.bind(this)}
136
+ >
137
+ <wui-icon size="sm" color="inherit" slot="iconLeft" name="copy"></wui-icon>
138
+ Paste
139
+ </wui-button>
140
+ address
141
+ </wui-text>
142
+ <textarea
143
+ spellcheck="false"
144
+ ?disabled=${!this.instructionHidden}
145
+ ${F(this.inputElementRef)}
146
+ @input=${this.onInputChange.bind(this)}
147
+ @blur=${this.onBlur.bind(this)}
148
+ .value=${this.value ?? ""}
149
+ autocomplete="off"
150
+ >
151
+ ${this.value ?? ""}</textarea
152
+ >
153
+ </wui-flex>`;
154
+ }
155
+ async focusInput() {
156
+ var t;
157
+ this.instructionElementRef.value && (this.instructionHidden = !0, await this.toggleInstructionFocus(!1), this.instructionElementRef.value.style.pointerEvents = "none", (t = this.inputElementRef.value) == null || t.focus(), this.inputElementRef.value && (this.inputElementRef.value.selectionStart = this.inputElementRef.value.selectionEnd = this.inputElementRef.value.value.length));
158
+ }
159
+ async focusInstruction() {
160
+ var t;
161
+ this.instructionElementRef.value && (this.instructionHidden = !1, await this.toggleInstructionFocus(!0), this.instructionElementRef.value.style.pointerEvents = "auto", (t = this.inputElementRef.value) == null || t.blur());
162
+ }
163
+ async toggleInstructionFocus(t) {
164
+ this.instructionElementRef.value && await this.instructionElementRef.value.animate([{ opacity: t ? 0 : 1 }, { opacity: t ? 1 : 0 }], {
165
+ duration: 100,
166
+ easing: "ease",
167
+ fill: "forwards"
168
+ }).finished;
169
+ }
170
+ onBoxClick() {
171
+ !this.value && !this.instructionHidden && this.focusInput();
172
+ }
173
+ onBlur() {
174
+ !this.value && this.instructionHidden && !this.pasting && this.focusInstruction();
175
+ }
176
+ checkHidden() {
177
+ this.instructionHidden && this.focusInput();
178
+ }
179
+ async onPasteClick() {
180
+ this.pasting = !0;
181
+ const t = await navigator.clipboard.readText();
182
+ l.setReceiverAddress(t), this.focusInput();
183
+ }
184
+ onInputChange(t) {
185
+ var r;
186
+ const i = t.target;
187
+ this.pasting = !1, this.value = (r = t.target) == null ? void 0 : r.value, i.value && !this.instructionHidden && this.focusInput(), l.setLoading(!0), this.onDebouncedSearch(i.value);
188
+ }
189
+ setReceiverAddress(t) {
190
+ l.setReceiverAddress(t), l.setReceiverProfileName(void 0), l.setReceiverProfileImageUrl(void 0), l.setLoading(!1);
191
+ }
192
+ };
193
+ $.styles = te;
194
+ E([
195
+ d()
196
+ ], $.prototype, "value", void 0);
197
+ E([
198
+ d({ type: Boolean })
199
+ ], $.prototype, "readOnly", void 0);
200
+ E([
201
+ u()
202
+ ], $.prototype, "instructionHidden", void 0);
203
+ E([
204
+ u()
205
+ ], $.prototype, "pasting", void 0);
206
+ $ = E([
207
+ x("w3m-input-address")
208
+ ], $);
209
+ const ie = b`
210
+ :host {
211
+ width: 100%;
212
+ height: 100px;
213
+ border-radius: ${({ borderRadius: e }) => e[5]};
214
+ border: 1px solid ${({ tokens: e }) => e.theme.foregroundPrimary};
215
+ background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
216
+ transition: background-color ${({ durations: e }) => e.lg}
217
+ ${({ easings: e }) => e["ease-out-power-1"]};
218
+ will-change: background-color;
219
+ transition: all ${({ easings: e }) => e["ease-out-power-1"]}
220
+ ${({ durations: e }) => e.lg};
221
+ }
222
+
223
+ :host(:hover) {
224
+ background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
225
+ }
226
+
227
+ wui-flex {
228
+ width: 100%;
229
+ height: fit-content;
230
+ }
231
+
232
+ wui-button {
233
+ width: 100%;
234
+ display: flex;
235
+ justify-content: flex-end;
236
+ }
237
+
238
+ wui-input-amount {
239
+ mask-image: linear-gradient(
240
+ 270deg,
241
+ transparent 0px,
242
+ transparent 8px,
243
+ black 24px,
244
+ black 25px,
245
+ black 32px,
246
+ black 100%
247
+ );
248
+ }
249
+
250
+ .totalValue {
251
+ width: 100%;
252
+ }
253
+ `;
254
+ var P = function(e, t, i, r) {
255
+ var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
256
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
257
+ else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
258
+ return o > 3 && n && Object.defineProperty(t, i, n), n;
259
+ };
260
+ let A = class extends v {
261
+ constructor() {
262
+ super(...arguments), this.readOnly = !1, this.isInsufficientBalance = !1;
263
+ }
264
+ render() {
265
+ const t = this.readOnly || !this.token;
266
+ return c` <wui-flex
267
+ flexDirection="column"
268
+ gap="01"
269
+ .padding=${["5", "3", "4", "3"]}
270
+ >
271
+ <wui-flex alignItems="center">
272
+ <wui-input-amount
273
+ @inputChange=${this.onInputChange.bind(this)}
274
+ ?disabled=${t}
275
+ .value=${this.sendTokenAmount ? String(this.sendTokenAmount) : ""}
276
+ ?error=${!!this.isInsufficientBalance}
277
+ ></wui-input-amount>
278
+ ${this.buttonTemplate()}
279
+ </wui-flex>
280
+ ${this.bottomTemplate()}
281
+ </wui-flex>`;
282
+ }
283
+ buttonTemplate() {
284
+ return this.token ? c`<wui-token-button
285
+ text=${this.token.symbol}
286
+ imageSrc=${this.token.iconUrl}
287
+ @click=${this.handleSelectButtonClick.bind(this)}
288
+ >
289
+ </wui-token-button>` : c`<wui-button
290
+ size="md"
291
+ variant="neutral-secondary"
292
+ @click=${this.handleSelectButtonClick.bind(this)}
293
+ >Select token</wui-button
294
+ >`;
295
+ }
296
+ handleSelectButtonClick() {
297
+ this.readOnly || h.push("WalletSendSelectToken");
298
+ }
299
+ sendValueTemplate() {
300
+ if (!this.readOnly && this.token && this.sendTokenAmount) {
301
+ const i = this.token.price * this.sendTokenAmount;
302
+ return c`<wui-text class="totalValue" variant="sm-regular" color="secondary"
303
+ >${i ? `$${H.formatNumberToLocalString(i, 2)}` : "Incorrect value"}</wui-text
304
+ >`;
305
+ }
306
+ return null;
307
+ }
308
+ maxAmountTemplate() {
309
+ return this.token ? c` <wui-text variant="sm-regular" color="secondary">
310
+ ${N.roundNumber(Number(this.token.quantity.numeric), 6, 5)}
311
+ </wui-text>` : null;
312
+ }
313
+ actionTemplate() {
314
+ return this.token ? c`<wui-link @click=${this.onMaxClick.bind(this)}>Max</wui-link>` : null;
315
+ }
316
+ bottomTemplate() {
317
+ return this.readOnly ? null : c`<wui-flex alignItems="center" justifyContent="space-between">
318
+ ${this.sendValueTemplate()}
319
+ <wui-flex alignItems="center" gap="01" justifyContent="flex-end">
320
+ ${this.maxAmountTemplate()} ${this.actionTemplate()}
321
+ </wui-flex>
322
+ </wui-flex>`;
323
+ }
324
+ onInputChange(t) {
325
+ l.setTokenAmount(t.detail);
326
+ }
327
+ onMaxClick() {
328
+ if (this.token) {
329
+ const t = H.bigNumber(this.token.quantity.numeric);
330
+ l.setTokenAmount(Number(t.toFixed(20)));
331
+ }
332
+ }
333
+ };
334
+ A.styles = ie;
335
+ P([
336
+ d({ type: Object })
337
+ ], A.prototype, "token", void 0);
338
+ P([
339
+ d({ type: Boolean })
340
+ ], A.prototype, "readOnly", void 0);
341
+ P([
342
+ d({ type: Number })
343
+ ], A.prototype, "sendTokenAmount", void 0);
344
+ P([
345
+ d({ type: Boolean })
346
+ ], A.prototype, "isInsufficientBalance", void 0);
347
+ A = P([
348
+ x("w3m-input-token")
349
+ ], A);
350
+ const ne = b`
351
+ :host {
352
+ display: block;
353
+ }
354
+
355
+ wui-flex {
356
+ position: relative;
357
+ }
358
+
359
+ wui-icon-box {
360
+ width: 32px;
361
+ height: 32px;
362
+ border-radius: ${({ borderRadius: e }) => e[10]} !important;
363
+ border: 4px solid ${({ tokens: e }) => e.theme.backgroundPrimary};
364
+ background: ${({ tokens: e }) => e.theme.foregroundPrimary};
365
+ position: absolute;
366
+ top: 50%;
367
+ left: 50%;
368
+ transform: translate(-50%, -50%);
369
+ z-index: 3;
370
+ }
371
+
372
+ wui-button {
373
+ --local-border-radius: ${({ borderRadius: e }) => e[4]} !important;
374
+ }
375
+
376
+ .inputContainer {
377
+ height: fit-content;
378
+ }
379
+ `;
380
+ var w = function(e, t, i, r) {
381
+ var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
382
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
383
+ else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
384
+ return o > 3 && n && Object.defineProperty(t, i, n), n;
385
+ };
386
+ const p = {
387
+ INSUFFICIENT_FUNDS: "Insufficient Funds",
388
+ INCORRECT_VALUE: "Incorrect Value",
389
+ INVALID_ADDRESS: "Invalid Address",
390
+ ADD_ADDRESS: "Add Address",
391
+ ADD_AMOUNT: "Add Amount",
392
+ SELECT_TOKEN: "Select Token",
393
+ PREVIEW_SEND: "Preview Send"
394
+ };
395
+ let f = class extends v {
396
+ constructor() {
397
+ var i, r;
398
+ super(), this.unsubscribe = [], this.isTryingToChooseDifferentWallet = !1, this.token = l.state.token, this.sendTokenAmount = l.state.sendTokenAmount, this.receiverAddress = l.state.receiverAddress, this.receiverProfileName = l.state.receiverProfileName, this.loading = l.state.loading, this.params = (i = h.state.data) == null ? void 0 : i.send, this.caipAddress = (r = g.getAccountData()) == null ? void 0 : r.caipAddress, this.message = p.PREVIEW_SEND, this.disconnecting = !1, this.token && !this.params && (this.fetchBalances(), this.fetchNetworkPrice());
399
+ const t = g.subscribeKey("activeCaipAddress", (o) => {
400
+ !o && this.isTryingToChooseDifferentWallet && (this.isTryingToChooseDifferentWallet = !1, q.open({
401
+ view: "Connect",
402
+ data: {
403
+ redirectView: "WalletSend"
404
+ }
405
+ }).catch(() => null), t());
406
+ });
407
+ this.unsubscribe.push(g.subscribeAccountStateProp("caipAddress", (o) => {
408
+ this.caipAddress = o;
409
+ }), l.subscribe((o) => {
410
+ this.token = o.token, this.sendTokenAmount = o.sendTokenAmount, this.receiverAddress = o.receiverAddress, this.receiverProfileName = o.receiverProfileName, this.loading = o.loading;
411
+ }));
412
+ }
413
+ disconnectedCallback() {
414
+ this.unsubscribe.forEach((t) => t());
415
+ }
416
+ async firstUpdated() {
417
+ await this.handleSendParameters();
418
+ }
419
+ render() {
420
+ this.getMessage();
421
+ const t = !!this.params;
422
+ return c` <wui-flex flexDirection="column" .padding=${["0", "4", "4", "4"]}>
423
+ <wui-flex class="inputContainer" gap="2" flexDirection="column">
424
+ <w3m-input-token
425
+ .token=${this.token}
426
+ .sendTokenAmount=${this.sendTokenAmount}
427
+ ?readOnly=${t}
428
+ ?isInsufficientBalance=${this.message === p.INSUFFICIENT_FUNDS}
429
+ ></w3m-input-token>
430
+ <wui-icon-box size="md" variant="secondary" icon="arrowBottom"></wui-icon-box>
431
+ <w3m-input-address
432
+ ?readOnly=${t}
433
+ .value=${this.receiverProfileName ? this.receiverProfileName : this.receiverAddress}
434
+ ></w3m-input-address>
435
+ </wui-flex>
436
+ ${this.buttonTemplate()}
437
+ </wui-flex>`;
438
+ }
439
+ async fetchBalances() {
440
+ await l.fetchTokenBalance(), l.fetchNetworkBalance();
441
+ }
442
+ async fetchNetworkPrice() {
443
+ await Q.getNetworkTokenPrice();
444
+ }
445
+ onButtonClick() {
446
+ h.push("WalletSendPreview", {
447
+ send: this.params
448
+ });
449
+ }
450
+ onFundWalletClick() {
451
+ h.push("FundWallet", {
452
+ redirectView: "WalletSend"
453
+ });
454
+ }
455
+ async onConnectDifferentWalletClick() {
456
+ try {
457
+ this.isTryingToChooseDifferentWallet = !0, this.disconnecting = !0, await j.disconnect();
458
+ } finally {
459
+ this.disconnecting = !1;
460
+ }
461
+ }
462
+ getMessage() {
463
+ var t;
464
+ this.message = p.PREVIEW_SEND, this.receiverAddress && !D.isAddress(this.receiverAddress, g.state.activeChain) && (this.message = p.INVALID_ADDRESS), this.receiverAddress || (this.message = p.ADD_ADDRESS), this.sendTokenAmount && this.token && this.sendTokenAmount > Number(this.token.quantity.numeric) && (this.message = p.INSUFFICIENT_FUNDS), this.sendTokenAmount || (this.message = p.ADD_AMOUNT), this.sendTokenAmount && ((t = this.token) != null && t.price) && (this.sendTokenAmount * this.token.price || (this.message = p.INCORRECT_VALUE)), this.token || (this.message = p.SELECT_TOKEN);
465
+ }
466
+ buttonTemplate() {
467
+ const t = !this.message.startsWith(p.PREVIEW_SEND), i = this.message === p.INSUFFICIENT_FUNDS, r = !!this.params;
468
+ return i && !r ? c`
469
+ <wui-flex .margin=${["4", "0", "0", "0"]} flexDirection="column" gap="4">
470
+ <wui-button
471
+ @click=${this.onFundWalletClick.bind(this)}
472
+ size="lg"
473
+ variant="accent-secondary"
474
+ fullWidth
475
+ >
476
+ Fund Wallet
477
+ </wui-button>
478
+
479
+ <wui-separator data-testid="wui-separator" text="or"></wui-separator>
480
+
481
+ <wui-button
482
+ @click=${this.onConnectDifferentWalletClick.bind(this)}
483
+ size="lg"
484
+ variant="neutral-secondary"
485
+ fullWidth
486
+ ?loading=${this.disconnecting}
487
+ >
488
+ Connect a different wallet
489
+ </wui-button>
490
+ </wui-flex>
491
+ ` : c`<wui-flex .margin=${["4", "0", "0", "0"]}>
492
+ <wui-button
493
+ @click=${this.onButtonClick.bind(this)}
494
+ ?disabled=${t}
495
+ size="lg"
496
+ variant="accent-primary"
497
+ ?loading=${this.loading}
498
+ fullWidth
499
+ >
500
+ ${this.message}
501
+ </wui-button>
502
+ </wui-flex>`;
503
+ }
504
+ async handleSendParameters() {
505
+ if (this.loading = !0, !this.params) {
506
+ this.loading = !1;
507
+ return;
508
+ }
509
+ const t = Number(this.params.amount);
510
+ if (isNaN(t)) {
511
+ y.showError("Invalid amount"), this.loading = !1;
512
+ return;
513
+ }
514
+ const { namespace: i, chainId: r, assetAddress: o } = this.params;
515
+ if (!G.SEND_PARAMS_SUPPORTED_CHAINS.includes(i)) {
516
+ y.showError(`Chain "${i}" is not supported for send parameters`), this.loading = !1;
517
+ return;
518
+ }
519
+ const n = g.getCaipNetworkById(r, i);
520
+ if (!n) {
521
+ y.showError(`Network with id "${r}" not found`), this.loading = !1;
522
+ return;
523
+ }
524
+ try {
525
+ const { balance: s, name: a, symbol: W, decimals: V } = await X.fetchERC20Balance({
526
+ caipAddress: this.caipAddress,
527
+ assetAddress: o,
528
+ caipNetwork: n
529
+ });
530
+ if (!a || !W || !V || !s) {
531
+ y.showError("Token not found");
532
+ return;
533
+ }
534
+ l.setToken({
535
+ name: a,
536
+ symbol: W,
537
+ chainId: n.id.toString(),
538
+ address: `${n.chainNamespace}:${n.id}:${o}`,
539
+ value: 0,
540
+ price: 0,
541
+ quantity: {
542
+ decimals: V.toString(),
543
+ numeric: s.toString()
544
+ },
545
+ iconUrl: K.getTokenImage(W) ?? ""
546
+ }), l.setTokenAmount(t), l.setReceiverAddress(this.params.to);
547
+ } catch (s) {
548
+ console.error("Failed to load token information:", s), y.showError("Failed to load token information");
549
+ } finally {
550
+ this.loading = !1;
551
+ }
552
+ }
553
+ };
554
+ f.styles = ne;
555
+ w([
556
+ u()
557
+ ], f.prototype, "token", void 0);
558
+ w([
559
+ u()
560
+ ], f.prototype, "sendTokenAmount", void 0);
561
+ w([
562
+ u()
563
+ ], f.prototype, "receiverAddress", void 0);
564
+ w([
565
+ u()
566
+ ], f.prototype, "receiverProfileName", void 0);
567
+ w([
568
+ u()
569
+ ], f.prototype, "loading", void 0);
570
+ w([
571
+ u()
572
+ ], f.prototype, "params", void 0);
573
+ w([
574
+ u()
575
+ ], f.prototype, "caipAddress", void 0);
576
+ w([
577
+ u()
578
+ ], f.prototype, "message", void 0);
579
+ w([
580
+ u()
581
+ ], f.prototype, "disconnecting", void 0);
582
+ f = w([
583
+ x("w3m-wallet-send-view")
584
+ ], f);
585
+ const re = b`
586
+ .contentContainer {
587
+ height: 440px;
588
+ overflow: scroll;
589
+ scrollbar-width: none;
590
+ }
591
+
592
+ .contentContainer::-webkit-scrollbar {
593
+ display: none;
594
+ }
595
+
596
+ wui-icon-box {
597
+ width: 40px;
598
+ height: 40px;
599
+ border-radius: ${({ borderRadius: e }) => e[3]};
600
+ }
601
+ `;
602
+ var I = function(e, t, i, r) {
603
+ var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
604
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
605
+ else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
606
+ return o > 3 && n && Object.defineProperty(t, i, n), n;
607
+ };
608
+ let C = class extends v {
609
+ constructor() {
610
+ super(), this.unsubscribe = [], this.tokenBalances = l.state.tokenBalances, this.search = "", this.onDebouncedSearch = D.debounce((t) => {
611
+ this.search = t;
612
+ }), this.fetchBalancesAndNetworkPrice(), this.unsubscribe.push(l.subscribe((t) => {
613
+ this.tokenBalances = t.tokenBalances;
614
+ }));
615
+ }
616
+ disconnectedCallback() {
617
+ this.unsubscribe.forEach((t) => t());
618
+ }
619
+ render() {
620
+ return c`
621
+ <wui-flex flexDirection="column">
622
+ ${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()}
623
+ </wui-flex>
624
+ `;
625
+ }
626
+ async fetchBalancesAndNetworkPrice() {
627
+ var t;
628
+ (!this.tokenBalances || ((t = this.tokenBalances) == null ? void 0 : t.length) === 0) && (await this.fetchBalances(), await this.fetchNetworkPrice());
629
+ }
630
+ async fetchBalances() {
631
+ await l.fetchTokenBalance(), l.fetchNetworkBalance();
632
+ }
633
+ async fetchNetworkPrice() {
634
+ await Q.getNetworkTokenPrice();
635
+ }
636
+ templateSearchInput() {
637
+ return c`
638
+ <wui-flex gap="2" padding="3">
639
+ <wui-input-text
640
+ @inputChange=${this.onInputChange.bind(this)}
641
+ class="network-search-input"
642
+ size="sm"
643
+ placeholder="Search token"
644
+ icon="search"
645
+ ></wui-input-text>
646
+ </wui-flex>
647
+ `;
648
+ }
649
+ templateTokens() {
650
+ var t, i;
651
+ return this.tokens = (t = this.tokenBalances) == null ? void 0 : t.filter((r) => {
652
+ var o;
653
+ return r.chainId === ((o = g.state.activeCaipNetwork) == null ? void 0 : o.caipNetworkId);
654
+ }), this.search ? this.filteredTokens = (i = this.tokenBalances) == null ? void 0 : i.filter((r) => r.name.toLowerCase().includes(this.search.toLowerCase())) : this.filteredTokens = this.tokens, c`
655
+ <wui-flex
656
+ class="contentContainer"
657
+ flexDirection="column"
658
+ .padding=${["0", "3", "0", "3"]}
659
+ >
660
+ <wui-flex justifyContent="flex-start" .padding=${["4", "3", "3", "3"]}>
661
+ <wui-text variant="md-medium" color="secondary">Your tokens</wui-text>
662
+ </wui-flex>
663
+ <wui-flex flexDirection="column" gap="2">
664
+ ${this.filteredTokens && this.filteredTokens.length > 0 ? this.filteredTokens.map((r) => c`<wui-list-token
665
+ @click=${this.handleTokenClick.bind(this, r)}
666
+ ?clickable=${!0}
667
+ tokenName=${r.name}
668
+ tokenImageUrl=${r.iconUrl}
669
+ tokenAmount=${r.quantity.numeric}
670
+ tokenValue=${r.value}
671
+ tokenCurrency=${r.symbol}
672
+ ></wui-list-token>`) : c`<wui-flex
673
+ .padding=${["20", "0", "0", "0"]}
674
+ alignItems="center"
675
+ flexDirection="column"
676
+ gap="4"
677
+ >
678
+ <wui-icon-box icon="coinPlaceholder" color="default" size="lg"></wui-icon-box>
679
+ <wui-flex
680
+ class="textContent"
681
+ gap="2"
682
+ flexDirection="column"
683
+ justifyContent="center"
684
+ flexDirection="column"
685
+ >
686
+ <wui-text variant="lg-medium" align="center" color="primary">
687
+ No tokens found
688
+ </wui-text>
689
+ <wui-text variant="lg-regular" align="center" color="secondary">
690
+ Your tokens will appear here
691
+ </wui-text>
692
+ </wui-flex>
693
+ <wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>
694
+ </wui-flex>`}
695
+ </wui-flex>
696
+ </wui-flex>
697
+ `;
698
+ }
699
+ onBuyClick() {
700
+ h.push("OnRampProviders");
701
+ }
702
+ onInputChange(t) {
703
+ this.onDebouncedSearch(t.detail);
704
+ }
705
+ handleTokenClick(t) {
706
+ l.setToken(t), l.setTokenAmount(void 0), h.goBack();
707
+ }
708
+ };
709
+ C.styles = re;
710
+ I([
711
+ u()
712
+ ], C.prototype, "tokenBalances", void 0);
713
+ I([
714
+ u()
715
+ ], C.prototype, "tokens", void 0);
716
+ I([
717
+ u()
718
+ ], C.prototype, "filteredTokens", void 0);
719
+ I([
720
+ u()
721
+ ], C.prototype, "search", void 0);
722
+ C = I([
723
+ x("w3m-wallet-send-select-token-view")
724
+ ], C);
725
+ const oe = b`
726
+ :host {
727
+ height: 32px;
728
+ display: flex;
729
+ align-items: center;
730
+ gap: ${({ spacing: e }) => e[1]};
731
+ border-radius: ${({ borderRadius: e }) => e[32]};
732
+ background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
733
+ padding: ${({ spacing: e }) => e[1]};
734
+ padding-left: ${({ spacing: e }) => e[2]};
735
+ }
736
+
737
+ wui-avatar,
738
+ wui-image {
739
+ width: 24px;
740
+ height: 24px;
741
+ border-radius: ${({ borderRadius: e }) => e[16]};
742
+ }
743
+
744
+ wui-icon {
745
+ border-radius: ${({ borderRadius: e }) => e[16]};
746
+ }
747
+ `;
748
+ var _ = function(e, t, i, r) {
749
+ var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
750
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
751
+ else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
752
+ return o > 3 && n && Object.defineProperty(t, i, n), n;
753
+ };
754
+ let T = class extends v {
755
+ constructor() {
756
+ super(...arguments), this.text = "";
757
+ }
758
+ render() {
759
+ return c`<wui-text variant="lg-regular" color="primary">${this.text}</wui-text>
760
+ ${this.imageTemplate()}`;
761
+ }
762
+ imageTemplate() {
763
+ return this.address ? c`<wui-avatar address=${this.address} .imageSrc=${this.imageSrc}></wui-avatar>` : this.imageSrc ? c`<wui-image src=${this.imageSrc}></wui-image>` : c`<wui-icon size="lg" color="inverse" name="networkPlaceholder"></wui-icon>`;
764
+ }
765
+ };
766
+ T.styles = [Y, J, oe];
767
+ _([
768
+ d({ type: String })
769
+ ], T.prototype, "text", void 0);
770
+ _([
771
+ d({ type: String })
772
+ ], T.prototype, "address", void 0);
773
+ _([
774
+ d({ type: String })
775
+ ], T.prototype, "imageSrc", void 0);
776
+ T = _([
777
+ x("wui-preview-item")
778
+ ], T);
779
+ const se = b`
780
+ :host {
781
+ display: flex;
782
+ padding: ${({ spacing: e }) => e[4]} ${({ spacing: e }) => e[3]};
783
+ width: 100%;
784
+ background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
785
+ border-radius: ${({ borderRadius: e }) => e[4]};
786
+ }
787
+
788
+ wui-image {
789
+ width: 20px;
790
+ height: 20px;
791
+ border-radius: ${({ borderRadius: e }) => e[16]};
792
+ }
793
+
794
+ wui-icon {
795
+ width: 20px;
796
+ height: 20px;
797
+ }
798
+ `;
799
+ var O = function(e, t, i, r) {
800
+ var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
801
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
802
+ else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
803
+ return o > 3 && n && Object.defineProperty(t, i, n), n;
804
+ };
805
+ let S = class extends v {
806
+ constructor() {
807
+ super(...arguments), this.imageSrc = void 0, this.textTitle = "", this.textValue = void 0;
808
+ }
809
+ render() {
810
+ return c`
811
+ <wui-flex justifyContent="space-between" alignItems="center">
812
+ <wui-text variant="lg-regular" color="primary"> ${this.textTitle} </wui-text>
813
+ ${this.templateContent()}
814
+ </wui-flex>
815
+ `;
816
+ }
817
+ templateContent() {
818
+ return this.imageSrc ? c`<wui-image src=${this.imageSrc} alt=${this.textTitle}></wui-image>` : this.textValue ? c` <wui-text variant="md-regular" color="secondary"> ${this.textValue} </wui-text>` : c`<wui-icon size="inherit" color="default" name="networkPlaceholder"></wui-icon>`;
819
+ }
820
+ };
821
+ S.styles = [Y, J, se];
822
+ O([
823
+ d()
824
+ ], S.prototype, "imageSrc", void 0);
825
+ O([
826
+ d()
827
+ ], S.prototype, "textTitle", void 0);
828
+ O([
829
+ d()
830
+ ], S.prototype, "textValue", void 0);
831
+ S = O([
832
+ x("wui-list-content")
833
+ ], S);
834
+ const ae = b`
835
+ :host {
836
+ display: flex;
837
+ width: auto;
838
+ flex-direction: column;
839
+ gap: ${({ spacing: e }) => e[1]};
840
+ border-radius: ${({ borderRadius: e }) => e[5]};
841
+ background: ${({ tokens: e }) => e.theme.foregroundPrimary};
842
+ padding: ${({ spacing: e }) => e[3]} ${({ spacing: e }) => e[2]}
843
+ ${({ spacing: e }) => e[2]} ${({ spacing: e }) => e[2]};
844
+ }
845
+
846
+ wui-list-content {
847
+ width: -webkit-fill-available !important;
848
+ }
849
+
850
+ wui-text {
851
+ padding: 0 ${({ spacing: e }) => e[2]};
852
+ }
853
+
854
+ wui-flex {
855
+ margin-top: ${({ spacing: e }) => e[2]};
856
+ }
857
+
858
+ .network {
859
+ cursor: pointer;
860
+ transition: background-color ${({ durations: e }) => e.lg}
861
+ ${({ easings: e }) => e["ease-out-power-1"]};
862
+ will-change: background-color;
863
+ }
864
+
865
+ .network:focus-visible {
866
+ border: 1px solid ${({ tokens: e }) => e.core.textAccentPrimary};
867
+ background-color: ${({ tokens: e }) => e.core.glass010};
868
+ -webkit-box-shadow: 0px 0px 0px 4px ${({ tokens: e }) => e.core.foregroundAccent010};
869
+ -moz-box-shadow: 0px 0px 0px 4px ${({ tokens: e }) => e.core.foregroundAccent010};
870
+ box-shadow: 0px 0px 0px 4px ${({ tokens: e }) => e.core.foregroundAccent010};
871
+ }
872
+
873
+ .network:hover {
874
+ background-color: ${({ tokens: e }) => e.core.glass010};
875
+ }
876
+
877
+ .network:active {
878
+ background-color: ${({ tokens: e }) => e.core.glass010};
879
+ }
880
+ `;
881
+ var B = function(e, t, i, r) {
882
+ var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
883
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
884
+ else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
885
+ return o > 3 && n && Object.defineProperty(t, i, n), n;
886
+ };
887
+ let R = class extends v {
888
+ constructor() {
889
+ var t;
890
+ super(...arguments), this.params = (t = h.state.data) == null ? void 0 : t.send;
891
+ }
892
+ render() {
893
+ return c` <wui-text variant="sm-regular" color="secondary">Details</wui-text>
894
+ <wui-flex flexDirection="column" gap="1">
895
+ <wui-list-content
896
+ textTitle="Address"
897
+ textValue=${N.getTruncateString({
898
+ string: this.receiverAddress ?? "",
899
+ charsStart: 4,
900
+ charsEnd: 4,
901
+ truncate: "middle"
902
+ })}
903
+ >
904
+ </wui-list-content>
905
+ ${this.networkTemplate()}
906
+ </wui-flex>`;
907
+ }
908
+ networkTemplate() {
909
+ var t;
910
+ return (t = this.caipNetwork) != null && t.name ? c` <wui-list-content
911
+ @click=${() => this.onNetworkClick(this.caipNetwork)}
912
+ class="network"
913
+ textTitle="Network"
914
+ imageSrc=${Z(K.getNetworkImage(this.caipNetwork))}
915
+ ></wui-list-content>` : null;
916
+ }
917
+ onNetworkClick(t) {
918
+ t && !this.params && h.push("Networks", { network: t });
919
+ }
920
+ };
921
+ R.styles = ae;
922
+ B([
923
+ d()
924
+ ], R.prototype, "receiverAddress", void 0);
925
+ B([
926
+ d({ type: Object })
927
+ ], R.prototype, "caipNetwork", void 0);
928
+ B([
929
+ u()
930
+ ], R.prototype, "params", void 0);
931
+ R = B([
932
+ x("w3m-wallet-send-details")
933
+ ], R);
934
+ const le = b`
935
+ wui-avatar,
936
+ wui-image {
937
+ display: ruby;
938
+ width: 32px;
939
+ height: 32px;
940
+ border-radius: ${({ borderRadius: e }) => e[20]};
941
+ }
942
+
943
+ .sendButton {
944
+ width: 70%;
945
+ --local-width: 100% !important;
946
+ --local-border-radius: ${({ borderRadius: e }) => e[4]} !important;
947
+ }
948
+
949
+ .cancelButton {
950
+ width: 30%;
951
+ --local-width: 100% !important;
952
+ --local-border-radius: ${({ borderRadius: e }) => e[4]} !important;
953
+ }
954
+ `;
955
+ var k = function(e, t, i, r) {
956
+ var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
957
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
958
+ else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
959
+ return o > 3 && n && Object.defineProperty(t, i, n), n;
960
+ };
961
+ let m = class extends v {
962
+ constructor() {
963
+ var t;
964
+ super(), this.unsubscribe = [], this.token = l.state.token, this.sendTokenAmount = l.state.sendTokenAmount, this.receiverAddress = l.state.receiverAddress, this.receiverProfileName = l.state.receiverProfileName, this.receiverProfileImageUrl = l.state.receiverProfileImageUrl, this.caipNetwork = g.state.activeCaipNetwork, this.loading = l.state.loading, this.params = (t = h.state.data) == null ? void 0 : t.send, this.unsubscribe.push(l.subscribe((i) => {
965
+ this.token = i.token, this.sendTokenAmount = i.sendTokenAmount, this.receiverAddress = i.receiverAddress, this.receiverProfileName = i.receiverProfileName, this.receiverProfileImageUrl = i.receiverProfileImageUrl, this.loading = i.loading;
966
+ }), g.subscribeKey("activeCaipNetwork", (i) => this.caipNetwork = i));
967
+ }
968
+ disconnectedCallback() {
969
+ this.unsubscribe.forEach((t) => t());
970
+ }
971
+ render() {
972
+ var t, i;
973
+ return c` <wui-flex flexDirection="column" .padding=${["0", "4", "4", "4"]}>
974
+ <wui-flex gap="2" flexDirection="column" .padding=${["0", "2", "0", "2"]}>
975
+ <wui-flex alignItems="center" justifyContent="space-between">
976
+ <wui-flex flexDirection="column" gap="01">
977
+ <wui-text variant="sm-regular" color="secondary">Send</wui-text>
978
+ ${this.sendValueTemplate()}
979
+ </wui-flex>
980
+ <wui-preview-item
981
+ text="${this.sendTokenAmount ? N.roundNumber(this.sendTokenAmount, 6, 5) : "unknown"} ${(t = this.token) == null ? void 0 : t.symbol}"
982
+ .imageSrc=${(i = this.token) == null ? void 0 : i.iconUrl}
983
+ ></wui-preview-item>
984
+ </wui-flex>
985
+ <wui-flex>
986
+ <wui-icon color="default" size="md" name="arrowBottom"></wui-icon>
987
+ </wui-flex>
988
+ <wui-flex alignItems="center" justifyContent="space-between">
989
+ <wui-text variant="sm-regular" color="secondary">To</wui-text>
990
+ <wui-preview-item
991
+ text="${this.receiverProfileName ? N.getTruncateString({
992
+ string: this.receiverProfileName,
993
+ charsStart: 20,
994
+ charsEnd: 0,
995
+ truncate: "end"
996
+ }) : N.getTruncateString({
997
+ string: this.receiverAddress ? this.receiverAddress : "",
998
+ charsStart: 4,
999
+ charsEnd: 4,
1000
+ truncate: "middle"
1001
+ })}"
1002
+ address=${this.receiverAddress ?? ""}
1003
+ .imageSrc=${this.receiverProfileImageUrl ?? void 0}
1004
+ .isAddress=${!0}
1005
+ ></wui-preview-item>
1006
+ </wui-flex>
1007
+ </wui-flex>
1008
+ <wui-flex flexDirection="column" .padding=${["6", "0", "0", "0"]}>
1009
+ <w3m-wallet-send-details
1010
+ .caipNetwork=${this.caipNetwork}
1011
+ .receiverAddress=${this.receiverAddress}
1012
+ ></w3m-wallet-send-details>
1013
+ <wui-flex justifyContent="center" gap="1" .padding=${["3", "0", "0", "0"]}>
1014
+ <wui-icon size="sm" color="default" name="warningCircle"></wui-icon>
1015
+ <wui-text variant="sm-regular" color="secondary">Review transaction carefully</wui-text>
1016
+ </wui-flex>
1017
+ <wui-flex justifyContent="center" gap="3" .padding=${["4", "0", "0", "0"]}>
1018
+ <wui-button
1019
+ class="cancelButton"
1020
+ @click=${this.onCancelClick.bind(this)}
1021
+ size="lg"
1022
+ variant="neutral-secondary"
1023
+ >
1024
+ Cancel
1025
+ </wui-button>
1026
+ <wui-button
1027
+ class="sendButton"
1028
+ @click=${this.onSendClick.bind(this)}
1029
+ size="lg"
1030
+ variant="accent-primary"
1031
+ .loading=${this.loading}
1032
+ >
1033
+ Send
1034
+ </wui-button>
1035
+ </wui-flex>
1036
+ </wui-flex></wui-flex
1037
+ >`;
1038
+ }
1039
+ sendValueTemplate() {
1040
+ if (!this.params && this.token && this.sendTokenAmount) {
1041
+ const i = this.token.price * this.sendTokenAmount;
1042
+ return c`<wui-text variant="md-regular" color="primary"
1043
+ >$${i.toFixed(2)}</wui-text
1044
+ >`;
1045
+ }
1046
+ return null;
1047
+ }
1048
+ async onSendClick() {
1049
+ if (!this.sendTokenAmount || !this.receiverAddress) {
1050
+ y.showError("Please enter a valid amount and receiver address");
1051
+ return;
1052
+ }
1053
+ try {
1054
+ await l.sendToken(), this.params ? h.reset("WalletSendConfirmed") : (y.showSuccess("Transaction started"), h.replace("Account"));
1055
+ } catch (t) {
1056
+ let i = "Failed to send transaction";
1057
+ const r = t instanceof L && t.originalName === M.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST, o = t instanceof L && t.originalName === M.PROVIDER_RPC_ERROR_NAME.SEND_TRANSACTION_ERROR;
1058
+ (r || o) && (i = t.message), ee.sendEvent({
1059
+ type: "track",
1060
+ event: r ? "SEND_REJECTED" : "SEND_ERROR",
1061
+ properties: l.getSdkEventProperties(t)
1062
+ }), y.showError(i);
1063
+ }
1064
+ }
1065
+ onCancelClick() {
1066
+ h.goBack();
1067
+ }
1068
+ };
1069
+ m.styles = le;
1070
+ k([
1071
+ u()
1072
+ ], m.prototype, "token", void 0);
1073
+ k([
1074
+ u()
1075
+ ], m.prototype, "sendTokenAmount", void 0);
1076
+ k([
1077
+ u()
1078
+ ], m.prototype, "receiverAddress", void 0);
1079
+ k([
1080
+ u()
1081
+ ], m.prototype, "receiverProfileName", void 0);
1082
+ k([
1083
+ u()
1084
+ ], m.prototype, "receiverProfileImageUrl", void 0);
1085
+ k([
1086
+ u()
1087
+ ], m.prototype, "caipNetwork", void 0);
1088
+ k([
1089
+ u()
1090
+ ], m.prototype, "loading", void 0);
1091
+ k([
1092
+ u()
1093
+ ], m.prototype, "params", void 0);
1094
+ m = k([
1095
+ x("w3m-wallet-send-preview-view")
1096
+ ], m);
1097
+ const ce = b`
1098
+ .icon-box {
1099
+ width: 64px;
1100
+ height: 64px;
1101
+ border-radius: 16px;
1102
+ background-color: ${({ spacing: e }) => e[16]};
1103
+ border: 8px solid ${({ tokens: e }) => e.theme.borderPrimary};
1104
+ border-radius: ${({ borderRadius: e }) => e.round};
1105
+ }
1106
+ `;
1107
+ var ue = function(e, t, i, r) {
1108
+ var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
1109
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
1110
+ else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
1111
+ return o > 3 && n && Object.defineProperty(t, i, n), n;
1112
+ };
1113
+ let U = class extends v {
1114
+ constructor() {
1115
+ super(), this.unsubscribe = [], this.unsubscribe.push();
1116
+ }
1117
+ render() {
1118
+ return c`
1119
+ <wui-flex
1120
+ flexDirection="column"
1121
+ alignItems="center"
1122
+ gap="4"
1123
+ .padding="${["1", "3", "4", "3"]}"
1124
+ >
1125
+ <wui-flex justifyContent="center" alignItems="center" class="icon-box">
1126
+ <wui-icon size="xxl" color="success" name="checkmark"></wui-icon>
1127
+ </wui-flex>
1128
+
1129
+ <wui-text variant="h6-medium" color="primary">You successfully sent asset</wui-text>
1130
+
1131
+ <wui-button
1132
+ fullWidth
1133
+ @click=${this.onCloseClick.bind(this)}
1134
+ size="lg"
1135
+ variant="neutral-secondary"
1136
+ >
1137
+ Close
1138
+ </wui-button>
1139
+ </wui-flex>
1140
+ `;
1141
+ }
1142
+ onCloseClick() {
1143
+ q.close();
1144
+ }
1145
+ };
1146
+ U.styles = ce;
1147
+ U = ue([
1148
+ x("w3m-send-confirmed-view")
1149
+ ], U);
1150
+ export {
1151
+ U as W3mSendConfirmedView,
1152
+ C as W3mSendSelectTokenView,
1153
+ m as W3mWalletSendPreviewView,
1154
+ f as W3mWalletSendView
1155
+ };