function s(e={text:null,message:"Copied!"}){return{onClipboard:!1,text:e.text,message:e.message||"Copied!",init(){this.message=this.$el.dataset.message||this.message},clipboard:{"@click"(){this.onClipboardClick()}},copy(){let t=this.text;typeof t=="function"&&(t=t()),typeof t=="object"&&(t=JSON.stringify(t));let i=()=>{setTimeout(()=>{this.onClipboard=!1},500)};window.navigator.clipboard.writeText(t).then(i),window.toastr.info(this.message)},onClipboardClick(){this.onClipboard=!0,this.copy()}}}export{s as c};
