"use strict";(self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[]).push([[5983],{5983(t,e,i){var o,a=i(6616),r=(i(9773),i(9609)),s=i(7154),n=i(4084),d=i(7161),p=i(429),l=i(5125),h=i(291),y=i(680),c=function(t,e,i,o){var a,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(s=(r<3?a(s):r>3?a(e,i,s):a(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};!function(t){let e=class extends d.LitElement{constructor(){super(...arguments),this._active=!1,this._tabIndex=0,this.ariaLabel="",this.ariaLabelledBy="",this.ariaLive="",this.ariaExpanded="",this.ariaHaspopup="false",this.ariaPressed="",this.circle=!1,this.rounded=!1,this.color="",this.containerLarge=!1,this.disabled=!1,this.href="",this.id="",this.value="",this.keyboardKey="",this.label="",this.loading=!1,this.outline=!1,this.hasRemoveStyle=!1,this.size="32",this.tag="button",this.type="button",this.role="button",this.variant="secondary",this.width="",this.maxWidth="",this.activityType="",this.iconActive=!1,this.isActive=!1,this.autofocus=!1,this.renderWidth=()=>this.width?`width: ${this.width};`:d.nothing,this.renderMaxWidth=()=>this.maxWidth?`max-width: ${this.maxWidth};`:d.nothing,this.getStyles=()=>{if(this.width||this.maxWidth)return d.html`
          <style>
            :host .md-button--${this.size} {
              ${this.renderWidth()};
              ${this.renderMaxWidth()};
            }
          </style>
        `},this.iconTemplate=()=>this.loading?d.html` <md-spinner size="16"></md-spinner> `:d.html` <slot name="icon"></slot> `,this.textTemplate=()=>this.circle&&this.hasIcon?d.nothing:d.html` <slot name="text"></slot> `}get active(){return this._active}set active(t){const e=this._active;this._active=t,this.requestUpdate("active",e)}get tabIndex(){return this._tabIndex}set tabIndex(t){const e=this._tabIndex;this._tabIndex=t,this.requestUpdate("tabIndex",e)}firstUpdated(t){super.firstUpdated(t),this.autofocus&&requestAnimationFrame(()=>{this.manageAutoFocus()})}manageAutoFocus(t){(null!=t?t:this).focus()}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}blur(){var t;null===(t=this.button)||void 0===t||t.blur()}handleKeyDown(t){if(this.disabled)return;const{code:e}=t;(0,s.o)(e)&&this.dispatchEvent(new CustomEvent("button-keydown",{composed:!0,bubbles:!0,detail:{srcEvent:t}}))}handleClick(t){var e;this.disabled||(null===(e=this.clickFunction)||void 0===e||e.call(this),this.dispatchEvent(new CustomEvent("button-click",{composed:!0,bubbles:!0,detail:{srcEvent:t}})))}static get styles(){return[n.A,y.A,a.A]}get buttonClassMap(){return{"md-button--circle":this.circle,"md-button--rounded":this.rounded,"md-button--none":this.hasRemoveStyle,"md-button--outline":this.outline,active:this.active&&!this.disabled,disabled:this.disabled&&!this.active,isActive:this.isActive,[`md-button--${this.size}`]:!this.hasRemoveStyle,[`md-button--${this.color}`]:!this.hasRemoveStyle&&!!this.color,[`md-activity__${this.activityType}`]:!!this.activityType,"md-activity":!!this.activityType,"md-button--icon":this.iconActive,"md-button--onlyicon":this.hasIcon&&!this.slottedText,"md-button--placeholder-text":!0===this.isPlaceholderText}}get slottedText(){var t;return null===(t=this.querySelector("[slot=text]"))||void 0===t?void 0:t.textContent}get hasIcon(){return null!==this.querySelector("[slot=icon]")||this.loading}childrenTemplate(){return d.html`
        <span part="button-children" class="md-button__children">
          ${this.iconTemplate()} ${this.textTemplate()}
          <slot></slot>
        </span>
        <slot name="notification"></slot>
      `}get computedAriaExpand(){return"true"===this.ariaExpanded?"true":"false"===this.ariaExpanded?"false":void 0}buttonTemplate(t){return"button"===t?d.html`
          <button
            part="button"
            id=${this.id}
            class="md-button ${(0,l.classMap)(this.buttonClassMap)}"
            @click=${t=>this.handleClick(t)}
            @keydown=${t=>this.handleKeyDown(t)}
            tabindex=${(0,h.ifDefined)(this.tabIndex||void 0)}
            aria-label=${(0,h.ifDefined)(this.ariaLabel||void 0)}
            aria-labelledby=${(0,h.ifDefined)(this.ariaLabelledBy||void 0)}
            aria-live=${(0,h.ifDefined)(this.ariaLive||void 0)}
            aria-expanded=${(0,h.ifDefined)(this.computedAriaExpand)}
            aria-haspopup=${(0,h.ifDefined)("false"===this.ariaHaspopup?void 0:this.ariaHaspopup)}
            aria-pressed=${(0,h.ifDefined)(this.ariaPressed||void 0)}
            aria-disabled=${(0,h.ifDefined)(this.disabled||this.loading||void 0)}
            aria-describedby=${(0,h.ifDefined)(this.ariaDescribedBy||void 0)}
            type=${this.type}
            role=${(0,h.ifDefined)("button"===this.role?void 0:this.role)}
          >
            ${this.childrenTemplate()}
          </button>
        `:"input"===t?d.html`
          <input
            part="button"
            id=${this.id}
            class="md-button ${(0,l.classMap)(this.buttonClassMap)}"
            @click=${t=>this.handleClick(t)}
            @keydown=${t=>this.handleKeyDown(t)}
            role=${this.role}
            tabindex=${(0,h.ifDefined)(this.tabIndex||void 0)}
            aria-pressed=${"true"===this.ariaPressed}
            aria-label=${(0,h.ifDefined)(this.ariaLabel||void 0)}
            aria-labelledby=${(0,h.ifDefined)(this.ariaLabelledBy||void 0)}
            aria-live=${(0,h.ifDefined)(this.ariaLive||void 0)}
            type=${this.type}
            alt=${this.label}
            value=${this.value}
            aria-disabled=${(0,h.ifDefined)(this.disabled||this.loading||void 0)}
          />
        `:"a"===t?d.html`
          <a
            part="button"
            id=${this.id}
            class="md-button ${(0,l.classMap)(this.buttonClassMap)}"
            @click=${t=>this.handleClick(t)}
            @keydown=${t=>this.handleKeyDown(t)}
            role=${this.role}
            tabindex=${(0,h.ifDefined)(this.tabIndex||void 0)}
            aria-pressed=${"true"===this.ariaPressed?"true":"false"}
            aria-label=${(0,h.ifDefined)(this.ariaLabel||void 0)}
            aria-labelledby=${(0,h.ifDefined)(this.ariaLabelledBy||void 0)}
            aria-live=${(0,h.ifDefined)(this.ariaLive||void 0)}
            aria-disabled=${(0,h.ifDefined)(this.disabled||this.loading||void 0)}
            href=${this.href}
          >
            ${this.childrenTemplate()}
          </a>
        `:d.nothing}get buttonContainerClassMap(){return{"md-button__container":this.containerLarge,"md-button__container--small":!this.containerLarge}}render(){return d.html`
        ${this.getStyles()}
        ${this.label?d.html`
              <div part="button-container" class=${(0,l.classMap)(this.buttonContainerClassMap)}>
                ${this.buttonTemplate(this.tag)}
                <div part="button-label" class="md-button__label">${this.label}</div>
              </div>
            `:d.html` ${this.buttonTemplate(this.tag)} `}
      `}};c([(0,p.property)({type:Boolean,reflect:!0})],e.prototype,"active",null),c([(0,p.property)({type:Number,attribute:"tab-index",reflect:!0})],e.prototype,"tabIndex",null),c([(0,p.property)({type:String})],e.prototype,"ariaLabel",void 0),c([(0,p.property)({type:String})],e.prototype,"ariaLabelledBy",void 0),c([(0,p.property)({type:String})],e.prototype,"ariaLive",void 0),c([(0,p.property)({type:String})],e.prototype,"ariaExpanded",void 0),c([(0,p.property)({type:String})],e.prototype,"ariaHaspopup",void 0),c([(0,p.property)({type:String})],e.prototype,"ariaPressed",void 0),c([(0,p.property)({type:Boolean})],e.prototype,"circle",void 0),c([(0,p.property)({type:Boolean})],e.prototype,"rounded",void 0),c([(0,p.property)({type:String})],e.prototype,"color",void 0),c([(0,p.property)({type:Boolean})],e.prototype,"containerLarge",void 0),c([(0,p.property)({type:Boolean})],e.prototype,"disabled",void 0),c([(0,p.property)({type:String})],e.prototype,"href",void 0),c([(0,p.property)({type:String})],e.prototype,"id",void 0),c([(0,p.property)({type:String})],e.prototype,"value",void 0),c([(0,p.property)({type:String})],e.prototype,"keyboardKey",void 0),c([(0,p.property)({type:String})],e.prototype,"label",void 0),c([(0,p.property)({type:Boolean})],e.prototype,"loading",void 0),c([(0,p.property)({type:Boolean})],e.prototype,"outline",void 0),c([(0,p.property)({type:Boolean})],e.prototype,"hasRemoveStyle",void 0),c([(0,p.property)({type:String})],e.prototype,"size",void 0),c([(0,p.property)({type:String})],e.prototype,"tag",void 0),c([(0,p.property)({type:String})],e.prototype,"type",void 0),c([(0,p.property)({type:String})],e.prototype,"role",void 0),c([(0,p.property)({type:String})],e.prototype,"variant",void 0),c([(0,p.property)({type:String})],e.prototype,"width",void 0),c([(0,p.property)({type:String})],e.prototype,"maxWidth",void 0),c([(0,p.property)({type:String})],e.prototype,"activityType",void 0),c([(0,p.property)({type:Boolean})],e.prototype,"iconActive",void 0),c([(0,p.property)({type:Boolean})],e.prototype,"isActive",void 0),c([(0,p.property)({type:String,attribute:"aria-describedby"})],e.prototype,"ariaDescribedBy",void 0),c([(0,p.property)({attribute:!1})],e.prototype,"clickFunction",void 0),c([(0,p.property)({type:Boolean,attribute:"is-placeholder-text"})],e.prototype,"isPlaceholderText",void 0),c([(0,p.property)({type:Boolean,reflect:!0})],e.prototype,"autofocus",void 0),c([(0,p.query)(".md-button")],e.prototype,"button",void 0),e=c([(0,r.w)("md-button")],e),t.ELEMENT=e}(o||(o={}))}}]);