import{hh as v,hi as _,hj as T,hk as f,hl as l,fw as u,fy as x,jM as _e,iR as S,fq as $,fr as b,ic as D,hm as ne,fp as I,iZ as fe,hy as w,hs as A,hq as m,fx as P,fs as k,ht as ve,hu as le,hr as y,ka as Sn,mk as We,ml as xe,mm as X,jG as An,k8 as E,mn as Te,hw as rn,jn as In,jm as En,jl as kn,iS as ri,mo as _n,mp as Wn,k7 as Li}from"./BC4hLSsA.js";import{n as c,c as p,U as V,r as d,a as an}from"./3Z1LeTmD.js";import{o as h}from"./DMVgneVN.js";import"./BhF09lic.js";import"./Jaeeh8gf.js";import"./DY1uUPRR.js";import"./DSghw-ck.js";import{a as wa,W as ma}from"./B9T8Av0b.js";import"./D65k8hAI.js";import"./BpkBkA6l.js";import"./CPKRQwYP.js";import{H as bi}from"./mp1cK3d-.js";import"./B8rXaDJr.js";import"./CW2vKvSC.js";import"./B9qpa0Qs.js";import{M as At}from"./Ct1ubMCv.js";import"./CpW-UKVx.js";import{n as Tn}from"./sjf_RL4T.js";import"./DLzWms3J.js";import{e as gi,n as yi}from"./DknQKSKj.js";import"./D2ohfqWB.js";import"./Ck6QfCWr.js";import"./wDRXYCg3.js";import"./Ci8QpLKo.js";import{O as It}from"./AgsAcQ8m.js";import{e as Nn}from"./C-VEW1lj.js";import"./CApR9HH9.js";import"./CH4N-1kM.js";import{N as Rn}from"./DmfK5sOV.js";import"./CeVasmQT.js";import"./Dmg8YACJ.js";const On=v` :host { display: block; } button { border-radius: ${({borderRadius:t})=>t[20]}; background: ${({tokens:t})=>t.theme.foregroundPrimary}; display: flex; gap: ${({spacing:t})=>t[1]}; padding: ${({spacing:t})=>t[1]}; color: ${({tokens:t})=>t.theme.textSecondary}; border-radius: ${({borderRadius:t})=>t[16]}; height: 32px; transition: box-shadow ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}; will-change: box-shadow; } button wui-flex.avatar-container { width: 28px; height: 24px; position: relative; wui-flex.network-image-container { position: absolute; bottom: 0px; right: 0px; width: 12px; height: 12px; } wui-avatar { width: 24px; min-width: 24px; height: 24px; } wui-icon { width: 12px; height: 12px; } } wui-image, wui-icon { border-radius: ${({borderRadius:t})=>t[16]}; } wui-text { white-space: nowrap; } button wui-flex.balance-container { height: 100%; border-radius: ${({borderRadius:t})=>t[16]}; padding-left: ${({spacing:t})=>t[1]}; padding-right: ${({spacing:t})=>t[1]}; background: ${({tokens:t})=>t.theme.foregroundSecondary}; color: ${({tokens:t})=>t.theme.textPrimary}; transition: background-color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}; will-change: background-color; } /* -- Hover & Active states ----------------------------------------------------------- */ button:hover:enabled, button:focus-visible:enabled, button:active:enabled { box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.2); wui-flex.balance-container { background: ${({tokens:t})=>t.theme.foregroundTertiary}; } } /* -- Disabled states --------------------------------------------------- */ button:disabled wui-text, button:disabled wui-flex.avatar-container { opacity: 0.3; } `;var de=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Q=class extends f{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.balance=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.loading=!1,this.address="",this.profileName="",this.charsStart=4,this.charsEnd=6}render(){return l` `}imageTemplate(){const e=this.networkSrc?l``:l` `;return l` ${e} `}addressTemplate(){return l` ${this.address?V.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"}):null} `}balanceTemplate(){if(this.balance){const e=this.loading?l``:l` ${this.balance}`;return l`${e}`}return null}};Q.styles=[_,T,On];de([c()],Q.prototype,"networkSrc",void 0);de([c()],Q.prototype,"avatarSrc",void 0);de([c()],Q.prototype,"balance",void 0);de([c({type:Boolean})],Q.prototype,"isUnsupportedChain",void 0);de([c({type:Boolean})],Q.prototype,"disabled",void 0);de([c({type:Boolean})],Q.prototype,"loading",void 0);de([c()],Q.prototype,"address",void 0);de([c()],Q.prototype,"profileName",void 0);de([c()],Q.prototype,"charsStart",void 0);de([c()],Q.prototype,"charsEnd",void 0);Q=de([p("wui-account-button")],Q);var M=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};class F extends f{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.namespace=void 0,this.isSupported=x.state.allowUnsupportedChain?!0:u.state.activeChain?u.checkIfSupportedNetwork(u.state.activeChain):!0}connectedCallback(){super.connectedCallback(),this.setAccountData(u.getAccountData(this.namespace)),this.setNetworkData(u.getNetworkData(this.namespace))}firstUpdated(){const e=this.namespace;e?this.unsubscribe.push(u.subscribeChainProp("accountState",i=>{this.setAccountData(i)},e),u.subscribeChainProp("networkState",i=>{var o;this.setNetworkData(i),this.isSupported=u.checkIfSupportedNetwork(e,(o=i==null?void 0:i.caipNetwork)==null?void 0:o.caipNetworkId)},e)):this.unsubscribe.push(_e.subscribeNetworkImages(()=>{this.networkImage=S.getNetworkImage(this.network)}),u.subscribeKey("activeCaipAddress",i=>{this.caipAddress=i}),$.subscribeKey("balance",i=>this.balanceVal=i),$.subscribeKey("balanceSymbol",i=>this.balanceSymbol=i),$.subscribeKey("profileName",i=>this.profileName=i),$.subscribeKey("profileImage",i=>this.profileImage=i),u.subscribeKey("activeCaipNetwork",i=>{this.network=i,this.networkImage=S.getNetworkImage(i),this.isSupported=i!=null&&i.chainNamespace?u.checkIfSupportedNetwork(i==null?void 0:i.chainNamespace):!0,this.fetchNetworkImage(i)}))}updated(){this.fetchNetworkImage(this.network)}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!u.state.activeChain)return null;const e=this.balance==="show",i=typeof this.balanceVal!="string",{formattedText:o}=b.parseBalance(this.balanceVal,this.balanceSymbol);return l` `}onClick(){this.isSupported||x.state.allowUnsupportedChain?D.open({namespace:this.namespace}):D.open({view:"UnsupportedChain"})}async fetchNetworkImage(e){var i,o;(i=e==null?void 0:e.assets)!=null&&i.imageId&&(this.networkImage=await S.fetchNetworkImage((o=e==null?void 0:e.assets)==null?void 0:o.imageId))}setAccountData(e){e&&(this.caipAddress=e.caipAddress,this.balanceVal=e.balance,this.balanceSymbol=e.balanceSymbol,this.profileName=e.profileName,this.profileImage=e.profileImage)}setNetworkData(e){e&&(this.network=e.caipNetwork,this.networkImage=S.getNetworkImage(e.caipNetwork))}}M([c({type:Boolean})],F.prototype,"disabled",void 0);M([c()],F.prototype,"balance",void 0);M([c()],F.prototype,"charsStart",void 0);M([c()],F.prototype,"charsEnd",void 0);M([c()],F.prototype,"namespace",void 0);M([d()],F.prototype,"caipAddress",void 0);M([d()],F.prototype,"balanceVal",void 0);M([d()],F.prototype,"balanceSymbol",void 0);M([d()],F.prototype,"profileName",void 0);M([d()],F.prototype,"profileImage",void 0);M([d()],F.prototype,"network",void 0);M([d()],F.prototype,"networkImage",void 0);M([d()],F.prototype,"isSupported",void 0);let Bi=class extends F{};Bi=M([p("w3m-account-button")],Bi);let Ui=class extends F{};Ui=M([p("appkit-account-button")],Ui);const Pn=ne` :host { display: block; width: max-content; } `;var ue=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};class oe extends f{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance=void 0,this.size=void 0,this.label=void 0,this.loadingLabel=void 0,this.charsStart=4,this.charsEnd=6,this.namespace=void 0}firstUpdated(){var e,i;this.caipAddress=this.namespace?(i=(e=u.state.chains.get(this.namespace))==null?void 0:e.accountState)==null?void 0:i.caipAddress:u.state.activeCaipAddress,this.namespace?this.unsubscribe.push(u.subscribeChainProp("accountState",o=>{this.caipAddress=o==null?void 0:o.caipAddress},this.namespace)):this.unsubscribe.push(u.subscribeKey("activeCaipAddress",o=>this.caipAddress=o))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.caipAddress?l` `:l` `}}oe.styles=Pn;ue([c({type:Boolean})],oe.prototype,"disabled",void 0);ue([c()],oe.prototype,"balance",void 0);ue([c()],oe.prototype,"size",void 0);ue([c()],oe.prototype,"label",void 0);ue([c()],oe.prototype,"loadingLabel",void 0);ue([c()],oe.prototype,"charsStart",void 0);ue([c()],oe.prototype,"charsEnd",void 0);ue([c()],oe.prototype,"namespace",void 0);ue([d()],oe.prototype,"caipAddress",void 0);let zi=class extends oe{};zi=ue([p("w3m-button")],zi);let Mi=class extends oe{};Mi=ue([p("appkit-button")],Mi);const Dn=v` :host { position: relative; display: block; } button { border-radius: ${({borderRadius:t})=>t[2]}; } button[data-size='sm'] { padding: ${({spacing:t})=>t[2]}; } button[data-size='md'] { padding: ${({spacing:t})=>t[3]}; } button[data-size='lg'] { padding: ${({spacing:t})=>t[4]}; } button[data-variant='primary'] { background: ${({tokens:t})=>t.core.backgroundAccentPrimary}; } button[data-variant='secondary'] { background: ${({tokens:t})=>t.core.foregroundAccent010}; } button:hover:enabled { border-radius: ${({borderRadius:t})=>t[3]}; } button:disabled { cursor: not-allowed; } button[data-loading='true'] { cursor: not-allowed; } button[data-loading='true'][data-size='sm'] { border-radius: ${({borderRadius:t})=>t[32]}; padding: ${({spacing:t})=>t[2]} ${({spacing:t})=>t[3]}; } button[data-loading='true'][data-size='md'] { border-radius: ${({borderRadius:t})=>t[20]}; padding: ${({spacing:t})=>t[3]} ${({spacing:t})=>t[4]}; } button[data-loading='true'][data-size='lg'] { border-radius: ${({borderRadius:t})=>t[16]}; padding: ${({spacing:t})=>t[4]} ${({spacing:t})=>t[5]}; } `;var wt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ne=class extends f{constructor(){super(...arguments),this.size="md",this.variant="primary",this.loading=!1,this.text="Connect Wallet"}render(){return l` `}contentTemplate(){const e={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},i={primary:"invert",secondary:"accent-primary"};return this.loading?l``:l` ${this.text} `}};Ne.styles=[_,T,Dn];wt([c()],Ne.prototype,"size",void 0);wt([c()],Ne.prototype,"variant",void 0);wt([c({type:Boolean})],Ne.prototype,"loading",void 0);wt([c()],Ne.prototype,"text",void 0);Ne=wt([p("wui-connect-button")],Ne);var Ee=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};class ke extends f{constructor(){super(),this.unsubscribe=[],this.size="md",this.label="Connect Wallet",this.loadingLabel="Connecting...",this.open=D.state.open,this.loading=this.namespace?D.state.loadingNamespaceMap.get(this.namespace):D.state.loading,this.unsubscribe.push(D.subscribe(e=>{this.open=e.open,this.loading=this.namespace?e.loadingNamespaceMap.get(this.namespace):e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l` ${this.loading?this.loadingLabel:this.label} `}onClick(){this.open?D.close():this.loading||D.open({view:"Connect",namespace:this.namespace})}}Ee([c()],ke.prototype,"size",void 0);Ee([c()],ke.prototype,"label",void 0);Ee([c()],ke.prototype,"loadingLabel",void 0);Ee([c()],ke.prototype,"namespace",void 0);Ee([d()],ke.prototype,"open",void 0);Ee([d()],ke.prototype,"loading",void 0);let Fi=class extends ke{};Fi=Ee([p("w3m-connect-button")],Fi);let Vi=class extends ke{};Vi=Ee([p("appkit-connect-button")],Vi);const jn=v` :host { display: block; } button { border-radius: ${({borderRadius:t})=>t[32]}; display: flex; gap: ${({spacing:t})=>t[1]}; padding: ${({spacing:t})=>t[1]} ${({spacing:t})=>t[2]} ${({spacing:t})=>t[1]} ${({spacing:t})=>t[1]}; background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; } button:disabled { opacity: 0.5; cursor: not-allowed; } @media (hover: hover) { button:hover:enabled { background-color: ${({tokens:t})=>t.theme.foregroundSecondary}; } } button[data-size='sm'] > wui-icon-box, button[data-size='sm'] > wui-image { width: 16px; height: 16px; } button[data-size='md'] > wui-icon-box, button[data-size='md'] > wui-image { width: 20px; height: 20px; } button[data-size='lg'] > wui-icon-box, button[data-size='lg'] > wui-image { width: 24px; height: 24px; } wui-image, wui-icon-box { border-radius: ${({borderRadius:t})=>t[32]}; } `;var mt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Re=class extends f{constructor(){super(...arguments),this.imageSrc=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.size="lg"}render(){const e={sm:"sm-regular",md:"md-regular",lg:"lg-regular"};return l` `}visualTemplate(){return this.isUnsupportedChain?l` `:this.imageSrc?l``:l` `}};Re.styles=[_,T,jn];mt([c()],Re.prototype,"imageSrc",void 0);mt([c({type:Boolean})],Re.prototype,"isUnsupportedChain",void 0);mt([c({type:Boolean})],Re.prototype,"disabled",void 0);mt([c()],Re.prototype,"size",void 0);Re=mt([p("wui-network-button")],Re);const Ln=ne` :host { display: block; width: max-content; } `;var ye=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};class we extends f{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.network=u.state.activeCaipNetwork,this.networkImage=S.getNetworkImage(this.network),this.caipAddress=u.state.activeCaipAddress,this.loading=D.state.loading,this.isSupported=x.state.allowUnsupportedChain?!0:u.state.activeChain?u.checkIfSupportedNetwork(u.state.activeChain):!0,this.unsubscribe.push(_e.subscribeNetworkImages(()=>{this.networkImage=S.getNetworkImage(this.network)}),u.subscribeKey("activeCaipAddress",e=>{this.caipAddress=e}),u.subscribeKey("activeCaipNetwork",e=>{var i;this.network=e,this.networkImage=S.getNetworkImage(e),this.isSupported=e!=null&&e.chainNamespace?u.checkIfSupportedNetwork(e.chainNamespace):!0,S.fetchNetworkImage((i=e==null?void 0:e.assets)==null?void 0:i.imageId)}),D.subscribeKey("loading",e=>this.loading=e))}firstUpdated(){var e,i;S.fetchNetworkImage((i=(e=this.network)==null?void 0:e.assets)==null?void 0:i.imageId)}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.network?u.checkIfSupportedNetwork(this.network.chainNamespace):!0;return l` ${this.getLabel()} `}getLabel(){return this.network?!this.isSupported&&!x.state.allowUnsupportedChain?"Switch Network":this.network.name:this.label?this.label:this.caipAddress?"Unknown Network":"Select Network"}onClick(){this.loading||(I.sendEvent({type:"track",event:"CLICK_NETWORKS"}),D.open({view:"Networks"}))}}we.styles=Ln;ye([c({type:Boolean})],we.prototype,"disabled",void 0);ye([c({type:String})],we.prototype,"label",void 0);ye([d()],we.prototype,"network",void 0);ye([d()],we.prototype,"networkImage",void 0);ye([d()],we.prototype,"caipAddress",void 0);ye([d()],we.prototype,"loading",void 0);ye([d()],we.prototype,"isSupported",void 0);let Hi=class extends we{};Hi=ye([p("w3m-network-button")],Hi);let Ki=class extends we{};Ki=ye([p("appkit-network-button")],Ki);const Bn=v` :host { display: block; } button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: ${({spacing:t})=>t[4]}; padding: ${({spacing:t})=>t[3]}; border-radius: ${({borderRadius:t})=>t[4]}; background-color: ${({tokens:t})=>t.core.foregroundAccent010}; } wui-flex > wui-icon { padding: ${({spacing:t})=>t[2]}; color: ${({tokens:t})=>t.theme.textInvert}; background-color: ${({tokens:t})=>t.core.backgroundAccentPrimary}; border-radius: ${({borderRadius:t})=>t[2]}; align-items: normal; } @media (hover: hover) { button:hover:enabled { background-color: ${({tokens:t})=>t.core.foregroundAccent020}; } } `;var Vt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let He=class extends f{constructor(){super(...arguments),this.label="",this.description="",this.icon="wallet"}render(){return l` `}};He.styles=[_,T,Bn];Vt([c()],He.prototype,"label",void 0);Vt([c()],He.prototype,"description",void 0);Vt([c()],He.prototype,"icon",void 0);He=Vt([p("wui-notice-card")],He);var ln=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ai=class extends f{constructor(){super(),this.unsubscribe=[],this.socialProvider=fe.getConnectedSocialProvider(),this.socialUsername=fe.getConnectedSocialUsername(),this.namespace=u.state.activeChain,this.unsubscribe.push(u.subscribeKey("activeChain",e=>{this.namespace=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=w.getConnectorId(this.namespace),i=w.getAuthConnector();if(!i||e!==A.CONNECTOR_ID.AUTH)return this.style.cssText="display: none",null;const o=i.provider.getEmail()??"";return!o&&!this.socialUsername?(this.style.cssText="display: none",null):l` {this.onGoToUpdateEmail(o,this.socialProvider)}} > ${this.getAuthName(o)} `}onGoToUpdateEmail(e,i){i||m.push("UpdateEmailWallet",{email:e,redirectView:"Account"})}getAuthName(e){return this.socialUsername?this.socialProvider==="discord"&&this.socialUsername.endsWith("0")?this.socialUsername.slice(0,-1):this.socialUsername:e.length>30?`${e.slice(0,-3)}...`:e}};ln([d()],ai.prototype,"namespace",void 0);ai=ln([p("w3m-account-auth-button")],ai);var me=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ce=class extends f{constructor(){super(),this.usubscribe=[],this.networkImages=_e.state.networkImages,this.address=$.state.address,this.profileImage=$.state.profileImage,this.profileName=$.state.profileName,this.network=u.state.activeCaipNetwork,this.disconnecting=!1,this.loading=!1,this.switched=!1,this.text="",this.remoteFeatures=x.state.remoteFeatures,this.usubscribe.push($.subscribe(e=>{e.address&&(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName)}),u.subscribeKey("activeCaipNetwork",e=>{e!=null&&e.id&&(this.network=e)}),x.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){var i,o,s;if(!this.address)throw new Error("w3m-account-settings-view: No account provided");const e=this.networkImages[((o=(i=this.network)==null?void 0:i.assets)==null?void 0:o.imageId)??""];return l` ${V.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})} ${this.authCardTemplate()} ${((s=this.network)==null?void 0:s.name)??"Unknown"} ${this.togglePreferredAccountBtnTemplate()} ${this.chooseNameButtonTemplate()} Disconnect `}chooseNameButtonTemplate(){var n;const e=(n=this.network)==null?void 0:n.chainNamespace,i=w.getConnectorId(e),o=w.getAuthConnector();return!u.checkIfNamesSupported()||!o||i!==A.CONNECTOR_ID.AUTH||this.profileName?null:l` Choose account name `}authCardTemplate(){var s;const e=w.getConnectorId((s=this.network)==null?void 0:s.chainNamespace),i=w.getAuthConnector(),{origin:o}=location;return!i||e!==A.CONNECTOR_ID.AUTH||o.includes(P.SECURE_SITE)?null:l` `}isAllowedNetworkSwitch(){const e=u.getAllRequestedCaipNetworks(),i=e?e.length>1:!1,o=e==null?void 0:e.find(({id:s})=>{var n;return s===((n=this.network)==null?void 0:n.id)});return i||!o}onCopyAddress(){try{this.address&&(b.copyToClopboard(this.address),k.showSuccess("Address copied"))}catch{k.showError("Failed to copy")}}togglePreferredAccountBtnTemplate(){var n;const e=(n=this.network)==null?void 0:n.chainNamespace,i=u.checkIfSmartAccountEnabled(),o=w.getConnectorId(e);return!w.getAuthConnector()||o!==A.CONNECTOR_ID.AUTH||!i?null:(this.switched||(this.text=ve(e)===le.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your Smart Account"),l` ${this.text} `)}onChooseName(){m.push("ChooseAccountName")}async changePreferredAccountType(){var n;const e=(n=this.network)==null?void 0:n.chainNamespace,i=u.checkIfSmartAccountEnabled(),o=ve(e)===le.ACCOUNT_TYPES.SMART_ACCOUNT||!i?le.ACCOUNT_TYPES.EOA:le.ACCOUNT_TYPES.SMART_ACCOUNT;w.getAuthConnector()&&(this.loading=!0,await y.setPreferredAccountType(o,e),this.text=o===le.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your Smart Account",this.switched=!0,Sn.resetSend(),this.loading=!1,this.requestUpdate())}onNetworks(){this.isAllowedNetworkSwitch()&&m.push("Networks")}async onDisconnect(){var e,i;try{this.disconnecting=!0;const o=(e=this.network)==null?void 0:e.chainNamespace,n=y.getConnections(o).length>0,r=o&&w.state.activeConnectorIds[o],a=(i=this.remoteFeatures)==null?void 0:i.multiWallet;await y.disconnect(a?{id:r,namespace:o}:{}),n&&a&&(m.push("ProfileWallets"),k.showSuccess("Wallet deleted"))}catch{I.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),k.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onGoToUpgradeView(){I.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),m.push("UpgradeEmailWallet")}};me([d()],ce.prototype,"address",void 0);me([d()],ce.prototype,"profileImage",void 0);me([d()],ce.prototype,"profileName",void 0);me([d()],ce.prototype,"network",void 0);me([d()],ce.prototype,"disconnecting",void 0);me([d()],ce.prototype,"loading",void 0);me([d()],ce.prototype,"switched",void 0);me([d()],ce.prototype,"text",void 0);me([d()],ce.prototype,"remoteFeatures",void 0);ce=me([p("w3m-account-settings-view")],ce);const Un=v` :host { flex: 1; height: 100%; } button { width: 100%; height: 100%; display: inline-flex; align-items: center; padding: ${({spacing:t})=>t[1]} ${({spacing:t})=>t[2]}; column-gap: ${({spacing:t})=>t[1]}; color: ${({tokens:t})=>t.theme.textSecondary}; border-radius: ${({borderRadius:t})=>t[20]}; background-color: transparent; transition: background-color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}; will-change: background-color; } /* -- Hover & Active states ----------------------------------------------------------- */ button[data-active='true'] { color: ${({tokens:t})=>t.theme.textPrimary}; background-color: ${({tokens:t})=>t.theme.foregroundTertiary}; } button:hover:enabled:not([data-active='true']), button:active:enabled:not([data-active='true']) { wui-text, wui-icon { color: ${({tokens:t})=>t.theme.textPrimary}; } } `;var bt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const zn={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},Mn={lg:"md",md:"sm",sm:"sm"};let Oe=class extends f{constructor(){super(...arguments),this.icon="mobile",this.size="md",this.label="",this.active=!1}render(){return l` `}};Oe.styles=[_,T,Un];bt([c()],Oe.prototype,"icon",void 0);bt([c()],Oe.prototype,"size",void 0);bt([c()],Oe.prototype,"label",void 0);bt([c({type:Boolean})],Oe.prototype,"active",void 0);Oe=bt([p("wui-tab-item")],Oe);const Fn=v` :host { display: inline-flex; align-items: center; background-color: ${({tokens:t})=>t.theme.foregroundSecondary}; border-radius: ${({borderRadius:t})=>t[32]}; padding: ${({spacing:t})=>t["01"]}; box-sizing: border-box; } :host([data-size='sm']) { height: 26px; } :host([data-size='md']) { height: 36px; } `;var gt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Pe=class extends f{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.size="md",this.activeTab=0}render(){return this.dataset.size=this.size,this.tabs.map((e,i)=>{var s;const o=i===this.activeTab;return l` this.onTabClick(i)} icon=${e.icon} size=${this.size} label=${e.label} ?active=${o} data-active=${o} data-testid="tab-${(s=e.label)==null?void 0:s.toLowerCase()}" > `})}onTabClick(e){this.activeTab=e,this.onTabChange(e)}};Pe.styles=[_,T,Fn];gt([c({type:Array})],Pe.prototype,"tabs",void 0);gt([c()],Pe.prototype,"onTabChange",void 0);gt([c()],Pe.prototype,"size",void 0);gt([d()],Pe.prototype,"activeTab",void 0);Pe=gt([p("wui-tabs")],Pe);const Vn=v` button { display: flex; align-items: center; height: 40px; padding: ${({spacing:t})=>t[2]}; border-radius: ${({borderRadius:t})=>t[4]}; column-gap: ${({spacing:t})=>t[1]}; background-color: transparent; transition: background-color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}; will-change: background-color; } wui-image, .icon-box { width: ${({spacing:t})=>t[6]}; height: ${({spacing:t})=>t[6]}; border-radius: ${({borderRadius:t})=>t[4]}; } wui-text { flex: 1; } .icon-box { position: relative; } .icon-box[data-active='true'] { background-color: ${({tokens:t})=>t.theme.foregroundSecondary}; } .circle { position: absolute; left: 16px; top: 15px; width: 8px; height: 8px; background-color: ${({tokens:t})=>t.core.textSuccess}; box-shadow: 0 0 0 2px ${({tokens:t})=>t.theme.foregroundPrimary}; border-radius: 50%; } /* -- Hover & Active states ----------------------------------------------------------- */ @media (hover: hover) { button:hover:enabled, button:active:enabled { background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; } } `;var be=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ie=class extends f{constructor(){super(...arguments),this.address="",this.profileName="",this.alt="",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.loading=!1,this.charsStart=4,this.charsEnd=6}render(){return l` `}leftImageTemplate(){const e=this.icon?l``:l``;return l` ${e} `}textTemplate(){return l` ${V.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?16:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"})} `}rightImageTemplate(){return l``}};ie.styles=[_,T,Vn];be([c()],ie.prototype,"address",void 0);be([c()],ie.prototype,"profileName",void 0);be([c()],ie.prototype,"alt",void 0);be([c()],ie.prototype,"imageSrc",void 0);be([c()],ie.prototype,"icon",void 0);be([c()],ie.prototype,"iconSize",void 0);be([c({type:Boolean})],ie.prototype,"loading",void 0);be([c({type:Number})],ie.prototype,"charsStart",void 0);be([c({type:Number})],ie.prototype,"charsEnd",void 0);ie=be([p("wui-wallet-switch")],ie);const Hn=v` wui-icon-link { margin-right: calc(${({spacing:t})=>t[8]} * -1); } wui-notice-card { margin-bottom: ${({spacing:t})=>t[1]}; } wui-list-item > wui-text { flex: 1; } w3m-transactions-view { max-height: 200px; } .tab-content-container { height: 300px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; } .tab-content-container::-webkit-scrollbar { display: none; } .account-button { width: auto; border: none; display: flex; align-items: center; justify-content: center; gap: ${({spacing:t})=>t[3]}; height: 48px; padding: ${({spacing:t})=>t[2]}; padding-right: ${({spacing:t})=>t[3]}; box-shadow: inset 0 0 0 1px ${({tokens:t})=>t.theme.foregroundPrimary}; background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; border-radius: ${({borderRadius:t})=>t[6]}; transition: background-color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}; } .account-button:hover { background-color: ${({tokens:t})=>t.core.glass010}; } .avatar-container { position: relative; } wui-avatar.avatar { width: 32px; height: 32px; box-shadow: 0 0 0 2px ${({tokens:t})=>t.core.glass010}; } wui-wallet-switch { margin-top: ${({spacing:t})=>t[2]}; } wui-avatar.network-avatar { width: 16px; height: 16px; position: absolute; left: 100%; top: 100%; transform: translate(-75%, -75%); box-shadow: 0 0 0 2px ${({tokens:t})=>t.core.glass010}; } .account-links { display: flex; justify-content: space-between; align-items: center; } .account-links wui-flex { cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 1; background: red; align-items: center; justify-content: center; height: 48px; padding: 10px; flex: 1 0 0; border-radius: var(--XS, 16px); border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); transition: background-color ${({durations:t})=>t.md} ${({easings:t})=>t["ease-out-power-1"]}, opacity ${({durations:t})=>t.md} ${({easings:t})=>t["ease-out-power-1"]}; will-change: background-color, opacity; } .account-links wui-flex:hover { background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15)); } .account-links wui-flex wui-icon { width: var(--S, 20px); height: var(--S, 20px); } .account-links wui-flex wui-icon svg path { stroke: #667dff; } `;var se=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let H=class extends f{constructor(){super(),this.unsubscribe=[],this.caipAddress=$.state.caipAddress,this.address=b.getPlainAddress($.state.caipAddress),this.profileImage=$.state.profileImage,this.profileName=$.state.profileName,this.disconnecting=!1,this.balance=$.state.balance,this.balanceSymbol=$.state.balanceSymbol,this.features=x.state.features,this.remoteFeatures=x.state.remoteFeatures,this.namespace=u.state.activeChain,this.activeConnectorIds=w.state.activeConnectorIds,this.unsubscribe.push($.subscribeKey("caipAddress",e=>{this.address=b.getPlainAddress(e),this.caipAddress=e}),$.subscribeKey("balance",e=>this.balance=e),$.subscribeKey("balanceSymbol",e=>this.balanceSymbol=e),$.subscribeKey("profileName",e=>this.profileName=e),$.subscribeKey("profileImage",e=>this.profileImage=e),x.subscribeKey("features",e=>this.features=e),x.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e),w.subscribeKey("activeConnectorIds",e=>{this.activeConnectorIds=e}),u.subscribeKey("activeChain",e=>this.namespace=e),u.subscribeKey("activeCaipNetwork",e=>{e!=null&&e.chainNamespace&&(this.namespace=e==null?void 0:e.chainNamespace)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.caipAddress||!this.namespace)return null;const e=this.activeConnectorIds[this.namespace],i=e?w.getConnectorById(e):void 0,o=S.getConnectorImage(i),{value:s,decimals:n,symbol:r}=b.parseBalance(this.balance,this.balanceSymbol);return l` ${s} .${n} ${r} ${this.explorerBtnTemplate()} ${this.authCardTemplate()} ${this.orderedFeaturesTemplate()} ${this.activityTemplate()} Disconnect `}fundWalletTemplate(){var r,a,g;if(!this.namespace)return null;const e=P.ONRAMP_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace),i=P.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace),o=!!((r=this.features)!=null&&r.receive),s=((a=this.remoteFeatures)==null?void 0:a.onramp)&&e,n=((g=this.remoteFeatures)==null?void 0:g.payWithExchange)&&i;return!s&&!o&&!n?null:l` Fund wallet `}orderedFeaturesTemplate(){var i;return(((i=this.features)==null?void 0:i.walletFeaturesOrder)||P.DEFAULT_FEATURES.walletFeaturesOrder).map(o=>{switch(o){case"onramp":return this.fundWalletTemplate();case"swaps":return this.swapsTemplate();case"send":return this.sendTemplate();default:return null}})}activityTemplate(){var i;return this.namespace&&((i=this.remoteFeatures)==null?void 0:i.activity)&&P.ACTIVITY_ENABLED_CHAIN_NAMESPACES.includes(this.namespace)?l` Activity `:null}swapsTemplate(){var o;const e=(o=this.remoteFeatures)==null?void 0:o.swaps,i=u.state.activeChain===A.CHAIN.EVM;return!e||!i?null:l` Swap `}sendTemplate(){var s;const e=(s=this.features)==null?void 0:s.send,i=u.state.activeChain;if(!i)throw new Error("SendController:sendTemplate - namespace is required");const o=P.SEND_SUPPORTED_NAMESPACES.includes(i);return!e||!o?null:l` Send `}authCardTemplate(){const e=u.state.activeChain;if(!e)throw new Error("AuthCardTemplate:authCardTemplate - namespace is required");const i=w.getConnectorId(e),o=w.getAuthConnector(),{origin:s}=location;return!o||i!==A.CONNECTOR_ID.AUTH||s.includes(P.SECURE_SITE)?null:l` `}handleClickFundWallet(){m.push("FundWallet")}handleClickSwap(){m.push("Swap")}handleClickSend(){m.push("WalletSend")}explorerBtnTemplate(){return $.state.addressExplorerUrl?l` Block Explorer `:null}onTransactions(){I.sendEvent({type:"track",event:"CLICK_TRANSACTIONS",properties:{isSmartAccount:ve(u.state.activeChain)===le.ACCOUNT_TYPES.SMART_ACCOUNT}}),m.push("Transactions")}async onDisconnect(){var e;try{this.disconnecting=!0;const o=y.getConnections(this.namespace).length>0,s=this.namespace&&w.state.activeConnectorIds[this.namespace],n=(e=this.remoteFeatures)==null?void 0:e.multiWallet;await y.disconnect(n?{id:s,namespace:this.namespace}:{}),o&&n&&(m.push("ProfileWallets"),k.showSuccess("Wallet deleted"))}catch{I.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),k.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onExplorer(){const e=$.state.addressExplorerUrl;e&&b.openHref(e,"_blank")}onGoToUpgradeView(){I.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),m.push("UpgradeEmailWallet")}onGoToProfileWalletsView(){m.push("ProfileWallets")}};H.styles=Hn;se([d()],H.prototype,"caipAddress",void 0);se([d()],H.prototype,"address",void 0);se([d()],H.prototype,"profileImage",void 0);se([d()],H.prototype,"profileName",void 0);se([d()],H.prototype,"disconnecting",void 0);se([d()],H.prototype,"balance",void 0);se([d()],H.prototype,"balanceSymbol",void 0);se([d()],H.prototype,"features",void 0);se([d()],H.prototype,"remoteFeatures",void 0);se([d()],H.prototype,"namespace",void 0);se([d()],H.prototype,"activeConnectorIds",void 0);H=se([p("w3m-account-default-widget")],H);const Kn=v` span { font-weight: 500; font-size: 38px; color: ${({tokens:t})=>t.theme.textPrimary}; line-height: 38px; letter-spacing: -2%; text-align: center; font-family: var(--apkt-fontFamily-regular); } .pennies { color: ${({tokens:t})=>t.theme.textSecondary}; } `;var xi=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let st=class extends f{constructor(){super(...arguments),this.dollars="0",this.pennies="00"}render(){return l`$${this.dollars}.${this.pennies}`}};st.styles=[_,Kn];xi([c()],st.prototype,"dollars",void 0);xi([c()],st.prototype,"pennies",void 0);st=xi([p("wui-balance")],st);const qn=v` :host { display: inline-flex; justify-content: center; align-items: center; position: relative; } wui-icon { position: absolute; width: 12px !important; height: 4px !important; } /* -- Variants --------------------------------------------------------- */ :host([data-variant='fill']) { background-color: ${({colors:t})=>t.neutrals100}; } :host([data-variant='shade']) { background-color: ${({colors:t})=>t.neutrals900}; } :host([data-variant='fill']) > wui-text { color: ${({colors:t})=>t.black}; } :host([data-variant='shade']) > wui-text { color: ${({colors:t})=>t.white}; } :host([data-variant='fill']) > wui-icon { color: ${({colors:t})=>t.neutrals100}; } :host([data-variant='shade']) > wui-icon { color: ${({colors:t})=>t.neutrals900}; } /* -- Sizes --------------------------------------------------------- */ :host([data-size='sm']) { padding: ${({spacing:t})=>t[1]} ${({spacing:t})=>t[2]}; border-radius: ${({borderRadius:t})=>t[2]}; } :host([data-size='md']) { padding: ${({spacing:t})=>t[2]} ${({spacing:t})=>t[3]}; border-radius: ${({borderRadius:t})=>t[3]}; } /* -- Placements --------------------------------------------------------- */ wui-icon[data-placement='top'] { bottom: 0px; left: 50%; transform: translate(-50%, 95%); } wui-icon[data-placement='bottom'] { top: 0; left: 50%; transform: translate(-50%, -95%) rotate(180deg); } wui-icon[data-placement='right'] { top: 50%; left: 0; transform: translate(-65%, -50%) rotate(90deg); } wui-icon[data-placement='left'] { top: 50%; right: 0%; transform: translate(65%, -50%) rotate(270deg); } `;var yt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Gn={sm:"sm-regular",md:"md-regular"};let De=class extends f{constructor(){super(...arguments),this.placement="top",this.variant="fill",this.size="md",this.message=""}render(){return this.dataset.variant=this.variant,this.dataset.size=this.size,l` ${this.message}`}};De.styles=[_,T,qn];yt([c()],De.prototype,"placement",void 0);yt([c()],De.prototype,"variant",void 0);yt([c()],De.prototype,"size",void 0);yt([c()],De.prototype,"message",void 0);De=yt([p("wui-tooltip")],De);const Yn=ne` :host { width: 100%; max-height: 280px; overflow: scroll; scrollbar-width: none; } :host::-webkit-scrollbar { display: none; } `;var Xn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let li=class extends f{render(){return l``}};li.styles=Yn;li=Xn([p("w3m-account-activity-widget")],li);const Qn=v` .contentContainer { height: 280px; } .contentContainer > wui-icon-box { width: 40px; height: 40px; border-radius: ${({borderRadius:t})=>t[3]}; } .contentContainer > .textContent { width: 65%; } `;var Zn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ci=class extends f{render(){return l`${this.nftTemplate()}`}nftTemplate(){return l` Coming soon Stay tuned for our upcoming NFT feature Receive funds `}onReceiveClick(){m.push("WalletReceive")}};ci.styles=Qn;ci=Zn([p("w3m-account-nfts-widget")],ci);const Jn=v` :host { width: 100%; } button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: ${({spacing:t})=>t[4]}; padding: ${({spacing:t})=>t[4]}; background-color: transparent; border-radius: ${({borderRadius:t})=>t[4]}; } wui-text { max-width: 174px; } .tag-container { width: fit-content; } @media (hover: hover) { button:hover:enabled { background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; } } `;var Ze=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let $e=class extends f{constructor(){super(...arguments),this.icon="card",this.text="",this.description="",this.tag=void 0,this.disabled=!1}render(){return l` `}};$e.styles=[_,T,Jn];Ze([c()],$e.prototype,"icon",void 0);Ze([c()],$e.prototype,"text",void 0);Ze([c()],$e.prototype,"description",void 0);Ze([c()],$e.prototype,"tag",void 0);Ze([c({type:Boolean})],$e.prototype,"disabled",void 0);$e=Ze([p("wui-list-description")],$e);const eo=ne` :host { width: 100%; } wui-flex { width: 100%; } .contentContainer { max-height: 280px; overflow: scroll; scrollbar-width: none; } .contentContainer::-webkit-scrollbar { display: none; } `;var vi=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let rt=class extends f{constructor(){super(),this.unsubscribe=[],this.tokenBalance=$.state.tokenBalance,this.remoteFeatures=x.state.remoteFeatures,this.unsubscribe.push($.subscribe(e=>{this.tokenBalance=e.tokenBalance}),x.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`${this.tokenTemplate()}`}tokenTemplate(){var e;return this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>0?l` ${this.tokenItemTemplate()} `:l` ${this.onRampTemplate()} `}onRampTemplate(){var e;return(e=this.remoteFeatures)!=null&&e.onramp?l``:l``}tokenItemTemplate(){var e;return(e=this.tokenBalance)==null?void 0:e.map(i=>l``)}onReceiveClick(){m.push("WalletReceive")}onBuyClick(){I.sendEvent({type:"track",event:"SELECT_BUY_CRYPTO",properties:{isSmartAccount:ve(u.state.activeChain)===le.ACCOUNT_TYPES.SMART_ACCOUNT}}),m.push("OnRampProviders")}};rt.styles=eo;vi([d()],rt.prototype,"tokenBalance",void 0);vi([d()],rt.prototype,"remoteFeatures",void 0);rt=vi([p("w3m-account-tokens-widget")],rt);const to=v` wui-flex { width: 100%; } wui-promo { position: absolute; top: -32px; } wui-profile-button { margin-top: calc(-1 * ${({spacing:t})=>t[4]}); } wui-promo + wui-profile-button { margin-top: ${({spacing:t})=>t[4]}; } wui-tabs { width: 100%; } .contentContainer { height: 280px; } .contentContainer > wui-icon-box { width: 40px; height: 40px; border-radius: ${({borderRadius:t})=>t[3]}; } .contentContainer > .textContent { width: 65%; } `;var he=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Z=class extends f{constructor(){super(),this.unsubscribe=[],this.address=$.state.address,this.profileName=$.state.profileName,this.network=u.state.activeCaipNetwork,this.currentTab=$.state.currentTab,this.tokenBalance=$.state.tokenBalance,this.features=x.state.features,this.namespace=u.state.activeChain,this.activeConnectorIds=w.state.activeConnectorIds,this.remoteFeatures=x.state.remoteFeatures,this.unsubscribe.push($.subscribe(e=>{e.address?(this.address=e.address,this.profileName=e.profileName,this.currentTab=e.currentTab,this.tokenBalance=e.tokenBalance):D.close()}),w.subscribeKey("activeConnectorIds",e=>{this.activeConnectorIds=e}),u.subscribeKey("activeChain",e=>this.namespace=e),u.subscribeKey("activeCaipNetwork",e=>this.network=e),x.subscribeKey("features",e=>this.features=e),x.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e)),this.watchSwapValues()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearInterval(this.watchTokenBalance)}firstUpdated(){$.fetchTokenBalance()}render(){if(!this.address)throw new Error("w3m-account-view: No account provided");if(!this.namespace)return null;const e=this.activeConnectorIds[this.namespace],i=e?w.getConnectorById(e):void 0,{icon:o,iconSize:s}=this.getAuthData();return l` ${this.tokenBalanceTemplate()} ${this.orderedWalletFeatures()} ${this.tabsTemplate()} ${this.listContentTemplate()} `}orderedWalletFeatures(){var n;const e=((n=this.features)==null?void 0:n.walletFeaturesOrder)||P.DEFAULT_FEATURES.walletFeaturesOrder;if(e.every(r=>{var a,g;return r==="send"||r==="receive"?!((a=this.features)!=null&&a[r]):r==="swaps"||r==="onramp"?!((g=this.remoteFeatures)!=null&&g[r]):!0}))return null;const o=e.map(r=>r==="receive"||r==="onramp"?"fund":r),s=[...new Set(o)];return l` ${s.map(r=>{switch(r){case"fund":return this.fundWalletTemplate();case"swaps":return this.swapsTemplate();case"send":return this.sendTemplate();default:return null}})} `}fundWalletTemplate(){var r,a,g;if(!this.namespace)return null;const e=P.ONRAMP_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace),i=P.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace),o=(r=this.features)==null?void 0:r.receive,s=((a=this.remoteFeatures)==null?void 0:a.onramp)&&e,n=((g=this.remoteFeatures)==null?void 0:g.payWithExchange)&&i;return!s&&!o&&!n?null:l` `}swapsTemplate(){var o;const e=(o=this.remoteFeatures)==null?void 0:o.swaps,i=u.state.activeChain===A.CHAIN.EVM;return!e||!i?null:l` `}sendTemplate(){var s;const e=(s=this.features)==null?void 0:s.send,i=u.state.activeChain,o=P.SEND_SUPPORTED_NAMESPACES.includes(i);return!e||!o?null:l` `}watchSwapValues(){this.watchTokenBalance=setInterval(()=>$.fetchTokenBalance(e=>this.onTokenBalanceError(e)),1e4)}onTokenBalanceError(e){e instanceof Error&&e.cause instanceof Response&&e.cause.status===A.HTTP_STATUS_CODES.SERVICE_UNAVAILABLE&&clearInterval(this.watchTokenBalance)}listContentTemplate(){return this.currentTab===0?l``:this.currentTab===1?l``:this.currentTab===2?l``:l``}tokenBalanceTemplate(){var e;if(this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>=0){const i=b.calculateBalance(this.tokenBalance),{dollars:o="0",pennies:s="00"}=b.formatTokenBalance(i);return l``}return l``}tabsTemplate(){const e=bi.getTabsByNamespace(u.state.activeChain);return e.length===0?null:l``}onTabChange(e){$.setCurrentTab(e)}onFundWalletClick(){m.push("FundWallet")}onSwapClick(){var e,i,o;(e=this.network)!=null&&e.caipNetworkId&&!P.SWAP_SUPPORTED_NETWORKS.includes((i=this.network)==null?void 0:i.caipNetworkId)?m.push("UnsupportedChain",{swapUnsupportedChain:!0}):(I.sendEvent({type:"track",event:"OPEN_SWAP",properties:{network:((o=this.network)==null?void 0:o.caipNetworkId)||"",isSmartAccount:ve(u.state.activeChain)===le.ACCOUNT_TYPES.SMART_ACCOUNT}}),m.push("Swap"))}getAuthData(){const e=fe.getConnectedSocialProvider(),i=fe.getConnectedSocialUsername(),o=w.getAuthConnector(),s=(o==null?void 0:o.provider.getEmail())??"";return{name:We.getAuthName({email:s,socialUsername:i,socialProvider:e}),icon:e??"mail",iconSize:e?"xl":"md"}}onGoToProfileWalletsView(){m.push("ProfileWallets")}onSendClick(){var e;I.sendEvent({type:"track",event:"OPEN_SEND",properties:{network:((e=this.network)==null?void 0:e.caipNetworkId)||"",isSmartAccount:ve(u.state.activeChain)===le.ACCOUNT_TYPES.SMART_ACCOUNT}}),m.push("WalletSend")}};Z.styles=to;he([d()],Z.prototype,"watchTokenBalance",void 0);he([d()],Z.prototype,"address",void 0);he([d()],Z.prototype,"profileName",void 0);he([d()],Z.prototype,"network",void 0);he([d()],Z.prototype,"currentTab",void 0);he([d()],Z.prototype,"tokenBalance",void 0);he([d()],Z.prototype,"features",void 0);he([d()],Z.prototype,"namespace",void 0);he([d()],Z.prototype,"activeConnectorIds",void 0);he([d()],Z.prototype,"remoteFeatures",void 0);Z=he([p("w3m-account-wallet-features-widget")],Z);var cn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let di=class extends f{constructor(){super(),this.unsubscribe=[],this.namespace=u.state.activeChain,this.unsubscribe.push(u.subscribeKey("activeChain",e=>{this.namespace=e}))}render(){if(!this.namespace)return null;const e=w.getConnectorId(this.namespace),i=w.getAuthConnector();return l` ${i&&e===A.CONNECTOR_ID.AUTH?this.walletFeaturesTemplate():this.defaultTemplate()} `}walletFeaturesTemplate(){return l``}defaultTemplate(){return l``}};cn([d()],di.prototype,"namespace",void 0);di=cn([p("w3m-account-view")],di);const io=v` wui-image { width: 24px; height: 24px; border-radius: ${({borderRadius:t})=>t[2]}; } wui-image, .icon-box { width: 32px; height: 32px; border-radius: ${({borderRadius:t})=>t[2]}; } wui-icon:not(.custom-icon, .icon-badge) { cursor: pointer; } .icon-box { position: relative; border-radius: ${({borderRadius:t})=>t[2]}; background-color: ${({tokens:t})=>t.theme.foregroundSecondary}; } .icon-badge { position: absolute; top: 18px; left: 23px; z-index: 3; background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; border: 2px solid ${({tokens:t})=>t.theme.backgroundPrimary}; border-radius: 50%; padding: ${({spacing:t})=>t["01"]}; } .icon-badge { width: 8px; height: 8px; } `;var G=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let j=class extends f{constructor(){super(...arguments),this.address="",this.profileName="",this.content=[],this.alt="",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.iconBadge=void 0,this.iconBadgeSize="md",this.buttonVariant="neutral-primary",this.enableMoreButton=!1,this.charsStart=4,this.charsEnd=6}render(){return l` ${this.topTemplate()} ${this.bottomTemplate()} `}topTemplate(){return l` ${this.imageOrIconTemplate()} ${this.enableMoreButton?l``:null} `}bottomTemplate(){return l` ${this.contentTemplate()} `}imageOrIconTemplate(){return this.icon?l` ${this.iconBadge?l``:null} `:l` `}contentTemplate(){return this.content.length===0?null:l` ${this.content.map(e=>this.labelAndTagTemplate(e))} `}labelAndTagTemplate({address:e,profileName:i,label:o,description:s,enableButton:n,buttonType:r,buttonLabel:a,buttonVariant:g,tagVariant:C,tagLabel:W,alignItems:O="flex-end"}){return l` ${o?l`${o}`:null} ${V.getTruncateString({string:i||e,charsStart:i?16:this.charsStart,charsEnd:i?0:this.charsEnd,truncate:i?"end":"middle"})} ${C&&W?l`${W}`:null} ${s?l`${s}`:null} ${n?this.buttonTemplate({buttonType:r,buttonLabel:a,buttonVariant:g}):null} `}buttonTemplate({buttonType:e,buttonLabel:i,buttonVariant:o}){return l` ${i} `}dispatchDisconnectEvent(){this.dispatchEvent(new CustomEvent("disconnect",{bubbles:!0,composed:!0}))}dispatchSwitchEvent(){this.dispatchEvent(new CustomEvent("switch",{bubbles:!0,composed:!0}))}dispatchExternalLinkEvent(){this.dispatchEvent(new CustomEvent("externalLink",{bubbles:!0,composed:!0}))}dispatchMoreButtonEvent(){this.dispatchEvent(new CustomEvent("more",{bubbles:!0,composed:!0}))}dispatchCopyEvent(){this.dispatchEvent(new CustomEvent("copy",{bubbles:!0,composed:!0}))}};j.styles=[_,T,io];G([c()],j.prototype,"address",void 0);G([c()],j.prototype,"profileName",void 0);G([c({type:Array})],j.prototype,"content",void 0);G([c()],j.prototype,"alt",void 0);G([c()],j.prototype,"imageSrc",void 0);G([c()],j.prototype,"icon",void 0);G([c()],j.prototype,"iconSize",void 0);G([c()],j.prototype,"iconBadge",void 0);G([c()],j.prototype,"iconBadgeSize",void 0);G([c()],j.prototype,"buttonVariant",void 0);G([c({type:Boolean})],j.prototype,"enableMoreButton",void 0);G([c({type:Number})],j.prototype,"charsStart",void 0);G([c({type:Number})],j.prototype,"charsEnd",void 0);j=G([p("wui-active-profile-wallet-item")],j);const no=v` wui-image, .icon-box { width: 32px; height: 32px; border-radius: ${({borderRadius:t})=>t[2]}; } .right-icon { cursor: pointer; } .icon-box { position: relative; background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; } .icon-badge { position: absolute; top: 18px; left: 23px; z-index: 3; background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; border: 2px solid ${({tokens:t})=>t.theme.backgroundPrimary}; border-radius: 50%; padding: ${({spacing:t})=>t["01"]}; } .icon-badge { width: 8px; height: 8px; } `;var L=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let N=class extends f{constructor(){super(...arguments),this.address="",this.profileName="",this.alt="",this.buttonLabel="",this.buttonVariant="accent-primary",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.iconBadgeSize="md",this.rightIcon="signOut",this.rightIconSize="md",this.loading=!1,this.charsStart=4,this.charsEnd=6}render(){return l` ${this.imageOrIconTemplate()} ${this.labelAndDescriptionTemplate()} ${this.buttonActionTemplate()} `}imageOrIconTemplate(){return this.icon?l` ${this.iconBadge?l``:null} `:l``}labelAndDescriptionTemplate(){return l` ${V.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?16:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"})} `}buttonActionTemplate(){return l` ${this.buttonLabel} `}handleButtonClick(){this.dispatchEvent(new CustomEvent("buttonClick",{bubbles:!0,composed:!0}))}handleIconClick(){this.dispatchEvent(new CustomEvent("iconClick",{bubbles:!0,composed:!0}))}};N.styles=[_,T,no];L([c()],N.prototype,"address",void 0);L([c()],N.prototype,"profileName",void 0);L([c()],N.prototype,"alt",void 0);L([c()],N.prototype,"buttonLabel",void 0);L([c()],N.prototype,"buttonVariant",void 0);L([c()],N.prototype,"imageSrc",void 0);L([c()],N.prototype,"icon",void 0);L([c()],N.prototype,"iconSize",void 0);L([c()],N.prototype,"iconBadge",void 0);L([c()],N.prototype,"iconBadgeSize",void 0);L([c()],N.prototype,"rightIcon",void 0);L([c()],N.prototype,"rightIconSize",void 0);L([c({type:Boolean})],N.prototype,"loading",void 0);L([c({type:Number})],N.prototype,"charsStart",void 0);L([c({type:Number})],N.prototype,"charsEnd",void 0);N=L([p("wui-inactive-profile-wallet-item")],N);const oi={getAuthData(t){var r,a;const e=t.connectorId===A.CONNECTOR_ID.AUTH;if(!e)return{isAuth:!1,icon:void 0,iconSize:void 0,name:void 0};const i=((r=t==null?void 0:t.auth)==null?void 0:r.name)??fe.getConnectedSocialProvider(),o=((a=t==null?void 0:t.auth)==null?void 0:a.username)??fe.getConnectedSocialUsername(),s=w.getAuthConnector(),n=(s==null?void 0:s.provider.getEmail())??"";return{isAuth:!0,icon:i??"mail",iconSize:i?"xl":"md",name:e?We.getAuthName({email:n,socialUsername:o,socialProvider:i}):void 0}}},oo=v` :host { --connect-scroll--top-opacity: 0; --connect-scroll--bottom-opacity: 0; } .balance-amount { flex: 1; } .wallet-list { scrollbar-width: none; overflow-y: scroll; overflow-x: hidden; transition: opacity ${({easings:t})=>t["ease-out-power-1"]} ${({durations:t})=>t.md}; will-change: opacity; mask-image: linear-gradient( to bottom, rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px, rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px, black 40px, black calc(100% - 40px), rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px), rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100% ); } .active-wallets { background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; border-radius: ${({borderRadius:t})=>t[4]}; } .active-wallets-box { height: 330px; } .empty-wallet-list-box { height: 400px; } .empty-box { width: 100%; padding: ${({spacing:t})=>t[4]}; background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; border-radius: ${({borderRadius:t})=>t[4]}; } wui-separator { margin: ${({spacing:t})=>t[2]} 0 ${({spacing:t})=>t[2]} 0; } .active-connection { padding: ${({spacing:t})=>t[2]}; } .recent-connection { padding: ${({spacing:t})=>t[2]} 0 ${({spacing:t})=>t[2]} 0; } @media (max-width: 430px) { .active-wallets-box, .empty-wallet-list-box { height: auto; max-height: clamp(360px, 470px, 80vh); } } `;var J=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const te={ADDRESS_DISPLAY:{START:4,END:6},BADGE:{SIZE:"md",ICON:"lightbulb"},SCROLL_THRESHOLD:50,OPACITY_RANGE:[0,1]},ot={eip155:"ethereum",solana:"solana",bip122:"bitcoin"},so=[{namespace:"eip155",icon:ot.eip155,label:"EVM"},{namespace:"solana",icon:ot.solana,label:"Solana"},{namespace:"bip122",icon:ot.bip122,label:"Bitcoin"}],ro={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"}};let U=class extends f{constructor(){var e,i;super(),this.unsubscribers=[],this.currentTab=0,this.namespace=u.state.activeChain,this.namespaces=Array.from(u.state.chains.keys()),this.caipAddress=void 0,this.profileName=void 0,this.activeConnectorIds=w.state.activeConnectorIds,this.lastSelectedAddress="",this.lastSelectedConnectorId="",this.isSwitching=!1,this.caipNetwork=u.state.activeCaipNetwork,this.user=$.state.user,this.remoteFeatures=x.state.remoteFeatures,this.currentTab=this.namespace?this.namespaces.indexOf(this.namespace):0,this.caipAddress=(e=u.getAccountData(this.namespace))==null?void 0:e.caipAddress,this.profileName=(i=u.getAccountData(this.namespace))==null?void 0:i.profileName,this.unsubscribers.push(y.subscribeKey("connections",()=>this.onConnectionsChange()),y.subscribeKey("recentConnections",()=>this.requestUpdate()),w.subscribeKey("activeConnectorIds",o=>{this.activeConnectorIds=o}),u.subscribeKey("activeCaipNetwork",o=>this.caipNetwork=o),$.subscribeKey("user",o=>this.user=o),x.subscribeKey("remoteFeatures",o=>this.remoteFeatures=o)),this.chainListener=u.subscribeChainProp("accountState",o=>{this.caipAddress=o==null?void 0:o.caipAddress,this.profileName=o==null?void 0:o.profileName},this.namespace)}disconnectedCallback(){var e,i;this.unsubscribers.forEach(o=>o()),(e=this.resizeObserver)==null||e.disconnect(),this.removeScrollListener(),(i=this.chainListener)==null||i.call(this)}firstUpdated(){var o;const e=(o=this.shadowRoot)==null?void 0:o.querySelector(".wallet-list");if(!e)return;const i=()=>this.updateScrollOpacity(e);requestAnimationFrame(i),e.addEventListener("scroll",i),this.resizeObserver=new ResizeObserver(i),this.resizeObserver.observe(e),i()}render(){const e=this.namespace;if(!e)throw new Error("Namespace is not set");return l` ${this.renderTabs()} ${this.renderHeader(e)} ${this.renderConnections(e)} ${this.renderAddConnectionButton(e)} `}renderTabs(){const e=so.filter(o=>this.namespaces.includes(o.namespace));return e.length>1?l` this.handleTabChange(o)} .activeTab=${this.currentTab} .tabs=${e} > `:null}renderHeader(e){const o=this.getActiveConnections(e).flatMap(({accounts:s})=>s).length+(this.caipAddress?1:0);return l` ${o>1?"Wallets":"Wallet"} ${o} y.disconnect({namespace:e})} ?disabled=${!this.hasAnyConnections(e)} data-testid="disconnect-all-button" > Disconnect All `}renderConnections(e){const i=this.hasAnyConnections(e);return l` ${i?this.renderActiveConnections(e):this.renderEmptyState(e)} `}renderActiveConnections(e){const i=this.getActiveConnections(e),o=this.activeConnectorIds[e],s=this.getPlainAddress();return l` ${s||o||i.length>0?l` ${this.renderActiveProfile(e)} ${this.renderActiveConnectionsList(e)} `:null} ${this.renderRecentConnections(e)} `}renderActiveProfile(e){const i=this.activeConnectorIds[e];if(!i)return null;const{connections:o}=xe.getConnectionsData(e),s=w.getConnectorById(i),n=S.getConnectorImage(s),r=this.getPlainAddress();if(!r)return null;const a=e===A.CHAIN.BITCOIN,g=oi.getAuthData({connectorId:i,accounts:[]}),C=this.getActiveConnections(e).flatMap(B=>B.accounts).length>0,W=o.find(B=>B.connectorId===i),O=W==null?void 0:W.accounts.filter(B=>!X.isLowerCaseMatch(B.address,r));return l` this.handleCopyAddress(r)} @disconnect=${()=>this.handleDisconnect(e,{id:i})} @switch=${()=>{a&&W&&(O!=null&&O[0])&&this.handleSwitchWallet(W,O[0].address,e)}} @externalLink=${()=>this.handleExternalLink(r)} @more=${()=>this.handleMore()} data-testid="wui-active-profile-wallet-item" > ${C?l``:null} `}renderActiveConnectionsList(e){const i=this.getActiveConnections(e);return i.length===0?null:l` ${this.renderConnectionList(i,!1,e)} `}renderRecentConnections(e){const{recentConnections:i}=xe.getConnectionsData(e);return i.flatMap(s=>s.accounts).length===0?null:l` RECENTLY CONNECTED ${this.renderConnectionList(i,!0,e)} `}renderConnectionList(e,i,o){return e.filter(s=>s.accounts.length>0).map((s,n)=>{const r=w.getConnectorById(s.connectorId),a=S.getConnectorImage(r)??"",g=oi.getAuthData(s);return s.accounts.map((C,W)=>{const O=n!==0||W!==0,B=this.isAccountLoading(s.connectorId,C.address);return l` ${O?l``:null} this.handleSwitchWallet(s,C.address,o)} @iconClick=${()=>this.handleWalletAction({connection:s,address:C.address,isRecentConnection:i,namespace:o})} > `})})}renderAddConnectionButton(e){if(!this.isMultiWalletEnabled()&&this.caipAddress||!this.hasAnyConnections(e))return null;const{title:i}=this.getChainLabelInfo(e);return l` this.handleAddConnection(e)} data-testid="add-connection-button" > ${i} `}renderEmptyState(e){const{title:i,description:o}=this.getChainLabelInfo(e);return l` No wallet connected ${o} this.handleAddConnection(e)} data-testid="empty-state-button" icon="plus" > ${i} `}handleTabChange(e){var o,s,n;const i=this.namespaces[e];i&&((o=this.chainListener)==null||o.call(this),this.currentTab=this.namespaces.indexOf(i),this.namespace=i,this.caipAddress=(s=u.getAccountData(i))==null?void 0:s.caipAddress,this.profileName=(n=u.getAccountData(i))==null?void 0:n.profileName,this.chainListener=u.subscribeChainProp("accountState",r=>{this.caipAddress=r==null?void 0:r.caipAddress},i))}async handleSwitchWallet(e,i,o){try{this.isSwitching=!0,this.lastSelectedConnectorId=e.connectorId,this.lastSelectedAddress=i,await y.switchConnection({connection:e,address:i,namespace:o,closeModalOnConnect:!1,onChange({hasSwitchedAccount:s,hasSwitchedWallet:n}){n?k.showSuccess("Wallet switched"):s&&k.showSuccess("Account switched")}})}catch{k.showError("Failed to switch wallet")}finally{this.isSwitching=!1}}handleWalletAction(e){const{connection:i,address:o,isRecentConnection:s,namespace:n}=e;s?(fe.deleteAddressFromConnection({connectorId:i.connectorId,address:o,namespace:n}),y.syncStorageConnections(),k.showSuccess("Wallet deleted")):this.handleDisconnect(n,{id:i.connectorId})}async handleDisconnect(e,{id:i}){try{await y.disconnect({id:i,namespace:e}),k.showSuccess("Wallet disconnected")}catch{k.showError("Failed to disconnect wallet")}}handleCopyAddress(e){b.copyToClopboard(e),k.showSuccess("Address copied")}handleMore(){m.push("AccountSettings")}handleExternalLink(e){var o,s;const i=(s=(o=this.caipNetwork)==null?void 0:o.blockExplorers)==null?void 0:s.default.url;i&&b.openHref(`${i}/address/${e}`,"_blank")}handleAddConnection(e){w.setFilterByNamespace(e),m.push("Connect")}getChainLabelInfo(e){return ro[e]??{title:"Add Wallet",description:"Add your first wallet"}}isSmartAccount(e){var o,s;if(!this.namespace)return!1;const i=(s=(o=this.user)==null?void 0:o.accounts)==null?void 0:s.find(n=>n.type==="smartAccount");return i&&e?X.isLowerCaseMatch(i.address,e):!1}getPlainAddress(){return this.caipAddress?b.getPlainAddress(this.caipAddress):void 0}getActiveConnections(e){const i=this.activeConnectorIds[e],{connections:o}=xe.getConnectionsData(e),[s]=o.filter(g=>X.isLowerCaseMatch(g.connectorId,i));if(!i)return o;const n=e===A.CHAIN.BITCOIN,{address:r}=this.caipAddress?An.parseCaipAddress(this.caipAddress):{};let a=[...r?[r]:[]];return n&&s&&(a=s.accounts.map(g=>g.address)||[]),xe.excludeConnectorAddressFromConnections({connectorId:i,addresses:a,connections:o})}hasAnyConnections(e){const i=this.getActiveConnections(e),{recentConnections:o}=xe.getConnectionsData(e);return!!this.caipAddress||i.length>0||o.length>0}isAccountLoading(e,i){return X.isLowerCaseMatch(this.lastSelectedConnectorId,e)&&X.isLowerCaseMatch(this.lastSelectedAddress,i)&&this.isSwitching}getProfileContent(e){const{address:i,connections:o,connectorId:s,namespace:n}=e,[r]=o.filter(g=>X.isLowerCaseMatch(g.connectorId,s));if(n===A.CHAIN.BITCOIN&&(r!=null&&r.accounts.every(g=>typeof g.type=="string")))return this.getBitcoinProfileContent(r.accounts,i);const a=oi.getAuthData({connectorId:s,accounts:[]});return[{address:i,tagLabel:"Active",tagVariant:"success",enableButton:!0,profileName:this.profileName,buttonType:"disconnect",buttonLabel:"Disconnect",buttonVariant:"neutral-secondary",...a.isAuth?{description:this.isSmartAccount(i)?"Smart Account":"EOA Account"}:{}}]}getBitcoinProfileContent(e,i){const o=e.length>1,s=this.getPlainAddress();return e.map(n=>{const r=X.isLowerCaseMatch(n.address,s);let a="PAYMENT";return n.type==="ordinal"&&(a="ORDINALS"),{address:n.address,tagLabel:X.isLowerCaseMatch(n.address,i)?"Active":void 0,tagVariant:X.isLowerCaseMatch(n.address,i)?"success":void 0,enableButton:!0,...o?{label:a,alignItems:"flex-end",buttonType:r?"disconnect":"switch",buttonLabel:r?"Disconnect":"Switch",buttonVariant:r?"neutral-secondary":"accent-secondary"}:{alignItems:"center",buttonType:"disconnect",buttonLabel:"Disconnect",buttonVariant:"neutral-secondary"}}})}removeScrollListener(){var i;const e=(i=this.shadowRoot)==null?void 0:i.querySelector(".wallet-list");e&&e.removeEventListener("scroll",()=>this.handleConnectListScroll())}handleConnectListScroll(){var i;const e=(i=this.shadowRoot)==null?void 0:i.querySelector(".wallet-list");e&&this.updateScrollOpacity(e)}isMultiWalletEnabled(){var e;return!!((e=this.remoteFeatures)!=null&&e.multiWallet)}updateScrollOpacity(e){e.style.setProperty("--connect-scroll--top-opacity",At.interpolate([0,te.SCROLL_THRESHOLD],te.OPACITY_RANGE,e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",At.interpolate([0,te.SCROLL_THRESHOLD],te.OPACITY_RANGE,e.scrollHeight-e.scrollTop-e.offsetHeight).toString())}onConnectionsChange(){if(this.isMultiWalletEnabled()&&this.namespace){const{connections:e}=xe.getConnectionsData(this.namespace);e.length===0&&m.reset("ProfileWallets")}this.requestUpdate()}};U.styles=oo;J([d()],U.prototype,"currentTab",void 0);J([d()],U.prototype,"namespace",void 0);J([d()],U.prototype,"namespaces",void 0);J([d()],U.prototype,"caipAddress",void 0);J([d()],U.prototype,"profileName",void 0);J([d()],U.prototype,"activeConnectorIds",void 0);J([d()],U.prototype,"lastSelectedAddress",void 0);J([d()],U.prototype,"lastSelectedConnectorId",void 0);J([d()],U.prototype,"isSwitching",void 0);J([d()],U.prototype,"caipNetwork",void 0);J([d()],U.prototype,"user",void 0);J([d()],U.prototype,"remoteFeatures",void 0);U=J([p("w3m-profile-wallets-view")],U);const ao=v` :host { display: flex; align-items: center; justify-content: center; } label { position: relative; display: inline-block; user-select: none; transition: background-color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}, color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}, border ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}, box-shadow ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}, width ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}, height ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}, transform ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}, opacity ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}; will-change: background-color, color, border, box-shadow, width, height, transform, opacity; } input { width: 0; height: 0; opacity: 0; } span { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: ${({colors:t})=>t.neutrals300}; border-radius: ${({borderRadius:t})=>t.round}; border: 1px solid transparent; will-change: border; transition: background-color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}, color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}, border ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}, box-shadow ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}, width ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}, height ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}, transform ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}, opacity ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}; will-change: background-color, color, border, box-shadow, width, height, transform, opacity; } span:before { content: ''; position: absolute; background-color: ${({colors:t})=>t.white}; border-radius: 50%; } /* -- Sizes --------------------------------------------------------- */ label[data-size='lg'] { width: 48px; height: 32px; } label[data-size='md'] { width: 40px; height: 28px; } label[data-size='sm'] { width: 32px; height: 22px; } label[data-size='lg'] > span:before { height: 24px; width: 24px; left: 4px; top: 3px; } label[data-size='md'] > span:before { height: 20px; width: 20px; left: 4px; top: 3px; } label[data-size='sm'] > span:before { height: 16px; width: 16px; left: 3px; top: 2px; } /* -- Focus states --------------------------------------------------- */ input:focus-visible:not(:checked) + span, input:focus:not(:checked) + span { border: 1px solid ${({tokens:t})=>t.core.iconAccentPrimary}; background-color: ${({tokens:t})=>t.theme.textTertiary}; box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2); } input:focus-visible:checked + span, input:focus:checked + span { border: 1px solid ${({tokens:t})=>t.core.iconAccentPrimary}; box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2); } /* -- Checked states --------------------------------------------------- */ input:checked + span { background-color: ${({tokens:t})=>t.core.iconAccentPrimary}; } label[data-size='lg'] > input:checked + span:before { transform: translateX(calc(100% - 9px)); } label[data-size='md'] > input:checked + span:before { transform: translateX(calc(100% - 9px)); } label[data-size='sm'] > input:checked + span:before { transform: translateX(calc(100% - 7px)); } /* -- Hover states ------------------------------------------------------- */ label:hover > input:not(:checked):not(:disabled) + span { background-color: ${({colors:t})=>t.neutrals400}; } label:hover > input:checked:not(:disabled) + span { background-color: ${({colors:t})=>t.accent080}; } /* -- Disabled state --------------------------------------------------- */ label:has(input:disabled) { pointer-events: none; user-select: none; } input:not(:checked):disabled + span { background-color: ${({colors:t})=>t.neutrals700}; } input:checked:disabled + span { background-color: ${({colors:t})=>t.neutrals700}; } input:not(:checked):disabled + span::before { background-color: ${({colors:t})=>t.neutrals400}; } input:checked:disabled + span::before { background-color: ${({tokens:t})=>t.theme.textTertiary}; } `;var Ht=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ke=class extends f{constructor(){super(...arguments),this.inputElementRef=gi(),this.checked=!1,this.disabled=!1,this.size="md"}render(){return l` `}dispatchChangeEvent(){var e;this.dispatchEvent(new CustomEvent("switchChange",{detail:(e=this.inputElementRef.value)==null?void 0:e.checked,bubbles:!0,composed:!0}))}};Ke.styles=[_,T,ao];Ht([c({type:Boolean})],Ke.prototype,"checked",void 0);Ht([c({type:Boolean})],Ke.prototype,"disabled",void 0);Ht([c()],Ke.prototype,"size",void 0);Ke=Ht([p("wui-toggle")],Ke);const lo=v` :host { height: auto; } :host > wui-flex { height: 100%; display: flex; align-items: center; justify-content: center; column-gap: ${({spacing:t})=>t[2]}; padding: ${({spacing:t})=>t[2]} ${({spacing:t})=>t[3]}; background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; border-radius: ${({borderRadius:t})=>t[4]}; box-shadow: inset 0 0 0 1px ${({tokens:t})=>t.theme.foregroundPrimary}; transition: background-color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}; will-change: background-color; cursor: pointer; } wui-switch { pointer-events: none; } `;var dn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Et=class extends f{constructor(){super(...arguments),this.checked=!1}render(){return l` `}handleToggleChange(e){e.stopPropagation(),this.checked=e.detail,this.dispatchSwitchEvent()}dispatchSwitchEvent(){this.dispatchEvent(new CustomEvent("certifiedSwitchChange",{detail:this.checked,bubbles:!0,composed:!0}))}};Et.styles=[_,T,lo];dn([c({type:Boolean})],Et.prototype,"checked",void 0);Et=dn([p("wui-certified-switch")],Et);const co=v` :host { position: relative; display: inline-block; width: 100%; } wui-icon { position: absolute; top: 50%; transform: translateY(-50%); right: ${({spacing:t})=>t[3]}; color: ${({tokens:t})=>t.theme.iconDefault}; cursor: pointer; padding: ${({spacing:t})=>t[2]}; background-color: transparent; border-radius: ${({borderRadius:t})=>t[4]}; transition: background-color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}; } @media (hover: hover) { wui-icon:hover { background-color: ${({tokens:t})=>t.theme.foregroundSecondary}; } } `;var un=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let kt=class extends f{constructor(){super(...arguments),this.inputComponentRef=gi(),this.inputValue=""}render(){return l` ${this.inputValue?l``:null} `}onInputChange(e){this.inputValue=e.detail||""}clearValue(){const e=this.inputComponentRef.value,i=e==null?void 0:e.inputElementRef.value;i&&(i.value="",this.inputValue="",i.focus(),i.dispatchEvent(new Event("input")))}};kt.styles=[_,co];un([c()],kt.prototype,"inputValue",void 0);kt=un([p("wui-search-bar")],kt);const uo=v` :host { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 104px; width: 104px; row-gap: ${({spacing:t})=>t[2]}; background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; border-radius: ${({borderRadius:t})=>t[5]}; position: relative; } wui-shimmer[data-type='network'] { border: none; -webkit-clip-path: var(--apkt-path-network); clip-path: var(--apkt-path-network); } svg { position: absolute; width: 48px; height: 54px; z-index: 1; } svg > path { stroke: ${({tokens:t})=>t.theme.foregroundSecondary}; stroke-width: 1px; } @media (max-width: 350px) { :host { width: 100%; } } `;var hn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let _t=class extends f{constructor(){super(...arguments),this.type="wallet"}render(){return l` ${this.shimmerTemplate()} `}shimmerTemplate(){return this.type==="network"?l` ${Tn}`:l``}};_t.styles=[_,T,uo];hn([c()],_t.prototype,"type",void 0);_t=hn([p("wui-card-select-loader")],_t);const ho=ne` :host { display: grid; width: inherit; height: inherit; } `;var re=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let K=class extends f{render(){return this.style.cssText=` grid-template-rows: ${this.gridTemplateRows}; grid-template-columns: ${this.gridTemplateColumns}; justify-items: ${this.justifyItems}; align-items: ${this.alignItems}; justify-content: ${this.justifyContent}; align-content: ${this.alignContent}; column-gap: ${this.columnGap&&`var(--apkt-spacing-${this.columnGap})`}; row-gap: ${this.rowGap&&`var(--apkt-spacing-${this.rowGap})`}; gap: ${this.gap&&`var(--apkt-spacing-${this.gap})`}; padding-top: ${this.padding&&V.getSpacingStyles(this.padding,0)}; padding-right: ${this.padding&&V.getSpacingStyles(this.padding,1)}; padding-bottom: ${this.padding&&V.getSpacingStyles(this.padding,2)}; padding-left: ${this.padding&&V.getSpacingStyles(this.padding,3)}; margin-top: ${this.margin&&V.getSpacingStyles(this.margin,0)}; margin-right: ${this.margin&&V.getSpacingStyles(this.margin,1)}; margin-bottom: ${this.margin&&V.getSpacingStyles(this.margin,2)}; margin-left: ${this.margin&&V.getSpacingStyles(this.margin,3)}; `,l``}};K.styles=[_,ho];re([c()],K.prototype,"gridTemplateRows",void 0);re([c()],K.prototype,"gridTemplateColumns",void 0);re([c()],K.prototype,"justifyItems",void 0);re([c()],K.prototype,"alignItems",void 0);re([c()],K.prototype,"justifyContent",void 0);re([c()],K.prototype,"alignContent",void 0);re([c()],K.prototype,"columnGap",void 0);re([c()],K.prototype,"rowGap",void 0);re([c()],K.prototype,"gap",void 0);re([c()],K.prototype,"padding",void 0);re([c()],K.prototype,"margin",void 0);K=re([p("wui-grid")],K);const po=v` button { display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; width: 104px; row-gap: ${({spacing:t})=>t[2]}; padding: ${({spacing:t})=>t[3]} ${({spacing:t})=>t[0]}; background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; border-radius: clamp(0px, ${({borderRadius:t})=>t[4]}, 20px); transition: color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-1"]}, background-color ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-1"]}, border-radius ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-1"]}; will-change: background-color, color, border-radius; outline: none; border: none; } button > wui-flex > wui-text { color: ${({tokens:t})=>t.theme.textPrimary}; max-width: 86px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; justify-content: center; } button > wui-flex > wui-text.certified { max-width: 66px; } @media (hover: hover) and (pointer: fine) { button:hover:enabled { background-color: ${({tokens:t})=>t.theme.foregroundSecondary}; } } button:disabled > wui-flex > wui-text { color: ${({tokens:t})=>t.core.glass010}; } [data-selected='true'] { background-color: ${({colors:t})=>t.accent020}; } @media (hover: hover) and (pointer: fine) { [data-selected='true']:hover:enabled { background-color: ${({colors:t})=>t.accent010}; } } [data-selected='true']:active:enabled { background-color: ${({colors:t})=>t.accent010}; } @media (max-width: 350px) { button { width: 100%; } } `;var xt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let je=class extends f{constructor(){super(),this.observer=new IntersectionObserver(()=>{}),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.wallet=void 0,this.observer=new IntersectionObserver(e=>{e.forEach(i=>{i.isIntersecting?(this.visible=!0,this.fetchImageSrc()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){var i,o;const e=((i=this.wallet)==null?void 0:i.badge_type)==="certified";return l` `}imageTemplate(){var e,i;return!this.visible&&!this.imageSrc||this.imageLoading?this.shimmerTemplate():l` `}shimmerTemplate(){return l``}async fetchImageSrc(){this.wallet&&(this.imageSrc=S.getWalletImage(this.wallet),!this.imageSrc&&(this.imageLoading=!0,this.imageSrc=await S.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}};je.styles=po;xt([d()],je.prototype,"visible",void 0);xt([d()],je.prototype,"imageSrc",void 0);xt([d()],je.prototype,"imageLoading",void 0);xt([c()],je.prototype,"wallet",void 0);je=xt([p("w3m-all-wallets-list-item")],je);const fo=v` wui-grid { max-height: clamp(360px, 400px, 80vh); overflow: scroll; scrollbar-width: none; grid-auto-rows: min-content; grid-template-columns: repeat(auto-fill, 104px); } @media (max-width: 350px) { wui-grid { grid-template-columns: repeat(2, 1fr); } } wui-grid[data-scroll='false'] { overflow: hidden; } wui-grid::-webkit-scrollbar { display: none; } w3m-all-wallets-list-item { opacity: 0; animation-duration: ${({durations:t})=>t.xl}; animation-timing-function: ${({easings:t})=>t["ease-inout-power-2"]}; animation-name: fade-in; animation-fill-mode: forwards; } @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } } wui-loading-spinner { padding-top: ${({spacing:t})=>t[4]}; padding-bottom: ${({spacing:t})=>t[4]}; justify-content: center; grid-column: 1 / span 4; } `;var Je=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const qi="local-paginator";let Ce=class extends f{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.loading=!E.state.wallets.length,this.wallets=E.state.wallets,this.recommended=E.state.recommended,this.featured=E.state.featured,this.filteredWallets=E.state.filteredWallets,this.unsubscribe.push(E.subscribeKey("wallets",e=>this.wallets=e),E.subscribeKey("recommended",e=>this.recommended=e),E.subscribeKey("featured",e=>this.featured=e),E.subscribeKey("filteredWallets",e=>this.filteredWallets=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){var e;this.unsubscribe.forEach(i=>i()),(e=this.paginationObserver)==null||e.disconnect()}render(){return l` ${this.loading?this.shimmerTemplate(16):this.walletsTemplate()} ${this.paginationLoaderTemplate()} `}async initialFetch(){var i;this.loading=!0;const e=(i=this.shadowRoot)==null?void 0:i.querySelector("wui-grid");e&&(await E.fetchWalletsByPage({page:1}),await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.loading=!1,e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(e,i){return[...Array(e)].map(()=>l` `)}getWallets(){var s;const e=[...this.featured,...this.recommended];((s=this.filteredWallets)==null?void 0:s.length)>0?e.push(...this.filteredWallets):e.push(...this.wallets);const i=b.uniqueBy(e,"id"),o=Te.markWalletsAsInstalled(i);return Te.markWalletsWithDisplayIndex(o)}walletsTemplate(){return this.getWallets().map(i=>l` this.onConnectWallet(i)} .wallet=${i} > `)}paginationLoaderTemplate(){const{wallets:e,recommended:i,featured:o,count:s,mobileFilteredOutWalletsLength:n}=E.state,r=window.innerWidth<352?3:4,a=e.length+i.length;let C=Math.ceil(a/r)*r-a+r;return C-=e.length?o.length%r:0,s===0&&o.length>0?null:s===0||[...o,...e,...i].length{if(o!=null&&o.isIntersecting&&!this.loading){const{page:s,count:n,wallets:r}=E.state;r.length=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let qe=class extends f{constructor(){super(...arguments),this.prevQuery="",this.prevBadge=void 0,this.loading=!0,this.query=""}render(){return this.onSearch(),this.loading?l``: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 E.searchWallet({search:this.query,badge:this.badge}),this.loading=!1)}walletsTemplate(){const{search:e}=E.state,i=Te.markWalletsAsInstalled(e);return e.length?l` ${i.map(o=>l` this.onConnectWallet(o)} .wallet=${o} data-testid="wallet-search-item-${o.id}" > `)} `:l` No Wallet found `}onConnectWallet(e){w.selectWalletConnector(e)}};qe.styles=wo;Kt([d()],qe.prototype,"loading",void 0);Kt([c()],qe.prototype,"query",void 0);Kt([c()],qe.prototype,"badge",void 0);qe=Kt([p("w3m-all-wallets-search")],qe);var $i=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Wt=class extends f{constructor(){super(...arguments),this.search="",this.badge=void 0,this.onDebouncedSearch=b.debounce(e=>{this.search=e})}render(){const e=this.search.length>=2;return l` ${this.qrButtonTemplate()} ${e||this.badge?l``:l``} `}onInputChange(e){this.onDebouncedSearch(e.detail)}onCertifiedSwitchChange(e){e.detail?(this.badge="certified",k.showSvg("Only WalletConnect certified",{icon:"walletConnectBrown",iconColor:"accent-100"})):this.badge=void 0}qrButtonTemplate(){return b.isMobile()?l` `:null}onWalletConnectQr(){m.push("ConnectingWalletConnect")}};$i([d()],Wt.prototype,"search",void 0);$i([d()],Wt.prototype,"badge",void 0);Wt=$i([p("w3m-all-wallets-view")],Wt);const mo=v` button { display: flex; gap: ${({spacing:t})=>t[1]}; padding: ${({spacing:t})=>t[4]}; width: 100%; background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; border-radius: ${({borderRadius:t})=>t[4]}; justify-content: center; align-items: center; } :host([data-size='sm']) button { padding: ${({spacing:t})=>t[2]}; border-radius: ${({borderRadius:t})=>t[2]}; } :host([data-size='md']) button { padding: ${({spacing:t})=>t[3]}; border-radius: ${({borderRadius:t})=>t[3]}; } button:hover { background-color: ${({tokens:t})=>t.theme.foregroundSecondary}; } button:disabled { opacity: 0.5; } `;var et=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Se=class extends f{constructor(){super(...arguments),this.text="",this.disabled=!1,this.size="lg",this.icon="copy",this.tabIdx=void 0}render(){this.dataset.size=this.size;const e=`${this.size}-regular`;return l` `}};Se.styles=[_,T,mo];et([c()],Se.prototype,"text",void 0);et([c({type:Boolean})],Se.prototype,"disabled",void 0);et([c()],Se.prototype,"size",void 0);et([c()],Se.prototype,"icon",void 0);et([c()],Se.prototype,"tabIdx",void 0);Se=et([p("wui-list-button")],Se);const bo=v` wui-separator { margin: ${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1); width: calc(100% + ${({spacing:t})=>t[3]} * 2); } wui-email-input { width: 100%; } form { width: 100%; display: block; position: relative; } wui-icon-link, wui-loading-spinner { position: absolute; top: 50%; transform: translateY(-50%); } wui-icon-link { right: ${({spacing:t})=>t[2]}; } wui-loading-spinner { right: ${({spacing:t})=>t[3]}; } wui-text { margin: ${({spacing:t})=>t[2]} ${({spacing:t})=>t[3]} ${({spacing:t})=>t[0]} ${({spacing:t})=>t[3]}; } `;var tt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ae=class extends f{constructor(){super(),this.unsubscribe=[],this.formRef=gi(),this.email="",this.loading=!1,this.error="",this.remoteFeatures=x.state.remoteFeatures,this.unsubscribe.push(x.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",i=>{i.key==="Enter"&&this.onSubmitEmail(i)})}render(){const e=y.hasAnyConnection(A.CONNECTOR_ID.AUTH);return l`
${this.submitButtonTemplate()}${this.loadingTemplate()}
${this.templateError()} `}submitButtonTemplate(){return!this.loading&&this.email.length>3?l` `:null}loadingTemplate(){return this.loading?l``:null}templateError(){return this.error?l`${this.error}`:null}onEmailInputChange(e){this.email=e.detail.trim(),this.error=""}async onSubmitEmail(e){var o;if(!bi.isValidEmail(this.email)){rn.open({displayMessage:In.ALERT_WARNINGS.INVALID_EMAIL.displayMessage},"warning");return}if(!A.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(s=>s===u.state.activeChain)){const s=u.getFirstCaipNetworkSupportsAuthConnector();if(s){m.push("SwitchNetwork",{network:s});return}}try{if(this.loading)return;this.loading=!0,e.preventDefault();const s=w.getAuthConnector();if(!s)throw new Error("w3m-email-login-widget: Auth connector not found");const{action:n}=await s.provider.connectEmail({email:this.email});if(I.sendEvent({type:"track",event:"EMAIL_SUBMITTED"}),n==="VERIFY_OTP")I.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),m.push("EmailVerifyOtp",{email:this.email});else if(n==="VERIFY_DEVICE")m.push("EmailVerifyDevice",{email:this.email});else if(n==="CONNECT"){const r=(o=this.remoteFeatures)==null?void 0:o.multiWallet;await y.connectExternal(s,u.state.activeChain),r?(m.replace("ProfileWallets"),k.showSuccess("New Wallet Added")):m.replace("Account")}}catch(s){const n=b.parseError(s);n!=null&&n.includes("Invalid email")?this.error="Invalid email. Try again.":k.showError(s)}finally{this.loading=!1}}onFocusEvent(){I.sendEvent({type:"track",event:"EMAIL_LOGIN_SELECTED"})}};Ae.styles=bo;tt([c()],Ae.prototype,"tabIdx",void 0);tt([d()],Ae.prototype,"email",void 0);tt([d()],Ae.prototype,"loading",void 0);tt([d()],Ae.prototype,"error",void 0);tt([d()],Ae.prototype,"remoteFeatures",void 0);Ae=tt([p("w3m-email-login-widget")],Ae);const go=v` :host { display: block; width: 100%; } button { width: 100%; height: 52px; display: flex; align-items: center; justify-content: center; background: ${({tokens:t})=>t.theme.foregroundPrimary}; border-radius: ${({borderRadius:t})=>t[4]}; } @media (hover: hover) { button:hover:enabled { background: ${({tokens:t})=>t.theme.foregroundSecondary}; } } button:disabled { cursor: not-allowed; opacity: 0.5; } button > wui-icon { width: 24px; height: 24px; } `;var qt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ge=class extends f{constructor(){super(...arguments),this.logo="google",this.disabled=!1,this.tabIdx=void 0}render(){return l` `}};Ge.styles=[_,T,go];qt([c()],Ge.prototype,"logo",void 0);qt([c({type:Boolean})],Ge.prototype,"disabled",void 0);qt([c()],Ge.prototype,"tabIdx",void 0);Ge=qt([p("wui-logo-select")],Ge);const yo=v` wui-separator { margin: ${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1) ${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1); width: calc(100% + ${({spacing:t})=>t[3]} * 2); } `;var Fe=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Gi=2,Yi=6;let ge=class extends f{constructor(){super(),this.unsubscribe=[],this.walletGuide="get-started",this.tabIdx=void 0,this.connectors=w.state.connectors,this.remoteFeatures=x.state.remoteFeatures,this.authConnector=this.connectors.find(e=>e.type==="AUTH"),this.isPwaLoading=!1,this.unsubscribe.push(w.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(i=>i.type==="AUTH")}),x.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}connectedCallback(){super.connectedCallback(),this.handlePwaFrameLoad()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l` ${this.topViewTemplate()}${this.bottomViewTemplate()} `}topViewTemplate(){var o;const e=this.walletGuide==="explore";let i=(o=this.remoteFeatures)==null?void 0:o.socials;return!i&&e?(i=P.DEFAULT_SOCIALS,this.renderTopViewContent(i)):i?this.renderTopViewContent(i):null}renderTopViewContent(e){return e.length===2?l` ${e.slice(0,Gi).map(i=>l`{this.onSocialClick(i)}} logo=${i} tabIdx=${h(this.tabIdx)} ?disabled=${this.isPwaLoading||this.hasConnection()} >`)} `:l` {this.onSocialClick(e[0])}} size="lg" icon=${h(e[0])} text=${`Continue with ${e[0]}`} tabIdx=${h(this.tabIdx)} ?disabled=${this.isPwaLoading||this.hasConnection()} >`}bottomViewTemplate(){var s;let e=(s=this.remoteFeatures)==null?void 0:s.socials;const i=this.walletGuide==="explore";return(!this.authConnector||!e||e.length===0)&&i&&(e=P.DEFAULT_SOCIALS),!e||e.length<=Gi?null:e&&e.length>Yi?l` ${e.slice(1,Yi-1).map(n=>l`{this.onSocialClick(n)}} logo=${n} tabIdx=${h(this.tabIdx)} ?focusable=${this.tabIdx!==void 0&&this.tabIdx>=0} ?disabled=${this.isPwaLoading||this.hasConnection()} >`)} `:e?l` ${e.slice(1,e.length).map(n=>l`{this.onSocialClick(n)}} logo=${n} tabIdx=${h(this.tabIdx)} ?focusable=${this.tabIdx!==void 0&&this.tabIdx>=0} ?disabled=${this.isPwaLoading||this.hasConnection()} >`)} `:null}onMoreSocialsClick(){m.push("ConnectSocials")}async onSocialClick(e){if(!A.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(o=>o===u.state.activeChain)){const o=u.getFirstCaipNetworkSupportsAuthConnector();if(o){m.push("SwitchNetwork",{network:o});return}}e&&await Nn(e)}async handlePwaFrameLoad(){var e;if(b.isPWA()){this.isPwaLoading=!0;try{((e=this.authConnector)==null?void 0:e.provider)instanceof En&&await this.authConnector.provider.init()}catch(i){rn.open({displayMessage:"Error loading embedded wallet in PWA",debugMessage:i.message},"error")}finally{this.isPwaLoading=!1}}}hasConnection(){return y.hasAnyConnection(A.CONNECTOR_ID.AUTH)}};ge.styles=yo;Fe([c()],ge.prototype,"walletGuide",void 0);Fe([c()],ge.prototype,"tabIdx",void 0);Fe([d()],ge.prototype,"connectors",void 0);Fe([d()],ge.prototype,"remoteFeatures",void 0);Fe([d()],ge.prototype,"authConnector",void 0);Fe([d()],ge.prototype,"isPwaLoading",void 0);ge=Fe([p("w3m-social-login-widget")],ge);const xo=v` :host { position: relative; border-radius: ${({borderRadius:t})=>t[2]}; width: 40px; height: 40px; overflow: hidden; background: ${({tokens:t})=>t.theme.foregroundPrimary}; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; column-gap: ${({spacing:t})=>t[1]}; padding: ${({spacing:t})=>t[1]}; } :host > wui-wallet-image { width: 14px; height: 14px; border-radius: 2px; } `;var pn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const si=4;let Tt=class extends f{constructor(){super(...arguments),this.walletImages=[]}render(){const e=this.walletImages.lengthl` `)} ${e?[...Array(si-this.walletImages.length)].map(()=>l` `):null} `}};Tt.styles=[_,xo];pn([c({type:Array})],Tt.prototype,"walletImages",void 0);Tt=pn([p("wui-all-wallets-image")],Tt);const vo=v` :host { width: 100%; } button { column-gap: ${({spacing:t})=>t[2]}; padding: ${({spacing:t})=>t[3]}; width: 100%; background-color: transparent; border-radius: ${({borderRadius:t})=>t[4]}; color: ${({tokens:t})=>t.theme.textPrimary}; } button > wui-wallet-image { background: ${({tokens:t})=>t.theme.foregroundSecondary}; } button > wui-text:nth-child(2) { display: flex; flex: 1; } button:hover:enabled { background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; } button[data-all-wallets='true'] { background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; } button[data-all-wallets='true']:hover:enabled { background-color: ${({tokens:t})=>t.theme.foregroundSecondary}; } button:focus-visible:enabled { background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; box-shadow: 0 0 0 4px ${({tokens:t})=>t.core.foregroundAccent020}; } button:disabled { background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; opacity: 0.5; cursor: not-allowed; } button:disabled > wui-tag { background-color: ${({tokens:t})=>t.core.glass010}; color: ${({tokens:t})=>t.theme.foregroundTertiary}; } `;var ee=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let z=class extends f{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.size="md",this.tabIdx=void 0,this.disabled=!1,this.showAllWallets=!1,this.loading=!1,this.loadingSpinnerColor="accent-100"}render(){return this.dataset.size=this.size,l` `}templateAllWallets(){return this.showAllWallets&&this.imageSrc?l` `:this.showAllWallets&&this.walletIcon?l` `:null}templateWalletImage(){return!this.showAllWallets&&this.imageSrc?l``:!this.showAllWallets&&!this.imageSrc?l``:null}templateStatus(){return this.loading?l``:this.tagLabel&&this.tagVariant?l`${this.tagLabel}`:null}};z.styles=[_,T,vo];ee([c({type:Array})],z.prototype,"walletImages",void 0);ee([c()],z.prototype,"imageSrc",void 0);ee([c()],z.prototype,"name",void 0);ee([c()],z.prototype,"size",void 0);ee([c()],z.prototype,"tagLabel",void 0);ee([c()],z.prototype,"tagVariant",void 0);ee([c()],z.prototype,"walletIcon",void 0);ee([c()],z.prototype,"tabIdx",void 0);ee([c({type:Boolean})],z.prototype,"disabled",void 0);ee([c({type:Boolean})],z.prototype,"showAllWallets",void 0);ee([c({type:Boolean})],z.prototype,"loading",void 0);ee([c({type:String})],z.prototype,"loadingSpinnerColor",void 0);z=ee([p("wui-list-wallet")],z);var it=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Le=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=w.state.connectors,this.count=E.state.count,this.filteredCount=E.state.filteredWallets.length,this.isFetchingRecommendedWallets=E.state.isFetchingRecommendedWallets,this.unsubscribe.push(w.subscribeKey("connectors",e=>this.connectors=e),E.subscribeKey("count",e=>this.count=e),E.subscribeKey("filteredWallets",e=>this.filteredCount=e.length),E.subscribeKey("isFetchingRecommendedWallets",e=>this.isFetchingRecommendedWallets=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.find(C=>C.id==="walletConnect"),{allWallets:i}=x.state;if(!e||i==="HIDE"||i==="ONLY_MOBILE"&&!b.isMobile())return null;const o=E.state.featured.length,s=this.count+o,n=s<10?s:Math.floor(s/10)*10,r=this.filteredCount>0?this.filteredCount:n;let a=`${r}`;this.filteredCount>0?a=`${this.filteredCount}`:r `}onAllWallets(){I.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),m.push("AllWallets")}};it([c()],Le.prototype,"tabIdx",void 0);it([d()],Le.prototype,"connectors",void 0);it([d()],Le.prototype,"count",void 0);it([d()],Le.prototype,"filteredCount",void 0);it([d()],Le.prototype,"isFetchingRecommendedWallets",void 0);Le=it([p("w3m-all-wallets-widget")],Le);var Gt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let at=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=w.state.connectors,this.connections=y.state.connections,this.unsubscribe.push(w.subscribeKey("connectors",e=>this.connectors=e),y.subscribeKey("connections",e=>this.connections=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.filter(i=>i.type==="ANNOUNCED");return e!=null&&e.length?l` ${e.filter(We.showConnector).map(i=>{const s=(this.connections.get(i.chain)??[]).some(n=>X.isLowerCaseMatch(n.connectorId,i.id));return l` this.onConnector(i)} tagVariant=${s?"info":"success"} tagLabel=${s?"connected":"installed"} size="sm" data-testid=${`wallet-selector-${i.id}`} .installed=${!0} tabIdx=${h(this.tabIdx)} > `})} `:(this.style.cssText="display: none",null)}onConnector(e){e.id==="walletConnect"?b.isMobile()?m.push("AllWallets"):m.push("ConnectingWalletConnect"):m.push("ConnectingExternal",{connector:e})}};Gt([c()],at.prototype,"tabIdx",void 0);Gt([d()],at.prototype,"connectors",void 0);Gt([d()],at.prototype,"connections",void 0);at=Gt([p("w3m-connect-announced-widget")],at);var Yt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let lt=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=w.state.connectors,this.loading=!1,this.unsubscribe.push(w.subscribeKey("connectors",e=>this.connectors=e)),b.isTelegram()&&b.isIos()&&(this.loading=!y.state.wcUri,this.unsubscribe.push(y.subscribeKey("wcUri",e=>this.loading=!e)))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const{customWallets:e}=x.state;if(!(e!=null&&e.length))return this.style.cssText="display: none",null;const i=this.filterOutDuplicateWallets(e),o=y.hasAnyConnection(A.CONNECTOR_ID.WALLET_CONNECT);return l` ${i.map(s=>l` this.onConnectWallet(s)} size="sm" data-testid=${`wallet-selector-${s.id}`} tabIdx=${h(this.tabIdx)} ?loading=${this.loading} ?disabled=${o} > `)} `}filterOutDuplicateWallets(e){const i=fe.getRecentWallets(),o=this.connectors.map(a=>{var g;return(g=a.info)==null?void 0:g.rdns}).filter(Boolean),s=i.map(a=>a.rdns).filter(Boolean),n=o.concat(s);if(n.includes("io.metamask.mobile")&&b.isMobile()){const a=n.indexOf("io.metamask.mobile");n[a]="io.metamask"}return e.filter(a=>!n.includes(String(a==null?void 0:a.rdns)))}onConnectWallet(e){this.loading||m.push("ConnectingWalletConnect",{wallet:e})}};Yt([c()],lt.prototype,"tabIdx",void 0);Yt([d()],lt.prototype,"connectors",void 0);Yt([d()],lt.prototype,"loading",void 0);lt=Yt([p("w3m-connect-custom-widget")],lt);var Ci=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Nt=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=w.state.connectors,this.unsubscribe.push(w.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const o=this.connectors.filter(n=>n.type==="EXTERNAL").filter(We.showConnector).filter(n=>n.id!==A.CONNECTOR_ID.COINBASE_SDK);if(!(o!=null&&o.length))return this.style.cssText="display: none",null;const s=y.hasAnyConnection(A.CONNECTOR_ID.WALLET_CONNECT);return l` ${o.map(n=>l` this.onConnector(n)} tabIdx=${h(this.tabIdx)} ?disabled=${s} > `)} `}onConnector(e){m.push("ConnectingExternal",{connector:e})}};Ci([c()],Nt.prototype,"tabIdx",void 0);Ci([d()],Nt.prototype,"connectors",void 0);Nt=Ci([p("w3m-connect-external-widget")],Nt);var Si=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Rt=class extends f{constructor(){super(...arguments),this.tabIdx=void 0,this.wallets=[]}render(){if(!this.wallets.length)return this.style.cssText="display: none",null;const e=y.hasAnyConnection(A.CONNECTOR_ID.WALLET_CONNECT);return l` ${this.wallets.map(i=>l` this.onConnectWallet(i)} tabIdx=${h(this.tabIdx)} size="sm" ?disabled=${e} > `)} `}onConnectWallet(e){w.selectWalletConnector(e)}};Si([c()],Rt.prototype,"tabIdx",void 0);Si([c()],Rt.prototype,"wallets",void 0);Rt=Si([p("w3m-connect-featured-widget")],Rt);var Xt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ct=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=[],this.connections=y.state.connections,this.unsubscribe.push(y.subscribeKey("connections",e=>this.connections=e))}render(){const e=this.connectors.filter(We.showConnector);return e.length===0?(this.style.cssText="display: none",null):l` ${e.map(i=>{const s=(this.connections.get(i.chain)??[]).some(n=>X.isLowerCaseMatch(n.connectorId,i.id));return l` this.onConnector(i)} tabIdx=${h(this.tabIdx)} > `})} `}onConnector(e){w.setActiveConnector(e),m.push("ConnectingExternal",{connector:e})}};Xt([c()],ct.prototype,"tabIdx",void 0);Xt([c()],ct.prototype,"connectors",void 0);Xt([d()],ct.prototype,"connections",void 0);ct=Xt([p("w3m-connect-injected-widget")],ct);var Ai=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ot=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=w.state.connectors,this.unsubscribe.push(w.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.filter(i=>i.type==="MULTI_CHAIN"&&i.name!=="WalletConnect");return e!=null&&e.length?l` ${e.map(i=>l` this.onConnector(i)} tabIdx=${h(this.tabIdx)} > `)} `:(this.style.cssText="display: none",null)}onConnector(e){w.setActiveConnector(e),m.push("ConnectingMultiChain")}};Ai([c()],Ot.prototype,"tabIdx",void 0);Ai([d()],Ot.prototype,"connectors",void 0);Ot=Ai([p("w3m-connect-multi-chain-widget")],Ot);var Qt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let dt=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=w.state.connectors,this.loading=!1,this.unsubscribe.push(w.subscribeKey("connectors",e=>this.connectors=e)),b.isTelegram()&&b.isIos()&&(this.loading=!y.state.wcUri,this.unsubscribe.push(y.subscribeKey("wcUri",e=>this.loading=!e)))}render(){const i=fe.getRecentWallets().filter(s=>!Te.isExcluded(s)).filter(s=>!this.hasWalletConnector(s)).filter(s=>this.isWalletCompatibleWithCurrentChain(s));if(!i.length)return this.style.cssText="display: none",null;const o=y.hasAnyConnection(A.CONNECTOR_ID.WALLET_CONNECT);return l` ${i.map(s=>l` this.onConnectWallet(s)} tagLabel="recent" tagVariant="info" size="sm" tabIdx=${h(this.tabIdx)} ?loading=${this.loading} ?disabled=${o} > `)} `}onConnectWallet(e){this.loading||w.selectWalletConnector(e)}hasWalletConnector(e){return this.connectors.some(i=>i.id===e.id||i.name===e.name)}isWalletCompatibleWithCurrentChain(e){const i=u.state.activeChain;return i&&e.chains?e.chains.some(o=>{const s=o.split(":")[0];return i===s}):!0}};Qt([c()],dt.prototype,"tabIdx",void 0);Qt([d()],dt.prototype,"connectors",void 0);Qt([d()],dt.prototype,"loading",void 0);dt=Qt([p("w3m-connect-recent-widget")],dt);var Zt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Xi=4;let ut=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.wallets=[],this.loading=!1,b.isTelegram()&&b.isIos()&&(this.loading=!y.state.wcUri,this.unsubscribe.push(y.subscribeKey("wcUri",e=>this.loading=!e)))}render(){var Ni,Ri,Oi,Pi,Di,ji;const{connectors:e}=w.state,{customWallets:i,featuredWalletIds:o}=x.state,s=e.find(Y=>Y.id==="walletConnect"),n=e.filter(Y=>Y.type==="INJECTED"||Y.type==="ANNOUNCED"||Y.type==="MULTI_CHAIN");if(!s&&!n.length&&!(i!=null&&i.length))return null;const r=!!((Ni=x.state.features)!=null&&Ni.email||(Ri=x.state.remoteFeatures)!=null&&Ri.email),a=Array.isArray((Oi=x.state.features)==null?void 0:Oi.socials)&&((Pi=x.state.features)==null?void 0:Pi.socials.length)>0||Array.isArray((Di=x.state.remoteFeatures)==null?void 0:Di.socials)&&((ji=x.state.remoteFeatures)==null?void 0:ji.socials.length)>0,g=n.filter(Y=>Y.name!=="Browser Wallet"),C=(o==null?void 0:o.length)||0,W=(i==null?void 0:i.length)||0,O=g.length||0,B=r?1:0,ni=a?1:0,St=C+W+O+B+ni;if(St>=Xi)return this.style.cssText="display: none",null;const Ti=Te.filterOutDuplicateWallets(this.wallets).slice(0,Xi-St);if(!Ti.length)return this.style.cssText="display: none",null;const Cn=y.hasAnyConnection(A.CONNECTOR_ID.WALLET_CONNECT);return l` ${Ti.map(Y=>l` this.onConnectWallet(Y)} size="sm" tabIdx=${h(this.tabIdx)} ?loading=${this.loading} ?disabled=${Cn} > `)} `}onConnectWallet(e){if(this.loading)return;const i=w.getConnector({id:e.id,rdns:e.rdns});i?m.push("ConnectingExternal",{connector:i}):m.push("ConnectingWalletConnect",{wallet:e})}};Zt([c()],ut.prototype,"tabIdx",void 0);Zt([c()],ut.prototype,"wallets",void 0);Zt([d()],ut.prototype,"loading",void 0);ut=Zt([p("w3m-connect-recommended-widget")],ut);var Jt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ht=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=w.state.connectors,this.connectorImages=_e.state.connectorImages,this.unsubscribe.push(w.subscribeKey("connectors",e=>this.connectors=e),_e.subscribeKey("connectorImages",e=>this.connectorImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(b.isMobile())return this.style.cssText="display: none",null;const e=this.connectors.find(s=>s.id==="walletConnect");if(!e)return this.style.cssText="display: none",null;const i=e.imageUrl||this.connectorImages[(e==null?void 0:e.imageId)??""],o=y.hasAnyConnection(A.CONNECTOR_ID.WALLET_CONNECT);return l` this.onConnector(e)} tagLabel="qr code" tagVariant="accent" tabIdx=${h(this.tabIdx)} data-testid="wallet-selector-walletconnect" size="sm" ?disabled=${o} > `}onConnector(e){w.setActiveConnector(e),m.push("ConnectingWalletConnect")}};Jt([c()],ht.prototype,"tabIdx",void 0);Jt([d()],ht.prototype,"connectors",void 0);Jt([d()],ht.prototype,"connectorImages",void 0);ht=Jt([p("w3m-connect-walletconnect-widget")],ht);const $o=v` :host { margin-top: ${({spacing:t})=>t[1]}; } wui-separator { margin: ${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1) ${({spacing:t})=>t[2]} calc(${({spacing:t})=>t[3]} * -1); width: calc(100% + ${({spacing:t})=>t[3]} * 2); } `;var vt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Be=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=w.state.connectors,this.recommended=E.state.recommended,this.featured=E.state.featured,this.unsubscribe.push(w.subscribeKey("connectors",e=>this.connectors=e),E.subscribeKey("recommended",e=>this.recommended=e),E.subscribeKey("featured",e=>this.featured=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l` ${this.connectorListTemplate()} `}connectorListTemplate(){const e=We.getConnectorsByType(this.connectors,this.recommended,this.featured),{custom:i,recent:o,announced:s,injected:n,multiChain:r,recommended:a,featured:g,external:C}=e;return We.getConnectorTypeOrder({custom:i,recent:o,announced:s,injected:n,multiChain:r,recommended:a,featured:g,external:C}).map(O=>{switch(O){case"injected":return l` ${r.length?l``:null} ${s.length?l``:null} ${n.length?l``:null} `;case"walletConnect":return l``;case"recent":return l``;case"featured":return l``;case"custom":return l``;case"external":return l``;case"recommended":return l``;default:return console.warn(`Unknown connector type: ${O}`),null}})}};Be.styles=$o;vt([c()],Be.prototype,"tabIdx",void 0);vt([d()],Be.prototype,"connectors",void 0);vt([d()],Be.prototype,"recommended",void 0);vt([d()],Be.prototype,"featured",void 0);Be=vt([p("w3m-connector-list")],Be);var fn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ui=class extends f{constructor(){super(...arguments),this.tabIdx=void 0}render(){return l` `}};fn([c()],ui.prototype,"tabIdx",void 0);ui=fn([p("w3m-wallet-login-list")],ui);const Co=v` :host { --connect-scroll--top-opacity: 0; --connect-scroll--bottom-opacity: 0; --connect-mask-image: none; } .connect { max-height: clamp(360px, 470px, 80vh); scrollbar-width: none; overflow-y: scroll; overflow-x: hidden; transition: opacity ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}; will-change: opacity; mask-image: var(--connect-mask-image); } .guide { transition: opacity ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}; will-change: opacity; } .connect::-webkit-scrollbar { display: none; } .all-wallets { flex-flow: column; } .connect.disabled, .guide.disabled { opacity: 0.3; pointer-events: none; user-select: none; } wui-separator { margin: ${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1); width: calc(100% + ${({spacing:t})=>t[3]} * 2); } `;var ae=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const So=470;let q=class extends f{constructor(){var e,i;super(),this.unsubscribe=[],this.connectors=w.state.connectors,this.authConnector=this.connectors.find(o=>o.type==="AUTH"),this.features=x.state.features,this.remoteFeatures=x.state.remoteFeatures,this.enableWallets=x.state.enableWallets,this.noAdapters=u.state.noAdapters,this.walletGuide="get-started",this.checked=It.state.isLegalCheckboxChecked,this.isEmailEnabled=((e=this.remoteFeatures)==null?void 0:e.email)&&!u.state.noAdapters,this.isSocialEnabled=((i=this.remoteFeatures)==null?void 0:i.socials)&&this.remoteFeatures.socials.length>0&&!u.state.noAdapters,this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors),this.unsubscribe.push(w.subscribeKey("connectors",o=>{this.connectors=o,this.authConnector=this.connectors.find(s=>s.type==="AUTH"),this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors)}),x.subscribeKey("features",o=>{this.features=o}),x.subscribeKey("remoteFeatures",o=>{this.remoteFeatures=o,this.setEmailAndSocialEnableCheck(this.noAdapters,this.remoteFeatures)}),x.subscribeKey("enableWallets",o=>this.enableWallets=o),u.subscribeKey("noAdapters",o=>this.setEmailAndSocialEnableCheck(o,this.remoteFeatures)),It.subscribeKey("isLegalCheckboxChecked",o=>this.checked=o))}disconnectedCallback(){var i,o;this.unsubscribe.forEach(s=>s()),(i=this.resizeObserver)==null||i.disconnect();const e=(o=this.shadowRoot)==null?void 0:o.querySelector(".connect");e==null||e.removeEventListener("scroll",this.handleConnectListScroll.bind(this))}firstUpdated(){var i,o;const e=(i=this.shadowRoot)==null?void 0:i.querySelector(".connect");e&&(requestAnimationFrame(this.handleConnectListScroll.bind(this)),e==null||e.addEventListener("scroll",this.handleConnectListScroll.bind(this)),this.resizeObserver=new ResizeObserver(()=>{this.handleConnectListScroll()}),(o=this.resizeObserver)==null||o.observe(e),this.handleConnectListScroll())}render(){var B;const{termsConditionsUrl:e,privacyPolicyUrl:i}=x.state,o=(B=x.state.features)==null?void 0:B.legalCheckbox,r=!!(e||i)&&!!o&&this.walletGuide==="get-started"&&!this.checked,a={connect:!0,disabled:r},g=x.state.enableWalletGuide,C=this.enableWallets,W=this.isSocialEnabled||this.authConnector,O=r?-1:void 0;return l` ${this.legalCheckboxTemplate()} ${this.renderConnectMethod(O)} ${this.reownBrandingTemplate()} `}reownBrandingTemplate(){var e;return bi.hasFooter()||!((e=this.remoteFeatures)!=null&&e.reownBranding)?null:l``}setEmailAndSocialEnableCheck(e,i){this.isEmailEnabled=(i==null?void 0:i.email)&&!e,this.isSocialEnabled=(i==null?void 0:i.socials)&&i.socials.length>0&&!e,this.remoteFeatures=i,this.noAdapters=e}checkIfAuthEnabled(e){const i=e.filter(s=>s.type===kn.CONNECTOR_TYPE_AUTH).map(s=>s.chain);return A.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(s=>i.includes(s))}renderConnectMethod(e){const i=Te.getConnectOrderMethod(this.features,this.connectors);return l`${i.map((o,s)=>{switch(o){case"email":return l`${this.emailTemplate(e)} ${this.separatorTemplate(s,"email")}`;case"social":return l`${this.socialListTemplate(e)} ${this.separatorTemplate(s,"social")}`;case"wallet":return l`${this.walletListTemplate(e)} ${this.separatorTemplate(s,"wallet")}`;default:return null}})}`}checkMethodEnabled(e){switch(e){case"wallet":return this.enableWallets;case"social":return this.isSocialEnabled&&this.isAuthEnabled;case"email":return this.isEmailEnabled&&this.isAuthEnabled;default:return null}}checkIsThereNextMethod(e){const o=Te.getConnectOrderMethod(this.features,this.connectors)[e+1];return o?this.checkMethodEnabled(o)?o:this.checkIsThereNextMethod(e+1):void 0}separatorTemplate(e,i){const o=this.checkIsThereNextMethod(e),s=this.walletGuide==="explore";switch(i){case"wallet":return this.enableWallets&&o&&!s?l``:null;case"email":{const n=o==="social";return this.isAuthEnabled&&this.isEmailEnabled&&!n&&o?l``:null}case"social":{const n=o==="email";return this.isAuthEnabled&&this.isSocialEnabled&&!n&&o?l``:null}default:return null}}emailTemplate(e){return!this.isEmailEnabled||!this.isAuthEnabled?null:l``}socialListTemplate(e){return!this.isSocialEnabled||!this.isAuthEnabled?null:l``}walletListTemplate(e){var a,g;const i=this.enableWallets,o=((a=this.features)==null?void 0:a.emailShowWallets)===!1,s=(g=this.features)==null?void 0:g.collapseWallets,n=o||s;return!i||(b.isTelegram()&&(b.isSafari()||b.isIos())&&y.connectWalletConnect().catch(C=>({})),this.walletGuide==="explore")?null:this.isAuthEnabled&&(this.isEmailEnabled||this.isSocialEnabled)&&n?l``:l``}legalCheckboxTemplate(){return this.walletGuide==="explore"?null:l``}handleConnectListScroll(){var o;const e=(o=this.shadowRoot)==null?void 0:o.querySelector(".connect");if(!e)return;e.scrollHeight>So?(e.style.setProperty("--connect-mask-image",`linear-gradient( to bottom, rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px, rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px, black 100px, black calc(100% - 100px), rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px), rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100% )`),e.style.setProperty("--connect-scroll--top-opacity",At.interpolate([0,50],[0,1],e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",At.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(){m.push("ConnectWallets")}};q.styles=Co;ae([d()],q.prototype,"connectors",void 0);ae([d()],q.prototype,"authConnector",void 0);ae([d()],q.prototype,"features",void 0);ae([d()],q.prototype,"remoteFeatures",void 0);ae([d()],q.prototype,"enableWallets",void 0);ae([d()],q.prototype,"noAdapters",void 0);ae([c()],q.prototype,"walletGuide",void 0);ae([d()],q.prototype,"checked",void 0);ae([d()],q.prototype,"isEmailEnabled",void 0);ae([d()],q.prototype,"isSocialEnabled",void 0);ae([d()],q.prototype,"isAuthEnabled",void 0);q=ae([p("w3m-connect-view")],q);const Ao=v` wui-flex { width: 100%; height: 52px; box-sizing: border-box; background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; border-radius: ${({borderRadius:t})=>t[5]}; padding-left: ${({spacing:t})=>t[3]}; padding-right: ${({spacing:t})=>t[3]}; display: flex; align-items: center; justify-content: space-between; gap: ${({spacing:t})=>t[6]}; } wui-text { color: ${({tokens:t})=>t.theme.textSecondary}; } wui-icon { width: 12px; height: 12px; } `;var ei=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ye=class extends f{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return l` ${this.label} ${this.buttonLabel} `}};Ye.styles=[_,T,Ao];ei([c({type:Boolean})],Ye.prototype,"disabled",void 0);ei([c()],Ye.prototype,"label",void 0);ei([c()],Ye.prototype,"buttonLabel",void 0);Ye=ei([p("wui-cta-button")],Ye);const Io=v` :host { display: block; padding: 0 ${({spacing:t})=>t[5]} ${({spacing:t})=>t[5]}; } `;var wn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Pt=class extends f{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;const{name:e,app_store:i,play_store:o,chrome_store:s,homepage:n}=this.wallet,r=b.isMobile(),a=b.isIos(),g=b.isAndroid(),C=[i,o,n,s].filter(Boolean).length>1,W=V.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return C&&!r?l` m.push("Downloads",{wallet:this.wallet})} > `:!C&&n?l` `:i&&a?l` `:o&&g?l` `:(this.style.display="none",null)}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&b.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&b.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&b.openHref(this.wallet.homepage,"_blank")}};Pt.styles=[Io];wn([c({type:Object})],Pt.prototype,"wallet",void 0);Pt=wn([p("w3m-mobile-download-links")],Pt);const Eo=v` @keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(3px); } 50% { transform: translateX(-3px); } 75% { transform: translateX(3px); } 100% { transform: translateX(0); } } wui-flex:first-child:not(:only-child) { position: relative; } wui-wallet-image { width: 56px; height: 56px; } wui-loading-thumbnail { position: absolute; } wui-icon-box { position: absolute; right: calc(${({spacing:t})=>t[1]} * -1); bottom: calc(${({spacing:t})=>t[1]} * -1); opacity: 0; transform: scale(0.5); transition-property: opacity, transform; transition-duration: ${({durations:t})=>t.lg}; transition-timing-function: ${({easings:t})=>t["ease-out-power-2"]}; will-change: opacity, transform; } wui-text[align='center'] { width: 100%; padding: 0px ${({spacing:t})=>t[4]}; } [data-error='true'] wui-icon-box { opacity: 1; transform: scale(1); } [data-error='true'] > wui-flex:first-child { animation: shake 250ms ${({easings:t})=>t["ease-out-power-2"]} both; } [data-retry='false'] wui-link { display: none; } [data-retry='true'] wui-link { display: block; opacity: 1; } w3m-mobile-download-links { padding: 0px; width: 100%; } `;var pe=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};class R extends f{constructor(){var e,i,o,s,n;super(),this.wallet=(e=m.state.data)==null?void 0:e.wallet,this.connector=(i=m.state.data)==null?void 0:i.connector,this.timeout=void 0,this.secondaryBtnIcon="refresh",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=S.getWalletImage(this.wallet)??S.getConnectorImage(this.connector),this.name=((o=this.wallet)==null?void 0:o.name)??((s=this.connector)==null?void 0:s.name)??"Wallet",this.isRetrying=!1,this.uri=y.state.wcUri,this.error=y.state.wcError,this.ready=!1,this.showRetry=!1,this.label=void 0,this.secondaryBtnLabel="Try again",this.secondaryLabel="Accept connection request in the wallet",this.isLoading=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(y.subscribeKey("wcUri",r=>{var a;this.uri=r,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,(a=this.onConnect)==null||a.call(this))}),y.subscribeKey("wcError",r=>this.error=r)),(b.isTelegram()||b.isSafari())&&b.isIos()&&y.state.wcUri&&((n=this.onConnect)==null||n.call(this))}firstUpdated(){var e;(e=this.onAutoConnect)==null||e.call(this),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),y.setWcError(!1),clearTimeout(this.timeout)}render(){var o;(o=this.onRender)==null||o.call(this),this.onShowRetry();const e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let i="";return this.label?i=this.label:(i=`Continue in ${this.name}`,this.error&&(i="Connection declined")),l` ${this.error?null:this.loaderTemplate()} ${i} ${e} ${this.secondaryBtnLabel?l` ${this.secondaryBtnLabel} `:null} ${this.isWalletConnect?l` Copy link `:null} `}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const i=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");i==null||i.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){var e,i;y.setWcError(!1),this.onRetry?(this.isRetrying=!0,(e=this.onRetry)==null||e.call(this)):(i=this.onConnect)==null||i.call(this)}loaderTemplate(){const e=ri.state.themeVariables["--w3m-border-radius-master"],i=e?parseInt(e.replace("px",""),10):4;return l``}onCopyUri(){try{this.uri&&(b.copyToClopboard(this.uri),k.showSuccess("Link copied"))}catch{k.showError("Failed to copy")}}}R.styles=Eo;pe([d()],R.prototype,"isRetrying",void 0);pe([d()],R.prototype,"uri",void 0);pe([d()],R.prototype,"error",void 0);pe([d()],R.prototype,"ready",void 0);pe([d()],R.prototype,"showRetry",void 0);pe([d()],R.prototype,"label",void 0);pe([d()],R.prototype,"secondaryBtnLabel",void 0);pe([d()],R.prototype,"secondaryLabel",void 0);pe([d()],R.prototype,"isLoading",void 0);pe([c({type:Boolean})],R.prototype,"isMobile",void 0);pe([c()],R.prototype,"onRetry",void 0);var ko=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Qi=class extends R{constructor(){var i,o,s,n;if(super(),this.externalViewUnsubscribe=[],this.connectionsByNamespace=y.getConnections((i=this.connector)==null?void 0:i.chain),this.hasMultipleConnections=this.connectionsByNamespace.length>0,this.remoteFeatures=x.state.remoteFeatures,this.currentActiveConnectorId=w.state.activeConnectorIds[(o=this.connector)==null?void 0:o.chain],!this.connector)throw new Error("w3m-connecting-view: No connector provided");const e=(s=this.connector)==null?void 0:s.chain;this.isAlreadyConnected(this.connector)&&(this.secondaryBtnLabel=void 0,this.label=`This account is already linked, change your account in ${this.connector.name}`,this.secondaryLabel=`To link a new account, open ${this.connector.name} and switch to the account you want to link`),I.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser",displayIndex:(n=this.wallet)==null?void 0:n.display_index}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1,this.externalViewUnsubscribe.push(w.subscribeKey("activeConnectorIds",r=>{var C;const a=r[e],g=(C=this.remoteFeatures)==null?void 0:C.multiWallet;a!==this.currentActiveConnectorId&&(this.hasMultipleConnections&&g?(m.replace("ProfileWallets"),k.showSuccess("New Wallet Added")):D.close())}),y.subscribeKey("connections",this.onConnectionsChange.bind(this)))}disconnectedCallback(){this.externalViewUnsubscribe.forEach(e=>e())}async onConnectProxy(){try{if(this.error=!1,this.connector){if(this.isAlreadyConnected(this.connector))return;(this.connector.id!==A.CONNECTOR_ID.COINBASE_SDK||!this.error)&&(await y.connectExternal(this.connector,this.connector.chain),I.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.connector.name||"Unknown"}}))}}catch(e){I.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(e==null?void 0:e.message)??"Unknown"}}),this.error=!0}}onConnectionsChange(e){var i,o;if((i=this.connector)!=null&&i.chain&&e.get(this.connector.chain)&&this.isAlreadyConnected(this.connector)){const s=e.get(this.connector.chain)??[],n=(o=this.remoteFeatures)==null?void 0:o.multiWallet;if(s.length===0)m.replace("Connect");else{const r=xe.getConnectionsByConnectorId(this.connectionsByNamespace,this.connector.id).flatMap(g=>g.accounts),a=xe.getConnectionsByConnectorId(s,this.connector.id).flatMap(g=>g.accounts);a.length===0?this.hasMultipleConnections&&n?(m.replace("ProfileWallets"),k.showSuccess("Wallet deleted")):D.close():!r.every(C=>a.some(W=>X.isLowerCaseMatch(C.address,W.address)))&&n&&m.replace("ProfileWallets")}}}isAlreadyConnected(e){return!!e&&this.connectionsByNamespace.some(i=>X.isLowerCaseMatch(i.connectorId,e.id))}};Qi=ko([p("w3m-connecting-external-view")],Qi);const _o=ne` wui-flex, wui-list-wallet { width: 100%; } `;var mn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Dt=class extends f{constructor(){super(),this.unsubscribe=[],this.activeConnector=w.state.activeConnector,this.unsubscribe.push(w.subscribeKey("activeConnector",e=>this.activeConnector=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e;return l` Select Chain for ${(e=this.activeConnector)==null?void 0:e.name} Select which chain to connect to your multi chain wallet ${this.networksTemplate()} `}networksTemplate(){var e,i;return(i=(e=this.activeConnector)==null?void 0:e.connectors)==null?void 0:i.map(o=>o.name?l` this.onConnector(o)} size="sm" data-testid="wui-list-chain-${o.chain}" > `:null)}onConnector(e){var o,s;const i=(s=(o=this.activeConnector)==null?void 0:o.connectors)==null?void 0:s.find(n=>n.chain===e.chain);if(!i){k.showError("Failed to find connector");return}i.id==="walletConnect"?b.isMobile()?m.push("AllWallets"):m.push("ConnectingWalletConnect"):m.push("ConnectingExternal",{connector:i})}};Dt.styles=_o;mn([d()],Dt.prototype,"activeConnector",void 0);Dt=mn([p("w3m-connecting-multi-chain-view")],Dt);var Ii=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let jt=class extends f{constructor(){super(...arguments),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.generateTabs();return l` `}generateTabs(){const e=this.platforms.map(i=>i==="browser"?{label:"Browser",icon:"extension",platform:"browser"}:i==="mobile"?{label:"Mobile",icon:"mobile",platform:"mobile"}:i==="qrcode"?{label:"Mobile",icon:"mobile",platform:"qrcode"}:i==="web"?{label:"Webapp",icon:"browser",platform:"web"}:i==="desktop"?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=e.map(({platform:i})=>i),e}onTabChange(e){var o;const i=this.platformTabs[e];i&&((o=this.onSelectPlatfrom)==null||o.call(this,i))}};Ii([c({type:Array})],jt.prototype,"platforms",void 0);Ii([c()],jt.prototype,"onSelectPlatfrom",void 0);jt=Ii([p("w3m-connecting-header")],jt);var Wo=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Zi=class extends R{constructor(){var e;if(super(),!this.wallet)throw new Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),I.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:(e=this.wallet)==null?void 0:e.display_index}})}async onConnectProxy(){var e;try{this.error=!1;const{connectors:i}=w.state,o=i.find(s=>{var n,r,a;return s.type==="ANNOUNCED"&&((n=s.info)==null?void 0:n.rdns)===((r=this.wallet)==null?void 0:r.rdns)||s.type==="INJECTED"||s.name===((a=this.wallet)==null?void 0:a.name)});if(o)await y.connectExternal(o,o.chain);else throw new Error("w3m-connecting-wc-browser: No connector found");D.close(),I.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:((e=this.wallet)==null?void 0:e.name)||"Unknown"}})}catch(i){I.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(i==null?void 0:i.message)??"Unknown"}}),this.error=!0}}};Zi=Wo([p("w3m-connecting-wc-browser")],Zi);var To=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ji=class extends R{constructor(){var e;if(super(),!this.wallet)throw new Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),I.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop",displayIndex:(e=this.wallet)==null?void 0:e.display_index}})}onRenderProxy(){var e;!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.desktop_link&&this.uri)try{this.error=!1;const{desktop_link:i,name:o}=this.wallet,{redirect:s,href:n}=b.formatNativeUrl(i,this.uri);y.setWcLinking({name:o,href:n}),y.setRecentWallet(this.wallet),b.openHref(s,"_blank")}catch{this.error=!0}}};Ji=To([p("w3m-connecting-wc-desktop")],Ji);var nt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ue=class extends R{constructor(){var e;if(super(),this.btnLabelTimeout=void 0,this.redirectDeeplink=void 0,this.redirectUniversalLink=void 0,this.target=void 0,this.preferUniversalLinks=x.state.experimental_preferUniversalLinks,this.isLoading=!0,this.onConnect=()=>{var i;if((i=this.wallet)!=null&&i.mobile_link&&this.uri)try{this.error=!1;const{mobile_link:o,link_mode:s,name:n}=this.wallet,{redirect:r,redirectUniversalLink:a,href:g}=b.formatNativeUrl(o,this.uri,s);this.redirectDeeplink=r,this.redirectUniversalLink=a,this.target=b.isIframe()?"_top":"_self",y.setWcLinking({name:n,href:g}),y.setRecentWallet(this.wallet),this.preferUniversalLinks&&this.redirectUniversalLink?b.openHref(this.redirectUniversalLink,this.target):b.openHref(this.redirectDeeplink,this.target)}catch(o){I.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:o instanceof Error?o.message:"Error parsing the deeplink",uri:this.uri,mobile_link:this.wallet.mobile_link,name:this.wallet.name}}),this.error=!0}},!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel="Open",this.secondaryLabel=P.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.onHandleURI(),this.unsubscribe.push(y.subscribeKey("wcUri",()=>{this.onHandleURI()})),I.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile",displayIndex:(e=this.wallet)==null?void 0:e.display_index}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.btnLabelTimeout)}onHandleURI(){var e;this.isLoading=!this.uri,!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onTryAgain(){var e;y.setWcError(!1),(e=this.onConnect)==null||e.call(this)}};nt([d()],Ue.prototype,"redirectDeeplink",void 0);nt([d()],Ue.prototype,"redirectUniversalLink",void 0);nt([d()],Ue.prototype,"target",void 0);nt([d()],Ue.prototype,"preferUniversalLinks",void 0);nt([d()],Ue.prototype,"isLoading",void 0);Ue=nt([p("w3m-connecting-wc-mobile")],Ue);const No=v` wui-shimmer { width: 100%; aspect-ratio: 1 / 1; border-radius: ${({borderRadius:t})=>t[4]}; } wui-qr-code { opacity: 0; animation-duration: ${({durations:t})=>t.xl}; animation-timing-function: ${({easings:t})=>t["ease-out-power-2"]}; animation-name: fade-in; animation-fill-mode: forwards; } @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } } `;var bn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Lt=class extends R{constructor(){super(),this.basic=!1,this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate)}firstUpdated(){var e,i;this.basic||I.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:((e=this.wallet)==null?void 0:e.name)??"WalletConnect",platform:"qrcode",displayIndex:(i=this.wallet)==null?void 0:i.display_index}})}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.unsubscribe)==null||e.forEach(i=>i()),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),l` ${this.qrCodeTemplate()} Scan this QR Code with your phone ${this.copyTemplate()} `}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const e=this.getBoundingClientRect().width-40,i=this.wallet?this.wallet.name:void 0;return y.setWcLinking(void 0),y.setRecentWallet(this.wallet),l` `}copyTemplate(){const e=!this.uri||!this.ready;return l` Copy link `}};Lt.styles=No;bn([c({type:Boolean})],Lt.prototype,"basic",void 0);Lt=bn([p("w3m-connecting-wc-qrcode")],Lt);var Ro=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let en=class extends f{constructor(){var e,i;if(super(),this.wallet=(e=m.state.data)==null?void 0:e.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");I.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:(i=this.wallet)==null?void 0:i.display_index}})}render(){return l` Not Detected `}};en=Ro([p("w3m-connecting-wc-unsupported")],en);var gn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let hi=class extends R{constructor(){var e;if(super(),this.isLoading=!0,!this.wallet)throw new Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel=P.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.updateLoadingState(),this.unsubscribe.push(y.subscribeKey("wcUri",()=>{this.updateLoadingState()})),I.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web",displayIndex:(e=this.wallet)==null?void 0:e.display_index}})}updateLoadingState(){this.isLoading=!this.uri}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.webapp_link&&this.uri)try{this.error=!1;const{webapp_link:i,name:o}=this.wallet,{redirect:s,href:n}=b.formatUniversalUrl(i,this.uri);y.setWcLinking({name:o,href:n}),y.setRecentWallet(this.wallet),b.openHref(s,"_blank")}catch{this.error=!0}}};gn([d()],hi.prototype,"isLoading",void 0);hi=gn([p("w3m-connecting-wc-web")],hi);var Ve=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ie=class extends f{constructor(){var e;super(),this.wallet=(e=m.state.data)==null?void 0:e.wallet,this.unsubscribe=[],this.platform=void 0,this.platforms=[],this.isSiwxEnabled=!!x.state.siwx,this.remoteFeatures=x.state.remoteFeatures,this.displayBranding=!0,this.basic=!1,this.determinePlatforms(),this.initializeConnection(),this.unsubscribe.push(x.subscribeKey("remoteFeatures",i=>this.remoteFeatures=i))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l` ${this.headerTemplate()}
${this.platformTemplate()}
${this.reownBrandingTemplate()} `}reownBrandingTemplate(){var e;return!((e=this.remoteFeatures)!=null&&e.reownBranding)||!this.displayBranding?null:l``}async initializeConnection(e=!1){var i,o;if(!(this.platform==="browser"||x.state.manualWCControl&&!e))try{const{wcPairingExpiry:s,status:n}=y.state;if(e||x.state.enableEmbedded||b.isPairingExpired(s)||n==="connecting"){const r=y.getConnections(u.state.activeChain),a=(i=this.remoteFeatures)==null?void 0:i.multiWallet,g=r.length>0;await y.connectWalletConnect({cache:"never"}),this.isSiwxEnabled||(g&&a?(m.replace("ProfileWallets"),k.showSuccess("New Wallet Added")):D.close())}}catch(s){if(s instanceof Error&&s.message.includes("An error occurred when attempting to switch chain")&&!x.state.enableNetworkSwitch&&u.state.activeChain){u.setActiveCaipNetwork(_n.getUnsupportedNetwork(`${u.state.activeChain}:${(o=u.state.activeCaipNetwork)==null?void 0:o.id}`)),u.showUnsupportedChainUI();return}I.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(s==null?void 0:s.message)??"Unknown"}}),y.setWcError(!0),k.showError(s.message??"Connection error"),y.resetWcConnection(),m.goBack()}}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;const{mobile_link:e,desktop_link:i,webapp_link:o,injected:s,rdns:n}=this.wallet,r=s==null?void 0:s.map(({injected_id:St})=>St).filter(Boolean),a=[...n?[n]:r??[]],g=x.state.isUniversalProvider?!1:a.length,C=e,W=o,O=y.checkInstalled(a),B=g&&O,ni=i&&!b.isMobile();B&&!u.state.noAdapters&&this.platforms.push("browser"),C&&this.platforms.push(b.isMobile()?"mobile":"qrcode"),W&&this.platforms.push("web"),ni&&this.platforms.push("desktop"),!B&&g&&!u.state.noAdapters&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return l``;case"web":return l``;case"desktop":return l` this.initializeConnection(!0)}> `;case"mobile":return l` this.initializeConnection(!0)}> `;case"qrcode":return l``;default:return l``}}headerTemplate(){return this.platforms.length>1?l` `:null}async onSelectPlatform(e){var o;const i=(o=this.shadowRoot)==null?void 0:o.querySelector("div");i&&(await i.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,i.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};Ve([d()],Ie.prototype,"platform",void 0);Ve([d()],Ie.prototype,"platforms",void 0);Ve([d()],Ie.prototype,"isSiwxEnabled",void 0);Ve([d()],Ie.prototype,"remoteFeatures",void 0);Ve([c({type:Boolean})],Ie.prototype,"displayBranding",void 0);Ve([c({type:Boolean})],Ie.prototype,"basic",void 0);Ie=Ve([p("w3m-connecting-wc-view")],Ie);var Ei=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Bt=class extends f{constructor(){super(),this.unsubscribe=[],this.isMobile=b.isMobile(),this.remoteFeatures=x.state.remoteFeatures,this.unsubscribe.push(x.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(this.isMobile){const{featured:e,recommended:i}=E.state,{customWallets:o}=x.state,s=fe.getRecentWallets(),n=e.length||i.length||(o==null?void 0:o.length)||s.length;return l` ${n?l``:null} `}return l` ${this.reownBrandingTemplate()} `}reownBrandingTemplate(){var e;return(e=this.remoteFeatures)!=null&&e.reownBranding?l` `:null}};Ei([d()],Bt.prototype,"isMobile",void 0);Ei([d()],Bt.prototype,"remoteFeatures",void 0);Bt=Ei([p("w3m-connecting-wc-basic-view")],Bt);const Oo=ne` .continue-button-container { width: 100%; } `;var yn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ut=class extends f{constructor(){super(...arguments),this.loading=!1}render(){return l` ${this.onboardingTemplate()} ${this.buttonsTemplate()} {b.openHref(Rn.URLS.FAQ,"_blank")}} > Learn more about names `}onboardingTemplate(){return l` Choose your account name Finally say goodbye to 0x addresses, name your account to make it easier to exchange assets `}buttonsTemplate(){return l` Choose name `}handleContinue(){m.push("RegisterAccountName"),I.sendEvent({type:"track",event:"OPEN_ENS_FLOW",properties:{isSmartAccount:ve(u.state.activeChain)===le.ACCOUNT_TYPES.SMART_ACCOUNT}})}};Ut.styles=Oo;yn([d()],Ut.prototype,"loading",void 0);Ut=yn([p("w3m-choose-account-name-view")],Ut);var Po=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let tn=class extends f{constructor(){var e;super(...arguments),this.wallet=(e=m.state.data)==null?void 0:e.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return l` ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()} ${this.homepageTemplate()} `}chromeTemplate(){var e;return(e=this.wallet)!=null&&e.chrome_store?l` Chrome Extension `:null}iosTemplate(){var e;return(e=this.wallet)!=null&&e.app_store?l` iOS App `:null}androidTemplate(){var e;return(e=this.wallet)!=null&&e.play_store?l` Android App `:null}homepageTemplate(){var e;return(e=this.wallet)!=null&&e.homepage?l` Website `:null}onChromeStore(){var e;(e=this.wallet)!=null&&e.chrome_store&&b.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&b.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&b.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&b.openHref(this.wallet.homepage,"_blank")}};tn=Po([p("w3m-downloads-view")],tn);var Do=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const jo="https://walletconnect.com/explorer";let nn=class extends f{render(){return l` ${this.recommendedWalletsTemplate()} {b.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}} > `}recommendedWalletsTemplate(){const{recommended:e,featured:i}=E.state,{customWallets:o}=x.state;return[...i,...o??[],...e].slice(0,4).map(n=>l` {b.openHref(n.homepage??jo,"_blank")}} > `)}};nn=Do([p("w3m-get-wallet-view")],nn);var xn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let pi=class extends f{constructor(){super(...arguments),this.data=[]}render(){return l` ${this.data.map(e=>l` ${e.images.map(i=>l``)} ${e.title} ${e.text} `)} `}};xn([c({type:Array})],pi.prototype,"data",void 0);pi=xn([p("w3m-help-widget")],pi);var Lo=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Bo=[{images:["login","profile","lock"],title:"One login for all of web3",text:"Log in to any app by connecting your wallet. Say goodbye to countless passwords!"},{images:["defi","nft","eth"],title:"A home for your digital assets",text:"A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."},{images:["browser","noun","dao"],title:"Your gateway to a new web",text:"With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."}];let on=class extends f{render(){return l` Get a wallet `}onGetWallet(){I.sendEvent({type:"track",event:"CLICK_GET_WALLET"}),m.push("GetWallet")}};on=Lo([p("w3m-what-is-a-wallet-view")],on);const Uo=v` wui-flex { max-height: clamp(360px, 540px, 80vh); overflow: scroll; scrollbar-width: none; transition: opacity ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}; will-change: opacity; } wui-flex::-webkit-scrollbar { display: none; } wui-flex.disabled { opacity: 0.3; pointer-events: none; user-select: none; } `;var vn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let zt=class extends f{constructor(){super(),this.unsubscribe=[],this.checked=It.state.isLegalCheckboxChecked,this.unsubscribe.push(It.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var g;const{termsConditionsUrl:e,privacyPolicyUrl:i}=x.state,o=(g=x.state.features)==null?void 0:g.legalCheckbox,n=!!(e||i)&&!!o,r=n&&!this.checked,a=r?-1:void 0;return l` `}};zt.styles=Uo;vn([d()],zt.prototype,"checked",void 0);zt=vn([p("w3m-connect-wallets-view")],zt);const zo=v` :host { display: block; width: 120px; height: 120px; } svg { width: 120px; height: 120px; fill: none; stroke: transparent; stroke-linecap: round; } use { stroke: ${t=>t.colors.accent100}; stroke-width: 2px; stroke-dasharray: 54, 118; stroke-dashoffset: 172; animation: dash 1s linear infinite; } @keyframes dash { to { stroke-dashoffset: 0px; } } `;var Mo=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let fi=class extends f{render(){return l` `}};fi.styles=[_,zo];fi=Mo([p("wui-loading-hexagon")],fi);const Fo=ne` @keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(3px); } 50% { transform: translateX(-3px); } 75% { transform: translateX(3px); } 100% { transform: translateX(0); } } wui-flex:first-child:not(:only-child) { position: relative; } wui-loading-hexagon { position: absolute; } wui-icon-box { position: absolute; right: 4px; bottom: 0; opacity: 0; transform: scale(0.5); z-index: 1; } wui-button { display: none; } [data-error='true'] wui-icon-box { opacity: 1; transform: scale(1); } [data-error='true'] > wui-flex:first-child { animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; } wui-button[data-retry='true'] { display: block; opacity: 1; } `;var ki=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let pt=class extends f{constructor(){var e;super(),this.network=(e=m.state.data)==null?void 0:e.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw new Error("w3m-network-switch-view: No network provided");this.onShowRetry();const e=this.getLabel(),i=this.getSubLabel();return l` ${this.error?null:l``} ${e} ${i} Try again `}getSubLabel(){const e=w.getConnectorId(u.state.activeChain);return w.getAuthConnector()&&e===A.CONNECTOR_ID.AUTH?"":this.error?"Switch can be declined if chain is not supported by a wallet or previous request is still active":"Accept connection request in your wallet"}getLabel(){var o;const e=w.getConnectorId(u.state.activeChain);return w.getAuthConnector()&&e===A.CONNECTOR_ID.AUTH?`Switching to ${((o=this.network)==null?void 0:o.name)??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const i=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");i==null||i.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){var e;try{this.error=!1,u.state.activeChain!==((e=this.network)==null?void 0:e.chainNamespace)&&u.setIsSwitchingNamespace(!0),this.network&&await u.switchActiveNetwork(this.network)}catch{this.error=!0}}};pt.styles=Fo;ki([d()],pt.prototype,"showRetry",void 0);ki([d()],pt.prototype,"error",void 0);pt=ki([p("w3m-network-switch-view")],pt);const Vo=v` :host { width: 100%; } button { display: flex; align-items: center; justify-content: space-between; padding: ${({spacing:t})=>t[3]}; width: 100%; background-color: transparent; border-radius: ${({borderRadius:t})=>t[4]}; } wui-text { text-transform: capitalize; } @media (hover: hover) { button:hover:enabled { background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; } } button:disabled { opacity: 0.5; cursor: not-allowed; } `;var $t=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ze=class extends f{constructor(){super(...arguments),this.imageSrc="proxy.php?url=https%3A%2F%2Fbetswirl.com%2Fethereum",this.name="Ethereum",this.disabled=!1}render(){return l` `}};ze.styles=[_,T,Vo];$t([c()],ze.prototype,"imageSrc",void 0);$t([c()],ze.prototype,"name",void 0);$t([c()],ze.prototype,"tabIdx",void 0);$t([c({type:Boolean})],ze.prototype,"disabled",void 0);ze=$t([p("wui-list-network")],ze);const Ho=ne` .container { max-height: 360px; overflow: auto; } .container::-webkit-scrollbar { display: none; } `;var Ct=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Me=class extends f{constructor(){super(),this.unsubscribe=[],this.network=u.state.activeCaipNetwork,this.requestedCaipNetworks=u.getCaipNetworks(),this.search="",this.onDebouncedSearch=b.debounce(e=>{this.search=e},100),this.unsubscribe.push(_e.subscribeNetworkImages(()=>this.requestUpdate()),u.subscribeKey("activeCaipNetwork",e=>this.network=e),u.subscribe(()=>{this.requestedCaipNetworks=u.getAllRequestedCaipNetworks()}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l` ${this.templateSearchInput()} ${this.networksTemplate()} `}templateSearchInput(){return l` `}onInputChange(e){this.onDebouncedSearch(e.detail)}networksTemplate(){var o;const e=u.getAllApprovedCaipNetworkIds(),i=b.sortRequestedNetworks(e,this.requestedCaipNetworks);return this.search?this.filteredNetworks=i==null?void 0:i.filter(s=>{var n;return(n=s==null?void 0:s.name)==null?void 0:n.toLowerCase().includes(this.search.toLowerCase())}):this.filteredNetworks=i,(o=this.filteredNetworks)==null?void 0:o.map(s=>{var n;return l` this.onSwitchNetwork(s)} .disabled=${this.getNetworkDisabled(s)} data-testid=${`w3m-network-switch-${s.name??s.id}`} > `})}getNetworkDisabled(e){const i=e.chainNamespace,o=$.getCaipAddress(i),s=u.getAllApprovedCaipNetworkIds(),n=u.getNetworkProp("supportsAllNetworks",i)!==!1,r=w.getConnectorId(i),a=w.getAuthConnector(),g=r===A.CONNECTOR_ID.AUTH&&a;return!o||n||g?!1:!(s!=null&&s.includes(e.caipNetworkId))}onSwitchNetwork(e){Wn.onSwitchNetwork({network:e})}};Me.styles=Ho;Ct([d()],Me.prototype,"network",void 0);Ct([d()],Me.prototype,"requestedCaipNetworks",void 0);Ct([d()],Me.prototype,"filteredNetworks",void 0);Ct([d()],Me.prototype,"search",void 0);Me=Ct([p("w3m-networks-view")],Me);const Ko=v` @keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(3px); } 50% { transform: translateX(-3px); } 75% { transform: translateX(3px); } 100% { transform: translateX(0); } } wui-flex:first-child:not(:only-child) { position: relative; } wui-loading-thumbnail { position: absolute; } wui-visual { border-radius: calc( ${({borderRadius:t})=>t[1]} * 9 - ${({borderRadius:t})=>t[3]} ); position: relative; overflow: hidden; } wui-visual::after { content: ''; display: block; width: 100%; height: 100%; position: absolute; inset: 0; border-radius: calc( ${({borderRadius:t})=>t[1]} * 9 - ${({borderRadius:t})=>t[3]} ); box-shadow: inset 0 0 0 1px ${({tokens:t})=>t.core.glass010}; } wui-icon-box { position: absolute; right: calc(${({spacing:t})=>t[1]} * -1); bottom: calc(${({spacing:t})=>t[1]} * -1); opacity: 0; transform: scale(0.5); transition: opacity ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}, transform ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]}; will-change: opacity, transform; } wui-text[align='center'] { width: 100%; padding: 0px ${({spacing:t})=>t[4]}; } [data-error='true'] wui-icon-box { opacity: 1; transform: scale(1); } [data-error='true'] > wui-flex:first-child { animation: shake 250ms ${({easings:t})=>t["ease-out-power-2"]} both; } [data-retry='false'] wui-link { display: none; } [data-retry='true'] wui-link { display: block; opacity: 1; } wui-link { padding: ${({spacing:t})=>t["01"]} ${({spacing:t})=>t[2]}; } .capitalize { text-transform: capitalize; } `;var $n=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const qo={eip155:"eth",solana:"solana",bip122:"bitcoin",polkadot:void 0};let Mt=class extends f{constructor(){var e,i;super(...arguments),this.unsubscribe=[],this.switchToChain=(e=m.state.data)==null?void 0:e.switchToChain,this.caipNetwork=(i=m.state.data)==null?void 0:i.network,this.activeChain=u.state.activeChain}firstUpdated(){this.unsubscribe.push(u.subscribeKey("activeChain",e=>this.activeChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.switchToChain?A.CHAIN_NAME_MAP[this.switchToChain]:"supported";if(!this.switchToChain)return null;const i=A.CHAIN_NAME_MAP[this.switchToChain];return l` Switch to ${i} Connected wallet doesn't support connecting to ${e} chain. You need to connect with a different wallet. Switch `}async switchActiveChain(){this.switchToChain&&(u.setIsSwitchingNamespace(!0),w.setFilterByNamespace(this.switchToChain),this.caipNetwork?await u.switchActiveNetwork(this.caipNetwork):u.setActiveNamespace(this.switchToChain),m.reset("Connect"))}};Mt.styles=Ko;$n([c()],Mt.prototype,"activeChain",void 0);Mt=$n([p("w3m-switch-active-chain-view")],Mt);var Go=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Yo=[{images:["network","layers","system"],title:"The system’s nuts and bolts",text:"A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."},{images:["noun","defiAlt","dao"],title:"Designed for different uses",text:"Each network is designed differently, and may therefore suit certain apps and experiences."}];let sn=class extends f{render(){return l` {b.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}} > Learn more `}};sn=Go([p("w3m-what-is-a-network-view")],sn);const Xo=ne` :host > wui-flex { max-height: clamp(360px, 540px, 80vh); overflow: scroll; scrollbar-width: none; } :host > wui-flex::-webkit-scrollbar { display: none; } `;var _i=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ft=class extends f{constructor(){var e;super(),this.swapUnsupportedChain=(e=m.state.data)==null?void 0:e.swapUnsupportedChain,this.unsubscribe=[],this.disconnecting=!1,this.remoteFeatures=x.state.remoteFeatures,this.unsubscribe.push(_e.subscribeNetworkImages(()=>this.requestUpdate()),x.subscribeKey("remoteFeatures",i=>{this.remoteFeatures=i}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l` ${this.descriptionTemplate()} ${this.networksTemplate()} Disconnect `}descriptionTemplate(){return this.swapUnsupportedChain?l` The swap feature doesn’t support your current network. Switch to an available option to continue. `:l` This app doesn’t support your current network. Switch to an available option to continue. `}networksTemplate(){const e=u.getAllRequestedCaipNetworks(),i=u.getAllApprovedCaipNetworkIds(),o=b.sortRequestedNetworks(i,e);return(this.swapUnsupportedChain?o.filter(n=>P.SWAP_SUPPORTED_NETWORKS.includes(n.caipNetworkId)):o).map(n=>l` this.onSwitchNetwork(n)} > `)}async onDisconnect(){var e;try{this.disconnecting=!0;const i=u.state.activeChain,s=y.getConnections(i).length>0,n=i&&w.state.activeConnectorIds[i],r=(e=this.remoteFeatures)==null?void 0:e.multiWallet;await y.disconnect(r?{id:n,namespace:i}:{}),s&&r&&(m.push("ProfileWallets"),k.showSuccess("Wallet deleted"))}catch{I.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),k.showError("Failed to disconnect")}finally{this.disconnecting=!1}}async onSwitchNetwork(e){const i=$.state.caipAddress,o=u.getAllApprovedCaipNetworkIds(),s=u.getNetworkProp("supportsAllNetworks",e.chainNamespace),n=m.state.data;i?o!=null&&o.includes(e.caipNetworkId)?await u.switchActiveNetwork(e):s?m.push("SwitchNetwork",{...n,network:e}):m.push("SwitchNetwork",{...n,network:e}):i||(u.setActiveCaipNetwork(e),m.push("Connect"))}};ft.styles=Xo;_i([d()],ft.prototype,"disconnecting",void 0);_i([d()],ft.prototype,"remoteFeatures",void 0);ft=_i([p("w3m-unsupported-chain-view")],ft);const Qo=v` wui-flex { width: 100%; display: flex; align-items: center; justify-content: center; gap: ${({spacing:t})=>t[2]}; border-radius: ${({borderRadius:t})=>t[4]}; padding: ${({spacing:t})=>t[3]}; } /* -- Types --------------------------------------------------------- */ wui-flex[data-type='info'] { color: ${({tokens:t})=>t.theme.textSecondary}; background-color: ${({tokens:t})=>t.theme.foregroundPrimary}; } wui-flex[data-type='success'] { color: ${({tokens:t})=>t.core.textSuccess}; background-color: ${({tokens:t})=>t.core.backgroundSuccess}; } wui-flex[data-type='error'] { color: ${({tokens:t})=>t.core.textError}; background-color: ${({tokens:t})=>t.core.backgroundError}; } wui-flex[data-type='warning'] { color: ${({tokens:t})=>t.core.textWarning}; background-color: ${({tokens:t})=>t.core.backgroundWarning}; } wui-flex[data-type='info'] wui-icon-box { background-color: ${({tokens:t})=>t.theme.foregroundSecondary}; } wui-flex[data-type='success'] wui-icon-box { background-color: ${({tokens:t})=>t.core.backgroundSuccess}; } wui-flex[data-type='error'] wui-icon-box { background-color: ${({tokens:t})=>t.core.backgroundError}; } wui-flex[data-type='warning'] wui-icon-box { background-color: ${({tokens:t})=>t.core.backgroundWarning}; } wui-text { flex: 1; } `;var ti=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Xe=class extends f{constructor(){super(...arguments),this.icon="externalLink",this.text="",this.type="info"}render(){return l` ${this.text} `}};Xe.styles=[_,T,Qo];ti([c()],Xe.prototype,"icon",void 0);ti([c()],Xe.prototype,"text",void 0);ti([c()],Xe.prototype,"type",void 0);Xe=ti([p("wui-banner")],Xe);const Zo=ne` :host > wui-flex { max-height: clamp(360px, 540px, 80vh); overflow: scroll; scrollbar-width: none; } :host > wui-flex::-webkit-scrollbar { display: none; } `;var Jo=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let wi=class extends f{constructor(){super(),this.unsubscribe=[]}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l` ${this.networkTemplate()} `}networkTemplate(){const e=u.getAllRequestedCaipNetworks(),i=u.getAllApprovedCaipNetworkIds(),o=u.state.activeCaipNetwork,s=u.checkIfSmartAccountEnabled();let n=b.sortRequestedNetworks(i,e);if(s&&ve(o==null?void 0:o.chainNamespace)===le.ACCOUNT_TYPES.SMART_ACCOUNT){if(!o)return null;n=[o]}return n.filter(a=>a.chainNamespace===(o==null?void 0:o.chainNamespace)).map(a=>l` `)}};wi.styles=Zo;wi=Jo([p("w3m-wallet-compatible-networks-view")],wi);const es=v` :host { display: flex; justify-content: center; align-items: center; width: 56px; height: 56px; box-shadow: 0 0 0 8px ${({tokens:t})=>t.theme.borderPrimary}; border-radius: ${({borderRadius:t})=>t[4]}; overflow: hidden; } :host([data-border-radius-full='true']) { border-radius: 50px; } wui-icon { width: 32px; height: 32px; } `;var ii=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Qe=class extends f{render(){return this.dataset.borderRadiusFull=this.borderRadiusFull?"true":"false",l`${this.templateVisual()}`}templateVisual(){return this.imageSrc?l``:l``}};Qe.styles=[_,es];ii([c()],Qe.prototype,"imageSrc",void 0);ii([c()],Qe.prototype,"alt",void 0);ii([c({type:Boolean})],Qe.prototype,"borderRadiusFull",void 0);Qe=ii([p("wui-visual-thumbnail")],Qe);const ts=v` :host { display: flex; justify-content: center; gap: ${({spacing:t})=>t[4]}; } wui-visual-thumbnail:nth-child(1) { z-index: 1; } `;var is=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let mi=class extends f{constructor(){var e,i;super(...arguments),this.dappImageUrl=(e=x.state.metadata)==null?void 0:e.icons,this.walletImageUrl=(i=$.state.connectedWalletInfo)==null?void 0:i.icon}firstUpdated(){var i;const e=(i=this.shadowRoot)==null?void 0:i.querySelectorAll("wui-visual-thumbnail");e!=null&&e[0]&&this.createAnimation(e[0],"translate(18px)"),e!=null&&e[1]&&this.createAnimation(e[1],"translate(-18px)")}render(){var e;return l` `}createAnimation(e,i){e.animate([{transform:"translateX(0px)"},{transform:i}],{duration:1600,easing:"cubic-bezier(0.56, 0, 0.48, 1)",direction:"alternate",iterations:1/0})}};mi.styles=ts;mi=is([p("w3m-siwx-sign-message-thumbnails")],mi);var Wi=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ft=class extends f{constructor(){var e;super(...arguments),this.dappName=(e=x.state.metadata)==null?void 0:e.name,this.isCancelling=!1,this.isSigning=!1}render(){return l` ${this.dappName??"Dapp"} needs to connect to your wallet Sign this message to prove you own this wallet and proceed. Canceling will disconnect you. ${this.isCancelling?"Cancelling...":"Cancel"} ${this.isSigning?"Signing...":"Sign"} `}async onSign(){this.isSigning=!0;try{await Li.requestSignMessage()}catch(e){if(e instanceof Error&&e.message.includes("OTP is required")){k.showError({message:"Something went wrong. We need to verify your account again."}),m.replace("DataCapture");return}throw e}finally{this.isSigning=!1}}async onCancel(){this.isCancelling=!0,await Li.cancelSignMessage().finally(()=>this.isCancelling=!1)}};Wi([d()],Ft.prototype,"isCancelling",void 0);Wi([d()],Ft.prototype,"isSigning",void 0);Ft=Wi([p("w3m-siwx-sign-message-view")],Ft);export{Ui as AppKitAccountButton,Mi as AppKitButton,Vi as AppKitConnectButton,Ki as AppKitNetworkButton,Bi as W3mAccountButton,ce as W3mAccountSettingsView,di as W3mAccountView,Wt as W3mAllWalletsView,zi as W3mButton,Ut as W3mChooseAccountNameView,Fi as W3mConnectButton,q as W3mConnectView,zt as W3mConnectWalletsView,Qi as W3mConnectingExternalView,Dt as W3mConnectingMultiChainView,Bt as W3mConnectingWcBasicView,Ie as W3mConnectingWcView,tn as W3mDownloadsView,wa as W3mFooter,nn as W3mGetWalletView,Hi as W3mNetworkButton,pt as W3mNetworkSwitchView,Me as W3mNetworksView,U as W3mProfileWalletsView,ma as W3mRouter,Ft as W3mSIWXSignMessageView,Mt as W3mSwitchActiveChainView,ft as W3mUnsupportedChainView,wi as W3mWalletCompatibleNetworksView,sn as W3mWhatIsANetworkView,on as W3mWhatIsAWalletView};