import{jsxs as c,jsx as r,Fragment as w}from"react/jsx-runtime";import{ButtonContainer as l}from"../containers/button.js";import"../containers/card.js";import{cn as v}from"../../lib/cn.js";import g from"../icons/ico-checkmark.js";import y from"../icons/ico-copy.js";import N from"../icons/ico-eye-closed.js";import j from"../icons/ico-eye-opened.js";import"../primitives/button.js";import"../primitives/checkbox.js";import"../primitives/dropdown-selector.js";import"../primitives/popover.js";import"../primitives/radio.js";import"../primitives/segmented-control.js";import"../primitives/switch.js";import s from"../primitives/text.js";import{useState as p,useEffect as d,useCallback as B}from"react";import"../utils/client-asset-logo.js";import"react-qrcode-logo";import"../utils/secured-by-magic.js";import"../containers/header.js";import"../containers/menu.js";import"../containers/modal.js";import"../containers/overlay.js";const h=f=>{const{content:o,onCopy:t,showHideButton:e,mono:u}=f,[i,a]=p(!!e),[n,m]=p(!1);d(()=>{if(n){const x=setTimeout(()=>{m(!1)},1500);return()=>clearTimeout(x)}},[n]),d(()=>{a(!!e)},[e]);const b=B(()=>{t&&(t(o),m(!0))},[o]);return c("div",{className:"flex flex-row items-center w-full px-4 py-3 rounded-[10px] bg-surface-secondary justify-between relative",children:[r("div",{className:v("text-nowrap overflow-hidden",i?"select-none blur-[10px]":"select-auto"),children:u?r(s.Mono,{truncate:!0,children:o}):r(s,{truncate:!0,children:o})}),c("div",{className:"flex flex-row items-center gap-3",children:[i&&r(l,{onPress:()=>a(!1),"aria-label":"show",children:r(N,{width:22,height:22,color:"var(--color-brand-base)"})}),e&&!i&&r(l,{onPress:()=>a(!0),"aria-label":"hide",children:r(j,{width:22,height:22,color:"var(--color-brand-base)"})}),t&&r(w,{children:n?r(g,{width:22,height:22,color:"var(--color-brand-base)"}):r(l,{onPress:b,"aria-label":"copy",children:r(y,{width:22,height:22,color:"var(--color-brand-base)"})})})]})]})};h.displayName="TextBox";export{h as default};
//# sourceMappingURL=text-box.js.map
