!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js"],t);else{var i="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"]);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(self,(e,t,i)=>(()=>{"use strict";var s,o={120(e,t,i){i.r(t),i.d(t,{TAB_CROSS_WIDTH:()=>h,Tab:()=>u});var s=i(2900),o=i(7704),r=i(9609),l=i(7154),a=i(4084),n=i(7161),d=i(429),p=i(5125),c=i(3272),b=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};const h=22;var u;!function(e){let t=class extends((0,o.yC)(n.LitElement)){constructor(){super(...arguments),this.tabIndex=-1,this.ariaLabel="",this.closable="",this.name="",this.isCrossVisible=!1,this.role="tab",this.type="line",this.newMomentum=!1,this.onlyIcon=!1,this.variant="ghost",this.visibleTab=!1,this.size=28,this._disabled=!1,this._selected=0===this.tabIndex,this.vertical=!1,this.viewportHidden=!1}get disabled(){return this._disabled}set disabled(e){const t=this._disabled;this._disabled=e,e?this.tabDisabled():this.tabEnabled(),this.requestUpdate("disabled",t)}tabDisabled(){-1!==this.tabIndex&&(this.tabIndex=-1),this.setAttribute("aria-disabled","true")}tabEnabled(){-1===this.tabIndex&&this.selected&&(this.tabIndex=0),this.removeAttribute("aria-disabled")}get selected(){return this._selected}set selected(e){const t=this._selected;this._selected=e,e?(this.setAttribute("aria-selected","true"),this.tabIndex=0,this.notifySelectedTab()):(this.tabIndex=-1,this.removeAttribute("aria-selected")),this.requestUpdate("selected",t)}static get styles(){return[a.A,c.A]}handleClick(e){e.preventDefault(),this.id&&this.dispatchEvent(new CustomEvent("tab-click",{detail:{id:this.id},bubbles:!0,composed:!0}))}handleKeydown(e){if((0,l.o)(e.code)){if(this.disabled)return void e.preventDefault();this.handleClick(e)}}handleCrossKeydown(e){e.stopPropagation(),e.code===s.Uz.Enter&&this.handleCrossEventDispatch()}handleCrossClick(e){e.preventDefault(),!0!==this.disabled&&this.handleCrossEventDispatch()}handleCrossEventDispatch(){this.id&&("auto"===this.closable?this.dispatchEvent(new CustomEvent("tab-cross-click",{detail:{id:this.id},bubbles:!0,composed:!0})):"custom"===this.closable&&this.dispatchEvent(new CustomEvent("tab-close-click",{detail:{id:this.id,name:this.name},bubbles:!0,composed:!0})))}notifySelectedTab(){this.dispatchEvent(new CustomEvent("focus-visible",{composed:!0,bubbles:!0}))}update(e){super.update(e),e.has("disabled")&&this.disabled&&(this.selected=!1)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeydown)}firstUpdated(e){super.firstUpdated(e)}renderCrossButton(){return n.html`
        <md-button
          variant="ghost"
          size="size-none"
          circle
          class="tab-action-button"
          ?disabled=${this.disabled}
          @click=${e=>this.handleCrossClick(e)}
          @keydown=${e=>this.handleCrossKeydown(e)}
        >
          <md-icon name="cancel-bold" size="14" iconSet="momentumDesign"></md-icon>
        </md-button>
      `}render(){return n.html`
        <div
          part="tab"
          class="${(0,p.classMap)({disabled:this.disabled,"md-tab-content":!0,closable:""!==this.closable,pill:"pill"===this.type,rounded:"rounded"===this.type,line:"line"===this.type,primary:"primary"===this.variant,newMomentum:this.newMomentum,onlyIcon:this.onlyIcon})}"
        >
          <slot class="tab-slot"></slot>
          ${this.isCrossVisible&&this.closable?this.renderCrossButton():""}
        </div>
        <div part="indicator"></div>
        <!-- Invisible button for legacy third party test compatibility -->
        <button
          type="button"
          class="test-compatibility-button"
          aria-hidden="true"
          @click=${e=>this.handleClick(e)}
          @keydown=${e=>this.handleKeydown(e)}
        ></button>
      `}};b([(0,d.property)({type:Number,reflect:!0})],t.prototype,"tabIndex",void 0),b([(0,d.property)({type:String,attribute:"aria-label"})],t.prototype,"ariaLabel",void 0),b([(0,d.property)({type:String,attribute:"closable"})],t.prototype,"closable",void 0),b([(0,d.property)({type:String,attribute:"name"})],t.prototype,"name",void 0),b([(0,d.property)({type:Boolean,attribute:"cross-visible"})],t.prototype,"isCrossVisible",void 0),b([(0,d.property)({type:String,attribute:"role",reflect:!0})],t.prototype,"role",void 0),b([(0,d.property)({type:String,reflect:!0})],t.prototype,"type",void 0),b([(0,d.property)({type:Boolean})],t.prototype,"newMomentum",void 0),b([(0,d.property)({type:Boolean})],t.prototype,"onlyIcon",void 0),b([(0,d.property)({type:String})],t.prototype,"variant",void 0),b([(0,d.property)({type:Boolean,attribute:"visible-tab",reflect:!0})],t.prototype,"visibleTab",void 0),b([(0,d.property)({type:Number})],t.prototype,"size",void 0),b([(0,d.property)({type:Boolean,reflect:!0})],t.prototype,"disabled",null),b([(0,d.property)({type:Boolean,reflect:!0})],t.prototype,"selected",null),b([(0,d.property)({type:Boolean,reflect:!0})],t.prototype,"vertical",void 0),b([(0,d.property)({type:Boolean,reflect:!0})],t.prototype,"viewportHidden",void 0),t=b([(0,r.w)("md-tab")],t),e.ELEMENT=t}(u||(u={}))},7161(t){t.exports=e},429(e){e.exports=t},5125(e){e.exports=i}},r={};function l(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return o[e](i,i.exports,l),i.exports}l.m=o,s=[],l.O=(e,t,i,o)=>{if(!t){var r=1/0;for(p=0;p<s.length;p++){for(var[t,i,o]=s[p],a=!0,n=0;n<t.length;n++)(!1&o||r>=o)&&Object.keys(l.O).every(e=>l.O[e](t[n]))?t.splice(n--,1):(a=!1,o<r&&(r=o));if(a){s.splice(p--,1);var d=i();void 0!==d&&(e=d)}}return e}o=o||0;for(var p=s.length;p>0&&s[p-1][2]>o;p--)s[p]=s[p-1];s[p]=[t,i,o]},l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var i in t)l.o(t,i)&&!l.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={2139:0};l.O.j=t=>0===e[t];var t=(t,i)=>{var s,o,[r,a,n]=i,d=0;if(r.some(t=>0!==e[t])){for(s in a)l.o(a,s)&&(l.m[s]=a[s]);if(n)var p=n(l)}for(t&&t(i);d<r.length;d++)o=r[d],l.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return l.O(p)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var a=l.O(void 0,[9609,4084,7154,2364,9938,4781,5201,5584,8227,2900,7704,3272],()=>l(120));return l.O(a)})());