"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[22604],{10983:function(t,i,n){n.a(t,async function(t,s){try{n.r(i);var e,a,o,r,h=n(28430),u=n(57567),c=n(25979),g=n(12463),f=n(16472),y=(n(16280),n(18111),n(13579),n(26099),n(15697)),l=n(57527),v=n(51209),_=n(3899),d=n(45602),p=n(88293),k=n(72441),w=n(59366),C=n(58178),m=t([p,w,C]);[p,w,C]=m.then?(await m)():m;var A=function(t){function i(){return(0,u.A)(this,i),(0,f.A)(this,i,arguments)}return(0,g.A)(i,t),(0,c.A)(i,[{key:"_computeCanToggle",value:function(t,i){var n=this;return i.some(function(i){var s,e=(0,d.m)(i);return"group"===e?n._computeCanToggle(t,null===(s=n.hass)||void 0===s?void 0:s.states[i].attributes.entity_id):_.FD.has(e)})}},{key:"setConfig",value:function(t){if(!t)throw new Error("Invalid configuration");this._config=t}},{key:"shouldUpdate",value:function(t){return(0,k.LX)(this,t)}},{key:"render",value:function(){if(!this._config||!this.hass)return l.s6;var t=this.hass.states[this._config.entity];return t?(0,l.qy)(a||(a=(0,h.A)([" <hui-generic-entity-row .hass="," .config=","> "," </hui-generic-entity-row> "])),this.hass,this._config,this._computeCanToggle(this.hass,t.attributes.entity_id)?(0,l.qy)(o||(o=(0,h.A)([" <ha-entity-toggle .stateObj=","></ha-entity-toggle> "])),t):(0,l.qy)(r||(r=(0,h.A)([' <div class="text-content"> '," </div> "])),this.hass.formatEntityState(t))):(0,l.qy)(e||(e=(0,h.A)([" <hui-warning .hass=","> "," </hui-warning> "])),this.hass,(0,C.j)(this.hass,this._config.entity))}}])}(l.WF);(0,y.Cg)([(0,v.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,y.Cg)([(0,v.wk)()],A.prototype,"_config",void 0),A=(0,y.Cg)([(0,v.EM)("hui-group-entity-row")],A),s()}catch(b){s(b)}})}}]);
//# sourceMappingURL=22604.29f383c9a115142c.js.map