diff --git a/info.md b/info.md index 9b9e046..47ec096 100644 --- a/info.md +++ b/info.md @@ -1,6 +1,10 @@ {% if installed %} ### Features +{% if version_installed.replace("v", "").replace(".","") | int < 10803 %} +- Fixed `State badges updating again thanks to @elupus` +{% endif %} + {% if version_installed.replace("v", "").replace(".","") | int < 10802 %} - Fixed `Entity icons not updating on state change` {% endif %} diff --git a/package-lock.json b/package-lock.json index 934ec57..ac5ed38 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "room-card", - "version": "1.08.02", + "version": "1.08.03", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "room-card", - "version": "1.08.02", + "version": "1.08.03", "license": "MIT", "dependencies": { "babel-jest": "^29.6.4", @@ -14,6 +14,7 @@ "jest-environment-jsdom": "^29.5.0", "jest-ts-auto-mock": "^2.1.0", "lit": "^3.1.0", + "minify-html-literals-loader": "^1.1.1", "ts-auto-mock": "3.5.0", "ttypescript": "^1.5.13", "yarn": "^1.22.18" @@ -2860,6 +2861,15 @@ "@babel/types": "^7.20.7" } }, + "node_modules/@types/clean-css": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@types/clean-css/-/clean-css-4.2.11.tgz", + "integrity": "sha512-Y8n81lQVTAfP2TOdtJJEsCoYl1AnOkqDqMvXb9/7pfgZZ7r8YrEyurrAvAoAjHOGXKRybay+5CsExqIH6liccw==", + "dependencies": { + "@types/node": "*", + "source-map": "^0.6.0" + } + }, "node_modules/@types/eslint": { "version": "8.44.4", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.4.tgz", @@ -2894,6 +2904,16 @@ "@types/node": "*" } }, + "node_modules/@types/html-minifier": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/@types/html-minifier/-/html-minifier-3.5.3.tgz", + "integrity": "sha512-j1P/4PcWVVCPEy5lofcHnQ6BtXz9tHGiFPWzqm7TtGuWZEfCHEP446HlkSNc9fQgNJaJZ6ewPtp2aaFla/Uerg==", + "dependencies": { + "@types/clean-css": "*", + "@types/relateurl": "*", + "@types/uglify-js": "*" + } + }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", @@ -2949,6 +2969,11 @@ "undici-types": "~5.25.1" } }, + "node_modules/@types/relateurl": { + "version": "0.2.33", + "resolved": "https://registry.npmjs.org/@types/relateurl/-/relateurl-0.2.33.tgz", + "integrity": "sha512-bTQCKsVbIdzLqZhLkF5fcJQreE4y1ro4DIyVrlDNSCJRRwHhB8Z+4zXXa8jN6eDvc2HbRsEYgbvrnGvi54EpSw==" + }, "node_modules/@types/semver": { "version": "7.5.3", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.3.tgz", @@ -2975,6 +3000,14 @@ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==" }, + "node_modules/@types/uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-Hm/T0kV3ywpJyMGNbsItdivRhYNCQQf1IIsYsXnoVPES4t+FMLyDe0/K+Ea7ahWtMtSNb22ZdY7MIyoD9rqARg==", + "dependencies": { + "source-map": "^0.6.1" + } + }, "node_modules/@types/yargs": { "version": "17.0.28", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.28.tgz", @@ -3996,6 +4029,15 @@ "node": ">=6" } }, + "node_modules/camel-case": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", + "integrity": "sha512-+MbKztAYHXPr1jNTSKQF52VpcFjwY5RkR7fxksV8Doo4KAYc5Fl4UJRgthBbTmEx8C54DqahhbLJkDwjI3PI/w==", + "dependencies": { + "no-case": "^2.2.0", + "upper-case": "^1.1.1" + } + }, "node_modules/camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -4074,6 +4116,17 @@ "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", "dev": true }, + "node_modules/clean-css": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.4.tgz", + "integrity": "sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==", + "dependencies": { + "source-map": "~0.6.0" + }, + "engines": { + "node": ">= 4.0" + } + }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -4198,8 +4251,7 @@ "node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, "node_modules/common-path-prefix": { "version": "3.0.0", @@ -5472,6 +5524,14 @@ "node": ">=4" } }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "bin": { + "he": "bin/he" + } + }, "node_modules/home-assistant-js-websocket": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/home-assistant-js-websocket/-/home-assistant-js-websocket-6.1.1.tgz", @@ -5494,6 +5554,26 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, + "node_modules/html-minifier": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-4.0.0.tgz", + "integrity": "sha512-aoGxanpFPLg7MkIl/DDFYtb0iWz7jMFGqFhvEDZga6/4QTjneiD8I/NXL1x5aaoCp7FSIT6h/OhykDdPsbtMig==", + "dependencies": { + "camel-case": "^3.0.0", + "clean-css": "^4.2.1", + "commander": "^2.19.0", + "he": "^1.2.0", + "param-case": "^2.1.1", + "relateurl": "^0.2.7", + "uglify-js": "^3.5.1" + }, + "bin": { + "html-minifier": "cli.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/http-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", @@ -7701,6 +7781,11 @@ "node": ">= 12.0.0" } }, + "node_modules/lower-case": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", + "integrity": "sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA==" + }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -7709,6 +7794,14 @@ "yallist": "^3.0.2" } }, + "node_modules/magic-string": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "dependencies": { + "sourcemap-codec": "^1.4.8" + } + }, "node_modules/make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -7824,6 +7917,26 @@ "node": ">=6" } }, + "node_modules/minify-html-literals": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/minify-html-literals/-/minify-html-literals-1.3.5.tgz", + "integrity": "sha512-p8T8ryePRR8FVfJZLVFmM53WY25FL0moCCTycUDuAu6rf9GMLwy0gNjXBGNin3Yun7Y+tIWd28axOf0t2EpAlQ==", + "dependencies": { + "@types/html-minifier": "^3.5.3", + "clean-css": "^4.2.1", + "html-minifier": "^4.0.0", + "magic-string": "^0.25.0", + "parse-literals": "^1.2.1" + } + }, + "node_modules/minify-html-literals-loader": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/minify-html-literals-loader/-/minify-html-literals-loader-1.1.1.tgz", + "integrity": "sha512-uetSI66d347Kwqrrs4JXIdTenvRpa35PBH2Lpb7t6iR3lOwd+fmXGP2xmPWOZKCf2AgXb9cYdbRjA19eabuQAg==", + "dependencies": { + "minify-html-literals": "^1.3.5" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -7858,6 +7971,14 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, + "node_modules/no-case": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", + "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", + "dependencies": { + "lower-case": "^1.1.1" + } + }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", @@ -8031,6 +8152,14 @@ "node": ">=6" } }, + "node_modules/param-case": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", + "integrity": "sha512-eQE845L6ot89sk2N8liD8HAuH4ca6Vvr7VWAWwt7+kvvG5aBcPmmphQ68JsEG2qa9n1TykS2DLeMt363AAH8/w==", + "dependencies": { + "no-case": "^2.2.0" + } + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -8061,6 +8190,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/parse-literals": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/parse-literals/-/parse-literals-1.2.1.tgz", + "integrity": "sha512-Ml0w104Ph2wwzuRdxrg9booVWsngXbB4bZ5T2z6WyF8b5oaNkUmBiDtahi34yUIpXD8Y13JjAK6UyIyApJ73RQ==", + "dependencies": { + "typescript": "^2.9.2 || ^3.0.0 || ^4.0.0" + } + }, "node_modules/parse5": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", @@ -8469,6 +8606,14 @@ "jsesc": "bin/jsesc" } }, + "node_modules/relateurl": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", + "integrity": "sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==", + "engines": { + "node": ">= 0.10" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -8781,7 +8926,6 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "devOptional": true, "engines": { "node": ">=0.10.0" } @@ -8796,6 +8940,12 @@ "source-map": "^0.6.0" } }, + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "deprecated": "Please use @jridgewell/sourcemap-codec instead" + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -9549,6 +9699,17 @@ "node": ">=4.2.0" } }, + "node_modules/uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/undici-types": { "version": "5.25.3", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", @@ -9631,6 +9792,11 @@ "browserslist": ">= 4.21.0" } }, + "node_modules/upper-case": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", + "integrity": "sha512-WRbjgmYzgXkCV7zNVpy5YgrHgbBv126rMALQQMrmzOVC4GM2waQ9x7xtm8VU+1yF2kWyPzI9zbZ48n4vSxwfSA==" + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", diff --git a/package.json b/package.json index d846787..9fac145 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "room-card", - "version": "1.08.02", + "version": "1.08.03", "description": "Show entities in Home Assistant's Lovelace UI", "keywords": [ "home-assistant", @@ -19,6 +19,7 @@ "jest-environment-jsdom": "^29.5.0", "jest-ts-auto-mock": "^2.1.0", "lit": "^3.1.0", + "minify-html-literals-loader": "^1.1.1", "ts-auto-mock": "3.5.0", "ttypescript": "^1.5.13", "yarn": "^1.22.18" diff --git a/room-card.js b/room-card.js index d4eea5f..8a65de6 100644 --- a/room-card.js +++ b/room-card.js @@ -1,128 +1,2 @@ /*! For license information please see room-card.js.LICENSE.txt */ -(()=>{"use strict";var t={197:(t,e,i)=>{i.r(e),i.d(e,{DEFAULT_DOMAIN_ICON:()=>X,DEFAULT_PANEL:()=>Z,DEFAULT_VIEW_ENTITY_ID:()=>st,DOMAINS_HIDE_MORE_INFO:()=>et,DOMAINS_MORE_INFO_NO_HISTORY:()=>it,DOMAINS_TOGGLE:()=>rt,DOMAINS_WITH_CARD:()=>Q,DOMAINS_WITH_MORE_INFO:()=>tt,NumberFormat:()=>n,STATES_OFF:()=>nt,TimeFormat:()=>r,UNIT_C:()=>ot,UNIT_F:()=>at,applyThemesOnElement:()=>U,computeCardSize:()=>R,computeDomain:()=>H,computeEntity:()=>L,computeRTL:()=>V,computeRTLDirection:()=>z,computeStateDisplay:()=>J,computeStateDomain:()=>B,createThing:()=>dt,debounce:()=>mt,domainIcon:()=>pt,evaluateFilter:()=>ft,fireEvent:()=>lt,fixedIcons:()=>ht,formatDate:()=>u,formatDateMonth:()=>y,formatDateMonthYear:()=>v,formatDateNumeric:()=>m,formatDateShort:()=>p,formatDateTime:()=>A,formatDateTimeNumeric:()=>O,formatDateTimeWithSeconds:()=>S,formatDateWeekday:()=>l,formatDateYear:()=>b,formatNumber:()=>K,formatTime:()=>k,formatTimeWeekday:()=>j,formatTimeWithSeconds:()=>D,forwardHaptic:()=>vt,getLovelace:()=>Ot,handleAction:()=>wt,handleActionConfig:()=>bt,handleClick:()=>$t,hasAction:()=>At,hasConfigOrEntityChanged:()=>Et,hasDoubleClick:()=>St,isNumericState:()=>q,navigate:()=>gt,numberFormatToLocale:()=>W,relativeTime:()=>M,round:()=>Y,stateIcon:()=>Nt,timerTimeRemaining:()=>P,toggleEntity:()=>_t,turnOnOffEntities:()=>Tt,turnOnOffEntity:()=>yt});var n,r,o,a=function(){return a=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0)return{value:Math.round(m),unit:"year"};var h=12*m+u.getMonth()-d.getMonth();if(Math.round(Math.abs(h))>0)return{value:Math.round(h),unit:"month"};var p=r/604800;return{value:Math.round(p),unit:"week"}}(t,i);return n?function(t){return new Intl.RelativeTimeFormat(t.language,{numeric:"auto"})}(e).format(r.value,r.unit):Intl.NumberFormat(e.language,{style:"unit",unit:r.unit,unitDisplay:"long"}).format(Math.abs(r.value))};function P(t){var e,i=3600*(e=t.attributes.remaining.split(":").map(Number))[0]+60*e[1]+e[2];if("active"===t.state){var n=(new Date).getTime(),r=new Date(t.last_changed).getTime();i=Math.max(i-(n-r)/1e3,0)}return i}function F(){return(F=Object.assign||function(t){for(var e=1;e-1?t.split(".")[1].length:0;i.minimumFractionDigits=n,i.maximumFractionDigits=n}return i},J=function(t,e,i,n){var r=void 0!==n?n:e.state;if("unknown"===r||"unavailable"===r)return t("state.default."+r);if(q(e)){if("monetary"===e.attributes.device_class)try{return K(r,i,{style:"currency",currency:e.attributes.unit_of_measurement})}catch(t){}return K(r,i)+(e.attributes.unit_of_measurement?" "+e.attributes.unit_of_measurement:"")}var o=B(e);if("input_datetime"===o){var a;if(void 0===n)return e.attributes.has_date&&e.attributes.has_time?(a=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day,e.attributes.hour,e.attributes.minute),A(a,i)):e.attributes.has_date?(a=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day),u(a,i)):e.attributes.has_time?((a=new Date).setHours(e.attributes.hour,e.attributes.minute),k(a,i)):e.state;try{var s=n.split(" ");if(2===s.length)return A(new Date(s.join("T")),i);if(1===s.length){if(n.includes("-"))return u(new Date(n+"T00:00"),i);if(n.includes(":")){var l=new Date;return k(new Date(l.toISOString().split("T")[0]+"T"+n),i)}}return n}catch(t){return n}}return"humidifier"===o&&"on"===r&&e.attributes.humidity?e.attributes.humidity+" %":"counter"===o||"number"===o||"input_number"===o?K(r,i):e.attributes.device_class&&t("component."+o+".state."+e.attributes.device_class+"."+r)||t("component."+o+".state._."+r)||r},X="mdi:bookmark",Z="lovelace",Q=["climate","cover","configurator","input_select","input_number","input_text","lock","media_player","scene","script","timer","vacuum","water_heater","weblink"],tt=["alarm_control_panel","automation","camera","climate","configurator","cover","fan","group","history_graph","input_datetime","light","lock","media_player","script","sun","updater","vacuum","water_heater","weather"],et=["input_number","input_select","input_text","scene","weblink"],it=["camera","configurator","history_graph","scene"],nt=["closed","locked","off"],rt=new Set(["fan","input_boolean","light","switch","group","automation"]),ot="°C",at="°F",st="group.default_view",lt=function(t,e,i,n){n=n||{},i=null==i?{}:i;var r=new Event(e,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return r.detail=i,t.dispatchEvent(r),r},ct=new Set(["call-service","divider","section","weblink","cast","select"]),ut={alert:"toggle",automation:"toggle",climate:"climate",cover:"cover",fan:"toggle",group:"group",input_boolean:"toggle",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",remote:"toggle",scene:"scene",script:"script",sensor:"sensor",timer:"timer",switch:"toggle",vacuum:"toggle",water_heater:"climate",input_datetime:"input-datetime"},dt=function(t,e){void 0===e&&(e=!1);var i=function(t,e){return n("hui-error-card",{type:"error",error:t,config:e})},n=function(t,e){var n=window.document.createElement(t);try{if(!n.setConfig)return;n.setConfig(e)}catch(n){return console.error(t,n),i(n.message,e)}return n};if(!t||"object"!=typeof t||!e&&!t.type)return i("No type defined",t);var r=t.type;if(r&&r.startsWith("custom:"))r=r.substr(7);else if(e)if(ct.has(r))r="hui-"+r+"-row";else{if(!t.entity)return i("Invalid config given.",t);var o=t.entity.split(".",1)[0];r="hui-"+(ut[o]||"text")+"-entity-row"}else r="hui-"+r+"-card";if(customElements.get(r))return n(r,t);var a=i("Custom element doesn't exist: "+t.type+".",t);a.style.display="None";var s=setTimeout((function(){a.style.display=""}),2e3);return customElements.whenDefined(t.type).then((function(){clearTimeout(s),lt(a,"ll-rebuild",{},a)})),a},mt=function(t,e,i){var n;return void 0===i&&(i=!1),function(){var r=[].slice.call(arguments),o=this,a=i&&!n;clearTimeout(n),n=setTimeout((function(){n=null,i||t.apply(o,r)}),e),a&&t.apply(o,r)}},ht={alert:"mdi:alert",automation:"mdi:playlist-play",calendar:"mdi:calendar",camera:"mdi:video",climate:"mdi:thermostat",configurator:"mdi:settings",conversation:"mdi:text-to-speech",device_tracker:"mdi:account",fan:"mdi:fan",group:"mdi:google-circles-communities",history_graph:"mdi:chart-line",homeassistant:"mdi:home-assistant",homekit:"mdi:home-automation",image_processing:"mdi:image-filter-frames",input_boolean:"mdi:drawing",input_datetime:"mdi:calendar-clock",input_number:"mdi:ray-vertex",input_select:"mdi:format-list-bulleted",input_text:"mdi:textbox",light:"mdi:lightbulb",mailbox:"mdi:mailbox",notify:"mdi:comment-alert",person:"mdi:account",plant:"mdi:flower",proximity:"mdi:apple-safari",remote:"mdi:remote",scene:"mdi:google-pages",script:"mdi:file-document",sensor:"mdi:eye",simple_alarm:"mdi:bell",sun:"mdi:white-balance-sunny",switch:"mdi:flash",timer:"mdi:timer",updater:"mdi:cloud-upload",vacuum:"mdi:robot-vacuum",water_heater:"mdi:thermometer",weblink:"mdi:open-in-new"};function pt(t,e){if(t in ht)return ht[t];switch(t){case"alarm_control_panel":switch(e){case"armed_home":return"mdi:bell-plus";case"armed_night":return"mdi:bell-sleep";case"disarmed":return"mdi:bell-outline";case"triggered":return"mdi:bell-ring";default:return"mdi:bell"}case"binary_sensor":return e&&"off"===e?"mdi:radiobox-blank":"mdi:checkbox-marked-circle";case"cover":return"closed"===e?"mdi:window-closed":"mdi:window-open";case"lock":return e&&"unlocked"===e?"mdi:lock-open":"mdi:lock";case"media_player":return e&&"off"!==e&&"idle"!==e?"mdi:cast-connected":"mdi:cast";case"zwave":switch(e){case"dead":return"mdi:emoticon-dead";case"sleeping":return"mdi:sleep";case"initializing":return"mdi:timer-sand";default:return"mdi:z-wave"}default:return console.warn("Unable to find icon for domain "+t+" ("+e+")"),"mdi:bookmark"}}var ft=function(t,e){var i=e.value||e,n=e.attribute?t.attributes[e.attribute]:t.state;switch(e.operator||"=="){case"==":return n===i;case"<=":return n<=i;case"<":return n=":return n>=i;case">":return n>i;case"!=":return n!==i;case"regex":return n.match(i);default:return!1}},vt=function(t){lt(window,"haptic",t)},gt=function(t,e,i){void 0===i&&(i=!1),i?history.replaceState(null,"",e):history.pushState(null,"",e),lt(window,"location-changed",{replace:i})},yt=function(t,e,i){void 0===i&&(i=!0);var n,r=H(e),o="group"===r?"homeassistant":r;switch(r){case"lock":n=i?"unlock":"lock";break;case"cover":n=i?"open_cover":"close_cover";break;default:n=i?"turn_on":"turn_off"}return t.callService(o,n,{entity_id:e})},_t=function(t,e){var i=nt.includes(t.states[e].state);return yt(t,e,i)},bt=function(t,e,i,n){if(n||(n={action:"more-info"}),!n.confirmation||n.confirmation.exemptions&&n.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||(vt("warning"),confirm(n.confirmation.text||"Are you sure you want to "+n.action+"?")))switch(n.action){case"more-info":(i.entity||i.camera_image)&<(t,"hass-more-info",{entityId:i.entity?i.entity:i.camera_image});break;case"navigate":n.navigation_path&>(0,n.navigation_path);break;case"url":n.url_path&&window.open(n.url_path);break;case"toggle":i.entity&&(_t(e,i.entity),vt("success"));break;case"call-service":if(!n.service)return void vt("failure");var r=n.service.split(".",2);e.callService(r[0],r[1],n.service_data,n.target),vt("success");break;case"fire-dom-event":lt(t,"ll-custom",n)}},wt=function(t,e,i,n){var r;"double_tap"===n&&i.double_tap_action?r=i.double_tap_action:"hold"===n&&i.hold_action?r=i.hold_action:"tap"===n&&i.tap_action&&(r=i.tap_action),bt(t,e,i,r)},$t=function(t,e,i,n,r){var o;if(r&&i.double_tap_action?o=i.double_tap_action:n&&i.hold_action?o=i.hold_action:!n&&i.tap_action&&(o=i.tap_action),o||(o={action:"more-info"}),!o.confirmation||o.confirmation.exemptions&&o.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||confirm(o.confirmation.text||"Are you sure you want to "+o.action+"?"))switch(o.action){case"more-info":(o.entity||i.entity||i.camera_image)&&(lt(t,"hass-more-info",{entityId:o.entity?o.entity:i.entity?i.entity:i.camera_image}),o.haptic&&vt(o.haptic));break;case"navigate":o.navigation_path&&(gt(0,o.navigation_path),o.haptic&&vt(o.haptic));break;case"url":o.url_path&&window.open(o.url_path),o.haptic&&vt(o.haptic);break;case"toggle":i.entity&&(_t(e,i.entity),o.haptic&&vt(o.haptic));break;case"call-service":if(!o.service)return;var a=o.service.split(".",2),s=a[0],l=a[1],c=F({},o.service_data);"entity"===c.entity_id&&(c.entity_id=i.entity),e.callService(s,l,c,o.target),o.haptic&&vt(o.haptic);break;case"fire-dom-event":lt(t,"ll-custom",o),o.haptic&&vt(o.haptic)}};function At(t){return void 0!==t&&"none"!==t.action}function Et(t,e,i){if(e.has("config")||i)return!0;if(t.config.entity){var n=e.get("hass");return!n||n.states[t.config.entity]!==t.hass.states[t.config.entity]}return!1}function St(t){return void 0!==t&&"none"!==t.action}var Tt=function(t,e,i){void 0===i&&(i=!0);var n={};e.forEach((function(e){if(nt.includes(t.states[e].state)===i){var r=H(e),o=["cover","lock"].includes(r)?r:"homeassistant";o in n||(n[o]=[]),n[o].push(e)}})),Object.keys(n).forEach((function(e){var r;switch(e){case"lock":r=i?"unlock":"lock";break;case"cover":r=i?"open_cover":"close_cover";break;default:r=i?"turn_on":"turn_off"}t.callService(e,r,{entity_id:n[e]})}))},Ot=function(){var t=document.querySelector("home-assistant");if(t=(t=(t=(t=(t=(t=(t=(t=t&&t.shadowRoot)&&t.querySelector("home-assistant-main"))&&t.shadowRoot)&&t.querySelector("app-drawer-layout partial-panel-resolver"))&&t.shadowRoot||t)&&t.querySelector("ha-panel-lovelace"))&&t.shadowRoot)&&t.querySelector("hui-root")){var e=t.lovelace;return e.current_view=t.___curView,e}return null},Ct={humidity:"mdi:water-percent",illuminance:"mdi:brightness-5",temperature:"mdi:thermometer",pressure:"mdi:gauge",power:"mdi:flash",signal_strength:"mdi:wifi"},kt={binary_sensor:function(t,e){var i="off"===t;switch(null==e?void 0:e.attributes.device_class){case"battery":return i?"mdi:battery":"mdi:battery-outline";case"battery_charging":return i?"mdi:battery":"mdi:battery-charging";case"cold":return i?"mdi:thermometer":"mdi:snowflake";case"connectivity":return i?"mdi:server-network-off":"mdi:server-network";case"door":return i?"mdi:door-closed":"mdi:door-open";case"garage_door":return i?"mdi:garage":"mdi:garage-open";case"power":case"plug":return i?"mdi:power-plug-off":"mdi:power-plug";case"gas":case"problem":case"safety":case"tamper":return i?"mdi:check-circle":"mdi:alert-circle";case"smoke":return i?"mdi:check-circle":"mdi:smoke";case"heat":return i?"mdi:thermometer":"mdi:fire";case"light":return i?"mdi:brightness-5":"mdi:brightness-7";case"lock":return i?"mdi:lock":"mdi:lock-open";case"moisture":return i?"mdi:water-off":"mdi:water";case"motion":return i?"mdi:walk":"mdi:run";case"occupancy":case"presence":return i?"mdi:home-outline":"mdi:home";case"opening":return i?"mdi:square":"mdi:square-outline";case"running":return i?"mdi:stop":"mdi:play";case"sound":return i?"mdi:music-note-off":"mdi:music-note";case"update":return i?"mdi:package":"mdi:package-up";case"vibration":return i?"mdi:crop-portrait":"mdi:vibrate";case"window":return i?"mdi:window-closed":"mdi:window-open";default:return i?"mdi:radiobox-blank":"mdi:checkbox-marked-circle"}},cover:function(t){var e="closed"!==t.state;switch(t.attributes.device_class){case"garage":return e?"mdi:garage-open":"mdi:garage";case"door":return e?"mdi:door-open":"mdi:door-closed";case"shutter":return e?"mdi:window-shutter-open":"mdi:window-shutter";case"blind":return e?"mdi:blinds-open":"mdi:blinds";case"window":return e?"mdi:window-open":"mdi:window-closed";default:return pt("cover",t.state)}},sensor:function(t){var e=t.attributes.device_class;if(e&&e in Ct)return Ct[e];if("battery"===e){var i=Number(t.state);if(isNaN(i))return"mdi:battery-unknown";var n=10*Math.round(i/10);return n>=100?"mdi:battery":n<=0?"mdi:battery-alert":"hass:battery-"+n}var r=t.attributes.unit_of_measurement;return"°C"===r||"°F"===r?"mdi:thermometer":pt("sensor")},input_datetime:function(t){return t.attributes.has_date?t.attributes.has_time?pt("input_datetime"):"mdi:calendar":"mdi:clock"}},Nt=function(t){if(!t)return"mdi:bookmark";if(t.attributes.icon)return t.attributes.icon;var e=H(t.entity_id);return e in kt?kt[e](t):pt(e,t.state)}},342:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.actionHandler=e.actionHandlerBind=void 0;const n=i(62),r=i(156),o=i(197),a="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.maxTouchPoints>0;class s extends HTMLElement{constructor(){super(),this.holdTime=500,this.held=!1,this.ripple=document.createElement("mwc-ripple")}connectedCallback(){Object.assign(this.style,{position:"absolute",width:a?"100px":"50px",height:a?"100px":"50px",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:"999"}),this.appendChild(this.ripple),this.ripple.primary=!0,["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach((t=>{document.addEventListener(t,(()=>{clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0}),{passive:!0})}))}bind(t,e){if(t.actionHandler)return;t.actionHandler=!0,t.addEventListener("contextmenu",(t=>{const e=t||window.event;return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.returnValue=!1,!1}));const i=t=>{let e,i;this.held=!1,t.touches?(e=t.touches[0].pageX,i=t.touches[0].pageY):(e=t.pageX,i=t.pageY),this.timer=window.setTimeout((()=>{this.startAnimation(e,i),this.held=!0}),this.holdTime)},n=i=>{i.preventDefault(),["touchend","touchcancel"].includes(i.type)&&void 0===this.timer||(clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0,this.held?(0,o.fireEvent)(t,"action",{action:"hold"}):e.hasDoubleClick?"click"===i.type&&i.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout((()=>{this.dblClickTimeout=void 0,(0,o.fireEvent)(t,"action",{action:"tap"})}),250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,(0,o.fireEvent)(t,"action",{action:"double_tap"})):(0,o.fireEvent)(t,"action",{action:"tap"}))};t.addEventListener("touchstart",i,{passive:!0}),t.addEventListener("touchend",n),t.addEventListener("touchcancel",n),t.addEventListener("mousedown",i,{passive:!0}),t.addEventListener("click",n),t.addEventListener("keyup",(t=>{13===t.keyCode&&n(t)}))}startAnimation(t,e){Object.assign(this.style,{left:`${t}px`,top:`${e}px`,display:null}),this.ripple.disabled=!1,this.ripple.active=!0,this.ripple.unbounded=!0}stopAnimation(){this.ripple.active=!1,this.ripple.disabled=!0,this.style.display="none"}}customElements.define("action-handler-roomcard",s),e.actionHandlerBind=(t,e)=>{const i=(()=>{const t=document.body;if(t.querySelector("action-handler-roomcard"))return t.querySelector("action-handler-roomcard");const e=document.createElement("action-handler-roomcard");return t.appendChild(e),e})();i&&i.bind(t,e)},e.actionHandler=(0,r.directive)(class extends r.Directive{update(t,[i]){return(0,e.actionHandlerBind)(t.element,i),n.noChange}render(t){}})},461:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extractValue=e.renderRows=e.renderEntity=e.renderEntitiesRow=e.renderInfoEntity=e.renderTitle=e.clickHandler=e.renderMainEntity=e.renderValue=e.renderIcon=e.entityStyles=e.entityStateDisplay=e.renderCustomStateIcon=e.renderConditionIcons=e.entityIcon=e.entityName=e.computeEntity=e.checkConfig=void 0;const n=i(230),r=i(759),o=i(578),a=i(882),s=i(197),l=i(62),c=i(623),u=i(704),d=i(846),m=i(342);e.checkConfig=t=>{if(null==t.entities&&null==t.entity&&void 0===t.info_entities&&void 0===t.rows&&void 0===t.cards)throw new Error("Please define entities.")},e.computeEntity=t=>t.substr(t.indexOf(".")+1),e.entityName=(t,i)=>(0,u.getTemplateOrAttribute)(t.name,i,t.stateObj)||(t.entity?t.stateObj.attributes.friendly_name||(0,e.computeEntity)(t.stateObj.entity_id):null)||null,e.entityIcon=(t,i,n)=>{var r;if("icon"in i&&(void 0===i.show_icon||!1===i.show_icon))throw new Error(`Entity: ${i.entity} => Icon defined but show_icon is set to false or not defined. Please set show_icon to true`);return"icon"in i?"string"==typeof i.icon?i.icon:i.icon.state_on?(0,e.renderCustomStateIcon)(t,i.icon):i.icon.conditions?(0,e.renderConditionIcons)(t,i,n):(null===(r=i.icon.template)||void 0===r?void 0:r.icon)?(0,a.evalTemplate)(n,t,i.icon.template.icon):void 0:t.attributes.icon||null},e.renderConditionIcons=(t,e,i)=>{const n=t.state;return e.icon.conditions.filter((e=>{let r=n;if(e.entity){const t=i.states[e.entity];r=e.attribute?t.attributes[e.attribute]:t.state}return e.attribute&&!e.entity&&(r=t.attributes[e.attribute]),(0,a.checkConditionalValue)(e,r)})).pop()},e.renderCustomStateIcon=(t,e)=>{switch((0,o.computeStateDomain)(t)){case"light":case"switch":case"binary_sensor":case"input_boolean":return"on"===t.state?e.state_on:e.state_off}},e.entityStateDisplay=(t,i)=>{if((0,a.isUnavailable)(i.stateObj))return t.localize(`state.default.${i.stateObj.state}`);let n=(0,a.getValue)(i),s=void 0!==i.attribute?i.unit:i.unit||i.stateObj.attributes.unit_of_measurement;if(i.format)return({value:n,unit:s}=(0,e.extractValue)(i,n,t,s)),`${n}${s?` ${s}`:""}`;if(i.attribute)return`${isNaN(n)?n:(0,r.formatNumber)(n,t.locale)}${s?` ${s}`:""}`;const l=Object.assign(Object.assign({},i.stateObj),{attributes:Object.assign(Object.assign({},i.stateObj.attributes),{unit_of_measurement:s})});return(0,o.computeStateDisplay)(t.localize,l,t.locale)},e.entityStyles=(t,e,i)=>{if(!t)return"";if("template"in t){const n=t;return(0,a.evalTemplate)(i,e,n.template)}const n=t;return Object.keys(n).map((t=>`${t}: ${n[t]};`)).join("")},e.renderIcon=(t,i,n,r)=>{if(void 0!==i.show_icon&&!1===i.show_icon)return null;const o=(0,e.entityIcon)(t,i,n),s=(0,u.templateStyling)(t,i,n);return l.html``},e.renderValue=(t,i)=>{if(!0===t.toggle)return l.html``;if(!0===t.show_icon)return(0,e.renderIcon)(t.stateObj,t,i);if(t.attribute&&[c.LAST_CHANGED,c.LAST_UPDATED].includes(t.attribute))return l.html``;if(t.format&&c.TIMESTAMP_FORMATS.includes(t.format)){const e=(0,a.getValue)(t),n=new Date(e);return n instanceof Date&&!isNaN(n.getTime())?l.html``:e}return(0,e.entityStateDisplay)(i,t)},e.renderMainEntity=(t,i,n)=>{var r;if(void 0===t)return null;const o=n.states[t.entity];return l.html`
- ${0===(null===(r=i.entities)||void 0===r?void 0:r.length)||i.icon?(0,e.renderIcon)(t.stateObj,i,n,"main-icon"):void 0!==t.show_state&&!1===t.show_state?"":(0,e.renderValue)(t,n)} -
`},e.clickHandler=(t,e,i,n)=>{(0,s.handleAction)(t,e,i,n.detail.action)},e.renderTitle=(t,i,n,r)=>{if(!0===t.hide_title)return null;const o=void 0!==t.tap_action||void 0!==t.double_tap_action,a=(0,u.getTemplateOrAttribute)(t.title,i,null==r?void 0:r.stateObj);return l.html`
{i&&o.detail.action&&(0,e.clickHandler)(n,i,null!=r?r:{tap_action:t.tap_action,double_tap_action:t.double_tap_action,hold_action:t.hold_action},o)}} - .actionHandler=${(0,m.actionHandler)({hasHold:(0,s.hasAction)(null==r?void 0:r.hold_action),hasDoubleClick:(0,s.hasAction)(null==r?void 0:r.double_tap_action)})}>${(0,e.renderMainEntity)(r,t,i)} ${a}
`},e.renderInfoEntity=(t,i,n)=>void 0===t||!t.stateObj||(0,d.hideIfEntity)(t,i)?null:l.html`
{i&&t&&r.detail.action&&(0,e.clickHandler)(n,i,t,r)}} - .actionHandler=${(0,m.actionHandler)({hasHold:(0,s.hasAction)(t.hold_action),hasDoubleClick:(0,s.hasAction)(t.double_tap_action)})}>${(0,e.renderValue)(t,i)}
`,e.renderEntitiesRow=(t,i,n,r,o)=>void 0===i?null:l.html`
${i.map((t=>(0,e.renderEntity)(t,n,r)))}
`,e.renderEntity=(t,i,n)=>null==t.stateObj||(0,d.hideIfEntity)(t,i)?null:l.html`
{i&&t&&r.detail.action&&(0,e.clickHandler)(n,i,t,r)}} - .actionHandler=${(0,m.actionHandler)({hasHold:(0,s.hasAction)(t.hold_action),hasDoubleClick:(0,s.hasAction)(t.double_tap_action)})}> - ${void 0===t.show_name||t.show_name?l.html`${(0,e.entityName)(t,i)}`:""} -
${(0,e.renderIcon)(t.stateObj,t,i)}
- ${t.show_state?l.html`${(0,e.entityStateDisplay)(i,t)}`:""} -
`,e.renderRows=(t,i,n)=>{const r=t.filter((t=>!(0,d.hideIfRow)(t,i)));return l.html`${r.map((t=>(0,e.renderEntitiesRow)(t,t.entities,i,n)))}`},e.extractValue=(t,e,i,o)=>{if(t.format.startsWith("precision")){const n=parseInt(t.format.slice(-1),10);e=(0,r.formatNumber)(e,i.locale,{minimumFractionDigits:n,maximumFractionDigits:n})}else isNaN(parseFloat(e))||!isFinite(e)||("brightness"===t.format?(e=Math.round(e/255*100),o="%"):t.format.startsWith("duration")?(e=(0,n.secondsToDuration)("duration-m"===t.format?e/1e3:e),o=void 0):"kilo"===t.format?e=(0,r.formatNumber)(e/1e3,i.locale,{maximumFractionDigits:2}):"invert"===t.format?e=(0,r.formatNumber)(e-2*e,i.locale):"position"===t.format&&(e=(0,r.formatNumber)(100-e,i.locale)));return{value:e,unit:o}}},846:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.hideIfEntity=e.hideIfRow=e.hideIfCard=e.hideUnavailable=void 0;const n=i(882);e.hideUnavailable=t=>t.hide_unavailable&&(0,n.isUnavailable)(t.stateObj),e.hideIfCard=(t,e)=>{var i,r;if(void 0===t.hide_if)return!1;if(t.hide_if){const o=null===(i=e.states[t.entity])||void 0===i?void 0:i.state,a=null===(r=t.hide_if.conditions)||void 0===r?void 0:r.filter((i=>{let r=o;if(i.entity){const t=e.states[i.entity];r=i.attribute?t.attributes[i.attribute]:t.state}return i.attribute&&!i.entity&&(r=e.states[t.entity].attributes[i.attribute]),(0,n.checkConditionalValue)(i,r)}));return(null==a?void 0:a.length)>0}},e.hideIfRow=(t,e)=>{var i;if(void 0===t.hide_if)return!1;if(t.hide_if){const r=null===(i=t.hide_if.conditions)||void 0===i?void 0:i.filter((t=>{if(t.entity){const i=e.states[t.entity];return(0,n.checkConditionalValue)(t,t.attribute?i.attributes[t.attribute]:i.state)}}));return(null==r?void 0:r.length)>0}},e.hideIfEntity=(t,i)=>{var r;if((0,e.hideUnavailable)(t))return!0;if(void 0===t.hide_if)return!1;if(t.hide_if){const e=t.stateObj.state,o=null===(r=t.hide_if.conditions)||void 0===r?void 0:r.filter((r=>{let o=e;if(r.entity){const t=i.states[r.entity];o=r.attribute?t.attributes[r.attribute]:t.state}return r.attribute&&!r.entity&&(o=t.stateObj.attributes[r.attribute]),(0,n.checkConditionalValue)(r,o)}));return(null==o?void 0:o.length)>0}}},607:function(t,e,i){var n=this&&this.__decorate||function(t,e,i,n){var r,o=arguments.length,a=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,i,a):r(e,i))||a);return o>3&&a&&Object.defineProperty(e,i,a),a},r=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{l(n.next(t))}catch(t){o(t)}}function s(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}l((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const o=i(62),a=i(595),s=i(197),l=i(461),c=i(882),u=i(846),d=i(299),m=i(147);console.info(`%c ROOM-CARD %c ${m.version}`,"color: cyan; background: black; font-weight: bold;","color: darkblue; background: white; font-weight: bold;"),window.customCards=window.customCards||[],window.customCards.push({type:"room-card",name:"Room card",preview:!1,description:"Show multiple entity states, attributes and icons in a single card in Home Assistant's Lovelace UI"});let h=class extends o.LitElement{constructor(){super(...arguments),this.monitoredStates={}}getChildCustomCardTypes(t,e){if(t)for(const i of t)0===i.type.indexOf("custom:")&&e.add(i.type.substring(7,i.type.length)),this.getChildCustomCardTypes(i.cards,e)}waitForDependentComponents(t){return r(this,void 0,void 0,(function*(){const e=new Set;this.getChildCustomCardTypes(t.cards,e),yield Promise.all(Array.from(e).map((t=>customElements.whenDefined(t))))}))}shouldUpdate(t){return void 0!==this.monitoredStates&&void 0!==this.config&&t.size>0&&void 0!==this._helpers&&void 0!==this._helpers.createCardElement}updateMonitoredStates(t){const e=Object.assign({},this.monitoredStates);let i=!1;for(const n of this.config.entityIds)if(n in t.states){const r=this.monitoredStates&&this.monitoredStates[n];(!this.monitoredStates||(null==r?void 0:r.last_updated) -
- ${(0,l.renderTitle)(this.config,this._hass,this,e)} -
- ${i.map((t=>(0,l.renderInfoEntity)(t,this._hass,this)))} -
-
- ${void 0!==r&&r.length>0?(0,l.renderRows)(r,this._hass,this):(0,l.renderEntitiesRow)(this.config,n,this._hass,this)} - ${null===(t=this.config.cards)||void 0===t?void 0:t.map((t=>this.createCardElement(t,this._hass)))} - - `}catch(t){return o.html`${t.toString()}`}}getCardSize(){const t=this.config.cards?this.config.cards.length:0,e=this.config.rows?this.config.rows.length:0,i=!this.config.info_entities&&this.config.hide_title?1:2;return t+e+(this.config.entities&&this.config.entities.length>0?1:0)+i}createCardElement(t,e){if((0,u.hideIfCard)(t,e)||t.show_states&&!t.show_states.includes(e.states[t.entity].state))return null;let i;return i=this._helpers?this._helpers.createCardElement(t):(0,s.createThing)(t),i.hass=e,i.style.boxShadow="none",i.style.borderRadius="0",i}};n([(0,a.property)()],h.prototype,"monitoredStates",void 0),n([(0,a.property)()],h.prototype,"_helpers",void 0),n([(0,a.property)()],h.prototype,"_hass",void 0),n([(0,a.property)()],h.prototype,"config",void 0),h=n([(0,a.customElement)("room-card")],h),e.default=h},578:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.computeStateDisplay=e.computeStateDomain=void 0;const n=i(623),r=i(247),o=i(347),a=i(319),s=i(759);e.computeStateDomain=t=>t.entity_id.substr(0,t.entity_id.indexOf(".")),e.computeStateDisplay=(t,i,l,c)=>{const u=void 0!==c?c:i.state;if(u===n.UNKNOWN||u===n.UNAVAILABLE)return t(`state.default.${u}`);if((0,s.isNumericState)(i)){if("monetary"===i.attributes.device_class)try{return(0,s.formatNumber)(u,l,{style:"currency",currency:i.attributes.unit_of_measurement})}catch(t){}return`${(0,s.formatNumber)(u,l)}${i.attributes.unit_of_measurement?" "+i.attributes.unit_of_measurement:""}`}const d=(0,e.computeStateDomain)(i);if("input_datetime"===d){if(void 0===c){let t;return i.attributes.has_date&&i.attributes.has_time?(t=new Date(i.attributes.year,i.attributes.month-1,i.attributes.day,i.attributes.hour,i.attributes.minute),(0,o.formatDateTime)(t,l)):i.attributes.has_date?(t=new Date(i.attributes.year,i.attributes.month-1,i.attributes.day),(0,r.formatDate)(t,l)):i.attributes.has_time?(t=new Date,t.setHours(i.attributes.hour,i.attributes.minute),(0,a.formatTime)(t,l)):i.state}try{const t=c.split(" ");if(2===t.length)return(0,o.formatDateTime)(new Date(t.join("T")),l);if(1===t.length){if(c.includes("-"))return(0,r.formatDate)(new Date(`${c}T00:00`),l);if(c.includes(":")){const t=new Date;return(0,a.formatTime)(new Date(`${t.toISOString().split("T")[0]}T${c}`),l)}}return c}catch(t){return c}}return"humidifier"===d&&"on"===u&&i.attributes.humidity?`${i.attributes.humidity} %`:"counter"===d||"number"===d||"input_number"===d?(0,s.formatNumber)(u,l):"button"===d||"sensor"===d&&"timestamp"===i.attributes.device_class?(0,o.formatDateTime)(new Date(u),l):i.attributes.device_class&&t(`component.${d}.state.${i.attributes.device_class}.${u}`)||t(`component.${d}.state._.${u}`)||u}},623:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TimeFormat=e.NumberFormat=e.SECONDARY_INFO_VALUES=e.TIMESTAMP_FORMATS=e.LAST_UPDATED=e.LAST_CHANGED=e.UNAVAILABLE_STATES=e.UNKNOWN=e.UNAVAILABLE=void 0,e.UNAVAILABLE="unavailable",e.UNKNOWN="unknown",e.UNAVAILABLE_STATES=[e.UNAVAILABLE,e.UNKNOWN],e.LAST_CHANGED="last-changed",e.LAST_UPDATED="last-updated",e.TIMESTAMP_FORMATS=["relative","total","date","time","datetime"],e.SECONDARY_INFO_VALUES=["entity-id","last-changed","last-updated","last-triggered","position","tilt-position","brightness"],e.NumberFormat={language:"language",system:"system",comma_decimal:"comma_decimal",decimal_comma:"decimal_comma",space_comma:"space_comma",none:"none"},e.TimeFormat={language:"language",system:"system",am_pm:"12",twenty_four:"24"}},247:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatDate=void 0,e.formatDate=(t,e)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric"}).format(t)},347:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatDateTime=void 0;const n=i(269);e.formatDateTime=(t,e)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,n.useAmPm)(e)?"numeric":"2-digit",minute:"2-digit",hour12:(0,n.useAmPm)(e)}).format(t)},759:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNumber=e.numberFormatToLocale=e.isNumericState=e.round=void 0;const n=i(623);e.round=(t,e=2)=>Math.round(t*Math.pow(10,e))/Math.pow(10,e),e.isNumericState=t=>!!t.attributes.unit_of_measurement||!!t.attributes.state_class,e.numberFormatToLocale=t=>{switch(t.number_format){case n.NumberFormat.comma_decimal:return["en-US","en"];case n.NumberFormat.decimal_comma:return["de","es","it"];case n.NumberFormat.space_comma:return["fr","sv","cs"];case n.NumberFormat.system:return;default:return t.language}},e.formatNumber=(t,i,o)=>{const a=i?(0,e.numberFormatToLocale)(i):void 0;if((null==i?void 0:i.number_format)!==n.NumberFormat.none&&!Number.isNaN(Number(t))&&Intl)try{return new Intl.NumberFormat(a,r(t,o)).format(Number(t))}catch(e){return console.error(e),new Intl.NumberFormat(void 0,r(t,o)).format(Number(t))}return"string"==typeof t?t:`${(0,e.round)(t,null==o?void 0:o.maximumFractionDigits).toString()}${"currency"===(null==o?void 0:o.style)?` ${o.currency}`:""}`};const r=(t,e)=>Object.assign({maximumFractionDigits:2},e)},319:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatTime=void 0;const n=i(269);e.formatTime=(t,e)=>new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",hour12:(0,n.useAmPm)(e)}).format(t)},230:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.secondsToDuration=void 0;const i=t=>t<10?`0${t}`:t;e.secondsToDuration=function(t){const e=Math.floor(t/3600),n=Math.floor(t%3600/60),r=Math.floor(t%3600%60);return e>0?`${e}:${i(n)}:${i(r)}`:n>0?`${n}:${i(r)}`:r>0?""+r:null}},269:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.useAmPm=void 0;const n=i(623);e.useAmPm=t=>{if(t.time_format===n.TimeFormat.language||t.time_format===n.TimeFormat.system){const e=t.time_format===n.TimeFormat.language?t.language:void 0,i=(new Date).toLocaleString(e);return i.includes("AM")||i.includes("PM")}return t.time_format===n.TimeFormat.am_pm}},299:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.style=void 0;const n=i(62);e.style=n.css` - ha-card { - display: flex; - flex-direction: column; - } - ha-card .card-header { - padding-bottom: 0px; - } - .icon-small { - display: inline-block; - } - .entity { - text-align: center; - cursor: pointer; - } - .entity span { - font-size: 10px; - } - .entities-row { - flex-direction: row; - flex-wrap: wrap; - display: inline-flex; - align-items: center; - padding: 0 20px 10px 20px; - } - .entities-row .entity { - margin-right: 16px; - } - .entities-row .entity:last-of-type, - .entities-info-row .entity:last-of-type { - margin-right: 0; - } - .entities-column { - flex-direction: column; - display: flex; - align-items: flex-end; - justify-content: space-evenly; - } - .entities-column .entity div { - display: inline-block; - vertical-align: middle; - } - - .entities-info-row { - flex-direction: row; - flex-wrap: wrap; - display: inline-flex; - justify-content: center; - align-items: center; - padding: 0 20px 10px 20px; - font-size: 12px; - position: absolute; - right: 20px; - top: 15px; - } - .entities-info-row .entity { - margin-right: 16px; - } - .entities-info-row .entity.icon-entity { - margin-right: 0px; - } - .main-state { - float: left; - margin-right: 10px; - } - .main-state > ha-state-icon > ha-svg-icon { - vertical-align: baseline; - } - .main-icon { - vertical-align: baseline; - font-size: 30px; - } - .title { - min-height: 48px; - } - .clickable { - cursor: pointer; - } - .content-left { - justify-content: left; - } - .content-center { - justify-content: center; - } - .content-right { - justify-content: right; - } -`},704:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getTemplateOrAttribute=e.mapTemplate=e.templateStyling=void 0;const n=i(882);e.templateStyling=(t,e,i)=>{var r;const o=e.icon;return void 0!==(null===(r=null==o?void 0:o.template)||void 0===r?void 0:r.styles)?(0,n.evalTemplate)(i,t,o.template.styles):null},e.mapTemplate=(t,e)=>{if(void 0!==t&&t.template){const i=e.templates.filter((e=>e.name===t.template));if(i.length>0){const e=i[0];return Object.assign(Object.assign({stateObj:t.stateObj},t),e.template)}}return t},e.getTemplateOrAttribute=(t,e,i)=>t&&"object"==typeof t&&"template"in t?(0,n.evalTemplate)(e,i,t.template):t},882:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.parseConfig=e.renderClasses=e.evalTemplate=e.mapStateObject=e.checkConditionalValue=e.hasConfigOrEntitiesChanged=e.getCardEntities=e.getConditionEntitiesFromConfig=e.getConditionEntities=e.getEntity=e.getEntityIds=e.getValue=e.isUnavailable=e.isObject=void 0;const n=i(62),r=i(623),o=i(704);e.isObject=t=>"object"==typeof t&&!Array.isArray(t)&&!!t,e.isUnavailable=t=>!t||r.UNAVAILABLE_STATES.includes(t.state),e.getValue=t=>{if(t.attribute&&void 0===t.stateObj.attributes[t.attribute])throw new Error(`Entity: '${t.entity}' has no attribute named '${t.attribute}'`);return t.attribute?t.stateObj.attributes[t.attribute]:t.stateObj.state},e.getEntityIds=t=>{var i,n,r,o;return[t.entity].concat(null===(i=t.entities)||void 0===i?void 0:i.map((t=>(0,e.getEntity)(t)))).concat(null===(n=t.info_entities)||void 0===n?void 0:n.map((t=>(0,e.getEntity)(t)))).concat(null===(r=t.rows)||void 0===r?void 0:r.flatMap((t=>t.entities)).map((t=>(0,e.getEntity)(t)))).concat(null===(o=t.cards)||void 0===o?void 0:o.flatMap((t=>(0,e.getCardEntities)(t)))).concat((0,e.getConditionEntitiesFromConfig)(t)).filter((t=>t))},e.getEntity=t=>void 0===t?null:"string"==typeof t?t:t.entity,e.getConditionEntities=t=>{let e=[];return null==t||t.forEach((t=>{var i,n,r,o;const a=null===(n=null===(i=null==t?void 0:t.icon)||void 0===i?void 0:i.conditions)||void 0===n?void 0:n.filter((t=>void 0!==t.entity));a&&(e=e.concat(a));const s=null===(o=null===(r=null==t?void 0:t.hide_if)||void 0===r?void 0:r.conditions)||void 0===o?void 0:o.filter((t=>void 0!==t.entity));s&&(e=e.concat(s))})),e},e.getConditionEntitiesFromConfig=t=>{var i;const n=[t.entities,t.info_entities,null===(i=t.rows)||void 0===i?void 0:i.flatMap((t=>t.entities))];return(0,e.getConditionEntities)(n.flatMap((t=>t))).filter((t=>t.entity)).map((t=>t.entity))},e.getCardEntities=t=>{var i,n;return[(0,e.getEntity)(t.entity)].concat(null===(i=t.cards)||void 0===i?void 0:i.flatMap((t=>(0,e.getCardEntities)(t)))).concat(null===(n=t.entities)||void 0===n?void 0:n.flatMap((t=>(0,e.getEntity)(t)))).filter((t=>t))},e.hasConfigOrEntitiesChanged=(t,e)=>{if(e.has("config"))return!0;const i=e.get("_hass");return!!i&&t.entityIds.some((e=>i.states[e]!==t.hass.states[e]))},e.checkConditionalValue=(t,e)=>{const i="boolean"==typeof t.value?String(t.value):t.value;return"equals"==t.condition&&e==i||"not_equals"==t.condition&&e!=i||"above"==t.condition&&e>i||"below"==t.condition&&e{let n="string"==typeof t?{entity:t}:t;return n=(0,o.mapTemplate)(n,i),Object.assign(Object.assign({},n),{stateObj:e.states[n.entity]})},e.evalTemplate=(t,e,i)=>{try{return new Function("states","entity","user","hass","html",`'use strict'; ${i}`).call(this,null==t?void 0:t.states,e,null==t?void 0:t.user,t,n.html)}catch(t){const e=i.length<=100?i.trim():`${i.trim().substring(0,98)}...`;throw t.message=`${t.name}: ${t.message} in '${e}'`,t.name="RoomCardJSTemplateError",t}},e.renderClasses=(t,e)=>`entities-row ${t.content_alignment?`content-${t.content_alignment}`:"content-left"}${void 0!==e?` ${e}`:""}`,e.parseConfig=(t,i)=>{var n,r,o,a,s,l;const c={info_entities:[],entities:[]};return i&&t?(c.stateObj=void 0!==t.entity?i.states[t.entity]:void 0,c.entity=void 0!==t.entity?Object.assign(Object.assign({},t),{stateObj:c.stateObj}):void 0,c.info_entities=null!==(r=null===(n=t.info_entities)||void 0===n?void 0:n.map((n=>(0,e.mapStateObject)(n,i,t))))&&void 0!==r?r:[],c.entities=null!==(a=null===(o=t.entities)||void 0===o?void 0:o.map((n=>(0,e.mapStateObject)(n,i,t))))&&void 0!==a?a:[],c.rows=null!==(l=null===(s=t.rows)||void 0===s?void 0:s.map((n=>{var r;return{entities:null===(r=n.entities)||void 0===r?void 0:r.map((n=>(0,e.mapStateObject)(n,i,t))),hide_if:n.hide_if,content_alignment:n.content_alignment}})))&&void 0!==l?l:[],t.hass=i,c):c}},595:(t,e,i)=>{i.r(e),i.d(e,{customElement:()=>n,eventOptions:()=>c,property:()=>a,query:()=>u,queryAll:()=>d,queryAssignedElements:()=>f,queryAssignedNodes:()=>v,queryAsync:()=>m,state:()=>s});const n=t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:n}=e;return{kind:i,elements:n,finisher(e){customElements.define(t,e)}}})(t,e),r=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}},o=(t,e,i)=>{e.constructor.createProperty(i,t)};function a(t){return(e,i)=>void 0!==i?o(t,e,i):r(t,e)}function s(t){return a({...t,state:!0})}const l=({finisher:t,descriptor:e})=>(i,n)=>{var r;if(void 0===n){const n=null!==(r=i.originalKey)&&void 0!==r?r:i.key,o=null!=e?{kind:"method",placement:"prototype",key:n,descriptor:e(i.key)}:{...i,key:n};return null!=t&&(o.finisher=function(e){t(e,n)}),o}{const r=i.constructor;void 0!==e&&Object.defineProperty(i,n,e(n)),null==t||t(r,n)}};function c(t){return l({finisher:(e,i)=>{Object.assign(e.prototype[i],t)}})}function u(t,e){return l({descriptor:i=>{const n={get(){var e,i;return null!==(i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t))&&void 0!==i?i:null},enumerable:!0,configurable:!0};if(e){const e="symbol"==typeof i?Symbol():"__"+i;n.get=function(){var i,n;return void 0===this[e]&&(this[e]=null!==(n=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(t))&&void 0!==n?n:null),this[e]}}return n}})}function d(t){return l({descriptor:e=>({get(){var e,i;return null!==(i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelectorAll(t))&&void 0!==i?i:[]},enumerable:!0,configurable:!0})})}function m(t){return l({descriptor:e=>({async get(){var e;return await this.updateComplete,null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t)},enumerable:!0,configurable:!0})})}var h;const p=null!=(null===(h=window.HTMLSlotElement)||void 0===h?void 0:h.prototype.assignedElements)?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter((t=>t.nodeType===Node.ELEMENT_NODE));function f(t){const{slot:e,selector:i}=null!=t?t:{};return l({descriptor:n=>({get(){var n;const r="slot"+(e?`[name=${e}]`:":not([name])"),o=null===(n=this.renderRoot)||void 0===n?void 0:n.querySelector(r),a=null!=o?p(o,t):[];return i?a.filter((t=>t.matches(i))):a},enumerable:!0,configurable:!0})})}function v(t,e,i){let n,r=t;return"object"==typeof t?(r=t.slot,n=t):n={flatten:e},i?f({slot:r,flatten:e,selector:i}):l({descriptor:t=>({get(){var t,e;const i="slot"+(r?`[name=${r}]`:":not([name])"),o=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(i);return null!==(e=null==o?void 0:o.assignedNodes(n))&&void 0!==e?e:[]},enumerable:!0,configurable:!0})})}},156:(t,e,i)=>{i.r(e),i.d(e,{Directive:()=>o,PartType:()=>n,directive:()=>r});const n={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},r=t=>(...e)=>({_$litDirective$:t,values:e});class o{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}},62:(t,e,i)=>{i.r(e),i.d(e,{CSSResult:()=>s,LitElement:()=>pt,ReactiveElement:()=>w,UpdatingElement:()=>ht,_$LE:()=>vt,_$LH:()=>lt,adoptStyles:()=>u,css:()=>c,defaultConverter:()=>g,getCompatibleStyle:()=>d,html:()=>B,isServer:()=>gt,noChange:()=>W,notEqual:()=>y,nothing:()=>Y,render:()=>ut,supportsAdoptingStyleSheets:()=>r,svg:()=>q,unsafeCSS:()=>l});const n=window,r=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),a=new WeakMap;class s{constructor(t,e,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(r&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=a.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&a.set(e,t))}return t}toString(){return this.cssText}}const l=t=>new s("string"==typeof t?t:t+"",void 0,o),c=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new s(i,t,o)},u=(t,e)=>{r?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),r=n.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=e.cssText,t.appendChild(i)}))},d=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return l(e)})(t):t;var m;const h=window,p=h.trustedTypes,f=p?p.emptyScript:"",v=h.reactiveElementPolyfillSupport,g={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},y=(t,e)=>e!==t&&(e==e||t==t),_={attribute:!0,type:String,converter:g,reflect:!1,hasChanged:y},b="finalized";class w extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const n=this._$Ep(i,e);void 0!==n&&(this._$Ev.set(n,i),t.push(n))})),t}static createProperty(t,e=_){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){const r=this[t];this[e]=n,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||_}static finalize(){if(this.hasOwnProperty(b))return!1;this[b]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(d(t))}else void 0!==t&&e.push(d(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return u(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=_){var n;const r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){const o=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:g).toAttribute(e,i.type);this._$El=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$El=null}}_$AK(t,e){var i;const n=this.constructor,r=n._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=n.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:g;this._$El=r,this[r]=o.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let n=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}var $;w[b]=!0,w.elementProperties=new Map,w.elementStyles=[],w.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:w}),(null!==(m=h.reactiveElementVersions)&&void 0!==m?m:h.reactiveElementVersions=[]).push("1.6.3");const A=window,E=A.trustedTypes,S=E?E.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",O=`lit$${(Math.random()+"").slice(9)}$`,C="?"+O,k=`<${C}>`,N=document,D=()=>N.createComment(""),x=t=>null===t||"object"!=typeof t&&"function"!=typeof t,j=Array.isArray,I=t=>j(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),M="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,F=/-->/g,U=/>/g,R=RegExp(`>|${M}(?:([^\\s"'>=/]+)(${M}*=${M}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),H=/'/g,L=/"/g,V=/^(?:script|style|textarea|title)$/i,z=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),B=z(1),q=z(2),W=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),K=new WeakMap,G=N.createTreeWalker(N,129,null,!1);function J(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(e):e}const X=(t,e)=>{const i=t.length-1,n=[];let r,o=2===e?"":"",a=P;for(let e=0;e"===l[0]?(a=null!=r?r:P,c=-1):void 0===l[1]?c=-2:(c=a.lastIndex-l[2].length,s=l[1],a=void 0===l[3]?R:'"'===l[3]?L:H):a===L||a===H?a=R:a===F||a===U?a=P:(a=R,r=void 0);const d=a===R&&t[e+1].startsWith("/>")?" ":"";o+=a===P?i+k:c>=0?(n.push(s),i.slice(0,c)+T+i.slice(c)+O+d):i+O+(-2===c?(n.push(void 0),e):d)}return[J(t,o+(t[i]||"")+(2===e?"":"")),n]};class Z{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,o=0;const a=t.length-1,s=this.parts,[l,c]=X(t,e);if(this.el=Z.createElement(l,i),G.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=G.nextNode())&&s.length0){n.textContent=E?E.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Y}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){const r=this.strings;let o=!1;if(void 0===r)t=Q(this,t,e,0),o=!x(t)||t!==this._$AH&&t!==W,o&&(this._$AH=t);else{const n=t;let a,s;for(t=r[0],a=0;a{var n,r;const o=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let a=o._$litPart$;if(void 0===a){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;o._$litPart$=a=new et(e.insertBefore(D(),t),t,void 0,null!=i?i:{})}return a._$AI(t),a};var dt,mt;const ht=w;class pt extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ut(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return W}}pt.finalized=!0,pt._$litElement$=!0,null===(dt=globalThis.litElementHydrateSupport)||void 0===dt||dt.call(globalThis,{LitElement:pt});const ft=globalThis.litElementPolyfillSupport;null==ft||ft({LitElement:pt});const vt={_$AK:(t,e,i)=>{t._$AK(e,i)},_$AL:t=>t._$AL};(null!==(mt=globalThis.litElementVersions)&&void 0!==mt?mt:globalThis.litElementVersions=[]).push("3.3.3");const gt=!1},147:t=>{t.exports=JSON.parse('{"name":"room-card","version":"1.08.02","description":"Show entities in Home Assistant\'s Lovelace UI","keywords":["home-assistant","homeassistant","lovelace","custom-cards","multiple","entity","row"],"module":"room-card.js","license":"MIT","dependencies":{"babel-jest":"^29.6.4","custom-card-helpers":"^1.8.0","jest-environment-jsdom":"^29.5.0","jest-ts-auto-mock":"^2.1.0","lit":"^2.7.5","ts-auto-mock":"3.5.0","ttypescript":"^1.5.13","yarn":"^1.22.18"},"devDependencies":{"@babel/core":"^7.22.1","@babel/plugin-transform-runtime":"^7.22.4","@babel/preset-env":"^7.22.5","@types/jest":"^29.5.3","@typescript-eslint/eslint-plugin":"^5.60.1","@typescript-eslint/parser":"^5.59.1","babel-loader":"^9.1.3","codecov":"^3.8.3","compression-webpack-plugin":"^10.0.0","eslint":"^8.44.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.0.0","jest":"^29.6.2","prettier":"^2.8.8","ts-jest":"^29.1.1","ts-loader":"^9.4.4","typescript":"^4.9.5","webpack":"^5.88.2","webpack-cli":"^5.0.2"},"scripts":{"lint":"eslint src/**/*.ts","dev":"webpack -c webpack.config.js","build":"yarn lint && webpack -c webpack.config.js","test":"jest","coverage":"jest --coverage","workflow":"jest --coverage --json --outputFile=/home/runner/work/room-card/room-card/jest.results.json","prebuild":"copy git-hooks\\\\pre-commit .git\\\\hooks\\\\ && echo \'hook copied\'"}}')}},e={};function i(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,i),o.exports}i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(607)})(); \ No newline at end of file +(()=>{"use strict";var t={313:(t,e,i)=>{i.r(e),i.d(e,{DEFAULT_DOMAIN_ICON:()=>Q,DEFAULT_PANEL:()=>X,DEFAULT_VIEW_ENTITY_ID:()=>st,DOMAINS_HIDE_MORE_INFO:()=>et,DOMAINS_MORE_INFO_NO_HISTORY:()=>it,DOMAINS_TOGGLE:()=>rt,DOMAINS_WITH_CARD:()=>Z,DOMAINS_WITH_MORE_INFO:()=>tt,NumberFormat:()=>n,STATES_OFF:()=>nt,TimeFormat:()=>r,UNIT_C:()=>ot,UNIT_F:()=>at,applyThemesOnElement:()=>F,computeCardSize:()=>R,computeDomain:()=>H,computeEntity:()=>L,computeRTL:()=>V,computeRTLDirection:()=>z,computeStateDisplay:()=>J,computeStateDomain:()=>q,createThing:()=>dt,debounce:()=>mt,domainIcon:()=>pt,evaluateFilter:()=>ft,fireEvent:()=>ct,fixedIcons:()=>ht,formatDate:()=>u,formatDateMonth:()=>v,formatDateMonthYear:()=>g,formatDateNumeric:()=>m,formatDateShort:()=>p,formatDateTime:()=>A,formatDateTimeNumeric:()=>O,formatDateTimeWithSeconds:()=>S,formatDateWeekday:()=>c,formatDateYear:()=>b,formatNumber:()=>K,formatTime:()=>k,formatTimeWeekday:()=>j,formatTimeWithSeconds:()=>N,forwardHaptic:()=>gt,getLovelace:()=>Ot,handleAction:()=>wt,handleActionConfig:()=>bt,handleClick:()=>$t,hasAction:()=>At,hasConfigOrEntityChanged:()=>Et,hasDoubleClick:()=>St,isNumericState:()=>B,navigate:()=>yt,numberFormatToLocale:()=>W,relativeTime:()=>I,round:()=>Y,stateIcon:()=>Dt,timerTimeRemaining:()=>P,toggleEntity:()=>_t,turnOnOffEntities:()=>Tt,turnOnOffEntity:()=>vt});var n,r,o,a=function(){return a=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0)return{value:Math.round(m),unit:"year"};var h=12*m+u.getMonth()-d.getMonth();if(Math.round(Math.abs(h))>0)return{value:Math.round(h),unit:"month"};var p=r/604800;return{value:Math.round(p),unit:"week"}}(t,i);return n?function(t){return new Intl.RelativeTimeFormat(t.language,{numeric:"auto"})}(e).format(r.value,r.unit):Intl.NumberFormat(e.language,{style:"unit",unit:r.unit,unitDisplay:"long"}).format(Math.abs(r.value))};function P(t){var e,i=3600*(e=t.attributes.remaining.split(":").map(Number))[0]+60*e[1]+e[2];if("active"===t.state){var n=(new Date).getTime(),r=new Date(t.last_changed).getTime();i=Math.max(i-(n-r)/1e3,0)}return i}function U(){return(U=Object.assign||function(t){for(var e=1;e-1?t.split(".")[1].length:0;i.minimumFractionDigits=n,i.maximumFractionDigits=n}return i},J=function(t,e,i,n){var r=void 0!==n?n:e.state;if("unknown"===r||"unavailable"===r)return t("state.default."+r);if(B(e)){if("monetary"===e.attributes.device_class)try{return K(r,i,{style:"currency",currency:e.attributes.unit_of_measurement})}catch(t){}return K(r,i)+(e.attributes.unit_of_measurement?" "+e.attributes.unit_of_measurement:"")}var o=q(e);if("input_datetime"===o){var a;if(void 0===n)return e.attributes.has_date&&e.attributes.has_time?(a=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day,e.attributes.hour,e.attributes.minute),A(a,i)):e.attributes.has_date?(a=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day),u(a,i)):e.attributes.has_time?((a=new Date).setHours(e.attributes.hour,e.attributes.minute),k(a,i)):e.state;try{var s=n.split(" ");if(2===s.length)return A(new Date(s.join("T")),i);if(1===s.length){if(n.includes("-"))return u(new Date(n+"T00:00"),i);if(n.includes(":")){var c=new Date;return k(new Date(c.toISOString().split("T")[0]+"T"+n),i)}}return n}catch(t){return n}}return"humidifier"===o&&"on"===r&&e.attributes.humidity?e.attributes.humidity+" %":"counter"===o||"number"===o||"input_number"===o?K(r,i):e.attributes.device_class&&t("component."+o+".state."+e.attributes.device_class+"."+r)||t("component."+o+".state._."+r)||r},Q="mdi:bookmark",X="lovelace",Z=["climate","cover","configurator","input_select","input_number","input_text","lock","media_player","scene","script","timer","vacuum","water_heater","weblink"],tt=["alarm_control_panel","automation","camera","climate","configurator","cover","fan","group","history_graph","input_datetime","light","lock","media_player","script","sun","updater","vacuum","water_heater","weather"],et=["input_number","input_select","input_text","scene","weblink"],it=["camera","configurator","history_graph","scene"],nt=["closed","locked","off"],rt=new Set(["fan","input_boolean","light","switch","group","automation"]),ot="°C",at="°F",st="group.default_view",ct=function(t,e,i,n){n=n||{},i=null==i?{}:i;var r=new Event(e,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return r.detail=i,t.dispatchEvent(r),r},lt=new Set(["call-service","divider","section","weblink","cast","select"]),ut={alert:"toggle",automation:"toggle",climate:"climate",cover:"cover",fan:"toggle",group:"group",input_boolean:"toggle",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",remote:"toggle",scene:"scene",script:"script",sensor:"sensor",timer:"timer",switch:"toggle",vacuum:"toggle",water_heater:"climate",input_datetime:"input-datetime"},dt=function(t,e){void 0===e&&(e=!1);var i=function(t,e){return n("hui-error-card",{type:"error",error:t,config:e})},n=function(t,e){var n=window.document.createElement(t);try{if(!n.setConfig)return;n.setConfig(e)}catch(n){return console.error(t,n),i(n.message,e)}return n};if(!t||"object"!=typeof t||!e&&!t.type)return i("No type defined",t);var r=t.type;if(r&&r.startsWith("custom:"))r=r.substr(7);else if(e)if(lt.has(r))r="hui-"+r+"-row";else{if(!t.entity)return i("Invalid config given.",t);var o=t.entity.split(".",1)[0];r="hui-"+(ut[o]||"text")+"-entity-row"}else r="hui-"+r+"-card";if(customElements.get(r))return n(r,t);var a=i("Custom element doesn't exist: "+t.type+".",t);a.style.display="None";var s=setTimeout((function(){a.style.display=""}),2e3);return customElements.whenDefined(t.type).then((function(){clearTimeout(s),ct(a,"ll-rebuild",{},a)})),a},mt=function(t,e,i){var n;return void 0===i&&(i=!1),function(){var r=[].slice.call(arguments),o=this,a=i&&!n;clearTimeout(n),n=setTimeout((function(){n=null,i||t.apply(o,r)}),e),a&&t.apply(o,r)}},ht={alert:"mdi:alert",automation:"mdi:playlist-play",calendar:"mdi:calendar",camera:"mdi:video",climate:"mdi:thermostat",configurator:"mdi:settings",conversation:"mdi:text-to-speech",device_tracker:"mdi:account",fan:"mdi:fan",group:"mdi:google-circles-communities",history_graph:"mdi:chart-line",homeassistant:"mdi:home-assistant",homekit:"mdi:home-automation",image_processing:"mdi:image-filter-frames",input_boolean:"mdi:drawing",input_datetime:"mdi:calendar-clock",input_number:"mdi:ray-vertex",input_select:"mdi:format-list-bulleted",input_text:"mdi:textbox",light:"mdi:lightbulb",mailbox:"mdi:mailbox",notify:"mdi:comment-alert",person:"mdi:account",plant:"mdi:flower",proximity:"mdi:apple-safari",remote:"mdi:remote",scene:"mdi:google-pages",script:"mdi:file-document",sensor:"mdi:eye",simple_alarm:"mdi:bell",sun:"mdi:white-balance-sunny",switch:"mdi:flash",timer:"mdi:timer",updater:"mdi:cloud-upload",vacuum:"mdi:robot-vacuum",water_heater:"mdi:thermometer",weblink:"mdi:open-in-new"};function pt(t,e){if(t in ht)return ht[t];switch(t){case"alarm_control_panel":switch(e){case"armed_home":return"mdi:bell-plus";case"armed_night":return"mdi:bell-sleep";case"disarmed":return"mdi:bell-outline";case"triggered":return"mdi:bell-ring";default:return"mdi:bell"}case"binary_sensor":return e&&"off"===e?"mdi:radiobox-blank":"mdi:checkbox-marked-circle";case"cover":return"closed"===e?"mdi:window-closed":"mdi:window-open";case"lock":return e&&"unlocked"===e?"mdi:lock-open":"mdi:lock";case"media_player":return e&&"off"!==e&&"idle"!==e?"mdi:cast-connected":"mdi:cast";case"zwave":switch(e){case"dead":return"mdi:emoticon-dead";case"sleeping":return"mdi:sleep";case"initializing":return"mdi:timer-sand";default:return"mdi:z-wave"}default:return console.warn("Unable to find icon for domain "+t+" ("+e+")"),"mdi:bookmark"}}var ft=function(t,e){var i=e.value||e,n=e.attribute?t.attributes[e.attribute]:t.state;switch(e.operator||"=="){case"==":return n===i;case"<=":return n<=i;case"<":return n=":return n>=i;case">":return n>i;case"!=":return n!==i;case"regex":return n.match(i);default:return!1}},gt=function(t){ct(window,"haptic",t)},yt=function(t,e,i){void 0===i&&(i=!1),i?history.replaceState(null,"",e):history.pushState(null,"",e),ct(window,"location-changed",{replace:i})},vt=function(t,e,i){void 0===i&&(i=!0);var n,r=H(e),o="group"===r?"homeassistant":r;switch(r){case"lock":n=i?"unlock":"lock";break;case"cover":n=i?"open_cover":"close_cover";break;default:n=i?"turn_on":"turn_off"}return t.callService(o,n,{entity_id:e})},_t=function(t,e){var i=nt.includes(t.states[e].state);return vt(t,e,i)},bt=function(t,e,i,n){if(n||(n={action:"more-info"}),!n.confirmation||n.confirmation.exemptions&&n.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||(gt("warning"),confirm(n.confirmation.text||"Are you sure you want to "+n.action+"?")))switch(n.action){case"more-info":(i.entity||i.camera_image)&&ct(t,"hass-more-info",{entityId:i.entity?i.entity:i.camera_image});break;case"navigate":n.navigation_path&&yt(0,n.navigation_path);break;case"url":n.url_path&&window.open(n.url_path);break;case"toggle":i.entity&&(_t(e,i.entity),gt("success"));break;case"call-service":if(!n.service)return void gt("failure");var r=n.service.split(".",2);e.callService(r[0],r[1],n.service_data,n.target),gt("success");break;case"fire-dom-event":ct(t,"ll-custom",n)}},wt=function(t,e,i,n){var r;"double_tap"===n&&i.double_tap_action?r=i.double_tap_action:"hold"===n&&i.hold_action?r=i.hold_action:"tap"===n&&i.tap_action&&(r=i.tap_action),bt(t,e,i,r)},$t=function(t,e,i,n,r){var o;if(r&&i.double_tap_action?o=i.double_tap_action:n&&i.hold_action?o=i.hold_action:!n&&i.tap_action&&(o=i.tap_action),o||(o={action:"more-info"}),!o.confirmation||o.confirmation.exemptions&&o.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||confirm(o.confirmation.text||"Are you sure you want to "+o.action+"?"))switch(o.action){case"more-info":(o.entity||i.entity||i.camera_image)&&(ct(t,"hass-more-info",{entityId:o.entity?o.entity:i.entity?i.entity:i.camera_image}),o.haptic&>(o.haptic));break;case"navigate":o.navigation_path&&(yt(0,o.navigation_path),o.haptic&>(o.haptic));break;case"url":o.url_path&&window.open(o.url_path),o.haptic&>(o.haptic);break;case"toggle":i.entity&&(_t(e,i.entity),o.haptic&>(o.haptic));break;case"call-service":if(!o.service)return;var a=o.service.split(".",2),s=a[0],c=a[1],l=U({},o.service_data);"entity"===l.entity_id&&(l.entity_id=i.entity),e.callService(s,c,l,o.target),o.haptic&>(o.haptic);break;case"fire-dom-event":ct(t,"ll-custom",o),o.haptic&>(o.haptic)}};function At(t){return void 0!==t&&"none"!==t.action}function Et(t,e,i){if(e.has("config")||i)return!0;if(t.config.entity){var n=e.get("hass");return!n||n.states[t.config.entity]!==t.hass.states[t.config.entity]}return!1}function St(t){return void 0!==t&&"none"!==t.action}var Tt=function(t,e,i){void 0===i&&(i=!0);var n={};e.forEach((function(e){if(nt.includes(t.states[e].state)===i){var r=H(e),o=["cover","lock"].includes(r)?r:"homeassistant";o in n||(n[o]=[]),n[o].push(e)}})),Object.keys(n).forEach((function(e){var r;switch(e){case"lock":r=i?"unlock":"lock";break;case"cover":r=i?"open_cover":"close_cover";break;default:r=i?"turn_on":"turn_off"}t.callService(e,r,{entity_id:n[e]})}))},Ot=function(){var t=document.querySelector("home-assistant");if(t=(t=(t=(t=(t=(t=(t=(t=t&&t.shadowRoot)&&t.querySelector("home-assistant-main"))&&t.shadowRoot)&&t.querySelector("app-drawer-layout partial-panel-resolver"))&&t.shadowRoot||t)&&t.querySelector("ha-panel-lovelace"))&&t.shadowRoot)&&t.querySelector("hui-root")){var e=t.lovelace;return e.current_view=t.___curView,e}return null},Ct={humidity:"mdi:water-percent",illuminance:"mdi:brightness-5",temperature:"mdi:thermometer",pressure:"mdi:gauge",power:"mdi:flash",signal_strength:"mdi:wifi"},kt={binary_sensor:function(t,e){var i="off"===t;switch(null==e?void 0:e.attributes.device_class){case"battery":return i?"mdi:battery":"mdi:battery-outline";case"battery_charging":return i?"mdi:battery":"mdi:battery-charging";case"cold":return i?"mdi:thermometer":"mdi:snowflake";case"connectivity":return i?"mdi:server-network-off":"mdi:server-network";case"door":return i?"mdi:door-closed":"mdi:door-open";case"garage_door":return i?"mdi:garage":"mdi:garage-open";case"power":case"plug":return i?"mdi:power-plug-off":"mdi:power-plug";case"gas":case"problem":case"safety":case"tamper":return i?"mdi:check-circle":"mdi:alert-circle";case"smoke":return i?"mdi:check-circle":"mdi:smoke";case"heat":return i?"mdi:thermometer":"mdi:fire";case"light":return i?"mdi:brightness-5":"mdi:brightness-7";case"lock":return i?"mdi:lock":"mdi:lock-open";case"moisture":return i?"mdi:water-off":"mdi:water";case"motion":return i?"mdi:walk":"mdi:run";case"occupancy":case"presence":return i?"mdi:home-outline":"mdi:home";case"opening":return i?"mdi:square":"mdi:square-outline";case"running":return i?"mdi:stop":"mdi:play";case"sound":return i?"mdi:music-note-off":"mdi:music-note";case"update":return i?"mdi:package":"mdi:package-up";case"vibration":return i?"mdi:crop-portrait":"mdi:vibrate";case"window":return i?"mdi:window-closed":"mdi:window-open";default:return i?"mdi:radiobox-blank":"mdi:checkbox-marked-circle"}},cover:function(t){var e="closed"!==t.state;switch(t.attributes.device_class){case"garage":return e?"mdi:garage-open":"mdi:garage";case"door":return e?"mdi:door-open":"mdi:door-closed";case"shutter":return e?"mdi:window-shutter-open":"mdi:window-shutter";case"blind":return e?"mdi:blinds-open":"mdi:blinds";case"window":return e?"mdi:window-open":"mdi:window-closed";default:return pt("cover",t.state)}},sensor:function(t){var e=t.attributes.device_class;if(e&&e in Ct)return Ct[e];if("battery"===e){var i=Number(t.state);if(isNaN(i))return"mdi:battery-unknown";var n=10*Math.round(i/10);return n>=100?"mdi:battery":n<=0?"mdi:battery-alert":"hass:battery-"+n}var r=t.attributes.unit_of_measurement;return"°C"===r||"°F"===r?"mdi:thermometer":pt("sensor")},input_datetime:function(t){return t.attributes.has_date?t.attributes.has_time?pt("input_datetime"):"mdi:calendar":"mdi:clock"}},Dt=function(t){if(!t)return"mdi:bookmark";if(t.attributes.icon)return t.attributes.icon;var e=H(t.entity_id);return e in kt?kt[e](t):pt(e,t.state)}},22:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.actionHandler=e.actionHandlerBind=void 0;const n=i(3),r=i(41),o=i(313),a="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.maxTouchPoints>0;class s extends HTMLElement{constructor(){super(),this.holdTime=500,this.held=!1,this.ripple=document.createElement("mwc-ripple")}connectedCallback(){Object.assign(this.style,{position:"absolute",width:a?"100px":"50px",height:a?"100px":"50px",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:"999"}),this.appendChild(this.ripple),this.ripple.primary=!0,["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach((t=>{document.addEventListener(t,(()=>{clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0}),{passive:!0})}))}bind(t,e){if(t.actionHandler)return;t.actionHandler=!0,t.addEventListener("contextmenu",(t=>{const e=t||window.event;return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.returnValue=!1,!1}));const i=t=>{let e,i;this.held=!1,t.touches?(e=t.touches[0].pageX,i=t.touches[0].pageY):(e=t.pageX,i=t.pageY),this.timer=window.setTimeout((()=>{this.startAnimation(e,i),this.held=!0}),this.holdTime)},n=i=>{i.preventDefault(),["touchend","touchcancel"].includes(i.type)&&void 0===this.timer||(clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0,this.held?(0,o.fireEvent)(t,"action",{action:"hold"}):e.hasDoubleClick?"click"===i.type&&i.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout((()=>{this.dblClickTimeout=void 0,(0,o.fireEvent)(t,"action",{action:"tap"})}),250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,(0,o.fireEvent)(t,"action",{action:"double_tap"})):(0,o.fireEvent)(t,"action",{action:"tap"}))};t.addEventListener("touchstart",i,{passive:!0}),t.addEventListener("touchend",n),t.addEventListener("touchcancel",n),t.addEventListener("mousedown",i,{passive:!0}),t.addEventListener("click",n),t.addEventListener("keyup",(t=>{13===t.keyCode&&n(t)}))}startAnimation(t,e){Object.assign(this.style,{left:`${t}px`,top:`${e}px`,display:null}),this.ripple.disabled=!1,this.ripple.active=!0,this.ripple.unbounded=!0}stopAnimation(){this.ripple.active=!1,this.ripple.disabled=!0,this.style.display="none"}}customElements.define("action-handler-roomcard",s),e.actionHandlerBind=(t,e)=>{const i=(()=>{const t=document.body;if(t.querySelector("action-handler-roomcard"))return t.querySelector("action-handler-roomcard");const e=document.createElement("action-handler-roomcard");return t.appendChild(e),e})();i&&i.bind(t,e)},e.actionHandler=(0,r.directive)(class extends r.Directive{update(t,[i]){return(0,e.actionHandlerBind)(t.element,i),n.noChange}render(t){}})},184:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extractValue=e.renderRows=e.renderEntity=e.renderEntitiesRow=e.renderInfoEntity=e.renderTitle=e.clickHandler=e.renderMainEntity=e.renderValue=e.renderIcon=e.entityStyles=e.entityStateDisplay=e.renderCustomStateIcon=e.renderConditionIcons=e.entityIcon=e.entityName=e.computeEntity=e.checkConfig=void 0;const n=i(671),r=i(621),o=i(249),a=i(693),s=i(313),c=i(3),l=i(198),u=i(870),d=i(883),m=i(22);e.checkConfig=t=>{if(null==t.entities&&null==t.entity&&void 0===t.info_entities&&void 0===t.rows&&void 0===t.cards)throw new Error("Please define entities.")},e.computeEntity=t=>t.substr(t.indexOf(".")+1),e.entityName=(t,i)=>(0,u.getTemplateOrAttribute)(t.name,i,t.stateObj)||(t.entity?t.stateObj.attributes.friendly_name||(0,e.computeEntity)(t.stateObj.entity_id):null)||null,e.entityIcon=(t,i,n)=>{var r;if("icon"in i&&(void 0===i.show_icon||!1===i.show_icon))throw new Error(`Entity: ${i.entity} => Icon defined but show_icon is set to false or not defined. Please set show_icon to true`);return"icon"in i?"string"==typeof i.icon?i.icon:i.icon.state_on?(0,e.renderCustomStateIcon)(t,i.icon):i.icon.conditions?(0,e.renderConditionIcons)(t,i,n):(null===(r=i.icon.template)||void 0===r?void 0:r.icon)?(0,a.evalTemplate)(n,t,i.icon.template.icon):void 0:t.attributes.icon||null},e.renderConditionIcons=(t,e,i)=>{const n=t.state;return e.icon.conditions.filter((e=>{let r=n;if(e.entity){const t=i.states[e.entity];r=e.attribute?t.attributes[e.attribute]:t.state}return e.attribute&&!e.entity&&(r=t.attributes[e.attribute]),(0,a.checkConditionalValue)(e,r)})).pop()},e.renderCustomStateIcon=(t,e)=>{switch((0,o.computeStateDomain)(t)){case"light":case"switch":case"binary_sensor":case"input_boolean":return"on"===t.state?e.state_on:e.state_off}},e.entityStateDisplay=(t,i)=>{if((0,a.isUnavailable)(i.stateObj))return t.localize(`state.default.${i.stateObj.state}`);let n=(0,a.getValue)(i),s=void 0!==i.attribute?i.unit:i.unit||i.stateObj.attributes.unit_of_measurement;if(i.format)return({value:n,unit:s}=(0,e.extractValue)(i,n,t,s)),`${n}${s?` ${s}`:""}`;if(i.attribute)return`${isNaN(n)?n:(0,r.formatNumber)(n,t.locale)}${s?` ${s}`:""}`;const c=Object.assign(Object.assign({},i.stateObj),{attributes:Object.assign(Object.assign({},i.stateObj.attributes),{unit_of_measurement:s})});return(0,o.computeStateDisplay)(t.localize,c,t.locale)},e.entityStyles=(t,e,i)=>{if(!t)return"";if("template"in t){const n=t;return(0,a.evalTemplate)(i,e,n.template)}const n=t;return Object.keys(n).map((t=>`${t}: ${n[t]};`)).join("")},e.renderIcon=(t,i,n,r)=>{if(void 0!==i.show_icon&&!1===i.show_icon)return null;const o=(0,e.entityIcon)(t,i,n),s=(0,u.templateStyling)(t,i,n);return c.html``},e.renderValue=(t,i)=>{if(!0===t.toggle)return c.html``;if(!0===t.show_icon)return(0,e.renderIcon)(t.stateObj,t,i);if(t.attribute&&[l.LAST_CHANGED,l.LAST_UPDATED].includes(t.attribute))return c.html``;if(t.format&&l.TIMESTAMP_FORMATS.includes(t.format)){const e=(0,a.getValue)(t),n=new Date(e);return n instanceof Date&&!isNaN(n.getTime())?c.html``:e}return(0,e.entityStateDisplay)(i,t)},e.renderMainEntity=(t,i,n)=>{var r;if(void 0===t)return null;const o=n.states[t.entity];return c.html`
${0===(null===(r=i.entities)||void 0===r?void 0:r.length)||i.icon?(0,e.renderIcon)(t.stateObj,i,n,"main-icon"):void 0!==t.show_state&&!1===t.show_state?"":(0,e.renderValue)(t,n)}
`},e.clickHandler=(t,e,i,n)=>{(0,s.handleAction)(t,e,i,n.detail.action)},e.renderTitle=(t,i,n,r)=>{if(!0===t.hide_title)return null;const o=void 0!==t.tap_action||void 0!==t.double_tap_action,a=(0,u.getTemplateOrAttribute)(t.title,i,null==r?void 0:r.stateObj);return c.html`
${(0,e.renderMainEntity)(r,t,i)} ${a}
`},e.renderInfoEntity=(t,i,n)=>void 0===t||!t.stateObj||(0,d.hideIfEntity)(t,i)?null:c.html`
${(0,e.renderValue)(t,i)}
`,e.renderEntitiesRow=(t,i,n,r,o)=>void 0===i?null:c.html`
${i.map((t=>(0,e.renderEntity)(t,n,r)))}
`,e.renderEntity=(t,i,n)=>null==t.stateObj||(0,d.hideIfEntity)(t,i)?null:c.html`
${void 0===t.show_name||t.show_name?c.html`${(0,e.entityName)(t,i)}`:""}
${(0,e.renderIcon)(t.stateObj,t,i)}
${t.show_state?c.html`${(0,e.entityStateDisplay)(i,t)}`:""}
`,e.renderRows=(t,i,n)=>{const r=t.filter((t=>!(0,d.hideIfRow)(t,i)));return c.html`${r.map((t=>(0,e.renderEntitiesRow)(t,t.entities,i,n)))}`},e.extractValue=(t,e,i,o)=>{if(t.format.startsWith("precision")){const n=parseInt(t.format.slice(-1),10);e=(0,r.formatNumber)(e,i.locale,{minimumFractionDigits:n,maximumFractionDigits:n})}else isNaN(parseFloat(e))||!isFinite(e)||("brightness"===t.format?(e=Math.round(e/255*100),o="%"):t.format.startsWith("duration")?(e=(0,n.secondsToDuration)("duration-m"===t.format?e/1e3:e),o=void 0):"kilo"===t.format?e=(0,r.formatNumber)(e/1e3,i.locale,{maximumFractionDigits:2}):"invert"===t.format?e=(0,r.formatNumber)(e-2*e,i.locale):"position"===t.format&&(e=(0,r.formatNumber)(100-e,i.locale)));return{value:e,unit:o}}},883:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.hideIfEntity=e.hideIfRow=e.hideIfCard=e.hideUnavailable=void 0;const n=i(693);e.hideUnavailable=t=>t.hide_unavailable&&(0,n.isUnavailable)(t.stateObj),e.hideIfCard=(t,e)=>{var i,r;if(void 0===t.hide_if)return!1;if(t.hide_if){const o=null===(i=e.states[t.entity])||void 0===i?void 0:i.state,a=null===(r=t.hide_if.conditions)||void 0===r?void 0:r.filter((i=>{let r=o;if(i.entity){const t=e.states[i.entity];r=i.attribute?t.attributes[i.attribute]:t.state}return i.attribute&&!i.entity&&(r=e.states[t.entity].attributes[i.attribute]),(0,n.checkConditionalValue)(i,r)}));return(null==a?void 0:a.length)>0}},e.hideIfRow=(t,e)=>{var i;if(void 0===t.hide_if)return!1;if(t.hide_if){const r=null===(i=t.hide_if.conditions)||void 0===i?void 0:i.filter((t=>{if(t.entity){const i=e.states[t.entity];return(0,n.checkConditionalValue)(t,t.attribute?i.attributes[t.attribute]:i.state)}}));return(null==r?void 0:r.length)>0}},e.hideIfEntity=(t,i)=>{var r;if((0,e.hideUnavailable)(t))return!0;if(void 0===t.hide_if)return!1;if(t.hide_if){const e=t.stateObj.state,o=null===(r=t.hide_if.conditions)||void 0===r?void 0:r.filter((r=>{let o=e;if(r.entity){const t=i.states[r.entity];o=r.attribute?t.attributes[r.attribute]:t.state}return r.attribute&&!r.entity&&(o=t.stateObj.attributes[r.attribute]),(0,n.checkConditionalValue)(r,o)}));return(null==o?void 0:o.length)>0}}},148:function(t,e,i){var n=this&&this.__decorate||function(t,e,i,n){var r,o=arguments.length,a=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,i,a):r(e,i))||a);return o>3&&a&&Object.defineProperty(e,i,a),a},r=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const o=i(3),a=i(515),s=i(313),c=i(184),l=i(693),u=i(883),d=i(278),m=i(147);console.info(`%c ROOM-CARD %c ${m.version}`,"color: cyan; background: black; font-weight: bold;","color: darkblue; background: white; font-weight: bold;"),window.customCards=window.customCards||[],window.customCards.push({type:"room-card",name:"Room card",preview:!1,description:"Show multiple entity states, attributes and icons in a single card in Home Assistant's Lovelace UI"});let h=class extends o.LitElement{constructor(){super(...arguments),this.monitoredStates={}}getChildCustomCardTypes(t,e){if(t)for(const i of t)0===i.type.indexOf("custom:")&&e.add(i.type.substring(7,i.type.length)),this.getChildCustomCardTypes(i.cards,e)}waitForDependentComponents(t){return r(this,void 0,void 0,(function*(){const e=new Set;this.getChildCustomCardTypes(t.cards,e),yield Promise.all(Array.from(e).map((t=>customElements.whenDefined(t))))}))}shouldUpdate(t){return void 0!==this.monitoredStates&&void 0!==this.config&&t.size>0&&void 0!==this._helpers&&void 0!==this._helpers.createCardElement}updateMonitoredStates(t){const e=Object.assign({},this.monitoredStates);let i=!1;for(const n of this.config.entityIds)if(n in t.states){const r=this.monitoredStates&&this.monitoredStates[n];(!this.monitoredStates||(null==r?void 0:r.last_updated)
${(0,c.renderTitle)(this.config,this._hass,this,e)}
${i.map((t=>(0,c.renderInfoEntity)(t,this._hass,this)))}
${void 0!==r&&r.length>0?(0,c.renderRows)(r,this._hass,this):(0,c.renderEntitiesRow)(this.config,n,this._hass,this)} ${null===(t=this.config.cards)||void 0===t?void 0:t.map((t=>this.createCardElement(t,this._hass)))}`}catch(t){return o.html`${t.toString()}`}}getCardSize(){const t=this.config.cards?this.config.cards.length:0,e=this.config.rows?this.config.rows.length:0,i=!this.config.info_entities&&this.config.hide_title?1:2;return t+e+(this.config.entities&&this.config.entities.length>0?1:0)+i}createCardElement(t,e){if((0,u.hideIfCard)(t,e)||t.show_states&&!t.show_states.includes(e.states[t.entity].state))return null;let i;return i=this._helpers?this._helpers.createCardElement(t):(0,s.createThing)(t),i.hass=e,i.style.boxShadow="none",i.style.borderRadius="0",i}};n([(0,a.property)()],h.prototype,"monitoredStates",void 0),n([(0,a.property)()],h.prototype,"_helpers",void 0),n([(0,a.property)()],h.prototype,"_hass",void 0),n([(0,a.property)()],h.prototype,"config",void 0),h=n([(0,a.customElement)("room-card")],h),e.default=h},249:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.computeStateDisplay=e.computeStateDomain=void 0;const n=i(198),r=i(300),o=i(141),a=i(599),s=i(621);e.computeStateDomain=t=>t.entity_id.substr(0,t.entity_id.indexOf(".")),e.computeStateDisplay=(t,i,c,l)=>{const u=void 0!==l?l:i.state;if(u===n.UNKNOWN||u===n.UNAVAILABLE)return t(`state.default.${u}`);if((0,s.isNumericState)(i)){if("monetary"===i.attributes.device_class)try{return(0,s.formatNumber)(u,c,{style:"currency",currency:i.attributes.unit_of_measurement})}catch(t){}return`${(0,s.formatNumber)(u,c)}${i.attributes.unit_of_measurement?" "+i.attributes.unit_of_measurement:""}`}const d=(0,e.computeStateDomain)(i);if("input_datetime"===d){if(void 0===l){let t;return i.attributes.has_date&&i.attributes.has_time?(t=new Date(i.attributes.year,i.attributes.month-1,i.attributes.day,i.attributes.hour,i.attributes.minute),(0,o.formatDateTime)(t,c)):i.attributes.has_date?(t=new Date(i.attributes.year,i.attributes.month-1,i.attributes.day),(0,r.formatDate)(t,c)):i.attributes.has_time?(t=new Date,t.setHours(i.attributes.hour,i.attributes.minute),(0,a.formatTime)(t,c)):i.state}try{const t=l.split(" ");if(2===t.length)return(0,o.formatDateTime)(new Date(t.join("T")),c);if(1===t.length){if(l.includes("-"))return(0,r.formatDate)(new Date(`${l}T00:00`),c);if(l.includes(":")){const t=new Date;return(0,a.formatTime)(new Date(`${t.toISOString().split("T")[0]}T${l}`),c)}}return l}catch(t){return l}}return"humidifier"===d&&"on"===u&&i.attributes.humidity?`${i.attributes.humidity} %`:"counter"===d||"number"===d||"input_number"===d?(0,s.formatNumber)(u,c):"button"===d||"sensor"===d&&"timestamp"===i.attributes.device_class?(0,o.formatDateTime)(new Date(u),c):i.attributes.device_class&&t(`component.${d}.state.${i.attributes.device_class}.${u}`)||t(`component.${d}.state._.${u}`)||u}},198:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TimeFormat=e.NumberFormat=e.SECONDARY_INFO_VALUES=e.TIMESTAMP_FORMATS=e.LAST_UPDATED=e.LAST_CHANGED=e.UNAVAILABLE_STATES=e.UNKNOWN=e.UNAVAILABLE=void 0,e.UNAVAILABLE="unavailable",e.UNKNOWN="unknown",e.UNAVAILABLE_STATES=[e.UNAVAILABLE,e.UNKNOWN],e.LAST_CHANGED="last-changed",e.LAST_UPDATED="last-updated",e.TIMESTAMP_FORMATS=["relative","total","date","time","datetime"],e.SECONDARY_INFO_VALUES=["entity-id","last-changed","last-updated","last-triggered","position","tilt-position","brightness"],e.NumberFormat={language:"language",system:"system",comma_decimal:"comma_decimal",decimal_comma:"decimal_comma",space_comma:"space_comma",none:"none"},e.TimeFormat={language:"language",system:"system",am_pm:"12",twenty_four:"24"}},300:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatDate=void 0,e.formatDate=(t,e)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric"}).format(t)},141:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatDateTime=void 0;const n=i(975);e.formatDateTime=(t,e)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,n.useAmPm)(e)?"numeric":"2-digit",minute:"2-digit",hour12:(0,n.useAmPm)(e)}).format(t)},621:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNumber=e.numberFormatToLocale=e.isNumericState=e.round=void 0;const n=i(198);e.round=(t,e=2)=>Math.round(t*Math.pow(10,e))/Math.pow(10,e),e.isNumericState=t=>!!t.attributes.unit_of_measurement||!!t.attributes.state_class,e.numberFormatToLocale=t=>{switch(t.number_format){case n.NumberFormat.comma_decimal:return["en-US","en"];case n.NumberFormat.decimal_comma:return["de","es","it"];case n.NumberFormat.space_comma:return["fr","sv","cs"];case n.NumberFormat.system:return;default:return t.language}},e.formatNumber=(t,i,o)=>{const a=i?(0,e.numberFormatToLocale)(i):void 0;if((null==i?void 0:i.number_format)!==n.NumberFormat.none&&!Number.isNaN(Number(t))&&Intl)try{return new Intl.NumberFormat(a,r(t,o)).format(Number(t))}catch(e){return console.error(e),new Intl.NumberFormat(void 0,r(t,o)).format(Number(t))}return"string"==typeof t?t:`${(0,e.round)(t,null==o?void 0:o.maximumFractionDigits).toString()}${"currency"===(null==o?void 0:o.style)?` ${o.currency}`:""}`};const r=(t,e)=>Object.assign({maximumFractionDigits:2},e)},599:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatTime=void 0;const n=i(975);e.formatTime=(t,e)=>new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",hour12:(0,n.useAmPm)(e)}).format(t)},671:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.secondsToDuration=void 0;const i=t=>t<10?`0${t}`:t;e.secondsToDuration=function(t){const e=Math.floor(t/3600),n=Math.floor(t%3600/60),r=Math.floor(t%3600%60);return e>0?`${e}:${i(n)}:${i(r)}`:n>0?`${n}:${i(r)}`:r>0?""+r:null}},975:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.useAmPm=void 0;const n=i(198);e.useAmPm=t=>{if(t.time_format===n.TimeFormat.language||t.time_format===n.TimeFormat.system){const e=t.time_format===n.TimeFormat.language?t.language:void 0,i=(new Date).toLocaleString(e);return i.includes("AM")||i.includes("PM")}return t.time_format===n.TimeFormat.am_pm}},278:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.style=void 0;const n=i(3);e.style=n.css`ha-card{display:flex;flex-direction:column}ha-card .card-header{padding-bottom:0}.icon-small{display:inline-block}.entity{text-align:center;cursor:pointer}.entity span{font-size:10px}.entities-row{flex-direction:row;flex-wrap:wrap;display:inline-flex;align-items:center;padding:0 20px 10px 20px}.entities-row .entity{margin-right:16px}.entities-info-row .entity:last-of-type,.entities-row .entity:last-of-type{margin-right:0}.entities-column{flex-direction:column;display:flex;align-items:flex-end;justify-content:space-evenly}.entities-column .entity div{display:inline-block;vertical-align:middle}.entities-info-row{flex-direction:row;flex-wrap:wrap;display:inline-flex;justify-content:center;align-items:center;padding:0 20px 10px 20px;font-size:12px;position:absolute;right:20px;top:15px}.entities-info-row .entity{margin-right:16px}.entities-info-row .entity.icon-entity{margin-right:0}.main-state{float:left;margin-right:10px}.main-state>ha-state-icon>ha-svg-icon{vertical-align:baseline}.main-icon{vertical-align:baseline;font-size:30px}.title{min-height:48px}.clickable{cursor:pointer}.content-left{justify-content:left}.content-center{justify-content:center}.content-right{justify-content:right}`},870:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getTemplateOrAttribute=e.mapTemplate=e.templateStyling=void 0;const n=i(693);e.templateStyling=(t,e,i)=>{var r;const o=e.icon;return void 0!==(null===(r=null==o?void 0:o.template)||void 0===r?void 0:r.styles)?(0,n.evalTemplate)(i,t,o.template.styles):null},e.mapTemplate=(t,e)=>{if(void 0!==t&&t.template){const i=e.templates.filter((e=>e.name===t.template));if(i.length>0){const e=i[0];return Object.assign(Object.assign({stateObj:t.stateObj},t),e.template)}}return t},e.getTemplateOrAttribute=(t,e,i)=>t&&"object"==typeof t&&"template"in t?(0,n.evalTemplate)(e,i,t.template):t},693:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.parseConfig=e.renderClasses=e.evalTemplate=e.mapStateObject=e.checkConditionalValue=e.hasConfigOrEntitiesChanged=e.getCardEntities=e.getConditionEntitiesFromConfig=e.getConditionEntities=e.getEntity=e.getEntityIds=e.getValue=e.isUnavailable=e.isObject=void 0;const n=i(3),r=i(198),o=i(870);e.isObject=t=>"object"==typeof t&&!Array.isArray(t)&&!!t,e.isUnavailable=t=>!t||r.UNAVAILABLE_STATES.includes(t.state),e.getValue=t=>{if(t.attribute&&void 0===t.stateObj.attributes[t.attribute])throw new Error(`Entity: '${t.entity}' has no attribute named '${t.attribute}'`);return t.attribute?t.stateObj.attributes[t.attribute]:t.stateObj.state},e.getEntityIds=t=>{var i,n,r,o;return[t.entity].concat(null===(i=t.entities)||void 0===i?void 0:i.map((t=>(0,e.getEntity)(t)))).concat(null===(n=t.info_entities)||void 0===n?void 0:n.map((t=>(0,e.getEntity)(t)))).concat(null===(r=t.rows)||void 0===r?void 0:r.flatMap((t=>t.entities)).map((t=>(0,e.getEntity)(t)))).concat(null===(o=t.cards)||void 0===o?void 0:o.flatMap((t=>(0,e.getCardEntities)(t)))).concat((0,e.getConditionEntitiesFromConfig)(t)).filter((t=>t))},e.getEntity=t=>void 0===t?null:"string"==typeof t?t:t.entity,e.getConditionEntities=t=>{let e=[];return null==t||t.forEach((t=>{var i,n,r,o;const a=null===(n=null===(i=null==t?void 0:t.icon)||void 0===i?void 0:i.conditions)||void 0===n?void 0:n.filter((t=>void 0!==t.entity));a&&(e=e.concat(a));const s=null===(o=null===(r=null==t?void 0:t.hide_if)||void 0===r?void 0:r.conditions)||void 0===o?void 0:o.filter((t=>void 0!==t.entity));s&&(e=e.concat(s))})),e},e.getConditionEntitiesFromConfig=t=>{var i;const n=[t.entities,t.info_entities,null===(i=t.rows)||void 0===i?void 0:i.flatMap((t=>t.entities))];return(0,e.getConditionEntities)(n.flatMap((t=>t))).filter((t=>t.entity)).map((t=>t.entity))},e.getCardEntities=t=>{var i,n;return[(0,e.getEntity)(t.entity)].concat(null===(i=t.cards)||void 0===i?void 0:i.flatMap((t=>(0,e.getCardEntities)(t)))).concat(null===(n=t.entities)||void 0===n?void 0:n.flatMap((t=>(0,e.getEntity)(t)))).filter((t=>t))},e.hasConfigOrEntitiesChanged=(t,e)=>{if(e.has("config"))return!0;const i=e.get("_hass");return!!i&&t.entityIds.some((e=>i.states[e]!==t.hass.states[e]))},e.checkConditionalValue=(t,e)=>{const i="boolean"==typeof t.value?String(t.value):t.value;return"equals"==t.condition&&e==i||"not_equals"==t.condition&&e!=i||"above"==t.condition&&e>i||"below"==t.condition&&e{let n="string"==typeof t?{entity:t}:t;return n=(0,o.mapTemplate)(n,i),Object.assign(Object.assign({},n),{stateObj:e.states[n.entity]})},e.evalTemplate=(t,e,i)=>{try{return new Function("states","entity","user","hass","html",`'use strict'; ${i}`).call(this,null==t?void 0:t.states,e,null==t?void 0:t.user,t,n.html)}catch(t){const e=i.length<=100?i.trim():`${i.trim().substring(0,98)}...`;throw t.message=`${t.name}: ${t.message} in '${e}'`,t.name="RoomCardJSTemplateError",t}},e.renderClasses=(t,e)=>`entities-row ${t.content_alignment?`content-${t.content_alignment}`:"content-left"}${void 0!==e?` ${e}`:""}`,e.parseConfig=(t,i)=>{var n,r,o,a,s,c;const l={info_entities:[],entities:[]};return i&&t?(l.stateObj=void 0!==t.entity?i.states[t.entity]:void 0,l.entity=void 0!==t.entity?Object.assign(Object.assign({},t),{stateObj:l.stateObj}):void 0,l.info_entities=null!==(r=null===(n=t.info_entities)||void 0===n?void 0:n.map((n=>(0,e.mapStateObject)(n,i,t))))&&void 0!==r?r:[],l.entities=null!==(a=null===(o=t.entities)||void 0===o?void 0:o.map((n=>(0,e.mapStateObject)(n,i,t))))&&void 0!==a?a:[],l.rows=null!==(c=null===(s=t.rows)||void 0===s?void 0:s.map((n=>{var r;return{entities:null===(r=n.entities)||void 0===r?void 0:r.map((n=>(0,e.mapStateObject)(n,i,t))),hide_if:n.hide_if,content_alignment:n.content_alignment}})))&&void 0!==c?c:[],t.hass=i,l):l}},805:(t,e,i)=>{i.d(e,{c3:()=>s,fl:()=>T,ec:()=>u,iv:()=>l,Ts:()=>A,i1:()=>d,Qu:()=>E,FV:()=>r,$m:()=>c});const n=globalThis,r=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),a=new WeakMap;class s{constructor(t,e,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(r&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=a.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&a.set(e,t))}return t}toString(){return this.cssText}}const c=t=>new s("string"==typeof t?t:t+"",void 0,o),l=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new s(i,t,o)},u=(t,e)=>{if(r)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),r=n.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=i.cssText,t.appendChild(e)}},d=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return c(e)})(t):t,{is:m,defineProperty:h,getOwnPropertyDescriptor:p,getOwnPropertyNames:f,getOwnPropertySymbols:g,getPrototypeOf:y}=Object,v=globalThis,_=v.trustedTypes,b=_?_.emptyScript:"",w=v.reactiveElementPolyfillSupport,$=(t,e)=>t,A={toAttribute(t,e){switch(e){case Boolean:t=t?b:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},E=(t,e)=>!m(t,e),S={attribute:!0,type:String,converter:A,reflect:!1,hasChanged:E};Symbol.metadata??=Symbol("metadata"),v.litPropertyMetadata??=new WeakMap;class T extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=S){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(t,i,e);void 0!==n&&h(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){const{get:n,set:r}=p(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return n?.call(this)},set(e){const o=n?.call(this);r.call(this,e),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??S}static _$Ei(){if(this.hasOwnProperty($("elementProperties")))return;const t=y(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty($("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty($("properties"))){const t=this.properties,e=[...f(t),...g(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(d(t))}else void 0!==t&&e.push(d(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$ES(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$E_??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$E_?.delete(t)}_$ES(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return u(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$E_?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$E_?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e){const i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(void 0!==n&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:A).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,n=i._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=i.getPropertyOptions(n),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:A;this._$Em=n,this[n]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,i,n=!1,r){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??E)(n?r:this[t],e))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t)!0!==i.wrapped||this._$AL.has(e)||void 0===this[e]||this.C(e,this[e],i)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$E_?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$ET()}catch(e){throw t=!1,this._$ET(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$E_?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EO(t,this[t]))),this._$ET()}updated(t){}firstUpdated(t){}}T.elementStyles=[],T.shadowRootOptions={mode:"open"},T[$("elementProperties")]=new Map,T[$("finalized")]=new Map,w?.({ReactiveElement:T}),(v.reactiveElementVersions??=[]).push("2.0.2")},515:(t,e,i)=>{i.r(e),i.d(e,{customElement:()=>n,eventOptions:()=>l,property:()=>s,query:()=>d,queryAll:()=>h,queryAssignedElements:()=>f,queryAssignedNodes:()=>g,queryAsync:()=>p,standardProperty:()=>a,state:()=>c});const n=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};var r=i(805);const o={attribute:!0,type:String,converter:r.Ts,reflect:!1,hasChanged:r.Qu},a=(t=o,e,i)=>{const{kind:n,metadata:r}=i;let a=globalThis.litPropertyMetadata.get(r);if(void 0===a&&globalThis.litPropertyMetadata.set(r,a=new Map),a.set(i.name,t),"accessor"===n){const{name:n}=i;return{set(i){const r=e.get.call(this);e.set.call(this,i),this.requestUpdate(n,r,t)},init(e){return void 0!==e&&this.C(n,void 0,t),e}}}if("setter"===n){const{name:n}=i;return function(i){const r=this[n];e.call(this,i),this.requestUpdate(n,r,t)}}throw Error("Unsupported decorator location: "+n)};function s(t){return(e,i)=>"object"==typeof i?a(t,e,i):((t,e,i)=>{const n=e.hasOwnProperty(i);return e.constructor.createProperty(i,n?{...t,wrapped:!0}:t),n?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}function c(t){return s({...t,state:!0,attribute:!1})}function l(t){return(e,i)=>{const n="function"==typeof e?e:e[i];Object.assign(n,t)}}const u=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i);function d(t,e){return(i,n,r)=>{const o=e=>e.renderRoot?.querySelector(t)??null;if(e){const{get:t,set:e}="object"==typeof n?i:r??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return u(i,n,{get(){let i=t.call(this);return void 0===i&&(i=o(this),(null!==i||this.hasUpdated)&&e.call(this,i)),i}})}return u(i,n,{get(){return o(this)}})}}let m;function h(t){return(e,i)=>u(e,i,{get(){return(this.renderRoot??(m??=document.createDocumentFragment())).querySelectorAll(t)}})}function p(t){return(e,i)=>u(e,i,{async get(){return await this.updateComplete,this.renderRoot?.querySelector(t)??null}})}function f(t){return(e,i)=>{const{slot:n,selector:r}=t??{},o="slot"+(n?`[name=${n}]`:":not([name])");return u(e,i,{get(){const e=this.renderRoot?.querySelector(o),i=e?.assignedElements(t)??[];return void 0===r?i:i.filter((t=>t.matches(r)))}})}}function g(t){return(e,i)=>{const{slot:n}=t??{},r="slot"+(n?`[name=${n}]`:":not([name])");return u(e,i,{get(){const e=this.renderRoot?.querySelector(r);return e?.assignedNodes(t)??[]}})}}},41:(t,e,i)=>{i.r(e),i.d(e,{Directive:()=>o,PartType:()=>n,directive:()=>r});const n={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},r=t=>(...e)=>({_$litDirective$:t,values:e});class o{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}},3:(t,e,i)=>{i.r(e),i.d(e,{CSSResult:()=>n.c3,LitElement:()=>B,ReactiveElement:()=>n.fl,_$LE:()=>Y,_$LH:()=>V,adoptStyles:()=>n.ec,css:()=>n.iv,defaultConverter:()=>n.Ts,getCompatibleStyle:()=>n.i1,html:()=>S,isServer:()=>K,noChange:()=>O,notEqual:()=>n.Qu,nothing:()=>C,render:()=>q,supportsAdoptingStyleSheets:()=>n.FV,svg:()=>T,unsafeCSS:()=>n.$m});var n=i(805);const r=globalThis,o=r.trustedTypes,a=o?o.createPolicy("lit-html",{createHTML:t=>t}):void 0,s="$lit$",c=`lit$${(Math.random()+"").slice(9)}$`,l="?"+c,u=`<${l}>`,d=document,m=()=>d.createComment(""),h=t=>null===t||"object"!=typeof t&&"function"!=typeof t,p=Array.isArray,f=t=>p(t)||"function"==typeof t?.[Symbol.iterator],g="[ \t\n\f\r]",y=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,b=RegExp(`>|${g}(?:([^\\s"'>=/]+)(${g}*=${g}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),w=/'/g,$=/"/g,A=/^(?:script|style|textarea|title)$/i,E=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),S=E(1),T=E(2),O=Symbol.for("lit-noChange"),C=Symbol.for("lit-nothing"),k=new WeakMap,D=d.createTreeWalker(d,129);function N(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==a?a.createHTML(e):e}const x=(t,e)=>{const i=t.length-1,n=[];let r,o=2===e?"":"",a=y;for(let e=0;e"===d[0]?(a=r??y,m=-1):void 0===d[1]?m=-2:(m=a.lastIndex-d[2].length,l=d[1],a=void 0===d[3]?b:'"'===d[3]?$:w):a===$||a===w?a=b:a===v||a===_?a=y:(a=b,r=void 0);const p=a===b&&t[e+1].startsWith("/>")?" ":"";o+=a===y?i+u:m>=0?(n.push(l),i.slice(0,m)+s+i.slice(m)+c+p):i+c+(-2===m?e:p)}return[N(t,o+(t[i]||"")+(2===e?"":"")),n]};class j{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,a=0;const u=t.length-1,d=this.parts,[h,p]=x(t,e);if(this.el=j.createElement(h,i),D.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=D.nextNode())&&d.length0){n.textContent=o?o.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=C}_$AI(t,e=this,i,n){const r=this.strings;let o=!1;if(void 0===r)t=M(this,t,e,0),o=!h(t)||t!==this._$AH&&t!==O,o&&(this._$AH=t);else{const n=t;let a,s;for(t=r[0],a=0;a{const n=i?.renderBefore??e;let r=n._$litPart$;if(void 0===r){const t=i?.renderBefore??null;n._$litPart$=r=new P(e.insertBefore(m(),t),t,void 0,i??{})}return r._$AI(t),r};class B extends n.fl{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=q(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return O}}B._$litElement$=!0,B.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:B});const W=globalThis.litElementPolyfillSupport;W?.({LitElement:B});const Y={_$AK:(t,e,i)=>{t._$AK(e,i)},_$AL:t=>t._$AL};(globalThis.litElementVersions??=[]).push("4.0.2");const K=!1},147:t=>{t.exports=JSON.parse('{"name":"room-card","version":"1.08.03","description":"Show entities in Home Assistant\'s Lovelace UI","keywords":["home-assistant","homeassistant","lovelace","custom-cards","multiple","entity","row"],"module":"room-card.js","license":"MIT","dependencies":{"babel-jest":"^29.6.4","custom-card-helpers":"^1.8.0","jest-environment-jsdom":"^29.5.0","jest-ts-auto-mock":"^2.1.0","lit":"^3.1.0","minify-html-literals-loader":"^1.1.1","ts-auto-mock":"3.5.0","ttypescript":"^1.5.13","yarn":"^1.22.18"},"devDependencies":{"@babel/core":"^7.23.5","@babel/plugin-transform-runtime":"^7.23.7","@babel/preset-env":"^7.23.7","@types/jest":"^29.5.10","@typescript-eslint/eslint-plugin":"^5.60.1","@typescript-eslint/parser":"^5.59.1","babel-loader":"^9.1.3","codecov":"^3.8.3","compression-webpack-plugin":"^10.0.0","eslint":"^8.56.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^4.0.0","jest":"^29.6.2","prettier":"^3.1.1","ts-jest":"^29.1.1","ts-loader":"^9.4.4","typescript":"^4.9.5","webpack":"^5.88.2","webpack-cli":"^5.0.2"},"scripts":{"lint":"eslint src/**/*.ts","dev":"webpack -c webpack.config.js","build":"yarn lint && webpack -c webpack.config.js","test":"jest","coverage":"jest --coverage","workflow":"jest --coverage --json --outputFile=/home/runner/work/room-card/room-card/jest.results.json","prebuild":"copy git-hooks\\\\pre-commit .git\\\\hooks\\\\ && echo \'hook copied\'"}}')}},e={};function i(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,i),o.exports}i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(148)})(); \ No newline at end of file diff --git a/room-card.js.gz b/room-card.js.gz index 58988bc..f79d7bc 100644 Binary files a/room-card.js.gz and b/room-card.js.gz differ diff --git a/src/entity.ts b/src/entity.ts index ea034ce..9daaf08 100644 --- a/src/entity.ts +++ b/src/entity.ts @@ -123,6 +123,7 @@ export const renderIcon = (stateObj: HomeAssistantEntity, config: RoomCardEntity return html` { const result = renderEntitiesRow(config, entities, hass, element); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
Test Entity
'); + expect(htmlResult).toMatch('
Test Entity
'); }), test('Passing entities and classes should return entities-row with one child element', () => { @@ -64,6 +64,6 @@ describe('Testing entity file function renderEntitiesRow', () => { const result = renderEntitiesRow(config, entities, hass, element, 'test-class'); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
Test Entity
'); + expect(htmlResult).toMatch('
Test Entity
'); }) }) \ No newline at end of file diff --git a/tests/entity/renderEntity.test.ts b/tests/entity/renderEntity.test.ts index d745906..90eb5d7 100644 --- a/tests/entity/renderEntity.test.ts +++ b/tests/entity/renderEntity.test.ts @@ -30,7 +30,7 @@ describe('Testing entity file function renderEntity', () => { const result = renderEntity(entity, hass, element); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
'); + expect(htmlResult).toMatch('
'); }), test('Passing entity show_state false and show_name false should return expected html', () => { @@ -43,7 +43,7 @@ describe('Testing entity file function renderEntity', () => { const result = renderEntity(entity, hass, element); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
'); + expect(htmlResult).toMatch('
'); }), test('Passing entity show_state false and show_name true should return expected html', () => { @@ -56,7 +56,7 @@ describe('Testing entity file function renderEntity', () => { const result = renderEntity(entity, hass, element); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
Test Entity
'); + expect(htmlResult).toMatch('
Test Entity
'); }), test('Passing entity show_state and show_name false should return expected html', () => { @@ -69,7 +69,7 @@ describe('Testing entity file function renderEntity', () => { const result = renderEntity(entity, hass, element); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
on
'); + expect(htmlResult).toMatch('
on
'); }), test('Passing entity show_state and show_name should return expected html', () => { @@ -82,7 +82,7 @@ describe('Testing entity file function renderEntity', () => { const result = renderEntity(entity, hass, element); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
Test Entity
on
'); + expect(htmlResult).toMatch('
Test Entity
on
'); }), test('Passing entity to be hidden should return null', () => { @@ -116,7 +116,7 @@ describe('Testing entity file function renderEntity', () => { const result = renderEntity(entity, hass, element); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
'); + expect(htmlResult).toMatch('
'); }), test.each` format | state | expected @@ -148,7 +148,7 @@ describe('Testing entity file function renderEntity', () => { const result = renderEntity(entity, hass, element); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch(`
${expected}
`); + expect(htmlResult).toMatch(`
${expected}
`); }), test('Mouseclick should trigger action', () => { diff --git a/tests/entity/renderIcon.test.ts b/tests/entity/renderIcon.test.ts index f784da9..5598cd3 100644 --- a/tests/entity/renderIcon.test.ts +++ b/tests/entity/renderIcon.test.ts @@ -29,7 +29,7 @@ describe('Testing entity file function renderIcon', () => { const result = renderIcon(stateObj, config, hass); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch(''); + expect(htmlResult).toMatch(''); }), test('Passing HomeAssistantEntity, RoomCardConfig and HomeAssistant with show_icon should render nothing', async () => { @@ -56,7 +56,7 @@ describe('Testing entity file function renderIcon', () => { const result = renderIcon(stateObj, config, hass); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch(''); + expect(htmlResult).toMatch(''); }), test('Passing HomeAssistantEntity, RoomCardConfig and HomeAssistant state_on/state_off should render state_on icon', async () => { @@ -74,7 +74,7 @@ describe('Testing entity file function renderIcon', () => { const result = renderIcon(stateObj, config, hass); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch(''); + expect(htmlResult).toMatch(''); }), test('Passing HomeAssistantEntity, RoomCardConfig and HomeAssistant and class should render css class', async () => { @@ -87,7 +87,7 @@ describe('Testing entity file function renderIcon', () => { const result = renderIcon(stateObj, config, hass, 'main-icon'); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch(''); + expect(htmlResult).toMatch(''); }), test.each` state | condition | value | icon | expected @@ -117,7 +117,7 @@ describe('Testing entity file function renderIcon', () => { const result = renderIcon(stateObj, config, hass); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch(``); + expect(htmlResult).toMatch(``); }), test('Passing HomeAssistantEntity, RoomCardConfig and HomeAssistant and styles should render styles', async () => { @@ -142,7 +142,7 @@ describe('Testing entity file function renderIcon', () => { const result = renderIcon(stateObj, config, hass); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch(''); + expect(htmlResult).toMatch(''); }), test('Passing HomeAssistantEntity, RoomCardEntity and HomeAssistant should render main icon', async () => { @@ -154,7 +154,7 @@ describe('Testing entity file function renderIcon', () => { const result = renderIcon(stateObj, entity, hass); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch(''); + expect(htmlResult).toMatch(''); }), test('Passing HomeAssistantEntity, RoomCardEntity and HomeAssistant with show_icon should render nothing', async () => { @@ -179,7 +179,7 @@ describe('Testing entity file function renderIcon', () => { const result = renderIcon(stateObj, entity, hass); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch(''); + expect(htmlResult).toMatch(''); }), test('Passing HomeAssistantEntity, RoomCardEntity and HomeAssistant state_on/state_off should render state_on icon', async () => { @@ -196,7 +196,7 @@ describe('Testing entity file function renderIcon', () => { const result = renderIcon(stateObj, entity, hass); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch(''); + expect(htmlResult).toMatch(''); }), test('Passing HomeAssistantEntity, RoomCardEntity and HomeAssistant and class should render css class', async () => { @@ -208,7 +208,7 @@ describe('Testing entity file function renderIcon', () => { const result = renderIcon(stateObj, entity, hass, 'main-icon'); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch(''); + expect(htmlResult).toMatch(''); }), test.each` state | condition | value | icon | expected @@ -237,7 +237,7 @@ describe('Testing entity file function renderIcon', () => { const result = renderIcon(stateObj, entity, hass); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch(``); + expect(htmlResult).toMatch(``); }), test('Passing HomeAssistantEntity, RoomCardEntity and HomeAssistant and styles should render styles', async () => { @@ -261,7 +261,7 @@ describe('Testing entity file function renderIcon', () => { const result = renderIcon(stateObj, entity, hass); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch(''); + expect(htmlResult).toMatch(''); }), test('Passing config with icon template icon should return expected html', () => { @@ -281,6 +281,6 @@ describe('Testing entity file function renderIcon', () => { const result = renderIcon(stateObj, entity, hass); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch(''); + expect(htmlResult).toMatch(''); }) }); \ No newline at end of file diff --git a/tests/entity/renderInfoEntity.test.ts b/tests/entity/renderInfoEntity.test.ts index dcb4554..dd2320b 100644 --- a/tests/entity/renderInfoEntity.test.ts +++ b/tests/entity/renderInfoEntity.test.ts @@ -76,7 +76,7 @@ describe('Testing entity file function renderInfoEntity', () => { const result = renderInfoEntity(entity, hass, element); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
'); + expect(htmlResult).toMatch('
'); }), test('Mouseclick should trigger action', () => { diff --git a/tests/entity/renderMainEntity.test.ts b/tests/entity/renderMainEntity.test.ts index 70d35d3..16f18cb 100644 --- a/tests/entity/renderMainEntity.test.ts +++ b/tests/entity/renderMainEntity.test.ts @@ -72,7 +72,7 @@ describe('Testing entity file function renderMainEntity', () => { const result = renderMainEntity(entity, config, hass); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
'); + expect(htmlResult).toMatch('
'); }), test('Passing RoomCardEntity with icon, RoomcardConfig, HomeAssistant and LitElement with icon expected html with icon', () => { @@ -91,7 +91,7 @@ describe('Testing entity file function renderMainEntity', () => { const result = renderMainEntity(entity, config, hass); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
'); + expect(htmlResult).toMatch('
'); }), test('Passing RoomCardEntity, RoomcardConfig, HomeAssistant and LitElement with empty entities', () => { @@ -110,6 +110,6 @@ describe('Testing entity file function renderMainEntity', () => { const result = renderMainEntity(entity, config, hass); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
'); + expect(htmlResult).toMatch('
'); }) }); \ No newline at end of file diff --git a/tests/entity/renderTitle.test.ts b/tests/entity/renderTitle.test.ts index 495baa8..a1e409a 100644 --- a/tests/entity/renderTitle.test.ts +++ b/tests/entity/renderTitle.test.ts @@ -44,7 +44,7 @@ describe('Testing entity file function renderValue', () => { const result = renderTitle(config, hass, element, entity); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
'); + expect(htmlResult).toMatch('
'); }), test('Passing no RoomCardEntity, RoomcardConfig, HomeAssistant and LitElement should return expected html', () => { @@ -78,7 +78,7 @@ describe('Testing entity file function renderValue', () => { const result = renderTitle(config, hass, element, entity); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
'); + expect(htmlResult).toMatch('
'); }), test.each` state | expected @@ -106,7 +106,7 @@ describe('Testing entity file function renderValue', () => { const result = renderTitle(config, hass, element, entity); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch(`
${expected}
`); + expect(htmlResult).toMatch(`
${expected}
`); }), test('Mouseclick should trigger action', () => { diff --git a/tests/entity/renderValue.test.ts b/tests/entity/renderValue.test.ts index dca7860..3a9f82b 100644 --- a/tests/entity/renderValue.test.ts +++ b/tests/entity/renderValue.test.ts @@ -38,7 +38,7 @@ describe('Testing entity file function renderValue', () => { const result = renderValue(entity, hass) const htmlResult = getRenderString(result); - expect(htmlResult).toMatch(''); + expect(htmlResult).toMatch(''); }), test.each` attribute diff --git a/tests/index.test.ts b/tests/index.test.ts index 33c136b..1a70b7b 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -47,7 +47,7 @@ describe('Testing index file class RoomCard', () => { const result = roomcard.render(); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
test_entity2
'); + expect(htmlResult).toMatch('
test_entity2
'); }), test('Calling setconfig should set config', () => { @@ -197,7 +197,7 @@ describe('Testing index file class RoomCard', () => { const result = roomcard.render(); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
test_entity2
'); + expect(htmlResult).toMatch('
test_entity2
'); }), test('Calling render with only entities and title should return expected html', () => { @@ -216,7 +216,7 @@ describe('Testing index file class RoomCard', () => { const result = roomcard.render(); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
Test title
test_entity2
'); + expect(htmlResult).toMatch('
Test title
test_entity2
'); }), test('Calling render with only info_entities and title should return expected html', () => { @@ -235,7 +235,7 @@ describe('Testing index file class RoomCard', () => { const result = roomcard.render(); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
Test title
on
'); + expect(htmlResult).toMatch('
Test title
on
'); }), test('Calling render with only rows and title should return expected html', () => { @@ -260,7 +260,7 @@ describe('Testing index file class RoomCard', () => { const result = roomcard.render(); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
Test title
test_entity2
test_entity3
'); + expect(htmlResult).toMatch('
Test title
test_entity2
test_entity3
'); }), test('Calling render with only rows without entities and title should return expected html', () => { @@ -280,7 +280,7 @@ describe('Testing index file class RoomCard', () => { const result = roomcard.render(); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
Test title
'); + expect(htmlResult).toMatch('
Test title
'); }), test('Calling render with entities, info_entities and title should return expected html', () => { @@ -302,7 +302,7 @@ describe('Testing index file class RoomCard', () => { const result = roomcard.render(); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
Test title
on
on
test_entity2
test_entity3
'); + expect(htmlResult).toMatch('
Test title
on
on
test_entity2
test_entity3
'); }), test('Calling render with entities, info_entities and rows title, rows should override and should return expected html', () => { @@ -330,7 +330,7 @@ describe('Testing index file class RoomCard', () => { const result = roomcard.render(); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
Test title
on
on
row_test_entity2
row_test_entity3
'); + expect(htmlResult).toMatch('
Test title
on
on
row_test_entity2
row_test_entity3
'); }), test('Calling getCardSize should return 2', () => { @@ -542,6 +542,6 @@ describe('Testing index file class RoomCard', () => { const result = roomcard.render(); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
Test title
'); + expect(htmlResult).toMatch('
Test title
'); }) }) \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index ce706bc..0ce3582 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -24,6 +24,12 @@ module.exports = { }, }, }, + { + test: /\.(js|jsx|ts|tsx)$/, + use: [ + { loader: 'minify-html-literals-loader' } + ], + }, { test: /\.tsx?$/, loader: "ts-loader" } ], },