import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{t}from"./clipboard-DMTjLsXj.js";import{Gy as n,Hy as r,Jf as i,Ly as a,Ql as o,Zv as s,bf as c,m_ as l,rv as u,xf as d}from"./index-DDwwBb9e.js";var f=i(`clipboard-plus`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M9 14h6`,key:`159ibu`}],[`path`,{d:`M12 17v-6`,key:`1y8rbf`}]]),p=e(n()),m=r();function h({prefix:e,value:n,ariaLabel:r,showVisibilityToggle:i=!1,onCopy:h}){let[g,_]=(0,p.useState)(!1);function v(){_(e=>!e)}function y(){return!i||g?n:n.length<=16?`••••••••`:`${n.slice(0,4)}••••••••${n.slice(-4)}`}return(0,m.jsxs)(a,{position:`relative`,borderRadius:`xl`,border:`1px solid`,borderColor:`gray.200`,bg:`bg.panel/70`,backdropFilter:`blur(24px) saturate(1.4)`,boxShadow:`0 4px 30px rgba(0,0,0,0.06)`,overflow:`hidden`,transition:`all 0.2s ease`,_hover:{borderColor:`gray.300`,boxShadow:`0 8px 40px rgba(0,0,0,0.08)`},children:[(0,m.jsxs)(a,{px:5,py:3.5,pr:i?`120px`:`90px`,fontSize:`xs`,lineHeight:`tall`,fontFamily:`mono`,color:`fg`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,"aria-label":r,children:[(0,m.jsx)(s,{as:`span`,color:`fg.muted`,children:e}),y()]}),(0,m.jsxs)(l,{position:`absolute`,top:`50%`,right:2,transform:`translateY(-50%)`,gap:`0.5`,children:[i&&(0,m.jsx)(o,{content:g?`Hide`:`Show`,openDelay:0,showArrow:!0,children:(0,m.jsx)(u,{size:`xs`,variant:`ghost`,onClick:v,"aria-label":g?`Hide key`:`Show key`,backdropFilter:`blur(8px)`,bg:`bg.panel/50`,borderRadius:`lg`,_hover:{bg:`bg.panel/70`},children:g?(0,m.jsx)(d,{size:14}):(0,m.jsx)(c,{size:14})})}),(0,m.jsx)(o,{content:`Copy ${r.toLowerCase()}`,openDelay:0,showArrow:!0,children:(0,m.jsx)(u,{size:`xs`,variant:`ghost`,onClick:()=>void h({withBashPrefix:!1}),"aria-label":`Copy ${r.toLowerCase()}`,backdropFilter:`blur(8px)`,bg:`bg.panel/50`,borderRadius:`lg`,_hover:{bg:`bg.panel/70`},children:(0,m.jsx)(t,{size:14})})}),(0,m.jsx)(o,{content:`Copy with env prefix`,openDelay:0,showArrow:!0,children:(0,m.jsx)(u,{size:`xs`,variant:`ghost`,onClick:()=>void h({withBashPrefix:!0}),"aria-label":`Copy ${r.toLowerCase()} with bash prefix`,backdropFilter:`blur(8px)`,bg:`bg.panel/50`,borderRadius:`lg`,_hover:{bg:`bg.panel/70`},children:(0,m.jsx)(f,{size:14})})})]})]})}export{h as t};
//# sourceMappingURL=CopyableInputWithPrefix-C6e7hVcM.js.map