1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2709],{6725:(e,t,i)=>{var o=i(28312),a=i(745);i(23499);var r=i(97265),n=i(54166);let s=(0,o.AH)` 2 :host { 3 position: relative; 4 } 5 6 button { 7 display: flex; 8 justify-content: center; 9 align-items: center; 10 height: 48px; 11 width: 100%; 12 background-color: var(--wui-color-accent-glass-010); 13 border-radius: var(--wui-border-radius-xs); 14 border: 1px solid var(--wui-color-accent-glass-010); 15 transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); 16 will-change: background-color; 17 } 18 19 wui-tooltip { 20 padding: 7px var(--wui-spacing-s) 8px var(--wui-spacing-s); 21 position: absolute; 22 top: -8px; 23 left: 50%; 24 transform: translate(-50%, -100%); 25 opacity: 0; 26 display: none; 27 } 28 29 @media (hover: hover) and (pointer: fine) { 30 button:hover:enabled { 31 background-color: var(--wui-color-accent-glass-015); 32 } 33 34 button:active:enabled { 35 background-color: var(--wui-color-accent-glass-020); 36 } 37 } 38`;var l=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let c=class extends o.WF{constructor(){super(...arguments),this.text="",this.icon="card"}render(){return(0,o.qy)`<button> 39 <wui-icon color="accent-100" name=${this.icon} size="lg"></wui-icon> 40 </button>`}};c.styles=[r.W5,r.fD,s],l([(0,a.MZ)()],c.prototype,"text",void 0),l([(0,a.MZ)()],c.prototype,"icon",void 0),c=l([(0,n.E)("wui-icon-button")],c)},7273:(e,t,i)=>{i.d(t,{T:()=>o});let o={URLS:{FAQ:"https://walletconnect.com/faq"}}},13998:(e,t,i)=>{i(48252)},23050:(e,t,i)=>{var o=i(28312),a=i(745);i(23499);var r=i(97265),n=i(54166);let s=(0,o.AH)` 41 :host { 42 display: flex; 43 justify-content: center; 44 align-items: center; 45 width: 40px; 46 height: 40px; 47 border-radius: var(--wui-border-radius-3xl); 48 border: 1px solid var(--wui-color-gray-glass-005); 49 overflow: hidden; 50 } 51 52 wui-icon { 53 width: 100%; 54 height: 100%; 55 } 56`;var l=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let c=class extends o.WF{constructor(){super(...arguments),this.logo="google"}render(){return(0,o.qy)`<wui-icon color="inherit" size="inherit" name=${this.logo}></wui-icon> `}};c.styles=[r.W5,s],l([(0,a.MZ)()],c.prototype,"logo",void 0),c=l([(0,n.E)("wui-logo")],c)},33559:(e,t,i)=>{i.d(t,{Up:()=>w});var o=i(60500),a=i(11076),r=i(90906),n=i(54252),s=i(32836),l=i(19628),c=i(5517),d=i(35558),u=i(5582);async function p(){l.I.push("ConnectingFarcaster");let e=n.a.getAuthConnector();if(e&&!a.U.state.farcasterUrl)try{let{url:t}=await e.provider.getFarcasterUri();a.U.setFarcasterUrl(t,r.W.state.activeChain)}catch(e){l.I.goBack(),c.P.showError(e)}}async function h(e){l.I.push("ConnectingSocial");let t=n.a.getAuthConnector(),i=null;try{let n=setTimeout(()=>{throw Error("Social login timed out. Please try again.")},45e3);if(t&&e){if(d.w.isTelegram()||(i=function(){try{return d.w.returnOpenHref(`${o.o.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes")}catch(e){throw Error("Could not open social popup")}}()),i)a.U.setSocialWindow(i,r.W.state.activeChain);else if(!d.w.isTelegram())throw Error("Could not create social popup");let{uri:s}=await t.provider.getSocialRedirectUri({provider:e});if(!s)throw i?.close(),Error("Could not fetch the social redirect uri");if(i&&(i.location.href=s),d.w.isTelegram()){u.i.setTelegramSocialProvider(e);let t=d.w.formatTelegramSocialLoginUrl(s);d.w.openHref(t,"_top")}clearTimeout(n)}}catch(e){i?.close(),c.P.showError(e?.message)}}async function w(e){a.U.setSocialProvider(e,r.W.state.activeChain),s.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:e}}
56),"farcaster"===e?await p():await h(e)}},37054:(e,t,i)=>{var o=i(28312),a=i(745),r=i(68216),n=i(19628),s=i(33806),l=i(52515);let c=(0,o.AH)` 57 :host { 58 width: 100%; 59 display: block; 60 } 61`;var d=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let u=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.text="",this.open=r.I.state.open,this.unsubscribe.push(n.I.subscribeKey("view",()=>{r.I.hide()}),s.W.subscribeKey("open",e=>{e||r.I.hide()}),r.I.subscribeKey("open",e=>{this.open=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),r.I.hide()}render(){return(0,o.qy)` 62 <div 63 @pointermove=${this.onMouseEnter.bind(this)} 64 @pointerleave=${this.onMouseLeave.bind(this)} 65 > 66 ${this.renderChildren()} 67 </div> 68 `}renderChildren(){return(0,o.qy)`<slot></slot> `}onMouseEnter(){let e=this.getBoundingClientRect();this.open||r.I.showTooltip({message:this.text,triggerRect:{width:e.width,height:e.height,left:e.left,top:e.top},variant:"shade"})}onMouseLeave(e){this.contains(e.relatedTarget)||r.I.hide()}};u.styles=[c],d([(0,a.MZ)()],u.prototype,"text",void 0),d([(0,a.wk)()],u.prototype,"open",void 0),u=d([(0,l.EM)("w3m-tooltip-trigger")],u)},38254:(e,t,i)=>{var o=i(28312),a=i(745);i(23499),i(25322),i(98750);var r=i(97265),n=i(54166);let s=(0,o.AH)` 69 button { 70 border: none; 71 border-radius: var(--wui-border-radius-3xl); 72 } 73 74 button[data-variant='main'] { 75 background-color: var(--wui-color-accent-100); 76 color: var(--wui-color-inverse-100); 77 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); 78 } 79 80 button[data-variant='accent'] { 81 background-color: var(--wui-color-accent-glass-010); 82 color: var(--wui-color-accent-100); 83 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); 84 } 85 86 button[data-variant='gray'] { 87 background-color: transparent; 88 color: var(--wui-color-fg-200); 89 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); 90 } 91 92 button[data-variant='shade'] { 93 background-color: transparent; 94 color: var(--wui-color-accent-100); 95 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); 96 } 97 98 button[data-size='sm'] { 99 height: 32px; 100 padding: 0 var(--wui-spacing-s); 101 } 102 103 button[data-size='md'] { 104 height: 40px; 105 padding: 0 var(--wui-spacing-l); 106 } 107 108 button[data-size='sm'] > wui-image { 109 width: 16px; 110 height: 16px; 111 } 112 113 button[data-size='md'] > wui-image { 114 width: 24px; 115 height: 24px; 116 } 117 118 button[data-size='sm'] > wui-icon { 119 width: 12px; 120 height: 12px; 121 } 122 123 button[data-size='md'] > wui-icon { 124 width: 14px; 125 height: 14px; 126 } 127 128 wui-image { 129 border-radius: var(--wui-border-radius-3xl); 130 overflow: hidden; 131 } 132 133 button.disabled > wui-icon, 134 button.disabled > wui-image { 135 filter: grayscale(1); 136 } 137 138 button[data-variant='main'] > wui-image { 139 box-shadow: inset 0 0 0 1px var(--wui-color-accent-090); 140 } 141 142 button[data-variant='shade'] > wui-image, 143 button[data-variant='gray'] > wui-image { 144 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); 145 } 146 147 @media (hover: hover) and (pointer: fine) { 148 button[data-variant='main']:focus-visible { 149 background-color: var(--wui-color-accent-090); 150 } 151 152 button[data-variant='main']:hover:enabled { 153 background-color: var(--wui-color-accent-090); 154 } 155 156 button[data-variant='main']:active:enabled { 157 background-color: var(--wui-color-accent-080); 158 } 159 160 button[data-variant='accent']:hover:enabled { 161 background-color: var(--wui-color-accent-glass-015); 162 } 163 164 button[data-variant='accent']:active:enabled { 165 background-color: var(--wui-color-accent-glass-020); 166 } 167 168 button[data-variant='shade']:focus-visible, 169 button[data-variant='gray']:focus-visible, 170 button[data-variant='shade']:hover, 171 button[data-variant='gray']:hover { 172 background-color: var(--wui-color-gray-glass-002); 173 } 174 175 button[data-variant='gray']:active, 176 button[data-variant='shade']:active { 177 background-color: var(--wui-color-gray-glass-005); 178 } 179 } 180 181 button.disabled { 182 color: var(--wui-color-gray-glass-020); 183 background-color: var(--wui-color-gray-glass-002); 184 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); 185 pointer-events: none; 186 } 187`;var l=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let c=class extends o.WF{constructor(){super(...arguments),this.variant="accent",this.imageSrc="",this.disabled=!1,this.icon="externalLink",this.size="md",this.text=""}render(){let e="sm"===this.size?"small-600":"paragraph-600";return(0,o.qy)` 188 <button 189 class=${this.disabled?"disabled":""} 190 data-variant=${this.variant} 191 data-size=${this.size} 192 > 193 ${this.imageSrc?(0,o.qy)`<wui-image src=${this.imageSrc}></wui-image>`:null} 194 <wui-text variant=${e} color="inherit"> ${this.text} </wui-text> 195 <wui-icon name=${this.icon} color="inherit" size="inherit"></wui-icon> 196 </button> 197 `}};c.styles=[r.W5,r.fD,s],l([(0,a.MZ)()],c.prototype,"variant",void 0),l([(0,a.MZ)()],c.prototype,"imageSrc",void 0),l([(0,a.MZ)({type:Boolean})],c.prototype,"disabled",void 0),l([(0,a.MZ)()],c.prototype,"icon",void 0),l([(0,a.MZ)()],c.prototype,"size",void 0),l([(0,a.MZ)()],c.prototype,"text",void 0),c=l([(0,n.E)("wui-chip-button")],c)},45217:(e,t,i)=>{var o=i(28312),a=i(745);let r=(0,o.JW)`<svg width="86" height="96" fill="none"> 198 <path 199 d="M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z" 200 /> 201</svg>`;var n=i(65674);let s=(0,o.JW)` 202 <svg fill="none" viewBox="0 0 36 40"> 203 <path 204 d="M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.
20461 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z" 205 /> 206 </svg> 207`;i(23499),i(25322);var l=i(97265),c=i(54166);let d=(0,o.AH)` 208 :host { 209 position: relative; 210 border-radius: inherit; 211 display: flex; 212 justify-content: center; 213 align-items: center; 214 width: var(--local-width); 215 height: var(--local-height); 216 } 217 218 :host([data-round='true']) { 219 background: var(--wui-color-gray-glass-002); 220 border-radius: 100%; 221 outline: 1px solid var(--wui-color-gray-glass-005); 222 } 223 224 svg { 225 position: absolute; 226 top: 0; 227 left: 0; 228 width: 100%; 229 height: 100%; 230 z-index: 1; 231 fill: var(--wui-color-gray-glass-002); 232 } 233 234 svg > path { 235 stroke: var(--local-stroke); 236 } 237 238 wui-image { 239 width: 100%; 240 height: 100%; 241 -webkit-clip-path: var(--local-path); 242 clip-path: var(--local-path); 243 background: var(--wui-color-gray-glass-002); 244 } 245 246 wui-icon { 247 transform: translateY(-5%); 248 width: var(--local-icon-size); 249 height: var(--local-icon-size); 250 } 251`;var u=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let p=class extends o.WF{constructor(){super(...arguments),this.size="md",this.name="uknown",this.networkImagesBySize={sm:s,md:n.a,lg:r},this.selected=!1,this.round=!1}render(){return this.round?(this.dataset.round="true",this.style.cssText=` 252 --local-width: var(--wui-spacing-3xl); 253 --local-height: var(--wui-spacing-3xl); 254 --local-icon-size: var(--wui-spacing-l); 255 `):this.style.cssText=` 256 257 --local-path: var(--wui-path-network-${this.size}); 258 --local-width: var(--wui-width-network-${this.size}); 259 --local-height: var(--wui-height-network-${this.size}); 260 --local-icon-size: var(--wui-icon-size-network-${this.size}); 261 `,(0,o.qy)`${this.templateVisual()} ${this.svgTemplate()} `}svgTemplate(){return this.round?null:this.networkImagesBySize[this.size]}templateVisual(){return this.imageSrc?(0,o.qy)`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:(0,o.qy)`<wui-icon size="inherit" color="fg-200" name="networkPlaceholder"></wui-icon>`}};p.styles=[l.W5,d],u([(0,a.MZ)()],p.prototype,"size",void 0),u([(0,a.MZ)()],p.prototype,"name",void 0),u([(0,a.MZ)({type:Object})],p.prototype,"networkImagesBySize",void 0),u([(0,a.MZ)()],p.prototype,"imageSrc",void 0),u([(0,a.MZ)({type:Boolean})],p.prototype,"selected",void 0),u([(0,a.MZ)({type:Boolean})],p.prototype,"round",void 0),p=u([(0,c.E)("wui-network-image")],p)},45440:(e,t,i)=>{var o=i(28312),a=i(745);i(23499),i(25322),i(43804);var r=i(97265),n=i(54166);i(89556);let s=(0,o.AH)` 262 :host { 263 position: relative; 264 background-color: var(--wui-color-gray-glass-002); 265 display: flex; 266 justify-content: center; 267 align-items: center; 268 width: var(--local-size); 269 height: var(--local-size); 270 border-radius: inherit; 271 border-radius: var(--local-border-radius); 272 } 273 274 :host > wui-flex { 275 overflow: hidden; 276 border-radius: inherit; 277 border-radius: var(--local-border-radius); 278 } 279 280 :host::after { 281 content: ''; 282 position: absolute; 283 top: 0; 284 bottom: 0; 285 left: 0; 286 right: 0; 287 border-radius: inherit; 288 border: 1px solid var(--wui-color-gray-glass-010); 289 pointer-events: none; 290 } 291 292 :host([name='Extension'])::after { 293 border: 1px solid var(--wui-color-accent-glass-010); 294 } 295 296 :host([data-wallet-icon='allWallets']) { 297 background-color: var(--wui-all-wallets-bg-100); 298 } 299 300 :host([data-wallet-icon='allWallets'])::after { 301 border: 1px solid var(--wui-color-accent-glass-010); 302 } 303 304 wui-icon[data-parent-size='inherit'] { 305 width: 75%; 306 height: 75%; 307 align-items: center; 308 } 309 310 wui-icon[data-parent-size='sm'] { 311 width: 18px; 312 height: 18px; 313 } 314 315 wui-icon[data-parent-size='md'] { 316 width: 24px; 317 height: 24px; 318 } 319 320 wui-icon[data-parent-size='lg'] { 321 width: 42px; 322 height: 42px; 323 } 324 325 wui-icon[data-parent-size='full'] { 326 width: 100%; 327 height: 100%; 328 } 329 330 :host > wui-icon-box { 331 position: absolute; 332 overflow: hidden; 333 right: -1px; 334 bottom: -2px; 335 z-index: 1; 336 border: 2px solid var(--wui-color-bg-150, #1e1f1f); 337 padding: 1px; 338 } 339`;var l=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let c=class extends o.WF{constructor(){super(...arguments),this.size="md",this.name="",this.installed=!1,this.badgeSize="xs"}render(){let e="xxs";return e="lg"===this.size?"m":"md"===this.size?"xs":"xxs",this.style.cssText=` 340 --local-border-radius: var(--wui-border-radius-${e}); 341 --local-size: var(--wui-wallet-image-size-${this.size}); 342 `,this.walletIcon&&(this.dataset.walletIcon=this.walletIcon),(0,o.qy)` 343 <wui-flex justifyContent="center" alignItems="center"> ${this.templateVisual()} </wui-flex> 344 `}templateVisual(){return this.imageSrc?(0,o.qy)`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:this.walletIcon?(0,o.qy)`<wui-icon 345 data-parent-size="md" 346 size="md" 347 color="inherit" 348 name=${this.walletIcon} 349 ></wui-icon>`:(0,o.qy)`<wui-icon 350 data-parent-size=${this.size} 351 size="inherit" 352 color="inherit" 353 name="walletPlaceholder" 354 ></wui-icon>`}};c.styles=[r.fD,r.W5,s],l([(0,a.MZ)()],c.prototype,"size",void 0),l([(0,a.MZ)()],c.prototype,"name",void 0),l([(0,a.MZ)()],c.prototype,"imageSrc",void 0),l([(0,a.MZ)()],c.prototype,"walletIcon",void 0),l([(0,a.MZ)({type:Boolean})],c.prototype,"installed",void 0),l([(0,a.MZ)()],c.prototype,"badgeSize",void 0),c=l([(0,n.E)("wui-wallet-image")],c)},47122:(e,t,i)=>{i(45440)},48347:(e,t,i)=>{i(45217)},50196:(e,t,i)=>{var o=i(28312),a=i(745);i(23499),i(25322),i(98750);var r=i(97265),n=i(59970),s=i(54166);let l=(0,o.AH)` 355 a { 356 border: 1px solid var(--wui-color-gray-glass-010); 357 border-radius: var(--wui-border-radius-3xl); 358 } 359 360 wui-image { 361 border-radius: var(--wui-border-radius-3xl); 362 overflow: hidden; 363 } 364 365 a.disabled > wui-icon:not(.image-icon), 366 a.disabled > wui-image { 367 filter: grayscale(1); 368 } 369 370 a[data-variant='fill'] { 371 color: var(--wui-color-inverse-100); 372 background-color: var(--wui-color-accent-100); 373 } 374 375 a[data-variant='shade'], 376 a[data-variant='shadeSmall'] { 377 background-color: transparent; 378 background-color: var(--wui-color-gray-glass-010); 379 color: var(--wui-color-fg-200); 380 } 381 382 a[data-variant='success'] { 383 column-gap: var(--wui-spacing-xxs); 384 border: 1px solid var(--wui-color-success-glass-010); 385 background-color: var(--wui-color-success-glass-010); 386 color: var(--wui-color-success-100); 387 } 388 389 a[data-variant='error'] { 390 column-gap: var(--wui-spacing-xxs); 391 border: 1px solid var(--wui-color-error-glass-010); 392 background-color: var(--wui-color-error-glass-010); 393 color: var(--wui-color-error-100); 394 } 395 396 a[data-variant='transparent'] { 397 column-gap: var(--wui-spacing-xxs); 398 background-color: transparent; 399 color: var(--wui-color-fg-150); 400 } 401 402 a[data-variant='transparent'], 403 a[data-variant='success'], 404 a[data-variant='shadeSmall'], 405 a[data-variant='error'] { 406 padding: 7px var(--wui-spacing-s) 7px 10px; 407 } 408 409 a[data-variant='transparent']:has(wui-text:first-child), 410 a[data-variant='success']:has(wui-text:first-child), 411 a[data-variant='shadeSmall']:has(wui-text:first-child), 412 a[data-variant='error']:has(wui-text:first-child) { 413 padding: 7px var(--wui-spacing-s); 414 } 415 416 a[data-variant='fill'], 417 a[data-variant='shade'] { 418 column-gap: var(--wui-spacing-xs); 419 padding: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-xxs) 420 var(--wui-spacing-xs); 421 } 422 423 a[data-variant='fill']:has(wui-text:first-child), 424 a[data-variant='shade']:has(wui-text:first-child) { 425 padding: 9px var(--wui-spacing-m) 9px var(--wui-spacing-m); 426 } 427 428 a[data-variant='fill'] > wui-image, 429 a[data-variant='shade'] > wui-image { 430 width: 24px; 431 height: 24px; 432 } 433 434 a[data-variant='fill'] > wui-image { 435 box-shadow: inset 0 0 0 1px var(--wui-color-accent-090); 436 } 437 438 a[data-variant='shade'] > wui-image, 439 a[data-variant='shadeSmall'] > wui-image { 440 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); 441 } 442 443 a[data-variant='fill'] > wui-icon:not(.image-icon), 444 a[data-variant='shade'] > wui-icon:not(.image-icon) { 445 width: 14px; 446 height: 14px; 447 } 448 449 a[data-variant='transparent'] > wui-image, 450 a[data-variant='success'] > wui-image, 451 a[data-variant='shadeSmall'] > wui-image, 452 a[data-variant='error'] > wui-image { 453 width: 14px; 454 height: 14px; 455 } 456 457 a[data-variant='transparent'] > wui-icon:not(.image-icon), 458 a[data-variant='success'] > wui-icon:not(.image-icon), 459 a[data-variant='shadeSmall'] > wui-icon:not(.image-icon), 460 a[data-variant='error'] > wui-icon:not(.image-icon) { 461 width: 12px; 462 height: 12px; 463 } 464 465 a[data-variant='fill']:focus-visible { 466 background-color: var(--wui-color-accent-090); 467 } 468 469 a[data-variant='shade']:focus-visible, 470 a[data-variant='shadeSmall']:focus-visible { 471 background-color: var(--wui-color-gray-glass-015); 472 } 473 474 a[data-variant='transparent']:focus-visible { 475 background-color: var(--wui-color-gray-glass-005); 476 } 477 478 a[data-variant='success']:focus-visible { 479 background-color: var(--wui-color-success-glass-015); 480 } 481 482 a[data-variant='error']:focus-visible { 483 background-color: var(--wui-color-error-glass-015); 484 } 485 486 a.disabled { 487 color: var(--wui-color-gray-glass-015); 488 background-color: var(--wui-color-gray-glass-015); 489 pointer-events: none; 490 } 491 492 @media (hover: hover) and (pointer: fine) { 493 a[data-variant='fill']:hover { 494 background-color: var(--wui-color-accent-090); 495 } 496 497 a[data-variant='shade']:hover, 498 a[data-variant='shadeSmall']:hover { 499 background-color: var(--wui-color-gray-glass-015); 500 } 501 502 a[data-variant='transparent']:hover { 503 background-color: var(--wui-color-gray-glass-005); 504 } 505 506 a[data-variant='success']:hover { 507 background-color: var(--wui-color-success-glass-015); 508 } 509 510 a[data-variant='error']:hover { 511 background-color: var(--wui-color-error-glass-015); 512 } 513 } 514 515 a[data-variant='fill']:active { 516 background-color: var(--wui-color-accent-080); 517 } 518 519 a[data-variant='shade']:active, 520 a[data-variant='shadeSmall']:active { 521 background-color: var(--wui-color-gray-glass-020); 522 } 523 524 a[data-variant='transparent']:active { 525 background-color: var(--wui-color-gray-glass-010); 526 } 527 528 a[data-variant='success']:active { 529 background-color: var(--wui-color-success-glass-020); 530 } 531 532 a[data-variant='error']:active { 533 background-color: var(--wui-color-error-glass-020); 534 } 535`;var c=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let d=class extends o.WF{constructor(){super(...arguments),this.variant="fill",this.imageSrc=void 0,this.imageIcon=void 0,this.imageIconSize="md",this.disabled=!1,this.icon="externalLink",this.href="",this.text=void 0}render(){let e="success"===this.variant||"transparent"===this.variant||"shadeSmall"===this.variant;return(0,o.qy)` 536 <a 537 rel="noreferrer" 538 target="_blank" 539 href=${this.href} 540 class=${this.disabled?"disabled":""} 541 data-variant=${this.variant} 542 > 543 ${this.imageTemplate()} 544 <wui-text variant=${e?"small-600":"paragraph-600"} color="inherit"> 545 ${this.title?this.title:n.Z.getHostName(this.href)} 546 </wui-text> 547 <wui-icon name=${this.icon} color="inherit" size="inherit"></wui-icon> 548 </a> 549 `}imageTemplate(){return this.imageSrc?(0,o.qy)`<wui-image src=${this.imageSrc}></wui-image>`:this.imageIcon?(0,o.qy)`<wui-icon 550 name=${this.imageIcon} 551 color="inherit" 552 size=${this.imageIconSize} 553 class="image-icon" 554 ></wui-icon>`:null}};d.styles=[r.W5,r.fD,l],c([(0,a.MZ)()],d.prototype,"variant",void 0),c([(0,a.MZ)()],d.prototype,"imageSrc",void 0),c([(0,a.MZ)()],d.prototype,"imageIcon",void 0),c([(0,a.MZ)()],d.prototype,"imageIconSize",void 0),c([(0,a.MZ)({type:Boolean})],d.prototype,"disabled",void 0),c([(0,a.MZ)()],d.prototype,"icon",void 0),c([(0,a.MZ)()],d.prototype,"href",void 0),c([(0,a.MZ)()],d.prototype,"text",void 0),d=c([(0,s.E)("wui-chip")],d)},60567:(e,t,i)=>{var o=i(28312),a=i(745),r=i(51882);i(98750);var n=i(97265),s=i(54166);i(39151);let l=(0,o.AH)` 555 :host { 556 position: relative; 557 display: inline-block; 558 } 559 560 wui-text { 561 margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m); 562 } 563`;var c=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let d=class extends o.WF{constructor(){super(...arguments),this.disabled=!1}render(){return(0,o.qy)` 564 <wui-input-text 565 type="email" 566 placeholder="Email" 567 icon="mail" 568 size="mdl" 569 .disabled=${this.disabled} 570 .value=${this.value} 571 data-testid="wui-email-input" 572 tabIdx=${(0,r.J)(this.tabIdx)} 573 ></wui-input-text> 574 ${this.templateError()} 575 `}templateError(){return this.errorMessage?(0,o.qy)`<wui-text variant="tiny-500" color="error-100">${this.errorMessage}</wui-text>`:null}};d.styles=[n.W5,l],c([(0,a.MZ)()],d.prototype,"errorMessage",void 0),c([(0,a.MZ)({type:Boolean})],d.prototype,"disabled",void 0),c([(0,a.MZ)()],d.prototype,"value",void 0),c([(0,a.MZ)()],d.prototype,"tabIdx",void 0),d=c([(0,s.E)("wui-email-input")],d)},64644:(e,t,i)=>{var o=i(28312),a=i(745);i(25322);var r=i(97265),n=i(59970),s=i(54166);let l=(0,o.AH)` 576 :host { 577 display: block; 578 width: var(--local-width); 579 height: var(--local-height); 580 border-radius: var(--wui-border-radius-3xl); 581 box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005); 582 overflow: hidden; 583 position: relative; 584 } 585 586 :host([data-variant='generated']) { 587 --mixed-local-color-1: var(--local-color-1); 588 --mixed-local-color-2: var(--local-color-2); 589 --mixed-local-color-3: var(--local-color-3); 590 --mixed-local-color-4: var(--local-color-4); 591 --mixed-local-color-5: var(--local-color-5); 592 } 593 594 @supports (background: color-mix(in srgb, white 50%, black)) { 595 :host([data-variant='generated']) { 596 --mixed-local-color-1: color-mix( 597 in srgb, 598 var(--w3m-color-mix) var(--w3m-color-mix-strength), 599 var(--local-color-1) 600 ); 601 --mixed-local-color-2: color-mix( 602 in srgb, 603 var(--w3m-color-mix) var(--w3m-color-mix-strength), 604 var(--local-color-2) 605 ); 606 --mixed-local-color-3: color-mix( 607 in srgb, 608 var(--w3m-color-mix) var(--w3m-color-mix-strength), 609 var(--local-color-3) 610 ); 611 --mixed-local-color-4: color-mix( 612 in srgb, 613 var(--w3m-color-mix) var(--w3m-color-mix-strength), 614 var(--local-color-4) 615 ); 616 --mixed-local-color-5: color-mix( 617 in srgb, 618 var(--w3m-color-mix) var(--w3m-color-mix-strength), 619 var(--local-color-5) 620 ); 621 } 622 } 623 624 :host([data-variant='generated']) { 625 box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005); 626 background: radial-gradient( 627 var(--local-radial-circle), 628 #fff 0.52%, 629 var(--mixed-local-color-5) 31.25%, 630 var(--mixed-local-color-3) 51.56%, 631 var(--mixed-local-color-2) 65.63%, 632 var(--mixed-local-color-1) 82.29%, 633 var(--mixed-local-color-4) 100% 634 ); 635 } 636 637 :host([data-variant='default']) { 638 box-shadow: 0 0 0 8px
638 var(--wui-color-gray-glass-005); 639 background: radial-gradient( 640 75.29% 75.29% at 64.96% 24.36%, 641 #fff 0.52%, 642 #f5ccfc 31.25%, 643 #dba4f5 51.56%, 644 #9a8ee8 65.63%, 645 #6493da 82.29%, 646 #6ebdea 100% 647 ); 648 } 649`;var c=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let d=class extends o.WF{constructor(){super(...arguments),this.imageSrc=void 0,this.alt=void 0,this.address=void 0,this.size="xl"}render(){return this.style.cssText=` 650 --local-width: var(--wui-icon-box-size-${this.size}); 651 --local-height: var(--wui-icon-box-size-${this.size}); 652 `,(0,o.qy)`${this.visualTemplate()}`}visualTemplate(){if(this.imageSrc)return this.dataset.variant="image",(0,o.qy)`<wui-image src=${this.imageSrc} alt=${this.alt??"avatar"}></wui-image>`;if(this.address){this.dataset.variant="generated";let e=n.Z.generateAvatarColors(this.address);return this.style.cssText+=` 653 ${e}`,null}return this.dataset.variant="default",null}};d.styles=[r.W5,l],c([(0,a.MZ)()],d.prototype,"imageSrc",void 0),c([(0,a.MZ)()],d.prototype,"alt",void 0),c([(0,a.MZ)()],d.prototype,"address",void 0),c([(0,a.MZ)()],d.prototype,"size",void 0),d=c([(0,s.E)("wui-avatar")],d)},65674:(e,t,i)=>{i.d(t,{a:()=>a});var o=i(28312);let a=(0,o.JW)`<svg viewBox="0 0 48 54" fill="none"> 654 <path 655 d="M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z" 656 /> 657</svg>`},69551:(e,t,i)=>{var o=i(28312),a=i(745);i(98750);var r=i(97265),n=i(54166);let s=(0,o.AH)` 658 :host { 659 position: relative; 660 display: flex; 661 width: 100%; 662 height: 1px; 663 background-color: var(--wui-color-gray-glass-005); 664 justify-content: center; 665 align-items: center; 666 } 667 668 :host > wui-text { 669 position: absolute; 670 padding: 0px 10px; 671 background-color: var(--wui-color-modal-bg); 672 transition: background-color var(--wui-duration-lg) var(--wui-ease-out-power-1); 673 will-change: background-color; 674 } 675`;var l=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let c=class extends o.WF{constructor(){super(...arguments),this.text=""}render(){return(0,o.qy)`${this.template()}`}template(){return this.text?(0,o.qy)`<wui-text variant="small-500" color="fg-200">${this.text}</wui-text>`:null}};c.styles=[r.W5,s],l([(0,a.MZ)()],c.prototype,"text",void 0),c=l([(0,n.E)("wui-separator")],c)},72709:(e,t,i)=>{i.r(t),i.d(t,{AppKitAccountButton:()=>C,AppKitButton:()=>E,AppKitConnectButton:()=>P,AppKitNetworkButton:()=>F,W3mAccountButton:()=>k,W3mAccountSettingsView:()=>es,W3mAccountView:()=>eZ,W3mAllWalletsView:()=>tF,W3mButton:()=>A,W3mChooseAccountNameView:()=>on,W3mConnectButton:()=>M,W3mConnectView:()=>iq,W3mConnectWalletsView:()=>og,W3mConnectingExternalView:()=>iJ,W3mConnectingMultiChainView:()=>iY,W3mConnectingWcBasicView:()=>oi,W3mConnectingWcView:()=>oe,W3mDownloadsView:()=>os,W3mGetWalletView:()=>ol,W3mNetworkButton:()=>B,W3mNetworkSwitchView:()=>oy,W3mNetworksView:()=>oA,W3mProfileView:()=>eK,W3mProfileWalletsView:()=>tu,W3mRouter:()=>H.J,W3mSIWXSignMessageView:()=>oG,W3mSwitchActiveChainView:()=>oW,W3mSwitchAddressView:()=>e3,W3mUnsupportedChainView:()=>oj,W3mWalletCompatibleNetworksView:()=>oZ,W3mWhatIsANetworkView:()=>oN,W3mWhatIsAWalletView:()=>op});var o=i(28312),a=i(745),r=i(51882),n=i(96641),s=i(90906),l=i(74623),c=i(34735),d=i(11076),u=i(35558),p=i(33806),h=i(52515);i(25322),i(4537),i(98750),i(43804);var w=i(97265),g=i(59970),b=i(54166);i(64644),i(89556);let f=(0,o.AH)` 676 :host { 677 display: block; 678 } 679 680 button { 681 border-radius: var(--wui-border-radius-3xl); 682 background: var(--wui-color-gray-glass-002); 683 display: flex; 684 gap: var(--wui-spacing-xs); 685 padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) var(--wui-spacing-3xs) 686 var(--wui-spacing-xs); 687 border: 1px solid var(--wui-color-gray-glass-005); 688 } 689 690 button:disabled { 691 background: var(--wui-color-gray-glass-015); 692 } 693 694 button:disabled > wui-text { 695 color: var(--wui-color-gray-glass-015); 696 } 697 698 button:disabled > wui-flex > wui-text { 699 color: var(--wui-color-gray-glass-015); 700 } 701 702 button:disabled > wui-image, 703 button:disabled > wui-flex > wui-avatar { 704 filter: grayscale(1); 705 } 706 707 button:has(wui-image) { 708 padding: var(--wui-spacing-3xs) var(--wui-spacing-3xs) var(--wui-spacing-3xs) 709 var(--wui-spacing-xs); 710 } 711 712 wui-text { 713 color: var(--wui-color-fg-100); 714 } 715 716 wui-flex > wui-text { 717 color: var(--wui-color-fg-200); 718 } 719 720 wui-image, 721 wui-icon-box { 722 border-radius: var(--wui-border-radius-3xl); 723 width: 24px; 724 height: 24px; 725 box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); 726 } 727 728 wui-flex { 729 border-radius: var(--wui-border-radius-3xl); 730 border: 1px solid var(--wui-color-gray-glass-005); 731 background: var(--wui-color-gray-glass-005); 732 padding: 4px var(--wui-spacing-m) 4px var(--wui-spacing-xxs); 733 } 734 735 button.local-no-balance { 736 border-radius: 0px; 737 border: none; 738 background: transparent; 739 } 740 741 wui-avatar {
742 width: 20px; 743 height: 20px; 744 box-shadow: 0 0 0 2px var(--wui-color-accent-glass-010); 745 } 746 747 @media (max-width: 500px) { 748 button { 749 gap: 0px; 750 padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) !important; 751 height: 32px; 752 } 753 wui-image, 754 wui-icon-box, 755 button > wui-text { 756 visibility: hidden; 757 width: 0px; 758 height: 0px; 759 } 760 button { 761 border-radius: 0px; 762 border: none; 763 background: transparent; 764 padding: 0px; 765 } 766 } 767 768 @media (hover: hover) and (pointer: fine) { 769 button:hover:enabled > wui-flex > wui-text { 770 color: var(--wui-color-fg-175); 771 } 772 773 button:active:enabled > wui-flex > wui-text { 774 color: var(--wui-color-fg-175); 775 } 776 } 777`;var m=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let v=class extends o.WF{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(0,o.qy)` 778 <button 779 ?disabled=${this.disabled} 780 class=${(0,r.J)(this.balance?void 0:"local-no-balance")} 781 > 782 ${this.balanceTemplate()} 783 <wui-flex gap="xxs" alignItems="center"> 784 <wui-avatar 785 .imageSrc=${this.avatarSrc} 786 alt=${this.address} 787 address=${this.address} 788 ></wui-avatar> 789 <wui-text variant="paragraph-600" color="inherit"> 790 ${this.address?g.Z.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"}):null} 791 </wui-text> 792 </wui-flex> 793 </button> 794 `}balanceTemplate(){if(this.isUnsupportedChain)return(0,o.qy)` <wui-icon-box 795 size="sm" 796 iconColor="error-100" 797 backgroundColor="error-100" 798 icon="warningCircle" 799 ></wui-icon-box> 800 <wui-text variant="paragraph-600" color="inherit"> Switch Network</wui-text>`;if(this.balance){let e=this.networkSrc?(0,o.qy)`<wui-image src=${this.networkSrc}></wui-image>`:(0,o.qy)` 801 <wui-icon-box 802 size="sm" 803 iconColor="fg-200" 804 backgroundColor="fg-300" 805 icon="networkPlaceholder" 806 ></wui-icon-box> 807 `,t=this.loading?(0,o.qy)`<wui-loading-spinner size="md" color="fg-200"></wui-loading-spinner>`:(0,o.qy)`<wui-text variant="paragraph-600" color="inherit"> ${this.balance}</wui-text>`;return(0,o.qy)`${e} ${t}`}return null}};v.styles=[w.W5,w.fD,f],m([(0,a.MZ)()],v.prototype,"networkSrc",void 0),m([(0,a.MZ)()],v.prototype,"avatarSrc",void 0),m([(0,a.MZ)()],v.prototype,"balance",void 0),m([(0,a.MZ)({type:Boolean})],v.prototype,"isUnsupportedChain",void 0),m([(0,a.MZ)({type:Boolean})],v.prototype,"disabled",void 0),m([(0,a.MZ)({type:Boolean})],v.prototype,"loading",void 0),m([(0,a.MZ)()],v.prototype,"address",void 0),m([(0,a.MZ)()],v.prototype,"profileName",void 0),m([(0,a.MZ)()],v.prototype,"charsStart",void 0),m([(0,a.MZ)()],v.prototype,"charsEnd",void 0),v=m([(0,b.E)("wui-account-button")],v);var y=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class x extends o.WF{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.namespace=void 0,this.isSupported=!!n.H.state.allowUnsupportedChain||!s.W.state.activeChain||s.W.checkIfSupportedNetwork(s.W.state.activeChain)}connectedCallback(){super.connectedCallback(),this.setAccountData(s.W.getAccountData(this.namespace)),this.setNetworkData(s.W.getNetworkData(this.namespace))}firstUpdated(){let e=this.namespace;e?this.unsubscribe.push(s.W.subscribeChainProp("accountState",e=>{this.setAccountData(e)},e),s.W.subscribeChainProp("networkState",t=>{this.setNetworkData(t),this.isSupported=s.W.checkIfSupportedNetwork(e,t?.caipNetwork)},e)):this.unsubscribe.push(l.j.subscribeNetworkImages(()=>{this.networkImage=c.$.getNetworkImage(this.network)}),s.W.subscribeKey("activeCaipAddress",e=>{this.caipAddress=e}),d.U.subscribeKey("balance",e=>this.balanceVal=e),d.U.subscribeKey("balanceSymbol",e=>this.balanceSymbol=e),d.U.subscribeKey("profileName",e=>this.profileName=e),d.U.subscribeKey("profileImage",e=>this.profileImage=e),s.W.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=c.$.getNetworkImage(e),this.isSupported=!e?.chainNamespace||s.W.checkIfSupportedNetwork(e?.chainNamespace),this.fetchNetworkImage(e)}))}updated(){this.fetchNetworkImage(this.network)}
807disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!s.W.state.activeChain)return null;let e="show"===this.balance,t="string"!=typeof this.balanceVal;return(0,o.qy)` 808 <wui-account-button 809 .disabled=${!!this.disabled} 810 .isUnsupportedChain=${!n.H.state.allowUnsupportedChain&&!this.isSupported} 811 address=${(0,r.J)(u.w.getPlainAddress(this.caipAddress))} 812 profileName=${(0,r.J)(this.profileName)} 813 networkSrc=${(0,r.J)(this.networkImage)} 814 avatarSrc=${(0,r.J)(this.profileImage)} 815 balance=${e?u.w.formatBalance(this.balanceVal,this.balanceSymbol):""} 816 @click=${this.onClick.bind(this)} 817 data-testid=${`account-button${this.namespace?`-${this.namespace}`:""}`} 818 .charsStart=${this.charsStart} 819 .charsEnd=${this.charsEnd} 820 ?loading=${t} 821 > 822 </wui-account-button> 823 `}onClick(){this.isSupported||n.H.state.allowUnsupportedChain?p.W.open({namespace:this.namespace}):p.W.open({view:"UnsupportedChain"})}async fetchNetworkImage(e){e?.assets?.imageId&&(this.networkImage=await c.$.fetchNetworkImage(e?.assets?.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=c.$.getNetworkImage(e.caipNetwork))}}y([(0,a.MZ)({type:Boolean})],x.prototype,"disabled",void 0),y([(0,a.MZ)()],x.prototype,"balance",void 0),y([(0,a.MZ)()],x.prototype,"charsStart",void 0),y([(0,a.MZ)()],x.prototype,"charsEnd",void 0),y([(0,a.MZ)()],x.prototype,"namespace",void 0),y([(0,a.wk)()],x.prototype,"caipAddress",void 0),y([(0,a.wk)()],x.prototype,"balanceVal",void 0),y([(0,a.wk)()],x.prototype,"balanceSymbol",void 0),y([(0,a.wk)()],x.prototype,"profileName",void 0),y([(0,a.wk)()],x.prototype,"profileImage",void 0),y([(0,a.wk)()],x.prototype,"network",void 0),y([(0,a.wk)()],x.prototype,"networkImage",void 0),y([(0,a.wk)()],x.prototype,"isSupported",void 0);let k=class extends x{};k=y([(0,h.EM)("w3m-account-button")],k);let C=class extends x{};C=y([(0,h.EM)("appkit-account-button")],C);let $=(0,o.AH)` 824 :host { 825 display: block; 826 width: max-content; 827 } 828`;var S=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class I extends o.WF{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}connectedCallback(){super.connectedCallback(),this.caipAddress=this.namespace?s.W.state.chains.get(this.namespace)?.accountState?.caipAddress:s.W.state.activeCaipAddress}firstUpdated(){this.namespace?this.unsubscribe.push(s.W.subscribeChainProp("accountState",e=>{this.caipAddress=e?.caipAddress},this.namespace)):this.unsubscribe.push(s.W.subscribeKey("activeCaipAddress",e=>this.caipAddress=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.caipAddress?(0,o.qy)` 829 <appkit-account-button 830 .disabled=${!!this.disabled} 831 balance=${(0,r.J)(this.balance)} 832 .charsStart=${(0,r.J)(this.charsStart)} 833 .charsEnd=${(0,r.J)(this.charsEnd)} 834 namespace=${(0,r.J)(this.namespace)} 835 > 836 </appkit-account-button> 837 `:(0,o.qy)` 838 <appkit-connect-button 839 size=${(0,r.J)(this.size)} 840 label=${(0,r.J)(this.label)} 841 loadingLabel=${(0,r.J)(this.loadingLabel)} 842 namespace=${(0,r.J)(this.namespace)} 843 ></appkit-connect-button> 844 `}}I.styles=$,S([(0,a.MZ)({type:Boolean})],I.prototype,"disabled",void 0),S([(0,a.MZ)()],I.prototype,"balance",void 0),S([(0,a.MZ)()],I.prototype,"size",void 0),S([(0,a.MZ)()],I.prototype,"label",void 0),S([(0,a.MZ)()],I.prototype,"loadingLabel",void 0),S([(0,a.MZ)()],I.prototype,"charsStart",void 0),S([(0,a.MZ)()],I.prototype,"charsEnd",void 0),S([(0,a.MZ)()],I.prototype,"namespace",void 0),S([(0,a.wk)()],I.prototype,"caipAddress",void 0);let A=class extends I{};A=S([(0,h.EM)("w3m-button")],A);let E=class extends I{};E=S([(0,h.EM)("appkit-button")],E);let T=(0,o.AH)` 845 :host { 846 position: relative; 847 display: block; 848 } 849 850 button { 851 background: var(--wui-color-accent-100); 852 border: 1px solid var(--wui-color-gray-glass-010); 853 border-radius: var(--wui-border-radius-m); 854 gap: var(--wui-spacing-xs); 855 } 856 857 button.loading { 858 background: var(--wui-color-gray-glass-010); 859 border: 1px solid var(--wui-color-gray-glass-010); 860 pointer-events: none; 861 } 862 863 button:disabled { 864 background-color: var(--wui-color-gray-glass-015); 865 border: 1px solid var(--wui-color-gray-glass-010); 866 } 867 868 button:disabled > wui-text { 869 color: var(--wui-color-gray-glass-015); 870 } 871 872 @media (hover: hover) and (pointer: fine) { 873 button:hover:enabled { 874 background-color: var(--wui-color-accent-090); 875 } 876 877 button:active:enabled { 878 background-color: var(--wui-color-accent-080); 879 } 880 } 881 882 button:focus-visible { 883 border: 1px solid var(--wui-color-gray-glass-010); 884 background-color: var(--wui-color-accent-090);
885 -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); 886 -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); 887 box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); 888 } 889 890 button[data-size='sm'] { 891 padding: 6.75px 10px 7.25px; 892 } 893 894 ::slotted(*) { 895 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 896 will-change: opacity; 897 opacity: var(--local-opacity-100); 898 } 899 900 button > wui-text { 901 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 902 will-change: opacity; 903 opacity: var(--local-opacity-100); 904 color: var(--wui-color-inverse-100); 905 } 906 907 button[data-size='md'] { 908 padding: 9px var(--wui-spacing-l) 9px var(--wui-spacing-l); 909 } 910 911 button[data-size='md'] + wui-text { 912 padding-left: var(--wui-spacing-3xs); 913 } 914 915 @media (max-width: 500px) { 916 button[data-size='md'] { 917 height: 32px; 918 padding: 5px 12px; 919 } 920 921 button[data-size='md'] > wui-text > slot { 922 font-size: 14px !important; 923 } 924 } 925 926 wui-loading-spinner { 927 width: 14px; 928 height: 14px; 929 } 930 931 wui-loading-spinner::slotted(svg) { 932 width: 10px !important; 933 height: 10px !important; 934 } 935 936 button[data-size='sm'] > wui-loading-spinner { 937 width: 12px; 938 height: 12px; 939 } 940`;var R=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let W=class extends o.WF{constructor(){super(...arguments),this.size="md",this.loading=!1}render(){let e="md"===this.size?"paragraph-600":"small-600";return(0,o.qy)` 941 <button data-size=${this.size} ?disabled=${this.loading}> 942 ${this.loadingTemplate()} 943 <wui-text variant=${e} color=${this.loading?"accent-100":"inherit"}> 944 <slot></slot> 945 </wui-text> 946 </button> 947 `}loadingTemplate(){return this.loading?(0,o.qy)`<wui-loading-spinner size=${this.size} color="accent-100"></wui-loading-spinner>`:null}};W.styles=[w.W5,w.fD,T],R([(0,a.MZ)()],W.prototype,"size",void 0),R([(0,a.MZ)({type:Boolean})],W.prototype,"loading",void 0),W=R([(0,b.E)("wui-connect-button")],W);var O=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class N extends o.WF{constructor(){super(),this.unsubscribe=[],this.size="md",this.label="Connect Wallet",this.loadingLabel="Connecting...",this.open=p.W.state.open,this.loading=this.namespace?p.W.state.loadingNamespaceMap.get(this.namespace):p.W.state.loading,this.unsubscribe.push(p.W.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(0,o.qy)` 948 <wui-connect-button 949 size=${(0,r.J)(this.size)} 950 .loading=${this.loading} 951 @click=${this.onClick.bind(this)} 952 data-testid=${`connect-button${this.namespace?`-${this.namespace}`:""}`} 953 > 954 ${this.loading?this.loadingLabel:this.label} 955 </wui-connect-button> 956 `}onClick(){this.open?p.W.close():this.loading||p.W.open({view:"Connect",namespace:this.namespace})}}O([(0,a.MZ)()],N.prototype,"size",void 0),O([(0,a.MZ)()],N.prototype,"label",void 0),O([(0,a.MZ)()],N.prototype,"loadingLabel",void 0),O([(0,a.MZ)()],N.prototype,"namespace",void 0),O([(0,a.wk)()],N.prototype,"open",void 0),O([(0,a.wk)()],N.prototype,"loading",void 0);let M=class extends N{};M=O([(0,h.EM)("w3m-connect-button")],M);let P=class extends N{};P=O([(0,h.EM)("appkit-connect-button")],P);var j=i(32836);let q=(0,o.AH)` 957 :host { 958 display: block; 959 } 960 961 button { 962 border-radius: var(--wui-border-radius-3xl); 963 display: flex; 964 gap: var(--wui-spacing-xs); 965 padding: var(--wui-spacing-2xs) var(--wui-spacing-s) var(--wui-spacing-2xs) 966 var(--wui-spacing-xs); 967 border: 1px solid var(--wui-color-gray-glass-010); 968 background-color: var(--wui-color-gray-glass-005); 969 color: var(--wui-color-fg-100); 970 } 971 972 button:disabled { 973 border: 1px solid var(--wui-color-gray-glass-005); 974 background-color: var(--wui-color-gray-glass-015); 975 color: var(--wui-color-gray-glass-015); 976 } 977 978 @media (hover: hover) and (pointer: fine) { 979 button:hover:enabled { 980 background-color: var(--wui-color-gray-glass-010); 981 } 982 983 button:active:enabled { 984 background-color: var(--wui-color-gray-glass-015); 985 } 986 } 987 988 wui-image, 989 wui-icon-box { 990 border-radius: var(--wui-border-radius-3xl); 991 width: 24px; 992 height: 24px; 993 box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); 994 } 995`;var D=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let U=class extends o.WF{constructor(){super(...arguments),this.imageSrc=void 0,this.isUnsupportedChain=void 0,this.disabled=!1}render(){return(0,o.qy)` 996 <button data-testid="wui-network-button" ?disabled=${this.disabled}> 997 ${this.visualTemplate()} 998 <wui-text variant="paragraph-600" color="inherit"> 999 <slot></slot> 1000 </wui-text> 1001 </button> 1002 `}visualTemplate(){return this.isUnsupportedChain?(0,o.qy)` 1003 <wui-icon-box 1004 size="sm" 1005 iconColor="error-100" 1006 backgroundColor="error-100" 1007 icon="warningCircle" 1008 ></wui-icon-box> 1009 `:this.imageSrc?(0,o.qy)`<wui-image src=${this.imageSrc}></wui-image>`:(0,o.qy)` 1010 <wui-icon-box 1011 size="sm" 1012 iconColor="inverse-100" 1013 backgroundColor="fg-100" 1014 icon="networkPlaceholder" 1015 ></wui-icon-box> 1016 `}};U.styles=[w.W5,w.fD,q],D([(0,a.MZ)()],U.prototype,"imageSrc",void 0),D([(0,a.MZ)({type:Boolean})],U.prototype,"isUnsupportedChain",void 0),D([(0,a.MZ)({type:Boolean})],U.prototype,"disabled",void 0),U=D([(0,b.E)("wui-network-button")],U);let L=(0,o.AH)` 1017 :host { 1018 display: block; 1019 width: max-content; 1020 } 1021`;var z=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Z extends o.WF{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.network=s.W.state.activeCaipNetwork,this.networkImage=c.$.getNetworkImage(this.network),this.caipAddress=s.W.state.activeCaipAddress,this.loading=p.W.state.loading,this.isSupported=!!n.H.state.allowUnsupportedChain||!s.W.state.activeChain||s.W.checkIfSupportedNetwork(s.W.state.activeChain),this.unsubscribe.push(l.j.subscribeNetworkImages(()=>{this.networkImage=c.$.getNetworkImage(this.network)}),s.W.subscribeKey("activeCaipAddress",e=>{this.caipAddress=e}),s.W.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=c.$.getNetworkImage(e),this.isSupported=!e?.chainNamespace||s.W.checkIfSupportedNetwork(e.chainNamespace),c.$.fetchNetworkImage(e?.assets?.imageId)}),p.W.subscribeKey("loading",e=>this.loading=e))}firstUpdated(){c.$.fetchNetworkImage(this.network?.assets?.imageId)}
1021disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=!this.network||s.W.checkIfSupportedNetwork(this.network.chainNamespace);return(0,o.qy)` 1022 <wui-network-button 1023 .disabled=${!!(this.disabled||this.loading)} 1024 .isUnsupportedChain=${!n.H.state.allowUnsupportedChain&&!e} 1025 imageSrc=${(0,r.J)(this.networkImage)} 1026 @click=${this.onClick.bind(this)} 1027 data-testid="w3m-network-button" 1028 > 1029 ${this.getLabel()} 1030 <slot></slot> 1031 </wui-network-button> 1032 `}getLabel(){return this.network?this.isSupported||n.H.state.allowUnsupportedChain?this.network.name:"Switch Network":this.label?this.label:this.caipAddress?"Unknown Network":"Select Network"}onClick(){this.loading||(j.E.sendEvent({type:"track",event:"CLICK_NETWORKS"}),p.W.open({view:"Networks"}))}}Z.styles=L,z([(0,a.MZ)({type:Boolean})],Z.prototype,"disabled",void 0),z([(0,a.MZ)({type:String})],Z.prototype,"label",void 0),z([(0,a.wk)()],Z.prototype,"network",void 0),z([(0,a.wk)()],Z.prototype,"networkImage",void 0),z([(0,a.wk)()],Z.prototype,"caipAddress",void 0),z([(0,a.wk)()],Z.prototype,"loading",void 0),z([(0,a.wk)()],Z.prototype,"isSupported",void 0);let B=class extends Z{};B=z([(0,h.EM)("w3m-network-button")],B);let F=class extends Z{};F=z([(0,h.EM)("appkit-network-button")],F);var H=i(51994),_=i(60500),V=i(54252),J=i(76610),K=i(5517),G=i(19628),Y=i(6193),X=i(68319);i(98160),i(76197),i(546),i(23499),i(15127);let Q=(0,o.AH)` 1033 :host { 1034 display: block; 1035 } 1036 1037 button { 1038 width: 100%; 1039 display: block; 1040 padding-top: var(--wui-spacing-l); 1041 padding-bottom: var(--wui-spacing-l); 1042 padding-left: var(--wui-spacing-s); 1043 padding-right: var(--wui-spacing-2l); 1044 border-radius: var(--wui-border-radius-s); 1045 background-color: var(--wui-color-accent-glass-010); 1046 } 1047 1048 button:hover { 1049 background-color: var(--wui-color-accent-glass-015) !important; 1050 } 1051 1052 button:active { 1053 background-color: var(--wui-color-accent-glass-020) !important; 1054 } 1055`;var ee=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let et=class extends o.WF{constructor(){super(...arguments),this.label="",this.description="",this.icon="wallet"}render(){return(0,o.qy)` 1056 <button> 1057 <wui-flex gap="m" alignItems="center" justifyContent="space-between"> 1058 <wui-icon-box 1059 size="lg" 1060 iconcolor="accent-100" 1061 backgroundcolor="accent-100" 1062 icon=${this.icon} 1063 background="transparent" 1064 ></wui-icon-box> 1065 1066 <wui-flex flexDirection="column" gap="3xs"> 1067 <wui-text variant="paragraph-500" color="fg-100">${this.label}</wui-text> 1068 <wui-text variant="small-400" color="fg-200">${this.description}</wui-text> 1069 </wui-flex> 1070 1071 <wui-icon size="md" color="fg-200" name="chevronRight"></wui-icon> 1072 </wui-flex> 1073 </button> 1074 `}};et.styles=[w.W5,w.fD,Q],ee([(0,a.MZ)()],et.prototype,"label",void 0),ee([(0,a.MZ)()],et.prototype,"description",void 0),ee([(0,a.MZ)()],et.prototype,"icon",void 0),et=ee([(0,b.E)("wui-notice-card")],et),i(22724);var ei=i(45312),eo=i(5582),ea=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let er=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.socialProvider=eo.i.getConnectedSocialProvider(),this.socialUsername=eo.i.getConnectedSocialUsername(),this.namespace=s.W.state.activeChain,this.unsubscribe.push(s.W.subscribeKey("activeChain",e=>{this.namespace=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=V.a.getConnectorId(this.namespace),t=V.a.getAuthConnector();if(!t||e!==_.o.CONNECTOR_ID.AUTH)return this.style.cssText="display: none",null;let i=t.provider.getEmail()??"";return i||this.socialUsername?(0,o.qy)` 1075 <wui-list-item 1076 variant="icon" 1077 iconVariant="overlay" 1078 icon=${this.socialProvider??"mail"} 1079 iconSize=${this.socialProvider?"xxl":"sm"} 1080 data-testid="w3m-account-email-update" 1081 ?chevron=${!this.socialProvider} 1082 @click=${()=>{this.onGoToUpdateEmail(i,this.socialProvider)}} 1083 > 1084 <wui-text variant="paragraph-500" color="fg-100">${this.getAuthName(i)}</wui-text> 1085 </wui-list-item> 1086 `:(this.style.cssText="display: none",null)}onGoToUpdateEmail(e,t){t||G.I.push("UpdateEmailWallet",{email:e,redirectView:"Account"})}getAuthName(e){return this.socialUsername?"discord"===this.socialProvider&&this.socialUsername.endsWith("0")?this.socialUsername.slice(0,-1):this.socialUsername:e.length>30?`${e.slice(0,-3)}...`:e}};ea([(0,a.wk)()],er.prototype,"namespace",void 0),er=ea([(0,h.EM)("w3m-account-auth-button")],er);var en=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let es=class extends o.WF{constructor(){super(),this.usubscribe=[],this.networkImages=l.j.state.networkImages,this.address=d.U.state.address,this.profileImage=d.U.state.profileImage,this.profileName=d.U.state.profileName,this.network=s.W.state.activeCaipNetwork,this.preferredAccountTypes=d.U.state.preferredAccountTypes,this.disconnecting=!1,this.loading=!1,this.switched=!1,this.text="",this.usubscribe.push(d.U.subscribe(e=>{e.address&&(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.preferredAccountTypes=e.preferredAccountTypes)}),d.U.subscribeKey("preferredAccountTypes",e=>this.preferredAccountTypes=e),s.W.subscribeKey("activeCaipNetwork",e=>{e?.id&&(this.network=e)}))}
1086disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){if(!this.address)throw Error("w3m-account-settings-view: No account provided");let e=this.networkImages[this.network?.assets?.imageId??""];return(0,o.qy)` 1087 <wui-flex 1088 flexDirection="column" 1089 alignItems="center" 1090 gap="l" 1091 .padding=${["0","xl","m","xl"]} 1092 > 1093 <wui-avatar 1094 alt=${this.address} 1095 address=${this.address} 1096 imageSrc=${(0,r.J)(this.profileImage)} 1097 size="2lg" 1098 ></wui-avatar> 1099 <wui-flex flexDirection="column" alignItems="center"> 1100 <wui-flex gap="3xs" alignItems="center" justifyContent="center"> 1101 <wui-text variant="title-6-600" color="fg-100" data-testid="account-settings-address"> 1102 ${h.Zv.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})} 1103 </wui-text> 1104 <wui-icon-link 1105 size="md" 1106 icon="copy" 1107 iconColor="fg-200" 1108 @click=${this.onCopyAddress} 1109 ></wui-icon-link> 1110 </wui-flex> 1111 </wui-flex> 1112 </wui-flex> 1113 <wui-flex flexDirection="column" gap="m"> 1114 <wui-flex flexDirection="column" gap="xs" .padding=${["0","l","m","l"]}> 1115 ${this.authCardTemplate()} 1116 <w3m-account-auth-button></w3m-account-auth-button> 1117 <wui-list-item 1118 .variant=${e?"image":"icon"} 1119 iconVariant="overlay" 1120 icon="networkPlaceholder" 1121 imageSrc=${(0,r.J)(e)} 1122 ?chevron=${this.isAllowedNetworkSwitch()} 1123 @click=${this.onNetworks.bind(this)} 1124 data-testid="account-switch-network-button" 1125 > 1126 <wui-text variant="paragraph-500" color="fg-100"> 1127 ${this.network?.name??"Unknown"} 1128 </wui-text> 1129 </wui-list-item> 1130 ${this.togglePreferredAccountBtnTemplate()} ${this.chooseNameButtonTemplate()} 1131 <wui-list-item 1132 variant="icon" 1133 iconVariant="overlay" 1134 icon="disconnect" 1135 ?chevron=${!1} 1136 .loading=${this.disconnecting} 1137 @click=${this.onDisconnect.bind(this)} 1138 data-testid="disconnect-button" 1139 > 1140 <wui-text variant="paragraph-500" color="fg-200">Disconnect</wui-text> 1141 </wui-list-item> 1142 </wui-flex> 1143 </wui-flex> 1144 `}chooseNameButtonTemplate(){let e=this.network?.chainNamespace,t=V.a.getConnectorId(e),i=V.a.getAuthConnector();return s.W.checkIfNamesSupported()&&i&&t===_.o.CONNECTOR_ID.AUTH&&!this.profileName?(0,o.qy)` 1145 <wui-list-item 1146 variant="icon" 1147 iconVariant="overlay" 1148 icon="id" 1149 iconSize="sm" 1150 ?chevron=${!0} 1151 @click=${this.onChooseName.bind(this)} 1152 data-testid="account-choose-name-button" 1153 > 1154 <wui-text variant="paragraph-500" color="fg-100">Choose account name </wui-text> 1155 </wui-list-item> 1156 `:null}authCardTemplate(){let e=this.network?.chainNamespace,t=V.a.getConnectorId(e),i=V.a.getAuthConnector(),{origin:a}=location;return!i||t!==_.o.CONNECTOR_ID.AUTH||a.includes(J.oU.SECURE_SITE)?null:(0,o.qy)` 1157 <wui-notice-card 1158 @click=${this.onGoToUpgradeView.bind(this)} 1159 label="Upgrade your wallet" 1160 description="Transition to a self-custodial wallet" 1161 icon="wallet" 1162 data-testid="w3m-wallet-upgrade-card" 1163 ></wui-notice-card> 1164 `}isAllowedNetworkSwitch(){let e=s.W.getAllRequestedCaipNetworks(),t=!!e&&e.length>1,i=e?.find(({id:e})=>e===this.network?.id);return t||!i}onCopyAddress(){try{this.address&&(u.w.copyToClopboard(this.address),K.P.showSuccess("Address copied"))}catch{K.P.showError("Failed to copy")}}togglePreferredAccountBtnTemplate(){let e=this.network?.chainNamespace,t=s.W.checkIfSmartAccountEnabled(),i=V.a.getConnectorId(e);return V.a.getAuthConnector()&&i===_.o.CONNECTOR_ID.AUTH&&t?(this.switched||(this.text=this.preferredAccountTypes?.[e]===ei.Vl.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account"),(0,o.qy)` 1165 <wui-list-item 1166 variant="icon" 1167 iconVariant="overlay" 1168 icon="swapHorizontalBold" 1169 iconSize="sm" 1170 ?chevron=${!0} 1171 ?loading=${this.loading} 1172 @click=${this.changePreferredAccountType.bind(this)} 1173 data-testid="account-toggle-preferred-account-type" 1174 > 1175 <wui-text variant="paragraph-500" color="fg-100">${this.text}</wui-text> 1176 </wui-list-item> 1177 `):null}onChooseName(){G.I.push("ChooseAccountName")}async changePreferredAccountType(){let e=this.network?.chainNamespace,t=s.W.checkIfSmartAccountEnabled(),i=this.preferredAccountTypes?.[e]!==ei.Vl.ACCOUNT_TYPES.SMART_ACCOUNT&&t?ei.Vl.ACCOUNT_TYPES.SMART_ACCOUNT:ei.Vl.ACCOUNT_TYPES.EOA;V.a.getAuthConnector()&&(this.loading=!0,await Y.x.setPreferredAccountType(i,e),this.text=i===ei.Vl.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account",this.switched=!0,X.R.resetSend(),this.loading=!1,this.requestUpdate())}onNetworks(){this.isAllowedNetworkSwitch()&&G.I.push("Networks")}async onDisconnect(){try{this.disconnecting=!0,await Y.x.disconnect(),p.W.close()}catch{j.E.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),K.P.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onGoToUpgradeView(){j.E.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),G.I.push("UpgradeEmailWallet")}};en([(0,a.wk)()],es.prototype,"address",void 0),en([(0,a.wk)()],es.prototype,"profileImage",void 0),en([(0,a.wk)()],es.prototype,"profileName",void 0),en([(0,a.wk)()],es.prototype,"network",void 0),en([(0,a.wk)()],es.prototype,"preferredAccountTypes",void 0),en([(0,a.wk)()],es.prototype,"disconnecting",void 0),en([(0,a.wk)()],es.prototype,"loading",void 0),en([(0,a.wk)()],es.prototype,"switched",void 0),en([(0,a.wk)()],es.prototype,"text",void 0),es=en([(0,h.EM)("w3m-account-settings-view")],es),i(54279),i(21330);let el=(0,o.AH)` 1178 button { 1179 background-color: var(--wui-color-gray-glass-002); 1180 border-radius: var(--wui-border-radius-3xl); 1181 border: 1px solid var(--wui-color-gray-glass-002); 1182 padding: var(--wui-spacing-xs) var(--wui-spacing-s) var(--wui-spacing-xs) var(--wui-spacing-xs); 1183 position: relative; 1184 } 1185 1186 wui-avatar { 1187 width: 32px; 1188 height: 32px; 1189 box-shadow: 0 0 0 0; 1190 outline: 3px solid var(--wui-color-gray-glass-005); 1191 } 1192 1193 wui-icon-box, 1194 wui-image { 1195 width: 16px; 1196 height: 16px; 1197 border-radius: var(--wui-border-radius-3xl); 1198 position: absolute; 1199 left: 26px; 1200 top: 24px; 1201 } 1202 1203 wui-image { 1204 outline: 2px solid var(--wui-color-bg-125); 1205 } 1206 1207 wui-icon-box { 1208 outline: 2px solid var(--wui-color-bg-200); 1209 background-color: var(--wui-color-bg-250); 1210 } 1211`;var ec=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let ed=class extends o.WF{constructor(){super(...arguments),this.avatarSrc=void 0,this.profileName="",this.address="",this.icon="mail"}render(){let e=s.W.state.activeChain,t=V.a.getConnectorId(e)===_.o.CONNECTOR_ID.AUTH;return(0,o.qy)`<button data-testid="wui-profile-button" @click=${this.handleClick}> 1212 <wui-flex gap="xs" alignItems="center"> 1213 <wui-avatar 1214 .imageSrc=${this.avatarSrc} 1215 alt=${this.address} 1216 address=${this.address} 1217 ></wui-avatar> 1218 ${t?this.getIconTemplate(this.icon):""} 1219 <wui-flex gap="xs" alignItems="center"> 1220 <wui-text variant="large-600" color="fg-100"> 1221 ${g.Z.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:4,charsEnd:4*!this.profileName,truncate:this.profileName?"end":"middle"})} 1222 </wui-text> 1223 <wui-icon size="sm" color="fg-200" name="copy" id="copy-address"></wui-icon> 1224 </wui-flex> 1225 </wui-flex> 1226 </button>`}handleClick(e){if(e.target instanceof HTMLElement&&"copy-address"===e.target.id)return void this.onCopyClick?.(e);this.onProfileClick?.(e)}getIconTemplate(e){return(0,o.qy)` 1227 <wui-icon-box 1228 size="xxs" 1229 iconColor="fg-200" 1230 backgroundColor="bg-100" 1231 icon="${e||"networkPlaceholder"}" 1232 ></wui-icon-box> 1233 `}};ed.styles=[w.W5,w.fD,el],ec([(0,a.MZ)()],ed.prototype,"avatarSrc",void 0),ec([(0,a.MZ)()],ed.prototype,"profileName",void 0),ec([(0,a.MZ)()],ed.prototype,"address",void 0),ec([(0,a.MZ)()],ed.prototype,"icon",void 0),ec([(0,a.MZ)()],ed.prototype,"onProfileClick",void 0),ec([(0,a.MZ)()],ed.prototype,"onCopyClick",void 0),ed=ec([(0,b.E)("wui-profile-button-v2")],ed);let eu=(0,o.AH)` 1234 :host { 1235 display: inline-flex; 1236 background-color: var(--wui-color-gray-glass-002); 1237 border-radius: var(--wui-border-radius-3xl); 1238 padding: var(--wui-spacing-3xs); 1239 position: relative; 1240 height: 36px; 1241 min-height: 36px; 1242 overflow: hidden; 1243 } 1244 1245 :host::before { 1246 content: ''; 1247 position: absolute; 1248 pointer-events: none; 1249 top: 4px; 1250 left: 4px; 1251 display: block; 1252 width: var(--local-tab-width); 1253 height: 28px; 1254 border-radius: var(--wui-border-radius-3xl); 1255 background-color: var(--wui-color-gray-glass-002); 1256 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); 1257 transform: translateX(calc(var(--local-tab) * var(--local-tab-width))); 1258 transition: transform var(--wui-ease-out-power-1) var(--wui-duration-md); 1259 will-change: background-color, opacity; 1260 } 1261 1262 :host([data-type='flex'])::before { 1263 left: 3px; 1264 transform: translateX(calc((var(--local-tab) * 34px) + (var(--local-tab) * 4px))); 1265 } 1266 1267 :host([data-type='flex']) { 1268 display: flex; 1269 padding: 0px 0px 0px 12px; 1270 gap: 4px; 1271 } 1272 1273 :host([data-type='flex']) > button > wui-text { 1274 position: absolute; 1275 left: 18px; 1276 opacity: 0; 1277 } 1278 1279 button[data-active='true'] > wui-icon, 1280 button[data-active='true'] > wui-text { 1281 color: var(--wui-color-fg-100); 1282 } 1283 1284 button[data-active='false'] > wui-icon, 1285 button[data-active='false'] > wui-text { 1286 color: var(--wui-color-fg-200); 1287 } 1288 1289 button[data-active='true']:disabled, 1290 button[data-active='false']:disabled { 1291 background-color: transparent; 1292 opacity: 0.5;
1293 cursor: not-allowed; 1294 } 1295 1296 button[data-active='true']:disabled > wui-text { 1297 color: var(--wui-color-fg-200); 1298 } 1299 1300 button[data-active='false']:disabled > wui-text { 1301 color: var(--wui-color-fg-300); 1302 } 1303 1304 button > wui-icon, 1305 button > wui-text { 1306 pointer-events: none; 1307 transition: color var(--wui-e ase-out-power-1) var(--wui-duration-md); 1308 will-change: color; 1309 } 1310 1311 button { 1312 width: var(--local-tab-width); 1313 transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); 1314 will-change: background-color; 1315 } 1316 1317 :host([data-type='flex']) > button { 1318 width: 34px; 1319 position: relative; 1320 display: flex; 1321 justify-content: flex-start; 1322 } 1323 1324 button:hover:enabled, 1325 button:active:enabled { 1326 background-color: transparent !important; 1327 } 1328 1329 button:hover:enabled > wui-icon, 1330 button:active:enabled > wui-icon { 1331 transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg); 1332 color: var(--wui-color-fg-125); 1333 } 1334 1335 button:hover:enabled > wui-text, 1336 button:active:enabled > wui-text { 1337 transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg); 1338 color: var(--wui-color-fg-125); 1339 } 1340 1341 button { 1342 border-radius: var(--wui-border-radius-3xl); 1343 } 1344`;var ep=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let eh=class extends o.WF{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.buttons=[],this.disabled=!1,this.localTabWidth="100px",this.activeTab=0,this.isDense=!1}render(){return this.isDense=this.tabs.length>3,this.style.cssText=` 1345 --local-tab: ${this.activeTab}; 1346 --local-tab-width: ${this.localTabWidth}; 1347 `,this.dataset.type=this.isDense?"flex":"block",this.tabs.map((e,t)=>{let i=t===this.activeTab;return(0,o.qy)` 1348 <button 1349 ?disabled=${this.disabled} 1350 @click=${()=>this.onTabClick(t)} 1351 data-active=${i} 1352 data-testid="tab-${e.label?.toLowerCase()}" 1353 > 1354 ${this.iconTemplate(e)} 1355 <wui-text variant="small-600" color="inherit"> ${e.label} </wui-text> 1356 </button> 1357 `})}firstUpdated(){this.shadowRoot&&this.isDense&&(this.buttons=[...this.shadowRoot.querySelectorAll("button")],setTimeout(()=>{this.animateTabs(0,!0)},0))}iconTemplate(e){return e.icon?(0,o.qy)`<wui-icon size="xs" color="inherit" name=${e.icon}></wui-icon>`:null}onTabClick(e){this.buttons&&this.animateTabs(e,!1),this.activeTab=e,this.onTabChange(e)}animateTabs(e,t){let i=this.buttons[this.activeTab],o=this.buttons[e],a=i?.querySelector("wui-text"),r=o?.querySelector("wui-text"),n=o?.getBoundingClientRect(),s=r?.getBoundingClientRect();i&&a&&!t&&e!==this.activeTab&&(a.animate([{opacity:0}],{duration:50,easing:"ease",fill:"forwards"}),i.animate([{width:"34px"}],{duration:500,easing:"ease",fill:"forwards"})),o&&n&&s&&r&&(e!==this.activeTab||t)&&(this.localTabWidth=`${Math.round(n.width+s.width)+6}px`,o.animate([{width:`${n.width+s.width}px`}],{duration:500*!t,fill:"forwards",easing:"ease"}),r.animate([{opacity:1}],{duration:125*!t,delay:200*!t,fill:"forwards",easing:"ease"}))}};eh.styles=[w.W5,w.fD,eu],ep([(0,a.MZ)({type:Array})],eh.prototype,"tabs",void 0),ep([(0,a.MZ)()],eh.prototype,"onTabChange",void 0),ep([(0,a.MZ)({type:Array})],eh.prototype,"buttons",void 0),ep([(0,a.MZ)({type:Boolean})],eh.prototype,"disabled",void 0),ep([(0,a.MZ)()],eh.prototype,"localTabWidth",void 0),ep([(0,a.wk)()],eh.prototype,"activeTab",void 0),ep([(0,a.wk)()],eh.prototype,"isDense",void 0),eh=ep([(0,b.E)("wui-tabs")],eh),i(77509);let ew=(0,o.AH)` 1358 wui-flex { 1359 width: 100%; 1360 } 1361 1362 :host > wui-flex:first-child { 1363 transform: translateY(calc(var(--wui-spacing-xxs) * -1)); 1364 } 1365 1366 wui-icon-link { 1367 margin-right: calc(var(--wui-icon-box-size-md) * -1); 1368 } 1369 1370 wui-notice-card { 1371 margin-bottom: var(--wui-spacing-3xs); 1372 } 1373 1374 wui-list-item > wui-text { 1375 flex: 1; 1376 } 1377 1378 w3m-transactions-view { 1379 max-height: 200px; 1380 } 1381 1382 .tab-content-container { 1383 height: 300px; 1384 overflow-y: auto; 1385 overflow-x: hidden; 1386 scrollbar-width: none; 1387 } 1388 1389 .tab-content-container::-webkit-scrollbar {
1390 display: none; 1391 } 1392 1393 .account-button { 1394 width: auto; 1395 border: none; 1396 display: flex; 1397 align-items: center; 1398 justify-content: center; 1399 gap: var(--wui-spacing-s); 1400 height: 48px; 1401 padding: var(--wui-spacing-xs); 1402 padding-right: var(--wui-spacing-s); 1403 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); 1404 background-color: var(--wui-color-gray-glass-002); 1405 border-radius: 24px; 1406 transition: background-color 0.2s linear; 1407 } 1408 1409 .account-button:hover { 1410 background-color: var(--wui-color-gray-glass-005); 1411 } 1412 1413 .avatar-container { 1414 position: relative; 1415 } 1416 1417 wui-avatar.avatar { 1418 width: 32px; 1419 height: 32px; 1420 box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); 1421 } 1422 1423 wui-avatar.network-avatar { 1424 width: 16px; 1425 height: 16px; 1426 position: absolute; 1427 left: 100%; 1428 top: 100%; 1429 transform: translate(-75%, -75%); 1430 box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); 1431 } 1432 1433 .account-links { 1434 display: flex; 1435 justify-content: space-between; 1436 align-items: center; 1437 } 1438 1439 .account-links wui-flex { 1440 cursor: pointer; 1441 display: flex; 1442 align-items: center; 1443 justify-content: center; 1444 flex: 1; 1445 background: red; 1446 align-items: center; 1447 justify-content: center; 1448 height: 48px; 1449 padding: 10px; 1450 flex: 1 0 0; 1451 border-radius: var(--XS, 16px); 1452 border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); 1453 background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); 1454 transition: 1455 background-color var(--wui-ease-out-power-1) var(--wui-duration-md), 1456 opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 1457 will-change: background-color, opacity; 1458 } 1459 1460 .account-links wui-flex:hover { 1461 background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15)); 1462 } 1463 1464 .account-links wui-flex wui-icon { 1465 width: var(--S, 20px); 1466 height: var(--S, 20px); 1467 } 1468 1469 .account-links wui-flex wui-icon svg path { 1470 stroke: #667dff; 1471 } 1472`;var eg=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let eb=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.caipAddress=d.U.state.caipAddress,this.address=u.w.getPlainAddress(d.U.state.caipAddress),this.allAccounts=d.U.state.allAccounts,this.profileImage=d.U.state.profileImage,this.profileName=d.U.state.profileName,this.disconnecting=!1,this.balance=d.U.state.balance,this.balanceSymbol=d.U.state.balanceSymbol,this.features=n.H.state.features,this.remoteFeatures=n.H.state.remoteFeatures,this.namespace=s.W.state.activeChain,this.chainId=s.W.state.activeCaipNetwork?.id,this.unsubscribe.push(d.U.subscribeKey("caipAddress",e=>{this.address=u.w.getPlainAddress(e),this.caipAddress=e}),d.U.subscribeKey("balance",e=>this.balance=e),d.U.subscribeKey("balanceSymbol",e=>this.balanceSymbol=e),d.U.subscribeKey("profileName",e=>this.profileName=e),d.U.subscribeKey("profileImage",e=>this.profileImage=e),n.H.subscribeKey("features",e=>this.features=e),n.H.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e),d.U.subscribeKey("allAccounts",e=>{this.allAccounts=e}),n.H.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e),s.W.subscribeKey("activeChain",e=>this.namespace=e),s.W.subscribeKey("activeCaipNetwork",e=>{if(e){let[t,i]=e?.caipNetworkId?.split(":")||[];t&&i&&(this.namespace=t,this.chainId=i)}}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.caipAddress)return null;let e=s.W.state.activeChain!==_.o.CHAIN.SOLANA&&this.allAccounts.length>1;return(0,o.qy)`<wui-flex 1473 flexDirection="column" 1474 .padding=${["0","xl","m","xl"]} 1475 alignItems="center" 1476 gap="l" 1477 > 1478 ${e?this.multiAccountTemplate():this.singleAccountTemplate()} 1479 <wui-flex flexDirection="column" alignItems="center"> 1480 <wui-text variant="paragraph-500" color="fg-200"> 1481 ${u.w.formatBalance(this.balance,this.balanceSymbol)} 1482 </wui-text> 1483 </wui-flex> 1484 ${this.explorerBtnTemplate()} 1485 </wui-flex> 1486 1487 <wui-flex flexDirection="column" gap="xs" .padding=${["0","s","s","s"]}> 1488 ${this.authCardTemplate()} <w3m-account-auth-button></w3m-account-auth-button> 1489 ${this.orderedFeaturesTemplate()} ${this.activityTemplate()} 1490 <wui-list-item 1491 variant="icon" 1492 iconVariant="overlay" 1493 icon="disconnect" 1494 ?chevron=${!1} 1495 .loading=${this.disconnecting} 1496 @click=${this.onDisconnect.bind(this)} 1497 data-testid="disconnect-button" 1498 > 1499 <wui-text variant="paragraph-500" color="fg-200">Disconnect</wui-text> 1500 </wui-list-item> 1501 </wui-flex>`}onrampTemplate(){if(!this.namespace)return null;let e=this.remoteFeatures?.onramp,t=J.oU.ONRAMP_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace);return e&&t?(0,o.qy)` 1502 <wui-list-item 1503 data-testid="w3m-account-default-onramp-button" 1504 iconVariant="blue" 1505 icon="card" 1506 ?chevron=${!0} 1507 @click=${this.handleClickPay.bind(this)} 1508 > 1509 <wui-text variant="paragraph-500" color="fg-100">Buy crypto</wui-text> 1510 </wui-list-item> 1511 `:null}orderedFeaturesTemplate(){return(this.features?.walletFeaturesOrder||J.oU.DEFAULT_FEATURES.walletFeaturesOrder).map(e=>{switch(e){case"onramp":return this.onrampTemplate();case"swaps":return this.swapsTemplate();case"send":return this.sendTemplate();default:return null}})}activityTemplate(){return this.namespace&&this.remoteFeatures?.activity&&J.oU.ACTIVITY_ENABLED_CHAIN_NAMESPACES.includes(this.namespace)?(0,o.qy)` <wui-list-item 1512 iconVariant="blue" 1513 icon="clock" 1514 iconSize="sm" 1515 ?chevron=${!0} 1516 @click=${this.onTransactions.bind(this)} 1517 data-testid="w3m-account-default-activity-button" 1518 > 1519 <wui-text variant="paragraph-500" color="fg-100">Activity</wui-text> 1520 </wui-list-item>`:null}swapsTemplate(){let e=this.remoteFeatures?.swaps,t=s.W.state.activeChain===_.o.CHAIN.EVM;return e&&t?(0,o.qy)` 1521 <wui-list-item 1522 iconVariant="blue" 1523 icon="recycleHorizontal" 1524 ?chevron=${!0} 1525 @click=${this.handleClickSwap.bind(this)} 1526 data-testid="w3m-account-default-swaps-button" 1527 > 1528 <wui-text variant="paragraph-500" color="fg-100">Swap</wui-text> 1529 </wui-list-item> 1530 `:null}sendTemplate(){let e=this.features?.send,t=s.W.state.activeChain,i=J.oU.SEND_SUPPORTED_NAMESPACES.includes(t);return e&&i?(0,o.qy)` 1531 <wui-list-item 1532 iconVariant="blue" 1533 icon="send" 1534 ?chevron=${!0} 1535 @click=${this.handleClickSend.bind(this)} 1536 data-testid="w3m-account-default-send-button" 1537 > 1538 <wui-text variant="paragraph-500" color="fg-100">Send</wui-text> 1539 </wui-list-item> 1540 `:null}authCardTemplate(){let e=s.W.state.activeChain,t=V.a.getConnectorId(e),i=V.a.getAuthConnector(),{origin:a}=location;return!i||t!==_.o.CONNECTOR_ID.AUTH||a.includes(J.oU.SECURE_SITE)?null:(0,o.qy)` 1541 <wui-notice-card 1542 @click=${this.onGoToUpgradeView.bind(this)} 1543 label="Upgrade your wallet" 1544 description="Transition to a self-custodial wallet" 1545 icon="wallet" 1546 data-testid="w3m-wallet-upgrade-card" 1547 ></wui-notice-card> 1548 `}handleSwitchAccountsView(){G.I.push("SwitchAddress")}
1548handleClickPay(){G.I.push("OnRampProviders")}handleClickSwap(){G.I.push("Swap")}handleClickSend(){G.I.push("WalletSend")}explorerBtnTemplate(){return d.U.state.addressExplorerUrl?(0,o.qy)` 1549 <wui-button size="md" variant="neutral" @click=${this.onExplorer.bind(this)}> 1550 <wui-icon size="sm" color="inherit" slot="iconLeft" name="compass"></wui-icon> 1551 Block Explorer 1552 <wui-icon size="sm" color="inherit" slot="iconRight" name="externalLink"></wui-icon> 1553 </wui-button> 1554 `:null}singleAccountTemplate(){return(0,o.qy)` 1555 <wui-avatar 1556 alt=${(0,r.J)(this.caipAddress)} 1557 address=${(0,r.J)(u.w.getPlainAddress(this.caipAddress))} 1558 imageSrc=${(0,r.J)(null===this.profileImage?void 0:this.profileImage)} 1559 data-testid="single-account-avatar" 1560 ></wui-avatar> 1561 <wui-flex flexDirection="column" alignItems="center"> 1562 <wui-flex gap="3xs" alignItems="center" justifyContent="center"> 1563 <wui-text variant="large-600" color="fg-100"> 1564 ${this.profileName?h.Zv.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):h.Zv.getTruncateString({string:this.address||"",charsStart:4,charsEnd:4,truncate:"middle"})} 1565 </wui-text> 1566 <wui-icon-link 1567 size="md" 1568 icon="copy" 1569 iconColor="fg-200" 1570 @click=${this.onCopyAddress} 1571 ></wui-icon-link> </wui-flex 1572 ></wui-flex> 1573 `}multiAccountTemplate(){if(!this.address)throw Error("w3m-account-view: No account provided");let e=this.allAccounts.find(e=>e.address===this.address),t=d.U.state.addressLabels.get(this.address);return"bip122"===this.namespace?this.btcAccountsTemplate():(0,o.qy)` 1574 <wui-profile-button-v2 1575 .onProfileClick=${this.handleSwitchAccountsView.bind(this)} 1576 address=${(0,r.J)(this.address)} 1577 icon="${e?.type===ei.Vl.ACCOUNT_TYPES.SMART_ACCOUNT&&s.W.state.activeChain===_.o.CHAIN.EVM?"lightbulb":"mail"}" 1578 avatarSrc=${(0,r.J)(this.profileImage?this.profileImage:void 0)} 1579 profileName=${(0,r.J)(t||this.profileName)} 1580 .onCopyClick=${this.onCopyAddress.bind(this)} 1581 ></wui-profile-button-v2> 1582 `}btcAccountsTemplate(){return(0,o.qy)`<wui-flex gap="m" alignItems="center" flexDirection="column"> 1583 <wui-avatar 1584 .imageSrc=${(0,r.J)(this.profileImage?this.profileImage:void 0)} 1585 alt=${this.address} 1586 address=${this.address} 1587 ></wui-avatar> 1588 <wui-tabs 1589 .tabs=${[{label:"Payment"},{label:"Ordinals"}]} 1590 .onTabChange=${e=>d.U.setCaipAddress(`bip122:${this.chainId}:${this.allAccounts[e]?.address||""}`,this.namespace)} 1591 ></wui-tabs> 1592 <wui-flex gap="xs" alignItems="center" justifyContent="center"> 1593 <wui-text variant="large-600" color="fg-100"> 1594 ${h.Zv.getTruncateString({string:this.profileName||this.address||"",charsStart:this.profileName?18:4,charsEnd:4*!this.profileName,truncate:this.profileName?"end":"middle"})} 1595 </wui-text> 1596 <wui-icon-link 1597 size="md" 1598 icon="copy" 1599 iconColor="fg-200" 1600 @click=${this.onCopyAddress} 1601 ></wui-icon-link> 1602 </wui-flex> 1603 </wui-flex>`}onCopyAddress(){try{this.address&&(u.w.copyToClopboard(this.address),K.P.showSuccess("Address copied"))}catch{K.P.showError("Failed to copy")}}onTransactions(){let e=s.W.state.activeChain;j.E.sendEvent({type:"track",event:"CLICK_TRANSACTIONS",properties:{isSmartAccount:d.U.state.preferredAccountTypes?.[e]===ei.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),G.I.push("Transactions")}async onDisconnect(){try{this.disconnecting=!0,await Y.x.disconnect(),p.W.close()}catch{j.E.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),K.P.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onExplorer(){let e=d.U.state.addressExplorerUrl;e&&u.w.openHref(e,"_blank")}onGoToUpgradeView(){j.E.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),G.I.push("UpgradeEmailWallet")}};eb.styles=ew,eg([(0,a.wk)()],eb.prototype,"caipAddress",void 0),eg([(0,a.wk)()],eb.prototype,"address",void 0),eg([(0,a.wk)()],eb.prototype,"allAccounts",void 0),eg([(0,a.wk)()],eb.prototype,"profileImage",void 0),eg([(0,a.wk)()],eb.prototype,"profileName",void 0),eg([(0,a.wk)()],eb.prototype,"disconnecting",void 0),eg([(0,a.wk)()],eb.prototype,"balance",void 0),eg([(0,a.wk)()],eb.prototype,"balanceSymbol",void 0),eg([(0,a.wk)()],eb.prototype,"features",void 0),eg([(0,a.wk)()],eb.prototype,"remoteFeatures",void 0),eg([(0,a.wk)()],eb.prototype,"namespace",void 0),eg([(0,a.wk)()],eb.prototype,"chainId",void 0),eb=eg([(0,h.EM)("w3m-account-default-widget")],eb);let ef=(0,o.AH)` 1604 span { 1605 font-weight: 500; 1606 font-size: 40px; 1607 color: var(--wui-color-fg-100); 1608 line-height: 130%; /* 52px */ 1609 letter-spacing: -1.6px; 1610 text-align: center; 1611 } 1612 1613 .pennies { 1614 color: var(--wui-color-fg-200); 1615 } 1616`;var em=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let ev=class extends o.WF{constructor(){super(...arguments),this.dollars="0",this.pennies="00"}render(){return(0,o.qy)`<span>$${this.dollars}<span class="pennies">.${this.pennies}</span></span>`}};ev.styles=[w.W5,ef],em([(0,a.MZ)()],ev.prototype,"dollars",void 0),em([(0,a.MZ)()],ev.prototype,"pennies",void 0),ev=em([(0,b.E)("wui-balance")],ev),i(6725);let ey=(0,o.AH)` 1617 button { 1618 background-color: var(--wui-color-gray-glass-002); 1619 border-radius: var(--wui-border-radius-3xl); 1620 border: 1px solid var(--wui-color-gray-glass-002); 1621 padding: var(--wui-spacing-xs) var(--wui-spacing-s) var(--wui-spacing-xs) var(--wui-spacing-xs); 1622 position: relative; 1623 } 1624 1625 wui-avatar { 1626 width: 32px; 1627 height: 32px; 1628 box-shadow: 0 0 0 0; 1629 outline: 3px solid var(--wui-color-gray-glass-005); 1630 } 1631 1632 wui-icon-box, 1633 wui-image { 1634 width: 16px; 1635 height: 16px; 1636 border-radius: var(--wui-border-radius-3xl); 1637 position: absolute; 1638 left: 26px; 1639 top: 24px; 1640 } 1641 1642 wui-image { 1643 outline: 2px solid var(--wui-color-bg-125); 1644 } 1645 1646 wui-icon-box { 1647 outline: 2px solid var(--wui-color-bg-200); 1648 background-color: var(--wui-color-bg-250); 1649 } 1650`;var ex=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let ek=class extends o.WF{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.profileName="",this.address="",this.icon="chevronBottom"}render(){return(0,o.qy)`<button data-testid="wui-profile-button"> 1651 <wui-flex gap="xs" alignItems="center"> 1652 <wui-avatar 1653 .imageSrc=${this.avatarSrc} 1654 alt=${this.address} 1655 address=${this.address} 1656 ></wui-avatar> 1657 ${this.networkImageTemplate()} 1658 <wui-flex gap="xs" alignItems="center"> 1659 <wui-text variant="large-600" color="fg-100"> 1660 ${g.Z.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:4,charsEnd:4*!this.profileName,truncate:this.profileName?"end":"middle"})} 1661 </wui-text> 1662 <wui-icon size="sm" color="fg-200" name=${this.icon}></wui-icon> 1663 </wui-flex> 1664 </wui-flex> 1665 </button>`}networkImageTemplate(){return this.networkSrc?(0,o.qy)`<wui-image src=${this.networkSrc}></wui-image>`:(0,o.qy)` 1666 <wui-icon-box 1667 size="xxs" 1668 iconColor="fg-200" 1669 backgroundColor="bg-100" 1670 icon="networkPlaceholder" 1671 ></wui-icon-box> 1672 `}};ek.styles=[w.W5,w.fD,ey],ex([(0,a.MZ)()],ek.prototype,"networkSrc",void 0),ex([(0,a.MZ)()],ek.prototype,"avatarSrc",void 0),ex([(0,a.MZ)()],ek.prototype,"profileName",void 0),ex([(0,a.MZ)()],ek.prototype,"address",void 0),ex([(0,a.MZ)()],ek.prototype,"icon",void 0),ek=ex([(0,b.E)("wui-profile-button")],ek);let eC=(0,o.AH)` 1673 :host { 1674 display: block; 1675 padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s); 1676 border-radius: var(--wui-border-radius-xxs); 1677 1678 color: var(--wui-color-bg-100); 1679 position: relative; 1680 } 1681 1682 :host([data-variant='shade']) { 1683 background-color: var(--wui-color-bg-150); 1684 border: 1px solid var(--wui-color-gray-glass-005); 1685 } 1686 1687 :host([data-variant='shade']) > wui-text { 1688 color: var(--wui-color-fg-150); 1689 } 1690 1691 :host([data-variant='fill']) { 1692 background-color: var(--wui-color-fg-100); 1693 border: none; 1694 } 1695 1696 wui-icon { 1697 position: absolute; 1698 width: 12px !important; 1699 height: 4px !important; 1700 } 1701 1702 wui-icon[data-placement='top'] { 1703 bottom: 0px; 1704 left: 50%; 1705 transform: translate(-50%, 95%); 1706 } 1707 1708 wui-icon[data-placement='bottom'] { 1709 top: 0; 1710 left: 50%; 1711 transform: translate(-50%, -95%) rotate(180deg); 1712 } 1713 1714 wui-icon[data-placement='right'] { 1715 top: 50%; 1716 left: 0; 1717 transform: translate(-65%, -50%) rotate(90deg); 1718 } 1719 1720 wui-icon[data-placement='left'] { 1721 top: 50%; 1722 right: 0%; 1723 transform: translate(65%, -50%) rotate(270deg); 1724 } 1725`;var e$=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let eS=class extends o.WF{constructor(){super(...arguments),this.placement="top",this.variant="fill",this.message=""}render(){return this.dataset.variant=this.variant,(0,o.qy)`<wui-icon 1726 data-placement=${this.placement} 1727 color="fg-100" 1728 size="inherit"
1729 name=${"fill"===this.variant?"cursor":"cursorTransparent"} 1730 ></wui-icon> 1731 <wui-text color="inherit" variant="small-500">${this.message}</wui-text>`}};eS.styles=[w.W5,w.fD,eC],e$([(0,a.MZ)()],eS.prototype,"placement",void 0),e$([(0,a.MZ)()],eS.prototype,"variant",void 0),e$([(0,a.MZ)()],eS.prototype,"message",void 0),eS=e$([(0,b.E)("wui-tooltip")],eS);var eI=i(26128);let eA={getTabsByNamespace:e=>e&&e===_.o.CHAIN.EVM?n.H.state.remoteFeatures?.activity===!1?eI.o.ACCOUNT_TABS.filter(e=>"Activity"!==e.label):eI.o.ACCOUNT_TABS:[]};i(75258);let eE=(0,o.AH)` 1732 :host { 1733 width: 100%; 1734 max-height: 280px; 1735 overflow: scroll; 1736 scrollbar-width: none; 1737 } 1738 1739 :host::-webkit-scrollbar { 1740 display: none; 1741 } 1742`,eT=class extends o.WF{render(){return(0,o.qy)`<w3m-activity-list page="account"></w3m-activity-list>`}};eT.styles=eE,eT=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n}([(0,h.EM)("w3m-account-activity-widget")],eT),i(36698),i(82786);let eR=(0,o.AH)` 1743 .contentContainer { 1744 height: 280px; 1745 } 1746 1747 .contentContainer > wui-icon-box { 1748 width: 40px; 1749 height: 40px; 1750 border-radius: var(--wui-border-radius-xxs); 1751 } 1752 1753 .contentContainer > .textContent { 1754 width: 65%; 1755 } 1756`,eW=class extends o.WF{render(){return(0,o.qy)`${this.nftTemplate()}`}nftTemplate(){return(0,o.qy)` <wui-flex 1757 class="contentContainer" 1758 alignItems="center" 1759 justifyContent="center" 1760 flexDirection="column" 1761 gap="l" 1762 > 1763 <wui-icon-box 1764 icon="wallet" 1765 size="inherit" 1766 iconColor="fg-200" 1767 backgroundColor="fg-200" 1768 iconSize="lg" 1769 ></wui-icon-box> 1770 <wui-flex 1771 class="textContent" 1772 gap="xs" 1773 flexDirection="column" 1774 justifyContent="center" 1775 flexDirection="column" 1776 > 1777 <wui-text 1778 variant="paragraph-500" 1779 align="center" 1780 color="fg-100" 1781 data-testid="nft-template-title" 1782 >Coming soon</wui-text 1783 > 1784 <wui-text 1785 variant="small-400" 1786 align="center" 1787 color="fg-200" 1788 data-testid="nft-template-description" 1789 >Stay tuned for our upcoming NFT feature</wui-text 1790 > 1791 </wui-flex> 1792 <wui-link @click=${this.onReceiveClick.bind(this)} data-testid="link-receive-funds" 1793 >Receive funds</wui-link 1794 > 1795 </wui-flex>`}onReceiveClick(){G.I.push("WalletReceive")}};eW.styles=eR,eW=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n}([(0,h.EM)("w3m-account-nfts-widget")],eW),i(2745);let eO=(0,o.AH)` 1796 button { 1797 width: 100%; 1798 display: flex; 1799 gap: var(--wui-spacing-s); 1800 align-items: center; 1801 justify-content: flex-start; 1802 padding: var(--wui-spacing-s) var(--wui-spacing-m) var(--wui-spacing-s) var(--wui-spacing-s); 1803 background-color: var(--wui-color-gray-glass-002); 1804 border-radius: var(--wui-border-radius-xs); 1805 } 1806 1807 wui-icon-box { 1808 width: var(--wui-spacing-2xl); 1809 height: var(--wui-spacing-2xl); 1810 } 1811 1812 wui-flex { 1813 width: auto; 1814 } 1815`;var eN=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let eM=class extends o.WF{constructor(){super(...arguments),this.icon="card",this.text="",this.description="",this.tag=void 0,this.iconBackgroundColor="accent-100",this.iconColor="accent-100",this.disabled=!1}render(){return(0,o.qy)` 1816 <button ?disabled=${this.disabled}> 1817 <wui-icon-box 1818 iconColor=${this.iconColor}
1819 backgroundColor=${this.iconBackgroundColor} 1820 size="inherit" 1821 icon=${this.icon} 1822 iconSize="md" 1823 ></wui-icon-box> 1824 <wui-flex flexDirection="column" justifyContent="spaceBetween"> 1825 ${this.titleTemplate()} 1826 <wui-text variant="small-400" color="fg-200"> ${this.description}</wui-text></wui-flex 1827 > 1828 </button> 1829 `}titleTemplate(){return this.tag?(0,o.qy)` <wui-flex alignItems="center" gap="xxs" 1830 ><wui-text variant="paragraph-500" color="fg-100">${this.text}</wui-text 1831 ><wui-tag tagType="main" size="md">${this.tag}</wui-tag> 1832 </wui-flex>`:(0,o.qy)`<wui-text variant="paragraph-500" color="fg-100">${this.text}</wui-text>`}};eM.styles=[w.W5,w.fD,eO],eN([(0,a.MZ)()],eM.prototype,"icon",void 0),eN([(0,a.MZ)()],eM.prototype,"text",void 0),eN([(0,a.MZ)()],eM.prototype,"description",void 0),eN([(0,a.MZ)()],eM.prototype,"tag",void 0),eN([(0,a.MZ)()],eM.prototype,"iconBackgroundColor",void 0),eN([(0,a.MZ)()],eM.prototype,"iconColor",void 0),eN([(0,a.MZ)({type:Boolean})],eM.prototype,"disabled",void 0),eM=eN([(0,b.E)("wui-list-description")],eM),i(76927);let eP=(0,o.AH)` 1833 :host { 1834 width: 100%; 1835 } 1836 1837 wui-flex { 1838 width: 100%; 1839 } 1840 1841 .contentContainer { 1842 max-height: 280px; 1843 overflow: scroll; 1844 scrollbar-width: none; 1845 } 1846 1847 .contentContainer::-webkit-scrollbar {
1848 display: none; 1849 } 1850`;var ej=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let eq=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.tokenBalance=d.U.state.tokenBalance,this.remoteFeatures=n.H.state.remoteFeatures,this.unsubscribe.push(d.U.subscribe(e=>{this.tokenBalance=e.tokenBalance}),n.H.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,o.qy)`${this.tokenTemplate()}`}tokenTemplate(){return this.tokenBalance&&this.tokenBalance?.length>0?(0,o.qy)`<wui-flex class="contentContainer" flexDirection="column" gap="xs"> 1851 ${this.tokenItemTemplate()} 1852 </wui-flex>`:(0,o.qy)` <wui-flex flexDirection="column" gap="xs" 1853 >${this.onRampTemplate()} 1854 <wui-list-description 1855 @click=${this.onReceiveClick.bind(this)} 1856 text="Receive funds" 1857 description="Transfer tokens on your wallet" 1858 icon="arrowBottomCircle" 1859 iconColor="fg-200" 1860 iconBackgroundColor="fg-200" 1861 data-testid="receive-funds" 1862 ></wui-list-description 1863 ></wui-flex>`}onRampTemplate(){return this.remoteFeatures?.onramp?(0,o.qy)`<wui-list-description 1864 @click=${this.onBuyClick.bind(this)} 1865 text="Buy Crypto" 1866 description="Easy with card or bank account" 1867 icon="card" 1868 iconColor="success-100" 1869 iconBackgroundColor="success-100" 1870 tag="popular" 1871 data-testid="buy-crypto" 1872 ></wui-list-description>`:(0,o.qy)``}tokenItemTemplate(){return this.tokenBalance?.map(e=>(0,o.qy)`<wui-list-token 1873 tokenName=${e.name} 1874 tokenImageUrl=${e.iconUrl} 1875 tokenAmount=${e.quantity.numeric} 1876 tokenValue=${e.value} 1877 tokenCurrency=${e.symbol} 1878 ></wui-list-token>`)}onReceiveClick(){G.I.push("WalletReceive")}onBuyClick(){let e=s.W.state.activeChain;j.E.sendEvent({type:"track",event:"SELECT_BUY_CRYPTO",properties:{isSmartAccount:d.U.state.preferredAccountTypes?.[e]===ei.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}
1878),G.I.push("OnRampProviders")}};eq.styles=eP,ej([(0,a.wk)()],eq.prototype,"tokenBalance",void 0),ej([(0,a.wk)()],eq.prototype,"remoteFeatures",void 0),eq=ej([(0,h.EM)("w3m-account-tokens-widget")],eq),i(37054),i(21457);let eD=(0,o.AH)` 1879 wui-flex { 1880 width: 100%; 1881 } 1882 1883 wui-promo { 1884 position: absolute; 1885 top: -32px; 1886 } 1887 1888 wui-profile-button { 1889 margin-top: calc(-1 * var(--wui-spacing-2l)); 1890 } 1891 1892 wui-promo + wui-profile-button { 1893 margin-top: var(--wui-spacing-2l); 1894 } 1895 1896 wui-tabs { 1897 width: 100%; 1898 } 1899 1900 .contentContainer { 1901 height: 280px; 1902 } 1903 1904 .contentContainer > wui-icon-box { 1905 width: 40px; 1906 height: 40px; 1907 border-radius: var(--wui-border-radius-xxs); 1908 } 1909 1910 .contentContainer > .textContent { 1911 width: 65%; 1912 } 1913`;var eU=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let eL=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.address=d.U.state.address,this.profileImage=d.U.state.profileImage,this.profileName=d.U.state.profileName,this.network=s.W.state.activeCaipNetwork,this.currentTab=d.U.state.currentTab,this.tokenBalance=d.U.state.tokenBalance,this.features=n.H.state.features,this.remoteFeatures=n.H.state.remoteFeatures,this.networkImage=c.$.getNetworkImage(this.network),this.unsubscribe.push(l.j.subscribeNetworkImages(()=>{this.networkImage=c.$.getNetworkImage(this.network)}),d.U.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.currentTab=e.currentTab,this.tokenBalance=e.tokenBalance):p.W.close()}),s.W.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=c.$.getNetworkImage(this.network)}),n.H.subscribeKey("features",e=>this.features=e),n.H.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e)),this.watchSwapValues()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearInterval(this.watchTokenBalance)}firstUpdated(){d.U.fetchTokenBalance()}render(){if(!this.address)throw Error("w3m-account-view: No account provided");return(0,o.qy)`<wui-flex 1914 flexDirection="column" 1915 .padding=${["0","xl","m","xl"]} 1916 alignItems="center" 1917 gap="m" 1918 data-testid="w3m-account-wallet-features-widget" 1919 > 1920 <wui-profile-button 1921 @click=${this.onProfileButtonClick.bind(this)} 1922 address=${(0,r.J)(this.address)} 1923 networkSrc=${(0,r.J)(this.networkImage)} 1924 icon="chevronBottom" 1925 avatarSrc=${(0,r.J)(this.profileImage?this.profileImage:void 0)} 1926 profileName=${(0,r.J)(this.profileName??void 0)} 1927 data-testid="w3m-profile-button" 1928 ></wui-profile-button> 1929 1930 ${this.tokenBalanceTemplate()} ${this.orderedWalletFeatures()} ${this.tabsTemplate()} 1931 ${this.listContentTemplate()} 1932 </wui-flex>`}orderedWalletFeatures(){let e=this.features?.walletFeaturesOrder||J.oU.DEFAULT_FEATURES.walletFeaturesOrder;return e.every(e=>"send"===e||"receive"===e?!this.features?.[e]:"swaps"!==e&&"onramp"!==e||!this.remoteFeatures?.[e])?null:(0,o.qy)`<wui-flex gap="s"> 1933 ${e.map(e=>{switch(e){case"onramp":return this.onrampTemplate();case"swaps":return this.swapsTemplate();case"receive":return this.receiveTemplate();case"send":return this.sendTemplate();default:return null}})} 1934 </wui-flex>`}onrampTemplate(){return this.remoteFeatures?.onramp?(0,o.qy)` 1935 <w3m-tooltip-trigger text="Buy"> 1936 <wui-icon-button 1937 data-testid="wallet-features-onramp-button" 1938 @click=${this.onBuyClick.bind(this)} 1939 icon="card" 1940 ></wui-icon-button> 1941 </w3m-tooltip-trigger> 1942 `:null}swapsTemplate(){let e=this.remoteFeatures?.swaps,t=s.W.state.activeChain===_.o.CHAIN.EVM;return e&&t?(0,o.qy)` 1943 <w3m-tooltip-trigger text="Swap"> 1944 <wui-icon-button 1945 data-testid="wallet-features-swaps-button" 1946 @click=${this.onSwapClick.bind(this)} 1947 icon="recycleHorizontal" 1948 > 1949 </wui-icon-button> 1950 </w3m-tooltip-trigger> 1951 `:null}receiveTemplate(){return this.features?.receive?(0,o.qy)` 1952 <w3m-tooltip-trigger text="Receive"> 1953 <wui-icon-button 1954 data-testid="wallet-features-receive-button" 1955 @click=${this.onReceiveClick.bind(this)} 1956 icon="arrowBottomCircle" 1957 > 1958 </wui-icon-button> 1959 </w3m-tooltip-trigger> 1960 `:null}sendTemplate(){let e=this.features?.send,t=s.W.state.activeChain,i=J.oU.SEND_SUPPORTED_NAMESPACES.includes(t);return e&&i?(0,o.qy)` 1961 <w3m-tooltip-trigger text="Send"> 1962 <wui-icon-button 1963 data-testid="wallet-features-send-button" 1964 @click=${this.onSendClick.bind(this)} 1965 icon="send" 1966 ></wui-icon-button> 1967 </w3m-tooltip-trigger> 1968 `:null}watchSwapValues(){this.watchTokenBalance=setInterval(()=>d.U.fetchTokenBalance(e=>this.onTokenBalanceError(e)),1e4)}onTokenBalanceError(e){e instanceof Error&&e.cause instanceof Response&&e.cause.status===_.o.HTTP_STATUS_CODES.SERVICE_UNAVAILABLE&&clearInterval(this.watchTokenBalance)}listContentTemplate(){return 0===this.currentTab?(0,o.qy)`<w3m-account-tokens-widget></w3m-account-tokens-widget>`:1===this.currentTab?(0,o.qy)`<w3m-account-nfts-widget></w3m-account-nfts-widget>`:2===this.currentTab?(0,o.qy)`<w3m-account-activity-widget></w3m-account-activity-widget>`:(0,o.qy)`<w3m-account-tokens-widget></w3m-account-tokens-widget>`}tokenBalanceTemplate(){if(this.tokenBalance&&this.tokenBalance?.length>=0){let e=u.w.calculateBalance(this.tokenBalance),{dollars:t="0",pennies:i="00"}=u.w.formatTokenBalance(e);return(0,o.qy)`<wui-balance dollars=${t} pennies=${i}></wui-balance>`}return(0,o.qy)`<wui-balance dollars="0" pennies="00"></wui-balance>`}tabsTemplate(){let e=eA.getTabsByNamespace(s.W.state.activeChain);if(0===e.length)return null;let t=u.w.isMobile()&&window.innerWidth<430,i="104px";return i=t?`${(window.innerWidth-48)/e.length}px`:2===e.length?"156px":"104px",(0,o.qy)`<wui-tabs 1969 .onTabChange=${this.onTabChange.bind(this)} 1970 .activeTab=${this.currentTab} 1971 localTabWidth=${i} 1972 .tabs=${e} 1973 ></wui-tabs>`}onTabChange(e){d.U.setCurrentTab(e)}onProfileButtonClick(){let{allAccounts:e}=d.U.state;e.length>1?G.I.push("Profile"):G.I.push("AccountSettings")}
1973onBuyClick(){G.I.push("OnRampProviders")}onSwapClick(){let e=s.W.state.activeChain;this.network?.caipNetworkId&&!J.oU.SWAP_SUPPORTED_NETWORKS.includes(this.network?.caipNetworkId)?G.I.push("UnsupportedChain",{swapUnsupportedChain:!0}):(j.E.sendEvent({type:"track",event:"OPEN_SWAP",properties:{network:this.network?.caipNetworkId||"",isSmartAccount:d.U.state.preferredAccountTypes?.[e]===ei.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),G.I.push("Swap"))}onReceiveClick(){G.I.push("WalletReceive")}onSendClick(){let e=s.W.state.activeChain;j.E.sendEvent({type:"track",event:"OPEN_SEND",properties:{network:this.network?.caipNetworkId||"",isSmartAccount:d.U.state.preferredAccountTypes?.[e]===ei.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),G.I.push("WalletSend")}};eL.styles=eD,eU([(0,a.wk)()],eL.prototype,"watchTokenBalance",void 0),eU([(0,a.wk)()],eL.prototype,"address",void 0),eU([(0,a.wk)()],eL.prototype,"profileImage",void 0),eU([(0,a.wk)()],eL.prototype,"profileName",void 0),eU([(0,a.wk)()],eL.prototype,"network",void 0),eU([(0,a.wk)()],eL.prototype,"currentTab",void 0),eU([(0,a.wk)()],eL.prototype,"tokenBalance",void 0),eU([(0,a.wk)()],eL.prototype,"features",void 0),eU([(0,a.wk)()],eL.prototype,"remoteFeatures",void 0),eU([(0,a.wk)()],eL.prototype,"networkImage",void 0),eL=eU([(0,h.EM)("w3m-account-wallet-features-widget")],eL);var ez=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let eZ=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.namespace=s.W.state.activeChain,this.unsubscribe.push(s.W.subscribeKey("activeChain",e=>{this.namespace=e}))}render(){if(!this.namespace)return null;let e=V.a.getConnectorId(this.namespace),t=V.a.getAuthConnector();return(0,o.qy)` 1974 ${t&&e===_.o.CONNECTOR_ID.AUTH?this.walletFeaturesTemplate():this.defaultTemplate()} 1975 `}walletFeaturesTemplate(){return(0,o.qy)`<w3m-account-wallet-features-widget></w3m-account-wallet-features-widget>`}defaultTemplate(){return(0,o.qy)`<w3m-account-default-widget></w3m-account-default-widget>`}};ez([(0,a.wk)()],eZ.prototype,"namespace",void 0),eZ=ez([(0,h.EM)("w3m-account-view")],eZ);var eB=i(11501);let eF=(0,o.AH)` 1976 button { 1977 padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs); 1978 display: flex; 1979 justify-content: space-between; 1980 width: 100%; 1981 border-radius: var(--wui-border-radius-xs); 1982 background-color: var(--wui-color-gray-glass-002); 1983 } 1984 1985 button[data-clickable='false'] { 1986 pointer-events: none; 1987 background-color: transparent; 1988 } 1989 1990 wui-image { 1991 width: var(--wui-spacing-3xl); 1992 height: var(--wui-spacing-3xl); 1993 border-radius: var(--wui-border-radius-3xl); 1994 } 1995 1996 wui-avatar { 1997 width: var(--wui-spacing-3xl); 1998 height: var(--wui-spacing-3xl); 1999 box-shadow: 0 0 0 0; 2000 } 2001 .address { 2002 color: var(--wui-color-fg-base-100); 2003 } 2004 .address-description { 2005 text-transform: capitalize; 2006 color: var(--wui-color-fg-base-200); 2007 } 2008 2009 wui-icon-box { 2010 position: relative; 2011 right: 15px; 2012 top: 15px; 2013 border: 2px solid var(--wui-color-bg-150); 2014 background-color: var(--wui-color-bg-125); 2015 } 2016`;var eH=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let e_=class extends o.WF{constructor(){super(...arguments),this.accountAddress="",this.accountType="",this.labels=d.U.state.addressLabels,this.caipNetwork=s.W.state.activeCaipNetwork,this.socialProvider=eo.i.getConnectedSocialProvider(),this.balance=0,this.fetchingBalance=!0,this.shouldShowIcon=!1,this.selected=!1}connectedCallback(){super.connectedCallback(),eB.T.getBalance(this.accountAddress,this.caipNetwork?.caipNetworkId).then(e=>{let t=this.balance;e.balances.length>0&&(t=e.balances.reduce((e,t)=>
2016e+(t?.value||0),0)),this.balance=t,this.fetchingBalance=!1,this.requestUpdate()}).catch(()=>{this.fetchingBalance=!1,this.requestUpdate()})}render(){let e=this.getLabel(),t=s.W.state.activeChain,i=V.a.getConnectorId(t);return this.shouldShowIcon=i===_.o.CONNECTOR_ID.AUTH,(0,o.qy)` 2017 <wui-flex 2018 flexDirection="row" 2019 justifyContent="space-between" 2020 .padding=${["0","0","s","1xs"]} 2021 > 2022 <wui-flex gap="md" alignItems="center"> 2023 <wui-avatar address=${this.accountAddress}></wui-avatar> 2024 ${this.shouldShowIcon?(0,o.qy)`<wui-icon-box 2025 size="sm" 2026 iconcolor="fg-200" 2027 backgroundcolor="fg-300" 2028 icon=${this.accountType===ei.Vl.ACCOUNT_TYPES.EOA?this.socialProvider??"mail":"lightbulb"} 2029 background="fg-300" 2030 ></wui-icon-box>`:(0,o.qy)`<wui-flex .padding="${["0","0","0","s"]}"></wui-flex>`} 2031 <wui-flex flexDirection="column"> 2032 <wui-text class="address" variant="paragraph-500" color="fg-100" 2033 >${g.Z.getTruncateString({string:this.accountAddress,charsStart:4,charsEnd:6,truncate:"middle"})}</wui-text 2034 > 2035 <wui-text class="address-description" variant="small-400">${e}</wui-text></wui-flex 2036 > 2037 </wui-flex> 2038 <wui-flex gap="s" alignItems="center"> 2039 <slot name="action"></slot> 2040 ${this.fetchingBalance?(0,o.qy)`<wui-loading-spinner size="sm" color="accent-100"></wui-loading-spinner>`:(0,o.qy)` <wui-text variant="small-400">$${this.balance.toFixed(2)}</wui-text>`} 2041 </wui-flex> 2042 </wui-flex> 2043 `}getLabel(){let e=this.labels?.get(this.accountAddress),t=s.W.state.activeChain,i=V.a.getConnectorId(t);return e||i!==_.o.CONNECTOR_ID.AUTH?e||(e="EOA"):e=`${"eoa"===this.accountType?this.socialProvider??"Email":"Smart"} Account`,e}};e_.styles=[w.W5,w.fD,eF],eH([(0,a.MZ)()],e_.prototype,"accountAddress",void 0),eH([(0,a.MZ)()],e_.prototype,"accountType",void 0),eH([(0,a.MZ)({type:Boolean})],e_.prototype,"selected",void 0),eH([(0,a.MZ)({type:Function})],e_.prototype,"onSelect",void 0),e_=eH([(0,b.E)("wui-list-account")],e_);let eV=(0,o.AH)` 2044 wui-flex { 2045 width: 100%; 2046 } 2047 2048 wui-icon-link { 2049 margin-right: calc(var(--wui-icon-box-size-md) * -1); 2050 } 2051 2052 .account-links { 2053 display: flex; 2054 justify-content: space-between; 2055 align-items: center; 2056 } 2057 2058 .account-links wui-flex { 2059 cursor: pointer; 2060 display: flex; 2061 align-items: center; 2062 justify-content: center; 2063 flex: 1; 2064 background: red; 2065 align-items: center; 2066 justify-content: center; 2067 height: 48px; 2068 padding: 10px; 2069 flex: 1 0 0; 2070 2071 border-radius: var(--XS, 16px); 2072 border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); 2073 background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); 2074 transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); 2075 will-change: background-color; 2076 } 2077 2078 .account-links wui-flex:hover { 2079 background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15)); 2080 } 2081 2082 .account-links wui-flex wui-icon { 2083 width: var(--S, 20px); 2084 height: var(--S, 20px); 2085 } 2086 2087 .account-links wui-flex wui-icon svg path { 2088 stroke: #47a1ff; 2089 } 2090 2091 .account-settings-button { 2092 padding: calc(var(--wui-spacing-m) - 1px) var(--wui-spacing-2l); 2093 height: 40px; 2094 border-radius: var(--wui-border-radius-xxs); 2095 border: 1px solid var(--wui-color-gray-glass-002); 2096 background: var(--wui-color-gray-glass-002); 2097 cursor: pointer; 2098 } 2099 2100 .account-settings-button:hover { 2101 background: var(--wui-color-gray-glass-005); 2102 } 2103`;var eJ=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let eK=class extends o.WF{constructor(){super(),this.usubscribe=[],this.address=d.U.state.address,this.profileImage=d.U.state.profileImage,this.profileName=d.U.state.profileName,this.accounts=d.U.state.allAccounts,this.loading=!1,this.usubscribe.push(d.U.subscribeKey("address",e=>{e?this.address=e:p.W.close()})),this.usubscribe.push(d.U.subscribeKey("profileImage",e=>{this.profileImage=e})),this.usubscribe.push(d.U.subscribeKey("profileName",e=>{this.profileName=e}))}
2103disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){if(!this.address)throw Error("w3m-profile-view: No account provided");return(0,o.qy)` 2104 <wui-flex flexDirection="column" gap="l" .padding=${["0","xl","m","xl"]}> 2105 <wui-flex flexDirection="column" alignItems="center" gap="l"> 2106 <wui-avatar 2107 alt=${this.address} 2108 address=${this.address} 2109 imageSrc=${(0,r.J)(this.profileImage)} 2110 size="2lg" 2111 ></wui-avatar> 2112 <wui-flex flexDirection="column" alignItems="center"> 2113 <wui-flex gap="3xs" alignItems="center" justifyContent="center"> 2114 <wui-text variant="title-6-600" color="fg-100" data-testid="account-settings-address"> 2115 ${this.profileName?h.Zv.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):h.Zv.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})} 2116 </wui-text> 2117 <wui-icon-link 2118 size="md" 2119 icon="copy" 2120 iconColor="fg-200" 2121 @click=${this.onCopyAddress} 2122 ></wui-icon-link> 2123 </wui-flex> 2124 </wui-flex> 2125 </wui-flex> 2126 <wui-flex 2127 data-testid="account-settings-button" 2128 justifyContent="center" 2129 alignItems="center" 2130 class="account-settings-button" 2131 @click=${()=>G.I.push("AccountSettings")} 2132 > 2133 <wui-text variant="paragraph-500" color="fg-100">Account Settings</wui-text> 2134 </wui-flex> 2135 ${this.accountsTemplate()} 2136 </wui-flex> 2137 `}accountsTemplate(){return(0,o.qy)`<wui-flex flexDirection="column"> 2138 <wui-flex .padding=${["3xs","m","s","s"]}> 2139 <wui-text color="fg-200" variant="paragraph-400">Your accounts</wui-text> 2140 </wui-flex> 2141 <wui-flex flexDirection="column" gap="xxs"> 2142 ${this.accounts.map(e=>this.accountTemplate(e))} 2143 </wui-flex> 2144 </wui-flex>`}async onSwitchAccount(e){let t=s.W.state.activeCaipNetwork?.chainNamespace;if(this.loading=!0,V.a.getAuthConnector()){let i=e.type;await Y.x.setPreferredAccountType(i,t)}d.U.setShouldUpdateToAddress(e.address,t),this.loading=!1}accountTemplate(e){return(0,o.qy)`<wui-list-account accountAddress=${e.address} accountType=${e.type}> 2145 ${e.address===this.address?"":(0,o.qy)`<wui-button 2146 slot="action" 2147 textVariant="small-600" 2148 size="md" 2149 variant="accent" 2150 @click=${()=>this.onSwitchAccount(e)} 2151 .loading=${this.loading} 2152 >Switch</wui-button 2153 >`} 2154 </wui-list-account>`}onCopyAddress(){try{this.address&&(u.w.copyToClopboard(this.address),K.P.showSuccess("Address copied"))}catch{K.P.showError("Failed to copy")}}};eK.styles=eV,eJ([(0,a.wk)()],eK.prototype,"address",void 0),eJ([(0,a.wk)()],eK.prototype,"profileImage",void 0),eJ([(0,a.wk)()],eK.prototype,"profileName",void 0),eJ([(0,a.wk)()],eK.prototype,"accounts",void 0),eJ([(0,a.wk)()],eK.prototype,"loading",void 0),eK=eJ([(0,h.EM)("w3m-profile-view")],eK);let eG=(0,o.AH)` 2155 wui-flex { 2156 width: 100%; 2157 background-color: var(--wui-color-gray-glass-005); 2158 border-radius: var(--wui-border-radius-m); 2159 padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs) 2160 var(--wui-spacing-1xs); 2161 } 2162`;var eY=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let eX=class extends o.WF{constructor(){super(...arguments),this.imageSrc="",this.text="",this.size=""}render(){return(0,o.qy)` 2163 <wui-flex gap="1xs" alignItems="center"> 2164 <wui-avatar size=${this.size} imageSrc=${this.imageSrc}></wui-avatar> 2165 <wui-text variant="small-400" color="fg-200">${this.text}</wui-text> 2166 </wui-flex> 2167 `}};eX.styles=[w.W5,w.fD,eG],eY([(0,a.MZ)()],eX.prototype,"imageSrc",void 0),eY([(0,a.MZ)()],eX.prototype,"text",void 0),eY([(0,a.MZ)()],eX.prototype,"size",void 0),eX=eY([(0,b.E)("wui-banner-img")],eX);let eQ=(0,o.AH)` 2168 wui-avatar { 2169 width: var(--wui-spacing-3xl); 2170 height: var(--wui-spacing-3xl); 2171 box-shadow: 0 0 0 0; 2172 } 2173 2174 wui-icon-box { 2175 position: relative; 2176 right: 15px; 2177 top: 15px; 2178 border: 2px solid var(--wui-color-bg-150); 2179 background-color: var(--wui-color-bg-125); 2180 } 2181`;var e0=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let e3=class extends o.WF{constructor(){super(),this.metadata=n.H.state.metadata,this.allAccounts=d.U.state.allAccounts||[],this.balances={},this.labels=d.U.state.addressLabels,this.currentAddress=d.U.state.address||"",this.caipNetwork=s.W.state.activeCaipNetwork,d.U.subscribeKey("allAccounts",e=>{this.allAccounts=e})}connectedCallback(){super.connectedCallback(),this.allAccounts.forEac
2181h(e=>{eB.T.getBalance(e.address,this.caipNetwork?.caipNetworkId).then(t=>{let i=this.balances[e.address]||0;t.balances.length>0&&(i=t.balances.reduce((e,t)=>e+(t?.value||0),0)),this.balances[e.address]=i,this.requestUpdate()})})}getAddressIcon(e){return"smartAccount"===e?"lightbulb":"mail"}render(){return(0,o.qy)` 2182 <wui-flex justifyContent="center" .padding=${["xl","0","xl","0"]}> 2183 <wui-banner-img 2184 imageSrc=${(0,r.J)(this.metadata?.icons[0])} 2185 text=${(0,r.J)(this.metadata?.url)} 2186 size="sm" 2187 ></wui-banner-img> 2188 </wui-flex> 2189 <wui-flex flexDirection="column" gap="xxl" .padding=${["l","xl","xl","xl"]}> 2190 ${this.allAccounts.map((e,t)=>this.getAddressTemplate(e,t))} 2191 </wui-flex> 2192 `}getAddressTemplate(e,t){let i=this.labels?.get(e.address),a=s.W.state.activeChain,r=V.a.getConnectorId(a)===_.o.CONNECTOR_ID.AUTH;return(0,o.qy)` 2193 <wui-flex 2194 flexDirection="row" 2195 justifyContent="space-between" 2196 data-testid="switch-address-item" 2197 > 2198 <wui-flex alignItems="center"> 2199 <wui-avatar address=${e.address}></wui-avatar> 2200 ${r?(0,o.qy)`<wui-icon-box 2201 size="sm" 2202 iconcolor="fg-200" 2203 backgroundcolor="glass-002" 2204 background="gray" 2205 icon="${this.getAddressIcon(e.type)}" 2206 ?border=${!0} 2207 ></wui-icon-box>`:(0,o.qy)`<wui-flex .padding="${["0","0","0","s"]}"></wui-flex>`} 2208 <wui-flex flexDirection="column"> 2209 <wui-text class="address" variant="paragraph-500" color="fg-100" 2210 >${i||h.Zv.getTruncateString({string:e.address,charsStart:4,charsEnd:6,truncate:"middle"})}</wui-text 2211 > 2212 <wui-text class="address-description" variant="small-400"> 2213 ${"number"==typeof this.balances[e.address]?`$${this.balances[e.address]?.toFixed(2)}`:(0,o.qy)`<wui-loading-spinner size="sm" color="accent-100"></wui-loading-spinner>`} 2214 </wui-text> 2215 </wui-flex> 2216 </wui-flex> 2217 <wui-flex gap="s" alignItems="center"> 2218 ${e.address?.toLowerCase()===this.currentAddress?.toLowerCase()?"":(0,o.qy)` 2219 <wui-button 2220 data-testid=${`w3m-switch-address-button-${t}`} 2221 textVariant="small-600" 2222 size="md" 2223 variant="accent" 2224 @click=${()=>this.onSwitchAddress(e.address)} 2225 >Switch to</wui-button 2226 > 2227 `} 2228 </wui-flex> 2229 </wui-flex> 2230 `}onSwitchAddress(e){let t=s.W.state.activeCaipNetwork,i=t?.chainNamespace,o=`${i}:${t?.id}:${e}`;d.U.setCaipAddress(o,i),p.W.close()}};e3.styles=eQ,e0([(0,a.wk)()],e3.prototype,"allAccounts",void 0),e0([(0,a.wk)()],e3.prototype,"balances",void 0),e3=e0([(0,h.EM)("w3m-switch-address-view")],e3);var e1=i(58698),e5=i(45714),e2=i(51173);i(4577),i(45440);let e4=(0,o.AH)` 2231 wui-image { 2232 width: var(--wui-spacing-2xl); 2233 height: var(--wui-spacing-2xl); 2234 border-radius: var(--wui-border-radius-3xs); 2235 } 2236 2237 wui-image, 2238 .icon-box { 2239 width: var(--wui-spacing-2xl); 2240 height: var(--wui-spacing-2xl); 2241 border-radius: var(--wui-border-radius-3xs); 2242 } 2243 2244 wui-icon:not(.custom-icon, .icon-badge) { 2245 cursor: pointer; 2246 } 2247 2248 .icon-box { 2249 position: relative; 2250 background-color: var(--wui-color-gray-glass-002); 2251 } 2252 2253 .icon-badge { 2254 position: absolute; 2255 top: 18px; 2256 left: 23px; 2257 z-index: 3; 2258 background-color: var(--wui-color-gray-glass-005); 2259 border: 2px solid var(--wui-color-modal-bg); 2260 border-radius: 50%; 2261 padding: var(--wui-spacing-4xs); 2262 } 2263`;var e6=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let e7=class extends o.WF{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",this.enableMoreButton=!1,this.charsStart=4,this.charsEnd=6}render(){return(0,o.qy)` 2264 <wui-flex flexDirection="column" rowGap="xs"> 2265 ${this.topTemplate()} ${this.bottomTemplate()} 2266 </wui-flex> 2267 `}topTemplate(){return(0,o.qy)` 2268 <wui-flex alignItems="flex-start" justifyContent="space-between"> 2269 ${this.imageOrIconTemplate()} 2270 <wui-icon-link 2271 iconColor="fg-200" 2272 size="sm" 2273 icon="copy" 2274 @click=${this.dispatchCopyEvent} 2275 ></wui-icon-link> 2276 <wui-icon-link 2277 iconColor="fg-200" 2278 size="sm" 2279 icon="externalLink" 2280 @click=${this.dispatchExternalLinkEvent} 2281 ></wui-icon-link> 2282 ${this.enableMoreButton?(0,o.qy)`<wui-icon-link 2283 iconColor="fg-200" 2284 size="sm" 2285 icon="threeDots" 2286 @click=${this.dispatchMoreButtonEvent} 2287 ></wui-icon-link>`:null} 2288 </wui-flex> 2289 `}bottomTemplate(){return(0,o.qy)` <wui-flex flexDirection="column">${this.contentTemplate()}</wui-flex> `}imageOrIconTemplate(){return this.icon?(0,o.qy)` 2290 <wui-flex flexGrow="1" alignItems="center"> 2291 <wui-flex alignItems="center" justifyContent="center" class="icon-box"> 2292 <wui-icon 2293 size=${this.iconSize} 2294 color="fg-200" 2295 name=${this.icon} 2296 class="custom-icon" 2297 ></wui-icon> 2298 2299 ${this.iconBadge?(0,o.qy)`<wui-icon 2300 color="fg-175" 2301 size=${this.iconBadgeSize} 2302 name=${this.iconBadge} 2303 class="icon-badge" 2304 ></wui-icon>`:null} 2305 </wui-flex> 2306 </wui-flex> 2307 `:(0,o.qy)` 2308 <wui-flex flexGrow="1" alignItems="center"> 2309 <wui-image objectFit="contain" src=${this.imageSrc} alt=${this.alt}></wui-image> 2310 </wui-flex> 2311 `}contentTemplate(){return 0===this.content.length?null:(0,o.qy)` 2312 <wui-flex flexDirection="column" rowGap="s"> 2313 ${this.content.map(e=>this.labelAndTagTemplate(e))} 2314 </wui-flex> 2315 `}labelAndTagTemplate({address:e,profileName:t,label:i,description:a,enableButton:r,tagVariant:n,tagLabel:s,alignItems:l="flex-end"}){return(0,o.qy)` 2316 <wui-flex justifyContent="space-between" alignItems=${l} columnGap="3xs"> 2317 <wui-flex flexDirection="column" rowGap="4xs"> 2318 ${i?(0,o.qy)`<wui-text variant="micro-600" color="fg-200">${i}</wui-text>`:null} 2319 2320 <wui-flex alignItems="center" columnGap="3xs"> 2321 <wui-text variant="small-500" color="fg-100"> 2322 ${g.Z.getTruncateString({string:t||e,charsStart:t?16:this.charsStart,charsEnd:t?0:this.charsEnd,truncate:t?"end":"middle"})} 2323 </wui-text> 2324 2325 ${n&&s?(0,o.qy)`<wui-tag variant=${n} size="xs">${s}</wui-tag>`:null} 2326 </wui-flex> 2327 2328 ${a?(0,o.qy)`<wui-text variant="tiny-500" color="fg-200">${a}</wui-text>`:null} 2329 </wui-flex> 2330 2331 ${r?this.disconnectTemplate():null} 2332 </wui-flex> 2333 `}disconnectTemplate(){return(0,o.qy)` 2334 <wui-button 2335 size="xs" 2336 variant=${this.buttonVariant} 2337 @click=${this.dispatchDisconnectEvent.bind(this)} 2338 > 2339 Disconnect 2340 </wui-button>
2340 2341 `}dispatchDisconnectEvent(){this.dispatchEvent(new CustomEvent("disconnect",{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}))}};e7.styles=[w.W5,w.fD,e4],e6([(0,a.MZ)()],e7.prototype,"address",void 0),e6([(0,a.MZ)()],e7.prototype,"profileName",void 0),e6([(0,a.MZ)({type:Array})],e7.prototype,"content",void 0),e6([(0,a.MZ)()],e7.prototype,"alt",void 0),e6([(0,a.MZ)()],e7.prototype,"imageSrc",void 0),e6([(0,a.MZ)()],e7.prototype,"icon",void 0),e6([(0,a.MZ)()],e7.prototype,"iconSize",void 0),e6([(0,a.MZ)()],e7.prototype,"iconBadge",void 0),e6([(0,a.MZ)()],e7.prototype,"iconBadgeSize",void 0),e6([(0,a.MZ)()],e7.prototype,"buttonVariant",void 0),e6([(0,a.MZ)({type:Boolean})],e7.prototype,"enableMoreButton",void 0),e6([(0,a.MZ)({type:Number})],e7.prototype,"charsStart",void 0),e6([(0,a.MZ)({type:Number})],e7.prototype,"charsEnd",void 0),e7=e6([(0,b.E)("wui-active-profile-wallet-item")],e7);let e8=(0,o.AH)` 2342 wui-image, 2343 .icon-box { 2344 width: var(--wui-spacing-2xl); 2345 height: var(--wui-spacing-2xl); 2346 border-radius: var(--wui-border-radius-3xs); 2347 } 2348 2349 .right-icon { 2350 cursor: pointer; 2351 } 2352 2353 .icon-box { 2354 position: relative; 2355 background-color: var(--wui-color-gray-glass-002); 2356 } 2357 2358 .icon-badge { 2359 position: absolute; 2360 top: 18px; 2361 left: 23px; 2362 z-index: 3; 2363 background-color: var(--wui-color-gray-glass-005); 2364 border: 2px solid var(--wui-color-modal-bg); 2365 border-radius: 50%; 2366 padding: var(--wui-spacing-4xs); 2367 } 2368`;var e9=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let te=class extends o.WF{constructor(){super(...arguments),this.address="",this.profileName="",this.alt="",this.buttonLabel="",this.buttonVariant="accent",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.iconBadgeSize="md",this.rightIcon="off",this.rightIconSize="md",this.loading=!1,this.charsStart=4,this.charsEnd=6}render(){return(0,o.qy)` 2369 <wui-flex alignItems="center" columnGap="xs"> 2370 ${this.imageOrIconTemplate()} ${this.labelAndDescriptionTemplate()} 2371 ${this.buttonActionTemplate()} 2372 </wui-flex> 2373 `}imageOrIconTemplate(){return this.icon?(0,o.qy)` 2374 <wui-flex alignItems="center" justifyContent="center" class="icon-box"> 2375 <wui-flex alignItems="center" justifyContent="center" class="icon-box"> 2376 <wui-icon 2377 size=${this.iconSize} 2378 color="fg-200" 2379 name=${this.icon} 2380 class="custom-icon" 2381 ></wui-icon> 2382 2383 ${this.iconBadge?(0,o.qy)`<wui-icon 2384 color="fg-175" 2385 size=${this.iconBadgeSize} 2386 name=${this.iconBadge} 2387 class="icon-badge" 2388 ></wui-icon>`:null} 2389 </wui-flex> 2390 </wui-flex> 2391 `:(0,o.qy)`<wui-image objectFit="contain" src=${this.imageSrc} alt=${this.alt}></wui-image>`}labelAndDescriptionTemplate(){return(0,o.qy)` 2392 <wui-flex 2393 flexDirection="column" 2394 flexGrow="1" 2395 justifyContent="flex-start" 2396 alignItems="flex-start" 2397 > 2398 <wui-text variant="small-500" color="fg-100"> 2399 ${g.Z.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?16:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"})} 2400 </wui-text> 2401 </wui-flex> 2402 `}buttonActionTemplate(){return(0,o.qy)` 2403 <wui-flex columnGap="3xs" alignItems="center" justifyContent="center"> 2404 <wui-button 2405 size="xs" 2406 variant=${this.buttonVariant} 2407 .loading=${this.loading} 2408 @click=${this.handleButtonClick} 2409 > 2410 ${this.buttonLabel} 2411 </wui-button>
2411 2412 2413 <wui-icon-link 2414 iconColor="fg-200" 2415 size=${this.rightIconSize} 2416 icon=${this.rightIcon} 2417 class="right-icon" 2418 @click=${this.handleIconClick} 2419 ></wui-icon-link> 2420 </wui-flex> 2421 `}handleButtonClick(){this.dispatchEvent(new CustomEvent("buttonClick",{bubbles:!0,composed:!0}))}handleIconClick(){this.dispatchEvent(new CustomEvent("iconClick",{bubbles:!0,composed:!0}))}};te.styles=[w.W5,w.fD,e8],e9([(0,a.MZ)()],te.prototype,"address",void 0),e9([(0,a.MZ)()],te.prototype,"profileName",void 0),e9([(0,a.MZ)()],te.prototype,"alt",void 0),e9([(0,a.MZ)()],te.prototype,"buttonLabel",void 0),e9([(0,a.MZ)()],te.prototype,"buttonVariant",void 0),e9([(0,a.MZ)()],te.prototype,"imageSrc",void 0),e9([(0,a.MZ)()],te.prototype,"icon",void 0),e9([(0,a.MZ)()],te.prototype,"iconSize",void 0),e9([(0,a.MZ)()],te.prototype,"iconBadge",void 0),e9([(0,a.MZ)()],te.prototype,"iconBadgeSize",void 0),e9([(0,a.MZ)()],te.prototype,"rightIcon",void 0),e9([(0,a.MZ)()],te.prototype,"rightIconSize",void 0),e9([(0,a.MZ)({type:Boolean})],te.prototype,"loading",void 0),e9([(0,a.MZ)({type:Number})],te.prototype,"charsStart",void 0),e9([(0,a.MZ)({type:Number})],te.prototype,"charsEnd",void 0),te=e9([(0,b.E)("wui-inactive-profile-wallet-item")],te),i(69551);var tt=i(23140),ti=i(95842);let to={getAuthData(e){let t=e.connectorId===_.o.CONNECTOR_ID.AUTH;if(!t)return{isAuth:!1,icon:void 0,iconSize:void 0,name:void 0};let i=e?.auth?.name??eo.i.getConnectedSocialProvider(),o=e?.auth?.username??eo.i.getConnectedSocialUsername(),a=V.a.getAuthConnector(),r=a?.provider.getEmail()??"";return{isAuth:!0,icon:i??"mail",iconSize:i?"xl":"md",name:t?ti.g.getAuthName({email:r,socialUsername:o,socialProvider:i}):void 0}}},ta=(0,o.AH)` 2422 :host { 2423 --connect-scroll--top-opacity: 0; 2424 --connect-scroll--bottom-opacity: 0; 2425 } 2426 2427 .balance-amount { 2428 flex: 1; 2429 } 2430 2431 .wallet-list { 2432 scrollbar-width: none; 2433 overflow-y: scroll; 2434 overflow-x: hidden; 2435 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 2436 will-change: opacity; 2437 mask-image: linear-gradient( 2438 to bottom, 2439 rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px, 2440 rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px, 2441 black 40px, 2442 black calc(100% - 40px), 2443 rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px), 2444 rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100% 2445 ); 2446 } 2447 2448 .active-wallets { 2449 background-color: var(--wui-color-gray-glass-002); 2450 border-radius: var(--wui-border-radius-xs); 2451 } 2452 2453 .active-wallets-box { 2454 height: 330px; 2455 } 2456 2457 .empty-wallet-list-box { 2458 height: 400px; 2459 } 2460 2461 .empty-box { 2462 width: 100%; 2463 padding: var(--wui-spacing-l); 2464 background-color: var(--wui-color-gray-glass-002); 2465 border-radius: var(--wui-border-radius-xs); 2466 } 2467 2468 wui-separator { 2469 margin: var(--wui-spacing-xs) 0 var(--wui-spacing-xs) 0; 2470 } 2471 2472 .active-connection { 2473 padding: var(--wui-spacing-xs); 2474 } 2475 2476 .recent-connection { 2477 padding: var(--wui-spacing-xs) 0 var(--wui-spacing-xs) 0; 2478 } 2479 2480 @media (max-width: 430px) { 2481 .active-wallets-box, 2482 .empty-wallet-list-box { 2483 height: auto; 2484 max-height: clamp(360px, 470px, 80vh); 2485 } 2486 } 2487`;var tr=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let tn={ADDRESS_DISPLAY:{START:4,END:6},BADGE:{SIZE:"md",ICON:"lightbulb"},SCROLL_THRESHOLD:50,OPACITY_RANGE:[0,1]},ts={eip155:"ethereum",solana:"solana",bip122:"bitcoin"},tl=[{namespace:"eip155",icon:ts.eip155,label:"EVM"},{namespace:"solana",icon:ts.solana,label:"Solana"},{namespace:"bip122",icon:ts.bip122,label:"Bitcoin"}],tc={1:320,2:160,3:106},td={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"}},tu=class extends o.WF{constructor(){super(),this.unsubscribers=[],this.currentTab=0,this.namespace=s.W.state.activeChain,this.namespaces=Array.from(s.W.state.chains.keys()),this.caipAddress=void 0,this.profileName=void 0,this.activeConnectorIds=V.a.state.activeConnectorIds,this.lastSelectedAddress="",this.lastSelectedConnectorId="",this.isSwitching=!1,this.caipNetwork=s.W.state.activeCaipNetwork,this.currentTab=this.namespace?this.namespaces.indexOf(this.namespace):0,this.caipAddress=s.W.getAccountData(this.namespace)?.caipAddress,this.profileName=s.W.getAccountData(this.namespace)?.profileName,this.unsubscribers.push(Y.x.subscribeKey("connections",()=>this.requestUpdate()),V.a.subscribeKey("activeConnectorIds",e=>{this.activeConnectorIds=e}),s.W.subscribeKey("activeCaipNetwork",e=>this.caipNetwork=e)),this.chainListener=s.W.subscribeChainProp("accountState",e=>{this.caipAddress=e?.caipAddress,this.profileName=e?.profileName},this.namespace)}
2487disconnectedCallback(){this.unsubscribers.forEach(e=>e()),this.resizeObserver?.disconnect(),this.removeScrollListener(),this.chainListener?.()}firstUpdated(){let e=this.shadowRoot?.querySelector(".wallet-list");if(!e)return;let t=()=>this.updateScrollOpacity(e);requestAnimationFrame(t),e.addEventListener("scroll",t),this.resizeObserver=new ResizeObserver(t),this.resizeObserver.observe(e),t()}render(){let e=this.namespace;if(!e)throw Error("Namespace is not set");return(0,o.qy)` 2488 <wui-flex flexDirection="column" .padding=${["0","l","l","l"]} gap="l"> 2489 ${this.renderTabs()} ${this.renderHeader(e)} ${this.renderConnections(e)} 2490 ${this.renderAddConnectionButton(e)} 2491 </wui-flex> 2492 `}renderTabs(){let e=tl.filter(e=>this.namespaces.includes(e.namespace)),t=e.length,i=tc[t]??tc[1];return t>1?(0,o.qy)` 2493 <wui-tabs 2494 .onTabChange=${e=>this.handleTabChange(e)} 2495 .activeTab=${this.currentTab} 2496 localTabWidth=${u.w.isMobile()&&window.innerWidth<=430?`${(window.innerWidth-40)/t}px`:`${i}px`} 2497 .tabs=${e} 2498 ></wui-tabs> 2499 `:null}renderHeader(e){let t=this.getActiveConnections(e).flatMap(({accounts:e})=>e).length+ +!!this.caipAddress;return(0,o.qy)` 2500 <wui-flex alignItems="center" columnGap="3xs"> 2501 <wui-icon 2502 name=${ts[e]??ts.eip155} 2503 size="lg" 2504 ></wui-icon> 2505 <wui-text color="fg-200" variant="small-400" 2506 >${t>1?"Wallets":"Wallet"}</wui-text 2507 > 2508 <wui-text 2509 color="fg-100" 2510 variant="small-400" 2511 class="balance-amount" 2512 data-testid="balance-amount" 2513 > 2514 ${t} 2515 </wui-text> 2516 <wui-link 2517 color="fg-200" 2518 @click=${()=>this.handleDisconnectAll(e)} 2519 ?disabled=${!this.hasAnyConnections(e)} 2520 data-testid="disconnect-all-button" 2521 > 2522 Disconnect All 2523 </wui-link> 2524 </wui-flex> 2525 `}renderConnections(e){let t=this.hasAnyConnections(e);return(0,o.qy)` 2526 <wui-flex flexDirection="column" class=${(0,e1.H)({"wallet-list":!0,"active-wallets-box":t,"empty-wallet-list-box":!t})} rowGap="s"> 2527 ${t?this.renderActiveConnections(e):this.renderEmptyState(e)} 2528 </wui-flex> 2529 `}renderActiveConnections(e){let t=this.getActiveConnections(e),i=this.activeConnectorIds[e],a=this.getPlainAddress();return(0,o.qy)` 2530 ${a||i||t.length>0?(0,o.qy)`<wui-flex 2531 flexDirection="column" 2532 .padding=${["l","0","xs","0"]} 2533 class="active-wallets" 2534 > 2535 ${this.renderActiveProfile(e)} ${this.renderActiveConnectionsList(e)} 2536 </wui-flex>`:null} 2537 ${this.renderRecentConnections(e)} 2538 `}renderActiveProfile(e){let t=this.activeConnectorIds[e];if(!t)return null;let{connections:i}=e2.b.getConnectionsData(e),a=V.a.getConnectorById(t),r=c.$.getConnectorImage(a),n=this.getPlainAddress();if(!n)return null;let s=to.getAuthData({connectorId:t,accounts:[]}),l=this.getActiveConnections(e).flatMap(e=>e.accounts).length>0;return(0,o.qy)` 2539 <wui-flex flexDirection="column" .padding=${["0","l","0","l"]}> 2540 <wui-active-profile-wallet-item 2541 address=${n} 2542 alt=${a?.name} 2543 .content=${this.getProfileContent({address:n,connections:i,connectorId:t,namespace:e})} 2544 .charsStart=${tn.ADDRESS_DISPLAY.START} 2545 .charsEnd=${tn.ADDRESS_DISPLAY.END} 2546 .icon=${s.icon} 2547 .iconSize=${s.iconSize} 2548 .iconBadge=${this.isSmartAccount(n)?tn.BADGE.ICON:void 0} 2549 .iconBadgeSize=${this.isSmartAccount(n)?tn.BADGE.SIZE:void 0} 2550 imageSrc=${r} 2551 ?enableMoreButton=${s.isAuth} 2552 @copy=${()=>this.handleCopyAddress(n)} 2553 @disconnect=${()=>this.handleDisconnect(e,{})} 2554 @externalLink=${()=>this.handleExternalLink(n)} 2555 @more=${()=>this.handleMore()} 2556 ></wui-active-profile-wallet-item> 2557 ${l?(0,o.qy)`<wui-separator></wui-separator>`:null} 2558 </wui-flex> 2559 `}renderActiveConnectionsList(e){let t=this.getActiveConnections(e);return 0===t.length?null:(0,o.qy)` 2560 <wui-flex flexDirection="column" .padding=${["0","xs","0","xs"]}> 2561 ${this.renderConnectionList(t,!1,e)} 2562 </wui-flex> 2563 `}renderRecentConnections(e){let{recentConnections:t}=e2.b.getConnectionsData(e);return(e===_.o.CHAIN.BITCOIN&&(t=t.map(e=>({...e,accounts:e.accounts.filter(e=>"string"!=typeof e.type||"payment"===e.type)}))),0===t.flatMap(e=>e.accounts).length)?null:(0,o.qy)` 2564 <wui-flex flexDirection="column" .padding=${["0","xs","0","xs"]} rowGap="xs"> 2565 <wui-text color="fg-200" variant="micro-500" data-testid="recently-connected-text" 2566 >RECENTLY CONNECTED</wui-text 2567 > 2568 <wui-flex flexDirection="column" .padding=${["0","xs","0","xs"]}> 2569 ${this.renderConnectionList(t,!0,e)} 2570 </wui-flex> 2571 </wui-flex> 2572 `}renderConnectionList(e,t,i){return e.filter(e=>e.accounts.length>0).map((e,a)=>{let r=V.a.getConnectorById(e.connectorId),n=c.$.getConnectorImage(r)??"",s=to.getAuthData(e);return e.accounts.map((r,l)=>{let c=this.isAccountLoading(e.connectorId,r.address);return(0,o.qy)` 2573 <wui-flex flexDirection="column"> 2574 ${0!==a||0!==l?(0,o.qy)`<wui-separator></wui-separator>`:null} 2575 <wui-inactive-profile-wallet-item 2576 address=${r.address} 2577 alt=${e.connectorId} 2578 buttonLabel=${t?"Connect":"Switch"} 2579 buttonVariant=${t?"neutral":"accent"} 2580 rightIcon=${t?"bin":"off"} 2581 rightIconSize="sm" 2582 class=${t?"recent-connection":"active-connection"} 2583 data-testid=${t?"recent-connection":"active-connection"} 2584 imageSrc=${n} 2585 .iconBadge=${this.isSmartAccount(r.address)?tn.BADGE.ICON:void 0} 2586 .iconBadgeSize=${this.isSmartAccount(r.address)?tn.BADGE.SIZE:void 0} 2587 .icon=${s.icon} 2588 .iconSize=${s.iconSize} 2589 .loading=${c} 2590 .showBalance=${!1} 2591 .charsStart=${tn.ADDRESS_DISPLAY.START} 2592 .charsEnd=${tn.ADDRESS_DISPLAY.END} 2593 @buttonClick=${()=>this.handleSwitchWallet(e,r.address,i)} 2594 @iconClick=${()=>this.handleWalletAction({connection:e,address:r.address,isRecentConnection:t,namespace:i})} 2595 ></wui-inactive-profile-wallet-item> 2596 </wui-flex> 2597 `})})}renderAddConnectionButton(e){if(!this.hasAnyConnections(e))return null;let{title:t}=this.getChainLabelInfo(e);return(0,o.qy)` 2598 <wui-list-item 2599 variant="icon" 2600 iconVariant="overlay" 2601 icon="plus" 2602 iconSize="sm" 2603 ?chevron=${!0} 2604 @click=${()=>this.handleAddConnection(e)} 2605 data-testid="add-connection-button" 2606 > 2607 <wui-text variant="paragraph-500" color="fg-200">${t}</wui-text> 2608 </wui-list-item> 2609 `}renderEmptyState(e){let{title:t,description:i}=this.getChainLabelInfo(e);return(0,o.qy)` 2610 <wui-flex alignItems="flex-start" class="empty-template" data-testid="empty-template"> 2611 <wui-flex 2612 flexDirection="column" 2613 alignItems="center" 2614 justifyContent="center" 2615 rowGap="s" 2616 class="empty-box" 2617 > 2618 <wui-icon-box 2619 size="lg" 2620 icon="wallet" 2621 background="gray" 2622 iconColor="fg-200" 2623 backgroundColor="glass-002" 2624 ></wui-icon-box> 2625 2626 <wui-flex flexDirection="column" alignItems="center" justifyContent="center" gap="3xs"> 2627 <wui-text color="fg-100" variant="paragraph-500" data-testid="empty-state-text" 2628 >No wallet connected</wui-text 2629 > 2630 <wui-text color="fg-200" variant="tiny-500" data-testid="empty-state-description" 2631 >${i}</wui-text 2632 > 2633 </wui-flex> 2634 2635 <wui-button 2636 variant="neutral" 2637 size="md" 2638 @click=${()=>this.handleAddConnection(e)} 2639 data-testid="empty-state-button" 2640 > 2641 <wui-icon color="inherit" slot="iconLeft" name="plus"></wui-icon> 2642 ${t} 2643 </wui-button>
2643 2644 </wui-flex> 2645 </wui-flex> 2646 `}handleTabChange(e){let t=this.namespaces[e];t&&(this.chainListener?.(),this.currentTab=this.namespaces.indexOf(t),this.namespace=t,this.caipAddress=s.W.getAccountData(t)?.caipAddress,this.profileName=s.W.getAccountData(t)?.profileName,this.chainListener=s.W.subscribeChainProp("accountState",e=>{this.caipAddress=e?.caipAddress},t))}handleDisconnectAll(e){Y.x.disconnect({namespace:e})}async handleSwitchWallet(e,t,i){try{this.isSwitching=!0,this.lastSelectedConnectorId=e.connectorId,this.lastSelectedAddress=t,await Y.x.switchConnection({connection:e,address:t,namespace:i,closeModalOnConnect:!1,onChange({hasSwitchedAccount:e,hasSwitchedWallet:t}){t?K.P.showSuccess("Wallet switched"):e&&K.P.showSuccess("Account switched")}})}catch(e){K.P.showError("Failed to switch wallet")}finally{this.isSwitching=!1}}handleWalletAction(e){let{connection:t,address:i,isRecentConnection:o,namespace:a}=e;o?(eo.i.deleteAddressFromConnection({connectorId:t.connectorId,address:i,namespace:a}),K.P.showSuccess("Wallet deleted"),this.requestUpdate()):this.handleDisconnect(a,{id:t.connectorId})}async handleDisconnect(e,{id:t}){try{await Y.x.disconnect({id:t,namespace:e}),K.P.showSuccess("Wallet disconnected")}catch{K.P.showError("Failed to disconnect wallet")}}handleCopyAddress(e){u.w.copyToClopboard(e),K.P.showSuccess("Address copied")}handleMore(){G.I.push("AccountSettings")}handleExternalLink(e){let t=this.caipNetwork?.blockExplorers?.default.url;t&&u.w.openHref(`${t}/address/${e}`,"_blank")}handleAddConnection(e){V.a.setFilterByNamespace(e),G.I.push("Connect")}getChainLabelInfo(e){return td[e]??{title:"Add Wallet",description:"Add your first wallet"}}isSmartAccount(e){if(!this.namespace)return!1;let{connections:t,recentConnections:i}=e2.b.getConnectionsData(this.namespace);return[...t,...i].flatMap(e=>e.accounts).filter(e=>"smart"===e.type).some(t=>tt.y.isLowerCaseMatch(t.address,e))}getPlainAddress(){return this.caipAddress?u.w.getPlainAddress(this.caipAddress):void 0}getActiveConnections(e){let t=this.activeConnectorIds[e],{connections:i}=e2.b.getConnectionsData(e);if(!t)return i;let{address:o}=this.caipAddress?e5.C.parseCaipAddress(this.caipAddress):{},a=e===_.o.CHAIN.BITCOIN;return e2.b.excludeConnectorAddressFromConnections({connectorId:t,addresses:o?[o]:[],connections:a?e2.b.filterConnectionsByAccountType(i,"payment"):i})}hasAnyConnections(e){let t=this.getActiveConnections(e),{recentConnections:i}=e2.b.getConnectionsData(e);return!!this.caipAddress||t.length>0||i.length>0}isAccountLoading(e,t){return tt.y.isLowerCaseMatch(this.lastSelectedConnectorId,e)&&tt.y.isLowerCaseMatch(this.lastSelectedAddress,t)&&this.isSwitching}getProfileContent(e){let{address:t,connections:i,connectorId:o,namespace:a}=e,[r]=i.filter(e=>tt.y.isLowerCaseMatch(e.connectorId,o));if(a===_.o.CHAIN.BITCOIN&&r?.accounts.every(e=>"string"==typeof e.type))return this.getBitcoinProfileContent(r.accounts,t);let n=to.getAuthData({connectorId:o,accounts:[]});return[{address:t,tagLabel:"Active",tagVariant:"success",enableButton:!0,profileName:this.profileName,...n.isAuth?{description:this.isSmartAccount(t)?"Smart Account":"EOA Account"}:{}}]}getBitcoinProfileContent(e,t){let i=e.length>1;return e.map((o,a)=>({address:o.address,tagLabel:tt.y.isLowerCaseMatch(o.address,t)?"Active":void 0,tagVariant:tt.y.isLowerCaseMatch(o.address,t)?"success":void 0,enableButton:a===e.length-1,...i?{label:o.type?.toUpperCase(),alignItems:"flex-end"}:{alignItems:"center"}}))}removeScrollListener(){let e=this.shadowRoot?.querySelector(".wallet-list");e&&e.removeEventListener("scroll",()=>this.handleConnectListScroll())}handleConnectListScroll(){let e=this.shadowRoot?.querySelector(".wallet-list");e&&this.updateScrollOpacity(e)}updateScrollOpacity(e){e.style.setProperty("--connect-scroll--top-opacity",h.z8.interpolate([0,tn.SCROLL_THRESHOLD],tn.OPACITY_RANGE,e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",h.z8.interpolate([0,tn.SCROLL_THRESHOLD],tn.OPACITY_RANGE,e.scrollHeight-e.scrollTop-e.offsetHeight).toString())}};tu.styles=ta,tr([(0,a.wk)()],tu.prototype,"currentTab",void 0),tr([(0,a.wk)()],tu.prototype,"namespace",void 0),tr([(0,a.wk)()],tu.prototype,"namespaces",void 0),tr([(0,a.wk)()],tu.prototype,"caipAddress",void 0),tr([(0,a.wk)()],tu.prototype,"profileName",void 0),tr([(0,a.wk)()],tu.prototype,"activeConnectorIds",void 0),tr([(0,a.wk)()],tu.prototype,"lastSelectedAddress",void 0),tr([(0,a.wk)()],tu.prototype,"lastSelectedConnectorId",void 0),tr([(0,a.wk)()],tu.prototype,"isSwitching",void 0),tr([(0,a.wk)()],tu.prototype,"caipNetwork",void 0),tu=tr([(0,h.EM)("w3m-profile-wallets-view")],tu);var tp=i(74236);let th=(0,o.AH)` 2647 :host { 2648 display: flex; 2649 align-items: center; 2650 justify-content: center; 2651 } 2652 2653 label { 2654 position: relative; 2655 display: inline-block; 2656 width: 32px; 2657 height: 22px; 2658 } 2659 2660 input { 2661 width: 0; 2662 height: 0; 2663 opacity: 0; 2664 } 2665 2666 span { 2667 position: absolute; 2668 cursor: pointer; 2669 top: 0; 2670 left: 0; 2671 right: 0; 2672 bottom: 0; 2673 background-color: var(--wui-color-blue-100); 2674 border-width: 1px; 2675 border-style: solid; 2676 border-color: var(--wui-color-gray-glass-002); 2677 border-radius: 999px; 2678 transition: 2679 background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), 2680 border-color var(--wui-ease-inout-power-1) var(--wui-duration-md); 2681 will-change: background-color, border-color; 2682 } 2683 2684 span:before { 2685 position: absolute; 2686 content: ''; 2687 height: 16px; 2688 width: 16px; 2689 left: 3px; 2690 top: 2px; 2691 background-color: var(--wui-color-inverse-100); 2692 transition: transform var(--wui-ease-inout-power-1) var(--wui-duration-lg); 2693 will-change: transform; 2694 border-radius: 50%; 2695 } 2696 2697 input:checked + span { 2698 border-color: var(--wui-color-gray-glass-005); 2699 background-color: var(--wui-color-blue-100); 2700 } 2701 2702 input:not(:checked) + span { 2703 background-color: var(--wui-color-gray-glass-010); 2704 } 2705 2706 input:checked + span:before { 2707 transform: translateX(calc(100% - 7px)); 2708 } 2709`;var tw=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let tg=class extends o.WF{constructor(){super(...arguments),this.inputElementRef=(0,tp._)(),this.checked=void 0}render(){return(0,o.qy)` 2710 <label> 2711 <input 2712 ${(0,tp.K)(this.inputElementRef)} 2713 type="checkbox" 2714 ?checked=${(0,r.J)(this.checked)} 2715 @change=${this.dispatchChangeEvent.bind(this)} 2716 />
2717 <span></span> 2718 </label> 2719 `}dispatchChangeEvent(){this.dispatchEvent(new CustomEvent("switchChange",{detail:this.inputElementRef.value?.checked,bubbles:!0,composed:!0}))}};tg.styles=[w.W5,w.fD,w.ck,th],tw([(0,a.MZ)({type:Boolean})],tg.prototype,"checked",void 0),tg=tw([(0,b.E)("wui-switch")],tg);let tb=(0,o.AH)` 2720 :host { 2721 height: 100%; 2722 } 2723 2724 button { 2725 display: flex; 2726 align-items: center; 2727 justify-content: center; 2728 column-gap: var(--wui-spacing-1xs); 2729 padding: var(--wui-spacing-xs) var(--wui-spacing-s); 2730 background-color: var(--wui-color-gray-glass-002); 2731 border-radius: var(--wui-border-radius-xs); 2732 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); 2733 transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); 2734 will-change: background-color; 2735 cursor: pointer; 2736 } 2737 2738 wui-switch { 2739 pointer-events: none; 2740 } 2741`;var tf=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let tm=class extends o.WF{constructor(){super(...arguments),this.checked=void 0}render(){return(0,o.qy)` 2742 <button> 2743 <wui-icon size="xl" name="walletConnectBrown"></wui-icon> 2744 <wui-switch ?checked=${(0,r.J)(this.checked)}></wui-switch> 2745 </button> 2746 `}};tm.styles=[w.W5,w.fD,tb],tf([(0,a.MZ)({type:Boolean})],tm.prototype,"checked",void 0),tm=tf([(0,b.E)("wui-certified-switch")],tm);let tv=(0,o.AH)` 2747 button { 2748 background-color: var(--wui-color-fg-300); 2749 border-radius: var(--wui-border-radius-4xs); 2750 width: 16px; 2751 height: 16px; 2752 } 2753 2754 button:disabled { 2755 background-color: var(--wui-color-bg-300); 2756 } 2757 2758 wui-icon { 2759 color: var(--wui-color-bg-200) !important; 2760 } 2761 2762 button:focus-visible { 2763 background-color: var(--wui-color-fg-250); 2764 border: 1px solid var(--wui-color-accent-100); 2765 } 2766 2767 @media (hover: hover) and (pointer: fine) { 2768 button:hover:enabled { 2769 background-color: var(--wui-color-fg-250); 2770 } 2771 2772 button:active:enabled { 2773 background-color: var(--wui-color-fg-225); 2774 } 2775 } 2776`;var ty=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let tx=class extends o.WF{constructor(){super(...arguments),this.icon="copy"}render(){return(0,o.qy)` 2777 <button> 2778 <wui-icon color="inherit" size="xxs" name=${this.icon}></wui-icon> 2779 </button> 2780 `}};tx.styles=[w.W5,w.fD,tv],ty([(0,a.MZ)()],tx.prototype,"icon",void 0),tx=ty([(0,b.E)("wui-input-element")],tx),i(39151);let tk=(0,o.AH)` 2781 :host { 2782 position: relative; 2783 display: inline-block; 2784 width: 100%; 2785 } 2786`,tC=class extends o.WF{constructor(){super(...arguments),this.inputComponentRef=(0,tp._)()}render(){return(0,o.qy)` 2787 <wui-input-text 2788 ${(0,tp.K)(this.inputComponentRef)} 2789 placeholder="Search wallet" 2790 icon="search" 2791 type="search" 2792 enterKeyHint="search" 2793 size="sm" 2794 > 2795 <wui-input-element @click=${this.clearValue} icon="close"></wui-input-element> 2796 </wui-input-text> 2797 `}clearValue(){let e=this.inputComponentRef.value,t=e?.inputElementRef.value;t&&(t.value="",t.focus(),t.dispatchEvent(new Event("input")))}};tC.styles=[w.W5,tk],tC=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n}([(0,b.E)("wui-search-bar")],tC);var t$=i(65819),tS=i(65674);i(48252);let tI=(0,o.AH)` 2798 :host { 2799 display: flex; 2800 flex-direction: column; 2801 align-items: center; 2802 width: 104px; 2803 row-gap: var(--wui-spacing-xs); 2804 padding: var(--wui-spacing-xs) 10px; 2805 background-color: var(--wui-color-gray-glass-002); 2806 border-radius: clamp(0px, var(--wui-border-radius-xs), 20px); 2807 position: relative; 2808 } 2809 2810 wui-shimmer[data-type='network'] { 2811 border: none; 2812 -webkit-clip-path: var(--wui-path-network); 2813 clip-path: var(--wui-path-network); 2814 } 2815 2816 svg { 2817 position: absolute; 2818 width: 48px; 2819 height: 54px; 2820 z-index: 1; 2821 } 2822 2823 svg > path { 2824 stroke: var(--wui-color-gray-glass-010); 2825 stroke-width: 1px; 2826 } 2827 2828 @media (max-width: 350px) { 2829 :host { 2830 width: 100%; 2831 } 2832 } 2833`;var tA=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let tE=class extends o.WF{constructor(){super(...arguments),this.type="wallet"}render(){return(0,o.qy)` 2834 ${this.shimmerTemplate()} 2835 <wui-shimmer width="56px" height="20px" borderRadius="xs"></wui-shimmer> 2836 `}shimmerTemplate(){return"network"===this.type?(0,o.qy)` <wui-shimmer 2837 data-type=${this.type} 2838 width="48px" 2839 height="54px" 2840 borderRadius="xs" 2841 ></wui-shimmer> 2842 ${tS.a}`:(0,o.qy)`<wui-shimmer width="56px" height="56px" borderRadius="xs"></wui-shimmer>`}};tE.styles=[w.W5,w.fD,tI],tA([(0,a.MZ)()],tE.prototype,"type",void 0),tE=tA([(0,b.E)("wui-card-select-loader")],tE);let tT=(0,o.AH)` 2843 :host { 2844 display: grid; 2845 width: inherit; 2846 height: inherit; 2847 } 2848`;var tR=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let tW=class extends o.WF{render(){return this.style.cssText=` 2849 grid-template-rows: ${this.gridTemplateRows}; 2850 grid-template-columns: ${this.gridTemplateColumns}; 2851 justify-items: ${this.justifyItems}; 2852 align-items: ${this.alignItems}; 2853 justify-content: ${this.justifyContent}; 2854 align-content: ${this.alignContent}; 2855 column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`}; 2856 row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`}; 2857 gap: ${this.gap&&`var(--wui-spacing-${this.gap})`}; 2858 padding-top: ${this.padding&&g.Z.getSpacingStyles(this.padding,0)}; 2859 padding-right: ${this.padding&&g.Z.getSpacingStyles(this.padding,1)}; 2860 padding-bottom: ${this.padding&&g.Z.getSpacingStyles(this.padding,2)}; 2861 padding-left: ${this.padding&&g.Z.getSpacingStyles(this.padding,3)}; 2862 margin-top: ${this.margin&&g.Z.getSpacingStyles(this.margin,
28620)}; 2863 margin-right: ${this.margin&&g.Z.getSpacingStyles(this.margin,1)}; 2864 margin-bottom: ${this.margin&&g.Z.getSpacingStyles(this.margin,2)}; 2865 margin-left: ${this.margin&&g.Z.getSpacingStyles(this.margin,3)}; 2866 `,(0,o.qy)`<slot></slot>`}};tW.styles=[w.W5,tT],tR([(0,a.MZ)()],tW.prototype,"gridTemplateRows",void 0),tR([(0,a.MZ)()],tW.prototype,"gridTemplateColumns",void 0),tR([(0,a.MZ)()],tW.prototype,"justifyItems",void 0),tR([(0,a.MZ)()],tW.prototype,"alignItems",void 0),tR([(0,a.MZ)()],tW.prototype,"justifyContent",void 0),tR([(0,a.MZ)()],tW.prototype,"alignContent",void 0),tR([(0,a.MZ)()],tW.prototype,"columnGap",void 0),tR([(0,a.MZ)()],tW.prototype,"rowGap",void 0),tR([(0,a.MZ)()],tW.prototype,"gap",void 0),tR([(0,a.MZ)()],tW.prototype,"padding",void 0),tR([(0,a.MZ)()],tW.prototype,"margin",void 0),tW=tR([(0,b.E)("wui-grid")],tW);var tO=i(98782);i(13998),i(47122);let tN=(0,o.AH)` 2867 button { 2868 display: flex; 2869 flex-direction: column; 2870 justify-content: center; 2871 align-items: center; 2872 cursor: pointer; 2873 width: 104px; 2874 row-gap: var(--wui-spacing-xs); 2875 padding: var(--wui-spacing-s) var(--wui-spacing-0); 2876 background-color: var(--wui-color-gray-glass-002); 2877 border-radius: clamp(0px, var(--wui-border-radius-xs), 20px); 2878 transition: 2879 color var(--wui-duration-lg) var(--wui-ease-out-power-1), 2880 background-color var(--wui-duration-lg) var(--wui-ease-out-power-1), 2881 border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1); 2882 will-change: background-color, color, border-radius; 2883 outline: none; 2884 border: none; 2885 } 2886 2887 button > wui-flex > wui-text { 2888 color: var(--wui-color-fg-100); 2889 max-width: 86px; 2890 white-space: nowrap; 2891 overflow: hidden; 2892 text-overflow: ellipsis; 2893 justify-content: center; 2894 } 2895 2896 button > wui-flex > wui-text.certified { 2897 max-width: 66px; 2898 } 2899 2900 button:hover:enabled { 2901 background-color: var(--wui-color-gray-glass-005); 2902 } 2903 2904 button:disabled > wui-flex > wui-text { 2905 color: var(--wui-color-gray-glass-015); 2906 } 2907 2908 [data-selected='true'] { 2909 background-color: var(--wui-color-accent-glass-020); 2910 } 2911 2912 @media (hover: hover) and (pointer: fine) { 2913 [data-selected='true']:hover:enabled { 2914 background-color: var(--wui-color-accent-glass-015); 2915 } 2916 } 2917 2918 [data-selected='true']:active:enabled { 2919 background-color: var(--wui-color-accent-glass-010); 2920 } 2921 2922 @media (max-width: 350px) { 2923 button { 2924 width: 100%; 2925 } 2926 } 2927`;var tM=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let tP=class extends o.WF{constructor(){super(),this.observer=new IntersectionObserver(()=>void 0),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.wallet=void 0,this.observer=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting?(this.visible=!0,this.fetchImageSrc()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){let e=this.wallet?.badge_type==="certified";return(0,o.qy)` 2928 <button> 2929 ${this.imageTemplate()} 2930 <wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="3xs"> 2931 <wui-text 2932 variant="tiny-500" 2933 color="inherit" 2934 class=${(0,r.J)(e?"certified":void 0)} 2935 >${this.wallet?.name}</wui-text 2936 > 2937 ${e?(0,o.qy)`<wui-icon size="sm" name="walletConnectBrown"></wui-icon>`:null} 2938 </wui-flex> 2939 </button> 2940 `}imageTemplate(){return(this.visible||this.imageSrc)&&!this.imageLoading?(0,o.qy)` 2941 <wui-wallet-image 2942 size="md" 2943 imageSrc=${(0,r.J)(this.imageSrc)} 2944 name=${this.wallet?.name} 2945 .installed=${this.wallet?.installed} 2946 badgeSize="sm" 2947 > 2948 </wui-wallet-image> 2949 `:this.shimmerTemplate()}shimmerTemplate(){return(0,o.qy)`<wui-shimmer width="56px" height="56px" borderRadius="xs"></wui-shimmer>`}async fetchImageSrc(){this.wallet&&(this.imageSrc=c.$.getWalletImage(this.wallet),this.imageSrc||(this.imageLoading=!0,this.imageSrc=await c.$.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}};tP.styles=tN,tM([(0,a.wk)()],tP.prototype,"visible",void 0),tM([(0,a.wk)()],tP.prototype,"imageSrc",void 0),tM([(0,a.wk)()],tP.prototype,"imageLoading",void 0),tM([(0,a.MZ)()],tP.prototype,"wallet",void 0),tP=tM([(0,h.EM)("w3m-all-wallets-list-item")],tP);let tj=(0,o.AH)` 2950 wui-grid { 2951 max-height: clamp(360px, 400px, 80vh); 2952 overflow: scroll; 2953 scrollbar-width: none; 2954 grid-auto-rows: min-content; 2955 grid-template-columns: repeat(auto-fill, 104px); 2956 } 2957 2958 @media (max-width: 350px) { 2959 wui-grid { 2960 grid-template-columns: repeat(2, 1fr); 2961 } 2962 } 2963 2964 wui-grid[data-scroll='false'] { 2965 overflow: hidden; 2966 } 2967 2968 wui-grid::-webkit-scrollbar {
2969 display: none; 2970 } 2971 2972 wui-loading-spinner { 2973 padding-top: var(--wui-spacing-l); 2974 padding-bottom: var(--wui-spacing-l); 2975 justify-content: center; 2976 grid-column: 1 / span 4; 2977 } 2978`;var tq=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let tD="local-paginator",tU=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.loading=!t$.N.state.wallets.length,this.wallets=t$.N.state.wallets,this.recommended=t$.N.state.recommended,this.featured=t$.N.state.featured,this.filteredWallets=t$.N.state.filteredWallets,this.unsubscribe.push(t$.N.subscribeKey("wallets",e=>this.wallets=e),t$.N.subscribeKey("recommended",e=>this.recommended=e),t$.N.subscribeKey("featured",e=>this.featured=e),t$.N.subscribeKey("filteredWallets",e=>this.filteredWallets=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.paginationObserver?.disconnect()}render(){return(0,o.qy)` 2979 <wui-grid 2980 data-scroll=${!this.loading} 2981 .padding=${["0","s","s","s"]} 2982 columnGap="xxs" 2983 rowGap="l" 2984 justifyContent="space-between" 2985 > 2986 ${this.loading?this.shimmerTemplate(16):this.walletsTemplate()} 2987 ${this.paginationLoaderTemplate()} 2988 </wui-grid> 2989 `}async initialFetch(){this.loading=!0;let e=this.shadowRoot?.querySelector("wui-grid");e&&(await t$.N.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,t){return[...Array(e)].map(()=>(0,o.qy)` 2990 <wui-card-select-loader type="wallet" id=${(0,r.J)(t)}></wui-card-select-loader> 2991 `)}walletsTemplate(){let e=this.filteredWallets?.length>0?u.w.uniqueBy([...this.featured,...this.recommended,...this.filteredWallets],"id"):u.w.uniqueBy([...this.featured,...this.recommended,...this.wallets],"id");return tO.A.markWalletsAsInstalled(e).map(e=>(0,o.qy)` 2992 <w3m-all-wallets-list-item 2993 @click=${()=>this.onConnectWallet(e)} 2994 .wallet=${e} 2995 ></w3m-all-wallets-list-item> 2996 `)}paginationLoaderTemplate(){let{wallets:e,recommended:t,featured:i,count:o}=t$.N.state,a=window.innerWidth<352?3:4,r=e.length+t.length,n=Math.ceil(r/a)*a-r+a;return(n-=e.length?i.length%a:0,0===o&&i.length>0)?null:0===o||[...i,...e,...t].length<o?this.shimmerTemplate(n,tD):null}createPaginationObserver(){let e=this.shadowRoot?.querySelector(`#${tD}`);e&&(this.paginationObserver=new IntersectionObserver(([e])=>{if(e?.isIntersecting&&!this.loading){let{page:e,count:t,wallets:i}=t$.N.state;i.length<t&&t$.N.fetchWalletsByPage({page:e+1})}}),this.paginationObserver.observe(e))}onConnectWallet(e){V.a.selectWalletConnector(e)}};tU.styles=tj,tq([(0,a.wk)()],tU.prototype,"loading",void 0),tq([(0,a.wk)()],tU.prototype,"wallets",void 0),tq([(0,a.wk)()],tU.prototype,"recommended",void 0),tq([(0,a.wk)()],tU.prototype,"featured",void 0),tq([(0,a.wk)()],tU.prototype,"filteredWallets",void 0),tU=tq([(0,h.EM)("w3m-all-wallets-list")],tU),i(72873);let tL=(0,o.AH)` 2997 wui-grid, 2998 wui-loading-spinner, 2999 wui-flex { 3000 height: 360px; 3001 } 3002 3003 wui-grid { 3004 overflow: scroll; 3005 scrollbar-width: none; 3006 grid-auto-rows: min-content; 3007 grid-template-columns: repeat(auto-fill, 104px); 3008 } 3009 3010 wui-grid[data-scroll='false'] { 3011 overflow: hidden; 3012 } 3013 3014 wui-grid::-webkit-scrollbar {
3015 display: none; 3016 } 3017 3018 wui-loading-spinner { 3019 justify-content: center; 3020 align-items: center; 3021 } 3022 3023 @media (max-width: 350px) { 3024 wui-grid { 3025 grid-template-columns: repeat(2, 1fr); 3026 } 3027 } 3028`;var tz=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let tZ=class extends o.WF{constructor(){super(...arguments),this.prevQuery="",this.prevBadge=void 0,this.loading=!0,this.query=""}render(){return this.onSearch(),this.loading?(0,o.qy)`<wui-loading-spinner color="accent-100"></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 t$.N.searchWallet({search:this.query,badge:this.badge}),this.loading=!1)}walletsTemplate(){let{search:e}=t$.N.state,t=tO.A.markWalletsAsInstalled(e);return e.length?(0,o.qy)` 3029 <wui-grid 3030 data-testid="wallet-list" 3031 .padding=${["0","s","s","s"]} 3032 rowGap="l" 3033 columnGap="xs" 3034 justifyContent="space-between" 3035 > 3036 ${t.map(e=>(0,o.qy)` 3037 <w3m-all-wallets-list-item 3038 @click=${()=>this.onConnectWallet(e)} 3039 .wallet=${e} 3040 data-testid="wallet-search-item-${e.id}" 3041 ></w3m-all-wallets-list-item> 3042 `)} 3043 </wui-grid> 3044 `:(0,o.qy)` 3045 <wui-flex 3046 data-testid="no-wallet-found" 3047 justifyContent="center" 3048 alignItems="center" 3049 gap="s" 3050 flexDirection="column" 3051 > 3052 <wui-icon-box 3053 size="lg" 3054 iconColor="fg-200" 3055 backgroundColor="fg-300" 3056 icon="wallet" 3057 background="transparent" 3058 ></wui-icon-box> 3059 <wui-text data-testid="no-wallet-found-text" color="fg-200" variant="paragraph-500"> 3060 No Wallet found 3061 </wui-text> 3062 </wui-flex> 3063 `}onConnectWallet(e){V.a.selectWalletConnector(e)}};tZ.styles=tL,tz([(0,a.wk)()],tZ.prototype,"loading",void 0),tz([(0,a.MZ)()],tZ.prototype,"query",void 0),tz([(0,a.MZ)()],tZ.prototype,"badge",void 0),tZ=tz([(0,h.EM)("w3m-all-wallets-search")],tZ);var tB=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let tF=class extends o.WF{constructor(){super(...arguments),this.search="",this.onDebouncedSearch=u.w.debounce(e=>{this.search=e})}render(){let e=this.search.length>=2;return(0,o.qy)` 3064 <wui-flex .padding=${["0","s","s","s"]} gap="xs"> 3065 <wui-search-bar @inputChange=${this.onInputChange.bind(this)}></wui-search-bar> 3066 <wui-certified-switch 3067 ?checked=${this.badge} 3068 @click=${this.onClick.bind(this)} 3069 data-testid="wui-certified-switch" 3070 ></wui-certified-switch> 3071 ${this.qrButtonTemplate()} 3072 </wui-flex> 3073 ${e||this.badge?(0,o.qy)`<w3m-all-wallets-search 3074 query=${this.search} 3075 badge=${(0,r.J)(this.badge)} 3076 ></w3m-all-wallets-search>`:(0,o.qy)`<w3m-all-wallets-list badge=${(0,r.J)(this.badge)}></w3m-all-wallets-list>`} 3077 `}onInputChange(e){this.onDebouncedSearch(e.detail)}onClick(){if("certified"===this.badge){this.badge=void 0;return}this.badge="certified",K.P.showSvg("Only WalletConnect certified",{icon:"walletConnectBrown",iconColor:"accent-100"})}qrButtonTemplate(){return u.w.isMobile()?(0,o.qy)` 3078 <wui-icon-box 3079 size="lg" 3080 iconSize="xl" 3081 iconColor="accent-100" 3082 backgroundColor="accent-100" 3083 icon="qrCode" 3084 background="transparent" 3085 border 3086 borderColor="wui-accent-glass-010" 3087 @click=${this.onWalletConnectQr.bind(this)} 3088 ></wui-icon-box> 3089 `:null}onWalletConnectQr(){G.I.push("ConnectingWalletConnect")}};tB([(0,a.wk)()],tF.prototype,"search",void 0),tB([(0,a.wk)()],tF.prototype,"badge",void 0),tF=tB([(0,h.EM)("w3m-all-wallets-view")],tF);var tH=i(14816),t_=i(14098);let tV=(0,o.AH)` 3090 button { 3091 column-gap: var(--wui-spacing-s); 3092 padding: 16.5px var(--wui-spacing-l) 16.5px var(--wui-spacing-xs); 3093 width: 100%; 3094 background-color: var(--wui-color-gray-glass-002); 3095 border-radius: var(--wui-border-radius-xs); 3096 color: var(--wui-color-fg-100); 3097 justify-content: center;
3098 align-items: center; 3099 } 3100 3101 button:disabled { 3102 background-color: var(--wui-color-gray-glass-015); 3103 color: var(--wui-color-gray-glass-015); 3104 } 3105`;var tJ=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let tK=class extends o.WF{constructor(){super(...arguments),this.text="",this.disabled=!1,this.tabIdx=void 0}render(){return(0,o.qy)` 3106 <button ?disabled=${this.disabled} tabindex=${(0,r.J)(this.tabIdx)}> 3107 <wui-text align="center" variant="paragraph-500" color="inherit">${this.text}</wui-text> 3108 </button> 3109 `}};tK.styles=[w.W5,w.fD,tV],tJ([(0,a.MZ)()],tK.prototype,"text",void 0),tJ([(0,a.MZ)({type:Boolean})],tK.prototype,"disabled",void 0),tJ([(0,a.MZ)()],tK.prototype,"tabIdx",void 0),tK=tJ([(0,b.E)("wui-list-button")],tK);var tG=i(99836);i(60567);let tY=(0,o.AH)` 3110 wui-separator { 3111 margin: var(--wui-spacing-s) calc(var(--wui-spacing-s) * -1); 3112 width: calc(100% + var(--wui-spacing-s) * 2); 3113 } 3114 3115 wui-email-input { 3116 width: 100%; 3117 } 3118 3119 form { 3120 width: 100%; 3121 display: block; 3122 position: relative; 3123 } 3124 3125 wui-icon-link, 3126 wui-loading-spinner { 3127 position: absolute; 3128 top: 50%; 3129 transform: translateY(-50%); 3130 } 3131 3132 wui-icon-link { 3133 right: var(--wui-spacing-xs); 3134 } 3135 3136 wui-loading-spinner { 3137 right: var(--wui-spacing-m); 3138 } 3139 3140 wui-text { 3141 margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m); 3142 } 3143`;var tX=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let tQ=class extends o.WF{constructor(){super(...arguments),this.unsubscribe=[],this.formRef=(0,tp._)(),this.email="",this.loading=!1,this.error=""}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.formRef.value?.addEventListener("keydown",e=>{"Enter"===e.key&&this.onSubmitEmail(e)})}render(){return(0,o.qy)` 3144 <form ${(0,tp.K)(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}> 3145 <wui-email-input 3146 @focus=${this.onFocusEvent.bind(this)} 3147 .disabled=${this.loading} 3148 @inputChange=${this.onEmailInputChange.bind(this)} 3149 tabIdx=${(0,r.J)(this.tabIdx)} 3150 > 3151 </wui-email-input> 3152 3153 ${this.submitButtonTemplate()}${this.loadingTemplate()} 3154 <input type="submit" hidden /> 3155 </form> 3156 ${this.templateError()} 3157 `}submitButtonTemplate(){return!this.loading&&this.email.length>3?(0,o.qy)` 3158 <wui-icon-link 3159 size="sm" 3160 icon="chevronRight" 3161 iconcolor="accent-100" 3162 @click=${this.onSubmitEmail.bind(this)} 3163 > 3164 </wui-icon-link> 3165 `:null}loadingTemplate(){return this.loading?(0,o.qy)`<wui-loading-spinner size="md" color="accent-100"></wui-loading-spinner>`:null}templateError(){return this.error?(0,o.qy)`<wui-text variant="tiny-500" color="error-100">${this.error}</wui-text>`:null}onEmailInputChange(e){this.email=e.detail.trim(),this.error=""}async onSubmitEmail(e){if(!_.o.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(e=>e===s.W.state.activeChain)){let e=s.W.getFirstCaipNetworkSupportsAuthConnector();if(e)return void G.I.push("SwitchNetwork",{network:e})}try{if(this.loading)return;this.loading=!0,e.preventDefault();let t=V.a.getAuthConnector();if(!t)throw Error("w3m-email-login-widget: Auth connector not found");let{action:i}=await t.provider.connectEmail({email:this.email});j.E.sendEvent({type:"track",event:"EMAIL_SUBMITTED"}),"VERIFY_OTP"===i?(j.E.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),G.I.push("EmailVerifyOtp",{email:this.email})):"VERIFY_DEVICE"===i?G.I.push("EmailVerifyDevice",{email:this.email}
3165):"CONNECT"===i&&(await Y.x.connectExternal(t,s.W.state.activeChain),G.I.replace("Account"))}catch(t){let e=u.w.parseError(t);e?.includes("Invalid email")?this.error="Invalid email. Try again.":K.P.showError(t)}finally{this.loading=!1}}onFocusEvent(){j.E.sendEvent({type:"track",event:"EMAIL_LOGIN_SELECTED"})}};tQ.styles=tY,tX([(0,a.MZ)()],tQ.prototype,"tabIdx",void 0),tX([(0,a.wk)()],tQ.prototype,"email",void 0),tX([(0,a.wk)()],tQ.prototype,"loading",void 0),tX([(0,a.wk)()],tQ.prototype,"error",void 0),tQ=tX([(0,h.EM)("w3m-email-login-widget")],tQ),i(97102),i(75293);var t0=i(79277),t3=i(33559);i(89188),i(23050);let t1=(0,o.AH)` 3166 :host { 3167 display: block; 3168 width: 100%; 3169 } 3170 3171 button { 3172 width: 100%; 3173 height: 56px; 3174 background: var(--wui-color-gray-glass-002); 3175 border-radius: var(--wui-border-radius-xs); 3176 } 3177`;var t5=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let t2=class extends o.WF{constructor(){super(...arguments),this.logo="google",this.disabled=!1,this.tabIdx=void 0}render(){return(0,o.qy)` 3178 <button ?disabled=${this.disabled} tabindex=${(0,r.J)(this.tabIdx)}> 3179 <wui-logo logo=${this.logo}></wui-logo> 3180 </button> 3181 `}};t2.styles=[w.W5,w.fD,t1],t5([(0,a.MZ)()],t2.prototype,"logo",void 0),t5([(0,a.MZ)({type:Boolean})],t2.prototype,"disabled",void 0),t5([(0,a.MZ)()],t2.prototype,"tabIdx",void 0),t2=t5([(0,b.E)("wui-logo-select")],t2);var t4=i(70558);let t6=(0,o.AH)` 3182 wui-separator { 3183 margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-m) 3184 calc(var(--wui-spacing-m) * -1); 3185 width: calc(100% + var(--wui-spacing-s) * 2); 3186 } 3187`;var t7=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let t8=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.walletGuide="get-started",this.tabIdx=void 0,this.connectors=V.a.state.connectors,this.remoteFeatures=n.H.state.remoteFeatures,this.authConnector=this.connectors.find(e=>"AUTH"===e.type),this.isPwaLoading=!1,this.unsubscribe.push(V.a.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(e=>"AUTH"===e.type)}),n.H.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}connectedCallback(){super.connectedCallback(),this.handlePwaFrameLoad()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,o.qy)` 3188 <wui-flex 3189 class="container" 3190 flexDirection="column" 3191 gap="xs" 3192 data-testid="w3m-social-login-widget" 3193 > 3194 ${this.topViewTemplate()}${this.bottomViewTemplate()} 3195 </wui-flex> 3196 `}topViewTemplate(){let e="explore"===this.walletGuide,t=this.remoteFeatures?.socials;return!t&&e?(t=J.oU.DEFAULT_SOCIALS,this.renderTopViewContent(t)):t?this.renderTopViewContent(t):null}renderTopViewContent(e){return 2===e.length?(0,o.qy)` <wui-flex gap="xs"> 3197 ${e.slice(0,2).map(e=>(0,o.qy)`<wui-logo-select 3198 data-testid=${`social-selector-${e}`} 3199 @click=${()=>{this.onSocialClick(e)}} 3200 logo=${e} 3201 tabIdx=${(0,r.J)(this.tabIdx)} 3202 ?disabled=${this.isPwaLoading} 3203 ></wui-logo-select>`)} 3204 </wui-flex>`:(0,o.qy)` <wui-list-social 3205 data-testid=${`social-selector-${e[0]}`} 3206 @click=${()=>{this.onSocialClick(e[0])}} 3207 logo=${(0,r.J)(e[0])} 3208 align="center" 3209 name=${`Continue with ${e[0]}`} 3210 tabIdx=${(0,r.J)(this.tabIdx)} 3211 ?disabled=${this.isPwaLoading} 3212 ></wui-list-social>`}bottomViewTemplate(){let e=this.remoteFeatures?.socials,t="explore"===this.walletGuide;return(this.authConnector&&e&&0!==e.length||!t||(e=J.oU.DEFAULT_SOCIALS),!e||e.length<=2)?null:e&&e.length>6?(0,o.qy)`<wui-flex gap="xs"> 3213 ${e.slice(1,5).map(e=>(0,o.qy)`<wui-logo-select 3214 data-testid=${`social-selector-${e}`} 3215 @click=${()=>{this.onSocialClick(e)}} 3216 logo=${e} 3217 tabIdx=${(0,r.J)(this.tabIdx)} 3218 ?focusable=${void 0!==this.tabIdx&&this.tabIdx>=0} 3219 ?disabled=${this.isPwaLoading} 3220 ></wui-logo-select>`)} 3221 <wui-logo-select 3222 logo="more" 3223 tabIdx=${(0,r.J)(this.tabIdx)} 3224 @click=${this.onMoreSocialsClick.bind(this)} 3225 ?disabled=${this.isPwaLoading} 3226 data-testid="social-selector-more" 3227 ></wui-logo-select> 3228 </wui-flex>`:e?(0,o.qy)`<wui-flex gap="xs"> 3229 ${e.slice(1,e.length).map(e=>(0,o.qy)`<wui-logo-select 3230 data-testid=${`social-selector-${e}`} 3231 @click=${()=>{this.onSocialClick(e)}} 3232 logo=${e} 3233 tabIdx=${(0,r.J)(this.tabIdx)} 3234 ?focusable=${void 0!==this.tabIdx&&this.tabIdx>=0} 3235 ?disabled=${this.isPwaLoading} 3236 ></wui-logo-select>`)} 3237 </wui-flex>`:null}onMoreSocialsClick(){G.I.push("ConnectSocials")}async onSocialClick(e){if(!_.o.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(e=>e===s.W.state.activeChain)){let e=s.W.getFirstCaipNetworkSupportsAuthConnector();if(e)return void G.I.push("SwitchNetwork",{network:e})}e&&await (0,t3.Up)(e)}async handlePwaFrameLoad(){if(u.w.isPWA()){this.isPwaLoading=!0;try{this.authConnector?.provider instanceof t4.Y&&await this.authConnector.provider.init()}catch(e){t0.h.open({shortMessage:"Error loading embedded wallet in PWA",longMessage:e.message},"error")}finally{this.isPwaLoading=!1}}}};t8.styles=t6,t7([(0,a.MZ)()],t8.prototype,"walletGuide",void 0),t7([(0,a.MZ)()],t8.prototype,"tabIdx",void 0),t7([(0,a.wk)()],t8.prototype,"connectors",void 0),t7([(0,a.wk)()],t8.prototype,"remoteFeatures",void 0),t7([(0,a.wk)()],t8.prototype,"authConnector",void 0),t7([(0,a.wk)()],t8.prototype,"isPwaLoading",void 0),t8=t7([(0,h.EM)("w3m-social-login-widget")],t8),i(50196);let t9=(0,o.AH)` 3238 wui-flex { 3239 width: 100%; 3240 } 3241 3242 .wallet-guide { 3243 width: 100%; 3244 } 3245 3246 .chip-box { 3247 width: fit-content; 3248 background-color: var(--wui-color-gray-glass-005); 3249 border-radius: var(--wui-border-radius-3xl); 3250 } 3251`;var ie=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let it=class extends o.WF{constructor(){super(...arguments),this.walletGuide="get-started"}render(){return"explore"===this.walletGuide?(0,o.qy)`<wui-flex 3252 class="wallet-guide" 3253 flexDirection="column" 3254 alignItems="center" 3255 justifyContent="center" 3256 rowGap="xs" 3257 data-testid="w3m-wallet-guide-explore" 3258 > 3259 <wui-text variant="small-400" color="fg-200" align="center"> 3260 Looking for a self-custody wallet? 3261 </wui-text> 3262 3263 <wui-flex class="chip-box"> 3264 <wui-chip 3265 imageIcon="walletConnectLightBrown" 3266 icon="externalLink" 3267 variant="transparent" 3268 href="https://walletguide.walletconnect.network" 3269 title="Find one on WalletGuide" 3270 ></wui-chip> 3271 </wui-flex> 3272 </wui-flex>`:(0,o.qy)`<wui-flex 3273 columnGap="4xs" 3274 flexDirection="row" 3275 alignItems="center" 3276 justifyContent="center" 3277 .padding=${["s","0","s","0"]} 3278 > 3279 <wui-text variant="small-400" class="title" color="fg-200" 3280 >Haven't got a wallet?</wui-text 3281 > 3282 <wui-link 3283 data-testid="w3m-wallet-guide-get-started" 3284 color="blue-100" 3285 class="get-started-link" 3286 @click=${this.onGetStarted} 3287 tabIdx=${(0,r.J)(this.tabIdx)} 3288 > 3289 Get started 3290 </wui-link> 3291 </wui-flex>`}onGetStarted(){G.I.push("Create")}};it.styles=t9,ie([(0,a.MZ)()],it.prototype,"tabIdx",void 0),ie([(0,a.MZ)()],it.prototype,"walletGuide",void 0),it=ie([(0,h.EM)("w3m-wallet-guide")],it);let ii=(0,o.AH)` 3292 :host { 3293 position: relative; 3294 border-radius: var(--wui-border-radius-xxs); 3295 width: 40px; 3296 height: 40px; 3297 overflow: hidden; 3298 background: var(--wui-color-gray-glass-002); 3299 display: flex; 3300 justify-content: center;
3301 align-items: center; 3302 flex-wrap: wrap; 3303 gap: var(--wui-spacing-4xs); 3304 padding: 3.75px !important; 3305 } 3306 3307 :host::after { 3308 content: ''; 3309 position: absolute; 3310 top: 0; 3311 bottom: 0; 3312 left: 0; 3313 right: 0; 3314 border-radius: inherit; 3315 border: 1px solid var(--wui-color-gray-glass-010); 3316 pointer-events: none; 3317 } 3318 3319 :host > wui-wallet-image { 3320 width: 14px; 3321 height: 14px; 3322 border-radius: var(--wui-border-radius-5xs); 3323 } 3324 3325 :host > wui-flex { 3326 padding: 2px; 3327 position: fixed; 3328 overflow: hidden; 3329 left: 34px; 3330 bottom: 8px; 3331 background: var(--dark-background-150, #1e1f1f); 3332 border-radius: 50%; 3333 z-index: 2; 3334 display: flex; 3335 } 3336`;var io=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let ia=class extends o.WF{constructor(){super(...arguments),this.walletImages=[]}render(){let e=this.walletImages.length<4;return(0,o.qy)`${this.walletImages.slice(0,4).map(({src:e,walletName:t})=>(0,o.qy)` 3337 <wui-wallet-image 3338 size="inherit" 3339 imageSrc=${e} 3340 name=${(0,r.J)(t)} 3341 ></wui-wallet-image> 3342 `)} 3343 ${e?[...Array(4-this.walletImages.length)].map(()=>(0,o.qy)` <wui-wallet-image size="inherit" name=""></wui-wallet-image>`):null} 3344 <wui-flex> 3345 <wui-icon-box 3346 size="xxs" 3347 iconSize="xxs" 3348 iconcolor="success-100" 3349 backgroundcolor="success-100" 3350 icon="checkmark" 3351 background="opaque" 3352 ></wui-icon-box> 3353 </wui-flex>`}};ia.styles=[w.W5,ii],io([(0,a.MZ)({type:Array})],ia.prototype,"walletImages",void 0),ia=io([(0,b.E)("wui-all-wallets-image")],ia);let ir=(0,o.AH)` 3354 button { 3355 column-gap: var(--wui-spacing-s); 3356 padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); 3357 width: 100%; 3358 background-color: var(--wui-color-gray-glass-002); 3359 border-radius: var(--wui-border-radius-xs); 3360 color: var(--wui-color-fg-100); 3361 } 3362 3363 button > wui-text:nth-child(2) { 3364 display: flex; 3365 flex: 1; 3366 } 3367 3368 button:disabled { 3369 background-color: var(--wui-color-gray-glass-015); 3370 color: var(--wui-color-gray-glass-015); 3371 } 3372 3373 button:disabled > wui-tag { 3374 background-color: var(--wui-color-gray-glass-010); 3375 color: var(--wui-color-fg-300); 3376 } 3377 3378 wui-icon { 3379 color: var(--wui-color-fg-200) !important; 3380 } 3381`;var is=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let il=class extends o.WF{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.tabIdx=void 0,this.installed=!1,this.disabled=!1,this.showAllWallets=!1,this.loading=!1,this.loadingSpinnerColor="accent-100"}render(){return(0,o.qy)` 3382 <button ?disabled=${this.disabled} tabindex=${(0,r.J)(this.tabIdx)}> 3383 ${this.templateAllWallets()} ${this.templateWalletImage()} 3384 <wui-text variant="paragraph-500" color="inherit">${this.name}</wui-text> 3385 ${this.templateStatus()} 3386 </button> 3387 `}templateAllWallets(){return this.showAllWallets&&this.imageSrc?(0,o.qy)` <wui-all-wallets-image .imageeSrc=${this.imageSrc}> </wui-all-wallets-image> `:this.showAllWallets&&this.walletIcon?(0,o.qy)` <wui-wallet-image .walletIcon=${this.walletIcon} size="sm"> </wui-wallet-image> `:null}templateWalletImage(){return!this.showAllWallets&&this.imageSrc?(0,o.qy)`<wui-wallet-image 3388 size="sm" 3389 imageSrc=${this.imageSrc} 3390 name=${this.name} 3391 .installed=${this.installed} 3392 ></wui-wallet-image>`:this.showAllWallets||this.imageSrc?null:(0,o.qy)`<wui-wallet-image size="sm" name=${this.name}></wui-wallet-image>`}templateStatus(){return this.loading?(0,o.qy)`<wui-loading-spinner 3393 size="lg" 3394 color=${this.loadingSpinnerColor} 3395 ></wui-loading-spinner>`:this.tagLabel&&this.tagVariant?(0,o.qy)`<wui-tag variant=${this.tagVariant}>${this.tagLabel}</wui-tag>`:this.icon?(0,o.qy)`<wui-icon color="inherit" size="sm" name=${this.icon}></wui-icon>`:null}};il.styles=[w.W5,w.fD,ir],is([(0,a.MZ)({type:Array})],il.prototype,"walletImages",void 0),is([(0,a.MZ)()],il.prototype,"imageSrc",void 0),is([(0,a.MZ)()],il.prototype,"name",void 0),is([(0,a.MZ)()],il.prototype,"tagLabel",void 0),is([(0,a.MZ)()],il.prototype,"tagVariant",void 0),is([(0,a.MZ)()],il.prototype,"icon",void 0),is([(0,a.MZ)()],il.prototype,"walletIcon",void 0),is([(0,a.MZ)()],il.prototype,"tabIdx",void 0),is([(0,a.MZ)({type:Boolean})],il.prototype,"installed",void 0),is([(0,a.MZ)({type:Boolean})],il.prototype,"disabled",void 0),is([(0,a.MZ)({type:Boolean})],il.prototype,"showAllWallets",void 0),is([(0,a.MZ)({type:Boolean})],il.prototype,"loading",void 0),is([(0,a.MZ)({type:String})],il.prototype,"loadingSpinnerColor",void 0),il=is([(0,b.E)("wui-list-wallet")],il);var ic=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let id=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=V.a.state.connectors,this.count=t$.N.state.count,this.filteredCount=t$.N.state.filteredWallets.length,this.isFetchingRecommendedWallets=t$.N.state.isFetchingRecommendedWallets,this.unsubscribe.push(V.a.subscribeKey("connectors",e=>this.connectors=e),t$.N.subscribeKey("count",e=>this.count=e),t$.N.subscribeKey("filteredWallets",e=>this.filteredCount=e.length),t$.N.subscribeKey("isFetchingRecommendedWallets",e=>this.isFetchingRecommendedWallets=e))}
3395disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.connectors.find(e=>"walletConnect"===e.id),{allWallets:t}=n.H.state;if(!e||"HIDE"===t||"ONLY_MOBILE"===t&&!u.w.isMobile())return null;let i=t$.N.state.featured.length,a=this.count+i,s=a<10?a:10*Math.floor(a/10),l=this.filteredCount>0?this.filteredCount:s,c=`${l}`;return this.filteredCount>0?c=`${this.filteredCount}`:l<a&&(c=`${l}+`),(0,o.qy)` 3396 <wui-list-wallet 3397 name="All Wallets" 3398 walletIcon="allWallets" 3399 showAllWallets 3400 @click=${this.onAllWallets.bind(this)} 3401 tagLabel=${c} 3402 tagVariant="shade" 3403 data-testid="all-wallets" 3404 tabIdx=${(0,r.J)(this.tabIdx)} 3405 .loading=${this.isFetchingRecommendedWallets} 3406 loadingSpinnerColor=${this.isFetchingRecommendedWallets?"fg-300":"accent-100"} 3407 ></wui-list-wallet> 3408 `}onAllWallets(){j.E.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),G.I.push("AllWallets")}};ic([(0,a.MZ)()],id.prototype,"tabIdx",void 0),ic([(0,a.wk)()],id.prototype,"connectors",void 0),ic([(0,a.wk)()],id.prototype,"count",void 0),ic([(0,a.wk)()],id.prototype,"filteredCount",void 0),ic([(0,a.wk)()],id.prototype,"isFetchingRecommendedWallets",void 0),id=ic([(0,h.EM)("w3m-all-wallets-widget")],id);var iu=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let ip=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=V.a.state.connectors,this.unsubscribe.push(V.a.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.connectors.filter(e=>"ANNOUNCED"===e.type);return e?.length?(0,o.qy)` 3409 <wui-flex flexDirection="column" gap="xs"> 3410 ${e.filter(ti.g.showConnector).map(e=>(0,o.qy)` 3411 <wui-list-wallet 3412 imageSrc=${(0,r.J)(c.$.getConnectorImage(e))} 3413 name=${e.name??"Unknown"} 3414 @click=${()=>this.onConnector(e)} 3415 tagVariant="success" 3416 tagLabel="installed" 3417 data-testid=${`wallet-selector-${e.id}`} 3418 .installed=${!0} 3419 tabIdx=${(0,r.J)(this.tabIdx)} 3420 > 3421 </wui-list-wallet> 3422 `)} 3423 </wui-flex> 3424 `:(this.style.cssText="display: none",null)}onConnector(e){"walletConnect"===e.id?u.w.isMobile()?G.I.push("AllWallets"):G.I.push("ConnectingWalletConnect"):G.I.push("ConnectingExternal",{connector:e})}};iu([(0,a.MZ)()],ip.prototype,"tabIdx",void 0),iu([(0,a.wk)()],ip.prototype,"connectors",void 0),ip=iu([(0,h.EM)("w3m-connect-announced-widget")],ip);var ih=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let iw=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=V.a.state.connectors,this.loading=!1,this.unsubscribe.push(V.a.subscribeKey("connectors",e=>this.connectors=e)),u.w.isTelegram()&&u.w.isIos()&&(this.loading=!Y.x.state.wcUri,this.unsubscribe.push(Y.x.subscribeKey("wcUri",e=>this.loading=!e)))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{customWallets:e}=n.H.state;if(!e?.length)return this.style.cssText="display: none",null;let t=this.filterOutDuplicateWallets(e);return(0,o.qy)`<wui-flex flexDirection="column" gap="xs"> 3425 ${t.map(e=>(0,o.qy)` 3426 <wui-list-wallet 3427 imageSrc=${(0,r.J)(c.$.getWalletImage(e))} 3428 name=${e.name??"Unknown"} 3429 @click=${()=>this.onConnectWallet(e)} 3430 data-testid=${`wallet-selector-${e.id}`} 3431 tabIdx=${(0,r.J)(this.tabIdx)} 3432 ?loading=${this.loading} 3433 > 3434 </wui-list-wallet> 3435 `)} 3436 </wui-flex>`}filterOutDuplicateWallets(e){let t=eo.i.getRecentWallets(),i=this.connectors.map(e=>
3436e.info?.rdns).filter(Boolean),o=t.map(e=>e.rdns).filter(Boolean),a=i.concat(o);if(a.includes("io.metamask.mobile")&&u.w.isMobile()){let e=a.indexOf("io.metamask.mobile");a[e]="io.metamask"}return e.filter(e=>!a.includes(String(e?.rdns)))}onConnectWallet(e){this.loading||G.I.push("ConnectingWalletConnect",{wallet:e})}};ih([(0,a.MZ)()],iw.prototype,"tabIdx",void 0),ih([(0,a.wk)()],iw.prototype,"connectors",void 0),ih([(0,a.wk)()],iw.prototype,"loading",void 0),iw=ih([(0,h.EM)("w3m-connect-custom-widget")],iw);var ig=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let ib=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=V.a.state.connectors,this.unsubscribe.push(V.a.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.connectors.filter(e=>"EXTERNAL"===e.type).filter(ti.g.showConnector).filter(e=>e.id!==_.o.CONNECTOR_ID.COINBASE_SDK);return e?.length?(0,o.qy)` 3437 <wui-flex flexDirection="column" gap="xs"> 3438 ${e.map(e=>(0,o.qy)` 3439 <wui-list-wallet 3440 imageSrc=${(0,r.J)(c.$.getConnectorImage(e))} 3441 .installed=${!0} 3442 name=${e.name??"Unknown"} 3443 data-testid=${`wallet-selector-external-${e.id}`} 3444 @click=${()=>this.onConnector(e)} 3445 tabIdx=${(0,r.J)(this.tabIdx)} 3446 > 3447 </wui-list-wallet> 3448 `)} 3449 </wui-flex> 3450 `:(this.style.cssText="display: none",null)}onConnector(e){G.I.push("ConnectingExternal",{connector:e})}};ig([(0,a.MZ)()],ib.prototype,"tabIdx",void 0),ig([(0,a.wk)()],ib.prototype,"connectors",void 0),ib=ig([(0,h.EM)("w3m-connect-external-widget")],ib);var im=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let iv=class extends o.WF{constructor(){super(...arguments),this.tabIdx=void 0,this.wallets=[]}render(){return this.wallets.length?(0,o.qy)` 3451 <wui-flex flexDirection="column" gap="xs"> 3452 ${this.wallets.map(e=>(0,o.qy)` 3453 <wui-list-wallet 3454 data-testid=${`wallet-selector-featured-${e.id}`} 3455 imageSrc=${(0,r.J)(c.$.getWalletImage(e))} 3456 name=${e.name??"Unknown"} 3457 @click=${()=>this.onConnectWallet(e)} 3458 tabIdx=${(0,r.J)(this.tabIdx)} 3459 > 3460 </wui-list-wallet> 3461 `)} 3462 </wui-flex> 3463 `:(this.style.cssText="display: none",null)}onConnectWallet(e){V.a.selectWalletConnector(e)}};im([(0,a.MZ)()],iv.prototype,"tabIdx",void 0),im([(0,a.MZ)()],iv.prototype,"wallets",void 0),iv=im([(0,h.EM)("w3m-connect-featured-widget")],iv);var iy=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let ix=class extends o.WF{constructor(){super(...arguments),this.tabIdx=void 0,this.connectors=[]}render(){let e=this.connectors.filter(ti.g.showConnector);return 0===e.length?(this.style.cssText="display: none",null):(0,o.qy)` 3464 <wui-flex flexDirection="column" gap="xs"> 3465 ${e.map(e=>(0,o.qy)` 3466 <wui-list-wallet 3467 imageSrc=${(0,r.J)(c.$.getConnectorImage(e))} 3468 .installed=${!0} 3469 name=${e.name??"Unknown"} 3470 tagVariant="success" 3471 tagLabel="installed" 3472 data-testid=${`wallet-selector-${e.id}`} 3473 @click=${()=>this.onConnector(e)} 3474 tabIdx=${(0,r.J)(this.tabIdx)} 3475 > 3476 </wui-list-wallet> 3477 `)} 3478 </wui-flex> 3479 `}onConnector(e){V.a.setActiveConnector(e),G.I.push("ConnectingExter
3479nal",{connector:e})}};iy([(0,a.MZ)()],ix.prototype,"tabIdx",void 0),iy([(0,a.MZ)()],ix.prototype,"connectors",void 0),ix=iy([(0,h.EM)("w3m-connect-injected-widget")],ix);var ik=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let iC=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=V.a.state.connectors,this.unsubscribe.push(V.a.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.connectors.filter(e=>"MULTI_CHAIN"===e.type&&"WalletConnect"!==e.name);return e?.length?(0,o.qy)` 3480 <wui-flex flexDirection="column" gap="xs"> 3481 ${e.map(e=>(0,o.qy)` 3482 <wui-list-wallet 3483 imageSrc=${(0,r.J)(c.$.getConnectorImage(e))} 3484 .installed=${!0} 3485 name=${e.name??"Unknown"} 3486 tagVariant="shade" 3487 tagLabel="multichain" 3488 data-testid=${`wallet-selector-${e.id}`} 3489 @click=${()=>this.onConnector(e)} 3490 tabIdx=${(0,r.J)(this.tabIdx)} 3491 > 3492 </wui-list-wallet> 3493 `)} 3494 </wui-flex> 3495 `:(this.style.cssText="display: none",null)}onConnector(e){V.a.setActiveConnector(e),G.I.push("ConnectingMultiChain")}};ik([(0,a.MZ)()],iC.prototype,"tabIdx",void 0),ik([(0,a.wk)()],iC.prototype,"connectors",void 0),iC=ik([(0,h.EM)("w3m-connect-multi-chain-widget")],iC);var i$=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let iS=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=V.a.state.connectors,this.loading=!1,this.unsubscribe.push(V.a.subscribeKey("connectors",e=>this.connectors=e)),u.w.isTelegram()&&u.w.isIos()&&(this.loading=!Y.x.state.wcUri,this.unsubscribe.push(Y.x.subscribeKey("wcUri",e=>this.loading=!e)))}render(){let e=eo.i.getRecentWallets().filter(e=>!tO.A.isExcluded(e)).filter(e=>!this.hasWalletConnector(e)).filter(e=>this.isWalletCompatibleWithCurrentChain(e));return e.length?(0,o.qy)` 3496 <wui-flex flexDirection="column" gap="xs"> 3497 ${e.map(e=>(0,o.qy)` 3498 <wui-list-wallet 3499 imageSrc=${(0,r.J)(c.$.getWalletImage(e))} 3500 name=${e.name??"Unknown"} 3501 @click=${()=>this.onConnectWallet(e)} 3502 tagLabel="recent" 3503 tagVariant="shade" 3504 tabIdx=${(0,r.J)(this.tabIdx)} 3505 ?loading=${this.loading} 3506 > 3507 </wui-list-wallet> 3508 `)} 3509 </wui-flex> 3510 `:(this.style.cssText="display: none",null)}onConnectWallet(e){this.loading||V.a.selectWalletConnector(e)}hasWalletConnector(e){return this.connectors.some(t=>t.id===e.id||t.name===e.name)}isWalletCompatibleWithCurrentChain(e){let t=s.W.state.activeChain;return!t||!e.chains||e.chains.some(e=>t===e.split(":")[0])}};i$([(0,a.MZ)()],iS.prototype,"tabIdx",void 0),i$([(0,a.wk)()],iS.prototype,"connectors",void 0),i$([(0,a.wk)()],iS.prototype,"loading",void 0),iS=i$([(0,h.EM)("w3m-connect-recent-widget")],iS);var iI=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let iA=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.wallets=[],this.loading=!1,u.w.isTelegram()&&u.w.isIos()&&(this.loading=!Y.x.state.wcUri,this.unsubscribe.push(Y.x.subscribeKey("wcUri",e=>this.loading=!e)))}render(){let{connectors:e}=V.a.state,{customWallets:t,featuredWalletIds:i}=n.H.state,a=eo.i.getRecentWallets(),s=e.find(e=>"walletConnect"===e.id),l=e.filter(e=>"INJECTED"===e.type||"ANNOUNCED"===e.type||"MULTI_CHAIN"===e.type).filter(e=>"Browser Wallet"!==e.name);if(!s)return null;if(i||t||!this.wallets.length)return this.style.cssText="display: none",null;let d=Math.max(0,2-(l.length+a.length)),u=tO.A.filterOutDuplicateWallets(this.wallets).slice(0,d);return u.length?(0,o.qy)` 3511 <wui-flex flexDirection="column" gap="xs"> 3512 ${u.map(e=>(0,o.qy)` 3513 <wui-list-wallet 3514 imageSrc=${(0,r.J)(c.$.getWalletImage(e))} 3515 name=${e?.name??"Unknown"} 3516 @click=${()=>this.onConnectWallet(e)} 3517 tabIdx=${(0,r.J)(this.tabIdx)} 3518 ?loading=${this.loading} 3519 > 3520 </wui-list-wallet> 3521 `)} 3522 </wui-flex> 3523 `:(this.style.cssText="display: none",null)}onConnectWallet(e){if(this.loading)return;let t=V.a.getConnector(e.id,e.rdns);
3523t?G.I.push("ConnectingExternal",{connector:t}):G.I.push("ConnectingWalletConnect",{wallet:e})}};iI([(0,a.MZ)()],iA.prototype,"tabIdx",void 0),iI([(0,a.MZ)()],iA.prototype,"wallets",void 0),iI([(0,a.wk)()],iA.prototype,"loading",void 0),iA=iI([(0,h.EM)("w3m-connect-recommended-widget")],iA);var iE=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let iT=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=V.a.state.connectors,this.connectorImages=l.j.state.connectorImages,this.unsubscribe.push(V.a.subscribeKey("connectors",e=>this.connectors=e),l.j.subscribeKey("connectorImages",e=>this.connectorImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(u.w.isMobile())return this.style.cssText="display: none",null;let e=this.connectors.find(e=>"walletConnect"===e.id);if(!e)return this.style.cssText="display: none",null;let t=e.imageUrl||this.connectorImages[e?.imageId??""];return(0,o.qy)` 3524 <wui-list-wallet 3525 imageSrc=${(0,r.J)(t)} 3526 name=${e.name??"Unknown"} 3527 @click=${()=>this.onConnector(e)} 3528 tagLabel="qr code" 3529 tagVariant="main" 3530 tabIdx=${(0,r.J)(this.tabIdx)} 3531 data-testid="wallet-selector-walletconnect" 3532 > 3533 </wui-list-wallet> 3534 `}onConnector(e){V.a.setActiveConnector(e),G.I.push("ConnectingWalletConnect")}};iE([(0,a.MZ)()],iT.prototype,"tabIdx",void 0),iE([(0,a.wk)()],iT.prototype,"connectors",void 0),iE([(0,a.wk)()],iT.prototype,"connectorImages",void 0),iT=iE([(0,h.EM)("w3m-connect-walletconnect-widget")],iT);let iR=(0,o.AH)` 3535 :host { 3536 margin-top: var(--wui-spacing-3xs); 3537 } 3538 wui-separator { 3539 margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs) 3540 calc(var(--wui-spacing-m) * -1); 3541 width: calc(100% + var(--wui-spacing-s) * 2); 3542 } 3543`;var iW=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let iO=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=V.a.state.connectors,this.recommended=t$.N.state.recommended,this.featured=t$.N.state.featured,this.unsubscribe.push(V.a.subscribeKey("connectors",e=>this.connectors=e),t$.N.subscribeKey("recommended",e=>this.recommended=e),t$.N.subscribeKey("featured",e=>this.featured=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,o.qy)` 3544 <wui-flex flexDirection="column" gap="xs"> ${this.connectorListTemplate()} </wui-flex> 3545 `}connectorListTemplate(){let{custom:e,recent:t,announced:i,injected:a,multiChain:n,recommended:s,featured:l,external:c}=ti.g.getConnectorsByType(this.connectors,this.recommended,this.featured);return ti.g.getConnectorTypeOrder({custom:e,recent:t,announced:i,injected:a,multiChain:n,recommended:s,featured:l,external:c}).map(e=>{switch(e){case"injected":return(0,o.qy)` 3546 ${n.length?(0,o.qy)`<w3m-connect-multi-chain-widget 3547 tabIdx=${(0,r.J)(this.tabIdx)} 3548 ></w3m-connect-multi-chain-widget>`:null} 3549 ${i.length?(0,o.qy)`<w3m-connect-announced-widget 3550 tabIdx=${(0,r.J)(this.tabIdx)} 3551 ></w3m-connect-announced-widget>`:null} 3552 ${a.length?(0,o.qy)`<w3m-connect-injected-widget 3553 .connectors=${a} 3554 tabIdx=${(0,r.J)(this.tabIdx)} 3555 ></w3m-connect-injected-widget>`:null} 3556 `;case"walletConnect":return(0,o.qy)`<w3m-connect-walletconnect-widget 3557 tabIdx=${(0,r.J)(this.tabIdx)} 3558 ></w3m-connect-walletconnect-widget>`;case"recent":return(0,o.qy)`<w3m-connect-recent-widget 3559 tabIdx=${(0,r.J)(this.tabIdx)} 3560 ></w3m-connect-recent-widget>`;case"featured":return(0,o.qy)`<w3m-connect-featured-widget 3561 .wallets=${l} 3562 tabIdx=${(0,r.J)(this.tabIdx)} 3563 ></w3m-connect-featured-widget>`;
3563case"custom":return(0,o.qy)`<w3m-connect-custom-widget 3564 tabIdx=${(0,r.J)(this.tabIdx)} 3565 ></w3m-connect-custom-widget>`;case"external":return(0,o.qy)`<w3m-connect-external-widget 3566 tabIdx=${(0,r.J)(this.tabIdx)} 3567 ></w3m-connect-external-widget>`;case"recommended":return(0,o.qy)`<w3m-connect-recommended-widget 3568 .wallets=${s} 3569 tabIdx=${(0,r.J)(this.tabIdx)} 3570 ></w3m-connect-recommended-widget>`;default:return console.warn(`Unknown connector type: ${e}`),null}})}};iO.styles=iR,iW([(0,a.MZ)()],iO.prototype,"tabIdx",void 0),iW([(0,a.wk)()],iO.prototype,"connectors",void 0),iW([(0,a.wk)()],iO.prototype,"recommended",void 0),iW([(0,a.wk)()],iO.prototype,"featured",void 0),iO=iW([(0,h.EM)("w3m-connector-list")],iO);var iN=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let iM=class extends o.WF{constructor(){super(...arguments),this.tabIdx=void 0}render(){return(0,o.qy)` 3571 <wui-flex flexDirection="column" gap="xs"> 3572 <w3m-connector-list tabIdx=${(0,r.J)(this.tabIdx)}></w3m-connector-list> 3573 <w3m-all-wallets-widget tabIdx=${(0,r.J)(this.tabIdx)}></w3m-all-wallets-widget> 3574 </wui-flex> 3575 `}};iN([(0,a.MZ)()],iM.prototype,"tabIdx",void 0),iM=iN([(0,h.EM)("w3m-wallet-login-list")],iM);let iP=(0,o.AH)` 3576 :host { 3577 --connect-scroll--top-opacity: 0; 3578 --connect-scroll--bottom-opacity: 0; 3579 --connect-mask-image: none; 3580 } 3581 3582 .connect { 3583 max-height: clamp(360px, 470px, 80vh); 3584 scrollbar-width: none; 3585 overflow-y: scroll; 3586 overflow-x: hidden; 3587 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 3588 will-change: opacity; 3589 mask-image: var(--connect-mask-image); 3590 } 3591 3592 .guide { 3593 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 3594 will-change: opacity; 3595 } 3596 3597 .connect::-webkit-scrollbar {
3598 display: none; 3599 } 3600 3601 .all-wallets { 3602 flex-flow: column; 3603 } 3604 3605 .connect.disabled, 3606 .guide.disabled { 3607 opacity: 0.3; 3608 pointer-events: none; 3609 user-select: none; 3610 } 3611 3612 wui-separator { 3613 margin: var(--wui-spacing-s) calc(var(--wui-spacing-s) * -1); 3614 width: calc(100% + var(--wui-spacing-s) * 2); 3615 } 3616`;var ij=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let iq=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.connectors=V.a.state.connectors,this.authConnector=this.connectors.find(e=>"AUTH"===e.type),this.features=n.H.state.features,this.remoteFeatures=n.H.state.remoteFeatures,this.enableWallets=n.H.state.enableWallets,this.noAdapters=s.W.state.noAdapters,this.walletGuide="get-started",this.checked=t_.o.state.isLegalCheckboxChecked,this.isEmailEnabled=this.remoteFeatures?.email&&!s.W.state.noAdapters,this.isSocialEnabled=this.remoteFeatures?.socials&&this.remoteFeatures.socials.length>0&&!s.W.state.noAdapters,this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors),this.unsubscribe.push(V.a.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(e=>"AUTH"===e.type),this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors)}),n.H.subscribeKey("features",e=>{this.features=e}),n.H.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e,this.setEmailAndSocialEnableCheck(this.noAdapters,this.remoteFeatures)}),n.H.subscribeKey("enableWallets",e=>this.enableWallets=e),s.W.subscribeKey("noAdapters",e=>this.setEmailAndSocialEnableCheck(e,this.remoteFeatures)),t_.o.subscribeKey("isLegalCheckboxChecked",e=>this.checked=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.resizeObserver?.disconnect();let e=this.shadowRoot?.querySelector(".connect");e?.removeEventListener("scroll",this.handleConnectListScroll.bind(this))}firstUpdated(){let e=this.shadowRoot?.querySelector(".connect");e&&(requestAnimationFrame(this.handleConnectListScroll.bind(this)),e?.addEventListener("scroll",this.handleConnectListScroll.bind(this)),this.resizeObserver=new ResizeObserver(()=>{this.handleConnectListScroll()}),this.resizeObserver?.observe(e),this.handleConnectListScroll())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.H.state,i=n.H.state.features?.legalCheckbox,a=!!(e||t)&&!!i&&"get-started"===this.walletGuide&&!this.checked,r=n.H.state.enableWalletGuide,s=this.enableWallets,l=this.isSocialEnabled||this.authConnector,c=a?-1:void 0;return(0,o.qy)` 3617 <wui-flex flexDirection="column"> 3618 ${this.legalCheckboxTemplate()} 3619 <wui-flex 3620 data-testid="w3m-connect-scroll-view" 3621 flexDirection="column" 3622 class=${(0,e1.H)({connect:!0,disabled:a})} 3623 > 3624 <wui-flex 3625 class="connect-methods" 3626 flexDirection="column" 3627 gap="s" 3628 .padding=${l&&s&&r&&"get-started"===this.walletGuide?["3xs","s","0","s"]:["3xs","s","s","s"]} 3629 > 3630 ${this.renderConnectMethod(c)} 3631 </wui-flex> 3632 </wui-flex> 3633 ${this.guideTemplate(a)} 3634 <w3m-legal-footer></w3m-legal-footer> 3635 </wui-flex> 3636 `}setEmailAndSocialEnableCheck(e,t){this.isEmailEnabled=t?.email&&!e,this.isSocialEnabled=t?.socials&&t.socials.length>0&&!e,this.remoteFeatures=t,this.noAdapters=e}checkIfAuthEnabled(e){let t=e.filter(e=>e.type===tG.o.CONNECTOR_TYPE_AUTH).map(e=>e.chain);return _.o.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(e=>t.includes(e))}renderConnectMethod(e){let t=tO.A.getConnectOrderMethod(this.features,this.connectors);return(0,o.qy)`${t.map((t,i)=>{switch(t){case"email":return(0,o.qy)`${this.emailTemplate(e)} ${this.separatorTemplate(i,"email")}`;case"social":return(0,o.qy)`${this.socialListTemplate(e)} 3637 ${this.separatorTemplate(i,"social")}`;case"wallet":return(0,o.qy)`${this.walletListTemplate(e)} 3638 ${this.separatorTemplate(i,"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){let t=tO.A.getConnectOrderMethod(this.features,this.connectors)[e+1];return t?this.checkMethodEnabled(t)?t:this.checkIsThereNextMethod(e+1):void 0}separatorTemplate(e,t){let i=this.checkIsThereNextMethod(e),a="explore"===this.walletGuide;switch(t){case"wallet":return this.enableWallets&&i&&!a?(0,o.qy)`<wui-separator data-testid="wui-separator" text="or"></wui-separator>`:null;case"email":return this.isAuthEnabled&&this.isEmailEnabled&&"social"!==i&&i?(0,o.qy)`<wui-separator 3639 data-testid="w3m-email-login-or-separator" 3640 text="or" 3641 ></wui-separator>`:null;case"social":return this.isAuthEnabled&&this.isSocialEnabled&&"email"!==i&&i?(0,o.qy)`<wui-separator data-testid="wui-separator" text="or"></wui-separator>`:null;default:return null}}emailTemplate(e){return this.isEmailEnabled&&this.isAuthEnabled?(0,o.qy)`<w3m-email-login-widget 3642 walletGuide=${this.walletGuide} 3643 tabIdx=${(0,r.J)(e)} 3644 ></w3m-email-login-widget>`:null}socialListTemplate(e){return this.isSocialEnabled&&this.isAuthEnabled?(0,o.qy)`<w3m-social-login-widget 3645 walletGuide=${this.walletGuide} 3646 tabIdx=${(0,r.J)(e)} 3647 ></w3m-social-login-widget>`:null}walletListTemplate(e){let t=this.enableWallets,i=this.features?.emailShowWallets===!1,a=this.features?.collapseWallets;return t?(u.w.isTelegram()&&(u.w.isSafari()||u.w.isIos())&&Y.x.connectWalletConnect().catch(e=>({})),"explore"===this.walletGuide)?null:this.isAuthEnabled&&(this.isEmailEnabled||this.isSocialEnabled)&&(i||a)?(0,o.qy)`<wui-list-button 3648 data-testid="w3m-collapse-wallets-button" 3649 tabIdx=${(0,r.J)(e)} 3650 @click=${this.onContinueWalletClick.bind(this)} 3651 text="Continue with a wallet" 3652 ></wui-list-button>`:(0,o.qy)`<w3m-wallet-login-list tabIdx=${(0,r.J)(e)}></w3m-wallet-login-list>`:null}guideTemplate(e=!1){return n.H.state.enableWalletGuide&&(this.authConnector||this.isSocialEnabled)?(0,o.qy)` 3653 ${"explore"===this.walletGuide&&!s.W.state.noAdapters?(0,o.qy)`<wui-separator data-testid="wui-separator" id="explore" text="or"></wui-separator>`:null} 3654 <w3m-wallet-guide 3655 class=${(0,e1.H)({guide:!0,disabled:e})} 3656 tabIdx=${(0,r.J)(e?-1:void 0)} 3657 walletGuide=${this.walletGuide} 3658 ></w3m-wallet-guide> 3659 `:null}legalCheckboxTemplate(){return"explore"===this.walletGuide?null:(0,o.qy)`<w3m-legal-checkbox data-testid="w3m-legal-checkbox"></w3m-legal-checkbox>`}handleConnectListScroll(){let e=this.shadowRoot?.querySelector(".connect");e&&(e.scrollHeight>470?(e.style.setProperty("--connect-mask-image",`linear-gradient( 3660 to bottom, 3661 rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px, 3662 rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px, 3663 black 40px, 3664 black calc(100% - 40px), 3665 rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px), 3666 rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100% 3667 )`),e.style.setProperty("--connect-scroll--top-opacity",h.z8.interpolate([0,50],[0,1],e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",h.z8.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(){G.I.push("ConnectWallets")}};iq.styles=iP,ij([(0,tH.w)()],iq.prototype,"connectors",void 0),ij([(0,tH.w)()],iq.prototype,"authConnector",void 0),ij([(0,tH.w)()],iq.prototype,"features",void 0),ij([(0,tH.w)()],iq.prototype,"remoteFeatures",void 0),ij([(0,tH.w)()],iq.prototype,"enableWallets",void 0),ij([(0,tH.w)()],iq.prototype,"noAdapters",void 0),ij([(0,a.MZ)()],iq.prototype,"walletGuide",void 0),ij([(0,tH.w)()],iq.prototype,"checked",void 0),ij([(0,tH.w)()],iq.prototype,"isEmailEnabled",void 0),ij([(0,tH.w)()],iq.prototype,"isSocialEnabled",void 0),ij([(0,tH.w)()],iq.prototype,"isAuthEnabled",void 0),iq=ij([(0,h.EM)("w3m-connect-view")],iq);var iD=i(7478);i(19284),i(38254);let iU=(0,o.AH)` 3668 wui-flex { 3669 width: 100%; 3670 background-color: var(--wui-color-gray-glass-002); 3671 border-radius: var(--wui-border-radius-xs); 3672 } 3673`;var iL=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let iz=class extends o.WF{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return(0,o.qy)` 3674 <wui-flex 3675 justifyContent="space-between" 3676 alignItems="center" 3677 .padding=${["1xs","2l","1xs","2l"]} 3678 > 3679 <wui-text variant="paragraph-500" color="fg-200">${this.label}</wui-text> 3680 <wui-chip-button size="sm" variant="shade" text=${this.buttonLabel} icon="chevronRight"> 3681 </wui-chip-button>
3681 3682 </wui-flex> 3683 `}};iz.styles=[w.W5,w.fD,iU],iL([(0,a.MZ)({type:Boolean})],iz.prototype,"disabled",void 0),iL([(0,a.MZ)()],iz.prototype,"label",void 0),iL([(0,a.MZ)()],iz.prototype,"buttonLabel",void 0),iz=iL([(0,b.E)("wui-cta-button")],iz);let iZ=(0,o.AH)` 3684 :host { 3685 display: block; 3686 padding: 0 var(--wui-spacing-xl) var(--wui-spacing-xl); 3687 } 3688`;var iB=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let iF=class extends o.WF{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;let{name:e,app_store:t,play_store:i,chrome_store:a,homepage:r}=this.wallet,n=u.w.isMobile(),s=u.w.isIos(),l=u.w.isAndroid(),c=[t,i,r,a].filter(Boolean).length>1,d=h.Zv.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return c&&!n?(0,o.qy)` 3689 <wui-cta-button 3690 label=${`Don't have ${d}?`} 3691 buttonLabel="Get" 3692 @click=${()=>G.I.push("Downloads",{wallet:this.wallet})} 3693 ></wui-cta-button> 3694 `:!c&&r?(0,o.qy)` 3695 <wui-cta-button 3696 label=${`Don't have ${d}?`} 3697 buttonLabel="Get" 3698 @click=${this.onHomePage.bind(this)} 3699 ></wui-cta-button> 3700 `:t&&s?(0,o.qy)` 3701 <wui-cta-button 3702 label=${`Don't have ${d}?`} 3703 buttonLabel="Get" 3704 @click=${this.onAppStore.bind(this)} 3705 ></wui-cta-button> 3706 `:i&&l?(0,o.qy)` 3707 <wui-cta-button 3708 label=${`Don't have ${d}?`} 3709 buttonLabel="Get" 3710 @click=${this.onPlayStore.bind(this)} 3711 ></wui-cta-button> 3712 `:(this.style.display="none",null)}onAppStore(){this.wallet?.app_store&&u.w.openHref(this.wallet.app_store,"_blank")}onPlayStore(){this.wallet?.play_store&&u.w.openHref(this.wallet.play_store,"_blank")}onHomePage(){this.wallet?.homepage&&u.w.openHref(this.wallet.homepage,"_blank")}};iF.styles=[iZ],iB([(0,a.MZ)({type:Object})],iF.prototype,"wallet",void 0),iF=iB([(0,h.EM)("w3m-mobile-download-links")],iF);let iH=(0,o.AH)` 3713 @keyframes shake { 3714 0% { 3715 transform: translateX(0); 3716 } 3717 25% { 3718 transform: translateX(3px); 3719 } 3720 50% { 3721 transform: translateX(-3px); 3722 } 3723 75% { 3724 transform: translateX(3px); 3725 } 3726 100% { 3727 transform: translateX(0); 3728 } 3729 } 3730 3731 wui-flex:first-child:not(:only-child) { 3732 position: relative; 3733 } 3734 3735 wui-loading-thumbnail { 3736 position: absolute; 3737 } 3738 3739 wui-icon-box { 3740 position: absolute; 3741 right: calc(var(--wui-spacing-3xs) * -1); 3742 bottom: calc(var(--wui-spacing-3xs) * -1); 3743 opacity: 0; 3744 transform: scale(0.5); 3745 transition-property: opacity, transform; 3746 transition-duration: var(--wui-duration-lg); 3747 transition-timing-function: var(--wui-ease-out-power-2); 3748 will-change: opacity, transform; 3749 } 3750 3751 wui-text[align='center'] { 3752 width: 100%; 3753 padding: 0px var(--wui-spacing-l); 3754 } 3755 3756 [data-error='true'] wui-icon-box { 3757 opacity: 1; 3758 transform: scale(1); 3759 } 3760 3761 [data-error='true'] > wui-flex:first-child { 3762 animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; 3763 } 3764 3765 [data-retry='false'] wui-link { 3766 display: none; 3767 } 3768 3769 [data-retry='true'] wui-link { 3770 display: block; 3771 opacity: 1; 3772 } 3773`;var i_=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class iV extends o.WF{constructor(){super(),this.wallet=G.I.state.data?.wallet,this.connector=G.I.state.data?.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=c.$.getWalletImage(this.wallet)??c.$.getConnectorImage(this.connector),this.name=this.wallet?.name??this.connector?.name??"Wallet",this.isRetrying=!1,this.uri=Y.x.state.wcUri,this.error=Y.x.state.wcError,this.ready=!1,this.showRetry=!1,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(Y.x.subscribeKey("wcUri",e=>{this.uri=e,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,this.onConnect?.())}),Y.x.subscribeKey("wcError",e=>this.error=e)),(u.w.isTelegram()||u.w.isSafari())&&u.w.isIos()&&Y.x.state.wcUri&&this.onConnect?.()}firstUpdated(){this.onAutoConnect?.(),this.showRetry=!this.onAutoConnect}
3773disconnectedCallback(){this.unsubscribe.forEach(e=>e()),Y.x.setWcError(!1),clearTimeout(this.timeout)}render(){this.onRender?.(),this.onShowRetry();let e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel,t=`Continue in ${this.name}`;return this.error&&(t="Connection declined"),(0,o.qy)` 3774 <wui-flex 3775 data-error=${(0,r.J)(this.error)} 3776 data-retry=${this.showRetry} 3777 flexDirection="column" 3778 alignItems="center" 3779 .padding=${["3xl","xl","xl","xl"]} 3780 gap="xl" 3781 > 3782 <wui-flex justifyContent="center" alignItems="center"> 3783 <wui-wallet-image size="lg" imageSrc=${(0,r.J)(this.imageSrc)}></wui-wallet-image> 3784 3785 ${this.error?null:this.loaderTemplate()} 3786 3787 <wui-icon-box 3788 backgroundColor="error-100" 3789 background="opaque" 3790 iconColor="error-100" 3791 icon="close" 3792 size="sm" 3793 border 3794 borderColor="wui-color-bg-125" 3795 ></wui-icon-box> 3796 </wui-flex> 3797 3798 <wui-flex flexDirection="column" alignItems="center" gap="xs"> 3799 <wui-text variant="paragraph-500" color=${this.error?"error-100":"fg-100"}> 3800 ${t} 3801 </wui-text> 3802 <wui-text align="center" variant="small-500" color="fg-200">${e}</wui-text> 3803 </wui-flex> 3804 3805 ${this.secondaryBtnLabel?(0,o.qy)` 3806 <wui-button 3807 variant="accent" 3808 size="md" 3809 ?disabled=${this.isRetrying||this.isLoading} 3810 @click=${this.onTryAgain.bind(this)} 3811 data-testid="w3m-connecting-widget-secondary-button" 3812 > 3813 <wui-icon color="inherit" slot="iconLeft" name=${this.secondaryBtnIcon}></wui-icon> 3814 ${this.secondaryBtnLabel} 3815 </wui-button> 3816 `:null} 3817 </wui-flex> 3818 3819 ${this.isWalletConnect?(0,o.qy)` 3820 <wui-flex .padding=${["0","xl","xl","xl"]} justifyContent="center"> 3821 <wui-link @click=${this.onCopyUri} color="fg-200" data-testid="wui-link-copy"> 3822 <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon> 3823 Copy link 3824 </wui-link> 3825 </wui-flex> 3826 `:null} 3827 3828 <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links> 3829 `}onShowRetry(){if(this.error&&!this.showRetry){this.showRetry=!0;let e=this.shadowRoot?.querySelector("wui-button");e?.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){Y.x.setWcError(!1),this.onRetry?(this.isRetrying=!0,this.onRetry?.()):this.onConnect?.()}loaderTemplate(){let e=iD.W.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return(0,o.qy)`<wui-loading-thumbnail radius=${9*t}></wui-loading-thumbnail>`}onCopyUri(){try{this.uri&&(u.w.copyToClopboard(this.uri),K.P.showSuccess("Link copied"))}catch{K.P.showError("Failed to copy")}}}iV.styles=iH,i_([(0,a.wk)()],iV.prototype,"isRetrying",void 0),i_([(0,a.wk)()],iV.prototype,"uri",void 0),i_([(0,a.wk)()],iV.prototype,"error",void 0),i_([(0,a.wk)()],iV.prototype,"ready",void 0),i_([(0,a.wk)()],iV.prototype,"showRetry",void 0),i_([(0,a.wk)()],iV.prototype,"secondaryBtnLabel",void 0),i_([(0,a.wk)()],iV.prototype,"secondaryLabel",void 0),i_([(0,a.wk)()],iV.prototype,"isLoading",void 0),i_([(0,a.MZ)({type:Boolean})],iV.prototype,"isMobile",void 0),i_([(0,a.MZ)()],iV.prototype,"onRetry",void 0);let iJ=class extends iV{constructor(){if(super(),this.externalViewUnsubscribe=[],!this.connector)throw Error("w3m-connecting-view: No connector provided");j.E.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser"}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1,this.externalViewUnsubscribe.push(s.W.subscribeKey("activeCaipAddress",e=>{e&&p.W.close()}))}disconnectedCallback(){this.externalViewUnsubscribe.forEach(e=>e())}async onConnectProxy(){try{this.error=!1,this.connector&&(this.connector.id!==_.o.CONNECTOR_ID.COINBASE_SDK||!this.error)&&(await Y.x.
3829connectExternal(this.connector,this.connector.chain),j.E.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.connector.name||"Unknown"}}))}catch(e){j.E.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),this.error=!0}}};iJ=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n}([(0,h.EM)("w3m-connecting-external-view")],iJ);let iK=(0,o.AH)` 3830 wui-flex, 3831 wui-list-wallet { 3832 width: 100%; 3833 } 3834`;var iG=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let iY=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.activeConnector=V.a.state.activeConnector,this.unsubscribe.push(V.a.subscribeKey("activeConnector",e=>this.activeConnector=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,o.qy)` 3835 <wui-flex 3836 flexDirection="column" 3837 alignItems="center" 3838 .padding=${["m","xl","xl","xl"]} 3839 gap="xl" 3840 > 3841 <wui-flex justifyContent="center" alignItems="center"> 3842 <wui-wallet-image 3843 size="lg" 3844 imageSrc=${(0,r.J)(c.$.getConnectorImage(this.activeConnector))} 3845 ></wui-wallet-image> 3846 </wui-flex> 3847 <wui-flex 3848 flexDirection="column" 3849 alignItems="center" 3850 gap="xs" 3851 .padding=${["0","s","0","s"]} 3852 > 3853 <wui-text variant="paragraph-500" color="fg-100"> 3854 Select Chain for ${this.activeConnector?.name} 3855 </wui-text> 3856 <wui-text align="center" variant="small-500" color="fg-200" 3857 >Select which chain to connect to your multi chain wallet</wui-text 3858 > 3859 </wui-flex> 3860 <wui-flex 3861 flexGrow="1" 3862 flexDirection="column" 3863 alignItems="center" 3864 gap="xs" 3865 .padding=${["xs","0","xs","0"]} 3866 > 3867 ${this.networksTemplate()} 3868 </wui-flex> 3869 </wui-flex> 3870 `}networksTemplate(){return this.activeConnector?.connectors?.map(e=>e.name?(0,o.qy)` 3871 <wui-list-wallet 3872 imageSrc=${(0,r.J)(c.$.getChainImage(e.chain))} 3873 name=${_.o.CHAIN_NAME_MAP[e.chain]} 3874 @click=${()=>this.onConnector(e)} 3875 data-testid="wui-list-chain-${e.chain}" 3876 ></wui-list-wallet> 3877 `:null)}onConnector(e){let t=this.activeConnector?.connectors?.find(t=>t.chain===e.chain);if(!t)return void K.P.showError("Failed to find connector");"walletConnect"===t.id?u.w.isMobile()?G.I.push("AllWallets"):G.I.push("ConnectingWalletConnect"):G.I.push("ConnectingExternal",{connector:t})}};iY.styles=iK,iG([(0,a.wk)()],iY.prototype,"activeConnector",void 0),iY=iG([(0,h.EM)("w3m-connecting-multi-chain-view")],iY);var iX=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let iQ=class extends o.WF{constructor(){super(...arguments),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.generateTabs();return(0,o.qy)` 3878 <wui-flex justifyContent="center" .padding=${["0","0","l","0"]}> 3879 <wui-tabs .tabs=${e} .onTabChange=${this.onTabChange.bind(this)}></wui-tabs> 3880 </wui-flex> 3881 `}generateTabs(){let e=this.platforms.map(e=>{if("browser"===e)return{label:"Browser",icon:"extension",platform:"browser"};if("mobile"===e)return{label:"Mobile",icon:"mobile",platform:"mobile"};if("qrcode"===e)return{label:"Mobile",icon:"mobile",platform:"qrcode"};if("web"===e)return{label:"Webapp",icon:"browser",platform:"web"};if("desktop"===e)return{label:"Desktop",icon:"desktop",platform:"desktop"};return{label:"Browser",icon:"extension",platform:"unsupported"}});return this.platformTabs=e.map(({platform:e})=>e),e}onTabChange(e){let t=this.platformTabs[e];t&&this.onSelectPlatfrom?.(t)}};iX([(0,a.MZ)({type:Array})],iQ.prototype,"platforms",void 0),iX([(0,a.MZ)()],iQ.prototype,"onSelectPlatfrom",void 0),iQ=iX([(0,h.EM)("w3m-connecting-header")],iQ);let i0=class extends iV{constructor(){if(super(),!this.wallet)throw Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),j.E.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}async onConnectProxy(){try{this.error=!1;let{connectors:e}=V.a.state,t=e.find(e=>
3881"ANNOUNCED"===e.type&&e.info?.rdns===this.wallet?.rdns||"INJECTED"===e.type||e.name===this.wallet?.name);if(t)await Y.x.connectExternal(t,t.chain);else throw Error("w3m-connecting-wc-browser: No connector found");p.W.close(),j.E.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.wallet?.name||"Unknown"}})}catch(e){j.E.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),this.error=!0}}};i0=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n}([(0,h.EM)("w3m-connecting-wc-browser")],i0);let i3=class extends iV{constructor(){if(super(),!this.wallet)throw Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),j.E.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop"}})}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onConnectProxy(){if(this.wallet?.desktop_link&&this.uri)try{this.error=!1;let{desktop_link:e,name:t}=this.wallet,{redirect:i,href:o}=u.w.formatNativeUrl(e,this.uri);Y.x.setWcLinking({name:t,href:o}),Y.x.setRecentWallet(this.wallet),u.w.openHref(i,"_blank")}catch{this.error=!0}}};i3=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n}([(0,h.EM)("w3m-connecting-wc-desktop")],i3);var i1=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let i5=class extends iV{constructor(){if(super(),this.btnLabelTimeout=void 0,this.redirectDeeplink=void 0,this.redirectUniversalLink=void 0,this.target=void 0,this.preferUniversalLinks=n.H.state.experimental_preferUniversalLinks,this.isLoading=!0,this.onConnect=()=>{if(this.wallet?.mobile_link&&this.uri)try{this.error=!1;let{mobile_link:e,link_mode:t,name:i}=this.wallet,{redirect:o,redirectUniversalLink:a,href:r}=u.w.formatNativeUrl(e,this.uri,t);this.redirectDeeplink=o,this.redirectUniversalLink=a,this.target=u.w.isIframe()?"_top":"_self",Y.x.setWcLinking({name:i,href:r}),Y.x.setRecentWallet(this.wallet),this.preferUniversalLinks&&this.redirectUniversalLink?u.w.openHref(this.redirectUniversalLink,this.target):u.w.openHref(this.redirectDeeplink,this.target)}catch(e){j.E.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:e instanceof Error?e.message:"Error parsing the deeplink",uri:this.uri,mobile_link:this.wallet.mobile_link,name:this.wallet.name}}),this.error=!0}},!this.wallet)throw Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel="Open",this.secondaryLabel=J.oU.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.onHandleURI(),this.unsubscribe.push(Y.x.subscribeKey("wcUri",()=>{this.onHandleURI()})),j.E.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile"}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.btnLabelTimeout)}onHandleURI(){this.isLoading=!this.uri,!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onTryAgain(){Y.x.setWcError(!1),this.onConnect?.()}};i1([(0,a.wk)()],i5.prototype,"redirectDeeplink",void 0),i1([(0,a.wk)()],i5.prototype,"redirectUniversalLink",void 0),i1([(0,a.wk)()],i5.prototype,"target",void 0),i1([(0,a.wk)()],i5.prototype,"preferUniversalLinks",void 0),i1([(0,a.wk)()],i5.prototype,"isLoading",void 0),i5=i1([(0,h.EM)("w3m-connecting-wc-mobile")],i5),i(4146),i(80674);let i2=(0,o.AH)` 3882 @keyframes fadein { 3883 from { 3884 opacity: 0; 3885 } 3886 to { 3887 opacity: 1; 3888 } 3889 } 3890 3891 wui-shimmer { 3892 width: 100%; 3893 aspect-ratio: 1 / 1; 3894 border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important; 3895 } 3896 3897 wui-qr-code { 3898 opacity: 0; 3899 animation-duration: 200ms; 3900 animation-timing-function: ease; 3901 animation-name: fadein; 3902 animation-fill-mode: forwards; 3903 } 3904`,i4=class extends iV{constructor(){super(),this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate),j.E.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet?.name??"WalletConnect",platform:"qrcode"}})}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribe?.forEach(e
3904=>e()),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),(0,o.qy)` 3905 <wui-flex 3906 flexDirection="column" 3907 alignItems="center" 3908 .padding=${["0","xl","xl","xl"]} 3909 gap="xl" 3910 > 3911 <wui-shimmer borderRadius="l" width="100%"> ${this.qrCodeTemplate()} </wui-shimmer> 3912 3913 <wui-text variant="paragraph-500" color="fg-100"> 3914 Scan this QR Code with your phone 3915 </wui-text> 3916 ${this.copyTemplate()} 3917 </wui-flex> 3918 <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links> 3919 `}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;let e=this.getBoundingClientRect().width-40,t=this.wallet?this.wallet.name:void 0;return Y.x.setWcLinking(void 0),Y.x.setRecentWallet(this.wallet),(0,o.qy)` <wui-qr-code 3920 size=${e} 3921 theme=${iD.W.state.themeMode} 3922 uri=${this.uri} 3923 imageSrc=${(0,r.J)(c.$.getWalletImage(this.wallet))} 3924 color=${(0,r.J)(iD.W.state.themeVariables["--w3m-qr-color"])} 3925 alt=${(0,r.J)(t)} 3926 data-testid="wui-qr-code" 3927 ></wui-qr-code>`}copyTemplate(){let e=!this.uri||!this.ready;return(0,o.qy)`<wui-link 3928 .disabled=${e} 3929 @click=${this.onCopyUri} 3930 color="fg-200" 3931 data-testid="copy-wc2-uri" 3932 > 3933 <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon> 3934 Copy link 3935 </wui-link>`}};i4.styles=i2,i4=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n}([(0,h.EM)("w3m-connecting-wc-qrcode")],i4);let i6=class extends o.WF{constructor(){if(super(),this.wallet=G.I.state.data?.wallet,!this.wallet)throw Error("w3m-connecting-wc-unsupported: No wallet provided");j.E.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}render(){return(0,o.qy)` 3936 <wui-flex 3937 flexDirection="column" 3938 alignItems="center" 3939 .padding=${["3xl","xl","xl","xl"]} 3940 gap="xl" 3941 > 3942 <wui-wallet-image 3943 size="lg" 3944 imageSrc=${(0,r.J)(c.$.getWalletImage(this.wallet))} 3945 ></wui-wallet-image> 3946 3947 <wui-text variant="paragraph-500" color="fg-100">Not Detected</wui-text> 3948 </wui-flex> 3949 3950 <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links> 3951 `}};i6=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n}([(0,h.EM)("w3m-connecting-wc-unsupported")],i6);var i7=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let i8=class extends iV{constructor(){if(super(),this.isLoading=!0,!this.wallet)throw Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel=J.oU.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.updateLoadingState(),this.unsubscribe.push(Y.x.subscribeKey("wcUri",()=>{this.updateLoadingState()})),j.E.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web"}})}updateLoadingState(){this.isLoading=!this.uri}onConnectProxy(){if(this.wallet?.webapp_link&&this.uri)try{this.error=!1;let{webapp_link:e,name:t}=this.wallet,{redirect:i,href:o}=u.w.formatUniversalUrl(e,this.uri);Y.x.setWcLinking({name:t,href:o}),Y.x.setRecentWallet(this.wallet),u.w.openHref(i,"_blank")}catch{this.error=!0}}};i7([(0,a.wk)()],i8.prototype,"isLoading",void 0),i8=i7([(0,h.EM)("w3m-connecting-wc-web")],i8);var i9=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let oe=class extends o.WF{constructor(){super(),this.wallet=G.I.state.data?.wallet,this.unsubscribe=[],this.platform=void 0,this.platforms=[],this.isSiwxEnabled=!!n.H.state.siwx,this.remoteFeatures=n.H.state.remoteFeatures,this.determinePlatforms(),this.initializeConnection(),this.unsubscribe.push(n.H.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}
3951disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,o.qy)` 3952 ${this.headerTemplate()} 3953 <div>${this.platformTemplate()}</div> 3954 ${this.reownBrandingTemplate()} 3955 `}reownBrandingTemplate(){return this.remoteFeatures?.reownBranding?(0,o.qy)`<wui-ux-by-reown></wui-ux-by-reown>`:null}async initializeConnection(e=!1){if("browser"!==this.platform&&(!n.H.state.manualWCControl||e))try{let{wcPairingExpiry:t,status:i}=Y.x.state;(e||n.H.state.enableEmbedded||u.w.isPairingExpired(t)||"connecting"===i)&&(await Y.x.connectWalletConnect(),this.isSiwxEnabled||p.W.close())}catch(e){j.E.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),Y.x.setWcError(!0),K.P.showError(e.message??"Connection error"),Y.x.resetWcConnection(),G.I.goBack()}}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;let{mobile_link:e,desktop_link:t,webapp_link:i,injected:o,rdns:a}=this.wallet,r=o?.map(({injected_id:e})=>
3955e).filter(Boolean),l=[...a?[a]:r??[]],c=!n.H.state.isUniversalProvider&&l.length,d=Y.x.checkInstalled(l),p=c&&d,h=t&&!u.w.isMobile();p&&!s.W.state.noAdapters&&this.platforms.push("browser"),e&&this.platforms.push(u.w.isMobile()?"mobile":"qrcode"),i&&this.platforms.push("web"),h&&this.platforms.push("desktop"),p||!c||s.W.state.noAdapters||this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return(0,o.qy)`<w3m-connecting-wc-browser></w3m-connecting-wc-browser>`;case"web":return(0,o.qy)`<w3m-connecting-wc-web></w3m-connecting-wc-web>`;case"desktop":return(0,o.qy)` 3956 <w3m-connecting-wc-desktop .onRetry=${()=>this.initializeConnection(!0)}> 3957 </w3m-connecting-wc-desktop> 3958 `;case"mobile":return(0,o.qy)` 3959 <w3m-connecting-wc-mobile isMobile .onRetry=${()=>this.initializeConnection(!0)}> 3960 </w3m-connecting-wc-mobile> 3961 `;case"qrcode":return(0,o.qy)`<w3m-connecting-wc-qrcode></w3m-connecting-wc-qrcode>`;default:return(0,o.qy)`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`}}headerTemplate(){return this.platforms.length>1?(0,o.qy)` 3962 <w3m-connecting-header 3963 .platforms=${this.platforms} 3964 .onSelectPlatfrom=${this.onSelectPlatform.bind(this)} 3965 > 3966 </w3m-connecting-header> 3967 `:null}async onSelectPlatform(e){let t=this.shadowRoot?.querySelector("div");t&&(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};i9([(0,a.wk)()],oe.prototype,"platform",void 0),i9([(0,a.wk)()],oe.prototype,"platforms",void 0),i9([(0,a.wk)()],oe.prototype,"isSiwxEnabled",void 0),i9([(0,a.wk)()],oe.prototype,"remoteFeatures",void 0),oe=i9([(0,h.EM)("w3m-connecting-wc-view")],oe);var ot=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let oi=class extends o.WF{constructor(){super(...arguments),this.isMobile=u.w.isMobile()}render(){if(this.isMobile){let{featured:e,recommended:t}=t$.N.state,{customWallets:i}=n.H.state,a=eo.i.getRecentWallets(),r=e.length||t.length||i?.length||a.length;return(0,o.qy)`<wui-flex 3968 flexDirection="column" 3969 gap="xs" 3970 .margin=${["3xs","s","s","s"]} 3971 > 3972 ${r?(0,o.qy)`<w3m-connector-list></w3m-connector-list>`:null} 3973 <w3m-all-wallets-widget></w3m-all-wallets-widget> 3974 </wui-flex>`}return(0,o.qy)`<wui-flex flexDirection="column" .padding=${["0","0","l","0"]}> 3975 <w3m-connecting-wc-view></w3m-connecting-wc-view> 3976 <wui-flex flexDirection="column" .padding=${["0","m","0","m"]}> 3977 <w3m-all-wallets-widget></w3m-all-wallets-widget> </wui-flex 3978 ></wui-flex>`}};ot([(0,a.wk)()],oi.prototype,"isMobile",void 0),oi=ot([(0,h.EM)("w3m-connecting-wc-basic-view")],oi);var oo=i(7273);let oa=(0,o.AH)` 3979 .continue-button-container { 3980 width: 100%; 3981 } 3982`;var or=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let on=class extends o.WF{constructor(){super(...arguments),this.loading=!1}render(){return(0,o.qy)` 3983 <wui-flex 3984 flexDirection="column" 3985 alignItems="center" 3986 gap="xxl" 3987 .padding=${["0","0","l","0"]} 3988 > 3989 ${this.onboardingTemplate()} ${this.buttonsTemplate()} 3990 <wui-link 3991 @click=${()=>{u.w.openHref(oo.T.URLS.FAQ,"_blank")}} 3992 > 3993 Learn more about names 3994 <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon> 3995 </wui-link> 3996 </wui-flex> 3997 `}onboardingTemplate(){return(0,o.qy)` <wui-flex 3998 flexDirection="column" 3999 gap="xxl" 4000 alignItems="center" 4001 .padding=${["0","xxl","0","xxl"]} 4002 > 4003 <wui-flex gap="s" alignItems="center" justifyContent="center"> 4004 <wui-icon-box 4005 icon="id" 4006 size="xl" 4007 iconSize="xxl" 4008 iconColor="fg-200" 4009 backgroundColor="fg-200" 4010 ></wui-icon-box> 4011 </wui-flex> 4012 <wui-flex flexDirection="column" alignItems="center" gap="s"> 4013 <wui-text align="center" variant="medium-600" color="fg-100"> 4014 Choose your account name 4015 </wui-text> 4016 <wui-text align="center" variant="paragraph-400" color="fg-100"> 4017 Finally say goodbye to 0x addresses, name your account to make it easier to exchange 4018 assets 4019 </wui-text> 4020 </wui-flex> 4021 </wui-flex>`}buttonsTemplate(){return(0,o.qy)`<wui-flex 4022 .padding=${["0","2l","0","2l"]} 4023 gap="s" 4024 class="continue-button-container" 4025 > 4026 <wui-button 4027 fullWidth 4028 .loading=${this.loading} 4029 size="lg" 4030 borderRadius="xs" 4031 @click=${this.handleContinue.bind(this)} 4032 >Choose name 4033 </wui-button>
4033 4034 </wui-flex>`}handleContinue(){let e=s.W.state.activeChain;G.I.push("RegisterAccountName"),j.E.sendEvent({type:"track",event:"OPEN_ENS_FLOW",properties:{isSmartAccount:d.U.state.preferredAccountTypes?.[e]===ei.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}})}};on.styles=oa,or([(0,a.wk)()],on.prototype,"loading",void 0),on=or([(0,h.EM)("w3m-choose-account-name-view")],on);let os=class extends o.WF{constructor(){super(...arguments),this.wallet=G.I.state.data?.wallet}render(){if(!this.wallet)throw Error("w3m-downloads-view");return(0,o.qy)` 4035 <wui-flex gap="xs" flexDirection="column" .padding=${["s","s","l","s"]}> 4036 ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()} 4037 ${this.homepageTemplate()} 4038 </wui-flex> 4039 `}chromeTemplate(){return this.wallet?.chrome_store?(0,o.qy)`<wui-list-item 4040 variant="icon" 4041 icon="chromeStore" 4042 iconVariant="square" 4043 @click=${this.onChromeStore.bind(this)} 4044 chevron 4045 > 4046 <wui-text variant="paragraph-500" color="fg-100">Chrome Extension</wui-text> 4047 </wui-list-item>`:null}iosTemplate(){return this.wallet?.app_store?(0,o.qy)`<wui-list-item 4048 variant="icon" 4049 icon="appStore" 4050 iconVariant="square" 4051 @click=${this.onAppStore.bind(this)} 4052 chevron 4053 > 4054 <wui-text variant="paragraph-500" color="fg-100">iOS App</wui-text> 4055 </wui-list-item>`:null}androidTemplate(){return this.wallet?.play_store?(0,o.qy)`<wui-list-item 4056 variant="icon" 4057 icon="playStore" 4058 iconVariant="square" 4059 @click=${this.onPlayStore.bind(this)} 4060 chevron 4061 > 4062 <wui-text variant="paragraph-500" color="fg-100">Android App</wui-text> 4063 </wui-list-item>`:null}homepageTemplate(){return this.wallet?.homepage?(0,o.qy)` 4064 <wui-list-item 4065 variant="icon" 4066 icon="browser" 4067 iconVariant="square-blue" 4068 @click=${this.onHomePage.bind(this)} 4069 chevron 4070 > 4071 <wui-text variant="paragraph-500" color="fg-100">Website</wui-text> 4072 </wui-list-item> 4073 `:null}onChromeStore(){this.wallet?.chrome_store&&u.w.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){this.wallet?.app_store&&u.w.openHref(this.wallet.app_store,"_blank")}onPlayStore(){this.wallet?.play_store&&u.w.openHref(this.wallet.play_store,"_blank")}onHomePage(){this.wallet?.homepage&&u.w.openHref(this.wallet.homepage,"_blank")}};os=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n}([(0,h.EM)("w3m-downloads-view")],os);let ol=class extends o.WF{render(){return(0,o.qy)` 4074 <wui-flex flexDirection="column" .padding=${["0","s","s","s"]} gap="xs"> 4075 ${this.recommendedWalletsTemplate()} 4076 <wui-list-wallet 4077 name="Explore all" 4078 showAllWallets 4079 walletIcon="allWallets" 4080 icon="externalLink" 4081 @click=${()=>{u.w.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}} 4082 ></wui-list-wallet> 4083 </wui-flex> 4084 `}recommendedWalletsTemplate(){let{recommended:e,featured:t}=t$.N.state,{customWallets:i}=n.H.state;return[...t,...i??[],...e].slice(0,4).map(e=>(0,o.qy)` 4085 <wui-list-wallet 4086 name=${e.name??"Unknown"} 4087 tagVariant="main" 4088 imageSrc=${(0,r.J)(c.$.getWalletImage(e))} 4089 @click=${()=>{u.w.openHref(e.homepage??"https://walletconnect.com/explorer","_blank")}} 4090 ></wui-list-wallet> 4091 `)}};ol=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n}([(0,h.EM)("w3m-get-wallet-view")],ol),i(19804);var oc=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let od=class extends o.WF{constructor(){super(...arguments),this.data=[]}render(){return(0,o.qy)` 4092 <wui-flex flexDirection="column" alignItems="center" gap="l"> 4093 ${this.data.map(e=>(0,o.qy)` 4094 <wui-flex flexDirection="column" alignItems="center" gap="xl"> 4095 <wui-flex flexDirection="row" justifyContent="center" gap="1xs"> 4096 ${e.images.map(e=>(0,o.qy)`<wui-visual name=${e}></wui-visual>`)} 4097 </wui-flex> 4098 </wui-flex> 4099 <wui-flex flexDirection="column" alignItems="center" gap="xxs"> 4100 <wui-text variant="paragraph-500" color="fg-100" align="center"> 4101 ${e.title} 4102 </wui-text> 4103 <wui-text variant="small-500" color="fg-200" align="center">${e.text}</wui-text> 4104 </wui-flex> 4105 `)} 4106 </wui-flex> 4107 `}};oc([(0,a.MZ)({type:Array})],od.prototype,"data",void 0),od=oc([(0,h.EM)("w3m-help-widget")],od);let ou=[{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."}],op=class extends o.WF{render(){return(0,o.qy)` 4108 <wui-flex 4109 flexDirection="column" 4110 .padding=${["xxl","xl","xl","xl"]} 4111 alignItems="center" 4112 gap="xl" 4113 > 4114 <w3m-help-widget .data=${ou}></w3m-help-widget> 4115 <wui-button variant="main" size="md" @click=${this.onGetWallet.bind(this)}> 4116 <wui-icon color="inherit" slot="iconLeft" name="wallet"></wui-icon> 4117 Get a wallet 4118 </wui-button>
4118 4119 </wui-flex> 4120 `}onGetWallet(){j.E.sendEvent({type:"track",event:"CLICK_GET_WALLET"}),G.I.push("GetWallet")}};op=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n}([(0,h.EM)("w3m-what-is-a-wallet-view")],op);let oh=(0,o.AH)` 4121 wui-flex { 4122 max-height: clamp(360px, 540px, 80vh); 4123 overflow: scroll; 4124 scrollbar-width: none; 4125 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 4126 will-change: opacity; 4127 } 4128 wui-flex::-webkit-scrollbar { 4129 display: none; 4130 } 4131 wui-flex.disabled { 4132 opacity: 0.3; 4133 pointer-events: none; 4134 user-select: none; 4135 } 4136`;var ow=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let og=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.checked=t_.o.state.isLegalCheckboxChecked,this.unsubscribe.push(t_.o.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.H.state,i=n.H.state.features?.legalCheckbox,a=!!(e||t)&&!!i,s=a&&!this.checked;return(0,o.qy)` 4137 <w3m-legal-checkbox></w3m-legal-checkbox> 4138 <wui-flex 4139 flexDirection="column" 4140 .padding=${a?["0","s","s","s"]:"s"} 4141 gap="xs" 4142 class=${(0,r.J)(s?"disabled":void 0)} 4143 > 4144 <w3m-wallet-login-list tabIdx=${(0,r.J)(s?-1:void 0)}></w3m-wallet-login-list> 4145 </wui-flex> 4146 <w3m-legal-footer></w3m-legal-footer> 4147 `}};og.styles=oh,ow([(0,a.wk)()],og.prototype,"checked",void 0),og=ow([(0,h.EM)("w3m-connect-wallets-view")],og);let ob=(0,o.AH)` 4148 :host { 4149 display: block; 4150 width: var(--wui-box-size-lg); 4151 height: var(--wui-box-size-lg); 4152 } 4153 4154 svg { 4155 width: var(--wui-box-size-lg); 4156 height: var(--wui-box-size-lg); 4157 fill: none; 4158 stroke: transparent; 4159 stroke-linecap: round; 4160 } 4161 4162 use { 4163 stroke: var(--wui-color-accent-100); 4164 stroke-width: 2px; 4165 stroke-dasharray: 54, 118; 4166 stroke-dashoffset: 172; 4167 animation: dash 1s linear infinite; 4168 } 4169 4170 @keyframes dash { 4171 to { 4172 stroke-dashoffset: 0px; 4173 } 4174 } 4175`,of=class extends o.WF{render(){return(0,o.qy)` 4176 <svg viewBox="0 0 54 59"> 4177 <path 4178 id="wui-loader-path" 4179 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" 4180 /> 4181 <use xlink:href="#wui-loader-path"></use> 4182 </svg> 4183 `}};of.styles=[w.W5,ob],of=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n}([(0,b.E)("wui-loading-hexagon")],of),i(48347);let om=(0,o.AH)` 4184 @keyframes shake { 4185 0% { 4186 transform: translateX(0); 4187 } 4188 25% { 4189 transform: translateX(3px); 4190 } 4191 50% { 4192 transform: translateX(-3px); 4193 } 4194 75% { 4195 transform: translateX(3px); 4196 } 4197 100% { 4198 transform: translateX(0); 4199 } 4200 } 4201 4202 wui-flex:first-child:not(:only-child) { 4203 position: relative; 4204 } 4205 4206 wui-loading-hexagon { 4207 position: absolute; 4208 } 4209 4210 wui-icon-box { 4211 position: absolute; 4212 right: 4px; 4213 bottom: 0; 4214 opacity: 0; 4215 transform: scale(0.5); 4216 z-index: 1; 4217 } 4218 4219 wui-button { 4220 display: none; 4221 } 4222 4223 [data-error='true'] wui-icon-box { 4224 opacity: 1; 4225 transform: scale(1); 4226 } 4227 4228 [data-error='true'] > wui-flex:first-child { 4229 animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; 4230 } 4231 4232 wui-button[data-retry='true'] { 4233 display: block; 4234 opacity: 1; 4235 } 4236`;var ov=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let oy=class extends o.WF{constructor(){super(),this.network=G.I.state.data?.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}
4236disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw Error("w3m-network-switch-view: No network provided");this.onShowRetry();let e=this.getLabel(),t=this.getSubLabel();return(0,o.qy)` 4237 <wui-flex 4238 data-error=${this.error} 4239 flexDirection="column" 4240 alignItems="center" 4241 .padding=${["3xl","xl","3xl","xl"]} 4242 gap="xl" 4243 > 4244 <wui-flex justifyContent="center" alignItems="center"> 4245 <wui-network-image 4246 size="lg" 4247 imageSrc=${(0,r.J)(c.$.getNetworkImage(this.network))} 4248 ></wui-network-image> 4249 4250 ${this.error?null:(0,o.qy)`<wui-loading-hexagon></wui-loading-hexagon>`} 4251 4252 <wui-icon-box 4253 backgroundColor="error-100" 4254 background="opaque" 4255 iconColor="error-100" 4256 icon="close" 4257 size="sm" 4258 ?border=${!0} 4259 borderColor="wui-color-bg-125" 4260 ></wui-icon-box> 4261 </wui-flex> 4262 4263 <wui-flex flexDirection="column" alignItems="center" gap="xs"> 4264 <wui-text align="center" variant="paragraph-500" color="fg-100">${e}</wui-text> 4265 <wui-text align="center" variant="small-500" color="fg-200">${t}</wui-text> 4266 </wui-flex> 4267 4268 <wui-button 4269 data-retry=${this.showRetry} 4270 variant="accent" 4271 size="md" 4272 .disabled=${!this.error} 4273 @click=${this.onSwitchNetwork.bind(this)} 4274 > 4275 <wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon> 4276 Try again 4277 </wui-button> 4278 </wui-flex> 4279 `}getSubLabel(){let e=s.W.state.activeChain,t=V.a.getConnectorId(e);return V.a.getAuthConnector()&&t===_.o.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(){let e=s.W.state.activeChain,t=V.a.getConnectorId(e);return V.a.getAuthConnector()&&t===_.o.CONNECTOR_ID.AUTH?`Switching to ${this.network?.name??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){if(this.error&&!this.showRetry){this.showRetry=!0;let e=this.shadowRoot?.querySelector("wui-button");e?.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onSwitchNetwork(){try{this.error=!1,s.W.state.activeChain!==this.network?.chainNamespace&&s.W.setIsSwitchingNamespace(!0),this.network&&s.W.switchActiveNetwork(this.network)}catch(e){this.error=!0}}};oy.styles=om,ov([(0,a.wk)()],oy.prototype,"showRetry",void 0),ov([(0,a.wk)()],oy.prototype,"error",void 0),oy=ov([(0,h.EM)("w3m-network-switch-view")],oy);var ox=i(80977);i(65759),i(45217);let ok=(0,o.AH)` 4280 button { 4281 column-gap: var(--wui-spacing-s); 4282 padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); 4283 width: 100%; 4284 transition: all var(--wui-ease-out-power-1) var(--wui-duration-md); 4285 border-radius: var(--wui-border-radius-xs); 4286 color: var(--wui-color-fg-100); 4287 } 4288 4289 button > wui-text:nth-child(2) { 4290 display: flex; 4291 flex: 1; 4292 } 4293 4294 button[data-transparent='true'] { 4295 pointer-events: none; 4296 background-color: transparent; 4297 } 4298 4299 button:hover { 4300 background-color: var(--wui-color-gray-glass-002); 4301 } 4302 4303 button:active { 4304 background-color: var(--wui-color-gray-glass-005); 4305 } 4306 4307 wui-image { 4308 width: var(--wui-spacing-3xl); 4309 height: var(--wui-spacing-3xl); 4310 border-radius: 100%; 4311 } 4312 4313 button:disabled { 4314 background-color: var(--wui-color-gray-glass-002); 4315 opacity: 0.5; 4316 cursor: not-allowed; 4317 } 4318 4319 button:disabled > wui-tag { 4320 background-color: var(--wui-color-gray-glass-010); 4321 color: var(--wui-color-fg-300); 4322 } 4323`;var oC=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let o$=class extends o.WF{constructor(){super(...arguments),this.imageSrc="",this.name="",this.disabled=!1,this.selected=!1,this.transparent=!1}render(){return(0,o.qy)` 4324 <button data-transparent=${this.transparent} ?disabled=${this.disabled}> 4325 <wui-flex gap="s" alignItems="center"> 4326 ${this.templateNetworkImage()} 4327 <wui-text variant="paragraph-500" color="inherit">${this.name}</wui-text></wui-flex 4328 > 4329 ${this.checkmarkTemplate()} 4330 </button> 4331 `}checkmarkTemplate(){return this.selected?(0,o.qy)`<wui-icon size="sm" color="accent-100" name="checkmarkBold"></wui-icon>`:null}templateNetworkImage(){return this.imageSrc?(0,o.qy)`<wui-image size="sm" src=${this.imageSrc} name=${this.name}></wui-image>`:this.imageSrc?null:(0,o.qy)`<wui-network-image 4332 ?round=${!0} 4333 size="md" 4334 name=${this.name} 4335 ></wui-network-image>`}};o$.styles=[w.W5,w.fD,ok],oC([(0,a.MZ)()],o$.prototype,"imageSrc",void 0),oC([(0,a.MZ)()],o$.prototype,"name",void 0),oC([(0,a.MZ)({type:Boolean})],o$.prototype,"disabled",void 0),oC([(0,a.MZ)({type:Boolean})],o$.prototype,"selected",void 0),oC([(0,a.MZ)({type:Boolean})],o$.prototype,"transparent",void 0),o$=oC([(0,b.E)("wui-list-network")],o$);let oS=(0,o.AH)` 4336 .container { 4337 max-height: 360px; 4338 overflow: auto; 4339 } 4340 4341 .container::-webkit-scrollbar {
4342 display: none; 4343 } 4344`;var oI=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let oA=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.network=s.W.state.activeCaipNetwork,this.requestedCaipNetworks=s.W.getCaipNetworks(),this.search="",this.onDebouncedSearch=u.w.debounce(e=>{this.search=e},100),this.unsubscribe.push(l.j.subscribeNetworkImages(()=>this.requestUpdate()),s.W.subscribeKey("activeCaipNetwork",e=>this.network=e),s.W.subscribe(()=>{this.requestedCaipNetworks=s.W.getAllRequestedCaipNetworks()}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,o.qy)` 4345 ${this.templateSearchInput()} 4346 <wui-flex 4347 class="container" 4348 .padding=${["0","s","s","s"]} 4349 flexDirection="column" 4350 gap="xs" 4351 > 4352 ${this.networksTemplate()} 4353 </wui-flex> 4354 4355 <wui-separator></wui-separator> 4356 4357 <wui-flex padding="s" flexDirection="column" gap="m" alignItems="center"> 4358 <wui-text variant="small-400" color="fg-300" align="center"> 4359 Your connected wallet may not support some of the networks available for this dApp 4360 </wui-text> 4361 <wui-link @click=${this.onNetworkHelp.bind(this)}> 4362 <wui-icon size="xs" color="accent-100" slot="iconLeft" name="helpCircle"></wui-icon> 4363 What is a network 4364 </wui-link> 4365 </wui-flex> 4366 `}templateSearchInput(){return(0,o.qy)` 4367 <wui-flex gap="xs" .padding=${["0","s","s","s"]}> 4368 <wui-input-text 4369 @inputChange=${this.onInputChange.bind(this)} 4370 class="network-search-input" 4371 size="md" 4372 placeholder="Search network" 4373 icon="search" 4374 ></wui-input-text> 4375 </wui-flex> 4376 `}onInputChange(e){this.onDebouncedSearch(e.detail)}onNetworkHelp(){j.E.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),G.I.push("WhatIsANetwork")}networksTemplate(){let e=s.W.getAllApprovedCaipNetworkIds(),t=u.w.sortRequestedNetworks(e,this.requestedCaipNetworks);return this.search?this.filteredNetworks=t?.filter(e=>e?.name?.toLowerCase().includes(this.search.toLowerCase())):this.filteredNetworks=t,this.filteredNetworks?.map(e=>(0,o.qy)` 4377 <wui-list-network 4378 .selected=${this.network?.id===e.id} 4379 imageSrc=${(0,r.J)(c.$.getNetworkImage(e))} 4380 type="network" 4381 name=${e.name??e.id} 4382 @click=${()=>this.onSwitchNetwork(e)} 4383 .disabled=${this.getNetworkDisabled(e)} 4384 data-testid=${`w3m-network-switch-${e.name??e.id}`} 4385 ></wui-list-network> 4386 `)}getNetworkDisabled(e){let t=e.chainNamespace,i=d.U.getCaipAddress(t),o=s.W.getAllApprovedCaipNetworkIds(),a=!1!==s.W.getNetworkProp("supportsAllNetworks",t),r=V.a.getConnectorId(t),n=V.a.getAuthConnector(),l=r===_.o.CONNECTOR_ID.AUTH&&n;return!!i&&!a&&!l&&!o?.includes(e.caipNetworkId)}onSwitchNetwork(e){ox.L.onSwitchNetwork({network:e})}};oA.styles=oS,oI([(0,a.wk)()],oA.prototype,"network",void 0),oI([(0,a.wk)()],oA.prototype,"requestedCaipNetworks",void 0),oI([(0,a.wk)()],oA.prototype,"filteredNetworks",void 0),oI([(0,a.wk)()],oA.prototype,"search",void 0),oA=oI([(0,h.EM)("w3m-networks-view")],oA);let oE=(0,o.AH)` 4387 @keyframes shake { 4388 0% { 4389 transform: translateX(0); 4390 } 4391 25% { 4392 transform: translateX(3px); 4393 } 4394 50% { 4395 transform: translateX(-3px); 4396 } 4397 75% { 4398 transform: translateX(3px); 4399 } 4400 100% { 4401 transform: translateX(0); 4402 } 4403 } 4404 4405 wui-flex:first-child:not(:only-child) { 4406 position: relative; 4407 } 4408 4409 wui-loading-thumbnail { 4410 position: absolute; 4411 } 4412 4413 wui-visual { 4414 width: var(--wui-wallet-image-size-lg); 4415 height: var(--wui-wallet-image-size-lg); 4416 border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); 4417 position: relative; 4418 overflow: hidden; 4419 } 4420 4421 wui-visual::after { 4422 content: ''; 4423 display: block; 4424 width: 100%; 4425 height: 100%; 4426 position: absolute; 4427 inset: 0; 4428 border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); 4429 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); 4430 } 4431 4432 wui-icon-box { 4433 position: absolute; 4434 right: calc(var(--wui-spacing-3xs) * -1); 4435 bottom: calc(var(--wui-spacing-3xs) * -1); 4436 opacity: 0; 4437 transform: scale(0.5); 4438 transition: 4439 opacity var(--wui-ease-out-power-2) var(--wui-duration-lg), 4440 transform var(--wui-ease-out-power-2) var(--wui-duration-lg); 4441 will-change: opacity, transform; 4442 } 4443 4444 wui-text[align='center'] { 4445 width: 100%; 4446 padding: 0px var(--wui-spacing-l); 4447 } 4448 4449 [data-error='true'] wui-icon-box { 4450 opacity: 1; 4451 transform: scale(1); 4452 } 4453 4454 [data-error='true'] > wui-flex:first-child { 4455 animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; 4456 } 4457 4458 [data-retry='false'] wui-link { 4459 display: none; 4460 } 4461 4462 [data-retry='true'] wui-link { 4463 display: block; 4464 opacity: 1; 4465 } 4466 4467 wui-link { 4468 padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); 4469 } 4470 4471 .capitalize { 4472 text-transform: capitalize; 4473 } 4474`;var oT=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let oR={eip155:"eth",solana:"solana",bip122:"bitcoin",polkadot:void 0},oW=class extends o.WF{constructor(){super(...arguments),this.unsubscribe=[],this.switchToChain=G.I.state.data?.switchToChain,this.caipNetwork=G.I.state.data?.network,this.activeChain=s.W.state.activeChain}firstUpdated(){this.unsubscribe.push(s.W.subscribeKey("activeChain",e=>this.activeChain=e))}
4474disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.switchToChain?_.o.CHAIN_NAME_MAP[this.switchToChain]:"supported";if(!this.switchToChain)return null;let t=_.o.CHAIN_NAME_MAP[this.switchToChain];return(0,o.qy)` 4475 <wui-flex 4476 flexDirection="column" 4477 alignItems="center" 4478 .padding=${["3xl","xl","xl","xl"]} 4479 gap="xl" 4480 > 4481 <wui-flex justifyContent="center" flexDirection="column" alignItems="center" gap="xl"> 4482 <wui-visual name=${(0,r.J)(oR[this.switchToChain])}></wui-visual> 4483 <wui-text 4484 data-testid=${`w3m-switch-active-chain-to-${t}`} 4485 variant="paragraph-500" 4486 color="fg-100" 4487 align="center" 4488 >Switch to <span class="capitalize">${t}</span></wui-text 4489 > 4490 <wui-text variant="small-400" color="fg-200" align="center"> 4491 Connected wallet doesn't support connecting to ${e} chain. You 4492 need to connect with a different wallet. 4493 </wui-text> 4494 <wui-button 4495 data-testid="w3m-switch-active-chain-button" 4496 size="md" 4497 @click=${this.switchActiveChain.bind(this)} 4498 >Switch</wui-button 4499 > 4500 </wui-flex> 4501 </wui-flex> 4502 `}async switchActiveChain(){this.switchToChain&&(s.W.setIsSwitchingNamespace(!0),V.a.setFilterByNamespace(this.switchToChain),this.caipNetwork?await s.W.switchActiveNetwork(this.caipNetwork):s.W.setActiveNamespace(this.switchToChain),G.I.reset("Connect"))}};oW.styles=oE,oT([(0,a.MZ)()],oW.prototype,"activeChain",void 0),oW=oT([(0,h.EM)("w3m-switch-active-chain-view")],oW);let oO=[{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."}],oN=class extends o.WF{render(){return(0,o.qy)` 4503 <wui-flex 4504 flexDirection="column" 4505 .padding=${["xxl","xl","xl","xl"]} 4506 alignItems="center" 4507 gap="xl" 4508 > 4509 <w3m-help-widget .data=${oO}></w3m-help-widget> 4510 <wui-button 4511 variant="main" 4512 size="md" 4513 @click=${()=>{u.w.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}} 4514 > 4515 Learn more 4516 <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon> 4517 </wui-button> 4518 </wui-flex> 4519 `}};oN=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n}([(0,h.EM)("w3m-what-is-a-network-view")],oN);let oM=(0,o.AH)` 4520 :host > wui-flex { 4521 max-height: clamp(360px, 540px, 80vh); 4522 overflow: scroll; 4523 scrollbar-width: none; 4524 } 4525 4526 :host > wui-flex::-webkit-scrollbar {
4527 display: none; 4528 } 4529`;var oP=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let oj=class extends o.WF{constructor(){super(),this.swapUnsupportedChain=G.I.state.data?.swapUnsupportedChain,this.unsubscribe=[],this.disconecting=!1,this.unsubscribe.push(l.j.subscribeNetworkImages(()=>this.requestUpdate()))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,o.qy)` 4530 <wui-flex class="container" flexDirection="column" gap="0"> 4531 <wui-flex 4532 class="container" 4533 flexDirection="column" 4534 .padding=${["m","xl","xs","xl"]} 4535 alignItems="center" 4536 gap="xl" 4537 > 4538 ${this.descriptionTemplate()} 4539 </wui-flex> 4540 4541 <wui-flex flexDirection="column" padding="s" gap="xs"> 4542 ${this.networksTemplate()} 4543 </wui-flex> 4544 4545 <wui-separator text="or"></wui-separator> 4546 <wui-flex flexDirection="column" padding="s" gap="xs"> 4547 <wui-list-item 4548 variant="icon" 4549 iconVariant="overlay" 4550 icon="disconnect" 4551 ?chevron=${!1} 4552 .loading=${this.disconecting} 4553 @click=${this.onDisconnect.bind(this)} 4554 data-testid="disconnect-button" 4555 > 4556 <wui-text variant="paragraph-500" color="fg-200">Disconnect</wui-text> 4557 </wui-list-item> 4558 </wui-flex> 4559 </wui-flex> 4560 `}descriptionTemplate(){return this.swapUnsupportedChain?(0,o.qy)` 4561 <wui-text variant="small-400" color="fg-200" align="center"> 4562 The swap feature doesnât support your current network. Switch to an available option to 4563 continue. 4564 </wui-text> 4565 `:(0,o.qy)` 4566 <wui-text variant="small-400" color="fg-200" align="center"> 4567 This app doesnât support your current network. Switch to an available option to continue. 4568 </wui-text> 4569 `}networksTemplate(){let e=s.W.getAllRequestedCaipNetworks(),t=s.W.getAllApprovedCaipNetworkIds(),i=u.w.sortRequestedNetworks(t,e);return(this.swapUnsupportedChain?i.filter(e=>J.oU.SWAP_SUPPORTED_NETWORKS.includes(e.caipNetworkId)):i).map(e=>(0,o.qy)` 4570 <wui-list-network 4571 imageSrc=${(0,r.J)(c.$.getNetworkImage(e))} 4572 name=${e.name??"Unknown"} 4573 @click=${()=>this.onSwitchNetwork(e)} 4574 > 4575 </wui-list-network> 4576 `)}async onDisconnect(){try{this.disconecting=!0,await Y.x.disconnect(),p.W.close()}catch{j.E.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),K.P.showError("Failed to disconnect")}finally{this.disconecting=!1}}async onSwitchNetwork(e){let t=d.U.state.caipAddress,i=s.W.getAllApprovedCaipNetworkIds(),o=(s.W.getNetworkProp("supportsAllNetworks",e.chainNamespace),G.I.state.data);t?i?.includes(e.caipNetworkId)?await s.W.switchActiveNetwork(e):G.I.push("SwitchNetwork",{...o,network:e}):t||(s.W.setActiveCaipNetwork(e),G.I.push("Connect"))}};oj.styles=oM,oP([(0,a.wk)()],oj.prototype,"disconecting",void 0),oj=oP([(0,h.EM)("w3m-unsupported-chain-view")],oj);let oq=(0,o.AH)` 4577 wui-flex { 4578 width: 100%; 4579 background-color: var(--wui-color-gray-glass-005); 4580 border-radius: var(--wui-border-radius-s); 4581 padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs) 4582 var(--wui-spacing-1xs); 4583 } 4584`;var oD=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let oU=class extends o.WF{constructor(){super(...arguments),this.icon="externalLink",this.text=""}render(){return(0,o.qy)` 4585 <wui-flex gap="1xs" alignItems="center"> 4586 <wui-icon-box 4587 size="sm" 4588 iconcolor="fg-200" 4589 backgroundcolor="fg-200" 4590 icon=${this.icon} 4591 background="transparent" 4592 ></wui-icon-box> 4593 <wui-text variant="small-400" color="fg-200">${this.text}</wui-text> 4594 </wui-flex> 4595 `}};oU.styles=[w.W5,w.fD,oq],oD([(0,a.MZ)()],oU.prototype,"icon",void 0),oD([(0,a.MZ)()],oU.prototype,"text",void 0),oU=oD([(0,b.E)("wui-banner")],oU);let oL=(0,o.AH)` 4596 :host > wui-flex { 4597 max-height: clamp(360px, 540px, 80vh); 4598 overflow: scroll; 4599 scrollbar-width: none; 4600 } 4601 4602 :host > wui-flex::-webkit-scrollbar {
4603 display: none; 4604 } 4605`;var oz=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let oZ=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.preferredAccountTypes=d.U.state.preferredAccountTypes,this.unsubscribe.push(d.U.subscribeKey("preferredAccountTypes",e=>{this.preferredAccountTypes=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,o.qy)` <wui-flex 4606 flexDirection="column" 4607 .padding=${["xs","s","m","s"]} 4608 gap="xs" 4609 > 4610 <wui-banner 4611 icon="warningCircle" 4612 text="You can only receive assets on these networks" 4613 ></wui-banner> 4614 ${this.networkTemplate()} 4615 </wui-flex>`}networkTemplate(){let e=s.W.getAllRequestedCaipNetworks(),t=s.W.getAllApprovedCaipNetworkIds(),i=s.W.state.activeCaipNetwork,a=s.W.checkIfSmartAccountEnabled(),n=u.w.sortRequestedNetworks(t,e);if(a&&this.preferredAccountTypes?.[i?.chainNamespace]===ei.Vl.ACCOUNT_TYPES.SMART_ACCOUNT){if(!i)return null;n=[i]}return n.filter(e=>e.chainNamespace===i?.chainNamespace).map(e=>(0,o.qy)` 4616 <wui-list-network 4617 imageSrc=${(0,r.J)(c.$.getNetworkImage(e))} 4618 name=${e.name??"Unknown"} 4619 ?transparent=${!0} 4620 > 4621 </wui-list-network> 4622 `)}};oZ.styles=oL,oz([(0,a.wk)()],oZ.prototype,"preferredAccountTypes",void 0),oZ=oz([(0,h.EM)("w3m-wallet-compatible-networks-view")],oZ);var oB=i(45954);let oF=(0,o.AH)` 4623 :host { 4624 display: flex; 4625 justify-content: center; 4626 align-items: center; 4627 width: var(--wui-icon-box-size-xl); 4628 height: var(--wui-icon-box-size-xl); 4629 box-shadow: 0 0 0 8px var(--wui-thumbnail-border); 4630 border-radius: var(--local-border-radius); 4631 overflow: hidden; 4632 } 4633 4634 wui-icon { 4635 width: 32px; 4636 height: 32px; 4637 } 4638`;var oH=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let o_=class extends o.WF{render(){return this.style.cssText=`--local-border-radius: ${this.borderRadiusFull?"1000px":"20px"}; background-color: var(--wui-color-modal-bg);`,(0,o.qy)`${this.templateVisual()}`}templateVisual(){return this.imageSrc?(0,o.qy)`<wui-image src=${this.imageSrc} alt=${this.alt??""}></wui-image>`:(0,o.qy)`<wui-icon 4639 data-parent-size="md" 4640 size="inherit" 4641 color="inherit" 4642 name="walletPlaceholder" 4643 ></wui-icon>`}};o_.styles=[w.W5,oF],oH([(0,a.MZ)()],o_.prototype,"imageSrc",void 0),oH([(0,a.MZ)()],o_.prototype,"alt",void 0),oH([(0,a.MZ)({type:Boolean})],o_.prototype,"borderRadiusFull",void 0),o_=oH([(0,b.E)("wui-visual-thumbnail")],o_);let oV=(0,o.AH)` 4644 :host { 4645 display: flex; 4646 justify-content: center; 4647 gap: var(--wui-spacing-2xl); 4648 } 4649 4650 wui-visual-thumbnail:nth-child(1) { 4651 z-index: 1; 4652 } 4653`,oJ=class extends o.WF{constructor(){super(...arguments),this.dappImageUrl=n.H.state.metadata?.icons,this.walletImageUrl=d.U.state.connectedWalletInfo?.icon}firstUpdated(){let e=this.shadowRoot?.querySelectorAll("wui-visual-thumbnail");e?.[0]&&this.createAnimation(e[0],"translate(18px)"),e?.[1]&&this.createAnimation(e[1],"translate(-18px)")}render(){return(0,o.qy)` 4654 <wui-visual-thumbnail 4655 ?borderRadiusFull=${!0} 4656 .imageSrc=${this.dappImageUrl?.[0]} 4657 ></wui-visual-thumbnail> 4658 <wui-visual-thumbnail .imageSrc=${this.walletImageUrl}></wui-visual-thumbnail> 4659 `}createAnimation(e,t){e.animate([{transform:"translateX(0px)"},{transform:t}],{duration:1600,easing:"cubic-bezier(0.56, 0, 0.48, 1)",direction:"alternate",iterations:1/0})}};oJ.styles=oV,oJ=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n}([(0,h.EM)("w3m-siwx-sign-message-thumbnails")],oJ);var oK=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let oG=class extends o.WF{constructor(){super(...arguments),this.dappName=n.H.state.metadata?.name,this.isCancelling=!1,this.isSigning=!1}render(){return(0,o.qy)` 4660 <wui-flex justifyContent="center" .padding=${["2xl","0","xxl","0"]}> 4661 <w3m-siwx-sign-message-thumbnails></w3m-siwx-sign-message-thumbnails> 4662 </wui-flex> 4663 <wui-flex 4664 .padding=${["0","4xl","l","4xl"]} 4665 gap="s" 4666 justifyContent="space-between" 4667 > 4668 <wui-text variant="paragraph-500" align="center" color="fg-100" 4669 >${this.dappName??"Dapp"} needs to connect to your wallet</wui-text 4670 > 4671 </wui-flex> 4672 <wui-flex 4673 .padding=${["0","3xl","l","3xl"]} 4674 gap="s" 4675 justifyContent="space-between" 4676 > 4677 <wui-text variant="small-400" align="center" color="fg-200" 4678 >Sign this message to prove you own this wallet and proceed. Canceling will disconnect 4679 you.</wui-text 4680 > 4681 </wui-flex> 4682 <wui-flex .padding=${["l","xl","xl","xl"]}
4682 gap="s" justifyContent="space-between"> 4683 <wui-button 4684 size="lg" 4685 borderRadius="xs" 4686 fullWidth 4687 variant="neutral" 4688 ?loading=${this.isCancelling} 4689 @click=${this.onCancel.bind(this)} 4690 data-testid="w3m-connecting-siwe-cancel" 4691 > 4692 ${this.isCancelling?"Cancelling...":"Cancel"} 4693 </wui-button> 4694 <wui-button 4695 size="lg" 4696 borderRadius="xs" 4697 fullWidth 4698 variant="main" 4699 @click=${this.onSign.bind(this)} 4700 ?loading=${this.isSigning} 4701 data-testid="w3m-connecting-siwe-sign" 4702 > 4703 ${this.isSigning?"Signing...":"Sign"} 4704 </wui-button> 4705 </wui-flex> 4706 `}async onSign(){this.isSigning=!0,await oB.U.requestSignMessage().finally(()=>this.isSigning=!1)}async onCancel(){this.isCancelling=!0,await oB.U.cancelSignMessage().finally(()=>this.isCancelling=!1)}};oK([(0,a.wk)()],oG.prototype,"isCancelling",void 0),oK([(0,a.wk)()],oG.prototype,"isSigning",void 0),oG=oK([(0,h.EM)("w3m-siwx-sign-message-view")],oG)},76927:(e,t,i)=>{var o=i(28312),a=i(745);i(23499),i(25322),i(98750),i(43804);var r=i(97265),n=i(59970),s=i(54166);let l=(0,o.AH)` 4707 button { 4708 padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs); 4709 display: flex; 4710 justify-content: space-between; 4711 width: 100%; 4712 border-radius: var(--wui-border-radius-xs); 4713 background-color: var(--wui-color-gray-glass-002); 4714 } 4715 4716 button[data-clickable='false'] { 4717 pointer-events: none; 4718 background-color: transparent; 4719 } 4720 4721 wui-image, 4722 wui-icon { 4723 width: var(--wui-spacing-3xl); 4724 height: var(--wui-spacing-3xl); 4725 } 4726 4727 wui-image { 4728 border-radius: var(--wui-border-radius-3xl); 4729 } 4730`;var c=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let d=class extends o.WF{constructor(){super(...arguments),this.tokenName="",this.tokenImageUrl="",this.tokenValue=0,this.tokenAmount="0.0",this.tokenCurrency="",this.clickable=!1}render(){return(0,o.qy)` 4731 <button data-clickable=${String(this.clickable)}> 4732 <wui-flex gap="s" alignItems="center"> 4733 ${this.visualTemplate()} 4734 <wui-flex flexDirection="column" justifyContent="spaceBetween"> 4735 <wui-text variant="paragraph-500" color="fg-100">${this.tokenName}</wui-text> 4736 <wui-text variant="small-400" color="fg-200"> 4737 ${n.Z.formatNumberToLocalString(this.tokenAmount,4)} ${this.tokenCurrency} 4738 </wui-text> 4739 </wui-flex> 4740 </wui-flex> 4741 <wui-text variant="paragraph-500" color="fg-100">$${this.tokenValue.toFixed(2)}</wui-text> 4742 </button> 4743 `}visualTemplate(){return this.tokenName&&this.tokenImageUrl?(0,o.qy)`<wui-image alt=${this.tokenName} src=${this.tokenImageUrl}></wui-image>`:(0,o.qy)`<wui-icon name="coinPlaceholder" color="fg-100"></wui-icon>`}};d.styles=[r.W5,r.fD,l],c([(0,a.MZ)()],d.prototype,"tokenName",void 0),c([(0,a.MZ)()],d.prototype,"tokenImageUrl",void 0),c([(0,a.MZ)({type:Number})],d.prototype,"tokenValue",void 0),c([(0,a.MZ)()],d.prototype,"tokenAmount",void 0),c([(0,a.MZ)()],d.prototype,"tokenCurrency",void 0),c([(0,a.MZ)({type:Boolean})],d.prototype,"clickable",void 0),d=c([(0,s.E)("wui-list-token")],d)},89188:(e,t,i)=>{var o=i(28312),a=i(745),r=i(51882);i(98750);var n=i(97265),s=i(54166);i(23050);let l=(0,o.AH)` 4744 button { 4745 column-gap: var(--wui-spacing-s); 4746 padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); 4747 width: 100%; 4748 justify-content: flex-start; 4749 background-color: var(--wui-color-gray-glass-002); 4750 border-radius: var(--wui-border-radius-xs); 4751 color: var(--wui-color-fg-100); 4752 } 4753 4754 wui-text { 4755 text-transform: capitalize; 4756 } 4757 4758 wui-text[data-align='left'] { 4759 display: flex; 4760 flex: 1; 4761 } 4762 4763 wui-text[data-align='center'] { 4764 display: flex; 4765 flex: 1; 4766 justify-content: center; 4767 } 4768 4769 .invisible { 4770 opacity: 0; 4771 pointer-events: none; 4772 } 4773 4774 button:disabled { 4775 background-color: var(--wui-color-gray-glass-015); 4776 color: var(--wui-color-gray-glass-015); 4777 } 4778`;var c=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let d=class extends o.WF{constructor(){super(...arguments),this.logo="google",this.name="Continue with google",this.align="left",this.disabled=!1}render(){return(0,o.qy)` 4779 <button ?disabled=${this.disabled} tabindex=${(0,r.J)(this.tabIdx)}> 4780 <wui-logo logo=${this.logo}></wui-logo> 4781 <wui-text 4782 data-align=${this.align} 4783 variant="paragraph-500" 4784 color="inherit" 4785 align=${this.align} 4786 >${this.name}</wui-text 4787 > 4788 ${this.templatePlacement()} 4789 </button> 4790 `}templatePlacement(){return"center"===this.align?(0,o.qy)` <wui-logo class="invisible" logo=${this.logo}></wui-logo>`:null}};d.styles=[n.W5,n.fD,l],c([(0,a.MZ)()],d.prototype,"logo",void 0),c([(0,a.MZ)()],d.prototype,"name",void 0),c([(0,a.MZ)()],d.prototype,"align",void 0),c([(0,a.MZ)()],d.prototype,"tabIdx",void 0),c([(0,a.MZ)({type:Boolean})],d.prototype,"disabled",void 0),d=c([(0,s.E)("wui-list-social")],d)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.