iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 22 kB
JavaScript
export const __rspack_esm_id=6078;export const __rspack_esm_ids=[6078];export const __webpack_modules__={16629(e,t,a){a.d(t,{E7:()=>d,Mn:()=>o,P9:()=>l,lf:()=>u});a(18111),a(61701);var n=a(63004);const o=e=>{const t=e/100;return[Math.round(i(t)),Math.round(r(t)),Math.round(m(t))]},i=e=>{if(e<=66)return 255;const t=329.698727446*(e-60)**-.1332047592;return(0,n.q)(t,0,255)},r=e=>{let t;return t=e<=66?99.4708025861*Math.log(e)-161.1195681661:288.1221695283*(e-60)**-.0755148492,(0,n.q)(t,0,255)},m=e=>{if(e>=66)return 255;if(e<=19)return 0;const t=138.5177312231*Math.log(e-10)-305.0447927307;return(0,n.q)(t,0,255)},s=(e,t)=>{const a=Math.max(...e),n=Math.max(...t);let o;return o=0===n?0:a/n,t.map(e=>Math.round(e*o))},l=e=>0===e?1e6:Math.floor(1e6/e),c=e=>0===e?1e6:Math.floor(1e6/e),u=(e,t,a)=>{const[n,i,r,m,u]=e,d=c(t??2700),h=c(a??6500),g=d-h;let y;try{y=u/(m+u)}catch(e){y=.5}const _=h+y*g,p=_?l(_):0,[f,L,v]=o(p),w=Math.max(m,u)/255;return s([n,i,r,m,u],[n+f*w,i+L*w,r+v*w])},d=e=>{const[t,a,n,o]=e;return s([t,a,n,o],[t+o,a+o,n+o])}},80785(e,t,a){function n(e){return!!e&&(e instanceof Date&&!isNaN(e.valueOf()))}a.d(t,{A:()=>n})},380(e,t,a){a.d(t,{D:()=>m,P:()=>r});a(74423);var n=a(67932),o=a(46927),i=a(96029);const r=e=>e.first_weekday===o.zt.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(e.language).weekInfo.firstDay%7:(0,n.S)(e.language)%7:i.Z.includes(e.first_weekday)?i.Z.indexOf(e.first_weekday):1,m=e=>{const t=r(e);return i.Z[t]}},72487(e,t,a){a.a(e,async function(e,n){try{a.d(t,{CA:()=>T,Mi:()=>Z,Pm:()=>A,Wq:()=>L,Yq:()=>l,bl:()=>b,c2:()=>w,fr:()=>p,gu:()=>D,kz:()=>u,m9:()=>j,sl:()=>y,ur:()=>k,zB:()=>h});a(18111),a(20116);var o=a(74487),i=a(22786),r=a(46927),m=a(8480),s=e([o,m]);[o,m]=s.then?(await s)():s;(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",month:"long",day:"numeric",timeZone:(0,m.wj)(e.time_zone,t)}));const l=(e,t,a)=>c(t,a.time_zone).format(e),c=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",timeZone:(0,m.wj)(e.time_zone,t)})),u=(e,t,a)=>d(t,a.time_zone).format(e),d=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,m.wj)(e.time_zone,t)})),h=(e,t,a)=>{const n=g(t,a.time_zone);if(t.date_format===r.ow.language||t.date_format===r.ow.system)return n.format(e);const o=n.formatToParts(e),i=o.find(e=>"literal"===e.type)?.value,m=o.find(e=>"day"===e.type)?.value,s=o.find(e=>"month"===e.type)?.value,l=o.find(e=>"year"===e.type)?.value,c=o[o.length-1];let u="literal"===c?.type?c?.value:"";"bg"===t.language&&t.date_format===r.ow.YMD&&(u="");return{[r.ow.DMY]:`${m}${i}${s}${i}${l}${u}`,[r.ow.MDY]:`${s}${i}${m}${i}${l}${u}`,[r.ow.YMD]:`${l}${i}${s}${i}${m}${u}`}[t.date_format]},g=(0,i.A)((e,t)=>{const a=e.date_format===r.ow.system?void 0:e.language;return e.date_format===r.ow.language||(e.date_format,r.ow.system),new Intl.DateTimeFormat(a,{year:"numeric",month:"numeric",day:"numeric",timeZone:(0,m.wj)(e.time_zone,t)})}),y=(e,t,a)=>_(t,a.time_zone).format(e),_=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{day:"numeric",month:"short",timeZone:(0,m.wj)(e.time_zone,t)})),p=(e,t,a)=>f(t,a.time_zone).format(e),f=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",year:"numeric",timeZone:(0,m.wj)(e.time_zone,t)})),L=(e,t,a)=>v(t,a.time_zone).format(e),v=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",timeZone:(0,m.wj)(e.time_zone,t)})),w=(e,t,a)=>C(t,a.time_zone).format(e),C=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"short",timeZone:(0,m.wj)(e.time_zone,t)})),A=(e,t,a)=>z(t,a.time_zone).format(e),z=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",timeZone:(0,m.wj)(e.time_zone,t)})),T=(e,t,a)=>M(t,a.time_zone).format(e),M=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",timeZone:(0,m.wj)(e.time_zone,t)})),D=(e,t,a)=>E(t,a.time_zone).format(e),E=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",timeZone:(0,m.wj)(e.time_zone,t)})),Z=(e,t,a)=>I(t,a.time_zone).format(e),I=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",month:"short",day:"numeric",timeZone:(0,m.wj)(e.time_zone,t)})),k=(e,t,a)=>F(t,a.time_zone).format(e),F=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",month:"short",day:"numeric",year:"numeric",timeZone:(0,m.wj)(e.time_zone,t)})),b=(e,t,a)=>{const n=(0,m.wj)(t.time_zone,a.time_zone);return new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",timeZone:n}).format(e)},j=(e,t,a,n)=>`${b(e,a,n)}/${b(t,a,n)}`;n()}catch(e){n(e)}})},95747(e,t,a){a.a(e,async function(e,n){try{a.d(t,{CL:()=>L,GH:()=>C,Rl:()=>h,ZS:()=>p,aQ:()=>y,r6:()=>u,yg:()=>v});var o=a(74487),i=a(22786),r=a(72487),m=a(30162),s=a(8480),l=a(69543),c=e([o,s,r,m]);[o,s,r,m]=c.then?(await c)():c;const u=(e,t,a)=>d(t,a.time_zone).format(e),d=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,l.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.J)(e)?"h12":"h23",timeZone:(0,s.wj)(e.time_zone,t)})),h=e=>g().format(e),g=(0,i.A)(()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})),y=(e,t,a)=>_(t,a.time_zone).format(e),_=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",hour:(0,l.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.J)(e)?"h12":"h23",timeZone:(0,s.wj)(e.time_zone,t)})),p=(e,t,a)=>f(t,a.time_zone).format(e),f=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"short",day:"numeric",hour:(0,l.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.J)(e)?"h12":"h23",timeZone:(0,s.wj)(e.time_zone,t)})),L=(e,t,a)=>(new Date).getFullYear()===e.getFullYear()?p(e,t,a):y(e,t,a),v=(e,t,a)=>w(t,a.time_zone).format(e),w=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,l.J)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,l.J)(e)?"h12":"h23",timeZone:(0,s.wj)(e.time_zone,t)})),C=(e,t,a)=>`${(0,r.zB)(e,t,a)}, ${(0,m.fU)(e,t,a)}`;n()}catch(e){n(e)}})},30162(e,t,a){a.a(e,async function(e,n){try{a.d(t,{LW:()=>y,Xs:()=>h,fU:()=>l,ie:()=>u});var o=a(74487),i=a(22786),r=a(8480),m=a(69543),s=e([o,r]);[o,r]=s.then?(await s)():s;const l=(e,t,a)=>c(t,a.time_zone).format(e),c=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,m.J)(e)?"h12":"h23",timeZone:(0,r.wj)(e.time_zone,t)})),u=(e,t,a)=>d(t,a.time_zone).format(e),d=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{hour:(0,m.J)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,m.J)(e)?"h12":"h23",timeZone:(0,r.wj)(e.time_zone,t)})),h=(e,t,a)=>g(t,a.time_zone).format(e),g=(0,i.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",hour:(0,m.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,m.J)(e)?"h12":"h23",timeZone:(0,r.wj)(e.time_zone,t)})),y=(e,t,a)=>_(t,a.time_zone).format(e),_=(0,i.A)((e,t)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,r.wj)(e.time_zone,t)}));n()}catch(e){n(e)}})},8480(e,t,a){a.a(e,async function(e,n){try{a.d(t,{fL:()=>c,n2:()=>u,wj:()=>d});var o=a(74487),i=a(29079),r=a(46927),m=e([o]);o=(m.then?(await m)():m)[0];const s=Intl.DateTimeFormat?.().resolvedOptions?.().timeZone,l=s&&("UTC"===s||"Etc/UTC"===s||s in i)?s:void 0,c=14881==a.j?void 0!==l:null,u=l??"UTC",d=(e,t)=>e===r.Wj.local&&l?u:t;n()}catch(e){n(e)}})},69543(e,t,a){a.d(t,{J:()=>i});a(74423);var n=a(22786),o=a(46927);const i=(0,n.A)(e=>{if(e.time_format===o.Hg.language||e.time_format===o.Hg.system){const t=e.time_format===o.Hg.language?e.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(t).includes("10")}return e.time_format===o.Hg.am_pm})},96029(e,t,a){a.d(t,{Tq:()=>r,Z:()=>o,ZV:()=>n,sj:()=>i});const n=["sun","mon","tue","wed","thu","fri","sat"],o=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],i={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"}},69093(e,t,a){a.d(t,{t:()=>o});var n=a(71727);const o=e=>(0,n.m)(e.entity_id)},4423(e,t,a){a.d(t,{B:()=>s,r:()=>m});a(44114),a(18111),a(13579),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var n=a(44537),o=a(71727),i=a(28455);const r=e=>{if(void 0!==e)return null===e?new Set([null]):new Set((0,n.e)(e))},m=(e,t)=>{const a=t.domain?new Set((0,n.e)(t.domain)):void 0,m=t.hidden_domains?new Set((0,n.e)(t.hidden_domains)):void 0,s=t.device_class?new Set((0,n.e)(t.device_class)):void 0,l=r(t.floor),c=r(t.area),u=r(t.device),d=t.entity_category?new Set((0,n.e)(t.entity_category)):void 0,h=t.label?new Set((0,n.e)(t.label)):void 0,g=t.hidden_platform?new Set((0,n.e)(t.hidden_platform)):void 0;return t=>{const n=e.states[t];if(!n)return!1;if(a||m){const e=(0,o.m)(t);if(a&&!a.has(e))return!1;if(m&&m.has(e))return!1}if(s){const e=n.attributes.device_class||"none";if(!s.has(e))return!1}const{area:r,floor:y,device:_,entity:p}=(0,i.ln)(n,e.entities,e.devices,e.areas,e.floors);if(p&&p.hidden)return!1;if(l){const e=y?.floor_id??null;if(!l.has(e))return!1}if(c){const e=r?.area_id??null;if(!c.has(e))return!1}if(u){const e=_?.id??null;if(!u.has(e))return!1}if(h){if(!p)return!1;if(!p.labels.some(e=>h.has(e)))return!1}if(d){const e=p?.entity_category||"none";if(!d.has(e))return!1}if(g){if(!p)return!1;if(p.platform&&g.has(p.platform))return!1}return!0}},s=(e,t)=>{const a=new Set,n=[];for(const o of t)for(const t of e)o(t)&&!a.has(t)&&(a.add(t),n.push(t));return n}},82286(e,t,a){a.d(t,{$:()=>n});const n=(e,t)=>o(e.attributes,t),o=(e,t)=>0!==(e.supported_features&t)},52943(e,t,a){a.d(t,{Z:()=>n});const n=e=>e.charAt(0).toUpperCase()+e.slice(1)},22682(e,t,a){a.d(t,{$:()=>r});const n="^\\d{4}-(0[1-9]|1[0-2])-([12]\\d|0[1-9]|3[01])",o=new RegExp(n+"$"),i=new RegExp(n),r=(e,t=!1)=>t?i.test(e):o.test(e)},38279(e,t,a){a.d(t,{$2:()=>n,VV:()=>i,on:()=>s,sx:()=>r});var n=function(e){return e[e.TARGET_TEMPERATURE=1]="TARGET_TEMPERATURE",e[e.TARGET_TEMPERATURE_RANGE=2]="TARGET_TEMPERATURE_RANGE",e[e.TARGET_HUMIDITY=4]="TARGET_HUMIDITY",e[e.FAN_MODE=8]="FAN_MODE",e[e.PRESET_MODE=16]="PRESET_MODE",e[e.SWING_MODE=32]="SWING_MODE",e[e.AUX_HEAT=64]="AUX_HEAT",e[e.TURN_OFF=128]="TURN_OFF",e[e.TURN_ON=256]="TURN_ON",e[e.SWING_HORIZONTAL_MODE=512]="SWING_HORIZONTAL_MODE",e}({});const o=["auto","heat_cool","heat","cool","dry","fan_only","off"].reduce((e,t,a)=>(e[t]=a,e),{}),i=(e,t)=>o[e]-o[t],r={cooling:"cool",defrosting:"heat",drying:"dry",fan:"fan_only",heating:"heat",idle:"off",off:"off",preheating:"heat"},m={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"},s=e=>m[e]||"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"},28949(e,t,a){a.d(t,{r:()=>i});a(44114),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);const n=["light","climate","security","media_players","maintenance","weather","energy"],o=new Set(n);function i(e){const t=[],a=new Set;for(const n of e||[]){if("summary"===n.type){if(!o.has(n.key))continue;if(a.has(n.key))continue;a.add(n.key)}t.push(n)}for(const e of n)a.has(e)||t.push({type:"summary",key:e});return t}},48441(e,t,a){a.d(t,{B:()=>n});const n=[{area:null,hidden_platform:["automation","script","hassio","backup","mobile_app","zone","person"],hidden_domains:["ai_task","automation","configurator","device_tracker","event","geo_location","notify","persistent_notification","script","sun","tag","todo","zone",...a(46190).gt]}]},8892(e,t,a){a.a(e,async function(e,n){try{a.r(t),a.d(t,{HomeOverviewViewStrategy:()=>f});a(44114),a(18111),a(22489),a(61701),a(13579);var o=a(62826),i=a(5124),r=a(22441),m=a(66639),s=a(36312),l=a(4423),c=a(18198),u=a(38114),d=a(28949),h=a(7723),g=a(8537),y=a(48441),_=e([g,u]);[g,u]=_.then?(await _)():_;const p=(e,t)=>{const a=t.areas[e],n=`areas-${e}`,o=[];return a?.temperature_entity_id&&o.push("temperature"),{type:"area",area:e,display_type:"compact",sensor_classes:o,tap_action:{action:"navigate",navigation_path:n},vertical:!0,grid_options:{rows:2,columns:4}}};class f extends i.mN{static async generate(e,t){const a=Object.values(t.areas),n=Object.values(t.floors),o=(0,m.cs)(n,a),i=o.floors.length+(o.areas.length?1:0),r=Object.keys(t.states),_=y.B.map(e=>(0,l.r)(t,e)),f=(0,l.B)(r,_),L=[];for(const e of o.floors){const a=e.id,n=e.areas,o=t.floors[a],r=[];for(const e of n)r.push(p(e,t));r.length&&L.push({type:"grid",column_span:3,cards:[{type:"heading",heading:i>1?o.name:t.localize("ui.panel.lovelace.strategy.home.areas"),heading_style:"title",icon:o.icon||(0,c.Dc)(o)},...r]})}if(o.areas.length>0||f.length>0){const e=[];for(const a of o.areas)e.push(p(a,t));f.length>0&&e.push({type:"tile",entity:"zone.home",vertical:!0,name:t.localize("ui.panel.lovelace.strategy.home.devices"),icon:"mdi:devices",hide_state:!0,tap_action:{action:"navigate",navigation_path:"other-devices"},grid_options:{rows:2,columns:4}});const a=0===o.areas.length,n=0===o.floors.length;let i;i=n&&a?void 0:n?t.localize("ui.panel.lovelace.strategy.home.areas"):a?t.localize("ui.panel.lovelace.strategy.home.devices"):t.localize("ui.panel.lovelace.strategy.home.other_areas"),L.push({type:"grid",column_span:3,cards:[...i?[{type:"heading",heading:i,heading_style:"title"}]:[],...e]})}const v=(e.favorite_entities||[]).filter(e=>void 0!==t.states[e]),w=Math.max(8,v.length),C={type:"heading",heading:t.localize("ui.panel.lovelace.strategy.home.favorites"),heading_style:"title",visibility:[h.r],grid_options:{rows:"auto"}};let A;e.hide_suggested_entities?v.length>0&&(A={type:"grid",column_span:3,cards:[C,...v.map(e=>({type:"tile",entity:e,state_content:["state","area_name"],show_entity_picture:!0}))]}):A={strategy:{type:"common-controls",limit:w,include_entities:v,hide_empty:!0,heading:C},column_span:3};const z=g.vV.media_players.map(e=>(0,l.r)(t,e)),T=g.vV.light.map(e=>(0,l.r)(t,e)),M=g.vV.climate.map(e=>(0,l.r)(t,e)),D=g.vV.security.map(e=>(0,l.r)(t,e)),E=g.vV.maintenance.map(e=>(0,l.r)(t,e)),Z=t.panels.light&&(0,l.B)(r,T).length>0,I=(0,l.B)(r,z).length>0,k=t.panels.climate&&(0,l.B)(r,M).length>0,F=t.panels.security&&(0,l.B)(r,D).length>0,b=t.panels.maintenance&&(0,l.B)(r,E).length>0,j=(0,l.r)(t,{domain:"weather",entity_category:"none"}),$=Object.keys(t.states).filter(j).sort()[0],R=(0,s.x)(t.config,"energy")?await(0,u.bs)(t).catch(()=>{}):void 0,O=t.panels.energy&&(R?.energy_sources.some(e=>"grid"===e.type&&!!e.stat_energy_from)??!1),B={light:()=>Z?{type:"home-summary",summary:"light",tap_action:{action:"navigate",navigation_path:"/light?historyBack=1"}}:void 0,climate:()=>k?{type:"home-summary",summary:"climate",tap_action:{action:"navigate",navigation_path:"/climate?historyBack=1"}}:void 0,security:()=>F?{type:"home-summary",summary:"security",tap_action:{action:"navigate",navigation_path:"/security?historyBack=1"}}:void 0,media_players:()=>I?{type:"home-summary",summary:"media_players",tap_action:{action:"navigate",navigation_path:"media-players"}}:void 0,maintenance:()=>b?{type:"home-summary",summary:"maintenance",tap_action:{action:"navigate",navigation_path:e.home_panel?"/maintenance?historyBack=1&backPath=/home":"/maintenance?historyBack=1"}}:void 0,weather:()=>$?{type:"tile",entity:$,name:t.localize("ui.panel.lovelace.strategy.home.summary_list.weather"),state_content:["temperature","state"]}:void 0,energy:()=>O?{type:"home-summary",summary:"energy",tap_action:{action:"navigate",navigation_path:e.home_panel?"/energy?historyBack=1&backPath=/home":"/energy?historyBack=1"}}:void 0},S=[{type:"repairs",hide_empty:!0,tap_action:{action:"navigate",navigation_path:"/config/repairs?historyBack=1"}},{type:"updates",hide_empty:!0,tap_action:{action:"navigate",navigation_path:"/config/updates?historyBack=1"}},{type:"discovered-devices",hide_empty:!0}];for(const t of(0,d.r)(e.shortcuts))if("summary"===t.type){if(t.hidden)continue;const e=B[t.key]?.();e&&S.push(e)}else S.push({type:"shortcut",label:t.label,icon:t.icon,color:t.color,tap_action:{action:"navigate",navigation_path:t.path}});const H=S.map(e=>({...e,grid_options:{columns:12}})),N=[...S.map(e=>({...e,grid_options:{columns:6}}))],U={type:"heading",heading:t.localize("ui.panel.lovelace.strategy.home.summaries"),heading_style:"title"},V=N.length>0?{type:"grid",column_span:3,visibility:[h.B],cards:[U,...N]}:void 0,x=H.length>0?{type:"grid",cards:[{...U,grid_options:{rows:"auto"}},...H]}:void 0;if(0===L.length)return{type:"panel",cards:[{type:"empty-state",icon:"mdi:home-assistant",icon_color:"primary",content_only:!0,title:t.localize("ui.panel.lovelace.strategy.home.welcome_title"),content:t.localize("ui.panel.lovelace.strategy.home.welcome_content"),...e.home_panel&&t.user?.is_admin?{buttons:[{icon:"mdi:plus",text:t.localize("ui.panel.lovelace.strategy.home.welcome_add_device"),appearance:"filled",variant:"brand",tap_action:{action:"fire-dom-event",home_panel:{type:"add_integration"}}},{icon:"mdi:home-edit",text:t.localize("ui.panel.lovelace.strategy.home.welcome_edit_areas"),appearance:"plain",variant:"brand",tap_action:{action:"navigate",navigation_path:"/config/areas/dashboard"}}]}:{}}]};return{type:"sections",max_columns:3,sections:[A,V,...L].filter(Boolean),...!e.hide_welcome_message&&{header:{layout:"responsive",card:{type:"markdown",text_only:!0,content:`## ${t.localize("ui.panel.lovelace.strategy.home.welcome_user",{user:"{{ user }}"})}`}}},...x&&{sidebar:{sections:[x],content_label:t.localize("ui.panel.lovelace.strategy.home.home"),sidebar_label:t.localize("ui.panel.lovelace.strategy.home.summaries"),visibility:[h.r]}}}}}f=(0,o.Cg)([(0,r.EM)("home-overview-view-strategy")],f),n()}catch(e){n(e)}})}};