PageSourceSearch

https://auth.buffer.com/assets/RecoveryCode-CchrnCHM.js

js buffer.com collected 2026-09-24 06:40:25 UTC 3,555 bytes, 1 lines download raw bytes

1import{M as e,O as t,P as n,k as r,r as i,t as a}from"./jsx-runtime-CL-DilWO.js";import{D as o}from"./LucideIcons-9IqVpk3v.js";import{i as s,n as c,r as l,t as u}from"./LegalFooter-CZUOGWXy.js";import{t as d}from"./Notice-hJmUoi3l.js";import{t as f}from"./Button-Dfnu3zd4.js";import{n as p,t as m}from"./AuthFormFields.module-KMmMqFAU.js";import{t as h}from"./Label-DuHNjnur.js";import{n as g,r as _}from"./pageTitle-DrP3IrGA.js";import{n as v,r as y,t as b}from"./PageLayout-CMwo5IdX.js";import{n as x}from"./constants-C42EMpmP.js";import{t as S}from"./FormError-DQTM_6D-.js";import{t as C}from"./focusFirstInvalidControl-Hl2SDLsM.js";var w=16,T=e=>e.replace(/[^A-Za-z0-9]/g,``).slice(0,w).replace(/(.{4})(?=.)/g,`$1-`),E=e=>/^[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}$/.test(e),D=n(e()),O=`Please enter your full recovery code, in the format xxxx-xxxx-xxxx-xxxx.`,k=()=>{let[e,t]=(0,D.useState)(``),[n,r]=(0,D.useState)(!1),[i,a]=(0,D.useState)(null),o=(0,D.useRef)(null);(0,D.useEffect)(()=>{o.current?.focus()},[]);let s=(0,D.useCallback)(e=>{r(!0),a(null),t(T(e))},[]),c=E(e);return{recoveryCode:e,editedSinceLoad:n,errorMessage:i,handleRecoveryCodeChange:s,handleSubmit:(0,D.useCallback)(e=>{c||(e.preventDefault(),a(O),C(e.currentTarget))},[c]),inputRef:o}},A={logoSection:`_logoSection_1adba_1`,heading:`_heading_1adba_8`,description:`_description_1adba_12`,form:`_form_1adba_19`,field:`_field_1adba_23`,input:`_input_1adba_30`,buttons:`_buttons_1adba_34`,backLink:`_backLink_1adba_41`,footer:`_footer_1adba_52`,footerText:`_footerText_1adba_60`},j=a(),M=g(`Account Recovery`),N={invalid_code:`This recovery code doesn't seem to match. Try again?`,invalid_credentials:`Account does not exist`,rate_limited:x},P=r(function({params:e}){let{uid:n}=e,{recoveryCode:r,editedSinceLoad:a,errorMessage:g,handleRecoveryCodeChange:x,handleSubmit:C,inputRef:w}=k(),[T]=t(),E=T.get(`error`),D=E?N[E]??`An unknown error occurred. Please try again.`:null,O=E===`invalid_code`,M=g??(O&&!a?D:null),P=O?null:D;return(0,j.jsxs)(y,{children:[(0,j.jsxs)(v,{children:[(0,j.jsxs)(`div`,{className:A.logoSection,children:[(0,j.jsx)(_,{}),(0,j.jsx)(s,{size:`lg`,as:`h1`,className:A.heading,children:`Account Recovery`})]}),(0,j.jsxs)(b,{children:[(0,j.jsx)(`p`,{className:A.description,children:`Enter your recovery code to log in.`}),(0,j.jsxs)(`form`,{action:`/interaction/${n}/recovery-code`,method:`post`,onSubmit:C,className:o(A.form,m.form),children:[(0,j.jsx)(`input`,{type:`hidden`,name:`recoveryCode`,value:r}),(0,j.jsxs)(l,{direction:`column`,gap:`lg`,children:[P&&(0,j.jsx)(d,{variant:`error`,children:P}),(0,j.jsxs)(`div`,{className:A.field,children:[(0,j.jsx)(h,{htmlFor:`recovery-code`,children:`Recovery Code`}),(0,j.jsx)(p,{ref:w,id:`recovery-code`,type:`text`,value:r,onChange:e=>x(e.target.value),placeholder:`RcIU-UnqW-unzB-aOmz`,autoComplete:`off`,"aria-invalid":!!M,"aria-describedby":M?`recovery-code-error`:void 0,maxLength:19,size:`large`,className:o(A.input,m.input)})]}),M&&(0,j.jsx)(S,{id:`recovery-code-error`,children:M}),(0,j.jsxs)(`div`,{className:A.buttons,children:[(0,j.jsx)(f,{type:`submit`,size:`large`,className:m.submitButton,children:`Submit Code`}),(0,j.jsx)(c,{as:i,to:`/tfa/${n}`,className:A.backLink,children:`Back`})]})]})]}),(0,j.jsx)(`div`,{className:A.footer,children:(0,j.jsxs)(`p`,{className:A.footerText,children:[`Having issues?`,` `,(0,j.jsx)(c,{href:`https://support.buffer.com?openContact=true`,external:!0,children:`Contact support`})]})})]})]}),(0,j.jsx)(u,{})]})});export{P as default,M as meta};

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.