var e=`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 32 32" fill="currentColor" aria-hidden="true"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z"/><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z"/></svg>`,t=`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 32 32" fill="currentColor" aria-hidden="true"><path d="M13 24 4 15 5.414 13.586 13 21.171 26.586 7.586 28 9 13 24z"/></svg>`;function n(n){let r=document.createElement(`button`);r.type=`button`,r.className=`code-copy-btn`,r.title=`Copy code`,r.setAttribute(`aria-label`,`Copy code`),r.innerHTML=e;let i=null;return r.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation()}),r.addEventListener(`click`,async a=>{a.preventDefault(),a.stopPropagation();try{await navigator.clipboard.writeText(n())}catch{return}r.innerHTML=t,r.classList.add(`is-copied`),r.title=`Copied`,i&&clearTimeout(i),i=setTimeout(()=>{r.innerHTML=e,r.classList.remove(`is-copied`),r.title=`Copy code`},2e3)}),r}export{n as t};