@directcryptopay/sdk 0.1.0

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 (141) hide show
  1. package/README.md +357 -0
  2. package/dist/ConstantsUtil-B-_-u8aQ.js +6 -0
  3. package/dist/add-KF4m4jFK.js +19 -0
  4. package/dist/all-wallets-D6NAjQgX.js +10 -0
  5. package/dist/app-store-D7TTn-EO.js +21 -0
  6. package/dist/apple-DjX2E2hE.js +22 -0
  7. package/dist/arrow-bottom-C0YrNJYB.js +12 -0
  8. package/dist/arrow-bottom-circle-Dlxvx_XG.js +15 -0
  9. package/dist/arrow-left-x8_-lUyK.js +12 -0
  10. package/dist/arrow-right-BTZybj80.js +12 -0
  11. package/dist/arrow-top-LzH7iLCp.js +12 -0
  12. package/dist/bank-23jp-IV_.js +18 -0
  13. package/dist/browser-EjoorDid.js +18 -0
  14. package/dist/card-DGgWwtwC.js +18 -0
  15. package/dist/ccip-BMANewTU.js +150 -0
  16. package/dist/checkmark-B1qcQhBo.js +15 -0
  17. package/dist/checkmark-bold-Cyc4IEEJ.js +12 -0
  18. package/dist/chevron-bottom-ClHs08rB.js +12 -0
  19. package/dist/chevron-left-O8h_551_.js +12 -0
  20. package/dist/chevron-right-DP3xpyIA.js +12 -0
  21. package/dist/chevron-top-CuwkBUs9.js +12 -0
  22. package/dist/chrome-store-zfT_aJ3R.js +65 -0
  23. package/dist/clock-DHZqivIS.js +12 -0
  24. package/dist/close-Cp9rNAw4.js +12 -0
  25. package/dist/coinPlaceholder-U7-T1KKQ.js +12 -0
  26. package/dist/compass-Ds5-PRSR.js +12 -0
  27. package/dist/copy-Jg4HdIMf.js +19 -0
  28. package/dist/core/api.d.ts +30 -0
  29. package/dist/core/config.d.ts +59 -0
  30. package/dist/core/logic.d.ts +2 -0
  31. package/dist/core/wallet.d.ts +34 -0
  32. package/dist/cursor-DmMevduB.js +7 -0
  33. package/dist/cursor-transparent-Dn9-1SV8.js +16 -0
  34. package/dist/dcp-sdk.umd.js +12000 -0
  35. package/dist/dcp.d.ts +10 -0
  36. package/dist/desktop-C4udXXlZ.js +13 -0
  37. package/dist/disconnect-wd1BYLxt.js +12 -0
  38. package/dist/discord-DthxuCAP.js +21 -0
  39. package/dist/email-B3jSnUFE.js +696 -0
  40. package/dist/embedded-wallet-CJHmoBI2.js +468 -0
  41. package/dist/etherscan-Cjp4xfMW.js +10 -0
  42. package/dist/exclamation-triangle-CRNR5WOy.js +8 -0
  43. package/dist/extension-Cydk0mZt.js +12 -0
  44. package/dist/external-link-CuPTAoq9.js +12 -0
  45. package/dist/facebook-CghqXmdf.js +30 -0
  46. package/dist/farcaster-BREqMX4y.js +16 -0
  47. package/dist/filters-Dn_Ys7ew.js +12 -0
  48. package/dist/github-C-A7JmIY.js +22 -0
  49. package/dist/google-CCdM_naE.js +22 -0
  50. package/dist/hashTypedData-D2Qmzscs.js +197 -0
  51. package/dist/help-circle-DIH4vyj3.js +16 -0
  52. package/dist/id-DkJ0gBuy.js +16 -0
  53. package/dist/if-defined-BciplFKz.js +744 -0
  54. package/dist/image-qMjyiXM0.js +8 -0
  55. package/dist/index--3Zp0jAb.js +45 -0
  56. package/dist/index-1adX-Fit.js +65 -0
  57. package/dist/index-AvC0IGDl.js +7864 -0
  58. package/dist/index-B2-vKLd8.js +276 -0
  59. package/dist/index-B2iDt0TJ.js +146 -0
  60. package/dist/index-B5zkXsLJ.js +320 -0
  61. package/dist/index-B7K86vWu.js +1742 -0
  62. package/dist/index-BBkcvSiY.js +511 -0
  63. package/dist/index-BdjxQs66.js +181 -0
  64. package/dist/index-Bijd4_Ns.js +294 -0
  65. package/dist/index-BpXOsxzU.js +387 -0
  66. package/dist/index-C1QEJL-2.js +572 -0
  67. package/dist/index-C27dwOyE.js +243 -0
  68. package/dist/index-C4BX3QW8.js +58 -0
  69. package/dist/index-CMPIqsB1.js +170 -0
  70. package/dist/index-CTYngdl0.js +21991 -0
  71. package/dist/index-CUdQyyFn.js +51 -0
  72. package/dist/index-CX60z_g2.js +573 -0
  73. package/dist/index-CppCc1n8.js +65 -0
  74. package/dist/index-CqVegmN4.js +559 -0
  75. package/dist/index-CuiyMA8F.js +78 -0
  76. package/dist/index-CwB_qRfM.js +305 -0
  77. package/dist/index-CxOF7GqE.js +265 -0
  78. package/dist/index-D-IzHD_8.js +54 -0
  79. package/dist/index-DRNiFv9I.js +218 -0
  80. package/dist/index-Da8oZh8H.js +838 -0
  81. package/dist/index-DiHImG4L.js +44236 -0
  82. package/dist/index-DmOMXRG1.js +181 -0
  83. package/dist/index-DoSYqTQg.js +199 -0
  84. package/dist/index-DpHXq5_E.js +603 -0
  85. package/dist/index-DtCsAVBg.js +78 -0
  86. package/dist/index-Ij6XA6_4.js +77 -0
  87. package/dist/index-SzyBYfzA.js +8490 -0
  88. package/dist/index-eW8y-mXH.js +257 -0
  89. package/dist/index-fxzIDZsb.js +75 -0
  90. package/dist/index-lbhz9evJ.js +97 -0
  91. package/dist/index.d.ts +3 -0
  92. package/dist/index.js +4 -0
  93. package/dist/info-DMIGgjkL.js +7 -0
  94. package/dist/info-circle-CJuIKZSx.js +16 -0
  95. package/dist/lightbulb-qFT6WEWV.js +7 -0
  96. package/dist/localBatchGatewayRequest-CsMVMFBc.js +91 -0
  97. package/dist/mail-DoYgQvOt.js +12 -0
  98. package/dist/mobile-URtsh7o-.js +13 -0
  99. package/dist/more-DoQd10TF.js +15 -0
  100. package/dist/network-placeholder-BBA2Ue6C.js +18 -0
  101. package/dist/nftPlaceholder-C9RXWz9k.js +12 -0
  102. package/dist/off-YcuDQczT.js +12 -0
  103. package/dist/onramp-BfqDIx4o.js +1279 -0
  104. package/dist/parseSignature-280HB24T.js +3560 -0
  105. package/dist/play-store-sFaloG_r.js +36 -0
  106. package/dist/plus-l0wekSht.js +17 -0
  107. package/dist/qr-code-CihrUU4G.js +10 -0
  108. package/dist/receive-dfY1Cu-g.js +186 -0
  109. package/dist/recycle-horizontal-nXu6YaPw.js +13 -0
  110. package/dist/ref-huAzXCX0.js +41 -0
  111. package/dist/refresh-D2ZbVeNC.js +12 -0
  112. package/dist/reown-logo-BMaTMJmc.js +16 -0
  113. package/dist/search-YVM9q3J-.js +12 -0
  114. package/dist/secp256k1-BrysY3Sv.js +1302 -0
  115. package/dist/secp256k1-DPQgTBwQ.js +1510 -0
  116. package/dist/send-BwQZPKxI.js +19 -0
  117. package/dist/send-GyetMVu1.js +1038 -0
  118. package/dist/socials-B0W91J9k.js +574 -0
  119. package/dist/swapHorizontal-Dy_oQEkp.js +12 -0
  120. package/dist/swapHorizontalBold-C4JpaMpc.js +12 -0
  121. package/dist/swapHorizontalMedium-D5NuVZFh.js +20 -0
  122. package/dist/swapHorizontalRoundedBold-Bq4P2MCj.js +12 -0
  123. package/dist/swapVertical-CVQ8Mg03.js +12 -0
  124. package/dist/swaps-CA04SSdK.js +1637 -0
  125. package/dist/telegram-BP4SgW_L.js +20 -0
  126. package/dist/three-dots-BJYGJ-dQ.js +9 -0
  127. package/dist/transactions-Bq-98Tsg.js +37 -0
  128. package/dist/twitch-DTATWo9M.js +22 -0
  129. package/dist/twitterIcon-D5UWPInb.js +10 -0
  130. package/dist/types.d.ts +128 -0
  131. package/dist/ui/Modal.d.ts +9 -0
  132. package/dist/ui/index.d.ts +6 -0
  133. package/dist/verify-Byvj8Wi1.js +12 -0
  134. package/dist/verify-filled-B40taNm0.js +12 -0
  135. package/dist/w3m-modal-HV6SE74G.js +1037 -0
  136. package/dist/wallet-Cp-6Kk88.js +12 -0
  137. package/dist/wallet-placeholder-C3juwA9o.js +18 -0
  138. package/dist/walletconnect-CRkIiLCx.js +36 -0
  139. package/dist/warning-circle-DtvCLwG4.js +16 -0
  140. package/dist/x-Cqyx5eCt.js +16 -0
  141. package/package.json +70 -0
