var t,e,i={120(t,e,i){i.d(e,{o:()=>y,y:()=>h});var s=i(2900),o=i(7704),r=i(9609),a=i(7154),n=i(4084),l=i(2927),d=i(8899),p=i(4955),c=i(3272),b=function(t,e,i,s){var o,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(o=t[n])&&(a=(r<3?o(a):r>3?o(e,i,a):o(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const h=22;var y;!function(t){let e=class extends((0,o.yC)(l.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(t){const e=this._disabled;this._disabled=t,t?this.tabDisabled():this.tabEnabled(),this.requestUpdate("disabled",e)}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(t){const e=this._selected;this._selected=t,t?(this.setAttribute("aria-selected","true"),this.tabIndex=0,this.notifySelectedTab()):(this.tabIndex=-1,this.removeAttribute("aria-selected")),this.requestUpdate("selected",e)}static get styles(){return[n.A,c.A]}handleClick(t){t.preventDefault(),this.id&&this.dispatchEvent(new CustomEvent("tab-click",{detail:{id:this.id},bubbles:!0,composed:!0}))}handleKeydown(t){if((0,a.o)(t.code)){if(this.disabled)return void t.preventDefault();this.handleClick(t)}}handleCrossKeydown(t){t.stopPropagation(),t.code===s.Uz.Enter&&this.handleCrossEventDispatch()}handleCrossClick(t){t.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(t){super.update(t),t.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(t){super.firstUpdated(t)}renderCrossButton(){return l.html`
        <md-button
          variant="ghost"
          size="size-none"
          circle
          class="tab-action-button"
          ?disabled=${this.disabled}
          @click=${t=>this.handleCrossClick(t)}
          @keydown=${t=>this.handleCrossKeydown(t)}
        >
          <md-icon name="cancel-bold" size="14" iconSet="momentumDesign"></md-icon>
        </md-button>
      `}render(){return l.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=${t=>this.handleClick(t)}
          @keydown=${t=>this.handleKeydown(t)}
        ></button>
      `}};b([(0,d.property)({type:Number,reflect:!0})],e.prototype,"tabIndex",void 0),b([(0,d.property)({type:String,attribute:"aria-label"})],e.prototype,"ariaLabel",void 0),b([(0,d.property)({type:String,attribute:"closable"})],e.prototype,"closable",void 0),b([(0,d.property)({type:String,attribute:"name"})],e.prototype,"name",void 0),b([(0,d.property)({type:Boolean,attribute:"cross-visible"})],e.prototype,"isCrossVisible",void 0),b([(0,d.property)({type:String,attribute:"role",reflect:!0})],e.prototype,"role",void 0),b([(0,d.property)({type:String,reflect:!0})],e.prototype,"type",void 0),b([(0,d.property)({type:Boolean})],e.prototype,"newMomentum",void 0),b([(0,d.property)({type:Boolean})],e.prototype,"onlyIcon",void 0),b([(0,d.property)({type:String})],e.prototype,"variant",void 0),b([(0,d.property)({type:Boolean,attribute:"visible-tab",reflect:!0})],e.prototype,"visibleTab",void 0),b([(0,d.property)({type:Number})],e.prototype,"size",void 0),b([(0,d.property)({type:Boolean,reflect:!0})],e.prototype,"disabled",null),b([(0,d.property)({type:Boolean,reflect:!0})],e.prototype,"selected",null),b([(0,d.property)({type:Boolean,reflect:!0})],e.prototype,"vertical",void 0),b([(0,d.property)({type:Boolean,reflect:!0})],e.prototype,"viewportHidden",void 0),e=b([(0,r.w)("md-tab")],e),t.ELEMENT=e}(y||(y={}))}},s={};function o(t){var e=s[t];if(void 0!==e)return e.exports;var r=s[t]={exports:{}};return i[t](r,r.exports,o),r.exports}o.m=i,t=[],o.O=(e,i,s,r)=>{if(!i){var a=1/0;for(p=0;p<t.length;p++){for(var[i,s,r]=t[p],n=!0,l=0;l<i.length;l++)(!1&r||a>=r)&&Object.keys(o.O).every(t=>o.O[t](i[l]))?i.splice(l--,1):(n=!1,r<a&&(a=r));if(n){t.splice(p--,1);var d=s();void 0!==d&&(e=d)}}return e}r=r||0;for(var p=t.length;p>0&&t[p-1][2]>r;p--)t[p]=t[p-1];t[p]=[i,s,r]},o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{o as __webpack_require__};e={2139:0},o.C=t=>{var i,s,{__webpack_esm_ids__:r,__webpack_esm_modules__:a,__webpack_esm_runtime__:n}=t,l=0;for(i in a)o.o(a,i)&&(o.m[i]=a[i]);for(n&&n(o);l<r.length;l++)s=r[l],o.o(e,s)&&e[s]&&e[s][0](),e[r[l]]=0;o.O()},o.O.j=t=>0===e[t];import*as r from"../9609.js";o.C(r);import*as a from"../4084.js";o.C(a);import*as n from"../4955.js";o.C(n);import*as l from"../7154.js";o.C(l);import*as d from"../2364.js";o.C(d);import*as p from"../9938.js";o.C(p);import*as c from"../4781.js";o.C(c);import*as b from"../5201.js";o.C(b);import*as h from"../5584.js";o.C(h);import*as y from"../8227.js";o.C(y);import*as m from"../2900.js";o.C(m);import*as u from"../7704.js";o.C(u);import*as v from"../2927.js";o.C(v);import*as f from"../6994.js";o.C(f);import*as C from"../3272.js";o.C(C);var _=o.O(void 0,[9609,4084,4955,7154,2364,9938,4781,5201,5584,8227,2900,7704,2927,6994,3272],()=>o(120));const k=(_=o.O(_)).y,w=_.o;export{k as TAB_CROSS_WIDTH,w as Tab};