PageSourceSearch

https://rift-easonchai.vercel.app/_next/static/chunks/4230.67bca0b0bef8c722.js

js rift-easonchai.vercel.app collected 2026-10-03 07:39:29 UTC 4,229 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4230],{99042:function(i,t,e){e.d(t,{W:function(){return s}});var n=e(22555),r=e(54146);class s extends r.Z{constructor(i){let{chains:t=n.gL9,options:e}=i;super(),this.chains=t,this.options=e}getBlockExplorerUrls(i){let t=i.explorers?.map(i=>i.url)??[];return t.length>0?t:void 0}isChainUnsupported(i){return!this.chains.some(t=>t.chainId===i)}updateChains(i){this.chains=i}}},53827:function(i,t,e){e.d(t,{n:function(){return n}});function n(i){return"string"==typeof i?Number.parseInt(i,"0x"===i.trim().substring(0,2)?16:10):"bigint"==typeof i?Number(i):i}},84230:function(i,t,e){e.d(t,{MagicAuthConnector:function(){return u}});var n=e(7622),r=e(53827),s=e(241),a=e(19485),o=e(15632),h=e(52083),c=e(99042);e(54146);class d extends c.W{constructor(i){super(i),(0,n._)(this,"id","magic-link"),(0,n._)(this,"name","Magic Link"),(0,n._)(this,"ready",!0),this.magicOptions=i.options}async getAccount(){let i=new s.Q(await this.getProvider()).getSigner(),t=await i.getAddress();return t.startsWith("0x")?t:`0x${t}`}
1async getProvider(){if(this.provider)return this.provider;let i=this.getMagicSDK();return this.provider=i.rpcProvider,this.provider}async getSigner(){let i=new s.Q(await this.getProvider());return await i.getSigner()}async isAuthorized(){let i=this.getMagicSDK();try{return await i.user.isLoggedIn()}catch(i){return!1}}onAccountsChanged(i){0===i.length?this.emit("disconnect"):i[0]&&this.emit("change",{account:a.getAddress(i[0])})}onChainChanged(i){let t=(0,r.n)(i),e=this.isChainUnsupported(t);this.emit("change",{chain:{id:t,unsupported:e}})}onDisconnect(){this.emit("disconnect")}async disconnect(){let i=this.getMagicSDK();await i.user.logout()}}class u extends d{constructor(i){super(i),this.magicSdkConfiguration=i.options.magicSdkConfiguration,this._type=i.options.type,this.oauthProviders=i.options.oauthOptions?.providers||[],this.oauthRedirectURI=i.options.oauthOptions?.redirectURI}async connect(i){if(!this.magicOptions.apiKey)throw Error("Magic API Key is not provided.");try{let t;i.chainId&&this.initializeMagicSDK({chainId:i.chainId});let e=await this.getProvider();this.setupListeners(),this.emit("message",{type:"connecting"});let n=await this.isAuthorized();try{t=await this.getChainId()}catch(i){t=0}if(this._connectedChainId=t,n)return{provider:e,chain:{id:t,unsupported:!1},account:await this.getAccount()};let r=this.getMagicSDK();if("connect"===this._type)("email"in i||"phoneNumber"in i)&&console.warn("Passing email or phoneNumber is not required for Magic Connect"),await r.wallet.connectWithUI();else if("oauthProvider"in i)await r.oauth.loginWithRedirect({provider:i.oauthProvider,redirectURI:this.oauthRedirectURI||window.location.href}),await new Promise(i=>{setTimeout(i,1e4)});else if("email"in i)await r.auth.loginWithMagicLink({email:i.email,showUI:!0});else if("phoneNumber"in i)await r.auth.loginWithSMS({phoneNumber:i.phoneNumber});else throw Error("Invalid options: Either provide and email, phoneNumber or oauthProvider when using Magic Auth");
1let s=await this.getSigner(),a=await s.getAddress();return a.startsWith("0x")||(a=`0x${a}`),{account:a,chain:{id:t,unsupported:!1},provider:e}}catch(i){throw console.error(i),Error("Something went wrong")}}async getChainId(){let i=this.magicSdkConfiguration?.network;if("object"==typeof i){let t=i.chainId;if(t)return(0,r.n)(t)}throw Error("Chain ID is not defined")}initializeMagicSDK(){let{chainId:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={...this.magicSdkConfiguration,extensions:[new o.XX]};if(i){let e=this.chains.find(t=>t.chainId===i);e&&(t.network={rpcUrl:e.rpc[0]||"",chainId:e.chainId})}return this.magicSDK=new h.s$(this.magicOptions.apiKey,t),this.provider=this.magicSDK.rpcProvider,this.magicSDK}getMagicSDK(){return this.magicSDK?this.magicSDK:this.initializeMagicSDK()}async setupListeners(){let i=await this.getProvider();i.on("accountsChanged",this.onAccountsChanged),i.on("chainChanged",this.onChainChanged),i.on("disconnect",this.onDisconnect)}async switchChain(i){let t=this.chains.find(t=>t.chainId===i);if(!t)throw Error("Chain not found");return this._connectedChainId!==i&&this.initializeMagicSDK({chainId:i}),t}}}}]);

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.