PageSourceSearch

https://dynamic-lebkuchen-0238db.netlify.app/static/js/517.a7c6efc0.chunk.js

js dynamic-lebkuchen-0238db.netlify.app collected 2026-10-03 10:41:24 UTC 13,315 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkico_react=self.webpackChunkico_react||[]).push([[517],{60517:(e,t,r)=>{r.r(t),r.d(t,{RecoveryOAuthScreen:()=>A,default:()=>A});var o=r(90034),a=r(57722),i=r(67980),l=r(33898),n=r(93014),c=r(99844),d=r(78055),s=r(51380),u=r(49931),h=r(69523),p=r(44131),v=r(17488),w=r(73999),y=r(85961);r(2035),r(30549),r(88404),r(82425),r(82595);async function f(e){let{url:t,popup:r,provider:o}=e;return r.location=t,new Promise((e,t)=>{function o(){null!==r&&void 0!==r&&r.close(),window.removeEventListener("message",a)}function a(r){r.data&&("PRIVY_OAUTH_RESPONSE"===r.data.type&&r.data.stateCode&&r.data.authorizationCode&&(e(r.data),o()),"https://cdn.apple-cloudkit.com"===r.origin&&r.data.ckSession&&(e({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:r.data.ckSession}),o()),"PRIVY_OAUTH_ERROR"===r.data.type&&(t(r.data.error),o()))}window.addEventListener("message",a)})}async function g(e){let{api:t,provider:r,stateCode:o,codeVerifier:a,authorizationCode:i}=e;if(!i||!o)throw new s.a("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===i)throw new s.a("User denied confirmation during OAuth flow");try{return(await t.post(h.a8,{authorization_code:i,state_code:o,code_verifier:a,provider:r})).access_token}catch(t){let e=(0,s.f)(t);if(e.privyErrorCode)throw new s.a(e.message||"Invalid code during OAuth flow.",void 0,e.privyErrorCode);if("User denied confirmation during OAuth flow"===e.message)throw new s.a("Invalid code during oauth flow.",void 0,s.b.OAUTH_USER_DENIED);throw new s.a("Invalid code during OAuth flow.",void 0,s.b.UNKNOWN_AUTH_ERROR)}}async function m(e){let{api:t,provider:r}=e,o=(0,d.v)(),a=(0,d.w)(),i=await(0,d.x)(o);try{return"icloud"===r?{url:(await t.post(h.a9,{client_type:"web"})).url}:{url:(await t.post(h.aa,{redirect_to:window.location.href,code_challenge:i,state_code:a})).url,codeVerifier:o,stateCode:a,provider:r}}catch(t){throw(0,s.f)(t)}}let x={"google-drive":{name:"Google Drive",component:y.G},icloud:{name:"iCloud",component:y.A}};const A={component:()=>{var e;let{logout:t}=(0,u.u)(),{navigate:r,setModalData:h,data:A}=(0,u.a)(),{closePrivyModal:C,createAnalyticsEvent:_}=(0,s.u)(),{execute:E}=(()=>{let{client:e,walletProxy:t,refreshSessionAndUser:r}=(0,s.u)(),{data:o}=(0,u.a)(),{user:a}=(0,u.u)(),i=(0,v.a)(),{create:l}=(0,w.u)();return{execute:async n=>{let c,d,{provider:h,action:v,popup:w,shouldCreateEth:y,shouldCreateSol:x}=n;if(!e)throw new s.a("Missing client");function A(t){if(!t&&e)throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:h}}),new s.a("Recovery OAuth failed")}switch(h){case"google-drive":{let r,o,{url:a,codeVerifier:i,stateCode:l}=await m({api:e.api,provider:h});A(a);try{let t=await f({url:a,popup:w,provider:h});if(r=t.stateCode,o=t.authorizationCode,r!==l)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:h,storedStateCode:null!==l&&void 0!==l?l:"",returnedStateCode:null!==r&&void 0!==r?r:""}}),new s.a("Unexpected auth flow. This may be a phishing attempt.",void 0,s.b.OAUTH_UNEXPECTED)}catch(t){throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:t.toString(),provider:h}}),new s.a("Recovery OAuth failed")}[c,d]=await Promise.all([e.getAccessToken(),g({api:e.api,provider:h,codeVerifier:i,stateCode:r,authorizationCode:o})]);break}case"icloud":{let{url:t}=await m({api:e.api,provider:h});A(t);let{ckWebAuthToken:r}=await f({url:t,popup:w,provider:h});d=r,c=await e.getAccessToken()}}if(!t)throw new s.a("Cannot connect to wallet proxy");if(!c)throw new s.a("Unable to authorize user");switch(v){case"recover":{var C,_;let r=null===o||void 0===o||null===(C=o.recoverWallet)||void 0===C?void 0:C.entropyId,a=null===o||void 0===o||null===(_=o.recoverWallet)||void 0===_?void 0:_.entropyIdVerifier;if(!r||!a)throw new s.a("Recovery OAuth failed");e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:r,recoveryMethod:h}}),await t.recover({accessToken:c,entropyId:r,entropyIdVerifier:a,recoveryAccessToken:d}),e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:r,recoveryMethod:h}});break}case"create-wallet":{let t;if(e.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}
1),y&&x)t=await l({recoveryMethod:h,recoveryAccessToken:d,chainType:"ethereum",walletIndex:0,latestUser:a}),t=await l({chainType:"solana",walletIndex:0,latestUser:t.user});else if(x)t=await l({recoveryMethod:h,recoveryAccessToken:d,chainType:"solana",walletIndex:0,latestUser:a});else{if(!y)throw Error("Invalid args to create wallet");t=await l({recoveryMethod:h,recoveryAccessToken:d,chainType:"ethereum",walletIndex:0,latestUser:a})}if(!t)throw i("createWallet","onError",s.b.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,u.g)(a);if(!o)throw i("setWalletRecovery","onError",s.b.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:h}});let{entropyId:l,entropyIdVerifier:n}=(0,p.g)(a);await t.setRecovery({accessToken:c,entropyId:l,entropyIdVerifier:n,recoveryMethod:h,recoveryAccessToken:d});let v=(0,u.g)(await r());if(!v)throw i("createWallet","onError",s.b.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:h}}),i("setWalletRecovery","onSuccess",{method:h,wallet:v});break}default:throw new s.a("Unsupported recovery action")}}}})(),[b,R]=(0,a.useState)(!1),{provider:T,action:k,isInAccountCreateFlow:j,shouldCreateEth:S,shouldCreateSol:O}=null===A||void 0===A?void 0:A.recoveryOAuthStatus,[I,U]=(0,a.useState)(void 0),[N,L]=(0,a.useState)("create-wallet"===k);if("user-passcode"===T)throw Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let M=x[T].name,P=x[T].component,W=null===A||void 0===A||null===(e=A.recoverWallet)||void 0===e?void 0:e.onCompleteNavigateTo,D=new d.R(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"create-wallet";return L(!0),new Promise((t,r)=>{setTimeout(async()=>{try{let r=window.open();await E({provider:T,action:e,popup:r,shouldCreateEth:S,shouldCreateSol:O}),R(!0),t()}catch(t){U({message:"".concat("recover"===e?"Recovery":"Back up"," with ").concat(M," unsuccessful"),detail:"recover"===k?"Please verify that you are selecting the ".concat(M," account associated with your backup."):"",retryable:!0}),r()}},0)})});(0,a.useEffect)(()=>{"recover"!==k&&D.execute(j?"create-wallet":"set-recovery")},[]),(0,a.useEffect)(()=>{if(!b)return;let e=setTimeout(()=>{j?(h({createWallet:{onSuccess:()=>{},onFailure:e=>{_({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"RecoveryOAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0,shouldCreateEth:!1,shouldCreateSol:!1}}),r("EmbeddedWalletCreatedScreen")):C({shouldCallAuthOnSuccess:!1})},c.q);return()=>clearTimeout(e)},[b]);let F=(0,a.useCallback)(async()=>{await D.execute("recover"),W?r(W):R(!0)},[]),H="google-drive"===T?"Google Drive":"Apple iCloud",V=b&&"Successfully ".concat("recover"===k?"recovered":"backed up"," with ").concat(H,".")||I&&I.message||"".concat("recover"===k?"Recovering":"Backing up"," with ").concat(H,"..."),z=I?I.detail:"";return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.M,{}),N?(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(y.R,{children:[(0,o.jsx)(n.C,{title:V,icon:(0,o.jsx)(P,{style:{width:"38px",height:"38px"}}),description:z}),I&&null!==I&&void 0!==I&&I.retryable?(0,o.jsx)(i.P,{onClick:()=>{(0,d.o)(),U(void 0),"create-wallet"===k?D.execute("create-wallet"):F()},disabled:!b&&!(null!==I&&void 0!==I&&I.retryable),children:"Try again"}):null]})}):(0,o.jsxs)(y.R,{children:[(0,o.jsx)(n.C,{title:"Confirm it's really you",icon:(0,o.jsx)(P,{style:{height:42,width:48}}),description:"To confirm your identity, please log in to ".concat(H," where your account is backed up.")}),(0,o.jsxs)(i.P,{onClick:F,children:["Confirm with ",H]})]}),(0,o.jsx)(l.B,{})]})}}},73999:(e,t,r)=>{r.d(t,{u:()=>l});var o=r(66252),a=r(99844),i=r(51380);const l=()=>{let{walletProxy:e,recoverEmbeddedWallet:t,setUser:r,refreshSessionAndUser:l,privy:n,client:c}=(0,i.u)(),d=(0,a.u)();return{create:async a=>{let{walletIndex:i,chainType:s,latestUser:u,recoveryMethod:h,recoveryPassword:p,recoveryAccessToken:v}=a,w=u;w||(w=await l());let y=await c.getAccessToken();if(!w||!y||!e)throw Error("User must be authenticated before creating a Privy wallet");return await(0,o.g)({appConfig:d,user:w,refreshSessionAndUser:l,privy:n,accessToken:y,proxy:e,recoverEmbeddedWallet:t,setUser:r,walletIndex:i,chainType:s,recoveryMethod:h,recoveryPassword:p,recoveryAccessToken:v})}}}},85961:(e,t,r)=>{r.d(t,{A:()=>c,G:()=>d,R:()=>s,a:()=>u});var o=r(15882),a=r(24107),i=r(90034),l=r(52610);const n=["style"],c=e=>(0,i.jsxs)("svg",(0,a.A)((0,a.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20"},e),{},{children:[(0,i.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 
10 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),(0,i.jsx)("defs",{children:(0,i.jsxs)("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[(0,i.jsx)("stop",{stopColor:"#3E82F4"}),(0,i.jsx)("stop",{offset:1,stopColor:"#93DCF7"})]})})]})),d=e=>{let{style:t}=e,r=(0,o.A)(e,n);return(0,i.jsxs)("svg",(0,a.A)((0,a.A)({width:"16",height:"14",style:t,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),{},{children:[(0,i.jsxs)("g",{clipPath:"url(#clip0_2115_829)",children:[(0,i.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,i.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,i.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,i.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,i.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,i.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,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:"clip0_2115_829",children:(0,i.jsx)("rect",{width:"16",height:"14",fill:"white"})})})]}))},s=l.I4.div.withConfig({displayName:"RecoveryContainer",componentId:"sc-12b46968-0"})(["display:flex;flex-direction:column;gap:12px;padding-top:24px;padding-bottom:24px;"]),u=l.I4.div.withConfig({displayName:"RecoveryExplainerContainer",componentId:"sc-12b46968-1"})(["padding-bottom:24px;"])},93014:(e,t,r)=>{r.d(t,{C:()=>s,S:()=>d});var o=r(24107),a=r(15882),i=r(90034),l=r(52610);const n=["title","description","children"],c=["title","description","icon","children"],d=e=>{let{title:t,description:r,children:l}=e,c=(0,a.A)(e,n);return(0,i.jsx)(u,(0,o.A)((0,o.A)({},c),{},{children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h3",{children:t}),"string"==typeof r?(0,i.jsx)("p",{children:r}):r,l]})}))},s=e=>{let{title:t,description:r,icon:l,children:n}=e,d=(0,a.A)(e,c);return(0,i.jsxs)(h,(0,o.A)((0,o.A)({},d),{},{children:[l||null,(0,i.jsx)("h3",{children:t}),r&&"string"==typeof r?(0,i.jsx)("p",{children:r}):r,n]}))};let u=l.I4.div.withConfig({displayName:"StyledSection",componentId:"sc-523a75d6-1"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;width:100%;margin-bottom:24px;&& h3{font-size:17px;color:var(--privy-color-foreground);}&& p{color:var(--privy-color-foreground-2);font-size:14px;}"]),h=(0,l.I4)(u).withConfig({displayName:"CenteredStyledSection",componentId:"sc-523a75d6-2"})(["align-items:center;text-align:center;gap:16px;h3{margin-bottom:24px;}"])}}]);
2//# sourceMappingURL=517.a7c6efc0.chunk.js.map

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.