"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("./feed-item-row-constants.cjs"),r=require("../../common/mixins/modal.cjs"),o=require("@dialpad/dialtone-icons/vue2"),n=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),d=require("../badge/badge.cjs"),c=require("../list-item/list-item.cjs"),l=require("../lazy-show/lazy-show.cjs"),_=require("../avatar/avatar.cjs"),u={name:"DtRecipeFeedItemRow",components:{DtAvatar:_.default,DtLazyShow:l.default,DtListItem:c.default,DtBadge:d.default,DtIconUser:o.DtIconUser},mixins:[r.default],inheritAttrs:!1,props:{avatarSeed:{type:String,default:null},showHeader:{type:Boolean,default:!1},avatarImageUrl:{type:String,default:""},displayName:{type:String,default:""},noInitials:{type:Boolean,default:!1},time:{type:String,default:""},shortTime:{type:String,default:""},labelText:{type:String,default:""},isActive:{type:Boolean,default:!1},state:{type:String,default:i.DEFAULT_FEED_ROW_STATE,validator:a=>Object.keys(i.FEED_ROW_STATE_BACKGROUND_COLOR).includes(a)}},emits:["hover","focus","keydown"],data(){return{transitionActive:!1}},computed:{feedListeners(){return{...this.$listeners,mouseenter:()=>this.setHover(!0),mouseleave:()=>this.setHover(!1),focusin:()=>this.setFocus(!0),focusout:()=>this.setFocus(!1),transitionend:()=>this.transitionComplete(),keydown:a=>{switch(a.code){case"Tab":this.trapFocus(a);break}this.$emit("keydown",a)}}},listItemClasses(){return["d-recipe-feed-item-row",{"d-recipe-feed-item-row--active":this.isActive&&this.state===i.DEFAULT_FEED_ROW_STATE},{"d-recipe-feed-item-row__state-transition":this.transitionActive},i.FEED_ROW_STATE_BACKGROUND_COLOR[this.state]]}},watch:{state:{immediate:!0,handler:function(a){a!==i.DEFAULT_FEED_ROW_STATE&&(this.transitionActive=!0)}}},methods:{transitionComplete(){this.state===i.DEFAULT_FEED_ROW_STATE&&(this.transitionActive=!1)},trapFocus(a){this.focusTrappedTabPress(a)},setFocus(a){this.$emit("focus",a)},setHover(a){this.$emit("hover",a)}}};var m=function(){var e=this,t=e._self._c;return t("dt-list-item",e._g(e._b({ref:"FeedItemRef",class:e.listItemClasses,attrs:{"navigation-type":"none","data-qa":"dt-recipe-feed-item-row"},scopedSlots:e._u([{key:"left",fn:function(){return[e.showHeader?t("div",{staticClass:"d-recipe-feed-item-row__avatar-container"},[e._t("avatar",function(){return[t("dt-avatar",{attrs:{"full-name":e.displayName,"image-src":e.avatarImageUrl,"image-alt":"",seed:e.avatarSeed},scopedSlots:e._u([e.noInitials?{key:"icon",fn:function({iconSize:s}){return[t("dt-icon-user",{attrs:{size:s}})]}}:null],null,!0)})]})],2):e._e(),e.showHeader?e._e():t("span",{directives:[{name:"show",rawName:"v-show",value:e.isActive,expression:"isActive"}],staticClass:"d-recipe-feed-item-row__left-time",attrs:{"data-qa":"dt-recipe-feed-item-row--left-time"}},[e._v(" "+e._s(e.shortTime)+" ")])]},proxy:!0},{key:"bottom",fn:function(){return[e.$slots.reactions?t("div",{staticClass:"d-recipe-feed-item-row__reactions",attrs:{"data-qa":"dt-recipe-feed-item-row--reactions"}},[e._t("reactions")],2):e._e(),e.$slots.threading?t("div",{staticClass:"d-recipe-feed-item-row__threading"},[e._t("threading")],2):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:e.isActive,expression:"isActive"}],staticClass:"d-recipe-feed-item-row__menu",attrs:{"data-qa":"dt-recipe-feed-item-row--menu"}},[t("dt-lazy-show",{attrs:{appear:!0,transition:"fade",show:e.isActive}},[e._t("menu")],2)],1)]},proxy:!0}],null,!0)},"dt-list-item",e.$attrs,!1),e.feedListeners),[t("article",{staticClass:"d-recipe-feed-item-row__content"},[e.showHeader?t("div",{staticClass:"d-recipe-feed-item-row__header",attrs:{"data-qa":"dt-recipe-feed-item-row--header"}},[e._t("displayName",function(){return[t("p",{staticClass:"d-recipe-feed-item-row__header-name"},[e._v(" "+e._s(e.displayName)+" ")])]}),t("time",{staticClass:"d-recipe-feed-item-row__header-time"},[e._v(" "+e._s(e.time)+" ")]),e.labelText?t("dt-badge",{attrs:{text:e.labelText}}):e._e()],2):e._e(),t("span",{attrs:{"data-qa":"dt-recipe-feed-item-row--content"}},[e._t("default")],2),e.$slots.attachment?t("div",{staticClass:"d-recipe-feed-item-row__attachment",attrs:{"data-qa":"dt-recipe-feed-item-row--attachment"}},[e._t("attachment")],2):e._e()])])},f=[],p=n.n(u,m,f);const h=p.exports;exports.default=h;
//# sourceMappingURL=feed-item-row.cjs.map
