import*as t from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as e from"@momentum-ui/utils/lib/getColorValue";import*as s from"lit";import*as r from"lit/decorators.js";import*as i from"lit/directives/class-map.js";import*as o from"lit/directives/if-defined.js";import*as a from"lit/directives/style-map.js";import*as p from"lit/directives/until.js";import*as m from"mobx";var l,d,c={5558(t,e,s){s.d(e,{c:()=>r}),s(2245);var r,i=s(9609),o=s(4084),a=s(2927),p=s(8899),m=s(3517),l=s(9316),d=function(t,e,s,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,s,r);else for(var p=t.length-1;p>=0;p--)(i=t[p])&&(a=(o<3?i(a):o>3?i(e,s,a):i(e,s))||a);return o>3&&a&&Object.defineProperty(e,s,a),a};!function(t){let e=class extends a.LitElement{constructor(){super(...arguments),this.title="",this.src="",this.time="",this.label="Avatar",this.status="",this.clickableTimestamp=!1,this.isSelected=!1,this.self=!1}get computedAvatarType(){return void 0!==this.avatarType?this.avatarType:this.self?"self":void 0}get computedYouLabel(){return this.selfLabel||"You"}get isSelfType(){return void 0===this.avatarType?this.self:"self"===this.avatarType}timeStampClicked(){this.dispatchEvent(new CustomEvent("timestamp-clicked",{bubbles:!0,composed:!0}))}static get styles(){return[o.A,l.A]}render(){return a.html`
        <div class="md-chat-message">
          <div class="md-chat-message_avatar">
            <md-avatar
              type=${(0,m.ifDefined)(this.computedAvatarType)}
              title=${this.self?"self":this.title}
              label="${this.label}"
              src=${(0,m.ifDefined)(this.self?void 0:this.src)}
              color=${(0,m.ifDefined)(this.avatarColor)}
              size=${(0,m.ifDefined)(this.avatarSize)}
            ></md-avatar>
          </div>

          <div class="md-chat-message_content ${this.isSelected?"selected":""}">
            <div class="md-chat-message_heading">
              <div class="md-chat-message_title">
                <span>${this.isSelfType?this.computedYouLabel:this.title}</span>
              </div>
              ${this.clickableTimestamp?a.html`<md-link
                    class="md-chat-message_time"
                    @click=${t=>{t.preventDefault(),this.timeStampClicked()}}
                    >${this.time}</md-link
                  >`:a.html`<div class="md-chat-message_time" title="">${this.time}</div>`}
              <div class="md-chat-message_status" title="">${this.status}</div>
              <div class="md-chat-message_custom_content" title="">
                <slot name="custom-content"></slot>
              </div>
            </div>
            <div class="md-chat-message_text" title="">
              <slot name="message"></slot>
            </div>
          </div>
        </div>
      `}};d([(0,p.property)({type:String})],e.prototype,"title",void 0),d([(0,p.property)({type:String})],e.prototype,"src",void 0),d([(0,p.property)({type:String})],e.prototype,"time",void 0),d([(0,p.property)({type:String})],e.prototype,"label",void 0),d([(0,p.property)({type:String})],e.prototype,"status",void 0),d([(0,p.property)({type:Boolean})],e.prototype,"clickableTimestamp",void 0),d([(0,p.property)({type:Boolean})],e.prototype,"isSelected",void 0),d([(0,p.property)({type:String,reflect:!0,attribute:"self-label"})],e.prototype,"selfLabel",void 0),d([(0,p.property)({type:Boolean})],e.prototype,"self",void 0),d([(0,p.property)({type:String,reflect:!0,attribute:"avatar-color"})],e.prototype,"avatarColor",void 0),d([(0,p.property)({type:String,reflect:!0,attribute:"avatar-type"})],e.prototype,"avatarType",void 0),d([(0,p.property)({type:Number,reflect:!0,attribute:"avatar-size"})],e.prototype,"avatarSize",void 0),e=d([(0,i.w)("md-chat-message")],e),t.ELEMENT=e}(r||(r={}))},9500(e,s,r){var i,o;e.exports=(i={default:()=>t.default},o={},r.d(o,i),o)},3496(t,s,r){var i,o;t.exports=(i={default:()=>e.default},o={},r.d(o,i),o)},2927(t,e,r){var i,o;t.exports=(i={LitElement:()=>s.LitElement,css:()=>s.css,html:()=>s.html,nothing:()=>s.nothing},o={},r.d(o,i),o)},8899(t,e,s){var i,o;t.exports=(i={property:()=>r.property,query:()=>r.query,state:()=>r.state},o={},s.d(o,i),o)},4955(t,e,s){var r,o;t.exports=(r={classMap:()=>i.classMap},o={},s.d(o,r),o)},3517(t,e,s){var r,i;t.exports=(r={ifDefined:()=>o.ifDefined},i={},s.d(i,r),i)},1156(t,e,s){var r,i;t.exports=(r={styleMap:()=>a.styleMap},i={},s.d(i,r),i)},1666(t,e,s){var r,i;t.exports=(r={until:()=>p.until},i={},s.d(i,r),i)},4980(t,e,s){var r,i;t.exports=(r={action:()=>m.action,observable:()=>m.observable},i={},s.d(i,r),i)}},n={};function v(t){var e=n[t];if(void 0!==e)return e.exports;var s=n[t]={exports:{}};return c[t](s,s.exports,v),s.exports}v.m=c,l=[],v.O=(t,e,s,r)=>{if(!e){var i=1/0;for(m=0;m<l.length;m++){for(var[e,s,r]=l[m],o=!0,a=0;a<e.length;a++)(!1&r||i>=r)&&Object.keys(v.O).every(t=>v.O[t](e[a]))?e.splice(a--,1):(o=!1,r<i&&(i=r));if(o){l.splice(m--,1);var p=s();void 0!==p&&(t=p)}}return t}r=r||0;for(var m=l.length;m>0&&l[m-1][2]>r;m--)l[m]=l[m-1];l[m]=[e,s,r]},v.d=(t,e)=>{for(var s in e)v.o(e,s)&&!v.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},v.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{v as __webpack_require__};d={502:0,1745:0,4545:0,4928:0,5369:0,6060:0,6920:0,7684:0,8111:0,8115:0,8442:0},v.C=t=>{var e,s,{__webpack_esm_ids__:r,__webpack_esm_modules__:i,__webpack_esm_runtime__:o}=t,a=0;for(e in i)v.o(i,e)&&(v.m[e]=i[e]);for(o&&o(v);a<r.length;a++)s=r[a],v.o(d,s)&&d[s]&&d[s][0](),d[r[a]]=0;v.O()},v.O.j=t=>0===d[t];import*as f from"../9609.js";v.C(f);import*as y from"../4084.js";v.C(y);import*as h from"../3305.js";v.C(h);import*as u from"../4739.js";v.C(u);import*as g from"../7154.js";v.C(g);import*as b from"../9773.js";v.C(b);import*as j from"../5983.js";v.C(j);import*as _ from"../9488.js";v.C(_);import*as C from"../1821.js";v.C(C);import*as x from"../519.js";v.C(x);import*as S from"../6325.js";v.C(S);import*as O from"../4449.js";v.C(O);import*as k from"../1392.js";v.C(k);import*as T from"../1618.js";v.C(T);import*as $ from"../4621.js";v.C($);import*as D from"../9244.js";v.C(D);import*as E from"../4626.js";v.C(E);import*as L from"../9316.js";v.C(L);var w=v.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,519,6325,4449,1392,1618,4621,9244,4626,9316],()=>v(5558));const M=(w=v.O(w)).c;export{M as ChatMessage};