import{ai as t,aq as o,v as e}from"./vendor-element-plus.js?ver=3.0.6";import{bi as s,b1 as c,A as a,x as i,br as r,y as n,c5 as p,J as m}from"./vendor.js?ver=3.0.6";import{_ as d}from"./fc-bits-ui.js?ver=3.0.6";const l={class:"fcrm_item_copier_wrapper"},u={class:"fcrm_smart_url_box"},y={class:"fcrm_smart_url_text"};const _=d({name:"ItemCopier",components:{CopyDocument:o,Check:t},props:["text","showViewButton"],data:()=>({copy_success:!1}),methods:{copyItem(){this.copy_success=!1;const t=this.text;let o=!1;if(window.clipboardData&&window.clipboardData.setData)window.clipboardData.clipboardData.setData("Text",t),o=!0;else if(document.queryCommandSupported&&document.queryCommandSupported("copy")){const s=document.createElement("textarea");s.textContent=t,s.style.position="fixed",document.body.appendChild(s),s.select();try{document.execCommand("copy"),o=!0}catch(e){console.warn("Copy to clipboard failed.",e),o=!1}finally{document.body.removeChild(s)}}o?(this.copy_success=!0,this.$notify({message:this.$t("Copied to your clipboard"),position:"bottom-right",customClass:"bottom_right",type:"success"}),setTimeout(()=>{this.copy_success=!1},2e3)):this.$notify({message:this.$t("Your Browser does not support JS copy. Please copy manually"),position:"bottom-right",customClass:"bottom_right",type:"error"})},openUrl(){this.text&&window.open(this.text,"_blank")}}},[["render",function(t,o,d,_,h,b){const f=s("CopyDocument"),C=e,x=s("Check");return c(),a("div",l,[i("div",u,[i("span",y,r(d.text),1),i("button",{class:"fcrm_copy_btn",onClick:o[0]||(o[0]=(...t)=>b.copyItem&&b.copyItem(...t)),type:"button"},[h.copy_success?(c(),n(C,{key:1,class:"fcrm_check_icon"},{default:p(()=>[m(x)],void 0),_:1})):(c(),n(C,{key:0,class:"fcrm_copy_icon"},{default:p(()=>[m(f)],void 0),_:1}))])])])}]]);export{_ as I};