1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2738],{20357:(e,n,t)=>{t.r(n),t.d(n,{MfaEnrollmentFlowScreen:()=>C,default:()=>C});var o=t(42073),r=t(48334),l=t(31816),s=t(13741);let a=s.forwardRef(function(e,n){let{title:t,titleId:o,...r}=e;return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":o},r),t?s.createElement("title",{id:o},t):null,s.createElement("path",{fillRule:"evenodd",d:"M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Zm7.007 6.387a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}),i=s.forwardRef(function(e,n){let{title:t,titleId:o,...r}=e;return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":o},r),t?s.createElement("title",{id:o},t):null,s.createElement("path",{fillRule:"evenodd",d:"M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z",clipRule:"evenodd"}))});var c=t(72339),d=t(3503),u=t(37076),h=t(17629),m=t(81123),x=t(60168),f=t(28884),j=t(32325),y=t(81539),w=t(58739),p=t(55121),v=t(69752),g=t(85461),b=t(58987);t(16567),t(62207),t(9133),t(58544),t(52198),t(15);let k=({appName:e,onComplete:n,onReset:t,onClose:r})=>
1{let[l,a]=(0,s.useState)(""),[i,d]=(0,s.useState)(!1),[h,x]=(0,s.useState)(null),[j,k]=(0,s.useState)("enroll"),{initEnrollmentWithSms:C,submitEnrollmentWithSms:M}=(0,f.h)(),{data:S}=(0,m.u)(),E=(0,u.u)();function F(){S?.mfaEnrollmentFlow?.onSuccess(),n()}return h?(0,o.jsx)(b.ErrorScreenView,{allowlistConfig:E.allowlistConfig,error:h,onBack:()=>x(null),onRetry:()=>x(null)}):(0,o.jsxs)(o.Fragment,"enroll"===j?{children:[(0,o.jsx)(c.M,{backFn:t,onClose:r},"header"),(0,o.jsx)(g.I,{style:{marginBottom:"1.5rem"},children:(0,o.jsx)(w.A,{})}),(0,o.jsx)(g.T,{children:"Set up SMS verification"}),(0,o.jsxs)(g.S,{children:["We'll text a verification code to this mobile device whenever you use your ",e," ","wallet."]}),(0,o.jsxs)(g.C,{children:[(0,o.jsx)(v.C,{onSubmit:async function({qualifiedPhoneNumber:e}){try{await C({phoneNumber:e}),a(e),k("verify")}catch(e){x(e)}},hideRecent:!0}),(0,o.jsxs)(g.c,{children:["By providing your mobile number, you agree to receive text messages from ",E?.name,". Some carrier charges may apply"]})]}),(0,o.jsx)(c.b,{})]}:i?{children:[(0,o.jsx)(c.M,{onClose:F},"header"),(0,o.jsx)(g.I,{style:{marginBottom:"1.5rem"},children:(0,o.jsx)(y.A,{})}),(0,o.jsx)(g.T,{children:"SMS verification added"}),(0,o.jsxs)(g.S,{children:["From now on, you'll enter the verification code sent to your mobile device whenever you use your ",e," wallet."]}),(0,o.jsx)(g.B,{children:(0,o.jsx)(c.P,{onClick:F,children:"Done"})}),(0,o.jsx)(c.b,{})]}:{children:[(0,o.jsx)(c.M,{backFn:function(){"verify"===j?k("enroll"):t()},onClose:r},"header"),(0,o.jsx)(g.I,{style:{marginBottom:"1.5rem"},children:(0,o.jsx)(w.A,{})}),(0,o.jsx)(g.T,{children:"Enter enrollment code"}),(0,o.jsxs)(g.C,{children:[(0,o.jsx)(g.N,{onChange:async function(e){try{if(!e)return;await M({phoneNumber:l,mfaCode:e}),d(!0)}catch(e){if((0,f.i)(e))throw Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.");if((0,f.d)(e))throw Error("The code you entered is not valid");if((0,f.f)(e))throw Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.");throw(0,f.j)(e)?Error("Verification canceled"):Error("Unknown error")}}}),(0,o.jsxs)(g.S,{children:["To continue, enter the 6-digit code sent to ",(0,o.jsx)("strong",{children:(0,p.Ds)(l)})]})]}),(0,o.jsx)(c.b,{})]})},C={component:()=>{let{user:e,enrollInMfa:n,ready:t}=(0,x.u)(),[y,w]=(0,s.useState)(null),{unenrollWithSms:p,unenrollWithTotp:v,unenrollWithPasskey:b,submitEnrollmentWithTotp:C,initEnrollmentWithPasskey:M,submitEnrollmentWithPasskey:S,initEnrollmentWithTotp:E}=(0,f.h)(),{data:F,onUserCloseViaDialogOrKeybindRef:R}=(0,m.u)(),A=(0,u.u)(),{closePrivyModal:B}=(0,h.u)(),{promptMfa:P}
1=(0,f.u)(),[T,I]=(0,s.useState)(!1),[W,N]=(0,s.useState)(null),[L,Z]=(0,s.useState)(null),O=()=>{B({shouldCallAuthOnSuccess:!0}),n(!1),setTimeout(()=>{w(null),N(null)},500)},[U,H]=(0,s.useState)(!1),[V,_]=(0,s.useState)();R.current=O;let D=e?.mfaMethods.includes("sms"),Y=!!e?.phone,$=e?.mfaMethods.includes("totp"),q=e?.mfaMethods.includes("passkey"),K=D||$||q,z=e?.linkedAccounts.filter(e=>"passkey"===e.type).map(e=>e.credentialId)??[];function G(){w(null),N(null)}async function J(e=z){H(!0);try{return await M(),await S({credentialIds:e},{removeForLogin:F?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa}),F?.mfaEnrollmentFlow?.onSuccess(),O()}catch(e){_(e)}finally{H(!1)}}if((0,s.useEffect)(()=>{K&&I(!0)},[K]),!t||!e||!A)return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.M,{onClose:O},"header"),(0,o.jsx)(g.A,{children:(0,o.jsx)(j.M,{})}),(0,o.jsx)(g.C,{children:(0,o.jsx)(d.L,{})}),(0,o.jsx)(c.b,{})]});if("sms"===y)return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.M,{backFn:G,onClose:O},"header"),(0,o.jsx)(g.I,{style:{marginBottom:"1.5rem"},children:(0,o.jsx)(r.A,{})}),(0,o.jsx)(g.T,{children:"Remove SMS verification?"}),(0,o.jsxs)(g.S,{children:["MFA adds an extra layer of security to your ",A?.name," account. Make sure you have other methods to secure your account."]}),(0,o.jsx)(g.B,{children:(0,o.jsx)(c.P,{$warn:!0,onClick:async function(){w(null);try{await p()}catch(e){w(null)}},children:"Remove"})}),(0,o.jsx)(c.b,{})]});if("totp"===y)return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.M,{backFn:G,onClose:O},"header"),(0,o.jsx)(g.I,{style:{marginBottom:"1.5rem"},children:(0,o.jsx)(r.A,{})}),(0,o.jsx)(g.T,{children:"Remove authenticator app verification?"}),(0,o.jsxs)(g.S,{children:["MFA adds an extra layer of security to your ",A?.name," account. Make sure you have other methods to secure your account."]}),(0,o.jsx)(g.B,{children:(0,o.jsx)(c.P,{$warn:!0,onClick:async function(){w(null);try{await v()}catch(e){w(null)}},children:"Remove"})}),(0,o.jsx)(c.b,{})]});if("passkey"===y){let e=F?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa??!0;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.M,{backFn:G,onClose:O},"header"),(0,o.jsx)(g.I,{style:{marginBottom:"1.5rem"},children:(0,o.jsx)(r.A,{})}),(0,o.jsx)(g.T,{children:"Are you sure you want to remove this passkey?"}),(0,o.jsx)(g.S,{children:e?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),(0,o.jsx)(g.B,{children:(0,o.jsx)(c.P,{$warn:!0,onClick:async function(){w(null);try{await b({removeForLogin:F?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa})}catch(e){w(null)}},children:"Remove"})}),(0,o.jsx)(c.b,{})]})}if(0===F.mfaEnrollmentFlow.mfaMethods.length&&!K)return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.M,{onClose:O},"header"),(0,o.jsx)(g.I,{style:{marginBottom:"1.5rem"},children:(0,o.jsx)(l.A,{})}),(0,o.jsx)(g.T,{children:"Add more security"}),(0,o.jsxs)(g.S,{children:[A?.name," does not have any verification methods enabled."]}),(0,o.jsx)(g.B,{children:(0,o.jsx)(c.P,{onClick:O,children:"Close"})}),(0,o.jsx)(c.b,{})]});let Q=!K&&!T;return Q?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.M,{onClose:O},"header"),(0,o.jsx)(g.I,{style:{marginBottom:"1.5rem"},children:(0,o.jsx)(l.A,{})}),(0,o.jsx)(g.T,{children:"Transaction Protection"}),(0,o.jsx)(g.S,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,o.jsxs)(g.L,{children:[(0,o.jsxs)(g.a,{children:[(0,o.jsx)(g.b,{children:(0,o.jsx)(a,{})}),"Enable 2-Step verification for your ",A?.name," wallet."]}),(0,o.jsxs)(g.a,{children:[(0,o.jsx)(g.b,{children:(0,o.jsx)(i,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,o.jsxs)(g.B,{children:[(0,o.jsx)(c.P,{onClick:()=>I(!0),children:"Continue"}),(0,o.jsx)(c.S,{onClick:O,children:"Not now"})]}),(0,o.jsx)(c.b,{})]}):"sms"===W?(0,o.jsx)(k,{appName:A?.name||"Privy",onComplete:O,onReset:G,onClose:O}):"totp"===W&&L?(0,o.jsx)(j.E,{onClose:O,onReset:G,submitEnrollmentWithTotp:({mfaCode:e})=>(async function(e){try{return _(void 0),await C({mfaCode:e}),F?.mfaEnrollmentFlow?.onSuccess(),O()}catch(e){_(e)}finally{w(null)}})(e),totpInfo:{...L,appName:A?.name||"Privy"}}):"passkey"===W?(0,o.jsx)(j.a,{onReset:G,onClose:O,submitEnrollmentWithPasskey:J}):(0,o.jsx)(j.b,{showIntro:Q,userMfaMethods:e.mfaMethods,appMfaMethods:A.mfa.methods,userHasAuthSms:Y,backFn:function(){I(!1)},handleSelectMethod:async function(e){try{await P()}catch(e){return void _(e)}return"totp"===e?(N(e),Z(null),void E().then(e=>{Z(e)}).catch(()=>{Z(null),G()})):"passkey"===e&&1===z.length?await J():void N(e)},isTotpLoading:"totp"===W&&!L,isPasskeyLoading:U,error:V,onClose:O,setRemovingMfaMethod:async e=>{try{await P()}catch(e){return void _(e)}w(e)}})}}},81539:(e,n,t)=>{t.d(n,{A:()=>r});var o=t(13741);let r=o.forwardRef(function(e,n){let{title:t,titleId:r,...l}=e;return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":r},l),t?o.createElement("title",{id:r},t):null,o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))})}}]);
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.