"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[76685],{42364:function(t,i,n){n.a(t,async function(t,a){try{n.r(i);var e,o,s=n(28430),c=n(36854),h=n(98117),r=n(57567),l=n(25979),u=n(12463),d=n(16472),f=n(92297),_=(n(69476),n(28706),n(2008),n(18111),n(22489),n(26099),n(3362),n(15697)),v=n(57527),g=n(51209),p=n(148),y=n(56245),A=(n(75041),n(32878),n(88472),n(51517),n(63236)),k=n(42239),C=n(49511),H=n(78316),m=t([A]);A=(m.then?(await m)():m)[0];var w=function(t){function i(){var t;(0,r.A)(this,i);for(var n=arguments.length,a=new Array(n),e=0;e<n;e++)a[e]=arguments[e];return(t=(0,d.A)(this,i,[].concat(a))).connectedWhileHidden=!0,t}return(0,u.A)(i,t),(0,l.A)(i,[{key:"setConfig",value:function(t){this._config=t}},{key:"getCardSize",value:function(){var t;return null!==(t=this._config)&&void 0!==t&&t.vertical?2:1}},{key:"getGridOptions",value:function(){var t,i=6,n=1;return null!==(t=this._config)&&void 0!==t&&t.vertical&&(n++,i=3),{columns:6,rows:n,min_columns:i,min_rows:n}}},{key:"_getUpdateEntities",value:function(){return this.hass?(0,A.ZS)(this.hass.states,this.hass.locale.language).filter(function(t){return(0,A.VK)(t,!1)}):[]}},{key:"_handleAction",value:(n=(0,h.A)((0,c.A)().m(function t(i){var n;return(0,c.A)().w(function(t){for(;;)switch(t.n){case 0:if("tap"!==i.detail.action||(0,C.h)(null===(n=this._config)||void 0===n?void 0:n.tap_action)){t.n=1;break}return(0,y.oo)("/config/updates"),t.a(2);case 1:(0,k.$)(this,this.hass,this._config,i.detail.action);case 2:return t.a(2)}},t,this)})),function(t){return n.apply(this,arguments)})},{key:"_hasCardAction",get:function(){var t,i,n,a;return!(null!==(t=this._config)&&void 0!==t&&t.tap_action)||(0,C.h)(null===(i=this._config)||void 0===i?void 0:i.tap_action)||(0,C.h)(null===(n=this._config)||void 0===n?void 0:n.hold_action)||(0,C.h)(null===(a=this._config)||void 0===a?void 0:a.double_tap_action)}},{key:"willUpdate",value:function(t){var n;if((0,f.A)(i,"willUpdate",this,3)([t]),this._config&&this.hass){var a=this._getUpdateEntities(),e=Boolean(!(null!==(n=this.hass.user)&&void 0!==n&&n.is_admin)||this._config.hide_empty&&0===a.length);e!==this.hidden&&(this.style.display=e?"none":"",this.toggleAttribute("hidden",e),(0,p.r)(this,"card-visibility-changed",{value:!e}))}}},{key:"render",value:function(){if(!this._config||!this.hass)return v.s6;var t=this._getUpdateEntities().length,i=this.hass.localize("ui.card.updates.title"),n=t>0?this.hass.localize("ui.card.updates.count_updates",{count:t}):this.hass.localize("ui.card.updates.no_updates");return(0,v.qy)(e||(e=(0,s.A)([" <ha-card> <ha-tile-container .vertical="," .interactive="," .actionHandlerOptions="," @action=",'> <ha-tile-icon slot="icon" .iconPath=','></ha-tile-icon> <ha-tile-info slot="info" .primary='," .secondary=","></ha-tile-info> </ha-tile-container> </ha-card> "])),Boolean(this._config.vertical),this._hasCardAction,{hasHold:(0,C.h)(this._config.hold_action),hasDoubleClick:(0,C.h)(this._config.double_tap_action)},this._handleAction,"M20.54,5.23C20.83,5.57 21,6 21,6.5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V6.5C3,6 3.17,5.57 3.46,5.23L4.84,3.55C5.12,3.21 5.53,3 6,3H18C18.47,3 18.88,3.21 19.15,3.55L20.54,5.23M5.12,5H18.87L17.93,4H5.93L5.12,5M12,9.5L6.5,15H10V17H14V15H17.5L12,9.5Z",i,n)}}]);var n}(v.WF);w.styles=[H.c,(0,v.AH)(o||(o=(0,s.A)([":host{--tile-color:var(--info-color)}"])))],(0,_.Cg)([(0,g.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,_.Cg)([(0,g.wk)()],w.prototype,"_config",void 0),w=(0,_.Cg)([(0,g.EM)("hui-updates-card")],w),n.d(i,{HuiUpdatesCard:function(){return w}}),a()}catch(b){a(b)}})}}]);
//# sourceMappingURL=76685.675d5c34788a586d.js.map