"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["61854"],{57150:function(e,t,i){i.d(t,{Q:function(){return n}});i(3362),i(62953);var s=i(1087);const a=()=>Promise.all([i.e("92769"),i.e("62453"),i.e("8477"),i.e("72130"),i.e("85010"),i.e("89385"),i.e("25582"),i.e("99788"),i.e("21543"),i.e("86909"),i.e("60521"),i.e("69960"),i.e("78398"),i.e("39005"),i.e("34310"),i.e("19112"),i.e("30002"),i.e("21519"),i.e("25322"),i.e("12009"),i.e("94860"),i.e("55076"),i.e("36332"),i.e("15862"),i.e("82529"),i.e("40069"),i.e("99023"),i.e("38285"),i.e("50319"),i.e("1990")]).then(i.bind(i,78305)),n=(e,t)=>{(0,s.r)(e,"show-dialog",{dialogTag:"hui-dialog-suggest-card",dialogImport:a,dialogParams:t})}},85633:function(e,t,i){i.d(t,{X:function(){return a}});i(3362),i(62953);var s=i(1087);const a=(e,t)=>{(0,s.r)(e,"show-dialog",{dialogTag:"hui-dialog-select-view",dialogImport:()=>Promise.all([i.e("4939"),i.e("30115"),i.e("40901")]).then(i.bind(i,54564)),dialogParams:t})}},39693:function(e,t,i){i.a(e,async function(e,s){try{i.r(t),i.d(t,{HuiUnusedEntities:function(){return w}});i(26910),i(62953);var a=i(40445),n=i(96196),o=i(77845),l=i(94333),c=(i(27661),i(67094),i(99939)),d=i(55212),h=i(83824),r=i(57150),u=i(85633),g=e([h]);h=(g.then?(await g)():g)[0];let v,f,p,_,b=e=>e;const C="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";class w extends n.WF{get _config(){return this.lovelace.config}updated(e){super.updated(e),e.has("lovelace")&&this._getUnusedEntities()}render(){return this.hass&&this.lovelace?"storage"===this.lovelace.mode&&!1===this.lovelace.editMode?n.s6:(0,n.qy)(v||(v=b` <div class="container"> ${0} <hui-entity-picker-table .hass="${0}" .narrow="${0}" .entities="${0}" @selected-changed="${0}"></hui-entity-picker-table> </div> <div class="fab ${0}"> <ha-fab .label="${0}" extended @click="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-fab> </div> `),this.narrow?"":(0,n.qy)(f||(f=b` <ha-card header="${0}"> <div class="card-content"> ${0} ${0} </div> </ha-card> `),this.hass.localize("ui.panel.lovelace.unused_entities.title"),this.hass.localize("ui.panel.lovelace.unused_entities.available_entities"),"storage"===this.lovelace.mode?(0,n.qy)(p||(p=b` <br>${0} `),this.hass.localize("ui.panel.lovelace.unused_entities.select_to_add")):""),this.hass,this.narrow,this._unusedEntities,this._handleSelectedChanged,(0,l.H)({selected:this._selectedEntities.length}),this.hass.localize("ui.panel.lovelace.editor.edit_card.add"),this._addToLovelaceView,C):n.s6}_getUnusedEntities(){if(!this.hass||!this.lovelace)return;this._selectedEntities=[];const e=(0,c.lZ)(this.hass,this._config);this._unusedEntities=[...e].sort()}_handleSelectedChanged(e){this._selectedEntities=e.detail.selectedEntities}_addToLovelaceView(){const e=(0,d.Bi)(this.hass,this._selectedEntities,{}),t=(0,d.ZI)(this._selectedEntities,{});1!==this.lovelace.config.views.length?(0,u.X)(this,{lovelaceConfig:this.lovelace.config,allowDashboardChange:!1,viewSelectedCallback:(i,s,a)=>{(0,r.Q)(this,{lovelaceConfig:this.lovelace.config,saveConfig:this.lovelace.saveConfig,path:[a],entities:this._selectedEntities,cardConfig:e,sectionConfig:t})}}):(0,r.Q)(this,{lovelaceConfig:this.lovelace.config,saveConfig:this.lovelace.saveConfig,path:[0],entities:this._selectedEntities,cardConfig:e,sectionConfig:t})}constructor(...e){super(...e),this.narrow=!1,this._unusedEntities=[],this._selectedEntities=[]}}w.styles=(0,n.AH)(_||(_=b`:host{overflow:hidden}.container{display:flex;flex-direction:column;height:100%}ha-card{--ha-card-box-shadow:none;--ha-card-border-radius:var(--ha-border-radius-square)}hui-entity-picker-table{flex-grow:1}.fab{position:sticky;float:var(--float-end);right:calc(16px + var(--safe-area-inset-right));bottom:calc(16px + var(--safe-area-inset-bottom));inset-inline-end:calc(16px + var(--safe-area-inset-right));inset-inline-start:initial;z-index:1}ha-fab{position:relative;bottom:calc(-80px - var(--safe-area-inset-bottom));transition:bottom .3s}.fab.selected ha-fab{bottom:0}`)),(0,a.Cg)([(0,o.MZ)({attribute:!1})],w.prototype,"lovelace",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],w.prototype,"narrow",void 0),(0,a.Cg)([(0,o.wk)()],w.prototype,"_unusedEntities",void 0),(0,a.Cg)([(0,o.wk)()],w.prototype,"_selectedEntities",void 0),w=(0,a.Cg)([(0,o.EM)("hui-unused-entities")],w),s()}catch(v){s(v)}})}}]);
//# sourceMappingURL=61854.7f1848f9ee80e7a5.js.map