"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[65016],{459:function(i,e,a){a.a(i,async function(i,t){try{a.r(e);var n,s,r,c,o,d=a(28430),h=a(36854),l=a(98117),f=a(57567),_=a(25979),u=a(12463),p=a(16472),g=(a(28706),a(62062),a(18111),a(61701),a(26099),a(3362),a(38781),a(15697)),v=a(57527),m=a(51209),b=a(148),y=(a(25087),a(37955),a(15466)),A=a(73651),k=a(7064),x=a(13288),D=a(76730),w=i([y,A]);[y,A]=w.then?(await w)():w;var C=function(i){function e(){var i;(0,f.A)(this,e);for(var a=arguments.length,t=new Array(a),n=0;n<a;n++)t[n]=arguments[n];return(i=(0,p.A)(this,e,[].concat(t)))._open=!1,i}return(0,u.A)(e,i),(0,_.A)(e,[{key:"showDialog",value:(g=(0,l.A)((0,h.A)().m(function i(e){return(0,h.A)().w(function(i){for(;;)switch(i.n){case 0:this.device_id=e.device_id,this._open=!0,this._fetchNodeDetails();case 1:return i.a(2)}},i,this)})),function(i){return g.apply(this,arguments)})},{key:"render",value:function(){var i=this;return this.device_id?(0,v.qy)(n||(n=(0,d.A)([" <ha-dialog .open="," header-title="," @closed=","> <p> "," </p> "," </ha-dialog> "])),this._open,this.hass.localize("ui.panel.config.matter.manage_fabrics.title"),this._dialogClosed,this.hass.localize("ui.panel.config.matter.manage_fabrics.fabrics"),this._nodeDiagnostics?(0,v.qy)(s||(s=(0,d.A)(["<ha-list> "," </ha-list>"])),this._nodeDiagnostics.active_fabrics.map(function(e){return(0,v.qy)(r||(r=(0,d.A)(["<ha-list-item noninteractive .hasMeta=",">"," <ha-icon-button @click=",' slot="meta" .fabric='," .path=","></ha-icon-button> </ha-list-item>"])),i._nodeDiagnostics.available&&e.fabric_index!==i._nodeDiagnostics.active_fabric_index,e.vendor_name||e.fabric_label||e.vendor_id,i._removeFabric,e,"M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z")})):(0,v.qy)(c||(c=(0,d.A)(['<div class="center"> <ha-spinner></ha-spinner> </div>'])))):v.s6}},{key:"_fetchNodeDetails",value:(t=(0,l.A)((0,h.A)().m(function i(){return(0,h.A)().w(function(i){for(;;)switch(i.p=i.n){case 0:if(this.device_id){i.n=1;break}return i.a(2);case 1:return i.p=1,i.n=2,(0,k.eB)(this.hass,this.device_id);case 2:this._nodeDiagnostics=i.v,i.n=4;break;case 3:i.p=3,i.v,this._nodeDiagnostics=void 0;case 4:return i.a(2)}},i,this,[[1,3]])})),function(){return t.apply(this,arguments)})},{key:"_removeFabric",value:(a=(0,l.A)((0,h.A)().m(function i(e){var a,t;return(0,h.A)().w(function(i){for(;;)switch(i.p=i.n){case 0:if(a=e.target.fabric,this._nodeDiagnostics.active_fabric_index!==a.fabric_index){i.n=1;break}return i.a(2);case 1:return t=a.vendor_name||a.fabric_label||a.vendor_id.toString(),i.n=2,(0,x.dk)(this,{title:this.hass.localize("ui.panel.config.matter.manage_fabrics.remove_fabric_confirm_header",{fabric:t}),text:this.hass.localize("ui.panel.config.matter.manage_fabrics.remove_fabric_confirm_text",{fabric:t}),warning:!0});case 2:if(i.v){i.n=3;break}return i.a(2);case 3:return i.p=3,i.n=4,(0,k.vX)(this.hass,this.device_id,a.fabric_index);case 4:this._fetchNodeDetails(),i.n=6;break;case 5:i.p=5,i.v,(0,x.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.matter.manage_fabrics.remove_fabric_failed_header",{fabric:t}),text:this.hass.localize("ui.panel.config.matter.manage_fabrics.remove_fabric_failed_text")});case 6:return i.a(2)}},i,this,[[3,5]])})),function(i){return a.apply(this,arguments)})},{key:"closeDialog",value:function(){this._open=!1}},{key:"_dialogClosed",value:function(){this.device_id=void 0,this._nodeDiagnostics=void 0,(0,b.r)(this,"dialog-closed",{dialog:this.localName})}}],[{key:"styles",get:function(){return[D.nA,(0,v.AH)(o||(o=(0,d.A)(["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{justify-content:center;align-items:center;display:flex}"])))]}}]);var a,t,g}(v.WF);(0,g.Cg)([(0,m.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,g.Cg)([(0,m.wk)()],C.prototype,"device_id",void 0),(0,g.Cg)([(0,m.wk)()],C.prototype,"_nodeDiagnostics",void 0),(0,g.Cg)([(0,m.wk)()],C.prototype,"_open",void 0),C=(0,g.Cg)([(0,m.EM)("dialog-matter-manage-fabrics")],C),t()}catch(z){t(z)}})}}]);
//# sourceMappingURL=65016.9ee31c2c77ebbbf5.js.map