import{c as g,r as c,j as o}from"./vendor-tanstack-BpuysabX.js";import{u as x,E as b,j}from"./vendor-codemirror-q5gL9Jwo.js";import{z as v,q as y,I as C,b4 as w,y as E}from"./index-CREafGO4.js";import"./vendor-radix-DIu41Ss_.js";import"./vendor-recharts-C2XeLr4O.js";import"./vendor-forms-Buh7U8Ay.js";import"./vendor-date-C1t37jsh.js";const N=[j(),b.lineWrapping],z=g.forwardRef(({className:l,value:s,onChange:u,copy:p=!1,onBlur:I,disabled:r,hideLineNumbers:h=!1,...f},e)=>{const i=c.useRef(null),{resolvedTheme:d}=v();let n;r&&(n={lineNumbers:!h,highlightActiveLine:!1,foldGutter:!1,highlightActiveLineGutter:!1});const{setContainer:a}=x({container:i.current,extensions:N,value:s,onChange:u,indentWithTab:!1,editable:!r,basicSetup:n,theme:d==="dark"?"dark":"light",height:"100%"});c.useEffect(()=>{i.current&&a(i.current)},[a]);const m=t=>{E.success("Copied to clipboard"),navigator.clipboard.writeText(t)};return o.jsx("div",{className:w("rounded-md border shadow-xs overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative",l),ref:t=>{i.current=t,typeof e=="function"?e(t):e&&(e.current=t)},...f,children:p&&s&&o.jsx(y,{onClick:()=>m(s),variant:"ghost",size:"icon",className:"absolute top-0 right-0 z-10","aria-label":"copy",children:o.jsx(C,{id:"Copy",className:"size-2"})})})});z.displayName="JsonInput";export{z as JsonInput};
//# sourceMappingURL=json-input-BOSzYwbm.js.map
