import{V as s}from"./dav-D-0Zsvk_.chunk.mjs";import{L as o}from"./video-B2Zidy_E.chunk.mjs";import{n as r}from"./index-VDTWCae_.chunk.mjs";import{N as i}from"./NcAvatar-BBqomFJ3-XdOuYWZi.chunk.mjs";import{a as n}from"./NcActions-JnumflF4-wQHpCaHI.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=r(l,u,p,!1,null,null);const c=m.exports,d={name:"NcUserBubble",components:{NcAvatar:i,NcPopover:n,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 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?o:"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&&s.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:a}){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",a,!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=r(d,v,h,!1,null,"7942d6b6");const C=b.exports;export{C as N};
//# sourceMappingURL=NcUserBubble-CuCNjhc8-zjOyCAzw.chunk.mjs.map
