var t,e,i={5983(t,e,i){i.d(e,{$n:()=>$,El:()=>c,Fr:()=>u,Gh:()=>g,MS:()=>v,Sq:()=>f,r3:()=>b,uZ:()=>m});var o=i(6616),r=(i(9773),i(9609)),a=i(7154),s=i(4084),n=i(2927),p=i(8899),d=i(4955),l=i(3517),h=i(680),y=function(t,e,i,o){var r,a=arguments.length,s=a<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--)(r=t[n])&&(s=(a<3?r(s):a>3?r(e,i,s):r(e,i))||s);return a>3&&s&&Object.defineProperty(e,i,s),s};const c=["20","24","28","32","36","40","44","52","56","72","68","84","size-none",20,24,28,32,36,40,44,52,56,68,72,68,84],u=["button","input","a"],b=["button","reset","submit"],v=["button","checkbox","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","switch","tab"],m=["primary","secondary","red","green","ghost","ghostInheritTextColor","white","darkGrey","promotional","tab","available","unavailable","engaged","idle","inverted-primary","inverted-secondary","inverted-ghost","dropdown","secondary-negative","secondary-positive","secondary-accent"],f=["blue","red","green","orange","yellow","mint","purple","pink","cyan","white","dark-gray","duck-egg","violet","color-none",""],g=["","off","polite","assertive"];var $;!function(t){let e=class extends n.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};`:n.nothing,this.renderMaxWidth=()=>this.maxWidth?`max-width: ${this.maxWidth};`:n.nothing,this.getStyles=()=>{if(this.width||this.maxWidth)return n.html`
          <style>
            :host .md-button--${this.size} {
              ${this.renderWidth()};
              ${this.renderMaxWidth()};
            }
          </style>
        `},this.iconTemplate=()=>this.loading?n.html` <md-spinner size="16"></md-spinner> `:n.html` <slot name="icon"></slot> `,this.textTemplate=()=>this.circle&&this.hasIcon?n.nothing:n.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,a.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[s.A,h.A,o.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 n.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?n.html`
          <button
            part="button"
            id=${this.id}
            class="md-button ${(0,d.classMap)(this.buttonClassMap)}"
            @click=${t=>this.handleClick(t)}
            @keydown=${t=>this.handleKeyDown(t)}
            tabindex=${(0,l.ifDefined)(this.tabIndex||void 0)}
            aria-label=${(0,l.ifDefined)(this.ariaLabel||void 0)}
            aria-labelledby=${(0,l.ifDefined)(this.ariaLabelledBy||void 0)}
            aria-live=${(0,l.ifDefined)(this.ariaLive||void 0)}
            aria-expanded=${(0,l.ifDefined)(this.computedAriaExpand)}
            aria-haspopup=${(0,l.ifDefined)("false"===this.ariaHaspopup?void 0:this.ariaHaspopup)}
            aria-pressed=${(0,l.ifDefined)(this.ariaPressed||void 0)}
            aria-disabled=${(0,l.ifDefined)(this.disabled||this.loading||void 0)}
            aria-describedby=${(0,l.ifDefined)(this.ariaDescribedBy||void 0)}
            type=${this.type}
            role=${(0,l.ifDefined)("button"===this.role?void 0:this.role)}
          >
            ${this.childrenTemplate()}
          </button>
        `:"input"===t?n.html`
          <input
            part="button"
            id=${this.id}
            class="md-button ${(0,d.classMap)(this.buttonClassMap)}"
            @click=${t=>this.handleClick(t)}
            @keydown=${t=>this.handleKeyDown(t)}
            role=${this.role}
            tabindex=${(0,l.ifDefined)(this.tabIndex||void 0)}
            aria-pressed=${"true"===this.ariaPressed}
            aria-label=${(0,l.ifDefined)(this.ariaLabel||void 0)}
            aria-labelledby=${(0,l.ifDefined)(this.ariaLabelledBy||void 0)}
            aria-live=${(0,l.ifDefined)(this.ariaLive||void 0)}
            type=${this.type}
            alt=${this.label}
            value=${this.value}
            aria-disabled=${(0,l.ifDefined)(this.disabled||this.loading||void 0)}
          />
        `:"a"===t?n.html`
          <a
            part="button"
            id=${this.id}
            class="md-button ${(0,d.classMap)(this.buttonClassMap)}"
            @click=${t=>this.handleClick(t)}
            @keydown=${t=>this.handleKeyDown(t)}
            role=${this.role}
            tabindex=${(0,l.ifDefined)(this.tabIndex||void 0)}
            aria-pressed=${"true"===this.ariaPressed?"true":"false"}
            aria-label=${(0,l.ifDefined)(this.ariaLabel||void 0)}
            aria-labelledby=${(0,l.ifDefined)(this.ariaLabelledBy||void 0)}
            aria-live=${(0,l.ifDefined)(this.ariaLive||void 0)}
            aria-disabled=${(0,l.ifDefined)(this.disabled||this.loading||void 0)}
            href=${this.href}
          >
            ${this.childrenTemplate()}
          </a>
        `:n.nothing}get buttonContainerClassMap(){return{"md-button__container":this.containerLarge,"md-button__container--small":!this.containerLarge}}render(){return n.html`
        ${this.getStyles()}
        ${this.label?n.html`
              <div part="button-container" class=${(0,d.classMap)(this.buttonContainerClassMap)}>
                ${this.buttonTemplate(this.tag)}
                <div part="button-label" class="md-button__label">${this.label}</div>
              </div>
            `:n.html` ${this.buttonTemplate(this.tag)} `}
      `}};y([(0,p.property)({type:Boolean,reflect:!0})],e.prototype,"active",null),y([(0,p.property)({type:Number,attribute:"tab-index",reflect:!0})],e.prototype,"tabIndex",null),y([(0,p.property)({type:String})],e.prototype,"ariaLabel",void 0),y([(0,p.property)({type:String})],e.prototype,"ariaLabelledBy",void 0),y([(0,p.property)({type:String})],e.prototype,"ariaLive",void 0),y([(0,p.property)({type:String})],e.prototype,"ariaExpanded",void 0),y([(0,p.property)({type:String})],e.prototype,"ariaHaspopup",void 0),y([(0,p.property)({type:String})],e.prototype,"ariaPressed",void 0),y([(0,p.property)({type:Boolean})],e.prototype,"circle",void 0),y([(0,p.property)({type:Boolean})],e.prototype,"rounded",void 0),y([(0,p.property)({type:String})],e.prototype,"color",void 0),y([(0,p.property)({type:Boolean})],e.prototype,"containerLarge",void 0),y([(0,p.property)({type:Boolean})],e.prototype,"disabled",void 0),y([(0,p.property)({type:String})],e.prototype,"href",void 0),y([(0,p.property)({type:String})],e.prototype,"id",void 0),y([(0,p.property)({type:String})],e.prototype,"value",void 0),y([(0,p.property)({type:String})],e.prototype,"keyboardKey",void 0),y([(0,p.property)({type:String})],e.prototype,"label",void 0),y([(0,p.property)({type:Boolean})],e.prototype,"loading",void 0),y([(0,p.property)({type:Boolean})],e.prototype,"outline",void 0),y([(0,p.property)({type:Boolean})],e.prototype,"hasRemoveStyle",void 0),y([(0,p.property)({type:String})],e.prototype,"size",void 0),y([(0,p.property)({type:String})],e.prototype,"tag",void 0),y([(0,p.property)({type:String})],e.prototype,"type",void 0),y([(0,p.property)({type:String})],e.prototype,"role",void 0),y([(0,p.property)({type:String})],e.prototype,"variant",void 0),y([(0,p.property)({type:String})],e.prototype,"width",void 0),y([(0,p.property)({type:String})],e.prototype,"maxWidth",void 0),y([(0,p.property)({type:String})],e.prototype,"activityType",void 0),y([(0,p.property)({type:Boolean})],e.prototype,"iconActive",void 0),y([(0,p.property)({type:Boolean})],e.prototype,"isActive",void 0),y([(0,p.property)({type:String,attribute:"aria-describedby"})],e.prototype,"ariaDescribedBy",void 0),y([(0,p.property)({attribute:!1})],e.prototype,"clickFunction",void 0),y([(0,p.property)({type:Boolean,attribute:"is-placeholder-text"})],e.prototype,"isPlaceholderText",void 0),y([(0,p.property)({type:Boolean,reflect:!0})],e.prototype,"autofocus",void 0),y([(0,p.query)(".md-button")],e.prototype,"button",void 0),e=y([(0,r.w)("md-button")],e),t.ELEMENT=e}($||($={}))}},o={};function r(t){var e=o[t];if(void 0!==e)return e.exports;var a=o[t]={exports:{}};return i[t](a,a.exports,r),a.exports}r.m=i,t=[],r.O=(e,i,o,a)=>{if(!i){var s=1/0;for(l=0;l<t.length;l++){for(var[i,o,a]=t[l],n=!0,p=0;p<i.length;p++)(!1&a||s>=a)&&Object.keys(r.O).every(t=>r.O[t](i[p]))?i.splice(p--,1):(n=!1,a<s&&(s=a));if(n){t.splice(l--,1);var d=o();void 0!==d&&(e=d)}}return e}a=a||0;for(var l=t.length;l>0&&t[l-1][2]>a;l--)t[l]=t[l-1];t[l]=[i,o,a]},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{r as __webpack_require__};e={5156:0,5983:0},r.C=t=>{var i,o,{__webpack_esm_ids__:a,__webpack_esm_modules__:s,__webpack_esm_runtime__:n}=t,p=0;for(i in s)r.o(s,i)&&(r.m[i]=s[i]);for(n&&n(r);p<a.length;p++)o=a[p],r.o(e,o)&&e[o]&&e[o][0](),e[a[p]]=0;r.O()},r.O.j=t=>0===e[t];import*as a from"../9609.js";r.C(a);import*as s from"../4084.js";r.C(s);import*as n from"../4955.js";r.C(n);import*as p from"../3517.js";r.C(p);import*as d from"../1156.js";r.C(d);import*as l from"../3305.js";r.C(l);import*as h from"../4739.js";r.C(h);import*as y from"../7154.js";r.C(y);import*as c from"../9773.js";r.C(c);import*as u from"../519.js";r.C(u);import*as b from"../8165.js";r.C(b);import*as v from"../9375.js";r.C(v);var m=r.O(void 0,[9609,4084,4955,3517,1156,3305,4739,7154,9773,519,8165,9375],()=>r(5983));const f=(m=r.O(m)).$n,g=m.Gh,$=m.Sq,x=m.MS,_=m.El,S=m.Fr,C=m.r3,w=m.uZ;export{f as Button,g as buttonAriaLive,$ as buttonColor,x as buttonRoles,_ as buttonSize,S as buttonTag,C as buttonType,w as buttonVariant};