import*as t from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as e from"@momentum-ui/utils/lib/getColorValue";import*as i from"lit";import*as o from"lit/decorators.js";import*as s from"lit/directives/class-map.js";import*as r from"lit/directives/if-defined.js";import*as a from"lit/directives/style-map.js";import*as l from"lit/directives/until.js";import*as p from"mobx";var n,d,m={7901(t,e,i){var o,s=i(9609),r=i(4084),a=i(2927),l=i(8899),p=i(4955),n=i(3517),d=i(4958),m=i(3543),h=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};!function(t){let e=class extends a.LitElement{constructor(){super(...arguments),this.ariaLabel="",this.color="",this.bgColor="",this.textColor="",this.height="",this.width="",this.outlined=!1,this.compact=!1,this.circle=!1,this.circleSize=d.zj[40],this.small=!1,this.split=!1,this.disabled=!1,this.tabIndexing="",this.ariaHiddenSplits="",this.renderBgColor=()=>this.bgColor?`background-color: ${this.bgColor};`:a.nothing,this.renderTextColor=()=>this.textColor?`color: ${this.textColor};`:a.nothing,this.renderHeight=()=>this.height?`height: ${this.height};`:a.nothing,this.renderWidth=()=>this.width?`width: ${this.width};`:a.nothing,this.getStyles=()=>this.bgColor||this.textColor||this.height||this.width?a.html`
          <style>
            :host .md-badge {
              ${this.renderBgColor()};
              ${this.renderTextColor()};
              ${this.renderHeight()};
              ${this.renderWidth()};
            }
          </style>
        `:a.nothing}static get styles(){return[r.A,m.A]}get computedAriaHiddenSplits(){return"true"===this.ariaHiddenSplits||"false"!==this.ariaHiddenSplits&&void 0}get computedTabIndex(){const t=parseInt(this.tabIndexing);return isNaN(t)?void 0:t}render(){const t={"md-badge--circle":this.circle,[`md-badge--circle-${this.circleSize}`]:this.circle,"md-badge--split":this.split,"md-badge--compact":this.compact,"md-badge--small":this.small||24===this.size,[`md-badge--size-${this.size}`]:!!this.size&&24!==this.size,"md-badge--outline":this.outlined,"md-badge--disabled":this.disabled,[`md-badge--${this.color}`]:!this.disabled&&this.color};return a.html`
        ${this.getStyles()}
        <span
          tabindex=${(0,n.ifDefined)(this.computedTabIndex)}
          part="badge"
          class="md-badge ${(0,p.classMap)(t)}"
          aria-label=${this.ariaLabel}
        >
          ${this.split?(()=>a.html`
          <slot
            aria-hidden=${(0,n.ifDefined)(this.computedAriaHiddenSplits)}
            name="split-left"
            class="split split-left"
          ></slot>
          <span aria-hidden="true" class="split-separator"> | </span>
          <slot
            aria-hidden=${(0,n.ifDefined)(this.computedAriaHiddenSplits)}
            name="split-right"
            class="split split-right"
          ></slot>
        `)():a.nothing}
          <slot></slot>
        </span>
      `}};h([(0,l.property)({type:String})],e.prototype,"ariaLabel",void 0),h([(0,l.property)({type:String})],e.prototype,"color",void 0),h([(0,l.property)({type:String})],e.prototype,"bgColor",void 0),h([(0,l.property)({type:String})],e.prototype,"textColor",void 0),h([(0,l.property)({type:String})],e.prototype,"height",void 0),h([(0,l.property)({type:String})],e.prototype,"width",void 0),h([(0,l.property)({type:Boolean})],e.prototype,"outlined",void 0),h([(0,l.property)({type:Boolean})],e.prototype,"compact",void 0),h([(0,l.property)({type:Boolean})],e.prototype,"circle",void 0),h([(0,l.property)({type:Number,attribute:"circle-size"})],e.prototype,"circleSize",void 0),h([(0,l.property)({type:Number})],e.prototype,"size",void 0),h([(0,l.property)({type:Boolean})],e.prototype,"small",void 0),h([(0,l.property)({type:Boolean})],e.prototype,"split",void 0),h([(0,l.property)({type:Boolean})],e.prototype,"disabled",void 0),h([(0,l.property)({type:String})],e.prototype,"tabIndexing",void 0),h([(0,l.property)({type:String})],e.prototype,"ariaHiddenSplits",void 0),e=h([(0,s.w)("md-badge")],e),t.ELEMENT=e}(o||(o={}))},1479(t,e,i){i.d(e,{L:()=>o}),i(2245),i(7901),i(1821);var o,s=i(9609),r=i(4084),a=i(2927),l=i(8899),p=i(4955),n=i(3517),d=i(9244),m=i(5076),h=i(8634),c=function(t,e,i,o){var s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};!function(t){let e=class extends a.LitElement{constructor(){super(...arguments),this.mediaType=d.r.TELEPHONY,this.status="",this.popovertitle="",this.queue="",this.queueTimeLabel="",this.accepted=!1,this.displayOnlyTitle=!1,this.quantity=0,this.lastmessage="",this.selected=!1,this.disabled=!1,this.customAriaLabel="",this.iconSrc="",this.tabIndexForContainer="0",this.isRestyle=!1,this.displayTitle="",this.titleValue="",this.itemTitleValue="",this.additionEmptyMargin=!1}get title(){return this.displayTitle}set title(t){this.titleValue=t,this.updateTitle()}get itemTitle(){return this.displayTitle}set itemTitle(t){this.itemTitleValue=t,this.updateTitle()}updateTitle(){this.itemTitleValue?this.displayTitle=this.itemTitleValue:this.displayTitle=this.titleValue}handleClick(t){this.dispatchEvent(new CustomEvent("taskitem-click",{composed:!0,bubbles:!0,detail:{srcEvent:t}})),this.blur()}handleKeyDown(t){this.dispatchEvent(new CustomEvent("taskitem-keydown",{detail:{key:t.code},bubbles:!0,composed:!0}))}getAriaLabel(){var t,e,i,o;if(this.customAriaLabel)return this.customAriaLabel;let s=this.queue;if(!s){const i=this.querySelector('[slot="queue"]');if(i){s=null!==(e=null===(t=i.textContent)||void 0===t?void 0:t.trim())&&void 0!==e?e:i.innerText.trim();const o=/(?:([01]?\d|2[0-3]):)?([0-5]?\d):([0-5]?\d)/.exec(s);if(o){const[,t=0,e,i]=o.map(Number);(new Date).setHours(t,e,i),s=s.replace(/(?:([01]?\d|2[0-3]):)?([0-5]?\d):([0-5]?\d)/,`${t?t+" hours ":""}${e} minutes ${i} seconds`)}}}const r=this.querySelector('[slot="queue-time"]');let a=this.queueTimeLabel;return r&&(a+=`${null!==(o=null===(i=r.textContent)||void 0===i?void 0:i.trim())&&void 0!==o?o:r.innerText.trim()}`),`${this.mediaType} ${this.status} ${this.popovertitle} ${this.itemTitle} ${s} ${a} ${this.quantity?this.quantity:""} ${this.lastmessage}`}static get styles(){return[r.A,h.A]}get sanitizedTabIndexForContainer(){var t;return null!==(t=parseInt(this.tabIndexForContainer))&&void 0!==t?t:0}handleAdditionSlotChange(){var t;const e=(null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".md-taskitem__addition")).getBoundingClientRect();this.additionEmptyMargin=0===e.width&&0===e.height}render(){return a.html`
        <div
          part="task-item-container"
          class="md-taskitem ${(0,p.classMap)({selected:this.selected})}"
          tabindex=${this.sanitizedTabIndexForContainer}
          @click=${t=>this.handleClick(t)}
          @keydown=${t=>this.handleKeyDown(t)}
          aria-label=${this.getAriaLabel()}
          aria-disabled=${(0,n.ifDefined)(this.disabled||void 0)}
        >
          <div class="md-taskitem__mediatype">
            ${(0,m.i0)(this.isRestyle,this.mediaType,this.selected,this.status,this.iconSrc)}
            ${this.status&&!this.isRestyle?a.html` <span class=${`md-taskitem__status ${this.status}`}> ${(0,m.LG)(this.status)} </span> `:a.nothing}
          </div>
          <div class="md-taskitem__content" part="task-item-content">
            ${this.popovertitle?a.html`
                  <span class="md-taskitem__content_popover_title"
                    ><md-tooltip placement="bottom" slot-to-tooltip>${this.popovertitle}</md-tooltip></span
                  >
                `:a.nothing}
            ${this.itemTitle?a.html`
                  <span
                    class="md-taskitem__content_title ${(0,p.classMap)({mainTitle:!this.popovertitle,"display-only-title":this.displayOnlyTitle})}"
                    ><md-tooltip placement="bottom" slot-to-tooltip>${this.itemTitle}</md-tooltip></span
                  >
                `:a.html`
                  <span class="md-taskitem__content_popover_title popover-item-title"><slot name="title"></slot></span>
                `}
            <div class="md-taskitem__content_inner">
              ${this.displayOnlyTitle?a.nothing:a.html`
                    <span class="md-taskitem__content_queue">
                      <md-tooltip placement="bottom" slot-to-tooltip>
                        ${this.queue.length>0?this.queue:a.html` <slot name="queue"></slot> `}
                      </md-tooltip>
                    </span>
                  `}
              ${this.queueTimeLabel.length>0||this.querySelector('[slot="queue-time"]')?a.html`
                    <span class="md-taskitem__content_queue_time">
                      <div class="md-taskitem__content_queue_time_dot"></div>
                      ${this.queueTimeLabel}
                      <slot name="queue-time"></slot>
                    </span>
                  `:a.nothing}
            </div>
            ${this.lastmessage?a.html`
                  <span class="md-taskitem__content_chat">
                    <span class="new-chat_massages">
                      <md-tooltip placement="bottom" slot-to-tooltip> ${this.lastmessage} </md-tooltip></span
                    >
                  </span>
                `:a.nothing}
            ${this.lastmessage?a.nothing:a.html` <slot name="lastmessage"></slot> `}
          </div>
          <div class="md-taskitem__addition ${(0,p.classMap)({empty_addition:this.additionEmptyMargin})}">
            <slot @slotchange=${this.handleAdditionSlotChange}></slot>
            ${(0,m.Um)(this.quantity,this.isRestyle,this)}
          </div>
        </div>
      `}};c([(0,l.property)({type:String})],e.prototype,"mediaType",void 0),c([(0,l.property)({type:String})],e.prototype,"status",void 0),c([(0,l.property)({type:String})],e.prototype,"popovertitle",void 0),c([(0,l.property)({type:String})],e.prototype,"queue",void 0),c([(0,l.property)({type:String,attribute:"queue-time-label"})],e.prototype,"queueTimeLabel",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"accepted",void 0),c([(0,l.property)({type:Boolean,attribute:"display-only-title"})],e.prototype,"displayOnlyTitle",void 0),c([(0,l.property)({type:Number})],e.prototype,"quantity",void 0),c([(0,l.property)({type:String})],e.prototype,"lastmessage",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"selected",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"disabled",void 0),c([(0,l.property)({type:String})],e.prototype,"customAriaLabel",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSrc",void 0),c([(0,l.property)({type:String})],e.prototype,"tabIndexForContainer",void 0),c([(0,l.property)({type:Boolean,attribute:"is-restyle"})],e.prototype,"isRestyle",void 0),c([(0,l.property)({type:String,reflect:!0})],e.prototype,"title",null),c([(0,l.property)({type:String,reflect:!0,attribute:"item-title"})],e.prototype,"itemTitle",null),c([(0,l.state)()],e.prototype,"additionEmptyMargin",void 0),e=c([(0,s.w)("md-task-item")],e),t.ELEMENT=e}(o||(o={}))},9500(e,i,o){var s,r;e.exports=(s={default:()=>t.default},r={},o.d(r,s),r)},3496(t,i,o){var s,r;t.exports=(s={default:()=>e.default},r={},o.d(r,s),r)},2927(t,e,o){var s,r;t.exports=(s={LitElement:()=>i.LitElement,css:()=>i.css,html:()=>i.html,nothing:()=>i.nothing},r={},o.d(r,s),r)},8899(t,e,i){var s,r;t.exports=(s={property:()=>o.property,query:()=>o.query,state:()=>o.state},r={},i.d(r,s),r)},4955(t,e,i){var o,r;t.exports=(o={classMap:()=>s.classMap},r={},i.d(r,o),r)},3517(t,e,i){var o,s;t.exports=(o={ifDefined:()=>r.ifDefined},s={},i.d(s,o),s)},1156(t,e,i){var o,s;t.exports=(o={styleMap:()=>a.styleMap},s={},i.d(s,o),s)},1666(t,e,i){var o,s;t.exports=(o={until:()=>l.until},s={},i.d(s,o),s)},4980(t,e,i){var o,s;t.exports=(o={action:()=>p.action,observable:()=>p.observable},s={},i.d(s,o),s)}},h={};function c(t){var e=h[t];if(void 0!==e)return e.exports;var i=h[t]={exports:{}};return m[t](i,i.exports,c),i.exports}c.m=m,n=[],c.O=(t,e,i,o)=>{if(!e){var s=1/0;for(p=0;p<n.length;p++){for(var[e,i,o]=n[p],r=!0,a=0;a<e.length;a++)(!1&o||s>=o)&&Object.keys(c.O).every(t=>c.O[t](e[a]))?e.splice(a--,1):(r=!1,o<s&&(s=o));if(r){n.splice(p--,1);var l=i();void 0!==l&&(t=l)}}return t}o=o||0;for(var p=n.length;p>0&&n[p-1][2]>o;p--)n[p]=n[p-1];n[p]=[e,i,o]},c.d=(t,e)=>{for(var i in e)c.o(e,i)&&!c.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},c.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{c as __webpack_require__};d={502:0,1745:0,4545:0,4928:0,5369:0,6060:0,6920:0,7901:0,8111:0,8115:0,8339:0,8442:0},c.C=t=>{var e,i,{__webpack_esm_ids__:o,__webpack_esm_modules__:s,__webpack_esm_runtime__:r}=t,a=0;for(e in s)c.o(s,e)&&(c.m[e]=s[e]);for(r&&r(c);a<o.length;a++)i=o[a],c.o(d,i)&&d[i]&&d[i][0](),d[o[a]]=0;c.O()},c.O.j=t=>0===d[t];import*as y from"../9609.js";c.C(y);import*as u from"../4084.js";c.C(u);import*as g from"../3305.js";c.C(g);import*as v from"../4739.js";c.C(v);import*as b from"../7154.js";c.C(b);import*as f from"../9773.js";c.C(f);import*as _ from"../5983.js";c.C(_);import*as $ from"../9488.js";c.C($);import*as C from"../1821.js";c.C(C);import*as T from"../519.js";c.C(T);import*as x from"../6325.js";c.C(x);import*as S from"../4449.js";c.C(S);import*as j from"../1392.js";c.C(j);import*as k from"../1618.js";c.C(k);import*as q from"../4621.js";c.C(q);import*as w from"../4626.js";c.C(w);import*as L from"../3543.js";c.C(L);import*as O from"../861.js";c.C(O);import*as E from"../4958.js";c.C(E);var A=c.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,519,6325,4449,1392,1618,4621,4626,3543,861,4958],()=>c(1479));const B=(A=c.O(A)).L;export{B as TaskItem};