@@ -0,0 +1,1037 @@
1
+ import { cN as w, dK as Z, cE as c, cz as v, cC as L, cA as y, cB as l, d4 as P, cD as se, cG as re, cT as p, cV as U, dL as ce, cF as j, d3 as G, dd as $, d7 as z, cS as q, cU as A, dM as R, cW as le, dN as de, cY as ue, d8 as pe } from "./index-DiHImG4L.js";
2
+ import { c as f, n as u, r as d, o as H, U as he } from "./if-defined-BciplFKz.js";
3
+ import "./index-1adX-Fit.js";
4
+ import "./index-CUdQyyFn.js";
5
+ import "./index-fxzIDZsb.js";
6
+ import "./index-DtCsAVBg.js";
7
+ import "./index-lbhz9evJ.js";
8
+ import "./index-B2iDt0TJ.js";
9
+ import "./index-C27dwOyE.js";
10
+ const ee = {
11
+ isUnsupportedChainView() {
12
+ return c.state.view === "UnsupportedChain" || c.state.view === "SwitchNetwork" && c.state.history.includes("UnsupportedChain");
13
+ },
14
+ async safeClose() {
15
+ if (this.isUnsupportedChainView()) {
16
+ w.shake();
17
+ return;
18
+ }
19
+ if (await Z.isSIWXCloseDisabled()) {
20
+ w.shake();
21
+ return;
22
+ }
23
+ w.close();
24
+ }
25
+ }, we = v`
26
+ :host {
27
+ display: block;
28
+ border-radius: clamp(0px, var(--wui-border-radius-l), 44px);
29
+ box-shadow: 0 0 0 1px var(--wui-color-gray-glass-005);
30
+ background-color: var(--wui-color-modal-bg);
31
+ overflow: hidden;
32
+ }
33
+
34
+ :host([data-embedded='true']) {
35
+ box-shadow:
36
+ 0 0 0 1px var(--wui-color-gray-glass-005),
37
+ 0px 4px 12px 4px var(--w3m-card-embedded-shadow-color);
38
+ }
39
+ `;
40
+ var me = function(s, e, t, i) {
41
+ var a = arguments.length, o = a < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
42
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(s, e, t, i);
43
+ else for (var r = s.length - 1; r >= 0; r--) (n = s[r]) && (o = (a < 3 ? n(o) : a > 3 ? n(e, t, o) : n(e, t)) || o);
44
+ return a > 3 && o && Object.defineProperty(e, t, o), o;
45
+ };
46
+ let M = class extends y {
47
+ render() {
48
+ return l`<slot></slot>`;
49
+ }
50
+ };
51
+ M.styles = [L, we];
52
+ M = me([
53
+ f("wui-card")
54
+ ], M);
55
+ const fe = v`
56
+ :host {
57
+ display: flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+ padding: var(--wui-spacing-s);
61
+ border-radius: var(--wui-border-radius-s);
62
+ border: 1px solid var(--wui-color-dark-glass-100);
63
+ box-sizing: border-box;
64
+ background-color: var(--wui-color-bg-325);
65
+ box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.25);
66
+ }
67
+
68
+ wui-flex {
69
+ width: 100%;
70
+ }
71
+
72
+ wui-text {
73
+ word-break: break-word;
74
+ flex: 1;
75
+ }
76
+
77
+ .close {
78
+ cursor: pointer;
79
+ }
80
+
81
+ .icon-box {
82
+ height: 40px;
83
+ width: 40px;
84
+ border-radius: var(--wui-border-radius-3xs);
85
+ background-color: var(--local-icon-bg-value);
86
+ }
87
+ `;
88
+ var W = function(s, e, t, i) {
89
+ var a = arguments.length, o = a < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
90
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(s, e, t, i);
91
+ else for (var r = s.length - 1; r >= 0; r--) (n = s[r]) && (o = (a < 3 ? n(o) : a > 3 ? n(e, t, o) : n(e, t)) || o);
92
+ return a > 3 && o && Object.defineProperty(e, t, o), o;
93
+ };
94
+ let k = class extends y {
95
+ constructor() {
96
+ super(...arguments), this.message = "", this.backgroundColor = "accent-100", this.iconColor = "accent-100", this.icon = "info";
97
+ }
98
+ render() {
99
+ return this.style.cssText = `
100
+ --local-icon-bg-value: var(--wui-color-${this.backgroundColor});
101
+ `, l`
102
+ <wui-flex flexDirection="row" justifyContent="space-between" alignItems="center">
103
+ <wui-flex columnGap="xs" flexDirection="row" alignItems="center">
104
+ <wui-flex
105
+ flexDirection="row"
106
+ alignItems="center"
107
+ justifyContent="center"
108
+ class="icon-box"
109
+ >
110
+ <wui-icon color=${this.iconColor} size="md" name=${this.icon}></wui-icon>
111
+ </wui-flex>
112
+ <wui-text variant="small-500" color="bg-350" data-testid="wui-alertbar-text"
113
+ >${this.message}</wui-text
114
+ >
115
+ </wui-flex>
116
+ <wui-icon
117
+ class="close"
118
+ color="bg-350"
119
+ size="sm"
120
+ name="close"
121
+ @click=${this.onClose}
122
+ ></wui-icon>
123
+ </wui-flex>
124
+ `;
125
+ }
126
+ onClose() {
127
+ P.close();
128
+ }
129
+ };
130
+ k.styles = [L, fe];
131
+ W([
132
+ u()
133
+ ], k.prototype, "message", void 0);
134
+ W([
135
+ u()
136
+ ], k.prototype, "backgroundColor", void 0);
137
+ W([
138
+ u()
139
+ ], k.prototype, "iconColor", void 0);
140
+ W([
141
+ u()
142
+ ], k.prototype, "icon", void 0);
143
+ k = W([
144
+ f("wui-alertbar")
145
+ ], k);
146
+ const ge = v`
147
+ :host {
148
+ display: block;
149
+ position: absolute;
150
+ top: var(--wui-spacing-s);
151
+ left: var(--wui-spacing-l);
152
+ right: var(--wui-spacing-l);
153
+ opacity: 0;
154
+ pointer-events: none;
155
+ }
156
+ `;
157
+ var te = function(s, e, t, i) {
158
+ var a = arguments.length, o = a < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
159
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(s, e, t, i);
160
+ else for (var r = s.length - 1; r >= 0; r--) (n = s[r]) && (o = (a < 3 ? n(o) : a > 3 ? n(e, t, o) : n(e, t)) || o);
161
+ return a > 3 && o && Object.defineProperty(e, t, o), o;
162
+ };
163
+ const be = {
164
+ info: {
165
+ backgroundColor: "fg-350",
166
+ iconColor: "fg-325",
167
+ icon: "info"
168
+ },
169
+ success: {
170
+ backgroundColor: "success-glass-reown-020",
171
+ iconColor: "success-125",
172
+ icon: "checkmark"
173
+ },
174
+ warning: {
175
+ backgroundColor: "warning-glass-reown-020",
176
+ iconColor: "warning-100",
177
+ icon: "warningCircle"
178
+ },
179
+ error: {
180
+ backgroundColor: "error-glass-reown-020",
181
+ iconColor: "error-125",
182
+ icon: "exclamationTriangle"
183
+ }
184
+ };
185
+ let B = class extends y {
186
+ constructor() {
187
+ super(), this.unsubscribe = [], this.open = P.state.open, this.onOpen(!0), this.unsubscribe.push(P.subscribeKey("open", (e) => {
188
+ this.open = e, this.onOpen(!1);
189
+ }));
190
+ }
191
+ disconnectedCallback() {
192
+ this.unsubscribe.forEach((e) => e());
193
+ }
194
+ render() {
195
+ const { message: e, variant: t } = P.state, i = be[t];
196
+ return l`
197
+ <wui-alertbar
198
+ message=${e}
199
+ backgroundColor=${i == null ? void 0 : i.backgroundColor}
200
+ iconColor=${i == null ? void 0 : i.iconColor}
201
+ icon=${i == null ? void 0 : i.icon}
202
+ ></wui-alertbar>
203
+ `;
204
+ }
205
+ onOpen(e) {
206
+ this.open ? (this.animate([
207
+ { opacity: 0, transform: "scale(0.85)" },
208
+ { opacity: 1, transform: "scale(1)" }
209
+ ], {
210
+ duration: 150,
211
+ fill: "forwards",
212
+ easing: "ease"
213
+ }), this.style.cssText = "pointer-events: auto") : e || (this.animate([
214
+ { opacity: 1, transform: "scale(1)" },
215
+ { opacity: 0, transform: "scale(0.85)" }
216
+ ], {
217
+ duration: 150,
218
+ fill: "forwards",
219
+ easing: "ease"
220
+ }), this.style.cssText = "pointer-events: none");
221
+ }
222
+ };
223
+ B.styles = ge;
224
+ te([
225
+ d()
226
+ ], B.prototype, "open", void 0);
227
+ B = te([
228
+ f("w3m-alertbar")
229
+ ], B);
230
+ const ve = v`
231
+ button {
232
+ display: block;
233
+ display: flex;
234
+ align-items: center;
235
+ padding: var(--wui-spacing-xxs);
236
+ gap: var(--wui-spacing-xxs);
237
+ transition: all var(--wui-ease-out-power-1) var(--wui-duration-md);
238
+ border-radius: var(--wui-border-radius-xxs);
239
+ }
240
+
241
+ wui-image {
242
+ border-radius: 100%;
243
+ width: var(--wui-spacing-xl);
244
+ height: var(--wui-spacing-xl);
245
+ }
246
+
247
+ wui-icon-box {
248
+ width: var(--wui-spacing-xl);
249
+ height: var(--wui-spacing-xl);
250
+ }
251
+
252
+ button:hover {
253
+ background-color: var(--wui-color-gray-glass-002);
254
+ }
255
+
256
+ button:active {
257
+ background-color: var(--wui-color-gray-glass-005);
258
+ }
259
+ `;
260
+ var oe = function(s, e, t, i) {
261
+ var a = arguments.length, o = a < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
262
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(s, e, t, i);
263
+ else for (var r = s.length - 1; r >= 0; r--) (n = s[r]) && (o = (a < 3 ? n(o) : a > 3 ? n(e, t, o) : n(e, t)) || o);
264
+ return a > 3 && o && Object.defineProperty(e, t, o), o;
265
+ };
266
+ let _ = class extends y {
267
+ constructor() {
268
+ super(...arguments), this.imageSrc = "";
269
+ }
270
+ render() {
271
+ return l`<button>
272
+ ${this.imageTemplate()}
273
+ <wui-icon size="xs" color="fg-200" name="chevronBottom"></wui-icon>
274
+ </button>`;
275
+ }
276
+ imageTemplate() {
277
+ return this.imageSrc ? l`<wui-image src=${this.imageSrc} alt="select visual"></wui-image>` : l`<wui-icon-box
278
+ size="xxs"
279
+ iconColor="fg-200"
280
+ backgroundColor="fg-100"
281
+ background="opaque"
282
+ icon="networkPlaceholder"
283
+ ></wui-icon-box>`;
284
+ }
285
+ };
286
+ _.styles = [L, se, re, ve];
287
+ oe([
288
+ u()
289
+ ], _.prototype, "imageSrc", void 0);
290
+ _ = oe([
291
+ f("wui-select")
292
+ ], _);
293
+ const ye = v`
294
+ :host {
295
+ height: 64px;
296
+ }
297
+
298
+ wui-text {
299
+ text-transform: capitalize;
300
+ }
301
+
302
+ wui-flex.w3m-header-title {
303
+ transform: translateY(0);
304
+ opacity: 1;
305
+ }
306
+
307
+ wui-flex.w3m-header-title[view-direction='prev'] {
308
+ animation:
309
+ slide-down-out 120ms forwards var(--wui-ease-out-power-2),
310
+ slide-down-in 120ms forwards var(--wui-ease-out-power-2);
311
+ animation-delay: 0ms, 200ms;
312
+ }
313
+
314
+ wui-flex.w3m-header-title[view-direction='next'] {
315
+ animation:
316
+ slide-up-out 120ms forwards var(--wui-ease-out-power-2),
317
+ slide-up-in 120ms forwards var(--wui-ease-out-power-2);
318
+ animation-delay: 0ms, 200ms;
319
+ }
320
+
321
+ wui-icon-link[data-hidden='true'] {
322
+ opacity: 0 !important;
323
+ pointer-events: none;
324
+ }
325
+
326
+ @keyframes slide-up-out {
327
+ from {
328
+ transform: translateY(0px);
329
+ opacity: 1;
330
+ }
331
+ to {
332
+ transform: translateY(3px);
333
+ opacity: 0;
334
+ }
335
+ }
336
+
337
+ @keyframes slide-up-in {
338
+ from {
339
+ transform: translateY(-3px);
340
+ opacity: 0;
341
+ }
342
+ to {
343
+ transform: translateY(0);
344
+ opacity: 1;
345
+ }
346
+ }
347
+
348
+ @keyframes slide-down-out {
349
+ from {
350
+ transform: translateY(0px);
351
+ opacity: 1;
352
+ }
353
+ to {
354
+ transform: translateY(-3px);
355
+ opacity: 0;
356
+ }
357
+ }
358
+
359
+ @keyframes slide-down-in {
360
+ from {
361
+ transform: translateY(3px);
362
+ opacity: 0;
363
+ }
364
+ to {
365
+ transform: translateY(0);
366
+ opacity: 1;
367
+ }
368
+ }
369
+ `;
370
+ var g = function(s, e, t, i) {
371
+ var a = arguments.length, o = a < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
372
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(s, e, t, i);
373
+ else for (var r = s.length - 1; r >= 0; r--) (n = s[r]) && (o = (a < 3 ? n(o) : a > 3 ? n(e, t, o) : n(e, t)) || o);
374
+ return a > 3 && o && Object.defineProperty(e, t, o), o;
375
+ };
376
+ const Ce = ["SmartSessionList"];
377
+ function K() {
378
+ var n, r, N, x, T, E, I;
379
+ const s = (r = (n = c.state.data) == null ? void 0 : n.connector) == null ? void 0 : r.name, e = (x = (N = c.state.data) == null ? void 0 : N.wallet) == null ? void 0 : x.name, t = (E = (T = c.state.data) == null ? void 0 : T.network) == null ? void 0 : E.name, i = e ?? s, a = z.getConnectors();
380
+ return {
381
+ Connect: `Connect ${a.length === 1 && ((I = a[0]) == null ? void 0 : I.id) === "w3m-email" ? "Email" : ""} Wallet`,
382
+ Create: "Create Wallet",
383
+ ChooseAccountName: void 0,
384
+ Account: void 0,
385
+ AccountSettings: void 0,
386
+ AllWallets: "All Wallets",
387
+ ApproveTransaction: "Approve Transaction",
388
+ BuyInProgress: "Buy",
389
+ ConnectingExternal: i ?? "Connect Wallet",
390
+ ConnectingWalletConnect: i ?? "WalletConnect",
391
+ ConnectingWalletConnectBasic: "WalletConnect",
392
+ ConnectingSiwe: "Sign In",
393
+ Convert: "Convert",
394
+ ConvertSelectToken: "Select token",
395
+ ConvertPreview: "Preview convert",
396
+ Downloads: i ? `Get ${i}` : "Downloads",
397
+ EmailLogin: "Email Login",
398
+ EmailVerifyOtp: "Confirm Email",
399
+ EmailVerifyDevice: "Register Device",
400
+ GetWallet: "Get a wallet",
401
+ Networks: "Choose Network",
402
+ OnRampProviders: "Choose Provider",
403
+ OnRampActivity: "Activity",
404
+ OnRampTokenSelect: "Select Token",
405
+ OnRampFiatSelect: "Select Currency",
406
+ Pay: "How you pay",
407
+ Profile: void 0,
408
+ SwitchNetwork: t ?? "Switch Network",
409
+ SwitchAddress: "Switch Address",
410
+ Transactions: "Activity",
411
+ UnsupportedChain: "Switch Network",
412
+ UpgradeEmailWallet: "Upgrade your Wallet",
413
+ UpdateEmailWallet: "Edit Email",
414
+ UpdateEmailPrimaryOtp: "Confirm Current Email",
415
+ UpdateEmailSecondaryOtp: "Confirm New Email",
416
+ WhatIsABuy: "What is Buy?",
417
+ RegisterAccountName: "Choose name",
418
+ RegisterAccountNameSuccess: "",
419
+ WalletReceive: "Receive",
420
+ WalletCompatibleNetworks: "Compatible Networks",
421
+ Swap: "Swap",
422
+ SwapSelectToken: "Select token",
423
+ SwapPreview: "Preview swap",
424
+ WalletSend: "Send",
425
+ WalletSendPreview: "Review send",
426
+ WalletSendSelectToken: "Select Token",
427
+ WhatIsANetwork: "What is a network?",
428
+ WhatIsAWallet: "What is a wallet?",
429
+ ConnectWallets: "Connect wallet",
430
+ ConnectSocials: "All socials",
431
+ ConnectingSocial: q.state.socialProvider ? q.state.socialProvider : "Connect Social",
432
+ ConnectingMultiChain: "Select chain",
433
+ ConnectingFarcaster: "Farcaster",
434
+ SwitchActiveChain: "Switch chain",
435
+ SmartSessionCreated: void 0,
436
+ SmartSessionList: "Smart Sessions",
437
+ SIWXSignMessage: "Sign In",
438
+ PayLoading: "Payment in progress"
439
+ };
440
+ }
441
+ let h = class extends y {
442
+ constructor() {
443
+ super(), this.unsubscribe = [], this.heading = K()[c.state.view], this.network = p.state.activeCaipNetwork, this.networkImage = U.getNetworkImage(this.network), this.showBack = !1, this.prevHistoryLength = 1, this.view = c.state.view, this.viewDirection = "", this.headerText = K()[c.state.view], this.unsubscribe.push(ce.subscribeNetworkImages(() => {
444
+ this.networkImage = U.getNetworkImage(this.network);
445
+ }), c.subscribeKey("view", (e) => {
446
+ setTimeout(() => {
447
+ this.view = e, this.headerText = K()[e];
448
+ }, j.ANIMATION_DURATIONS.HeaderText), this.onViewChange(), this.onHistoryChange();
449
+ }), p.subscribeKey("activeCaipNetwork", (e) => {
450
+ this.network = e, this.networkImage = U.getNetworkImage(this.network);
451
+ }));
452
+ }
453
+ disconnectCallback() {
454
+ this.unsubscribe.forEach((e) => e());
455
+ }
456
+ render() {
457
+ return l`
458
+ <wui-flex .padding=${this.getPadding()} justifyContent="space-between" alignItems="center">
459
+ ${this.leftHeaderTemplate()} ${this.titleTemplate()} ${this.rightHeaderTemplate()}
460
+ </wui-flex>
461
+ `;
462
+ }
463
+ onWalletHelp() {
464
+ G.sendEvent({ type: "track", event: "CLICK_WALLET_HELP" }), c.push("WhatIsAWallet");
465
+ }
466
+ async onClose() {
467
+ await ee.safeClose();
468
+ }
469
+ rightHeaderTemplate() {
470
+ var t, i, a;
471
+ const e = (a = (i = (t = $) == null ? void 0 : t.state) == null ? void 0 : i.features) == null ? void 0 : a.smartSessions;
472
+ return c.state.view !== "Account" || !e ? this.closeButtonTemplate() : l`<wui-flex>
473
+ <wui-icon-link
474
+ icon="clock"
475
+ @click=${() => c.push("SmartSessionList")}
476
+ data-testid="w3m-header-smart-sessions"
477
+ ></wui-icon-link>
478
+ ${this.closeButtonTemplate()}
479
+ </wui-flex> `;
480
+ }
481
+ closeButtonTemplate() {
482
+ return l`
483
+ <wui-icon-link
484
+ icon="close"
485
+ @click=${this.onClose.bind(this)}
486
+ data-testid="w3m-header-close"
487
+ ></wui-icon-link>
488
+ `;
489
+ }
490
+ titleTemplate() {
491
+ const e = Ce.includes(this.view);
492
+ return l`
493
+ <wui-flex
494
+ view-direction="${this.viewDirection}"
495
+ class="w3m-header-title"
496
+ alignItems="center"
497
+ gap="xs"
498
+ >
499
+ <wui-text variant="paragraph-700" color="fg-100" data-testid="w3m-header-text"
500
+ >${this.headerText}</wui-text
501
+ >
502
+ ${e ? l`<wui-tag variant="main">Beta</wui-tag>` : null}
503
+ </wui-flex>
504
+ `;
505
+ }
506
+ leftHeaderTemplate() {
507
+ var x;
508
+ const { view: e } = c.state, t = e === "Connect", i = $.state.enableEmbedded, a = e === "ApproveTransaction", o = e === "ConnectingSiwe", n = e === "Account", r = $.state.enableNetworkSwitch, N = a || o || t && i;
509
+ return n && r ? l`<wui-select
510
+ id="dynamic"
511
+ data-testid="w3m-account-select-network"
512
+ active-network=${H((x = this.network) == null ? void 0 : x.name)}
513
+ @click=${this.onNetworks.bind(this)}
514
+ imageSrc=${H(this.networkImage)}
515
+ ></wui-select>` : this.showBack && !N ? l`<wui-icon-link
516
+ data-testid="header-back"
517
+ id="dynamic"
518
+ icon="chevronLeft"
519
+ @click=${this.onGoBack.bind(this)}
520
+ ></wui-icon-link>` : l`<wui-icon-link
521
+ data-hidden=${!t}
522
+ id="dynamic"
523
+ icon="helpCircle"
524
+ @click=${this.onWalletHelp.bind(this)}
525
+ ></wui-icon-link>`;
526
+ }
527
+ onNetworks() {
528
+ this.isAllowedNetworkSwitch() && (G.sendEvent({ type: "track", event: "CLICK_NETWORKS" }), c.push("Networks"));
529
+ }
530
+ isAllowedNetworkSwitch() {
531
+ const e = p.getAllRequestedCaipNetworks(), t = e ? e.length > 1 : !1, i = e == null ? void 0 : e.find(({ id: a }) => {
532
+ var o;
533
+ return a === ((o = this.network) == null ? void 0 : o.id);
534
+ });
535
+ return t || !i;
536
+ }
537
+ getPadding() {
538
+ return this.heading ? ["l", "2l", "l", "2l"] : ["0", "2l", "0", "2l"];
539
+ }
540
+ onViewChange() {
541
+ const { history: e } = c.state;
542
+ let t = j.VIEW_DIRECTION.Next;
543
+ e.length < this.prevHistoryLength && (t = j.VIEW_DIRECTION.Prev), this.prevHistoryLength = e.length, this.viewDirection = t;
544
+ }
545
+ async onHistoryChange() {
546
+ var i;
547
+ const { history: e } = c.state, t = (i = this.shadowRoot) == null ? void 0 : i.querySelector("#dynamic");
548
+ e.length > 1 && !this.showBack && t ? (await t.animate([{ opacity: 1 }, { opacity: 0 }], {
549
+ duration: 200,
550
+ fill: "forwards",
551
+ easing: "ease"
552
+ }).finished, this.showBack = !0, t.animate([{ opacity: 0 }, { opacity: 1 }], {
553
+ duration: 200,
554
+ fill: "forwards",
555
+ easing: "ease"
556
+ })) : e.length <= 1 && this.showBack && t && (await t.animate([{ opacity: 1 }, { opacity: 0 }], {
557
+ duration: 200,
558
+ fill: "forwards",
559
+ easing: "ease"
560
+ }).finished, this.showBack = !1, t.animate([{ opacity: 0 }, { opacity: 1 }], {
561
+ duration: 200,
562
+ fill: "forwards",
563
+ easing: "ease"
564
+ }));
565
+ }
566
+ onGoBack() {
567
+ c.goBack();
568
+ }
569
+ };
570
+ h.styles = ye;
571
+ g([
572
+ d()
573
+ ], h.prototype, "heading", void 0);
574
+ g([
575
+ d()
576
+ ], h.prototype, "network", void 0);
577
+ g([
578
+ d()
579
+ ], h.prototype, "networkImage", void 0);
580
+ g([
581
+ d()
582
+ ], h.prototype, "showBack", void 0);
583
+ g([
584
+ d()
585
+ ], h.prototype, "prevHistoryLength", void 0);
586
+ g([
587
+ d()
588
+ ], h.prototype, "view", void 0);
589
+ g([
590
+ d()
591
+ ], h.prototype, "viewDirection", void 0);
592
+ g([
593
+ d()
594
+ ], h.prototype, "headerText", void 0);
595
+ h = g([
596
+ f("w3m-header")
597
+ ], h);
598
+ const xe = v`
599
+ :host {
600
+ display: flex;
601
+ column-gap: var(--wui-spacing-s);
602
+ align-items: center;
603
+ padding: var(--wui-spacing-xs) var(--wui-spacing-m) var(--wui-spacing-xs) var(--wui-spacing-xs);
604
+ border-radius: var(--wui-border-radius-s);
605
+ border: 1px solid var(--wui-color-gray-glass-005);
606
+ box-sizing: border-box;
607
+ background-color: var(--wui-color-bg-175);
608
+ box-shadow:
609
+ 0px 14px 64px -4px rgba(0, 0, 0, 0.15),
610
+ 0px 8px 22px -6px rgba(0, 0, 0, 0.15);
611
+
612
+ max-width: 300px;
613
+ }
614
+
615
+ :host wui-loading-spinner {
616
+ margin-left: var(--wui-spacing-3xs);
617
+ }
618
+ `;
619
+ var S = function(s, e, t, i) {
620
+ var a = arguments.length, o = a < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
621
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(s, e, t, i);
622
+ else for (var r = s.length - 1; r >= 0; r--) (n = s[r]) && (o = (a < 3 ? n(o) : a > 3 ? n(e, t, o) : n(e, t)) || o);
623
+ return a > 3 && o && Object.defineProperty(e, t, o), o;
624
+ };
625
+ let m = class extends y {
626
+ constructor() {
627
+ super(...arguments), this.backgroundColor = "accent-100", this.iconColor = "accent-100", this.icon = "checkmark", this.message = "", this.loading = !1, this.iconType = "default";
628
+ }
629
+ render() {
630
+ return l`
631
+ ${this.templateIcon()}
632
+ <wui-text variant="paragraph-500" color="fg-100" data-testid="wui-snackbar-message"
633
+ >${this.message}</wui-text
634
+ >
635
+ `;
636
+ }
637
+ templateIcon() {
638
+ return this.loading ? l`<wui-loading-spinner size="md" color="accent-100"></wui-loading-spinner>` : this.iconType === "default" ? l`<wui-icon size="xl" color=${this.iconColor} name=${this.icon}></wui-icon>` : l`<wui-icon-box
639
+ size="sm"
640
+ iconSize="xs"
641
+ iconColor=${this.iconColor}
642
+ backgroundColor=${this.backgroundColor}
643
+ icon=${this.icon}
644
+ background="opaque"
645
+ ></wui-icon-box>`;
646
+ }
647
+ };
648
+ m.styles = [L, xe];
649
+ S([
650
+ u()
651
+ ], m.prototype, "backgroundColor", void 0);
652
+ S([
653
+ u()
654
+ ], m.prototype, "iconColor", void 0);
655
+ S([
656
+ u()
657
+ ], m.prototype, "icon", void 0);
658
+ S([
659
+ u()
660
+ ], m.prototype, "message", void 0);
661
+ S([
662
+ u()
663
+ ], m.prototype, "loading", void 0);
664
+ S([
665
+ u()
666
+ ], m.prototype, "iconType", void 0);
667
+ m = S([
668
+ f("wui-snackbar")
669
+ ], m);
670
+ const ke = v`
671
+ :host {
672
+ display: block;
673
+ position: absolute;
674
+ opacity: 0;
675
+ pointer-events: none;
676
+ top: 11px;
677
+ left: 50%;
678
+ width: max-content;
679
+ }
680
+ `;
681
+ var ie = function(s, e, t, i) {
682
+ var a = arguments.length, o = a < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
683
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(s, e, t, i);
684
+ else for (var r = s.length - 1; r >= 0; r--) (n = s[r]) && (o = (a < 3 ? n(o) : a > 3 ? n(e, t, o) : n(e, t)) || o);
685
+ return a > 3 && o && Object.defineProperty(e, t, o), o;
686
+ };
687
+ const Se = {
688
+ loading: void 0,
689
+ success: {
690
+ backgroundColor: "success-100",
691
+ iconColor: "success-100",
692
+ icon: "checkmark"
693
+ },
694
+ error: {
695
+ backgroundColor: "error-100",
696
+ iconColor: "error-100",
697
+ icon: "close"
698
+ }
699
+ };
700
+ let D = class extends y {
701
+ constructor() {
702
+ super(), this.unsubscribe = [], this.timeout = void 0, this.open = A.state.open, this.unsubscribe.push(A.subscribeKey("open", (e) => {
703
+ this.open = e, this.onOpen();
704
+ }));
705
+ }
706
+ disconnectedCallback() {
707
+ clearTimeout(this.timeout), this.unsubscribe.forEach((e) => e());
708
+ }
709
+ render() {
710
+ const { message: e, variant: t, svg: i } = A.state, a = Se[t], { icon: o, iconColor: n } = i ?? a ?? {};
711
+ return l`
712
+ <wui-snackbar
713
+ message=${e}
714
+ backgroundColor=${a == null ? void 0 : a.backgroundColor}
715
+ iconColor=${n}
716
+ icon=${o}
717
+ .loading=${t === "loading"}
718
+ ></wui-snackbar>
719
+ `;
720
+ }
721
+ onOpen() {
722
+ clearTimeout(this.timeout), this.open ? (this.animate([
723
+ { opacity: 0, transform: "translateX(-50%) scale(0.85)" },
724
+ { opacity: 1, transform: "translateX(-50%) scale(1)" }
725
+ ], {
726
+ duration: 150,
727
+ fill: "forwards",
728
+ easing: "ease"
729
+ }), this.timeout && clearTimeout(this.timeout), A.state.autoClose && (this.timeout = setTimeout(() => A.hide(), 2500))) : this.animate([
730
+ { opacity: 1, transform: "translateX(-50%) scale(1)" },
731
+ { opacity: 0, transform: "translateX(-50%) scale(0.85)" }
732
+ ], {
733
+ duration: 150,
734
+ fill: "forwards",
735
+ easing: "ease"
736
+ });
737
+ }
738
+ };
739
+ D.styles = ke;
740
+ ie([
741
+ d()
742
+ ], D.prototype, "open", void 0);
743
+ D = ie([
744
+ f("w3m-snackbar")
745
+ ], D);
746
+ const Ae = v`
747
+ :host {
748
+ z-index: var(--w3m-z-index);
749
+ display: block;
750
+ backface-visibility: hidden;
751
+ will-change: opacity;
752
+ position: fixed;
753
+ top: 0;
754
+ left: 0;
755
+ right: 0;
756
+ bottom: 0;
757
+ pointer-events: none;
758
+ opacity: 0;
759
+ background-color: var(--wui-cover);
760
+ transition: opacity 0.2s var(--wui-ease-out-power-2);
761
+ will-change: opacity;
762
+ }
763
+
764
+ :host(.open) {
765
+ opacity: 1;
766
+ }
767
+
768
+ :host(.appkit-modal) {
769
+ position: relative;
770
+ pointer-events: unset;
771
+ background: none;
772
+ width: 100%;
773
+ opacity: 1;
774
+ }
775
+
776
+ wui-card {
777
+ max-width: var(--w3m-modal-width);
778
+ width: 100%;
779
+ position: relative;
780
+ animation: zoom-in 0.2s var(--wui-ease-out-power-2);
781
+ animation-fill-mode: backwards;
782
+ outline: none;
783
+ transition:
784
+ border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1),
785
+ background-color var(--wui-duration-lg) var(--wui-ease-out-power-1);
786
+ will-change: border-radius, background-color;
787
+ }
788
+
789
+ :host(.appkit-modal) wui-card {
790
+ max-width: 400px;
791
+ }
792
+
793
+ wui-card[shake='true'] {
794
+ animation:
795
+ zoom-in 0.2s var(--wui-ease-out-power-2),
796
+ w3m-shake 0.5s var(--wui-ease-out-power-2);
797
+ }
798
+
799
+ wui-flex {
800
+ overflow-x: hidden;
801
+ overflow-y: auto;
802
+ display: flex;
803
+ align-items: center;
804
+ justify-content: center;
805
+ width: 100%;
806
+ height: 100%;
807
+ }
808
+
809
+ @media (max-height: 700px) and (min-width: 431px) {
810
+ wui-flex {
811
+ align-items: flex-start;
812
+ }
813
+
814
+ wui-card {
815
+ margin: var(--wui-spacing-xxl) 0px;
816
+ }
817
+ }
818
+
819
+ @media (max-width: 430px) {
820
+ wui-flex {
821
+ align-items: flex-end;
822
+ }
823
+
824
+ wui-card {
825
+ max-width: 100%;
826
+ border-bottom-left-radius: var(--local-border-bottom-mobile-radius);
827
+ border-bottom-right-radius: var(--local-border-bottom-mobile-radius);
828
+ border-bottom: none;
829
+ animation: slide-in 0.2s var(--wui-ease-out-power-2);
830
+ }
831
+
832
+ wui-card[shake='true'] {
833
+ animation:
834
+ slide-in 0.2s var(--wui-ease-out-power-2),
835
+ w3m-shake 0.5s var(--wui-ease-out-power-2);
836
+ }
837
+ }
838
+
839
+ @keyframes zoom-in {
840
+ 0% {
841
+ transform: scale(0.95) translateY(0);
842
+ }
843
+ 100% {
844
+ transform: scale(1) translateY(0);
845
+ }
846
+ }
847
+
848
+ @keyframes slide-in {
849
+ 0% {
850
+ transform: scale(1) translateY(50px);
851
+ }
852
+ 100% {
853
+ transform: scale(1) translateY(0);
854
+ }
855
+ }
856
+
857
+ @keyframes w3m-shake {
858
+ 0% {
859
+ transform: scale(1) rotate(0deg);
860
+ }
861
+ 20% {
862
+ transform: scale(1) rotate(-1deg);
863
+ }
864
+ 40% {
865
+ transform: scale(1) rotate(1.5deg);
866
+ }
867
+ 60% {
868
+ transform: scale(1) rotate(-1.5deg);
869
+ }
870
+ 80% {
871
+ transform: scale(1) rotate(1deg);
872
+ }
873
+ 100% {
874
+ transform: scale(1) rotate(0deg);
875
+ }
876
+ }
877
+
878
+ @keyframes w3m-view-height {
879
+ from {
880
+ height: var(--prev-height);
881
+ }
882
+ to {
883
+ height: var(--new-height);
884
+ }
885
+ }
886
+ `;
887
+ var C = function(s, e, t, i) {
888
+ var a = arguments.length, o = a < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
889
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(s, e, t, i);
890
+ else for (var r = s.length - 1; r >= 0; r--) (n = s[r]) && (o = (a < 3 ? n(o) : a > 3 ? n(e, t, o) : n(e, t)) || o);
891
+ return a > 3 && o && Object.defineProperty(e, t, o), o;
892
+ };
893
+ const F = "scroll-lock";
894
+ class b extends y {
895
+ constructor() {
896
+ super(), this.unsubscribe = [], this.abortController = void 0, this.hasPrefetched = !1, this.enableEmbedded = $.state.enableEmbedded, this.open = w.state.open, this.caipAddress = p.state.activeCaipAddress, this.caipNetwork = p.state.activeCaipNetwork, this.shake = w.state.shake, this.filterByNamespace = z.state.filterByNamespace, this.initializeTheming(), R.prefetchAnalyticsConfig(), this.unsubscribe.push(w.subscribeKey("open", (e) => e ? this.onOpen() : this.onClose()), w.subscribeKey("shake", (e) => this.shake = e), p.subscribeKey("activeCaipNetwork", (e) => this.onNewNetwork(e)), p.subscribeKey("activeCaipAddress", (e) => this.onNewAddress(e)), $.subscribeKey("enableEmbedded", (e) => this.enableEmbedded = e), z.subscribeKey("filterByNamespace", (e) => {
897
+ var t;
898
+ this.filterByNamespace !== e && !((t = p.getAccountData(e)) != null && t.caipAddress) && (R.fetchRecommendedWallets(), this.filterByNamespace = e);
899
+ }));
900
+ }
901
+ firstUpdated() {
902
+ if (this.caipAddress) {
903
+ if (this.enableEmbedded) {
904
+ w.close(), this.prefetch();
905
+ return;
906
+ }
907
+ this.onNewAddress(this.caipAddress);
908
+ }
909
+ this.open && this.onOpen(), this.enableEmbedded && this.prefetch();
910
+ }
911
+ disconnectedCallback() {
912
+ this.unsubscribe.forEach((e) => e()), this.onRemoveKeyboardListener();
913
+ }
914
+ render() {
915
+ return this.style.cssText = `
916
+ --local-border-bottom-mobile-radius: ${this.enableEmbedded ? "clamp(0px, var(--wui-border-radius-l), 44px)" : "0px"};
917
+ `, this.enableEmbedded ? l`${this.contentTemplate()}
918
+ <w3m-tooltip></w3m-tooltip> ` : this.open ? l`
919
+ <wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
920
+ ${this.contentTemplate()}
921
+ </wui-flex>
922
+ <w3m-tooltip></w3m-tooltip>
923
+ ` : null;
924
+ }
925
+ contentTemplate() {
926
+ return l` <wui-card
927
+ shake="${this.shake}"
928
+ data-embedded="${H(this.enableEmbedded)}"
929
+ role="alertdialog"
930
+ aria-modal="true"
931
+ tabindex="0"
932
+ data-testid="w3m-modal-card"
933
+ >
934
+ <w3m-header></w3m-header>
935
+ <w3m-router></w3m-router>
936
+ <w3m-snackbar></w3m-snackbar>
937
+ <w3m-alertbar></w3m-alertbar>
938
+ </wui-card>`;
939
+ }
940
+ async onOverlayClick(e) {
941
+ e.target === e.currentTarget && await this.handleClose();
942
+ }
943
+ async handleClose() {
944
+ await ee.safeClose();
945
+ }
946
+ initializeTheming() {
947
+ const { themeVariables: e, themeMode: t } = le.state, i = he.getColorTheme(t);
948
+ de(e, i);
949
+ }
950
+ onClose() {
951
+ this.open = !1, this.classList.remove("open"), this.onScrollUnlock(), A.hide(), this.onRemoveKeyboardListener();
952
+ }
953
+ onOpen() {
954
+ this.open = !0, this.classList.add("open"), this.onScrollLock(), this.onAddKeyboardListener();
955
+ }
956
+ onScrollLock() {
957
+ const e = document.createElement("style");
958
+ e.dataset.w3m = F, e.textContent = `
959
+ body {
960
+ touch-action: none;
961
+ overflow: hidden;
962
+ overscroll-behavior: contain;
963
+ }
964
+ w3m-modal {
965
+ pointer-events: auto;
966
+ }
967
+ `, document.head.appendChild(e);
968
+ }
969
+ onScrollUnlock() {
970
+ const e = document.head.querySelector(`style[data-w3m="${F}"]`);
971
+ e && e.remove();
972
+ }
973
+ onAddKeyboardListener() {
974
+ var t;
975
+ this.abortController = new AbortController();
976
+ const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector("wui-card");
977
+ e == null || e.focus(), window.addEventListener("keydown", (i) => {
978
+ if (i.key === "Escape")
979
+ this.handleClose();
980
+ else if (i.key === "Tab") {
981
+ const { tagName: a } = i.target;
982
+ a && !a.includes("W3M-") && !a.includes("WUI-") && (e == null || e.focus());
983
+ }
984
+ }, this.abortController);
985
+ }
986
+ onRemoveKeyboardListener() {
987
+ var e;
988
+ (e = this.abortController) == null || e.abort(), this.abortController = void 0;
989
+ }
990
+ async onNewAddress(e) {
991
+ const t = p.state.isSwitchingNamespace, i = ue.getPlainAddress(e);
992
+ !i && !t ? w.close() : t && i && c.goBack(), await Z.initializeIfEnabled(), this.caipAddress = e, p.setIsSwitchingNamespace(!1);
993
+ }
994
+ onNewNetwork(e) {
995
+ var Y, V, X;
996
+ const t = this.caipNetwork, i = (Y = t == null ? void 0 : t.caipNetworkId) == null ? void 0 : Y.toString(), a = t == null ? void 0 : t.chainNamespace, o = (V = e == null ? void 0 : e.caipNetworkId) == null ? void 0 : V.toString(), n = e == null ? void 0 : e.chainNamespace, r = i !== o, x = r && !(a !== n), T = (t == null ? void 0 : t.name) === pe.UNSUPPORTED_NETWORK_NAME, E = c.state.view === "ConnectingExternal", I = !((X = p.getAccountData(e == null ? void 0 : e.chainNamespace)) != null && X.caipAddress), ae = c.state.view === "UnsupportedChain", ne = w.state.open;
997
+ let O = !1;
998
+ ne && !E && (I ? r && (O = !0) : (ae || x && !T) && (O = !0)), O && c.state.view !== "SIWXSignMessage" && c.goBack(), this.caipNetwork = e;
999
+ }
1000
+ prefetch() {
1001
+ this.hasPrefetched || (R.prefetch(), R.fetchWalletsByPage({ page: 1 }), this.hasPrefetched = !0);
1002
+ }
1003
+ }
1004
+ b.styles = Ae;
1005
+ C([
1006
+ u({ type: Boolean })
1007
+ ], b.prototype, "enableEmbedded", void 0);
1008
+ C([
1009
+ d()
1010
+ ], b.prototype, "open", void 0);
1011
+ C([
1012
+ d()
1013
+ ], b.prototype, "caipAddress", void 0);
1014
+ C([
1015
+ d()
1016
+ ], b.prototype, "caipNetwork", void 0);
1017
+ C([
1018
+ d()
1019
+ ], b.prototype, "shake", void 0);
1020
+ C([
1021
+ d()
1022
+ ], b.prototype, "filterByNamespace", void 0);
1023
+ let J = class extends b {
1024
+ };
1025
+ J = C([
1026
+ f("w3m-modal")
1027
+ ], J);
1028
+ let Q = class extends b {
1029
+ };
1030
+ Q = C([
1031
+ f("appkit-modal")
1032
+ ], Q);
1033
+ export {
1034
+ Q as AppKitModal,
1035
+ J as W3mModal,
1036
+ b as W3mModalBase
1037
+ };