async function t(t,e=null){if(null!=navigator.clipboard?.write){const n={"text/plain":new Blob([t],{type:"text/plain"})};null!=e&&(n["text/html"]=new Blob([e],{type:"text/html"})),await navigator.clipboard.write([new ClipboardItem(n)])}else if(null!=document.execCommand){const n=n=>{n.clipboardData.setData("text/plain",t),null!=e&&n.clipboardData.setData("text/html",e),n.preventDefault()};document.addEventListener("copy",n),document.execCommand("copy"),document.removeEventListener("copy",n)}else await(navigator.clipboard?.writeText(t))}function e(t){return{text:t.join("\n"),html:n(t)}}function n(t){return 0===t.length?"":1===t.length?`<code>${t[0]}</code>`:`<pre>${t.join("<br>")}</pre>`}export{t as copyToClipboard,n as formatLinesOfCodeToHtml,e as prepareLinesOfCodeForClipboard};
//# sourceMappingURL=clipboard.js.map
