@dcl/governance-site 2.0.0 → 2.0.1-20995780683.commit-d6baf5e
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.
- package/assets/BlockOverrides-9837a6f9.js +5 -0
- package/assets/ConstantsUtil-298f7898.js +1 -0
- package/assets/ExchangeController-d2354ec6.js +1 -0
- package/assets/HelpersUtil-8cddb046.js +62 -0
- package/assets/MathUtil-b514a570.js +1 -0
- package/assets/NavigationUtil-a0d0ce87.js +1 -0
- package/assets/NetworkUtil-220ea128.js +1 -0
- package/assets/PhWallet-fd2006d2.js +14 -0
- package/assets/{features-b72c9430.js → ReownAuthentication-468828df.js} +4 -4
- package/assets/SwapController-7bfd6ce7.js +1 -0
- package/assets/{UserAvatar-78751cb5.js → UserAvatar-456716f1.js} +1 -1
- package/assets/ccip-ddcec720.js +1 -0
- package/assets/data-capture-3e424a2c.js +242 -0
- package/assets/email-ea617f9c.js +90 -0
- package/assets/embedded-wallet-814bf005.js +410 -0
- package/assets/features-fd521597.js +1 -0
- package/assets/fortmatic-f3cb4aa6.js +13 -0
- package/assets/if-defined-0a35f675.js +5 -0
- package/assets/index-034d22a0.js +138 -0
- package/assets/{index-a8255d1c.css → index-05771666.css} +4 -4
- package/assets/index-07a61b45.js +51 -0
- package/assets/index-1039ded0.js +132 -0
- package/assets/index-123c1362.js +224 -0
- package/assets/index-15bbaaa0.js +7 -0
- package/assets/{index-073512a1.js → index-206e3e77.js} +1 -1
- package/assets/index-27a991e4.js +53 -0
- package/assets/index-2d0efdd2.js +210 -0
- package/assets/index-32d53c87.js +189 -0
- package/assets/index-3b861a37.js +102 -0
- package/assets/index-4207595b.js +100 -0
- package/assets/index-4243d275.js +43 -0
- package/assets/index-42ce7246.js +63 -0
- package/assets/index-47e87339.js +152 -0
- package/assets/index-48bd3fca.js +277 -0
- package/assets/index-49cc5044.js +46 -0
- package/assets/index-5788a0d6.js +468 -0
- package/assets/index-5824c226.js +81 -0
- package/assets/index-5da565ce.js +78 -0
- package/assets/index-685e7949.js +425 -0
- package/assets/index-84e8ecf6.js +647 -0
- package/assets/index-965fdf98.js +3425 -0
- package/assets/index-9d970383.js +152 -0
- package/assets/index-a59b6662.js +68 -0
- package/assets/index-b457d047.js +1062 -0
- package/assets/index-b65e06cc.js +27 -0
- package/assets/{index-2ef9f1d1.js → index-d70e4ab8.js} +66 -66
- package/assets/index-d7a6ceea.js +30 -0
- package/assets/index-d9c55c27.js +77 -0
- package/assets/index-db5b7889.js +77 -0
- package/assets/index-e3222791.js +78 -0
- package/assets/index-eb060c20.js +1 -0
- package/assets/index-f3f03959.js +90 -0
- package/assets/index-fcda68c9.js +19 -0
- package/assets/index-ff4dea43.js +85 -0
- package/assets/networks-14f3c0d2.js +1 -0
- package/assets/onramp-dcdb1a34.js +422 -0
- package/assets/pay-with-exchange-a64f18a3.js +280 -0
- package/assets/receive-ca7bc867.js +131 -0
- package/assets/ref-88e1be05.js +13 -0
- package/assets/send-8739c9fb.js +554 -0
- package/assets/socials-ccc593f5.js +250 -0
- package/assets/swaps-0a90eb06.js +1050 -0
- package/assets/transactions-bb8cb277.js +16 -0
- package/assets/{tslib.es6-82b9ba96.js → tslib.es6-db2ec995.js} +2 -2
- package/assets/w3m-modal-869dafbc.js +891 -0
- package/assets/zoraTestnet-adc7b76b.js +36 -0
- package/index.html +4 -4
- package/package.json +3 -3
- package/assets/basic-ca749c4c.js +0 -1435
- package/assets/core-806d78ea.js +0 -249
- package/assets/fortmatic-12e0f2e5.js +0 -13
- package/assets/index-372705ba.js +0 -1321
- package/assets/index-4be588a0.js +0 -94
- package/assets/index-74e34dfb.js +0 -39
- package/assets/index-bbb36593.js +0 -7
- package/assets/index-c1c8440f.js +0 -47
- package/assets/w3m-modal-26eff9d9.js +0 -1209
|
@@ -0,0 +1,3425 @@
|
|
|
1
|
+
import{j as v,r as I,k as W,l as m,m as l,O as f,C as u,$ as Te,H as T,h as y,M as P,n as ee,E as C,J as fe,o as b,R as h,c as D,S as k,x,y as ze,W as Fe,af as Xt,ag as he,aa as J,a6 as Hi,G as A,ah as tt,u as Ai,Q as Ki,P as qi,L as Gi,T as mt,a0 as Yt,a1 as Qt,ai as Xi,a3 as Bt,aj as Yi}from"./index-48bd3fca.js";import{n as c,c as p,U as F,r as d,b as Ii}from"./index-84e8ecf6.js";import{o as w}from"./if-defined-0a35f675.js";import"./index-42ce7246.js";import"./index-07a61b45.js";import"./index-49cc5044.js";import"./index-ff4dea43.js";import{a as Ta,W as Sa}from"./index-2d0efdd2.js";import"./index-d9c55c27.js";import"./index-db5b7889.js";import"./index-47e87339.js";import{C as S}from"./NetworkUtil-220ea128.js";import{H as Jt}from"./HelpersUtil-8cddb046.js";import{n as Qi}from"./index-123c1362.js";import{E as Q}from"./ExchangeController-d2354ec6.js";import"./index-685e7949.js";import"./index-e3222791.js";import"./index-4207595b.js";import{M as ft}from"./MathUtil-b514a570.js";import"./index-b65e06cc.js";import{e as Zt,n as ei}from"./ref-88e1be05.js";import"./index-9d970383.js";import"./index-d7a6ceea.js";import"./index-5824c226.js";import"./index-fcda68c9.js";import{O as bt}from"./index-32d53c87.js";import{e as Ji}from"./index-27a991e4.js";import"./index-a59b6662.js";import"./index-3b861a37.js";import{N as Zi}from"./NavigationUtil-a0d0ce87.js";import"./index-5788a0d6.js";import"./index-d70e4ab8.js";import"./BlockOverrides-9837a6f9.js";import"./index-4243d275.js";import"./ConstantsUtil-298f7898.js";const en=v`
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
button {
|
|
7
|
+
border-radius: ${({borderRadius:t})=>t[20]};
|
|
8
|
+
background: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
9
|
+
display: flex;
|
|
10
|
+
gap: ${({spacing:t})=>t[1]};
|
|
11
|
+
padding: ${({spacing:t})=>t[1]};
|
|
12
|
+
color: ${({tokens:t})=>t.theme.textSecondary};
|
|
13
|
+
border-radius: ${({borderRadius:t})=>t[16]};
|
|
14
|
+
height: 32px;
|
|
15
|
+
transition: box-shadow ${({durations:t})=>t.lg}
|
|
16
|
+
${({easings:t})=>t["ease-out-power-2"]};
|
|
17
|
+
will-change: box-shadow;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
button wui-flex.avatar-container {
|
|
21
|
+
width: 28px;
|
|
22
|
+
height: 24px;
|
|
23
|
+
position: relative;
|
|
24
|
+
|
|
25
|
+
wui-flex.network-image-container {
|
|
26
|
+
position: absolute;
|
|
27
|
+
bottom: 0px;
|
|
28
|
+
right: 0px;
|
|
29
|
+
width: 12px;
|
|
30
|
+
height: 12px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
wui-flex.network-image-container wui-icon {
|
|
34
|
+
background: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
wui-avatar {
|
|
38
|
+
width: 24px;
|
|
39
|
+
min-width: 24px;
|
|
40
|
+
height: 24px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
wui-icon {
|
|
44
|
+
width: 12px;
|
|
45
|
+
height: 12px;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
wui-image,
|
|
50
|
+
wui-icon {
|
|
51
|
+
border-radius: ${({borderRadius:t})=>t[16]};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
wui-text {
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
button wui-flex.balance-container {
|
|
59
|
+
height: 100%;
|
|
60
|
+
border-radius: ${({borderRadius:t})=>t[16]};
|
|
61
|
+
padding-left: ${({spacing:t})=>t[1]};
|
|
62
|
+
padding-right: ${({spacing:t})=>t[1]};
|
|
63
|
+
background: ${({tokens:t})=>t.theme.foregroundSecondary};
|
|
64
|
+
color: ${({tokens:t})=>t.theme.textPrimary};
|
|
65
|
+
transition: background-color ${({durations:t})=>t.lg}
|
|
66
|
+
${({easings:t})=>t["ease-out-power-2"]};
|
|
67
|
+
will-change: background-color;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* -- Hover & Active states ----------------------------------------------------------- */
|
|
71
|
+
button:hover:enabled,
|
|
72
|
+
button:focus-visible:enabled,
|
|
73
|
+
button:active:enabled {
|
|
74
|
+
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.2);
|
|
75
|
+
|
|
76
|
+
wui-flex.balance-container {
|
|
77
|
+
background: ${({tokens:t})=>t.theme.foregroundTertiary};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* -- Disabled states --------------------------------------------------- */
|
|
82
|
+
button:disabled wui-text,
|
|
83
|
+
button:disabled wui-flex.avatar-container {
|
|
84
|
+
opacity: 0.3;
|
|
85
|
+
}
|
|
86
|
+
`;var se=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let q=class extends m{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.balance=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.loading=!1,this.address="",this.profileName="",this.charsStart=4,this.charsEnd=6}render(){return l`
|
|
87
|
+
<button
|
|
88
|
+
?disabled=${this.disabled}
|
|
89
|
+
class=${w(this.balance?void 0:"local-no-balance")}
|
|
90
|
+
data-error=${w(this.isUnsupportedChain)}
|
|
91
|
+
>
|
|
92
|
+
${this.imageTemplate()} ${this.addressTemplate()} ${this.balanceTemplate()}
|
|
93
|
+
</button>
|
|
94
|
+
`}imageTemplate(){const e=this.networkSrc?l`<wui-image src=${this.networkSrc}></wui-image>`:l` <wui-icon size="inherit" color="inherit" name="networkPlaceholder"></wui-icon> `;return l`<wui-flex class="avatar-container">
|
|
95
|
+
<wui-avatar
|
|
96
|
+
.imageSrc=${this.avatarSrc}
|
|
97
|
+
alt=${this.address}
|
|
98
|
+
address=${this.address}
|
|
99
|
+
></wui-avatar>
|
|
100
|
+
|
|
101
|
+
<wui-flex class="network-image-container">${e}</wui-flex>
|
|
102
|
+
</wui-flex>`}addressTemplate(){return l`<wui-text variant="md-regular" color="inherit">
|
|
103
|
+
${this.address?F.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"}):null}
|
|
104
|
+
</wui-text>`}balanceTemplate(){if(this.balance){const e=this.loading?l`<wui-loading-spinner size="md" color="inherit"></wui-loading-spinner>`:l`<wui-text variant="md-regular" color="inherit"> ${this.balance}</wui-text>`;return l`<wui-flex alignItems="center" justifyContent="center" class="balance-container"
|
|
105
|
+
>${e}</wui-flex
|
|
106
|
+
>`}return null}};q.styles=[I,W,en];se([c()],q.prototype,"networkSrc",void 0);se([c()],q.prototype,"avatarSrc",void 0);se([c()],q.prototype,"balance",void 0);se([c({type:Boolean})],q.prototype,"isUnsupportedChain",void 0);se([c({type:Boolean})],q.prototype,"disabled",void 0);se([c({type:Boolean})],q.prototype,"loading",void 0);se([c()],q.prototype,"address",void 0);se([c()],q.prototype,"profileName",void 0);se([c()],q.prototype,"charsStart",void 0);se([c()],q.prototype,"charsEnd",void 0);q=se([p("wui-account-button")],q);var U=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};class z extends m{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.namespace=void 0,this.isSupported=f.state.allowUnsupportedChain?!0:u.state.activeChain?u.checkIfSupportedNetwork(u.state.activeChain):!0}connectedCallback(){super.connectedCallback(),this.setAccountData(u.getAccountData(this.namespace)),this.setNetworkData(u.getNetworkData(this.namespace))}firstUpdated(){const e=this.namespace;e?this.unsubscribe.push(u.subscribeChainProp("accountState",i=>{this.setAccountData(i)},e),u.subscribeChainProp("networkState",i=>{var o;this.setNetworkData(i),this.isSupported=u.checkIfSupportedNetwork(e,(o=i==null?void 0:i.caipNetwork)==null?void 0:o.caipNetworkId)},e)):this.unsubscribe.push(Te.subscribeNetworkImages(()=>{this.networkImage=T.getNetworkImage(this.network)}),u.subscribeKey("activeCaipAddress",i=>{this.caipAddress=i}),u.subscribeChainProp("accountState",i=>{this.setAccountData(i)}),u.subscribeKey("activeCaipNetwork",i=>{this.network=i,this.networkImage=T.getNetworkImage(i),this.isSupported=i!=null&&i.chainNamespace?u.checkIfSupportedNetwork(i==null?void 0:i.chainNamespace):!0,this.fetchNetworkImage(i)}))}updated(){this.fetchNetworkImage(this.network)}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!u.state.activeChain)return null;const e=this.balance==="show",i=typeof this.balanceVal!="string",{formattedText:o}=y.parseBalance(this.balanceVal,this.balanceSymbol);return l`
|
|
107
|
+
<wui-account-button
|
|
108
|
+
.disabled=${!!this.disabled}
|
|
109
|
+
.isUnsupportedChain=${f.state.allowUnsupportedChain?!1:!this.isSupported}
|
|
110
|
+
address=${w(y.getPlainAddress(this.caipAddress))}
|
|
111
|
+
profileName=${w(this.profileName)}
|
|
112
|
+
networkSrc=${w(this.networkImage)}
|
|
113
|
+
avatarSrc=${w(this.profileImage)}
|
|
114
|
+
balance=${e?o:""}
|
|
115
|
+
@click=${this.onClick.bind(this)}
|
|
116
|
+
data-testid=${`account-button${this.namespace?`-${this.namespace}`:""}`}
|
|
117
|
+
.charsStart=${this.charsStart}
|
|
118
|
+
.charsEnd=${this.charsEnd}
|
|
119
|
+
?loading=${i}
|
|
120
|
+
>
|
|
121
|
+
</wui-account-button>
|
|
122
|
+
`}onClick(){this.isSupported||f.state.allowUnsupportedChain?P.open({namespace:this.namespace}):P.open({view:"UnsupportedChain"})}async fetchNetworkImage(e){var i,o;(i=e==null?void 0:e.assets)!=null&&i.imageId&&(this.networkImage=await T.fetchNetworkImage((o=e==null?void 0:e.assets)==null?void 0:o.imageId))}setAccountData(e){e&&(this.caipAddress=e.caipAddress,this.balanceVal=e.balance,this.balanceSymbol=e.balanceSymbol,this.profileName=e.profileName,this.profileImage=e.profileImage)}setNetworkData(e){e&&(this.network=e.caipNetwork,this.networkImage=T.getNetworkImage(e.caipNetwork))}}U([c({type:Boolean})],z.prototype,"disabled",void 0);U([c()],z.prototype,"balance",void 0);U([c()],z.prototype,"charsStart",void 0);U([c()],z.prototype,"charsEnd",void 0);U([c()],z.prototype,"namespace",void 0);U([d()],z.prototype,"caipAddress",void 0);U([d()],z.prototype,"balanceVal",void 0);U([d()],z.prototype,"balanceSymbol",void 0);U([d()],z.prototype,"profileName",void 0);U([d()],z.prototype,"profileImage",void 0);U([d()],z.prototype,"network",void 0);U([d()],z.prototype,"networkImage",void 0);U([d()],z.prototype,"isSupported",void 0);let ci=class extends z{};ci=U([p("w3m-account-button")],ci);let ui=class extends z{};ui=U([p("appkit-account-button")],ui);const tn=ee`
|
|
123
|
+
:host {
|
|
124
|
+
display: block;
|
|
125
|
+
width: max-content;
|
|
126
|
+
}
|
|
127
|
+
`;var ae=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};class te extends m{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance=void 0,this.size=void 0,this.label=void 0,this.loadingLabel=void 0,this.charsStart=4,this.charsEnd=6,this.namespace=void 0}firstUpdated(){var e;this.caipAddress=this.namespace?(e=u.getAccountData(this.namespace))==null?void 0:e.caipAddress:u.state.activeCaipAddress,this.namespace?this.unsubscribe.push(u.subscribeChainProp("accountState",i=>{this.caipAddress=i==null?void 0:i.caipAddress},this.namespace)):this.unsubscribe.push(u.subscribeKey("activeCaipAddress",i=>this.caipAddress=i))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.caipAddress?l`
|
|
128
|
+
<appkit-account-button
|
|
129
|
+
.disabled=${!!this.disabled}
|
|
130
|
+
balance=${w(this.balance)}
|
|
131
|
+
.charsStart=${w(this.charsStart)}
|
|
132
|
+
.charsEnd=${w(this.charsEnd)}
|
|
133
|
+
namespace=${w(this.namespace)}
|
|
134
|
+
>
|
|
135
|
+
</appkit-account-button>
|
|
136
|
+
`:l`
|
|
137
|
+
<appkit-connect-button
|
|
138
|
+
size=${w(this.size)}
|
|
139
|
+
label=${w(this.label)}
|
|
140
|
+
loadingLabel=${w(this.loadingLabel)}
|
|
141
|
+
namespace=${w(this.namespace)}
|
|
142
|
+
></appkit-connect-button>
|
|
143
|
+
`}}te.styles=tn;ae([c({type:Boolean})],te.prototype,"disabled",void 0);ae([c()],te.prototype,"balance",void 0);ae([c()],te.prototype,"size",void 0);ae([c()],te.prototype,"label",void 0);ae([c()],te.prototype,"loadingLabel",void 0);ae([c()],te.prototype,"charsStart",void 0);ae([c()],te.prototype,"charsEnd",void 0);ae([c()],te.prototype,"namespace",void 0);ae([d()],te.prototype,"caipAddress",void 0);let di=class extends te{};di=ae([p("w3m-button")],di);let hi=class extends te{};hi=ae([p("appkit-button")],hi);const nn=v`
|
|
144
|
+
:host {
|
|
145
|
+
position: relative;
|
|
146
|
+
display: block;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
button {
|
|
150
|
+
border-radius: ${({borderRadius:t})=>t[2]};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
button[data-size='sm'] {
|
|
154
|
+
padding: ${({spacing:t})=>t[2]};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
button[data-size='md'] {
|
|
158
|
+
padding: ${({spacing:t})=>t[3]};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
button[data-size='lg'] {
|
|
162
|
+
padding: ${({spacing:t})=>t[4]};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
button[data-variant='primary'] {
|
|
166
|
+
background: ${({tokens:t})=>t.core.backgroundAccentPrimary};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
button[data-variant='secondary'] {
|
|
170
|
+
background: ${({tokens:t})=>t.core.foregroundAccent010};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
button:hover:enabled {
|
|
174
|
+
border-radius: ${({borderRadius:t})=>t[3]};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
button:disabled {
|
|
178
|
+
cursor: not-allowed;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
button[data-loading='true'] {
|
|
182
|
+
cursor: not-allowed;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
button[data-loading='true'][data-size='sm'] {
|
|
186
|
+
border-radius: ${({borderRadius:t})=>t[32]};
|
|
187
|
+
padding: ${({spacing:t})=>t[2]} ${({spacing:t})=>t[3]};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
button[data-loading='true'][data-size='md'] {
|
|
191
|
+
border-radius: ${({borderRadius:t})=>t[20]};
|
|
192
|
+
padding: ${({spacing:t})=>t[3]} ${({spacing:t})=>t[4]};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
button[data-loading='true'][data-size='lg'] {
|
|
196
|
+
border-radius: ${({borderRadius:t})=>t[16]};
|
|
197
|
+
padding: ${({spacing:t})=>t[4]} ${({spacing:t})=>t[5]};
|
|
198
|
+
}
|
|
199
|
+
`;var at=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Se=class extends m{constructor(){super(...arguments),this.size="md",this.variant="primary",this.loading=!1,this.text="Connect Wallet"}render(){return l`
|
|
200
|
+
<button
|
|
201
|
+
data-loading=${this.loading}
|
|
202
|
+
data-variant=${this.variant}
|
|
203
|
+
data-size=${this.size}
|
|
204
|
+
?disabled=${this.loading}
|
|
205
|
+
>
|
|
206
|
+
${this.contentTemplate()}
|
|
207
|
+
</button>
|
|
208
|
+
`}contentTemplate(){const e={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},i={primary:"invert",secondary:"accent-primary"};return this.loading?l`<wui-loading-spinner
|
|
209
|
+
color=${i[this.variant]}
|
|
210
|
+
size=${this.size}
|
|
211
|
+
></wui-loading-spinner>`:l` <wui-text variant=${e[this.size]} color=${i[this.variant]}>
|
|
212
|
+
${this.text}
|
|
213
|
+
</wui-text>`}};Se.styles=[I,W,nn];at([c()],Se.prototype,"size",void 0);at([c()],Se.prototype,"variant",void 0);at([c({type:Boolean})],Se.prototype,"loading",void 0);at([c()],Se.prototype,"text",void 0);Se=at([p("wui-connect-button")],Se);var ve=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};class $e extends m{constructor(){super(),this.unsubscribe=[],this.size="md",this.label="Connect Wallet",this.loadingLabel="Connecting...",this.open=P.state.open,this.loading=this.namespace?P.state.loadingNamespaceMap.get(this.namespace):P.state.loading,this.unsubscribe.push(P.subscribe(e=>{this.open=e.open,this.loading=this.namespace?e.loadingNamespaceMap.get(this.namespace):e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
|
|
214
|
+
<wui-connect-button
|
|
215
|
+
size=${w(this.size)}
|
|
216
|
+
.loading=${this.loading}
|
|
217
|
+
@click=${this.onClick.bind(this)}
|
|
218
|
+
data-testid=${`connect-button${this.namespace?`-${this.namespace}`:""}`}
|
|
219
|
+
>
|
|
220
|
+
${this.loading?this.loadingLabel:this.label}
|
|
221
|
+
</wui-connect-button>
|
|
222
|
+
`}onClick(){this.open?P.close():this.loading||P.open({view:"Connect",namespace:this.namespace})}}ve([c()],$e.prototype,"size",void 0);ve([c()],$e.prototype,"label",void 0);ve([c()],$e.prototype,"loadingLabel",void 0);ve([c()],$e.prototype,"namespace",void 0);ve([d()],$e.prototype,"open",void 0);ve([d()],$e.prototype,"loading",void 0);let pi=class extends $e{};pi=ve([p("w3m-connect-button")],pi);let wi=class extends $e{};wi=ve([p("appkit-connect-button")],wi);const on=v`
|
|
223
|
+
:host {
|
|
224
|
+
display: block;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
button {
|
|
228
|
+
border-radius: ${({borderRadius:t})=>t[32]};
|
|
229
|
+
display: flex;
|
|
230
|
+
gap: ${({spacing:t})=>t[1]};
|
|
231
|
+
padding: ${({spacing:t})=>t[1]} ${({spacing:t})=>t[2]}
|
|
232
|
+
${({spacing:t})=>t[1]} ${({spacing:t})=>t[1]};
|
|
233
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
button:disabled {
|
|
237
|
+
opacity: 0.5;
|
|
238
|
+
cursor: not-allowed;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
@media (hover: hover) {
|
|
242
|
+
button:hover:enabled {
|
|
243
|
+
background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
button[data-size='sm'] > wui-icon-box,
|
|
248
|
+
button[data-size='sm'] > wui-image {
|
|
249
|
+
width: 16px;
|
|
250
|
+
height: 16px;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
button[data-size='md'] > wui-icon-box,
|
|
254
|
+
button[data-size='md'] > wui-image {
|
|
255
|
+
width: 20px;
|
|
256
|
+
height: 20px;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
button[data-size='lg'] > wui-icon-box,
|
|
260
|
+
button[data-size='lg'] > wui-image {
|
|
261
|
+
width: 24px;
|
|
262
|
+
height: 24px;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
wui-image,
|
|
266
|
+
wui-icon-box {
|
|
267
|
+
border-radius: ${({borderRadius:t})=>t[32]};
|
|
268
|
+
}
|
|
269
|
+
`;var rt=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ee=class extends m{constructor(){super(...arguments),this.imageSrc=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.size="lg"}render(){const e={sm:"sm-regular",md:"md-regular",lg:"lg-regular"};return l`
|
|
270
|
+
<button data-size=${this.size} data-testid="wui-network-button" ?disabled=${this.disabled}>
|
|
271
|
+
${this.visualTemplate()}
|
|
272
|
+
<wui-text variant=${e[this.size]} color="primary">
|
|
273
|
+
<slot></slot>
|
|
274
|
+
</wui-text>
|
|
275
|
+
</button>
|
|
276
|
+
`}visualTemplate(){return this.isUnsupportedChain?l` <wui-icon-box color="error" icon="warningCircle"></wui-icon-box> `:this.imageSrc?l`<wui-image src=${this.imageSrc}></wui-image>`:l` <wui-icon size="xl" color="default" name="networkPlaceholder"></wui-icon> `}};Ee.styles=[I,W,on];rt([c()],Ee.prototype,"imageSrc",void 0);rt([c({type:Boolean})],Ee.prototype,"isUnsupportedChain",void 0);rt([c({type:Boolean})],Ee.prototype,"disabled",void 0);rt([c()],Ee.prototype,"size",void 0);Ee=rt([p("wui-network-button")],Ee);const sn=ee`
|
|
277
|
+
:host {
|
|
278
|
+
display: block;
|
|
279
|
+
width: max-content;
|
|
280
|
+
}
|
|
281
|
+
`;var me=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};class ue extends m{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.network=u.state.activeCaipNetwork,this.networkImage=T.getNetworkImage(this.network),this.caipAddress=u.state.activeCaipAddress,this.loading=P.state.loading,this.isSupported=f.state.allowUnsupportedChain?!0:u.state.activeChain?u.checkIfSupportedNetwork(u.state.activeChain):!0,this.unsubscribe.push(Te.subscribeNetworkImages(()=>{this.networkImage=T.getNetworkImage(this.network)}),u.subscribeKey("activeCaipAddress",e=>{this.caipAddress=e}),u.subscribeKey("activeCaipNetwork",e=>{var i;this.network=e,this.networkImage=T.getNetworkImage(e),this.isSupported=e!=null&&e.chainNamespace?u.checkIfSupportedNetwork(e.chainNamespace):!0,T.fetchNetworkImage((i=e==null?void 0:e.assets)==null?void 0:i.imageId)}),P.subscribeKey("loading",e=>this.loading=e))}firstUpdated(){var e,i;T.fetchNetworkImage((i=(e=this.network)==null?void 0:e.assets)==null?void 0:i.imageId)}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.network?u.checkIfSupportedNetwork(this.network.chainNamespace):!0;return l`
|
|
282
|
+
<wui-network-button
|
|
283
|
+
.disabled=${!!(this.disabled||this.loading)}
|
|
284
|
+
.isUnsupportedChain=${f.state.allowUnsupportedChain?!1:!e}
|
|
285
|
+
imageSrc=${w(this.networkImage)}
|
|
286
|
+
@click=${this.onClick.bind(this)}
|
|
287
|
+
data-testid="w3m-network-button"
|
|
288
|
+
>
|
|
289
|
+
${this.getLabel()}
|
|
290
|
+
<slot></slot>
|
|
291
|
+
</wui-network-button>
|
|
292
|
+
`}getLabel(){return this.network?!this.isSupported&&!f.state.allowUnsupportedChain?"Switch Network":this.network.name:this.label?this.label:this.caipAddress?"Unknown Network":"Select Network"}onClick(){this.loading||(C.sendEvent({type:"track",event:"CLICK_NETWORKS"}),P.open({view:"Networks"}))}}ue.styles=sn;me([c({type:Boolean})],ue.prototype,"disabled",void 0);me([c({type:String})],ue.prototype,"label",void 0);me([d()],ue.prototype,"network",void 0);me([d()],ue.prototype,"networkImage",void 0);me([d()],ue.prototype,"caipAddress",void 0);me([d()],ue.prototype,"loading",void 0);me([d()],ue.prototype,"isSupported",void 0);let mi=class extends ue{};mi=me([p("w3m-network-button")],mi);let fi=class extends ue{};fi=me([p("appkit-network-button")],fi);const an=v`
|
|
293
|
+
:host {
|
|
294
|
+
display: block;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
button {
|
|
298
|
+
width: 100%;
|
|
299
|
+
display: flex;
|
|
300
|
+
align-items: center;
|
|
301
|
+
justify-content: space-between;
|
|
302
|
+
gap: ${({spacing:t})=>t[4]};
|
|
303
|
+
padding: ${({spacing:t})=>t[3]};
|
|
304
|
+
border-radius: ${({borderRadius:t})=>t[4]};
|
|
305
|
+
background-color: ${({tokens:t})=>t.core.foregroundAccent010};
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
wui-flex > wui-icon {
|
|
309
|
+
padding: ${({spacing:t})=>t[2]};
|
|
310
|
+
color: ${({tokens:t})=>t.theme.textInvert};
|
|
311
|
+
background-color: ${({tokens:t})=>t.core.backgroundAccentPrimary};
|
|
312
|
+
border-radius: ${({borderRadius:t})=>t[2]};
|
|
313
|
+
align-items: center;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
@media (hover: hover) {
|
|
317
|
+
button:hover:enabled {
|
|
318
|
+
background-color: ${({tokens:t})=>t.core.foregroundAccent020};
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
`;var Rt=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Me=class extends m{constructor(){super(...arguments),this.label="",this.description="",this.icon="wallet"}render(){return l`
|
|
322
|
+
<button>
|
|
323
|
+
<wui-flex gap="2" alignItems="center">
|
|
324
|
+
<wui-icon weight="fill" size="lg" name=${this.icon} color="inherit"></wui-icon>
|
|
325
|
+
<wui-flex flexDirection="column" gap="1">
|
|
326
|
+
<wui-text variant="md-medium" color="primary">${this.label}</wui-text>
|
|
327
|
+
<wui-text variant="md-regular" color="tertiary">${this.description}</wui-text>
|
|
328
|
+
</wui-flex>
|
|
329
|
+
</wui-flex>
|
|
330
|
+
<wui-icon size="lg" color="accent-primary" name="chevronRight"></wui-icon>
|
|
331
|
+
</button>
|
|
332
|
+
`}};Me.styles=[I,W,an];Rt([c()],Me.prototype,"label",void 0);Rt([c()],Me.prototype,"description",void 0);Rt([c()],Me.prototype,"icon",void 0);Me=Rt([p("wui-notice-card")],Me);var _i=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ut=class extends m{constructor(){super(),this.unsubscribe=[],this.socialProvider=fe.getConnectedSocialProvider(),this.socialUsername=fe.getConnectedSocialUsername(),this.namespace=u.state.activeChain,this.unsubscribe.push(u.subscribeKey("activeChain",e=>{this.namespace=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=b.getConnectorId(this.namespace),i=b.getAuthConnector();if(!i||e!==S.CONNECTOR_ID.AUTH)return this.style.cssText="display: none",null;const o=i.provider.getEmail()??"";return!o&&!this.socialUsername?(this.style.cssText="display: none",null):l`
|
|
333
|
+
<wui-list-item
|
|
334
|
+
?rounded=${!0}
|
|
335
|
+
icon=${this.socialProvider??"mail"}
|
|
336
|
+
data-testid="w3m-account-email-update"
|
|
337
|
+
?chevron=${!this.socialProvider}
|
|
338
|
+
@click=${()=>{this.onGoToUpdateEmail(o,this.socialProvider)}}
|
|
339
|
+
>
|
|
340
|
+
<wui-text variant="lg-regular" color="primary">${this.getAuthName(o)}</wui-text>
|
|
341
|
+
</wui-list-item>
|
|
342
|
+
`}onGoToUpdateEmail(e,i){i||h.push("UpdateEmailWallet",{email:e,redirectView:"Account"})}getAuthName(e){return this.socialUsername?this.socialProvider==="discord"&&this.socialUsername.endsWith("0")?this.socialUsername.slice(0,-1):this.socialUsername:e.length>30?`${e.slice(0,-3)}...`:e}};_i([d()],Ut.prototype,"namespace",void 0);Ut=_i([p("w3m-account-auth-button")],Ut);var Le=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let be=class extends m{constructor(){var e,i,o;super(),this.usubscribe=[],this.networkImages=Te.state.networkImages,this.address=(e=u.getAccountData())==null?void 0:e.address,this.profileImage=(i=u.getAccountData())==null?void 0:i.profileImage,this.profileName=(o=u.getAccountData())==null?void 0:o.profileName,this.network=u.state.activeCaipNetwork,this.disconnecting=!1,this.remoteFeatures=f.state.remoteFeatures,this.usubscribe.push(u.subscribeChainProp("accountState",s=>{s&&(this.address=s.address,this.profileImage=s.profileImage,this.profileName=s.profileName)}),u.subscribeKey("activeCaipNetwork",s=>{s!=null&&s.id&&(this.network=s)}),f.subscribeKey("remoteFeatures",s=>{this.remoteFeatures=s}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){var i,o,s;if(!this.address)throw new Error("w3m-account-settings-view: No account provided");const e=this.networkImages[((o=(i=this.network)==null?void 0:i.assets)==null?void 0:o.imageId)??""];return l`
|
|
343
|
+
<wui-flex
|
|
344
|
+
flexDirection="column"
|
|
345
|
+
alignItems="center"
|
|
346
|
+
gap="4"
|
|
347
|
+
.padding=${["0","5","3","5"]}
|
|
348
|
+
>
|
|
349
|
+
<wui-avatar
|
|
350
|
+
alt=${this.address}
|
|
351
|
+
address=${this.address}
|
|
352
|
+
imageSrc=${w(this.profileImage)}
|
|
353
|
+
size="lg"
|
|
354
|
+
></wui-avatar>
|
|
355
|
+
<wui-flex flexDirection="column" alignItems="center">
|
|
356
|
+
<wui-flex gap="1" alignItems="center" justifyContent="center">
|
|
357
|
+
<wui-text variant="h5-medium" color="primary" data-testid="account-settings-address">
|
|
358
|
+
${F.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})}
|
|
359
|
+
</wui-text>
|
|
360
|
+
<wui-icon-link
|
|
361
|
+
size="md"
|
|
362
|
+
icon="copy"
|
|
363
|
+
iconColor="default"
|
|
364
|
+
@click=${this.onCopyAddress}
|
|
365
|
+
></wui-icon-link>
|
|
366
|
+
</wui-flex>
|
|
367
|
+
</wui-flex>
|
|
368
|
+
</wui-flex>
|
|
369
|
+
<wui-flex flexDirection="column" gap="4">
|
|
370
|
+
<wui-flex flexDirection="column" gap="2" .padding=${["6","4","3","4"]}>
|
|
371
|
+
${this.authCardTemplate()}
|
|
372
|
+
<w3m-account-auth-button></w3m-account-auth-button>
|
|
373
|
+
<wui-list-item
|
|
374
|
+
imageSrc=${w(e)}
|
|
375
|
+
?chevron=${this.isAllowedNetworkSwitch()}
|
|
376
|
+
?fullSize=${!0}
|
|
377
|
+
?rounded=${!0}
|
|
378
|
+
@click=${this.onNetworks.bind(this)}
|
|
379
|
+
data-testid="account-switch-network-button"
|
|
380
|
+
>
|
|
381
|
+
<wui-text variant="lg-regular" color="primary">
|
|
382
|
+
${((s=this.network)==null?void 0:s.name)??"Unknown"}
|
|
383
|
+
</wui-text>
|
|
384
|
+
</wui-list-item>
|
|
385
|
+
${this.smartAccountSettingsTemplate()} ${this.chooseNameButtonTemplate()}
|
|
386
|
+
<wui-list-item
|
|
387
|
+
?rounded=${!0}
|
|
388
|
+
icon="power"
|
|
389
|
+
iconColor="error"
|
|
390
|
+
?chevron=${!1}
|
|
391
|
+
.loading=${this.disconnecting}
|
|
392
|
+
@click=${this.onDisconnect.bind(this)}
|
|
393
|
+
data-testid="disconnect-button"
|
|
394
|
+
>
|
|
395
|
+
<wui-text variant="lg-regular" color="primary">Disconnect</wui-text>
|
|
396
|
+
</wui-list-item>
|
|
397
|
+
</wui-flex>
|
|
398
|
+
</wui-flex>
|
|
399
|
+
`}chooseNameButtonTemplate(){var n;const e=(n=this.network)==null?void 0:n.chainNamespace,i=b.getConnectorId(e),o=b.getAuthConnector();return!u.checkIfNamesSupported()||!o||i!==S.CONNECTOR_ID.AUTH||this.profileName?null:l`
|
|
400
|
+
<wui-list-item
|
|
401
|
+
icon="id"
|
|
402
|
+
?rounded=${!0}
|
|
403
|
+
?chevron=${!0}
|
|
404
|
+
@click=${this.onChooseName.bind(this)}
|
|
405
|
+
data-testid="account-choose-name-button"
|
|
406
|
+
>
|
|
407
|
+
<wui-text variant="lg-regular" color="primary">Choose account name </wui-text>
|
|
408
|
+
</wui-list-item>
|
|
409
|
+
`}authCardTemplate(){var s;const e=b.getConnectorId((s=this.network)==null?void 0:s.chainNamespace),i=b.getAuthConnector(),{origin:o}=location;return!i||e!==S.CONNECTOR_ID.AUTH||o.includes(D.SECURE_SITE)?null:l`
|
|
410
|
+
<wui-notice-card
|
|
411
|
+
@click=${this.onGoToUpgradeView.bind(this)}
|
|
412
|
+
label="Upgrade your wallet"
|
|
413
|
+
description="Transition to a self-custodial wallet"
|
|
414
|
+
icon="wallet"
|
|
415
|
+
data-testid="w3m-wallet-upgrade-card"
|
|
416
|
+
></wui-notice-card>
|
|
417
|
+
`}isAllowedNetworkSwitch(){const e=u.getAllRequestedCaipNetworks(),i=e?e.length>1:!1,o=e==null?void 0:e.find(({id:s})=>{var n;return s===((n=this.network)==null?void 0:n.id)});return i||!o}onCopyAddress(){try{this.address&&(y.copyToClopboard(this.address),k.showSuccess("Address copied"))}catch{k.showError("Failed to copy")}}smartAccountSettingsTemplate(){var n;const e=(n=this.network)==null?void 0:n.chainNamespace,i=u.checkIfSmartAccountEnabled(),o=b.getConnectorId(e);return!b.getAuthConnector()||o!==S.CONNECTOR_ID.AUTH||!i?null:l`
|
|
418
|
+
<wui-list-item
|
|
419
|
+
icon="user"
|
|
420
|
+
?rounded=${!0}
|
|
421
|
+
?chevron=${!0}
|
|
422
|
+
@click=${this.onSmartAccountSettings.bind(this)}
|
|
423
|
+
data-testid="account-smart-account-settings-button"
|
|
424
|
+
>
|
|
425
|
+
<wui-text variant="lg-regular" color="primary">Smart Account Settings</wui-text>
|
|
426
|
+
</wui-list-item>
|
|
427
|
+
`}onChooseName(){h.push("ChooseAccountName")}onNetworks(){this.isAllowedNetworkSwitch()&&h.push("Networks")}async onDisconnect(){var e,i;try{this.disconnecting=!0;const o=(e=this.network)==null?void 0:e.chainNamespace,n=x.getConnections(o).length>0,a=o&&b.state.activeConnectorIds[o],r=(i=this.remoteFeatures)==null?void 0:i.multiWallet;await x.disconnect(r?{id:a,namespace:o}:{}),n&&r&&(h.push("ProfileWallets"),k.showSuccess("Wallet deleted"))}catch{C.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),k.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onGoToUpgradeView(){C.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),h.push("UpgradeEmailWallet")}onSmartAccountSettings(){h.push("SmartAccountSettings")}};Le([d()],be.prototype,"address",void 0);Le([d()],be.prototype,"profileImage",void 0);Le([d()],be.prototype,"profileName",void 0);Le([d()],be.prototype,"network",void 0);Le([d()],be.prototype,"disconnecting",void 0);Le([d()],be.prototype,"remoteFeatures",void 0);be=Le([p("w3m-account-settings-view")],be);const rn=v`
|
|
428
|
+
:host {
|
|
429
|
+
flex: 1;
|
|
430
|
+
height: 100%;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
button {
|
|
434
|
+
width: 100%;
|
|
435
|
+
height: 100%;
|
|
436
|
+
display: inline-flex;
|
|
437
|
+
align-items: center;
|
|
438
|
+
padding: ${({spacing:t})=>t[1]} ${({spacing:t})=>t[2]};
|
|
439
|
+
column-gap: ${({spacing:t})=>t[1]};
|
|
440
|
+
color: ${({tokens:t})=>t.theme.textSecondary};
|
|
441
|
+
border-radius: ${({borderRadius:t})=>t[20]};
|
|
442
|
+
background-color: transparent;
|
|
443
|
+
transition: background-color ${({durations:t})=>t.lg}
|
|
444
|
+
${({easings:t})=>t["ease-out-power-2"]};
|
|
445
|
+
will-change: background-color;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/* -- Hover & Active states ----------------------------------------------------------- */
|
|
449
|
+
button[data-active='true'] {
|
|
450
|
+
color: ${({tokens:t})=>t.theme.textPrimary};
|
|
451
|
+
background-color: ${({tokens:t})=>t.theme.foregroundTertiary};
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
button:hover:enabled:not([data-active='true']),
|
|
455
|
+
button:active:enabled:not([data-active='true']) {
|
|
456
|
+
wui-text,
|
|
457
|
+
wui-icon {
|
|
458
|
+
color: ${({tokens:t})=>t.theme.textPrimary};
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
`;var lt=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const ln={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},cn={lg:"md",md:"sm",sm:"sm"};let ke=class extends m{constructor(){super(...arguments),this.icon="mobile",this.size="md",this.label="",this.active=!1}render(){return l`
|
|
462
|
+
<button data-active=${this.active}>
|
|
463
|
+
${this.icon?l`<wui-icon size=${cn[this.size]} name=${this.icon}></wui-icon>`:""}
|
|
464
|
+
<wui-text variant=${ln[this.size]}> ${this.label} </wui-text>
|
|
465
|
+
</button>
|
|
466
|
+
`}};ke.styles=[I,W,rn];lt([c()],ke.prototype,"icon",void 0);lt([c()],ke.prototype,"size",void 0);lt([c()],ke.prototype,"label",void 0);lt([c({type:Boolean})],ke.prototype,"active",void 0);ke=lt([p("wui-tab-item")],ke);const un=v`
|
|
467
|
+
:host {
|
|
468
|
+
display: inline-flex;
|
|
469
|
+
align-items: center;
|
|
470
|
+
background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
|
|
471
|
+
border-radius: ${({borderRadius:t})=>t[32]};
|
|
472
|
+
padding: ${({spacing:t})=>t["01"]};
|
|
473
|
+
box-sizing: border-box;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
:host([data-size='sm']) {
|
|
477
|
+
height: 26px;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
:host([data-size='md']) {
|
|
481
|
+
height: 36px;
|
|
482
|
+
}
|
|
483
|
+
`;var ct=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ae=class extends m{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.size="md",this.activeTab=0}render(){return this.dataset.size=this.size,this.tabs.map((e,i)=>{var s;const o=i===this.activeTab;return l`
|
|
484
|
+
<wui-tab-item
|
|
485
|
+
@click=${()=>this.onTabClick(i)}
|
|
486
|
+
icon=${e.icon}
|
|
487
|
+
size=${this.size}
|
|
488
|
+
label=${e.label}
|
|
489
|
+
?active=${o}
|
|
490
|
+
data-active=${o}
|
|
491
|
+
data-testid="tab-${(s=e.label)==null?void 0:s.toLowerCase()}"
|
|
492
|
+
></wui-tab-item>
|
|
493
|
+
`})}onTabClick(e){this.activeTab=e,this.onTabChange(e)}};Ae.styles=[I,W,un];ct([c({type:Array})],Ae.prototype,"tabs",void 0);ct([c()],Ae.prototype,"onTabChange",void 0);ct([c()],Ae.prototype,"size",void 0);ct([d()],Ae.prototype,"activeTab",void 0);Ae=ct([p("wui-tabs")],Ae);const dn=v`
|
|
494
|
+
wui-icon-link {
|
|
495
|
+
margin-right: calc(${({spacing:t})=>t[8]} * -1);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
wui-notice-card {
|
|
499
|
+
margin-bottom: ${({spacing:t})=>t[1]};
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
wui-list-item > wui-text {
|
|
503
|
+
flex: 1;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
w3m-transactions-view {
|
|
507
|
+
max-height: 200px;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.balance-container {
|
|
511
|
+
display: inline;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.tab-content-container {
|
|
515
|
+
height: 300px;
|
|
516
|
+
overflow-y: auto;
|
|
517
|
+
overflow-x: hidden;
|
|
518
|
+
scrollbar-width: none;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
.symbol {
|
|
522
|
+
transform: translateY(-2px);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.tab-content-container::-webkit-scrollbar {
|
|
526
|
+
display: none;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
.account-button {
|
|
530
|
+
width: auto;
|
|
531
|
+
border: none;
|
|
532
|
+
display: flex;
|
|
533
|
+
align-items: center;
|
|
534
|
+
justify-content: center;
|
|
535
|
+
gap: ${({spacing:t})=>t[3]};
|
|
536
|
+
height: 48px;
|
|
537
|
+
padding: ${({spacing:t})=>t[2]};
|
|
538
|
+
padding-right: ${({spacing:t})=>t[3]};
|
|
539
|
+
box-shadow: inset 0 0 0 1px ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
540
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
541
|
+
border-radius: ${({borderRadius:t})=>t[6]};
|
|
542
|
+
transition: background-color ${({durations:t})=>t.lg}
|
|
543
|
+
${({easings:t})=>t["ease-out-power-2"]};
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
.account-button:hover {
|
|
547
|
+
background-color: ${({tokens:t})=>t.core.glass010};
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
.avatar-container {
|
|
551
|
+
position: relative;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
wui-avatar.avatar {
|
|
555
|
+
width: 32px;
|
|
556
|
+
height: 32px;
|
|
557
|
+
box-shadow: 0 0 0 2px ${({tokens:t})=>t.core.glass010};
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
wui-wallet-switch {
|
|
561
|
+
margin-top: ${({spacing:t})=>t[2]};
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
wui-avatar.network-avatar {
|
|
565
|
+
width: 16px;
|
|
566
|
+
height: 16px;
|
|
567
|
+
position: absolute;
|
|
568
|
+
left: 100%;
|
|
569
|
+
top: 100%;
|
|
570
|
+
transform: translate(-75%, -75%);
|
|
571
|
+
box-shadow: 0 0 0 2px ${({tokens:t})=>t.core.glass010};
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.account-links {
|
|
575
|
+
display: flex;
|
|
576
|
+
justify-content: space-between;
|
|
577
|
+
align-items: center;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
.account-links wui-flex {
|
|
581
|
+
cursor: pointer;
|
|
582
|
+
display: flex;
|
|
583
|
+
align-items: center;
|
|
584
|
+
justify-content: center;
|
|
585
|
+
flex: 1;
|
|
586
|
+
background: red;
|
|
587
|
+
align-items: center;
|
|
588
|
+
justify-content: center;
|
|
589
|
+
height: 48px;
|
|
590
|
+
padding: 10px;
|
|
591
|
+
flex: 1 0 0;
|
|
592
|
+
border-radius: var(--XS, 16px);
|
|
593
|
+
border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
|
|
594
|
+
background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
|
|
595
|
+
transition:
|
|
596
|
+
background-color ${({durations:t})=>t.md}
|
|
597
|
+
${({easings:t})=>t["ease-out-power-1"]},
|
|
598
|
+
opacity ${({durations:t})=>t.md} ${({easings:t})=>t["ease-out-power-1"]};
|
|
599
|
+
will-change: background-color, opacity;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
.account-links wui-flex:hover {
|
|
603
|
+
background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15));
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
.account-links wui-flex wui-icon {
|
|
607
|
+
width: var(--S, 20px);
|
|
608
|
+
height: var(--S, 20px);
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.account-links wui-flex wui-icon svg path {
|
|
612
|
+
stroke: #667dff;
|
|
613
|
+
}
|
|
614
|
+
`;var ie=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let M=class extends m{constructor(){var e,i,o,s,n,a;super(),this.unsubscribe=[],this.caipAddress=(e=u.getAccountData())==null?void 0:e.caipAddress,this.address=y.getPlainAddress((i=u.getAccountData())==null?void 0:i.caipAddress),this.profileImage=(o=u.getAccountData())==null?void 0:o.profileImage,this.profileName=(s=u.getAccountData())==null?void 0:s.profileName,this.disconnecting=!1,this.balance=(n=u.getAccountData())==null?void 0:n.balance,this.balanceSymbol=(a=u.getAccountData())==null?void 0:a.balanceSymbol,this.features=f.state.features,this.remoteFeatures=f.state.remoteFeatures,this.namespace=u.state.activeChain,this.activeConnectorIds=b.state.activeConnectorIds,this.unsubscribe.push(u.subscribeChainProp("accountState",r=>{this.address=y.getPlainAddress(r==null?void 0:r.caipAddress),this.caipAddress=r==null?void 0:r.caipAddress,this.balance=r==null?void 0:r.balance,this.balanceSymbol=r==null?void 0:r.balanceSymbol,this.profileName=r==null?void 0:r.profileName,this.profileImage=r==null?void 0:r.profileImage}),f.subscribeKey("features",r=>this.features=r),f.subscribeKey("remoteFeatures",r=>this.remoteFeatures=r),b.subscribeKey("activeConnectorIds",r=>{this.activeConnectorIds=r}),u.subscribeKey("activeChain",r=>this.namespace=r),u.subscribeKey("activeCaipNetwork",r=>{r!=null&&r.chainNamespace&&(this.namespace=r==null?void 0:r.chainNamespace)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.caipAddress||!this.namespace)return null;const e=this.activeConnectorIds[this.namespace],i=e?b.getConnectorById(e):void 0,o=T.getConnectorImage(i),{value:s,decimals:n,symbol:a}=y.parseBalance(this.balance,this.balanceSymbol);return l`<wui-flex
|
|
615
|
+
flexDirection="column"
|
|
616
|
+
.padding=${["0","5","4","5"]}
|
|
617
|
+
alignItems="center"
|
|
618
|
+
gap="3"
|
|
619
|
+
>
|
|
620
|
+
<wui-avatar
|
|
621
|
+
alt=${w(this.caipAddress)}
|
|
622
|
+
address=${w(y.getPlainAddress(this.caipAddress))}
|
|
623
|
+
imageSrc=${w(this.profileImage===null?void 0:this.profileImage)}
|
|
624
|
+
data-testid="single-account-avatar"
|
|
625
|
+
></wui-avatar>
|
|
626
|
+
<wui-wallet-switch
|
|
627
|
+
profileName=${this.profileName}
|
|
628
|
+
address=${this.address}
|
|
629
|
+
imageSrc=${o}
|
|
630
|
+
alt=${i==null?void 0:i.name}
|
|
631
|
+
@click=${this.onGoToProfileWalletsView.bind(this)}
|
|
632
|
+
data-testid="wui-wallet-switch"
|
|
633
|
+
></wui-wallet-switch>
|
|
634
|
+
<div class="balance-container">
|
|
635
|
+
<wui-text variant="h3-regular" color="primary">${s}</wui-text>
|
|
636
|
+
<wui-text variant="h3-regular" color="secondary">.${n}</wui-text>
|
|
637
|
+
<wui-text variant="h6-medium" color="primary" class="symbol">${a}</wui-text>
|
|
638
|
+
</div>
|
|
639
|
+
${this.explorerBtnTemplate()}
|
|
640
|
+
</wui-flex>
|
|
641
|
+
|
|
642
|
+
<wui-flex flexDirection="column" gap="2" .padding=${["0","3","3","3"]}>
|
|
643
|
+
${this.authCardTemplate()} <w3m-account-auth-button></w3m-account-auth-button>
|
|
644
|
+
${this.orderedFeaturesTemplate()} ${this.activityTemplate()}
|
|
645
|
+
<wui-list-item
|
|
646
|
+
.rounded=${!0}
|
|
647
|
+
icon="power"
|
|
648
|
+
iconColor="error"
|
|
649
|
+
?chevron=${!1}
|
|
650
|
+
.loading=${this.disconnecting}
|
|
651
|
+
.rightIcon=${!1}
|
|
652
|
+
@click=${this.onDisconnect.bind(this)}
|
|
653
|
+
data-testid="disconnect-button"
|
|
654
|
+
>
|
|
655
|
+
<wui-text variant="lg-regular" color="primary">Disconnect</wui-text>
|
|
656
|
+
</wui-list-item>
|
|
657
|
+
</wui-flex>`}fundWalletTemplate(){var n,a;if(!this.namespace)return null;const e=D.ONRAMP_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace),i=!!((n=this.features)!=null&&n.receive),o=((a=this.remoteFeatures)==null?void 0:a.onramp)&&e,s=Q.isPayWithExchangeEnabled();return!o&&!i&&!s?null:l`
|
|
658
|
+
<wui-list-item
|
|
659
|
+
.rounded=${!0}
|
|
660
|
+
data-testid="w3m-account-default-fund-wallet-button"
|
|
661
|
+
iconVariant="blue"
|
|
662
|
+
icon="dollar"
|
|
663
|
+
?chevron=${!0}
|
|
664
|
+
@click=${this.handleClickFundWallet.bind(this)}
|
|
665
|
+
>
|
|
666
|
+
<wui-text variant="lg-regular" color="primary">Fund wallet</wui-text>
|
|
667
|
+
</wui-list-item>
|
|
668
|
+
`}orderedFeaturesTemplate(){var i;return(((i=this.features)==null?void 0:i.walletFeaturesOrder)||D.DEFAULT_FEATURES.walletFeaturesOrder).map(o=>{switch(o){case"onramp":return this.fundWalletTemplate();case"swaps":return this.swapsTemplate();case"send":return this.sendTemplate();default:return null}})}activityTemplate(){var i;return this.namespace&&((i=this.remoteFeatures)==null?void 0:i.activity)&&D.ACTIVITY_ENABLED_CHAIN_NAMESPACES.includes(this.namespace)?l` <wui-list-item
|
|
669
|
+
.rounded=${!0}
|
|
670
|
+
icon="clock"
|
|
671
|
+
?chevron=${!0}
|
|
672
|
+
@click=${this.onTransactions.bind(this)}
|
|
673
|
+
data-testid="w3m-account-default-activity-button"
|
|
674
|
+
>
|
|
675
|
+
<wui-text variant="lg-regular" color="primary">Activity</wui-text>
|
|
676
|
+
</wui-list-item>`:null}swapsTemplate(){var o;const e=(o=this.remoteFeatures)==null?void 0:o.swaps,i=u.state.activeChain===S.CHAIN.EVM;return!e||!i?null:l`
|
|
677
|
+
<wui-list-item
|
|
678
|
+
.rounded=${!0}
|
|
679
|
+
icon="recycleHorizontal"
|
|
680
|
+
?chevron=${!0}
|
|
681
|
+
@click=${this.handleClickSwap.bind(this)}
|
|
682
|
+
data-testid="w3m-account-default-swaps-button"
|
|
683
|
+
>
|
|
684
|
+
<wui-text variant="lg-regular" color="primary">Swap</wui-text>
|
|
685
|
+
</wui-list-item>
|
|
686
|
+
`}sendTemplate(){var s;const e=(s=this.features)==null?void 0:s.send,i=u.state.activeChain;if(!i)throw new Error("SendController:sendTemplate - namespace is required");const o=D.SEND_SUPPORTED_NAMESPACES.includes(i);return!e||!o?null:l`
|
|
687
|
+
<wui-list-item
|
|
688
|
+
.rounded=${!0}
|
|
689
|
+
icon="send"
|
|
690
|
+
?chevron=${!0}
|
|
691
|
+
@click=${this.handleClickSend.bind(this)}
|
|
692
|
+
data-testid="w3m-account-default-send-button"
|
|
693
|
+
>
|
|
694
|
+
<wui-text variant="lg-regular" color="primary">Send</wui-text>
|
|
695
|
+
</wui-list-item>
|
|
696
|
+
`}authCardTemplate(){const e=u.state.activeChain;if(!e)throw new Error("AuthCardTemplate:authCardTemplate - namespace is required");const i=b.getConnectorId(e),o=b.getAuthConnector(),{origin:s}=location;return!o||i!==S.CONNECTOR_ID.AUTH||s.includes(D.SECURE_SITE)?null:l`
|
|
697
|
+
<wui-notice-card
|
|
698
|
+
@click=${this.onGoToUpgradeView.bind(this)}
|
|
699
|
+
label="Upgrade your wallet"
|
|
700
|
+
description="Transition to a self-custodial wallet"
|
|
701
|
+
icon="wallet"
|
|
702
|
+
data-testid="w3m-wallet-upgrade-card"
|
|
703
|
+
></wui-notice-card>
|
|
704
|
+
`}handleClickFundWallet(){h.push("FundWallet")}handleClickSwap(){h.push("Swap")}handleClickSend(){h.push("WalletSend")}explorerBtnTemplate(){var i;return((i=u.getAccountData())==null?void 0:i.addressExplorerUrl)?l`
|
|
705
|
+
<wui-button size="md" variant="accent-primary" @click=${this.onExplorer.bind(this)}>
|
|
706
|
+
<wui-icon size="sm" color="inherit" slot="iconLeft" name="compass"></wui-icon>
|
|
707
|
+
Block Explorer
|
|
708
|
+
<wui-icon size="sm" color="inherit" slot="iconRight" name="externalLink"></wui-icon>
|
|
709
|
+
</wui-button>
|
|
710
|
+
`:null}onTransactions(){C.sendEvent({type:"track",event:"CLICK_TRANSACTIONS",properties:{isSmartAccount:ze(u.state.activeChain)===Fe.ACCOUNT_TYPES.SMART_ACCOUNT}}),h.push("Transactions")}async onDisconnect(){var e;try{this.disconnecting=!0;const o=x.getConnections(this.namespace).length>0,s=this.namespace&&b.state.activeConnectorIds[this.namespace],n=(e=this.remoteFeatures)==null?void 0:e.multiWallet;await x.disconnect(n?{id:s,namespace:this.namespace}:{}),o&&n&&(h.push("ProfileWallets"),k.showSuccess("Wallet deleted"))}catch{C.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),k.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onExplorer(){var i;const e=(i=u.getAccountData())==null?void 0:i.addressExplorerUrl;e&&y.openHref(e,"_blank")}onGoToUpgradeView(){C.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),h.push("UpgradeEmailWallet")}onGoToProfileWalletsView(){h.push("ProfileWallets")}};M.styles=dn;ie([d()],M.prototype,"caipAddress",void 0);ie([d()],M.prototype,"address",void 0);ie([d()],M.prototype,"profileImage",void 0);ie([d()],M.prototype,"profileName",void 0);ie([d()],M.prototype,"disconnecting",void 0);ie([d()],M.prototype,"balance",void 0);ie([d()],M.prototype,"balanceSymbol",void 0);ie([d()],M.prototype,"features",void 0);ie([d()],M.prototype,"remoteFeatures",void 0);ie([d()],M.prototype,"namespace",void 0);ie([d()],M.prototype,"activeConnectorIds",void 0);M=ie([p("w3m-account-default-widget")],M);const hn=v`
|
|
711
|
+
span {
|
|
712
|
+
font-weight: 500;
|
|
713
|
+
font-size: 38px;
|
|
714
|
+
color: ${({tokens:t})=>t.theme.textPrimary};
|
|
715
|
+
line-height: 38px;
|
|
716
|
+
letter-spacing: -2%;
|
|
717
|
+
text-align: center;
|
|
718
|
+
font-family: var(--apkt-fontFamily-regular);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.pennies {
|
|
722
|
+
color: ${({tokens:t})=>t.theme.textSecondary};
|
|
723
|
+
}
|
|
724
|
+
`;var ti=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let it=class extends m{constructor(){super(...arguments),this.dollars="0",this.pennies="00"}render(){return l`<span>$${this.dollars}<span class="pennies">.${this.pennies}</span></span>`}};it.styles=[I,hn];ti([c()],it.prototype,"dollars",void 0);ti([c()],it.prototype,"pennies",void 0);it=ti([p("wui-balance")],it);const pn=v`
|
|
725
|
+
:host {
|
|
726
|
+
display: inline-flex;
|
|
727
|
+
justify-content: center;
|
|
728
|
+
align-items: center;
|
|
729
|
+
position: relative;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
wui-icon {
|
|
733
|
+
position: absolute;
|
|
734
|
+
width: 12px !important;
|
|
735
|
+
height: 4px !important;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
/* -- Variants --------------------------------------------------------- */
|
|
739
|
+
:host([data-variant='fill']) {
|
|
740
|
+
background-color: ${({colors:t})=>t.neutrals100};
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
:host([data-variant='shade']) {
|
|
744
|
+
background-color: ${({colors:t})=>t.neutrals900};
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
:host([data-variant='fill']) > wui-text {
|
|
748
|
+
color: ${({colors:t})=>t.black};
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
:host([data-variant='shade']) > wui-text {
|
|
752
|
+
color: ${({colors:t})=>t.white};
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
:host([data-variant='fill']) > wui-icon {
|
|
756
|
+
color: ${({colors:t})=>t.neutrals100};
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
:host([data-variant='shade']) > wui-icon {
|
|
760
|
+
color: ${({colors:t})=>t.neutrals900};
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/* -- Sizes --------------------------------------------------------- */
|
|
764
|
+
:host([data-size='sm']) {
|
|
765
|
+
padding: ${({spacing:t})=>t[1]} ${({spacing:t})=>t[2]};
|
|
766
|
+
border-radius: ${({borderRadius:t})=>t[2]};
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
:host([data-size='md']) {
|
|
770
|
+
padding: ${({spacing:t})=>t[2]} ${({spacing:t})=>t[3]};
|
|
771
|
+
border-radius: ${({borderRadius:t})=>t[3]};
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
/* -- Placements --------------------------------------------------------- */
|
|
775
|
+
wui-icon[data-placement='top'] {
|
|
776
|
+
bottom: 0px;
|
|
777
|
+
left: 50%;
|
|
778
|
+
transform: translate(-50%, 95%);
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
wui-icon[data-placement='bottom'] {
|
|
782
|
+
top: 0;
|
|
783
|
+
left: 50%;
|
|
784
|
+
transform: translate(-50%, -95%) rotate(180deg);
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
wui-icon[data-placement='right'] {
|
|
788
|
+
top: 50%;
|
|
789
|
+
left: 0;
|
|
790
|
+
transform: translate(-65%, -50%) rotate(90deg);
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
wui-icon[data-placement='left'] {
|
|
794
|
+
top: 50%;
|
|
795
|
+
right: 0%;
|
|
796
|
+
transform: translate(65%, -50%) rotate(270deg);
|
|
797
|
+
}
|
|
798
|
+
`;var ut=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const wn={sm:"sm-regular",md:"md-regular"};let Ie=class extends m{constructor(){super(...arguments),this.placement="top",this.variant="fill",this.size="md",this.message=""}render(){return this.dataset.variant=this.variant,this.dataset.size=this.size,l`<wui-icon data-placement=${this.placement} size="inherit" name="cursor"></wui-icon>
|
|
799
|
+
<wui-text variant=${wn[this.size]}>${this.message}</wui-text>`}};Ie.styles=[I,W,pn];ut([c()],Ie.prototype,"placement",void 0);ut([c()],Ie.prototype,"variant",void 0);ut([c()],Ie.prototype,"size",void 0);ut([c()],Ie.prototype,"message",void 0);Ie=ut([p("wui-tooltip")],Ie);const mn=ee`
|
|
800
|
+
:host {
|
|
801
|
+
width: 100%;
|
|
802
|
+
max-height: 280px;
|
|
803
|
+
overflow: scroll;
|
|
804
|
+
scrollbar-width: none;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
:host::-webkit-scrollbar {
|
|
808
|
+
display: none;
|
|
809
|
+
}
|
|
810
|
+
`;var fn=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let zt=class extends m{render(){return l`<w3m-activity-list page="account"></w3m-activity-list>`}};zt.styles=mn;zt=fn([p("w3m-account-activity-widget")],zt);const bn=v`
|
|
811
|
+
:host {
|
|
812
|
+
width: 100%;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
button {
|
|
816
|
+
width: 100%;
|
|
817
|
+
display: flex;
|
|
818
|
+
justify-content: space-between;
|
|
819
|
+
align-items: center;
|
|
820
|
+
gap: ${({spacing:t})=>t[4]};
|
|
821
|
+
padding: ${({spacing:t})=>t[4]};
|
|
822
|
+
background-color: transparent;
|
|
823
|
+
border-radius: ${({borderRadius:t})=>t[4]};
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
wui-text {
|
|
827
|
+
max-width: 174px;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
.tag-container {
|
|
831
|
+
width: fit-content;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
@media (hover: hover) {
|
|
835
|
+
button:hover:enabled {
|
|
836
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
`;var Xe=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ge=class extends m{constructor(){super(...arguments),this.icon="card",this.text="",this.description="",this.tag=void 0,this.disabled=!1}render(){return l`
|
|
840
|
+
<button ?disabled=${this.disabled}>
|
|
841
|
+
<wui-flex alignItems="center" gap="3">
|
|
842
|
+
<wui-icon-box padding="2" color="secondary" icon=${this.icon} size="lg"></wui-icon-box>
|
|
843
|
+
<wui-flex flexDirection="column" gap="1">
|
|
844
|
+
<wui-text variant="md-medium" color="primary">${this.text}</wui-text>
|
|
845
|
+
${this.description?l`<wui-text variant="md-regular" color="secondary">
|
|
846
|
+
${this.description}</wui-text
|
|
847
|
+
>`:null}
|
|
848
|
+
</wui-flex>
|
|
849
|
+
</wui-flex>
|
|
850
|
+
|
|
851
|
+
<wui-flex class="tag-container" alignItems="center" gap="1" justifyContent="flex-end">
|
|
852
|
+
${this.tag?l`<wui-tag tagType="main" size="sm">${this.tag}</wui-tag>`:null}
|
|
853
|
+
<wui-icon size="md" name="chevronRight" color="default"></wui-icon>
|
|
854
|
+
</wui-flex>
|
|
855
|
+
</button>
|
|
856
|
+
`}};ge.styles=[I,W,bn];Xe([c()],ge.prototype,"icon",void 0);Xe([c()],ge.prototype,"text",void 0);Xe([c()],ge.prototype,"description",void 0);Xe([c()],ge.prototype,"tag",void 0);Xe([c({type:Boolean})],ge.prototype,"disabled",void 0);ge=Xe([p("wui-list-description")],ge);const gn=ee`
|
|
857
|
+
:host {
|
|
858
|
+
width: 100%;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
wui-flex {
|
|
862
|
+
width: 100%;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
.contentContainer {
|
|
866
|
+
max-height: 280px;
|
|
867
|
+
overflow: scroll;
|
|
868
|
+
scrollbar-width: none;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
.contentContainer::-webkit-scrollbar {
|
|
872
|
+
display: none;
|
|
873
|
+
}
|
|
874
|
+
`;var ii=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let nt=class extends m{constructor(){var e;super(),this.unsubscribe=[],this.tokenBalance=(e=u.getAccountData())==null?void 0:e.tokenBalance,this.remoteFeatures=f.state.remoteFeatures,this.unsubscribe.push(u.subscribeChainProp("accountState",i=>{this.tokenBalance=i==null?void 0:i.tokenBalance}),f.subscribeKey("remoteFeatures",i=>{this.remoteFeatures=i}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`${this.tokenTemplate()}`}tokenTemplate(){var e;return this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>0?l`<wui-flex class="contentContainer" flexDirection="column" gap="2">
|
|
875
|
+
${this.tokenItemTemplate()}
|
|
876
|
+
</wui-flex>`:l` <wui-flex flexDirection="column">
|
|
877
|
+
${this.onRampTemplate()}
|
|
878
|
+
<wui-list-description
|
|
879
|
+
@click=${this.onReceiveClick.bind(this)}
|
|
880
|
+
text="Receive funds"
|
|
881
|
+
description="Scan the QR code and receive funds"
|
|
882
|
+
icon="qrCode"
|
|
883
|
+
iconColor="fg-200"
|
|
884
|
+
iconBackgroundColor="fg-200"
|
|
885
|
+
data-testid="w3m-account-receive-button"
|
|
886
|
+
></wui-list-description
|
|
887
|
+
></wui-flex>`}onRampTemplate(){var e;return(e=this.remoteFeatures)!=null&&e.onramp?l`<wui-list-description
|
|
888
|
+
@click=${this.onBuyClick.bind(this)}
|
|
889
|
+
text="Buy Crypto"
|
|
890
|
+
description="Easy with card or bank account"
|
|
891
|
+
icon="card"
|
|
892
|
+
iconColor="success-100"
|
|
893
|
+
iconBackgroundColor="success-100"
|
|
894
|
+
tag="popular"
|
|
895
|
+
data-testid="w3m-account-onramp-button"
|
|
896
|
+
></wui-list-description>`:l``}tokenItemTemplate(){var e;return(e=this.tokenBalance)==null?void 0:e.map(i=>l`<wui-list-token
|
|
897
|
+
tokenName=${i.name}
|
|
898
|
+
tokenImageUrl=${i.iconUrl}
|
|
899
|
+
tokenAmount=${i.quantity.numeric}
|
|
900
|
+
tokenValue=${i.value}
|
|
901
|
+
tokenCurrency=${i.symbol}
|
|
902
|
+
></wui-list-token>`)}onReceiveClick(){h.push("WalletReceive")}onBuyClick(){C.sendEvent({type:"track",event:"SELECT_BUY_CRYPTO",properties:{isSmartAccount:ze(u.state.activeChain)===Fe.ACCOUNT_TYPES.SMART_ACCOUNT}}),h.push("OnRampProviders")}};nt.styles=gn;ii([d()],nt.prototype,"tokenBalance",void 0);ii([d()],nt.prototype,"remoteFeatures",void 0);nt=ii([p("w3m-account-tokens-widget")],nt);const yn=v`
|
|
903
|
+
wui-flex {
|
|
904
|
+
width: 100%;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
wui-promo {
|
|
908
|
+
position: absolute;
|
|
909
|
+
top: -32px;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
wui-profile-button {
|
|
913
|
+
margin-top: calc(-1 * ${({spacing:t})=>t[4]});
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
wui-promo + wui-profile-button {
|
|
917
|
+
margin-top: ${({spacing:t})=>t[4]};
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
wui-tabs {
|
|
921
|
+
width: 100%;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
.contentContainer {
|
|
925
|
+
height: 280px;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
.contentContainer > wui-icon-box {
|
|
929
|
+
width: 40px;
|
|
930
|
+
height: 40px;
|
|
931
|
+
border-radius: ${({borderRadius:t})=>t[3]};
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
.contentContainer > .textContent {
|
|
935
|
+
width: 65%;
|
|
936
|
+
}
|
|
937
|
+
`;var re=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let G=class extends m{constructor(){var e,i,o,s;super(...arguments),this.unsubscribe=[],this.network=u.state.activeCaipNetwork,this.profileName=(e=u.getAccountData())==null?void 0:e.profileName,this.address=(i=u.getAccountData())==null?void 0:i.address,this.currentTab=(o=u.getAccountData())==null?void 0:o.currentTab,this.tokenBalance=(s=u.getAccountData())==null?void 0:s.tokenBalance,this.features=f.state.features,this.namespace=u.state.activeChain,this.activeConnectorIds=b.state.activeConnectorIds,this.remoteFeatures=f.state.remoteFeatures}firstUpdated(){u.fetchTokenBalance(),this.unsubscribe.push(u.subscribeChainProp("accountState",e=>{e!=null&&e.address?(this.address=e.address,this.profileName=e.profileName,this.currentTab=e.currentTab,this.tokenBalance=e.tokenBalance):P.close()}),b.subscribeKey("activeConnectorIds",e=>{this.activeConnectorIds=e}),u.subscribeKey("activeChain",e=>this.namespace=e),u.subscribeKey("activeCaipNetwork",e=>this.network=e),f.subscribeKey("features",e=>this.features=e),f.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e)),this.watchSwapValues()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearInterval(this.watchTokenBalance)}render(){if(!this.address)throw new Error("w3m-account-features-widget: No account provided");if(!this.namespace)return null;const e=this.activeConnectorIds[this.namespace],i=e?b.getConnectorById(e):void 0,{icon:o,iconSize:s}=this.getAuthData();return l`<wui-flex
|
|
938
|
+
flexDirection="column"
|
|
939
|
+
.padding=${["0","3","4","3"]}
|
|
940
|
+
alignItems="center"
|
|
941
|
+
gap="4"
|
|
942
|
+
data-testid="w3m-account-wallet-features-widget"
|
|
943
|
+
>
|
|
944
|
+
<wui-flex flexDirection="column" justifyContent="center" alignItems="center" gap="2">
|
|
945
|
+
<wui-wallet-switch
|
|
946
|
+
profileName=${this.profileName}
|
|
947
|
+
address=${this.address}
|
|
948
|
+
icon=${o}
|
|
949
|
+
iconSize=${s}
|
|
950
|
+
alt=${i==null?void 0:i.name}
|
|
951
|
+
@click=${this.onGoToProfileWalletsView.bind(this)}
|
|
952
|
+
data-testid="wui-wallet-switch"
|
|
953
|
+
></wui-wallet-switch>
|
|
954
|
+
|
|
955
|
+
${this.tokenBalanceTemplate()}
|
|
956
|
+
</wui-flex>
|
|
957
|
+
${this.orderedWalletFeatures()} ${this.tabsTemplate()} ${this.listContentTemplate()}
|
|
958
|
+
</wui-flex>`}orderedWalletFeatures(){var n;const e=((n=this.features)==null?void 0:n.walletFeaturesOrder)||D.DEFAULT_FEATURES.walletFeaturesOrder;if(e.every(a=>{var r,g;return a==="send"||a==="receive"?!((r=this.features)!=null&&r[a]):a==="swaps"||a==="onramp"?!((g=this.remoteFeatures)!=null&&g[a]):!0}))return null;const o=e.map(a=>a==="receive"||a==="onramp"?"fund":a),s=[...new Set(o)];return l`<wui-flex gap="2">
|
|
959
|
+
${s.map(a=>{switch(a){case"fund":return this.fundWalletTemplate();case"swaps":return this.swapsTemplate();case"send":return this.sendTemplate();default:return null}})}
|
|
960
|
+
</wui-flex>`}fundWalletTemplate(){var n,a;if(!this.namespace)return null;const e=D.ONRAMP_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace),i=(n=this.features)==null?void 0:n.receive,o=((a=this.remoteFeatures)==null?void 0:a.onramp)&&e,s=Q.isPayWithExchangeEnabled();return!o&&!i&&!s?null:l`
|
|
961
|
+
<w3m-tooltip-trigger text="Fund wallet">
|
|
962
|
+
<wui-button
|
|
963
|
+
data-testid="wallet-features-fund-wallet-button"
|
|
964
|
+
@click=${this.onFundWalletClick.bind(this)}
|
|
965
|
+
variant="accent-secondary"
|
|
966
|
+
size="lg"
|
|
967
|
+
fullWidth
|
|
968
|
+
>
|
|
969
|
+
<wui-icon name="dollar"></wui-icon>
|
|
970
|
+
</wui-button>
|
|
971
|
+
</w3m-tooltip-trigger>
|
|
972
|
+
`}swapsTemplate(){var o;const e=(o=this.remoteFeatures)==null?void 0:o.swaps,i=u.state.activeChain===S.CHAIN.EVM;return!e||!i?null:l`
|
|
973
|
+
<w3m-tooltip-trigger text="Swap">
|
|
974
|
+
<wui-button
|
|
975
|
+
fullWidth
|
|
976
|
+
data-testid="wallet-features-swaps-button"
|
|
977
|
+
@click=${this.onSwapClick.bind(this)}
|
|
978
|
+
variant="accent-secondary"
|
|
979
|
+
size="lg"
|
|
980
|
+
>
|
|
981
|
+
<wui-icon name="recycleHorizontal"></wui-icon>
|
|
982
|
+
</wui-button>
|
|
983
|
+
</w3m-tooltip-trigger>
|
|
984
|
+
`}sendTemplate(){var s;const e=(s=this.features)==null?void 0:s.send,i=u.state.activeChain,o=D.SEND_SUPPORTED_NAMESPACES.includes(i);return!e||!o?null:l`
|
|
985
|
+
<w3m-tooltip-trigger text="Send">
|
|
986
|
+
<wui-button
|
|
987
|
+
fullWidth
|
|
988
|
+
data-testid="wallet-features-send-button"
|
|
989
|
+
@click=${this.onSendClick.bind(this)}
|
|
990
|
+
variant="accent-secondary"
|
|
991
|
+
size="lg"
|
|
992
|
+
>
|
|
993
|
+
<wui-icon name="send"></wui-icon>
|
|
994
|
+
</wui-button>
|
|
995
|
+
</w3m-tooltip-trigger>
|
|
996
|
+
`}watchSwapValues(){this.watchTokenBalance=setInterval(()=>u.fetchTokenBalance(e=>this.onTokenBalanceError(e)),1e4)}onTokenBalanceError(e){e instanceof Error&&e.cause instanceof Response&&e.cause.status===S.HTTP_STATUS_CODES.SERVICE_UNAVAILABLE&&clearInterval(this.watchTokenBalance)}listContentTemplate(){return this.currentTab===0?l`<w3m-account-tokens-widget></w3m-account-tokens-widget>`:this.currentTab===1?l`<w3m-account-activity-widget></w3m-account-activity-widget>`:l`<w3m-account-tokens-widget></w3m-account-tokens-widget>`}tokenBalanceTemplate(){var e;if(this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>=0){const i=y.calculateBalance(this.tokenBalance),{dollars:o="0",pennies:s="00"}=y.formatTokenBalance(i);return l`<wui-balance dollars=${o} pennies=${s}></wui-balance>`}return l`<wui-balance dollars="0" pennies="00"></wui-balance>`}tabsTemplate(){const e=Jt.getTabsByNamespace(u.state.activeChain);return e.length===0?null:l`<wui-tabs
|
|
997
|
+
.onTabChange=${this.onTabChange.bind(this)}
|
|
998
|
+
.activeTab=${this.currentTab}
|
|
999
|
+
.tabs=${e}
|
|
1000
|
+
></wui-tabs>`}onTabChange(e){u.setAccountProp("currentTab",e,this.namespace)}onFundWalletClick(){h.push("FundWallet")}onSwapClick(){var e,i,o;(e=this.network)!=null&&e.caipNetworkId&&!D.SWAP_SUPPORTED_NETWORKS.includes((i=this.network)==null?void 0:i.caipNetworkId)?h.push("UnsupportedChain",{swapUnsupportedChain:!0}):(C.sendEvent({type:"track",event:"OPEN_SWAP",properties:{network:((o=this.network)==null?void 0:o.caipNetworkId)||"",isSmartAccount:ze(u.state.activeChain)===Fe.ACCOUNT_TYPES.SMART_ACCOUNT}}),h.push("Swap"))}getAuthData(){const e=fe.getConnectedSocialProvider(),i=fe.getConnectedSocialUsername(),o=b.getAuthConnector(),s=(o==null?void 0:o.provider.getEmail())??"";return{name:Xt.getAuthName({email:s,socialUsername:i,socialProvider:e}),icon:e??"mail",iconSize:e?"xl":"md"}}onGoToProfileWalletsView(){h.push("ProfileWallets")}onSendClick(){var e;C.sendEvent({type:"track",event:"OPEN_SEND",properties:{network:((e=this.network)==null?void 0:e.caipNetworkId)||"",isSmartAccount:ze(u.state.activeChain)===Fe.ACCOUNT_TYPES.SMART_ACCOUNT}}),h.push("WalletSend")}};G.styles=yn;re([d()],G.prototype,"watchTokenBalance",void 0);re([d()],G.prototype,"network",void 0);re([d()],G.prototype,"profileName",void 0);re([d()],G.prototype,"address",void 0);re([d()],G.prototype,"currentTab",void 0);re([d()],G.prototype,"tokenBalance",void 0);re([d()],G.prototype,"features",void 0);re([d()],G.prototype,"namespace",void 0);re([d()],G.prototype,"activeConnectorIds",void 0);re([d()],G.prototype,"remoteFeatures",void 0);G=re([p("w3m-account-wallet-features-widget")],G);var Ri=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ft=class extends m{constructor(){super(),this.unsubscribe=[],this.namespace=u.state.activeChain,this.unsubscribe.push(u.subscribeKey("activeChain",e=>{this.namespace=e}))}render(){if(!this.namespace)return null;const e=b.getConnectorId(this.namespace),i=b.getAuthConnector();return l`
|
|
1001
|
+
${i&&e===S.CONNECTOR_ID.AUTH?this.walletFeaturesTemplate():this.defaultTemplate()}
|
|
1002
|
+
`}walletFeaturesTemplate(){return l`<w3m-account-wallet-features-widget></w3m-account-wallet-features-widget>`}defaultTemplate(){return l`<w3m-account-default-widget></w3m-account-default-widget>`}};Ri([d()],Ft.prototype,"namespace",void 0);Ft=Ri([p("w3m-account-view")],Ft);const xn=v`
|
|
1003
|
+
wui-image {
|
|
1004
|
+
width: 24px;
|
|
1005
|
+
height: 24px;
|
|
1006
|
+
border-radius: ${({borderRadius:t})=>t[2]};
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
wui-image,
|
|
1010
|
+
.icon-box {
|
|
1011
|
+
width: 32px;
|
|
1012
|
+
height: 32px;
|
|
1013
|
+
border-radius: ${({borderRadius:t})=>t[2]};
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
wui-icon:not(.custom-icon, .icon-badge) {
|
|
1017
|
+
cursor: pointer;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
.icon-box {
|
|
1021
|
+
position: relative;
|
|
1022
|
+
border-radius: ${({borderRadius:t})=>t[2]};
|
|
1023
|
+
background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
.icon-badge {
|
|
1027
|
+
position: absolute;
|
|
1028
|
+
top: 18px;
|
|
1029
|
+
left: 23px;
|
|
1030
|
+
z-index: 3;
|
|
1031
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
1032
|
+
border: 2px solid ${({tokens:t})=>t.theme.backgroundPrimary};
|
|
1033
|
+
border-radius: 50%;
|
|
1034
|
+
padding: ${({spacing:t})=>t["01"]};
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
.icon-badge {
|
|
1038
|
+
width: 8px;
|
|
1039
|
+
height: 8px;
|
|
1040
|
+
}
|
|
1041
|
+
`;var K=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let L=class extends m{constructor(){super(...arguments),this.address="",this.profileName="",this.content=[],this.alt="",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.iconBadge=void 0,this.iconBadgeSize="md",this.buttonVariant="neutral-primary",this.enableMoreButton=!1,this.charsStart=4,this.charsEnd=6}render(){return l`
|
|
1042
|
+
<wui-flex flexDirection="column" rowgap="2">
|
|
1043
|
+
${this.topTemplate()} ${this.bottomTemplate()}
|
|
1044
|
+
</wui-flex>
|
|
1045
|
+
`}topTemplate(){return l`
|
|
1046
|
+
<wui-flex alignItems="flex-start" justifyContent="space-between">
|
|
1047
|
+
${this.imageOrIconTemplate()}
|
|
1048
|
+
<wui-icon-link
|
|
1049
|
+
variant="secondary"
|
|
1050
|
+
size="md"
|
|
1051
|
+
icon="copy"
|
|
1052
|
+
@click=${this.dispatchCopyEvent}
|
|
1053
|
+
></wui-icon-link>
|
|
1054
|
+
<wui-icon-link
|
|
1055
|
+
variant="secondary"
|
|
1056
|
+
size="md"
|
|
1057
|
+
icon="externalLink"
|
|
1058
|
+
@click=${this.dispatchExternalLinkEvent}
|
|
1059
|
+
></wui-icon-link>
|
|
1060
|
+
${this.enableMoreButton?l`<wui-icon-link
|
|
1061
|
+
variant="secondary"
|
|
1062
|
+
size="md"
|
|
1063
|
+
icon="threeDots"
|
|
1064
|
+
@click=${this.dispatchMoreButtonEvent}
|
|
1065
|
+
data-testid="wui-active-profile-wallet-item-more-button"
|
|
1066
|
+
></wui-icon-link>`:null}
|
|
1067
|
+
</wui-flex>
|
|
1068
|
+
`}bottomTemplate(){return l` <wui-flex flexDirection="column">${this.contentTemplate()}</wui-flex> `}imageOrIconTemplate(){return this.icon?l`
|
|
1069
|
+
<wui-flex flexGrow="1" alignItems="center">
|
|
1070
|
+
<wui-flex alignItems="center" justifyContent="center" class="icon-box">
|
|
1071
|
+
<wui-icon size="lg" color="default" name=${this.icon} class="custom-icon"></wui-icon>
|
|
1072
|
+
|
|
1073
|
+
${this.iconBadge?l`<wui-icon
|
|
1074
|
+
color="accent-primary"
|
|
1075
|
+
size="inherit"
|
|
1076
|
+
name=${this.iconBadge}
|
|
1077
|
+
class="icon-badge"
|
|
1078
|
+
></wui-icon>`:null}
|
|
1079
|
+
</wui-flex>
|
|
1080
|
+
</wui-flex>
|
|
1081
|
+
`:l`
|
|
1082
|
+
<wui-flex flexGrow="1" alignItems="center">
|
|
1083
|
+
<wui-image objectFit="contain" src=${this.imageSrc} alt=${this.alt}></wui-image>
|
|
1084
|
+
</wui-flex>
|
|
1085
|
+
`}contentTemplate(){return this.content.length===0?null:l`
|
|
1086
|
+
<wui-flex flexDirection="column" rowgap="3">
|
|
1087
|
+
${this.content.map(e=>this.labelAndTagTemplate(e))}
|
|
1088
|
+
</wui-flex>
|
|
1089
|
+
`}labelAndTagTemplate({address:e,profileName:i,label:o,description:s,enableButton:n,buttonType:a,buttonLabel:r,buttonVariant:g,tagVariant:$,tagLabel:E,alignItems:_="flex-end"}){return l`
|
|
1090
|
+
<wui-flex justifyContent="space-between" alignItems=${_} columngap="1">
|
|
1091
|
+
<wui-flex flexDirection="column" rowgap="01">
|
|
1092
|
+
${o?l`<wui-text variant="sm-medium" color="secondary">${o}</wui-text>`:null}
|
|
1093
|
+
|
|
1094
|
+
<wui-flex alignItems="center" columngap="1">
|
|
1095
|
+
<wui-text variant="md-regular" color="primary">
|
|
1096
|
+
${F.getTruncateString({string:i||e,charsStart:i?16:this.charsStart,charsEnd:i?0:this.charsEnd,truncate:i?"end":"middle"})}
|
|
1097
|
+
</wui-text>
|
|
1098
|
+
|
|
1099
|
+
${$&&E?l`<wui-tag variant=${$} size="sm">${E}</wui-tag>`:null}
|
|
1100
|
+
</wui-flex>
|
|
1101
|
+
|
|
1102
|
+
${s?l`<wui-text variant="sm-regular" color="secondary">${s}</wui-text>`:null}
|
|
1103
|
+
</wui-flex>
|
|
1104
|
+
|
|
1105
|
+
${n?this.buttonTemplate({buttonType:a,buttonLabel:r,buttonVariant:g}):null}
|
|
1106
|
+
</wui-flex>
|
|
1107
|
+
`}buttonTemplate({buttonType:e,buttonLabel:i,buttonVariant:o}){return l`
|
|
1108
|
+
<wui-button
|
|
1109
|
+
size="sm"
|
|
1110
|
+
variant=${o}
|
|
1111
|
+
@click=${e==="disconnect"?this.dispatchDisconnectEvent.bind(this):this.dispatchSwitchEvent.bind(this)}
|
|
1112
|
+
data-testid=${e==="disconnect"?"wui-active-profile-wallet-item-disconnect-button":"wui-active-profile-wallet-item-switch-button"}
|
|
1113
|
+
>
|
|
1114
|
+
${i}
|
|
1115
|
+
</wui-button>
|
|
1116
|
+
`}dispatchDisconnectEvent(){this.dispatchEvent(new CustomEvent("disconnect",{bubbles:!0,composed:!0}))}dispatchSwitchEvent(){this.dispatchEvent(new CustomEvent("switch",{bubbles:!0,composed:!0}))}dispatchExternalLinkEvent(){this.dispatchEvent(new CustomEvent("externalLink",{bubbles:!0,composed:!0}))}dispatchMoreButtonEvent(){this.dispatchEvent(new CustomEvent("more",{bubbles:!0,composed:!0}))}dispatchCopyEvent(){this.dispatchEvent(new CustomEvent("copy",{bubbles:!0,composed:!0}))}};L.styles=[I,W,xn];K([c()],L.prototype,"address",void 0);K([c()],L.prototype,"profileName",void 0);K([c({type:Array})],L.prototype,"content",void 0);K([c()],L.prototype,"alt",void 0);K([c()],L.prototype,"imageSrc",void 0);K([c()],L.prototype,"icon",void 0);K([c()],L.prototype,"iconSize",void 0);K([c()],L.prototype,"iconBadge",void 0);K([c()],L.prototype,"iconBadgeSize",void 0);K([c()],L.prototype,"buttonVariant",void 0);K([c({type:Boolean})],L.prototype,"enableMoreButton",void 0);K([c({type:Number})],L.prototype,"charsStart",void 0);K([c({type:Number})],L.prototype,"charsEnd",void 0);L=K([p("wui-active-profile-wallet-item")],L);const vn=v`
|
|
1117
|
+
wui-image,
|
|
1118
|
+
.icon-box {
|
|
1119
|
+
width: 32px;
|
|
1120
|
+
height: 32px;
|
|
1121
|
+
border-radius: ${({borderRadius:t})=>t[2]};
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
.right-icon {
|
|
1125
|
+
cursor: pointer;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
.icon-box {
|
|
1129
|
+
position: relative;
|
|
1130
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
.icon-badge {
|
|
1134
|
+
position: absolute;
|
|
1135
|
+
top: 18px;
|
|
1136
|
+
left: 23px;
|
|
1137
|
+
z-index: 3;
|
|
1138
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
1139
|
+
border: 2px solid ${({tokens:t})=>t.theme.backgroundPrimary};
|
|
1140
|
+
border-radius: 50%;
|
|
1141
|
+
padding: ${({spacing:t})=>t["01"]};
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
.icon-badge {
|
|
1145
|
+
width: 8px;
|
|
1146
|
+
height: 8px;
|
|
1147
|
+
}
|
|
1148
|
+
`;var j=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let R=class extends m{constructor(){super(...arguments),this.address="",this.profileName="",this.alt="",this.buttonLabel="",this.buttonVariant="accent-primary",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.iconBadgeSize="md",this.rightIcon="signOut",this.rightIconSize="md",this.loading=!1,this.charsStart=4,this.charsEnd=6}render(){return l`
|
|
1149
|
+
<wui-flex alignItems="center" columngap="2">
|
|
1150
|
+
${this.imageOrIconTemplate()} ${this.labelAndDescriptionTemplate()}
|
|
1151
|
+
${this.buttonActionTemplate()}
|
|
1152
|
+
</wui-flex>
|
|
1153
|
+
`}imageOrIconTemplate(){return this.icon?l`
|
|
1154
|
+
<wui-flex alignItems="center" justifyContent="center" class="icon-box">
|
|
1155
|
+
<wui-flex alignItems="center" justifyContent="center" class="icon-box">
|
|
1156
|
+
<wui-icon size="lg" color="default" name=${this.icon} class="custom-icon"></wui-icon>
|
|
1157
|
+
|
|
1158
|
+
${this.iconBadge?l`<wui-icon
|
|
1159
|
+
color="default"
|
|
1160
|
+
size="inherit"
|
|
1161
|
+
name=${this.iconBadge}
|
|
1162
|
+
class="icon-badge"
|
|
1163
|
+
></wui-icon>`:null}
|
|
1164
|
+
</wui-flex>
|
|
1165
|
+
</wui-flex>
|
|
1166
|
+
`:l`<wui-image objectFit="contain" src=${this.imageSrc} alt=${this.alt}></wui-image>`}labelAndDescriptionTemplate(){return l`
|
|
1167
|
+
<wui-flex
|
|
1168
|
+
flexDirection="column"
|
|
1169
|
+
flexGrow="1"
|
|
1170
|
+
justifyContent="flex-start"
|
|
1171
|
+
alignItems="flex-start"
|
|
1172
|
+
>
|
|
1173
|
+
<wui-text variant="lg-regular" color="primary">
|
|
1174
|
+
${F.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?16:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"})}
|
|
1175
|
+
</wui-text>
|
|
1176
|
+
</wui-flex>
|
|
1177
|
+
`}buttonActionTemplate(){return l`
|
|
1178
|
+
<wui-flex columngap="1" alignItems="center" justifyContent="center">
|
|
1179
|
+
<wui-button
|
|
1180
|
+
size="sm"
|
|
1181
|
+
variant=${this.buttonVariant}
|
|
1182
|
+
.loading=${this.loading}
|
|
1183
|
+
@click=${this.handleButtonClick}
|
|
1184
|
+
data-testid="wui-inactive-profile-wallet-item-button"
|
|
1185
|
+
>
|
|
1186
|
+
${this.buttonLabel}
|
|
1187
|
+
</wui-button>
|
|
1188
|
+
|
|
1189
|
+
<wui-icon-link
|
|
1190
|
+
variant="secondary"
|
|
1191
|
+
size="md"
|
|
1192
|
+
icon=${w(this.rightIcon)}
|
|
1193
|
+
class="right-icon"
|
|
1194
|
+
@click=${this.handleIconClick}
|
|
1195
|
+
></wui-icon-link>
|
|
1196
|
+
</wui-flex>
|
|
1197
|
+
`}handleButtonClick(){this.dispatchEvent(new CustomEvent("buttonClick",{bubbles:!0,composed:!0}))}handleIconClick(){this.dispatchEvent(new CustomEvent("iconClick",{bubbles:!0,composed:!0}))}};R.styles=[I,W,vn];j([c()],R.prototype,"address",void 0);j([c()],R.prototype,"profileName",void 0);j([c()],R.prototype,"alt",void 0);j([c()],R.prototype,"buttonLabel",void 0);j([c()],R.prototype,"buttonVariant",void 0);j([c()],R.prototype,"imageSrc",void 0);j([c()],R.prototype,"icon",void 0);j([c()],R.prototype,"iconSize",void 0);j([c()],R.prototype,"iconBadge",void 0);j([c()],R.prototype,"iconBadgeSize",void 0);j([c()],R.prototype,"rightIcon",void 0);j([c()],R.prototype,"rightIconSize",void 0);j([c({type:Boolean})],R.prototype,"loading",void 0);j([c({type:Number})],R.prototype,"charsStart",void 0);j([c({type:Number})],R.prototype,"charsEnd",void 0);R=j([p("wui-inactive-profile-wallet-item")],R);const jt={getAuthData(t){var a,r;const e=t.connectorId===S.CONNECTOR_ID.AUTH;if(!e)return{isAuth:!1,icon:void 0,iconSize:void 0,name:void 0};const i=((a=t==null?void 0:t.auth)==null?void 0:a.name)??fe.getConnectedSocialProvider(),o=((r=t==null?void 0:t.auth)==null?void 0:r.username)??fe.getConnectedSocialUsername(),s=b.getAuthConnector(),n=(s==null?void 0:s.provider.getEmail())??"";return{isAuth:!0,icon:i??"mail",iconSize:i?"xl":"md",name:e?Xt.getAuthName({email:n,socialUsername:o,socialProvider:i}):void 0}}},$n=v`
|
|
1198
|
+
:host {
|
|
1199
|
+
--connect-scroll--top-opacity: 0;
|
|
1200
|
+
--connect-scroll--bottom-opacity: 0;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
.balance-amount {
|
|
1204
|
+
flex: 1;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
.wallet-list {
|
|
1208
|
+
scrollbar-width: none;
|
|
1209
|
+
overflow-y: scroll;
|
|
1210
|
+
overflow-x: hidden;
|
|
1211
|
+
transition: opacity ${({easings:t})=>t["ease-out-power-1"]}
|
|
1212
|
+
${({durations:t})=>t.md};
|
|
1213
|
+
will-change: opacity;
|
|
1214
|
+
mask-image: linear-gradient(
|
|
1215
|
+
to bottom,
|
|
1216
|
+
rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px,
|
|
1217
|
+
rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px,
|
|
1218
|
+
black 40px,
|
|
1219
|
+
black calc(100% - 40px),
|
|
1220
|
+
rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px),
|
|
1221
|
+
rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100%
|
|
1222
|
+
);
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
.active-wallets {
|
|
1226
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
1227
|
+
border-radius: ${({borderRadius:t})=>t[4]};
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
.active-wallets-box {
|
|
1231
|
+
height: 330px;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
.empty-wallet-list-box {
|
|
1235
|
+
height: 400px;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
.empty-box {
|
|
1239
|
+
width: 100%;
|
|
1240
|
+
padding: ${({spacing:t})=>t[4]};
|
|
1241
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
1242
|
+
border-radius: ${({borderRadius:t})=>t[4]};
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
wui-separator {
|
|
1246
|
+
margin: ${({spacing:t})=>t[2]} 0 ${({spacing:t})=>t[2]} 0;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
.active-connection {
|
|
1250
|
+
padding: ${({spacing:t})=>t[2]};
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
.recent-connection {
|
|
1254
|
+
padding: ${({spacing:t})=>t[2]} 0 ${({spacing:t})=>t[2]} 0;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
@media (max-width: 430px) {
|
|
1258
|
+
.active-wallets-box,
|
|
1259
|
+
.empty-wallet-list-box {
|
|
1260
|
+
height: auto;
|
|
1261
|
+
max-height: clamp(360px, 470px, 80vh);
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
`;var X=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Y={ADDRESS_DISPLAY:{START:4,END:6},BADGE:{SIZE:"md",ICON:"lightbulb"},SCROLL_THRESHOLD:50,OPACITY_RANGE:[0,1]},Ue={eip155:"ethereum",solana:"solana",bip122:"bitcoin",ton:"ton"},Cn=[{namespace:"eip155",icon:Ue.eip155,label:"EVM"},{namespace:"solana",icon:Ue.solana,label:"Solana"},{namespace:"bip122",icon:Ue.bip122,label:"Bitcoin"},{namespace:"ton",icon:Ue.ton,label:"Ton"}],Tn={eip155:{title:"Add EVM Wallet",description:"Add your first EVM wallet"},solana:{title:"Add Solana Wallet",description:"Add your first Solana wallet"},bip122:{title:"Add Bitcoin Wallet",description:"Add your first Bitcoin wallet"},ton:{title:"Add TON Wallet",description:"Add your first TON wallet"}};let B=class extends m{constructor(){var e,i,o;super(),this.unsubscribers=[],this.currentTab=0,this.namespace=u.state.activeChain,this.namespaces=Array.from(u.state.chains.keys()),this.caipAddress=void 0,this.profileName=void 0,this.activeConnectorIds=b.state.activeConnectorIds,this.lastSelectedAddress="",this.lastSelectedConnectorId="",this.isSwitching=!1,this.caipNetwork=u.state.activeCaipNetwork,this.user=(e=u.getAccountData())==null?void 0:e.user,this.remoteFeatures=f.state.remoteFeatures,this.currentTab=this.namespace?this.namespaces.indexOf(this.namespace):0,this.caipAddress=(i=u.getAccountData(this.namespace))==null?void 0:i.caipAddress,this.profileName=(o=u.getAccountData(this.namespace))==null?void 0:o.profileName,this.unsubscribers.push(x.subscribeKey("connections",()=>this.onConnectionsChange()),x.subscribeKey("recentConnections",()=>this.requestUpdate()),b.subscribeKey("activeConnectorIds",s=>{this.activeConnectorIds=s}),u.subscribeKey("activeCaipNetwork",s=>this.caipNetwork=s),u.subscribeChainProp("accountState",s=>{this.user=s==null?void 0:s.user}),f.subscribeKey("remoteFeatures",s=>this.remoteFeatures=s)),this.chainListener=u.subscribeChainProp("accountState",s=>{this.caipAddress=s==null?void 0:s.caipAddress,this.profileName=s==null?void 0:s.profileName},this.namespace)}disconnectedCallback(){var e,i;this.unsubscribers.forEach(o=>o()),(e=this.resizeObserver)==null||e.disconnect(),this.removeScrollListener(),(i=this.chainListener)==null||i.call(this)}firstUpdated(){var o;const e=(o=this.shadowRoot)==null?void 0:o.querySelector(".wallet-list");if(!e)return;const i=()=>this.updateScrollOpacity(e);requestAnimationFrame(i),e.addEventListener("scroll",i),this.resizeObserver=new ResizeObserver(i),this.resizeObserver.observe(e),i()}render(){const e=this.namespace;if(!e)throw new Error("Namespace is not set");return l`
|
|
1265
|
+
<wui-flex flexDirection="column" .padding=${["0","4","4","4"]} gap="4">
|
|
1266
|
+
${this.renderTabs()} ${this.renderHeader(e)} ${this.renderConnections(e)}
|
|
1267
|
+
${this.renderAddConnectionButton(e)}
|
|
1268
|
+
</wui-flex>
|
|
1269
|
+
`}renderTabs(){const e=this.namespaces.map(o=>Cn.find(s=>s.namespace===o)).filter(Boolean);return e.length>1?l`
|
|
1270
|
+
<wui-tabs
|
|
1271
|
+
.onTabChange=${o=>this.handleTabChange(o)}
|
|
1272
|
+
.activeTab=${this.currentTab}
|
|
1273
|
+
.tabs=${e}
|
|
1274
|
+
></wui-tabs>
|
|
1275
|
+
`:null}renderHeader(e){const o=this.getActiveConnections(e).flatMap(({accounts:s})=>s).length+(this.caipAddress?1:0);return l`
|
|
1276
|
+
<wui-flex alignItems="center" columngap="1">
|
|
1277
|
+
<wui-icon
|
|
1278
|
+
size="sm"
|
|
1279
|
+
name=${Ue[e]??Ue.eip155}
|
|
1280
|
+
></wui-icon>
|
|
1281
|
+
<wui-text color="secondary" variant="lg-regular"
|
|
1282
|
+
>${o>1?"Wallets":"Wallet"}</wui-text
|
|
1283
|
+
>
|
|
1284
|
+
<wui-text
|
|
1285
|
+
color="primary"
|
|
1286
|
+
variant="lg-regular"
|
|
1287
|
+
class="balance-amount"
|
|
1288
|
+
data-testid="balance-amount"
|
|
1289
|
+
>
|
|
1290
|
+
${o}
|
|
1291
|
+
</wui-text>
|
|
1292
|
+
<wui-link
|
|
1293
|
+
color="secondary"
|
|
1294
|
+
variant="secondary"
|
|
1295
|
+
@click=${()=>x.disconnect({namespace:e})}
|
|
1296
|
+
?disabled=${!this.hasAnyConnections(e)}
|
|
1297
|
+
data-testid="disconnect-all-button"
|
|
1298
|
+
>
|
|
1299
|
+
Disconnect All
|
|
1300
|
+
</wui-link>
|
|
1301
|
+
</wui-flex>
|
|
1302
|
+
`}renderConnections(e){const i=this.hasAnyConnections(e);return l`
|
|
1303
|
+
<wui-flex flexDirection="column" class=${Ii({"wallet-list":!0,"active-wallets-box":i,"empty-wallet-list-box":!i})} rowgap="3">
|
|
1304
|
+
${i?this.renderActiveConnections(e):this.renderEmptyState(e)}
|
|
1305
|
+
</wui-flex>
|
|
1306
|
+
`}renderActiveConnections(e){const i=this.getActiveConnections(e),o=this.activeConnectorIds[e],s=this.getPlainAddress();return l`
|
|
1307
|
+
${s||o||i.length>0?l`<wui-flex
|
|
1308
|
+
flexDirection="column"
|
|
1309
|
+
.padding=${["4","0","4","0"]}
|
|
1310
|
+
class="active-wallets"
|
|
1311
|
+
>
|
|
1312
|
+
${this.renderActiveProfile(e)} ${this.renderActiveConnectionsList(e)}
|
|
1313
|
+
</wui-flex>`:null}
|
|
1314
|
+
${this.renderRecentConnections(e)}
|
|
1315
|
+
`}renderActiveProfile(e){const i=this.activeConnectorIds[e];if(!i)return null;const{connections:o}=he.getConnectionsData(e),s=b.getConnectorById(i),n=T.getConnectorImage(s),a=this.getPlainAddress();if(!a)return null;const r=e===S.CHAIN.BITCOIN,g=jt.getAuthData({connectorId:i,accounts:[]}),$=this.getActiveConnections(e).flatMap(O=>O.accounts).length>0,E=o.find(O=>O.connectorId===i),_=E==null?void 0:E.accounts.filter(O=>!J.isLowerCaseMatch(O.address,a));return l`
|
|
1316
|
+
<wui-flex flexDirection="column" .padding=${["0","4","0","4"]}>
|
|
1317
|
+
<wui-active-profile-wallet-item
|
|
1318
|
+
address=${a}
|
|
1319
|
+
alt=${s==null?void 0:s.name}
|
|
1320
|
+
.content=${this.getProfileContent({address:a,connections:o,connectorId:i,namespace:e})}
|
|
1321
|
+
.charsStart=${Y.ADDRESS_DISPLAY.START}
|
|
1322
|
+
.charsEnd=${Y.ADDRESS_DISPLAY.END}
|
|
1323
|
+
.icon=${g.icon}
|
|
1324
|
+
.iconSize=${g.iconSize}
|
|
1325
|
+
.iconBadge=${this.isSmartAccount(a)?Y.BADGE.ICON:void 0}
|
|
1326
|
+
.iconBadgeSize=${this.isSmartAccount(a)?Y.BADGE.SIZE:void 0}
|
|
1327
|
+
imageSrc=${n}
|
|
1328
|
+
?enableMoreButton=${g.isAuth}
|
|
1329
|
+
@copy=${()=>this.handleCopyAddress(a)}
|
|
1330
|
+
@disconnect=${()=>this.handleDisconnect(e,i)}
|
|
1331
|
+
@switch=${()=>{r&&E&&(_!=null&&_[0])&&this.handleSwitchWallet(E,_[0].address,e)}}
|
|
1332
|
+
@externalLink=${()=>this.handleExternalLink(a)}
|
|
1333
|
+
@more=${()=>this.handleMore()}
|
|
1334
|
+
data-testid="wui-active-profile-wallet-item"
|
|
1335
|
+
></wui-active-profile-wallet-item>
|
|
1336
|
+
${$?l`<wui-separator></wui-separator>`:null}
|
|
1337
|
+
</wui-flex>
|
|
1338
|
+
`}renderActiveConnectionsList(e){const i=this.getActiveConnections(e);return i.length===0?null:l`
|
|
1339
|
+
<wui-flex flexDirection="column" .padding=${["0","2","0","2"]}>
|
|
1340
|
+
${this.renderConnectionList(i,!1,e)}
|
|
1341
|
+
</wui-flex>
|
|
1342
|
+
`}renderRecentConnections(e){const{recentConnections:i}=he.getConnectionsData(e);return i.flatMap(s=>s.accounts).length===0?null:l`
|
|
1343
|
+
<wui-flex flexDirection="column" .padding=${["0","2","0","2"]} rowGap="2">
|
|
1344
|
+
<wui-text color="secondary" variant="sm-medium" data-testid="recently-connected-text"
|
|
1345
|
+
>RECENTLY CONNECTED</wui-text
|
|
1346
|
+
>
|
|
1347
|
+
<wui-flex flexDirection="column" .padding=${["0","2","0","2"]}>
|
|
1348
|
+
${this.renderConnectionList(i,!0,e)}
|
|
1349
|
+
</wui-flex>
|
|
1350
|
+
</wui-flex>
|
|
1351
|
+
`}renderConnectionList(e,i,o){return e.filter(s=>s.accounts.length>0).map((s,n)=>{const a=b.getConnectorById(s.connectorId),r=T.getConnectorImage(a)??"",g=jt.getAuthData(s);return s.accounts.map(($,E)=>{const _=n!==0||E!==0,O=this.isAccountLoading(s.connectorId,$.address);return l`
|
|
1352
|
+
<wui-flex flexDirection="column">
|
|
1353
|
+
${_?l`<wui-separator></wui-separator>`:null}
|
|
1354
|
+
<wui-inactive-profile-wallet-item
|
|
1355
|
+
address=${$.address}
|
|
1356
|
+
alt=${s.connectorId}
|
|
1357
|
+
buttonLabel=${i?"Connect":"Switch"}
|
|
1358
|
+
buttonVariant=${i?"neutral-secondary":"accent-secondary"}
|
|
1359
|
+
rightIcon=${i?"bin":"power"}
|
|
1360
|
+
rightIconSize="sm"
|
|
1361
|
+
class=${i?"recent-connection":"active-connection"}
|
|
1362
|
+
data-testid=${i?"recent-connection":"active-connection"}
|
|
1363
|
+
imageSrc=${r}
|
|
1364
|
+
.iconBadge=${this.isSmartAccount($.address)?Y.BADGE.ICON:void 0}
|
|
1365
|
+
.iconBadgeSize=${this.isSmartAccount($.address)?Y.BADGE.SIZE:void 0}
|
|
1366
|
+
.icon=${g.icon}
|
|
1367
|
+
.iconSize=${g.iconSize}
|
|
1368
|
+
.loading=${O}
|
|
1369
|
+
.showBalance=${!1}
|
|
1370
|
+
.charsStart=${Y.ADDRESS_DISPLAY.START}
|
|
1371
|
+
.charsEnd=${Y.ADDRESS_DISPLAY.END}
|
|
1372
|
+
@buttonClick=${()=>this.handleSwitchWallet(s,$.address,o)}
|
|
1373
|
+
@iconClick=${()=>this.handleWalletAction({connection:s,address:$.address,isRecentConnection:i,namespace:o})}
|
|
1374
|
+
></wui-inactive-profile-wallet-item>
|
|
1375
|
+
</wui-flex>
|
|
1376
|
+
`})})}renderAddConnectionButton(e){if(!this.isMultiWalletEnabled()&&this.caipAddress||!this.hasAnyConnections(e))return null;const{title:i}=this.getChainLabelInfo(e);return l`
|
|
1377
|
+
<wui-list-item
|
|
1378
|
+
variant="icon"
|
|
1379
|
+
iconVariant="overlay"
|
|
1380
|
+
icon="plus"
|
|
1381
|
+
iconSize="sm"
|
|
1382
|
+
?chevron=${!0}
|
|
1383
|
+
@click=${()=>this.handleAddConnection(e)}
|
|
1384
|
+
data-testid="add-connection-button"
|
|
1385
|
+
>
|
|
1386
|
+
<wui-text variant="md-medium" color="secondary">${i}</wui-text>
|
|
1387
|
+
</wui-list-item>
|
|
1388
|
+
`}renderEmptyState(e){const{title:i,description:o}=this.getChainLabelInfo(e);return l`
|
|
1389
|
+
<wui-flex alignItems="flex-start" class="empty-template" data-testid="empty-template">
|
|
1390
|
+
<wui-flex
|
|
1391
|
+
flexDirection="column"
|
|
1392
|
+
alignItems="center"
|
|
1393
|
+
justifyContent="center"
|
|
1394
|
+
rowgap="3"
|
|
1395
|
+
class="empty-box"
|
|
1396
|
+
>
|
|
1397
|
+
<wui-icon-box size="xl" icon="wallet" color="secondary"></wui-icon-box>
|
|
1398
|
+
|
|
1399
|
+
<wui-flex flexDirection="column" alignItems="center" justifyContent="center" gap="1">
|
|
1400
|
+
<wui-text color="primary" variant="lg-regular" data-testid="empty-state-text"
|
|
1401
|
+
>No wallet connected</wui-text
|
|
1402
|
+
>
|
|
1403
|
+
<wui-text color="secondary" variant="md-regular" data-testid="empty-state-description"
|
|
1404
|
+
>${o}</wui-text
|
|
1405
|
+
>
|
|
1406
|
+
</wui-flex>
|
|
1407
|
+
|
|
1408
|
+
<wui-link
|
|
1409
|
+
@click=${()=>this.handleAddConnection(e)}
|
|
1410
|
+
data-testid="empty-state-button"
|
|
1411
|
+
icon="plus"
|
|
1412
|
+
>
|
|
1413
|
+
${i}
|
|
1414
|
+
</wui-link>
|
|
1415
|
+
</wui-flex>
|
|
1416
|
+
</wui-flex>
|
|
1417
|
+
`}handleTabChange(e){var o,s,n;const i=this.namespaces[e];i&&((o=this.chainListener)==null||o.call(this),this.currentTab=this.namespaces.indexOf(i),this.namespace=i,this.caipAddress=(s=u.getAccountData(i))==null?void 0:s.caipAddress,this.profileName=(n=u.getAccountData(i))==null?void 0:n.profileName,this.chainListener=u.subscribeChainProp("accountState",a=>{this.caipAddress=a==null?void 0:a.caipAddress},i))}async handleSwitchWallet(e,i,o){var s;try{this.isSwitching=!0,this.lastSelectedConnectorId=e.connectorId,this.lastSelectedAddress=i,((s=this.caipNetwork)==null?void 0:s.chainNamespace)!==o&&(e!=null&&e.caipNetwork)&&(b.setFilterByNamespace(o),await u.switchActiveNetwork(e==null?void 0:e.caipNetwork)),await x.switchConnection({connection:e,address:i,namespace:o,closeModalOnConnect:!1,onChange({hasSwitchedAccount:a,hasSwitchedWallet:r}){r?k.showSuccess("Wallet switched"):a&&k.showSuccess("Account switched")}})}catch{k.showError("Failed to switch wallet")}finally{this.isSwitching=!1}}handleWalletAction(e){const{connection:i,address:o,isRecentConnection:s,namespace:n}=e;s?(fe.deleteAddressFromConnection({connectorId:i.connectorId,address:o,namespace:n}),x.syncStorageConnections(),k.showSuccess("Wallet deleted")):this.handleDisconnect(n,i.connectorId)}async handleDisconnect(e,i){try{await x.disconnect({id:i,namespace:e}),k.showSuccess("Wallet disconnected")}catch{k.showError("Failed to disconnect wallet")}}handleCopyAddress(e){y.copyToClopboard(e),k.showSuccess("Address copied")}handleMore(){h.push("AccountSettings")}handleExternalLink(e){var o,s;const i=(s=(o=this.caipNetwork)==null?void 0:o.blockExplorers)==null?void 0:s.default.url;i&&y.openHref(`${i}/address/${e}`,"_blank")}handleAddConnection(e){b.setFilterByNamespace(e),h.push("Connect",{addWalletForNamespace:e})}getChainLabelInfo(e){return Tn[e]??{title:"Add Wallet",description:"Add your first wallet"}}isSmartAccount(e){var o,s;if(!this.namespace)return!1;const i=(s=(o=this.user)==null?void 0:o.accounts)==null?void 0:s.find(n=>n.type==="smartAccount");return i&&e?J.isLowerCaseMatch(i.address,e):!1}getPlainAddress(){return this.caipAddress?y.getPlainAddress(this.caipAddress):void 0}getActiveConnections(e){const i=this.activeConnectorIds[e],{connections:o}=he.getConnectionsData(e),[s]=o.filter(g=>J.isLowerCaseMatch(g.connectorId,i));if(!i)return o;const n=e===S.CHAIN.BITCOIN,{address:a}=this.caipAddress?Hi.parseCaipAddress(this.caipAddress):{};let r=[...a?[a]:[]];return n&&s&&(r=s.accounts.map(g=>g.address)||[]),he.excludeConnectorAddressFromConnections({connectorId:i,addresses:r,connections:o})}hasAnyConnections(e){const i=this.getActiveConnections(e),{recentConnections:o}=he.getConnectionsData(e);return!!this.caipAddress||i.length>0||o.length>0}isAccountLoading(e,i){return J.isLowerCaseMatch(this.lastSelectedConnectorId,e)&&J.isLowerCaseMatch(this.lastSelectedAddress,i)&&this.isSwitching}getProfileContent(e){const{address:i,connections:o,connectorId:s,namespace:n}=e,[a]=o.filter(g=>J.isLowerCaseMatch(g.connectorId,s));if(n===S.CHAIN.BITCOIN&&(a!=null&&a.accounts.every(g=>typeof g.type=="string")))return this.getBitcoinProfileContent(a.accounts,i);const r=jt.getAuthData({connectorId:s,accounts:[]});return[{address:i,tagLabel:"Active",tagVariant:"success",enableButton:!0,profileName:this.profileName,buttonType:"disconnect",buttonLabel:"Disconnect",buttonVariant:"neutral-secondary",...r.isAuth?{description:this.isSmartAccount(i)?"Smart Account":"EOA Account"}:{}}]}getBitcoinProfileContent(e,i){const o=e.length>1,s=this.getPlainAddress();return e.map(n=>{const a=J.isLowerCaseMatch(n.address,s);let r="PAYMENT";return n.type==="ordinal"&&(r="ORDINALS"),{address:n.address,tagLabel:J.isLowerCaseMatch(n.address,i)?"Active":void 0,tagVariant:J.isLowerCaseMatch(n.address,i)?"success":void 0,enableButton:!0,...o?{label:r,alignItems:"flex-end",buttonType:a?"disconnect":"switch",buttonLabel:a?"Disconnect":"Switch",buttonVariant:a?"neutral-secondary":"accent-secondary"}:{alignItems:"center",buttonType:"disconnect",buttonLabel:"Disconnect",buttonVariant:"neutral-secondary"}}})}removeScrollListener(){var i;const e=(i=this.shadowRoot)==null?void 0:i.querySelector(".wallet-list");e&&e.removeEventListener("scroll",()=>this.handleConnectListScroll())}handleConnectListScroll(){var i;const e=(i=this.shadowRoot)==null?void 0:i.querySelector(".wallet-list");e&&this.updateScrollOpacity(e)}isMultiWalletEnabled(){var e;return!!((e=this.remoteFeatures)!=null&&e.multiWallet)}updateScrollOpacity(e){e.style.setProperty("--connect-scroll--top-opacity",ft.interpolate([0,Y.SCROLL_THRESHOLD],Y.OPACITY_RANGE,e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",ft.interpolate([0,Y.SCROLL_THRESHOLD],Y.OPACITY_RANGE,e.scrollHeight-e.scrollTop-e.offsetHeight).toString())}onConnectionsChange(){if(this.isMultiWalletEnabled()&&this.namespace){const{connections:e}=he.getConnectionsData(this.namespace);e.length===0&&h.reset("ProfileWallets")}this.requestUpdate()}};B.styles=$n;X([d()],B.prototype,"currentTab",void 0);X([d()],B.prototype,"namespace",void 0);X([d()],B.prototype,"namespaces",void 0);X([d()],B.prototype,"caipAddress",void 0);X([d()],B.prototype,"profileName",void 0);X([d()],B.prototype,"activeConnectorIds",void 0);X([d()],B.prototype,"lastSelectedAddress",void 0);X([d()],B.prototype,"lastSelectedConnectorId",void 0);X([d()],B.prototype,"isSwitching",void 0);X([d()],B.prototype,"caipNetwork",void 0);X([d()],B.prototype,"user",void 0);X([d()],B.prototype,"remoteFeatures",void 0);B=X([p("w3m-profile-wallets-view")],B);var Ye=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let _e=class extends m{constructor(){super(),this.unsubscribe=[],this.activeCaipNetwork=u.state.activeCaipNetwork,this.features=f.state.features,this.remoteFeatures=f.state.remoteFeatures,this.exchangesLoading=Q.state.isLoading,this.exchanges=Q.state.exchanges,this.unsubscribe.push(f.subscribeKey("features",e=>this.features=e),f.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e),u.subscribeKey("activeCaipNetwork",e=>{this.activeCaipNetwork=e,this.setDefaultPaymentAsset()}),Q.subscribeKey("isLoading",e=>this.exchangesLoading=e),Q.subscribeKey("exchanges",e=>this.exchanges=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}async firstUpdated(){Q.isPayWithExchangeSupported()&&(await this.setDefaultPaymentAsset(),await Q.fetchExchanges())}render(){return l`
|
|
1418
|
+
<wui-flex flexDirection="column" .padding=${["1","3","3","3"]} gap="2">
|
|
1419
|
+
${this.onrampTemplate()} ${this.receiveTemplate()} ${this.depositFromExchangeTemplate()}
|
|
1420
|
+
</wui-flex>
|
|
1421
|
+
`}async setDefaultPaymentAsset(){if(!this.activeCaipNetwork)return;const e=await Q.getAssetsForNetwork(this.activeCaipNetwork.caipNetworkId),i=e.find(o=>o.metadata.symbol==="USDC")||e[0];i&&Q.setPaymentAsset(i)}onrampTemplate(){var o;if(!this.activeCaipNetwork)return null;const e=(o=this.remoteFeatures)==null?void 0:o.onramp,i=D.ONRAMP_SUPPORTED_CHAIN_NAMESPACES.includes(this.activeCaipNetwork.chainNamespace);return!e||!i?null:l`
|
|
1422
|
+
<wui-list-item
|
|
1423
|
+
@click=${this.onBuyCrypto.bind(this)}
|
|
1424
|
+
icon="card"
|
|
1425
|
+
data-testid="wallet-features-onramp-button"
|
|
1426
|
+
>
|
|
1427
|
+
<wui-text variant="lg-regular" color="primary">Buy crypto</wui-text>
|
|
1428
|
+
</wui-list-item>
|
|
1429
|
+
`}depositFromExchangeTemplate(){return!this.activeCaipNetwork||!Q.isPayWithExchangeSupported()?null:l`
|
|
1430
|
+
<wui-list-item
|
|
1431
|
+
@click=${this.onDepositFromExchange.bind(this)}
|
|
1432
|
+
icon="arrowBottomCircle"
|
|
1433
|
+
data-testid="wallet-features-deposit-from-exchange-button"
|
|
1434
|
+
?loading=${this.exchangesLoading}
|
|
1435
|
+
?disabled=${this.exchangesLoading||!this.exchanges.length}
|
|
1436
|
+
>
|
|
1437
|
+
<wui-text variant="lg-regular" color="primary">Deposit from exchange</wui-text>
|
|
1438
|
+
</wui-list-item>
|
|
1439
|
+
`}receiveTemplate(){var i;return!((i=this.features)!=null&&i.receive)?null:l`
|
|
1440
|
+
<wui-list-item
|
|
1441
|
+
@click=${this.onReceive.bind(this)}
|
|
1442
|
+
icon="qrCode"
|
|
1443
|
+
data-testid="wallet-features-receive-button"
|
|
1444
|
+
>
|
|
1445
|
+
<wui-text variant="lg-regular" color="primary">Receive funds</wui-text>
|
|
1446
|
+
</wui-list-item>
|
|
1447
|
+
`}onBuyCrypto(){h.push("OnRampProviders")}onReceive(){h.push("WalletReceive")}onDepositFromExchange(){var e;Q.reset(),h.push("PayWithExchange",{redirectView:(e=h.state.data)==null?void 0:e.redirectView})}};Ye([d()],_e.prototype,"activeCaipNetwork",void 0);Ye([d()],_e.prototype,"features",void 0);Ye([d()],_e.prototype,"remoteFeatures",void 0);Ye([d()],_e.prototype,"exchangesLoading",void 0);Ye([d()],_e.prototype,"exchanges",void 0);_e=Ye([p("w3m-fund-wallet-view")],_e);const Sn=v`
|
|
1448
|
+
:host {
|
|
1449
|
+
display: flex;
|
|
1450
|
+
align-items: center;
|
|
1451
|
+
justify-content: center;
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
label {
|
|
1455
|
+
position: relative;
|
|
1456
|
+
display: inline-block;
|
|
1457
|
+
user-select: none;
|
|
1458
|
+
transition:
|
|
1459
|
+
background-color ${({durations:t})=>t.lg}
|
|
1460
|
+
${({easings:t})=>t["ease-out-power-2"]},
|
|
1461
|
+
color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
|
|
1462
|
+
border ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
|
|
1463
|
+
box-shadow ${({durations:t})=>t.lg}
|
|
1464
|
+
${({easings:t})=>t["ease-out-power-2"]},
|
|
1465
|
+
width ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
|
|
1466
|
+
height ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
|
|
1467
|
+
transform ${({durations:t})=>t.lg}
|
|
1468
|
+
${({easings:t})=>t["ease-out-power-2"]},
|
|
1469
|
+
opacity ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]};
|
|
1470
|
+
will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
input {
|
|
1474
|
+
width: 0;
|
|
1475
|
+
height: 0;
|
|
1476
|
+
opacity: 0;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
span {
|
|
1480
|
+
position: absolute;
|
|
1481
|
+
cursor: pointer;
|
|
1482
|
+
top: 0;
|
|
1483
|
+
left: 0;
|
|
1484
|
+
right: 0;
|
|
1485
|
+
bottom: 0;
|
|
1486
|
+
background-color: ${({colors:t})=>t.neutrals300};
|
|
1487
|
+
border-radius: ${({borderRadius:t})=>t.round};
|
|
1488
|
+
border: 1px solid transparent;
|
|
1489
|
+
will-change: border;
|
|
1490
|
+
transition:
|
|
1491
|
+
background-color ${({durations:t})=>t.lg}
|
|
1492
|
+
${({easings:t})=>t["ease-out-power-2"]},
|
|
1493
|
+
color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
|
|
1494
|
+
border ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
|
|
1495
|
+
box-shadow ${({durations:t})=>t.lg}
|
|
1496
|
+
${({easings:t})=>t["ease-out-power-2"]},
|
|
1497
|
+
width ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
|
|
1498
|
+
height ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
|
|
1499
|
+
transform ${({durations:t})=>t.lg}
|
|
1500
|
+
${({easings:t})=>t["ease-out-power-2"]},
|
|
1501
|
+
opacity ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]};
|
|
1502
|
+
will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
span:before {
|
|
1506
|
+
content: '';
|
|
1507
|
+
position: absolute;
|
|
1508
|
+
background-color: ${({colors:t})=>t.white};
|
|
1509
|
+
border-radius: 50%;
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
/* -- Sizes --------------------------------------------------------- */
|
|
1513
|
+
label[data-size='lg'] {
|
|
1514
|
+
width: 48px;
|
|
1515
|
+
height: 32px;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
label[data-size='md'] {
|
|
1519
|
+
width: 40px;
|
|
1520
|
+
height: 28px;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
label[data-size='sm'] {
|
|
1524
|
+
width: 32px;
|
|
1525
|
+
height: 22px;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
label[data-size='lg'] > span:before {
|
|
1529
|
+
height: 24px;
|
|
1530
|
+
width: 24px;
|
|
1531
|
+
left: 4px;
|
|
1532
|
+
top: 3px;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
label[data-size='md'] > span:before {
|
|
1536
|
+
height: 20px;
|
|
1537
|
+
width: 20px;
|
|
1538
|
+
left: 4px;
|
|
1539
|
+
top: 3px;
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
label[data-size='sm'] > span:before {
|
|
1543
|
+
height: 16px;
|
|
1544
|
+
width: 16px;
|
|
1545
|
+
left: 3px;
|
|
1546
|
+
top: 2px;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
/* -- Focus states --------------------------------------------------- */
|
|
1550
|
+
input:focus-visible:not(:checked) + span,
|
|
1551
|
+
input:focus:not(:checked) + span {
|
|
1552
|
+
border: 1px solid ${({tokens:t})=>t.core.iconAccentPrimary};
|
|
1553
|
+
background-color: ${({tokens:t})=>t.theme.textTertiary};
|
|
1554
|
+
box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
input:focus-visible:checked + span,
|
|
1558
|
+
input:focus:checked + span {
|
|
1559
|
+
border: 1px solid ${({tokens:t})=>t.core.iconAccentPrimary};
|
|
1560
|
+
box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
/* -- Checked states --------------------------------------------------- */
|
|
1564
|
+
input:checked + span {
|
|
1565
|
+
background-color: ${({tokens:t})=>t.core.iconAccentPrimary};
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
label[data-size='lg'] > input:checked + span:before {
|
|
1569
|
+
transform: translateX(calc(100% - 9px));
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
label[data-size='md'] > input:checked + span:before {
|
|
1573
|
+
transform: translateX(calc(100% - 9px));
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
label[data-size='sm'] > input:checked + span:before {
|
|
1577
|
+
transform: translateX(calc(100% - 7px));
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
/* -- Hover states ------------------------------------------------------- */
|
|
1581
|
+
label:hover > input:not(:checked):not(:disabled) + span {
|
|
1582
|
+
background-color: ${({colors:t})=>t.neutrals400};
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
label:hover > input:checked:not(:disabled) + span {
|
|
1586
|
+
background-color: ${({colors:t})=>t.accent080};
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
/* -- Disabled state --------------------------------------------------- */
|
|
1590
|
+
label:has(input:disabled) {
|
|
1591
|
+
pointer-events: none;
|
|
1592
|
+
user-select: none;
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
input:not(:checked):disabled + span {
|
|
1596
|
+
background-color: ${({colors:t})=>t.neutrals700};
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
input:checked:disabled + span {
|
|
1600
|
+
background-color: ${({colors:t})=>t.neutrals700};
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
input:not(:checked):disabled + span::before {
|
|
1604
|
+
background-color: ${({colors:t})=>t.neutrals400};
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
input:checked:disabled + span::before {
|
|
1608
|
+
background-color: ${({tokens:t})=>t.theme.textTertiary};
|
|
1609
|
+
}
|
|
1610
|
+
`;var Wt=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ve=class extends m{constructor(){super(...arguments),this.inputElementRef=Zt(),this.checked=!1,this.disabled=!1,this.size="md"}render(){return l`
|
|
1611
|
+
<label data-size=${this.size}>
|
|
1612
|
+
<input
|
|
1613
|
+
${ei(this.inputElementRef)}
|
|
1614
|
+
type="checkbox"
|
|
1615
|
+
?checked=${this.checked}
|
|
1616
|
+
?disabled=${this.disabled}
|
|
1617
|
+
@change=${this.dispatchChangeEvent.bind(this)}
|
|
1618
|
+
/>
|
|
1619
|
+
<span></span>
|
|
1620
|
+
</label>
|
|
1621
|
+
`}dispatchChangeEvent(){var e;this.dispatchEvent(new CustomEvent("switchChange",{detail:(e=this.inputElementRef.value)==null?void 0:e.checked,bubbles:!0,composed:!0}))}};Ve.styles=[I,W,Sn];Wt([c({type:Boolean})],Ve.prototype,"checked",void 0);Wt([c({type:Boolean})],Ve.prototype,"disabled",void 0);Wt([c()],Ve.prototype,"size",void 0);Ve=Wt([p("wui-toggle")],Ve);const En=v`
|
|
1622
|
+
:host {
|
|
1623
|
+
height: auto;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
:host > wui-flex {
|
|
1627
|
+
height: 100%;
|
|
1628
|
+
display: flex;
|
|
1629
|
+
align-items: center;
|
|
1630
|
+
justify-content: center;
|
|
1631
|
+
column-gap: ${({spacing:t})=>t[2]};
|
|
1632
|
+
padding: ${({spacing:t})=>t[2]} ${({spacing:t})=>t[3]};
|
|
1633
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
1634
|
+
border-radius: ${({borderRadius:t})=>t[4]};
|
|
1635
|
+
box-shadow: inset 0 0 0 1px ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
1636
|
+
transition: background-color ${({durations:t})=>t.lg}
|
|
1637
|
+
${({easings:t})=>t["ease-out-power-2"]};
|
|
1638
|
+
will-change: background-color;
|
|
1639
|
+
cursor: pointer;
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
wui-switch {
|
|
1643
|
+
pointer-events: none;
|
|
1644
|
+
}
|
|
1645
|
+
`;var Wi=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let gt=class extends m{constructor(){super(...arguments),this.checked=!1}render(){return l`
|
|
1646
|
+
<wui-flex>
|
|
1647
|
+
<wui-icon size="xl" name="walletConnectBrown"></wui-icon>
|
|
1648
|
+
<wui-toggle
|
|
1649
|
+
?checked=${this.checked}
|
|
1650
|
+
size="sm"
|
|
1651
|
+
@switchChange=${this.handleToggleChange.bind(this)}
|
|
1652
|
+
></wui-toggle>
|
|
1653
|
+
</wui-flex>
|
|
1654
|
+
`}handleToggleChange(e){e.stopPropagation(),this.checked=e.detail,this.dispatchSwitchEvent()}dispatchSwitchEvent(){this.dispatchEvent(new CustomEvent("certifiedSwitchChange",{detail:this.checked,bubbles:!0,composed:!0}))}};gt.styles=[I,W,En];Wi([c({type:Boolean})],gt.prototype,"checked",void 0);gt=Wi([p("wui-certified-switch")],gt);const kn=v`
|
|
1655
|
+
:host {
|
|
1656
|
+
position: relative;
|
|
1657
|
+
display: inline-block;
|
|
1658
|
+
width: 100%;
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
wui-icon {
|
|
1662
|
+
position: absolute;
|
|
1663
|
+
top: 50%;
|
|
1664
|
+
transform: translateY(-50%);
|
|
1665
|
+
right: ${({spacing:t})=>t[3]};
|
|
1666
|
+
color: ${({tokens:t})=>t.theme.iconDefault};
|
|
1667
|
+
cursor: pointer;
|
|
1668
|
+
padding: ${({spacing:t})=>t[2]};
|
|
1669
|
+
background-color: transparent;
|
|
1670
|
+
border-radius: ${({borderRadius:t})=>t[4]};
|
|
1671
|
+
transition: background-color ${({durations:t})=>t.lg}
|
|
1672
|
+
${({easings:t})=>t["ease-out-power-2"]};
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
@media (hover: hover) {
|
|
1676
|
+
wui-icon:hover {
|
|
1677
|
+
background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
`;var Ni=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let yt=class extends m{constructor(){super(...arguments),this.inputComponentRef=Zt(),this.inputValue=""}render(){return l`
|
|
1681
|
+
<wui-input-text
|
|
1682
|
+
${ei(this.inputComponentRef)}
|
|
1683
|
+
placeholder="Search wallet"
|
|
1684
|
+
icon="search"
|
|
1685
|
+
type="search"
|
|
1686
|
+
enterKeyHint="search"
|
|
1687
|
+
size="sm"
|
|
1688
|
+
@inputChange=${this.onInputChange}
|
|
1689
|
+
>
|
|
1690
|
+
${this.inputValue?l`<wui-icon
|
|
1691
|
+
@click=${this.clearValue}
|
|
1692
|
+
color="inherit"
|
|
1693
|
+
size="sm"
|
|
1694
|
+
name="close"
|
|
1695
|
+
></wui-icon>`:null}
|
|
1696
|
+
</wui-input-text>
|
|
1697
|
+
`}onInputChange(e){this.inputValue=e.detail||""}clearValue(){const e=this.inputComponentRef.value,i=e==null?void 0:e.inputElementRef.value;i&&(i.value="",this.inputValue="",i.focus(),i.dispatchEvent(new Event("input")))}};yt.styles=[I,kn];Ni([c()],yt.prototype,"inputValue",void 0);yt=Ni([p("wui-search-bar")],yt);const An=v`
|
|
1698
|
+
:host {
|
|
1699
|
+
display: flex;
|
|
1700
|
+
flex-direction: column;
|
|
1701
|
+
justify-content: center;
|
|
1702
|
+
align-items: center;
|
|
1703
|
+
height: 104px;
|
|
1704
|
+
width: 104px;
|
|
1705
|
+
row-gap: ${({spacing:t})=>t[2]};
|
|
1706
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
1707
|
+
border-radius: ${({borderRadius:t})=>t[5]};
|
|
1708
|
+
position: relative;
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
wui-shimmer[data-type='network'] {
|
|
1712
|
+
border: none;
|
|
1713
|
+
-webkit-clip-path: var(--apkt-path-network);
|
|
1714
|
+
clip-path: var(--apkt-path-network);
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
svg {
|
|
1718
|
+
position: absolute;
|
|
1719
|
+
width: 48px;
|
|
1720
|
+
height: 54px;
|
|
1721
|
+
z-index: 1;
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
svg > path {
|
|
1725
|
+
stroke: ${({tokens:t})=>t.theme.foregroundSecondary};
|
|
1726
|
+
stroke-width: 1px;
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
@media (max-width: 350px) {
|
|
1730
|
+
:host {
|
|
1731
|
+
width: 100%;
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
`;var Oi=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let xt=class extends m{constructor(){super(...arguments),this.type="wallet"}render(){return l`
|
|
1735
|
+
${this.shimmerTemplate()}
|
|
1736
|
+
<wui-shimmer width="80px" height="20px"></wui-shimmer>
|
|
1737
|
+
`}shimmerTemplate(){return this.type==="network"?l` <wui-shimmer data-type=${this.type} width="48px" height="54px"></wui-shimmer>
|
|
1738
|
+
${Qi}`:l`<wui-shimmer width="56px" height="56px"></wui-shimmer>`}};xt.styles=[I,W,An];Oi([c()],xt.prototype,"type",void 0);xt=Oi([p("wui-card-select-loader")],xt);const In=ee`
|
|
1739
|
+
:host {
|
|
1740
|
+
display: grid;
|
|
1741
|
+
width: inherit;
|
|
1742
|
+
height: inherit;
|
|
1743
|
+
}
|
|
1744
|
+
`;var ne=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let V=class extends m{render(){return this.style.cssText=`
|
|
1745
|
+
grid-template-rows: ${this.gridTemplateRows};
|
|
1746
|
+
grid-template-columns: ${this.gridTemplateColumns};
|
|
1747
|
+
justify-items: ${this.justifyItems};
|
|
1748
|
+
align-items: ${this.alignItems};
|
|
1749
|
+
justify-content: ${this.justifyContent};
|
|
1750
|
+
align-content: ${this.alignContent};
|
|
1751
|
+
column-gap: ${this.columnGap&&`var(--apkt-spacing-${this.columnGap})`};
|
|
1752
|
+
row-gap: ${this.rowGap&&`var(--apkt-spacing-${this.rowGap})`};
|
|
1753
|
+
gap: ${this.gap&&`var(--apkt-spacing-${this.gap})`};
|
|
1754
|
+
padding-top: ${this.padding&&F.getSpacingStyles(this.padding,0)};
|
|
1755
|
+
padding-right: ${this.padding&&F.getSpacingStyles(this.padding,1)};
|
|
1756
|
+
padding-bottom: ${this.padding&&F.getSpacingStyles(this.padding,2)};
|
|
1757
|
+
padding-left: ${this.padding&&F.getSpacingStyles(this.padding,3)};
|
|
1758
|
+
margin-top: ${this.margin&&F.getSpacingStyles(this.margin,0)};
|
|
1759
|
+
margin-right: ${this.margin&&F.getSpacingStyles(this.margin,1)};
|
|
1760
|
+
margin-bottom: ${this.margin&&F.getSpacingStyles(this.margin,2)};
|
|
1761
|
+
margin-left: ${this.margin&&F.getSpacingStyles(this.margin,3)};
|
|
1762
|
+
`,l`<slot></slot>`}};V.styles=[I,In];ne([c()],V.prototype,"gridTemplateRows",void 0);ne([c()],V.prototype,"gridTemplateColumns",void 0);ne([c()],V.prototype,"justifyItems",void 0);ne([c()],V.prototype,"alignItems",void 0);ne([c()],V.prototype,"justifyContent",void 0);ne([c()],V.prototype,"alignContent",void 0);ne([c()],V.prototype,"columnGap",void 0);ne([c()],V.prototype,"rowGap",void 0);ne([c()],V.prototype,"gap",void 0);ne([c()],V.prototype,"padding",void 0);ne([c()],V.prototype,"margin",void 0);V=ne([p("wui-grid")],V);const _n=v`
|
|
1763
|
+
button {
|
|
1764
|
+
display: flex;
|
|
1765
|
+
flex-direction: column;
|
|
1766
|
+
justify-content: center;
|
|
1767
|
+
align-items: center;
|
|
1768
|
+
cursor: pointer;
|
|
1769
|
+
width: 104px;
|
|
1770
|
+
row-gap: ${({spacing:t})=>t[2]};
|
|
1771
|
+
padding: ${({spacing:t})=>t[3]} ${({spacing:t})=>t[0]};
|
|
1772
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
1773
|
+
border-radius: clamp(0px, ${({borderRadius:t})=>t[4]}, 20px);
|
|
1774
|
+
transition:
|
|
1775
|
+
color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-1"]},
|
|
1776
|
+
background-color ${({durations:t})=>t.lg}
|
|
1777
|
+
${({easings:t})=>t["ease-out-power-1"]},
|
|
1778
|
+
border-radius ${({durations:t})=>t.lg}
|
|
1779
|
+
${({easings:t})=>t["ease-out-power-1"]};
|
|
1780
|
+
will-change: background-color, color, border-radius;
|
|
1781
|
+
outline: none;
|
|
1782
|
+
border: none;
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
button > wui-flex > wui-text {
|
|
1786
|
+
color: ${({tokens:t})=>t.theme.textPrimary};
|
|
1787
|
+
max-width: 86px;
|
|
1788
|
+
white-space: nowrap;
|
|
1789
|
+
overflow: hidden;
|
|
1790
|
+
text-overflow: ellipsis;
|
|
1791
|
+
justify-content: center;
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
button > wui-flex > wui-text.certified {
|
|
1795
|
+
max-width: 66px;
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
@media (hover: hover) and (pointer: fine) {
|
|
1799
|
+
button:hover:enabled {
|
|
1800
|
+
background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
button:disabled > wui-flex > wui-text {
|
|
1805
|
+
color: ${({tokens:t})=>t.core.glass010};
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
[data-selected='true'] {
|
|
1809
|
+
background-color: ${({colors:t})=>t.accent020};
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
@media (hover: hover) and (pointer: fine) {
|
|
1813
|
+
[data-selected='true']:hover:enabled {
|
|
1814
|
+
background-color: ${({colors:t})=>t.accent010};
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
[data-selected='true']:active:enabled {
|
|
1819
|
+
background-color: ${({colors:t})=>t.accent010};
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
@media (max-width: 350px) {
|
|
1823
|
+
button {
|
|
1824
|
+
width: 100%;
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
`;var de=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Z=class extends m{constructor(){super(),this.observer=new IntersectionObserver(()=>{}),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.isImpressed=!1,this.explorerId="",this.walletQuery="",this.certified=!1,this.displayIndex=0,this.wallet=void 0,this.observer=new IntersectionObserver(e=>{e.forEach(i=>{i.isIntersecting?(this.visible=!0,this.fetchImageSrc(),this.sendImpressionEvent()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){var i,o;const e=((i=this.wallet)==null?void 0:i.badge_type)==="certified";return l`
|
|
1828
|
+
<button>
|
|
1829
|
+
${this.imageTemplate()}
|
|
1830
|
+
<wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="1">
|
|
1831
|
+
<wui-text
|
|
1832
|
+
variant="md-regular"
|
|
1833
|
+
color="inherit"
|
|
1834
|
+
class=${w(e?"certified":void 0)}
|
|
1835
|
+
>${(o=this.wallet)==null?void 0:o.name}</wui-text
|
|
1836
|
+
>
|
|
1837
|
+
${e?l`<wui-icon size="sm" name="walletConnectBrown"></wui-icon>`:null}
|
|
1838
|
+
</wui-flex>
|
|
1839
|
+
</button>
|
|
1840
|
+
`}imageTemplate(){var e,i;return!this.visible&&!this.imageSrc||this.imageLoading?this.shimmerTemplate():l`
|
|
1841
|
+
<wui-wallet-image
|
|
1842
|
+
size="lg"
|
|
1843
|
+
imageSrc=${w(this.imageSrc)}
|
|
1844
|
+
name=${w((e=this.wallet)==null?void 0:e.name)}
|
|
1845
|
+
.installed=${((i=this.wallet)==null?void 0:i.installed)??!1}
|
|
1846
|
+
badgeSize="sm"
|
|
1847
|
+
>
|
|
1848
|
+
</wui-wallet-image>
|
|
1849
|
+
`}shimmerTemplate(){return l`<wui-shimmer width="56px" height="56px"></wui-shimmer>`}async fetchImageSrc(){this.wallet&&(this.imageSrc=T.getWalletImage(this.wallet),!this.imageSrc&&(this.imageLoading=!0,this.imageSrc=await T.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}sendImpressionEvent(){!this.wallet||this.isImpressed||(this.isImpressed=!0,C.sendWalletImpressionEvent({name:this.wallet.name,walletRank:this.wallet.order,explorerId:this.explorerId,view:h.state.view,query:this.walletQuery,certified:this.certified,displayIndex:this.displayIndex}))}};Z.styles=_n;de([d()],Z.prototype,"visible",void 0);de([d()],Z.prototype,"imageSrc",void 0);de([d()],Z.prototype,"imageLoading",void 0);de([d()],Z.prototype,"isImpressed",void 0);de([c()],Z.prototype,"explorerId",void 0);de([c()],Z.prototype,"walletQuery",void 0);de([c()],Z.prototype,"certified",void 0);de([c()],Z.prototype,"displayIndex",void 0);de([c({type:Object})],Z.prototype,"wallet",void 0);Z=de([p("w3m-all-wallets-list-item")],Z);const Rn=v`
|
|
1850
|
+
wui-grid {
|
|
1851
|
+
max-height: clamp(360px, 400px, 80vh);
|
|
1852
|
+
overflow: scroll;
|
|
1853
|
+
scrollbar-width: none;
|
|
1854
|
+
grid-auto-rows: min-content;
|
|
1855
|
+
grid-template-columns: repeat(auto-fill, 104px);
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
:host([data-mobile-fullscreen='true']) wui-grid {
|
|
1859
|
+
max-height: none;
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
@media (max-width: 350px) {
|
|
1863
|
+
wui-grid {
|
|
1864
|
+
grid-template-columns: repeat(2, 1fr);
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
wui-grid[data-scroll='false'] {
|
|
1869
|
+
overflow: hidden;
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
wui-grid::-webkit-scrollbar {
|
|
1873
|
+
display: none;
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
w3m-all-wallets-list-item {
|
|
1877
|
+
opacity: 0;
|
|
1878
|
+
animation-duration: ${({durations:t})=>t.xl};
|
|
1879
|
+
animation-timing-function: ${({easings:t})=>t["ease-inout-power-2"]};
|
|
1880
|
+
animation-name: fade-in;
|
|
1881
|
+
animation-fill-mode: forwards;
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
@keyframes fade-in {
|
|
1885
|
+
from {
|
|
1886
|
+
opacity: 0;
|
|
1887
|
+
}
|
|
1888
|
+
to {
|
|
1889
|
+
opacity: 1;
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
wui-loading-spinner {
|
|
1894
|
+
padding-top: ${({spacing:t})=>t[4]};
|
|
1895
|
+
padding-bottom: ${({spacing:t})=>t[4]};
|
|
1896
|
+
justify-content: center;
|
|
1897
|
+
grid-column: 1 / span 4;
|
|
1898
|
+
}
|
|
1899
|
+
`;var dt=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const bi="local-paginator";let Re=class extends m{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.loading=!A.state.wallets.length,this.wallets=A.state.wallets,this.mobileFullScreen=f.state.enableMobileFullScreen,this.unsubscribe.push(A.subscribeKey("wallets",e=>this.wallets=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){var e;this.unsubscribe.forEach(i=>i()),(e=this.paginationObserver)==null||e.disconnect()}render(){return this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),l`
|
|
1900
|
+
<wui-grid
|
|
1901
|
+
data-scroll=${!this.loading}
|
|
1902
|
+
.padding=${["0","3","3","3"]}
|
|
1903
|
+
gap="2"
|
|
1904
|
+
justifyContent="space-between"
|
|
1905
|
+
>
|
|
1906
|
+
${this.loading?this.shimmerTemplate(16):this.walletsTemplate()}
|
|
1907
|
+
${this.paginationLoaderTemplate()}
|
|
1908
|
+
</wui-grid>
|
|
1909
|
+
`}async initialFetch(){var i;this.loading=!0;const e=(i=this.shadowRoot)==null?void 0:i.querySelector("wui-grid");e&&(await A.fetchWalletsByPage({page:1}),await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.loading=!1,e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(e,i){return[...Array(e)].map(()=>l`
|
|
1910
|
+
<wui-card-select-loader type="wallet" id=${w(i)}></wui-card-select-loader>
|
|
1911
|
+
`)}walletsTemplate(){return tt.getWalletConnectWallets(this.wallets).map((e,i)=>l`
|
|
1912
|
+
<w3m-all-wallets-list-item
|
|
1913
|
+
data-testid="wallet-search-item-${e.id}"
|
|
1914
|
+
@click=${()=>this.onConnectWallet(e)}
|
|
1915
|
+
.wallet=${e}
|
|
1916
|
+
explorerId=${e.id}
|
|
1917
|
+
certified=${this.badge==="certified"}
|
|
1918
|
+
displayIndex=${i}
|
|
1919
|
+
></w3m-all-wallets-list-item>
|
|
1920
|
+
`)}paginationLoaderTemplate(){const{wallets:e,recommended:i,featured:o,count:s,mobileFilteredOutWalletsLength:n}=A.state,a=window.innerWidth<352?3:4,r=e.length+i.length;let $=Math.ceil(r/a)*a-r+a;return $-=e.length?o.length%a:0,s===0&&o.length>0?null:s===0||[...o,...e,...i].length<s-(n??0)?this.shimmerTemplate($,bi):null}createPaginationObserver(){var i;const e=(i=this.shadowRoot)==null?void 0:i.querySelector(`#${bi}`);e&&(this.paginationObserver=new IntersectionObserver(([o])=>{if(o!=null&&o.isIntersecting&&!this.loading){const{page:s,count:n,wallets:a}=A.state;a.length<n&&A.fetchWalletsByPage({page:s+1})}}),this.paginationObserver.observe(e))}onConnectWallet(e){b.selectWalletConnector(e)}};Re.styles=Rn;dt([d()],Re.prototype,"loading",void 0);dt([d()],Re.prototype,"wallets",void 0);dt([d()],Re.prototype,"badge",void 0);dt([d()],Re.prototype,"mobileFullScreen",void 0);Re=dt([p("w3m-all-wallets-list")],Re);const Wn=ee`
|
|
1921
|
+
wui-grid,
|
|
1922
|
+
wui-loading-spinner,
|
|
1923
|
+
wui-flex {
|
|
1924
|
+
height: 360px;
|
|
1925
|
+
}
|
|
1926
|
+
|
|
1927
|
+
wui-grid {
|
|
1928
|
+
overflow: scroll;
|
|
1929
|
+
scrollbar-width: none;
|
|
1930
|
+
grid-auto-rows: min-content;
|
|
1931
|
+
grid-template-columns: repeat(auto-fill, 104px);
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
:host([data-mobile-fullscreen='true']) wui-grid {
|
|
1935
|
+
max-height: none;
|
|
1936
|
+
height: auto;
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
wui-grid[data-scroll='false'] {
|
|
1940
|
+
overflow: hidden;
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
wui-grid::-webkit-scrollbar {
|
|
1944
|
+
display: none;
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
wui-loading-spinner {
|
|
1948
|
+
justify-content: center;
|
|
1949
|
+
align-items: center;
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
@media (max-width: 350px) {
|
|
1953
|
+
wui-grid {
|
|
1954
|
+
grid-template-columns: repeat(2, 1fr);
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
`;var ht=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let We=class extends m{constructor(){super(...arguments),this.prevQuery="",this.prevBadge=void 0,this.loading=!0,this.mobileFullScreen=f.state.enableMobileFullScreen,this.query=""}render(){return this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),this.onSearch(),this.loading?l`<wui-loading-spinner color="accent-primary"></wui-loading-spinner>`:this.walletsTemplate()}async onSearch(){(this.query.trim()!==this.prevQuery.trim()||this.badge!==this.prevBadge)&&(this.prevQuery=this.query,this.prevBadge=this.badge,this.loading=!0,await A.searchWallet({search:this.query,badge:this.badge}),this.loading=!1)}walletsTemplate(){const{search:e}=A.state,i=tt.markWalletsAsInstalled(e),o=tt.filterWalletsByWcSupport(i);return o.length?l`
|
|
1958
|
+
<wui-grid
|
|
1959
|
+
data-testid="wallet-list"
|
|
1960
|
+
.padding=${["0","3","3","3"]}
|
|
1961
|
+
rowGap="4"
|
|
1962
|
+
columngap="2"
|
|
1963
|
+
justifyContent="space-between"
|
|
1964
|
+
>
|
|
1965
|
+
${o.map((s,n)=>l`
|
|
1966
|
+
<w3m-all-wallets-list-item
|
|
1967
|
+
@click=${()=>this.onConnectWallet(s)}
|
|
1968
|
+
.wallet=${s}
|
|
1969
|
+
data-testid="wallet-search-item-${s.id}"
|
|
1970
|
+
explorerId=${s.id}
|
|
1971
|
+
certified=${this.badge==="certified"}
|
|
1972
|
+
walletQuery=${this.query}
|
|
1973
|
+
displayIndex=${n}
|
|
1974
|
+
></w3m-all-wallets-list-item>
|
|
1975
|
+
`)}
|
|
1976
|
+
</wui-grid>
|
|
1977
|
+
`:l`
|
|
1978
|
+
<wui-flex
|
|
1979
|
+
data-testid="no-wallet-found"
|
|
1980
|
+
justifyContent="center"
|
|
1981
|
+
alignItems="center"
|
|
1982
|
+
gap="3"
|
|
1983
|
+
flexDirection="column"
|
|
1984
|
+
>
|
|
1985
|
+
<wui-icon-box size="lg" color="default" icon="wallet"></wui-icon-box>
|
|
1986
|
+
<wui-text data-testid="no-wallet-found-text" color="secondary" variant="md-medium">
|
|
1987
|
+
No Wallet found
|
|
1988
|
+
</wui-text>
|
|
1989
|
+
</wui-flex>
|
|
1990
|
+
`}onConnectWallet(e){b.selectWalletConnector(e)}};We.styles=Wn;ht([d()],We.prototype,"loading",void 0);ht([d()],We.prototype,"mobileFullScreen",void 0);ht([c()],We.prototype,"query",void 0);ht([c()],We.prototype,"badge",void 0);We=ht([p("w3m-all-wallets-search")],We);var ni=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let vt=class extends m{constructor(){super(...arguments),this.search="",this.badge=void 0,this.onDebouncedSearch=y.debounce(e=>{this.search=e})}render(){const e=this.search.length>=2;return l`
|
|
1991
|
+
<wui-flex .padding=${["1","3","3","3"]} gap="2" alignItems="center">
|
|
1992
|
+
<wui-search-bar @inputChange=${this.onInputChange.bind(this)}></wui-search-bar>
|
|
1993
|
+
<wui-certified-switch
|
|
1994
|
+
?checked=${this.badge==="certified"}
|
|
1995
|
+
@certifiedSwitchChange=${this.onCertifiedSwitchChange.bind(this)}
|
|
1996
|
+
data-testid="wui-certified-switch"
|
|
1997
|
+
></wui-certified-switch>
|
|
1998
|
+
${this.qrButtonTemplate()}
|
|
1999
|
+
</wui-flex>
|
|
2000
|
+
${e||this.badge?l`<w3m-all-wallets-search
|
|
2001
|
+
query=${this.search}
|
|
2002
|
+
.badge=${this.badge}
|
|
2003
|
+
></w3m-all-wallets-search>`:l`<w3m-all-wallets-list .badge=${this.badge}></w3m-all-wallets-list>`}
|
|
2004
|
+
`}onInputChange(e){this.onDebouncedSearch(e.detail)}onCertifiedSwitchChange(e){e.detail?(this.badge="certified",k.showSvg("Only WalletConnect certified",{icon:"walletConnectBrown",iconColor:"accent-100"})):this.badge=void 0}qrButtonTemplate(){return y.isMobile()?l`
|
|
2005
|
+
<wui-icon-box
|
|
2006
|
+
size="xl"
|
|
2007
|
+
iconSize="xl"
|
|
2008
|
+
color="accent-primary"
|
|
2009
|
+
icon="qrCode"
|
|
2010
|
+
border
|
|
2011
|
+
borderColor="wui-accent-glass-010"
|
|
2012
|
+
@click=${this.onWalletConnectQr.bind(this)}
|
|
2013
|
+
></wui-icon-box>
|
|
2014
|
+
`:null}onWalletConnectQr(){h.push("ConnectingWalletConnect")}};ni([d()],vt.prototype,"search",void 0);ni([d()],vt.prototype,"badge",void 0);vt=ni([p("w3m-all-wallets-view")],vt);const Nn=v`
|
|
2015
|
+
button {
|
|
2016
|
+
display: flex;
|
|
2017
|
+
gap: ${({spacing:t})=>t[1]};
|
|
2018
|
+
padding: ${({spacing:t})=>t[4]};
|
|
2019
|
+
width: 100%;
|
|
2020
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
2021
|
+
border-radius: ${({borderRadius:t})=>t[4]};
|
|
2022
|
+
justify-content: center;
|
|
2023
|
+
align-items: center;
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
:host([data-size='sm']) button {
|
|
2027
|
+
padding: ${({spacing:t})=>t[2]};
|
|
2028
|
+
border-radius: ${({borderRadius:t})=>t[2]};
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
:host([data-size='md']) button {
|
|
2032
|
+
padding: ${({spacing:t})=>t[3]};
|
|
2033
|
+
border-radius: ${({borderRadius:t})=>t[3]};
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
button:hover {
|
|
2037
|
+
background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
button:disabled {
|
|
2041
|
+
opacity: 0.5;
|
|
2042
|
+
}
|
|
2043
|
+
`;var Qe=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ye=class extends m{constructor(){super(...arguments),this.text="",this.disabled=!1,this.size="lg",this.icon="copy",this.tabIdx=void 0}render(){this.dataset.size=this.size;const e=`${this.size}-regular`;return l`
|
|
2044
|
+
<button ?disabled=${this.disabled} tabindex=${w(this.tabIdx)}>
|
|
2045
|
+
<wui-icon name=${this.icon} size=${this.size} color="default"></wui-icon>
|
|
2046
|
+
<wui-text align="center" variant=${e} color="primary">${this.text}</wui-text>
|
|
2047
|
+
</button>
|
|
2048
|
+
`}};ye.styles=[I,W,Nn];Qe([c()],ye.prototype,"text",void 0);Qe([c({type:Boolean})],ye.prototype,"disabled",void 0);Qe([c()],ye.prototype,"size",void 0);Qe([c()],ye.prototype,"icon",void 0);Qe([c()],ye.prototype,"tabIdx",void 0);ye=Qe([p("wui-list-button")],ye);const On=v`
|
|
2049
|
+
wui-separator {
|
|
2050
|
+
margin: ${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1);
|
|
2051
|
+
width: calc(100% + ${({spacing:t})=>t[3]} * 2);
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
wui-email-input {
|
|
2055
|
+
width: 100%;
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
form {
|
|
2059
|
+
width: 100%;
|
|
2060
|
+
display: block;
|
|
2061
|
+
position: relative;
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
wui-icon-link,
|
|
2065
|
+
wui-loading-spinner {
|
|
2066
|
+
position: absolute;
|
|
2067
|
+
top: 50%;
|
|
2068
|
+
transform: translateY(-50%);
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
wui-icon-link {
|
|
2072
|
+
right: ${({spacing:t})=>t[2]};
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
wui-loading-spinner {
|
|
2076
|
+
right: ${({spacing:t})=>t[3]};
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
wui-text {
|
|
2080
|
+
margin: ${({spacing:t})=>t[2]} ${({spacing:t})=>t[3]}
|
|
2081
|
+
${({spacing:t})=>t[0]} ${({spacing:t})=>t[3]};
|
|
2082
|
+
}
|
|
2083
|
+
`;var je=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let pe=class extends m{constructor(){super(),this.unsubscribe=[],this.formRef=Zt(),this.email="",this.loading=!1,this.error="",this.remoteFeatures=f.state.remoteFeatures,this.hasExceededUsageLimit=A.state.plan.hasExceededUsageLimit,this.unsubscribe.push(f.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}),A.subscribeKey("plan",e=>this.hasExceededUsageLimit=e.hasExceededUsageLimit))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",i=>{i.key==="Enter"&&this.onSubmitEmail(i)})}render(){const e=x.hasAnyConnection(S.CONNECTOR_ID.AUTH);return l`
|
|
2084
|
+
<form ${ei(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}>
|
|
2085
|
+
<wui-email-input
|
|
2086
|
+
@focus=${this.onFocusEvent.bind(this)}
|
|
2087
|
+
.disabled=${this.loading}
|
|
2088
|
+
@inputChange=${this.onEmailInputChange.bind(this)}
|
|
2089
|
+
tabIdx=${w(this.tabIdx)}
|
|
2090
|
+
?disabled=${e||this.hasExceededUsageLimit}
|
|
2091
|
+
>
|
|
2092
|
+
</wui-email-input>
|
|
2093
|
+
|
|
2094
|
+
${this.submitButtonTemplate()}${this.loadingTemplate()}
|
|
2095
|
+
<input type="submit" hidden />
|
|
2096
|
+
</form>
|
|
2097
|
+
${this.templateError()}
|
|
2098
|
+
`}submitButtonTemplate(){return!this.loading&&this.email.length>3?l`
|
|
2099
|
+
<wui-icon-link
|
|
2100
|
+
size="sm"
|
|
2101
|
+
icon="chevronRight"
|
|
2102
|
+
iconcolor="accent-100"
|
|
2103
|
+
@click=${this.onSubmitEmail.bind(this)}
|
|
2104
|
+
>
|
|
2105
|
+
</wui-icon-link>
|
|
2106
|
+
`:null}loadingTemplate(){return this.loading?l`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:null}templateError(){return this.error?l`<wui-text variant="sm-medium" color="error">${this.error}</wui-text>`:null}onEmailInputChange(e){this.email=e.detail.trim(),this.error=""}async onSubmitEmail(e){var o;if(!Jt.isValidEmail(this.email)){Ai.open({displayMessage:Ki.ALERT_WARNINGS.INVALID_EMAIL.displayMessage},"warning");return}if(!S.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(s=>s===u.state.activeChain)){const s=u.getFirstCaipNetworkSupportsAuthConnector();if(s){h.push("SwitchNetwork",{network:s});return}}try{if(this.loading)return;this.loading=!0,e.preventDefault();const s=b.getAuthConnector();if(!s)throw new Error("w3m-email-login-widget: Auth connector not found");const{action:n}=await s.provider.connectEmail({email:this.email});if(C.sendEvent({type:"track",event:"EMAIL_SUBMITTED"}),n==="VERIFY_OTP")C.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),h.push("EmailVerifyOtp",{email:this.email});else if(n==="VERIFY_DEVICE")h.push("EmailVerifyDevice",{email:this.email});else if(n==="CONNECT"){const a=(o=this.remoteFeatures)==null?void 0:o.multiWallet;await x.connectExternal(s,u.state.activeChain),a?(h.replace("ProfileWallets"),k.showSuccess("New Wallet Added")):h.replace("Account")}}catch(s){const n=y.parseError(s);n!=null&&n.includes("Invalid email")?this.error="Invalid email. Try again.":k.showError(s)}finally{this.loading=!1}}onFocusEvent(){C.sendEvent({type:"track",event:"EMAIL_LOGIN_SELECTED"})}};pe.styles=On;je([c()],pe.prototype,"tabIdx",void 0);je([d()],pe.prototype,"email",void 0);je([d()],pe.prototype,"loading",void 0);je([d()],pe.prototype,"error",void 0);je([d()],pe.prototype,"remoteFeatures",void 0);je([d()],pe.prototype,"hasExceededUsageLimit",void 0);pe=je([p("w3m-email-login-widget")],pe);const Pn=v`
|
|
2107
|
+
:host {
|
|
2108
|
+
display: block;
|
|
2109
|
+
width: 100%;
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
button {
|
|
2113
|
+
width: 100%;
|
|
2114
|
+
height: 52px;
|
|
2115
|
+
display: flex;
|
|
2116
|
+
align-items: center;
|
|
2117
|
+
justify-content: center;
|
|
2118
|
+
background: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
2119
|
+
border-radius: ${({borderRadius:t})=>t[4]};
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
@media (hover: hover) {
|
|
2123
|
+
button:hover:enabled {
|
|
2124
|
+
background: ${({tokens:t})=>t.theme.foregroundSecondary};
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
button:disabled {
|
|
2129
|
+
cursor: not-allowed;
|
|
2130
|
+
opacity: 0.5;
|
|
2131
|
+
}
|
|
2132
|
+
`;var Nt=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let He=class extends m{constructor(){super(...arguments),this.logo="google",this.disabled=!1,this.tabIdx=void 0}render(){return l`
|
|
2133
|
+
<button ?disabled=${this.disabled} tabindex=${w(this.tabIdx)}>
|
|
2134
|
+
<wui-icon size="xxl" name=${this.logo}></wui-icon>
|
|
2135
|
+
</button>
|
|
2136
|
+
`}};He.styles=[I,W,Pn];Nt([c()],He.prototype,"logo",void 0);Nt([c({type:Boolean})],He.prototype,"disabled",void 0);Nt([c()],He.prototype,"tabIdx",void 0);He=Nt([p("wui-logo-select")],He);const Dn=v`
|
|
2137
|
+
wui-separator {
|
|
2138
|
+
margin: ${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1)
|
|
2139
|
+
${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1);
|
|
2140
|
+
width: calc(100% + ${({spacing:t})=>t[3]} * 2);
|
|
2141
|
+
}
|
|
2142
|
+
`;var Ce=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const gi=2,yi=6;let ce=class extends m{constructor(){super(),this.unsubscribe=[],this.walletGuide="get-started",this.tabIdx=void 0,this.connectors=b.state.connectors,this.remoteFeatures=f.state.remoteFeatures,this.authConnector=this.connectors.find(e=>e.type==="AUTH"),this.isPwaLoading=!1,this.hasExceededUsageLimit=A.state.plan.hasExceededUsageLimit,this.unsubscribe.push(b.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(i=>i.type==="AUTH")}),f.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e),A.subscribeKey("plan",e=>this.hasExceededUsageLimit=e.hasExceededUsageLimit))}connectedCallback(){super.connectedCallback(),this.handlePwaFrameLoad()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
|
|
2143
|
+
<wui-flex
|
|
2144
|
+
class="container"
|
|
2145
|
+
flexDirection="column"
|
|
2146
|
+
gap="2"
|
|
2147
|
+
data-testid="w3m-social-login-widget"
|
|
2148
|
+
>
|
|
2149
|
+
${this.topViewTemplate()}${this.bottomViewTemplate()}
|
|
2150
|
+
</wui-flex>
|
|
2151
|
+
`}topViewTemplate(){var o;const e=this.walletGuide==="explore";let i=(o=this.remoteFeatures)==null?void 0:o.socials;return!i&&e?(i=D.DEFAULT_SOCIALS,this.renderTopViewContent(i)):i?this.renderTopViewContent(i):null}renderTopViewContent(e){return e.length===2?l` <wui-flex gap="2">
|
|
2152
|
+
${e.slice(0,gi).map(i=>l`<wui-logo-select
|
|
2153
|
+
data-testid=${`social-selector-${i}`}
|
|
2154
|
+
@click=${()=>{this.onSocialClick(i)}}
|
|
2155
|
+
logo=${i}
|
|
2156
|
+
tabIdx=${w(this.tabIdx)}
|
|
2157
|
+
?disabled=${this.isPwaLoading||this.hasConnection()}
|
|
2158
|
+
></wui-logo-select>`)}
|
|
2159
|
+
</wui-flex>`:l` <wui-list-button
|
|
2160
|
+
data-testid=${`social-selector-${e[0]}`}
|
|
2161
|
+
@click=${()=>{this.onSocialClick(e[0])}}
|
|
2162
|
+
size="lg"
|
|
2163
|
+
icon=${w(e[0])}
|
|
2164
|
+
text=${`Continue with ${F.capitalize(e[0])}`}
|
|
2165
|
+
tabIdx=${w(this.tabIdx)}
|
|
2166
|
+
?disabled=${this.isPwaLoading||this.hasConnection()}
|
|
2167
|
+
></wui-list-button>`}bottomViewTemplate(){var s;let e=(s=this.remoteFeatures)==null?void 0:s.socials;const i=this.walletGuide==="explore";return(!this.authConnector||!e||e.length===0)&&i&&(e=D.DEFAULT_SOCIALS),!e||e.length<=gi?null:e&&e.length>yi?l`<wui-flex gap="2">
|
|
2168
|
+
${e.slice(1,yi-1).map(n=>l`<wui-logo-select
|
|
2169
|
+
data-testid=${`social-selector-${n}`}
|
|
2170
|
+
@click=${()=>{this.onSocialClick(n)}}
|
|
2171
|
+
logo=${n}
|
|
2172
|
+
tabIdx=${w(this.tabIdx)}
|
|
2173
|
+
?focusable=${this.tabIdx!==void 0&&this.tabIdx>=0}
|
|
2174
|
+
?disabled=${this.isPwaLoading||this.hasConnection()}
|
|
2175
|
+
></wui-logo-select>`)}
|
|
2176
|
+
<wui-logo-select
|
|
2177
|
+
logo="more"
|
|
2178
|
+
tabIdx=${w(this.tabIdx)}
|
|
2179
|
+
@click=${this.onMoreSocialsClick.bind(this)}
|
|
2180
|
+
?disabled=${this.isPwaLoading||this.hasConnection()}
|
|
2181
|
+
data-testid="social-selector-more"
|
|
2182
|
+
></wui-logo-select>
|
|
2183
|
+
</wui-flex>`:e?l`<wui-flex gap="2">
|
|
2184
|
+
${e.slice(1,e.length).map(n=>l`<wui-logo-select
|
|
2185
|
+
data-testid=${`social-selector-${n}`}
|
|
2186
|
+
@click=${()=>{this.onSocialClick(n)}}
|
|
2187
|
+
logo=${n}
|
|
2188
|
+
tabIdx=${w(this.tabIdx)}
|
|
2189
|
+
?focusable=${this.tabIdx!==void 0&&this.tabIdx>=0}
|
|
2190
|
+
?disabled=${this.isPwaLoading||this.hasConnection()}
|
|
2191
|
+
></wui-logo-select>`)}
|
|
2192
|
+
</wui-flex>`:null}onMoreSocialsClick(){h.push("ConnectSocials")}async onSocialClick(e){if(this.hasExceededUsageLimit){h.push("UsageExceeded");return}if(!S.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(o=>o===u.state.activeChain)){const o=u.getFirstCaipNetworkSupportsAuthConnector();if(o){h.push("SwitchNetwork",{network:o});return}}e&&await Ji(e)}async handlePwaFrameLoad(){var e;if(y.isPWA()){this.isPwaLoading=!0;try{((e=this.authConnector)==null?void 0:e.provider)instanceof qi&&await this.authConnector.provider.init()}catch(i){Ai.open({displayMessage:"Error loading embedded wallet in PWA",debugMessage:i.message},"error")}finally{this.isPwaLoading=!1}}}hasConnection(){return x.hasAnyConnection(S.CONNECTOR_ID.AUTH)}};ce.styles=Dn;Ce([c()],ce.prototype,"walletGuide",void 0);Ce([c()],ce.prototype,"tabIdx",void 0);Ce([d()],ce.prototype,"connectors",void 0);Ce([d()],ce.prototype,"remoteFeatures",void 0);Ce([d()],ce.prototype,"authConnector",void 0);Ce([d()],ce.prototype,"isPwaLoading",void 0);Ce([d()],ce.prototype,"hasExceededUsageLimit",void 0);ce=Ce([p("w3m-social-login-widget")],ce);var Je=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ne=class extends m{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=b.state.connectors,this.count=A.state.count,this.filteredCount=A.state.filteredWallets.length,this.isFetchingRecommendedWallets=A.state.isFetchingRecommendedWallets,this.unsubscribe.push(b.subscribeKey("connectors",e=>this.connectors=e),A.subscribeKey("count",e=>this.count=e),A.subscribeKey("filteredWallets",e=>this.filteredCount=e.length),A.subscribeKey("isFetchingRecommendedWallets",e=>this.isFetchingRecommendedWallets=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.find($=>$.id==="walletConnect"),{allWallets:i}=f.state;if(!e||i==="HIDE"||i==="ONLY_MOBILE"&&!y.isMobile())return null;const o=A.state.featured.length,s=this.count+o,n=s<10?s:Math.floor(s/10)*10,a=this.filteredCount>0?this.filteredCount:n;let r=`${a}`;this.filteredCount>0?r=`${this.filteredCount}`:a<s&&(r=`${a}+`);const g=x.hasAnyConnection(S.CONNECTOR_ID.WALLET_CONNECT);return l`
|
|
2193
|
+
<wui-list-wallet
|
|
2194
|
+
name="Search Wallet"
|
|
2195
|
+
walletIcon="search"
|
|
2196
|
+
showAllWallets
|
|
2197
|
+
@click=${this.onAllWallets.bind(this)}
|
|
2198
|
+
tagLabel=${r}
|
|
2199
|
+
tagVariant="info"
|
|
2200
|
+
data-testid="all-wallets"
|
|
2201
|
+
tabIdx=${w(this.tabIdx)}
|
|
2202
|
+
.loading=${this.isFetchingRecommendedWallets}
|
|
2203
|
+
?disabled=${g}
|
|
2204
|
+
size="sm"
|
|
2205
|
+
></wui-list-wallet>
|
|
2206
|
+
`}onAllWallets(){var e;C.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),h.push("AllWallets",{redirectView:(e=h.state.data)==null?void 0:e.redirectView})}};Je([c()],Ne.prototype,"tabIdx",void 0);Je([d()],Ne.prototype,"connectors",void 0);Je([d()],Ne.prototype,"count",void 0);Je([d()],Ne.prototype,"filteredCount",void 0);Je([d()],Ne.prototype,"isFetchingRecommendedWallets",void 0);Ne=Je([p("w3m-all-wallets-widget")],Ne);const Ln=v`
|
|
2207
|
+
:host {
|
|
2208
|
+
margin-top: ${({spacing:t})=>t[1]};
|
|
2209
|
+
}
|
|
2210
|
+
wui-separator {
|
|
2211
|
+
margin: ${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1)
|
|
2212
|
+
${({spacing:t})=>t[2]} calc(${({spacing:t})=>t[3]} * -1);
|
|
2213
|
+
width: calc(100% + ${({spacing:t})=>t[3]} * 2);
|
|
2214
|
+
}
|
|
2215
|
+
`;var Ze=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let xe=class extends m{constructor(){super(),this.unsubscribe=[],this.explorerWallets=A.state.explorerWallets,this.connections=x.state.connections,this.connectorImages=Te.state.connectorImages,this.loadingTelegram=!1,this.unsubscribe.push(x.subscribeKey("connections",e=>this.connections=e),Te.subscribeKey("connectorImages",e=>this.connectorImages=e),A.subscribeKey("explorerFilteredWallets",e=>{this.explorerWallets=e!=null&&e.length?e:A.state.explorerWallets}),A.subscribeKey("explorerWallets",e=>{var i;(i=this.explorerWallets)!=null&&i.length||(this.explorerWallets=e)})),y.isTelegram()&&y.isIos()&&(this.loadingTelegram=!x.state.wcUri,this.unsubscribe.push(x.subscribeKey("wcUri",e=>this.loadingTelegram=!e)))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
|
|
2216
|
+
<wui-flex flexDirection="column" gap="2"> ${this.connectorListTemplate()} </wui-flex>
|
|
2217
|
+
`}connectorListTemplate(){return Xt.connectorList().map((e,i)=>e.kind==="connector"?this.renderConnector(e,i):this.renderWallet(e,i))}getConnectorNamespaces(e){var i;return e.subtype==="walletConnect"?[]:e.subtype==="multiChain"?((i=e.connector.connectors)==null?void 0:i.map(o=>o.chain))||[]:[e.connector.chain]}renderConnector(e,i){var _,O;const o=e.connector,s=T.getConnectorImage(o)||this.connectorImages[(o==null?void 0:o.imageId)??""],a=(this.connections.get(o.chain)??[]).some(Lt=>J.isLowerCaseMatch(Lt.connectorId,o.id));let r,g;e.subtype==="walletConnect"?(r="qr code",g="accent"):e.subtype==="injected"||e.subtype==="announced"?(r=a?"connected":"installed",g=a?"info":"success"):(r=void 0,g=void 0);const $=x.hasAnyConnection(S.CONNECTOR_ID.WALLET_CONNECT),E=e.subtype==="walletConnect"||e.subtype==="external"?$:!1;return l`
|
|
2218
|
+
<w3m-list-wallet
|
|
2219
|
+
displayIndex=${i}
|
|
2220
|
+
imageSrc=${w(s)}
|
|
2221
|
+
.installed=${!0}
|
|
2222
|
+
name=${o.name??"Unknown"}
|
|
2223
|
+
.tagVariant=${g}
|
|
2224
|
+
tagLabel=${w(r)}
|
|
2225
|
+
data-testid=${`wallet-selector-${o.id.toLowerCase()}`}
|
|
2226
|
+
size="sm"
|
|
2227
|
+
@click=${()=>this.onClickConnector(e)}
|
|
2228
|
+
tabIdx=${w(this.tabIdx)}
|
|
2229
|
+
?disabled=${E}
|
|
2230
|
+
rdnsId=${w(((_=o.explorerWallet)==null?void 0:_.rdns)||void 0)}
|
|
2231
|
+
walletRank=${w((O=o.explorerWallet)==null?void 0:O.order)}
|
|
2232
|
+
.namespaces=${this.getConnectorNamespaces(e)}
|
|
2233
|
+
>
|
|
2234
|
+
</w3m-list-wallet>
|
|
2235
|
+
`}onClickConnector(e){var o;const i=(o=h.state.data)==null?void 0:o.redirectView;if(e.subtype==="walletConnect"){b.setActiveConnector(e.connector),y.isMobile()?h.push("AllWallets"):h.push("ConnectingWalletConnect",{redirectView:i});return}if(e.subtype==="multiChain"){b.setActiveConnector(e.connector),h.push("ConnectingMultiChain",{redirectView:i});return}if(e.subtype==="injected"){b.setActiveConnector(e.connector),h.push("ConnectingExternal",{connector:e.connector,redirectView:i,wallet:e.connector.explorerWallet});return}if(e.subtype==="announced"){if(e.connector.id==="walletConnect"){y.isMobile()?h.push("AllWallets"):h.push("ConnectingWalletConnect",{redirectView:i});return}h.push("ConnectingExternal",{connector:e.connector,redirectView:i,wallet:e.connector.explorerWallet});return}h.push("ConnectingExternal",{connector:e.connector,redirectView:i})}renderWallet(e,i){const o=e.wallet,s=T.getWalletImage(o),a=x.hasAnyConnection(S.CONNECTOR_ID.WALLET_CONNECT),r=this.loadingTelegram,g=e.subtype==="recent"?"recent":void 0,$=e.subtype==="recent"?"info":void 0;return l`
|
|
2236
|
+
<w3m-list-wallet
|
|
2237
|
+
displayIndex=${i}
|
|
2238
|
+
imageSrc=${w(s)}
|
|
2239
|
+
name=${o.name??"Unknown"}
|
|
2240
|
+
@click=${()=>this.onClickWallet(e)}
|
|
2241
|
+
size="sm"
|
|
2242
|
+
data-testid=${`wallet-selector-${o.id}`}
|
|
2243
|
+
tabIdx=${w(this.tabIdx)}
|
|
2244
|
+
?loading=${r}
|
|
2245
|
+
?disabled=${a}
|
|
2246
|
+
rdnsId=${w(o.rdns||void 0)}
|
|
2247
|
+
walletRank=${w(o.order)}
|
|
2248
|
+
tagLabel=${w(g)}
|
|
2249
|
+
.tagVariant=${$}
|
|
2250
|
+
>
|
|
2251
|
+
</w3m-list-wallet>
|
|
2252
|
+
`}onClickWallet(e){var n;const i=(n=h.state.data)==null?void 0:n.redirectView,o=u.state.activeChain;if(e.subtype==="featured"){b.selectWalletConnector(e.wallet);return}if(e.subtype==="recent"){if(this.loadingTelegram)return;b.selectWalletConnector(e.wallet);return}if(e.subtype==="custom"){if(this.loadingTelegram)return;h.push("ConnectingWalletConnect",{wallet:e.wallet,redirectView:i});return}if(this.loadingTelegram)return;const s=o?b.getConnector({id:e.wallet.id,namespace:o}):void 0;s?h.push("ConnectingExternal",{connector:s,redirectView:i}):h.push("ConnectingWalletConnect",{wallet:e.wallet,redirectView:i})}};xe.styles=Ln;Ze([c({type:Number})],xe.prototype,"tabIdx",void 0);Ze([d()],xe.prototype,"explorerWallets",void 0);Ze([d()],xe.prototype,"connections",void 0);Ze([d()],xe.prototype,"connectorImages",void 0);Ze([d()],xe.prototype,"loadingTelegram",void 0);xe=Ze([p("w3m-connector-list")],xe);var Pi=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Mt=class extends m{constructor(){super(...arguments),this.tabIdx=void 0}render(){return l`
|
|
2253
|
+
<wui-flex flexDirection="column" gap="2">
|
|
2254
|
+
<w3m-connector-list tabIdx=${w(this.tabIdx)}></w3m-connector-list>
|
|
2255
|
+
<w3m-all-wallets-widget tabIdx=${w(this.tabIdx)}></w3m-all-wallets-widget>
|
|
2256
|
+
</wui-flex>
|
|
2257
|
+
`}};Pi([c()],Mt.prototype,"tabIdx",void 0);Mt=Pi([p("w3m-wallet-login-list")],Mt);const jn=v`
|
|
2258
|
+
:host {
|
|
2259
|
+
--connect-scroll--top-opacity: 0;
|
|
2260
|
+
--connect-scroll--bottom-opacity: 0;
|
|
2261
|
+
--connect-mask-image: none;
|
|
2262
|
+
}
|
|
2263
|
+
|
|
2264
|
+
.connect {
|
|
2265
|
+
max-height: clamp(360px, 470px, 80vh);
|
|
2266
|
+
scrollbar-width: none;
|
|
2267
|
+
overflow-y: scroll;
|
|
2268
|
+
overflow-x: hidden;
|
|
2269
|
+
transition: opacity ${({durations:t})=>t.lg}
|
|
2270
|
+
${({easings:t})=>t["ease-out-power-2"]};
|
|
2271
|
+
will-change: opacity;
|
|
2272
|
+
mask-image: var(--connect-mask-image);
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
.guide {
|
|
2276
|
+
transition: opacity ${({durations:t})=>t.lg}
|
|
2277
|
+
${({easings:t})=>t["ease-out-power-2"]};
|
|
2278
|
+
will-change: opacity;
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2281
|
+
.connect::-webkit-scrollbar {
|
|
2282
|
+
display: none;
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
.all-wallets {
|
|
2286
|
+
flex-flow: column;
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
.connect.disabled,
|
|
2290
|
+
.guide.disabled {
|
|
2291
|
+
opacity: 0.3;
|
|
2292
|
+
pointer-events: none;
|
|
2293
|
+
user-select: none;
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
wui-separator {
|
|
2297
|
+
margin: ${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1);
|
|
2298
|
+
width: calc(100% + ${({spacing:t})=>t[3]} * 2);
|
|
2299
|
+
}
|
|
2300
|
+
`;var oe=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Bn=470;let H=class extends m{constructor(){var e,i;super(),this.unsubscribe=[],this.connectors=b.state.connectors,this.authConnector=this.connectors.find(o=>o.type==="AUTH"),this.features=f.state.features,this.remoteFeatures=f.state.remoteFeatures,this.enableWallets=f.state.enableWallets,this.noAdapters=u.state.noAdapters,this.walletGuide="get-started",this.checked=bt.state.isLegalCheckboxChecked,this.isEmailEnabled=((e=this.remoteFeatures)==null?void 0:e.email)&&!u.state.noAdapters,this.isSocialEnabled=((i=this.remoteFeatures)==null?void 0:i.socials)&&this.remoteFeatures.socials.length>0&&!u.state.noAdapters,this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors),this.unsubscribe.push(b.subscribeKey("connectors",o=>{this.connectors=o,this.authConnector=this.connectors.find(s=>s.type==="AUTH"),this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors)}),f.subscribeKey("features",o=>{this.features=o}),f.subscribeKey("remoteFeatures",o=>{this.remoteFeatures=o,this.setEmailAndSocialEnableCheck(this.noAdapters,this.remoteFeatures)}),f.subscribeKey("enableWallets",o=>this.enableWallets=o),u.subscribeKey("noAdapters",o=>this.setEmailAndSocialEnableCheck(o,this.remoteFeatures)),bt.subscribeKey("isLegalCheckboxChecked",o=>this.checked=o))}disconnectedCallback(){var i,o;this.unsubscribe.forEach(s=>s()),(i=this.resizeObserver)==null||i.disconnect();const e=(o=this.shadowRoot)==null?void 0:o.querySelector(".connect");e==null||e.removeEventListener("scroll",this.handleConnectListScroll.bind(this))}firstUpdated(){var i,o;const e=(i=this.shadowRoot)==null?void 0:i.querySelector(".connect");e&&(requestAnimationFrame(this.handleConnectListScroll.bind(this)),e==null||e.addEventListener("scroll",this.handleConnectListScroll.bind(this)),this.resizeObserver=new ResizeObserver(()=>{this.handleConnectListScroll()}),(o=this.resizeObserver)==null||o.observe(e),this.handleConnectListScroll())}render(){var O;const{termsConditionsUrl:e,privacyPolicyUrl:i}=f.state,o=(O=f.state.features)==null?void 0:O.legalCheckbox,a=!!(e||i)&&!!o&&this.walletGuide==="get-started"&&!this.checked,r={connect:!0,disabled:a},g=f.state.enableWalletGuide,$=this.enableWallets,E=this.isSocialEnabled||this.authConnector,_=a?-1:void 0;return l`
|
|
2301
|
+
<wui-flex flexDirection="column">
|
|
2302
|
+
${this.legalCheckboxTemplate()}
|
|
2303
|
+
<wui-flex
|
|
2304
|
+
data-testid="w3m-connect-scroll-view"
|
|
2305
|
+
flexDirection="column"
|
|
2306
|
+
.padding=${["0","0","4","0"]}
|
|
2307
|
+
class=${Ii(r)}
|
|
2308
|
+
>
|
|
2309
|
+
<wui-flex
|
|
2310
|
+
class="connect-methods"
|
|
2311
|
+
flexDirection="column"
|
|
2312
|
+
gap="2"
|
|
2313
|
+
.padding=${E&&$&&g&&this.walletGuide==="get-started"?["0","3","0","3"]:["0","3","3","3"]}
|
|
2314
|
+
>
|
|
2315
|
+
${this.renderConnectMethod(_)}
|
|
2316
|
+
</wui-flex>
|
|
2317
|
+
</wui-flex>
|
|
2318
|
+
${this.reownBrandingTemplate()}
|
|
2319
|
+
</wui-flex>
|
|
2320
|
+
`}reownBrandingTemplate(){var e;return Jt.hasFooter()||!((e=this.remoteFeatures)!=null&&e.reownBranding)?null:l`<wui-ux-by-reown></wui-ux-by-reown>`}setEmailAndSocialEnableCheck(e,i){this.isEmailEnabled=(i==null?void 0:i.email)&&!e,this.isSocialEnabled=(i==null?void 0:i.socials)&&i.socials.length>0&&!e,this.remoteFeatures=i,this.noAdapters=e}checkIfAuthEnabled(e){const i=e.filter(s=>s.type===Gi.CONNECTOR_TYPE_AUTH).map(s=>s.chain);return S.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(s=>i.includes(s))}renderConnectMethod(e){const i=tt.getConnectOrderMethod(this.features,this.connectors);return l`${i.map((o,s)=>{switch(o){case"email":return l`${this.emailTemplate(e)} ${this.separatorTemplate(s,"email")}`;case"social":return l`${this.socialListTemplate(e)}
|
|
2321
|
+
${this.separatorTemplate(s,"social")}`;case"wallet":return l`${this.walletListTemplate(e)}
|
|
2322
|
+
${this.separatorTemplate(s,"wallet")}`;default:return null}})}`}checkMethodEnabled(e){switch(e){case"wallet":return this.enableWallets;case"social":return this.isSocialEnabled&&this.isAuthEnabled;case"email":return this.isEmailEnabled&&this.isAuthEnabled;default:return null}}checkIsThereNextMethod(e){const o=tt.getConnectOrderMethod(this.features,this.connectors)[e+1];return o?this.checkMethodEnabled(o)?o:this.checkIsThereNextMethod(e+1):void 0}separatorTemplate(e,i){const o=this.checkIsThereNextMethod(e),s=this.walletGuide==="explore";switch(i){case"wallet":return this.enableWallets&&o&&!s?l`<wui-separator data-testid="wui-separator" text="or"></wui-separator>`:null;case"email":{const n=o==="social";return this.isAuthEnabled&&this.isEmailEnabled&&!n&&o?l`<wui-separator
|
|
2323
|
+
data-testid="w3m-email-login-or-separator"
|
|
2324
|
+
text="or"
|
|
2325
|
+
></wui-separator>`:null}case"social":{const n=o==="email";return this.isAuthEnabled&&this.isSocialEnabled&&!n&&o?l`<wui-separator data-testid="wui-separator" text="or"></wui-separator>`:null}default:return null}}emailTemplate(e){return!this.isEmailEnabled||!this.isAuthEnabled?null:l`<w3m-email-login-widget tabIdx=${w(e)}></w3m-email-login-widget>`}socialListTemplate(e){return!this.isSocialEnabled||!this.isAuthEnabled?null:l`<w3m-social-login-widget
|
|
2326
|
+
walletGuide=${this.walletGuide}
|
|
2327
|
+
tabIdx=${w(e)}
|
|
2328
|
+
></w3m-social-login-widget>`}walletListTemplate(e){var r,g;const i=this.enableWallets,o=((r=this.features)==null?void 0:r.emailShowWallets)===!1,s=(g=this.features)==null?void 0:g.collapseWallets,n=o||s;return!i||(y.isTelegram()&&(y.isSafari()||y.isIos())&&x.connectWalletConnect().catch($=>({})),this.walletGuide==="explore")?null:this.isAuthEnabled&&(this.isEmailEnabled||this.isSocialEnabled)&&n?l`<wui-list-button
|
|
2329
|
+
data-testid="w3m-collapse-wallets-button"
|
|
2330
|
+
tabIdx=${w(e)}
|
|
2331
|
+
@click=${this.onContinueWalletClick.bind(this)}
|
|
2332
|
+
text="Continue with a wallet"
|
|
2333
|
+
></wui-list-button>`:l`<w3m-wallet-login-list tabIdx=${w(e)}></w3m-wallet-login-list>`}legalCheckboxTemplate(){return this.walletGuide==="explore"?null:l`<w3m-legal-checkbox data-testid="w3m-legal-checkbox"></w3m-legal-checkbox>`}handleConnectListScroll(){var o;const e=(o=this.shadowRoot)==null?void 0:o.querySelector(".connect");if(!e)return;e.scrollHeight>Bn?(e.style.setProperty("--connect-mask-image",`linear-gradient(
|
|
2334
|
+
to bottom,
|
|
2335
|
+
rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px,
|
|
2336
|
+
rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px,
|
|
2337
|
+
black 100px,
|
|
2338
|
+
black calc(100% - 100px),
|
|
2339
|
+
rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px),
|
|
2340
|
+
rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100%
|
|
2341
|
+
)`),e.style.setProperty("--connect-scroll--top-opacity",ft.interpolate([0,50],[0,1],e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",ft.interpolate([0,50],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString())):(e.style.setProperty("--connect-mask-image","none"),e.style.setProperty("--connect-scroll--top-opacity","0"),e.style.setProperty("--connect-scroll--bottom-opacity","0"))}onContinueWalletClick(){h.push("ConnectWallets")}};H.styles=jn;oe([d()],H.prototype,"connectors",void 0);oe([d()],H.prototype,"authConnector",void 0);oe([d()],H.prototype,"features",void 0);oe([d()],H.prototype,"remoteFeatures",void 0);oe([d()],H.prototype,"enableWallets",void 0);oe([d()],H.prototype,"noAdapters",void 0);oe([c()],H.prototype,"walletGuide",void 0);oe([d()],H.prototype,"checked",void 0);oe([d()],H.prototype,"isEmailEnabled",void 0);oe([d()],H.prototype,"isSocialEnabled",void 0);oe([d()],H.prototype,"isAuthEnabled",void 0);H=oe([p("w3m-connect-view")],H);const Un=v`
|
|
2342
|
+
wui-flex {
|
|
2343
|
+
width: 100%;
|
|
2344
|
+
height: 52px;
|
|
2345
|
+
box-sizing: border-box;
|
|
2346
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
2347
|
+
border-radius: ${({borderRadius:t})=>t[5]};
|
|
2348
|
+
padding-left: ${({spacing:t})=>t[3]};
|
|
2349
|
+
padding-right: ${({spacing:t})=>t[3]};
|
|
2350
|
+
display: flex;
|
|
2351
|
+
align-items: center;
|
|
2352
|
+
justify-content: space-between;
|
|
2353
|
+
gap: ${({spacing:t})=>t[6]};
|
|
2354
|
+
}
|
|
2355
|
+
|
|
2356
|
+
wui-text {
|
|
2357
|
+
color: ${({tokens:t})=>t.theme.textSecondary};
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
wui-icon {
|
|
2361
|
+
width: 12px;
|
|
2362
|
+
height: 12px;
|
|
2363
|
+
}
|
|
2364
|
+
`;var Ot=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ke=class extends m{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return l`
|
|
2365
|
+
<wui-flex justifyContent="space-between" alignItems="center">
|
|
2366
|
+
<wui-text variant="lg-regular" color="inherit">${this.label}</wui-text>
|
|
2367
|
+
<wui-button variant="accent-secondary" size="sm">
|
|
2368
|
+
${this.buttonLabel}
|
|
2369
|
+
<wui-icon name="chevronRight" color="inherit" size="inherit" slot="iconRight"></wui-icon>
|
|
2370
|
+
</wui-button>
|
|
2371
|
+
</wui-flex>
|
|
2372
|
+
`}};Ke.styles=[I,W,Un];Ot([c({type:Boolean})],Ke.prototype,"disabled",void 0);Ot([c()],Ke.prototype,"label",void 0);Ot([c()],Ke.prototype,"buttonLabel",void 0);Ke=Ot([p("wui-cta-button")],Ke);const zn=v`
|
|
2373
|
+
:host {
|
|
2374
|
+
display: block;
|
|
2375
|
+
padding: 0 ${({spacing:t})=>t[5]} ${({spacing:t})=>t[5]};
|
|
2376
|
+
}
|
|
2377
|
+
`;var Di=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let $t=class extends m{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;const{name:e,app_store:i,play_store:o,chrome_store:s,homepage:n}=this.wallet,a=y.isMobile(),r=y.isIos(),g=y.isAndroid(),$=[i,o,n,s].filter(Boolean).length>1,E=F.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return $&&!a?l`
|
|
2378
|
+
<wui-cta-button
|
|
2379
|
+
label=${`Don't have ${E}?`}
|
|
2380
|
+
buttonLabel="Get"
|
|
2381
|
+
@click=${()=>h.push("Downloads",{wallet:this.wallet})}
|
|
2382
|
+
></wui-cta-button>
|
|
2383
|
+
`:!$&&n?l`
|
|
2384
|
+
<wui-cta-button
|
|
2385
|
+
label=${`Don't have ${E}?`}
|
|
2386
|
+
buttonLabel="Get"
|
|
2387
|
+
@click=${this.onHomePage.bind(this)}
|
|
2388
|
+
></wui-cta-button>
|
|
2389
|
+
`:i&&r?l`
|
|
2390
|
+
<wui-cta-button
|
|
2391
|
+
label=${`Don't have ${E}?`}
|
|
2392
|
+
buttonLabel="Get"
|
|
2393
|
+
@click=${this.onAppStore.bind(this)}
|
|
2394
|
+
></wui-cta-button>
|
|
2395
|
+
`:o&&g?l`
|
|
2396
|
+
<wui-cta-button
|
|
2397
|
+
label=${`Don't have ${E}?`}
|
|
2398
|
+
buttonLabel="Get"
|
|
2399
|
+
@click=${this.onPlayStore.bind(this)}
|
|
2400
|
+
></wui-cta-button>
|
|
2401
|
+
`:(this.style.display="none",null)}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&y.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&y.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&y.openHref(this.wallet.homepage,"_blank")}};$t.styles=[zn];Di([c({type:Object})],$t.prototype,"wallet",void 0);$t=Di([p("w3m-mobile-download-links")],$t);const Fn=v`
|
|
2402
|
+
@keyframes shake {
|
|
2403
|
+
0% {
|
|
2404
|
+
transform: translateX(0);
|
|
2405
|
+
}
|
|
2406
|
+
25% {
|
|
2407
|
+
transform: translateX(3px);
|
|
2408
|
+
}
|
|
2409
|
+
50% {
|
|
2410
|
+
transform: translateX(-3px);
|
|
2411
|
+
}
|
|
2412
|
+
75% {
|
|
2413
|
+
transform: translateX(3px);
|
|
2414
|
+
}
|
|
2415
|
+
100% {
|
|
2416
|
+
transform: translateX(0);
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2420
|
+
wui-flex:first-child:not(:only-child) {
|
|
2421
|
+
position: relative;
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
wui-wallet-image {
|
|
2425
|
+
width: 56px;
|
|
2426
|
+
height: 56px;
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
wui-loading-thumbnail {
|
|
2430
|
+
position: absolute;
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
wui-icon-box {
|
|
2434
|
+
position: absolute;
|
|
2435
|
+
right: calc(${({spacing:t})=>t[1]} * -1);
|
|
2436
|
+
bottom: calc(${({spacing:t})=>t[1]} * -1);
|
|
2437
|
+
opacity: 0;
|
|
2438
|
+
transform: scale(0.5);
|
|
2439
|
+
transition-property: opacity, transform;
|
|
2440
|
+
transition-duration: ${({durations:t})=>t.lg};
|
|
2441
|
+
transition-timing-function: ${({easings:t})=>t["ease-out-power-2"]};
|
|
2442
|
+
will-change: opacity, transform;
|
|
2443
|
+
}
|
|
2444
|
+
|
|
2445
|
+
wui-text[align='center'] {
|
|
2446
|
+
width: 100%;
|
|
2447
|
+
padding: 0px ${({spacing:t})=>t[4]};
|
|
2448
|
+
}
|
|
2449
|
+
|
|
2450
|
+
[data-error='true'] wui-icon-box {
|
|
2451
|
+
opacity: 1;
|
|
2452
|
+
transform: scale(1);
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
[data-error='true'] > wui-flex:first-child {
|
|
2456
|
+
animation: shake 250ms ${({easings:t})=>t["ease-out-power-2"]} both;
|
|
2457
|
+
}
|
|
2458
|
+
|
|
2459
|
+
[data-retry='false'] wui-link {
|
|
2460
|
+
display: none;
|
|
2461
|
+
}
|
|
2462
|
+
|
|
2463
|
+
[data-retry='true'] wui-link {
|
|
2464
|
+
display: block;
|
|
2465
|
+
opacity: 1;
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
w3m-mobile-download-links {
|
|
2469
|
+
padding: 0px;
|
|
2470
|
+
width: 100%;
|
|
2471
|
+
}
|
|
2472
|
+
`;var le=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};class N extends m{constructor(){var e,i,o,s,n;super(),this.wallet=(e=h.state.data)==null?void 0:e.wallet,this.connector=(i=h.state.data)==null?void 0:i.connector,this.timeout=void 0,this.secondaryBtnIcon="refresh",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=T.getConnectorImage(this.connector)??T.getWalletImage(this.wallet),this.name=((o=this.wallet)==null?void 0:o.name)??((s=this.connector)==null?void 0:s.name)??"Wallet",this.isRetrying=!1,this.uri=x.state.wcUri,this.error=x.state.wcError,this.ready=!1,this.showRetry=!1,this.label=void 0,this.secondaryBtnLabel="Try again",this.secondaryLabel="Accept connection request in the wallet",this.isLoading=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(x.subscribeKey("wcUri",a=>{var r;this.uri=a,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,(r=this.onConnect)==null||r.call(this))}),x.subscribeKey("wcError",a=>this.error=a)),(y.isTelegram()||y.isSafari())&&y.isIos()&&x.state.wcUri&&((n=this.onConnect)==null||n.call(this))}firstUpdated(){var e;(e=this.onAutoConnect)==null||e.call(this),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),x.setWcError(!1),clearTimeout(this.timeout)}render(){var o;(o=this.onRender)==null||o.call(this),this.onShowRetry();const e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let i="";return this.label?i=this.label:(i=`Continue in ${this.name}`,this.error&&(i="Connection declined")),l`
|
|
2473
|
+
<wui-flex
|
|
2474
|
+
data-error=${w(this.error)}
|
|
2475
|
+
data-retry=${this.showRetry}
|
|
2476
|
+
flexDirection="column"
|
|
2477
|
+
alignItems="center"
|
|
2478
|
+
.padding=${["10","5","5","5"]}
|
|
2479
|
+
gap="6"
|
|
2480
|
+
>
|
|
2481
|
+
<wui-flex gap="2" justifyContent="center" alignItems="center">
|
|
2482
|
+
<wui-wallet-image size="lg" imageSrc=${w(this.imageSrc)}></wui-wallet-image>
|
|
2483
|
+
|
|
2484
|
+
${this.error?null:this.loaderTemplate()}
|
|
2485
|
+
|
|
2486
|
+
<wui-icon-box
|
|
2487
|
+
color="error"
|
|
2488
|
+
icon="close"
|
|
2489
|
+
size="sm"
|
|
2490
|
+
border
|
|
2491
|
+
borderColor="wui-color-bg-125"
|
|
2492
|
+
></wui-icon-box>
|
|
2493
|
+
</wui-flex>
|
|
2494
|
+
|
|
2495
|
+
<wui-flex flexDirection="column" alignItems="center" gap="6"> <wui-flex
|
|
2496
|
+
flexDirection="column"
|
|
2497
|
+
alignItems="center"
|
|
2498
|
+
gap="2"
|
|
2499
|
+
.padding=${["2","0","0","0"]}
|
|
2500
|
+
>
|
|
2501
|
+
<wui-text align="center" variant="lg-medium" color=${this.error?"error":"primary"}>
|
|
2502
|
+
${i}
|
|
2503
|
+
</wui-text>
|
|
2504
|
+
<wui-text align="center" variant="lg-regular" color="secondary">${e}</wui-text>
|
|
2505
|
+
</wui-flex>
|
|
2506
|
+
|
|
2507
|
+
${this.secondaryBtnLabel?l`
|
|
2508
|
+
<wui-button
|
|
2509
|
+
variant="neutral-secondary"
|
|
2510
|
+
size="md"
|
|
2511
|
+
?disabled=${this.isRetrying||this.isLoading}
|
|
2512
|
+
@click=${this.onTryAgain.bind(this)}
|
|
2513
|
+
data-testid="w3m-connecting-widget-secondary-button"
|
|
2514
|
+
>
|
|
2515
|
+
<wui-icon
|
|
2516
|
+
color="inherit"
|
|
2517
|
+
slot="iconLeft"
|
|
2518
|
+
name=${this.secondaryBtnIcon}
|
|
2519
|
+
></wui-icon>
|
|
2520
|
+
${this.secondaryBtnLabel}
|
|
2521
|
+
</wui-button>
|
|
2522
|
+
`:null}
|
|
2523
|
+
</wui-flex>
|
|
2524
|
+
|
|
2525
|
+
${this.isWalletConnect?l`
|
|
2526
|
+
<wui-flex .padding=${["0","5","5","5"]} justifyContent="center">
|
|
2527
|
+
<wui-link
|
|
2528
|
+
@click=${this.onCopyUri}
|
|
2529
|
+
variant="secondary"
|
|
2530
|
+
icon="copy"
|
|
2531
|
+
data-testid="wui-link-copy"
|
|
2532
|
+
>
|
|
2533
|
+
Copy link
|
|
2534
|
+
</wui-link>
|
|
2535
|
+
</wui-flex>
|
|
2536
|
+
`:null}
|
|
2537
|
+
|
|
2538
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links></wui-flex>
|
|
2539
|
+
</wui-flex>
|
|
2540
|
+
`}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const i=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");i==null||i.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){var e,i;x.setWcError(!1),this.onRetry?(this.isRetrying=!0,(e=this.onRetry)==null||e.call(this)):(i=this.onConnect)==null||i.call(this)}loaderTemplate(){const e=mt.state.themeVariables["--w3m-border-radius-master"],i=e?parseInt(e.replace("px",""),10):4;return l`<wui-loading-thumbnail radius=${i*9}></wui-loading-thumbnail>`}onCopyUri(){try{this.uri&&(y.copyToClopboard(this.uri),k.showSuccess("Link copied"))}catch{k.showError("Failed to copy")}}}N.styles=Fn;le([d()],N.prototype,"isRetrying",void 0);le([d()],N.prototype,"uri",void 0);le([d()],N.prototype,"error",void 0);le([d()],N.prototype,"ready",void 0);le([d()],N.prototype,"showRetry",void 0);le([d()],N.prototype,"label",void 0);le([d()],N.prototype,"secondaryBtnLabel",void 0);le([d()],N.prototype,"secondaryLabel",void 0);le([d()],N.prototype,"isLoading",void 0);le([c({type:Boolean})],N.prototype,"isMobile",void 0);le([c()],N.prototype,"onRetry",void 0);var Mn=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let xi=class extends N{constructor(){var i,o,s,n,a;if(super(),this.externalViewUnsubscribe=[],this.connectionsByNamespace=x.getConnections((i=this.connector)==null?void 0:i.chain),this.hasMultipleConnections=this.connectionsByNamespace.length>0,this.remoteFeatures=f.state.remoteFeatures,this.currentActiveConnectorId=b.state.activeConnectorIds[(o=this.connector)==null?void 0:o.chain],!this.connector)throw new Error("w3m-connecting-view: No connector provided");const e=(s=this.connector)==null?void 0:s.chain;this.isAlreadyConnected(this.connector)&&(this.secondaryBtnLabel=void 0,this.label=`This account is already linked, change your account in ${this.connector.name}`,this.secondaryLabel=`To link a new account, open ${this.connector.name} and switch to the account you want to link`),C.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser",displayIndex:(n=this.wallet)==null?void 0:n.display_index,walletRank:(a=this.wallet)==null?void 0:a.order,view:h.state.view}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1,this.externalViewUnsubscribe.push(b.subscribeKey("activeConnectorIds",r=>{var _;const g=r[e],$=(_=this.remoteFeatures)==null?void 0:_.multiWallet,{redirectView:E}=h.state.data??{};g!==this.currentActiveConnectorId&&(this.hasMultipleConnections&&$?(h.replace("ProfileWallets"),k.showSuccess("New Wallet Added")):E?h.replace(E):P.close())}),x.subscribeKey("connections",this.onConnectionsChange.bind(this)))}disconnectedCallback(){this.externalViewUnsubscribe.forEach(e=>e())}async onConnectProxy(){try{if(this.error=!1,this.connector){if(this.isAlreadyConnected(this.connector))return;(this.connector.id!==S.CONNECTOR_ID.COINBASE_SDK||!this.error)&&await x.connectExternal(this.connector,this.connector.chain)}}catch(e){e instanceof Yt&&e.originalName===Qt.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?C.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:e.message}}):C.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(e==null?void 0:e.message)??"Unknown"}}),this.error=!0}}onConnectionsChange(e){var i,o;if((i=this.connector)!=null&&i.chain&&e.get(this.connector.chain)&&this.isAlreadyConnected(this.connector)){const s=e.get(this.connector.chain)??[],n=(o=this.remoteFeatures)==null?void 0:o.multiWallet;if(s.length===0)h.replace("Connect");else{const a=he.getConnectionsByConnectorId(this.connectionsByNamespace,this.connector.id).flatMap(g=>g.accounts),r=he.getConnectionsByConnectorId(s,this.connector.id).flatMap(g=>g.accounts);r.length===0?this.hasMultipleConnections&&n?(h.replace("ProfileWallets"),k.showSuccess("Wallet deleted")):P.close():!a.every($=>r.some(E=>J.isLowerCaseMatch($.address,E.address)))&&n&&h.replace("ProfileWallets")}}}isAlreadyConnected(e){return!!e&&this.connectionsByNamespace.some(i=>J.isLowerCaseMatch(i.connectorId,e.id))}};xi=Mn([p("w3m-connecting-external-view")],xi);const Vn=ee`
|
|
2541
|
+
wui-flex,
|
|
2542
|
+
wui-list-wallet {
|
|
2543
|
+
width: 100%;
|
|
2544
|
+
}
|
|
2545
|
+
`;var Li=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ct=class extends m{constructor(){super(),this.unsubscribe=[],this.activeConnector=b.state.activeConnector,this.unsubscribe.push(b.subscribeKey("activeConnector",e=>this.activeConnector=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e;return l`
|
|
2546
|
+
<wui-flex
|
|
2547
|
+
flexDirection="column"
|
|
2548
|
+
alignItems="center"
|
|
2549
|
+
.padding=${["3","5","5","5"]}
|
|
2550
|
+
gap="5"
|
|
2551
|
+
>
|
|
2552
|
+
<wui-flex justifyContent="center" alignItems="center">
|
|
2553
|
+
<wui-wallet-image
|
|
2554
|
+
size="lg"
|
|
2555
|
+
imageSrc=${w(T.getConnectorImage(this.activeConnector))}
|
|
2556
|
+
></wui-wallet-image>
|
|
2557
|
+
</wui-flex>
|
|
2558
|
+
<wui-flex
|
|
2559
|
+
flexDirection="column"
|
|
2560
|
+
alignItems="center"
|
|
2561
|
+
gap="2"
|
|
2562
|
+
.padding=${["0","3","0","3"]}
|
|
2563
|
+
>
|
|
2564
|
+
<wui-text variant="lg-medium" color="primary">
|
|
2565
|
+
Select Chain for ${(e=this.activeConnector)==null?void 0:e.name}
|
|
2566
|
+
</wui-text>
|
|
2567
|
+
<wui-text align="center" variant="lg-regular" color="secondary"
|
|
2568
|
+
>Select which chain to connect to your multi chain wallet</wui-text
|
|
2569
|
+
>
|
|
2570
|
+
</wui-flex>
|
|
2571
|
+
<wui-flex
|
|
2572
|
+
flexGrow="1"
|
|
2573
|
+
flexDirection="column"
|
|
2574
|
+
alignItems="center"
|
|
2575
|
+
gap="2"
|
|
2576
|
+
.padding=${["2","0","2","0"]}
|
|
2577
|
+
>
|
|
2578
|
+
${this.networksTemplate()}
|
|
2579
|
+
</wui-flex>
|
|
2580
|
+
</wui-flex>
|
|
2581
|
+
`}networksTemplate(){var e,i;return(i=(e=this.activeConnector)==null?void 0:e.connectors)==null?void 0:i.map((o,s)=>{var n;return o.name?l`
|
|
2582
|
+
<w3m-list-wallet
|
|
2583
|
+
displayIndex=${s}
|
|
2584
|
+
imageSrc=${w(T.getChainImage(o.chain))}
|
|
2585
|
+
name=${S.CHAIN_NAME_MAP[o.chain]}
|
|
2586
|
+
@click=${()=>this.onConnector(o)}
|
|
2587
|
+
size="sm"
|
|
2588
|
+
data-testid="wui-list-chain-${o.chain}"
|
|
2589
|
+
rdnsId=${(n=o.explorerWallet)==null?void 0:n.rdns}
|
|
2590
|
+
></w3m-list-wallet>
|
|
2591
|
+
`:null})}onConnector(e){var s,n,a,r;const i=(n=(s=this.activeConnector)==null?void 0:s.connectors)==null?void 0:n.find(g=>g.chain===e.chain),o=(a=h.state.data)==null?void 0:a.redirectView;if(!i){k.showError("Failed to find connector");return}i.id==="walletConnect"?y.isMobile()?h.push("AllWallets"):h.push("ConnectingWalletConnect",{redirectView:o}):h.push("ConnectingExternal",{connector:i,redirectView:o,wallet:(r=this.activeConnector)==null?void 0:r.explorerWallet})}};Ct.styles=Vn;Li([d()],Ct.prototype,"activeConnector",void 0);Ct=Li([p("w3m-connecting-multi-chain-view")],Ct);var oi=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Tt=class extends m{constructor(){super(...arguments),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.generateTabs();return l`
|
|
2592
|
+
<wui-flex justifyContent="center" .padding=${["0","0","4","0"]}>
|
|
2593
|
+
<wui-tabs .tabs=${e} .onTabChange=${this.onTabChange.bind(this)}></wui-tabs>
|
|
2594
|
+
</wui-flex>
|
|
2595
|
+
`}generateTabs(){const e=this.platforms.map(i=>i==="browser"?{label:"Browser",icon:"extension",platform:"browser"}:i==="mobile"?{label:"Mobile",icon:"mobile",platform:"mobile"}:i==="qrcode"?{label:"Mobile",icon:"mobile",platform:"qrcode"}:i==="web"?{label:"Webapp",icon:"browser",platform:"web"}:i==="desktop"?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=e.map(({platform:i})=>i),e}onTabChange(e){var o;const i=this.platformTabs[e];i&&((o=this.onSelectPlatfrom)==null||o.call(this,i))}};oi([c({type:Array})],Tt.prototype,"platforms",void 0);oi([c()],Tt.prototype,"onSelectPlatfrom",void 0);Tt=oi([p("w3m-connecting-header")],Tt);var Hn=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let vi=class extends N{constructor(){var e;if(super(),!this.wallet)throw new Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),C.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:(e=this.wallet)==null?void 0:e.display_index,walletRank:this.wallet.order,view:h.state.view}})}async onConnectProxy(){try{this.error=!1;const{connectors:e}=b.state,i=e.find(o=>{var s,n,a;return o.type==="ANNOUNCED"&&((s=o.info)==null?void 0:s.rdns)===((n=this.wallet)==null?void 0:n.rdns)||o.type==="INJECTED"||o.name===((a=this.wallet)==null?void 0:a.name)});if(i)await x.connectExternal(i,i.chain);else throw new Error("w3m-connecting-wc-browser: No connector found");P.close()}catch(e){e instanceof Yt&&e.originalName===Qt.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?C.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:e.message}}):C.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(e==null?void 0:e.message)??"Unknown"}}),this.error=!0}}};vi=Hn([p("w3m-connecting-wc-browser")],vi);var Kn=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let $i=class extends N{constructor(){var e;if(super(),!this.wallet)throw new Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),C.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop",displayIndex:(e=this.wallet)==null?void 0:e.display_index,walletRank:this.wallet.order,view:h.state.view}})}onRenderProxy(){var e;!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.desktop_link&&this.uri)try{this.error=!1;const{desktop_link:i,name:o}=this.wallet,{redirect:s,href:n}=y.formatNativeUrl(i,this.uri);x.setWcLinking({name:o,href:n}),x.setRecentWallet(this.wallet),y.openHref(s,"_blank")}catch{this.error=!0}}};$i=Kn([p("w3m-connecting-wc-desktop")],$i);var et=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Oe=class extends N{constructor(){var e;if(super(),this.btnLabelTimeout=void 0,this.redirectDeeplink=void 0,this.redirectUniversalLink=void 0,this.target=void 0,this.preferUniversalLinks=f.state.experimental_preferUniversalLinks,this.isLoading=!0,this.onConnect=()=>{he.onConnectMobile(this.wallet)},!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel="Open",this.secondaryLabel=D.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.onHandleURI(),this.unsubscribe.push(x.subscribeKey("wcUri",()=>{this.onHandleURI()})),C.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile",displayIndex:(e=this.wallet)==null?void 0:e.display_index,walletRank:this.wallet.order,view:h.state.view}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.btnLabelTimeout)}onHandleURI(){var e;this.isLoading=!this.uri,!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onTryAgain(){var e;x.setWcError(!1),(e=this.onConnect)==null||e.call(this)}};et([d()],Oe.prototype,"redirectDeeplink",void 0);et([d()],Oe.prototype,"redirectUniversalLink",void 0);et([d()],Oe.prototype,"target",void 0);et([d()],Oe.prototype,"preferUniversalLinks",void 0);et([d()],Oe.prototype,"isLoading",void 0);Oe=et([p("w3m-connecting-wc-mobile")],Oe);const qn=v`
|
|
2596
|
+
wui-shimmer {
|
|
2597
|
+
width: 100%;
|
|
2598
|
+
aspect-ratio: 1 / 1;
|
|
2599
|
+
border-radius: ${({borderRadius:t})=>t[4]};
|
|
2600
|
+
}
|
|
2601
|
+
|
|
2602
|
+
wui-qr-code {
|
|
2603
|
+
opacity: 0;
|
|
2604
|
+
animation-duration: ${({durations:t})=>t.xl};
|
|
2605
|
+
animation-timing-function: ${({easings:t})=>t["ease-out-power-2"]};
|
|
2606
|
+
animation-name: fade-in;
|
|
2607
|
+
animation-fill-mode: forwards;
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2610
|
+
@keyframes fade-in {
|
|
2611
|
+
from {
|
|
2612
|
+
opacity: 0;
|
|
2613
|
+
}
|
|
2614
|
+
to {
|
|
2615
|
+
opacity: 1;
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
`;var ji=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let St=class extends N{constructor(){super(),this.basic=!1}firstUpdated(){var e,i,o;this.basic||C.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:((e=this.wallet)==null?void 0:e.name)??"WalletConnect",platform:"qrcode",displayIndex:(i=this.wallet)==null?void 0:i.display_index,walletRank:(o=this.wallet)==null?void 0:o.order,view:h.state.view}})}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.unsubscribe)==null||e.forEach(i=>i())}render(){return this.onRenderProxy(),l`
|
|
2619
|
+
<wui-flex
|
|
2620
|
+
flexDirection="column"
|
|
2621
|
+
alignItems="center"
|
|
2622
|
+
.padding=${["0","5","5","5"]}
|
|
2623
|
+
gap="5"
|
|
2624
|
+
>
|
|
2625
|
+
<wui-shimmer width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
|
|
2626
|
+
<wui-text variant="lg-medium" color="primary"> Scan this QR Code with your phone </wui-text>
|
|
2627
|
+
${this.copyTemplate()}
|
|
2628
|
+
</wui-flex>
|
|
2629
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
|
|
2630
|
+
`}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0)}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const e=this.wallet?this.wallet.name:void 0;x.setWcLinking(void 0),x.setRecentWallet(this.wallet);const i=mt.state.themeVariables["--apkt-qr-color"]??mt.state.themeVariables["--w3m-qr-color"];return l` <wui-qr-code
|
|
2631
|
+
theme=${mt.state.themeMode}
|
|
2632
|
+
uri=${this.uri}
|
|
2633
|
+
imageSrc=${w(T.getWalletImage(this.wallet))}
|
|
2634
|
+
color=${w(i)}
|
|
2635
|
+
alt=${w(e)}
|
|
2636
|
+
data-testid="wui-qr-code"
|
|
2637
|
+
></wui-qr-code>`}copyTemplate(){const e=!this.uri||!this.ready;return l`<wui-button
|
|
2638
|
+
.disabled=${e}
|
|
2639
|
+
@click=${this.onCopyUri}
|
|
2640
|
+
variant="neutral-secondary"
|
|
2641
|
+
size="sm"
|
|
2642
|
+
data-testid="copy-wc2-uri"
|
|
2643
|
+
>
|
|
2644
|
+
Copy link
|
|
2645
|
+
<wui-icon size="sm" color="inherit" name="copy" slot="iconRight"></wui-icon>
|
|
2646
|
+
</wui-button>`}};St.styles=qn;ji([c({type:Boolean})],St.prototype,"basic",void 0);St=ji([p("w3m-connecting-wc-qrcode")],St);var Gn=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ci=class extends m{constructor(){var e,i,o;if(super(),this.wallet=(e=h.state.data)==null?void 0:e.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");C.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:(i=this.wallet)==null?void 0:i.display_index,walletRank:(o=this.wallet)==null?void 0:o.order,view:h.state.view}})}render(){return l`
|
|
2647
|
+
<wui-flex
|
|
2648
|
+
flexDirection="column"
|
|
2649
|
+
alignItems="center"
|
|
2650
|
+
.padding=${["10","5","5","5"]}
|
|
2651
|
+
gap="5"
|
|
2652
|
+
>
|
|
2653
|
+
<wui-wallet-image
|
|
2654
|
+
size="lg"
|
|
2655
|
+
imageSrc=${w(T.getWalletImage(this.wallet))}
|
|
2656
|
+
></wui-wallet-image>
|
|
2657
|
+
|
|
2658
|
+
<wui-text variant="md-regular" color="primary">Not Detected</wui-text>
|
|
2659
|
+
</wui-flex>
|
|
2660
|
+
|
|
2661
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
|
|
2662
|
+
`}};Ci=Gn([p("w3m-connecting-wc-unsupported")],Ci);var Bi=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Vt=class extends N{constructor(){var e,i;if(super(),this.isLoading=!0,!this.wallet)throw new Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel=D.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.updateLoadingState(),this.unsubscribe.push(x.subscribeKey("wcUri",()=>{this.updateLoadingState()})),C.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web",displayIndex:(e=this.wallet)==null?void 0:e.display_index,walletRank:(i=this.wallet)==null?void 0:i.order,view:h.state.view}})}updateLoadingState(){this.isLoading=!this.uri}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.webapp_link&&this.uri)try{this.error=!1;const{webapp_link:i,name:o}=this.wallet,{redirect:s,href:n}=y.formatUniversalUrl(i,this.uri);x.setWcLinking({name:o,href:n}),x.setRecentWallet(this.wallet),y.openHref(s,"_blank")}catch{this.error=!0}}};Bi([d()],Vt.prototype,"isLoading",void 0);Vt=Bi([p("w3m-connecting-wc-web")],Vt);const Xn=v`
|
|
2663
|
+
:host([data-mobile-fullscreen='true']) {
|
|
2664
|
+
height: 100%;
|
|
2665
|
+
display: flex;
|
|
2666
|
+
flex-direction: column;
|
|
2667
|
+
}
|
|
2668
|
+
|
|
2669
|
+
:host([data-mobile-fullscreen='true']) wui-ux-by-reown {
|
|
2670
|
+
margin-top: auto;
|
|
2671
|
+
}
|
|
2672
|
+
`;var Be=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let we=class extends m{constructor(){var e;super(),this.wallet=(e=h.state.data)==null?void 0:e.wallet,this.unsubscribe=[],this.platform=void 0,this.platforms=[],this.isSiwxEnabled=!!f.state.siwx,this.remoteFeatures=f.state.remoteFeatures,this.displayBranding=!0,this.basic=!1,this.determinePlatforms(),this.initializeConnection(),this.unsubscribe.push(f.subscribeKey("remoteFeatures",i=>this.remoteFeatures=i))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return f.state.enableMobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),l`
|
|
2673
|
+
${this.headerTemplate()}
|
|
2674
|
+
<div class="platform-container">${this.platformTemplate()}</div>
|
|
2675
|
+
${this.reownBrandingTemplate()}
|
|
2676
|
+
`}reownBrandingTemplate(){var e;return!((e=this.remoteFeatures)!=null&&e.reownBranding)||!this.displayBranding?null:l`<wui-ux-by-reown></wui-ux-by-reown>`}async initializeConnection(e=!1){var i,o;if(!(this.platform==="browser"||f.state.manualWCControl&&!e))try{const{wcPairingExpiry:s,status:n}=x.state,{redirectView:a}=h.state.data??{};if(e||f.state.enableEmbedded||y.isPairingExpired(s)||n==="connecting"){const r=x.getConnections(u.state.activeChain),g=(i=this.remoteFeatures)==null?void 0:i.multiWallet,$=r.length>0;await x.connectWalletConnect({cache:"never"}),this.isSiwxEnabled||($&&g?(h.replace("ProfileWallets"),k.showSuccess("New Wallet Added")):a?h.replace(a):P.close())}}catch(s){if(s instanceof Error&&s.message.includes("An error occurred when attempting to switch chain")&&!f.state.enableNetworkSwitch&&u.state.activeChain){u.setActiveCaipNetwork(Xi.getUnsupportedNetwork(`${u.state.activeChain}:${(o=u.state.activeCaipNetwork)==null?void 0:o.id}`)),u.showUnsupportedChainUI();return}s instanceof Yt&&s.originalName===Qt.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?C.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:s.message}}):C.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(s==null?void 0:s.message)??"Unknown"}}),x.setWcError(!0),k.showError(s.message??"Connection error"),x.resetWcConnection(),h.goBack()}}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;const{mobile_link:e,desktop_link:i,webapp_link:o,injected:s,rdns:n}=this.wallet,a=s==null?void 0:s.map(({injected_id:Vi})=>Vi).filter(Boolean),r=[...n?[n]:a??[]],g=f.state.isUniversalProvider?!1:r.length,$=e,E=o,_=x.checkInstalled(r),O=g&&_,Lt=i&&!y.isMobile();O&&!u.state.noAdapters&&this.platforms.push("browser"),$&&this.platforms.push(y.isMobile()?"mobile":"qrcode"),E&&this.platforms.push("web"),Lt&&this.platforms.push("desktop"),!O&&g&&!u.state.noAdapters&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return l`<w3m-connecting-wc-browser></w3m-connecting-wc-browser>`;case"web":return l`<w3m-connecting-wc-web></w3m-connecting-wc-web>`;case"desktop":return l`
|
|
2677
|
+
<w3m-connecting-wc-desktop .onRetry=${()=>this.initializeConnection(!0)}>
|
|
2678
|
+
</w3m-connecting-wc-desktop>
|
|
2679
|
+
`;case"mobile":return l`
|
|
2680
|
+
<w3m-connecting-wc-mobile isMobile .onRetry=${()=>this.initializeConnection(!0)}>
|
|
2681
|
+
</w3m-connecting-wc-mobile>
|
|
2682
|
+
`;case"qrcode":return l`<w3m-connecting-wc-qrcode ?basic=${this.basic}></w3m-connecting-wc-qrcode>`;default:return l`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`}}headerTemplate(){return this.platforms.length>1?l`
|
|
2683
|
+
<w3m-connecting-header
|
|
2684
|
+
.platforms=${this.platforms}
|
|
2685
|
+
.onSelectPlatfrom=${this.onSelectPlatform.bind(this)}
|
|
2686
|
+
>
|
|
2687
|
+
</w3m-connecting-header>
|
|
2688
|
+
`:null}async onSelectPlatform(e){var o;const i=(o=this.shadowRoot)==null?void 0:o.querySelector("div");i&&(await i.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,i.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};we.styles=Xn;Be([d()],we.prototype,"platform",void 0);Be([d()],we.prototype,"platforms",void 0);Be([d()],we.prototype,"isSiwxEnabled",void 0);Be([d()],we.prototype,"remoteFeatures",void 0);Be([c({type:Boolean})],we.prototype,"displayBranding",void 0);Be([c({type:Boolean})],we.prototype,"basic",void 0);we=Be([p("w3m-connecting-wc-view")],we);var si=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Et=class extends m{constructor(){super(),this.unsubscribe=[],this.isMobile=y.isMobile(),this.remoteFeatures=f.state.remoteFeatures,this.unsubscribe.push(f.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(this.isMobile){const{featured:e,recommended:i}=A.state,{customWallets:o}=f.state,s=fe.getRecentWallets(),n=e.length||i.length||(o==null?void 0:o.length)||s.length;return l`<wui-flex flexDirection="column" gap="2" .margin=${["1","3","3","3"]}>
|
|
2689
|
+
${n?l`<w3m-connector-list></w3m-connector-list>`:null}
|
|
2690
|
+
<w3m-all-wallets-widget></w3m-all-wallets-widget>
|
|
2691
|
+
</wui-flex>`}return l`<wui-flex flexDirection="column" .padding=${["0","0","4","0"]}>
|
|
2692
|
+
<w3m-connecting-wc-view ?basic=${!0} .displayBranding=${!1}></w3m-connecting-wc-view>
|
|
2693
|
+
<wui-flex flexDirection="column" .padding=${["0","3","0","3"]}>
|
|
2694
|
+
<w3m-all-wallets-widget></w3m-all-wallets-widget>
|
|
2695
|
+
</wui-flex>
|
|
2696
|
+
</wui-flex>
|
|
2697
|
+
${this.reownBrandingTemplate()} `}reownBrandingTemplate(){var e;return(e=this.remoteFeatures)!=null&&e.reownBranding?l` <wui-flex flexDirection="column" .padding=${["1","0","1","0"]}>
|
|
2698
|
+
<wui-ux-by-reown></wui-ux-by-reown>
|
|
2699
|
+
</wui-flex>`:null}};si([d()],Et.prototype,"isMobile",void 0);si([d()],Et.prototype,"remoteFeatures",void 0);Et=si([p("w3m-connecting-wc-basic-view")],Et);const Yn=ee`
|
|
2700
|
+
.continue-button-container {
|
|
2701
|
+
width: 100%;
|
|
2702
|
+
}
|
|
2703
|
+
`;var Ui=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let kt=class extends m{constructor(){super(...arguments),this.loading=!1}render(){return l`
|
|
2704
|
+
<wui-flex
|
|
2705
|
+
flexDirection="column"
|
|
2706
|
+
alignItems="center"
|
|
2707
|
+
gap="6"
|
|
2708
|
+
.padding=${["0","0","4","0"]}
|
|
2709
|
+
>
|
|
2710
|
+
${this.onboardingTemplate()} ${this.buttonsTemplate()}
|
|
2711
|
+
<wui-link
|
|
2712
|
+
@click=${()=>{y.openHref(Zi.URLS.FAQ,"_blank")}}
|
|
2713
|
+
>
|
|
2714
|
+
Learn more about names
|
|
2715
|
+
<wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
|
|
2716
|
+
</wui-link>
|
|
2717
|
+
</wui-flex>
|
|
2718
|
+
`}onboardingTemplate(){return l` <wui-flex
|
|
2719
|
+
flexDirection="column"
|
|
2720
|
+
gap="6"
|
|
2721
|
+
alignItems="center"
|
|
2722
|
+
.padding=${["0","6","0","6"]}
|
|
2723
|
+
>
|
|
2724
|
+
<wui-flex gap="3" alignItems="center" justifyContent="center">
|
|
2725
|
+
<wui-icon-box icon="id" size="xl" iconSize="xxl" color="default"></wui-icon-box>
|
|
2726
|
+
</wui-flex>
|
|
2727
|
+
<wui-flex flexDirection="column" alignItems="center" gap="3">
|
|
2728
|
+
<wui-text align="center" variant="lg-medium" color="primary">
|
|
2729
|
+
Choose your account name
|
|
2730
|
+
</wui-text>
|
|
2731
|
+
<wui-text align="center" variant="md-regular" color="primary">
|
|
2732
|
+
Finally say goodbye to 0x addresses, name your account to make it easier to exchange
|
|
2733
|
+
assets
|
|
2734
|
+
</wui-text>
|
|
2735
|
+
</wui-flex>
|
|
2736
|
+
</wui-flex>`}buttonsTemplate(){return l`<wui-flex
|
|
2737
|
+
.padding=${["0","8","0","8"]}
|
|
2738
|
+
gap="3"
|
|
2739
|
+
class="continue-button-container"
|
|
2740
|
+
>
|
|
2741
|
+
<wui-button
|
|
2742
|
+
fullWidth
|
|
2743
|
+
.loading=${this.loading}
|
|
2744
|
+
size="lg"
|
|
2745
|
+
borderRadius="xs"
|
|
2746
|
+
@click=${this.handleContinue.bind(this)}
|
|
2747
|
+
>Choose name
|
|
2748
|
+
</wui-button>
|
|
2749
|
+
</wui-flex>`}handleContinue(){h.push("RegisterAccountName"),C.sendEvent({type:"track",event:"OPEN_ENS_FLOW",properties:{isSmartAccount:ze(u.state.activeChain)===Fe.ACCOUNT_TYPES.SMART_ACCOUNT}})}};kt.styles=Yn;Ui([d()],kt.prototype,"loading",void 0);kt=Ui([p("w3m-choose-account-name-view")],kt);var Qn=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ti=class extends m{constructor(){var e;super(...arguments),this.wallet=(e=h.state.data)==null?void 0:e.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return l`
|
|
2750
|
+
<wui-flex gap="2" flexDirection="column" .padding=${["3","3","4","3"]}>
|
|
2751
|
+
${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
|
|
2752
|
+
${this.homepageTemplate()}
|
|
2753
|
+
</wui-flex>
|
|
2754
|
+
`}chromeTemplate(){var e;return(e=this.wallet)!=null&&e.chrome_store?l`<wui-list-item
|
|
2755
|
+
variant="icon"
|
|
2756
|
+
icon="chromeStore"
|
|
2757
|
+
iconVariant="square"
|
|
2758
|
+
@click=${this.onChromeStore.bind(this)}
|
|
2759
|
+
chevron
|
|
2760
|
+
>
|
|
2761
|
+
<wui-text variant="md-medium" color="primary">Chrome Extension</wui-text>
|
|
2762
|
+
</wui-list-item>`:null}iosTemplate(){var e;return(e=this.wallet)!=null&&e.app_store?l`<wui-list-item
|
|
2763
|
+
variant="icon"
|
|
2764
|
+
icon="appStore"
|
|
2765
|
+
iconVariant="square"
|
|
2766
|
+
@click=${this.onAppStore.bind(this)}
|
|
2767
|
+
chevron
|
|
2768
|
+
>
|
|
2769
|
+
<wui-text variant="md-medium" color="primary">iOS App</wui-text>
|
|
2770
|
+
</wui-list-item>`:null}androidTemplate(){var e;return(e=this.wallet)!=null&&e.play_store?l`<wui-list-item
|
|
2771
|
+
variant="icon"
|
|
2772
|
+
icon="playStore"
|
|
2773
|
+
iconVariant="square"
|
|
2774
|
+
@click=${this.onPlayStore.bind(this)}
|
|
2775
|
+
chevron
|
|
2776
|
+
>
|
|
2777
|
+
<wui-text variant="md-medium" color="primary">Android App</wui-text>
|
|
2778
|
+
</wui-list-item>`:null}homepageTemplate(){var e;return(e=this.wallet)!=null&&e.homepage?l`
|
|
2779
|
+
<wui-list-item
|
|
2780
|
+
variant="icon"
|
|
2781
|
+
icon="browser"
|
|
2782
|
+
iconVariant="square-blue"
|
|
2783
|
+
@click=${this.onHomePage.bind(this)}
|
|
2784
|
+
chevron
|
|
2785
|
+
>
|
|
2786
|
+
<wui-text variant="md-medium" color="primary">Website</wui-text>
|
|
2787
|
+
</wui-list-item>
|
|
2788
|
+
`:null}openStore(e){e.href&&this.wallet&&(C.sendEvent({type:"track",event:"GET_WALLET",properties:{name:this.wallet.name,walletRank:this.wallet.order,explorerId:this.wallet.id,type:e.type}}),y.openHref(e.href,"_blank"))}onChromeStore(){var e;(e=this.wallet)!=null&&e.chrome_store&&this.openStore({href:this.wallet.chrome_store,type:"chrome_store"})}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&this.openStore({href:this.wallet.app_store,type:"app_store"})}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&this.openStore({href:this.wallet.play_store,type:"play_store"})}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&this.openStore({href:this.wallet.homepage,type:"homepage"})}};Ti=Qn([p("w3m-downloads-view")],Ti);var Jn=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Zn="https://walletconnect.com/explorer";let Si=class extends m{render(){return l`
|
|
2789
|
+
<wui-flex flexDirection="column" .padding=${["0","3","3","3"]} gap="2">
|
|
2790
|
+
${this.recommendedWalletsTemplate()}
|
|
2791
|
+
<w3m-list-wallet
|
|
2792
|
+
name="Explore all"
|
|
2793
|
+
showAllWallets
|
|
2794
|
+
walletIcon="allWallets"
|
|
2795
|
+
icon="externalLink"
|
|
2796
|
+
size="sm"
|
|
2797
|
+
@click=${()=>{y.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}}
|
|
2798
|
+
></w3m-list-wallet>
|
|
2799
|
+
</wui-flex>
|
|
2800
|
+
`}recommendedWalletsTemplate(){const{recommended:e,featured:i}=A.state,{customWallets:o}=f.state;return[...i,...o??[],...e].slice(0,4).map((n,a)=>l`
|
|
2801
|
+
<w3m-list-wallet
|
|
2802
|
+
displayIndex=${a}
|
|
2803
|
+
name=${n.name??"Unknown"}
|
|
2804
|
+
tagVariant="accent"
|
|
2805
|
+
size="sm"
|
|
2806
|
+
imageSrc=${w(T.getWalletImage(n))}
|
|
2807
|
+
@click=${()=>{this.onWalletClick(n)}}
|
|
2808
|
+
></w3m-list-wallet>
|
|
2809
|
+
`)}onWalletClick(e){C.sendEvent({type:"track",event:"GET_WALLET",properties:{name:e.name,walletRank:void 0,explorerId:e.id,type:"homepage"}}),y.openHref(e.homepage??Zn,"_blank")}};Si=Jn([p("w3m-get-wallet-view")],Si);var zi=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ht=class extends m{constructor(){super(...arguments),this.data=[]}render(){return l`
|
|
2810
|
+
<wui-flex flexDirection="column" alignItems="center" gap="4">
|
|
2811
|
+
${this.data.map(e=>l`
|
|
2812
|
+
<wui-flex flexDirection="column" alignItems="center" gap="5">
|
|
2813
|
+
<wui-flex flexDirection="row" justifyContent="center" gap="1">
|
|
2814
|
+
${e.images.map(i=>l`<wui-visual size="sm" name=${i}></wui-visual>`)}
|
|
2815
|
+
</wui-flex>
|
|
2816
|
+
</wui-flex>
|
|
2817
|
+
<wui-flex flexDirection="column" alignItems="center" gap="1">
|
|
2818
|
+
<wui-text variant="md-regular" color="primary" align="center">${e.title}</wui-text>
|
|
2819
|
+
<wui-text variant="sm-regular" color="secondary" align="center"
|
|
2820
|
+
>${e.text}</wui-text
|
|
2821
|
+
>
|
|
2822
|
+
</wui-flex>
|
|
2823
|
+
`)}
|
|
2824
|
+
</wui-flex>
|
|
2825
|
+
`}};zi([c({type:Array})],Ht.prototype,"data",void 0);Ht=zi([p("w3m-help-widget")],Ht);var eo=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const to=[{images:["login","profile","lock"],title:"One login for all of web3",text:"Log in to any app by connecting your wallet. Say goodbye to countless passwords!"},{images:["defi","nft","eth"],title:"A home for your digital assets",text:"A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."},{images:["browser","noun","dao"],title:"Your gateway to a new web",text:"With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."}];let Ei=class extends m{render(){return l`
|
|
2826
|
+
<wui-flex
|
|
2827
|
+
flexDirection="column"
|
|
2828
|
+
.padding=${["6","5","5","5"]}
|
|
2829
|
+
alignItems="center"
|
|
2830
|
+
gap="5"
|
|
2831
|
+
>
|
|
2832
|
+
<w3m-help-widget .data=${to}></w3m-help-widget>
|
|
2833
|
+
<wui-button variant="accent-primary" size="md" @click=${this.onGetWallet.bind(this)}>
|
|
2834
|
+
<wui-icon color="inherit" slot="iconLeft" name="wallet"></wui-icon>
|
|
2835
|
+
Get a wallet
|
|
2836
|
+
</wui-button>
|
|
2837
|
+
</wui-flex>
|
|
2838
|
+
`}onGetWallet(){C.sendEvent({type:"track",event:"CLICK_GET_WALLET_HELP"}),h.push("GetWallet")}};Ei=eo([p("w3m-what-is-a-wallet-view")],Ei);const io=v`
|
|
2839
|
+
wui-flex {
|
|
2840
|
+
max-height: clamp(360px, 540px, 80vh);
|
|
2841
|
+
overflow: scroll;
|
|
2842
|
+
scrollbar-width: none;
|
|
2843
|
+
transition: opacity ${({durations:t})=>t.lg}
|
|
2844
|
+
${({easings:t})=>t["ease-out-power-2"]};
|
|
2845
|
+
will-change: opacity;
|
|
2846
|
+
}
|
|
2847
|
+
wui-flex::-webkit-scrollbar {
|
|
2848
|
+
display: none;
|
|
2849
|
+
}
|
|
2850
|
+
wui-flex.disabled {
|
|
2851
|
+
opacity: 0.3;
|
|
2852
|
+
pointer-events: none;
|
|
2853
|
+
user-select: none;
|
|
2854
|
+
}
|
|
2855
|
+
`;var Fi=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let At=class extends m{constructor(){super(),this.unsubscribe=[],this.checked=bt.state.isLegalCheckboxChecked,this.unsubscribe.push(bt.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var g;const{termsConditionsUrl:e,privacyPolicyUrl:i}=f.state,o=(g=f.state.features)==null?void 0:g.legalCheckbox,n=!!(e||i)&&!!o,a=n&&!this.checked,r=a?-1:void 0;return l`
|
|
2856
|
+
<w3m-legal-checkbox></w3m-legal-checkbox>
|
|
2857
|
+
<wui-flex
|
|
2858
|
+
flexDirection="column"
|
|
2859
|
+
.padding=${n?["0","3","3","3"]:"3"}
|
|
2860
|
+
gap="2"
|
|
2861
|
+
class=${w(a?"disabled":void 0)}
|
|
2862
|
+
>
|
|
2863
|
+
<w3m-wallet-login-list tabIdx=${w(r)}></w3m-wallet-login-list>
|
|
2864
|
+
</wui-flex>
|
|
2865
|
+
`}};At.styles=io;Fi([d()],At.prototype,"checked",void 0);At=Fi([p("w3m-connect-wallets-view")],At);const no=v`
|
|
2866
|
+
:host {
|
|
2867
|
+
display: block;
|
|
2868
|
+
width: 120px;
|
|
2869
|
+
height: 120px;
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2872
|
+
svg {
|
|
2873
|
+
width: 120px;
|
|
2874
|
+
height: 120px;
|
|
2875
|
+
fill: none;
|
|
2876
|
+
stroke: transparent;
|
|
2877
|
+
stroke-linecap: round;
|
|
2878
|
+
}
|
|
2879
|
+
|
|
2880
|
+
use {
|
|
2881
|
+
stroke: ${t=>t.colors.accent100};
|
|
2882
|
+
stroke-width: 2px;
|
|
2883
|
+
stroke-dasharray: 54, 118;
|
|
2884
|
+
stroke-dashoffset: 172;
|
|
2885
|
+
animation: dash 1s linear infinite;
|
|
2886
|
+
}
|
|
2887
|
+
|
|
2888
|
+
@keyframes dash {
|
|
2889
|
+
to {
|
|
2890
|
+
stroke-dashoffset: 0px;
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
`;var oo=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Kt=class extends m{render(){return l`
|
|
2894
|
+
<svg viewBox="0 0 54 59">
|
|
2895
|
+
<path
|
|
2896
|
+
id="wui-loader-path"
|
|
2897
|
+
d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z"
|
|
2898
|
+
/>
|
|
2899
|
+
<use xlink:href="#wui-loader-path"></use>
|
|
2900
|
+
</svg>
|
|
2901
|
+
`}};Kt.styles=[I,no];Kt=oo([p("wui-loading-hexagon")],Kt);const so=ee`
|
|
2902
|
+
@keyframes shake {
|
|
2903
|
+
0% {
|
|
2904
|
+
transform: translateX(0);
|
|
2905
|
+
}
|
|
2906
|
+
25% {
|
|
2907
|
+
transform: translateX(3px);
|
|
2908
|
+
}
|
|
2909
|
+
50% {
|
|
2910
|
+
transform: translateX(-3px);
|
|
2911
|
+
}
|
|
2912
|
+
75% {
|
|
2913
|
+
transform: translateX(3px);
|
|
2914
|
+
}
|
|
2915
|
+
100% {
|
|
2916
|
+
transform: translateX(0);
|
|
2917
|
+
}
|
|
2918
|
+
}
|
|
2919
|
+
|
|
2920
|
+
wui-flex:first-child:not(:only-child) {
|
|
2921
|
+
position: relative;
|
|
2922
|
+
}
|
|
2923
|
+
|
|
2924
|
+
wui-loading-hexagon {
|
|
2925
|
+
position: absolute;
|
|
2926
|
+
}
|
|
2927
|
+
|
|
2928
|
+
wui-icon-box {
|
|
2929
|
+
position: absolute;
|
|
2930
|
+
right: 4px;
|
|
2931
|
+
bottom: 0;
|
|
2932
|
+
opacity: 0;
|
|
2933
|
+
transform: scale(0.5);
|
|
2934
|
+
z-index: 1;
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2937
|
+
wui-button {
|
|
2938
|
+
display: none;
|
|
2939
|
+
}
|
|
2940
|
+
|
|
2941
|
+
[data-error='true'] wui-icon-box {
|
|
2942
|
+
opacity: 1;
|
|
2943
|
+
transform: scale(1);
|
|
2944
|
+
}
|
|
2945
|
+
|
|
2946
|
+
[data-error='true'] > wui-flex:first-child {
|
|
2947
|
+
animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
|
|
2948
|
+
}
|
|
2949
|
+
|
|
2950
|
+
wui-button[data-retry='true'] {
|
|
2951
|
+
display: block;
|
|
2952
|
+
opacity: 1;
|
|
2953
|
+
}
|
|
2954
|
+
`;var ai=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ot=class extends m{constructor(){var e;super(),this.network=(e=h.state.data)==null?void 0:e.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw new Error("w3m-network-switch-view: No network provided");this.onShowRetry();const e=this.getLabel(),i=this.getSubLabel();return l`
|
|
2955
|
+
<wui-flex
|
|
2956
|
+
data-error=${this.error}
|
|
2957
|
+
flexDirection="column"
|
|
2958
|
+
alignItems="center"
|
|
2959
|
+
.padding=${["10","5","10","5"]}
|
|
2960
|
+
gap="7"
|
|
2961
|
+
>
|
|
2962
|
+
<wui-flex justifyContent="center" alignItems="center">
|
|
2963
|
+
<wui-network-image
|
|
2964
|
+
size="lg"
|
|
2965
|
+
imageSrc=${w(T.getNetworkImage(this.network))}
|
|
2966
|
+
></wui-network-image>
|
|
2967
|
+
|
|
2968
|
+
${this.error?null:l`<wui-loading-hexagon></wui-loading-hexagon>`}
|
|
2969
|
+
|
|
2970
|
+
<wui-icon-box color="error" icon="close" size="sm"></wui-icon-box>
|
|
2971
|
+
</wui-flex>
|
|
2972
|
+
|
|
2973
|
+
<wui-flex flexDirection="column" alignItems="center" gap="2">
|
|
2974
|
+
<wui-text align="center" variant="h6-regular" color="primary">${e}</wui-text>
|
|
2975
|
+
<wui-text align="center" variant="md-regular" color="secondary">${i}</wui-text>
|
|
2976
|
+
</wui-flex>
|
|
2977
|
+
|
|
2978
|
+
<wui-button
|
|
2979
|
+
data-retry=${this.showRetry}
|
|
2980
|
+
variant="accent-primary"
|
|
2981
|
+
size="md"
|
|
2982
|
+
.disabled=${!this.error}
|
|
2983
|
+
@click=${this.onSwitchNetwork.bind(this)}
|
|
2984
|
+
>
|
|
2985
|
+
<wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
|
|
2986
|
+
Try again
|
|
2987
|
+
</wui-button>
|
|
2988
|
+
</wui-flex>
|
|
2989
|
+
`}getSubLabel(){const e=b.getConnectorId(u.state.activeChain);return b.getAuthConnector()&&e===S.CONNECTOR_ID.AUTH?"":this.error?"Switch can be declined if chain is not supported by a wallet or previous request is still active":"Accept connection request in your wallet"}getLabel(){var o;const e=b.getConnectorId(u.state.activeChain);return b.getAuthConnector()&&e===S.CONNECTOR_ID.AUTH?`Switching to ${((o=this.network)==null?void 0:o.name)??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const i=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");i==null||i.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){var e;try{this.error=!1,u.state.activeChain!==((e=this.network)==null?void 0:e.chainNamespace)&&u.setIsSwitchingNamespace(!0),this.network&&(await u.switchActiveNetwork(this.network),await Bt.isAuthenticated()&&h.goBack())}catch{this.error=!0}}};ot.styles=so;ai([d()],ot.prototype,"showRetry",void 0);ai([d()],ot.prototype,"error",void 0);ot=ai([p("w3m-network-switch-view")],ot);const ao=v`
|
|
2990
|
+
:host {
|
|
2991
|
+
width: 100%;
|
|
2992
|
+
}
|
|
2993
|
+
|
|
2994
|
+
button {
|
|
2995
|
+
display: flex;
|
|
2996
|
+
align-items: center;
|
|
2997
|
+
justify-content: space-between;
|
|
2998
|
+
padding: ${({spacing:t})=>t[3]};
|
|
2999
|
+
width: 100%;
|
|
3000
|
+
background-color: transparent;
|
|
3001
|
+
border-radius: ${({borderRadius:t})=>t[4]};
|
|
3002
|
+
}
|
|
3003
|
+
|
|
3004
|
+
wui-text {
|
|
3005
|
+
text-transform: capitalize;
|
|
3006
|
+
}
|
|
3007
|
+
|
|
3008
|
+
@media (hover: hover) {
|
|
3009
|
+
button:hover:enabled {
|
|
3010
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
|
|
3014
|
+
button:disabled {
|
|
3015
|
+
opacity: 0.5;
|
|
3016
|
+
cursor: not-allowed;
|
|
3017
|
+
}
|
|
3018
|
+
`;var pt=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Pe=class extends m{constructor(){super(...arguments),this.imageSrc=void 0,this.name="Ethereum",this.disabled=!1}render(){return l`
|
|
3019
|
+
<button ?disabled=${this.disabled} tabindex=${w(this.tabIdx)}>
|
|
3020
|
+
<wui-flex gap="2" alignItems="center">
|
|
3021
|
+
${this.imageTemplate()}
|
|
3022
|
+
<wui-text variant="lg-regular" color="primary">${this.name}</wui-text>
|
|
3023
|
+
</wui-flex>
|
|
3024
|
+
<wui-icon name="chevronRight" size="lg" color="default"></wui-icon>
|
|
3025
|
+
</button>
|
|
3026
|
+
`}imageTemplate(){return this.imageSrc?l`<wui-image ?boxed=${!0} src=${this.imageSrc}></wui-image>`:l`<wui-image
|
|
3027
|
+
?boxed=${!0}
|
|
3028
|
+
icon="networkPlaceholder"
|
|
3029
|
+
size="lg"
|
|
3030
|
+
iconColor="default"
|
|
3031
|
+
></wui-image>`}};Pe.styles=[I,W,ao];pt([c()],Pe.prototype,"imageSrc",void 0);pt([c()],Pe.prototype,"name",void 0);pt([c()],Pe.prototype,"tabIdx",void 0);pt([c({type:Boolean})],Pe.prototype,"disabled",void 0);Pe=pt([p("wui-list-network")],Pe);const ro=ee`
|
|
3032
|
+
.container {
|
|
3033
|
+
max-height: 360px;
|
|
3034
|
+
overflow: auto;
|
|
3035
|
+
}
|
|
3036
|
+
|
|
3037
|
+
.container::-webkit-scrollbar {
|
|
3038
|
+
display: none;
|
|
3039
|
+
}
|
|
3040
|
+
`;var wt=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let De=class extends m{constructor(){super(),this.unsubscribe=[],this.network=u.state.activeCaipNetwork,this.requestedCaipNetworks=u.getCaipNetworks(),this.search="",this.onDebouncedSearch=y.debounce(e=>{this.search=e},100),this.unsubscribe.push(Te.subscribeNetworkImages(()=>this.requestUpdate()),u.subscribeKey("activeCaipNetwork",e=>this.network=e),u.subscribe(()=>{this.requestedCaipNetworks=u.getAllRequestedCaipNetworks()}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
|
|
3041
|
+
${this.templateSearchInput()}
|
|
3042
|
+
<wui-flex
|
|
3043
|
+
class="container"
|
|
3044
|
+
.padding=${["0","3","3","3"]}
|
|
3045
|
+
flexDirection="column"
|
|
3046
|
+
gap="2"
|
|
3047
|
+
>
|
|
3048
|
+
${this.networksTemplate()}
|
|
3049
|
+
</wui-flex>
|
|
3050
|
+
`}templateSearchInput(){return l`
|
|
3051
|
+
<wui-flex gap="2" .padding=${["0","3","3","3"]}>
|
|
3052
|
+
<wui-input-text
|
|
3053
|
+
@inputChange=${this.onInputChange.bind(this)}
|
|
3054
|
+
class="network-search-input"
|
|
3055
|
+
size="md"
|
|
3056
|
+
placeholder="Search network"
|
|
3057
|
+
icon="search"
|
|
3058
|
+
></wui-input-text>
|
|
3059
|
+
</wui-flex>
|
|
3060
|
+
`}onInputChange(e){this.onDebouncedSearch(e.detail)}networksTemplate(){var o;const e=u.getAllApprovedCaipNetworkIds(),i=y.sortRequestedNetworks(e,this.requestedCaipNetworks);return this.search?this.filteredNetworks=i==null?void 0:i.filter(s=>{var n;return(n=s==null?void 0:s.name)==null?void 0:n.toLowerCase().includes(this.search.toLowerCase())}):this.filteredNetworks=i,(o=this.filteredNetworks)==null?void 0:o.map(s=>{var n;return l`
|
|
3061
|
+
<wui-list-network
|
|
3062
|
+
.selected=${((n=this.network)==null?void 0:n.id)===s.id}
|
|
3063
|
+
imageSrc=${w(T.getNetworkImage(s))}
|
|
3064
|
+
type="network"
|
|
3065
|
+
name=${s.name??s.id}
|
|
3066
|
+
@click=${()=>this.onSwitchNetwork(s)}
|
|
3067
|
+
.disabled=${u.isCaipNetworkDisabled(s)}
|
|
3068
|
+
data-testid=${`w3m-network-switch-${s.name??s.id}`}
|
|
3069
|
+
></wui-list-network>
|
|
3070
|
+
`})}onSwitchNetwork(e){Yi.onSwitchNetwork({network:e})}};De.styles=ro;wt([d()],De.prototype,"network",void 0);wt([d()],De.prototype,"requestedCaipNetworks",void 0);wt([d()],De.prototype,"filteredNetworks",void 0);wt([d()],De.prototype,"search",void 0);De=wt([p("w3m-networks-view")],De);const lo=v`
|
|
3071
|
+
@keyframes shake {
|
|
3072
|
+
0% {
|
|
3073
|
+
transform: translateX(0);
|
|
3074
|
+
}
|
|
3075
|
+
25% {
|
|
3076
|
+
transform: translateX(3px);
|
|
3077
|
+
}
|
|
3078
|
+
50% {
|
|
3079
|
+
transform: translateX(-3px);
|
|
3080
|
+
}
|
|
3081
|
+
75% {
|
|
3082
|
+
transform: translateX(3px);
|
|
3083
|
+
}
|
|
3084
|
+
100% {
|
|
3085
|
+
transform: translateX(0);
|
|
3086
|
+
}
|
|
3087
|
+
}
|
|
3088
|
+
|
|
3089
|
+
wui-flex:first-child:not(:only-child) {
|
|
3090
|
+
position: relative;
|
|
3091
|
+
}
|
|
3092
|
+
|
|
3093
|
+
wui-loading-thumbnail {
|
|
3094
|
+
position: absolute;
|
|
3095
|
+
}
|
|
3096
|
+
|
|
3097
|
+
wui-visual {
|
|
3098
|
+
border-radius: calc(
|
|
3099
|
+
${({borderRadius:t})=>t[1]} * 9 - ${({borderRadius:t})=>t[3]}
|
|
3100
|
+
);
|
|
3101
|
+
position: relative;
|
|
3102
|
+
overflow: hidden;
|
|
3103
|
+
}
|
|
3104
|
+
|
|
3105
|
+
wui-visual::after {
|
|
3106
|
+
content: '';
|
|
3107
|
+
display: block;
|
|
3108
|
+
width: 100%;
|
|
3109
|
+
height: 100%;
|
|
3110
|
+
position: absolute;
|
|
3111
|
+
inset: 0;
|
|
3112
|
+
border-radius: calc(
|
|
3113
|
+
${({borderRadius:t})=>t[1]} * 9 - ${({borderRadius:t})=>t[3]}
|
|
3114
|
+
);
|
|
3115
|
+
box-shadow: inset 0 0 0 1px ${({tokens:t})=>t.core.glass010};
|
|
3116
|
+
}
|
|
3117
|
+
|
|
3118
|
+
wui-icon-box {
|
|
3119
|
+
position: absolute;
|
|
3120
|
+
right: calc(${({spacing:t})=>t[1]} * -1);
|
|
3121
|
+
bottom: calc(${({spacing:t})=>t[1]} * -1);
|
|
3122
|
+
opacity: 0;
|
|
3123
|
+
transform: scale(0.5);
|
|
3124
|
+
transition:
|
|
3125
|
+
opacity ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
|
|
3126
|
+
transform ${({durations:t})=>t.lg}
|
|
3127
|
+
${({easings:t})=>t["ease-out-power-2"]};
|
|
3128
|
+
will-change: opacity, transform;
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
wui-text[align='center'] {
|
|
3132
|
+
width: 100%;
|
|
3133
|
+
padding: 0px ${({spacing:t})=>t[4]};
|
|
3134
|
+
}
|
|
3135
|
+
|
|
3136
|
+
[data-error='true'] wui-icon-box {
|
|
3137
|
+
opacity: 1;
|
|
3138
|
+
transform: scale(1);
|
|
3139
|
+
}
|
|
3140
|
+
|
|
3141
|
+
[data-error='true'] > wui-flex:first-child {
|
|
3142
|
+
animation: shake 250ms ${({easings:t})=>t["ease-out-power-2"]} both;
|
|
3143
|
+
}
|
|
3144
|
+
|
|
3145
|
+
[data-retry='false'] wui-link {
|
|
3146
|
+
display: none;
|
|
3147
|
+
}
|
|
3148
|
+
|
|
3149
|
+
[data-retry='true'] wui-link {
|
|
3150
|
+
display: block;
|
|
3151
|
+
opacity: 1;
|
|
3152
|
+
}
|
|
3153
|
+
|
|
3154
|
+
wui-link {
|
|
3155
|
+
padding: ${({spacing:t})=>t["01"]} ${({spacing:t})=>t[2]};
|
|
3156
|
+
}
|
|
3157
|
+
|
|
3158
|
+
.capitalize {
|
|
3159
|
+
text-transform: capitalize;
|
|
3160
|
+
}
|
|
3161
|
+
`;var Mi=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const co={eip155:"eth",solana:"solana",bip122:"bitcoin",polkadot:void 0};let It=class extends m{constructor(){var e,i;super(...arguments),this.unsubscribe=[],this.switchToChain=(e=h.state.data)==null?void 0:e.switchToChain,this.caipNetwork=(i=h.state.data)==null?void 0:i.network,this.activeChain=u.state.activeChain}firstUpdated(){this.unsubscribe.push(u.subscribeKey("activeChain",e=>this.activeChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.switchToChain?S.CHAIN_NAME_MAP[this.switchToChain]:"supported";if(!this.switchToChain)return null;const i=S.CHAIN_NAME_MAP[this.switchToChain];return l`
|
|
3162
|
+
<wui-flex
|
|
3163
|
+
flexDirection="column"
|
|
3164
|
+
alignItems="center"
|
|
3165
|
+
.padding=${["4","2","2","2"]}
|
|
3166
|
+
gap="4"
|
|
3167
|
+
>
|
|
3168
|
+
<wui-flex justifyContent="center" flexDirection="column" alignItems="center" gap="2">
|
|
3169
|
+
<wui-visual
|
|
3170
|
+
size="md"
|
|
3171
|
+
name=${w(co[this.switchToChain])}
|
|
3172
|
+
></wui-visual>
|
|
3173
|
+
<wui-flex gap="2" flexDirection="column" alignItems="center">
|
|
3174
|
+
<wui-text
|
|
3175
|
+
data-testid=${`w3m-switch-active-chain-to-${i}`}
|
|
3176
|
+
variant="lg-regular"
|
|
3177
|
+
color="primary"
|
|
3178
|
+
align="center"
|
|
3179
|
+
>Switch to <span class="capitalize">${i}</span></wui-text
|
|
3180
|
+
>
|
|
3181
|
+
<wui-text variant="md-regular" color="secondary" align="center">
|
|
3182
|
+
Connected wallet doesn't support connecting to ${e} chain. You
|
|
3183
|
+
need to connect with a different wallet.
|
|
3184
|
+
</wui-text>
|
|
3185
|
+
</wui-flex>
|
|
3186
|
+
<wui-button
|
|
3187
|
+
data-testid="w3m-switch-active-chain-button"
|
|
3188
|
+
size="md"
|
|
3189
|
+
@click=${this.switchActiveChain.bind(this)}
|
|
3190
|
+
>Switch</wui-button
|
|
3191
|
+
>
|
|
3192
|
+
</wui-flex>
|
|
3193
|
+
</wui-flex>
|
|
3194
|
+
`}async switchActiveChain(){this.switchToChain&&(u.setIsSwitchingNamespace(!0),b.setFilterByNamespace(this.switchToChain),this.caipNetwork?await u.switchActiveNetwork(this.caipNetwork):u.setActiveNamespace(this.switchToChain),h.reset("Connect"))}};It.styles=lo;Mi([c()],It.prototype,"activeChain",void 0);It=Mi([p("w3m-switch-active-chain-view")],It);var uo=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const ho=[{images:["network","layers","system"],title:"The system’s nuts and bolts",text:"A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."},{images:["noun","defiAlt","dao"],title:"Designed for different uses",text:"Each network is designed differently, and may therefore suit certain apps and experiences."}];let ki=class extends m{render(){return l`
|
|
3195
|
+
<wui-flex
|
|
3196
|
+
flexDirection="column"
|
|
3197
|
+
.padding=${["6","5","5","5"]}
|
|
3198
|
+
alignItems="center"
|
|
3199
|
+
gap="5"
|
|
3200
|
+
>
|
|
3201
|
+
<w3m-help-widget .data=${ho}></w3m-help-widget>
|
|
3202
|
+
<wui-button
|
|
3203
|
+
variant="accent-primary"
|
|
3204
|
+
size="md"
|
|
3205
|
+
@click=${()=>{y.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}}
|
|
3206
|
+
>
|
|
3207
|
+
Learn more
|
|
3208
|
+
<wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
|
|
3209
|
+
</wui-button>
|
|
3210
|
+
</wui-flex>
|
|
3211
|
+
`}};ki=uo([p("w3m-what-is-a-network-view")],ki);const po=ee`
|
|
3212
|
+
:host > wui-flex {
|
|
3213
|
+
max-height: clamp(360px, 540px, 80vh);
|
|
3214
|
+
overflow: scroll;
|
|
3215
|
+
scrollbar-width: none;
|
|
3216
|
+
}
|
|
3217
|
+
|
|
3218
|
+
:host > wui-flex::-webkit-scrollbar {
|
|
3219
|
+
display: none;
|
|
3220
|
+
}
|
|
3221
|
+
`;var ri=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let st=class extends m{constructor(){var e;super(),this.swapUnsupportedChain=(e=h.state.data)==null?void 0:e.swapUnsupportedChain,this.unsubscribe=[],this.disconnecting=!1,this.remoteFeatures=f.state.remoteFeatures,this.unsubscribe.push(Te.subscribeNetworkImages(()=>this.requestUpdate()),f.subscribeKey("remoteFeatures",i=>{this.remoteFeatures=i}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
|
|
3222
|
+
<wui-flex class="container" flexDirection="column" gap="0">
|
|
3223
|
+
<wui-flex
|
|
3224
|
+
class="container"
|
|
3225
|
+
flexDirection="column"
|
|
3226
|
+
.padding=${["3","5","2","5"]}
|
|
3227
|
+
alignItems="center"
|
|
3228
|
+
gap="5"
|
|
3229
|
+
>
|
|
3230
|
+
${this.descriptionTemplate()}
|
|
3231
|
+
</wui-flex>
|
|
3232
|
+
|
|
3233
|
+
<wui-flex flexDirection="column" padding="3" gap="2"> ${this.networksTemplate()} </wui-flex>
|
|
3234
|
+
|
|
3235
|
+
<wui-separator text="or"></wui-separator>
|
|
3236
|
+
<wui-flex flexDirection="column" padding="3" gap="2">
|
|
3237
|
+
<wui-list-item
|
|
3238
|
+
variant="icon"
|
|
3239
|
+
iconVariant="overlay"
|
|
3240
|
+
icon="signOut"
|
|
3241
|
+
?chevron=${!1}
|
|
3242
|
+
.loading=${this.disconnecting}
|
|
3243
|
+
@click=${this.onDisconnect.bind(this)}
|
|
3244
|
+
data-testid="disconnect-button"
|
|
3245
|
+
>
|
|
3246
|
+
<wui-text variant="md-medium" color="secondary">Disconnect</wui-text>
|
|
3247
|
+
</wui-list-item>
|
|
3248
|
+
</wui-flex>
|
|
3249
|
+
</wui-flex>
|
|
3250
|
+
`}descriptionTemplate(){return this.swapUnsupportedChain?l`
|
|
3251
|
+
<wui-text variant="sm-regular" color="secondary" align="center">
|
|
3252
|
+
The swap feature doesn’t support your current network. Switch to an available option to
|
|
3253
|
+
continue.
|
|
3254
|
+
</wui-text>
|
|
3255
|
+
`:l`
|
|
3256
|
+
<wui-text variant="sm-regular" color="secondary" align="center">
|
|
3257
|
+
This app doesn’t support your current network. Switch to an available option to continue.
|
|
3258
|
+
</wui-text>
|
|
3259
|
+
`}networksTemplate(){const e=u.getAllRequestedCaipNetworks(),i=u.getAllApprovedCaipNetworkIds(),o=y.sortRequestedNetworks(i,e);return(this.swapUnsupportedChain?o.filter(n=>D.SWAP_SUPPORTED_NETWORKS.includes(n.caipNetworkId)):o).map(n=>l`
|
|
3260
|
+
<wui-list-network
|
|
3261
|
+
imageSrc=${w(T.getNetworkImage(n))}
|
|
3262
|
+
name=${n.name??"Unknown"}
|
|
3263
|
+
@click=${()=>this.onSwitchNetwork(n)}
|
|
3264
|
+
>
|
|
3265
|
+
</wui-list-network>
|
|
3266
|
+
`)}async onDisconnect(){var e;try{this.disconnecting=!0;const i=u.state.activeChain,s=x.getConnections(i).length>0,n=i&&b.state.activeConnectorIds[i],a=(e=this.remoteFeatures)==null?void 0:e.multiWallet;await x.disconnect(a?{id:n,namespace:i}:{}),s&&a&&(h.push("ProfileWallets"),k.showSuccess("Wallet deleted"))}catch{C.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),k.showError("Failed to disconnect")}finally{this.disconnecting=!1}}async onSwitchNetwork(e){const i=u.getActiveCaipAddress(),o=u.getAllApprovedCaipNetworkIds(),s=u.getNetworkProp("supportsAllNetworks",e.chainNamespace),n=h.state.data;i?o!=null&&o.includes(e.caipNetworkId)?await u.switchActiveNetwork(e):s?h.push("SwitchNetwork",{...n,network:e}):h.push("SwitchNetwork",{...n,network:e}):i||(u.setActiveCaipNetwork(e),h.push("Connect"))}};st.styles=po;ri([d()],st.prototype,"disconnecting",void 0);ri([d()],st.prototype,"remoteFeatures",void 0);st=ri([p("w3m-unsupported-chain-view")],st);const wo=v`
|
|
3267
|
+
wui-flex {
|
|
3268
|
+
width: 100%;
|
|
3269
|
+
display: flex;
|
|
3270
|
+
align-items: center;
|
|
3271
|
+
justify-content: center;
|
|
3272
|
+
gap: ${({spacing:t})=>t[2]};
|
|
3273
|
+
border-radius: ${({borderRadius:t})=>t[4]};
|
|
3274
|
+
padding: ${({spacing:t})=>t[3]};
|
|
3275
|
+
}
|
|
3276
|
+
|
|
3277
|
+
/* -- Types --------------------------------------------------------- */
|
|
3278
|
+
wui-flex[data-type='info'] {
|
|
3279
|
+
color: ${({tokens:t})=>t.theme.textSecondary};
|
|
3280
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
3281
|
+
}
|
|
3282
|
+
|
|
3283
|
+
wui-flex[data-type='success'] {
|
|
3284
|
+
color: ${({tokens:t})=>t.core.textSuccess};
|
|
3285
|
+
background-color: ${({tokens:t})=>t.core.backgroundSuccess};
|
|
3286
|
+
}
|
|
3287
|
+
|
|
3288
|
+
wui-flex[data-type='error'] {
|
|
3289
|
+
color: ${({tokens:t})=>t.core.textError};
|
|
3290
|
+
background-color: ${({tokens:t})=>t.core.backgroundError};
|
|
3291
|
+
}
|
|
3292
|
+
|
|
3293
|
+
wui-flex[data-type='warning'] {
|
|
3294
|
+
color: ${({tokens:t})=>t.core.textWarning};
|
|
3295
|
+
background-color: ${({tokens:t})=>t.core.backgroundWarning};
|
|
3296
|
+
}
|
|
3297
|
+
|
|
3298
|
+
wui-flex[data-type='info'] wui-icon-box {
|
|
3299
|
+
background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
|
|
3300
|
+
}
|
|
3301
|
+
|
|
3302
|
+
wui-flex[data-type='success'] wui-icon-box {
|
|
3303
|
+
background-color: ${({tokens:t})=>t.core.backgroundSuccess};
|
|
3304
|
+
}
|
|
3305
|
+
|
|
3306
|
+
wui-flex[data-type='error'] wui-icon-box {
|
|
3307
|
+
background-color: ${({tokens:t})=>t.core.backgroundError};
|
|
3308
|
+
}
|
|
3309
|
+
|
|
3310
|
+
wui-flex[data-type='warning'] wui-icon-box {
|
|
3311
|
+
background-color: ${({tokens:t})=>t.core.backgroundWarning};
|
|
3312
|
+
}
|
|
3313
|
+
|
|
3314
|
+
wui-text {
|
|
3315
|
+
flex: 1;
|
|
3316
|
+
}
|
|
3317
|
+
`;var Pt=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let qe=class extends m{constructor(){super(...arguments),this.icon="externalLink",this.text="",this.type="info"}render(){return l`
|
|
3318
|
+
<wui-flex alignItems="center" data-type=${this.type}>
|
|
3319
|
+
<wui-icon-box size="sm" color="inherit" icon=${this.icon}></wui-icon-box>
|
|
3320
|
+
<wui-text variant="md-regular" color="inherit">${this.text}</wui-text>
|
|
3321
|
+
</wui-flex>
|
|
3322
|
+
`}};qe.styles=[I,W,wo];Pt([c()],qe.prototype,"icon",void 0);Pt([c()],qe.prototype,"text",void 0);Pt([c()],qe.prototype,"type",void 0);qe=Pt([p("wui-banner")],qe);const mo=ee`
|
|
3323
|
+
:host > wui-flex {
|
|
3324
|
+
max-height: clamp(360px, 540px, 80vh);
|
|
3325
|
+
overflow: scroll;
|
|
3326
|
+
scrollbar-width: none;
|
|
3327
|
+
}
|
|
3328
|
+
|
|
3329
|
+
:host > wui-flex::-webkit-scrollbar {
|
|
3330
|
+
display: none;
|
|
3331
|
+
}
|
|
3332
|
+
`;var fo=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let qt=class extends m{constructor(){super(),this.unsubscribe=[]}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l` <wui-flex flexDirection="column" .padding=${["2","3","3","3"]} gap="2">
|
|
3333
|
+
<wui-banner
|
|
3334
|
+
icon="warningCircle"
|
|
3335
|
+
text="You can only receive assets on these networks"
|
|
3336
|
+
></wui-banner>
|
|
3337
|
+
${this.networkTemplate()}
|
|
3338
|
+
</wui-flex>`}networkTemplate(){const e=u.getAllRequestedCaipNetworks(),i=u.getAllApprovedCaipNetworkIds(),o=u.state.activeCaipNetwork,s=u.checkIfSmartAccountEnabled();let n=y.sortRequestedNetworks(i,e);if(s&&ze(o==null?void 0:o.chainNamespace)===Fe.ACCOUNT_TYPES.SMART_ACCOUNT){if(!o)return null;n=[o]}return n.filter(r=>r.chainNamespace===(o==null?void 0:o.chainNamespace)).map(r=>l`
|
|
3339
|
+
<wui-list-network
|
|
3340
|
+
imageSrc=${w(T.getNetworkImage(r))}
|
|
3341
|
+
name=${r.name??"Unknown"}
|
|
3342
|
+
?transparent=${!0}
|
|
3343
|
+
>
|
|
3344
|
+
</wui-list-network>
|
|
3345
|
+
`)}};qt.styles=mo;qt=fo([p("w3m-wallet-compatible-networks-view")],qt);const bo=v`
|
|
3346
|
+
:host {
|
|
3347
|
+
display: flex;
|
|
3348
|
+
justify-content: center;
|
|
3349
|
+
align-items: center;
|
|
3350
|
+
width: 56px;
|
|
3351
|
+
height: 56px;
|
|
3352
|
+
box-shadow: 0 0 0 8px ${({tokens:t})=>t.theme.borderPrimary};
|
|
3353
|
+
border-radius: ${({borderRadius:t})=>t[4]};
|
|
3354
|
+
overflow: hidden;
|
|
3355
|
+
}
|
|
3356
|
+
|
|
3357
|
+
:host([data-border-radius-full='true']) {
|
|
3358
|
+
border-radius: 50px;
|
|
3359
|
+
}
|
|
3360
|
+
|
|
3361
|
+
wui-icon {
|
|
3362
|
+
width: 32px;
|
|
3363
|
+
height: 32px;
|
|
3364
|
+
}
|
|
3365
|
+
`;var Dt=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ge=class extends m{render(){return this.dataset.borderRadiusFull=this.borderRadiusFull?"true":"false",l`${this.templateVisual()}`}templateVisual(){return this.imageSrc?l`<wui-image src=${this.imageSrc} alt=${this.alt??""}></wui-image>`:l`<wui-icon
|
|
3366
|
+
data-parent-size="md"
|
|
3367
|
+
size="inherit"
|
|
3368
|
+
color="inherit"
|
|
3369
|
+
name="wallet"
|
|
3370
|
+
></wui-icon>`}};Ge.styles=[I,bo];Dt([c()],Ge.prototype,"imageSrc",void 0);Dt([c()],Ge.prototype,"alt",void 0);Dt([c({type:Boolean})],Ge.prototype,"borderRadiusFull",void 0);Ge=Dt([p("wui-visual-thumbnail")],Ge);const go=v`
|
|
3371
|
+
:host {
|
|
3372
|
+
display: flex;
|
|
3373
|
+
justify-content: center;
|
|
3374
|
+
gap: ${({spacing:t})=>t[4]};
|
|
3375
|
+
}
|
|
3376
|
+
|
|
3377
|
+
wui-visual-thumbnail:nth-child(1) {
|
|
3378
|
+
z-index: 1;
|
|
3379
|
+
}
|
|
3380
|
+
`;var yo=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Gt=class extends m{constructor(){var e,i,o;super(...arguments),this.dappImageUrl=(e=f.state.metadata)==null?void 0:e.icons,this.walletImageUrl=(o=(i=u.getAccountData())==null?void 0:i.connectedWalletInfo)==null?void 0:o.icon}firstUpdated(){var i;const e=(i=this.shadowRoot)==null?void 0:i.querySelectorAll("wui-visual-thumbnail");e!=null&&e[0]&&this.createAnimation(e[0],"translate(18px)"),e!=null&&e[1]&&this.createAnimation(e[1],"translate(-18px)")}render(){var e;return l`
|
|
3381
|
+
<wui-visual-thumbnail
|
|
3382
|
+
?borderRadiusFull=${!0}
|
|
3383
|
+
.imageSrc=${(e=this.dappImageUrl)==null?void 0:e[0]}
|
|
3384
|
+
></wui-visual-thumbnail>
|
|
3385
|
+
<wui-visual-thumbnail .imageSrc=${this.walletImageUrl}></wui-visual-thumbnail>
|
|
3386
|
+
`}createAnimation(e,i){e.animate([{transform:"translateX(0px)"},{transform:i}],{duration:1600,easing:"cubic-bezier(0.56, 0, 0.48, 1)",direction:"alternate",iterations:1/0})}};Gt.styles=go;Gt=yo([p("w3m-siwx-sign-message-thumbnails")],Gt);var li=globalThis&&globalThis.__decorate||function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let _t=class extends m{constructor(){var e;super(...arguments),this.dappName=(e=f.state.metadata)==null?void 0:e.name,this.isCancelling=!1,this.isSigning=!1}render(){return l`
|
|
3387
|
+
<wui-flex justifyContent="center" .padding=${["8","0","6","0"]}>
|
|
3388
|
+
<w3m-siwx-sign-message-thumbnails></w3m-siwx-sign-message-thumbnails>
|
|
3389
|
+
</wui-flex>
|
|
3390
|
+
<wui-flex .padding=${["0","20","5","20"]} gap="3" justifyContent="space-between">
|
|
3391
|
+
<wui-text variant="lg-medium" align="center" color="primary"
|
|
3392
|
+
>${this.dappName??"Dapp"} needs to connect to your wallet</wui-text
|
|
3393
|
+
>
|
|
3394
|
+
</wui-flex>
|
|
3395
|
+
<wui-flex .padding=${["0","10","4","10"]} gap="3" justifyContent="space-between">
|
|
3396
|
+
<wui-text variant="md-regular" align="center" color="secondary"
|
|
3397
|
+
>Sign this message to prove you own this wallet and proceed. Canceling will disconnect
|
|
3398
|
+
you.</wui-text
|
|
3399
|
+
>
|
|
3400
|
+
</wui-flex>
|
|
3401
|
+
<wui-flex .padding=${["4","5","5","5"]} gap="3" justifyContent="space-between">
|
|
3402
|
+
<wui-button
|
|
3403
|
+
size="lg"
|
|
3404
|
+
borderRadius="xs"
|
|
3405
|
+
fullWidth
|
|
3406
|
+
variant="neutral-secondary"
|
|
3407
|
+
?loading=${this.isCancelling}
|
|
3408
|
+
@click=${this.onCancel.bind(this)}
|
|
3409
|
+
data-testid="w3m-connecting-siwe-cancel"
|
|
3410
|
+
>
|
|
3411
|
+
${this.isCancelling?"Cancelling...":"Cancel"}
|
|
3412
|
+
</wui-button>
|
|
3413
|
+
<wui-button
|
|
3414
|
+
size="lg"
|
|
3415
|
+
borderRadius="xs"
|
|
3416
|
+
fullWidth
|
|
3417
|
+
variant="neutral-primary"
|
|
3418
|
+
@click=${this.onSign.bind(this)}
|
|
3419
|
+
?loading=${this.isSigning}
|
|
3420
|
+
data-testid="w3m-connecting-siwe-sign"
|
|
3421
|
+
>
|
|
3422
|
+
${this.isSigning?"Signing...":"Sign"}
|
|
3423
|
+
</wui-button>
|
|
3424
|
+
</wui-flex>
|
|
3425
|
+
`}async onSign(){this.isSigning=!0;try{await Bt.requestSignMessage()}catch(e){if(e instanceof Error&&e.message.includes("OTP is required")){k.showError({message:"Something went wrong. We need to verify your account again."}),h.replace("DataCapture");return}throw e}finally{this.isSigning=!1}}async onCancel(){this.isCancelling=!0,await Bt.cancelSignMessage().finally(()=>this.isCancelling=!1)}};li([d()],_t.prototype,"isCancelling",void 0);li([d()],_t.prototype,"isSigning",void 0);_t=li([p("w3m-siwx-sign-message-view")],_t);export{ui as AppKitAccountButton,hi as AppKitButton,wi as AppKitConnectButton,fi as AppKitNetworkButton,ci as W3mAccountButton,be as W3mAccountSettingsView,Ft as W3mAccountView,vt as W3mAllWalletsView,di as W3mButton,kt as W3mChooseAccountNameView,pi as W3mConnectButton,H as W3mConnectView,At as W3mConnectWalletsView,xi as W3mConnectingExternalView,Ct as W3mConnectingMultiChainView,Et as W3mConnectingWcBasicView,we as W3mConnectingWcView,Ti as W3mDownloadsView,Ta as W3mFooter,_e as W3mFundWalletView,Si as W3mGetWalletView,mi as W3mNetworkButton,ot as W3mNetworkSwitchView,De as W3mNetworksView,B as W3mProfileWalletsView,Sa as W3mRouter,_t as W3mSIWXSignMessageView,It as W3mSwitchActiveChainView,st as W3mUnsupportedChainView,qt as W3mWalletCompatibleNetworksView,ki as W3mWhatIsANetworkView,Ei as W3mWhatIsAWalletView};
|