"use strict";(self.webpackChunkfrog=self.webpackChunkfrog||[]).push([[2211],{59133:(t,e,i)=>{i.d(e,{g:()=>r});var o=i(87792),n=i(54277);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),l=n.A.filterOutDuplicateWallets(e),c=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:c,announced:u,injected:d,recommended:a,featured:l}},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}}},39287:(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}}},54277:(t,e,i)=>{i.d(e,{A:()=>s});var o=i(87792),n=i(59133),r=i(39287);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:l}=n.g.getConnectorsByType(s),c=a.filter(n.g.showConnector),u=l.filter(n.g.showConnector);return c.length||u.length?["wallet","email","social"]:r.o.DEFAULT_CONNECT_METHOD_ORDER}}},23522:(t,e,i)=>{i.d(e,{o:()=>c});var o=i(12618),n=i(25707),r=i(60031),s=i(87792);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 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};class c 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")}}}c.styles=a,l([(0,n.wk)()],c.prototype,"isRetrying",void 0),l([(0,n.wk)()],c.prototype,"uri",void 0),l([(0,n.wk)()],c.prototype,"error",void 0),l([(0,n.wk)()],c.prototype,"ready",void 0),l([(0,n.wk)()],c.prototype,"showRetry",void 0),l([(0,n.wk)()],c.prototype,"secondaryBtnLabel",void 0),l([(0,n.wk)()],c.prototype,"secondaryLabel",void 0),l([(0,n.wk)()],c.prototype,"buffering",void 0),l([(0,n.MZ)({type:Boolean})],c.prototype,"isMobile",void 0),l([(0,n.MZ)()],c.prototype,"onRetry",void 0)},35310:(t,e,i)=>{i.d(e,{H:()=>u});var o=i(12618),n=i(25707),r=i(87792),s=i(98414),a=i(72088);const l=o.AH`
wui-loading-spinner {
margin: 9px auto;
}
.email-display,
.email-display wui-text {
max-width: 100%;
}
`;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};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=l,c([(0,n.wk)()],u.prototype,"loading",void 0),c([(0,n.wk)()],u.prototype,"timeoutTimeLeft",void 0),c([(0,n.wk)()],u.prototype,"error",void 0),u=c([(0,s.customElement)("w3m-email-otp-widget")],u)}}]);