export const __rspack_esm_id="33425";export const __rspack_esm_ids=["33425"];export const __webpack_modules__={21288(i,e,a){a.a(i,async function(i,t){try{a.r(e);a(18111),a(61701);var s=a(62826),o=a(96196),c=a(97735),n=a(1087),r=(a(8630),a(28732),a(65829)),d=a(72554),_=a(20559),h=a(65063),l=a(14503),g=i([r,d]);[r,d]=g.then?(await g)():g;const f="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z";class p extends o.WF{async showDialog(i){this.device_id=i.device_id,this._open=!0,this._fetchNodeDetails()}render(){return this.device_id?o.qy` <ha-dialog .hass="${this.hass}" .open="${this._open}" header-title="${this.hass.localize("ui.panel.config.matter.manage_fabrics.title")}" @closed="${this._dialogClosed}"> <p> ${this.hass.localize("ui.panel.config.matter.manage_fabrics.fabrics")} </p> ${this._nodeDiagnostics?o.qy`<ha-list> ${this._nodeDiagnostics.active_fabrics.map(i=>o.qy`<ha-list-item noninteractive .hasMeta="${this._nodeDiagnostics.available&&i.fabric_index!==this._nodeDiagnostics.active_fabric_index}">${i.vendor_name||i.fabric_label||i.vendor_id} <ha-icon-button @click="${this._removeFabric}" slot="meta" .fabric="${i}" .path="${f}"></ha-icon-button> </ha-list-item>`)} </ha-list>`:o.qy`<div class="center"> <ha-spinner></ha-spinner> </div>`} </ha-dialog> `:o.s6}async _fetchNodeDetails(){if(this.device_id)try{this._nodeDiagnostics=await(0,_.eB)(this.hass,this.device_id)}catch(i){this._nodeDiagnostics=void 0}}async _removeFabric(i){const e=i.target.fabric;if(this._nodeDiagnostics.active_fabric_index===e.fabric_index)return;const a=e.vendor_name||e.fabric_label||e.vendor_id.toString();if(await(0,h.dk)(this,{title:this.hass.localize("ui.panel.config.matter.manage_fabrics.remove_fabric_confirm_header",{fabric:a}),text:this.hass.localize("ui.panel.config.matter.manage_fabrics.remove_fabric_confirm_text",{fabric:a}),warning:!0}))try{await(0,_.vX)(this.hass,this.device_id,e.fabric_index),this._fetchNodeDetails()}catch(i){(0,h.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.matter.manage_fabrics.remove_fabric_failed_header",{fabric:a}),text:this.hass.localize("ui.panel.config.matter.manage_fabrics.remove_fabric_failed_text")})}}closeDialog(){this._open=!1}_dialogClosed(){this.device_id=void 0,this._nodeDiagnostics=void 0,(0,n.r)(this,"dialog-closed",{dialog:this.localName})}static get styles(){return[l.nA,o.AH`ha-dialog{--dialog-content-padding:0;--mdc-list-side-padding:24px;--mdc-list-side-padding-right:16px;--mdc-list-item-meta-size:48px}p{margin:8px 24px}.center{display:flex;align-items:center;justify-content:center}`]}constructor(...i){super(...i),this._open=!1}}(0,s.Cg)([(0,c.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,s.Cg)([(0,c.wk)()],p.prototype,"device_id",void 0),(0,s.Cg)([(0,c.wk)()],p.prototype,"_nodeDiagnostics",void 0),(0,s.Cg)([(0,c.wk)()],p.prototype,"_open",void 0),p=(0,s.Cg)([(0,c.EM)("dialog-matter-manage-fabrics")],p),t()}catch(i){t(i)}})}};
//# sourceMappingURL=33425.f015a7366d648a32.js.map