import{S as s}from"./index-D7n5ZNak.js";async function r(t){let o="";t.indexOf("")>=0?o=t.split("")[1]:o=t;const e=document.createElement("textarea");e.value=o,document.body.appendChild(e),e.select(),document.execCommand("copy")&&(s.success("已将内容复制到您的粘贴板"),document.body.removeChild(e))}const a=(t="")=>t.indexOf("office_")!=-1,l=async(t,o)=>{if(navigator.clipboard&&navigator.permissions)await navigator.clipboard.writeText(t),o&&o();else{const e=document.createElement("textArea");e.value=t,e.style.width=0,e.style.position="fixed",e.style.left="-999px",e.style.top="10px",e.setAttribute("readonly","readonly"),document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),o&&o()}};function m(t,o,e){if(!(!t||!o))if(e)fetch(t).then(n=>n.blob()).then(n=>{const d=window.URL.createObjectURL(n),c=document.createElement("a");c.href=d,c.download=o,document.body.appendChild(c),c.click(),window.URL.revokeObjectURL(d),document.body.removeChild(c)});else{const n=document.createElement("a");n.href=t,n.download=o,n.click(),n.remove()}}export{l as a,r as c,m as d,a as i};