1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2170],{92170:(e,t,i)=>{i.r(t),i.d(t,{W3mConnectSocialsView:()=>x,W3mConnectingFarcasterView:()=>q,W3mConnectingSocialView:()=>R});var o=i(83138),r=i(98410),s=i(78964),a=i(75751),n=i(55480),c=i(36211);i(40575),i(82886);var l=i(10899),d=i(67869),u=i(28977),h=i(52502),p=i(30112),w=i(12319);i(1507);var m=i(3375);let g=(0,c.AH)` 2 :host { 3 margin-top: ${({spacing:e})=>e["1"]}; 4 } 5 wui-separator { 6 margin: ${({spacing:e})=>e["3"]} calc(${({spacing:e})=>e["3"]} * -1) 7 ${({spacing:e})=>e["2"]} calc(${({spacing:e})=>e["3"]} * -1); 8 width: calc(100% + ${({spacing:e})=>e["3"]} * 2); 9 } 10`;var f=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let v=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="2"> 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 m.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}}}};v.styles=g,f([(0,r.MZ)()],v.prototype,"tabIdx",void 0),f([(0,r.wk)()],v.prototype,"connectors",void 0),f([(0,r.wk)()],v.prototype,"authConnector",void 0),f([(0,r.wk)()],v.prototype,"remoteFeatures",void 0),f([(0,r.wk)()],v.prototype,"isPwaLoading",void 0),v=f([(0,c.EM)("w3m-social-login-list")],v);let y=(0,c.AH)` 19 wui-flex { 20 max-height: clamp(360px, 540px, 80vh); 21 overflow: scroll; 22 scrollbar-width: none; 23 transition: opacity ${({durations:e})=>e.md} 24 ${({easings:e})=>e["ease-out-power-1"]}; 25 will-change: opacity; 26 } 27 28 wui-flex::-webkit-scrollbar {
29 display: none; 30 } 31 32 wui-flex.disabled { 33 opacity: 0.3; 34 pointer-events: none; 35 user-select: none; 36 } 37`;var b=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let x=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.checked=a.o.state.isLegalCheckboxChecked,this.unsubscribe.push(a.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&&!this.checked;return(0,o.qy)` 38 <w3m-legal-checkbox></w3m-legal-checkbox> 39 <wui-flex 40 flexDirection="column" 41 .padding=${["0","3","3","3"]} 42 gap="01" 43 class=${(0,s.J)(r?"disabled":void 0)} 44 > 45 <w3m-social-login-list tabIdx=${(0,s.J)(r?-1:void 0)}></w3m-social-login-list> 46 </wui-flex> 47 `}};x.styles=y,b([(0,r.wk)()],x.prototype,"checked",void 0),x=b([(0,c.EM)("w3m-connect-socials-view")],x);var C=i(93481),$=i(97418),k=i(70417),P=i(58653),E=i(65374),W=i(81701),I=i(45069);i(90721),i(64731),i(47824),i(41163);var S=i(89600),L=i(91867);let A=(0,c.AH)` 48 wui-logo { 49 width: 80px; 50 height: 80px; 51 border-radius: ${({borderRadius:e})=>e["8"]}; 52 } 53 @keyframes shake { 54 0% { 55 transform: translateX(0); 56 } 57 25% { 58 transform: translateX(3px); 59 } 60 50% { 61 transform: translateX(-3px); 62 } 63 75% { 64 transform: translateX(3px); 65 } 66 100% { 67 transform: translateX(0); 68 } 69 } 70 wui-flex:first-child:not(:only-child) { 71 position: relative; 72 } 73 wui-loading-thumbnail { 74 position: absolute; 75 } 76 wui-icon-box { 77 position: absolute; 78 right: calc(${({spacing:e})=>e["1"]} * -1); 79 bottom: calc(${({spacing:e})=>e["1"]} * -1); 80 opacity: 0; 81 transform: scale(0.5); 82 transition: all ${({easings:e})=>e["ease-out-power-2"]} 83 ${({durations:e})=>e.lg}; 84 } 85 wui-text[align='center'] { 86 width: 100%; 87 padding: 0px ${({spacing:e})=>e["4"]}; 88 } 89 [data-error='true'] wui-icon-box { 90 opacity: 1; 91 transform: scale(1); 92 } 93 [data-error='true'] > wui-flex:first-child { 94 animation: shake 250ms ${({easings:e})=>e["ease-out-power-2"]} both; 95 } 96 .capitalize { 97 text-transform: capitalize; 98 } 99`;var O=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let R=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.socialProvider=C.W.getAccountData()?.socialProvider,this.socialWindow=C.W.getAccountData()?.socialWindow,this.error=!1,this.connecting=!1,this.message="Connect in the provider window",this.remoteFeatures=n.H.state.remoteFeatures,this.address=C.W.getAccountData()?.address,this.connectionsByNamespace=$.x.getConnections(C.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===L.o.SECURE_SITE_ORIGIN){window.removeEventListener("message",this.handleSocialConnection,!1);try{if(this.authConnector&&!this.connecting){this.socialWindow&&(this.socialWindow.close(),C.W.setAccountProp("socialWindow",void 0,C.W.state.activeChain)),this.connecting=!0,this.updateMessage();let t=e.data.resultUri;this.socialProvider&&k.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_REQUEST_USER_DATA",properties:{provider:this.socialProvider}}),await $.x.connectExternal({id:this.authConnector.id,type:this.authConnector.type,socialUri:t},this.authConnector.chain),this.socialProvider&&(P.i.setConnectedSocialProvider(this.socialProvider),k.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:this.socialProvider}}))}}catch(e){this.error=!0,this.updateMessage(),this.socialProvider&&k.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider,message:w.w.parseError(e)}})}}else d.I.goBack(),E.P.showError("Untrusted Origin"),this.socialProvider&&k.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider,message:"Untrusted Origin"}})},S.R.EmbeddedWalletAbortController.signal.addEventListener("abort",()=>{this.socialWindow&&(this.socialWindow.close(),C.W.setAccountProp("socialWindow",void 0,C.W.state.activeChain))}),this.unsubscribe.push(C.W.subscribeChainProp("accountState",e=>
99{if(e&&(this.socialProvider=e.socialProvider,e.socialWindow&&(this.socialWindow=e.socialWindow),e.address)){let t=this.remoteFeatures?.multiWallet;e.address!==this.address&&(this.hasMultipleConnections&&t?(d.I.replace("ProfileWallets"),E.P.showSuccess("New Wallet Added"),this.address=e.address):(W.W.state.open||n.H.state.enableEmbedded)&&W.W.close())}}),n.H.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e})),this.authConnector&&this.connectSocial()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),window.removeEventListener("message",this.handleSocialConnection,!1),this.socialWindow?.close(),C.W.setAccountProp("socialWindow",void 0,C.W.state.activeChain)}render(){return(0,o.qy)` 100 <wui-flex 101 data-error=${(0,s.J)(this.error)} 102 flexDirection="column" 103 alignItems="center" 104 .padding=${["10","5","5","5"]} 105 gap="6" 106 > 107 <wui-flex justifyContent="center" alignItems="center"> 108 <wui-logo logo=${(0,s.J)(this.socialProvider)}></wui-logo> 109 ${this.error?null:this.loaderTemplate()} 110 <wui-icon-box color="error" icon="close" size="sm"></wui-icon-box> 111 </wui-flex> 112 <wui-flex flexDirection="column" alignItems="center" gap="2"> 113 <wui-text align="center" variant="lg-medium" color="primary" 114 >Log in with 115 <span class="capitalize">${this.socialProvider??"Social"}</span></wui-text 116 > 117 <wui-text align="center" variant="lg-regular" color=${this.error?"error":"secondary"} 118 >${this.message}</wui-text 119 ></wui-flex 120 > 121 </wui-flex> 122 `}loaderTemplate(){let e=I.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&&k.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"}};R.styles=A,O([(0,r.wk)()],R.prototype,"socialProvider",void 0),O([(0,r.wk)()],R.prototype,"socialWindow",void 0),O([(0,r.wk)()],R.prototype,"error",void 0),O([(0,r.wk)()],R.prototype,"connecting",void 0),O([(0,r.wk)()],R.prototype,"message",void 0),O([(0,r.wk)()],R.prototype,"remoteFeatures",void 0),R=O([(0,c.EM)("w3m-connecting-social-view")],R),i(41028),i(77237),i(34563),i(41699);let T=(0,c.AH)` 123 wui-shimmer { 124 width: 100%; 125 aspect-ratio: 1 / 1; 126 border-radius: ${({borderRadius:e})=>e[4]}; 127 } 128 129 wui-qr-code { 130 opacity: 0; 131 animation-duration: ${({durations:e})=>e.xl}; 132 animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]}; 133 animation-name: fade-in; 134 animation-fill-mode: forwards; 135 } 136 137 wui-logo { 138 width: 80px; 139 height: 80px; 140 border-radius: ${({borderRadius:e})=>e["8"]}; 141 } 142 143 wui-flex:first-child:not(:only-child) { 144 position: relative; 145 } 146 147 wui-loading-thumbnail { 148 position: absolute; 149 } 150 151 wui-icon-box { 152 position: absolute; 153 right: calc(${({spacing:e})=>e["1"]} * -1); 154 bottom: calc(${({spacing:e})=>e["1"]} * -1); 155 opacity: 0; 156 transform: scale(0.5); 157 transition: 158 opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]}, 159 transform ${({durations:e})=>e.lg} 160 ${({easings:e})=>e["ease-out-power-2"]}; 161 will-change: opacity, transform; 162 } 163 164 @keyframes fade-in { 165 from { 166 opacity: 0; 167 } 168 to { 169 opacity: 1; 170 } 171 } 172`;var F=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let q=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.socialProvider=C.W.getAccountData()?.socialProvider,this.uri=C.W.getAccountData()?.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.W.subscribeChainProp("accountState",e=>{this.socialProvider=e?.socialProvider,this.uri=e?.farcasterUrl,this.connectFarcaster()}),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 173 flexDirection="column" 174 alignItems="center" 175 .padding=${["0","5","5","5"]} 176 gap="5" 177 > 178 <wui-shimmer width="100%"> ${this.qrCodeTemplate()} </wui-shimmer> 179 180 <wui-text variant="lg-medium" color="primary"> Scan this QR Code with your phone </wui-text> 181 ${this.copyTemplate()} 182 </wui-flex>`}loadingTemplate(){return(0,o.qy)` 183 <wui-flex 184 flexDirection="column" 185 alignItems="center" 186 .padding=${["5","5","5","5"]} 187 gap="5" 188 > 189 <wui-flex justifyContent="center" alignItems="center"> 190 <wui-logo logo="farcaster"></wui-logo> 191 ${this.loaderTemplate()} 192 <wui-icon-box color="error" icon="close" size="sm"></wui-icon-box> 193 </wui-flex> 194 <wui-flex flexDirection="column" alignItems="center" gap="2"> 195 <wui-text align="center" variant="md-medium" color="primary"> 196 Loading user data 197 </wui-text> 198 <wui-text align="center" variant="sm-regular" color="secondary"> 199 Please wait a moment while we load your data. 200 </wui-text> 201 </wui-flex> 202 </wui-flex> 203 `}mobileTemplate(){return(0,o.qy)` <wui-flex 204 flexDirection="column" 205 alignItems="center" 206 .padding=${["10","5","5","5"]} 207 gap="5" 208 > 209 <wui-flex justifyContent="center" alignItems="center"> 210 <wui-logo logo="farcaster"></wui-logo> 211 ${this.loaderTemplate()} 212 <wui-icon-box 213 color="error" 214 icon="close" 215 size="sm" 216 ></wui-icon-box> 217 </wui-flex> 218 <wui-flex flexDirection="column" alignItems="center" gap="2"> 219 <wui-text align="center" variant="md-medium" color="primary" 220 >
220Continue in Farcaster</span></wui-text 221 > 222 <wui-text align="center" variant="sm-regular" color="secondary" 223 >Accept connection request in the app</wui-text 224 ></wui-flex 225 > 226 ${this.mobileLinkTemplate()} 227 </wui-flex>`}loaderTemplate(){let e=I.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&&(P.i.setConnectedSocialProvider(this.socialProvider),k.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_REQUEST_USER_DATA",properties:{provider:this.socialProvider}})),this.loading=!0;let e=$.x.getConnections(this.authConnector.chain).length>0;await $.x.connectExternal(this.authConnector,this.authConnector.chain);let t=this.remoteFeatures?.multiWallet;this.socialProvider&&k.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:this.socialProvider}}),this.loading=!1,e&&t?(d.I.replace("ProfileWallets"),E.P.showSuccess("New Wallet Added")):W.W.close()}catch(e){this.socialProvider&&k.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider,message:w.w.parseError(e)}}),d.I.goBack(),E.P.showError(e)}}mobileLinkTemplate(){return(0,o.qy)`<wui-button 228 size="md" 229 ?loading=${this.loading} 230 ?disabled=${!this.uri||this.loading} 231 @click=${()=>{this.uri&&w.w.openHref(this.uri,"_blank")}} 232 > 233 Open farcaster</wui-button 234 >`}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 235 size=${e} 236 theme=${I.W.state.themeMode} 237 uri=${this.uri} 238 ?farcaster=${!0} 239 data-testid="wui-qr-code" 240 color=${(0,s.J)(I.W.state.themeVariables["--w3m-qr-color"])} 241 ></wui-qr-code>`}copyTemplate(){let e=!this.uri||!this.ready;return(0,o.qy)`<wui-button 242 .disabled=${e} 243 @click=${this.onCopyUri} 244 variant="neutral-secondary" 245 size="sm" 246 data-testid="copy-wc2-uri" 247 > 248 <wui-icon size="sm" color="default" slot="iconRight" name="copy"></wui-icon> 249 Copy link 250 </wui-button>`}onCopyUri(){try{this.uri&&(w.w.copyToClopboard(this.uri),E.P.showSuccess("Link copied"))}catch{E.P.showError("Failed to copy")}}};q.styles=T,F([(0,r.wk)()],q.prototype,"socialProvider",void 0),F([(0,r.wk)()],q.prototype,"uri",void 0),F([(0,r.wk)()],q.prototype,"ready",void 0),F([(0,r.wk)()],q.prototype,"loading",void 0),F([(0,r.wk)()],q.prototype,"remoteFeatures",void 0),q=F([(0,c.EM)("w3m-connecting-farcaster-view")],q)}}]);
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.