{"version":3,"file":"clipboard.mjs","names":[],"sources":["../../src/utils/clipboard.ts"],"sourcesContent":["/**\n * Safely copies text to the clipboard.\n *\n * Checks that the Clipboard API is available before attempting the write,\n * and catches any errors (e.g. permission denied, insecure context).\n *\n * @param text - The text to copy to the clipboard.\n * @returns `true` if the text was successfully copied, `false` otherwise.\n */\nexport async function copyToClipboard(text: string): Promise<boolean> {\n  if (!navigator.clipboard?.writeText) {\n    console.error(\"Clipboard API is not available\");\n    return false;\n  }\n\n  try {\n    await navigator.clipboard.writeText(text);\n    return true;\n  } catch (err) {\n    console.error(\"Failed to copy to clipboard:\", err);\n    return false;\n  }\n}\n"],"mappings":";;;;;;;;;;AASA,eAAsB,gBAAgB,MAAgC;AACpE,KAAI,CAAC,UAAU,WAAW,WAAW;AACnC,UAAQ,MAAM,iCAAiC;AAC/C,SAAO;;AAGT,KAAI;AACF,QAAM,UAAU,UAAU,UAAU,KAAK;AACzC,SAAO;UACA,KAAK;AACZ,UAAQ,MAAM,gCAAgC,IAAI;AAClD,SAAO"}