import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ef as t,Ff as n,Gy as r,Hy as i,Ly as a,Md as o,Sf as s,Zv as c,ch as l,dg as u,m_ as d,mv as f,pl as p,rv as m,tv as h,ty as g}from"./index-DDwwBb9e.js";import{t as _}from"./docsUrl-sZ6mVUWs.js";var v=e(r()),y=i();function b({heading:e=`Install the LangWatch CLI`,subline:t="One-time setup. After installing, run `langwatch login` to authenticate this device."}={}){let n=l(),r=!!n.data?.IS_SAAS,i=n.data?.BASE_HOST??`https://app.langwatch.ai`,m=r?`langwatch login`:`langwatch login --endpoint ${i}`;return(0,y.jsx)(a,{borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`md`,padding:5,backgroundColor:`bg`,boxShadow:`sm`,width:`full`,children:(0,y.jsxs)(u,{align:`stretch`,gap:4,children:[(0,y.jsxs)(d,{gap:2,children:[(0,y.jsx)(a,{color:`fg.muted`,children:(0,y.jsx)(o,{size:18})}),(0,y.jsx)(g,{as:`h3`,size:`sm`,children:e})]}),(0,y.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:t}),(0,y.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,children:[`Requires Node.js 18 or newer (the `,(0,y.jsx)(h,{fontSize:`xs`,children:`npm`}),` `,`command ships with it). Get it at`,` `,(0,y.jsx)(h,{fontSize:`xs`,children:`nodejs.org`}),`.`]}),(0,y.jsx)(x,{label:`1. Install`,command:`npm install -g langwatch`,ariaLabel:`Copy install command`}),(0,y.jsx)(x,{label:`2. Authenticate`,command:m,ariaLabel:`Copy login command`}),!r&&(0,y.jsxs)(c,{fontSize:`xs`,color:`fg.muted`,children:[`Self-hosted detected. The login flag targets`,` `,(0,y.jsx)(h,{fontSize:`xs`,children:i}),`; the endpoint is persisted after that first login, so subsequent commands don't need it.`]}),(0,y.jsxs)(d,{gap:2,children:[(0,y.jsx)(f,{size:`xs`,variant:`outline`,asChild:!0,children:(0,y.jsxs)(p,{href:_(`/integration/install`),isExternal:!0,gap:1,children:[`Install guide `,(0,y.jsx)(s,{size:12})]})}),(0,y.jsx)(f,{size:`xs`,variant:`ghost`,asChild:!0,children:(0,y.jsxs)(p,{href:_(`/integration/cli`),isExternal:!0,gap:1,children:[`CLI reference `,(0,y.jsx)(s,{size:12})]})})]})]})})}function x({label:e,command:r,ariaLabel:i}){let[a,o]=(0,v.useState)(!1);return(0,y.jsxs)(u,{align:`stretch`,gap:1,children:[(0,y.jsx)(c,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:e}),(0,y.jsxs)(d,{gap:2,padding:2,borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`sm`,backgroundColor:`bg.subtle`,children:[(0,y.jsxs)(h,{flex:1,backgroundColor:`transparent`,fontSize:`sm`,overflowX:`auto`,whiteSpace:`nowrap`,children:[`$ `,r]}),(0,y.jsx)(m,{size:`xs`,variant:`ghost`,"aria-label":a?`Copied`:i,onClick:()=>{navigator.clipboard.writeText(r),o(!0),setTimeout(()=>o(!1),1500)},children:a?(0,y.jsx)(n,{size:14}):(0,y.jsx)(t,{size:14})})]})]})}export{b as t};
//# sourceMappingURL=InstallCliCard-5H2kTK1j.js.map