1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[99],{35340:(e,t,r)=>{r.d(t,{C:()=>l,S:()=>i});var o=r(42073),a=r(28290);let i=({title:e,description:t,children:r,...a})=>(0,o.jsx)(n,{...a,children:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("h3",{children:e}),"string"==typeof t?(0,o.jsx)("p",{children:t}):t,r]})});(0,a.I4)(i)` 2 margin-bottom: 24px; 3`;let l=({title:e,description:t,icon:r,children:a,...i})=>(0,o.jsxs)(c,{...i,children:[r||null,(0,o.jsx)("h3",{children:e}),t&&"string"==typeof t?(0,o.jsx)("p",{children:t}):t,a]}),n=a.I4.div` 4 display: flex; 5 flex-direction: column; 6 justify-content: flex-start; 7 align-items: flex-start; 8 text-align: left; 9 gap: 8px; 10 width: 100%; 11 margin-bottom: 24px; 12 13 && h3 { 14 font-size: 17px; 15 color: var(--privy-color-foreground); 16 } 17 18 /* Sugar assuming children are paragraphs. Otherwise, handling styling on your own */ 19 && p { 20 color: var(--privy-color-foreground-2); 21 font-size: 14px; 22 } 23`,c=(0,a.I4)(n)` 24 align-items: center; 25 text-align: center; 26 gap: 16px; 27 28 h3 { 29 margin-bottom: 24px; 30 } 31`},60099:(e,t,r)=>{r.r(t),r.d(t,{RecoveryOAuthScreen:()=>A,default:()=>A});var o=r(42073),a=r(13741),i=r(72339),l=r(35340),n=r(37076),c=r(81806),s=r(17629),d=r(60168),h=r(92216),p=r(31555),u=r(5898),v=r(18187),w=r(33671),y=r(81123),f=r(28884),g=r(97352);async function x({url:e,popup:t,provider:r}){return t.location=e,new Promise((e,r)=>{function o(){t?.close(),window.removeEventListener("message",a)}function a(t){t.data&&("PRIVY_OAUTH_RESPONSE"===t.data.type&&t.data.stateCode&&t.data.authorizationCode&&(e(t.data),o()),"https://cdn.apple-cloudkit.com"===t.origin&&t.data.ckSession&&(e({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:t.data.ckSession}),o()),"PRIVY_OAUTH_ERROR"===t.data.type&&(r(t.data.error),o()))}window.addEventListener("message",a)})}async function m({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:a}){if(!a||!r)throw new h.P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===a)throw new h.P("User denied confirmation during OAuth flow");try{return(await e.post(p.a8,{authorization_code:a,state_code:r,code_verifier:o,provider:t})).access_token}catch(t){let e=(0,h.f)(t);if(e.privyErrorCode)throw new h.P(e.message||"Invalid code during OAuth flow.",void 0,e.privyErrorCode);if("User denied confirmation during OAuth flow"===e.message)throw new h.P("Invalid code during oauth flow.",void 0,h.a.OAUTH_USER_DENIED);throw new h.P("Invalid code during OAuth flow.",void 0,h.a.UNKNOWN_AUTH_ERROR)}}async function _({api:e,provider:t}){let r=(0,u.c)(),o=(0,u.a)(),a=await (0,u.d)(r);try{return"icloud"===t?{url:(await e.post(p.a9,{client_type:"web"})).url}:{url:(await e.post(p.aa,{redirect_to:window.location.href,code_challenge:a,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(e){throw(0,h.f)(e)}}r(16567),r(62207),r(9133),r(58544),r(52198);let E={"google-drive":{name:"Google Drive",component:g.G},icloud:{name:"iCloud",component:g.A}},A={component:()=>{let{logout:e}=(0,d.u)(),{navigate:t,setModalData:r,data:p}=(0,y.u)(),{closePrivyModal:u,createAnalyticsEvent:A}=(0,s.u)(),{execute:C}=(()=>{let{client:e,walletProxy:t,refreshSessionAndUser:r}=(0,s.u)(),{data:o}=(0,y.u)(),{user:a}=(0,d.u)(),i=(0,w.a)(),{create:l}=(0,f.n)();return{execute:async({provider:n,action:c,popup:s,shouldCreateEth:p,shouldCreateSol:u})=>{let w,y;if(!e)throw new h.P("Missing client");function f(t){if(!t&&e)throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:n}}),new h.P("Recovery OAuth failed")}switch(n){case"google-drive":{let t,r,{url:o,codeVerifier:a,stateCode:i}=await _({api:e.api,provider:n});f(o);try{let a=await x({url:o,popup:s,provider:n});if(t=a.stateCode,r=a.authorizationCode,t!==i)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:n,storedStateCode:i??"",returnedStateCode:t??""}}),new h.P("Unexpected auth flow. This may be a phishing attempt.",void 0,h.a.OAUTH_UNEXPECTED)}catch(t){throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:t.toString(),provider:n}}),new h.P("Recovery OAuth failed")}[w,y]=await Promise.all([e.getAccessToken(),m({api:e.api,provider:n,codeVerifier:a,stateCode:t,authorizationCode:r})]);break}case"icloud":{let{url:t}=await _({api:e.api,provider:n});f(t);let{ckWebAuthToken:r}=await x({url:t,popup:s,provider:n});y=r,w=await e.getAccessToken()}}if(!t)throw new h.P("Cannot connect to wallet proxy");if(!w)throw new h.P("Unable to authorize user");
31switch(c){case"recover":{let r=o?.recoverWallet?.entropyId,a=o?.recoverWallet?.entropyIdVerifier;if(!r||!a)throw new h.P("Recovery OAuth failed");e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:r,recoveryMethod:n}}),await t.recover({accessToken:w,entropyId:r,entropyIdVerifier:a,recoveryAccessToken:y}),e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:r,recoveryMethod:n}});break}case"create-wallet":{let t;if(e.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),p&&u)t=await l({recoveryMethod:n,recoveryAccessToken:y,chainType:"ethereum",walletIndex:0,latestUser:a}),t=await l({chainType:"solana",walletIndex:0,latestUser:t.user});else if(u)t=await l({recoveryMethod:n,recoveryAccessToken:y,chainType:"solana",walletIndex:0,latestUser:a});else{if(!p)throw Error("Invalid args to create wallet");t=await l({recoveryMethod:n,recoveryAccessToken:y,chainType:"ethereum",walletIndex:0,latestUser:a})}if(!t)throw i("createWallet","onError",h.a.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:t.account.address}}),i("createWallet","onSuccess",{wallet:t.account});break}case"set-recovery":{let o=(0,d.g)(a);if(!o)throw i("setWalletRecovery","onError",h.a.EMBEDDED_WALLET_NOT_FOUND),Error("Embedded wallet not found");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:o.address,existingRecoveryMethod:o.recoveryMethod,targetRecoveryMethod:n}});let{entropyId:l,entropyIdVerifier:c}=(0,v.g)(a);await t.setRecovery({accessToken:w,entropyId:l,entropyIdVerifier:c,recoveryMethod:n,recoveryAccessToken:y});let s=(0,d.g)(await r());if(!s)throw i("createWallet","onError",h.a.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to set recovery on wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:o.address,existingRecoveryMethod:o.recoveryMethod,targetRecoveryMethod:n}}),i("setWalletRecovery","onSuccess",{method:n,wallet:s});break}default:throw new h.P("Unsupported recovery action")}}}})(),[b,j]=(0,a.useState)(!1),{provider:R,action:k,isInAccountCreateFlow:O,shouldCreateEth:T,shouldCreateSol:S}=p?.recoveryOAuthStatus??{},[L,P]=(0,a.useState)(void 0),[N,M]=(0,a.useState)("create-wallet"===k);if("user-passcode"===R)throw Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let I=E[R].name,U=E[R].component,D=p?.recoverWallet?.onCompleteNavigateTo,W=new c.R(async(e="create-wallet")=>(M(!0),new Promise((t,r)=>{setTimeout(async()=>{try{let r=window.open();await C({provider:R,action:e,popup:r,shouldCreateEth:T,shouldCreateSol:S}),j(!0),t()}catch(t){P({message:`${"recover"===e?"Recovery":"Back up"} with ${I} unsuccessful`,detail:"recover"===k?`Please verify that you are selecting the ${I} account associated with your backup.`:"",retryable:!0}),r()}},0)})));(0,a.useEffect)(()=>{"recover"!==k&&W.execute(O?"create-wallet":"set-recovery")},[]),(0,a.useEffect)(()=>{if(!b)return;let o=setTimeout(()=>{O?(r({createWallet:{onSuccess:()=>{},onFailure:t=>{A({eventName:"embedded_wallet_creation_failure_logout",payload:{error:t,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0,shouldCreateEth:!1,shouldCreateSol:!1}}),t("EmbeddedWalletCreatedScreen")):u({shouldCallAuthOnSuccess:!1})},n.r);return()=>clearTimeout(o)},[b]);let F=(0,a.useCallback)(async()=>{await W.execute("recover"),D?t(D):j(!0)},[]),H="google-drive"===R?"Google Drive":"Apple iCloud",V=b&&`Successfully ${"recover"===k?"recovered":"backed up"} with ${H}.`||L&&L.message||`${"recover"===k?"Recovering":"Backing up"} with ${H}...`,z=L?L.detail:"";return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.M,{}),N?(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(g.R,{children:[(0,o.jsx)(l.C,{title:V,icon:(0,o.jsx)(U,{style:{width:"38px",height:"38px"}}),description:z}),L&&L?.retryable?(0,o.jsx)(i.P,{onClick:()=>{(0,f.k)(),P(void 0),"create-wallet"===k?W.execute("create-wallet"):F()},disabled:!b&&!L?.retryable,children:"Try again"}):null]})}):(0,o.jsxs)(g.R,{children:[(0,o.jsx)(l.C,{title:"Confirm it's really you",icon:(0,o.jsx)(U,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${H} where your account is backed up.`}),(0,o.jsxs)(i.P,{onClick:F,children:["Confirm with ",H]})]}),(0,o.jsx)(i.B,{})]})}}},97352:(e,t,r)=>{r.d(t,{A:()=>i,G:()=>l,R:()=>n,a:()=>c});var o=r(42073),a=r(28290);let i=e=>(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[(0,o.jsx)("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992
310 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),(0,o.jsx)("defs",{children:(0,o.jsxs)("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[(0,o.jsx)("stop",{stopColor:"#3E82F4"}),(0,o.jsx)("stop",{offset:1,stopColor:"#93DCF7"})]})})]}),l=({style:e,...t})=>(0,o.jsxs)("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,o.jsxs)("g",{clipPath:"url(#clip0_2115_829)",children:[(0,o.jsx)("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),(0,o.jsx)("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),(0,o.jsx)("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),(0,o.jsx)("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),(0,o.jsx)("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),(0,o.jsx)("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),(0,o.jsx)("defs",{children:(0,o.jsx)("clipPath",{id:"clip0_2115_829",children:(0,o.jsx)("rect",{width:"16",height:"14",fill:"white"})})})]}),n=a.I4.div` 32 display: flex; 33 flex-direction: column; 34 gap: 12px; 35 padding-top: 24px; 36 padding-bottom: 24px; 37`,c=a.I4.div` 38 padding-bottom: 24px; 39`}}]);
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.