iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
11 lines • 31.2 kB
JavaScript
/*! For license information please see 23453.a28fe6787cc8b300.js.LICENSE.txt */
export const __rspack_esm_id=23453;export const __rspack_esm_ids=[23453];export const __webpack_modules__={93421(t,e,a){a.d(e,{IW:()=>d,dH:()=>l,fI:()=>c});a(44114);var i=a(35211),s=a(22792),o=a(32172);const r=(t,e)=>{let a=t;for(const t of e){if(null==a)return;a=a[t]}return a},n=(t,e,a)=>{const s=(0,o.p)({transformer:function(t){return a.call(this,t)},watch:e?[e]:[]}),r=(0,i.Fg)({context:t,subscribe:!0});return(t,e)=>{s(t,e),r(t,e)}},c=t=>n(s.iN,t.entityIdPath[0],function(e){const a=r(this,t.entityIdPath);return"string"==typeof a?e?.[a]:void 0}),l=t=>n(s.X1,t.entityIdPath[0],function(e){const a=r(this,t.entityIdPath);return"string"==typeof a?e?.[a]:void 0}),d=()=>n(s.D5,void 0,({localize:t})=>t)},26218(t,e,a){a.d(e,{a:()=>s});const i=(0,a(77796).n)(t=>{history.replaceState({scrollPosition:t},"")},300);function s(t){return(e,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const s=e.connectedCallback;e.connectedCallback=function(){s.call(this);const e=this[a];e&&this.updateComplete.then(()=>{const a=this.renderRoot.querySelector(t);a&&setTimeout(()=>{a.scrollTop=e},0)})};const o=Object.getOwnPropertyDescriptor(e,a);let r;if(void 0===o)r={get(){return this[`__${String(a)}`]||history.state?.scrollPosition},set(t){i(t),this[`__${String(a)}`]=t},configurable:!0,enumerable:!0};else{const t=o.set;r={...o,set(e){i(e),this[`__${String(a)}`]=e,t?.call(this,e)}}}Object.defineProperty(e,a,r)}}},32172(t,e,a){a.d(e,{p:()=>i});a(18111),a(7588),a(45367),a(92731),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);function i(t){return(e,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const i=String(a),s=e;if(s._transformers){if(!s.hasOwnProperty("_transformers")){const t=s._transformers;s._transformers=new Map,t.forEach((t,e)=>s._transformers.set(e,t))}}else{s._transformers=new Map,s._watching=new Map;const t=s.willUpdate;s.willUpdate=function(e){t.call(this,e);const a=new Set;e.forEach((t,e)=>{const i=this._watching.get(e);void 0!==i&&i.forEach(t=>a.add(t))}),a.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}s._transformers.set(a,t.transformer),t.watch&&t.watch.forEach(t=>{let e=s._watching.get(t);e||(e=new Set,s._watching.set(t,e)),e.add(a)});const o=Object.getOwnPropertyDescriptor(e,a);let r;if(void 0===o)r={get(){return this[`__transform_${i}`]},set(t){const e=this[`__transform_${i}`],a=this._transformers.get(i);this[`__transform_${i}`]=a?a.call(this,t):t,this[`__original_${i}`]=t,this.requestUpdate(i,e)},configurable:!0,enumerable:!0};else{const t=o.set;r={...o,set(e){const a=this[`__transform_${i}`],s=this._transformers.get(i);this[`__transform_${i}`]=s?s.call(this,e):e,this[`__original_${i}`]=e,this.requestUpdate(i,a),t?.call(this,e)}}}Object.defineProperty(e,a,r)}}},69093(t,e,a){a.d(e,{t:()=>s});var i=a(71727);const s=t=>(0,i.m)(t.entity_id)},47129(t,e,a){a.d(e,{a:()=>o});a(74423);var i=a(22675),s=a(71727);function o(t,e){const a=(0,s.m)(t.entity_id),o=void 0!==e?e:t?.state;if(["button","event","infrared","input_button","radio_frequency","scene"].includes(a))return o!==i.Hh;if(o===i.Hh||o===i.HV)return!1;if("off"===o&&"alert"!==a)return!1;switch(a){case"alarm_control_panel":return"disarmed"!==o;case"alert":return"idle"!==o;case"cover":case"valve":return"closed"!==o;case"device_tracker":case"person":return"not_home"!==o;case"lawn_mower":return!["docked","paused"].includes(o);case"lock":return"locked"!==o;case"media_player":return"standby"!==o;case"vacuum":return!["idle","docked","paused"].includes(o);case"plant":return"problem"===o;case"group":return["on","home","open","locked","problem"].includes(o);case"timer":return"active"===o;case"camera":return"streaming"===o}return!0}},52658(t,e,a){a.d(e,{ZK:()=>p,gf:()=>h,mT:()=>v,Se:()=>d,mg:()=>u});a(44114),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var i=a(22675),s=a(68287),o=a(86030),r=a(80880);var n=a(71727),c=a(47129);const l=new Set(["alarm_control_panel","alert","automation","binary_sensor","calendar","camera","climate","cover","device_tracker","fan","group","humidifier","input_boolean","lawn_mower","light","lock","media_player","person","plant","remote","schedule","script","siren","sun","switch","timer","update","vacuum","valve","water_heater","weather"]),d=(t,e)=>{if((void 0!==e?e:t?.state)===i.Hh)return"var(--state-unavailable-color)";const a=u(t,e);return a?(0,o.B)(a):void 0},h=(t,e,a)=>{const i=void 0!==a?a:e.state,s=(0,c.a)(e,a);return p(t,e.attributes.device_class,i,s)},p=(t,e,a,i)=>{const s=[],o=(0,r.Y)(a,"_"),n=i?"active":"inactive";return e&&s.push(`--state-${t}-${e}-${o}-color`),s.push(`--state-${t}-${o}-color`,`--state-${t}-${n}-color`,`--state-${n}-color`),s},u=(t,e)=>{const a=void 0!==e?e:t?.state,i=(0,n.m)(t.entity_id),o=t.attributes.device_class;if("sensor"===i&&"battery"===o){const t=(t=>{const e=Number(t);if(!isNaN(e))return e>=70?"--state-sensor-battery-high-color":e>=30?"--state-sensor-battery-medium-color":"--state-sensor-battery-low-color"})(a);if(t)return[t]}if("group"===i){const a=(0,s.z)(t);if(a&&l.has(a))return h(a,t,e)}if(l.has(i))return h(i,t,e)},v=t=>{if(t.attributes.brightness&&"plant"!==(0,n.m)(t.entity_id)){return`brightness(${(t.attributes.brightness+245)/5}%)`}return""}},82286(t,e,a){a.d(e,{$:()=>i});const i=(t,e)=>s(t.attributes,e),s=(t,e)=>0!==(t.supported_features&e)},20058(t,e,a){a.a(t,async function(t,i){try{a.d(e,{QL:()=>h,ZQ:()=>p,ZV:()=>d,ty:()=>c,x:()=>n});var s=a(74487),o=(a(74423),a(18111),a(61701),a(46927)),r=t([s]);s=(r.then?(await r)():r)[0];const n=t=>c(t.attributes),c=(t,e)=>!!t.unit_of_measurement||!!t.state_class||(e||[]).includes(t.device_class||""),l=t=>{switch(t.number_format){case o.jG.comma_decimal:return["en-US","en"];case o.jG.decimal_comma:return["de","es","it"];case o.jG.space_comma:return["fr","sv","cs"];case o.jG.quote_decimal:return["de-CH"];case o.jG.system:return;default:return t.language}},d=(t,e,a)=>h(t,e,a).map(t=>t.value).join(""),h=(t,e,a)=>{const i=e?l(e):void 0;return e?.number_format===o.jG.none||Number.isNaN(Number(t))?Number.isNaN(Number(t))||""===t||e?.number_format!==o.jG.none?[{type:"literal",value:t}]:new Intl.NumberFormat("en-US",u(t,{...a,useGrouping:!1})).formatToParts(Number(t)):new Intl.NumberFormat(i,u(t,a)).formatToParts(Number(t))},p=(t,e)=>{const a=e?.display_precision;return null!=a?{maximumFractionDigits:a,minimumFractionDigits:a}:Number.isInteger(Number(t?.attributes?.step))&&Number.isInteger(Number(t?.state))?{maximumFractionDigits:0}:void 0},u=(t,e)=>{const a={maximumFractionDigits:2,...e};if("string"!=typeof t)return a;if(!e||void 0===e.minimumFractionDigits&&void 0===e.maximumFractionDigits){const e=t.indexOf(".")>-1?t.split(".")[1].length:0;a.minimumFractionDigits=e,a.maximumFractionDigits=e}return a};i()}catch(t){i(t)}})},80880(t,e,a){a.d(e,{Y:()=>i});const i=(t,e="_")=>{const a="àáâäæãåāăąабçćčđďдèéêëēėęěеёэфğǵгḧхîïíīįìıİийкłлḿмñńǹňнôöòóœøōõőоṕпŕřрßśšşșсťțтûüùúūǘůűųувẃẍÿýыžźżз·",i=`aaaaaaaaaaabcccdddeeeeeeeeeeefggghhiiiiiiiiijkllmmnnnnnoooooooooopprrrsssssstttuuuuuuuuuuvwxyyyzzzz${e}`,s=new RegExp(a.split("").join("|"),"g"),o={ж:"zh",х:"kh",ц:"ts",ч:"ch",ш:"sh",щ:"shch",ю:"iu",я:"ia"};let r;return""===t?r="":(r=t.toString().toLowerCase().replace(s,t=>i.charAt(a.indexOf(t))).replace(/[а-я]/g,t=>o[t]||"").replace(/(\d),(?=\d)/g,"$1").replace(/[^a-z0-9]+/g,e).replace(new RegExp(`(${e})\\1+`,"g"),"$1").replace(new RegExp(`^${e}+`),"").replace(new RegExp(`${e}+$`),""),""===r&&(r="unknown")),r}},77796(t,e,a){a.d(e,{n:()=>i});const i=(t,e,a=!0,i=!0)=>{let s,o=0;const r=(...r)=>{const n=()=>{o=!1===a?0:Date.now(),s=void 0,t(...r)},c=Date.now();o||!1!==a||(o=c);const l=e-(c-o);l<=0||l>e?(s&&(clearTimeout(s),s=void 0),o=c,t(...r)):s||!1===i||(s=window.setTimeout(n,l))};return r.cancel=()=>{clearTimeout(s),s=void 0,o=0},r}},86836(t,e,a){function i(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function s(){return i()+i()+i()+i()+i()}a.d(e,{L:()=>s})},34296(t,e,a){var i=a(62826),s=a(96229),o=a(26069),r=a(91735),n=a(42034),c=a(5124),l=a(22441);class d extends s.k{renderOutline(){return this.filled?c.qy`<span class="filled"></span>`:super.renderOutline()}getContainerClasses(){return{...super.getContainerClasses(),active:this.active}}renderPrimaryContent(){return c.qy` <span class="leading icon" aria-hidden="true"> ${this.renderLeadingIcon()} </span> <span class="label">${this.label}</span> <span class="touch"></span> <span class="trailing leading icon" aria-hidden="true"> ${this.renderTrailingIcon()} </span> `}renderTrailingIcon(){return c.qy`<slot name="trailing-icon"></slot>`}constructor(...t){super(...t),this.filled=!1,this.active=!1}}d.styles=[r.R,n.R,o.R,c.AH`:host{--md-sys-color-primary:var(--primary-text-color);--md-sys-color-on-surface:var(--primary-text-color);--md-assist-chip-container-shape:var(
--ha-assist-chip-container-shape,
16px
);--md-assist-chip-outline-color:var(--outline-color);--md-assist-chip-label-text-weight:400}.filled{display:flex;pointer-events:none;border-radius:inherit;inset:0;position:absolute;background-color:var(--ha-assist-chip-filled-container-color)}::slotted([slot=icon]),::slotted([slot=trailing-icon]){display:flex;--mdc-icon-size:var(--md-input-chip-icon-size, 18px);font-size:var(--_label-text-size)!important}.trailing.icon ::slotted(*),.trailing.icon svg{margin-inline-end:unset;margin-inline-start:var(--_icon-label-space)}::before{background:var(--ha-assist-chip-container-color,transparent);opacity:var(--ha-assist-chip-container-opacity, 1)}:where(.active)::before{background:var(--ha-assist-chip-active-container-color);opacity:var(--ha-assist-chip-active-container-opacity)}.label{font-family:var(--ha-font-family-body)}`],(0,i.Cg)([(0,l.MZ)({type:Boolean,reflect:!0})],d.prototype,"filled",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean})],d.prototype,"active",void 0),d=(0,i.Cg)([(0,l.EM)("ha-assist-chip")],d)},38962(t,e,a){a.a(t,async function(t,i){try{a.r(e);var s=a(62826),o=a(5124),r=a(22441),n=a(6412),c=a(93421),l=a(1087),d=a(26300),h=(a(67094),t([d]));d=(h.then?(await h)():h)[0];const p="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",u={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 v extends o.WF{render(){return o.qy` <div class="issue-type ${(0,n.H)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${u[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,n.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?o.qy`<div class="title">${this.title}</div>`:o.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?o.qy`<ha-icon-button ="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${p}"></ha-icon-button>`:o.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,l.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}v.styles=o.AH`.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,s.Cg)([(0,r.MZ)()],v.prototype,"title",void 0),(0,s.Cg)([(0,r.MZ)({attribute:"alert-type"})],v.prototype,"alertType",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],v.prototype,"dismissable",void 0),(0,s.Cg)([(0,r.wk)(),(0,c.IW)()],v.prototype,"_localize",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],v.prototype,"narrow",void 0),v=(0,s.Cg)([(0,r.EM)("ha-alert")],v),i()}catch(t){i(t)}})},90248(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaIconButtonArrowPrev:()=>p});var s=a(62826),o=a(5124),r=a(22441),n=a(63091),c=a(26300),l=t([c]);c=(l.then?(await l)():l)[0];const d="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",h="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class p extends o.WF{render(){return o.qy` <ha-icon-button .disabled="${this.disabled}" .label="${this.label||this.hass?.localize("ui.common.back")||"Back"}" .path="${this._icon}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"></ha-icon-button> `}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===n.G.document.dir?h:d}}(0,s.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],p.prototype,"disabled",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"label",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"href",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"target",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"rel",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"download",void 0),(0,s.Cg)([(0,r.wk)()],p.prototype,"_icon",void 0),p=(0,s.Cg)([(0,r.EM)("ha-icon-button-arrow-prev")],p),i()}catch(t){i(t)}})},26300(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaIconButton:()=>d});var s=a(62826),o=a(5124),r=a(22441),n=a(63672),c=a(18350),l=(a(67094),t([c]));c=(l.then?(await l)():l)[0];class d extends o.WF{render(){return o.qy` <ha-button appearance="plain" variant="neutral" aria-label="${(0,n.J)(this.label)}" title="${(0,n.J)(this.hideTitle?void 0:this.label)}" aria-haspopup="${(0,n.J)(this.ariaHasPopup)}" .disabled="${this.disabled}" .iconTag="${this.path?"ha-svg-icon":"span"}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"> ${this.path?o.qy`<ha-svg-icon aria-hidden="true" .path="${this.path}"></ha-svg-icon>`:o.qy`<span><slot></slot></span>`} </ha-button> `}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}d.shadowRootOptions={mode:"open",delegatesFocus:!0},d.styles=o.AH`:host{display:inline-block;outline:0;--ha-button-height:var(--ha-icon-button-size, 48px)}ha-button{position:relative;isolation:isolate;--wa-form-control-padding-inline:var(
--ha-icon-button-padding-inline,
--ha-space-2
);--wa-color-on-normal:currentColor;--wa-color-fill-quiet:transparent;--ha-button-label-overflow:visible}ha-button::after{content:"";position:absolute;inset:0;z-index:-1;border-radius:50%;background-color:currentColor;opacity:0;pointer-events:none}ha-button::part(base){width:var(--wa-form-control-height);aspect-ratio:1;outline-offset:-4px}ha-button::part(label){display:flex}:host([selected]) ha-button::after{opacity:.1} (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`,(0,s.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],d.prototype,"disabled",void 0),(0,s.Cg)([(0,r.MZ)({type:String})],d.prototype,"path",void 0),(0,s.Cg)([(0,r.MZ)({type:String})],d.prototype,"label",void 0),(0,s.Cg)([(0,r.MZ)({type:String,attribute:"aria-haspopup"})],d.prototype,"ariaHasPopup",void 0),(0,s.Cg)([(0,r.MZ)({attribute:"hide-title",type:Boolean})],d.prototype,"hideTitle",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],d.prototype,"selected",void 0),(0,s.Cg)([(0,r.MZ)()],d.prototype,"href",void 0),(0,s.Cg)([(0,r.MZ)()],d.prototype,"target",void 0),(0,s.Cg)([(0,r.MZ)()],d.prototype,"rel",void 0),(0,s.Cg)([(0,r.MZ)()],d.prototype,"download",void 0),d=(0,s.Cg)([(0,r.EM)("ha-icon-button")],d),i()}catch(t){i(t)}})},8630(t,e,a){var i=a(62826),s=a(68618),o=a(11081),r=a(22441);class n extends s.iY{}n.styles=o.R,n=(0,i.Cg)([(0,r.EM)("ha-list")],n)},2054(t,e,a){a.a(t,async function(t,e){try{var i=a(62826),s=a(5124),o=a(22441),r=a(1087),n=a(44249),c=a(26300),l=t([c]);c=(l.then?(await l)():l)[0];const d="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class h extends s.WF{connectedCallback(){super.connectedCallback(),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}disconnectedCallback(){super.disconnectedCallback(),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}render(){if(!this._show)return s.s6;const t=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return s.qy` <ha-icon-button .label="${this.hass.localize("ui.sidebar.sidebar_toggle")}" .path="${d}" ="${this._toggleMenu}"></ha-icon-button> ${t?s.qy`<div class="dot"></div>`:""} `}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const e=t.has("hass")?t.get("hass"):this.hass,a=t.has("narrow")?t.get("narrow"):this.narrow,i=!1===e?.kioskMode&&(a||"always_hidden"===e?.dockedSidebar),s=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&i===s||(this._show=s||this._alwaysVisible,s?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}_subscribeNotifications(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,n.V)(this.hass.connection,t=>{this._hasNotifications=t.length>0})}_toggleMenu(){(0,r.r)(this,"hass-toggle-menu")}constructor(...t){super(...t),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}h.styles=s.AH`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:var(--ha-border-radius-circle);border:2px solid var(--app-header-background-color)}`,(0,i.Cg)([(0,o.MZ)({type:Boolean})],h.prototype,"narrow",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,i.Cg)([(0,o.wk)()],h.prototype,"_hasNotifications",void 0),(0,i.Cg)([(0,o.wk)()],h.prototype,"_show",void 0),h=(0,i.Cg)([(0,o.EM)("ha-menu-button")],h),e()}catch(t){e(t)}})},82988(t,e,a){var i=a(62826),s=a(43666),o=a(87592),r=a(5124),n=a(22441);class c extends s.g{async show(){super.show(),this.menu.hasOverflow=!1}}c.styles=[o.R,r.AH`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-on-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--secondary-text-color);--md-sys-color-secondary-container:rgba(
var(--rgb-primary-color),
0.15
);--md-sys-color-on-secondary-container:var(--text-primary-color);--mdc-icon-size:16px;--md-sys-color-on-primary-container:var(--primary-text-color);--md-sys-color-on-secondary-container:var(--primary-text-color)}`],c=(0,i.Cg)([(0,n.EM)("ha-sub-menu")],c)},67094(t,e,a){a.r(e),a.d(e,{HaSvgIcon:()=>r});var i=a(62826),s=a(5124),o=a(22441);class r extends s.WF{render(){return s.JW` <svg viewBox="${this.viewBox||"0 0 24 24"}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${this.path?s.JW`<path class="primary-path" d="${this.path}"></path>`:s.s6} ${this.secondaryPath?s.JW`<path class="secondary-path" d="${this.secondaryPath}"></path>`:s.s6} </g> </svg>`}}r.styles=s.AH`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`,(0,i.Cg)([(0,o.MZ)()],r.prototype,"path",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],r.prototype,"secondaryPath",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],r.prototype,"viewBox",void 0),r=(0,i.Cg)([(0,o.EM)("ha-svg-icon")],r)},77001(t,e,a){a.d(e,{Dc:()=>s,_H:()=>o,fq:()=>r,iS:()=>i});a(74423),a(18111),a(7588),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);const i=t=>{const e={};return Object.entries(t).forEach(([t,a])=>{e[t]={value:a.value,items:a.items instanceof Set?Array.from(a.items):a.items}}),e},s=t=>{const e={};return Object.entries(t).forEach(([t,a])=>{e[t]={value:a.value,items:Array.isArray(a.items)?new Set(a.items):a.items}}),e},o=(t,e,a)=>t===a&&Array.isArray(e.value)&&e.value.length,r=(t,e,a)=>(t===a||a.includes(t))&&e.items},22675(t,e,a){a.d(e,{HV:()=>o,Hh:()=>s});var i=a(23832);const s="unavailable",o="unknown",r=[s,o,"off"];(0,i.g)(r)},68287(t,e,a){a.d(e,{z:()=>s});a(18111),a(61701),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var i=a(71727);const s=t=>{const e=t.attributes.entity_id||[],a=[...new Set(e.map(t=>(0,i.m)(t)))];return 1===a.length?a[0]:void 0}},44249(t,e,a){a.d(e,{V:()=>i});const i=(t,e)=>{const a=new s,i=t.subscribeMessage(t=>e(a.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{i.then(t=>t?.())}};class s{processMessage(t){if("removed"===t.type)for(const e of Object.keys(t.notifications))delete this.notifications[e];else this.notifications={...this.notifications,...t.notifications};return Object.values(this.notifications)}constructor(){this.notifications={}}}},39359(t,e,a){a.d(e,{_:()=>s});var i=a(76830);const s=t=>class extends t{_removeListeners(){window.removeEventListener("click",this._handleClick,!0),window.removeEventListener("beforeunload",this._handleUnload)}willUpdate(t){super.willUpdate(t),this.isDirty?(window.addEventListener("click",this._handleClick,!0),window.addEventListener("beforeunload",this._handleUnload)):this._removeListeners()}disconnectedCallback(){super.disconnectedCallback(),this._removeListeners()}get isDirty(){return!1}async promptDiscardChanges(){return!0}constructor(...t){super(...t),this._handleClick=async t=>{const e=t.composedPath()[0];if(!(0,i.d)(t))return;if(await this.promptDiscardChanges()&&(this._removeListeners(),e)){const a=new MouseEvent(t.type,t);e.dispatchEvent(a)}},this._handleUnload=t=>t.preventDefault()}}},34023(t,e,a){a.d(e,{E:()=>s,J:()=>o});var i=a(1087);const s=()=>Promise.all([a.e(32450),a.e(7305),a.e(92769),a.e(3283),a.e(85010),a.e(89100),a.e(42209),a.e(26092),a.e(8851),a.e(66201),a.e(26295),a.e(52808),a.e(93e3),a.e(61023)]).then(a.bind(a,39803)),o=(t,e)=>{(0,i.r)(t,"show-dialog",{dialogTag:"dialog-area-registry-detail",dialogImport:s,dialogParams:e})}},60109(t,e,a){a.d(e,{j:()=>o});var i=a(1087);const s=()=>a.e(83450).then(a.bind(a,22529)),o=(t,e)=>new Promise(a=>{const o=e.onClose;(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-automation-save-timeout",dialogImport:s,dialogParams:{...e,onClose:()=>{a(),o&&o()}}})})},24367(t,e,a){a.d(e,{L:()=>s,z:()=>o});var i=a(23832);const s=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],o=(0,i.g)(s)},86030(t,e,a){a.d(e,{B:()=>i,a:()=>s});a(18111),a(18237);function i(t){return Array.isArray(t)?t.reverse().reduce((t,e)=>`var(${e}${t?`, ${t}`:""})`,void 0):`var(${t})`}function s(t,e){if(Array.isArray(t))for(const a of t){const t=s(a,e);if(t)return t}else if(t.endsWith("-color"))return e.getPropertyValue(t).trim()||void 0}},96229(t,e,a){a.d(e,{k:()=>n});var i=a(62826),s=(a(73535),a(5124)),o=a(22441),r=a(99591);class n extends r.v{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(t){const{ariaLabel:e}=this;return this.href?s.qy` <a class="primary action" id="link" aria-label="${e||s.s6}" href="${this.href}" download="${this.download||s.s6}" target="${this.target||s.s6}">${t}</a> `:s.qy` <button class="primary action" id="button" aria-label="${e||s.s6}" aria-disabled="${this.softDisabled||s.s6}" ?disabled="${this.disabled&&!this.alwaysFocusable}" type="button">${t}</button> `}renderOutline(){return this.elevated?s.qy`<md-elevation part="elevation"></md-elevation>`:super.renderOutline()}constructor(){super(...arguments),this.elevated=!1,this.href="",this.download="",this.target=""}}(0,i.Cg)([(0,o.MZ)({type:Boolean})],n.prototype,"elevated",void 0),(0,i.Cg)([(0,o.MZ)()],n.prototype,"href",void 0),(0,i.Cg)([(0,o.MZ)()],n.prototype,"download",void 0),(0,i.Cg)([(0,o.MZ)()],n.prototype,"target",void 0)},26069(t,e,a){a.d(e,{R:()=>i});const i=a(5124).AH`: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}}`}};