iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
63 lines • 123 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[70111],{66639:function(t,e,a){a.d(e,{Vu:function(){return n},Xz:function(){return o},cs:function(){return i}});a(44114),a(18111),a(61701),a(45367),a(92731),a(62953);const i=(t,e)=>{const a=new Map,i=[];for(const o of e)o.floor_id?(a.has(o.floor_id)||a.set(o.floor_id,[]),a.get(o.floor_id).push(o.area_id)):i.push(o.area_id);return{floors:t.map(t=>({id:t.floor_id,areas:a.get(t.floor_id)||[]})),areas:i}},o=t=>{const e=[];for(const a of t.floors)e.push(...a.areas);return e.push(...t.areas),e},n=t=>t.floors.map(t=>t.id)},63708:function(t,e,a){a.d(e,{fW:function(){return n}});a(18111),a(13579);var i=a(44537),o=a(36312);const n=(t,e)=>(c(e)||r(t,e))&&s(t,e),r=(t,e)=>!e.component||(0,i.e)(e.component).some(e=>(0,o.x)(t.config,e)),s=(t,e)=>!e.not_component||!(0,i.e)(e.not_component).some(e=>(0,o.x)(t.config,e)),c=t=>t.core},380:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{D:function(){return d},P:function(){return l}});a(74423);var o=a(74487),n=a(27734),r=a(46927),s=a(96029),c=t([o]);o=(c.then?(await c)():c)[0];const l=t=>t.first_weekday===r.zt.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(t.language).weekInfo.firstDay%7:(0,n.S)(t.language)%7:s.Z.includes(t.first_weekday)?s.Z.indexOf(t.first_weekday):1,d=t=>{const e=l(t);return s.Z[e]};i()}catch(l){i(l)}})},72487:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{CA:function(){return k},Mi:function(){return L},Pm:function(){return $},Wq:function(){return y},Yq:function(){return l},bl:function(){return Z},c2:function(){return w},fr:function(){return v},gu:function(){return M},kz:function(){return h},m9:function(){return I},sl:function(){return g},ur:function(){return V},zB:function(){return p}});a(18111),a(20116);var o=a(74487),n=a(22786),r=a(46927),s=a(8480),c=t([o,s]);[o,s]=c.then?(await c)():c;(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",month:"long",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)}));const l=(t,e,a)=>d(e,a.time_zone).format(t),d=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),h=(t,e,a)=>u(e,a.time_zone).format(t),u=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),p=(t,e,a)=>{var i,o,n,s;const c=f(e,a.time_zone);if(e.date_format===r.ow.language||e.date_format===r.ow.system)return c.format(t);const l=c.formatToParts(t),d=null===(i=l.find(t=>"literal"===t.type))||void 0===i?void 0:i.value,h=null===(o=l.find(t=>"day"===t.type))||void 0===o?void 0:o.value,u=null===(n=l.find(t=>"month"===t.type))||void 0===n?void 0:n.value,p=null===(s=l.find(t=>"year"===t.type))||void 0===s?void 0:s.value,g=l[l.length-1];let m="literal"===(null==g?void 0:g.type)?null==g?void 0:g.value:"";"bg"===e.language&&e.date_format===r.ow.YMD&&(m="");return{[r.ow.DMY]:`${h}${d}${u}${d}${p}${m}`,[r.ow.MDY]:`${u}${d}${h}${d}${p}${m}`,[r.ow.YMD]:`${p}${d}${u}${d}${h}${m}`}[e.date_format]},f=(0,n.A)((t,e)=>{const a=t.date_format===r.ow.system?void 0:t.language;return t.date_format===r.ow.language||(t.date_format,r.ow.system),new Intl.DateTimeFormat(a,{year:"numeric",month:"numeric",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})}),g=(t,e,a)=>m(e,a.time_zone).format(t),m=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{day:"numeric",month:"short",timeZone:(0,s.wj)(t.time_zone,e)})),v=(t,e,a)=>b(e,a.time_zone).format(t),b=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",year:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),y=(t,e,a)=>_(e,a.time_zone).format(t),_=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",timeZone:(0,s.wj)(t.time_zone,e)})),w=(t,e,a)=>x(e,a.time_zone).format(t),x=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"short",timeZone:(0,s.wj)(t.time_zone,e)})),$=(t,e,a)=>C(e,a.time_zone).format(t),C=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),k=(t,e,a)=>A(e,a.time_zone).format(t),A=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",timeZone:(0,s.wj)(t.time_zone,e)})),M=(t,e,a)=>H(e,a.time_zone).format(t),H=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",timeZone:(0,s.wj)(t.time_zone,e)})),L=(t,e,a)=>z(e,a.time_zone).format(t),z=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",month:"short",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),V=(t,e,a)=>T(e,a.time_zone).format(t),T=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",month:"short",day:"numeric",year:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),Z=(t,e,a)=>{const i=(0,s.wj)(e.time_zone,a.time_zone);return new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",timeZone:i}).format(t)},I=(t,e,a,i)=>`${Z(t,a,i)}/${Z(e,a,i)}`;i()}catch(l){i(l)}})},95747:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{CL:function(){return y},GH:function(){return x},Rl:function(){return p},ZS:function(){return v},aQ:function(){return g},r6:function(){return h},yg:function(){return _}});var o=a(74487),n=a(22786),r=a(72487),s=a(30162),c=a(8480),l=a(69543),d=t([o,c,r,s]);[o,c,r,s]=d.then?(await d)():d;const h=(t,e,a)=>u(e,a.time_zone).format(t),u=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,l.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.J)(t)?"h12":"h23",timeZone:(0,c.wj)(t.time_zone,e)})),p=t=>f().format(t),f=(0,n.A)(()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})),g=(t,e,a)=>m(e,a.time_zone).format(t),m=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",hour:(0,l.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.J)(t)?"h12":"h23",timeZone:(0,c.wj)(t.time_zone,e)})),v=(t,e,a)=>b(e,a.time_zone).format(t),b=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"short",day:"numeric",hour:(0,l.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.J)(t)?"h12":"h23",timeZone:(0,c.wj)(t.time_zone,e)})),y=(t,e,a)=>(new Date).getFullYear()===t.getFullYear()?v(t,e,a):g(t,e,a),_=(t,e,a)=>w(e,a.time_zone).format(t),w=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,l.J)(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,l.J)(t)?"h12":"h23",timeZone:(0,c.wj)(t.time_zone,e)})),x=(t,e,a)=>`${(0,r.zB)(t,e,a)}, ${(0,s.fU)(t,e,a)}`;i()}catch(h){i(h)}})},82591:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{E2:function(){return p},Z8:function(){return f},a3:function(){return b},i:function(){return h},nR:function(){return l}});a(16280);var o=a(74487),n=a(22786),r=a(79791),s=t([o]);o=(s.then?(await s)():s)[0];const c=t=>t<10?`0${t}`:t,l=(t,e)=>{const a=e.days||0,i=e.hours||0,o=e.minutes||0,n=e.seconds||0,r=e.milliseconds||0;return a>0?`${Intl.NumberFormat(t.language,{style:"unit",unit:"day",unitDisplay:"long"}).format(a)} ${i}:${c(o)}:${c(n)}`:i>0?`${i}:${c(o)}:${c(n)}`:o>0?`${o}:${c(n)}`:n>0?Intl.NumberFormat(t.language,{style:"unit",unit:"second",unitDisplay:"long"}).format(n):r>0?Intl.NumberFormat(t.language,{style:"unit",unit:"millisecond",unitDisplay:"long"}).format(r):null},d=(0,n.A)(t=>new Intl.DurationFormat(t.language,{style:"long"})),h=(t,e)=>d(t).format(e),u=(0,n.A)(t=>new Intl.DurationFormat(t.language,{style:"digital",hoursDisplay:"auto"})),p=(t,e)=>u(t).format(e),f=["min","h","d"],g=(0,n.A)(t=>new Intl.DurationFormat(t.language,{style:"narrow",daysDisplay:"always"})),m=(0,n.A)(t=>new Intl.DurationFormat(t.language,{style:"narrow",hoursDisplay:"always"})),v=(0,n.A)(t=>new Intl.DurationFormat(t.language,{style:"narrow",minutesDisplay:"always"})),b=(t,e,a,i)=>{const o=void 0!==i?(0,r.L)(parseFloat(e),i):parseFloat(e);switch(a){case"d":{const e=Math.floor(o),a={days:e,hours:Math.floor(24*(o-e))};return g(t).format(a)}case"h":{const e=Math.floor(o),a={hours:e,minutes:Math.floor(60*(o-e))};return m(t).format(a)}case"min":{const e=Math.floor(o),a={minutes:e,seconds:Math.floor(60*(o-e))};return v(t).format(a)}default:throw new Error("Invalid duration unit")}};i()}catch(c){i(c)}})},30162:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{LW:function(){return g},Xs:function(){return p},fU:function(){return l},ie:function(){return h}});var o=a(74487),n=a(22786),r=a(8480),s=a(69543),c=t([o,r]);[o,r]=c.then?(await c)():c;const l=(t,e,a)=>d(e,a.time_zone).format(t),d=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,s.J)(t)?"h12":"h23",timeZone:(0,r.wj)(t.time_zone,e)})),h=(t,e,a)=>u(e,a.time_zone).format(t),u=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{hour:(0,s.J)(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,s.J)(t)?"h12":"h23",timeZone:(0,r.wj)(t.time_zone,e)})),p=(t,e,a)=>f(e,a.time_zone).format(t),f=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",hour:(0,s.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,s.J)(t)?"h12":"h23",timeZone:(0,r.wj)(t.time_zone,e)})),g=(t,e,a)=>m(e,a.time_zone).format(t),m=(0,n.A)((t,e)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,r.wj)(t.time_zone,e)}));i()}catch(l){i(l)}})},98975:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{K:function(){return l}});var o=a(74487),n=a(22786),r=a(63927),s=t([o,r]);[o,r]=s.then?(await s)():s;const c=(0,n.A)(t=>new Intl.RelativeTimeFormat(t.language,{numeric:"auto"})),l=(t,e,a,i=!0)=>{const o=(0,r.x)(t,a,e);return i?c(e).format(o.value,o.unit):Intl.NumberFormat(e.language,{style:"unit",unit:o.unit,unitDisplay:"long"}).format(Math.abs(o.value))};i()}catch(c){i(c)}})},8480:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{fL:function(){return p},n2:function(){return f},wj:function(){return g}});var o,n,r,s=a(74487),c=a(29079),l=a(46927),d=t([s]);s=(d.then?(await d)():d)[0];const h=null===(o=Intl.DateTimeFormat)||void 0===o||null===(n=(r=o.call(Intl)).resolvedOptions)||void 0===n?void 0:n.call(r).timeZone,u=h&&("UTC"===h||"Etc/UTC"===h||h in c)?h:void 0,p=14881==a.j?void 0!==u:null,f=null!=u?u:"UTC",g=(t,e)=>t===l.Wj.local&&u?f:e;i()}catch(h){i(h)}})},69543:function(t,e,a){a.d(e,{J:function(){return n}});a(74423);var i=a(22786),o=a(46927);const n=(0,i.A)(t=>{if(t.time_format===o.Hg.language||t.time_format===o.Hg.system){const e=t.time_format===o.Hg.language?t.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(e).includes("10")}return t.time_format===o.Hg.am_pm})},96029:function(t,e,a){a.d(e,{Tq:function(){return r},Z:function(){return o},ZV:function(){return i},sj:function(){return n}});const i=["sun","mon","tue","wed","thu","fri","sat"],o=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],n={0:"sun",1:"mon",2:"tue",3:"wed",4:"thu",5:"fri",6:"sat"},r={sun:"sunday",mon:"monday",tue:"tuesday",wed:"wednesday",thu:"thursday",fri:"friday",sat:"saturday"}},26218:function(t,e,a){a.d(e,{a:function(){return o}});a(16280);const i=(0,a(77796).n)(t=>{history.replaceState({scrollPosition:t},"")},300);function o(t){return(e,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const o=e.connectedCallback;e.connectedCallback=function(){o.call(this);const e=this[a];e&&this.updateComplete.then(()=>{const a=this.renderRoot.querySelector(t);a&&setTimeout(()=>{a.scrollTop=e},0)})};const n=Object.getOwnPropertyDescriptor(e,a);let r;if(void 0===n)r={get(){var t;return this[`__${String(a)}`]||(null===(t=history.state)||void 0===t?void 0:t.scrollPosition)},set(t){i(t),this[`__${String(a)}`]=t},configurable:!0,enumerable:!0};else{const t=n.set;r=Object.assign(Object.assign({},n),{},{set(e){i(e),this[`__${String(a)}`]=e,null==t||t.call(this,e)}})}Object.defineProperty(e,a,r)}}},76830:function(t,e,a){a.d(e,{d:function(){return i}});a(18111),a(20116);const i=(t,e=!0)=>{if(t.defaultPrevented||0!==t.button||t.metaKey||t.ctrlKey||t.shiftKey)return;const a=t.composedPath().find(t=>"A"===t.tagName);if(!a||a.target||a.hasAttribute("download")||"external"===a.getAttribute("rel"))return;let i=a.href;if(!i||-1!==i.indexOf("mailto:"))return;const o=window.location,n=o.origin||o.protocol+"//"+o.host;return i.startsWith(n)&&(i=i.slice(n.length),"#"!==i)?(e&&t.preventDefault(),i):void 0}},69093:function(t,e,a){a.d(e,{t:function(){return o}});var i=a(71727);const o=t=>(0,i.m)(t.entity_id)},15090:function(t,e,a){a.d(e,{nP:function(){return l},vB:function(){return s}});a(44114),a(26910),a(18111),a(22489),a(61701),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);var i=a(22675),o=a(52220),n=a(71727),r=a(69093);const s={alarm_control_panel:["armed_away","armed_custom_bypass","armed_home","armed_night","armed_vacation","arming","disarmed","disarming","pending","triggered"],alert:["on","off","idle"],assist_satellite:["idle","listening","responding","processing"],automation:["on","off"],binary_sensor:["on","off"],button:[],calendar:["on","off"],camera:["idle","recording","streaming"],cover:["closed","closing","open","opening"],device_tracker:["home","not_home"],fan:["on","off"],humidifier:["on","off"],infrared:[],input_boolean:["on","off"],input_button:[],lawn_mower:["error","paused","mowing","returning","docked"],light:["on","off"],lock:["jammed","locked","locking","unlocked","unlocking","opening","open"],media_player:["off","on","idle","playing","paused","standby","buffering"],person:["home","not_home"],plant:["ok","problem"],radio_frequency:[],remote:["on","off"],scene:[],schedule:["on","off"],script:["on","off"],siren:["on","off"],sun:["above_horizon","below_horizon"],switch:["on","off"],timer:["active","idle","paused"],update:["on","off"],vacuum:["cleaning","docked","error","idle","paused","returning"],valve:["closed","closing","open","opening"],weather:["clear-night","cloudy","exceptional","fog","hail","lightning-rainy","lightning","partlycloudy","pouring","rainy","snowy-rainy","snowy","sunny","windy-variant","windy"]},c={alarm_control_panel:{code_format:["number","text"]},binary_sensor:{device_class:["battery","battery_charging","co","cold","connectivity","door","garage_door","gas","heat","light","lock","moisture","motion","moving","occupancy","opening","plug","power","presence","problem","running","safety","smoke","sound","tamper","update","vibration","window"]},button:{device_class:["restart","update"]},camera:{frontend_stream_type:["hls","web_rtc"]},climate:{hvac_action:["off","idle","preheating","defrosting","heating","cooling","drying","fan"]},cover:{device_class:["awning","blind","curtain","damper","door","garage","gate","shade","shutter","window"]},device_tracker:{source_type:["bluetooth","bluetooth_le","gps","router"]},fan:{direction:["forward","reverse"]},humidifier:{device_class:["humidifier","dehumidifier"],action:["off","idle","humidifying","drying"]},media_player:{device_class:["tv","speaker","receiver"],media_content_type:["album","app","artist","channel","channels","composer","contributing_artist","episode","game","genre","image","movie","music","playlist","podcast","season","track","tvshow","url","video"],repeat:["off","one","all"]},number:{device_class:["temperature"]},sensor:{device_class:["apparent_power","aqi","battery","carbon_dioxide","carbon_monoxide","current","date","duration","energy","frequency","gas","humidity","illuminance","monetary","nitrogen_dioxide","nitrogen_monoxide","nitrous_oxide","ozone","ph","pm1","pm10","pm25","pm4","power_factor","power","pressure","reactive_power","signal_strength","sulphur_dioxide","temperature","timestamp","uptime","volatile_organic_compounds","volatile_organic_compounds_parts","voltage","volume_flow_rate"],state_class:["measurement","total","total_increasing"]},switch:{device_class:["outlet","switch"]},update:{device_class:["firmware"]},water_heater:{away_mode:["on","off"]}},l=(t,e,a=void 0)=>{const l=(0,r.t)(e),d=[];switch(d.push(...((t,e,a)=>{const r=[];switch(a||r.push(i.Hh,i.HV),!a&&e in s?r.push(...s[e]):a&&e in c&&a in c[e]&&r.push(...c[e][a]),e){case"device_tracker":case"person":a||r.push(...Object.entries(t.states).filter(([t,e])=>"zone"===(0,n.m)(t)&&"zone.home"!==t&&e.attributes.friendly_name).map(([t,e])=>e.attributes.friendly_name).sort((e,a)=>(0,o.xL)(e,a,t.locale.language)))}return r})(t,l,a)),l){case"climate":a?"fan_mode"===a?d.push(...e.attributes.fan_modes):"preset_mode"===a?d.push(...e.attributes.preset_modes):"swing_mode"===a?d.push(...e.attributes.swing_modes):"swing_horizontal_mode"===a&&d.push(...e.attributes.swing_horizontal_modes):d.push(...e.attributes.hvac_modes);break;case"event":"event_type"===a&&d.push(...e.attributes.event_types);break;case"fan":"preset_mode"===a&&d.push(...e.attributes.preset_modes);break;case"humidifier":"mode"===a&&d.push(...e.attributes.available_modes);break;case"input_select":case"select":a||d.push(...e.attributes.options);break;case"light":"effect"===a&&e.attributes.effect_list?d.push(...e.attributes.effect_list):"color_mode"===a&&e.attributes.supported_color_modes&&d.push(...e.attributes.supported_color_modes);break;case"media_player":"sound_mode"===a?d.push(...e.attributes.sound_mode_list):"source"===a&&d.push(...e.attributes.source_list);break;case"remote":"current_activity"===a&&d.push(...e.attributes.activity_list);break;case"sensor":a||"enum"!==e.attributes.device_class||d.push(...e.attributes.options);break;case"vacuum":"fan_speed"===a&&d.push(...e.attributes.fan_speed_list);break;case"water_heater":a&&"operation_mode"!==a||d.push(...e.attributes.operation_list)}return[...new Set(d)]}},47129:function(t,e,a){a.d(e,{a:function(){return n}});a(74423);var i=a(22675),o=a(71727);function n(t,e){const a=(0,o.m)(t.entity_id),n=void 0!==e?e:null==t?void 0:t.state;if(["button","event","infrared","input_button","radio_frequency","scene"].includes(a))return n!==i.Hh;if(n===i.Hh||n===i.HV)return!1;if("off"===n&&"alert"!==a)return!1;switch(a){case"alarm_control_panel":return"disarmed"!==n;case"alert":return"idle"!==n;case"cover":case"valve":return"closed"!==n;case"device_tracker":case"person":return"not_home"!==n;case"lawn_mower":return!["docked","paused"].includes(n);case"lock":return"locked"!==n;case"media_player":return"standby"!==n;case"vacuum":return!["idle","docked","paused"].includes(n);case"plant":return"problem"===n;case"group":return["on","home","open","locked","problem"].includes(n);case"timer":return"active"===n;case"camera":return"streaming"===n}return!0}},52658:function(t,e,a){a.d(e,{ZK:function(){return u},gf:function(){return h},mT:function(){return f},Se:function(){return d},mg:function(){return p}});a(44114),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);var i=a(22675),o=a(68287),n=a(86030),r=a(80880);var s=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:null==t?void 0:t.state)===i.Hh)return"var(--state-unavailable-color)";const a=p(t,e);return a?(0,n.B)(a):void 0},h=(t,e,a)=>{const i=void 0!==a?a:e.state,o=(0,c.a)(e,a);return u(t,e.attributes.device_class,i,o)},u=(t,e,a,i)=>{const o=[],n=(0,r.Y)(a,"_"),s=i?"active":"inactive";return e&&o.push(`--state-${t}-${e}-${n}-color`),o.push(`--state-${t}-${n}-color`,`--state-${t}-${s}-color`,`--state-${s}-color`),o},p=(t,e)=>{const a=void 0!==e?e:null==t?void 0:t.state,i=(0,s.m)(t.entity_id),n=t.attributes.device_class;if("sensor"===i&&"battery"===n){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,o.z)(t);if(a&&l.has(a))return h(a,t,e)}if(l.has(i))return h(i,t,e)},f=t=>{if(t.attributes.brightness&&"plant"!==(0,s.m)(t.entity_id)){return`brightness(${(t.attributes.brightness+245)/5}%)`}return""}},82286:function(t,e,a){a.d(e,{$:function(){return i}});const i=(t,e)=>o(t.attributes,e),o=(t,e)=>0!==(t.supported_features&e)},20058:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{QL:function(){return h},ZQ:function(){return u},ZV:function(){return d},ty:function(){return c},x:function(){return s}});var o=a(74487),n=(a(74423),a(18111),a(61701),a(46927)),r=t([o]);o=(r.then?(await r)():r)[0];const s=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 n.jG.comma_decimal:return["en-US","en"];case n.jG.decimal_comma:return["de","es","it"];case n.jG.space_comma:return["fr","sv","cs"];case n.jG.quote_decimal:return["de-CH"];case n.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(null==e?void 0:e.number_format)===n.jG.none||Number.isNaN(Number(t))?Number.isNaN(Number(t))||""===t||(null==e?void 0:e.number_format)!==n.jG.none?[{type:"literal",value:t}]:new Intl.NumberFormat("en-US",p(t,Object.assign(Object.assign({},a),{},{useGrouping:!1}))).formatToParts(Number(t)):new Intl.NumberFormat(i,p(t,a)).formatToParts(Number(t))},u=(t,e)=>{var a;const i=null==e?void 0:e.display_precision;return null!=i?{maximumFractionDigits:i,minimumFractionDigits:i}:Number.isInteger(Number(null==t||null===(a=t.attributes)||void 0===a?void 0:a.step))&&Number.isInteger(Number(null==t?void 0:t.state))?{maximumFractionDigits:0}:void 0},p=(t,e)=>{const a=Object.assign({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(s){i(s)}})},79791:function(t,e,a){a.d(e,{L:function(){return i}});const i=(t,e=2)=>Math.round(t*10**e)/10**e},8185:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{c:function(){return s},q:function(){return c}});var o=a(74487),n=a(22786),r=t([o]);o=(r.then?(await r)():r)[0];const s=(t,e)=>l(t).format(e),c=(t,e)=>d(t).format(e),l=(0,n.A)(t=>new Intl.ListFormat(t.language,{style:"long",type:"conjunction"})),d=(0,n.A)(t=>new Intl.ListFormat(t.language,{style:"long",type:"disjunction"}));i()}catch(s){i(s)}})},80880:function(t,e,a){a.d(e,{Y:function(){return i}});a(84864),a(57465),a(27495),a(25440);const i=(t,e="_")=>{const a="àáâäæãåāăąабçćčđďдèéêëēėęěеёэфğǵгḧхîïíīįìıİийкłлḿмñńǹňнôöòóœøōõőоṕпŕřрßśšşșсťțтûüùúūǘůűųувẃẍÿýыžźżз·",i=`aaaaaaaaaaabcccdddeeeeeeeeeeefggghhiiiiiiiiijkllmmnnnnnoooooooooopprrrsssssstttuuuuuuuuuuvwxyyyzzzz${e}`,o=new RegExp(a.split("").join("|"),"g"),n={"ж":"zh","х":"kh","ц":"ts","ч":"ch","ш":"sh","щ":"shch","ю":"iu","я":"ia"};let r;return""===t?r="":(r=t.toString().toLowerCase().replace(o,t=>i.charAt(a.indexOf(t))).replace(/[а-я]/g,t=>n[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}},34470:function(t,e,a){a.d(e,{E:function(){return o}});let i;const o=(0,a(5124).AH)(i||(i=(t=>t)`ha-state-icon[data-domain=alarm_control_panel][data-state=arming],ha-state-icon[data-domain=alarm_control_panel][data-state=pending],ha-state-icon[data-domain=alarm_control_panel][data-state=triggered],ha-state-icon[data-domain=lock][data-state=jammed]{animation:pulse 1s infinite}@keyframes pulse{0%{opacity:1}50%{opacity:0}100%{opacity:1}}ha-state-icon[data-state=unavailable]{color:var(--state-unavailable-color)}`))},22533:function(t,e,a){a.d(e,{i:function(){return o}});var i=a(52943);const o=(t,e)=>(t=>{switch(t){case"de":case"lb":return!0;default:return!1}})(e)?(0,i.Z)(t):t.toLocaleLowerCase(e)},67258:function(t,e,a){a.d(e,{d:function(){return i}});const i=t=>{switch(t.language){case"cs":case"de":case"fi":case"fr":case"sk":case"sv":return" ";default:return""}}},8549:function(t,e,a){a.d(e,{A:function(){return o}});var i=a(67258);const o=(t,e)=>"°"===t?"":e&&"%"===t?(0,i.d)(e):" "},5911:function(t,e,a){a.d(e,{$:function(){return i}});a(44114),a(62953);const i=(t,e)=>{const a={};for(const i of t){const t=e(i);t in a?a[t].push(i):a[t]=[i]}return a}},63927:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{x:function(){return p}});var o=a(6946),n=a(52640),r=a(38684),s=a(380),c=t([s]);s=(c.then?(await c)():c)[0];const d=1e3,h=60,u=60*h;function p(t,e=Date.now(),a,i={}){const c=Object.assign(Object.assign({},f),i||{}),l=(+t-+e)/d;if(Math.abs(l)<c.second)return{value:Math.round(l),unit:"second"};const p=l/h;if(Math.abs(p)<c.minute)return{value:Math.round(p),unit:"minute"};const g=l/u;if(Math.abs(g)<c.hour)return{value:Math.round(g),unit:"hour"};const m=new Date(t),v=new Date(e);m.setHours(0,0,0,0),v.setHours(0,0,0,0);const b=(0,o.c)(m,v);if(0===b)return{value:Math.round(g),unit:"hour"};if(Math.abs(b)<c.day)return{value:b,unit:"day"};const y=(0,s.P)(a),_=(0,n.k)(m,{weekStartsOn:y}),w=(0,n.k)(v,{weekStartsOn:y}),x=(0,r.I)(_,w);if(0===x)return{value:b,unit:"day"};if(Math.abs(x)<c.week)return{value:x,unit:"week"};const $=m.getFullYear()-v.getFullYear(),C=12*$+m.getMonth()-v.getMonth();return 0===C?{value:x,unit:"week"}:Math.abs(C)<c.month||0===$?{value:C,unit:"month"}:{value:Math.round($),unit:"year"}}const f={second:59,minute:59,hour:22,day:5,week:4,month:11};i()}catch(l){i(l)}})},77796:function(t,e,a){a.d(e,{n:function(){return i}});a(62953);const i=(t,e,a=!0,i=!0)=>{let o,n=0;const r=(...r)=>{const s=()=>{n=!1===a?0:Date.now(),o=void 0,t(...r)},c=Date.now();n||!1!==a||(n=c);const l=e-(c-n);l<=0||l>e?(o&&(clearTimeout(o),o=void 0),n=c,t(...r)):o||!1===i||(o=window.setTimeout(s,l))};return r.cancel=()=>{clearTimeout(o),o=void 0,n=0},r}},3931:function(t,e,a){a.d(e,{U:function(){return i}});a(3362),a(62953);const i=async(t,e,a,i,o,...n)=>{let r=i[t];r||(r=i[t]={});const s=r[o];if(s)return s;const c=a(i,o,...n);return r[o]=c,c.then(()=>setTimeout(()=>{r[o]=void 0},e),()=>{r[o]=void 0}),c}},74281:function(t,e,a){a.a(t,async function(t,e){try{a(18111),a(7588),a(45367),a(92731),a(62953);var i=a(40445),o=a(5124),n=a(67576),r=a(63672),s=a(89784),c=a(71727),l=a(69093),d=a(52658),h=a(34470),u=a(10897),p=a(38279),f=a(93367),g=t([f]);f=(g.then?(await g)():g)[0];let m,v,b,y=t=>t;const _="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z";class w extends o.WF{connectedCallback(){var t,e;super.connectedCallback(),this.hasUpdated&&void 0===this.overrideImage&&(null!==(t=this.stateObj)&&void 0!==t&&t.attributes.entity_picture||null!==(e=this.stateObj)&&void 0!==e&&e.attributes.entity_picture_local)&&this.requestUpdate("stateObj")}disconnectedCallback(){var t,e;super.disconnectedCallback(),void 0===this.overrideImage&&(null!==(t=this.stateObj)&&void 0!==t&&t.attributes.entity_picture||null!==(e=this.stateObj)&&void 0!==e&&e.attributes.entity_picture_local)&&(this.style.backgroundImage="")}get _stateColor(){var t;const e=this.stateObj?(0,l.t)(this.stateObj):void 0;return null!==(t=this.stateColor)&&void 0!==t?t:"light"===e}render(){const t=this.stateObj;if(!t&&!this.overrideIcon&&!this.overrideImage)return(0,o.qy)(m||(m=y`<div class="missing"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div>`),_);const e=this.getClass();if(e&&e.forEach((t,e)=>{t?this.classList.add(e):this.classList.remove(e)}),!this.icon)return o.s6;const a=t?(0,l.t)(t):void 0;return(0,o.qy)(v||(v=y`<ha-state-icon style="${0}" data-domain="${0}" data-state="${0}" .icon="${0}" .stateObj="${0}"></ha-state-icon>`),(0,s.W)(this._iconStyle),(0,r.J)(a),(0,r.J)(null==t?void 0:t.state),this.overrideIcon,t)}willUpdate(t){if(super.willUpdate(t),!(t.has("stateObj")||t.has("overrideImage")||t.has("overrideIcon")||t.has("stateColor")||t.has("color")))return;const e=this.stateObj,a={};let i="";if(this.icon=!0,e){const t=(0,c.m)(e.entity_id);if(void 0===this.overrideImage)if(!e.attributes.entity_picture_local&&!e.attributes.entity_picture||this.overrideIcon){if(this.color)a.color=this.color;else if(this._stateColor){const t=(0,d.Se)(e);if(t&&(a.color=t),e.attributes.rgb_color&&(a.color=`rgb(${e.attributes.rgb_color.join(",")})`),e.attributes.brightness){const t=e.attributes.brightness;if("number"!=typeof t){const a=`Type error: state-badge expected number, but type of ${e.entity_id}.attributes.brightness is ${typeof t} (${t})`;console.warn(a)}a.filter=(0,d.mT)(e)}if(e.attributes.hvac_action){const t=e.attributes.hvac_action;t in p.sx?a.color=(0,d.Se)(e,p.sx[t]):delete a.color}}}else{let a=e.attributes.entity_picture_local||e.attributes.entity_picture;this.hass&&(a=this.hass.hassUrl(a)),"camera"===t&&(a=(0,u.su)(a,80,80)),i=`url(${a})`,this.icon=!1}else if(this.overrideImage){let t=this.overrideImage;this.hass&&(t=this.hass.hassUrl(t)),i=`url(${t})`,this.icon=!1}}this._iconStyle=a,this.style.backgroundImage=i}getClass(){const t=new Map(["has-no-radius","has-media-image","has-image"].map(t=>[t,!1]));if(this.stateObj){const e=(0,c.m)(this.stateObj.entity_id);"update"===e?t.set("has-no-radius",!0):"media_player"===e||"camera"===e?t.set("has-media-image",!0):""!==this.style.backgroundImage&&t.set("has-image",!0)}return t}static get styles(){return[h.E,(0,o.AH)(b||(b=y`:host{position:relative;display:inline-flex;width:40px;color:var(--state-icon-color);border-radius:var(--state-badge-border-radius,50%);height:40px;background-size:cover;box-sizing:border-box;--state-inactive-color:initial;align-items:center;justify-content:center}:host(.has-image){border-radius:var(--state-badge-with-image-border-radius,50%)}:host(.has-media-image){border-radius:var(--state-badge-with-media-image-border-radius,8%)}:host(.has-no-radius){border-radius:var(--ha-border-radius-square)}:host(:focus){outline:0}:host(:not([icon]):focus){border:2px solid var(--divider-color)}:host([icon]:focus){background:var(--divider-color)}ha-state-icon{transition:color .3s ease-in-out,filter .3s ease-in-out}.missing{color:#fce588}`))]}constructor(...t){super(...t),this.icon=!0,this._iconStyle={}}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"stateObj",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"overrideIcon",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"overrideImage",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"stateColor",void 0),(0,i.Cg)([(0,n.MZ)()],w.prototype,"color",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],w.prototype,"icon",void 0),(0,i.Cg)([(0,n.wk)()],w.prototype,"_iconStyle",void 0),w=(0,i.Cg)([(0,n.EM)("state-badge")],w),e()}catch(m){e(m)}})},76776:function(t,e,a){a(62953);var i=a(40445),o=a(5124),n=a(67576);let r,s,c,l=t=>t;class d extends o.WF{render(){return(0,o.qy)(r||(r=l` ${0} <slot></slot> `),this.header?(0,o.qy)(s||(s=l`<h1 class="card-header">${0}</h1>`),this.header):o.s6)}constructor(...t){super(...t),this.raised=!1}}d.styles=(0,o.AH)(c||(c=l`: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,i.Cg)([(0,n.MZ)()],d.prototype,"header",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],d.prototype,"raised",void 0),d=(0,i.Cg)([(0,n.EM)("ha-card")],d)},70947:function(t,e,a){a(62953);var i=a(40445),o=a(50759),n=(a(38625),a(5124)),r=a(67576);a(67094);let s,c,l=t=>t;class d extends o.A{renderCheckboxIcon(){return(0,n.qy)(s||(s=l` <ha-svg-icon id="check" part="checkmark" .path="${0}"></ha-svg-icon> `),this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z")}static get styles(){return[o.A.styles,(0,n.AH)(c||(c=l`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`))]}constructor(...t){super(...t),this.selected=!1}}(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],d.prototype,"selected",void 0),d=(0,i.Cg)([(0,r.EM)("ha-dropdown-item")],d)},29823:function(t,e,a){a.a(t,async function(t,e){try{a(3362),a(62953);var i=a(40445),o=a(52254),n=a(5124),r=a(67576),s=t([o]);o=(s.then?(await s)():s)[0];let c,l=t=>t;class d extends o.A{get anchorElement(){var t;return null===(t=this.popup)||void 0===t?void 0:t.anchor}set anchorElement(t){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=t)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!0)}async hideMenu(){const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!1),await super.hideMenu()}static get styles(){return[o.A.styles,(0,n.AH)(c||(c=l`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var(
--card-background-color,
var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)),
)}#menu{padding:var(--ha-space-1)}wa-popup::part(popup){z-index:200}`))]}constructor(...t){super(...t),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],d.prototype,"dropdownTag",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],d.prototype,"dropdownItemTag",void 0),d=(0,i.Cg)([(0,r.EM)("ha-dropdown")],d),e()}catch(c){e(c)}})},18198:function(t,e,a){a.d(e,{Dc:function(){return d},Si:function(){return l}});var i=a(40445),o=a(5124),n=a(67576);a(47680),a(67094);let r,s,c=t=>t;const l=t=>{switch(t.level){case 0:return"M11,10H13V16H11V10M22,12H19V20H5V12H2L12,3L22,12M15,10A2,2 0 0,0 13,8H11A2,2 0 0,0 9,10V16A2,2 0 0,0 11,18H13A2,2 0 0,0 15,16V10Z";case 1:return"M12,3L2,12H5V20H19V12H22L12,3M10,8H14V18H12V10H10V8Z";case 2:return"M12,3L2,12H5V20H19V12H22L12,3M9,8H13A2,2 0 0,1 15,10V12A2,2 0 0,1 13,14H11V16H15V18H9V14A2,2 0 0,1 11,12H13V10H9V8Z";case 3:return"M12,3L22,12H19V20H5V12H2L12,3M15,11.5V10C15,8.89 14.1,8 13,8H9V10H13V12H11V14H13V16H9V18H13A2,2 0 0,0 15,16V14.5A1.5,1.5 0 0,0 13.5,13A1.5,1.5 0 0,0 15,11.5Z";case-1:return"M12,3L2,12H5V20H19V12H22L12,3M11,15H7V13H11V15M15,18H13V10H11V8H15V18Z"}return"M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z"},d=t=>{switch(t.level){case 0:return"mdi:home-floor-0";case 1:return"mdi:home-floor-1";case 2:return"mdi:home-floor-2";case 3:return"mdi:home-floor-3";case-1:return"mdi:home-floor-negative-1"}return"mdi:home"};class h extends o.WF{render(){if(!this.floor)return o.s6;if(this.floor.icon)return(0,o.qy)(r||(r=c`<ha-icon .icon="${0}"></ha-icon>`),this.floor.icon);const t=l(this.floor);return(0,o.qy)(s||(s=c`<ha-svg-icon .path="${0}"></ha-svg-icon>`),t)}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"floor",void 0),(0,i.Cg)([(0,n.MZ)()],h.prototype,"icon",void 0),h=(0,i.Cg)([(0,n.EM)("ha-floor-icon")],h)},43661:function(t,e,a){a.r(e),a.d(e,{HaIconNext:function(){return s}});a(62953);var i=a(40445),o=a(67576),n=a(63091),r=a(67094);class s extends r.HaSvgIcon{constructor(...t){super(...t),this.path="rtl"===n.G.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}(0,i.Cg)([(0,o.MZ)()],s.prototype,"path",void 0),s=(0,i.Cg)([(0,o.EM)("ha-icon-next")],s)},47680:function(t,e,a){a.r(e),a.d(e,{HaIcon:function(){return A}});a(74423),a(3362),a(62953);var i=a(40445),o=a(5124),n=a(67576),r=a(1087),s=a(9899),c=a(700),l=(a(44114),a(18111),a(7588),a(96167),a(95192)),d=a(7553);const h=JSON.parse('{"version":"7.4.47","parts":[{"file":"7a7139d465f1f41cb26ab851a17caa21a9331234"},{"start":"account-supervisor-circle-","file":"9561286c4c1021d46b9006596812178190a7cc1c"},{"start":"alpha-r-c","file":"eb466b7087fb2b4d23376ea9bc86693c45c500fa"},{"start":"arrow-decision-o","file":"4b3c01b7e0723b702940c5ac46fb9e555646972b"},{"start":"baby-f","file":"2611401d85450b95ab448ad1d02c1a432b409ed2"},{"start":"battery-hi","file":"89bcd31855b34cd9d31ac693fb073277e74f1f6a"},{"start":"blur-r","file":"373709cd5d7e688c2addc9a6c5d26c2d57c02c48"},{"start":"briefcase-account-","file":"a75956cf812ee90ee4f656274426aafac81e1053"},{"start":"calendar-question-","file":"3253f2529b5ebdd110b411917bacfacb5b7063e6"},{"start":"car-lig","file":"74566af3501ad6ae58ad13a8b6921b3cc2ef879d"},{"start":"cellphone-co","file":"7677f1cfb2dd4f5562a2aa6d3ae43a2e6997b21a"},{"start":"circle-slice-2","file":"70d08c50ec4522dd75d11338db57846588263ee2"},{"start":"cloud-co","file":"141d2bfa55ca4c83f4bae2812a5da59a84fec4ff"},{"start":"cog-s","file":"5a640365f8e47c609005d5e098e0e8104286d120"},{"start":"cookie-l","file":"dd85b8eb8581b176d3acf75d1bd82e61ca1ba2fc"},{"start":"currency-eur-","file":"15362279f4ebfc3620ae55f79d2830ad86d5213e"},{"start":"delete-o","file":"239434ab8df61237277d7599ebe066c55806c274"},{"start":"draw-","file":"5605918a592070803ba2ad05a5aba06263da0d70"},{"start":"emoticon-po","file":"a838cfcec34323946237a9f18e66945f55260f78"},{"start":"fan","file":"effd56103b37a8c7f332e22de8e4d67a69b70db7"},{"start":"file-question-","file":"b2424b50bd465ae192593f1c3d086c5eec893af8"},{"start":"flask-off-","file":"3b76295cde006a18f0301dd98eed8c57e1d5a425"},{"start":"food-s","file":"1c6941474cbeb1755faaaf5771440577f4f1f9c6"},{"start":"gamepad-u","file":"c6efe18db6bc9654ae3540c7dee83218a5450263"},{"start":"google-f","file":"df341afe6ad4437457cf188499cb8d2df8ac7b9e"},{"start":"head-c","file":"282121c9e45ed67f033edcc1eafd279334c00f46"},{"start":"home-pl","file":"27e8e38fc7adcacf2a210802f27d841b49c8c508"},{"start":"inbox-","file":"0f0316ec7b1b7f7ce3eaabce26c9ef619b5a1694"},{"start":"key-v","file":"ea33462be7b953ff1eafc5dac2d166b210685a60"},{"start":"leaf-circle-","file":"33db9bbd66ce48a2db3e987fdbd37fb0482145a4"},{"start":"lock-p","file":"b89e27ed39e9d10c44259362a4b57f3c579d3ec8"},{"start":"message-s","file":"7b5ab5a5cadbe06e3113ec148f044aa701eac53a"},{"start":"moti","file":"01024d78c248d36805b565e343dd98033cc3bcaf"},{"start":"newspaper-variant-o","file":"22a6ec4a4fdd0a7c0acaf805f6127b38723c9189"},{"start":"on","file":"c73d55b412f394e64632e2011a59aa05e5a1f50d"},{"start":"paw-ou","file":"3f669bf26d16752dc4a9ea349492df93a13dcfbf"},{"start":"pigg","file":"0c24edb27eb1c90b6e33fc05f34ef3118fa94256"},{"start":"printer-pos-sy","file":"41a55cda866f90b99a64395c3bb18c14983dcf0a"},{"start":"read","file":"c7ed91552a3a64c9be88c85e807404cf705b7edf"},{"start":"robot-vacuum-variant-o","file":"917d2a35d7268c0ea9ad9ecab2778060e19d90e0"},{"start":"sees","file":"6e82d9861d8fac30102bafa212021b819f303bdb"},{"start":"shoe-f","file":"e2fe7ce02b5472301418cc90a0e631f187b9f238"},{"start":"snowflake-m","file":"a28ba9f5309090c8b49a27ca20ff582a944f6e71"},{"start":"st","file":"7e92d03f095ec27e137b708b879dfd273bd735ab"},{"start":"su","file":"61c74913720f9de59a379bdca37f1d2f0dc1f9db"},{"start":"tag-plus-","file":"8f3184156a4f38549cf4c4fffba73a6a941166ae"},{"start":"timer-a","file":"baab470d11cfb3a3cd3b063ee6503a77d12a80d0"},{"start":"transit-d","file":"8561c0d9b1ac03fab360fd8fe9729c96e8693239"},{"start":"vector-arrange-b","file":"c9a3439257d4bab33d3355f1f2e11842e8171141"},{"start":"water-ou","file":"02dbccfb8ca35f39b99f5a085b095fc1275005a0"},{"start":"webc","file":"57bafd4b97341f4f2ac20a609d023719f23a619c"},{"start":"zip","file":"65ae094e8263236fa50486584a08c03497a38d93"}]}');let u;const p=()=>(u||(u=f().catch(t=>{throw u=void 0,t})),u),f=async()=>{const t=(0,l.y$)("hass-icon-db","mdi-icon-store"),e=await(0,l.Jt)("_version",t);return e?e!==h.version&&(await(0,l.IU)(t),(0,l.hZ)("_version",h.version,t)):(0,l.hZ)("_version",h.version,t),t},g=["mdi","hass","hassio","hademo"];let m=[];a(67094);let v,b,y,_=t=>t;const w={},x={},$=(0,s.s)(()=>(async t=>{const e=Object.keys(t),a=await Promise.allSettled(Object.values(t));(await p())("readwrite",i=>{a.forEach((a,o)=>{"fulfilled"===a.status&&Object.entries(a.value).forEach(([t,e])=>{i.put(e,t)}),delete t[e[o]]})})})(x),2e3),C={},k={"home-assistant":()=>a.e(58781).then(a.bind(a,53580)).then(t=>t.mdiHomeAssistant),"music-assistant":()=>a.e(56009).then(a.bind(a,10576)).then(t=>t.mdiMusicAssistant),esphome:()=>a.e(88800).then(a.bind(a,45091)).then(t=>t.mdiEsphomeLogo)};class A extends o.WF{willUpdate(t){super.willUpdate(t),t.has("icon")&&(this._path=void 0,this._secondaryPath=void 0,this._viewBox=void 0,this._loadIcon())}render(){return this.icon?this._legacy?(0,o.qy)(v||(v=_` <iron-icon .icon="${0}"></iron-icon>`),this.icon):(0,o.qy)(b||(b=_`<ha-svg-icon .path="${0}" .secondaryPath="${0}" .viewBox="${0}"></ha-svg-icon>`),this._path,this._secondaryPath,this._viewBox):o.s6}async _loadIcon(){if(!this.icon)return;const t=this.icon,[e,a]=this.icon.split(":",2);let i,o=a;if(!e||!o)return;if(!g.includes(e)){const a=c.y[e];return a?void(a&&"function"==typeof a.getIcon&&this._setCustomPath(a.getIcon(o),t)):void(this._legacy=!0)}if(this._legacy=!1,o in w){const t=w[o];let a;t.newName?(a=`Icon ${e}:${o} was renamed to ${e}:${t.newName}, please change your config, it will be removed in version ${t.removeIn}.`,o=t.newName):a=`Icon ${e}:${o} was removed from MDI, please replace this icon with an other icon in your config, it will be removed in version ${t.removeIn}.`,console.warn(a),(0,r.r)(this,"write_log",{level:"warning",message:a})}if(o in C)return void(this._path=C[o]);if(o in k){const e=await k[o]();return this.icon===t&&(this._path=e),void(C[o]=e)}try{i=await(t=>new Promise((e,a)=>{if(m.push([t,e,a]),m.length>1)return;const i=p();(0,d.h)(1e3,(async()=>{(await i)("readonly",t=>{for(const[e,a,i]of m)(0,l.Yd)(t.get(e)).then(t=>a(t)).catch(t=>i(t));m=[]})})()).catch(t=>{for(const[,,e]of m)e(t);m=[]})}))(o)}catch(u){i=void 0}if(i)return this.icon===t&&(this._path=i),void(C[o]=i);const n=(t=>{let e;for(const a of h.parts){if(void 0!==a.start&&t<a.start)break;e=a}return e.file})(o);if(n in x)return void this._setPath(x[n],o,t);const s=fetch(`/static/mdi/${n}.json`).then(t=>t.json());x[n]=s,this._setPath(s,o,t),s.catch(()=>{delete x[n]}),$()}async _setCustomPath(t,e){const a=await t;this.icon===e&&(this._path=a.path,this._secondaryPath=a.secondaryPath,this._viewBox=a.viewBox)}async _setPath(t,e,a){try{const i=await t;this.icon===a&&(this._path=i[e]),C[e]=i[e]}catch(i){}}constructor(...t){super(...t),this._legacy=!1}}A.styles=(0,o.AH)(y||(y=_`:host{fill:currentcolor}`)),(0,i.Cg)([(0,n.MZ)()],A.prototype,"icon",void 0),(0,i.Cg)([(0,n.wk)()],A.prototype,"_path",void 0),(0,i.Cg)([(0,n.wk)()],A.prototype,"_secondaryPath",void 0),(0,i.Cg)([(0,n.wk)()],A.prototype,"_viewBox",void 0),(0,i.Cg)([(0,n.wk)()],A.prototype,"_legacy",void 0),A=(0,i.Cg)([(0,n.EM)("ha-icon")],A)},8630:function(t,e,a){var i=a(40445),o=a(68618),n=a(11081),r=a(67576);class s extends o.iY{}s.styles=n.R,s=(0,i.Cg)([(0,r.EM)("ha-list")],s)},36158:function(t,e,a){a.a(t,async function(t,e){try{a(62953);var i=a(40445),o=a(25625),n=a(5124),r=a(67576),s=a(98975),c=a(52943),l=t([s]);s=(l.then?(await l)():l)[0];class d extends n.mN{disconnectedCallback(){super.disconnectedCallback(),this._clearInterval()}connectedCallback(){super.connectedCallback(),this.datetime&&this._startInterval()}createRenderRoot(){return this}firstUpdated(t){super.firstUpdated(t),this._updateRelative()}update(t){super.update(t),this._updateRelative()}_clearInterval(){this._interval&&(window.clearInterval(this._interval),this._interval=void 0)}_startInterval(){this._clearInterval(),this._interval=window.setInterval(()=>this._updateRelative(),6e4)}_updateRelative(){if(this.datetime){const t="string"==typeof this.datetime?(0,o.H)(this.datetime):this.datetime,e=(0,s.K)(t,this.hass.locale);this.innerHTML=this.capitalize?(0,c.Z)(e):e}else this.innerHTML=this.hass.localize("ui.components.relative_time.never")}constructor(...t){super(...t),this.capitalize=!1}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],d.prototype,"datetime",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],d.prototype,"capitalize",void 0),d=(0,i.Cg)([(0,r.EM)("ha-relative-time")],d),e()}catch(d){e(d)}})},54276:function(t,e,a){a(62953);var i=a(40445),o=a(76482),n=a(91382),r=a(96245),s=a(5124),c=a(67576);let l;class d extends n.n{attach(t){super.attach(t),this.attachableTouchController.attach(t)}disconnectedCallback(){super.disconnectedCallback(),this.hovered=!1,this.pressed=!1}detach(){super.detach(),this.attachableTouchController.detach()}_onTouchControlChange(t,e){null==t||t.removeEventListener("touchend",this._handleTouchEnd),null==e||e.addEventListener("touchend",this._handleTouchEnd)}constructor(...t){super(...t),this.attachableTouchController=new o.i(this,this._onTouchControlChange.bind(this)),this._handleTouchEnd=()=>{this.disabled||super.endPressAnimation()}}}d.styles=[r.R,(0,s.AH)(l||(l=(t=>t)`:host{--md-ripple-hover-opacity:var(--ha-ripple-hover-opacity, 0.08);--md-ripple-pressed-opacity:var(--ha-ripple-pressed-opacity, 0.12);--md-ripple-hover-color:var(
--ha-ripple-hover-color,
var(--ha-ripple-color, var(--secondary-text-color))
);--md-ripple-pressed-color:var(
--ha-ripple-pressed-color,
var(--ha-ripple-color, var(--secondary-text-color))
)}`))],d=(0,i.Cg)([(0,c.EM)("ha-ripple")],d)},85938:function(t,e,a){a(18111),a(22489),a(3362),a(46058),a(62953);var i=a(40445),o=a(5124),n=a(67576),r=a(1087);let s,c=t=>t;class l extends o.WF{updated(t){t.has("disabled")&&(this.disabled?this._destroySortable():this._createSortable())}disconnectedCallback(){super.disconnectedCallback(),this._shouldBeDestroy=!0,setTimeout(()=>{this._shouldBeDestroy&&(this._destroySortable(),this._shouldBeDestroy=!1)},1)}connectedCallback(){super.connectedCallback(),this._shouldBeDestroy=!1,this.hasUpdated&&!this.disabled&&this._createSortable()}createRenderRoot(){return this}render(){return this.noStyle?o.s6:(0,o.qy)(s||(s=c` <style>.sortable-fallback{display:none!important}.sortable-ghost{box-shadow:0 0 0 2px var(--primary-color);background:rgba(var(--rgb-primary-color),.25);border-radius:var(--ha-border-radius-sm);opacity:.4}.sortable-drag{border-radius:var(--ha-border-radius-sm);opacity:1;background:var(--card-background-color);box-shadow:0px 4px 8px 3px #00000026;cursor:grabbing}</style> `))}async _createSortable(){if(this._sortable)return;const t=this.children[0];if(!t)return;const e=(await Promise.all([a.e(85283),a.e(70322)]).then(a.bind(a,80745))).default,i=Object.assign(Object.assign({scroll:!0,forceAutoScrollFallback:!0,scrollSpeed:20,animation:150},this.options),{},{onChoose:this._handleChoose,onStart:this._handleStart,onEnd:this._handleEnd,onUpdate:this._handleUpdate,onAdd:this._handleAdd,onRemove:this._handleRemove});this.draggableSelector&&(i.draggable=this.draggableSelector),this.handleSelector&&(i.handle=this.handleSelector),void 0!==this.invertSwap&&(i.invertSwap=this.invertSwap),this.group&&(i.group=this.group),this.filter&&(i.filter=this.filter),this._sortable=new e(t,i)}_destroySortable(){this._sortable&&(this._sortable.destroy(),this._sortable=void 0)}constructor(...t){super(...t),this.disabled=!1,this.noStyle=!1,this.invertSwap=!1,this.rollback=!0,this._shouldBeDestroy=!1,this._handleUpdate=t=>{(0,r.r)(this,"item-moved",{newIndex:t.newIndex,oldIndex:t.oldIndex})},this._handleAdd=t=>{(0,r.r)(this,"item-added",{index:t.newIndex,data:t.item.sortableData,item:t.item})},this._handleRemove=t=>{(0,r.r)(this,"item-removed",{index:t.oldIndex})},this._handleEnd=async t=>{(0,r.r)(this,"drag-end"),this.rollback&&t.item.placeholder&&(t.item.placeholder.replaceWith(t.item),delete t.item.placeholder)},this._handleStart=()=>{(0,r.r)(this,"drag-start")},this._handleChoose=t=>{this.rollback&&(t.item.placeholder=document.createComment("sort-placeholder"),t.item.after(t.item.placeholder))}}}(0,i.Cg)([(0,n.MZ)({type:Boolean})],l.prototype,"disabled",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"no-style"})],l.prototype,"noStyle",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"draggable-selector"})],l.prototype,"draggableSelector",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"handle-selector"})],l.prototype,"handleSelector",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"filter"})],l.prototype,"filter",void 0),(0,i.Cg)([(0,n.MZ)({type:String})],l.prototype,"group",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"invert-swap"})],l.prototype,"invertSwap",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],l.prototype,"options",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],l.prototype,"rollback",void 0),l=(0,i.Cg)([(0,n.EM)("ha-sortable")],l)},65829:function(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaSpinner:function(){return h}});var o=a(40445),n=a(55262),r=a(5124),s=a(67576),c=t([n]);n=(c.then?(await c)():c)[0];let l,d=t=>t;class h extends n.A{updated(t){if(super.updated(t),t.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[n.A.styles,(0,r.AH)(l||(l=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,s.MZ)()],h.prototype,"size",void 0),h=(0,o.Cg)([(0,s.EM)("ha-spinner")],h),i()}catch(l){i(l)}})},93367:function(t,e,a){a.a(t,async function(t,e){try{var i=a(40445),o=a(35211),n=a(5124),r=a(67576),s=a(91450),c=a(69093),l=a(22792),d=a(85694),h=(a(47680),a(67094),t([d]));d=(h.then?(await h)():h)[0];let u,p,f,g,m=t=>t;class v extends n.WF{render(){var t,e;const a=this.icon||this.stateObj&&(null===(t=this._entities)||void 0===t||null===(t=t[this.stateObj.entity_id])||void 0===t?void 0:t.icon)||(null===(e=this.stateObj)||void 0===e?void 0:e.attributes.icon);if(a)return(0,n.qy)(u||(u=m`<ha-icon .icon="${0}"></ha-icon>`),a);if(!this.stateObj)return n.s6;if(!this._config||!this._connection||!this._entities)return this._renderFallback();const i=(0,d.fq)(this._entities,this._config.config,this._connection.connection,this.stateObj,this.stateValue).then(t=>t?(0,n.qy)(p||(p=m`<ha-icon .icon="${0}"></ha-icon>`),t):this._renderFallback());return(0,n.qy)(f||(f=m`${0}`),(0,s.T)(i))}_renderFallback(){const t=(0,c.t)(this.stateObj);return(0,n.qy)(g||(g=m` <ha-svg-icon .path="${0}"></ha-svg-icon> `),d.l[t]||d.lW)}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"stateObj",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"stateValue",void 0),(0,i.Cg)([(0,r.MZ)()],v.prototype,"icon",void 0),(0,i.Cg)([(0,r.wk)(),(0,o.Fg)({context:l.WF,subscribe:!0})],v.prototype,"_config",void 0),(0,i.Cg)([(0,r.wk)(),(0,o.Fg)({context:l.Wq,subscribe:!0})],v.prototype,"_connection",void 0),(0,i.Cg)([(0,r.wk)(),(0,o.Fg)({context:l.X1,subscribe:!0})],v.prototype,"_entities",void 0),v=(0,i.Cg)([(0,r.EM)("ha-state-icon")],v),e()}catch(u){e(u)}})},43831:function(t,e,a){a(62953);var i=a(40445),o=a(5124),n=a(67576),r=a(63672);a(54276);let s,c,l=t=>t;class d extends o.WF{render(){return(0,o.qy)(s||(s=l` <div tabindex="0" role="tab" aria-selected="${0}" aria-label="${0}" @keydown="${0}"> <slot name="icon"></slot> <span class="name">${0}</span> <ha-ripple></ha-ripple> </div> `),this.active,(0,r.J)(this.name),this._handleKeyDown,this.name)}_handleKeyDown(t){"Enter"===t.key&&t.target.click()}constructor(...t){super(...t),this.active=!1,this.narrow=!1}}d.styles=(0,o.AH)(c||(c=l`div{padding:0 32px;display:flex;flex-direction:column;text-align:center;box-sizing:border-box;align-items:center;justify-content:center;width:100%;height:var(--header-height);cursor:pointer;position:relative;outline:0}:host(:not([narrow])) div{flex-direction:row;gap:var(--ha-space-2)}.name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}:host([active]){color:var(--primary-color)}:host(:not([narrow])[active]) div{border-bottom:2px solid var(--primary-color)}:host([narrow]){min-width:0;display:flex;justify-content:center;overflow:hidden}:host([narrow]) div{padding:0 4px}::slotted([slot=icon]){margin-bottom:var(--ha-space-1)}:host(:not([narrow])) ::slotted([slot=icon]){margin-bottom:0}div:focus-visible:before{position:absolute;display:block;content:"";inset:0;background-color:var(--secondary-text-color);opacity:.08}`)),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],d.prototype,"active",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],d.prototype,"narrow",void 0),(0,i.Cg)([(0,n.MZ)()],d.prototype,"name",void 0),d=(0,i.Cg)([(0,n.EM)("ha-tab")],d)},34127:function(t,e,a){a.a(t,async function(t,e){try{a(62953);var i=a(40445),o=a(52630),n=a(5124),r=a(67576),s=t([o]);o=(s.then?(await s)():s)[0];let c,l=t=>t;class d extends o.A{static get styles(){return[o.A.styles,(0,n.AH)(c||(c=l`:host{--wa-tooltip-background-color:var(
--ha-tooltip-background-color,
var(--ha-color-surface-default)
);--wa-tooltip-content-color:var(
--ha-tooltip-text-color,
var(--primary-text-color)
);--wa-tooltip-font-family:var(
--ha-tooltip-font-family,
var(--ha-font-family-body)
);--wa-tooltip-font-size:var(
--ha-tooltip-font-size,
var(--ha-font-size-m)
);--wa-tooltip-font-weight:var(
--ha-tooltip-font-weight,
var(--ha-font-weight-medium)
);--wa-tooltip-line-height:var(
--ha-tooltip-line-height,
var(--ha-line-height-condensed)
);--wa-tooltip-padding:var(--ha-tooltip-padding, var(--ha-space-2));--wa-tooltip-border-radius:var(
--ha-tooltip-border-radius,
var(--ha-border-radius-md)
);--wa-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 0px);--wa-tooltip-border-width:0px;--wa-z-index-tooltip:1000}.tooltip::part(popup){animation-duration:var(--ha-tooltip-animation-duration, 0)}.body{box-shadow:var(--ha-tooltip-box-shadow,var(--ha-box-shadow-m))}`))]}constructor(...t){super(...t),this.showDelay=350,this.hideDelay=150}}(0,i.Cg)([(0,r.MZ)({attribute:"show-delay",type:Number})],d.prototype,"showDelay",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"hide-delay",type:Number})],d.prototype,"hideDelay",void 0),d=(0,i.Cg)([(0,r.EM)("ha-tooltip")],d),e()}catch(c){e(c)}})},10897:function(t,e,a){a.d(e,{C4:function(){return l},CK:function(){return c},FX:function(){return g},UC:function(){return p},_Z:function(){return y},bT:function(){return _},j4:function(){return v},sd:function(){return n},su:function(){return s},vc:function(){return b},w8:function(){return u},wv:function(){return h},y3:function(){return f},zS:function(){return r}});a(3362);var i=a(3931),o=a(82e3);const n=[1,2,3,4,6,8],r="web_rtc",s=(t,e,a)=>`${t}&width=${e}&height=${a}`,c=t=>t.attributes.access_token?`/api/camera_proxy_stream/${t.entity_id}?token=${t.attributes.access_token}`:void 0,l=async(t,e,a,o)=>{const n=await(0,i.U)("_cameraTmbUrl",9e3,d,t,e);return s(n,a,o)},d=async(t,e)=>{const a=await(0,o.e0)(t,`/api/camera_proxy/${e}`);return t.hassUrl(a.path)},h=async(t,e,a)=>{const i={type:"camera/stream",entity_id:e};a&&(i.format=a);const o=await t.callWS(i);return o.url=t.hassUrl(o.url),o},u=(t,e,a,i)=>t.connection.subscribeMessage(i,{type:"camera/webrtc/offer",entity_id:e,offer:a}),p=(t,e,a,i)=>t.callWS({type:"camera/webrtc/candidate",entity_id:e,session_id:a,candidate:i}),f=(t,e)=>t.callWS({type:"camera/get_prefs",entity_id:e}),g=(t,e,a)=>t.callWS(Object.assign({type:"camera/update_prefs",entity_id:e},a)),m="media-source://camera/",v=t=>t.startsWith(m),b=t=>t.substring(22),y=async(t,e)=>t.callWS({type:"camera/capabilities",entity_id:e}),_=async(t,e)=>t.callWS({type:"camera/webrtc/get_client_config",entity_id:e})},38279:function(t,e,a){a.d(e,{$2:function(){return i},VV:function(){return n},on:function(){return c},sx:function(){return r}});a(72712);var i=function(t){return t[t.TARGET_TEMPERATURE=1]="TARGET_TEMPERATURE",t[t.TARGET_TEMPERATURE_RANGE=2]="TARGET_TEMPERATURE_RANGE",t[t.TARGET_HUMIDITY=4]="TARGET_HUMIDITY",t[t.FAN_MODE=8]="FAN_MODE",t[t.PRESET_MODE=16]="PRESET_MODE",t[t.SWING_MODE=32]="SWING_MODE",t[t.AUX_HEAT=64]="AUX_HEAT",t[t.TURN_OFF=128]="TURN_OFF",t[t.TURN_ON=256]="TURN_ON",t[t.SWING_HORIZONTAL_MODE=512]="SWING_HORIZONTAL_MODE",t}({});const o=["auto","heat_cool","heat","cool","dry","fan_only","off"].reduce((t,e,a)=>(t[e]=a,t),{}),n=(t,e)=>o[t]-o[e],r={cooling:"cool",defrosting:"heat",drying:"dry",fan:"fan_only",heating:"heat",idle:"off",off:"off",preheating:"heat"},s={cool:"M20.79,13.95L18.46,14.57L16.46,13.44V10.56L18.46,9.43L20.79,10.05L21.31,8.12L19.54,7.65L20,5.88L18.07,5.36L17.45,7.69L15.45,8.82L13,7.38V5.12L14.71,3.41L13.29,2L12,3.29L10.71,2L9.29,3.41L11,5.12V7.38L8.5,8.82L6.5,7.69L5.92,5.36L4,5.88L4.47,7.65L2.7,8.12L3.22,10.05L5.55,9.43L7.55,10.56V13.45L5.55,14.58L3.22,13.96L2.7,15.89L4.47,16.36L4,18.12L5.93,18.64L6.55,16.31L8.55,15.18L11,16.62V18.88L9.29,20.59L10.71,22L12,20.71L13.29,22L14.7,20.59L13,18.88V16.62L15.5,15.17L17.5,16.3L18.12,18.63L20,18.12L19.53,16.35L21.3,15.88L20.79,13.95M9.5,10.56L12,9.11L14.5,10.56V13.44L12,14.89L9.5,13.44V10.56Z",dry:"M12,3.25C12,3.25 6,10 6,14C6,17.32 8.69,20 12,20A6,6 0 0,0 18,14C18,10 12,3.25 12,3.25M14.47,9.97L15.53,11.03L9.53,17.03L8.47,15.97M9.75,10A1.25,1.25 0 0,1 11,11.25A1.25,1.25 0 0,1 9.75,12.5A1.25,1.25 0 0,1 8.5,11.25A1.25,1.25 0 0,1 9.75,10M14.25,14.5A1.25,1.25 0 0,1 15.5,15.75A1.25,1.25 0 0,1 14.25,17A1.25,1.25 0 0,1 13,15.75A1.25,1.25 0 0,1 14.25,14.5Z",fan_only:"M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12.5,2C17,2 17.11,5.57 14.75,6.75C13.76,7.24 13.32,8.29 13.13,9.22C13.61,9.42 14.03,9.73 14.35,10.13C18.05,8.13 22.03,8.92 22.03,12.5C22.03,17 18.46,17.1 17.28,14.73C16.78,13.74 15.72,13.3 14.79,13.11C14.59,13.59 14.28,14 13.88,14.34C15.87,18.03 15.08,22 11.5,22C7,22 6.91,18.42 9.27,17.24C10.25,16.75 10.69,15.71 10.89,14.79C10.4,14.59 9.97,14.27 9.65,13.87C5.96,15.85 2,15.07 2,11.5C2,7 5.56,6.89 6.74,9.26C7.24,10.25 8.29,10.68 9.22,10.87C9.41,10.39 9.73,9.97 10.14,9.65C8.15,5.96 8.94,2 12.5,2Z",auto:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22C12.4 22 12.7 22 13.1 21.9L15.4 15.3L14.8 14.7C15.5 14 16 13 16 11.9C16 11.2 15.8 10.5 15.4 9.9L17.6 7.7C18.5 9 19 10.4 19 12H20C20.3 12 20.6 12.1 20.8 12.2C20.8 12.2 20.9 12.2 20.9 12.3C21.3 12.5 21.7 12.9 21.9 13.4C22 12.9 22 12.5 22 12C22 6.5 17.5 2 12 2M14 8.6C13.4 8.2 12.7 8 12 8C9.8 8 8 9.8 8 12C8 13.1 8.4 14.1 9.2 14.8L7.1 16.9C5.8 15.7 5 13.9 5 12C5 8.1 8.1 5 12 5C13.6 5 15 5.5 16.2 6.4L14 8.6M20 14H18L14.8 23H16.7L17.4 21H20.6L21.3 23H23.2L20 14M17.8 19.7L19 16L20.2 19.7H17.8Z",heat:"M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z",off:"M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13",heat_cool:"M12.92 1.58L11.18 2.58L12.39 4.67L11.8 6.85L9 7.6L7.38 6L7.42 3.59L5.43 3.59L5.43 5.42L3.59 5.42L3.6 7.42L6 7.42L7.65 9.03L6.9 11.82L4.68 12.4L2.59 11.2L1.59 12.93L3.17 13.84L2.26 15.42L4 16.42L5.19 14.33L7.42 13.75L7.92 14.26L9.32 12.86L8.78 12.32L9.53 9.54L12.32 8.78L12.85 9.32L14.26 7.91L13.73 7.37L14.32 5.19L16.41 4L15.41 2.25L13.83 3.16L12.92 1.58M20.72 4L4 20.72L5.27 22L10.16 17.11C10.63 17.43 11.15 17.68 11.71 17.83C14.38 18.55 17.12 16.96 17.83 14.29C18.22 12.86 17.93 11.36 17.11 10.16L22 5.27L20.72 4M18.74 9C19.18 9.63 19.53 10.38 19.75 11.19C19.97 12 20.03 12.81 19.96 13.61L22.65 10.41L18.74 9M19.32 15.95C19 16.67 18.5 17.35 17.93 17.94C17.34 18.53 16.66 19 15.96 19.34L20.05 20.06L19.32 15.95M9 18.71L10.41 22.66L13.59 19.95C12.81 20 12 19.97 11.19 19.76C10.36 19.54 9.62 19.17 9 18.71Z"},c=t=>s[t]||"M16.95,16.95L14.83,14.83C15.55,14.1 16,13.1 16,12C16,11.26 15.79,10.57 15.43,10L17.6,7.81C18.5,9 19,10.43 19,12C19,13.93 18.22,15.68 16.95,16.95M12,5C13.57,5 15,5.5 16.19,6.4L14,8.56C13.43,8.21 12.74,8 12,8A4,4 0 0,0 8,12C8,13.1 8.45,14.1 9.17,14.83L7.05,16.95C5.78,15.68 5,13.93 5,12A7,7 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"},700:function(t,e,a){a.d(e,{y:function(){return r}});const i=window;"customIconsets"in i||(i.customIconsets={});const o=i.customIconsets,n=window;"customIcons"in n||(n.customIcons={});const r=new Proxy(n.customIcons,{get:(t,e)=>{var a;return null!==(a=t[e])&&void 0!==a?a:o[e]?{getIcon:o[e]}:void 0}})},22675:function(t,e,a){a.d(e,{HV:function(){return n},Hh:function(){return o}});var i=a(23832);const o="unavailable",n="unknown",r=[o,n,"off"];(0,i.g)(r)},32250:function(t,e,a){a.d(e,{KD:function(){return i},NL:function(){return o},Rj:function(){return r},_o:function(){return s},ls:function(){return n}});a(44114),a(62953),a(29908);const i=(t,e)=>t.callWS(Object.assign({type:"config/floor_registry/create"},e)),o=(t,e,a)=>t.callWS(Object.assign({type:"config/floor_registry/update",floor_id:e},a)),n=(t,e)=>t.callWS({type:"config/floor_registry/delete",floor_id:e}),r=(t,e)=>t.callWS({type:"config/floor_registry/reorder",floor_ids:e}),s=t=>{const e={};for(const a of t)a.floor_id&&(a.floor_id in e||(e[a.floor_id]=[]),e[a.floor_id].push(a));return e}},68287:function(t,e,a){a.d(e,{z:function(){return o}});a(18111),a(61701),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);var i=a(71727);const o=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}},86531:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{$O:function(){return b},a$:function(){return w},cj:function(){return u},dG:function(){return v},gM:function(){return m},gd:function(){return f},k$:function(){return _},rc:function(){return x}});a(74423),a(3362),a(27495),a(25440),a(62953);var o=a(46190),n=a(71727),r=a(69093),s=a(22533),c=a(22675),l=a(25064),d=t([l]);l=(d.then?(await d)():d)[0];const h="ui.components.logbook.messages",u=["counter","proximity"],p={triggered_by_numeric_state_of:"numeric state of",triggered_by_state_of:"state of",triggered_by_event:"event",triggered_by_time_pattern:"time pattern",triggered_by_time:"time",triggered_by_homeassistant_stopping:"ioBroker stopping",triggered_by_homeassistant_starting:"ioBroker starting"},f=async(t,e,a)=>g(t,e,void 0,void 0,a),g=(t,e,a,i,o,n)=>{if((i||n)&&(!i||0===i.length)&&(!n||0===n.length))return Promise.resolve([]);const r={type:"logbook/get_events",start_time:e};return a&&(r.end_time=a),null!=i&&i.length&&(r.entity_ids=i),null!=n&&n.length&&(r.device_ids=n),o&&(r.context_id=o),t.callWS(r)},m=(t,e,a,i,o,n,r)=>{if((n||r)&&(!n||0===n.length)&&(!r||0===r.length))return Promise.reject("No entities or devices");const s={type:"logbook/event_stream",start_time:a,end_time:i};return null!=n&&n.length&&(s.entity_ids=n),null!=r&&r.length&&(s.device_ids=r),t.connection.subscribeMessage(t=>e(t,o),s)},v=(t,e)=>({entity_id:t.entity_id,state:e,attributes:{device_class:null==t?void 0:t.attributes.device_class,source_type:null==t?void 0:t.attributes.source_type,has_date:null==t?void 0:t.attributes.has_date,has_time:null==t?void 0:t.attributes.has_time,entity_picture_local:o.oL.has((0,n.m)(t.entity_id))||null==t?void 0:t.attributes.entity_picture_local,entity_picture:o.oL.has((0,n.m)(t.entity_id))||null==t?void 0:t.attributes.entity_picture}}),b=(t,e)=>{for(const a of Object.keys(p)){const i=p[a];if(e.startsWith(i))return e.replace(i,`${t(`ui.components.logbook.${a}`)}`)}return e},y={triggered_by_numeric_state_of:"numeric_state_of",triggered_by_state_of:"state_of",triggered_by_event:"event",triggered_by_time_pattern:"time_pattern",triggered_by_time:"time",triggered_by_homeassistant_stopping:"homeassistant_stopping",triggered_by_homeassistant_starting:"homeassistant_starting"},_=(t,e)=>{for(const a of Object.keys(p)){const i=p[a];if(e.startsWith(i)){const o=y[a];return e.replace(i,`${t(`ui.components.logbook.${o}`)}`)}}return e},w=(t,e,a,i,o)=>{switch(o){case"device_tracker":case"person":return"not_home"===a?e(`${h}.was_away`):"home"===a?e(`${h}.was_at_home`):e(`${h}.was_at_state`,{state:a});case"sun":return e("above_horizon"===a?`${h}.rose`:`${h}.set`);case"binary_sensor":{const o="on"===a,n="off"===a,r=i.attributes.device_class;if(r&&(o||n))return e(`${h}.${o?"detected_device_classes":"cleared_device_classes"}.${r}`,{device_class:(0,s.i)(e(`component.binary_sensor.entity_component.${r}.name`)||r,t.language)})||e(`${h}.${o?"detected_device_class":"cleared_device_class"}`,{device_class:(0,s.i)(e(`component.binary_sensor.entity_component.${r}.name`)||r,t.language)});break}case"cover":switch(a){case"open":return e(`${h}.was_opened`);case"opening":return e(`${h}.is_opening`);case"closing":return e(`${h}.is_closing`);case"closed":return e(`${h}.was_closed`)}break;case"event":return e(`${h}.detected_event_no_type`);case"lock":switch(a){case"unlocked":return e(`${h}.was_unlocked`);case"locking":return e(`${h}.is_locking`);case"unlocking":return e(`${h}.is_unlocking`);case"opening":return e(`${h}.is_opening`);case"open":return e(`${h}.is_opened`);case"locked":return e(`${h}.was_locked`);case"jammed":return e(`${h}.is_jammed`)}}return"on"===a?e(`${h}.turned_on`):"off"===a?e(`${h}.turned_off`):a===c.HV?e(`${h}.became_unknown`):a===c.Hh?e(`${h}.became_unavailable`):t.localize(`${h}.changed_to_state`,{state:i?t.formatEntityState(i,a):a})},x=(t,e=[])=>{const a=(0,r.t)(t);return!(u.includes(a)||"sensor"===a&&(0,l.Fp)(a,t,void 0,e))};i()}catch(h){i(h)}})},34884:function(t,e,a){a.d(e,{$4:function(){return d},C6:function(){return c},CB:function(){return s},Tx:function(){return r},ac:function(){return o},qL:function(){return u},tK:function(){return l},w$:function(){return h}});var i=a(91926);const o=["binary_sensor","button","configuration","device_tracker","event","image_processing","infrared","input_button","persistent_notification","person","radio_frequency","scene","schedule","script","sensor","sun","update","weather","zone"];let n;const r=(t,e)=>{n={config:t,areaId:e},(0,i.oo)("/config/scene/edit/new")},s=()=>{const t=n;return n=void 0,t},c=(t,e)=>t.callService("scene","turn_on",{entity_id:e}),l=(t,e)=>t.callService("scene","apply",{entities:e}),d=(t,e)=>t.callApi("GET",`config/scene/config/${e}`),h=(t,e,a)=>t.callApi("POST",`config/scene/config/${e}`,a),u=(t,e)=>t.callApi("DELETE",`config/scene/config/${e}`)},71606:function(t,e,a){a.d(e,{f:function(){return o},o:function(){return i}});a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);const i=new Set(["automation","script","scene","group"]),o=(t,e,a)=>t.callWS({type:"search/related",item_type:e,item_id:a})},42269:function(t,e,a){a.d(e,{p:function(){return o}});var i=a(1087);const o=(t,e)=>(0,i.r)(t,"hass-more-info",e)},81310:function(t,e,a){a.a(t,async function(t,e){try{a(62953);var i=a(40445),o=a(5124),n=a(67576),r=a(6412),s=a(26218),c=a(91926),l=a(90248),d=a(2054),h=a(14503),u=t([l,d]);[l,d]=u.then?(await u)():u;let p,f,g,m,v,b=t=>t;class y extends o.WF{render(){var t;return(0,o.qy)(p||(p=b` <div class="toolbar ${0}"> <div class="toolbar-content"> ${0} <div class="main-title"> <slot name="header">${0}</slot> </div> <slot name="toolbar-icon"></slot> </div> </div> <div class="${0}" @scroll="${0}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `),(0,r.H)({narrow:this.narrow}),this.mainPage||null!==(t=history.state)&&void 0!==t&&t.root?(0,o.qy)(f||(f=b` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):this.backPath?(0,o.qy)(g||(g=b` <ha-icon-button-arrow-prev href="${0}" .hass="${0}"></ha-icon-button-arrow-prev> `),this.backPath,this.hass):(0,o.qy)(m||(m=b` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._backTapped),this.header,(0,r.H)({content:!0,"ha-scrollbar":this.scrollable,"not-scrollable":!this.scrollable}),this._saveScrollPos)}_saveScrollPos(t){this._savedScrollPos=t.target.scrollTop}_backTapped(){this.backCallback?this.backCallback():(0,c.OE)()}static get styles(){return[h.dp,(0,o.AH)(v||(v=b`:host{display:block;height:100%;background-color:var(--primary-background-color);overflow:hidden;position:relative}:host([narrow]){width:100%;position:fixed}.toolbar{background-color:var(--app-header-background-color);padding-top:var(--safe-area-inset-top);padding-right:var(--safe-area-inset-right)}:host([narrow]) .toolbar{padding-left:var(--safe-area-inset-left)}.toolbar-content{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box;padding:8px 12px}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{display:flex;align-items:center;pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{margin-inline-start:var(--ha-space-6);line-height:var(--ha-line-height-normal);min-width:0;flex-grow:1;overflow-wrap:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.narrow .main-title{margin-inline-start:var(--ha-space-2)}.content{position:relative;width:calc(100% - var(--safe-area-inset-right,0px));height:calc(100% - 1px - var(--header-height,0px) - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));padding-bottom:var(--safe-area-inset-bottom,0px);margin-right:var(--safe-area-inset-right);overflow-y:auto;overflow:auto;-webkit-overflow-scrolling:touch}.content.not-scrollable{overflow:hidden;display:flex;flex-direction:column}:host([narrow]) .content{width:calc(100% - var(--safe-area-inset-left,0px) - var(--safe-area-inset-right,0px));margin-left:var(--safe-area-inset-left)}#fab{position:absolute;right:calc(16px + var(--safe-area-inset-right,0px));inset-inline-end:calc(16px + var(--safe-area-inset-right,0px));inset-inline-start:initial;bottom:calc(16px + var(--safe-area-inset-bottom,0px));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--ha-space-2);--ha-button-box-shadow:var(--ha-box-shadow-l)}:host([narrow]) #fab.tabs{bottom:calc(84px + var(--safe-area-inset-bottom,0px))}#fab[is-wide]{bottom:calc(24px + var(--safe-area-inset-bottom,0px));right:calc(24px + var(--safe-area-inset-right,0px));inset-inline-end:calc(24px + var(--safe-area-inset-right,0px));inset-inline-start:initial}`))]}constructor(...t){super(...t),this.mainPage=!1,this.narrow=!1,this.scrollable=!0}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)()],y.prototype,"header",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"main-page"})],y.prototype,"mainPage",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"back-path"})],y.prototype,"backPath",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"backCallback",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],y.prototype,"narrow",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],y.prototype,"scrollable",void 0),(0,i.Cg)([(0,s.a)(".content")],y.prototype,"_savedScrollPos",void 0),(0,i.Cg)([(0,n.Ls)({passive:!0})],y.prototype,"_saveScrollPos",null),y=(0,i.Cg)([(0,n.EM)("hass-subpage")],y),e()}catch(p){e(p)}})},40511:function(t,e,a){a.a(t,async function(t,e){try{a(18111),a(22489),a(20116),a(61701),a(3362),a(62953),a(3296),a(27208),a(48408),a(14603),a(47566),a(98721);var i=a(40445),o=a(5124),n=a(67576),r=a(6412),s=a(22786),c=a(63708),l=a(26218),d=a(76830),h=a(91926),u=a(90248),p=a(2054),f=(a(67094),a(43831),a(14503)),g=t([u,p]);[u,p]=g.then?(await g)():g;let m,v,b,y,_,w,x,$,C,k,A,M,H=t=>t;const L=t=>t.endsWith("/")&&t.length>1?t.slice(0,-1):t;class z extends o.WF{willUpdate(t){if(t.has("route")){const t=`${this.route.prefix}${this.route.path}`;this._activeTab=this.tabs.find(e=>this._isActiveTabPath(e.path,t))}super.willUpdate(t)}render(){var t;const e=this._getTabs(this.tabs,this._activeTab,this.hass.config.components,this.hass.language,this.hass.userData,this.narrow,this.localizeFunc||this.hass.localize);return(0,o.qy)(m||(m=H` <div class="toolbar ${0}"> <slot name="toolbar"> <div class="toolbar-content"> ${0} ${0} ${0} <div id="toolbar-icon"> <slot name="toolbar-icon"></slot> </div> </div> </slot> ${0} </div> <div class="container"> ${0} <div class="content ha-scrollbar" @scroll="${0}"> <slot></slot> ${0} </div> </div> <div id="fab"> <slot name="fab"></slot> </div> `),(0,r.H)({narrow:this.narrow}),this.mainPage||!this.backPath&&null!==(t=history.state)&&void 0!==t&&t.root?(0,o.qy)(v||(v=H` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):this.backPath?(0,o.qy)(b||(b=H` <ha-icon-button-arrow-prev .href="${0}" .hass="${0}"></ha-icon-button-arrow-prev> `),this.backPath,this.hass):(0,o.qy)(y||(y=H` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._backTapped),this.narrow||!this.showTabs?(0,o.qy)(_||(_=H`<div class="main-title"> <slot name="header">${0}</slot> </div>`),this.showTabs?"":e[0]):"",this.showTabs&&!this.narrow?(0,o.qy)(w||(w=H`<div id="tabbar">${0}</div>`),e):"",this.showTabs&&this.narrow?(0,o.qy)(x||(x=H`<div id="tabbar" class="bottom-bar">${0}</div>`),e):"",this.pane?(0,o.qy)($||($=H`<div class="pane"> <div class="shadow-container"></div> <div class="ha-scrollbar"> <slot name="pane"></slot> </div> </div>`)):o.s6,this._saveScrollPos,this.hasFab?(0,o.qy)(C||(C=H`<div class="fab-bottom-space"></div>`)):o.s6)}_saveScrollPos(t){this._savedScrollPos=t.target.scrollTop}focusContentScroller(){this._content&&(this._content.style.outline="none",this._content.focus({preventScroll:!0}))}_backTapped(){this.backCallback?this.backCallback():(0,h.OE)()}_isActiveTabPath(t,e){try{const a=new URL(t,window.location.origin),i=new URL(e,window.location.origin),o=L(a.pathname),n=L(i.pathname);return!(n!==o&&!n.startsWith(`${o}/`))}catch(a){return e===t||e.startsWith(`${t}/`)}}async _tabClicked(t){const e=(0,d.d)(t);e&&await(0,h.oo)(e,{replace:!0})}static get styles(){return[f.dp,(0,o.AH)(k||(k=H`:host{display:block;height:100%;background-color:var(--primary-background-color)}:host([narrow]){width:100%;position:fixed}.container{display:flex;height:calc(100% - var(--header-height,0px) - var(--safe-area-inset-top,0px))}ha-menu-button{margin-right:24px;margin-inline-end:24px;margin-inline-start:initial}.toolbar{font-size:var(--ha-font-size-xl);height:calc(var(--header-height,0px) + var(--safe-area-inset-top,0px));padding-top:var(--safe-area-inset-top);padding-right:var(--safe-area-inset-right);background-color:var(--sidebar-background-color);font-weight:var(--ha-font-weight-normal);border-bottom:1px solid var(--divider-color);box-sizing:border-box}:host([narrow]) .toolbar{padding-left:var(--safe-area-inset-left)}.toolbar-content{padding:8px 12px;display:flex;align-items:center;height:100%;box-sizing:border-box}:host([narrow]) .toolbar-content{padding:4px}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}.bottom-bar a{width:25%}#tabbar{display:flex;font-size:var(--ha-font-size-m);overflow:hidden}#tabbar>a{overflow:hidden;max-width:45%}#tabbar.bottom-bar{position:absolute;bottom:0;left:0;padding:0 16px;box-sizing:border-box;background-color:var(--sidebar-background-color);border-top:1px solid var(--divider-color);justify-content:space-around;z-index:2;font-size:var(--ha-font-size-s);width:100%;padding-bottom:var(--safe-area-inset-bottom)}#tabbar:not(.bottom-bar){flex:1;justify-content:center}:host(:not([narrow])) #toolbar-icon{min-width:40px}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{display:flex;flex-shrink:0;pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{min-width:0;flex:1;max-height:var(--header-height);line-height:var(--ha-line-height-normal);color:var(--sidebar-text-color);margin-inline-start:var(--main-title-margin,var(--ha-space-6))}.narrow .main-title{margin-inline-start:var(--main-title-margin,var(--ha-space-2))}.content{position:relative;width:100%;margin-right:var(--safe-area-inset-right);margin-inline-end:var(--safe-area-inset-right);overflow:auto;-webkit-overflow-scrolling:touch}:host([narrow]) .content{margin-left:var(--safe-area-inset-left);margin-inline-start:var(--safe-area-inset-left)}:host([narrow][show-tabs]) .content{margin-bottom:calc(var(--header-height,0px) + var(--safe-area-inset-bottom,0px))}.content .fab-bottom-space{height:calc(64px + var(--safe-area-inset-bottom,0px))}:host([narrow][show-tabs]) .content .fab-bottom-space{height:calc(80px + var(--safe-area-inset-bottom,0px))}#fab{position:fixed;right:calc(16px + var(--safe-area-inset-right,0px));inset-inline-end:calc(16px + var(--safe-area-inset-right));inset-inline-start:initial;bottom:calc(16px + var(--safe-area-inset-bottom,0px));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--ha-space-2);--ha-button-box-shadow:var(--ha-box-shadow-l)}:host([narrow][show-tabs]) #fab{bottom:calc(84px + var(--safe-area-inset-bottom,0px))}#fab[is-wide]{bottom:24px;right:24px;inset-inline-end:24px;inset-inline-start:initial}.pane{border-right:1px solid var(--divider-color);border-inline-end:1px solid var(--divider-color);border-inline-start:initial;box-sizing:border-box;display:flex;flex:0 0 var(--sidepane-width,250px);width:var(--sidepane-width,250px);flex-direction:column;position:relative}.pane .ha-scrollbar{flex:1}`))]}constructor(...t){super(...t),this.mainPage=!1,this.narrow=!1,this.isWide=!1,this.pane=!1,this.hasFab=!1,this.showTabs=!1,this._getTabs=(0,s.A)((t,e,a,i,n,r,s)=>{const l=t.filter(t=>(0,c.fW)(this.hass,t));if(l.length<2){if(this.showTabs=!1,1===l.length){const t=l[0];return[t.translationKey?s(t.translationKey):t.name]}return[""]}return this.showTabs=!0,l.map(t=>(0,o.qy)(A||(A=H` <a href="${0}" @click="${0}"> <ha-tab .active="${0}" .narrow="${0}" .name="${0}"> ${0} </ha-tab> </a> `),t.path,this._tabClicked,t.path===(null==e?void 0:e.path),this.narrow,t.translationKey?s(t.translationKey):t.name,t.iconPath?(0,o.qy)(M||(M=H`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),t.iconPath):""))})}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],z.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],z.prototype,"localizeFunc",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"back-path"})],z.prototype,"backPath",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],z.prototype,"backCallback",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"main-page"})],z.prototype,"mainPage",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],z.prototype,"route",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],z.prototype,"tabs",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],z.prototype,"narrow",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"is-wide"})],z.prototype,"isWide",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],z.prototype,"pane",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"has-fab"})],z.prototype,"hasFab",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"show-tabs",reflect:!0})],z.prototype,"showTabs",void 0),(0,i.Cg)([(0,n.wk)()],z.prototype,"_activeTab",void 0),(0,i.Cg)([(0,n.P)(".content")],z.prototype,"_content",void 0),(0,i.Cg)([(0,l.a)(".content")],z.prototype,"_savedScrollPos",void 0),(0,i.Cg)([(0,n.Ls)({passive:!0})],z.prototype,"_saveScrollPos",null),z=(0,i.Cg)([(0,n.EM)("hass-tabs-subpage")],z),e()}catch(m){e(m)}})},54706:function(t,e,a){a.d(e,{E:function(){return n}});a(74423),a(18111),a(13579),a(3362),a(62953);var i=a(40445),o=a(67576);const n=t=>{class e extends t{connectedCallback(){super.connectedCallback(),this._checkSubscribed()}disconnectedCallback(){if(super.disconnectedCallback(),this.__unsubs){for(;this.__unsubs.length;){const t=this.__unsubs.pop();t instanceof Promise?t.then(t=>t()):t()}this.__unsubs=void 0}}updated(t){if(super.updated(t),t.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const e of t.keys())if(this.hassSubscribeRequiredHostProps.includes(e))return void this._checkSubscribed()}hassSubscribe(){return[]}_checkSubscribed(){var t;void 0!==this.__unsubs||!this.isConnected||void 0===this.hass||null!==(t=this.hassSubscribeRequiredHostProps)&&void 0!==t&&t.some(t=>void 0===this[t])||(this.__unsubs=this.hassSubscribe())}}return(0,i.Cg)([(0,o.MZ)({attribute:!1})],e.prototype,"hass",void 0),e}},49717:function(t,e,a){a.a(t,async function(t,e){try{a(74423),a(44114),a(26910),a(18111),a(22489),a(20116),a(7588),a(61701),a(45367),a(92731),a(3362),a(62953);var i=a(40445),o=a(35211),n=a(5124),r=a(67576),s=a(63672),c=a(22786),l=a(36312),d=a(37981),h=a(71727),u=a(28978),p=a(91926),f=a(52220),g=a(80880),m=a(5911),v=a(12587),b=a(18350),y=(a(76776),a(29823)),_=(a(70947),a(26300)),w=(a(43661),a(8630),a(67094),a(34127)),x=a(53641),$=a(22792),C=a(58594),k=a(59241),A=a(93758),M=a(71606),H=a(41250),L=a(65063),z=a(42269),V=a(28794),T=a(81310),Z=a(54706),I=a(14503),E=a(24367),j=a(89434),S=a(13541),D=a(34023),F=t([b,y,_,w,V,T,j]);[b,y,_,w,V,T,j]=F.then?(await F)():F;let P,O,q,R,U,W,N,B,G,J,K,Y,X,Q,tt,et,at,it,ot,nt,rt,st,ct,lt,dt,ht,ut,pt,ft,gt,mt,vt,bt=t=>t;const yt="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",_t="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",wt="M18 15V18H15V20H18V23H20V20H23V18H20V15H18M13.3 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5V13.3C20.4 13.1 19.7 13 19 13C17.9 13 16.8 13.3 15.9 13.9L14.5 12L11 16.5L8.5 13.5L5 18H13.1C13 18.3 13 18.7 13 19C13 19.7 13.1 20.4 13.3 21Z",xt="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",$t="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",Ct=[{value:"navigate-devices",path:"/config/devices/dashboard",icon:"M3 6H21V4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H7V18H3V6M13 12H9V13.78C8.39 14.33 8 15.11 8 16C8 16.89 8.39 17.67 9 18.22V20H13V18.22C13.61 17.67 14 16.88 14 16S13.61 14.33 13 13.78V12M11 17.5C10.17 17.5 9.5 16.83 9.5 16S10.17 14.5 11 14.5 12.5 15.17 12.5 16 11.83 17.5 11 17.5M22 8H16C15.5 8 15 8.5 15 9V19C15 19.5 15.5 20 16 20H22C22.5 20 23 19.5 23 19V9C23 8.5 22.5 8 22 8M21 18H17V10H21V18Z",countKey:"devices"},{value:"navigate-entities",path:"/config/entities",icon:"M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z",countKey:"entities"},{value:"navigate-helpers",path:"/config/helpers",icon:"M21.71 20.29L20.29 21.71A1 1 0 0 1 18.88 21.71L7 9.85A3.81 3.81 0 0 1 6 10A4 4 0 0 1 2.22 4.7L4.76 7.24L5.29 6.71L6.71 5.29L7.24 4.76L4.7 2.22A4 4 0 0 1 10 6A3.81 3.81 0 0 1 9.85 7L21.71 18.88A1 1 0 0 1 21.71 20.29M2.29 18.88A1 1 0 0 0 2.29 20.29L3.71 21.71A1 1 0 0 0 5.12 21.71L10.59 16.25L7.76 13.42M20 2L16 4V6L13.83 8.17L15.83 10.17L18 8H20L22 4Z",countKey:"helpers"},{value:"navigate-automations",path:"/config/automation/dashboard",icon:"M12,2A2,2 0 0,1 14,4C14,4.74 13.6,5.39 13,5.73V7H14A7,7 0 0,1 21,14H22A1,1 0 0,1 23,15V18A1,1 0 0,1 22,19H21V20A2,2 0 0,1 19,22H5A2,2 0 0,1 3,20V19H2A1,1 0 0,1 1,18V15A1,1 0 0,1 2,14H3A7,7 0 0,1 10,7H11V5.73C10.4,5.39 10,4.74 10,4A2,2 0 0,1 12,2M7.5,13A2.5,2.5 0 0,0 5,15.5A2.5,2.5 0 0,0 7.5,18A2.5,2.5 0 0,0 10,15.5A2.5,2.5 0 0,0 7.5,13M16.5,13A2.5,2.5 0 0,0 14,15.5A2.5,2.5 0 0,0 16.5,18A2.5,2.5 0 0,0 19,15.5A2.5,2.5 0 0,0 16.5,13Z",countKey:"automations"},{value:"navigate-scenes",path:"/config/scene/dashboard",icon:"M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z",countKey:"scenes"},{value:"navigate-scripts",path:"/config/script/dashboard",icon:"M17.8,20C17.4,21.2 16.3,22 15,22H5C3.3,22 2,20.7 2,19V18H5L14.2,18C14.6,19.2 15.7,20 17,20H17.8M19,2C20.7,2 22,3.3 22,5V6H20V5C20,4.4 19.6,4 19,4C18.4,4 18,4.4 18,5V18H17C16.4,18 16,17.6 16,17V16H5V5C5,3.3 6.3,2 8,2H19M8,6V8H15V6H8M8,10V12H14V10H8Z",countKey:"scripts"}];class kt extends((0,Z.E)(n.WF)){firstUpdated(t){super.firstUpdated(t),(0,D.E)(),(0,S.G)()}updated(t){super.updated(t),t.has("areaId")&&this._findRelated()}hassSubscribe(){return(0,l.x)(this.hass.config,"automation")?[(0,A.CO)(this.hass.connection,"automation","new_triggers_conditions",t=>{this._newTriggersConditions=t.enabled})]:[]}render(){var t,e,a,i,o,r,s,c,u,p,f,g;if(!this.hass.areas||!this.hass.devices||!this.hass.entities)return n.s6;const v=this.hass.areas[this.areaId];if(!v)return(0,n.qy)(P||(P=bt` <hass-error-screen .hass="${0}" .error="${0}"></hass-error-screen> `),this.hass,this.hass.localize("ui.panel.config.areas.area_not_found"));const b=this._memberships(this.areaId,Object.values(this.hass.devices),this._entityReg),{devices:y,entities:_}=b,w=this._getQuickLinkCounts(b,this._related);y&&(y.forEach(t=>{t.name=(0,d.T)(t,this.hass.localize,this.hass.states)}),(0,C.un)(y,this.hass.locale.language)),_&&(_.forEach(t=>{t.name=(0,k.jh)(this.hass,t)}),(0,k.n4)(_,this.hass.locale.language));const x=(0,m.$)(_,t=>(0,h.m)(t.entity_id));let $=[],A=[],M=[],H=[],L=[],z=[];var V,T,Z;(0,l.x)(this.hass.config,"automation")&&({groupedEntities:$,relatedEntities:H}=this._prepareEntities(x.automation,null===(V=this._related)||void 0===V?void 0:V.automation));(0,l.x)(this.hass.config,"scene")&&({groupedEntities:A,relatedEntities:L}=this._prepareEntities(x.scene,null===(T=this._related)||void 0===T?void 0:T.scene));(0,l.x)(this.hass.config,"script")&&({groupedEntities:M,relatedEntities:z}=this._prepareEntities(x.script,null===(Z=this._related)||void 0===Z?void 0:Z.script));const I=_.filter(t=>!["scene","script","automation"].includes((0,h.m)(t.entity_id)));return(0,n.qy)(O||(O=bt` <hass-subpage .hass="${0}" .narrow="${0}" .header="${0}"> <ha-dropdown slot="toolbar-icon" @wa-select="${0}"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> ${0} <wa-divider></wa-divider> <ha-dropdown-item value="edit" .data="${0}"> <ha-svg-icon slot="icon" .path="${0}"> </ha-svg-icon> ${0} </ha-dropdown-item> <ha-dropdown-item value="delete" variant="danger"> <ha-svg-icon slot="icon" .path="${0}"> </ha-svg-icon> ${0} </ha-dropdown-item> </ha-dropdown> <div class="container"> <div class="column"> ${0} ${0} <ha-card outlined .header="${0}">${0} </ha-card> <ha-card outlined .header="${0}"> ${0} </ha-card> </div> <div class="column"> ${0} ${0} ${0} </div> <div class="column"> ${0} </div> </div> </hass-subpage> `),this.hass,this.narrow,(0,n.qy)(q||(q=bt`${0}${0}`),v.icon?(0,n.qy)(R||(R=bt`<ha-icon .icon="${0}" style="margin-inline-end:8px"></ha-icon>`),v.icon):n.s6,v.name),this._handleMenuAction,this.hass.localize("ui.common.menu"),_t,Ct.map(t=>(0,n.qy)(U||(U=bt` <ha-dropdown-item value="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} <ha-icon-next slot="details"></ha-icon-next> </ha-dropdown-item> `),t.value,t.icon,this.hass.localize(`ui.panel.config.areas.quick_links.${t.countKey}`,{count:w[t.countKey]}))),v,xt,this.hass.localize("ui.panel.config.areas.edit_settings"),yt,this.hass.localize("ui.panel.config.areas.editor.delete"),v.picture?(0,n.qy)(W||(W=bt`<div class="img-container"> <img alt="${0}" src="${0}"> <ha-icon-button .path="${0}" .entry="${0}" @click="${0}" .label="${0}" class="img-edit-btn"></ha-icon-button> </div>`),v.name,v.picture,xt,v,this._showSettings,this.hass.localize("ui.panel.config.areas.edit_settings")):n.s6,v.picture&&!this._newTriggersConditions?n.s6:(0,n.qy)(N||(N=bt`<div class="action-buttons"> ${0} ${0} </div>`),v.picture?n.s6:(0,n.qy)(B||(B=bt`<ha-button appearance="filled" .entry="${0}" @click="${0}"> <ha-svg-icon .path="${0}" slot="start"></ha-svg-icon> ${0} </ha-button>`),v,this._showSettings,wt,this.hass.localize("ui.panel.config.areas.add_picture")),this._newTriggersConditions?(0,n.qy)(G||(G=bt`<ha-button appearance="filled" variant="brand" @click="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> ${0} </ha-button>`),this._showAddToDialog,$t,this.hass.localize("ui.dialogs.more_info_control.add_to.item")):n.s6),this.hass.localize("ui.panel.config.devices.caption"),y.length?(0,n.qy)(J||(J=bt`<ha-list> ${0} </ha-list>`),y.map(t=>(0,n.qy)(K||(K=bt` <a href="/config/devices/device/${0}"> <ha-list-item hasMeta> <span>${0}</span> <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> </a> `),t.id,t.name))):(0,n.qy)(Y||(Y=bt` <div class="no-entries"> ${0} </div> `),this.hass.localize("ui.panel.config.devices.no_devices")),this.hass.localize("ui.panel.config.areas.editor.linked_entities_caption"),I.length?(0,n.qy)(X||(X=bt`<ha-list> ${0}</ha-list>`),I.map(t=>(0,n.qy)(Q||(Q=bt` <ha-list-item @click="${0}" .entity="${0}" hasMeta> <span>${0}</span> <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> `),this._openEntity,t,t.name))):(0,n.qy)(tt||(tt=bt` <div class="no-entries"> ${0} </div> `),this.hass.localize("ui.panel.config.areas.editor.no_linked_entities")),(0,l.x)(this.hass.config,"automation")?(0,n.qy)(et||(et=bt` <ha-card outlined .header="${0}"> ${0} ${0} ${0} </ha-card> `),this.hass.localize("ui.panel.config.devices.automation.automations_heading"),null!==(t=$)&&void 0!==t&&t.length?(0,n.qy)(at||(at=bt`<h3> ${0}: </h3> <ha-list> ${0}</ha-list>`),this.hass.localize("ui.panel.config.areas.assigned_to_area"),$.map(t=>this._renderAutomation(t.name,t.entity))):"",null!==(e=H)&&void 0!==e&&e.length?(0,n.qy)(it||(it=bt`<h3> ${0}: </h3> <ha-list> ${0}</ha-list>`),this.hass.localize("ui.panel.config.areas.targeting_area"),H.map(t=>this._renderAutomation(t.name,t.entity))):"",null!==(a=$)&&void 0!==a&&a.length||null!==(i=H)&&void 0!==i&&i.length?"":(0,n.qy)(ot||(ot=bt` <div class="no-entries"> ${0} </div> `),this.hass.localize("ui.panel.config.devices.automation.no_automations"))):"",(0,l.x)(this.hass.config,"scene")?(0,n.qy)(nt||(nt=bt` <ha-card outlined .header="${0}"> ${0} ${0} ${0} </ha-card> `),this.hass.localize("ui.panel.config.devices.scene.scenes_heading"),null!==(o=A)&&void 0!==o&&o.length?(0,n.qy)(rt||(rt=bt`<h3> ${0}: </h3> <ha-list> ${0}</ha-list>`),this.hass.localize("ui.panel.config.areas.assigned_to_area"),A.map(t=>this._renderScene(t.name,t.entity))):"",null!==(r=L)&&void 0!==r&&r.length?(0,n.qy)(st||(st=bt`<h3> ${0}: </h3> <ha-list> ${0}</ha-list>`),this.hass.localize("ui.panel.config.areas.targeting_area"),L.map(t=>this._renderScene(t.name,t.entity))):"",null!==(s=A)&&void 0!==s&&s.length||null!==(c=L)&&void 0!==c&&c.length?"":(0,n.qy)(ct||(ct=bt` <div class="no-entries"> ${0} </div> `),this.hass.localize("ui.panel.config.devices.scene.no_scenes"))):"",(0,l.x)(this.hass.config,"script")?(0,n.qy)(lt||(lt=bt` <ha-card outlined .header="${0}"> ${0} ${0} ${0} </ha-card> `),this.hass.localize("ui.panel.config.devices.script.scripts_heading"),null!==(u=M)&&void 0!==u&&u.length?(0,n.qy)(dt||(dt=bt`<h3> ${0}: </h3> ${0}`),this.hass.localize("ui.panel.config.areas.assigned_to_area"),M.map(t=>this._renderScript(t.name,t.entity))):"",null!==(p=z)&&void 0!==p&&p.length?(0,n.qy)(ht||(ht=bt`<h3> ${0}: </h3> ${0}`),this.hass.localize("ui.panel.config.areas.targeting_area"),z.map(t=>this._renderScript(t.name,t.entity))):"",null!==(f=M)&&void 0!==f&&f.length||null!==(g=z)&&void 0!==g&&g.length?"":(0,n.qy)(ut||(ut=bt` <div class="no-entries"> ${0} </div> `),this.hass.localize("ui.panel.config.devices.script.no_scripts"))):"",(0,l.x)(this.hass.config,"logbook")?(0,n.qy)(pt||(pt=bt` <ha-card outlined .header="${0}"> <ha-logbook .hass="${0}" .time="${0}" .entityIds="${0}" .deviceIds="${0}" virtualize narrow no-icon></ha-logbook> </ha-card> `),this.hass.localize("panel.logbook"),this.hass,this._logbookTime,this._allEntities(b),this._allDeviceIds(b.devices)):"")}_prepareEntities(t,e){const a=[],i=[];return null!=t&&t.length&&(t.forEach(t=>{const e=this.hass.states[t.entity_id];e&&a.push({name:(0,u.u)(e),entity:e})}),a.sort((t,e)=>(0,f.SH)(t.name,e.name,this.hass.locale.language))),null!=e&&e.length&&(e.forEach(t=>{const e=this.hass.states[t];e&&i.push({name:e?(0,u.u)(e):"",entity:e})}),i.sort((t,e)=>(0,f.SH)(t.name,e.name,this.hass.locale.language))),{groupedEntities:a,relatedEntities:i}}_renderScene(t,e){return(0,n.qy)(ft||(ft=bt`<ha-tooltip .for="scene-${0}" .distance="${0}" .disabled="${0}"> ${0} </ha-tooltip> <a .id="scene-${0}" href="${0}"> <ha-list-item .disabled="${0}" hasMeta> <span>${0}</span> <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> </a> `),(0,g.Y)(e.entity_id),-4,!!e.attributes.id,this.hass.localize("ui.panel.config.devices.cant_edit"),(0,g.Y)(e.entity_id),(0,s.J)(e.attributes.id?`/config/scene/edit/${e.attributes.id}`:void 0),!e.attributes.id,t)}_renderAutomation(t,e){return(0,n.qy)(gt||(gt=bt`<a id="automation-${0}" href="${0}"> <ha-list-item .disabled="${0}" hasMeta> <span>${0}</span> <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> </a> <ha-tooltip for="automation-${0}" .disabled="${0}" .distance="${0}">${0} </ha-tooltip>`),(0,g.Y)(e.entity_id),(0,s.J)(e.attributes.id?`/config/automation/edit/${encodeURIComponent(e.attributes.id)}`:void 0),!e.attributes.id,t,(0,g.Y)(e.entity_id),!!e.attributes.id,-4,this.hass.localize("ui.panel.config.devices.cant_edit"))}_renderScript(t,e){const a=this._entityReg.find(t=>t.entity_id===e.entity_id);let i=`/config/script/show/${e.entity_id}`;return a&&(i=`/config/script/edit/${a.unique_id}`),(0,n.qy)(mt||(mt=bt`<a href="${0}"> <ha-list-item hasMeta> <span>${0}</span> <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> </a>`),i,t)}async _findRelated(){this._related=await(0,M.f)(this.hass,"area",this.areaId)}_showAddToDialog(){const t=this.hass.areas[this.areaId];if(!t)return;const e=(0,H.cJ)(this._areaEntityIds,this._entityReg,this.hass.states);(0,S.P)(this,{areaId:t.area_id,entityIds:e,canCreateScene:(0,l.x)(this.hass.config,"scene")&&e.length>0})}get _areaEntityIds(){const t=this._memberships(this.areaId,Object.values(this.hass.devices),this._entityReg);return this._allEntities(t)}_handleMenuAction(t){var e,a;const i=null===(e=t.detail)||void 0===e||null===(e=e.item)||void 0===e?void 0:e.value,o=null===(a=t.detail)||void 0===a||null===(a=a.item)||void 0===a?void 0:a.data,n=Ct.find(t=>t.value===i);if(n)(0,p.oo)(`${n.path}?historyBack=1&area=${this.areaId}`);else switch(i){case"edit":this._openDialog(o);break;case"delete":this._deleteConfirm()}}_showSettings(t){this._openDialog(t.currentTarget.entry)}_openEntity(t){(0,z.p)(this,{entityId:t.currentTarget.entity.entity_id})}_openDialog(t){(0,D.J)(this,{entry:t,updateEntry:async e=>(0,x.gs)(this.hass,t.area_id,e)})}async _deleteConfirm(){const t=this.hass.areas[this.areaId];(0,L.dk)(this,{title:this.hass.localize("ui.panel.config.areas.delete.confirmation_title",{name:t.name}),text:this.hass.localize("ui.panel.config.areas.delete.confirmation_text"),dismissText:this.hass.localize("ui.common.cancel"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0,confirm:async()=>{await(0,x.uG)(this.hass,t.area_id),(0,v.m)(()=>(0,p.OE)("/config"))}})}static get styles(){return[I.RF,(0,n.AH)(vt||(vt=bt`h3{margin:0;padding:0 16px;font-weight:var(--ha-font-weight-medium);color:var(--secondary-text-color)}.action-buttons{display:flex;gap:var(--ha-space-2);flex-wrap:wrap;justify-content:space-around}img{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));width:100%}.container{display:flex;flex-wrap:wrap;margin:auto;max-width:1000px;margin-top:32px;margin-bottom:32px}.column{padding:8px;box-sizing:border-box;width:33%;flex-grow:1}.fullwidth{padding:8px;width:100%}.column>:not(:first-child){margin-top:16px}:host([narrow]) .column{width:100%}:host([narrow]) .container{margin-top:0}a{text-decoration:none;color:var(--primary-text-color)}ha-card>a:first-child{display:block}ha-card>:first-child{margin-top:-16px}.img-container{position:relative}.img-edit-btn{position:absolute;top:4px;right:4px;inset-inline-end:4px;inset-inline-start:initial;display:none}.img-container:hover .img-edit-btn{display:block}.img-edit-btn::before{content:"";position:absolute;width:100%;height:100%;background-color:var(--card-background-color);opacity:.5;border-radius:var(--ha-border-radius-circle)}ha-logbook{height:400px}:host([narrow]) ha-logbook{height:235px;overflow:auto}.no-entries{text-align:center;padding:16px;color:var(--secondary-text-color)}`))]}constructor(...t){super(...t),this.narrow=!1,this.isWide=!1,this._entityReg=[],this._newTriggersConditions=!1,this._logbookTime={recent:86400},this._memberships=(0,c.A)((t,e,a)=>{const i=new Map;for(const r of e)r.area_id===t&&i.set(r.id,r);const o=[],n=[];for(const r of a)r.area_id?r.area_id===t&&o.push(r):r.device_id&&i.has(r.device_id)&&n.push(r);return{devices:Array.from(i.values()),entities:o,indirectEntities:n}}),this._allDeviceIds=(0,c.A)(t=>t.map(t=>t.id)),this._allEntities=(0,c.A)(t=>t.entities.map(t=>t.entity_id).concat(t.indirectEntities.map(t=>t.entity_id))),this._getQuickLinkCounts=(0,c.A)((t,e)=>{var a,i,o,n,r,s,c,l,d;const u=this._allEntities(t),p=null!==(a=null==e?void 0:e.entity)&&void 0!==a?a:u;return{devices:null!==(i=null==e||null===(o=e.device)||void 0===o?void 0:o.length)&&void 0!==i?i:t.devices.length,entities:p.length,helpers:p.filter(t=>(0,E.z)((0,h.m)(t))).length,automations:null!==(n=null==e||null===(r=e.automation)||void 0===r?void 0:r.length)&&void 0!==n?n:0,scenes:null!==(s=null==e||null===(c=e.scene)||void 0===c?void 0:c.length)&&void 0!==s?s:0,scripts:null!==(l=null==e||null===(d=e.script)||void 0===d?void 0:d.length)&&void 0!==l?l:0}})}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],kt.prototype,"hass",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],kt.prototype,"areaId",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],kt.prototype,"narrow",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"is-wide",type:Boolean})],kt.prototype,"isWide",void 0),(0,i.Cg)([(0,r.wk)(),(0,o.Fg)({context:$.ih,subscribe:!0})],kt.prototype,"_entityReg",void 0),(0,i.Cg)([(0,r.wk)()],kt.prototype,"_related",void 0),(0,i.Cg)([(0,r.wk)()],kt.prototype,"_newTriggersConditions",void 0),kt=(0,i.Cg)([(0,r.EM)("ha-config-area-page")],kt),e()}catch(P){e(P)}})},12057:function(t,e,a){a.a(t,async function(t,e){try{a(18111),a(22489),a(7588),a(61701),a(45367),a(92731),a(3362),a(27495),a(62953),a(48408),a(14603),a(47566),a(98721);var i=a(40445),o=(a(68825),a(5124)),n=a(67576),r=a(89784),s=a(22786),c=a(66639),l=a(8185),d=a(18350),h=a(29823),u=(a(70947),a(18198),a(26300)),p=(a(85938),a(67094),a(53641)),f=a(32250),g=a(65063),m=a(40511),v=a(81619),b=a(25635),y=a(34023),_=a(68219),w=a(27986),x=t([d,h,u,m,l]);[d,h,u,m,l]=x.then?(await x)():x;let $,C,k,A,M,H,L,z=t=>t;const V="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",T="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",Z="M10,5V10H9V5H5V13H9V12H10V17H9V14H5V19H12V17H13V19H19V17H21V21H3V3H21V15H19V10H13V15H12V9H19V5H10Z",I="M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,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,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z",E="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",j="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",S="M12.5 7C12.5 5.89 13.39 5 14.5 5H18C19.1 5 20 5.9 20 7V9.16C18.84 9.57 18 10.67 18 11.97V14H12.5V7M6 11.96V14H11.5V7C11.5 5.89 10.61 5 9.5 5H6C4.9 5 4 5.9 4 7V9.15C5.16 9.56 6 10.67 6 11.96M20.66 10.03C19.68 10.19 19 11.12 19 12.12V15H5V12C5 10.9 4.11 10 3 10S1 10.9 1 12V17C1 18.1 1.9 19 3 19V21H5V19H19V21H21V19C22.1 19 23 18.1 23 17V12C23 10.79 21.91 9.82 20.66 10.03Z",D="M18 21L14 17H17V7H14L18 3L22 7H19V17H22M2 19V17H12V19M2 13V11H9V13M2 7V5H6V7H2Z",F="__unassigned__",P={sort:!0,delay:500,delayOnTouchOnly:!0};class O extends o.WF{willUpdate(t){if(super.willUpdate(t),t.has("hass")){const e=t.get("hass");this.hass.areas===(null==e?void 0:e.areas)&&this.hass.floors===(null==e?void 0:e.floors)||this._blockHierarchyUpdate||this._computeHierarchy()}}_computeHierarchy(){this._hierarchy=(0,c.cs)(Object.values(this.hass.floors),Object.values(this.hass.areas))}render(){if(!this._hierarchy)return o.s6;const t=this._processAreasStats(this.hass.areas,this.hass.devices,this.hass.entities);return(0,o.qy)($||($=z` <hass-tabs-subpage .hass="${0}" .narrow="${0}" .isWide="${0}" .backPath="${0}" .tabs="${0}" .route="${0}" has-fab> <ha-icon-button slot="toolbar-icon" .label="${0}" .path="${0}" @click="${0}"></ha-icon-button> <div class="container"> <div class="floors"> ${0} </div> ${0} </div> <ha-dropdown slot="fab" @wa-select="${0}"> <ha-button slot="trigger" id="fab" size="large"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> ${0} </ha-button> <ha-dropdown-item value="create_floor"> <ha-svg-icon .path="${0}" slot="icon"></ha-svg-icon> ${0} </ha-dropdown-item> <ha-dropdown-item value="create_area"> <ha-svg-icon .path="${0}" slot="icon"></ha-svg-icon> ${0} </ha-dropdown-item> </ha-dropdown> </hass-tabs-subpage> `),this.hass,this.narrow,this.isWide,this._searchParms.has("historyBack")?void 0:"/config",b.configSections.areas,this.route,this.hass.localize("ui.common.help"),I,this._showHelp,this._hierarchy.floors.map(({areas:e,id:a})=>{const i=this.hass.floors[a];return i?(0,o.qy)(C||(C=z` <div class="floor"> <div class="header"> <h2> <ha-floor-icon .floor="${0}"></ha-floor-icon> ${0} </h2> <div class="actions"> <ha-dropdown .floor="${0}" @wa-select="${0}"> <ha-icon-button slot="trigger" .path="${0}" .label="${0}"></ha-icon-button> <ha-dropdown-item value="reorder"><ha-svg-icon .path="${0}" slot="icon"></ha-svg-icon>${0}</ha-dropdown-item> <wa-divider></wa-divider> <ha-dropdown-item value="edit"><ha-svg-icon .path="${0}" slot="icon"></ha-svg-icon>${0}</ha-dropdown-item> <ha-dropdown-item value="delete" variant="danger"><ha-svg-icon .path="${0}" slot="icon"></ha-svg-icon>${0}</ha-dropdown-item> </ha-dropdown> </div> </div> <ha-sortable handle-selector="a" draggable-selector="a" @item-added="${0}" @item-moved="${0}" group="areas" .options="${0}" .floor="${0}"> <div class="areas"> ${0} </div> </ha-sortable> </div> `),i,i.name,i,this._handleFloorAction,T,this.hass.localize("ui.common.menu"),D,this.hass.localize("ui.panel.config.areas.picker.reorder"),E,this.hass.localize("ui.panel.config.areas.picker.floor.edit_floor"),V,this.hass.localize("ui.panel.config.areas.picker.floor.delete_floor"),this._areaAdded,this._areaMoved,P,i.floor_id,e.map(e=>{const a=this.hass.areas[e];if(!a)return o.s6;const i=t.get(a.area_id);return this._renderArea(a,i)})):o.s6}),this._hierarchy.areas.length?(0,o.qy)(k||(k=z` <div class="floor"> <div class="header"> <h2> ${0} </h2> <div class="actions"> <ha-dropdown @wa-select="${0}"> <ha-icon-button slot="trigger" .path="${0}" .label="${0}"></ha-icon-button> <ha-dropdown-item value="reorder"><ha-svg-icon .path="${0}" slot="icon"></ha-svg-icon>${0}</ha-dropdown-item> </ha-dropdown> </div> </div> <ha-sortable handle-selector="a" draggable-selector="a" @item-added="${0}" @item-moved="${0}" group="areas" .options="${0}" .floor="${0}"> <div class="areas"> ${0} </div> </ha-sortable> </div> `),this.hass.localize(this._hierarchy.floors.length?"ui.panel.config.areas.picker.other_areas":"ui.panel.config.areas.picker.header"),this._handleUnassignedAreasAction,T,this.hass.localize("ui.common.menu"),D,this.hass.localize("ui.panel.config.areas.picker.reorder"),this._areaAdded,this._areaMoved,P,F,this._hierarchy.areas.map(e=>{const a=this.hass.areas[e];if(!a)return o.s6;const i=t.get(a.area_id);return this._renderArea(a,i)})):o.s6,this._handleCreateAction,j,this.hass.localize("ui.common.add"),Z,this.hass.localize("ui.panel.config.areas.picker.create_floor"),S,this.hass.localize("ui.panel.config.areas.picker.create_area"))}_renderArea(t,e){return(0,o.qy)(A||(A=z` <a href="${0}" .sortableData="${0}"> <ha-card outlined> <div style="${0}" class="picture ${0}"> ${0} </div> <div class="card-header"> ${0} <ha-icon-button .area="${0}" .path="${0}" @click="${0}"></ha-icon-button> </div> <div class="card-content"> <div> ${0} </div> </div> </ha-card> </a> `),`/config/areas/area/${t.area_id}`,t,(0,r.W)({backgroundImage:t.picture?`url(${t.picture})`:void 0}),t.picture?"":"placeholder",!t.picture&&t.icon?(0,o.qy)(M||(M=z`<ha-icon .icon="${0}"></ha-icon>`),t.icon):"",t.name,t,E,this._openAreaDetails,(0,l.c)(this.hass.locale,[(null==e?void 0:e.devices)&&this.hass.localize("ui.panel.config.integrations.config_entry.devices",{count:e.devices}),(null==e?void 0:e.services)&&this.hass.localize("ui.panel.config.integrations.config_entry.services",{count:e.services}),(null==e?void 0:e.entities)&&this.hass.localize("ui.panel.config.integrations.config_entry.entities",{count:e.entities})].filter(t=>Boolean(t))))}firstUpdated(t){super.firstUpdated(t),(0,y.E)()}_openAreaDetails(t){t.preventDefault();const e=t.currentTarget.area;(0,y.J)(this,{entry:e,updateEntry:async t=>(0,p.gs)(this.hass,e.area_id,t)})}async _areaMoved(t){if(t.stopPropagation(),!this.hass||!this._hierarchy)return;const{floor:e}=t.currentTarget,{oldIndex:a,newIndex:i}=t.detail,o=e===F?null:e,n=(t,e,a)=>{const i=[...t],[o]=i.splice(e,1);return i.splice(a,0,o),i};this._hierarchy=Object.assign(Object.assign({},this._hierarchy),{},{floors:this._hierarchy.floors.map(t=>t.id===o?Object.assign(Object.assign({},t),{},{areas:n(t.areas,a,i)}):t),areas:null===o?n(this._hierarchy.areas,a,i):this._hierarchy.areas});const r=(0,c.Xz)(this._hierarchy);try{await(0,p.WT)(this.hass,r)}catch(s){(0,v.P)(this,{message:this.hass.localize("ui.panel.config.areas.picker.area_move_failed")}),this._computeHierarchy()}}async _areaAdded(t){if(t.stopPropagation(),!this.hass||!this._hierarchy)return;const{floor:e}=t.currentTarget,{data:a,index:i}=t.detail,o=e===F?null:e,n=(t,e,a)=>{const i=[...t];return i.splice(a,0,e),i};this._hierarchy=Object.assign(Object.assign({},this._hierarchy),{},{floors:this._hierarchy.floors.map(t=>t.id===o?Object.assign(Object.assign({},t),{},{areas:n(t.areas,a.area_id,i)}):Object.assign(Object.assign({},t),{},{areas:t.areas.filter(t=>t!==a.area_id)})),areas:null===o?n(this._hierarchy.areas,a.area_id,i):this._hierarchy.areas.filter(t=>t!==a.area_id)});const r=(0,c.Xz)(this._hierarchy);this._blockHierarchyUpdateFor(500);try{await(0,p.WT)(this.hass,r),await(0,p.gs)(this.hass,a.area_id,{floor_id:o})}catch(s){(0,v.P)(this,{message:this.hass.localize("ui.panel.config.areas.picker.area_move_failed")}),this._computeHierarchy()}}_blockHierarchyUpdateFor(t){this._blockHierarchyUpdate=!0,this._blockHierarchyUpdateTimeout&&window.clearTimeout(this._blockHierarchyUpdateTimeout),this._blockHierarchyUpdateTimeout=window.setTimeout(()=>{this._blockHierarchyUpdate=!1},t)}_handleFloorAction(t){const e=t.currentTarget.floor;switch(t.detail.item.value){case"reorder":this._showReorderDialog();break;case"edit":this._editFloor(e);break;case"delete":this._deleteFloor(e)}}_handleUnassignedAreasAction(t){"reorder"===t.detail.item.value&&this._showReorderDialog()}_handleCreateAction(t){const e=t.detail.item.value;"create_floor"===e?this._createFloor():"create_area"===e&&this._createArea()}_createFloor(){this._openFloorDialog()}_editFloor(t){this._openFloorDialog(t)}async _deleteFloor(t){await(0,g.dk)(this,{title:this.hass.localize("ui.panel.config.areas.picker.floor.confirm_delete"),text:this.hass.localize("ui.panel.config.areas.picker.floor.confirm_delete_text"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0})&&await(0,f.ls)(this.hass,t.floor_id)}_createArea(){this._openAreaDialog()}_showReorderDialog(){(0,_.B)(this,{})}_showHelp(){(0,g.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.areas.caption"),text:(0,o.qy)(H||(H=z` ${0} <p> ${0} </p> <a href="/config/integrations/dashboard"> ${0} </a> `),this.hass.localize("ui.panel.config.areas.picker.introduction"),this.hass.localize("ui.panel.config.areas.picker.introduction2"),this.hass.localize("ui.panel.config.areas.picker.integrations_page"))})}_openAreaDialog(t){(0,y.J)(this,{entry:t,createEntry:async t=>(0,p.L3)(this.hass,t)})}_openFloorDialog(t){(0,w.k)(this,{entry:t,createEntry:async(t,e)=>{const a=await(0,f.KD)(this.hass,t);e.forEach(t=>{(0,p.gs)(this.hass,t,{floor_id:a.floor_id})})},updateEntry:async(e,a,i)=>{const o=await(0,f.NL)(this.hass,t.floor_id,e);a.forEach(t=>{(0,p.gs)(this.hass,t,{floor_id:o.floor_id})}),i.forEach(t=>{(0,p.gs)(this.hass,t,{floor_id:null})})}})}constructor(...t){super(...t),this.isWide=!1,this.narrow=!1,this._searchParms=new URLSearchParams(window.location.search),this._blockHierarchyUpdate=!1,this._processAreasStats=(0,s.A)((t,e,a)=>{const i=new Map;return Object.values(t).forEach(t=>{i.set(t.area_id,(t=>{let i=0,o=0,n=0;for(const a of Object.values(e))a.area_id===t.area_id&&("service"===a.entry_type?o++:i++);for(const e of Object.values(a))e.area_id===t.area_id&&n++;return{devices:i,services:o,entities:n}})(t))}),i})}}O.styles=(0,o.AH)(L||(L=z`.container{padding:8px 16px 16px;margin:0 auto 64px auto}.header{display:flex;align-items:center;justify-content:space-between;color:var(--secondary-text-color);padding-inline-start:8px}.header h2{font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-medium);margin-top:28px}.header ha-icon{margin-inline-end:8px}.header .actions{display:flex;align-items:center}.areas{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));grid-gap:16px 16px;max-width:2000px;margin-bottom:16px}.areas>*{max-width:500px}.handle{cursor:move;cursor:grab}ha-card{overflow:hidden}a{text-decoration:none}h1{padding-bottom:0}.picture{height:150px;width:100%;background-size:cover;background-position:center;position:relative}.placeholder{display:flex;align-items:center;justify-content:center;--mdc-icon-size:48px}.picture.placeholder::before{position:absolute;content:"";width:100%;height:100%;background-color:var(--sidebar-selected-icon-color);opacity:.12}.card-content{min-height:16px;color:var(--secondary-text-color)}.card-header{display:flex;justify-content:space-between;align-items:center;overflow-wrap:anywhere}`)),(0,i.Cg)([(0,n.MZ)({attribute:!1})],O.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"is-wide",type:Boolean})],O.prototype,"isWide",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],O.prototype,"narrow",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],O.prototype,"route",void 0),(0,i.Cg)([(0,n.wk)()],O.prototype,"_hierarchy",void 0),O=(0,i.Cg)([(0,n.EM)("ha-config-areas-dashboard")],O),e()}catch($){e($)}})},84344:function(t,e,a){a.a(t,async function(t,i){try{a.r(e);a(62953);var o=a(40445),n=a(67576),r=a(324),s=a(49717),c=a(12057),l=t([s,c]);[s,c]=l.then?(await l)():l;class d extends r.a{updatePageEl(t){t.hass=this.hass,"area"===this._currentPage&&(t.areaId=this.routeTail.path.substr(1)),t.narrow=this.narrow,t.isWide=this.isWide,t.route=this.routeTail}constructor(...t){super(...t),this.narrow=!1,this.isWide=!1,this.routerOptions={defaultPage:"dashboard",routes:{dashboard:{tag:"ha-config-areas-dashboard",cache:!0},area:{tag:"ha-config-area-page"}}}}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],d.prototype,"narrow",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"is-wide",type:Boolean})],d.prototype,"isWide",void 0),d=(0,o.Cg)([(0,n.EM)("ha-config-areas")],d),i()}catch(d){i(d)}})},13541:function(t,e,a){a.d(e,{G:function(){return o},P:function(){return n}});a(3362),a(62953);var i=a(1087);const o=()=>Promise.all([a.e(52815),a.e(23554)]).then(a.bind(a,80825)),n=(t,e)=>{(0,i.r)(t,"show-dialog",{dialogTag:"dialog-area-add-to",dialogImport:o,dialogParams:e})}},68219:function(t,e,a){a.d(e,{B:function(){return n}});a(3362),a(62953);var i=a(1087);const o=()=>Promise.all([a.e(68e3),a.e(6660)]).then(a.bind(a,54607)),n=(t,e)=>{(0,i.r)(t,"show-dialog",{dialogTag:"dialog-areas-floors-order",dialogImport:o,dialogParams:e})}},27986:function(t,e,a){a.d(e,{k:function(){return n}});a(3362),a(62953);var i=a(1087);const o=()=>Promise.all([a.e(32450),a.e(7305),a.e(92769),a.e(3283),a.e(8158),a.e(62574),a.e(26092),a.e(39005),a.e(61617)]).then(a.bind(a,91622)),n=(t,e)=>{(0,i.r)(t,"show-dialog",{dialogTag:"dialog-floor-registry-detail",dialogImport:o,dialogParams:e})}},24367:function(t,e,a){a.d(e,{L:function(){return o},z:function(){return n}});var i=a(23832);const o=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],n=(0,i.g)(o)},86030:function(t,e,a){a.d(e,{B:function(){return i},a:function(){return o}});a(72712),a(94490),a(18111),a(18237),a(42762),a(62953);function i(t){return Array.isArray(t)?t.reverse().reduce((t,e)=>`var(${e}${t?`, ${t}`:""})`,void 0):`var(${t})`}function o(t,e){if(Array.isArray(t))for(const a of t){const t=o(a,e);if(t)return t}else if(t.endsWith("-color"))return e.getPropertyValue(t).trim()||void 0}},53580:function(t,e,a){a.d(e,{mdiHomeAssistant:function(){return i}});const i="m12.151 1.5882c-.3262 0-.6523.1291-.8996.3867l-8.3848 8.7354c-.0619.0644-.1223.1368-.1807.2154-.0588.0789-.1151.1638-.1688.2534-.2593.4325-.4552.9749-.5232 1.4555-.0026.018-.0076.0369-.0094.0548-.0121.0987-.0184.1944-.0184.2857v8.0124a1.2731 1.2731 0 001.2731 1.2731h7.8313l-3.4484-3.593a1.7399 1.7399 0 111.0803-1.125l2.6847 2.7972v-10.248a1.7399 1.7399 0 111.5276-0v7.187l2.6702-2.782a1.7399 1.7399 0 111.0566 1.1505l-3.7269 3.8831v2.7299h8.174a1.2471 1.2471 0 001.2471-1.2471v-8.0375c0-.0912-.0059-.1868-.0184-.2855-.0603-.4935-.2636-1.0617-.5326-1.5105-.0537-.0896-.1101-.1745-.1684-.253-.0588-.079-.1191-.1513-.181-.2158l-8.3848-8.7363c-.2473-.2577-.5735-.3866-.8995-.3864"},69235:function(t,e,a){a.a(t,async function(t,e){try{a(3362),a(62953);"function"!=typeof window.ResizeObserver&&(window.ResizeObserver=(await a.e(71055).then(a.bind(a,52370))).default),e()}catch(i){e(i)}},1)},14503:function(t,e,a){a.d(e,{RF:function(){return u},dp:function(){return g},kO:function(){return f},nA:function(){return p},og:function(){return h}});var i=a(5124);let o,n,r,s,c,l,d=t=>t;const h=(0,i.AH)(o||(o=d`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`)),u=(0,i.AH)(n||(n=d`:host{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}.header{transition:box-shadow .2s linear,width var(--ha-animation-duration-normal) ease,padding-left var(--ha-animation-duration-normal) ease,padding-right var(--ha-animation-duration-normal) ease}@media (prefers-reduced-motion:reduce){.header{transition:box-shadow .2s linear}}h1{font-family:var(--ha-font-family-heading);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed)}h2{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-normal)}h3{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-l);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}${0} .card-actions a{text-decoration:none}.card-actions .warning{--mdc-theme-primary:var(--error-color)}.layout.horizontal,.layout.vertical{display:flex}.layout.inline{display:inline-flex}.layout.horizontal{flex-direction:row}.layout.vertical{flex-direction:column}.layout.wrap{flex-wrap:wrap}.layout.no-wrap{flex-wrap:nowrap}.layout.center,.layout.center-center{align-items:center}.layout.bottom{align-items:flex-end}.layout.center-center,.layout.center-justified{justify-content:center}.flex{flex:1;flex-basis:0.000000001px}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.layout.justified{justify-content:space-between}`),h),p=(0,i.AH)(r||(r=d`ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:400px;--mdc-dialog-max-width:600px;--mdc-dialog-max-width:min(600px, 95vw);--justify-action-buttons:space-between;--dialog-container-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--dialog-surface-padding:0px}ha-adaptive-dialog .form,ha-dialog .form{color:var(--primary-text-color)}a{color:var(--primary-color)}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:100vw;--mdc-dialog-max-width:100vw;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--dialog-container-padding:0px;--dialog-surface-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--vertical-align-dialog:flex-end}ha-dialog{--ha-dialog-border-radius:var(--ha-border-radius-square)}}.error{color:var(--error-color)}`)),f=(0,i.AH)(s||(s=d`ha-adaptive-dialog,ha-dialog{--vertical-align-dialog:flex-start;--dialog-surface-margin-top:var(--ha-space-10);--mdc-dialog-max-height:calc(
100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--mdc-dialog-max-height:calc(
100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--ha-dialog-max-height:calc(
100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--ha-dialog-max-height:calc(
100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
)}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--dialog-surface-margin-top:0px;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--ha-dialog-max-height:100vh;--ha-dialog-max-height:100svh}}`)),g=(0,i.AH)(c||(c=d`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{border-radius:var(--ha-border-radius-sm);background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`));(0,i.AH)(l||(l=d`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`))},85614:function(t,e,a){a.d(e,{i:function(){return i}});a(3362),a(62953);const i=async()=>{await Promise.all([a.e(38085),a.e(22309)]).then(a.bind(a,40772))}}}]);