"use strict";(self.webpackChunkfrog=self.webpackChunkfrog||[]).push([[3347],{18149:(t,e,i)=>{i.d(e,{o:()=>l});var o=i(12618),n=i(25707),r=i(60031),s=i(12525);const a=o.AH`
@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-icon-box {
position: absolute;
right: calc(var(--wui-spacing-3xs) * -1);
bottom: calc(var(--wui-spacing-3xs) * -1);
opacity: 0;
transform: scale(0.5);
transition-property: opacity, transform;
transition-duration: var(--wui-duration-lg);
transition-timing-function: var(--wui-ease-out-power-2);
will-change: opacity, transform;
}
wui-text[align='center'] {
width: 100%;
padding: 0px var(--wui-spacing-l);
}
[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;
}
[data-retry='false'] wui-link {
display: none;
}
[data-retry='true'] wui-link {
display: block;
opacity: 1;
}
`;var c=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class l extends o.WF{constructor(){super(),this.wallet=s.IN.state.data?.wallet,this.connector=s.IN.state.data?.connector,this.timeout=void 0,this.secondaryBtnIcon="refresh",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=s.$m.getWalletImage(this.wallet)??s.$m.getConnectorImage(this.connector),this.name=this.wallet?.name??this.connector?.name??"Wallet",this.isRetrying=!1,this.uri=s.x4.state.wcUri,this.error=s.x4.state.wcError,this.ready=!1,this.showRetry=!1,this.secondaryBtnLabel="Try again",this.secondaryLabel="Accept connection request in the wallet",this.buffering=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(s.x4.subscribeKey("wcUri",(t=>{this.uri=t,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,this.onConnect?.())})),s.x4.subscribeKey("wcError",(t=>this.error=t)),s.x4.subscribeKey("buffering",(t=>this.buffering=t))),(s.wE.isTelegram()||s.wE.isSafari())&&s.wE.isIos()&&s.x4.state.wcUri&&this.onConnect?.()}firstUpdated(){this.onAutoConnect?.(),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach((t=>t())),clearTimeout(this.timeout)}render(){this.onRender?.(),this.onShowRetry();const t=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let e=`Continue in ${this.name}`;return this.buffering&&(e="Connecting..."),this.error&&(e="Connection declined"),o.qy`
${this.error?null:this.loaderTemplate()}
${e}
${t}
${this.secondaryBtnLabel?o.qy`
${this.secondaryBtnLabel}
`:null}
${this.isWalletConnect?o.qy`
Copy link
`:null}
`}onShowRetry(){if(this.error&&!this.showRetry){this.showRetry=!0;const t=this.shadowRoot?.querySelector("wui-button");t?.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){this.buffering||(s.x4.setWcError(!1),this.onRetry?(this.isRetrying=!0,this.onRetry?.()):this.onConnect?.())}loaderTemplate(){const t=s.Wn.state.themeVariables["--w3m-border-radius-master"],e=t?parseInt(t.replace("px",""),10):4;return o.qy``}onCopyUri(){try{this.uri&&(s.wE.copyToClopboard(this.uri),s.Pt.showSuccess("Link copied"))}catch{s.Pt.showError("Failed to copy")}}}l.styles=a,c([(0,n.wk)()],l.prototype,"isRetrying",void 0),c([(0,n.wk)()],l.prototype,"uri",void 0),c([(0,n.wk)()],l.prototype,"error",void 0),c([(0,n.wk)()],l.prototype,"ready",void 0),c([(0,n.wk)()],l.prototype,"showRetry",void 0),c([(0,n.wk)()],l.prototype,"secondaryBtnLabel",void 0),c([(0,n.wk)()],l.prototype,"secondaryLabel",void 0),c([(0,n.wk)()],l.prototype,"buffering",void 0),c([(0,n.MZ)({type:Boolean})],l.prototype,"isMobile",void 0),c([(0,n.MZ)()],l.prototype,"onRetry",void 0)},40656:(t,e,i)=>{var o=i(12618),n=i(25707),r=i(60031),s=i(6229),a=i(12525),c=i(66955),l=i(41457),u=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let d=class extends o.WF{constructor(){super(),this.usubscribe=[],this.networkImages=a.jQ.state.networkImages,this.address=a.Uj.state.address,this.profileImage=a.Uj.state.profileImage,this.profileName=a.Uj.state.profileName,this.network=a.WB.state.activeCaipNetwork,this.preferredAccountType=a.Uj.state.preferredAccountType,this.disconnecting=!1,this.loading=!1,this.switched=!1,this.text="",this.usubscribe.push(a.Uj.subscribe((t=>{t.address?(this.address=t.address,this.profileImage=t.profileImage,this.profileName=t.profileName,this.preferredAccountType=t.preferredAccountType):a.W3.close()})),a.Uj.subscribeKey("preferredAccountType",(t=>this.preferredAccountType=t)),a.WB.subscribeKey("activeCaipNetwork",(t=>{t?.id&&(this.network=t)})))}disconnectedCallback(){this.usubscribe.forEach((t=>t()))}render(){if(!this.address)throw new Error("w3m-account-settings-view: No account provided");const t=this.networkImages[this.network?.assets?.imageId??""];return o.qy`
${c.UiHelperUtil.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})}
${this.authCardTemplate()}
${this.network?.name??"Unknown"}
${this.togglePreferredAccountBtnTemplate()} ${this.chooseNameButtonTemplate()}
Disconnect
`}chooseNameButtonTemplate(){const t=this.network?.chainNamespace,e=a.iT.getConnectedConnectorId(t),i=a.aK.getAuthConnector();return a.WB.checkIfNamesSupported()&&i&&e===s.oU.CONNECTOR_ID.AUTH&&!this.profileName?o.qy`
Choose account name
`:null}authCardTemplate(){const t=this.network?.chainNamespace,e=a.iT.getConnectedConnectorId(t),i=a.aK.getAuthConnector(),{origin:n}=location;return!i||e!==s.oU.CONNECTOR_ID.AUTH||n.includes(a.oU.SECURE_SITE)?null:o.qy`
`}isAllowedNetworkSwitch(){const t=a.WB.getAllRequestedCaipNetworks(),e=!!t&&t.length>1,i=t?.find((({id:t})=>t===this.network?.id));return e||!i}onCopyAddress(){try{this.address&&(a.wE.copyToClopboard(this.address),a.Pt.showSuccess("Address copied"))}catch{a.Pt.showError("Failed to copy")}}togglePreferredAccountBtnTemplate(){const t=this.network?.chainNamespace,e=a.WB.checkIfSmartAccountEnabled(),i=a.iT.getConnectedConnectorId(t);return a.aK.getAuthConnector()&&i===s.oU.CONNECTOR_ID.AUTH&&e?(this.switched||(this.text=this.preferredAccountType===l.Vl.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account"),o.qy`
${this.text}
`):null}onChooseName(){a.IN.push("ChooseAccountName")}async changePreferredAccountType(){const t=a.WB.checkIfSmartAccountEnabled(),e=this.preferredAccountType!==l.Vl.ACCOUNT_TYPES.SMART_ACCOUNT&&t?l.Vl.ACCOUNT_TYPES.SMART_ACCOUNT:l.Vl.ACCOUNT_TYPES.EOA;a.aK.getAuthConnector()&&(this.loading=!0,await a.x4.setPreferredAccountType(e),this.text=e===l.Vl.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account",this.switched=!0,a.Rv.resetSend(),this.loading=!1,this.requestUpdate())}onNetworks(){this.isAllowedNetworkSwitch()&&a.IN.push("Networks")}async onDisconnect(){try{this.disconnecting=!0,await a.x4.disconnect(),a.En.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),a.W3.close()}catch{a.En.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),a.Pt.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onGoToUpgradeView(){a.En.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),a.IN.push("UpgradeEmailWallet")}};u([(0,n.wk)()],d.prototype,"address",void 0),u([(0,n.wk)()],d.prototype,"profileImage",void 0),u([(0,n.wk)()],d.prototype,"profileName",void 0),u([(0,n.wk)()],d.prototype,"network",void 0),u([(0,n.wk)()],d.prototype,"preferredAccountType",void 0),u([(0,n.wk)()],d.prototype,"disconnecting",void 0),u([(0,n.wk)()],d.prototype,"loading",void 0),u([(0,n.wk)()],d.prototype,"switched",void 0),u([(0,n.wk)()],d.prototype,"text",void 0),d=u([(0,c.customElement)("w3m-account-settings-view")],d)},41482:(t,e,i)=>{i.d(e,{o:()=>o});const o={ACCOUNT_TABS:[{label:"Tokens"},{label:"NFTs"},{label:"Activity"}],SECURE_SITE_ORIGIN:process.env.NEXT_PUBLIC_SECURE_SITE_ORIGIN||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},DEFAULT_CONNECT_METHOD_ORDER:["email","social","wallet"],ANIMATION_DURATIONS:{HeaderText:120,ModalHeight:150,ViewTransition:150}}},56092:(t,e,i)=>{i.d(e,{g:()=>r});var o=i(12525),n=i(65042);const r={getConnectorsByType(t){const{featured:e,recommended:i}=o.Np.state,{customWallets:r}=o.Hd.state,s=o.iT.getRecentWallets(),a=n.A.filterOutDuplicateWallets(i),c=n.A.filterOutDuplicateWallets(e),l=t.filter((t=>"MULTI_CHAIN"===t.type)),u=t.filter((t=>"ANNOUNCED"===t.type)),d=t.filter((t=>"INJECTED"===t.type));return{custom:r,recent:s,external:t.filter((t=>"EXTERNAL"===t.type)),multiChain:l,announced:u,injected:d,recommended:a,featured:c}},showConnector(t){if("INJECTED"===t.type){if(!o.wE.isMobile()&&"Browser Wallet"===t.name)return!1;const e=t.info?.rdns;if(!e&&!o.x4.checkInstalled())return!1;if(e&&o.Np.state.excludedRDNS&&o.Np.state.excludedRDNS.includes(e))return!1}if("ANNOUNCED"===t.type){const e=t.info?.rdns;if(e&&o.Np.state.excludedRDNS.includes(e))return!1}return!0}}},61123:(t,e,i)=>{i.d(e,{H:()=>u});var o=i(12618),n=i(25707),r=i(12525),s=i(66955),a=i(41457);const c=o.AH`
wui-loading-spinner {
margin: 9px auto;
}
.email-display,
.email-display wui-text {
max-width: 100%;
}
`;var l=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let u=class extends o.WF{firstUpdated(){this.startOTPTimeout()}disconnectedCallback(){clearTimeout(this.OTPTimeout)}constructor(){super(),this.loading=!1,this.timeoutTimeLeft=a.QH.getTimeToNextEmailLogin(),this.error="",this.otp="",this.email=r.IN.state.data?.email,this.authConnector=r.aK.getAuthConnector()}render(){if(!this.email)throw new Error("w3m-email-otp-widget: No email provided");const t=Boolean(this.timeoutTimeLeft),e=this.getFooterLabels(t);return o.qy`
Enter the code we sent to
${this.email}
The code expires in 20 minutes
${this.loading?o.qy``:o.qy`
${this.error?o.qy`
${this.error}. Try Again
`:null}
`}
${e.title}
${e.action}
`}startOTPTimeout(){this.timeoutTimeLeft=a.QH.getTimeToNextEmailLogin(),this.OTPTimeout=setInterval((()=>{this.timeoutTimeLeft>0?this.timeoutTimeLeft=a.QH.getTimeToNextEmailLogin():clearInterval(this.OTPTimeout)}),1e3)}async onOtpInputChange(t){try{this.loading||(this.otp=t.detail,this.authConnector&&6===this.otp.length&&(this.loading=!0,await(this.onOtpSubmit?.(this.otp))))}catch(t){this.error=r.wE.parseError(t),this.loading=!1}}async onResendCode(){try{if(this.onOtpResend){if(!this.loading&&!this.timeoutTimeLeft){this.error="",this.otp="";if(!r.aK.getAuthConnector()||!this.email)throw new Error("w3m-email-otp-widget: Unable to resend email");this.loading=!0,await this.onOtpResend(this.email),this.startOTPTimeout(),r.Pt.showSuccess("Code email resent")}}else this.onStartOver&&this.onStartOver()}catch(t){r.Pt.showError(t)}finally{this.loading=!1}}getFooterLabels(t){return this.onStartOver?{title:"Something wrong?",action:"Try again "+(t?`in ${this.timeoutTimeLeft}s`:"")}:{title:"Didn't receive it?",action:"Resend "+(t?`in ${this.timeoutTimeLeft}s`:"Code")}}};u.styles=c,l([(0,n.wk)()],u.prototype,"loading",void 0),l([(0,n.wk)()],u.prototype,"timeoutTimeLeft",void 0),l([(0,n.wk)()],u.prototype,"error",void 0),u=l([(0,s.customElement)("w3m-email-otp-widget")],u)},65042:(t,e,i)=>{i.d(e,{A:()=>s});var o=i(12525),n=i(56092),r=i(41482);const s={filterOutDuplicatesByRDNS(t){const e=o.Hd.state.enableEIP6963?o.aK.state.connectors:[],i=o.iT.getRecentWallets(),n=e.map((t=>t.info?.rdns)).filter(Boolean),r=i.map((t=>t.rdns)).filter(Boolean),s=n.concat(r);if(s.includes("io.metamask.mobile")&&o.wE.isMobile()){const t=s.indexOf("io.metamask.mobile");s[t]="io.metamask"}return t.filter((t=>!s.includes(String(t?.rdns))))},filterOutDuplicatesByIds(t){const e=o.aK.state.connectors.filter((t=>"ANNOUNCED"===t.type||"INJECTED"===t.type)),i=o.iT.getRecentWallets(),n=e.map((t=>t.explorerId)),r=i.map((t=>t.id)),s=n.concat(r);return t.filter((t=>!s.includes(t?.id)))},filterOutDuplicateWallets(t){const e=this.filterOutDuplicatesByRDNS(t);return this.filterOutDuplicatesByIds(e)},markWalletsAsInstalled(t){const{connectors:e}=o.aK.state,i=e.filter((t=>"ANNOUNCED"===t.type)).reduce(((t,e)=>e.info?.rdns?(t[e.info.rdns]=!0,t):t),{});return t.map((t=>({...t,installed:Boolean(t.rdns)&&Boolean(i[t.rdns??""])}))).sort(((t,e)=>Number(e.installed)-Number(t.installed)))},getConnectOrderMethod(t,e){const i=t?.connectMethodsOrder||o.Hd.state.features?.connectMethodsOrder,s=e||o.aK.state.connectors;if(i)return i;const{injected:a,announced:c}=n.g.getConnectorsByType(s),l=a.filter(n.g.showConnector),u=c.filter(n.g.showConnector);return l.length||u.length?["wallet","email","social"]:r.o.DEFAULT_CONNECT_METHOD_ORDER}}},95430:(t,e,i)=>{var o=i(12618),n=i(25707),r=i(6229),s=i(12525),a=i(66955),c=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let l=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.namespace=s.WB.state.activeChain,this.unsubscribe.push(s.WB.subscribeKey("activeChain",(t=>{this.namespace=t})))}render(){if(!this.namespace)return null;const t=s.iT.getConnectedConnectorId(this.namespace),e=s.aK.getAuthConnector();return o.qy`
${e&&t===r.oU.CONNECTOR_ID.AUTH?this.walletFeaturesTemplate():this.defaultTemplate()}
`}walletFeaturesTemplate(){return o.qy``}defaultTemplate(){return o.qy``}};c([(0,n.wk)()],l.prototype,"namespace",void 0),l=c([(0,a.customElement)("w3m-account-view")],l)}}]);