UNPKG

@kelvininc/ui-components

Version:
1 lines 544 B
import{i as t}from"./p-DjSNdVAB.js";function o(t){const o=document.createElement("textarea");let a=!0;o.value=t,o.style.position="fixed",document.body.appendChild(o),o.focus(),o.select();try{a=document.execCommand("copy")}catch(t){a=!1}return document.body.removeChild(o),a}async function a(a){const c=t(a)?"":a.replace(/^\s+|\s+$/gm,"");return t(navigator.clipboard)?o(c):await navigator.clipboard.writeText(c).then((()=>!0),(()=>!1))}var c=Object.freeze({__proto__:null,copyTextToClipboard:a,fallbackCopyTextToClipboard:o});export{a,c,o as f}