PageSourceSearch

https://the-republic-ashy.vercel.app/assets/CrossAppAuthScreen-V6LW9fie-DNBrDYSX.js

js the-republic-ashy.vercel.app collected 2026-10-03 07:52:28 UTC 3,436 bytes, 1 lines download raw bytes

1import{d5 as P,d4 as D,d7 as F,dK as K,d9 as p,df as g,dL as L,dw as S,d6 as k,dM as V,db as B}from"./index-MOhYIfAn.js";import{a as q}from"./shouldProceedtoEmbeddedWalletCreationFlow-BdpCzEJT-oReAkVcd.js";import{n as Q}from"./ScreenLayout-kyRBwF5n-BkUlue8r.js";import"./ModalHeader-CvLNEZ0F-Bvb1tW_R.js";import"./Screen-DnEl8dVF-a5P97aVF.js";import"./index-Dq_xe9dz-Dhf-gFgX.js";const Y=({providerApp:a,success:s,error:r,onClose:i})=>{let{title:m,subtitle:f}=p.useMemo((()=>s?{title:`Successfully connected with ${a.name}`,subtitle:"You're good to go!"}:r?{title:"Authentication failed",subtitle:r.message}:{title:`Connecting to ${a.name}`,subtitle:`Please check the pop-up from ${a.name} to continue`}),[s,r,a.name]);return k.jsx(Q,{title:m,subtitle:f,icon:a.logoUrl,iconVariant:"loading",iconLoadingStatus:{success:s,fail:!!r},onBack:i,watermark:!0})},U={component:()=>{let a=P(),{data:s,navigate:r,setModalData:i,onUserCloseViaDialogOrKeybindRef:m}=D(),{crossAppAuthFlow:f,updateWallets:M,closePrivyModal:C,createAnalyticsEvent:W}=F(),{logout:j}=K(),[o,l]=p.useState({}),e=s==null?void 0:s.crossAppAuth,A=new g(`There was an issue connecting your ${e==null?void 0:e.name} account. Please try again.`),N=new L((async n=>{var u,c,d,b,y,w,v,I,T,E,$,x,O,R,_;if(e!=null&&e.popup)try{let t=await f({appId:n,popup:e.popup,action:e.action,disableSignup:e.disableSignup});l({data:t})}catch(t){if(t instanceof g)l({error:t});else if(t instanceof V){if(t.privyErrorCode===B.ACCOUNT_TRANSFER_REQUIRED&&((c=(u=t.data)==null?void 0:u.data)!=null&&c.nonce))return i({accountTransfer:{nonce:(b=(d=t.data)==null?void 0:d.data)==null?void 0:b.nonce,account:(w=(y=t.data)==null?void 0:y.data)==null?void 0:w.subject,displayName:(T=(I=(v=t.data)==null?void 0:v.data)==null?void 0:I.account)==null?void 0:T.displayName,linkMethod:`privy:${e.appId}`,embeddedWalletAddress:(x=($=(E=t.data)==null?void 0:E.data)==null?void 0:$.otherUser)==null?void 0:x.embeddedWalletAddress,oAuthUserInfo:(_=(R=(O=t.data)==null?void 0:O.data)==null?void 0:R.otherUser)==null?void 0:_.oAuthUserInfo}}),void r("LinkConflictScreen");e.popup&&e.popup.close(),l({error:A})}else l({error:A})}else l({error:A})})),h=()=>{o.data&&(M(),e==null||e.onSuccess(o.data),C({shouldCallAuthOnSuccess:!0,isSuccess:!0})),e==null||e.onError(o.error??new g("User canceled flow")),C({shouldCallAuthOnSuccess:!1,isSuccess:!1})};return m.current=h,p.useEffect((()=>{var n;(n=e==null?void 0:e.appId)!=null&&n.length&&N.execute(e.appId)}),[e==null?void 0:e.appId]),p.useEffect((()=>{if(!o.data)return;let n=o.data;if(a.legal.requireUsersAcceptTerms&&!n.hasAcceptedTerms){let c=setTimeout((()=>{r("AffirmativeConsentScreen")}),S);return()=>clearTimeout(c)}if(q(n,a.embeddedWallets)){let c=setTimeout((()=>{i({createWallet:{onSuccess:()=>{},onFailure:d=>{console.error(d),W({eventName:"embedded_wallet_creation_failure_logout",payload:{error:d,provider:`privy:${e==null?void 0:e.appId}`,screen:"CrossAppAuthScreen"}}),j()},callAuthOnSuccessOnClose:!0}}),r("EmbeddedWalletOnAccountCreateScreen")}),S);return()=>clearTimeout(c)}let u=setTimeout(h,S);return()=>clearTimeout(u)}),[o.data]),e!=null&&e.appId?k.jsx(Y,{providerApp:{id:e==null?void 0:e.appId,logoUrl:e==null?void 0:e.logoUrl,name:e==null?void 0:e.name},success:!!o.data,error:o.error,onClose:h}):(console.warn("Missing data for Screen"),null)},isShownBeforeReady:!0};export{U as CrossAppAuthScreen,Y as CrossAppAuthScreenView,U as default};

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.