1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9984],{99984:(e,t,i)=>{i.r(t),i.d(t,{W3mConnectSocialsView:()=>y,W3mConnectingFarcasterView:()=>F,W3mConnectingSocialView:()=>T});var o=i(22707),r=i(71877),a=i(43957),s=i(20482),n=i(16285),c=i(21438);i(21995),i(52121),i(33719);var l=i(15176),d=i(6792),u=i(40818),h=i(41421),p=i(80563),w=i(85934);i(36838);var g=i(75282);let m=(0,o.AH)` 2 :host { 3 margin-top: var(--wui-spacing-3xs); 4 } 5 wui-separator { 6 margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs) 7 calc(var(--wui-spacing-m) * -1); 8 width: calc(100% + var(--wui-spacing-s) * 2); 9 } 10`;var v=function(e,t,i,o){var r,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};let f=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=l.a.state.connectors,this.authConnector=this.connectors.find(e=>"AUTH"===e.type),this.remoteFeatures=n.H.state.remoteFeatures,this.isPwaLoading=!1,this.unsubscribe.push(l.a.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(e=>"AUTH"===e.type)}),n.H.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}connectedCallback(){super.connectedCallback(),this.handlePwaFrameLoad()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.remoteFeatures?.socials||[],t=!!this.authConnector,i=e?.length,r="ConnectSocials"===d.I.state.view;return t&&i||r?(r&&!i&&(e=u.oU.DEFAULT_SOCIALS),(0,o.qy)` <wui-flex flexDirection="column" gap="xs"> 11 ${e.map(e=>(0,o.qy)`<wui-list-social 12 @click=${()=>{this.onSocialClick(e)}} 13 data-testid=${`social-selector-${e}`} 14 name=${e} 15 logo=${e} 16 ?disabled=${this.isPwaLoading} 17 ></wui-list-social>`)} 18 </wui-flex>`):null}async onSocialClick(e){e&&await (0,p.Up)(e)}async handlePwaFrameLoad(){if(w.w.isPWA()){this.isPwaLoading=!0;try{this.authConnector?.provider instanceof g.Y&&await this.authConnector.provider.init()}catch(e){h.h.open({displayMessage:"Error loading embedded wallet in PWA",debugMessage:e.message},"error")}finally{this.isPwaLoading=!1}}}};f.styles=m,v([(0,r.MZ)()],f.prototype,"tabIdx",void 0),v([(0,r.wk)()],f.prototype,"connectors",void 0),v([(0,r.wk)()],f.prototype,"authConnector",void 0),v([(0,r.wk)()],f.prototype,"remoteFeatures",void 0),v([(0,r.wk)()],f.prototype,"isPwaLoading",void 0),f=v([(0,c.EM)("w3m-social-login-list")],f);let b=(0,o.AH)` 19 wui-flex { 20 max-height: clamp(360px, 540px, 80vh); 21 overflow: scroll; 22 scrollbar-width: none; 23 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 24 will-change: opacity; 25 } 26 wui-flex::-webkit-scrollbar {
27 display: none; 28 } 29 wui-flex.disabled { 30 opacity: 0.3; 31 pointer-events: none; 32 user-select: none; 33 } 34`;var x=function(e,t,i,o){var r,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};let y=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.checked=s.o.state.isLegalCheckboxChecked,this.unsubscribe.push(s.o.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.H.state,i=n.H.state.features?.legalCheckbox,r=!!(e||t)&&!!i,s=r&&!this.checked;return(0,o.qy)` 35 <w3m-legal-checkbox></w3m-legal-checkbox> 36 <wui-flex 37 flexDirection="column" 38 .padding=${r?["0","s","s","s"]:"s"} 39 gap="xs" 40 class=${(0,a.J)(s?"disabled":void 0)} 41 > 42 <w3m-social-login-list tabIdx=${(0,a.J)(s?-1:void 0)}></w3m-social-login-list> 43 </wui-flex> 44 <w3m-legal-footer></w3m-legal-footer> 45 `}};y.styles=b,x([(0,r.wk)()],y.prototype,"checked",void 0),y=x([(0,c.EM)("w3m-connect-socials-view")],y);var C=i(35728),k=i(2767),P=i(12890),E=i(77424),I=i(86486),S=i(72317),W=i(88950),$=i(9886);i(39001),i(48088),i(93099),i(97039);var L=i(90258),U=i(85148);let O=(0,o.AH)` 46 wui-logo { 47 width: 80px; 48 height: 80px; 49 border-radius: var(--wui-border-radius-m); 50 } 51 @keyframes shake { 52 0% { 53 transform: translateX(0); 54 } 55 25% { 56 transform: translateX(3px); 57 } 58 50% { 59 transform: translateX(-3px); 60 } 61 75% { 62 transform: translateX(3px); 63 } 64 100% { 65 transform: translateX(0); 66 } 67 } 68 wui-flex:first-child:not(:only-child) { 69 position: relative; 70 } 71 wui-loading-thumbnail { 72 position: absolute; 73 } 74 wui-icon-box { 75 position: absolute; 76 right: calc(var(--wui-spacing-3xs) * -1); 77 bottom: calc(var(--wui-spacing-3xs) * -1); 78 opacity: 0; 79 transform: scale(0.5); 80 transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg); 81 } 82 wui-text[align='center'] { 83 width: 100%; 84 padding: 0px var(--wui-spacing-l); 85 } 86 [data-error='true'] wui-icon-box { 87 opacity: 1; 88 transform: scale(1); 89 } 90 [data-error='true'] > wui-flex:first-child { 91 animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; 92 } 93 .capitalize { 94 text-transform: capitalize; 95 } 96`;var R=function(e,t,i,o){var r,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};let T=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.socialProvider=C.U.state.socialProvider,this.socialWindow=C.U.state.socialWindow,this.error=!1,this.connecting=!1,this.message="Connect in the provider window",this.remoteFeatures=n.H.state.remoteFeatures,this.address=C.U.state.address,this.connectionsByNamespace=k.x.getConnections(P.W.state.activeChain),this.hasMultipleConnections=this.connectionsByNamespace.length>0,this.authConnector=l.a.getAuthConnector(),this.handleSocialConnection=async e=>{if(e.data?.resultUri)if(e.origin===U.o.SECURE_SITE_ORIGIN){window.removeEventListener("message",this.handleSocialConnection,!1);try{if(this.authConnector&&!this.connecting){this.socialWindow&&(this.socialWindow.close(),C.U.setSocialWindow(void 0,P.W.state.activeChain)),this.connecting=!0,this.updateMessage();let t=e.data.resultUri;this.socialProvider&&E.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_REQUEST_USER_DATA",properties:{provider:this.socialProvider}}),await k.x.connectExternal({id:this.authConnector.id,type:this.authConnector.type,socialUri:t},this.authConnector.chain),this.socialProvider&&(I.i.setConnectedSocialProvider(this.socialProvider),E.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:this.socialProvider,caipNetworkId:P.W.getActiveCaipNetwork()?.caipNetworkId}}))}}catch(e){this.error=!0,this.updateMessage(),this.socialProvider&&E.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})}}else d.I.goBack(),S.P.showError("Untrusted Origin"),this.socialProvider&&E.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})},L.R.EmbeddedWalletAbortController.signal.addEventListener("abort",()=>{this.socialWindow&&(this.socialWindow.close(),C.U.setSocialWindow(void 0,P.W.state.activeChain))}),this.unsubscribe.push(C.U.subscribe(e=>{e.socialProvider&&(this.socialProvider=e.socialProvider),e.socialWindow&&(this.socialWindow=e.socialWindow)}),n.H.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}),C.U.subscribeKey("address",e=>{let t=this.remoteFeatures?.multiWallet;e&&e!==this.address&&(this.hasMultipleConnections&&t?(d.I.replace("ProfileWallets"),S.P.showSuccess("New Wallet Added")):(W.W.state.open||n.H.state.enableEmbedded)&&W.W.close())})),this.authConnector&&this.connectSocial()}
96disconnectedCallback(){this.unsubscribe.forEach(e=>e()),window.removeEventListener("message",this.handleSocialConnection,!1),this.socialWindow?.close(),C.U.setSocialWindow(void 0,P.W.state.activeChain)}render(){return(0,o.qy)` 97 <wui-flex 98 data-error=${(0,a.J)(this.error)} 99 flexDirection="column" 100 alignItems="center" 101 .padding=${["3xl","xl","xl","xl"]} 102 gap="xl" 103 > 104 <wui-flex justifyContent="center" alignItems="center"> 105 <wui-logo logo=${(0,a.J)(this.socialProvider)}></wui-logo> 106 ${this.error?null:this.loaderTemplate()} 107 <wui-icon-box 108 backgroundColor="error-100" 109 background="opaque" 110 iconColor="error-100" 111 icon="close" 112 size="sm" 113 border 114 borderColor="wui-color-bg-125" 115 ></wui-icon-box> 116 </wui-flex> 117 <wui-flex flexDirection="column" alignItems="center" gap="xs"> 118 <wui-text align="center" variant="paragraph-500" color="fg-100" 119 >Log in with 120 <span class="capitalize">${this.socialProvider??"Social"}</span></wui-text 121 > 122 <wui-text align="center" variant="small-400" color=${this.error?"error-100":"fg-200"} 123 >${this.message}</wui-text 124 ></wui-flex 125 > 126 </wui-flex> 127 `}loaderTemplate(){let e=$.W.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return(0,o.qy)`<wui-loading-thumbnail radius=${9*t}></wui-loading-thumbnail>`}connectSocial(){let e=setInterval(()=>{this.socialWindow?.closed&&(this.connecting||"ConnectingSocial"!==d.I.state.view||(this.socialProvider&&E.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_CANCELED",properties:{provider:this.socialProvider}}),d.I.goBack()),clearInterval(e))},1e3);window.addEventListener("message",this.handleSocialConnection,!1)}updateMessage(){this.error?this.message="Something went wrong":this.connecting?this.message="Retrieving user data":this.message="Connect in the provider window"}};T.styles=O,R([(0,r.wk)()],T.prototype,"socialProvider",void 0),R([(0,r.wk)()],T.prototype,"socialWindow",void 0),R([(0,r.wk)()],T.prototype,"error",void 0),R([(0,r.wk)()],T.prototype,"connecting",void 0),R([(0,r.wk)()],T.prototype,"message",void 0),R([(0,r.wk)()],T.prototype,"remoteFeatures",void 0),T=R([(0,c.EM)("w3m-connecting-social-view")],T),i(2080),i(44949),i(99548),i(1664),i(56375);let q=(0,o.AH)` 128 @keyframes fadein { 129 from { 130 opacity: 0; 131 } 132 to { 133 opacity: 1; 134 } 135 } 136 137 wui-shimmer { 138 width: 100%; 139 aspect-ratio: 1 / 1; 140 border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important; 141 } 142 143 wui-qr-code { 144 opacity: 0; 145 animation-duration: 200ms; 146 animation-timing-function: ease; 147 animation-name: fadein; 148 animation-fill-mode: forwards; 149 } 150 151 wui-logo { 152 width: 80px; 153 height: 80px; 154 border-radius: var(--wui-border-radius-m); 155 } 156 157 wui-flex:first-child:not(:only-child) { 158 position: relative; 159 } 160 wui-loading-thumbnail { 161 position: absolute; 162 } 163 wui-icon-box { 164 position: absolute; 165 right: calc(var(--wui-spacing-3xs) * -1); 166 bottom: calc(var(--wui-spacing-3xs) * -1); 167 opacity: 0; 168 transform: scale(0.5); 169 transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg); 170 } 171`;var A=function(e,t,i,o){var r,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};let F=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.socialProvider=C.U.state.socialProvider,this.uri=C.U.state.farcasterUrl,this.ready=!1,this.loading=!1,this.remoteFeatures=n.H.state.remoteFeatures,this.authConnector=l.a.getAuthConnector(),this.forceUpdate=()=>{this.requestUpdate()},this.unsubscribe.push(C.U.subscribeKey("farcasterUrl",e=>{e&&(this.uri=e,this.connectFarcaster())}),C.U.subscribeKey("socialProvider",e=>{e&&(this.socialProvider=e)}),n.H.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e})),window.addEventListener("resize",this.forceUpdate)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.timeout),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),(0,o.qy)`${this.platformTemplate()}`}platformTemplate(){return w.w.isMobile()?(0,o.qy)`${this.mobileTemplate()}`:(0,o.qy)`${this.desktopTemplate()}`}desktopTemplate(){return this.loading?(0,o.qy)`${this.loadingTemplate()}`:(0,o.qy)`${this.qrTemplate()}`}qrTemplate(){return(0,o.qy)` <wui-flex 172 flexDirection="column" 173 alignItems="center" 174 .padding=${["0","xl","xl","xl"]} 175 gap="xl" 176 > 177 <wui-shimmer borderRadius="l" width="100%"> ${this.qrCodeTemplate()} </wui-shimmer> 178 179 <wui-text variant="paragraph-500" color="fg-100"> 180 Scan this QR Code with your phone 181 </wui-text> 182 ${this.copyTemplate()} 183 </wui-flex>`}loadingTemplate(){return(0,o.qy)` 184 <wui-flex 185 flexDirection="column" 186 alignItems="center" 187 .padding=${["xl","xl","xl","xl"]} 188 gap="xl" 189 > 190 <wui-flex justifyContent="center" alignItems="center"> 191 <wui-logo logo="farcaster"></wui-logo> 192 ${this.loaderTemplate()} 193 <wui-icon-box 194 backgroundColor="error-100" 195 background="opaque" 196 iconColor="error-100" 197 icon="close" 198 size="sm" 199 border 200 borderColor="wui-color-bg-125" 201 ></wui-icon-box> 202 </wui-flex> 203 <wui-flex flexDirection="column" alignItems="center" gap="xs"> 204 <wui-text align="center" variant="paragraph-500" color="fg-100"> 205 Loading user data 206 </wui-text> 207 <wui-text align="center" variant="small-400" color="fg-200"> 208 Please wait a moment while we load your data. 209 </wui-text> 210 </wui-flex> 211 </wui-flex> 212 `}mobileTemplate(){return(0,o.qy)` <wui-flex 213 flexDirection="column" 214 alignItems="center" 215 .padding=${["3xl","xl","xl","xl"]} 216 gap="xl" 217 > 218 <wui-flex justifyContent="center" alignItems="center"> 219 <wui-logo logo="farcaster"></wui-logo> 220 ${this.loaderTemplate()} 221 <wui-icon-box 222 backgroundColor="error-100" 223 background="opaque" 224 iconColor="error-100" 225 icon="close" 226 size="sm" 227 border 228 borderColor="wui-color-bg-125" 229 ></wui-icon-box> 230 </wui-flex> 231 <wui-flex flexDirection="column" alignItems="center" gap="xs"> 232 <wui-text align="center" variant="paragraph-500" color="fg-100" 233 >
233Continue in Farcaster</span></wui-text 234 > 235 <wui-text align="center" variant="small-400" color="fg-200" 236 >Accept connection request in the app</wui-text 237 ></wui-flex 238 > 239 ${this.mobileLinkTemplate()} 240 </wui-flex>`}loaderTemplate(){let e=$.W.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return(0,o.qy)`<wui-loading-thumbnail radius=${9*t}></wui-loading-thumbnail>`}async connectFarcaster(){if(this.authConnector)try{await this.authConnector?.provider.connectFarcaster(),this.socialProvider&&(I.i.setConnectedSocialProvider(this.socialProvider),E.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_REQUEST_USER_DATA",properties:{provider:this.socialProvider}})),this.loading=!0;let e=k.x.getConnections(this.authConnector.chain).length>0;await k.x.connectExternal(this.authConnector,this.authConnector.chain);let t=this.remoteFeatures?.multiWallet;this.socialProvider&&E.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:this.socialProvider,caipNetworkId:P.W.getActiveCaipNetwork()?.caipNetworkId}}),this.loading=!1,e&&t?(d.I.replace("ProfileWallets"),S.P.showSuccess("New Wallet Added")):W.W.close()}catch(e){this.socialProvider&&E.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}}),d.I.goBack(),S.P.showError(e)}}mobileLinkTemplate(){return(0,o.qy)`<wui-button 241 size="md" 242 ?loading=${this.loading} 243 ?disabled=${!this.uri||this.loading} 244 @click=${()=>{this.uri&&w.w.openHref(this.uri,"_blank")}} 245 > 246 Open farcaster</wui-button 247 >`}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;let e=this.getBoundingClientRect().width-40;return(0,o.qy)` <wui-qr-code 248 size=${e} 249 theme=${$.W.state.themeMode} 250 uri=${this.uri} 251 ?farcaster=${!0} 252 data-testid="wui-qr-code" 253 color=${(0,a.J)($.W.state.themeVariables["--w3m-qr-color"])} 254 ></wui-qr-code>`}copyTemplate(){let e=!this.uri||!this.ready;return(0,o.qy)`<wui-link 255 .disabled=${e} 256 @click=${this.onCopyUri} 257 color="fg-200" 258 data-testid="copy-wc2-uri" 259 > 260 <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon> 261 Copy link 262 </wui-link>`}onCopyUri(){try{this.uri&&(w.w.copyToClopboard(this.uri),S.P.showSuccess("Link copied"))}catch{S.P.showError("Failed to copy")}}};F.styles=q,A([(0,r.wk)()],F.prototype,"socialProvider",void 0),A([(0,r.wk)()],F.prototype,"uri",void 0),A([(0,r.wk)()],F.prototype,"ready",void 0),A([(0,r.wk)()],F.prototype,"loading",void 0),A([(0,r.wk)()],F.prototype,"remoteFeatures",void 0),F=A([(0,c.EM)("w3m-connecting-farcaster-view")],F)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.