import{n as a,ao as s}from"./index-BMeBqg0T.chunk.mjs";import{N as o}from"./NcAvatar-YSp2ORHc-k3rtAvRh.chunk.mjs";import{V as i}from"./vue.runtime.esm-Ct3_M7aQ.chunk.mjs";import{L as n}from"./video-rmrjCz0n.chunk.mjs";const l={name:"NcUserBubbleDiv"};var u=function(){var t=this,e=t._self._c;return e("div",[t._t("trigger")],2)},p=[],m=a(l,u,p,!1,null,null);const c=m.exports,d={name:"NcUserBubble",components:{NcAvatar:o,NcPopover:s,NcUserBubbleDiv:c},props:{avatarImage:{type:String,default:void 0},user:{type:String,default:void 0},displayName:{type:String,default:void 0},showUserStatus:{type:Boolean,default:!1},url:{type:String,default:void 0,validator:t=>{try{return t=new URL(t,t?.startsWith?.("/")?window.location.href:void 0),!0}catch{return!1}}},to:{type:[String,Object],default:void 0},open:{type:Boolean,default:!1},primary:{type:Boolean,default:!1},size:{type:Number,default:20},margin:{type:Number,default:2}},emits:["click","update:open"],computed:{isPopoverComponent(){return this.popoverEmpty?"NcUserBubbleDiv":"NcPopover"},isAvatarUrl(){if(!this.avatarImage)return!1;try{return!!new URL(this.avatarImage)}catch{return!1}},isCustomAvatar(){return!!this.avatarImage},hasUrl(){return this.url&&this.url.trim()!==""},isLinkComponent(){return this.hasUrl?"a":this.to?n:"div"},popoverEmpty(){return!("default"in this.$slots)},styles(){return{content:{height:this.size+"px",lineHeight:this.size+"px",borderRadius:this.size/2+"px"},avatar:{marginInlineStart:this.margin+"px"}}}},mounted(){!this.displayName&&!this.user&&i.util.warn("[NcUserBubble] At least `displayName` or `user` property should be set.")},methods:{onOpenChange(t){this.$emit("update:open",t)},onClick(t){this.$emit("click",t)}}};var v=function(){var t=this,e=t._self._c;return e(t.isPopoverComponent,{tag:"component",staticClass:"user-bubble__wrapper",attrs:{trigger:"hover focus",shown:t.open},on:{"update:open":t.onOpenChange},scopedSlots:t._u([{key:"trigger",fn:function({attrs:r}){return[e(t.isLinkComponent,t._b({tag:"component",staticClass:"user-bubble__content",class:{"user-bubble__content--primary":t.primary},style:t.styles.content,attrs:{to:t.to,href:t.hasUrl?t.url:null},on:{click:t.onClick}},"component",r,!1),[e("NcAvatar",{staticClass:"user-bubble__avatar",style:t.styles.avatar,attrs:{url:t.isCustomAvatar&&t.isAvatarUrl?t.avatarImage:void 0,"icon-class":t.isCustomAvatar&&!t.isAvatarUrl?t.avatarImage:void 0,user:t.user,"display-name":t.displayName,size:t.size-t.margin*2,"disable-tooltip":!0,"disable-menu":!0,"show-user-status":t.showUserStatus}}),e("span",{staticClass:"user-bubble__name"},[t._v(" "+t._s(t.displayName||t.user)+" ")]),t.$slots.name?e("span",{staticClass:"user-bubble__secondary"},[t._t("name")],2):t._e()],1)]}}],null,!0)},[t._t("default")],2)},h=[],b=a(d,v,h,!1,null,"a62a9496");const N=b.exports;export{N}; //# sourceMappingURL=NcUserBubble-B3-E-5F5-PCL0TJHA.chunk.mjs.map