iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
14 lines • 53.5 kB
JavaScript
/*! For license information please see 41132.486d364355f65379.js.LICENSE.txt */
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[41132],{93421:function(e,t,i){i.d(t,{IW:function(){return d},dH:function(){return c},fI:function(){return l}});i(44114),i(62953);var a=i(35211),o=i(22792),s=i(32172);const r=(e,t)=>{let i=e;for(const a of t){if(null==i)return;i=i[a]}return i},n=(e,t,i)=>{const o=(0,s.p)({transformer:function(e){return i.call(this,e)},watch:t?[t]:[]}),r=(0,a.Fg)({context:e,subscribe:!0});return(e,t)=>{o(e,t),r(e,t)}},l=e=>n(o.iN,e.entityIdPath[0],function(t){const i=r(this,e.entityIdPath);return"string"==typeof i?null==t?void 0:t[i]:void 0}),c=e=>n(o.X1,e.entityIdPath[0],function(t){const i=r(this,e.entityIdPath);return"string"==typeof i?null==t?void 0:t[i]:void 0}),d=()=>n(o.D5,void 0,({localize:e})=>e)},32172:function(e,t,i){i.d(t,{p:function(){return a}});i(16280),i(18111),i(7588),i(45367),i(92731),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);function a(e){return(t,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const a=String(i),o=t;if(o._transformers){if(!o.hasOwnProperty("_transformers")){const e=o._transformers;o._transformers=new Map,e.forEach((e,t)=>o._transformers.set(t,e))}}else{o._transformers=new Map,o._watching=new Map;const e=o.willUpdate;o.willUpdate=function(t){e.call(this,t);const i=new Set;t.forEach((e,t)=>{const a=this._watching.get(t);void 0!==a&&a.forEach(e=>i.add(e))}),i.forEach(e=>{this[e]=this[`__original_${String(e)}`]})}}o._transformers.set(i,e.transformer),e.watch&&e.watch.forEach(e=>{let t=o._watching.get(e);t||(t=new Set,o._watching.set(e,t)),t.add(i)});const s=Object.getOwnPropertyDescriptor(t,i);let r;if(void 0===s)r={get(){return this[`__transform_${a}`]},set(e){const t=this[`__transform_${a}`],i=this._transformers.get(a);this[`__transform_${a}`]=i?i.call(this,e):e,this[`__original_${a}`]=e,this.requestUpdate(a,t)},configurable:!0,enumerable:!0};else{const e=s.set;r=Object.assign(Object.assign({},s),{},{set(t){const i=this[`__transform_${a}`],o=this._transformers.get(a);this[`__transform_${a}`]=o?o.call(this,t):t,this[`__original_${a}`]=t,this.requestUpdate(a,i),null==e||e.call(this,t)}})}Object.defineProperty(t,i,r)}}},17451:function(e,t,i){i.d(t,{j:function(){return a}});const a=(e,t,i)=>(void 0!==i&&(i=!!i),e.hasAttribute(t)?!!i||(e.removeAttribute(t),!1):!1!==i&&(e.setAttribute(t,""),!0))},52943:function(e,t,i){i.d(t,{Z:function(){return a}});const a=e=>e.charAt(0).toUpperCase()+e.slice(1)},19459:function(e,t,i){i.d(t,{b:function(){return a}});i(45367),i(92731),i(84864),i(57465),i(27495),i(69479),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);const a=(e,t,i)=>{if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;let o,s;if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(o=s;0!==o--;)if(!a(e[o],t[o],i))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!a(o[1],t.get(o[0]),i))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(s=e.length,s!==t.length)return!1;for(o=s;0!==o--;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const r=Object.keys(e);if(s=r.length,s!==Object.keys(t).length)return!1;for(o=s;0!==o--;)if(!Object.prototype.hasOwnProperty.call(t,r[o]))return!1;for(o=s;0!==o--;){const s=r[o];if(!a(e[s],t[s],i))return!1}if(null!=i&&i.compareSymbols){const o=Object.getOwnPropertySymbols(e),s=Object.getOwnPropertySymbols(t);if(o.length!==s.length)return!1;for(const r of o){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;if(!a(e[r],t[r],i))return!1}}return!0}return e!=e&&t!=t}},38962:function(e,t,i){i.a(e,async function(e,a){try{i.r(t);i(62953);var o=i(40445),s=i(5124),r=i(67576),n=i(6412),l=i(93421),c=i(1087),d=i(26300),h=(i(67094),e([d]));d=(h.then?(await h)():h)[0];let u,p,g,f,m=e=>e;const b="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",v={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class _ extends s.WF{render(){var e;return(0,s.qy)(u||(u=m` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,n.H)({[this.alertType]:!0}),this.title?"":"no-title",v[this.alertType],(0,n.H)({content:!0,narrow:this.narrow}),this.title?(0,s.qy)(p||(p=m`<div class="title">${0}</div>`),this.title):s.s6,this.dismissable?(0,s.qy)(g||(g=m`<ha-icon-button @click="${0}" .label="${0}" .path="${0}"></ha-icon-button>`),this._dismissClicked,null===(e=this._localize)||void 0===e?void 0:e.call(this,"ui.common.dismiss_alert"),b):s.s6)}_dismissClicked(){(0,c.r)(this,"alert-dismissed-clicked")}constructor(...e){super(...e),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}_.styles=(0,s.AH)(f||(f=m`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`)),(0,o.Cg)([(0,r.MZ)()],_.prototype,"title",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"alert-type"})],_.prototype,"alertType",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],_.prototype,"dismissable",void 0),(0,o.Cg)([(0,r.wk)(),(0,l.IW)()],_.prototype,"_localize",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],_.prototype,"narrow",void 0),_=(0,o.Cg)([(0,r.EM)("ha-alert")],_),a()}catch(u){a(u)}})},76776:function(e,t,i){i(62953);var a=i(40445),o=i(5124),s=i(67576);let r,n,l,c=e=>e;class d extends o.WF{render(){return(0,o.qy)(r||(r=c` ${0} <slot></slot> `),this.header?(0,o.qy)(n||(n=c`<h1 class="card-header">${0}</h1>`),this.header):o.s6)}constructor(...e){super(...e),this.raised=!1}}d.styles=(0,o.AH)(l||(l=c`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, var(--ha-font-size-2xl));letter-spacing:-.012em;line-height:var(--ha-line-height-expanded);padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4);display:block;margin-block-start:0;margin-block-end:0;font-weight:var(--ha-font-weight-normal)}
:host
::slotted(
.card-content:not(:nth-child(1 of .card-content, .card-header))
),
slot:not(:first-child)::slotted(.card-content) {
padding-top: 0;
margin-top: calc(var(--ha-space-2) * -1);
}
:host ::slotted(.card-content){padding:var(--ha-space-4)}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:var(--ha-space-2)}`)),(0,a.Cg)([(0,s.MZ)()],d.prototype,"header",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],d.prototype,"raised",void 0),d=(0,a.Cg)([(0,s.EM)("ha-card")],d)},65829:function(e,t,i){i.a(e,async function(e,a){try{i.r(t),i.d(t,{HaSpinner:function(){return h}});var o=i(40445),s=i(55262),r=i(5124),n=i(67576),l=e([s]);s=(l.then?(await l)():l)[0];let c,d=e=>e;class h extends s.A{updated(e){if(super.updated(e),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}static get styles(){return[s.A.styles,(0,r.AH)(c||(c=d`:host{--indicator-color:var(
--ha-spinner-indicator-color,
var(--primary-color)
);--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`))]}}(0,o.Cg)([(0,n.MZ)()],h.prototype,"size",void 0),h=(0,o.Cg)([(0,n.EM)("ha-spinner")],h),a()}catch(c){a(c)}})},82e3:function(e,t,i){i.d(t,{D5:function(){return a},Fy:function(){return r},Gk:function(){return c},Hg:function(){return o},Y_:function(){return d},ds:function(){return l},e0:function(){return s},ec:function(){return n}});i(74423),i(18111),i(61701),i(33110),i(3362);const a=14881==i.j?`${location.protocol}//${location.host}`:null,o=e=>e.map(e=>{if("string"!==e.type)return e;switch(e.name){case"username":return Object.assign(Object.assign({},e),{},{autocomplete:"username",autofocus:!0});case"password":return Object.assign(Object.assign({},e),{},{autocomplete:"current-password"});case"code":return Object.assign(Object.assign({},e),{},{autocomplete:"one-time-code",autofocus:!0});default:return e}}),s=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),r=async(e,t,i,a)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:i,password:a}),n=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:i}),l=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:i}),c=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:i}),d=(e,t,i)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:i})},23528:function(e,t,i){i.a(e,async function(e,a){try{i.d(t,{$3:function(){return b},$O:function(){return k},$j:function(){return v},ED:function(){return n},JE:function(){return L},OQ:function(){return M},PU:function(){return S},Ph:function(){return f},Uf:function(){return $},W1:function(){return m},Wr:function(){return u},Z:function(){return d},gF:function(){return _},iY:function(){return w},jU:function(){return l},nN:function(){return x},p3:function(){return h},pJ:function(){return g},r_:function(){return c},sz:function(){return p}});i(74423),i(18111),i(13579),i(62953);var o=i(28978),s=i(380),r=e([s]);s=(r.then?(await r)():r)[0];var n=function(e){return e[e.NONE=0]="NONE",e[e.ARITHMETIC=1]="ARITHMETIC",e[e.CIRCULAR=2]="CIRCULAR",e}({});const l=["entity_not_recorded","entity_no_longer_recorded","state_class_removed","units_changed","mean_type_changed","no_state"],c=["L","gal","ft³","m³","CCF","MCF"],d=e=>e.sendMessagePromise({type:"recorder/info"}),h=(e,t)=>e.callWS({type:"recorder/list_statistic_ids",statistic_type:t}),u=(e,t)=>e.callWS({type:"recorder/get_statistics_metadata",statistic_ids:t}),p=(e,t,i,a,o="hour",s,r)=>e.callWS({type:"recorder/statistics_during_period",start_time:t.toISOString(),end_time:null==i?void 0:i.toISOString(),statistic_ids:a,period:o,units:s,types:r}),g=(e,t,i,a)=>e.callWS({type:"recorder/statistic_during_period",statistic_id:t,units:a,fixed_period:i.fixed_period?{start_time:i.fixed_period.start instanceof Date?i.fixed_period.start.toISOString():i.fixed_period.start,end_time:i.fixed_period.end instanceof Date?i.fixed_period.end.toISOString():i.fixed_period.end}:void 0,calendar:i.calendar?Object.assign(Object.assign({},"week"===i.calendar.period?{first_weekday:(0,s.D)(e.locale).substring(0,3)}:{}),i.calendar):void 0,rolling_window:i.rolling_window}),f=e=>e.callWS({type:"recorder/validate_statistics"}),m=(e,t,i,a)=>e.callWS({type:"recorder/update_statistics_metadata",statistic_id:t,unit_of_measurement:i,unit_class:a}),b=(e,t)=>e.callWS({type:"recorder/clear_statistics",statistic_ids:t}),v=e=>{let t=null;if(!e)return null;for(const i of e)null!==i.change&&void 0!==i.change&&(null===t?t=i.change:t+=i.change);return t},_=(e,t)=>{let i=null;for(const a of t){if(!(a in e))continue;const t=v(e[a]);null!==t&&(null===i?i=t:i+=t)}return i},w=(e,t)=>e.some(e=>void 0!==e[t]&&null!==e[t]),y=["mean","min","max"],C=["sum","state","change"],x=(e,t)=>!(!y.includes(t)||0===e.mean_type)||!(!C.includes(t)||!e.has_sum),$=(e,t,i,a,o)=>{const s=new Date(i).toISOString();return e.callWS({type:"recorder/adjust_sum_statistics",statistic_id:t,start_time:s,adjustment:a,adjustment_unit_of_measurement:o})},k=(e,t,i)=>{const a=e.states[t];return a?(0,o.u)(a):(null==i?void 0:i.name)||t},L=(e,t,i)=>{let a;var o;t&&(a=null===(o=e.states[t])||void 0===o?void 0:o.attributes.unit_of_measurement);return void 0===a?null==i?void 0:i.statistics_unit_of_measurement:a},M=e=>e.includes(":"),S=e=>e.callWS({type:"recorder/update_statistics_issues"});a()}catch(l){a(l)}})},71606:function(e,t,i){i.d(t,{f:function(){return o},o:function(){return a}});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);const a=new Set(["automation","script","scene","group"]),o=(e,t,i)=>e.callWS({type:"search/related",item_type:t,item_id:i})},28669:function(e,t,i){i.d(t,{TK:function(){return n},_2:function(){return c},eR:function(){return o},hG:function(){return l},hU:function(){return s},kg:function(){return r},wj:function(){return a},xg:function(){return d}});i(44114),i(18111),i(61701),i(3362),i(42762);const a="system-admin",o="system-users",s=async e=>e.callWS({type:"config/auth/list"}),r=async(e,t,i,a)=>e.callWS({type:"config/auth/create",name:t,group_ids:i,local_only:a}),n=async(e,t,i)=>e.callWS(Object.assign(Object.assign({},i),{},{type:"config/auth/update",user_id:t})),l=async(e,t)=>e.callWS({type:"config/auth/delete",user_id:t}),c=e=>e?e.trim().split(" ").slice(0,3).map(e=>e.substring(0,1)).join(""):"?",d=(e,t,i)=>{const a=[],o=t=>e.localize(`ui.panel.config.users.${t}`);return t.is_owner&&a.push(["M12 2C6.47 2 2 6.5 2 12C2 17.5 6.5 22 12 22S22 17.5 22 12 17.5 2 12 2M12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4S20 7.58 20 12C20 16.42 16.42 20 12 20M8 14L7 8L10 10L12 7L14 10L17 8L16 14H8M8.56 16C8.22 16 8 15.78 8 15.44V15H16V15.44C16 15.78 15.78 16 15.44 16H8.56Z",o("is_owner")]),i&&t.system_generated&&a.push(["M11,7H15V9H11V11H13A2,2 0 0,1 15,13V15A2,2 0 0,1 13,17H9V15H13V13H11A2,2 0 0,1 9,11V9A2,2 0 0,1 11,7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z",o("is_system")]),t.local_only&&a.push(["M12 20C7.6 20 4 16.4 4 12S7.6 4 12 4 20 7.6 20 12 16.4 20 12 20M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M11 14H13V17H16V12H18L12 7L6 12H8V17H11V14",o("is_local")]),t.is_active||a.push(["M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",o("is_not_active")]),a}},71341:function(e,t,i){i.a(e,async function(e,a){try{i.r(t);i(74423),i(44114),i(26910),i(18111),i(22489),i(20116),i(7588),i(61701),i(13579),i(3362),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var o=i(40445),s=(i(68825),i(35211)),r=i(5124),n=i(67576),l=i(22786),c=i(1087),d=i(65522),h=i(37981),u=i(81816),p=i(28978),g=(i(34296),i(48091)),f=i(86368),m=i(18350),b=i(29823),v=(i(70947),i(36866)),_=i(23528),w=i(22792),y=i(29303),C=i(79172),x=i(14503),$=i(33963),k=i(5936),L=i(36959),M=e([g,m,b,v,y,$,_]);[g,m,b,v,y,$,_]=M.then?(await M)():M;let S,O,A,H,E,z,j,D,P,V,q,T,Z,I,W,U,N,F,B,G=e=>e;const R="M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z",J="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z",K="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",X="M3,5H9V11H3V5M5,7V9H7V7H5M11,7H21V9H11V7M11,15H21V17H11V15M5,20L1.5,16.5L2.91,15.09L5,17.17L9.59,12.59L11,14L5,20Z",Y="M7,10L12,15L17,10H7Z",Q="M22,13V22H2V19L22,13M21.68,7.06L16.86,4.46L17.7,7.24L7.58,10.24C6.63,8.95 4.82,8.67 3.53,9.62C2.24,10.57 1.96,12.38 2.91,13.67C3.85,14.97 5.67,15.24 6.96,14.29C7.67,13.78 8.1,12.97 8.14,12.09L18.26,9.09L19.1,11.87L21.68,7.06Z",ee="M3 3H17C18.11 3 19 3.9 19 5V12.08C17.45 11.82 15.92 12.18 14.68 13H11V17H12.08C11.97 17.68 11.97 18.35 12.08 19H3C1.9 19 1 18.11 1 17V5C1 3.9 1.9 3 3 3M3 7V11H9V7H3M11 7V11H17V7H11M3 13V17H9V13H3M22.78 19.32L21.71 18.5C21.73 18.33 21.75 18.17 21.75 18S21.74 17.67 21.71 17.5L22.77 16.68C22.86 16.6 22.89 16.47 22.83 16.36L21.83 14.63C21.77 14.5 21.64 14.5 21.5 14.5L20.28 15C20 14.82 19.74 14.65 19.43 14.53L19.24 13.21C19.23 13.09 19.12 13 19 13H17C16.88 13 16.77 13.09 16.75 13.21L16.56 14.53C16.26 14.66 15.97 14.82 15.71 15L14.47 14.5C14.36 14.5 14.23 14.5 14.16 14.63L13.16 16.36C13.1 16.47 13.12 16.6 13.22 16.68L14.28 17.5C14.26 17.67 14.25 17.83 14.25 18S14.26 18.33 14.28 18.5L13.22 19.32C13.13 19.4 13.1 19.53 13.16 19.64L14.16 21.37C14.22 21.5 14.35 21.5 14.47 21.5L15.71 21C15.97 21.18 16.25 21.35 16.56 21.47L16.75 22.79C16.77 22.91 16.87 23 17 23H19C19.12 23 19.23 22.91 19.25 22.79L19.44 21.47C19.74 21.34 20 21.18 20.28 21L21.5 21.5C21.64 21.5 21.77 21.5 21.84 21.37L22.84 19.64C22.9 19.53 22.87 19.4 22.78 19.32M18 19.5C17.17 19.5 16.5 18.83 16.5 18S17.18 16.5 18 16.5 19.5 17.17 19.5 18 18.84 19.5 18 19.5Z",te="M16.59,5.41L15.17,4L12,7.17L8.83,4L7.41,5.41L12,10M7.41,18.59L8.83,20L12,16.83L15.17,20L16.58,18.59L12,14L7.41,18.59Z",ie="M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z",ae={no_state:0,entity_no_longer_recorded:1,entity_not_recorded:1,state_class_removed:2,units_changed:3,mean_type_changed:4},oe=["no_state","entity_no_longer_recorded","state_class_removed","units_changed","mean_type_changed"];class se extends((0,C.b)(r.WF)){firstUpdated(){this._validateStatistics()}render(){var e,t;const i=this._columns(this._i18n.localize),a=this._selectMode?r.s6:(0,r.qy)(S||(S=G`<ha-assist-chip class="has-dropdown select-mode-chip" .active="${0}" @click="${0}" .title="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-assist-chip> `),this._selectMode,this._enableSelectMode,this._i18n.localize("ui.components.subpage-data-table.enter_selection_mode"),X),o=(0,r.qy)(O||(O=G`<ha-input-search appearance="outlined" .value="${0}" @input="${0}"> </ha-input-search>`),this.filter,this._handleSearchChange),s=Object.values(i).find(e=>e.sortable)?(0,r.qy)(A||(A=G` <ha-dropdown @wa-select="${0}"> <ha-assist-chip slot="trigger" .label="${0}"> <ha-svg-icon slot="trailing-icon" .path="${0}"></ha-svg-icon> </ha-assist-chip> ${0} </ha-dropdown> `),this._handleSortBy,this._i18n.localize("ui.components.subpage-data-table.sort_by",{sortColumn:this._sortColumn?` ${(null===(e=i[this._sortColumn])||void 0===e?void 0:e.title)||(null===(t=i[this._sortColumn])||void 0===t?void 0:t.label)}`:""}),Y,Object.entries(i).map(([e,t])=>t.sortable?(0,r.qy)(H||(H=G` <ha-dropdown-item .value="${0}" .selected="${0}"> ${0} ${0} </ha-dropdown-item> `),e,e===this._sortColumn,this._sortColumn===e?(0,r.qy)(E||(E=G` <ha-svg-icon slot="details" .path="${0}"></ha-svg-icon> `),"desc"===this._sortDirection?R:J):r.s6,t.title||t.label):r.s6)):r.s6,n=Object.values(i).find(e=>e.groupable)?(0,r.qy)(z||(z=G` <ha-dropdown @wa-select="${0}"> <ha-assist-chip slot="trigger" .label="${0}"> <ha-svg-icon slot="trailing-icon" .path="${0}"></ha-svg-icon></ha-assist-chip> ${0} <ha-dropdown-item value="none" .selected="${0}"> ${0} </ha-dropdown-item> <wa-divider></wa-divider> <ha-dropdown-item value="collapse_all" @click="${0}" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> <ha-dropdown-item @click="${0}" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> </ha-dropdown> `),this._handleOverflowGroupBy,this._i18n.localize("ui.components.subpage-data-table.group_by",{groupColumn:this._groupColumn?` ${i[this._groupColumn].title||i[this._groupColumn].label}`:""}),Y,Object.entries(i).map(([e,t])=>t.groupable?(0,r.qy)(j||(j=G` <ha-dropdown-item .value="${0}" .selected="${0}"> ${0} </ha-dropdown-item> `),e,e===this._groupColumn,t.title||t.label):r.s6),void 0===this._groupColumn,this._i18n.localize("ui.components.subpage-data-table.dont_group_by"),this._collapseAllGroups,void 0===this._groupColumn,te,this._i18n.localize("ui.components.subpage-data-table.collapse_all_groups"),this._expandAllGroups,void 0===this._groupColumn,ie,this._i18n.localize("ui.components.subpage-data-table.expand_all_groups")):r.s6,l=(0,r.qy)(D||(D=G`<ha-assist-chip class="has-dropdown select-mode-chip" @click="${0}" .title="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-assist-chip>`),this._openSettings,this._i18n.localize("ui.components.subpage-data-table.settings"),ee);return(0,r.qy)(P||(P=G` <div class="table-with-toolbars"> ${0} <div slot="toolbar-icon"> <slot name="toolbar-icon"></slot> </div> ${0} <ha-data-table .narrow="${0}" .columns="${0}" .data="${0}" .noDataText="${0}" .filter="${0}" .selectable="${0}" id="statistic_id" clickable .sortColumn="${0}" .sortDirection="${0}" .groupColumn="${0}" .groupOrder="${0}" .columnOrder="${0}" .hiddenColumns="${0}" @row-click="${0}" @selection-changed="${0}" @sorting-changed="${0}"> ${0} </ha-data-table> </div> `),this._selectMode?(0,r.qy)(V||(V=G`<div class="selection-bar"> <div class="selection-controls"> <ha-icon-button .path="${0}" @click="${0}" .label="${0}"></ha-icon-button> <ha-dropdown> <ha-assist-chip .label="${0}" slot="trigger"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> <ha-svg-icon slot="trailing-icon" .path="${0}"></ha-svg-icon></ha-assist-chip> <ha-dropdown-item @click="${0}"> ${0} </ha-dropdown-item> <ha-dropdown-item @click="${0}"> ${0} </ha-dropdown-item> <ha-dropdown-item @click="${0}"> ${0} </ha-dropdown-item> <wa-divider></wa-divider> <ha-dropdown-item @click="${0}"> ${0} </ha-dropdown-item> </ha-dropdown> <p> ${0} </p> </div> <div class="center-vertical"> <slot name="selection-bar"></slot> </div> <ha-assist-chip .label="${0}" .disabled="${0}" @click="${0}"> </ha-assist-chip> </div>`),K,this._disableSelectMode,this._i18n.localize("ui.components.subpage-data-table.exit_selection_mode"),this._i18n.localize("ui.components.subpage-data-table.select"),X,Y,this._selectAll,this._i18n.localize("ui.components.subpage-data-table.select_all"),this._selectAllIssues,this._i18n.localize("ui.panel.config.developer-tools.tabs.statistics.data_table.select_all_issues"),this._selectNone,this._i18n.localize("ui.components.subpage-data-table.select_none"),this._disableSelectMode,this._i18n.localize("ui.components.subpage-data-table.exit_selection_mode"),this._i18n.localize("ui.components.subpage-data-table.selected",{selected:this._selected.length}),this._i18n.localize("ui.panel.config.developer-tools.tabs.statistics.delete_selected"),!this._selected.length,this._clearSelected):r.s6,this.narrow?(0,r.qy)(q||(q=G` <div slot="header"> <slot name="header"> <div class="search-toolbar">${0}</div> </slot> </div> `),o):r.s6,this.narrow,i,this._displayData(this._data,this._i18n.localize,this._registries.entities,this._registries.devices,this._registries.areas),this._i18n.localize("ui.panel.config.developer-tools.tabs.statistics.data_table.no_statistics"),this.filter,this._selectMode,this._sortColumn,this._sortDirection,this._groupColumn,this.groupOrder,this.columnOrder,this.hiddenColumns,this._rowClicked,this._handleSelectionChanged,this._handleTableSortingChanged,this.narrow?(0,r.qy)(Z||(Z=G`<div slot="header"></div> <div slot="header-row" class="narrow-header-row"> ${0}${0}${0}${0} </div>`),a,n,s,l):(0,r.qy)(T||(T=G` <div slot="header"> <slot name="header"> <div class="table-header"> ${0}${0}${0}${0}${0} </div> </slot> </div> `),a,o,n,s,l))}_handleSearchChange(e){var t;this.filter!==e.target.value&&(this.filter=null!==(t=e.target.value)&&void 0!==t?t:"")}_handleSelectionChanged(e){this._selected=e.detail.value}_handleTableSortingChanged(e){const{column:t,direction:i}=e.detail;this._sortColumn=t,this._sortDirection=i}_handleSortBy(e){e.preventDefault();const t=e.detail.item.value;this._sortDirection&&this._sortColumn===t&&"asc"===this._sortDirection?this._sortDirection="desc":this._sortDirection="asc",this._sortColumn=t}_setGroupColumn(e){this._groupColumn=e}_openSettings(){(0,f.n)(this,{columns:this._columns(this._i18n.localize),hiddenColumns:this.hiddenColumns,columnOrder:this.columnOrder,onUpdate:(e,t)=>{this.columnOrder=e,this.hiddenColumns=t},localizeFunc:this._i18n.localize})}_collapseAllGroups(){this._dataTable.collapseAllGroups()}_expandAllGroups(){this._dataTable.expandAllGroups()}_enableSelectMode(){this._selectMode=!0}_disableSelectMode(){this._selectMode=!1,this._dataTable.clearSelection()}_selectAll(){this._dataTable.selectAll()}_selectNone(){this._dataTable.clearSelection()}_selectAllIssues(){this._dataTable.select(this._data.filter(e=>e.issues).map(e=>e.statistic_id),!0)}_showStatisticsAdjustSumDialog(e){e.stopPropagation(),(0,L.D)(this,{statistic:e.currentTarget.statistic})}_rowClicked(e){const t=e.detail.id;t in this._states&&(0,c.r)(this,"hass-more-info",{entityId:t})}async _validateStatistics(){const[e,t]=await Promise.all([(0,_.p3)(this._api),(0,_.Ph)(this._api)]);(0,_.PU)(this._api);const i=new Set;this._data=e.map(e=>(i.add(e.statistic_id),Object.assign(Object.assign({},e),{},{state:this._states[e.statistic_id],issues:t[e.statistic_id]}))),Object.keys(t).forEach(e=>{i.has(e)||this._data.push({statistic_id:e,statistics_unit_of_measurement:"",source:"",state:this._states[e],issues:t[e],mean_type:_.ED.NONE,has_sum:!1,unit_class:null})})}supportedShortcuts(){return{f:()=>this._searchInput.focus()}}static get styles(){return[x.RF,(0,r.AH)(I||(I=G`:host{display:block;height:100%}.table-with-toolbars{height:100%;display:flex;flex-direction:column;gap:var(--ha-space-2)}ha-data-table{width:100%;flex-grow:1;--data-table-border-width:0}:host([narrow]){--expansion-panel-summary-padding:0 16px}.table-header{display:flex;align-items:center;--mdc-shape-small:0;height:56px;width:100%;justify-content:space-between;padding:0 var(--ha-space-4);gap:var(--ha-space-4);box-sizing:border-box;background:var(--primary-background-color);border-bottom:1px solid var(--divider-color)}ha-input-search{flex:1}.search-toolbar{display:flex;align-items:center;color:var(--secondary-text-color)}.narrow-header-row{display:flex;align-items:center;gap:var(--ha-space-4);padding:0 var(--ha-space-4);overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none}.selection-bar{background:rgba(var(--rgb-primary-color),.1);width:100%;display:flex;align-items:center;justify-content:space-between;padding:var(--ha-space-2) var(--ha-space-3);box-sizing:border-box;font-size:var(--ha-font-size-m);--ha-assist-chip-container-color:var(--card-background-color)}.selection-controls{display:flex;align-items:center;gap:var(--ha-space-2)}.selection-controls p{margin-left:var(--ha-space-2);margin-inline-start:var(--ha-space-2);margin-inline-end:initial}.center-vertical{display:flex;align-items:center;gap:var(--ha-space-2)}.relative{position:relative}ha-assist-chip{--ha-assist-chip-container-shape:10px;--ha-assist-chip-container-color:var(--card-background-color)}.select-mode-chip{--md-assist-chip-icon-label-space:0;--md-assist-chip-trailing-space:8px}ha-dialog{--mdc-dialog-min-width:100vw;--mdc-dialog-max-width:100vw;--mdc-dialog-min-height:100%;--mdc-dialog-max-height:100%;--vertical-align-dialog:flex-end;--ha-dialog-border-radius:var(--ha-border-radius-square);--dialog-content-padding:0}ha-dropdown ha-assist-chip{--md-assist-chip-trailing-space:8px}`))]}constructor(...e){super(...e),this.narrow=!1,this._data=[],this.filter="",this._selected=[],this._sortDirection=null,this._selectMode=!1,this._displayData=(0,l.A)((e,t,i,a,o)=>{const s=(0,h.Kh)(a);return e.map(e=>{var r;const n=i[e.statistic_id],l=null!=n&&n.device_id?a[n.device_id]:void 0,c=(null==n?void 0:n.area_id)||(null==l?void 0:l.area_id),g=c?o[c]:void 0,f=n?(0,u.cx)(n,a,e.state):void 0,m=l?(0,h.xn)(l):void 0,b=g?(0,d.A)(g):void 0,v=m?s.has(m)&&b?`${m} (${b})`:m:void 0;return Object.assign(Object.assign({},e),{},{displayName:f||m||(e.state?(0,p.u)(e.state):void 0)||e.name||e.statistic_id,device:m,device_full:v,area:b,issues_string:null===(r=e.issues)||void 0===r?void 0:r.map(e=>t(`ui.panel.config.developer-tools.tabs.statistics.issues.${e.type}`,e.data)||e.type).join(" ")})})}),this._columns=(0,l.A)(e=>({displayName:{title:e("ui.panel.config.developer-tools.tabs.statistics.data_table.name"),main:!0,sortable:!0,filterable:!0,flex:2},device:{title:e("ui.panel.config.entities.picker.headers.device"),sortable:!0,template:e=>e.device||""},device_full:{title:e("ui.panel.config.entities.picker.headers.device"),filterable:!0,groupable:!0,hidden:!0},area:(0,y.A7)(e),statistic_id:{title:e("ui.panel.config.developer-tools.tabs.statistics.data_table.statistic_id"),sortable:!0,filterable:!0,hidden:this.narrow},statistics_unit_of_measurement:{title:e("ui.panel.config.developer-tools.tabs.statistics.data_table.statistics_unit"),sortable:!0,filterable:!0,forceLTR:!0},source:{title:e("ui.panel.config.developer-tools.tabs.statistics.data_table.source"),sortable:!0,filterable:!0,groupable:!0},issues_string:{title:e("ui.panel.config.developer-tools.tabs.statistics.data_table.issue"),sortable:!0,filterable:!0,groupable:!0,direction:"asc",flex:2,template:t=>{var i;return(0,r.qy)(W||(W=G`${0}`),null!==(i=t.issues_string)&&void 0!==i?i:e("ui.panel.config.developer-tools.tabs.statistics.no_issue"))}},fix:{title:"",label:e("ui.panel.config.developer-tools.tabs.statistics.fix_issue.fix"),type:"icon",template:t=>(0,r.qy)(U||(U=G`${0}`),t.issues?(0,r.qy)(N||(N=G`<ha-button @click="${0}" .data="${0}" appearance="plain" size="small"> ${0} </ha-button>`),this._fixIssue,t.issues,e(t.issues.some(e=>oe.includes(e.type))?"ui.panel.config.developer-tools.tabs.statistics.fix_issue.fix":"ui.panel.config.developer-tools.tabs.statistics.fix_issue.info")):"—"),minWidth:"113px",maxWidth:"113px",showNarrow:!0},actions:{title:"",label:e("ui.panel.config.developer-tools.tabs.statistics.adjust_sum"),type:"icon-button",showNarrow:!0,template:t=>t.has_sum?(0,r.qy)(F||(F=G` <ha-icon-button .label="${0}" .path="${0}" .statistic="${0}" @click="${0}"></ha-icon-button> `),e("ui.panel.config.developer-tools.tabs.statistics.adjust_sum"),Q,t,this._showStatisticsAdjustSumDialog):r.s6}})),this._handleOverflowGroupBy=e=>{const t=e.detail.item.value;if(t)switch(t){case"collapse_all":return void this._collapseAllGroups();case"expand_all":return void this._expandAllGroups();case"none":return void this._setGroupColumn();default:this._setGroupColumn(t)}},this._clearSelected=async()=>{if(!this._selected.length)return;const e=this._selected;await(0,$.showConfirmationDialog)(this,{title:this._i18n.localize("ui.panel.config.developer-tools.tabs.statistics.multi_delete.title"),text:(0,r.qy)(B||(B=G`${0}`),this._i18n.localize("ui.panel.config.developer-tools.tabs.statistics.multi_delete.info_text",{statistic_count:e.length})),confirmText:this._i18n.localize("ui.common.delete"),destructive:!0,confirm:async()=>{await(0,_.$3)(this._api,e),this._validateStatistics(),this._dataTable.clearSelection()}})},this._fixIssue=async e=>{const t=e.currentTarget.data.sort((e,t)=>{var i,a;return(null!==(i=ae[e.type])&&void 0!==i?i:99)-(null!==(a=ae[t.type])&&void 0!==a?a:99)})[0];await(0,k.c)(this,t),this._validateStatistics()}}}(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],se.prototype,"narrow",void 0),(0,o.Cg)([(0,n.wk)()],se.prototype,"_data",void 0),(0,o.Cg)([(0,n.wk)()],se.prototype,"filter",void 0),(0,o.Cg)([(0,n.wk)()],se.prototype,"_selected",void 0),(0,o.Cg)([(0,n.wk)()],se.prototype,"groupOrder",void 0),(0,o.Cg)([(0,n.wk)()],se.prototype,"columnOrder",void 0),(0,o.Cg)([(0,n.wk)()],se.prototype,"hiddenColumns",void 0),(0,o.Cg)([(0,n.wk)()],se.prototype,"_sortColumn",void 0),(0,o.Cg)([(0,n.wk)()],se.prototype,"_sortDirection",void 0),(0,o.Cg)([(0,n.wk)()],se.prototype,"_groupColumn",void 0),(0,o.Cg)([(0,n.wk)()],se.prototype,"_selectMode",void 0),(0,o.Cg)([(0,n.wk)(),(0,s.Fg)({context:w.Ie,subscribe:!0})],se.prototype,"_api",void 0),(0,o.Cg)([(0,n.wk)(),(0,s.Fg)({context:w.D5,subscribe:!0})],se.prototype,"_i18n",void 0),(0,o.Cg)([(0,n.wk)(),(0,s.Fg)({context:w.Hd,subscribe:!0})],se.prototype,"_registries",void 0),(0,o.Cg)([(0,n.wk)(),(0,s.Fg)({context:w.iN,subscribe:!0})],se.prototype,"_states",void 0),(0,o.Cg)([(0,n.P)("ha-data-table",!0)],se.prototype,"_dataTable",void 0),(0,o.Cg)([(0,n.P)("ha-input-search")],se.prototype,"_searchInput",void 0),se=(0,o.Cg)([(0,n.EM)("developer-tools-statistics")],se),a()}catch(S){a(S)}})},5936:function(e,t,i){i.d(t,{c:function(){return r}});i(3362),i(62953);var a=i(1087);const o=()=>Promise.all([i.e(32450),i.e(7305),i.e(92769),i.e(3283),i.e(80131),i.e(70183),i.e(72130),i.e(85010),i.e(83113),i.e(67218),i.e(98470),i.e(99788),i.e(58303),i.e(59979),i.e(21543),i.e(66283),i.e(82134),i.e(46601),i.e(99972),i.e(48182),i.e(62574),i.e(26092),i.e(39005),i.e(8851),i.e(19112),i.e(34310),i.e(30002),i.e(59704),i.e(25322),i.e(53480),i.e(82209),i.e(55392),i.e(89747),i.e(71572),i.e(55076),i.e(72453),i.e(36332),i.e(77563),i.e(15862),i.e(99143),i.e(41344),i.e(97500),i.e(66990),i.e(3025),i.e(87857),i.e(96563),i.e(38108),i.e(32659)]).then(i.bind(i,15251)),s=()=>Promise.all([i.e(81034),i.e(147),i.e(56121)]).then(i.bind(i,51744)),r=async(e,t)=>"units_changed"===t.type?((e,t)=>new Promise(i=>{const o=t.fixedCallback;(0,a.r)(e,"show-dialog",{dialogTag:"dialog-statistics-fix-units-changed",dialogImport:s,dialogParams:Object.assign(Object.assign({},t),{},{cancelCallback:()=>{i(!1)},fixedCallback:()=>{i(!0),null==o||o()}})})}))(e,{issue:t}):((e,t)=>new Promise(i=>{const s=t.fixedCallback;(0,a.r)(e,"show-dialog",{dialogTag:"dialog-statistics-fix",dialogImport:o,dialogParams:Object.assign(Object.assign({},t),{},{cancelCallback:()=>{i(!1)},fixedCallback:()=>{i(!0),null==s||s()}})})}))(e,{issue:t})},36959:function(e,t,i){i.d(t,{D:function(){return s}});i(3362),i(62953);var a=i(1087);const o=()=>Promise.all([i.e(24617),i.e(51448)]).then(i.bind(i,19691)),s=(e,t)=>{(0,a.r)(e,"show-dialog",{dialogTag:"dialog-statistics-adjust-sum",dialogImport:o,dialogParams:t})}},34128:function(e,t,i){i.d(t,{G9:function(){return r},Ni:function(){return s},Ue:function(){return d},Vd:function(){return h},gh:function(){return u}});i(16280),i(74423),i(3362),i(62953);var a=i(1087),o=i(45291);const s=e=>{const t=document.createElement("hui-error-card");return customElements.get("hui-error-card")?t.setConfig(e):(Promise.resolve().then(i.bind(i,4397)),customElements.whenDefined("hui-error-card").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t},r=(e,t)=>({type:"error",error:e,origConfig:t}),n=(e,t)=>{const i=document.createElement(e);return i.setConfig(t),i},l=(e,t,a)=>"badge"===e?(e=>{const t=document.createElement("hui-error-badge");return customElements.get("hui-error-badge")?t.setConfig(e):(Promise.all([i.e(92769),i.e(3283),i.e(72130),i.e(85010),i.e(67218),i.e(98470),i.e(99788),i.e(66283),i.e(82134),i.e(45981),i.e(26092),i.e(39005),i.e(34310),i.e(59704),i.e(25322),i.e(55392),i.e(89747),i.e(71572),i.e(36332),i.e(77563),i.e(15862),i.e(99143),i.e(41344),i.e(12009),i.e(66990),i.e(3025),i.e(38108),i.e(57693),i.e(38260)]).then(i.bind(i,50655)),customElements.whenDefined("hui-error-badge").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t})(r(t,a)):"heading-badge"===e?(e=>{const t=document.createElement("hui-error-heading-badge");return customElements.get("hui-error-heading-badge")?t.setConfig(e):(Promise.all([i.e(92769),i.e(3283),i.e(72130),i.e(85010),i.e(67218),i.e(98470),i.e(99788),i.e(66283),i.e(82134),i.e(45981),i.e(26092),i.e(39005),i.e(34310),i.e(59704),i.e(25322),i.e(55392),i.e(89747),i.e(71572),i.e(36332),i.e(77563),i.e(15862),i.e(99143),i.e(41344),i.e(12009),i.e(66990),i.e(3025),i.e(38108),i.e(57693),i.e(21614)]).then(i.bind(i,13469)),customElements.whenDefined("hui-error-heading-badge").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t})(((e,t)=>({type:"error",error:e,origConfig:t}))(t,a)):s({type:"error",message:t}),c=e=>(0,o.c8)(e)?(0,o.Iu)(e):void 0,d=(e,t,i,a,o,s)=>{try{return h(e,t,i,a,o,s)}catch(r){return console.error(e,t.type,r),l(e,r.message,t)}},h=(e,t,i,o,s,r)=>{if(!t||"object"!=typeof t)throw new Error("Config is not an object");if(!(t.type||r||s&&"entity"in t))throw new Error("No card type configured");const d=t.type?c(t.type):void 0;if(d)return((e,t,i)=>{if(customElements.get(t))return n(t,i);const o=l(e,`Custom element doesn't exist: ${t}.`,i);if(!t.includes("-"))return o;o.style.display="None";const s=window.setTimeout(()=>{o.style.display=""},2e3);return customElements.whenDefined(t).then(()=>{clearTimeout(s),(0,a.r)(o,"ll-rebuild")}),o})(e,d,t);let h;if(s&&!t.type&&t.entity){h=`${s[t.entity.split(".",1)[0]]||s._domain_not_found}-entity`}else h=t.type||r;if(void 0===h)throw new Error("No type specified");const u=`hui-${h}-${e}`;if(o&&h in o)return o[h](),((e,t)=>{if(customElements.get(e))return n(e,t);const i=document.createElement(e);return customElements.whenDefined(e).then(()=>{try{customElements.upgrade(i),(0,a.r)(i,"ll-upgrade"),i.setConfig(t)}catch(e){(0,a.r)(i,"ll-rebuild")}}),i})(u,t);if(i&&i.has(h))return n(u,t);throw new Error(`Unknown type encountered: ${h}`)},u=async(e,t,i,a)=>{const o=c(e);if(o){const e=customElements.get(o);if(e)return e;if(!o.includes("-"))throw new Error(`Custom element not found: ${o}`);return new Promise((e,t)=>{setTimeout(()=>t(new Error(`Custom element not found: ${o}`)),2e3),customElements.whenDefined(o).then(()=>e(customElements.get(o)))})}const s=`hui-${e}-${t}`,r=customElements.get(s);if(i&&i.has(e))return r;if(a&&e in a)return r||a[e]().then(()=>customElements.get(s));throw new Error(`Unknown type: ${e}`)}},94225:function(e,t,i){i.a(e,async function(e,a){try{i.d(t,{T:function(){return _},t:function(){return w}});i(3362),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var o=i(99799),s=i(29003),r=i(92055),n=i(19396),l=i(74323),c=i(51199),d=i(43721),h=i(65509),u=i(21659),p=i(82525),g=i(34128),f=e([o,s,r,n,l,c,d,h,u,p]);[o,s,r,n,l,c,d,h,u,p]=f.then?(await f)():f;const m=new Set(["media-player-entity","scene-entity","script-entity","sensor-entity","simple-entity","toggle-entity","button","call-service"]),b={"button-entity":()=>i.e(26846).then(i.bind(i,21869)),"climate-entity":()=>i.e(56995).then(i.bind(i,2798)),"cover-entity":()=>i.e(41243).then(i.bind(i,79734)),"date-entity":()=>i.e(17418).then(i.bind(i,75473)),"datetime-entity":()=>Promise.all([i.e(99194),i.e(24617),i.e(55328)]).then(i.bind(i,69690)),"event-entity":()=>Promise.resolve().then(i.bind(i,99799)),"group-entity":()=>i.e(68827).then(i.bind(i,53110)),"input-button-entity":()=>i.e(19825).then(i.bind(i,46472)),"humidifier-entity":()=>i.e(378).then(i.bind(i,53537)),"input-datetime-entity":()=>i.e(71748).then(i.bind(i,1391)),"input-number-entity":()=>i.e(17600).then(i.bind(i,58723)),"input-select-entity":()=>i.e(44325).then(i.bind(i,54596)),"input-text-entity":()=>i.e(8086).then(i.bind(i,51765)),"lock-entity":()=>i.e(28245).then(i.bind(i,49748)),"number-entity":()=>i.e(71523).then(i.bind(i,57198)),"select-entity":()=>i.e(9374).then(i.bind(i,78157)),"text-entity":()=>i.e(67973).then(i.bind(i,58212)),"time-entity":()=>Promise.all([i.e(21209),i.e(7004)]).then(i.bind(i,87550)),"timer-entity":()=>i.e(94097).then(i.bind(i,6344)),"update-entity":()=>i.e(80275).then(i.bind(i,38238)),"valve-entity":()=>i.e(96654).then(i.bind(i,46493)),conditional:()=>Promise.all([i.e(67218),i.e(77563),i.e(78490)]).then(i.bind(i,80725)),"weather-entity":()=>Promise.all([i.e(12009),i.e(77547)]).then(i.bind(i,80395)),divider:()=>i.e(45249).then(i.bind(i,38584)),section:()=>i.e(51255).then(i.bind(i,39082)),weblink:()=>i.e(69148).then(i.bind(i,65751)),cast:()=>i.e(10405).then(i.bind(i,96612)),buttons:()=>i.e(50777).then(i.bind(i,65728)),attribute:()=>Promise.resolve().then(i.bind(i,65509)),text:()=>i.e(95421).then(i.bind(i,3980))},v={_domain_not_found:"simple",alert:"toggle",automation:"toggle",button:"button",climate:"climate",cover:"cover",date:"date",datetime:"datetime",event:"event",fan:"toggle",group:"group",humidifier:"humidifier",input_boolean:"toggle",input_button:"input-button",input_datetime:"input-datetime",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",number:"number",remote:"toggle",scene:"scene",script:"script",select:"select",sensor:"sensor",siren:"toggle",switch:"toggle",text:"text",time:"time",timer:"timer",update:"update",vacuum:"toggle",valve:"valve",water_heater:"climate",weather:"weather"},_=e=>(0,g.Ue)("row",e,m,b,v,void 0),w=e=>(0,g.gh)(e,"row",m,b);a()}catch(m){a(m)}})},69479:function(e,t,i){var a=i(43724),o=i(62106),s=i(65213),r=i(67979);a&&!s.correct&&(o(RegExp.prototype,"flags",{configurable:!0,get:r}),s.correct=!0)},13611:function(e,t,i){var a=i(46518),o=i(44576),s=i(62106),r=i(43724),n=TypeError,l=Object.defineProperty,c=o.self!==o;try{if(r){var d=Object.getOwnPropertyDescriptor(o,"self");!c&&d&&d.get&&d.enumerable||s(o,"self",{get:function(){return o},set:function(e){if(this!==o)throw new n("Illegal invocation");l(o,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else a({global:!0,simple:!0,forced:c},{self:o})}catch(h){}},31886:function(e,t,i){i.a(e,async function(e,a){try{i.d(t,{BB:function(){return o.B}});i(38744);var o=i(88775),s=i(49232),r=i(78713),n=i(53834),l=i(35204),c=i(5806),d=e([o,s,r,n,l,c]);[o,s,r,n,l,c]=d.then?(await d)():d,a()}catch(h){a(h)}})},1126:function(e,t,i){i.a(e,async function(e,t){try{i(3362),i(27495),i(62953);var a=i(5124),o=i(67576),s=i(6412),r=i(63672),n=i(17051),l=i(42462),c=i(28438),d=i(98779),h=i(27259),u=i(25877),p=i(31247),g=i(4444),f=i(92070),m=i(9395),b=i(717),v=i(17060),_=i(88496),w=i(57024),y=e([_,v]);[_,v]=y.then?(await y)():y;let k,L,M,S=e=>e;var C=Object.defineProperty,x=Object.getOwnPropertyDescriptor,$=(e,t,i,a)=>{for(var o,s=a>1?void 0:a?x(t,i):t,r=e.length-1;r>=0;r--)(o=e[r])&&(s=(a?o(t,i,s):o(s))||s);return a&&s&&C(t,i,s),s};let O=class extends b.A{firstUpdated(){a.S$||this.open&&(this.addOpenListeners(),this.drawer.showModal(),(0,g.JG)(this))}disconnectedCallback(){super.disconnectedCallback(),(0,g.I7)(this),this.removeOpenListeners()}async requestClose(e){const t=new c.L({source:e});if(this.dispatchEvent(t),t.defaultPrevented)return this.open=!0,void(0,h.Ud)(this.drawer,"pulse");this.removeOpenListeners(),await(0,h.Ud)(this.drawer,"hide"),this.open=!1,this.drawer.close(),(0,g.I7)(this);const i=this.originalTrigger;"function"==typeof(null==i?void 0:i.focus)&&setTimeout(()=>i.focus()),this.dispatchEvent(new n.Z)}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown),(0,u.AZ)(this)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,u.Fw)(this)}handleDialogCancel(e){e.preventDefault(),!this.drawer.classList.contains("hide")&&e.target===this.drawer&&(0,u.a0)(this)&&this.requestClose(this.drawer)}handleDialogClick(e){const t=e.target.closest('[data-drawer="close"]');t&&(e.stopPropagation(),this.requestClose(t))}async handleDialogPointerDown(e){e.target===this.drawer&&(this.lightDismiss?this.requestClose(this.drawer):await(0,h.Ud)(this.drawer,"pulse"))}handleOpenChange(){this.open&&!this.drawer.open?this.show():this.drawer.open&&(this.open=!0,this.requestClose(this.drawer))}async show(){const e=new d.k;this.dispatchEvent(e),e.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.drawer.showModal(),(0,g.JG)(this),requestAnimationFrame(()=>{const e=this.querySelector("[autofocus]");e&&"function"==typeof e.focus?e.focus():this.drawer.focus()}),await(0,h.Ud)(this.drawer,"show"),this.dispatchEvent(new l.q))}render(){var e;const t=!this.withoutHeader,i=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return(0,a.qy)(k||(k=S` <dialog aria-labelledby="${0}" aria-describedby="${0}" part="dialog" class="${0}" @cancel="${0}" @click="${0}" @pointerdown="${0}"> ${0} <div part="body" class="body"><slot></slot></div> ${0} </dialog> `),null!==(e=this.ariaLabelledby)&&void 0!==e?e:"title",(0,r.J)(this.ariaDescribedby),(0,s.H)({drawer:!0,open:this.open,top:"top"===this.placement,end:"end"===this.placement,bottom:"bottom"===this.placement,start:"start"===this.placement}),this.handleDialogCancel,this.handleDialogClick,this.handleDialogPointerDown,t?(0,a.qy)(L||(L=S` <header part="header" class="header"> <h2 part="title" class="title" id="title"> <slot name="label"> ${0} </slot> </h2> <div part="header-actions" class="header-actions"> <slot name="header-actions"></slot> <wa-button part="close-button" exportparts="base:close-button__base" class="close" appearance="plain" @click="${0}"> <wa-icon name="xmark" label="${0}" library="system" variant="solid"></wa-icon> </wa-button> </div> </header> `),this.label.length>0?this.label:String.fromCharCode(8203),e=>this.requestClose(e.target),this.localize.term("close")):"",i?(0,a.qy)(M||(M=S` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `)):"")}constructor(){super(...arguments),this.localize=new v.c(this),this.hasSlotController=new f.X(this,"footer","header-actions","label"),this.open=!1,this.label="",this.placement="end",this.withoutHeader=!1,this.lightDismiss=!0,this.withFooter=!1,this.handleDocumentKeyDown=e=>{"Escape"===e.key&&this.open&&(0,u.a0)(this)&&(e.preventDefault(),e.stopPropagation(),this.requestClose(this.drawer))}}};O.css=w.A,$([(0,o.P)(".drawer")],O.prototype,"drawer",2),$([(0,o.MZ)({type:Boolean,reflect:!0})],O.prototype,"open",2),$([(0,o.MZ)({reflect:!0})],O.prototype,"label",2),$([(0,o.MZ)({reflect:!0})],O.prototype,"placement",2),$([(0,o.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],O.prototype,"withoutHeader",2),$([(0,o.MZ)({attribute:"light-dismiss",type:Boolean})],O.prototype,"lightDismiss",2),$([(0,o.MZ)({attribute:"aria-labelledby"})],O.prototype,"ariaLabelledby",2),$([(0,o.MZ)({attribute:"aria-describedby"})],O.prototype,"ariaDescribedby",2),$([(0,o.MZ)({attribute:"with-footer",type:Boolean})],O.prototype,"withFooter",2),$([(0,m.w)("open",{waitUntilFirstUpdate:!0})],O.prototype,"handleOpenChange",1),O=$([(0,o.EM)("wa-drawer")],O),a.S$||(document.addEventListener("click",e=>{const t=e.target.closest("[data-drawer]");if(t instanceof Element){const[e,i]=(0,p.v)(t.getAttribute("data-drawer")||"");if("open"===e&&null!=i&&i.length){const e=t.getRootNode().getElementById(i);"wa-drawer"===(null==e?void 0:e.localName)?e.open=!0:console.warn(`A drawer with an ID of "${i}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),t()}catch(k){t(k)}})},57024:function(e,t,i){i.d(t,{A:function(){return o}});let a;var o=(0,i(5124).AH)(a||(a=(e=>e)`:host{--size:25rem;--spacing:var(--wa-space-l);--backdrop-filter:none;--show-duration:200ms;--hide-duration:200ms;display:none}:host([open]){display:block}.drawer{display:flex;flex-direction:column;top:0;inset-inline-start:0;width:100%;height:100%;max-width:100%;max-height:100%;overflow:hidden;color:inherit;background-color:var(--wa-color-surface-raised);border:none;box-shadow:var(--wa-shadow-l);overflow:auto;padding:0;margin:0;animation-duration:var(--show-duration);animation-timing-function:ease}.drawer.show::backdrop{animation:show-backdrop var(--show-duration,200ms) ease}.drawer.hide::backdrop{animation:show-backdrop var(--hide-duration,200ms) ease reverse}.drawer.show.top{animation:show-drawer-from-top var(--show-duration) ease}.drawer.hide.top{animation:show-drawer-from-top var(--hide-duration) ease reverse}.drawer.show.end{animation:show-drawer-from-end var(--show-duration) ease}.drawer.show.end:dir(rtl){animation-name:show-drawer-from-start}.drawer.hide.end{animation:show-drawer-from-end var(--hide-duration) ease reverse}.drawer.hide.end:dir(rtl){animation-name:show-drawer-from-start}.drawer.show.bottom{animation:show-drawer-from-bottom var(--show-duration) ease}.drawer.hide.bottom{animation:show-drawer-from-bottom var(--hide-duration) ease reverse}.drawer.show.start{animation:show-drawer-from-start var(--show-duration) ease}.drawer.show.start:dir(rtl){animation-name:show-drawer-from-end}.drawer.hide.start{animation:show-drawer-from-start var(--hide-duration) ease reverse}.drawer.hide.start:dir(rtl){animation-name:show-drawer-from-end}.drawer.pulse{animation:pulse 250ms ease}.drawer:focus{outline:0}.top{top:0;inset-inline-end:auto;bottom:auto;inset-inline-start:0;width:100%;height:var(--size)}.end{top:0;inset-inline-end:0;bottom:auto;inset-inline-start:auto;width:var(--size);height:100%}.bottom{top:auto;inset-inline-end:auto;bottom:0;inset-inline-start:0;width:100%;height:var(--size)}.start{top:0;inset-inline-end:auto;bottom:auto;inset-inline-start:0;width:var(--size);height:100%}.header{display:flex;flex-wrap:nowrap;padding-inline-start:var(--spacing);padding-block-end:0;padding-inline-end:calc(var(--spacing) - var(--wa-form-control-padding-block));padding-block-start:calc(var(--spacing) - var(--wa-form-control-padding-block))}.title{align-self:center;flex:1 1 auto;font:inherit;font-size:var(--wa-font-size-l);font-weight:var(--wa-font-weight-heading);line-height:var(--wa-line-height-condensed);margin:0}.header-actions{align-self:start;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:end;gap:var(--wa-space-2xs);padding-inline-start:var(--spacing)}.header-actions ::slotted(wa-button),.header-actions wa-button{flex:0 0 auto;display:flex;align-items:center}.body{flex:1 1 auto;display:block;padding:var(--spacing);overflow:auto;-webkit-overflow-scrolling:touch}.body:focus{outline:0}.body:focus-visible{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}.footer{display:flex;flex-wrap:wrap;gap:var(--wa-space-xs);justify-content:end;padding:var(--spacing);padding-block-start:0}.footer ::slotted(wa-button:not(:last-of-type)){margin-inline-end:var(--wa-spacing-xs)}.drawer::backdrop{background-color:var(--wa-color-overlay-modal,rgb(0 0 0 / .25));-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)}@keyframes pulse{0%{scale:1}50%{scale:1.01}100%{scale:1}}@keyframes show-drawer{from{opacity:0;scale:0.8}to{opacity:1;scale:1}}@keyframes show-drawer-from-top{from{opacity:0;translate:0 -100%}to{opacity:1;translate:0 0}}@keyframes show-drawer-from-end{from{opacity:0;translate:100%}to{opacity:1;translate:0 0}}@keyframes show-drawer-from-bottom{from{opacity:0;translate:0 100%}to{opacity:1;translate:0 0}}@keyframes show-drawer-from-start{from{opacity:0;translate:-100% 0}to{opacity:1;translate:0 0}}@keyframes show-backdrop{from{opacity:0}to{opacity:1}}@media (forced-colors:active){.drawer{border:solid 1px #fff}}`))}}]);