import { E as compilerRuntimeExports, r as reactExports } from "./vendor-react-DYNCg6N5.js";
const useCopyToClipboard = () => {
  const $ = compilerRuntimeExports.c(3);
  const [copiedText, setCopiedText] = reactExports.useState(null);
  let t0;
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
    t0 = async (text) => {
      if (!(navigator == null ? void 0 : navigator.clipboard)) {
        console.warn("Clipboard not supported");
        return false;
      }
      try {
        await navigator.clipboard.writeText(text);
        setCopiedText(text);
        return true;
      } catch (t12) {
        const error = t12;
        console.warn("Copy failed", error);
        setCopiedText(null);
        return false;
      }
    };
    $[0] = t0;
  } else {
    t0 = $[0];
  }
  const copy = t0;
  let t1;
  if ($[1] !== copiedText) {
    t1 = {
      copiedText,
      copy
    };
    $[1] = copiedText;
    $[2] = t1;
  } else {
    t1 = $[2];
  }
  return t1;
};
export {
  useCopyToClipboard as u
};
//# sourceMappingURL=useCopyToClipboard-C-S2RacD.js.map
