import{_ as u,l as b,c as r,i as t,j as p,k as h,o as n,m as _,n as m}from"./vue-9d41a690.js";const f={name:"ShareToFriends",data(){return{showModal:!1,shareUrl:null}},computed:{isMobileDevice(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}},methods:{handleShareButton(){if(navigator.share){const s=document.title,e=document.querySelector('meta[name="description"]'),d=e?"Check this out: "+e.content:"",c=s||"FutureWalker",a=d||"Check this AI & tech news platform out!";navigator.share({title:c,text:a,url:this.shareUrl}).then(()=>{}).catch(o=>{})}else this.showModal=!0},copyLink(){navigator.clipboard.writeText(this.shareUrl).then(()=>{b("Copied!",{position:"bottom-center",type:"success",timeout:1500,closeOnClick:!0,pauseOnFocusLoss:!0,pauseOnHover:!0,draggable:!0,draggablePercent:.6,showCloseButtonOnHover:!1,hideProgressBar:!1,closeButton:!0,icon:!0,rtl:!1})}).catch(s=>{})}},mounted(){this.shareUrl=window.location.href}},i=s=>(_("data-v-e7f1c1a4"),s=s(),m(),s),y={class:"d-flex",style:{height:"100%"}},g=i(()=>t("i",{class:"bi bi-share-fill"},null,-1)),k=[g],v=i(()=>t("i",{class:"bi bi-share-fill"},null,-1)),w={key:0,class:"modal fade show",id:"shareModal",tabindex:"-1","aria-labelledby":"shareModalLabel",style:{display:"block"},"aria-modal":"true",role:"dialog"},x={class:"modal-dialog modal-dialog-centered"},S={class:"modal-content"},B={class:"modal-header"},C=i(()=>t("h1",{class:"modal-title fs-5 text-black fw-bold",id:"shareModalLabel"}," Share to Friends ",-1)),M={class:"modal-body d-grid gap-2"},T=["value"],L={key:1,class:"modal-backdrop fade show"};function F(s,e,d,c,a,o){return n(),r("div",null,[t("div",y,[o.isMobileDevice?(n(),r("button",{key:0,type:"button",class:"align-self-center btn btn-link text-white ms-1 btn-lg px-1 hover-opacity",onClick:e[0]||(e[0]=(...l)=>o.handleShareButton&&o.handleShareButton(...l))},k)):(n(),r("button",{key:1,type:"button",class:"align-self-center btn btn-light ms-2 mb-0",onClick:e[1]||(e[1]=(...l)=>o.handleShareButton&&o.handleShareButton(...l))},[v,p(" Share ")]))]),a.showModal?(n(),r("div",w,[t("div",x,[t("div",S,[t("div",B,[C,t("button",{type:"button",class:"btn-close",onClick:e[2]||(e[2]=l=>a.showModal=!1),"aria-label":"Close"})]),t("div",M,[t("input",{type:"text",readonly:"",class:"form-control",value:a.shareUrl},null,8,T),t("button",{class:"btn btn-primary w-full",onClick:e[3]||(e[3]=(...l)=>o.copyLink&&o.copyLink(...l))}," Copy Link ")])])])])):h("",!0),a.showModal?(n(),r("div",L)):h("",!0)])}const O=u(f,[["render",F],["__scopeId","data-v-e7f1c1a4"]]);export{O as default};
