1import{c as O,Q as S,aF as z,r as i,aG as H,aH as I,aI as P,aJ as w,aK as d,j as e,aL as s,u as E,s as T,ai as L,w as R,a6 as f,a3 as p,aM as A,F as U,R as q,M as D,Z as W,aN as B,aO as Q,a5 as V}from"./index-yzLLMphG.js";/** 2 * @license lucide-react v0.575.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const X=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Z=O("bot",X),j="409",C="404",$=a=>a.message.startsWith(j)?a.message.includes("api key")?s.keyConflict:s.alreadyHasOrganization:a.message.startsWith(C)?s.invalidCode:`${s.failed}: ${a.message}`,N=a=>a===""?void 0:a,y=({children:a})=>e.jsx(D,{className:"w-full max-w-md",children:e.jsx(W,{className:"flex flex-col gap-5 p-6",children:a})}),G=()=>e.jsx(y,{children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("h1",{className:"text-lg font-semibold text-foreground",children:s.missingCodeTitle}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.missingCode})]})}),J=({code:a})=>{const{accessToken:t,name:m}=E(),n=T(),b=L(),[u,v]=i.useState(""),[x,_]=i.useState(m),[l,F]=i.useState({}),[h,k]=i.useState(!0),o=R(B(t,n));i.useEffect(()=>{d.capture("agent_claim_viewed")},[]);const g=u.trim()!==""&&x.trim()!==""&&!o.isPending,M=r=>{r.preventDefault(),g&&o.mutate({claimCode:a,identityConsent:h,organizationName:u.trim(),userName:x.trim(),userFunction:l.userFunction,userFunctionOther:N(l.userFunctionOther),userHeardFrom:l.userHeardFrom,userHeardFromOther:N(l.userHeardFromOther)},{onSuccess(){d.capture("agent_claim_submitted",{result:"success"}),Q(),V.success(s.success),b("/general")},onError(c){d.capture("agent_claim_submitted",{result:"error",reason:c.message.startsWith(j)?"has_organization":c.message.startsWith(C)?"invalid_code":"other"})}})};return e.jsxs(y,{children:[e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("span",{className:"flex h-11 w-11 items-center justify-center rounded-full bg-primary/10 text-primary",children:e.jsx(Z,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("h1",{className:"text-lg font-semibold text-foreground",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.description})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:s.codeLabel}),e.jsx("code",{className:"break-all rounded-md bg-muted/60 px-3 py-2 font-mono text-sm text-foreground",children:a})]}),e.jsxs("form",{onSubmit:M,className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{htmlFor:"organizationName",children:s.organizationName}),e.jsx(p,{id:"organizationName",type:"text",required:!0,value:u,onChange:r=>{v(r.target.value)}})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{htmlFor:"userName",children:s.yourName}),e.jsx(p,{id:"userName",type:"text",required:!0,value:x,onChange:r=>{_(r.target.value)}})]}),e.jsx(A,{value:l,onUpdate:r=>{F(c=>({...c,...r}))}}),e.jsxs("label",{className:"flex items-start gap-2 rounded-lg border border-border/60 px-3.5 py-3 text-left",children:[e.jsx(U,{className:"mt-0.5",checked:h,onCheckedChange:r=>{k(r===!0)}}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-foreground",children:s.shareIdentityLabel}),e.jsx("br",{}),s.shareIdentityHint]})]}),o.error!==null&&e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:$(o.error)}),e.jsx(q,{type:"submit",size:"lg",disabled:!g,children:o.isPending?s.submitting:s.submit})]})]})},Y=()=>{const[a]=S(),t=a.get(z),[m]=i.useState(H),n=t!==null&&t!==""?t:m;return i.useEffect(()=>{t!==null&&t!==""&&(I(t),window.history.replaceState(null,"",P)),w()},[t]),i.useEffect(()=>{(n===null||n==="")&&d.capture("agent_claim_viewed",{missing_code:!0})},[n]),n===null||n===""?e.jsx(G,{}):e.jsx(J,{code:n})};export{Y 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.