"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["51603"],{44830:function(t,e,n){n.r(e),n.d(e,{CommonControlsSectionStrategy:function(){return _}});var i=n(61397),r=n(7739),o=n(50264),l=n(44734),s=n(43080),c=n(69683),u=n(6454),a=(n(2008),n(74423),n(62062),n(44114),n(34782),n(13609),n(18111),n(22489),n(61701),n(26099),n(21699),n(40445)),d=n(96196),p=n(77845),f=n(36312),h=function(t){return t.callWS({type:"usage_prediction/common_control"})},_=function(t){function e(){return(0,l.A)(this,e),(0,c.A)(this,e,arguments)}return(0,u.A)(e,t),(0,s.A)(e,null,[{key:"generate",value:(n=(0,o.A)((0,i.A)().m(function t(e,n){var o,l,s,c,u,a,d,p,_,m;return(0,i.A)().w(function(t){for(;;)switch(t.n){case 0:if(c={type:"grid",cards:[]},e.title&&(null===(u=c.cards)||void 0===u||u.push({type:"heading",heading:e.title,icon:e.icon,visibility:e.title_visibilty})),(0,f.x)(n,"usage_prediction")){t.n=1;break}return c.cards.push({type:"markdown",content:n.localize("ui.panel.lovelace.strategy.common_controls.not_loaded")}),c.disabled=e.hide_empty,t.a(2,c);case 1:return t.n=2,h(n);case 2:return a=t.v,d=a.entities.filter(function(t){return t in n.states}),null!==(o=e.exclude_entities)&&void 0!==o&&o.length&&(d=d.filter(function(t){return!e.exclude_entities.includes(t)})),null!==(l=e.include_entities)&&void 0!==l&&l.length&&(d=d.filter(function(t){return!e.include_entities.includes(t)}),(p=d).unshift.apply(p,(0,r.A)(e.include_entities.filter(function(t){return t in n.states})))),_=null!==(s=e.limit)&&void 0!==s?s:8,(d=d.slice(0,_)).length>0?(m=c.cards).push.apply(m,(0,r.A)(d.map(function(t){return{type:"tile",entity:t,show_entity_picture:!0}}))):(c.cards.push({type:"markdown",content:n.localize("ui.panel.lovelace.strategy.common_controls.no_data")}),c.disabled=e.hide_empty),t.a(2,c)}},t)})),function(t,e){return n.apply(this,arguments)})}]);var n}(d.mN);_=(0,a.Cg)([(0,p.EM)("common-controls-section-strategy")],_)}}]);
//# sourceMappingURL=51603.cf5b468c6fbaa011.js.map