1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2536],{92536:(e,t,s)=>{s.r(t),s.d(t,{MfaVerifyFlowScreen:()=>u,default:()=>u});var l=s(42073),o=s(13741),r=s(37076),a=s(60168),n=s(28884),i=s(36526);s(9133),s(16567),s(62207),s(58544),s(52198);let u=({onClose:e})=>{let{user:t}=(0,a.u)(),s=(0,r.u)(),u=(0,o.useMemo)(()=>t?.mfaMethods.filter(e=>"passkey"!==e||!s.globalDisablePasskeys)??[],[t?.mfaMethods,s.globalDisablePasskeys]),[c,f]=(0,o.useState)(u[0]??null),{init:d,cancel:h,submit:k}=(0,n.u)(),[y,b]=(0,o.useState)(!1),[w,m]=(0,o.useState)(null),[S,g]=(0,o.useState)();(0,o.useEffect)(()=>{f(u[0]??null)},[u]);let v=(0,o.useRef)(!1);async function p(t){g(void 0);try{if(!t||!c)return;await k(c,t),b(!0),g(void 0),e()}catch(e){throw(0,i.t)(e).error}}async function C(t){if("passkey"!==t)try{f(t),await d(t)}catch(e){console.error(e)}else try{f(t);let s=await d(t);if(!s)throw Error("something went wrong");m(s),await k(t,s),b(!0),g(void 0),e()}catch(e){g((0,i.t)(e))}}(0,o.useEffect)(()=>{!v.current&&c&&(v.current=!0,C(c).finally(()=>{v.current=!1}))},[]);let E=()=>{f(null),g(void 0),h(),e()};return t?"passkey"===c?(0,l.jsx)(i.V,{account:t.linkedAccounts.filter(e=>"passkey"===e.type&&e.enrolledInMfa).sort((e,t)=>t.firstVerifiedAt.valueOf()-e.firstVerifiedAt.valueOf())[0],submitSuccess:y,hasBlockingError:S?.isBlocking??!1,error:S?.error,onClose:E,onBack:()=>{f(null),g(void 0)},handleSubmit:()=>p(w).catch(g)}):c?(0,l.jsx)(i.a,{submitSuccess:y,hasBlockingError:S?.isBlocking??!1,handleSubmitCode:p,selectedMethod:c,onClose:E,onBack:u.length>1?()=>f(null):void 0}):(0,l.jsx)(i.b,{mfaMethods:u,onSelect:C,handleClose:E}):null}}}]);
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.