PageSourceSearch

https://www.hirexl.ai/app/assets/WorkspaceAckRoute-Df7qtlfg.js

js hirexl.ai collected 2026-10-05 13:58:42 UTC 4,129 bytes, 1 lines download raw bytes

1import{iA as N,iB as S,iC as T,e as W,u as C,c as P,r as m,aY as I,y as b,j as e,k as L,q as E,b as y,T as B,s as O,n as F,B as w,A as R,v as q,w as D,L as U,I as z,iD as _,iE as G,iF as H,G as M}from"./index-Dw85Szsp.js";import{a as V,b as Y}from"./workspaceActivationApi-CipGMb_e.js";import{F as $}from"./FormCard.react-A3tRsaXy.js";import"./vendor-CLXKpVbq.js";const J=s=>({id:s.id==null&&s.workspaceId==null?null:Number(s.id??s.workspaceId),slug:s.slug||"",name:s.name||"",type:s.type||""}),K=s=>{var n;const i=s.accessToken||s.token||"",d=J(s.workspace||{});return N({accessToken:i,workspace:d}),localStorage.setItem("email-confirmed",((n=s.workspace)==null?void 0:n.status)||"active"),S(s.user||{}),T(i),{accessToken:i,workspace:d}},se=()=>{var k;const s=W(),i=C(),d=P(),n=m.useRef(!1),[o,c]=m.useState(!1),[l,u]=m.useState({message:"",type:""}),x=new URLSearchParams(d.search),h=((k=x.get("token"))==null?void 0:k.trim())||"",p=Number(x.get("workspaceId")),g=!!h&&Number.isInteger(p)&&p>0,f=t=>{var j;const{accessToken:r,workspace:A}=K(t);if(s(_({token:r,workspace:A})),s(G(t.user||{})),((j=t.trialSetup)==null?void 0:j.nextAction)==="show_preparing_workspace"){H({user:t.user,workspace:t.workspace,trialSetup:t.trialSetup}),i("/workspace-preparing",{replace:!0});return}M(),i("/dashboard",{replace:!0})},v=()=>{c(!0),u({message:"",type:""}),Y({token:h,workspaceId:p}).then(t=>{f(t)}).catch(()=>{u({message:"This activation link is invalid, expired, or has already been used.",type:"error"}),s(b({message:"Workspace activation failed.",severity:"error"}))}).finally(()=>{c(!1)})};m.useEffect(()=>{!g||n.current||(n.current=!0,v())},[h,p,g]);const a=I({initialValues:{otp:""},validate:t=>{const r={};return u({message:"",type:""}),t.otp||(r.otp="OTP is required!"),/^\d{6}$/.test(t.otp)||(r.otp="OTP should be numeric!"),r},onSubmit:t=>{c(!0),V(t.otp).then(r=>{f(r),c(!1)}).catch(()=>{c(!1),u({message:"Something went wrong!",type:"error"}),s(b({message:"Something went wrong!",severity:"error"}))})}});return g?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-slate-950 px-4 py-10",children:e.jsxs(L,{className:"w-full max-w-xl border-slate-800 bg-slate-900 text-slate-50 shadow-2xl",children:[e.jsxs(E,{className:"space-y-4",children:[e.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl bg-cyan-500/10 text-cyan-300",children:o?e.jsx(y,{className:"h-7 w-7 animate-spin"}):e.jsx(B,{className:"h-7 w-7"})}),e.jsx(O,{className:"text-3xl font-semibold tracking-tight",children:o?"Preparing your access":"Activation required"})]}),e.jsxs(F,{className:"space-y-6",children:[e.jsx("p",{className:"text-sm leading-6 text-slate-300",children:o?"We are validating your workspace activation and setting up your session.":l.message}),o?e.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-slate-800",children:e.jsx("div",{className:"h-full w-2/3 animate-pulse rounded-full bg-cyan-400"})}):e.jsx(w,{type:"button",onClick:()=>{n.current=!1,v()},children:"Try activation again"})]})]})}):e.jsx("div",{className:"min-h-screen w-full flex flex-col items-center justify-center bg-gray-50",children:e.jsx("div",{className:"min-w-[400px]",children:e.jsxs($,{buttonText:"Enter Activation Code",title:"A 6-digit OTP for account activation or verification.",onSubmit:a.handleSubmit,children:[l.message&&e.jsxs(R,{variant:"default",className:l.message?"bg-red-100 text-red-800":"bg-green-100 text-green-800",children:[e.jsx(q,{children:l.message?"Error":"Success"}),e.jsx(D,{children:l.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"otp",children:"Activation OTP"}),e.jsx(z,{id:"otp",name:"otp",type:"text",inputMode:"numeric",pattern:"[0-9]*",maxLength:6,placeholder:"Enter 6 digit OTP",value:a.values.otp,onChange:a.handleChange,onBlur:a.handleBlur,className:a.touched.otp&&a.errors.otp?"border-red-500":""}),a.touched.otp&&a.errors.otp?e.jsx("p",{className:"text-xs text-red-500 mt-0",children:a.errors.otp}):null]}),e.jsxs(w,{type:"submit",disabled:o,children:[o&&e.jsx(y,{className:"animate-spin w-4 h-4"}),"Submit"]})]})})})};export{se as default};

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.