import*as e from"@momentum-ui/icons/data/momentumUiIconsNames.json";import*as t from"@momentum-ui/utils/lib/getColorValue";import*as s from"@popperjs/core/lib/modifiers/arrow";import*as i from"@popperjs/core/lib/modifiers/flip";import*as o from"@popperjs/core/lib/modifiers/offset";import*as r from"@popperjs/core/lib/modifiers/preventOverflow";import*as a from"@popperjs/core/lib/popper-lite";import*as d from"lit";import*as l from"lit/decorators.js";import*as n from"lit/directives/class-map.js";import*as c from"lit/directives/if-defined.js";import*as p from"lit/directives/repeat.js";import*as m from"lit/directives/style-map.js";import*as h from"mobx";var u,f,v={1499(e,t,s){s.d(t,{Z:()=>i}),s(5983),s(23),s(1821),s(6131),s(8552),s(708),s(9613);var i,o=s(9609),r=s(4084),a=s(2927),d=s(2577),l=s(2900),n=s(4242),c=s(8899),p=function(e,t,s,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var d=e.length-1;d>=0;d--)(o=e[d])&&(a=(r<3?o(a):r>3?o(t,s,a):o(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a};!function(e){let t=class extends a.LitElement{constructor(){super(...arguments),this.title="title",this.subtitle="",this.id="",this.info="",this.infoAriaLabel="Card Info",this.menuAriaLabel="Card Menu",this.menuOptions=[]}static get styles(){return[r.A,n.A]}handleCardClick(){this.dispatchEvent(new CustomEvent("card-click",{detail:{id:this.id},bubbles:!0,composed:!0}))}handleCardKeyDown(e){e.code!==l.Uz.Enter&&e.code!==l.Uz.Space||this.dispatchEvent(new CustomEvent("card-keydown",{detail:{id:this.id},bubbles:!0,composed:!0}))}handleCardMenuEvent(e,t){e.stopPropagation();const s=t.toLowerCase();this.dispatchEvent(new CustomEvent("card-menu-click",{detail:{id:this.id,type:s},bubbles:!0,composed:!0}))}handleCardMenuKeyDown(e,t){e.preventDefault(),this.dispatchEvent(new CustomEvent("card-menu-keydown",{detail:{id:this.id,type:t.toLowerCase(),keyCode:e.code},bubbles:!0,composed:!0}))}render(){return a.html`
        <div
          class="md-card"
          id="${this.id}"
          part="card"
          tabindex="0"
          @click=${()=>this.handleCardClick()}
          @keydown=${e=>this.handleCardKeyDown(e)}
        >
          <div class="md-card-header">
            <slot name="card-header-aside">
              <md-favorite value="${"card-"+this.id}"></md-favorite>
            </slot>
            <div class="md-card-header-title">
              <slot name="card-header-title">
                <h1>${this.title}</h1>
                <h2>${this.subtitle}</h2>
              </slot>
            </div>
            <div class="md-card-header-actions">
              ${this.info?a.html`
                    <md-tooltip message="${this.info}" placement="bottom">
                      <md-button
                        ariaLabel="${this.infoAriaLabel}"
                        class="md-card-info-icon"
                        color="color-none"
                        size="size-none"
                      >
                        <md-icon slot="icon" name="info-circle-bold" size="16" iconSet="momentumDesign"></md-icon>
                      </md-button>
                    </md-tooltip>
                  `:a.nothing}
              ${this.menuOptions.length?a.html`
                    <md-menu-overlay class="md-card-menu" placement="bottom-start">
                      <md-button
                        ariaLabel="${this.menuAriaLabel}"
                        class="md-card-menu-icon"
                        color="color-none"
                        size="size-none"
                        slot="menu-trigger"
                      >
                        <md-icon slot="icon" name="more-adr-bold" size="16" iconSet="momentumDesign"></md-icon>
                      </md-button>
                      <div class="md-card-menu-list-items" style="width: 100%;">
                        <md-list>
                          ${(0,d.repeat)(this.menuOptions,(e,t)=>a.html`
                              <md-list-item
                                class="${"menu-item-"+t}"
                                slot="list-item"
                                @click=${t=>this.handleCardMenuEvent(t,e)}
                                @keydown=${t=>this.handleCardMenuKeyDown(t,e)}
                                >${e}</md-list-item
                              >
                            `)}
                        </md-list>
                      </div>
                    </md-menu-overlay>
                  `:a.nothing}
            </div>
          </div>
          <div class="md-card-content">
            <slot name="content"></slot>
          </div>
          <div class="md-card-footer">
            <slot name="footer"> </slot>
          </div>
        </div>
      `}};p([(0,c.property)({type:String})],t.prototype,"title",void 0),p([(0,c.property)({type:String})],t.prototype,"subtitle",void 0),p([(0,c.property)({type:String})],t.prototype,"id",void 0),p([(0,c.property)({type:String})],t.prototype,"info",void 0),p([(0,c.property)({type:String,attribute:"info-aria-label"})],t.prototype,"infoAriaLabel",void 0),p([(0,c.property)({type:String,attribute:"menu-aria-label"})],t.prototype,"menuAriaLabel",void 0),p([(0,c.property)({type:Array})],t.prototype,"menuOptions",void 0),t=p([(0,o.w)("md-card")],t),e.ELEMENT=t}(i||(i={}))},23(e,t,s){s(1821);var i,o=s(2900),r=s(7704),a=s(9609),d=s(4084),l=s(2927),n=s(8899),c=s(4955),p=s(3517),m=s(6816),h=function(e,t,s,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var d=e.length-1;d>=0;d--)(o=e[d])&&(a=(r<3?o(a):r>3?o(t,s,a):o(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a};!function(e){let t=class extends((0,r.yC)(l.LitElement)){constructor(){super(...arguments),this.disabled=!1,this.checked=!1,this.value="Select favorite",this.id="",this.label="Favorite"}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.handleElectKeyDown),this.addEventListener("click",this.handleFavorite)}static get styles(){return[d.A,m.A]}handleFavorite(){this.disabled||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("favorite-toggle",{detail:{active:this.checked,value:this.value},bubbles:!0,composed:!0})))}handleElectKeyDown(e){e.code!==o.Uz.Enter&&e.code!==o.Uz.Space||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("favorite-keydown",{detail:{active:this.checked,value:this.value},bubbles:!0,composed:!0})))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.handleElectKeyDown),this.removeEventListener("click",this.handleFavorite)}get favoriteClassMap(){return{"md-favorite--active":this.checked,"md-favorite--disabled":this.disabled}}render(){return l.html`
        <label
          for="favorite-checkbox"
          id="${this.id}"
          class="md-favorite ${(0,c.classMap)(this.favoriteClassMap)}"
          tabindex="0"
        >
          <input
            type="checkbox"
            aria-label=${(0,p.ifDefined)(this.label.length?this.label:void 0)}
            value=${this.value}
            ?checked=${this.checked}
            ?disabled=${this.disabled}
            aria-hidden="true"
            name="favorite-checkbox"
          />
          <md-icon
            name="${this.checked?"favorite-filled":"favorite-bold"}"
            iconSet="momentumDesign"
            size="16"
          ></md-icon>
        </label>
      `}};h([(0,n.property)({type:Boolean})],t.prototype,"disabled",void 0),h([(0,n.property)({type:Boolean})],t.prototype,"checked",void 0),h([(0,n.property)({type:String})],t.prototype,"value",void 0),h([(0,n.property)({type:String})],t.prototype,"id",void 0),h([(0,n.property)({type:String})],t.prototype,"label",void 0),t=h([(0,a.w)("md-favorite")],t),e.ELEMENT=t}(i||(i={}))},6131(e,t,s){var i,o=s(2900),r=s(7704),a=s(9609),d=s(4084),l=s(2927),n=s(8899),c=s(3517),p=s(740),m=function(e,t,s,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var d=e.length-1;d>=0;d--)(o=e[d])&&(a=(r<3?o(a):r>3?o(t,s,a):o(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a};!function(e){let t=class extends((0,r.Io)(l.LitElement)){constructor(){super(...arguments),this.alignment="vertical",this.label="option",this.activated=-1,this._role="listbox"}firstUpdated(e){super.firstUpdated(e),"none"!==this._role&&this.setAttribute("aria-label",this.label)}notifySelectedChange(){this.dispatchEvent(new CustomEvent("list-item-change",{detail:{selected:this.selected},bubbles:!0,composed:!0}))}isFocusable(e){return!e.hasAttribute("hidden")}connectedCallback(){super.connectedCallback();const e=this.getAttribute("role");this._role=e||"listbox",this.removeAttribute("role"),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("click",this.handleClick)}findListItemIndex(e){const t=e.composedPath();return this.slotted.findIndex(e=>t.includes(e))}switchListItemOnArrowPress(e,t=1){const s=super.getAvailableSelectedIndex(e,t);-1!==s&&(this.selected=s)}setActivated(e){-1!==e&&(this.activated=e,this.selected=e,this.setSelected(e))}findSelectedListItemIndex(){return this.slotted.findIndex(e=>e.selected)}setSelected(e){const t=this.findSelectedListItemIndex();-1!==t&&t!==e&&(this.slotted[t].selected=!1),this.slotted[e]&&(this.slotted[e].selected=!0)}updated(e){super.updated(e),e.has("slotted")&&this.setActivated(this.activated),e.has("activated")&&this.setActivated(this.activated),e.has("label")&&"none"!==this._role&&this.setAttribute("aria-label",this.label)}isListItemDisabled(e){var t;const s=this.slotted[e];return null===(t=null==s?void 0:s.disabled)||void 0===t||t}handleClick(e){const t=this.findListItemIndex(e);-1!==t&&(this.isListItemDisabled(t)||(this.setActivated(t),this.notifySelectedChange()))}shouldElementHandleKey(e,t){if(e.hasAttribute("data-handles-keys")||e.closest("[data-handles-keys]"))return!0;const s=e.tagName.toLowerCase(),i=e.nodeName.toLowerCase(),r="input"===i||"textarea"===i||"select"===i,a=e.getAttribute("role"),d=e.hasAttribute("contenteditable")||"false"===e.getAttribute("aria-readonly"),l=[o.Uz.ArrowUp,o.Uz.ArrowDown,o.Uz.ArrowLeft,o.Uz.ArrowRight],n=[o.Uz.Enter,o.Uz.Space];return l.includes(t)?r||d||"textbox"===a||"combobox"===a||"listbox"===a||"menu"===a||"slider"===a||"scrollbar"===a||"tablist"===a||s.startsWith("md-")&&("md-input"===s||"md-select"===s||"md-combobox"===s):n.includes(t)?"button"===a||"link"===a||"checkbox"===a||"radio"===a||"button"===s||"a"===s||"md-button"===s||"md-checkbox"===s||"md-radio"===s||r:(t===o.Uz.Home||t===o.Uz.End)&&(r||d||"textbox"===a||"md-input"===s)}handleKeyDown(e){const t=e.composedPath()[0];if(this.shouldElementHandleKey(t,e.code))return;const{code:s}=e;switch(s){case o.Uz.End:this.switchListItemOnArrowPress(this.slotted.length-1);break;case o.Uz.Home:this.switchListItemOnArrowPress(0);break;case o.Uz.ArrowUp:case o.Uz.ArrowLeft:e.preventDefault(),0===this.selected?this.switchListItemOnArrowPress(this.slotted.length-1,-1):this.switchListItemOnArrowPress(this.selected-1,-1);break;case o.Uz.ArrowDown:case o.Uz.ArrowRight:e.preventDefault(),this.selected===this.slotted.length-1?this.switchListItemOnArrowPress(0):this.switchListItemOnArrowPress(this.selected+1);break;case o.Uz.Enter:case o.Uz.Space:this.isListItemDisabled(this.selected)||(this.setActivated(this.selected),this.notifySelectedChange())}}get slotElement(){return this.listItemSlot}static get styles(){return[d.A,p.A]}render(){return l.html`
        <ul role=${(0,c.ifDefined)("list"!==this._role?this._role:void 0)} class="md-list" part="list">
          <slot name="list-item"></slot>
        </ul>
      `}};m([(0,n.property)({type:String,reflect:!0})],t.prototype,"alignment",void 0),m([(0,n.property)({type:String})],t.prototype,"label",void 0),m([(0,n.property)({type:Number,reflect:!0})],t.prototype,"activated",void 0),m([(0,n.query)("slot[name='list-item']")],t.prototype,"listItemSlot",void 0),t=m([(0,a.w)("md-list")],t),e.ELEMENT=t}(i||(i={}))},8552(e,t,s){var i,o=s(7704),r=s(9609),a=s(4084),d=s(2927),l=s(8899),n=s(4955),c=s(740),p=function(e,t,s,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var d=e.length-1;d>=0;d--)(o=e[d])&&(a=(r<3?o(a):r>3?o(t,s,a):o(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a};!function(e){let t=class extends((0,o.yC)(d.LitElement)){constructor(){super(...arguments),this.role="option",this.tabIndex=-1,this.shape="rounded",this._disabled=!1,this._selected=!1}get disabled(){return this._disabled}set disabled(e){const t=this._disabled;this._disabled=e,this.setAttribute("aria-disabled",`${e}`),this.requestUpdate("disabled",t)}get selected(){return this._selected}set selected(e){const t=this._selected;this._selected=e,"option"===this.role&&this.setAttribute("aria-selected",`${e}`),this.requestUpdate("selected",t)}get listItemTemplateClassMap(){return{[`md-list-item--${this.shape}`]:!!this.shape}}static get styles(){return[a.A,c.A]}render(){return d.html`
        <div class="md-list-item ${(0,n.classMap)(this.listItemTemplateClassMap)}" part="list-item">
          <slot></slot>
        </div>
      `}};p([(0,l.property)({type:String,reflect:!0})],t.prototype,"role",void 0),p([(0,l.property)({type:Number,reflect:!0})],t.prototype,"tabIndex",void 0),p([(0,l.property)({type:String,reflect:!0})],t.prototype,"shape",void 0),p([(0,l.property)({type:Boolean,reflect:!0})],t.prototype,"disabled",null),p([(0,l.property)({type:Boolean,reflect:!0})],t.prototype,"selected",null),t=p([(0,r.w)("md-list-item")],t),e.ELEMENT=t}(i||(i={}))},7704(e,t,s){s.d(t,{Io:()=>r.I,UM:()=>o.U,yC:()=>i.y}),s(2364);var i=s(3203),o=(s(9938),s(5201)),r=s(4781);s(608)},9500(t,s,i){var o,r;t.exports=(o={default:()=>e.default},r={},i.d(r,o),r)},3496(e,s,i){var o,r;e.exports=(o={default:()=>t.default},r={},i.d(r,o),r)},9644(e,t,i){var o,r;e.exports=(o={default:()=>s.default},r={},i.d(r,o),r)},9324(e,t,s){var o,r;e.exports=(o={default:()=>i.default},r={},s.d(r,o),r)},9520(e,t,s){var i,r;e.exports=(i={default:()=>o.default},r={},s.d(r,i),r)},6521(e,t,s){var i,o;e.exports=(i={default:()=>r.default},o={},s.d(o,i),o)},9709(e,t,s){var i,o;e.exports=(i={createPopper:()=>a.createPopper,defaultModifiers:()=>a.defaultModifiers},o={},s.d(o,i),o)},2927(e,t,s){var i,o;e.exports=(i={LitElement:()=>d.LitElement,css:()=>d.css,html:()=>d.html,nothing:()=>d.nothing},o={},s.d(o,i),o)},8899(e,t,s){var i,o;e.exports=(i={property:()=>l.property,query:()=>l.query,queryAssignedNodes:()=>l.queryAssignedNodes,state:()=>l.state},o={},s.d(o,i),o)},4955(e,t,s){var i,o;e.exports=(i={classMap:()=>n.classMap},o={},s.d(o,i),o)},3517(e,t,s){var i,o;e.exports=(i={ifDefined:()=>c.ifDefined},o={},s.d(o,i),o)},2577(e,t,s){var i,o;e.exports=(i={repeat:()=>p.repeat},o={},s.d(o,i),o)},1156(e,t,s){var i,o;e.exports=(i={styleMap:()=>m.styleMap},o={},s.d(o,i),o)},4980(e,t,s){var i,o;e.exports=(i={action:()=>h.action,observable:()=>h.observable},o={},s.d(o,i),o)}},b={};function y(e){var t=b[e];if(void 0!==t)return t.exports;var s=b[e]={exports:{}};return v[e](s,s.exports,y),s.exports}y.m=v,u=[],y.O=(e,t,s,i)=>{if(!t){var o=1/0;for(l=0;l<u.length;l++){for(var[t,s,i]=u[l],r=!0,a=0;a<t.length;a++)(!1&i||o>=i)&&Object.keys(y.O).every(e=>y.O[e](t[a]))?t.splice(a--,1):(r=!1,i<o&&(o=i));if(r){u.splice(l--,1);var d=s();void 0!==d&&(e=d)}}return e}i=i||0;for(var l=u.length;l>0&&u[l-1][2]>i;l--)u[l]=u[l-1];u[l]=[t,s,i]},y.d=(e,t)=>{for(var s in t)y.o(t,s)&&!y.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},y.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);export{y as __webpack_require__};f={23:0,502:0,561:0,1462:0,1745:0,2169:0,2942:0,4545:0,4928:0,5323:0,5369:0,6060:0,6131:0,6920:0,7704:0,8111:0,8180:0,8442:0,8552:0},y.C=e=>{var t,s,{__webpack_esm_ids__:i,__webpack_esm_modules__:o,__webpack_esm_runtime__:r}=e,a=0;for(t in o)y.o(o,t)&&(y.m[t]=o[t]);for(r&&r(y);a<i.length;a++)s=i[a],y.o(f,s)&&f[s]&&f[s][0](),f[i[a]]=0;y.O()},y.O.j=e=>0===f[e];import*as g from"../9609.js";y.C(g);import*as C from"../4084.js";y.C(C);import*as w from"../3305.js";y.C(w);import*as k from"../4739.js";y.C(k);import*as E from"../7154.js";y.C(E);import*as j from"../9773.js";y.C(j);import*as x from"../5983.js";y.C(x);import*as A from"../9488.js";y.C(A);import*as L from"../1821.js";y.C(L);import*as O from"../2364.js";y.C(O);import*as I from"../519.js";y.C(I);import*as _ from"../2050.js";y.C(_);import*as S from"../8441.js";y.C(S);import*as D from"../608.js";y.C(D);import*as U from"../9146.js";y.C(U);import*as $ from"../6343.js";y.C($);import*as z from"../7162.js";y.C(z);import*as M from"../7582.js";y.C(M);import*as P from"../708.js";y.C(P);import*as R from"../9613.js";y.C(R);import*as K from"../740.js";y.C(K);import*as N from"../6816.js";y.C(N);import*as q from"../7557.js";y.C(q);import*as T from"../4242.js";y.C(T);var F=y.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,2364,519,2050,8441,608,9146,6343,7162,7582,708,9613,740,6816,7557,4242],()=>y(1499));const B=(F=y.O(F)).Z;export{B as Card};