iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
3 lines • 34.8 kB
JavaScript
/*! For license information please see 47457.64a3388ab4c596a1.js.LICENSE.txt */
export const __webpack_ids__=["47457"];export const __webpack_modules__={42983:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(44249),s=(i(92745),i(9359),i(56475),i(31526),i(87319),i(57243)),n=i(15093),o=i(27486),r=i(95262),d=i(36522),l=i(1416),c=i(17705),h=i(73192),u=(i(94279),i(37583),i(5460)),p=i(24360),v=e([u]);u=(v.then?(await v)():v)[0];(0,a.Z)([(0,n.Mo)("ha-statistic-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"statistic-types"})],key:"statisticTypes",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"allow-custom-entity"})],key:"allowCustomEntity",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1,type:Array})],key:"statisticIds",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Array,attribute:"include-statistics-unit-of-measurement"})],key:"includeStatisticsUnitOfMeasurement",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"include-unit-class"})],key:"includeUnitClass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"include-device-class"})],key:"includeDeviceClass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"entities-only"})],key:"entitiesOnly",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Array,attribute:"exclude-statistics"})],key:"excludeStatistics",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"helpMissingEntityUrl",value:()=>"/more-info/statistics/"},{kind:"field",decorators:[(0,n.SB)()],key:"_opened",value:void 0},{kind:"field",decorators:[(0,n.IO)("ha-combo-box",!0)],key:"comboBox",value:void 0},{kind:"field",key:"_init",value:()=>!1},{kind:"field",key:"_statistics",value:()=>[]},{kind:"field",decorators:[(0,n.SB)()],key:"_filteredItems",value(){}},{kind:"field",key:"_rowRenderer",value(){return e=>s.dy`<mwc-list-item graphic="avatar" twoline> ${e.state?s.dy`<state-badge slot="graphic" .stateObj="${e.state}" .hass="${this.hass}"></state-badge>`:""} <span>${e.name}</span> <span slot="secondary">${""===e.id||"__missing"===e.id?s.dy`<a target="_blank" rel="noopener noreferrer" href="${(0,h.R)(this.hass,this.helpMissingEntityUrl)}">${this.hass.localize("ui.components.statistic-picker.learn_more")}</a>`:e.id}</span> </mwc-list-item>`}},{kind:"field",key:"_getStatistics",value(){return(0,o.Z)(((e,t,i,a,s,n,o)=>{if(!e.length)return[{id:"",name:this.hass.localize("ui.components.statistic-picker.no_statistics"),strings:[]}];if(t){const i=(0,r.r)(t);e=e.filter((e=>i.includes(e.statistics_unit_of_measurement)))}if(i){const t=(0,r.r)(i);e=e.filter((e=>t.includes(e.unit_class)))}if(a){const t=(0,r.r)(a);e=e.filter((e=>{const i=this.hass.states[e.statistic_id];return!i||t.includes(i.attributes.device_class||"")}))}const d=[];return e.forEach((e=>{if(n&&e.statistic_id!==o&&n.includes(e.statistic_id))return;const t=this.hass.states[e.statistic_id];if(!t){if(!s){const t=e.statistic_id,i=(0,c.Kd)(this.hass,e.statistic_id,e);d.push({id:t,name:i,strings:[t,i]})}return}const i=e.statistic_id,a=(0,c.Kd)(this.hass,e.statistic_id,e);d.push({id:i,name:a,state:t,strings:[i,a]})})),d.length?(d.length>1&&d.sort(((e,t)=>(0,l.$K)(e.name||"",t.name||"",this.hass.locale.language))),d.push({id:"__missing",name:this.hass.localize("ui.components.statistic-picker.missing_entity"),strings:[]}),d):[{id:"",name:this.hass.localize("ui.components.statistic-picker.no_match"),strings:[]}]}))}},{kind:"method",key:"open",value:function(){this.comboBox?.open()}},{kind:"method",key:"focus",value:function(){this.comboBox?.focus()}},{kind:"method",key:"willUpdate",value:function(e){(!this.hasUpdated&&!this.statisticIds||e.has("statisticTypes"))&&this._getStatisticIds(),(!this._init&&this.statisticIds||e.has("_opened")&&this._opened)&&(this._init=!0,this.hasUpdated?this._statistics=this._getStatistics(this.statisticIds,this.includeStatisticsUnitOfMeasurement,this.includeUnitClass,this.includeDeviceClass,this.entitiesOnly,this.excludeStatistics,this.value):this.updateComplete.then((()=>{this._statistics=this._getStatistics(this.statisticIds,this.includeStatisticsUnitOfMeasurement,this.includeUnitClass,this.includeDeviceClass,this.entitiesOnly,this.excludeStatistics,this.value)})))}},{kind:"method",key:"render",value:function(){return 0===this._statistics.length?s.Ld:s.dy` <ha-combo-box .hass="${this.hass}" .label="${void 0===this.label&&this.hass?this.hass.localize("ui.components.statistic-picker.statistic"):this.label}" .value="${this._value}" .renderer="${this._rowRenderer}" .disabled="${this.disabled}" .allowCustomValue="${this.allowCustomEntity}" .items="${this._statistics}" .filteredItems="${this._filteredItems??this._statistics}" item-value-path="id" item-id-path="id" item-label-path="name" -changed="${this._openedChanged}" -changed="${this._statisticChanged}" -changed="${this._filterChanged}"></ha-combo-box> `}},{kind:"method",key:"_getStatisticIds",value:async function(){this.statisticIds=await(0,c.uR)(this.hass,this.statisticTypes)}},{kind:"get",key:"_value",value:function(){return this.value||""}},{kind:"method",key:"_statisticChanged",value:function(e){e.stopPropagation();let t=e.detail.value;"__missing"===t&&(t=""),t!==this._value&&this._setValue(t)}},{kind:"method",key:"_openedChanged",value:function(e){this._opened=e.detail.value}},{kind:"method",key:"_filterChanged",value:function(e){const t=e.detail.value.toLowerCase();this._filteredItems=t.length?(0,p.q)(t,this._statistics):void 0}},{kind:"method",key:"_setValue",value:function(e){this.value=e,setTimeout((()=>{(0,d.B)(this,"value-changed",{value:e}),(0,d.B)(this,"change")}),0)}}]}}),s.oi);t()}catch(e){t(e)}}))},52131:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(44249),s=(i(9359),i(56475),i(70104),i(57243)),n=i(15093),o=i(91583),r=i(36522),d=i(42983),l=e([d]);d=(l.then?(await l)():l)[0];(0,a.Z)([(0,n.Mo)("ha-statistics-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Array})],key:"value",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1,type:Array})],key:"statisticIds",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"statistic-types"})],key:"statisticTypes",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"picked-statistic-label"})],key:"pickedStatisticLabel",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"pick-statistic-label"})],key:"pickStatisticLabel",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"allow-custom-entity"})],key:"allowCustomEntity",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"include-statistics-unit-of-measurement"})],key:"includeStatisticsUnitOfMeasurement",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"include-unit-class"})],key:"includeUnitClass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"include-device-class"})],key:"includeDeviceClass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"ignore-restrictions-on-first-statistic"})],key:"ignoreRestrictionsOnFirstStatistic",value:()=>!1},{kind:"method",key:"render",value:function(){if(!this.hass)return s.Ld;const e=this.ignoreRestrictionsOnFirstStatistic&&this._currentStatistics.length<=1,t=e?void 0:this.includeStatisticsUnitOfMeasurement,i=e?void 0:this.includeUnitClass,a=e?void 0:this.includeDeviceClass,n=e?void 0:this.statisticTypes;return s.dy` ${(0,o.r)(this._currentStatistics,(e=>e),(e=>s.dy` <div> <ha-statistic-picker .curValue="${e}" .hass="${this.hass}" .includeStatisticsUnitOfMeasurement="${t}" .includeUnitClass="${i}" .includeDeviceClass="${a}" .value="${e}" .statisticTypes="${n}" .statisticIds="${this.statisticIds}" .label="${this.pickedStatisticLabel}" .excludeStatistics="${this.value}" .allowCustomEntity="${this.allowCustomEntity}" -changed="${this._statisticChanged}"></ha-statistic-picker> </div> `))} <div> <ha-statistic-picker .hass="${this.hass}" .includeStatisticsUnitOfMeasurement="${this.includeStatisticsUnitOfMeasurement}" .includeUnitClass="${this.includeUnitClass}" .includeDeviceClass="${this.includeDeviceClass}" .statisticTypes="${this.statisticTypes}" .statisticIds="${this.statisticIds}" .label="${this.pickStatisticLabel}" .excludeStatistics="${this.value}" .allowCustomEntity="${this.allowCustomEntity}" -changed="${this._addStatistic}"></ha-statistic-picker> </div> `}},{kind:"get",key:"_currentStatistics",value:function(){return this.value||[]}},{kind:"method",key:"_updateStatistics",value:async function(e){this.value=e,(0,r.B)(this,"value-changed",{value:e})}},{kind:"method",key:"_statisticChanged",value:function(e){e.stopPropagation();const t=e.currentTarget.curValue,i=e.detail.value;if(i===t)return;const a=this._currentStatistics;i&&!a.includes(i)?this._updateStatistics(a.map((e=>e===t?i:e))):this._updateStatistics(a.filter((e=>e!==t)))}},{kind:"method",key:"_addStatistic",value:async function(e){e.stopPropagation();const t=e.detail.value;if(!t)return;if(e.currentTarget.value="",!t)return;const i=this._currentStatistics;i.includes(t)||this._updateStatistics([...i,t])}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`:host{width:200px;display:block}ha-statistic-picker{display:block;width:100%;margin-top:8px}`}]}}),s.oi);t()}catch(e){t(e)}}))},83166:function(e,t,i){var a=i(44249),s=i(72621),n=i(1105),o=i(33990),r=i(57243),d=i(15093),l=i(5111);(0,a.Z)([(0,d.Mo)("ha-textfield")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"iconTrailing",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,d.IO)("input")],key:"formElement",value:void 0},{kind:"method",key:"updated",value:function(e){(0,s.Z)(i,"updated",this,3)([e]),(e.has("invalid")||e.has("errorMessage"))&&(this.setCustomValidity(this.invalid?this.errorMessage||this.validationMessage||"Invalid":""),(this.invalid||this.validateOnInitialRender||e.has("invalid")&&void 0!==e.get("invalid"))&&this.reportValidity()),e.has("autocomplete")&&(this.autocomplete?this.formElement.setAttribute("autocomplete",this.autocomplete):this.formElement.removeAttribute("autocomplete")),e.has("autocorrect")&&(this.autocorrect?this.formElement.setAttribute("autocorrect",this.autocorrect):this.formElement.removeAttribute("autocorrect")),e.has("inputSpellcheck")&&(this.inputSpellcheck?this.formElement.setAttribute("spellcheck",this.inputSpellcheck):this.formElement.removeAttribute("spellcheck"))}},{kind:"method",key:"renderIcon",value:function(e,t=!1){const i=t?"trailing":"leading";return r.dy` <span class="mdc-text-field__icon mdc-text-field__icon--${i}" tabindex="${t?1:-1}"> <slot name="${i}Icon"></slot> </span> `}},{kind:"field",static:!0,key:"styles",value:()=>[o.W,r.iv`.mdc-text-field__input{width:var(--ha-textfield-input-width,100%)}.mdc-text-field:not(.mdc-text-field--with-leading-icon){padding:var(--text-field-padding,0px 16px)}.mdc-text-field__affix--suffix{padding-left:var(--text-field-suffix-padding-left,12px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,12px);padding-inline-end:var(--text-field-suffix-padding-right,0px);direction:ltr}.mdc-text-field--with-leading-icon{padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,16px);direction:var(--direction)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:var(--text-field-suffix-padding-left,0px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,0px)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--suffix{color:var(--secondary-text-color)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon{color:var(--secondary-text-color)}.mdc-text-field__icon--leading{margin-inline-start:16px;margin-inline-end:8px;direction:var(--direction)}.mdc-text-field__icon--trailing{padding:var(--textfield-icon-trailing-padding,12px)}.mdc-floating-label:not(.mdc-floating-label--float-above){text-overflow:ellipsis;width:inherit;padding-right:30px;padding-inline-end:30px;padding-inline-start:initial;box-sizing:border-box;direction:var(--direction)}input{text-align:var(--text-field-text-align,start)}input[type=color]{height:20px}::-ms-reveal{display:none}:host([no-spinner]) input::-webkit-inner-spin-button,:host([no-spinner]) input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=color]::-webkit-color-swatch-wrapper{padding:0}:host([no-spinner]) input[type=number]{-moz-appearance:textfield}.mdc-text-field__ripple{overflow:hidden}.mdc-text-field{overflow:var(--text-field-overflow)}.mdc-floating-label{inset-inline-start:16px!important;inset-inline-end:initial!important;transform-origin:var(--float-start);direction:var(--direction);text-align:var(--float-start)}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px - var(--text-field-suffix-padding-left,0px));inset-inline-start:calc(48px + var(--text-field-suffix-padding-left,0px))!important;inset-inline-end:initial!important;direction:var(--direction)}.mdc-text-field__input[type=number]{direction:var(--direction)}.mdc-text-field__affix--prefix{padding-right:var(--text-field-prefix-padding-right,2px);padding-inline-end:var(--text-field-prefix-padding-right,2px);padding-inline-start:initial}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--prefix{color:var(--mdc-text-field-label-ink-color)}#helper-text ha-markdown{display:inline-block}`,"rtl"===l.E.document.dir?r.iv`.mdc-floating-label,.mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field__icon--leading,.mdc-text-field__input[type=number]{direction:rtl;--direction:rtl}`:r.iv``]}]}}),n.P)},38070:function(e,t,i){i.d(t,{Q:()=>a});const a=["relative","total","date","time","datetime"]},23656:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HuiStatisticsGraphCardEditor:()=>C});var s=i(44249),n=(i(92745),i(9359),i(56475),i(1331),i(31526),i(70104),i(52924),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(57243)),o=i(15093),r=i(27486),d=i(62900),l=i(95262),c=i(36522),h=i(48045),u=i(84892),p=i(52131),v=(i(29073),i(17705)),f=i(29401),m=i(18200),_=i(8148),b=i(56615),y=e([p,b,u]);[p,b,u]=y.then?(await y)():y;const g=(0,d.G0)([(0,d.i0)("state"),(0,d.i0)("sum"),(0,d.i0)("change"),(0,d.i0)("min"),(0,d.i0)("max"),(0,d.i0)("mean")]),x=(0,d.f0)(m.I,(0,d.Ry)({entities:(0,d.IX)(_.K),title:(0,d.jt)((0,d.Z_)()),days_to_show:(0,d.jt)((0,d.Rx)()),period:(0,d.jt)((0,d.G0)([(0,d.i0)("5minute"),(0,d.i0)("hour"),(0,d.i0)("day"),(0,d.i0)("week"),(0,d.i0)("month")])),chart_type:(0,d.jt)((0,d.G0)([(0,d.i0)("bar"),(0,d.i0)("line")])),stat_types:(0,d.jt)((0,d.G0)([(0,d.IX)(g),g])),unit:(0,d.jt)((0,d.Z_)()),hide_legend:(0,d.jt)((0,d.O7)()),logarithmic_scale:(0,d.jt)((0,d.O7)()),min_y_axis:(0,d.jt)((0,d.Rx)()),max_y_axis:(0,d.jt)((0,d.Rx)()),fit_y_data:(0,d.jt)((0,d.O7)())})),k=["5minute","hour","day","week","month"],w=["mean","min","max","sum","state","change"];let C=(0,s.Z)([(0,o.Mo)("hui-statistics-graph-card-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_config",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_configEntities",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_metaDatas",value:void 0},{kind:"method",key:"setConfig",value:function(e){(0,d.hu)(e,x),this._config=e,this._configEntities=e.entities?(0,f.A)(e.entities,!1).map((e=>e.entity)):[]}},{kind:"field",key:"_getStatisticsMetaData",value(){return async e=>{this._metaDatas=await(0,v.Py)(this.hass,e||[])}}},{kind:"method",key:"willUpdate",value:function(e){e.has("_configEntities")&&!(0,h.v)(this._configEntities,e.get("_configEntities"))&&(this._metaDatas=void 0,this._configEntities?.length&&this._getStatisticsMetaData(this._configEntities))}},{kind:"field",key:"_schema",value(){return(0,r.Z)(((e,t,i,a)=>{const s=new Set;i?.forEach((e=>{const t=(0,v.dO)(this.hass,e.statistic_id,e);t&&s.add(t)}));const n=[{name:"title",selector:{text:{}}},{name:"",type:"grid",schema:[{name:"period",required:!0,selector:{select:{options:k.map((i=>({value:i,label:e(`ui.panel.lovelace.editor.card.statistics-graph.periods.${i}`),disabled:"5minute"===i&&t?.some((e=>(0,v.Hs)(e)))})))}}},{name:"days_to_show",default:b.DEFAULT_DAYS_TO_SHOW,selector:{number:{min:1,mode:"box"}}},{name:"stat_types",required:!0,selector:{select:{multiple:!0,mode:"list",options:w.map((t=>({value:t,label:e(`ui.panel.lovelace.editor.card.statistics-graph.stat_type_labels.${t}`),disabled:!i||!i.some((e=>(0,v.Z0)(e,u.O[t])))})))}}},{name:"chart_type",required:!0,type:"select",options:[["line",e("ui.panel.lovelace.editor.card.statistics-graph.chart_type_labels.line")],["bar",e("ui.panel.lovelace.editor.card.statistics-graph.chart_type_labels.bar")]]},{name:"",type:"grid",schema:[{name:"min_y_axis",required:!1,selector:{number:{mode:"box",step:"any"}}},{name:"max_y_axis",required:!1,selector:{number:{mode:"box",step:"any"}}}]},...a?[{name:"fit_y_data",required:!1,selector:{boolean:{}}}]:[],{name:"hide_legend",required:!1,selector:{boolean:{}}},{name:"logarithmic_scale",required:!1,selector:{boolean:{}}}]}];return s.size>1&&n[1].schema.push({name:"unit",required:!1,selector:{select:{options:Array.from(s).map((e=>({value:e,label:e})))}}}),n}))}},{kind:"method",key:"render",value:function(){if(!this.hass||!this._config)return n.Ld;const e=this._schema(this.hass.localize,this._configEntities,this._metaDatas,void 0!==this._config.min_y_axis||void 0!==this._config.max_y_axis),t=this._config.stat_types?(0,l.r)(this._config.stat_types):w.filter((e=>this._metaDatas?.some((t=>(0,v.Z0)(t,e))))),i={chart_type:"line",period:"hour",...this._config,stat_types:t},a=this._metaDatas?.[0]?.unit_class,s=a?void 0:this._metaDatas?.[0]?.statistics_unit_of_measurement;return n.dy` <ha-form .hass="${this.hass}" .data="${i}" .schema="${e}" .computeLabel="${this._computeLabelCallback}" -changed="${this._valueChanged}"></ha-form> <ha-statistics-picker allow-custom-entity .hass="${this.hass}" .pickStatisticLabel="${this.hass.localize("ui.panel.lovelace.editor.card.statistics-graph.pick_statistic")}" .pickedStatisticLabel="${this.hass.localize("ui.panel.lovelace.editor.card.statistics-graph.picked_statistic")}" .includeStatisticsUnitOfMeasurement="${s}" .includeUnitClass="${a}" .ignoreRestrictionsOnFirstStatistic="${!0}" .value="${this._configEntities}" .configValue="${"entities"}" -changed="${this._entitiesChanged}"></ha-statistics-picker> `}},{kind:"method",key:"_valueChanged",value:function(e){(0,c.B)(this,"config-changed",{config:e.detail.value})}},{kind:"method",key:"_entitiesChanged",value:async function(e){const t=e.detail.value,i=t.map((e=>this._config.entities.find((t=>"string"!=typeof t&&t.entity===e))??e)),a={...this._config,entities:i};t?.some((e=>(0,v.Hs)(e)))&&"5minute"===a.period&&delete a.period;const s=a.stat_types||a.unit?await(0,v.Py)(this.hass,t):void 0;a.stat_types&&a.entities.length&&(a.stat_types=(0,l.r)(a.stat_types).filter((e=>s.some((t=>(0,v.Z0)(t,e))))),a.stat_types.length||delete a.stat_types),a.unit&&!s.some((e=>(0,v.dO)(this.hass,e?.statistic_id,e)===a.unit))&&delete a.unit,(0,c.B)(this,"config-changed",{config:a})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>{switch(e.name){case"chart_type":case"stat_types":case"period":case"unit":case"hide_legend":case"logarithmic_scale":case"min_y_axis":case"max_y_axis":case"fit_y_data":return this.hass.localize(`ui.panel.lovelace.editor.card.statistics-graph.${e.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`ha-statistics-picker{width:100%}`}]}}),n.oi);a()}catch(e){a(e)}}))},18200:function(e,t,i){i.d(t,{I:()=>s});var a=i(62900);const s=(0,a.Ry)({type:(0,a.Z_)(),view_layout:(0,a.Yj)(),layout_options:(0,a.Yj)(),grid_options:(0,a.Yj)(),visibility:(0,a.Yj)()})},8148:function(e,t,i){i.d(t,{K:()=>o});var a=i(62900),s=i(38070),n=i(30571);const o=(0,a.G0)([(0,a.Ry)({entity:(0,a.Z_)(),name:(0,a.jt)((0,a.Z_)()),icon:(0,a.jt)((0,a.Z_)()),image:(0,a.jt)((0,a.Z_)()),secondary_info:(0,a.jt)((0,a.Z_)()),format:(0,a.jt)((0,a.kE)(s.Q)),state_color:(0,a.jt)((0,a.O7)()),tap_action:(0,a.jt)(n.fJ),hold_action:(0,a.jt)(n.fJ),double_tap_action:(0,a.jt)(n.fJ),confirmation:(0,a.jt)(n.TX)}),(0,a.Z_)()])},10445:function(e,t,i){i.d(t,{X:()=>h});var a=i(9065),s=i(15093),n=(i(54835),i(57243)),o=i(4077);class r extends o.A{constructor(){super(...arguments),this.elevated=!1,this.href="",this.target=""}get primaryId(){return this.href?"link":"button"}get rippleDisabled(){return!this.href&&(this.disabled||this.softDisabled)}getContainerClasses(){return{...super.getContainerClasses(),disabled:!this.href&&(this.disabled||this.softDisabled),elevated:this.elevated,link:!!this.href}}renderPrimaryAction(e){const{ariaLabel:t}=this;return this.href?n.dy` <a class="primary action" id="link" aria-label="${t||n.Ld}" href="${this.href}" target="${this.target||n.Ld}">${e}</a> `:n.dy` <button class="primary action" id="button" aria-label="${t||n.Ld}" aria-disabled="${this.softDisabled||n.Ld}" ?disabled="${this.disabled&&!this.alwaysFocusable}" type="button">${e}</button> `}renderOutline(){return this.elevated?n.dy`<md-elevation part="elevation"></md-elevation>`:super.renderOutline()}}(0,a.__decorate)([(0,s.Cb)({type:Boolean})],r.prototype,"elevated",void 0),(0,a.__decorate)([(0,s.Cb)()],r.prototype,"href",void 0),(0,a.__decorate)([(0,s.Cb)()],r.prototype,"target",void 0);const d=n.iv`:host{--_container-height:var(--md-assist-chip-container-height, 32px);--_disabled-label-text-color:var(--md-assist-chip-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity:var(--md-assist-chip-disabled-label-text-opacity, 0.38);--_elevated-container-color:var(--md-assist-chip-elevated-container-color, var(--md-sys-color-surface-container-low, #f7f2fa));--_elevated-container-elevation:var(--md-assist-chip-elevated-container-elevation, 1);--_elevated-container-shadow-color:var(--md-assist-chip-elevated-container-shadow-color, var(--md-sys-color-shadow, #000));--_elevated-disabled-container-color:var(--md-assist-chip-elevated-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_elevated-disabled-container-elevation:var(--md-assist-chip-elevated-disabled-container-elevation, 0);--_elevated-disabled-container-opacity:var(--md-assist-chip-elevated-disabled-container-opacity, 0.12);--_elevated-focus-container-elevation:var(--md-assist-chip-elevated-focus-container-elevation, 1);--_elevated-hover-container-elevation:var(--md-assist-chip-elevated-hover-container-elevation, 2);--_elevated-pressed-container-elevation:var(--md-assist-chip-elevated-pressed-container-elevation, 1);--_focus-label-text-color:var(--md-assist-chip-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color:var(--md-assist-chip-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-color:var(--md-assist-chip-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity:var(--md-assist-chip-hover-state-layer-opacity, 0.08);--_label-text-color:var(--md-assist-chip-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-font:var(--md-assist-chip-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height:var(--md-assist-chip-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size:var(--md-assist-chip-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight:var(--md-assist-chip-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-label-text-color:var(--md-assist-chip-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-state-layer-color:var(--md-assist-chip-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-state-layer-opacity:var(--md-assist-chip-pressed-state-layer-opacity, 0.12);--_disabled-outline-color:var(--md-assist-chip-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity:var(--md-assist-chip-disabled-outline-opacity, 0.12);--_focus-outline-color:var(--md-assist-chip-focus-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_outline-color:var(--md-assist-chip-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width:var(--md-assist-chip-outline-width, 1px);--_disabled-leading-icon-color:var(--md-assist-chip-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity:var(--md-assist-chip-disabled-leading-icon-opacity, 0.38);--_focus-leading-icon-color:var(--md-assist-chip-focus-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-leading-icon-color:var(--md-assist-chip-hover-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_leading-icon-color:var(--md-assist-chip-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size:var(--md-assist-chip-icon-size, 18px);--_pressed-leading-icon-color:var(--md-assist-chip-pressed-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_container-shape-start-start:var(--md-assist-chip-container-shape-start-start, var(--md-assist-chip-container-shape, var(--md-sys-shape-corner-small, 8px)));--_container-shape-start-end:var(--md-assist-chip-container-shape-start-end, var(--md-assist-chip-container-shape, var(--md-sys-shape-corner-small, 8px)));--_container-shape-end-end:var(--md-assist-chip-container-shape-end-end, var(--md-assist-chip-container-shape, var(--md-sys-shape-corner-small, 8px)));--_container-shape-end-start:var(--md-assist-chip-container-shape-end-start, var(--md-assist-chip-container-shape, var(--md-sys-shape-corner-small, 8px)));--_leading-space:var(--md-assist-chip-leading-space, 16px);--_trailing-space:var(--md-assist-chip-trailing-space, 16px);--_icon-label-space:var(--md-assist-chip-icon-label-space, 8px);--_with-leading-icon-leading-space:var(--md-assist-chip-with-leading-icon-leading-space, 8px)} {.link .outline{border-color:ActiveText}}`;var l=i(29126),c=i(21016);let h=class extends r{};h.styles=[c.W,l.W,d],h=(0,a.__decorate)([(0,s.Mo)("md-assist-chip")],h)},4077:function(e,t,i){i.d(t,{A:()=>d});var a=i(9065),s=(i(57618),i(23111),i(57243)),n=i(15093),o=i(35359);const r=(0,i(13823).T)(s.oi);class d extends r{get rippleDisabled(){return this.disabled||this.softDisabled}constructor(){super(),this.disabled=!1,this.softDisabled=!1,this.alwaysFocusable=!1,this.label="",this.hasIcon=!1,s.sk||this.addEventListener("click",this.handleClick.bind(this))}focus(e){this.disabled&&!this.alwaysFocusable||super.focus(e)}render(){return s.dy` <div class="container ${(0,o.$)(this.getContainerClasses())}"> ${this.renderContainerContent()} </div> `}updated(e){e.has("disabled")&&void 0!==e.get("disabled")&&this.dispatchEvent(new Event("update-focus",{bubbles:!0}))}getContainerClasses(){return{disabled:this.disabled||this.softDisabled,"has-icon":this.hasIcon}}renderContainerContent(){return s.dy` ${this.renderOutline()} <md-focus-ring part="focus-ring" for="${this.primaryId}"></md-focus-ring> <md-ripple for="${this.primaryId}" ?disabled="${this.rippleDisabled}"></md-ripple> ${this.renderPrimaryAction(this.renderPrimaryContent())} `}renderOutline(){return s.dy`<span class="outline"></span>`}renderLeadingIcon(){return s.dy`<slot name="icon" ="${this.handleIconChange}"></slot>`}renderPrimaryContent(){return s.dy` <span class="leading icon" aria-hidden="true"> ${this.renderLeadingIcon()} </span> <span class="label"> <span class="label-text" id="label"> ${this.label?this.label:s.dy`<slot></slot>`} </span> </span> <span class="touch"></span> `}handleIconChange(e){const t=e.target;this.hasIcon=t.assignedElements({flatten:!0}).length>0}handleClick(e){if(this.softDisabled||this.disabled&&this.alwaysFocusable)return e.stopImmediatePropagation(),void e.preventDefault()}}d.shadowRootOptions={...s.oi.shadowRootOptions,delegatesFocus:!0},(0,a.__decorate)([(0,n.Cb)({type:Boolean,reflect:!0})],d.prototype,"disabled",void 0),(0,a.__decorate)([(0,n.Cb)({type:Boolean,attribute:"soft-disabled",reflect:!0})],d.prototype,"softDisabled",void 0),(0,a.__decorate)([(0,n.Cb)({type:Boolean,attribute:"always-focusable"})],d.prototype,"alwaysFocusable",void 0),(0,a.__decorate)([(0,n.Cb)()],d.prototype,"label",void 0),(0,a.__decorate)([(0,n.Cb)({type:Boolean,reflect:!0,attribute:"has-icon"})],d.prototype,"hasIcon",void 0)},29126:function(e,t,i){i.d(t,{W:()=>a});const a=i(57243).iv`.elevated{--md-elevation-level:var(--_elevated-container-elevation);--md-elevation-shadow-color:var(--_elevated-container-shadow-color)}.elevated::before{background:var(--_elevated-container-color)}.elevated:hover{--md-elevation-level:var(--_elevated-hover-container-elevation)}.elevated:focus-within{--md-elevation-level:var(--_elevated-focus-container-elevation)}.elevated:active{--md-elevation-level:var(--_elevated-pressed-container-elevation)}.elevated.disabled{--md-elevation-level:var(--_elevated-disabled-container-elevation)}.elevated.disabled::before{background:var(--_elevated-disabled-container-color);opacity:var(--_elevated-disabled-container-opacity)} {.elevated md-elevation{border:1px solid CanvasText}.elevated.disabled md-elevation{border-color:GrayText}}`},21016:function(e,t,i){i.d(t,{W:()=>a});const a=i(57243).iv`:host{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end);display:inline-flex;height:var(--_container-height);cursor:pointer;-webkit-tap-highlight-color:transparent;--md-ripple-hover-color:var(--_hover-state-layer-color);--md-ripple-hover-opacity:var(--_hover-state-layer-opacity);--md-ripple-pressed-color:var(--_pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_pressed-state-layer-opacity)}:host(:is([disabled],[soft-disabled])){pointer-events:none}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_container-height))/2) 0}md-focus-ring{--md-focus-ring-shape-start-start:var(--_container-shape-start-start);--md-focus-ring-shape-start-end:var(--_container-shape-start-end);--md-focus-ring-shape-end-end:var(--_container-shape-end-end);--md-focus-ring-shape-end-start:var(--_container-shape-end-start)}.container{border-radius:inherit;box-sizing:border-box;display:flex;height:100%;position:relative;width:100%}.container::before{border-radius:inherit;content:"";inset:0;pointer-events:none;position:absolute}.container:not(.disabled){cursor:pointer}.container.disabled{pointer-events:none}.cell{display:flex}.action{align-items:baseline;appearance:none;background:0 0;border:none;border-radius:inherit;display:flex;outline:0;padding:0;position:relative;text-decoration:none}.primary.action{min-width:0;padding-inline-start:var(--_leading-space);padding-inline-end:var(--_trailing-space)}.has-icon .primary.action{padding-inline-start:var(--_with-leading-icon-leading-space)}.touch{height:48px;inset:50% 0 0;position:absolute;transform:translateY(-50%);width:100%}:host([touch-target=none]) .touch{display:none}.outline{border:var(--_outline-width) solid var(--_outline-color);border-radius:inherit;inset:0;pointer-events:none;position:absolute}:where(:focus) .outline{border-color:var(--_focus-outline-color)}:where(.disabled) .outline{border-color:var(--_disabled-outline-color);opacity:var(--_disabled-outline-opacity)}md-ripple{border-radius:inherit}.icon,.label,.touch{z-index:1}.label{align-items:center;color:var(--_label-text-color);display:flex;font-family:var(--_label-text-font);font-size:var(--_label-text-size);font-weight:var(--_label-text-weight);height:100%;line-height:var(--_label-text-line-height);overflow:hidden;user-select:none}.label-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(:hover) .label{color:var(--_hover-label-text-color)}:where(:focus) .label{color:var(--_focus-label-text-color)}:where(:active) .label{color:var(--_pressed-label-text-color)}:where(.disabled) .label{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.icon{align-self:center;display:flex;fill:currentColor;position:relative}.icon ::slotted(:first-child){font-size:var(--_icon-size);height:var(--_icon-size);width:var(--_icon-size)}.leading.icon{color:var(--_leading-icon-color)}.leading.icon ::slotted(*),.leading.icon svg{margin-inline-end:var(--_icon-label-space)}:where(:hover) .leading.icon{color:var(--_hover-leading-icon-color)}:where(:focus) .leading.icon{color:var(--_focus-leading-icon-color)}:where(:active) .leading.icon{color:var(--_pressed-leading-icon-color)}:where(.disabled) .leading.icon{color:var(--_disabled-leading-icon-color);opacity:var(--_disabled-leading-icon-opacity)} {:where(.disabled) :is(.label,.outline,.leading.icon){color:GrayText;opacity:1}}a,button{text-transform:inherit}a,button:not(:disabled,[aria-disabled=true]){cursor:inherit}`},5376:function(e,t,i){i.d(t,{X:()=>o});var a=i(34151),s=i(76808),n=i(14276);function o(e,t,i){const o=(0,n._)(e,t)/s.yJ;return(0,a.u)(i?.roundingMethod)(o)}}};
//# sourceMappingURL=47457.64a3388ab4c596a1.js.map